Fix npm deprecation warnings and minimize dependency overrides
Bump @n8n/node-cli to 0.37.1 (the `^0.24.1` range was trapping it at 0.24.x), which pulls an updated toolchain and clears the eslint@8, glob@7, inflight, rimraf@3, @humanwhocodes/*, node-domexception and uuid@10 deprecation warnings at the source. Add a glob override (^13.0.6) so rimraf@6 no longer pulls the deprecated glob@11, and trim the overrides list down to the three that actually do work (uuid, js-yaml, glob); the rest were redundant or dead. npm audit reports 0 vulnerabilities. The upgraded @n8n/eslint-plugin-community-nodes rules flagged two pre-existing issues in the Probo node, now fixed: handle continueOnFail() in execute() and throw NodeOperationError instead of raw Error. The only remaining warning is @langchain/community, whose entire package is deprecated upstream and is a hard dependency of @n8n/ai-utilities. Signed-off-by: Sacha Al Himdani <sacha@probo.com>
This commit is contained in:
4483
package-lock.json
generated
4483
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -24,14 +24,9 @@
|
|||||||
"turbo": "^2.9.14"
|
"turbo": "^2.9.14"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"minimatch@9": "^9.0.9",
|
|
||||||
"handlebars": "4.7.9",
|
|
||||||
"@langchain/classic": "^1.0.27",
|
|
||||||
"@langchain/community": "^1.1.25",
|
|
||||||
"lodash": "^4.18.1",
|
|
||||||
"uuid": "^14.0.0",
|
"uuid": "^14.0.0",
|
||||||
"form-data": "^4.0.6",
|
"js-yaml": "^4.2.0",
|
||||||
"js-yaml": "^4.2.0"
|
"glob": "^13.0.6"
|
||||||
},
|
},
|
||||||
"allowScripts": {
|
"allowScripts": {
|
||||||
"esbuild": true,
|
"esbuild": true,
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
NodeConnectionTypes,
|
NodeConnectionTypes,
|
||||||
|
NodeOperationError,
|
||||||
type IExecuteFunctions,
|
type IExecuteFunctions,
|
||||||
type INodeExecutionData,
|
type INodeExecutionData,
|
||||||
type INodeType,
|
type INodeType,
|
||||||
@@ -249,12 +250,23 @@ export class Probo implements INodeType {
|
|||||||
const returnData: INodeExecutionData[] = [];
|
const returnData: INodeExecutionData[] = [];
|
||||||
|
|
||||||
for (let i = 0; i < items.length; i++) {
|
for (let i = 0; i < items.length; i++) {
|
||||||
|
try {
|
||||||
const resource = this.getNodeParameter('resource', i) as string;
|
const resource = this.getNodeParameter('resource', i) as string;
|
||||||
const operation = this.getNodeParameter('operation', i, 'execute') as string;
|
const operation = this.getNodeParameter('operation', i, 'execute') as string;
|
||||||
|
|
||||||
const executeFunction = getExecuteFunction(resource, operation);
|
const executeFunction = getExecuteFunction(resource, operation);
|
||||||
const result = await executeFunction.call(this, i);
|
const result = await executeFunction.call(this, i);
|
||||||
returnData.push(result);
|
returnData.push(result);
|
||||||
|
} catch (error) {
|
||||||
|
if (this.continueOnFail()) {
|
||||||
|
returnData.push({
|
||||||
|
json: { error: error instanceof Error ? error.message : String(error) },
|
||||||
|
pairedItem: { item: i },
|
||||||
|
});
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
throw new NodeOperationError(this.getNode(), error as Error, { itemIndex: i });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return [returnData];
|
return [returnData];
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
// PERFORMANCE OF THIS SOFTWARE.
|
// PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
import type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
import type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
|
||||||
|
import { NodeOperationError } from 'n8n-workflow';
|
||||||
import { proboApiRequest, proboConnectApiRequest } from '../../GenericFunctions';
|
import { proboApiRequest, proboConnectApiRequest } from '../../GenericFunctions';
|
||||||
|
|
||||||
export const description: INodeProperties[] = [
|
export const description: INodeProperties[] = [
|
||||||
@@ -82,14 +83,16 @@ export async function execute(
|
|||||||
// Basic validation: check if query contains a GraphQL operation
|
// Basic validation: check if query contains a GraphQL operation
|
||||||
const trimmedQuery = query.trim();
|
const trimmedQuery = query.trim();
|
||||||
if (!trimmedQuery) {
|
if (!trimmedQuery) {
|
||||||
throw new Error('GraphQL query cannot be empty');
|
throw new NodeOperationError(this.getNode(), 'GraphQL query cannot be empty', { itemIndex });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for operation type (query, mutation, or subscription)
|
// Check for operation type (query, mutation, or subscription)
|
||||||
const operationMatch = trimmedQuery.match(/^\s*(query|mutation|subscription)\s+(\w+)/i);
|
const operationMatch = trimmedQuery.match(/^\s*(query|mutation|subscription)\s+(\w+)/i);
|
||||||
if (!operationMatch) {
|
if (!operationMatch) {
|
||||||
throw new Error(
|
throw new NodeOperationError(
|
||||||
|
this.getNode(),
|
||||||
'GraphQL operation must start with "query", "mutation", or "subscription" followed by an operation name (e.g., "query GetUser { ... }" or "mutation UpdateUser { ... }")',
|
'GraphQL operation must start with "query", "mutation", or "subscription" followed by an operation name (e.g., "query GetUser { ... }" or "mutation UpdateUser { ... }")',
|
||||||
|
{ itemIndex },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +102,10 @@ export async function execute(
|
|||||||
variables =
|
variables =
|
||||||
typeof variablesParam === 'string' ? JSON.parse(variablesParam) : variablesParam;
|
typeof variablesParam === 'string' ? JSON.parse(variablesParam) : variablesParam;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new Error(`Invalid JSON in Variables: ${error instanceof Error ? error.message : String(error)}`);
|
throw new NodeOperationError(this.getNode(), error as Error, {
|
||||||
|
itemIndex,
|
||||||
|
description: 'Invalid JSON in Variables',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
"n8n-workflow": "*"
|
"n8n-workflow": "*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@n8n/node-cli": "^0.24.1",
|
"@n8n/node-cli": "0.37.1",
|
||||||
"eslint": "^9.39.4"
|
"eslint": "^9.39.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user