@robinpath/weather 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +103 -103
- package/package.json +16 -3
- package/dist/index.d.ts +0 -6
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -12
- package/dist/index.js.map +0 -1
- package/dist/weather.d.ts +0 -166
- package/dist/weather.d.ts.map +0 -1
- package/dist/weather.js +0 -99
- package/dist/weather.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
# @robinpath/weather
|
|
2
|
-
|
|
3
|
-
> Weather module for RobinPath.
|
|
4
|
-
|
|
5
|
-
   
|
|
6
|
-
|
|
7
|
-
## Why use this module?
|
|
8
|
-
|
|
9
|
-
The `weather` module lets you:
|
|
10
|
-
|
|
11
|
-
- getCurrentWeather
|
|
12
|
-
- getForecast
|
|
13
|
-
- get5DayForecast
|
|
14
|
-
- getHourlyForecast
|
|
15
|
-
- getAirQuality
|
|
16
|
-
|
|
17
|
-
All functions are callable directly from RobinPath scripts with a simple, consistent API.
|
|
18
|
-
|
|
19
|
-
## Installation
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
npm install @robinpath/weather
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Quick Start
|
|
26
|
-
|
|
27
|
-
**1. Set up credentials**
|
|
28
|
-
|
|
29
|
-
```robinpath
|
|
30
|
-
weather.setCredentials "your-credentials"
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
**2. getCurrentWeather**
|
|
34
|
-
|
|
35
|
-
```robinpath
|
|
36
|
-
weather.getCurrentWeather
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Available Functions
|
|
40
|
-
|
|
41
|
-
| Function | Description |
|
|
42
|
-
|----------|-------------|
|
|
43
|
-
| `weather.setCredentials` | Configure weather credentials. |
|
|
44
|
-
| `weather.getCurrentWeather` | getCurrentWeather |
|
|
45
|
-
| `weather.getForecast` | getForecast |
|
|
46
|
-
| `weather.get5DayForecast` | get5DayForecast |
|
|
47
|
-
| `weather.getHourlyForecast` | getHourlyForecast |
|
|
48
|
-
| `weather.getAirQuality` | getAirQuality |
|
|
49
|
-
| `weather.getUVIndex` | getUVIndex |
|
|
50
|
-
| `weather.getWeatherByZip` | getWeatherByZip |
|
|
51
|
-
| `weather.getHistoricalWeather` | getHistoricalWeather |
|
|
52
|
-
| `weather.getWeatherAlerts` | getWeatherAlerts |
|
|
53
|
-
| `weather.geocodeCity` | geocodeCity |
|
|
54
|
-
| `weather.reverseGeocode` | reverseGeocode |
|
|
55
|
-
| `weather.getWeatherMap` | getWeatherMap |
|
|
56
|
-
|
|
57
|
-
## Examples
|
|
58
|
-
|
|
59
|
-
### getCurrentWeather
|
|
60
|
-
|
|
61
|
-
```robinpath
|
|
62
|
-
weather.getCurrentWeather
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### getForecast
|
|
66
|
-
|
|
67
|
-
```robinpath
|
|
68
|
-
weather.getForecast
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### get5DayForecast
|
|
72
|
-
|
|
73
|
-
```robinpath
|
|
74
|
-
weather.get5DayForecast
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Integration with RobinPath
|
|
78
|
-
|
|
79
|
-
```typescript
|
|
80
|
-
import { RobinPath } from "@wiredwp/robinpath";
|
|
81
|
-
import Module from "@robinpath/weather";
|
|
82
|
-
|
|
83
|
-
const rp = new RobinPath();
|
|
84
|
-
rp.registerModule(Module.name, Module.functions);
|
|
85
|
-
rp.registerModuleMeta(Module.name, Module.functionMetadata);
|
|
86
|
-
|
|
87
|
-
const result = await rp.executeScript(`
|
|
88
|
-
weather.setCredentials "your-credentials"
|
|
89
|
-
weather.getCurrentWeather
|
|
90
|
-
`);
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
## Full API Reference
|
|
94
|
-
|
|
95
|
-
See [MODULE.md](./MODULE.md) for complete documentation including all parameters, return types, error handling, and advanced examples.
|
|
96
|
-
|
|
97
|
-
## Related Modules
|
|
98
|
-
|
|
99
|
-
- [`@robinpath/json`](../json) — JSON module for complementary functionality
|
|
100
|
-
|
|
101
|
-
## License
|
|
102
|
-
|
|
103
|
-
MIT
|
|
1
|
+
# @robinpath/weather
|
|
2
|
+
|
|
3
|
+
> Weather module for RobinPath.
|
|
4
|
+
|
|
5
|
+
   
|
|
6
|
+
|
|
7
|
+
## Why use this module?
|
|
8
|
+
|
|
9
|
+
The `weather` module lets you:
|
|
10
|
+
|
|
11
|
+
- getCurrentWeather
|
|
12
|
+
- getForecast
|
|
13
|
+
- get5DayForecast
|
|
14
|
+
- getHourlyForecast
|
|
15
|
+
- getAirQuality
|
|
16
|
+
|
|
17
|
+
All functions are callable directly from RobinPath scripts with a simple, consistent API.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install @robinpath/weather
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
**1. Set up credentials**
|
|
28
|
+
|
|
29
|
+
```robinpath
|
|
30
|
+
weather.setCredentials "your-credentials"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**2. getCurrentWeather**
|
|
34
|
+
|
|
35
|
+
```robinpath
|
|
36
|
+
weather.getCurrentWeather
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Available Functions
|
|
40
|
+
|
|
41
|
+
| Function | Description |
|
|
42
|
+
|----------|-------------|
|
|
43
|
+
| `weather.setCredentials` | Configure weather credentials. |
|
|
44
|
+
| `weather.getCurrentWeather` | getCurrentWeather |
|
|
45
|
+
| `weather.getForecast` | getForecast |
|
|
46
|
+
| `weather.get5DayForecast` | get5DayForecast |
|
|
47
|
+
| `weather.getHourlyForecast` | getHourlyForecast |
|
|
48
|
+
| `weather.getAirQuality` | getAirQuality |
|
|
49
|
+
| `weather.getUVIndex` | getUVIndex |
|
|
50
|
+
| `weather.getWeatherByZip` | getWeatherByZip |
|
|
51
|
+
| `weather.getHistoricalWeather` | getHistoricalWeather |
|
|
52
|
+
| `weather.getWeatherAlerts` | getWeatherAlerts |
|
|
53
|
+
| `weather.geocodeCity` | geocodeCity |
|
|
54
|
+
| `weather.reverseGeocode` | reverseGeocode |
|
|
55
|
+
| `weather.getWeatherMap` | getWeatherMap |
|
|
56
|
+
|
|
57
|
+
## Examples
|
|
58
|
+
|
|
59
|
+
### getCurrentWeather
|
|
60
|
+
|
|
61
|
+
```robinpath
|
|
62
|
+
weather.getCurrentWeather
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### getForecast
|
|
66
|
+
|
|
67
|
+
```robinpath
|
|
68
|
+
weather.getForecast
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### get5DayForecast
|
|
72
|
+
|
|
73
|
+
```robinpath
|
|
74
|
+
weather.get5DayForecast
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Integration with RobinPath
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
import { RobinPath } from "@wiredwp/robinpath";
|
|
81
|
+
import Module from "@robinpath/weather";
|
|
82
|
+
|
|
83
|
+
const rp = new RobinPath();
|
|
84
|
+
rp.registerModule(Module.name, Module.functions);
|
|
85
|
+
rp.registerModuleMeta(Module.name, Module.functionMetadata);
|
|
86
|
+
|
|
87
|
+
const result = await rp.executeScript(`
|
|
88
|
+
weather.setCredentials "your-credentials"
|
|
89
|
+
weather.getCurrentWeather
|
|
90
|
+
`);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Full API Reference
|
|
94
|
+
|
|
95
|
+
See [MODULE.md](./MODULE.md) for complete documentation including all parameters, return types, error handling, and advanced examples.
|
|
96
|
+
|
|
97
|
+
## Related Modules
|
|
98
|
+
|
|
99
|
+
- [`@robinpath/json`](../json) — JSON module for complementary functionality
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@robinpath/weather",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -20,10 +20,23 @@
|
|
|
20
20
|
"build": "tsc"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@
|
|
23
|
+
"@robinpath/core": ">=0.20.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@
|
|
26
|
+
"@robinpath/core": "^0.30.1",
|
|
27
27
|
"typescript": "^5.6.0"
|
|
28
|
+
},
|
|
29
|
+
"description": "Weather module for RobinPath.",
|
|
30
|
+
"keywords": [
|
|
31
|
+
"weather",
|
|
32
|
+
"other"
|
|
33
|
+
],
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"robinpath": {
|
|
36
|
+
"category": "other",
|
|
37
|
+
"type": "utility",
|
|
38
|
+
"auth": "api-key",
|
|
39
|
+
"functionCount": 13,
|
|
40
|
+
"baseUrl": "https://api.openweathermap.org"
|
|
28
41
|
}
|
|
29
42
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ModuleAdapter } from "@wiredwp/robinpath";
|
|
2
|
-
declare const WeatherModule: ModuleAdapter;
|
|
3
|
-
export default WeatherModule;
|
|
4
|
-
export { WeatherModule };
|
|
5
|
-
export { WeatherFunctions, WeatherFunctionMetadata, WeatherModuleMetadata } from "./weather.js";
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,QAAA,MAAM,aAAa,EAAE,aAMpB,CAAC;AAEF,eAAe,aAAa,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { WeatherFunctions, WeatherFunctionMetadata, WeatherModuleMetadata } from "./weather.js";
|
|
2
|
-
const WeatherModule = {
|
|
3
|
-
name: "weather",
|
|
4
|
-
functions: WeatherFunctions,
|
|
5
|
-
functionMetadata: WeatherFunctionMetadata,
|
|
6
|
-
moduleMetadata: WeatherModuleMetadata,
|
|
7
|
-
global: false,
|
|
8
|
-
}; // as ModuleAdapter
|
|
9
|
-
export default WeatherModule;
|
|
10
|
-
export { WeatherModule };
|
|
11
|
-
export { WeatherFunctions, WeatherFunctionMetadata, WeatherModuleMetadata } from "./weather.js";
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAEhG,MAAM,aAAa,GAAkB;IACnC,IAAI,EAAE,SAAS;IACf,SAAS,EAAE,gBAAgB;IAC3B,gBAAgB,EAAE,uBAA8B;IAChD,cAAc,EAAE,qBAA4B;IAC5C,MAAM,EAAE,KAAK;CACd,CAAC,CAAC,mBAAmB;AAEtB,eAAe,aAAa,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/weather.d.ts
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import type { BuiltinHandler } from "@wiredwp/robinpath";
|
|
2
|
-
export declare const WeatherFunctions: Record<string, BuiltinHandler>;
|
|
3
|
-
export declare const WeatherFunctionMetadata: {
|
|
4
|
-
setCredentials: {
|
|
5
|
-
description: string;
|
|
6
|
-
parameters: {
|
|
7
|
-
name: string;
|
|
8
|
-
dataType: string;
|
|
9
|
-
description: string;
|
|
10
|
-
formInputType: string;
|
|
11
|
-
required: boolean;
|
|
12
|
-
}[];
|
|
13
|
-
returnType: string;
|
|
14
|
-
returnDescription: string;
|
|
15
|
-
};
|
|
16
|
-
getCurrentWeather: {
|
|
17
|
-
description: string;
|
|
18
|
-
parameters: {
|
|
19
|
-
name: string;
|
|
20
|
-
dataType: string;
|
|
21
|
-
description: string;
|
|
22
|
-
formInputType: string;
|
|
23
|
-
required: boolean;
|
|
24
|
-
}[];
|
|
25
|
-
returnType: string;
|
|
26
|
-
returnDescription: string;
|
|
27
|
-
};
|
|
28
|
-
getForecast: {
|
|
29
|
-
description: string;
|
|
30
|
-
parameters: {
|
|
31
|
-
name: string;
|
|
32
|
-
dataType: string;
|
|
33
|
-
description: string;
|
|
34
|
-
formInputType: string;
|
|
35
|
-
required: boolean;
|
|
36
|
-
}[];
|
|
37
|
-
returnType: string;
|
|
38
|
-
returnDescription: string;
|
|
39
|
-
};
|
|
40
|
-
get5DayForecast: {
|
|
41
|
-
description: string;
|
|
42
|
-
parameters: {
|
|
43
|
-
name: string;
|
|
44
|
-
dataType: string;
|
|
45
|
-
description: string;
|
|
46
|
-
formInputType: string;
|
|
47
|
-
required: boolean;
|
|
48
|
-
}[];
|
|
49
|
-
returnType: string;
|
|
50
|
-
returnDescription: string;
|
|
51
|
-
};
|
|
52
|
-
getHourlyForecast: {
|
|
53
|
-
description: string;
|
|
54
|
-
parameters: {
|
|
55
|
-
name: string;
|
|
56
|
-
dataType: string;
|
|
57
|
-
description: string;
|
|
58
|
-
formInputType: string;
|
|
59
|
-
required: boolean;
|
|
60
|
-
}[];
|
|
61
|
-
returnType: string;
|
|
62
|
-
returnDescription: string;
|
|
63
|
-
};
|
|
64
|
-
getAirQuality: {
|
|
65
|
-
description: string;
|
|
66
|
-
parameters: {
|
|
67
|
-
name: string;
|
|
68
|
-
dataType: string;
|
|
69
|
-
description: string;
|
|
70
|
-
formInputType: string;
|
|
71
|
-
required: boolean;
|
|
72
|
-
}[];
|
|
73
|
-
returnType: string;
|
|
74
|
-
returnDescription: string;
|
|
75
|
-
};
|
|
76
|
-
getUVIndex: {
|
|
77
|
-
description: string;
|
|
78
|
-
parameters: {
|
|
79
|
-
name: string;
|
|
80
|
-
dataType: string;
|
|
81
|
-
description: string;
|
|
82
|
-
formInputType: string;
|
|
83
|
-
required: boolean;
|
|
84
|
-
}[];
|
|
85
|
-
returnType: string;
|
|
86
|
-
returnDescription: string;
|
|
87
|
-
};
|
|
88
|
-
getWeatherByZip: {
|
|
89
|
-
description: string;
|
|
90
|
-
parameters: {
|
|
91
|
-
name: string;
|
|
92
|
-
dataType: string;
|
|
93
|
-
description: string;
|
|
94
|
-
formInputType: string;
|
|
95
|
-
required: boolean;
|
|
96
|
-
}[];
|
|
97
|
-
returnType: string;
|
|
98
|
-
returnDescription: string;
|
|
99
|
-
};
|
|
100
|
-
getHistoricalWeather: {
|
|
101
|
-
description: string;
|
|
102
|
-
parameters: {
|
|
103
|
-
name: string;
|
|
104
|
-
dataType: string;
|
|
105
|
-
description: string;
|
|
106
|
-
formInputType: string;
|
|
107
|
-
required: boolean;
|
|
108
|
-
}[];
|
|
109
|
-
returnType: string;
|
|
110
|
-
returnDescription: string;
|
|
111
|
-
};
|
|
112
|
-
getWeatherAlerts: {
|
|
113
|
-
description: string;
|
|
114
|
-
parameters: {
|
|
115
|
-
name: string;
|
|
116
|
-
dataType: string;
|
|
117
|
-
description: string;
|
|
118
|
-
formInputType: string;
|
|
119
|
-
required: boolean;
|
|
120
|
-
}[];
|
|
121
|
-
returnType: string;
|
|
122
|
-
returnDescription: string;
|
|
123
|
-
};
|
|
124
|
-
geocodeCity: {
|
|
125
|
-
description: string;
|
|
126
|
-
parameters: {
|
|
127
|
-
name: string;
|
|
128
|
-
dataType: string;
|
|
129
|
-
description: string;
|
|
130
|
-
formInputType: string;
|
|
131
|
-
required: boolean;
|
|
132
|
-
}[];
|
|
133
|
-
returnType: string;
|
|
134
|
-
returnDescription: string;
|
|
135
|
-
};
|
|
136
|
-
reverseGeocode: {
|
|
137
|
-
description: string;
|
|
138
|
-
parameters: {
|
|
139
|
-
name: string;
|
|
140
|
-
dataType: string;
|
|
141
|
-
description: string;
|
|
142
|
-
formInputType: string;
|
|
143
|
-
required: boolean;
|
|
144
|
-
}[];
|
|
145
|
-
returnType: string;
|
|
146
|
-
returnDescription: string;
|
|
147
|
-
};
|
|
148
|
-
getWeatherMap: {
|
|
149
|
-
description: string;
|
|
150
|
-
parameters: {
|
|
151
|
-
name: string;
|
|
152
|
-
dataType: string;
|
|
153
|
-
description: string;
|
|
154
|
-
formInputType: string;
|
|
155
|
-
required: boolean;
|
|
156
|
-
}[];
|
|
157
|
-
returnType: string;
|
|
158
|
-
returnDescription: string;
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
|
-
export declare const WeatherModuleMetadata: {
|
|
162
|
-
description: string;
|
|
163
|
-
methods: string[];
|
|
164
|
-
category: string;
|
|
165
|
-
};
|
|
166
|
-
//# sourceMappingURL=weather.d.ts.map
|
package/dist/weather.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"weather.d.ts","sourceRoot":"","sources":["../src/weather.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAA2C,MAAM,oBAAoB,CAAC;AAwFlG,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAE3D,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcnC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;CAIjC,CAAC"}
|
package/dist/weather.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
const config = new Map();
|
|
2
|
-
function getConfig(key) {
|
|
3
|
-
const val = config.get(key);
|
|
4
|
-
if (!val)
|
|
5
|
-
throw new Error(`Weather: "${key}" not configured. Call weather.setCredentials first.`);
|
|
6
|
-
return val;
|
|
7
|
-
}
|
|
8
|
-
async function apiCall(path, method = "GET", body) {
|
|
9
|
-
const res = await fetch(`https://api.openweathermap.org/data/2.5${path}`, {
|
|
10
|
-
method,
|
|
11
|
-
headers: { "Content-Type": "application/json" },
|
|
12
|
-
body: body ? JSON.stringify(body) : undefined,
|
|
13
|
-
});
|
|
14
|
-
if (!res.ok) {
|
|
15
|
-
const t = await res.text();
|
|
16
|
-
throw new Error(`Weather API error (${res.status}): ${t}`);
|
|
17
|
-
}
|
|
18
|
-
const ct = res.headers.get("content-type");
|
|
19
|
-
return ct && ct.includes("application/json") ? res.json() : res.text();
|
|
20
|
-
}
|
|
21
|
-
const setCredentials = (args) => {
|
|
22
|
-
const apiKey = args[0];
|
|
23
|
-
if (!apiKey)
|
|
24
|
-
throw new Error("weather.setCredentials requires apiKey.");
|
|
25
|
-
config.set("apiKey", apiKey);
|
|
26
|
-
return "Weather credentials configured.";
|
|
27
|
-
};
|
|
28
|
-
const getCurrentWeather = async (args) => {
|
|
29
|
-
const id = args[0];
|
|
30
|
-
return apiCall(id ? `/getCurrentWeather/${id}` : `/getCurrentWeather`);
|
|
31
|
-
};
|
|
32
|
-
const getForecast = async (args) => {
|
|
33
|
-
const id = args[0];
|
|
34
|
-
return apiCall(id ? `/getForecast/${id}` : `/getForecast`);
|
|
35
|
-
};
|
|
36
|
-
const get5DayForecast = async (args) => {
|
|
37
|
-
const id = args[0];
|
|
38
|
-
return apiCall(id ? `/get5DayForecast/${id}` : `/get5DayForecast`);
|
|
39
|
-
};
|
|
40
|
-
const getHourlyForecast = async (args) => {
|
|
41
|
-
const id = args[0];
|
|
42
|
-
return apiCall(id ? `/getHourlyForecast/${id}` : `/getHourlyForecast`);
|
|
43
|
-
};
|
|
44
|
-
const getAirQuality = async (args) => {
|
|
45
|
-
const id = args[0];
|
|
46
|
-
return apiCall(id ? `/getAirQuality/${id}` : `/getAirQuality`);
|
|
47
|
-
};
|
|
48
|
-
const getUVIndex = async (args) => {
|
|
49
|
-
const id = args[0];
|
|
50
|
-
return apiCall(id ? `/getUVIndex/${id}` : `/getUVIndex`);
|
|
51
|
-
};
|
|
52
|
-
const getWeatherByZip = async (args) => {
|
|
53
|
-
const id = args[0];
|
|
54
|
-
return apiCall(id ? `/getWeatherByZip/${id}` : `/getWeatherByZip`);
|
|
55
|
-
};
|
|
56
|
-
const getHistoricalWeather = async (args) => {
|
|
57
|
-
const id = args[0];
|
|
58
|
-
return apiCall(id ? `/getHistoricalWeather/${id}` : `/getHistoricalWeather`);
|
|
59
|
-
};
|
|
60
|
-
const getWeatherAlerts = async (args) => {
|
|
61
|
-
const id = args[0];
|
|
62
|
-
return apiCall(id ? `/getWeatherAlerts/${id}` : `/getWeatherAlerts`);
|
|
63
|
-
};
|
|
64
|
-
const geocodeCity = async (args) => {
|
|
65
|
-
const id = args[0];
|
|
66
|
-
return apiCall(`/geocodeCity${id ? `/${id}` : ""}`);
|
|
67
|
-
};
|
|
68
|
-
const reverseGeocode = async (args) => {
|
|
69
|
-
const id = args[0];
|
|
70
|
-
return apiCall(id ? `/reverseGeocode/${id}` : `/reverseGeocode`);
|
|
71
|
-
};
|
|
72
|
-
const getWeatherMap = async (args) => {
|
|
73
|
-
const id = args[0];
|
|
74
|
-
return apiCall(id ? `/getWeatherMap/${id}` : `/getWeatherMap`);
|
|
75
|
-
};
|
|
76
|
-
export const WeatherFunctions = {
|
|
77
|
-
setCredentials, getCurrentWeather, getForecast, get5DayForecast, getHourlyForecast, getAirQuality, getUVIndex, getWeatherByZip, getHistoricalWeather, getWeatherAlerts, geocodeCity, reverseGeocode, getWeatherMap,
|
|
78
|
-
};
|
|
79
|
-
export const WeatherFunctionMetadata = {
|
|
80
|
-
setCredentials: { description: "Configure weather credentials.", parameters: [{ name: "apiKey", dataType: "string", description: "apiKey", formInputType: "text", required: true }], returnType: "object", returnDescription: "API response." },
|
|
81
|
-
getCurrentWeather: { description: "getCurrentWeather", parameters: [{ name: "input", dataType: "string", description: "Input parameter", formInputType: "text", required: false }], returnType: "object", returnDescription: "API response." },
|
|
82
|
-
getForecast: { description: "getForecast", parameters: [{ name: "input", dataType: "string", description: "Input parameter", formInputType: "text", required: false }], returnType: "object", returnDescription: "API response." },
|
|
83
|
-
get5DayForecast: { description: "get5DayForecast", parameters: [{ name: "input", dataType: "string", description: "Input parameter", formInputType: "text", required: false }], returnType: "object", returnDescription: "API response." },
|
|
84
|
-
getHourlyForecast: { description: "getHourlyForecast", parameters: [{ name: "input", dataType: "string", description: "Input parameter", formInputType: "text", required: false }], returnType: "object", returnDescription: "API response." },
|
|
85
|
-
getAirQuality: { description: "getAirQuality", parameters: [{ name: "input", dataType: "string", description: "Input parameter", formInputType: "text", required: false }], returnType: "object", returnDescription: "API response." },
|
|
86
|
-
getUVIndex: { description: "getUVIndex", parameters: [{ name: "input", dataType: "string", description: "Input parameter", formInputType: "text", required: false }], returnType: "object", returnDescription: "API response." },
|
|
87
|
-
getWeatherByZip: { description: "getWeatherByZip", parameters: [{ name: "input", dataType: "string", description: "Input parameter", formInputType: "text", required: false }], returnType: "object", returnDescription: "API response." },
|
|
88
|
-
getHistoricalWeather: { description: "getHistoricalWeather", parameters: [{ name: "input", dataType: "string", description: "Input parameter", formInputType: "text", required: false }], returnType: "object", returnDescription: "API response." },
|
|
89
|
-
getWeatherAlerts: { description: "getWeatherAlerts", parameters: [{ name: "input", dataType: "string", description: "Input parameter", formInputType: "text", required: false }], returnType: "object", returnDescription: "API response." },
|
|
90
|
-
geocodeCity: { description: "geocodeCity", parameters: [{ name: "input", dataType: "string", description: "Input parameter", formInputType: "text", required: false }], returnType: "object", returnDescription: "API response." },
|
|
91
|
-
reverseGeocode: { description: "reverseGeocode", parameters: [{ name: "input", dataType: "string", description: "Input parameter", formInputType: "text", required: false }], returnType: "object", returnDescription: "API response." },
|
|
92
|
-
getWeatherMap: { description: "getWeatherMap", parameters: [{ name: "input", dataType: "string", description: "Input parameter", formInputType: "text", required: false }], returnType: "object", returnDescription: "API response." },
|
|
93
|
-
};
|
|
94
|
-
export const WeatherModuleMetadata = {
|
|
95
|
-
description: "Weather data via OpenWeatherMap — current conditions, forecasts, and alerts.",
|
|
96
|
-
methods: Object.keys(WeatherFunctions),
|
|
97
|
-
category: "utility",
|
|
98
|
-
};
|
|
99
|
-
//# sourceMappingURL=weather.js.map
|
package/dist/weather.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"weather.js","sourceRoot":"","sources":["../src/weather.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEzC,SAAS,SAAS,CAAC,GAAW;IAC5B,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,CAAC,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,aAAa,GAAG,sDAAsD,CAAC,CAAC;IAClG,OAAO,GAAG,CAAC;AACb,CAAC;AAED,KAAK,UAAU,OAAO,CAAC,IAAY,EAAE,MAAM,GAAG,KAAK,EAAE,IAAc;IACjE,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,0CAA0C,IAAI,EAAE,EAAE;QACxE,MAAM;QACN,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;QAC/C,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;KAC9C,CAAC,C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