wlbot 1.1.0 → 1.1.2
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/commands/config.js
CHANGED
|
@@ -5,14 +5,14 @@ export default (options) => {
|
|
|
5
5
|
const spinner = !options.raw ? ora('Reading Environment Variables').start() : undefined;
|
|
6
6
|
|
|
7
7
|
let evValues = {
|
|
8
|
-
"WEATHER_LINK_API_KEY": process.env.WEATHER_LINK_API_KEY,
|
|
9
|
-
"WEATHER_LINK_API_SECRET": process.env.WEATHER_LINK_API_SECRET,
|
|
10
|
-
"WEATHER_LINK_BASE_API_URL": process.env.WEATHER_LINK_BASE_API_URL,
|
|
8
|
+
"WEATHER_LINK_API_KEY": process.env.WEATHER_LINK_API_KEY || "",
|
|
9
|
+
"WEATHER_LINK_API_SECRET": process.env.WEATHER_LINK_API_SECRET || "",
|
|
10
|
+
"WEATHER_LINK_BASE_API_URL": process.env.WEATHER_LINK_BASE_API_URL || "",
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
if (!options.list) {
|
|
14
14
|
for (const [key, value] of Object.entries(evValues)) {
|
|
15
|
-
evValues[key] = evValues[key].slice(0, 3) + "*".repeat(value.length - evValues[key].slice(0, 3).length)
|
|
15
|
+
evValues[key] = evValues[key].slice(0, 3) + "*".repeat(value.length - evValues[key].slice(0, 3).length);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -9,6 +9,10 @@ export default (options) => {
|
|
|
9
9
|
|
|
10
10
|
const envVars = checkForRequired(["WEATHER_LINK_API_KEY", "WEATHER_LINK_API_SECRET", "WEATHER_LINK_BASE_API_URL"])
|
|
11
11
|
if (!envVars.exist) {
|
|
12
|
+
if (spinner) {
|
|
13
|
+
spinner.fail('Failed to Retrieve Catalog')
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
return console.log(`${chalk.red.bold(`Missing Environment Variable(s):`)} ${envVars.missing.join(", ")}`);
|
|
13
17
|
}
|
|
14
18
|
|
|
@@ -9,6 +9,10 @@ export default (options) => {
|
|
|
9
9
|
|
|
10
10
|
const envVars = checkForRequired(["WEATHER_LINK_API_KEY", "WEATHER_LINK_API_SECRET", "WEATHER_LINK_BASE_API_URL"])
|
|
11
11
|
if (!envVars.exist) {
|
|
12
|
+
if (spinner) {
|
|
13
|
+
spinner.fail('Failed to Retrieve Stations')
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
return console.log(`${chalk.red.bold(`Missing Environment Variable(s):`)} ${envVars.missing.join(", ")}`);
|
|
13
17
|
}
|
|
14
18
|
|
|
@@ -9,6 +9,10 @@ export default (stationIds, options) => {
|
|
|
9
9
|
|
|
10
10
|
const envVars = checkForRequired(["WEATHER_LINK_API_KEY", "WEATHER_LINK_API_SECRET", "WEATHER_LINK_BASE_API_URL"])
|
|
11
11
|
if (!envVars.exist) {
|
|
12
|
+
if (spinner) {
|
|
13
|
+
spinner.fail('Failed to Retrieve Stations')
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
return console.log(`${chalk.red.bold(`Missing Environment Variable(s):`)} ${envVars.missing.join(", ")}`);
|
|
13
17
|
}
|
|
14
18
|
|
|
@@ -9,6 +9,10 @@ export default (stationId, options) => {
|
|
|
9
9
|
|
|
10
10
|
const envVars = checkForRequired(["WEATHER_LINK_API_KEY", "WEATHER_LINK_API_SECRET", "WEATHER_LINK_BASE_API_URL"])
|
|
11
11
|
if (!envVars.exist) {
|
|
12
|
+
if (spinner) {
|
|
13
|
+
spinner.fail('Failed to Retrieve Current Weather Data')
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
return console.log(`${chalk.red.bold(`Missing Environment Variable(s):`)} ${envVars.missing.join(", ")}`);
|
|
13
17
|
}
|
|
14
18
|
|
|
@@ -9,6 +9,10 @@ export default (stationId, startTimestamp, endTimestamp, options) => {
|
|
|
9
9
|
|
|
10
10
|
const envVars = checkForRequired(["WEATHER_LINK_API_KEY", "WEATHER_LINK_API_SECRET", "WEATHER_LINK_BASE_API_URL"])
|
|
11
11
|
if (!envVars.exist) {
|
|
12
|
+
if (spinner) {
|
|
13
|
+
spinner.fail('Failed to Retrieve Historic Weather Data')
|
|
14
|
+
}
|
|
15
|
+
|
|
12
16
|
return console.log(`${chalk.red.bold(`Missing Environment Variable(s):`)} ${envVars.missing.join(", ")}`);
|
|
13
17
|
}
|
|
14
18
|
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wlbot",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "A CLI for the WeatherLink Live API.",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"Davis Instruments",
|
|
7
|
-
"WeatherLink v2 API",
|
|
8
|
-
"WeatherLink API",
|
|
6
|
+
"Davis Instruments",
|
|
7
|
+
"WeatherLink v2 API",
|
|
8
|
+
"WeatherLink API",
|
|
9
9
|
"Weather Link API CLI",
|
|
10
10
|
"WeatherLink",
|
|
11
11
|
"WeatherLink CLI",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"author": {
|
|
21
|
-
"name": "Michael Weiner",
|
|
21
|
+
"name": "Michael Weiner",
|
|
22
22
|
"email": "michael.weiner@hey.com",
|
|
23
23
|
"url": "https://michaelweiner.org"
|
|
24
24
|
},
|