@docbrasil/api-systemmanager 1.1.68 → 1.1.70

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
@@ -1619,6 +1619,7 @@ Class for documents, permission user
1619
1619
 
1620
1620
  * [Documents](#Documents)
1621
1621
  * [.add(params, session)](#Documents+add) ⇒ <code>Promise</code>
1622
+ * [.addDocuments(params, session)](#Documents+addDocuments) ⇒ <code>Promise.&lt;object&gt;</code> \| <code>boolean</code> \| <code>array.&lt;object&gt;</code> \| <code>array.&lt;object&gt;</code>
1622
1623
  * [.findByIdAndUpdate(id, params, session)](#Documents+findByIdAndUpdate) ⇒ <code>Promise</code>
1623
1624
  * [.findByIdsAndUpdate(ids, params, session)](#Documents+findByIdsAndUpdate) ⇒ <code>Promise</code>
1624
1625
  * [.findById(id, session)](#Documents+findById) ⇒ <code>Promise</code>
@@ -1694,6 +1695,65 @@ const params = {
1694
1695
  const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
1695
1696
  await api.user.document.add(params, session);
1696
1697
  ```
1698
+ <a name="Documents+addDocuments"></a>
1699
+
1700
+ ### documents.addDocuments(params, session) ⇒ <code>Promise.&lt;object&gt;</code> \| <code>boolean</code> \| <code>array.&lt;object&gt;</code> \| <code>array.&lt;object&gt;</code>
1701
+ Add multiple documents to a doc area under a doc type
1702
+
1703
+ **Kind**: instance method of [<code>Documents</code>](#Documents)
1704
+ **Returns**: <code>Promise.&lt;object&gt;</code> - The result of the operation<code>boolean</code> - return.success True if the operation was successful<code>array.&lt;object&gt;</code> - return.added Array of added documents<code>array.&lt;object&gt;</code> - return.notAdded Array of documents that could not be added
1705
+ **Access**: public
1706
+ **Author**: Myndware <augusto.pissarra@myndware.com>
1707
+
1708
+ | Param | Type | Default | Description |
1709
+ | --- | --- | --- | --- |
1710
+ | params | <code>object</code> | | Object for adding documents |
1711
+ | params.orgId | <code>string</code> | | Organization id (_id database) |
1712
+ | params.userId | <code>string</code> | | User id (_id database) |
1713
+ | params.docAreaName | <code>string</code> | | The name of the doc area |
1714
+ | params.docTypeName | <code>string</code> | | The name of the doc type |
1715
+ | params.docs | <code>array.&lt;object&gt;</code> | | Array of documents to add |
1716
+ | [params.docs.document] | <code>string</code> | <code>&quot;&#x27;&#x27;&quot;</code> | The url to the document on S3, an external URL or a base64 representation of the document |
1717
+ | [params.docs.type] | <code>string</code> | <code>&quot;&#x27;&#x27;&quot;</code> | The mime type of the document |
1718
+ | [params.docs.name] | <code>string</code> | <code>&quot;&#x27;&#x27;&quot;</code> | The name of the document |
1719
+ | [params.docs.content] | <code>string</code> | <code>&quot;&#x27;&#x27;&quot;</code> | The content of the document |
1720
+ | [params.docs.bytes] | <code>number</code> | <code>0</code> | The bytes (in kb) of the document |
1721
+ | [params.docs.urlType] | <code>string</code> | <code>&quot;&#x27;&#x27;&quot;</code> | The urlType of the document |
1722
+ | [params.docs.description] | <code>string</code> | <code>&quot;&#x27;&#x27;&quot;</code> | The description of the document |
1723
+ | [params.docs.category] | <code>string</code> | <code>&quot;&#x27;&#x27;&quot;</code> | The category of the document |
1724
+ | [params.docs.tags] | <code>array.&lt;string&gt;</code> | <code>[]</code> | The tags of the document |
1725
+ | [params.docs.docTypeFieldsData] | <code>object</code> | <code>{}</code> | The data related to this document |
1726
+ | [params.docs.hasPhisicalStorage] | <code>boolean</code> | <code>false</code> | The flag to define if the document has physical storage or not |
1727
+ | [params.docs.boxId] | <code>string</code> | <code>&quot;&#x27;&#x27;&quot;</code> | The boxId if we define the document has physical storage |
1728
+ | [params.docs.status] | <code>number</code> | | The document status |
1729
+ | [params.docs.storageStatus] | <code>string</code> | <code>&quot;&#x27;&#x27;&quot;</code> | The storageStatus if we define the document has physical storage |
1730
+ | session | <code>string</code> | | Session, token JWT |
1731
+
1732
+ **Example**
1733
+ ```js
1734
+ const API = require('@docbrasil/api-systemmanager');
1735
+ const api = new API();
1736
+ const params = {
1737
+ orgId: '5df7f19618430c89a41a19d2',
1738
+ userId: '5df7f19618430c89a41a19d3',
1739
+ docAreaName: 'My Doc Area',
1740
+ docTypeName: 'My Doc Type',
1741
+ docs: [
1742
+ {
1743
+ document: 'https://s3.amazonaws.com/...',
1744
+ type: 'application/pdf',
1745
+ name: 'Document 1',
1746
+ description: 'First document',
1747
+ category: 'Category 1',
1748
+ tags: ['tag1', 'tag2'],
1749
+ docTypeFieldsData: { extraField: 'value' },
1750
+ bytes: 12345
1751
+ }
1752
+ ]
1753
+ };
1754
+ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
1755
+ const result = await api.user.document.addDocuments(params, session);
1756
+ ```
1697
1757
  <a name="Documents+findByIdAndUpdate"></a>
1698
1758
 
1699
1759
  ### documents.findByIdAndUpdate(id, params, session) ⇒ <code>Promise</code>
@@ -3458,6 +3518,7 @@ Class for process, permission user
3458
3518
  * [.getOrgDocTypes(params, session)](#Process+getOrgDocTypes) ⇒ <code>Promise</code>
3459
3519
  * [.getOrgGroups(params, session)](#Process+getOrgGroups) ⇒ <code>Promise</code>
3460
3520
  * [.getOrgUsers(params, session)](#Process+getOrgUsers) ⇒ <code>Promise</code>
3521
+ * [.getStepHistory(params, session)](#Process+getStepHistory) ⇒ <code>Promise.&lt;Array&gt;</code>
3461
3522
 
3462
3523
  <a name="Process+start"></a>
3463
3524
 
@@ -3794,6 +3855,36 @@ const params = {
3794
3855
  const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
3795
3856
  await api.user.process.getOrgUsers(params, session);
3796
3857
  ```
3858
+ <a name="Process+getStepHistory"></a>
3859
+
3860
+ ### process.getStepHistory(params, session) ⇒ <code>Promise.&lt;Array&gt;</code>
3861
+ Get step history of a process flow
3862
+
3863
+ **Kind**: instance method of [<code>Process</code>](#Process)
3864
+ **Returns**: <code>Promise.&lt;Array&gt;</code> - Array of step history entries
3865
+ **Access**: public
3866
+ **Author**: Myndware <augusto.pissarra@myndware.com>
3867
+
3868
+ | Param | Type | Description |
3869
+ | --- | --- | --- |
3870
+ | params | <code>object</code> | Params to get step history |
3871
+ | params.orgId | <code>string</code> | Organization id (_id database); |
3872
+ | params.processId | <code>string</code> | Process id (_id database); |
3873
+ | params.flowId | <code>string</code> | Flow id; |
3874
+ | session | <code>string</code> | Session, token JWT |
3875
+
3876
+ **Example**
3877
+ ```js
3878
+ const API = require('@docbrasil/api-systemmanager');
3879
+ const api = new API();
3880
+ const params = {
3881
+ orgId: '5edd11c46b6ce9729c2c297c',
3882
+ processId: '5dadd01dc4af3941d42f8c5c',
3883
+ flowId: 'Task_18v1xx7'
3884
+ }
3885
+ const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
3886
+ const stepHistory = await api.user.process.getStepHistory(params, session);
3887
+ ```
3797
3888
  <a name="Register"></a>
3798
3889
 
3799
3890
  ## Register