@docbrasil/api-systemmanager 1.0.115 → 1.0.117
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/.project +11 -0
- package/api/user/notification.js +124 -0
- package/dist/bundle.cjs +124 -0
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +94 -0
- package/package.json +1 -1
- package/.vscode/settings.json +0 -1
package/doc/api.md
CHANGED
|
@@ -1718,6 +1718,10 @@ Class for user registration in a user
|
|
|
1718
1718
|
* [Notification](#Notification)
|
|
1719
1719
|
* [.tokenTypes](#Notification+tokenTypes) ⇒ <code>Object</code>
|
|
1720
1720
|
* [.addToken(params, session)](#Notification+addToken) ⇒ <code>promise.<object></code> \| <code>boolean</code>
|
|
1721
|
+
* [.getNew(session)](#Notification+getNew)
|
|
1722
|
+
* [.getOld(session)](#Notification+getOld)
|
|
1723
|
+
* [.setRead(params, session)](#Notification+setRead) ⇒ <code>Promise</code>
|
|
1724
|
+
* [.setUnread(params, session)](#Notification+setUnread) ⇒ <code>Promise</code>
|
|
1721
1725
|
|
|
1722
1726
|
<a name="Notification+tokenTypes"></a>
|
|
1723
1727
|
|
|
@@ -1753,6 +1757,96 @@ const params = {
|
|
|
1753
1757
|
};
|
|
1754
1758
|
const retData = await api.user.notification.addToken(params, session);
|
|
1755
1759
|
```
|
|
1760
|
+
<a name="Notification+getNew"></a>
|
|
1761
|
+
|
|
1762
|
+
### notification.getNew(session)
|
|
1763
|
+
get new notifications
|
|
1764
|
+
|
|
1765
|
+
**Kind**: instance method of [<code>Notification</code>](#Notification)
|
|
1766
|
+
**Access**: public
|
|
1767
|
+
**Author**: Augusto Pissarra <abernardo.br@gmail.com>
|
|
1768
|
+
|
|
1769
|
+
| Param | Type | Description |
|
|
1770
|
+
| --- | --- | --- |
|
|
1771
|
+
| session | <code>string</code> | JWT token |
|
|
1772
|
+
|
|
1773
|
+
**Example**
|
|
1774
|
+
```js
|
|
1775
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
1776
|
+
const api = new API();
|
|
1777
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
1778
|
+
await api.user.notification.getNew(session);
|
|
1779
|
+
```
|
|
1780
|
+
<a name="Notification+getOld"></a>
|
|
1781
|
+
|
|
1782
|
+
### notification.getOld(session)
|
|
1783
|
+
get old notifications
|
|
1784
|
+
|
|
1785
|
+
**Kind**: instance method of [<code>Notification</code>](#Notification)
|
|
1786
|
+
**Access**: public
|
|
1787
|
+
**Author**: Augusto Pissarra <abernardo.br@gmail.com>
|
|
1788
|
+
|
|
1789
|
+
| Param | Type | Description |
|
|
1790
|
+
| --- | --- | --- |
|
|
1791
|
+
| session | <code>string</code> | JWT token |
|
|
1792
|
+
|
|
1793
|
+
**Example**
|
|
1794
|
+
```js
|
|
1795
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
1796
|
+
const api = new API();
|
|
1797
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
1798
|
+
await api.user.notification.getOld(session);
|
|
1799
|
+
```
|
|
1800
|
+
<a name="Notification+setRead"></a>
|
|
1801
|
+
|
|
1802
|
+
### notification.setRead(params, session) ⇒ <code>Promise</code>
|
|
1803
|
+
Set notification as readed
|
|
1804
|
+
|
|
1805
|
+
**Kind**: instance method of [<code>Notification</code>](#Notification)
|
|
1806
|
+
**Access**: public
|
|
1807
|
+
**Author**: CloudBrasil <abernardo.br@gmail.com>
|
|
1808
|
+
|
|
1809
|
+
| Param | Type | Description |
|
|
1810
|
+
| --- | --- | --- |
|
|
1811
|
+
| params | <code>object</code> | Params to update the notification |
|
|
1812
|
+
| params.id | <code>string</code> | Notification Id |
|
|
1813
|
+
| session | <code>string</code> | JWT Token |
|
|
1814
|
+
|
|
1815
|
+
**Example**
|
|
1816
|
+
```js
|
|
1817
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
1818
|
+
const api = new API();
|
|
1819
|
+
const params = {
|
|
1820
|
+
id: '34c344c43c34c344c43c'
|
|
1821
|
+
};
|
|
1822
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
1823
|
+
await api.user.notification.setRead(params, session);
|
|
1824
|
+
```
|
|
1825
|
+
<a name="Notification+setUnread"></a>
|
|
1826
|
+
|
|
1827
|
+
### notification.setUnread(params, session) ⇒ <code>Promise</code>
|
|
1828
|
+
Set notification as unreaded
|
|
1829
|
+
|
|
1830
|
+
**Kind**: instance method of [<code>Notification</code>](#Notification)
|
|
1831
|
+
**Access**: public
|
|
1832
|
+
**Author**: CloudBrasil <abernardo.br@gmail.com>
|
|
1833
|
+
|
|
1834
|
+
| Param | Type | Description |
|
|
1835
|
+
| --- | --- | --- |
|
|
1836
|
+
| params | <code>object</code> | Params to update the notification |
|
|
1837
|
+
| params.id | <code>string</code> | Notification Id |
|
|
1838
|
+
| session | <code>string</code> | JWT Token |
|
|
1839
|
+
|
|
1840
|
+
**Example**
|
|
1841
|
+
```js
|
|
1842
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
1843
|
+
const api = new API();
|
|
1844
|
+
const params = {
|
|
1845
|
+
id: '34c344c43c34c344c43c'
|
|
1846
|
+
};
|
|
1847
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
1848
|
+
await api.user.notification.setUnread(params, session);
|
|
1849
|
+
```
|
|
1756
1850
|
<a name="Organization"></a>
|
|
1757
1851
|
|
|
1758
1852
|
## Organization
|
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.0.
|
|
4
|
+
"version": "1.0.117",
|
|
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",
|
package/.vscode/settings.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|