@azohra/meteo.station 0.6.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/README.md +17 -17
  2. package/dist/air.d.ts +4 -7
  3. package/dist/air.js +1 -2
  4. package/dist/client/climatology.d.ts +4 -7
  5. package/dist/client/climatology.js +1 -2
  6. package/dist/client/history.d.ts +14 -17
  7. package/dist/client/history.js +1 -2
  8. package/dist/client/live.d.ts +9 -11
  9. package/dist/client/live.js +1 -2
  10. package/dist/client/poll.d.ts +9 -12
  11. package/dist/client/poll.js +1 -2
  12. package/dist/client/stores.d.ts +8 -10
  13. package/dist/client/stores.js +1 -2
  14. package/dist/client/ticker.d.ts +1 -4
  15. package/dist/client/ticker.js +1 -2
  16. package/dist/climatology.d.ts +13 -15
  17. package/dist/climatology.js +1 -2
  18. package/dist/connectivity.d.ts +9 -12
  19. package/dist/connectivity.js +1 -2
  20. package/dist/contract-climatology.d.ts +11 -14
  21. package/dist/contract-climatology.js +1 -2
  22. package/dist/contract.d.ts +148 -151
  23. package/dist/contract.js +1 -2
  24. package/dist/derive.d.ts +24 -26
  25. package/dist/derive.js +5 -6
  26. package/dist/display.d.ts +6 -9
  27. package/dist/display.js +1 -2
  28. package/dist/elements/elements/AirExtremesElement.d.ts +2 -5
  29. package/dist/elements/elements/AirExtremesElement.js +6 -20
  30. package/dist/elements/elements/AirMatrixElement.d.ts +2 -5
  31. package/dist/elements/elements/AirMatrixElement.js +7 -33
  32. package/dist/elements/elements/ClimatologyDailyPatternElement.d.ts +2 -5
  33. package/dist/elements/elements/ClimatologyDailyPatternElement.js +18 -14
  34. package/dist/elements/elements/ClimatologyRoseElement.d.ts +2 -5
  35. package/dist/elements/elements/ClimatologyRoseElement.js +6 -17
  36. package/dist/elements/elements/CompassFanElement.d.ts +2 -5
  37. package/dist/elements/elements/CompassFanElement.js +6 -66
  38. package/dist/elements/elements/CurrentConditionsElement.d.ts +2 -5
  39. package/dist/elements/elements/CurrentConditionsElement.js +8 -28
  40. package/dist/elements/elements/DailyPatternElement.d.ts +2 -6
  41. package/dist/elements/elements/DailyPatternElement.js +7 -122
  42. package/dist/elements/elements/DialElement.d.ts +2 -5
  43. package/dist/elements/elements/DialElement.js +4 -97
  44. package/dist/elements/elements/FavorableShareElement.d.ts +2 -5
  45. package/dist/elements/elements/FavorableShareElement.js +7 -23
  46. package/dist/elements/elements/FreshnessBadgeElement.d.ts +2 -5
  47. package/dist/elements/elements/FreshnessBadgeElement.js +1 -2
  48. package/dist/elements/elements/RecentSummariesElement.d.ts +2 -5
  49. package/dist/elements/elements/RecentSummariesElement.js +7 -25
  50. package/dist/elements/elements/SparklineElement.d.ts +2 -6
  51. package/dist/elements/elements/SparklineElement.js +5 -41
  52. package/dist/elements/elements/StationCardElement.d.ts +6 -8
  53. package/dist/elements/elements/StationCardElement.js +5 -20
  54. package/dist/elements/elements/StationFeedElement.d.ts +2 -5
  55. package/dist/elements/elements/StationFeedElement.js +5 -4
  56. package/dist/elements/elements/StationStripElement.d.ts +2 -5
  57. package/dist/elements/elements/StationStripElement.js +5 -20
  58. package/dist/elements/elements/StationTableElement.d.ts +3 -6
  59. package/dist/elements/elements/StationTableElement.js +16 -53
  60. package/dist/elements/elements/TrendChartElement.d.ts +2 -5
  61. package/dist/elements/elements/TrendChartElement.js +22 -71
  62. package/dist/elements/elements/WindArrowElement.d.ts +2 -5
  63. package/dist/elements/elements/WindArrowElement.js +1 -2
  64. package/dist/elements/elements/WindHistoryChartElement.d.ts +2 -5
  65. package/dist/elements/elements/WindHistoryChartElement.js +24 -166
  66. package/dist/elements/elements/WindRoseElement.d.ts +2 -6
  67. package/dist/elements/elements/WindRoseElement.js +7 -72
  68. package/dist/elements/elements/atoms.d.ts +10 -12
  69. package/dist/elements/elements/atoms.js +12 -40
  70. package/dist/elements/index.d.ts +3 -5
  71. package/dist/elements/index.js +4 -5
  72. package/dist/elements/lib/ambient.d.ts +2 -5
  73. package/dist/elements/lib/ambient.js +1 -2
  74. package/dist/elements/lib/attributes.js +1 -2
  75. package/dist/elements/lib/base.d.ts +3 -6
  76. package/dist/elements/lib/base.js +1 -2
  77. package/dist/elements/lib/context.js +1 -2
  78. package/dist/elements/lib/fragments.js +9 -39
  79. package/dist/elements/lib/h.js +2 -3
  80. package/dist/elements/lib/pinned-cursor.js +1 -2
  81. package/dist/elements/lib/render.js +29 -0
  82. package/dist/elements/register.js +1 -2
  83. package/dist/endpoints.d.ts +6 -9
  84. package/dist/endpoints.js +1 -2
  85. package/dist/fixtures.d.ts +7 -10
  86. package/dist/fixtures.js +1 -2
  87. package/dist/format.d.ts +11 -14
  88. package/dist/format.js +1 -2
  89. package/dist/geometry.d.ts +36 -38
  90. package/dist/geometry.js +3 -3
  91. package/dist/instruments.d.ts +37 -40
  92. package/dist/instruments.js +3 -4
  93. package/dist/merge-current.d.ts +4 -7
  94. package/dist/merge-current.js +1 -2
  95. package/dist/react/components/AirExtremes.d.ts +2 -5
  96. package/dist/react/components/AirExtremes.js +6 -24
  97. package/dist/react/components/AirMatrix.d.ts +2 -5
  98. package/dist/react/components/AirMatrix.js +11 -45
  99. package/dist/react/components/ClimatologyDailyPattern.d.ts +2 -5
  100. package/dist/react/components/ClimatologyDailyPattern.js +20 -15
  101. package/dist/react/components/ClimatologyRose.d.ts +2 -5
  102. package/dist/react/components/ClimatologyRose.js +12 -30
  103. package/dist/react/components/CompassFan.d.ts +2 -5
  104. package/dist/react/components/CompassFan.js +7 -75
  105. package/dist/react/components/CurrentConditions.d.ts +2 -5
  106. package/dist/react/components/CurrentConditions.js +12 -76
  107. package/dist/react/components/DailyPattern.d.ts +3 -8
  108. package/dist/react/components/DailyPattern.js +11 -151
  109. package/dist/react/components/Dial.d.ts +2 -5
  110. package/dist/react/components/Dial.js +6 -120
  111. package/dist/react/components/FavorableShare.d.ts +2 -5
  112. package/dist/react/components/FavorableShare.js +7 -29
  113. package/dist/react/components/FreshnessBadge.d.ts +2 -5
  114. package/dist/react/components/FreshnessBadge.js +6 -14
  115. package/dist/react/components/Readout.d.ts +2 -5
  116. package/dist/react/components/Readout.js +1 -2
  117. package/dist/react/components/RecentSummaries.d.ts +2 -5
  118. package/dist/react/components/RecentSummaries.js +7 -46
  119. package/dist/react/components/SceneTree.js +37 -0
  120. package/dist/react/components/Sparkline.d.ts +2 -5
  121. package/dist/react/components/Sparkline.js +4 -41
  122. package/dist/react/components/StationCard.d.ts +8 -10
  123. package/dist/react/components/StationCard.js +6 -47
  124. package/dist/react/components/StationFeedProvider.d.ts +3 -6
  125. package/dist/react/components/StationFeedProvider.js +1 -2
  126. package/dist/react/components/StationStrip.d.ts +2 -5
  127. package/dist/react/components/StationStrip.js +6 -62
  128. package/dist/react/components/StationTable.d.ts +3 -6
  129. package/dist/react/components/StationTable.js +22 -77
  130. package/dist/react/components/TrendChart.d.ts +2 -5
  131. package/dist/react/components/TrendChart.js +9 -65
  132. package/dist/react/components/WindArrow.d.ts +2 -5
  133. package/dist/react/components/WindArrow.js +4 -17
  134. package/dist/react/components/WindHistoryChart.d.ts +2 -5
  135. package/dist/react/components/WindHistoryChart.js +9 -184
  136. package/dist/react/components/WindRose.d.ts +2 -7
  137. package/dist/react/components/WindRose.js +7 -91
  138. package/dist/react/components/WindSampleStrip.d.ts +2 -5
  139. package/dist/react/components/WindSampleStrip.js +9 -117
  140. package/dist/react/components/atoms.d.ts +12 -14
  141. package/dist/react/components/atoms.js +13 -50
  142. package/dist/react/hooks/useFreshness.d.ts +1 -4
  143. package/dist/react/hooks/useFreshness.js +1 -2
  144. package/dist/react/hooks/useMeasuredChartWidth.d.ts +2 -5
  145. package/dist/react/hooks/useMeasuredChartWidth.js +1 -2
  146. package/dist/react/hooks/usePolledJson.js +1 -2
  147. package/dist/react/hooks/useStation.d.ts +2 -5
  148. package/dist/react/hooks/useStation.js +1 -2
  149. package/dist/react/hooks/useStationClimatology.d.ts +2 -5
  150. package/dist/react/hooks/useStationClimatology.js +1 -2
  151. package/dist/react/hooks/useStationCurrent.d.ts +2 -5
  152. package/dist/react/hooks/useStationCurrent.js +4 -4
  153. package/dist/react/hooks/useStationFeed.d.ts +2 -5
  154. package/dist/react/hooks/useStationFeed.js +4 -4
  155. package/dist/react/hooks/useStationLive.d.ts +2 -5
  156. package/dist/react/hooks/useStationLive.js +1 -2
  157. package/dist/react/index.d.ts +2 -2
  158. package/dist/react/index.js +5 -5
  159. package/dist/react/lib/cells.js +5 -26
  160. package/dist/react/lib/use-pinned-cursor.js +1 -2
  161. package/dist/samples.d.ts +8 -11
  162. package/dist/samples.js +1 -2
  163. package/dist/scene/air-extremes.js +13 -29
  164. package/dist/scene/air-matrix.js +46 -60
  165. package/dist/scene/atoms.js +1 -2
  166. package/dist/scene/card.js +15 -42
  167. package/dist/scene/cells.d.ts +4 -0
  168. package/dist/scene/cells.js +50 -0
  169. package/dist/scene/chart.d.ts +2 -5
  170. package/dist/scene/chart.js +3 -3
  171. package/dist/scene/climatology-pattern.d.ts +1 -2
  172. package/dist/scene/climatology-pattern.js +11 -13
  173. package/dist/scene/climatology-rose.d.ts +1 -2
  174. package/dist/scene/climatology-rose.js +15 -35
  175. package/dist/scene/compass-fan.js +29 -102
  176. package/dist/scene/current.d.ts +2 -1
  177. package/dist/scene/current.js +30 -58
  178. package/dist/scene/daily-pattern.d.ts +1 -3
  179. package/dist/scene/daily-pattern.js +21 -29
  180. package/dist/scene/dial-parts.d.ts +1 -0
  181. package/dist/scene/dial-parts.js +69 -0
  182. package/dist/scene/dial.d.ts +1 -2
  183. package/dist/scene/dial.js +49 -138
  184. package/dist/scene/favorable-share.js +17 -35
  185. package/dist/scene/glyphs.js +21 -18
  186. package/dist/scene/index.d.ts +5 -3
  187. package/dist/scene/node.js +18 -0
  188. package/dist/scene/recent-summaries.js +27 -65
  189. package/dist/scene/rose.js +90 -119
  190. package/dist/scene/sample-strip.d.ts +1 -2
  191. package/dist/scene/sample-strip.js +36 -38
  192. package/dist/scene/sparkline.js +32 -42
  193. package/dist/scene/strip.js +19 -59
  194. package/dist/scene/table.js +48 -71
  195. package/dist/scene/trend.d.ts +1 -2
  196. package/dist/scene/trend.js +30 -57
  197. package/dist/scene/wind-history.d.ts +1 -2
  198. package/dist/scene/wind-history.js +42 -53
  199. package/dist/scene/wind-plot.js +71 -142
  200. package/dist/server/adapter.d.ts +7 -10
  201. package/dist/server/adapter.js +1 -2
  202. package/dist/server/adapters/campbell.d.ts +18 -20
  203. package/dist/server/adapters/campbell.js +2 -3
  204. package/dist/server/adapters/ecowitt.d.ts +12 -15
  205. package/dist/server/adapters/ecowitt.js +1 -2
  206. package/dist/server/adapters/tempest.d.ts +10 -13
  207. package/dist/server/adapters/tempest.js +1 -2
  208. package/dist/server/adapters/windnerd-climatology.d.ts +5 -8
  209. package/dist/server/adapters/windnerd-climatology.js +5 -5
  210. package/dist/server/adapters/windnerd-live.d.ts +2 -5
  211. package/dist/server/adapters/windnerd-live.js +4 -4
  212. package/dist/server/adapters/windnerd.d.ts +30 -33
  213. package/dist/server/adapters/windnerd.js +2 -3
  214. package/dist/server/config.d.ts +61 -63
  215. package/dist/server/config.js +1 -2
  216. package/dist/server/environment.d.ts +20 -22
  217. package/dist/server/environment.js +1 -2
  218. package/dist/server/feed.d.ts +19 -21
  219. package/dist/server/feed.js +1 -2
  220. package/dist/server/handler.d.ts +4 -7
  221. package/dist/server/handler.js +1 -2
  222. package/dist/server/hologram.d.ts +9 -12
  223. package/dist/server/hologram.js +3 -3
  224. package/dist/server/live.d.ts +2 -5
  225. package/dist/server/live.js +1 -2
  226. package/dist/sse.js +1 -2
  227. package/dist/strings.d.ts +8 -11
  228. package/dist/strings.js +1 -2
  229. package/dist/windnerd.d.ts +4 -7
  230. package/dist/windnerd.js +1 -2
  231. package/package.json +12 -17
  232. package/schema/README.md +1 -1
  233. package/schema/stationclimatology.schema.json +64 -61
  234. package/schema/stationcurrent.schema.json +68 -156
  235. package/schema/stationfeed.schema.json +71 -163
  236. package/schema/stationhistory.schema.json +37 -46
  237. package/schema/stationlive.schema.json +221 -306
@@ -1,7 +1,7 @@
1
1
  import { resolveEnvironment, unavailableReasonForError } from "./environment.js";
2
2
  import { StationClimatologyUnsupportedError, StationHistoryUnsupportedError, StationLiveUnsupportedError, UnknownStationError, assembleStations, loadStationClimatology, loadStationCurrent, loadStationFeed, loadStationHistory, openStationLive } from "./feed.js";
3
3
  import { STATION_LIVE_SSE_HEADERS, encodeStationLiveSse } from "./live.js";
4
- //#region src/server/handler.ts
4
+ // src/server/handler.ts
5
5
  const CLIMATOLOGY_CACHE_SECONDS = 21600;
6
6
  const HISTORY_PAST_CACHE_SECONDS = 86400;
7
7
  const HISTORY_LIVE_CACHE_SECONDS = 60;
@@ -244,5 +244,4 @@ function etagMatches(ifNoneMatch, etag) {
244
244
  const bare = (tag) => tag.startsWith("W/") ? tag.slice(2) : tag;
245
245
  return ifNoneMatch.split(",").some((candidate) => bare(candidate.trim()) === bare(etag));
246
246
  }
247
- //#endregion
248
247
  export { createStationFeedHandler };
@@ -1,22 +1,19 @@
1
1
  import { ConnectivityServiceState, StationConnectivity } from "../connectivity.js";
2
2
  import { ServerEnvironment } from "./environment.js";
3
3
  import { z } from "zod";
4
- //#region src/server/hologram.d.ts
5
- declare const HOLOGRAM_API_BASE = "https://dashboard.hologram.io/api/1";
6
- declare const TRIAL_HOLOGRAM_CACHE_TTL_SECONDS = 300;
7
- declare const hologramConnectivityConfigSchema: z.ZodObject<{
4
+ export declare const HOLOGRAM_API_BASE = "https://dashboard.hologram.io/api/1";
5
+ export declare const TRIAL_HOLOGRAM_CACHE_TTL_SECONDS = 300;
6
+ export declare const hologramConnectivityConfigSchema: z.ZodObject<{
8
7
  apiKey: z.ZodString;
9
8
  deviceId: z.ZodNumber;
10
9
  }, z.core.$strict>;
11
- type HologramConnectivityConfig = z.output<typeof hologramConnectivityConfigSchema>;
12
- type HologramConnectivityOptions = {
10
+ export type HologramConnectivityConfig = z.output<typeof hologramConnectivityConfigSchema>;
11
+ export type HologramConnectivityOptions = {
13
12
  environment?: ServerEnvironment;
14
13
  cacheTtlSeconds?: number;
15
14
  apiBase?: string;
16
15
  };
17
- declare function hologramTimeToIso(value: string | null | undefined): string | null;
18
- declare function hologramServiceState(state: string | null | undefined): ConnectivityServiceState;
19
- declare function parseHologramConnectivity(value: string, expectedDeviceId: number, checkedAt: string): StationConnectivity;
20
- declare function loadHologramConnectivity(config: HologramConnectivityConfig, options?: HologramConnectivityOptions): Promise<StationConnectivity>;
21
- //#endregion
22
- export { HOLOGRAM_API_BASE, HologramConnectivityConfig, HologramConnectivityOptions, TRIAL_HOLOGRAM_CACHE_TTL_SECONDS, hologramConnectivityConfigSchema, hologramServiceState, hologramTimeToIso, loadHologramConnectivity, parseHologramConnectivity };
16
+ export declare function hologramTimeToIso(value: string | null | undefined): string | null;
17
+ export declare function hologramServiceState(state: string | null | undefined): ConnectivityServiceState;
18
+ export declare function parseHologramConnectivity(value: string, expectedDeviceId: number, checkedAt: string): StationConnectivity;
19
+ export declare function loadHologramConnectivity(config: HologramConnectivityConfig, options?: HologramConnectivityOptions): Promise<StationConnectivity>;
@@ -1,7 +1,7 @@
1
1
  import { fetchUpstreamText, resolveEnvironment } from "./environment.js";
2
2
  import { z } from "zod";
3
3
  import { UpstreamError } from "@azohra/meteo.core";
4
- //#region src/server/hologram.ts
4
+ // src/server/hologram.ts
5
5
  const HOLOGRAM_API_BASE = "https://dashboard.hologram.io/api/1";
6
6
  const TRIAL_HOLOGRAM_CACHE_TTL_SECONDS = 300;
7
7
  const hologramConnectivityConfigSchema = z.strictObject({
@@ -101,13 +101,13 @@ function parseHologramConnectivity(value, expectedDeviceId, checkedAt) {
101
101
  }
102
102
  async function loadHologramConnectivity(config, options = {}) {
103
103
  const environment = resolveEnvironment(options.environment);
104
+ const base = options.apiBase ?? "https://dashboard.hologram.io/api/1";
104
105
  return parseHologramConnectivity(await fetchUpstreamText(environment, {
105
- url: `${options.apiBase ?? "https://dashboard.hologram.io/api/1"}/devices/${config.deviceId}`,
106
+ url: `${base}/devices/${config.deviceId}`,
106
107
  cacheKey: `hologram/device/${config.deviceId}`,
107
108
  cacheTtlSeconds: options.cacheTtlSeconds ?? 300,
108
109
  subject: `Hologram device ${config.deviceId}`,
109
110
  headers: { Authorization: `Basic ${btoa(`apikey:${config.apiKey}`)}` }
110
111
  }), config.deviceId, environment.now().toISOString());
111
112
  }
112
- //#endregion
113
113
  export { HOLOGRAM_API_BASE, TRIAL_HOLOGRAM_CACHE_TTL_SECONDS, hologramConnectivityConfigSchema, hologramServiceState, hologramTimeToIso, loadHologramConnectivity, parseHologramConnectivity };
@@ -1,6 +1,5 @@
1
1
  import { StationLiveFrame } from "../contract.js";
2
- //#region src/server/live.d.ts
3
- declare const STATION_LIVE_SSE_HEADERS: {
2
+ export declare const STATION_LIVE_SSE_HEADERS: {
4
3
  readonly "Content-Type": "text/event-stream; charset=utf-8";
5
4
  readonly "Cache-Control": "no-cache, no-store";
6
5
  readonly "X-Accel-Buffering": "no";
@@ -10,6 +9,4 @@ declare const STATION_LIVE_SSE_HEADERS: {
10
9
  * vendor open call (openWindnerdLive) is the seam a host uses to serve live
11
10
  * data through its own route or fan-out infrastructure.
12
11
  */
13
- declare function encodeStationLiveSse(frames: ReadableStream<StationLiveFrame>): ReadableStream<Uint8Array>;
14
- //#endregion
15
- export { STATION_LIVE_SSE_HEADERS, encodeStationLiveSse };
12
+ export declare function encodeStationLiveSse(frames: ReadableStream<StationLiveFrame>): ReadableStream<Uint8Array>;
@@ -1,4 +1,4 @@
1
- //#region src/server/live.ts
1
+ // src/server/live.ts
2
2
  const STATION_LIVE_SSE_HEADERS = {
3
3
  "Content-Type": "text/event-stream; charset=utf-8",
4
4
  "Cache-Control": "no-cache, no-store",
@@ -15,5 +15,4 @@ function encodeStationLiveSse(frames) {
15
15
  controller.enqueue(encoder.encode(`data: ${JSON.stringify(frame)}\n\n`));
16
16
  } }));
17
17
  }
18
- //#endregion
19
18
  export { STATION_LIVE_SSE_HEADERS, encodeStationLiveSse };
package/dist/sse.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/sse.ts
1
+ // src/sse.ts
2
2
  const DEFAULT_MAX_EVENT_BYTES = 262144;
3
3
  async function* sseEvents(body, options = {}) {
4
4
  const maxEventBytes = options.maxEventBytes ?? 262144;
@@ -52,5 +52,4 @@ async function* sseEvents(body, options = {}) {
52
52
  await reader.cancel().catch(() => void 0);
53
53
  }
54
54
  }
55
- //#endregion
56
55
  export { DEFAULT_MAX_EVENT_BYTES, sseEvents };
package/dist/strings.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { UnavailableReason } from "./contract.js";
2
2
  import { CompassPoint, FreshnessStatus, SpeedUnit } from "./derive.js";
3
- //#region src/strings.d.ts
4
- type StationStrings = {
3
+ export type StationStrings = {
5
4
  averageLabel: string;
6
5
  avgLabel: string;
7
6
  calm: string;
@@ -112,8 +111,8 @@ type StationStrings = {
112
111
  trend: (stationName: string, seriesName: string) => string;
113
112
  };
114
113
  };
115
- declare const defaultStrings: StationStrings;
116
- type StationStringOverrides = Partial<Omit<StationStrings, "compassSpoken" | "updated" | "freshness" | "reasons" | "speedUnits" | "table" | "air" | "aria"> & {
114
+ export declare const defaultStrings: StationStrings;
115
+ export type StationStringOverrides = Partial<Omit<StationStrings, "compassSpoken" | "updated" | "freshness" | "reasons" | "speedUnits" | "table" | "air" | "aria"> & {
117
116
  compassSpoken: Partial<StationStrings["compassSpoken"]>;
118
117
  updated: Partial<StationStrings["updated"]>;
119
118
  freshness: Partial<StationStrings["freshness"]>;
@@ -123,10 +122,8 @@ type StationStringOverrides = Partial<Omit<StationStrings, "compassSpoken" | "up
123
122
  air: Partial<StationStrings["air"]>;
124
123
  aria: Partial<StationStrings["aria"]>;
125
124
  }>;
126
- declare function resolveStrings(overrides?: StationStringOverrides): StationStrings;
127
- declare function mergeStringOverrides(outer: StationStringOverrides | undefined, inner: StationStringOverrides | undefined): StationStringOverrides | undefined;
128
- type FormatTime = (date: Date) => string;
129
- declare function defaultFormatTime(date: Date): string;
130
- declare function localeFormatTime(locale: string): FormatTime;
131
- //#endregion
132
- export { FormatTime, StationStringOverrides, StationStrings, defaultFormatTime, defaultStrings, localeFormatTime, mergeStringOverrides, resolveStrings };
125
+ export declare function resolveStrings(overrides?: StationStringOverrides): StationStrings;
126
+ export declare function mergeStringOverrides(outer: StationStringOverrides | undefined, inner: StationStringOverrides | undefined): StationStringOverrides | undefined;
127
+ export type FormatTime = (date: Date) => string;
128
+ export declare function defaultFormatTime(date: Date): string;
129
+ export declare function localeFormatTime(locale: string): FormatTime;
package/dist/strings.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { speedUnitLabel } from "./derive.js";
2
- //#region src/strings.ts
2
+ // src/strings.ts
3
3
  const defaultStrings = {
4
4
  averageLabel: "Average",
5
5
  avgLabel: "avg",
@@ -247,5 +247,4 @@ function localeFormatTime(locale) {
247
247
  }
248
248
  return format;
249
249
  }
250
- //#endregion
251
250
  export { defaultFormatTime, defaultStrings, localeFormatTime, mergeStringOverrides, resolveStrings };
@@ -1,7 +1,4 @@
1
- //#region src/windnerd.d.ts
2
- declare const WINDNERD_RECORD_PERIODS_MINUTES: readonly [1, 5, 10, 15, 30, 60, 180, 360];
3
- type WindnerdRecordPeriodMinutes = (typeof WINDNERD_RECORD_PERIODS_MINUTES)[number];
4
- declare function normalizeWindnerdStationKey(value: string | null | undefined): string | null;
5
- declare function windnerdStationUrl(stationKey: string): string;
6
- //#endregion
7
- export { WINDNERD_RECORD_PERIODS_MINUTES, WindnerdRecordPeriodMinutes, normalizeWindnerdStationKey, windnerdStationUrl };
1
+ export declare const WINDNERD_RECORD_PERIODS_MINUTES: readonly [1, 5, 10, 15, 30, 60, 180, 360];
2
+ export type WindnerdRecordPeriodMinutes = (typeof WINDNERD_RECORD_PERIODS_MINUTES)[number];
3
+ export declare function normalizeWindnerdStationKey(value: string | null | undefined): string | null;
4
+ export declare function windnerdStationUrl(stationKey: string): string;
package/dist/windnerd.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/windnerd.ts
1
+ // src/windnerd.ts
2
2
  const WINDNERD_HOST = "windnerd.net";
3
3
  const WINDNERD_KEY = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
4
4
  const WINDNERD_RECORD_PERIODS_MINUTES = [
@@ -31,5 +31,4 @@ function windnerdStationUrl(stationKey) {
31
31
  if (!WINDNERD_KEY.test(stationKey)) throw new Error("Invalid WindNerd station key.");
32
32
  return `https://${WINDNERD_HOST}/en/${stationKey}`;
33
33
  }
34
- //#endregion
35
34
  export { WINDNERD_RECORD_PERIODS_MINUTES, normalizeWindnerdStationKey, windnerdStationUrl };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azohra/meteo.station",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "description": "Live weather-station reading and display. A wire contract, provider adapters, a polling client, a Node server, and byte-identical React and custom-element display bindings.",
5
5
  "keywords": [
6
6
  "weather-station",
@@ -63,8 +63,8 @@
63
63
  "./package.json": "./package.json"
64
64
  },
65
65
  "dependencies": {
66
- "zod": "^4.0.0",
67
- "@azohra/meteo.core": "0.3.0"
66
+ "@azohra/meteo.core": "0.3.2",
67
+ "zod": "^4.6.7"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "react": "^18.0.0 || ^19.0.0"
@@ -75,23 +75,18 @@
75
75
  }
76
76
  },
77
77
  "devDependencies": {
78
- "@testing-library/react": "^16.1.0",
79
- "@types/node": "^22.10.0",
80
- "@types/react": "^19.0.0",
81
- "@types/react-dom": "^19.2.4",
78
+ "@testing-library/react": "^16.3.3",
79
+ "@types/node": "^22.20.5",
80
+ "@types/react": "^19.3.0",
81
+ "@types/react-dom": "^19.3.0",
82
82
  "jsdom": "^26.0.0",
83
- "react": "^19.0.0",
84
- "react-dom": "^19.0.0",
85
- "typescript": "^5.6.0",
86
- "vitest": "^4.0.0"
83
+ "react": "^19.3.1",
84
+ "react-dom": "^19.3.1",
85
+ "typescript": "^7.0.2",
86
+ "vitest": "^5.0.5"
87
87
  },
88
88
  "engines": {
89
89
  "node": ">=22"
90
90
  },
91
- "homepage": "https://meteo.azohra.com",
92
- "scripts": {
93
- "build": "pnpm --dir ../core build && vp pack",
94
- "test": "pnpm --dir ../core build && vp test",
95
- "typecheck": "pnpm --dir ../core build && tsc -p tsconfig.json --noEmit"
96
- }
91
+ "homepage": "https://meteo.azohra.com"
97
92
  }
package/schema/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  The station capability's wire contract in language-neutral form: JSON
4
4
  Schemas emitted from the zod contract (`station/contract.ts`), plus an
5
5
  annotated example document beside each schema. Never edited by hand — regenerate with
6
- `pnpm schemas` at the workspace root, which must reproduce every file
6
+ `mise run schemas` at the workspace root, which must reproduce every file
7
7
  byte-identical (the drift guard is this package's own test suite).
8
8
 
9
9
  They are committed rather than build-generated so contract changes appear
@@ -3,69 +3,72 @@
3
3
  "$id": "https://meteo.azohra.com/schema/stationclimatology.schema.json",
4
4
  "title": "StationClimatology",
5
5
  "description": "The multi-year cube served at /climatology: (month, slot-of-day, sector) sums bucketed in the station's standard time, binned with the consumer's thresholds. Its own document family — it versions apart from the feed.",
6
- "type": "object",
7
- "properties": {
8
- "schemaVersion": {
9
- "type": "number",
10
- "const": 1
11
- },
12
- "servedAt": {
13
- "type": "string",
14
- "format": "date-time"
15
- },
16
- "stationId": {
17
- "type": "string",
18
- "minLength": 1
19
- },
20
- "sectorCount": {
21
- "type": "integer",
22
- "minimum": 4,
23
- "maximum": 9007199254740991
24
- },
25
- "slotMinutes": {
26
- "type": "integer",
27
- "exclusiveMinimum": 0,
28
- "maximum": 9007199254740991,
29
- "description": "Minutes per slot of day; must divide 1440."
30
- },
31
- "thresholdsMps": {
32
- "type": "array",
33
- "items": {
34
- "type": "number",
35
- "minimum": 0
36
- },
37
- "description": "The consumer's speed-band bounds the cube was binned with, m/s, ascending. A judgment parameter echoed so a reader knows which opinion shaped bandCounts."
38
- },
39
- "utcOffsetMinutes": {
40
- "type": "number",
41
- "description": "The station's STANDARD utc offset used for month and slot bucketing — no DST, so a slot means the same solar hours in January and July."
42
- },
43
- "years": {
44
- "type": "array",
45
- "items": {
46
- "$ref": "#/$defs/ClimatologyYear"
6
+ "$ref": "#/$defs/StationClimatology",
7
+ "$defs": {
8
+ "StationClimatology": {
9
+ "type": "object",
10
+ "properties": {
11
+ "schemaVersion": {
12
+ "type": "number",
13
+ "const": 1
14
+ },
15
+ "servedAt": {
16
+ "type": "string",
17
+ "format": "date-time"
18
+ },
19
+ "stationId": {
20
+ "type": "string",
21
+ "minLength": 1
22
+ },
23
+ "sectorCount": {
24
+ "type": "integer",
25
+ "minimum": 4,
26
+ "maximum": 9007199254740991
27
+ },
28
+ "slotMinutes": {
29
+ "type": "integer",
30
+ "exclusiveMinimum": 0,
31
+ "maximum": 9007199254740991,
32
+ "description": "Minutes per slot of day; must divide 1440."
33
+ },
34
+ "thresholdsMps": {
35
+ "type": "array",
36
+ "items": {
37
+ "type": "number",
38
+ "minimum": 0
39
+ },
40
+ "description": "The consumer's speed-band bounds the cube was binned with, m/s, ascending. A judgment parameter echoed so a reader knows which opinion shaped bandCounts."
41
+ },
42
+ "utcOffsetMinutes": {
43
+ "type": "number",
44
+ "description": "The station's STANDARD utc offset used for month and slot bucketing — no DST, so a slot means the same solar hours in January and July."
45
+ },
46
+ "years": {
47
+ "type": "array",
48
+ "items": {
49
+ "$ref": "#/$defs/ClimatologyYear"
50
+ },
51
+ "description": "Oldest first; the coverage ledger."
52
+ },
53
+ "cells": {
54
+ "type": "array",
55
+ "items": {
56
+ "$ref": "#/$defs/ClimatologyCell"
57
+ }
58
+ }
47
59
  },
48
- "description": "Oldest first; the coverage ledger."
60
+ "required": [
61
+ "schemaVersion",
62
+ "servedAt",
63
+ "stationId",
64
+ "sectorCount",
65
+ "slotMinutes",
66
+ "thresholdsMps",
67
+ "utcOffsetMinutes",
68
+ "years",
69
+ "cells"
70
+ ]
49
71
  },
50
- "cells": {
51
- "type": "array",
52
- "items": {
53
- "$ref": "#/$defs/ClimatologyCell"
54
- }
55
- }
56
- },
57
- "required": [
58
- "schemaVersion",
59
- "servedAt",
60
- "stationId",
61
- "sectorCount",
62
- "slotMinutes",
63
- "thresholdsMps",
64
- "utcOffsetMinutes",
65
- "years",
66
- "cells"
67
- ],
68
- "$defs": {
69
72
  "ClimatologyYear": {
70
73
  "type": "object",
71
74
  "properties": {