@rise-maritime/keelson-js 0.6.0-alpha.255.dev.1 → 0.6.0-alpha.275.dev.2
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/index.d.ts +83 -8
- package/dist/index.js +23 -1
- package/dist/index.test.js +31 -0
- package/dist/interfaces/AlarmAck.d.ts +2 -2
- package/dist/interfaces/AlarmAck.js +2 -2
- package/dist/interfaces/ContainerControl.d.ts +239 -0
- package/dist/interfaces/ContainerControl.js +1053 -0
- package/dist/interfaces/ContainerHost.d.ts +403 -0
- package/dist/interfaces/ContainerHost.js +1230 -0
- package/dist/interfaces/ErrorResponse.d.ts +7 -2
- package/dist/interfaces/ErrorResponse.js +12 -2
- package/dist/interfaces/Route.d.ts +141 -6
- package/dist/interfaces/Route.js +309 -4
- package/dist/interfaces/RoutePlanner.d.ts +19 -1
- package/dist/interfaces/RoutePlanner.js +23 -1
- package/dist/interfaces/ScenarioControl.d.ts +132 -3
- package/dist/interfaces/ScenarioControl.js +439 -37
- package/dist/interfaces/VehicleNavigation.d.ts +55 -0
- package/dist/interfaces/VehicleNavigation.js +233 -1
- package/dist/interfaces/VehicleSimulatorControl.d.ts +0 -83
- package/dist/interfaces/VehicleSimulatorControl.js +1 -293
- package/dist/interfaces/serviceRegistry.d.ts +84 -8
- package/dist/interfaces/serviceRegistry.js +4 -0
- package/dist/interfaces.json +2 -0
- package/dist/payloads/AdviceDisposition.d.ts +55 -0
- package/dist/payloads/AdviceDisposition.js +242 -0
- package/dist/payloads/ChecklistHandover.d.ts +522 -0
- package/dist/payloads/ChecklistHandover.js +1735 -0
- package/dist/payloads/ContainerHost.d.ts +407 -0
- package/dist/payloads/ContainerHost.js +1245 -0
- package/dist/payloads/Encounter.d.ts +104 -0
- package/dist/payloads/Encounter.js +573 -0
- package/dist/payloads/NavigationAdvice.d.ts +94 -0
- package/dist/payloads/NavigationAdvice.js +596 -0
- package/dist/payloads/NavigationState.d.ts +90 -0
- package/dist/payloads/NavigationState.js +377 -0
- package/dist/payloads/Route.d.ts +142 -6
- package/dist/payloads/Route.js +318 -4
- package/dist/payloads/RouteExecution.d.ts +7 -0
- package/dist/payloads/ScenarioEvent.d.ts +14 -0
- package/dist/payloads/ScenarioEvent.js +16 -0
- package/dist/payloads/index.d.ts +1 -1
- package/dist/payloads/index.js +2 -2
- package/dist/payloads/index.keelson.d.ts +10 -4
- package/dist/payloads/index.keelson.js +10 -4
- package/dist/qos.json +6 -0
- package/dist/subjects.json +20 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import './payloads';
|
|
|
4
4
|
export declare function construct_pubSub_key(base_path: string, entityId: string, subject: string, sourceId: string, targetId?: string): string;
|
|
5
5
|
export declare function construct_rpc_key(base_path: string, entityId: string, iface: string, version: string, procedure: string, sourceId: string): string;
|
|
6
6
|
export declare function construct_source_liveliness_key(base_path: string, entityId: string, sourceId: string): string;
|
|
7
|
+
export declare function construct_pubsub_subject_liveliness_keys(base_path: string, entityId: string, subject: string, sourceId: string, targeted?: boolean): string[];
|
|
7
8
|
export declare function construct_rpc_interface_liveliness_key(base_path: string, entityId: string, iface: string, version: string, sourceId: string): string;
|
|
8
9
|
export interface ParsedPubSubKey {
|
|
9
10
|
base_path: string;
|
|
@@ -23,6 +24,19 @@ export declare function isInterfaceWellKnown(interfaceAndVersion: string): boole
|
|
|
23
24
|
export declare function getInterfaceService(interfaceAndVersion: string): string | undefined;
|
|
24
25
|
export declare function listInterfaces(): string[];
|
|
25
26
|
export declare function getInterfaceDefinition(interfaceAndVersion: string): {
|
|
27
|
+
readonly name: "AlarmAck";
|
|
28
|
+
readonly fullName: "keelson.interfaces.alarm_ack.AlarmAck";
|
|
29
|
+
readonly methods: {
|
|
30
|
+
readonly acknowledge_alarm: {
|
|
31
|
+
readonly name: "acknowledge_alarm";
|
|
32
|
+
readonly requestType: import("./interfaces/AlarmAck").MessageFns<import("./interfaces/AlarmAck").AcknowledgeAlarmRequest>;
|
|
33
|
+
readonly requestStream: false;
|
|
34
|
+
readonly responseType: import("./interfaces/AlarmAck").MessageFns<import("./interfaces/AlarmAck").AcknowledgeAlarmResponse>;
|
|
35
|
+
readonly responseStream: false;
|
|
36
|
+
readonly options: {};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
} | {
|
|
26
40
|
readonly name: "Configurable";
|
|
27
41
|
readonly fullName: "keelson.interfaces.configurable.Configurable";
|
|
28
42
|
readonly methods: {
|
|
@@ -43,6 +57,59 @@ export declare function getInterfaceDefinition(interfaceAndVersion: string): {
|
|
|
43
57
|
readonly options: {};
|
|
44
58
|
};
|
|
45
59
|
};
|
|
60
|
+
} | {
|
|
61
|
+
readonly name: "ContainerControl";
|
|
62
|
+
readonly fullName: "keelson.interfaces.container_control.ContainerControl";
|
|
63
|
+
readonly methods: {
|
|
64
|
+
readonly list: {
|
|
65
|
+
readonly name: "list";
|
|
66
|
+
readonly requestType: import("./interfaces/ContainerControl").MessageFns<import("./interfaces/ContainerControl").ListContainersRequest>;
|
|
67
|
+
readonly requestStream: false;
|
|
68
|
+
readonly responseType: import("./interfaces/ContainerControl").MessageFns<import("./interfaces/ContainerControl").ListContainersResponse>;
|
|
69
|
+
readonly responseStream: false;
|
|
70
|
+
readonly options: {};
|
|
71
|
+
};
|
|
72
|
+
readonly logs: {
|
|
73
|
+
readonly name: "logs";
|
|
74
|
+
readonly requestType: import("./interfaces/ContainerControl").MessageFns<import("./interfaces/ContainerControl").GetLogsRequest>;
|
|
75
|
+
readonly requestStream: false;
|
|
76
|
+
readonly responseType: import("./interfaces/ContainerControl").MessageFns<import("./interfaces/ContainerControl").GetLogsResponse>;
|
|
77
|
+
readonly responseStream: false;
|
|
78
|
+
readonly options: {};
|
|
79
|
+
};
|
|
80
|
+
readonly start: {
|
|
81
|
+
readonly name: "start";
|
|
82
|
+
readonly requestType: import("./interfaces/ContainerControl").MessageFns<import("./interfaces/ContainerControl").StartContainerRequest>;
|
|
83
|
+
readonly requestStream: false;
|
|
84
|
+
readonly responseType: import("./interfaces/ContainerControl").MessageFns<import("./interfaces/ContainerControl").ContainerActionResponse>;
|
|
85
|
+
readonly responseStream: false;
|
|
86
|
+
readonly options: {};
|
|
87
|
+
};
|
|
88
|
+
readonly stop: {
|
|
89
|
+
readonly name: "stop";
|
|
90
|
+
readonly requestType: import("./interfaces/ContainerControl").MessageFns<import("./interfaces/ContainerControl").StopContainerRequest>;
|
|
91
|
+
readonly requestStream: false;
|
|
92
|
+
readonly responseType: import("./interfaces/ContainerControl").MessageFns<import("./interfaces/ContainerControl").ContainerActionResponse>;
|
|
93
|
+
readonly responseStream: false;
|
|
94
|
+
readonly options: {};
|
|
95
|
+
};
|
|
96
|
+
readonly restart: {
|
|
97
|
+
readonly name: "restart";
|
|
98
|
+
readonly requestType: import("./interfaces/ContainerControl").MessageFns<import("./interfaces/ContainerControl").RestartContainerRequest>;
|
|
99
|
+
readonly requestStream: false;
|
|
100
|
+
readonly responseType: import("./interfaces/ContainerControl").MessageFns<import("./interfaces/ContainerControl").ContainerActionResponse>;
|
|
101
|
+
readonly responseStream: false;
|
|
102
|
+
readonly options: {};
|
|
103
|
+
};
|
|
104
|
+
readonly remove: {
|
|
105
|
+
readonly name: "remove";
|
|
106
|
+
readonly requestType: import("./interfaces/ContainerControl").MessageFns<import("./interfaces/ContainerControl").RemoveContainerRequest>;
|
|
107
|
+
readonly requestStream: false;
|
|
108
|
+
readonly responseType: import("./interfaces/ContainerControl").MessageFns<import("./interfaces/ContainerControl").RemoveContainerResponse>;
|
|
109
|
+
readonly responseStream: false;
|
|
110
|
+
readonly options: {};
|
|
111
|
+
};
|
|
112
|
+
};
|
|
46
113
|
} | {
|
|
47
114
|
readonly name: "MavlinkCommand";
|
|
48
115
|
readonly fullName: "keelson.interfaces.mavlink_command.MavlinkCommand";
|
|
@@ -216,6 +283,14 @@ export declare function getInterfaceDefinition(interfaceAndVersion: string): {
|
|
|
216
283
|
readonly name: "ScenarioControl";
|
|
217
284
|
readonly fullName: "keelson.interfaces.scenario_control.ScenarioControl";
|
|
218
285
|
readonly methods: {
|
|
286
|
+
readonly list_scenarios: {
|
|
287
|
+
readonly name: "list_scenarios";
|
|
288
|
+
readonly requestType: import("./interfaces/ScenarioControl").MessageFns<import("./interfaces/ScenarioControl").ListScenariosRequest>;
|
|
289
|
+
readonly requestStream: false;
|
|
290
|
+
readonly responseType: import("./interfaces/ScenarioControl").MessageFns<import("./interfaces/ScenarioControl").ListScenariosResponse>;
|
|
291
|
+
readonly responseStream: false;
|
|
292
|
+
readonly options: {};
|
|
293
|
+
};
|
|
219
294
|
readonly load: {
|
|
220
295
|
readonly name: "load";
|
|
221
296
|
readonly requestType: import("./interfaces/ScenarioControl").MessageFns<import("./interfaces/ScenarioControl").LoadRequest>;
|
|
@@ -451,6 +526,14 @@ export declare function getInterfaceDefinition(interfaceAndVersion: string): {
|
|
|
451
526
|
readonly responseStream: false;
|
|
452
527
|
readonly options: {};
|
|
453
528
|
};
|
|
529
|
+
readonly set_steering_order: {
|
|
530
|
+
readonly name: "set_steering_order";
|
|
531
|
+
readonly requestType: import("./interfaces/VehicleNavigation").MessageFns<import("./interfaces/VehicleNavigation").SetSteeringOrderRequest>;
|
|
532
|
+
readonly requestStream: false;
|
|
533
|
+
readonly responseType: import("./interfaces/VehicleNavigation").MessageFns<import("./interfaces/VehicleNavigation").SetSteeringOrderResponse>;
|
|
534
|
+
readonly responseStream: false;
|
|
535
|
+
readonly options: {};
|
|
536
|
+
};
|
|
454
537
|
};
|
|
455
538
|
} | {
|
|
456
539
|
readonly name: "VehicleParam";
|
|
@@ -509,14 +592,6 @@ export declare function getInterfaceDefinition(interfaceAndVersion: string): {
|
|
|
509
592
|
readonly responseStream: false;
|
|
510
593
|
readonly options: {};
|
|
511
594
|
};
|
|
512
|
-
readonly set_standing_order: {
|
|
513
|
-
readonly name: "set_standing_order";
|
|
514
|
-
readonly requestType: import("./interfaces/VehicleSimulatorControl").MessageFns<import("./interfaces/VehicleSimulatorControl").StandingOrder>;
|
|
515
|
-
readonly requestStream: false;
|
|
516
|
-
readonly responseType: import("./interfaces/VehicleSimulatorControl").MessageFns<import("./interfaces/VehicleSimulatorControl").SetStandingOrderResponse>;
|
|
517
|
-
readonly responseStream: false;
|
|
518
|
-
readonly options: {};
|
|
519
|
-
};
|
|
520
595
|
};
|
|
521
596
|
} | {
|
|
522
597
|
readonly name: "WHEPProxy";
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.encloseFromTypeName = exports.encodePayloadFromTypeName = exports.decodePayloadFromTypeName = exports.getProtobufClassFromTypeName = exports.qosFor = exports.getProcedureCodecs = exports.getProcedures = exports.getInterfaceDefinition = exports.listInterfaces = exports.getInterfaceService = exports.isInterfaceWellKnown = exports.getSubjectSchema = exports.isSubjectWellKnown = exports.uncover = exports.enclose = exports.get_subject_from_pubsub_key = exports.parse_rpc_key = exports.parse_pubsub_key = exports.construct_rpc_interface_liveliness_key = exports.construct_source_liveliness_key = exports.construct_rpc_key = exports.construct_pubSub_key = void 0;
|
|
6
|
+
exports.encloseFromTypeName = exports.encodePayloadFromTypeName = exports.decodePayloadFromTypeName = exports.getProtobufClassFromTypeName = exports.qosFor = exports.getProcedureCodecs = exports.getProcedures = exports.getInterfaceDefinition = exports.listInterfaces = exports.getInterfaceService = exports.isInterfaceWellKnown = exports.getSubjectSchema = exports.isSubjectWellKnown = exports.uncover = exports.enclose = exports.get_subject_from_pubsub_key = exports.parse_rpc_key = exports.parse_pubsub_key = exports.construct_rpc_interface_liveliness_key = exports.construct_pubsub_subject_liveliness_keys = exports.construct_source_liveliness_key = exports.construct_rpc_key = exports.construct_pubSub_key = void 0;
|
|
7
7
|
const Envelope_1 = require("./Envelope");
|
|
8
8
|
const subjects_json_1 = __importDefault(require("./subjects.json"));
|
|
9
9
|
const interfaces_json_1 = __importDefault(require("./interfaces.json"));
|
|
@@ -73,6 +73,28 @@ function construct_source_liveliness_key(base_path, entityId, sourceId) {
|
|
|
73
73
|
return `${base_path}/@v0/${entityId}/*/${sourceId}`;
|
|
74
74
|
}
|
|
75
75
|
exports.construct_source_liveliness_key = construct_source_liveliness_key;
|
|
76
|
+
function construct_pubsub_subject_liveliness_keys(base_path, entityId, subject, sourceId, targeted = false) {
|
|
77
|
+
/**
|
|
78
|
+
* Construct the subject-level liveliness token key(s) for one subject.
|
|
79
|
+
*
|
|
80
|
+
* One key normally. Two for a source that publishes about OTHER
|
|
81
|
+
* entities — an AIS, TAK or track source — the second carrying the
|
|
82
|
+
* bare `@target` chunk. Both are declared, never one: `@target` is a
|
|
83
|
+
* verbatim chunk no wildcard crosses, so a source holding only the
|
|
84
|
+
* target form is invisible to every existing discovery query, while a
|
|
85
|
+
* source holding only the plain form advertises a key it never writes
|
|
86
|
+
* a sample to. See §5.2 of the protocol specification.
|
|
87
|
+
*
|
|
88
|
+
* The target form is the plain key plus `@target`, a strict prefix of
|
|
89
|
+
* every key published about a target, with no target id and no
|
|
90
|
+
* wildcard: a `*` in a declared token acts as a pattern and would
|
|
91
|
+
* answer a query for any concrete target. A target producer commits to
|
|
92
|
+
* subjects, never to a roster of targets, so there is no per-target token.
|
|
93
|
+
*/
|
|
94
|
+
const plain = construct_pubSub_key(base_path, entityId, subject, sourceId);
|
|
95
|
+
return targeted ? [plain, `${plain}/@target`] : [plain];
|
|
96
|
+
}
|
|
97
|
+
exports.construct_pubsub_subject_liveliness_keys = construct_pubsub_subject_liveliness_keys;
|
|
76
98
|
function construct_rpc_interface_liveliness_key(base_path, entityId, iface, version, sourceId) {
|
|
77
99
|
/**
|
|
78
100
|
* Construct the liveliness token key for one served RPC
|
package/dist/index.test.js
CHANGED
|
@@ -216,3 +216,34 @@ describe("interface introspection", () => {
|
|
|
216
216
|
expect(() => getProcedureCodecs("replay_control/v1", "warp")).toThrow();
|
|
217
217
|
});
|
|
218
218
|
});
|
|
219
|
+
describe("construct_pubsub_subject_liveliness_keys", () => {
|
|
220
|
+
it("builds one key for a source publishing about itself", () => {
|
|
221
|
+
expect((0, index_1.construct_pubsub_subject_liveliness_keys)("realm", "boat", "location_fix", "gnss/0"))
|
|
222
|
+
.toStrictEqual(["realm/@v0/boat/pubsub/location_fix/gnss/0"]);
|
|
223
|
+
});
|
|
224
|
+
// Both forms, never one. `@target` is verbatim, so a source holding only
|
|
225
|
+
// the target form is invisible to every existing discovery query, and one
|
|
226
|
+
// holding only the plain form advertises a key it never writes to.
|
|
227
|
+
it("builds both keys for a source publishing about others", () => {
|
|
228
|
+
expect((0, index_1.construct_pubsub_subject_liveliness_keys)("realm", "shore", "location_fix", "ais", true))
|
|
229
|
+
.toStrictEqual([
|
|
230
|
+
"realm/@v0/shore/pubsub/location_fix/ais",
|
|
231
|
+
"realm/@v0/shore/pubsub/location_fix/ais/@target",
|
|
232
|
+
]);
|
|
233
|
+
});
|
|
234
|
+
// The target form is a chunk-boundary prefix of every published target
|
|
235
|
+
// key, so the token cannot drift from the data it advertises.
|
|
236
|
+
it("is a strict prefix of a published target key", () => {
|
|
237
|
+
const [, token] = (0, index_1.construct_pubsub_subject_liveliness_keys)("rise", "maritimedb", "name", "srv-herakles/sjofartsverket", true);
|
|
238
|
+
const published = (0, index_1.construct_pubSub_key)("rise", "maritimedb", "name", "srv-herakles/sjofartsverket", "mmsi_245060000");
|
|
239
|
+
expect(published.startsWith(`${token}/`)).toBe(true);
|
|
240
|
+
});
|
|
241
|
+
// Not hypothetical: maritimedb publishes AIS under this source id.
|
|
242
|
+
it("keeps a multi-level source id intact", () => {
|
|
243
|
+
expect((0, index_1.construct_pubsub_subject_liveliness_keys)("rise", "maritimedb", "name", "srv-herakles/sjofartsverket", true))
|
|
244
|
+
.toStrictEqual([
|
|
245
|
+
"rise/@v0/maritimedb/pubsub/name/srv-herakles/sjofartsverket",
|
|
246
|
+
"rise/@v0/maritimedb/pubsub/name/srv-herakles/sjofartsverket/@target",
|
|
247
|
+
]);
|
|
248
|
+
});
|
|
249
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
-
export declare const protobufPackage = "";
|
|
2
|
+
export declare const protobufPackage = "keelson.interfaces.alarm_ack";
|
|
3
3
|
export interface AcknowledgeAlarmRequest {
|
|
4
4
|
/** Client wall-clock at send, so the responder can log round-trip latency. */
|
|
5
5
|
timestamp: Date | undefined;
|
|
@@ -29,7 +29,7 @@ export declare const AcknowledgeAlarmResponse: MessageFns<AcknowledgeAlarmRespon
|
|
|
29
29
|
export type AlarmAckDefinition = typeof AlarmAckDefinition;
|
|
30
30
|
export declare const AlarmAckDefinition: {
|
|
31
31
|
readonly name: "AlarmAck";
|
|
32
|
-
readonly fullName: "AlarmAck";
|
|
32
|
+
readonly fullName: "keelson.interfaces.alarm_ack.AlarmAck";
|
|
33
33
|
readonly methods: {
|
|
34
34
|
readonly acknowledge_alarm: {
|
|
35
35
|
readonly name: "acknowledge_alarm";
|
|
@@ -9,7 +9,7 @@ exports.AlarmAckDefinition = exports.AcknowledgeAlarmResponse = exports.Acknowle
|
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
11
|
const timestamp_1 = require("./google/protobuf/timestamp");
|
|
12
|
-
exports.protobufPackage = "";
|
|
12
|
+
exports.protobufPackage = "keelson.interfaces.alarm_ack";
|
|
13
13
|
function createBaseAcknowledgeAlarmRequest() {
|
|
14
14
|
return { timestamp: undefined, identifier: "", acknowledgedBy: "" };
|
|
15
15
|
}
|
|
@@ -180,7 +180,7 @@ exports.AcknowledgeAlarmResponse = {
|
|
|
180
180
|
};
|
|
181
181
|
exports.AlarmAckDefinition = {
|
|
182
182
|
name: "AlarmAck",
|
|
183
|
-
fullName: "AlarmAck",
|
|
183
|
+
fullName: "keelson.interfaces.alarm_ack.AlarmAck",
|
|
184
184
|
methods: {
|
|
185
185
|
acknowledge_alarm: {
|
|
186
186
|
name: "acknowledge_alarm",
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { ContainerInfo } from "./ContainerHost";
|
|
3
|
+
export declare const protobufPackage = "keelson.interfaces.container_control";
|
|
4
|
+
/**
|
|
5
|
+
* Which stream one log line came from. UNSPECIFIED is the honest answer for a
|
|
6
|
+
* TTY-allocated container, whose streams are merged before the runtime sees them
|
|
7
|
+
* and cannot be separated after the fact.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum LogStream {
|
|
10
|
+
LOG_STREAM_UNSPECIFIED = 0,
|
|
11
|
+
LOG_STREAM_STDOUT = 1,
|
|
12
|
+
LOG_STREAM_STDERR = 2,
|
|
13
|
+
UNRECOGNIZED = -1
|
|
14
|
+
}
|
|
15
|
+
export declare function logStreamFromJSON(object: any): LogStream;
|
|
16
|
+
export declare function logStreamToJSON(object: LogStream): string;
|
|
17
|
+
/**
|
|
18
|
+
* Which streams a caller wants back. Separate from LogStream so the zero value
|
|
19
|
+
* can mean "both" on the request side without meaning "both" on a line.
|
|
20
|
+
*/
|
|
21
|
+
export declare enum LogStreamSelector {
|
|
22
|
+
/** LOG_STREAM_SELECTOR_UNSPECIFIED - both */
|
|
23
|
+
LOG_STREAM_SELECTOR_UNSPECIFIED = 0,
|
|
24
|
+
LOG_STREAM_SELECTOR_STDOUT = 1,
|
|
25
|
+
LOG_STREAM_SELECTOR_STDERR = 2,
|
|
26
|
+
LOG_STREAM_SELECTOR_BOTH = 3,
|
|
27
|
+
UNRECOGNIZED = -1
|
|
28
|
+
}
|
|
29
|
+
export declare function logStreamSelectorFromJSON(object: any): LogStreamSelector;
|
|
30
|
+
export declare function logStreamSelectorToJSON(object: LogStreamSelector): string;
|
|
31
|
+
export interface ListContainersRequest {
|
|
32
|
+
/**
|
|
33
|
+
* Default (false) returns every container including stopped ones -- a client
|
|
34
|
+
* cannot offer "start" for a container it was never told about.
|
|
35
|
+
*/
|
|
36
|
+
runningOnly: boolean;
|
|
37
|
+
/** Optional shell-style glob against ContainerInfo.name. Empty matches all. */
|
|
38
|
+
nameGlob: string;
|
|
39
|
+
}
|
|
40
|
+
export interface ListContainersResponse {
|
|
41
|
+
containers: ContainerInfo[];
|
|
42
|
+
/** When the responder read the runtime's state. */
|
|
43
|
+
observedAt: Date | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* False when this responder is read-only: every start/stop/restart on it will
|
|
46
|
+
* reply PERMISSION_DENIED regardless of which container is named.
|
|
47
|
+
*/
|
|
48
|
+
controlEnabled: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* False when this responder will remove nothing: every `remove` on it will
|
|
51
|
+
* reply PERMISSION_DENIED regardless of which container is named. Read
|
|
52
|
+
* INDEPENDENTLY of control_enabled -- neither implies the other, and the
|
|
53
|
+
* common configuration is control_enabled true with this false.
|
|
54
|
+
*/
|
|
55
|
+
removeEnabled: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface GetLogsRequest {
|
|
58
|
+
name: string;
|
|
59
|
+
/**
|
|
60
|
+
* Lines from the end of the log. 0 selects the responder's default; values
|
|
61
|
+
* above its ceiling are clamped, and the effective value comes back in
|
|
62
|
+
* GetLogsResponse.tail_lines rather than erroring.
|
|
63
|
+
*/
|
|
64
|
+
tailLines: number;
|
|
65
|
+
/** Optional: only lines at or after this instant. */
|
|
66
|
+
since: Date | undefined;
|
|
67
|
+
stream: LogStreamSelector;
|
|
68
|
+
}
|
|
69
|
+
export interface LogLine {
|
|
70
|
+
/** Unset when the runtime emitted no parseable timestamp for the line. */
|
|
71
|
+
time: Date | undefined;
|
|
72
|
+
stream: LogStream;
|
|
73
|
+
text: string;
|
|
74
|
+
}
|
|
75
|
+
export interface GetLogsResponse {
|
|
76
|
+
name: string;
|
|
77
|
+
id: string;
|
|
78
|
+
lines: LogLine[];
|
|
79
|
+
/**
|
|
80
|
+
* True when the responder dropped lines to stay under its byte ceiling. The
|
|
81
|
+
* OLDEST lines are dropped, so `lines` is always the most recent window.
|
|
82
|
+
*/
|
|
83
|
+
truncated: boolean;
|
|
84
|
+
/** The tail_lines the responder actually applied after defaulting/clamping. */
|
|
85
|
+
tailLines: number;
|
|
86
|
+
}
|
|
87
|
+
export interface StartContainerRequest {
|
|
88
|
+
name: string;
|
|
89
|
+
}
|
|
90
|
+
export interface StopContainerRequest {
|
|
91
|
+
name: string;
|
|
92
|
+
/** Grace period before SIGKILL. 0 selects the responder's default. */
|
|
93
|
+
timeoutS: number;
|
|
94
|
+
}
|
|
95
|
+
export interface RestartContainerRequest {
|
|
96
|
+
name: string;
|
|
97
|
+
timeoutS: number;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Shared by start, stop and restart. Carries the container's state AFTER the
|
|
101
|
+
* operation, so a client does not have to follow every action with a `list` and
|
|
102
|
+
* race the runtime for the answer. All three are idempotent: starting a running
|
|
103
|
+
* container or stopping a stopped one succeeds and returns its unchanged state.
|
|
104
|
+
*/
|
|
105
|
+
export interface ContainerActionResponse {
|
|
106
|
+
container: ContainerInfo | undefined;
|
|
107
|
+
}
|
|
108
|
+
export interface RemoveContainerRequest {
|
|
109
|
+
name: string;
|
|
110
|
+
/**
|
|
111
|
+
* Remove a RUNNING container, killing it first. Default (false) makes a
|
|
112
|
+
* running container reply ErrorResponse.INVALID_STATE naming the stop it
|
|
113
|
+
* needs, rather than taking a vessel's connector off the air because a click
|
|
114
|
+
* landed one row lower than the operator meant. An operator who does mean it
|
|
115
|
+
* says so in a second call, which is the point: the confirmation lives in the
|
|
116
|
+
* protocol rather than only in whichever UI happens to be in front of them.
|
|
117
|
+
*/
|
|
118
|
+
force: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Also delete the ANONYMOUS volumes this container owns. Named volumes are
|
|
121
|
+
* never touched by this and a responder must not offer to: they outlive the
|
|
122
|
+
* container by definition and are shared with whatever else mounts them, so
|
|
123
|
+
* removing one on a container's behalf destroys data nobody asked about.
|
|
124
|
+
* Default (false) leaves even the anonymous ones behind -- reclaiming disk is
|
|
125
|
+
* a deliberate act, not a side effect of tidying a container list.
|
|
126
|
+
*/
|
|
127
|
+
removeVolumes: boolean;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* NOT ContainerActionResponse, deliberately. That message carries the
|
|
131
|
+
* container's state AFTER the operation, which is the one thing removal does
|
|
132
|
+
* not leave behind: there is nothing to re-read, and a ContainerInfo describing
|
|
133
|
+
* a container that no longer exists is a falsehood a client would render as a
|
|
134
|
+
* perfectly ordinary row. This says what went away, and stops.
|
|
135
|
+
*/
|
|
136
|
+
export interface RemoveContainerResponse {
|
|
137
|
+
/**
|
|
138
|
+
* Echoed from the request, so a client with several calls in flight can tell
|
|
139
|
+
* the replies apart.
|
|
140
|
+
*/
|
|
141
|
+
name: string;
|
|
142
|
+
/**
|
|
143
|
+
* The id the container had at the moment it was removed, for correlating with
|
|
144
|
+
* the `list` the caller was looking at. Nothing resolves it any more.
|
|
145
|
+
*/
|
|
146
|
+
id: string;
|
|
147
|
+
/**
|
|
148
|
+
* True when the container was running on arrival and `force` killed it. The
|
|
149
|
+
* ordinary path -- removing something already stopped -- reports false, so an
|
|
150
|
+
* operator can tell "I tidied up an exited container" from "I took a running
|
|
151
|
+
* one down", after the fact, from the reply alone.
|
|
152
|
+
*/
|
|
153
|
+
forceApplied: boolean;
|
|
154
|
+
}
|
|
155
|
+
export declare const ListContainersRequest: MessageFns<ListContainersRequest>;
|
|
156
|
+
export declare const ListContainersResponse: MessageFns<ListContainersResponse>;
|
|
157
|
+
export declare const GetLogsRequest: MessageFns<GetLogsRequest>;
|
|
158
|
+
export declare const LogLine: MessageFns<LogLine>;
|
|
159
|
+
export declare const GetLogsResponse: MessageFns<GetLogsResponse>;
|
|
160
|
+
export declare const StartContainerRequest: MessageFns<StartContainerRequest>;
|
|
161
|
+
export declare const StopContainerRequest: MessageFns<StopContainerRequest>;
|
|
162
|
+
export declare const RestartContainerRequest: MessageFns<RestartContainerRequest>;
|
|
163
|
+
export declare const ContainerActionResponse: MessageFns<ContainerActionResponse>;
|
|
164
|
+
export declare const RemoveContainerRequest: MessageFns<RemoveContainerRequest>;
|
|
165
|
+
export declare const RemoveContainerResponse: MessageFns<RemoveContainerResponse>;
|
|
166
|
+
export type ContainerControlDefinition = typeof ContainerControlDefinition;
|
|
167
|
+
export declare const ContainerControlDefinition: {
|
|
168
|
+
readonly name: "ContainerControl";
|
|
169
|
+
readonly fullName: "keelson.interfaces.container_control.ContainerControl";
|
|
170
|
+
readonly methods: {
|
|
171
|
+
readonly list: {
|
|
172
|
+
readonly name: "list";
|
|
173
|
+
readonly requestType: MessageFns<ListContainersRequest>;
|
|
174
|
+
readonly requestStream: false;
|
|
175
|
+
readonly responseType: MessageFns<ListContainersResponse>;
|
|
176
|
+
readonly responseStream: false;
|
|
177
|
+
readonly options: {};
|
|
178
|
+
};
|
|
179
|
+
readonly logs: {
|
|
180
|
+
readonly name: "logs";
|
|
181
|
+
readonly requestType: MessageFns<GetLogsRequest>;
|
|
182
|
+
readonly requestStream: false;
|
|
183
|
+
readonly responseType: MessageFns<GetLogsResponse>;
|
|
184
|
+
readonly responseStream: false;
|
|
185
|
+
readonly options: {};
|
|
186
|
+
};
|
|
187
|
+
readonly start: {
|
|
188
|
+
readonly name: "start";
|
|
189
|
+
readonly requestType: MessageFns<StartContainerRequest>;
|
|
190
|
+
readonly requestStream: false;
|
|
191
|
+
readonly responseType: MessageFns<ContainerActionResponse>;
|
|
192
|
+
readonly responseStream: false;
|
|
193
|
+
readonly options: {};
|
|
194
|
+
};
|
|
195
|
+
readonly stop: {
|
|
196
|
+
readonly name: "stop";
|
|
197
|
+
readonly requestType: MessageFns<StopContainerRequest>;
|
|
198
|
+
readonly requestStream: false;
|
|
199
|
+
readonly responseType: MessageFns<ContainerActionResponse>;
|
|
200
|
+
readonly responseStream: false;
|
|
201
|
+
readonly options: {};
|
|
202
|
+
};
|
|
203
|
+
readonly restart: {
|
|
204
|
+
readonly name: "restart";
|
|
205
|
+
readonly requestType: MessageFns<RestartContainerRequest>;
|
|
206
|
+
readonly requestStream: false;
|
|
207
|
+
readonly responseType: MessageFns<ContainerActionResponse>;
|
|
208
|
+
readonly responseStream: false;
|
|
209
|
+
readonly options: {};
|
|
210
|
+
};
|
|
211
|
+
readonly remove: {
|
|
212
|
+
readonly name: "remove";
|
|
213
|
+
readonly requestType: MessageFns<RemoveContainerRequest>;
|
|
214
|
+
readonly requestStream: false;
|
|
215
|
+
readonly responseType: MessageFns<RemoveContainerResponse>;
|
|
216
|
+
readonly responseStream: false;
|
|
217
|
+
readonly options: {};
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
222
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
223
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
224
|
+
} : Partial<T>;
|
|
225
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
226
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
227
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
228
|
+
} & {
|
|
229
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
230
|
+
};
|
|
231
|
+
export interface MessageFns<T> {
|
|
232
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
233
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
234
|
+
fromJSON(object: any): T;
|
|
235
|
+
toJSON(message: T): unknown;
|
|
236
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
237
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
238
|
+
}
|
|
239
|
+
export {};
|