@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,27 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "foxglove";
3
+ /** GeoJSON data for annotating maps */
4
+ export interface GeoJSON {
5
+ /** GeoJSON data encoded as a UTF-8 string */
6
+ geojson: string;
7
+ }
8
+ export declare const GeoJSON: MessageFns<GeoJSON>;
9
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
10
+ export 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 {} ? {
11
+ [K in keyof T]?: DeepPartial<T[K]>;
12
+ } : Partial<T>;
13
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
14
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
15
+ [K in keyof P]: Exact<P[K], I[K]>;
16
+ } & {
17
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
18
+ };
19
+ export interface MessageFns<T> {
20
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
21
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
22
+ fromJSON(object: any): T;
23
+ toJSON(message: T): unknown;
24
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
25
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
26
+ }
27
+ export {};
@@ -0,0 +1,65 @@
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: foxglove/GeoJSON.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.GeoJSON = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ const wire_1 = require("@bufbuild/protobuf/wire");
11
+ exports.protobufPackage = "foxglove";
12
+ function createBaseGeoJSON() {
13
+ return { geojson: "" };
14
+ }
15
+ exports.GeoJSON = {
16
+ encode(message, writer = new wire_1.BinaryWriter()) {
17
+ if (message.geojson !== "") {
18
+ writer.uint32(10).string(message.geojson);
19
+ }
20
+ return writer;
21
+ },
22
+ decode(input, length) {
23
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
24
+ let end = length === undefined ? reader.len : reader.pos + length;
25
+ const message = createBaseGeoJSON();
26
+ while (reader.pos < end) {
27
+ const tag = reader.uint32();
28
+ switch (tag >>> 3) {
29
+ case 1: {
30
+ if (tag !== 10) {
31
+ break;
32
+ }
33
+ message.geojson = reader.string();
34
+ continue;
35
+ }
36
+ }
37
+ if ((tag & 7) === 4 || tag === 0) {
38
+ break;
39
+ }
40
+ reader.skip(tag & 7);
41
+ }
42
+ return message;
43
+ },
44
+ fromJSON(object) {
45
+ return { geojson: isSet(object.geojson) ? globalThis.String(object.geojson) : "" };
46
+ },
47
+ toJSON(message) {
48
+ const obj = {};
49
+ if (message.geojson !== "") {
50
+ obj.geojson = message.geojson;
51
+ }
52
+ return obj;
53
+ },
54
+ create(base) {
55
+ return exports.GeoJSON.fromPartial(base ?? {});
56
+ },
57
+ fromPartial(object) {
58
+ const message = createBaseGeoJSON();
59
+ message.geojson = object.geojson ?? "";
60
+ return message;
61
+ },
62
+ };
63
+ function isSet(value) {
64
+ return value !== null && value !== undefined;
65
+ }
@@ -0,0 +1,49 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "foxglove";
3
+ /** A navigation satellite fix for any Global Navigation Satellite System */
4
+ export interface LocationFix {
5
+ /** Timestamp of the message */
6
+ timestamp: Date | undefined;
7
+ /** Frame for the sensor. Latitude and longitude readings are at the origin of the frame. */
8
+ frameId: string;
9
+ /** Latitude in degrees */
10
+ latitude: number;
11
+ /** Longitude in degrees */
12
+ longitude: number;
13
+ /** Altitude in meters */
14
+ altitude: number;
15
+ /** Position covariance (m^2) defined relative to a tangential plane through the reported position. The components are East, North, and Up (ENU), in row-major order. */
16
+ positionCovariance: number[];
17
+ /** If `position_covariance` is available, `position_covariance_type` must be set to indicate the type of covariance. */
18
+ positionCovarianceType: LocationFix_PositionCovarianceType;
19
+ }
20
+ /** Type of position covariance */
21
+ export declare enum LocationFix_PositionCovarianceType {
22
+ UNKNOWN = 0,
23
+ APPROXIMATED = 1,
24
+ DIAGONAL_KNOWN = 2,
25
+ KNOWN = 3,
26
+ UNRECOGNIZED = -1
27
+ }
28
+ export declare function locationFix_PositionCovarianceTypeFromJSON(object: any): LocationFix_PositionCovarianceType;
29
+ export declare function locationFix_PositionCovarianceTypeToJSON(object: LocationFix_PositionCovarianceType): string;
30
+ export declare const LocationFix: MessageFns<LocationFix>;
31
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
32
+ export 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 {} ? {
33
+ [K in keyof T]?: DeepPartial<T[K]>;
34
+ } : Partial<T>;
35
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
36
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
37
+ [K in keyof P]: Exact<P[K], I[K]>;
38
+ } & {
39
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
40
+ };
41
+ export interface MessageFns<T> {
42
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
43
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
44
+ fromJSON(object: any): T;
45
+ toJSON(message: T): unknown;
46
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
47
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
48
+ }
49
+ export {};
@@ -0,0 +1,246 @@
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: foxglove/LocationFix.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.LocationFix = exports.locationFix_PositionCovarianceTypeToJSON = exports.locationFix_PositionCovarianceTypeFromJSON = exports.LocationFix_PositionCovarianceType = 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 = "foxglove";
13
+ /** Type of position covariance */
14
+ var LocationFix_PositionCovarianceType;
15
+ (function (LocationFix_PositionCovarianceType) {
16
+ LocationFix_PositionCovarianceType[LocationFix_PositionCovarianceType["UNKNOWN"] = 0] = "UNKNOWN";
17
+ LocationFix_PositionCovarianceType[LocationFix_PositionCovarianceType["APPROXIMATED"] = 1] = "APPROXIMATED";
18
+ LocationFix_PositionCovarianceType[LocationFix_PositionCovarianceType["DIAGONAL_KNOWN"] = 2] = "DIAGONAL_KNOWN";
19
+ LocationFix_PositionCovarianceType[LocationFix_PositionCovarianceType["KNOWN"] = 3] = "KNOWN";
20
+ LocationFix_PositionCovarianceType[LocationFix_PositionCovarianceType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
21
+ })(LocationFix_PositionCovarianceType || (exports.LocationFix_PositionCovarianceType = LocationFix_PositionCovarianceType = {}));
22
+ function locationFix_PositionCovarianceTypeFromJSON(object) {
23
+ switch (object) {
24
+ case 0:
25
+ case "UNKNOWN":
26
+ return LocationFix_PositionCovarianceType.UNKNOWN;
27
+ case 1:
28
+ case "APPROXIMATED":
29
+ return LocationFix_PositionCovarianceType.APPROXIMATED;
30
+ case 2:
31
+ case "DIAGONAL_KNOWN":
32
+ return LocationFix_PositionCovarianceType.DIAGONAL_KNOWN;
33
+ case 3:
34
+ case "KNOWN":
35
+ return LocationFix_PositionCovarianceType.KNOWN;
36
+ case -1:
37
+ case "UNRECOGNIZED":
38
+ default:
39
+ return LocationFix_PositionCovarianceType.UNRECOGNIZED;
40
+ }
41
+ }
42
+ exports.locationFix_PositionCovarianceTypeFromJSON = locationFix_PositionCovarianceTypeFromJSON;
43
+ function locationFix_PositionCovarianceTypeToJSON(object) {
44
+ switch (object) {
45
+ case LocationFix_PositionCovarianceType.UNKNOWN:
46
+ return "UNKNOWN";
47
+ case LocationFix_PositionCovarianceType.APPROXIMATED:
48
+ return "APPROXIMATED";
49
+ case LocationFix_PositionCovarianceType.DIAGONAL_KNOWN:
50
+ return "DIAGONAL_KNOWN";
51
+ case LocationFix_PositionCovarianceType.KNOWN:
52
+ return "KNOWN";
53
+ case LocationFix_PositionCovarianceType.UNRECOGNIZED:
54
+ default:
55
+ return "UNRECOGNIZED";
56
+ }
57
+ }
58
+ exports.locationFix_PositionCovarianceTypeToJSON = locationFix_PositionCovarianceTypeToJSON;
59
+ function createBaseLocationFix() {
60
+ return {
61
+ timestamp: undefined,
62
+ frameId: "",
63
+ latitude: 0,
64
+ longitude: 0,
65
+ altitude: 0,
66
+ positionCovariance: [],
67
+ positionCovarianceType: 0,
68
+ };
69
+ }
70
+ exports.LocationFix = {
71
+ encode(message, writer = new wire_1.BinaryWriter()) {
72
+ if (message.timestamp !== undefined) {
73
+ timestamp_1.Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(50).fork()).join();
74
+ }
75
+ if (message.frameId !== "") {
76
+ writer.uint32(58).string(message.frameId);
77
+ }
78
+ if (message.latitude !== 0) {
79
+ writer.uint32(9).double(message.latitude);
80
+ }
81
+ if (message.longitude !== 0) {
82
+ writer.uint32(17).double(message.longitude);
83
+ }
84
+ if (message.altitude !== 0) {
85
+ writer.uint32(25).double(message.altitude);
86
+ }
87
+ writer.uint32(34).fork();
88
+ for (const v of message.positionCovariance) {
89
+ writer.double(v);
90
+ }
91
+ writer.join();
92
+ if (message.positionCovarianceType !== 0) {
93
+ writer.uint32(40).int32(message.positionCovarianceType);
94
+ }
95
+ return writer;
96
+ },
97
+ decode(input, length) {
98
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
99
+ let end = length === undefined ? reader.len : reader.pos + length;
100
+ const message = createBaseLocationFix();
101
+ while (reader.pos < end) {
102
+ const tag = reader.uint32();
103
+ switch (tag >>> 3) {
104
+ case 6: {
105
+ if (tag !== 50) {
106
+ break;
107
+ }
108
+ message.timestamp = fromTimestamp(timestamp_1.Timestamp.decode(reader, reader.uint32()));
109
+ continue;
110
+ }
111
+ case 7: {
112
+ if (tag !== 58) {
113
+ break;
114
+ }
115
+ message.frameId = reader.string();
116
+ continue;
117
+ }
118
+ case 1: {
119
+ if (tag !== 9) {
120
+ break;
121
+ }
122
+ message.latitude = reader.double();
123
+ continue;
124
+ }
125
+ case 2: {
126
+ if (tag !== 17) {
127
+ break;
128
+ }
129
+ message.longitude = reader.double();
130
+ continue;
131
+ }
132
+ case 3: {
133
+ if (tag !== 25) {
134
+ break;
135
+ }
136
+ message.altitude = reader.double();
137
+ continue;
138
+ }
139
+ case 4: {
140
+ if (tag === 33) {
141
+ message.positionCovariance.push(reader.double());
142
+ continue;
143
+ }
144
+ if (tag === 34) {
145
+ const end2 = reader.uint32() + reader.pos;
146
+ while (reader.pos < end2) {
147
+ message.positionCovariance.push(reader.double());
148
+ }
149
+ continue;
150
+ }
151
+ break;
152
+ }
153
+ case 5: {
154
+ if (tag !== 40) {
155
+ break;
156
+ }
157
+ message.positionCovarianceType = reader.int32();
158
+ continue;
159
+ }
160
+ }
161
+ if ((tag & 7) === 4 || tag === 0) {
162
+ break;
163
+ }
164
+ reader.skip(tag & 7);
165
+ }
166
+ return message;
167
+ },
168
+ fromJSON(object) {
169
+ return {
170
+ timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
171
+ frameId: isSet(object.frameId) ? globalThis.String(object.frameId) : "",
172
+ latitude: isSet(object.latitude) ? globalThis.Number(object.latitude) : 0,
173
+ longitude: isSet(object.longitude) ? globalThis.Number(object.longitude) : 0,
174
+ altitude: isSet(object.altitude) ? globalThis.Number(object.altitude) : 0,
175
+ positionCovariance: globalThis.Array.isArray(object?.positionCovariance)
176
+ ? object.positionCovariance.map((e) => globalThis.Number(e))
177
+ : [],
178
+ positionCovarianceType: isSet(object.positionCovarianceType)
179
+ ? locationFix_PositionCovarianceTypeFromJSON(object.positionCovarianceType)
180
+ : 0,
181
+ };
182
+ },
183
+ toJSON(message) {
184
+ const obj = {};
185
+ if (message.timestamp !== undefined) {
186
+ obj.timestamp = message.timestamp.toISOString();
187
+ }
188
+ if (message.frameId !== "") {
189
+ obj.frameId = message.frameId;
190
+ }
191
+ if (message.latitude !== 0) {
192
+ obj.latitude = message.latitude;
193
+ }
194
+ if (message.longitude !== 0) {
195
+ obj.longitude = message.longitude;
196
+ }
197
+ if (message.altitude !== 0) {
198
+ obj.altitude = message.altitude;
199
+ }
200
+ if (message.positionCovariance?.length) {
201
+ obj.positionCovariance = message.positionCovariance;
202
+ }
203
+ if (message.positionCovarianceType !== 0) {
204
+ obj.positionCovarianceType = locationFix_PositionCovarianceTypeToJSON(message.positionCovarianceType);
205
+ }
206
+ return obj;
207
+ },
208
+ create(base) {
209
+ return exports.LocationFix.fromPartial(base ?? {});
210
+ },
211
+ fromPartial(object) {
212
+ const message = createBaseLocationFix();
213
+ message.timestamp = object.timestamp ?? undefined;
214
+ message.frameId = object.frameId ?? "";
215
+ message.latitude = object.latitude ?? 0;
216
+ message.longitude = object.longitude ?? 0;
217
+ message.altitude = object.altitude ?? 0;
218
+ message.positionCovariance = object.positionCovariance?.map((e) => e) || [];
219
+ message.positionCovarianceType = object.positionCovarianceType ?? 0;
220
+ return message;
221
+ },
222
+ };
223
+ function toTimestamp(date) {
224
+ const seconds = Math.trunc(date.getTime() / 1000);
225
+ const nanos = (date.getTime() % 1000) * 1000000;
226
+ return { seconds, nanos };
227
+ }
228
+ function fromTimestamp(t) {
229
+ let millis = (t.seconds || 0) * 1000;
230
+ millis += (t.nanos || 0) / 1000000;
231
+ return new globalThis.Date(millis);
232
+ }
233
+ function fromJsonTimestamp(o) {
234
+ if (o instanceof globalThis.Date) {
235
+ return o;
236
+ }
237
+ else if (typeof o === "string") {
238
+ return new globalThis.Date(o);
239
+ }
240
+ else {
241
+ return fromTimestamp(timestamp_1.Timestamp.fromJSON(o));
242
+ }
243
+ }
244
+ function isSet(value) {
245
+ return value !== null && value !== undefined;
246
+ }
@@ -0,0 +1,144 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ export declare const protobufPackage = "google.protobuf";
3
+ /**
4
+ * `Any` contains an arbitrary serialized protocol buffer message along with a
5
+ * URL that describes the type of the serialized message.
6
+ *
7
+ * Protobuf library provides support to pack/unpack Any values in the form
8
+ * of utility functions or additional generated methods of the Any type.
9
+ *
10
+ * Example 1: Pack and unpack a message in C++.
11
+ *
12
+ * Foo foo = ...;
13
+ * Any any;
14
+ * any.PackFrom(foo);
15
+ * ...
16
+ * if (any.UnpackTo(&foo)) {
17
+ * ...
18
+ * }
19
+ *
20
+ * Example 2: Pack and unpack a message in Java.
21
+ *
22
+ * Foo foo = ...;
23
+ * Any any = Any.pack(foo);
24
+ * ...
25
+ * if (any.is(Foo.class)) {
26
+ * foo = any.unpack(Foo.class);
27
+ * }
28
+ * // or ...
29
+ * if (any.isSameTypeAs(Foo.getDefaultInstance())) {
30
+ * foo = any.unpack(Foo.getDefaultInstance());
31
+ * }
32
+ *
33
+ * Example 3: Pack and unpack a message in Python.
34
+ *
35
+ * foo = Foo(...)
36
+ * any = Any()
37
+ * any.Pack(foo)
38
+ * ...
39
+ * if any.Is(Foo.DESCRIPTOR):
40
+ * any.Unpack(foo)
41
+ * ...
42
+ *
43
+ * Example 4: Pack and unpack a message in Go
44
+ *
45
+ * foo := &pb.Foo{...}
46
+ * any, err := anypb.New(foo)
47
+ * if err != nil {
48
+ * ...
49
+ * }
50
+ * ...
51
+ * foo := &pb.Foo{}
52
+ * if err := any.UnmarshalTo(foo); err != nil {
53
+ * ...
54
+ * }
55
+ *
56
+ * The pack methods provided by protobuf library will by default use
57
+ * 'type.googleapis.com/full.type.name' as the type URL and the unpack
58
+ * methods only use the fully qualified type name after the last '/'
59
+ * in the type URL, for example "foo.bar.com/x/y.z" will yield type
60
+ * name "y.z".
61
+ *
62
+ * JSON
63
+ * ====
64
+ * The JSON representation of an `Any` value uses the regular
65
+ * representation of the deserialized, embedded message, with an
66
+ * additional field `@type` which contains the type URL. Example:
67
+ *
68
+ * package google.profile;
69
+ * message Person {
70
+ * string first_name = 1;
71
+ * string last_name = 2;
72
+ * }
73
+ *
74
+ * {
75
+ * "@type": "type.googleapis.com/google.profile.Person",
76
+ * "firstName": <string>,
77
+ * "lastName": <string>
78
+ * }
79
+ *
80
+ * If the embedded message type is well-known and has a custom JSON
81
+ * representation, that representation will be embedded adding a field
82
+ * `value` which holds the custom JSON in addition to the `@type`
83
+ * field. Example (for message [google.protobuf.Duration][]):
84
+ *
85
+ * {
86
+ * "@type": "type.googleapis.com/google.protobuf.Duration",
87
+ * "value": "1.212s"
88
+ * }
89
+ */
90
+ export interface Any {
91
+ /**
92
+ * A URL/resource name that uniquely identifies the type of the serialized
93
+ * protocol buffer message. This string must contain at least
94
+ * one "/" character. The last segment of the URL's path must represent
95
+ * the fully qualified name of the type (as in
96
+ * `path/google.protobuf.Duration`). The name should be in a canonical form
97
+ * (e.g., leading "." is not accepted).
98
+ *
99
+ * In practice, teams usually precompile into the binary all types that they
100
+ * expect it to use in the context of Any. However, for URLs which use the
101
+ * scheme `http`, `https`, or no scheme, one can optionally set up a type
102
+ * server that maps type URLs to message definitions as follows:
103
+ *
104
+ * * If no scheme is provided, `https` is assumed.
105
+ * * An HTTP GET on the URL must yield a [google.protobuf.Type][]
106
+ * value in binary format, or produce an error.
107
+ * * Applications are allowed to cache lookup results based on the
108
+ * URL, or have them precompiled into a binary to avoid any
109
+ * lookup. Therefore, binary compatibility needs to be preserved
110
+ * on changes to types. (Use versioned type names to manage
111
+ * breaking changes.)
112
+ *
113
+ * Note: this functionality is not currently available in the official
114
+ * protobuf release, and it is not used for type URLs beginning with
115
+ * type.googleapis.com. As of May 2023, there are no widely used type server
116
+ * implementations and no plans to implement one.
117
+ *
118
+ * Schemes other than `http`, `https` (or the empty scheme) might be
119
+ * used with implementation specific semantics.
120
+ */
121
+ typeUrl: string;
122
+ /** Must be a valid serialized protocol buffer of the above specified type. */
123
+ value: Uint8Array;
124
+ }
125
+ export declare const Any: MessageFns<Any>;
126
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
127
+ export 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 {} ? {
128
+ [K in keyof T]?: DeepPartial<T[K]>;
129
+ } : Partial<T>;
130
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
131
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
132
+ [K in keyof P]: Exact<P[K], I[K]>;
133
+ } & {
134
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
135
+ };
136
+ export interface MessageFns<T> {
137
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
138
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
139
+ fromJSON(object: any): T;
140
+ toJSON(message: T): unknown;
141
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
142
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
143
+ }
144
+ export {};
@@ -0,0 +1,107 @@
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: google/protobuf/any.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.Any = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ const wire_1 = require("@bufbuild/protobuf/wire");
11
+ exports.protobufPackage = "google.protobuf";
12
+ function createBaseAny() {
13
+ return { typeUrl: "", value: new Uint8Array(0) };
14
+ }
15
+ exports.Any = {
16
+ encode(message, writer = new wire_1.BinaryWriter()) {
17
+ if (message.typeUrl !== "") {
18
+ writer.uint32(10).string(message.typeUrl);
19
+ }
20
+ if (message.value.length !== 0) {
21
+ writer.uint32(18).bytes(message.value);
22
+ }
23
+ return writer;
24
+ },
25
+ decode(input, length) {
26
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
27
+ let end = length === undefined ? reader.len : reader.pos + length;
28
+ const message = createBaseAny();
29
+ while (reader.pos < end) {
30
+ const tag = reader.uint32();
31
+ switch (tag >>> 3) {
32
+ case 1: {
33
+ if (tag !== 10) {
34
+ break;
35
+ }
36
+ message.typeUrl = reader.string();
37
+ continue;
38
+ }
39
+ case 2: {
40
+ if (tag !== 18) {
41
+ break;
42
+ }
43
+ message.value = reader.bytes();
44
+ continue;
45
+ }
46
+ }
47
+ if ((tag & 7) === 4 || tag === 0) {
48
+ break;
49
+ }
50
+ reader.skip(tag & 7);
51
+ }
52
+ return message;
53
+ },
54
+ fromJSON(object) {
55
+ return {
56
+ typeUrl: isSet(object.typeUrl) ? globalThis.String(object.typeUrl) : "",
57
+ value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0),
58
+ };
59
+ },
60
+ toJSON(message) {
61
+ const obj = {};
62
+ if (message.typeUrl !== "") {
63
+ obj.typeUrl = message.typeUrl;
64
+ }
65
+ if (message.value.length !== 0) {
66
+ obj.value = base64FromBytes(message.value);
67
+ }
68
+ return obj;
69
+ },
70
+ create(base) {
71
+ return exports.Any.fromPartial(base ?? {});
72
+ },
73
+ fromPartial(object) {
74
+ const message = createBaseAny();
75
+ message.typeUrl = object.typeUrl ?? "";
76
+ message.value = object.value ?? new Uint8Array(0);
77
+ return message;
78
+ },
79
+ };
80
+ function bytesFromBase64(b64) {
81
+ if (globalThis.Buffer) {
82
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
83
+ }
84
+ else {
85
+ const bin = globalThis.atob(b64);
86
+ const arr = new Uint8Array(bin.length);
87
+ for (let i = 0; i < bin.length; ++i) {
88
+ arr[i] = bin.charCodeAt(i);
89
+ }
90
+ return arr;
91
+ }
92
+ }
93
+ function base64FromBytes(arr) {
94
+ if (globalThis.Buffer) {
95
+ return globalThis.Buffer.from(arr).toString("base64");
96
+ }
97
+ else {
98
+ const bin = [];
99
+ arr.forEach((byte) => {
100
+ bin.push(globalThis.String.fromCharCode(byte));
101
+ });
102
+ return globalThis.btoa(bin.join(""));
103
+ }
104
+ }
105
+ function isSet(value) {
106
+ return value !== null && value !== undefined;
107
+ }