@azohra/meteo.station 0.7.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/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 +7 -10
- 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 +45 -48
- package/dist/contract.js +1 -2
- package/dist/derive.d.ts +24 -26
- package/dist/derive.js +1 -2
- 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 +1 -2
- package/dist/elements/elements/AirMatrixElement.d.ts +2 -5
- package/dist/elements/elements/AirMatrixElement.js +1 -2
- package/dist/elements/elements/ClimatologyDailyPatternElement.d.ts +2 -5
- package/dist/elements/elements/ClimatologyDailyPatternElement.js +1 -2
- package/dist/elements/elements/ClimatologyRoseElement.d.ts +2 -5
- package/dist/elements/elements/ClimatologyRoseElement.js +1 -2
- package/dist/elements/elements/CompassFanElement.d.ts +2 -5
- package/dist/elements/elements/CompassFanElement.js +1 -2
- package/dist/elements/elements/CurrentConditionsElement.d.ts +2 -5
- package/dist/elements/elements/CurrentConditionsElement.js +1 -2
- package/dist/elements/elements/DailyPatternElement.d.ts +2 -5
- package/dist/elements/elements/DailyPatternElement.js +1 -2
- package/dist/elements/elements/DialElement.d.ts +2 -5
- package/dist/elements/elements/DialElement.js +1 -2
- package/dist/elements/elements/FavorableShareElement.d.ts +2 -5
- package/dist/elements/elements/FavorableShareElement.js +1 -2
- 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 +1 -2
- package/dist/elements/elements/SparklineElement.d.ts +2 -5
- package/dist/elements/elements/SparklineElement.js +1 -2
- package/dist/elements/elements/StationCardElement.d.ts +6 -8
- package/dist/elements/elements/StationCardElement.js +1 -2
- package/dist/elements/elements/StationFeedElement.d.ts +2 -5
- package/dist/elements/elements/StationFeedElement.js +1 -2
- package/dist/elements/elements/StationStripElement.d.ts +2 -5
- package/dist/elements/elements/StationStripElement.js +1 -2
- package/dist/elements/elements/StationTableElement.d.ts +3 -6
- package/dist/elements/elements/StationTableElement.js +1 -2
- package/dist/elements/elements/TrendChartElement.d.ts +2 -5
- package/dist/elements/elements/TrendChartElement.js +1 -2
- 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 +1 -2
- package/dist/elements/elements/WindRoseElement.d.ts +2 -5
- package/dist/elements/elements/WindRoseElement.js +1 -2
- package/dist/elements/elements/atoms.d.ts +9 -11
- package/dist/elements/elements/atoms.js +1 -2
- package/dist/elements/index.d.ts +3 -5
- package/dist/elements/index.js +1 -2
- 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 +1 -2
- package/dist/elements/lib/h.js +1 -2
- package/dist/elements/lib/pinned-cursor.js +1 -2
- package/dist/elements/lib/render.js +1 -2
- 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 +1 -2
- package/dist/instruments.d.ts +37 -40
- package/dist/instruments.js +1 -2
- 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 +1 -2
- package/dist/react/components/AirMatrix.d.ts +2 -5
- package/dist/react/components/AirMatrix.js +1 -2
- package/dist/react/components/ClimatologyDailyPattern.d.ts +2 -5
- package/dist/react/components/ClimatologyDailyPattern.js +1 -2
- package/dist/react/components/ClimatologyRose.d.ts +2 -5
- package/dist/react/components/ClimatologyRose.js +1 -2
- package/dist/react/components/CompassFan.d.ts +2 -5
- package/dist/react/components/CompassFan.js +1 -2
- package/dist/react/components/CurrentConditions.d.ts +2 -5
- package/dist/react/components/CurrentConditions.js +1 -2
- package/dist/react/components/DailyPattern.d.ts +2 -5
- package/dist/react/components/DailyPattern.js +1 -2
- package/dist/react/components/Dial.d.ts +2 -5
- package/dist/react/components/Dial.js +1 -2
- package/dist/react/components/FavorableShare.d.ts +2 -5
- package/dist/react/components/FavorableShare.js +1 -2
- package/dist/react/components/FreshnessBadge.d.ts +2 -5
- package/dist/react/components/FreshnessBadge.js +1 -2
- 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 +1 -2
- package/dist/react/components/SceneTree.js +1 -2
- package/dist/react/components/Sparkline.d.ts +2 -5
- package/dist/react/components/Sparkline.js +1 -2
- package/dist/react/components/StationCard.d.ts +6 -8
- package/dist/react/components/StationCard.js +1 -2
- 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 +1 -2
- package/dist/react/components/StationTable.d.ts +3 -6
- package/dist/react/components/StationTable.js +1 -2
- package/dist/react/components/TrendChart.d.ts +2 -5
- package/dist/react/components/TrendChart.js +1 -2
- package/dist/react/components/WindArrow.d.ts +2 -5
- package/dist/react/components/WindArrow.js +1 -2
- package/dist/react/components/WindHistoryChart.d.ts +2 -5
- package/dist/react/components/WindHistoryChart.js +1 -2
- package/dist/react/components/WindRose.d.ts +2 -5
- package/dist/react/components/WindRose.js +1 -2
- package/dist/react/components/WindSampleStrip.d.ts +2 -5
- package/dist/react/components/WindSampleStrip.js +1 -2
- package/dist/react/components/atoms.d.ts +9 -11
- package/dist/react/components/atoms.js +1 -2
- 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 +1 -2
- package/dist/react/hooks/useStationFeed.d.ts +2 -5
- package/dist/react/hooks/useStationFeed.js +1 -2
- package/dist/react/hooks/useStationLive.d.ts +2 -5
- package/dist/react/hooks/useStationLive.js +1 -2
- package/dist/react/lib/cells.js +1 -2
- 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 +1 -2
- package/dist/scene/air-matrix.js +1 -2
- package/dist/scene/atoms.js +1 -2
- package/dist/scene/card.js +1 -2
- package/dist/scene/cells.js +1 -2
- package/dist/scene/chart.d.ts +2 -5
- package/dist/scene/chart.js +1 -2
- package/dist/scene/climatology-pattern.js +1 -2
- package/dist/scene/climatology-rose.js +1 -2
- package/dist/scene/compass-fan.js +1 -2
- package/dist/scene/current.js +1 -2
- package/dist/scene/daily-pattern.js +1 -2
- package/dist/scene/dial-parts.js +1 -2
- package/dist/scene/dial.js +1 -2
- package/dist/scene/favorable-share.js +1 -2
- package/dist/scene/glyphs.js +1 -2
- package/dist/scene/node.js +1 -2
- package/dist/scene/recent-summaries.js +1 -2
- package/dist/scene/rose.js +1 -2
- package/dist/scene/sample-strip.js +1 -2
- package/dist/scene/sparkline.js +1 -2
- package/dist/scene/strip.js +1 -2
- package/dist/scene/table.js +1 -2
- package/dist/scene/trend.js +1 -2
- package/dist/scene/wind-history.js +1 -2
- package/dist/scene/wind-plot.js +1 -2
- package/dist/server/adapter.d.ts +7 -10
- package/dist/server/adapter.js +1 -2
- package/dist/server/adapters/campbell.d.ts +11 -13
- package/dist/server/adapters/campbell.js +1 -2
- package/dist/server/adapters/ecowitt.d.ts +4 -7
- package/dist/server/adapters/ecowitt.js +1 -2
- package/dist/server/adapters/tempest.d.ts +4 -7
- 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 +1 -2
- package/dist/server/adapters/windnerd-live.d.ts +2 -5
- package/dist/server/adapters/windnerd-live.js +1 -2
- package/dist/server/adapters/windnerd.d.ts +22 -25
- package/dist/server/adapters/windnerd.js +1 -2
- package/dist/server/config.d.ts +18 -20
- 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 +1 -2
- 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 +9 -9
package/dist/air.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { AirConditions } from "./contract.js";
|
|
2
2
|
import { FormatTime, StationStrings } from "./strings.js";
|
|
3
|
-
|
|
4
|
-
declare function
|
|
5
|
-
|
|
6
|
-
type AirRow = {
|
|
3
|
+
export declare function airSummary(conditions: AirConditions, strings?: StationStrings): string;
|
|
4
|
+
export declare function lastStrikeWords(conditions: AirConditions, formatTime: FormatTime, strings?: StationStrings): string;
|
|
5
|
+
export type AirRow = {
|
|
7
6
|
label: string;
|
|
8
7
|
unit: string;
|
|
9
8
|
value: (conditions: AirConditions) => string | null;
|
|
10
9
|
};
|
|
11
|
-
declare function airRows(words: StationStrings): AirRow[];
|
|
12
|
-
//#endregion
|
|
13
|
-
export { AirRow, airRows, airSummary, lastStrikeWords };
|
|
10
|
+
export declare function airRows(words: StationStrings): AirRow[];
|
package/dist/air.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defaultStrings } from "./strings.js";
|
|
2
|
-
|
|
2
|
+
// src/air.ts
|
|
3
3
|
const round1 = (value) => Math.round(value * 10) / 10;
|
|
4
4
|
function airSummary(conditions, strings = defaultStrings) {
|
|
5
5
|
const words = strings.air;
|
|
@@ -72,5 +72,4 @@ function airRows(words) {
|
|
|
72
72
|
}
|
|
73
73
|
];
|
|
74
74
|
}
|
|
75
|
-
//#endregion
|
|
76
75
|
export { airRows, airSummary, lastStrikeWords };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { PollError } from "./poll.js";
|
|
2
2
|
import { StationClimatology } from "../contract-climatology.js";
|
|
3
|
-
|
|
4
|
-
type StationClimatologySnapshot = {
|
|
3
|
+
export type StationClimatologySnapshot = {
|
|
5
4
|
document: StationClimatology | null;
|
|
6
5
|
receivedAtMs: number | null;
|
|
7
6
|
loading: boolean;
|
|
8
7
|
error: PollError | null;
|
|
9
8
|
};
|
|
10
|
-
type StationClimatologyStore = {
|
|
9
|
+
export type StationClimatologyStore = {
|
|
11
10
|
getSnapshot(): StationClimatologySnapshot;
|
|
12
11
|
subscribe(listener: () => void): () => void;
|
|
13
12
|
/** Fetches once; further calls while a document is held are no-ops. */
|
|
@@ -20,8 +19,6 @@ type StationClimatologyStore = {
|
|
|
20
19
|
* needs no poller. Every filter interaction re-aggregates the held cube
|
|
21
20
|
* client-side; only load()/refresh() touch the network.
|
|
22
21
|
*/
|
|
23
|
-
declare function createStationClimatologyStore(url: string, options?: {
|
|
22
|
+
export declare function createStationClimatologyStore(url: string, options?: {
|
|
24
23
|
fetchInit?: RequestInit;
|
|
25
|
-
}): StationClimatologyStore;
|
|
26
|
-
//#endregion
|
|
27
|
-
export { StationClimatologySnapshot, StationClimatologyStore, createStationClimatologyStore };
|
|
24
|
+
}): StationClimatologyStore;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseStationClimatologyJson } from "../contract-climatology.js";
|
|
2
2
|
import { REQUEST_TIMEOUT_MS } from "./poll.js";
|
|
3
|
-
|
|
3
|
+
// src/client/climatology.ts
|
|
4
4
|
/**
|
|
5
5
|
* Fetch-once store for the climatology document: near-immutable history
|
|
6
6
|
* needs no poller. Every filter interaction re-aggregates the held cube
|
|
@@ -79,5 +79,4 @@ function createStationClimatologyStore(url, options = {}) {
|
|
|
79
79
|
refresh
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
|
-
//#endregion
|
|
83
82
|
export { createStationClimatologyStore };
|
package/dist/client/history.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { StationHistory } from "../contract.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type StationHistoryQuery = {
|
|
2
|
+
export declare const HISTORY_STORE_DEFAULT_MAX_WINDOWS = 32;
|
|
3
|
+
export type StationHistoryQuery = {
|
|
5
4
|
fromMs: number;
|
|
6
5
|
toMs: number;
|
|
7
6
|
periodMinutes: number;
|
|
@@ -9,10 +8,10 @@ type StationHistoryQuery = {
|
|
|
9
8
|
/** One requested window in, one parsed document (or null on failure) out.
|
|
10
9
|
* A host that mounts the feed handler uses `stationHistoryFetcher`; a host
|
|
11
10
|
* serving history its own way supplies any function of this shape. */
|
|
12
|
-
type StationHistoryFetcher = (query: StationHistoryQuery) => Promise<StationHistory | null>;
|
|
11
|
+
export type StationHistoryFetcher = (query: StationHistoryQuery) => Promise<StationHistory | null>;
|
|
13
12
|
/** The default fetcher, against the mounted handler's /history route. */
|
|
14
|
-
declare function stationHistoryFetcher(base: string, stationId: string, fetchInit?: RequestInit): StationHistoryFetcher;
|
|
15
|
-
type StationHistoryStore = {
|
|
13
|
+
export declare function stationHistoryFetcher(base: string, stationId: string, fetchInit?: RequestInit): StationHistoryFetcher;
|
|
14
|
+
export type StationHistoryStore = {
|
|
16
15
|
/** The window's document — cache-served when held, deduplicated while in
|
|
17
16
|
* flight. A failed fetch resolves null and is not cached, so the next
|
|
18
17
|
* ask retries. */
|
|
@@ -21,27 +20,25 @@ type StationHistoryStore = {
|
|
|
21
20
|
size(): number;
|
|
22
21
|
};
|
|
23
22
|
/** A window-keyed LRU over a fetcher, so pan/zoom revisits cost nothing. */
|
|
24
|
-
declare function createStationHistoryStore(fetcher: StationHistoryFetcher, options?: {
|
|
23
|
+
export declare function createStationHistoryStore(fetcher: StationHistoryFetcher, options?: {
|
|
25
24
|
maxWindows?: number;
|
|
26
25
|
}): StationHistoryStore;
|
|
27
|
-
declare const ARCHIVE_DEFAULT_PERIODS_MINUTES: readonly [1, 5, 10, 15, 30, 60, 180, 360];
|
|
28
|
-
declare const ARCHIVE_TARGET_POINTS = 500;
|
|
29
|
-
type ArchiveWindow = {
|
|
26
|
+
export declare const ARCHIVE_DEFAULT_PERIODS_MINUTES: readonly [1, 5, 10, 15, 30, 60, 180, 360];
|
|
27
|
+
export declare const ARCHIVE_TARGET_POINTS = 500;
|
|
28
|
+
export type ArchiveWindow = {
|
|
30
29
|
fromMs: number;
|
|
31
30
|
toMs: number;
|
|
32
31
|
};
|
|
33
32
|
/** The finest ladder period that keeps the span at or under the point
|
|
34
33
|
* target; a span too wide for every rung takes the coarsest. */
|
|
35
|
-
declare function archivePeriodFor(spanMs: number, periods?: ReadonlyArray<number>, targetPoints?: number): number;
|
|
34
|
+
export declare function archivePeriodFor(spanMs: number, periods?: ReadonlyArray<number>, targetPoints?: number): number;
|
|
36
35
|
/** One whole LOCAL day from a YYYY-MM-DD date-input value (not the UTC
|
|
37
36
|
* day); null when the value is not a real date. */
|
|
38
|
-
declare function archiveDayWindow(dateValue: string): ArchiveWindow | null;
|
|
37
|
+
export declare function archiveDayWindow(dateValue: string): ArchiveWindow | null;
|
|
39
38
|
/** The YYYY-MM-DD value naming an instant's local day. */
|
|
40
|
-
declare function archiveDayValue(atMs: number): string;
|
|
39
|
+
export declare function archiveDayValue(atMs: number): string;
|
|
41
40
|
/** The day value deltaDays away. Steps through noon so a DST-shifted
|
|
42
41
|
* midnight cannot skip a day; null for an invalid value. */
|
|
43
|
-
declare function archiveDayStep(dateValue: string, deltaDays: number): string | null;
|
|
42
|
+
export declare function archiveDayStep(dateValue: string, deltaDays: number): string | null;
|
|
44
43
|
/** The trailing 24 h ending at nowMs. */
|
|
45
|
-
declare function archiveTrailingWindow(nowMs: number, spanMs?: number): ArchiveWindow;
|
|
46
|
-
//#endregion
|
|
47
|
-
export { ARCHIVE_DEFAULT_PERIODS_MINUTES, ARCHIVE_TARGET_POINTS, ArchiveWindow, HISTORY_STORE_DEFAULT_MAX_WINDOWS, StationHistoryFetcher, StationHistoryQuery, StationHistoryStore, archiveDayStep, archiveDayValue, archiveDayWindow, archivePeriodFor, archiveTrailingWindow, createStationHistoryStore, stationHistoryFetcher };
|
|
44
|
+
export declare function archiveTrailingWindow(nowMs: number, spanMs?: number): ArchiveWindow;
|
package/dist/client/history.js
CHANGED
|
@@ -2,7 +2,7 @@ import { parseStationHistoryJson } from "../contract.js";
|
|
|
2
2
|
import { historyEndpoint } from "../endpoints.js";
|
|
3
3
|
import { WINDNERD_RECORD_PERIODS_MINUTES } from "../windnerd.js";
|
|
4
4
|
import { REQUEST_TIMEOUT_MS } from "./poll.js";
|
|
5
|
-
|
|
5
|
+
// src/client/history.ts
|
|
6
6
|
const HISTORY_STORE_DEFAULT_MAX_WINDOWS = 32;
|
|
7
7
|
/** The default fetcher, against the mounted handler's /history route. */
|
|
8
8
|
function stationHistoryFetcher(base, stationId, fetchInit) {
|
|
@@ -100,5 +100,4 @@ function archiveTrailingWindow(nowMs, spanMs = DAY_MS) {
|
|
|
100
100
|
toMs: nowMs
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
//#endregion
|
|
104
103
|
export { ARCHIVE_DEFAULT_PERIODS_MINUTES, ARCHIVE_TARGET_POINTS, HISTORY_STORE_DEFAULT_MAX_WINDOWS, archiveDayStep, archiveDayValue, archiveDayWindow, archivePeriodFor, archiveTrailingWindow, createStationHistoryStore, stationHistoryFetcher };
|
package/dist/client/live.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { PollError } from "./poll.js";
|
|
2
2
|
import { LiveSample, Station, StationCurrent } from "../contract.js";
|
|
3
|
-
|
|
4
|
-
declare const
|
|
5
|
-
declare const
|
|
6
|
-
|
|
7
|
-
type
|
|
8
|
-
type StationLiveSnapshot = {
|
|
3
|
+
export declare const LIVE_BACKOFF_MIN_MS = 1000;
|
|
4
|
+
export declare const LIVE_BACKOFF_MAX_MS = 30000;
|
|
5
|
+
export declare const LIVE_IDLE_RECONNECT_MS = 60000;
|
|
6
|
+
export type LiveStatus = "connecting" | "open" | "backoff" | "stopped";
|
|
7
|
+
export type StationLiveSnapshot = {
|
|
9
8
|
status: LiveStatus;
|
|
10
9
|
station: Station | null;
|
|
11
10
|
samples: LiveSample[];
|
|
@@ -14,7 +13,7 @@ type StationLiveSnapshot = {
|
|
|
14
13
|
receivedAtMs: number | null;
|
|
15
14
|
error: PollError | null;
|
|
16
15
|
};
|
|
17
|
-
type StationLiveStore = {
|
|
16
|
+
export type StationLiveStore = {
|
|
18
17
|
getSnapshot(): StationLiveSnapshot;
|
|
19
18
|
subscribe(listener: () => void): () => void;
|
|
20
19
|
start(): void;
|
|
@@ -29,10 +28,9 @@ type FetchInitOption = RequestInit | (() => RequestInit | undefined);
|
|
|
29
28
|
* disconnect and reconnect on return; a reconnect's fresh init frame heals
|
|
30
29
|
* any gap the ring can cover.
|
|
31
30
|
*/
|
|
32
|
-
declare function createStationLiveStore(base: string, stationId: string, options?: {
|
|
31
|
+
export declare function createStationLiveStore(base: string, stationId: string, options?: {
|
|
33
32
|
fetchInit?: FetchInitOption;
|
|
34
33
|
windowSeconds?: number;
|
|
35
34
|
}): StationLiveStore;
|
|
36
|
-
declare function liveSnapshotToCurrent(live: Pick<StationLiveSnapshot, "station" | "servedAt" | "samples" | "sampleIntervalSeconds">): StationCurrent | null;
|
|
37
|
-
|
|
38
|
-
export { LIVE_BACKOFF_MAX_MS, LIVE_BACKOFF_MIN_MS, LIVE_IDLE_RECONNECT_MS, LiveStatus, StationLiveSnapshot, StationLiveStore, createStationLiveStore, liveSnapshotToCurrent };
|
|
35
|
+
export declare function liveSnapshotToCurrent(live: Pick<StationLiveSnapshot, "station" | "servedAt" | "samples" | "sampleIntervalSeconds">): StationCurrent | null;
|
|
36
|
+
export {};
|
package/dist/client/live.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseStationLiveFrameJson } from "../contract.js";
|
|
2
2
|
import { liveEndpoint } from "../endpoints.js";
|
|
3
3
|
import { sseEvents } from "../sse.js";
|
|
4
|
-
|
|
4
|
+
// src/client/live.ts
|
|
5
5
|
const LIVE_BACKOFF_MIN_MS = 1e3;
|
|
6
6
|
const LIVE_BACKOFF_MAX_MS = 3e4;
|
|
7
7
|
const LIVE_IDLE_RECONNECT_MS = 6e4;
|
|
@@ -255,5 +255,4 @@ function mergeSamples(existing, incoming, windowSeconds) {
|
|
|
255
255
|
const cutoffMs = Date.parse(latest.observedAt) - windowSeconds * 1e3;
|
|
256
256
|
return merged.filter((sample) => Date.parse(sample.observedAt) >= cutoffMs);
|
|
257
257
|
}
|
|
258
|
-
//#endregion
|
|
259
258
|
export { LIVE_BACKOFF_MAX_MS, LIVE_BACKOFF_MIN_MS, LIVE_IDLE_RECONNECT_MS, createStationLiveStore, liveSnapshotToCurrent };
|
package/dist/client/poll.d.ts
CHANGED
|
@@ -1,42 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
type PollError = {
|
|
1
|
+
export type PollError = {
|
|
3
2
|
kind: "network";
|
|
4
3
|
status?: number;
|
|
5
4
|
} | {
|
|
6
5
|
kind: "contract";
|
|
7
6
|
cause?: unknown;
|
|
8
7
|
};
|
|
9
|
-
type ParseOutcome<T> = {
|
|
8
|
+
export type ParseOutcome<T> = {
|
|
10
9
|
ok: true;
|
|
11
10
|
data: T;
|
|
12
11
|
} | {
|
|
13
12
|
ok: false;
|
|
14
13
|
cause: unknown;
|
|
15
14
|
};
|
|
16
|
-
type PollSeed<T> = {
|
|
15
|
+
export type PollSeed<T> = {
|
|
17
16
|
data: T;
|
|
18
17
|
receivedAtMs: number;
|
|
19
18
|
};
|
|
20
|
-
type PollSnapshot<T> = {
|
|
19
|
+
export type PollSnapshot<T> = {
|
|
21
20
|
data: T | null;
|
|
22
21
|
error: PollError | null;
|
|
23
22
|
receivedAtMs: number | null;
|
|
24
23
|
};
|
|
25
|
-
declare const REQUEST_TIMEOUT_MS = 15000;
|
|
26
|
-
declare const FRESHNESS_REEVALUATE_MS = 30000;
|
|
27
|
-
type JsonPollerOptions<T> = {
|
|
24
|
+
export declare const REQUEST_TIMEOUT_MS = 15000;
|
|
25
|
+
export declare const FRESHNESS_REEVALUATE_MS = 30000;
|
|
26
|
+
export type JsonPollerOptions<T> = {
|
|
28
27
|
parse: (text: string) => ParseOutcome<T>;
|
|
29
28
|
intervalMsFor: (last: T | null) => number;
|
|
30
29
|
fetchInit?: RequestInit | (() => RequestInit | undefined);
|
|
31
30
|
initial?: PollSeed<T>;
|
|
32
31
|
};
|
|
33
|
-
type JsonPoller<T> = {
|
|
32
|
+
export type JsonPoller<T> = {
|
|
34
33
|
getSnapshot(): PollSnapshot<T>;
|
|
35
34
|
subscribe(listener: () => void): () => void;
|
|
36
35
|
start(): void;
|
|
37
36
|
stop(): void;
|
|
38
37
|
refresh(): void;
|
|
39
38
|
};
|
|
40
|
-
declare function createJsonPoller<T>(url: string, options: JsonPollerOptions<T>): JsonPoller<T>;
|
|
41
|
-
//#endregion
|
|
42
|
-
export { FRESHNESS_REEVALUATE_MS, JsonPoller, JsonPollerOptions, ParseOutcome, PollError, PollSeed, PollSnapshot, REQUEST_TIMEOUT_MS, createJsonPoller };
|
|
39
|
+
export declare function createJsonPoller<T>(url: string, options: JsonPollerOptions<T>): JsonPoller<T>;
|
package/dist/client/poll.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/client/poll.ts
|
|
2
2
|
const REQUEST_TIMEOUT_MS = 15e3;
|
|
3
3
|
const FRESHNESS_REEVALUATE_MS = 3e4;
|
|
4
4
|
function createJsonPoller(url, options) {
|
|
@@ -117,5 +117,4 @@ function createJsonPoller(url, options) {
|
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
//#endregion
|
|
121
120
|
export { FRESHNESS_REEVALUATE_MS, REQUEST_TIMEOUT_MS, createJsonPoller };
|
package/dist/client/stores.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { JsonPoller, ParseOutcome, PollError } from "./poll.js";
|
|
2
2
|
import { Station, StationCurrent, StationFeed } from "../contract.js";
|
|
3
|
-
|
|
4
|
-
declare function
|
|
5
|
-
declare function parseCurrentText(text: string): ParseOutcome<StationCurrent>;
|
|
3
|
+
export declare function parseFeedText(text: string): ParseOutcome<StationFeed>;
|
|
4
|
+
export declare function parseCurrentText(text: string): ParseOutcome<StationCurrent>;
|
|
6
5
|
type FetchInitOption = RequestInit | (() => RequestInit | undefined);
|
|
7
|
-
declare function createStationFeedStore(base: string, options?: {
|
|
6
|
+
export declare function createStationFeedStore(base: string, options?: {
|
|
8
7
|
pollSeconds?: number;
|
|
9
8
|
fetchInit?: FetchInitOption;
|
|
10
9
|
initial?: {
|
|
@@ -12,7 +11,7 @@ declare function createStationFeedStore(base: string, options?: {
|
|
|
12
11
|
receivedAtMs: number;
|
|
13
12
|
};
|
|
14
13
|
}): JsonPoller<StationFeed>;
|
|
15
|
-
declare function createStationCurrentStore(base: string, stationId: string, options?: {
|
|
14
|
+
export declare function createStationCurrentStore(base: string, stationId: string, options?: {
|
|
16
15
|
pollSeconds?: number;
|
|
17
16
|
fetchInit?: FetchInitOption;
|
|
18
17
|
initial?: {
|
|
@@ -20,20 +19,20 @@ declare function createStationCurrentStore(base: string, stationId: string, opti
|
|
|
20
19
|
receivedAtMs: number;
|
|
21
20
|
};
|
|
22
21
|
}): JsonPoller<StationCurrent>;
|
|
23
|
-
type StationSnapshot = {
|
|
22
|
+
export type StationSnapshot = {
|
|
24
23
|
feed: StationFeed | null;
|
|
25
24
|
station: Station | null;
|
|
26
25
|
receivedAtMs: number | null;
|
|
27
26
|
error: PollError | null;
|
|
28
27
|
};
|
|
29
|
-
type StationStore = {
|
|
28
|
+
export type StationStore = {
|
|
30
29
|
getSnapshot(): StationSnapshot;
|
|
31
30
|
subscribe(listener: () => void): () => void;
|
|
32
31
|
start(): void;
|
|
33
32
|
stop(): void;
|
|
34
33
|
refresh(): void;
|
|
35
34
|
};
|
|
36
|
-
declare function createStationStore(base: string, stationId: string, options?: {
|
|
35
|
+
export declare function createStationStore(base: string, stationId: string, options?: {
|
|
37
36
|
pollSeconds?: number;
|
|
38
37
|
currentPollSeconds?: number;
|
|
39
38
|
fetchInit?: FetchInitOption;
|
|
@@ -43,5 +42,4 @@ declare function createStationStore(base: string, stationId: string, options?: {
|
|
|
43
42
|
};
|
|
44
43
|
live?: boolean;
|
|
45
44
|
}): StationStore;
|
|
46
|
-
|
|
47
|
-
export { StationSnapshot, StationStore, createStationCurrentStore, createStationFeedStore, createStationStore, parseCurrentText, parseFeedText };
|
|
45
|
+
export {};
|
package/dist/client/stores.js
CHANGED
|
@@ -3,7 +3,7 @@ import { currentEndpoint, feedEndpoint } from "../endpoints.js";
|
|
|
3
3
|
import { foldCurrent } from "../merge-current.js";
|
|
4
4
|
import { createJsonPoller } from "./poll.js";
|
|
5
5
|
import { createStationLiveStore, liveSnapshotToCurrent } from "./live.js";
|
|
6
|
-
|
|
6
|
+
// src/client/stores.ts
|
|
7
7
|
const FEED_DEFAULT_POLL_SECONDS = 60;
|
|
8
8
|
const CURRENT_DEFAULT_POLL_SECONDS = 15;
|
|
9
9
|
function parseFeedText(text) {
|
|
@@ -167,5 +167,4 @@ function createStationStore(base, stationId, options = {}) {
|
|
|
167
167
|
}
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
|
-
//#endregion
|
|
171
170
|
export { createStationCurrentStore, createStationFeedStore, createStationStore, parseCurrentText, parseFeedText };
|
package/dist/client/ticker.d.ts
CHANGED
package/dist/client/ticker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FRESHNESS_REEVALUATE_MS } from "./poll.js";
|
|
2
|
-
|
|
2
|
+
// src/client/ticker.ts
|
|
3
3
|
const listeners = /* @__PURE__ */ new Set();
|
|
4
4
|
let timer = null;
|
|
5
5
|
function subscribeTicker(listener) {
|
|
@@ -15,5 +15,4 @@ function subscribeTicker(listener) {
|
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
//#endregion
|
|
19
18
|
export { subscribeTicker };
|
package/dist/climatology.d.ts
CHANGED
|
@@ -2,8 +2,7 @@ import { HistoryPoint } from "./contract.js";
|
|
|
2
2
|
import { ClimatologyCell, StationClimatology } from "./contract-climatology.js";
|
|
3
3
|
import { DailyPatternSlot, WindRoseSummary } from "./geometry.js";
|
|
4
4
|
import { DirectionArc } from "@azohra/meteo.core";
|
|
5
|
-
|
|
6
|
-
type ClimatologyFoldParams = {
|
|
5
|
+
export type ClimatologyFoldParams = {
|
|
7
6
|
sectorCount: number;
|
|
8
7
|
slotMinutes: number;
|
|
9
8
|
/** The consumer's band bounds in m/s, ascending — a judgment parameter
|
|
@@ -24,18 +23,18 @@ type MutableCell = {
|
|
|
24
23
|
calmCount: number;
|
|
25
24
|
sectors: Map<number, MutableSector>;
|
|
26
25
|
};
|
|
27
|
-
type ClimatologyAccumulator = {
|
|
26
|
+
export type ClimatologyAccumulator = {
|
|
28
27
|
readonly params: ClimatologyFoldParams;
|
|
29
28
|
readonly cells: Map<string, MutableCell>;
|
|
30
29
|
/** Distinct (month, day, slot) buckets holding a record, per year. */
|
|
31
30
|
readonly coveredSlots: Map<number, Set<string>>;
|
|
32
31
|
};
|
|
33
|
-
declare function createClimatologyAccumulator(params: ClimatologyFoldParams): ClimatologyAccumulator;
|
|
34
|
-
declare function foldClimatologyPoints(accumulator: ClimatologyAccumulator, points: ReadonlyArray<HistoryPoint>): void;
|
|
32
|
+
export declare function createClimatologyAccumulator(params: ClimatologyFoldParams): ClimatologyAccumulator;
|
|
33
|
+
export declare function foldClimatologyPoints(accumulator: ClimatologyAccumulator, points: ReadonlyArray<HistoryPoint>): void;
|
|
35
34
|
/** The accumulated buckets as wire cells: month, then slot, then sector,
|
|
36
35
|
* every empty bucket absent. */
|
|
37
|
-
declare function accumulatedCells(accumulator: ClimatologyAccumulator): ClimatologyCell[];
|
|
38
|
-
type ClimatologyFilters = {
|
|
36
|
+
export declare function accumulatedCells(accumulator: ClimatologyAccumulator): ClimatologyCell[];
|
|
37
|
+
export type ClimatologyFilters = {
|
|
39
38
|
/** Calendar months to keep, 1–12; absent keeps all. */
|
|
40
39
|
months?: ReadonlyArray<number>;
|
|
41
40
|
/** Slot-of-day indices to keep; absent keeps all. */
|
|
@@ -43,24 +42,23 @@ type ClimatologyFilters = {
|
|
|
43
42
|
};
|
|
44
43
|
/** The filtered cube as a rose — geometry's WindRoseSummary shape, every
|
|
45
44
|
* sector carrying its bandCounts stack. */
|
|
46
|
-
declare function climatologyRose(document: StationClimatology, filters?: ClimatologyFilters): WindRoseSummary;
|
|
45
|
+
export declare function climatologyRose(document: StationClimatology, filters?: ClimatologyFilters): WindRoseSummary;
|
|
47
46
|
/** The filtered cube as a typical day — geometry's DailyPatternSlot list,
|
|
48
47
|
* vector-averaged per slot, calm records weighing the mean down exactly as
|
|
49
48
|
* the point-level dailyPattern does. */
|
|
50
|
-
declare function climatologyPattern(document: StationClimatology, filters?: Pick<ClimatologyFilters, "months">): DailyPatternSlot[];
|
|
51
|
-
type ClimatologyCoverage = {
|
|
49
|
+
export declare function climatologyPattern(document: StationClimatology, filters?: Pick<ClimatologyFilters, "months">): DailyPatternSlot[];
|
|
50
|
+
export type ClimatologyCoverage = {
|
|
52
51
|
sampleCount: number;
|
|
53
52
|
expectedCount: number;
|
|
54
53
|
ratio: number | null;
|
|
55
54
|
};
|
|
56
55
|
/** Per-year covered-slot counts, for producers writing the ledger. */
|
|
57
|
-
declare function coveredSlotCountByYear(accumulator: ClimatologyAccumulator): Map<number, number>;
|
|
56
|
+
export declare function coveredSlotCountByYear(accumulator: ClimatologyAccumulator): Map<number, number>;
|
|
58
57
|
/** Summed over the ledger. The ratio comes only from the slot pair and is
|
|
59
58
|
* null when any year lacks it — no percent beats a wrong-unit percent. */
|
|
60
|
-
declare function climatologyCoverage(document: StationClimatology): ClimatologyCoverage;
|
|
59
|
+
export declare function climatologyCoverage(document: StationClimatology): ClimatologyCoverage;
|
|
61
60
|
/** The share of the filtered non-calm record blowing from inside the
|
|
62
61
|
* consumer's arcs, judged at each sector's centre bearing; null when
|
|
63
62
|
* nothing non-calm was recorded. */
|
|
64
|
-
declare function climatologyFavorableShare(document: StationClimatology, arcs: ReadonlyArray<DirectionArc>, filters?: ClimatologyFilters): number | null;
|
|
65
|
-
|
|
66
|
-
export { ClimatologyAccumulator, ClimatologyCoverage, ClimatologyFilters, ClimatologyFoldParams, accumulatedCells, climatologyCoverage, climatologyFavorableShare, climatologyPattern, climatologyRose, coveredSlotCountByYear, createClimatologyAccumulator, foldClimatologyPoints };
|
|
63
|
+
export declare function climatologyFavorableShare(document: StationClimatology, arcs: ReadonlyArray<DirectionArc>, filters?: ClimatologyFilters): number | null;
|
|
64
|
+
export {};
|
package/dist/climatology.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isCalm, normalizeDegrees } from "./derive.js";
|
|
2
2
|
import { speedBand } from "./geometry.js";
|
|
3
3
|
import { componentsToWind, inDirectionArcs, windToComponents } from "@azohra/meteo.core";
|
|
4
|
-
|
|
4
|
+
// src/climatology.ts
|
|
5
5
|
function createClimatologyAccumulator(params) {
|
|
6
6
|
if (params.slotMinutes <= 0 || 1440 % params.slotMinutes !== 0) throw new Error(`climatology: slotMinutes must evenly divide 1440, got ${params.slotMinutes}`);
|
|
7
7
|
if (params.sectorCount < 4) throw new Error(`climatology: sectorCount must be at least 4, got ${params.sectorCount}`);
|
|
@@ -226,5 +226,4 @@ function climatologyFavorableShare(document, arcs, filters) {
|
|
|
226
226
|
}
|
|
227
227
|
return blowing === 0 ? null : favorable / blowing;
|
|
228
228
|
}
|
|
229
|
-
//#endregion
|
|
230
229
|
export { accumulatedCells, climatologyCoverage, climatologyFavorableShare, climatologyPattern, climatologyRose, coveredSlotCountByYear, createClimatologyAccumulator, foldClimatologyPoints };
|
package/dist/connectivity.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare const connectivitySessionSchema: z.ZodObject<{
|
|
2
|
+
export declare const CONNECTIVITY_SERVICE_STATES: readonly ["active", "paused", "inactive", "retired", "unknown"];
|
|
3
|
+
export type ConnectivityServiceState = (typeof CONNECTIVITY_SERVICE_STATES)[number];
|
|
4
|
+
export declare const connectivitySessionSchema: z.ZodObject<{
|
|
6
5
|
beganAt: z.ZodString;
|
|
7
6
|
endedAt: z.ZodNullable<z.ZodString>;
|
|
8
7
|
bytes: z.ZodNullable<z.ZodNumber>;
|
|
9
8
|
}, z.core.$strip>;
|
|
10
|
-
type ConnectivitySession = z.infer<typeof connectivitySessionSchema>;
|
|
11
|
-
declare const stationConnectivitySchema: z.ZodObject<{
|
|
9
|
+
export type ConnectivitySession = z.infer<typeof connectivitySessionSchema>;
|
|
10
|
+
export declare const stationConnectivitySchema: z.ZodObject<{
|
|
12
11
|
sourceLabel: z.ZodString;
|
|
13
12
|
checkedAt: z.ZodString;
|
|
14
13
|
deviceName: z.ZodNullable<z.ZodString>;
|
|
@@ -40,7 +39,5 @@ declare const stationConnectivitySchema: z.ZodObject<{
|
|
|
40
39
|
bytes: z.ZodNullable<z.ZodNumber>;
|
|
41
40
|
}, z.core.$strip>>;
|
|
42
41
|
}, z.core.$strip>;
|
|
43
|
-
type StationConnectivity = z.infer<typeof stationConnectivitySchema>;
|
|
44
|
-
declare function parseStationConnectivity(value: unknown): StationConnectivity | null;
|
|
45
|
-
//#endregion
|
|
46
|
-
export { CONNECTIVITY_SERVICE_STATES, ConnectivityServiceState, ConnectivitySession, StationConnectivity, connectivitySessionSchema, parseStationConnectivity, stationConnectivitySchema };
|
|
42
|
+
export type StationConnectivity = z.infer<typeof stationConnectivitySchema>;
|
|
43
|
+
export declare function parseStationConnectivity(value: unknown): StationConnectivity | null;
|
package/dist/connectivity.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
2
|
+
// src/connectivity.ts
|
|
3
3
|
const isoTime = z.string().refine((value) => Number.isFinite(Date.parse(value)), { message: "not an ISO timestamp" }).meta({ format: "date-time" });
|
|
4
4
|
const dataBytes = z.number().int().min(0);
|
|
5
5
|
const CONNECTIVITY_SERVICE_STATES = [
|
|
@@ -40,5 +40,4 @@ function parseStationConnectivity(value) {
|
|
|
40
40
|
const result = stationConnectivitySchema.safeParse(value);
|
|
41
41
|
return result.success ? result.data : null;
|
|
42
42
|
}
|
|
43
|
-
//#endregion
|
|
44
43
|
export { CONNECTIVITY_SERVICE_STATES, connectivitySessionSchema, parseStationConnectivity, stationConnectivitySchema };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
declare const
|
|
4
|
-
declare const climatologySectorSchema: z.ZodObject<{
|
|
2
|
+
export declare const STATION_CLIMATOLOGY_SCHEMA_VERSION = 1;
|
|
3
|
+
export declare const climatologySectorSchema: z.ZodObject<{
|
|
5
4
|
sector: z.ZodNumber;
|
|
6
5
|
count: z.ZodNumber;
|
|
7
6
|
uSum: z.ZodNumber;
|
|
@@ -10,8 +9,8 @@ declare const climatologySectorSchema: z.ZodObject<{
|
|
|
10
9
|
bandCounts: z.ZodArray<z.ZodNumber>;
|
|
11
10
|
maxGustMps: z.ZodNullable<z.ZodNumber>;
|
|
12
11
|
}, z.core.$strip>;
|
|
13
|
-
type ClimatologySector = z.infer<typeof climatologySectorSchema>;
|
|
14
|
-
declare const climatologyCellSchema: z.ZodObject<{
|
|
12
|
+
export type ClimatologySector = z.infer<typeof climatologySectorSchema>;
|
|
13
|
+
export declare const climatologyCellSchema: z.ZodObject<{
|
|
15
14
|
month: z.ZodNumber;
|
|
16
15
|
slot: z.ZodNumber;
|
|
17
16
|
sampleCount: z.ZodNumber;
|
|
@@ -26,16 +25,16 @@ declare const climatologyCellSchema: z.ZodObject<{
|
|
|
26
25
|
maxGustMps: z.ZodNullable<z.ZodNumber>;
|
|
27
26
|
}, z.core.$strip>>;
|
|
28
27
|
}, z.core.$strip>;
|
|
29
|
-
type ClimatologyCell = z.infer<typeof climatologyCellSchema>;
|
|
30
|
-
declare const climatologyYearSchema: z.ZodObject<{
|
|
28
|
+
export type ClimatologyCell = z.infer<typeof climatologyCellSchema>;
|
|
29
|
+
export declare const climatologyYearSchema: z.ZodObject<{
|
|
31
30
|
year: z.ZodNumber;
|
|
32
31
|
sampleCount: z.ZodNumber;
|
|
33
32
|
expectedCount: z.ZodNumber;
|
|
34
33
|
coveredSlotCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
35
34
|
expectedSlotCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
36
35
|
}, z.core.$strip>;
|
|
37
|
-
type ClimatologyYear = z.infer<typeof climatologyYearSchema>;
|
|
38
|
-
declare const stationClimatologySchema: z.ZodObject<{
|
|
36
|
+
export type ClimatologyYear = z.infer<typeof climatologyYearSchema>;
|
|
37
|
+
export declare const stationClimatologySchema: z.ZodObject<{
|
|
39
38
|
schemaVersion: z.ZodLiteral<1>;
|
|
40
39
|
servedAt: z.ZodString;
|
|
41
40
|
stationId: z.ZodString;
|
|
@@ -66,8 +65,6 @@ declare const stationClimatologySchema: z.ZodObject<{
|
|
|
66
65
|
}, z.core.$strip>>;
|
|
67
66
|
}, z.core.$strip>>;
|
|
68
67
|
}, z.core.$strip>;
|
|
69
|
-
type StationClimatology = z.infer<typeof stationClimatologySchema>;
|
|
70
|
-
declare function parseStationClimatology(value: unknown): StationClimatology | null;
|
|
71
|
-
declare function parseStationClimatologyJson(text: string): StationClimatology | null;
|
|
72
|
-
//#endregion
|
|
73
|
-
export { ClimatologyCell, ClimatologySector, ClimatologyYear, STATION_CLIMATOLOGY_SCHEMA_VERSION, StationClimatology, climatologyCellSchema, climatologySectorSchema, climatologyYearSchema, parseStationClimatology, parseStationClimatologyJson, stationClimatologySchema };
|
|
68
|
+
export type StationClimatology = z.infer<typeof stationClimatologySchema>;
|
|
69
|
+
export declare function parseStationClimatology(value: unknown): StationClimatology | null;
|
|
70
|
+
export declare function parseStationClimatologyJson(text: string): StationClimatology | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
2
|
+
// src/contract-climatology.ts
|
|
3
3
|
const STATION_CLIMATOLOGY_SCHEMA_VERSION = 1;
|
|
4
4
|
const count = z.number().int().min(0);
|
|
5
5
|
const climatologySectorSchema = z.object({
|
|
@@ -48,5 +48,4 @@ function parseStationClimatologyJson(text) {
|
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
//#endregion
|
|
52
51
|
export { STATION_CLIMATOLOGY_SCHEMA_VERSION, climatologyCellSchema, climatologySectorSchema, climatologyYearSchema, parseStationClimatology, parseStationClimatologyJson, stationClimatologySchema };
|