@docbrasil/api-systemmanager 1.0.83 → 1.0.84
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/admin/notification.js +24 -0
- package/dist/bundle.cjs +24 -0
- package/dist/bundle.mjs +1 -1
- package/package.json +1 -1
|
@@ -47,6 +47,30 @@ class AdminNotification {
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* @description Send real time notification
|
|
52
|
+
* @param {object} params Params to send notification
|
|
53
|
+
* @param {string} params.userIds Users to send notification
|
|
54
|
+
* @param {object} params.message Object with data to send user
|
|
55
|
+
* @param {object} session Session, token JWT
|
|
56
|
+
* @returns {Promise<*>}
|
|
57
|
+
*/
|
|
58
|
+
async realTime(params, session) {
|
|
59
|
+
const self = this;
|
|
60
|
+
|
|
61
|
+
try {
|
|
62
|
+
Joi.assert(params, Joi.object().required(), 'Object with params to add notifications');
|
|
63
|
+
Joi.assert(params.userIds, Joi.array().required(), 'OrgId of the user SU');
|
|
64
|
+
Joi.assert(params.message, Joi.object().required(), 'Object with data to send user');
|
|
65
|
+
Joi.assert(session, Joi.string().required(), 'Session, token JWT');
|
|
66
|
+
|
|
67
|
+
const apiCall = self.client.post(`/admin/send/notifications`, params, self._setHeader(session));
|
|
68
|
+
return self._returnData(await apiCall);
|
|
69
|
+
} catch (ex) {
|
|
70
|
+
throw ex;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
50
74
|
/**
|
|
51
75
|
* @author CloudBrasil <abernardo.br@gmail.com>
|
|
52
76
|
* @description Create notification
|
package/dist/bundle.cjs
CHANGED
|
@@ -9792,6 +9792,30 @@ class AdminNotification {
|
|
|
9792
9792
|
};
|
|
9793
9793
|
}
|
|
9794
9794
|
|
|
9795
|
+
/**
|
|
9796
|
+
* @description Send real time notification
|
|
9797
|
+
* @param {object} params Params to send notification
|
|
9798
|
+
* @param {string} params.userIds Users to send notification
|
|
9799
|
+
* @param {object} params.message Object with data to send user
|
|
9800
|
+
* @param {object} session Session, token JWT
|
|
9801
|
+
* @returns {Promise<*>}
|
|
9802
|
+
*/
|
|
9803
|
+
async realTime(params, session) {
|
|
9804
|
+
const self = this;
|
|
9805
|
+
|
|
9806
|
+
try {
|
|
9807
|
+
Joi__default["default"].assert(params, Joi__default["default"].object().required(), 'Object with params to add notifications');
|
|
9808
|
+
Joi__default["default"].assert(params.userIds, Joi__default["default"].array().required(), 'OrgId of the user SU');
|
|
9809
|
+
Joi__default["default"].assert(params.message, Joi__default["default"].object().required(), 'Object with data to send user');
|
|
9810
|
+
Joi__default["default"].assert(session, Joi__default["default"].string().required(), 'Session, token JWT');
|
|
9811
|
+
|
|
9812
|
+
const apiCall = self.client.post(`/admin/send/notifications`, params, self._setHeader(session));
|
|
9813
|
+
return self._returnData(await apiCall);
|
|
9814
|
+
} catch (ex) {
|
|
9815
|
+
throw ex;
|
|
9816
|
+
}
|
|
9817
|
+
}
|
|
9818
|
+
|
|
9795
9819
|
/**
|
|
9796
9820
|
* @author CloudBrasil <abernardo.br@gmail.com>
|
|
9797
9821
|
* @description Create notification
|