Skip to content

Commit e94977f

Browse files
committed
feat: export NodeSchema interface and update generateNodeSchemas to include nodeId
1 parent 3dc9652 commit e94977f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/schema/getSignatureSchema.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import { getSchema, Schema } from "../util/schema.util"
77
* Represents the schema information for a node parameter.
88
* Includes the parameter's schema definition and any parameter dependencies that block it.
99
*/
10-
interface NodeSchema {
10+
export interface NodeSchema {
11+
nodeId: NodeFunction["id"]
1112
/** The schema definition for this node parameter */
1213
schema: Schema
1314
/** Array of parameter indices that must be resolved before this parameter */
@@ -96,6 +97,7 @@ export const getSignatureSchema = (
9697

9798
// Generate schema for each parameter
9899
return generateNodeSchemas(
100+
nodeId,
99101
checker,
100102
node!,
101103
combinedParameterTypes,
@@ -289,6 +291,7 @@ const getParameterDependencies = (node: ts.FunctionDeclaration): ParameterDepend
289291
* Generates node schemas for all parameters.
290292
* Creates schema objects for each parameter with their dependencies.
291293
*
294+
* @param nodeId -
292295
* @param checker - The TypeScript type checker
293296
* @param node - The node's variable declaration
294297
* @param combinedParameterTypes - Merged parameter types to use for schema generation
@@ -298,6 +301,7 @@ const getParameterDependencies = (node: ts.FunctionDeclaration): ParameterDepend
298301
* @returns Array of NodeSchema objects
299302
*/
300303
const generateNodeSchemas = (
304+
nodeId: NodeFunction["id"],
301305
checker: ts.TypeChecker,
302306
node: ts.VariableDeclaration,
303307
combinedParameterTypes: Type[] | undefined,
@@ -310,6 +314,7 @@ const generateNodeSchemas = (
310314
}
311315

312316
return combinedParameterTypes.map((parameterType, index) => ({
317+
nodeId: nodeId,
313318
schema: getSchema(
314319
checker,
315320
node,

0 commit comments

Comments
 (0)