@docbrasil/api-systemmanager 1.0.108 → 1.0.110

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/doc/api.md CHANGED
@@ -1920,7 +1920,7 @@ Start process
1920
1920
  | Param | Type | Default | Description |
1921
1921
  | --- | --- | --- | --- |
1922
1922
  | params | <code>object</code> | | Params to start process |
1923
- | params.processId | <code>string</code> | | Process id (_id database); |
1923
+ | params.orgProcessId | <code>string</code> | | The organization process id (_id database); |
1924
1924
  | params.orgId | <code>string</code> | | Organization id (_id database); |
1925
1925
  | [params.payload] | <code>object</code> | <code>{}</code> | Start process with data |
1926
1926
  | session | <code>string</code> | | Session, token JWT |
@@ -1930,7 +1930,7 @@ Start process
1930
1930
  const API = require('@docbrasil/api-systemmanager');
1931
1931
  const api = new API();
1932
1932
  const params = {
1933
- processId: '5dadd01dc4af3941d42f8c5c',
1933
+ orgProcessId: '5dadd01dc4af3941d42f8c5c',
1934
1934
  orgId: '5edd11c46b6ce9729c2c297c',
1935
1935
  payload: {}
1936
1936
  }
@@ -2548,7 +2548,7 @@ Class for documents, permission user
2548
2548
  * [External](#External)
2549
2549
  * [.context(params)](#External+context) ⇒ <code>Promise.&lt;object&gt;</code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>array.&lt;object&gt;</code>
2550
2550
  * [.getUploadDocumentSignedUrl(mime, authorization)](#External+getUploadDocumentSignedUrl) ⇒ <code>Promise.&lt;object&gt;</code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>string</code>
2551
- * [.getUploadDocumentSignedUrl(docs, authorization)](#External+getUploadDocumentSignedUrl) ⇒ <code>Promise.&lt;array&gt;</code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>string</code>
2551
+ * [.getUploadDocumentsSignedUrl(docs, authorization)](#External+getUploadDocumentsSignedUrl) ⇒ <code>Promise.&lt;array&gt;</code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>string</code>
2552
2552
  * [.handle(authorization, params)](#External+handle) ⇒ <code>Promise.&lt;boolean&gt;</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+getUploadDocumentSignedUrl"></a>
2604
+ <a name="External+getUploadDocumentsSignedUrl"></a>
2605
2605
 
2606
- ### external.getUploadDocumentSignedUrl(docs, authorization) ⇒ <code>Promise.&lt;array&gt;</code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>string</code>
2606
+ ### external.getUploadDocumentsSignedUrl(docs, authorization) ⇒ <code>Promise.&lt;array&gt;</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)
@@ -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">(docs, authorization)</span><span class="type-signature"> &rarr; {Promise.&lt;array>|string|string|string|string}</span>
531
+ getUploadDocumentSignedUrl<span class="signature">(mime, authorization)</span><span class="type-signature"> &rarr; {Promise.&lt;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.&lt;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"> &rarr; {Promise.&lt;array>|string|string|string|string}</span>
532
826
 
533
827
  </span>
534
828
  </h4>
package/docs/Process.html CHANGED
@@ -1297,7 +1297,7 @@ await api.user.process.getProcessProperties(params, session);</code></pre>
1297
1297
 
1298
1298
  <tr class="deep-level-1">
1299
1299
 
1300
- <td class="name"><code>processId</code></td>
1300
+ <td class="name"><code>orgProcessId</code></td>
1301
1301
 
1302
1302
 
1303
1303
  <td class="type">
@@ -1325,7 +1325,7 @@ await api.user.process.getProcessProperties(params, session);</code></pre>
1325
1325
  </td>
1326
1326
 
1327
1327
 
1328
- <td class="description last">Process id (_id database);</td>
1328
+ <td class="description last">The organization process id (_id database);</td>
1329
1329
  </tr>
1330
1330
 
1331
1331
 
@@ -1548,7 +1548,7 @@ await api.user.process.getProcessProperties(params, session);</code></pre>
1548
1548
  <pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
1549
1549
  const api = new API();
1550
1550
  const params = {
1551
- processId: '5dadd01dc4af3941d42f8c5c',
1551
+ orgProcessId: '5dadd01dc4af3941d42f8c5c',
1552
1552
  orgId: '5edd11c46b6ce9729c2c297c',
1553
1553
  payload: {}
1554
1554
  }
@@ -236,11 +236,11 @@ class External {
236
236
  * ];
237
237
  * const retDocs = await api.external.getUploadDocumentsSignedUrl(docs, authorization);
238
238
  */
239
- async getUploadDocumentSignedUrl(docs, authorization) {
239
+ async getUploadDocumentsSignedUrl(docs, authorization) {
240
240
  const self = this;
241
241
 
242
242
  try {
243
- Joi.assert(docs, Joi.string().array().error(new Error('docs is required')));
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
@@ -155,7 +155,7 @@ class Process {
155
155
  * @author CloudBrasil &lt;abernardo.br@gmail.com>
156
156
  * @description Start process
157
157
  * @param {object} params Params to start process
158
- * @param {string} params.processId Process id (_id database);
158
+ * @param {string} params.orgProcessId The organization process id (_id database);
159
159
  * @param {string} params.orgId Organization id (_id database);
160
160
  * @param {object} [params.payload={}] Start process with data
161
161
  * @param {string} session Session, token JWT
@@ -167,7 +167,7 @@ class Process {
167
167
  * const API = require('@docbrasil/api-systemmanager');
168
168
  * const api = new API();
169
169
  * const params = {
170
- * processId: '5dadd01dc4af3941d42f8c5c',
170
+ * orgProcessId: '5dadd01dc4af3941d42f8c5c',
171
171
  * orgId: '5edd11c46b6ce9729c2c297c',
172
172
  * payload: {}
173
173
  * }
@@ -179,13 +179,13 @@ class Process {
179
179
 
180
180
  try {
181
181
  Joi.assert(params, Joi.object().required());
182
- Joi.assert(params.processId, Joi.string().required());
182
+ Joi.assert(params.orgProcessId, Joi.string().required());
183
183
  Joi.assert(params.orgId, Joi.string().required());
184
184
  Joi.assert(params.payload, Joi.object());
185
185
  Joi.assert(session, Joi.string().required());
186
186
 
187
- const {processId, orgId, payload = {}} = params;
188
- const apiCall = self._client.put(`/organizations/${orgId}/process/${processId}`, payload, self._setMaxContentHeader(session));
187
+ const {orgProcessId, orgId, payload = {}} = params;
188
+ const apiCall = self._client.put(`/organizations/${orgId}/process/${orgProcessId}`, payload, self._setMaxContentHeader(session));
189
189
  return self._returnData(await apiCall);
190
190
  } catch (ex) {
191
191
  throw ex;
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.108",
4
+ "version": "1.0.110",
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",
package/readme.md CHANGED
@@ -20,5 +20,5 @@ const api = new APISystemManager();
20
20
 
21
21
  ### API
22
22
  * [API Documentation in HTML](https://cloudbrasil.github.io/api-systemmanager)
23
- * [API Documentation in Markup](https://github.com/cloudbrasil/api-systemmanager/blob/develop/doc/doc.md)
23
+ * [API Documentation in Markup](https://github.com/cloudbrasil/api-systemmanager/blob/develop/doc/api.md)
24
24
  * [API Examples](https://github.com/cloudbrasil/api-systemmanager/wiki)