@athenna/cron 5.10.0 → 5.11.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.10.0",
3
+ "version": "5.11.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.7.0",
61
- "@athenna/common": "^5.14.0",
62
- "@athenna/config": "^5.4.0",
60
+ "@athenna/artisan": "^5.11.0",
61
+ "@athenna/common": "^5.30.0",
62
+ "@athenna/config": "^5.6.0",
63
63
  "@athenna/ioc": "^5.2.0",
64
- "@athenna/logger": "^5.7.0",
65
- "@athenna/test": "^5.5.0",
64
+ "@athenna/logger": "^5.14.0",
65
+ "@athenna/test": "^5.6.0",
66
66
  "@athenna/tsconfig": "^5.0.0",
67
- "@athenna/view": "^5.3.0",
67
+ "@athenna/view": "^5.4.0",
68
68
  "@types/node-cron": "^3.0.11",
69
- "@typescript-eslint/eslint-plugin": "^8.38.0",
70
- "@typescript-eslint/parser": "^8.38.0",
69
+ "@typescript-eslint/eslint-plugin": "^8.57.0",
70
+ "@typescript-eslint/parser": "^8.57.0",
71
71
  "cls-rtracer": "^2.6.3",
72
72
  "commitizen": "^4.3.1",
73
73
  "cz-conventional-changelog": "^3.3.0",
@@ -103,7 +103,7 @@ export class CronBuilder extends Macroable {
103
103
  await handler(...args);
104
104
  }
105
105
  catch (err) {
106
- CronBuilder.exceptionHandler.handle(err);
106
+ CronBuilder.exceptionHandler.handle({ error: err });
107
107
  }
108
108
  };
109
109
  }
@@ -6,4 +6,4 @@
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 const debug: import("util").DebugLogger;
9
+ export declare const debug: import("node:util").DebugLogger;
@@ -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 CronExceptionHandler {
9
+ import { ExceptionHandler, type ExceptionHandlerContext } from '@athenna/common';
10
+ export declare class CronExceptionHandler extends ExceptionHandler {
10
11
  /**
11
12
  * Error codes that should be ignored from logging.
12
13
  */
@@ -18,7 +19,7 @@ export declare class CronExceptionHandler {
18
19
  /**
19
20
  * The exception handler of all Artisan commands.
20
21
  */
21
- handle(error: any): Promise<void>;
22
+ handle({ error }: ExceptionHandlerContext): Promise<void>;
22
23
  /**
23
24
  * Return a boolean indicating if the error can be logged or not.
24
25
  */
@@ -6,10 +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 { Is, String, ExceptionHandler } from '@athenna/common';
9
10
  import { Log } from '@athenna/logger';
10
11
  import { Config } from '@athenna/config';
11
- import { Is, String } from '@athenna/common';
12
- export class CronExceptionHandler {
12
+ export class CronExceptionHandler extends ExceptionHandler {
13
13
  /**
14
14
  * Error codes that should be ignored from logging.
15
15
  */
@@ -25,7 +25,7 @@ export class CronExceptionHandler {
25
25
  /**
26
26
  * The exception handler of all Artisan commands.
27
27
  */
28
- async handle(error) {
28
+ async handle({ error }) {
29
29
  error.code = String.toSnakeCase(`${error.code}` || error.name).toUpperCase();
30
30
  if (!Is.Exception(error)) {
31
31
  error = error.toAthennaException();