@abinnovision/nestjs-hatchet 0.4.0-beta.9 → 0.5.0-beta.1

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +11 -1
  3. package/dist/__fixtures__/test-hosts.d.cts +5 -5
  4. package/dist/__fixtures__/test-hosts.d.ts +5 -5
  5. package/dist/abstracts/hosts.d.cts +3 -3
  6. package/dist/abstracts/hosts.d.ts +3 -3
  7. package/dist/client/client.cjs +2 -2
  8. package/dist/client/client.d.cts +1 -1
  9. package/dist/client/client.d.ts +1 -1
  10. package/dist/client/client.mjs +1 -1
  11. package/dist/execution/context/types.d.cts +1 -1
  12. package/dist/execution/context/types.d.ts +1 -1
  13. package/dist/execution/host-run/adapter-factory.d.cts +1 -1
  14. package/dist/execution/host-run/adapter-factory.d.ts +1 -1
  15. package/dist/execution/host-run/function-type.d.cts +1 -1
  16. package/dist/execution/host-run/function-type.d.ts +1 -1
  17. package/dist/explorer/declaration-builder.service.cjs +3 -3
  18. package/dist/explorer/declaration-builder.service.d.cts +1 -1
  19. package/dist/explorer/declaration-builder.service.d.ts +1 -1
  20. package/dist/explorer/declaration-builder.service.mjs +1 -1
  21. package/dist/explorer/worker-management.service.cjs +2 -2
  22. package/dist/explorer/worker-management.service.d.cts +1 -1
  23. package/dist/explorer/worker-management.service.d.ts +1 -1
  24. package/dist/explorer/worker-management.service.mjs +1 -1
  25. package/dist/hatchet.module-config.d.cts +1 -1
  26. package/dist/hatchet.module-config.d.ts +1 -1
  27. package/dist/metadata/decorators/host.decorator.d.cts +1 -1
  28. package/dist/metadata/decorators/host.decorator.d.ts +1 -1
  29. package/dist/metadata/decorators/task.decorator.d.cts +1 -1
  30. package/dist/metadata/decorators/task.decorator.d.ts +1 -1
  31. package/dist/metadata/decorators/workflow-task.decorator.d.cts +1 -1
  32. package/dist/metadata/decorators/workflow-task.decorator.d.ts +1 -1
  33. package/dist/metadata/translator.d.cts +1 -1
  34. package/dist/metadata/translator.d.ts +1 -1
  35. package/dist/sdk/hatchet-client.factory.cjs +3 -3
  36. package/dist/sdk/hatchet-client.factory.mjs +1 -1
  37. package/dist/sdk-export/index.cjs +9 -0
  38. package/dist/sdk-export/index.d.cts +8 -0
  39. package/dist/sdk-export/index.d.ts +8 -0
  40. package/dist/sdk-export/index.mjs +2 -0
  41. package/package.json +12 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.4.0](https://github.com/abinnovision/nestjs-commons/compare/nestjs-hatchet-v0.3.2...nestjs-hatchet-v0.4.0) (2026-03-21)
4
+
5
+
6
+ ### Features
7
+
8
+ * add workflow/task orphan detection ([#91](https://github.com/abinnovision/nestjs-commons/issues/91)) ([dd574d4](https://github.com/abinnovision/nestjs-commons/commit/dd574d4bfe35639aa6ffba28afcdb141ce948a8e))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * migrate build-system and use dual export with cjs and esm ([#98](https://github.com/abinnovision/nestjs-commons/issues/98)) ([28ea7a6](https://github.com/abinnovision/nestjs-commons/commit/28ea7a6f6d5685a400787eab443b1437beff0f6b))
14
+
3
15
  ## [0.3.2](https://github.com/abinnovision/nestjs-commons/compare/nestjs-hatchet-v0.3.1...nestjs-hatchet-v0.3.2) (2026-01-28)
4
16
 
5
17
 
package/README.md CHANGED
@@ -7,7 +7,17 @@ handling for building robust workflows.
7
7
  ## Installation
8
8
 
9
9
  ```bash
10
- yarn add @abinnovision/nestjs-hatchet @hatchet-dev/typescript-sdk
10
+ yarn add @abinnovision/nestjs-hatchet
11
+ ```
12
+
13
+ ### Hatchet SDK Re-export
14
+
15
+ This package includes a patched version of `@hatchet-dev/typescript-sdk` that properly
16
+ exports the `v1` subdirectory. You can import SDK types and classes directly without
17
+ adding the Hatchet SDK as a separate dependency:
18
+
19
+ ```typescript
20
+ import { HatchetClient, Context } from "@abinnovision/nestjs-hatchet/sdk";
11
21
  ```
12
22
 
13
23
  ## Quick Start
@@ -5,7 +5,7 @@ declare const TestTask_base: {
5
5
  readonly __task_host_input: {
6
6
  data: string;
7
7
  };
8
- readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk/index.js").JsonObject, {
8
+ readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk").JsonObject, {
9
9
  data: string;
10
10
  }> | undefined;
11
11
  };
@@ -20,7 +20,7 @@ declare const NoMethodsTask_base: {
20
20
  new (): {
21
21
  readonly __task_host_brand: void;
22
22
  readonly __task_host_input: unknown;
23
- readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk/index.js").JsonObject, unknown> | undefined;
23
+ readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk").JsonObject, unknown> | undefined;
24
24
  };
25
25
  };
26
26
  /** TaskHost without any decorated methods (invalid) */
@@ -31,7 +31,7 @@ declare const NoSchemaTask_base: {
31
31
  new (): {
32
32
  readonly __task_host_brand: void;
33
33
  readonly __task_host_input: unknown;
34
- readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk/index.js").JsonObject, unknown> | undefined;
34
+ readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk").JsonObject, unknown> | undefined;
35
35
  };
36
36
  };
37
37
  /** TaskHost without input schema */
@@ -46,7 +46,7 @@ declare const TestWorkflow_base: {
46
46
  readonly __workflow_host_input: {
47
47
  id: string;
48
48
  };
49
- readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk/index.js").JsonObject, {
49
+ readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk").JsonObject, {
50
50
  id: string;
51
51
  }> | undefined;
52
52
  };
@@ -64,7 +64,7 @@ declare const NoMethodsWorkflow_base: {
64
64
  new (): {
65
65
  readonly __workflow_host_brand: void;
66
66
  readonly __workflow_host_input: unknown;
67
- readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk/index.js").JsonObject, unknown> | undefined;
67
+ readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk").JsonObject, unknown> | undefined;
68
68
  };
69
69
  };
70
70
  /** WorkflowHost without any decorated methods (invalid) */
@@ -5,7 +5,7 @@ declare const TestTask_base: {
5
5
  readonly __task_host_input: {
6
6
  data: string;
7
7
  };
8
- readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk/index.js").JsonObject, {
8
+ readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk").JsonObject, {
9
9
  data: string;
10
10
  }> | undefined;
11
11
  };
@@ -20,7 +20,7 @@ declare const NoMethodsTask_base: {
20
20
  new (): {
21
21
  readonly __task_host_brand: void;
22
22
  readonly __task_host_input: unknown;
23
- readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk/index.js").JsonObject, unknown> | undefined;
23
+ readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk").JsonObject, unknown> | undefined;
24
24
  };
25
25
  };
26
26
  /** TaskHost without any decorated methods (invalid) */
@@ -31,7 +31,7 @@ declare const NoSchemaTask_base: {
31
31
  new (): {
32
32
  readonly __task_host_brand: void;
33
33
  readonly __task_host_input: unknown;
34
- readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk/index.js").JsonObject, unknown> | undefined;
34
+ readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk").JsonObject, unknown> | undefined;
35
35
  };
36
36
  };
37
37
  /** TaskHost without input schema */
@@ -46,7 +46,7 @@ declare const TestWorkflow_base: {
46
46
  readonly __workflow_host_input: {
47
47
  id: string;
48
48
  };
49
- readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk/index.js").JsonObject, {
49
+ readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk").JsonObject, {
50
50
  id: string;
51
51
  }> | undefined;
52
52
  };
@@ -64,7 +64,7 @@ declare const NoMethodsWorkflow_base: {
64
64
  new (): {
65
65
  readonly __workflow_host_brand: void;
66
66
  readonly __workflow_host_input: unknown;
67
- readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk/index.js").JsonObject, unknown> | undefined;
67
+ readonly inputSchema: () => import("@standard-schema/spec").StandardSchemaV1<import("@hatchet-dev/typescript-sdk").JsonObject, unknown> | undefined;
68
68
  };
69
69
  };
70
70
  /** WorkflowHost without any decorated methods (invalid) */
@@ -1,4 +1,4 @@
1
- import type { InputType } from "@hatchet-dev/typescript-sdk";
1
+ import type { InputType } from "@hatchet-dev/typescript-sdk/v1";
2
2
  import type { StandardSchemaV1 } from "@standard-schema/spec";
3
3
  /**
4
4
  * Interface for classes that provide a schema for their input.
@@ -49,7 +49,7 @@ export declare function workflowHost<I>(input?: ReturnType<InputSchemaProvider<I
49
49
  new (): {
50
50
  readonly __workflow_host_brand: void;
51
51
  readonly __workflow_host_input: I;
52
- readonly inputSchema: () => StandardSchemaV1<import("@hatchet-dev/typescript-sdk").JsonObject, I> | undefined;
52
+ readonly inputSchema: () => StandardSchemaV1<import("@hatchet-dev/typescript-sdk/v1").JsonObject, I> | undefined;
53
53
  };
54
54
  };
55
55
  /**
@@ -61,6 +61,6 @@ export declare function taskHost<I>(input?: ReturnType<InputSchemaProvider<I>["i
61
61
  new (): {
62
62
  readonly __task_host_brand: void;
63
63
  readonly __task_host_input: I;
64
- readonly inputSchema: () => StandardSchemaV1<import("@hatchet-dev/typescript-sdk").JsonObject, I> | undefined;
64
+ readonly inputSchema: () => StandardSchemaV1<import("@hatchet-dev/typescript-sdk/v1").JsonObject, I> | undefined;
65
65
  };
66
66
  };
@@ -1,4 +1,4 @@
1
- import type { InputType } from "@hatchet-dev/typescript-sdk";
1
+ import type { InputType } from "@hatchet-dev/typescript-sdk/v1";
2
2
  import type { StandardSchemaV1 } from "@standard-schema/spec";
3
3
  /**
4
4
  * Interface for classes that provide a schema for their input.
@@ -49,7 +49,7 @@ export declare function workflowHost<I>(input?: ReturnType<InputSchemaProvider<I
49
49
  new (): {
50
50
  readonly __workflow_host_brand: void;
51
51
  readonly __workflow_host_input: I;
52
- readonly inputSchema: () => StandardSchemaV1<import("@hatchet-dev/typescript-sdk").JsonObject, I> | undefined;
52
+ readonly inputSchema: () => StandardSchemaV1<import("@hatchet-dev/typescript-sdk/v1").JsonObject, I> | undefined;
53
53
  };
54
54
  };
55
55
  /**
@@ -61,6 +61,6 @@ export declare function taskHost<I>(input?: ReturnType<InputSchemaProvider<I>["i
61
61
  new (): {
62
62
  readonly __task_host_brand: void;
63
63
  readonly __task_host_input: I;
64
- readonly inputSchema: () => StandardSchemaV1<import("@hatchet-dev/typescript-sdk").JsonObject, I> | undefined;
64
+ readonly inputSchema: () => StandardSchemaV1<import("@hatchet-dev/typescript-sdk/v1").JsonObject, I> | undefined;
65
65
  };
66
66
  };
@@ -1,7 +1,7 @@
1
1
  const require_event_definition = require("../events/event-definition.cjs");
2
2
  const require_adapter_factory = require("../execution/host-run/adapter-factory.cjs");
3
3
  let _nestjs_common = require("@nestjs/common");
4
- let _hatchet_dev_typescript_sdk = require("@hatchet-dev/typescript-sdk");
4
+ let _hatchet_dev_typescript_sdk_v1 = require("@hatchet-dev/typescript-sdk/v1");
5
5
  //#region src/client/client.ts
6
6
  function _ts_decorate(decorators, target, key, desc) {
7
7
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -69,7 +69,7 @@ var Client = class {
69
69
  Client = _ts_decorate([
70
70
  (0, _nestjs_common.Injectable)(),
71
71
  _ts_metadata("design:type", Function),
72
- _ts_metadata("design:paramtypes", [typeof _hatchet_dev_typescript_sdk.HatchetClient === "undefined" ? Object : _hatchet_dev_typescript_sdk.HatchetClient])
72
+ _ts_metadata("design:paramtypes", [typeof _hatchet_dev_typescript_sdk_v1.HatchetClient === "undefined" ? Object : _hatchet_dev_typescript_sdk_v1.HatchetClient])
73
73
  ], Client);
74
74
  //#endregion
75
75
  Object.defineProperty(exports, "Client", {
@@ -1,4 +1,4 @@
1
- import { HatchetClient } from "@hatchet-dev/typescript-sdk";
1
+ import { HatchetClient } from "@hatchet-dev/typescript-sdk/v1";
2
2
  import type { AnyEventDefinition, EventInput } from "../events/index.js";
3
3
  import type { HostRunFn } from "../execution/index.js";
4
4
  type EventClient = HatchetClient["events"];
@@ -1,4 +1,4 @@
1
- import { HatchetClient } from "@hatchet-dev/typescript-sdk";
1
+ import { HatchetClient } from "@hatchet-dev/typescript-sdk/v1";
2
2
  import type { AnyEventDefinition, EventInput } from "../events/index.js";
3
3
  import type { HostRunFn } from "../execution/index.js";
4
4
  type EventClient = HatchetClient["events"];
@@ -1,7 +1,7 @@
1
1
  import { EVENT_MARKER } from "../events/event-definition.mjs";
2
2
  import { createHostRunForAdmin } from "../execution/host-run/adapter-factory.mjs";
3
3
  import { Injectable } from "@nestjs/common";
4
- import { HatchetClient } from "@hatchet-dev/typescript-sdk";
4
+ import { HatchetClient } from "@hatchet-dev/typescript-sdk/v1";
5
5
  //#region src/client/client.ts
6
6
  function _ts_decorate(decorators, target, key, desc) {
7
7
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -2,7 +2,7 @@ import type { TaskHost, WorkflowHost } from "../../abstracts/index.js";
2
2
  import type { AnyEventDefinition, EventOutput } from "../../events/index.js";
3
3
  import type { AnyTaskFn, OutputOfTaskFn } from "../../references/shared.js";
4
4
  import type { HostRunFn } from "../host-run/index.js";
5
- import type { Context } from "@hatchet-dev/typescript-sdk";
5
+ import type { Context } from "@hatchet-dev/typescript-sdk/v1";
6
6
  export declare const TASK_MARKER: unique symbol;
7
7
  export type TaskMarker = typeof TASK_MARKER;
8
8
  /**
@@ -2,7 +2,7 @@ import type { TaskHost, WorkflowHost } from "../../abstracts/index.js";
2
2
  import type { AnyEventDefinition, EventOutput } from "../../events/index.js";
3
3
  import type { AnyTaskFn, OutputOfTaskFn } from "../../references/shared.js";
4
4
  import type { HostRunFn } from "../host-run/index.js";
5
- import type { Context } from "@hatchet-dev/typescript-sdk";
5
+ import type { Context } from "@hatchet-dev/typescript-sdk/v1";
6
6
  export declare const TASK_MARKER: unique symbol;
7
7
  export type TaskMarker = typeof TASK_MARKER;
8
8
  /**
@@ -1,5 +1,5 @@
1
1
  import type { HostRunFn } from "./function-type.js";
2
- import type { Context, HatchetClient } from "@hatchet-dev/typescript-sdk";
2
+ import type { Context, HatchetClient } from "@hatchet-dev/typescript-sdk/v1";
3
3
  /**
4
4
  * Creates a HostRunFn that uses SDK Context for spawning child workflows.
5
5
  * Used within task execution contexts.
@@ -1,5 +1,5 @@
1
1
  import type { HostRunFn } from "./function-type.js";
2
- import type { Context, HatchetClient } from "@hatchet-dev/typescript-sdk";
2
+ import type { Context, HatchetClient } from "@hatchet-dev/typescript-sdk/v1";
3
3
  /**
4
4
  * Creates a HostRunFn that uses SDK Context for spawning child workflows.
5
5
  * Used within task execution contexts.
@@ -1,6 +1,6 @@
1
1
  import type { AnyCallableRef, InputOfRef, OutputOfRef } from "../../references/index.js";
2
2
  import type { WorkflowRunRef } from "../../sdk/types.js";
3
- import type { RunOpts } from "@hatchet-dev/typescript-sdk";
3
+ import type { RunOpts } from "@hatchet-dev/typescript-sdk/v1";
4
4
  /**
5
5
  * Describes the return type of the {@link HostRunFn} function.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  import type { AnyCallableRef, InputOfRef, OutputOfRef } from "../../references/index.js";
2
2
  import type { WorkflowRunRef } from "../../sdk/types.js";
3
- import type { RunOpts } from "@hatchet-dev/typescript-sdk";
3
+ import type { RunOpts } from "@hatchet-dev/typescript-sdk/v1";
4
4
  /**
5
5
  * Describes the return type of the {@link HostRunFn} function.
6
6
  *
@@ -3,7 +3,7 @@ const require_accessor = require("../metadata/accessor.cjs");
3
3
  const require_factory = require("../execution/context/factory.cjs");
4
4
  const require_registrations = require("../internal/registrations.cjs");
5
5
  let _nestjs_common = require("@nestjs/common");
6
- let _hatchet_dev_typescript_sdk = require("@hatchet-dev/typescript-sdk");
6
+ let _hatchet_dev_typescript_sdk_v1 = require("@hatchet-dev/typescript-sdk/v1");
7
7
  let _nestjs_core = require("@nestjs/core");
8
8
  let directed_graph_typed = require("directed-graph-typed");
9
9
  //#region src/explorer/declaration-builder.service.ts
@@ -47,7 +47,7 @@ var DeclarationBuilderService = class {
47
47
  if (!methodName) throw new Error("Could not find method name for TaskHost");
48
48
  const taskOpts = accessor.getTaskMeta(methodName);
49
49
  const proto = Object.getPrototypeOf(host);
50
- return new _hatchet_dev_typescript_sdk.TaskWorkflowDeclaration({
50
+ return new _hatchet_dev_typescript_sdk_v1.TaskWorkflowDeclaration({
51
51
  ...hostOpts,
52
52
  ...taskOpts,
53
53
  fn: async (_, ctx) => {
@@ -65,7 +65,7 @@ var DeclarationBuilderService = class {
65
65
  this.validateWorkflowHost(host);
66
66
  const accessor = require_accessor.fromInstance(host);
67
67
  const graph = this.buildWorkflowHostGraph(host);
68
- const workflowDec = new _hatchet_dev_typescript_sdk.WorkflowDeclaration(accessor.sdkOpts);
68
+ const workflowDec = new _hatchet_dev_typescript_sdk_v1.WorkflowDeclaration(accessor.sdkOpts);
69
69
  const proto = Object.getPrototypeOf(host);
70
70
  const taskDecls = /* @__PURE__ */ new Map();
71
71
  const topoSorted = graph.topologicalSort("key");
@@ -1,4 +1,4 @@
1
- import { TaskWorkflowDeclaration, WorkflowDeclaration } from "@hatchet-dev/typescript-sdk";
1
+ import { TaskWorkflowDeclaration, WorkflowDeclaration } from "@hatchet-dev/typescript-sdk/v1";
2
2
  import { ModuleRef } from "@nestjs/core";
3
3
  import { InterceptorRegistration } from "../internal/registrations.js";
4
4
  import { AnyHost } from "../references/shared.js";
@@ -1,4 +1,4 @@
1
- import { TaskWorkflowDeclaration, WorkflowDeclaration } from "@hatchet-dev/typescript-sdk";
1
+ import { TaskWorkflowDeclaration, WorkflowDeclaration } from "@hatchet-dev/typescript-sdk/v1";
2
2
  import { ModuleRef } from "@nestjs/core";
3
3
  import { InterceptorRegistration } from "../internal/registrations.js";
4
4
  import { AnyHost } from "../references/shared.js";
@@ -3,7 +3,7 @@ import { fromInstance } from "../metadata/accessor.mjs";
3
3
  import { createTaskCtx, createWorkflowCtx } from "../execution/context/factory.mjs";
4
4
  import { InterceptorRegistration } from "../internal/registrations.mjs";
5
5
  import { Inject, Injectable, Optional } from "@nestjs/common";
6
- import { TaskWorkflowDeclaration, WorkflowDeclaration } from "@hatchet-dev/typescript-sdk";
6
+ import { TaskWorkflowDeclaration, WorkflowDeclaration } from "@hatchet-dev/typescript-sdk/v1";
7
7
  import { ModuleRef } from "@nestjs/core";
8
8
  import { DirectedGraph } from "directed-graph-typed";
9
9
  //#region src/explorer/declaration-builder.service.ts
@@ -3,7 +3,7 @@ const require_registrations = require("../internal/registrations.cjs");
3
3
  const require_declaration_builder_service = require("./declaration-builder.service.cjs");
4
4
  const require_hatchet_module_config = require("../hatchet.module-config.cjs");
5
5
  let _nestjs_common = require("@nestjs/common");
6
- let _hatchet_dev_typescript_sdk = require("@hatchet-dev/typescript-sdk");
6
+ let _hatchet_dev_typescript_sdk_v1 = require("@hatchet-dev/typescript-sdk/v1");
7
7
  let _nestjs_core = require("@nestjs/core");
8
8
  //#region src/explorer/worker-management.service.ts
9
9
  function _ts_decorate(decorators, target, key, desc) {
@@ -111,7 +111,7 @@ WorkerManagementService = _ts_decorate([
111
111
  _ts_param(2, (0, _nestjs_common.Inject)(require_hatchet_module_config.hatchetModuleConfigToken)),
112
112
  _ts_metadata("design:type", Function),
113
113
  _ts_metadata("design:paramtypes", [
114
- typeof _hatchet_dev_typescript_sdk.HatchetClient === "undefined" ? Object : _hatchet_dev_typescript_sdk.HatchetClient,
114
+ typeof _hatchet_dev_typescript_sdk_v1.HatchetClient === "undefined" ? Object : _hatchet_dev_typescript_sdk_v1.HatchetClient,
115
115
  typeof require_declaration_builder_service.DeclarationBuilderService === "undefined" ? Object : require_declaration_builder_service.DeclarationBuilderService,
116
116
  typeof HatchetModuleConfig === "undefined" ? Object : HatchetModuleConfig,
117
117
  typeof _nestjs_core.ModuleRef === "undefined" ? Object : _nestjs_core.ModuleRef
@@ -1,4 +1,4 @@
1
- import { HatchetClient } from "@hatchet-dev/typescript-sdk";
1
+ import { HatchetClient } from "@hatchet-dev/typescript-sdk/v1";
2
2
  import { OnApplicationBootstrap } from "@nestjs/common";
3
3
  import { ModuleRef } from "@nestjs/core";
4
4
  import { type HatchetModuleConfig } from "../hatchet.module-config.js";
@@ -1,4 +1,4 @@
1
- import { HatchetClient } from "@hatchet-dev/typescript-sdk";
1
+ import { HatchetClient } from "@hatchet-dev/typescript-sdk/v1";
2
2
  import { OnApplicationBootstrap } from "@nestjs/common";
3
3
  import { ModuleRef } from "@nestjs/core";
4
4
  import { type HatchetModuleConfig } from "../hatchet.module-config.js";
@@ -3,7 +3,7 @@ import { HatchetFeatureRegistration } from "../internal/registrations.mjs";
3
3
  import { DeclarationBuilderService } from "./declaration-builder.service.mjs";
4
4
  import { hatchetModuleConfigToken } from "../hatchet.module-config.mjs";
5
5
  import { Inject, Injectable, Logger } from "@nestjs/common";
6
- import { HatchetClient } from "@hatchet-dev/typescript-sdk";
6
+ import { HatchetClient } from "@hatchet-dev/typescript-sdk/v1";
7
7
  import { ModuleRef } from "@nestjs/core";
8
8
  //#region src/explorer/worker-management.service.ts
9
9
  function _ts_decorate(decorators, target, key, desc) {
@@ -1,4 +1,4 @@
1
- import type { CreateWorkerOpts, HatchetClient } from "@hatchet-dev/typescript-sdk";
1
+ import type { CreateWorkerOpts, HatchetClient } from "@hatchet-dev/typescript-sdk/v1";
2
2
  type ClientConfig = HatchetClient["config"];
3
3
  /**
4
4
  * Configuration for the Hatchet worker.
@@ -1,4 +1,4 @@
1
- import type { CreateWorkerOpts, HatchetClient } from "@hatchet-dev/typescript-sdk";
1
+ import type { CreateWorkerOpts, HatchetClient } from "@hatchet-dev/typescript-sdk/v1";
2
2
  type ClientConfig = HatchetClient["config"];
3
3
  /**
4
4
  * Configuration for the Hatchet worker.
@@ -1,5 +1,5 @@
1
1
  import type { AnyEventDefinition } from "../../events/index.js";
2
- import type { CreateBaseWorkflowOpts } from "@hatchet-dev/typescript-sdk";
2
+ import type { CreateBaseWorkflowOpts } from "@hatchet-dev/typescript-sdk/v1";
3
3
  /**
4
4
  * Properties we enhance beyond SDK types.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import type { AnyEventDefinition } from "../../events/index.js";
2
- import type { CreateBaseWorkflowOpts } from "@hatchet-dev/typescript-sdk";
2
+ import type { CreateBaseWorkflowOpts } from "@hatchet-dev/typescript-sdk/v1";
3
3
  /**
4
4
  * Properties we enhance beyond SDK types.
5
5
  */
@@ -1,4 +1,4 @@
1
- import type { CreateBaseWorkflowOpts, CreateTaskWorkflowOpts } from "@hatchet-dev/typescript-sdk";
1
+ import type { CreateBaseWorkflowOpts, CreateTaskWorkflowOpts } from "@hatchet-dev/typescript-sdk/v1";
2
2
  export type TaskOpts = Omit<CreateTaskWorkflowOpts, "fn" | "name" | keyof CreateBaseWorkflowOpts>;
3
3
  /**
4
4
  * Decorator to mark a method as a Hatchet task.
@@ -1,4 +1,4 @@
1
- import type { CreateBaseWorkflowOpts, CreateTaskWorkflowOpts } from "@hatchet-dev/typescript-sdk";
1
+ import type { CreateBaseWorkflowOpts, CreateTaskWorkflowOpts } from "@hatchet-dev/typescript-sdk/v1";
2
2
  export type TaskOpts = Omit<CreateTaskWorkflowOpts, "fn" | "name" | keyof CreateBaseWorkflowOpts>;
3
3
  /**
4
4
  * Decorator to mark a method as a Hatchet task.
@@ -1,6 +1,6 @@
1
1
  import type { WorkflowCtx } from "../../execution/index.js";
2
2
  import type { ContextMethodKeys, WorkflowHostCtor } from "../../references/shared.js";
3
- import type { CreateWorkflowTaskOpts } from "@hatchet-dev/typescript-sdk";
3
+ import type { CreateWorkflowTaskOpts } from "@hatchet-dev/typescript-sdk/v1";
4
4
  export type WorkflowTaskOpts<C extends WorkflowHostCtor<any>> = Omit<CreateWorkflowTaskOpts, "fn" | "parents" | "name"> & {
5
5
  parents?: ContextMethodKeys<InstanceType<C>, WorkflowCtx<any>>[];
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import type { WorkflowCtx } from "../../execution/index.js";
2
2
  import type { ContextMethodKeys, WorkflowHostCtor } from "../../references/shared.js";
3
- import type { CreateWorkflowTaskOpts } from "@hatchet-dev/typescript-sdk";
3
+ import type { CreateWorkflowTaskOpts } from "@hatchet-dev/typescript-sdk/v1";
4
4
  export type WorkflowTaskOpts<C extends WorkflowHostCtor<any>> = Omit<CreateWorkflowTaskOpts, "fn" | "parents" | "name"> & {
5
5
  parents?: ContextMethodKeys<InstanceType<C>, WorkflowCtx<any>>[];
6
6
  };
@@ -1,5 +1,5 @@
1
1
  import type { HostOpts } from "./decorators/index.js";
2
- import type { CreateBaseWorkflowOpts } from "@hatchet-dev/typescript-sdk";
2
+ import type { CreateBaseWorkflowOpts } from "@hatchet-dev/typescript-sdk/v1";
3
3
  /**
4
4
  * SDK-compatible host options.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import type { HostOpts } from "./decorators/index.js";
2
- import type { CreateBaseWorkflowOpts } from "@hatchet-dev/typescript-sdk";
2
+ import type { CreateBaseWorkflowOpts } from "@hatchet-dev/typescript-sdk/v1";
3
3
  /**
4
4
  * SDK-compatible host options.
5
5
  */
@@ -1,6 +1,6 @@
1
1
  const require_hatchet_module_config = require("../hatchet.module-config.cjs");
2
2
  let _nestjs_common = require("@nestjs/common");
3
- let _hatchet_dev_typescript_sdk = require("@hatchet-dev/typescript-sdk");
3
+ let _hatchet_dev_typescript_sdk_v1 = require("@hatchet-dev/typescript-sdk/v1");
4
4
  //#region src/sdk/hatchet-client.factory.ts
5
5
  /**
6
6
  * Creates a logger that matches the Hatchet logger interface based on the given context.
@@ -35,9 +35,9 @@ let _hatchet_dev_typescript_sdk = require("@hatchet-dev/typescript-sdk");
35
35
  /**
36
36
  * Factory provider for the HatchetClient.
37
37
  */ const hatchetClientFactory = {
38
- provide: _hatchet_dev_typescript_sdk.HatchetClient,
38
+ provide: _hatchet_dev_typescript_sdk_v1.HatchetClient,
39
39
  inject: [require_hatchet_module_config.hatchetModuleConfigToken],
40
- useFactory: (opts) => new _hatchet_dev_typescript_sdk.HatchetClient({
40
+ useFactory: (opts) => new _hatchet_dev_typescript_sdk_v1.HatchetClient({
41
41
  ...opts.config,
42
42
  logger: loggerFactory
43
43
  })
@@ -1,6 +1,6 @@
1
1
  import { hatchetModuleConfigToken } from "../hatchet.module-config.mjs";
2
2
  import { Logger } from "@nestjs/common";
3
- import { HatchetClient } from "@hatchet-dev/typescript-sdk";
3
+ import { HatchetClient } from "@hatchet-dev/typescript-sdk/v1";
4
4
  //#region src/sdk/hatchet-client.factory.ts
5
5
  /**
6
6
  * Creates a logger that matches the Hatchet logger interface based on the given context.
@@ -0,0 +1,9 @@
1
+ var _hatchet_dev_typescript_sdk_v1 = require("@hatchet-dev/typescript-sdk/v1");
2
+ Object.keys(_hatchet_dev_typescript_sdk_v1).forEach(function(k) {
3
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
4
+ enumerable: true,
5
+ get: function() {
6
+ return _hatchet_dev_typescript_sdk_v1[k];
7
+ }
8
+ });
9
+ });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Re-exports the patched @hatchet-dev/typescript-sdk/v1 entrypoint.
3
+ *
4
+ * This allows consumers to import SDK types and classes from @abinnovision/nestjs-hatchet/sdk
5
+ * without depending on the hatchet SDK directly, ensuring they use the patched version
6
+ * that properly exports the v1 subdirectory.
7
+ */
8
+ export * from "@hatchet-dev/typescript-sdk/v1";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Re-exports the patched @hatchet-dev/typescript-sdk/v1 entrypoint.
3
+ *
4
+ * This allows consumers to import SDK types and classes from @abinnovision/nestjs-hatchet/sdk
5
+ * without depending on the hatchet SDK directly, ensuring they use the patched version
6
+ * that properly exports the v1 subdirectory.
7
+ */
8
+ export * from "@hatchet-dev/typescript-sdk/v1";
@@ -0,0 +1,2 @@
1
+ export * from "@hatchet-dev/typescript-sdk/v1";
2
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@abinnovision/nestjs-hatchet",
4
- "version": "0.4.0-beta.9",
4
+ "version": "0.5.0-beta.1",
5
5
  "keywords": [
6
6
  "nestjs",
7
7
  "hatchet"
@@ -28,6 +28,16 @@
28
28
  "types": "./dist/index.d.cts",
29
29
  "default": "./dist/index.cjs"
30
30
  }
31
+ },
32
+ "./sdk": {
33
+ "import": {
34
+ "types": "./dist/sdk-export/index.d.ts",
35
+ "default": "./dist/sdk-export/index.mjs"
36
+ },
37
+ "require": {
38
+ "types": "./dist/sdk-export/index.d.cts",
39
+ "default": "./dist/sdk-export/index.cjs"
40
+ }
31
41
  }
32
42
  },
33
43
  "main": "./dist/index.cjs",
@@ -57,7 +67,7 @@
57
67
  },
58
68
  "prettier": "@abinnovision/prettier-config",
59
69
  "dependencies": {
60
- "@hatchet-dev/typescript-sdk": "^1.10.0",
70
+ "@hatchet-dev/typescript-sdk": "patch:@hatchet-dev/typescript-sdk@npm%3A1.17.2#~/.yarn/patches/@hatchet-dev-typescript-sdk-npm-1.17.2-eac4b79d71.patch",
61
71
  "@standard-schema/spec": "^1.0.0",
62
72
  "directed-graph-typed": "^2.1.0"
63
73
  },