Skip to content

Commit

Permalink
chore: Remove unused @ts-ignore's (no-changelog) (#12198)
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieKolb authored Dec 18, 2024
1 parent 5d33a6b commit 54b02ac
Show file tree
Hide file tree
Showing 49 changed files with 2 additions and 67 deletions.
1 change: 0 additions & 1 deletion packages/@n8n/nodes-langchain/utils/logWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ export function logWrapper(
return async (
query: string,
k?: number,
// @ts-ignore
filter?: BiquadFilterType | undefined,
_callbacks?: Callbacks | undefined,
): Promise<Document[]> => {
Expand Down
3 changes: 0 additions & 3 deletions packages/core/src/WorkflowExecute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/editor-ui/src/composables/useWorkflowHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions packages/node-dev/src/Build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions packages/nodes-base/nodes/Affinity/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -84,7 +83,6 @@ export function eventsExist(subscriptions: string[], currentSubsriptions: string
}

export function mapResource(key: string) {
//@ts-ignore
return {
person: 'persons',
list: 'lists',
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/Automizy/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/BambooHr/v1/transport/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'] || '';
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/Box/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/ClickUp/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export async function clickupApiRequest(
keepBearer: false,
tokenType: 'Bearer',
};
// @ts-ignore
return await this.helpers.requestOAuth2.call(
this,
'clickUpOAuth2Api',
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/Coda/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 !== '');

Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/CoinGecko/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/Flow/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 !== '');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/Freshdesk/Freshdesk.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/GetResponse/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/Git/Git.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@ export class Git implements INodeType {
});
}

// @ts-ignore
returnItems.push(
...this.helpers.returnJsonArray(data).map((item) => {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/Google/Task/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/Gotify/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/HelpScout/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,6 @@ export class HttpRequestV1 implements INodeType {
} satisfies IRequestOptions;

if (fullResponse) {
// @ts-ignore
requestOptions.resolveWithFullResponse = true;
}

Expand All @@ -714,7 +713,6 @@ export class HttpRequestV1 implements INodeType {
}

if (options.ignoreResponseCode === true) {
// @ts-ignore
requestOptions.simple = false;
}
if (options.proxy !== undefined) {
Expand Down Expand Up @@ -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') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,6 @@ export class HttpRequestV2 implements INodeType {
};

if (fullResponse) {
// @ts-ignore
requestOptions.resolveWithFullResponse = true;
}

Expand All @@ -754,7 +753,6 @@ export class HttpRequestV2 implements INodeType {
}

if (options.ignoreResponseCode === true) {
// @ts-ignore
requestOptions.simple = false;
}
if (options.proxy !== undefined) {
Expand Down Expand Up @@ -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()) {
Expand Down
2 changes: 0 additions & 2 deletions packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
}
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/Hubspot/V2/HubspotV2.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/Keap/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/Magento/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions packages/nodes-base/nodes/MailerLite/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/Mailgun/Mailgun.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ export class Mailgun implements INodeType {
}

if (attachments.length) {
// @ts-ignore
formData.attachment = attachments;
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/Mandrill/Mandrill.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/nodes/Matrix/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down
3 changes: 0 additions & 3 deletions packages/nodes-base/nodes/Mautic/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
Expand Down
Loading

0 comments on commit 54b02ac

Please sign in to comment.