@signalk/server-api 2.22.0 → 2.24.0

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 (46) hide show
  1. package/dist/deltas.d.ts +8 -0
  2. package/dist/deltas.d.ts.map +1 -1
  3. package/dist/history.d.ts +40 -8
  4. package/dist/history.d.ts.map +1 -1
  5. package/dist/history.js +7 -2
  6. package/dist/propertyvalues.d.ts.map +1 -1
  7. package/dist/propertyvalues.js +35 -5
  8. package/dist/serverapi.d.ts +3 -2
  9. package/dist/serverapi.d.ts.map +1 -1
  10. package/dist/streambundle.d.ts +4 -4
  11. package/dist/streambundle.d.ts.map +1 -1
  12. package/dist/typebox/autopilot-schemas.d.ts +59 -0
  13. package/dist/typebox/autopilot-schemas.d.ts.map +1 -0
  14. package/dist/typebox/autopilot-schemas.js +86 -0
  15. package/dist/typebox/course-schemas.d.ts +218 -0
  16. package/dist/typebox/course-schemas.d.ts.map +1 -0
  17. package/dist/typebox/course-schemas.js +317 -0
  18. package/dist/typebox/discovery-schemas.d.ts +53 -0
  19. package/dist/typebox/discovery-schemas.d.ts.map +1 -0
  20. package/dist/typebox/discovery-schemas.js +73 -0
  21. package/dist/typebox/history-schemas.d.ts +34 -0
  22. package/dist/typebox/history-schemas.d.ts.map +1 -0
  23. package/dist/typebox/history-schemas.js +75 -0
  24. package/dist/typebox/index.d.ts +11 -0
  25. package/dist/typebox/index.d.ts.map +1 -0
  26. package/dist/typebox/index.js +26 -0
  27. package/dist/typebox/notifications-schemas.d.ts +50 -0
  28. package/dist/typebox/notifications-schemas.d.ts.map +1 -0
  29. package/dist/typebox/notifications-schemas.js +53 -0
  30. package/dist/typebox/protocol-schemas.d.ts +432 -0
  31. package/dist/typebox/protocol-schemas.d.ts.map +1 -0
  32. package/dist/typebox/protocol-schemas.js +352 -0
  33. package/dist/typebox/radar-schemas.d.ts +50 -0
  34. package/dist/typebox/radar-schemas.d.ts.map +1 -0
  35. package/dist/typebox/radar-schemas.js +70 -0
  36. package/dist/typebox/resources-schemas.d.ts +152 -0
  37. package/dist/typebox/resources-schemas.d.ts.map +1 -0
  38. package/dist/typebox/resources-schemas.js +214 -0
  39. package/dist/typebox/shared-schemas.d.ts +92 -0
  40. package/dist/typebox/shared-schemas.d.ts.map +1 -0
  41. package/dist/typebox/shared-schemas.js +149 -0
  42. package/dist/typebox/weather-schemas.d.ts +82 -0
  43. package/dist/typebox/weather-schemas.d.ts.map +1 -0
  44. package/dist/typebox/weather-schemas.js +215 -0
  45. package/package.json +12 -8
  46. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,352 @@
1
+ "use strict";
2
+ /**
3
+ * TypeBox Schema Definitions for Signal K Protocol Types
4
+ *
5
+ * Core protocol schemas: Delta, Update, Source, Notification, Meta, Zone.
6
+ *
7
+ * Metadata sourced from:
8
+ * specification/schemas/definitions.json
9
+ * specification/schemas/groups/notifications.json
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DeltaSchema = exports.UpdateSchema = exports.PathValueSchema = exports.NotificationSchema = exports.SourceSchema = exports.MetaSchema = exports.MetaValueSchema = exports.EnhancedDisplayUnitsSchema = exports.DisplayUnitsMetadataSchema = exports.AlarmStatusSchema = exports.ZoneSchema = exports.AlarmMethodSchema = exports.AlarmStateSchema = exports.ALARM_METHOD = exports.ALARM_STATE = void 0;
13
+ const typebox_1 = require("@sinclair/typebox");
14
+ const shared_schemas_1 = require("./shared-schemas");
15
+ // Keep as TypeScript enums alongside TypeBox enum schemas — enums are values
16
+ // used at runtime (switch statements, comparisons), not just types.
17
+ /**
18
+ * Alarm state enum.
19
+ * @see specification/schemas/definitions.json#/definitions/alarmState
20
+ * @category Server API
21
+ */
22
+ var ALARM_STATE;
23
+ (function (ALARM_STATE) {
24
+ ALARM_STATE["nominal"] = "nominal";
25
+ ALARM_STATE["normal"] = "normal";
26
+ ALARM_STATE["alert"] = "alert";
27
+ ALARM_STATE["warn"] = "warn";
28
+ ALARM_STATE["alarm"] = "alarm";
29
+ ALARM_STATE["emergency"] = "emergency";
30
+ })(ALARM_STATE || (exports.ALARM_STATE = ALARM_STATE = {}));
31
+ /**
32
+ * Alarm method enum.
33
+ * @see specification/schemas/definitions.json#/definitions/alarmMethodEnum
34
+ * @category Server API
35
+ */
36
+ var ALARM_METHOD;
37
+ (function (ALARM_METHOD) {
38
+ ALARM_METHOD["visual"] = "visual";
39
+ ALARM_METHOD["sound"] = "sound";
40
+ })(ALARM_METHOD || (exports.ALARM_METHOD = ALARM_METHOD = {}));
41
+ /**
42
+ * TypeBox schema for alarm state values.
43
+ * Mirrors the ALARM_STATE enum for runtime validation and documentation.
44
+ */
45
+ exports.AlarmStateSchema = typebox_1.Type.Union([
46
+ typebox_1.Type.Literal('nominal'),
47
+ typebox_1.Type.Literal('normal'),
48
+ typebox_1.Type.Literal('alert'),
49
+ typebox_1.Type.Literal('warn'),
50
+ typebox_1.Type.Literal('alarm'),
51
+ typebox_1.Type.Literal('emergency')
52
+ ], {
53
+ $id: 'AlarmState',
54
+ description: 'The alarm state when the value is in this zone.',
55
+ default: 'normal'
56
+ });
57
+ /**
58
+ * TypeBox schema for alarm method values.
59
+ * Mirrors the ALARM_METHOD enum for runtime validation and documentation.
60
+ */
61
+ exports.AlarmMethodSchema = typebox_1.Type.Union([typebox_1.Type.Literal('visual'), typebox_1.Type.Literal('sound')], {
62
+ $id: 'AlarmMethod',
63
+ description: 'Method to use to raise notifications.'
64
+ });
65
+ /**
66
+ * A zone defining display and alarm state for a value range.
67
+ * @see specification/schemas/definitions.json zones definition
68
+ */
69
+ exports.ZoneSchema = typebox_1.Type.Object({
70
+ lower: typebox_1.Type.Optional(typebox_1.Type.Number({
71
+ description: 'The lowest number in this zone',
72
+ examples: [3500]
73
+ })),
74
+ upper: typebox_1.Type.Optional(typebox_1.Type.Number({
75
+ description: 'The highest value in this zone',
76
+ examples: [4000]
77
+ })),
78
+ state: exports.AlarmStateSchema,
79
+ message: typebox_1.Type.String({
80
+ description: 'The message to display for the alarm.',
81
+ default: 'Warning'
82
+ })
83
+ }, {
84
+ $id: 'Zone',
85
+ description: 'A zone used to define the display and alarm state when the value is in between lower and upper.'
86
+ });
87
+ /**
88
+ * Alarm status flags (silenced, acknowledged, etc.).
89
+ */
90
+ exports.AlarmStatusSchema = typebox_1.Type.Object({
91
+ silenced: typebox_1.Type.Boolean({
92
+ description: 'Whether the alarm has been silenced'
93
+ }),
94
+ acknowledged: typebox_1.Type.Boolean({
95
+ description: 'Whether the alarm has been acknowledged'
96
+ }),
97
+ canSilence: typebox_1.Type.Boolean({
98
+ description: 'Whether the alarm can be silenced'
99
+ }),
100
+ canAcknowledge: typebox_1.Type.Boolean({
101
+ description: 'Whether the alarm can be acknowledged'
102
+ }),
103
+ canClear: typebox_1.Type.Boolean({
104
+ description: 'Whether the alarm can be cleared'
105
+ })
106
+ }, {
107
+ $id: 'AlarmStatus',
108
+ description: 'Status flags for an active alarm/notification'
109
+ });
110
+ /**
111
+ * Stored display-units metadata — the minimal form persisted in path metadata.
112
+ * The server resolves this into EnhancedDisplayUnits before sending to clients.
113
+ */
114
+ exports.DisplayUnitsMetadataSchema = typebox_1.Type.Object({
115
+ category: typebox_1.Type.String({
116
+ description: 'Unit category (e.g. "speed", "temperature", "distance")'
117
+ }),
118
+ targetUnit: typebox_1.Type.Optional(typebox_1.Type.String({
119
+ description: 'Per-path target unit override (e.g. "kn", "°C")'
120
+ })),
121
+ displayFormat: typebox_1.Type.Optional(typebox_1.Type.String({
122
+ description: 'Display format string (e.g. "0.0", "0.00")'
123
+ }))
124
+ }, {
125
+ $id: 'DisplayUnitsMetadata',
126
+ description: 'Stored display-units metadata for a Signal K path'
127
+ });
128
+ /**
129
+ * Enhanced display-units metadata — the resolved form returned to clients,
130
+ * containing the Math.js conversion formulas needed to convert from SI.
131
+ */
132
+ exports.EnhancedDisplayUnitsSchema = typebox_1.Type.Object({
133
+ category: typebox_1.Type.String({
134
+ description: 'Unit category (e.g. "speed", "temperature")'
135
+ }),
136
+ targetUnit: typebox_1.Type.String({
137
+ description: 'Target display unit (e.g. "kn", "°C")'
138
+ }),
139
+ formula: typebox_1.Type.String({
140
+ description: 'Math.js formula to convert from SI to target unit (e.g. "value * 1.94384")'
141
+ }),
142
+ inverseFormula: typebox_1.Type.String({
143
+ description: 'Math.js formula to convert from target unit back to SI (e.g. "value * 0.514444")'
144
+ }),
145
+ symbol: typebox_1.Type.String({
146
+ description: 'Unit symbol for display (e.g. "kn", "°C")'
147
+ }),
148
+ displayFormat: typebox_1.Type.Optional(typebox_1.Type.String({
149
+ description: 'Display format string (e.g. "0.0")'
150
+ }))
151
+ }, {
152
+ $id: 'EnhancedDisplayUnits',
153
+ description: 'Resolved display-units metadata with conversion formulas, as returned to clients'
154
+ });
155
+ /**
156
+ * Metadata payload for a Signal K path.
157
+ * Contains display hints, units, timeout, and alarm zones.
158
+ */
159
+ exports.MetaValueSchema = typebox_1.Type.Object({
160
+ description: typebox_1.Type.Optional(typebox_1.Type.String({ description: 'Description of the Signal K path' })),
161
+ units: typebox_1.Type.Optional(typebox_1.Type.String({
162
+ description: 'Allowed units of physical quantities. Units should be (derived) SI units where possible.'
163
+ })),
164
+ example: typebox_1.Type.Optional(typebox_1.Type.String({ description: 'An example value for this path' })),
165
+ timeout: typebox_1.Type.Optional(typebox_1.Type.Number({
166
+ description: 'The timeout in seconds after which the value should be considered stale',
167
+ minimum: 0
168
+ })),
169
+ displayName: typebox_1.Type.Optional(typebox_1.Type.String({
170
+ description: 'A human-readable display name for this path'
171
+ })),
172
+ displayScale: typebox_1.Type.Optional(typebox_1.Type.Object({
173
+ lower: typebox_1.Type.Number({ description: 'Lower bound of display scale' }),
174
+ upper: typebox_1.Type.Number({ description: 'Upper bound of display scale' })
175
+ })),
176
+ zones: typebox_1.Type.Optional(typebox_1.Type.Array(exports.ZoneSchema, {
177
+ description: 'The zones defining the range of values for this Signal K value.'
178
+ })),
179
+ supportsPut: typebox_1.Type.Optional(typebox_1.Type.Boolean({
180
+ description: 'Whether this path supports PUT operations'
181
+ })),
182
+ displayUnits: typebox_1.Type.Optional(typebox_1.Type.Union([exports.DisplayUnitsMetadataSchema, exports.EnhancedDisplayUnitsSchema], {
183
+ description: 'Display unit preferences — either stored metadata or resolved with conversion formulas'
184
+ }))
185
+ }, {
186
+ $id: 'MetaValue',
187
+ description: 'Metadata about a Signal K path'
188
+ });
189
+ /**
190
+ * Meta message — a path paired with its metadata.
191
+ */
192
+ exports.MetaSchema = typebox_1.Type.Object({
193
+ path: typebox_1.Type.String({ description: 'Signal K path' }),
194
+ value: exports.MetaValueSchema
195
+ }, {
196
+ $id: 'Meta',
197
+ description: 'A path with its metadata value'
198
+ });
199
+ /**
200
+ * Source of data in delta format — a record of where the data was received from.
201
+ *
202
+ * Properties cover NMEA 0183 (talker, sentence), NMEA 2000 (src, pgn, canName,
203
+ * instance), and AIS (aisType 1-27) sources.
204
+ *
205
+ * @see specification/schemas/definitions.json#/definitions/source
206
+ */
207
+ exports.SourceSchema = typebox_1.Type.Object({
208
+ label: typebox_1.Type.String({
209
+ description: 'A label to identify the source bus, e.g. serial-COM1, eth-local, etc.',
210
+ examples: ['N2K-1']
211
+ }),
212
+ type: typebox_1.Type.Optional(typebox_1.Type.String({
213
+ description: 'A human name to identify the type. NMEA0183, NMEA2000, signalk',
214
+ default: 'NMEA2000',
215
+ examples: ['NMEA2000']
216
+ })),
217
+ // NMEA 2000 fields
218
+ src: typebox_1.Type.Optional(typebox_1.Type.String({
219
+ description: 'NMEA2000 src value or any similar value for encapsulating the original source of the data',
220
+ examples: ['36']
221
+ })),
222
+ canName: typebox_1.Type.Optional(typebox_1.Type.String({
223
+ description: 'NMEA2000 CAN name of the source device',
224
+ examples: ['13877444229283709432']
225
+ })),
226
+ pgn: typebox_1.Type.Optional(typebox_1.Type.Number({
227
+ description: 'NMEA2000 PGN of the source message',
228
+ examples: [130312]
229
+ })),
230
+ instance: typebox_1.Type.Optional(typebox_1.Type.String({
231
+ description: 'NMEA2000 instance value of the source message'
232
+ })),
233
+ // NMEA 0183 fields
234
+ sentence: typebox_1.Type.Optional(typebox_1.Type.String({
235
+ description: 'Sentence type of the source NMEA0183 sentence, e.g. RMC from $GPRMC,...',
236
+ examples: ['RMC']
237
+ })),
238
+ talker: typebox_1.Type.Optional(typebox_1.Type.String({
239
+ description: 'Talker id of the source NMEA0183 sentence, e.g. GP from $GPRMC,...',
240
+ examples: ['GP']
241
+ })),
242
+ // AIS fields
243
+ aisType: typebox_1.Type.Optional(typebox_1.Type.Integer({
244
+ minimum: 1,
245
+ maximum: 27,
246
+ description: 'AIS Message Type',
247
+ examples: [15]
248
+ }))
249
+ }, {
250
+ $id: 'Source',
251
+ description: 'Source of data in delta format, a record of where the data was received from.'
252
+ });
253
+ /**
254
+ * Notification payload — state, method, message, and optional position/status.
255
+ */
256
+ exports.NotificationSchema = typebox_1.Type.Object({
257
+ state: exports.AlarmStateSchema,
258
+ method: typebox_1.Type.Array(exports.AlarmMethodSchema, {
259
+ description: 'Methods to use to raise this notification'
260
+ }),
261
+ message: typebox_1.Type.String({
262
+ description: 'Message to display or speak'
263
+ }),
264
+ status: typebox_1.Type.Optional(exports.AlarmStatusSchema),
265
+ position: typebox_1.Type.Optional(typebox_1.Type.Ref(shared_schemas_1.PositionSchema, {
266
+ description: 'Geographic position associated with the notification, when relevant (e.g. MOB, anchor alarm, waypoint arrival)'
267
+ })),
268
+ createdAt: typebox_1.Type.Optional(typebox_1.Type.String({
269
+ pattern: shared_schemas_1.IsoTimePattern,
270
+ description: 'ISO 8601 timestamp when the notification was created'
271
+ })),
272
+ id: typebox_1.Type.Optional(typebox_1.Type.String({
273
+ pattern: shared_schemas_1.SignalKUuidPattern,
274
+ description: 'Unique notification identifier (UUID)',
275
+ examples: ['ac3a3b2d-07e8-4f25-92bc-98e7c92f7f1a']
276
+ }))
277
+ }, {
278
+ $id: 'Notification',
279
+ description: 'A Signal K notification with alarm state and message'
280
+ });
281
+ /**
282
+ * A path-value pair in an update delta.
283
+ */
284
+ exports.PathValueSchema = typebox_1.Type.Object({
285
+ path: typebox_1.Type.String({ description: 'Signal K path' }),
286
+ value: typebox_1.Type.Unknown({ description: 'The value for this path' })
287
+ }, {
288
+ $id: 'PathValue',
289
+ description: 'A Signal K path and its value'
290
+ });
291
+ /**
292
+ * An update within a delta message.
293
+ * Must contain values[] or meta[] (or both), plus optional timestamp and source.
294
+ *
295
+ * Uses a Union to match the Signal K specification's oneOf constraint:
296
+ * an update with neither values nor meta is invalid.
297
+ * @see specification delta.json oneOf constraint
298
+ */
299
+ const UpdateBase = typebox_1.Type.Object({
300
+ timestamp: typebox_1.Type.Optional(typebox_1.Type.String({
301
+ pattern: shared_schemas_1.IsoTimePattern,
302
+ description: 'RFC 3339 (UTC only without local offset) string representing date and time.'
303
+ })),
304
+ source: typebox_1.Type.Optional(exports.SourceSchema),
305
+ $source: typebox_1.Type.Optional(typebox_1.Type.String({
306
+ pattern: '^[A-Za-z0-9-_.]*$',
307
+ description: 'Reference to the source under /sources. A dot separated path to the data, e.g. [type].[bus].[device]',
308
+ examples: ['NMEA0183.COM1.GP']
309
+ })),
310
+ notificationId: typebox_1.Type.Optional(typebox_1.Type.String({ description: 'Notification identifier' }))
311
+ });
312
+ const ValuesFields = typebox_1.Type.Object({
313
+ values: typebox_1.Type.Array(exports.PathValueSchema, {
314
+ description: 'Array of path-value pairs'
315
+ }),
316
+ meta: typebox_1.Type.Optional(typebox_1.Type.Array(exports.MetaSchema, {
317
+ description: 'Array of path-metadata pairs'
318
+ }))
319
+ });
320
+ const MetaFields = typebox_1.Type.Object({
321
+ meta: typebox_1.Type.Array(exports.MetaSchema, {
322
+ description: 'Array of path-metadata pairs'
323
+ }),
324
+ values: typebox_1.Type.Optional(typebox_1.Type.Array(exports.PathValueSchema, {
325
+ description: 'Array of path-value pairs'
326
+ }))
327
+ });
328
+ exports.UpdateSchema = typebox_1.Type.Union([
329
+ typebox_1.Type.Intersect([UpdateBase, ValuesFields]),
330
+ typebox_1.Type.Intersect([UpdateBase, MetaFields])
331
+ ], {
332
+ $id: 'Update',
333
+ description: 'A Signal K update containing path-value and/or path-meta pairs with timestamp and source'
334
+ });
335
+ /**
336
+ * A Signal K delta message — the fundamental unit of data exchange.
337
+ * Contains a context (vessel/aircraft/etc.) and one or more updates.
338
+ */
339
+ exports.DeltaSchema = typebox_1.Type.Object({
340
+ context: typebox_1.Type.Optional(typebox_1.Type.String({
341
+ description: 'The context path, usually a vessel URN (e.g. vessels.urn:mrn:signalk:uuid:...)',
342
+ examples: [
343
+ 'vessels.urn:mrn:signalk:uuid:b7590868-1d62-47d9-989c-32321b349fb9'
344
+ ]
345
+ })),
346
+ updates: typebox_1.Type.Array(exports.UpdateSchema, {
347
+ description: 'One or more updates in this delta'
348
+ })
349
+ }, {
350
+ $id: 'Delta',
351
+ description: 'A Signal K delta message — the fundamental unit of data exchange'
352
+ });
@@ -0,0 +1,50 @@
1
+ /**
2
+ * TypeBox Schema Definitions for the Signal K Radar API
3
+ */
4
+ import { type Static } from '@sinclair/typebox';
5
+ export declare const RadarStatusSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"off">, import("@sinclair/typebox").TLiteral<"standby">, import("@sinclair/typebox").TLiteral<"transmit">, import("@sinclair/typebox").TLiteral<"warming">]>;
6
+ export type RadarStatusSchemaType = Static<typeof RadarStatusSchema>;
7
+ export declare const RadarControlValueSchema: import("@sinclair/typebox").TObject<{
8
+ auto: import("@sinclair/typebox").TBoolean;
9
+ value: import("@sinclair/typebox").TNumber;
10
+ }>;
11
+ export type RadarControlValueSchemaType = Static<typeof RadarControlValueSchema>;
12
+ export declare const RadarControlsSchema: import("@sinclair/typebox").TObject<{
13
+ gain: import("@sinclair/typebox").TRefUnsafe<import("@sinclair/typebox").TObject<{
14
+ auto: import("@sinclair/typebox").TBoolean;
15
+ value: import("@sinclair/typebox").TNumber;
16
+ }>>;
17
+ sea: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRefUnsafe<import("@sinclair/typebox").TObject<{
18
+ auto: import("@sinclair/typebox").TBoolean;
19
+ value: import("@sinclair/typebox").TNumber;
20
+ }>>>;
21
+ rain: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
22
+ value: import("@sinclair/typebox").TNumber;
23
+ }>>;
24
+ }>;
25
+ export type RadarControlsSchemaType = Static<typeof RadarControlsSchema>;
26
+ export declare const RadarInfoSchema: import("@sinclair/typebox").TObject<{
27
+ id: import("@sinclair/typebox").TString;
28
+ name: import("@sinclair/typebox").TString;
29
+ brand: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
30
+ status: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"off">, import("@sinclair/typebox").TLiteral<"standby">, import("@sinclair/typebox").TLiteral<"transmit">, import("@sinclair/typebox").TLiteral<"warming">]>;
31
+ spokesPerRevolution: import("@sinclair/typebox").TInteger;
32
+ maxSpokeLen: import("@sinclair/typebox").TInteger;
33
+ range: import("@sinclair/typebox").TNumber;
34
+ controls: import("@sinclair/typebox").TObject<{
35
+ gain: import("@sinclair/typebox").TRefUnsafe<import("@sinclair/typebox").TObject<{
36
+ auto: import("@sinclair/typebox").TBoolean;
37
+ value: import("@sinclair/typebox").TNumber;
38
+ }>>;
39
+ sea: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TRefUnsafe<import("@sinclair/typebox").TObject<{
40
+ auto: import("@sinclair/typebox").TBoolean;
41
+ value: import("@sinclair/typebox").TNumber;
42
+ }>>>;
43
+ rain: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
44
+ value: import("@sinclair/typebox").TNumber;
45
+ }>>;
46
+ }>;
47
+ streamUrl: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
48
+ }>;
49
+ export type RadarInfoSchemaType = Static<typeof RadarInfoSchema>;
50
+ //# sourceMappingURL=radar-schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radar-schemas.d.ts","sourceRoot":"","sources":["../../src/typebox/radar-schemas.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAErD,eAAO,MAAM,iBAAiB,uOAW7B,CAAA;AACD,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAEpE,eAAO,MAAM,uBAAuB;;;EAcnC,CAAA;AACD,MAAM,MAAM,2BAA2B,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEhF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EA+B/B,CAAA;AACD,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAExE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;EA8B3B,CAAA;AACD,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,eAAe,CAAC,CAAA"}
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ /**
3
+ * TypeBox Schema Definitions for the Signal K Radar API
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.RadarInfoSchema = exports.RadarControlsSchema = exports.RadarControlValueSchema = exports.RadarStatusSchema = void 0;
7
+ const typebox_1 = require("@sinclair/typebox");
8
+ exports.RadarStatusSchema = typebox_1.Type.Union([
9
+ typebox_1.Type.Literal('off'),
10
+ typebox_1.Type.Literal('standby'),
11
+ typebox_1.Type.Literal('transmit'),
12
+ typebox_1.Type.Literal('warming')
13
+ ], {
14
+ $id: 'RadarStatus',
15
+ description: 'Current operational status of the radar'
16
+ });
17
+ exports.RadarControlValueSchema = typebox_1.Type.Object({
18
+ auto: typebox_1.Type.Boolean({
19
+ description: 'Whether automatic adjustment is enabled'
20
+ }),
21
+ value: typebox_1.Type.Number({
22
+ description: 'Current control value. The valid range depends on the radar hardware — see the capability manifest at GET /radars/{id}/capabilities for min/max/step per control.'
23
+ })
24
+ }, {
25
+ $id: 'RadarControlValue',
26
+ description: 'A radar control with auto mode and a numeric value'
27
+ });
28
+ exports.RadarControlsSchema = typebox_1.Type.Object({
29
+ gain: typebox_1.Type.Ref(exports.RadarControlValueSchema, {
30
+ description: 'Receiver gain control'
31
+ }),
32
+ sea: typebox_1.Type.Optional(typebox_1.Type.Ref(exports.RadarControlValueSchema, {
33
+ description: 'Sea clutter rejection control. Present when supported by the radar.'
34
+ })),
35
+ rain: typebox_1.Type.Optional(typebox_1.Type.Object({
36
+ value: typebox_1.Type.Number({
37
+ description: 'Rain clutter rejection level. Valid range is hardware-dependent — see capability manifest.'
38
+ })
39
+ }, {
40
+ description: 'Rain clutter rejection control (no auto mode). Present when supported by the radar.'
41
+ }))
42
+ }, {
43
+ $id: 'RadarControlsModel',
44
+ description: 'Current control settings for a radar. Additional radar-specific controls beyond gain/sea/rain may be present.'
45
+ });
46
+ exports.RadarInfoSchema = typebox_1.Type.Object({
47
+ id: typebox_1.Type.String({ description: 'Unique radar identifier' }),
48
+ name: typebox_1.Type.String({ description: 'Display name' }),
49
+ brand: typebox_1.Type.Optional(typebox_1.Type.String({ description: 'Manufacturer/brand' })),
50
+ status: exports.RadarStatusSchema,
51
+ spokesPerRevolution: typebox_1.Type.Integer({
52
+ description: 'Number of spokes per full rotation (e.g. 512, 1024, 2048)',
53
+ examples: [2048]
54
+ }),
55
+ maxSpokeLen: typebox_1.Type.Integer({
56
+ description: 'Maximum spoke length in samples (e.g. 512, 1024)',
57
+ examples: [1024]
58
+ }),
59
+ range: typebox_1.Type.Number({
60
+ description: 'Current range in meters',
61
+ units: 'm'
62
+ }),
63
+ controls: exports.RadarControlsSchema,
64
+ streamUrl: typebox_1.Type.Optional(typebox_1.Type.String({
65
+ description: 'WebSocket URL for spoke stream. If absent, use /radars/{id}/stream'
66
+ }))
67
+ }, {
68
+ $id: 'RadarInfoModel',
69
+ description: 'Information about a radar device'
70
+ });
@@ -0,0 +1,152 @@
1
+ /**
2
+ * TypeBox Schema Definitions for the Signal K Resources API
3
+ *
4
+ * Covers routes, waypoints, regions, notes, and charts.
5
+ */
6
+ import { type Static } from '@sinclair/typebox';
7
+ /**
8
+ * Signal K resource href — generic pointer to any resource type by UUID.
9
+ */
10
+ export declare const SignalKHrefSchema: import("@sinclair/typebox").TString;
11
+ /** Href attribute — used to link a note to another resource */
12
+ export declare const HrefAttributeSchema: import("@sinclair/typebox").TObject<{
13
+ href: import("@sinclair/typebox").TString;
14
+ }>;
15
+ /** Position attribute — used to give a note a geographic position */
16
+ export declare const PositionAttributeSchema: import("@sinclair/typebox").TObject<{
17
+ position: import("@sinclair/typebox").TObject<{
18
+ latitude: import("@sinclair/typebox").TNumber;
19
+ longitude: import("@sinclair/typebox").TNumber;
20
+ altitude: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
21
+ }>;
22
+ }>;
23
+ export declare const BaseResponseModelSchema: import("@sinclair/typebox").TObject<{
24
+ timestamp: import("@sinclair/typebox").TString;
25
+ $source: import("@sinclair/typebox").TString;
26
+ }>;
27
+ /** Route point metadata */
28
+ export declare const RoutePointMetaSchema: import("@sinclair/typebox").TObject<{
29
+ name: import("@sinclair/typebox").TString;
30
+ }>;
31
+ /** Route resource */
32
+ export declare const RouteSchema: import("@sinclair/typebox").TObject<{
33
+ name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
34
+ description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
35
+ distance: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
36
+ feature: import("@sinclair/typebox").TObject<{
37
+ geometry: import("@sinclair/typebox").TObject<{
38
+ type: import("@sinclair/typebox").TLiteral<"LineString">;
39
+ coordinates: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNumber]>>;
40
+ }>;
41
+ properties: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
42
+ coordinatesMeta: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
43
+ name: import("@sinclair/typebox").TString;
44
+ }>, import("@sinclair/typebox").TObject<{
45
+ href: import("@sinclair/typebox").TString;
46
+ }>]>>>;
47
+ }>>;
48
+ }>;
49
+ }>;
50
+ export type RouteResource = Static<typeof RouteSchema>;
51
+ /** Waypoint resource */
52
+ export declare const WaypointSchema: import("@sinclair/typebox").TObject<{
53
+ name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
54
+ description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
55
+ type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
56
+ feature: import("@sinclair/typebox").TObject<{
57
+ geometry: import("@sinclair/typebox").TObject<{
58
+ type: import("@sinclair/typebox").TLiteral<"Point">;
59
+ coordinates: import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNumber]>;
60
+ }>;
61
+ properties: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{}>>;
62
+ }>;
63
+ }>;
64
+ export type WaypointResource = Static<typeof WaypointSchema>;
65
+ /** Region resource */
66
+ export declare const RegionSchema: import("@sinclair/typebox").TObject<{
67
+ name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
68
+ description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
69
+ feature: import("@sinclair/typebox").TObject<{
70
+ geometry: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
71
+ type: import("@sinclair/typebox").TLiteral<"Polygon">;
72
+ coordinates: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNumber]>>>;
73
+ }>, import("@sinclair/typebox").TObject<{
74
+ type: import("@sinclair/typebox").TLiteral<"MultiPolygon">;
75
+ coordinates: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TTuple<[import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNumber]>>>>;
76
+ }>]>;
77
+ properties: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{}>>;
78
+ }>;
79
+ }>;
80
+ export type RegionResource = Static<typeof RegionSchema>;
81
+ /** Note base model */
82
+ export declare const NoteBaseModelSchema: import("@sinclair/typebox").TObject<{
83
+ title: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
84
+ description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
85
+ mimeType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
86
+ url: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
87
+ properties: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{}>>;
88
+ }>;
89
+ /** Note resource — a note linked to either an href or a position */
90
+ export declare const NoteSchema: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
91
+ title: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
92
+ description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
93
+ mimeType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
94
+ url: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
95
+ properties: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{}>>;
96
+ }>, import("@sinclair/typebox").TObject<{
97
+ href: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
98
+ position: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
99
+ latitude: import("@sinclair/typebox").TNumber;
100
+ longitude: import("@sinclair/typebox").TNumber;
101
+ altitude: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
102
+ }>>;
103
+ }>]>;
104
+ export type NoteResource = Static<typeof NoteSchema>;
105
+ /** Tile layer source */
106
+ export declare const TileLayerSourceSchema: import("@sinclair/typebox").TObject<{
107
+ type: import("@sinclair/typebox").TLiteral<"tilelayer">;
108
+ bounds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>>;
109
+ format: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"jpg">, import("@sinclair/typebox").TLiteral<"pbf">, import("@sinclair/typebox").TLiteral<"png">, import("@sinclair/typebox").TLiteral<"webp">]>>;
110
+ maxzoom: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
111
+ minzoom: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
112
+ scale: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
113
+ }>;
114
+ /** Map server source */
115
+ export declare const MapServerSourceSchema: import("@sinclair/typebox").TObject<{
116
+ type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tileJSON">, import("@sinclair/typebox").TLiteral<"WMS">, import("@sinclair/typebox").TLiteral<"WMTS">, import("@sinclair/typebox").TLiteral<"mapstyleJSON">, import("@sinclair/typebox").TLiteral<"S-57">]>;
117
+ }>;
118
+ /** Chart resource */
119
+ export declare const ChartSchema: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
120
+ identifier: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
121
+ name: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
122
+ description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
123
+ url: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
124
+ layers: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
125
+ }>, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
126
+ type: import("@sinclair/typebox").TLiteral<"tilelayer">;
127
+ bounds: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>>;
128
+ format: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"jpg">, import("@sinclair/typebox").TLiteral<"pbf">, import("@sinclair/typebox").TLiteral<"png">, import("@sinclair/typebox").TLiteral<"webp">]>>;
129
+ maxzoom: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
130
+ minzoom: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
131
+ scale: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
132
+ }>, import("@sinclair/typebox").TObject<{
133
+ type: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"tileJSON">, import("@sinclair/typebox").TLiteral<"WMS">, import("@sinclair/typebox").TLiteral<"WMTS">, import("@sinclair/typebox").TLiteral<"mapstyleJSON">, import("@sinclair/typebox").TLiteral<"S-57">]>;
134
+ }>]>]>;
135
+ export type ChartResource = Static<typeof ChartSchema>;
136
+ /**
137
+ * 200 success response with resource ID.
138
+ */
139
+ export declare const ResourceActionOkResponseSchema: import("@sinclair/typebox").TObject<{
140
+ state: import("@sinclair/typebox").TLiteral<"COMPLETED">;
141
+ statusCode: import("@sinclair/typebox").TLiteral<200>;
142
+ id: import("@sinclair/typebox").TString;
143
+ }>;
144
+ /**
145
+ * 201 created response with resource ID.
146
+ */
147
+ export declare const ResourceActionCreatedResponseSchema: import("@sinclair/typebox").TObject<{
148
+ state: import("@sinclair/typebox").TLiteral<"COMPLETED">;
149
+ statusCode: import("@sinclair/typebox").TLiteral<201>;
150
+ id: import("@sinclair/typebox").TString;
151
+ }>;
152
+ //# sourceMappingURL=resources-schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources-schemas.d.ts","sourceRoot":"","sources":["../../src/typebox/resources-schemas.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAUrD;;GAEG;AACH,eAAO,MAAM,iBAAiB,qCAK5B,CAAA;AAEF,+DAA+D;AAC/D,eAAO,MAAM,mBAAmB;;EAK/B,CAAA;AAED,qEAAqE;AACrE,eAAO,MAAM,uBAAuB;;;;;;EAKnC,CAAA;AAED,eAAO,MAAM,uBAAuB;;;EAgBnC,CAAA;AAED,2BAA2B;AAC3B,eAAO,MAAM,oBAAoB;;EAQhC,CAAA;AAED,qBAAqB;AACrB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;EAoCvB,CAAA;AACD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAA;AAEtD,wBAAwB;AACxB,eAAO,MAAM,cAAc;;;;;;;;;;;EA4B1B,CAAA;AACD,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAA;AAE5D,sBAAsB;AACtB,eAAO,MAAM,YAAY;;;;;;;;;;;;;EA0BxB,CAAA;AACD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,YAAY,CAAC,CAAA;AAExD,sBAAsB;AACtB,eAAO,MAAM,mBAAmB;;;;;;EAwB/B,CAAA;AAED,oEAAoE;AACpE,eAAO,MAAM,UAAU;;;;;;;;;;;;;IActB,CAAA;AACD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,UAAU,CAAC,CAAA;AAEpD,wBAAwB;AACxB,eAAO,MAAM,qBAAqB;;;;;;;EAkDjC,CAAA;AAED,wBAAwB;AACxB,eAAO,MAAM,qBAAqB;;EAejC,CAAA;AAED,qBAAqB;AACrB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;MAyBvB,CAAA;AACD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAA;AAEtD;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;EAU1C,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mCAAmC;;;;EAU/C,CAAA"}