diff --git a/www/apps/resources/references/core_flows/Cart/Workflows_Cart/functions/core_flows.Cart.Workflows_Cart.completeCartWorkflow/page.mdx b/www/apps/resources/references/core_flows/Cart/Workflows_Cart/functions/core_flows.Cart.Workflows_Cart.completeCartWorkflow/page.mdx index 710945b10a..86b0c92efc 100644 --- a/www/apps/resources/references/core_flows/Cart/Workflows_Cart/functions/core_flows.Cart.Workflows_Cart.completeCartWorkflow/page.mdx +++ b/www/apps/resources/references/core_flows/Cart/Workflows_Cart/functions/core_flows.Cart.Workflows_Cart.completeCartWorkflow/page.mdx @@ -29,7 +29,7 @@ You can use this workflow within your own customizations or custom workflows, al For example, in the [Subscriptions recipe](https://docs.medusajs.com/resources/recipes/subscriptions/examples/standard#create-workflow), this workflow is used within another workflow that creates a subscription order. - + ## Examples @@ -138,7 +138,7 @@ const myWorkflow = createWorkflow( ## Steps - + ## Input @@ -176,62 +176,6 @@ Handlers consuming this hook accept the following input. -### beforePaymentAuthorization - -This step is a hook that you can inject custom functionality into. - -:::note - -This hook is nested within a [when](https://docs.medusajs.com/learn/fundamentals/workflows/conditions) condition, so it may not be executed if the when condition isn't satisfied. - -::: - -#### Example - -```ts -import { completeCartWorkflow } from "@medusajs/medusa/core-flows" - -completeCartWorkflow.hooks.beforePaymentAuthorization( - (async ({}, { container }) => { - //TODO - }) -) -``` - -#### Input - -Handlers consuming this hook accept the following input. - - - -### orderCreated - -This step is a hook that you can inject custom functionality into. - -:::note - -This hook is nested within a [when](https://docs.medusajs.com/learn/fundamentals/workflows/conditions) condition, so it may not be executed if the when condition isn't satisfied. - -::: - -#### Example - -```ts -import { completeCartWorkflow } from "@medusajs/medusa/core-flows" - -completeCartWorkflow.hooks.orderCreated( - (async ({}, { container }) => { - //TODO - }) -) -``` - -#### Input - -Handlers consuming this hook accept the following input. - - - ## Emitted Events This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow. diff --git a/www/utils/packages/typedoc-plugin-workflows/src/plugin.ts b/www/utils/packages/typedoc-plugin-workflows/src/plugin.ts index 7aa13cfcbd..33d977ae68 100644 --- a/www/utils/packages/typedoc-plugin-workflows/src/plugin.ts +++ b/www/utils/packages/typedoc-plugin-workflows/src/plugin.ts @@ -303,20 +303,39 @@ class WorkflowsPlugin { if (stepType === "hook" && "symbol" in initializer.arguments[1]) { // get the hook's name from the first argument stepId = this.helper.normalizeName(initializer.arguments[0].getText()) - const hookArgumetSymbol = this.getHookArgumentSymbol({ - argument: initializer.arguments[1], - constructorFn, - }) + const shouldIgnore = ts + .getJSDocCommentsAndTags(initializer.parent) + .some((comment) => { + if (!("tags" in comment)) { + return false + } - if (hookArgumetSymbol) { - stepReflection = this.assembleHookReflection({ - stepId, - context, - inputSymbol: hookArgumetSymbol, - workflowName: workflowVarName, - workflowComments, - workflowReflection: workflowReflection.parent, + return comment.tags?.some( + (tag) => tag.tagName.getText() === "ignore" + ) }) + if (stepId === "beforePaymentAuthorization") { + console.log( + shouldIgnore, + ts.getJSDocCommentsAndTags(initializer.parent) + ) + } + if (!shouldIgnore) { + const hookArgumetSymbol = this.getHookArgumentSymbol({ + argument: initializer.arguments[1], + constructorFn, + }) + + if (hookArgumetSymbol) { + stepReflection = this.assembleHookReflection({ + stepId, + context, + inputSymbol: hookArgumetSymbol, + workflowName: workflowVarName, + workflowComments, + workflowReflection: workflowReflection.parent, + }) + } } } else { const initializerReflection = findReflectionInNamespaces(