powr-sdk-api 4.3.0 → 4.3.1

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.
@@ -91,7 +91,7 @@ class ScheduledTasksManager {
91
91
 
92
92
  // Build query based on user role
93
93
  let query = {
94
- id: taskId
94
+ _id: taskId
95
95
  };
96
96
  if (isAdmin) {
97
97
  // Admin can access any task in the project
@@ -128,7 +128,7 @@ class ScheduledTasksManager {
128
128
 
129
129
  // Build query based on user role
130
130
  let query = {
131
- id: taskId
131
+ _id: taskId
132
132
  };
133
133
  if (isAdmin) {
134
134
  // Admin can update any task in the project
@@ -180,7 +180,7 @@ class ScheduledTasksManager {
180
180
 
181
181
  // Build query based on user role
182
182
  let query = {
183
- id: taskId
183
+ _id: taskId
184
184
  };
185
185
  if (isAdmin) {
186
186
  // Admin can delete any task in the project
@@ -225,7 +225,7 @@ class ScheduledTasksManager {
225
225
 
226
226
  // Build query based on user role
227
227
  let query = {
228
- id: taskId
228
+ _id: taskId
229
229
  };
230
230
  if (isAdmin) {
231
231
  // Admin can toggle any task in the project
@@ -271,7 +271,7 @@ class ScheduledTasksManager {
271
271
 
272
272
  // Build query based on user role
273
273
  let query = {
274
- id: taskId
274
+ _id: taskId
275
275
  };
276
276
  if (isAdmin) {
277
277
  // Admin can execute any task in the project
@@ -319,7 +319,7 @@ class ScheduledTasksManager {
319
319
  const tasks = await db.collection("tasks").find(query).toArray();
320
320
  for (const task of tasks) {
321
321
  try {
322
- console.log(`⏰ Executing: ${task.name} (${task.id}) for project ${task.projectId}`);
322
+ console.log(`⏰ Executing: ${task.name} (${task._id}) for project ${task.projectId}`);
323
323
 
324
324
  // Execute the task directly (we already have the task data)
325
325
  const result = await this.executeTaskAction(task);
@@ -329,20 +329,20 @@ class ScheduledTasksManager {
329
329
  if (!task.scheduledFor || this.isTimestamp(task.scheduledFor)) {
330
330
  // For immediate and one-time tasks, deactivate after execution
331
331
  updateData.isActive = false;
332
- console.log(`✅ Task ${task.id} completed and deactivated`);
332
+ console.log(`✅ Task ${task._id} completed and deactivated`);
333
333
  } else if (this.isCronExpression(task.scheduledFor)) {
334
334
  // For recurring tasks, calculate next run time
335
335
  updateData.nextRun = this.getNextRunTime(task.scheduledFor);
336
- console.log(`📅 Updated next run time for task ${task.id}: ${updateData.nextRun}`);
336
+ console.log(`📅 Updated next run time for task ${task._id}: ${updateData.nextRun}`);
337
337
  }
338
338
  await db.collection("tasks").updateOne({
339
- id: task.id
339
+ _id: task._id
340
340
  }, {
341
341
  $set: updateData
342
342
  });
343
- console.log(`✅ Task ${task.id} completed:`, result.success ? 'SUCCESS' : 'FAILED');
343
+ console.log(`✅ Task ${task._id} completed:`, result.success ? 'SUCCESS' : 'FAILED');
344
344
  } catch (error) {
345
- console.error(`❌ Task ${task.id} failed:`, error.message);
345
+ console.error(`❌ Task ${task._id} failed:`, error.message);
346
346
  }
347
347
  }
348
348
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powr-sdk-api",
3
- "version": "4.3.0",
3
+ "version": "4.3.1",
4
4
  "description": "Shared API core library for PowrStack projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",