-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
27 lines (23 loc) · 954 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const { getWorkflowsHistory } = require('./lib/workflow/history.js');
const { getOpenWorkflows, getFailedWorkflows, getCompletedWorkflows } = require('./lib/workflow/get.js');
function getPendingWorkflowsActivities(client, options) {
return Promise.resolve(client)
.then(() => getOpenWorkflows(client, options))
.then(data => getWorkflowsHistory(client, data, options));
}
function getFailedWorkflowsActivities(client, options) {
return Promise.resolve(client)
.then(() => getFailedWorkflows(client, options))
.then(data => getWorkflowsHistory(client, data, options));
}
function getCompletedWorkflowsActivities(client, options) {
return Promise.resolve(client)
.then(() => getCompletedWorkflows(client, options))
.then(data => getWorkflowsHistory(client, data, options));
}
module.exports = {
getPendingWorkflowsActivities,
getCompletedWorkflowsActivities,
getFailedWorkflowsActivities,
getWorkflowsHistory,
};