@docbrasil/api-systemmanager 1.1.68 → 1.1.69
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/process.js +41 -0
- package/dist/bundle.cjs +41 -0
- package/dist/bundle.mjs +1 -1
- package/doc/api.md +31 -0
- package/docs/Process.html +296 -0
- package/docs/user_process.js.html +41 -0
- package/package.json +1 -1
package/api/user/process.js
CHANGED
|
@@ -553,6 +553,47 @@ class Process {
|
|
|
553
553
|
throw ex;
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
559
|
+
* @description Get step history of a process flow
|
|
560
|
+
* @param {object} params Params to get step history
|
|
561
|
+
* @param {string} params.orgId Organization id (_id database);
|
|
562
|
+
* @param {string} params.processId Process id (_id database);
|
|
563
|
+
* @param {string} params.flowId Flow id;
|
|
564
|
+
* @param {string} session Session, token JWT
|
|
565
|
+
* @return {Promise<Array>} Array of step history entries
|
|
566
|
+
* @public
|
|
567
|
+
* @async
|
|
568
|
+
* @example
|
|
569
|
+
*
|
|
570
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
571
|
+
* const api = new API();
|
|
572
|
+
* const params = {
|
|
573
|
+
* orgId: '5edd11c46b6ce9729c2c297c',
|
|
574
|
+
* processId: '5dadd01dc4af3941d42f8c5c',
|
|
575
|
+
* flowId: 'Task_18v1xx7'
|
|
576
|
+
* }
|
|
577
|
+
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
578
|
+
* const stepHistory = await api.user.process.getStepHistory(params, session);
|
|
579
|
+
*/
|
|
580
|
+
async getStepHistory(params, session) {
|
|
581
|
+
const self = this;
|
|
582
|
+
|
|
583
|
+
try {
|
|
584
|
+
Joi.assert(params, Joi.object().required());
|
|
585
|
+
Joi.assert(params.orgId, Joi.string().required());
|
|
586
|
+
Joi.assert(params.processId, Joi.string().required());
|
|
587
|
+
Joi.assert(params.flowId, Joi.string().required());
|
|
588
|
+
Joi.assert(session, Joi.string().required());
|
|
589
|
+
|
|
590
|
+
const {orgId, processId, flowId} = params;
|
|
591
|
+
const apiCall = self._client.get(`/organizations/${orgId}/process/${processId}/flow/${flowId}/history`, self._setHeader(session));
|
|
592
|
+
return self._returnData(await apiCall, []);
|
|
593
|
+
} catch (ex) {
|
|
594
|
+
throw ex;
|
|
595
|
+
}
|
|
596
|
+
}
|
|
556
597
|
}
|
|
557
598
|
|
|
558
599
|
export default Process;
|
package/dist/bundle.cjs
CHANGED
|
@@ -2504,6 +2504,47 @@ class Process {
|
|
|
2504
2504
|
throw ex;
|
|
2505
2505
|
}
|
|
2506
2506
|
}
|
|
2507
|
+
|
|
2508
|
+
/**
|
|
2509
|
+
* @author Myndware <augusto.pissarra@myndware.com>
|
|
2510
|
+
* @description Get step history of a process flow
|
|
2511
|
+
* @param {object} params Params to get step history
|
|
2512
|
+
* @param {string} params.orgId Organization id (_id database);
|
|
2513
|
+
* @param {string} params.processId Process id (_id database);
|
|
2514
|
+
* @param {string} params.flowId Flow id;
|
|
2515
|
+
* @param {string} session Session, token JWT
|
|
2516
|
+
* @return {Promise<Array>} Array of step history entries
|
|
2517
|
+
* @public
|
|
2518
|
+
* @async
|
|
2519
|
+
* @example
|
|
2520
|
+
*
|
|
2521
|
+
* const API = require('@docbrasil/api-systemmanager');
|
|
2522
|
+
* const api = new API();
|
|
2523
|
+
* const params = {
|
|
2524
|
+
* orgId: '5edd11c46b6ce9729c2c297c',
|
|
2525
|
+
* processId: '5dadd01dc4af3941d42f8c5c',
|
|
2526
|
+
* flowId: 'Task_18v1xx7'
|
|
2527
|
+
* }
|
|
2528
|
+
* const session = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...';
|
|
2529
|
+
* const stepHistory = await api.user.process.getStepHistory(params, session);
|
|
2530
|
+
*/
|
|
2531
|
+
async getStepHistory(params, session) {
|
|
2532
|
+
const self = this;
|
|
2533
|
+
|
|
2534
|
+
try {
|
|
2535
|
+
Joi__default["default"].assert(params, Joi__default["default"].object().required());
|
|
2536
|
+
Joi__default["default"].assert(params.orgId, Joi__default["default"].string().required());
|
|
2537
|
+
Joi__default["default"].assert(params.processId, Joi__default["default"].string().required());
|
|
2538
|
+
Joi__default["default"].assert(params.flowId, Joi__default["default"].string().required());
|
|
2539
|
+
Joi__default["default"].assert(session, Joi__default["default"].string().required());
|
|
2540
|
+
|
|
2541
|
+
const {orgId, processId, flowId} = params;
|
|
2542
|
+
const apiCall = self._client.get(`/organizations/${orgId}/process/${processId}/flow/${flowId}/history`, self._setHeader(session));
|
|
2543
|
+
return self._returnData(await apiCall, []);
|
|
2544
|
+
} catch (ex) {
|
|
2545
|
+
throw ex;
|
|
2546
|
+
}
|
|
2547
|
+
}
|
|
2507
2548
|
}
|
|
2508
2549
|
|
|
2509
2550
|
/**
|