Skip to content

Commit 7e6be97

Browse files
authored
Merge pull request #24 from myDevicesIoT/feat/hermes-blacklist-endpoints
feat: exposing Hermes blacklist endpoints for gdpr issue
2 parents 3c9e9b1 + 28394ce commit 7e6be97

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

lib/Services/hermes.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,39 @@ class Hermes extends Request {
4949
return this.send('POST', path, { query });
5050
}
5151

52+
/**
53+
* @param {Object} payload Hermes payload to send
54+
* @param {string} payload.type Type: 'accountId', 'applicationId', 'recipient'
55+
* @param {string} payload.value either one from: user account id, application id, or recipient: email/phone
56+
*/
57+
createBlacklist(payload) {
58+
const path = `/blacklist`;
59+
return this.send('POST', path, { payload });
60+
}
61+
62+
/**
63+
* @param {Object} payload Hermes payload to send
64+
* @param {string} payload.params.query Hermes query to send
65+
* @param {number} payload.params.query.limit Optional, default is 10
66+
* @param {string} payload.params.query.order_dir Optional one of: 'asc', 'desc'
67+
* @param {string} payload.params.query.type 'accountId', 'applicationId', 'recipient'
68+
* @param {string} payload.params.query.value either one from: user account id, application id, or recipient: email/phone
69+
*/
70+
getBlacklistEntries(params) {
71+
const path = `/blacklist/entries`;
72+
return this.send('GET', path, params);
73+
}
74+
75+
/**
76+
* Deletes the blacklist entry
77+
*
78+
* @param {string} id
79+
*/
80+
deleteBlacklistEntry(id) {
81+
const path = `/blacklist/${id}`;
82+
return this.send('DELETE', path);
83+
}
84+
5285
/**
5386
* Gets notification logs
5487
* @param {string} applicationId

0 commit comments

Comments
 (0)