mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix: Set '@typescript-eslint/return-await' rule to 'always' for node code (no-changelog) (#8363)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -252,15 +252,15 @@ export class Agent implements INodeType {
|
||||
const agentType = this.getNodeParameter('agent', 0, '') as string;
|
||||
|
||||
if (agentType === 'conversationalAgent') {
|
||||
return conversationalAgentExecute.call(this);
|
||||
return await conversationalAgentExecute.call(this);
|
||||
} else if (agentType === 'openAiFunctionsAgent') {
|
||||
return openAiFunctionsAgentExecute.call(this);
|
||||
return await openAiFunctionsAgentExecute.call(this);
|
||||
} else if (agentType === 'reActAgent') {
|
||||
return reActAgentAgentExecute.call(this);
|
||||
return await reActAgentAgentExecute.call(this);
|
||||
} else if (agentType === 'sqlAgent') {
|
||||
return sqlAgentAgentExecute.call(this);
|
||||
return await sqlAgentAgentExecute.call(this);
|
||||
} else if (agentType === 'planAndExecuteAgent') {
|
||||
return planAndExecuteAgentExecute.call(this);
|
||||
return await planAndExecuteAgentExecute.call(this);
|
||||
}
|
||||
|
||||
throw new NodeOperationError(this.getNode(), `The agent type "${agentType}" is not supported`);
|
||||
|
||||
@@ -102,5 +102,5 @@ export async function conversationalAgentExecute(
|
||||
returnData.push({ json: response });
|
||||
}
|
||||
|
||||
return this.prepareOutputData(returnData);
|
||||
return await this.prepareOutputData(returnData);
|
||||
}
|
||||
|
||||
@@ -101,5 +101,5 @@ export async function openAiFunctionsAgentExecute(
|
||||
returnData.push({ json: response });
|
||||
}
|
||||
|
||||
return this.prepareOutputData(returnData);
|
||||
return await this.prepareOutputData(returnData);
|
||||
}
|
||||
|
||||
@@ -76,5 +76,5 @@ export async function planAndExecuteAgentExecute(
|
||||
returnData.push({ json: response });
|
||||
}
|
||||
|
||||
return this.prepareOutputData(returnData);
|
||||
return await this.prepareOutputData(returnData);
|
||||
}
|
||||
|
||||
@@ -94,5 +94,5 @@ export async function reActAgentAgentExecute(
|
||||
returnData.push({ json: response });
|
||||
}
|
||||
|
||||
return this.prepareOutputData(returnData);
|
||||
return await this.prepareOutputData(returnData);
|
||||
}
|
||||
|
||||
@@ -101,5 +101,5 @@ export async function sqlAgentAgentExecute(
|
||||
returnData.push({ json: response });
|
||||
}
|
||||
|
||||
return this.prepareOutputData(returnData);
|
||||
return await this.prepareOutputData(returnData);
|
||||
}
|
||||
|
||||
@@ -380,6 +380,6 @@ export class OpenAiAssistant implements INodeType {
|
||||
returnData.push({ json: response });
|
||||
}
|
||||
|
||||
return this.prepareOutputData(returnData);
|
||||
return await this.prepareOutputData(returnData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ async function getChain(
|
||||
|
||||
// If there are no output parsers, create a simple LLM chain and execute the query
|
||||
if (!outputParsers.length) {
|
||||
return createSimpleLLMChain(context, llm, query, chatTemplate);
|
||||
return await createSimpleLLMChain(context, llm, query, chatTemplate);
|
||||
}
|
||||
|
||||
// If there's only one output parser, use it; otherwise, create a combined output parser
|
||||
|
||||
@@ -126,6 +126,6 @@ export class ChainRetrievalQa implements INodeType {
|
||||
const response = await chain.call({ query });
|
||||
returnData.push({ json: { response } });
|
||||
}
|
||||
return this.prepareOutputData(returnData);
|
||||
return await this.prepareOutputData(returnData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,6 +258,6 @@ export class ChainSummarizationV1 implements INodeType {
|
||||
returnData.push({ json: { response } });
|
||||
}
|
||||
|
||||
return this.prepareOutputData(returnData);
|
||||
return await this.prepareOutputData(returnData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -415,6 +415,6 @@ export class ChainSummarizationV2 implements INodeType {
|
||||
}
|
||||
}
|
||||
|
||||
return this.prepareOutputData(returnData);
|
||||
return await this.prepareOutputData(returnData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ export class MemoryChatRetriever implements INodeType {
|
||||
const messages = await memory?.chatHistory.getMessages();
|
||||
|
||||
if (simplifyOutput && messages) {
|
||||
return this.prepareOutputData(simplifyMessages(messages));
|
||||
return await this.prepareOutputData(simplifyMessages(messages));
|
||||
}
|
||||
|
||||
const serializedMessages =
|
||||
@@ -107,6 +107,6 @@ export class MemoryChatRetriever implements INodeType {
|
||||
return { json: serializedMessage as unknown as IDataObject };
|
||||
}) ?? [];
|
||||
|
||||
return this.prepareOutputData(serializedMessages);
|
||||
return await this.prepareOutputData(serializedMessages);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,6 +324,6 @@ export class MemoryManager implements INodeType {
|
||||
result.push(...executionData);
|
||||
}
|
||||
|
||||
return this.prepareOutputData(result);
|
||||
return await this.prepareOutputData(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ export class ToolCode implements INodeType {
|
||||
|
||||
const runFunction = async (query: string): Promise<string> => {
|
||||
const sandbox = getSandbox(query, itemIndex);
|
||||
return sandbox.runCode() as Promise<string>;
|
||||
return await (sandbox.runCode() as Promise<string>);
|
||||
};
|
||||
|
||||
return {
|
||||
|
||||
@@ -46,7 +46,7 @@ export const VectorStoreInMemory = createVectorStoreNode({
|
||||
const memoryKey = context.getNodeParameter('memoryKey', itemIndex) as string;
|
||||
const vectorStoreSingleton = MemoryVectorStoreManager.getInstance(embeddings);
|
||||
|
||||
return vectorStoreSingleton.getVectorStore(`${workflowId}__${memoryKey}`);
|
||||
return await vectorStoreSingleton.getVectorStore(`${workflowId}__${memoryKey}`);
|
||||
},
|
||||
async populateVectorStore(context, embeddings, documents, itemIndex) {
|
||||
const memoryKey = context.getNodeParameter('memoryKey', itemIndex) as string;
|
||||
|
||||
@@ -108,6 +108,6 @@ export class VectorStoreInMemoryInsert implements INodeType {
|
||||
clearStore,
|
||||
);
|
||||
|
||||
return this.prepareOutputData(serializedDocuments);
|
||||
return await this.prepareOutputData(serializedDocuments);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ export const VectorStorePinecone = createVectorStoreNode({
|
||||
filter,
|
||||
};
|
||||
|
||||
return PineconeStore.fromExistingIndex(embeddings, config);
|
||||
return await PineconeStore.fromExistingIndex(embeddings, config);
|
||||
},
|
||||
async populateVectorStore(context, embeddings, documents, itemIndex) {
|
||||
const index = context.getNodeParameter('pineconeIndex', itemIndex, '', {
|
||||
|
||||
@@ -134,6 +134,6 @@ export class VectorStorePineconeInsert implements INodeType {
|
||||
pineconeIndex,
|
||||
});
|
||||
|
||||
return this.prepareOutputData(serializedDocuments);
|
||||
return await this.prepareOutputData(serializedDocuments);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ export const VectorStoreQdrant = createVectorStoreNode({
|
||||
collectionName: collection,
|
||||
};
|
||||
|
||||
return QdrantVectorStore.fromExistingCollection(embeddings, config);
|
||||
return await QdrantVectorStore.fromExistingCollection(embeddings, config);
|
||||
},
|
||||
async populateVectorStore(context, embeddings, documents, itemIndex) {
|
||||
const collectionName = context.getNodeParameter('qdrantCollection', itemIndex, '', {
|
||||
|
||||
@@ -76,7 +76,7 @@ export const VectorStoreSupabase = createVectorStoreNode({
|
||||
const credentials = await context.getCredentials('supabaseApi');
|
||||
const client = createClient(credentials.host as string, credentials.serviceRole as string);
|
||||
|
||||
return SupabaseVectorStore.fromExistingIndex(embeddings, {
|
||||
return await SupabaseVectorStore.fromExistingIndex(embeddings, {
|
||||
client,
|
||||
tableName,
|
||||
queryName: options.queryName ?? 'match_documents',
|
||||
|
||||
@@ -122,6 +122,6 @@ export class VectorStoreSupabaseInsert implements INodeType {
|
||||
queryName,
|
||||
});
|
||||
|
||||
return this.prepareOutputData(serializedDocuments);
|
||||
return await this.prepareOutputData(serializedDocuments);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,6 +139,6 @@ export class VectorStoreZepInsert implements INodeType {
|
||||
|
||||
await ZepVectorStore.fromDocuments(processedDocuments, embeddings, zepConfig);
|
||||
|
||||
return this.prepareOutputData(serializedDocuments);
|
||||
return await this.prepareOutputData(serializedDocuments);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ export const createVectorStoreNode = (args: VectorStoreNodeConstructorArgs) =>
|
||||
resultData.push(...serializedDocs);
|
||||
}
|
||||
|
||||
return this.prepareOutputData(resultData);
|
||||
return await this.prepareOutputData(resultData);
|
||||
}
|
||||
|
||||
if (mode === 'insert') {
|
||||
@@ -267,7 +267,7 @@ export const createVectorStoreNode = (args: VectorStoreNodeConstructorArgs) =>
|
||||
}
|
||||
}
|
||||
|
||||
return this.prepareOutputData(resultData);
|
||||
return await this.prepareOutputData(resultData);
|
||||
}
|
||||
|
||||
throw new NodeOperationError(
|
||||
|
||||
Reference in New Issue
Block a user