@output.ai/core 0.1.14 → 0.1.15
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/package.json
CHANGED
|
@@ -25,10 +25,9 @@ export function workflow( { name, description, inputSchema, outputSchema, fn, op
|
|
|
25
25
|
const steps = proxyActivities( activityOptions );
|
|
26
26
|
|
|
27
27
|
const wrapper = async input => {
|
|
28
|
-
validateWithSchema( inputSchema, input, `Workflow ${name} input` );
|
|
29
|
-
|
|
30
28
|
// this returns a plain function, for example, in unit tests
|
|
31
29
|
if ( !inWorkflowContext() ) {
|
|
30
|
+
validateWithSchema( inputSchema, input, `Workflow ${name} input` );
|
|
32
31
|
const output = await fn( input );
|
|
33
32
|
validateWithSchema( outputSchema, output, `Workflow ${name} output` );
|
|
34
33
|
return output;
|
|
@@ -53,6 +52,9 @@ export function workflow( { name, description, inputSchema, outputSchema, fn, op
|
|
|
53
52
|
activityOptions: memo.activityOptions ?? activityOptions // Also preserve the original activity options
|
|
54
53
|
} );
|
|
55
54
|
|
|
55
|
+
// validation comes after setting memo to have that info already set for interceptor even if validations fail
|
|
56
|
+
validateWithSchema( inputSchema, input, `Workflow ${name} input` );
|
|
57
|
+
|
|
56
58
|
// binds the methods called in the code that Webpack loader will add, they will exposed via "this"
|
|
57
59
|
const output = await fn.call( {
|
|
58
60
|
invokeStep: async ( stepName, input, options ) => steps[`${workflowPath}#${stepName}`]( input, options ),
|