fix(core): Remove linting exceptions in nodes-base, @typescript-eslint/no-unsafe-argument (no-changelog)
This commit is contained in:
@@ -14,6 +14,7 @@ import type {
|
||||
IDataObject,
|
||||
INodeProperties,
|
||||
IPairedItemData,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
@@ -26,12 +27,11 @@ export async function supabaseApiRequest(
|
||||
| IWebhookFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
|
||||
body: any = {},
|
||||
body: IDataObject | IDataObject[] = {},
|
||||
qs: IDataObject = {},
|
||||
uri?: string,
|
||||
headers: IDataObject = {},
|
||||
): Promise<any> {
|
||||
) {
|
||||
const credentials = (await this.getCredentials('supabaseApi')) as {
|
||||
host: string;
|
||||
serviceRole: string;
|
||||
@@ -56,7 +56,7 @@ export async function supabaseApiRequest(
|
||||
}
|
||||
return await this.helpers.requestWithAuthentication.call(this, 'supabaseApi', options);
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), error);
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ export class Supabase implements INodeType {
|
||||
async getTables(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const { paths } = await supabaseApiRequest.call(this, 'GET', '/');
|
||||
for (const path of Object.keys(paths)) {
|
||||
for (const path of Object.keys(paths as IDataObject)) {
|
||||
//omit introspection path
|
||||
if (path === '/') continue;
|
||||
returnData.push({
|
||||
@@ -89,7 +89,7 @@ export class Supabase implements INodeType {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const tableName = this.getCurrentNodeParameter('tableId') as string;
|
||||
const { definitions } = await supabaseApiRequest.call(this, 'GET', '/');
|
||||
for (const column of Object.keys(definitions[tableName].properties)) {
|
||||
for (const column of Object.keys(definitions[tableName].properties as IDataObject)) {
|
||||
returnData.push({
|
||||
name: `${column} - (${definitions[tableName].properties[column].type})`,
|
||||
value: column,
|
||||
@@ -233,7 +233,7 @@ export class Supabase implements INodeType {
|
||||
throw error;
|
||||
}
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(rows),
|
||||
this.helpers.returnJsonArray(rows as IDataObject[]),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
@@ -273,7 +273,7 @@ export class Supabase implements INodeType {
|
||||
throw error;
|
||||
}
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(rows),
|
||||
this.helpers.returnJsonArray(rows as IDataObject[]),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
@@ -316,7 +316,7 @@ export class Supabase implements INodeType {
|
||||
try {
|
||||
rows = await supabaseApiRequest.call(this, 'GET', endpoint, {}, qs);
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(rows),
|
||||
this.helpers.returnJsonArray(rows as IDataObject[]),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
@@ -392,7 +392,7 @@ export class Supabase implements INodeType {
|
||||
try {
|
||||
updatedRow = await supabaseApiRequest.call(this, 'PATCH', endpoint, record, qs);
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(updatedRow),
|
||||
this.helpers.returnJsonArray(updatedRow as IDataObject[]),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
returnData.push(...executionData);
|
||||
|
||||
Reference in New Issue
Block a user