@docbrasil/api-systemmanager 1.1.77 → 1.1.79
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/user.js +413 -10
- package/dist/bundle.cjs +413 -10
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +284 -0
- package/docs/AdminUser.html +3339 -294
- package/docs/admin_user.js.html +413 -10
- 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#line465">line 465</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#line518">line 518</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#line376">line 376</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,25 +1032,259 @@ 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
|
-
</
|
|
1005
|
-
|
|
1060
|
+
<td class="type">
|
|
1061
|
+
|
|
1062
|
+
|
|
1063
|
+
<code class="param-type">string</code>
|
|
1006
1064
|
|
|
1007
1065
|
|
|
1066
|
+
|
|
1067
|
+
</td>
|
|
1008
1068
|
|
|
1069
|
+
|
|
1070
|
+
<td class="attributes">
|
|
1071
|
+
|
|
1009
1072
|
|
|
1010
|
-
|
|
1073
|
+
|
|
1011
1074
|
|
|
1012
|
-
|
|
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
|
+
|
|
1013
1288
|
|
|
1014
1289
|
|
|
1015
1290
|
|
|
@@ -1026,6 +1301,13 @@ await api.admin.user.findById(userId, session);</code></pre>
|
|
|
1026
1301
|
|
|
1027
1302
|
|
|
1028
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
|
+
|
|
1029
1311
|
|
|
1030
1312
|
|
|
1031
1313
|
|
|
@@ -1042,7 +1324,7 @@ await api.admin.user.findById(userId, session);</code></pre>
|
|
|
1042
1324
|
<p class="tag-source">
|
|
1043
1325
|
<a href="admin_user.js.html" class="button">View Source</a>
|
|
1044
1326
|
<span>
|
|
1045
|
-
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#
|
|
1327
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line283">line 283</a>
|
|
1046
1328
|
</span>
|
|
1047
1329
|
</p>
|
|
1048
1330
|
|
|
@@ -1073,11 +1355,13 @@ await api.admin.user.findById(userId, session);</code></pre>
|
|
|
1073
1355
|
|
|
1074
1356
|
<div class="columns">
|
|
1075
1357
|
|
|
1358
|
+
<div class='param-desc column is-7'>Created user document</div>
|
|
1359
|
+
|
|
1076
1360
|
|
|
1077
1361
|
<div class='column is-5 has-text-left'>
|
|
1078
1362
|
<label>Type: </label>
|
|
1079
1363
|
|
|
1080
|
-
<code class="param-type">Promise.<
|
|
1364
|
+
<code class="param-type">Promise.<object></code>
|
|
1081
1365
|
|
|
1082
1366
|
|
|
1083
1367
|
</div>
|
|
@@ -1094,12 +1378,17 @@ await api.admin.user.findById(userId, session);</code></pre>
|
|
|
1094
1378
|
<h5>Example</h5>
|
|
1095
1379
|
|
|
1096
1380
|
|
|
1097
|
-
<pre class="prettyprint"><code>const
|
|
1381
|
+
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
1382
|
+
const api = new API();
|
|
1098
1383
|
const payload = {
|
|
1099
|
-
name: 'Maria
|
|
1100
|
-
|
|
1384
|
+
name: 'Maria Silva',
|
|
1385
|
+
username: 'maria.silva',
|
|
1386
|
+
email: 'maria@example.com',
|
|
1387
|
+
orgId: '5edd11c46b6ce9729c2c297c',
|
|
1388
|
+
role: [2]
|
|
1101
1389
|
};
|
|
1102
|
-
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
|
|
1390
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
1391
|
+
await api.admin.user.create(payload, session);</code></pre>
|
|
1103
1392
|
|
|
1104
1393
|
|
|
1105
1394
|
|
|
@@ -1109,8 +1398,8 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1109
1398
|
|
|
1110
1399
|
|
|
1111
1400
|
|
|
1112
|
-
<h4 class="name" id="
|
|
1113
|
-
<a class="href-link" href="#
|
|
1401
|
+
<h4 class="name" id="emailExist">
|
|
1402
|
+
<a class="href-link" href="#emailExist">#</a>
|
|
1114
1403
|
|
|
1115
1404
|
|
|
1116
1405
|
<span class='tag'>async</span>
|
|
@@ -1118,7 +1407,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1118
1407
|
|
|
1119
1408
|
<span class="code-name">
|
|
1120
1409
|
|
|
1121
|
-
|
|
1410
|
+
emailExist<span class="signature">(email, session)</span><span class="type-signature"></span>
|
|
1122
1411
|
|
|
1123
1412
|
</span>
|
|
1124
1413
|
</h4>
|
|
@@ -1127,7 +1416,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1127
1416
|
|
|
1128
1417
|
|
|
1129
1418
|
<div class="description">
|
|
1130
|
-
|
|
1419
|
+
Check if email is unique
|
|
1131
1420
|
</div>
|
|
1132
1421
|
|
|
1133
1422
|
|
|
@@ -1165,13 +1454,13 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1165
1454
|
|
|
1166
1455
|
<tr class="deep-level-0">
|
|
1167
1456
|
|
|
1168
|
-
<td class="name"><code>
|
|
1457
|
+
<td class="name"><code>email</code></td>
|
|
1169
1458
|
|
|
1170
1459
|
|
|
1171
1460
|
<td class="type">
|
|
1172
1461
|
|
|
1173
1462
|
|
|
1174
|
-
<code class="param-type">
|
|
1463
|
+
<code class="param-type">string</code>
|
|
1175
1464
|
|
|
1176
1465
|
|
|
1177
1466
|
|
|
@@ -1181,15 +1470,16 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1181
1470
|
|
|
1182
1471
|
|
|
1183
1472
|
|
|
1184
|
-
<td class="description last">
|
|
1473
|
+
<td class="description last">Check if email is unique</td>
|
|
1185
1474
|
</tr>
|
|
1186
1475
|
|
|
1476
|
+
|
|
1477
|
+
|
|
1478
|
+
|
|
1479
|
+
|
|
1480
|
+
<tr class="deep-level-0">
|
|
1187
1481
|
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
<tr class="deep-level-1">
|
|
1191
|
-
|
|
1192
|
-
<td class="name"><code>userId</code></td>
|
|
1482
|
+
<td class="name"><code>session</code></td>
|
|
1193
1483
|
|
|
1194
1484
|
|
|
1195
1485
|
<td class="type">
|
|
@@ -1205,37 +1495,2774 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1205
1495
|
|
|
1206
1496
|
|
|
1207
1497
|
|
|
1208
|
-
<td class="description last">
|
|
1498
|
+
<td class="description last">Is token JWT</td>
|
|
1209
1499
|
</tr>
|
|
1210
1500
|
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
<tr class="deep-level-1">
|
|
1214
|
-
|
|
1215
|
-
<td class="name"><code>oldPassword</code></td>
|
|
1216
|
-
|
|
1217
1501
|
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1502
|
+
|
|
1503
|
+
</tbody>
|
|
1504
|
+
</table>
|
|
1505
|
+
</div>
|
|
1222
1506
|
|
|
1223
1507
|
|
|
1224
|
-
|
|
1225
|
-
</td>
|
|
1226
1508
|
|
|
1227
|
-
|
|
1228
1509
|
|
|
1229
|
-
|
|
1230
1510
|
|
|
1231
|
-
|
|
1232
|
-
</tr>
|
|
1511
|
+
<dl class="details">
|
|
1233
1512
|
|
|
1234
|
-
|
|
1235
1513
|
|
|
1236
|
-
|
|
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#line207">line 207</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#line106">line 106</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#line239">line 239</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#line174">line 174</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#line137">line 137</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#line344">line 344</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#line606">line 606</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#line713">line 713</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#line682">line 682</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">
|
|
3707
|
+
|
|
3708
|
+
|
|
3709
|
+
|
|
3710
|
+
|
|
3711
|
+
|
|
3712
|
+
|
|
3713
|
+
|
|
3714
|
+
|
|
3715
|
+
|
|
3716
|
+
|
|
3717
|
+
|
|
3718
|
+
|
|
3719
|
+
|
|
3720
|
+
|
|
3721
|
+
|
|
3722
|
+
|
|
3723
|
+
|
|
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
|
+
|
|
3732
|
+
|
|
3733
|
+
|
|
3734
|
+
|
|
3735
|
+
|
|
3736
|
+
|
|
3737
|
+
|
|
3738
|
+
|
|
3739
|
+
|
|
3740
|
+
|
|
3741
|
+
|
|
3742
|
+
|
|
3743
|
+
|
|
3744
|
+
|
|
3745
|
+
<p class="tag-source">
|
|
3746
|
+
<a href="admin_user.js.html" class="button">View Source</a>
|
|
3747
|
+
<span>
|
|
3748
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line415">line 415</a>
|
|
3749
|
+
</span>
|
|
3750
|
+
</p>
|
|
3751
|
+
|
|
3752
|
+
</dl>
|
|
3753
|
+
|
|
3754
|
+
|
|
3755
|
+
|
|
3756
|
+
|
|
3757
|
+
|
|
3758
|
+
|
|
3759
|
+
|
|
3760
|
+
|
|
3761
|
+
|
|
3762
|
+
|
|
3763
|
+
|
|
3764
|
+
|
|
3765
|
+
|
|
3766
|
+
|
|
3767
|
+
|
|
3768
|
+
|
|
3769
|
+
|
|
3770
|
+
|
|
3771
|
+
<div class='columns method-parameter'>
|
|
3772
|
+
<div class="column is-2"><label>Returns:</label></div>
|
|
3773
|
+
<div class="column is-10">
|
|
3774
|
+
|
|
3775
|
+
|
|
3776
|
+
|
|
3777
|
+
<div class="columns">
|
|
3778
|
+
|
|
3779
|
+
|
|
3780
|
+
<div class='column is-5 has-text-left'>
|
|
3781
|
+
<label>Type: </label>
|
|
3782
|
+
|
|
3783
|
+
<code class="param-type">Promise</code>
|
|
3784
|
+
|
|
3785
|
+
|
|
3786
|
+
</div>
|
|
3787
|
+
|
|
3788
|
+
</div>
|
|
3789
|
+
|
|
3790
|
+
|
|
3791
|
+
</div>
|
|
3792
|
+
</div>
|
|
3793
|
+
|
|
3794
|
+
|
|
3795
|
+
|
|
3796
|
+
|
|
3797
|
+
<h5>Example</h5>
|
|
3798
|
+
|
|
3799
|
+
|
|
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},
|
|
3804
|
+
};
|
|
3805
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
3806
|
+
await api.user.form.getUserList(params, session);</code></pre>
|
|
3807
|
+
|
|
3808
|
+
|
|
3809
|
+
|
|
3810
|
+
</div>
|
|
3811
|
+
|
|
3812
|
+
<div class="member">
|
|
3813
|
+
|
|
3814
|
+
|
|
3815
|
+
|
|
3816
|
+
<h4 class="name" id="remove">
|
|
3817
|
+
<a class="href-link" href="#remove">#</a>
|
|
3818
|
+
|
|
3819
|
+
|
|
3820
|
+
<span class='tag'>async</span>
|
|
3821
|
+
|
|
3822
|
+
|
|
3823
|
+
<span class="code-name">
|
|
3824
|
+
|
|
3825
|
+
remove<span class="signature">(userId, session)</span><span class="type-signature"> → {Promise.<object>}</span>
|
|
3826
|
+
|
|
3827
|
+
</span>
|
|
3828
|
+
</h4>
|
|
3829
|
+
|
|
3830
|
+
|
|
3831
|
+
|
|
3832
|
+
|
|
3833
|
+
<div class="description">
|
|
3834
|
+
Remove a user
|
|
3835
|
+
</div>
|
|
3836
|
+
|
|
3837
|
+
|
|
3838
|
+
|
|
3839
|
+
|
|
3840
|
+
|
|
3841
|
+
|
|
3842
|
+
|
|
3843
|
+
|
|
3844
|
+
|
|
3845
|
+
|
|
3846
|
+
<h5>Parameters:</h5>
|
|
3847
|
+
|
|
3848
|
+
<div class="table-container">
|
|
3849
|
+
<table class="params table">
|
|
3850
|
+
<thead>
|
|
3851
|
+
<tr>
|
|
3852
|
+
|
|
3853
|
+
<th>Name</th>
|
|
3854
|
+
|
|
3855
|
+
|
|
3856
|
+
<th>Type</th>
|
|
3857
|
+
|
|
3858
|
+
|
|
3859
|
+
|
|
3860
|
+
|
|
3861
|
+
|
|
3862
|
+
<th class="last">Description</th>
|
|
3863
|
+
</tr>
|
|
3864
|
+
</thead>
|
|
3865
|
+
|
|
3866
|
+
<tbody>
|
|
3867
|
+
|
|
3868
|
+
|
|
3869
|
+
|
|
3870
|
+
<tr class="deep-level-0">
|
|
3871
|
+
|
|
3872
|
+
<td class="name"><code>userId</code></td>
|
|
3873
|
+
|
|
3874
|
+
|
|
3875
|
+
<td class="type">
|
|
3876
|
+
|
|
3877
|
+
|
|
3878
|
+
<code class="param-type">string</code>
|
|
3879
|
+
|
|
3880
|
+
|
|
3881
|
+
|
|
3882
|
+
</td>
|
|
3883
|
+
|
|
3884
|
+
|
|
3885
|
+
|
|
3886
|
+
|
|
3887
|
+
|
|
3888
|
+
<td class="description last">User ID to remove (required)</td>
|
|
3889
|
+
</tr>
|
|
3890
|
+
|
|
3891
|
+
|
|
3892
|
+
|
|
3893
|
+
|
|
3894
|
+
|
|
3895
|
+
<tr class="deep-level-0">
|
|
3896
|
+
|
|
3897
|
+
<td class="name"><code>session</code></td>
|
|
3898
|
+
|
|
3899
|
+
|
|
3900
|
+
<td class="type">
|
|
3901
|
+
|
|
3902
|
+
|
|
3903
|
+
<code class="param-type">string</code>
|
|
3904
|
+
|
|
3905
|
+
|
|
3906
|
+
|
|
3907
|
+
</td>
|
|
3908
|
+
|
|
3909
|
+
|
|
3910
|
+
|
|
3911
|
+
|
|
3912
|
+
|
|
3913
|
+
<td class="description last">JWT session token</td>
|
|
3914
|
+
</tr>
|
|
3915
|
+
|
|
3916
|
+
|
|
3917
|
+
|
|
3918
|
+
</tbody>
|
|
3919
|
+
</table>
|
|
3920
|
+
</div>
|
|
3921
|
+
|
|
3922
|
+
|
|
3923
|
+
|
|
3924
|
+
|
|
3925
|
+
|
|
3926
|
+
<dl class="details">
|
|
3927
|
+
|
|
3928
|
+
|
|
3929
|
+
|
|
3930
|
+
|
|
3931
|
+
|
|
3932
|
+
|
|
3933
|
+
|
|
3934
|
+
|
|
3935
|
+
|
|
3936
|
+
|
|
3937
|
+
|
|
3938
|
+
|
|
3939
|
+
|
|
3940
|
+
|
|
3941
|
+
|
|
3942
|
+
|
|
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#line317">line 317</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="setOrgId">
|
|
4037
|
+
<a class="href-link" href="#setOrgId">#</a>
|
|
4038
|
+
|
|
4039
|
+
<span class="code-name">
|
|
4040
|
+
|
|
4041
|
+
setOrgId<span class="signature">(orgId)</span><span class="type-signature"> → {<a href="AdminUser.html">AdminUser</a>}</span>
|
|
4042
|
+
|
|
4043
|
+
</span>
|
|
4044
|
+
</h4>
|
|
4045
|
+
|
|
4046
|
+
|
|
4047
|
+
|
|
4048
|
+
|
|
4049
|
+
<div class="description">
|
|
4050
|
+
Set the organization ID for org-scoped API calls
|
|
4051
|
+
</div>
|
|
4052
|
+
|
|
4053
|
+
|
|
4054
|
+
|
|
4055
|
+
|
|
4056
|
+
|
|
4057
|
+
|
|
4058
|
+
|
|
4059
|
+
|
|
4060
|
+
|
|
4061
|
+
|
|
4062
|
+
<h5>Parameters:</h5>
|
|
4063
|
+
|
|
4064
|
+
<div class="table-container">
|
|
4065
|
+
<table class="params table">
|
|
4066
|
+
<thead>
|
|
4067
|
+
<tr>
|
|
4068
|
+
|
|
4069
|
+
<th>Name</th>
|
|
4070
|
+
|
|
4071
|
+
|
|
4072
|
+
<th>Type</th>
|
|
4073
|
+
|
|
4074
|
+
|
|
4075
|
+
|
|
4076
|
+
|
|
4077
|
+
|
|
4078
|
+
<th class="last">Description</th>
|
|
4079
|
+
</tr>
|
|
4080
|
+
</thead>
|
|
4081
|
+
|
|
4082
|
+
<tbody>
|
|
4083
|
+
|
|
4084
|
+
|
|
4085
|
+
|
|
4086
|
+
<tr class="deep-level-0">
|
|
4087
|
+
|
|
4088
|
+
<td class="name"><code>orgId</code></td>
|
|
4089
|
+
|
|
4090
|
+
|
|
4091
|
+
<td class="type">
|
|
4092
|
+
|
|
4093
|
+
|
|
4094
|
+
<code class="param-type">string</code>
|
|
4095
|
+
|
|
4096
|
+
|
|
4097
|
+
|
|
4098
|
+
</td>
|
|
4099
|
+
|
|
4100
|
+
|
|
4101
|
+
|
|
4102
|
+
|
|
4103
|
+
|
|
4104
|
+
<td class="description last">Organization ID</td>
|
|
4105
|
+
</tr>
|
|
4106
|
+
|
|
4107
|
+
|
|
4108
|
+
|
|
4109
|
+
</tbody>
|
|
4110
|
+
</table>
|
|
4111
|
+
</div>
|
|
4112
|
+
|
|
4113
|
+
|
|
4114
|
+
|
|
4115
|
+
|
|
4116
|
+
|
|
4117
|
+
<dl class="details">
|
|
4118
|
+
|
|
4119
|
+
|
|
4120
|
+
|
|
4121
|
+
|
|
4122
|
+
|
|
4123
|
+
|
|
4124
|
+
|
|
4125
|
+
|
|
4126
|
+
|
|
4127
|
+
|
|
4128
|
+
|
|
4129
|
+
|
|
4130
|
+
|
|
4131
|
+
|
|
4132
|
+
|
|
4133
|
+
|
|
4134
|
+
|
|
4135
|
+
|
|
4136
|
+
|
|
4137
|
+
|
|
4138
|
+
|
|
4139
|
+
|
|
4140
|
+
|
|
4141
|
+
|
|
4142
|
+
|
|
4143
|
+
|
|
4144
|
+
|
|
4145
|
+
|
|
4146
|
+
|
|
4147
|
+
|
|
4148
|
+
|
|
4149
|
+
<p class="tag-source">
|
|
4150
|
+
<a href="admin_user.js.html" class="button">View Source</a>
|
|
4151
|
+
<span>
|
|
4152
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line27">line 27</a>
|
|
4153
|
+
</span>
|
|
4154
|
+
</p>
|
|
4155
|
+
|
|
4156
|
+
</dl>
|
|
4157
|
+
|
|
4158
|
+
|
|
4159
|
+
|
|
4160
|
+
|
|
4161
|
+
|
|
4162
|
+
|
|
4163
|
+
|
|
4164
|
+
|
|
4165
|
+
|
|
4166
|
+
|
|
4167
|
+
|
|
4168
|
+
|
|
4169
|
+
|
|
4170
|
+
|
|
4171
|
+
|
|
4172
|
+
|
|
4173
|
+
|
|
4174
|
+
|
|
4175
|
+
<div class='columns method-parameter'>
|
|
4176
|
+
<div class="column is-2"><label>Returns:</label></div>
|
|
4177
|
+
<div class="column is-10">
|
|
4178
|
+
|
|
4179
|
+
|
|
4180
|
+
|
|
4181
|
+
<div class="columns">
|
|
4182
|
+
|
|
4183
|
+
<div class='param-desc column is-7'>this instance for chaining</div>
|
|
4184
|
+
|
|
4185
|
+
|
|
4186
|
+
<div class='column is-5 has-text-left'>
|
|
4187
|
+
<label>Type: </label>
|
|
4188
|
+
|
|
4189
|
+
<code class="param-type"><a href="AdminUser.html">AdminUser</a></code>
|
|
4190
|
+
|
|
4191
|
+
|
|
4192
|
+
</div>
|
|
4193
|
+
|
|
4194
|
+
</div>
|
|
4195
|
+
|
|
4196
|
+
|
|
4197
|
+
</div>
|
|
4198
|
+
</div>
|
|
4199
|
+
|
|
4200
|
+
|
|
4201
|
+
|
|
4202
|
+
|
|
4203
|
+
</div>
|
|
4204
|
+
|
|
4205
|
+
<div class="member">
|
|
4206
|
+
|
|
4207
|
+
|
|
4208
|
+
|
|
4209
|
+
<h4 class="name" id="unblock">
|
|
4210
|
+
<a class="href-link" href="#unblock">#</a>
|
|
4211
|
+
|
|
4212
|
+
|
|
4213
|
+
<span class='tag'>async</span>
|
|
4214
|
+
|
|
4215
|
+
|
|
4216
|
+
<span class="code-name">
|
|
4217
|
+
|
|
4218
|
+
unblock<span class="signature">(userId, session)</span><span class="type-signature"> → {Promise.<object>}</span>
|
|
4219
|
+
|
|
4220
|
+
</span>
|
|
4221
|
+
</h4>
|
|
4222
|
+
|
|
4223
|
+
|
|
4224
|
+
|
|
4225
|
+
|
|
4226
|
+
<div class="description">
|
|
4227
|
+
Unblock a user (allow login)
|
|
4228
|
+
</div>
|
|
4229
|
+
|
|
4230
|
+
|
|
4231
|
+
|
|
4232
|
+
|
|
4233
|
+
|
|
4234
|
+
|
|
4235
|
+
|
|
4236
|
+
|
|
4237
|
+
|
|
4238
|
+
|
|
4239
|
+
<h5>Parameters:</h5>
|
|
4240
|
+
|
|
4241
|
+
<div class="table-container">
|
|
4242
|
+
<table class="params table">
|
|
4243
|
+
<thead>
|
|
4244
|
+
<tr>
|
|
4245
|
+
|
|
4246
|
+
<th>Name</th>
|
|
4247
|
+
|
|
4248
|
+
|
|
4249
|
+
<th>Type</th>
|
|
4250
|
+
|
|
4251
|
+
|
|
4252
|
+
|
|
4253
|
+
|
|
4254
|
+
|
|
4255
|
+
<th class="last">Description</th>
|
|
4256
|
+
</tr>
|
|
4257
|
+
</thead>
|
|
4258
|
+
|
|
4259
|
+
<tbody>
|
|
4260
|
+
|
|
4261
|
+
|
|
4262
|
+
|
|
4263
|
+
<tr class="deep-level-0">
|
|
1237
4264
|
|
|
1238
|
-
<td class="name"><code>
|
|
4265
|
+
<td class="name"><code>userId</code></td>
|
|
1239
4266
|
|
|
1240
4267
|
|
|
1241
4268
|
<td class="type">
|
|
@@ -1251,11 +4278,9 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1251
4278
|
|
|
1252
4279
|
|
|
1253
4280
|
|
|
1254
|
-
<td class="description last">
|
|
4281
|
+
<td class="description last">User ID to unblock (required)</td>
|
|
1255
4282
|
</tr>
|
|
1256
4283
|
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
4284
|
|
|
1260
4285
|
|
|
1261
4286
|
|
|
@@ -1278,7 +4303,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1278
4303
|
|
|
1279
4304
|
|
|
1280
4305
|
|
|
1281
|
-
<td class="description last">
|
|
4306
|
+
<td class="description last">JWT session token</td>
|
|
1282
4307
|
</tr>
|
|
1283
4308
|
|
|
1284
4309
|
|
|
@@ -1333,7 +4358,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1333
4358
|
<p class="tag-source">
|
|
1334
4359
|
<a href="admin_user.js.html" class="button">View Source</a>
|
|
1335
4360
|
<span>
|
|
1336
|
-
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#
|
|
4361
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line495">line 495</a>
|
|
1337
4362
|
</span>
|
|
1338
4363
|
</p>
|
|
1339
4364
|
|
|
@@ -1364,11 +4389,13 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1364
4389
|
|
|
1365
4390
|
<div class="columns">
|
|
1366
4391
|
|
|
4392
|
+
<div class='param-desc column is-7'>Updated user</div>
|
|
4393
|
+
|
|
1367
4394
|
|
|
1368
4395
|
<div class='column is-5 has-text-left'>
|
|
1369
4396
|
<label>Type: </label>
|
|
1370
4397
|
|
|
1371
|
-
<code class="param-type">Promise.<
|
|
4398
|
+
<code class="param-type">Promise.<object></code>
|
|
1372
4399
|
|
|
1373
4400
|
|
|
1374
4401
|
</div>
|
|
@@ -1387,13 +4414,9 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1387
4414
|
|
|
1388
4415
|
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
1389
4416
|
const api = new API();
|
|
1390
|
-
const
|
|
1391
|
-
userId: '55e4a3bd6be6b45210833fae',
|
|
1392
|
-
oldPassword: '123456',
|
|
1393
|
-
newPassword: '123456789'
|
|
1394
|
-
};
|
|
4417
|
+
const userId = '55e4a3bd6be6b45210833fae';
|
|
1395
4418
|
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
1396
|
-
await api.admin.user.
|
|
4419
|
+
await api.admin.user.unblock(userId, session);</code></pre>
|
|
1397
4420
|
|
|
1398
4421
|
|
|
1399
4422
|
|
|
@@ -1403,8 +4426,8 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1403
4426
|
|
|
1404
4427
|
|
|
1405
4428
|
|
|
1406
|
-
<h4 class="name" id="
|
|
1407
|
-
<a class="href-link" href="#
|
|
4429
|
+
<h4 class="name" id="unblockEmail">
|
|
4430
|
+
<a class="href-link" href="#unblockEmail">#</a>
|
|
1408
4431
|
|
|
1409
4432
|
|
|
1410
4433
|
<span class='tag'>async</span>
|
|
@@ -1412,7 +4435,7 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1412
4435
|
|
|
1413
4436
|
<span class="code-name">
|
|
1414
4437
|
|
|
1415
|
-
|
|
4438
|
+
unblockEmail<span class="signature">(userId, session)</span><span class="type-signature"> → {Promise.<object>}</span>
|
|
1416
4439
|
|
|
1417
4440
|
</span>
|
|
1418
4441
|
</h4>
|
|
@@ -1421,7 +4444,7 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1421
4444
|
|
|
1422
4445
|
|
|
1423
4446
|
<div class="description">
|
|
1424
|
-
|
|
4447
|
+
Unblock email notifications for a user
|
|
1425
4448
|
</div>
|
|
1426
4449
|
|
|
1427
4450
|
|
|
@@ -1459,7 +4482,7 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1459
4482
|
|
|
1460
4483
|
<tr class="deep-level-0">
|
|
1461
4484
|
|
|
1462
|
-
<td class="name"><code>
|
|
4485
|
+
<td class="name"><code>userId</code></td>
|
|
1463
4486
|
|
|
1464
4487
|
|
|
1465
4488
|
<td class="type">
|
|
@@ -1475,7 +4498,7 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1475
4498
|
|
|
1476
4499
|
|
|
1477
4500
|
|
|
1478
|
-
<td class="description last">
|
|
4501
|
+
<td class="description last">User ID (required)</td>
|
|
1479
4502
|
</tr>
|
|
1480
4503
|
|
|
1481
4504
|
|
|
@@ -1484,7 +4507,7 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1484
4507
|
|
|
1485
4508
|
<tr class="deep-level-0">
|
|
1486
4509
|
|
|
1487
|
-
<td class="name"><code>
|
|
4510
|
+
<td class="name"><code>session</code></td>
|
|
1488
4511
|
|
|
1489
4512
|
|
|
1490
4513
|
<td class="type">
|
|
@@ -1500,7 +4523,7 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1500
4523
|
|
|
1501
4524
|
|
|
1502
4525
|
|
|
1503
|
-
<td class="description last">
|
|
4526
|
+
<td class="description last">JWT session token</td>
|
|
1504
4527
|
</tr>
|
|
1505
4528
|
|
|
1506
4529
|
|
|
@@ -1555,7 +4578,7 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1555
4578
|
<p class="tag-source">
|
|
1556
4579
|
<a href="admin_user.js.html" class="button">View Source</a>
|
|
1557
4580
|
<span>
|
|
1558
|
-
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#
|
|
4581
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line541">line 541</a>
|
|
1559
4582
|
</span>
|
|
1560
4583
|
</p>
|
|
1561
4584
|
|
|
@@ -1586,11 +4609,13 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1586
4609
|
|
|
1587
4610
|
<div class="columns">
|
|
1588
4611
|
|
|
4612
|
+
<div class='param-desc column is-7'>Updated user</div>
|
|
4613
|
+
|
|
1589
4614
|
|
|
1590
4615
|
<div class='column is-5 has-text-left'>
|
|
1591
4616
|
<label>Type: </label>
|
|
1592
4617
|
|
|
1593
|
-
<code class="param-type">Promise
|
|
4618
|
+
<code class="param-type">Promise.<object></code>
|
|
1594
4619
|
|
|
1595
4620
|
|
|
1596
4621
|
</div>
|
|
@@ -1604,25 +4629,14 @@ await api.admin.user.findByIdAndUpdatePassword(params, session);</code></pre>
|
|
|
1604
4629
|
|
|
1605
4630
|
|
|
1606
4631
|
|
|
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
4632
|
</div>
|
|
1619
4633
|
|
|
1620
4634
|
<div class="member">
|
|
1621
4635
|
|
|
1622
4636
|
|
|
1623
4637
|
|
|
1624
|
-
<h4 class="name" id="
|
|
1625
|
-
<a class="href-link" href="#
|
|
4638
|
+
<h4 class="name" id="updateUserGroups">
|
|
4639
|
+
<a class="href-link" href="#updateUserGroups">#</a>
|
|
1626
4640
|
|
|
1627
4641
|
|
|
1628
4642
|
<span class='tag'>async</span>
|
|
@@ -1630,7 +4644,7 @@ await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
|
1630
4644
|
|
|
1631
4645
|
<span class="code-name">
|
|
1632
4646
|
|
|
1633
|
-
|
|
4647
|
+
updateUserGroups<span class="signature">(params, session)</span><span class="type-signature"> → {Promise.<object>}</span>
|
|
1634
4648
|
|
|
1635
4649
|
</span>
|
|
1636
4650
|
</h4>
|
|
@@ -1639,7 +4653,7 @@ await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
|
1639
4653
|
|
|
1640
4654
|
|
|
1641
4655
|
<div class="description">
|
|
1642
|
-
|
|
4656
|
+
Update user's group memberships in an organization
|
|
1643
4657
|
</div>
|
|
1644
4658
|
|
|
1645
4659
|
|
|
@@ -1677,7 +4691,31 @@ await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
|
1677
4691
|
|
|
1678
4692
|
<tr class="deep-level-0">
|
|
1679
4693
|
|
|
1680
|
-
<td class="name"><code>
|
|
4694
|
+
<td class="name"><code>params</code></td>
|
|
4695
|
+
|
|
4696
|
+
|
|
4697
|
+
<td class="type">
|
|
4698
|
+
|
|
4699
|
+
|
|
4700
|
+
<code class="param-type">object</code>
|
|
4701
|
+
|
|
4702
|
+
|
|
4703
|
+
|
|
4704
|
+
</td>
|
|
4705
|
+
|
|
4706
|
+
|
|
4707
|
+
|
|
4708
|
+
|
|
4709
|
+
|
|
4710
|
+
<td class="description last">Parameters</td>
|
|
4711
|
+
</tr>
|
|
4712
|
+
|
|
4713
|
+
|
|
4714
|
+
|
|
4715
|
+
|
|
4716
|
+
<tr class="deep-level-1">
|
|
4717
|
+
|
|
4718
|
+
<td class="name"><code>orgId</code></td>
|
|
1681
4719
|
|
|
1682
4720
|
|
|
1683
4721
|
<td class="type">
|
|
@@ -1693,7 +4731,80 @@ await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
|
1693
4731
|
|
|
1694
4732
|
|
|
1695
4733
|
|
|
1696
|
-
<td class="description last">
|
|
4734
|
+
<td class="description last">Organization ID (required)</td>
|
|
4735
|
+
</tr>
|
|
4736
|
+
|
|
4737
|
+
|
|
4738
|
+
|
|
4739
|
+
<tr class="deep-level-1">
|
|
4740
|
+
|
|
4741
|
+
<td class="name"><code>userId</code></td>
|
|
4742
|
+
|
|
4743
|
+
|
|
4744
|
+
<td class="type">
|
|
4745
|
+
|
|
4746
|
+
|
|
4747
|
+
<code class="param-type">string</code>
|
|
4748
|
+
|
|
4749
|
+
|
|
4750
|
+
|
|
4751
|
+
</td>
|
|
4752
|
+
|
|
4753
|
+
|
|
4754
|
+
|
|
4755
|
+
|
|
4756
|
+
|
|
4757
|
+
<td class="description last">User ID (required)</td>
|
|
4758
|
+
</tr>
|
|
4759
|
+
|
|
4760
|
+
|
|
4761
|
+
|
|
4762
|
+
<tr class="deep-level-1">
|
|
4763
|
+
|
|
4764
|
+
<td class="name"><code>groups</code></td>
|
|
4765
|
+
|
|
4766
|
+
|
|
4767
|
+
<td class="type">
|
|
4768
|
+
|
|
4769
|
+
|
|
4770
|
+
<code class="param-type">array</code>
|
|
4771
|
+
|
|
4772
|
+
|
|
4773
|
+
|
|
4774
|
+
</td>
|
|
4775
|
+
|
|
4776
|
+
|
|
4777
|
+
|
|
4778
|
+
|
|
4779
|
+
|
|
4780
|
+
<td class="description last">Array of group IDs (required)</td>
|
|
4781
|
+
</tr>
|
|
4782
|
+
|
|
4783
|
+
|
|
4784
|
+
|
|
4785
|
+
|
|
4786
|
+
|
|
4787
|
+
|
|
4788
|
+
|
|
4789
|
+
<tr class="deep-level-0">
|
|
4790
|
+
|
|
4791
|
+
<td class="name"><code>session</code></td>
|
|
4792
|
+
|
|
4793
|
+
|
|
4794
|
+
<td class="type">
|
|
4795
|
+
|
|
4796
|
+
|
|
4797
|
+
<code class="param-type">string</code>
|
|
4798
|
+
|
|
4799
|
+
|
|
4800
|
+
|
|
4801
|
+
</td>
|
|
4802
|
+
|
|
4803
|
+
|
|
4804
|
+
|
|
4805
|
+
|
|
4806
|
+
|
|
4807
|
+
<td class="description last">JWT session token</td>
|
|
1697
4808
|
</tr>
|
|
1698
4809
|
|
|
1699
4810
|
|
|
@@ -1725,6 +4836,13 @@ await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
|
1725
4836
|
|
|
1726
4837
|
|
|
1727
4838
|
|
|
4839
|
+
<dt class="tag-author">Author:</dt>
|
|
4840
|
+
<dd class="tag-author">
|
|
4841
|
+
<ul>
|
|
4842
|
+
<li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
|
|
4843
|
+
</ul>
|
|
4844
|
+
</dd>
|
|
4845
|
+
|
|
1728
4846
|
|
|
1729
4847
|
|
|
1730
4848
|
|
|
@@ -1741,7 +4859,7 @@ await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
|
1741
4859
|
<p class="tag-source">
|
|
1742
4860
|
<a href="admin_user.js.html" class="button">View Source</a>
|
|
1743
4861
|
<span>
|
|
1744
|
-
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#
|
|
4862
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line646">line 646</a>
|
|
1745
4863
|
</span>
|
|
1746
4864
|
</p>
|
|
1747
4865
|
|
|
@@ -1772,11 +4890,13 @@ await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
|
1772
4890
|
|
|
1773
4891
|
<div class="columns">
|
|
1774
4892
|
|
|
4893
|
+
<div class='param-desc column is-7'>Updated groups</div>
|
|
4894
|
+
|
|
1775
4895
|
|
|
1776
4896
|
<div class='column is-5 has-text-left'>
|
|
1777
4897
|
<label>Type: </label>
|
|
1778
4898
|
|
|
1779
|
-
<code class="param-type">Promise.<
|
|
4899
|
+
<code class="param-type">Promise.<object></code>
|
|
1780
4900
|
|
|
1781
4901
|
|
|
1782
4902
|
</div>
|
|
@@ -1793,10 +4913,15 @@ await api.admin.user.findByIds(userIds, apiKey);</code></pre>
|
|
|
1793
4913
|
<h5>Example</h5>
|
|
1794
4914
|
|
|
1795
4915
|
|
|
1796
|
-
<pre class="prettyprint"><code>const
|
|
1797
|
-
|
|
4916
|
+
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
4917
|
+
const api = new API();
|
|
4918
|
+
const params = {
|
|
4919
|
+
orgId: '5edd11c46b6ce9729c2c297c',
|
|
4920
|
+
userId: '55e4a3bd6be6b45210833fae',
|
|
4921
|
+
groups: ['groupId1', 'groupId2']
|
|
1798
4922
|
};
|
|
1799
|
-
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
|
|
4923
|
+
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
4924
|
+
await api.admin.user.updateUserGroups(params, session);</code></pre>
|
|
1800
4925
|
|
|
1801
4926
|
|
|
1802
4927
|
|
|
@@ -1806,8 +4931,8 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1806
4931
|
|
|
1807
4932
|
|
|
1808
4933
|
|
|
1809
|
-
<h4 class="name" id="
|
|
1810
|
-
<a class="href-link" href="#
|
|
4934
|
+
<h4 class="name" id="updateUserType">
|
|
4935
|
+
<a class="href-link" href="#updateUserType">#</a>
|
|
1811
4936
|
|
|
1812
4937
|
|
|
1813
4938
|
<span class='tag'>async</span>
|
|
@@ -1815,7 +4940,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1815
4940
|
|
|
1816
4941
|
<span class="code-name">
|
|
1817
4942
|
|
|
1818
|
-
|
|
4943
|
+
updateUserType<span class="signature">(params, session)</span><span class="type-signature"> → {Promise.<object>}</span>
|
|
1819
4944
|
|
|
1820
4945
|
</span>
|
|
1821
4946
|
</h4>
|
|
@@ -1824,7 +4949,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1824
4949
|
|
|
1825
4950
|
|
|
1826
4951
|
<div class="description">
|
|
1827
|
-
|
|
4952
|
+
Update user type classification
|
|
1828
4953
|
</div>
|
|
1829
4954
|
|
|
1830
4955
|
|
|
@@ -1851,8 +4976,6 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1851
4976
|
|
|
1852
4977
|
|
|
1853
4978
|
|
|
1854
|
-
<th>Default</th>
|
|
1855
|
-
|
|
1856
4979
|
|
|
1857
4980
|
<th class="last">Description</th>
|
|
1858
4981
|
</tr>
|
|
@@ -1879,84 +5002,22 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1879
5002
|
|
|
1880
5003
|
|
|
1881
5004
|
|
|
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
5005
|
|
|
1917
|
-
<td class="description last">
|
|
5006
|
+
<td class="description last">Parameters</td>
|
|
1918
5007
|
</tr>
|
|
1919
5008
|
|
|
1920
5009
|
|
|
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
5010
|
|
|
1950
5011
|
|
|
1951
5012
|
<tr class="deep-level-1">
|
|
1952
5013
|
|
|
1953
|
-
<td class="name"><code>
|
|
5014
|
+
<td class="name"><code>userId</code></td>
|
|
1954
5015
|
|
|
1955
5016
|
|
|
1956
5017
|
<td class="type">
|
|
1957
5018
|
|
|
1958
5019
|
|
|
1959
|
-
<code class="param-type">
|
|
5020
|
+
<code class="param-type">string</code>
|
|
1960
5021
|
|
|
1961
5022
|
|
|
1962
5023
|
|
|
@@ -1965,27 +5026,21 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1965
5026
|
|
|
1966
5027
|
|
|
1967
5028
|
|
|
1968
|
-
<td class="default">
|
|
1969
|
-
|
|
1970
|
-
{_id:
|
|
1971
|
-
|
|
1972
|
-
</td>
|
|
1973
|
-
|
|
1974
5029
|
|
|
1975
|
-
<td class="description last">
|
|
5030
|
+
<td class="description last">User ID (required)</td>
|
|
1976
5031
|
</tr>
|
|
1977
5032
|
|
|
1978
5033
|
|
|
1979
5034
|
|
|
1980
5035
|
<tr class="deep-level-1">
|
|
1981
5036
|
|
|
1982
|
-
<td class="name"><code>
|
|
5037
|
+
<td class="name"><code>userType</code></td>
|
|
1983
5038
|
|
|
1984
5039
|
|
|
1985
5040
|
<td class="type">
|
|
1986
5041
|
|
|
1987
5042
|
|
|
1988
|
-
<code class="param-type">
|
|
5043
|
+
<code class="param-type">string</code>
|
|
1989
5044
|
|
|
1990
5045
|
|
|
1991
5046
|
|
|
@@ -1994,14 +5049,8 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
1994
5049
|
|
|
1995
5050
|
|
|
1996
5051
|
|
|
1997
|
-
<td class="default">
|
|
1998
|
-
|
|
1999
|
-
{name:
|
|
2000
|
-
|
|
2001
|
-
</td>
|
|
2002
|
-
|
|
2003
5052
|
|
|
2004
|
-
<td class="description last">
|
|
5053
|
+
<td class="description last">New user type (required)</td>
|
|
2005
5054
|
</tr>
|
|
2006
5055
|
|
|
2007
5056
|
|
|
@@ -2027,12 +5076,8 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
2027
5076
|
|
|
2028
5077
|
|
|
2029
5078
|
|
|
2030
|
-
<td class="default">
|
|
2031
|
-
|
|
2032
|
-
</td>
|
|
2033
|
-
|
|
2034
5079
|
|
|
2035
|
-
<td class="description last">
|
|
5080
|
+
<td class="description last">JWT session token</td>
|
|
2036
5081
|
</tr>
|
|
2037
5082
|
|
|
2038
5083
|
|
|
@@ -2087,7 +5132,7 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
2087
5132
|
<p class="tag-source">
|
|
2088
5133
|
<a href="admin_user.js.html" class="button">View Source</a>
|
|
2089
5134
|
<span>
|
|
2090
|
-
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#
|
|
5135
|
+
<a href="admin_user.js.html">admin/user.js</a>, <a href="admin_user.js.html#line573">line 573</a>
|
|
2091
5136
|
</span>
|
|
2092
5137
|
</p>
|
|
2093
5138
|
|
|
@@ -2118,11 +5163,13 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
2118
5163
|
|
|
2119
5164
|
<div class="columns">
|
|
2120
5165
|
|
|
5166
|
+
<div class='param-desc column is-7'>Updated user</div>
|
|
5167
|
+
|
|
2121
5168
|
|
|
2122
5169
|
<div class='column is-5 has-text-left'>
|
|
2123
5170
|
<label>Type: </label>
|
|
2124
5171
|
|
|
2125
|
-
<code class="param-type">Promise
|
|
5172
|
+
<code class="param-type">Promise.<object></code>
|
|
2126
5173
|
|
|
2127
5174
|
|
|
2128
5175
|
</div>
|
|
@@ -2141,11 +5188,9 @@ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';</code></pre>
|
|
|
2141
5188
|
|
|
2142
5189
|
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
2143
5190
|
const api = new API();
|
|
2144
|
-
const params
|
|
2145
|
-
project: {_id: 1, name: 1, orgId: 1, orgIds: 1},
|
|
2146
|
-
};
|
|
5191
|
+
const params = { userId: '55e4a3bd6be6b45210833fae', userType: 'USER' };
|
|
2147
5192
|
const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
2148
|
-
await api.user.
|
|
5193
|
+
await api.admin.user.updateUserType(params, session);</code></pre>
|
|
2149
5194
|
|
|
2150
5195
|
|
|
2151
5196
|
|