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.
Files changed (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +280 -0
  3. package/dist/__tests__/test-utils.d.ts +240 -0
  4. package/dist/__tests__/test-utils.d.ts.map +1 -0
  5. package/dist/__tests__/test-utils.js +278 -0
  6. package/dist/__tests__/test-utils.js.map +1 -0
  7. package/dist/api/hydro-stations.d.ts +133 -0
  8. package/dist/api/hydro-stations.d.ts.map +1 -0
  9. package/dist/api/hydro-stations.js +148 -0
  10. package/dist/api/hydro-stations.js.map +1 -0
  11. package/dist/api/index.d.ts +8 -0
  12. package/dist/api/index.d.ts.map +1 -0
  13. package/dist/api/index.js +8 -0
  14. package/dist/api/index.js.map +1 -0
  15. package/dist/api/places.d.ts +78 -0
  16. package/dist/api/places.d.ts.map +1 -0
  17. package/dist/api/places.js +87 -0
  18. package/dist/api/places.js.map +1 -0
  19. package/dist/api/stations.d.ts +80 -0
  20. package/dist/api/stations.d.ts.map +1 -0
  21. package/dist/api/stations.js +89 -0
  22. package/dist/api/stations.js.map +1 -0
  23. package/dist/client/MeteoClient.d.ts +85 -0
  24. package/dist/client/MeteoClient.d.ts.map +1 -0
  25. package/dist/client/MeteoClient.js +92 -0
  26. package/dist/client/MeteoClient.js.map +1 -0
  27. package/dist/client/config.d.ts +57 -0
  28. package/dist/client/config.d.ts.map +1 -0
  29. package/dist/client/config.js +29 -0
  30. package/dist/client/config.js.map +1 -0
  31. package/dist/client/http.d.ts +36 -0
  32. package/dist/client/http.d.ts.map +1 -0
  33. package/dist/client/http.js +115 -0
  34. package/dist/client/http.js.map +1 -0
  35. package/dist/client/index.d.ts +8 -0
  36. package/dist/client/index.d.ts.map +1 -0
  37. package/dist/client/index.js +7 -0
  38. package/dist/client/index.js.map +1 -0
  39. package/dist/client/rate-limiter.d.ts +64 -0
  40. package/dist/client/rate-limiter.d.ts.map +1 -0
  41. package/dist/client/rate-limiter.js +150 -0
  42. package/dist/client/rate-limiter.js.map +1 -0
  43. package/dist/index.d.ts +36 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +43 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/schemas/coordinates.d.ts +26 -0
  48. package/dist/schemas/coordinates.d.ts.map +1 -0
  49. package/dist/schemas/coordinates.js +32 -0
  50. package/dist/schemas/coordinates.js.map +1 -0
  51. package/dist/schemas/forecasts.d.ts +93 -0
  52. package/dist/schemas/forecasts.d.ts.map +1 -0
  53. package/dist/schemas/forecasts.js +38 -0
  54. package/dist/schemas/forecasts.js.map +1 -0
  55. package/dist/schemas/hydro-stations.d.ts +172 -0
  56. package/dist/schemas/hydro-stations.d.ts.map +1 -0
  57. package/dist/schemas/hydro-stations.js +99 -0
  58. package/dist/schemas/hydro-stations.js.map +1 -0
  59. package/dist/schemas/index.d.ts +10 -0
  60. package/dist/schemas/index.d.ts.map +1 -0
  61. package/dist/schemas/index.js +15 -0
  62. package/dist/schemas/index.js.map +1 -0
  63. package/dist/schemas/places.d.ts +77 -0
  64. package/dist/schemas/places.d.ts.map +1 -0
  65. package/dist/schemas/places.js +45 -0
  66. package/dist/schemas/places.js.map +1 -0
  67. package/dist/schemas/stations.d.ts +167 -0
  68. package/dist/schemas/stations.d.ts.map +1 -0
  69. package/dist/schemas/stations.js +69 -0
  70. package/dist/schemas/stations.js.map +1 -0
  71. package/dist/types/conditions.d.ts +47 -0
  72. package/dist/types/conditions.d.ts.map +1 -0
  73. package/dist/types/conditions.js +132 -0
  74. package/dist/types/conditions.js.map +1 -0
  75. package/dist/types/coordinates.d.ts +63 -0
  76. package/dist/types/coordinates.d.ts.map +1 -0
  77. package/dist/types/coordinates.js +58 -0
  78. package/dist/types/coordinates.js.map +1 -0
  79. package/dist/types/errors.d.ts +94 -0
  80. package/dist/types/errors.d.ts.map +1 -0
  81. package/dist/types/errors.js +116 -0
  82. package/dist/types/errors.js.map +1 -0
  83. package/dist/types/forecasts.d.ts +49 -0
  84. package/dist/types/forecasts.d.ts.map +1 -0
  85. package/dist/types/forecasts.js +6 -0
  86. package/dist/types/forecasts.js.map +1 -0
  87. package/dist/types/hydro-stations.d.ts +143 -0
  88. package/dist/types/hydro-stations.d.ts.map +1 -0
  89. package/dist/types/hydro-stations.js +6 -0
  90. package/dist/types/hydro-stations.js.map +1 -0
  91. package/dist/types/index.d.ts +14 -0
  92. package/dist/types/index.d.ts.map +1 -0
  93. package/dist/types/index.js +9 -0
  94. package/dist/types/index.js.map +1 -0
  95. package/dist/types/places.d.ts +54 -0
  96. package/dist/types/places.d.ts.map +1 -0
  97. package/dist/types/places.js +6 -0
  98. package/dist/types/places.js.map +1 -0
  99. package/dist/types/stations.d.ts +90 -0
  100. package/dist/types/stations.d.ts.map +1 -0
  101. package/dist/types/stations.js +6 -0
  102. package/dist/types/stations.js.map +1 -0
  103. package/package.json +90 -0
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @fileoverview Zod schemas for meteorological station data validation.
3
+ * @module meteo-lt-sdk/schemas/stations
4
+ */
5
+ import { z } from 'zod';
6
+ import { coordinatesSchema } from './coordinates.js';
7
+ import { OBSERVATION_CONDITION_CODES } from '../types/conditions.js';
8
+ /**
9
+ * Schema for observation condition codes.
10
+ * Allows null for unknown conditions.
11
+ */
12
+ const observationConditionCodeSchema = z.enum(OBSERVATION_CONDITION_CODES).nullable();
13
+ /**
14
+ * Schema for station summary (list item).
15
+ */
16
+ export const stationSummarySchema = z.object({
17
+ code: z.string().min(1),
18
+ name: z.string().min(1),
19
+ coordinates: coordinatesSchema,
20
+ });
21
+ /**
22
+ * Schema for an array of station summaries.
23
+ */
24
+ export const stationSummaryArraySchema = z.array(stationSummarySchema);
25
+ /**
26
+ * Schema for detailed station information.
27
+ */
28
+ export const stationDetailsSchema = stationSummarySchema.extend({
29
+ type: z.string(),
30
+ });
31
+ /**
32
+ * Schema for observations data range.
33
+ */
34
+ export const observationsDataRangeSchema = z.object({
35
+ startTimeUtc: z.string(),
36
+ endTimeUtc: z.string(),
37
+ });
38
+ /**
39
+ * Schema for station observations info response.
40
+ */
41
+ export const stationObservationsInfoSchema = z.object({
42
+ station: stationSummarySchema,
43
+ observationsDataRange: observationsDataRangeSchema,
44
+ });
45
+ /**
46
+ * Schema for a single observation data point.
47
+ * Most fields are nullable since not all stations measure all parameters.
48
+ */
49
+ export const observationSchema = z.object({
50
+ observationTimeUtc: z.string(),
51
+ airTemperature: z.number().nullable(),
52
+ feelsLikeTemperature: z.number().nullable(),
53
+ windSpeed: z.number().nonnegative().nullable(),
54
+ windGust: z.number().nonnegative().nullable(),
55
+ windDirection: z.number().min(0).max(360).nullable(),
56
+ cloudCover: z.number().min(0).max(100).nullable(),
57
+ seaLevelPressure: z.number().positive().nullable(),
58
+ relativeHumidity: z.number().min(0).max(100).nullable(),
59
+ precipitation: z.number().nonnegative().nullable(),
60
+ conditionCode: observationConditionCodeSchema,
61
+ });
62
+ /**
63
+ * Schema for station observations response.
64
+ */
65
+ export const stationObservationsSchema = z.object({
66
+ station: stationSummarySchema,
67
+ observations: z.array(observationSchema),
68
+ });
69
+ //# sourceMappingURL=stations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stations.js","sourceRoot":"","sources":["../../src/schemas/stations.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAUrE;;;GAGG;AACH,MAAM,8BAA8B,GAAG,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC,QAAQ,EAAE,CAAC;AAEtF;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,iBAAiB;CAC/B,CAAqC,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;AAEvE;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,MAAM,CAAC;IAC9D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAqC,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAA4C,CAAC;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,OAAO,EAAE,oBAAoB;IAC7B,qBAAqB,EAAE,2BAA2B;CACnD,CAA8C,CAAC;AAEhD;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,oBAAoB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAC9C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAC7C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACpD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACjD,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAClD,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACvD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;IAClD,aAAa,EAAE,8BAA8B;CAC9C,CAAkC,CAAC;AAEpC;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,oBAAoB;IAC7B,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC;CACzC,CAA0C,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @fileoverview Weather condition codes for forecasts and observations.
3
+ * @module meteo-lt-sdk/types/conditions
4
+ */
5
+ /**
6
+ * Weather condition codes used in forecast data.
7
+ * These are the possible values returned by the forecast API.
8
+ */
9
+ export declare const FORECAST_CONDITION_CODES: readonly ["clear", "partly-cloudy", "cloudy-with-sunny-intervals", "cloudy", "light-rain", "rain", "heavy-rain", "thunder", "isolated-thunderstorms", "thunderstorms", "heavy-rain-with-thunderstorms", "light-sleet", "sleet", "freezing-rain", "hail", "light-snow", "snow", "heavy-snow", "fog"];
10
+ /**
11
+ * Weather condition code type for forecast data.
12
+ * Null indicates conditions could not be determined.
13
+ */
14
+ export type ForecastConditionCode = (typeof FORECAST_CONDITION_CODES)[number] | null;
15
+ /**
16
+ * Weather condition codes used in observation data.
17
+ * This is a superset of forecast conditions with additional observational values.
18
+ */
19
+ export declare const OBSERVATION_CONDITION_CODES: readonly ["clear", "partly-cloudy", "variable-cloudiness", "cloudy-with-sunny-intervals", "cloudy", "rain-showers", "light-rain-at-times", "rain-at-times", "light-rain", "rain", "heavy-rain", "thunder", "isolated-thunderstorms", "thunderstorms", "sleet-showers", "sleet-at-times", "light-sleet", "sleet", "freezing-rain", "hail", "snow-showers", "light-snow-at-times", "snow-at-times", "light-snow", "snow", "heavy-snow", "snowstorm", "fog", "squall"];
20
+ /**
21
+ * Weather condition code type for observation data.
22
+ * Null indicates conditions could not be determined.
23
+ */
24
+ export type ObservationConditionCode = (typeof OBSERVATION_CONDITION_CODES)[number] | null;
25
+ /**
26
+ * Type guard to check if a value is a valid forecast condition code.
27
+ * @param value - The value to check
28
+ * @returns True if the value is a valid forecast condition code
29
+ */
30
+ export declare function isForecastConditionCode(value: unknown): value is ForecastConditionCode;
31
+ /**
32
+ * Type guard to check if a value is a valid observation condition code.
33
+ * @param value - The value to check
34
+ * @returns True if the value is a valid observation condition code
35
+ */
36
+ export declare function isObservationConditionCode(value: unknown): value is ObservationConditionCode;
37
+ /**
38
+ * Human-readable descriptions for weather condition codes in English.
39
+ */
40
+ export declare const CONDITION_DESCRIPTIONS: Readonly<Record<string, string>>;
41
+ /**
42
+ * Gets the human-readable description for a condition code.
43
+ * @param code - The condition code
44
+ * @returns Human-readable description or 'Unknown' if not found
45
+ */
46
+ export declare function getConditionDescription(code: ForecastConditionCode | ObservationConditionCode): string;
47
+ //# sourceMappingURL=conditions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditions.d.ts","sourceRoot":"","sources":["../../src/types/conditions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,eAAO,MAAM,wBAAwB,qSAoB3B,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAErF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,qcA8B9B,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE3F;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,qBAAqB,CAItF;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,wBAAwB,CAI5F;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA+B1D,CAAC;AAEX;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,qBAAqB,GAAG,wBAAwB,GAAG,MAAM,CAGtG"}
@@ -0,0 +1,132 @@
1
+ /**
2
+ * @fileoverview Weather condition codes for forecasts and observations.
3
+ * @module meteo-lt-sdk/types/conditions
4
+ */
5
+ /**
6
+ * Weather condition codes used in forecast data.
7
+ * These are the possible values returned by the forecast API.
8
+ */
9
+ export const FORECAST_CONDITION_CODES = [
10
+ 'clear',
11
+ 'partly-cloudy',
12
+ 'cloudy-with-sunny-intervals',
13
+ 'cloudy',
14
+ 'light-rain',
15
+ 'rain',
16
+ 'heavy-rain',
17
+ 'thunder',
18
+ 'isolated-thunderstorms',
19
+ 'thunderstorms',
20
+ 'heavy-rain-with-thunderstorms',
21
+ 'light-sleet',
22
+ 'sleet',
23
+ 'freezing-rain',
24
+ 'hail',
25
+ 'light-snow',
26
+ 'snow',
27
+ 'heavy-snow',
28
+ 'fog',
29
+ ];
30
+ /**
31
+ * Weather condition codes used in observation data.
32
+ * This is a superset of forecast conditions with additional observational values.
33
+ */
34
+ export const OBSERVATION_CONDITION_CODES = [
35
+ 'clear',
36
+ 'partly-cloudy',
37
+ 'variable-cloudiness',
38
+ 'cloudy-with-sunny-intervals',
39
+ 'cloudy',
40
+ 'rain-showers',
41
+ 'light-rain-at-times',
42
+ 'rain-at-times',
43
+ 'light-rain',
44
+ 'rain',
45
+ 'heavy-rain',
46
+ 'thunder',
47
+ 'isolated-thunderstorms',
48
+ 'thunderstorms',
49
+ 'sleet-showers',
50
+ 'sleet-at-times',
51
+ 'light-sleet',
52
+ 'sleet',
53
+ 'freezing-rain',
54
+ 'hail',
55
+ 'snow-showers',
56
+ 'light-snow-at-times',
57
+ 'snow-at-times',
58
+ 'light-snow',
59
+ 'snow',
60
+ 'heavy-snow',
61
+ 'snowstorm',
62
+ 'fog',
63
+ 'squall',
64
+ ];
65
+ /**
66
+ * Type guard to check if a value is a valid forecast condition code.
67
+ * @param value - The value to check
68
+ * @returns True if the value is a valid forecast condition code
69
+ */
70
+ export function isForecastConditionCode(value) {
71
+ if (value === null)
72
+ return true;
73
+ return typeof value === 'string' &&
74
+ FORECAST_CONDITION_CODES.includes(value);
75
+ }
76
+ /**
77
+ * Type guard to check if a value is a valid observation condition code.
78
+ * @param value - The value to check
79
+ * @returns True if the value is a valid observation condition code
80
+ */
81
+ export function isObservationConditionCode(value) {
82
+ if (value === null)
83
+ return true;
84
+ return typeof value === 'string' &&
85
+ OBSERVATION_CONDITION_CODES.includes(value);
86
+ }
87
+ /**
88
+ * Human-readable descriptions for weather condition codes in English.
89
+ */
90
+ export const CONDITION_DESCRIPTIONS = {
91
+ 'clear': 'Clear',
92
+ 'partly-cloudy': 'Partly cloudy',
93
+ 'variable-cloudiness': 'Variable cloudiness',
94
+ 'cloudy-with-sunny-intervals': 'Cloudy with sunny intervals',
95
+ 'cloudy': 'Cloudy',
96
+ 'rain-showers': 'Rain showers',
97
+ 'light-rain-at-times': 'Light rain at times',
98
+ 'rain-at-times': 'Rain at times',
99
+ 'light-rain': 'Light rain',
100
+ 'rain': 'Rain',
101
+ 'heavy-rain': 'Heavy rain',
102
+ 'thunder': 'Thunder',
103
+ 'isolated-thunderstorms': 'Isolated thunderstorms',
104
+ 'thunderstorms': 'Thunderstorms',
105
+ 'heavy-rain-with-thunderstorms': 'Heavy rain with thunderstorms',
106
+ 'sleet-showers': 'Sleet showers',
107
+ 'sleet-at-times': 'Sleet at times',
108
+ 'light-sleet': 'Light sleet',
109
+ 'sleet': 'Sleet',
110
+ 'freezing-rain': 'Freezing rain',
111
+ 'hail': 'Hail',
112
+ 'snow-showers': 'Snow showers',
113
+ 'light-snow-at-times': 'Light snow at times',
114
+ 'snow-at-times': 'Snow at times',
115
+ 'light-snow': 'Light snow',
116
+ 'snow': 'Snow',
117
+ 'heavy-snow': 'Heavy snow',
118
+ 'snowstorm': 'Snowstorm',
119
+ 'fog': 'Fog',
120
+ 'squall': 'Squall',
121
+ };
122
+ /**
123
+ * Gets the human-readable description for a condition code.
124
+ * @param code - The condition code
125
+ * @returns Human-readable description or 'Unknown' if not found
126
+ */
127
+ export function getConditionDescription(code) {
128
+ if (code === null)
129
+ return 'Unknown';
130
+ return CONDITION_DESCRIPTIONS[code] ?? 'Unknown';
131
+ }
132
+ //# sourceMappingURL=conditions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../src/types/conditions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,OAAO;IACP,eAAe;IACf,6BAA6B;IAC7B,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,YAAY;IACZ,SAAS;IACT,wBAAwB;IACxB,eAAe;IACf,+BAA+B;IAC/B,aAAa;IACb,OAAO;IACP,eAAe;IACf,MAAM;IACN,YAAY;IACZ,MAAM;IACN,YAAY;IACZ,KAAK;CACG,CAAC;AAQX;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,OAAO;IACP,eAAe;IACf,qBAAqB;IACrB,6BAA6B;IAC7B,QAAQ;IACR,cAAc;IACd,qBAAqB;IACrB,eAAe;IACf,YAAY;IACZ,MAAM;IACN,YAAY;IACZ,SAAS;IACT,wBAAwB;IACxB,eAAe;IACf,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,OAAO;IACP,eAAe;IACf,MAAM;IACN,cAAc;IACd,qBAAqB;IACrB,eAAe;IACf,YAAY;IACZ,MAAM;IACN,YAAY;IACZ,WAAW;IACX,KAAK;IACL,QAAQ;CACA,CAAC;AAQX;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAc;IACpD,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,OAAO,OAAO,KAAK,KAAK,QAAQ;QAC7B,wBAA8C,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACpE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,KAAc;IACvD,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,OAAO,OAAO,KAAK,KAAK,QAAQ;QAC7B,2BAAiD,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACvE,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAqC;IACtE,OAAO,EAAE,OAAO;IAChB,eAAe,EAAE,eAAe;IAChC,qBAAqB,EAAE,qBAAqB;IAC5C,6BAA6B,EAAE,6BAA6B;IAC5D,QAAQ,EAAE,QAAQ;IAClB,cAAc,EAAE,cAAc;IAC9B,qBAAqB,EAAE,qBAAqB;IAC5C,eAAe,EAAE,eAAe;IAChC,YAAY,EAAE,YAAY;IAC1B,MAAM,EAAE,MAAM;IACd,YAAY,EAAE,YAAY;IAC1B,SAAS,EAAE,SAAS;IACpB,wBAAwB,EAAE,wBAAwB;IAClD,eAAe,EAAE,eAAe;IAChC,+BAA+B,EAAE,+BAA+B;IAChE,eAAe,EAAE,eAAe;IAChC,gBAAgB,EAAE,gBAAgB;IAClC,aAAa,EAAE,aAAa;IAC5B,OAAO,EAAE,OAAO;IAChB,eAAe,EAAE,eAAe;IAChC,MAAM,EAAE,MAAM;IACd,cAAc,EAAE,cAAc;IAC9B,qBAAqB,EAAE,qBAAqB;IAC5C,eAAe,EAAE,eAAe;IAChC,YAAY,EAAE,YAAY;IAC1B,MAAM,EAAE,MAAM;IACd,YAAY,EAAE,YAAY;IAC1B,WAAW,EAAE,WAAW;IACxB,KAAK,EAAE,KAAK;IACZ,QAAQ,EAAE,QAAQ;CACV,CAAC;AAEX;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAsD;IAC5F,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IACpC,OAAO,sBAAsB,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC;AACnD,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * @fileoverview Coordinate types for WGS84 geographic coordinates.
3
+ * @module meteo-lt-sdk/types/coordinates
4
+ */
5
+ /**
6
+ * Branded type for latitude values in decimal degrees.
7
+ * Valid range: -90 to 90
8
+ */
9
+ export type Latitude = number & {
10
+ readonly __brand: 'Latitude';
11
+ };
12
+ /**
13
+ * Branded type for longitude values in decimal degrees.
14
+ * Valid range: -180 to 180
15
+ */
16
+ export type Longitude = number & {
17
+ readonly __brand: 'Longitude';
18
+ };
19
+ /**
20
+ * Geographic coordinates in WGS84 decimal degrees format.
21
+ * Used throughout the API for location data.
22
+ */
23
+ export interface Coordinates {
24
+ /** Latitude in decimal degrees (-90 to 90) */
25
+ readonly latitude: Latitude;
26
+ /** Longitude in decimal degrees (-180 to 180) */
27
+ readonly longitude: Longitude;
28
+ }
29
+ /**
30
+ * Type guard to check if a number is a valid latitude value.
31
+ * @param value - The value to check
32
+ * @returns True if the value is a valid latitude (-90 to 90)
33
+ */
34
+ export declare function isValidLatitude(value: number): value is Latitude;
35
+ /**
36
+ * Type guard to check if a number is a valid longitude value.
37
+ * @param value - The value to check
38
+ * @returns True if the value is a valid longitude (-180 to 180)
39
+ */
40
+ export declare function isValidLongitude(value: number): value is Longitude;
41
+ /**
42
+ * Creates a branded Latitude value from a number.
43
+ * @param value - The latitude value in decimal degrees
44
+ * @returns Branded Latitude value
45
+ * @throws {RangeError} If the value is outside the valid range
46
+ */
47
+ export declare function createLatitude(value: number): Latitude;
48
+ /**
49
+ * Creates a branded Longitude value from a number.
50
+ * @param value - The longitude value in decimal degrees
51
+ * @returns Branded Longitude value
52
+ * @throws {RangeError} If the value is outside the valid range
53
+ */
54
+ export declare function createLongitude(value: number): Longitude;
55
+ /**
56
+ * Creates a Coordinates object from latitude and longitude values.
57
+ * @param latitude - The latitude value in decimal degrees
58
+ * @param longitude - The longitude value in decimal degrees
59
+ * @returns Coordinates object with branded latitude and longitude
60
+ * @throws {RangeError} If either value is outside the valid range
61
+ */
62
+ export declare function createCoordinates(latitude: number, longitude: number): Coordinates;
63
+ //# sourceMappingURL=coordinates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinates.d.ts","sourceRoot":"","sources":["../../src/types/coordinates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAA;CAAE,CAAC;AAEjE;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,iDAAiD;IACjD,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,QAAQ,CAEhE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,SAAS,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,CAKtD;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAKxD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,WAAW,CAKlF"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * @fileoverview Coordinate types for WGS84 geographic coordinates.
3
+ * @module meteo-lt-sdk/types/coordinates
4
+ */
5
+ /**
6
+ * Type guard to check if a number is a valid latitude value.
7
+ * @param value - The value to check
8
+ * @returns True if the value is a valid latitude (-90 to 90)
9
+ */
10
+ export function isValidLatitude(value) {
11
+ return value >= -90 && value <= 90;
12
+ }
13
+ /**
14
+ * Type guard to check if a number is a valid longitude value.
15
+ * @param value - The value to check
16
+ * @returns True if the value is a valid longitude (-180 to 180)
17
+ */
18
+ export function isValidLongitude(value) {
19
+ return value >= -180 && value <= 180;
20
+ }
21
+ /**
22
+ * Creates a branded Latitude value from a number.
23
+ * @param value - The latitude value in decimal degrees
24
+ * @returns Branded Latitude value
25
+ * @throws {RangeError} If the value is outside the valid range
26
+ */
27
+ export function createLatitude(value) {
28
+ if (!isValidLatitude(value)) {
29
+ throw new RangeError(`Latitude must be between -90 and 90, got: ${String(value)}`);
30
+ }
31
+ return value;
32
+ }
33
+ /**
34
+ * Creates a branded Longitude value from a number.
35
+ * @param value - The longitude value in decimal degrees
36
+ * @returns Branded Longitude value
37
+ * @throws {RangeError} If the value is outside the valid range
38
+ */
39
+ export function createLongitude(value) {
40
+ if (!isValidLongitude(value)) {
41
+ throw new RangeError(`Longitude must be between -180 and 180, got: ${String(value)}`);
42
+ }
43
+ return value;
44
+ }
45
+ /**
46
+ * Creates a Coordinates object from latitude and longitude values.
47
+ * @param latitude - The latitude value in decimal degrees
48
+ * @param longitude - The longitude value in decimal degrees
49
+ * @returns Coordinates object with branded latitude and longitude
50
+ * @throws {RangeError} If either value is outside the valid range
51
+ */
52
+ export function createCoordinates(latitude, longitude) {
53
+ return {
54
+ latitude: createLatitude(latitude),
55
+ longitude: createLongitude(longitude),
56
+ };
57
+ }
58
+ //# sourceMappingURL=coordinates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinates.js","sourceRoot":"","sources":["../../src/types/coordinates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyBH;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,OAAO,KAAK,IAAI,CAAC,EAAE,IAAI,KAAK,IAAI,EAAE,CAAC;AACrC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,OAAO,KAAK,IAAI,CAAC,GAAG,IAAI,KAAK,IAAI,GAAG,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa;IAC1C,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,UAAU,CAAC,6CAA6C,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACrF,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,UAAU,CAAC,gDAAgD,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACxF,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAgB,EAAE,SAAiB;IACnE,OAAO;QACL,QAAQ,EAAE,cAAc,CAAC,QAAQ,CAAC;QAClC,SAAS,EAAE,eAAe,CAAC,SAAS,CAAC;KACtC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,94 @@
1
+ /**
2
+ * @fileoverview Error types for the Meteo.lt SDK.
3
+ * @module meteo-lt-sdk/types/errors
4
+ */
5
+ /**
6
+ * Base error class for all Meteo.lt API errors.
7
+ * Contains the HTTP status code and response body for debugging.
8
+ */
9
+ export declare class MeteoApiError extends Error {
10
+ readonly statusCode: number;
11
+ readonly responseBody?: string | undefined;
12
+ /** Error name for instanceof checks */
13
+ readonly name: string;
14
+ /**
15
+ * Creates a new MeteoApiError.
16
+ * @param message - Human-readable error message
17
+ * @param statusCode - HTTP status code from the API response
18
+ * @param responseBody - Raw response body for debugging
19
+ */
20
+ constructor(message: string, statusCode: number, responseBody?: string | undefined);
21
+ }
22
+ /**
23
+ * Error thrown when a requested resource is not found (HTTP 404).
24
+ * This can occur when:
25
+ * - A place code doesn't exist
26
+ * - A station code doesn't exist
27
+ * - No observations exist for the requested date
28
+ */
29
+ export declare class MeteoNotFoundError extends MeteoApiError {
30
+ readonly resource: string;
31
+ readonly name: string;
32
+ /**
33
+ * Creates a new MeteoNotFoundError.
34
+ * @param resource - Description of the resource that wasn't found
35
+ * @param responseBody - Raw response body for debugging
36
+ */
37
+ constructor(resource: string, responseBody?: string);
38
+ }
39
+ /**
40
+ * Error thrown when the rate limit is exceeded (HTTP 429).
41
+ * The API limits requests to 180 per minute per IP address.
42
+ */
43
+ export declare class MeteoRateLimitError extends MeteoApiError {
44
+ readonly retryAfterSeconds?: number | undefined;
45
+ readonly name: string;
46
+ /**
47
+ * Creates a new MeteoRateLimitError.
48
+ * @param retryAfterSeconds - Seconds to wait before retrying (if provided by API)
49
+ * @param responseBody - Raw response body for debugging
50
+ */
51
+ constructor(retryAfterSeconds?: number | undefined, responseBody?: string);
52
+ }
53
+ /**
54
+ * Error thrown when response validation fails.
55
+ * This indicates the API returned data that doesn't match the expected schema.
56
+ */
57
+ export declare class MeteoValidationError extends MeteoApiError {
58
+ readonly validationErrors: readonly string[];
59
+ readonly name: string;
60
+ /**
61
+ * Creates a new MeteoValidationError.
62
+ * @param message - Description of what validation failed
63
+ * @param validationErrors - Detailed validation error information
64
+ * @param responseBody - Raw response body for debugging
65
+ */
66
+ constructor(message: string, validationErrors: readonly string[], responseBody?: string);
67
+ }
68
+ /**
69
+ * Error thrown when a network request fails.
70
+ * This wraps fetch errors for consistent error handling.
71
+ */
72
+ export declare class MeteoNetworkError extends MeteoApiError {
73
+ readonly cause?: Error | undefined;
74
+ readonly name: string;
75
+ /**
76
+ * Creates a new MeteoNetworkError.
77
+ * @param message - Description of the network error
78
+ * @param cause - Original error that caused this error
79
+ */
80
+ constructor(message: string, cause?: Error | undefined);
81
+ }
82
+ /**
83
+ * Error thrown when a request times out.
84
+ */
85
+ export declare class MeteoTimeoutError extends MeteoApiError {
86
+ readonly timeoutMs: number;
87
+ readonly name: string;
88
+ /**
89
+ * Creates a new MeteoTimeoutError.
90
+ * @param timeoutMs - The timeout value in milliseconds
91
+ */
92
+ constructor(timeoutMs: number);
93
+ }
94
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/types/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,qBAAa,aAAc,SAAQ,KAAK;aAYpB,UAAU,EAAE,MAAM;aAClB,YAAY,CAAC,EAAE,MAAM;IAZvC,uCAAuC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAmB;IAExC;;;;;OAKG;gBAED,OAAO,EAAE,MAAM,EACC,UAAU,EAAE,MAAM,EAClB,YAAY,CAAC,EAAE,MAAM,YAAA;CAIxC;AAED;;;;;;GAMG;AACH,qBAAa,kBAAmB,SAAQ,aAAa;aASjC,QAAQ,EAAE,MAAM;IARlC,SAAkB,IAAI,EAAE,MAAM,CAAwB;IAEtD;;;;OAIG;gBAEe,QAAQ,EAAE,MAAM,EAChC,YAAY,CAAC,EAAE,MAAM;CAIxB;AAED;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,aAAa;aASlC,iBAAiB,CAAC,EAAE,MAAM;IAR5C,SAAkB,IAAI,EAAE,MAAM,CAAyB;IAEvD;;;;OAIG;gBAEe,iBAAiB,CAAC,EAAE,MAAM,YAAA,EAC1C,YAAY,CAAC,EAAE,MAAM;CAOxB;AAED;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,aAAa;aAWnC,gBAAgB,EAAE,SAAS,MAAM,EAAE;IAVrD,SAAkB,IAAI,EAAE,MAAM,CAA0B;IAExD;;;;;OAKG;gBAED,OAAO,EAAE,MAAM,EACC,gBAAgB,EAAE,SAAS,MAAM,EAAE,EACnD,YAAY,CAAC,EAAE,MAAM;CAIxB;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,aAAa;aAUhC,KAAK,CAAC,EAAE,KAAK;IAT/B,SAAkB,IAAI,EAAE,MAAM,CAAuB;IAErD;;;;OAIG;gBAED,OAAO,EAAE,MAAM,EACC,KAAK,CAAC,EAAE,KAAK,YAAA;CAIhC;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,aAAa;aAOtB,SAAS,EAAE,MAAM;IAN7C,SAAkB,IAAI,EAAE,MAAM,CAAuB;IAErD;;;OAGG;gBACyB,SAAS,EAAE,MAAM;CAG9C"}
@@ -0,0 +1,116 @@
1
+ /**
2
+ * @fileoverview Error types for the Meteo.lt SDK.
3
+ * @module meteo-lt-sdk/types/errors
4
+ */
5
+ /**
6
+ * Base error class for all Meteo.lt API errors.
7
+ * Contains the HTTP status code and response body for debugging.
8
+ */
9
+ export class MeteoApiError extends Error {
10
+ statusCode;
11
+ responseBody;
12
+ /** Error name for instanceof checks */
13
+ name = 'MeteoApiError';
14
+ /**
15
+ * Creates a new MeteoApiError.
16
+ * @param message - Human-readable error message
17
+ * @param statusCode - HTTP status code from the API response
18
+ * @param responseBody - Raw response body for debugging
19
+ */
20
+ constructor(message, statusCode, responseBody) {
21
+ super(message);
22
+ this.statusCode = statusCode;
23
+ this.responseBody = responseBody;
24
+ }
25
+ }
26
+ /**
27
+ * Error thrown when a requested resource is not found (HTTP 404).
28
+ * This can occur when:
29
+ * - A place code doesn't exist
30
+ * - A station code doesn't exist
31
+ * - No observations exist for the requested date
32
+ */
33
+ export class MeteoNotFoundError extends MeteoApiError {
34
+ resource;
35
+ name = 'MeteoNotFoundError';
36
+ /**
37
+ * Creates a new MeteoNotFoundError.
38
+ * @param resource - Description of the resource that wasn't found
39
+ * @param responseBody - Raw response body for debugging
40
+ */
41
+ constructor(resource, responseBody) {
42
+ super(`Resource not found: ${resource}`, 404, responseBody);
43
+ this.resource = resource;
44
+ }
45
+ }
46
+ /**
47
+ * Error thrown when the rate limit is exceeded (HTTP 429).
48
+ * The API limits requests to 180 per minute per IP address.
49
+ */
50
+ export class MeteoRateLimitError extends MeteoApiError {
51
+ retryAfterSeconds;
52
+ name = 'MeteoRateLimitError';
53
+ /**
54
+ * Creates a new MeteoRateLimitError.
55
+ * @param retryAfterSeconds - Seconds to wait before retrying (if provided by API)
56
+ * @param responseBody - Raw response body for debugging
57
+ */
58
+ constructor(retryAfterSeconds, responseBody) {
59
+ const retryMessage = retryAfterSeconds !== undefined
60
+ ? `. Retry after ${String(retryAfterSeconds)} seconds`
61
+ : '';
62
+ super(`Rate limit exceeded${retryMessage}`, 429, responseBody);
63
+ this.retryAfterSeconds = retryAfterSeconds;
64
+ }
65
+ }
66
+ /**
67
+ * Error thrown when response validation fails.
68
+ * This indicates the API returned data that doesn't match the expected schema.
69
+ */
70
+ export class MeteoValidationError extends MeteoApiError {
71
+ validationErrors;
72
+ name = 'MeteoValidationError';
73
+ /**
74
+ * Creates a new MeteoValidationError.
75
+ * @param message - Description of what validation failed
76
+ * @param validationErrors - Detailed validation error information
77
+ * @param responseBody - Raw response body for debugging
78
+ */
79
+ constructor(message, validationErrors, responseBody) {
80
+ super(`Validation failed: ${message}`, 0, responseBody);
81
+ this.validationErrors = validationErrors;
82
+ }
83
+ }
84
+ /**
85
+ * Error thrown when a network request fails.
86
+ * This wraps fetch errors for consistent error handling.
87
+ */
88
+ export class MeteoNetworkError extends MeteoApiError {
89
+ cause;
90
+ name = 'MeteoNetworkError';
91
+ /**
92
+ * Creates a new MeteoNetworkError.
93
+ * @param message - Description of the network error
94
+ * @param cause - Original error that caused this error
95
+ */
96
+ constructor(message, cause) {
97
+ super(`Network error: ${message}`, 0);
98
+ this.cause = cause;
99
+ }
100
+ }
101
+ /**
102
+ * Error thrown when a request times out.
103
+ */
104
+ export class MeteoTimeoutError extends MeteoApiError {
105
+ timeoutMs;
106
+ name = 'MeteoTimeoutError';
107
+ /**
108
+ * Creates a new MeteoTimeoutError.
109
+ * @param timeoutMs - The timeout value in milliseconds
110
+ */
111
+ constructor(timeoutMs) {
112
+ super(`Request timed out after ${String(timeoutMs)}ms`, 0);
113
+ this.timeoutMs = timeoutMs;
114
+ }
115
+ }
116
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/types/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IAYpB;IACA;IAZlB,uCAAuC;IAC9B,IAAI,GAAW,eAAe,CAAC;IAExC;;;;;OAKG;IACH,YACE,OAAe,EACC,UAAkB,EAClB,YAAqB;QAErC,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,eAAU,GAAV,UAAU,CAAQ;QAClB,iBAAY,GAAZ,YAAY,CAAS;IAGvC,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,OAAO,kBAAmB,SAAQ,aAAa;IASjC;IARA,IAAI,GAAW,oBAAoB,CAAC;IAEtD;;;;OAIG;IACH,YACkB,QAAgB,EAChC,YAAqB;QAErB,KAAK,CAAC,uBAAuB,QAAQ,EAAE,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC;QAH5C,aAAQ,GAAR,QAAQ,CAAQ;IAIlC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,aAAa;IASlC;IARA,IAAI,GAAW,qBAAqB,CAAC;IAEvD;;;;OAIG;IACH,YACkB,iBAA0B,EAC1C,YAAqB;QAErB,MAAM,YAAY,GAAG,iBAAiB,KAAK,SAAS;YAClD,CAAC,CAAC,iBAAiB,MAAM,CAAC,iBAAiB,CAAC,UAAU;YACtD,CAAC,CAAC,EAAE,CAAC;QACP,KAAK,CAAC,sBAAsB,YAAY,EAAE,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC;QAN/C,sBAAiB,GAAjB,iBAAiB,CAAS;IAO5C,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,aAAa;IAWnC;IAVA,IAAI,GAAW,sBAAsB,CAAC;IAExD;;;;;OAKG;IACH,YACE,OAAe,EACC,gBAAmC,EACnD,YAAqB;QAErB,KAAK,CAAC,sBAAsB,OAAO,EAAE,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;QAHxC,qBAAgB,GAAhB,gBAAgB,CAAmB;IAIrD,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,aAAa;IAUhC;IATA,IAAI,GAAW,mBAAmB,CAAC;IAErD;;;;OAIG;IACH,YACE,OAAe,EACC,KAAa;QAE7B,KAAK,CAAC,kBAAkB,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;QAFtB,UAAK,GAAL,KAAK,CAAQ;IAG/B,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,aAAa;IAOtB;IANV,IAAI,GAAW,mBAAmB,CAAC;IAErD;;;OAGG;IACH,YAA4B,SAAiB;QAC3C,KAAK,CAAC,2BAA2B,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QADjC,cAAS,GAAT,SAAS,CAAQ;IAE7C,CAAC;CACF"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @fileoverview Forecast data types for weather predictions.
3
+ * @module meteo-lt-sdk/types/forecasts
4
+ */
5
+ import type { ForecastConditionCode } from './conditions.js';
6
+ import type { PlaceDetails, ForecastType } from './places.js';
7
+ /**
8
+ * A single forecast timestamp with all weather parameters.
9
+ * Represents predicted weather conditions for a specific point in time.
10
+ */
11
+ export interface ForecastTimestamp {
12
+ /** Forecast time in UTC (ISO 8601 format) */
13
+ readonly forecastTimeUtc: string;
14
+ /** Air temperature in degrees Celsius */
15
+ readonly airTemperature: number;
16
+ /** Feels-like temperature in degrees Celsius */
17
+ readonly feelsLikeTemperature: number;
18
+ /** Wind speed in meters per second */
19
+ readonly windSpeed: number;
20
+ /** Maximum wind gust in m/s (max over 1h when step is 1h, 3h when step is 3h, etc.) */
21
+ readonly windGust: number;
22
+ /** Wind direction in degrees (0 = from north, 180 = from south) */
23
+ readonly windDirection: number;
24
+ /** Cloud cover percentage (0 = clear, 100 = overcast) */
25
+ readonly cloudCover: number;
26
+ /** Atmospheric pressure at sea level in hPa */
27
+ readonly seaLevelPressure: number;
28
+ /** Relative humidity percentage */
29
+ readonly relativeHumidity: number;
30
+ /** Total precipitation in mm (sum over 1h when step is 1h, 3h when step is 3h, etc.) */
31
+ readonly totalPrecipitation: number;
32
+ /** Weather condition code */
33
+ readonly conditionCode: ForecastConditionCode;
34
+ }
35
+ /**
36
+ * Complete forecast response for a place.
37
+ * Returned by GET /places/{place-code}/forecasts/{forecast-type} endpoint.
38
+ */
39
+ export interface Forecast {
40
+ /** Place information */
41
+ readonly place: PlaceDetails;
42
+ /** Type of forecast */
43
+ readonly forecastType: ForecastType;
44
+ /** When the forecast was created (UTC, ISO 8601 format) */
45
+ readonly forecastCreationTimeUtc: string;
46
+ /** Array of forecast data points */
47
+ readonly forecastTimestamps: readonly ForecastTimestamp[];
48
+ }
49
+ //# sourceMappingURL=forecasts.d.ts.map