Skip to content

Commit

Permalink
Merge branch 'develop' into fix/calculate-prices-type
Browse files Browse the repository at this point in the history
  • Loading branch information
riqwan authored Nov 24, 2023
2 parents 7ab28d9 + ffb0c7b commit dadcb16
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/real-ears-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/workflows-sdk": patch
---

Expose getName method to the workflow
20 changes: 12 additions & 8 deletions packages/workflows-sdk/src/utils/composer/create-workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import {
WorkflowManager,
} from "@medusajs/orchestration"
import { LoadedModule, MedusaContainer } from "@medusajs/types"
import { exportWorkflow, FlowRunOptions, WorkflowResult } from "../../helper"
import { FlowRunOptions, WorkflowResult, exportWorkflow } from "../../helper"
import {
CreateWorkflowComposerContext,
WorkflowData,
WorkflowDataProperties,
} from "./type"
import {
resolveValue,
SymbolInputReference,
SymbolMedusaWorkflowComposerContext,
SymbolWorkflowStep,
resolveValue,
} from "./helpers"
import { proxify } from "./helpers/proxy"
import {
CreateWorkflowComposerContext,
WorkflowData,
WorkflowDataProperties,
} from "./type"

global[SymbolMedusaWorkflowComposerContext] = null

Expand Down Expand Up @@ -81,7 +81,9 @@ type ReturnWorkflow<TData, TResult, THooks extends Record<string, Function>> = {
>
>
}
} & THooks
} & THooks & {
getName: () => string
}

/**
* This function creates a workflow with the provided name and a constructor function.
Expand Down Expand Up @@ -259,5 +261,7 @@ export function createWorkflow<
}
}

mainFlow.getName = () => name

return mainFlow as ReturnWorkflow<TData, TResult, THooks>
}

0 comments on commit dadcb16

Please sign in to comment.