mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(core): Remove linting exceptions in nodes-base (#4794)
* ⚡ enabled array-type * ⚡ await-thenable on * ⚡ ban-types on * ⚡ default-param-last on * ⚡ dot-notation on * ⚡ member-delimiter-style on * ⚡ no-duplicate-imports on * ⚡ no-empty-interface on * ⚡ no-floating-promises on * ⚡ no-for-in-array on * ⚡ no-invalid-void-type on * ⚡ no-loop-func on * ⚡ no-shadow on * ⚡ ban-ts-comment re enabled * ⚡ @typescript-eslint/lines-between-class-members on * address my own comment * @typescript-eslint/return-await on * @typescript-eslint/promise-function-async on * @typescript-eslint/no-unnecessary-boolean-literal-compare on * @typescript-eslint/no-unnecessary-type-assertion on * prefer-const on * @typescript-eslint/prefer-optional-chain on Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -193,9 +193,8 @@ export async function getToken(
|
||||
|
||||
const url = `https://${host}/fmi/data/v1/databases/${db}/sessions`;
|
||||
|
||||
let requestOptions: OptionsWithUri;
|
||||
// Reset all values
|
||||
requestOptions = {
|
||||
const requestOptions: OptionsWithUri = {
|
||||
uri: url,
|
||||
headers: {},
|
||||
method: 'POST',
|
||||
@@ -203,15 +202,15 @@ export async function getToken(
|
||||
//rejectUnauthorized: !this.getNodeParameter('allowUnauthorizedCerts', itemIndex, false) as boolean,
|
||||
};
|
||||
requestOptions.auth = {
|
||||
user: login as string,
|
||||
pass: password as string,
|
||||
user: login,
|
||||
pass: password,
|
||||
};
|
||||
requestOptions.body = {
|
||||
fmDataSource: [
|
||||
{
|
||||
database: host,
|
||||
username: login as string,
|
||||
password: password as string,
|
||||
username: login,
|
||||
password,
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -243,9 +242,8 @@ export async function logout(
|
||||
|
||||
const url = `https://${host}/fmi/data/v1/databases/${db}/sessions/${token}`;
|
||||
|
||||
let requestOptions: OptionsWithUri;
|
||||
// Reset all values
|
||||
requestOptions = {
|
||||
const requestOptions: OptionsWithUri = {
|
||||
uri: url,
|
||||
headers: {},
|
||||
method: 'DELETE',
|
||||
@@ -285,11 +283,11 @@ export function parseSort(this: IExecuteFunctions, i: number): object | null {
|
||||
const sortParametersUi = this.getNodeParameter('sortParametersUi', i, {}) as IDataObject;
|
||||
if (sortParametersUi.rules !== undefined) {
|
||||
// @ts-ignore
|
||||
for (const parameterData of sortParametersUi!.rules as IDataObject[]) {
|
||||
for (const parameterData of sortParametersUi.rules as IDataObject[]) {
|
||||
// @ts-ignore
|
||||
sort.push({
|
||||
fieldName: parameterData!.name as string,
|
||||
sortOrder: parameterData!.value,
|
||||
fieldName: parameterData.name as string,
|
||||
sortOrder: parameterData.value,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -308,7 +306,7 @@ export function parseScripts(this: IExecuteFunctions, i: number): object | null
|
||||
const scripts = {} as ScriptsOptions;
|
||||
if (setScriptAfter) {
|
||||
scripts.script = this.getNodeParameter('scriptAfter', i);
|
||||
scripts!['script.param'] = this.getNodeParameter('scriptAfter', i);
|
||||
scripts['script.param'] = this.getNodeParameter('scriptAfter', i);
|
||||
}
|
||||
if (setScriptBefore) {
|
||||
scripts['script.prerequest'] = this.getNodeParameter('scriptBefore', i);
|
||||
@@ -324,8 +322,8 @@ export function parseScripts(this: IExecuteFunctions, i: number): object | null
|
||||
|
||||
export function parsePortals(this: IExecuteFunctions, i: number): object | null {
|
||||
let portals;
|
||||
const getPortals = this.getNodeParameter('getPortals', i);
|
||||
if (!getPortals) {
|
||||
const getPortalsData = this.getNodeParameter('getPortals', i);
|
||||
if (!getPortalsData) {
|
||||
portals = [];
|
||||
} else {
|
||||
portals = this.getNodeParameter('portals', i);
|
||||
@@ -340,14 +338,14 @@ export function parseQuery(this: IExecuteFunctions, i: number): object | null {
|
||||
if (queriesParamUi.query !== undefined) {
|
||||
// @ts-ignore
|
||||
queries = [];
|
||||
for (const queryParam of queriesParamUi!.query as IDataObject[]) {
|
||||
for (const queryParam of queriesParamUi.query as IDataObject[]) {
|
||||
const query = {
|
||||
omit: queryParam.omit ? 'true' : 'false',
|
||||
};
|
||||
// @ts-ignore
|
||||
for (const field of queryParam!.fields!.field as IDataObject[]) {
|
||||
for (const field of queryParam.fields!.field as IDataObject[]) {
|
||||
// @ts-ignore
|
||||
query[field.name] = field!.value;
|
||||
query[field.name] = field.value;
|
||||
}
|
||||
queries.push(query);
|
||||
}
|
||||
@@ -364,9 +362,9 @@ export function parseFields(this: IExecuteFunctions, i: number): object | null {
|
||||
if (fieldsParametersUi.fields !== undefined) {
|
||||
// @ts-ignore
|
||||
fieldData = {};
|
||||
for (const field of fieldsParametersUi!.fields as IDataObject[]) {
|
||||
for (const field of fieldsParametersUi.fields as IDataObject[]) {
|
||||
// @ts-ignore
|
||||
fieldData[field.name] = field!.value;
|
||||
fieldData[field.name] = field.value;
|
||||
}
|
||||
} else {
|
||||
fieldData = null;
|
||||
|
||||
Reference in New Issue
Block a user