@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.
- package/api/user/notification.js +6 -11
- package/dist/bundle.cjs +6 -11
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +4 -8
- package/docs/Notification.html +10 -58
- package/docs/user_notification.js.html +6 -11
- package/package.json +1 -1
package/doc/api.md
CHANGED
|
@@ -2519,10 +2519,8 @@ Method to add a notification token
|
|
|
2519
2519
|
| Param | Type | Description |
|
|
2520
2520
|
| --- | --- | --- |
|
|
2521
2521
|
| params | <code>object</code> | Params to add notification token |
|
|
2522
|
-
| params.token | <code>obhect</code> | The token |
|
|
2523
|
-
| params.
|
|
2524
|
-
| params.token.type | <code>object</code> | The token type |
|
|
2525
|
-
| params.token.data | <code>object</code> | The extra data of a token, if there is. |
|
|
2522
|
+
| params.token | <code>obhect</code> | The token value |
|
|
2523
|
+
| params.type | <code>object</code> | The token type |
|
|
2526
2524
|
| session | <code>string</code> | Is token JWT of user NOT allow SU |
|
|
2527
2525
|
|
|
2528
2526
|
**Example**
|
|
@@ -2531,10 +2529,8 @@ const API = require('@docbrasil/api-systemmanager');
|
|
|
2531
2529
|
const api = new API();
|
|
2532
2530
|
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
2533
2531
|
const params = {
|
|
2534
|
-
token:
|
|
2535
|
-
|
|
2536
|
-
type: 'FCM_CAPACITOR'
|
|
2537
|
-
}
|
|
2532
|
+
token: 'V6OSBr4aEVoiE9H1b4xzLe+vqmXB+ShVNc/FvJGxnIz4tZv6jBJkk4aQzz2',
|
|
2533
|
+
type: 'FCM_CAPACITOR'
|
|
2538
2534
|
};
|
|
2539
2535
|
const retData = await api.user.notification.addToken(params, session);
|
|
2540
2536
|
```
|
package/docs/Notification.html
CHANGED
|
@@ -396,29 +396,6 @@
|
|
|
396
396
|
|
|
397
397
|
|
|
398
398
|
|
|
399
|
-
<td class="description last">The token</td>
|
|
400
|
-
</tr>
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
<tr class="deep-level-1">
|
|
405
|
-
|
|
406
|
-
<td class="name"><code>token.value</code></td>
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
<td class="type">
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
<code class="param-type">object</code>
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
</td>
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
399
|
<td class="description last">The token value</td>
|
|
423
400
|
</tr>
|
|
424
401
|
|
|
@@ -426,7 +403,7 @@
|
|
|
426
403
|
|
|
427
404
|
<tr class="deep-level-1">
|
|
428
405
|
|
|
429
|
-
<td class="name"><code>
|
|
406
|
+
<td class="name"><code>type</code></td>
|
|
430
407
|
|
|
431
408
|
|
|
432
409
|
<td class="type">
|
|
@@ -446,29 +423,6 @@
|
|
|
446
423
|
</tr>
|
|
447
424
|
|
|
448
425
|
|
|
449
|
-
|
|
450
|
-
<tr class="deep-level-1">
|
|
451
|
-
|
|
452
|
-
<td class="name"><code>token.data</code></td>
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
<td class="type">
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
<code class="param-type">object</code>
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
</td>
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
<td class="description last">The extra data of a token, if there is.</td>
|
|
469
|
-
</tr>
|
|
470
|
-
|
|
471
|
-
|
|
472
426
|
|
|
473
427
|
|
|
474
428
|
|
|
@@ -547,7 +501,7 @@
|
|
|
547
501
|
<p class="tag-source">
|
|
548
502
|
<a href="user_notification.js.html" class="button">View Source</a>
|
|
549
503
|
<span>
|
|
550
|
-
<a href="user_notification.js.html">user/notification.js</a>, <a href="user_notification.js.html#
|
|
504
|
+
<a href="user_notification.js.html">user/notification.js</a>, <a href="user_notification.js.html#line82">line 82</a>
|
|
551
505
|
</span>
|
|
552
506
|
</p>
|
|
553
507
|
|
|
@@ -623,10 +577,8 @@
|
|
|
623
577
|
const api = new API();
|
|
624
578
|
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
625
579
|
const params = {
|
|
626
|
-
token:
|
|
627
|
-
|
|
628
|
-
type: 'FCM_CAPACITOR'
|
|
629
|
-
}
|
|
580
|
+
token: 'V6OSBr4aEVoiE9H1b4xzLe+vqmXB+ShVNc/FvJGxnIz4tZv6jBJkk4aQzz2',
|
|
581
|
+
type: 'FCM_CAPACITOR'
|
|
630
582
|
};
|
|
631
583
|
const retData = await api.user.notification.addToken(params, session);</code></pre>
|
|
632
584
|
|
|
@@ -765,7 +717,7 @@ const retData = await api.user.notification.addToken(params, session);</code></p
|
|
|
765
717
|
<p class="tag-source">
|
|
766
718
|
<a href="user_notification.js.html" class="button">View Source</a>
|
|
767
719
|
<span>
|
|
768
|
-
<a href="user_notification.js.html">user/notification.js</a>, <a href="user_notification.js.html#
|
|
720
|
+
<a href="user_notification.js.html">user/notification.js</a>, <a href="user_notification.js.html#line149">line 149</a>
|
|
769
721
|
</span>
|
|
770
722
|
</p>
|
|
771
723
|
|
|
@@ -934,7 +886,7 @@ await api.user.notification.getNew(session);</code></pre>
|
|
|
934
886
|
<p class="tag-source">
|
|
935
887
|
<a href="user_notification.js.html" class="button">View Source</a>
|
|
936
888
|
<span>
|
|
937
|
-
<a href="user_notification.js.html">user/notification.js</a>, <a href="user_notification.js.html#
|
|
889
|
+
<a href="user_notification.js.html">user/notification.js</a>, <a href="user_notification.js.html#line175">line 175</a>
|
|
938
890
|
</span>
|
|
939
891
|
</p>
|
|
940
892
|
|
|
@@ -1154,7 +1106,7 @@ await api.user.notification.getOld(session);</code></pre>
|
|
|
1154
1106
|
<p class="tag-source">
|
|
1155
1107
|
<a href="user_notification.js.html" class="button">View Source</a>
|
|
1156
1108
|
<span>
|
|
1157
|
-
<a href="user_notification.js.html">user/notification.js</a>, <a href="user_notification.js.html#
|
|
1109
|
+
<a href="user_notification.js.html">user/notification.js</a>, <a href="user_notification.js.html#line119">line 119</a>
|
|
1158
1110
|
</span>
|
|
1159
1111
|
</p>
|
|
1160
1112
|
|
|
@@ -1420,7 +1372,7 @@ const retData = await api.user.notification.removeToken(params, session);</code>
|
|
|
1420
1372
|
<p class="tag-source">
|
|
1421
1373
|
<a href="user_notification.js.html" class="button">View Source</a>
|
|
1422
1374
|
<span>
|
|
1423
|
-
<a href="user_notification.js.html">user/notification.js</a>, <a href="user_notification.js.html#
|
|
1375
|
+
<a href="user_notification.js.html">user/notification.js</a>, <a href="user_notification.js.html#line207">line 207</a>
|
|
1424
1376
|
</span>
|
|
1425
1377
|
</p>
|
|
1426
1378
|
|
|
@@ -1615,7 +1567,7 @@ await api.user.notification.setRead(params, session);</code></pre>
|
|
|
1615
1567
|
<p class="tag-source">
|
|
1616
1568
|
<a href="user_notification.js.html" class="button">View Source</a>
|
|
1617
1569
|
<span>
|
|
1618
|
-
<a href="user_notification.js.html">user/notification.js</a>, <a href="user_notification.js.html#
|
|
1570
|
+
<a href="user_notification.js.html">user/notification.js</a>, <a href="user_notification.js.html#line238">line 238</a>
|
|
1619
1571
|
</span>
|
|
1620
1572
|
</p>
|
|
1621
1573
|
|
|
@@ -1858,7 +1810,7 @@ await api.user.notification.setReadAll(session);</code></pre>
|
|
|
1858
1810
|
<p class="tag-source">
|
|
1859
1811
|
<a href="user_notification.js.html" class="button">View Source</a>
|
|
1860
1812
|
<span>
|
|
1861
|
-
<a href="user_notification.js.html">user/notification.js</a>, <a href="user_notification.js.html#
|
|
1813
|
+
<a href="user_notification.js.html">user/notification.js</a>, <a href="user_notification.js.html#line274">line 274</a>
|
|
1862
1814
|
</span>
|
|
1863
1815
|
</p>
|
|
1864
1816
|
|
|
@@ -149,10 +149,8 @@ class Notification {
|
|
|
149
149
|
* @author Myndware <augusto.pissarra@myndware.com>
|
|
150
150
|
* @description Method to add a notification token
|
|
151
151
|
* @param {object} params Params to add notification token
|
|
152
|
-
* @param {obhect} params.token The token
|
|
153
|
-
* @param {object} params.
|
|
154
|
-
* @param {object} params.token.type The token type
|
|
155
|
-
* @param {object} params.token.data The extra data of a token, if there is.
|
|
152
|
+
* @param {obhect} params.token The token value
|
|
153
|
+
* @param {object} params.type The token type
|
|
156
154
|
* @param {string} session Is token JWT of user NOT allow SU
|
|
157
155
|
* @returns {promise<object>} data
|
|
158
156
|
* @returns {boolean} data._id the id of the added token
|
|
@@ -163,10 +161,8 @@ class Notification {
|
|
|
163
161
|
* const api = new API();
|
|
164
162
|
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
165
163
|
* const params = {
|
|
166
|
-
* token:
|
|
167
|
-
*
|
|
168
|
-
* type: 'FCM_CAPACITOR'
|
|
169
|
-
* }
|
|
164
|
+
* token: 'V6OSBr4aEVoiE9H1b4xzLe+vqmXB+ShVNc/FvJGxnIz4tZv6jBJkk4aQzz2',
|
|
165
|
+
* type: 'FCM_CAPACITOR'
|
|
170
166
|
* };
|
|
171
167
|
* const retData = await api.user.notification.addToken(params, session);
|
|
172
168
|
*/
|
|
@@ -175,9 +171,8 @@ class Notification {
|
|
|
175
171
|
|
|
176
172
|
try {
|
|
177
173
|
Joi.assert(params, Joi.object().required(), 'Params to get task');
|
|
178
|
-
Joi.assert(params.token, Joi.
|
|
179
|
-
Joi.assert(params.
|
|
180
|
-
Joi.assert(params.token.type, Joi.string().required(), 'The type of the token');
|
|
174
|
+
Joi.assert(params.token, Joi.string().required(), 'Token value');
|
|
175
|
+
Joi.assert(params.type, Joi.string().required(), 'The type of the token');
|
|
181
176
|
|
|
182
177
|
const apiCall = self._client
|
|
183
178
|
.put(`/notifications/token`, params, self._setHeader(session));
|
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.1.
|
|
4
|
+
"version": "1.1.34",
|
|
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",
|