@puppi/adapter-open-meteo 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +26 -2
- package/dist/define.d.ts +18 -0
- package/dist/define.d.ts.map +1 -0
- package/dist/define.js +12 -0
- package/dist/define.js.map +1 -0
- package/dist/index.d.ts +75 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +226 -0
- package/dist/index.js.map +1 -0
- package/dist/openapi.d.ts +183 -0
- package/dist/openapi.d.ts.map +1 -0
- package/dist/openapi.js +6 -0
- package/dist/openapi.js.map +1 -0
- package/dist/operations.d.ts +12 -0
- package/dist/operations.d.ts.map +1 -0
- package/dist/operations.js +19 -0
- package/dist/operations.js.map +1 -0
- package/package.json +48 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @puppi/adapter-open-meteo
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Source connector for Open-Meteo. No key. Three hosts, each a binding field with a default:
|
|
4
|
+
|
|
5
|
+
| Field | Default |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `base_url` | `https://api.open-meteo.com` |
|
|
8
|
+
| `geocoding_url` | `https://geocoding-api.open-meteo.com` |
|
|
9
|
+
| `archive_url` | `https://archive-api.open-meteo.com` |
|
|
10
|
+
|
|
11
|
+
`current(locations)` is current conditions. `daily(locations)` is a daily forecast. `archive(location, { start, end })` is historical daily values between two ISO dates. `geocode(name)` searches places. There is no secret. `check()` searches the geocoding host for Berlin.
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"open-meteo": {
|
|
16
|
+
"config": {}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
client.current([{ latitude: 52.5, longitude: 13.4 }], {
|
|
23
|
+
variables: ["temperature_2m", "weather_code", "wind_speed_10m"],
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Reference: <https://open-meteo.com/en/docs>
|
package/dist/define.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
readonly type: "open-meteo";
|
|
3
|
+
readonly docs: "https://open-meteo.com/en/docs";
|
|
4
|
+
readonly configSchema: {
|
|
5
|
+
readonly base_url: "string";
|
|
6
|
+
readonly geocoding_url: "string";
|
|
7
|
+
readonly archive_url: "string";
|
|
8
|
+
};
|
|
9
|
+
readonly secretFields: readonly [];
|
|
10
|
+
readonly auth: {
|
|
11
|
+
readonly scheme: "none";
|
|
12
|
+
};
|
|
13
|
+
readonly apiVersions: readonly ["unversioned"];
|
|
14
|
+
readonly defaultApiVersion: "unversioned";
|
|
15
|
+
readonly defaultBaseUrl: "https://api.open-meteo.com";
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
18
|
+
//# sourceMappingURL=define.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.d.ts","sourceRoot":"","sources":["../src/define.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,wBASG"}
|
package/dist/define.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineConnector } from "@puppi/sdk";
|
|
2
|
+
export default defineConnector({
|
|
3
|
+
type: "open-meteo",
|
|
4
|
+
docs: "https://open-meteo.com/en/docs",
|
|
5
|
+
configSchema: { base_url: "string", geocoding_url: "string", archive_url: "string" },
|
|
6
|
+
secretFields: [],
|
|
7
|
+
auth: { scheme: "none" },
|
|
8
|
+
apiVersions: ["unversioned"],
|
|
9
|
+
defaultApiVersion: "unversioned",
|
|
10
|
+
defaultBaseUrl: "https://api.open-meteo.com",
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=define.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.js","sourceRoot":"","sources":["../src/define.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,eAAe,eAAe,CAAC;IAC7B,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,gCAAgC;IACtC,YAAY,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE;IACpF,YAAY,EAAE,EAAE;IAChB,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;IACxB,WAAW,EAAE,CAAC,aAAa,CAAC;IAC5B,iBAAiB,EAAE,aAAa;IAChC,cAAc,EAAE,4BAA4B;CAC7C,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@puppi/adapter-open-meteo`: a source connector over https://open-meteo.com.
|
|
3
|
+
* No key; three hosts (forecast, geocoding, archive), each a binding field
|
|
4
|
+
* with a default. Archive and geocoding pass `base` on `read`.
|
|
5
|
+
*/
|
|
6
|
+
import { type CredentialCheck, type ClientOptions, OpenApiClient } from "@puppi/sdk";
|
|
7
|
+
import connector from "./define.js";
|
|
8
|
+
import type { SchemaPlace } from "./openapi.js";
|
|
9
|
+
import { type Api } from "./operations.js";
|
|
10
|
+
export type Place = SchemaPlace;
|
|
11
|
+
export default connector;
|
|
12
|
+
export declare const DEFAULT_GEOCODING_URL = "https://geocoding-api.open-meteo.com";
|
|
13
|
+
export declare const DEFAULT_ARCHIVE_URL = "https://archive-api.open-meteo.com";
|
|
14
|
+
export interface Location {
|
|
15
|
+
latitude: number;
|
|
16
|
+
longitude: number;
|
|
17
|
+
}
|
|
18
|
+
/** One location's current conditions: the variables asked for, by name. */
|
|
19
|
+
export interface Current extends Location {
|
|
20
|
+
timezone: string;
|
|
21
|
+
elevation: number;
|
|
22
|
+
/** ISO 8601, in the response timezone (UTC unless asked otherwise). */
|
|
23
|
+
time: string;
|
|
24
|
+
values: Record<string, number | null>;
|
|
25
|
+
units: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
/** One location's daily series: one row per day, the variables by name. */
|
|
28
|
+
export interface Daily extends Location {
|
|
29
|
+
timezone: string;
|
|
30
|
+
days: {
|
|
31
|
+
date: string;
|
|
32
|
+
values: Record<string, number | null>;
|
|
33
|
+
}[];
|
|
34
|
+
units: Record<string, string>;
|
|
35
|
+
}
|
|
36
|
+
export declare const DEFAULT_CURRENT: readonly ["temperature_2m", "relative_humidity_2m", "precipitation", "weather_code", "wind_speed_10m"];
|
|
37
|
+
export declare const DEFAULT_DAILY: readonly ["temperature_2m_max", "temperature_2m_min", "precipitation_sum"];
|
|
38
|
+
export declare class Client extends OpenApiClient<Api> {
|
|
39
|
+
private readonly geocodingBase;
|
|
40
|
+
private readonly archiveBase;
|
|
41
|
+
constructor(config: Record<string, unknown>, secrets?: Record<string, string>, options?: ClientOptions);
|
|
42
|
+
/** `GET` geocoding search for a known place proves a host answers. */
|
|
43
|
+
check(): Promise<CredentialCheck>;
|
|
44
|
+
/**
|
|
45
|
+
* Current conditions at each location, in the order given, batched into as
|
|
46
|
+
* few requests as the api allows. `onBatch` fires after each request with
|
|
47
|
+
* the rows so far, so a caller can checkpoint between batches.
|
|
48
|
+
*/
|
|
49
|
+
current(locations: Location[], options?: {
|
|
50
|
+
variables?: readonly string[];
|
|
51
|
+
onBatch?: (done: number) => void;
|
|
52
|
+
}): Promise<Current[]>;
|
|
53
|
+
/** A daily forecast per location, `forecastDays` days from today. */
|
|
54
|
+
daily(locations: Location[], options?: {
|
|
55
|
+
variables?: readonly string[];
|
|
56
|
+
forecastDays?: number;
|
|
57
|
+
}): Promise<Daily[]>;
|
|
58
|
+
/** Historical daily values for one location between two ISO dates (inclusive). */
|
|
59
|
+
archive(location: Location, range: {
|
|
60
|
+
start: string;
|
|
61
|
+
end: string;
|
|
62
|
+
variables?: readonly string[];
|
|
63
|
+
}): Promise<Daily>;
|
|
64
|
+
/** Places matching a name, best first. */
|
|
65
|
+
geocode(name: string, options?: {
|
|
66
|
+
count?: number;
|
|
67
|
+
language?: string;
|
|
68
|
+
}): Promise<Place[]>;
|
|
69
|
+
/** WMO weather interpretation codes, as Open-Meteo documents them. */
|
|
70
|
+
describe(code: number | null): string;
|
|
71
|
+
private forecast;
|
|
72
|
+
}
|
|
73
|
+
/** WMO weather interpretation codes, as Open-Meteo documents them. */
|
|
74
|
+
export declare function describeWeatherCode(code: number | null): string;
|
|
75
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,KAAK,eAAe,EAEpB,KAAK,aAAa,EAClB,aAAa,EAGd,MAAM,YAAY,CAAC;AAEpB,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,EAAkB,WAAW,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,KAAK,GAAG,EAAc,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,KAAK,GAAG,WAAW,CAAC;AAEhC,eAAe,SAAS,CAAC;AAEzB,eAAO,MAAM,qBAAqB,yCAAyC,CAAC;AAC5E,eAAO,MAAM,mBAAmB,uCAAuC,CAAC;AAKxE,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CA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,CAAC;IA6BrB,qEAAqE;IAE/D,KAAK,CACT,SAAS,EAAE,QAAQ,EAAE,EACrB,OAAO,GAAE;QAAE,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAO,GACrE,OAAO,CAAC,KAAK,EAAE,CAAC;IAgBnB,kFAAkF;IAE5E,OAAO,CACX,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,GACnE,OAAO,CAAC,KAAK,CAAC;IAiBjB,0CAA0C;IAEpC,OAAO,CACX,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO,GAClD,OAAO,CAAC,KAAK,EAAE,CAAC;IAcnB,sEAAsE;IAEtE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM;YAIvB,QAAQ;CAgBvB;AAuBD,sEAAsE;AACtE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAa/D"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@puppi/adapter-open-meteo`: a source connector over https://open-meteo.com.
|
|
3
|
+
* No key; three hosts (forecast, geocoding, archive), each a binding field
|
|
4
|
+
* with a default. Archive and geocoding pass `base` on `read`.
|
|
5
|
+
*/
|
|
6
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
7
|
+
var useValue = arguments.length > 2;
|
|
8
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
9
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
10
|
+
}
|
|
11
|
+
return useValue ? value : void 0;
|
|
12
|
+
};
|
|
13
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
14
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
15
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
16
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
17
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
18
|
+
var _, done = false;
|
|
19
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
20
|
+
var context = {};
|
|
21
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
22
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
23
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
24
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
25
|
+
if (kind === "accessor") {
|
|
26
|
+
if (result === void 0) continue;
|
|
27
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
28
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
29
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
30
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
31
|
+
}
|
|
32
|
+
else if (_ = accept(result)) {
|
|
33
|
+
if (kind === "field") initializers.unshift(_);
|
|
34
|
+
else descriptor[key] = _;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
38
|
+
done = true;
|
|
39
|
+
};
|
|
40
|
+
import { read, chunk, OpenApiClient, openApiClientOptions, trimSlash, } from "@puppi/sdk";
|
|
41
|
+
import connector from "./define.js";
|
|
42
|
+
import { operations } from "./operations.js";
|
|
43
|
+
export default connector;
|
|
44
|
+
export const DEFAULT_GEOCODING_URL = "https://geocoding-api.open-meteo.com";
|
|
45
|
+
export const DEFAULT_ARCHIVE_URL = "https://archive-api.open-meteo.com";
|
|
46
|
+
/** Open-Meteo accepts comma-separated coordinate lists; this many per request keeps a url short. */
|
|
47
|
+
const LOCATIONS_PER_REQUEST = 50;
|
|
48
|
+
export const DEFAULT_CURRENT = [
|
|
49
|
+
"temperature_2m",
|
|
50
|
+
"relative_humidity_2m",
|
|
51
|
+
"precipitation",
|
|
52
|
+
"weather_code",
|
|
53
|
+
"wind_speed_10m",
|
|
54
|
+
];
|
|
55
|
+
export const DEFAULT_DAILY = [
|
|
56
|
+
"temperature_2m_max",
|
|
57
|
+
"temperature_2m_min",
|
|
58
|
+
"precipitation_sum",
|
|
59
|
+
];
|
|
60
|
+
let Client = (() => {
|
|
61
|
+
let _classSuper = OpenApiClient;
|
|
62
|
+
let _instanceExtraInitializers = [];
|
|
63
|
+
let _current_decorators;
|
|
64
|
+
let _daily_decorators;
|
|
65
|
+
let _archive_decorators;
|
|
66
|
+
let _geocode_decorators;
|
|
67
|
+
let _describe_decorators;
|
|
68
|
+
return class Client extends _classSuper {
|
|
69
|
+
static {
|
|
70
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
71
|
+
_current_decorators = [read];
|
|
72
|
+
_daily_decorators = [read];
|
|
73
|
+
_archive_decorators = [read];
|
|
74
|
+
_geocode_decorators = [read];
|
|
75
|
+
_describe_decorators = [read];
|
|
76
|
+
__esDecorate(this, null, _current_decorators, { kind: "method", name: "current", static: false, private: false, access: { has: obj => "current" in obj, get: obj => obj.current }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
77
|
+
__esDecorate(this, null, _daily_decorators, { kind: "method", name: "daily", static: false, private: false, access: { has: obj => "daily" in obj, get: obj => obj.daily }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
78
|
+
__esDecorate(this, null, _archive_decorators, { kind: "method", name: "archive", static: false, private: false, access: { has: obj => "archive" in obj, get: obj => obj.archive }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
79
|
+
__esDecorate(this, null, _geocode_decorators, { kind: "method", name: "geocode", static: false, private: false, access: { has: obj => "geocode" in obj, get: obj => obj.geocode }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
80
|
+
__esDecorate(this, null, _describe_decorators, { kind: "method", name: "describe", static: false, private: false, access: { has: obj => "describe" in obj, get: obj => obj.describe }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
81
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
82
|
+
}
|
|
83
|
+
geocodingBase = __runInitializers(this, _instanceExtraInitializers);
|
|
84
|
+
archiveBase;
|
|
85
|
+
constructor(config, secrets = {}, options = {}) {
|
|
86
|
+
super(config, options, ...openApiClientOptions(connector, config, secrets, operations));
|
|
87
|
+
this.geocodingBase = trimSlash(config["geocoding_url"] ?? DEFAULT_GEOCODING_URL);
|
|
88
|
+
this.archiveBase = trimSlash(config["archive_url"] ?? DEFAULT_ARCHIVE_URL);
|
|
89
|
+
}
|
|
90
|
+
/** `GET` geocoding search for a known place proves a host answers. */
|
|
91
|
+
async check() {
|
|
92
|
+
await this.read("searchPlaces", {
|
|
93
|
+
base: this.geocodingBase,
|
|
94
|
+
query: { name: "Berlin", count: 1, language: "en", format: "json" },
|
|
95
|
+
});
|
|
96
|
+
return { ok: true };
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Current conditions at each location, in the order given, batched into as
|
|
100
|
+
* few requests as the api allows. `onBatch` fires after each request with
|
|
101
|
+
* the rows so far, so a caller can checkpoint between batches.
|
|
102
|
+
*/
|
|
103
|
+
async current(locations, options = {}) {
|
|
104
|
+
const variables = options.variables ?? DEFAULT_CURRENT;
|
|
105
|
+
const rows = [];
|
|
106
|
+
for (const batch of chunk(locations, LOCATIONS_PER_REQUEST)) {
|
|
107
|
+
const responses = await this.forecast(batch, { current: variables.join(",") });
|
|
108
|
+
for (const response of responses) {
|
|
109
|
+
const values = Object.fromEntries(variables.map((name) => [name, numberOrNull(response.current?.[name])]));
|
|
110
|
+
rows.push({
|
|
111
|
+
latitude: response.latitude,
|
|
112
|
+
longitude: response.longitude,
|
|
113
|
+
timezone: response.timezone,
|
|
114
|
+
elevation: response.elevation,
|
|
115
|
+
time: String(response.current?.["time"] ?? ""),
|
|
116
|
+
values,
|
|
117
|
+
units: response.current_units ?? {},
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
options.onBatch?.(rows.length);
|
|
121
|
+
}
|
|
122
|
+
return rows;
|
|
123
|
+
}
|
|
124
|
+
/** A daily forecast per location, `forecastDays` days from today. */
|
|
125
|
+
async daily(locations, options = {}) {
|
|
126
|
+
const variables = options.variables ?? DEFAULT_DAILY;
|
|
127
|
+
const rows = [];
|
|
128
|
+
for (const batch of chunk(locations, LOCATIONS_PER_REQUEST)) {
|
|
129
|
+
const responses = await this.forecast(batch, {
|
|
130
|
+
daily: variables.join(","),
|
|
131
|
+
forecast_days: options.forecastDays ?? 7,
|
|
132
|
+
});
|
|
133
|
+
for (const response of responses)
|
|
134
|
+
rows.push(dailyRows(response, variables));
|
|
135
|
+
}
|
|
136
|
+
return rows;
|
|
137
|
+
}
|
|
138
|
+
/** Historical daily values for one location between two ISO dates (inclusive). */
|
|
139
|
+
async archive(location, range) {
|
|
140
|
+
const variables = range.variables ?? DEFAULT_DAILY;
|
|
141
|
+
const response = await this.read("getArchive", {
|
|
142
|
+
base: this.archiveBase,
|
|
143
|
+
query: {
|
|
144
|
+
latitude: location.latitude,
|
|
145
|
+
longitude: location.longitude,
|
|
146
|
+
start_date: range.start,
|
|
147
|
+
end_date: range.end,
|
|
148
|
+
daily: variables.join(","),
|
|
149
|
+
timezone: "UTC",
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
return dailyRows(response, variables);
|
|
153
|
+
}
|
|
154
|
+
/** Places matching a name, best first. */
|
|
155
|
+
async geocode(name, options = {}) {
|
|
156
|
+
const body = await this.read("searchPlaces", {
|
|
157
|
+
base: this.geocodingBase,
|
|
158
|
+
query: {
|
|
159
|
+
name,
|
|
160
|
+
count: options.count ?? 5,
|
|
161
|
+
language: options.language ?? "en",
|
|
162
|
+
format: "json",
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
return body.results ?? [];
|
|
166
|
+
}
|
|
167
|
+
/** WMO weather interpretation codes, as Open-Meteo documents them. */
|
|
168
|
+
describe(code) {
|
|
169
|
+
return describeWeatherCode(code);
|
|
170
|
+
}
|
|
171
|
+
async forecast(locations, params) {
|
|
172
|
+
const body = await this.read("getForecast", {
|
|
173
|
+
query: {
|
|
174
|
+
latitude: locations.map((location) => location.latitude).join(","),
|
|
175
|
+
longitude: locations.map((location) => location.longitude).join(","),
|
|
176
|
+
timezone: "UTC",
|
|
177
|
+
...params,
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
// One location answers with an object, several with an array.
|
|
181
|
+
return Array.isArray(body) ? body : [body];
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
})();
|
|
185
|
+
export { Client };
|
|
186
|
+
function dailyRows(response, variables) {
|
|
187
|
+
const dates = (response.daily?.["time"] ?? []);
|
|
188
|
+
return {
|
|
189
|
+
latitude: response.latitude,
|
|
190
|
+
longitude: response.longitude,
|
|
191
|
+
timezone: response.timezone,
|
|
192
|
+
days: dates.map((date, index) => ({
|
|
193
|
+
date,
|
|
194
|
+
values: Object.fromEntries(variables.map((name) => [name, numberOrNull(response.daily?.[name]?.[index])])),
|
|
195
|
+
})),
|
|
196
|
+
units: response.daily_units ?? {},
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function numberOrNull(value) {
|
|
200
|
+
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
201
|
+
}
|
|
202
|
+
/** WMO weather interpretation codes, as Open-Meteo documents them. */
|
|
203
|
+
export function describeWeatherCode(code) {
|
|
204
|
+
if (code === null)
|
|
205
|
+
return "unknown";
|
|
206
|
+
if (code === 0)
|
|
207
|
+
return "clear";
|
|
208
|
+
if (code <= 2)
|
|
209
|
+
return "partly cloudy";
|
|
210
|
+
if (code === 3)
|
|
211
|
+
return "overcast";
|
|
212
|
+
if (code <= 48)
|
|
213
|
+
return "fog";
|
|
214
|
+
if (code <= 57)
|
|
215
|
+
return "drizzle";
|
|
216
|
+
if (code <= 67)
|
|
217
|
+
return "rain";
|
|
218
|
+
if (code <= 77)
|
|
219
|
+
return "snow";
|
|
220
|
+
if (code <= 82)
|
|
221
|
+
return "rain showers";
|
|
222
|
+
if (code <= 86)
|
|
223
|
+
return "snow showers";
|
|
224
|
+
return "thunderstorm";
|
|
225
|
+
}
|
|
226
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,OAAO,EACL,IAAI,EAEJ,KAAK,EAEL,aAAa,EACb,oBAAoB,EACpB,SAAS,GACV,MAAM,YAAY,CAAC;AAEpB,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAY,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIvD,eAAe,SAAS,CAAC;AAEzB,MAAM,CAAC,MAAM,qBAAqB,GAAG,sCAAsC,CAAC;AAC5E,MAAM,CAAC,MAAM,mBAAmB,GAAG,oCAAoC,CAAC;AAExE,oGAAoG;AACpG,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAwBjC,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,gBAAgB;IAChB,sBAAsB;IACtB,eAAe;IACf,cAAc;IACd,gBAAgB;CACR,CAAC;AAEX,MAAM,CAAC,MAAM,aAAa,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|
3
|
+
* Do not make direct changes to the file.
|
|
4
|
+
*/
|
|
5
|
+
export type paths = {
|
|
6
|
+
"/v1/forecast": {
|
|
7
|
+
parameters: {
|
|
8
|
+
query?: never;
|
|
9
|
+
header?: never;
|
|
10
|
+
path?: never;
|
|
11
|
+
cookie?: never;
|
|
12
|
+
};
|
|
13
|
+
get: operations["getForecast"];
|
|
14
|
+
put?: never;
|
|
15
|
+
post?: never;
|
|
16
|
+
delete?: never;
|
|
17
|
+
options?: never;
|
|
18
|
+
head?: never;
|
|
19
|
+
patch?: never;
|
|
20
|
+
trace?: never;
|
|
21
|
+
};
|
|
22
|
+
"/v1/archive": {
|
|
23
|
+
parameters: {
|
|
24
|
+
query?: never;
|
|
25
|
+
header?: never;
|
|
26
|
+
path?: never;
|
|
27
|
+
cookie?: never;
|
|
28
|
+
};
|
|
29
|
+
get: operations["getArchive"];
|
|
30
|
+
put?: never;
|
|
31
|
+
post?: never;
|
|
32
|
+
delete?: never;
|
|
33
|
+
options?: never;
|
|
34
|
+
head?: never;
|
|
35
|
+
patch?: never;
|
|
36
|
+
trace?: never;
|
|
37
|
+
};
|
|
38
|
+
"/v1/search": {
|
|
39
|
+
parameters: {
|
|
40
|
+
query?: never;
|
|
41
|
+
header?: never;
|
|
42
|
+
path?: never;
|
|
43
|
+
cookie?: never;
|
|
44
|
+
};
|
|
45
|
+
get: operations["searchPlaces"];
|
|
46
|
+
put?: never;
|
|
47
|
+
post?: never;
|
|
48
|
+
delete?: never;
|
|
49
|
+
options?: never;
|
|
50
|
+
head?: never;
|
|
51
|
+
patch?: never;
|
|
52
|
+
trace?: never;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export type webhooks = Record<string, never>;
|
|
56
|
+
export type components = {
|
|
57
|
+
schemas: {
|
|
58
|
+
forecast: {
|
|
59
|
+
latitude: number;
|
|
60
|
+
longitude: number;
|
|
61
|
+
timezone: string;
|
|
62
|
+
elevation: number;
|
|
63
|
+
current?: {
|
|
64
|
+
[key: string]: (number | string) | null;
|
|
65
|
+
};
|
|
66
|
+
current_units?: {
|
|
67
|
+
[key: string]: string;
|
|
68
|
+
};
|
|
69
|
+
daily?: {
|
|
70
|
+
[key: string]: ((number | string) | null)[];
|
|
71
|
+
};
|
|
72
|
+
daily_units?: {
|
|
73
|
+
[key: string]: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
place: {
|
|
77
|
+
id: number;
|
|
78
|
+
name: string;
|
|
79
|
+
latitude: number;
|
|
80
|
+
longitude: number;
|
|
81
|
+
elevation?: number;
|
|
82
|
+
country_code?: string;
|
|
83
|
+
country?: string;
|
|
84
|
+
admin1?: string;
|
|
85
|
+
population?: number;
|
|
86
|
+
timezone?: string;
|
|
87
|
+
};
|
|
88
|
+
search: {
|
|
89
|
+
results?: components["schemas"]["place"][];
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
responses: never;
|
|
93
|
+
parameters: never;
|
|
94
|
+
requestBodies: never;
|
|
95
|
+
headers: never;
|
|
96
|
+
pathItems: never;
|
|
97
|
+
};
|
|
98
|
+
export type SchemaForecast = components["schemas"]["forecast"];
|
|
99
|
+
export type SchemaPlace = components["schemas"]["place"];
|
|
100
|
+
export type SchemaSearch = components["schemas"]["search"];
|
|
101
|
+
export type $defs = Record<string, never>;
|
|
102
|
+
export interface operations {
|
|
103
|
+
getForecast: {
|
|
104
|
+
parameters: {
|
|
105
|
+
query?: {
|
|
106
|
+
latitude?: string;
|
|
107
|
+
longitude?: string;
|
|
108
|
+
current?: string;
|
|
109
|
+
daily?: string;
|
|
110
|
+
forecast_days?: number;
|
|
111
|
+
timezone?: string;
|
|
112
|
+
};
|
|
113
|
+
header?: never;
|
|
114
|
+
path?: never;
|
|
115
|
+
cookie?: never;
|
|
116
|
+
};
|
|
117
|
+
requestBody?: never;
|
|
118
|
+
responses: {
|
|
119
|
+
/** @description One object, or an array when several locations were asked. */
|
|
120
|
+
200: {
|
|
121
|
+
headers: {
|
|
122
|
+
[name: string]: unknown;
|
|
123
|
+
};
|
|
124
|
+
content: {
|
|
125
|
+
"application/json": components["schemas"]["forecast"];
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
getArchive: {
|
|
131
|
+
parameters: {
|
|
132
|
+
query?: {
|
|
133
|
+
latitude?: number;
|
|
134
|
+
longitude?: number;
|
|
135
|
+
start_date?: string;
|
|
136
|
+
end_date?: string;
|
|
137
|
+
daily?: string;
|
|
138
|
+
timezone?: string;
|
|
139
|
+
};
|
|
140
|
+
header?: never;
|
|
141
|
+
path?: never;
|
|
142
|
+
cookie?: never;
|
|
143
|
+
};
|
|
144
|
+
requestBody?: never;
|
|
145
|
+
responses: {
|
|
146
|
+
/** @description Historical daily values. */
|
|
147
|
+
200: {
|
|
148
|
+
headers: {
|
|
149
|
+
[name: string]: unknown;
|
|
150
|
+
};
|
|
151
|
+
content: {
|
|
152
|
+
"application/json": components["schemas"]["forecast"];
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
searchPlaces: {
|
|
158
|
+
parameters: {
|
|
159
|
+
query?: {
|
|
160
|
+
name?: string;
|
|
161
|
+
count?: number;
|
|
162
|
+
language?: string;
|
|
163
|
+
format?: string;
|
|
164
|
+
};
|
|
165
|
+
header?: never;
|
|
166
|
+
path?: never;
|
|
167
|
+
cookie?: never;
|
|
168
|
+
};
|
|
169
|
+
requestBody?: never;
|
|
170
|
+
responses: {
|
|
171
|
+
/** @description Matching places. */
|
|
172
|
+
200: {
|
|
173
|
+
headers: {
|
|
174
|
+
[name: string]: unknown;
|
|
175
|
+
};
|
|
176
|
+
content: {
|
|
177
|
+
"application/json": components["schemas"]["search"];
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=openapi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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YACf,IAAI,CAAC,EAAE,KAAK,CAAC;YACb,MAAM,CAAC,EAAE,KAAK,CAAC;SAChB,CAAC;QACF,WAAW,CAAC,EAAE,KAAK,CAAC;QACpB,SAAS,EAAE;YACT,oCAAoC;YACpC,GAAG,EAAE;gBACH,OAAO,EAAE;oBACP,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;iBACzB,CAAC;gBACF,OAAO,EAAE;oBACP,kBAAkB,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;iBACrD,CAAC;aACH,CAAC;SACH,CAAC;KACH,CAAC;CACH"}
|
package/dist/openapi.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi.js","sourceRoot":"","sources":["../src/openapi.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Generated from openapi.json. Do not edit. */
|
|
2
|
+
import type { BodyOf, Operation } from "@puppi/sdk";
|
|
3
|
+
import type { operations as spec } from "./openapi.js";
|
|
4
|
+
export type Api = {
|
|
5
|
+
responses: {
|
|
6
|
+
getForecast: BodyOf<spec["getForecast"]>;
|
|
7
|
+
getArchive: BodyOf<spec["getArchive"]>;
|
|
8
|
+
searchPlaces: BodyOf<spec["searchPlaces"]>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const operations: Record<keyof Api["responses"], Operation>;
|
|
12
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAEhD,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,KAAK,EAAE,UAAU,IAAI,IAAI,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,MAAM,GAAG,GAAG;IAChB,SAAS,EAAE;QACT,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;QACzC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;QACvC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;KAC5C,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,WAAW,CAAC,EAAE,SAAS,CAgBhE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Generated from openapi.json. Do not edit. */
|
|
2
|
+
export const operations = {
|
|
3
|
+
getForecast: {
|
|
4
|
+
method: "get",
|
|
5
|
+
path: "/v1/forecast",
|
|
6
|
+
query: ["latitude", "longitude", "current", "daily", "forecast_days", "timezone"],
|
|
7
|
+
},
|
|
8
|
+
getArchive: {
|
|
9
|
+
method: "get",
|
|
10
|
+
path: "/v1/archive",
|
|
11
|
+
query: ["latitude", "longitude", "start_date", "end_date", "daily", "timezone"],
|
|
12
|
+
},
|
|
13
|
+
searchPlaces: {
|
|
14
|
+
method: "get",
|
|
15
|
+
path: "/v1/search",
|
|
16
|
+
query: ["name", "count", "language", "format"],
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAchD,MAAM,CAAC,MAAM,UAAU,GAA8C;IACnE,WAAW,EAAE;QACX,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,CAAC;KAClF;IACD,UAAU,EAAE;QACV,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,CAAC;KAChF;IACD,YAAY,EAAE;QACZ,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC;KAC/C;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@puppi/adapter-open-meteo",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Source connector for Open-Meteo forecast, geocoding, and archive APIs.",
|
|
5
|
+
"homepage": "https://github.com/DashJump/puppi",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/DashJump/puppi/issues"
|
|
8
|
+
},
|
|
9
|
+
"license": "Apache-2.0",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/DashJump/puppi.git",
|
|
13
|
+
"directory": "connectors/open-meteo"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"default": "./dist/index.js"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@puppi/sdk": "0.3.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@puppi/conformance": "0.1.0",
|
|
36
|
+
"@types/node": "^26.6.5",
|
|
37
|
+
"openapi-sampler": "1.7.4",
|
|
38
|
+
"openapi-typescript": "7.13.0",
|
|
39
|
+
"typescript": "^5.6.3",
|
|
40
|
+
"vite-plus": "1.7.0"
|
|
41
|
+
},
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">=26"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"generate": "openapi-typescript openapi.json -o src/openapi.ts --export-type --root-types --empty-objects-unknown --default-non-nullable=false && puppi-write-operations openapi.json src/operations.ts && vp fmt --write src/openapi.ts src/operations.ts",
|
|
47
|
+
"build": "tsc -p tsconfig.json",
|
|
48
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p test/tsconfig.json",
|
|
49
|
+
"test": "vp test run --config ../../vite.config.ts"
|
|
50
|
+
}
|
|
6
51
|
}
|