@rise-maritime/keelson-js 0.5.3 → 0.6.0-alpha.221.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.
Files changed (111) hide show
  1. package/dist/index.d.ts +524 -1
  2. package/dist/index.js +114 -5
  3. package/dist/index.test.js +57 -0
  4. package/dist/interfaces/AlarmAck.d.ts +62 -0
  5. package/dist/interfaces/AlarmAck.js +218 -0
  6. package/dist/interfaces/Configurable.d.ts +24 -18
  7. package/dist/interfaces/Configurable.js +24 -22
  8. package/dist/interfaces/Coordinate.d.ts +38 -0
  9. package/dist/interfaces/Coordinate.js +82 -0
  10. package/dist/interfaces/ErrorResponse.d.ts +1 -1
  11. package/dist/interfaces/ErrorResponse.js +1 -1
  12. package/dist/interfaces/MavlinkCommand.d.ts +24 -18
  13. package/dist/interfaces/MavlinkCommand.js +24 -22
  14. package/dist/interfaces/Mission.d.ts +128 -0
  15. package/dist/interfaces/Mission.js +800 -0
  16. package/dist/interfaces/NetworkPingPong.d.ts +16 -16
  17. package/dist/interfaces/NetworkPingPong.js +16 -16
  18. package/dist/interfaces/ReplayControl.d.ts +72 -30
  19. package/dist/interfaces/ReplayControl.js +72 -58
  20. package/dist/interfaces/Route.d.ts +627 -0
  21. package/dist/interfaces/Route.js +4148 -0
  22. package/dist/interfaces/RoutePlanner.d.ts +152 -0
  23. package/dist/interfaces/RoutePlanner.js +268 -0
  24. package/dist/interfaces/ScenarioCheckpoint.d.ts +154 -0
  25. package/dist/interfaces/ScenarioCheckpoint.js +694 -0
  26. package/dist/interfaces/ScenarioControl.d.ts +144 -0
  27. package/dist/interfaces/ScenarioControl.js +552 -0
  28. package/dist/interfaces/Severity.d.ts +22 -0
  29. package/dist/interfaces/Severity.js +72 -0
  30. package/dist/interfaces/SimulationControl.d.ts +69 -0
  31. package/dist/interfaces/SimulationControl.js +153 -0
  32. package/dist/interfaces/Subscriber.d.ts +24 -18
  33. package/dist/interfaces/Subscriber.js +24 -22
  34. package/dist/interfaces/VehicleCommon.d.ts +1 -32
  35. package/dist/interfaces/VehicleCommon.js +2 -74
  36. package/dist/interfaces/VehicleControl.d.ts +34 -28
  37. package/dist/interfaces/VehicleControl.js +34 -22
  38. package/dist/interfaces/VehicleGeofence.d.ts +26 -19
  39. package/dist/interfaces/VehicleGeofence.js +40 -37
  40. package/dist/interfaces/VehicleLifecycle.d.ts +32 -20
  41. package/dist/interfaces/VehicleLifecycle.js +32 -28
  42. package/dist/interfaces/VehicleMission.d.ts +42 -97
  43. package/dist/interfaces/VehicleMission.js +41 -696
  44. package/dist/interfaces/VehicleNavigation.d.ts +30 -24
  45. package/dist/interfaces/VehicleNavigation.js +30 -22
  46. package/dist/interfaces/VehicleParam.d.ts +48 -24
  47. package/dist/interfaces/VehicleParam.js +48 -40
  48. package/dist/interfaces/VehicleSimulatorControl.d.ts +57 -0
  49. package/dist/interfaces/VehicleSimulatorControl.js +155 -0
  50. package/dist/interfaces/WHEPProxy.d.ts +16 -16
  51. package/dist/interfaces/WHEPProxy.js +16 -16
  52. package/dist/interfaces/foxglove/GeoJSON.d.ts +27 -0
  53. package/dist/interfaces/foxglove/GeoJSON.js +65 -0
  54. package/dist/interfaces/foxglove/LocationFix.d.ts +49 -0
  55. package/dist/interfaces/foxglove/LocationFix.js +246 -0
  56. package/dist/interfaces/google/protobuf/any.d.ts +144 -0
  57. package/dist/interfaces/google/protobuf/any.js +107 -0
  58. package/dist/interfaces/google/protobuf/duration.d.ts +99 -0
  59. package/dist/interfaces/google/protobuf/duration.js +92 -0
  60. package/dist/interfaces/serviceRegistry.d.ts +520 -0
  61. package/dist/interfaces/serviceRegistry.js +40 -0
  62. package/dist/interfaces.json +19 -0
  63. package/dist/payloads/Alarm.d.ts +7 -12
  64. package/dist/payloads/Alarm.js +4 -54
  65. package/dist/payloads/CommandAuthority.d.ts +82 -0
  66. package/dist/payloads/CommandAuthority.js +364 -0
  67. package/dist/payloads/Coordinate.d.ts +39 -0
  68. package/dist/payloads/Coordinate.js +85 -0
  69. package/dist/payloads/EntityHealth.d.ts +9 -0
  70. package/dist/payloads/EntityHealth.js +14 -0
  71. package/dist/payloads/Mission.d.ts +137 -0
  72. package/dist/payloads/Mission.js +826 -0
  73. package/dist/payloads/OperationalAuthority.d.ts +172 -5
  74. package/dist/payloads/OperationalAuthority.js +525 -6
  75. package/dist/payloads/Route.d.ts +649 -0
  76. package/dist/payloads/Route.js +4257 -0
  77. package/dist/payloads/RouteChangeEvent.d.ts +42 -0
  78. package/dist/payloads/RouteChangeEvent.js +223 -0
  79. package/dist/payloads/RouteEditAuthority.d.ts +87 -0
  80. package/dist/payloads/RouteEditAuthority.js +380 -0
  81. package/dist/payloads/RouteExecution.d.ts +64 -0
  82. package/dist/payloads/RouteExecution.js +310 -0
  83. package/dist/payloads/ScenarioStatus.d.ts +160 -0
  84. package/dist/payloads/ScenarioStatus.js +654 -0
  85. package/dist/payloads/Severity.d.ts +13 -6
  86. package/dist/payloads/Severity.js +30 -18
  87. package/dist/payloads/SimulationStatus.d.ts +3 -4
  88. package/dist/payloads/SimulationStatus.js +12 -18
  89. package/dist/payloads/TestObjectStatus.d.ts +154 -0
  90. package/dist/payloads/TestObjectStatus.js +580 -0
  91. package/dist/payloads/VesselType.d.ts +2 -1
  92. package/dist/payloads/VesselType.js +1 -1
  93. package/dist/payloads/Voyage.d.ts +154 -0
  94. package/dist/payloads/Voyage.js +866 -0
  95. package/dist/payloads/WarrantRecord.d.ts +168 -0
  96. package/dist/payloads/WarrantRecord.js +781 -0
  97. package/dist/payloads/foxglove/CompressedPointCloud.d.ts +37 -0
  98. package/dist/payloads/foxglove/CompressedPointCloud.js +185 -0
  99. package/dist/payloads/google/protobuf/any.d.ts +145 -0
  100. package/dist/payloads/google/protobuf/any.js +110 -0
  101. package/dist/payloads/google/protobuf/empty.d.ts +34 -0
  102. package/dist/payloads/google/protobuf/empty.js +50 -0
  103. package/dist/payloads/index.foxglove.d.ts +1 -0
  104. package/dist/payloads/index.foxglove.js +1 -0
  105. package/dist/payloads/index.google.protobuf.d.ts +2 -0
  106. package/dist/payloads/index.google.protobuf.js +2 -0
  107. package/dist/payloads/index.keelson.d.ts +12 -1
  108. package/dist/payloads/index.keelson.js +12 -1
  109. package/dist/qos.json +89 -0
  110. package/dist/subjects.json +30 -1
  111. package/package.json +2 -1
@@ -0,0 +1,694 @@
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: ScenarioCheckpoint.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ScenarioCheckpointDefinition = exports.ListCheckpointsResponse = exports.ListCheckpointsRequest = exports.CheckpointInfo = exports.RestoreResponse = exports.RestoreRequest = exports.SaveResponse = exports.SaveRequest = 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.interfaces.scenario_checkpoint";
13
+ function createBaseSaveRequest() {
14
+ return { checkpointId: "", note: "", overwrite: false };
15
+ }
16
+ exports.SaveRequest = {
17
+ encode(message, writer = new wire_1.BinaryWriter()) {
18
+ if (message.checkpointId !== "") {
19
+ writer.uint32(10).string(message.checkpointId);
20
+ }
21
+ if (message.note !== "") {
22
+ writer.uint32(18).string(message.note);
23
+ }
24
+ if (message.overwrite !== false) {
25
+ writer.uint32(24).bool(message.overwrite);
26
+ }
27
+ return writer;
28
+ },
29
+ decode(input, length) {
30
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
31
+ let end = length === undefined ? reader.len : reader.pos + length;
32
+ const message = createBaseSaveRequest();
33
+ while (reader.pos < end) {
34
+ const tag = reader.uint32();
35
+ switch (tag >>> 3) {
36
+ case 1: {
37
+ if (tag !== 10) {
38
+ break;
39
+ }
40
+ message.checkpointId = reader.string();
41
+ continue;
42
+ }
43
+ case 2: {
44
+ if (tag !== 18) {
45
+ break;
46
+ }
47
+ message.note = reader.string();
48
+ continue;
49
+ }
50
+ case 3: {
51
+ if (tag !== 24) {
52
+ break;
53
+ }
54
+ message.overwrite = reader.bool();
55
+ continue;
56
+ }
57
+ }
58
+ if ((tag & 7) === 4 || tag === 0) {
59
+ break;
60
+ }
61
+ reader.skip(tag & 7);
62
+ }
63
+ return message;
64
+ },
65
+ fromJSON(object) {
66
+ return {
67
+ checkpointId: isSet(object.checkpointId) ? globalThis.String(object.checkpointId) : "",
68
+ note: isSet(object.note) ? globalThis.String(object.note) : "",
69
+ overwrite: isSet(object.overwrite) ? globalThis.Boolean(object.overwrite) : false,
70
+ };
71
+ },
72
+ toJSON(message) {
73
+ const obj = {};
74
+ if (message.checkpointId !== "") {
75
+ obj.checkpointId = message.checkpointId;
76
+ }
77
+ if (message.note !== "") {
78
+ obj.note = message.note;
79
+ }
80
+ if (message.overwrite !== false) {
81
+ obj.overwrite = message.overwrite;
82
+ }
83
+ return obj;
84
+ },
85
+ create(base) {
86
+ return exports.SaveRequest.fromPartial(base ?? {});
87
+ },
88
+ fromPartial(object) {
89
+ const message = createBaseSaveRequest();
90
+ message.checkpointId = object.checkpointId ?? "";
91
+ message.note = object.note ?? "";
92
+ message.overwrite = object.overwrite ?? false;
93
+ return message;
94
+ },
95
+ };
96
+ function createBaseSaveResponse() {
97
+ return { checkpointId: "", tick: 0, simulationTime: undefined };
98
+ }
99
+ exports.SaveResponse = {
100
+ encode(message, writer = new wire_1.BinaryWriter()) {
101
+ if (message.checkpointId !== "") {
102
+ writer.uint32(10).string(message.checkpointId);
103
+ }
104
+ if (message.tick !== 0) {
105
+ writer.uint32(16).uint64(message.tick);
106
+ }
107
+ if (message.simulationTime !== undefined) {
108
+ timestamp_1.Timestamp.encode(toTimestamp(message.simulationTime), writer.uint32(26).fork()).join();
109
+ }
110
+ return writer;
111
+ },
112
+ decode(input, length) {
113
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
114
+ let end = length === undefined ? reader.len : reader.pos + length;
115
+ const message = createBaseSaveResponse();
116
+ while (reader.pos < end) {
117
+ const tag = reader.uint32();
118
+ switch (tag >>> 3) {
119
+ case 1: {
120
+ if (tag !== 10) {
121
+ break;
122
+ }
123
+ message.checkpointId = reader.string();
124
+ continue;
125
+ }
126
+ case 2: {
127
+ if (tag !== 16) {
128
+ break;
129
+ }
130
+ message.tick = longToNumber(reader.uint64());
131
+ continue;
132
+ }
133
+ case 3: {
134
+ if (tag !== 26) {
135
+ break;
136
+ }
137
+ message.simulationTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
138
+ continue;
139
+ }
140
+ }
141
+ if ((tag & 7) === 4 || tag === 0) {
142
+ break;
143
+ }
144
+ reader.skip(tag & 7);
145
+ }
146
+ return message;
147
+ },
148
+ fromJSON(object) {
149
+ return {
150
+ checkpointId: isSet(object.checkpointId) ? globalThis.String(object.checkpointId) : "",
151
+ tick: isSet(object.tick) ? globalThis.Number(object.tick) : 0,
152
+ simulationTime: isSet(object.simulationTime) ? fromJsonTimestamp(object.simulationTime) : undefined,
153
+ };
154
+ },
155
+ toJSON(message) {
156
+ const obj = {};
157
+ if (message.checkpointId !== "") {
158
+ obj.checkpointId = message.checkpointId;
159
+ }
160
+ if (message.tick !== 0) {
161
+ obj.tick = Math.round(message.tick);
162
+ }
163
+ if (message.simulationTime !== undefined) {
164
+ obj.simulationTime = message.simulationTime.toISOString();
165
+ }
166
+ return obj;
167
+ },
168
+ create(base) {
169
+ return exports.SaveResponse.fromPartial(base ?? {});
170
+ },
171
+ fromPartial(object) {
172
+ const message = createBaseSaveResponse();
173
+ message.checkpointId = object.checkpointId ?? "";
174
+ message.tick = object.tick ?? 0;
175
+ message.simulationTime = object.simulationTime ?? undefined;
176
+ return message;
177
+ },
178
+ };
179
+ function createBaseRestoreRequest() {
180
+ return { checkpointId: "" };
181
+ }
182
+ exports.RestoreRequest = {
183
+ encode(message, writer = new wire_1.BinaryWriter()) {
184
+ if (message.checkpointId !== "") {
185
+ writer.uint32(10).string(message.checkpointId);
186
+ }
187
+ return writer;
188
+ },
189
+ decode(input, length) {
190
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
191
+ let end = length === undefined ? reader.len : reader.pos + length;
192
+ const message = createBaseRestoreRequest();
193
+ while (reader.pos < end) {
194
+ const tag = reader.uint32();
195
+ switch (tag >>> 3) {
196
+ case 1: {
197
+ if (tag !== 10) {
198
+ break;
199
+ }
200
+ message.checkpointId = reader.string();
201
+ continue;
202
+ }
203
+ }
204
+ if ((tag & 7) === 4 || tag === 0) {
205
+ break;
206
+ }
207
+ reader.skip(tag & 7);
208
+ }
209
+ return message;
210
+ },
211
+ fromJSON(object) {
212
+ return { checkpointId: isSet(object.checkpointId) ? globalThis.String(object.checkpointId) : "" };
213
+ },
214
+ toJSON(message) {
215
+ const obj = {};
216
+ if (message.checkpointId !== "") {
217
+ obj.checkpointId = message.checkpointId;
218
+ }
219
+ return obj;
220
+ },
221
+ create(base) {
222
+ return exports.RestoreRequest.fromPartial(base ?? {});
223
+ },
224
+ fromPartial(object) {
225
+ const message = createBaseRestoreRequest();
226
+ message.checkpointId = object.checkpointId ?? "";
227
+ return message;
228
+ },
229
+ };
230
+ function createBaseRestoreResponse() {
231
+ return { runId: "", parentRunId: "", parentTick: 0, simulationTime: undefined };
232
+ }
233
+ exports.RestoreResponse = {
234
+ encode(message, writer = new wire_1.BinaryWriter()) {
235
+ if (message.runId !== "") {
236
+ writer.uint32(10).string(message.runId);
237
+ }
238
+ if (message.parentRunId !== "") {
239
+ writer.uint32(18).string(message.parentRunId);
240
+ }
241
+ if (message.parentTick !== 0) {
242
+ writer.uint32(24).uint64(message.parentTick);
243
+ }
244
+ if (message.simulationTime !== undefined) {
245
+ timestamp_1.Timestamp.encode(toTimestamp(message.simulationTime), writer.uint32(34).fork()).join();
246
+ }
247
+ return writer;
248
+ },
249
+ decode(input, length) {
250
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
251
+ let end = length === undefined ? reader.len : reader.pos + length;
252
+ const message = createBaseRestoreResponse();
253
+ while (reader.pos < end) {
254
+ const tag = reader.uint32();
255
+ switch (tag >>> 3) {
256
+ case 1: {
257
+ if (tag !== 10) {
258
+ break;
259
+ }
260
+ message.runId = reader.string();
261
+ continue;
262
+ }
263
+ case 2: {
264
+ if (tag !== 18) {
265
+ break;
266
+ }
267
+ message.parentRunId = reader.string();
268
+ continue;
269
+ }
270
+ case 3: {
271
+ if (tag !== 24) {
272
+ break;
273
+ }
274
+ message.parentTick = longToNumber(reader.uint64());
275
+ continue;
276
+ }
277
+ case 4: {
278
+ if (tag !== 34) {
279
+ break;
280
+ }
281
+ message.simulationTime = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
282
+ continue;
283
+ }
284
+ }
285
+ if ((tag & 7) === 4 || tag === 0) {
286
+ break;
287
+ }
288
+ reader.skip(tag & 7);
289
+ }
290
+ return message;
291
+ },
292
+ fromJSON(object) {
293
+ return {
294
+ runId: isSet(object.runId) ? globalThis.String(object.runId) : "",
295
+ parentRunId: isSet(object.parentRunId) ? globalThis.String(object.parentRunId) : "",
296
+ parentTick: isSet(object.parentTick) ? globalThis.Number(object.parentTick) : 0,
297
+ simulationTime: isSet(object.simulationTime) ? fromJsonTimestamp(object.simulationTime) : undefined,
298
+ };
299
+ },
300
+ toJSON(message) {
301
+ const obj = {};
302
+ if (message.runId !== "") {
303
+ obj.runId = message.runId;
304
+ }
305
+ if (message.parentRunId !== "") {
306
+ obj.parentRunId = message.parentRunId;
307
+ }
308
+ if (message.parentTick !== 0) {
309
+ obj.parentTick = Math.round(message.parentTick);
310
+ }
311
+ if (message.simulationTime !== undefined) {
312
+ obj.simulationTime = message.simulationTime.toISOString();
313
+ }
314
+ return obj;
315
+ },
316
+ create(base) {
317
+ return exports.RestoreResponse.fromPartial(base ?? {});
318
+ },
319
+ fromPartial(object) {
320
+ const message = createBaseRestoreResponse();
321
+ message.runId = object.runId ?? "";
322
+ message.parentRunId = object.parentRunId ?? "";
323
+ message.parentTick = object.parentTick ?? 0;
324
+ message.simulationTime = object.simulationTime ?? undefined;
325
+ return message;
326
+ },
327
+ };
328
+ function createBaseCheckpointInfo() {
329
+ return {
330
+ checkpointId: "",
331
+ scenarioId: "",
332
+ scenarioHash: "",
333
+ runId: "",
334
+ tick: 0,
335
+ createdAt: undefined,
336
+ note: "",
337
+ sizeBytes: 0,
338
+ };
339
+ }
340
+ exports.CheckpointInfo = {
341
+ encode(message, writer = new wire_1.BinaryWriter()) {
342
+ if (message.checkpointId !== "") {
343
+ writer.uint32(10).string(message.checkpointId);
344
+ }
345
+ if (message.scenarioId !== "") {
346
+ writer.uint32(18).string(message.scenarioId);
347
+ }
348
+ if (message.scenarioHash !== "") {
349
+ writer.uint32(26).string(message.scenarioHash);
350
+ }
351
+ if (message.runId !== "") {
352
+ writer.uint32(34).string(message.runId);
353
+ }
354
+ if (message.tick !== 0) {
355
+ writer.uint32(40).uint64(message.tick);
356
+ }
357
+ if (message.createdAt !== undefined) {
358
+ timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(50).fork()).join();
359
+ }
360
+ if (message.note !== "") {
361
+ writer.uint32(58).string(message.note);
362
+ }
363
+ if (message.sizeBytes !== 0) {
364
+ writer.uint32(64).uint64(message.sizeBytes);
365
+ }
366
+ return writer;
367
+ },
368
+ decode(input, length) {
369
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
370
+ let end = length === undefined ? reader.len : reader.pos + length;
371
+ const message = createBaseCheckpointInfo();
372
+ while (reader.pos < end) {
373
+ const tag = reader.uint32();
374
+ switch (tag >>> 3) {
375
+ case 1: {
376
+ if (tag !== 10) {
377
+ break;
378
+ }
379
+ message.checkpointId = reader.string();
380
+ continue;
381
+ }
382
+ case 2: {
383
+ if (tag !== 18) {
384
+ break;
385
+ }
386
+ message.scenarioId = reader.string();
387
+ continue;
388
+ }
389
+ case 3: {
390
+ if (tag !== 26) {
391
+ break;
392
+ }
393
+ message.scenarioHash = reader.string();
394
+ continue;
395
+ }
396
+ case 4: {
397
+ if (tag !== 34) {
398
+ break;
399
+ }
400
+ message.runId = reader.string();
401
+ continue;
402
+ }
403
+ case 5: {
404
+ if (tag !== 40) {
405
+ break;
406
+ }
407
+ message.tick = longToNumber(reader.uint64());
408
+ continue;
409
+ }
410
+ case 6: {
411
+ if (tag !== 50) {
412
+ break;
413
+ }
414
+ message.createdAt = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
415
+ continue;
416
+ }
417
+ case 7: {
418
+ if (tag !== 58) {
419
+ break;
420
+ }
421
+ message.note = reader.string();
422
+ continue;
423
+ }
424
+ case 8: {
425
+ if (tag !== 64) {
426
+ break;
427
+ }
428
+ message.sizeBytes = longToNumber(reader.uint64());
429
+ continue;
430
+ }
431
+ }
432
+ if ((tag & 7) === 4 || tag === 0) {
433
+ break;
434
+ }
435
+ reader.skip(tag & 7);
436
+ }
437
+ return message;
438
+ },
439
+ fromJSON(object) {
440
+ return {
441
+ checkpointId: isSet(object.checkpointId) ? globalThis.String(object.checkpointId) : "",
442
+ scenarioId: isSet(object.scenarioId) ? globalThis.String(object.scenarioId) : "",
443
+ scenarioHash: isSet(object.scenarioHash) ? globalThis.String(object.scenarioHash) : "",
444
+ runId: isSet(object.runId) ? globalThis.String(object.runId) : "",
445
+ tick: isSet(object.tick) ? globalThis.Number(object.tick) : 0,
446
+ createdAt: isSet(object.createdAt) ? fromJsonTimestamp(object.createdAt) : undefined,
447
+ note: isSet(object.note) ? globalThis.String(object.note) : "",
448
+ sizeBytes: isSet(object.sizeBytes) ? globalThis.Number(object.sizeBytes) : 0,
449
+ };
450
+ },
451
+ toJSON(message) {
452
+ const obj = {};
453
+ if (message.checkpointId !== "") {
454
+ obj.checkpointId = message.checkpointId;
455
+ }
456
+ if (message.scenarioId !== "") {
457
+ obj.scenarioId = message.scenarioId;
458
+ }
459
+ if (message.scenarioHash !== "") {
460
+ obj.scenarioHash = message.scenarioHash;
461
+ }
462
+ if (message.runId !== "") {
463
+ obj.runId = message.runId;
464
+ }
465
+ if (message.tick !== 0) {
466
+ obj.tick = Math.round(message.tick);
467
+ }
468
+ if (message.createdAt !== undefined) {
469
+ obj.createdAt = message.createdAt.toISOString();
470
+ }
471
+ if (message.note !== "") {
472
+ obj.note = message.note;
473
+ }
474
+ if (message.sizeBytes !== 0) {
475
+ obj.sizeBytes = Math.round(message.sizeBytes);
476
+ }
477
+ return obj;
478
+ },
479
+ create(base) {
480
+ return exports.CheckpointInfo.fromPartial(base ?? {});
481
+ },
482
+ fromPartial(object) {
483
+ const message = createBaseCheckpointInfo();
484
+ message.checkpointId = object.checkpointId ?? "";
485
+ message.scenarioId = object.scenarioId ?? "";
486
+ message.scenarioHash = object.scenarioHash ?? "";
487
+ message.runId = object.runId ?? "";
488
+ message.tick = object.tick ?? 0;
489
+ message.createdAt = object.createdAt ?? undefined;
490
+ message.note = object.note ?? "";
491
+ message.sizeBytes = object.sizeBytes ?? 0;
492
+ return message;
493
+ },
494
+ };
495
+ function createBaseListCheckpointsRequest() {
496
+ return { pattern: "" };
497
+ }
498
+ exports.ListCheckpointsRequest = {
499
+ encode(message, writer = new wire_1.BinaryWriter()) {
500
+ if (message.pattern !== "") {
501
+ writer.uint32(10).string(message.pattern);
502
+ }
503
+ return writer;
504
+ },
505
+ decode(input, length) {
506
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
507
+ let end = length === undefined ? reader.len : reader.pos + length;
508
+ const message = createBaseListCheckpointsRequest();
509
+ while (reader.pos < end) {
510
+ const tag = reader.uint32();
511
+ switch (tag >>> 3) {
512
+ case 1: {
513
+ if (tag !== 10) {
514
+ break;
515
+ }
516
+ message.pattern = reader.string();
517
+ continue;
518
+ }
519
+ }
520
+ if ((tag & 7) === 4 || tag === 0) {
521
+ break;
522
+ }
523
+ reader.skip(tag & 7);
524
+ }
525
+ return message;
526
+ },
527
+ fromJSON(object) {
528
+ return { pattern: isSet(object.pattern) ? globalThis.String(object.pattern) : "" };
529
+ },
530
+ toJSON(message) {
531
+ const obj = {};
532
+ if (message.pattern !== "") {
533
+ obj.pattern = message.pattern;
534
+ }
535
+ return obj;
536
+ },
537
+ create(base) {
538
+ return exports.ListCheckpointsRequest.fromPartial(base ?? {});
539
+ },
540
+ fromPartial(object) {
541
+ const message = createBaseListCheckpointsRequest();
542
+ message.pattern = object.pattern ?? "";
543
+ return message;
544
+ },
545
+ };
546
+ function createBaseListCheckpointsResponse() {
547
+ return { baseDirectory: "", checkpoints: [], truncated: false };
548
+ }
549
+ exports.ListCheckpointsResponse = {
550
+ encode(message, writer = new wire_1.BinaryWriter()) {
551
+ if (message.baseDirectory !== "") {
552
+ writer.uint32(10).string(message.baseDirectory);
553
+ }
554
+ for (const v of message.checkpoints) {
555
+ exports.CheckpointInfo.encode(v, writer.uint32(18).fork()).join();
556
+ }
557
+ if (message.truncated !== false) {
558
+ writer.uint32(24).bool(message.truncated);
559
+ }
560
+ return writer;
561
+ },
562
+ decode(input, length) {
563
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
564
+ let end = length === undefined ? reader.len : reader.pos + length;
565
+ const message = createBaseListCheckpointsResponse();
566
+ while (reader.pos < end) {
567
+ const tag = reader.uint32();
568
+ switch (tag >>> 3) {
569
+ case 1: {
570
+ if (tag !== 10) {
571
+ break;
572
+ }
573
+ message.baseDirectory = reader.string();
574
+ continue;
575
+ }
576
+ case 2: {
577
+ if (tag !== 18) {
578
+ break;
579
+ }
580
+ message.checkpoints.push(exports.CheckpointInfo.decode(reader, reader.uint32()));
581
+ continue;
582
+ }
583
+ case 3: {
584
+ if (tag !== 24) {
585
+ break;
586
+ }
587
+ message.truncated = reader.bool();
588
+ continue;
589
+ }
590
+ }
591
+ if ((tag & 7) === 4 || tag === 0) {
592
+ break;
593
+ }
594
+ reader.skip(tag & 7);
595
+ }
596
+ return message;
597
+ },
598
+ fromJSON(object) {
599
+ return {
600
+ baseDirectory: isSet(object.baseDirectory) ? globalThis.String(object.baseDirectory) : "",
601
+ checkpoints: globalThis.Array.isArray(object?.checkpoints)
602
+ ? object.checkpoints.map((e) => exports.CheckpointInfo.fromJSON(e))
603
+ : [],
604
+ truncated: isSet(object.truncated) ? globalThis.Boolean(object.truncated) : false,
605
+ };
606
+ },
607
+ toJSON(message) {
608
+ const obj = {};
609
+ if (message.baseDirectory !== "") {
610
+ obj.baseDirectory = message.baseDirectory;
611
+ }
612
+ if (message.checkpoints?.length) {
613
+ obj.checkpoints = message.checkpoints.map((e) => exports.CheckpointInfo.toJSON(e));
614
+ }
615
+ if (message.truncated !== false) {
616
+ obj.truncated = message.truncated;
617
+ }
618
+ return obj;
619
+ },
620
+ create(base) {
621
+ return exports.ListCheckpointsResponse.fromPartial(base ?? {});
622
+ },
623
+ fromPartial(object) {
624
+ const message = createBaseListCheckpointsResponse();
625
+ message.baseDirectory = object.baseDirectory ?? "";
626
+ message.checkpoints = object.checkpoints?.map((e) => exports.CheckpointInfo.fromPartial(e)) || [];
627
+ message.truncated = object.truncated ?? false;
628
+ return message;
629
+ },
630
+ };
631
+ exports.ScenarioCheckpointDefinition = {
632
+ name: "ScenarioCheckpoint",
633
+ fullName: "keelson.interfaces.scenario_checkpoint.ScenarioCheckpoint",
634
+ methods: {
635
+ save: {
636
+ name: "save",
637
+ requestType: exports.SaveRequest,
638
+ requestStream: false,
639
+ responseType: exports.SaveResponse,
640
+ responseStream: false,
641
+ options: {},
642
+ },
643
+ restore: {
644
+ name: "restore",
645
+ requestType: exports.RestoreRequest,
646
+ requestStream: false,
647
+ responseType: exports.RestoreResponse,
648
+ responseStream: false,
649
+ options: {},
650
+ },
651
+ list_checkpoints: {
652
+ name: "list_checkpoints",
653
+ requestType: exports.ListCheckpointsRequest,
654
+ requestStream: false,
655
+ responseType: exports.ListCheckpointsResponse,
656
+ responseStream: false,
657
+ options: {},
658
+ },
659
+ },
660
+ };
661
+ function toTimestamp(date) {
662
+ const seconds = Math.trunc(date.getTime() / 1000);
663
+ const nanos = (date.getTime() % 1000) * 1000000;
664
+ return { seconds, nanos };
665
+ }
666
+ function fromTimestamp(t) {
667
+ let millis = (t.seconds || 0) * 1000;
668
+ millis += (t.nanos || 0) / 1000000;
669
+ return new globalThis.Date(millis);
670
+ }
671
+ function fromJsonTimestamp(o) {
672
+ if (o instanceof globalThis.Date) {
673
+ return o;
674
+ }
675
+ else if (typeof o === "string") {
676
+ return new globalThis.Date(o);
677
+ }
678
+ else {
679
+ return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
680
+ }
681
+ }
682
+ function longToNumber(int64) {
683
+ const num = globalThis.Number(int64.toString());
684
+ if (num > globalThis.Number.MAX_SAFE_INTEGER) {
685
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
686
+ }
687
+ if (num < globalThis.Number.MIN_SAFE_INTEGER) {
688
+ throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
689
+ }
690
+ return num;
691
+ }
692
+ function isSet(value) {
693
+ return value !== null && value !== undefined;
694
+ }