@things-factory/integration-weather 9.0.0-beta.40
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/CHANGELOG.md +8 -0
- package/README.md +0 -0
- package/dist-client/index.d.ts +0 -0
- package/dist-client/index.js +2 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-server/engine/connector/index.d.ts +1 -0
- package/dist-server/engine/connector/index.js +4 -0
- package/dist-server/engine/connector/index.js.map +1 -0
- package/dist-server/engine/connector/noaa-gps-adapter.d.ts +27 -0
- package/dist-server/engine/connector/noaa-gps-adapter.js +90 -0
- package/dist-server/engine/connector/noaa-gps-adapter.js.map +1 -0
- package/dist-server/engine/connector/open-meteo-adapter.d.ts +7 -0
- package/dist-server/engine/connector/open-meteo-adapter.js +46 -0
- package/dist-server/engine/connector/open-meteo-adapter.js.map +1 -0
- package/dist-server/engine/connector/open-weather-adapter.d.ts +14 -0
- package/dist-server/engine/connector/open-weather-adapter.js +31 -0
- package/dist-server/engine/connector/open-weather-adapter.js.map +1 -0
- package/dist-server/engine/connector/weather-api-connector.d.ts +27 -0
- package/dist-server/engine/connector/weather-api-connector.js +94 -0
- package/dist-server/engine/connector/weather-api-connector.js.map +1 -0
- package/dist-server/engine/index.d.ts +2 -0
- package/dist-server/engine/index.js +5 -0
- package/dist-server/engine/index.js.map +1 -0
- package/dist-server/engine/task/index.d.ts +2 -0
- package/dist-server/engine/task/index.js +5 -0
- package/dist-server/engine/task/index.js.map +1 -0
- package/dist-server/engine/task/weather-around-location.d.ts +1 -0
- package/dist-server/engine/task/weather-around-location.js +36 -0
- package/dist-server/engine/task/weather-around-location.js.map +1 -0
- package/dist-server/engine/task/weather-by-location.d.ts +1 -0
- package/dist-server/engine/task/weather-by-location.js +31 -0
- package/dist-server/engine/task/weather-by-location.js.map +1 -0
- package/dist-server/engine/types.d.ts +48 -0
- package/dist-server/engine/types.js +3 -0
- package/dist-server/engine/types.js.map +1 -0
- package/dist-server/index.d.ts +1 -0
- package/dist-server/index.js +4 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +32 -0
- package/things-factory.config.js +1 -0
- package/translations/en.json +7 -0
- package/translations/ja.json +7 -0
- package/translations/ko.json +7 -0
- package/translations/ms.json +7 -0
- package/translations/zh.json +7 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
6
|
+
and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
<!-- ## [Unreleased] -->
|
package/README.md
ADDED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../client/index.ts"],"names":[],"mappings":"","sourcesContent":[""]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../client/index.ts","../../../node_modules/@types/node/compatibility/disposable.d.ts","../../../node_modules/@types/node/compatibility/indexable.d.ts","../../../node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/@types/node/compatibility/index.d.ts","../../../node_modules/@types/node/globals.typedarray.d.ts","../../../node_modules/@types/node/buffer.buffer.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/file.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/undici-types/retry-handler.d.ts","../../../node_modules/undici-types/retry-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/util.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/eventsource.d.ts","../../../node_modules/undici-types/filereader.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/dom-events.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/sea.d.ts","../../../node_modules/@types/node/sqlite.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/@jest/expect-utils/build/index.d.ts","../../../node_modules/chalk/index.d.ts","../../../node_modules/@sinclair/typebox/typebox.d.ts","../../../node_modules/@jest/schemas/build/index.d.ts","../../../node_modules/pretty-format/build/index.d.ts","../../../node_modules/jest-diff/build/index.d.ts","../../../node_modules/jest-matcher-utils/build/index.d.ts","../../../node_modules/expect/build/index.d.ts","../../../node_modules/@types/jest/index.d.ts"],"fileIdsList":[[54,97],[54,97,150],[54,97,152,155],[54,94,97],[54,96,97],[97],[54,97,102,132],[54,97,98,103,109,110,117,129,140],[54,97,98,99,109,117],[49,50,51,54,97],[54,97,100,141],[54,97,101,102,110,118],[54,97,102,129,137],[54,97,103,105,109,117],[54,96,97,104],[54,97,105,106],[54,97,109],[54,97,107,109],[54,96,97,109],[54,97,109,110,111,129,140],[54,97,109,110,111,124,129,132],[54,92,97,145],[54,92,97,105,109,112,117,129,140],[54,97,109,110,112,113,117,129,137,140],[54,97,112,114,129,137,140],[52,53,54,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146],[54,97,109,115],[54,97,116,140],[54,97,105,109,117,129],[54,97,118],[54,97,119],[54,96,97,120],[54,94,95,96,97,98,99,100,101,102,103,104,105,106,107,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146],[54,97,122],[54,97,123],[54,97,109,124,125],[54,97,124,126,141,143],[54,97,109,129,130,132],[54,97,129,131],[54,97,129,130],[54,97,132],[54,97,133],[54,94,97,129],[54,97,109,135,136],[54,97,135,136],[54,97,102,117,129,137],[54,97,138],[54,97,117,139],[54,97,112,123,140],[54,97,102,141],[54,97,129,142],[54,97,116,143],[54,97,144],[54,97,102,109,111,120,129,140,143,145],[54,97,129,146],[54,97,148,154],[54,97,152],[54,97,149,153],[54,97,151],[54,64,68,97,140],[54,64,97,129,140],[54,59,97],[54,61,64,97,137,140],[54,97,117,137],[54,97,147],[54,59,97,147],[54,61,64,97,117,140],[54,56,57,60,63,97,109,129,140],[54,64,71,97],[54,56,62,97],[54,64,85,86,97],[54,60,64,97,132,140,147],[54,85,97,147],[54,58,59,97,147],[54,64,97],[54,58,59,60,61,62,63,64,65,66,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,86,87,88,89,90,91,97],[54,64,79,97],[54,64,71,72,97],[54,62,64,72,73,97],[54,63,97],[54,56,59,64,97],[54,64,68,72,73,97],[54,68,97],[54,62,64,67,97,140],[54,56,61,64,71,97],[54,97,129],[54,59,64,85,97,145,147]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"092c2bfe125ce69dbb1223c85d68d4d2397d7d8411867b5cc03cec902c233763","affectsGlobalScope":true,"impliedFormat":1},{"version":"07f073f19d67f74d732b1adea08e1dc66b1b58d77cb5b43931dee3d798a2fd53","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true,"impliedFormat":1},{"version":"030e350db2525514580ed054f712ffb22d273e6bc7eddc1bb7eda1e0ba5d395e","affectsGlobalScope":true,"impliedFormat":1},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"a79e62f1e20467e11a904399b8b18b18c0c6eea6b50c1168bf215356d5bebfaf","affectsGlobalScope":true,"impliedFormat":1},{"version":"8fa51737611c21ba3a5ac02c4e1535741d58bec67c9bdf94b1837a31c97a2263","affectsGlobalScope":true,"impliedFormat":1},{"version":"4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"d2bc987ae352271d0d615a420dcf98cc886aa16b87fb2b569358c1fe0ca0773d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4f0539c58717cbc8b73acb29f9e992ab5ff20adba5f9b57130691c7f9b186a4d","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"76103716ba397bbb61f9fa9c9090dca59f39f9047cb1352b2179c5d8e7f4e8d0","impliedFormat":1},{"version":"f9677e434b7a3b14f0a9367f9dfa1227dfe3ee661792d0085523c3191ae6a1a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"4314c7a11517e221f7296b46547dbc4df047115b182f544d072bdccffa57fc72","impliedFormat":1},{"version":"115971d64632ea4742b5b115fb64ed04bcaae2c3c342f13d9ba7e3f9ee39c4e7","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","impliedFormat":1},{"version":"9057f224b79846e3a95baf6dad2c8103278de2b0c5eebda23fc8188171ad2398","affectsGlobalScope":true,"impliedFormat":1},{"version":"19d5f8d3930e9f99aa2c36258bf95abbe5adf7e889e6181872d1cdba7c9a7dd5","impliedFormat":1},{"version":"e6f5a38687bebe43a4cef426b69d34373ef68be9a6b1538ec0a371e69f309354","impliedFormat":1},{"version":"a6bf63d17324010ca1fbf0389cab83f93389bb0b9a01dc8a346d092f65b3605f","impliedFormat":1},{"version":"e009777bef4b023a999b2e5b9a136ff2cde37dc3f77c744a02840f05b18be8ff","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true,"impliedFormat":1},{"version":"88bc59b32d0d5b4e5d9632ac38edea23454057e643684c3c0b94511296f2998c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ff5a53a58e756d2661b73ba60ffe274231a4432d21f7a2d0d9e4f6aa99f4283","impliedFormat":1},{"version":"1e289f30a48126935a5d408a91129a13a59c9b0f8c007a816f9f16ef821e144e","impliedFormat":1},{"version":"2ea254f944dfe131df1264d1fb96e4b1f7d110195b21f1f5dbb68fdd394e5518","impliedFormat":1},{"version":"5135bdd72cc05a8192bd2e92f0914d7fc43ee077d1293dc622a049b7035a0afb","impliedFormat":1},{"version":"4f80de3a11c0d2f1329a72e92c7416b2f7eab14f67e92cac63bb4e8d01c6edc8","impliedFormat":1},{"version":"6d386bc0d7f3afa1d401afc3e00ed6b09205a354a9795196caed937494a713e6","impliedFormat":1},{"version":"f579f267a2f4c2278cca2ec84613e95059368b503ce96586972d304e5e40125b","affectsGlobalScope":true,"impliedFormat":1},{"version":"23459c1915878a7c1e86e8bdb9c187cddd3aea105b8b1dfce512f093c969bc7e","impliedFormat":1},{"version":"b1b6ee0d012aeebe11d776a155d8979730440082797695fc8e2a5c326285678f","impliedFormat":1},{"version":"45875bcae57270aeb3ebc73a5e3fb4c7b9d91d6b045f107c1d8513c28ece71c0","impliedFormat":1},{"version":"1dc73f8854e5c4506131c4d95b3a6c24d0c80336d3758e95110f4c7b5cb16397","affectsGlobalScope":true,"impliedFormat":1},{"version":"5f6f1d54779d0b9ed152b0516b0958cd34889764c1190434bbf18e7a8bb884cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"c6b4e0a02545304935ecbf7de7a8e056a31bb50939b5b321c9d50a405b5a0bba","impliedFormat":1},{"version":"fab29e6d649aa074a6b91e3bdf2bff484934a46067f6ee97a30fcd9762ae2213","impliedFormat":1},{"version":"8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","impliedFormat":1},{"version":"e1120271ebbc9952fdc7b2dd3e145560e52e06956345e6fdf91d70ca4886464f","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"f7b1df115dbd1b8522cba4f404a9f4fdcd5169e2137129187ffeee9d287e4fd1","impliedFormat":1},{"version":"c878f74b6d10b267f6075c51ac1d8becd15b4aa6a58f79c0cfe3b24908357f60","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","impliedFormat":1},{"version":"fbf68fc8057932b1c30107ebc37420f8d8dc4bef1253c4c2f9e141886c0df5ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2754d8221d77c7b382096651925eb476f1066b3348da4b73fe71ced7801edada","impliedFormat":1},{"version":"993985beef40c7d113f6dd8f0ba26eed63028b691fbfeb6a5b63f26408dd2c6d","affectsGlobalScope":true,"impliedFormat":1},{"version":"bef91efa0baea5d0e0f0f27b574a8bc100ce62a6d7e70220a0d58af6acab5e89","affectsGlobalScope":true,"impliedFormat":1},{"version":"282fd2a1268a25345b830497b4b7bf5037a5e04f6a9c44c840cb605e19fea841","impliedFormat":1},{"version":"5360a27d3ebca11b224d7d3e38e3e2c63f8290cb1fcf6c3610401898f8e68bc3","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"7d6ff413e198d25639f9f01f16673e7df4e4bd2875a42455afd4ecc02ef156da","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb094bb347d7df3380299eb69836c2c8758626ecf45917577707c03cf816b6f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"f689c4237b70ae6be5f0e4180e8833f34ace40529d1acc0676ab8fb8f70457d7","impliedFormat":1},{"version":"b02784111b3fc9c38590cd4339ff8718f9329a6f4d3fd66e9744a1dcd1d7e191","impliedFormat":1},{"version":"ac5ed35e649cdd8143131964336ab9076937fa91802ec760b3ea63b59175c10a","impliedFormat":1},{"version":"52a8e7e8a1454b6d1b5ad428efae3870ffc56f2c02d923467f2940c454aa9aec","affectsGlobalScope":true,"impliedFormat":1},{"version":"78dc0513cc4f1642906b74dda42146bcbd9df7401717d6e89ea6d72d12ecb539","impliedFormat":1},{"version":"ad90122e1cb599b3bc06a11710eb5489101be678f2920f2322b0ac3e195af78d","impliedFormat":1},{"version":"cdcc132f207d097d7d3aa75615ab9a2e71d6a478162dde8b67f88ea19f3e54de","impliedFormat":1},{"version":"0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","impliedFormat":1},{"version":"c085e9aa62d1ae1375794c1fb927a445fa105fed891a7e24edbb1c3300f7384a","impliedFormat":1},{"version":"f315e1e65a1f80992f0509e84e4ae2df15ecd9ef73df975f7c98813b71e4c8da","impliedFormat":1},{"version":"5b9586e9b0b6322e5bfbd2c29bd3b8e21ab9d871f82346cb71020e3d84bae73e","impliedFormat":1},{"version":"3e70a7e67c2cb16f8cd49097360c0309fe9d1e3210ff9222e9dac1f8df9d4fb6","impliedFormat":1},{"version":"ab68d2a3e3e8767c3fba8f80de099a1cfc18c0de79e42cb02ae66e22dfe14a66","impliedFormat":1},{"version":"d96cc6598148bf1a98fb2e8dcf01c63a4b3558bdaec6ef35e087fd0562eb40ec","impliedFormat":1},{"version":"f8db4fea512ab759b2223b90ecbbe7dae919c02f8ce95ec03f7fb1cf757cfbeb","affectsGlobalScope":true,"impliedFormat":1}],"root":[48],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"importHelpers":true,"inlineSources":true,"module":99,"noEmitOnError":true,"noImplicitAny":false,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":true,"target":4,"useDefineForClassFields":false},"referencedMap":[[148,1],[151,2],[150,1],[156,3],[94,4],[95,4],[96,5],[54,6],[97,7],[98,8],[99,9],[49,1],[52,10],[50,1],[51,1],[100,11],[101,12],[102,13],[103,14],[104,15],[105,16],[106,16],[108,17],[107,18],[109,19],[110,20],[111,21],[93,22],[53,1],[112,23],[113,24],[114,25],[147,26],[115,27],[116,28],[117,29],[118,30],[119,31],[120,32],[121,33],[122,34],[123,35],[124,36],[125,36],[126,37],[127,1],[128,1],[129,38],[131,39],[130,40],[132,41],[133,42],[134,43],[135,44],[136,45],[137,46],[138,47],[139,48],[140,49],[141,50],[142,51],[143,52],[144,53],[145,54],[146,55],[55,1],[149,1],[155,56],[153,57],[154,58],[152,59],[46,1],[47,1],[8,1],[9,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[20,1],[21,1],[4,1],[22,1],[26,1],[23,1],[24,1],[25,1],[27,1],[28,1],[29,1],[5,1],[30,1],[31,1],[32,1],[33,1],[6,1],[37,1],[34,1],[35,1],[36,1],[38,1],[7,1],[39,1],[44,1],[45,1],[40,1],[41,1],[42,1],[43,1],[1,1],[71,60],[81,61],[70,60],[91,62],[62,63],[61,64],[90,65],[84,66],[89,67],[64,68],[78,69],[63,70],[87,71],[59,72],[58,65],[88,73],[60,74],[65,75],[66,1],[69,75],[56,1],[92,76],[82,77],[73,78],[74,79],[76,80],[72,81],[75,82],[85,65],[67,83],[68,84],[77,85],[57,86],[80,77],[79,75],[83,1],[86,87],[48,1]],"version":"5.8.2"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './weather-api-connector.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/engine/connector/index.ts"],"names":[],"mappings":";;AAAA,sCAAmC","sourcesContent":["import './weather-api-connector.js'\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { WeatherService, WeatherData, WeatherAround, Location } from '../types.js';
|
|
2
|
+
export declare class NoaaGfsService implements WeatherService {
|
|
3
|
+
private readonly baseUrl;
|
|
4
|
+
private url;
|
|
5
|
+
constructor(url?: string);
|
|
6
|
+
/**
|
|
7
|
+
* 특정 위치의 날씨 데이터를 가져온다.
|
|
8
|
+
* NOAA GFS는 Bounding Box 기반이므로, 중심 좌표를 포함하는 작은 영역을 요청하여 데이터를 가져온다.
|
|
9
|
+
*/
|
|
10
|
+
getWeatherByLocation(location: Location): Promise<WeatherData>;
|
|
11
|
+
/**
|
|
12
|
+
* 특정 위치를 중심으로 주변 반경 내의 날씨 데이터를 가져온다.
|
|
13
|
+
*/
|
|
14
|
+
getWeatherAroundLocation(location: Location, radius: number): Promise<WeatherAround>;
|
|
15
|
+
/**
|
|
16
|
+
* NOAA GFS 데이터는 GRIB2 포맷으로 제공되므로 JSON으로 변환하는 파싱 로직
|
|
17
|
+
*/
|
|
18
|
+
private parseNoaaGfsData;
|
|
19
|
+
/**
|
|
20
|
+
* NOAA GFS의 Bounding Box 기반 데이터를 변환하여 여러 개의 WeatherData로 반환
|
|
21
|
+
*/
|
|
22
|
+
private parseNoaaGfsGridData;
|
|
23
|
+
/**
|
|
24
|
+
* 중심 좌표를 기준으로 Bounding Box를 생성 (위도/경도 범위를 설정)
|
|
25
|
+
*/
|
|
26
|
+
private getBoundingBox;
|
|
27
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NoaaGfsService = void 0;
|
|
4
|
+
class NoaaGfsService {
|
|
5
|
+
constructor(url) {
|
|
6
|
+
this.baseUrl = 'https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl';
|
|
7
|
+
this.url = this.baseUrl;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 특정 위치의 날씨 데이터를 가져온다.
|
|
11
|
+
* NOAA GFS는 Bounding Box 기반이므로, 중심 좌표를 포함하는 작은 영역을 요청하여 데이터를 가져온다.
|
|
12
|
+
*/
|
|
13
|
+
async getWeatherByLocation(location) {
|
|
14
|
+
const boundingBox = this.getBoundingBox(location, 0.25); // 0.25° 범위로 작은 영역 요청
|
|
15
|
+
const url = `${this.baseUrl}?file=gfs.t00z.pgrb2.0p25.f000&var_TMP=on&var_UGRD=on&var_VGRD=on
|
|
16
|
+
&subregion=&leftlon=${boundingBox.leftLon}&rightlon=${boundingBox.rightLon}
|
|
17
|
+
&toplat=${boundingBox.topLat}&bottomlat=${boundingBox.bottomLat}&dir=/`;
|
|
18
|
+
const response = await fetch(url);
|
|
19
|
+
if (!response.ok)
|
|
20
|
+
throw new Error(`NOAA GFS API request failed: ${response.status}`);
|
|
21
|
+
const rawData = await response.text(); // NOAA GFS는 GRIB2 데이터로 반환됨 (JSON 변환 필요)
|
|
22
|
+
const parsedData = this.parseNoaaGfsData(rawData, location);
|
|
23
|
+
return parsedData;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 특정 위치를 중심으로 주변 반경 내의 날씨 데이터를 가져온다.
|
|
27
|
+
*/
|
|
28
|
+
async getWeatherAroundLocation(location, radius) {
|
|
29
|
+
const boundingBox = this.getBoundingBox(location, radius);
|
|
30
|
+
const url = `${this.baseUrl}?file=gfs.t00z.pgrb2.0p25.f000&var_TMP=on&var_UGRD=on&var_VGRD=on
|
|
31
|
+
&subregion=&leftlon=${boundingBox.leftLon}&rightlon=${boundingBox.rightLon}
|
|
32
|
+
&toplat=${boundingBox.topLat}&bottomlat=${boundingBox.bottomLat}&dir=/`;
|
|
33
|
+
const response = await fetch(url);
|
|
34
|
+
if (!response.ok)
|
|
35
|
+
throw new Error(`NOAA GFS API request failed: ${response.status}`);
|
|
36
|
+
const rawData = await response.text();
|
|
37
|
+
const weatherPoints = this.parseNoaaGfsGridData(rawData, boundingBox);
|
|
38
|
+
return { center: location, radius, weatherPoints };
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* NOAA GFS 데이터는 GRIB2 포맷으로 제공되므로 JSON으로 변환하는 파싱 로직
|
|
42
|
+
*/
|
|
43
|
+
parseNoaaGfsData(rawData, location) {
|
|
44
|
+
// 실제 GRIB2 → JSON 변환은 `grib2json` 또는 `noaa-gfs-parser` 같은 라이브러리 필요
|
|
45
|
+
const temperature = 15.0; // 임시값, 실제 변환 필요
|
|
46
|
+
const windSpeed = 5.0;
|
|
47
|
+
const windDirection = 180;
|
|
48
|
+
return {
|
|
49
|
+
location,
|
|
50
|
+
temperature: { current: temperature, unit: '°C' },
|
|
51
|
+
wind: { speed: windSpeed, unit: 'm/s', direction: windDirection },
|
|
52
|
+
humidity: 60, // NOAA GFS에서 상대습도 값 추출 필요
|
|
53
|
+
cloudCoverage: 30, // NOAA GFS에서 클라우드 커버리지 값 추출 필요
|
|
54
|
+
solarRadiation: null, // NOAA GFS는 직접적인 태양광량 값 제공 안 함
|
|
55
|
+
weatherDescription: 'N/A',
|
|
56
|
+
timestamp: new Date().toISOString()
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* NOAA GFS의 Bounding Box 기반 데이터를 변환하여 여러 개의 WeatherData로 반환
|
|
61
|
+
*/
|
|
62
|
+
parseNoaaGfsGridData(rawData, boundingBox) {
|
|
63
|
+
// NOAA 데이터 파싱 로직 필요 (여러 지점의 데이터를 WeatherData 리스트로 변환)
|
|
64
|
+
return [
|
|
65
|
+
{
|
|
66
|
+
location: { latitude: boundingBox.topLat, longitude: boundingBox.leftLon },
|
|
67
|
+
temperature: { current: 15.0, unit: '°C' },
|
|
68
|
+
wind: { speed: 5.0, unit: 'm/s', direction: 180 },
|
|
69
|
+
humidity: 60,
|
|
70
|
+
cloudCoverage: 30,
|
|
71
|
+
solarRadiation: null,
|
|
72
|
+
weatherDescription: 'N/A',
|
|
73
|
+
timestamp: new Date().toISOString()
|
|
74
|
+
}
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 중심 좌표를 기준으로 Bounding Box를 생성 (위도/경도 범위를 설정)
|
|
79
|
+
*/
|
|
80
|
+
getBoundingBox(location, range) {
|
|
81
|
+
return {
|
|
82
|
+
leftLon: location.longitude - range,
|
|
83
|
+
rightLon: location.longitude + range,
|
|
84
|
+
topLat: location.latitude + range,
|
|
85
|
+
bottomLat: location.latitude - range
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
exports.NoaaGfsService = NoaaGfsService;
|
|
90
|
+
//# sourceMappingURL=noaa-gps-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"noaa-gps-adapter.js","sourceRoot":"","sources":["../../../server/engine/connector/noaa-gps-adapter.ts"],"names":[],"mappings":"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","sourcesContent":["import { WeatherService, WeatherData, WeatherAround, Location } from '../types.js'\n\nexport class NoaaGfsService implements WeatherService {\n private readonly baseUrl = 'https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_0p25.pl'\n private url: string = this.baseUrl\n\n constructor(url?: string) {}\n\n /**\n * 특정 위치의 날씨 데이터를 가져온다.\n * NOAA GFS는 Bounding Box 기반이므로, 중심 좌표를 포함하는 작은 영역을 요청하여 데이터를 가져온다.\n */\n async getWeatherByLocation(location: Location): Promise<WeatherData> {\n const boundingBox = this.getBoundingBox(location, 0.25) // 0.25° 범위로 작은 영역 요청\n const url = `${this.baseUrl}?file=gfs.t00z.pgrb2.0p25.f000&var_TMP=on&var_UGRD=on&var_VGRD=on\n &subregion=&leftlon=${boundingBox.leftLon}&rightlon=${boundingBox.rightLon}\n &toplat=${boundingBox.topLat}&bottomlat=${boundingBox.bottomLat}&dir=/`\n\n const response = await fetch(url)\n if (!response.ok) throw new Error(`NOAA GFS API request failed: ${response.status}`)\n\n const rawData = await response.text() // NOAA GFS는 GRIB2 데이터로 반환됨 (JSON 변환 필요)\n const parsedData = this.parseNoaaGfsData(rawData, location)\n\n return parsedData\n }\n\n /**\n * 특정 위치를 중심으로 주변 반경 내의 날씨 데이터를 가져온다.\n */\n async getWeatherAroundLocation(location: Location, radius: number): Promise<WeatherAround> {\n const boundingBox = this.getBoundingBox(location, radius)\n const url = `${this.baseUrl}?file=gfs.t00z.pgrb2.0p25.f000&var_TMP=on&var_UGRD=on&var_VGRD=on\n &subregion=&leftlon=${boundingBox.leftLon}&rightlon=${boundingBox.rightLon}\n &toplat=${boundingBox.topLat}&bottomlat=${boundingBox.bottomLat}&dir=/`\n\n const response = await fetch(url)\n if (!response.ok) throw new Error(`NOAA GFS API request failed: ${response.status}`)\n\n const rawData = await response.text()\n const weatherPoints = this.parseNoaaGfsGridData(rawData, boundingBox)\n\n return { center: location, radius, weatherPoints }\n }\n\n /**\n * NOAA GFS 데이터는 GRIB2 포맷으로 제공되므로 JSON으로 변환하는 파싱 로직\n */\n private parseNoaaGfsData(rawData: string, location: Location): WeatherData {\n // 실제 GRIB2 → JSON 변환은 `grib2json` 또는 `noaa-gfs-parser` 같은 라이브러리 필요\n const temperature = 15.0 // 임시값, 실제 변환 필요\n const windSpeed = 5.0\n const windDirection = 180\n\n return {\n location,\n temperature: { current: temperature, unit: '°C' },\n wind: { speed: windSpeed, unit: 'm/s', direction: windDirection },\n humidity: 60, // NOAA GFS에서 상대습도 값 추출 필요\n cloudCoverage: 30, // NOAA GFS에서 클라우드 커버리지 값 추출 필요\n solarRadiation: null, // NOAA GFS는 직접적인 태양광량 값 제공 안 함\n weatherDescription: 'N/A',\n timestamp: new Date().toISOString()\n }\n }\n\n /**\n * NOAA GFS의 Bounding Box 기반 데이터를 변환하여 여러 개의 WeatherData로 반환\n */\n private parseNoaaGfsGridData(rawData: string, boundingBox: any): WeatherData[] {\n // NOAA 데이터 파싱 로직 필요 (여러 지점의 데이터를 WeatherData 리스트로 변환)\n return [\n {\n location: { latitude: boundingBox.topLat, longitude: boundingBox.leftLon },\n temperature: { current: 15.0, unit: '°C' },\n wind: { speed: 5.0, unit: 'm/s', direction: 180 },\n humidity: 60,\n cloudCoverage: 30,\n solarRadiation: null,\n weatherDescription: 'N/A',\n timestamp: new Date().toISOString()\n }\n ]\n }\n\n /**\n * 중심 좌표를 기준으로 Bounding Box를 생성 (위도/경도 범위를 설정)\n */\n private getBoundingBox(location: Location, range: number) {\n return {\n leftLon: location.longitude - range,\n rightLon: location.longitude + range,\n topLat: location.latitude + range,\n bottomLat: location.latitude - range\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { WeatherService, WeatherData, WeatherAround, Location } from '../types.js';
|
|
2
|
+
export declare class OpenMeteoService implements WeatherService {
|
|
3
|
+
private readonly baseUrl;
|
|
4
|
+
constructor(url?: string);
|
|
5
|
+
getWeatherByLocation(location: Location): Promise<WeatherData>;
|
|
6
|
+
getWeatherAroundLocation(location: Location, radius: number): Promise<WeatherAround>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OpenMeteoService = void 0;
|
|
4
|
+
class OpenMeteoService {
|
|
5
|
+
constructor(url) {
|
|
6
|
+
this.baseUrl = 'https://api.open-meteo.com/v1/forecast';
|
|
7
|
+
}
|
|
8
|
+
async getWeatherByLocation(location) {
|
|
9
|
+
const url = `${this.baseUrl}?latitude=${location.latitude}&longitude=${location.longitude}¤t=temperature_2m,windspeed_10m,cloudcover,relative_humidity_2m,shortwave_radiation&timezone=UTC`;
|
|
10
|
+
const response = await fetch(url);
|
|
11
|
+
if (!response.ok)
|
|
12
|
+
throw new Error(`OpenMeteo API request failed: ${response.status}`);
|
|
13
|
+
const data = await response.json();
|
|
14
|
+
return {
|
|
15
|
+
location,
|
|
16
|
+
temperature: { current: data.current.temperature_2m, unit: '°C' },
|
|
17
|
+
wind: { speed: data.current.windspeed_10m, unit: 'm/s', direction: null },
|
|
18
|
+
humidity: data.current.relative_humidity_2m,
|
|
19
|
+
cloudCoverage: data.current.cloudcover,
|
|
20
|
+
solarRadiation: data.current.shortwave_radiation,
|
|
21
|
+
weatherDescription: 'N/A',
|
|
22
|
+
timestamp: new Date().toISOString()
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
async getWeatherAroundLocation(location, radius) {
|
|
26
|
+
const gridSize = radius / 50; // 반경을 격자로 변환 (50km 단위)
|
|
27
|
+
const url = `${this.baseUrl}?latitude=${location.latitude}&longitude=${location.longitude}&grid=${gridSize}&hourly=temperature_2m,windspeed_10m,cloudcover,relative_humidity_2m,shortwave_radiation`;
|
|
28
|
+
const response = await fetch(url);
|
|
29
|
+
if (!response.ok)
|
|
30
|
+
throw new Error(`OpenMeteo API request failed: ${response.status}`);
|
|
31
|
+
const data = await response.json();
|
|
32
|
+
const weatherPoints = data.hourly.temperature_2m.map((temp, index) => ({
|
|
33
|
+
location: { latitude: location.latitude + index * gridSize, longitude: location.longitude },
|
|
34
|
+
temperature: { current: temp, unit: '°C' },
|
|
35
|
+
wind: { speed: data.hourly.windspeed_10m[index], unit: 'm/s', direction: null },
|
|
36
|
+
humidity: data.hourly.relative_humidity_2m[index],
|
|
37
|
+
cloudCoverage: data.hourly.cloudcover[index],
|
|
38
|
+
solarRadiation: data.hourly.shortwave_radiation[index],
|
|
39
|
+
weatherDescription: 'N/A',
|
|
40
|
+
timestamp: new Date().toISOString()
|
|
41
|
+
}));
|
|
42
|
+
return { center: location, radius, weatherPoints };
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.OpenMeteoService = OpenMeteoService;
|
|
46
|
+
//# sourceMappingURL=open-meteo-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-meteo-adapter.js","sourceRoot":"","sources":["../../../server/engine/connector/open-meteo-adapter.ts"],"names":[],"mappings":";;;AAEA,MAAa,gBAAgB;IAG3B,YAAY,GAAY;QAFP,YAAO,GAAG,wCAAwC,CAAA;IAExC,CAAC;IAE5B,KAAK,CAAC,oBAAoB,CAAC,QAAkB;QAC3C,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,aAAa,QAAQ,CAAC,QAAQ,cAAc,QAAQ,CAAC,SAAS,wGAAwG,CAAA;QAEjM,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;QACjC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;QAErF,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;QAElC,OAAO;YACL,QAAQ;YACR,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE;YACjE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE;YACzE,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,oBAAoB;YAC3C,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU;YACtC,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,mBAAmB;YAChD,kBAAkB,EAAE,KAAK;YACzB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACpC,CAAA;IACH,CAAC;IAED,KAAK,CAAC,wBAAwB,CAAC,QAAkB,EAAE,MAAc;QAC/D,MAAM,QAAQ,GAAG,MAAM,GAAG,EAAE,CAAA,CAAC,uBAAuB;QACpD,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,aAAa,QAAQ,CAAC,QAAQ,cAAc,QAAQ,CAAC,SAAS,SAAS,QAAQ,0FAA0F,CAAA;QAEpM,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;QACjC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;QAErF,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;QAClC,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;YACrE,QAAQ,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,GAAG,KAAK,GAAG,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,EAAE;YAC3F,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;YAC1C,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE;YAC/E,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,KAAK,CAAC;YACjD,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;YAC5C,cAAc,EAAE,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC;YACtD,kBAAkB,EAAE,KAAK;YACzB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACpC,CAAC,CAAC,CAAA;QAEH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,CAAA;IACpD,CAAC;CACF;AA9CD,4CA8CC","sourcesContent":["import { WeatherService, WeatherData, WeatherAround, Location } from '../types.js'\n\nexport class OpenMeteoService implements WeatherService {\n private readonly baseUrl = 'https://api.open-meteo.com/v1/forecast'\n\n constructor(url?: string) {}\n\n async getWeatherByLocation(location: Location): Promise<WeatherData> {\n const url = `${this.baseUrl}?latitude=${location.latitude}&longitude=${location.longitude}¤t=temperature_2m,windspeed_10m,cloudcover,relative_humidity_2m,shortwave_radiation&timezone=UTC`\n\n const response = await fetch(url)\n if (!response.ok) throw new Error(`OpenMeteo API request failed: ${response.status}`)\n\n const data = await response.json()\n\n return {\n location,\n temperature: { current: data.current.temperature_2m, unit: '°C' },\n wind: { speed: data.current.windspeed_10m, unit: 'm/s', direction: null },\n humidity: data.current.relative_humidity_2m,\n cloudCoverage: data.current.cloudcover,\n solarRadiation: data.current.shortwave_radiation,\n weatherDescription: 'N/A',\n timestamp: new Date().toISOString()\n }\n }\n\n async getWeatherAroundLocation(location: Location, radius: number): Promise<WeatherAround> {\n const gridSize = radius / 50 // 반경을 격자로 변환 (50km 단위)\n const url = `${this.baseUrl}?latitude=${location.latitude}&longitude=${location.longitude}&grid=${gridSize}&hourly=temperature_2m,windspeed_10m,cloudcover,relative_humidity_2m,shortwave_radiation`\n\n const response = await fetch(url)\n if (!response.ok) throw new Error(`OpenMeteo API request failed: ${response.status}`)\n\n const data = await response.json()\n const weatherPoints = data.hourly.temperature_2m.map((temp, index) => ({\n location: { latitude: location.latitude + index * gridSize, longitude: location.longitude },\n temperature: { current: temp, unit: '°C' },\n wind: { speed: data.hourly.windspeed_10m[index], unit: 'm/s', direction: null },\n humidity: data.hourly.relative_humidity_2m[index],\n cloudCoverage: data.hourly.cloudcover[index],\n solarRadiation: data.hourly.shortwave_radiation[index],\n weatherDescription: 'N/A',\n timestamp: new Date().toISOString()\n }))\n\n return { center: location, radius, weatherPoints }\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WeatherService, WeatherData, WeatherAround } from '../types.js';
|
|
2
|
+
export declare class OpenWeatherMapService implements WeatherService {
|
|
3
|
+
private readonly baseUrl;
|
|
4
|
+
private readonly apiKey;
|
|
5
|
+
constructor(apiKey: string, url?: string);
|
|
6
|
+
getWeatherByLocation({ latitude, longitude }: {
|
|
7
|
+
latitude: any;
|
|
8
|
+
longitude: any;
|
|
9
|
+
}): Promise<WeatherData>;
|
|
10
|
+
getWeatherAroundLocation({ latitude, longitude }: {
|
|
11
|
+
latitude: any;
|
|
12
|
+
longitude: any;
|
|
13
|
+
}, radius: number): Promise<WeatherAround>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OpenWeatherMapService = void 0;
|
|
4
|
+
class OpenWeatherMapService {
|
|
5
|
+
constructor(apiKey, url) {
|
|
6
|
+
this.baseUrl = 'https://api.openweathermap.org/data/2.5/weather';
|
|
7
|
+
this.apiKey = apiKey;
|
|
8
|
+
}
|
|
9
|
+
async getWeatherByLocation({ latitude, longitude }) {
|
|
10
|
+
const url = `${this.baseUrl}?lat=${latitude}&lon=${longitude}&appid=${this.apiKey}&units=metric`;
|
|
11
|
+
const response = await fetch(url);
|
|
12
|
+
if (!response.ok)
|
|
13
|
+
throw new Error(`OpenWeatherMap API request failed: ${response.status}`);
|
|
14
|
+
const data = await response.json();
|
|
15
|
+
return {
|
|
16
|
+
location: { latitude, longitude },
|
|
17
|
+
temperature: { current: data.main.temp, unit: '°C' },
|
|
18
|
+
wind: { speed: data.wind.speed, unit: 'm/s', direction: data.wind.deg },
|
|
19
|
+
humidity: data.main.humidity,
|
|
20
|
+
cloudCoverage: data.clouds.all,
|
|
21
|
+
solarRadiation: null,
|
|
22
|
+
weatherDescription: data.weather[0].description,
|
|
23
|
+
timestamp: new Date().toISOString()
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
async getWeatherAroundLocation({ latitude, longitude }, radius) {
|
|
27
|
+
throw new Error('OpenWeatherMap does not support grid-based requests.');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.OpenWeatherMapService = OpenWeatherMapService;
|
|
31
|
+
//# sourceMappingURL=open-weather-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-weather-adapter.js","sourceRoot":"","sources":["../../../server/engine/connector/open-weather-adapter.ts"],"names":[],"mappings":";;;AAEA,MAAa,qBAAqB;IAIhC,YAAY,MAAc,EAAE,GAAY;QAHvB,YAAO,GAAG,iDAAiD,CAAA;QAI1E,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE;QAChD,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,QAAQ,QAAQ,QAAQ,SAAS,UAAU,IAAI,CAAC,MAAM,eAAe,CAAA;QAEhG,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAA;QACjC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,sCAAsC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;QAE1F,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;QAElC,OAAO;YACL,QAAQ,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE;YACjC,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;YACpD,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YACvE,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ;YAC5B,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG;YAC9B,cAAc,EAAE,IAAI;YACpB,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW;YAC/C,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACpC,CAAA;IACH,CAAC;IAED,KAAK,CAAC,wBAAwB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,MAAc;QACpE,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAA;IACzE,CAAC;CACF;AA/BD,sDA+BC","sourcesContent":["import { WeatherService, WeatherData, WeatherAround, Location } from '../types.js'\n\nexport class OpenWeatherMapService implements WeatherService {\n private readonly baseUrl = 'https://api.openweathermap.org/data/2.5/weather'\n private readonly apiKey: string\n\n constructor(apiKey: string, url?: string) {\n this.apiKey = apiKey\n }\n\n async getWeatherByLocation({ latitude, longitude }): Promise<WeatherData> {\n const url = `${this.baseUrl}?lat=${latitude}&lon=${longitude}&appid=${this.apiKey}&units=metric`\n\n const response = await fetch(url)\n if (!response.ok) throw new Error(`OpenWeatherMap API request failed: ${response.status}`)\n\n const data = await response.json()\n\n return {\n location: { latitude, longitude },\n temperature: { current: data.main.temp, unit: '°C' },\n wind: { speed: data.wind.speed, unit: 'm/s', direction: data.wind.deg },\n humidity: data.main.humidity,\n cloudCoverage: data.clouds.all,\n solarRadiation: null,\n weatherDescription: data.weather[0].description,\n timestamp: new Date().toISOString()\n }\n }\n\n async getWeatherAroundLocation({ latitude, longitude }, radius: number): Promise<WeatherAround> {\n throw new Error('OpenWeatherMap does not support grid-based requests.')\n }\n}\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Connection, Connector } from '@things-factory/integration-base';
|
|
2
|
+
export declare class WeatherAPIConnector implements Connector {
|
|
3
|
+
ready(connectionConfigs: any): Promise<void>;
|
|
4
|
+
checkConnectionInstance(domain: any, connectionName: any): boolean;
|
|
5
|
+
connect(connection: any): Promise<void>;
|
|
6
|
+
disconnect(connection: Connection): Promise<void>;
|
|
7
|
+
get parameterSpec(): ({
|
|
8
|
+
type: string;
|
|
9
|
+
name: string;
|
|
10
|
+
label: string;
|
|
11
|
+
property: {
|
|
12
|
+
options: {
|
|
13
|
+
value: string;
|
|
14
|
+
display: string;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
optional?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
type: string;
|
|
20
|
+
name: string;
|
|
21
|
+
label: string;
|
|
22
|
+
optional: boolean;
|
|
23
|
+
property?: undefined;
|
|
24
|
+
})[];
|
|
25
|
+
get taskPrefixes(): string[];
|
|
26
|
+
get help(): string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WeatherAPIConnector = void 0;
|
|
4
|
+
const integration_base_1 = require("@things-factory/integration-base");
|
|
5
|
+
const open_meteo_adapter_js_1 = require("./open-meteo-adapter.js"); // OpenMeteo 구현체
|
|
6
|
+
const open_weather_adapter_js_1 = require("./open-weather-adapter.js"); // OpenWeatherMap 구현체
|
|
7
|
+
const noaa_gps_adapter_js_1 = require("./noaa-gps-adapter.js"); // NOAA GFS 구현체
|
|
8
|
+
class WeatherAPIConnector {
|
|
9
|
+
async ready(connectionConfigs) {
|
|
10
|
+
await Promise.all(connectionConfigs.map(this.connect.bind(this)));
|
|
11
|
+
integration_base_1.ConnectionManager.logger.info('Weather API connections are ready');
|
|
12
|
+
}
|
|
13
|
+
checkConnectionInstance(domain, connectionName) {
|
|
14
|
+
try {
|
|
15
|
+
const connection = integration_base_1.ConnectionManager.getConnectionInstanceByName(domain, connectionName);
|
|
16
|
+
return !!connection;
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
async connect(connection) {
|
|
23
|
+
const { params: { provider, apiKey } } = connection;
|
|
24
|
+
try {
|
|
25
|
+
let weatherService;
|
|
26
|
+
switch (provider) {
|
|
27
|
+
case 'open-meteo':
|
|
28
|
+
weatherService = new open_meteo_adapter_js_1.OpenMeteoService();
|
|
29
|
+
break;
|
|
30
|
+
case 'openweathermap':
|
|
31
|
+
if (!apiKey)
|
|
32
|
+
throw new Error(`API Key is required for OpenWeatherMap`);
|
|
33
|
+
weatherService = new open_weather_adapter_js_1.OpenWeatherMapService(apiKey);
|
|
34
|
+
break;
|
|
35
|
+
case 'noaa-gfs':
|
|
36
|
+
weatherService = new noaa_gps_adapter_js_1.NoaaGfsService();
|
|
37
|
+
break;
|
|
38
|
+
default:
|
|
39
|
+
throw new Error(`Unsupported weather provider: ${provider}`);
|
|
40
|
+
}
|
|
41
|
+
integration_base_1.ConnectionManager.addConnectionInstance(connection, weatherService);
|
|
42
|
+
integration_base_1.ConnectionManager.logger.info(`Weather API connection(${connection.name}) is connected with provider: ${provider}`);
|
|
43
|
+
}
|
|
44
|
+
catch (ex) {
|
|
45
|
+
integration_base_1.ConnectionManager.logger.error(`Weather API connection(${connection.name}) failed`, ex);
|
|
46
|
+
throw ex;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async disconnect(connection) {
|
|
50
|
+
integration_base_1.ConnectionManager.removeConnectionInstance(connection);
|
|
51
|
+
integration_base_1.ConnectionManager.logger.info(`Weather API connection(${connection.name}) is disconnected`);
|
|
52
|
+
}
|
|
53
|
+
get parameterSpec() {
|
|
54
|
+
return [
|
|
55
|
+
{
|
|
56
|
+
type: 'select',
|
|
57
|
+
name: 'provider',
|
|
58
|
+
label: 'label.api-provider',
|
|
59
|
+
property: {
|
|
60
|
+
options: [
|
|
61
|
+
{
|
|
62
|
+
value: 'open-meteo',
|
|
63
|
+
display: 'Open Meteo API'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
value: 'openweathermap',
|
|
67
|
+
display: 'Open Weather API'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
value: 'noaa-gfs',
|
|
71
|
+
display: 'NOAA GFS API'
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
type: 'string',
|
|
78
|
+
name: 'apiKey',
|
|
79
|
+
label: 'label.weather-apikey',
|
|
80
|
+
optional: true
|
|
81
|
+
}
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
get taskPrefixes() {
|
|
85
|
+
return ['weather'];
|
|
86
|
+
}
|
|
87
|
+
get help() {
|
|
88
|
+
return 'integration/connector/weather-api-connector';
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.WeatherAPIConnector = WeatherAPIConnector;
|
|
92
|
+
// 🏗️ 커넥터 등록
|
|
93
|
+
integration_base_1.ConnectionManager.registerConnector('weather-api-connector', new WeatherAPIConnector());
|
|
94
|
+
//# sourceMappingURL=weather-api-connector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weather-api-connector.js","sourceRoot":"","sources":["../../../server/engine/connector/weather-api-connector.ts"],"names":[],"mappings":"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","sourcesContent":["import { Connection, ConnectionManager, Connector } from '@things-factory/integration-base'\nimport { WeatherService } from '../types.js' // WeatherService 인터페이스\nimport { OpenMeteoService } from './open-meteo-adapter.js' // OpenMeteo 구현체\nimport { OpenWeatherMapService } from './open-weather-adapter.js' // OpenWeatherMap 구현체\nimport { NoaaGfsService } from './noaa-gps-adapter.js' // NOAA GFS 구현체\n\nexport class WeatherAPIConnector implements Connector {\n async ready(connectionConfigs) {\n await Promise.all(connectionConfigs.map(this.connect.bind(this)))\n ConnectionManager.logger.info('Weather API connections are ready')\n }\n\n checkConnectionInstance(domain, connectionName): boolean {\n try {\n const connection = ConnectionManager.getConnectionInstanceByName(domain, connectionName)\n return !!connection\n } catch (e) {\n return false\n }\n }\n\n async connect(connection) {\n const {\n params: { provider, apiKey }\n } = connection\n\n try {\n let weatherService: WeatherService\n\n switch (provider) {\n case 'open-meteo':\n weatherService = new OpenMeteoService()\n break\n case 'openweathermap':\n if (!apiKey) throw new Error(`API Key is required for OpenWeatherMap`)\n weatherService = new OpenWeatherMapService(apiKey)\n break\n case 'noaa-gfs':\n weatherService = new NoaaGfsService()\n break\n default:\n throw new Error(`Unsupported weather provider: ${provider}`)\n }\n\n ConnectionManager.addConnectionInstance(connection, weatherService)\n ConnectionManager.logger.info(\n `Weather API connection(${connection.name}) is connected with provider: ${provider}`\n )\n } catch (ex) {\n ConnectionManager.logger.error(`Weather API connection(${connection.name}) failed`, ex)\n throw ex\n }\n }\n\n async disconnect(connection: Connection) {\n ConnectionManager.removeConnectionInstance(connection)\n ConnectionManager.logger.info(`Weather API connection(${connection.name}) is disconnected`)\n }\n\n get parameterSpec() {\n return [\n {\n type: 'select',\n name: 'provider',\n label: 'label.api-provider',\n property: {\n options: [\n {\n value: 'open-meteo',\n display: 'Open Meteo API'\n },\n {\n value: 'openweathermap',\n display: 'Open Weather API'\n },\n {\n value: 'noaa-gfs',\n display: 'NOAA GFS API'\n }\n ]\n }\n },\n {\n type: 'string',\n name: 'apiKey',\n label: 'label.weather-apikey',\n optional: true\n }\n ]\n }\n\n get taskPrefixes() {\n return ['weather']\n }\n\n get help() {\n return 'integration/connector/weather-api-connector'\n }\n}\n\n// 🏗️ 커넥터 등록\nConnectionManager.registerConnector('weather-api-connector', new WeatherAPIConnector())\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/engine/index.ts"],"names":[],"mappings":";;AAAA,gCAA6B;AAC7B,2BAAwB","sourcesContent":["import './connector/index.js'\nimport './task/index.js'\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/engine/task/index.ts"],"names":[],"mappings":";;AAAA,oCAAiC;AACjC,wCAAqC","sourcesContent":["import './weather-by-location.js'\nimport './weather-around-location.js'\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const integration_base_1 = require("@things-factory/integration-base");
|
|
4
|
+
const debug = require('debug')('things-factory:weather-around-location');
|
|
5
|
+
async function weatherAroundLocation(step, { domain, user, data, variables, lng }) {
|
|
6
|
+
const { connection, params: { latitude, longitude, radius } } = step;
|
|
7
|
+
const client = integration_base_1.ConnectionManager.getConnectionInstanceByName(domain, connection);
|
|
8
|
+
if (!client) {
|
|
9
|
+
debug(`no connection : ${connection}`);
|
|
10
|
+
throw new Error(`no connection : ${connection}`);
|
|
11
|
+
}
|
|
12
|
+
const result = await client.getWeatherAroundLocation({ latitude, longitude }, radius);
|
|
13
|
+
return {
|
|
14
|
+
data: result
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
weatherAroundLocation.parameterSpec = [
|
|
18
|
+
{
|
|
19
|
+
type: 'number',
|
|
20
|
+
name: 'latitude',
|
|
21
|
+
label: 'label.latitude'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: 'number',
|
|
25
|
+
name: 'longitude',
|
|
26
|
+
label: 'label.longitude'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: 'number',
|
|
30
|
+
name: 'radius',
|
|
31
|
+
label: 'label.location-radius'
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
weatherAroundLocation.help = 'integration/task/weather-around-location';
|
|
35
|
+
integration_base_1.TaskRegistry.registerTaskHandler('weather-around-location', weatherAroundLocation);
|
|
36
|
+
//# sourceMappingURL=weather-around-location.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weather-around-location.js","sourceRoot":"","sources":["../../../server/engine/task/weather-around-location.ts"],"names":[],"mappings":";;AAAA,uEAA2F;AAI3F,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,wCAAwC,CAAC,CAAA;AAExE,KAAK,UAAU,qBAAqB,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAW;IACxF,MAAM,EACJ,UAAU,EACV,MAAM,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,EACxC,GAAG,IAAI,CAAA;IAER,MAAM,MAAM,GAAmB,oCAAiB,CAAC,2BAA2B,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAChG,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,KAAK,CAAC,mBAAmB,UAAU,EAAE,CAAC,CAAA;QACtC,MAAM,IAAI,KAAK,CAAC,mBAAmB,UAAU,EAAE,CAAC,CAAA;IAClD,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,MAAM,CAAC,CAAA;IAErF,OAAO;QACL,IAAI,EAAE,MAAM;KACb,CAAA;AACH,CAAC;AAED,qBAAqB,CAAC,aAAa,GAAG;IACpC;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,gBAAgB;KACxB;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,WAAW;QACjB,KAAK,EAAE,iBAAiB;KACzB;IACD;QACE,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,uBAAuB;KAC/B;CACF,CAAA;AAED,qBAAqB,CAAC,IAAI,GAAG,0CAA0C,CAAA;AAEvE,+BAAY,CAAC,mBAAmB,CAAC,yBAAyB,EAAE,qBAAqB,CAAC,CAAA","sourcesContent":["import { ConnectionManager, Context, TaskRegistry } from '@things-factory/integration-base'\n\nimport { WeatherService } from '../types.js'\n\nconst debug = require('debug')('things-factory:weather-around-location')\n\nasync function weatherAroundLocation(step, { domain, user, data, variables, lng }: Context) {\n const {\n connection,\n params: { latitude, longitude, radius }\n } = step\n\n const client: WeatherService = ConnectionManager.getConnectionInstanceByName(domain, connection)\n if (!client) {\n debug(`no connection : ${connection}`)\n throw new Error(`no connection : ${connection}`)\n }\n\n const result = await client.getWeatherAroundLocation({ latitude, longitude }, radius)\n\n return {\n data: result\n }\n}\n\nweatherAroundLocation.parameterSpec = [\n {\n type: 'number',\n name: 'latitude',\n label: 'label.latitude'\n },\n {\n type: 'number',\n name: 'longitude',\n label: 'label.longitude'\n },\n {\n type: 'number',\n name: 'radius',\n label: 'label.location-radius'\n }\n]\n\nweatherAroundLocation.help = 'integration/task/weather-around-location'\n\nTaskRegistry.registerTaskHandler('weather-around-location', weatherAroundLocation)\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|