@uniai-fe/uds-templates 0.5.29 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -6
- package/package.json +1 -1
- package/src/weather/_legacy/apis/index.ts +4 -0
- package/src/weather/_legacy/data/response.ts +36 -0
- package/src/weather/_legacy/hooks/index.ts +5 -0
- package/src/weather/{hooks → _legacy/hooks}/useOpenWeatherMap.ts +1 -1
- package/src/weather/{hooks → _legacy/hooks}/useWeatherKorea.ts +4 -7
- package/src/weather/{hooks → _legacy/hooks}/useWeatherKoreaAlert.ts +2 -4
- package/src/weather/_legacy/types/api.ts +221 -0
- package/src/weather/_legacy/types/base.ts +70 -0
- package/src/weather/_legacy/types/index.ts +4 -0
- package/src/weather/_legacy/utils/index.ts +5 -0
- package/src/weather/_legacy/utils/locale.ts +28 -0
- package/src/weather/_legacy/utils/location.ts +139 -0
- package/src/weather/_legacy/utils/weather.ts +460 -0
- package/src/weather/apis/client.ts +459 -0
- package/src/weather/apis/index.ts +2 -4
- package/src/weather/apis/server.ts +373 -0
- package/src/weather/components/icon/Address.tsx +7 -0
- package/src/weather/components/icon/Weather.tsx +7 -6
- package/src/weather/components/page-header/Address.tsx +14 -0
- package/src/weather/components/page-header/Alert.tsx +17 -13
- package/src/weather/components/page-header/Container.tsx +12 -19
- package/src/weather/components/page-header/Forecast.tsx +21 -28
- package/src/weather/components/page-header/NextDays.tsx +10 -0
- package/src/weather/components/page-header/Today.tsx +86 -158
- package/src/weather/components/page-header/index.ts +5 -0
- package/src/weather/data/response.ts +4 -23
- package/src/weather/hooks/index.ts +3 -3
- package/src/weather/hooks/useWeather.ts +52 -0
- package/src/weather/hooks/useWeatherAlert.ts +35 -0
- package/src/weather/index.tsx +2 -2
- package/src/weather/jotai/coordinate.ts +4 -0
- package/src/weather/jotai/farm-idx.ts +4 -0
- package/src/weather/types/api.ts +442 -114
- package/src/weather/types/base.ts +31 -32
- package/src/weather/types/index.ts +0 -3
- package/src/weather/types/page-header.ts +118 -68
- package/src/weather/utils/index.ts +6 -4
- package/src/weather/utils/locale.ts +7 -69
- package/src/weather/utils/location.ts +47 -102
- package/src/weather/utils/weather.ts +53 -456
- package/src/weather/data/alert-regions-meta.json +0 -1286
- package/src/weather/data/weather-regions-meta.json +0 -9833
- package/src/weather/types/provider.ts +0 -34
- package/src/weather/utils/alert.ts +0 -30
- /package/src/weather/{apis → _legacy/apis}/korea/client.ts +0 -0
- /package/src/weather/{apis → _legacy/apis}/korea/server.ts +0 -0
- /package/src/weather/{apis → _legacy/apis}/open-weather-map/client.ts +0 -0
- /package/src/weather/{apis → _legacy/apis}/open-weather-map/server.ts +0 -0
- /package/src/weather/{types → _legacy/types}/korea.ts +0 -0
- /package/src/weather/{types → _legacy/types}/open-weather-map.ts +0 -0
- /package/src/weather/{utils → _legacy/utils}/date-time.ts +0 -0
- /package/src/weather/{utils → _legacy/utils}/validate.ts +0 -0
package/src/weather/types/api.ts
CHANGED
|
@@ -1,221 +1,549 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
KMA_Res_AlertType,
|
|
8
|
-
KMA_Res_AlertLevel,
|
|
9
|
-
KMA_Res_AlertCommand,
|
|
10
|
-
KMA_Res_WeatherItem,
|
|
11
|
-
} from "./korea";
|
|
2
|
+
WeatherApiLocaleOptions,
|
|
3
|
+
WeatherCoordinate,
|
|
4
|
+
WeatherGeoCoordinate,
|
|
5
|
+
WeatherGridCoordinate,
|
|
6
|
+
} from "./base";
|
|
12
7
|
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Weather backend; 농장/좌표/locale 공통 요청 옵션.
|
|
10
|
+
* @property {number|string|null} [farm_idx] 농장 식별자
|
|
11
|
+
* @property {number|null} [lat] 위도
|
|
12
|
+
* @property {number|null} [lng] 경도
|
|
13
|
+
* @property {number|null} [nx] backend 격자 X
|
|
14
|
+
* @property {number|null} [ny] backend 격자 Y
|
|
15
|
+
* @property {string} [base_date] 현재/예보 단일 route 재현용 날짜
|
|
16
|
+
* @property {string} [base_time] 현재/예보 단일 route 재현용 시각
|
|
17
|
+
* @property {string} [now_base_date] summary 현재 날씨 재현용 날짜
|
|
18
|
+
* @property {string} [now_base_time] summary 현재 날씨 재현용 시각
|
|
19
|
+
* @property {string} [forecast_base_date] summary 예보 날씨 재현용 날짜
|
|
20
|
+
* @property {string} [forecast_base_time] summary 예보 날씨 재현용 시각
|
|
21
|
+
* @property {string} [locale] 요청 언어 코드
|
|
22
|
+
* @property {boolean} [include_raw] 원본 응답 포함 여부
|
|
23
|
+
*/
|
|
24
|
+
export interface API_Req_Weather
|
|
25
|
+
extends
|
|
26
|
+
WeatherApiLocaleOptions,
|
|
27
|
+
Partial<WeatherGeoCoordinate>,
|
|
28
|
+
Partial<WeatherGridCoordinate> {
|
|
29
|
+
/**
|
|
30
|
+
* 농장 식별자
|
|
31
|
+
*/
|
|
32
|
+
farm_idx?: number | string | null;
|
|
33
|
+
/**
|
|
34
|
+
* 위도
|
|
35
|
+
*/
|
|
36
|
+
lat?: number | null;
|
|
37
|
+
/**
|
|
38
|
+
* 경도
|
|
39
|
+
*/
|
|
40
|
+
lng?: number | null;
|
|
41
|
+
/**
|
|
42
|
+
* backend 격자 X
|
|
43
|
+
*/
|
|
44
|
+
nx?: number | null;
|
|
45
|
+
/**
|
|
46
|
+
* backend 격자 Y
|
|
47
|
+
*/
|
|
48
|
+
ny?: number | null;
|
|
49
|
+
/**
|
|
50
|
+
* 현재/예보 단일 route 재현용 날짜
|
|
51
|
+
*/
|
|
52
|
+
base_date?: string;
|
|
53
|
+
/**
|
|
54
|
+
* 현재/예보 단일 route 재현용 시각
|
|
55
|
+
*/
|
|
56
|
+
base_time?: string;
|
|
57
|
+
/**
|
|
58
|
+
* summary 현재 날씨 재현용 날짜
|
|
59
|
+
*/
|
|
60
|
+
now_base_date?: string;
|
|
61
|
+
/**
|
|
62
|
+
* summary 현재 날씨 재현용 시각
|
|
63
|
+
*/
|
|
64
|
+
now_base_time?: string;
|
|
65
|
+
/**
|
|
66
|
+
* summary 예보 날씨 재현용 날짜
|
|
67
|
+
*/
|
|
68
|
+
forecast_base_date?: string;
|
|
69
|
+
/**
|
|
70
|
+
* summary 예보 날씨 재현용 시각
|
|
71
|
+
*/
|
|
72
|
+
forecast_base_time?: string;
|
|
73
|
+
/**
|
|
74
|
+
* 요청 언어 코드
|
|
75
|
+
*/
|
|
76
|
+
locale?: string;
|
|
77
|
+
/**
|
|
78
|
+
* 원본 응답 포함 여부
|
|
79
|
+
*/
|
|
80
|
+
include_raw?: boolean;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Weather backend; 현재 날씨 요청.
|
|
85
|
+
*/
|
|
86
|
+
export type API_Req_WeatherNow = API_Req_Weather;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Weather backend; 예보 날씨 요청.
|
|
90
|
+
*/
|
|
91
|
+
export type API_Req_WeatherForecast = API_Req_Weather;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Weather backend; summary 요청.
|
|
95
|
+
*/
|
|
96
|
+
export type API_Req_WeatherSummary = API_Req_Weather;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Weather backend; 특보 요청 파라미터.
|
|
100
|
+
* @property {number|string|null} farm_idx 농장 식별자
|
|
101
|
+
*/
|
|
102
|
+
export interface API_Req_WeatherAlert {
|
|
103
|
+
/**
|
|
104
|
+
* 농장 식별자
|
|
105
|
+
*/
|
|
106
|
+
farm_idx: number | string | null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Weather Client; local route 경로 옵션.
|
|
111
|
+
* @property {string} [routePath] service app의 local weather route 경로
|
|
112
|
+
*/
|
|
113
|
+
export interface WeatherClientRouteOptions {
|
|
114
|
+
/**
|
|
115
|
+
* service app의 local weather route 경로
|
|
116
|
+
*/
|
|
117
|
+
routePath?: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Weather Client; React Query 실행 옵션.
|
|
122
|
+
* @property {boolean} [enabled] query 실행 여부
|
|
123
|
+
*/
|
|
124
|
+
export interface WeatherQueryOptions {
|
|
125
|
+
/**
|
|
126
|
+
* query 실행 여부
|
|
127
|
+
*/
|
|
128
|
+
enabled?: boolean;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Weather Client; local route 경로와 query 실행 옵션.
|
|
133
|
+
* @property {string} [routePath] service app의 local weather route 경로
|
|
134
|
+
* @property {boolean} [enabled] query 실행 여부
|
|
135
|
+
*/
|
|
136
|
+
export interface WeatherClientQueryOptions
|
|
137
|
+
extends WeatherClientRouteOptions, WeatherQueryOptions {
|
|
138
|
+
/**
|
|
139
|
+
* service app의 local weather route 경로
|
|
140
|
+
*/
|
|
141
|
+
routePath?: string;
|
|
142
|
+
/**
|
|
143
|
+
* query 실행 여부
|
|
144
|
+
*/
|
|
145
|
+
enabled?: boolean;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Weather Server; backend proxy route 입력.
|
|
150
|
+
* @property {string} domain backend API domain
|
|
151
|
+
* @property {string} routeUrl service app local route URL
|
|
152
|
+
* @property {URLSearchParams} searchParams service app local route query
|
|
153
|
+
*/
|
|
154
|
+
export interface WeatherServerRouteParams {
|
|
155
|
+
/**
|
|
156
|
+
* backend API domain
|
|
157
|
+
*/
|
|
158
|
+
domain: string;
|
|
159
|
+
/**
|
|
160
|
+
* service app local route URL
|
|
161
|
+
*/
|
|
162
|
+
routeUrl: string;
|
|
163
|
+
/**
|
|
164
|
+
* service app local route query
|
|
165
|
+
*/
|
|
166
|
+
searchParams: URLSearchParams;
|
|
167
|
+
}
|
|
15
168
|
|
|
16
169
|
/**
|
|
17
|
-
*
|
|
170
|
+
* Weather Server; backend fetch helper 입력.
|
|
171
|
+
* @property {string} domain backend API domain
|
|
172
|
+
* @property {string} routeUrl service app local route URL
|
|
173
|
+
* @property {URLSearchParams} searchParams service app local route query
|
|
174
|
+
* @property {string} queryUrl backend weather route URL
|
|
175
|
+
* @property {"now"|"forecast"|"summary"|"alert"} routeKind backend weather route 종류
|
|
176
|
+
* @property {Data} fallback 실패 시 반환할 fallback 응답
|
|
18
177
|
*/
|
|
19
|
-
export type
|
|
20
|
-
|
|
178
|
+
export type WeatherBackendFetchParams<Data> = WeatherServerRouteParams & {
|
|
179
|
+
/**
|
|
180
|
+
* backend weather route URL
|
|
181
|
+
*/
|
|
182
|
+
queryUrl: string;
|
|
183
|
+
/**
|
|
184
|
+
* backend weather route 종류
|
|
185
|
+
*/
|
|
186
|
+
routeKind: "now" | "forecast" | "summary" | "alert";
|
|
187
|
+
/**
|
|
188
|
+
* 실패 시 반환할 fallback 응답
|
|
189
|
+
*/
|
|
190
|
+
fallback: Data;
|
|
191
|
+
};
|
|
21
192
|
|
|
22
193
|
/**
|
|
23
|
-
*
|
|
24
|
-
* @property {
|
|
194
|
+
* Weather Hook; 통합 weather 조회 옵션.
|
|
195
|
+
* @property {string} [locale] 요청 언어 코드
|
|
196
|
+
* @property {boolean} [enabled] query 실행 여부
|
|
25
197
|
*/
|
|
26
|
-
export
|
|
198
|
+
export interface UseWeatherOptions extends WeatherApiLocaleOptions {
|
|
199
|
+
/**
|
|
200
|
+
* 요청 언어 코드
|
|
201
|
+
*/
|
|
202
|
+
locale?: string;
|
|
203
|
+
/**
|
|
204
|
+
* query 실행 여부
|
|
205
|
+
*/
|
|
206
|
+
enabled?: boolean;
|
|
207
|
+
}
|
|
27
208
|
|
|
28
209
|
/**
|
|
29
|
-
*
|
|
210
|
+
* Weather Hook; 통합 weather query 결과.
|
|
211
|
+
* @property {API_Req_Weather} params weather summary 요청 파라미터
|
|
212
|
+
* @property {WeatherCoordinate} coordinate 현재 지역 좌표
|
|
213
|
+
* @property {number|null} farm_idx 특보 조회에 사용할 농장 식별자
|
|
214
|
+
* @property {API_Res_WeatherSummary} [summary] summary 응답
|
|
215
|
+
* @property {API_Res_WeatherNow} [now] 현재 날씨 응답
|
|
216
|
+
* @property {API_Res_WeatherForecast} [forecast] 예보 날씨 응답
|
|
217
|
+
* @property {API_Res_WeatherAlertItem[]} alert 특보 목록
|
|
218
|
+
* @property {boolean} isFetching 현재/예보/특보 조회 상태
|
|
219
|
+
* @property {boolean} isFetchingNow 현재 날씨 조회 상태
|
|
220
|
+
* @property {boolean} isFetchingForecast 예보 날씨 조회 상태
|
|
221
|
+
* @property {boolean} isFetchingAlert 특보 조회 상태
|
|
30
222
|
*/
|
|
31
|
-
export
|
|
223
|
+
export interface UseWeatherReturn {
|
|
224
|
+
/**
|
|
225
|
+
* weather summary 요청 파라미터
|
|
226
|
+
*/
|
|
227
|
+
params: API_Req_Weather;
|
|
228
|
+
/**
|
|
229
|
+
* 현재 지역 좌표
|
|
230
|
+
*/
|
|
231
|
+
coordinate: WeatherCoordinate;
|
|
232
|
+
/**
|
|
233
|
+
* 특보 조회에 사용할 농장 식별자
|
|
234
|
+
*/
|
|
235
|
+
farm_idx: number | null;
|
|
236
|
+
/**
|
|
237
|
+
* summary 응답
|
|
238
|
+
*/
|
|
239
|
+
summary?: API_Res_WeatherSummary;
|
|
240
|
+
/**
|
|
241
|
+
* 현재 날씨 응답
|
|
242
|
+
*/
|
|
243
|
+
now?: API_Res_WeatherNow;
|
|
244
|
+
/**
|
|
245
|
+
* 예보 날씨 응답
|
|
246
|
+
*/
|
|
247
|
+
forecast?: API_Res_WeatherForecast;
|
|
248
|
+
/**
|
|
249
|
+
* 특보 목록
|
|
250
|
+
*/
|
|
251
|
+
alert: API_Res_WeatherAlertItem[];
|
|
252
|
+
/**
|
|
253
|
+
* 현재/예보/특보 조회 상태
|
|
254
|
+
*/
|
|
255
|
+
isFetching: boolean;
|
|
256
|
+
/**
|
|
257
|
+
* 현재 날씨 조회 상태
|
|
258
|
+
*/
|
|
259
|
+
isFetchingNow: boolean;
|
|
260
|
+
/**
|
|
261
|
+
* 예보 날씨 조회 상태
|
|
262
|
+
*/
|
|
263
|
+
isFetchingForecast: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* 특보 조회 상태
|
|
266
|
+
*/
|
|
267
|
+
isFetchingAlert: boolean;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Weather Hook; 통합 weather alert 조회 옵션.
|
|
272
|
+
* @property {boolean} [enabled] query 실행 여부
|
|
273
|
+
*/
|
|
274
|
+
export interface UseWeatherAlertOptions {
|
|
275
|
+
/**
|
|
276
|
+
* query 실행 여부
|
|
277
|
+
*/
|
|
278
|
+
enabled?: boolean;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Weather Hook; 통합 weather alert query 결과.
|
|
283
|
+
* @property {number|null} farm_idx 특보 조회에 사용할 농장 식별자
|
|
284
|
+
* @property {API_Res_WeatherAlertItem[]} alert 특보 목록
|
|
285
|
+
* @property {boolean} isFetching 특보 조회 상태
|
|
286
|
+
*/
|
|
287
|
+
export interface UseWeatherAlertReturn {
|
|
288
|
+
/**
|
|
289
|
+
* 특보 조회에 사용할 농장 식별자
|
|
290
|
+
*/
|
|
291
|
+
farm_idx: number | null;
|
|
292
|
+
/**
|
|
293
|
+
* 특보 목록
|
|
294
|
+
*/
|
|
295
|
+
alert: API_Res_WeatherAlertItem[];
|
|
296
|
+
/**
|
|
297
|
+
* 특보 조회 상태
|
|
298
|
+
*/
|
|
299
|
+
isFetching: boolean;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Weather backend; 특보 종류.
|
|
304
|
+
*/
|
|
305
|
+
export type API_Res_WeatherAlertType = string;
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Weather backend; 특보 수준.
|
|
309
|
+
*/
|
|
310
|
+
export type API_Res_WeatherAlertLevel = string;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Weather backend; 특보 명령.
|
|
314
|
+
*/
|
|
315
|
+
export type API_Res_WeatherAlertCommand = string;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Weather backend; 지역별 특보정보.
|
|
319
|
+
* @property {string} upper_region_code 상위 지역 코드
|
|
320
|
+
* @property {string} upper_region_name 상위 지역 이름
|
|
321
|
+
* @property {string} alert_region_code 특보 지역 코드
|
|
322
|
+
* @property {string} alert_region_name 특보 지역 이름
|
|
323
|
+
* @property {string} announcement_time 특보 발표시간
|
|
324
|
+
* @property {string} effective_time 특보 발효시간
|
|
325
|
+
* @property {API_Res_WeatherAlertType} alert_type 특보 종류
|
|
326
|
+
* @property {API_Res_WeatherAlertLevel} alert_level 특보 수준
|
|
327
|
+
* @property {API_Res_WeatherAlertCommand} alert_command 특보 명령
|
|
328
|
+
* @property {string} cancel_notice_time 특보 해제 예고시점
|
|
329
|
+
*/
|
|
330
|
+
export type API_Res_WeatherAlertItem = {
|
|
32
331
|
/**
|
|
33
332
|
* 상위 지역 코드
|
|
34
|
-
* @see https://apihub.kma.go.kr/api/typ01/url/wrn_reg.php?tmfc=0&authKey=njld-D40Rb25Xfg-NAW9hA
|
|
35
333
|
*/
|
|
36
334
|
upper_region_code: string;
|
|
37
335
|
/**
|
|
38
336
|
* 상위 지역 이름
|
|
39
|
-
* @see https://apihub.kma.go.kr/api/typ01/url/wrn_reg.php?tmfc=0&authKey=njld-D40Rb25Xfg-NAW9hA
|
|
40
337
|
*/
|
|
41
338
|
upper_region_name: string;
|
|
42
339
|
/**
|
|
43
340
|
* 특보 지역 코드
|
|
44
|
-
* @see https://apihub.kma.go.kr/api/typ01/url/wrn_reg.php?tmfc=0&authKey=njld-D40Rb25Xfg-NAW9hA
|
|
45
341
|
*/
|
|
46
342
|
alert_region_code: string;
|
|
47
343
|
/**
|
|
48
344
|
* 특보 지역 이름
|
|
49
|
-
* @see https://apihub.kma.go.kr/api/typ01/url/wrn_reg.php?tmfc=0&authKey=njld-D40Rb25Xfg-NAW9hA
|
|
50
345
|
*/
|
|
51
346
|
alert_region_name: string;
|
|
52
347
|
/**
|
|
53
348
|
* 특보 발표시간
|
|
54
|
-
* - yyyymmddhhmm
|
|
55
349
|
*/
|
|
56
350
|
announcement_time: string;
|
|
57
351
|
/**
|
|
58
352
|
* 특보 발효시간
|
|
59
|
-
* - yyyymmddhhmm
|
|
60
353
|
*/
|
|
61
354
|
effective_time: string;
|
|
62
|
-
/** * 특보 종류 (한글) */
|
|
63
|
-
alert_type: KMA_Res_AlertType;
|
|
64
355
|
/**
|
|
65
|
-
* 특보
|
|
66
|
-
* - 경보, 주의, 예비
|
|
356
|
+
* 특보 종류
|
|
67
357
|
*/
|
|
68
|
-
|
|
358
|
+
alert_type: API_Res_WeatherAlertType;
|
|
69
359
|
/**
|
|
70
|
-
* 특보
|
|
71
|
-
* - 발표, 변경, 해제
|
|
360
|
+
* 특보 수준
|
|
72
361
|
*/
|
|
73
|
-
|
|
362
|
+
alert_level: API_Res_WeatherAlertLevel;
|
|
74
363
|
/**
|
|
75
|
-
* 특보
|
|
76
|
-
|
|
364
|
+
* 특보 명령
|
|
365
|
+
*/
|
|
366
|
+
alert_command: API_Res_WeatherAlertCommand;
|
|
367
|
+
/**
|
|
368
|
+
* 특보 해제 예고시점
|
|
77
369
|
*/
|
|
78
370
|
cancel_notice_time: string;
|
|
79
371
|
};
|
|
372
|
+
|
|
80
373
|
/**
|
|
81
|
-
*
|
|
374
|
+
* Weather backend; 특보 응답 타입.
|
|
375
|
+
* @property {string|null} api_announcement_time 특보 발표 시간
|
|
376
|
+
* @property {number} total_count 총 특보 개수
|
|
377
|
+
* @property {API_Res_WeatherAlertItem[]} alerts 지역별 특보
|
|
82
378
|
*/
|
|
83
|
-
export type
|
|
84
|
-
/**
|
|
379
|
+
export type API_Res_WeatherAlert = {
|
|
380
|
+
/**
|
|
381
|
+
* 특보 발표 시간
|
|
382
|
+
*/
|
|
85
383
|
api_announcement_time: string | null;
|
|
86
|
-
/**
|
|
384
|
+
/**
|
|
385
|
+
* 총 특보 개수
|
|
386
|
+
*/
|
|
87
387
|
total_count: number;
|
|
88
|
-
/**
|
|
89
|
-
|
|
388
|
+
/**
|
|
389
|
+
* 지역별 특보
|
|
390
|
+
*/
|
|
391
|
+
alerts: API_Res_WeatherAlertItem[];
|
|
90
392
|
};
|
|
91
393
|
|
|
92
394
|
/**
|
|
93
|
-
*
|
|
94
|
-
* @property {string}
|
|
395
|
+
* Weather backend; 기초 정보.
|
|
396
|
+
* @property {string|null} sky 하늘상태 코드
|
|
397
|
+
* @property {string|null} drop 강수형태 코드
|
|
398
|
+
* @property {string|null} rainAmount 강수량 코드
|
|
399
|
+
* @property {string|null} snowAmount 강설량 코드
|
|
400
|
+
* @property {string|null} windSpeed 풍속 코드
|
|
401
|
+
* @property {string|null} condition 날씨 상태 코드
|
|
402
|
+
* @property {string|null} conditionName 날씨 상태 텍스트
|
|
95
403
|
*/
|
|
96
|
-
export type
|
|
404
|
+
export type API_Res_WeatherBase = {
|
|
97
405
|
/**
|
|
98
406
|
* 하늘상태 코드
|
|
99
|
-
* - 1(맑음)
|
|
100
|
-
* - 2(구름조금)
|
|
101
|
-
* - 3(구름많음)
|
|
102
|
-
* - 4(흐림)
|
|
103
407
|
*/
|
|
104
408
|
sky: string | null;
|
|
105
409
|
/**
|
|
106
410
|
* 강수형태 코드
|
|
107
|
-
* - 0(없음)
|
|
108
|
-
* - 1(비)
|
|
109
|
-
* - 2(비/눈)
|
|
110
|
-
* - 3(눈)
|
|
111
|
-
* - 4(소나기)
|
|
112
411
|
*/
|
|
113
412
|
drop: string | null;
|
|
114
413
|
/**
|
|
115
414
|
* 강수량 코드
|
|
116
|
-
* - 1(약한 비); 3mm/h 미만
|
|
117
|
-
* - 2(보통 비); 3mm/h 이상 15mm/h 미만
|
|
118
|
-
* - 3(강한 비); 15mm/h 이상
|
|
119
415
|
*/
|
|
120
416
|
rainAmount: string | null;
|
|
121
417
|
/**
|
|
122
418
|
* 강설량 코드
|
|
123
|
-
* - 1(보통 눈); 1cm/h 미만
|
|
124
|
-
* - 2(많은 눈); 1cm/h 이상
|
|
125
419
|
*/
|
|
126
420
|
snowAmount: string | null;
|
|
127
421
|
/**
|
|
128
422
|
* 풍속 코드
|
|
129
|
-
* - 1(약한 바람); 4m/s 미만
|
|
130
|
-
* - 2(약간 강한 바람); 4m/s 이상 9m/s 미만
|
|
131
|
-
* - 3(강한 바람); 9m/s 이상
|
|
132
423
|
*/
|
|
133
424
|
windSpeed: string | null;
|
|
134
425
|
/**
|
|
135
426
|
* 날씨 상태 코드
|
|
136
|
-
* - sky-1(맑음)
|
|
137
|
-
* - sky-2(구름조금)
|
|
138
|
-
* - sky-3(구름많음)
|
|
139
|
-
* - sky-4(흐림)
|
|
140
|
-
* - drop-rain-shower(소나기)
|
|
141
|
-
* - drop-rain(비)
|
|
142
|
-
* - drop-rain-1(약한 비)
|
|
143
|
-
* - drop-rain-2(보통 비)
|
|
144
|
-
* - drop-rain-3(강한 비)
|
|
145
|
-
* - drop-rain-snow(비/눈)
|
|
146
|
-
* - drop-rain-snow-1(약한 비/눈)
|
|
147
|
-
* - drop-rain-snow-2(보통 비/눈)
|
|
148
|
-
* - drop-rain-snow-3(강한 비/눈)
|
|
149
|
-
* - drop-snow(눈)
|
|
150
|
-
* - drop-snow-1(보통 눈)
|
|
151
|
-
* - drop-snow-2(많은 눈)
|
|
152
427
|
*/
|
|
153
428
|
condition: string | null;
|
|
154
|
-
/**
|
|
429
|
+
/**
|
|
430
|
+
* 날씨 상태 텍스트
|
|
431
|
+
*/
|
|
155
432
|
conditionName: string | null;
|
|
156
433
|
};
|
|
157
434
|
|
|
158
435
|
/**
|
|
159
|
-
*
|
|
436
|
+
* Weather backend; 오늘 날씨.
|
|
160
437
|
* @property {number|string|null} temperature 기온(℃)
|
|
161
438
|
* @property {number|string|null} max_temperature 최고기온(℃)
|
|
162
439
|
* @property {number|string|null} min_temperature 최저기온(℃)
|
|
163
440
|
* @property {number|string|null} humidity 습도(%)
|
|
164
441
|
*/
|
|
165
|
-
export type
|
|
166
|
-
/**
|
|
442
|
+
export type API_Res_WeatherToday = API_Res_WeatherBase & {
|
|
443
|
+
/**
|
|
444
|
+
* 기온(℃)
|
|
445
|
+
*/
|
|
167
446
|
temperature: number | string | null;
|
|
168
|
-
/**
|
|
447
|
+
/**
|
|
448
|
+
* 최고 기온(℃)
|
|
449
|
+
*/
|
|
169
450
|
max_temperature: number | string | null;
|
|
170
|
-
/**
|
|
451
|
+
/**
|
|
452
|
+
* 최저 기온(℃)
|
|
453
|
+
*/
|
|
171
454
|
min_temperature: number | string | null;
|
|
172
|
-
/**
|
|
455
|
+
/**
|
|
456
|
+
* 습도(%)
|
|
457
|
+
*/
|
|
173
458
|
humidity: number | string | null;
|
|
174
459
|
};
|
|
175
460
|
|
|
176
461
|
/**
|
|
177
|
-
*
|
|
462
|
+
* Weather backend; 내일/모레 날씨.
|
|
178
463
|
* @property {number|string|null} max_temperature 최고기온(℃)
|
|
179
464
|
* @property {number|string|null} min_temperature 최저기온(℃)
|
|
180
465
|
*/
|
|
181
|
-
export type
|
|
182
|
-
/**
|
|
466
|
+
export type API_Res_WeatherNextDays = API_Res_WeatherBase & {
|
|
467
|
+
/**
|
|
468
|
+
* 최고 기온(℃)
|
|
469
|
+
*/
|
|
183
470
|
max_temperature: number | string | null;
|
|
184
|
-
/**
|
|
471
|
+
/**
|
|
472
|
+
* 최저 기온(℃)
|
|
473
|
+
*/
|
|
185
474
|
min_temperature: number | string | null;
|
|
186
475
|
};
|
|
187
476
|
|
|
188
477
|
/**
|
|
189
|
-
*
|
|
190
|
-
* @property {
|
|
478
|
+
* Weather backend; 공통 응답 메타.
|
|
479
|
+
* @property {string|null} [source] backend weather source
|
|
480
|
+
* @property {boolean} [fallback_used] fallback 사용 여부
|
|
481
|
+
* @property {unknown} [raw] include_raw 요청 시 원본 응답
|
|
191
482
|
*/
|
|
192
|
-
export
|
|
193
|
-
/**
|
|
194
|
-
|
|
483
|
+
export interface API_Res_WeatherBackendMeta {
|
|
484
|
+
/**
|
|
485
|
+
* backend weather source
|
|
486
|
+
*/
|
|
487
|
+
source?: string | null;
|
|
488
|
+
/**
|
|
489
|
+
* fallback 사용 여부
|
|
490
|
+
*/
|
|
491
|
+
fallback_used?: boolean;
|
|
492
|
+
/**
|
|
493
|
+
* include_raw 요청 시 원본 응답
|
|
494
|
+
*/
|
|
495
|
+
raw?: unknown;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Weather backend; 현재 날씨 구조.
|
|
500
|
+
* @property {API_Res_WeatherToday} today 오늘 데이터
|
|
501
|
+
*/
|
|
502
|
+
export type API_Res_WeatherNow = API_Res_WeatherBackendMeta & {
|
|
503
|
+
/**
|
|
504
|
+
* 오늘 날씨
|
|
505
|
+
*/
|
|
506
|
+
today: API_Res_WeatherToday;
|
|
195
507
|
};
|
|
196
508
|
|
|
197
509
|
/**
|
|
198
|
-
*
|
|
199
|
-
* @property {
|
|
510
|
+
* Weather backend; 예보 날씨 구조.
|
|
511
|
+
* @property {API_Res_WeatherToday} today 오늘 데이터
|
|
512
|
+
* @property {API_Res_WeatherNextDays} day_1 내일 데이터
|
|
513
|
+
* @property {API_Res_WeatherNextDays} day_2 모레 데이터
|
|
200
514
|
*/
|
|
201
|
-
export type
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
515
|
+
export type API_Res_WeatherForecast = API_Res_WeatherBackendMeta & {
|
|
516
|
+
/**
|
|
517
|
+
* 오늘 날씨
|
|
518
|
+
*/
|
|
519
|
+
today: API_Res_WeatherToday;
|
|
520
|
+
/**
|
|
521
|
+
* 내일 날씨
|
|
522
|
+
*/
|
|
523
|
+
day_1: API_Res_WeatherNextDays;
|
|
524
|
+
/**
|
|
525
|
+
* 모레 날씨
|
|
526
|
+
*/
|
|
527
|
+
day_2: API_Res_WeatherNextDays;
|
|
528
|
+
};
|
|
206
529
|
|
|
207
530
|
/**
|
|
208
|
-
*
|
|
209
|
-
* @property {
|
|
210
|
-
* @property {
|
|
211
|
-
* @property {
|
|
531
|
+
* Weather backend; summary 구조.
|
|
532
|
+
* @property {API_Res_WeatherNow} now 현재 날씨
|
|
533
|
+
* @property {API_Res_WeatherForecast} forecast 예보 날씨
|
|
534
|
+
* @property {API_Res_WeatherAlert} alert 특보
|
|
212
535
|
*/
|
|
213
|
-
export type
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
536
|
+
export type API_Res_WeatherSummary = {
|
|
537
|
+
/**
|
|
538
|
+
* 현재 날씨
|
|
539
|
+
*/
|
|
540
|
+
now: API_Res_WeatherNow;
|
|
541
|
+
/**
|
|
542
|
+
* 예보 날씨
|
|
543
|
+
*/
|
|
544
|
+
forecast: API_Res_WeatherForecast;
|
|
545
|
+
/**
|
|
546
|
+
* 특보
|
|
547
|
+
*/
|
|
548
|
+
alert: API_Res_WeatherAlert;
|
|
549
|
+
};
|