chore: Remove unused @ts-ignore's (no-changelog) (#12198)
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions

This commit is contained in:
Charlie Kolb 2024-12-18 08:35:53 +01:00 committed by GitHub
parent 5d33a6ba8a
commit 54b02acdd7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 2 additions and 67 deletions

View file

@ -394,7 +394,6 @@ export function logWrapper(
return async (
query: string,
k?: number,
// @ts-ignore
filter?: BiquadFilterType | undefined,
_callbacks?: Callbacks | undefined,
): Promise<Document[]> => {

View file

@ -1796,16 +1796,13 @@ export class WorkflowExecute {
lineResult.json.$json !== undefined
) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
lineResult.error = lineResult.json.$error as NodeApiError | NodeOperationError;
lineResult.json = {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
error: (lineResult.json.$error as NodeApiError | NodeOperationError).message,
};
} else if (lineResult.error !== undefined) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
lineResult.json = { error: lineResult.error.message };
}
}

View file

@ -518,7 +518,6 @@ export function useWorkflowHelpers(options: { router: ReturnType<typeof useRoute
const nodes: INode[] = [];
for (let nodeIndex = 0; nodeIndex < workflowNodes.length; nodeIndex++) {
// @ts-ignore
nodeData = getNodeDataToSave(workflowNodes[nodeIndex]);
nodes.push(nodeData);

View file

@ -85,9 +85,7 @@ export async function buildFiles({
// Forward the output of the child process to the main one
// that the user can see what is happening
// @ts-ignore
buildProcess.stdout.pipe(process.stdout);
// @ts-ignore
buildProcess.stderr.pipe(process.stderr);
// Make sure that the child process gets also always terminated

View file

@ -66,7 +66,6 @@ export async function affinityApiRequestAllItems(
do {
responseData = await affinityApiRequest.call(this, method, resource, body, query);
// @ts-ignore
query.page_token = responseData.page_token;
returnData.push.apply(returnData, responseData[propertyName] as IDataObject[]);
} while (responseData.page_token !== undefined && responseData.page_token !== null);
@ -84,7 +83,6 @@ export function eventsExist(subscriptions: string[], currentSubsriptions: string
}
export function mapResource(key: string) {
//@ts-ignore
return {
person: 'persons',
list: 'lists',

View file

@ -40,7 +40,6 @@ export async function automizyApiRequest(
if (Object.keys(option).length !== 0) {
Object.assign(options, option);
}
//@ts-ignore
return await this.helpers.request.call(this, options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -53,7 +53,6 @@ export async function apiRequest(
}
try {
//@ts-ignore
return await this.helpers.request(options);
} catch (error) {
const description = error?.response?.headers['x-bamboohr-error-messsage'] || '';

View file

@ -41,7 +41,6 @@ export async function boxApiRequest(
includeCredentialsOnRefreshOnBody: true,
};
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'boxOAuth2Api', options, oAuth2Options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -43,7 +43,6 @@ export async function webexApiRequest(
if (Object.keys(qs).length === 0) {
delete options.qs;
}
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'ciscoWebexOAuth2Api', options, {
tokenType: 'Bearer',
});

View file

@ -42,7 +42,6 @@ export async function clickupApiRequest(
keepBearer: false,
tokenType: 'Bearer',
};
// @ts-ignore
return await this.helpers.requestOAuth2.call(
this,
'clickUpOAuth2Api',

View file

@ -67,7 +67,6 @@ export async function codaApiRequestAllItems(
do {
responseData = await codaApiRequest.call(this, method, resource, body, query, uri);
uri = responseData.nextPageLink;
// @ts-ignore
returnData.push.apply(returnData, responseData[propertyName] as IDataObject[]);
} while (responseData.nextPageLink !== undefined && responseData.nextPageLink !== '');

View file

@ -37,7 +37,6 @@ export async function coinGeckoApiRequest(
delete options.body;
}
//@ts-ignore
return await this.helpers.request.call(this, options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -67,7 +67,6 @@ export async function FlowApiRequestAllItems(
resolveWithFullResponse: true,
});
uri = responseData.headers.link;
// @ts-ignore
returnData.push.apply(returnData, responseData.body[propertyName] as IDataObject[]);
} while (responseData.headers.link !== undefined && responseData.headers.link !== '');

View file

@ -163,7 +163,6 @@ export class FormstackTrigger implements INodeType {
},
};
// @ts-ignore
async webhook(this: IWebhookFunctions): Promise<IWebhookResponseData> {
const bodyData = this.getBodyData() as unknown as IFormstackWebhookResponseBody;
const simple = this.getNodeParameter('simple') as string;

View file

@ -1205,7 +1205,6 @@ export class Freshdesk implements INodeType {
if (updateFields.requester) {
const value = updateFields.requesterIdentificationValue as string;
if (updateFields.requester === 'requesterId') {
// @ts-ignore
if (isNaN(parseInt(value, 10))) {
throw new NodeOperationError(this.getNode(), 'Requester Id must be a number', {
itemIndex: i,

View file

@ -41,7 +41,6 @@ export async function getresponseApiRequest(
if (authentication === 'apiKey') {
return await this.helpers.requestWithAuthentication.call(this, 'getResponseApi', options);
} else {
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'getResponseOAuth2Api', options);
}
} catch (error) {

View file

@ -439,7 +439,6 @@ export class Git implements INodeType {
});
}
// @ts-ignore
returnItems.push(
...this.helpers.returnJsonArray(data).map((item) => {
return {

View file

@ -40,7 +40,6 @@ export async function googleApiRequest(
if (Object.keys(body as IDataObject).length === 0) {
delete options.body;
}
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'googleCalendarOAuth2Api', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -36,7 +36,6 @@ export async function googleApiRequest(
if (Object.keys(body as IDataObject).length === 0) {
delete options.body;
}
//@ts-ignore
return await this.helpers.requestOAuth2.call(
this,
'googleCloudNaturalLanguageOAuth2Api',

View file

@ -36,7 +36,6 @@ export async function googleApiRequest(
delete options.body;
}
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'googleContactsOAuth2Api', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -49,7 +49,6 @@ export async function googleApiRequest(
(options.headers as IDataObject).Authorization = `Bearer ${access_token}`;
}
//@ts-ignore
return await this.helpers.requestWithAuthentication.call(this, credentialType, options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -35,7 +35,6 @@ export async function googleApiRequest(
if (Object.keys(body as IDataObject).length === 0) {
delete options.body;
}
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'gSuiteAdminOAuth2Api', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -35,7 +35,6 @@ export async function googleApiRequest(
if (Object.keys(body).length === 0) {
delete options.body;
}
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'googleTasksOAuth2Api', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -35,7 +35,6 @@ export async function googleApiRequest(
delete options.body;
}
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'youTubeOAuth2Api', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -37,7 +37,6 @@ export async function gotifyApiRequest(
delete options.body;
}
//@ts-ignore
return await this.helpers.request.call(this, options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -38,7 +38,6 @@ export async function helpscoutApiRequest(
if (Object.keys(body as IDataObject).length === 0) {
delete options.body;
}
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'helpScoutOAuth2Api', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -222,7 +222,6 @@ export class HomeAssistant implements INodeType {
if (Object.entries(serviceAttributes).length) {
if (serviceAttributes.attributes !== undefined) {
serviceAttributes.attributes.map((attribute) => {
// @ts-ignore
body[attribute.name as string] = attribute.value;
});
}

View file

@ -701,7 +701,6 @@ export class HttpRequestV1 implements INodeType {
} satisfies IRequestOptions;
if (fullResponse) {
// @ts-ignore
requestOptions.resolveWithFullResponse = true;
}
@ -714,7 +713,6 @@ export class HttpRequestV1 implements INodeType {
}
if (options.ignoreResponseCode === true) {
// @ts-ignore
requestOptions.simple = false;
}
if (options.proxy !== undefined) {
@ -976,12 +974,10 @@ export class HttpRequestV1 implements INodeType {
}
}
// @ts-ignore
const promisesResponses = await Promise.allSettled(requestPromises);
let response: any;
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
// @ts-ignore
response = promisesResponses.shift();
if (response!.status !== 'fulfilled') {

View file

@ -741,7 +741,6 @@ export class HttpRequestV2 implements INodeType {
};
if (fullResponse) {
// @ts-ignore
requestOptions.resolveWithFullResponse = true;
}
@ -754,7 +753,6 @@ export class HttpRequestV2 implements INodeType {
}
if (options.ignoreResponseCode === true) {
// @ts-ignore
requestOptions.simple = false;
}
if (options.proxy !== undefined) {
@ -1030,12 +1028,10 @@ export class HttpRequestV2 implements INodeType {
}
}
// @ts-ignore
const promisesResponses = await Promise.allSettled(requestPromises);
let response: any;
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
// @ts-ignore
response = promisesResponses.shift();
if (response!.status !== 'fulfilled') {
if (!this.continueOnFail()) {

View file

@ -424,14 +424,12 @@ export class HubspotTrigger implements INodeType {
const req = this.getRequestObject();
const bodyData = req.body;
const headerData = this.getHeaderData();
//@ts-ignore
if (headerData['x-hubspot-signature'] === undefined) {
return {};
}
const hash = `${credentials.clientSecret}${JSON.stringify(bodyData)}`;
const signature = createHash('sha256').update(hash).digest('hex');
//@ts-ignore
if (signature !== headerData['x-hubspot-signature']) {
return {};
}

View file

@ -1672,7 +1672,6 @@ export class HubspotV2 implements INodeType {
delete filter.type;
// Hacky way to get the filter value as we concat the values with a | and the type
filter.propertyName = filter.propertyName?.toString().split('|')[0];
//@ts-ignore
}
(body.filterGroups as IDataObject[]).push({ filters: filterValues });
}

View file

@ -41,7 +41,6 @@ export async function keapApiRequest(
if (Object.keys(body as IDataObject).length === 0) {
delete options.body;
}
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'keapOAuth2Api', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -39,7 +39,6 @@ export async function magentoApiRequest(
if (Object.keys(body as IDataObject).length === 0) {
delete options.body;
}
//@ts-ignore
return await this.helpers.requestWithAuthentication.call(this, 'magento2Api', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -34,6 +34,7 @@ export async function mailerliteApiRequest(
if (Object.keys(body as IDataObject).length === 0) {
delete options.body;
}
return await this.helpers.httpRequestWithAuthentication.call(this, 'mailerLiteApi', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -163,7 +163,6 @@ export class Mailgun implements INodeType {
}
if (attachments.length) {
// @ts-ignore
formData.attachment = attachments;
}
}

View file

@ -838,7 +838,6 @@ export class Mandrill implements INodeType {
// @ts-ignore
attachmentsValues = map(attachmentsUi.attachmentsValues, (o: IDataObject) => {
const aux: IDataObject = {};
// @ts-ignore
aux.name = o.name;
aux.content = o.content;
aux.type = o.type;

View file

@ -40,7 +40,6 @@ export async function matrixApiRequest(
const credentials = await this.getCredentials('matrixApi');
options.uri = `${credentials.homeserverUrl}/_matrix/${
//@ts-ignore
option.overridePrefix || 'client'
}/r0${resource}`;
options.headers!.Authorization = `Bearer ${credentials.accessToken}`;

View file

@ -37,14 +37,12 @@ export async function mauticApiRequest(
const baseUrl = credentials.url as string;
options.uri = `${baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl}${options.uri}`;
//@ts-ignore
returnData = await this.helpers.requestWithAuthentication.call(this, 'mauticApi', options);
} else {
const credentials = await this.getCredentials('mauticOAuth2Api');
const baseUrl = credentials.url as string;
options.uri = `${baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl}${options.uri}`;
//@ts-ignore
returnData = await this.helpers.requestOAuth2.call(this, 'mauticOAuth2Api', options, {
includeCredentialsOnRefreshOnBody: true,
});
@ -83,7 +81,6 @@ export async function mauticApiRequestAllItems(
do {
responseData = await mauticApiRequest.call(this, method, endpoint, body, query);
const values = Object.values(responseData[propertyName] as IDataObject[]);
//@ts-ignore
returnData.push.apply(returnData, values);
query.start += query.limit;
} while (

View file

@ -42,7 +42,6 @@ export async function microsoftApiRequest(
if (Object.keys(option).length !== 0) {
options = Object.assign({}, options, option);
}
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'microsoftDynamicsOAuth2Api', options, {
property: 'id_token',
});

View file

@ -41,7 +41,6 @@ export async function microsoftApiRequest(
if (Object.keys(body as IDataObject).length === 0) {
delete options.body;
}
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'microsoftOneDriveOAuth2Api', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -32,7 +32,6 @@ export async function microsoftApiRequest(
if (Object.keys(headers).length !== 0) {
options.headers = Object.assign({}, options.headers, headers);
}
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'microsoftTeamsOAuth2Api', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -32,7 +32,6 @@ export async function microsoftApiRequest(
if (Object.keys(headers).length !== 0) {
options.headers = Object.assign({}, options.headers, headers);
}
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'microsoftTeamsOAuth2Api', options);
} catch (error) {
const errorOptions: IDataObject = {};

View file

@ -35,7 +35,6 @@ export async function microsoftApiRequest(
if (Object.keys(body).length === 0) {
delete options.body;
}
//@ts-ignore
return await this.helpers.requestOAuth2.call(this, 'microsoftToDoOAuth2Api', options);
} catch (error) {
throw new NodeApiError(this.getNode(), error as JsonObject);

View file

@ -789,7 +789,6 @@ export class Onfleet {
const tasksData = {
tasks: items.map((_item, index) => Onfleet.getTaskFields.call(this, index, operation)),
};
//@ts-ignore
const { tasks: tasksCreated } = await onfleetApiRequest.call(this, 'POST', path, tasksData);
return tasksCreated;
}

View file

@ -436,7 +436,6 @@ export class RabbitMQ implements INodeType {
);
}
// @ts-ignore
const promisesResponses = await Promise.allSettled(queuePromises);
// @ts-ignore
@ -507,7 +506,6 @@ export class RabbitMQ implements INodeType {
);
}
// @ts-ignore
const promisesResponses = await Promise.allSettled(exchangePromises);
// @ts-ignore

View file

@ -114,7 +114,6 @@ export async function salesforceApiRequest(
);
options.headers!.Authorization = `Bearer ${access_token}`;
Object.assign(options, option);
//@ts-ignore
return await this.helpers.request(options);
} else {
// https://help.salesforce.com/articleView?id=remoteaccess_oauth_web_server_flow.htm&type=5

View file

@ -75,10 +75,7 @@ for (const tool of (tools as IDataObject).processors as IDataObject[]) {
options: param.o,
displayOptions: {
show: {
group: [
//@ts-ignore
tool.g,
],
group: [tool.g],
tool: [tool.k],
},
},
@ -96,7 +93,6 @@ for (const tool of (tools as IDataObject).processors as IDataObject[]) {
//if exists, other wise
if (modifiedParam) {
//Assign new group and tool
//@ts-ignore
modifiedParam.displayOptions.show.group.push(tool.g);
modifiedParam.displayOptions.show.tool.push(tool.k);

View file

@ -137,7 +137,6 @@ export const extendTransform = (expression: string): { code: string } | undefine
// This is to match our fork of tmpl
const globalIdentifier = types.builders.identifier(
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
typeof window !== 'object' ? 'global' : 'window',
);
// We want to define all of our commonly used identifiers and member

View file

@ -1093,9 +1093,7 @@ function generateTestWorkflowAndRunData(): { workflow: Partial<IWorkflowBase>; r
},
Switch: {
main: [
// @ts-ignore
null,
// @ts-ignore
null,
[
{