chore(docs): Generated References (automated) (#9436)

Co-authored-by: kodiakhq <kodiakhq@users.noreply.github.com>
Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
This commit is contained in:
authored and GitHub committed 2024-10-03 11:03:35 +03:00
1 parent bffb36cd11
commit c536f7caf5
637 files changed
+340776 -501155

No files matched your search

@@ -23,7 +23,7 @@ import {
createHook,
createWorkflow,
WorkflowResponse,
} from "@medusajs/workflows-sdk"
} from "@medusajs/framework/workflows-sdk"
import { createProductStep } from "./steps/create-product"
export const myWorkflow = createWorkflow(
@@ -16,10 +16,8 @@ This function creates a [StepFunction](../../types/workflows.StepFunction/page.m
```ts
import {
createStep,
StepResponse,
StepExecutionContext,
WorkflowData
} from "@medusajs/workflows-sdk"
StepResponse
} from "@medusajs/framework/workflows-sdk"
interface CreateProductInput {
title: string
@@ -17,8 +17,11 @@ invoke the exported workflow, then run its `run` method.
## Example
```ts
import { createWorkflow } from "@medusajs/workflows-sdk"
import { MedusaRequest, MedusaResponse, Product } from "@medusajs/medusa"
import {
createWorkflow,
WorkflowResponse
} from "@medusajs/framework/workflows-sdk"
import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"
import {
createProductStep,
getProductStep,
@@ -29,16 +32,15 @@ interface WorkflowInput {
title: string
}
const myWorkflow = createWorkflow<
WorkflowInput,
Product
>("my-workflow", (input) => {
const myWorkflow = createWorkflow(
"my-workflow",
(input: WorkflowInput) => {
// Everything here will be executed and resolved later
// during the execution. Including the data access.
const product = createProductStep(input)
const prices = createPricesStep(product)
return getProductStep(product.id)
return new WorkflowResponse(getProductStep(product.id))
}
)
@@ -16,8 +16,9 @@ This function is used to run multiple steps in parallel. The result of each step
```ts
import {
createWorkflow,
parallelize
} from "@medusajs/workflows-sdk"
parallelize,
WorkflowResponse
} from "@medusajs/framework/workflows-sdk"
import {
createProductStep,
getProductStep,
@@ -29,10 +30,9 @@ interface WorkflowInput {
title: string
}
const myWorkflow = createWorkflow<
WorkflowInput,
Product
>("my-workflow", (input) => {
const myWorkflow = createWorkflow(
"my-workflow",
(input: WorkflowInput) => {
const product = createProductStep(input)
const [prices, productSalesChannel] = parallelize(
@@ -41,7 +41,7 @@ const myWorkflow = createWorkflow<
)
const id = product.id
return getProductStep(product.id)
return new WorkflowResponse(getProductStep(product.id))
}
)
```
@@ -23,32 +23,27 @@ If you're also retrieving the output of a hook and want to check if its value is
```ts
import {
createWorkflow,
transform
} from "@medusajs/workflows-sdk"
transform,
WorkflowResponse
} from "@medusajs/framework/workflows-sdk"
import { step1, step2 } from "./steps"
type WorkflowInput = {
name: string
}
type WorkflowOutput = {
message: string
}
const myWorkflow = createWorkflow<
WorkflowInput,
WorkflowOutput
>
("hello-world", (input) => {
const myWorkflow = createWorkflow(
"hello-world",
(input: WorkflowInput) => {
const str1 = step1(input)
const str2 = step2(input)
return transform({
const message = transform({
str1,
str2
}, (input) => ({
message: `${input.str1}${input.str2}`
}))
}, (input) => `${input.str1}${input.str2}`)
return new WorkflowResponse(message)
})
```
@@ -4,4 +4,4 @@ import { TypeList } from "docs-ui"
The step's context.
<TypeList types={[{"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-1/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":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"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":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../types/interfaces/types.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"The idempoency key of the parent step.","optional":true,"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":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="StepExecutionContext"/>
<TypeList types={[{"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-1/page.mdx)","description":"The container used to access resources, such as services, in the step.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"registerAdd","type":"`<T>`(`name`: `string`, `registration`: T) => [MedusaContainer](../../../medusa/types/medusa.MedusaContainer-1/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"createScope","type":"() => [MedusaContainer](../../../medusa/types/medusa.MedusaContainer-1/page.mdx)","description":"","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":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"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":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../types/interfaces/types.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the parent workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"parentStepIdempotencyKey","type":"`string`","description":"The idempoency key of the parent step.","optional":true,"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":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="StepExeLine truncated