Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Replace with "['main']" in node-class-description-outputs-wrong #195

Open
MaSpeng opened this issue Oct 14, 2024 · 0 comments
Open

Bug Replace with "['main']" in node-class-description-outputs-wrong #195

MaSpeng opened this issue Oct 14, 2024 · 0 comments

Comments

@MaSpeng
Copy link

MaSpeng commented Oct 14, 2024

The rule node-class-description-outputs-wrong required the parameter outputs to contain a entry called main.

The INodeTypeDescription interface from n8n-workflow has been updated and expects the parameter inputs to now contain Array<NodeConnectionType | INodeInputConfiguration> | ExpressionString.

NodeConnectionType is a enum which contains Main as property and is declared as:

export declare const enum NodeConnectionType {
    AiAgent = "ai_agent",
    AiChain = "ai_chain",
    AiDocument = "ai_document",
    AiEmbedding = "ai_embedding",
    AiLanguageModel = "ai_languageModel",
    AiMemory = "ai_memory",
    AiOutputParser = "ai_outputParser",
    AiRetriever = "ai_retriever",
    AiTextSplitter = "ai_textSplitter",
    AiTool = "ai_tool",
    AiVectorStore = "ai_vectorStore",
    Main = "main"
}

This means that:

export class Foo implements INodeType {
  description: INodeTypeDescription = {
    // ...
    outputs: ['Main'],
    // ...
  }
}

Has to be changed to:

export class Foo implements INodeType {
  description: INodeTypeDescription = {
    // ...
    outputs: [NodeConnectionType.Main],
    // ...
  }
}

This should be reflected by the rule/autofixer, depending on the existence of the mentioned const.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant