@workflow/core 4.0.1-beta.9 → 4.1.0-beta.52
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/builtins.js +1 -1
- package/dist/class-serialization.d.ts +26 -0
- package/dist/class-serialization.d.ts.map +1 -0
- package/dist/class-serialization.js +66 -0
- package/dist/create-hook.js +1 -1
- package/dist/define-hook.d.ts +40 -25
- package/dist/define-hook.d.ts.map +1 -1
- package/dist/define-hook.js +22 -27
- package/dist/events-consumer.d.ts.map +1 -1
- package/dist/events-consumer.js +5 -1
- package/dist/flushable-stream.d.ts +82 -0
- package/dist/flushable-stream.d.ts.map +1 -0
- package/dist/flushable-stream.js +214 -0
- package/dist/global.d.ts +4 -1
- package/dist/global.d.ts.map +1 -1
- package/dist/global.js +21 -9
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/logger.js +1 -1
- package/dist/observability.d.ts +60 -0
- package/dist/observability.d.ts.map +1 -1
- package/dist/observability.js +265 -32
- package/dist/private.d.ts +10 -1
- package/dist/private.d.ts.map +1 -1
- package/dist/private.js +6 -1
- package/dist/runtime/helpers.d.ts +52 -0
- package/dist/runtime/helpers.d.ts.map +1 -0
- package/dist/runtime/helpers.js +264 -0
- package/dist/runtime/resume-hook.d.ts +17 -12
- package/dist/runtime/resume-hook.d.ts.map +1 -1
- package/dist/runtime/resume-hook.js +79 -64
- package/dist/runtime/run.d.ts +100 -0
- package/dist/runtime/run.d.ts.map +1 -0
- package/dist/runtime/run.js +132 -0
- package/dist/runtime/start.d.ts +15 -1
- package/dist/runtime/start.d.ts.map +1 -1
- package/dist/runtime/start.js +72 -46
- package/dist/runtime/step-handler.d.ts +7 -0
- package/dist/runtime/step-handler.d.ts.map +1 -0
- package/dist/runtime/step-handler.js +337 -0
- package/dist/runtime/suspension-handler.d.ts +25 -0
- package/dist/runtime/suspension-handler.d.ts.map +1 -0
- package/dist/runtime/suspension-handler.js +182 -0
- package/dist/runtime/world.d.ts.map +1 -1
- package/dist/runtime/world.js +20 -21
- package/dist/runtime.d.ts +4 -105
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +97 -531
- package/dist/schemas.d.ts +1 -15
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +2 -15
- package/dist/serialization.d.ts +112 -21
- package/dist/serialization.d.ts.map +1 -1
- package/dist/serialization.js +469 -85
- package/dist/sleep.d.ts +10 -0
- package/dist/sleep.d.ts.map +1 -1
- package/dist/sleep.js +1 -1
- package/dist/source-map.d.ts +10 -0
- package/dist/source-map.d.ts.map +1 -0
- package/dist/source-map.js +56 -0
- package/dist/step/context-storage.d.ts +2 -1
- package/dist/step/context-storage.d.ts.map +1 -1
- package/dist/step/context-storage.js +1 -1
- package/dist/step/get-closure-vars.d.ts +9 -0
- package/dist/step/get-closure-vars.d.ts.map +1 -0
- package/dist/step/get-closure-vars.js +16 -0
- package/dist/step/get-step-metadata.js +1 -1
- package/dist/step/get-workflow-metadata.js +1 -1
- package/dist/step/writable-stream.d.ts +10 -2
- package/dist/step/writable-stream.d.ts.map +1 -1
- package/dist/step/writable-stream.js +6 -5
- package/dist/step.d.ts +1 -1
- package/dist/step.d.ts.map +1 -1
- package/dist/step.js +93 -47
- package/dist/symbols.d.ts +6 -0
- package/dist/symbols.d.ts.map +1 -1
- package/dist/symbols.js +7 -1
- package/dist/telemetry/semantic-conventions.d.ts +66 -38
- package/dist/telemetry/semantic-conventions.d.ts.map +1 -1
- package/dist/telemetry/semantic-conventions.js +16 -3
- package/dist/telemetry.d.ts +8 -4
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +39 -6
- package/dist/types.js +1 -1
- package/dist/util.d.ts +5 -24
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +19 -38
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/vm/index.js +2 -2
- package/dist/vm/uuid.js +1 -1
- package/dist/workflow/create-hook.js +1 -1
- package/dist/workflow/define-hook.d.ts +3 -3
- package/dist/workflow/define-hook.d.ts.map +1 -1
- package/dist/workflow/define-hook.js +1 -1
- package/dist/workflow/get-workflow-metadata.js +1 -1
- package/dist/workflow/hook.d.ts.map +1 -1
- package/dist/workflow/hook.js +49 -14
- package/dist/workflow/index.d.ts +1 -1
- package/dist/workflow/index.d.ts.map +1 -1
- package/dist/workflow/index.js +2 -2
- package/dist/workflow/sleep.d.ts +1 -1
- package/dist/workflow/sleep.d.ts.map +1 -1
- package/dist/workflow/sleep.js +26 -39
- package/dist/workflow/writable-stream.d.ts +1 -1
- package/dist/workflow/writable-stream.d.ts.map +1 -1
- package/dist/workflow/writable-stream.js +1 -1
- package/dist/workflow.d.ts +1 -1
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +72 -9
- package/docs/api-reference/create-hook.mdx +134 -0
- package/docs/api-reference/create-webhook.mdx +226 -0
- package/docs/api-reference/define-hook.mdx +207 -0
- package/docs/api-reference/fatal-error.mdx +38 -0
- package/docs/api-reference/fetch.mdx +140 -0
- package/docs/api-reference/get-step-metadata.mdx +77 -0
- package/docs/api-reference/get-workflow-metadata.mdx +45 -0
- package/docs/api-reference/get-writable.mdx +292 -0
- package/docs/api-reference/index.mdx +56 -0
- package/docs/api-reference/meta.json +3 -0
- package/docs/api-reference/retryable-error.mdx +107 -0
- package/docs/api-reference/sleep.mdx +60 -0
- package/docs/foundations/common-patterns.mdx +254 -0
- package/docs/foundations/errors-and-retries.mdx +191 -0
- package/docs/foundations/hooks.mdx +456 -0
- package/docs/foundations/idempotency.mdx +56 -0
- package/docs/foundations/index.mdx +33 -0
- package/docs/foundations/meta.json +14 -0
- package/docs/foundations/serialization.mdx +158 -0
- package/docs/foundations/starting-workflows.mdx +212 -0
- package/docs/foundations/streaming.mdx +570 -0
- package/docs/foundations/workflows-and-steps.mdx +198 -0
- package/docs/how-it-works/code-transform.mdx +335 -0
- package/docs/how-it-works/event-sourcing.mdx +255 -0
- package/docs/how-it-works/framework-integrations.mdx +438 -0
- package/docs/how-it-works/meta.json +10 -0
- package/docs/how-it-works/understanding-directives.mdx +612 -0
- package/package.json +31 -25
- package/dist/builtins.js.map +0 -1
- package/dist/create-hook.js.map +0 -1
- package/dist/define-hook.js.map +0 -1
- package/dist/events-consumer.js.map +0 -1
- package/dist/global.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/logger.js.map +0 -1
- package/dist/observability.js.map +0 -1
- package/dist/parse-name.d.ts +0 -25
- package/dist/parse-name.d.ts.map +0 -1
- package/dist/parse-name.js +0 -40
- package/dist/parse-name.js.map +0 -1
- package/dist/private.js.map +0 -1
- package/dist/runtime/resume-hook.js.map +0 -1
- package/dist/runtime/start.js.map +0 -1
- package/dist/runtime/world.js.map +0 -1
- package/dist/runtime.js.map +0 -1
- package/dist/schemas.js.map +0 -1
- package/dist/serialization.js.map +0 -1
- package/dist/sleep.js.map +0 -1
- package/dist/step/context-storage.js.map +0 -1
- package/dist/step/get-step-metadata.js.map +0 -1
- package/dist/step/get-workflow-metadata.js.map +0 -1
- package/dist/step/writable-stream.js.map +0 -1
- package/dist/step.js.map +0 -1
- package/dist/symbols.js.map +0 -1
- package/dist/telemetry/semantic-conventions.js.map +0 -1
- package/dist/telemetry.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/util.js.map +0 -1
- package/dist/vm/index.js.map +0 -1
- package/dist/vm/uuid.js.map +0 -1
- package/dist/workflow/create-hook.js.map +0 -1
- package/dist/workflow/define-hook.js.map +0 -1
- package/dist/workflow/get-workflow-metadata.js.map +0 -1
- package/dist/workflow/hook.js.map +0 -1
- package/dist/workflow/index.js.map +0 -1
- package/dist/workflow/sleep.js.map +0 -1
- package/dist/workflow/writable-stream.js.map +0 -1
- package/dist/workflow.js.map +0 -1
- package/dist/writable-stream.d.ts +0 -23
- package/dist/writable-stream.d.ts.map +0 -1
- package/dist/writable-stream.js +0 -17
- package/dist/writable-stream.js.map +0 -1
package/dist/schemas.d.ts
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const WorkflowInvokePayloadSchema: z.ZodObject<{
|
|
3
|
-
runId: z.ZodString;
|
|
4
|
-
traceCarrier: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
5
|
-
}, z.core.$strip>;
|
|
6
|
-
export declare const StepInvokePayloadSchema: z.ZodObject<{
|
|
7
|
-
workflowName: z.ZodString;
|
|
8
|
-
workflowRunId: z.ZodString;
|
|
9
|
-
workflowStartedAt: z.ZodNumber;
|
|
10
|
-
stepId: z.ZodString;
|
|
11
|
-
traceCarrier: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
12
|
-
}, z.core.$strip>;
|
|
13
|
-
export type WorkflowInvokePayload = z.infer<typeof WorkflowInvokePayloadSchema>;
|
|
14
|
-
export type StepInvokePayload = z.infer<typeof StepInvokePayloadSchema>;
|
|
15
1
|
/**
|
|
16
2
|
* A serializable value:
|
|
17
3
|
* Any valid JSON object is serializable
|
|
@@ -25,5 +11,5 @@ export type StepInvokePayload = z.infer<typeof StepInvokePayloadSchema>;
|
|
|
25
11
|
*/
|
|
26
12
|
export type Serializable = string | number | boolean | null | undefined | Serializable[] | {
|
|
27
13
|
[key: string]: Serializable;
|
|
28
|
-
} | ArrayBuffer | bigint | BigInt64Array | BigUint64Array | Date | Float32Array | Float64Array | Headers | Int8Array | Int16Array | Int32Array | Map<Serializable, Serializable> | ReadableStream<Uint8Array> | RegExp | Response | Set<Serializable> | URL | URLSearchParams | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | WritableStream<Uint8Array
|
|
14
|
+
} | ArrayBuffer | bigint | BigInt64Array | BigUint64Array | Date | Float32Array | Float64Array | Headers | Int8Array | Int16Array | Int32Array | Map<Serializable, Serializable> | ReadableStream<Uint8Array> | RegExp | Response | Set<Serializable> | URL | URLSearchParams | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | WritableStream<Uint8Array> | ((...args: Serializable[]) => Promise<Serializable>);
|
|
29
15
|
//# sourceMappingURL=schemas.d.ts.map
|
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY,GAEpB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,GACT,YAAY,EAAE,GACd;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAA;CAAE,GAG/B,WAAW,GACX,MAAM,GACN,aAAa,GACb,cAAc,GACd,IAAI,GACJ,YAAY,GACZ,YAAY,GACZ,OAAO,GACP,SAAS,GACT,UAAU,GACV,UAAU,GACV,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC,GAC/B,cAAc,CAAC,UAAU,CAAC,GAC1B,MAAM,GACN,QAAQ,GACR,GAAG,CAAC,YAAY,CAAC,GACjB,GAAG,GACH,eAAe,GACf,UAAU,GACV,iBAAiB,GACjB,WAAW,GACX,WAAW,GACX,cAAc,CAAC,UAAU,CAAC,GAC1B,CAAC,CAAC,GAAG,IAAI,EAAE,YAAY,EAAE,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC"}
|
package/dist/schemas.js
CHANGED
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const TraceCarrierSchema = z.record(z.string(), z.string());
|
|
4
|
-
export const WorkflowInvokePayloadSchema = z.object({
|
|
5
|
-
runId: z.string(),
|
|
6
|
-
traceCarrier: TraceCarrierSchema.optional(),
|
|
7
|
-
});
|
|
8
|
-
export const StepInvokePayloadSchema = z.object({
|
|
9
|
-
workflowName: z.string(),
|
|
10
|
-
workflowRunId: z.string(),
|
|
11
|
-
workflowStartedAt: z.number(),
|
|
12
|
-
stepId: z.string(),
|
|
13
|
-
traceCarrier: TraceCarrierSchema.optional(),
|
|
14
|
-
});
|
|
15
|
-
//# sourceMappingURL=schemas.js.map
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NoZW1hcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9zY2hlbWFzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
|
package/dist/serialization.d.ts
CHANGED
|
@@ -1,4 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Known serialization format identifiers.
|
|
3
|
+
* Each format ID is exactly 4 ASCII characters, matching the convention
|
|
4
|
+
* used for other workflow IDs (wrun, step, wait, etc.)
|
|
5
|
+
*/
|
|
6
|
+
export declare const SerializationFormat: {
|
|
7
|
+
/** devalue stringify/parse with TextEncoder/TextDecoder */
|
|
8
|
+
readonly DEVALUE_V1: "devl";
|
|
9
|
+
};
|
|
10
|
+
export type SerializationFormatType = (typeof SerializationFormat)[keyof typeof SerializationFormat];
|
|
11
|
+
/**
|
|
12
|
+
* Encode a payload with a format prefix.
|
|
13
|
+
*
|
|
14
|
+
* @param format - The format identifier (must be exactly 4 ASCII characters)
|
|
15
|
+
* @param payload - The serialized payload bytes
|
|
16
|
+
* @returns A new Uint8Array with format prefix prepended
|
|
17
|
+
*/
|
|
18
|
+
export declare function encodeWithFormatPrefix(format: SerializationFormatType, payload: Uint8Array | unknown): Uint8Array | unknown;
|
|
19
|
+
/**
|
|
20
|
+
* Decode a format-prefixed payload.
|
|
21
|
+
*
|
|
22
|
+
* @param data - The format-prefixed data
|
|
23
|
+
* @returns An object with the format identifier and payload
|
|
24
|
+
* @throws Error if the data is too short or has an unknown format
|
|
25
|
+
*/
|
|
26
|
+
export declare function decodeFormatPrefix(data: Uint8Array | unknown): {
|
|
27
|
+
format: SerializationFormatType;
|
|
28
|
+
payload: Uint8Array;
|
|
29
|
+
};
|
|
2
30
|
/**
|
|
3
31
|
* Detect if a readable stream is a byte stream.
|
|
4
32
|
*
|
|
@@ -13,7 +41,7 @@ export declare class WorkflowServerReadableStream extends ReadableStream<Uint8Ar
|
|
|
13
41
|
constructor(name: string, startIndex?: number);
|
|
14
42
|
}
|
|
15
43
|
export declare class WorkflowServerWritableStream extends WritableStream<Uint8Array> {
|
|
16
|
-
constructor(name: string);
|
|
44
|
+
constructor(name: string, runId: string | Promise<string>);
|
|
17
45
|
}
|
|
18
46
|
export interface SerializableSpecial {
|
|
19
47
|
ArrayBuffer: string;
|
|
@@ -57,7 +85,22 @@ export interface SerializableSpecial {
|
|
|
57
85
|
body: Response['body'];
|
|
58
86
|
redirected: boolean;
|
|
59
87
|
};
|
|
88
|
+
Class: {
|
|
89
|
+
classId: string;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Custom serialized class instance.
|
|
93
|
+
* The class must have a `classId` property and be registered for deserialization.
|
|
94
|
+
*/
|
|
95
|
+
Instance: {
|
|
96
|
+
classId: string;
|
|
97
|
+
data: unknown;
|
|
98
|
+
};
|
|
60
99
|
Set: any[];
|
|
100
|
+
StepFunction: {
|
|
101
|
+
stepId: string;
|
|
102
|
+
closureVars?: Record<string, any>;
|
|
103
|
+
};
|
|
61
104
|
URL: string;
|
|
62
105
|
URLSearchParams: string;
|
|
63
106
|
Uint8Array: string;
|
|
@@ -82,7 +125,7 @@ type Revivers = {
|
|
|
82
125
|
* @param ops
|
|
83
126
|
* @returns
|
|
84
127
|
*/
|
|
85
|
-
export declare function getExternalReducers(global: Record<string, any> | undefined, ops: Promise<
|
|
128
|
+
export declare function getExternalReducers(global: Record<string, any> | undefined, ops: Promise<void>[], runId: string | Promise<string>): Reducers;
|
|
86
129
|
/**
|
|
87
130
|
* Reducers for serialization boundary from within the workflow execution
|
|
88
131
|
* environment, passing return value to the client side and into step arguments.
|
|
@@ -91,14 +134,52 @@ export declare function getExternalReducers(global: Record<string, any> | undefi
|
|
|
91
134
|
* @returns
|
|
92
135
|
*/
|
|
93
136
|
export declare function getWorkflowReducers(global?: Record<string, any>): Reducers;
|
|
137
|
+
export declare function getCommonRevivers(global?: Record<string, any>): {
|
|
138
|
+
readonly ArrayBuffer: (value: string) => any;
|
|
139
|
+
readonly BigInt: (value: string) => any;
|
|
140
|
+
readonly BigInt64Array: (value: string) => any;
|
|
141
|
+
readonly BigUint64Array: (value: string) => any;
|
|
142
|
+
readonly Date: (value: string) => any;
|
|
143
|
+
readonly Error: (value: Record<string, any>) => any;
|
|
144
|
+
readonly Float32Array: (value: string) => any;
|
|
145
|
+
readonly Float64Array: (value: string) => any;
|
|
146
|
+
readonly Headers: (value: [string, string][]) => any;
|
|
147
|
+
readonly Int8Array: (value: string) => any;
|
|
148
|
+
readonly Int16Array: (value: string) => any;
|
|
149
|
+
readonly Int32Array: (value: string) => any;
|
|
150
|
+
readonly Map: (value: [any, any][]) => any;
|
|
151
|
+
readonly RegExp: (value: {
|
|
152
|
+
source: string;
|
|
153
|
+
flags: string;
|
|
154
|
+
}) => any;
|
|
155
|
+
readonly Class: (value: {
|
|
156
|
+
classId: string;
|
|
157
|
+
}) => Function;
|
|
158
|
+
readonly Instance: (value: {
|
|
159
|
+
classId: string;
|
|
160
|
+
data: unknown;
|
|
161
|
+
}) => any;
|
|
162
|
+
readonly Set: (value: any[]) => any;
|
|
163
|
+
readonly StepFunction: (value: {
|
|
164
|
+
stepId: string;
|
|
165
|
+
closureVars?: Record<string, any>;
|
|
166
|
+
}) => any;
|
|
167
|
+
readonly URL: (value: string) => any;
|
|
168
|
+
readonly URLSearchParams: (value: string) => any;
|
|
169
|
+
readonly Uint8Array: (value: string) => any;
|
|
170
|
+
readonly Uint8ClampedArray: (value: string) => any;
|
|
171
|
+
readonly Uint16Array: (value: string) => any;
|
|
172
|
+
readonly Uint32Array: (value: string) => any;
|
|
173
|
+
};
|
|
94
174
|
/**
|
|
95
175
|
* Revivers for deserialization boundary from the client side,
|
|
96
176
|
* receiving the return value from the workflow handler.
|
|
97
177
|
*
|
|
98
178
|
* @param global
|
|
99
179
|
* @param ops
|
|
180
|
+
* @param runId
|
|
100
181
|
*/
|
|
101
|
-
export declare function getExternalRevivers(global: Record<string, any> | undefined, ops: Promise<
|
|
182
|
+
export declare function getExternalRevivers(global: Record<string, any> | undefined, ops: Promise<void>[], runId: string | Promise<string>): Revivers;
|
|
102
183
|
/**
|
|
103
184
|
* Revivers for deserialization boundary from within the workflow execution
|
|
104
185
|
* environment, receiving arguments from the client side, and return values
|
|
@@ -115,38 +196,42 @@ export declare function getWorkflowRevivers(global?: Record<string, any>): Reviv
|
|
|
115
196
|
*
|
|
116
197
|
* @param value
|
|
117
198
|
* @param global
|
|
118
|
-
* @
|
|
199
|
+
* @param runId
|
|
200
|
+
* @returns The dehydrated value as binary data (Uint8Array) with format prefix
|
|
119
201
|
*/
|
|
120
|
-
export declare function dehydrateWorkflowArguments(value: unknown, ops: Promise<
|
|
202
|
+
export declare function dehydrateWorkflowArguments(value: unknown, ops: Promise<void>[], runId: string | Promise<string>, global?: Record<string, any>, v1Compat?: boolean): Uint8Array | unknown;
|
|
121
203
|
/**
|
|
122
204
|
* Called from workflow execution environment to hydrate the workflow
|
|
123
205
|
* arguments from the database at the start of workflow execution.
|
|
124
206
|
*
|
|
125
|
-
* @param value
|
|
126
|
-
* @param ops
|
|
207
|
+
* @param value - Binary serialized data (Uint8Array) with format prefix
|
|
127
208
|
* @param global
|
|
209
|
+
* @param extraRevivers
|
|
128
210
|
* @returns The hydrated value
|
|
129
211
|
*/
|
|
130
|
-
export declare function hydrateWorkflowArguments(value:
|
|
212
|
+
export declare function hydrateWorkflowArguments(value: Uint8Array | unknown, global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>): any;
|
|
131
213
|
/**
|
|
132
214
|
* Called at the end of a completed workflow execution to serialize the
|
|
133
215
|
* return value into a format that can be saved to the database.
|
|
134
216
|
*
|
|
135
217
|
* @param value
|
|
136
218
|
* @param global
|
|
137
|
-
* @returns The dehydrated value
|
|
219
|
+
* @returns The dehydrated value as binary data (Uint8Array) with format prefix
|
|
138
220
|
*/
|
|
139
|
-
export declare function dehydrateWorkflowReturnValue(value: unknown, global?: Record<string, any
|
|
221
|
+
export declare function dehydrateWorkflowReturnValue(value: unknown, global?: Record<string, any>, v1Compat?: boolean): Uint8Array | unknown;
|
|
140
222
|
/**
|
|
141
223
|
* Called from the client side (i.e. the execution environment where
|
|
142
224
|
* the workflow run was initiated from) to hydrate the workflow
|
|
143
225
|
* return value of a completed workflow run.
|
|
144
226
|
*
|
|
145
|
-
* @param value
|
|
227
|
+
* @param value - Binary serialized data (Uint8Array) with format prefix
|
|
228
|
+
* @param ops
|
|
146
229
|
* @param global
|
|
230
|
+
* @param extraRevivers
|
|
231
|
+
* @param runId
|
|
147
232
|
* @returns The hydrated return value, ready to be consumed by the client
|
|
148
233
|
*/
|
|
149
|
-
export declare function hydrateWorkflowReturnValue(value:
|
|
234
|
+
export declare function hydrateWorkflowReturnValue(value: Uint8Array | unknown, ops: Promise<void>[], runId: string | Promise<string>, global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>): any;
|
|
150
235
|
/**
|
|
151
236
|
* Called from the workflow handler when a step is being created.
|
|
152
237
|
* Dehydrates values from within the workflow execution environment
|
|
@@ -154,36 +239,42 @@ export declare function hydrateWorkflowReturnValue(value: Parameters<typeof deva
|
|
|
154
239
|
*
|
|
155
240
|
* @param value
|
|
156
241
|
* @param global
|
|
157
|
-
* @returns The dehydrated value
|
|
242
|
+
* @returns The dehydrated value as binary data (Uint8Array) with format prefix
|
|
158
243
|
*/
|
|
159
|
-
export declare function dehydrateStepArguments(value: unknown, global: Record<string, any
|
|
244
|
+
export declare function dehydrateStepArguments(value: unknown, global: Record<string, any>, v1Compat?: boolean): Uint8Array | unknown;
|
|
160
245
|
/**
|
|
161
246
|
* Called from the step handler to hydrate the arguments of a step
|
|
162
247
|
* from the database at the start of the step execution.
|
|
163
248
|
*
|
|
164
|
-
* @param value
|
|
249
|
+
* @param value - Binary serialized data (Uint8Array) with format prefix
|
|
250
|
+
* @param ops
|
|
165
251
|
* @param global
|
|
252
|
+
* @param extraRevivers
|
|
253
|
+
* @param runId
|
|
166
254
|
* @returns The hydrated value, ready to be consumed by the step user-code function
|
|
167
255
|
*/
|
|
168
|
-
export declare function hydrateStepArguments(value:
|
|
256
|
+
export declare function hydrateStepArguments(value: Uint8Array | unknown, ops: Promise<any>[], runId: string | Promise<string>, global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>): any;
|
|
169
257
|
/**
|
|
170
258
|
* Called from the step handler when a step has completed.
|
|
171
259
|
* Dehydrates values from within the step execution environment
|
|
172
260
|
* into a format that can be saved to the database.
|
|
173
261
|
*
|
|
174
262
|
* @param value
|
|
263
|
+
* @param ops
|
|
175
264
|
* @param global
|
|
176
|
-
* @
|
|
265
|
+
* @param runId
|
|
266
|
+
* @returns The dehydrated value as binary data (Uint8Array) with format prefix
|
|
177
267
|
*/
|
|
178
|
-
export declare function dehydrateStepReturnValue(value: unknown, ops: Promise<any>[], global?: Record<string, any
|
|
268
|
+
export declare function dehydrateStepReturnValue(value: unknown, ops: Promise<any>[], runId: string | Promise<string>, global?: Record<string, any>, v1Compat?: boolean): Uint8Array | unknown;
|
|
179
269
|
/**
|
|
180
270
|
* Called from the workflow handler when replaying the event log of a `step_completed` event.
|
|
181
271
|
* Hydrates the return value of a step from the database.
|
|
182
272
|
*
|
|
183
|
-
* @param value
|
|
273
|
+
* @param value - Binary serialized data (Uint8Array) with format prefix
|
|
184
274
|
* @param global
|
|
275
|
+
* @param extraRevivers
|
|
185
276
|
* @returns The hydrated return value of a step, ready to be consumed by the workflow handler
|
|
186
277
|
*/
|
|
187
|
-
export declare function hydrateStepReturnValue(value:
|
|
278
|
+
export declare function hydrateStepReturnValue(value: Uint8Array | unknown, global?: Record<string, any>, extraRevivers?: Record<string, (value: any) => any>): any;
|
|
188
279
|
export {};
|
|
189
280
|
//# sourceMappingURL=serialization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../src/serialization.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../src/serialization.ts"],"names":[],"mappings":"AA6CA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;IAC9B,2DAA2D;;CAEnD,CAAC;AAEX,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAWjE;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,uBAAuB,EAC/B,OAAO,EAAE,UAAU,GAAG,OAAO,GAC5B,UAAU,GAAG,OAAO,CAgBtB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,GAAG;IAC9D,MAAM,EAAE,uBAAuB,CAAC;IAChC,OAAO,EAAE,UAAU,CAAC;CACrB,CA6BA;AAoCD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,GAAG,SAAS,CAMzE;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,QAAQ,GACjB,eAAe,CAAC,GAAG,EAAE,UAAU,CAAC,CAkBlC;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,QAAQ,GACjB,eAAe,CAAC,UAAU,EAAE,GAAG,CAAC,CA6BlC;AAED,qBAAa,4BAA6B,SAAQ,cAAc,CAAC,UAAU,CAAC;;gBAG9D,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;CA8B9C;AAED,qBAAa,4BAA6B,SAAQ,cAAc,CAAC,UAAU,CAAC;gBAC9D,IAAI,EAAE,MAAM,E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