@docbrasil/api-systemmanager 1.0.106 → 1.0.108

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.
Files changed (76) hide show
  1. package/.github/workflows/static.yml +43 -0
  2. package/api/external.js +41 -0
  3. package/api/user/process.js +44 -0
  4. package/api/user/task.js +1 -0
  5. package/api/user/task_available.js +1 -1
  6. package/dist/bundle.cjs +87 -1
  7. package/dist/bundle.mjs +1 -1
  8. package/doc/api.md +412 -1
  9. package/docs/Admin.html +336 -0
  10. package/docs/AdminDocuments.html +2235 -0
  11. package/docs/AdminForm.html +934 -0
  12. package/docs/AdminLists.html +895 -0
  13. package/docs/AdminMessage.html +1490 -0
  14. package/docs/AdminNotification.html +1636 -0
  15. package/docs/AdminPlugin.html +696 -0
  16. package/docs/AdminPolicy.html +451 -0
  17. package/docs/AdminProcesses.html +692 -0
  18. package/docs/AdminTask.html +740 -0
  19. package/docs/AdminUser.html +1203 -0
  20. package/docs/Datasource.html +660 -0
  21. package/docs/Dispatch.html +624 -0
  22. package/docs/Documents.html +4875 -0
  23. package/docs/External.html +1203 -0
  24. package/docs/GeoLocation.html +503 -0
  25. package/docs/Login.html +1839 -0
  26. package/docs/Notification.html +625 -0
  27. package/docs/Organization.html +2767 -0
  28. package/docs/Process.html +1598 -0
  29. package/docs/Register.html +1604 -0
  30. package/docs/Session.html +482 -0
  31. package/docs/Task.html +1394 -0
  32. package/docs/TaskAvailable.html +893 -0
  33. package/docs/User.html +2002 -0
  34. package/docs/Users.html +569 -0
  35. package/docs/admin_doctypes.js.html +193 -0
  36. package/docs/admin_document.js.html +449 -0
  37. package/docs/admin_form.js.html +268 -0
  38. package/docs/admin_index.js.html +163 -0
  39. package/docs/admin_list.js.html +250 -0
  40. package/docs/admin_message.js.html +311 -0
  41. package/docs/admin_notification.js.html +350 -0
  42. package/docs/admin_organization.js.html +241 -0
  43. package/docs/admin_plugin.js.html +233 -0
  44. package/docs/admin_policy.js.html +195 -0
  45. package/docs/admin_processes.js.html +487 -0
  46. package/docs/admin_task.js.html +242 -0
  47. package/docs/admin_user.js.html +302 -0
  48. package/docs/dispatch.js.html +218 -0
  49. package/docs/external.js.html +333 -0
  50. package/docs/general_geoLocation.js.html +205 -0
  51. package/docs/general_index.js.html +140 -0
  52. package/docs/index.html +129 -0
  53. package/docs/login.js.html +384 -0
  54. package/docs/scripts/app.min.js +1 -0
  55. package/docs/scripts/linenumber.js +26 -0
  56. package/docs/scripts/search.js +39 -0
  57. package/docs/session.js.html +202 -0
  58. package/docs/styles/app.min.css +1 -0
  59. package/docs/styles/iframe.css +13 -0
  60. package/docs/styles/prettify-jsdoc.css +111 -0
  61. package/docs/styles/prettify-tomorrow.css +132 -0
  62. package/docs/styles/reset.css +44 -0
  63. package/docs/user_datasource.js.html +261 -0
  64. package/docs/user_document.js.html +847 -0
  65. package/docs/user_index.js.html +156 -0
  66. package/docs/user_notification.js.html +218 -0
  67. package/docs/user_organization.js.html +347 -0
  68. package/docs/user_process.js.html +352 -0
  69. package/docs/user_register.js.html +322 -0
  70. package/docs/user_task.js.html +319 -0
  71. package/docs/user_task_available.js.html +252 -0
  72. package/docs/user_user.js.html +404 -0
  73. package/docs/utils_promises.js.html +235 -0
  74. package/package.json +7 -4
  75. package/readme.md +7 -8
  76. package/doc.md +0 -653
package/doc/api.md CHANGED
@@ -73,6 +73,18 @@
73
73
  <dt><a href="#User">User</a></dt>
74
74
  <dd><p>Class for user, permission user</p>
75
75
  </dd>
76
+ <dt><a href="#Dispatch">Dispatch</a></dt>
77
+ <dd><p>Api dispatch manager</p>
78
+ </dd>
79
+ <dt><a href="#External">External</a></dt>
80
+ <dd><p>Class for documents, permission user</p>
81
+ </dd>
82
+ <dt><a href="#Login">Login</a></dt>
83
+ <dd><p>Login manager</p>
84
+ </dd>
85
+ <dt><a href="#Session">Session</a></dt>
86
+ <dd><p>Session manager of the API</p>
87
+ </dd>
76
88
  </dl>
77
89
 
78
90
  <a name="AdminDocuments"></a>
@@ -1894,6 +1906,7 @@ Class for process, permission user
1894
1906
  * [.start(params, session)](#Process+start) ⇒ <code>Promise</code>
1895
1907
  * [.getProcessProperties(params, session)](#Process+getProcessProperties) ⇒ <code>Promise</code>
1896
1908
  * [.getOrgProcessSearchInfo(params, session)](#Process+getOrgProcessSearchInfo) ⇒ <code>Promise</code> \| <code>string</code> \| <code>object</code> \| <code>object</code> \| <code>object</code> \| <code>string</code>
1909
+ * [.find(params, session)](#Process+find) ⇒ <code>promise</code> \| <code>number</code> \| <code>array.&lt;object&gt;</code> \| <code>number</code> \| <code>number</code>
1897
1910
 
1898
1911
  <a name="Process+start"></a>
1899
1912
 
@@ -1980,6 +1993,34 @@ const params = {
1980
1993
  const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
1981
1994
  const retSearchInfo = await api.user.process.getOrgProcessSearchInfo(params, session);
1982
1995
  ```
1996
+ <a name="Process+find"></a>
1997
+
1998
+ ### process.find(params, session) ⇒ <code>promise</code> \| <code>number</code> \| <code>array.&lt;object&gt;</code> \| <code>number</code> \| <code>number</code>
1999
+ Method to search processes
2000
+
2001
+ **Kind**: instance method of [<code>Process</code>](#Process)
2002
+ **Returns**: <code>promise</code> - returned data from the search<code>number</code> - count the count of items searched<code>array.&lt;object&gt;</code> - items the items returned from search<code>number</code> - page the page of the search (on pagination), zero indexed<code>number</code> - perPage how many items per page
2003
+ **Access**: public
2004
+ **Author**: CloudBrasil <abernardo.br@gmail.com>
2005
+
2006
+ | Param | Type | Description |
2007
+ | --- | --- | --- |
2008
+ | params | <code>object</code> | Params to search processes |
2009
+ | params.query | <code>object</code> | Search process query |
2010
+ | params.orgId | <code>object</code> | Organization id (_id database) |
2011
+ | session | <code>string</code> | Session, token JWT |
2012
+
2013
+ **Example**
2014
+ ```js
2015
+ const API = require('@docbrasil/api-systemmanager');
2016
+ const api = new API();
2017
+ const params = {
2018
+ query: {"orgProcessId": {"value":"62c2d1cdfb5455c195d1baa1","oper":"=","type":"string"},"s":[{"historyBegin":{"order":"desc"}}],"i":1,"p":20},
2019
+ orgId: '55e4a3bd6be6b45210833fae',
2020
+ };
2021
+ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
2022
+ const retSearch = await api.user.process.find(params, session);
2023
+ ```
1983
2024
  <a name="Register"></a>
1984
2025
 
1985
2026
  ## Register
@@ -2228,7 +2269,7 @@ Method to find available tasks for a user
2228
2269
  | Param | Type | Description |
2229
2270
  | --- | --- | --- |
2230
2271
  | params | <code>object</code> | Params to get task |
2231
- | params.query | <code>object</code> | Search process query |
2272
+ | params.query | <code>object</code> | Search available tasks query |
2232
2273
  | params.orgId | <code>object</code> | Organization id (_id database) |
2233
2274
  | session | <code>string</code> | Session, token JWT |
2234
2275
 
@@ -2451,3 +2492,373 @@ const id = '616eccaaa9360a05293b10fe';
2451
2492
  const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
2452
2493
  await api.user.changeOrganization.updateAvatar(id, session);
2453
2494
  ```
2495
+ <a name="Dispatch"></a>
2496
+
2497
+ ## Dispatch
2498
+ Api dispatch manager
2499
+
2500
+ **Kind**: global class
2501
+
2502
+ * [Dispatch](#Dispatch)
2503
+ * [.getContext(url, session)](#Dispatch+getContext) ⇒ <code>Promise.&lt;object&gt;</code>
2504
+ * [.getClient()](#Dispatch+getClient) ⇒ <code>promise</code>
2505
+
2506
+ <a name="Dispatch+getContext"></a>
2507
+
2508
+ ### dispatch.getContext(url, session) ⇒ <code>Promise.&lt;object&gt;</code>
2509
+ Get the URL context
2510
+
2511
+ **Kind**: instance method of [<code>Dispatch</code>](#Dispatch)
2512
+ **Returns**: <code>Promise.&lt;object&gt;</code> - The full data context of the URL
2513
+ **Access**: public
2514
+
2515
+ | Param | Type | Default | Description |
2516
+ | --- | --- | --- | --- |
2517
+ | url | <code>string</code> | | Full url |
2518
+ | session | <code>session</code> | <code></code> | Session, token JWT |
2519
+
2520
+ **Example**
2521
+ ```js
2522
+ const API = require('@docbrasil/api-systemmanager');
2523
+ const api = new API();
2524
+ const retContext = await api.dispatch.getContext('http://myndware.io/login/myorg);
2525
+ ```
2526
+ <a name="Dispatch+getClient"></a>
2527
+
2528
+ ### dispatch.getClient() ⇒ <code>promise</code>
2529
+ Get client Axios
2530
+
2531
+ **Kind**: instance method of [<code>Dispatch</code>](#Dispatch)
2532
+ **Returns**: <code>promise</code> - return client axios
2533
+ **Access**: public
2534
+ **Author**: CloudBrasil <abernardo.br@gmail.com>
2535
+ **Example**
2536
+ ```js
2537
+ const API = require('@docbrasil/api-systemmanager');
2538
+ const api = new API();
2539
+ await api.dispatch.getClient();
2540
+ ```
2541
+ <a name="External"></a>
2542
+
2543
+ ## External
2544
+ Class for documents, permission user
2545
+
2546
+ **Kind**: global class
2547
+
2548
+ * [External](#External)
2549
+ * [.context(params)](#External+context) ⇒ <code>Promise.&lt;object&gt;</code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>array.&lt;object&gt;</code>
2550
+ * [.getUploadDocumentSignedUrl(mime, authorization)](#External+getUploadDocumentSignedUrl) ⇒ <code>Promise.&lt;object&gt;</code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>string</code>
2551
+ * [.getUploadDocumentSignedUrl(docs, authorization)](#External+getUploadDocumentSignedUrl) ⇒ <code>Promise.&lt;array&gt;</code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>string</code>
2552
+ * [.handle(authorization, params)](#External+handle) ⇒ <code>Promise.&lt;boolean&gt;</code>
2553
+
2554
+ <a name="External+context"></a>
2555
+
2556
+ ### external.context(params) ⇒ <code>Promise.&lt;object&gt;</code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>array.&lt;object&gt;</code>
2557
+ Create new document
2558
+
2559
+ **Kind**: instance method of [<code>External</code>](#External)
2560
+ **Returns**: <code>Promise.&lt;object&gt;</code> - data<code>string</code> - _id the id of the form<code>string</code> - orgId the organization id of the form<code>string</code> - authorization the unique token registered internally by the system for all the next calls to the external form APIs
2561
+ The authorization is unique and is ONLY valid for this session.<code>array.&lt;object&gt;</code> - groups the form groups to render
2562
+ **Access**: public
2563
+ **Author**: CloudBrasil <abernardo.br@gmail.com>
2564
+
2565
+ | Param | Type | Description |
2566
+ | --- | --- | --- |
2567
+ | params | <code>object</code> | Object for add new document |
2568
+ | params.id | <code>string</code> | Organization form id |
2569
+
2570
+ **Example**
2571
+ ```js
2572
+ const API = require('@docbrasil/api-systemmanager');
2573
+ const api = new API();
2574
+ const params = {
2575
+ id: '611e679741cc63168c26d7ee'
2576
+ };
2577
+ const retForm = await api.external.context(params);
2578
+ ```
2579
+ <a name="External+getUploadDocumentSignedUrl"></a>
2580
+
2581
+ ### external.getUploadDocumentSignedUrl(mime, authorization) ⇒ <code>Promise.&lt;object&gt;</code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>string</code>
2582
+ Get an upload signed url, so it will be possible to upload documents temporarily during the use of the external form
2583
+
2584
+ **Kind**: instance method of [<code>External</code>](#External)
2585
+ **Returns**: <code>Promise.&lt;object&gt;</code> - doc<code>string</code> - doc.mime the original mime type of the document<code>string</code> - doc.signedUrl the signed url to upload the document<code>string</code> - doc.filename the filename of the uploaded file<code>string</code> - doc.extension the extension of the filename, obtained from the mime type
2586
+ **Access**: public
2587
+ **Author**: CloudBrasil <abernardo.br@gmail.com>
2588
+
2589
+ | Param | Type | Description |
2590
+ | --- | --- | --- |
2591
+ | mime | <code>string</code> | the mime type of the document |
2592
+ | authorization | <code>string</code> | a legal authorization |
2593
+
2594
+ **Example**
2595
+ ```js
2596
+ const API = require('@docbrasil/api-systemmanager');
2597
+ const api = new API();
2598
+ const authorization = '...';
2599
+ const doc = {
2600
+ mime: 'application/pdf'
2601
+ };
2602
+ const retDoc = await api.external.getUploadDocumentSignedUrl(doc, authorization);
2603
+ ```
2604
+ <a name="External+getUploadDocumentSignedUrl"></a>
2605
+
2606
+ ### external.getUploadDocumentSignedUrl(docs, authorization) ⇒ <code>Promise.&lt;array&gt;</code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>string</code>
2607
+ Get an upload signed url, for many documents. So it will be possible to upload documents temporarily during the use of the external form
2608
+
2609
+ **Kind**: instance method of [<code>External</code>](#External)
2610
+ **Returns**: <code>Promise.&lt;array&gt;</code> - docs<code>string</code> - docs.mime the original mime type of the document<code>string</code> - docs.signedUrl the signed url to upload the document<code>string</code> - docs.filename the filename of the uploaded file<code>string</code> - docs.extension the extension of the filename, obtained from the mime type
2611
+ **Access**: public
2612
+ **Author**: CloudBrasil <abernardo.br@gmail.com>
2613
+
2614
+ | Param | Type | Description |
2615
+ | --- | --- | --- |
2616
+ | docs | <code>array.&lt;object&gt;</code> | the list of documents |
2617
+ | docs.mime | <code>string</code> | the mime type of the document |
2618
+ | authorization | <code>string</code> | a legal authorization |
2619
+
2620
+ **Example**
2621
+ ```js
2622
+ const API = require('@docbrasil/api-systemmanager');
2623
+ const api = new API();
2624
+ const authorization = '...';
2625
+ const docs = [
2626
+ {
2627
+ mime: 'application/pdf'
2628
+ }
2629
+ ];
2630
+ const retDocs = await api.external.getUploadDocumentsSignedUrl(docs, authorization);
2631
+ ```
2632
+ <a name="External+handle"></a>
2633
+
2634
+ ### external.handle(authorization, params) ⇒ <code>Promise.&lt;boolean&gt;</code>
2635
+ Handles the execution of an external form
2636
+
2637
+ **Kind**: instance method of [<code>External</code>](#External)
2638
+ **Returns**: <code>Promise.&lt;boolean&gt;</code> - true|false if success
2639
+ **Access**: public
2640
+ **Author**: CloudBrasil <abernardo.br@gmail.com>
2641
+
2642
+ | Param | Type | Description |
2643
+ | --- | --- | --- |
2644
+ | authorization | <code>string</code> | a legal authorization |
2645
+ | params | <code>object</code> | the parameters to handle the execution of an external form |
2646
+ | params.payload | <code>array.&lt;object&gt;</code> | the payload of the external form. It should represent the form groups of the external form |
2647
+ | params.payload.name | <code>string</code> | the name of the group |
2648
+ | params.payload.fields | <code>array.&lt;object&gt;</code> | the fields that belong to each group |
2649
+ | params.payload.fields.value | <code>\*</code> \| <code>Object</code> | besides all the data inside a field, it should have the value of the the field |
2650
+
2651
+ **Example**
2652
+ ```js
2653
+ const API = require('@docbrasil/api-systemmanager');
2654
+ const api = new API();
2655
+ const authorization = '...';
2656
+ const params = {
2657
+ payload: [
2658
+ {
2659
+ name: 'My Group One',
2660
+ fields: [
2661
+ {}
2662
+ ]
2663
+ }
2664
+ ]
2665
+ };
2666
+ const success = await api.external.handle(params, authorization);
2667
+ ```
2668
+ <a name="Login"></a>
2669
+
2670
+ ## Login
2671
+ Login manager
2672
+
2673
+ **Kind**: global class
2674
+
2675
+ * [Login](#Login)
2676
+ * [.facebook(params)](#Login+facebook) ⇒ <code>promise.&lt;object&gt;</code> \| <code>object</code> \| <code>object</code>
2677
+ * [.google(params)](#Login+google) ⇒ <code>promise.&lt;object&gt;</code> \| <code>object</code> \| <code>object</code>
2678
+ * [.apiKey(apikey)](#Login+apiKey) ⇒ <code>promise.&lt;object&gt;</code> \| <code>object</code> \| <code>object</code>
2679
+ * [.userPass(params)](#Login+userPass) ⇒ <code>promise.&lt;object&gt;</code> \| <code>object</code> \| <code>object</code>
2680
+ * [.logout(session)](#Login+logout) ⇒ <code>promise.&lt;object&gt;</code> \| <code>boolean</code>
2681
+ * [.recover(username)](#Login+recover) ⇒ <code>promise.&lt;object&gt;</code> \| <code>boolean</code>
2682
+
2683
+ <a name="Login+facebook"></a>
2684
+
2685
+ ### login.facebook(params) ⇒ <code>promise.&lt;object&gt;</code> \| <code>object</code> \| <code>object</code>
2686
+ Login with social login Facebook
2687
+
2688
+ **Kind**: instance method of [<code>Login</code>](#Login)
2689
+ **Returns**: <code>promise.&lt;object&gt;</code> - data<code>object</code> - data.auth true or false if we have the user authenticaited correctly<code>object</code> - data.user the logged user
2690
+ **Access**: public
2691
+ **Author**: CloudBrasil <abernardo.br@gmail.com>
2692
+
2693
+ | Param | Type | Description |
2694
+ | --- | --- | --- |
2695
+ | params | <code>object</code> | Params to login Facebook |
2696
+ | params.accessToken | <code>string</code> | Access token of the system manager |
2697
+ | params.initialUserData | <code>object</code> | Object with roles default if sigin |
2698
+ | params.initialUserData.externalRoles | <code>array</code> | Array with permission of user |
2699
+
2700
+ **Example**
2701
+ ```js
2702
+ const API = require('@docbrasil/api-systemmanager');
2703
+
2704
+ // Params of the instance
2705
+ const params = {...}
2706
+ const api = new API(params);
2707
+ const params = { accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cC...' };
2708
+ const { auth, user } = await api.login.facebook(params);
2709
+ ```
2710
+ <a name="Login+google"></a>
2711
+
2712
+ ### login.google(params) ⇒ <code>promise.&lt;object&gt;</code> \| <code>object</code> \| <code>object</code>
2713
+ Login with social login Google
2714
+
2715
+ **Kind**: instance method of [<code>Login</code>](#Login)
2716
+ **Returns**: <code>promise.&lt;object&gt;</code> - data<code>object</code> - data.auth true or false if we have the user authenticaited correctly<code>object</code> - data.user the logged user
2717
+ **Access**: public
2718
+ **Author**: CloudBrasil <abernardo.br@gmail.com>
2719
+
2720
+ | Param | Type | Description |
2721
+ | --- | --- | --- |
2722
+ | params | <code>object</code> | Params to login Google |
2723
+ | params.accessToken | <code>string</code> | Access token of the system manager |
2724
+ | params.initialUserData | <code>object</code> | Object with roles default if sigin |
2725
+ | params.initialUserData.externalRoles | <code>array</code> | Array with permission of user |
2726
+
2727
+ **Example**
2728
+ ```js
2729
+ const API = require('@docbrasil/api-systemmanager');
2730
+
2731
+ // Params of the instance
2732
+ const params = {...}
2733
+ const api = new API(params);
2734
+ const accessToken = 'eyJhbGciOiJIUzI1NiIsInR5cC...';
2735
+ const { auth, user } = await api.login.google(accessToken);
2736
+ ```
2737
+ <a name="Login+apiKey"></a>
2738
+
2739
+ ### login.apiKey(apikey) ⇒ <code>promise.&lt;object&gt;</code> \| <code>object</code> \| <code>object</code>
2740
+ Login with apikey
2741
+
2742
+ **Kind**: instance method of [<code>Login</code>](#Login)
2743
+ **Returns**: <code>promise.&lt;object&gt;</code> - data<code>object</code> - data.auth true or false if we have the user authenticaited correctly<code>object</code> - data.user the logged user
2744
+ **Access**: public
2745
+ **Author**: CloudBrasil <abernardo.br@gmail.com>
2746
+
2747
+ | Param | Type | Description |
2748
+ | --- | --- | --- |
2749
+ | apikey | <code>string</code> | Access key |
2750
+
2751
+ **Example**
2752
+ ```js
2753
+ const API = require('@docbrasil/api-systemmanager');
2754
+
2755
+ // Params of the instance
2756
+ const params = {...}
2757
+ const api = new API(params);
2758
+ const apiKey = '043a0eb2-f5c3-4900-b781-7f229d00d092';
2759
+ const { auth, user } = await api.login.apiKey(apiKey);
2760
+ ```
2761
+ <a name="Login+userPass"></a>
2762
+
2763
+ ### login.userPass(params) ⇒ <code>promise.&lt;object&gt;</code> \| <code>object</code> \| <code>object</code>
2764
+ Login with user and password
2765
+
2766
+ **Kind**: instance method of [<code>Login</code>](#Login)
2767
+ **Returns**: <code>promise.&lt;object&gt;</code> - data<code>object</code> - data.auth true or false if we have the user authenticaited correctly<code>object</code> - data.user the logged user
2768
+ **Access**: public
2769
+ **Author**: CloudBrasil <abernardo.br@gmail.com>
2770
+
2771
+ | Param | Type | Description |
2772
+ | --- | --- | --- |
2773
+ | params | <code>object</code> | Object with user and password |
2774
+ | params.username | <code>string</code> | Username or email of the user |
2775
+ | params.password | <code>string</code> | Password of the user |
2776
+ | params.orgname | <code>string</code> | The organame of the user |
2777
+
2778
+ **Example**
2779
+ ```js
2780
+ const API = require('@docbrasil/api-systemmanager');
2781
+
2782
+ // Params of the instance
2783
+ const params = {...}
2784
+ const api = new API(params);
2785
+ const params = {
2786
+ username: 'ana.silva@gmail.com',
2787
+ password: '123456'
2788
+ };
2789
+ const { auth, user } = await api.login.userPass(params);
2790
+ ```
2791
+ <a name="Login+logout"></a>
2792
+
2793
+ ### login.logout(session) ⇒ <code>promise.&lt;object&gt;</code> \| <code>boolean</code>
2794
+ Logout user system manager
2795
+
2796
+ **Kind**: instance method of [<code>Login</code>](#Login)
2797
+ **Returns**: <code>promise.&lt;object&gt;</code> - } data<code>boolean</code> - data.success true|false
2798
+ **Access**: public
2799
+ **Author**: CloudBrasil <abernardo.br@gmail.com>
2800
+
2801
+ | Param | Type | Description |
2802
+ | --- | --- | --- |
2803
+ | session | <code>string</code> | Session, token JWT |
2804
+
2805
+ **Example**
2806
+ ```js
2807
+ const API = require('@docbrasil/api-systemmanager');
2808
+
2809
+ // Params of the instance
2810
+ const params = {...}
2811
+ const api = new API(params);
2812
+ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
2813
+ const { success } = await api.login.logout(session);
2814
+ ```
2815
+ <a name="Login+recover"></a>
2816
+
2817
+ ### login.recover(username) ⇒ <code>promise.&lt;object&gt;</code> \| <code>boolean</code>
2818
+ Recover the password
2819
+
2820
+ **Kind**: instance method of [<code>Login</code>](#Login)
2821
+ **Returns**: <code>promise.&lt;object&gt;</code> - } data<code>boolean</code> - data.success true|false
2822
+ **Access**: public
2823
+ **Author**: CloudBrasil <abernardo.br@gmail.com>
2824
+
2825
+ | Param | Type | Description |
2826
+ | --- | --- | --- |
2827
+ | username | <code>string</code> | The username or email |
2828
+
2829
+ **Example**
2830
+ ```js
2831
+ const API = require('@docbrasil/api-systemmanager');
2832
+
2833
+ // Params of the instance
2834
+ const params = {...}
2835
+ const api = new API(params);
2836
+ const { success } = await api.login.recover('myusername');
2837
+ ```
2838
+ <a name="Session"></a>
2839
+
2840
+ ## Session
2841
+ Session manager of the API
2842
+
2843
+ **Kind**: global class
2844
+ <a name="Session+information"></a>
2845
+
2846
+ ### session.information(sessionId, suSessionId) ⇒ <code>Promise</code>
2847
+ Show information for session, thus validating the session (Valid token JWT)
2848
+
2849
+ **Kind**: instance method of [<code>Session</code>](#Session)
2850
+ **Access**: public
2851
+
2852
+ | Param | Type | Default | Description |
2853
+ | --- | --- | --- | --- |
2854
+ | sessionId | <code>string</code> | | The user session (JWT Token) |
2855
+ | suSessionId | <code>string</code> | <code>&quot;sessionId&quot;</code> | Given a JWT Token of a SU (SuperAdmin), allow to check session for another user. |
2856
+
2857
+ **Example**
2858
+ ```js
2859
+ const API = require('@docbrasil/api-systemmanager');
2860
+ const api = new API();
2861
+ const sessionId = 'eyJhbFVBBiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
2862
+ const suSessionId = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
2863
+ await api.session.information(sessionId, suSessionId);
2864
+ ```