@abinnovision/nestjs-hatchet 0.7.0-beta.1 → 0.7.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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.0](https://github.com/abinnovision/nestjs-commons/compare/nestjs-hatchet-v0.6.1...nestjs-hatchet-v0.7.0) (2026-05-13)
4
+
5
+
6
+ ### Features
7
+
8
+ * add nestjs-toolkit and nestjs-exceptions packages ([#106](https://github.com/abinnovision/nestjs-commons/issues/106)) ([1655e03](https://github.com/abinnovision/nestjs-commons/commit/1655e03d4a0202bdd59e00be634a22ea69bdb8b1))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **hatchet:** tolerate startup with no forFeature registrations ([#119](https://github.com/abinnovision/nestjs-commons/issues/119)) ([7b4cb4c](https://github.com/abinnovision/nestjs-commons/commit/7b4cb4cc1f6252d7810f9d1b7567cde7f70b542b))
14
+
3
15
  ## [0.6.1](https://github.com/abinnovision/nestjs-commons/compare/nestjs-hatchet-v0.6.0...nestjs-hatchet-v0.6.1) (2026-05-12)
4
16
 
5
17
 
@@ -28,7 +28,8 @@ var DeclarationBuilderService = class {
28
28
  constructor(moduleRef, interceptorRegistration) {
29
29
  this.moduleRef = moduleRef;
30
30
  this.interceptorRegistration = interceptorRegistration;
31
- this.interceptors = this.interceptorRegistration?.refs.map((token) => this.moduleRef.get(token, { strict: false })) ?? [];
31
+ const resolvedRefs = this.interceptorRegistration?.refs.map((token) => this.moduleRef.get(token, { strict: false }));
32
+ this.interceptors = resolvedRefs ?? [];
32
33
  }
33
34
  /**
34
35
  * Creates a WorkflowDeclaration or TaskWorkflowDeclaration from the given host.
@@ -28,7 +28,8 @@ var DeclarationBuilderService = class {
28
28
  constructor(moduleRef, interceptorRegistration) {
29
29
  this.moduleRef = moduleRef;
30
30
  this.interceptorRegistration = interceptorRegistration;
31
- this.interceptors = this.interceptorRegistration?.refs.map((token) => this.moduleRef.get(token, { strict: false })) ?? [];
31
+ const resolvedRefs = this.interceptorRegistration?.refs.map((token) => this.moduleRef.get(token, { strict: false }));
32
+ this.interceptors = resolvedRefs ?? [];
32
33
  }
33
34
  /**
34
35
  * Creates a WorkflowDeclaration or TaskWorkflowDeclaration from the given host.
@@ -62,11 +62,20 @@ var WorkerManagementService = class WorkerManagementService {
62
62
  }
63
63
  /**
64
64
  * Discovers all feature registrations from forFeature() calls.
65
+ *
66
+ * Returns an empty array when no `HatchetModule.forFeature()` has been
67
+ * registered anywhere. Nest's `ModuleRef.get(..., { each: true })` throws
68
+ * `UnknownElementException` when zero providers exist for the token, even
69
+ * with `strict: false`, so we catch that case and treat it as "no features".
65
70
  */ discoverFeatureRegistrations() {
66
- return this.moduleRef.get(require_registrations.HatchetFeatureRegistration, {
67
- strict: false,
68
- each: true
69
- });
71
+ try {
72
+ return this.moduleRef.get(require_registrations.HatchetFeatureRegistration, {
73
+ strict: false,
74
+ each: true
75
+ });
76
+ } catch {
77
+ return [];
78
+ }
70
79
  }
71
80
  /**
72
81
  * Detects workflows registered on the Hatchet server that have no
@@ -18,6 +18,11 @@ export declare class WorkerManagementService implements OnApplicationBootstrap {
18
18
  private buildDeclarations;
19
19
  /**
20
20
  * Discovers all feature registrations from forFeature() calls.
21
+ *
22
+ * Returns an empty array when no `HatchetModule.forFeature()` has been
23
+ * registered anywhere. Nest's `ModuleRef.get(..., { each: true })` throws
24
+ * `UnknownElementException` when zero providers exist for the token, even
25
+ * with `strict: false`, so we catch that case and treat it as "no features".
21
26
  */
22
27
  private discoverFeatureRegistrations;
23
28
  /**
@@ -62,11 +62,20 @@ var WorkerManagementService = class WorkerManagementService {
62
62
  }
63
63
  /**
64
64
  * Discovers all feature registrations from forFeature() calls.
65
+ *
66
+ * Returns an empty array when no `HatchetModule.forFeature()` has been
67
+ * registered anywhere. Nest's `ModuleRef.get(..., { each: true })` throws
68
+ * `UnknownElementException` when zero providers exist for the token, even
69
+ * with `strict: false`, so we catch that case and treat it as "no features".
65
70
  */ discoverFeatureRegistrations() {
66
- return this.moduleRef.get(HatchetFeatureRegistration, {
67
- strict: false,
68
- each: true
69
- });
71
+ try {
72
+ return this.moduleRef.get(HatchetFeatureRegistration, {
73
+ strict: false,
74
+ each: true
75
+ });
76
+ } catch {
77
+ return [];
78
+ }
70
79
  }
71
80
  /**
72
81
  * Detects workflows registered on the Hatchet server that have no
package/package.json CHANGED
@@ -1,10 +1,17 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@abinnovision/nestjs-hatchet",
4
- "version": "0.7.0-beta.1",
4
+ "version": "0.7.0",
5
+ "description": "NestJS integration for Hatchet workflow orchestration with declarative task and workflow decorators for building distributed job systems.",
5
6
  "keywords": [
6
7
  "nestjs",
7
- "hatchet"
8
+ "hatchet",
9
+ "workflow",
10
+ "orchestration",
11
+ "background-tasks",
12
+ "job-queue",
13
+ "task-scheduling",
14
+ "decorators"
8
15
  ],
9
16
  "repository": {
10
17
  "type": "git",
@@ -13,9 +20,9 @@
13
20
  },
14
21
  "license": "Apache-2.0",
15
22
  "author": {
16
- "name": "AB INNOVISION GmbH",
17
- "email": "info@abinnovision.com",
18
- "url": "https://abinnovision.com/"
23
+ "name": "abi group GmbH",
24
+ "email": "info@abigroup.io",
25
+ "url": "https://abigroup.io"
19
26
  },
20
27
  "type": "module",
21
28
  "exports": {
@@ -72,19 +79,19 @@
72
79
  "directed-graph-typed": "^2.6.0"
73
80
  },
74
81
  "devDependencies": {
75
- "@abinnovision/eslint-config-base": "^3.2.0",
76
- "@abinnovision/prettier-config": "^2.1.5",
82
+ "@abinnovision/eslint-config-base": "^3.4.1",
83
+ "@abinnovision/prettier-config": "^2.2.0",
77
84
  "@swc/core": "^1.15.18",
78
- "eslint": "^9.39.4",
79
- "prettier": "^3.8.1",
80
- "publint": "^0.3.18",
85
+ "eslint": "^10.3.0",
86
+ "prettier": "^3.8.3",
87
+ "publint": "^0.3.21",
81
88
  "reflect-metadata": "^0.2.2",
82
89
  "rxjs": "^7.8.2",
83
- "tsdown": "^0.21.4",
90
+ "tsdown": "^0.22.0",
84
91
  "typescript": "^5.9.3",
85
92
  "unplugin-swc": "^1.5.9",
86
- "vitest": "^4.1.0",
87
- "vitest-mock-extended": "^3.1.0",
93
+ "vitest": "^4.1.6",
94
+ "vitest-mock-extended": "^4.0.0",
88
95
  "zod": "^4.3.6"
89
96
  },
90
97
  "peerDependencies": {