mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +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:
@@ -327,7 +327,7 @@ export class NotionV1 implements INodeType {
|
||||
body,
|
||||
);
|
||||
} else {
|
||||
body['page_size'] = this.getNodeParameter('limit', i);
|
||||
body.page_size = this.getNodeParameter('limit', i);
|
||||
responseData = await notionApiRequest.call(this, 'POST', `/search`, body);
|
||||
responseData = responseData.results;
|
||||
}
|
||||
@@ -350,7 +350,7 @@ export class NotionV1 implements INodeType {
|
||||
parent: {},
|
||||
properties: {},
|
||||
};
|
||||
body.parent['database_id'] = this.getNodeParameter('databaseId', i, '', {
|
||||
body.parent.database_id = this.getNodeParameter('databaseId', i, '', {
|
||||
extractValue: true,
|
||||
}) as string;
|
||||
const properties = this.getNodeParameter(
|
||||
@@ -365,7 +365,7 @@ export class NotionV1 implements INodeType {
|
||||
extractDatabaseMentionRLC(blockValues);
|
||||
body.children = formatBlocks(blockValues);
|
||||
responseData = await notionApiRequest.call(this, 'POST', '/pages', body);
|
||||
if (simple === true) {
|
||||
if (simple) {
|
||||
responseData = simplifyObjects(responseData, false, 1);
|
||||
}
|
||||
|
||||
@@ -390,7 +390,7 @@ export class NotionV1 implements INodeType {
|
||||
filter: {},
|
||||
};
|
||||
if (filters.singleCondition) {
|
||||
body['filter'] = mapFilters([filters.singleCondition] as IDataObject[], timezone);
|
||||
body.filter = mapFilters([filters.singleCondition] as IDataObject[], timezone);
|
||||
}
|
||||
if (filters.multipleCondition) {
|
||||
const { or, and } = (filters.multipleCondition as IDataObject).condition as IDataObject;
|
||||
@@ -410,7 +410,7 @@ export class NotionV1 implements INodeType {
|
||||
}
|
||||
if (sort) {
|
||||
//@ts-expect-error
|
||||
body['sorts'] = mapSorting(sort);
|
||||
body.sorts = mapSorting(sort);
|
||||
}
|
||||
if (returnAll) {
|
||||
responseData = await notionApiRequestAllItems.call(
|
||||
@@ -432,7 +432,7 @@ export class NotionV1 implements INodeType {
|
||||
);
|
||||
responseData = responseData.results;
|
||||
}
|
||||
if (simple === true) {
|
||||
if (simple) {
|
||||
responseData = simplifyObjects(responseData, false, 1);
|
||||
}
|
||||
|
||||
@@ -463,7 +463,7 @@ export class NotionV1 implements INodeType {
|
||||
body.properties = mapProperties(properties, timezone) as IDataObject;
|
||||
}
|
||||
responseData = await notionApiRequest.call(this, 'PATCH', `/pages/${pageId}`, body);
|
||||
if (simple === true) {
|
||||
if (simple) {
|
||||
responseData = simplifyObjects(responseData, false, 1);
|
||||
}
|
||||
|
||||
@@ -518,7 +518,7 @@ export class NotionV1 implements INodeType {
|
||||
parent: {},
|
||||
properties: {},
|
||||
};
|
||||
body.parent['page_id'] = extractPageId(
|
||||
body.parent.page_id = extractPageId(
|
||||
this.getNodeParameter('pageId', i, '', { extractValue: true }) as string,
|
||||
);
|
||||
body.properties = formatTitle(this.getNodeParameter('title', i) as string);
|
||||
@@ -526,7 +526,7 @@ export class NotionV1 implements INodeType {
|
||||
extractDatabaseMentionRLC(blockValues);
|
||||
body.children = formatBlocks(blockValues);
|
||||
responseData = await notionApiRequest.call(this, 'POST', '/pages', body);
|
||||
if (simple === true) {
|
||||
if (simple) {
|
||||
responseData = simplifyObjects(responseData, false, 1);
|
||||
}
|
||||
|
||||
@@ -543,7 +543,7 @@ export class NotionV1 implements INodeType {
|
||||
const pageId = extractPageId(this.getNodeParameter('pageId', i) as string);
|
||||
const simple = this.getNodeParameter('simple', i) as boolean;
|
||||
responseData = await notionApiRequest.call(this, 'GET', `/pages/${pageId}`);
|
||||
if (simple === true) {
|
||||
if (simple) {
|
||||
responseData = simplifyObjects(responseData, false, 1);
|
||||
}
|
||||
|
||||
@@ -564,17 +564,17 @@ export class NotionV1 implements INodeType {
|
||||
const body: IDataObject = {};
|
||||
|
||||
if (text) {
|
||||
body['query'] = text;
|
||||
body.query = text;
|
||||
}
|
||||
|
||||
if (options.filter) {
|
||||
const filter = (((options.filter as IDataObject) || {}).filters as IDataObject[]) || [];
|
||||
body['filter'] = filter;
|
||||
const filter = ((options.filter as IDataObject)?.filters as IDataObject[]) || [];
|
||||
body.filter = filter;
|
||||
}
|
||||
|
||||
if (options.sort) {
|
||||
const sort = (((options.sort as IDataObject) || {}).sortValue as IDataObject) || {};
|
||||
body['sort'] = sort;
|
||||
const sort = ((options.sort as IDataObject)?.sortValue as IDataObject) || {};
|
||||
body.sort = sort;
|
||||
}
|
||||
if (returnAll) {
|
||||
responseData = await notionApiRequestAllItems.call(
|
||||
@@ -596,7 +596,7 @@ export class NotionV1 implements INodeType {
|
||||
responseData = responseData.splice(0, qs.limit);
|
||||
}
|
||||
|
||||
if (simple === true) {
|
||||
if (simple) {
|
||||
responseData = simplifyObjects(responseData, false, 1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user