@docbrasil/api-systemmanager 1.1.32 → 1.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/user/notification.js +6 -11
- package/package.json +1 -1
package/api/user/notification.js
CHANGED
|
@@ -62,10 +62,8 @@ class Notification {
|
|
|
62
62
|
* @author Myndware <augusto.pissarra@myndware.com>
|
|
63
63
|
* @description Method to add a notification token
|
|
64
64
|
* @param {object} params Params to add notification token
|
|
65
|
-
* @param {obhect} params.token The token
|
|
66
|
-
* @param {object} params.
|
|
67
|
-
* @param {object} params.token.type The token type
|
|
68
|
-
* @param {object} params.token.data The extra data of a token, if there is.
|
|
65
|
+
* @param {obhect} params.token The token value
|
|
66
|
+
* @param {object} params.type The token type
|
|
69
67
|
* @param {string} session Is token JWT of user NOT allow SU
|
|
70
68
|
* @returns {promise<object>} data
|
|
71
69
|
* @returns {boolean} data._id the id of the added token
|
|
@@ -76,10 +74,8 @@ class Notification {
|
|
|
76
74
|
* const api = new API();
|
|
77
75
|
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
78
76
|
* const params = {
|
|
79
|
-
* token:
|
|
80
|
-
*
|
|
81
|
-
* type: 'FCM_CAPACITOR'
|
|
82
|
-
* }
|
|
77
|
+
* token: 'V6OSBr4aEVoiE9H1b4xzLe+vqmXB+ShVNc/FvJGxnIz4tZv6jBJkk4aQzz2',
|
|
78
|
+
* type: 'FCM_CAPACITOR'
|
|
83
79
|
* };
|
|
84
80
|
* const retData = await api.user.notification.addToken(params, session);
|
|
85
81
|
*/
|
|
@@ -88,9 +84,8 @@ class Notification {
|
|
|
88
84
|
|
|
89
85
|
try {
|
|
90
86
|
Joi.assert(params, Joi.object().required(), 'Params to get task');
|
|
91
|
-
Joi.assert(params.token, Joi.
|
|
92
|
-
Joi.assert(params.
|
|
93
|
-
Joi.assert(params.token.type, Joi.string().required(), 'The type of the token');
|
|
87
|
+
Joi.assert(params.token, Joi.string().required(), 'Token token value');
|
|
88
|
+
Joi.assert(params.type, Joi.string().required(), 'The type of the token');
|
|
94
89
|
|
|
95
90
|
const apiCall = self._client
|
|
96
91
|
.put(`/notifications/token`, params, self._setHeader(session));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docbrasil/api-systemmanager",
|
|
3
3
|
"description": "Module API System Manager",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.33",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"htmldoc": "rm -rf docs && jsdoc api/** -d docs -t ./node_modules/better-docs",
|
|
7
7
|
"doc": "rm -rf doc && mkdir doc && jsdoc2md api/**/* api/* > doc/api.md",
|