@docbrasil/api-systemmanager 1.1.76 → 1.1.78
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/admin/list.js +214 -0
- package/api/admin/user.js +363 -1
- package/dist/bundle.cjs +577 -1
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +407 -0
- package/docs/AdminLists.html +1591 -49
- package/docs/AdminUser.html +3164 -292
- package/docs/admin_list.js.html +214 -0
- package/docs/admin_user.js.html +363 -1
- package/package.json +1 -1
package/docs/AdminUser.html
CHANGED
|
@@ -224,8 +224,8 @@
|
|
|
224
224
|
|
|
225
225
|
|
|
226
226
|
|
|
227
|
-
<h4 class="name" id="
|
|
228
|
-
<a class="href-link" href="#
|
|
227
|
+
<h4 class="name" id="block">
|
|
228
|
+
<a class="href-link" href="#block">#</a>
|
|
229
229
|
|
|
230
230
|
|
|
231
231
|
<span class='tag'>async</span>
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
|
|
234
234
|
<span class="code-name">
|
|
235
235
|
|
|
236
|
-
|
|
236
|
+
block<span class="signature">(userId, session)</span><span class="type-signature"> → {Promise.<object>}</span>
|
|
237
237
|
|
|
238
238
|
</span>
|
|
239
239
|
</h4>
|
|
@@ -242,7 +242,7 @@
|
|
|
242
242
|
|
|
243
243
|
|
|
244
244
|
<div class="description">
|
|
245
|
-
|
|
245
|
+
Block a user (prevent login)
|
|
246
246
|
</div>
|
|
247
247
|
|
|
248
248
|
|
|
@@ -280,13 +280,13 @@
|
|
|
280
280
|
|
|
281
281
|
<tr class="deep-level-0">
|
|
282
282
|
|
|
283
|
-
<td class="name"><code>
|
|
283
|
+
<td class="name"><code>userId</code></td>
|
|
284
284
|
|
|
285
285
|
|
|
286
286
|
<td class="type">
|
|
287
287
|
|
|
288
288
|
|
|
289
|
-
<code class="param-type">
|
|
289
|
+
<code class="param-type">string</code>
|
|
290
290
|
|
|
291
291
|
|
|
292
292
|
|
|
@@ -296,38 +296,16 @@
|
|
|
296
296
|
|
|
297
297
|
|
|
298
298
|
|
|
299
|
-
<td class="description last">
|
|
299
|
+
<td class="description last">User ID to block (required)</td>
|
|
300
300
|
</tr>
|
|
301
301
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
<tr class="deep-level-1">
|
|
306
|
-
|
|
307
|
-
<td class="name"><code>guid</code></td>
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
<td class="type">
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
<code class="param-type">string</code>
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
</td>
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
302
|
|
|
323
|
-
|
|
324
|
-
</tr>
|
|
303
|
+
|
|
325
304
|
|
|
305
|
+
|
|
306
|
+
<tr class="deep-level-0">
|
|
326
307
|
|
|
327
|
-
|
|
328
|
-
<tr class="deep-level-1">
|
|
329
|
-
|
|
330
|
-
<td class="name"><code>newPassword</code></td>
|
|
308
|
+
<td class="name"><code>session</code></td>
|
|
331
309
|
|
|
332
310
|
|
|
333
311
|
<td class="type">
|
|
@@ -343,11 +321,9 @@
|
|
|
343
321
|
|
|
344
322
|
|
|
345
323
|
|
|
346
|
-
<td class="description last">
|
|
324
|
+
<td class="description last">JWT session token</td>
|
|
347
325
|
</tr>
|
|
348
326
|
|
|
349
|
-
|
|
350
|
-
|
|
351
327
|
|
|
352
328
|
|
|
353
329
|
</tbody>
|
|
@@ -377,6 +353,13 @@
|
|
|
377
353
|
|
|
378
354
|
|
|
379
355
|
|
|
356
|
+
<dt class="tag-author">Author:</dt>
|
|
357
|
+
<dd class="tag-author">
|
|
358
|
+
<ul>
|
|
359
|
+
<li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
|
|
360
|
+
</ul>
|
|
361
|
+
</dd>
|
|
362
|
+
|
|
380
363
|
|
|
381
364
|
|
|
382
365
|
|
|
@@ -393,7 +376,7 @@
|
|
|
393
376
|
<p class="tag-source">
|
|
394
377
|
<a href="admin_user.js.html" class="button">View Source</a>
|
|
395
378
|
<span>
|
|
396
|
-
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#
|
|
379
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line424">line 424</a>
|
|
397
380
|
</span>
|
|
398
381
|
</p>
|
|
399
382
|
|
|
@@ -424,11 +407,13 @@
|
|
|
424
407
|
|
|
425
408
|
<div class="columns">
|
|
426
409
|
|
|
410
|
+
<div class='param-desc column is-7'>Updated user</div>
|
|
411
|
+
|
|
427
412
|
|
|
428
413
|
<div class='column is-5 has-text-left'>
|
|
429
414
|
<label>Type: </label>
|
|
430
415
|
|
|
431
|
-
<code class="param-type">Promise.<
|
|
416
|
+
<code class="param-type">Promise.<object></code>
|
|
432
417
|
|
|
433
418
|
|
|
434
419
|
</div>
|
|
@@ -445,11 +430,11 @@
|
|
|
445
430
|
<h5>Example</h5>
|
|
446
431
|
|
|
447
432
|
|
|
448
|
-
<pre class="prettyprint"><code>const
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
433
|
+
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
434
|
+
const api = new API();
|
|
435
|
+
const userId = '55e4a3bd6be6b45210833fae';
|
|
436
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
437
|
+
await api.admin.user.block(userId, session);</code></pre>
|
|
453
438
|
|
|
454
439
|
|
|
455
440
|
|
|
@@ -459,8 +444,8 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
459
444
|
|
|
460
445
|
|
|
461
446
|
|
|
462
|
-
<h4 class="name" id="
|
|
463
|
-
<a class="href-link" href="#
|
|
447
|
+
<h4 class="name" id="blockEmail">
|
|
448
|
+
<a class="href-link" href="#blockEmail">#</a>
|
|
464
449
|
|
|
465
450
|
|
|
466
451
|
<span class='tag'>async</span>
|
|
@@ -468,7 +453,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
468
453
|
|
|
469
454
|
<span class="code-name">
|
|
470
455
|
|
|
471
|
-
|
|
456
|
+
blockEmail<span class="signature">(userId, session)</span><span class="type-signature"> → {Promise.<object>}</span>
|
|
472
457
|
|
|
473
458
|
</span>
|
|
474
459
|
</h4>
|
|
@@ -477,7 +462,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
477
462
|
|
|
478
463
|
|
|
479
464
|
<div class="description">
|
|
480
|
-
|
|
465
|
+
Block email notifications for a user
|
|
481
466
|
</div>
|
|
482
467
|
|
|
483
468
|
|
|
@@ -515,7 +500,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
515
500
|
|
|
516
501
|
<tr class="deep-level-0">
|
|
517
502
|
|
|
518
|
-
<td class="name"><code>
|
|
503
|
+
<td class="name"><code>userId</code></td>
|
|
519
504
|
|
|
520
505
|
|
|
521
506
|
<td class="type">
|
|
@@ -531,7 +516,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
531
516
|
|
|
532
517
|
|
|
533
518
|
|
|
534
|
-
<td class="description last">
|
|
519
|
+
<td class="description last">User ID (required)</td>
|
|
535
520
|
</tr>
|
|
536
521
|
|
|
537
522
|
|
|
@@ -556,7 +541,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
556
541
|
|
|
557
542
|
|
|
558
543
|
|
|
559
|
-
<td class="description last">
|
|
544
|
+
<td class="description last">JWT session token</td>
|
|
560
545
|
</tr>
|
|
561
546
|
|
|
562
547
|
|
|
@@ -611,7 +596,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
611
596
|
<p class="tag-source">
|
|
612
597
|
<a href="admin_user.js.html" class="button">View Source</a>
|
|
613
598
|
<span>
|
|
614
|
-
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#
|
|
599
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line477">line 477</a>
|
|
615
600
|
</span>
|
|
616
601
|
</p>
|
|
617
602
|
|
|
@@ -634,18 +619,32 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
634
619
|
|
|
635
620
|
|
|
636
621
|
|
|
622
|
+
<div class='columns method-parameter'>
|
|
623
|
+
<div class="column is-2"><label>Returns:</label></div>
|
|
624
|
+
<div class="column is-10">
|
|
625
|
+
|
|
626
|
+
|
|
637
627
|
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
<h5>Example</h5>
|
|
628
|
+
<div class="columns">
|
|
641
629
|
|
|
630
|
+
<div class='param-desc column is-7'>Updated user</div>
|
|
642
631
|
|
|
643
|
-
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
644
|
-
const api = new API();
|
|
645
|
-
const email = 'ana.silva@gmail.com';
|
|
646
|
-
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
647
|
-
await api.admin.user.emailExist(email, session);</code></pre>
|
|
648
632
|
|
|
633
|
+
<div class='column is-5 has-text-left'>
|
|
634
|
+
<label>Type: </label>
|
|
635
|
+
|
|
636
|
+
<code class="param-type">Promise.<object></code>
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
</div>
|
|
640
|
+
|
|
641
|
+
</div>
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
</div>
|
|
645
|
+
</div>
|
|
646
|
+
|
|
647
|
+
|
|
649
648
|
|
|
650
649
|
|
|
651
650
|
</div>
|
|
@@ -654,8 +653,8 @@ await api.admin.user.emailExist(email, session);</code></pre>
|
|
|
654
653
|
|
|
655
654
|
|
|
656
655
|
|
|
657
|
-
<h4 class="name" id="
|
|
658
|
-
<a class="href-link" href="#
|
|
656
|
+
<h4 class="name" id="changePasswordGuid">
|
|
657
|
+
<a class="href-link" href="#changePasswordGuid">#</a>
|
|
659
658
|
|
|
660
659
|
|
|
661
660
|
<span class='tag'>async</span>
|
|
@@ -663,7 +662,7 @@ await api.admin.user.emailExist(email, session);</code></pre>
|
|
|
663
662
|
|
|
664
663
|
<span class="code-name">
|
|
665
664
|
|
|
666
|
-
|
|
665
|
+
changePasswordGuid<span class="signature">(Payload)</span><span class="type-signature"> → {Promise.<*>}</span>
|
|
667
666
|
|
|
668
667
|
</span>
|
|
669
668
|
</h4>
|
|
@@ -672,7 +671,7 @@ await api.admin.user.emailExist(email, session);</code></pre>
|
|
|
672
671
|
|
|
673
672
|
|
|
674
673
|
<div class="description">
|
|
675
|
-
|
|
674
|
+
Change password guid
|
|
676
675
|
</div>
|
|
677
676
|
|
|
678
677
|
|
|
@@ -710,13 +709,13 @@ await api.admin.user.emailExist(email, session);</code></pre>
|
|
|
710
709
|
|
|
711
710
|
<tr class="deep-level-0">
|
|
712
711
|
|
|
713
|
-
<td class="name"><code>
|
|
712
|
+
<td class="name"><code>Payload</code></td>
|
|
714
713
|
|
|
715
714
|
|
|
716
715
|
<td class="type">
|
|
717
716
|
|
|
718
717
|
|
|
719
|
-
<code class="param-type">
|
|
718
|
+
<code class="param-type">object</code>
|
|
720
719
|
|
|
721
720
|
|
|
722
721
|
|
|
@@ -726,16 +725,38 @@ await api.admin.user.emailExist(email, session);</code></pre>
|
|
|
726
725
|
|
|
727
726
|
|
|
728
727
|
|
|
729
|
-
<td class="description last">
|
|
728
|
+
<td class="description last">Payload to change password</td>
|
|
730
729
|
</tr>
|
|
731
730
|
|
|
731
|
+
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
<tr class="deep-level-1">
|
|
735
|
+
|
|
736
|
+
<td class="name"><code>guid</code></td>
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
<td class="type">
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
<code class="param-type">string</code>
|
|
732
743
|
|
|
733
|
-
|
|
734
744
|
|
|
735
|
-
|
|
736
|
-
<tr class="deep-level-0">
|
|
737
745
|
|
|
738
|
-
|
|
746
|
+
</td>
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
<td class="description last">GUID</td>
|
|
753
|
+
</tr>
|
|
754
|
+
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
<tr class="deep-level-1">
|
|
758
|
+
|
|
759
|
+
<td class="name"><code>newPassword</code></td>
|
|
739
760
|
|
|
740
761
|
|
|
741
762
|
<td class="type">
|
|
@@ -751,9 +772,11 @@ await api.admin.user.emailExist(email, session);</code></pre>
|
|
|
751
772
|
|
|
752
773
|
|
|
753
774
|
|
|
754
|
-
<td class="description last">
|
|
775
|
+
<td class="description last">New password</td>
|
|
755
776
|
</tr>
|
|
756
777
|
|
|
778
|
+
|
|
779
|
+
|
|
757
780
|
|
|
758
781
|
|
|
759
782
|
</tbody>
|
|
@@ -783,13 +806,6 @@ await api.admin.user.emailExist(email, session);</code></pre>
|
|
|
783
806
|
|
|
784
807
|
|
|
785
808
|
|
|
786
|
-
<dt class="tag-author">Author:</dt>
|
|
787
|
-
<dd class="tag-author">
|
|
788
|
-
<ul>
|
|
789
|
-
<li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
|
|
790
|
-
</ul>
|
|
791
|
-
</dd>
|
|
792
|
-
|
|
793
809
|
|
|
794
810
|
|
|
795
811
|
|
|
@@ -806,7 +822,7 @@ await api.admin.user.emailExist(email, session);</code></pre>
|
|
|
806
822
|
<p class="tag-source">
|
|
807
823
|
<a href="admin_user.js.html" class="button">View Source</a>
|
|
808
824
|
<span>
|
|
809
|
-
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#
|
|
825
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line336">line 336</a>
|
|
810
826
|
</span>
|
|
811
827
|
</p>
|
|
812
828
|
|
|
@@ -841,7 +857,7 @@ await api.admin.user.emailExist(email, session);</code></pre>
|
|
|
841
857
|
<div class='column is-5 has-text-left'>
|
|
842
858
|
<label>Type: </label>
|
|
843
859
|
|
|
844
|
-
<code class="param-type">Promise
|
|
860
|
+
<code class="param-type">Promise.<*></code>
|
|
845
861
|
|
|
846
862
|
|
|
847
863
|
</div>
|
|
@@ -858,11 +874,11 @@ await api.admin.user.emailExist(email, session);</code></pre>
|
|
|
858
874
|
<h5>Example</h5>
|
|
859
875
|
|
|
860
876
|
|
|
861
|
-
<pre class="prettyprint"><code>const
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
877
|
+
<pre class="prettyprint"><code>const payload = {
|
|
878
|
+
guid: '5b3c049c-4861-4353-a423-5e3f14242642',
|
|
879
|
+
newPassword: '123456789'
|
|
880
|
+
};
|
|
881
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
866
882
|
|
|
867
883
|
|
|
868
884
|
|
|
@@ -872,8 +888,8 @@ await api.admin.user.findById(userId, session);</code></pre>
|
|
|
872
888
|
|
|
873
889
|
|
|
874
890
|
|
|
875
|
-
<h4 class="name" id="
|
|
876
|
-
<a class="href-link" href="#
|
|
891
|
+
<h4 class="name" id="create">
|
|
892
|
+
<a class="href-link" href="#create">#</a>
|
|
877
893
|
|
|
878
894
|
|
|
879
895
|
<span class='tag'>async</span>
|
|
@@ -881,7 +897,7 @@ await api.admin.user.findById(userId, session);</code></pre>
|
|
|
881
897
|
|
|
882
898
|
<span class="code-name">
|
|
883
899
|
|
|
884
|
-
|
|
900
|
+
create<span class="signature">(payload, session)</span><span class="type-signature"> → {Promise.<object>}</span>
|
|
885
901
|
|
|
886
902
|
</span>
|
|
887
903
|
</h4>
|
|
@@ -890,7 +906,7 @@ await api.admin.user.findById(userId, session);</code></pre>
|
|
|
890
906
|
|
|
891
907
|
|
|
892
908
|
<div class="description">
|
|
893
|
-
|
|
909
|
+
Create a new user
|
|
894
910
|
</div>
|
|
895
911
|
|
|
896
912
|
|
|
@@ -915,8 +931,12 @@ await api.admin.user.findById(userId, session);</code></pre>
|
|
|
915
931
|
<th>Type</th>
|
|
916
932
|
|
|
917
933
|
|
|
934
|
+
<th>Attributes</th>
|
|
935
|
+
|
|
918
936
|
|
|
919
937
|
|
|
938
|
+
<th>Default</th>
|
|
939
|
+
|
|
920
940
|
|
|
921
941
|
<th class="last">Description</th>
|
|
922
942
|
</tr>
|
|
@@ -928,57 +948,78 @@ await api.admin.user.findById(userId, session);</code></pre>
|
|
|
928
948
|
|
|
929
949
|
<tr class="deep-level-0">
|
|
930
950
|
|
|
931
|
-
<td class="name"><code>
|
|
951
|
+
<td class="name"><code>payload</code></td>
|
|
932
952
|
|
|
933
953
|
|
|
934
954
|
<td class="type">
|
|
935
955
|
|
|
936
956
|
|
|
937
|
-
<code class="param-type">
|
|
957
|
+
<code class="param-type">object</code>
|
|
938
958
|
|
|
939
959
|
|
|
940
960
|
|
|
941
961
|
</td>
|
|
942
962
|
|
|
943
963
|
|
|
964
|
+
<td class="attributes">
|
|
965
|
+
|
|
944
966
|
|
|
945
|
-
|
|
967
|
+
|
|
946
968
|
|
|
947
|
-
|
|
948
|
-
</
|
|
969
|
+
|
|
970
|
+
</td>
|
|
971
|
+
|
|
949
972
|
|
|
973
|
+
|
|
974
|
+
<td class="default">
|
|
975
|
+
|
|
976
|
+
</td>
|
|
977
|
+
|
|
950
978
|
|
|
951
|
-
|
|
979
|
+
<td class="description last">User data to create</td>
|
|
980
|
+
</tr>
|
|
952
981
|
|
|
953
|
-
|
|
954
|
-
<tr class="deep-level-0">
|
|
955
982
|
|
|
956
|
-
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
<tr class="deep-level-1">
|
|
986
|
+
|
|
987
|
+
<td class="name"><code>name</code></td>
|
|
957
988
|
|
|
958
989
|
|
|
959
990
|
<td class="type">
|
|
960
991
|
|
|
961
992
|
|
|
962
|
-
<code class="param-type">
|
|
993
|
+
<code class="param-type">string</code>
|
|
963
994
|
|
|
964
995
|
|
|
965
996
|
|
|
966
997
|
</td>
|
|
967
998
|
|
|
968
999
|
|
|
1000
|
+
<td class="attributes">
|
|
1001
|
+
|
|
969
1002
|
|
|
970
|
-
|
|
1003
|
+
|
|
971
1004
|
|
|
972
|
-
|
|
973
|
-
</
|
|
1005
|
+
|
|
1006
|
+
</td>
|
|
1007
|
+
|
|
974
1008
|
|
|
1009
|
+
|
|
1010
|
+
<td class="default">
|
|
1011
|
+
|
|
1012
|
+
</td>
|
|
1013
|
+
|
|
975
1014
|
|
|
976
|
-
|
|
1015
|
+
<td class="description last">Full name (required)</td>
|
|
1016
|
+
</tr>
|
|
977
1017
|
|
|
978
|
-
|
|
979
|
-
<tr class="deep-level-0">
|
|
980
1018
|
|
|
981
|
-
|
|
1019
|
+
|
|
1020
|
+
<tr class="deep-level-1">
|
|
1021
|
+
|
|
1022
|
+
<td class="name"><code>username</code></td>
|
|
982
1023
|
|
|
983
1024
|
|
|
984
1025
|
<td class="type">
|
|
@@ -991,23 +1032,2678 @@ await api.admin.user.findById(userId, session);</code></pre>
|
|
|
991
1032
|
</td>
|
|
992
1033
|
|
|
993
1034
|
|
|
1035
|
+
<td class="attributes">
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
|
|
1041
|
+
</td>
|
|
1042
|
+
|
|
994
1043
|
|
|
995
1044
|
|
|
1045
|
+
<td class="default">
|
|
1046
|
+
|
|
1047
|
+
</td>
|
|
1048
|
+
|
|
996
1049
|
|
|
997
|
-
<td class="description last">
|
|
1050
|
+
<td class="description last">Username (required)</td>
|
|
998
1051
|
</tr>
|
|
999
1052
|
|
|
1053
|
+
|
|
1054
|
+
|
|
1055
|
+
<tr class="deep-level-1">
|
|
1056
|
+
|
|
1057
|
+
<td class="name"><code>email</code></td>
|
|
1058
|
+
|
|
1000
1059
|
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
</
|
|
1060
|
+
<td class="type">
|
|
1061
|
+
|
|
1062
|
+
|
|
1063
|
+
<code class="param-type">string</code>
|
|
1005
1064
|
|
|
1006
1065
|
|
|
1066
|
+
|
|
1067
|
+
</td>
|
|
1007
1068
|
|
|
1069
|
+
|
|
1070
|
+
<td class="attributes">
|
|
1071
|
+
|
|
1008
1072
|
|
|
1073
|
+
|
|
1009
1074
|
|
|
1010
|
-
|
|
1075
|
+
|
|
1076
|
+
</td>
|
|
1077
|
+
|
|
1078
|
+
|
|
1079
|
+
|
|
1080
|
+
<td class="default">
|
|
1081
|
+
|
|
1082
|
+
</td>
|
|
1083
|
+
|
|
1084
|
+
|
|
1085
|
+
<td class="description last">Email (required)</td>
|
|
1086
|
+
</tr>
|
|
1087
|
+
|
|
1088
|
+
|
|
1089
|
+
|
|
1090
|
+
<tr class="deep-level-1">
|
|
1091
|
+
|
|
1092
|
+
<td class="name"><code>orgId</code></td>
|
|
1093
|
+
|
|
1094
|
+
|
|
1095
|
+
<td class="type">
|
|
1096
|
+
|
|
1097
|
+
|
|
1098
|
+
<code class="param-type">string</code>
|
|
1099
|
+
|
|
1100
|
+
|
|
1101
|
+
|
|
1102
|
+
</td>
|
|
1103
|
+
|
|
1104
|
+
|
|
1105
|
+
<td class="attributes">
|
|
1106
|
+
|
|
1107
|
+
|
|
1108
|
+
|
|
1109
|
+
|
|
1110
|
+
|
|
1111
|
+
</td>
|
|
1112
|
+
|
|
1113
|
+
|
|
1114
|
+
|
|
1115
|
+
<td class="default">
|
|
1116
|
+
|
|
1117
|
+
</td>
|
|
1118
|
+
|
|
1119
|
+
|
|
1120
|
+
<td class="description last">Primary organization ID (required)</td>
|
|
1121
|
+
</tr>
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
<tr class="deep-level-1">
|
|
1126
|
+
|
|
1127
|
+
<td class="name"><code>orgIds</code></td>
|
|
1128
|
+
|
|
1129
|
+
|
|
1130
|
+
<td class="type">
|
|
1131
|
+
|
|
1132
|
+
|
|
1133
|
+
<code class="param-type">array</code>
|
|
1134
|
+
|
|
1135
|
+
|
|
1136
|
+
|
|
1137
|
+
</td>
|
|
1138
|
+
|
|
1139
|
+
|
|
1140
|
+
<td class="attributes">
|
|
1141
|
+
|
|
1142
|
+
<optional><br>
|
|
1143
|
+
|
|
1144
|
+
|
|
1145
|
+
|
|
1146
|
+
|
|
1147
|
+
|
|
1148
|
+
</td>
|
|
1149
|
+
|
|
1150
|
+
|
|
1151
|
+
|
|
1152
|
+
<td class="default">
|
|
1153
|
+
|
|
1154
|
+
</td>
|
|
1155
|
+
|
|
1156
|
+
|
|
1157
|
+
<td class="description last">Organization IDs</td>
|
|
1158
|
+
</tr>
|
|
1159
|
+
|
|
1160
|
+
|
|
1161
|
+
|
|
1162
|
+
<tr class="deep-level-1">
|
|
1163
|
+
|
|
1164
|
+
<td class="name"><code>role</code></td>
|
|
1165
|
+
|
|
1166
|
+
|
|
1167
|
+
<td class="type">
|
|
1168
|
+
|
|
1169
|
+
|
|
1170
|
+
<code class="param-type">array</code>
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
|
|
1174
|
+
</td>
|
|
1175
|
+
|
|
1176
|
+
|
|
1177
|
+
<td class="attributes">
|
|
1178
|
+
|
|
1179
|
+
<optional><br>
|
|
1180
|
+
|
|
1181
|
+
|
|
1182
|
+
|
|
1183
|
+
|
|
1184
|
+
|
|
1185
|
+
</td>
|
|
1186
|
+
|
|
1187
|
+
|
|
1188
|
+
|
|
1189
|
+
<td class="default">
|
|
1190
|
+
|
|
1191
|
+
[2]
|
|
1192
|
+
|
|
1193
|
+
</td>
|
|
1194
|
+
|
|
1195
|
+
|
|
1196
|
+
<td class="description last">Security roles</td>
|
|
1197
|
+
</tr>
|
|
1198
|
+
|
|
1199
|
+
|
|
1200
|
+
|
|
1201
|
+
<tr class="deep-level-1">
|
|
1202
|
+
|
|
1203
|
+
<td class="name"><code>password</code></td>
|
|
1204
|
+
|
|
1205
|
+
|
|
1206
|
+
<td class="type">
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
|
+
<code class="param-type">string</code>
|
|
1210
|
+
|
|
1211
|
+
|
|
1212
|
+
|
|
1213
|
+
</td>
|
|
1214
|
+
|
|
1215
|
+
|
|
1216
|
+
<td class="attributes">
|
|
1217
|
+
|
|
1218
|
+
<optional><br>
|
|
1219
|
+
|
|
1220
|
+
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
|
|
1224
|
+
</td>
|
|
1225
|
+
|
|
1226
|
+
|
|
1227
|
+
|
|
1228
|
+
<td class="default">
|
|
1229
|
+
|
|
1230
|
+
</td>
|
|
1231
|
+
|
|
1232
|
+
|
|
1233
|
+
<td class="description last">Initial password</td>
|
|
1234
|
+
</tr>
|
|
1235
|
+
|
|
1236
|
+
|
|
1237
|
+
|
|
1238
|
+
|
|
1239
|
+
|
|
1240
|
+
|
|
1241
|
+
|
|
1242
|
+
<tr class="deep-level-0">
|
|
1243
|
+
|
|
1244
|
+
<td class="name"><code>session</code></td>
|
|
1245
|
+
|
|
1246
|
+
|
|
1247
|
+
<td class="type">
|
|
1248
|
+
|
|
1249
|
+
|
|
1250
|
+
<code class="param-type">string</code>
|
|
1251
|
+
|
|
1252
|
+
|
|
1253
|
+
|
|
1254
|
+
</td>
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+
<td class="attributes">
|
|
1258
|
+
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
|
|
1262
|
+
|
|
1263
|
+
</td>
|
|
1264
|
+
|
|
1265
|
+
|
|
1266
|
+
|
|
1267
|
+
<td class="default">
|
|
1268
|
+
|
|
1269
|
+
</td>
|
|
1270
|
+
|
|
1271
|
+
|
|
1272
|
+
<td class="description last">JWT session token</td>
|
|
1273
|
+
</tr>
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
|
|
1277
|
+
</tbody>
|
|
1278
|
+
</table>
|
|
1279
|
+
</div>
|
|
1280
|
+
|
|
1281
|
+
|
|
1282
|
+
|
|
1283
|
+
|
|
1284
|
+
|
|
1285
|
+
<dl class="details">
|
|
1286
|
+
|
|
1287
|
+
|
|
1288
|
+
|
|
1289
|
+
|
|
1290
|
+
|
|
1291
|
+
|
|
1292
|
+
|
|
1293
|
+
|
|
1294
|
+
|
|
1295
|
+
|
|
1296
|
+
|
|
1297
|
+
|
|
1298
|
+
|
|
1299
|
+
|
|
1300
|
+
|
|
1301
|
+
|
|
1302
|
+
|
|
1303
|
+
|
|
1304
|
+
<dt class="tag-author">Author:</dt>
|
|
1305
|
+
<dd class="tag-author">
|
|
1306
|
+
<ul>
|
|
1307
|
+
<li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
|
|
1308
|
+
</ul>
|
|
1309
|
+
</dd>
|
|
1310
|
+
|
|
1311
|
+
|
|
1312
|
+
|
|
1313
|
+
|
|
1314
|
+
|
|
1315
|
+
|
|
1316
|
+
|
|
1317
|
+
|
|
1318
|
+
|
|
1319
|
+
|
|
1320
|
+
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
|
|
1324
|
+
<p class="tag-source">
|
|
1325
|
+
<a href="admin_user.js.html" class="button">View Source</a>
|
|
1326
|
+
<span>
|
|
1327
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line243">line 243</a>
|
|
1328
|
+
</span>
|
|
1329
|
+
</p>
|
|
1330
|
+
|
|
1331
|
+
</dl>
|
|
1332
|
+
|
|
1333
|
+
|
|
1334
|
+
|
|
1335
|
+
|
|
1336
|
+
|
|
1337
|
+
|
|
1338
|
+
|
|
1339
|
+
|
|
1340
|
+
|
|
1341
|
+
|
|
1342
|
+
|
|
1343
|
+
|
|
1344
|
+
|
|
1345
|
+
|
|
1346
|
+
|
|
1347
|
+
|
|
1348
|
+
|
|
1349
|
+
|
|
1350
|
+
<div class='columns method-parameter'>
|
|
1351
|
+
<div class="column is-2"><label>Returns:</label></div>
|
|
1352
|
+
<div class="column is-10">
|
|
1353
|
+
|
|
1354
|
+
|
|
1355
|
+
|
|
1356
|
+
<div class="columns">
|
|
1357
|
+
|
|
1358
|
+
<div class='param-desc column is-7'>Created user document</div>
|
|
1359
|
+
|
|
1360
|
+
|
|
1361
|
+
<div class='column is-5 has-text-left'>
|
|
1362
|
+
<label>Type: </label>
|
|
1363
|
+
|
|
1364
|
+
<code class="param-type">Promise.<object></code>
|
|
1365
|
+
|
|
1366
|
+
|
|
1367
|
+
</div>
|
|
1368
|
+
|
|
1369
|
+
</div>
|
|
1370
|
+
|
|
1371
|
+
|
|
1372
|
+
</div>
|
|
1373
|
+
</div>
|
|
1374
|
+
|
|
1375
|
+
|
|
1376
|
+
|
|
1377
|
+
|
|
1378
|
+
<h5>Example</h5>
|
|
1379
|
+
|
|
1380
|
+
|
|
1381
|
+
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
1382
|
+
const api = new API();
|
|
1383
|
+
const payload = {
|
|
1384
|
+
name: 'Maria Silva',
|
|
1385
|
+
username: 'maria.silva',
|
|
1386
|
+
email: 'maria@example.com',
|
|
1387
|
+
orgId: '5edd11c46b6ce9729c2c297c',
|
|
1388
|
+
role: [2]
|
|
1389
|
+
};
|
|
1390
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
1391
|
+
await api.admin.user.create(payload, session);</code></pre>
|
|
1392
|
+
|
|
1393
|
+
|
|
1394
|
+
|
|
1395
|
+
</div>
|
|
1396
|
+
|
|
1397
|
+
<div class="member">
|
|
1398
|
+
|
|
1399
|
+
|
|
1400
|
+
|
|
1401
|
+
<h4 class="name" id="emailExist">
|
|
1402
|
+
<a class="href-link" href="#emailExist">#</a>
|
|
1403
|
+
|
|
1404
|
+
|
|
1405
|
+
<span class='tag'>async</span>
|
|
1406
|
+
|
|
1407
|
+
|
|
1408
|
+
<span class="code-name">
|
|
1409
|
+
|
|
1410
|
+
emailExist<span class="signature">(email, session)</span><span class="type-signature"></span>
|
|
1411
|
+
|
|
1412
|
+
</span>
|
|
1413
|
+
</h4>
|
|
1414
|
+
|
|
1415
|
+
|
|
1416
|
+
|
|
1417
|
+
|
|
1418
|
+
<div class="description">
|
|
1419
|
+
Check if email is unique
|
|
1420
|
+
</div>
|
|
1421
|
+
|
|
1422
|
+
|
|
1423
|
+
|
|
1424
|
+
|
|
1425
|
+
|
|
1426
|
+
|
|
1427
|
+
|
|
1428
|
+
|
|
1429
|
+
|
|
1430
|
+
|
|
1431
|
+
<h5>Parameters:</h5>
|
|
1432
|
+
|
|
1433
|
+
<div class="table-container">
|
|
1434
|
+
<table class="params table">
|
|
1435
|
+
<thead>
|
|
1436
|
+
<tr>
|
|
1437
|
+
|
|
1438
|
+
<th>Name</th>
|
|
1439
|
+
|
|
1440
|
+
|
|
1441
|
+
<th>Type</th>
|
|
1442
|
+
|
|
1443
|
+
|
|
1444
|
+
|
|
1445
|
+
|
|
1446
|
+
|
|
1447
|
+
<th class="last">Description</th>
|
|
1448
|
+
</tr>
|
|
1449
|
+
</thead>
|
|
1450
|
+
|
|
1451
|
+
<tbody>
|
|
1452
|
+
|
|
1453
|
+
|
|
1454
|
+
|
|
1455
|
+
<tr class="deep-level-0">
|
|
1456
|
+
|
|
1457
|
+
<td class="name"><code>email</code></td>
|
|
1458
|
+
|
|
1459
|
+
|
|
1460
|
+
<td class="type">
|
|
1461
|
+
|
|
1462
|
+
|
|
1463
|
+
<code class="param-type">string</code>
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
|
|
1467
|
+
</td>
|
|
1468
|
+
|
|
1469
|
+
|
|
1470
|
+
|
|
1471
|
+
|
|
1472
|
+
|
|
1473
|
+
<td class="description last">Check if email is unique</td>
|
|
1474
|
+
</tr>
|
|
1475
|
+
|
|
1476
|
+
|
|
1477
|
+
|
|
1478
|
+
|
|
1479
|
+
|
|
1480
|
+
<tr class="deep-level-0">
|
|
1481
|
+
|
|
1482
|
+
<td class="name"><code>session</code></td>
|
|
1483
|
+
|
|
1484
|
+
|
|
1485
|
+
<td class="type">
|
|
1486
|
+
|
|
1487
|
+
|
|
1488
|
+
<code class="param-type">string</code>
|
|
1489
|
+
|
|
1490
|
+
|
|
1491
|
+
|
|
1492
|
+
</td>
|
|
1493
|
+
|
|
1494
|
+
|
|
1495
|
+
|
|
1496
|
+
|
|
1497
|
+
|
|
1498
|
+
<td class="description last">Is token JWT</td>
|
|
1499
|
+
</tr>
|
|
1500
|
+
|
|
1501
|
+
|
|
1502
|
+
|
|
1503
|
+
</tbody>
|
|
1504
|
+
</table>
|
|
1505
|
+
</div>
|
|
1506
|
+
|
|
1507
|
+
|
|
1508
|
+
|
|
1509
|
+
|
|
1510
|
+
|
|
1511
|
+
<dl class="details">
|
|
1512
|
+
|
|
1513
|
+
|
|
1514
|
+
|
|
1515
|
+
|
|
1516
|
+
|
|
1517
|
+
|
|
1518
|
+
|
|
1519
|
+
|
|
1520
|
+
|
|
1521
|
+
|
|
1522
|
+
|
|
1523
|
+
|
|
1524
|
+
|
|
1525
|
+
|
|
1526
|
+
|
|
1527
|
+
|
|
1528
|
+
|
|
1529
|
+
|
|
1530
|
+
<dt class="tag-author">Author:</dt>
|
|
1531
|
+
<dd class="tag-author">
|
|
1532
|
+
<ul>
|
|
1533
|
+
<li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
|
|
1534
|
+
</ul>
|
|
1535
|
+
</dd>
|
|
1536
|
+
|
|
1537
|
+
|
|
1538
|
+
|
|
1539
|
+
|
|
1540
|
+
|
|
1541
|
+
|
|
1542
|
+
|
|
1543
|
+
|
|
1544
|
+
|
|
1545
|
+
|
|
1546
|
+
|
|
1547
|
+
|
|
1548
|
+
|
|
1549
|
+
|
|
1550
|
+
<p class="tag-source">
|
|
1551
|
+
<a href="admin_user.js.html" class="button">View Source</a>
|
|
1552
|
+
<span>
|
|
1553
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line167">line 167</a>
|
|
1554
|
+
</span>
|
|
1555
|
+
</p>
|
|
1556
|
+
|
|
1557
|
+
</dl>
|
|
1558
|
+
|
|
1559
|
+
|
|
1560
|
+
|
|
1561
|
+
|
|
1562
|
+
|
|
1563
|
+
|
|
1564
|
+
|
|
1565
|
+
|
|
1566
|
+
|
|
1567
|
+
|
|
1568
|
+
|
|
1569
|
+
|
|
1570
|
+
|
|
1571
|
+
|
|
1572
|
+
|
|
1573
|
+
|
|
1574
|
+
|
|
1575
|
+
|
|
1576
|
+
|
|
1577
|
+
|
|
1578
|
+
|
|
1579
|
+
<h5>Example</h5>
|
|
1580
|
+
|
|
1581
|
+
|
|
1582
|
+
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
1583
|
+
const api = new API();
|
|
1584
|
+
const email = 'ana.silva@gmail.com';
|
|
1585
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
1586
|
+
await api.admin.user.emailExist(email, session);</code></pre>
|
|
1587
|
+
|
|
1588
|
+
|
|
1589
|
+
|
|
1590
|
+
</div>
|
|
1591
|
+
|
|
1592
|
+
<div class="member">
|
|
1593
|
+
|
|
1594
|
+
|
|
1595
|
+
|
|
1596
|
+
<h4 class="name" id="findById">
|
|
1597
|
+
<a class="href-link" href="#findById">#</a>
|
|
1598
|
+
|
|
1599
|
+
|
|
1600
|
+
<span class='tag'>async</span>
|
|
1601
|
+
|
|
1602
|
+
|
|
1603
|
+
<span class="code-name">
|
|
1604
|
+
|
|
1605
|
+
findById<span class="signature">(userId, session)</span><span class="type-signature"> → {Promise}</span>
|
|
1606
|
+
|
|
1607
|
+
</span>
|
|
1608
|
+
</h4>
|
|
1609
|
+
|
|
1610
|
+
|
|
1611
|
+
|
|
1612
|
+
|
|
1613
|
+
<div class="description">
|
|
1614
|
+
Request profile by userId
|
|
1615
|
+
</div>
|
|
1616
|
+
|
|
1617
|
+
|
|
1618
|
+
|
|
1619
|
+
|
|
1620
|
+
|
|
1621
|
+
|
|
1622
|
+
|
|
1623
|
+
|
|
1624
|
+
|
|
1625
|
+
|
|
1626
|
+
<h5>Parameters:</h5>
|
|
1627
|
+
|
|
1628
|
+
<div class="table-container">
|
|
1629
|
+
<table class="params table">
|
|
1630
|
+
<thead>
|
|
1631
|
+
<tr>
|
|
1632
|
+
|
|
1633
|
+
<th>Name</th>
|
|
1634
|
+
|
|
1635
|
+
|
|
1636
|
+
<th>Type</th>
|
|
1637
|
+
|
|
1638
|
+
|
|
1639
|
+
|
|
1640
|
+
|
|
1641
|
+
|
|
1642
|
+
<th class="last">Description</th>
|
|
1643
|
+
</tr>
|
|
1644
|
+
</thead>
|
|
1645
|
+
|
|
1646
|
+
<tbody>
|
|
1647
|
+
|
|
1648
|
+
|
|
1649
|
+
|
|
1650
|
+
<tr class="deep-level-0">
|
|
1651
|
+
|
|
1652
|
+
<td class="name"><code>userId</code></td>
|
|
1653
|
+
|
|
1654
|
+
|
|
1655
|
+
<td class="type">
|
|
1656
|
+
|
|
1657
|
+
|
|
1658
|
+
<code class="param-type">string</code>
|
|
1659
|
+
|
|
1660
|
+
|
|
1661
|
+
|
|
1662
|
+
</td>
|
|
1663
|
+
|
|
1664
|
+
|
|
1665
|
+
|
|
1666
|
+
|
|
1667
|
+
|
|
1668
|
+
<td class="description last">User identifier (_id database)</td>
|
|
1669
|
+
</tr>
|
|
1670
|
+
|
|
1671
|
+
|
|
1672
|
+
|
|
1673
|
+
|
|
1674
|
+
|
|
1675
|
+
<tr class="deep-level-0">
|
|
1676
|
+
|
|
1677
|
+
<td class="name"><code>session</code></td>
|
|
1678
|
+
|
|
1679
|
+
|
|
1680
|
+
<td class="type">
|
|
1681
|
+
|
|
1682
|
+
|
|
1683
|
+
<code class="param-type">string</code>
|
|
1684
|
+
|
|
1685
|
+
|
|
1686
|
+
|
|
1687
|
+
</td>
|
|
1688
|
+
|
|
1689
|
+
|
|
1690
|
+
|
|
1691
|
+
|
|
1692
|
+
|
|
1693
|
+
<td class="description last">Is token JWT</td>
|
|
1694
|
+
</tr>
|
|
1695
|
+
|
|
1696
|
+
|
|
1697
|
+
|
|
1698
|
+
</tbody>
|
|
1699
|
+
</table>
|
|
1700
|
+
</div>
|
|
1701
|
+
|
|
1702
|
+
|
|
1703
|
+
|
|
1704
|
+
|
|
1705
|
+
|
|
1706
|
+
<dl class="details">
|
|
1707
|
+
|
|
1708
|
+
|
|
1709
|
+
|
|
1710
|
+
|
|
1711
|
+
|
|
1712
|
+
|
|
1713
|
+
|
|
1714
|
+
|
|
1715
|
+
|
|
1716
|
+
|
|
1717
|
+
|
|
1718
|
+
|
|
1719
|
+
|
|
1720
|
+
|
|
1721
|
+
|
|
1722
|
+
|
|
1723
|
+
|
|
1724
|
+
|
|
1725
|
+
<dt class="tag-author">Author:</dt>
|
|
1726
|
+
<dd class="tag-author">
|
|
1727
|
+
<ul>
|
|
1728
|
+
<li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
|
|
1729
|
+
</ul>
|
|
1730
|
+
</dd>
|
|
1731
|
+
|
|
1732
|
+
|
|
1733
|
+
|
|
1734
|
+
|
|
1735
|
+
|
|
1736
|
+
|
|
1737
|
+
|
|
1738
|
+
|
|
1739
|
+
|
|
1740
|
+
|
|
1741
|
+
|
|
1742
|
+
|
|
1743
|
+
|
|
1744
|
+
|
|
1745
|
+
<p class="tag-source">
|
|
1746
|
+
<a href="admin_user.js.html" class="button">View Source</a>
|
|
1747
|
+
<span>
|
|
1748
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line66">line 66</a>
|
|
1749
|
+
</span>
|
|
1750
|
+
</p>
|
|
1751
|
+
|
|
1752
|
+
</dl>
|
|
1753
|
+
|
|
1754
|
+
|
|
1755
|
+
|
|
1756
|
+
|
|
1757
|
+
|
|
1758
|
+
|
|
1759
|
+
|
|
1760
|
+
|
|
1761
|
+
|
|
1762
|
+
|
|
1763
|
+
|
|
1764
|
+
|
|
1765
|
+
|
|
1766
|
+
|
|
1767
|
+
|
|
1768
|
+
|
|
1769
|
+
|
|
1770
|
+
|
|
1771
|
+
<div class='columns method-parameter'>
|
|
1772
|
+
<div class="column is-2"><label>Returns:</label></div>
|
|
1773
|
+
<div class="column is-10">
|
|
1774
|
+
|
|
1775
|
+
|
|
1776
|
+
|
|
1777
|
+
<div class="columns">
|
|
1778
|
+
|
|
1779
|
+
|
|
1780
|
+
<div class='column is-5 has-text-left'>
|
|
1781
|
+
<label>Type: </label>
|
|
1782
|
+
|
|
1783
|
+
<code class="param-type">Promise</code>
|
|
1784
|
+
|
|
1785
|
+
|
|
1786
|
+
</div>
|
|
1787
|
+
|
|
1788
|
+
</div>
|
|
1789
|
+
|
|
1790
|
+
|
|
1791
|
+
</div>
|
|
1792
|
+
</div>
|
|
1793
|
+
|
|
1794
|
+
|
|
1795
|
+
|
|
1796
|
+
|
|
1797
|
+
<h5>Example</h5>
|
|
1798
|
+
|
|
1799
|
+
|
|
1800
|
+
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
1801
|
+
const api = new API();
|
|
1802
|
+
const userId = '55e4a3bd6be6b45210833fae';
|
|
1803
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
1804
|
+
await api.admin.user.findById(userId, session);</code></pre>
|
|
1805
|
+
|
|
1806
|
+
|
|
1807
|
+
|
|
1808
|
+
</div>
|
|
1809
|
+
|
|
1810
|
+
<div class="member">
|
|
1811
|
+
|
|
1812
|
+
|
|
1813
|
+
|
|
1814
|
+
<h4 class="name" id="findByIdAndUpdate">
|
|
1815
|
+
<a class="href-link" href="#findByIdAndUpdate">#</a>
|
|
1816
|
+
|
|
1817
|
+
|
|
1818
|
+
<span class='tag'>async</span>
|
|
1819
|
+
|
|
1820
|
+
|
|
1821
|
+
<span class="code-name">
|
|
1822
|
+
|
|
1823
|
+
findByIdAndUpdate<span class="signature">(userId, payload, session)</span><span class="type-signature"> → {Promise.<*>}</span>
|
|
1824
|
+
|
|
1825
|
+
</span>
|
|
1826
|
+
</h4>
|
|
1827
|
+
|
|
1828
|
+
|
|
1829
|
+
|
|
1830
|
+
|
|
1831
|
+
<div class="description">
|
|
1832
|
+
update userData by userSMId
|
|
1833
|
+
</div>
|
|
1834
|
+
|
|
1835
|
+
|
|
1836
|
+
|
|
1837
|
+
|
|
1838
|
+
|
|
1839
|
+
|
|
1840
|
+
|
|
1841
|
+
|
|
1842
|
+
|
|
1843
|
+
|
|
1844
|
+
<h5>Parameters:</h5>
|
|
1845
|
+
|
|
1846
|
+
<div class="table-container">
|
|
1847
|
+
<table class="params table">
|
|
1848
|
+
<thead>
|
|
1849
|
+
<tr>
|
|
1850
|
+
|
|
1851
|
+
<th>Name</th>
|
|
1852
|
+
|
|
1853
|
+
|
|
1854
|
+
<th>Type</th>
|
|
1855
|
+
|
|
1856
|
+
|
|
1857
|
+
|
|
1858
|
+
|
|
1859
|
+
|
|
1860
|
+
<th class="last">Description</th>
|
|
1861
|
+
</tr>
|
|
1862
|
+
</thead>
|
|
1863
|
+
|
|
1864
|
+
<tbody>
|
|
1865
|
+
|
|
1866
|
+
|
|
1867
|
+
|
|
1868
|
+
<tr class="deep-level-0">
|
|
1869
|
+
|
|
1870
|
+
<td class="name"><code>userId</code></td>
|
|
1871
|
+
|
|
1872
|
+
|
|
1873
|
+
<td class="type">
|
|
1874
|
+
|
|
1875
|
+
|
|
1876
|
+
<code class="param-type">string</code>
|
|
1877
|
+
|
|
1878
|
+
|
|
1879
|
+
|
|
1880
|
+
</td>
|
|
1881
|
+
|
|
1882
|
+
|
|
1883
|
+
|
|
1884
|
+
|
|
1885
|
+
|
|
1886
|
+
<td class="description last">User SM Id</td>
|
|
1887
|
+
</tr>
|
|
1888
|
+
|
|
1889
|
+
|
|
1890
|
+
|
|
1891
|
+
|
|
1892
|
+
|
|
1893
|
+
<tr class="deep-level-0">
|
|
1894
|
+
|
|
1895
|
+
<td class="name"><code>payload</code></td>
|
|
1896
|
+
|
|
1897
|
+
|
|
1898
|
+
<td class="type">
|
|
1899
|
+
|
|
1900
|
+
|
|
1901
|
+
<code class="param-type">object</code>
|
|
1902
|
+
|
|
1903
|
+
|
|
1904
|
+
|
|
1905
|
+
</td>
|
|
1906
|
+
|
|
1907
|
+
|
|
1908
|
+
|
|
1909
|
+
|
|
1910
|
+
|
|
1911
|
+
<td class="description last">Payload to update</td>
|
|
1912
|
+
</tr>
|
|
1913
|
+
|
|
1914
|
+
|
|
1915
|
+
|
|
1916
|
+
|
|
1917
|
+
|
|
1918
|
+
<tr class="deep-level-0">
|
|
1919
|
+
|
|
1920
|
+
<td class="name"><code>session</code></td>
|
|
1921
|
+
|
|
1922
|
+
|
|
1923
|
+
<td class="type">
|
|
1924
|
+
|
|
1925
|
+
|
|
1926
|
+
<code class="param-type">string</code>
|
|
1927
|
+
|
|
1928
|
+
|
|
1929
|
+
|
|
1930
|
+
</td>
|
|
1931
|
+
|
|
1932
|
+
|
|
1933
|
+
|
|
1934
|
+
|
|
1935
|
+
|
|
1936
|
+
<td class="description last">Is token JWT</td>
|
|
1937
|
+
</tr>
|
|
1938
|
+
|
|
1939
|
+
|
|
1940
|
+
|
|
1941
|
+
</tbody>
|
|
1942
|
+
</table>
|
|
1943
|
+
</div>
|
|
1944
|
+
|
|
1945
|
+
|
|
1946
|
+
|
|
1947
|
+
|
|
1948
|
+
|
|
1949
|
+
<dl class="details">
|
|
1950
|
+
|
|
1951
|
+
|
|
1952
|
+
|
|
1953
|
+
|
|
1954
|
+
|
|
1955
|
+
|
|
1956
|
+
|
|
1957
|
+
|
|
1958
|
+
|
|
1959
|
+
|
|
1960
|
+
|
|
1961
|
+
|
|
1962
|
+
|
|
1963
|
+
|
|
1964
|
+
|
|
1965
|
+
|
|
1966
|
+
|
|
1967
|
+
|
|
1968
|
+
|
|
1969
|
+
|
|
1970
|
+
|
|
1971
|
+
|
|
1972
|
+
|
|
1973
|
+
|
|
1974
|
+
|
|
1975
|
+
|
|
1976
|
+
|
|
1977
|
+
|
|
1978
|
+
|
|
1979
|
+
|
|
1980
|
+
|
|
1981
|
+
<p class="tag-source">
|
|
1982
|
+
<a href="admin_user.js.html" class="button">View Source</a>
|
|
1983
|
+
<span>
|
|
1984
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line199">line 199</a>
|
|
1985
|
+
</span>
|
|
1986
|
+
</p>
|
|
1987
|
+
|
|
1988
|
+
</dl>
|
|
1989
|
+
|
|
1990
|
+
|
|
1991
|
+
|
|
1992
|
+
|
|
1993
|
+
|
|
1994
|
+
|
|
1995
|
+
|
|
1996
|
+
|
|
1997
|
+
|
|
1998
|
+
|
|
1999
|
+
|
|
2000
|
+
|
|
2001
|
+
|
|
2002
|
+
|
|
2003
|
+
|
|
2004
|
+
|
|
2005
|
+
|
|
2006
|
+
|
|
2007
|
+
<div class='columns method-parameter'>
|
|
2008
|
+
<div class="column is-2"><label>Returns:</label></div>
|
|
2009
|
+
<div class="column is-10">
|
|
2010
|
+
|
|
2011
|
+
|
|
2012
|
+
|
|
2013
|
+
<div class="columns">
|
|
2014
|
+
|
|
2015
|
+
|
|
2016
|
+
<div class='column is-5 has-text-left'>
|
|
2017
|
+
<label>Type: </label>
|
|
2018
|
+
|
|
2019
|
+
<code class="param-type">Promise.<*></code>
|
|
2020
|
+
|
|
2021
|
+
|
|
2022
|
+
</div>
|
|
2023
|
+
|
|
2024
|
+
</div>
|
|
2025
|
+
|
|
2026
|
+
|
|
2027
|
+
</div>
|
|
2028
|
+
</div>
|
|
2029
|
+
|
|
2030
|
+
|
|
2031
|
+
|
|
2032
|
+
|
|
2033
|
+
<h5>Example</h5>
|
|
2034
|
+
|
|
2035
|
+
|
|
2036
|
+
<pre class="prettyprint"><code>const userId = '55e4a3bd6be6b45210833fae';
|
|
2037
|
+
const payload = {
|
|
2038
|
+
name: 'Maria joaquina',
|
|
2039
|
+
email: 'maria@gmail.com'
|
|
2040
|
+
};
|
|
2041
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
2042
|
+
|
|
2043
|
+
|
|
2044
|
+
|
|
2045
|
+
</div>
|
|
2046
|
+
|
|
2047
|
+
<div class="member">
|
|
2048
|
+
|
|
2049
|
+
|
|
2050
|
+
|
|
2051
|
+
<h4 class="name" id="findByIdAndUpdatePassword">
|
|
2052
|
+
<a class="href-link" href="#findByIdAndUpdatePassword">#</a>
|
|
2053
|
+
|
|
2054
|
+
|
|
2055
|
+
<span class='tag'>async</span>
|
|
2056
|
+
|
|
2057
|
+
|
|
2058
|
+
<span class="code-name">
|
|
2059
|
+
|
|
2060
|
+
findByIdAndUpdatePassword<span class="signature">(params, session)</span><span class="type-signature"> → {Promise.<unknown>}</span>
|
|
2061
|
+
|
|
2062
|
+
</span>
|
|
2063
|
+
</h4>
|
|
2064
|
+
|
|
2065
|
+
|
|
2066
|
+
|
|
2067
|
+
|
|
2068
|
+
<div class="description">
|
|
2069
|
+
Update password by userId
|
|
2070
|
+
</div>
|
|
2071
|
+
|
|
2072
|
+
|
|
2073
|
+
|
|
2074
|
+
|
|
2075
|
+
|
|
2076
|
+
|
|
2077
|
+
|
|
2078
|
+
|
|
2079
|
+
|
|
2080
|
+
|
|
2081
|
+
<h5>Parameters:</h5>
|
|
2082
|
+
|
|
2083
|
+
<div class="table-container">
|
|
2084
|
+
<table class="params table">
|
|
2085
|
+
<thead>
|
|
2086
|
+
<tr>
|
|
2087
|
+
|
|
2088
|
+
<th>Name</th>
|
|
2089
|
+
|
|
2090
|
+
|
|
2091
|
+
<th>Type</th>
|
|
2092
|
+
|
|
2093
|
+
|
|
2094
|
+
|
|
2095
|
+
|
|
2096
|
+
|
|
2097
|
+
<th class="last">Description</th>
|
|
2098
|
+
</tr>
|
|
2099
|
+
</thead>
|
|
2100
|
+
|
|
2101
|
+
<tbody>
|
|
2102
|
+
|
|
2103
|
+
|
|
2104
|
+
|
|
2105
|
+
<tr class="deep-level-0">
|
|
2106
|
+
|
|
2107
|
+
<td class="name"><code>params</code></td>
|
|
2108
|
+
|
|
2109
|
+
|
|
2110
|
+
<td class="type">
|
|
2111
|
+
|
|
2112
|
+
|
|
2113
|
+
<code class="param-type">object</code>
|
|
2114
|
+
|
|
2115
|
+
|
|
2116
|
+
|
|
2117
|
+
</td>
|
|
2118
|
+
|
|
2119
|
+
|
|
2120
|
+
|
|
2121
|
+
|
|
2122
|
+
|
|
2123
|
+
<td class="description last">Params to update password</td>
|
|
2124
|
+
</tr>
|
|
2125
|
+
|
|
2126
|
+
|
|
2127
|
+
|
|
2128
|
+
|
|
2129
|
+
<tr class="deep-level-1">
|
|
2130
|
+
|
|
2131
|
+
<td class="name"><code>userId</code></td>
|
|
2132
|
+
|
|
2133
|
+
|
|
2134
|
+
<td class="type">
|
|
2135
|
+
|
|
2136
|
+
|
|
2137
|
+
<code class="param-type">string</code>
|
|
2138
|
+
|
|
2139
|
+
|
|
2140
|
+
|
|
2141
|
+
</td>
|
|
2142
|
+
|
|
2143
|
+
|
|
2144
|
+
|
|
2145
|
+
|
|
2146
|
+
|
|
2147
|
+
<td class="description last">Id of the user</td>
|
|
2148
|
+
</tr>
|
|
2149
|
+
|
|
2150
|
+
|
|
2151
|
+
|
|
2152
|
+
<tr class="deep-level-1">
|
|
2153
|
+
|
|
2154
|
+
<td class="name"><code>oldPassword</code></td>
|
|
2155
|
+
|
|
2156
|
+
|
|
2157
|
+
<td class="type">
|
|
2158
|
+
|
|
2159
|
+
|
|
2160
|
+
<code class="param-type">string</code>
|
|
2161
|
+
|
|
2162
|
+
|
|
2163
|
+
|
|
2164
|
+
</td>
|
|
2165
|
+
|
|
2166
|
+
|
|
2167
|
+
|
|
2168
|
+
|
|
2169
|
+
|
|
2170
|
+
<td class="description last">Old password</td>
|
|
2171
|
+
</tr>
|
|
2172
|
+
|
|
2173
|
+
|
|
2174
|
+
|
|
2175
|
+
<tr class="deep-level-1">
|
|
2176
|
+
|
|
2177
|
+
<td class="name"><code>newPassword</code></td>
|
|
2178
|
+
|
|
2179
|
+
|
|
2180
|
+
<td class="type">
|
|
2181
|
+
|
|
2182
|
+
|
|
2183
|
+
<code class="param-type">string</code>
|
|
2184
|
+
|
|
2185
|
+
|
|
2186
|
+
|
|
2187
|
+
</td>
|
|
2188
|
+
|
|
2189
|
+
|
|
2190
|
+
|
|
2191
|
+
|
|
2192
|
+
|
|
2193
|
+
<td class="description last">New password</td>
|
|
2194
|
+
</tr>
|
|
2195
|
+
|
|
2196
|
+
|
|
2197
|
+
|
|
2198
|
+
|
|
2199
|
+
|
|
2200
|
+
|
|
2201
|
+
|
|
2202
|
+
<tr class="deep-level-0">
|
|
2203
|
+
|
|
2204
|
+
<td class="name"><code>session</code></td>
|
|
2205
|
+
|
|
2206
|
+
|
|
2207
|
+
<td class="type">
|
|
2208
|
+
|
|
2209
|
+
|
|
2210
|
+
<code class="param-type">string</code>
|
|
2211
|
+
|
|
2212
|
+
|
|
2213
|
+
|
|
2214
|
+
</td>
|
|
2215
|
+
|
|
2216
|
+
|
|
2217
|
+
|
|
2218
|
+
|
|
2219
|
+
|
|
2220
|
+
<td class="description last">Is token JWT</td>
|
|
2221
|
+
</tr>
|
|
2222
|
+
|
|
2223
|
+
|
|
2224
|
+
|
|
2225
|
+
</tbody>
|
|
2226
|
+
</table>
|
|
2227
|
+
</div>
|
|
2228
|
+
|
|
2229
|
+
|
|
2230
|
+
|
|
2231
|
+
|
|
2232
|
+
|
|
2233
|
+
<dl class="details">
|
|
2234
|
+
|
|
2235
|
+
|
|
2236
|
+
|
|
2237
|
+
|
|
2238
|
+
|
|
2239
|
+
|
|
2240
|
+
|
|
2241
|
+
|
|
2242
|
+
|
|
2243
|
+
|
|
2244
|
+
|
|
2245
|
+
|
|
2246
|
+
|
|
2247
|
+
|
|
2248
|
+
|
|
2249
|
+
|
|
2250
|
+
|
|
2251
|
+
|
|
2252
|
+
<dt class="tag-author">Author:</dt>
|
|
2253
|
+
<dd class="tag-author">
|
|
2254
|
+
<ul>
|
|
2255
|
+
<li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
|
|
2256
|
+
</ul>
|
|
2257
|
+
</dd>
|
|
2258
|
+
|
|
2259
|
+
|
|
2260
|
+
|
|
2261
|
+
|
|
2262
|
+
|
|
2263
|
+
|
|
2264
|
+
|
|
2265
|
+
|
|
2266
|
+
|
|
2267
|
+
|
|
2268
|
+
|
|
2269
|
+
|
|
2270
|
+
|
|
2271
|
+
|
|
2272
|
+
<p class="tag-source">
|
|
2273
|
+
<a href="admin_user.js.html" class="button">View Source</a>
|
|
2274
|
+
<span>
|
|
2275
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line134">line 134</a>
|
|
2276
|
+
</span>
|
|
2277
|
+
</p>
|
|
2278
|
+
|
|
2279
|
+
</dl>
|
|
2280
|
+
|
|
2281
|
+
|
|
2282
|
+
|
|
2283
|
+
|
|
2284
|
+
|
|
2285
|
+
|
|
2286
|
+
|
|
2287
|
+
|
|
2288
|
+
|
|
2289
|
+
|
|
2290
|
+
|
|
2291
|
+
|
|
2292
|
+
|
|
2293
|
+
|
|
2294
|
+
|
|
2295
|
+
|
|
2296
|
+
|
|
2297
|
+
|
|
2298
|
+
<div class='columns method-parameter'>
|
|
2299
|
+
<div class="column is-2"><label>Returns:</label></div>
|
|
2300
|
+
<div class="column is-10">
|
|
2301
|
+
|
|
2302
|
+
|
|
2303
|
+
|
|
2304
|
+
<div class="columns">
|
|
2305
|
+
|
|
2306
|
+
|
|
2307
|
+
<div class='column is-5 has-text-left'>
|
|
2308
|
+
<label>Type: </label>
|
|
2309
|
+
|
|
2310
|
+
<code class="param-type">Promise.<unknown></code>
|
|
2311
|
+
|
|
2312
|
+
|
|
2313
|
+
</div>
|
|
2314
|
+
|
|
2315
|
+
</div>
|
|
2316
|
+
|
|
2317
|
+
|
|
2318
|
+
</div>
|
|
2319
|
+
</div>
|
|
2320
|
+
|
|
2321
|
+
|
|
2322
|
+
|
|
2323
|
+
|
|
2324
|
+
<h5>Example</h5>
|
|
2325
|
+
|
|
2326
|
+
|
|
2327
|
+
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
2328
|
+
const api = new API();
|
|
2329
|
+
const params = {
|
|
2330
|
+
userId: '55e4a3bd6be6b45210833fae',
|
|
2331
|
+
oldPassword: '123456',
|
|
2332
|
+
newPassword: '123456789'
|
|
2333
|
+
};
|
|
2334
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
2335
|
+
await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
2336
|
+
|
|
2337
|
+
|
|
2338
|
+
|
|
2339
|
+
</div>
|
|
2340
|
+
|
|
2341
|
+
<div class="member">
|
|
2342
|
+
|
|
2343
|
+
|
|
2344
|
+
|
|
2345
|
+
<h4 class="name" id="findByIds">
|
|
2346
|
+
<a class="href-link" href="#findByIds">#</a>
|
|
2347
|
+
|
|
2348
|
+
|
|
2349
|
+
<span class='tag'>async</span>
|
|
2350
|
+
|
|
2351
|
+
|
|
2352
|
+
<span class="code-name">
|
|
2353
|
+
|
|
2354
|
+
findByIds<span class="signature">(userIds, apiKey)</span><span class="type-signature"> → {Promise}</span>
|
|
2355
|
+
|
|
2356
|
+
</span>
|
|
2357
|
+
</h4>
|
|
2358
|
+
|
|
2359
|
+
|
|
2360
|
+
|
|
2361
|
+
|
|
2362
|
+
<div class="description">
|
|
2363
|
+
Request profile by userId
|
|
2364
|
+
</div>
|
|
2365
|
+
|
|
2366
|
+
|
|
2367
|
+
|
|
2368
|
+
|
|
2369
|
+
|
|
2370
|
+
|
|
2371
|
+
|
|
2372
|
+
|
|
2373
|
+
|
|
2374
|
+
|
|
2375
|
+
<h5>Parameters:</h5>
|
|
2376
|
+
|
|
2377
|
+
<div class="table-container">
|
|
2378
|
+
<table class="params table">
|
|
2379
|
+
<thead>
|
|
2380
|
+
<tr>
|
|
2381
|
+
|
|
2382
|
+
<th>Name</th>
|
|
2383
|
+
|
|
2384
|
+
|
|
2385
|
+
<th>Type</th>
|
|
2386
|
+
|
|
2387
|
+
|
|
2388
|
+
|
|
2389
|
+
|
|
2390
|
+
|
|
2391
|
+
<th class="last">Description</th>
|
|
2392
|
+
</tr>
|
|
2393
|
+
</thead>
|
|
2394
|
+
|
|
2395
|
+
<tbody>
|
|
2396
|
+
|
|
2397
|
+
|
|
2398
|
+
|
|
2399
|
+
<tr class="deep-level-0">
|
|
2400
|
+
|
|
2401
|
+
<td class="name"><code>userIds</code></td>
|
|
2402
|
+
|
|
2403
|
+
|
|
2404
|
+
<td class="type">
|
|
2405
|
+
|
|
2406
|
+
|
|
2407
|
+
<code class="param-type">string</code>
|
|
2408
|
+
|
|
2409
|
+
|
|
2410
|
+
|
|
2411
|
+
</td>
|
|
2412
|
+
|
|
2413
|
+
|
|
2414
|
+
|
|
2415
|
+
|
|
2416
|
+
|
|
2417
|
+
<td class="description last">Users identifier (_id database)</td>
|
|
2418
|
+
</tr>
|
|
2419
|
+
|
|
2420
|
+
|
|
2421
|
+
|
|
2422
|
+
|
|
2423
|
+
|
|
2424
|
+
<tr class="deep-level-0">
|
|
2425
|
+
|
|
2426
|
+
<td class="name"><code>apiKey</code></td>
|
|
2427
|
+
|
|
2428
|
+
|
|
2429
|
+
<td class="type">
|
|
2430
|
+
|
|
2431
|
+
|
|
2432
|
+
<code class="param-type">string</code>
|
|
2433
|
+
|
|
2434
|
+
|
|
2435
|
+
|
|
2436
|
+
</td>
|
|
2437
|
+
|
|
2438
|
+
|
|
2439
|
+
|
|
2440
|
+
|
|
2441
|
+
|
|
2442
|
+
<td class="description last">Api to use to search users</td>
|
|
2443
|
+
</tr>
|
|
2444
|
+
|
|
2445
|
+
|
|
2446
|
+
|
|
2447
|
+
</tbody>
|
|
2448
|
+
</table>
|
|
2449
|
+
</div>
|
|
2450
|
+
|
|
2451
|
+
|
|
2452
|
+
|
|
2453
|
+
|
|
2454
|
+
|
|
2455
|
+
<dl class="details">
|
|
2456
|
+
|
|
2457
|
+
|
|
2458
|
+
|
|
2459
|
+
|
|
2460
|
+
|
|
2461
|
+
|
|
2462
|
+
|
|
2463
|
+
|
|
2464
|
+
|
|
2465
|
+
|
|
2466
|
+
|
|
2467
|
+
|
|
2468
|
+
|
|
2469
|
+
|
|
2470
|
+
|
|
2471
|
+
|
|
2472
|
+
|
|
2473
|
+
|
|
2474
|
+
<dt class="tag-author">Author:</dt>
|
|
2475
|
+
<dd class="tag-author">
|
|
2476
|
+
<ul>
|
|
2477
|
+
<li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
|
|
2478
|
+
</ul>
|
|
2479
|
+
</dd>
|
|
2480
|
+
|
|
2481
|
+
|
|
2482
|
+
|
|
2483
|
+
|
|
2484
|
+
|
|
2485
|
+
|
|
2486
|
+
|
|
2487
|
+
|
|
2488
|
+
|
|
2489
|
+
|
|
2490
|
+
|
|
2491
|
+
|
|
2492
|
+
|
|
2493
|
+
|
|
2494
|
+
<p class="tag-source">
|
|
2495
|
+
<a href="admin_user.js.html" class="button">View Source</a>
|
|
2496
|
+
<span>
|
|
2497
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line97">line 97</a>
|
|
2498
|
+
</span>
|
|
2499
|
+
</p>
|
|
2500
|
+
|
|
2501
|
+
</dl>
|
|
2502
|
+
|
|
2503
|
+
|
|
2504
|
+
|
|
2505
|
+
|
|
2506
|
+
|
|
2507
|
+
|
|
2508
|
+
|
|
2509
|
+
|
|
2510
|
+
|
|
2511
|
+
|
|
2512
|
+
|
|
2513
|
+
|
|
2514
|
+
|
|
2515
|
+
|
|
2516
|
+
|
|
2517
|
+
|
|
2518
|
+
|
|
2519
|
+
|
|
2520
|
+
<div class='columns method-parameter'>
|
|
2521
|
+
<div class="column is-2"><label>Returns:</label></div>
|
|
2522
|
+
<div class="column is-10">
|
|
2523
|
+
|
|
2524
|
+
|
|
2525
|
+
|
|
2526
|
+
<div class="columns">
|
|
2527
|
+
|
|
2528
|
+
|
|
2529
|
+
<div class='column is-5 has-text-left'>
|
|
2530
|
+
<label>Type: </label>
|
|
2531
|
+
|
|
2532
|
+
<code class="param-type">Promise</code>
|
|
2533
|
+
|
|
2534
|
+
|
|
2535
|
+
</div>
|
|
2536
|
+
|
|
2537
|
+
</div>
|
|
2538
|
+
|
|
2539
|
+
|
|
2540
|
+
</div>
|
|
2541
|
+
</div>
|
|
2542
|
+
|
|
2543
|
+
|
|
2544
|
+
|
|
2545
|
+
|
|
2546
|
+
<h5>Example</h5>
|
|
2547
|
+
|
|
2548
|
+
|
|
2549
|
+
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
2550
|
+
const api = new API();
|
|
2551
|
+
const userIds = ['55e4a3bd6be6b45210833fae', '55e4a3bd6be6b45210833fae'];
|
|
2552
|
+
const apiKey = 'c9bbd652-d112-454e-8595-f1669f49dde0';
|
|
2553
|
+
await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
2554
|
+
|
|
2555
|
+
|
|
2556
|
+
|
|
2557
|
+
</div>
|
|
2558
|
+
|
|
2559
|
+
<div class="member">
|
|
2560
|
+
|
|
2561
|
+
|
|
2562
|
+
|
|
2563
|
+
<h4 class="name" id="getChangePasswordGuid">
|
|
2564
|
+
<a class="href-link" href="#getChangePasswordGuid">#</a>
|
|
2565
|
+
|
|
2566
|
+
|
|
2567
|
+
<span class='tag'>async</span>
|
|
2568
|
+
|
|
2569
|
+
|
|
2570
|
+
<span class="code-name">
|
|
2571
|
+
|
|
2572
|
+
getChangePasswordGuid<span class="signature">(email)</span><span class="type-signature"> → {Promise.<*>}</span>
|
|
2573
|
+
|
|
2574
|
+
</span>
|
|
2575
|
+
</h4>
|
|
2576
|
+
|
|
2577
|
+
|
|
2578
|
+
|
|
2579
|
+
|
|
2580
|
+
<div class="description">
|
|
2581
|
+
Request GUID to change the password
|
|
2582
|
+
</div>
|
|
2583
|
+
|
|
2584
|
+
|
|
2585
|
+
|
|
2586
|
+
|
|
2587
|
+
|
|
2588
|
+
|
|
2589
|
+
|
|
2590
|
+
|
|
2591
|
+
|
|
2592
|
+
|
|
2593
|
+
<h5>Parameters:</h5>
|
|
2594
|
+
|
|
2595
|
+
<div class="table-container">
|
|
2596
|
+
<table class="params table">
|
|
2597
|
+
<thead>
|
|
2598
|
+
<tr>
|
|
2599
|
+
|
|
2600
|
+
<th>Name</th>
|
|
2601
|
+
|
|
2602
|
+
|
|
2603
|
+
<th>Type</th>
|
|
2604
|
+
|
|
2605
|
+
|
|
2606
|
+
|
|
2607
|
+
|
|
2608
|
+
|
|
2609
|
+
<th class="last">Description</th>
|
|
2610
|
+
</tr>
|
|
2611
|
+
</thead>
|
|
2612
|
+
|
|
2613
|
+
<tbody>
|
|
2614
|
+
|
|
2615
|
+
|
|
2616
|
+
|
|
2617
|
+
<tr class="deep-level-0">
|
|
2618
|
+
|
|
2619
|
+
<td class="name"><code>email</code></td>
|
|
2620
|
+
|
|
2621
|
+
|
|
2622
|
+
<td class="type">
|
|
2623
|
+
|
|
2624
|
+
|
|
2625
|
+
<code class="param-type">string</code>
|
|
2626
|
+
|
|
2627
|
+
|
|
2628
|
+
|
|
2629
|
+
</td>
|
|
2630
|
+
|
|
2631
|
+
|
|
2632
|
+
|
|
2633
|
+
|
|
2634
|
+
|
|
2635
|
+
<td class="description last">User email</td>
|
|
2636
|
+
</tr>
|
|
2637
|
+
|
|
2638
|
+
|
|
2639
|
+
|
|
2640
|
+
</tbody>
|
|
2641
|
+
</table>
|
|
2642
|
+
</div>
|
|
2643
|
+
|
|
2644
|
+
|
|
2645
|
+
|
|
2646
|
+
|
|
2647
|
+
|
|
2648
|
+
<dl class="details">
|
|
2649
|
+
|
|
2650
|
+
|
|
2651
|
+
|
|
2652
|
+
|
|
2653
|
+
|
|
2654
|
+
|
|
2655
|
+
|
|
2656
|
+
|
|
2657
|
+
|
|
2658
|
+
|
|
2659
|
+
|
|
2660
|
+
|
|
2661
|
+
|
|
2662
|
+
|
|
2663
|
+
|
|
2664
|
+
|
|
2665
|
+
|
|
2666
|
+
|
|
2667
|
+
|
|
2668
|
+
|
|
2669
|
+
|
|
2670
|
+
|
|
2671
|
+
|
|
2672
|
+
|
|
2673
|
+
|
|
2674
|
+
|
|
2675
|
+
|
|
2676
|
+
|
|
2677
|
+
|
|
2678
|
+
|
|
2679
|
+
|
|
2680
|
+
<p class="tag-source">
|
|
2681
|
+
<a href="admin_user.js.html" class="button">View Source</a>
|
|
2682
|
+
<span>
|
|
2683
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line304">line 304</a>
|
|
2684
|
+
</span>
|
|
2685
|
+
</p>
|
|
2686
|
+
|
|
2687
|
+
</dl>
|
|
2688
|
+
|
|
2689
|
+
|
|
2690
|
+
|
|
2691
|
+
|
|
2692
|
+
|
|
2693
|
+
|
|
2694
|
+
|
|
2695
|
+
|
|
2696
|
+
|
|
2697
|
+
|
|
2698
|
+
|
|
2699
|
+
|
|
2700
|
+
|
|
2701
|
+
|
|
2702
|
+
|
|
2703
|
+
|
|
2704
|
+
|
|
2705
|
+
|
|
2706
|
+
<div class='columns method-parameter'>
|
|
2707
|
+
<div class="column is-2"><label>Returns:</label></div>
|
|
2708
|
+
<div class="column is-10">
|
|
2709
|
+
|
|
2710
|
+
|
|
2711
|
+
|
|
2712
|
+
<div class="columns">
|
|
2713
|
+
|
|
2714
|
+
|
|
2715
|
+
<div class='column is-5 has-text-left'>
|
|
2716
|
+
<label>Type: </label>
|
|
2717
|
+
|
|
2718
|
+
<code class="param-type">Promise.<*></code>
|
|
2719
|
+
|
|
2720
|
+
|
|
2721
|
+
</div>
|
|
2722
|
+
|
|
2723
|
+
</div>
|
|
2724
|
+
|
|
2725
|
+
|
|
2726
|
+
</div>
|
|
2727
|
+
</div>
|
|
2728
|
+
|
|
2729
|
+
|
|
2730
|
+
|
|
2731
|
+
|
|
2732
|
+
<h5>Example</h5>
|
|
2733
|
+
|
|
2734
|
+
|
|
2735
|
+
<pre class="prettyprint"><code>const payload = {
|
|
2736
|
+
email: 'maria@gmail.com'
|
|
2737
|
+
};
|
|
2738
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
2739
|
+
|
|
2740
|
+
|
|
2741
|
+
|
|
2742
|
+
</div>
|
|
2743
|
+
|
|
2744
|
+
<div class="member">
|
|
2745
|
+
|
|
2746
|
+
|
|
2747
|
+
|
|
2748
|
+
<h4 class="name" id="getGroupsPermissions">
|
|
2749
|
+
<a class="href-link" href="#getGroupsPermissions">#</a>
|
|
2750
|
+
|
|
2751
|
+
|
|
2752
|
+
<span class='tag'>async</span>
|
|
2753
|
+
|
|
2754
|
+
|
|
2755
|
+
<span class="code-name">
|
|
2756
|
+
|
|
2757
|
+
getGroupsPermissions<span class="signature">(orgId, session)</span><span class="type-signature"> → {Promise.<array>}</span>
|
|
2758
|
+
|
|
2759
|
+
</span>
|
|
2760
|
+
</h4>
|
|
2761
|
+
|
|
2762
|
+
|
|
2763
|
+
|
|
2764
|
+
|
|
2765
|
+
<div class="description">
|
|
2766
|
+
Get organization groups with their permissions
|
|
2767
|
+
</div>
|
|
2768
|
+
|
|
2769
|
+
|
|
2770
|
+
|
|
2771
|
+
|
|
2772
|
+
|
|
2773
|
+
|
|
2774
|
+
|
|
2775
|
+
|
|
2776
|
+
|
|
2777
|
+
|
|
2778
|
+
<h5>Parameters:</h5>
|
|
2779
|
+
|
|
2780
|
+
<div class="table-container">
|
|
2781
|
+
<table class="params table">
|
|
2782
|
+
<thead>
|
|
2783
|
+
<tr>
|
|
2784
|
+
|
|
2785
|
+
<th>Name</th>
|
|
2786
|
+
|
|
2787
|
+
|
|
2788
|
+
<th>Type</th>
|
|
2789
|
+
|
|
2790
|
+
|
|
2791
|
+
|
|
2792
|
+
|
|
2793
|
+
|
|
2794
|
+
<th class="last">Description</th>
|
|
2795
|
+
</tr>
|
|
2796
|
+
</thead>
|
|
2797
|
+
|
|
2798
|
+
<tbody>
|
|
2799
|
+
|
|
2800
|
+
|
|
2801
|
+
|
|
2802
|
+
<tr class="deep-level-0">
|
|
2803
|
+
|
|
2804
|
+
<td class="name"><code>orgId</code></td>
|
|
2805
|
+
|
|
2806
|
+
|
|
2807
|
+
<td class="type">
|
|
2808
|
+
|
|
2809
|
+
|
|
2810
|
+
<code class="param-type">string</code>
|
|
2811
|
+
|
|
2812
|
+
|
|
2813
|
+
|
|
2814
|
+
</td>
|
|
2815
|
+
|
|
2816
|
+
|
|
2817
|
+
|
|
2818
|
+
|
|
2819
|
+
|
|
2820
|
+
<td class="description last">Organization ID (required)</td>
|
|
2821
|
+
</tr>
|
|
2822
|
+
|
|
2823
|
+
|
|
2824
|
+
|
|
2825
|
+
|
|
2826
|
+
|
|
2827
|
+
<tr class="deep-level-0">
|
|
2828
|
+
|
|
2829
|
+
<td class="name"><code>session</code></td>
|
|
2830
|
+
|
|
2831
|
+
|
|
2832
|
+
<td class="type">
|
|
2833
|
+
|
|
2834
|
+
|
|
2835
|
+
<code class="param-type">string</code>
|
|
2836
|
+
|
|
2837
|
+
|
|
2838
|
+
|
|
2839
|
+
</td>
|
|
2840
|
+
|
|
2841
|
+
|
|
2842
|
+
|
|
2843
|
+
|
|
2844
|
+
|
|
2845
|
+
<td class="description last">JWT session token</td>
|
|
2846
|
+
</tr>
|
|
2847
|
+
|
|
2848
|
+
|
|
2849
|
+
|
|
2850
|
+
</tbody>
|
|
2851
|
+
</table>
|
|
2852
|
+
</div>
|
|
2853
|
+
|
|
2854
|
+
|
|
2855
|
+
|
|
2856
|
+
|
|
2857
|
+
|
|
2858
|
+
<dl class="details">
|
|
2859
|
+
|
|
2860
|
+
|
|
2861
|
+
|
|
2862
|
+
|
|
2863
|
+
|
|
2864
|
+
|
|
2865
|
+
|
|
2866
|
+
|
|
2867
|
+
|
|
2868
|
+
|
|
2869
|
+
|
|
2870
|
+
|
|
2871
|
+
|
|
2872
|
+
|
|
2873
|
+
|
|
2874
|
+
|
|
2875
|
+
|
|
2876
|
+
|
|
2877
|
+
<dt class="tag-author">Author:</dt>
|
|
2878
|
+
<dd class="tag-author">
|
|
2879
|
+
<ul>
|
|
2880
|
+
<li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
|
|
2881
|
+
</ul>
|
|
2882
|
+
</dd>
|
|
2883
|
+
|
|
2884
|
+
|
|
2885
|
+
|
|
2886
|
+
|
|
2887
|
+
|
|
2888
|
+
|
|
2889
|
+
|
|
2890
|
+
|
|
2891
|
+
|
|
2892
|
+
|
|
2893
|
+
|
|
2894
|
+
|
|
2895
|
+
|
|
2896
|
+
|
|
2897
|
+
<p class="tag-source">
|
|
2898
|
+
<a href="admin_user.js.html" class="button">View Source</a>
|
|
2899
|
+
<span>
|
|
2900
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line565">line 565</a>
|
|
2901
|
+
</span>
|
|
2902
|
+
</p>
|
|
2903
|
+
|
|
2904
|
+
</dl>
|
|
2905
|
+
|
|
2906
|
+
|
|
2907
|
+
|
|
2908
|
+
|
|
2909
|
+
|
|
2910
|
+
|
|
2911
|
+
|
|
2912
|
+
|
|
2913
|
+
|
|
2914
|
+
|
|
2915
|
+
|
|
2916
|
+
|
|
2917
|
+
|
|
2918
|
+
|
|
2919
|
+
|
|
2920
|
+
|
|
2921
|
+
|
|
2922
|
+
|
|
2923
|
+
<div class='columns method-parameter'>
|
|
2924
|
+
<div class="column is-2"><label>Returns:</label></div>
|
|
2925
|
+
<div class="column is-10">
|
|
2926
|
+
|
|
2927
|
+
|
|
2928
|
+
|
|
2929
|
+
<div class="columns">
|
|
2930
|
+
|
|
2931
|
+
<div class='param-desc column is-7'>Array of groups with permissions</div>
|
|
2932
|
+
|
|
2933
|
+
|
|
2934
|
+
<div class='column is-5 has-text-left'>
|
|
2935
|
+
<label>Type: </label>
|
|
2936
|
+
|
|
2937
|
+
<code class="param-type">Promise.<array></code>
|
|
2938
|
+
|
|
2939
|
+
|
|
2940
|
+
</div>
|
|
2941
|
+
|
|
2942
|
+
</div>
|
|
2943
|
+
|
|
2944
|
+
|
|
2945
|
+
</div>
|
|
2946
|
+
</div>
|
|
2947
|
+
|
|
2948
|
+
|
|
2949
|
+
|
|
2950
|
+
|
|
2951
|
+
<h5>Example</h5>
|
|
2952
|
+
|
|
2953
|
+
|
|
2954
|
+
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
2955
|
+
const api = new API();
|
|
2956
|
+
const orgId = '5edd11c46b6ce9729c2c297c';
|
|
2957
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
2958
|
+
const groups = await api.admin.user.getGroupsPermissions(orgId, session);</code></pre>
|
|
2959
|
+
|
|
2960
|
+
|
|
2961
|
+
|
|
2962
|
+
</div>
|
|
2963
|
+
|
|
2964
|
+
<div class="member">
|
|
2965
|
+
|
|
2966
|
+
|
|
2967
|
+
|
|
2968
|
+
<h4 class="name" id="getOrgUsers">
|
|
2969
|
+
<a class="href-link" href="#getOrgUsers">#</a>
|
|
2970
|
+
|
|
2971
|
+
|
|
2972
|
+
<span class='tag'>async</span>
|
|
2973
|
+
|
|
2974
|
+
|
|
2975
|
+
<span class="code-name">
|
|
2976
|
+
|
|
2977
|
+
getOrgUsers<span class="signature">(params, session)</span><span class="type-signature"> → {Promise.<array>}</span>
|
|
2978
|
+
|
|
2979
|
+
</span>
|
|
2980
|
+
</h4>
|
|
2981
|
+
|
|
2982
|
+
|
|
2983
|
+
|
|
2984
|
+
|
|
2985
|
+
<div class="description">
|
|
2986
|
+
Get users belonging to an organization
|
|
2987
|
+
</div>
|
|
2988
|
+
|
|
2989
|
+
|
|
2990
|
+
|
|
2991
|
+
|
|
2992
|
+
|
|
2993
|
+
|
|
2994
|
+
|
|
2995
|
+
|
|
2996
|
+
|
|
2997
|
+
|
|
2998
|
+
<h5>Parameters:</h5>
|
|
2999
|
+
|
|
3000
|
+
<div class="table-container">
|
|
3001
|
+
<table class="params table">
|
|
3002
|
+
<thead>
|
|
3003
|
+
<tr>
|
|
3004
|
+
|
|
3005
|
+
<th>Name</th>
|
|
3006
|
+
|
|
3007
|
+
|
|
3008
|
+
<th>Type</th>
|
|
3009
|
+
|
|
3010
|
+
|
|
3011
|
+
<th>Attributes</th>
|
|
3012
|
+
|
|
3013
|
+
|
|
3014
|
+
|
|
3015
|
+
|
|
3016
|
+
<th class="last">Description</th>
|
|
3017
|
+
</tr>
|
|
3018
|
+
</thead>
|
|
3019
|
+
|
|
3020
|
+
<tbody>
|
|
3021
|
+
|
|
3022
|
+
|
|
3023
|
+
|
|
3024
|
+
<tr class="deep-level-0">
|
|
3025
|
+
|
|
3026
|
+
<td class="name"><code>params</code></td>
|
|
3027
|
+
|
|
3028
|
+
|
|
3029
|
+
<td class="type">
|
|
3030
|
+
|
|
3031
|
+
|
|
3032
|
+
<code class="param-type">object</code>
|
|
3033
|
+
|
|
3034
|
+
|
|
3035
|
+
|
|
3036
|
+
</td>
|
|
3037
|
+
|
|
3038
|
+
|
|
3039
|
+
<td class="attributes">
|
|
3040
|
+
|
|
3041
|
+
|
|
3042
|
+
|
|
3043
|
+
|
|
3044
|
+
|
|
3045
|
+
</td>
|
|
3046
|
+
|
|
3047
|
+
|
|
3048
|
+
|
|
3049
|
+
|
|
3050
|
+
<td class="description last">Parameters</td>
|
|
3051
|
+
</tr>
|
|
3052
|
+
|
|
3053
|
+
|
|
3054
|
+
|
|
3055
|
+
|
|
3056
|
+
<tr class="deep-level-1">
|
|
3057
|
+
|
|
3058
|
+
<td class="name"><code>orgId</code></td>
|
|
3059
|
+
|
|
3060
|
+
|
|
3061
|
+
<td class="type">
|
|
3062
|
+
|
|
3063
|
+
|
|
3064
|
+
<code class="param-type">string</code>
|
|
3065
|
+
|
|
3066
|
+
|
|
3067
|
+
|
|
3068
|
+
</td>
|
|
3069
|
+
|
|
3070
|
+
|
|
3071
|
+
<td class="attributes">
|
|
3072
|
+
|
|
3073
|
+
|
|
3074
|
+
|
|
3075
|
+
|
|
3076
|
+
|
|
3077
|
+
</td>
|
|
3078
|
+
|
|
3079
|
+
|
|
3080
|
+
|
|
3081
|
+
|
|
3082
|
+
<td class="description last">Organization ID (required)</td>
|
|
3083
|
+
</tr>
|
|
3084
|
+
|
|
3085
|
+
|
|
3086
|
+
|
|
3087
|
+
<tr class="deep-level-1">
|
|
3088
|
+
|
|
3089
|
+
<td class="name"><code>userIds</code></td>
|
|
3090
|
+
|
|
3091
|
+
|
|
3092
|
+
<td class="type">
|
|
3093
|
+
|
|
3094
|
+
|
|
3095
|
+
<code class="param-type">array</code>
|
|
3096
|
+
|
|
3097
|
+
|
|
3098
|
+
|
|
3099
|
+
</td>
|
|
3100
|
+
|
|
3101
|
+
|
|
3102
|
+
<td class="attributes">
|
|
3103
|
+
|
|
3104
|
+
<optional><br>
|
|
3105
|
+
|
|
3106
|
+
|
|
3107
|
+
|
|
3108
|
+
|
|
3109
|
+
|
|
3110
|
+
</td>
|
|
3111
|
+
|
|
3112
|
+
|
|
3113
|
+
|
|
3114
|
+
|
|
3115
|
+
<td class="description last">Optional array of user IDs to filter</td>
|
|
3116
|
+
</tr>
|
|
3117
|
+
|
|
3118
|
+
|
|
3119
|
+
|
|
3120
|
+
|
|
3121
|
+
|
|
3122
|
+
|
|
3123
|
+
|
|
3124
|
+
<tr class="deep-level-0">
|
|
3125
|
+
|
|
3126
|
+
<td class="name"><code>session</code></td>
|
|
3127
|
+
|
|
3128
|
+
|
|
3129
|
+
<td class="type">
|
|
3130
|
+
|
|
3131
|
+
|
|
3132
|
+
<code class="param-type">string</code>
|
|
3133
|
+
|
|
3134
|
+
|
|
3135
|
+
|
|
3136
|
+
</td>
|
|
3137
|
+
|
|
3138
|
+
|
|
3139
|
+
<td class="attributes">
|
|
3140
|
+
|
|
3141
|
+
|
|
3142
|
+
|
|
3143
|
+
|
|
3144
|
+
|
|
3145
|
+
</td>
|
|
3146
|
+
|
|
3147
|
+
|
|
3148
|
+
|
|
3149
|
+
|
|
3150
|
+
<td class="description last">JWT session token</td>
|
|
3151
|
+
</tr>
|
|
3152
|
+
|
|
3153
|
+
|
|
3154
|
+
|
|
3155
|
+
</tbody>
|
|
3156
|
+
</table>
|
|
3157
|
+
</div>
|
|
3158
|
+
|
|
3159
|
+
|
|
3160
|
+
|
|
3161
|
+
|
|
3162
|
+
|
|
3163
|
+
<dl class="details">
|
|
3164
|
+
|
|
3165
|
+
|
|
3166
|
+
|
|
3167
|
+
|
|
3168
|
+
|
|
3169
|
+
|
|
3170
|
+
|
|
3171
|
+
|
|
3172
|
+
|
|
3173
|
+
|
|
3174
|
+
|
|
3175
|
+
|
|
3176
|
+
|
|
3177
|
+
|
|
3178
|
+
|
|
3179
|
+
|
|
3180
|
+
|
|
3181
|
+
|
|
3182
|
+
<dt class="tag-author">Author:</dt>
|
|
3183
|
+
<dd class="tag-author">
|
|
3184
|
+
<ul>
|
|
3185
|
+
<li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
|
|
3186
|
+
</ul>
|
|
3187
|
+
</dd>
|
|
3188
|
+
|
|
3189
|
+
|
|
3190
|
+
|
|
3191
|
+
|
|
3192
|
+
|
|
3193
|
+
|
|
3194
|
+
|
|
3195
|
+
|
|
3196
|
+
|
|
3197
|
+
|
|
3198
|
+
|
|
3199
|
+
|
|
3200
|
+
|
|
3201
|
+
|
|
3202
|
+
<p class="tag-source">
|
|
3203
|
+
<a href="admin_user.js.html" class="button">View Source</a>
|
|
3204
|
+
<span>
|
|
3205
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line672">line 672</a>
|
|
3206
|
+
</span>
|
|
3207
|
+
</p>
|
|
3208
|
+
|
|
3209
|
+
</dl>
|
|
3210
|
+
|
|
3211
|
+
|
|
3212
|
+
|
|
3213
|
+
|
|
3214
|
+
|
|
3215
|
+
|
|
3216
|
+
|
|
3217
|
+
|
|
3218
|
+
|
|
3219
|
+
|
|
3220
|
+
|
|
3221
|
+
|
|
3222
|
+
|
|
3223
|
+
|
|
3224
|
+
|
|
3225
|
+
|
|
3226
|
+
|
|
3227
|
+
|
|
3228
|
+
<div class='columns method-parameter'>
|
|
3229
|
+
<div class="column is-2"><label>Returns:</label></div>
|
|
3230
|
+
<div class="column is-10">
|
|
3231
|
+
|
|
3232
|
+
|
|
3233
|
+
|
|
3234
|
+
<div class="columns">
|
|
3235
|
+
|
|
3236
|
+
<div class='param-desc column is-7'>Array of users with id, name, email, title</div>
|
|
3237
|
+
|
|
3238
|
+
|
|
3239
|
+
<div class='column is-5 has-text-left'>
|
|
3240
|
+
<label>Type: </label>
|
|
3241
|
+
|
|
3242
|
+
<code class="param-type">Promise.<array></code>
|
|
3243
|
+
|
|
3244
|
+
|
|
3245
|
+
</div>
|
|
3246
|
+
|
|
3247
|
+
</div>
|
|
3248
|
+
|
|
3249
|
+
|
|
3250
|
+
</div>
|
|
3251
|
+
</div>
|
|
3252
|
+
|
|
3253
|
+
|
|
3254
|
+
|
|
3255
|
+
|
|
3256
|
+
<h5>Example</h5>
|
|
3257
|
+
|
|
3258
|
+
|
|
3259
|
+
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
3260
|
+
const api = new API();
|
|
3261
|
+
const params = { orgId: '5edd11c46b6ce9729c2c297c' };
|
|
3262
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
3263
|
+
const users = await api.admin.user.getOrgUsers(params, session);</code></pre>
|
|
3264
|
+
|
|
3265
|
+
|
|
3266
|
+
|
|
3267
|
+
</div>
|
|
3268
|
+
|
|
3269
|
+
<div class="member">
|
|
3270
|
+
|
|
3271
|
+
|
|
3272
|
+
|
|
3273
|
+
<h4 class="name" id="getOrganizations">
|
|
3274
|
+
<a class="href-link" href="#getOrganizations">#</a>
|
|
3275
|
+
|
|
3276
|
+
|
|
3277
|
+
<span class='tag'>async</span>
|
|
3278
|
+
|
|
3279
|
+
|
|
3280
|
+
<span class="code-name">
|
|
3281
|
+
|
|
3282
|
+
getOrganizations<span class="signature">(session)</span><span class="type-signature"> → {Promise.<array>}</span>
|
|
3283
|
+
|
|
3284
|
+
</span>
|
|
3285
|
+
</h4>
|
|
3286
|
+
|
|
3287
|
+
|
|
3288
|
+
|
|
3289
|
+
|
|
3290
|
+
<div class="description">
|
|
3291
|
+
Get organizations the admin user can manage
|
|
3292
|
+
</div>
|
|
3293
|
+
|
|
3294
|
+
|
|
3295
|
+
|
|
3296
|
+
|
|
3297
|
+
|
|
3298
|
+
|
|
3299
|
+
|
|
3300
|
+
|
|
3301
|
+
|
|
3302
|
+
|
|
3303
|
+
<h5>Parameters:</h5>
|
|
3304
|
+
|
|
3305
|
+
<div class="table-container">
|
|
3306
|
+
<table class="params table">
|
|
3307
|
+
<thead>
|
|
3308
|
+
<tr>
|
|
3309
|
+
|
|
3310
|
+
<th>Name</th>
|
|
3311
|
+
|
|
3312
|
+
|
|
3313
|
+
<th>Type</th>
|
|
3314
|
+
|
|
3315
|
+
|
|
3316
|
+
|
|
3317
|
+
|
|
3318
|
+
|
|
3319
|
+
<th class="last">Description</th>
|
|
3320
|
+
</tr>
|
|
3321
|
+
</thead>
|
|
3322
|
+
|
|
3323
|
+
<tbody>
|
|
3324
|
+
|
|
3325
|
+
|
|
3326
|
+
|
|
3327
|
+
<tr class="deep-level-0">
|
|
3328
|
+
|
|
3329
|
+
<td class="name"><code>session</code></td>
|
|
3330
|
+
|
|
3331
|
+
|
|
3332
|
+
<td class="type">
|
|
3333
|
+
|
|
3334
|
+
|
|
3335
|
+
<code class="param-type">string</code>
|
|
3336
|
+
|
|
3337
|
+
|
|
3338
|
+
|
|
3339
|
+
</td>
|
|
3340
|
+
|
|
3341
|
+
|
|
3342
|
+
|
|
3343
|
+
|
|
3344
|
+
|
|
3345
|
+
<td class="description last">JWT session token</td>
|
|
3346
|
+
</tr>
|
|
3347
|
+
|
|
3348
|
+
|
|
3349
|
+
|
|
3350
|
+
</tbody>
|
|
3351
|
+
</table>
|
|
3352
|
+
</div>
|
|
3353
|
+
|
|
3354
|
+
|
|
3355
|
+
|
|
3356
|
+
|
|
3357
|
+
|
|
3358
|
+
<dl class="details">
|
|
3359
|
+
|
|
3360
|
+
|
|
3361
|
+
|
|
3362
|
+
|
|
3363
|
+
|
|
3364
|
+
|
|
3365
|
+
|
|
3366
|
+
|
|
3367
|
+
|
|
3368
|
+
|
|
3369
|
+
|
|
3370
|
+
|
|
3371
|
+
|
|
3372
|
+
|
|
3373
|
+
|
|
3374
|
+
|
|
3375
|
+
|
|
3376
|
+
|
|
3377
|
+
<dt class="tag-author">Author:</dt>
|
|
3378
|
+
<dd class="tag-author">
|
|
3379
|
+
<ul>
|
|
3380
|
+
<li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
|
|
3381
|
+
</ul>
|
|
3382
|
+
</dd>
|
|
3383
|
+
|
|
3384
|
+
|
|
3385
|
+
|
|
3386
|
+
|
|
3387
|
+
|
|
3388
|
+
|
|
3389
|
+
|
|
3390
|
+
|
|
3391
|
+
|
|
3392
|
+
|
|
3393
|
+
|
|
3394
|
+
|
|
3395
|
+
|
|
3396
|
+
|
|
3397
|
+
<p class="tag-source">
|
|
3398
|
+
<a href="admin_user.js.html" class="button">View Source</a>
|
|
3399
|
+
<span>
|
|
3400
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line641">line 641</a>
|
|
3401
|
+
</span>
|
|
3402
|
+
</p>
|
|
3403
|
+
|
|
3404
|
+
</dl>
|
|
3405
|
+
|
|
3406
|
+
|
|
3407
|
+
|
|
3408
|
+
|
|
3409
|
+
|
|
3410
|
+
|
|
3411
|
+
|
|
3412
|
+
|
|
3413
|
+
|
|
3414
|
+
|
|
3415
|
+
|
|
3416
|
+
|
|
3417
|
+
|
|
3418
|
+
|
|
3419
|
+
|
|
3420
|
+
|
|
3421
|
+
|
|
3422
|
+
|
|
3423
|
+
<div class='columns method-parameter'>
|
|
3424
|
+
<div class="column is-2"><label>Returns:</label></div>
|
|
3425
|
+
<div class="column is-10">
|
|
3426
|
+
|
|
3427
|
+
|
|
3428
|
+
|
|
3429
|
+
<div class="columns">
|
|
3430
|
+
|
|
3431
|
+
<div class='param-desc column is-7'>Array of organizations</div>
|
|
3432
|
+
|
|
3433
|
+
|
|
3434
|
+
<div class='column is-5 has-text-left'>
|
|
3435
|
+
<label>Type: </label>
|
|
3436
|
+
|
|
3437
|
+
<code class="param-type">Promise.<array></code>
|
|
3438
|
+
|
|
3439
|
+
|
|
3440
|
+
</div>
|
|
3441
|
+
|
|
3442
|
+
</div>
|
|
3443
|
+
|
|
3444
|
+
|
|
3445
|
+
</div>
|
|
3446
|
+
</div>
|
|
3447
|
+
|
|
3448
|
+
|
|
3449
|
+
|
|
3450
|
+
|
|
3451
|
+
<h5>Example</h5>
|
|
3452
|
+
|
|
3453
|
+
|
|
3454
|
+
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
3455
|
+
const api = new API();
|
|
3456
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
3457
|
+
const orgs = await api.admin.user.getOrganizations(session);</code></pre>
|
|
3458
|
+
|
|
3459
|
+
|
|
3460
|
+
|
|
3461
|
+
</div>
|
|
3462
|
+
|
|
3463
|
+
<div class="member">
|
|
3464
|
+
|
|
3465
|
+
|
|
3466
|
+
|
|
3467
|
+
<h4 class="name" id="getUserList">
|
|
3468
|
+
<a class="href-link" href="#getUserList">#</a>
|
|
3469
|
+
|
|
3470
|
+
|
|
3471
|
+
<span class='tag'>async</span>
|
|
3472
|
+
|
|
3473
|
+
|
|
3474
|
+
<span class="code-name">
|
|
3475
|
+
|
|
3476
|
+
getUserList<span class="signature">(params, session)</span><span class="type-signature"> → {Promise}</span>
|
|
3477
|
+
|
|
3478
|
+
</span>
|
|
3479
|
+
</h4>
|
|
3480
|
+
|
|
3481
|
+
|
|
3482
|
+
|
|
3483
|
+
|
|
3484
|
+
<div class="description">
|
|
3485
|
+
Request signed url url to put or get
|
|
3486
|
+
</div>
|
|
3487
|
+
|
|
3488
|
+
|
|
3489
|
+
|
|
3490
|
+
|
|
3491
|
+
|
|
3492
|
+
|
|
3493
|
+
|
|
3494
|
+
|
|
3495
|
+
|
|
3496
|
+
|
|
3497
|
+
<h5>Parameters:</h5>
|
|
3498
|
+
|
|
3499
|
+
<div class="table-container">
|
|
3500
|
+
<table class="params table">
|
|
3501
|
+
<thead>
|
|
3502
|
+
<tr>
|
|
3503
|
+
|
|
3504
|
+
<th>Name</th>
|
|
3505
|
+
|
|
3506
|
+
|
|
3507
|
+
<th>Type</th>
|
|
3508
|
+
|
|
3509
|
+
|
|
3510
|
+
|
|
3511
|
+
|
|
3512
|
+
<th>Default</th>
|
|
3513
|
+
|
|
3514
|
+
|
|
3515
|
+
<th class="last">Description</th>
|
|
3516
|
+
</tr>
|
|
3517
|
+
</thead>
|
|
3518
|
+
|
|
3519
|
+
<tbody>
|
|
3520
|
+
|
|
3521
|
+
|
|
3522
|
+
|
|
3523
|
+
<tr class="deep-level-0">
|
|
3524
|
+
|
|
3525
|
+
<td class="name"><code>params</code></td>
|
|
3526
|
+
|
|
3527
|
+
|
|
3528
|
+
<td class="type">
|
|
3529
|
+
|
|
3530
|
+
|
|
3531
|
+
<code class="param-type">object</code>
|
|
3532
|
+
|
|
3533
|
+
|
|
3534
|
+
|
|
3535
|
+
</td>
|
|
3536
|
+
|
|
3537
|
+
|
|
3538
|
+
|
|
3539
|
+
|
|
3540
|
+
<td class="default">
|
|
3541
|
+
|
|
3542
|
+
</td>
|
|
3543
|
+
|
|
3544
|
+
|
|
3545
|
+
<td class="description last">Params to get form list</td>
|
|
3546
|
+
</tr>
|
|
3547
|
+
|
|
3548
|
+
|
|
3549
|
+
|
|
3550
|
+
|
|
3551
|
+
<tr class="deep-level-1">
|
|
3552
|
+
|
|
3553
|
+
<td class="name"><code>page</code></td>
|
|
3554
|
+
|
|
3555
|
+
|
|
3556
|
+
<td class="type">
|
|
3557
|
+
|
|
3558
|
+
|
|
3559
|
+
<code class="param-type">number</code>
|
|
3560
|
+
|
|
3561
|
+
|
|
3562
|
+
|
|
3563
|
+
</td>
|
|
3564
|
+
|
|
3565
|
+
|
|
3566
|
+
|
|
3567
|
+
|
|
3568
|
+
<td class="default">
|
|
3569
|
+
|
|
3570
|
+
1
|
|
3571
|
+
|
|
3572
|
+
</td>
|
|
3573
|
+
|
|
3574
|
+
|
|
3575
|
+
<td class="description last">Page of pagination</td>
|
|
3576
|
+
</tr>
|
|
3577
|
+
|
|
3578
|
+
|
|
3579
|
+
|
|
3580
|
+
<tr class="deep-level-1">
|
|
3581
|
+
|
|
3582
|
+
<td class="name"><code>perPage</code></td>
|
|
3583
|
+
|
|
3584
|
+
|
|
3585
|
+
<td class="type">
|
|
3586
|
+
|
|
3587
|
+
|
|
3588
|
+
<code class="param-type">number</code>
|
|
3589
|
+
|
|
3590
|
+
|
|
3591
|
+
|
|
3592
|
+
</td>
|
|
3593
|
+
|
|
3594
|
+
|
|
3595
|
+
|
|
3596
|
+
|
|
3597
|
+
<td class="default">
|
|
3598
|
+
|
|
3599
|
+
200
|
|
3600
|
+
|
|
3601
|
+
</td>
|
|
3602
|
+
|
|
3603
|
+
|
|
3604
|
+
<td class="description last">Items per page</td>
|
|
3605
|
+
</tr>
|
|
3606
|
+
|
|
3607
|
+
|
|
3608
|
+
|
|
3609
|
+
<tr class="deep-level-1">
|
|
3610
|
+
|
|
3611
|
+
<td class="name"><code>project</code></td>
|
|
3612
|
+
|
|
3613
|
+
|
|
3614
|
+
<td class="type">
|
|
3615
|
+
|
|
3616
|
+
|
|
3617
|
+
<code class="param-type">object</code>
|
|
3618
|
+
|
|
3619
|
+
|
|
3620
|
+
|
|
3621
|
+
</td>
|
|
3622
|
+
|
|
3623
|
+
|
|
3624
|
+
|
|
3625
|
+
|
|
3626
|
+
<td class="default">
|
|
3627
|
+
|
|
3628
|
+
{_id:
|
|
3629
|
+
|
|
3630
|
+
</td>
|
|
3631
|
+
|
|
3632
|
+
|
|
3633
|
+
<td class="description last">1, name: 1} - Fields to project</td>
|
|
3634
|
+
</tr>
|
|
3635
|
+
|
|
3636
|
+
|
|
3637
|
+
|
|
3638
|
+
<tr class="deep-level-1">
|
|
3639
|
+
|
|
3640
|
+
<td class="name"><code>sort</code></td>
|
|
3641
|
+
|
|
3642
|
+
|
|
3643
|
+
<td class="type">
|
|
3644
|
+
|
|
3645
|
+
|
|
3646
|
+
<code class="param-type">object</code>
|
|
3647
|
+
|
|
3648
|
+
|
|
3649
|
+
|
|
3650
|
+
</td>
|
|
3651
|
+
|
|
3652
|
+
|
|
3653
|
+
|
|
3654
|
+
|
|
3655
|
+
<td class="default">
|
|
3656
|
+
|
|
3657
|
+
{name:
|
|
3658
|
+
|
|
3659
|
+
</td>
|
|
3660
|
+
|
|
3661
|
+
|
|
3662
|
+
<td class="description last">1} - Sort fields</td>
|
|
3663
|
+
</tr>
|
|
3664
|
+
|
|
3665
|
+
|
|
3666
|
+
|
|
3667
|
+
|
|
3668
|
+
|
|
3669
|
+
|
|
3670
|
+
|
|
3671
|
+
<tr class="deep-level-0">
|
|
3672
|
+
|
|
3673
|
+
<td class="name"><code>session</code></td>
|
|
3674
|
+
|
|
3675
|
+
|
|
3676
|
+
<td class="type">
|
|
3677
|
+
|
|
3678
|
+
|
|
3679
|
+
<code class="param-type">string</code>
|
|
3680
|
+
|
|
3681
|
+
|
|
3682
|
+
|
|
3683
|
+
</td>
|
|
3684
|
+
|
|
3685
|
+
|
|
3686
|
+
|
|
3687
|
+
|
|
3688
|
+
<td class="default">
|
|
3689
|
+
|
|
3690
|
+
</td>
|
|
3691
|
+
|
|
3692
|
+
|
|
3693
|
+
<td class="description last">Session, token JWT</td>
|
|
3694
|
+
</tr>
|
|
3695
|
+
|
|
3696
|
+
|
|
3697
|
+
|
|
3698
|
+
</tbody>
|
|
3699
|
+
</table>
|
|
3700
|
+
</div>
|
|
3701
|
+
|
|
3702
|
+
|
|
3703
|
+
|
|
3704
|
+
|
|
3705
|
+
|
|
3706
|
+
<dl class="details">
|
|
1011
3707
|
|
|
1012
3708
|
|
|
1013
3709
|
|
|
@@ -1026,6 +3722,13 @@ await api.admin.user.findById(userId, session);</code></pre>
|
|
|
1026
3722
|
|
|
1027
3723
|
|
|
1028
3724
|
|
|
3725
|
+
<dt class="tag-author">Author:</dt>
|
|
3726
|
+
<dd class="tag-author">
|
|
3727
|
+
<ul>
|
|
3728
|
+
<li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
|
|
3729
|
+
</ul>
|
|
3730
|
+
</dd>
|
|
3731
|
+
|
|
1029
3732
|
|
|
1030
3733
|
|
|
1031
3734
|
|
|
@@ -1042,7 +3745,7 @@ await api.admin.user.findById(userId, session);</code></pre>
|
|
|
1042
3745
|
<p class="tag-source">
|
|
1043
3746
|
<a href="admin_user.js.html" class="button">View Source</a>
|
|
1044
3747
|
<span>
|
|
1045
|
-
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#
|
|
3748
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line375">line 375</a>
|
|
1046
3749
|
</span>
|
|
1047
3750
|
</p>
|
|
1048
3751
|
|
|
@@ -1077,7 +3780,7 @@ await api.admin.user.findById(userId, session);</code></pre>
|
|
|
1077
3780
|
<div class='column is-5 has-text-left'>
|
|
1078
3781
|
<label>Type: </label>
|
|
1079
3782
|
|
|
1080
|
-
<code class="param-type">Promise
|
|
3783
|
+
<code class="param-type">Promise</code>
|
|
1081
3784
|
|
|
1082
3785
|
|
|
1083
3786
|
</div>
|
|
@@ -1094,12 +3797,13 @@ await api.admin.user.findById(userId, session);</code></pre>
|
|
|
1094
3797
|
<h5>Example</h5>
|
|
1095
3798
|
|
|
1096
3799
|
|
|
1097
|
-
<pre class="prettyprint"><code>const
|
|
1098
|
-
const
|
|
1099
|
-
|
|
1100
|
-
|
|
3800
|
+
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
3801
|
+
const api = new API();
|
|
3802
|
+
const params - {
|
|
3803
|
+
project: {_id: 1, name: 1, orgId: 1, orgIds: 1},
|
|
1101
3804
|
};
|
|
1102
|
-
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
|
|
3805
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
3806
|
+
await api.user.form.getUserList(params, session);</code></pre>
|
|
1103
3807
|
|
|
1104
3808
|
|
|
1105
3809
|
|
|
@@ -1109,8 +3813,8 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1109
3813
|
|
|
1110
3814
|
|
|
1111
3815
|
|
|
1112
|
-
<h4 class="name" id="
|
|
1113
|
-
<a class="href-link" href="#
|
|
3816
|
+
<h4 class="name" id="remove">
|
|
3817
|
+
<a class="href-link" href="#remove">#</a>
|
|
1114
3818
|
|
|
1115
3819
|
|
|
1116
3820
|
<span class='tag'>async</span>
|
|
@@ -1118,7 +3822,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1118
3822
|
|
|
1119
3823
|
<span class="code-name">
|
|
1120
3824
|
|
|
1121
|
-
|
|
3825
|
+
remove<span class="signature">(userId, session)</span><span class="type-signature"> → {Promise.<object>}</span>
|
|
1122
3826
|
|
|
1123
3827
|
</span>
|
|
1124
3828
|
</h4>
|
|
@@ -1127,7 +3831,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1127
3831
|
|
|
1128
3832
|
|
|
1129
3833
|
<div class="description">
|
|
1130
|
-
|
|
3834
|
+
Remove a user
|
|
1131
3835
|
</div>
|
|
1132
3836
|
|
|
1133
3837
|
|
|
@@ -1165,13 +3869,13 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1165
3869
|
|
|
1166
3870
|
<tr class="deep-level-0">
|
|
1167
3871
|
|
|
1168
|
-
<td class="name"><code>
|
|
3872
|
+
<td class="name"><code>userId</code></td>
|
|
1169
3873
|
|
|
1170
3874
|
|
|
1171
3875
|
<td class="type">
|
|
1172
3876
|
|
|
1173
3877
|
|
|
1174
|
-
<code class="param-type">
|
|
3878
|
+
<code class="param-type">string</code>
|
|
1175
3879
|
|
|
1176
3880
|
|
|
1177
3881
|
|
|
@@ -1181,15 +3885,16 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1181
3885
|
|
|
1182
3886
|
|
|
1183
3887
|
|
|
1184
|
-
<td class="description last">
|
|
3888
|
+
<td class="description last">User ID to remove (required)</td>
|
|
1185
3889
|
</tr>
|
|
1186
3890
|
|
|
3891
|
+
|
|
3892
|
+
|
|
3893
|
+
|
|
3894
|
+
|
|
3895
|
+
<tr class="deep-level-0">
|
|
1187
3896
|
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
<tr class="deep-level-1">
|
|
1191
|
-
|
|
1192
|
-
<td class="name"><code>userId</code></td>
|
|
3897
|
+
<td class="name"><code>session</code></td>
|
|
1193
3898
|
|
|
1194
3899
|
|
|
1195
3900
|
<td class="type">
|
|
@@ -1205,37 +3910,186 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1205
3910
|
|
|
1206
3911
|
|
|
1207
3912
|
|
|
1208
|
-
<td class="description last">
|
|
3913
|
+
<td class="description last">JWT session token</td>
|
|
1209
3914
|
</tr>
|
|
1210
3915
|
|
|
1211
|
-
|
|
3916
|
+
|
|
3917
|
+
|
|
3918
|
+
</tbody>
|
|
3919
|
+
</table>
|
|
3920
|
+
</div>
|
|
3921
|
+
|
|
3922
|
+
|
|
3923
|
+
|
|
3924
|
+
|
|
3925
|
+
|
|
3926
|
+
<dl class="details">
|
|
3927
|
+
|
|
1212
3928
|
|
|
1213
|
-
<tr class="deep-level-1">
|
|
1214
|
-
|
|
1215
|
-
<td class="name"><code>oldPassword</code></td>
|
|
1216
|
-
|
|
1217
3929
|
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
<code class="param-type">string</code>
|
|
3930
|
+
|
|
1222
3931
|
|
|
3932
|
+
|
|
1223
3933
|
|
|
1224
|
-
|
|
1225
|
-
</td>
|
|
3934
|
+
|
|
1226
3935
|
|
|
1227
|
-
|
|
3936
|
+
|
|
1228
3937
|
|
|
1229
|
-
|
|
3938
|
+
|
|
1230
3939
|
|
|
1231
|
-
|
|
1232
|
-
</tr>
|
|
3940
|
+
|
|
1233
3941
|
|
|
1234
|
-
|
|
1235
3942
|
|
|
1236
|
-
|
|
3943
|
+
|
|
3944
|
+
|
|
3945
|
+
<dt class="tag-author">Author:</dt>
|
|
3946
|
+
<dd class="tag-author">
|
|
3947
|
+
<ul>
|
|
3948
|
+
<li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
|
|
3949
|
+
</ul>
|
|
3950
|
+
</dd>
|
|
3951
|
+
|
|
3952
|
+
|
|
3953
|
+
|
|
3954
|
+
|
|
3955
|
+
|
|
3956
|
+
|
|
3957
|
+
|
|
3958
|
+
|
|
3959
|
+
|
|
3960
|
+
|
|
3961
|
+
|
|
3962
|
+
|
|
3963
|
+
|
|
3964
|
+
|
|
3965
|
+
<p class="tag-source">
|
|
3966
|
+
<a href="admin_user.js.html" class="button">View Source</a>
|
|
3967
|
+
<span>
|
|
3968
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line277">line 277</a>
|
|
3969
|
+
</span>
|
|
3970
|
+
</p>
|
|
3971
|
+
|
|
3972
|
+
</dl>
|
|
3973
|
+
|
|
3974
|
+
|
|
3975
|
+
|
|
3976
|
+
|
|
3977
|
+
|
|
3978
|
+
|
|
3979
|
+
|
|
3980
|
+
|
|
3981
|
+
|
|
3982
|
+
|
|
3983
|
+
|
|
3984
|
+
|
|
3985
|
+
|
|
3986
|
+
|
|
3987
|
+
|
|
3988
|
+
|
|
3989
|
+
|
|
3990
|
+
|
|
3991
|
+
<div class='columns method-parameter'>
|
|
3992
|
+
<div class="column is-2"><label>Returns:</label></div>
|
|
3993
|
+
<div class="column is-10">
|
|
3994
|
+
|
|
3995
|
+
|
|
3996
|
+
|
|
3997
|
+
<div class="columns">
|
|
3998
|
+
|
|
3999
|
+
<div class='param-desc column is-7'>Removal confirmation</div>
|
|
4000
|
+
|
|
4001
|
+
|
|
4002
|
+
<div class='column is-5 has-text-left'>
|
|
4003
|
+
<label>Type: </label>
|
|
4004
|
+
|
|
4005
|
+
<code class="param-type">Promise.<object></code>
|
|
4006
|
+
|
|
4007
|
+
|
|
4008
|
+
</div>
|
|
4009
|
+
|
|
4010
|
+
</div>
|
|
4011
|
+
|
|
4012
|
+
|
|
4013
|
+
</div>
|
|
4014
|
+
</div>
|
|
4015
|
+
|
|
4016
|
+
|
|
4017
|
+
|
|
4018
|
+
|
|
4019
|
+
<h5>Example</h5>
|
|
4020
|
+
|
|
4021
|
+
|
|
4022
|
+
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
4023
|
+
const api = new API();
|
|
4024
|
+
const userId = '55e4a3bd6be6b45210833fae';
|
|
4025
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
4026
|
+
await api.admin.user.remove(userId, session);</code></pre>
|
|
4027
|
+
|
|
4028
|
+
|
|
4029
|
+
|
|
4030
|
+
</div>
|
|
4031
|
+
|
|
4032
|
+
<div class="member">
|
|
4033
|
+
|
|
4034
|
+
|
|
4035
|
+
|
|
4036
|
+
<h4 class="name" id="unblock">
|
|
4037
|
+
<a class="href-link" href="#unblock">#</a>
|
|
4038
|
+
|
|
4039
|
+
|
|
4040
|
+
<span class='tag'>async</span>
|
|
4041
|
+
|
|
4042
|
+
|
|
4043
|
+
<span class="code-name">
|
|
4044
|
+
|
|
4045
|
+
unblock<span class="signature">(userId, session)</span><span class="type-signature"> → {Promise.<object>}</span>
|
|
4046
|
+
|
|
4047
|
+
</span>
|
|
4048
|
+
</h4>
|
|
4049
|
+
|
|
4050
|
+
|
|
4051
|
+
|
|
4052
|
+
|
|
4053
|
+
<div class="description">
|
|
4054
|
+
Unblock a user (allow login)
|
|
4055
|
+
</div>
|
|
4056
|
+
|
|
4057
|
+
|
|
4058
|
+
|
|
4059
|
+
|
|
4060
|
+
|
|
4061
|
+
|
|
4062
|
+
|
|
4063
|
+
|
|
4064
|
+
|
|
4065
|
+
|
|
4066
|
+
<h5>Parameters:</h5>
|
|
4067
|
+
|
|
4068
|
+
<div class="table-container">
|
|
4069
|
+
<table class="params table">
|
|
4070
|
+
<thead>
|
|
4071
|
+
<tr>
|
|
4072
|
+
|
|
4073
|
+
<th>Name</th>
|
|
4074
|
+
|
|
4075
|
+
|
|
4076
|
+
<th>Type</th>
|
|
4077
|
+
|
|
4078
|
+
|
|
4079
|
+
|
|
4080
|
+
|
|
4081
|
+
|
|
4082
|
+
<th class="last">Description</th>
|
|
4083
|
+
</tr>
|
|
4084
|
+
</thead>
|
|
4085
|
+
|
|
4086
|
+
<tbody>
|
|
4087
|
+
|
|
4088
|
+
|
|
4089
|
+
|
|
4090
|
+
<tr class="deep-level-0">
|
|
1237
4091
|
|
|
1238
|
-
<td class="name"><code>
|
|
4092
|
+
<td class="name"><code>userId</code></td>
|
|
1239
4093
|
|
|
1240
4094
|
|
|
1241
4095
|
<td class="type">
|
|
@@ -1251,11 +4105,9 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1251
4105
|
|
|
1252
4106
|
|
|
1253
4107
|
|
|
1254
|
-
<td class="description last">
|
|
4108
|
+
<td class="description last">User ID to unblock (required)</td>
|
|
1255
4109
|
</tr>
|
|
1256
4110
|
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
4111
|
|
|
1260
4112
|
|
|
1261
4113
|
|
|
@@ -1278,7 +4130,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1278
4130
|
|
|
1279
4131
|
|
|
1280
4132
|
|
|
1281
|
-
<td class="description last">
|
|
4133
|
+
<td class="description last">JWT session token</td>
|
|
1282
4134
|
</tr>
|
|
1283
4135
|
|
|
1284
4136
|
|
|
@@ -1333,7 +4185,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1333
4185
|
<p class="tag-source">
|
|
1334
4186
|
<a href="admin_user.js.html" class="button">View Source</a>
|
|
1335
4187
|
<span>
|
|
1336
|
-
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#
|
|
4188
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line454">line 454</a>
|
|
1337
4189
|
</span>
|
|
1338
4190
|
</p>
|
|
1339
4191
|
|
|
@@ -1364,11 +4216,13 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1364
4216
|
|
|
1365
4217
|
<div class="columns">
|
|
1366
4218
|
|
|
4219
|
+
<div class='param-desc column is-7'>Updated user</div>
|
|
4220
|
+
|
|
1367
4221
|
|
|
1368
4222
|
<div class='column is-5 has-text-left'>
|
|
1369
4223
|
<label>Type: </label>
|
|
1370
4224
|
|
|
1371
|
-
<code class="param-type">Promise.<
|
|
4225
|
+
<code class="param-type">Promise.<object></code>
|
|
1372
4226
|
|
|
1373
4227
|
|
|
1374
4228
|
</div>
|
|
@@ -1387,13 +4241,9 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1387
4241
|
|
|
1388
4242
|
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
1389
4243
|
const api = new API();
|
|
1390
|
-
const
|
|
1391
|
-
userId: '55e4a3bd6be6b45210833fae',
|
|
1392
|
-
oldPassword: '123456',
|
|
1393
|
-
newPassword: '123456789'
|
|
1394
|
-
};
|
|
4244
|
+
const userId = '55e4a3bd6be6b45210833fae';
|
|
1395
4245
|
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
1396
|
-
await api.admin.user.
|
|
4246
|
+
await api.admin.user.unblock(userId, session);</code></pre>
|
|
1397
4247
|
|
|
1398
4248
|
|
|
1399
4249
|
|
|
@@ -1403,8 +4253,8 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1403
4253
|
|
|
1404
4254
|
|
|
1405
4255
|
|
|
1406
|
-
<h4 class="name" id="
|
|
1407
|
-
<a class="href-link" href="#
|
|
4256
|
+
<h4 class="name" id="unblockEmail">
|
|
4257
|
+
<a class="href-link" href="#unblockEmail">#</a>
|
|
1408
4258
|
|
|
1409
4259
|
|
|
1410
4260
|
<span class='tag'>async</span>
|
|
@@ -1412,7 +4262,7 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1412
4262
|
|
|
1413
4263
|
<span class="code-name">
|
|
1414
4264
|
|
|
1415
|
-
|
|
4265
|
+
unblockEmail<span class="signature">(userId, session)</span><span class="type-signature"> → {Promise.<object>}</span>
|
|
1416
4266
|
|
|
1417
4267
|
</span>
|
|
1418
4268
|
</h4>
|
|
@@ -1421,7 +4271,7 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1421
4271
|
|
|
1422
4272
|
|
|
1423
4273
|
<div class="description">
|
|
1424
|
-
|
|
4274
|
+
Unblock email notifications for a user
|
|
1425
4275
|
</div>
|
|
1426
4276
|
|
|
1427
4277
|
|
|
@@ -1459,7 +4309,7 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1459
4309
|
|
|
1460
4310
|
<tr class="deep-level-0">
|
|
1461
4311
|
|
|
1462
|
-
<td class="name"><code>
|
|
4312
|
+
<td class="name"><code>userId</code></td>
|
|
1463
4313
|
|
|
1464
4314
|
|
|
1465
4315
|
<td class="type">
|
|
@@ -1475,7 +4325,7 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1475
4325
|
|
|
1476
4326
|
|
|
1477
4327
|
|
|
1478
|
-
<td class="description last">
|
|
4328
|
+
<td class="description last">User ID (required)</td>
|
|
1479
4329
|
</tr>
|
|
1480
4330
|
|
|
1481
4331
|
|
|
@@ -1484,7 +4334,7 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1484
4334
|
|
|
1485
4335
|
<tr class="deep-level-0">
|
|
1486
4336
|
|
|
1487
|
-
<td class="name"><code>
|
|
4337
|
+
<td class="name"><code>session</code></td>
|
|
1488
4338
|
|
|
1489
4339
|
|
|
1490
4340
|
<td class="type">
|
|
@@ -1500,7 +4350,7 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1500
4350
|
|
|
1501
4351
|
|
|
1502
4352
|
|
|
1503
|
-
<td class="description last">
|
|
4353
|
+
<td class="description last">JWT session token</td>
|
|
1504
4354
|
</tr>
|
|
1505
4355
|
|
|
1506
4356
|
|
|
@@ -1555,7 +4405,7 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1555
4405
|
<p class="tag-source">
|
|
1556
4406
|
<a href="admin_user.js.html" class="button">View Source</a>
|
|
1557
4407
|
<span>
|
|
1558
|
-
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#
|
|
4408
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line500">line 500</a>
|
|
1559
4409
|
</span>
|
|
1560
4410
|
</p>
|
|
1561
4411
|
|
|
@@ -1586,11 +4436,13 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1586
4436
|
|
|
1587
4437
|
<div class="columns">
|
|
1588
4438
|
|
|
4439
|
+
<div class='param-desc column is-7'>Updated user</div>
|
|
4440
|
+
|
|
1589
4441
|
|
|
1590
4442
|
<div class='column is-5 has-text-left'>
|
|
1591
4443
|
<label>Type: </label>
|
|
1592
4444
|
|
|
1593
|
-
<code class="param-type">Promise
|
|
4445
|
+
<code class="param-type">Promise.<object></code>
|
|
1594
4446
|
|
|
1595
4447
|
|
|
1596
4448
|
</div>
|
|
@@ -1604,25 +4456,14 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1604
4456
|
|
|
1605
4457
|
|
|
1606
4458
|
|
|
1607
|
-
<h5>Example</h5>
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
1611
|
-
const api = new API();
|
|
1612
|
-
const userIds = ['55e4a3bd6be6b45210833fae', '55e4a3bd6be6b45210833fae'];
|
|
1613
|
-
const apiKey = 'c9bbd652-d112-454e-8595-f1669f49dde0';
|
|
1614
|
-
await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
4459
|
</div>
|
|
1619
4460
|
|
|
1620
4461
|
<div class="member">
|
|
1621
4462
|
|
|
1622
4463
|
|
|
1623
4464
|
|
|
1624
|
-
<h4 class="name" id="
|
|
1625
|
-
<a class="href-link" href="#
|
|
4465
|
+
<h4 class="name" id="updateUserGroups">
|
|
4466
|
+
<a class="href-link" href="#updateUserGroups">#</a>
|
|
1626
4467
|
|
|
1627
4468
|
|
|
1628
4469
|
<span class='tag'>async</span>
|
|
@@ -1630,7 +4471,7 @@ await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
|
1630
4471
|
|
|
1631
4472
|
<span class="code-name">
|
|
1632
4473
|
|
|
1633
|
-
|
|
4474
|
+
updateUserGroups<span class="signature">(params, session)</span><span class="type-signature"> → {Promise.<object>}</span>
|
|
1634
4475
|
|
|
1635
4476
|
</span>
|
|
1636
4477
|
</h4>
|
|
@@ -1639,7 +4480,7 @@ await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
|
1639
4480
|
|
|
1640
4481
|
|
|
1641
4482
|
<div class="description">
|
|
1642
|
-
|
|
4483
|
+
Update user's group memberships in an organization
|
|
1643
4484
|
</div>
|
|
1644
4485
|
|
|
1645
4486
|
|
|
@@ -1677,7 +4518,31 @@ await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
|
1677
4518
|
|
|
1678
4519
|
<tr class="deep-level-0">
|
|
1679
4520
|
|
|
1680
|
-
<td class="name"><code>
|
|
4521
|
+
<td class="name"><code>params</code></td>
|
|
4522
|
+
|
|
4523
|
+
|
|
4524
|
+
<td class="type">
|
|
4525
|
+
|
|
4526
|
+
|
|
4527
|
+
<code class="param-type">object</code>
|
|
4528
|
+
|
|
4529
|
+
|
|
4530
|
+
|
|
4531
|
+
</td>
|
|
4532
|
+
|
|
4533
|
+
|
|
4534
|
+
|
|
4535
|
+
|
|
4536
|
+
|
|
4537
|
+
<td class="description last">Parameters</td>
|
|
4538
|
+
</tr>
|
|
4539
|
+
|
|
4540
|
+
|
|
4541
|
+
|
|
4542
|
+
|
|
4543
|
+
<tr class="deep-level-1">
|
|
4544
|
+
|
|
4545
|
+
<td class="name"><code>orgId</code></td>
|
|
1681
4546
|
|
|
1682
4547
|
|
|
1683
4548
|
<td class="type">
|
|
@@ -1693,7 +4558,80 @@ await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
|
1693
4558
|
|
|
1694
4559
|
|
|
1695
4560
|
|
|
1696
|
-
<td class="description last">
|
|
4561
|
+
<td class="description last">Organization ID (required)</td>
|
|
4562
|
+
</tr>
|
|
4563
|
+
|
|
4564
|
+
|
|
4565
|
+
|
|
4566
|
+
<tr class="deep-level-1">
|
|
4567
|
+
|
|
4568
|
+
<td class="name"><code>userId</code></td>
|
|
4569
|
+
|
|
4570
|
+
|
|
4571
|
+
<td class="type">
|
|
4572
|
+
|
|
4573
|
+
|
|
4574
|
+
<code class="param-type">string</code>
|
|
4575
|
+
|
|
4576
|
+
|
|
4577
|
+
|
|
4578
|
+
</td>
|
|
4579
|
+
|
|
4580
|
+
|
|
4581
|
+
|
|
4582
|
+
|
|
4583
|
+
|
|
4584
|
+
<td class="description last">User ID (required)</td>
|
|
4585
|
+
</tr>
|
|
4586
|
+
|
|
4587
|
+
|
|
4588
|
+
|
|
4589
|
+
<tr class="deep-level-1">
|
|
4590
|
+
|
|
4591
|
+
<td class="name"><code>groups</code></td>
|
|
4592
|
+
|
|
4593
|
+
|
|
4594
|
+
<td class="type">
|
|
4595
|
+
|
|
4596
|
+
|
|
4597
|
+
<code class="param-type">array</code>
|
|
4598
|
+
|
|
4599
|
+
|
|
4600
|
+
|
|
4601
|
+
</td>
|
|
4602
|
+
|
|
4603
|
+
|
|
4604
|
+
|
|
4605
|
+
|
|
4606
|
+
|
|
4607
|
+
<td class="description last">Array of group IDs (required)</td>
|
|
4608
|
+
</tr>
|
|
4609
|
+
|
|
4610
|
+
|
|
4611
|
+
|
|
4612
|
+
|
|
4613
|
+
|
|
4614
|
+
|
|
4615
|
+
|
|
4616
|
+
<tr class="deep-level-0">
|
|
4617
|
+
|
|
4618
|
+
<td class="name"><code>session</code></td>
|
|
4619
|
+
|
|
4620
|
+
|
|
4621
|
+
<td class="type">
|
|
4622
|
+
|
|
4623
|
+
|
|
4624
|
+
<code class="param-type">string</code>
|
|
4625
|
+
|
|
4626
|
+
|
|
4627
|
+
|
|
4628
|
+
</td>
|
|
4629
|
+
|
|
4630
|
+
|
|
4631
|
+
|
|
4632
|
+
|
|
4633
|
+
|
|
4634
|
+
<td class="description last">JWT session token</td>
|
|
1697
4635
|
</tr>
|
|
1698
4636
|
|
|
1699
4637
|
|
|
@@ -1725,6 +4663,13 @@ await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
|
1725
4663
|
|
|
1726
4664
|
|
|
1727
4665
|
|
|
4666
|
+
<dt class="tag-author">Author:</dt>
|
|
4667
|
+
<dd class="tag-author">
|
|
4668
|
+
<ul>
|
|
4669
|
+
<li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
|
|
4670
|
+
</ul>
|
|
4671
|
+
</dd>
|
|
4672
|
+
|
|
1728
4673
|
|
|
1729
4674
|
|
|
1730
4675
|
|
|
@@ -1741,7 +4686,7 @@ await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
|
1741
4686
|
<p class="tag-source">
|
|
1742
4687
|
<a href="admin_user.js.html" class="button">View Source</a>
|
|
1743
4688
|
<span>
|
|
1744
|
-
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#
|
|
4689
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line605">line 605</a>
|
|
1745
4690
|
</span>
|
|
1746
4691
|
</p>
|
|
1747
4692
|
|
|
@@ -1772,11 +4717,13 @@ await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
|
1772
4717
|
|
|
1773
4718
|
<div class="columns">
|
|
1774
4719
|
|
|
4720
|
+
<div class='param-desc column is-7'>Updated groups</div>
|
|
4721
|
+
|
|
1775
4722
|
|
|
1776
4723
|
<div class='column is-5 has-text-left'>
|
|
1777
4724
|
<label>Type: </label>
|
|
1778
4725
|
|
|
1779
|
-
<code class="param-type">Promise.<
|
|
4726
|
+
<code class="param-type">Promise.<object></code>
|
|
1780
4727
|
|
|
1781
4728
|
|
|
1782
4729
|
</div>
|
|
@@ -1793,10 +4740,15 @@ await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
|
1793
4740
|
<h5>Example</h5>
|
|
1794
4741
|
|
|
1795
4742
|
|
|
1796
|
-
<pre class="prettyprint"><code>const
|
|
1797
|
-
|
|
4743
|
+
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
4744
|
+
const api = new API();
|
|
4745
|
+
const params = {
|
|
4746
|
+
orgId: '5edd11c46b6ce9729c2c297c',
|
|
4747
|
+
userId: '55e4a3bd6be6b45210833fae',
|
|
4748
|
+
groups: ['groupId1', 'groupId2']
|
|
1798
4749
|
};
|
|
1799
|
-
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
|
|
4750
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
4751
|
+
await api.admin.user.updateUserGroups(params, session);</code></pre>
|
|
1800
4752
|
|
|
1801
4753
|
|
|
1802
4754
|
|
|
@@ -1806,8 +4758,8 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1806
4758
|
|
|
1807
4759
|
|
|
1808
4760
|
|
|
1809
|
-
<h4 class="name" id="
|
|
1810
|
-
<a class="href-link" href="#
|
|
4761
|
+
<h4 class="name" id="updateUserType">
|
|
4762
|
+
<a class="href-link" href="#updateUserType">#</a>
|
|
1811
4763
|
|
|
1812
4764
|
|
|
1813
4765
|
<span class='tag'>async</span>
|
|
@@ -1815,7 +4767,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1815
4767
|
|
|
1816
4768
|
<span class="code-name">
|
|
1817
4769
|
|
|
1818
|
-
|
|
4770
|
+
updateUserType<span class="signature">(params, session)</span><span class="type-signature"> → {Promise.<object>}</span>
|
|
1819
4771
|
|
|
1820
4772
|
</span>
|
|
1821
4773
|
</h4>
|
|
@@ -1824,7 +4776,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1824
4776
|
|
|
1825
4777
|
|
|
1826
4778
|
<div class="description">
|
|
1827
|
-
|
|
4779
|
+
Update user type classification
|
|
1828
4780
|
</div>
|
|
1829
4781
|
|
|
1830
4782
|
|
|
@@ -1851,8 +4803,6 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1851
4803
|
|
|
1852
4804
|
|
|
1853
4805
|
|
|
1854
|
-
<th>Default</th>
|
|
1855
|
-
|
|
1856
4806
|
|
|
1857
4807
|
<th class="last">Description</th>
|
|
1858
4808
|
</tr>
|
|
@@ -1879,84 +4829,22 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1879
4829
|
|
|
1880
4830
|
|
|
1881
4831
|
|
|
1882
|
-
<td class="default">
|
|
1883
|
-
|
|
1884
|
-
</td>
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
<td class="description last">Params to get form list</td>
|
|
1888
|
-
</tr>
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
<tr class="deep-level-1">
|
|
1894
|
-
|
|
1895
|
-
<td class="name"><code>page</code></td>
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
<td class="type">
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
<code class="param-type">number</code>
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
</td>
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
<td class="default">
|
|
1911
|
-
|
|
1912
|
-
1
|
|
1913
|
-
|
|
1914
|
-
</td>
|
|
1915
|
-
|
|
1916
4832
|
|
|
1917
|
-
<td class="description last">
|
|
4833
|
+
<td class="description last">Parameters</td>
|
|
1918
4834
|
</tr>
|
|
1919
4835
|
|
|
1920
4836
|
|
|
1921
|
-
|
|
1922
|
-
<tr class="deep-level-1">
|
|
1923
|
-
|
|
1924
|
-
<td class="name"><code>perPage</code></td>
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
<td class="type">
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
<code class="param-type">number</code>
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
</td>
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
<td class="default">
|
|
1940
|
-
|
|
1941
|
-
200
|
|
1942
|
-
|
|
1943
|
-
</td>
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
<td class="description last">Items per page</td>
|
|
1947
|
-
</tr>
|
|
1948
|
-
|
|
1949
4837
|
|
|
1950
4838
|
|
|
1951
4839
|
<tr class="deep-level-1">
|
|
1952
4840
|
|
|
1953
|
-
<td class="name"><code>
|
|
4841
|
+
<td class="name"><code>userId</code></td>
|
|
1954
4842
|
|
|
1955
4843
|
|
|
1956
4844
|
<td class="type">
|
|
1957
4845
|
|
|
1958
4846
|
|
|
1959
|
-
<code class="param-type">
|
|
4847
|
+
<code class="param-type">string</code>
|
|
1960
4848
|
|
|
1961
4849
|
|
|
1962
4850
|
|
|
@@ -1965,27 +4853,21 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1965
4853
|
|
|
1966
4854
|
|
|
1967
4855
|
|
|
1968
|
-
<td class="default">
|
|
1969
|
-
|
|
1970
|
-
{_id:
|
|
1971
|
-
|
|
1972
|
-
</td>
|
|
1973
|
-
|
|
1974
4856
|
|
|
1975
|
-
<td class="description last">
|
|
4857
|
+
<td class="description last">User ID (required)</td>
|
|
1976
4858
|
</tr>
|
|
1977
4859
|
|
|
1978
4860
|
|
|
1979
4861
|
|
|
1980
4862
|
<tr class="deep-level-1">
|
|
1981
4863
|
|
|
1982
|
-
<td class="name"><code>
|
|
4864
|
+
<td class="name"><code>userType</code></td>
|
|
1983
4865
|
|
|
1984
4866
|
|
|
1985
4867
|
<td class="type">
|
|
1986
4868
|
|
|
1987
4869
|
|
|
1988
|
-
<code class="param-type">
|
|
4870
|
+
<code class="param-type">string</code>
|
|
1989
4871
|
|
|
1990
4872
|
|
|
1991
4873
|
|
|
@@ -1994,14 +4876,8 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1994
4876
|
|
|
1995
4877
|
|
|
1996
4878
|
|
|
1997
|
-
<td class="default">
|
|
1998
|
-
|
|
1999
|
-
{name:
|
|
2000
|
-
|
|
2001
|
-
</td>
|
|
2002
|
-
|
|
2003
4879
|
|
|
2004
|
-
<td class="description last">
|
|
4880
|
+
<td class="description last">New user type (required)</td>
|
|
2005
4881
|
</tr>
|
|
2006
4882
|
|
|
2007
4883
|
|
|
@@ -2027,12 +4903,8 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
2027
4903
|
|
|
2028
4904
|
|
|
2029
4905
|
|
|
2030
|
-
<td class="default">
|
|
2031
|
-
|
|
2032
|
-
</td>
|
|
2033
|
-
|
|
2034
4906
|
|
|
2035
|
-
<td class="description last">
|
|
4907
|
+
<td class="description last">JWT session token</td>
|
|
2036
4908
|
</tr>
|
|
2037
4909
|
|
|
2038
4910
|
|
|
@@ -2087,7 +4959,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
2087
4959
|
<p class="tag-source">
|
|
2088
4960
|
<a href="admin_user.js.html" class="button">View Source</a>
|
|
2089
4961
|
<span>
|
|
2090
|
-
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#
|
|
4962
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line532">line 532</a>
|
|
2091
4963
|
</span>
|
|
2092
4964
|
</p>
|
|
2093
4965
|
|
|
@@ -2118,11 +4990,13 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
2118
4990
|
|
|
2119
4991
|
<div class="columns">
|
|
2120
4992
|
|
|
4993
|
+
<div class='param-desc column is-7'>Updated user</div>
|
|
4994
|
+
|
|
2121
4995
|
|
|
2122
4996
|
<div class='column is-5 has-text-left'>
|
|
2123
4997
|
<label>Type: </label>
|
|
2124
4998
|
|
|
2125
|
-
<code class="param-type">Promise
|
|
4999
|
+
<code class="param-type">Promise.<object></code>
|
|
2126
5000
|
|
|
2127
5001
|
|
|
2128
5002
|
</div>
|
|
@@ -2141,11 +5015,9 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
2141
5015
|
|
|
2142
5016
|
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
2143
5017
|
const api = new API();
|
|
2144
|
-
const params
|
|
2145
|
-
project: {_id: 1, name: 1, orgId: 1, orgIds: 1},
|
|
2146
|
-
};
|
|
5018
|
+
const params = { userId: '55e4a3bd6be6b45210833fae', userType: 'USER' };
|
|
2147
5019
|
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
2148
|
-
await api.user.
|
|
5020
|
+
await api.admin.user.updateUserType(params, session);</code></pre>
|
|
2149
5021
|
|
|
2150
5022
|
|
|
2151
5023
|
|