chore(docs): Generated References (#8400)

Generated the following references:
- `api_key`
- `auth`
- `auth_provider`
- `cart`
- `currency`
- `customer`
- `dml`
- `file`
- `fulfillment`
- `fulfillment_provider`
- `inventory_next`
- `medusa`
- `modules`
- `modules_sdk`
- `notification`
- `order`
- `order_models`
- `payment`
- `payment_models`
- `payment_provider`
- `pricing`
- `product`
- `promotion`
- `region`
- `sales_channel`
- `stock_location_next`
- `store`
- `tax`
- `types`
- `user`
- `workflows`
This commit is contained in:
github-actions[bot] authored and GitHub committed 2024-08-02 07:05:39 +00:00
1 parent c2faca1e8b
commit 71f0d24359
336 files changed
+53078 -49461

No files matched your search

@@ -6,7 +6,7 @@ This class is used to create the response returned by a step. A step return its
## Type parameters
<TypeList types={[{"name":"TOutput","type":"`object`","description":"The type of the output of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TCompensateInput","type":"`object`","description":"The type of the compensation input. If the step doesn't specify any compensation input, then the type of `TCompensateInput` is the same\nas that of `TOutput`.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="StepResponse"/>
<TypeList types={[{"name":"TOutput","type":"`object`","description":"The type of the output of the step.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"TCompensateInput","type":"`object`","description":"The type of the compensation input. If the step doesn't specify any compensation input, then the type of `TCompensateInput` is the same\nas that of `TOutput`.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="StepResponse"/>
## Methods
@@ -19,7 +19,7 @@ The constructor of the StepResponse
### Type Parameters
<TypeList types={[{"name":"TOutput","type":"`object`","description":"The type of the output of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TCompensateInput","type":"`object`","description":"The type of the compensation input. If the step doesn't specify any compensation input, then the type of `TCompensateInput` is the same\nas that of `TOutput`.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="new StepResponse"/>
<TypeList types={[{"name":"TOutput","type":"`object`","description":"The type of the output of the step.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"TCompensateInput","type":"`object`","description":"The type of the compensation input. If the step doesn't specify any compensation input, then the type of `TCompensateInput` is the same\nas that of `TOutput`.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="new StepResponse"/>
### Parameters
@@ -6,13 +6,13 @@ 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"/>
<TypeList types={[{"name":"TResult","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"THooks","type":"`object`","description":"","optional":true,"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"/>
<TypeList types={[{"name":"TResult","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"THooks","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="new WorkflowResponse"/>
### Parameters
@@ -9,20 +9,47 @@ import { TypeList } from "docs-ui"
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.
Expose a hook in your workflow where you can inject custom functionality as a step function.
Hooks behaves like steps
A handler hook can later be registered to consume the hook and perform custom functionality.
Learn more in [this documentation](https://docs.medusajs.com/v2/advanced-development/workflows/add-workflow-hook).
## Example
```ts
import {
createStep,
createHook,
createWorkflow,
WorkflowResponse,
} from "@medusajs/workflows-sdk"
import { createProductStep } from "./steps/create-product"
export const myWorkflow = createWorkflow(
"my-workflow",
function (input) {
const product = createProductStep(input)
const productCreatedHook = createHook(
"productCreated",
{ productId: product.id }
)
return new WorkflowResponse(product, {
hooks: [productCreatedHook],
})
}
)
```
## 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"/>
<TypeList types={[{"name":"Name","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"TInvokeInput","type":"`object`","description":"","optional":true,"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"/>
<TypeList types={[{"name":"name","type":"Name","description":"The hook's name. This is used when the hook handler is registered to consume the workflow.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"input","type":"TInvokeInput","description":"The input to pass to the hook handler.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createHook"/>
## Returns
<TypeList types={[{"name":"Hook","type":"[Hook](../../types/workflows.Hook/page.mdx)&#60;Name, TInvokeInput&#62;","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"/>
<TypeList types={[{"name":"Hook","type":"[Hook](../../types/workflows.Hook/page.mdx)&#60;Name, TInvokeInput&#62;","optional":false,"defaultValue":"","description":"A workflow hook.","expandable":false,"children":[]}]} sectionTitle="createHook"/>
@@ -55,7 +55,7 @@ export const createProductStep = createStep(
## Type Parameters
<TypeList types={[{"name":"TInvokeInput","type":"`object`","description":"The type of the expected input parameter to the invocation function.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TInvokeResultOutput","type":"`object`","description":"The type of the expected output parameter of the invocation function.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TInvokeResultCompensateInput","type":"`object`","description":"The type of the expected input parameter to the compensation function.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createStep"/>
<TypeList types={[{"name":"TInvokeInput","type":"`object`","description":"The type of the expected input parameter to the invocation function.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"TInvokeResultOutput","type":"`object`","description":"The type of the expected output parameter of the invocation function.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"TInvokeResultCompensateInput","type":"`object`","description":"The type of the expected input parameter to the compensation function.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createStep"/>
## Parameters
@@ -61,7 +61,7 @@ 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":"`any`[]","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":true,"defaultValue":"","expandable":false,"children":[]},{"name":"TResult","type":"`object`","description":"The type of the output returned by the composer function.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"THooks","type":"`any`[]","description":"The type of hooks defined in the workflow.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="createWorkflow"/>
## Parameters
@@ -48,7 +48,7 @@ const myWorkflow = createWorkflow<
## Type Parameters
<TypeList types={[{"name":"TResult","type":"[WorkflowData](../../types/workflows.WorkflowData/page.mdx)[]","description":"The type of the expected result.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="parallelize"/>
<TypeList types={[{"name":"TResult","type":"[WorkflowData](../../types/workflows.WorkflowData/page.mdx)[]","description":"The type of the expected result.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="parallelize"/>
## Parameters
@@ -54,7 +54,7 @@ const myWorkflow = createWorkflow<
## Type Parameters
<TypeList types={[{"name":"T","type":"`object` \\| [WorkflowData](../../types/workflows.WorkflowData/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"RFinal","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="transform"/>
<TypeList types={[{"name":"T","type":"`object` \\| [WorkflowData](../../types/workflows.WorkflowData/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"RFinal","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="transform"/>
## Parameters
@@ -11,7 +11,7 @@ This documentation provides a reference to the `when` . It belongs to the `@medu
## Type Parameters
<TypeList types={[{"name":"T","type":"`object` \\| [WorkflowData](../../types/workflows.WorkflowData/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"Then","type":"`Function`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="when"/>
<TypeList types={[{"name":"T","type":"`object` \\| [WorkflowData](../../types/workflows.WorkflowData/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"Then","type":"`Function`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="when"/>
## Parameters
@@ -4,6 +4,6 @@ import { TypeList } from "docs-ui"
## Type parameters
<TypeList types={[{"name":"TStepInputs","type":"&#123; [K in keyof TInvokeInput]: WorkflowData&#60;TInvokeInput[K]&#62; &#125;","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":"TStepInputs","type":"&#123; [K in keyof TInvokeInput]: WorkflowData&#60;TInvokeInput[K]&#62; &#125;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"TInvokeInput","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"TInvokeResultOutput","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"TInvokeResultCompensateInput","type":"`object`","description":"","optional":true,"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)&#60;TInvokeInput, TInvokeResultOutput, TInvokeResultCompensateInput&#62;","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)&#60;TInvokeResultCompensateInput&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ApplyStepOptions"/>
@@ -8,7 +8,7 @@ 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"/>
<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":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="CompensateFn"/>
## Type declaration
@@ -8,7 +8,7 @@ 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"/>
<TypeList types={[{"name":"Name","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"Input","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="Hook"/>
## Properties
@@ -8,7 +8,7 @@ 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"/>
<TypeList types={[{"name":"TInput","type":"`object`","description":"The type of the input that the function expects.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"TOutput","type":"`object`","description":"The type of the output that the function returns.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"TCompensateInput","type":"`object`","description":"The type of the input that the compensation function expects.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="InvokeFn"/>
## Type declaration
@@ -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":"`any`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ReturnWorkflow"/>
<TypeList types={[{"name":"TData","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"TResult","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"THooks","type":"`any`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ReturnWorkflow"/>
@@ -8,4 +8,4 @@ A step function to be used in a workflow.
## Type Parameters
<TypeList types={[{"name":"TInput","type":"`object`","description":"The type of the input of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"TOutput","type":"`object`","description":"The type of the output of the step.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="StepFunction"/>
<TypeList types={[{"name":"TInput","type":"`object`","description":"The type of the input of the step.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"TOutput","type":"`object`","description":"The type of the output of the step.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="StepFunction"/>
@@ -6,7 +6,7 @@ import { TypeList } from "docs-ui"
## Type Parameters
<TypeList types={[{"name":"TOutput","type":"`unknown` \\| `unknown`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="StepFunctionResult"/>
<TypeList types={[{"name":"TOutput","type":"`unknown` \\| `unknown`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="StepFunctionResult"/>
## Type declaration
@@ -14,4 +14,4 @@ type WorkflowInputData = UnwrapWorkflowInputDataType<typeof myWorkflow>
## Type Parameters
<TypeList types={[{"name":"T","type":"[ReturnWorkflow](../workflows.ReturnWorkflow/page.mdx)&#60;any, any, any&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"runAsStep","type":"(`{\n input,\n }`: ``{ input: TData \\| [WorkflowData](../workflows.WorkflowData/page.mdx)&#60;TData&#62; }``) => ReturnType&#60;[StepFunction](../workflows.StepFunction/page.mdx)&#60;TData, TResult&#62;&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"run","type":"`<TDataOverride, TResultOverride>`(...`args`: Parameters&#60;ExportedWorkflow&#60;TData, TResult, TDataOverride, TResultOverride&#62;[\"run\"]&#62;) => ReturnType&#60;ExportedWorkflow&#60;TData, TResult, TDataOverride, TResultOverride&#62;[\"run\"]&#62;","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&#60;THooks&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="UnwrapWorkflowInputDataType"/>
<TypeList types={[{"name":"T","type":"[ReturnWorkflow](../workflows.ReturnWorkflow/page.mdx)&#60;any, any, any&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"runAsStep","type":"(`{\n input,\n }`: ``{ input: TData \\| [WorkflowData](../workflows.WorkflowData/page.mdx)&#60;TData&#62; }``) => ReturnType&#60;[StepFunction](../workflows.StepFunction/page.mdx)&#60;TData, TResult&#62;&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"run","type":"`<TDataOverride, TResultOverride>`(...`args`: Parameters&#60;ExportedWorkflow&#60;TData, TResult, TDataOverride, TResultOverride&#62;[\"run\"]&#62;) => ReturnType&#60;ExportedWorkflow&#60;TData, TResult, TDataOverride, TResultOverride&#62;[\"run\"]&#62;","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"getName","type":"() => `string`","description":"This method retrieves the workflow's name.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"(`config`: `TransactionModelOptions`) => `void`","description":"This method sets the workflow's configurations.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hooks","type":"ConvertHooksToFunctions&#60;THooks&#62;","description":"The workflow's exposed hooks, used to register a handler to consume the hook.\n\nLearn more in [this documentation](https://docs.medusajs.com/v2/advanced-development/workflows/add-workflow-hook#how-to-consume-a-hook).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="UnwrapWorkflowInputDataType"/>
@@ -8,4 +8,4 @@ This type is used to encapsulate the input or output type of all utils.
## Type Parameters
<TypeList types={[{"name":"T","type":"`object`","description":"The type of a step's input or result.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="WorkflowData"/>
<TypeList types={[{"name":"T","type":"`object`","description":"The type of a step's input or result.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="WorkflowData"/>
@@ -6,7 +6,7 @@ import { TypeList } from "docs-ui"
## Type Parameters
<TypeList types={[{"name":"T","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="WorkflowDataProperties"/>
<TypeList types={[{"name":"T","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="WorkflowDataProperties"/>
## Properties