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:
@@ -43,7 +43,7 @@ export async function gitlabApiRequest(
|
||||
|
||||
options.uri = `${(credentials.server as string).replace(/\/$/, '')}/api/v4${endpoint}`;
|
||||
|
||||
return await this.helpers.requestOAuth2!.call(this, 'gitlabOAuth2Api', options);
|
||||
return await this.helpers.requestOAuth2.call(this, 'gitlabOAuth2Api', options);
|
||||
}
|
||||
} catch (error) {
|
||||
throw new NodeApiError(this.getNode(), error);
|
||||
@@ -71,6 +71,6 @@ export async function gitlabApiRequestAllItems(
|
||||
});
|
||||
query.page++;
|
||||
returnData.push.apply(returnData, responseData.body);
|
||||
} while (responseData.headers.link && responseData.headers.link.includes('next'));
|
||||
} while (responseData.headers.link?.includes('next'));
|
||||
return returnData;
|
||||
}
|
||||
|
||||
@@ -1065,8 +1065,8 @@ export class Gitlab implements INodeType {
|
||||
|
||||
const assigneeIds = this.getNodeParameter('assignee_ids', i) as IDataObject[];
|
||||
|
||||
body.labels = labels.map((data) => data['label']).join(',');
|
||||
body.assignee_ids = assigneeIds.map((data) => data['assignee']);
|
||||
body.labels = labels.map((data) => data.label).join(',');
|
||||
body.assignee_ids = assigneeIds.map((data) => data.assignee);
|
||||
|
||||
endpoint = `${baseEndpoint}/issues`;
|
||||
} else if (operation === 'createComment') {
|
||||
@@ -1092,12 +1092,10 @@ export class Gitlab implements INodeType {
|
||||
body = this.getNodeParameter('editFields', i, {}) as IDataObject;
|
||||
|
||||
if (body.labels !== undefined) {
|
||||
body.labels = (body.labels as IDataObject[]).map((data) => data['label']).join(',');
|
||||
body.labels = (body.labels as IDataObject[]).map((data) => data.label).join(',');
|
||||
}
|
||||
if (body.assignee_ids !== undefined) {
|
||||
body.assignee_ids = (body.assignee_ids as IDataObject[]).map(
|
||||
(data) => data['assignee'],
|
||||
);
|
||||
body.assignee_ids = (body.assignee_ids as IDataObject[]).map((data) => data.assignee);
|
||||
}
|
||||
|
||||
endpoint = `${baseEndpoint}/issues/${issueNumber}`;
|
||||
@@ -1132,7 +1130,7 @@ export class Gitlab implements INodeType {
|
||||
|
||||
requestMethod = 'POST';
|
||||
|
||||
body = this.getNodeParameter('additionalFields', i, {}) as IDataObject;
|
||||
body = this.getNodeParameter('additionalFields', i, {});
|
||||
|
||||
body.tag_name = this.getNodeParameter('releaseTag', i) as string;
|
||||
|
||||
@@ -1173,11 +1171,11 @@ export class Gitlab implements INodeType {
|
||||
|
||||
const id = this.getNodeParameter('projectId', i) as string;
|
||||
|
||||
qs = this.getNodeParameter('additionalFields', i, {}) as IDataObject;
|
||||
qs = this.getNodeParameter('additionalFields', i, {});
|
||||
|
||||
returnAll = this.getNodeParameter('returnAll', 0);
|
||||
|
||||
if (returnAll === false) {
|
||||
if (!returnAll) {
|
||||
qs.per_page = this.getNodeParameter('limit', 0);
|
||||
}
|
||||
|
||||
@@ -1194,7 +1192,7 @@ export class Gitlab implements INodeType {
|
||||
|
||||
const tagName = this.getNodeParameter('tag_name', i) as string;
|
||||
|
||||
body = this.getNodeParameter('additionalFields', i, {}) as IDataObject;
|
||||
body = this.getNodeParameter('additionalFields', i, {});
|
||||
if (body.milestones) {
|
||||
body.milestones = (body.milestones as string).split(',');
|
||||
}
|
||||
@@ -1237,7 +1235,7 @@ export class Gitlab implements INodeType {
|
||||
});
|
||||
}
|
||||
|
||||
if (returnAll === true) {
|
||||
if (returnAll) {
|
||||
responseData = await gitlabApiRequestAllItems.call(
|
||||
this,
|
||||
requestMethod,
|
||||
|
||||
@@ -232,8 +232,8 @@ export class GitlabTrigger implements INodeType {
|
||||
|
||||
// gitlab set the push_events to true when the field it's not sent.
|
||||
// set it to false when it's not picked by the user.
|
||||
if (events['push_events'] === undefined) {
|
||||
events['push_events'] = false;
|
||||
if (events.push_events === undefined) {
|
||||
events.push_events = false;
|
||||
}
|
||||
|
||||
const path = `${owner}/${repository}`.replace(/\//g, '%2F');
|
||||
@@ -262,7 +262,7 @@ export class GitlabTrigger implements INodeType {
|
||||
|
||||
const webhookData = this.getWorkflowStaticData('node');
|
||||
webhookData.webhookId = responseData.id as string;
|
||||
webhookData.webhookEvents = eventsArray as string[];
|
||||
webhookData.webhookEvents = eventsArray;
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user