powr-sdk-api 4.3.9 → 4.3.10

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.
@@ -86,6 +86,20 @@ class TasksManager {
86
86
  const tasks = await db.collection("tasks").find(query).sort({
87
87
  createdAt: -1
88
88
  }).toArray();
89
+
90
+ // For workflows, get the last execution time
91
+ for (const task of tasks) {
92
+ if (task.type === 'workflow') {
93
+ const lastExecution = await db.collection("workflow_executions").findOne({
94
+ workflowId: task._id
95
+ }, {
96
+ sort: {
97
+ executedAt: -1
98
+ }
99
+ });
100
+ task.lastRun = (lastExecution === null || lastExecution === void 0 ? void 0 : lastExecution.executedAt) || null;
101
+ }
102
+ }
89
103
  return {
90
104
  success: true,
91
105
  tasks
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powr-sdk-api",
3
- "version": "4.3.9",
3
+ "version": "4.3.10",
4
4
  "description": "Shared API core library for PowrStack projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",