@azohra/meteo.station 0.5.0 → 0.7.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 (147) hide show
  1. package/README.md +17 -17
  2. package/dist/client/climatology.js +1 -1
  3. package/dist/client/history.js +3 -11
  4. package/dist/client/live.d.ts +2 -1
  5. package/dist/client/live.js +7 -4
  6. package/dist/client/stores.js +10 -2
  7. package/dist/climatology.d.ts +1 -1
  8. package/dist/climatology.js +1 -1
  9. package/dist/connectivity.d.ts +2 -2
  10. package/dist/contract.d.ts +98 -98
  11. package/dist/derive.js +9 -8
  12. package/dist/elements/elements/AirExtremesElement.js +5 -18
  13. package/dist/elements/elements/AirMatrixElement.js +6 -31
  14. package/dist/elements/elements/ClimatologyDailyPatternElement.js +17 -12
  15. package/dist/elements/elements/ClimatologyRoseElement.js +5 -15
  16. package/dist/elements/elements/CompassFanElement.js +5 -64
  17. package/dist/elements/elements/CurrentConditionsElement.js +7 -26
  18. package/dist/elements/elements/DailyPatternElement.d.ts +0 -1
  19. package/dist/elements/elements/DailyPatternElement.js +6 -120
  20. package/dist/elements/elements/DialElement.js +3 -95
  21. package/dist/elements/elements/FavorableShareElement.js +6 -21
  22. package/dist/elements/elements/RecentSummariesElement.js +6 -23
  23. package/dist/elements/elements/SparklineElement.d.ts +0 -1
  24. package/dist/elements/elements/SparklineElement.js +4 -39
  25. package/dist/elements/elements/StationCardElement.js +4 -18
  26. package/dist/elements/elements/StationFeedElement.js +4 -2
  27. package/dist/elements/elements/StationStripElement.js +4 -18
  28. package/dist/elements/elements/StationTableElement.js +15 -51
  29. package/dist/elements/elements/TrendChartElement.js +27 -94
  30. package/dist/elements/elements/WindHistoryChartElement.js +29 -189
  31. package/dist/elements/elements/WindRoseElement.d.ts +0 -1
  32. package/dist/elements/elements/WindRoseElement.js +6 -70
  33. package/dist/elements/elements/atoms.js +11 -38
  34. package/dist/elements/index.js +3 -3
  35. package/dist/elements/lib/fragments.js +8 -37
  36. package/dist/elements/lib/h.js +1 -1
  37. package/dist/elements/lib/pinned-cursor.js +48 -0
  38. package/dist/elements/lib/render.js +30 -0
  39. package/dist/fixtures.d.ts +6 -2
  40. package/dist/fixtures.js +30 -2
  41. package/dist/format.js +7 -3
  42. package/dist/geometry.d.ts +1 -1
  43. package/dist/geometry.js +22 -9
  44. package/dist/instruments.js +2 -2
  45. package/dist/react/components/AirExtremes.d.ts +1 -1
  46. package/dist/react/components/AirExtremes.js +5 -22
  47. package/dist/react/components/AirMatrix.js +10 -43
  48. package/dist/react/components/ClimatologyDailyPattern.d.ts +1 -1
  49. package/dist/react/components/ClimatologyDailyPattern.js +19 -13
  50. package/dist/react/components/ClimatologyRose.d.ts +1 -1
  51. package/dist/react/components/ClimatologyRose.js +11 -28
  52. package/dist/react/components/CompassFan.d.ts +1 -1
  53. package/dist/react/components/CompassFan.js +6 -73
  54. package/dist/react/components/CurrentConditions.d.ts +1 -1
  55. package/dist/react/components/CurrentConditions.js +11 -74
  56. package/dist/react/components/DailyPattern.d.ts +1 -3
  57. package/dist/react/components/DailyPattern.js +10 -149
  58. package/dist/react/components/Dial.d.ts +2 -3
  59. package/dist/react/components/Dial.js +5 -118
  60. package/dist/react/components/FavorableShare.d.ts +1 -1
  61. package/dist/react/components/FavorableShare.js +6 -27
  62. package/dist/react/components/FreshnessBadge.d.ts +1 -1
  63. package/dist/react/components/FreshnessBadge.js +5 -12
  64. package/dist/react/components/RecentSummaries.d.ts +1 -1
  65. package/dist/react/components/RecentSummaries.js +6 -44
  66. package/dist/react/components/SceneTree.js +38 -0
  67. package/dist/react/components/Sparkline.d.ts +1 -1
  68. package/dist/react/components/Sparkline.js +3 -39
  69. package/dist/react/components/StationCard.d.ts +2 -2
  70. package/dist/react/components/StationCard.js +5 -45
  71. package/dist/react/components/StationStrip.d.ts +1 -1
  72. package/dist/react/components/StationStrip.js +5 -60
  73. package/dist/react/components/StationTable.js +21 -75
  74. package/dist/react/components/TrendChart.js +13 -86
  75. package/dist/react/components/WindArrow.d.ts +1 -1
  76. package/dist/react/components/WindArrow.js +3 -15
  77. package/dist/react/components/WindHistoryChart.js +12 -205
  78. package/dist/react/components/WindRose.d.ts +1 -3
  79. package/dist/react/components/WindRose.js +6 -89
  80. package/dist/react/components/WindSampleStrip.js +14 -139
  81. package/dist/react/components/atoms.d.ts +5 -5
  82. package/dist/react/components/atoms.js +12 -48
  83. package/dist/react/hooks/useStation.js +28 -50
  84. package/dist/react/hooks/useStationCurrent.js +3 -2
  85. package/dist/react/hooks/useStationFeed.d.ts +0 -1
  86. package/dist/react/hooks/useStationFeed.js +3 -2
  87. package/dist/react/index.d.ts +2 -2
  88. package/dist/react/index.js +7 -7
  89. package/dist/react/lib/cells.js +4 -24
  90. package/dist/react/lib/use-pinned-cursor.js +32 -0
  91. package/dist/samples.js +7 -43
  92. package/dist/scene/air-extremes.js +12 -27
  93. package/dist/scene/air-matrix.js +45 -58
  94. package/dist/scene/card.js +14 -40
  95. package/dist/scene/cells.d.ts +4 -0
  96. package/dist/scene/cells.js +51 -0
  97. package/dist/scene/chart.js +2 -1
  98. package/dist/scene/climatology-pattern.d.ts +1 -2
  99. package/dist/scene/climatology-pattern.js +10 -11
  100. package/dist/scene/climatology-rose.d.ts +1 -2
  101. package/dist/scene/climatology-rose.js +14 -33
  102. package/dist/scene/compass-fan.js +28 -100
  103. package/dist/scene/current.d.ts +2 -1
  104. package/dist/scene/current.js +29 -56
  105. package/dist/scene/daily-pattern.d.ts +1 -3
  106. package/dist/scene/daily-pattern.js +20 -27
  107. package/dist/scene/dial-parts.d.ts +1 -0
  108. package/dist/scene/dial-parts.js +70 -0
  109. package/dist/scene/dial.d.ts +1 -2
  110. package/dist/scene/dial.js +48 -136
  111. package/dist/scene/favorable-share.js +16 -33
  112. package/dist/scene/glyphs.js +20 -16
  113. package/dist/scene/index.d.ts +5 -3
  114. package/dist/scene/node.js +19 -0
  115. package/dist/scene/recent-summaries.js +26 -66
  116. package/dist/scene/rose.js +89 -117
  117. package/dist/scene/sample-strip.d.ts +1 -2
  118. package/dist/scene/sample-strip.js +35 -36
  119. package/dist/scene/sparkline.js +31 -40
  120. package/dist/scene/strip.js +18 -57
  121. package/dist/scene/table.js +47 -69
  122. package/dist/scene/trend.d.ts +1 -2
  123. package/dist/scene/trend.js +29 -55
  124. package/dist/scene/wind-history.d.ts +1 -2
  125. package/dist/scene/wind-history.js +41 -51
  126. package/dist/scene/wind-plot.js +70 -140
  127. package/dist/server/adapters/campbell.d.ts +7 -7
  128. package/dist/server/adapters/campbell.js +1 -1
  129. package/dist/server/adapters/ecowitt.d.ts +8 -8
  130. package/dist/server/adapters/tempest.d.ts +6 -6
  131. package/dist/server/adapters/windnerd-climatology.js +4 -3
  132. package/dist/server/adapters/windnerd-live.js +3 -2
  133. package/dist/server/adapters/windnerd.d.ts +10 -11
  134. package/dist/server/adapters/windnerd.js +3 -13
  135. package/dist/server/config.d.ts +48 -48
  136. package/dist/server/hologram.js +2 -1
  137. package/dist/server/index.d.ts +2 -2
  138. package/dist/server/index.js +2 -2
  139. package/dist/windnerd.d.ts +3 -1
  140. package/dist/windnerd.js +11 -1
  141. package/package.json +7 -12
  142. package/schema/README.md +3 -3
  143. package/schema/stationclimatology.schema.json +64 -61
  144. package/schema/stationcurrent.schema.json +68 -156
  145. package/schema/stationfeed.schema.json +71 -163
  146. package/schema/stationhistory.schema.json +37 -46
  147. package/schema/stationlive.schema.json +221 -306
@@ -4,50 +4,57 @@ import { ResolvedEnvironment } from "./environment.js";
4
4
  import { z } from "zod";
5
5
  //#region src/server/config.d.ts
6
6
  declare const windnerdStationConfigSchema: z.ZodObject<{
7
- stationKey: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
8
- locationId: z.ZodNumber;
9
- hasTemperature: z.ZodDefault<z.ZodBoolean>;
10
- hasPressure: z.ZodDefault<z.ZodBoolean>;
11
- hasBattery: z.ZodDefault<z.ZodBoolean>;
12
- timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
- pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
7
  elevationM: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
15
8
  latitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
16
9
  longitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
17
10
  id: z.ZodString;
18
11
  name: z.ZodString;
12
+ timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
+ pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
19
14
  vendor: z.ZodLiteral<"windnerd">;
15
+ stationKey: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
16
+ locationId: z.ZodNumber;
17
+ hasTemperature: z.ZodDefault<z.ZodBoolean>;
18
+ hasPressure: z.ZodDefault<z.ZodBoolean>;
19
+ hasBattery: z.ZodDefault<z.ZodBoolean>;
20
20
  }, z.core.$strict>;
21
21
  type WindnerdStationConfig = z.output<typeof windnerdStationConfigSchema>;
22
22
  declare const tempestStationConfigSchema: z.ZodObject<{
23
- stationId: z.ZodNumber;
24
- token: z.ZodString;
25
- timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
- pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
23
  elevationM: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
28
24
  latitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
29
25
  longitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
30
26
  id: z.ZodString;
31
27
  name: z.ZodString;
28
+ timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
29
+ pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
32
30
  vendor: z.ZodLiteral<"tempest">;
31
+ stationId: z.ZodNumber;
32
+ token: z.ZodString;
33
33
  }, z.core.$strict>;
34
34
  type TempestStationConfig = z.output<typeof tempestStationConfigSchema>;
35
35
  declare const ecowittStationConfigSchema: z.ZodObject<{
36
- applicationKey: z.ZodString;
37
- apiKey: z.ZodString;
38
- mac: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
39
- hasBattery: z.ZodDefault<z.ZodBoolean>;
40
- timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
41
- pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
42
36
  elevationM: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
43
37
  latitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
44
38
  longitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
45
39
  id: z.ZodString;
46
40
  name: z.ZodString;
41
+ timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
42
+ pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
47
43
  vendor: z.ZodLiteral<"ecowitt">;
44
+ applicationKey: z.ZodString;
45
+ apiKey: z.ZodString;
46
+ mac: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
47
+ hasBattery: z.ZodDefault<z.ZodBoolean>;
48
48
  }, z.core.$strict>;
49
49
  type EcowittStationConfig = z.output<typeof ecowittStationConfigSchema>;
50
50
  declare const campbellStationConfigSchema: z.ZodObject<{
51
+ elevationM: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
52
+ latitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
53
+ longitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
54
+ id: z.ZodString;
55
+ name: z.ZodString;
56
+ pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
57
+ vendor: z.ZodLiteral<"campbell">;
51
58
  baseUrl: z.ZodString;
52
59
  source: z.ZodString;
53
60
  timeZone: z.ZodString;
@@ -56,13 +63,6 @@ declare const campbellStationConfigSchema: z.ZodObject<{
56
63
  currentIntervalSeconds: z.ZodDefault<z.ZodNumber>;
57
64
  historyPeriodMinutes: z.ZodDefault<z.ZodNumber>;
58
65
  currentCacheTtlSeconds: z.ZodDefault<z.ZodNumber>;
59
- pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
60
- elevationM: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
61
- latitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
62
- longitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
63
- id: z.ZodString;
64
- name: z.ZodString;
65
- vendor: z.ZodLiteral<"campbell">;
66
66
  }, z.core.$strict>;
67
67
  type CampbellStationConfig = z.output<typeof campbellStationConfigSchema>;
68
68
  type CustomStationIdentity = {
@@ -82,43 +82,50 @@ type CustomStationContext = {
82
82
  };
83
83
  type CustomStationLoader = (context: CustomStationContext) => Promise<Station>;
84
84
  declare const customStationConfigSchema: z.ZodObject<{
85
- load: z.ZodCustom<CustomStationLoader, CustomStationLoader>;
86
- timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
87
- pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
85
  elevationM: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
89
86
  latitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
90
87
  longitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
91
88
  id: z.ZodString;
92
89
  name: z.ZodString;
90
+ timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
91
+ pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
93
92
  vendor: z.ZodLiteral<"custom">;
93
+ load: z.ZodCustom<CustomStationLoader, CustomStationLoader>;
94
94
  }, z.core.$strict>;
95
95
  type CustomStationConfig = z.output<typeof customStationConfigSchema>;
96
96
  declare const stationConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
97
+ elevationM: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
98
+ latitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
99
+ longitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
100
+ id: z.ZodString;
101
+ name: z.ZodString;
102
+ timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
103
+ pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
104
+ vendor: z.ZodLiteral<"windnerd">;
97
105
  stationKey: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
98
106
  locationId: z.ZodNumber;
99
107
  hasTemperature: z.ZodDefault<z.ZodBoolean>;
100
108
  hasPressure: z.ZodDefault<z.ZodBoolean>;
101
109
  hasBattery: z.ZodDefault<z.ZodBoolean>;
102
- timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
103
- pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
110
+ }, z.core.$strict>, z.ZodObject<{
104
111
  elevationM: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
105
112
  latitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
106
113
  longitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
107
114
  id: z.ZodString;
108
115
  name: z.ZodString;
109
- vendor: z.ZodLiteral<"windnerd">;
110
- }, z.core.$strict>, z.ZodObject<{
111
- stationId: z.ZodNumber;
112
- token: z.ZodString;
113
116
  timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
114
117
  pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
118
+ vendor: z.ZodLiteral<"tempest">;
119
+ stationId: z.ZodNumber;
120
+ token: z.ZodString;
121
+ }, z.core.$strict>, z.ZodObject<{
115
122
  elevationM: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
116
123
  latitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
117
124
  longitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
118
125
  id: z.ZodString;
119
126
  name: z.ZodString;
120
- vendor: z.ZodLiteral<"tempest">;
121
- }, z.core.$strict>, z.ZodObject<{
127
+ pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
128
+ vendor: z.ZodLiteral<"campbell">;
122
129
  baseUrl: z.ZodString;
123
130
  source: z.ZodString;
124
131
  timeZone: z.ZodString;
@@ -127,36 +134,29 @@ declare const stationConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
127
134
  currentIntervalSeconds: z.ZodDefault<z.ZodNumber>;
128
135
  historyPeriodMinutes: z.ZodDefault<z.ZodNumber>;
129
136
  currentCacheTtlSeconds: z.ZodDefault<z.ZodNumber>;
130
- pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
137
+ }, z.core.$strict>, z.ZodObject<{
131
138
  elevationM: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
132
139
  latitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
133
140
  longitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
134
141
  id: z.ZodString;
135
142
  name: z.ZodString;
136
- vendor: z.ZodLiteral<"campbell">;
137
- }, z.core.$strict>, z.ZodObject<{
143
+ timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
144
+ pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
145
+ vendor: z.ZodLiteral<"ecowitt">;
138
146
  applicationKey: z.ZodString;
139
147
  apiKey: z.ZodString;
140
148
  mac: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
141
149
  hasBattery: z.ZodDefault<z.ZodBoolean>;
142
- timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
143
- pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
150
+ }, z.core.$strict>, z.ZodObject<{
144
151
  elevationM: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
145
152
  latitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
146
153
  longitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
147
154
  id: z.ZodString;
148
155
  name: z.ZodString;
149
- vendor: z.ZodLiteral<"ecowitt">;
150
- }, z.core.$strict>, z.ZodObject<{
151
- load: z.ZodCustom<CustomStationLoader, CustomStationLoader>;
152
156
  timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
153
157
  pageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
154
- elevationM: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
155
- latitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
156
- longitude: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
157
- id: z.ZodString;
158
- name: z.ZodString;
159
158
  vendor: z.ZodLiteral<"custom">;
159
+ load: z.ZodCustom<CustomStationLoader, CustomStationLoader>;
160
160
  }, z.core.$strict>], "vendor">;
161
161
  type StationConfig = z.output<typeof stationConfigSchema>;
162
162
  type StationConfigInput = z.input<typeof stationConfigSchema>;
@@ -101,8 +101,9 @@ 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}`,
@@ -1,4 +1,4 @@
1
- import { normalizeWindnerdStationKey, windnerdStationUrl } from "../windnerd.js";
1
+ import { WINDNERD_RECORD_PERIODS_MINUTES, WindnerdRecordPeriodMinutes, normalizeWindnerdStationKey, windnerdStationUrl } from "../windnerd.js";
2
2
  import { DEFAULT_USER_AGENT, FeedCache, LogEvent, LogEventCode, ResolvedEnvironment, ServerEnvironment, UPSTREAM_CONNECT_TIMEOUT_MS, UPSTREAM_FAILURE_REASONS, UPSTREAM_FETCH_TIMEOUT_MS, UPSTREAM_RESPONSE_LIMIT_BYTES, UpstreamError, UpstreamErrorReason, UpstreamFailureReason, UpstreamStreamRequest, UpstreamTextRequest, boundedResponseText, coalesceUpstreamLoad, fetchUpstreamStream, fetchUpstreamText, logUpstreamFailure, memoryCache, resolveEnvironment, unavailableReasonForError, workersCache } from "./environment.js";
3
3
  import { CampbellStationConfig, CustomStationConfig, CustomStationContext, CustomStationIdentity, CustomStationLoader, EcowittStationConfig, StationConfig, StationConfigInput, TempestStationConfig, WindnerdStationConfig, campbellStationConfigSchema, customStationConfigSchema, ecowittStationConfigSchema, parseStationConfig, stationConfigSchema, tempestStationConfigSchema, windnerdStationConfigSchema } from "./config.js";
4
4
  import { StationAdapter, StationAdapterContext, StationAdapterDefinition, StationAdapterMode, StationAdapterOptions, StationAdapterResult, defineStationAdapter } from "./adapter.js";
@@ -7,7 +7,7 @@ import { StationFeedHandler, StationFeedHandlerOptions, StationFeedHandlerRoute,
7
7
  import { STATION_LIVE_SSE_HEADERS, encodeStationLiveSse } from "./live.js";
8
8
  import { WindnerdLiveOptions, openWindnerdLive } from "./adapters/windnerd-live.js";
9
9
  import { CLIMATOLOGY_DEFAULT_SECTOR_COUNT, CLIMATOLOGY_DEFAULT_YEARS, CLIMATOLOGY_RECORD_PERIOD_MINUTES, WindnerdClimatologyOptions, loadWindnerdClimatology } from "./adapters/windnerd-climatology.js";
10
- import { WINDNERD_LIVE_SAMPLE_INTERVAL_SECONDS, WINDNERD_RECORD_PERIODS_MINUTES, WindnerdAdapterOptions, WindnerdHistoryQuery, WindnerdLiveDigest, WindnerdLiveInit, WindnerdLiveLocation, WindnerdLiveSampleRecord, WindnerdRecordPeriodMinutes, WindnerdRecords, loadWindnerdHistory, loadWindnerdStation, parseStandardTimeOffset, parseWindnerdLiveDigest, parseWindnerdLiveInit, parseWindnerdLiveLocation, parseWindnerdLiveSampleRecords, parseWindnerdRecentSummaries, parseWindnerdRecords, windnerdEnrichedMeta, windnerdHistoryPoints, windnerdLiveReading, windnerdLiveSamples, windnerdLiveStreamUrl } from "./adapters/windnerd.js";
10
+ import { WINDNERD_LIVE_SAMPLE_INTERVAL_SECONDS, WindnerdAdapterOptions, WindnerdHistoryQuery, WindnerdLiveDigest, WindnerdLiveInit, WindnerdLiveLocation, WindnerdLiveSampleRecord, WindnerdRecords, loadWindnerdHistory, loadWindnerdStation, parseStandardTimeOffset, parseWindnerdLiveDigest, parseWindnerdLiveInit, parseWindnerdLiveLocation, parseWindnerdLiveSampleRecords, parseWindnerdRecentSummaries, parseWindnerdRecords, windnerdEnrichedMeta, windnerdHistoryPoints, windnerdLiveReading, windnerdLiveSamples, windnerdLiveStreamUrl } from "./adapters/windnerd.js";
11
11
  import { HOLOGRAM_API_BASE, HologramConnectivityConfig, HologramConnectivityOptions, TRIAL_HOLOGRAM_CACHE_TTL_SECONDS, hologramConnectivityConfigSchema, hologramServiceState, hologramTimeToIso, loadHologramConnectivity, parseHologramConnectivity } from "./hologram.js";
12
12
  import { TempestAdapterOptions, TempestObservation, loadTempestStation, parseTempestWind } from "./adapters/tempest.js";
13
13
  import { EcowittAdapterOptions, EcowittObservation, loadEcowittStation, parseEcowittRealTime } from "./adapters/ecowitt.js";
@@ -1,10 +1,10 @@
1
- import { normalizeWindnerdStationKey, windnerdStationUrl } from "../windnerd.js";
1
+ import { WINDNERD_RECORD_PERIODS_MINUTES, normalizeWindnerdStationKey, windnerdStationUrl } from "../windnerd.js";
2
2
  import { DEFAULT_USER_AGENT, UPSTREAM_CONNECT_TIMEOUT_MS, UPSTREAM_FAILURE_REASONS, UPSTREAM_FETCH_TIMEOUT_MS, UPSTREAM_RESPONSE_LIMIT_BYTES, UpstreamError, boundedResponseText, coalesceUpstreamLoad, fetchUpstreamStream, fetchUpstreamText, logUpstreamFailure, memoryCache, resolveEnvironment, unavailableReasonForError, workersCache } from "./environment.js";
3
3
  import { campbellStationConfigSchema, customStationConfigSchema, ecowittStationConfigSchema, parseStationConfig, stationConfigSchema, tempestStationConfigSchema, windnerdStationConfigSchema } from "./config.js";
4
4
  import { CAMPBELL_FIELD_CONTRACTS, loadCampbellCurrent, loadCampbellStation, naiveLocalToIso, parseCampbellCurrent, parseCampbellHistory, parseCampbellTable } from "./adapters/campbell.js";
5
5
  import { loadEcowittStation, parseEcowittRealTime } from "./adapters/ecowitt.js";
6
6
  import { loadTempestStation, parseTempestWind } from "./adapters/tempest.js";
7
- import { WINDNERD_LIVE_SAMPLE_INTERVAL_SECONDS, WINDNERD_RECORD_PERIODS_MINUTES, loadWindnerdHistory, loadWindnerdStation, parseStandardTimeOffset, parseWindnerdLiveDigest, parseWindnerdLiveInit, parseWindnerdLiveLocation, parseWindnerdLiveSampleRecords, parseWindnerdRecentSummaries, parseWindnerdRecords, windnerdEnrichedMeta, windnerdHistoryPoints, windnerdLiveReading, windnerdLiveSamples, windnerdLiveStreamUrl } from "./adapters/windnerd.js";
7
+ import { WINDNERD_LIVE_SAMPLE_INTERVAL_SECONDS, loadWindnerdHistory, loadWindnerdStation, parseStandardTimeOffset, parseWindnerdLiveDigest, parseWindnerdLiveInit, parseWindnerdLiveLocation, parseWindnerdLiveSampleRecords, parseWindnerdRecentSummaries, parseWindnerdRecords, windnerdEnrichedMeta, windnerdHistoryPoints, windnerdLiveReading, windnerdLiveSamples, windnerdLiveStreamUrl } from "./adapters/windnerd.js";
8
8
  import { CLIMATOLOGY_DEFAULT_SECTOR_COUNT, CLIMATOLOGY_DEFAULT_YEARS, CLIMATOLOGY_RECORD_PERIOD_MINUTES, loadWindnerdClimatology } from "./adapters/windnerd-climatology.js";
9
9
  import { openWindnerdLive } from "./adapters/windnerd-live.js";
10
10
  import { DEFAULT_HISTORY_HOURS, StationClimatologyUnsupportedError, StationHistoryUnsupportedError, StationLiveUnsupportedError, UnknownStationError, assembleStations, loadStationClimatology, loadStationCurrent, loadStationFeed, loadStationHistory, openStationLive } from "./feed.js";
@@ -1,5 +1,7 @@
1
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];
2
4
  declare function normalizeWindnerdStationKey(value: string | null | undefined): string | null;
3
5
  declare function windnerdStationUrl(stationKey: string): string;
4
6
  //#endregion
5
- export { normalizeWindnerdStationKey, windnerdStationUrl };
7
+ export { WINDNERD_RECORD_PERIODS_MINUTES, WindnerdRecordPeriodMinutes, normalizeWindnerdStationKey, windnerdStationUrl };
package/dist/windnerd.js CHANGED
@@ -1,6 +1,16 @@
1
1
  //#region src/windnerd.ts
2
2
  const WINDNERD_HOST = "windnerd.net";
3
3
  const WINDNERD_KEY = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
4
+ const WINDNERD_RECORD_PERIODS_MINUTES = [
5
+ 1,
6
+ 5,
7
+ 10,
8
+ 15,
9
+ 30,
10
+ 60,
11
+ 180,
12
+ 360
13
+ ];
4
14
  function normalizeWindnerdStationKey(value) {
5
15
  const candidate = value?.trim();
6
16
  if (!candidate) return null;
@@ -22,4 +32,4 @@ function windnerdStationUrl(stationKey) {
22
32
  return `https://${WINDNERD_HOST}/en/${stationKey}`;
23
33
  }
24
34
  //#endregion
25
- export { normalizeWindnerdStationKey, windnerdStationUrl };
35
+ export { WINDNERD_RECORD_PERIODS_MINUTES, normalizeWindnerdStationKey, windnerdStationUrl };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@azohra/meteo.station",
3
- "version": "0.5.0",
4
- "description": "The station capability of meteo by Azohra: live weather-station reading, derivation, and display - the wire contract, provider adapters, a polling client, a Node server, and React and custom-element display bindings.",
3
+ "version": "0.7.0",
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",
7
7
  "wind",
@@ -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.2.0"
66
+ "@azohra/meteo.core": "0.3.1",
67
+ "zod": "^4.6.7"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "react": "^18.0.0 || ^19.0.0"
@@ -82,16 +82,11 @@
82
82
  "jsdom": "^26.0.0",
83
83
  "react": "^19.0.0",
84
84
  "react-dom": "^19.0.0",
85
- "typescript": "^5.6.0",
86
- "vitest": "^4.0.0"
85
+ "typescript": "^7.0.2",
86
+ "vitest": "^4.1.11"
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
@@ -1,9 +1,9 @@
1
1
  # Wire contract artifacts
2
2
 
3
3
  The station capability's wire contract in language-neutral form: JSON
4
- Schemas emitted from the zod contract (`station/contract.ts`), plus three
5
- annotated example documents. Never edited by hand — regenerate with
6
- `pnpm schemas` at the workspace root, which must reproduce every file
4
+ Schemas emitted from the zod contract (`station/contract.ts`), plus an
5
+ annotated example document beside each schema. Never edited by hand — regenerate with
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": {