fix(core): Remove linting exceptions in nodes-base, @typescript-eslint/no-unsafe-argument (no-changelog)
This commit is contained in:
@@ -6,6 +6,7 @@ import type {
|
||||
INodeExecutionData,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
@@ -1146,20 +1147,23 @@ export class NextCloud implements INodeType {
|
||||
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
||||
|
||||
items[i].binary![binaryPropertyName] = await this.helpers.prepareBinaryData(
|
||||
responseData,
|
||||
responseData as Buffer,
|
||||
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) => {
|
||||
parseString(responseData as string, { explicitArray: false }, (err, data) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
if (data.ocs.meta.status !== 'ok') {
|
||||
return reject(
|
||||
new NodeApiError(this.getNode(), data.ocs.meta.message || data.ocs.meta.status),
|
||||
new NodeApiError(
|
||||
this.getNode(),
|
||||
(data.ocs.meta.message as JsonObject) || (data.ocs.meta.status as JsonObject),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1172,14 +1176,17 @@ export class NextCloud implements INodeType {
|
||||
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) => {
|
||||
parseString(responseData as string, { explicitArray: false }, (err, data) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
if (data.ocs.meta.status !== 'ok') {
|
||||
return reject(
|
||||
new NodeApiError(this.getNode(), data.ocs.meta.message || data.ocs.meta.status),
|
||||
new NodeApiError(
|
||||
this.getNode(),
|
||||
(data.ocs.meta.message || data.ocs.meta.status) as JsonObject,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1195,13 +1202,15 @@ export class NextCloud implements INodeType {
|
||||
} else {
|
||||
// eslint-disable-next-line @typescript-eslint/no-loop-func
|
||||
const jsonResponseData: IDataObject[] = await new Promise((resolve, reject) => {
|
||||
parseString(responseData, { explicitArray: false }, (err, data) => {
|
||||
parseString(responseData as string, { explicitArray: false }, (err, data) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
if (data.ocs.meta.status !== 'ok') {
|
||||
return reject(new NodeApiError(this.getNode(), data.ocs.meta.message));
|
||||
return reject(
|
||||
new NodeApiError(this.getNode(), data.ocs.meta.message as JsonObject),
|
||||
);
|
||||
}
|
||||
|
||||
if (typeof data.ocs.data.users.element === 'string') {
|
||||
@@ -1219,7 +1228,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) => {
|
||||
parseString(responseData as string, { explicitArray: false }, (err, data) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user