chore(docs): Generated References (#8383)
Generated the following references: - `helper_steps` - `modules` - `types` - `workflows`
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# WorkflowResponse
|
||||
|
||||
Workflow response class encapsulates the return value of a workflow
|
||||
|
||||
## Type parameters
|
||||
|
||||
<TypeList types={[{"name":"TResult","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"THooks","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="WorkflowResponse"/>
|
||||
|
||||
## constructor
|
||||
|
||||
### Type Parameters
|
||||
|
||||
<TypeList types={[{"name":"TResult","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"THooks","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="new WorkflowResponse"/>
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"$result","type":"[WorkflowData](../../types/workflows.WorkflowData/page.mdx)<TResult> \\| { [K in string \\| number \\| symbol]: TResult[K] \\| WorkflowDataProperties<TResult[K]> \\| WorkflowData<TResult[K]> }","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"hooks","type":"THooks","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="new WorkflowResponse"/>
|
||||
|
||||
___
|
||||
|
||||
<TypeList types={[{"name":"__type","type":"`string`","description":"","optional":false,"defaultValue":"OrchestrationUtils.SymbolMedusaWorkflowResponse","expandable":false,"children":[]},{"name":"$result","type":"[WorkflowData](../../types/workflows.WorkflowData/page.mdx)<TResult> \\| { [K in string \\| number \\| symbol]: TResult[K] \\| WorkflowDataProperties<TResult[K]> \\| WorkflowData<TResult[K]> }","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"hooks","type":"THooks","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="WorkflowResponse"/>
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
slug: /references/workflows/createHook
|
||||
sidebar_label: createHook
|
||||
---
|
||||
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# createHook - Workflows API Reference
|
||||
|
||||
This documentation provides a reference to the `createHook` . It belongs to the `@medusajs/workflows-sdk` package.
|
||||
|
||||
Define a workflow hook to be executed within steps. The created hook
|
||||
is exposed publicly for the workflow consumers to inject and run
|
||||
custom logic.
|
||||
|
||||
Hooks behaves like steps
|
||||
|
||||
## Type Parameters
|
||||
|
||||
<TypeList types={[{"name":"Name","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TInvokeInput","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createHook"/>
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"name","type":"Name","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"input","type":"TInvokeInput","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createHook"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Hook","type":"[Hook](../../types/workflows.Hook/page.mdx)<Name, TInvokeInput>","optional":false,"defaultValue":"","description":"Define a workflow hook to be executed within steps. The created hook\nis exposed publicly for the workflow consumers to inject and run\ncustom logic.\n\nHooks behaves like steps","expandable":false,"children":[]}]} sectionTitle="createHook"/>
|
||||
@@ -59,7 +59,7 @@ export const createProductStep = createStep(
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"nameOrConfig","type":"`string` \\| `object` & Omit<TransactionStepsDefinition, \"next\" \\| \"uuid\" \\| \"action\">","description":"The name of the step or its configuration.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"invokeFn","type":"InvokeFn<TInvokeInput, TInvokeResultOutput, TInvokeResultCompensateInput>","description":"An invocation function that will be executed when the workflow is executed. The function must return an instance of [StepResponse](../../classes/workflows.StepResponse/page.mdx). The constructor of [StepResponse](../../classes/workflows.StepResponse/page.mdx)\naccepts the output of the step as a first argument, and optionally as a second argument the data to be passed to the compensation function as a parameter.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"compensateFn","type":"CompensateFn<TInvokeResultCompensateInput>","description":"A compensation function that's executed if an error occurs in the workflow. It's used to roll-back actions when errors occur.\nIt accepts as a parameter the second argument passed to the constructor of the [StepResponse](../../classes/workflows.StepResponse/page.mdx) instance returned by the invocation function. If the\ninvocation function doesn't pass the second argument to `StepResponse` constructor, the compensation function receives the first argument\npassed to the `StepResponse` constructor instead.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createStep"/>
|
||||
<TypeList types={[{"name":"nameOrConfig","type":"`string` \\| `object` & Omit<TransactionStepsDefinition, \"next\" \\| \"uuid\" \\| \"action\">","description":"The name of the step or its configuration.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"invokeFn","type":"[InvokeFn](../../types/workflows.InvokeFn/page.mdx)<TInvokeInput, TInvokeResultOutput, TInvokeResultCompensateInput>","description":"An invocation function that will be executed when the workflow is executed. The function must return an instance of [StepResponse](../../classes/workflows.StepResponse/page.mdx). The constructor of [StepResponse](../../classes/workflows.StepResponse/page.mdx)\naccepts the output of the step as a first argument, and optionally as a second argument the data to be passed to the compensation function as a parameter.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"compensateFn","type":"[CompensateFn](../../types/workflows.CompensateFn/page.mdx)<TInvokeResultCompensateInput>","description":"A compensation function that's executed if an error occurs in the workflow. It's used to roll-back actions when errors occur.\nIt accepts as a parameter the second argument passed to the constructor of the [StepResponse](../../classes/workflows.StepResponse/page.mdx) instance returned by the invocation function. If the\ninvocation function doesn't pass the second argument to `StepResponse` constructor, the compensation function receives the first argument\npassed to the `StepResponse` constructor instead.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createStep"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
@@ -61,11 +61,11 @@ export async function GET(
|
||||
|
||||
## Type Parameters
|
||||
|
||||
<TypeList types={[{"name":"TData","type":"`object`","description":"The type of the input passed to the composer function.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TResult","type":"`object`","description":"The type of the output returned by the composer function.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"THooks","type":"`Record<string, Function>`","description":"The type of hooks defined in the workflow.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createWorkflow"/>
|
||||
<TypeList types={[{"name":"TData","type":"`object`","description":"The type of the input passed to the composer function.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TResult","type":"`object`","description":"The type of the output returned by the composer function.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"THooks","type":"`any`[]","description":"The type of hooks defined in the workflow.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createWorkflow"/>
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"nameOrConfig","type":"`string` \\| `object` & `TransactionModelOptions`","description":"The name of the workflow or its configuration.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"composer","type":"(`input`: [WorkflowData](../../types/workflows.WorkflowData/page.mdx)<TData>) => `void` \\| [WorkflowData](../../types/workflows.WorkflowData/page.mdx)<TResult> \\| { [K in string \\| number \\| symbol]: TResult[K] \\| WorkflowDataProperties<TResult[K]> \\| WorkflowData<TResult[K]> }","description":"The constructor function that is executed when the `run` method in [ReturnWorkflow](../../types/workflows.ReturnWorkflow/page.mdx) is used.\nThe function can't be an arrow function or an asynchronus function. It also can't directly manipulate data.\nYou'll have to use the [transform](../workflows.transform/page.mdx) function if you need to directly manipulate data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createWorkflow"/>
|
||||
<TypeList types={[{"name":"nameOrConfig","type":"`string` \\| `object` & `TransactionModelOptions`","description":"The name of the workflow or its configuration.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"composer","type":"(`input`: [WorkflowData](../../types/workflows.WorkflowData/page.mdx)<TData>) => `void` \\| [WorkflowResponse](../../classes/workflows.WorkflowResponse/page.mdx)<TResult, THooks>","description":"The constructor function that is executed when the `run` method in [ReturnWorkflow](../../types/workflows.ReturnWorkflow/page.mdx) is used.\nThe function can't be an arrow function or an asynchronus function. It also can't directly manipulate data.\nYou'll have to use the [transform](../workflows.transform/page.mdx) function if you need to directly manipulate data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createWorkflow"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# ApplyStepOptions
|
||||
|
||||
## Type parameters
|
||||
|
||||
<TypeList types={[{"name":"TStepInputs","type":"{ [K in keyof TInvokeInput]: WorkflowData<TInvokeInput[K]> }","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TInvokeInput","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TInvokeResultOutput","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TInvokeResultCompensateInput","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ApplyStepOptions"/>
|
||||
|
||||
<TypeList types={[{"name":"stepName","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"invokeFn","type":"[InvokeFn](../../types/workflows.InvokeFn/page.mdx)<TInvokeInput, TInvokeResultOutput, TInvokeResultCompensateInput>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"stepConfig","type":"`TransactionStepsDefinition`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"input","type":"TStepInputs","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"compensateFn","type":"[CompensateFn](../../types/workflows.CompensateFn/page.mdx)<TInvokeResultCompensateInput>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ApplyStepOptions"/>
|
||||
@@ -0,0 +1,21 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# CompensateFn
|
||||
|
||||
**CompensateFn**: (`input`: T \| `undefined`, `context`: [StepExecutionContext](../../interfaces/workflows.StepExecutionContext/page.mdx)) => `unknown` \| Promise<unknown>
|
||||
|
||||
The type of compensation function passed to a step.
|
||||
|
||||
## Type Parameters
|
||||
|
||||
<TypeList types={[{"name":"T","type":"`object`","description":"The type of the argument passed to the compensation function. If not specified, then it will be the same type as the invocation function's output.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CompensateFn"/>
|
||||
|
||||
## Type declaration
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"input","type":"T \\| `undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"[StepExecutionContext](../../interfaces/workflows.StepExecutionContext/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"workflowId","type":"`string`","description":"The ID of the workflow.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"attempt","type":"`number`","description":"The attempt number of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"The idempoency key of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"stepName","type":"`string`","description":"The name of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"action","type":"`\"invoke\"` \\| `\"compensate\"`","description":"The action of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"container","type":"[MedusaContainer](../../../medusa/types/medusa.MedusaContainer/page.mdx)","description":"The container used to access resources, such as services, in the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`TransactionMetadata`","description":"Metadata passed in the input.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"[Context](../../../types/interfaces/types.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="__type"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"unknown \\| Promise<unknown>","type":"`unknown` \\| Promise<unknown>","optional":false,"defaultValue":"","description":"There's no expected type to be returned by the compensation function.","expandable":false,"children":[]}]} sectionTitle="__type"/>
|
||||
+1
-1
@@ -6,4 +6,4 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
## Properties
|
||||
|
||||
<TypeList types={[{"name":"hooks_","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hooksCallback_","type":"`Record<string, Function[]>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"workflowId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"flow","type":"`OrchestratorBuilder`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handlers","type":"`WorkflowHandler`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"stepBinder","type":"`<TOutput>`(`fn`: [StepFunctionResult](../workflows.StepFunctionResult/page.mdx)) => [WorkflowData](../workflows.WorkflowData/page.mdx)<TOutput>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hookBinder","type":"`<TOutput>`(`name`: `string`, `fn`: `Function`) => [WorkflowData](../workflows.WorkflowData/page.mdx)<TOutput>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"parallelizeBinder","type":"`<TOutput>`(`fn`: (`this`: [CreateWorkflowComposerContext](page.mdx)) => TOutput) => TOutput","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CreateWorkflowComposerContext"/>
|
||||
<TypeList types={[{"name":"__type","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hooks_","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"declared","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"registered","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"hooksCallback_","type":"`Record<string, [HookHandler](../workflows.HookHandler/page.mdx)>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"workflowId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"flow","type":"`OrchestratorBuilder`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handlers","type":"`WorkflowHandler`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"stepBinder","type":"`<TOutput>`(`fn`: [StepFunctionResult](../workflows.StepFunctionResult/page.mdx)) => [WorkflowData](../workflows.WorkflowData/page.mdx)<TOutput>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hookBinder","type":"(`name`: `string`, `fn`: () => [HookHandler](../workflows.HookHandler/page.mdx)) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"parallelizeBinder","type":"`<TOutput>`(`fn`: (`this`: [CreateWorkflowComposerContext](page.mdx)) => TOutput) => TOutput","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CreateWorkflowComposerContext"/>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# Hook
|
||||
|
||||
**Hook**: `Object`
|
||||
|
||||
Representation of a hook definition.
|
||||
|
||||
## Type Parameters
|
||||
|
||||
<TypeList types={[{"name":"Name","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"Input","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="Hook"/>
|
||||
|
||||
## Properties
|
||||
|
||||
<TypeList types={[{"name":"__type","type":"typeof `OrchestrationUtils.SymbolWorkflowHook`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"Name","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":" input","type":"Input","description":"By prefixing a key with a space, we remove it from the\nintellisense of TypeScript. This is needed because\ninput is not set at runtime. It is a type-only\nproperty to infer input data type of a hook","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="Hook"/>
|
||||
@@ -0,0 +1,15 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# HookHandler
|
||||
|
||||
**HookHandler**: (...`args`: `any`[]) => `void` \| Promise<void>
|
||||
|
||||
## Type declaration
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"args","type":"`any`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="__type"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"void \\| Promise<void>","type":"`void` \\| Promise<void>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} sectionTitle="__type"/>
|
||||
@@ -0,0 +1,21 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# InvokeFn
|
||||
|
||||
**InvokeFn**: (`input`: TInput, `context`: [StepExecutionContext](../../interfaces/workflows.StepExecutionContext/page.mdx)) => `void` \| [StepResponse](../../classes/workflows.StepResponse/page.mdx)<TOutput, TCompensateInput extends undefined ? TOutput : TCompensateInput> \| Promise<void \| [StepResponse](../../classes/workflows.StepResponse/page.mdx)<TOutput, TCompensateInput extends undefined ? TOutput : TCompensateInput>>
|
||||
|
||||
The type of invocation function passed to a step.
|
||||
|
||||
## Type Parameters
|
||||
|
||||
<TypeList types={[{"name":"TInput","type":"`object`","description":"The type of the input that the function expects.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TOutput","type":"`object`","description":"The type of the output that the function returns.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TCompensateInput","type":"`object`","description":"The type of the input that the compensation function expects.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="InvokeFn"/>
|
||||
|
||||
## Type declaration
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"input","type":"TInput","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"[StepExecutionContext](../../interfaces/workflows.StepExecutionContext/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"workflowId","type":"`string`","description":"The ID of the workflow.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"attempt","type":"`number`","description":"The attempt number of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"The idempoency key of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"stepName","type":"`string`","description":"The name of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"action","type":"`\"invoke\"` \\| `\"compensate\"`","description":"The action of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"container","type":"[MedusaContainer](../../../medusa/types/medusa.MedusaContainer/page.mdx)","description":"The container used to access resources, such as services, in the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`TransactionMetadata`","description":"Metadata passed in the input.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"[Context](../../../types/interfaces/types.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="__type"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"void \\| StepResponse<TOutput, TCompensateInput extends undefined ? TOutput : TCompensateInput> \\| Promise<void \\| StepResponse<TOutput, TCompensateInput extends undefined ? TOutput : TCompensateInput>>","type":"`void` \\| [StepResponse](../../classes/workflows.StepResponse/page.mdx)<TOutput, TCompensateInput extends undefined ? TOutput : TCompensateInput> \\| Promise<void \\| [StepResponse](../../classes/workflows.StepResponse/page.mdx)<TOutput, TCompensateInput extends undefined ? TOutput : TCompensateInput>>","optional":false,"defaultValue":"","description":"The expected output based on the type parameter `TOutput`.","expandable":false,"children":[]}]} sectionTitle="__type"/>
|
||||
@@ -2,7 +2,7 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# ReturnWorkflow
|
||||
|
||||
**ReturnWorkflow**: `<TDataOverride, TResultOverride>`(`container?`: [MedusaContainer](../../../medusa/types/medusa.MedusaContainer/page.mdx) \| ``{ __joinerConfig: [ModuleJoinerConfig](../../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerConfig/page.mdx) ; __definition: [ModuleDefinition](../../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleDefinition/page.mdx) }``[]) => Omit<LocalWorkflow, "run" \| "registerStepSuccess" \| "registerStepFailure" \| "cancel"> & ExportedWorkflow<TData, TResult, TDataOverride, TResultOverride> & THooks & `object`
|
||||
**ReturnWorkflow**: `<TDataOverride, TResultOverride>`(`container?`: [MedusaContainer](../../../medusa/types/medusa.MedusaContainer/page.mdx) \| ``{ __joinerConfig: [ModuleJoinerConfig](../../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleJoinerConfig/page.mdx) ; __definition: [ModuleDefinition](../../../types/ModulesSdkTypes/types/types.ModulesSdkTypes.ModuleDefinition/page.mdx) }``[]) => Omit<LocalWorkflow, "run" \| "registerStepSuccess" \| "registerStepFailure" \| "cancel"> & ExportedWorkflow<TData, TResult, TDataOverride, TResultOverride> & `object`
|
||||
|
||||
An exported workflow, which is the type of a workflow constructed by the [createWorkflow](../../functions/workflows.createWorkflow/page.mdx) function. The exported workflow can be invoked to create
|
||||
an executable workflow, optionally within a specified container. So, to execute the workflow, you must invoke the exported workflow, then run the
|
||||
@@ -53,4 +53,4 @@ export async function GET(
|
||||
|
||||
## Type Parameters
|
||||
|
||||
<TypeList types={[{"name":"TData","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TResult","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"THooks","type":"`Record<string, Function>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ReturnWorkflow"/>
|
||||
<TypeList types={[{"name":"TData","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TResult","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"THooks","type":"`any`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ReturnWorkflow"/>
|
||||
|
||||
@@ -12,7 +12,7 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"this","type":"[CreateWorkflowComposerContext](../workflows.CreateWorkflowComposerContext/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"hooks_","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hooksCallback_","type":"`Record<string, Function[]>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"workflowId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"flow","type":"`OrchestratorBuilder`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handlers","type":"`WorkflowHandler`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"stepBinder","type":"`<TOutput>`(`fn`: [StepFunctionResult](page.mdx)) => [WorkflowData](../workflows.WorkflowData/page.mdx)<TOutput>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hookBinder","type":"`<TOutput>`(`name`: `string`, `fn`: `Function`) => [WorkflowData](../workflows.WorkflowData/page.mdx)<TOutput>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"parallelizeBinder","type":"`<TOutput>`(`fn`: (`this`: [CreateWorkflowComposerContext](../workflows.CreateWorkflowComposerContext/page.mdx)) => TOutput) => TOutput","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="__type"/>
|
||||
<TypeList types={[{"name":"this","type":"[CreateWorkflowComposerContext](../workflows.CreateWorkflowComposerContext/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"hooks_","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hooksCallback_","type":"`Record<string, [HookHandler](../workflows.HookHandler/page.mdx)>`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"workflowId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"flow","type":"`OrchestratorBuilder`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handlers","type":"`WorkflowHandler`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"stepBinder","type":"`<TOutput>`(`fn`: [StepFunctionResult](page.mdx)) => [WorkflowData](../workflows.WorkflowData/page.mdx)<TOutput>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hookBinder","type":"(`name`: `string`, `fn`: () => [HookHandler](../workflows.HookHandler/page.mdx)) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"parallelizeBinder","type":"`<TOutput>`(`fn`: (`this`: [CreateWorkflowComposerContext](../workflows.CreateWorkflowComposerContext/page.mdx)) => TOutput) => TOutput","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="__type"/>
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
+1
-1
@@ -14,4 +14,4 @@ type WorkflowInputData = UnwrapWorkflowInputDataType<typeof myWorkflow>
|
||||
|
||||
## Type Parameters
|
||||
|
||||
<TypeList types={[{"name":"T","type":"[ReturnWorkflow](../workflows.ReturnWorkflow/page.mdx)<any, any, any>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"runAsStep","type":"(`{\n input,\n }`: ``{ input: TData \\| [WorkflowData](../workflows.WorkflowData/page.mdx)<TData> }``) => ReturnType<[StepFunction](../workflows.StepFunction/page.mdx)<TData, TResult>>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"run","type":"`<TDataOverride, TResultOverride>`(...`args`: Parameters<ExportedWorkflow<TData, TResult, TDataOverride, TResultOverride>[\"run\"]>) => ReturnType<ExportedWorkflow<TData, TResult, TDataOverride, TResultOverride>[\"run\"]>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"getName","type":"() => `string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"(`config`: `TransactionModelOptions`) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="UnwrapWorkflowInputDataType"/>
|
||||
<TypeList types={[{"name":"T","type":"[ReturnWorkflow](../workflows.ReturnWorkflow/page.mdx)<any, any, any>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"runAsStep","type":"(`{\n input,\n }`: ``{ input: TData \\| [WorkflowData](../workflows.WorkflowData/page.mdx)<TData> }``) => ReturnType<[StepFunction](../workflows.StepFunction/page.mdx)<TData, TResult>>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"run","type":"`<TDataOverride, TResultOverride>`(...`args`: Parameters<ExportedWorkflow<TData, TResult, TDataOverride, TResultOverride>[\"run\"]>) => ReturnType<ExportedWorkflow<TData, TResult, TDataOverride, TResultOverride>[\"run\"]>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"getName","type":"() => `string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"(`config`: `TransactionModelOptions`) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hooks","type":"ConvertHooksToFunctions<THooks>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="UnwrapWorkflowInputDataType"/>
|
||||
|
||||
Reference in New Issue
Block a user