@docbrasil/api-systemmanager 1.0.108 → 1.0.109
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/external.js +2 -2
- package/dist/bundle.cjs +2 -2
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +3 -3
- package/docs/External.html +295 -1
- package/docs/external.js.html +2 -2
- package/package.json +1 -1
package/doc/api.md
CHANGED
|
@@ -2548,7 +2548,7 @@ Class for documents, permission user
|
|
|
2548
2548
|
* [External](#External)
|
|
2549
2549
|
* [.context(params)](#External+context) ⇒ <code>Promise.<object></code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>array.<object></code>
|
|
2550
2550
|
* [.getUploadDocumentSignedUrl(mime, authorization)](#External+getUploadDocumentSignedUrl) ⇒ <code>Promise.<object></code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>string</code>
|
|
2551
|
-
* [.
|
|
2551
|
+
* [.getUploadDocumentsSignedUrl(docs, authorization)](#External+getUploadDocumentsSignedUrl) ⇒ <code>Promise.<array></code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>string</code>
|
|
2552
2552
|
* [.handle(authorization, params)](#External+handle) ⇒ <code>Promise.<boolean></code>
|
|
2553
2553
|
|
|
2554
2554
|
<a name="External+context"></a>
|
|
@@ -2601,9 +2601,9 @@ const doc = {
|
|
|
2601
2601
|
};
|
|
2602
2602
|
const retDoc = await api.external.getUploadDocumentSignedUrl(doc, authorization);
|
|
2603
2603
|
```
|
|
2604
|
-
<a name="External+
|
|
2604
|
+
<a name="External+getUploadDocumentsSignedUrl"></a>
|
|
2605
2605
|
|
|
2606
|
-
### external.
|
|
2606
|
+
### external.getUploadDocumentsSignedUrl(docs, authorization) ⇒ <code>Promise.<array></code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>string</code>
|
|
2607
2607
|
Get an upload signed url, for many documents. So it will be possible to upload documents temporarily during the use of the external form
|
|
2608
2608
|
|
|
2609
2609
|
**Kind**: instance method of [<code>External</code>](#External)
|
package/docs/External.html
CHANGED
|
@@ -528,7 +528,301 @@ const retForm = await api.external.context(params);</code></pre>
|
|
|
528
528
|
|
|
529
529
|
<span class="code-name">
|
|
530
530
|
|
|
531
|
-
getUploadDocumentSignedUrl<span class="signature">(
|
|
531
|
+
getUploadDocumentSignedUrl<span class="signature">(mime, authorization)</span><span class="type-signature"> → {Promise.<object>|string|string|string|string}</span>
|
|
532
|
+
|
|
533
|
+
</span>
|
|
534
|
+
</h4>
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
<div class="description">
|
|
540
|
+
Get an upload signed url, so it will be possible to upload documents temporarily during the use of the external form
|
|
541
|
+
</div>
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
<h5>Parameters:</h5>
|
|
553
|
+
|
|
554
|
+
<div class="table-container">
|
|
555
|
+
<table class="params table">
|
|
556
|
+
<thead>
|
|
557
|
+
<tr>
|
|
558
|
+
|
|
559
|
+
<th>Name</th>
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
<th>Type</th>
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
<th class="last">Description</th>
|
|
569
|
+
</tr>
|
|
570
|
+
</thead>
|
|
571
|
+
|
|
572
|
+
<tbody>
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
<tr class="deep-level-0">
|
|
577
|
+
|
|
578
|
+
<td class="name"><code>mime</code></td>
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
<td class="type">
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
<code class="param-type">string</code>
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
</td>
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
<td class="description last">the mime type of the document</td>
|
|
595
|
+
</tr>
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
|
|
601
|
+
<tr class="deep-level-0">
|
|
602
|
+
|
|
603
|
+
<td class="name"><code>authorization</code></td>
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
<td class="type">
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
<code class="param-type">string</code>
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
</td>
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
<td class="description last">a legal authorization</td>
|
|
620
|
+
</tr>
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
</tbody>
|
|
625
|
+
</table>
|
|
626
|
+
</div>
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
<dl class="details">
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
<dt class="tag-author">Author:</dt>
|
|
652
|
+
<dd class="tag-author">
|
|
653
|
+
<ul>
|
|
654
|
+
<li><a href="mailto:abernardo.br@gmail.com">CloudBrasil</a></li>
|
|
655
|
+
</ul>
|
|
656
|
+
</dd>
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
<p class="tag-source">
|
|
672
|
+
<a href="external.js.html" class="button">View Source</a>
|
|
673
|
+
<span>
|
|
674
|
+
<a href="external.js.html">external.js</a>, <a href="external.js.html#line111">line 111</a>
|
|
675
|
+
</span>
|
|
676
|
+
</p>
|
|
677
|
+
|
|
678
|
+
</dl>
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
<div class='columns method-parameter'>
|
|
698
|
+
<div class="column is-2"><label>Returns:</label></div>
|
|
699
|
+
<div class="column is-10">
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
<div class="columns">
|
|
704
|
+
|
|
705
|
+
<div class='param-desc column is-7'>doc</div>
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
<div class='column is-5 has-text-left'>
|
|
709
|
+
<label>Type: </label>
|
|
710
|
+
|
|
711
|
+
<code class="param-type">Promise.<object></code>
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
</div>
|
|
715
|
+
|
|
716
|
+
</div>
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
|
|
720
|
+
|
|
721
|
+
<div class="columns">
|
|
722
|
+
|
|
723
|
+
<div class='param-desc column is-7'>doc.mime the original mime type of the document</div>
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
<div class='column is-5 has-text-left'>
|
|
727
|
+
<label>Type: </label>
|
|
728
|
+
|
|
729
|
+
<code class="param-type">string</code>
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
</div>
|
|
733
|
+
|
|
734
|
+
</div>
|
|
735
|
+
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
<div class="columns">
|
|
740
|
+
|
|
741
|
+
<div class='param-desc column is-7'>doc.signedUrl the signed url to upload the document</div>
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
<div class='column is-5 has-text-left'>
|
|
745
|
+
<label>Type: </label>
|
|
746
|
+
|
|
747
|
+
<code class="param-type">string</code>
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
</div>
|
|
751
|
+
|
|
752
|
+
</div>
|
|
753
|
+
|
|
754
|
+
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
<div class="columns">
|
|
758
|
+
|
|
759
|
+
<div class='param-desc column is-7'>doc.filename the filename of the uploaded file</div>
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
<div class='column is-5 has-text-left'>
|
|
763
|
+
<label>Type: </label>
|
|
764
|
+
|
|
765
|
+
<code class="param-type">string</code>
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
</div>
|
|
769
|
+
|
|
770
|
+
</div>
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
<div class="columns">
|
|
776
|
+
|
|
777
|
+
<div class='param-desc column is-7'>doc.extension the extension of the filename, obtained from the mime type</div>
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
<div class='column is-5 has-text-left'>
|
|
781
|
+
<label>Type: </label>
|
|
782
|
+
|
|
783
|
+
<code class="param-type">string</code>
|
|
784
|
+
|
|
785
|
+
|
|
786
|
+
</div>
|
|
787
|
+
|
|
788
|
+
</div>
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
</div>
|
|
792
|
+
</div>
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
<h5>Example</h5>
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
<pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
|
|
801
|
+
const api = new API();
|
|
802
|
+
const authorization = '...';
|
|
803
|
+
const doc = {
|
|
804
|
+
mime: 'application/pdf'
|
|
805
|
+
};
|
|
806
|
+
const retDoc = await api.external.getUploadDocumentSignedUrl(doc, authorization);</code></pre>
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
</div>
|
|
811
|
+
|
|
812
|
+
<div class="member">
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
<h4 class="name" id="getUploadDocumentsSignedUrl">
|
|
817
|
+
<a class="href-link" href="#getUploadDocumentsSignedUrl">#</a>
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
<span class='tag'>async</span>
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
<span class="code-name">
|
|
824
|
+
|
|
825
|
+
getUploadDocumentsSignedUrl<span class="signature">(docs, authorization)</span><span class="type-signature"> → {Promise.<array>|string|string|string|string}</span>
|
|
532
826
|
|
|
533
827
|
</span>
|
|
534
828
|
</h4>
|
package/docs/external.js.html
CHANGED
|
@@ -236,11 +236,11 @@ class External {
|
|
|
236
236
|
* ];
|
|
237
237
|
* const retDocs = await api.external.getUploadDocumentsSignedUrl(docs, authorization);
|
|
238
238
|
*/
|
|
239
|
-
async
|
|
239
|
+
async getUploadDocumentsSignedUrl(docs, authorization) {
|
|
240
240
|
const self = this;
|
|
241
241
|
|
|
242
242
|
try {
|
|
243
|
-
Joi.assert(docs, Joi.
|
|
243
|
+
Joi.assert(docs, Joi.array().required().error(new Error('docs is required')));
|
|
244
244
|
Joi.assert(authorization, Joi.string().required().error(new Error('authorization is required')));
|
|
245
245
|
|
|
246
246
|
const apiCall = self._client
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docbrasil/api-systemmanager",
|
|
3
3
|
"description": "Module API System Manager",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.109",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"htmldoc": "rm -rf docs && jsdoc api/** -d docs -t ./node_modules/better-docs",
|
|
7
7
|
"doc": "rm -rf doc && mkdir doc && jsdoc2md api/**/* api/* > doc/api.md",
|