meteo-lt-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +280 -0
- package/dist/__tests__/test-utils.d.ts +240 -0
- package/dist/__tests__/test-utils.d.ts.map +1 -0
- package/dist/__tests__/test-utils.js +278 -0
- package/dist/__tests__/test-utils.js.map +1 -0
- package/dist/api/hydro-stations.d.ts +133 -0
- package/dist/api/hydro-stations.d.ts.map +1 -0
- package/dist/api/hydro-stations.js +148 -0
- package/dist/api/hydro-stations.js.map +1 -0
- package/dist/api/index.d.ts +8 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +8 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/places.d.ts +78 -0
- package/dist/api/places.d.ts.map +1 -0
- package/dist/api/places.js +87 -0
- package/dist/api/places.js.map +1 -0
- package/dist/api/stations.d.ts +80 -0
- package/dist/api/stations.d.ts.map +1 -0
- package/dist/api/stations.js +89 -0
- package/dist/api/stations.js.map +1 -0
- package/dist/client/MeteoClient.d.ts +85 -0
- package/dist/client/MeteoClient.d.ts.map +1 -0
- package/dist/client/MeteoClient.js +92 -0
- package/dist/client/MeteoClient.js.map +1 -0
- package/dist/client/config.d.ts +57 -0
- package/dist/client/config.d.ts.map +1 -0
- package/dist/client/config.js +29 -0
- package/dist/client/config.js.map +1 -0
- package/dist/client/http.d.ts +36 -0
- package/dist/client/http.d.ts.map +1 -0
- package/dist/client/http.js +115 -0
- package/dist/client/http.js.map +1 -0
- package/dist/client/index.d.ts +8 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +7 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/rate-limiter.d.ts +64 -0
- package/dist/client/rate-limiter.d.ts.map +1 -0
- package/dist/client/rate-limiter.js +150 -0
- package/dist/client/rate-limiter.js.map +1 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/coordinates.d.ts +26 -0
- package/dist/schemas/coordinates.d.ts.map +1 -0
- package/dist/schemas/coordinates.js +32 -0
- package/dist/schemas/coordinates.js.map +1 -0
- package/dist/schemas/forecasts.d.ts +93 -0
- package/dist/schemas/forecasts.d.ts.map +1 -0
- package/dist/schemas/forecasts.js +38 -0
- package/dist/schemas/forecasts.js.map +1 -0
- package/dist/schemas/hydro-stations.d.ts +172 -0
- package/dist/schemas/hydro-stations.d.ts.map +1 -0
- package/dist/schemas/hydro-stations.js +99 -0
- package/dist/schemas/hydro-stations.js.map +1 -0
- package/dist/schemas/index.d.ts +10 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +15 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/places.d.ts +77 -0
- package/dist/schemas/places.d.ts.map +1 -0
- package/dist/schemas/places.js +45 -0
- package/dist/schemas/places.js.map +1 -0
- package/dist/schemas/stations.d.ts +167 -0
- package/dist/schemas/stations.d.ts.map +1 -0
- package/dist/schemas/stations.js +69 -0
- package/dist/schemas/stations.js.map +1 -0
- package/dist/types/conditions.d.ts +47 -0
- package/dist/types/conditions.d.ts.map +1 -0
- package/dist/types/conditions.js +132 -0
- package/dist/types/conditions.js.map +1 -0
- package/dist/types/coordinates.d.ts +63 -0
- package/dist/types/coordinates.d.ts.map +1 -0
- package/dist/types/coordinates.js +58 -0
- package/dist/types/coordinates.js.map +1 -0
- package/dist/types/errors.d.ts +94 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +116 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/forecasts.d.ts +49 -0
- package/dist/types/forecasts.d.ts.map +1 -0
- package/dist/types/forecasts.js +6 -0
- package/dist/types/forecasts.js.map +1 -0
- package/dist/types/hydro-stations.d.ts +143 -0
- package/dist/types/hydro-stations.d.ts.map +1 -0
- package/dist/types/hydro-stations.js +6 -0
- package/dist/types/hydro-stations.js.map +1 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +9 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/places.d.ts +54 -0
- package/dist/types/places.d.ts.map +1 -0
- package/dist/types/places.js +6 -0
- package/dist/types/places.js.map +1 -0
- package/dist/types/stations.d.ts +90 -0
- package/dist/types/stations.d.ts.map +1 -0
- package/dist/types/stations.js +6 -0
- package/dist/types/stations.js.map +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forecasts.d.ts","sourceRoot":"","sources":["../../src/types/forecasts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,yCAAyC;IACzC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,gDAAgD;IAChD,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,sCAAsC;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,uFAAuF;IACvF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,yDAAyD;IACzD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,+CAA+C;IAC/C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,mCAAmC;IACnC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,wFAAwF;IACxF,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,6BAA6B;IAC7B,QAAQ,CAAC,aAAa,EAAE,qBAAqB,CAAC;CAC/C;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,wBAAwB;IACxB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,uBAAuB;IACvB,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,2DAA2D;IAC3D,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,oCAAoC;IACpC,QAAQ,CAAC,kBAAkB,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forecasts.js","sourceRoot":"","sources":["../../src/types/forecasts.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Hydrological station types for water observations.
|
|
3
|
+
* @module meteo-lt-sdk/types/hydro-stations
|
|
4
|
+
*/
|
|
5
|
+
import type { Coordinates } from './coordinates.js';
|
|
6
|
+
/**
|
|
7
|
+
* Summary information for a hydrological station.
|
|
8
|
+
* Returned by GET /hydro-stations endpoint.
|
|
9
|
+
*/
|
|
10
|
+
export interface HydroStationSummary {
|
|
11
|
+
/** Unique station code used in API requests (e.g., 'nemajunu-vms') */
|
|
12
|
+
readonly code: string;
|
|
13
|
+
/** Human-readable station name */
|
|
14
|
+
readonly name: string;
|
|
15
|
+
/** Name of the water body being monitored */
|
|
16
|
+
readonly waterBody: string;
|
|
17
|
+
/** Geographic coordinates in WGS84 */
|
|
18
|
+
readonly coordinates: Coordinates;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Detailed information for a single hydrological station.
|
|
22
|
+
* Returned by GET /hydro-stations/{station-code} endpoint.
|
|
23
|
+
* Currently same as summary.
|
|
24
|
+
*/
|
|
25
|
+
export type HydroStationDetails = HydroStationSummary;
|
|
26
|
+
/**
|
|
27
|
+
* Types of hydrological observations available.
|
|
28
|
+
*/
|
|
29
|
+
export type HydroObservationType = 'measured' | 'historical';
|
|
30
|
+
/**
|
|
31
|
+
* Information about an available hydrological observation type.
|
|
32
|
+
*/
|
|
33
|
+
export interface HydroObservationTypeInfo {
|
|
34
|
+
/** Observation type identifier */
|
|
35
|
+
readonly type: HydroObservationType;
|
|
36
|
+
/** Human-readable description of the observation type */
|
|
37
|
+
readonly description: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Response containing station info and available observation types.
|
|
41
|
+
* Returned by GET /hydro-stations/{station-code}/observations endpoint.
|
|
42
|
+
*/
|
|
43
|
+
export interface HydroStationObservationTypes {
|
|
44
|
+
/** Station information */
|
|
45
|
+
readonly station: HydroStationSummary;
|
|
46
|
+
/** List of available observation types */
|
|
47
|
+
readonly observationTypes: readonly HydroObservationTypeInfo[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Time range of available measured observation data.
|
|
51
|
+
* Uses datetime format for current year data.
|
|
52
|
+
*/
|
|
53
|
+
export interface MeasuredDataRange {
|
|
54
|
+
/** Start of available data (UTC, ISO 8601 datetime format) */
|
|
55
|
+
readonly startTimeUtc: string;
|
|
56
|
+
/** End of available data (UTC, ISO 8601 datetime format) */
|
|
57
|
+
readonly endTimeUtc: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Date range of available historical observation data.
|
|
61
|
+
* Uses date format for historical data.
|
|
62
|
+
*/
|
|
63
|
+
export interface HistoricalDataRange {
|
|
64
|
+
/** Start of available data (UTC, ISO 8601 date format) */
|
|
65
|
+
readonly startDateUtc: string;
|
|
66
|
+
/** End of available data (UTC, ISO 8601 date format) */
|
|
67
|
+
readonly endDateUtc: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Response containing station info and measured data range.
|
|
71
|
+
* Returned by GET /hydro-stations/{station-code}/observations/measured endpoint.
|
|
72
|
+
*/
|
|
73
|
+
export interface HydroStationMeasuredInfo {
|
|
74
|
+
/** Station information */
|
|
75
|
+
readonly station: HydroStationSummary;
|
|
76
|
+
/** Available measured observation data time range */
|
|
77
|
+
readonly observationsDataRange: MeasuredDataRange;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Response containing station info and historical data range.
|
|
81
|
+
* Returned by GET /hydro-stations/{station-code}/observations/historical endpoint.
|
|
82
|
+
*/
|
|
83
|
+
export interface HydroStationHistoricalInfo {
|
|
84
|
+
/** Station information */
|
|
85
|
+
readonly station: HydroStationSummary;
|
|
86
|
+
/** Available historical observation data date range */
|
|
87
|
+
readonly observationsDataRange: HistoricalDataRange;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* A single measured hydrological observation (current year data).
|
|
91
|
+
* Measurements are taken at specific times throughout the day.
|
|
92
|
+
*/
|
|
93
|
+
export interface MeasuredHydroObservation {
|
|
94
|
+
/** Observation time in UTC (ISO 8601 datetime format) */
|
|
95
|
+
readonly observationTimeUtc: string;
|
|
96
|
+
/** Water level in centimeters */
|
|
97
|
+
readonly waterLevel: number | null;
|
|
98
|
+
/** Water temperature in degrees Celsius (null when ice is present) */
|
|
99
|
+
readonly waterTemperature: number | null;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* A single historical hydrological observation (past years data).
|
|
103
|
+
* Represents daily averages.
|
|
104
|
+
*/
|
|
105
|
+
export interface HistoricalHydroObservation {
|
|
106
|
+
/** Observation date in UTC (ISO 8601 date format) */
|
|
107
|
+
readonly observationDateUtc: string;
|
|
108
|
+
/** Average water level in centimeters for the day */
|
|
109
|
+
readonly waterLevel: number | null;
|
|
110
|
+
/** Average water discharge in m³/s for the day */
|
|
111
|
+
readonly waterDischarge: number | null;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Response containing measured hydrological observations.
|
|
115
|
+
* Returned by GET /hydro-stations/{station-code}/observations/measured/{date} endpoint.
|
|
116
|
+
*/
|
|
117
|
+
export interface HydroStationMeasuredObservations {
|
|
118
|
+
/** Station information */
|
|
119
|
+
readonly station: HydroStationSummary;
|
|
120
|
+
/** Array of measured observation data points */
|
|
121
|
+
readonly observations: readonly MeasuredHydroObservation[];
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Response containing historical hydrological observations.
|
|
125
|
+
* Returned by GET /hydro-stations/{station-code}/observations/historical/{date} endpoint.
|
|
126
|
+
*/
|
|
127
|
+
export interface HydroStationHistoricalObservations {
|
|
128
|
+
/** Station information */
|
|
129
|
+
readonly station: HydroStationSummary;
|
|
130
|
+
/** Array of historical observation data points */
|
|
131
|
+
readonly observations: readonly HistoricalHydroObservation[];
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Valid date parameter for measured observations.
|
|
135
|
+
* Can be 'latest' for last 24 hours or a date string in YYYY-MM-DD format.
|
|
136
|
+
*/
|
|
137
|
+
export type MeasuredDateParam = string;
|
|
138
|
+
/**
|
|
139
|
+
* Valid date parameter for historical observations.
|
|
140
|
+
* Can be 'latest' for last 31 days, YYYY-MM for a month, or YYYY-MM-DD for a day.
|
|
141
|
+
*/
|
|
142
|
+
export type HistoricalDateParam = string;
|
|
143
|
+
//# sourceMappingURL=hydro-stations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydro-stations.d.ts","sourceRoot":"","sources":["../../src/types/hydro-stations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6CAA6C;IAC7C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,sCAAsC;IACtC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,mBAAm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AE,MAAM,GAAG,IAAI,CAAC;IACnC,sEAAsE;IACtE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1C;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,qDAAqD;IACrD,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,qDAAqD;IACrD,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,kDAAkD;IAClD,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC;AAED;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAC/C,0BAA0B;IAC1B,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC,gDAAgD;IAChD,QAAQ,CAAC,YAAY,EAAE,SAAS,wBAAwB,EAAE,CAAC;CAC5D;AAED;;;GAGG;AACH,MAAM,WAAW,kCAAkC;IACjD,0BAA0B;IAC1B,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC,kDAAkD;IAClD,QAAQ,CAAC,YAAY,EAAE,SAAS,0BAA0B,EAAE,CAAC;CAC9D;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEvC;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydro-stations.js","sourceRoot":"","sources":["../../src/types/hydro-stations.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type exports for the Meteo.lt SDK.
|
|
3
|
+
* @module meteo-lt-sdk/types
|
|
4
|
+
*/
|
|
5
|
+
export type { Latitude, Longitude, Coordinates, } from './coordinates.js';
|
|
6
|
+
export { isValidLatitude, isValidLongitude, createLatitude, createLongitude, createCoordinates, } from './coordinates.js';
|
|
7
|
+
export type { ForecastConditionCode, ObservationConditionCode, } from './conditions.js';
|
|
8
|
+
export { FORECAST_CONDITION_CODES, OBSERVATION_CONDITION_CODES, CONDITION_DESCRIPTIONS, isForecastConditionCode, isObservationConditionCode, getConditionDescription, } from './conditions.js';
|
|
9
|
+
export type { PlaceSummary, PlaceDetails, ForecastType, ForecastTypeInfo, PlaceForecastTypes, } from './places.js';
|
|
10
|
+
export type { ForecastTimestamp, Forecast, } from './forecasts.js';
|
|
11
|
+
export type { StationSummary, StationDetails, ObservationsDataRange, StationObservationsInfo, Observation, StationObservations, ObservationDateParam, } from './stations.js';
|
|
12
|
+
export type { HydroStationSummary, HydroStationDetails, HydroObservationType, HydroObservationTypeInfo, HydroStationObservationTypes, MeasuredDataRange, HistoricalDataRange, HydroStationMeasuredInfo, HydroStationHistoricalInfo, MeasuredHydroObservation, HistoricalHydroObservation, HydroStationMeasuredObservations, HydroStationHistoricalObservations, MeasuredDateParam, HistoricalDateParam, } from './hydro-stations.js';
|
|
13
|
+
export { MeteoApiError, MeteoNotFoundError, MeteoRateLimitError, MeteoValidationError, MeteoNetworkError, MeteoTimeoutError, } from './errors.js';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EACV,QAAQ,EACR,SAAS,EACT,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AAGzB,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAGrB,YAAY,EACV,iBAAiB,EACjB,QAAQ,GACT,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACV,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,WAAW,EACX,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAGvB,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,4BAA4B,EAC5B,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,gCAAgC,EAChC,kCAAkC,EAClC,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type exports for the Meteo.lt SDK.
|
|
3
|
+
* @module meteo-lt-sdk/types
|
|
4
|
+
*/
|
|
5
|
+
export { isValidLatitude, isValidLongitude, createLatitude, createLongitude, createCoordinates, } from './coordinates.js';
|
|
6
|
+
export { FORECAST_CONDITION_CODES, OBSERVATION_CONDITION_CODES, CONDITION_DESCRIPTIONS, isForecastConditionCode, isObservationConditionCode, getConditionDescription, } from './conditions.js';
|
|
7
|
+
// Error types
|
|
8
|
+
export { MeteoApiError, MeteoNotFoundError, MeteoRateLimitError, MeteoValidationError, MeteoNetworkError, MeteoTimeoutError, } from './errors.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAQ1B,OAAO,EACL,wBAAwB,EACxB,2BAA2B,EAC3B,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AA+CzB,cAAc;AACd,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Place-related types for locations with weather forecasts.
|
|
3
|
+
* @module meteo-lt-sdk/types/places
|
|
4
|
+
*/
|
|
5
|
+
import type { Coordinates } from './coordinates.js';
|
|
6
|
+
/**
|
|
7
|
+
* Summary information for a place in the places list.
|
|
8
|
+
* Returned by GET /places endpoint.
|
|
9
|
+
*/
|
|
10
|
+
export interface PlaceSummary {
|
|
11
|
+
/** Unique place code used in API requests (e.g., 'vilnius') */
|
|
12
|
+
readonly code: string;
|
|
13
|
+
/** Human-readable place name */
|
|
14
|
+
readonly name: string;
|
|
15
|
+
/** Administrative division the place belongs to */
|
|
16
|
+
readonly administrativeDivision: string;
|
|
17
|
+
/** ISO 3166-1 alpha-2 country code (e.g., 'LT') */
|
|
18
|
+
readonly countryCode: string;
|
|
19
|
+
/** Geographic coordinates in WGS84 */
|
|
20
|
+
readonly coordinates: Coordinates;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Detailed information for a single place.
|
|
24
|
+
* Returned by GET /places/{place-code} endpoint.
|
|
25
|
+
*/
|
|
26
|
+
export interface PlaceDetails extends PlaceSummary {
|
|
27
|
+
/** Full country name */
|
|
28
|
+
readonly country: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Available forecast types.
|
|
32
|
+
* Currently only 'long-term' is supported by the API.
|
|
33
|
+
*/
|
|
34
|
+
export type ForecastType = 'long-term';
|
|
35
|
+
/**
|
|
36
|
+
* Information about an available forecast type.
|
|
37
|
+
*/
|
|
38
|
+
export interface ForecastTypeInfo {
|
|
39
|
+
/** Forecast type identifier */
|
|
40
|
+
readonly type: ForecastType;
|
|
41
|
+
/** Human-readable description of the forecast type */
|
|
42
|
+
readonly description: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Response containing place details and available forecast types.
|
|
46
|
+
* Returned by GET /places/{place-code}/forecasts endpoint.
|
|
47
|
+
*/
|
|
48
|
+
export interface PlaceForecastTypes {
|
|
49
|
+
/** Place information */
|
|
50
|
+
readonly place: PlaceDetails;
|
|
51
|
+
/** List of available forecast types for this place */
|
|
52
|
+
readonly forecastTypes: readonly ForecastTypeInfo[];
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=places.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"places.d.ts","sourceRoot":"","sources":["../../src/types/places.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACxC,mDAAmD;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,sCAAsC;IACtC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,YAAY;IAChD,wBAAwB;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,sDAAsD;IACtD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,wBAAwB;IACxB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,sDAAsD;IACtD,QAAQ,CAAC,aAAa,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"places.js","sourceRoot":"","sources":["../../src/types/places.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Meteorological station types for weather observations.
|
|
3
|
+
* @module meteo-lt-sdk/types/stations
|
|
4
|
+
*/
|
|
5
|
+
import type { Coordinates } from './coordinates.js';
|
|
6
|
+
import type { ObservationConditionCode } from './conditions.js';
|
|
7
|
+
/**
|
|
8
|
+
* Summary information for a meteorological station.
|
|
9
|
+
* Returned by GET /stations endpoint.
|
|
10
|
+
*/
|
|
11
|
+
export interface StationSummary {
|
|
12
|
+
/** Unique station code used in API requests (e.g., 'vilniaus-ams') */
|
|
13
|
+
readonly code: string;
|
|
14
|
+
/** Human-readable station name */
|
|
15
|
+
readonly name: string;
|
|
16
|
+
/** Geographic coordinates in WGS84 */
|
|
17
|
+
readonly coordinates: Coordinates;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Detailed information for a single meteorological station.
|
|
21
|
+
* Returned by GET /stations/{station-code} endpoint.
|
|
22
|
+
*/
|
|
23
|
+
export interface StationDetails extends StationSummary {
|
|
24
|
+
/** Station type classification */
|
|
25
|
+
readonly type: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Time range of available observation data for a station.
|
|
29
|
+
*/
|
|
30
|
+
export interface ObservationsDataRange {
|
|
31
|
+
/** Start of available data (UTC, ISO 8601 format) */
|
|
32
|
+
readonly startTimeUtc: string;
|
|
33
|
+
/** End of available data (UTC, ISO 8601 format) */
|
|
34
|
+
readonly endTimeUtc: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Response containing station info and available data range.
|
|
38
|
+
* Returned by GET /stations/{station-code}/observations endpoint.
|
|
39
|
+
*/
|
|
40
|
+
export interface StationObservationsInfo {
|
|
41
|
+
/** Station information */
|
|
42
|
+
readonly station: StationSummary;
|
|
43
|
+
/** Available observation data time range */
|
|
44
|
+
readonly observationsDataRange: ObservationsDataRange;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A single observation data point from a meteorological station.
|
|
48
|
+
* Some fields may be null if the station doesn't measure that parameter
|
|
49
|
+
* or if the measurement failed (e.g., cloud cover during fog).
|
|
50
|
+
*/
|
|
51
|
+
export interface Observation {
|
|
52
|
+
/** Observation time in UTC (ISO 8601 format) */
|
|
53
|
+
readonly observationTimeUtc: string;
|
|
54
|
+
/** Air temperature in degrees Celsius */
|
|
55
|
+
readonly airTemperature: number | null;
|
|
56
|
+
/** Feels-like temperature in degrees Celsius */
|
|
57
|
+
readonly feelsLikeTemperature: number | null;
|
|
58
|
+
/** Wind speed in meters per second */
|
|
59
|
+
readonly windSpeed: number | null;
|
|
60
|
+
/** Maximum wind gust in m/s over the past hour */
|
|
61
|
+
readonly windGust: number | null;
|
|
62
|
+
/** Wind direction in degrees (0 = from north, 180 = from south) */
|
|
63
|
+
readonly windDirection: number | null;
|
|
64
|
+
/** Cloud cover percentage (0 = clear, 100 = overcast), null if undetermined */
|
|
65
|
+
readonly cloudCover: number | null;
|
|
66
|
+
/** Atmospheric pressure at sea level in hPa */
|
|
67
|
+
readonly seaLevelPressure: number | null;
|
|
68
|
+
/** Relative humidity percentage */
|
|
69
|
+
readonly relativeHumidity: number | null;
|
|
70
|
+
/** Precipitation in mm over the past hour */
|
|
71
|
+
readonly precipitation: number | null;
|
|
72
|
+
/** Weather condition code */
|
|
73
|
+
readonly conditionCode: ObservationConditionCode;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Response containing station observations for a specific date.
|
|
77
|
+
* Returned by GET /stations/{station-code}/observations/{date} endpoint.
|
|
78
|
+
*/
|
|
79
|
+
export interface StationObservations {
|
|
80
|
+
/** Station information */
|
|
81
|
+
readonly station: StationSummary;
|
|
82
|
+
/** Array of observation data points */
|
|
83
|
+
readonly observations: readonly Observation[];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Valid date parameter for station observations.
|
|
87
|
+
* Can be 'latest' for last 24 hours or a date string in YYYY-MM-DD format.
|
|
88
|
+
*/
|
|
89
|
+
export type ObservationDateParam = string;
|
|
90
|
+
//# sourceMappingURL=stations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stations.d.ts","sourceRoot":"","sources":["../../src/types/stations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAEhE;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,cAAc;IACpD,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,qDAAqD;IACrD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,mDAAmD;IACnD,QAAQ,CAAC,UAAU,E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|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stations.js","sourceRoot":"","sources":["../../src/types/stations.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "meteo-lt-sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "TypeScript SDK for the Meteo.lt API - Lithuanian weather forecasts, meteorological and hydrological observations",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"test": "vitest run",
|
|
11
|
+
"test:watch": "vitest",
|
|
12
|
+
"lint": "eslint src",
|
|
13
|
+
"prepublishOnly": "npm run build"
|
|
14
|
+
},
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=18.0.0"
|
|
17
|
+
},
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./types": {
|
|
24
|
+
"types": "./dist/types/index.d.ts",
|
|
25
|
+
"import": "./dist/types/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./schemas": {
|
|
28
|
+
"types": "./dist/schemas/index.d.ts",
|
|
29
|
+
"import": "./dist/schemas/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./client": {
|
|
32
|
+
"types": "./dist/client/index.d.ts",
|
|
33
|
+
"import": "./dist/client/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./api": {
|
|
36
|
+
"types": "./dist/api/index.d.ts",
|
|
37
|
+
"import": "./dist/api/index.js"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"author": {
|
|
41
|
+
"name": "Giedrius Macevičius",
|
|
42
|
+
"email": "gmacev@gmail.com",
|
|
43
|
+
"url": "https://github.com/gmacev/"
|
|
44
|
+
},
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "git+https://github.com/gmacev/meteo-lt-sdk.git"
|
|
48
|
+
},
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "https://github.com/gmacev/meteo-lt-sdk/issues"
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://github.com/gmacev/meteo-lt-sdk#readme",
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"keywords": [
|
|
55
|
+
"meteo",
|
|
56
|
+
"meteo.lt",
|
|
57
|
+
"lithuania",
|
|
58
|
+
"weather",
|
|
59
|
+
"forecast",
|
|
60
|
+
"meteorology",
|
|
61
|
+
"hydrology",
|
|
62
|
+
"api",
|
|
63
|
+
"sdk",
|
|
64
|
+
"typescript",
|
|
65
|
+
"lhmt",
|
|
66
|
+
"orai"
|
|
67
|
+
],
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"@eslint/js": "^9.39.2",
|
|
70
|
+
"@types/node": "^22.0.0",
|
|
71
|
+
"@typescript-eslint/eslint-plugin": "^8.51.0",
|
|
72
|
+
"@typescript-eslint/parser": "^8.51.0",
|
|
73
|
+
"eslint": "^9.39.2",
|
|
74
|
+
"typescript": "^5.5.3",
|
|
75
|
+
"typescript-eslint": "^8.51.0",
|
|
76
|
+
"vitest": "^2.0.0"
|
|
77
|
+
},
|
|
78
|
+
"publishConfig": {
|
|
79
|
+
"access": "public"
|
|
80
|
+
},
|
|
81
|
+
"sideEffects": false,
|
|
82
|
+
"files": [
|
|
83
|
+
"dist",
|
|
84
|
+
"README.md",
|
|
85
|
+
"LICENSE"
|
|
86
|
+
],
|
|
87
|
+
"dependencies": {
|
|
88
|
+
"zod": "^4.3.4"
|
|
89
|
+
}
|
|
90
|
+
}
|