Skip to content

Commit d443ca0

Browse files
danielJacobPlaster
authored andcommitted
lib/rest2.js add pulse new private method
1 parent a301b47 commit d443ca0

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

lib/rest2.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ const {
3535
Notification,
3636
Login,
3737
ChangeLog,
38-
PublicPulseProfile
38+
PublicPulseProfile,
39+
PulseMessage
3940
} = require('bfx-api-node-models')
4041

4142
const RESTv1 = require('./rest1')
@@ -1426,6 +1427,20 @@ class RESTv2 {
14261427
return this._makeAuthRequest('/auth/w/withdraw', params, cb)
14271428
.then(_takeResNotify)
14281429
}
1430+
1431+
/**
1432+
* @param {object} params - parameters
1433+
* @param {string} params.title - the title of your Pulse message
1434+
* @param {string} params.content - content of your Pulse message
1435+
* @param {number} params.isPublic - make Pulse message public
1436+
* @param {string} params.isPin - make Pulse message pinned
1437+
* @param {string} params.attachments - Base64 encoded list of strings
1438+
* @param {Function} [cb] - callback
1439+
* @returns {Promise} p
1440+
*/
1441+
addPulse (params, cb) {
1442+
return this._makeAuthRequest('/auth/w/pulse/add', params, cb, PulseMessage)
1443+
}
14291444
}
14301445

14311446
RESTv2.url = API_URL

0 commit comments

Comments
 (0)