@docbrasil/api-systemmanager 1.0.74 → 1.0.75

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.
@@ -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
@@ -9597,6 +9597,30 @@ class AdminNotification {
9597
9597
  };
9598
9598
  }
9599
9599
 
9600
+ /**
9601
+ * @description Send real time notification
9602
+ * @param {object} params Params to send notification
9603
+ * @param {string} params.userIds Users to send notification
9604
+ * @param {object} params.message Object with data to send user
9605
+ * @param {object} session Session, token JWT
9606
+ * @returns {Promise<*>}
9607
+ */
9608
+ async realTime(params, session) {
9609
+ const self = this;
9610
+
9611
+ try {
9612
+ Joi__default["default"].assert(params, Joi__default["default"].object().required(), 'Object with params to add notifications');
9613
+ Joi__default["default"].assert(params.userIds, Joi__default["default"].array().required(), 'OrgId of the user SU');
9614
+ Joi__default["default"].assert(params.message, Joi__default["default"].object().required(), 'Object with data to send user');
9615
+ Joi__default["default"].assert(session, Joi__default["default"].string().required(), 'Session, token JWT');
9616
+
9617
+ const apiCall = self.client.post(`/admin/send/notifications`, params, self._setHeader(session));
9618
+ return self._returnData(await apiCall);
9619
+ } catch (ex) {
9620
+ throw ex;
9621
+ }
9622
+ }
9623
+
9600
9624
  /**
9601
9625
  * @author CloudBrasil <abernardo.br@gmail.com>
9602
9626
  * @description Create notification