chore: update imports in tsdocs (#9379)
This commit is contained in:
@@ -35,7 +35,7 @@ export type Hook<Name extends string, Input> = {
|
||||
* createHook,
|
||||
* createWorkflow,
|
||||
* WorkflowResponse,
|
||||
* } from "@medusajs/workflows-sdk"
|
||||
* } from "@medusajs/framework/workflows-sdk"
|
||||
* import { createProductStep } from "./steps/create-product"
|
||||
*
|
||||
* export const myWorkflow = createWorkflow(
|
||||
|
||||
@@ -311,10 +311,8 @@ function wrapConditionalStep(
|
||||
* @example
|
||||
* import {
|
||||
* createStep,
|
||||
* StepResponse,
|
||||
* StepExecutionContext,
|
||||
* WorkflowData
|
||||
* } from "@medusajs/workflows-sdk"
|
||||
* StepResponse
|
||||
* } from "@medusajs/framework/workflows-sdk"
|
||||
*
|
||||
* interface CreateProductInput {
|
||||
* title: string
|
||||
|
||||
@@ -34,8 +34,11 @@ global[OrchestrationUtils.SymbolMedusaWorkflowComposerContext] = null
|
||||
* @returns The created workflow. You can later execute the workflow by invoking it, then using its `run` method.
|
||||
*
|
||||
* @example
|
||||
* 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,
|
||||
@@ -46,16 +49,15 @@ global[OrchestrationUtils.SymbolMedusaWorkflowComposerContext] = null
|
||||
* 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))
|
||||
* }
|
||||
* )
|
||||
*
|
||||
|
||||
@@ -11,8 +11,9 @@ import { OrchestrationUtils } from "@medusajs/utils"
|
||||
* @example
|
||||
* import {
|
||||
* createWorkflow,
|
||||
* parallelize
|
||||
* } from "@medusajs/workflows-sdk"
|
||||
* parallelize,
|
||||
* WorkflowResponse
|
||||
* } from "@medusajs/framework/workflows-sdk"
|
||||
* import {
|
||||
* createProductStep,
|
||||
* getProductStep,
|
||||
@@ -24,10 +25,9 @@ import { OrchestrationUtils } from "@medusajs/utils"
|
||||
* 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(
|
||||
@@ -36,7 +36,7 @@ import { OrchestrationUtils } from "@medusajs/utils"
|
||||
* )
|
||||
*
|
||||
* const id = product.id
|
||||
* return getProductStep(product.id)
|
||||
* return new WorkflowResponse(getProductStep(product.id))
|
||||
* }
|
||||
* )
|
||||
*/
|
||||
|
||||
@@ -30,32 +30,27 @@ type Func<T, U> = (input: T, context: StepExecutionContext) => U | Promise<U>
|
||||
* @example
|
||||
* 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)
|
||||
* })
|
||||
*/
|
||||
// prettier-ignore
|
||||
|
||||
Reference in New Issue
Block a user