@rise-maritime/keelson-js 0.6.0-alpha.232.dev.1 → 0.6.0-alpha.255.dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +8 -8
- package/dist/interfaces/Route.d.ts +24 -0
- package/dist/interfaces/Route.js +57 -2
- package/dist/interfaces/ScenarioControl.d.ts +3 -96
- package/dist/interfaces/ScenarioControl.js +37 -394
- package/dist/interfaces/VehicleSimulatorControl.d.ts +83 -0
- package/dist/interfaces/VehicleSimulatorControl.js +293 -1
- package/dist/interfaces/serviceRegistry.d.ts +8 -8
- package/dist/payloads/ChecklistEvent.d.ts +178 -0
- package/dist/payloads/ChecklistEvent.js +539 -0
- package/dist/payloads/ChecklistEvidence.d.ts +79 -0
- package/dist/payloads/ChecklistEvidence.js +287 -0
- package/dist/payloads/ChecklistPresence.d.ts +68 -0
- package/dist/payloads/ChecklistPresence.js +286 -0
- package/dist/payloads/ChecklistProcedure.d.ts +81 -0
- package/dist/payloads/ChecklistProcedure.js +364 -0
- package/dist/payloads/ChecklistState.d.ts +283 -0
- package/dist/payloads/ChecklistState.js +1100 -0
- package/dist/payloads/EnvelopeExceedance.d.ts +216 -0
- package/dist/payloads/EnvelopeExceedance.js +461 -0
- package/dist/payloads/Route.d.ts +24 -0
- package/dist/payloads/Route.js +57 -2
- package/dist/payloads/RouteExecution.d.ts +81 -1
- package/dist/payloads/RouteExecution.js +215 -1
- package/dist/payloads/ScenarioEvent.d.ts +90 -0
- package/dist/payloads/ScenarioEvent.js +294 -0
- package/dist/payloads/ScenarioTickAck.d.ts +95 -0
- package/dist/payloads/ScenarioTickAck.js +239 -0
- package/dist/payloads/index.foxglove.d.ts +1 -1
- package/dist/payloads/index.foxglove.js +1 -1
- package/dist/payloads/index.google.protobuf.d.ts +1 -1
- package/dist/payloads/index.google.protobuf.js +1 -1
- package/dist/payloads/index.keelson.d.ts +9 -1
- package/dist/payloads/index.keelson.js +9 -1
- package/dist/qos.json +13 -1
- package/dist/subjects.json +9 -1
- package/package.json +1 -1
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.6.1
|
|
5
|
+
// protoc v6.30.2
|
|
6
|
+
// source: ChecklistEvidence.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ChecklistItemEvidence = exports.checklistItemEvidence_SourceToJSON = exports.checklistItemEvidence_SourceFromJSON = exports.ChecklistItemEvidence_Source = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
|
+
const timestamp_1 = require("./google/protobuf/timestamp");
|
|
12
|
+
const typeRegistry_1 = require("./typeRegistry");
|
|
13
|
+
var ChecklistItemEvidence_Source;
|
|
14
|
+
(function (ChecklistItemEvidence_Source) {
|
|
15
|
+
ChecklistItemEvidence_Source[ChecklistItemEvidence_Source["SOURCE_UNKNOWN"] = 0] = "SOURCE_UNKNOWN";
|
|
16
|
+
/** SOURCE_FILE - Chosen from the operator's device — on a phone or tablet this is the camera. */
|
|
17
|
+
ChecklistItemEvidence_Source[ChecklistItemEvidence_Source["SOURCE_FILE"] = 1] = "SOURCE_FILE";
|
|
18
|
+
/** SOURCE_CAMERA - A still grabbed from a live vessel camera feed at the moment of capture. */
|
|
19
|
+
ChecklistItemEvidence_Source[ChecklistItemEvidence_Source["SOURCE_CAMERA"] = 2] = "SOURCE_CAMERA";
|
|
20
|
+
/** SOURCE_CHART - The chart as it stood when the check was made. */
|
|
21
|
+
ChecklistItemEvidence_Source[ChecklistItemEvidence_Source["SOURCE_CHART"] = 3] = "SOURCE_CHART";
|
|
22
|
+
ChecklistItemEvidence_Source[ChecklistItemEvidence_Source["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
23
|
+
})(ChecklistItemEvidence_Source || (exports.ChecklistItemEvidence_Source = ChecklistItemEvidence_Source = {}));
|
|
24
|
+
function checklistItemEvidence_SourceFromJSON(object) {
|
|
25
|
+
switch (object) {
|
|
26
|
+
case 0:
|
|
27
|
+
case "SOURCE_UNKNOWN":
|
|
28
|
+
return ChecklistItemEvidence_Source.SOURCE_UNKNOWN;
|
|
29
|
+
case 1:
|
|
30
|
+
case "SOURCE_FILE":
|
|
31
|
+
return ChecklistItemEvidence_Source.SOURCE_FILE;
|
|
32
|
+
case 2:
|
|
33
|
+
case "SOURCE_CAMERA":
|
|
34
|
+
return ChecklistItemEvidence_Source.SOURCE_CAMERA;
|
|
35
|
+
case 3:
|
|
36
|
+
case "SOURCE_CHART":
|
|
37
|
+
return ChecklistItemEvidence_Source.SOURCE_CHART;
|
|
38
|
+
case -1:
|
|
39
|
+
case "UNRECOGNIZED":
|
|
40
|
+
default:
|
|
41
|
+
return ChecklistItemEvidence_Source.UNRECOGNIZED;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.checklistItemEvidence_SourceFromJSON = checklistItemEvidence_SourceFromJSON;
|
|
45
|
+
function checklistItemEvidence_SourceToJSON(object) {
|
|
46
|
+
switch (object) {
|
|
47
|
+
case ChecklistItemEvidence_Source.SOURCE_UNKNOWN:
|
|
48
|
+
return "SOURCE_UNKNOWN";
|
|
49
|
+
case ChecklistItemEvidence_Source.SOURCE_FILE:
|
|
50
|
+
return "SOURCE_FILE";
|
|
51
|
+
case ChecklistItemEvidence_Source.SOURCE_CAMERA:
|
|
52
|
+
return "SOURCE_CAMERA";
|
|
53
|
+
case ChecklistItemEvidence_Source.SOURCE_CHART:
|
|
54
|
+
return "SOURCE_CHART";
|
|
55
|
+
case ChecklistItemEvidence_Source.UNRECOGNIZED:
|
|
56
|
+
default:
|
|
57
|
+
return "UNRECOGNIZED";
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.checklistItemEvidence_SourceToJSON = checklistItemEvidence_SourceToJSON;
|
|
61
|
+
function createBaseChecklistItemEvidence() {
|
|
62
|
+
return {
|
|
63
|
+
$type: "keelson.ChecklistItemEvidence",
|
|
64
|
+
evidenceId: "",
|
|
65
|
+
caption: "",
|
|
66
|
+
capturedAt: undefined,
|
|
67
|
+
author: "",
|
|
68
|
+
authorSite: "",
|
|
69
|
+
mediaType: "",
|
|
70
|
+
byteSize: 0,
|
|
71
|
+
width: 0,
|
|
72
|
+
height: 0,
|
|
73
|
+
source: 0,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
exports.ChecklistItemEvidence = {
|
|
77
|
+
$type: "keelson.ChecklistItemEvidence",
|
|
78
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
79
|
+
if (message.evidenceId !== "") {
|
|
80
|
+
writer.uint32(10).string(message.evidenceId);
|
|
81
|
+
}
|
|
82
|
+
if (message.caption !== "") {
|
|
83
|
+
writer.uint32(18).string(message.caption);
|
|
84
|
+
}
|
|
85
|
+
if (message.capturedAt !== undefined) {
|
|
86
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.capturedAt), writer.uint32(26).fork()).join();
|
|
87
|
+
}
|
|
88
|
+
if (message.author !== "") {
|
|
89
|
+
writer.uint32(34).string(message.author);
|
|
90
|
+
}
|
|
91
|
+
if (message.authorSite !== "") {
|
|
92
|
+
writer.uint32(42).string(message.authorSite);
|
|
93
|
+
}
|
|
94
|
+
if (message.mediaType !== "") {
|
|
95
|
+
writer.uint32(50).string(message.mediaType);
|
|
96
|
+
}
|
|
97
|
+
if (message.byteSize !== 0) {
|
|
98
|
+
writer.uint32(56).uint32(message.byteSize);
|
|
99
|
+
}
|
|
100
|
+
if (message.width !== 0) {
|
|
101
|
+
writer.uint32(64).uint32(message.width);
|
|
102
|
+
}
|
|
103
|
+
if (message.height !== 0) {
|
|
104
|
+
writer.uint32(72).uint32(message.height);
|
|
105
|
+
}
|
|
106
|
+
if (message.source !== 0) {
|
|
107
|
+
writer.uint32(80).int32(message.source);
|
|
108
|
+
}
|
|
109
|
+
return writer;
|
|
110
|
+
},
|
|
111
|
+
decode(input, length) {
|
|
112
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
113
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
114
|
+
const message = createBaseChecklistItemEvidence();
|
|
115
|
+
while (reader.pos < end) {
|
|
116
|
+
const tag = reader.uint32();
|
|
117
|
+
switch (tag >>> 3) {
|
|
118
|
+
case 1: {
|
|
119
|
+
if (tag !== 10) {
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
message.evidenceId = reader.string();
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
case 2: {
|
|
126
|
+
if (tag !== 18) {
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
message.caption = reader.string();
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
case 3: {
|
|
133
|
+
if (tag !== 26) {
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
message.capturedAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
case 4: {
|
|
140
|
+
if (tag !== 34) {
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
message.author = reader.string();
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
case 5: {
|
|
147
|
+
if (tag !== 42) {
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
message.authorSite = reader.string();
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
case 6: {
|
|
154
|
+
if (tag !== 50) {
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
message.mediaType = reader.string();
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
case 7: {
|
|
161
|
+
if (tag !== 56) {
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
message.byteSize = reader.uint32();
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
case 8: {
|
|
168
|
+
if (tag !== 64) {
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
message.width = reader.uint32();
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
case 9: {
|
|
175
|
+
if (tag !== 72) {
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
message.height = reader.uint32();
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
case 10: {
|
|
182
|
+
if (tag !== 80) {
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
message.source = reader.int32();
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
reader.skip(tag & 7);
|
|
193
|
+
}
|
|
194
|
+
return message;
|
|
195
|
+
},
|
|
196
|
+
fromJSON(object) {
|
|
197
|
+
return {
|
|
198
|
+
$type: exports.ChecklistItemEvidence.$type,
|
|
199
|
+
evidenceId: isSet(object.evidenceId) ? globalThis.String(object.evidenceId) : "",
|
|
200
|
+
caption: isSet(object.caption) ? globalThis.String(object.caption) : "",
|
|
201
|
+
capturedAt: isSet(object.capturedAt) ? fromJsonTimestamp(object.capturedAt) : undefined,
|
|
202
|
+
author: isSet(object.author) ? globalThis.String(object.author) : "",
|
|
203
|
+
authorSite: isSet(object.authorSite) ? globalThis.String(object.authorSite) : "",
|
|
204
|
+
mediaType: isSet(object.mediaType) ? globalThis.String(object.mediaType) : "",
|
|
205
|
+
byteSize: isSet(object.byteSize) ? globalThis.Number(object.byteSize) : 0,
|
|
206
|
+
width: isSet(object.width) ? globalThis.Number(object.width) : 0,
|
|
207
|
+
height: isSet(object.height) ? globalThis.Number(object.height) : 0,
|
|
208
|
+
source: isSet(object.source) ? checklistItemEvidence_SourceFromJSON(object.source) : 0,
|
|
209
|
+
};
|
|
210
|
+
},
|
|
211
|
+
toJSON(message) {
|
|
212
|
+
const obj = {};
|
|
213
|
+
if (message.evidenceId !== "") {
|
|
214
|
+
obj.evidenceId = message.evidenceId;
|
|
215
|
+
}
|
|
216
|
+
if (message.caption !== "") {
|
|
217
|
+
obj.caption = message.caption;
|
|
218
|
+
}
|
|
219
|
+
if (message.capturedAt !== undefined) {
|
|
220
|
+
obj.capturedAt = message.capturedAt.toISOString();
|
|
221
|
+
}
|
|
222
|
+
if (message.author !== "") {
|
|
223
|
+
obj.author = message.author;
|
|
224
|
+
}
|
|
225
|
+
if (message.authorSite !== "") {
|
|
226
|
+
obj.authorSite = message.authorSite;
|
|
227
|
+
}
|
|
228
|
+
if (message.mediaType !== "") {
|
|
229
|
+
obj.mediaType = message.mediaType;
|
|
230
|
+
}
|
|
231
|
+
if (message.byteSize !== 0) {
|
|
232
|
+
obj.byteSize = Math.round(message.byteSize);
|
|
233
|
+
}
|
|
234
|
+
if (message.width !== 0) {
|
|
235
|
+
obj.width = Math.round(message.width);
|
|
236
|
+
}
|
|
237
|
+
if (message.height !== 0) {
|
|
238
|
+
obj.height = Math.round(message.height);
|
|
239
|
+
}
|
|
240
|
+
if (message.source !== 0) {
|
|
241
|
+
obj.source = checklistItemEvidence_SourceToJSON(message.source);
|
|
242
|
+
}
|
|
243
|
+
return obj;
|
|
244
|
+
},
|
|
245
|
+
create(base) {
|
|
246
|
+
return exports.ChecklistItemEvidence.fromPartial(base ?? {});
|
|
247
|
+
},
|
|
248
|
+
fromPartial(object) {
|
|
249
|
+
const message = createBaseChecklistItemEvidence();
|
|
250
|
+
message.evidenceId = object.evidenceId ?? "";
|
|
251
|
+
message.caption = object.caption ?? "";
|
|
252
|
+
message.capturedAt = object.capturedAt ?? undefined;
|
|
253
|
+
message.author = object.author ?? "";
|
|
254
|
+
message.authorSite = object.authorSite ?? "";
|
|
255
|
+
message.mediaType = object.mediaType ?? "";
|
|
256
|
+
message.byteSize = object.byteSize ?? 0;
|
|
257
|
+
message.width = object.width ?? 0;
|
|
258
|
+
message.height = object.height ?? 0;
|
|
259
|
+
message.source = object.source ?? 0;
|
|
260
|
+
return message;
|
|
261
|
+
},
|
|
262
|
+
};
|
|
263
|
+
typeRegistry_1.messageTypeRegistry.set(exports.ChecklistItemEvidence.$type, exports.ChecklistItemEvidence);
|
|
264
|
+
function toTimestamp(date) {
|
|
265
|
+
const seconds = Math.trunc(date.getTime() / 1000);
|
|
266
|
+
const nanos = (date.getTime() % 1000) * 1000000;
|
|
267
|
+
return { $type: "google.protobuf.Timestamp", seconds, nanos };
|
|
268
|
+
}
|
|
269
|
+
function fromTimestamp(t) {
|
|
270
|
+
let millis = (t.seconds || 0) * 1000;
|
|
271
|
+
millis += (t.nanos || 0) / 1000000;
|
|
272
|
+
return new globalThis.Date(millis);
|
|
273
|
+
}
|
|
274
|
+
function fromJsonTimestamp(o) {
|
|
275
|
+
if (o instanceof globalThis.Date) {
|
|
276
|
+
return o;
|
|
277
|
+
}
|
|
278
|
+
else if (typeof o === "string") {
|
|
279
|
+
return new globalThis.Date(o);
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
function isSet(value) {
|
|
286
|
+
return value !== null && value !== undefined;
|
|
287
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
/**
|
|
3
|
+
* Heartbeat message published by each operator to indicate their presence and current focus
|
|
4
|
+
* within the checklist application. Used to show remote operator activity across ROC sites.
|
|
5
|
+
*/
|
|
6
|
+
export interface ChecklistPresence {
|
|
7
|
+
$type: "keelson.ChecklistPresence";
|
|
8
|
+
timestamp: Date | undefined;
|
|
9
|
+
operatorId: string;
|
|
10
|
+
username: string;
|
|
11
|
+
role: string;
|
|
12
|
+
rocSite: string;
|
|
13
|
+
activeProcedureId: string;
|
|
14
|
+
activeItemId: string;
|
|
15
|
+
cursor: ChecklistPresence_CursorState;
|
|
16
|
+
/**
|
|
17
|
+
* The run the operator is looking at. Distinct from `active_procedure_id`, which cannot
|
|
18
|
+
* identify a focus once two runs of the same procedure can be open at once.
|
|
19
|
+
*/
|
|
20
|
+
activeRunId: string;
|
|
21
|
+
/**
|
|
22
|
+
* Every run this operator has open, not just the focused one — the workspace shows up to four
|
|
23
|
+
* and a single scalar makes the other three invisible to everyone else.
|
|
24
|
+
*
|
|
25
|
+
* Read it guarded, since a publisher may predate this field:
|
|
26
|
+
* op.open_run_ids?.includes(id) ?? op.active_run_id === id
|
|
27
|
+
*
|
|
28
|
+
* Note for anyone tempted to solve this with the key instead: do NOT extend the presence source
|
|
29
|
+
* id to {roc_site}/{operator_id}/{run_id}. Every consumer keys presence by operator, so the
|
|
30
|
+
* extra keys overwrite each other and the heartbeat stops meaning what it says.
|
|
31
|
+
*/
|
|
32
|
+
openRunIds: string[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Renamed from CURSOR_* to carry the enum's own name, which is what every other enum in this
|
|
36
|
+
* family does (RUN_STATUS_, ITEM_STATUS_, SOURCE_, EVENT_TYPE_). The WIRE IS UNCHANGED — only
|
|
37
|
+
* the generated identifiers move, so a recording decodes identically and a consumer notices at
|
|
38
|
+
* compile time rather than at runtime.
|
|
39
|
+
*/
|
|
40
|
+
export declare enum ChecklistPresence_CursorState {
|
|
41
|
+
CURSOR_STATE_IDLE = 0,
|
|
42
|
+
CURSOR_STATE_VIEWING = 1,
|
|
43
|
+
CURSOR_STATE_EDITING_NOTE = 2,
|
|
44
|
+
UNRECOGNIZED = -1
|
|
45
|
+
}
|
|
46
|
+
export declare function checklistPresence_CursorStateFromJSON(object: any): ChecklistPresence_CursorState;
|
|
47
|
+
export declare function checklistPresence_CursorStateToJSON(object: ChecklistPresence_CursorState): string;
|
|
48
|
+
export declare const ChecklistPresence: MessageFns<ChecklistPresence, "keelson.ChecklistPresence">;
|
|
49
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
50
|
+
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 {} ? {
|
|
51
|
+
[K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
|
|
52
|
+
} : Partial<T>;
|
|
53
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
54
|
+
type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
55
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
56
|
+
} & {
|
|
57
|
+
[K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never;
|
|
58
|
+
};
|
|
59
|
+
interface MessageFns<T, V extends string> {
|
|
60
|
+
readonly $type: V;
|
|
61
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
62
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
63
|
+
fromJSON(object: any): T;
|
|
64
|
+
toJSON(message: T): unknown;
|
|
65
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
66
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.6.1
|
|
5
|
+
// protoc v6.30.2
|
|
6
|
+
// source: ChecklistPresence.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ChecklistPresence = exports.checklistPresence_CursorStateToJSON = exports.checklistPresence_CursorStateFromJSON = exports.ChecklistPresence_CursorState = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
|
+
const timestamp_1 = require("./google/protobuf/timestamp");
|
|
12
|
+
const typeRegistry_1 = require("./typeRegistry");
|
|
13
|
+
/**
|
|
14
|
+
* Renamed from CURSOR_* to carry the enum's own name, which is what every other enum in this
|
|
15
|
+
* family does (RUN_STATUS_, ITEM_STATUS_, SOURCE_, EVENT_TYPE_). The WIRE IS UNCHANGED — only
|
|
16
|
+
* the generated identifiers move, so a recording decodes identically and a consumer notices at
|
|
17
|
+
* compile time rather than at runtime.
|
|
18
|
+
*/
|
|
19
|
+
var ChecklistPresence_CursorState;
|
|
20
|
+
(function (ChecklistPresence_CursorState) {
|
|
21
|
+
ChecklistPresence_CursorState[ChecklistPresence_CursorState["CURSOR_STATE_IDLE"] = 0] = "CURSOR_STATE_IDLE";
|
|
22
|
+
ChecklistPresence_CursorState[ChecklistPresence_CursorState["CURSOR_STATE_VIEWING"] = 1] = "CURSOR_STATE_VIEWING";
|
|
23
|
+
ChecklistPresence_CursorState[ChecklistPresence_CursorState["CURSOR_STATE_EDITING_NOTE"] = 2] = "CURSOR_STATE_EDITING_NOTE";
|
|
24
|
+
ChecklistPresence_CursorState[ChecklistPresence_CursorState["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
25
|
+
})(ChecklistPresence_CursorState || (exports.ChecklistPresence_CursorState = ChecklistPresence_CursorState = {}));
|
|
26
|
+
function checklistPresence_CursorStateFromJSON(object) {
|
|
27
|
+
switch (object) {
|
|
28
|
+
case 0:
|
|
29
|
+
case "CURSOR_STATE_IDLE":
|
|
30
|
+
return ChecklistPresence_CursorState.CURSOR_STATE_IDLE;
|
|
31
|
+
case 1:
|
|
32
|
+
case "CURSOR_STATE_VIEWING":
|
|
33
|
+
return ChecklistPresence_CursorState.CURSOR_STATE_VIEWING;
|
|
34
|
+
case 2:
|
|
35
|
+
case "CURSOR_STATE_EDITING_NOTE":
|
|
36
|
+
return ChecklistPresence_CursorState.CURSOR_STATE_EDITING_NOTE;
|
|
37
|
+
case -1:
|
|
38
|
+
case "UNRECOGNIZED":
|
|
39
|
+
default:
|
|
40
|
+
return ChecklistPresence_CursorState.UNRECOGNIZED;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.checklistPresence_CursorStateFromJSON = checklistPresence_CursorStateFromJSON;
|
|
44
|
+
function checklistPresence_CursorStateToJSON(object) {
|
|
45
|
+
switch (object) {
|
|
46
|
+
case ChecklistPresence_CursorState.CURSOR_STATE_IDLE:
|
|
47
|
+
return "CURSOR_STATE_IDLE";
|
|
48
|
+
case ChecklistPresence_CursorState.CURSOR_STATE_VIEWING:
|
|
49
|
+
return "CURSOR_STATE_VIEWING";
|
|
50
|
+
case ChecklistPresence_CursorState.CURSOR_STATE_EDITING_NOTE:
|
|
51
|
+
return "CURSOR_STATE_EDITING_NOTE";
|
|
52
|
+
case ChecklistPresence_CursorState.UNRECOGNIZED:
|
|
53
|
+
default:
|
|
54
|
+
return "UNRECOGNIZED";
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.checklistPresence_CursorStateToJSON = checklistPresence_CursorStateToJSON;
|
|
58
|
+
function createBaseChecklistPresence() {
|
|
59
|
+
return {
|
|
60
|
+
$type: "keelson.ChecklistPresence",
|
|
61
|
+
timestamp: undefined,
|
|
62
|
+
operatorId: "",
|
|
63
|
+
username: "",
|
|
64
|
+
role: "",
|
|
65
|
+
rocSite: "",
|
|
66
|
+
activeProcedureId: "",
|
|
67
|
+
activeItemId: "",
|
|
68
|
+
cursor: 0,
|
|
69
|
+
activeRunId: "",
|
|
70
|
+
openRunIds: [],
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
exports.ChecklistPresence = {
|
|
74
|
+
$type: "keelson.ChecklistPresence",
|
|
75
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
76
|
+
if (message.timestamp !== undefined) {
|
|
77
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(10).fork()).join();
|
|
78
|
+
}
|
|
79
|
+
if (message.operatorId !== "") {
|
|
80
|
+
writer.uint32(18).string(message.operatorId);
|
|
81
|
+
}
|
|
82
|
+
if (message.username !== "") {
|
|
83
|
+
writer.uint32(26).string(message.username);
|
|
84
|
+
}
|
|
85
|
+
if (message.role !== "") {
|
|
86
|
+
writer.uint32(34).string(message.role);
|
|
87
|
+
}
|
|
88
|
+
if (message.rocSite !== "") {
|
|
89
|
+
writer.uint32(42).string(message.rocSite);
|
|
90
|
+
}
|
|
91
|
+
if (message.activeProcedureId !== "") {
|
|
92
|
+
writer.uint32(50).string(message.activeProcedureId);
|
|
93
|
+
}
|
|
94
|
+
if (message.activeItemId !== "") {
|
|
95
|
+
writer.uint32(58).string(message.activeItemId);
|
|
96
|
+
}
|
|
97
|
+
if (message.cursor !== 0) {
|
|
98
|
+
writer.uint32(64).int32(message.cursor);
|
|
99
|
+
}
|
|
100
|
+
if (message.activeRunId !== "") {
|
|
101
|
+
writer.uint32(74).string(message.activeRunId);
|
|
102
|
+
}
|
|
103
|
+
for (const v of message.openRunIds) {
|
|
104
|
+
writer.uint32(82).string(v);
|
|
105
|
+
}
|
|
106
|
+
return writer;
|
|
107
|
+
},
|
|
108
|
+
decode(input, length) {
|
|
109
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
110
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
111
|
+
const message = createBaseChecklistPresence();
|
|
112
|
+
while (reader.pos < end) {
|
|
113
|
+
const tag = reader.uint32();
|
|
114
|
+
switch (tag >>> 3) {
|
|
115
|
+
case 1: {
|
|
116
|
+
if (tag !== 10) {
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
message.timestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
case 2: {
|
|
123
|
+
if (tag !== 18) {
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
message.operatorId = reader.string();
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
case 3: {
|
|
130
|
+
if (tag !== 26) {
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
message.username = reader.string();
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
case 4: {
|
|
137
|
+
if (tag !== 34) {
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
message.role = reader.string();
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
case 5: {
|
|
144
|
+
if (tag !== 42) {
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
message.rocSite = reader.string();
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
case 6: {
|
|
151
|
+
if (tag !== 50) {
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
message.activeProcedureId = reader.string();
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
case 7: {
|
|
158
|
+
if (tag !== 58) {
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
message.activeItemId = reader.string();
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
case 8: {
|
|
165
|
+
if (tag !== 64) {
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
message.cursor = reader.int32();
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
case 9: {
|
|
172
|
+
if (tag !== 74) {
|
|
173
|
+
break;
|
|
174
|
+
}
|
|
175
|
+
message.activeRunId = reader.string();
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
case 10: {
|
|
179
|
+
if (tag !== 82) {
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
message.openRunIds.push(reader.string());
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
reader.skip(tag & 7);
|
|
190
|
+
}
|
|
191
|
+
return message;
|
|
192
|
+
},
|
|
193
|
+
fromJSON(object) {
|
|
194
|
+
return {
|
|
195
|
+
$type: exports.ChecklistPresence.$type,
|
|
196
|
+
timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
|
|
197
|
+
operatorId: isSet(object.operatorId) ? globalThis.String(object.operatorId) : "",
|
|
198
|
+
username: isSet(object.username) ? globalThis.String(object.username) : "",
|
|
199
|
+
role: isSet(object.role) ? globalThis.String(object.role) : "",
|
|
200
|
+
rocSite: isSet(object.rocSite) ? globalThis.String(object.rocSite) : "",
|
|
201
|
+
activeProcedureId: isSet(object.activeProcedureId) ? globalThis.String(object.activeProcedureId) : "",
|
|
202
|
+
activeItemId: isSet(object.activeItemId) ? globalThis.String(object.activeItemId) : "",
|
|
203
|
+
cursor: isSet(object.cursor) ? checklistPresence_CursorStateFromJSON(object.cursor) : 0,
|
|
204
|
+
activeRunId: isSet(object.activeRunId) ? globalThis.String(object.activeRunId) : "",
|
|
205
|
+
openRunIds: globalThis.Array.isArray(object?.openRunIds)
|
|
206
|
+
? object.openRunIds.map((e) => globalThis.String(e))
|
|
207
|
+
: [],
|
|
208
|
+
};
|
|
209
|
+
},
|
|
210
|
+
toJSON(message) {
|
|
211
|
+
const obj = {};
|
|
212
|
+
if (message.timestamp !== undefined) {
|
|
213
|
+
obj.timestamp = message.timestamp.toISOString();
|
|
214
|
+
}
|
|
215
|
+
if (message.operatorId !== "") {
|
|
216
|
+
obj.operatorId = message.operatorId;
|
|
217
|
+
}
|
|
218
|
+
if (message.username !== "") {
|
|
219
|
+
obj.username = message.username;
|
|
220
|
+
}
|
|
221
|
+
if (message.role !== "") {
|
|
222
|
+
obj.role = message.role;
|
|
223
|
+
}
|
|
224
|
+
if (message.rocSite !== "") {
|
|
225
|
+
obj.rocSite = message.rocSite;
|
|
226
|
+
}
|
|
227
|
+
if (message.activeProcedureId !== "") {
|
|
228
|
+
obj.activeProcedureId = message.activeProcedureId;
|
|
229
|
+
}
|
|
230
|
+
if (message.activeItemId !== "") {
|
|
231
|
+
obj.activeItemId = message.activeItemId;
|
|
232
|
+
}
|
|
233
|
+
if (message.cursor !== 0) {
|
|
234
|
+
obj.cursor = checklistPresence_CursorStateToJSON(message.cursor);
|
|
235
|
+
}
|
|
236
|
+
if (message.activeRunId !== "") {
|
|
237
|
+
obj.activeRunId = message.activeRunId;
|
|
238
|
+
}
|
|
239
|
+
if (message.openRunIds?.length) {
|
|
240
|
+
obj.openRunIds = message.openRunIds;
|
|
241
|
+
}
|
|
242
|
+
return obj;
|
|
243
|
+
},
|
|
244
|
+
create(base) {
|
|
245
|
+
return exports.ChecklistPresence.fromPartial(base ?? {});
|
|
246
|
+
},
|
|
247
|
+
fromPartial(object) {
|
|
248
|
+
const message = createBaseChecklistPresence();
|
|
249
|
+
message.timestamp = object.timestamp ?? undefined;
|
|
250
|
+
message.operatorId = object.operatorId ?? "";
|
|
251
|
+
message.username = object.username ?? "";
|
|
252
|
+
message.role = object.role ?? "";
|
|
253
|
+
message.rocSite = object.rocSite ?? "";
|
|
254
|
+
message.activeProcedureId = object.activeProcedureId ?? "";
|
|
255
|
+
message.activeItemId = object.activeItemId ?? "";
|
|
256
|
+
message.cursor = object.cursor ?? 0;
|
|
257
|
+
message.activeRunId = object.activeRunId ?? "";
|
|
258
|
+
message.openRunIds = object.openRunIds?.map((e) => e) || [];
|
|
259
|
+
return message;
|
|
260
|
+
},
|
|
261
|
+
};
|
|
262
|
+
typeRegistry_1.messageTypeRegistry.set(exports.ChecklistPresence.$type, exports.ChecklistPresence);
|
|
263
|
+
function toTimestamp(date) {
|
|
264
|
+
const seconds = Math.trunc(date.getTime() / 1000);
|
|
265
|
+
const nanos = (date.getTime() % 1000) * 1000000;
|
|
266
|
+
return { $type: "google.protobuf.Timestamp", seconds, nanos };
|
|
267
|
+
}
|
|
268
|
+
function fromTimestamp(t) {
|
|
269
|
+
let millis = (t.seconds || 0) * 1000;
|
|
270
|
+
millis += (t.nanos || 0) / 1000000;
|
|
271
|
+
return new globalThis.Date(millis);
|
|
272
|
+
}
|
|
273
|
+
function fromJsonTimestamp(o) {
|
|
274
|
+
if (o instanceof globalThis.Date) {
|
|
275
|
+
return o;
|
|
276
|
+
}
|
|
277
|
+
else if (typeof o === "string") {
|
|
278
|
+
return new globalThis.Date(o);
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
function isSet(value) {
|
|
285
|
+
return value !== null && value !== undefined;
|
|
286
|
+
}
|