@abinnovision/nestjs-hatchet 0.6.1 → 0.7.0-beta.2
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/dist/execution/context/factory.d.ts +1 -1
- package/dist/explorer/declaration-builder.service.cjs +2 -1
- package/dist/explorer/declaration-builder.service.mjs +2 -1
- package/dist/explorer/worker-management.service.cjs +13 -4
- package/dist/explorer/worker-management.service.d.ts +6 -1
- package/dist/explorer/worker-management.service.mjs +13 -4
- package/dist/hatchet.module.d.ts +1 -1
- package/package.json +20 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { BaseCtx, HostTriggerConfig, TaskCtx, WorkflowCtx } from "./types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Arguments for context factory functions.
|
|
4
4
|
* Derived from BaseCtx using Pick to ensure type alignment.
|
|
@@ -28,7 +28,8 @@ var DeclarationBuilderService = class {
|
|
|
28
28
|
constructor(moduleRef, interceptorRegistration) {
|
|
29
29
|
this.moduleRef = moduleRef;
|
|
30
30
|
this.interceptorRegistration = interceptorRegistration;
|
|
31
|
-
|
|
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
|
-
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { HatchetClient } from "@hatchet-dev/typescript-sdk";
|
|
2
2
|
import { OnApplicationBootstrap } from "@nestjs/common";
|
|
3
3
|
import { ModuleRef } from "@nestjs/core";
|
|
4
|
-
import { type HatchetModuleConfig } from "../hatchet.module-config.js";
|
|
5
4
|
import { DeclarationBuilderService } from "./declaration-builder.service.js";
|
|
5
|
+
import type { HatchetModuleConfig } from "../hatchet.module-config.js";
|
|
6
6
|
export declare class WorkerManagementService implements OnApplicationBootstrap {
|
|
7
7
|
private readonly client;
|
|
8
8
|
private readonly declarationBuilder;
|
|
@@ -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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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/dist/hatchet.module.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DynamicModule, Type } from "@nestjs/common";
|
|
2
|
-
import { type HatchetModuleConfig } from "./hatchet.module-config.js";
|
|
3
2
|
import { Interceptor } from "./interceptor/index.js";
|
|
3
|
+
import type { HatchetModuleConfig } from "./hatchet.module-config.js";
|
|
4
4
|
import type { AnyCallableRef } from "./references/index.js";
|
|
5
5
|
/**
|
|
6
6
|
* Extra options for the module (processed at module definition time).
|
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.
|
|
4
|
+
"version": "0.7.0-beta.2",
|
|
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": "
|
|
17
|
-
"email": "info@
|
|
18
|
-
"url": "https://
|
|
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.
|
|
76
|
-
"@abinnovision/prettier-config": "^2.
|
|
82
|
+
"@abinnovision/eslint-config-base": "^3.4.1",
|
|
83
|
+
"@abinnovision/prettier-config": "^2.2.0",
|
|
77
84
|
"@swc/core": "^1.15.18",
|
|
78
|
-
"eslint": "^
|
|
79
|
-
"prettier": "^3.8.
|
|
80
|
-
"publint": "^0.3.
|
|
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.
|
|
90
|
+
"tsdown": "^0.22.0",
|
|
84
91
|
"typescript": "^5.9.3",
|
|
85
92
|
"unplugin-swc": "^1.5.9",
|
|
86
|
-
"vitest": "^4.1.
|
|
87
|
-
"vitest-mock-extended": "^
|
|
93
|
+
"vitest": "^4.1.6",
|
|
94
|
+
"vitest-mock-extended": "^4.0.0",
|
|
88
95
|
"zod": "^4.3.6"
|
|
89
96
|
},
|
|
90
97
|
"peerDependencies": {
|