mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): Introduce overload for record-type node parameter (no-changelog) (#4648)
* 📘 Set up overload * 🔥 Remove inferrable record assertions * 👕 Fix semicolon * 👕 Fix another semicolon
This commit is contained in:
@@ -459,7 +459,7 @@ export class ClickUp implements INodeType {
|
||||
}
|
||||
if (operation === 'update') {
|
||||
const checklistId = this.getNodeParameter('checklist', i) as string;
|
||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
const updateFields = this.getNodeParameter('updateFields', i);
|
||||
const body: IDataObject = {};
|
||||
if (updateFields.name) {
|
||||
body.name = updateFields.name as string;
|
||||
@@ -480,7 +480,7 @@ export class ClickUp implements INodeType {
|
||||
if (operation === 'create') {
|
||||
const checklistId = this.getNodeParameter('checklist', i) as string;
|
||||
const name = this.getNodeParameter('name', i) as string;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const body: IDataObject = {
|
||||
name,
|
||||
};
|
||||
@@ -508,7 +508,7 @@ export class ClickUp implements INodeType {
|
||||
if (operation === 'update') {
|
||||
const checklistId = this.getNodeParameter('checklist', i) as string;
|
||||
const checklistItemId = this.getNodeParameter('checklistItem', i) as string;
|
||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
const updateFields = this.getNodeParameter('updateFields', i);
|
||||
const body: IDataObject = {};
|
||||
if (updateFields.name) {
|
||||
body.name = updateFields.name as string;
|
||||
@@ -536,7 +536,7 @@ export class ClickUp implements INodeType {
|
||||
const resource = this.getNodeParameter('commentOn', i) as string;
|
||||
const id = this.getNodeParameter('id', i) as string;
|
||||
const commentText = this.getNodeParameter('commentText', i) as string;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const body: IDataObject = {
|
||||
comment_text: commentText,
|
||||
};
|
||||
@@ -574,7 +574,7 @@ export class ClickUp implements INodeType {
|
||||
}
|
||||
if (operation === 'update') {
|
||||
const commentId = this.getNodeParameter('comment', i) as string;
|
||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
const updateFields = this.getNodeParameter('updateFields', i);
|
||||
const body: IDataObject = {};
|
||||
if (updateFields.commentText) {
|
||||
body.comment_text = updateFields.commentText as string;
|
||||
@@ -613,7 +613,7 @@ export class ClickUp implements INodeType {
|
||||
responseData = await clickupApiRequest.call(this, 'GET', `/folder/${folderId}`);
|
||||
}
|
||||
if (operation === 'getAll') {
|
||||
const filters = this.getNodeParameter('filters', i) as IDataObject;
|
||||
const filters = this.getNodeParameter('filters', i);
|
||||
const spaceId = this.getNodeParameter('space', i) as string;
|
||||
if (filters.archived) {
|
||||
qs.archived = filters.archived as boolean;
|
||||
@@ -631,7 +631,7 @@ export class ClickUp implements INodeType {
|
||||
}
|
||||
if (operation === 'update') {
|
||||
const folderId = this.getNodeParameter('folder', i) as string;
|
||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
const updateFields = this.getNodeParameter('updateFields', i);
|
||||
const body: IDataObject = {};
|
||||
if (updateFields.name) {
|
||||
body.name = updateFields.name as string;
|
||||
@@ -643,7 +643,7 @@ export class ClickUp implements INodeType {
|
||||
if (operation === 'create') {
|
||||
const teamId = this.getNodeParameter('team', i) as string;
|
||||
const name = this.getNodeParameter('name', i) as string;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const body: IDataObject = {
|
||||
name,
|
||||
};
|
||||
@@ -692,7 +692,7 @@ export class ClickUp implements INodeType {
|
||||
}
|
||||
if (operation === 'update') {
|
||||
const goalId = this.getNodeParameter('goal', i) as string;
|
||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
const updateFields = this.getNodeParameter('updateFields', i);
|
||||
const body: IDataObject = {};
|
||||
if (updateFields.name) {
|
||||
body.name = updateFields.name as string;
|
||||
@@ -725,7 +725,7 @@ export class ClickUp implements INodeType {
|
||||
const goalId = this.getNodeParameter('goal', i) as string;
|
||||
const name = this.getNodeParameter('name', i) as string;
|
||||
const type = this.getNodeParameter('type', i) as string;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const body: IDataObject = {
|
||||
name,
|
||||
type,
|
||||
@@ -793,7 +793,7 @@ export class ClickUp implements INodeType {
|
||||
}
|
||||
if (operation === 'update') {
|
||||
const keyResultId = this.getNodeParameter('keyResult', i) as string;
|
||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
const updateFields = this.getNodeParameter('updateFields', i);
|
||||
const body: IDataObject = {};
|
||||
if (updateFields.name) {
|
||||
body.name = updateFields.name as string;
|
||||
@@ -826,7 +826,7 @@ export class ClickUp implements INodeType {
|
||||
if (operation === 'create') {
|
||||
const teamId = this.getNodeParameter('team', i) as string;
|
||||
const email = this.getNodeParameter('email', i) as string;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const body: IDataObject = {
|
||||
email,
|
||||
};
|
||||
@@ -870,7 +870,7 @@ export class ClickUp implements INodeType {
|
||||
if (operation === 'update') {
|
||||
const teamId = this.getNodeParameter('team', i) as string;
|
||||
const guestId = this.getNodeParameter('guest', i) as string;
|
||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
const updateFields = this.getNodeParameter('updateFields', i);
|
||||
const body: IDataObject = {};
|
||||
if (updateFields.username) {
|
||||
body.username = updateFields.username as string;
|
||||
@@ -897,7 +897,7 @@ export class ClickUp implements INodeType {
|
||||
if (operation === 'create') {
|
||||
const listId = this.getNodeParameter('list', i) as string;
|
||||
const name = this.getNodeParameter('name', i) as string;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const body: ITask = {
|
||||
name,
|
||||
};
|
||||
@@ -954,7 +954,7 @@ export class ClickUp implements INodeType {
|
||||
}
|
||||
if (operation === 'update') {
|
||||
const taskId = this.getNodeParameter('id', i) as string;
|
||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
const updateFields = this.getNodeParameter('updateFields', i);
|
||||
const body: ITask = {
|
||||
assignees: {
|
||||
add: [],
|
||||
@@ -1018,7 +1018,7 @@ export class ClickUp implements INodeType {
|
||||
}
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
const filters = this.getNodeParameter('filters', i) as IDataObject;
|
||||
const filters = this.getNodeParameter('filters', i);
|
||||
if (filters.archived) {
|
||||
qs.archived = filters.archived as boolean;
|
||||
}
|
||||
@@ -1162,7 +1162,7 @@ export class ClickUp implements INodeType {
|
||||
if (operation === 'add') {
|
||||
const taskId = this.getNodeParameter('taskId', i) as string;
|
||||
const name = this.getNodeParameter('tagName', i) as string;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const qs: IDataObject = {};
|
||||
Object.assign(qs, additionalFields);
|
||||
responseData = await clickupApiRequest.call(
|
||||
@@ -1177,7 +1177,7 @@ export class ClickUp implements INodeType {
|
||||
if (operation === 'remove') {
|
||||
const taskId = this.getNodeParameter('taskId', i) as string;
|
||||
const name = this.getNodeParameter('tagName', i) as string;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const qs: IDataObject = {};
|
||||
Object.assign(qs, additionalFields);
|
||||
responseData = await clickupApiRequest.call(
|
||||
@@ -1248,7 +1248,7 @@ export class ClickUp implements INodeType {
|
||||
if (operation === 'update') {
|
||||
const teamId = this.getNodeParameter('team', i) as string;
|
||||
const timeEntryId = this.getNodeParameter('timeEntry', i) as string;
|
||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
const updateFields = this.getNodeParameter('updateFields', i);
|
||||
const timezone = this.getTimezone();
|
||||
const body: IDataObject = {};
|
||||
Object.assign(body, updateFields);
|
||||
@@ -1277,7 +1277,7 @@ export class ClickUp implements INodeType {
|
||||
if (operation === 'getAll') {
|
||||
const teamId = this.getNodeParameter('team', i) as string;
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
const filters = this.getNodeParameter('filters', i) as IDataObject;
|
||||
const filters = this.getNodeParameter('filters', i);
|
||||
const timezone = this.getTimezone();
|
||||
Object.assign(qs, filters);
|
||||
|
||||
@@ -1321,7 +1321,7 @@ export class ClickUp implements INodeType {
|
||||
const taskId = this.getNodeParameter('task', i) as string;
|
||||
const start = this.getNodeParameter('start', i) as string;
|
||||
const duration = this.getNodeParameter('duration', i) as number;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const timezone = this.getTimezone();
|
||||
const body: IDataObject = {
|
||||
start: moment.tz(start, timezone).valueOf(),
|
||||
@@ -1347,7 +1347,7 @@ export class ClickUp implements INodeType {
|
||||
const taskId = this.getNodeParameter('task', i) as string;
|
||||
const body: IDataObject = {};
|
||||
body.tid = taskId;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
Object.assign(body, additionalFields);
|
||||
responseData = await clickupApiRequest.call(
|
||||
this,
|
||||
@@ -1503,7 +1503,7 @@ export class ClickUp implements INodeType {
|
||||
const spaceId = this.getNodeParameter('space', i) as string;
|
||||
const folderless = this.getNodeParameter('folderless', i) as string;
|
||||
const name = this.getNodeParameter('name', i) as string;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const body: IList = {
|
||||
name,
|
||||
};
|
||||
@@ -1582,7 +1582,7 @@ export class ClickUp implements INodeType {
|
||||
responseData = await clickupApiRequest.call(this, 'GET', `/list/${listId}`);
|
||||
}
|
||||
if (operation === 'getAll') {
|
||||
const filters = this.getNodeParameter('filters', i) as IDataObject;
|
||||
const filters = this.getNodeParameter('filters', i);
|
||||
const spaceId = this.getNodeParameter('space', i) as string;
|
||||
const folderless = this.getNodeParameter('folderless', i) as boolean;
|
||||
if (filters.archived) {
|
||||
@@ -1601,7 +1601,7 @@ export class ClickUp implements INodeType {
|
||||
}
|
||||
if (operation === 'update') {
|
||||
const listId = this.getNodeParameter('list', i) as string;
|
||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
const updateFields = this.getNodeParameter('updateFields', i);
|
||||
const body: IList = {};
|
||||
if (updateFields.name) {
|
||||
body.name = updateFields.name as string;
|
||||
|
||||
Reference in New Issue
Block a user