fix(core): Remove linting exceptions in nodes-base, @typescript-eslint/no-unsafe-argument (no-changelog)

This commit is contained in:
Michael Kret
2023-02-28 05:39:43 +02:00
committed by GitHub
parent 3172ea376e
commit bb4db58819
560 changed files with 2227 additions and 1919 deletions

View File

@@ -2,7 +2,12 @@ import { createSign } from 'crypto';
import type { IExecuteFunctions, IHookFunctions } from 'n8n-core';
import type { IDataObject, IHttpRequestOptions, ILoadOptionsFunctions } from 'n8n-workflow';
import type {
IDataObject,
IHttpRequestOptions,
ILoadOptionsFunctions,
JsonObject,
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
/**
@@ -62,7 +67,7 @@ export async function wiseApiRequest(
response = await this.helpers.httpRequest(options);
} catch (error) {
delete error.config;
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
if (response.statusCode >= 200 && response.statusCode < 300) {
@@ -93,7 +98,7 @@ export async function wiseApiRequest(
} catch (error) {
throw new NodeApiError(this.getNode(), {
message: 'Error signing SCA request, check your private key',
...error,
...(error as JsonObject),
});
}
// Retry the request with signed token
@@ -106,7 +111,10 @@ export async function wiseApiRequest(
});
}
} else {
throw new NodeApiError(this.getNode(), { ...response, message: response.statusMessage });
throw new NodeApiError(this.getNode(), {
...(response as JsonObject),
message: response.statusMessage,
});
}
}