@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,218 @@
1
+ /**
2
+ * TypeBox Schema Definitions for the Signal K Course API
3
+ */
4
+ import { type Static } from '@sinclair/typebox';
5
+ import { PositionSchema, IsoTimeSchema, OkResponseSchema, ErrorResponseSchema } from './shared-schemas';
6
+ export { IsoTimeSchema, PositionSchema, OkResponseSchema, ErrorResponseSchema };
7
+ export type { IsoTimeType } from './shared-schemas';
8
+ /** Signal K route resource href (UUID v4 format). */
9
+ export declare const SignalKHrefRouteSchema: import("@sinclair/typebox").TString;
10
+ /** Signal K waypoint resource href (UUID v4 format). */
11
+ export declare const SignalKHrefWaypointSchema: import("@sinclair/typebox").TString;
12
+ /** Arrival circle radius in meters (non-negative). */
13
+ export declare const ArrivalCircleSchema: import("@sinclair/typebox").TNumber;
14
+ export type ArrivalCircleType = Static<typeof ArrivalCircleSchema>;
15
+ export type PositionType = Static<typeof PositionSchema>;
16
+ /** Type of course point. */
17
+ export declare const CoursePointTypeSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"VesselPosition">, import("@sinclair/typebox").TLiteral<"RoutePoint">, import("@sinclair/typebox").TLiteral<"Location">]>;
18
+ /** Destination by waypoint href. */
19
+ export declare const HrefDestinationSchema: import("@sinclair/typebox").TObject<{
20
+ href: import("@sinclair/typebox").TString;
21
+ }>;
22
+ export type HrefDestinationType = Static<typeof HrefDestinationSchema>;
23
+ /** Destination by position coordinates. */
24
+ export declare const PositionDestinationSchema: import("@sinclair/typebox").TObject<{
25
+ position: import("@sinclair/typebox").TObject<{
26
+ latitude: import("@sinclair/typebox").TNumber;
27
+ longitude: import("@sinclair/typebox").TNumber;
28
+ altitude: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
29
+ }>;
30
+ }>;
31
+ export type PositionDestinationType = Static<typeof PositionDestinationSchema>;
32
+ /**
33
+ * PUT /course/destination request body.
34
+ * Either a waypoint href or a position, optionally with an arrival circle.
35
+ */
36
+ export declare const SetDestinationBodySchema: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
37
+ href: import("@sinclair/typebox").TString;
38
+ }>, import("@sinclair/typebox").TObject<{
39
+ position: import("@sinclair/typebox").TObject<{
40
+ latitude: import("@sinclair/typebox").TNumber;
41
+ longitude: import("@sinclair/typebox").TNumber;
42
+ altitude: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
43
+ }>;
44
+ }>]>, import("@sinclair/typebox").TObject<{
45
+ arrivalCircle: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
46
+ }>]>;
47
+ export type SetDestinationBodyType = Static<typeof SetDestinationBodySchema>;
48
+ /** PUT /course/activeRoute request body. */
49
+ export declare const RouteDestinationSchema: import("@sinclair/typebox").TObject<{
50
+ href: import("@sinclair/typebox").TString;
51
+ pointIndex: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
52
+ reverse: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
53
+ arrivalCircle: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
54
+ }>;
55
+ export type RouteDestinationType = Static<typeof RouteDestinationSchema>;
56
+ /** PUT /course/arrivalCircle request body */
57
+ export declare const ArrivalCircleBodySchema: import("@sinclair/typebox").TObject<{
58
+ value: import("@sinclair/typebox").TNumber;
59
+ }>;
60
+ export type ArrivalCircleBodyType = Static<typeof ArrivalCircleBodySchema>;
61
+ /** PUT /course/targetArrivalTime request body */
62
+ export declare const TargetArrivalTimeBodySchema: import("@sinclair/typebox").TObject<{
63
+ value: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
64
+ }>;
65
+ export type TargetArrivalTimeBodyType = Static<typeof TargetArrivalTimeBodySchema>;
66
+ /** PUT /course/activeRoute/nextPoint request body */
67
+ export declare const NextPointBodySchema: import("@sinclair/typebox").TObject<{
68
+ value: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
69
+ }>;
70
+ export type NextPointBodyType = Static<typeof NextPointBodySchema>;
71
+ /** PUT /course/activeRoute/pointIndex request body */
72
+ export declare const PointIndexBodySchema: import("@sinclair/typebox").TObject<{
73
+ value: import("@sinclair/typebox").TNumber;
74
+ }>;
75
+ export type PointIndexBodyType = Static<typeof PointIndexBodySchema>;
76
+ /** PUT /course/activeRoute/reverse request body */
77
+ export declare const ReverseBodySchema: import("@sinclair/typebox").TObject<{
78
+ pointIndex: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
79
+ }>;
80
+ export type ReverseBodyType = Static<typeof ReverseBodySchema>;
81
+ /** Active route state. */
82
+ export declare const ActiveRouteSchema: import("@sinclair/typebox").TObject<{
83
+ href: import("@sinclair/typebox").TString;
84
+ name: import("@sinclair/typebox").TString;
85
+ pointIndex: import("@sinclair/typebox").TNumber;
86
+ pointTotal: import("@sinclair/typebox").TNumber;
87
+ reverse: import("@sinclair/typebox").TBoolean;
88
+ }>;
89
+ export type ActiveRouteType = Static<typeof ActiveRouteSchema>;
90
+ /** Navigation point (next or previous). */
91
+ export declare const NextPreviousPointSchema: import("@sinclair/typebox").TObject<{
92
+ href: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
93
+ type: import("@sinclair/typebox").TString;
94
+ position: import("@sinclair/typebox").TObject<{
95
+ latitude: import("@sinclair/typebox").TNumber;
96
+ longitude: import("@sinclair/typebox").TNumber;
97
+ altitude: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
98
+ }>;
99
+ }>;
100
+ export type NextPreviousPointType = Static<typeof NextPreviousPointSchema>;
101
+ /** Full course state response. */
102
+ export declare const CourseInfoSchema: import("@sinclair/typebox").TObject<{
103
+ startTime: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
104
+ targetArrivalTime: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
105
+ arrivalCircle: import("@sinclair/typebox").TNumber;
106
+ activeRoute: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
107
+ href: import("@sinclair/typebox").TString;
108
+ name: import("@sinclair/typebox").TString;
109
+ pointIndex: import("@sinclair/typebox").TNumber;
110
+ pointTotal: import("@sinclair/typebox").TNumber;
111
+ reverse: import("@sinclair/typebox").TBoolean;
112
+ }>, import("@sinclair/typebox").TNull]>;
113
+ nextPoint: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
114
+ href: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
115
+ type: import("@sinclair/typebox").TString;
116
+ position: import("@sinclair/typebox").TObject<{
117
+ latitude: import("@sinclair/typebox").TNumber;
118
+ longitude: import("@sinclair/typebox").TNumber;
119
+ altitude: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
120
+ }>;
121
+ }>, import("@sinclair/typebox").TNull]>;
122
+ previousPoint: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
123
+ href: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
124
+ type: import("@sinclair/typebox").TString;
125
+ position: import("@sinclair/typebox").TObject<{
126
+ latitude: import("@sinclair/typebox").TNumber;
127
+ longitude: import("@sinclair/typebox").TNumber;
128
+ altitude: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
129
+ }>;
130
+ }>, import("@sinclair/typebox").TNull]>;
131
+ }>;
132
+ export type CourseInfoType = Static<typeof CourseInfoSchema>;
133
+ /**
134
+ * Calculated course values derived from vessel position and destination.
135
+ */
136
+ export declare const CourseCalculationsSchema: import("@sinclair/typebox").TObject<{
137
+ calcMethod: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"GreatCircle">, import("@sinclair/typebox").TLiteral<"Rhumbline">]>;
138
+ crossTrackError: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
139
+ bearingTrackTrue: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
140
+ bearingTrackMagnetic: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
141
+ estimatedTimeOfArrival: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
142
+ distance: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
143
+ bearingTrue: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
144
+ bearingMagnetic: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
145
+ velocityMadeGood: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
146
+ timeToGo: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
147
+ targetSpeed: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
148
+ previousPoint: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
149
+ distance: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
150
+ }>>;
151
+ route: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
152
+ distance: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
153
+ timeToGo: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
154
+ estimatedTimeOfArrival: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
155
+ }>>;
156
+ }>;
157
+ export type CourseCalculationsType = Static<typeof CourseCalculationsSchema>;
158
+ /**
159
+ * v2 course delta paths emitted on navigation.course.*
160
+ * Emitted via handleMessage() with SKVersion.v2
161
+ */
162
+ export declare const CourseDeltaV2Schema: import("@sinclair/typebox").TObject<{
163
+ startTime: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
164
+ targetArrivalTime: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
165
+ activeRoute: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
166
+ href: import("@sinclair/typebox").TString;
167
+ name: import("@sinclair/typebox").TString;
168
+ pointIndex: import("@sinclair/typebox").TNumber;
169
+ pointTotal: import("@sinclair/typebox").TNumber;
170
+ reverse: import("@sinclair/typebox").TBoolean;
171
+ }>, import("@sinclair/typebox").TNull]>;
172
+ arrivalCircle: import("@sinclair/typebox").TNumber;
173
+ previousPoint: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
174
+ href: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
175
+ type: import("@sinclair/typebox").TString;
176
+ position: import("@sinclair/typebox").TObject<{
177
+ latitude: import("@sinclair/typebox").TNumber;
178
+ longitude: import("@sinclair/typebox").TNumber;
179
+ altitude: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
180
+ }>;
181
+ }>, import("@sinclair/typebox").TNull]>;
182
+ nextPoint: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
183
+ href: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
184
+ type: import("@sinclair/typebox").TString;
185
+ position: import("@sinclair/typebox").TObject<{
186
+ latitude: import("@sinclair/typebox").TNumber;
187
+ longitude: import("@sinclair/typebox").TNumber;
188
+ altitude: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
189
+ }>;
190
+ }>, import("@sinclair/typebox").TNull]>;
191
+ }>;
192
+ /**
193
+ * v1 course delta paths emitted on courseGreatCircle.* / courseRhumbline.*
194
+ * Emitted via handleMessage() with SKVersion.v1
195
+ */
196
+ export declare const CourseDeltaV1Schema: import("@sinclair/typebox").TObject<{
197
+ 'activeRoute.href': import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
198
+ 'activeRoute.startTime': import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
199
+ 'nextPoint.value.href': import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
200
+ 'nextPoint.value.type': import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
201
+ 'nextPoint.position': import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
202
+ latitude: import("@sinclair/typebox").TNumber;
203
+ longitude: import("@sinclair/typebox").TNumber;
204
+ altitude: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
205
+ }>, import("@sinclair/typebox").TNull]>;
206
+ 'nextPoint.arrivalCircle': import("@sinclair/typebox").TNumber;
207
+ 'previousPoint.position': import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
208
+ latitude: import("@sinclair/typebox").TNumber;
209
+ longitude: import("@sinclair/typebox").TNumber;
210
+ altitude: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
211
+ }>, import("@sinclair/typebox").TNull]>;
212
+ 'previousPoint.value.type': import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TNull]>;
213
+ }>;
214
+ /** API config response */
215
+ export declare const CourseConfigSchema: import("@sinclair/typebox").TObject<{
216
+ apiOnly: import("@sinclair/typebox").TBoolean;
217
+ }>;
218
+ //# sourceMappingURL=course-schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"course-schemas.d.ts","sourceRoot":"","sources":["../../src/typebox/course-schemas.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,E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AAmB;;;;;;;;;;;;;;;;;EAuB/B,CAAA;AAED,0BAA0B;AAC1B,eAAO,MAAM,kBAAkB;;EAQ9B,CAAA"}
@@ -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"}