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

@@ -8,7 +8,7 @@ import type {
IWebhookFunctions,
} from 'n8n-core';
import type { IDataObject } from 'n8n-workflow';
import type { IDataObject, JsonObject } from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';
export async function sentryIoApiRequest(
@@ -38,7 +38,7 @@ export async function sentryIoApiRequest(
uri: uri || `https://sentry.io${resource}`,
json: true,
};
if (!Object.keys(body).length) {
if (!Object.keys(body as IDataObject).length) {
delete options.body;
}
@@ -70,13 +70,12 @@ export async function sentryIoApiRequest(
Authorization: `Bearer ${credentials?.token}`,
};
//@ts-ignore
return await this.helpers.request(options);
} else {
return await this.helpers.requestOAuth2.call(this, 'sentryIoOAuth2Api', options);
}
} catch (error) {
throw new NodeApiError(this.getNode(), error);
throw new NodeApiError(this.getNode(), error as JsonObject);
}
}
@@ -121,12 +120,12 @@ export async function sentryApiRequestAllItems(
resolveWithFullResponse: true,
});
link = responseData.headers.link;
uri = getNext(link);
returnData.push.apply(returnData, responseData.body);
uri = getNext(link as string);
returnData.push.apply(returnData, responseData.body as IDataObject[]);
if (query.limit && query.limit >= returnData.length) {
return;
}
} while (hasMore(link));
} while (hasMore(link as string));
return returnData;
}