@rise-maritime/keelson-js 0.6.0-pre.5 → 0.6.0-pre.6

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.
@@ -1,7 +1,7 @@
1
1
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
2
  /**
3
3
  * WarrantRecord is the append-only audit stream for claim standings: the
4
- * record of why a conclusion held, weakened or lapsed, produced by any
4
+ * record of why a conclusion held, reduced or lapsed, produced by any
5
5
  * evaluator aboard that maintains justification for its conclusions. The
6
6
  * warrant_aggregator connector is its first producer; the subject is
7
7
  * deliberately producer-neutral and the source_id names the evaluator:
@@ -35,7 +35,7 @@ export interface WarrantRecord {
35
35
  export declare enum WarrantRecord_Standing {
36
36
  STANDING_UNSPECIFIED = 0,
37
37
  STANDING_WITHDRAWN = 1,
38
- STANDING_WEAKENED = 2,
38
+ STANDING_REDUCED = 2,
39
39
  STANDING_LICENSED = 3,
40
40
  UNRECOGNIZED = -1
41
41
  }
@@ -78,6 +78,12 @@ export interface WarrantRecord_ClaimState {
78
78
  $type: "keelson.WarrantRecord.ClaimState";
79
79
  claimId: string;
80
80
  standing: WarrantRecord_Standing;
81
+ /**
82
+ * When this claim last entered `standing`, never when this snapshot
83
+ * was taken. Snapshots are not on a fixed cadence (see
84
+ * target_standing), so a reader that treats this as a snapshot time
85
+ * reports hold durations as snapshot intervals.
86
+ */
81
87
  since: Date | undefined;
82
88
  rebuttalsFired: WarrantRecord_RebuttalFired[];
83
89
  grounds: WarrantRecord_GroundStanding[];
@@ -88,6 +94,35 @@ export interface WarrantRecord_ClaimState {
88
94
  statement: string;
89
95
  warrant: string;
90
96
  backing: string;
97
+ /**
98
+ * The standing the rule assigns on current evidence, before the
99
+ * requalification hold is applied. Equal to `standing` except while
100
+ * an upgrade is being held, where `standing` is the published value
101
+ * and this is what the evidence already supports. Without it a held
102
+ * claim and an unsupported claim are indistinguishable in the record,
103
+ * and a reader reconstructing mid-hold reads the previous snapshot's
104
+ * value and concludes the evidence did not support an upgrade, which
105
+ * is a denial rather than a silence.
106
+ *
107
+ * STANDING_UNSPECIFIED means a producer that did not record it, not
108
+ * equality with `standing`.
109
+ *
110
+ * Derived claims cannot be held at all: they are evaluated after
111
+ * their grounds and transition immediately in both directions, so
112
+ * for them the two are always equal. Only source claims are held.
113
+ *
114
+ * The producer emits a snapshot whenever the set of claims in this
115
+ * condition changes, so a hold is on the wire when it opens and when
116
+ * it closes rather than only at the periodic cadence. That makes the
117
+ * snapshot rate depend on how volatile the evidence is, which on a
118
+ * bounded channel trades against completeness: a producer that can
119
+ * drop records must say so rather than leave a silent gap.
120
+ *
121
+ * The ladder level has a hold of its own and is NOT covered here.
122
+ * The level rides operational_authority, not this stream, so a held
123
+ * level still cannot be told from an unsupported one.
124
+ */
125
+ targetStanding: WarrantRecord_Standing;
91
126
  }
92
127
  /**
93
128
  * Periodic full state, so reconstruction needs only the stream: the
@@ -19,7 +19,7 @@ var WarrantRecord_Standing;
19
19
  (function (WarrantRecord_Standing) {
20
20
  WarrantRecord_Standing[WarrantRecord_Standing["STANDING_UNSPECIFIED"] = 0] = "STANDING_UNSPECIFIED";
21
21
  WarrantRecord_Standing[WarrantRecord_Standing["STANDING_WITHDRAWN"] = 1] = "STANDING_WITHDRAWN";
22
- WarrantRecord_Standing[WarrantRecord_Standing["STANDING_WEAKENED"] = 2] = "STANDING_WEAKENED";
22
+ WarrantRecord_Standing[WarrantRecord_Standing["STANDING_REDUCED"] = 2] = "STANDING_REDUCED";
23
23
  WarrantRecord_Standing[WarrantRecord_Standing["STANDING_LICENSED"] = 3] = "STANDING_LICENSED";
24
24
  WarrantRecord_Standing[WarrantRecord_Standing["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
25
25
  })(WarrantRecord_Standing || (exports.WarrantRecord_Standing = WarrantRecord_Standing = {}));
@@ -32,8 +32,8 @@ function warrantRecord_StandingFromJSON(object) {
32
32
  case "STANDING_WITHDRAWN":
33
33
  return WarrantRecord_Standing.STANDING_WITHDRAWN;
34
34
  case 2:
35
- case "STANDING_WEAKENED":
36
- return WarrantRecord_Standing.STANDING_WEAKENED;
35
+ case "STANDING_REDUCED":
36
+ return WarrantRecord_Standing.STANDING_REDUCED;
37
37
  case 3:
38
38
  case "STANDING_LICENSED":
39
39
  return WarrantRecord_Standing.STANDING_LICENSED;
@@ -50,8 +50,8 @@ function warrantRecord_StandingToJSON(object) {
50
50
  return "STANDING_UNSPECIFIED";
51
51
  case WarrantRecord_Standing.STANDING_WITHDRAWN:
52
52
  return "STANDING_WITHDRAWN";
53
- case WarrantRecord_Standing.STANDING_WEAKENED:
54
- return "STANDING_WEAKENED";
53
+ case WarrantRecord_Standing.STANDING_REDUCED:
54
+ return "STANDING_REDUCED";
55
55
  case WarrantRecord_Standing.STANDING_LICENSED:
56
56
  return "STANDING_LICENSED";
57
57
  case WarrantRecord_Standing.UNRECOGNIZED:
@@ -462,6 +462,7 @@ function createBaseWarrantRecord_ClaimState() {
462
462
  statement: "",
463
463
  warrant: "",
464
464
  backing: "",
465
+ targetStanding: 0,
465
466
  };
466
467
  }
467
468
  exports.WarrantRecord_ClaimState = {
@@ -491,6 +492,9 @@ exports.WarrantRecord_ClaimState = {
491
492
  if (message.backing !== "") {
492
493
  writer.uint32(66).string(message.backing);
493
494
  }
495
+ if (message.targetStanding !== 0) {
496
+ writer.uint32(72).int32(message.targetStanding);
497
+ }
494
498
  return writer;
495
499
  },
496
500
  decode(input, length) {
@@ -556,6 +560,13 @@ exports.WarrantRecord_ClaimState = {
556
560
  message.backing = reader.string();
557
561
  continue;
558
562
  }
563
+ case 9: {
564
+ if (tag !== 72) {
565
+ break;
566
+ }
567
+ message.targetStanding = reader.int32();
568
+ continue;
569
+ }
559
570
  }
560
571
  if ((tag & 7) === 4 || tag === 0) {
561
572
  break;
@@ -579,6 +590,7 @@ exports.WarrantRecord_ClaimState = {
579
590
  statement: isSet(object.statement) ? globalThis.String(object.statement) : "",
580
591
  warrant: isSet(object.warrant) ? globalThis.String(object.warrant) : "",
581
592
  backing: isSet(object.backing) ? globalThis.String(object.backing) : "",
593
+ targetStanding: isSet(object.targetStanding) ? warrantRecord_StandingFromJSON(object.targetStanding) : 0,
582
594
  };
583
595
  },
584
596
  toJSON(message) {
@@ -607,6 +619,9 @@ exports.WarrantRecord_ClaimState = {
607
619
  if (message.backing !== "") {
608
620
  obj.backing = message.backing;
609
621
  }
622
+ if (message.targetStanding !== 0) {
623
+ obj.targetStanding = warrantRecord_StandingToJSON(message.targetStanding);
624
+ }
610
625
  return obj;
611
626
  },
612
627
  create(base) {
@@ -622,6 +637,7 @@ exports.WarrantRecord_ClaimState = {
622
637
  message.statement = object.statement ?? "";
623
638
  message.warrant = object.warrant ?? "";
624
639
  message.backing = object.backing ?? "";
640
+ message.targetStanding = object.targetStanding ?? 0;
625
641
  return message;
626
642
  },
627
643
  };
@@ -1,10 +1,6 @@
1
1
  export * from "./Audio";
2
2
  export * from "./Severity";
3
3
  export * from "./Alarm";
4
- export * from "./ChecklistEvent";
5
- export * from "./ChecklistPresence";
6
- export * from "./ChecklistProcedure";
7
- export * from "./ChecklistState";
8
4
  export * from "./CommandAuthority";
9
5
  export * from "./Coordinate";
10
6
  export * from "./Decomposed3DVector";
@@ -22,10 +22,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  __exportStar(require("./Audio"), exports);
23
23
  __exportStar(require("./Severity"), exports);
24
24
  __exportStar(require("./Alarm"), exports);
25
- __exportStar(require("./ChecklistEvent"), exports);
26
- __exportStar(require("./ChecklistPresence"), exports);
27
- __exportStar(require("./ChecklistProcedure"), exports);
28
- __exportStar(require("./ChecklistState"), exports);
29
25
  __exportStar(require("./CommandAuthority"), exports);
30
26
  __exportStar(require("./Coordinate"), exports);
31
27
  __exportStar(require("./Decomposed3DVector"), exports);
@@ -105,7 +105,6 @@
105
105
  "air_relative_humidity_pct": "keelson.TimestampedFloat",
106
106
  "air_pressure_pa": "keelson.TimestampedFloat",
107
107
  "dew_point_celsius": "keelson.TimestampedFloat",
108
- "illuminance_lux": "keelson.TimestampedFloat",
109
108
  "water_temperature_celsius": "keelson.TimestampedFloat",
110
109
  "water_salinity_ppt": "keelson.TimestampedFloat",
111
110
  "water_speed_of_sound_mps": "keelson.TimestampedFloat",
@@ -216,9 +215,5 @@
216
215
  "route_change_event": "keelson.RouteChangeEvent",
217
216
  "route_signature": "keelson.RouteSignatures",
218
217
  "command_authority": "keelson.CommandAuthority",
219
- "command_request": "keelson.CommandRequest",
220
- "checklist_event": "keelson.ChecklistEvent",
221
- "checklist_state": "keelson.ChecklistState",
222
- "checklist_presence": "keelson.ChecklistPresence",
223
- "checklist_procedure": "keelson.ChecklistProcedure"
218
+ "command_request": "keelson.CommandRequest"
224
219
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rise-maritime/keelson-js",
3
3
  "//version": "NOT the published version. The release workflow overwrites it from the release tag (npm version --no-git-tag-version), so tag and artifact cannot disagree. Only matters for local installs; do not hand-bump before tagging — that manual step is what broke release 0.5.4.",
4
- "version": "0.6.0-pre.5",
4
+ "version": "0.6.0-pre.6",
5
5
  "description": "Keelson JavaScript SDK with Node-RED nodes",
6
6
  "main": "dist/index.js",
7
7
  "files": [
@@ -1,59 +0,0 @@
1
- import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
- /**
3
- * Represents a single auditable action performed on a checklist by an operator.
4
- * Used for real-time synchronization of checklist activity between Remote Operations Centres.
5
- */
6
- export interface ChecklistEvent {
7
- $type: "keelson.ChecklistEvent";
8
- timestamp: Date | undefined;
9
- eventId: string;
10
- eventType: ChecklistEvent_EventType;
11
- /** Operator identity */
12
- operatorId: string;
13
- username: string;
14
- role: string;
15
- rocSite: string;
16
- /** Checklist context */
17
- procedureId: string;
18
- itemId: string;
19
- /** Event-specific text payload (note text, flag reason, resolution text) */
20
- detail: string;
21
- /** Reference ID for additive entries (note_id, evidence_id) */
22
- referenceId: string;
23
- }
24
- export declare enum ChecklistEvent_EventType {
25
- EVENT_TYPE_UNKNOWN = 0,
26
- EVENT_TYPE_CHECKLIST_OPENED = 1,
27
- EVENT_TYPE_ITEM_STARTED = 2,
28
- EVENT_TYPE_ITEM_COMPLETED = 3,
29
- EVENT_TYPE_ITEM_REVERTED = 4,
30
- EVENT_TYPE_NOTE_ADDED = 5,
31
- EVENT_TYPE_ITEM_FLAGGED = 6,
32
- EVENT_TYPE_FLAG_RESOLVED = 7,
33
- EVENT_TYPE_PROCEDURE_STARTED = 8,
34
- EVENT_TYPE_PROCEDURE_COMPLETED = 9,
35
- UNRECOGNIZED = -1
36
- }
37
- export declare function checklistEvent_EventTypeFromJSON(object: any): ChecklistEvent_EventType;
38
- export declare function checklistEvent_EventTypeToJSON(object: ChecklistEvent_EventType): string;
39
- export declare const ChecklistEvent: MessageFns<ChecklistEvent, "keelson.ChecklistEvent">;
40
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
41
- 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 {} ? {
42
- [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
43
- } : Partial<T>;
44
- type KeysOfUnion<T> = T extends T ? keyof T : never;
45
- type Exact<P, I extends P> = P extends Builtin ? P : P & {
46
- [K in keyof P]: Exact<P[K], I[K]>;
47
- } & {
48
- [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never;
49
- };
50
- interface MessageFns<T, V extends string> {
51
- readonly $type: V;
52
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
53
- decode(input: BinaryReader | Uint8Array, length?: number): T;
54
- fromJSON(object: any): T;
55
- toJSON(message: T): unknown;
56
- create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
57
- fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
58
- }
59
- export {};
@@ -1,336 +0,0 @@
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: ChecklistEvent.proto
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.ChecklistEvent = exports.checklistEvent_EventTypeToJSON = exports.checklistEvent_EventTypeFromJSON = exports.ChecklistEvent_EventType = 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 ChecklistEvent_EventType;
14
- (function (ChecklistEvent_EventType) {
15
- ChecklistEvent_EventType[ChecklistEvent_EventType["EVENT_TYPE_UNKNOWN"] = 0] = "EVENT_TYPE_UNKNOWN";
16
- ChecklistEvent_EventType[ChecklistEvent_EventType["EVENT_TYPE_CHECKLIST_OPENED"] = 1] = "EVENT_TYPE_CHECKLIST_OPENED";
17
- ChecklistEvent_EventType[ChecklistEvent_EventType["EVENT_TYPE_ITEM_STARTED"] = 2] = "EVENT_TYPE_ITEM_STARTED";
18
- ChecklistEvent_EventType[ChecklistEvent_EventType["EVENT_TYPE_ITEM_COMPLETED"] = 3] = "EVENT_TYPE_ITEM_COMPLETED";
19
- ChecklistEvent_EventType[ChecklistEvent_EventType["EVENT_TYPE_ITEM_REVERTED"] = 4] = "EVENT_TYPE_ITEM_REVERTED";
20
- ChecklistEvent_EventType[ChecklistEvent_EventType["EVENT_TYPE_NOTE_ADDED"] = 5] = "EVENT_TYPE_NOTE_ADDED";
21
- ChecklistEvent_EventType[ChecklistEvent_EventType["EVENT_TYPE_ITEM_FLAGGED"] = 6] = "EVENT_TYPE_ITEM_FLAGGED";
22
- ChecklistEvent_EventType[ChecklistEvent_EventType["EVENT_TYPE_FLAG_RESOLVED"] = 7] = "EVENT_TYPE_FLAG_RESOLVED";
23
- ChecklistEvent_EventType[ChecklistEvent_EventType["EVENT_TYPE_PROCEDURE_STARTED"] = 8] = "EVENT_TYPE_PROCEDURE_STARTED";
24
- ChecklistEvent_EventType[ChecklistEvent_EventType["EVENT_TYPE_PROCEDURE_COMPLETED"] = 9] = "EVENT_TYPE_PROCEDURE_COMPLETED";
25
- ChecklistEvent_EventType[ChecklistEvent_EventType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
26
- })(ChecklistEvent_EventType || (exports.ChecklistEvent_EventType = ChecklistEvent_EventType = {}));
27
- function checklistEvent_EventTypeFromJSON(object) {
28
- switch (object) {
29
- case 0:
30
- case "EVENT_TYPE_UNKNOWN":
31
- return ChecklistEvent_EventType.EVENT_TYPE_UNKNOWN;
32
- case 1:
33
- case "EVENT_TYPE_CHECKLIST_OPENED":
34
- return ChecklistEvent_EventType.EVENT_TYPE_CHECKLIST_OPENED;
35
- case 2:
36
- case "EVENT_TYPE_ITEM_STARTED":
37
- return ChecklistEvent_EventType.EVENT_TYPE_ITEM_STARTED;
38
- case 3:
39
- case "EVENT_TYPE_ITEM_COMPLETED":
40
- return ChecklistEvent_EventType.EVENT_TYPE_ITEM_COMPLETED;
41
- case 4:
42
- case "EVENT_TYPE_ITEM_REVERTED":
43
- return ChecklistEvent_EventType.EVENT_TYPE_ITEM_REVERTED;
44
- case 5:
45
- case "EVENT_TYPE_NOTE_ADDED":
46
- return ChecklistEvent_EventType.EVENT_TYPE_NOTE_ADDED;
47
- case 6:
48
- case "EVENT_TYPE_ITEM_FLAGGED":
49
- return ChecklistEvent_EventType.EVENT_TYPE_ITEM_FLAGGED;
50
- case 7:
51
- case "EVENT_TYPE_FLAG_RESOLVED":
52
- return ChecklistEvent_EventType.EVENT_TYPE_FLAG_RESOLVED;
53
- case 8:
54
- case "EVENT_TYPE_PROCEDURE_STARTED":
55
- return ChecklistEvent_EventType.EVENT_TYPE_PROCEDURE_STARTED;
56
- case 9:
57
- case "EVENT_TYPE_PROCEDURE_COMPLETED":
58
- return ChecklistEvent_EventType.EVENT_TYPE_PROCEDURE_COMPLETED;
59
- case -1:
60
- case "UNRECOGNIZED":
61
- default:
62
- return ChecklistEvent_EventType.UNRECOGNIZED;
63
- }
64
- }
65
- exports.checklistEvent_EventTypeFromJSON = checklistEvent_EventTypeFromJSON;
66
- function checklistEvent_EventTypeToJSON(object) {
67
- switch (object) {
68
- case ChecklistEvent_EventType.EVENT_TYPE_UNKNOWN:
69
- return "EVENT_TYPE_UNKNOWN";
70
- case ChecklistEvent_EventType.EVENT_TYPE_CHECKLIST_OPENED:
71
- return "EVENT_TYPE_CHECKLIST_OPENED";
72
- case ChecklistEvent_EventType.EVENT_TYPE_ITEM_STARTED:
73
- return "EVENT_TYPE_ITEM_STARTED";
74
- case ChecklistEvent_EventType.EVENT_TYPE_ITEM_COMPLETED:
75
- return "EVENT_TYPE_ITEM_COMPLETED";
76
- case ChecklistEvent_EventType.EVENT_TYPE_ITEM_REVERTED:
77
- return "EVENT_TYPE_ITEM_REVERTED";
78
- case ChecklistEvent_EventType.EVENT_TYPE_NOTE_ADDED:
79
- return "EVENT_TYPE_NOTE_ADDED";
80
- case ChecklistEvent_EventType.EVENT_TYPE_ITEM_FLAGGED:
81
- return "EVENT_TYPE_ITEM_FLAGGED";
82
- case ChecklistEvent_EventType.EVENT_TYPE_FLAG_RESOLVED:
83
- return "EVENT_TYPE_FLAG_RESOLVED";
84
- case ChecklistEvent_EventType.EVENT_TYPE_PROCEDURE_STARTED:
85
- return "EVENT_TYPE_PROCEDURE_STARTED";
86
- case ChecklistEvent_EventType.EVENT_TYPE_PROCEDURE_COMPLETED:
87
- return "EVENT_TYPE_PROCEDURE_COMPLETED";
88
- case ChecklistEvent_EventType.UNRECOGNIZED:
89
- default:
90
- return "UNRECOGNIZED";
91
- }
92
- }
93
- exports.checklistEvent_EventTypeToJSON = checklistEvent_EventTypeToJSON;
94
- function createBaseChecklistEvent() {
95
- return {
96
- $type: "keelson.ChecklistEvent",
97
- timestamp: undefined,
98
- eventId: "",
99
- eventType: 0,
100
- operatorId: "",
101
- username: "",
102
- role: "",
103
- rocSite: "",
104
- procedureId: "",
105
- itemId: "",
106
- detail: "",
107
- referenceId: "",
108
- };
109
- }
110
- exports.ChecklistEvent = {
111
- $type: "keelson.ChecklistEvent",
112
- encode(message, writer = new wire_1.BinaryWriter()) {
113
- if (message.timestamp !== undefined) {
114
- timestamp_1.Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(10).fork()).join();
115
- }
116
- if (message.eventId !== "") {
117
- writer.uint32(18).string(message.eventId);
118
- }
119
- if (message.eventType !== 0) {
120
- writer.uint32(24).int32(message.eventType);
121
- }
122
- if (message.operatorId !== "") {
123
- writer.uint32(34).string(message.operatorId);
124
- }
125
- if (message.username !== "") {
126
- writer.uint32(42).string(message.username);
127
- }
128
- if (message.role !== "") {
129
- writer.uint32(50).string(message.role);
130
- }
131
- if (message.rocSite !== "") {
132
- writer.uint32(58).string(message.rocSite);
133
- }
134
- if (message.procedureId !== "") {
135
- writer.uint32(66).string(message.procedureId);
136
- }
137
- if (message.itemId !== "") {
138
- writer.uint32(74).string(message.itemId);
139
- }
140
- if (message.detail !== "") {
141
- writer.uint32(82).string(message.detail);
142
- }
143
- if (message.referenceId !== "") {
144
- writer.uint32(90).string(message.referenceId);
145
- }
146
- return writer;
147
- },
148
- decode(input, length) {
149
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
150
- let end = length === undefined ? reader.len : reader.pos + length;
151
- const message = createBaseChecklistEvent();
152
- while (reader.pos < end) {
153
- const tag = reader.uint32();
154
- switch (tag >>> 3) {
155
- case 1: {
156
- if (tag !== 10) {
157
- break;
158
- }
159
- message.timestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
160
- continue;
161
- }
162
- case 2: {
163
- if (tag !== 18) {
164
- break;
165
- }
166
- message.eventId = reader.string();
167
- continue;
168
- }
169
- case 3: {
170
- if (tag !== 24) {
171
- break;
172
- }
173
- message.eventType = reader.int32();
174
- continue;
175
- }
176
- case 4: {
177
- if (tag !== 34) {
178
- break;
179
- }
180
- message.operatorId = reader.string();
181
- continue;
182
- }
183
- case 5: {
184
- if (tag !== 42) {
185
- break;
186
- }
187
- message.username = reader.string();
188
- continue;
189
- }
190
- case 6: {
191
- if (tag !== 50) {
192
- break;
193
- }
194
- message.role = reader.string();
195
- continue;
196
- }
197
- case 7: {
198
- if (tag !== 58) {
199
- break;
200
- }
201
- message.rocSite = reader.string();
202
- continue;
203
- }
204
- case 8: {
205
- if (tag !== 66) {
206
- break;
207
- }
208
- message.procedureId = reader.string();
209
- continue;
210
- }
211
- case 9: {
212
- if (tag !== 74) {
213
- break;
214
- }
215
- message.itemId = reader.string();
216
- continue;
217
- }
218
- case 10: {
219
- if (tag !== 82) {
220
- break;
221
- }
222
- message.detail = reader.string();
223
- continue;
224
- }
225
- case 11: {
226
- if (tag !== 90) {
227
- break;
228
- }
229
- message.referenceId = reader.string();
230
- continue;
231
- }
232
- }
233
- if ((tag & 7) === 4 || tag === 0) {
234
- break;
235
- }
236
- reader.skip(tag & 7);
237
- }
238
- return message;
239
- },
240
- fromJSON(object) {
241
- return {
242
- $type: exports.ChecklistEvent.$type,
243
- timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
244
- eventId: isSet(object.eventId) ? globalThis.String(object.eventId) : "",
245
- eventType: isSet(object.eventType) ? checklistEvent_EventTypeFromJSON(object.eventType) : 0,
246
- operatorId: isSet(object.operatorId) ? globalThis.String(object.operatorId) : "",
247
- username: isSet(object.username) ? globalThis.String(object.username) : "",
248
- role: isSet(object.role) ? globalThis.String(object.role) : "",
249
- rocSite: isSet(object.rocSite) ? globalThis.String(object.rocSite) : "",
250
- procedureId: isSet(object.procedureId) ? globalThis.String(object.procedureId) : "",
251
- itemId: isSet(object.itemId) ? globalThis.String(object.itemId) : "",
252
- detail: isSet(object.detail) ? globalThis.String(object.detail) : "",
253
- referenceId: isSet(object.referenceId) ? globalThis.String(object.referenceId) : "",
254
- };
255
- },
256
- toJSON(message) {
257
- const obj = {};
258
- if (message.timestamp !== undefined) {
259
- obj.timestamp = message.timestamp.toISOString();
260
- }
261
- if (message.eventId !== "") {
262
- obj.eventId = message.eventId;
263
- }
264
- if (message.eventType !== 0) {
265
- obj.eventType = checklistEvent_EventTypeToJSON(message.eventType);
266
- }
267
- if (message.operatorId !== "") {
268
- obj.operatorId = message.operatorId;
269
- }
270
- if (message.username !== "") {
271
- obj.username = message.username;
272
- }
273
- if (message.role !== "") {
274
- obj.role = message.role;
275
- }
276
- if (message.rocSite !== "") {
277
- obj.rocSite = message.rocSite;
278
- }
279
- if (message.procedureId !== "") {
280
- obj.procedureId = message.procedureId;
281
- }
282
- if (message.itemId !== "") {
283
- obj.itemId = message.itemId;
284
- }
285
- if (message.detail !== "") {
286
- obj.detail = message.detail;
287
- }
288
- if (message.referenceId !== "") {
289
- obj.referenceId = message.referenceId;
290
- }
291
- return obj;
292
- },
293
- create(base) {
294
- return exports.ChecklistEvent.fromPartial(base ?? {});
295
- },
296
- fromPartial(object) {
297
- const message = createBaseChecklistEvent();
298
- message.timestamp = object.timestamp ?? undefined;
299
- message.eventId = object.eventId ?? "";
300
- message.eventType = object.eventType ?? 0;
301
- message.operatorId = object.operatorId ?? "";
302
- message.username = object.username ?? "";
303
- message.role = object.role ?? "";
304
- message.rocSite = object.rocSite ?? "";
305
- message.procedureId = object.procedureId ?? "";
306
- message.itemId = object.itemId ?? "";
307
- message.detail = object.detail ?? "";
308
- message.referenceId = object.referenceId ?? "";
309
- return message;
310
- },
311
- };
312
- typeRegistry_1.messageTypeRegistry.set(exports.ChecklistEvent.$type, exports.ChecklistEvent);
313
- function toTimestamp(date) {
314
- const seconds = Math.trunc(date.getTime() / 1000);
315
- const nanos = (date.getTime() % 1000) * 1000000;
316
- return { $type: "google.protobuf.Timestamp", seconds, nanos };
317
- }
318
- function fromTimestamp(t) {
319
- let millis = (t.seconds || 0) * 1000;
320
- millis += (t.nanos || 0) / 1000000;
321
- return new globalThis.Date(millis);
322
- }
323
- function fromJsonTimestamp(o) {
324
- if (o instanceof globalThis.Date) {
325
- return o;
326
- }
327
- else if (typeof o === "string") {
328
- return new globalThis.Date(o);
329
- }
330
- else {
331
- return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
332
- }
333
- }
334
- function isSet(value) {
335
- return value !== null && value !== undefined;
336
- }
@@ -1,45 +0,0 @@
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
- export declare enum ChecklistPresence_CursorState {
18
- CURSOR_IDLE = 0,
19
- CURSOR_VIEWING = 1,
20
- CURSOR_EDITING_NOTE = 2,
21
- UNRECOGNIZED = -1
22
- }
23
- export declare function checklistPresence_CursorStateFromJSON(object: any): ChecklistPresence_CursorState;
24
- export declare function checklistPresence_CursorStateToJSON(object: ChecklistPresence_CursorState): string;
25
- export declare const ChecklistPresence: MessageFns<ChecklistPresence, "keelson.ChecklistPresence">;
26
- type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
27
- 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 {} ? {
28
- [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
29
- } : Partial<T>;
30
- type KeysOfUnion<T> = T extends T ? keyof T : never;
31
- type Exact<P, I extends P> = P extends Builtin ? P : P & {
32
- [K in keyof P]: Exact<P[K], I[K]>;
33
- } & {
34
- [K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never;
35
- };
36
- interface MessageFns<T, V extends string> {
37
- readonly $type: V;
38
- encode(message: T, writer?: BinaryWriter): BinaryWriter;
39
- decode(input: BinaryReader | Uint8Array, length?: number): T;
40
- fromJSON(object: any): T;
41
- toJSON(message: T): unknown;
42
- create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
43
- fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
44
- }
45
- export {};