@rise-maritime/keelson-js 0.6.0-alpha.282.dev.2 → 0.6.0-alpha.307.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.
Files changed (38) hide show
  1. package/dist/index.d.ts +31 -31
  2. package/dist/interfaces/ContainerControl.d.ts +7 -0
  3. package/dist/interfaces/ContainerControl.js +18 -1
  4. package/dist/interfaces/ContainerHost.d.ts +45 -0
  5. package/dist/interfaces/ContainerHost.js +332 -1
  6. package/dist/interfaces/NavigationRiskControl.d.ts +161 -0
  7. package/dist/interfaces/NavigationRiskControl.js +1007 -0
  8. package/dist/interfaces/ReplayControl.d.ts +49 -1
  9. package/dist/interfaces/ReplayControl.js +274 -1
  10. package/dist/interfaces/Route.d.ts +3 -0
  11. package/dist/interfaces/serviceRegistry.d.ts +33 -33
  12. package/dist/interfaces/serviceRegistry.js +2 -2
  13. package/dist/interfaces.json +1 -1
  14. package/dist/payloads/AdviceDisposition.d.ts +20 -5
  15. package/dist/payloads/AdviceDisposition.js +7 -0
  16. package/dist/payloads/ContainerHost.d.ts +48 -0
  17. package/dist/payloads/ContainerHost.js +341 -1
  18. package/dist/payloads/NavigationAdvice.d.ts +24 -0
  19. package/dist/payloads/NavigationAdvice.js +91 -1
  20. package/dist/payloads/NavigationRisk.d.ts +341 -0
  21. package/dist/payloads/NavigationRisk.js +2530 -0
  22. package/dist/payloads/NavigationState.d.ts +0 -46
  23. package/dist/payloads/NavigationState.js +1 -252
  24. package/dist/payloads/Route.d.ts +3 -0
  25. package/dist/payloads/index.keelson.d.ts +1 -0
  26. package/dist/payloads/index.keelson.js +1 -0
  27. package/dist/subjects.json +1 -0
  28. package/package.json +1 -1
  29. package/dist/interfaces/NavigationControl.d.ts +0 -169
  30. package/dist/interfaces/NavigationControl.js +0 -806
  31. package/dist/interfaces/NavigationState.d.ts +0 -132
  32. package/dist/interfaces/NavigationState.js +0 -615
  33. package/dist/interfaces/OperationalAuthority.d.ts +0 -217
  34. package/dist/interfaces/OperationalAuthority.js +0 -807
  35. package/dist/interfaces/VesselType.d.ts +0 -133
  36. package/dist/interfaces/VesselType.js +0 -726
  37. package/dist/interfaces/Voyage.d.ts +0 -151
  38. package/dist/interfaces/Voyage.js +0 -855
@@ -1,807 +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: OperationalAuthority.proto
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.OperationalAuthority_AuthorityConstraint = exports.OperationalAuthority_SourceAssessment = exports.OperationalAuthority_ComponentScoresEntry = exports.OperationalAuthority = exports.operationalAuthority_AuthorityConstraint_CauseToJSON = exports.operationalAuthority_AuthorityConstraint_CauseFromJSON = exports.OperationalAuthority_AuthorityConstraint_Cause = exports.operationalAuthority_AuthorityLevelToJSON = exports.operationalAuthority_AuthorityLevelFromJSON = exports.OperationalAuthority_AuthorityLevel = exports.protobufPackage = void 0;
9
- /* eslint-disable */
10
- const wire_1 = require("@bufbuild/protobuf/wire");
11
- const timestamp_1 = require("./google/protobuf/timestamp");
12
- exports.protobufPackage = "keelson";
13
- var OperationalAuthority_AuthorityLevel;
14
- (function (OperationalAuthority_AuthorityLevel) {
15
- /**
16
- * AUTHORITY_LEVEL_UNKNOWN - No valid determination could be made — not a determination that the
17
- * minimum is permissible. Raised when an essential requirement is not
18
- * even advertised, so the monitor cannot tell whether it is satisfied.
19
- * Consumers MUST treat this as non-authorizing, exactly like
20
- * MINIMAL_SAFE_MODE, and MUST NOT treat it as "no constraints known".
21
- */
22
- OperationalAuthority_AuthorityLevel[OperationalAuthority_AuthorityLevel["AUTHORITY_LEVEL_UNKNOWN"] = 0] = "AUTHORITY_LEVEL_UNKNOWN";
23
- OperationalAuthority_AuthorityLevel[OperationalAuthority_AuthorityLevel["AUTHORITY_LEVEL_MINIMAL_SAFE_MODE"] = 1] = "AUTHORITY_LEVEL_MINIMAL_SAFE_MODE";
24
- OperationalAuthority_AuthorityLevel[OperationalAuthority_AuthorityLevel["AUTHORITY_LEVEL_SUPERVISED_REMOTE"] = 2] = "AUTHORITY_LEVEL_SUPERVISED_REMOTE";
25
- OperationalAuthority_AuthorityLevel[OperationalAuthority_AuthorityLevel["AUTHORITY_LEVEL_REMOTE_CONTROLLED"] = 3] = "AUTHORITY_LEVEL_REMOTE_CONTROLLED";
26
- OperationalAuthority_AuthorityLevel[OperationalAuthority_AuthorityLevel["AUTHORITY_LEVEL_ASSISTED_AUTONOMOUS"] = 4] = "AUTHORITY_LEVEL_ASSISTED_AUTONOMOUS";
27
- OperationalAuthority_AuthorityLevel[OperationalAuthority_AuthorityLevel["AUTHORITY_LEVEL_FULL_AUTONOMOUS"] = 5] = "AUTHORITY_LEVEL_FULL_AUTONOMOUS";
28
- OperationalAuthority_AuthorityLevel[OperationalAuthority_AuthorityLevel["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
29
- })(OperationalAuthority_AuthorityLevel || (exports.OperationalAuthority_AuthorityLevel = OperationalAuthority_AuthorityLevel = {}));
30
- function operationalAuthority_AuthorityLevelFromJSON(object) {
31
- switch (object) {
32
- case 0:
33
- case "AUTHORITY_LEVEL_UNKNOWN":
34
- return OperationalAuthority_AuthorityLevel.AUTHORITY_LEVEL_UNKNOWN;
35
- case 1:
36
- case "AUTHORITY_LEVEL_MINIMAL_SAFE_MODE":
37
- return OperationalAuthority_AuthorityLevel.AUTHORITY_LEVEL_MINIMAL_SAFE_MODE;
38
- case 2:
39
- case "AUTHORITY_LEVEL_SUPERVISED_REMOTE":
40
- return OperationalAuthority_AuthorityLevel.AUTHORITY_LEVEL_SUPERVISED_REMOTE;
41
- case 3:
42
- case "AUTHORITY_LEVEL_REMOTE_CONTROLLED":
43
- return OperationalAuthority_AuthorityLevel.AUTHORITY_LEVEL_REMOTE_CONTROLLED;
44
- case 4:
45
- case "AUTHORITY_LEVEL_ASSISTED_AUTONOMOUS":
46
- return OperationalAuthority_AuthorityLevel.AUTHORITY_LEVEL_ASSISTED_AUTONOMOUS;
47
- case 5:
48
- case "AUTHORITY_LEVEL_FULL_AUTONOMOUS":
49
- return OperationalAuthority_AuthorityLevel.AUTHORITY_LEVEL_FULL_AUTONOMOUS;
50
- case -1:
51
- case "UNRECOGNIZED":
52
- default:
53
- return OperationalAuthority_AuthorityLevel.UNRECOGNIZED;
54
- }
55
- }
56
- exports.operationalAuthority_AuthorityLevelFromJSON = operationalAuthority_AuthorityLevelFromJSON;
57
- function operationalAuthority_AuthorityLevelToJSON(object) {
58
- switch (object) {
59
- case OperationalAuthority_AuthorityLevel.AUTHORITY_LEVEL_UNKNOWN:
60
- return "AUTHORITY_LEVEL_UNKNOWN";
61
- case OperationalAuthority_AuthorityLevel.AUTHORITY_LEVEL_MINIMAL_SAFE_MODE:
62
- return "AUTHORITY_LEVEL_MINIMAL_SAFE_MODE";
63
- case OperationalAuthority_AuthorityLevel.AUTHORITY_LEVEL_SUPERVISED_REMOTE:
64
- return "AUTHORITY_LEVEL_SUPERVISED_REMOTE";
65
- case OperationalAuthority_AuthorityLevel.AUTHORITY_LEVEL_REMOTE_CONTROLLED:
66
- return "AUTHORITY_LEVEL_REMOTE_CONTROLLED";
67
- case OperationalAuthority_AuthorityLevel.AUTHORITY_LEVEL_ASSISTED_AUTONOMOUS:
68
- return "AUTHORITY_LEVEL_ASSISTED_AUTONOMOUS";
69
- case OperationalAuthority_AuthorityLevel.AUTHORITY_LEVEL_FULL_AUTONOMOUS:
70
- return "AUTHORITY_LEVEL_FULL_AUTONOMOUS";
71
- case OperationalAuthority_AuthorityLevel.UNRECOGNIZED:
72
- default:
73
- return "UNRECOGNIZED";
74
- }
75
- }
76
- exports.operationalAuthority_AuthorityLevelToJSON = operationalAuthority_AuthorityLevelToJSON;
77
- var OperationalAuthority_AuthorityConstraint_Cause;
78
- (function (OperationalAuthority_AuthorityConstraint_Cause) {
79
- OperationalAuthority_AuthorityConstraint_Cause[OperationalAuthority_AuthorityConstraint_Cause["CAUSE_UNSPECIFIED"] = 0] = "CAUSE_UNSPECIFIED";
80
- OperationalAuthority_AuthorityConstraint_Cause[OperationalAuthority_AuthorityConstraint_Cause["CAUSE_DEGRADED"] = 1] = "CAUSE_DEGRADED";
81
- OperationalAuthority_AuthorityConstraint_Cause[OperationalAuthority_AuthorityConstraint_Cause["CAUSE_CRITICAL"] = 2] = "CAUSE_CRITICAL";
82
- OperationalAuthority_AuthorityConstraint_Cause[OperationalAuthority_AuthorityConstraint_Cause["CAUSE_INACTIVE"] = 3] = "CAUSE_INACTIVE";
83
- /**
84
- * CAUSE_UNKNOWN - No evidence either way. Capped because absence of evidence is not
85
- * evidence of health for a component something depends on.
86
- */
87
- OperationalAuthority_AuthorityConstraint_Cause[OperationalAuthority_AuthorityConstraint_Cause["CAUSE_UNKNOWN"] = 4] = "CAUSE_UNKNOWN";
88
- /**
89
- * CAUSE_NOT_ADVERTISED - Expected but never advertised — the monitor cannot tell whether the
90
- * requirement is met, so no valid determination exists.
91
- */
92
- OperationalAuthority_AuthorityConstraint_Cause[OperationalAuthority_AuthorityConstraint_Cause["CAUSE_NOT_ADVERTISED"] = 5] = "CAUSE_NOT_ADVERTISED";
93
- OperationalAuthority_AuthorityConstraint_Cause[OperationalAuthority_AuthorityConstraint_Cause["CAUSE_CONFIGURATION_INVALID"] = 6] = "CAUSE_CONFIGURATION_INVALID";
94
- OperationalAuthority_AuthorityConstraint_Cause[OperationalAuthority_AuthorityConstraint_Cause["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
95
- })(OperationalAuthority_AuthorityConstraint_Cause || (exports.OperationalAuthority_AuthorityConstraint_Cause = OperationalAuthority_AuthorityConstraint_Cause = {}));
96
- function operationalAuthority_AuthorityConstraint_CauseFromJSON(object) {
97
- switch (object) {
98
- case 0:
99
- case "CAUSE_UNSPECIFIED":
100
- return OperationalAuthority_AuthorityConstraint_Cause.CAUSE_UNSPECIFIED;
101
- case 1:
102
- case "CAUSE_DEGRADED":
103
- return OperationalAuthority_AuthorityConstraint_Cause.CAUSE_DEGRADED;
104
- case 2:
105
- case "CAUSE_CRITICAL":
106
- return OperationalAuthority_AuthorityConstraint_Cause.CAUSE_CRITICAL;
107
- case 3:
108
- case "CAUSE_INACTIVE":
109
- return OperationalAuthority_AuthorityConstraint_Cause.CAUSE_INACTIVE;
110
- case 4:
111
- case "CAUSE_UNKNOWN":
112
- return OperationalAuthority_AuthorityConstraint_Cause.CAUSE_UNKNOWN;
113
- case 5:
114
- case "CAUSE_NOT_ADVERTISED":
115
- return OperationalAuthority_AuthorityConstraint_Cause.CAUSE_NOT_ADVERTISED;
116
- case 6:
117
- case "CAUSE_CONFIGURATION_INVALID":
118
- return OperationalAuthority_AuthorityConstraint_Cause.CAUSE_CONFIGURATION_INVALID;
119
- case -1:
120
- case "UNRECOGNIZED":
121
- default:
122
- return OperationalAuthority_AuthorityConstraint_Cause.UNRECOGNIZED;
123
- }
124
- }
125
- exports.operationalAuthority_AuthorityConstraint_CauseFromJSON = operationalAuthority_AuthorityConstraint_CauseFromJSON;
126
- function operationalAuthority_AuthorityConstraint_CauseToJSON(object) {
127
- switch (object) {
128
- case OperationalAuthority_AuthorityConstraint_Cause.CAUSE_UNSPECIFIED:
129
- return "CAUSE_UNSPECIFIED";
130
- case OperationalAuthority_AuthorityConstraint_Cause.CAUSE_DEGRADED:
131
- return "CAUSE_DEGRADED";
132
- case OperationalAuthority_AuthorityConstraint_Cause.CAUSE_CRITICAL:
133
- return "CAUSE_CRITICAL";
134
- case OperationalAuthority_AuthorityConstraint_Cause.CAUSE_INACTIVE:
135
- return "CAUSE_INACTIVE";
136
- case OperationalAuthority_AuthorityConstraint_Cause.CAUSE_UNKNOWN:
137
- return "CAUSE_UNKNOWN";
138
- case OperationalAuthority_AuthorityConstraint_Cause.CAUSE_NOT_ADVERTISED:
139
- return "CAUSE_NOT_ADVERTISED";
140
- case OperationalAuthority_AuthorityConstraint_Cause.CAUSE_CONFIGURATION_INVALID:
141
- return "CAUSE_CONFIGURATION_INVALID";
142
- case OperationalAuthority_AuthorityConstraint_Cause.UNRECOGNIZED:
143
- default:
144
- return "UNRECOGNIZED";
145
- }
146
- }
147
- exports.operationalAuthority_AuthorityConstraint_CauseToJSON = operationalAuthority_AuthorityConstraint_CauseToJSON;
148
- function createBaseOperationalAuthority() {
149
- return {
150
- timestamp: undefined,
151
- level: 0,
152
- compositeScore: undefined,
153
- reason: "",
154
- componentScores: {},
155
- authorityScore: undefined,
156
- sourceAssessments: [],
157
- activeConstraints: [],
158
- policyId: undefined,
159
- policyConfigDigest: undefined,
160
- };
161
- }
162
- exports.OperationalAuthority = {
163
- encode(message, writer = new wire_1.BinaryWriter()) {
164
- if (message.timestamp !== undefined) {
165
- timestamp_1.Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(10).fork()).join();
166
- }
167
- if (message.level !== 0) {
168
- writer.uint32(16).int32(message.level);
169
- }
170
- if (message.compositeScore !== undefined) {
171
- writer.uint32(29).float(message.compositeScore);
172
- }
173
- if (message.reason !== "") {
174
- writer.uint32(34).string(message.reason);
175
- }
176
- Object.entries(message.componentScores).forEach(([key, value]) => {
177
- exports.OperationalAuthority_ComponentScoresEntry.encode({ key: key, value }, writer.uint32(42).fork()).join();
178
- });
179
- if (message.authorityScore !== undefined) {
180
- writer.uint32(53).float(message.authorityScore);
181
- }
182
- for (const v of message.sourceAssessments) {
183
- exports.OperationalAuthority_SourceAssessment.encode(v, writer.uint32(58).fork()).join();
184
- }
185
- for (const v of message.activeConstraints) {
186
- exports.OperationalAuthority_AuthorityConstraint.encode(v, writer.uint32(66).fork()).join();
187
- }
188
- if (message.policyId !== undefined) {
189
- writer.uint32(74).string(message.policyId);
190
- }
191
- if (message.policyConfigDigest !== undefined) {
192
- writer.uint32(82).bytes(message.policyConfigDigest);
193
- }
194
- return writer;
195
- },
196
- decode(input, length) {
197
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
198
- let end = length === undefined ? reader.len : reader.pos + length;
199
- const message = createBaseOperationalAuthority();
200
- while (reader.pos < end) {
201
- const tag = reader.uint32();
202
- switch (tag >>> 3) {
203
- case 1: {
204
- if (tag !== 10) {
205
- break;
206
- }
207
- message.timestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
208
- continue;
209
- }
210
- case 2: {
211
- if (tag !== 16) {
212
- break;
213
- }
214
- message.level = reader.int32();
215
- continue;
216
- }
217
- case 3: {
218
- if (tag !== 29) {
219
- break;
220
- }
221
- message.compositeScore = reader.float();
222
- continue;
223
- }
224
- case 4: {
225
- if (tag !== 34) {
226
- break;
227
- }
228
- message.reason = reader.string();
229
- continue;
230
- }
231
- case 5: {
232
- if (tag !== 42) {
233
- break;
234
- }
235
- const entry5 = exports.OperationalAuthority_ComponentScoresEntry.decode(reader, reader.uint32());
236
- if (entry5.value !== undefined) {
237
- message.componentScores[entry5.key] = entry5.value;
238
- }
239
- continue;
240
- }
241
- case 6: {
242
- if (tag !== 53) {
243
- break;
244
- }
245
- message.authorityScore = reader.float();
246
- continue;
247
- }
248
- case 7: {
249
- if (tag !== 58) {
250
- break;
251
- }
252
- message.sourceAssessments.push(exports.OperationalAuthority_SourceAssessment.decode(reader, reader.uint32()));
253
- continue;
254
- }
255
- case 8: {
256
- if (tag !== 66) {
257
- break;
258
- }
259
- message.activeConstraints.push(exports.OperationalAuthority_AuthorityConstraint.decode(reader, reader.uint32()));
260
- continue;
261
- }
262
- case 9: {
263
- if (tag !== 74) {
264
- break;
265
- }
266
- message.policyId = reader.string();
267
- continue;
268
- }
269
- case 10: {
270
- if (tag !== 82) {
271
- break;
272
- }
273
- message.policyConfigDigest = reader.bytes();
274
- continue;
275
- }
276
- }
277
- if ((tag & 7) === 4 || tag === 0) {
278
- break;
279
- }
280
- reader.skip(tag & 7);
281
- }
282
- return message;
283
- },
284
- fromJSON(object) {
285
- return {
286
- timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
287
- level: isSet(object.level) ? operationalAuthority_AuthorityLevelFromJSON(object.level) : 0,
288
- compositeScore: isSet(object.compositeScore) ? globalThis.Number(object.compositeScore) : undefined,
289
- reason: isSet(object.reason) ? globalThis.String(object.reason) : "",
290
- componentScores: isObject(object.componentScores)
291
- ? Object.entries(object.componentScores).reduce((acc, [key, value]) => {
292
- acc[key] = Number(value);
293
- return acc;
294
- }, {})
295
- : {},
296
- authorityScore: isSet(object.authorityScore) ? globalThis.Number(object.authorityScore) : undefined,
297
- sourceAssessments: globalThis.Array.isArray(object?.sourceAssessments)
298
- ? object.sourceAssessments.map((e) => exports.OperationalAuthority_SourceAssessment.fromJSON(e))
299
- : [],
300
- activeConstraints: globalThis.Array.isArray(object?.activeConstraints)
301
- ? object.activeConstraints.map((e) => exports.OperationalAuthority_AuthorityConstraint.fromJSON(e))
302
- : [],
303
- policyId: isSet(object.policyId) ? globalThis.String(object.policyId) : undefined,
304
- policyConfigDigest: isSet(object.policyConfigDigest) ? bytesFromBase64(object.policyConfigDigest) : undefined,
305
- };
306
- },
307
- toJSON(message) {
308
- const obj = {};
309
- if (message.timestamp !== undefined) {
310
- obj.timestamp = message.timestamp.toISOString();
311
- }
312
- if (message.level !== 0) {
313
- obj.level = operationalAuthority_AuthorityLevelToJSON(message.level);
314
- }
315
- if (message.compositeScore !== undefined) {
316
- obj.compositeScore = message.compositeScore;
317
- }
318
- if (message.reason !== "") {
319
- obj.reason = message.reason;
320
- }
321
- if (message.componentScores) {
322
- const entries = Object.entries(message.componentScores);
323
- if (entries.length > 0) {
324
- obj.componentScores = {};
325
- entries.forEach(([k, v]) => {
326
- obj.componentScores[k] = v;
327
- });
328
- }
329
- }
330
- if (message.authorityScore !== undefined) {
331
- obj.authorityScore = message.authorityScore;
332
- }
333
- if (message.sourceAssessments?.length) {
334
- obj.sourceAssessments = message.sourceAssessments.map((e) => exports.OperationalAuthority_SourceAssessment.toJSON(e));
335
- }
336
- if (message.activeConstraints?.length) {
337
- obj.activeConstraints = message.activeConstraints.map((e) => exports.OperationalAuthority_AuthorityConstraint.toJSON(e));
338
- }
339
- if (message.policyId !== undefined) {
340
- obj.policyId = message.policyId;
341
- }
342
- if (message.policyConfigDigest !== undefined) {
343
- obj.policyConfigDigest = base64FromBytes(message.policyConfigDigest);
344
- }
345
- return obj;
346
- },
347
- create(base) {
348
- return exports.OperationalAuthority.fromPartial(base ?? {});
349
- },
350
- fromPartial(object) {
351
- const message = createBaseOperationalAuthority();
352
- message.timestamp = object.timestamp ?? undefined;
353
- message.level = object.level ?? 0;
354
- message.compositeScore = object.compositeScore ?? undefined;
355
- message.reason = object.reason ?? "";
356
- message.componentScores = Object.entries(object.componentScores ?? {}).reduce((acc, [key, value]) => {
357
- if (value !== undefined) {
358
- acc[key] = globalThis.Number(value);
359
- }
360
- return acc;
361
- }, {});
362
- message.authorityScore = object.authorityScore ?? undefined;
363
- message.sourceAssessments =
364
- object.sourceAssessments?.map((e) => exports.OperationalAuthority_SourceAssessment.fromPartial(e)) || [];
365
- message.activeConstraints =
366
- object.activeConstraints?.map((e) => exports.OperationalAuthority_AuthorityConstraint.fromPartial(e)) || [];
367
- message.policyId = object.policyId ?? undefined;
368
- message.policyConfigDigest = object.policyConfigDigest ?? undefined;
369
- return message;
370
- },
371
- };
372
- function createBaseOperationalAuthority_ComponentScoresEntry() {
373
- return { key: "", value: 0 };
374
- }
375
- exports.OperationalAuthority_ComponentScoresEntry = {
376
- encode(message, writer = new wire_1.BinaryWriter()) {
377
- if (message.key !== "") {
378
- writer.uint32(10).string(message.key);
379
- }
380
- if (message.value !== 0) {
381
- writer.uint32(21).float(message.value);
382
- }
383
- return writer;
384
- },
385
- decode(input, length) {
386
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
387
- let end = length === undefined ? reader.len : reader.pos + length;
388
- const message = createBaseOperationalAuthority_ComponentScoresEntry();
389
- while (reader.pos < end) {
390
- const tag = reader.uint32();
391
- switch (tag >>> 3) {
392
- case 1: {
393
- if (tag !== 10) {
394
- break;
395
- }
396
- message.key = reader.string();
397
- continue;
398
- }
399
- case 2: {
400
- if (tag !== 21) {
401
- break;
402
- }
403
- message.value = reader.float();
404
- continue;
405
- }
406
- }
407
- if ((tag & 7) === 4 || tag === 0) {
408
- break;
409
- }
410
- reader.skip(tag & 7);
411
- }
412
- return message;
413
- },
414
- fromJSON(object) {
415
- return {
416
- key: isSet(object.key) ? globalThis.String(object.key) : "",
417
- value: isSet(object.value) ? globalThis.Number(object.value) : 0,
418
- };
419
- },
420
- toJSON(message) {
421
- const obj = {};
422
- if (message.key !== "") {
423
- obj.key = message.key;
424
- }
425
- if (message.value !== 0) {
426
- obj.value = message.value;
427
- }
428
- return obj;
429
- },
430
- create(base) {
431
- return exports.OperationalAuthority_ComponentScoresEntry.fromPartial(base ?? {});
432
- },
433
- fromPartial(object) {
434
- const message = createBaseOperationalAuthority_ComponentScoresEntry();
435
- message.key = object.key ?? "";
436
- message.value = object.value ?? 0;
437
- return message;
438
- },
439
- };
440
- function createBaseOperationalAuthority_SourceAssessment() {
441
- return {
442
- sourceId: "",
443
- healthScore: undefined,
444
- coverageFraction: undefined,
445
- effectiveScore: undefined,
446
- eligibleSubjectCount: 0,
447
- assessedSubjectCount: 0,
448
- unassessedSubjects: [],
449
- notAdvertisedSubjects: [],
450
- essential: false,
451
- authorityCap: undefined,
452
- };
453
- }
454
- exports.OperationalAuthority_SourceAssessment = {
455
- encode(message, writer = new wire_1.BinaryWriter()) {
456
- if (message.sourceId !== "") {
457
- writer.uint32(10).string(message.sourceId);
458
- }
459
- if (message.healthScore !== undefined) {
460
- writer.uint32(21).float(message.healthScore);
461
- }
462
- if (message.coverageFraction !== undefined) {
463
- writer.uint32(29).float(message.coverageFraction);
464
- }
465
- if (message.effectiveScore !== undefined) {
466
- writer.uint32(37).float(message.effectiveScore);
467
- }
468
- if (message.eligibleSubjectCount !== 0) {
469
- writer.uint32(40).uint32(message.eligibleSubjectCount);
470
- }
471
- if (message.assessedSubjectCount !== 0) {
472
- writer.uint32(48).uint32(message.assessedSubjectCount);
473
- }
474
- for (const v of message.unassessedSubjects) {
475
- writer.uint32(58).string(v);
476
- }
477
- for (const v of message.notAdvertisedSubjects) {
478
- writer.uint32(66).string(v);
479
- }
480
- if (message.essential !== false) {
481
- writer.uint32(72).bool(message.essential);
482
- }
483
- if (message.authorityCap !== undefined) {
484
- writer.uint32(85).float(message.authorityCap);
485
- }
486
- return writer;
487
- },
488
- decode(input, length) {
489
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
490
- let end = length === undefined ? reader.len : reader.pos + length;
491
- const message = createBaseOperationalAuthority_SourceAssessment();
492
- while (reader.pos < end) {
493
- const tag = reader.uint32();
494
- switch (tag >>> 3) {
495
- case 1: {
496
- if (tag !== 10) {
497
- break;
498
- }
499
- message.sourceId = reader.string();
500
- continue;
501
- }
502
- case 2: {
503
- if (tag !== 21) {
504
- break;
505
- }
506
- message.healthScore = reader.float();
507
- continue;
508
- }
509
- case 3: {
510
- if (tag !== 29) {
511
- break;
512
- }
513
- message.coverageFraction = reader.float();
514
- continue;
515
- }
516
- case 4: {
517
- if (tag !== 37) {
518
- break;
519
- }
520
- message.effectiveScore = reader.float();
521
- continue;
522
- }
523
- case 5: {
524
- if (tag !== 40) {
525
- break;
526
- }
527
- message.eligibleSubjectCount = reader.uint32();
528
- continue;
529
- }
530
- case 6: {
531
- if (tag !== 48) {
532
- break;
533
- }
534
- message.assessedSubjectCount = reader.uint32();
535
- continue;
536
- }
537
- case 7: {
538
- if (tag !== 58) {
539
- break;
540
- }
541
- message.unassessedSubjects.push(reader.string());
542
- continue;
543
- }
544
- case 8: {
545
- if (tag !== 66) {
546
- break;
547
- }
548
- message.notAdvertisedSubjects.push(reader.string());
549
- continue;
550
- }
551
- case 9: {
552
- if (tag !== 72) {
553
- break;
554
- }
555
- message.essential = reader.bool();
556
- continue;
557
- }
558
- case 10: {
559
- if (tag !== 85) {
560
- break;
561
- }
562
- message.authorityCap = reader.float();
563
- continue;
564
- }
565
- }
566
- if ((tag & 7) === 4 || tag === 0) {
567
- break;
568
- }
569
- reader.skip(tag & 7);
570
- }
571
- return message;
572
- },
573
- fromJSON(object) {
574
- return {
575
- sourceId: isSet(object.sourceId) ? globalThis.String(object.sourceId) : "",
576
- healthScore: isSet(object.healthScore) ? globalThis.Number(object.healthScore) : undefined,
577
- coverageFraction: isSet(object.coverageFraction) ? globalThis.Number(object.coverageFraction) : undefined,
578
- effectiveScore: isSet(object.effectiveScore) ? globalThis.Number(object.effectiveScore) : undefined,
579
- eligibleSubjectCount: isSet(object.eligibleSubjectCount) ? globalThis.Number(object.eligibleSubjectCount) : 0,
580
- assessedSubjectCount: isSet(object.assessedSubjectCount) ? globalThis.Number(object.assessedSubjectCount) : 0,
581
- unassessedSubjects: globalThis.Array.isArray(object?.unassessedSubjects)
582
- ? object.unassessedSubjects.map((e) => globalThis.String(e))
583
- : [],
584
- notAdvertisedSubjects: globalThis.Array.isArray(object?.notAdvertisedSubjects)
585
- ? object.notAdvertisedSubjects.map((e) => globalThis.String(e))
586
- : [],
587
- essential: isSet(object.essential) ? globalThis.Boolean(object.essential) : false,
588
- authorityCap: isSet(object.authorityCap) ? globalThis.Number(object.authorityCap) : undefined,
589
- };
590
- },
591
- toJSON(message) {
592
- const obj = {};
593
- if (message.sourceId !== "") {
594
- obj.sourceId = message.sourceId;
595
- }
596
- if (message.healthScore !== undefined) {
597
- obj.healthScore = message.healthScore;
598
- }
599
- if (message.coverageFraction !== undefined) {
600
- obj.coverageFraction = message.coverageFraction;
601
- }
602
- if (message.effectiveScore !== undefined) {
603
- obj.effectiveScore = message.effectiveScore;
604
- }
605
- if (message.eligibleSubjectCount !== 0) {
606
- obj.eligibleSubjectCount = Math.round(message.eligibleSubjectCount);
607
- }
608
- if (message.assessedSubjectCount !== 0) {
609
- obj.assessedSubjectCount = Math.round(message.assessedSubjectCount);
610
- }
611
- if (message.unassessedSubjects?.length) {
612
- obj.unassessedSubjects = message.unassessedSubjects;
613
- }
614
- if (message.notAdvertisedSubjects?.length) {
615
- obj.notAdvertisedSubjects = message.notAdvertisedSubjects;
616
- }
617
- if (message.essential !== false) {
618
- obj.essential = message.essential;
619
- }
620
- if (message.authorityCap !== undefined) {
621
- obj.authorityCap = message.authorityCap;
622
- }
623
- return obj;
624
- },
625
- create(base) {
626
- return exports.OperationalAuthority_SourceAssessment.fromPartial(base ?? {});
627
- },
628
- fromPartial(object) {
629
- const message = createBaseOperationalAuthority_SourceAssessment();
630
- message.sourceId = object.sourceId ?? "";
631
- message.healthScore = object.healthScore ?? undefined;
632
- message.coverageFraction = object.coverageFraction ?? undefined;
633
- message.effectiveScore = object.effectiveScore ?? undefined;
634
- message.eligibleSubjectCount = object.eligibleSubjectCount ?? 0;
635
- message.assessedSubjectCount = object.assessedSubjectCount ?? 0;
636
- message.unassessedSubjects = object.unassessedSubjects?.map((e) => e) || [];
637
- message.notAdvertisedSubjects = object.notAdvertisedSubjects?.map((e) => e) || [];
638
- message.essential = object.essential ?? false;
639
- message.authorityCap = object.authorityCap ?? undefined;
640
- return message;
641
- },
642
- };
643
- function createBaseOperationalAuthority_AuthorityConstraint() {
644
- return { componentId: "", capLevel: 0, capScore: undefined, cause: 0, subjectId: undefined };
645
- }
646
- exports.OperationalAuthority_AuthorityConstraint = {
647
- encode(message, writer = new wire_1.BinaryWriter()) {
648
- if (message.componentId !== "") {
649
- writer.uint32(10).string(message.componentId);
650
- }
651
- if (message.capLevel !== 0) {
652
- writer.uint32(16).int32(message.capLevel);
653
- }
654
- if (message.capScore !== undefined) {
655
- writer.uint32(29).float(message.capScore);
656
- }
657
- if (message.cause !== 0) {
658
- writer.uint32(32).int32(message.cause);
659
- }
660
- if (message.subjectId !== undefined) {
661
- writer.uint32(42).string(message.subjectId);
662
- }
663
- return writer;
664
- },
665
- decode(input, length) {
666
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
667
- let end = length === undefined ? reader.len : reader.pos + length;
668
- const message = createBaseOperationalAuthority_AuthorityConstraint();
669
- while (reader.pos < end) {
670
- const tag = reader.uint32();
671
- switch (tag >>> 3) {
672
- case 1: {
673
- if (tag !== 10) {
674
- break;
675
- }
676
- message.componentId = reader.string();
677
- continue;
678
- }
679
- case 2: {
680
- if (tag !== 16) {
681
- break;
682
- }
683
- message.capLevel = reader.int32();
684
- continue;
685
- }
686
- case 3: {
687
- if (tag !== 29) {
688
- break;
689
- }
690
- message.capScore = reader.float();
691
- continue;
692
- }
693
- case 4: {
694
- if (tag !== 32) {
695
- break;
696
- }
697
- message.cause = reader.int32();
698
- continue;
699
- }
700
- case 5: {
701
- if (tag !== 42) {
702
- break;
703
- }
704
- message.subjectId = reader.string();
705
- continue;
706
- }
707
- }
708
- if ((tag & 7) === 4 || tag === 0) {
709
- break;
710
- }
711
- reader.skip(tag & 7);
712
- }
713
- return message;
714
- },
715
- fromJSON(object) {
716
- return {
717
- componentId: isSet(object.componentId) ? globalThis.String(object.componentId) : "",
718
- capLevel: isSet(object.capLevel) ? operationalAuthority_AuthorityLevelFromJSON(object.capLevel) : 0,
719
- capScore: isSet(object.capScore) ? globalThis.Number(object.capScore) : undefined,
720
- cause: isSet(object.cause) ? operationalAuthority_AuthorityConstraint_CauseFromJSON(object.cause) : 0,
721
- subjectId: isSet(object.subjectId) ? globalThis.String(object.subjectId) : undefined,
722
- };
723
- },
724
- toJSON(message) {
725
- const obj = {};
726
- if (message.componentId !== "") {
727
- obj.componentId = message.componentId;
728
- }
729
- if (message.capLevel !== 0) {
730
- obj.capLevel = operationalAuthority_AuthorityLevelToJSON(message.capLevel);
731
- }
732
- if (message.capScore !== undefined) {
733
- obj.capScore = message.capScore;
734
- }
735
- if (message.cause !== 0) {
736
- obj.cause = operationalAuthority_AuthorityConstraint_CauseToJSON(message.cause);
737
- }
738
- if (message.subjectId !== undefined) {
739
- obj.subjectId = message.subjectId;
740
- }
741
- return obj;
742
- },
743
- create(base) {
744
- return exports.OperationalAuthority_AuthorityConstraint.fromPartial(base ?? {});
745
- },
746
- fromPartial(object) {
747
- const message = createBaseOperationalAuthority_AuthorityConstraint();
748
- message.componentId = object.componentId ?? "";
749
- message.capLevel = object.capLevel ?? 0;
750
- message.capScore = object.capScore ?? undefined;
751
- message.cause = object.cause ?? 0;
752
- message.subjectId = object.subjectId ?? undefined;
753
- return message;
754
- },
755
- };
756
- function bytesFromBase64(b64) {
757
- if (globalThis.Buffer) {
758
- return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
759
- }
760
- else {
761
- const bin = globalThis.atob(b64);
762
- const arr = new Uint8Array(bin.length);
763
- for (let i = 0; i < bin.length; ++i) {
764
- arr[i] = bin.charCodeAt(i);
765
- }
766
- return arr;
767
- }
768
- }
769
- function base64FromBytes(arr) {
770
- if (globalThis.Buffer) {
771
- return globalThis.Buffer.from(arr).toString("base64");
772
- }
773
- else {
774
- const bin = [];
775
- arr.forEach((byte) => {
776
- bin.push(globalThis.String.fromCharCode(byte));
777
- });
778
- return globalThis.btoa(bin.join(""));
779
- }
780
- }
781
- function toTimestamp(date) {
782
- const seconds = Math.trunc(date.getTime() / 1000);
783
- const nanos = (date.getTime() % 1000) * 1000000;
784
- return { seconds, nanos };
785
- }
786
- function fromTimestamp(t) {
787
- let millis = (t.seconds || 0) * 1000;
788
- millis += (t.nanos || 0) / 1000000;
789
- return new globalThis.Date(millis);
790
- }
791
- function fromJsonTimestamp(o) {
792
- if (o instanceof globalThis.Date) {
793
- return o;
794
- }
795
- else if (typeof o === "string") {
796
- return new globalThis.Date(o);
797
- }
798
- else {
799
- return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
800
- }
801
- }
802
- function isObject(value) {
803
- return typeof value === "object" && value !== null;
804
- }
805
- function isSet(value) {
806
- return value !== null && value !== undefined;
807
- }