@uniai-fe/ui-legacy 0.1.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/LICENSE +27 -0
- package/README.md +3 -0
- package/package.json +141 -0
- package/src/alternate/components/empty/Cage.tsx +29 -0
- package/src/alternate/components/empty/Data.tsx +35 -0
- package/src/alternate/components/empty/Table.tsx +38 -0
- package/src/alternate/components/index.tsx +19 -0
- package/src/alternate/components/loading/Default.tsx +38 -0
- package/src/alternate/components/loading/Icon.tsx +26 -0
- package/src/alternate/components/loading/Table.tsx +46 -0
- package/src/alternate/components/notice/SelectFlock.tsx +21 -0
- package/src/alternate/components/notice/SelectLabel.tsx +15 -0
- package/src/alternate/index.tsx +3 -0
- package/src/alternate/styles/styled/alternate.ts +92 -0
- package/src/asset-url.ts +7 -0
- package/src/button/button.scss +3 -0
- package/src/button/components/array/Add.tsx +39 -0
- package/src/button/components/array/Remove.tsx +34 -0
- package/src/button/components/base/Default.tsx +76 -0
- package/src/button/components/base/Expand.tsx +39 -0
- package/src/button/components/base/Link.tsx +40 -0
- package/src/button/components/base/Refresh.tsx +43 -0
- package/src/button/components/base/Reset.tsx +43 -0
- package/src/button/components/base/ResetSelected.tsx +35 -0
- package/src/button/components/base/Text.tsx +35 -0
- package/src/button/components/base/Tooltip.tsx +35 -0
- package/src/button/components/multiple/Container.tsx +70 -0
- package/src/button/components/select/SelectBox.tsx +37 -0
- package/src/button/icons/Expand.tsx +16 -0
- package/src/button/icons/Loading.tsx +20 -0
- package/src/button/icons/Refresh.tsx +20 -0
- package/src/button/icons/Reset.tsx +20 -0
- package/src/button/icons/ResetSelected.tsx +21 -0
- package/src/button/index.tsx +29 -0
- package/src/button/styled.tsx +12 -0
- package/src/button/styles/scss/multiple.scss +17 -0
- package/src/button/styles/scss/size.scss +46 -0
- package/src/button/styles/scss/theme.scss +36 -0
- package/src/button/styles/styled-components/button.ts +311 -0
- package/src/button/styles/styled-components/icon.ts +30 -0
- package/src/button/styles/styled-components/multiple.ts +75 -0
- package/src/button/styles/styled-components/template.ts +43 -0
- package/src/chart/chart.scss +11 -0
- package/src/chart/components/Contents.tsx +17 -0
- package/src/chart/components/control/Button.tsx +39 -0
- package/src/chart/components/control/Container.tsx +27 -0
- package/src/chart/components/control/Provider.tsx +117 -0
- package/src/chart/components/control/index.tsx +12 -0
- package/src/chart/components/custom/ActivePieSector.tsx +29 -0
- package/src/chart/components/graphs/ArcGauge.tsx +58 -0
- package/src/chart/components/graphs/ArcMeter.tsx +112 -0
- package/src/chart/components/graphs/Area.tsx +132 -0
- package/src/chart/components/graphs/Bar.tsx +179 -0
- package/src/chart/components/graphs/Doughnut.tsx +90 -0
- package/src/chart/components/graphs/Line.tsx +123 -0
- package/src/chart/components/graphs/index.tsx +17 -0
- package/src/chart/components/ticks/XAxis.tsx +39 -0
- package/src/chart/components/ticks/index.tsx +7 -0
- package/src/chart/index.tsx +17 -0
- package/src/chart/styled.tsx +3 -0
- package/src/chart/styles/scss/arc-gauge.scss +11 -0
- package/src/chart/styles/scss/arc-meter.scss +6 -0
- package/src/chart/styles/scss/control.scss +34 -0
- package/src/chart/styles/scss/filter.scss +0 -0
- package/src/chart/styles/scss/graph.scss +3 -0
- package/src/chart/styles/scss/legend.scss +35 -0
- package/src/chart/styles/scss/level.color.scss +7 -0
- package/src/chart/styles/scss/tick.scss +48 -0
- package/src/chart/styles/scss/tooltip.scss +70 -0
- package/src/chart/styles/styled/arc-gauge.ts +65 -0
- package/src/chart/styles/styled/arc-meter.ts +42 -0
- package/src/chart/styles/styled/common.ts +14 -0
- package/src/chart/styles/styled/control.ts +31 -0
- package/src/chart/styles/styled/legend.ts +11 -0
- package/src/chart/svg/gauge-track.min.svg +1 -0
- package/src/chart/utils/getLevel.ts +23 -0
- package/src/chip/chip.scss +1 -0
- package/src/chip/components/Default.tsx +40 -0
- package/src/chip/index.tsx +5 -0
- package/src/chip/styled.tsx +7 -0
- package/src/chip/styles/scss/variables.scss +15 -0
- package/src/chip/styles/styled/base.ts +41 -0
- package/src/components.tsx +42 -0
- package/src/delta/components/Rounded.tsx +72 -0
- package/src/delta/components/Square.tsx +72 -0
- package/src/delta/index.tsx +6 -0
- package/src/delta/styles/styled/delta.ts +126 -0
- package/src/dot/components/Location.tsx +55 -0
- package/src/dot/index.tsx +7 -0
- package/src/dot/styles/styled/location.ts +78 -0
- package/src/dropdown/components/Container.tsx +36 -0
- package/src/dropdown/components/ParentContainer.tsx +32 -0
- package/src/dropdown/dropdown.scss +1 -0
- package/src/dropdown/index.tsx +9 -0
- package/src/dropdown/styled.tsx +3 -0
- package/src/dropdown/styles/scss/variables.scss +24 -0
- package/src/dropdown/styles/styled-components/dropdown.ts +79 -0
- package/src/form/components/Provider.tsx +37 -0
- package/src/form/index.tsx +5 -0
- package/src/form-field/common/components/item-contents/Container.tsx +51 -0
- package/src/form-field/common/components/item-contents/Label.tsx +21 -0
- package/src/form-field/common/components/item-contents/Wrapper.tsx +24 -0
- package/src/form-field/common/components/item-contents/index.tsx +11 -0
- package/src/form-field/common/field.scss +2 -0
- package/src/form-field/common/hook.tsx +1 -0
- package/src/form-field/common/hooks/index.tsx +13 -0
- package/src/form-field/common/hooks/types.ts +16 -0
- package/src/form-field/common/hooks/useChangeEvents.ts +171 -0
- package/src/form-field/common/hooks/useInputCountdown.ts +115 -0
- package/src/form-field/common/hooks/useInputFile.ts +94 -0
- package/src/form-field/common/hooks/useInputMask.ts +56 -0
- package/src/form-field/common/hooks/useOpenDaumPostCodePopup.tsx +55 -0
- package/src/form-field/common/index.tsx +7 -0
- package/src/form-field/common/jotai/find-address.ts +4 -0
- package/src/form-field/common/jotai/password-hide.ts +6 -0
- package/src/form-field/common/styled.tsx +7 -0
- package/src/form-field/common/styles/scss/reset.scss +52 -0
- package/src/form-field/common/styles/scss/variables.scss +52 -0
- package/src/form-field/common/styles/styled-components/item.ts +148 -0
- package/src/form-field/input/components/Container.tsx +54 -0
- package/src/form-field/input/components/assets/button/ResetButton.tsx +24 -0
- package/src/form-field/input/components/assets/calendar/DatePicker.tsx +184 -0
- package/src/form-field/input/components/assets/calendar/DateTimePicker.tsx +187 -0
- package/src/form-field/input/components/assets/calendar/TimePicker.tsx +163 -0
- package/src/form-field/input/components/assets/calendar/custom/ButtonContainer.tsx +15 -0
- package/src/form-field/input/components/assets/calendar/custom/TodayButton.tsx +23 -0
- package/src/form-field/input/components/assets/icon/CalendarIcon.tsx +14 -0
- package/src/form-field/input/components/assets/icon/CheckIcon.tsx +14 -0
- package/src/form-field/input/components/assets/icon/ExpandIcon.tsx +14 -0
- package/src/form-field/input/components/assets/icon/StatusIcon.tsx +17 -0
- package/src/form-field/input/components/assets/util/Countdown.tsx +34 -0
- package/src/form-field/input/components/assets/util/StatusNotice.tsx +22 -0
- package/src/form-field/input/components/click/Checkbox.tsx +99 -0
- package/src/form-field/input/components/click/Radio.tsx +77 -0
- package/src/form-field/input/components/click/index.tsx +9 -0
- package/src/form-field/input/components/date-time/Date.tsx +74 -0
- package/src/form-field/input/components/date-time/DateTime.tsx +72 -0
- package/src/form-field/input/components/date-time/Time.tsx +60 -0
- package/src/form-field/input/components/file-upload/Container.tsx +117 -0
- package/src/form-field/input/components/file-upload/DragAndDrop.tsx +65 -0
- package/src/form-field/input/components/text/Box.tsx +134 -0
- package/src/form-field/input/components/text/index.tsx +7 -0
- package/src/form-field/input/index.tsx +19 -0
- package/src/form-field/input/input.scss +2 -0
- package/src/form-field/input/styled.tsx +5 -0
- package/src/form-field/input/styles/scss/size.scss +39 -0
- package/src/form-field/input/styles/scss/theme.scss +39 -0
- package/src/form-field/input/styles/styled-components/base.ts +96 -0
- package/src/form-field/input/styles/styled-components/calendar.ts +18 -0
- package/src/form-field/input/styles/styled-components/click.ts +37 -0
- package/src/form-field/input/styles/styled-components/input-file.ts +26 -0
- package/src/form-field/input/styles/styled-components/mixin.ts +200 -0
- package/src/form-field/input/styles/styled-components/util.ts +47 -0
- package/src/form-field/select/components/Default.tsx +222 -0
- package/src/form-field/select/components/MultipleCategoryList.tsx +47 -0
- package/src/form-field/select/components/MultipleDefault.tsx +63 -0
- package/src/form-field/select/components/assets/Container.tsx +40 -0
- package/src/form-field/select/components/assets/dropdown/Default.tsx +114 -0
- package/src/form-field/select/components/assets/dropdown/MultipleCategoryList.tsx +95 -0
- package/src/form-field/select/components/assets/dropdown/MultipleDefault.tsx +149 -0
- package/src/form-field/select/components/assets/dropdown/Selected.tsx +48 -0
- package/src/form-field/select/index.tsx +13 -0
- package/src/form-field/select/select.scss +1 -0
- package/src/form-field/select/styled.tsx +5 -0
- package/src/form-field/select/styles/scss/variable.scss +14 -0
- package/src/form-field/select/styles/styled-components/base.ts +135 -0
- package/src/frame/components/breadcrumb/Arrow.tsx +18 -0
- package/src/frame/components/breadcrumb/Container.tsx +20 -0
- package/src/frame/components/breadcrumb/Dropdown.tsx +28 -0
- package/src/frame/components/breadcrumb/Item.tsx +30 -0
- package/src/frame/components/breadcrumb/Label.tsx +11 -0
- package/src/frame/components/breadcrumb/SelectBox.tsx +48 -0
- package/src/frame/components/breadcrumb/SelectItem.tsx +47 -0
- package/src/frame/components/breadcrumb/Selected.tsx +25 -0
- package/src/frame/components/breadcrumb/index.tsx +15 -0
- package/src/frame/components/header/Container.tsx +11 -0
- package/src/frame/components/header/Logo.tsx +19 -0
- package/src/frame/components/header/index.tsx +27 -0
- package/src/frame/components/header/util/Button.tsx +31 -0
- package/src/frame/components/header/util/Container.tsx +15 -0
- package/src/frame/components/header/util/Item.tsx +16 -0
- package/src/frame/components/header/util/logout/Logout.tsx +22 -0
- package/src/frame/components/header/util/notify/Container.tsx +57 -0
- package/src/frame/components/header/util/notify/Dropdown.tsx +24 -0
- package/src/frame/components/header/util/notify/List.tsx +56 -0
- package/src/frame/components/header/util/notify/OpenButton.tsx +35 -0
- package/src/frame/components/header/util/notify/RefreshButton.tsx +31 -0
- package/src/frame/components/header/util/profile/Avatar.tsx +19 -0
- package/src/frame/components/header/util/profile/Container.tsx +61 -0
- package/src/frame/components/header/util/profile/Dropdown.tsx +30 -0
- package/src/frame/components/header/util/profile/DropdownButton.tsx +27 -0
- package/src/frame/components/header/util/profile/Selected.tsx +29 -0
- package/src/frame/components/header/util/setting/Button.tsx +39 -0
- package/src/frame/components/header/util/time/Container.tsx +13 -0
- package/src/frame/components/header/util/time/Time.tsx +11 -0
- package/src/frame/components/index.tsx +17 -0
- package/src/frame/components/nav/Button.tsx +22 -0
- package/src/frame/components/nav/Container.tsx +64 -0
- package/src/frame/components/nav/Logo.tsx +24 -0
- package/src/frame/components/nav/index.tsx +5 -0
- package/src/frame/components/page/Container.tsx +11 -0
- package/src/frame/components/page/ServiceFrame.tsx +13 -0
- package/src/frame/components/page/ServiceMain.tsx +13 -0
- package/src/frame/components/page/ServiceMainWrapper.tsx +26 -0
- package/src/frame/components/page/index.tsx +14 -0
- package/src/frame/components/popup/Container.tsx +21 -0
- package/src/frame/components/popup/frame/Body.tsx +17 -0
- package/src/frame/components/popup/frame/Container.tsx +20 -0
- package/src/frame/components/popup/frame/Header.tsx +27 -0
- package/src/frame/components/popup/frame/index.tsx +11 -0
- package/src/frame/components/popup/index.tsx +9 -0
- package/src/frame/frame.scss +2 -0
- package/src/frame/index.tsx +3 -0
- package/src/frame/styled.tsx +3 -0
- package/src/frame/styles/scss/size.variables.scss +28 -0
- package/src/frame/styles/scss/theme.variables.scss +23 -0
- package/src/frame/styles/styled-components/breadcrumb/base.ts +126 -0
- package/src/frame/styles/styled-components/index.ts +13 -0
- package/src/frame/styles/styled-components/page/common.ts +66 -0
- package/src/frame/styles/styled-components/page/header.ts +44 -0
- package/src/frame/styles/styled-components/page/nav.ts +127 -0
- package/src/frame/styles/styled-components/page/util.common.ts +48 -0
- package/src/frame/styles/styled-components/page/util.notify.ts +116 -0
- package/src/frame/styles/styled-components/page/util.profile.ts +78 -0
- package/src/frame/styles/styled-components/popup/popup.ts +66 -0
- package/src/icon/components/alternate/Loading.tsx +15 -0
- package/src/icon/components/alternate/index.tsx +7 -0
- package/src/icon/components/arrow/dropdown/Breadcrumb.tsx +20 -0
- package/src/icon/components/arrow/dropdown/Select.tsx +20 -0
- package/src/icon/components/arrow/index.tsx +11 -0
- package/src/icon/components/button/Close.tsx +20 -0
- package/src/icon/components/button/Filter.tsx +19 -0
- package/src/icon/components/button/Refresh.tsx +18 -0
- package/src/icon/components/button/Reset.tsx +18 -0
- package/src/icon/components/button/add/Outline.tsx +23 -0
- package/src/icon/components/button/add/Solid.tsx +23 -0
- package/src/icon/components/button/add/index.tsx +9 -0
- package/src/icon/components/button/index.tsx +17 -0
- package/src/icon/components/button/remove/Outline.tsx +23 -0
- package/src/icon/components/button/remove/Solid.tsx +23 -0
- package/src/icon/components/button/remove/index.tsx +9 -0
- package/src/icon/components/cage/Fan.tsx +48 -0
- package/src/icon/components/cage/index.tsx +7 -0
- package/src/icon/components/chart/Control.tsx +40 -0
- package/src/icon/components/chart/index.tsx +7 -0
- package/src/icon/components/delta/Delta.tsx +79 -0
- package/src/icon/components/delta/index.tsx +3 -0
- package/src/icon/components/health-score/HealthScore.tsx +46 -0
- package/src/icon/components/health-score/index.tsx +3 -0
- package/src/icon/components/input/Checkbox.tsx +33 -0
- package/src/icon/components/input/Radio.tsx +17 -0
- package/src/icon/components/input/Search.tsx +12 -0
- package/src/icon/components/input/index.tsx +11 -0
- package/src/icon/components/nav/common/Farm.tsx +12 -0
- package/src/icon/components/nav/factory-service/CCTV.tsx +12 -0
- package/src/icon/components/nav/factory-service/Dashboard.tsx +12 -0
- package/src/icon/components/nav/factory-service/Home.tsx +12 -0
- package/src/icon/components/nav/factory-service/Message.tsx +12 -0
- package/src/icon/components/nav/factory-service/Productivity.tsx +12 -0
- package/src/icon/components/nav/farm-service/Analysis.tsx +12 -0
- package/src/icon/components/nav/farm-service/Control.tsx +12 -0
- package/src/icon/components/nav/farm-service/Dashboard.tsx +12 -0
- package/src/icon/components/nav/farm-service/Eggs.tsx +12 -0
- package/src/icon/components/nav/farm-service/Feeding.tsx +12 -0
- package/src/icon/components/nav/farm-service/Feeds.tsx +12 -0
- package/src/icon/components/nav/farm-service/Flock.tsx +12 -0
- package/src/icon/components/nav/farm-service/Medicine.tsx +12 -0
- package/src/icon/components/nav/farm-service/Summary.tsx +12 -0
- package/src/icon/components/nav/index.tsx +44 -0
- package/src/icon/components/page-header/Check.tsx +12 -0
- package/src/icon/components/page-header/index.tsx +5 -0
- package/src/icon/components/tab-menu/Graph.tsx +12 -0
- package/src/icon/components/tab-menu/Table.tsx +12 -0
- package/src/icon/components/tab-menu/index.tsx +9 -0
- package/src/icon/components/table/index.tsx +9 -0
- package/src/icon/components/table/pagination/First.tsx +18 -0
- package/src/icon/components/table/pagination/Last.tsx +18 -0
- package/src/icon/components/table/pagination/Next.tsx +18 -0
- package/src/icon/components/table/pagination/Prev.tsx +18 -0
- package/src/icon/components/table/pagination/index.tsx +13 -0
- package/src/icon/components/table/sort/Asc.tsx +12 -0
- package/src/icon/components/table/sort/Common.tsx +12 -0
- package/src/icon/components/table/sort/Desc.tsx +12 -0
- package/src/icon/components/table/sort/index.tsx +11 -0
- package/src/icon/components/tooltip/Outline.tsx +7 -0
- package/src/icon/components/tooltip/Solid.tsx +7 -0
- package/src/icon/components/tooltip/index.tsx +9 -0
- package/src/icon/icon.scss +5 -0
- package/src/icon/index.tsx +31 -0
- package/src/icon/styled.tsx +17 -0
- package/src/icon/styles/scss/arrow.scss +6 -0
- package/src/icon/styles/scss/chart.scss +3 -0
- package/src/icon/styles/scss/input.scss +11 -0
- package/src/icon/styles/scss/page-header.scss +6 -0
- package/src/icon/styles/scss/table.scss +6 -0
- package/src/icon/styles/styled/arrow.ts +18 -0
- package/src/icon/styles/styled/chart.ts +17 -0
- package/src/icon/styles/styled/common.ts +27 -0
- package/src/icon/styles/styled/delta.ts +25 -0
- package/src/icon/styles/styled/input.ts +76 -0
- package/src/icon/styles/styled/page-header.ts +17 -0
- package/src/icon/styles/styled/table.ts +19 -0
- package/src/icon/svg/arrow/depth.svg +3 -0
- package/src/icon/svg/arrow/dropdown/breadcrumb.svg +3 -0
- package/src/icon/svg/arrow/dropdown/select.svg +3 -0
- package/src/icon/svg/button/add-outline.svg +4 -0
- package/src/icon/svg/button/add-solid.svg +3 -0
- package/src/icon/svg/button/close.svg +3 -0
- package/src/icon/svg/button/filter.svg +5 -0
- package/src/icon/svg/button/loading.svg +4 -0
- package/src/icon/svg/button/refresh.svg +4 -0
- package/src/icon/svg/button/remove-outline.svg +3 -0
- package/src/icon/svg/button/remove-solid.svg +3 -0
- package/src/icon/svg/button/reset.svg +3 -0
- package/src/icon/svg/chart/control/pan-left.svg +4 -0
- package/src/icon/svg/chart/control/pan-right.svg +4 -0
- package/src/icon/svg/chart/control/zoom-in.svg +4 -0
- package/src/icon/svg/chart/control/zoom-out.svg +4 -0
- package/src/icon/svg/delta/down-arrow.svg +4 -0
- package/src/icon/svg/delta/down-flat.svg +10 -0
- package/src/icon/svg/delta/down-rounded.svg +10 -0
- package/src/icon/svg/delta/up-arrow.svg +4 -0
- package/src/icon/svg/delta/up-flat.svg +10 -0
- package/src/icon/svg/delta/up-rounded.svg +10 -0
- package/src/icon/svg/input/search.svg +4 -0
- package/src/icon/svg/nav/factory-service/cctv.svg +3 -0
- package/src/icon/svg/nav/factory-service/dashboard.svg +3 -0
- package/src/icon/svg/nav/factory-service/farm.svg +3 -0
- package/src/icon/svg/nav/factory-service/home.svg +5 -0
- package/src/icon/svg/nav/factory-service/message.svg +3 -0
- package/src/icon/svg/nav/farm-service/analysis.svg +3 -0
- package/src/icon/svg/nav/farm-service/cctv.svg +3 -0
- package/src/icon/svg/nav/farm-service/control.svg +3 -0
- package/src/icon/svg/nav/farm-service/dashboard.svg +5 -0
- package/src/icon/svg/nav/farm-service/eggs.svg +3 -0
- package/src/icon/svg/nav/farm-service/feeds.svg +14 -0
- package/src/icon/svg/nav/farm-service/flock.svg +14 -0
- package/src/icon/svg/nav/farm-service/medicine.svg +4 -0
- package/src/icon/svg/nav/farm-service/summary.svg +7 -0
- package/src/icon/svg/nav/farm.svg +3 -0
- package/src/icon/svg/nav/grid.svg +3 -0
- package/src/icon/svg/nav/lock.svg +1 -0
- package/src/icon/svg/page-header/check.svg +3 -0
- package/src/icon/svg/tab-menu/graph.svg +3 -0
- package/src/icon/svg/tab-menu/table.svg +8 -0
- package/src/icon/svg/table/pagination/first.svg +4 -0
- package/src/icon/svg/table/pagination/last.svg +4 -0
- package/src/icon/svg/table/pagination/next.svg +3 -0
- package/src/icon/svg/table/pagination/prev.svg +3 -0
- package/src/icon/svg/table/sort/asc.svg +3 -0
- package/src/icon/svg/table/sort/common.svg +6 -0
- package/src/icon/svg/table/sort/desc.svg +3 -0
- package/src/icon/svg/tooltip/outline.svg +5 -0
- package/src/icon/svg/tooltip/solid.svg +3 -0
- package/src/index.scss +20 -0
- package/src/index.tsx +16 -0
- package/src/modal/components/assets/alert/MessageBox.tsx +26 -0
- package/src/modal/components/assets/alert/index.tsx +7 -0
- package/src/modal/components/assets/button/ButtonClose.tsx +34 -0
- package/src/modal/components/assets/button/ButtonDialog.tsx +32 -0
- package/src/modal/components/assets/button/index.tsx +6 -0
- package/src/modal/components/assets/form/ButtonContainer.tsx +18 -0
- package/src/modal/components/assets/form/Provider.tsx +12 -0
- package/src/modal/components/assets/form/index.tsx +9 -0
- package/src/modal/components/assets/layout/Body.tsx +7 -0
- package/src/modal/components/assets/layout/Container.tsx +37 -0
- package/src/modal/components/assets/layout/Footer.tsx +25 -0
- package/src/modal/components/assets/layout/Header.tsx +45 -0
- package/src/modal/components/assets/layout/index.tsx +14 -0
- package/src/modal/components/basic/Container.tsx +45 -0
- package/src/modal/components/basic/Provider.tsx +30 -0
- package/src/modal/components/basic/Root.tsx +84 -0
- package/src/modal/components/basic/index.tsx +11 -0
- package/src/modal/components/draggable/Container.tsx +75 -0
- package/src/modal/components/draggable/Provider.tsx +26 -0
- package/src/modal/components/draggable/index.tsx +9 -0
- package/src/modal/components/index.tsx +17 -0
- package/src/modal/hooks/useModal.ts +295 -0
- package/src/modal/index.tsx +3 -0
- package/src/modal/jotai/modal.ts +18 -0
- package/src/modal/modal.scss +2 -0
- package/src/modal/styled.tsx +15 -0
- package/src/modal/styles/scss/legacy.scss +254 -0
- package/src/modal/styles/scss/variables.scss +32 -0
- package/src/modal/styles/styled-components/alert.ts +24 -0
- package/src/modal/styles/styled-components/basic.ts +41 -0
- package/src/modal/styles/styled-components/draggable.ts +35 -0
- package/src/modal/styles/styled-components/form.ts +23 -0
- package/src/modal/styles/styled-components/layout.ts +106 -0
- package/src/modal/util.ts +4 -0
- package/src/scrollbar/components/Container.tsx +70 -0
- package/src/scrollbar/index.tsx +5 -0
- package/src/scrollbar/scrollbar.scss +2 -0
- package/src/scrollbar/styled.tsx +3 -0
- package/src/scrollbar/styles/scss/reset.scss +59 -0
- package/src/scrollbar/styles/scss/size.scss +4 -0
- package/src/scrollbar/styles/styled-components/scrollbar.ts +82 -0
- package/src/style-base/base.scss +6 -0
- package/src/style-base/essentials/calendar.scss +557 -0
- package/src/style-base/essentials/colors.scss +195 -0
- package/src/style-base/essentials/document.scss +14 -0
- package/src/style-base/essentials/fonts.scss +24 -0
- package/src/style-base/essentials/icon.scss +11 -0
- package/src/style-base/essentials/palette.scss +146 -0
- package/src/style-base/essentials/reset.scss +156 -0
- package/src/style-base/mantine.css +4 -0
- package/src/style-base/responsive.scss +57 -0
- package/src/style-config/index.ts +5 -0
- package/src/style-config/postcss/postcss-config.ts +9 -0
- package/src/styled.components.tsx +31 -0
- package/src/styled.template.tsx +5 -0
- package/src/tab-menu/components/custom/AddButton.tsx +32 -0
- package/src/tab-menu/components/custom/Container.tsx +60 -0
- package/src/tab-menu/components/custom/MenuButton.tsx +39 -0
- package/src/tab-menu/components/filter/Default.tsx +3 -0
- package/src/tab-menu/components/filter/WithData.tsx +36 -0
- package/src/tab-menu/components/mode/List.tsx +66 -0
- package/src/tab-menu/components/page/List.tsx +88 -0
- package/src/tab-menu/components/separated-square/List.tsx +66 -0
- package/src/tab-menu/components/text/List.tsx +53 -0
- package/src/tab-menu/index.tsx +21 -0
- package/src/tab-menu/styled.tsx +21 -0
- package/src/tab-menu/styles/scss/mode.scss +5 -0
- package/src/tab-menu/styles/scss/page-menu.scss +4 -0
- package/src/tab-menu/styles/scss/text-menu.scss +7 -0
- package/src/tab-menu/styles/styled-components/custom-menu.ts +80 -0
- package/src/tab-menu/styles/styled-components/filter-with-data.ts +72 -0
- package/src/tab-menu/styles/styled-components/mode-menu.ts +114 -0
- package/src/tab-menu/styles/styled-components/page-menu.ts +90 -0
- package/src/tab-menu/styles/styled-components/separated-square.ts +78 -0
- package/src/tab-menu/styles/styled-components/tab-menu.ts +21 -0
- package/src/tab-menu/styles/styled-components/text-menu.ts +73 -0
- package/src/tab-menu/tab-menu.scss +3 -0
- package/src/table/components/pagination/Button.tsx +61 -0
- package/src/table/components/pagination/Container.tsx +148 -0
- package/src/table/components/pagination/Icon.tsx +26 -0
- package/src/table/components/sort/Button.tsx +34 -0
- package/src/table/components/tables/Container.tsx +41 -0
- package/src/table/components/tables/basic/Container.tsx +52 -0
- package/src/table/components/tables/basic/index.tsx +13 -0
- package/src/table/components/tables/common/Body.tsx +29 -0
- package/src/table/components/tables/common/Cell.tsx +32 -0
- package/src/table/components/tables/common/CellWrap.tsx +27 -0
- package/src/table/components/tables/common/ColGroup.tsx +30 -0
- package/src/table/components/tables/common/DefaultTemplate.tsx +37 -0
- package/src/table/components/tables/common/Foot.tsx +25 -0
- package/src/table/components/tables/common/Head.tsx +25 -0
- package/src/table/components/tables/common/HeadDefault.tsx +42 -0
- package/src/table/components/tables/common/Row.tsx +36 -0
- package/src/table/components/tables/common/TopLine.tsx +11 -0
- package/src/table/components/tables/common/index.tsx +37 -0
- package/src/table/components/tables/grid/Cell.tsx +25 -0
- package/src/table/components/tables/grid/Container.tsx +23 -0
- package/src/table/components/tables/grid/Contents.tsx +25 -0
- package/src/table/components/tables/grid/index.tsx +19 -0
- package/src/table/components/tables/list/Container.tsx +36 -0
- package/src/table/components/tables/list/index.tsx +13 -0
- package/src/table/components/tables/sheet/Container.tsx +39 -0
- package/src/table/components/tables/sheet/index.tsx +13 -0
- package/src/table/hooks/index.ts +5 -0
- package/src/table/hooks/useTableColumns.ts +24 -0
- package/src/table/hooks/useTablePage.ts +150 -0
- package/src/table/hooks/useTableRowCheck.ts +112 -0
- package/src/table/hooks/useTableSearch.ts +69 -0
- package/src/table/hooks/useTableSort.ts +108 -0
- package/src/table/index.tsx +37 -0
- package/src/table/styled.tsx +3 -0
- package/src/table/styles/scss/common.scss +31 -0
- package/src/table/styles/scss/pagination.scss +14 -0
- package/src/table/styles/scss/reset.scss +7 -0
- package/src/table/styles/styled/basic.ts +59 -0
- package/src/table/styles/styled/common.ts +123 -0
- package/src/table/styles/styled/grid.ts +62 -0
- package/src/table/styles/styled/index.ts +20 -0
- package/src/table/styles/styled/list.ts +38 -0
- package/src/table/styles/styled/pagination.ts +77 -0
- package/src/table/styles/styled/sort.ts +25 -0
- package/src/table/styles/styled/spreadsheet.ts +86 -0
- package/src/table/table.scss +3 -0
- package/src/table/util.ts +1 -0
- package/src/template/compare/compare.scss +1 -0
- package/src/template/compare/components/box/Container.tsx +33 -0
- package/src/template/compare/components/box/TextStrong.tsx +15 -0
- package/src/template/compare/components/box/TextSub.tsx +15 -0
- package/src/template/compare/components/box/index.tsx +11 -0
- package/src/template/compare/components/button/Remove.tsx +28 -0
- package/src/template/compare/components/button/index.tsx +5 -0
- package/src/template/compare/components/chart/Container.tsx +33 -0
- package/src/template/compare/components/chart/graph/Container.tsx +15 -0
- package/src/template/compare/components/chart/graph/Item.tsx +13 -0
- package/src/template/compare/components/chart/index.tsx +16 -0
- package/src/template/compare/components/chart/legend/Container.tsx +23 -0
- package/src/template/compare/components/chart/legend/Section.tsx +31 -0
- package/src/template/compare/components/select-list/Container.tsx +15 -0
- package/src/template/compare/components/select-list/Header.tsx +15 -0
- package/src/template/compare/components/select-list/Item.tsx +15 -0
- package/src/template/compare/components/select-list/List.tsx +18 -0
- package/src/template/compare/components/select-list/index.tsx +13 -0
- package/src/template/compare/index.tsx +13 -0
- package/src/template/compare/styled.tsx +17 -0
- package/src/template/compare/styles/scss/variables.scss +17 -0
- package/src/template/compare/styles/styled-components/chart/graph.ts +26 -0
- package/src/template/compare/styles/styled-components/chart/layout.ts +38 -0
- package/src/template/compare/styles/styled-components/chart/legend.ts +64 -0
- package/src/template/compare/styles/styled-components/common.ts +57 -0
- package/src/template/compare/styles/styled-components/select-list.ts +36 -0
- package/src/template/filter/components/Container.tsx +39 -0
- package/src/template/filter/components/Group.tsx +100 -0
- package/src/template/filter/components/ToggleButton.tsx +27 -0
- package/src/template/filter/index.tsx +5 -0
- package/src/template/filter/styled.tsx +3 -0
- package/src/template/filter/styles/styled-components/filter.ts +66 -0
- package/src/template/health-score/components/Chart.tsx +38 -0
- package/src/template/health-score/index.tsx +3 -0
- package/src/template/health-score/styled.tsx +3 -0
- package/src/template/health-score/styles/styled/chart.ts +26 -0
- package/src/template.tsx +5 -0
- package/src/text-editor/components/Container.tsx +68 -0
- package/src/text-editor/components/Contents.tsx +14 -0
- package/src/text-editor/components/toolbar/Container.tsx +20 -0
- package/src/text-editor/components/toolbar/ControlsGroup.tsx +18 -0
- package/src/text-editor/components/toolbar/align/Center.tsx +23 -0
- package/src/text-editor/components/toolbar/align/Justify.tsx +23 -0
- package/src/text-editor/components/toolbar/align/Left.tsx +23 -0
- package/src/text-editor/components/toolbar/align/Right.tsx +23 -0
- package/src/text-editor/components/toolbar/index.tsx +35 -0
- package/src/text-editor/components/toolbar/list/Bullet.tsx +23 -0
- package/src/text-editor/components/toolbar/list/Ordered.tsx +23 -0
- package/src/text-editor/components/toolbar/text/Bold.tsx +23 -0
- package/src/text-editor/components/toolbar/text/Italic.tsx +23 -0
- package/src/text-editor/components/toolbar/text/Strike.tsx +27 -0
- package/src/text-editor/components/toolbar/text/Underline.tsx +23 -0
- package/src/text-editor/index.tsx +11 -0
- package/src/text-editor/styled.tsx +5 -0
- package/src/text-editor/styles/scss/style.scss +10 -0
- package/src/text-editor/styles/scss/theme.scss +17 -0
- package/src/text-editor/styles/styled/editor.ts +73 -0
- package/src/text-editor/svg/align/center.svg +6 -0
- package/src/text-editor/svg/align/justify.svg +6 -0
- package/src/text-editor/svg/align/left.svg +6 -0
- package/src/text-editor/svg/align/right.svg +6 -0
- package/src/text-editor/svg/list/bullet.svg +8 -0
- package/src/text-editor/svg/list/ordered.svg +8 -0
- package/src/text-editor/svg/text/bold.svg +4 -0
- package/src/text-editor/svg/text/italic.svg +5 -0
- package/src/text-editor/svg/text/strikethrough.svg +4 -0
- package/src/text-editor/svg/text/underline.svg +4 -0
- package/src/text-editor/text-editor.scss +2 -0
- package/src/tooltip/components/Help.tsx +38 -0
- package/src/tooltip/components/MessageBox.tsx +26 -0
- package/src/tooltip/components/Wrapper.tsx +34 -0
- package/src/tooltip/index.tsx +11 -0
- package/src/tooltip/styled.tsx +9 -0
- package/src/tooltip/styles/scss/size.scss +4 -0
- package/src/tooltip/styles/styled-components/base.ts +20 -0
- package/src/tooltip/styles/styled-components/help.ts +17 -0
- package/src/tooltip/styles/styled-components/message-box.ts +74 -0
- package/src/tooltip/tooltip.scss +1 -0
- package/src/types/button/base.d.ts +91 -0
- package/src/types/button/index.d.ts +2 -0
- package/src/types/button/multiple.d.ts +6 -0
- package/src/types/chart/axis.d.ts +15 -0
- package/src/types/chart/control.d.ts +109 -0
- package/src/types/chart/data.d.ts +41 -0
- package/src/types/chart/dot.d.ts +3 -0
- package/src/types/chart/index.d.ts +7 -0
- package/src/types/chart/legend.d.ts +124 -0
- package/src/types/chart/props.d.ts +271 -0
- package/src/types/chart/tick.d.ts +30 -0
- package/src/types/chip/index.d.ts +1 -0
- package/src/types/chip/props.d.ts +14 -0
- package/src/types/common.d.ts +16 -0
- package/src/types/delta/index.d.ts +1 -0
- package/src/types/delta/option.d.ts +57 -0
- package/src/types/form/common/format.d.ts +15 -0
- package/src/types/form/common/hook.d.ts +74 -0
- package/src/types/form/common/index.d.ts +6 -0
- package/src/types/form/common/label.d.ts +11 -0
- package/src/types/form/common/props.d.ts +136 -0
- package/src/types/form/common/state.d.ts +96 -0
- package/src/types/form/common/validation.d.ts +18 -0
- package/src/types/form/index.d.ts +5 -0
- package/src/types/form/input/index.d.ts +7 -0
- package/src/types/form/input/legacy/auto-complete.d.ts +77 -0
- package/src/types/form/input/legacy/base.d.ts +159 -0
- package/src/types/form/input/legacy/find-address.d.ts +7 -0
- package/src/types/form/input/legacy/refer.d.ts +84 -0
- package/src/types/form/input/legacy/select.options.d.ts +123 -0
- package/src/types/form/input/props.d.ts +156 -0
- package/src/types/form/search/index.d.ts +1 -0
- package/src/types/form/search/search.d.ts +4 -0
- package/src/types/form/select/index.d.ts +2 -0
- package/src/types/form/select/option.d.ts +43 -0
- package/src/types/form/select/props.d.ts +101 -0
- package/src/types/form/util/find-address.d.ts +7 -0
- package/src/types/form/util/index.d.ts +1 -0
- package/src/types/frame/index.d.ts +2 -0
- package/src/types/frame/notify.d.ts +7 -0
- package/src/types/frame/sitemap.d.ts +38 -0
- package/src/types/icon/delta.d.ts +32 -0
- package/src/types/icon/fan.d.ts +17 -0
- package/src/types/icon/index.d.ts +2 -0
- package/src/types/index.d.ts +15 -0
- package/src/types/location/geojson.d.ts +59 -0
- package/src/types/location/index.d.ts +2 -0
- package/src/types/location/region.d.ts +19 -0
- package/src/types/modal/index.d.ts +2 -0
- package/src/types/modal/modal.d.ts +88 -0
- package/src/types/modal/modal.options.d.ts +33 -0
- package/src/types/style-option.d.ts +33 -0
- package/src/types/tab-menu/index.d.ts +1 -0
- package/src/types/tab-menu/tab-menu.d.ts +37 -0
- package/src/types/table/components/pagination.d.ts +7 -0
- package/src/types/table/components/props.d.ts +104 -0
- package/src/types/table/data/column.d.ts +60 -0
- package/src/types/table/data/row.d.ts +26 -0
- package/src/types/table/index.d.ts +10 -0
- package/src/types/table/layout/grid.d.ts +8 -0
- package/src/types/table/layout/layout.d.ts +3 -0
- package/src/types/table/utils/row.check.d.ts +37 -0
- package/src/types/template/compare/chart.d.ts +8 -0
- package/src/types/template/filter.d.ts +39 -0
- package/src/types/template/index.d.ts +2 -0
- package/src/types/weather/api.d.ts +184 -0
- package/src/types/weather/base.d.ts +14 -0
- package/src/types/weather/index.d.ts +4 -0
- package/src/types/weather/korea.d.ts +163 -0
- package/src/types/weather/open-weather-map.d.ts +181 -0
- package/src/weather/apis/index.ts +4 -0
- package/src/weather/apis/korea/client.ts +93 -0
- package/src/weather/apis/korea/server.ts +250 -0
- package/src/weather/apis/open-weather-map/client.ts +69 -0
- package/src/weather/apis/open-weather-map/server.ts +134 -0
- package/src/weather/components/icon/Address.tsx +17 -0
- package/src/weather/components/icon/Weather.tsx +33 -0
- package/src/weather/components/index.tsx +7 -0
- package/src/weather/components/page-header/Address.tsx +21 -0
- package/src/weather/components/page-header/Alert.tsx +42 -0
- package/src/weather/components/page-header/Container.tsx +14 -0
- package/src/weather/components/page-header/Forecast.tsx +23 -0
- package/src/weather/components/page-header/NextDays.tsx +34 -0
- package/src/weather/components/page-header/Today.tsx +153 -0
- package/src/weather/data/alert-regions-meta.json +1286 -0
- package/src/weather/data/response.ts +36 -0
- package/src/weather/data/weather-regions-meta.json +9833 -0
- package/src/weather/hooks/index.ts +4 -0
- package/src/weather/hooks/useOpenWeatherMap.ts +31 -0
- package/src/weather/hooks/useWeatherKorea.ts +58 -0
- package/src/weather/hooks/useWeatherKoreaAlert.ts +22 -0
- package/src/weather/index.tsx +4 -0
- package/src/weather/jotai/coordinate.ts +16 -0
- package/src/weather/jotai/farm-idx.ts +5 -0
- package/src/weather/jotai/index.ts +2 -0
- package/src/weather/styled.tsx +13 -0
- package/src/weather/styles/styled-components/alert.ts +30 -0
- package/src/weather/styles/styled-components/base.ts +79 -0
- package/src/weather/styles/styled-components/next-days.ts +25 -0
- package/src/weather/styles/styled-components/today.ts +40 -0
- package/src/weather/utils/alert.ts +30 -0
- package/src/weather/utils/date-time.ts +68 -0
- package/src/weather/utils/index.ts +4 -0
- package/src/weather/utils/location.ts +159 -0
- package/src/weather/utils/validate.ts +9 -0
- package/src/weather/utils/weather.ts +304 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
export type KMA_GridCoordinate = {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export type KMA_Req_Base = {
|
|
7
|
+
pageNo: string;
|
|
8
|
+
numOfRows: string;
|
|
9
|
+
authKey: string; // API_KEY
|
|
10
|
+
dataType: string; // JSON, XML
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type KMA_Req_BaseMoments = {
|
|
14
|
+
base_date: string; // YYYYMMDD
|
|
15
|
+
base_time: string; // HH00
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type KMA_Req_BaseGridCoordinate = {
|
|
19
|
+
nx: number;
|
|
20
|
+
ny: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type KMA_Req_Weather = KMA_Req_Base &
|
|
24
|
+
KMA_Req_BaseMoments &
|
|
25
|
+
KMA_Req_BaseGridCoordinate;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 기상청 API 응답; 예보변수
|
|
29
|
+
* @desc
|
|
30
|
+
* - SKY(하늘상태) 코드 - 1(맑음), 2(구름조금), 3(구름많음), 4(흐림)
|
|
31
|
+
* - PTY(강수형태) 코드 - 0(없음), 1(비), 2(비/눈), 3(눈), 4(소나기)
|
|
32
|
+
* - POP(강수확률) %
|
|
33
|
+
* - PCP(1시간 강수량) 1mm
|
|
34
|
+
* - SNO(1시간 신적설) 1cm
|
|
35
|
+
* - TMP(기온) ℃
|
|
36
|
+
* - TMX(최고기온) ℃
|
|
37
|
+
* - TMN(최저기온) ℃
|
|
38
|
+
* - REH(습도) %
|
|
39
|
+
* - UUU(풍속; 동서바람성분) m/s
|
|
40
|
+
* - VVV(풍속; 남북바람성분) m/s
|
|
41
|
+
* - VEC(풍향) deg
|
|
42
|
+
* - WSD(풍속) m/s
|
|
43
|
+
* - WAV(파고) m
|
|
44
|
+
*/
|
|
45
|
+
export type KMA_Res_WeatherVariablesCategory =
|
|
46
|
+
| "TMP"
|
|
47
|
+
| "TMX"
|
|
48
|
+
| "TMN"
|
|
49
|
+
| "UUU"
|
|
50
|
+
| "VVV"
|
|
51
|
+
| "VEC"
|
|
52
|
+
| "WSD"
|
|
53
|
+
| "SKY"
|
|
54
|
+
| "PTY"
|
|
55
|
+
| "POP"
|
|
56
|
+
| "PCP"
|
|
57
|
+
| "SNO"
|
|
58
|
+
| "REH"
|
|
59
|
+
| "WAV";
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* 기상청 API 응답; 예보 데이터 base
|
|
63
|
+
*/
|
|
64
|
+
export type KMA_Res_WeatherItemBase = {
|
|
65
|
+
baseDate: string;
|
|
66
|
+
baseTime: string;
|
|
67
|
+
category: KMA_Res_WeatherVariablesCategory;
|
|
68
|
+
} & KMA_Req_BaseGridCoordinate;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* 기상청 API 응답; 예보 데이터
|
|
72
|
+
*/
|
|
73
|
+
export type KMA_Res_WeatherItem = KMA_Res_WeatherItemBase & {
|
|
74
|
+
fcstDate: string;
|
|
75
|
+
fcstTime: string;
|
|
76
|
+
fcstValue: string;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// /**
|
|
80
|
+
// * 기상청 API 응답; 현재 날씨 데이터
|
|
81
|
+
// */
|
|
82
|
+
// export type KMA_Res_WeatherItemNow = KMA_Res_WeatherItemBase & {
|
|
83
|
+
// obsrValue: string;
|
|
84
|
+
// };
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* 기상청 API 응답; Header 데이터
|
|
88
|
+
*/
|
|
89
|
+
export type KMA_Res_Header = {
|
|
90
|
+
resultCode: string;
|
|
91
|
+
resultMsg: string;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* 기상청 API 응답; Body 데이터
|
|
96
|
+
*/
|
|
97
|
+
export type KMA_Res_Body<Item> = {
|
|
98
|
+
dataType: string;
|
|
99
|
+
items: { item: Item[] };
|
|
100
|
+
pageNo: number;
|
|
101
|
+
numOfRows: number;
|
|
102
|
+
totalCount: number;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* 기상청 API 응답; 공통 구조
|
|
107
|
+
*/
|
|
108
|
+
export type KMA_Res_Base<Item> = {
|
|
109
|
+
response: {
|
|
110
|
+
header: KMA_Res_Header;
|
|
111
|
+
body: KMA_Res_Body<Item>;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* 기상청 API 응답; 현재 날씨
|
|
117
|
+
*/
|
|
118
|
+
export type KMA_Res_WeatherNow = KMA_Res_Base<KMA_Res_WeatherItem>;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* 기상청 API 응답; 예보
|
|
122
|
+
*/
|
|
123
|
+
export type KMA_Res_WeatherForecast = KMA_Res_Base<KMA_Res_WeatherItem>;
|
|
124
|
+
|
|
125
|
+
// export type KMA_Res_MetaRegionCodeItem = {
|
|
126
|
+
// warningAreaCode: string;
|
|
127
|
+
// korName: string;
|
|
128
|
+
// };
|
|
129
|
+
// export type KMA_Res_MetaRegionCodes = KMA_Res_Base<KMA_Res_MetaRegionCodeItem>;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* 기상청 API 응답; 특보 종류
|
|
133
|
+
* @see https://apihub.kma.go.kr/static/html/attach/wrn_table.html
|
|
134
|
+
*/
|
|
135
|
+
export type KMA_Res_AlertType =
|
|
136
|
+
| "강풍"
|
|
137
|
+
| "호우"
|
|
138
|
+
| "한파"
|
|
139
|
+
| "건조"
|
|
140
|
+
| "해일"
|
|
141
|
+
| "지진해일"
|
|
142
|
+
| "풍량"
|
|
143
|
+
| "태풍"
|
|
144
|
+
| "대설"
|
|
145
|
+
| "황사"
|
|
146
|
+
| "폭염";
|
|
147
|
+
/**
|
|
148
|
+
* 기상청 API 응답; 특보 수준
|
|
149
|
+
* @see https://apihub.kma.go.kr/static/html/attach/wrn_table.html
|
|
150
|
+
*/
|
|
151
|
+
export type KMA_Res_AlertLevel = "예비특보" | "주의보" | "경보";
|
|
152
|
+
/**
|
|
153
|
+
* 기상청 API 응답; 특보 명령
|
|
154
|
+
* @see https://apihub.kma.go.kr/static/html/attach/wrn_table.html
|
|
155
|
+
*/
|
|
156
|
+
export type KMA_Res_AlertCommand =
|
|
157
|
+
| "발표"
|
|
158
|
+
| "대치"
|
|
159
|
+
| "해제"
|
|
160
|
+
| "대치해제"
|
|
161
|
+
| "연장"
|
|
162
|
+
| "변경"
|
|
163
|
+
| "변경해제";
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export type OWM_Res_Coord = {
|
|
2
|
+
lat: number;
|
|
3
|
+
lon: number;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @see https://openweathermap.org/weather-conditions
|
|
8
|
+
*/
|
|
9
|
+
export type OWM_Res_Condition = {
|
|
10
|
+
/**
|
|
11
|
+
* 날씨 코드
|
|
12
|
+
* @see https://openweathermap.org/weather-conditions
|
|
13
|
+
* @desc
|
|
14
|
+
* - 800: 맑음
|
|
15
|
+
* - 801: 구름조금
|
|
16
|
+
* - 802: 구름많음
|
|
17
|
+
* - 803: 흐림
|
|
18
|
+
* - 804: 흐림
|
|
19
|
+
* - 7XX: 안개, 연무, 황사 등
|
|
20
|
+
* - 6XX: 눈
|
|
21
|
+
* - 5XX: 비
|
|
22
|
+
* - 3XX: 이슬비, 빗방울 등
|
|
23
|
+
* - 2XX: 천둥번개
|
|
24
|
+
*/
|
|
25
|
+
id: number;
|
|
26
|
+
/**
|
|
27
|
+
* 개황 (영문)
|
|
28
|
+
*/
|
|
29
|
+
main: string;
|
|
30
|
+
/**
|
|
31
|
+
* 개황 (한글)
|
|
32
|
+
*/
|
|
33
|
+
description: string;
|
|
34
|
+
/**
|
|
35
|
+
* 아이콘 코드
|
|
36
|
+
* @see https://openweathermap.org/weather-conditions
|
|
37
|
+
* @desc
|
|
38
|
+
* - 01d: 맑음 (clear sky)
|
|
39
|
+
* - 02d: 구름조금 (few clouds)
|
|
40
|
+
* - 03d: 구름많음 (scattered clouds)
|
|
41
|
+
* - 04d: 흐림 (broken clouds)
|
|
42
|
+
* - 09d: 소나기 (shower rain)
|
|
43
|
+
* - 10d: 비 (rain)
|
|
44
|
+
* - 11d: 천둥번개 (thunderstorm)
|
|
45
|
+
* - 13d: 눈 (snow)
|
|
46
|
+
* - 50d: 안개 (mist)
|
|
47
|
+
*/
|
|
48
|
+
icon: string;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 측정값
|
|
53
|
+
* - 온도: 섭씨온도 (°C)
|
|
54
|
+
* - 습도: 백분율 (%)
|
|
55
|
+
* - 기압: hPa
|
|
56
|
+
*/
|
|
57
|
+
export type OWM_Res_Weather_Degrees = {
|
|
58
|
+
/**
|
|
59
|
+
* 현재 온도 (°C)
|
|
60
|
+
*/
|
|
61
|
+
temp: number;
|
|
62
|
+
/**
|
|
63
|
+
* 체감 온도 (°C)
|
|
64
|
+
*/
|
|
65
|
+
feels_like: number;
|
|
66
|
+
/**
|
|
67
|
+
* 최저 온도 (°C)
|
|
68
|
+
*/
|
|
69
|
+
temp_min: number;
|
|
70
|
+
/**
|
|
71
|
+
* 최고 온도 (°C)
|
|
72
|
+
*/
|
|
73
|
+
temp_max: number;
|
|
74
|
+
/**
|
|
75
|
+
* 해면기압 (hPa)
|
|
76
|
+
*/
|
|
77
|
+
pressure: number;
|
|
78
|
+
/**
|
|
79
|
+
* 습도 (%)
|
|
80
|
+
*/
|
|
81
|
+
humidity: number;
|
|
82
|
+
/**
|
|
83
|
+
* 해면기압 (hPa)
|
|
84
|
+
*/
|
|
85
|
+
sea_level: number;
|
|
86
|
+
/**
|
|
87
|
+
* 현지기압 (hPa)
|
|
88
|
+
*/
|
|
89
|
+
grnd_level: number;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export type OWM_Res_Wind = {
|
|
93
|
+
/**
|
|
94
|
+
* 풍속 (m/s)
|
|
95
|
+
*/
|
|
96
|
+
speed: number;
|
|
97
|
+
/**
|
|
98
|
+
* 풍향 (deg)
|
|
99
|
+
* - 0: 북쪽
|
|
100
|
+
* - 90: 동쪽
|
|
101
|
+
* - 180: 남쪽
|
|
102
|
+
* - 270: 서쪽
|
|
103
|
+
*/
|
|
104
|
+
deg: number;
|
|
105
|
+
/**
|
|
106
|
+
* 돌풍 (m/s)
|
|
107
|
+
*/
|
|
108
|
+
gust: number;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export type OWM_Res_Clouds = {
|
|
112
|
+
/**
|
|
113
|
+
* 구름량 (0-100, %)
|
|
114
|
+
*/
|
|
115
|
+
all: number;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export type OWM_Res_Sun = {
|
|
119
|
+
country: string; // 국가 코드 "KR";
|
|
120
|
+
sunrise: number; // 일출 timestamp 1748290711;
|
|
121
|
+
sunset: number; // 일몰 timestamp 1748342383;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* OpenWeatherMap API 응답; 현재 날씨
|
|
126
|
+
* @see https://openweathermap.org/current
|
|
127
|
+
*/
|
|
128
|
+
export type OWM_Res_Weather_Now = {
|
|
129
|
+
/**
|
|
130
|
+
* 위/경도 좌표
|
|
131
|
+
*/
|
|
132
|
+
coord: OWM_Res_Coord;
|
|
133
|
+
/**
|
|
134
|
+
* 개황 정보
|
|
135
|
+
*/
|
|
136
|
+
weather: OWM_Res_Condition[];
|
|
137
|
+
base: string; // Internal parameter?? "stations";
|
|
138
|
+
/**
|
|
139
|
+
* 측정 정보
|
|
140
|
+
*/
|
|
141
|
+
main: OWM_Res_Weather_Degrees;
|
|
142
|
+
/**
|
|
143
|
+
* 시정거리 (m)
|
|
144
|
+
*/
|
|
145
|
+
visibility: number;
|
|
146
|
+
/**
|
|
147
|
+
* 바람 정보
|
|
148
|
+
*/
|
|
149
|
+
wind: OWM_Res_Wind;
|
|
150
|
+
/**
|
|
151
|
+
* 구름량 정보
|
|
152
|
+
*/
|
|
153
|
+
clouds: OWM_Res_Clouds;
|
|
154
|
+
/**
|
|
155
|
+
* 데이터 연산 시간 timestamp (UTC, sec)
|
|
156
|
+
*/
|
|
157
|
+
dt: number;
|
|
158
|
+
/**
|
|
159
|
+
* 일출/일몰 정보
|
|
160
|
+
*/
|
|
161
|
+
sys: OWM_Res_Sun;
|
|
162
|
+
/**
|
|
163
|
+
* UTC로부터 현지 시간 보정 (sec)
|
|
164
|
+
* - 한국 : 9시간 (3600 * 9 = 32400)
|
|
165
|
+
*/
|
|
166
|
+
timezone: number;
|
|
167
|
+
/**
|
|
168
|
+
* 도시 ID
|
|
169
|
+
* @deprecated
|
|
170
|
+
*/
|
|
171
|
+
id: number;
|
|
172
|
+
/**
|
|
173
|
+
* 도시 이름
|
|
174
|
+
* @deprecated
|
|
175
|
+
*/
|
|
176
|
+
name: number;
|
|
177
|
+
/**
|
|
178
|
+
* API 응답 정보
|
|
179
|
+
*/
|
|
180
|
+
cod: number; // Internal parameter
|
|
181
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useQuery, type UseQueryResult } from "@tanstack/react-query";
|
|
4
|
+
import { getQueryString } from "@uniai-fe/util-functions";
|
|
5
|
+
import type {
|
|
6
|
+
API_Req_WeatherKorea,
|
|
7
|
+
API_Req_WeatherKoreaAlert,
|
|
8
|
+
API_Res_WeatherKoreaAlert,
|
|
9
|
+
API_Res_WeatherKoreaForecast,
|
|
10
|
+
API_Res_WeatherKoreaNow,
|
|
11
|
+
} from "../../../types";
|
|
12
|
+
import { isValidGridCoordinate } from "../../utils/validate";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 기상청 API; 현재날씨 fetch
|
|
16
|
+
* @method GET
|
|
17
|
+
* @param {API_Req_WeatherKorea} params - API 요청 파라미터
|
|
18
|
+
* @param {number} params.nx - X 좌표
|
|
19
|
+
* @param {number} params.ny - Y 좌표
|
|
20
|
+
* @param {string} [params.base_date] - 기준 날짜
|
|
21
|
+
* @param {string} [params.base_time] - 기준 시간
|
|
22
|
+
*/
|
|
23
|
+
export const getWeatherKoreaNow = async (params: API_Req_WeatherKorea) =>
|
|
24
|
+
await (await fetch(`/api/weather/korea/now${getQueryString(params)}`)).json();
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 기상청 API; 내일/모레 예보 fetch
|
|
28
|
+
* @method GET
|
|
29
|
+
* @param {API_Req_WeatherKorea} params - API 요청 파라미터
|
|
30
|
+
* @param {number} params.nx - X 좌표
|
|
31
|
+
* @param {string} params.ny - Y 좌표
|
|
32
|
+
* @param {string} [params.base_date] - 기준 날짜
|
|
33
|
+
* @param {string} [params.base_time] - 기준 시간
|
|
34
|
+
*/
|
|
35
|
+
export const getWeatherKoreaForecast = async (params: API_Req_WeatherKorea) =>
|
|
36
|
+
await (
|
|
37
|
+
await fetch(`/api/weather/korea/forecast${getQueryString(params)}`)
|
|
38
|
+
).json();
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 기상청 API; 특보 fetch
|
|
42
|
+
* @method GET
|
|
43
|
+
* @param {API_Req_WeatherKoreaAlert} params - API 요청 파라미터
|
|
44
|
+
* @param {number} params.farm_idx - 농장 ID
|
|
45
|
+
*/
|
|
46
|
+
export const getWeatherKoreaAlert = async (params: API_Req_WeatherKoreaAlert) =>
|
|
47
|
+
await (
|
|
48
|
+
await fetch(`/api/weather/korea/alert${getQueryString(params)}`)
|
|
49
|
+
).json();
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 기상청 API; 현재 날씨 react query
|
|
53
|
+
* @method GET
|
|
54
|
+
*/
|
|
55
|
+
export const useQueryWeatherKoreaNow = (
|
|
56
|
+
params: API_Req_WeatherKorea,
|
|
57
|
+
): UseQueryResult<API_Res_WeatherKoreaNow> =>
|
|
58
|
+
useQuery({
|
|
59
|
+
queryKey: ["weather_korea_now", ...Object.values(params)],
|
|
60
|
+
queryFn: () => getWeatherKoreaNow(params),
|
|
61
|
+
enabled: isValidGridCoordinate({ nx: params.nx, ny: params.ny }),
|
|
62
|
+
staleTime: 10 * 60 * 1000, // 10분
|
|
63
|
+
refetchInterval: 5 * 60 * 1000, // 5분
|
|
64
|
+
refetchOnWindowFocus: true,
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* 기상청 API; 내일/모레 예보 react query
|
|
69
|
+
* @method GET
|
|
70
|
+
*/
|
|
71
|
+
export const useQueryWeatherKoreaForecast = (
|
|
72
|
+
params: API_Req_WeatherKorea,
|
|
73
|
+
): UseQueryResult<API_Res_WeatherKoreaForecast> =>
|
|
74
|
+
useQuery({
|
|
75
|
+
queryKey: ["weather_korea_forecast", ...Object.values(params)],
|
|
76
|
+
queryFn: () => getWeatherKoreaForecast(params),
|
|
77
|
+
enabled: isValidGridCoordinate({ nx: params.nx, ny: params.ny }),
|
|
78
|
+
staleTime: 30 * 60 * 1000, // 30분
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 기상청 API; 특보 react query
|
|
83
|
+
* @method GET
|
|
84
|
+
*/
|
|
85
|
+
export const useQueryWeatherKoreaAlert = (
|
|
86
|
+
params: API_Req_WeatherKoreaAlert,
|
|
87
|
+
): UseQueryResult<API_Res_WeatherKoreaAlert> =>
|
|
88
|
+
useQuery({
|
|
89
|
+
queryKey: ["weather_korea_alert", ...Object.values(params)],
|
|
90
|
+
queryFn: () => getWeatherKoreaAlert(params),
|
|
91
|
+
enabled: typeof params.farm_idx === "number" && params.farm_idx > 0,
|
|
92
|
+
staleTime: 60 * 60 * 1000, // 1시간
|
|
93
|
+
});
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
|
|
3
|
+
import { setDebugResponseHeaders } from "@uniai-fe/util-next";
|
|
4
|
+
import type {
|
|
5
|
+
API_Res_WeatherKoreaAlert,
|
|
6
|
+
API_Res_WeatherKoreaForecast,
|
|
7
|
+
API_Res_WeatherKoreaNextDays,
|
|
8
|
+
API_Res_WeatherKoreaNow,
|
|
9
|
+
API_Res_WeatherKoreaToday,
|
|
10
|
+
KMA_Req_Weather,
|
|
11
|
+
KMA_Res_WeatherForecast,
|
|
12
|
+
KMA_Res_WeatherNow,
|
|
13
|
+
} from "../../../types";
|
|
14
|
+
import WEATHER_KOREA_RESPONSE from "../../data/response";
|
|
15
|
+
import { getWeatherBaseMoments } from "../../utils/date-time";
|
|
16
|
+
import { extractWeatherSummary } from "../../utils";
|
|
17
|
+
import type { NextResponse } from "next/server";
|
|
18
|
+
import {
|
|
19
|
+
generateBackendQueryUrl_GET,
|
|
20
|
+
nextAPILog,
|
|
21
|
+
} from "@uniai-fe/util-functions";
|
|
22
|
+
|
|
23
|
+
// const { generateBackendQueryUrl_GET } = weatherApi;
|
|
24
|
+
// const weatherLog = weatherApi.logger;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 기상청 API; base URL
|
|
28
|
+
* "본 저작물은 기상청에서 'OO년'작성하여 공공누리 제1유형으로 개방한 '저작물명(작성자:OOO)'을 이용하였으며, 해당 저작물은 '기상청 API허브(apihub.kma.go.kr)에서 무료로 다운받으실 수 있습니다."
|
|
29
|
+
*/
|
|
30
|
+
const API_BASE_PATH = "/typ02/openApi/VilageFcstInfoService_2.0";
|
|
31
|
+
/**
|
|
32
|
+
* 기상청 API; 날씨정보 URL
|
|
33
|
+
*/
|
|
34
|
+
const API_WEATHER = API_BASE_PATH;
|
|
35
|
+
|
|
36
|
+
const QUERY_URL = {
|
|
37
|
+
forecast: `${API_WEATHER}/getVilageFcst`,
|
|
38
|
+
now: `${API_WEATHER}/getUltraSrtFcst`,
|
|
39
|
+
alert: `/avic/weather-alert`,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const { API_RES_RAW, API_RES_BASE } = WEATHER_KOREA_RESPONSE;
|
|
43
|
+
|
|
44
|
+
const getWeatherParams = ({
|
|
45
|
+
authKey,
|
|
46
|
+
category,
|
|
47
|
+
searchParams,
|
|
48
|
+
}: {
|
|
49
|
+
authKey: string;
|
|
50
|
+
category: "now" | "forecast";
|
|
51
|
+
searchParams: URLSearchParams;
|
|
52
|
+
}): KMA_Req_Weather => {
|
|
53
|
+
const { base_date, base_time } = getWeatherBaseMoments(category);
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
pageNo: "1",
|
|
57
|
+
numOfRows: "1000",
|
|
58
|
+
authKey,
|
|
59
|
+
base_date,
|
|
60
|
+
base_time,
|
|
61
|
+
dataType: "JSON",
|
|
62
|
+
nx: 0,
|
|
63
|
+
ny: 0,
|
|
64
|
+
...Object.fromEntries(searchParams.entries()),
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 기상청 API; 현재 날씨
|
|
70
|
+
* @method GET
|
|
71
|
+
*/
|
|
72
|
+
export const routeWeatherKoreaNow = async ({
|
|
73
|
+
domain,
|
|
74
|
+
authKey,
|
|
75
|
+
routeUrl,
|
|
76
|
+
searchParams,
|
|
77
|
+
}: {
|
|
78
|
+
domain: string;
|
|
79
|
+
authKey: string;
|
|
80
|
+
routeUrl: string;
|
|
81
|
+
searchParams: URLSearchParams;
|
|
82
|
+
}): Promise<API_Res_WeatherKoreaNow> => {
|
|
83
|
+
const NOW_DATA: API_Res_WeatherKoreaToday = {
|
|
84
|
+
...API_RES_BASE,
|
|
85
|
+
temperature: null,
|
|
86
|
+
humidity: null,
|
|
87
|
+
};
|
|
88
|
+
const resDefault: API_Res_WeatherKoreaNow = {
|
|
89
|
+
raw: API_RES_RAW as KMA_Res_WeatherNow,
|
|
90
|
+
today: NOW_DATA,
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
if (!authKey) {
|
|
94
|
+
nextAPILog("GET", routeUrl, "기상청 현재날씨 API", {
|
|
95
|
+
error: "API Key를 확인하세요.",
|
|
96
|
+
});
|
|
97
|
+
return resDefault;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const queryParams = Object.fromEntries(
|
|
101
|
+
Object.entries(
|
|
102
|
+
getWeatherParams({ authKey, category: "now", searchParams }),
|
|
103
|
+
).map(([key, value]) => [key, String(value)]),
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
// 요청 URL 구성
|
|
107
|
+
const url = generateBackendQueryUrl_GET({
|
|
108
|
+
domain,
|
|
109
|
+
routeUrl,
|
|
110
|
+
queryUrl: QUERY_URL.now,
|
|
111
|
+
searchParams: new URLSearchParams(queryParams),
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// nextAPILog("GET", routeUrl, url, { searchParams, queryParams });
|
|
115
|
+
|
|
116
|
+
try {
|
|
117
|
+
const res: KMA_Res_WeatherNow = await (await fetch(url)).json();
|
|
118
|
+
resDefault.raw = res;
|
|
119
|
+
return extractWeatherSummary.now(resDefault, res);
|
|
120
|
+
} catch (error) {
|
|
121
|
+
nextAPILog("GET", routeUrl, url, { error });
|
|
122
|
+
|
|
123
|
+
return resDefault;
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* 기상청 API; 내일, 모래 예보
|
|
129
|
+
* @method GET
|
|
130
|
+
*/
|
|
131
|
+
export const routeWeatherKoreaForecast = async ({
|
|
132
|
+
domain,
|
|
133
|
+
authKey,
|
|
134
|
+
routeUrl,
|
|
135
|
+
searchParams,
|
|
136
|
+
}: {
|
|
137
|
+
domain: string;
|
|
138
|
+
authKey: string;
|
|
139
|
+
routeUrl: string;
|
|
140
|
+
searchParams: URLSearchParams;
|
|
141
|
+
}): Promise<API_Res_WeatherKoreaForecast> => {
|
|
142
|
+
const FORECAST_DATA: API_Res_WeatherKoreaNextDays = {
|
|
143
|
+
...API_RES_BASE,
|
|
144
|
+
max_temperature: null,
|
|
145
|
+
min_temperature: null,
|
|
146
|
+
};
|
|
147
|
+
const resDefault: API_Res_WeatherKoreaForecast = {
|
|
148
|
+
raw: API_RES_RAW as KMA_Res_WeatherForecast,
|
|
149
|
+
today: { ...API_RES_BASE, temperature: null, humidity: null },
|
|
150
|
+
day_1: FORECAST_DATA,
|
|
151
|
+
day_2: FORECAST_DATA,
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
if (!authKey) {
|
|
155
|
+
nextAPILog("GET", routeUrl, "기상청 예보날씨 API", {
|
|
156
|
+
error: "API Key를 확인하세요.",
|
|
157
|
+
});
|
|
158
|
+
return resDefault;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const queryParams = Object.fromEntries(
|
|
162
|
+
Object.entries(
|
|
163
|
+
getWeatherParams({ authKey, category: "forecast", searchParams }),
|
|
164
|
+
).map(([key, value]) => [key, String(value)]),
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
// 요청 URL 구성
|
|
168
|
+
const url = generateBackendQueryUrl_GET({
|
|
169
|
+
domain,
|
|
170
|
+
routeUrl,
|
|
171
|
+
queryUrl: QUERY_URL.forecast,
|
|
172
|
+
searchParams: new URLSearchParams(queryParams),
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// nextAPILog("GET", routeUrl, url, { searchParams, queryParams });
|
|
176
|
+
|
|
177
|
+
try {
|
|
178
|
+
const res: KMA_Res_WeatherForecast = await (await fetch(url)).json();
|
|
179
|
+
resDefault.raw = res;
|
|
180
|
+
return extractWeatherSummary.forecast(resDefault, res);
|
|
181
|
+
} catch (error) {
|
|
182
|
+
nextAPILog("GET", routeUrl, url, { error });
|
|
183
|
+
|
|
184
|
+
return resDefault;
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* 기상청 API; 특보 - 구역코드 조회
|
|
190
|
+
*/
|
|
191
|
+
// export const getWeatherKoreaAlertRegionCodes = async ({
|
|
192
|
+
// routeUrl,
|
|
193
|
+
// searchParams,
|
|
194
|
+
// }: {
|
|
195
|
+
// routeUrl: string;
|
|
196
|
+
// searchParams: URLSearchParams;
|
|
197
|
+
// }) => {
|
|
198
|
+
// const params = new URLSearchParams({
|
|
199
|
+
// authKey,
|
|
200
|
+
// dataType: "JSON",
|
|
201
|
+
// pageNo: "1",
|
|
202
|
+
// numOfRows: "1000",
|
|
203
|
+
// korName: "",
|
|
204
|
+
// });
|
|
205
|
+
// const url = `${QUERY_URL.alert}?${params.toString()}`;
|
|
206
|
+
// nextAPILog("GET", routeUrl, url, { params, searchParams });
|
|
207
|
+
|
|
208
|
+
// const regions = await (await fetch(url)).json();
|
|
209
|
+
|
|
210
|
+
// return regions;
|
|
211
|
+
// };
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* 기상청 API; 특보
|
|
215
|
+
*/
|
|
216
|
+
export const routeWeatherKoreaAlert = async ({
|
|
217
|
+
domain,
|
|
218
|
+
routeUrl,
|
|
219
|
+
searchParams,
|
|
220
|
+
}: {
|
|
221
|
+
domain: string;
|
|
222
|
+
routeUrl: string;
|
|
223
|
+
searchParams: URLSearchParams;
|
|
224
|
+
}): Promise<NextResponse<API_Res_WeatherKoreaAlert>> => {
|
|
225
|
+
const params = new URLSearchParams({
|
|
226
|
+
// authKey,
|
|
227
|
+
// dataType: "JSON",
|
|
228
|
+
// reg: "",
|
|
229
|
+
// wrn: "",
|
|
230
|
+
// disp: "0",
|
|
231
|
+
// fe: "f",
|
|
232
|
+
// tm: "",
|
|
233
|
+
});
|
|
234
|
+
const url = generateBackendQueryUrl_GET({
|
|
235
|
+
domain,
|
|
236
|
+
routeUrl,
|
|
237
|
+
queryUrl: QUERY_URL.alert,
|
|
238
|
+
searchParams,
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
nextAPILog("GET", routeUrl, url, { params, searchParams });
|
|
242
|
+
const info = await (await fetch(url)).json();
|
|
243
|
+
|
|
244
|
+
return setDebugResponseHeaders<API_Res_WeatherKoreaAlert>({
|
|
245
|
+
res: info,
|
|
246
|
+
domain,
|
|
247
|
+
queryUrl: QUERY_URL.alert,
|
|
248
|
+
searchParams,
|
|
249
|
+
});
|
|
250
|
+
};
|