@docbrasil/api-systemmanager 1.1.36 → 1.1.37

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
@@ -1569,6 +1569,7 @@ Class for documents, permission user
1569
1569
  * [.signedUrl(params, session)](#Documents+signedUrl) ⇒ <code>Promise.&lt;object&gt;</code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>string</code>
1570
1570
  * [.signedUrls(params, session)](#Documents+signedUrls) ⇒ <code>Promise.&lt;object&gt;</code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>string</code> \| <code>string</code>
1571
1571
  * [.uploadSignedDocument(params)](#Documents+uploadSignedDocument) ⇒ <code>Promise.&lt;boolean&gt;</code>
1572
+ * [.uploadDocumentS3(params)](#Documents+uploadDocumentS3) ⇒ <code>Promise.&lt;boolean&gt;</code>
1572
1573
  * [.checkPrimaryKeys(params, session)](#Documents+checkPrimaryKeys) ⇒ <code>Promise.&lt;array&gt;</code> \| <code>array.&lt;string&gt;</code>
1573
1574
  * [.searchDocuments(params, session)](#Documents+searchDocuments) ⇒ <code>promise</code> \| <code>number</code> \| <code>array.&lt;object&gt;</code> \| <code>number</code> \| <code>number</code>
1574
1575
  * [.exportExcelForAllPages(params, session)](#Documents+exportExcelForAllPages) ⇒ <code>promise</code>
@@ -1910,6 +1911,39 @@ const params - {
1910
1911
  };
1911
1912
  const retData = await api.user.document.uploadSignedDocument(params);
1912
1913
 
1914
+ onUploadProgress return the progressEvent
1915
+ - lengthComputable: A Boolean that indicates whether or not the total number of bytes is known.
1916
+ - loaded: The number of bytes of the file that have been uploaded.
1917
+ - total: The total number of bytes in the file.
1918
+ ```
1919
+ <a name="Documents+uploadDocumentS3"></a>
1920
+
1921
+ ### documents.uploadDocumentS3(params) ⇒ <code>Promise.&lt;boolean&gt;</code>
1922
+ Uploads the file
1923
+
1924
+ **Kind**: instance method of [<code>Documents</code>](#Documents)
1925
+ **Returns**: <code>Promise.&lt;boolean&gt;</code> - True if success
1926
+ **Access**: public
1927
+
1928
+ | Param | Type | Description |
1929
+ | --- | --- | --- |
1930
+ | params | <code>object</code> | Params to upload document S3 |
1931
+ | params.data | <code>buffer</code> | The data of the file |
1932
+ | params.areaId | <code>string</code> | The docAreaId |
1933
+ | params.orgId | <code>string</code> | The orgId |
1934
+ | params.onUploadProgress | <code>string</code> | A callback for the upload progress. It will return a progressEvent. |
1935
+
1936
+ **Example**
1937
+ ```js
1938
+ const API = require('@docbrasil/api-systemmanager');
1939
+ const api = new API();
1940
+ const params - {
1941
+ data: {},
1942
+ areaId: '5dadd01dc4af3941d42f8c5c',
1943
+ orgId: '5dadd01dc4af3941d42f8c5c'
1944
+ };
1945
+ const retData = await api.user.document.uploadDocumentS3(params);
1946
+
1913
1947
  onUploadProgress return the progressEvent
1914
1948
  - lengthComputable: A Boolean that indicates whether or not the total number of bytes is known.
1915
1949
  - loaded: The number of bytes of the file that have been uploaded.
@@ -2907,6 +2941,7 @@ Class for process, permission user
2907
2941
  * [.exportProcessData(params, session)](#Process+exportProcessData)
2908
2942
  * [.processDocs(params, session)](#Process+processDocs) ⇒ <code>promise</code> \| <code>array.&lt;object&gt;</code>
2909
2943
  * [.downloadDocs(params, session)](#Process+downloadDocs) ⇒ <code>promise</code>
2944
+ * [.getOrgDocTypes(params, session)](#Process+getOrgDocTypes) ⇒ <code>Promise</code>
2910
2945
 
2911
2946
  <a name="Process+start"></a>
2912
2947
 
@@ -3164,6 +3199,33 @@ const params = {
3164
3199
  const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
3165
3200
  const result = await api.user.process.downloadDocs(params, session);
3166
3201
  ```
3202
+ <a name="Process+getOrgDocTypes"></a>
3203
+
3204
+ ### process.getOrgDocTypes(params, session) ⇒ <code>Promise</code>
3205
+ Get DocType properties of process
3206
+
3207
+ **Kind**: instance method of [<code>Process</code>](#Process)
3208
+ **Access**: public
3209
+ **Author**: Myndware <augusto.pissarra@myndware.com>
3210
+
3211
+ | Param | Type | Description |
3212
+ | --- | --- | --- |
3213
+ | params | <code>object</code> | Params to get document DocType |
3214
+ | params.docTypeId | <code>string</code> | Document DocTypeId id (_id database); |
3215
+ | params.orgId | <code>string</code> | Organization id (_id database); |
3216
+ | session | <code>string</code> | Session, token JWT |
3217
+
3218
+ **Example**
3219
+ ```js
3220
+ const API = require('@docbrasil/api-systemmanager');
3221
+ const api = new API();
3222
+ const params = {
3223
+ docTypeId: '5dadd01dc4af3941d42f8c5c',
3224
+ orgId: '5edd11c46b6ce9729c2c297c',
3225
+ }
3226
+ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
3227
+ await api.user.process.getOrgDocTypes(params, session);
3228
+ ```
3167
3229
  <a name="Register"></a>
3168
3230
 
3169
3231
  ## Register
@@ -1657,7 +1657,7 @@ Checks if a document can be added and it does not repeat its primary key</li>
1657
1657
  <p class="tag-source">
1658
1658
  <a href="user_document.js.html" class="button">View Source</a>
1659
1659
  <span>
1660
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line738">line 738</a>
1660
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line793">line 793</a>
1661
1661
  </span>
1662
1662
  </p>
1663
1663
 
@@ -1950,7 +1950,7 @@ const retDocs = await api.user.document.checkPrimaryKeys(params, session);</code
1950
1950
  <p class="tag-source">
1951
1951
  <a href="user_document.js.html" class="button">View Source</a>
1952
1952
  <span>
1953
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line826">line 826</a>
1953
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line881">line 881</a>
1954
1954
  </span>
1955
1955
  </p>
1956
1956
 
@@ -2222,7 +2222,7 @@ const retSearch = await api.user.document.exportExcelForAllPages(params, session
2222
2222
  <p class="tag-source">
2223
2223
  <a href="user_document.js.html" class="button">View Source</a>
2224
2224
  <span>
2225
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line866">line 866</a>
2225
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line921">line 921</a>
2226
2226
  </span>
2227
2227
  </p>
2228
2228
 
@@ -4417,7 +4417,7 @@ await api.user.document.findByIdsAndRemove(params, session);</code></pre>
4417
4417
  <p class="tag-source">
4418
4418
  <a href="user_document.js.html" class="button">View Source</a>
4419
4419
  <span>
4420
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line916">line 916</a>
4420
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line971">line 971</a>
4421
4421
  </span>
4422
4422
  </p>
4423
4423
 
@@ -4698,7 +4698,7 @@ const retSearch = await api.user.document.performDownloadComplete(params, sessio
4698
4698
  <p class="tag-source">
4699
4699
  <a href="user_document.js.html" class="button">View Source</a>
4700
4700
  <span>
4701
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line786">line 786</a>
4701
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line841">line 841</a>
4702
4702
  </span>
4703
4703
  </p>
4704
4704
 
@@ -5042,7 +5042,7 @@ const retSearch = await api.user.document.searchDocuments(params, session);</cod
5042
5042
  <p class="tag-source">
5043
5043
  <a href="user_document.js.html" class="button">View Source</a>
5044
5044
  <span>
5045
- <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line961">line 961</a>
5045
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line1016">line 1016</a>
5046
5046
  </span>
5047
5047
  </p>
5048
5048
 
@@ -6194,6 +6194,297 @@ const base64Data = await api.user.document.signedUrls(params, session);</code></
6194
6194
 
6195
6195
 
6196
6196
 
6197
+ </div>
6198
+
6199
+ <div class="member">
6200
+
6201
+
6202
+
6203
+ <h4 class="name" id="uploadDocumentS3">
6204
+ <a class="href-link" href="#uploadDocumentS3">#</a>
6205
+
6206
+
6207
+ <span class='tag'>async</span>
6208
+
6209
+
6210
+ <span class="code-name">
6211
+
6212
+ uploadDocumentS3<span class="signature">(params)</span><span class="type-signature"> &rarr; {Promise.&lt;boolean>}</span>
6213
+
6214
+ </span>
6215
+ </h4>
6216
+
6217
+
6218
+
6219
+
6220
+ <div class="description">
6221
+ Uploads the file
6222
+ </div>
6223
+
6224
+
6225
+
6226
+
6227
+
6228
+
6229
+
6230
+
6231
+
6232
+
6233
+ <h5>Parameters:</h5>
6234
+
6235
+ <div class="table-container">
6236
+ <table class="params table">
6237
+ <thead>
6238
+ <tr>
6239
+
6240
+ <th>Name</th>
6241
+
6242
+
6243
+ <th>Type</th>
6244
+
6245
+
6246
+
6247
+
6248
+
6249
+ <th class="last">Description</th>
6250
+ </tr>
6251
+ </thead>
6252
+
6253
+ <tbody>
6254
+
6255
+
6256
+
6257
+ <tr class="deep-level-0">
6258
+
6259
+ <td class="name"><code>params</code></td>
6260
+
6261
+
6262
+ <td class="type">
6263
+
6264
+
6265
+ <code class="param-type">object</code>
6266
+
6267
+
6268
+
6269
+ </td>
6270
+
6271
+
6272
+
6273
+
6274
+
6275
+ <td class="description last">Params to upload document S3</td>
6276
+ </tr>
6277
+
6278
+
6279
+
6280
+
6281
+ <tr class="deep-level-1">
6282
+
6283
+ <td class="name"><code>data</code></td>
6284
+
6285
+
6286
+ <td class="type">
6287
+
6288
+
6289
+ <code class="param-type">buffer</code>
6290
+
6291
+
6292
+
6293
+ </td>
6294
+
6295
+
6296
+
6297
+
6298
+
6299
+ <td class="description last">The data of the file</td>
6300
+ </tr>
6301
+
6302
+
6303
+
6304
+ <tr class="deep-level-1">
6305
+
6306
+ <td class="name"><code>areaId</code></td>
6307
+
6308
+
6309
+ <td class="type">
6310
+
6311
+
6312
+ <code class="param-type">string</code>
6313
+
6314
+
6315
+
6316
+ </td>
6317
+
6318
+
6319
+
6320
+
6321
+
6322
+ <td class="description last">The docAreaId</td>
6323
+ </tr>
6324
+
6325
+
6326
+
6327
+ <tr class="deep-level-1">
6328
+
6329
+ <td class="name"><code>orgId</code></td>
6330
+
6331
+
6332
+ <td class="type">
6333
+
6334
+
6335
+ <code class="param-type">string</code>
6336
+
6337
+
6338
+
6339
+ </td>
6340
+
6341
+
6342
+
6343
+
6344
+
6345
+ <td class="description last">The orgId</td>
6346
+ </tr>
6347
+
6348
+
6349
+
6350
+ <tr class="deep-level-1">
6351
+
6352
+ <td class="name"><code>onUploadProgress</code></td>
6353
+
6354
+
6355
+ <td class="type">
6356
+
6357
+
6358
+ <code class="param-type">string</code>
6359
+
6360
+
6361
+
6362
+ </td>
6363
+
6364
+
6365
+
6366
+
6367
+
6368
+ <td class="description last">A callback for the upload progress. It will return a progressEvent.</td>
6369
+ </tr>
6370
+
6371
+
6372
+
6373
+
6374
+
6375
+ </tbody>
6376
+ </table>
6377
+ </div>
6378
+
6379
+
6380
+
6381
+
6382
+
6383
+ <dl class="details">
6384
+
6385
+
6386
+
6387
+
6388
+
6389
+
6390
+
6391
+
6392
+
6393
+
6394
+
6395
+
6396
+
6397
+
6398
+
6399
+
6400
+
6401
+
6402
+
6403
+
6404
+
6405
+
6406
+
6407
+
6408
+
6409
+
6410
+
6411
+
6412
+
6413
+
6414
+
6415
+ <p class="tag-source">
6416
+ <a href="user_document.js.html" class="button">View Source</a>
6417
+ <span>
6418
+ <a href="user_document.js.html">user/document.js</a>, <a href="user_document.js.html#line735">line 735</a>
6419
+ </span>
6420
+ </p>
6421
+
6422
+ </dl>
6423
+
6424
+
6425
+
6426
+
6427
+
6428
+
6429
+
6430
+
6431
+
6432
+
6433
+
6434
+
6435
+
6436
+
6437
+
6438
+
6439
+
6440
+
6441
+ <div class='columns method-parameter'>
6442
+ <div class="column is-2"><label>Returns:</label></div>
6443
+ <div class="column is-10">
6444
+
6445
+
6446
+
6447
+ <div class="columns">
6448
+
6449
+ <div class='param-desc column is-7'>True if success</div>
6450
+
6451
+
6452
+ <div class='column is-5 has-text-left'>
6453
+ <label>Type: </label>
6454
+
6455
+ <code class="param-type">Promise.&lt;boolean></code>
6456
+
6457
+
6458
+ </div>
6459
+
6460
+ </div>
6461
+
6462
+
6463
+ </div>
6464
+ </div>
6465
+
6466
+
6467
+
6468
+
6469
+ <h5>Example</h5>
6470
+
6471
+
6472
+ <pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
6473
+ const api = new API();
6474
+ const params - {
6475
+ data: {},
6476
+ areaId: '5dadd01dc4af3941d42f8c5c',
6477
+ orgId: '5dadd01dc4af3941d42f8c5c'
6478
+ };
6479
+ const retData = await api.user.document.uploadDocumentS3(params);
6480
+
6481
+ onUploadProgress return the progressEvent
6482
+ - lengthComputable: A Boolean that indicates whether or not the total number of bytes is known.
6483
+ - loaded: The number of bytes of the file that have been uploaded.
6484
+ - total: The total number of bytes in the file.</code></pre>
6485
+
6486
+
6487
+
6197
6488
  </div>
6198
6489
 
6199
6490
  <div class="member">
package/docs/Process.html CHANGED
@@ -1376,6 +1376,276 @@ const retSearch = await api.user.process.find(params, session);</code></pre>
1376
1376
 
1377
1377
 
1378
1378
 
1379
+ </div>
1380
+
1381
+ <div class="member">
1382
+
1383
+
1384
+
1385
+ <h4 class="name" id="getOrgDocTypes">
1386
+ <a class="href-link" href="#getOrgDocTypes">#</a>
1387
+
1388
+
1389
+ <span class='tag'>async</span>
1390
+
1391
+
1392
+ <span class="code-name">
1393
+
1394
+ getOrgDocTypes<span class="signature">(params, session)</span><span class="type-signature"> &rarr; {Promise}</span>
1395
+
1396
+ </span>
1397
+ </h4>
1398
+
1399
+
1400
+
1401
+
1402
+ <div class="description">
1403
+ Get DocType properties of process
1404
+ </div>
1405
+
1406
+
1407
+
1408
+
1409
+
1410
+
1411
+
1412
+
1413
+
1414
+
1415
+ <h5>Parameters:</h5>
1416
+
1417
+ <div class="table-container">
1418
+ <table class="params table">
1419
+ <thead>
1420
+ <tr>
1421
+
1422
+ <th>Name</th>
1423
+
1424
+
1425
+ <th>Type</th>
1426
+
1427
+
1428
+
1429
+
1430
+
1431
+ <th class="last">Description</th>
1432
+ </tr>
1433
+ </thead>
1434
+
1435
+ <tbody>
1436
+
1437
+
1438
+
1439
+ <tr class="deep-level-0">
1440
+
1441
+ <td class="name"><code>params</code></td>
1442
+
1443
+
1444
+ <td class="type">
1445
+
1446
+
1447
+ <code class="param-type">object</code>
1448
+
1449
+
1450
+
1451
+ </td>
1452
+
1453
+
1454
+
1455
+
1456
+
1457
+ <td class="description last">Params to get document DocType</td>
1458
+ </tr>
1459
+
1460
+
1461
+
1462
+
1463
+ <tr class="deep-level-1">
1464
+
1465
+ <td class="name"><code>docTypeId</code></td>
1466
+
1467
+
1468
+ <td class="type">
1469
+
1470
+
1471
+ <code class="param-type">string</code>
1472
+
1473
+
1474
+
1475
+ </td>
1476
+
1477
+
1478
+
1479
+
1480
+
1481
+ <td class="description last">Document DocTypeId id (_id database);</td>
1482
+ </tr>
1483
+
1484
+
1485
+
1486
+ <tr class="deep-level-1">
1487
+
1488
+ <td class="name"><code>orgId</code></td>
1489
+
1490
+
1491
+ <td class="type">
1492
+
1493
+
1494
+ <code class="param-type">string</code>
1495
+
1496
+
1497
+
1498
+ </td>
1499
+
1500
+
1501
+
1502
+
1503
+
1504
+ <td class="description last">Organization id (_id database);</td>
1505
+ </tr>
1506
+
1507
+
1508
+
1509
+
1510
+
1511
+
1512
+
1513
+ <tr class="deep-level-0">
1514
+
1515
+ <td class="name"><code>session</code></td>
1516
+
1517
+
1518
+ <td class="type">
1519
+
1520
+
1521
+ <code class="param-type">string</code>
1522
+
1523
+
1524
+
1525
+ </td>
1526
+
1527
+
1528
+
1529
+
1530
+
1531
+ <td class="description last">Session, token JWT</td>
1532
+ </tr>
1533
+
1534
+
1535
+
1536
+ </tbody>
1537
+ </table>
1538
+ </div>
1539
+
1540
+
1541
+
1542
+
1543
+
1544
+ <dl class="details">
1545
+
1546
+
1547
+
1548
+
1549
+
1550
+
1551
+
1552
+
1553
+
1554
+
1555
+
1556
+
1557
+
1558
+
1559
+
1560
+
1561
+
1562
+
1563
+ <dt class="tag-author">Author:</dt>
1564
+ <dd class="tag-author">
1565
+ <ul>
1566
+ <li><a href="mailto:augusto.pissarra@myndware.com">Myndware</a></li>
1567
+ </ul>
1568
+ </dd>
1569
+
1570
+
1571
+
1572
+
1573
+
1574
+
1575
+
1576
+
1577
+
1578
+
1579
+
1580
+
1581
+
1582
+
1583
+ <p class="tag-source">
1584
+ <a href="user_process.js.html" class="button">View Source</a>
1585
+ <span>
1586
+ <a href="user_process.js.html">user/process.js</a>, <a href="user_process.js.html#line463">line 463</a>
1587
+ </span>
1588
+ </p>
1589
+
1590
+ </dl>
1591
+
1592
+
1593
+
1594
+
1595
+
1596
+
1597
+
1598
+
1599
+
1600
+
1601
+
1602
+
1603
+
1604
+
1605
+
1606
+
1607
+
1608
+
1609
+ <div class='columns method-parameter'>
1610
+ <div class="column is-2"><label>Returns:</label></div>
1611
+ <div class="column is-10">
1612
+
1613
+
1614
+
1615
+ <div class="columns">
1616
+
1617
+
1618
+ <div class='column is-5 has-text-left'>
1619
+ <label>Type: </label>
1620
+
1621
+ <code class="param-type">Promise</code>
1622
+
1623
+
1624
+ </div>
1625
+
1626
+ </div>
1627
+
1628
+
1629
+ </div>
1630
+ </div>
1631
+
1632
+
1633
+
1634
+
1635
+ <h5>Example</h5>
1636
+
1637
+
1638
+ <pre class="prettyprint"><code>const API = require('@docbrasil/api-systemmanager');
1639
+ const api = new API();
1640
+ const params = {
1641
+ docTypeId: '5dadd01dc4af3941d42f8c5c',
1642
+ orgId: '5edd11c46b6ce9729c2c297c',
1643
+ }
1644
+ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
1645
+ await api.user.process.getOrgDocTypes(params, session);</code></pre>
1646
+
1647
+
1648
+
1379
1649
  </div>
1380
1650
 
1381
1651
  <div class="member">