@pikku/schedule 0.6.2 → 0.8.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @pikku/schedule
2
2
 
3
+ ## 0.8.0
4
+
5
+ - Updating to match remaining packages
6
+
7
+ ## 0.7.0
8
+
9
+ - Updating to match remaining packages
10
+
3
11
  ## 0.6.2
4
12
 
5
13
  ### Patch Changes
@@ -1,6 +1,5 @@
1
1
  import { CronJob } from 'cron';
2
- import { pikkuState, } from '@pikku/core';
3
- import { runScheduledTask } from '@pikku/core/scheduler';
2
+ import { runScheduledTask, getScheduledTasks, } from '@pikku/core/scheduler';
4
3
  export class PikkuTaskScheduler {
5
4
  singletonServices;
6
5
  createSessionServices;
@@ -10,7 +9,7 @@ export class PikkuTaskScheduler {
10
9
  this.createSessionServices = createSessionServices;
11
10
  }
12
11
  startAll() {
13
- const scheduledTasks = pikkuState('scheduler', 'tasks');
12
+ const scheduledTasks = getScheduledTasks();
14
13
  scheduledTasks.forEach((task) => this.startJobSchedule(task));
15
14
  }
16
15
  stopAll() {
@@ -18,7 +17,7 @@ export class PikkuTaskScheduler {
18
17
  this.jobs.clear();
19
18
  }
20
19
  start(names) {
21
- const scheduledTasks = pikkuState('scheduler', 'tasks');
20
+ const scheduledTasks = getScheduledTasks();
22
21
  for (const name of names) {
23
22
  const task = scheduledTasks.get(name);
24
23
  if (task) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/schedule",
3
- "version": "0.6.2",
3
+ "version": "0.8.0",
4
4
  "author": "yasser.fadl@gmail.com",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",
@@ -17,7 +17,7 @@
17
17
  "test:coverage": "bash run-tests.sh --coverage"
18
18
  },
19
19
  "peerDependencies": {
20
- "@pikku/core": "^0.6.17"
20
+ "@pikku/core": "^0.8.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/node": "^22.7.8",
@@ -5,9 +5,12 @@ import {
5
5
  CoreSingletonServices,
6
6
  CoreUserSession,
7
7
  CreateSessionServices,
8
- pikkuState,
9
8
  } from '@pikku/core'
10
- import { runScheduledTask, CoreScheduledTask } from '@pikku/core/scheduler'
9
+ import {
10
+ runScheduledTask,
11
+ CoreScheduledTask,
12
+ getScheduledTasks,
13
+ } from '@pikku/core/scheduler'
11
14
 
12
15
  export class PikkuTaskScheduler<TaskName extends string> {
13
16
  private jobs = new Map<string, CronJob>()
@@ -22,7 +25,7 @@ export class PikkuTaskScheduler<TaskName extends string> {
22
25
  ) {}
23
26
 
24
27
  public startAll() {
25
- const scheduledTasks = pikkuState('scheduler', 'tasks')
28
+ const scheduledTasks = getScheduledTasks()
26
29
  scheduledTasks.forEach((task) => this.startJobSchedule(task))
27
30
  }
28
31
 
@@ -32,7 +35,7 @@ export class PikkuTaskScheduler<TaskName extends string> {
32
35
  }
33
36
 
34
37
  public start(names: TaskName[]) {
35
- const scheduledTasks = pikkuState('scheduler', 'tasks')
38
+ const scheduledTasks = getScheduledTasks()
36
39
  for (const name of names) {
37
40
  const task = scheduledTasks.get(name)
38
41
  if (task) {
@@ -52,10 +55,7 @@ export class PikkuTaskScheduler<TaskName extends string> {
52
55
  }
53
56
 
54
57
  private startJobSchedule(
55
- task: CoreScheduledTask<
56
- CoreAPIFunctionSessionless<void, void>,
57
- CoreUserSession
58
- >
58
+ task: CoreScheduledTask<CoreAPIFunctionSessionless<void, void>>
59
59
  ) {
60
60
  const job = new CronJob(
61
61
  task.schedule,
package/tsconfig.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "extends": "../tsconfig.json",
3
3
  "compilerOptions": {
4
4
  "rootDir": "./src",
5
- "module": "Node16",
5
+ "module": "Node18",
6
6
  "outDir": "dist",
7
7
  "target": "esnext",
8
8
  "declaration": true,
@@ -1 +1 @@
1
- {"root":["./src/index.ts","./src/pikku-task-scheduler.ts"],"version":"5.7.3"}
1
+ {"root":["./src/index.ts","./src/pikku-task-scheduler.ts"],"version":"5.8.3"}