mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +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:
@@ -276,7 +276,7 @@ export class GmailV2 implements INodeType {
|
||||
if (resource === 'message') {
|
||||
if (operation === 'send') {
|
||||
// https://developers.google.com/gmail/api/v1/reference/users/messages/send
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
const sendTo = this.getNodeParameter('sendTo', i) as string;
|
||||
let qs: IDataObject = {};
|
||||
|
||||
@@ -339,7 +339,7 @@ export class GmailV2 implements INodeType {
|
||||
}
|
||||
if (operation === 'reply') {
|
||||
const messageIdGmail = this.getNodeParameter('messageId', i) as string;
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
|
||||
responseData = await replayToEmail.call(this, items, messageIdGmail, options, i);
|
||||
}
|
||||
@@ -509,7 +509,7 @@ export class GmailV2 implements INodeType {
|
||||
if (resource === 'draft') {
|
||||
if (operation === 'create') {
|
||||
// https://developers.google.com/gmail/api/v1/reference/users/drafts/create
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
let qs: IDataObject = {};
|
||||
|
||||
let to = '';
|
||||
@@ -573,7 +573,7 @@ export class GmailV2 implements INodeType {
|
||||
const endpoint = `/gmail/v1/users/me/drafts/${id}`;
|
||||
const qs: IDataObject = {};
|
||||
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
qs.format = 'raw';
|
||||
|
||||
responseData = await googleApiRequest.call(this, 'GET', endpoint, {}, qs);
|
||||
@@ -606,7 +606,7 @@ export class GmailV2 implements INodeType {
|
||||
}
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
const qs: IDataObject = {};
|
||||
Object.assign(qs, options);
|
||||
|
||||
@@ -679,7 +679,7 @@ export class GmailV2 implements INodeType {
|
||||
const id = this.getNodeParameter('threadId', i);
|
||||
const endpoint = `/gmail/v1/users/me/threads/${id}`;
|
||||
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
const onlyMessages = options.returnOnlyMessages || false;
|
||||
const qs: IDataObject = {};
|
||||
|
||||
@@ -706,7 +706,7 @@ export class GmailV2 implements INodeType {
|
||||
if (operation === 'getAll') {
|
||||
//https://developers.google.com/gmail/api/reference/rest/v1/users.threads/list
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
const filters = this.getNodeParameter('filters', i) as IDataObject;
|
||||
const filters = this.getNodeParameter('filters', i);
|
||||
const qs: IDataObject = {};
|
||||
Object.assign(qs, prepareQuery.call(this, filters));
|
||||
|
||||
@@ -739,7 +739,7 @@ export class GmailV2 implements INodeType {
|
||||
}
|
||||
if (operation === 'reply') {
|
||||
const messageIdGmail = this.getNodeParameter('messageId', i) as string;
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
|
||||
responseData = await replayToEmail.call(this, items, messageIdGmail, options, i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user