@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,215 @@
1
+ "use strict";
2
+ /**
3
+ * TypeBox Schema Definitions for the Signal K Weather API
4
+ *
5
+ * Units follow SI conventions: K (temperature), Pa (pressure), m/s (speed),
6
+ * rad (direction), m (distance/visibility), ratio (humidity/cloud).
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.WeatherWarningModelSchema = exports.WeatherDataModelSchema = exports.PrecipitationTypeSchema = exports.PressureTendencySchema = exports.WeatherDataTypeSchema = void 0;
10
+ const typebox_1 = require("@sinclair/typebox");
11
+ const shared_schemas_1 = require("./shared-schemas");
12
+ /** Weather data type */
13
+ exports.WeatherDataTypeSchema = typebox_1.Type.Union([typebox_1.Type.Literal('daily'), typebox_1.Type.Literal('point'), typebox_1.Type.Literal('observation')], { $id: 'WeatherDataType' });
14
+ /** Pressure tendency */
15
+ exports.PressureTendencySchema = typebox_1.Type.Union([
16
+ typebox_1.Type.Literal('steady'),
17
+ typebox_1.Type.Literal('decreasing'),
18
+ typebox_1.Type.Literal('increasing')
19
+ ], { $id: 'PressureTendency' });
20
+ /** Precipitation type */
21
+ exports.PrecipitationTypeSchema = typebox_1.Type.Union([
22
+ typebox_1.Type.Literal('rain'),
23
+ typebox_1.Type.Literal('thunderstorm'),
24
+ typebox_1.Type.Literal('snow'),
25
+ typebox_1.Type.Literal('freezing rain'),
26
+ typebox_1.Type.Literal('mixed/ice')
27
+ ], { $id: 'PrecipitationType' });
28
+ /**
29
+ * Weather data model — observation, daily forecast, or point forecast.
30
+ */
31
+ exports.WeatherDataModelSchema = typebox_1.Type.Object({
32
+ date: shared_schemas_1.IsoTimeSchema,
33
+ description: typebox_1.Type.Optional(typebox_1.Type.String({
34
+ description: 'Weather description',
35
+ examples: ['broken clouds']
36
+ })),
37
+ type: exports.WeatherDataTypeSchema,
38
+ sun: typebox_1.Type.Optional(typebox_1.Type.Object({
39
+ sunrise: typebox_1.Type.Optional(shared_schemas_1.IsoTimeSchema),
40
+ sunset: typebox_1.Type.Optional(shared_schemas_1.IsoTimeSchema)
41
+ })),
42
+ outside: typebox_1.Type.Optional(typebox_1.Type.Object({
43
+ uvIndex: typebox_1.Type.Optional(typebox_1.Type.Number({
44
+ description: 'UV Index (1 UVI = 25mW/sqm)',
45
+ examples: [7.5]
46
+ })),
47
+ cloudCover: typebox_1.Type.Optional(typebox_1.Type.Number({
48
+ description: 'Amount of cloud cover (ratio)',
49
+ examples: [0.85]
50
+ })),
51
+ horizontalVisibility: typebox_1.Type.Optional(typebox_1.Type.Number({
52
+ description: 'Visibility (m)',
53
+ units: 'm',
54
+ examples: [5000]
55
+ })),
56
+ horizontalVisibilityOverRange: typebox_1.Type.Optional(typebox_1.Type.Boolean({
57
+ description: 'Visibility distance is greater than the range of the measuring equipment'
58
+ })),
59
+ temperature: typebox_1.Type.Optional(typebox_1.Type.Number({
60
+ description: 'Air temperature (K)',
61
+ units: 'K',
62
+ examples: [290]
63
+ })),
64
+ feelsLikeTemperature: typebox_1.Type.Optional(typebox_1.Type.Number({
65
+ description: 'Feels-like temperature (K)',
66
+ units: 'K',
67
+ examples: [277]
68
+ })),
69
+ dewPointTemperature: typebox_1.Type.Optional(typebox_1.Type.Number({
70
+ description: 'Dew point temperature (K)',
71
+ units: 'K',
72
+ examples: [260]
73
+ })),
74
+ pressure: typebox_1.Type.Optional(typebox_1.Type.Number({
75
+ description: 'Air pressure (Pa)',
76
+ units: 'Pa',
77
+ examples: [10100]
78
+ })),
79
+ pressureTendency: typebox_1.Type.Optional(exports.PressureTendencySchema),
80
+ absoluteHumidity: typebox_1.Type.Optional(typebox_1.Type.Number({
81
+ description: 'Absolute humidity (ratio)',
82
+ examples: [0.56]
83
+ })),
84
+ relativeHumidity: typebox_1.Type.Optional(typebox_1.Type.Number({
85
+ description: 'Relative humidity (ratio)',
86
+ examples: [0.56]
87
+ })),
88
+ precipitationType: typebox_1.Type.Optional(exports.PrecipitationTypeSchema),
89
+ precipitationVolume: typebox_1.Type.Optional(typebox_1.Type.Number({
90
+ description: 'Amount of precipitation (m)',
91
+ units: 'm',
92
+ examples: [0.56]
93
+ }))
94
+ })),
95
+ wind: typebox_1.Type.Optional(typebox_1.Type.Object({
96
+ averageSpeed: typebox_1.Type.Optional(typebox_1.Type.Number({
97
+ description: 'Average wind speed (m/s)',
98
+ units: 'm/s',
99
+ examples: [9.3]
100
+ })),
101
+ speedTrue: typebox_1.Type.Optional(typebox_1.Type.Number({
102
+ description: 'Wind speed (m/s)',
103
+ units: 'm/s',
104
+ examples: [15.3]
105
+ })),
106
+ directionTrue: typebox_1.Type.Optional(typebox_1.Type.Number({
107
+ description: 'Wind direction relative to true north (rad)',
108
+ units: 'rad',
109
+ examples: [2.145]
110
+ })),
111
+ gust: typebox_1.Type.Optional(typebox_1.Type.Number({
112
+ description: 'Wind gust (m/s)',
113
+ units: 'm/s',
114
+ examples: [21.6]
115
+ })),
116
+ gustDirectionTrue: typebox_1.Type.Optional(typebox_1.Type.Number({
117
+ description: 'Wind gust direction relative to true north (rad)',
118
+ units: 'rad',
119
+ examples: [2.6]
120
+ }))
121
+ })),
122
+ water: typebox_1.Type.Optional(typebox_1.Type.Object({
123
+ temperature: typebox_1.Type.Optional(typebox_1.Type.Number({
124
+ description: 'Water temperature (K)',
125
+ units: 'K',
126
+ examples: [281.6]
127
+ })),
128
+ level: typebox_1.Type.Optional(typebox_1.Type.Number({
129
+ description: 'Water level (m)',
130
+ units: 'm',
131
+ examples: [11.9]
132
+ })),
133
+ levelTendency: typebox_1.Type.Optional(typebox_1.Type.Union([
134
+ typebox_1.Type.Literal('steady'),
135
+ typebox_1.Type.Literal('decreasing'),
136
+ typebox_1.Type.Literal('increasing')
137
+ ])),
138
+ waves: typebox_1.Type.Optional(typebox_1.Type.Object({
139
+ significantHeight: typebox_1.Type.Optional(typebox_1.Type.Number({
140
+ description: 'Wave height (m)',
141
+ units: 'm',
142
+ examples: [2.6]
143
+ })),
144
+ directionTrue: typebox_1.Type.Optional(typebox_1.Type.Number({
145
+ description: 'Wave direction relative to true north (rad)',
146
+ units: 'rad',
147
+ examples: [2.3876]
148
+ })),
149
+ period: typebox_1.Type.Optional(typebox_1.Type.Number({
150
+ description: 'Wave period (s)',
151
+ units: 's',
152
+ examples: [2.3876]
153
+ }))
154
+ })),
155
+ swell: typebox_1.Type.Optional(typebox_1.Type.Object({
156
+ height: typebox_1.Type.Optional(typebox_1.Type.Number({
157
+ description: 'Swell height (m)',
158
+ units: 'm',
159
+ examples: [2.6]
160
+ })),
161
+ directionTrue: typebox_1.Type.Optional(typebox_1.Type.Number({
162
+ description: 'Swell direction relative to true north (rad)',
163
+ units: 'rad',
164
+ examples: [2.3876]
165
+ })),
166
+ period: typebox_1.Type.Optional(typebox_1.Type.Number({
167
+ description: 'Swell period (s)',
168
+ units: 's',
169
+ examples: [2.3876]
170
+ }))
171
+ })),
172
+ seaState: typebox_1.Type.Optional(typebox_1.Type.Number({ description: 'Sea state (Beaufort)', examples: [2] })),
173
+ salinity: typebox_1.Type.Optional(typebox_1.Type.Number({
174
+ description: 'Water salinity (ratio)',
175
+ examples: [0.12]
176
+ })),
177
+ ice: typebox_1.Type.Optional(typebox_1.Type.Boolean({ description: 'Whether ice is present' }))
178
+ })),
179
+ current: typebox_1.Type.Optional(typebox_1.Type.Object({
180
+ drift: typebox_1.Type.Optional(typebox_1.Type.Number({
181
+ description: 'Surface current speed (m/s)',
182
+ units: 'm/s',
183
+ examples: [3.4]
184
+ })),
185
+ set: typebox_1.Type.Optional(typebox_1.Type.Number({
186
+ description: 'Surface current direction (rad)',
187
+ units: 'rad',
188
+ examples: [1.74]
189
+ }))
190
+ }))
191
+ }, {
192
+ $id: 'WeatherDataModel',
193
+ description: 'Weather data — observation, daily forecast, or point forecast'
194
+ });
195
+ /**
196
+ * Weather warning — time-bound severe weather advisory.
197
+ */
198
+ exports.WeatherWarningModelSchema = typebox_1.Type.Object({
199
+ startTime: shared_schemas_1.IsoTimeSchema,
200
+ endTime: shared_schemas_1.IsoTimeSchema,
201
+ source: typebox_1.Type.Optional(typebox_1.Type.String({ description: 'Name of source.' })),
202
+ type: typebox_1.Type.Optional(typebox_1.Type.String({
203
+ description: 'Type of warning.',
204
+ examples: ['Heat Advisory']
205
+ })),
206
+ details: typebox_1.Type.Optional(typebox_1.Type.String({
207
+ description: 'Text describing the details of the warning.',
208
+ examples: [
209
+ 'HEAT ADVISORY REMAINS IN EFFECT FROM 1 PM THIS AFTERNOON....'
210
+ ]
211
+ }))
212
+ }, {
213
+ $id: 'WeatherWarningModel',
214
+ description: 'Weather warning — time-bound severe weather advisory'
215
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalk/server-api",
3
- "version": "2.23.0",
3
+ "version": "2.24.0",
4
4
  "description": "signalk-server Typescript API for plugins etc with relevant implementation classes",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,25 +16,31 @@
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "https://github.com/SignalK/signalk-server.git"
19
+ "url": "https://github.com/SignalK/signalk-server.git",
20
+ "directory": "packages/server-api"
20
21
  },
21
22
  "author": "teppo.kurki@iki.fi",
22
23
  "license": "Apache-2.0",
23
24
  "dependencies": {
24
25
  "@js-temporal/polyfill": "^0.5.1",
25
- "baconjs": "^1.0.1"
26
+ "@sinclair/typebox": "^0.34.0",
27
+ "baconjs": "^3.0.0"
26
28
  },
27
29
  "devDependencies": {
28
30
  "ts-auto-guard": "^5.0.1"
29
31
  },
30
32
  "exports": {
31
33
  ".": "./dist/index.js",
32
- "./history": "./dist/history.js"
34
+ "./history": "./dist/history.js",
35
+ "./typebox": "./dist/typebox/index.js"
33
36
  },
34
37
  "typesVersions": {
35
38
  "*": {
36
39
  "history": [
37
40
  "dist/history.d.ts"
41
+ ],
42
+ "typebox": [
43
+ "dist/typebox/index.d.ts"
38
44
  ]
39
45
  }
40
46
  }