@docbrasil/api-systemmanager 1.0.109 → 1.0.111

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/.project ADDED
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <projectDescription>
3
+ <name>api-systemmanager</name>
4
+ <comment></comment>
5
+ <projects>
6
+ </projects>
7
+ <buildSpec>
8
+ </buildSpec>
9
+ <natures>
10
+ </natures>
11
+ </projectDescription>
@@ -68,7 +68,7 @@ class Process {
68
68
  * @author CloudBrasil <abernardo.br@gmail.com>
69
69
  * @description Start process
70
70
  * @param {object} params Params to start process
71
- * @param {string} params.processId Process id (_id database);
71
+ * @param {string} params.orgProcessId The organization process id (_id database);
72
72
  * @param {string} params.orgId Organization id (_id database);
73
73
  * @param {object} [params.payload={}] Start process with data
74
74
  * @param {string} session Session, token JWT
@@ -80,7 +80,7 @@ class Process {
80
80
  * const API = require('@docbrasil/api-systemmanager');
81
81
  * const api = new API();
82
82
  * const params = {
83
- * processId: '5dadd01dc4af3941d42f8c5c',
83
+ * orgProcessId: '5dadd01dc4af3941d42f8c5c',
84
84
  * orgId: '5edd11c46b6ce9729c2c297c',
85
85
  * payload: {}
86
86
  * }
@@ -92,13 +92,13 @@ class Process {
92
92
 
93
93
  try {
94
94
  Joi.assert(params, Joi.object().required());
95
- Joi.assert(params.processId, Joi.string().required());
95
+ Joi.assert(params.orgProcessId, Joi.string().required());
96
96
  Joi.assert(params.orgId, Joi.string().required());
97
97
  Joi.assert(params.payload, Joi.object());
98
98
  Joi.assert(session, Joi.string().required());
99
99
 
100
- const {processId, orgId, payload = {}} = params;
101
- const apiCall = self._client.put(`/organizations/${orgId}/process/${processId}`, payload, self._setMaxContentHeader(session));
100
+ const {orgProcessId, orgId, payload = {}} = params;
101
+ const apiCall = self._client.put(`/organizations/${orgId}/process/${orgProcessId}`, payload, self._setMaxContentHeader(session));
102
102
  return self._returnData(await apiCall);
103
103
  } catch (ex) {
104
104
  throw ex;
@@ -230,6 +230,121 @@ class Process {
230
230
  throw ex;
231
231
  }
232
232
  }
233
+
234
+ /**
235
+ * @author CloudBrasil <abernardo.br@gmail.com>
236
+ * @description Method to remove process
237
+ * @param {object} params Params to remove process
238
+ * @param {object} params.orgId Organization id (_id database)
239
+ * @param {object} params.processId Process id (_id database)
240
+ * @param {string} session Session, token JWT
241
+ * @public
242
+ * @example
243
+ *
244
+ * const API = require('@docbrasil/api-systemmanager');
245
+ * const api = new API();
246
+ * const params = {
247
+ * orgId: '55e4a3bd6be6b45210833fae',
248
+ * processId: '55e4a3bd6be6b45210833fae'
249
+ * };
250
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
251
+ * const retSearch = await api.user.process.remove(params, session);
252
+ */
253
+ async remove(params, session) {
254
+ const self = this;
255
+
256
+ try {
257
+ Joi.assert(params, Joi.object().required(), 'Params to remove the process');
258
+ Joi.assert(params.processId, Joi.string().required(), 'Process id (_id database)');
259
+ Joi.assert(params.orgId, Joi.string().required(), 'Organization id (_id database)');
260
+ Joi.assert(session, Joi.string().required(), 'Session token JWT');
261
+
262
+ const {processId, orgId} = params;
263
+
264
+ const apiCall = self._client.delete(`/organizations/${orgId}/process/${processId}`, self._setHeader(session));
265
+ return self._returnData(await apiCall);
266
+ } catch (ex) {
267
+ throw ex;
268
+ }
269
+ }
270
+
271
+ /**
272
+ * @author CloudBrasil <abernardo.br@gmail.com>
273
+ * @description Method to export status data
274
+ * @param {object} params Params to export status data
275
+ * @param {object} params.query Search process query
276
+ * @param {object} params.orgId Organization id (_id database)
277
+ * @param {string} session Session, token JWT
278
+ * @public
279
+ * @example
280
+ *
281
+ * const API = require('@docbrasil/api-systemmanager');
282
+ * const api = new API();
283
+ * const params = {
284
+ * query: {"orgProcessId": {"value":"62c2d1cdfb5455c195d1baa1","oper":"=","type":"string"},"s":[{"historyBegin":{"order":"desc"}}],"i":1,"p":20},
285
+ * orgId: '55e4a3bd6be6b45210833fae',
286
+ * };
287
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
288
+ * const retSearch = await api.user.process.exportStatusData(params, session);
289
+ */
290
+ async exportStatusData(params, session) {
291
+ const self = this;
292
+
293
+ try {
294
+ Joi.assert(params, Joi.object().required(), 'Params to export status data');
295
+ Joi.assert(params.query, Joi.object().required(), 'The query for the search');
296
+ Joi.assert(params.orgId, Joi.string().required(), 'Organization id (_id database)');
297
+ Joi.assert(session, Joi.string().required(), 'Session token JWT');
298
+
299
+ const {query, orgId} = params;
300
+ const queryString = JSON.stringify(query);
301
+ const apiCall = self._client
302
+ .get(`/organizations/${orgId}/process/export/status/data?query=${queryString}`, self._setHeader(session));
303
+
304
+ return self._returnData(await apiCall);
305
+ } catch (ex) {
306
+ throw ex;
307
+ }
308
+ }
309
+
310
+ /**
311
+ * @author CloudBrasil <abernardo.br@gmail.com>
312
+ * @description Method to export process data
313
+ * @param {object} params Params to export process data
314
+ * @param {object} params.query Search process query
315
+ * @param {object} params.orgId Organization id (_id database)
316
+ * @param {string} session Session, token JWT
317
+ * @public
318
+ * @example
319
+ *
320
+ * const API = require('@docbrasil/api-systemmanager');
321
+ * const api = new API();
322
+ * const params = {
323
+ * query: {"orgProcessId": {"value":"62c2d1cdfb5455c195d1baa1","oper":"=","type":"string"},"s":[{"historyBegin":{"order":"desc"}}],"i":1,"p":20},
324
+ * orgId: '55e4a3bd6be6b45210833fae',
325
+ * };
326
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
327
+ * const retSearch = await api.user.process.exportProcessData(params, session);
328
+ */
329
+ async exportProcessData(params, session) {
330
+ const self = this;
331
+
332
+ try {
333
+ Joi.assert(params, Joi.object().required(), 'Params to export process data');
334
+ Joi.assert(params.query, Joi.object().required(), 'The query for the search');
335
+ Joi.assert(params.orgId, Joi.string().required(), 'Organization id (_id database)');
336
+ Joi.assert(session, Joi.string().required(), 'Session token JWT');
337
+
338
+ const {query, orgId} = params;
339
+ const queryString = JSON.stringify(query);
340
+ const apiCall = self._client
341
+ .get(`/organizations/${orgId}/process/export/collect/data?query=${queryString}`, self._setHeader(session));
342
+
343
+ return self._returnData(await apiCall);
344
+ } catch (ex) {
345
+ throw ex;
346
+ }
347
+ }
233
348
  }
234
349
 
235
350
  export default Process;
package/dist/bundle.cjs CHANGED
@@ -1569,7 +1569,7 @@ class Process {
1569
1569
  * @author CloudBrasil <abernardo.br@gmail.com>
1570
1570
  * @description Start process
1571
1571
  * @param {object} params Params to start process
1572
- * @param {string} params.processId Process id (_id database);
1572
+ * @param {string} params.orgProcessId The organization process id (_id database);
1573
1573
  * @param {string} params.orgId Organization id (_id database);
1574
1574
  * @param {object} [params.payload={}] Start process with data
1575
1575
  * @param {string} session Session, token JWT
@@ -1581,7 +1581,7 @@ class Process {
1581
1581
  * const API = require('@docbrasil/api-systemmanager');
1582
1582
  * const api = new API();
1583
1583
  * const params = {
1584
- * processId: '5dadd01dc4af3941d42f8c5c',
1584
+ * orgProcessId: '5dadd01dc4af3941d42f8c5c',
1585
1585
  * orgId: '5edd11c46b6ce9729c2c297c',
1586
1586
  * payload: {}
1587
1587
  * }
@@ -1593,13 +1593,13 @@ class Process {
1593
1593
 
1594
1594
  try {
1595
1595
  Joi__default["default"].assert(params, Joi__default["default"].object().required());
1596
- Joi__default["default"].assert(params.processId, Joi__default["default"].string().required());
1596
+ Joi__default["default"].assert(params.orgProcessId, Joi__default["default"].string().required());
1597
1597
  Joi__default["default"].assert(params.orgId, Joi__default["default"].string().required());
1598
1598
  Joi__default["default"].assert(params.payload, Joi__default["default"].object());
1599
1599
  Joi__default["default"].assert(session, Joi__default["default"].string().required());
1600
1600
 
1601
- const {processId, orgId, payload = {}} = params;
1602
- const apiCall = self._client.put(`/organizations/${orgId}/process/${processId}`, payload, self._setMaxContentHeader(session));
1601
+ const {orgProcessId, orgId, payload = {}} = params;
1602
+ const apiCall = self._client.put(`/organizations/${orgId}/process/${orgProcessId}`, payload, self._setMaxContentHeader(session));
1603
1603
  return self._returnData(await apiCall);
1604
1604
  } catch (ex) {
1605
1605
  throw ex;
@@ -1731,6 +1731,121 @@ class Process {
1731
1731
  throw ex;
1732
1732
  }
1733
1733
  }
1734
+
1735
+ /**
1736
+ * @author CloudBrasil <abernardo.br@gmail.com>
1737
+ * @description Method to remove process
1738
+ * @param {object} params Params to remove process
1739
+ * @param {object} params.orgId Organization id (_id database)
1740
+ * @param {object} params.processId Process id (_id database)
1741
+ * @param {string} session Session, token JWT
1742
+ * @public
1743
+ * @example
1744
+ *
1745
+ * const API = require('@docbrasil/api-systemmanager');
1746
+ * const api = new API();
1747
+ * const params = {
1748
+ * orgId: '55e4a3bd6be6b45210833fae',
1749
+ * processId: '55e4a3bd6be6b45210833fae'
1750
+ * };
1751
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
1752
+ * const retSearch = await api.user.process.remove(params, session);
1753
+ */
1754
+ async remove(params, session) {
1755
+ const self = this;
1756
+
1757
+ try {
1758
+ Joi__default["default"].assert(params, Joi__default["default"].object().required(), 'Params to remove the process');
1759
+ Joi__default["default"].assert(params.processId, Joi__default["default"].string().required(), 'Process id (_id database)');
1760
+ Joi__default["default"].assert(params.orgId, Joi__default["default"].string().required(), 'Organization id (_id database)');
1761
+ Joi__default["default"].assert(session, Joi__default["default"].string().required(), 'Session token JWT');
1762
+
1763
+ const {processId, orgId} = params;
1764
+
1765
+ const apiCall = self._client.delete(`/organizations/${orgId}/process/${processId}`, self._setHeader(session));
1766
+ return self._returnData(await apiCall);
1767
+ } catch (ex) {
1768
+ throw ex;
1769
+ }
1770
+ }
1771
+
1772
+ /**
1773
+ * @author CloudBrasil <abernardo.br@gmail.com>
1774
+ * @description Method to export status data
1775
+ * @param {object} params Params to export status data
1776
+ * @param {object} params.query Search process query
1777
+ * @param {object} params.orgId Organization id (_id database)
1778
+ * @param {string} session Session, token JWT
1779
+ * @public
1780
+ * @example
1781
+ *
1782
+ * const API = require('@docbrasil/api-systemmanager');
1783
+ * const api = new API();
1784
+ * const params = {
1785
+ * query: {"orgProcessId": {"value":"62c2d1cdfb5455c195d1baa1","oper":"=","type":"string"},"s":[{"historyBegin":{"order":"desc"}}],"i":1,"p":20},
1786
+ * orgId: '55e4a3bd6be6b45210833fae',
1787
+ * };
1788
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
1789
+ * const retSearch = await api.user.process.exportStatusData(params, session);
1790
+ */
1791
+ async exportStatusData(params, session) {
1792
+ const self = this;
1793
+
1794
+ try {
1795
+ Joi__default["default"].assert(params, Joi__default["default"].object().required(), 'Params to export status data');
1796
+ Joi__default["default"].assert(params.query, Joi__default["default"].object().required(), 'The query for the search');
1797
+ Joi__default["default"].assert(params.orgId, Joi__default["default"].string().required(), 'Organization id (_id database)');
1798
+ Joi__default["default"].assert(session, Joi__default["default"].string().required(), 'Session token JWT');
1799
+
1800
+ const {query, orgId} = params;
1801
+ const queryString = JSON.stringify(query);
1802
+ const apiCall = self._client
1803
+ .get(`/organizations/${orgId}/process/export/status/data?query=${queryString}`, self._setHeader(session));
1804
+
1805
+ return self._returnData(await apiCall);
1806
+ } catch (ex) {
1807
+ throw ex;
1808
+ }
1809
+ }
1810
+
1811
+ /**
1812
+ * @author CloudBrasil <abernardo.br@gmail.com>
1813
+ * @description Method to export process data
1814
+ * @param {object} params Params to export process data
1815
+ * @param {object} params.query Search process query
1816
+ * @param {object} params.orgId Organization id (_id database)
1817
+ * @param {string} session Session, token JWT
1818
+ * @public
1819
+ * @example
1820
+ *
1821
+ * const API = require('@docbrasil/api-systemmanager');
1822
+ * const api = new API();
1823
+ * const params = {
1824
+ * query: {"orgProcessId": {"value":"62c2d1cdfb5455c195d1baa1","oper":"=","type":"string"},"s":[{"historyBegin":{"order":"desc"}}],"i":1,"p":20},
1825
+ * orgId: '55e4a3bd6be6b45210833fae',
1826
+ * };
1827
+ * const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
1828
+ * const retSearch = await api.user.process.exportProcessData(params, session);
1829
+ */
1830
+ async exportProcessData(params, session) {
1831
+ const self = this;
1832
+
1833
+ try {
1834
+ Joi__default["default"].assert(params, Joi__default["default"].object().required(), 'Params to export process data');
1835
+ Joi__default["default"].assert(params.query, Joi__default["default"].object().required(), 'The query for the search');
1836
+ Joi__default["default"].assert(params.orgId, Joi__default["default"].string().required(), 'Organization id (_id database)');
1837
+ Joi__default["default"].assert(session, Joi__default["default"].string().required(), 'Session token JWT');
1838
+
1839
+ const {query, orgId} = params;
1840
+ const queryString = JSON.stringify(query);
1841
+ const apiCall = self._client
1842
+ .get(`/organizations/${orgId}/process/export/collect/data?query=${queryString}`, self._setHeader(session));
1843
+
1844
+ return self._returnData(await apiCall);
1845
+ } catch (ex) {
1846
+ throw ex;
1847
+ }
1848
+ }
1734
1849
  }
1735
1850
 
1736
1851
  /**