mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(core): Remove linting exceptions in nodes-base, @typescript-eslint/no-unsafe-argument (no-changelog)
This commit is contained in:
@@ -7,7 +7,7 @@ import type {
|
||||
IWebhookFunctions,
|
||||
} from 'n8n-core';
|
||||
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
import type { IDataObject, JsonObject } from 'n8n-workflow';
|
||||
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
export async function quickbaseApiRequest(
|
||||
@@ -44,7 +44,7 @@ export async function quickbaseApiRequest(
|
||||
json: true,
|
||||
};
|
||||
|
||||
if (Object.keys(body).length === 0) {
|
||||
if (Object.keys(body as IDataObject).length === 0) {
|
||||
delete options.body;
|
||||
}
|
||||
|
||||
@@ -55,16 +55,16 @@ export async function quickbaseApiRequest(
|
||||
if (Object.keys(option).length !== 0) {
|
||||
Object.assign(options, option);
|
||||
}
|
||||
//@ts-ignore
|
||||
|
||||
return await this.helpers?.request(options);
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), error);
|
||||
throw new NodeApiError(this.getNode(), error as JsonObject);
|
||||
}
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
// prettier-ignore
|
||||
export async function getFieldsObject(this: IHookFunctions | ILoadOptionsFunctions | IExecuteFunctions, tableId: string): any {
|
||||
export async function getFieldsObject(this: IHookFunctions | ILoadOptionsFunctions | IExecuteFunctions, tableId: string): any {
|
||||
const fieldsLabelKey: { [key: string]: number } = {};
|
||||
const fieldsIdKey: { [key: number]: string } = {};
|
||||
const data = await quickbaseApiRequest.call(this, 'GET', '/fields', {}, { tableId });
|
||||
@@ -116,7 +116,7 @@ export async function quickbaseApiRequestAllItems(
|
||||
|
||||
for (const record of data) {
|
||||
const recordData: IDataObject = {};
|
||||
for (const [key, value] of Object.entries(record)) {
|
||||
for (const [key, value] of Object.entries(record as IDataObject)) {
|
||||
recordData[fieldsIdKey[key]] = (value as IDataObject).value;
|
||||
}
|
||||
responseData.push(recordData);
|
||||
|
||||
@@ -149,7 +149,7 @@ export class QuickBase implements INodeType {
|
||||
}
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
|
||||
@@ -176,7 +176,7 @@ export class QuickBase implements INodeType {
|
||||
);
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
|
||||
@@ -220,7 +220,7 @@ export class QuickBase implements INodeType {
|
||||
);
|
||||
|
||||
//content-disposition': 'attachment; filename="dog-puppy-on-garden-royalty-free-image-1586966191.jpg"',
|
||||
const contentDisposition = responseData.headers['content-disposition'];
|
||||
const contentDisposition: string = responseData.headers['content-disposition'];
|
||||
|
||||
const data = Buffer.from(responseData.body as string, 'base64');
|
||||
|
||||
@@ -287,7 +287,7 @@ export class QuickBase implements INodeType {
|
||||
|
||||
for (const record of records) {
|
||||
const recordData: IDataObject = {};
|
||||
for (const [key, value] of Object.entries(record)) {
|
||||
for (const [key, value] of Object.entries(record as IDataObject)) {
|
||||
recordData[key] = (value as IDataObject).value;
|
||||
}
|
||||
responseData.push(recordData);
|
||||
@@ -295,7 +295,7 @@ export class QuickBase implements INodeType {
|
||||
}
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData: { item: 0 } },
|
||||
);
|
||||
|
||||
@@ -316,7 +316,7 @@ export class QuickBase implements INodeType {
|
||||
responseData = await quickbaseApiRequest.call(this, 'DELETE', '/records', body);
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
|
||||
@@ -374,14 +374,14 @@ export class QuickBase implements INodeType {
|
||||
|
||||
for (const record of records) {
|
||||
const data: IDataObject = {};
|
||||
for (const [key, value] of Object.entries(record)) {
|
||||
for (const [key, value] of Object.entries(record as IDataObject)) {
|
||||
data[fieldsIdKey[key]] = (value as IDataObject).value;
|
||||
}
|
||||
responseData.push(data);
|
||||
}
|
||||
}
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
|
||||
@@ -457,7 +457,7 @@ export class QuickBase implements INodeType {
|
||||
|
||||
for (const record of records) {
|
||||
const recordData: IDataObject = {};
|
||||
for (const [key, value] of Object.entries(record)) {
|
||||
for (const [key, value] of Object.entries(record as IDataObject)) {
|
||||
recordData[fieldsIdKey[key]] = (value as IDataObject).value;
|
||||
}
|
||||
responseData.push(recordData);
|
||||
@@ -465,7 +465,7 @@ export class QuickBase implements INodeType {
|
||||
}
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData: { item: 0 } },
|
||||
);
|
||||
|
||||
@@ -540,7 +540,7 @@ export class QuickBase implements INodeType {
|
||||
|
||||
for (const record of records) {
|
||||
const recordData: IDataObject = {};
|
||||
for (const [key, value] of Object.entries(record)) {
|
||||
for (const [key, value] of Object.entries(record as IDataObject)) {
|
||||
recordData[key] = (value as IDataObject).value;
|
||||
}
|
||||
responseData.push(recordData);
|
||||
@@ -548,7 +548,7 @@ export class QuickBase implements INodeType {
|
||||
}
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData: { item: 0 } },
|
||||
);
|
||||
|
||||
@@ -597,7 +597,7 @@ export class QuickBase implements INodeType {
|
||||
|
||||
for (const record of records) {
|
||||
const data: IDataObject = {};
|
||||
for (const [key, value] of Object.entries(record)) {
|
||||
for (const [key, value] of Object.entries(record as IDataObject)) {
|
||||
data[fieldsIdKey[key]] = (value as IDataObject).value;
|
||||
}
|
||||
responseData.push(data);
|
||||
@@ -605,7 +605,7 @@ export class QuickBase implements INodeType {
|
||||
}
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
|
||||
@@ -630,7 +630,7 @@ export class QuickBase implements INodeType {
|
||||
);
|
||||
|
||||
const executionData = this.helpers.constructExecutionMetaData(
|
||||
this.helpers.returnJsonArray(responseData),
|
||||
this.helpers.returnJsonArray(responseData as IDataObject[]),
|
||||
{ itemData: { item: i } },
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user