@docbrasil/api-systemmanager 1.1.25 → 1.1.27
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/user/dashboard.js +40 -0
- package/api/user/document.js +131 -0
- package/dist/bundle.cjs +171 -0
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +132 -0
- package/docs/Chart.html +296 -0
- package/docs/Dashboard.html +2 -2
- package/docs/Documents.html +1291 -443
- package/docs/user_dashboard.js.html +41 -1
- package/docs/user_document.js.html +131 -0
- package/package.json +1 -1
package/api/user/dashboard.js
CHANGED
|
@@ -81,6 +81,46 @@ class Chart {
|
|
|
81
81
|
throw ex;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
87
|
+
* @description Get the question data from a chart data
|
|
88
|
+
* @param {object} params Params to get helps from topic
|
|
89
|
+
* @param {object} params.orgId The organization id of the question
|
|
90
|
+
* @param {object} params.processId The process id of the question
|
|
91
|
+
* @param {object} params.path The path of the question so we can retrieve it
|
|
92
|
+
* @param {string} session Session, token JWT
|
|
93
|
+
* @returns {promise} data the question data
|
|
94
|
+
* @public
|
|
95
|
+
* @example
|
|
96
|
+
*
|
|
97
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
98
|
+
* const api = new API();
|
|
99
|
+
* const params = {
|
|
100
|
+
* orgId: '637e7523f555fabdfb1ed7b6',
|
|
101
|
+
* processId: '123e7523f555fabdfb1ed7c6',
|
|
102
|
+
* path: 'Checklist.Group Name.Field Name'
|
|
103
|
+
* };
|
|
104
|
+
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
105
|
+
* await api.user.dashboard.chart.getQuestion(params, session);
|
|
106
|
+
*/
|
|
107
|
+
async getQuestion(params, session) {
|
|
108
|
+
const self = this;
|
|
109
|
+
|
|
110
|
+
try {
|
|
111
|
+
Joi.assert(params, Joi.object().required(), 'Params to helps from a topic');
|
|
112
|
+
Joi.assert(params.orgId, Joi.string().required(), 'The organization id of the question');
|
|
113
|
+
Joi.assert(params.processId, Joi.string().required(), 'The process id of the question');
|
|
114
|
+
Joi.assert(params.path, Joi.string().required(), 'The path of the field of the question');
|
|
115
|
+
Joi.assert(session, Joi.string().required(), 'Session token JWT');
|
|
116
|
+
|
|
117
|
+
const apiCall = self._client.post(`/organizations/dashboard/chart/question/data`, params, self._setHeader(session));
|
|
118
|
+
|
|
119
|
+
return self._returnData(await apiCall);
|
|
120
|
+
} catch (ex) {
|
|
121
|
+
throw ex;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
84
124
|
}
|
|
85
125
|
|
|
86
126
|
/**
|
package/api/user/document.js
CHANGED
|
@@ -802,6 +802,137 @@ class Documents {
|
|
|
802
802
|
throw ex;
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
808
|
+
* @description Method to export excel for all pages
|
|
809
|
+
* @param {object} params Params to export excel for all pages
|
|
810
|
+
* @param {object} params.query Export excel for all pages query
|
|
811
|
+
* @param {object} params.orgId Organization id (_id database)
|
|
812
|
+
* @param {string} session Session, token JWT
|
|
813
|
+
* @returns {promise} returned data from the export excel for all pages
|
|
814
|
+
* @public
|
|
815
|
+
* @example
|
|
816
|
+
*
|
|
817
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
818
|
+
* const api = new API();
|
|
819
|
+
* const params = {
|
|
820
|
+
* query: {p: 20, i: 1, s: 'Mais recentes', as: '', m: 'w', ai: '57e6a3bd6be6b45210833fae'},
|
|
821
|
+
* orgId: '55e4a3bd6be6b45210833fae',
|
|
822
|
+
* };
|
|
823
|
+
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
824
|
+
* const retSearch = await api.user.document.exportExcelForAllPages(params, session);
|
|
825
|
+
*/
|
|
826
|
+
async exportExcelForAllPages(params, session) {
|
|
827
|
+
const self = this;
|
|
828
|
+
|
|
829
|
+
try {
|
|
830
|
+
Joi.assert(params, Joi.object().required(), 'Params to export excel for all pages');
|
|
831
|
+
Joi.assert(params.query, Joi.object().required(), 'The query for the export excel for all pages');
|
|
832
|
+
Joi.assert(params.orgId, Joi.string().required(), 'Organization id (_id database)');
|
|
833
|
+
Joi.assert(session, Joi.string().required(), 'Session token JWT');
|
|
834
|
+
|
|
835
|
+
const {query, orgId} = params;
|
|
836
|
+
const searchParams = new URLSearchParams(query);
|
|
837
|
+
const queryString = searchParams.toString();
|
|
838
|
+
const apiCall = self._client.get(`/organizations/${orgId}/documents/export/excel?${queryString}`, self._setHeader(session));
|
|
839
|
+
|
|
840
|
+
return self._returnData(await apiCall);
|
|
841
|
+
} catch (ex) {
|
|
842
|
+
throw ex;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
/**
|
|
847
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
848
|
+
* @description Method to export Wms Excel for all pages
|
|
849
|
+
* @param {object} params Params to export Wms Excel for all pages
|
|
850
|
+
* @param {object} params.query export Wms Excel for all pages query
|
|
851
|
+
* @param {object} params.orgId Organization id (_id database)
|
|
852
|
+
* @param {string} session Session, token JWT
|
|
853
|
+
* @returns {promise} returned data from the export Wms Excel for all pages
|
|
854
|
+
* @public
|
|
855
|
+
* @example
|
|
856
|
+
*
|
|
857
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
858
|
+
* const api = new API();
|
|
859
|
+
* const params = {
|
|
860
|
+
* query: {p: 20, i: 1, s: 'Mais recentes', as: '', m: 'w', ai: '57e6a3bd6be6b45210833fae'},
|
|
861
|
+
* orgId: '55e4a3bd6be6b45210833fae',
|
|
862
|
+
* };
|
|
863
|
+
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
864
|
+
* const retSearch = await api.user.document.exportWmsExcelForAllPages(params, session);
|
|
865
|
+
*/
|
|
866
|
+
async exportWmsExcelForAllPages(params, session) {
|
|
867
|
+
const self = this;
|
|
868
|
+
|
|
869
|
+
try {
|
|
870
|
+
Joi.assert(params, Joi.object().required(), 'Params to export Wms Excel for all pages');
|
|
871
|
+
Joi.assert(params.query, Joi.object().required(), 'The query for the export Wms Excel for all pages');
|
|
872
|
+
Joi.assert(params.orgId, Joi.string().required(), 'Organization id (_id database)');
|
|
873
|
+
Joi.assert(session, Joi.string().required(), 'Session token JWT');
|
|
874
|
+
|
|
875
|
+
const {query, orgId} = params;
|
|
876
|
+
const searchParams = new URLSearchParams(query);
|
|
877
|
+
const queryString = searchParams.toString();
|
|
878
|
+
const apiCall = self._client.get(`/organizations/${orgId}/documents/wms/export/excel?${queryString}`, self._setHeader(session));
|
|
879
|
+
|
|
880
|
+
return self._returnData(await apiCall);
|
|
881
|
+
} catch (ex) {
|
|
882
|
+
throw ex;
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
/**
|
|
887
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
888
|
+
* @description Method to perform download complete for all pages
|
|
889
|
+
* @param {object} params Params to perform download complete for all pages
|
|
890
|
+
* @param {object} params.data data to be send to download
|
|
891
|
+
* @param {object} params.query perform download complete for all pages query
|
|
892
|
+
* @param {object} params.orgId Organization id (_id database)
|
|
893
|
+
* @param {string} session Session, token JWT
|
|
894
|
+
* @returns {promise} returned data from the perform download complete for all pages
|
|
895
|
+
* @public
|
|
896
|
+
* @example
|
|
897
|
+
*
|
|
898
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
899
|
+
* const api = new API();
|
|
900
|
+
* const params = {
|
|
901
|
+
* query: {p: 20, i: 1, s: 'Mais recentes', as: '', m: 'w', ai: '57e6a3bd6be6b45210833fae'},
|
|
902
|
+
* orgId: '55e4a3bd6be6b45210833fae',
|
|
903
|
+
* data: {
|
|
904
|
+
* destAws = {
|
|
905
|
+
destAwsKey: '',
|
|
906
|
+
destAwsSecret: '',
|
|
907
|
+
destAwsBucket: '',
|
|
908
|
+
destAwsRegion: ''
|
|
909
|
+
},
|
|
910
|
+
maxFileSize: ''
|
|
911
|
+
* }
|
|
912
|
+
* };
|
|
913
|
+
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
914
|
+
* const retSearch = await api.user.document.performDownloadComplete(params, session);
|
|
915
|
+
*/
|
|
916
|
+
async performDownloadComplete(params, session) {
|
|
917
|
+
const self = this;
|
|
918
|
+
|
|
919
|
+
Joi.assert(params, Joi.object().required(), 'Params to perform download complete for all pages');
|
|
920
|
+
Joi.assert(params.data, Joi.object().required(), 'The data for the perform download complete for all pages');
|
|
921
|
+
Joi.assert(params.query, Joi.object().required(), 'The query for the perform download complete for all pages');
|
|
922
|
+
Joi.assert(params.orgId, Joi.string().required(), 'Organization id (_id database)');
|
|
923
|
+
Joi.assert(session, Joi.string().required(), 'Session token JWT');
|
|
924
|
+
|
|
925
|
+
try {
|
|
926
|
+
const {query, orgId, data} = params;
|
|
927
|
+
const searchParams = new URLSearchParams(query);
|
|
928
|
+
const queryString = searchParams.toString();
|
|
929
|
+
|
|
930
|
+
const apiCall = self._client.post(`/organizations/${orgId}/documents/download/attachments?${queryString}`, data, self._setHeader(session));
|
|
931
|
+
return self._returnData(await apiCall);
|
|
932
|
+
} catch (ex) {
|
|
933
|
+
throw ex;
|
|
934
|
+
}
|
|
935
|
+
}
|
|
805
936
|
}
|
|
806
937
|
|
|
807
938
|
export default Documents;
|
package/dist/bundle.cjs
CHANGED
|
@@ -1354,6 +1354,137 @@ class Documents {
|
|
|
1354
1354
|
throw ex;
|
|
1355
1355
|
}
|
|
1356
1356
|
}
|
|
1357
|
+
|
|
1358
|
+
/**
|
|
1359
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
1360
|
+
* @description Method to export excel for all pages
|
|
1361
|
+
* @param {object} params Params to export excel for all pages
|
|
1362
|
+
* @param {object} params.query Export excel for all pages query
|
|
1363
|
+
* @param {object} params.orgId Organization id (_id database)
|
|
1364
|
+
* @param {string} session Session, token JWT
|
|
1365
|
+
* @returns {promise} returned data from the export excel for all pages
|
|
1366
|
+
* @public
|
|
1367
|
+
* @example
|
|
1368
|
+
*
|
|
1369
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
1370
|
+
* const api = new API();
|
|
1371
|
+
* const params = {
|
|
1372
|
+
* query: {p: 20, i: 1, s: 'Mais recentes', as: '', m: 'w', ai: '57e6a3bd6be6b45210833fae'},
|
|
1373
|
+
* orgId: '55e4a3bd6be6b45210833fae',
|
|
1374
|
+
* };
|
|
1375
|
+
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
1376
|
+
* const retSearch = await api.user.document.exportExcelForAllPages(params, session);
|
|
1377
|
+
*/
|
|
1378
|
+
async exportExcelForAllPages(params, session) {
|
|
1379
|
+
const self = this;
|
|
1380
|
+
|
|
1381
|
+
try {
|
|
1382
|
+
Joi__default["default"].assert(params, Joi__default["default"].object().required(), 'Params to export excel for all pages');
|
|
1383
|
+
Joi__default["default"].assert(params.query, Joi__default["default"].object().required(), 'The query for the export excel for all pages');
|
|
1384
|
+
Joi__default["default"].assert(params.orgId, Joi__default["default"].string().required(), 'Organization id (_id database)');
|
|
1385
|
+
Joi__default["default"].assert(session, Joi__default["default"].string().required(), 'Session token JWT');
|
|
1386
|
+
|
|
1387
|
+
const {query, orgId} = params;
|
|
1388
|
+
const searchParams = new URLSearchParams(query);
|
|
1389
|
+
const queryString = searchParams.toString();
|
|
1390
|
+
const apiCall = self._client.get(`/organizations/${orgId}/documents/export/excel?${queryString}`, self._setHeader(session));
|
|
1391
|
+
|
|
1392
|
+
return self._returnData(await apiCall);
|
|
1393
|
+
} catch (ex) {
|
|
1394
|
+
throw ex;
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
/**
|
|
1399
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
1400
|
+
* @description Method to export Wms Excel for all pages
|
|
1401
|
+
* @param {object} params Params to export Wms Excel for all pages
|
|
1402
|
+
* @param {object} params.query export Wms Excel for all pages query
|
|
1403
|
+
* @param {object} params.orgId Organization id (_id database)
|
|
1404
|
+
* @param {string} session Session, token JWT
|
|
1405
|
+
* @returns {promise} returned data from the export Wms Excel for all pages
|
|
1406
|
+
* @public
|
|
1407
|
+
* @example
|
|
1408
|
+
*
|
|
1409
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
1410
|
+
* const api = new API();
|
|
1411
|
+
* const params = {
|
|
1412
|
+
* query: {p: 20, i: 1, s: 'Mais recentes', as: '', m: 'w', ai: '57e6a3bd6be6b45210833fae'},
|
|
1413
|
+
* orgId: '55e4a3bd6be6b45210833fae',
|
|
1414
|
+
* };
|
|
1415
|
+
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
1416
|
+
* const retSearch = await api.user.document.exportWmsExcelForAllPages(params, session);
|
|
1417
|
+
*/
|
|
1418
|
+
async exportWmsExcelForAllPages(params, session) {
|
|
1419
|
+
const self = this;
|
|
1420
|
+
|
|
1421
|
+
try {
|
|
1422
|
+
Joi__default["default"].assert(params, Joi__default["default"].object().required(), 'Params to export Wms Excel for all pages');
|
|
1423
|
+
Joi__default["default"].assert(params.query, Joi__default["default"].object().required(), 'The query for the export Wms Excel for all pages');
|
|
1424
|
+
Joi__default["default"].assert(params.orgId, Joi__default["default"].string().required(), 'Organization id (_id database)');
|
|
1425
|
+
Joi__default["default"].assert(session, Joi__default["default"].string().required(), 'Session token JWT');
|
|
1426
|
+
|
|
1427
|
+
const {query, orgId} = params;
|
|
1428
|
+
const searchParams = new URLSearchParams(query);
|
|
1429
|
+
const queryString = searchParams.toString();
|
|
1430
|
+
const apiCall = self._client.get(`/organizations/${orgId}/documents/wms/export/excel?${queryString}`, self._setHeader(session));
|
|
1431
|
+
|
|
1432
|
+
return self._returnData(await apiCall);
|
|
1433
|
+
} catch (ex) {
|
|
1434
|
+
throw ex;
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
/**
|
|
1439
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
1440
|
+
* @description Method to perform download complete for all pages
|
|
1441
|
+
* @param {object} params Params to perform download complete for all pages
|
|
1442
|
+
* @param {object} params.data data to be send to download
|
|
1443
|
+
* @param {object} params.query perform download complete for all pages query
|
|
1444
|
+
* @param {object} params.orgId Organization id (_id database)
|
|
1445
|
+
* @param {string} session Session, token JWT
|
|
1446
|
+
* @returns {promise} returned data from the perform download complete for all pages
|
|
1447
|
+
* @public
|
|
1448
|
+
* @example
|
|
1449
|
+
*
|
|
1450
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
1451
|
+
* const api = new API();
|
|
1452
|
+
* const params = {
|
|
1453
|
+
* query: {p: 20, i: 1, s: 'Mais recentes', as: '', m: 'w', ai: '57e6a3bd6be6b45210833fae'},
|
|
1454
|
+
* orgId: '55e4a3bd6be6b45210833fae',
|
|
1455
|
+
* data: {
|
|
1456
|
+
* destAws = {
|
|
1457
|
+
destAwsKey: '',
|
|
1458
|
+
destAwsSecret: '',
|
|
1459
|
+
destAwsBucket: '',
|
|
1460
|
+
destAwsRegion: ''
|
|
1461
|
+
},
|
|
1462
|
+
maxFileSize: ''
|
|
1463
|
+
* }
|
|
1464
|
+
* };
|
|
1465
|
+
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
1466
|
+
* const retSearch = await api.user.document.performDownloadComplete(params, session);
|
|
1467
|
+
*/
|
|
1468
|
+
async performDownloadComplete(params, session) {
|
|
1469
|
+
const self = this;
|
|
1470
|
+
|
|
1471
|
+
Joi__default["default"].assert(params, Joi__default["default"].object().required(), 'Params to perform download complete for all pages');
|
|
1472
|
+
Joi__default["default"].assert(params.data, Joi__default["default"].object().required(), 'The data for the perform download complete for all pages');
|
|
1473
|
+
Joi__default["default"].assert(params.query, Joi__default["default"].object().required(), 'The query for the perform download complete for all pages');
|
|
1474
|
+
Joi__default["default"].assert(params.orgId, Joi__default["default"].string().required(), 'Organization id (_id database)');
|
|
1475
|
+
Joi__default["default"].assert(session, Joi__default["default"].string().required(), 'Session token JWT');
|
|
1476
|
+
|
|
1477
|
+
try {
|
|
1478
|
+
const {query, orgId, data} = params;
|
|
1479
|
+
const searchParams = new URLSearchParams(query);
|
|
1480
|
+
const queryString = searchParams.toString();
|
|
1481
|
+
|
|
1482
|
+
const apiCall = self._client.post(`/organizations/${orgId}/documents/download/attachments?${queryString}`, data, self._setHeader(session));
|
|
1483
|
+
return self._returnData(await apiCall);
|
|
1484
|
+
} catch (ex) {
|
|
1485
|
+
throw ex;
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1357
1488
|
}
|
|
1358
1489
|
|
|
1359
1490
|
/**
|
|
@@ -11081,6 +11212,46 @@ class Chart {
|
|
|
11081
11212
|
throw ex;
|
|
11082
11213
|
}
|
|
11083
11214
|
}
|
|
11215
|
+
|
|
11216
|
+
/**
|
|
11217
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
11218
|
+
* @description Get the question data from a chart data
|
|
11219
|
+
* @param {object} params Params to get helps from topic
|
|
11220
|
+
* @param {object} params.orgId The organization id of the question
|
|
11221
|
+
* @param {object} params.processId The process id of the question
|
|
11222
|
+
* @param {object} params.path The path of the question so we can retrieve it
|
|
11223
|
+
* @param {string} session Session, token JWT
|
|
11224
|
+
* @returns {promise} data the question data
|
|
11225
|
+
* @public
|
|
11226
|
+
* @example
|
|
11227
|
+
*
|
|
11228
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
11229
|
+
* const api = new API();
|
|
11230
|
+
* const params = {
|
|
11231
|
+
* orgId: '637e7523f555fabdfb1ed7b6',
|
|
11232
|
+
* processId: '123e7523f555fabdfb1ed7c6',
|
|
11233
|
+
* path: 'Checklist.Group Name.Field Name'
|
|
11234
|
+
* };
|
|
11235
|
+
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
11236
|
+
* await api.user.dashboard.chart.getQuestion(params, session);
|
|
11237
|
+
*/
|
|
11238
|
+
async getQuestion(params, session) {
|
|
11239
|
+
const self = this;
|
|
11240
|
+
|
|
11241
|
+
try {
|
|
11242
|
+
Joi__default["default"].assert(params, Joi__default["default"].object().required(), 'Params to helps from a topic');
|
|
11243
|
+
Joi__default["default"].assert(params.orgId, Joi__default["default"].string().required(), 'The organization id of the question');
|
|
11244
|
+
Joi__default["default"].assert(params.processId, Joi__default["default"].string().required(), 'The process id of the question');
|
|
11245
|
+
Joi__default["default"].assert(params.path, Joi__default["default"].string().required(), 'The path of the field of the question');
|
|
11246
|
+
Joi__default["default"].assert(session, Joi__default["default"].string().required(), 'Session token JWT');
|
|
11247
|
+
|
|
11248
|
+
const apiCall = self._client.post(`/organizations/dashboard/chart/question/data`, params, self._setHeader(session));
|
|
11249
|
+
|
|
11250
|
+
return self._returnData(await apiCall);
|
|
11251
|
+
} catch (ex) {
|
|
11252
|
+
throw ex;
|
|
11253
|
+
}
|
|
11254
|
+
}
|
|
11084
11255
|
}
|
|
11085
11256
|
|
|
11086
11257
|
/**
|