docs-util: fix hook parameters not showing when using workflow input (#12382)
This commit is contained in:
1 parent
80007f3afd
commit
91173f3052
1 file changed
+10
-2
@@ -22,6 +22,7 @@ import {
|
|||||||
addTagsToReflection,
|
addTagsToReflection,
|
||||||
getResolvedResourcesOfStep,
|
getResolvedResourcesOfStep,
|
||||||
getUniqueStrArray,
|
getUniqueStrArray,
|
||||||
|
getWorkflowInputType,
|
||||||
} from "utils"
|
} from "utils"
|
||||||
import { StepType } from "./types.js"
|
import { StepType } from "./types.js"
|
||||||
import Examples from "./utils/examples.js"
|
import Examples from "./utils/examples.js"
|
||||||
@@ -565,9 +566,15 @@ class WorkflowsPlugin {
|
|||||||
ReflectionKind.Parameter,
|
ReflectionKind.Parameter,
|
||||||
signatureReflection
|
signatureReflection
|
||||||
)
|
)
|
||||||
|
const isParameterWorkflowInput =
|
||||||
|
inputSymbol.valueDeclaration?.kind === ts.SyntaxKind.Parameter &&
|
||||||
|
workflowReflection.signatures?.length
|
||||||
|
parameter.type = isParameterWorkflowInput
|
||||||
|
? getWorkflowInputType(workflowReflection.signatures![0]) ||
|
||||||
|
ReferenceType.createSymbolReference(inputSymbol, context)
|
||||||
|
: ReferenceType.createSymbolReference(inputSymbol, context)
|
||||||
|
|
||||||
parameter.type = ReferenceType.createSymbolReference(inputSymbol, context)
|
if (parameter.type.type === "reference") {
|
||||||
|
|
||||||
if (parameter.type.name === "__object") {
|
if (parameter.type.name === "__object") {
|
||||||
parameter.type.name = "object"
|
parameter.type.name = "object"
|
||||||
parameter.type.qualifiedName = "object"
|
parameter.type.qualifiedName = "object"
|
||||||
@@ -599,6 +606,7 @@ class WorkflowsPlugin {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
signatureReflection.parameters = []
|
signatureReflection.parameters = []
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user