@docbrasil/api-systemmanager 1.1.25 → 1.1.26
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 +11 -0
- package/api/user/document.js +131 -0
- package/dist/bundle.cjs +131 -0
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +97 -0
- package/package-lock.json +7337 -0
- package/package.json +1 -1
package/.project
ADDED
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
|
/**
|