Comparing version 3.1.5 to 3.2.0
@@ -45,10 +45,2 @@ <a name="BaseBot"></a> | ||
**Example** | ||
```js | ||
// In general however, one can instantiate a bot object like this: | ||
const bot = new BaseBotSubClass({ // e.g. MessengerBot | ||
credentials: <my_base_bot_sub_class_credentials>, | ||
webhookEnpoint: 'someEndpoint' // only if class requires them | ||
}) | ||
``` | ||
<a name="BaseBot+createOutgoingMessage"></a> | ||
@@ -64,3 +56,3 @@ | ||
**Kind**: instance method of <code>[BaseBot](#BaseBot)</code> | ||
**Kind**: instance method of [<code>BaseBot</code>](#BaseBot) | ||
**Returns**: <code>OutgoingMessage</code> - outgoingMessage. The same object passed in with | ||
@@ -82,3 +74,3 @@ all the helper functions from OutgoingMessage | ||
**Kind**: instance method of <code>[BaseBot](#BaseBot)</code> | ||
**Kind**: instance method of [<code>BaseBot</code>](#BaseBot) | ||
**Returns**: <code>OutgoingMessage</code> - outgoingMessage. A valid OutgoingMessage object with recipient set. | ||
@@ -97,3 +89,3 @@ | ||
**Kind**: instance method of <code>[BaseBot](#BaseBot)</code> | ||
**Kind**: instance method of [<code>BaseBot</code>](#BaseBot) | ||
**Returns**: <code>Promise</code> - promise that resolves with a body object (see example) | ||
@@ -134,3 +126,3 @@ | ||
**Kind**: instance method of <code>[BaseBot](#BaseBot)</code> | ||
**Kind**: instance method of [<code>BaseBot</code>](#BaseBot) | ||
**Returns**: <code>Promise</code> - promise that resolves with a body object | ||
@@ -161,3 +153,3 @@ (see `sendMessage` example) | ||
**Kind**: instance method of <code>[BaseBot](#BaseBot)</code> | ||
**Kind**: instance method of [<code>BaseBot</code>](#BaseBot) | ||
**Returns**: <code>Promise</code> - promise that resolves with a body object | ||
@@ -183,3 +175,3 @@ (see `sendMessage` example) | ||
**Kind**: instance method of <code>[BaseBot](#BaseBot)</code> | ||
**Kind**: instance method of [<code>BaseBot</code>](#BaseBot) | ||
**Returns**: <code>Promise</code> - promise that resolves with a body object | ||
@@ -204,3 +196,3 @@ (see `sendMessage` example) | ||
**Kind**: instance method of <code>[BaseBot](#BaseBot)</code> | ||
**Kind**: instance method of [<code>BaseBot</code>](#BaseBot) | ||
**Returns**: <code>Promise</code> - promise that resolves with a body object | ||
@@ -233,3 +225,3 @@ (see `sendMessage` example) | ||
**Kind**: instance method of <code>[BaseBot](#BaseBot)</code> | ||
**Kind**: instance method of [<code>BaseBot</code>](#BaseBot) | ||
**Returns**: <code>Promise</code> - promise that resolves with a body object | ||
@@ -256,3 +248,3 @@ (see `sendMessage` example) | ||
**Kind**: instance method of <code>[BaseBot](#BaseBot)</code> | ||
**Kind**: instance method of [<code>BaseBot</code>](#BaseBot) | ||
**Returns**: <code>Promise</code> - promise that resolves with a body object | ||
@@ -280,3 +272,3 @@ (see `sendMessage` example) | ||
**Kind**: instance method of <code>[BaseBot](#BaseBot)</code> | ||
**Kind**: instance method of [<code>BaseBot</code>](#BaseBot) | ||
**Returns**: <code>Promise</code> - promise that resolves with a body object | ||
@@ -301,3 +293,3 @@ (see `sendMessage` example) | ||
**Kind**: instance method of <code>[BaseBot](#BaseBot)</code> | ||
**Kind**: instance method of [<code>BaseBot</code>](#BaseBot) | ||
**Returns**: <code>Promise</code> - promise that resolves with an array of body objects | ||
@@ -332,3 +324,3 @@ (see `sendMessage` example for one said object) | ||
**Kind**: instance method of <code>[BaseBot](#BaseBot)</code> | ||
**Kind**: instance method of [<code>BaseBot</code>](#BaseBot) | ||
**Returns**: <code>Promise</code> - promise that resolves with an array of body objects | ||
@@ -355,3 +347,3 @@ (see `sendMessage` example for one said object) | ||
**Kind**: instance method of <code>[BaseBot](#BaseBot)</code> | ||
**Kind**: instance method of [<code>BaseBot</code>](#BaseBot) | ||
**Returns**: <code>Promise</code> - promise | ||
@@ -368,3 +360,3 @@ | ||
**Kind**: instance method of <code>[BaseBot](#BaseBot)</code> | ||
**Kind**: instance method of [<code>BaseBot</code>](#BaseBot) | ||
**Returns**: <code>Promise</code> - promise that resolves into the user info or an empty | ||
@@ -387,3 +379,3 @@ object by default | ||
**Kind**: static method of <code>[BaseBot](#BaseBot)</code> | ||
**Kind**: static method of [<code>BaseBot</code>](#BaseBot) | ||
**Returns**: <code>OutgoingMessage</code> - outgoingMessage. The same object passed in with | ||
@@ -405,3 +397,3 @@ all the helper functions from OutgoingMessage | ||
**Kind**: static method of <code>[BaseBot](#BaseBot)</code> | ||
**Kind**: static method of [<code>BaseBot</code>](#BaseBot) | ||
**Returns**: <code>OutgoingMessage</code> - outgoingMessage. A valid OutgoingMessage object with recipient set. | ||
@@ -408,0 +400,0 @@ |
@@ -10,8 +10,8 @@ <a name="Botmaster"></a> | ||
* [new Botmaster(settings)](#new_Botmaster_new) | ||
* [.addBot(bot)](#Botmaster+addBot) ⇒ <code>[Botmaster](#Botmaster)</code> | ||
* [.addBot(bot)](#Botmaster+addBot) ⇒ [<code>Botmaster</code>](#Botmaster) | ||
* [.getBot(options)](#Botmaster+getBot) ⇒ <code>BaseBot</code> | ||
* [.getBots(botType)](#Botmaster+getBots) ⇒ <code>Array</code> | ||
* [.removeBot(bot)](#Botmaster+removeBot) ⇒ <code>[Botmaster](#Botmaster)</code> | ||
* [.use(middleware)](#Botmaster+use) ⇒ <code>[Botmaster](#Botmaster)</code> | ||
* [.useWrapped(incomingMiddleware, outgoingMiddleware)](#Botmaster+useWrapped) ⇒ <code>[Botmaster](#Botmaster)</code> | ||
* [.removeBot(bot)](#Botmaster+removeBot) ⇒ [<code>Botmaster</code>](#Botmaster) | ||
* [.use(middleware)](#Botmaster+use) ⇒ [<code>Botmaster</code>](#Botmaster) | ||
* [.useWrapped(incomingMiddleware, outgoingMiddleware)](#Botmaster+useWrapped) ⇒ [<code>Botmaster</code>](#Botmaster) | ||
@@ -29,26 +29,9 @@ <a name="new_Botmaster_new"></a> | ||
**Example** | ||
```js | ||
// attach the botmaster generated server to port 5000 rather than the default 3000 | ||
const botmaster = new Botmaster({ | ||
port: 5000, | ||
}); | ||
``` | ||
**Example** | ||
```js | ||
const http = require('http'); | ||
const myServer = http.createServer() | ||
// use my own server rather than letting botmaster creat its own. | ||
const botmaster = new Botmaster({ | ||
server: myServer, | ||
}); | ||
``` | ||
<a name="Botmaster+addBot"></a> | ||
### botmaster.addBot(bot) ⇒ <code>[Botmaster](#Botmaster)</code> | ||
### botmaster.addBot(bot) ⇒ [<code>Botmaster</code>](#Botmaster) | ||
Add an existing bot to this instance of Botmaster | ||
**Kind**: instance method of <code>[Botmaster](#Botmaster)</code> | ||
**Returns**: <code>[Botmaster](#Botmaster)</code> - returns the botmaster object for chaining | ||
**Kind**: instance method of [<code>Botmaster</code>](#Botmaster) | ||
**Returns**: [<code>Botmaster</code>](#Botmaster) - returns the botmaster object for chaining | ||
@@ -64,3 +47,3 @@ | Param | Type | Description | | ||
**Kind**: instance method of <code>[Botmaster](#Botmaster)</code> | ||
**Kind**: instance method of [<code>Botmaster</code>](#Botmaster) | ||
**Returns**: <code>BaseBot</code> - The bot found of a class that inherits of BaseBot | ||
@@ -77,3 +60,3 @@ | ||
**Kind**: instance method of <code>[Botmaster](#Botmaster)</code> | ||
**Kind**: instance method of [<code>Botmaster</code>](#Botmaster) | ||
**Returns**: <code>Array</code> - Array of bots found | ||
@@ -87,7 +70,7 @@ | ||
### botmaster.removeBot(bot) ⇒ <code>[Botmaster](#Botmaster)</code> | ||
### botmaster.removeBot(bot) ⇒ [<code>Botmaster</code>](#Botmaster) | ||
Remove an existing bot from this instance of Botmaster | ||
**Kind**: instance method of <code>[Botmaster](#Botmaster)</code> | ||
**Returns**: <code>[Botmaster](#Botmaster)</code> - returns the botmaster object for chaining | ||
**Kind**: instance method of [<code>Botmaster</code>](#Botmaster) | ||
**Returns**: [<code>Botmaster</code>](#Botmaster) - returns the botmaster object for chaining | ||
@@ -100,8 +83,8 @@ | Param | Type | | ||
### botmaster.use(middleware) ⇒ <code>[Botmaster](#Botmaster)</code> | ||
### botmaster.use(middleware) ⇒ [<code>Botmaster</code>](#Botmaster) | ||
Add middleware to this botmaster object | ||
This function is just sugar for `middleware.__use` in them | ||
**Kind**: instance method of <code>[Botmaster](#Botmaster)</code> | ||
**Returns**: <code>[Botmaster](#Botmaster)</code> - returns the botmaster object so you can chain middleware | ||
**Kind**: instance method of [<code>Botmaster</code>](#Botmaster) | ||
**Returns**: [<code>Botmaster</code>](#Botmaster) - returns the botmaster object so you can chain middleware | ||
@@ -140,3 +123,3 @@ | Param | Type | | ||
### botmaster.useWrapped(incomingMiddleware, outgoingMiddleware) ⇒ <code>[Botmaster](#Botmaster)</code> | ||
### botmaster.useWrapped(incomingMiddleware, outgoingMiddleware) ⇒ [<code>Botmaster</code>](#Botmaster) | ||
Add wrapped middleware to this botmaster instance. Wrapped middleware | ||
@@ -147,4 +130,4 @@ places the incoming middleware at beginning of incoming stack and | ||
**Kind**: instance method of <code>[Botmaster](#Botmaster)</code> | ||
**Returns**: <code>[Botmaster](#Botmaster)</code> - returns the botmaster object so you can chain middleware | ||
**Kind**: instance method of [<code>Botmaster</code>](#Botmaster) | ||
**Returns**: [<code>Botmaster</code>](#Botmaster) - returns the botmaster object so you can chain middleware | ||
@@ -151,0 +134,0 @@ | Param | Type | Description | |
@@ -52,3 +52,3 @@ <a name="OutgoingMessage"></a> | ||
**Kind**: instance method of <code>[OutgoingMessage](#OutgoingMessage)</code> | ||
**Kind**: instance method of [<code>OutgoingMessage</code>](#OutgoingMessage) | ||
**Returns**: <code>OutgoinMessage</code> - returns this object to allow for chaining of methods. | ||
@@ -67,3 +67,3 @@ | ||
**Kind**: instance method of <code>[OutgoingMessage](#OutgoingMessage)</code> | ||
**Kind**: instance method of [<code>OutgoingMessage</code>](#OutgoingMessage) | ||
**Returns**: <code>OutgoinMessage</code> - returns this object to allow for chaining of methods. | ||
@@ -81,3 +81,3 @@ | ||
**Kind**: instance method of <code>[OutgoingMessage](#OutgoingMessage)</code> | ||
**Kind**: instance method of [<code>OutgoingMessage</code>](#OutgoingMessage) | ||
**Returns**: <code>OutgoinMessage</code> - returns this object to allow for chaining of methods. | ||
@@ -89,3 +89,3 @@ <a name="OutgoingMessage+addText"></a> | ||
**Kind**: instance method of <code>[OutgoingMessage](#OutgoingMessage)</code> | ||
**Kind**: instance method of [<code>OutgoingMessage</code>](#OutgoingMessage) | ||
**Returns**: <code>OutgoinMessage</code> - returns this object to allow for chaining of methods. | ||
@@ -102,3 +102,3 @@ | ||
**Kind**: instance method of <code>[OutgoingMessage](#OutgoingMessage)</code> | ||
**Kind**: instance method of [<code>OutgoingMessage</code>](#OutgoingMessage) | ||
**Returns**: <code>OutgoinMessage</code> - returns this object to allow for chaining of methods. | ||
@@ -112,3 +112,3 @@ <a name="OutgoingMessage+addAttachment"></a> | ||
**Kind**: instance method of <code>[OutgoingMessage](#OutgoingMessage)</code> | ||
**Kind**: instance method of [<code>OutgoingMessage</code>](#OutgoingMessage) | ||
**Returns**: <code>OutgoinMessage</code> - returns this object to allow for chaining of methods. | ||
@@ -127,3 +127,3 @@ | ||
**Kind**: instance method of <code>[OutgoingMessage](#OutgoingMessage)</code> | ||
**Kind**: instance method of [<code>OutgoingMessage</code>](#OutgoingMessage) | ||
**Returns**: <code>OutgoinMessage</code> - returns this object to allow for chaining of methods. | ||
@@ -141,3 +141,3 @@ | ||
**Kind**: instance method of <code>[OutgoingMessage](#OutgoingMessage)</code> | ||
**Kind**: instance method of [<code>OutgoingMessage</code>](#OutgoingMessage) | ||
**Returns**: <code>OutgoinMessage</code> - returns this object to allow for chaining of methods. | ||
@@ -151,3 +151,3 @@ <a name="OutgoingMessage+addQuickReplies"></a> | ||
**Kind**: instance method of <code>[OutgoingMessage](#OutgoingMessage)</code> | ||
**Kind**: instance method of [<code>OutgoingMessage</code>](#OutgoingMessage) | ||
**Returns**: <code>OutgoinMessage</code> - returns this object to allow for chaining of methods. | ||
@@ -166,3 +166,3 @@ | ||
**Kind**: instance method of <code>[OutgoingMessage](#OutgoingMessage)</code> | ||
**Kind**: instance method of [<code>OutgoingMessage</code>](#OutgoingMessage) | ||
**Returns**: <code>OutgoinMessage</code> - returns this object to allow for chaining of methods. | ||
@@ -181,3 +181,3 @@ | ||
**Kind**: instance method of <code>[OutgoingMessage](#OutgoingMessage)</code> | ||
**Kind**: instance method of [<code>OutgoingMessage</code>](#OutgoingMessage) | ||
**Returns**: <code>OutgoinMessage</code> - returns this object to allow for chaining of methods. | ||
@@ -189,3 +189,3 @@ <a name="OutgoingMessage+removeQuickReplies"></a> | ||
**Kind**: instance method of <code>[OutgoingMessage](#OutgoingMessage)</code> | ||
**Kind**: instance method of [<code>OutgoingMessage</code>](#OutgoingMessage) | ||
**Returns**: <code>OutgoinMessage</code> - returns this object to allow for chaining of methods. | ||
@@ -197,3 +197,3 @@ <a name="OutgoingMessage+addSenderAction"></a> | ||
**Kind**: instance method of <code>[OutgoingMessage](#OutgoingMessage)</code> | ||
**Kind**: instance method of [<code>OutgoingMessage</code>](#OutgoingMessage) | ||
**Returns**: <code>OutgoinMessage</code> - returns this object to allow for chaining of methods. | ||
@@ -210,3 +210,3 @@ | ||
**Kind**: instance method of <code>[OutgoingMessage](#OutgoingMessage)</code> | ||
**Kind**: instance method of [<code>OutgoingMessage</code>](#OutgoingMessage) | ||
**Returns**: <code>OutgoinMessage</code> - returns this object to allow for chaining of methods. | ||
@@ -218,3 +218,3 @@ <a name="OutgoingMessage+addTypingOffSenderAction"></a> | ||
**Kind**: instance method of <code>[OutgoingMessage](#OutgoingMessage)</code> | ||
**Kind**: instance method of [<code>OutgoingMessage</code>](#OutgoingMessage) | ||
**Returns**: <code>OutgoinMessage</code> - returns this object to allow for chaining of methods. | ||
@@ -226,3 +226,3 @@ <a name="OutgoingMessage+addMarkSeenSenderAction"></a> | ||
**Kind**: instance method of <code>[OutgoingMessage](#OutgoingMessage)</code> | ||
**Kind**: instance method of [<code>OutgoingMessage</code>](#OutgoingMessage) | ||
**Returns**: <code>OutgoinMessage</code> - returns this object to allow for chaining of methods. | ||
@@ -234,3 +234,3 @@ <a name="OutgoingMessage+removeSenderAction"></a> | ||
**Kind**: instance method of <code>[OutgoingMessage](#OutgoingMessage)</code> | ||
**Kind**: instance method of [<code>OutgoingMessage</code>](#OutgoingMessage) | ||
**Returns**: <code>OutgoinMessage</code> - returns this object to allow for chaining of methods. |
{ | ||
"name": "botmaster", | ||
"version": "3.1.5", | ||
"version": "3.2.0", | ||
"description": "Framework allowing developers to write bots that are agnostic with respect to the channel used by their users (messenger, telegram etc...)", | ||
@@ -65,20 +65,20 @@ "main": "./lib/index.js", | ||
"engines": { | ||
"node": ">=4.x.x <13.0.0" | ||
"node": "4.x.x || >=6.x.x" | ||
}, | ||
"devDependencies": { | ||
"ava": "^0.19.1", | ||
"body-parser": "^1.17.1", | ||
"body-parser": "^1.18.2", | ||
"botmaster-test-fixtures": "^2.1.0", | ||
"coveralls": "^2.13.1", | ||
"eslint": "^3.19.0", | ||
"eslint-config-airbnb": "^15.0.0", | ||
"eslint-plugin-ava": "^4.2.0", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-jsx-a11y": "^5.0.3", | ||
"eslint-plugin-react": "^7.0.1", | ||
"express": "^4.15.2", | ||
"jsdoc-to-markdown": "^3.0.0", | ||
"koa": "2.0.1", | ||
"nyc": "^10.3.2", | ||
"request-promise": "^4.2.1" | ||
"coveralls": "^3.0.0", | ||
"eslint": "^4.16.0", | ||
"eslint-config-airbnb": "^16.1.0", | ||
"eslint-plugin-ava": "^4.5.0", | ||
"eslint-plugin-import": "^2.8.0", | ||
"eslint-plugin-jsx-a11y": "^6.0.3", | ||
"eslint-plugin-react": "^7.6.0", | ||
"express": "^4.16.2", | ||
"jsdoc-to-markdown": "^4.0.1", | ||
"koa": "^2.4.1", | ||
"nyc": "^11.4.1", | ||
"request-promise": "^4.2.2" | ||
}, | ||
@@ -85,0 +85,0 @@ "author": "JD Wuarin <jwuarin@uk.ibm.com>", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
252961