@docbrasil/api-systemmanager 1.1.32 → 1.1.34

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.
@@ -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.token.value The token value
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
- * value: 'V6OSBr4aEVoiE9H1b4xzLe+vqmXB+ShVNc/FvJGxnIz4tZv6jBJkk4aQzz2',
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.object().required(), 'Token information to add');
92
- Joi.assert(params.token.value, Joi.string().required(), 'Token token value');
93
- Joi.assert(params.token.type, Joi.string().required(), 'The type of the token');
87
+ Joi.assert(params.token, Joi.string().required(), '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/dist/bundle.cjs CHANGED
@@ -10384,10 +10384,8 @@ class Notification {
10384
10384
  * @author Myndware <augusto.pissarra@myndware.com>
10385
10385
  * @description Method to add a notification token
10386
10386
  * @param {object} params Params to add notification token
10387
- * @param {obhect} params.token The token
10388
- * @param {object} params.token.value The token value
10389
- * @param {object} params.token.type The token type
10390
- * @param {object} params.token.data The extra data of a token, if there is.
10387
+ * @param {obhect} params.token The token value
10388
+ * @param {object} params.type The token type
10391
10389
  * @param {string} session Is token JWT of user NOT allow SU
10392
10390
  * @returns {promise<object>} data
10393
10391
  * @returns {boolean} data._id the id of the added token
@@ -10398,10 +10396,8 @@ class Notification {
10398
10396
  * const api = new API();
10399
10397
  * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
10400
10398
  * const params = {
10401
- * token: {
10402
- * value: 'V6OSBr4aEVoiE9H1b4xzLe+vqmXB+ShVNc/FvJGxnIz4tZv6jBJkk4aQzz2',
10403
- * type: 'FCM_CAPACITOR'
10404
- * }
10399
+ * token: 'V6OSBr4aEVoiE9H1b4xzLe+vqmXB+ShVNc/FvJGxnIz4tZv6jBJkk4aQzz2',
10400
+ * type: 'FCM_CAPACITOR'
10405
10401
  * };
10406
10402
  * const retData = await api.user.notification.addToken(params, session);
10407
10403
  */
@@ -10410,9 +10406,8 @@ class Notification {
10410
10406
 
10411
10407
  try {
10412
10408
  Joi__default["default"].assert(params, Joi__default["default"].object().required(), 'Params to get task');
10413
- Joi__default["default"].assert(params.token, Joi__default["default"].object().required(), 'Token information to add');
10414
- Joi__default["default"].assert(params.token.value, Joi__default["default"].string().required(), 'Token token value');
10415
- Joi__default["default"].assert(params.token.type, Joi__default["default"].string().required(), 'The type of the token');
10409
+ Joi__default["default"].assert(params.token, Joi__default["default"].string().required(), 'Token value');
10410
+ Joi__default["default"].assert(params.type, Joi__default["default"].string().required(), 'The type of the token');
10416
10411
 
10417
10412
  const apiCall = self._client
10418
10413
  .put(`/notifications/token`, params, self._setHeader(session));