mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +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:
@@ -1,11 +1,12 @@
|
||||
import { IExecuteFunctions } from 'n8n-core';
|
||||
import { IBinaryKeyData, NodeApiError } from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
IBinaryKeyData,
|
||||
IDataObject,
|
||||
INodeExecutionData,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
NodeApiError,
|
||||
NodeOperationError,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
@@ -1076,9 +1077,7 @@ export class NextCloud implements INodeType {
|
||||
const userid = this.getNodeParameter('userId', i) as string;
|
||||
endpoint = `ocs/v1.php/cloud/users/${userid}`;
|
||||
|
||||
body = Object.entries(
|
||||
(this.getNodeParameter('updateFields', i) as IDataObject).field as IDataObject,
|
||||
)
|
||||
body = Object.entries(this.getNodeParameter('updateFields', i).field as IDataObject)
|
||||
.map((entry) => {
|
||||
const [key, value] = entry;
|
||||
return `${key}=${value}`;
|
||||
@@ -1152,6 +1151,7 @@ export class NextCloud implements INodeType {
|
||||
endpoint,
|
||||
);
|
||||
} else if (['file', 'folder'].includes(resource) && operation === 'share') {
|
||||
// eslint-disable-next-line @typescript-eslint/no-loop-func
|
||||
const jsonResponseData: IDataObject = await new Promise((resolve, reject) => {
|
||||
parseString(responseData, { explicitArray: false }, (err, data) => {
|
||||
if (err) {
|
||||
@@ -1168,9 +1168,10 @@ export class NextCloud implements INodeType {
|
||||
});
|
||||
});
|
||||
|
||||
returnData.push(jsonResponseData as IDataObject);
|
||||
returnData.push(jsonResponseData);
|
||||
} else if (resource === 'user') {
|
||||
if (operation !== 'getAll') {
|
||||
// eslint-disable-next-line @typescript-eslint/no-loop-func
|
||||
const jsonResponseData: IDataObject = await new Promise((resolve, reject) => {
|
||||
parseString(responseData, { explicitArray: false }, (err, data) => {
|
||||
if (err) {
|
||||
@@ -1191,8 +1192,9 @@ export class NextCloud implements INodeType {
|
||||
});
|
||||
});
|
||||
|
||||
returnData.push(jsonResponseData as IDataObject);
|
||||
returnData.push(jsonResponseData);
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-loop-func
|
||||
const jsonResponseData: IDataObject[] = await new Promise((resolve, reject) => {
|
||||
parseString(responseData, { explicitArray: false }, (err, data) => {
|
||||
if (err) {
|
||||
@@ -1216,6 +1218,7 @@ export class NextCloud implements INodeType {
|
||||
});
|
||||
}
|
||||
} else if (resource === 'folder' && operation === 'list') {
|
||||
// eslint-disable-next-line @typescript-eslint/no-loop-func
|
||||
const jsonResponseData: IDataObject = await new Promise((resolve, reject) => {
|
||||
parseString(responseData, { explicitArray: false }, (err, data) => {
|
||||
if (err) {
|
||||
@@ -1242,7 +1245,7 @@ export class NextCloud implements INodeType {
|
||||
if (Array.isArray(jsonResponseData['d:multistatus']['d:response'])) {
|
||||
// @ts-ignore
|
||||
for (const item of jsonResponseData['d:multistatus']['d:response']) {
|
||||
if (skippedFirst === false) {
|
||||
if (!skippedFirst) {
|
||||
skippedFirst = true;
|
||||
continue;
|
||||
}
|
||||
@@ -1272,7 +1275,7 @@ export class NextCloud implements INodeType {
|
||||
// @ts-ignore
|
||||
newItem.eTag = props['d:getetag'].slice(1, -1);
|
||||
|
||||
returnData.push(newItem as IDataObject);
|
||||
returnData.push(newItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user