@rise-maritime/keelson-js 0.5.2 → 0.5.3
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/interfaces/ErrorResponse.d.ts +28 -0
- package/dist/interfaces/ErrorResponse.js +108 -3
- package/dist/interfaces/ReplayControl.d.ts +97 -0
- package/dist/interfaces/ReplayControl.js +616 -0
- package/dist/payloads/Primitives.d.ts +11 -0
- package/dist/payloads/Primitives.js +89 -1
- package/dist/payloads/ReplayStatus.d.ts +76 -0
- package/dist/payloads/ReplayStatus.js +445 -0
- package/dist/payloads/Severity.d.ts +14 -0
- package/dist/payloads/Severity.js +59 -0
- package/dist/payloads/VehicleState.d.ts +56 -0
- package/dist/payloads/VehicleState.js +196 -0
- package/dist/payloads/Weather.d.ts +148 -0
- package/dist/payloads/Weather.js +906 -0
- package/dist/payloads/index.foxglove.d.ts +1 -1
- package/dist/payloads/index.foxglove.js +1 -1
- package/dist/payloads/index.keelson.d.ts +4 -0
- package/dist/payloads/index.keelson.js +4 -0
- package/dist/subjects.json +24 -1
- package/package.json +2 -1
|
@@ -0,0 +1,59 @@
|
|
|
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: Severity.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.severityLevelToJSON = exports.severityLevelFromJSON = exports.SeverityLevel = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
/**
|
|
11
|
+
* Shared severity vocabulary for alerts and events across payloads
|
|
12
|
+
* (weather, route, ...). Keep this the single source of truth so the bus
|
|
13
|
+
* does not accumulate per-domain severity scales.
|
|
14
|
+
*/
|
|
15
|
+
var SeverityLevel;
|
|
16
|
+
(function (SeverityLevel) {
|
|
17
|
+
SeverityLevel[SeverityLevel["SEVERITY_LEVEL_UNSPECIFIED"] = 0] = "SEVERITY_LEVEL_UNSPECIFIED";
|
|
18
|
+
SeverityLevel[SeverityLevel["INFO"] = 1] = "INFO";
|
|
19
|
+
SeverityLevel[SeverityLevel["WARNING"] = 2] = "WARNING";
|
|
20
|
+
SeverityLevel[SeverityLevel["CRITICAL"] = 3] = "CRITICAL";
|
|
21
|
+
SeverityLevel[SeverityLevel["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
22
|
+
})(SeverityLevel || (exports.SeverityLevel = SeverityLevel = {}));
|
|
23
|
+
function severityLevelFromJSON(object) {
|
|
24
|
+
switch (object) {
|
|
25
|
+
case 0:
|
|
26
|
+
case "SEVERITY_LEVEL_UNSPECIFIED":
|
|
27
|
+
return SeverityLevel.SEVERITY_LEVEL_UNSPECIFIED;
|
|
28
|
+
case 1:
|
|
29
|
+
case "INFO":
|
|
30
|
+
return SeverityLevel.INFO;
|
|
31
|
+
case 2:
|
|
32
|
+
case "WARNING":
|
|
33
|
+
return SeverityLevel.WARNING;
|
|
34
|
+
case 3:
|
|
35
|
+
case "CRITICAL":
|
|
36
|
+
return SeverityLevel.CRITICAL;
|
|
37
|
+
case -1:
|
|
38
|
+
case "UNRECOGNIZED":
|
|
39
|
+
default:
|
|
40
|
+
return SeverityLevel.UNRECOGNIZED;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.severityLevelFromJSON = severityLevelFromJSON;
|
|
44
|
+
function severityLevelToJSON(object) {
|
|
45
|
+
switch (object) {
|
|
46
|
+
case SeverityLevel.SEVERITY_LEVEL_UNSPECIFIED:
|
|
47
|
+
return "SEVERITY_LEVEL_UNSPECIFIED";
|
|
48
|
+
case SeverityLevel.INFO:
|
|
49
|
+
return "INFO";
|
|
50
|
+
case SeverityLevel.WARNING:
|
|
51
|
+
return "WARNING";
|
|
52
|
+
case SeverityLevel.CRITICAL:
|
|
53
|
+
return "CRITICAL";
|
|
54
|
+
case SeverityLevel.UNRECOGNIZED:
|
|
55
|
+
default:
|
|
56
|
+
return "UNRECOGNIZED";
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.severityLevelToJSON = severityLevelToJSON;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export interface VehicleState {
|
|
3
|
+
$type: "keelson.VehicleState";
|
|
4
|
+
/** The source timestamp of the state report */
|
|
5
|
+
timestamp: Date | undefined;
|
|
6
|
+
state: VehicleState_State;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Vehicle-agnostic operational lifecycle / severity state. Maps 1:1 from
|
|
10
|
+
* MAVLink HEARTBEAT MAV_STATE, but the values are universal operational
|
|
11
|
+
* concepts (not a MAVLink-specific shape): any vehicle connector can
|
|
12
|
+
* publish this. The severity tail (CRITICAL / EMERGENCY / TERMINATED) is
|
|
13
|
+
* the failsafe axis that per-sensor health (sensor_status) cannot express.
|
|
14
|
+
*/
|
|
15
|
+
export declare enum VehicleState_State {
|
|
16
|
+
/** STATE_UNKNOWN - boot/uninitialised or indeterminate */
|
|
17
|
+
STATE_UNKNOWN = 0,
|
|
18
|
+
STATE_BOOTING = 1,
|
|
19
|
+
STATE_CALIBRATING = 2,
|
|
20
|
+
/** STATE_STANDBY - ready, not active */
|
|
21
|
+
STATE_STANDBY = 3,
|
|
22
|
+
/** STATE_ACTIVE - armed / operating normally */
|
|
23
|
+
STATE_ACTIVE = 4,
|
|
24
|
+
/** STATE_CRITICAL - non-normal but still controllable */
|
|
25
|
+
STATE_CRITICAL = 5,
|
|
26
|
+
/** STATE_EMERGENCY - mayday */
|
|
27
|
+
STATE_EMERGENCY = 6,
|
|
28
|
+
/** STATE_SHUTDOWN - powering off */
|
|
29
|
+
STATE_SHUTDOWN = 7,
|
|
30
|
+
/** STATE_TERMINATED - flight/operation terminated */
|
|
31
|
+
STATE_TERMINATED = 8,
|
|
32
|
+
UNRECOGNIZED = -1
|
|
33
|
+
}
|
|
34
|
+
export declare function vehicleState_StateFromJSON(object: any): VehicleState_State;
|
|
35
|
+
export declare function vehicleState_StateToJSON(object: VehicleState_State): string;
|
|
36
|
+
export declare const VehicleState: MessageFns<VehicleState, "keelson.VehicleState">;
|
|
37
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
38
|
+
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 {} ? {
|
|
39
|
+
[K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
|
|
40
|
+
} : Partial<T>;
|
|
41
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
42
|
+
type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
43
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
44
|
+
} & {
|
|
45
|
+
[K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never;
|
|
46
|
+
};
|
|
47
|
+
interface MessageFns<T, V extends string> {
|
|
48
|
+
readonly $type: V;
|
|
49
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
50
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
51
|
+
fromJSON(object: any): T;
|
|
52
|
+
toJSON(message: T): unknown;
|
|
53
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
54
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,196 @@
|
|
|
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: VehicleState.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.VehicleState = exports.vehicleState_StateToJSON = exports.vehicleState_StateFromJSON = exports.VehicleState_State = 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
|
+
* Vehicle-agnostic operational lifecycle / severity state. Maps 1:1 from
|
|
15
|
+
* MAVLink HEARTBEAT MAV_STATE, but the values are universal operational
|
|
16
|
+
* concepts (not a MAVLink-specific shape): any vehicle connector can
|
|
17
|
+
* publish this. The severity tail (CRITICAL / EMERGENCY / TERMINATED) is
|
|
18
|
+
* the failsafe axis that per-sensor health (sensor_status) cannot express.
|
|
19
|
+
*/
|
|
20
|
+
var VehicleState_State;
|
|
21
|
+
(function (VehicleState_State) {
|
|
22
|
+
/** STATE_UNKNOWN - boot/uninitialised or indeterminate */
|
|
23
|
+
VehicleState_State[VehicleState_State["STATE_UNKNOWN"] = 0] = "STATE_UNKNOWN";
|
|
24
|
+
VehicleState_State[VehicleState_State["STATE_BOOTING"] = 1] = "STATE_BOOTING";
|
|
25
|
+
VehicleState_State[VehicleState_State["STATE_CALIBRATING"] = 2] = "STATE_CALIBRATING";
|
|
26
|
+
/** STATE_STANDBY - ready, not active */
|
|
27
|
+
VehicleState_State[VehicleState_State["STATE_STANDBY"] = 3] = "STATE_STANDBY";
|
|
28
|
+
/** STATE_ACTIVE - armed / operating normally */
|
|
29
|
+
VehicleState_State[VehicleState_State["STATE_ACTIVE"] = 4] = "STATE_ACTIVE";
|
|
30
|
+
/** STATE_CRITICAL - non-normal but still controllable */
|
|
31
|
+
VehicleState_State[VehicleState_State["STATE_CRITICAL"] = 5] = "STATE_CRITICAL";
|
|
32
|
+
/** STATE_EMERGENCY - mayday */
|
|
33
|
+
VehicleState_State[VehicleState_State["STATE_EMERGENCY"] = 6] = "STATE_EMERGENCY";
|
|
34
|
+
/** STATE_SHUTDOWN - powering off */
|
|
35
|
+
VehicleState_State[VehicleState_State["STATE_SHUTDOWN"] = 7] = "STATE_SHUTDOWN";
|
|
36
|
+
/** STATE_TERMINATED - flight/operation terminated */
|
|
37
|
+
VehicleState_State[VehicleState_State["STATE_TERMINATED"] = 8] = "STATE_TERMINATED";
|
|
38
|
+
VehicleState_State[VehicleState_State["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
39
|
+
})(VehicleState_State || (exports.VehicleState_State = VehicleState_State = {}));
|
|
40
|
+
function vehicleState_StateFromJSON(object) {
|
|
41
|
+
switch (object) {
|
|
42
|
+
case 0:
|
|
43
|
+
case "STATE_UNKNOWN":
|
|
44
|
+
return VehicleState_State.STATE_UNKNOWN;
|
|
45
|
+
case 1:
|
|
46
|
+
case "STATE_BOOTING":
|
|
47
|
+
return VehicleState_State.STATE_BOOTING;
|
|
48
|
+
case 2:
|
|
49
|
+
case "STATE_CALIBRATING":
|
|
50
|
+
return VehicleState_State.STATE_CALIBRATING;
|
|
51
|
+
case 3:
|
|
52
|
+
case "STATE_STANDBY":
|
|
53
|
+
return VehicleState_State.STATE_STANDBY;
|
|
54
|
+
case 4:
|
|
55
|
+
case "STATE_ACTIVE":
|
|
56
|
+
return VehicleState_State.STATE_ACTIVE;
|
|
57
|
+
case 5:
|
|
58
|
+
case "STATE_CRITICAL":
|
|
59
|
+
return VehicleState_State.STATE_CRITICAL;
|
|
60
|
+
case 6:
|
|
61
|
+
case "STATE_EMERGENCY":
|
|
62
|
+
return VehicleState_State.STATE_EMERGENCY;
|
|
63
|
+
case 7:
|
|
64
|
+
case "STATE_SHUTDOWN":
|
|
65
|
+
return VehicleState_State.STATE_SHUTDOWN;
|
|
66
|
+
case 8:
|
|
67
|
+
case "STATE_TERMINATED":
|
|
68
|
+
return VehicleState_State.STATE_TERMINATED;
|
|
69
|
+
case -1:
|
|
70
|
+
case "UNRECOGNIZED":
|
|
71
|
+
default:
|
|
72
|
+
return VehicleState_State.UNRECOGNIZED;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.vehicleState_StateFromJSON = vehicleState_StateFromJSON;
|
|
76
|
+
function vehicleState_StateToJSON(object) {
|
|
77
|
+
switch (object) {
|
|
78
|
+
case VehicleState_State.STATE_UNKNOWN:
|
|
79
|
+
return "STATE_UNKNOWN";
|
|
80
|
+
case VehicleState_State.STATE_BOOTING:
|
|
81
|
+
return "STATE_BOOTING";
|
|
82
|
+
case VehicleState_State.STATE_CALIBRATING:
|
|
83
|
+
return "STATE_CALIBRATING";
|
|
84
|
+
case VehicleState_State.STATE_STANDBY:
|
|
85
|
+
return "STATE_STANDBY";
|
|
86
|
+
case VehicleState_State.STATE_ACTIVE:
|
|
87
|
+
return "STATE_ACTIVE";
|
|
88
|
+
case VehicleState_State.STATE_CRITICAL:
|
|
89
|
+
return "STATE_CRITICAL";
|
|
90
|
+
case VehicleState_State.STATE_EMERGENCY:
|
|
91
|
+
return "STATE_EMERGENCY";
|
|
92
|
+
case VehicleState_State.STATE_SHUTDOWN:
|
|
93
|
+
return "STATE_SHUTDOWN";
|
|
94
|
+
case VehicleState_State.STATE_TERMINATED:
|
|
95
|
+
return "STATE_TERMINATED";
|
|
96
|
+
case VehicleState_State.UNRECOGNIZED:
|
|
97
|
+
default:
|
|
98
|
+
return "UNRECOGNIZED";
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.vehicleState_StateToJSON = vehicleState_StateToJSON;
|
|
102
|
+
function createBaseVehicleState() {
|
|
103
|
+
return { $type: "keelson.VehicleState", timestamp: undefined, state: 0 };
|
|
104
|
+
}
|
|
105
|
+
exports.VehicleState = {
|
|
106
|
+
$type: "keelson.VehicleState",
|
|
107
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
108
|
+
if (message.timestamp !== undefined) {
|
|
109
|
+
timestamp_1.Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(10).fork()).join();
|
|
110
|
+
}
|
|
111
|
+
if (message.state !== 0) {
|
|
112
|
+
writer.uint32(16).int32(message.state);
|
|
113
|
+
}
|
|
114
|
+
return writer;
|
|
115
|
+
},
|
|
116
|
+
decode(input, length) {
|
|
117
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
118
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
119
|
+
const message = createBaseVehicleState();
|
|
120
|
+
while (reader.pos < end) {
|
|
121
|
+
const tag = reader.uint32();
|
|
122
|
+
switch (tag >>> 3) {
|
|
123
|
+
case 1: {
|
|
124
|
+
if (tag !== 10) {
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
message.timestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
case 2: {
|
|
131
|
+
if (tag !== 16) {
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
message.state = reader.int32();
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
reader.skip(tag & 7);
|
|
142
|
+
}
|
|
143
|
+
return message;
|
|
144
|
+
},
|
|
145
|
+
fromJSON(object) {
|
|
146
|
+
return {
|
|
147
|
+
$type: exports.VehicleState.$type,
|
|
148
|
+
timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
|
|
149
|
+
state: isSet(object.state) ? vehicleState_StateFromJSON(object.state) : 0,
|
|
150
|
+
};
|
|
151
|
+
},
|
|
152
|
+
toJSON(message) {
|
|
153
|
+
const obj = {};
|
|
154
|
+
if (message.timestamp !== undefined) {
|
|
155
|
+
obj.timestamp = message.timestamp.toISOString();
|
|
156
|
+
}
|
|
157
|
+
if (message.state !== 0) {
|
|
158
|
+
obj.state = vehicleState_StateToJSON(message.state);
|
|
159
|
+
}
|
|
160
|
+
return obj;
|
|
161
|
+
},
|
|
162
|
+
create(base) {
|
|
163
|
+
return exports.VehicleState.fromPartial(base ?? {});
|
|
164
|
+
},
|
|
165
|
+
fromPartial(object) {
|
|
166
|
+
const message = createBaseVehicleState();
|
|
167
|
+
message.timestamp = object.timestamp ?? undefined;
|
|
168
|
+
message.state = object.state ?? 0;
|
|
169
|
+
return message;
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
typeRegistry_1.messageTypeRegistry.set(exports.VehicleState.$type, exports.VehicleState);
|
|
173
|
+
function toTimestamp(date) {
|
|
174
|
+
const seconds = Math.trunc(date.getTime() / 1000);
|
|
175
|
+
const nanos = (date.getTime() % 1000) * 1000000;
|
|
176
|
+
return { $type: "google.protobuf.Timestamp", seconds, nanos };
|
|
177
|
+
}
|
|
178
|
+
function fromTimestamp(t) {
|
|
179
|
+
let millis = (t.seconds || 0) * 1000;
|
|
180
|
+
millis += (t.nanos || 0) / 1000000;
|
|
181
|
+
return new globalThis.Date(millis);
|
|
182
|
+
}
|
|
183
|
+
function fromJsonTimestamp(o) {
|
|
184
|
+
if (o instanceof globalThis.Date) {
|
|
185
|
+
return o;
|
|
186
|
+
}
|
|
187
|
+
else if (typeof o === "string") {
|
|
188
|
+
return new globalThis.Date(o);
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
function isSet(value) {
|
|
195
|
+
return value !== null && value !== undefined;
|
|
196
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
import { SeverityLevel } from "./Severity";
|
|
3
|
+
import { LocationFix } from "./foxglove/LocationFix";
|
|
4
|
+
/**
|
|
5
|
+
* Observed precipitation type. Published on the precipitation_type subject.
|
|
6
|
+
* Intensity is intentionally not modelled here: it is derivable from
|
|
7
|
+
* precipitation_rate_mmph and is therefore a consumer-side mapping.
|
|
8
|
+
*/
|
|
9
|
+
export interface PrecipitationType {
|
|
10
|
+
$type: "keelson.PrecipitationType";
|
|
11
|
+
timestamp: Date | undefined;
|
|
12
|
+
type: PrecipitationType_Type;
|
|
13
|
+
}
|
|
14
|
+
export declare enum PrecipitationType_Type {
|
|
15
|
+
TYPE_UNSPECIFIED = 0,
|
|
16
|
+
/** NONE - observed dry */
|
|
17
|
+
NONE = 1,
|
|
18
|
+
RAIN = 2,
|
|
19
|
+
DRIZZLE = 3,
|
|
20
|
+
SNOW = 4,
|
|
21
|
+
SLEET = 5,
|
|
22
|
+
HAIL = 6,
|
|
23
|
+
FREEZING_RAIN = 7,
|
|
24
|
+
MIXED = 8,
|
|
25
|
+
UNRECOGNIZED = -1
|
|
26
|
+
}
|
|
27
|
+
export declare function precipitationType_TypeFromJSON(object: any): PrecipitationType_Type;
|
|
28
|
+
export declare function precipitationType_TypeToJSON(object: PrecipitationType_Type): string;
|
|
29
|
+
/** Observed ice type (WMO sea-ice nomenclature). Published on the ice_type subject. */
|
|
30
|
+
export interface IceType {
|
|
31
|
+
$type: "keelson.IceType";
|
|
32
|
+
timestamp: Date | undefined;
|
|
33
|
+
type: IceType_Type;
|
|
34
|
+
}
|
|
35
|
+
export declare enum IceType_Type {
|
|
36
|
+
TYPE_UNSPECIFIED = 0,
|
|
37
|
+
FRAZIL = 1,
|
|
38
|
+
GREASE = 2,
|
|
39
|
+
SLUSH = 3,
|
|
40
|
+
SHUGA = 4,
|
|
41
|
+
NILAS = 5,
|
|
42
|
+
PANCAKE = 6,
|
|
43
|
+
FIRST_YEAR = 7,
|
|
44
|
+
MULTI_YEAR = 8,
|
|
45
|
+
GLACIER = 9,
|
|
46
|
+
ICEBERG = 10,
|
|
47
|
+
UNRECOGNIZED = -1
|
|
48
|
+
}
|
|
49
|
+
export declare function iceType_TypeFromJSON(object: any): IceType_Type;
|
|
50
|
+
export declare function iceType_TypeToJSON(object: IceType_Type): string;
|
|
51
|
+
/**
|
|
52
|
+
* A weather warning issued by an external authority (SMHI, NOAA, ...).
|
|
53
|
+
* Quarantined external product: free-form pass-through fields, provenance, and
|
|
54
|
+
* a validity window. Not assembled from live measurement subjects.
|
|
55
|
+
*/
|
|
56
|
+
export interface WeatherAlert {
|
|
57
|
+
$type: "keelson.WeatherAlert";
|
|
58
|
+
/** Stable, issuer-scoped identifier. */
|
|
59
|
+
id: string;
|
|
60
|
+
/** Shared severity vocabulary (Severity.proto) -- no per-domain scale. */
|
|
61
|
+
severity: SeverityLevel;
|
|
62
|
+
/**
|
|
63
|
+
* Free-form category as issued, e.g. "gale", "tropical-cyclone", "ice".
|
|
64
|
+
* A pass-through label, intentionally not an enum keelson maintains.
|
|
65
|
+
*/
|
|
66
|
+
category: string;
|
|
67
|
+
headline: string;
|
|
68
|
+
description: string;
|
|
69
|
+
/** Validity window. */
|
|
70
|
+
effectiveAt: Date | undefined;
|
|
71
|
+
expiresAt: Date | undefined;
|
|
72
|
+
/** Provenance. */
|
|
73
|
+
issuer: string;
|
|
74
|
+
affectedAreas: string[];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* A weather forecast for a location, as issued by an external model / source.
|
|
78
|
+
* Quarantined external product with confined scope: it enumerates exactly the
|
|
79
|
+
* quantities the contract predicts and does NOT embed live measurement types.
|
|
80
|
+
*/
|
|
81
|
+
export interface WeatherForecast {
|
|
82
|
+
$type: "keelson.WeatherForecast";
|
|
83
|
+
/** Location the forecast applies to. */
|
|
84
|
+
location: LocationFix | undefined;
|
|
85
|
+
/** Provenance. */
|
|
86
|
+
issuedAt: Date | undefined;
|
|
87
|
+
/** e.g. "ECMWF", "GFS", model-run name */
|
|
88
|
+
source: string;
|
|
89
|
+
/** Ordered series of predicted valid-times. */
|
|
90
|
+
steps: WeatherForecast_Step[];
|
|
91
|
+
/** Alerts attached to this forecast. */
|
|
92
|
+
alerts: WeatherAlert[];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* One predicted valid-time. Nested on purpose: this type is confined to the
|
|
96
|
+
* forecast contract -- it cannot acquire its own subject and cannot be reused
|
|
97
|
+
* by live-domain code. Field NAMES mirror the live atomic subjects so a
|
|
98
|
+
* consumer reads them without translation, but the TYPES are local floats:
|
|
99
|
+
* the external contract stays self-contained and drags no live enums across.
|
|
100
|
+
*
|
|
101
|
+
* `optional` gives explicit presence -- a model that does not predict a field
|
|
102
|
+
* omits it, which is distinct from a real 0.0.
|
|
103
|
+
*/
|
|
104
|
+
export interface WeatherForecast_Step {
|
|
105
|
+
$type: "keelson.WeatherForecast.Step";
|
|
106
|
+
validAt: Date | undefined;
|
|
107
|
+
trueWindSpeedMps?: number | undefined;
|
|
108
|
+
trueWindDirectionDeg?: number | undefined;
|
|
109
|
+
trueWindGustMps?: number | undefined;
|
|
110
|
+
waveHeightSignificantM?: number | undefined;
|
|
111
|
+
wavePeriodS?: number | undefined;
|
|
112
|
+
waveTrueDirectionDeg?: number | undefined;
|
|
113
|
+
precipitationRateMmph?: number | undefined;
|
|
114
|
+
/** PoP -- a forecast concept, [0, 100] */
|
|
115
|
+
precipitationProbabilityPct?: number | undefined;
|
|
116
|
+
visibilityRangeM?: number | undefined;
|
|
117
|
+
airTemperatureCelsius?: number | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* Deliberately limited to the marine-relevant core. Extend when a real
|
|
120
|
+
* producer needs more -- provisional until then.
|
|
121
|
+
*/
|
|
122
|
+
airPressurePa?: number | undefined;
|
|
123
|
+
}
|
|
124
|
+
export declare const PrecipitationType: MessageFns<PrecipitationType, "keelson.PrecipitationType">;
|
|
125
|
+
export declare const IceType: MessageFns<IceType, "keelson.IceType">;
|
|
126
|
+
export declare const WeatherAlert: MessageFns<WeatherAlert, "keelson.WeatherAlert">;
|
|
127
|
+
export declare const WeatherForecast: MessageFns<WeatherForecast, "keelson.WeatherForecast">;
|
|
128
|
+
export declare const WeatherForecast_Step: MessageFns<WeatherForecast_Step, "keelson.WeatherForecast.Step">;
|
|
129
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
130
|
+
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 {} ? {
|
|
131
|
+
[K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
|
|
132
|
+
} : Partial<T>;
|
|
133
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
134
|
+
type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
135
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
136
|
+
} & {
|
|
137
|
+
[K in Exclude<keyof I, KeysOfUnion<P> | "$type">]: never;
|
|
138
|
+
};
|
|
139
|
+
interface MessageFns<T, V extends string> {
|
|
140
|
+
readonly $type: V;
|
|
141
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
142
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
143
|
+
fromJSON(object: any): T;
|
|
144
|
+
toJSON(message: T): unknown;
|
|
145
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
146
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
147
|
+
}
|
|
148
|
+
export {};
|