@hatchet-dev/typescript-sdk 1.1.5 → 1.1.7
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/clients/rest/generated/data-contracts.d.ts +9 -1
- package/package.json +1 -1
- package/v1/client/client.d.ts +3 -4
- package/v1/client/features/runs.d.ts +1 -2
- package/v1/client/features/runs.js +1 -8
- package/v1/declaration.d.ts +2 -1
- package/v1/task.d.ts +0 -7
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -321,7 +321,7 @@ export interface TenantQueueMetrics {
|
|
|
321
321
|
queues?: Record<string, number>;
|
|
322
322
|
}
|
|
323
323
|
export interface TenantStepRunQueueMetrics {
|
|
324
|
-
queues?:
|
|
324
|
+
queues?: object;
|
|
325
325
|
}
|
|
326
326
|
export interface AcceptInviteRequest {
|
|
327
327
|
/**
|
|
@@ -1271,6 +1271,8 @@ export interface V1WorkflowRunDisplayNameList {
|
|
|
1271
1271
|
}
|
|
1272
1272
|
export interface V1TaskSummary {
|
|
1273
1273
|
metadata: APIResourceMeta;
|
|
1274
|
+
/** The action ID of the task. */
|
|
1275
|
+
actionId: string;
|
|
1274
1276
|
/** Additional metadata for the task run. */
|
|
1275
1277
|
additionalMetadata?: object;
|
|
1276
1278
|
/** The list of children tasks */
|
|
@@ -1454,6 +1456,12 @@ export interface V1WorkflowRun {
|
|
|
1454
1456
|
* @format date-time
|
|
1455
1457
|
*/
|
|
1456
1458
|
createdAt?: string;
|
|
1459
|
+
/**
|
|
1460
|
+
* @format uuid
|
|
1461
|
+
* @minLength 36
|
|
1462
|
+
* @maxLength 36
|
|
1463
|
+
*/
|
|
1464
|
+
parentTaskExternalId?: string;
|
|
1457
1465
|
}
|
|
1458
1466
|
export interface V1WorkflowRunDetails {
|
|
1459
1467
|
run: V1WorkflowRun;
|
package/package.json
CHANGED
package/v1/client/client.d.ts
CHANGED
|
@@ -4,14 +4,13 @@ import WorkflowRunRef from '../../util/workflow-run-ref';
|
|
|
4
4
|
import { Workflow as V0Workflow } from '../../workflow';
|
|
5
5
|
import { DurableContext } from '../../step';
|
|
6
6
|
import { Api } from '../../clients/rest';
|
|
7
|
-
import { CreateTaskWorkflowOpts, CreateWorkflowOpts, RunOpts, BaseWorkflowDeclaration, WorkflowDeclaration, TaskWorkflowDeclaration } from '../declaration';
|
|
7
|
+
import { CreateTaskWorkflowOpts, CreateWorkflowOpts, RunOpts, BaseWorkflowDeclaration, WorkflowDeclaration, TaskWorkflowDeclaration, CreateDurableTaskWorkflowOpts } from '../declaration';
|
|
8
8
|
import { IHatchetClient } from './client.interface';
|
|
9
9
|
import { CreateWorkerOpts, Worker } from './worker';
|
|
10
10
|
import { MetricsClient } from './features/metrics';
|
|
11
11
|
import { WorkersClient } from './features/workers';
|
|
12
12
|
import { WorkflowsClient } from './features/workflows';
|
|
13
13
|
import { RunsClient } from './features/runs';
|
|
14
|
-
import { CreateStandaloneDurableTaskOpts } from '../task';
|
|
15
14
|
import { InputType, OutputType, UnknownInputType, StrictWorkflowOutputType } from '../types';
|
|
16
15
|
import { RatelimitsClient } from './features';
|
|
17
16
|
/**
|
|
@@ -80,7 +79,7 @@ export declare class HatchetClient implements IHatchetClient {
|
|
|
80
79
|
* @param options Durable task configuration options
|
|
81
80
|
* @returns A TaskWorkflowDeclaration instance for a durable task
|
|
82
81
|
*/
|
|
83
|
-
durableTask<I extends InputType, O extends OutputType>(options:
|
|
82
|
+
durableTask<I extends InputType, O extends OutputType>(options: CreateDurableTaskWorkflowOpts<I, O>): TaskWorkflowDeclaration<I, O>;
|
|
84
83
|
/**
|
|
85
84
|
* Creates a new durable task workflow with types inferred from the function parameter.
|
|
86
85
|
* @template Fn The type of the durable task function with input and output extending JsonObject
|
|
@@ -89,7 +88,7 @@ export declare class HatchetClient implements IHatchetClient {
|
|
|
89
88
|
*/
|
|
90
89
|
durableTask<Fn extends (input: I, ctx: DurableContext<I>) => O | Promise<O>, I extends InputType = Parameters<Fn>[0], O extends OutputType = ReturnType<Fn> extends Promise<infer P> ? P extends OutputType ? P : void : ReturnType<Fn> extends OutputType ? ReturnType<Fn> : void>(options: {
|
|
91
90
|
fn: Fn;
|
|
92
|
-
} & Omit<
|
|
91
|
+
} & Omit<CreateDurableTaskWorkflowOpts<I, O>, 'fn'>): TaskWorkflowDeclaration<I, O>;
|
|
93
92
|
/**
|
|
94
93
|
* Triggers a workflow run without waiting for completion.
|
|
95
94
|
* @template I - The input type for the workflow
|
|
@@ -54,8 +54,7 @@ export declare class RunsClient {
|
|
|
54
54
|
tenantId: string;
|
|
55
55
|
workflows: WorkflowsClient;
|
|
56
56
|
constructor(client: HatchetClient);
|
|
57
|
-
get<T = any>(run: string | WorkflowRunRef<T>): Promise<import("../../../clients/rest/generated/data-contracts").
|
|
58
|
-
getDetails<T = any>(run: string | WorkflowRunRef<T>): Promise<import("../../../clients/rest/generated/data-contracts").WorkflowRunShape>;
|
|
57
|
+
get<T = any>(run: string | WorkflowRunRef<T>): Promise<import("../../../clients/rest/generated/data-contracts").V1WorkflowRunDetails>;
|
|
59
58
|
list(opts?: Partial<ListRunsOpts>): Promise<import("../../../clients/rest/generated/data-contracts").V1TaskSummaryList>;
|
|
60
59
|
cancel(opts: CancelRunOpts): Promise<import("axios").AxiosResponse<void, any>>;
|
|
61
60
|
replay(opts: ReplayRunOpts): Promise<import("axios").AxiosResponse<void, any>>;
|
|
@@ -22,14 +22,7 @@ class RunsClient {
|
|
|
22
22
|
get(run) {
|
|
23
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
24
|
const runId = typeof run === 'string' ? run : yield run.getWorkflowRunId();
|
|
25
|
-
const { data } = yield this.api.
|
|
26
|
-
return data;
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
getDetails(run) {
|
|
30
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
const runId = typeof run === 'string' ? run : yield run.getWorkflowRunId();
|
|
32
|
-
const { data } = yield this.api.workflowRunGetShape(this.tenantId, runId);
|
|
25
|
+
const { data } = yield this.api.v1WorkflowRunGet(runId);
|
|
33
26
|
return data;
|
|
34
27
|
});
|
|
35
28
|
}
|
package/v1/declaration.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Context, DurableContext } from '../step';
|
|
|
3
3
|
import { CronWorkflows, ScheduledWorkflows } from '../clients/rest/generated/data-contracts';
|
|
4
4
|
import { Workflow as WorkflowV0 } from '../workflow';
|
|
5
5
|
import { IHatchetClient } from './client/client.interface';
|
|
6
|
-
import { CreateWorkflowTaskOpts, CreateOnFailureTaskOpts, TaskConcurrency, TaskFn, CreateWorkflowDurableTaskOpts, CreateBaseTaskOpts, CreateOnSuccessTaskOpts } from './task';
|
|
6
|
+
import { CreateWorkflowTaskOpts, CreateOnFailureTaskOpts, TaskConcurrency, TaskFn, CreateWorkflowDurableTaskOpts, CreateBaseTaskOpts, CreateOnSuccessTaskOpts, DurableTaskFn } from './task';
|
|
7
7
|
import { Duration } from './client/duration';
|
|
8
8
|
import { MetricsClient } from './client/features/metrics';
|
|
9
9
|
import { InputType, OutputType, UnknownInputType, JsonObject } from './types';
|
|
@@ -61,6 +61,7 @@ export type CreateBaseWorkflowOpts = {
|
|
|
61
61
|
concurrency?: TaskConcurrency;
|
|
62
62
|
};
|
|
63
63
|
export type CreateTaskWorkflowOpts<I extends InputType = UnknownInputType, O extends OutputType = void> = CreateBaseWorkflowOpts & CreateBaseTaskOpts<I, O, TaskFn<I, O>>;
|
|
64
|
+
export type CreateDurableTaskWorkflowOpts<I extends InputType = UnknownInputType, O extends OutputType = void> = CreateBaseWorkflowOpts & CreateBaseTaskOpts<I, O, DurableTaskFn<I, O>>;
|
|
64
65
|
/**
|
|
65
66
|
* Options for creating a new workflow.
|
|
66
67
|
*/
|
package/v1/task.d.ts
CHANGED
|
@@ -158,19 +158,12 @@ export type CreateWorkflowTaskOpts<I extends InputType = UnknownInputType, O ext
|
|
|
158
158
|
*/
|
|
159
159
|
skipIf?: Conditions | Conditions[];
|
|
160
160
|
};
|
|
161
|
-
export type CreateStandaloneTaskOpts<I extends InputType = UnknownInputType, O extends OutputType = void, C extends TaskFn<I, O> = TaskFn<I, O>> = CreateBaseTaskOpts<I, O, C>;
|
|
162
161
|
/**
|
|
163
162
|
* Options for creating a hatchet durable task which is an atomic unit of work in a workflow.
|
|
164
163
|
* @template I The input type for the task function.
|
|
165
164
|
* @template O The return type of the task function (can be inferred from the return value of fn).
|
|
166
165
|
*/
|
|
167
166
|
export type CreateWorkflowDurableTaskOpts<I extends InputType = UnknownInputType, O extends OutputType = void, C extends DurableTaskFn<I, O> = DurableTaskFn<I, O>> = CreateWorkflowTaskOpts<I, O, C>;
|
|
168
|
-
/**
|
|
169
|
-
* Options for creating a hatchet task which is an atomic unit of work in a workflow.
|
|
170
|
-
* @template I The input type for the task function.
|
|
171
|
-
* @template O The return type of the task function (can be inferred from the return value of fn).
|
|
172
|
-
*/
|
|
173
|
-
export type CreateStandaloneDurableTaskOpts<I extends InputType = UnknownInputType, O extends OutputType = void, C extends DurableTaskFn<I, O> = DurableTaskFn<I, O>> = CreateBaseTaskOpts<I, O, C>;
|
|
174
167
|
/**
|
|
175
168
|
* Options for configuring the onSuccess task that is invoked when a task succeeds.
|
|
176
169
|
* @template I The input type for the task function.
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const HATCHET_VERSION = "1.1.
|
|
1
|
+
export declare const HATCHET_VERSION = "1.1.7";
|
package/version.js
CHANGED