@signalk/server-api 2.23.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 (44) hide show
  1. package/dist/history.d.ts +24 -6
  2. package/dist/history.d.ts.map +1 -1
  3. package/dist/history.js +7 -2
  4. package/dist/propertyvalues.d.ts.map +1 -1
  5. package/dist/propertyvalues.js +35 -5
  6. package/dist/serverapi.d.ts +3 -2
  7. package/dist/serverapi.d.ts.map +1 -1
  8. package/dist/streambundle.d.ts +4 -4
  9. package/dist/streambundle.d.ts.map +1 -1
  10. package/dist/typebox/autopilot-schemas.d.ts +59 -0
  11. package/dist/typebox/autopilot-schemas.d.ts.map +1 -0
  12. package/dist/typebox/autopilot-schemas.js +86 -0
  13. package/dist/typebox/course-schemas.d.ts +218 -0
  14. package/dist/typebox/course-schemas.d.ts.map +1 -0
  15. package/dist/typebox/course-schemas.js +317 -0
  16. package/dist/typebox/discovery-schemas.d.ts +53 -0
  17. package/dist/typebox/discovery-schemas.d.ts.map +1 -0
  18. package/dist/typebox/discovery-schemas.js +73 -0
  19. package/dist/typebox/history-schemas.d.ts +34 -0
  20. package/dist/typebox/history-schemas.d.ts.map +1 -0
  21. package/dist/typebox/history-schemas.js +75 -0
  22. package/dist/typebox/index.d.ts +11 -0
  23. package/dist/typebox/index.d.ts.map +1 -0
  24. package/dist/typebox/index.js +26 -0
  25. package/dist/typebox/notifications-schemas.d.ts +50 -0
  26. package/dist/typebox/notifications-schemas.d.ts.map +1 -0
  27. package/dist/typebox/notifications-schemas.js +53 -0
  28. package/dist/typebox/protocol-schemas.d.ts +432 -0
  29. package/dist/typebox/protocol-schemas.d.ts.map +1 -0
  30. package/dist/typebox/protocol-schemas.js +352 -0
  31. package/dist/typebox/radar-schemas.d.ts +50 -0
  32. package/dist/typebox/radar-schemas.d.ts.map +1 -0
  33. package/dist/typebox/radar-schemas.js +70 -0
  34. package/dist/typebox/resources-schemas.d.ts +152 -0
  35. package/dist/typebox/resources-schemas.d.ts.map +1 -0
  36. package/dist/typebox/resources-schemas.js +214 -0
  37. package/dist/typebox/shared-schemas.d.ts +92 -0
  38. package/dist/typebox/shared-schemas.d.ts.map +1 -0
  39. package/dist/typebox/shared-schemas.js +149 -0
  40. package/dist/typebox/weather-schemas.d.ts +82 -0
  41. package/dist/typebox/weather-schemas.d.ts.map +1 -0
  42. package/dist/typebox/weather-schemas.js +215 -0
  43. package/package.json +10 -4
  44. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"course-schemas.d.ts","sourceRoot":"","sources":["../../src/typebox/course-schemas.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,317 @@
1
+ "use strict";
2
+ /**
3
+ * TypeBox Schema Definitions for the Signal K Course API
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CourseConfigSchema = exports.CourseDeltaV1Schema = exports.CourseDeltaV2Schema = exports.CourseCalculationsSchema = exports.CourseInfoSchema = exports.NextPreviousPointSchema = exports.ActiveRouteSchema = exports.ReverseBodySchema = exports.PointIndexBodySchema = exports.NextPointBodySchema = exports.TargetArrivalTimeBodySchema = exports.ArrivalCircleBodySchema = exports.RouteDestinationSchema = exports.SetDestinationBodySchema = exports.PositionDestinationSchema = exports.HrefDestinationSchema = exports.CoursePointTypeSchema = exports.ArrivalCircleSchema = exports.SignalKHrefWaypointSchema = exports.SignalKHrefRouteSchema = exports.ErrorResponseSchema = exports.OkResponseSchema = exports.PositionSchema = exports.IsoTimeSchema = void 0;
7
+ const typebox_1 = require("@sinclair/typebox");
8
+ const shared_schemas_1 = require("./shared-schemas");
9
+ Object.defineProperty(exports, "PositionSchema", { enumerable: true, get: function () { return shared_schemas_1.PositionSchema; } });
10
+ Object.defineProperty(exports, "IsoTimeSchema", { enumerable: true, get: function () { return shared_schemas_1.IsoTimeSchema; } });
11
+ Object.defineProperty(exports, "OkResponseSchema", { enumerable: true, get: function () { return shared_schemas_1.OkResponseSchema; } });
12
+ Object.defineProperty(exports, "ErrorResponseSchema", { enumerable: true, get: function () { return shared_schemas_1.ErrorResponseSchema; } });
13
+ /** Signal K route resource href (UUID v4 format). */
14
+ exports.SignalKHrefRouteSchema = typebox_1.Type.String({
15
+ $id: 'SignalKHrefRoute',
16
+ pattern: `^/resources/routes/${shared_schemas_1.SignalKUuidPattern}$`,
17
+ description: 'Pointer to route resource.',
18
+ examples: ['/resources/routes/ac3a3b2d-07e8-4f25-92bc-98e7c92f7f1a']
19
+ });
20
+ /** Signal K waypoint resource href (UUID v4 format). */
21
+ exports.SignalKHrefWaypointSchema = typebox_1.Type.String({
22
+ $id: 'SignalKHrefWaypoint',
23
+ pattern: `^/resources/waypoints/${shared_schemas_1.SignalKUuidPattern}$`,
24
+ description: 'Pointer to waypoint resource.',
25
+ examples: ['/resources/waypoints/ac3a3b2d-07e8-4f25-92bc-98e7c92f7f1a']
26
+ });
27
+ /** Arrival circle radius in meters (non-negative). */
28
+ exports.ArrivalCircleSchema = typebox_1.Type.Number({
29
+ $id: 'ArrivalCircle',
30
+ minimum: 0,
31
+ description: 'Radius of arrival zone in meters',
32
+ examples: [500]
33
+ });
34
+ /** Type of course point. */
35
+ exports.CoursePointTypeSchema = typebox_1.Type.Union([
36
+ typebox_1.Type.Literal('VesselPosition'),
37
+ typebox_1.Type.Literal('RoutePoint'),
38
+ typebox_1.Type.Literal('Location')
39
+ ], {
40
+ $id: 'CoursePointType',
41
+ description: 'Type of course point'
42
+ });
43
+ /** Destination by waypoint href. */
44
+ exports.HrefDestinationSchema = typebox_1.Type.Object({
45
+ href: typebox_1.Type.String({
46
+ pattern: `^/resources/waypoints/${shared_schemas_1.SignalKUuidPattern}$`,
47
+ description: 'Reference to a related waypoint resource. A pointer to the resource UUID.',
48
+ examples: ['/resources/waypoints/ac3a3b2d-07e8-4f25-92bc-98e7c92f7f1a']
49
+ })
50
+ }, { $id: 'HrefDestination' });
51
+ /** Destination by position coordinates. */
52
+ exports.PositionDestinationSchema = typebox_1.Type.Object({
53
+ position: shared_schemas_1.PositionSchema
54
+ }, { $id: 'PositionDestination', description: 'Location coordinates.' });
55
+ /**
56
+ * PUT /course/destination request body.
57
+ * Either a waypoint href or a position, optionally with an arrival circle.
58
+ */
59
+ exports.SetDestinationBodySchema = typebox_1.Type.Intersect([
60
+ typebox_1.Type.Union([exports.HrefDestinationSchema, exports.PositionDestinationSchema]),
61
+ typebox_1.Type.Object({
62
+ arrivalCircle: typebox_1.Type.Optional(exports.ArrivalCircleSchema)
63
+ })
64
+ ], { $id: 'SetDestinationBody' });
65
+ /** PUT /course/activeRoute request body. */
66
+ exports.RouteDestinationSchema = typebox_1.Type.Object({
67
+ href: exports.SignalKHrefRouteSchema,
68
+ pointIndex: typebox_1.Type.Optional(typebox_1.Type.Number({
69
+ minimum: 0,
70
+ default: 0,
71
+ description: '0 based index of the point in the route to set as the destination'
72
+ })),
73
+ reverse: typebox_1.Type.Optional(typebox_1.Type.Boolean({
74
+ default: false,
75
+ description: 'Set to true to navigate the route points in reverse order.'
76
+ })),
77
+ arrivalCircle: typebox_1.Type.Optional(exports.ArrivalCircleSchema)
78
+ }, { $id: 'RouteDestination' });
79
+ /** PUT /course/arrivalCircle request body */
80
+ exports.ArrivalCircleBodySchema = typebox_1.Type.Object({
81
+ value: exports.ArrivalCircleSchema
82
+ }, { $id: 'ArrivalCircleBody' });
83
+ /** PUT /course/targetArrivalTime request body */
84
+ exports.TargetArrivalTimeBodySchema = typebox_1.Type.Object({
85
+ value: typebox_1.Type.Union([
86
+ typebox_1.Type.String({
87
+ pattern: shared_schemas_1.IsoTimePattern,
88
+ description: 'ISO 8601 date-time string'
89
+ }),
90
+ typebox_1.Type.Null()
91
+ ])
92
+ }, { $id: 'TargetArrivalTimeBody' });
93
+ /** PUT /course/activeRoute/nextPoint request body */
94
+ exports.NextPointBodySchema = typebox_1.Type.Object({
95
+ value: typebox_1.Type.Optional(typebox_1.Type.Number({
96
+ default: 1,
97
+ description: 'Index offset of point in route (-ve = previous)'
98
+ }))
99
+ }, { $id: 'NextPointBody' });
100
+ /** PUT /course/activeRoute/pointIndex request body */
101
+ exports.PointIndexBodySchema = typebox_1.Type.Object({
102
+ value: typebox_1.Type.Number({
103
+ minimum: 0,
104
+ description: 'Index of point in route to set as destination.',
105
+ examples: [2]
106
+ })
107
+ }, { $id: 'PointIndexBody' });
108
+ /** PUT /course/activeRoute/reverse request body */
109
+ exports.ReverseBodySchema = typebox_1.Type.Object({
110
+ pointIndex: typebox_1.Type.Optional(typebox_1.Type.Number({
111
+ minimum: 0,
112
+ description: 'Index of point in route to set as destination.',
113
+ examples: [2]
114
+ }))
115
+ }, { $id: 'ReverseBody' });
116
+ /** Active route state. */
117
+ exports.ActiveRouteSchema = typebox_1.Type.Object({
118
+ href: exports.SignalKHrefRouteSchema,
119
+ name: typebox_1.Type.String({
120
+ description: 'Name of route.',
121
+ examples: ['Here to eternity.']
122
+ }),
123
+ pointIndex: typebox_1.Type.Number({
124
+ minimum: 0,
125
+ description: '0 based index of the point in the route that is the current destination'
126
+ }),
127
+ pointTotal: typebox_1.Type.Number({
128
+ description: 'Total number of points in the route'
129
+ }),
130
+ reverse: typebox_1.Type.Boolean({
131
+ description: 'When true indicates the route points are being navigated in reverse order.'
132
+ })
133
+ }, { $id: 'ActiveRoute' });
134
+ /** Navigation point (next or previous). */
135
+ exports.NextPreviousPointSchema = typebox_1.Type.Object({
136
+ href: typebox_1.Type.Optional(typebox_1.Type.String({ description: 'Reference to a waypoint resource.' })),
137
+ type: typebox_1.Type.String({
138
+ description: "Type of point. Known values: VesselPosition (vessel's current location), RoutePoint (a point on the active route), Location (an arbitrary geographic position).",
139
+ examples: ['RoutePoint', 'Location', 'VesselPosition']
140
+ }),
141
+ position: shared_schemas_1.PositionSchema
142
+ }, { $id: 'NextPreviousPoint' });
143
+ /** Full course state response. */
144
+ exports.CourseInfoSchema = typebox_1.Type.Object({
145
+ startTime: typebox_1.Type.Union([typebox_1.Type.String({ pattern: shared_schemas_1.IsoTimePattern }), typebox_1.Type.Null()], {
146
+ description: 'ISO 8601 timestamp when the course was set, or null when no course is active'
147
+ }),
148
+ targetArrivalTime: typebox_1.Type.Union([typebox_1.Type.String({ pattern: shared_schemas_1.IsoTimePattern }), typebox_1.Type.Null()], {
149
+ description: 'ISO 8601 target arrival time, or null when not set'
150
+ }),
151
+ arrivalCircle: typebox_1.Type.Number({
152
+ minimum: 0,
153
+ description: 'Radius of arrival zone in meters',
154
+ units: 'm'
155
+ }),
156
+ activeRoute: typebox_1.Type.Union([exports.ActiveRouteSchema, typebox_1.Type.Null()], {
157
+ description: 'The active route, or null when navigating to a point'
158
+ }),
159
+ nextPoint: typebox_1.Type.Union([exports.NextPreviousPointSchema, typebox_1.Type.Null()], {
160
+ description: 'The next navigation point, or null when no course is set'
161
+ }),
162
+ previousPoint: typebox_1.Type.Union([exports.NextPreviousPointSchema, typebox_1.Type.Null()], {
163
+ description: 'The previous navigation point (departure point or last waypoint passed), or null when no course is set'
164
+ })
165
+ }, {
166
+ $id: 'CourseInfo',
167
+ description: 'Course state including active route and navigation points.'
168
+ });
169
+ /**
170
+ * Calculated course values derived from vessel position and destination.
171
+ */
172
+ exports.CourseCalculationsSchema = typebox_1.Type.Object({
173
+ calcMethod: typebox_1.Type.Union([typebox_1.Type.Literal('GreatCircle'), typebox_1.Type.Literal('Rhumbline')], {
174
+ description: 'Calculation method by which values are derived.',
175
+ default: 'GreatCircle',
176
+ examples: ['Rhumbline']
177
+ }),
178
+ crossTrackError: typebox_1.Type.Optional(typebox_1.Type.Number({
179
+ description: "The distance from the vessel's present position to the closest point on a line (track) between previousPoint and nextPoint. A negative number indicates that the vessel is currently to the left of this line (and thus must steer right to compensate), a positive number means the vessel is to the right of the line (steer left to compensate).",
180
+ units: 'm',
181
+ examples: [458.784]
182
+ })),
183
+ bearingTrackTrue: typebox_1.Type.Optional(typebox_1.Type.Number({
184
+ minimum: 0,
185
+ description: 'The bearing of a line between previousPoint and nextPoint, relative to true north',
186
+ units: 'rad',
187
+ examples: [4.58491]
188
+ })),
189
+ bearingTrackMagnetic: typebox_1.Type.Optional(typebox_1.Type.Number({
190
+ minimum: 0,
191
+ description: 'The bearing of a line between previousPoint and nextPoint, relative to magnetic north',
192
+ units: 'rad',
193
+ examples: [4.51234]
194
+ })),
195
+ estimatedTimeOfArrival: typebox_1.Type.Optional(typebox_1.Type.String({
196
+ pattern: shared_schemas_1.IsoTimePattern,
197
+ description: 'The estimated time of arrival at nextPoint position.'
198
+ })),
199
+ distance: typebox_1.Type.Optional(typebox_1.Type.Number({
200
+ minimum: 0,
201
+ description: "The distance between the vessel's present position and the nextPoint",
202
+ units: 'm',
203
+ examples: [10157]
204
+ })),
205
+ bearingTrue: typebox_1.Type.Optional(typebox_1.Type.Number({
206
+ minimum: 0,
207
+ description: "The bearing of a line between the vessel's current position and nextPoint, relative to true north",
208
+ units: 'rad',
209
+ examples: [4.58491]
210
+ })),
211
+ bearingMagnetic: typebox_1.Type.Optional(typebox_1.Type.Number({
212
+ minimum: 0,
213
+ description: "The bearing of a line between the vessel's current position and nextPoint, relative to magnetic north",
214
+ units: 'rad',
215
+ examples: [4.51234]
216
+ })),
217
+ velocityMadeGood: typebox_1.Type.Optional(typebox_1.Type.Number({
218
+ description: 'The velocity component of the vessel towards the nextPoint',
219
+ units: 'm/s',
220
+ examples: [7.2653]
221
+ })),
222
+ timeToGo: typebox_1.Type.Optional(typebox_1.Type.Number({
223
+ minimum: 0,
224
+ description: "Time to reach nextPoint's perpendicular with current speed and direction",
225
+ units: 's',
226
+ examples: [8491]
227
+ })),
228
+ targetSpeed: typebox_1.Type.Optional(typebox_1.Type.Number({
229
+ description: 'The average velocity required to reach the destination at the targetArrivalTime',
230
+ units: 'm/s',
231
+ examples: [2.2653]
232
+ })),
233
+ previousPoint: typebox_1.Type.Optional(typebox_1.Type.Object({
234
+ distance: typebox_1.Type.Optional(typebox_1.Type.Number({
235
+ minimum: 0,
236
+ description: "The distance between the vessel's present position and the start point",
237
+ units: 'm',
238
+ examples: [10157]
239
+ }))
240
+ })),
241
+ route: typebox_1.Type.Optional(typebox_1.Type.Object({
242
+ distance: typebox_1.Type.Optional(typebox_1.Type.Number({
243
+ minimum: 0,
244
+ description: 'The distance along the route to the last point',
245
+ units: 'm',
246
+ examples: [15936]
247
+ })),
248
+ timeToGo: typebox_1.Type.Optional(typebox_1.Type.Number({
249
+ minimum: 0,
250
+ description: 'Time to reach perpendicular of last point in route with current speed and direction',
251
+ units: 's',
252
+ examples: [10452]
253
+ })),
254
+ estimatedTimeOfArrival: typebox_1.Type.Optional(typebox_1.Type.String({
255
+ pattern: shared_schemas_1.IsoTimePattern,
256
+ description: 'The estimated time of arrival at last point in route.'
257
+ }))
258
+ }))
259
+ }, {
260
+ $id: 'CourseCalculations',
261
+ description: 'Calculated course data values.'
262
+ });
263
+ /**
264
+ * v2 course delta paths emitted on navigation.course.*
265
+ * Emitted via handleMessage() with SKVersion.v2
266
+ */
267
+ exports.CourseDeltaV2Schema = typebox_1.Type.Object({
268
+ startTime: typebox_1.Type.Union([
269
+ typebox_1.Type.String({ pattern: shared_schemas_1.IsoTimePattern }),
270
+ typebox_1.Type.Null()
271
+ ]),
272
+ targetArrivalTime: typebox_1.Type.Union([
273
+ typebox_1.Type.String({ pattern: shared_schemas_1.IsoTimePattern }),
274
+ typebox_1.Type.Null()
275
+ ]),
276
+ activeRoute: typebox_1.Type.Union([exports.ActiveRouteSchema, typebox_1.Type.Null()]),
277
+ arrivalCircle: typebox_1.Type.Number({
278
+ minimum: 0,
279
+ description: 'Radius of arrival zone in meters',
280
+ units: 'm'
281
+ }),
282
+ previousPoint: typebox_1.Type.Union([exports.NextPreviousPointSchema, typebox_1.Type.Null()]),
283
+ nextPoint: typebox_1.Type.Union([exports.NextPreviousPointSchema, typebox_1.Type.Null()])
284
+ }, {
285
+ $id: 'CourseDeltaV2',
286
+ description: 'Course delta values emitted under navigation.course.* (Signal K v2)'
287
+ });
288
+ /**
289
+ * v1 course delta paths emitted on courseGreatCircle.* / courseRhumbline.*
290
+ * Emitted via handleMessage() with SKVersion.v1
291
+ */
292
+ exports.CourseDeltaV1Schema = typebox_1.Type.Object({
293
+ 'activeRoute.href': typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()]),
294
+ 'activeRoute.startTime': typebox_1.Type.Union([
295
+ typebox_1.Type.String({ pattern: shared_schemas_1.IsoTimePattern }),
296
+ typebox_1.Type.Null()
297
+ ]),
298
+ 'nextPoint.value.href': typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()]),
299
+ 'nextPoint.value.type': typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()]),
300
+ 'nextPoint.position': typebox_1.Type.Union([shared_schemas_1.PositionSchema, typebox_1.Type.Null()]),
301
+ 'nextPoint.arrivalCircle': typebox_1.Type.Number({
302
+ minimum: 0,
303
+ description: 'Radius of arrival zone in meters',
304
+ units: 'm'
305
+ }),
306
+ 'previousPoint.position': typebox_1.Type.Union([shared_schemas_1.PositionSchema, typebox_1.Type.Null()]),
307
+ 'previousPoint.value.type': typebox_1.Type.Union([typebox_1.Type.String(), typebox_1.Type.Null()])
308
+ }, {
309
+ $id: 'CourseDeltaV1',
310
+ description: 'Course delta values emitted under navigation.courseGreatCircle.* and navigation.courseRhumbline.* (Signal K v1)'
311
+ });
312
+ /** API config response */
313
+ exports.CourseConfigSchema = typebox_1.Type.Object({
314
+ apiOnly: typebox_1.Type.Boolean({
315
+ description: 'When true, course data is only available via the API and not emitted as v1 deltas'
316
+ })
317
+ }, { $id: 'CourseConfig', description: 'Course API configuration' });
@@ -0,0 +1,53 @@
1
+ /**
2
+ * TypeBox Schema Definitions for the Signal K Discovery API
3
+ */
4
+ import { type Static } from '@sinclair/typebox';
5
+ /**
6
+ * v1 endpoint descriptor — protocol addresses for a specific API version.
7
+ */
8
+ export declare const V1EndpointSchema: import("@sinclair/typebox").TObject<{
9
+ version: import("@sinclair/typebox").TString;
10
+ 'signalk-http': import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
11
+ 'signalk-ws': import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
12
+ 'signalk-tcp': import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
13
+ }>;
14
+ /**
15
+ * Discovery response — server version and service endpoints.
16
+ */
17
+ export declare const DiscoveryDataSchema: import("@sinclair/typebox").TObject<{
18
+ endpoints: import("@sinclair/typebox").TObject<{
19
+ v1: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
20
+ version: import("@sinclair/typebox").TString;
21
+ 'signalk-http': import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
22
+ 'signalk-ws': import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
23
+ 'signalk-tcp': import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
24
+ }>>;
25
+ }>;
26
+ server: import("@sinclair/typebox").TObject<{
27
+ id: import("@sinclair/typebox").TString;
28
+ version: import("@sinclair/typebox").TString;
29
+ }>;
30
+ }>;
31
+ export type DiscoveryData = Static<typeof DiscoveryDataSchema>;
32
+ /**
33
+ * Plugin metadata for feature discovery.
34
+ */
35
+ export declare const PluginMetaDataSchema: import("@sinclair/typebox").TObject<{
36
+ id: import("@sinclair/typebox").TString;
37
+ name: import("@sinclair/typebox").TString;
38
+ version: import("@sinclair/typebox").TString;
39
+ }>;
40
+ export type PluginMetaData = Static<typeof PluginMetaDataSchema>;
41
+ /**
42
+ * Server features response — available APIs and installed plugins.
43
+ */
44
+ export declare const FeaturesModelSchema: import("@sinclair/typebox").TObject<{
45
+ apis: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
46
+ plugins: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
47
+ id: import("@sinclair/typebox").TString;
48
+ name: import("@sinclair/typebox").TString;
49
+ version: import("@sinclair/typebox").TString;
50
+ }>>;
51
+ }>;
52
+ export type FeaturesModel = Static<typeof FeaturesModelSchema>;
53
+ //# sourceMappingURL=discovery-schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discovery-schemas.d.ts","sourceRoot":"","sources":["../../src/typebox/discovery-schemas.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAErD;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;EA0B5B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;EAmB/B,CAAA;AACD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE9D;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;EAUhC,CAAA;AACD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEhE;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;EAa/B,CAAA;AACD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ /**
3
+ * TypeBox Schema Definitions for the Signal K Discovery API
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FeaturesModelSchema = exports.PluginMetaDataSchema = exports.DiscoveryDataSchema = exports.V1EndpointSchema = void 0;
7
+ const typebox_1 = require("@sinclair/typebox");
8
+ /**
9
+ * v1 endpoint descriptor — protocol addresses for a specific API version.
10
+ */
11
+ exports.V1EndpointSchema = typebox_1.Type.Object({
12
+ version: typebox_1.Type.String({
13
+ description: 'Version of the Signal K API',
14
+ examples: ['1.1.0']
15
+ }),
16
+ 'signalk-http': typebox_1.Type.Optional(typebox_1.Type.String({
17
+ description: "Address of the server's http API.",
18
+ examples: ['http://192.168.1.88:3000/signalk/v1/api/']
19
+ })),
20
+ 'signalk-ws': typebox_1.Type.Optional(typebox_1.Type.String({
21
+ description: "Address of the server's WebSocket API.",
22
+ examples: ['ws://192.168.1.88:3000/signalk/v1/stream']
23
+ })),
24
+ 'signalk-tcp': typebox_1.Type.Optional(typebox_1.Type.String({
25
+ description: "Address of the server's Signal K over TCP API.",
26
+ examples: ['tcp://192.168.1.88:8375']
27
+ }))
28
+ }, { $id: 'V1Endpoint' });
29
+ /**
30
+ * Discovery response — server version and service endpoints.
31
+ */
32
+ exports.DiscoveryDataSchema = typebox_1.Type.Object({
33
+ endpoints: typebox_1.Type.Object({
34
+ v1: typebox_1.Type.Optional(exports.V1EndpointSchema)
35
+ }),
36
+ server: typebox_1.Type.Object({
37
+ id: typebox_1.Type.String({
38
+ description: 'Id of the server implementation',
39
+ examples: ['signalk-server-node']
40
+ }),
41
+ version: typebox_1.Type.String({
42
+ description: 'Server software version'
43
+ })
44
+ })
45
+ }, {
46
+ $id: 'DiscoveryData',
47
+ description: 'Server version and service endpoint discovery data'
48
+ });
49
+ /**
50
+ * Plugin metadata for feature discovery.
51
+ */
52
+ exports.PluginMetaDataSchema = typebox_1.Type.Object({
53
+ id: typebox_1.Type.String({ description: 'Plugin ID.' }),
54
+ name: typebox_1.Type.String({ description: 'Plugin name.' }),
55
+ version: typebox_1.Type.String({ description: 'Plugin version.' })
56
+ }, {
57
+ $id: 'PluginMetaData',
58
+ description: 'Plugin metadata.'
59
+ });
60
+ /**
61
+ * Server features response — available APIs and installed plugins.
62
+ */
63
+ exports.FeaturesModelSchema = typebox_1.Type.Object({
64
+ apis: typebox_1.Type.Array(typebox_1.Type.String(), {
65
+ description: 'Implemented APIs.'
66
+ }),
67
+ plugins: typebox_1.Type.Array(exports.PluginMetaDataSchema, {
68
+ description: 'Installed Plugins.'
69
+ })
70
+ }, {
71
+ $id: 'FeaturesModel',
72
+ description: 'Features response'
73
+ });
@@ -0,0 +1,34 @@
1
+ /**
2
+ * TypeBox Schema Definitions for the Signal K History API
3
+ */
4
+ import { type Static } from '@sinclair/typebox';
5
+ export declare const AggregateMethodSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"average">, import("@sinclair/typebox").TLiteral<"min">, import("@sinclair/typebox").TLiteral<"max">, import("@sinclair/typebox").TLiteral<"first">, import("@sinclair/typebox").TLiteral<"last">, import("@sinclair/typebox").TLiteral<"mid">, import("@sinclair/typebox").TLiteral<"middle_index">, import("@sinclair/typebox").TLiteral<"sma">, import("@sinclair/typebox").TLiteral<"ema">]>;
6
+ export type AggregateMethodSchemaType = Static<typeof AggregateMethodSchema>;
7
+ export declare const ValuesResponseSchema: import("@sinclair/typebox").TObject<{
8
+ context: import("@sinclair/typebox").TString;
9
+ range: import("@sinclair/typebox").TObject<{
10
+ from: import("@sinclair/typebox").TString;
11
+ to: import("@sinclair/typebox").TString;
12
+ }>;
13
+ values: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
14
+ path: import("@sinclair/typebox").TString;
15
+ method: import("@sinclair/typebox").TString;
16
+ }>>;
17
+ data: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNumber, import("@sinclair/typebox").TNull, import("@sinclair/typebox").TArray<import("@sinclair/typebox").TNumber>]>>>;
18
+ }>;
19
+ export type ValuesResponseSchemaType = Static<typeof ValuesResponseSchema>;
20
+ export declare const PathSpecSchema: import("@sinclair/typebox").TObject<{
21
+ path: import("@sinclair/typebox").TString;
22
+ aggregate: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"average">, import("@sinclair/typebox").TLiteral<"min">, import("@sinclair/typebox").TLiteral<"max">, import("@sinclair/typebox").TLiteral<"first">, import("@sinclair/typebox").TLiteral<"last">, import("@sinclair/typebox").TLiteral<"mid">, import("@sinclair/typebox").TLiteral<"middle_index">, import("@sinclair/typebox").TLiteral<"sma">, import("@sinclair/typebox").TLiteral<"ema">]>;
23
+ parameter: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
24
+ }>;
25
+ export type PathSpecSchemaType = Static<typeof PathSpecSchema>;
26
+ export declare const HistoryProviderInfoSchema: import("@sinclair/typebox").TObject<{
27
+ isDefault: import("@sinclair/typebox").TBoolean;
28
+ }>;
29
+ export type HistoryProviderInfoSchemaType = Static<typeof HistoryProviderInfoSchema>;
30
+ export declare const HistoryProvidersResponseSchema: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TObject<{
31
+ isDefault: import("@sinclair/typebox").TBoolean;
32
+ }>>;
33
+ export type HistoryProvidersResponseSchemaType = Static<typeof HistoryProvidersResponseSchema>;
34
+ //# sourceMappingURL=history-schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history-schemas.d.ts","sourceRoot":"","sources":["../../src/typebox/history-schemas.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAErD,eAAO,MAAM,qBAAqB,2cAiBjC,CAAA;AACD,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAE5E,eAAO,MAAM,oBAAoB;;;;;;;;;;;EA8ChC,CAAA;AACD,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAE1E,eAAO,MAAM,cAAc;;;;EAc1B,CAAA;AACD,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAA;AAE9D,eAAO,MAAM,yBAAyB;;EAOrC,CAAA;AACD,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAChD,OAAO,yBAAyB,CACjC,CAAA;AAED,eAAO,MAAM,8BAA8B;;GAO1C,CAAA;AACD,MAAM,MAAM,kCAAkC,GAAG,MAAM,CACrD,OAAO,8BAA8B,CACtC,CAAA"}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ /**
3
+ * TypeBox Schema Definitions for the Signal K History API
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.HistoryProvidersResponseSchema = exports.HistoryProviderInfoSchema = exports.PathSpecSchema = exports.ValuesResponseSchema = exports.AggregateMethodSchema = void 0;
7
+ const typebox_1 = require("@sinclair/typebox");
8
+ exports.AggregateMethodSchema = typebox_1.Type.Union([
9
+ typebox_1.Type.Literal('average'),
10
+ typebox_1.Type.Literal('min'),
11
+ typebox_1.Type.Literal('max'),
12
+ typebox_1.Type.Literal('first'),
13
+ typebox_1.Type.Literal('last'),
14
+ typebox_1.Type.Literal('mid'),
15
+ typebox_1.Type.Literal('middle_index'),
16
+ typebox_1.Type.Literal('sma'),
17
+ typebox_1.Type.Literal('ema')
18
+ ], {
19
+ $id: 'AggregateMethod',
20
+ description: "Aggregation method for historical data. The 'sma' (Simple Moving Average) and 'ema' (Exponential Moving Average) methods accept an optional numeric parameter separated by colon: for sma it is the number of samples, for ema it is the alpha value (0-1)."
21
+ });
22
+ exports.ValuesResponseSchema = typebox_1.Type.Object({
23
+ context: typebox_1.Type.String({
24
+ description: 'Signal K context that the data is about',
25
+ examples: ['vessels.urn:mrn:imo:mmsi:123456789']
26
+ }),
27
+ range: typebox_1.Type.Object({
28
+ from: typebox_1.Type.String({
29
+ format: 'date-time',
30
+ description: 'Start of the time range, inclusive, as UTC timestamp',
31
+ examples: ['2018-03-20T09:12:28Z']
32
+ }),
33
+ to: typebox_1.Type.String({
34
+ format: 'date-time',
35
+ description: 'End of the time range, inclusive, as UTC timestamp',
36
+ examples: ['2018-03-20T09:13:28Z']
37
+ })
38
+ }),
39
+ values: typebox_1.Type.Array(typebox_1.Type.Object({
40
+ path: typebox_1.Type.String({ description: 'Signal K path' }),
41
+ method: typebox_1.Type.String({ description: 'Aggregation method' })
42
+ })),
43
+ data: typebox_1.Type.Array(typebox_1.Type.Array(typebox_1.Type.Union([
44
+ typebox_1.Type.String(),
45
+ typebox_1.Type.Number(),
46
+ typebox_1.Type.Null(),
47
+ typebox_1.Type.Array(typebox_1.Type.Number())
48
+ ]), {
49
+ description: 'Data for a point in time. The first array element is the timestamp in ISO 8601 format. Missing data for a path is returned as null'
50
+ }), {
51
+ examples: [[['2023-11-09T02:45:38.160Z', 13.2, null, [-120.5, 59.2]]]]
52
+ })
53
+ }, {
54
+ $id: 'HistoryValuesResponse',
55
+ description: 'Historical data series with header and data rows'
56
+ });
57
+ exports.PathSpecSchema = typebox_1.Type.Object({
58
+ path: typebox_1.Type.String({ description: 'Signal K path' }),
59
+ aggregate: exports.AggregateMethodSchema,
60
+ parameter: typebox_1.Type.Array(typebox_1.Type.String(), {
61
+ description: 'Additional parameters for the aggregation method (e.g., sample count for sma, alpha for ema)'
62
+ })
63
+ }, {
64
+ $id: 'PathSpec',
65
+ description: 'Specification for a path to query, including the aggregation method and optional parameters'
66
+ });
67
+ exports.HistoryProviderInfoSchema = typebox_1.Type.Object({
68
+ isDefault: typebox_1.Type.Boolean({
69
+ description: '`true` if this provider is set as the default.'
70
+ })
71
+ }, { $id: 'HistoryProviderInfo' });
72
+ exports.HistoryProvidersResponseSchema = typebox_1.Type.Record(typebox_1.Type.String({ description: 'Plugin id of the history provider' }), exports.HistoryProviderInfoSchema, {
73
+ $id: 'HistoryProvidersResponse',
74
+ description: 'Map of registered history providers keyed by plugin id'
75
+ });
@@ -0,0 +1,11 @@
1
+ export * from './shared-schemas';
2
+ export * from './protocol-schemas';
3
+ export * from './autopilot-schemas';
4
+ export * from './course-schemas';
5
+ export * from './discovery-schemas';
6
+ export * from './history-schemas';
7
+ export * from './notifications-schemas';
8
+ export * from './radar-schemas';
9
+ export * from './resources-schemas';
10
+ export * from './weather-schemas';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/typebox/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,yBAAyB,CAAA;AACvC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./shared-schemas"), exports);
18
+ __exportStar(require("./protocol-schemas"), exports);
19
+ __exportStar(require("./autopilot-schemas"), exports);
20
+ __exportStar(require("./course-schemas"), exports);
21
+ __exportStar(require("./discovery-schemas"), exports);
22
+ __exportStar(require("./history-schemas"), exports);
23
+ __exportStar(require("./notifications-schemas"), exports);
24
+ __exportStar(require("./radar-schemas"), exports);
25
+ __exportStar(require("./resources-schemas"), exports);
26
+ __exportStar(require("./weather-schemas"), exports);