@uniai-fe/ui-legacy 0.1.1 → 0.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniai-fe/ui-legacy",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Legacy UI Toolkit for UNIAI FE Projects",
5
5
  "type": "module",
6
6
  "private": false,
@@ -11,5 +11,4 @@ export type * from "./table";
11
11
  export type * from "./tab-menu";
12
12
  export type * from "./template";
13
13
  export type * from "./weather";
14
- export type * from "./location";
15
14
  export type * from "./style-option";
@@ -1,3 +1,7 @@
1
+ export type GeoCoordinate = {
2
+ latitude: number | null;
3
+ longitude: number | null;
4
+ };
1
5
  export type WeatherGeoCoordinate = {
2
6
  lat: number | null;
3
7
  lng: number | null;
@@ -27,11 +27,12 @@ import {
27
27
  * 기상청 API; base URL
28
28
  * "본 저작물은 기상청에서 'OO년'작성하여 공공누리 제1유형으로 개방한 '저작물명(작성자:OOO)'을 이용하였으며, 해당 저작물은 '기상청 API허브(apihub.kma.go.kr)에서 무료로 다운받으실 수 있습니다."
29
29
  */
30
- const API_BASE_PATH = "/typ02/openApi/VilageFcstInfoService_2.0";
30
+
31
+ const API_BASE = "https://apihub.kma.go.kr";
31
32
  /**
32
33
  * 기상청 API; 날씨정보 URL
33
34
  */
34
- const API_WEATHER = API_BASE_PATH;
35
+ const API_WEATHER = "/typ02/openApi/VilageFcstInfoService_2.0";
35
36
 
36
37
  const QUERY_URL = {
37
38
  forecast: `${API_WEATHER}/getVilageFcst`,
@@ -70,16 +71,17 @@ const getWeatherParams = ({
70
71
  * @method GET
71
72
  */
72
73
  export const routeWeatherKoreaNow = async ({
73
- domain,
74
+ domain = API_BASE,
74
75
  authKey,
75
76
  routeUrl,
76
77
  searchParams,
77
78
  }: {
78
- domain: string;
79
79
  authKey: string;
80
80
  routeUrl: string;
81
81
  searchParams: URLSearchParams;
82
- }): Promise<API_Res_WeatherKoreaNow> => {
82
+ } & Partial<{
83
+ domain: string;
84
+ }>): Promise<API_Res_WeatherKoreaNow> => {
83
85
  const NOW_DATA: API_Res_WeatherKoreaToday = {
84
86
  ...API_RES_BASE,
85
87
  temperature: null,
@@ -129,7 +131,7 @@ export const routeWeatherKoreaNow = async ({
129
131
  * @method GET
130
132
  */
131
133
  export const routeWeatherKoreaForecast = async ({
132
- domain,
134
+ domain = API_BASE,
133
135
  authKey,
134
136
  routeUrl,
135
137
  searchParams,
@@ -138,7 +140,9 @@ export const routeWeatherKoreaForecast = async ({
138
140
  authKey: string;
139
141
  routeUrl: string;
140
142
  searchParams: URLSearchParams;
141
- }): Promise<API_Res_WeatherKoreaForecast> => {
143
+ } & Partial<{
144
+ domain: string;
145
+ }>): Promise<API_Res_WeatherKoreaForecast> => {
142
146
  const FORECAST_DATA: API_Res_WeatherKoreaNextDays = {
143
147
  ...API_RES_BASE,
144
148
  max_temperature: null,
@@ -126,7 +126,9 @@ export async function getWeatherGridLocation(
126
126
  // 특정 위경도 좌표를 받지 못하는 경우, 현재 사용자 위치로 지정
127
127
  if (
128
128
  typeof window !== "undefined" &&
129
- (typeof coordinate === "undefined" || geo.lat === null || geo.lng === null)
129
+ (typeof coordinate === "undefined" ||
130
+ geo.latitude === null ||
131
+ geo.longitude === null)
130
132
  ) {
131
133
  const { latitude, longitude } = await userLocation();
132
134
 
@@ -1,59 +0,0 @@
1
- import type { GeoJsonObject } from "geojson";
2
-
3
- export type GeoCoordinate = {
4
- [directionKey: string]: number | null;
5
- latitude: number | null;
6
- longitude: number | null;
7
- };
8
-
9
- export type GeoJsonFeatureGeometryType = {
10
- type: string;
11
- coordinates: [number, number][][] | [number, number][];
12
- };
13
-
14
- export type GeoJsonFeaturePropertiesType = {
15
- [key: string]: string | number;
16
- name: string;
17
- base_year: string | number;
18
- name_eng: string;
19
- code: string | number;
20
- };
21
-
22
- /**
23
- * 지도 데이터 geojson 타입
24
- */
25
- export type GeoJsonFeatureType = {
26
- type: string;
27
- geometry: GeoJsonFeatureGeometryType;
28
- properties: GeoJsonFeaturePropertiesType;
29
- };
30
-
31
- /**
32
- * 지도 데이터 geojson 컬렉션 타입
33
- */
34
- export type GeoJsonFeatureCollectionType = GeoJsonObject & {
35
- // type: string;
36
- features: GeoJsonFeatureType[];
37
- };
38
-
39
- /**
40
- * geojson export 타입
41
- */
42
- export type GeoJsonCollectionType = {
43
- [key: string]: GeoJsonFeatureCollectionType;
44
- };
45
-
46
- /**
47
- * geojson 지역명 참조 타입
48
- */
49
- export type GeoJsonNamesType = {
50
- name: string;
51
- base_year: string | number;
52
- name_eng: string;
53
- code: string | number;
54
- };
55
-
56
- export type GeoJsonNamesCollectionType = {
57
- [key: string]: GeoJsonNamesType[];
58
- province: GeoJsonNamesType[];
59
- };
@@ -1,2 +0,0 @@
1
- export type * from "./geojson";
2
- export type * from "./region";
@@ -1,19 +0,0 @@
1
- export type CountyDataType = {
2
- key: string;
3
- name: string;
4
- value: string;
5
- province_code: number | string;
6
- };
7
-
8
- export type CountyCollectionType = {
9
- [provinceKey: string]: CountyDataType[];
10
- };
11
-
12
- export type ProvinceDataType = {
13
- key: string;
14
- name_full: string;
15
- name_short: string;
16
- eng: string;
17
- value: string;
18
- code: number | string;
19
- };