@docbrasil/api-systemmanager 1.0.65 → 1.0.68
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/index.js +2 -0
- package/api/user/notification.js +101 -0
- package/dist/bundle.cjs +97 -0
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +48 -0
- package/package.json +1 -1
package/doc/api.md
CHANGED
|
@@ -49,6 +49,9 @@
|
|
|
49
49
|
<dt><a href="#Users">Users</a></dt>
|
|
50
50
|
<dd><p>API request, user permission level</p>
|
|
51
51
|
</dd>
|
|
52
|
+
<dt><a href="#Notification">Notification</a></dt>
|
|
53
|
+
<dd><p>Class for user registration in a user</p>
|
|
54
|
+
</dd>
|
|
52
55
|
<dt><a href="#Organization">Organization</a></dt>
|
|
53
56
|
<dd><p>Class for organizations, permission user</p>
|
|
54
57
|
</dd>
|
|
@@ -1457,6 +1460,51 @@ API request, user permission level
|
|
|
1457
1460
|
| options | <code>object</code> | Params of the constructor |
|
|
1458
1461
|
| options.parent | <code>object</code> | This of the pararent |
|
|
1459
1462
|
|
|
1463
|
+
<a name="Notification"></a>
|
|
1464
|
+
|
|
1465
|
+
## Notification
|
|
1466
|
+
Class for user registration in a user
|
|
1467
|
+
|
|
1468
|
+
**Kind**: global class
|
|
1469
|
+
|
|
1470
|
+
* [Notification](#Notification)
|
|
1471
|
+
* [.tokenTypes](#Notification+tokenTypes) ⇒ <code>Object</code>
|
|
1472
|
+
* [.addToken(params, session)](#Notification+addToken) ⇒ <code>promise.<object></code> \| <code>boolean</code>
|
|
1473
|
+
|
|
1474
|
+
<a name="Notification+tokenTypes"></a>
|
|
1475
|
+
|
|
1476
|
+
### notification.tokenTypes ⇒ <code>Object</code>
|
|
1477
|
+
Notification token types
|
|
1478
|
+
|
|
1479
|
+
**Kind**: instance property of [<code>Notification</code>](#Notification)
|
|
1480
|
+
<a name="Notification+addToken"></a>
|
|
1481
|
+
|
|
1482
|
+
### notification.addToken(params, session) ⇒ <code>promise.<object></code> \| <code>boolean</code>
|
|
1483
|
+
Method to add a notification token
|
|
1484
|
+
|
|
1485
|
+
**Kind**: instance method of [<code>Notification</code>](#Notification)
|
|
1486
|
+
**Returns**: <code>promise.<object></code> - data<code>boolean</code> - data._id the id of the added token
|
|
1487
|
+
**Access**: public
|
|
1488
|
+
**Author**: CloudBrasil <abernardo.br@gmail.com>
|
|
1489
|
+
|
|
1490
|
+
| Param | Type | Description |
|
|
1491
|
+
| --- | --- | --- |
|
|
1492
|
+
| params | <code>object</code> | Params to add notification token |
|
|
1493
|
+
| params.token | <code>string</code> | The token |
|
|
1494
|
+
| params.type | <code>object</code> | The token type |
|
|
1495
|
+
| session | <code>string</code> | Is token JWT of user NOT allow SU |
|
|
1496
|
+
|
|
1497
|
+
**Example**
|
|
1498
|
+
```js
|
|
1499
|
+
const API = require('@docbrasil/api-systemmanager');
|
|
1500
|
+
const api = new API();
|
|
1501
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
1502
|
+
const params = {
|
|
1503
|
+
token: 'V6OSBr4aEVoiE9H1b4xzLe+vqmXB+ShVNc/FvJGxnIz4tZv6jBJkk4aQzz2',
|
|
1504
|
+
type: 'FCM_WEB'
|
|
1505
|
+
};
|
|
1506
|
+
const retData = await api.user.notification.addToken(params, session);
|
|
1507
|
+
```
|
|
1460
1508
|
<a name="Organization"></a>
|
|
1461
1509
|
|
|
1462
1510
|
## Organization
|
package/package.json
CHANGED