@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { favorableShare } from "../geometry.js";
|
|
2
2
|
import { el } from "./node.js";
|
|
3
|
-
|
|
3
|
+
// src/scene/favorable-share.ts
|
|
4
4
|
const FAVORABLE_SHARE_CLASS = "meteo-favorable-share";
|
|
5
5
|
function favorableShareSource(points, station) {
|
|
6
6
|
return points ?? (station?.status === "ok" ? station.history?.points : null) ?? [];
|
|
@@ -20,5 +20,4 @@ function favorableShareScene(input) {
|
|
|
20
20
|
class: FAVORABLE_SHARE_CLASS
|
|
21
21
|
}, el("span", { class: "meteo-favorable-share-label" }, words.favorableLabel), " ", el("span", { class: "meteo-favorable-share-value" }, words.percentShare(Math.round(share * 100))));
|
|
22
22
|
}
|
|
23
|
-
//#endregion
|
|
24
23
|
export { FAVORABLE_SHARE_CLASS, favorableShareScene, favorableShareSource };
|
package/dist/scene/glyphs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { el } from "./node.js";
|
|
2
|
-
|
|
2
|
+
// src/scene/glyphs.ts
|
|
3
3
|
function windArrowNode(deg, size = 12) {
|
|
4
4
|
return {
|
|
5
5
|
...el("svg", {
|
|
@@ -24,5 +24,4 @@ function freshnessBadgeNode(status, words) {
|
|
|
24
24
|
class: "meteo-freshness-dot"
|
|
25
25
|
}), words.freshness[status]);
|
|
26
26
|
}
|
|
27
|
-
//#endregion
|
|
28
27
|
export { freshnessBadgeNode, windArrowNode };
|
package/dist/scene/node.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/scene/node.ts
|
|
2
2
|
/** An element node; children may be nested arrays and are flattened by the walkers. */
|
|
3
3
|
function el(tag, attrs, ...children) {
|
|
4
4
|
const node = { tag };
|
|
@@ -15,5 +15,4 @@ function keyed(key, tag, attrs, ...children) {
|
|
|
15
15
|
}
|
|
16
16
|
/** Tags that open an SVG subtree; everything inside one stays in that namespace. */
|
|
17
17
|
const SVG_ROOT_TAGS = /* @__PURE__ */ new Set(["svg"]);
|
|
18
|
-
//#endregion
|
|
19
18
|
export { SVG_ROOT_TAGS, el, keyed };
|
|
@@ -2,7 +2,7 @@ import { optionalSpeed, roundSpeed } from "../format.js";
|
|
|
2
2
|
import { el, keyed } from "./node.js";
|
|
3
3
|
import { windArrowNode } from "./glyphs.js";
|
|
4
4
|
import { inDirectionArcs } from "@azohra/meteo.core";
|
|
5
|
-
|
|
5
|
+
// src/scene/recent-summaries.ts
|
|
6
6
|
const RECENT_SUMMARIES_CLASS = "meteo-recent-summaries";
|
|
7
7
|
/** Null unless the source declares the capability; the no-samples words
|
|
8
8
|
* when the declared block is dark. */
|
|
@@ -31,5 +31,4 @@ function recentSummariesScene(input) {
|
|
|
31
31
|
})), el("dl", { class: "meteo-recent-summary-stats" }, stat("avg", words.avgLabel, avgMps == null ? "—" : `${roundSpeed(avgMps, unit)} ${words.speedUnits[unit]}`), stat("gust", words.gustLabel, optionalSpeed(gusts.length === 0 ? null : Math.max(...gusts), unit)), stat("lull", words.lullLabel, optionalSpeed(lulls.length === 0 ? null : Math.min(...lulls), unit))));
|
|
32
32
|
}));
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
34
|
export { RECENT_SUMMARIES_CLASS, recentSummariesScene };
|
package/dist/scene/rose.js
CHANGED
|
@@ -2,7 +2,7 @@ import { normalizeDegrees, thresholdsToMps } from "../derive.js";
|
|
|
2
2
|
import { speedBand, windRose } from "../geometry.js";
|
|
3
3
|
import { ROSE_CARDINAL_LETTERS, ROSE_INTERCARDINAL_BEARINGS, ROSE_PETAL_FILL, roseBandPath, rosePetalPath, rosePolar, roseRingArcPath } from "../instruments.js";
|
|
4
4
|
import { el, keyed } from "./node.js";
|
|
5
|
-
|
|
5
|
+
// src/scene/rose.ts
|
|
6
6
|
const WIND_ROSE_CLASS = "meteo-wind-rose";
|
|
7
7
|
function windRoseSource(points, station) {
|
|
8
8
|
return points ?? (station?.status === "ok" ? station.history?.points : null) ?? [];
|
|
@@ -103,5 +103,4 @@ function windRoseScene(input, extra = []) {
|
|
|
103
103
|
r: 3
|
|
104
104
|
})), rose.calmFraction > 0 ? el("p", { class: "meteo-wind-rose-calm" }, words.percentCalm(Math.round(rose.calmFraction * 100))) : null, extra);
|
|
105
105
|
}
|
|
106
|
-
//#endregion
|
|
107
106
|
export { WIND_ROSE_CLASS, windRoseScene, windRoseSource };
|
|
@@ -3,7 +3,7 @@ import { roundSpeed } from "../format.js";
|
|
|
3
3
|
import { samplePoints, sampleRuns, sampleScales, thinSampleVanes } from "../samples.js";
|
|
4
4
|
import { el, keyed } from "./node.js";
|
|
5
5
|
import { calmNoteText, plotLine, speedGridLines, stretchedChartFrame, vaneCells, vaneGuideLines, vaneTickTexts, windRowLabels } from "./wind-plot.js";
|
|
6
|
-
|
|
6
|
+
// src/scene/sample-strip.ts
|
|
7
7
|
const SAMPLE_STRIP_CLASS = "meteo-sample-strip";
|
|
8
8
|
function sampleStripGate(samples, words) {
|
|
9
9
|
if (samples == null || samples.points.length < 2) return {
|
|
@@ -125,5 +125,4 @@ function sampleStripScene(input) {
|
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
-
//#endregion
|
|
129
128
|
export { SAMPLE_STRIP_CLASS, sampleStripGate, sampleStripScene };
|
package/dist/scene/sparkline.js
CHANGED
|
@@ -2,7 +2,7 @@ import { thresholdsToMps } from "../derive.js";
|
|
|
2
2
|
import { speedBand } from "../geometry.js";
|
|
3
3
|
import { bandStrips, historyRuns, sparklineScale } from "../instruments.js";
|
|
4
4
|
import { el, keyed } from "./node.js";
|
|
5
|
-
|
|
5
|
+
// src/scene/sparkline.ts
|
|
6
6
|
const coordinate = (x, y) => `${x.toFixed(1)},${y.toFixed(1)}`;
|
|
7
7
|
function sparklineScene(input) {
|
|
8
8
|
const { height, showBand, station, thresholds, width, words } = input;
|
|
@@ -60,5 +60,4 @@ function sparklineScene(input) {
|
|
|
60
60
|
points: [...strip.points.map((point) => coordinate(xAt(Date.parse(point.observedAt)), yAt(point.windGustMps))), ...[...strip.points].reverse().map((point) => coordinate(xAt(Date.parse(point.observedAt)), yAt(point.windLullMps)))].join(" ")
|
|
61
61
|
})), trace);
|
|
62
62
|
}
|
|
63
|
-
//#endregion
|
|
64
63
|
export { sparklineScene };
|
package/dist/scene/strip.js
CHANGED
|
@@ -2,7 +2,7 @@ import { optionalSpeed, roundSpeed, temperatureText } from "../format.js";
|
|
|
2
2
|
import { el } from "./node.js";
|
|
3
3
|
import { freshnessBadgeNode } from "./glyphs.js";
|
|
4
4
|
import { directionCellNodes, stationNameNode } from "./cells.js";
|
|
5
|
-
|
|
5
|
+
// src/scene/strip.ts
|
|
6
6
|
function stationStripScene(input) {
|
|
7
7
|
const { formatTime, freshness, station, unit, words } = input;
|
|
8
8
|
const labelled = (className, label, value) => el("span", { class: className }, el("small", { class: "meteo-microlabel" }, label), value);
|
|
@@ -20,5 +20,4 @@ function stationStripScene(input) {
|
|
|
20
20
|
role: "group"
|
|
21
21
|
}, el("span", { class: "meteo-strip-station" }, stationNameNode(station)), cells);
|
|
22
22
|
}
|
|
23
|
-
//#endregion
|
|
24
23
|
export { stationStripScene };
|
package/dist/scene/table.js
CHANGED
|
@@ -2,7 +2,7 @@ import { optionalSpeed, roundSpeed, temperatureText } from "../format.js";
|
|
|
2
2
|
import { el, keyed } from "./node.js";
|
|
3
3
|
import { freshnessBadgeNode } from "./glyphs.js";
|
|
4
4
|
import { directionCellNodes } from "./cells.js";
|
|
5
|
-
|
|
5
|
+
// src/scene/table.ts
|
|
6
6
|
const TABLE_ROW_CLASS = "meteo-station-table-row";
|
|
7
7
|
const TABLE_STATION_CELL_CLASS = "meteo-station-table-station";
|
|
8
8
|
function stationTableHeadNode(words) {
|
|
@@ -50,5 +50,4 @@ function stationTableRootAttrs(stations, words) {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
const TABLE_BODY_CLASS = "meteo-station-table-body";
|
|
53
|
-
//#endregion
|
|
54
53
|
export { TABLE_BODY_CLASS, TABLE_ROW_CLASS, TABLE_STATION_CELL_CLASS, stationTableHeadNode, stationTableRootAttrs, stationTableRowCells };
|
package/dist/scene/trend.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { chartFrame, chartScales, tickAnchor, trendRuns, trendSeriesPad, trendValueOf, valueScale } from "../geometry.js";
|
|
2
2
|
import { el, keyed } from "./node.js";
|
|
3
3
|
import { plotLine, plotText } from "./wind-plot.js";
|
|
4
|
-
|
|
4
|
+
// src/scene/trend.ts
|
|
5
5
|
const TREND_CLASS = "meteo-trend";
|
|
6
6
|
function trendGate(station, series, words) {
|
|
7
7
|
if (!station.capabilities.history) return { kind: "hidden" };
|
|
@@ -124,5 +124,4 @@ function trendScene(input) {
|
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
//#endregion
|
|
128
127
|
export { TREND_CLASS, trendFrame, trendGate, trendScene };
|
|
@@ -3,7 +3,7 @@ import { bandPoints, compareTracePoints, compareWindow, historyGaps, isCalmHisto
|
|
|
3
3
|
import { roundSpeed } from "../format.js";
|
|
4
4
|
import { el } from "./node.js";
|
|
5
5
|
import { calmNoteText, displaySpeedScales, gapHatchPattern, gapHatchRect, gradedMeanTrace, nightRects, plotLine, speedGridLines, stretchedChartFrame, vaneCells, vaneGuideLines, vaneTickTexts, windRowLabels, windThresholdGuides, windZoneRects } from "./wind-plot.js";
|
|
6
|
-
|
|
6
|
+
// src/scene/wind-history.ts
|
|
7
7
|
const WIND_CHART_CLASS = "meteo-wind-chart";
|
|
8
8
|
function windChartGate(station, words) {
|
|
9
9
|
if (!station.capabilities.history) return { kind: "hidden" };
|
|
@@ -135,5 +135,4 @@ function windChartScene(input) {
|
|
|
135
135
|
}
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
-
//#endregion
|
|
139
138
|
export { WIND_CHART_CLASS, windChartGate, windChartScene };
|
package/dist/scene/wind-plot.js
CHANGED
|
@@ -2,7 +2,7 @@ import { compassDirection, speedToMps } from "../derive.js";
|
|
|
2
2
|
import { averagePoints, chartFrame, chartScales, speedBand, stretchFrame, tickAnchor, vanePath, vaneTicks } from "../geometry.js";
|
|
3
3
|
import { el, keyed } from "./node.js";
|
|
4
4
|
import { inDirectionArcs, solarEventsForDate } from "@azohra/meteo.core";
|
|
5
|
-
|
|
5
|
+
// src/scene/wind-plot.ts
|
|
6
6
|
/** A plot label: the anchor is the SVG attribute, spelled as the DOM does. */
|
|
7
7
|
function plotText(attrs, anchor, x, y, text) {
|
|
8
8
|
return el("text", {
|
|
@@ -174,5 +174,4 @@ function vaneTickTexts(vanes, frame, scales, labelText) {
|
|
|
174
174
|
key: String(index)
|
|
175
175
|
}));
|
|
176
176
|
}
|
|
177
|
-
//#endregion
|
|
178
177
|
export { calmNoteText, displaySpeedScales, gapHatchPattern, gapHatchRect, gradedMeanTrace, nightRects, plotLine, plotText, speedGridLines, stretchedChartFrame, vaneCells, vaneGuideLines, vaneTickTexts, windRowLabels, windThresholdGuides, windZoneRects };
|
package/dist/server/adapter.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { History, LiveSamples, Reading, RecentSummary, Station, StationMeta, StationTelemetry } from "../contract.js";
|
|
2
2
|
import { ResolvedEnvironment, ServerEnvironment } from "./environment.js";
|
|
3
|
-
|
|
4
|
-
type
|
|
5
|
-
type StationAdapterOptions = {
|
|
3
|
+
export type StationAdapterMode = "full" | "current";
|
|
4
|
+
export type StationAdapterOptions = {
|
|
6
5
|
historyHours?: number;
|
|
7
6
|
mode?: StationAdapterMode;
|
|
8
7
|
environment?: ServerEnvironment;
|
|
9
8
|
};
|
|
10
|
-
type StationAdapterContext<O extends StationAdapterOptions = StationAdapterOptions> = {
|
|
9
|
+
export type StationAdapterContext<O extends StationAdapterOptions = StationAdapterOptions> = {
|
|
11
10
|
readonly environment: ResolvedEnvironment;
|
|
12
11
|
readonly historyHours: number;
|
|
13
12
|
readonly mode: StationAdapterMode;
|
|
14
13
|
readonly options: O;
|
|
15
14
|
};
|
|
16
|
-
type StationAdapterResult = {
|
|
15
|
+
export type StationAdapterResult = {
|
|
17
16
|
readonly reading: Reading;
|
|
18
17
|
readonly history: History | null;
|
|
19
18
|
readonly telemetry?: StationTelemetry | null;
|
|
@@ -21,11 +20,9 @@ type StationAdapterResult = {
|
|
|
21
20
|
readonly recentSummaries?: RecentSummary[] | null;
|
|
22
21
|
readonly meta?: Partial<StationMeta>;
|
|
23
22
|
};
|
|
24
|
-
type StationAdapterDefinition<C, O extends StationAdapterOptions = StationAdapterOptions> = {
|
|
23
|
+
export type StationAdapterDefinition<C, O extends StationAdapterOptions = StationAdapterOptions> = {
|
|
25
24
|
readonly meta: (config: C) => StationMeta;
|
|
26
25
|
readonly load: (config: C, context: StationAdapterContext<O>) => Promise<StationAdapterResult>;
|
|
27
26
|
};
|
|
28
|
-
type StationAdapter<C, O extends StationAdapterOptions = StationAdapterOptions> = (config: C, options?: O) => Promise<Station>;
|
|
29
|
-
declare function defineStationAdapter<C, O extends StationAdapterOptions = StationAdapterOptions>(definition: StationAdapterDefinition<C, O>): StationAdapter<C, O>;
|
|
30
|
-
//#endregion
|
|
31
|
-
export { StationAdapter, StationAdapterContext, StationAdapterDefinition, StationAdapterMode, StationAdapterOptions, StationAdapterResult, defineStationAdapter };
|
|
27
|
+
export type StationAdapter<C, O extends StationAdapterOptions = StationAdapterOptions> = (config: C, options?: O) => Promise<Station>;
|
|
28
|
+
export declare function defineStationAdapter<C, O extends StationAdapterOptions = StationAdapterOptions>(definition: StationAdapterDefinition<C, O>): StationAdapter<C, O>;
|
package/dist/server/adapter.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { unavailableStation } from "../contract.js";
|
|
2
2
|
import { logUpstreamFailure, resolveEnvironment, unavailableReasonForError } from "./environment.js";
|
|
3
3
|
import "./feed.js";
|
|
4
|
-
|
|
4
|
+
// src/server/adapter.ts
|
|
5
5
|
function defineStationAdapter(definition) {
|
|
6
6
|
return async (config, options) => {
|
|
7
7
|
const resolved = options ?? {};
|
|
@@ -31,5 +31,4 @@ function defineStationAdapter(definition) {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
34
|
export { defineStationAdapter };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { HistoryPoint, Reading, Station } from "../../contract.js";
|
|
2
2
|
import { CampbellStationConfig } from "../config.js";
|
|
3
3
|
import { StationAdapter, StationAdapterOptions } from "../adapter.js";
|
|
4
|
-
|
|
5
|
-
type CampbellAdapterOptions = StationAdapterOptions;
|
|
4
|
+
export type CampbellAdapterOptions = StationAdapterOptions;
|
|
6
5
|
type CampbellField = {
|
|
7
6
|
name: string;
|
|
8
7
|
process: string;
|
|
@@ -13,12 +12,12 @@ type CampbellRecord = {
|
|
|
13
12
|
time: string;
|
|
14
13
|
vals: unknown[];
|
|
15
14
|
};
|
|
16
|
-
type CampbellTable = {
|
|
15
|
+
export type CampbellTable = {
|
|
17
16
|
fields: CampbellField[];
|
|
18
17
|
records: CampbellRecord[];
|
|
19
18
|
};
|
|
20
19
|
type TableRole = "current" | "history";
|
|
21
|
-
declare const CAMPBELL_FIELD_CONTRACTS: {
|
|
20
|
+
export declare const CAMPBELL_FIELD_CONTRACTS: {
|
|
22
21
|
readonly current: readonly [{
|
|
23
22
|
readonly name: "Wind_Speed";
|
|
24
23
|
readonly process: "Avg";
|
|
@@ -72,14 +71,14 @@ declare const CAMPBELL_FIELD_CONTRACTS: {
|
|
|
72
71
|
readonly units: "kilometers/hour";
|
|
73
72
|
}];
|
|
74
73
|
};
|
|
75
|
-
type CampbellTableExpectation = {
|
|
74
|
+
export type CampbellTableExpectation = {
|
|
76
75
|
role: TableRole;
|
|
77
76
|
tableName: string;
|
|
78
77
|
stationName: string;
|
|
79
78
|
intervalMs: number;
|
|
80
79
|
subject: string;
|
|
81
80
|
};
|
|
82
|
-
declare const loadCampbellStation: StationAdapter<{
|
|
81
|
+
export declare const loadCampbellStation: StationAdapter<{
|
|
83
82
|
elevationM?: number | null | undefined;
|
|
84
83
|
latitude?: number | null | undefined;
|
|
85
84
|
longitude?: number | null | undefined;
|
|
@@ -96,17 +95,16 @@ declare const loadCampbellStation: StationAdapter<{
|
|
|
96
95
|
historyPeriodMinutes: number;
|
|
97
96
|
currentCacheTtlSeconds: number;
|
|
98
97
|
}, StationAdapterOptions>;
|
|
99
|
-
declare function loadCampbellCurrent(config: CampbellStationConfig, options?: CampbellAdapterOptions): Promise<Station>;
|
|
100
|
-
declare function parseCampbellCurrent(value: string, config: CampbellStationConfig, nowMs?: number): Reading;
|
|
101
|
-
declare function parseCampbellHistory(value: string, config: CampbellStationConfig): {
|
|
98
|
+
export declare function loadCampbellCurrent(config: CampbellStationConfig, options?: CampbellAdapterOptions): Promise<Station>;
|
|
99
|
+
export declare function parseCampbellCurrent(value: string, config: CampbellStationConfig, nowMs?: number): Reading;
|
|
100
|
+
export declare function parseCampbellHistory(value: string, config: CampbellStationConfig): {
|
|
102
101
|
points: HistoryPoint[];
|
|
103
102
|
latestTemperatureC: number;
|
|
104
103
|
latestWindChillC: number;
|
|
105
104
|
};
|
|
106
|
-
declare function parseCampbellTable(value: string, expectation: CampbellTableExpectation): CampbellTable;
|
|
107
|
-
declare function naiveLocalToIso(naive: string, timeZone: string, context?: {
|
|
105
|
+
export declare function parseCampbellTable(value: string, expectation: CampbellTableExpectation): CampbellTable;
|
|
106
|
+
export declare function naiveLocalToIso(naive: string, timeZone: string, context?: {
|
|
108
107
|
afterMs?: number | null;
|
|
109
108
|
nearMs?: number;
|
|
110
109
|
}): string;
|
|
111
|
-
|
|
112
|
-
export { CAMPBELL_FIELD_CONTRACTS, CampbellAdapterOptions, CampbellTable, CampbellTableExpectation, loadCampbellCurrent, loadCampbellStation, naiveLocalToIso, parseCampbellCurrent, parseCampbellHistory, parseCampbellTable };
|
|
110
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import { isCalm, normalizeDegrees } from "../../derive.js";
|
|
|
2
2
|
import { fetchUpstreamText, logUpstreamFailure } from "../environment.js";
|
|
3
3
|
import { defineStationAdapter } from "../adapter.js";
|
|
4
4
|
import { kmhToMps } from "@azohra/meteo.core";
|
|
5
|
-
|
|
5
|
+
// src/server/adapters/campbell.ts
|
|
6
6
|
const HISTORY_CACHE_TTL_SECONDS = 120;
|
|
7
7
|
const MAX_RESPONSE_BYTES = 524288;
|
|
8
8
|
const CAMPBELL_FIELD_CONTRACTS = {
|
|
@@ -410,5 +410,4 @@ function naiveLocalToIso(naive, timeZone, context = {}) {
|
|
|
410
410
|
}
|
|
411
411
|
return new Date(high).toISOString();
|
|
412
412
|
}
|
|
413
|
-
//#endregion
|
|
414
413
|
export { CAMPBELL_FIELD_CONTRACTS, loadCampbellCurrent, loadCampbellStation, naiveLocalToIso, parseCampbellCurrent, parseCampbellHistory, parseCampbellTable };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { Reading, StationTelemetry } from "../../contract.js";
|
|
2
2
|
import { EcowittStationConfig } from "../config.js";
|
|
3
3
|
import { StationAdapter, StationAdapterOptions } from "../adapter.js";
|
|
4
|
-
|
|
5
|
-
type EcowittAdapterOptions = StationAdapterOptions & {
|
|
4
|
+
export type EcowittAdapterOptions = StationAdapterOptions & {
|
|
6
5
|
realTimeUrl?: string;
|
|
7
6
|
};
|
|
8
|
-
type EcowittObservation = {
|
|
7
|
+
export type EcowittObservation = {
|
|
9
8
|
reading: Reading;
|
|
10
9
|
telemetry: StationTelemetry | null;
|
|
11
10
|
};
|
|
12
|
-
declare const loadEcowittStation: StationAdapter<{
|
|
11
|
+
export declare const loadEcowittStation: StationAdapter<{
|
|
13
12
|
elevationM?: number | null | undefined;
|
|
14
13
|
latitude?: number | null | undefined;
|
|
15
14
|
longitude?: number | null | undefined;
|
|
@@ -23,6 +22,4 @@ declare const loadEcowittStation: StationAdapter<{
|
|
|
23
22
|
mac: string;
|
|
24
23
|
hasBattery: boolean;
|
|
25
24
|
}, EcowittAdapterOptions>;
|
|
26
|
-
declare function parseEcowittRealTime(value: string, config: Pick<EcowittStationConfig, "mac" | "elevationM">): EcowittObservation;
|
|
27
|
-
//#endregion
|
|
28
|
-
export { EcowittAdapterOptions, EcowittObservation, loadEcowittStation, parseEcowittRealTime };
|
|
25
|
+
export declare function parseEcowittRealTime(value: string, config: Pick<EcowittStationConfig, "mac" | "elevationM">): EcowittObservation;
|
|
@@ -3,7 +3,7 @@ import { isCalm, normalizeDegrees, seaLevelPressureHpa } from "../../derive.js";
|
|
|
3
3
|
import { fetchUpstreamText } from "../environment.js";
|
|
4
4
|
import { defineStationAdapter } from "../adapter.js";
|
|
5
5
|
import { UpstreamError, plausibleWindMps } from "@azohra/meteo.core";
|
|
6
|
-
|
|
6
|
+
// src/server/adapters/ecowitt.ts
|
|
7
7
|
const ECOWITT_REAL_TIME_URL = "https://api.ecowitt.net/api/v3/device/real_time";
|
|
8
8
|
const CACHE_TTL_SECONDS = 60;
|
|
9
9
|
const ECOWITT_CALL_BACK = "outdoor,wind,pressure,rainfall,rainfall_piezo,solar_and_uvi,battery";
|
|
@@ -146,5 +146,4 @@ function directionDegrees(value) {
|
|
|
146
146
|
if (value < 0 || value > 360) throw new Error("Ecowitt returned an invalid wind direction");
|
|
147
147
|
return value;
|
|
148
148
|
}
|
|
149
|
-
//#endregion
|
|
150
149
|
export { loadEcowittStation, parseEcowittRealTime };
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { Reading } from "../../contract.js";
|
|
2
2
|
import { StationAdapter, StationAdapterOptions } from "../adapter.js";
|
|
3
|
-
|
|
4
|
-
type TempestAdapterOptions = StationAdapterOptions & {
|
|
3
|
+
export type TempestAdapterOptions = StationAdapterOptions & {
|
|
5
4
|
observationsUrl?: string;
|
|
6
5
|
};
|
|
7
|
-
type TempestObservation = {
|
|
6
|
+
export type TempestObservation = {
|
|
8
7
|
reading: Reading;
|
|
9
8
|
elevationM: number | null;
|
|
10
9
|
latitude: number | null;
|
|
11
10
|
longitude: number | null;
|
|
12
11
|
};
|
|
13
|
-
declare const loadTempestStation: StationAdapter<{
|
|
12
|
+
export declare const loadTempestStation: StationAdapter<{
|
|
14
13
|
elevationM?: number | null | undefined;
|
|
15
14
|
latitude?: number | null | undefined;
|
|
16
15
|
longitude?: number | null | undefined;
|
|
@@ -22,6 +21,4 @@ declare const loadTempestStation: StationAdapter<{
|
|
|
22
21
|
stationId: number;
|
|
23
22
|
token: string;
|
|
24
23
|
}, TempestAdapterOptions>;
|
|
25
|
-
declare function parseTempestWind(value: string, expectedStationId: number): TempestObservation;
|
|
26
|
-
//#endregion
|
|
27
|
-
export { TempestAdapterOptions, TempestObservation, loadTempestStation, parseTempestWind };
|
|
24
|
+
export declare function parseTempestWind(value: string, expectedStationId: number): TempestObservation;
|
|
@@ -2,7 +2,7 @@ import { isCalm, normalizeDegrees } from "../../derive.js";
|
|
|
2
2
|
import { fetchUpstreamText } from "../environment.js";
|
|
3
3
|
import { defineStationAdapter } from "../adapter.js";
|
|
4
4
|
import { plausibleWindMps } from "@azohra/meteo.core";
|
|
5
|
-
|
|
5
|
+
// src/server/adapters/tempest.ts
|
|
6
6
|
const TEMPEST_OBSERVATIONS_URL = "https://swd.weatherflow.com/swd/rest/observations/station";
|
|
7
7
|
const CACHE_TTL_SECONDS = 60;
|
|
8
8
|
const loadTempestStation = defineStationAdapter({
|
|
@@ -133,5 +133,4 @@ function longitudeDegrees(value) {
|
|
|
133
133
|
if (value < -180 || value > 180) throw new Error("Tempest returned an invalid longitude");
|
|
134
134
|
return value === 180 ? -180 : value;
|
|
135
135
|
}
|
|
136
|
-
//#endregion
|
|
137
136
|
export { loadTempestStation, parseTempestWind };
|
|
@@ -2,11 +2,10 @@ import { StationClimatology } from "../../contract-climatology.js";
|
|
|
2
2
|
import { SpeedThresholds } from "../../derive.js";
|
|
3
3
|
import { ServerEnvironment } from "../environment.js";
|
|
4
4
|
import { WindnerdStationConfig } from "../config.js";
|
|
5
|
-
|
|
6
|
-
declare const
|
|
7
|
-
declare const
|
|
8
|
-
|
|
9
|
-
type WindnerdClimatologyOptions = {
|
|
5
|
+
export declare const CLIMATOLOGY_RECORD_PERIOD_MINUTES = 180;
|
|
6
|
+
export declare const CLIMATOLOGY_DEFAULT_YEARS = 8;
|
|
7
|
+
export declare const CLIMATOLOGY_DEFAULT_SECTOR_COUNT = 16;
|
|
8
|
+
export type WindnerdClimatologyOptions = {
|
|
10
9
|
/** The consumer's speed-band bounds — a judgment parameter with no
|
|
11
10
|
* default; it shapes every bandCounts stack and joins the cache key. */
|
|
12
11
|
thresholds: SpeedThresholds;
|
|
@@ -25,6 +24,4 @@ type WindnerdClimatologyOptions = {
|
|
|
25
24
|
* running year 6 hours), folded into (month, slot, sector) sums in the
|
|
26
25
|
* station's STANDARD time. Any refused year fails the whole document —
|
|
27
26
|
* a silently missing year would read as an outage. */
|
|
28
|
-
declare function loadWindnerdClimatology(config: WindnerdStationConfig, options: WindnerdClimatologyOptions): Promise<StationClimatology>;
|
|
29
|
-
//#endregion
|
|
30
|
-
export { CLIMATOLOGY_DEFAULT_SECTOR_COUNT, CLIMATOLOGY_DEFAULT_YEARS, CLIMATOLOGY_RECORD_PERIOD_MINUTES, WindnerdClimatologyOptions, loadWindnerdClimatology };
|
|
27
|
+
export declare function loadWindnerdClimatology(config: WindnerdStationConfig, options: WindnerdClimatologyOptions): Promise<StationClimatology>;
|
|
@@ -3,7 +3,7 @@ import "../../contract-climatology.js";
|
|
|
3
3
|
import { accumulatedCells, coveredSlotCountByYear, createClimatologyAccumulator, foldClimatologyPoints } from "../../climatology.js";
|
|
4
4
|
import { fetchUpstreamText, logUpstreamFailure, resolveEnvironment } from "../environment.js";
|
|
5
5
|
import { loadWindnerdLocation, parseWindnerdRecords, windnerdHistoryPoints } from "./windnerd.js";
|
|
6
|
-
|
|
6
|
+
// src/server/adapters/windnerd-climatology.ts
|
|
7
7
|
const CLIMATOLOGY_RECORD_PERIOD_MINUTES = 180;
|
|
8
8
|
const CLIMATOLOGY_DEFAULT_YEARS = 8;
|
|
9
9
|
const CLIMATOLOGY_DEFAULT_SECTOR_COUNT = 16;
|
|
@@ -79,5 +79,4 @@ async function standardOffsetMinutes(config, environment, options) {
|
|
|
79
79
|
return 0;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
//#endregion
|
|
83
82
|
export { CLIMATOLOGY_DEFAULT_SECTOR_COUNT, CLIMATOLOGY_DEFAULT_YEARS, CLIMATOLOGY_RECORD_PERIOD_MINUTES, loadWindnerdClimatology };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { StationLiveFrame } from "../../contract.js";
|
|
2
2
|
import { ServerEnvironment } from "../environment.js";
|
|
3
3
|
import { WindnerdStationConfig } from "../config.js";
|
|
4
|
-
|
|
5
|
-
type WindnerdLiveOptions = {
|
|
4
|
+
export type WindnerdLiveOptions = {
|
|
6
5
|
environment?: ServerEnvironment;
|
|
7
6
|
signal?: AbortSignal;
|
|
8
7
|
liveUrl?: string;
|
|
@@ -13,6 +12,4 @@ type WindnerdLiveOptions = {
|
|
|
13
12
|
* upstream init frame) rejects on failure; after that, failures degrade
|
|
14
13
|
* to a terminal unavailable frame. One call is one upstream connection;
|
|
15
14
|
* reconnect and fan-out belong to the caller. */
|
|
16
|
-
declare function openWindnerdLive(config: WindnerdStationConfig, options?: WindnerdLiveOptions): Promise<ReadableStream<StationLiveFrame>>;
|
|
17
|
-
//#endregion
|
|
18
|
-
export { WindnerdLiveOptions, openWindnerdLive };
|
|
15
|
+
export declare function openWindnerdLive(config: WindnerdStationConfig, options?: WindnerdLiveOptions): Promise<ReadableStream<StationLiveFrame>>;
|
|
@@ -2,7 +2,7 @@ import "../../contract.js";
|
|
|
2
2
|
import { sseEvents } from "../../sse.js";
|
|
3
3
|
import { UpstreamError, fetchUpstreamStream, logUpstreamFailure, resolveEnvironment, unavailableReasonForError } from "../environment.js";
|
|
4
4
|
import { WINDNERD_LIVE_INIT_TIMEOUT_MS, parseWindnerdLiveDigest, parseWindnerdLiveInit, parseWindnerdLiveSampleRecords, parseWindnerdRecentSummaries, windnerdEnrichedMeta, windnerdLiveReading, windnerdLiveSamples, windnerdLiveStreamUrl, windnerdStationMeta } from "./windnerd.js";
|
|
5
|
-
|
|
5
|
+
// src/server/adapters/windnerd-live.ts
|
|
6
6
|
const LIVE_IDLE_TIMEOUT_MS = 75e3;
|
|
7
7
|
/** Opens the station's live stream: one init frame, then
|
|
8
8
|
* samples/reading/ping as served. The connect phase (headers plus the
|
|
@@ -181,5 +181,4 @@ function mapLiveEvent(event, config, environment) {
|
|
|
181
181
|
function isRecord(value) {
|
|
182
182
|
return typeof value === "object" && value !== null;
|
|
183
183
|
}
|
|
184
|
-
//#endregion
|
|
185
184
|
export { openWindnerdLive };
|
|
@@ -4,15 +4,14 @@ import "../environment.js";
|
|
|
4
4
|
import { WindnerdStationConfig } from "../config.js";
|
|
5
5
|
import { StationAdapter, StationAdapterOptions } from "../adapter.js";
|
|
6
6
|
import { DirectionArc } from "@azohra/meteo.core";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type WindnerdAdapterOptions = StationAdapterOptions & {
|
|
7
|
+
export declare const WINDNERD_LIVE_SAMPLE_INTERVAL_SECONDS = 3;
|
|
8
|
+
export type WindnerdAdapterOptions = StationAdapterOptions & {
|
|
10
9
|
recordsUrl?: string;
|
|
11
10
|
liveUrl?: string;
|
|
12
11
|
recordPeriodMinutes?: WindnerdRecordPeriodMinutes;
|
|
13
12
|
cacheTtlSeconds?: number;
|
|
14
13
|
};
|
|
15
|
-
type WindnerdRecords = {
|
|
14
|
+
export type WindnerdRecords = {
|
|
16
15
|
averageSpeedMps: number[];
|
|
17
16
|
vectorAverageSpeedMps: Array<number | null>;
|
|
18
17
|
windDirectionDeg: number[];
|
|
@@ -26,7 +25,7 @@ type WindnerdRecords = {
|
|
|
26
25
|
stationPressureMinHpa: Array<number | null>;
|
|
27
26
|
stationPressureMaxHpa: Array<number | null>;
|
|
28
27
|
};
|
|
29
|
-
declare const loadWindnerdStation: StationAdapter<{
|
|
28
|
+
export declare const loadWindnerdStation: StationAdapter<{
|
|
30
29
|
elevationM?: number | null | undefined;
|
|
31
30
|
latitude?: number | null | undefined;
|
|
32
31
|
longitude?: number | null | undefined;
|
|
@@ -41,14 +40,14 @@ declare const loadWindnerdStation: StationAdapter<{
|
|
|
41
40
|
hasPressure: boolean;
|
|
42
41
|
hasBattery: boolean;
|
|
43
42
|
}, WindnerdAdapterOptions>;
|
|
44
|
-
declare function windnerdHistoryPoints(records: WindnerdRecords, config: Pick<WindnerdStationConfig, "hasTemperature" | "hasPressure" | "elevationM">): HistoryPoint[];
|
|
45
|
-
type WindnerdHistoryQuery = {
|
|
43
|
+
export declare function windnerdHistoryPoints(records: WindnerdRecords, config: Pick<WindnerdStationConfig, "hasTemperature" | "hasPressure" | "elevationM">): HistoryPoint[];
|
|
44
|
+
export type WindnerdHistoryQuery = {
|
|
46
45
|
fromMs: number;
|
|
47
46
|
toMs: number;
|
|
48
47
|
periodMinutes: WindnerdRecordPeriodMinutes;
|
|
49
48
|
};
|
|
50
|
-
declare function loadWindnerdHistory(config: WindnerdStationConfig, query: WindnerdHistoryQuery, options?: WindnerdAdapterOptions): Promise<History>;
|
|
51
|
-
type WindnerdLiveDigest = {
|
|
49
|
+
export declare function loadWindnerdHistory(config: WindnerdStationConfig, query: WindnerdHistoryQuery, options?: WindnerdAdapterOptions): Promise<History>;
|
|
50
|
+
export type WindnerdLiveDigest = {
|
|
52
51
|
observedAt: string;
|
|
53
52
|
windAvgMps: number;
|
|
54
53
|
gustMps: number | null;
|
|
@@ -58,12 +57,12 @@ type WindnerdLiveDigest = {
|
|
|
58
57
|
stationPressureHpa: number | null;
|
|
59
58
|
batteryVoltage: number | null;
|
|
60
59
|
};
|
|
61
|
-
type WindnerdLiveSampleRecord = {
|
|
60
|
+
export type WindnerdLiveSampleRecord = {
|
|
62
61
|
observedAt: string;
|
|
63
62
|
speedMps: number;
|
|
64
63
|
directionDeg: number;
|
|
65
64
|
};
|
|
66
|
-
type WindnerdLiveLocation = {
|
|
65
|
+
export type WindnerdLiveLocation = {
|
|
67
66
|
declaredFavorableDirections: DirectionArc[] | null;
|
|
68
67
|
altitudeM: number | null;
|
|
69
68
|
timeZone: string | null;
|
|
@@ -71,26 +70,24 @@ type WindnerdLiveLocation = {
|
|
|
71
70
|
longitude: number | null;
|
|
72
71
|
standardUtcOffsetMinutes: number | null;
|
|
73
72
|
};
|
|
74
|
-
type WindnerdLiveInit = {
|
|
73
|
+
export type WindnerdLiveInit = {
|
|
75
74
|
digest: WindnerdLiveDigest;
|
|
76
75
|
samples: WindnerdLiveSampleRecord[];
|
|
77
76
|
location: WindnerdLiveLocation | null;
|
|
78
77
|
broadcastDelaySeconds: number | null;
|
|
79
78
|
recentSummaries: RecentSummary[] | null;
|
|
80
79
|
};
|
|
81
|
-
declare function windnerdLiveStreamUrl(config: Pick<WindnerdStationConfig, "stationKey">, base?: string): URL;
|
|
82
|
-
declare function parseWindnerdLiveInit(value: string, locationId: number): WindnerdLiveInit;
|
|
83
|
-
declare function parseWindnerdRecentSummaries(value: unknown): RecentSummary[] | null;
|
|
84
|
-
declare function parseWindnerdLiveLocation(value: unknown): WindnerdLiveLocation | null;
|
|
85
|
-
declare function parseStandardTimeOffset(value: unknown): number | null;
|
|
86
|
-
declare function parseWindnerdLiveDigest(value: unknown, locationId: number): WindnerdLiveDigest;
|
|
87
|
-
declare function parseWindnerdLiveSampleRecords(value: unknown, locationId: number): WindnerdLiveSampleRecord[];
|
|
88
|
-
declare function windnerdLiveReading(digest: WindnerdLiveDigest, config: Pick<WindnerdStationConfig, "hasTemperature" | "hasPressure" | "hasBattery" | "elevationM">): {
|
|
80
|
+
export declare function windnerdLiveStreamUrl(config: Pick<WindnerdStationConfig, "stationKey">, base?: string): URL;
|
|
81
|
+
export declare function parseWindnerdLiveInit(value: string, locationId: number): WindnerdLiveInit;
|
|
82
|
+
export declare function parseWindnerdRecentSummaries(value: unknown): RecentSummary[] | null;
|
|
83
|
+
export declare function parseWindnerdLiveLocation(value: unknown): WindnerdLiveLocation | null;
|
|
84
|
+
export declare function parseStandardTimeOffset(value: unknown): number | null;
|
|
85
|
+
export declare function parseWindnerdLiveDigest(value: unknown, locationId: number): WindnerdLiveDigest;
|
|
86
|
+
export declare function parseWindnerdLiveSampleRecords(value: unknown, locationId: number): WindnerdLiveSampleRecord[];
|
|
87
|
+
export declare function windnerdLiveReading(digest: WindnerdLiveDigest, config: Pick<WindnerdStationConfig, "hasTemperature" | "hasPressure" | "hasBattery" | "elevationM">): {
|
|
89
88
|
reading: Reading;
|
|
90
89
|
telemetry: StationTelemetry | null;
|
|
91
90
|
};
|
|
92
|
-
declare function windnerdLiveSamples(records: WindnerdLiveSampleRecord[]): LiveSamples;
|
|
93
|
-
declare function windnerdEnrichedMeta(config: Pick<WindnerdStationConfig, "latitude" | "longitude" | "timeZone" | "elevationM">, location: WindnerdLiveLocation | null, broadcastDelaySeconds: number | null): Partial<StationMeta>;
|
|
94
|
-
declare function parseWindnerdRecords(value: string, locationId: number, hasPressure?: boolean): WindnerdRecords;
|
|
95
|
-
//#endregion
|
|
96
|
-
export { 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 };
|
|
91
|
+
export declare function windnerdLiveSamples(records: WindnerdLiveSampleRecord[]): LiveSamples;
|
|
92
|
+
export declare function windnerdEnrichedMeta(config: Pick<WindnerdStationConfig, "latitude" | "longitude" | "timeZone" | "elevationM">, location: WindnerdLiveLocation | null, broadcastDelaySeconds: number | null): Partial<StationMeta>;
|
|
93
|
+
export declare function parseWindnerdRecords(value: string, locationId: number, hasPressure?: boolean): WindnerdRecords;
|
|
@@ -5,7 +5,7 @@ import { sseEvents } from "../../sse.js";
|
|
|
5
5
|
import { coalesceUpstreamLoad, fetchUpstreamStream, fetchUpstreamText, logUpstreamFailure, resolveEnvironment } from "../environment.js";
|
|
6
6
|
import { defineStationAdapter } from "../adapter.js";
|
|
7
7
|
import { UpstreamError } from "@azohra/meteo.core";
|
|
8
|
-
|
|
8
|
+
// src/server/adapters/windnerd.ts
|
|
9
9
|
const WINDNERD_RECORDS_URL = "https://windnerd.net/api/records";
|
|
10
10
|
const WINDNERD_LIVE_URL = "https://windnerd.net/api/live-url";
|
|
11
11
|
const RECORD_PERIOD_MINUTES = 1;
|
|
@@ -484,5 +484,4 @@ function recordTimeToIso(value, locationId) {
|
|
|
484
484
|
function isRecord(value) {
|
|
485
485
|
return typeof value === "object" && value !== null;
|
|
486
486
|
}
|
|
487
|
-
//#endregion
|
|
488
487
|
export { WINDNERD_LIVE_INIT_TIMEOUT_MS, WINDNERD_LIVE_SAMPLE_INTERVAL_SECONDS, WINDNERD_RECORDS_URL, loadWindnerdHistory, loadWindnerdLocation, loadWindnerdStation, parseStandardTimeOffset, parseWindnerdLiveDigest, parseWindnerdLiveInit, parseWindnerdLiveLocation, parseWindnerdLiveSampleRecords, parseWindnerdRecentSummaries, parseWindnerdRecords, windnerdEnrichedMeta, windnerdHistoryPoints, windnerdLiveReading, windnerdLiveSamples, windnerdLiveStreamUrl, windnerdStationMeta };
|