@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.
- package/README.md +17 -17
- package/dist/air.d.ts +4 -7
- package/dist/air.js +1 -2
- package/dist/client/climatology.d.ts +4 -7
- package/dist/client/climatology.js +1 -2
- package/dist/client/history.d.ts +14 -17
- package/dist/client/history.js +1 -2
- package/dist/client/live.d.ts +9 -11
- package/dist/client/live.js +1 -2
- package/dist/client/poll.d.ts +9 -12
- package/dist/client/poll.js +1 -2
- package/dist/client/stores.d.ts +8 -10
- package/dist/client/stores.js +1 -2
- package/dist/client/ticker.d.ts +1 -4
- package/dist/client/ticker.js +1 -2
- package/dist/climatology.d.ts +13 -15
- package/dist/climatology.js +1 -2
- package/dist/connectivity.d.ts +9 -12
- package/dist/connectivity.js +1 -2
- package/dist/contract-climatology.d.ts +11 -14
- package/dist/contract-climatology.js +1 -2
- package/dist/contract.d.ts +148 -151
- package/dist/contract.js +1 -2
- package/dist/derive.d.ts +24 -26
- package/dist/derive.js +5 -6
- package/dist/display.d.ts +6 -9
- package/dist/display.js +1 -2
- package/dist/elements/elements/AirExtremesElement.d.ts +2 -5
- package/dist/elements/elements/AirExtremesElement.js +6 -20
- package/dist/elements/elements/AirMatrixElement.d.ts +2 -5
- package/dist/elements/elements/AirMatrixElement.js +7 -33
- package/dist/elements/elements/ClimatologyDailyPatternElement.d.ts +2 -5
- package/dist/elements/elements/ClimatologyDailyPatternElement.js +18 -14
- package/dist/elements/elements/ClimatologyRoseElement.d.ts +2 -5
- package/dist/elements/elements/ClimatologyRoseElement.js +6 -17
- package/dist/elements/elements/CompassFanElement.d.ts +2 -5
- package/dist/elements/elements/CompassFanElement.js +6 -66
- package/dist/elements/elements/CurrentConditionsElement.d.ts +2 -5
- package/dist/elements/elements/CurrentConditionsElement.js +8 -28
- package/dist/elements/elements/DailyPatternElement.d.ts +2 -6
- package/dist/elements/elements/DailyPatternElement.js +7 -122
- package/dist/elements/elements/DialElement.d.ts +2 -5
- package/dist/elements/elements/DialElement.js +4 -97
- package/dist/elements/elements/FavorableShareElement.d.ts +2 -5
- package/dist/elements/elements/FavorableShareElement.js +7 -23
- package/dist/elements/elements/FreshnessBadgeElement.d.ts +2 -5
- package/dist/elements/elements/FreshnessBadgeElement.js +1 -2
- package/dist/elements/elements/RecentSummariesElement.d.ts +2 -5
- package/dist/elements/elements/RecentSummariesElement.js +7 -25
- package/dist/elements/elements/SparklineElement.d.ts +2 -6
- package/dist/elements/elements/SparklineElement.js +5 -41
- package/dist/elements/elements/StationCardElement.d.ts +6 -8
- package/dist/elements/elements/StationCardElement.js +5 -20
- package/dist/elements/elements/StationFeedElement.d.ts +2 -5
- package/dist/elements/elements/StationFeedElement.js +5 -4
- package/dist/elements/elements/StationStripElement.d.ts +2 -5
- package/dist/elements/elements/StationStripElement.js +5 -20
- package/dist/elements/elements/StationTableElement.d.ts +3 -6
- package/dist/elements/elements/StationTableElement.js +16 -53
- package/dist/elements/elements/TrendChartElement.d.ts +2 -5
- package/dist/elements/elements/TrendChartElement.js +22 -71
- package/dist/elements/elements/WindArrowElement.d.ts +2 -5
- package/dist/elements/elements/WindArrowElement.js +1 -2
- package/dist/elements/elements/WindHistoryChartElement.d.ts +2 -5
- package/dist/elements/elements/WindHistoryChartElement.js +24 -166
- package/dist/elements/elements/WindRoseElement.d.ts +2 -6
- package/dist/elements/elements/WindRoseElement.js +7 -72
- package/dist/elements/elements/atoms.d.ts +10 -12
- package/dist/elements/elements/atoms.js +12 -40
- package/dist/elements/index.d.ts +3 -5
- package/dist/elements/index.js +4 -5
- package/dist/elements/lib/ambient.d.ts +2 -5
- package/dist/elements/lib/ambient.js +1 -2
- package/dist/elements/lib/attributes.js +1 -2
- package/dist/elements/lib/base.d.ts +3 -6
- package/dist/elements/lib/base.js +1 -2
- package/dist/elements/lib/context.js +1 -2
- package/dist/elements/lib/fragments.js +9 -39
- package/dist/elements/lib/h.js +2 -3
- package/dist/elements/lib/pinned-cursor.js +1 -2
- package/dist/elements/lib/render.js +29 -0
- package/dist/elements/register.js +1 -2
- package/dist/endpoints.d.ts +6 -9
- package/dist/endpoints.js +1 -2
- package/dist/fixtures.d.ts +7 -10
- package/dist/fixtures.js +1 -2
- package/dist/format.d.ts +11 -14
- package/dist/format.js +1 -2
- package/dist/geometry.d.ts +36 -38
- package/dist/geometry.js +3 -3
- package/dist/instruments.d.ts +37 -40
- package/dist/instruments.js +3 -4
- package/dist/merge-current.d.ts +4 -7
- package/dist/merge-current.js +1 -2
- package/dist/react/components/AirExtremes.d.ts +2 -5
- package/dist/react/components/AirExtremes.js +6 -24
- package/dist/react/components/AirMatrix.d.ts +2 -5
- package/dist/react/components/AirMatrix.js +11 -45
- package/dist/react/components/ClimatologyDailyPattern.d.ts +2 -5
- package/dist/react/components/ClimatologyDailyPattern.js +20 -15
- package/dist/react/components/ClimatologyRose.d.ts +2 -5
- package/dist/react/components/ClimatologyRose.js +12 -30
- package/dist/react/components/CompassFan.d.ts +2 -5
- package/dist/react/components/CompassFan.js +7 -75
- package/dist/react/components/CurrentConditions.d.ts +2 -5
- package/dist/react/components/CurrentConditions.js +12 -76
- package/dist/react/components/DailyPattern.d.ts +3 -8
- package/dist/react/components/DailyPattern.js +11 -151
- package/dist/react/components/Dial.d.ts +2 -5
- package/dist/react/components/Dial.js +6 -120
- package/dist/react/components/FavorableShare.d.ts +2 -5
- package/dist/react/components/FavorableShare.js +7 -29
- package/dist/react/components/FreshnessBadge.d.ts +2 -5
- package/dist/react/components/FreshnessBadge.js +6 -14
- package/dist/react/components/Readout.d.ts +2 -5
- package/dist/react/components/Readout.js +1 -2
- package/dist/react/components/RecentSummaries.d.ts +2 -5
- package/dist/react/components/RecentSummaries.js +7 -46
- package/dist/react/components/SceneTree.js +37 -0
- package/dist/react/components/Sparkline.d.ts +2 -5
- package/dist/react/components/Sparkline.js +4 -41
- package/dist/react/components/StationCard.d.ts +8 -10
- package/dist/react/components/StationCard.js +6 -47
- package/dist/react/components/StationFeedProvider.d.ts +3 -6
- package/dist/react/components/StationFeedProvider.js +1 -2
- package/dist/react/components/StationStrip.d.ts +2 -5
- package/dist/react/components/StationStrip.js +6 -62
- package/dist/react/components/StationTable.d.ts +3 -6
- package/dist/react/components/StationTable.js +22 -77
- package/dist/react/components/TrendChart.d.ts +2 -5
- package/dist/react/components/TrendChart.js +9 -65
- package/dist/react/components/WindArrow.d.ts +2 -5
- package/dist/react/components/WindArrow.js +4 -17
- package/dist/react/components/WindHistoryChart.d.ts +2 -5
- package/dist/react/components/WindHistoryChart.js +9 -184
- package/dist/react/components/WindRose.d.ts +2 -7
- package/dist/react/components/WindRose.js +7 -91
- package/dist/react/components/WindSampleStrip.d.ts +2 -5
- package/dist/react/components/WindSampleStrip.js +9 -117
- package/dist/react/components/atoms.d.ts +12 -14
- package/dist/react/components/atoms.js +13 -50
- package/dist/react/hooks/useFreshness.d.ts +1 -4
- package/dist/react/hooks/useFreshness.js +1 -2
- package/dist/react/hooks/useMeasuredChartWidth.d.ts +2 -5
- package/dist/react/hooks/useMeasuredChartWidth.js +1 -2
- package/dist/react/hooks/usePolledJson.js +1 -2
- package/dist/react/hooks/useStation.d.ts +2 -5
- package/dist/react/hooks/useStation.js +1 -2
- package/dist/react/hooks/useStationClimatology.d.ts +2 -5
- package/dist/react/hooks/useStationClimatology.js +1 -2
- package/dist/react/hooks/useStationCurrent.d.ts +2 -5
- package/dist/react/hooks/useStationCurrent.js +4 -4
- package/dist/react/hooks/useStationFeed.d.ts +2 -5
- package/dist/react/hooks/useStationFeed.js +4 -4
- package/dist/react/hooks/useStationLive.d.ts +2 -5
- package/dist/react/hooks/useStationLive.js +1 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +5 -5
- package/dist/react/lib/cells.js +5 -26
- package/dist/react/lib/use-pinned-cursor.js +1 -2
- package/dist/samples.d.ts +8 -11
- package/dist/samples.js +1 -2
- package/dist/scene/air-extremes.js +13 -29
- package/dist/scene/air-matrix.js +46 -60
- package/dist/scene/atoms.js +1 -2
- package/dist/scene/card.js +15 -42
- package/dist/scene/cells.d.ts +4 -0
- package/dist/scene/cells.js +50 -0
- package/dist/scene/chart.d.ts +2 -5
- package/dist/scene/chart.js +3 -3
- package/dist/scene/climatology-pattern.d.ts +1 -2
- package/dist/scene/climatology-pattern.js +11 -13
- package/dist/scene/climatology-rose.d.ts +1 -2
- package/dist/scene/climatology-rose.js +15 -35
- package/dist/scene/compass-fan.js +29 -102
- package/dist/scene/current.d.ts +2 -1
- package/dist/scene/current.js +30 -58
- package/dist/scene/daily-pattern.d.ts +1 -3
- package/dist/scene/daily-pattern.js +21 -29
- package/dist/scene/dial-parts.d.ts +1 -0
- package/dist/scene/dial-parts.js +69 -0
- package/dist/scene/dial.d.ts +1 -2
- package/dist/scene/dial.js +49 -138
- package/dist/scene/favorable-share.js +17 -35
- package/dist/scene/glyphs.js +21 -18
- package/dist/scene/index.d.ts +5 -3
- package/dist/scene/node.js +18 -0
- package/dist/scene/recent-summaries.js +27 -65
- package/dist/scene/rose.js +90 -119
- package/dist/scene/sample-strip.d.ts +1 -2
- package/dist/scene/sample-strip.js +36 -38
- package/dist/scene/sparkline.js +32 -42
- package/dist/scene/strip.js +19 -59
- package/dist/scene/table.js +48 -71
- package/dist/scene/trend.d.ts +1 -2
- package/dist/scene/trend.js +30 -57
- package/dist/scene/wind-history.d.ts +1 -2
- package/dist/scene/wind-history.js +42 -53
- package/dist/scene/wind-plot.js +71 -142
- package/dist/server/adapter.d.ts +7 -10
- package/dist/server/adapter.js +1 -2
- package/dist/server/adapters/campbell.d.ts +18 -20
- package/dist/server/adapters/campbell.js +2 -3
- package/dist/server/adapters/ecowitt.d.ts +12 -15
- package/dist/server/adapters/ecowitt.js +1 -2
- package/dist/server/adapters/tempest.d.ts +10 -13
- package/dist/server/adapters/tempest.js +1 -2
- package/dist/server/adapters/windnerd-climatology.d.ts +5 -8
- package/dist/server/adapters/windnerd-climatology.js +5 -5
- package/dist/server/adapters/windnerd-live.d.ts +2 -5
- package/dist/server/adapters/windnerd-live.js +4 -4
- package/dist/server/adapters/windnerd.d.ts +30 -33
- package/dist/server/adapters/windnerd.js +2 -3
- package/dist/server/config.d.ts +61 -63
- package/dist/server/config.js +1 -2
- package/dist/server/environment.d.ts +20 -22
- package/dist/server/environment.js +1 -2
- package/dist/server/feed.d.ts +19 -21
- package/dist/server/feed.js +1 -2
- package/dist/server/handler.d.ts +4 -7
- package/dist/server/handler.js +1 -2
- package/dist/server/hologram.d.ts +9 -12
- package/dist/server/hologram.js +3 -3
- package/dist/server/live.d.ts +2 -5
- package/dist/server/live.js +1 -2
- package/dist/sse.js +1 -2
- package/dist/strings.d.ts +8 -11
- package/dist/strings.js +1 -2
- package/dist/windnerd.d.ts +4 -7
- package/dist/windnerd.js +1 -2
- package/package.json +12 -17
- package/schema/README.md +1 -1
- package/schema/stationclimatology.schema.json +64 -61
- package/schema/stationcurrent.schema.json +68 -156
- package/schema/stationfeed.schema.json +71 -163
- package/schema/stationhistory.schema.json +37 -46
- package/schema/stationlive.schema.json +221 -306
package/dist/server/handler.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
5
|
-
declare const
|
|
6
|
-
declare const
|
|
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>;
|
package/dist/server/hologram.js
CHANGED
|
@@ -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
|
-
|
|
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: `${
|
|
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 };
|
package/dist/server/live.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { StationLiveFrame } from "../contract.js";
|
|
2
|
-
|
|
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>;
|
package/dist/server/live.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 };
|
package/dist/windnerd.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare function
|
|
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
|
-
|
|
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.
|
|
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
|
-
"
|
|
67
|
-
"
|
|
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.
|
|
79
|
-
"@types/node": "^22.
|
|
80
|
-
"@types/react": "^19.
|
|
81
|
-
"@types/react-dom": "^19.
|
|
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.
|
|
84
|
-
"react-dom": "^19.
|
|
85
|
-
"typescript": "^
|
|
86
|
-
"vitest": "^
|
|
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
|
-
`
|
|
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
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"type": "
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
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
|
-
"
|
|
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": {
|