@rise-maritime/keelson-js 0.6.0-alpha.225.dev.1 → 0.6.0-alpha.232.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 -0
- package/dist/interfaces/Route.d.ts +13 -0
- package/dist/interfaces/Route.js +32 -0
- package/dist/interfaces/ScenarioControl.d.ts +96 -3
- package/dist/interfaces/ScenarioControl.js +394 -37
- package/dist/interfaces/serviceRegistry.d.ts +8 -0
- package/dist/payloads/Route.d.ts +13 -0
- package/dist/payloads/Route.js +32 -0
- package/dist/payloads/index.keelson.d.ts +0 -2
- package/dist/payloads/index.keelson.js +0 -2
- package/dist/qos.json +3 -8
- package/dist/subjects.json +4 -2
- package/package.json +1 -1
- package/dist/payloads/ScenarioEvent.d.ts +0 -90
- package/dist/payloads/ScenarioEvent.js +0 -294
- package/dist/payloads/ScenarioTickAck.d.ts +0 -81
- package/dist/payloads/ScenarioTickAck.js +0 -225
|
@@ -1,225 +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: ScenarioTickAck.proto
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.ScenarioTickAck = exports.scenarioTickAck_DispositionToJSON = exports.scenarioTickAck_DispositionFromJSON = exports.ScenarioTickAck_Disposition = 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
|
-
* What the participant did with this tick. A BLOCKING participant is
|
|
15
|
-
* expected to COMPLETE every one; a DECIMATING participant is explicitly
|
|
16
|
-
* permitted to skip work to keep up, and this is where it says so — a skip
|
|
17
|
-
* that looks identical to a completion on the wire makes the distinction
|
|
18
|
-
* ScenarioParticipant.Role draws unobservable.
|
|
19
|
-
*/
|
|
20
|
-
var ScenarioTickAck_Disposition;
|
|
21
|
-
(function (ScenarioTickAck_Disposition) {
|
|
22
|
-
ScenarioTickAck_Disposition[ScenarioTickAck_Disposition["DISPOSITION_UNKNOWN"] = 0] = "DISPOSITION_UNKNOWN";
|
|
23
|
-
/** COMPLETED - The work for this tick is done. */
|
|
24
|
-
ScenarioTickAck_Disposition[ScenarioTickAck_Disposition["COMPLETED"] = 1] = "COMPLETED";
|
|
25
|
-
/**
|
|
26
|
-
* SKIPPED - Deliberately did less than a full tick's work, and stayed causal.
|
|
27
|
-
* Not an error: the participant is keeping up as designed.
|
|
28
|
-
*/
|
|
29
|
-
ScenarioTickAck_Disposition[ScenarioTickAck_Disposition["SKIPPED"] = 2] = "SKIPPED";
|
|
30
|
-
/**
|
|
31
|
-
* FAILED - Could not do the work. The authority decides what that means for the
|
|
32
|
-
* run — a failed tick from a BLOCKING participant is a failed run, from a
|
|
33
|
-
* DECIMATING one it is a degraded one — but it must be able to tell this
|
|
34
|
-
* apart from silence, which is indistinguishable from a dead process.
|
|
35
|
-
*/
|
|
36
|
-
ScenarioTickAck_Disposition[ScenarioTickAck_Disposition["FAILED"] = 3] = "FAILED";
|
|
37
|
-
ScenarioTickAck_Disposition[ScenarioTickAck_Disposition["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
38
|
-
})(ScenarioTickAck_Disposition || (exports.ScenarioTickAck_Disposition = ScenarioTickAck_Disposition = {}));
|
|
39
|
-
function scenarioTickAck_DispositionFromJSON(object) {
|
|
40
|
-
switch (object) {
|
|
41
|
-
case 0:
|
|
42
|
-
case "DISPOSITION_UNKNOWN":
|
|
43
|
-
return ScenarioTickAck_Disposition.DISPOSITION_UNKNOWN;
|
|
44
|
-
case 1:
|
|
45
|
-
case "COMPLETED":
|
|
46
|
-
return ScenarioTickAck_Disposition.COMPLETED;
|
|
47
|
-
case 2:
|
|
48
|
-
case "SKIPPED":
|
|
49
|
-
return ScenarioTickAck_Disposition.SKIPPED;
|
|
50
|
-
case 3:
|
|
51
|
-
case "FAILED":
|
|
52
|
-
return ScenarioTickAck_Disposition.FAILED;
|
|
53
|
-
case -1:
|
|
54
|
-
case "UNRECOGNIZED":
|
|
55
|
-
default:
|
|
56
|
-
return ScenarioTickAck_Disposition.UNRECOGNIZED;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
exports.scenarioTickAck_DispositionFromJSON = scenarioTickAck_DispositionFromJSON;
|
|
60
|
-
function scenarioTickAck_DispositionToJSON(object) {
|
|
61
|
-
switch (object) {
|
|
62
|
-
case ScenarioTickAck_Disposition.DISPOSITION_UNKNOWN:
|
|
63
|
-
return "DISPOSITION_UNKNOWN";
|
|
64
|
-
case ScenarioTickAck_Disposition.COMPLETED:
|
|
65
|
-
return "COMPLETED";
|
|
66
|
-
case ScenarioTickAck_Disposition.SKIPPED:
|
|
67
|
-
return "SKIPPED";
|
|
68
|
-
case ScenarioTickAck_Disposition.FAILED:
|
|
69
|
-
return "FAILED";
|
|
70
|
-
case ScenarioTickAck_Disposition.UNRECOGNIZED:
|
|
71
|
-
default:
|
|
72
|
-
return "UNRECOGNIZED";
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
exports.scenarioTickAck_DispositionToJSON = scenarioTickAck_DispositionToJSON;
|
|
76
|
-
function createBaseScenarioTickAck() {
|
|
77
|
-
return { $type: "keelson.ScenarioTickAck", timestamp: undefined, runId: "", tick: 0, disposition: 0, detail: "" };
|
|
78
|
-
}
|
|
79
|
-
exports.ScenarioTickAck = {
|
|
80
|
-
$type: "keelson.ScenarioTickAck",
|
|
81
|
-
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
82
|
-
if (message.timestamp !== undefined) {
|
|
83
|
-
timestamp_1.Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(10).fork()).join();
|
|
84
|
-
}
|
|
85
|
-
if (message.runId !== "") {
|
|
86
|
-
writer.uint32(18).string(message.runId);
|
|
87
|
-
}
|
|
88
|
-
if (message.tick !== 0) {
|
|
89
|
-
writer.uint32(24).uint64(message.tick);
|
|
90
|
-
}
|
|
91
|
-
if (message.disposition !== 0) {
|
|
92
|
-
writer.uint32(32).int32(message.disposition);
|
|
93
|
-
}
|
|
94
|
-
if (message.detail !== "") {
|
|
95
|
-
writer.uint32(42).string(message.detail);
|
|
96
|
-
}
|
|
97
|
-
return writer;
|
|
98
|
-
},
|
|
99
|
-
decode(input, length) {
|
|
100
|
-
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
101
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
102
|
-
const message = createBaseScenarioTickAck();
|
|
103
|
-
while (reader.pos < end) {
|
|
104
|
-
const tag = reader.uint32();
|
|
105
|
-
switch (tag >>> 3) {
|
|
106
|
-
case 1: {
|
|
107
|
-
if (tag !== 10) {
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
message.timestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
case 2: {
|
|
114
|
-
if (tag !== 18) {
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
message.runId = reader.string();
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
case 3: {
|
|
121
|
-
if (tag !== 24) {
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
message.tick = longToNumber(reader.uint64());
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
case 4: {
|
|
128
|
-
if (tag !== 32) {
|
|
129
|
-
break;
|
|
130
|
-
}
|
|
131
|
-
message.disposition = reader.int32();
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
case 5: {
|
|
135
|
-
if (tag !== 42) {
|
|
136
|
-
break;
|
|
137
|
-
}
|
|
138
|
-
message.detail = reader.string();
|
|
139
|
-
continue;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
143
|
-
break;
|
|
144
|
-
}
|
|
145
|
-
reader.skip(tag & 7);
|
|
146
|
-
}
|
|
147
|
-
return message;
|
|
148
|
-
},
|
|
149
|
-
fromJSON(object) {
|
|
150
|
-
return {
|
|
151
|
-
$type: exports.ScenarioTickAck.$type,
|
|
152
|
-
timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
|
|
153
|
-
runId: isSet(object.runId) ? globalThis.String(object.runId) : "",
|
|
154
|
-
tick: isSet(object.tick) ? globalThis.Number(object.tick) : 0,
|
|
155
|
-
disposition: isSet(object.disposition) ? scenarioTickAck_DispositionFromJSON(object.disposition) : 0,
|
|
156
|
-
detail: isSet(object.detail) ? globalThis.String(object.detail) : "",
|
|
157
|
-
};
|
|
158
|
-
},
|
|
159
|
-
toJSON(message) {
|
|
160
|
-
const obj = {};
|
|
161
|
-
if (message.timestamp !== undefined) {
|
|
162
|
-
obj.timestamp = message.timestamp.toISOString();
|
|
163
|
-
}
|
|
164
|
-
if (message.runId !== "") {
|
|
165
|
-
obj.runId = message.runId;
|
|
166
|
-
}
|
|
167
|
-
if (message.tick !== 0) {
|
|
168
|
-
obj.tick = Math.round(message.tick);
|
|
169
|
-
}
|
|
170
|
-
if (message.disposition !== 0) {
|
|
171
|
-
obj.disposition = scenarioTickAck_DispositionToJSON(message.disposition);
|
|
172
|
-
}
|
|
173
|
-
if (message.detail !== "") {
|
|
174
|
-
obj.detail = message.detail;
|
|
175
|
-
}
|
|
176
|
-
return obj;
|
|
177
|
-
},
|
|
178
|
-
create(base) {
|
|
179
|
-
return exports.ScenarioTickAck.fromPartial(base ?? {});
|
|
180
|
-
},
|
|
181
|
-
fromPartial(object) {
|
|
182
|
-
const message = createBaseScenarioTickAck();
|
|
183
|
-
message.timestamp = object.timestamp ?? undefined;
|
|
184
|
-
message.runId = object.runId ?? "";
|
|
185
|
-
message.tick = object.tick ?? 0;
|
|
186
|
-
message.disposition = object.disposition ?? 0;
|
|
187
|
-
message.detail = object.detail ?? "";
|
|
188
|
-
return message;
|
|
189
|
-
},
|
|
190
|
-
};
|
|
191
|
-
typeRegistry_1.messageTypeRegistry.set(exports.ScenarioTickAck.$type, exports.ScenarioTickAck);
|
|
192
|
-
function toTimestamp(date) {
|
|
193
|
-
const seconds = Math.trunc(date.getTime() / 1000);
|
|
194
|
-
const nanos = (date.getTime() % 1000) * 1000000;
|
|
195
|
-
return { $type: "google.protobuf.Timestamp", seconds, nanos };
|
|
196
|
-
}
|
|
197
|
-
function fromTimestamp(t) {
|
|
198
|
-
let millis = (t.seconds || 0) * 1000;
|
|
199
|
-
millis += (t.nanos || 0) / 1000000;
|
|
200
|
-
return new globalThis.Date(millis);
|
|
201
|
-
}
|
|
202
|
-
function fromJsonTimestamp(o) {
|
|
203
|
-
if (o instanceof globalThis.Date) {
|
|
204
|
-
return o;
|
|
205
|
-
}
|
|
206
|
-
else if (typeof o === "string") {
|
|
207
|
-
return new globalThis.Date(o);
|
|
208
|
-
}
|
|
209
|
-
else {
|
|
210
|
-
return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
function longToNumber(int64) {
|
|
214
|
-
const num = globalThis.Number(int64.toString());
|
|
215
|
-
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
216
|
-
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
217
|
-
}
|
|
218
|
-
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
219
|
-
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
220
|
-
}
|
|
221
|
-
return num;
|
|
222
|
-
}
|
|
223
|
-
function isSet(value) {
|
|
224
|
-
return value !== null && value !== undefined;
|
|
225
|
-
}
|