@mastra/inngest 0.0.0-custom-instrumentation-20250626084921 → 0.0.0-fix-generate-title-20250616171351
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 +3 -99
- package/dist/_tsup-dts-rollup.d.cts +17 -51
- package/dist/_tsup-dts-rollup.d.ts +17 -51
- package/dist/index.cjs +18 -225
- package/dist/index.js +18 -225
- package/package.json +8 -8
- package/src/index.test.ts +132 -1478
- package/src/index.ts +28 -305
package/CHANGELOG.md
CHANGED
|
@@ -1,96 +1,6 @@
|
|
|
1
1
|
# @mastra/inngest
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Updated dependencies [a344ac7]
|
|
8
|
-
- @mastra/core@0.0.0-custom-instrumentation-20250626084921
|
|
9
|
-
|
|
10
|
-
## 0.11.0
|
|
11
|
-
|
|
12
|
-
### Minor Changes
|
|
13
|
-
|
|
14
|
-
- 8a3bfd2: Update peerdeps to latest core
|
|
15
|
-
|
|
16
|
-
### Patch Changes
|
|
17
|
-
|
|
18
|
-
- 8e1b6e9: dependencies updates:
|
|
19
|
-
- Updated dependency [`zod@^3.25.67` ↗︎](https://www.npmjs.com/package/zod/v/3.25.67) (from `^3.25.57`, in `dependencies`)
|
|
20
|
-
- 9d52b17: Fix inngest workflows streaming and add step metadata
|
|
21
|
-
- 4fb0cc2: Type safe variable mapping
|
|
22
|
-
- 502fe05: createRun() -> createRunAsync()
|
|
23
|
-
- 4efcfa0: Added bail() method and more ergonomic suspend function return value
|
|
24
|
-
- Updated dependencies [15e9d26]
|
|
25
|
-
- Updated dependencies [d1baedb]
|
|
26
|
-
- Updated dependencies [d8f2d19]
|
|
27
|
-
- Updated dependencies [4d21bf2]
|
|
28
|
-
- Updated dependencies [07d6d88]
|
|
29
|
-
- Updated dependencies [9d52b17]
|
|
30
|
-
- Updated dependencies [2097952]
|
|
31
|
-
- Updated dependencies [792c4c0]
|
|
32
|
-
- Updated dependencies [5d74aab]
|
|
33
|
-
- Updated dependencies [a8b194f]
|
|
34
|
-
- Updated dependencies [4fb0cc2]
|
|
35
|
-
- Updated dependencies [d2a7a31]
|
|
36
|
-
- Updated dependencies [502fe05]
|
|
37
|
-
- Updated dependencies [144eb0b]
|
|
38
|
-
- Updated dependencies [8ba1b51]
|
|
39
|
-
- Updated dependencies [4efcfa0]
|
|
40
|
-
- Updated dependencies [0e17048]
|
|
41
|
-
- @mastra/core@0.10.7
|
|
42
|
-
|
|
43
|
-
## 0.11.0-alpha.3
|
|
44
|
-
|
|
45
|
-
### Minor Changes
|
|
46
|
-
|
|
47
|
-
- 8a3bfd2: Update peerdeps to latest core
|
|
48
|
-
|
|
49
|
-
### Patch Changes
|
|
50
|
-
|
|
51
|
-
- 502fe05: createRun() -> createRunAsync()
|
|
52
|
-
- 4efcfa0: Added bail() method and more ergonomic suspend function return value
|
|
53
|
-
- Updated dependencies [792c4c0]
|
|
54
|
-
- Updated dependencies [502fe05]
|
|
55
|
-
- Updated dependencies [4efcfa0]
|
|
56
|
-
- @mastra/core@0.10.7-alpha.3
|
|
57
|
-
|
|
58
|
-
## 0.10.6-alpha.2
|
|
59
|
-
|
|
60
|
-
### Patch Changes
|
|
61
|
-
|
|
62
|
-
- 8e1b6e9: dependencies updates:
|
|
63
|
-
- Updated dependency [`zod@^3.25.67` ↗︎](https://www.npmjs.com/package/zod/v/3.25.67) (from `^3.25.57`, in `dependencies`)
|
|
64
|
-
- Updated dependencies [15e9d26]
|
|
65
|
-
- Updated dependencies [07d6d88]
|
|
66
|
-
- Updated dependencies [5d74aab]
|
|
67
|
-
- Updated dependencies [144eb0b]
|
|
68
|
-
- @mastra/core@0.10.7-alpha.2
|
|
69
|
-
|
|
70
|
-
## 0.10.6-alpha.1
|
|
71
|
-
|
|
72
|
-
### Patch Changes
|
|
73
|
-
|
|
74
|
-
- 4fb0cc2: Type safe variable mapping
|
|
75
|
-
- Updated dependencies [d1baedb]
|
|
76
|
-
- Updated dependencies [4d21bf2]
|
|
77
|
-
- Updated dependencies [2097952]
|
|
78
|
-
- Updated dependencies [4fb0cc2]
|
|
79
|
-
- Updated dependencies [d2a7a31]
|
|
80
|
-
- Updated dependencies [0e17048]
|
|
81
|
-
- @mastra/core@0.10.7-alpha.1
|
|
82
|
-
|
|
83
|
-
## 0.10.6-alpha.0
|
|
84
|
-
|
|
85
|
-
### Patch Changes
|
|
86
|
-
|
|
87
|
-
- 9d52b17: Fix inngest workflows streaming and add step metadata
|
|
88
|
-
- Updated dependencies [d8f2d19]
|
|
89
|
-
- Updated dependencies [9d52b17]
|
|
90
|
-
- Updated dependencies [8ba1b51]
|
|
91
|
-
- @mastra/core@0.10.7-alpha.0
|
|
92
|
-
|
|
93
|
-
## 0.10.5
|
|
3
|
+
## 0.0.0-fix-generate-title-20250616171351
|
|
94
4
|
|
|
95
5
|
### Patch Changes
|
|
96
6
|
|
|
@@ -99,21 +9,15 @@
|
|
|
99
9
|
- Updated dependency [`zod@^3.25.57` ↗︎](https://www.npmjs.com/package/zod/v/3.25.57) (from `^3.25.56`, in `dependencies`)
|
|
100
10
|
- ee9af57: Add api for polling run execution result and get run by id
|
|
101
11
|
- Updated dependencies [63f6b7d]
|
|
102
|
-
- Updated dependencies [
|
|
103
|
-
- Updated dependencies [4b0f8a6]
|
|
104
|
-
- Updated dependencies [51264a5]
|
|
105
|
-
- Updated dependencies [8e6f677]
|
|
106
|
-
- Updated dependencies [d70c420]
|
|
12
|
+
- Updated dependencies [9d56287]
|
|
107
13
|
- Updated dependencies [ee9af57]
|
|
108
14
|
- Updated dependencies [36f1c36]
|
|
109
|
-
- Updated dependencies [2a16996]
|
|
110
15
|
- Updated dependencies [10d352e]
|
|
111
|
-
- Updated dependencies [9589624]
|
|
112
16
|
- Updated dependencies [53d3c37]
|
|
113
17
|
- Updated dependencies [751c894]
|
|
114
18
|
- Updated dependencies [577ce3a]
|
|
115
19
|
- Updated dependencies [9260b3a]
|
|
116
|
-
- @mastra/core@0.
|
|
20
|
+
- @mastra/core@0.0.0-fix-generate-title-20250616171351
|
|
117
21
|
|
|
118
22
|
## 0.10.5-alpha.1
|
|
119
23
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Agent } from '@mastra/core';
|
|
2
2
|
import type { BaseContext } from 'inngest';
|
|
3
3
|
import { ClientOptions } from 'inngest';
|
|
4
4
|
import { DefaultExecutionEngine } from '@mastra/core/workflows';
|
|
5
|
-
import type { Emitter } from '@mastra/core/workflows';
|
|
6
5
|
import type { ExecuteFunction } from '@mastra/core/workflows';
|
|
7
6
|
import type { ExecutionContext } from '@mastra/core/workflows';
|
|
8
7
|
import type { ExecutionEngine } from '@mastra/core/workflows';
|
|
@@ -12,7 +11,6 @@ import type { Inngest } from 'inngest';
|
|
|
12
11
|
import { InngestFunction } from 'inngest';
|
|
13
12
|
import { InngestMiddleware } from 'inngest';
|
|
14
13
|
import type { Mastra } from '@mastra/core';
|
|
15
|
-
import type { ReadableStream as ReadableStream_2 } from 'node:stream/web';
|
|
16
14
|
import { Run } from '@mastra/core/workflows';
|
|
17
15
|
import { RuntimeContext } from '@mastra/core/di';
|
|
18
16
|
import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
|
|
@@ -21,8 +19,7 @@ import type { Span } from '@opentelemetry/api';
|
|
|
21
19
|
import type { Step } from '@mastra/core/workflows';
|
|
22
20
|
import type { StepFlowEntry } from '@mastra/core/workflows';
|
|
23
21
|
import type { StepResult } from '@mastra/core/workflows';
|
|
24
|
-
import
|
|
25
|
-
import { Tool } from '@mastra/core/tools';
|
|
22
|
+
import { Tool } from '@mastra/core';
|
|
26
23
|
import type { ToolExecutionContext } from '@mastra/core';
|
|
27
24
|
import type { WatchEvent } from '@mastra/core/workflows';
|
|
28
25
|
import { Workflow } from '@mastra/core/workflows';
|
|
@@ -60,9 +57,9 @@ export declare function init(inngest: Inngest): {
|
|
|
60
57
|
cloneStep<TStepId extends string>(step: Step<string, any, any, any, any, InngestEngineType>, opts: {
|
|
61
58
|
id: TStepId;
|
|
62
59
|
}): Step<TStepId, any, any, any, any, InngestEngineType>;
|
|
63
|
-
cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TOutput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TSteps extends Step<string, any, any, any, any, InngestEngineType>[] = Step<string, any, any, any, any, InngestEngineType>[]
|
|
60
|
+
cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TOutput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TSteps extends Step<string, any, any, any, any, InngestEngineType>[] = Step<string, any, any, any, any, InngestEngineType>[]>(workflow: Workflow<InngestEngineType, TSteps, string, TInput, TOutput, TInput>, opts: {
|
|
64
61
|
id: TWorkflowId;
|
|
65
|
-
}): Workflow<InngestEngineType, TSteps, TWorkflowId, TInput, TOutput,
|
|
62
|
+
}): Workflow<InngestEngineType, TSteps, TWorkflowId, TInput, TOutput, TInput>;
|
|
66
63
|
};
|
|
67
64
|
|
|
68
65
|
export declare type InngestEngineType = {
|
|
@@ -73,26 +70,9 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
73
70
|
private inngestStep;
|
|
74
71
|
private inngestAttempts;
|
|
75
72
|
constructor(mastra: Mastra, inngestStep: BaseContext<Inngest>['step'], inngestAttempts?: number);
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
graph: ExecutionGraph;
|
|
80
|
-
serializedStepGraph: SerializedStepFlowEntry[];
|
|
81
|
-
input?: TInput;
|
|
82
|
-
resume?: {
|
|
83
|
-
steps: string[];
|
|
84
|
-
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
85
|
-
resumePayload: any;
|
|
86
|
-
resumePath: number[];
|
|
87
|
-
};
|
|
88
|
-
emitter: Emitter;
|
|
89
|
-
retryConfig?: {
|
|
90
|
-
attempts?: number;
|
|
91
|
-
delay?: number;
|
|
92
|
-
};
|
|
93
|
-
runtimeContext: RuntimeContext;
|
|
94
|
-
}): Promise<TOutput>;
|
|
95
|
-
protected fmtReturnValue<TOutput>(executionSpan: Span | undefined, emitter: Emitter, stepResults: Record<string, StepResult<any, any, any, any>>, lastOutput: StepResult<any, any, any, any>, error?: Error | string): Promise<TOutput>;
|
|
73
|
+
protected fmtReturnValue<TOutput>(executionSpan: Span | undefined, emitter: {
|
|
74
|
+
emit: (event: string, data: any) => Promise<void>;
|
|
75
|
+
}, stepResults: Record<string, StepResult<any, any, any, any>>, lastOutput: StepResult<any, any, any, any>, error?: Error | string): Promise<TOutput>;
|
|
96
76
|
superExecuteStep({ workflowId, runId, step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
97
77
|
workflowId: string;
|
|
98
78
|
runId: string;
|
|
@@ -104,17 +84,15 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
104
84
|
resumePayload: any;
|
|
105
85
|
};
|
|
106
86
|
prevOutput: any;
|
|
107
|
-
emitter:
|
|
87
|
+
emitter: {
|
|
88
|
+
emit: (event: string, data: any) => Promise<void>;
|
|
89
|
+
};
|
|
108
90
|
runtimeContext: RuntimeContext;
|
|
109
91
|
}): Promise<StepResult<any, any, any, any>>;
|
|
110
92
|
executeSleep({ id, duration }: {
|
|
111
93
|
id: string;
|
|
112
94
|
duration: number;
|
|
113
95
|
}): Promise<void>;
|
|
114
|
-
executeWaitForEvent({ event, timeout }: {
|
|
115
|
-
event: string;
|
|
116
|
-
timeout?: number;
|
|
117
|
-
}): Promise<any>;
|
|
118
96
|
executeStep({ step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
119
97
|
step: Step<string, any, any>;
|
|
120
98
|
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
@@ -134,7 +112,9 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
134
112
|
runId?: string;
|
|
135
113
|
};
|
|
136
114
|
prevOutput: any;
|
|
137
|
-
emitter:
|
|
115
|
+
emitter: {
|
|
116
|
+
emit: (event: string, data: any) => Promise<void>;
|
|
117
|
+
};
|
|
138
118
|
runtimeContext: RuntimeContext;
|
|
139
119
|
}): Promise<StepResult<any, any, any, any>>;
|
|
140
120
|
persistStepUpdate({ workflowId, runId, stepResults, executionContext, serializedStepGraph, workflowStatus, result, error, }: {
|
|
@@ -166,7 +146,9 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
166
146
|
resumePath: number[];
|
|
167
147
|
};
|
|
168
148
|
executionContext: ExecutionContext;
|
|
169
|
-
emitter:
|
|
149
|
+
emitter: {
|
|
150
|
+
emit: (event: string, data: any) => Promise<void>;
|
|
151
|
+
};
|
|
170
152
|
runtimeContext: RuntimeContext;
|
|
171
153
|
}): Promise<StepResult<any, any, any, any>>;
|
|
172
154
|
}
|
|
@@ -190,7 +172,6 @@ export declare class InngestRun<TEngineType = InngestEngineType, TSteps extends
|
|
|
190
172
|
}, inngest: Inngest);
|
|
191
173
|
getRuns(eventId: string): Promise<any>;
|
|
192
174
|
getRunOutput(eventId: string): Promise<any>;
|
|
193
|
-
sendEvent(event: string, data: any): Promise<void>;
|
|
194
175
|
start({ inputData, }: {
|
|
195
176
|
inputData?: z.infer<TInput>;
|
|
196
177
|
runtimeContext?: RuntimeContext;
|
|
@@ -200,19 +181,7 @@ export declare class InngestRun<TEngineType = InngestEngineType, TSteps extends
|
|
|
200
181
|
step: Step<string, any, any, TResumeSchema, any> | [...Step<string, any, any, any, any>[], Step<string, any, any, TResumeSchema, any>] | string | string[];
|
|
201
182
|
runtimeContext?: RuntimeContext;
|
|
202
183
|
}): Promise<WorkflowResult<TOutput, TSteps>>;
|
|
203
|
-
|
|
204
|
-
resumeData?: z.infer<TResumeSchema>;
|
|
205
|
-
step: Step<string, any, any, TResumeSchema, any> | [...Step<string, any, any, any, any>[], Step<string, any, any, TResumeSchema, any>] | string | string[];
|
|
206
|
-
runtimeContext?: RuntimeContext;
|
|
207
|
-
}): Promise<WorkflowResult<TOutput, TSteps>>;
|
|
208
|
-
watch(cb: (event: WatchEvent) => void, type?: 'watch' | 'watch-v2'): () => void;
|
|
209
|
-
stream({ inputData, runtimeContext }?: {
|
|
210
|
-
inputData?: z.infer<TInput>;
|
|
211
|
-
runtimeContext?: RuntimeContext;
|
|
212
|
-
}): {
|
|
213
|
-
stream: ReadableStream_2<StreamEvent>;
|
|
214
|
-
getWorkflowState: () => Promise<WorkflowResult<TOutput, TSteps>>;
|
|
215
|
-
};
|
|
184
|
+
watch(cb: (event: any) => void): () => void;
|
|
216
185
|
}
|
|
217
186
|
|
|
218
187
|
export declare class InngestWorkflow<TEngineType = InngestEngineType, TSteps extends Step<string, any, any>[] = Step<string, any, any>[], TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TPrevSchema extends z.ZodType<any> = TInput> extends Workflow<TEngineType, TSteps, TWorkflowId, TInput, TOutput, TPrevSchema> {
|
|
@@ -233,9 +202,6 @@ export declare class InngestWorkflow<TEngineType = InngestEngineType, TSteps ext
|
|
|
233
202
|
createRun(options?: {
|
|
234
203
|
runId?: string;
|
|
235
204
|
}): Run<TEngineType, TSteps, TInput, TOutput>;
|
|
236
|
-
createRunAsync(options?: {
|
|
237
|
-
runId?: string;
|
|
238
|
-
}): Promise<Run<TEngineType, TSteps, TInput, TOutput>>;
|
|
239
205
|
getFunction(): InngestFunction<Omit<InngestFunction.Options<Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
|
|
240
206
|
cron: string;
|
|
241
207
|
} & Partial<Record<"event" | "if", never>>] | [{
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Agent } from '@mastra/core';
|
|
2
2
|
import type { BaseContext } from 'inngest';
|
|
3
3
|
import { ClientOptions } from 'inngest';
|
|
4
4
|
import { DefaultExecutionEngine } from '@mastra/core/workflows';
|
|
5
|
-
import type { Emitter } from '@mastra/core/workflows';
|
|
6
5
|
import type { ExecuteFunction } from '@mastra/core/workflows';
|
|
7
6
|
import type { ExecutionContext } from '@mastra/core/workflows';
|
|
8
7
|
import type { ExecutionEngine } from '@mastra/core/workflows';
|
|
@@ -12,7 +11,6 @@ import type { Inngest } from 'inngest';
|
|
|
12
11
|
import { InngestFunction } from 'inngest';
|
|
13
12
|
import { InngestMiddleware } from 'inngest';
|
|
14
13
|
import type { Mastra } from '@mastra/core';
|
|
15
|
-
import type { ReadableStream as ReadableStream_2 } from 'node:stream/web';
|
|
16
14
|
import { Run } from '@mastra/core/workflows';
|
|
17
15
|
import { RuntimeContext } from '@mastra/core/di';
|
|
18
16
|
import type { SerializedStepFlowEntry } from '@mastra/core/workflows';
|
|
@@ -21,8 +19,7 @@ import type { Span } from '@opentelemetry/api';
|
|
|
21
19
|
import type { Step } from '@mastra/core/workflows';
|
|
22
20
|
import type { StepFlowEntry } from '@mastra/core/workflows';
|
|
23
21
|
import type { StepResult } from '@mastra/core/workflows';
|
|
24
|
-
import
|
|
25
|
-
import { Tool } from '@mastra/core/tools';
|
|
22
|
+
import { Tool } from '@mastra/core';
|
|
26
23
|
import type { ToolExecutionContext } from '@mastra/core';
|
|
27
24
|
import type { WatchEvent } from '@mastra/core/workflows';
|
|
28
25
|
import { Workflow } from '@mastra/core/workflows';
|
|
@@ -60,9 +57,9 @@ export declare function init(inngest: Inngest): {
|
|
|
60
57
|
cloneStep<TStepId extends string>(step: Step<string, any, any, any, any, InngestEngineType>, opts: {
|
|
61
58
|
id: TStepId;
|
|
62
59
|
}): Step<TStepId, any, any, any, any, InngestEngineType>;
|
|
63
|
-
cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TOutput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TSteps extends Step<string, any, any, any, any, InngestEngineType>[] = Step<string, any, any, any, any, InngestEngineType>[]
|
|
60
|
+
cloneWorkflow<TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TOutput extends z.ZodType<any> = z.ZodType<any, z.ZodTypeDef, any>, TSteps extends Step<string, any, any, any, any, InngestEngineType>[] = Step<string, any, any, any, any, InngestEngineType>[]>(workflow: Workflow<InngestEngineType, TSteps, string, TInput, TOutput, TInput>, opts: {
|
|
64
61
|
id: TWorkflowId;
|
|
65
|
-
}): Workflow<InngestEngineType, TSteps, TWorkflowId, TInput, TOutput,
|
|
62
|
+
}): Workflow<InngestEngineType, TSteps, TWorkflowId, TInput, TOutput, TInput>;
|
|
66
63
|
};
|
|
67
64
|
|
|
68
65
|
export declare type InngestEngineType = {
|
|
@@ -73,26 +70,9 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
73
70
|
private inngestStep;
|
|
74
71
|
private inngestAttempts;
|
|
75
72
|
constructor(mastra: Mastra, inngestStep: BaseContext<Inngest>['step'], inngestAttempts?: number);
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
graph: ExecutionGraph;
|
|
80
|
-
serializedStepGraph: SerializedStepFlowEntry[];
|
|
81
|
-
input?: TInput;
|
|
82
|
-
resume?: {
|
|
83
|
-
steps: string[];
|
|
84
|
-
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
85
|
-
resumePayload: any;
|
|
86
|
-
resumePath: number[];
|
|
87
|
-
};
|
|
88
|
-
emitter: Emitter;
|
|
89
|
-
retryConfig?: {
|
|
90
|
-
attempts?: number;
|
|
91
|
-
delay?: number;
|
|
92
|
-
};
|
|
93
|
-
runtimeContext: RuntimeContext;
|
|
94
|
-
}): Promise<TOutput>;
|
|
95
|
-
protected fmtReturnValue<TOutput>(executionSpan: Span | undefined, emitter: Emitter, stepResults: Record<string, StepResult<any, any, any, any>>, lastOutput: StepResult<any, any, any, any>, error?: Error | string): Promise<TOutput>;
|
|
73
|
+
protected fmtReturnValue<TOutput>(executionSpan: Span | undefined, emitter: {
|
|
74
|
+
emit: (event: string, data: any) => Promise<void>;
|
|
75
|
+
}, stepResults: Record<string, StepResult<any, any, any, any>>, lastOutput: StepResult<any, any, any, any>, error?: Error | string): Promise<TOutput>;
|
|
96
76
|
superExecuteStep({ workflowId, runId, step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
97
77
|
workflowId: string;
|
|
98
78
|
runId: string;
|
|
@@ -104,17 +84,15 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
104
84
|
resumePayload: any;
|
|
105
85
|
};
|
|
106
86
|
prevOutput: any;
|
|
107
|
-
emitter:
|
|
87
|
+
emitter: {
|
|
88
|
+
emit: (event: string, data: any) => Promise<void>;
|
|
89
|
+
};
|
|
108
90
|
runtimeContext: RuntimeContext;
|
|
109
91
|
}): Promise<StepResult<any, any, any, any>>;
|
|
110
92
|
executeSleep({ id, duration }: {
|
|
111
93
|
id: string;
|
|
112
94
|
duration: number;
|
|
113
95
|
}): Promise<void>;
|
|
114
|
-
executeWaitForEvent({ event, timeout }: {
|
|
115
|
-
event: string;
|
|
116
|
-
timeout?: number;
|
|
117
|
-
}): Promise<any>;
|
|
118
96
|
executeStep({ step, stepResults, executionContext, resume, prevOutput, emitter, runtimeContext, }: {
|
|
119
97
|
step: Step<string, any, any>;
|
|
120
98
|
stepResults: Record<string, StepResult<any, any, any, any>>;
|
|
@@ -134,7 +112,9 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
134
112
|
runId?: string;
|
|
135
113
|
};
|
|
136
114
|
prevOutput: any;
|
|
137
|
-
emitter:
|
|
115
|
+
emitter: {
|
|
116
|
+
emit: (event: string, data: any) => Promise<void>;
|
|
117
|
+
};
|
|
138
118
|
runtimeContext: RuntimeContext;
|
|
139
119
|
}): Promise<StepResult<any, any, any, any>>;
|
|
140
120
|
persistStepUpdate({ workflowId, runId, stepResults, executionContext, serializedStepGraph, workflowStatus, result, error, }: {
|
|
@@ -166,7 +146,9 @@ export declare class InngestExecutionEngine extends DefaultExecutionEngine {
|
|
|
166
146
|
resumePath: number[];
|
|
167
147
|
};
|
|
168
148
|
executionContext: ExecutionContext;
|
|
169
|
-
emitter:
|
|
149
|
+
emitter: {
|
|
150
|
+
emit: (event: string, data: any) => Promise<void>;
|
|
151
|
+
};
|
|
170
152
|
runtimeContext: RuntimeContext;
|
|
171
153
|
}): Promise<StepResult<any, any, any, any>>;
|
|
172
154
|
}
|
|
@@ -190,7 +172,6 @@ export declare class InngestRun<TEngineType = InngestEngineType, TSteps extends
|
|
|
190
172
|
}, inngest: Inngest);
|
|
191
173
|
getRuns(eventId: string): Promise<any>;
|
|
192
174
|
getRunOutput(eventId: string): Promise<any>;
|
|
193
|
-
sendEvent(event: string, data: any): Promise<void>;
|
|
194
175
|
start({ inputData, }: {
|
|
195
176
|
inputData?: z.infer<TInput>;
|
|
196
177
|
runtimeContext?: RuntimeContext;
|
|
@@ -200,19 +181,7 @@ export declare class InngestRun<TEngineType = InngestEngineType, TSteps extends
|
|
|
200
181
|
step: Step<string, any, any, TResumeSchema, any> | [...Step<string, any, any, any, any>[], Step<string, any, any, TResumeSchema, any>] | string | string[];
|
|
201
182
|
runtimeContext?: RuntimeContext;
|
|
202
183
|
}): Promise<WorkflowResult<TOutput, TSteps>>;
|
|
203
|
-
|
|
204
|
-
resumeData?: z.infer<TResumeSchema>;
|
|
205
|
-
step: Step<string, any, any, TResumeSchema, any> | [...Step<string, any, any, any, any>[], Step<string, any, any, TResumeSchema, any>] | string | string[];
|
|
206
|
-
runtimeContext?: RuntimeContext;
|
|
207
|
-
}): Promise<WorkflowResult<TOutput, TSteps>>;
|
|
208
|
-
watch(cb: (event: WatchEvent) => void, type?: 'watch' | 'watch-v2'): () => void;
|
|
209
|
-
stream({ inputData, runtimeContext }?: {
|
|
210
|
-
inputData?: z.infer<TInput>;
|
|
211
|
-
runtimeContext?: RuntimeContext;
|
|
212
|
-
}): {
|
|
213
|
-
stream: ReadableStream_2<StreamEvent>;
|
|
214
|
-
getWorkflowState: () => Promise<WorkflowResult<TOutput, TSteps>>;
|
|
215
|
-
};
|
|
184
|
+
watch(cb: (event: any) => void): () => void;
|
|
216
185
|
}
|
|
217
186
|
|
|
218
187
|
export declare class InngestWorkflow<TEngineType = InngestEngineType, TSteps extends Step<string, any, any>[] = Step<string, any, any>[], TWorkflowId extends string = string, TInput extends z.ZodType<any> = z.ZodType<any>, TOutput extends z.ZodType<any> = z.ZodType<any>, TPrevSchema extends z.ZodType<any> = TInput> extends Workflow<TEngineType, TSteps, TWorkflowId, TInput, TOutput, TPrevSchema> {
|
|
@@ -233,9 +202,6 @@ export declare class InngestWorkflow<TEngineType = InngestEngineType, TSteps ext
|
|
|
233
202
|
createRun(options?: {
|
|
234
203
|
runId?: string;
|
|
235
204
|
}): Run<TEngineType, TSteps, TInput, TOutput>;
|
|
236
|
-
createRunAsync(options?: {
|
|
237
|
-
runId?: string;
|
|
238
|
-
}): Promise<Run<TEngineType, TSteps, TInput, TOutput>>;
|
|
239
205
|
getFunction(): InngestFunction<Omit<InngestFunction.Options<Inngest<ClientOptions>, InngestMiddleware.Stack, InngestFunction.Trigger<string>[] | [{
|
|
240
206
|
cron: string;
|
|
241
207
|
} & Partial<Record<"event" | "if", never>>] | [{
|