@sprucelabs/sprucebot-node
Advanced tools
Comparing version 6.70.11 to 7.0.0
@@ -6,11 +6,14 @@ # Change Log | ||
<a name="6.70.11"></a> | ||
## [6.70.11](https://github.com/sprucelabsai/workspace.sprucebot-skills-kit/compare/v6.70.10...v6.70.11) (2018-09-16) | ||
# [7.0.0](https://github.com/sprucelabsai/workspace.sprucebot-skills-kit/compare/v6.70.10...v7.0.0) (2018-09-16) | ||
**Note:** Version bump only for package @sprucelabs/sprucebot-node | ||
### Features | ||
* event contracts optional ([710bd1e](https://github.com/sprucelabsai/workspace.sprucebot-skills-kit/commit/710bd1e)) | ||
* send version information to api on skill boot ([384ae74](https://github.com/sprucelabsai/workspace.sprucebot-skills-kit/commit/384ae74)) | ||
<a name="6.70.10"></a> | ||
@@ -17,0 +20,0 @@ ## [6.70.10](https://github.com/sprucelabsai/workspace.sprucebot-skills-kit/compare/v6.70.9...v6.70.10) (2018-09-16) |
const url = require('../utilities/url') | ||
const https = require('https') | ||
var debug = require('debug')('sprucebot-node') | ||
var debug = require('debug')('@sprucelabs/sprucebot-node') | ||
@@ -5,0 +5,0 @@ module.exports = class Https { |
22
index.js
@@ -13,2 +13,8 @@ const Https = require('./https') | ||
function suggested(name) { | ||
console.log( | ||
`⚠️ Missing key in Sprucebot() constructor. Check your server.js and environment variables: ${eventContract}` | ||
) | ||
} | ||
class Sprucebot { | ||
@@ -26,3 +32,5 @@ constructor({ | ||
dbEnabled = false, | ||
eventContract = required('eventContract') | ||
eventContract = suggested('eventContract'), | ||
version = 'unknown', | ||
skillsKitVersion = 'unknown' | ||
}) { | ||
@@ -42,6 +50,8 @@ const hostMatches = host.match(/^(https?\:\/\/|)([^\/:?#]+)(?:[\/:?#]|$)/i) | ||
this.dbEnabled = dbEnabled | ||
this.eventContract = eventContract | ||
this.eventContract = eventContract || { events: {} } | ||
this._mutexes = {} | ||
this.version = '1.0' // maybe pull from package.json? | ||
this.version = version // skill version | ||
this.skillsKitVersion = skillsKitVersion // skills kit version | ||
this.apiVersion = '1.0' // maybe pull from package.json? | ||
@@ -53,3 +63,3 @@ // Setup http(s) class with everything it needs to talk to api | ||
id, | ||
version: this.version, | ||
version: this.apiVersion, | ||
allowSelfSignedCerts | ||
@@ -82,3 +92,5 @@ }) | ||
publicUrl: this.publicUrl, | ||
eventContract: this.eventContract | ||
eventContract: this.eventContract, | ||
version: this.version, | ||
skillsKitVersion: this.skillsKitVersion | ||
} | ||
@@ -85,0 +97,0 @@ const results = await this.https.patch('/', data) |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "6.70.11", | ||
"version": "7.0.0", | ||
"description": "Jam with the Sprucebot API in your favorite scripting language. 🤓", | ||
@@ -42,3 +42,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "51991585b831ad9e621ac24a201026c7d1beda76" | ||
"gitHead": "a1f0e09b86a57aab1c38bb06ba34bf43e5630b33" | ||
} |
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
387189
34
8365