sprucebot-node
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -9,4 +9,8 @@ { | ||
"cSpell.words": [ | ||
"upsert" | ||
"POST'ing", | ||
"metas", | ||
"mutexes", | ||
"upsert", | ||
"webhook" | ||
] | ||
} |
@@ -9,3 +9,3 @@ const url = require('../utilities/url') | ||
throw new Error( | ||
'You gotta pass host, apiKey, id, and version to the Http constructor' | ||
'You gotta pass host, apiKey, id, and version to the Http constructor.' | ||
) | ||
@@ -12,0 +12,0 @@ } |
28
index.js
@@ -9,3 +9,3 @@ const Https = require('./https') | ||
throw new Error( | ||
`You are missing some params! Make sure you set ${name} properly` | ||
`You are missing some params! Make sure you set ${name} properly (maybe .env) 🤷🏼` | ||
) | ||
@@ -26,14 +26,20 @@ } | ||
}) { | ||
// Setup http(s) class with everything it needs to talk to api | ||
this.name = name | ||
this.description = description | ||
this.icon = svgIcon | ||
this.webhookUrl = serverUrl + '/hook.json' | ||
this.iframeUrl = interfaceUrl | ||
this.marketingUrl = interfaceUrl + '/marketing' | ||
const hostMatches = host.match(/^(https?\:\/\/|)([^\/:?#]+)(?:[\/:?#]|$)/i) | ||
const cleanedHost = | ||
hostMatches && hostMatches[1] ? hostMatches[2] : required('host') | ||
this.name = name || required('name') | ||
this.description = description || required('description') | ||
this.icon = svgIcon || required('svgIcon') | ||
this.webhookUrl = (serverUrl || required('serverUrl')) + '/hook.json' | ||
this.iframeUrl = interfaceUrl || required('interfaceUrl') | ||
this.marketingUrl = | ||
(interfaceUrl || required('interfaceUrl')) + '/marketing' | ||
this._mutexes = {} | ||
this.version = '1.0' | ||
this.version = '1.0' // maybe pull from package.json? | ||
// Setup http(s) class with everything it needs to talk to api | ||
this.https = new Https({ | ||
host, | ||
host: cleanedHost, | ||
apiKey, | ||
@@ -47,3 +53,3 @@ id, | ||
`🌲 Sprucebot🌲 Skills Kit API ${this | ||
.version}\n\nhost : ${host} \nid : ${id} \napiKey : ${apiKey.replace( | ||
.version}\n\nhost : ${cleanedHost} \nid : ${id} \napiKey : ${apiKey.replace( | ||
/./g, | ||
@@ -50,0 +56,0 @@ '*' |
{ | ||
"name": "sprucebot-node", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Jam with the Sprucebot API in your favorite scripting language. 🤓", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
129729
987