@aeolus-fleet/common 0.6.0 → 0.8.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 +2 -1
- package/dist/fleet/index.js +1 -0
- package/dist/fleet/index.js.map +1 -1
- package/dist/schemas/console.d.ts +35 -0
- package/dist/schemas/console.js +18 -0
- package/dist/schemas/console.js.map +1 -1
- package/dist/schemas/fleet.d.ts +43 -1
- package/dist/schemas/fleet.js +32 -3
- package/dist/schemas/fleet.js.map +1 -1
- package/dist/schemas/history.d.ts +14 -0
- package/dist/schemas/history.js +7 -1
- package/dist/schemas/history.js.map +1 -1
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/ping.d.ts +37 -0
- package/dist/schemas/ping.js +34 -0
- package/dist/schemas/ping.js.map +1 -0
- package/package.json +1 -1
package/dist/fleet/index.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ export declare const deliveryStateSchema: z.ZodEnum<{
|
|
|
63
63
|
}>;
|
|
64
64
|
export type DeliveryState = z.infer<typeof deliveryStateSchema>;
|
|
65
65
|
/** The event types written so far. Each later slice adds the ones it writes. */
|
|
66
|
-
export declare const EVENT_TYPES: readonly ["FleetInitialised", "ShipCommissioned", "ShipClaimed", "LeaseRevoked", "CredentialRevoked", "StartingPromptIssued", "OperatorPasswordReset", "MessageAccepted", "DeliveryClaimed", "DeliveryAcknowledged", "DeliveryUndeliverable", "DeliveryReturned", "ShipRetired", "DeliveryAbandoned", "DeliveryDismissed"];
|
|
66
|
+
export declare const EVENT_TYPES: readonly ["FleetInitialised", "ShipCommissioned", "ShipClaimed", "LeaseRevoked", "CredentialRevoked", "StartingPromptIssued", "OperatorPasswordReset", "MessageAccepted", "DeliveryClaimed", "DeliveryAcknowledged", "DeliveryUndeliverable", "DeliveryReturned", "ShipRetired", "DeliveryAbandoned", "DeliveryDismissed", "ShipRenamed"];
|
|
67
67
|
export declare const eventTypeSchema: z.ZodEnum<{
|
|
68
68
|
FleetInitialised: "FleetInitialised";
|
|
69
69
|
ShipCommissioned: "ShipCommissioned";
|
|
@@ -80,5 +80,6 @@ export declare const eventTypeSchema: z.ZodEnum<{
|
|
|
80
80
|
ShipRetired: "ShipRetired";
|
|
81
81
|
DeliveryAbandoned: "DeliveryAbandoned";
|
|
82
82
|
DeliveryDismissed: "DeliveryDismissed";
|
|
83
|
+
ShipRenamed: "ShipRenamed";
|
|
83
84
|
}>;
|
|
84
85
|
export type EventType = z.infer<typeof eventTypeSchema>;
|
package/dist/fleet/index.js
CHANGED
package/dist/fleet/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fleet/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAEH,gGAAgG;AAChG,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,eAAe,EAAE,kBAAkB,EAAE,YAAY,EAAE,cAAc,CAAU,CAAC;AACnG,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAG1C,4FAA4F;AAC5F,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,UAAU,EAAE,OAAO,CAAU,CAAC;AACzD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAGjD,kFAAkF;AAClF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AAC9E,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAGzD;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,cAAc,EAAE,QAAQ,EAAE,SAAS,CAAU,C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
21
|
export type SignInInput = z.infer<typeof signInInputSchema>;
|
|
22
|
+
/** The console's theme, per operator account: Light, Dark, or System (the browser's setting), the default. */
|
|
23
|
+
export declare const THEMES: readonly ["light", "dark", "system"];
|
|
24
|
+
export declare const themeSchema: z.ZodEnum<{
|
|
25
|
+
light: "light";
|
|
26
|
+
dark: "dark";
|
|
27
|
+
system: "system";
|
|
28
|
+
}>;
|
|
29
|
+
export type Theme = z.infer<typeof themeSchema>;
|
|
30
|
+
/**
|
|
31
|
+
* Output of `console.account`: the signed-in operator, their theme, and this
|
|
32
|
+
* console session: the device it signed in from and since when.
|
|
33
|
+
*/
|
|
34
|
+
export declare const accountOutputSchema: z.ZodObject<{
|
|
35
|
+
email: z.ZodString;
|
|
36
|
+
theme: z.ZodEnum<{
|
|
37
|
+
light: "light";
|
|
38
|
+
dark: "dark";
|
|
39
|
+
system: "system";
|
|
40
|
+
}>;
|
|
41
|
+
session: z.ZodObject<{
|
|
42
|
+
device: z.ZodString;
|
|
43
|
+
since: z.ZodISODateTime;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
export type Account = z.infer<typeof accountOutputSchema>;
|
|
47
|
+
/** Input of `console.setTheme`. */
|
|
48
|
+
export declare const setThemeInputSchema: z.ZodObject<{
|
|
49
|
+
theme: z.ZodEnum<{
|
|
50
|
+
light: "light";
|
|
51
|
+
dark: "dark";
|
|
52
|
+
system: "system";
|
|
53
|
+
}>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
/** Output of `console.setTheme`: nothing; the OK is the answer. */
|
|
56
|
+
export declare const setThemeOutputSchema: z.ZodObject<{}, z.core.$strict>;
|
package/dist/schemas/console.js
CHANGED
|
@@ -18,4 +18,22 @@ export const signInInputSchema = z.object({
|
|
|
18
18
|
email: z.string().trim().min(1, 'Enter your email').max(OPERATOR_EMAIL_MAX_LENGTH),
|
|
19
19
|
password: z.string().min(1, 'Enter your password').max(OPERATOR_PASSWORD_MAX_LENGTH),
|
|
20
20
|
});
|
|
21
|
+
/** The console's theme, per operator account: Light, Dark, or System (the browser's setting), the default. */
|
|
22
|
+
export const THEMES = ['light', 'dark', 'system'];
|
|
23
|
+
export const themeSchema = z.enum(THEMES);
|
|
24
|
+
/** ISO 8601 in UTC. */
|
|
25
|
+
const isoTime = z.iso.datetime();
|
|
26
|
+
/**
|
|
27
|
+
* Output of `console.account`: the signed-in operator, their theme, and this
|
|
28
|
+
* console session: the device it signed in from and since when.
|
|
29
|
+
*/
|
|
30
|
+
export const accountOutputSchema = z.object({
|
|
31
|
+
email: z.string(),
|
|
32
|
+
theme: themeSchema,
|
|
33
|
+
session: z.object({ device: z.string(), since: isoTime }),
|
|
34
|
+
});
|
|
35
|
+
/** Input of `console.setTheme`. */
|
|
36
|
+
export const setThemeInputSchema = z.object({ theme: themeSchema });
|
|
37
|
+
/** Output of `console.setTheme`: nothing; the OK is the answer. */
|
|
38
|
+
export const setThemeOutputSchema = z.strictObject({});
|
|
21
39
|
//# sourceMappingURL=console.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.js","sourceRoot":"","sources":["../../src/schemas/console.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,sFAAsF;AACtF,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAC7C,4DAA4D;AAC5D,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAC1D;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC,GAAG,CAAC,yBAAyB,CAAC;IAClF,QAAQ,EAAE,CAAC,CAA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,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;CAC1D,CAAC,CAAC;AAIH,mCAAmC;AACnC,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;AAEpE,mEAAmE;AACnE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC"}
|
package/dist/schemas/fleet.d.ts
CHANGED
|
@@ -3,7 +3,11 @@ import { z } from 'zod';
|
|
|
3
3
|
* Inputs and outputs of the fleet procedures: commission a ship, get its
|
|
4
4
|
* starting prompt, release it, list the fleet, follow its events live.
|
|
5
5
|
*/
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* A ship's name and its type are handles (docs/blueprint.md, "Ship"). A colon
|
|
8
|
+
* is an ordinary character, so a prefix can group ships (`hemma:planner`); it
|
|
9
|
+
* carries no meaning for the fleet.
|
|
10
|
+
*/
|
|
7
11
|
export declare const SHIP_HANDLE_MAX_LENGTH = 48;
|
|
8
12
|
export declare const SHIP_HANDLE_PATTERN: RegExp;
|
|
9
13
|
export declare const shipHandleSchema: z.ZodString;
|
|
@@ -38,6 +42,13 @@ export declare const releaseShipInputSchema: z.ZodObject<{
|
|
|
38
42
|
export type ReleaseShipInput = z.infer<typeof releaseShipInputSchema>;
|
|
39
43
|
/** Output of `fleet.release`: nothing; the OK is the answer. */
|
|
40
44
|
export declare const releaseShipOutputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
45
|
+
/** Input of `fleet.rename`: the ship and its new name, a handle as at commissioning. Never argo or a retired ship. */
|
|
46
|
+
export declare const renameShipInputSchema: z.ZodObject<{
|
|
47
|
+
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
48
|
+
name: z.ZodString;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
/** Output of `fleet.rename`: nothing; the OK is the answer. */
|
|
51
|
+
export declare const renameShipOutputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
41
52
|
/** Input of `fleet.retire`: the ship to end for good. Never argo. */
|
|
42
53
|
export declare const retireShipInputSchema: z.ZodObject<{
|
|
43
54
|
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
@@ -53,11 +64,20 @@ export declare const retireShipOutputSchema: z.ZodObject<{
|
|
|
53
64
|
export declare const recrewShipInputSchema: z.ZodObject<{
|
|
54
65
|
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
55
66
|
}, z.core.$strip>;
|
|
67
|
+
/** How a ship's last ping stands: waiting for an answer, answered with pong, or received with a plain ack. */
|
|
68
|
+
export declare const PING_STATES: readonly ["waiting", "answered", "received"];
|
|
69
|
+
export declare const pingStateSchema: z.ZodEnum<{
|
|
70
|
+
waiting: "waiting";
|
|
71
|
+
answered: "answered";
|
|
72
|
+
received: "received";
|
|
73
|
+
}>;
|
|
74
|
+
export type PingState = z.infer<typeof pingStateSchema>;
|
|
56
75
|
/**
|
|
57
76
|
* One ship in `fleet.list`. `startingPrompt` is the prompt holding the ship's
|
|
58
77
|
* valid secret, when there is one: when it was issued and whether a session
|
|
59
78
|
* has claimed the ship with it. `location` is where the session crewing the
|
|
60
79
|
* ship runs, as it reported on claim; null while no session crews it.
|
|
80
|
+
* `lastSeenAt` is its session's last call.
|
|
61
81
|
*/
|
|
62
82
|
export declare const listedShipSchema: z.ZodObject<{
|
|
63
83
|
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
@@ -85,6 +105,16 @@ export declare const listedShipSchema: z.ZodObject<{
|
|
|
85
105
|
}>;
|
|
86
106
|
description: z.ZodNullable<z.ZodString>;
|
|
87
107
|
}, z.core.$strip>>;
|
|
108
|
+
lastSeenAt: z.ZodNullable<z.ZodISODateTime>;
|
|
109
|
+
ping: z.ZodNullable<z.ZodObject<{
|
|
110
|
+
state: z.ZodEnum<{
|
|
111
|
+
waiting: "waiting";
|
|
112
|
+
answered: "answered";
|
|
113
|
+
received: "received";
|
|
114
|
+
}>;
|
|
115
|
+
sentAt: z.ZodISODateTime;
|
|
116
|
+
answeredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
117
|
+
}, z.core.$strip>>;
|
|
88
118
|
}, z.core.$strip>;
|
|
89
119
|
export type ListedShip = z.infer<typeof listedShipSchema>;
|
|
90
120
|
/** Output of `fleet.list`: every ship in the caller's fleet, `argo` included. */
|
|
@@ -114,6 +144,16 @@ export declare const fleetListOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
114
144
|
}>;
|
|
115
145
|
description: z.ZodNullable<z.ZodString>;
|
|
116
146
|
}, z.core.$strip>>;
|
|
147
|
+
lastSeenAt: z.ZodNullable<z.ZodISODateTime>;
|
|
148
|
+
ping: z.ZodNullable<z.ZodObject<{
|
|
149
|
+
state: z.ZodEnum<{
|
|
150
|
+
waiting: "waiting";
|
|
151
|
+
answered: "answered";
|
|
152
|
+
received: "received";
|
|
153
|
+
}>;
|
|
154
|
+
sentAt: z.ZodISODateTime;
|
|
155
|
+
answeredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
156
|
+
}, z.core.$strip>>;
|
|
117
157
|
}, z.core.$strip>>;
|
|
118
158
|
/**
|
|
119
159
|
* Input of the `fleet.events` subscription: the number of the last event the
|
|
@@ -149,6 +189,7 @@ export declare const liveFleetEventSchema: z.ZodObject<{
|
|
|
149
189
|
ShipRetired: "ShipRetired";
|
|
150
190
|
DeliveryAbandoned: "DeliveryAbandoned";
|
|
151
191
|
DeliveryDismissed: "DeliveryDismissed";
|
|
192
|
+
ShipRenamed: "ShipRenamed";
|
|
152
193
|
}>;
|
|
153
194
|
occurredAt: z.ZodISODateTime;
|
|
154
195
|
actorShipId: z.ZodNullable<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>;
|
|
@@ -182,6 +223,7 @@ export declare const fleetStreamItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
182
223
|
ShipRetired: "ShipRetired";
|
|
183
224
|
DeliveryAbandoned: "DeliveryAbandoned";
|
|
184
225
|
DeliveryDismissed: "DeliveryDismissed";
|
|
226
|
+
ShipRenamed: "ShipRenamed";
|
|
185
227
|
}>;
|
|
186
228
|
occurredAt: z.ZodISODateTime;
|
|
187
229
|
actorShipId: z.ZodNullable<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>;
|
package/dist/schemas/fleet.js
CHANGED
|
@@ -5,10 +5,14 @@ import { idSchema } from '../ids/index.js';
|
|
|
5
5
|
* Inputs and outputs of the fleet procedures: commission a ship, get its
|
|
6
6
|
* starting prompt, release it, list the fleet, follow its events live.
|
|
7
7
|
*/
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* A ship's name and its type are handles (docs/blueprint.md, "Ship"). A colon
|
|
10
|
+
* is an ordinary character, so a prefix can group ships (`hemma:planner`); it
|
|
11
|
+
* carries no meaning for the fleet.
|
|
12
|
+
*/
|
|
9
13
|
export const SHIP_HANDLE_MAX_LENGTH = 48;
|
|
10
|
-
export const SHIP_HANDLE_PATTERN = /^[a-z0-9
|
|
11
|
-
const HANDLE_MESSAGE = `Use 1 to ${SHIP_HANDLE_MAX_LENGTH} lowercase letters, digits or
|
|
14
|
+
export const SHIP_HANDLE_PATTERN = /^[a-z0-9:-]+$/;
|
|
15
|
+
const HANDLE_MESSAGE = `Use 1 to ${SHIP_HANDLE_MAX_LENGTH} lowercase letters, digits, hyphens or colons`;
|
|
12
16
|
export const shipHandleSchema = z
|
|
13
17
|
.string()
|
|
14
18
|
.max(SHIP_HANDLE_MAX_LENGTH, HANDLE_MESSAGE)
|
|
@@ -42,6 +46,10 @@ export const startingPromptOutputSchema = z.object({
|
|
|
42
46
|
export const releaseShipInputSchema = z.object({ shipId: idSchema('ship') });
|
|
43
47
|
/** Output of `fleet.release`: nothing; the OK is the answer. */
|
|
44
48
|
export const releaseShipOutputSchema = z.strictObject({});
|
|
49
|
+
/** Input of `fleet.rename`: the ship and its new name, a handle as at commissioning. Never argo or a retired ship. */
|
|
50
|
+
export const renameShipInputSchema = z.object({ shipId: idSchema('ship'), name: shipHandleSchema });
|
|
51
|
+
/** Output of `fleet.rename`: nothing; the OK is the answer. */
|
|
52
|
+
export const renameShipOutputSchema = z.strictObject({});
|
|
45
53
|
/** Input of `fleet.retire`: the ship to end for good. Never argo. */
|
|
46
54
|
export const retireShipInputSchema = z.object({ shipId: idSchema('ship') });
|
|
47
55
|
/** Output of `fleet.retire`: how many of its direct deliveries it abandoned. */
|
|
@@ -51,11 +59,15 @@ export const retireShipOutputSchema = z.object({ abandonedDeliveries: z.int().mi
|
|
|
51
59
|
* a new starting prompt, as from `fleet.getStartingPrompt`.
|
|
52
60
|
*/
|
|
53
61
|
export const recrewShipInputSchema = z.object({ shipId: idSchema('ship') });
|
|
62
|
+
/** How a ship's last ping stands: waiting for an answer, answered with pong, or received with a plain ack. */
|
|
63
|
+
export const PING_STATES = ['waiting', 'answered', 'received'];
|
|
64
|
+
export const pingStateSchema = z.enum(PING_STATES);
|
|
54
65
|
/**
|
|
55
66
|
* One ship in `fleet.list`. `startingPrompt` is the prompt holding the ship's
|
|
56
67
|
* valid secret, when there is one: when it was issued and whether a session
|
|
57
68
|
* has claimed the ship with it. `location` is where the session crewing the
|
|
58
69
|
* ship runs, as it reported on claim; null while no session crews it.
|
|
70
|
+
* `lastSeenAt` is its session's last call.
|
|
59
71
|
*/
|
|
60
72
|
export const listedShipSchema = z.object({
|
|
61
73
|
id: idSchema('ship'),
|
|
@@ -78,6 +90,23 @@ export const listedShipSchema = z.object({
|
|
|
78
90
|
description: z.string().nullable(),
|
|
79
91
|
})
|
|
80
92
|
.nullable(),
|
|
93
|
+
/**
|
|
94
|
+
* When the session crewing the ship last called the fleet (ISO 8601 in UTC):
|
|
95
|
+
* observation only, nothing acts on it. Null while no session crews it.
|
|
96
|
+
*/
|
|
97
|
+
lastSeenAt: z.iso.datetime().nullable(),
|
|
98
|
+
/**
|
|
99
|
+
* The ship's last ping (ISO 8601 in UTC): when argo sent it, how it stands,
|
|
100
|
+
* and when pong answered it. Null before any ping, or when the last one went
|
|
101
|
+
* undeliverable. Observation only.
|
|
102
|
+
*/
|
|
103
|
+
ping: z
|
|
104
|
+
.object({
|
|
105
|
+
state: pingStateSchema,
|
|
106
|
+
sentAt: z.iso.datetime(),
|
|
107
|
+
answeredAt: z.iso.datetime().nullable(),
|
|
108
|
+
})
|
|
109
|
+
.nullable(),
|
|
81
110
|
});
|
|
82
111
|
/** Output of `fleet.list`: every ship in the caller's fleet, `argo` included. */
|
|
83
112
|
export const fleetListOutputSchema = z.array(listedShipSchema);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fleet.js","sourceRoot":"","sources":["../../src/schemas/fleet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1G,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;GAGG;AAEH
|
|
1
|
+
{"version":3,"file":"fleet.js","sourceRoot":"","sources":["../../src/schemas/fleet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1G,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;GAGG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,EA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U,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IAC5B,oDAAoD;IACpD,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;IACxC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;IACnC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE;IACzC,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAChE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC;IACnE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;CACxC,CAAC,CAAC"}
|
|
@@ -52,6 +52,16 @@ export declare const shipDetailOutputSchema: z.ZodObject<{
|
|
|
52
52
|
}>;
|
|
53
53
|
description: z.ZodNullable<z.ZodString>;
|
|
54
54
|
}, z.core.$strip>>;
|
|
55
|
+
lastSeenAt: z.ZodNullable<z.ZodISODateTime>;
|
|
56
|
+
ping: z.ZodNullable<z.ZodObject<{
|
|
57
|
+
state: z.ZodEnum<{
|
|
58
|
+
waiting: "waiting";
|
|
59
|
+
answered: "answered";
|
|
60
|
+
received: "received";
|
|
61
|
+
}>;
|
|
62
|
+
sentAt: z.ZodISODateTime;
|
|
63
|
+
answeredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
55
65
|
commissionedAt: z.ZodISODateTime;
|
|
56
66
|
crewedSince: z.ZodNullable<z.ZodISODateTime>;
|
|
57
67
|
retiredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
@@ -79,6 +89,7 @@ export declare const timelineEntrySchema: z.ZodObject<{
|
|
|
79
89
|
ShipRetired: "ShipRetired";
|
|
80
90
|
DeliveryAbandoned: "DeliveryAbandoned";
|
|
81
91
|
DeliveryDismissed: "DeliveryDismissed";
|
|
92
|
+
ShipRenamed: "ShipRenamed";
|
|
82
93
|
}>;
|
|
83
94
|
occurredAt: z.ZodISODateTime;
|
|
84
95
|
actor: z.ZodNullable<z.ZodObject<{
|
|
@@ -105,6 +116,7 @@ export declare const timelineEntrySchema: z.ZodObject<{
|
|
|
105
116
|
kind: z.ZodLiteral<"type">;
|
|
106
117
|
type: z.ZodString;
|
|
107
118
|
}, z.core.$strip>], "kind">;
|
|
119
|
+
contentType: z.ZodString;
|
|
108
120
|
}, z.core.$strip>>;
|
|
109
121
|
details: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
110
122
|
}, z.core.$strip>;
|
|
@@ -129,6 +141,7 @@ export declare const shipTimelineOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
129
141
|
ShipRetired: "ShipRetired";
|
|
130
142
|
DeliveryAbandoned: "DeliveryAbandoned";
|
|
131
143
|
DeliveryDismissed: "DeliveryDismissed";
|
|
144
|
+
ShipRenamed: "ShipRenamed";
|
|
132
145
|
}>;
|
|
133
146
|
occurredAt: z.ZodISODateTime;
|
|
134
147
|
actor: z.ZodNullable<z.ZodObject<{
|
|
@@ -155,6 +168,7 @@ export declare const shipTimelineOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
155
168
|
kind: z.ZodLiteral<"type">;
|
|
156
169
|
type: z.ZodString;
|
|
157
170
|
}, z.core.$strip>], "kind">;
|
|
171
|
+
contentType: z.ZodString;
|
|
158
172
|
}, z.core.$strip>>;
|
|
159
173
|
details: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
160
174
|
}, z.core.$strip>>;
|
package/dist/schemas/history.js
CHANGED
|
@@ -44,7 +44,13 @@ export const timelineEntrySchema = z.object({
|
|
|
44
44
|
ship: partySchema.nullable(),
|
|
45
45
|
/** The message it concerns, with its sender and recipient. */
|
|
46
46
|
message: z
|
|
47
|
-
.object({
|
|
47
|
+
.object({
|
|
48
|
+
id: idSchema('message'),
|
|
49
|
+
sender: partySchema,
|
|
50
|
+
recipient: messageRecipientSchema,
|
|
51
|
+
/** As the sender gave it; a ping has the reserved ping content type. */
|
|
52
|
+
contentType: z.string(),
|
|
53
|
+
})
|
|
48
54
|
.nullable(),
|
|
49
55
|
details: z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), z.null()])),
|
|
50
56
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/schemas/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;GAIG;AAEH,uBAAuB;AACvB,MAAM,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;AAEjC,2FAA2F;AAC3F,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAIhF,uEAAuE;AACvE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACjE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAA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E,kBAAkB,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC/F,+DAA+D;IAC/D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;CACpD,CAAC,CAAC;AAIH,4GAA4G;AAC5G,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;IACpG,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC;QACjB,EAAE,EAAE,QAAQ,CAAC,UAAU,CAAC;QACxB,KAAK,EAAE,mBAAmB;QAC1B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;QACxC,SAAS,EAAE,WAAW,CAAC,QAAQ,EAAE;QACjC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC;KAC7C,CAAC;CACH,CAAC,CAAC"}
|
package/dist/schemas/index.d.ts
CHANGED
package/dist/schemas/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A ping: a message from argo to one crewed ship that its session answers
|
|
4
|
+
* with pong, proving the ship's model is working, not only its process. It
|
|
5
|
+
* travels as any message does, told apart by this reserved content type,
|
|
6
|
+
* which only the ping call sends.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PING_CONTENT_TYPE = "application/vnd.aeolus.ping";
|
|
9
|
+
/**
|
|
10
|
+
* Whether a content type is the ping's: media types compare without case and
|
|
11
|
+
* without their parameters (RFC 9110), so no spelling of it slips past.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isPingContentType(contentType: string): boolean;
|
|
14
|
+
/** Input of `fleet.ping`: the crewed ship to ping. */
|
|
15
|
+
export declare const pingShipInputSchema: z.ZodObject<{
|
|
16
|
+
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type PingShipInput = z.infer<typeof pingShipInputSchema>;
|
|
19
|
+
/**
|
|
20
|
+
* Output of `fleet.ping`: the ship's open ping, when it was sent, and whether
|
|
21
|
+
* this call sent it. Pings never stack: while one is unanswered, ping answers
|
|
22
|
+
* with that one.
|
|
23
|
+
*/
|
|
24
|
+
export declare const pingShipOutputSchema: z.ZodObject<{
|
|
25
|
+
messageId: z.ZodType<`msg_${string}`, unknown, z.core.$ZodTypeInternals<`msg_${string}`, unknown>>;
|
|
26
|
+
sentAt: z.ZodISODateTime;
|
|
27
|
+
isNew: z.ZodBoolean;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export type PingShipOutput = z.infer<typeof pingShipOutputSchema>;
|
|
30
|
+
/** Input of `pong`: the ping delivery the ship answers. */
|
|
31
|
+
export declare const pongInputSchema: z.ZodObject<{
|
|
32
|
+
deliveryId: z.ZodType<`dlv_${string}`, unknown, z.core.$ZodTypeInternals<`dlv_${string}`, unknown>>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export type PongInput = z.infer<typeof pongInputSchema>;
|
|
35
|
+
/** Output of `pong`: nothing; the OK is the answer. */
|
|
36
|
+
export declare const pongOutputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
37
|
+
export type PongOutput = z.infer<typeof pongOutputSchema>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { idSchema } from '../ids/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* A ping: a message from argo to one crewed ship that its session answers
|
|
5
|
+
* with pong, proving the ship's model is working, not only its process. It
|
|
6
|
+
* travels as any message does, told apart by this reserved content type,
|
|
7
|
+
* which only the ping call sends.
|
|
8
|
+
*/
|
|
9
|
+
export const PING_CONTENT_TYPE = 'application/vnd.aeolus.ping';
|
|
10
|
+
/**
|
|
11
|
+
* Whether a content type is the ping's: media types compare without case and
|
|
12
|
+
* without their parameters (RFC 9110), so no spelling of it slips past.
|
|
13
|
+
*/
|
|
14
|
+
export function isPingContentType(contentType) {
|
|
15
|
+
const [essence = ''] = contentType.split(';');
|
|
16
|
+
return essence.trim().toLowerCase() === PING_CONTENT_TYPE;
|
|
17
|
+
}
|
|
18
|
+
/** Input of `fleet.ping`: the crewed ship to ping. */
|
|
19
|
+
export const pingShipInputSchema = z.object({ shipId: idSchema('ship') });
|
|
20
|
+
/**
|
|
21
|
+
* Output of `fleet.ping`: the ship's open ping, when it was sent, and whether
|
|
22
|
+
* this call sent it. Pings never stack: while one is unanswered, ping answers
|
|
23
|
+
* with that one.
|
|
24
|
+
*/
|
|
25
|
+
export const pingShipOutputSchema = z.object({
|
|
26
|
+
messageId: idSchema('message'),
|
|
27
|
+
sentAt: z.iso.datetime(),
|
|
28
|
+
isNew: z.boolean(),
|
|
29
|
+
});
|
|
30
|
+
/** Input of `pong`: the ping delivery the ship answers. */
|
|
31
|
+
export const pongInputSchema = z.object({ deliveryId: idSchema('delivery') });
|
|
32
|
+
/** Output of `pong`: nothing; the OK is the answer. */
|
|
33
|
+
export const pongOutputSchema = z.strictObject({});
|
|
34
|
+
//# sourceMappingURL=ping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ping.js","sourceRoot":"","sources":["../../src/schemas/ping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AAE/D;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,WAAmB;IACnD,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9C,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,iBAAiB,CAAC;AAC5D,CAAC;AAED,sDAAsD;AACtD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAI1E;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC9B,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IACxB,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE;CACnB,CAAC,CAAC;AAIH,2DAA2D;AAC3D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;AAI9E,uDAAuD;AACvD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC"}
|