@athenna/cron 5.4.0 → 5.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@athenna/cron",
3
- "version": "5.4.0",
3
+ "version": "5.5.0",
4
4
  "description": "Athenna scheduler application. Built on top of node-cron.",
5
5
  "license": "MIT",
6
6
  "author": "João Lenon <lenon@athenna.io>",
@@ -57,17 +57,17 @@
57
57
  "node-cron": "^3.0.3"
58
58
  },
59
59
  "devDependencies": {
60
- "@athenna/artisan": "^5.3.0",
61
- "@athenna/common": "^5.3.0",
62
- "@athenna/config": "^5.1.0",
63
- "@athenna/ioc": "^5.0.0",
64
- "@athenna/logger": "^5.1.0",
65
- "@athenna/test": "^5.2.0",
60
+ "@athenna/artisan": "^5.6.0",
61
+ "@athenna/common": "^5.7.0",
62
+ "@athenna/config": "^5.3.0",
63
+ "@athenna/ioc": "^5.1.0",
64
+ "@athenna/logger": "^5.3.0",
65
+ "@athenna/test": "^5.3.0",
66
66
  "@athenna/tsconfig": "^5.0.0",
67
- "@athenna/view": "^5.1.0",
67
+ "@athenna/view": "^5.3.0",
68
68
  "@types/node-cron": "^3.0.11",
69
- "@typescript-eslint/eslint-plugin": "^7.18.0",
70
- "@typescript-eslint/parser": "^7.18.0",
69
+ "@typescript-eslint/eslint-plugin": "^8.21.0",
70
+ "@typescript-eslint/parser": "^8.21.0",
71
71
  "cls-rtracer": "^2.6.3",
72
72
  "commitizen": "^4.3.1",
73
73
  "cz-conventional-changelog": "^3.3.0",
@@ -7,8 +7,9 @@
7
7
  * file that was distributed with this source code.
8
8
  */
9
9
  import type { CronHandler } from '#src/types';
10
+ import { Macroable } from '@athenna/common';
10
11
  import type { CronExceptionHandler } from '#src/handlers/CronExceptionHandler';
11
- export declare class CronBuilder {
12
+ export declare class CronBuilder extends Macroable {
12
13
  static rTracerPlugin: any;
13
14
  static exceptionHandler: CronExceptionHandler;
14
15
  /**
@@ -7,9 +7,10 @@
7
7
  * file that was distributed with this source code.
8
8
  */
9
9
  import { schedule } from 'node-cron';
10
- import { Options } from '@athenna/common';
11
- export class CronBuilder {
10
+ import { Macroable, Options } from '@athenna/common';
11
+ export class CronBuilder extends Macroable {
12
12
  constructor() {
13
+ super(...arguments);
13
14
  this.cron = {};
14
15
  }
15
16
  /**
@@ -6,9 +6,10 @@
6
6
  * For the full copyright and license information, please view the LICENSE
7
7
  * file that was distributed with this source code.
8
8
  */
9
+ import { Macroable } from '@athenna/common';
9
10
  import type { ScheduledTask } from '#src/types';
10
11
  import { CronBuilder } from '#src/cron/CronBuilder';
11
- export declare class CronImpl {
12
+ export declare class CronImpl extends Macroable {
12
13
  /**
13
14
  * Creates a new instance of CronBuilder to register
14
15
  * your scheduler.
@@ -6,10 +6,11 @@
6
6
  * For the full copyright and license information, please view the LICENSE
7
7
  * file that was distributed with this source code.
8
8
  */
9
+ import { Macroable } from '@athenna/common';
9
10
  import { getTasks, validate } from 'node-cron';
10
11
  import { CronBuilder } from '#src/cron/CronBuilder';
11
12
  import { NotFoundTaskNameException } from '#src/exceptions/NotFoundTaskNameException';
12
- export class CronImpl {
13
+ export class CronImpl extends Macroable {
13
14
  /**
14
15
  * Creates a new instance of CronBuilder to register
15
16
  * your scheduler.
@@ -2,7 +2,7 @@ import { debug } from '#src/debug';
2
2
  import { Cron } from '#src/facades/Cron';
3
3
  import { CronBuilder } from '#src/cron/CronBuilder';
4
4
  import { sep, resolve, isAbsolute } from 'node:path';
5
- import { Exec, File, Module, Path } from '@athenna/common';
5
+ import { File, Path, Module } from '@athenna/common';
6
6
  import { Annotation } from '@athenna/ioc';
7
7
  import { CronExceptionHandler } from '#src/handlers/CronExceptionHandler';
8
8
  const rTracerPlugin = await Module.safeImport('cls-rtracer');
@@ -42,7 +42,7 @@ export class CronKernel {
42
42
  */
43
43
  async registerSchedulers() {
44
44
  const schedulers = Config.get('rc.schedulers', []);
45
- await Exec.concurrently(schedulers, async (path) => {
45
+ await schedulers.athenna.concurrently(async (path) => {
46
46
  const Scheduler = await Module.resolve(path, this.getParentURL());
47
47
  if (Annotation.isAnnotated(Scheduler)) {
48
48
  this.registerUsingMeta(Scheduler);
@@ -6,7 +6,8 @@
6
6
  * For the full copyright and license information, please view the LICENSE
7
7
  * file that was distributed with this source code.
8
8
  */
9
- export declare class TestScheduler {
9
+ import { Macroable } from '@athenna/common';
10
+ export declare class TestScheduler extends Macroable {
10
11
  /**
11
12
  * Run a specific scheduler by its name.
12
13
  *
@@ -7,7 +7,8 @@
7
7
  * file that was distributed with this source code.
8
8
  */
9
9
  import { Cron } from '@athenna/cron';
10
- export class TestScheduler {
10
+ import { Macroable } from '@athenna/common';
11
+ export class TestScheduler extends Macroable {
11
12
  /**
12
13
  * Run a specific scheduler by its name.
13
14
  *
@@ -2,7 +2,7 @@ import { Scheduler, type Context } from '@athenna/cron'
2
2
 
3
3
  @Scheduler({ pattern: '* * * * *' })
4
4
  export class {{ namePascal }} {
5
- public async handler(ctx: Context) {
6
- //
7
- }
5
+ public async handler(ctx: Context) {
6
+ //
7
+ }
8
8
  }