1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-11-14 01:57:45 +03:00

👕 Fix lint issue

This commit is contained in:
Jan Oberhauser 2020-10-22 18:00:28 +02:00
parent 53162ba462
commit 546b79bea0
54 changed files with 257 additions and 257 deletions

View File

@ -79,14 +79,14 @@ export class Automizy implements INodeType {
// Get all the tags to display them to user so that he can // Get all the tags to display them to user so that he can
// select them easily // select them easily
async getLists( async getLists(
this: ILoadOptionsFunctions this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> { ): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const lists = await automizyApiRequestAllItems.call( const lists = await automizyApiRequestAllItems.call(
this, this,
'smartLists', 'smartLists',
'GET', 'GET',
`/smart-lists` `/smart-lists`,
); );
for (const list of lists) { for (const list of lists) {
returnData.push({ returnData.push({
@ -97,14 +97,14 @@ export class Automizy implements INodeType {
return returnData; return returnData;
}, },
async getTags( async getTags(
this: ILoadOptionsFunctions this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> { ): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const tags = await automizyApiRequestAllItems.call( const tags = await automizyApiRequestAllItems.call(
this, this,
'contactTags', 'contactTags',
'GET', 'GET',
'/contacts/tag-manager' '/contacts/tag-manager',
); );
for (const tag of tags) { for (const tag of tags) {
returnData.push({ returnData.push({
@ -115,14 +115,14 @@ export class Automizy implements INodeType {
return returnData; return returnData;
}, },
async getCustomFields( async getCustomFields(
this: ILoadOptionsFunctions this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> { ): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const customFields = await automizyApiRequestAllItems.call( const customFields = await automizyApiRequestAllItems.call(
this, this,
'customFields', 'customFields',
'GET', 'GET',
'/custom-fields' '/custom-fields',
); );
for (const customField of customFields) { for (const customField of customFields) {
returnData.push({ returnData.push({
@ -178,7 +178,7 @@ export class Automizy implements INodeType {
this, this,
'POST', 'POST',
`/smart-lists/${listId}/contacts`, `/smart-lists/${listId}/contacts`,
body body,
); );
} }
@ -188,7 +188,7 @@ export class Automizy implements INodeType {
responseData = await automizyApiRequest.call( responseData = await automizyApiRequest.call(
this, this,
'DELETE', 'DELETE',
`/contacts/${contactId}` `/contacts/${contactId}`,
); );
responseData = { success: true }; responseData = { success: true };
@ -200,7 +200,7 @@ export class Automizy implements INodeType {
responseData = await automizyApiRequest.call( responseData = await automizyApiRequest.call(
this, this,
'GET', 'GET',
`/contacts/${contactId}` `/contacts/${contactId}`,
); );
} }
@ -227,7 +227,7 @@ export class Automizy implements INodeType {
'GET', 'GET',
`/smart-lists/${listId}/contacts`, `/smart-lists/${listId}/contacts`,
{}, {},
qs qs,
); );
} else { } else {
@ -238,7 +238,7 @@ export class Automizy implements INodeType {
'GET', 'GET',
`/smart-lists/${listId}/contacts`, `/smart-lists/${listId}/contacts`,
{}, {},
qs qs,
); );
responseData = responseData.contacts; responseData = responseData.contacts;
@ -272,7 +272,7 @@ export class Automizy implements INodeType {
this, this,
'PATCH', 'PATCH',
`/contacts/${email}`, `/contacts/${email}`,
body body,
); );
} }
} }
@ -290,7 +290,7 @@ export class Automizy implements INodeType {
this, this,
'POST', 'POST',
`/smart-lists`, `/smart-lists`,
body body,
); );
} }
@ -300,7 +300,7 @@ export class Automizy implements INodeType {
responseData = await automizyApiRequest.call( responseData = await automizyApiRequest.call(
this, this,
'DELETE', 'DELETE',
`/smart-lists/${listId}` `/smart-lists/${listId}`,
); );
responseData = { success: true }; responseData = { success: true };
@ -312,7 +312,7 @@ export class Automizy implements INodeType {
responseData = await automizyApiRequest.call( responseData = await automizyApiRequest.call(
this, this,
'GET', 'GET',
`/smart-lists/${listId}` `/smart-lists/${listId}`,
); );
} }
@ -337,7 +337,7 @@ export class Automizy implements INodeType {
'GET', 'GET',
`/smart-lists`, `/smart-lists`,
{}, {},
qs qs,
); );
} else { } else {
@ -348,7 +348,7 @@ export class Automizy implements INodeType {
'GET', 'GET',
`/smart-lists`, `/smart-lists`,
{}, {},
qs qs,
); );
responseData = responseData.smartLists; responseData = responseData.smartLists;
@ -368,7 +368,7 @@ export class Automizy implements INodeType {
this, this,
'PATCH', 'PATCH',
`/smart-lists/${listId}`, `/smart-lists/${listId}`,
body body,
); );
} }
} }

View File

@ -43,7 +43,7 @@ export async function automizyApiRequest(this: IExecuteFunctions | IExecuteSingl
if (error.response && error.response.body) { if (error.response && error.response.body) {
throw new Error( throw new Error(
`Automizy error response [${error.statusCode}]: ${error.response.body.title}` `Automizy error response [${error.statusCode}]: ${error.response.body.title}`,
); );
} }

View File

@ -173,7 +173,7 @@ export class AwsLambda implements INodeType {
{ {
'X-Amz-Invocation-Type': params.InvocationType, 'X-Amz-Invocation-Type': params.InvocationType,
'Content-Type': 'application/x-amz-json-1.0', 'Content-Type': 'application/x-amz-json-1.0',
} },
); );
} catch (err) { } catch (err) {
throw new Error(`AWS Error: ${err}`); throw new Error(`AWS Error: ${err}`);

View File

@ -261,7 +261,7 @@ export class Clockify implements INodeType {
'POST', 'POST',
`/workspaces/${workspaceId}/projects`, `/workspaces/${workspaceId}/projects`,
body, body,
qs qs,
); );
} }
@ -276,7 +276,7 @@ export class Clockify implements INodeType {
'DELETE', 'DELETE',
`/workspaces/${workspaceId}/projects/${projectId}`, `/workspaces/${workspaceId}/projects/${projectId}`,
{}, {},
qs qs,
); );
responseData = { success: true }; responseData = { success: true };
@ -293,7 +293,7 @@ export class Clockify implements INodeType {
'GET', 'GET',
`/workspaces/${workspaceId}/projects/${projectId}`, `/workspaces/${workspaceId}/projects/${projectId}`,
{}, {},
qs qs,
); );
} }
@ -313,7 +313,7 @@ export class Clockify implements INodeType {
'GET', 'GET',
`/workspaces/${workspaceId}/projects`, `/workspaces/${workspaceId}/projects`,
{}, {},
qs qs,
); );
} else { } else {
@ -325,7 +325,7 @@ export class Clockify implements INodeType {
'GET', 'GET',
`/workspaces/${workspaceId}/projects`, `/workspaces/${workspaceId}/projects`,
{}, {},
qs qs,
); );
responseData = responseData.splice(0, qs.limit); responseData = responseData.splice(0, qs.limit);
@ -356,7 +356,7 @@ export class Clockify implements INodeType {
'PUT', 'PUT',
`/workspaces/${workspaceId}/projects/${projectId}`, `/workspaces/${workspaceId}/projects/${projectId}`,
body, body,
qs qs,
); );
} }
} }
@ -378,7 +378,7 @@ export class Clockify implements INodeType {
'POST', 'POST',
`/workspaces/${workspaceId}/tags`, `/workspaces/${workspaceId}/tags`,
body, body,
qs qs,
); );
} }
@ -393,7 +393,7 @@ export class Clockify implements INodeType {
'DELETE', 'DELETE',
`/workspaces/${workspaceId}/tags/${tagId}`, `/workspaces/${workspaceId}/tags/${tagId}`,
{}, {},
qs qs,
); );
responseData = { success: true }; responseData = { success: true };
@ -415,7 +415,7 @@ export class Clockify implements INodeType {
'GET', 'GET',
`/workspaces/${workspaceId}/tags`, `/workspaces/${workspaceId}/tags`,
{}, {},
qs qs,
); );
} else { } else {
@ -427,7 +427,7 @@ export class Clockify implements INodeType {
'GET', 'GET',
`/workspaces/${workspaceId}/tags`, `/workspaces/${workspaceId}/tags`,
{}, {},
qs qs,
); );
responseData = responseData.splice(0, qs.limit); responseData = responseData.splice(0, qs.limit);
@ -451,7 +451,7 @@ export class Clockify implements INodeType {
'PUT', 'PUT',
`/workspaces/${workspaceId}/tags/${tagId}`, `/workspaces/${workspaceId}/tags/${tagId}`,
body, body,
qs qs,
); );
} }
} }
@ -490,7 +490,7 @@ export class Clockify implements INodeType {
'POST', 'POST',
`/workspaces/${workspaceId}/time-entries`, `/workspaces/${workspaceId}/time-entries`,
body, body,
qs qs,
); );
} }
@ -505,7 +505,7 @@ export class Clockify implements INodeType {
'DELETE', 'DELETE',
`/workspaces/${workspaceId}/time-entries/${timeEntryId}`, `/workspaces/${workspaceId}/time-entries/${timeEntryId}`,
{}, {},
qs qs,
); );
responseData = { success: true }; responseData = { success: true };
@ -522,7 +522,7 @@ export class Clockify implements INodeType {
'GET', 'GET',
`/workspaces/${workspaceId}/time-entries/${timeEntryId}`, `/workspaces/${workspaceId}/time-entries/${timeEntryId}`,
{}, {},
qs qs,
); );
} }
@ -555,7 +555,7 @@ export class Clockify implements INodeType {
'GET', 'GET',
`/workspaces/${workspaceId}/time-entries/${timeEntryId}`, `/workspaces/${workspaceId}/time-entries/${timeEntryId}`,
{}, {},
qs qs,
); );
body.start = start; body.start = start;
@ -566,7 +566,7 @@ export class Clockify implements INodeType {
'PUT', 'PUT',
`/workspaces/${workspaceId}/time-entries/${timeEntryId}`, `/workspaces/${workspaceId}/time-entries/${timeEntryId}`,
body, body,
qs qs,
); );
} }
} }

View File

@ -74,7 +74,7 @@ export class CoinGecko implements INodeType {
const currencies = await coinGeckoApiRequest.call( const currencies = await coinGeckoApiRequest.call(
this, this,
'GET', 'GET',
'/simple/supported_vs_currencies' '/simple/supported_vs_currencies',
); );
currencies.sort(); currencies.sort();
for (const currency of currencies) { for (const currency of currencies) {
@ -91,7 +91,7 @@ export class CoinGecko implements INodeType {
const coins = await coinGeckoApiRequest.call( const coins = await coinGeckoApiRequest.call(
this, this,
'GET', 'GET',
'/coins/list' '/coins/list',
); );
for (const coin of coins) { for (const coin of coins) {
returnData.push({ returnData.push({
@ -112,7 +112,7 @@ export class CoinGecko implements INodeType {
const exchanges = await coinGeckoApiRequest.call( const exchanges = await coinGeckoApiRequest.call(
this, this,
'GET', 'GET',
'/exchanges/list' '/exchanges/list',
); );
for (const exchange of exchanges) { for (const exchange of exchanges) {
returnData.push({ returnData.push({
@ -128,7 +128,7 @@ export class CoinGecko implements INodeType {
const countryCodes = await coinGeckoApiRequest.call( const countryCodes = await coinGeckoApiRequest.call(
this, this,
'GET', 'GET',
'/events/countries' '/events/countries',
); );
for (const code of countryCodes.data) { for (const code of countryCodes.data) {
if (!code.code) { if (!code.code) {
@ -147,7 +147,7 @@ export class CoinGecko implements INodeType {
const eventTypes = await coinGeckoApiRequest.call( const eventTypes = await coinGeckoApiRequest.call(
this, this,
'GET', 'GET',
'/events/types' '/events/types',
); );
for (const type of eventTypes.data) { for (const type of eventTypes.data) {
returnData.push({ returnData.push({
@ -196,7 +196,7 @@ export class CoinGecko implements INodeType {
'GET', 'GET',
`/coins/${coinId}`, `/coins/${coinId}`,
{}, {},
qs qs,
); );
} }
@ -209,7 +209,7 @@ export class CoinGecko implements INodeType {
'GET', 'GET',
`/coins/${platformId}/contract/${contractAddress}`, `/coins/${platformId}/contract/${contractAddress}`,
{}, {},
qs qs,
); );
} }
} }
@ -225,7 +225,7 @@ export class CoinGecko implements INodeType {
'GET', 'GET',
'/coins/list', '/coins/list',
{}, {},
qs qs,
); );
if (returnAll === false) { if (returnAll === false) {
@ -256,7 +256,7 @@ export class CoinGecko implements INodeType {
'GET', 'GET',
`/coins/markets`, `/coins/markets`,
{}, {},
qs qs,
); );
} else { } else {
const limit = this.getNodeParameter('limit', i) as number; const limit = this.getNodeParameter('limit', i) as number;
@ -268,7 +268,7 @@ export class CoinGecko implements INodeType {
'GET', 'GET',
`/coins/markets`, `/coins/markets`,
{}, {},
qs qs,
); );
} }
} }
@ -295,7 +295,7 @@ export class CoinGecko implements INodeType {
'GET', 'GET',
'/simple/price', '/simple/price',
{}, {},
qs qs,
); );
} }
@ -310,7 +310,7 @@ export class CoinGecko implements INodeType {
'GET', 'GET',
`/simple/token_price/${platformId}`, `/simple/token_price/${platformId}`,
{}, {},
qs qs,
); );
} }
} }
@ -336,7 +336,7 @@ export class CoinGecko implements INodeType {
'GET', 'GET',
`/coins/${coinId}/tickers`, `/coins/${coinId}/tickers`,
{}, {},
qs qs,
); );
} else { } else {
const limit = this.getNodeParameter('limit', i) as number; const limit = this.getNodeParameter('limit', i) as number;
@ -346,7 +346,7 @@ export class CoinGecko implements INodeType {
'GET', 'GET',
`/coins/${coinId}/tickers`, `/coins/${coinId}/tickers`,
{}, {},
qs qs,
); );
responseData = responseData.tickers; responseData = responseData.tickers;
@ -370,7 +370,7 @@ export class CoinGecko implements INodeType {
'GET', 'GET',
`/coins/${coinId}/history`, `/coins/${coinId}/history`,
{}, {},
qs qs,
); );
} }
@ -395,7 +395,7 @@ export class CoinGecko implements INodeType {
'GET', 'GET',
`/coins/${coinId}/market_chart`, `/coins/${coinId}/market_chart`,
{}, {},
qs qs,
); );
} }
@ -408,7 +408,7 @@ export class CoinGecko implements INodeType {
'GET', 'GET',
`/coins/${platformId}/contract/${contractAddress}/market_chart`, `/coins/${platformId}/contract/${contractAddress}/market_chart`,
{}, {},
qs qs,
); );
} }
@ -436,7 +436,7 @@ export class CoinGecko implements INodeType {
'GET', 'GET',
`/coins/${baseCurrency}/ohlc`, `/coins/${baseCurrency}/ohlc`,
{}, {},
qs qs,
); );
for (let idx = 0; idx < responseData.length; idx++) { for (let idx = 0; idx < responseData.length; idx++) {
@ -462,7 +462,7 @@ export class CoinGecko implements INodeType {
'GET', 'GET',
'/events', '/events',
{}, {},
qs qs,
); );
} else { } else {
const limit = this.getNodeParameter('limit', i) as number; const limit = this.getNodeParameter('limit', i) as number;
@ -474,7 +474,7 @@ export class CoinGecko implements INodeType {
'GET', 'GET',
'/events', '/events',
{}, {},
qs qs,
); );
responseData = responseData.data; responseData = responseData.data;
} }
@ -499,7 +499,7 @@ export class CoinGecko implements INodeType {
'GET', 'GET',
'/simple/price', '/simple/price',
{}, {},
qs qs,
); );
} }
@ -521,7 +521,7 @@ export class CoinGecko implements INodeType {
'GET', 'GET',
`/simple/token_price/${id}`, `/simple/token_price/${id}`,
{}, {},
qs qs,
); );
} }
} }

View File

@ -13,7 +13,7 @@ export async function disqusApiRequest(
qs: IDataObject = {}, qs: IDataObject = {},
uri?: string, uri?: string,
body: IDataObject = {}, body: IDataObject = {},
option: IDataObject = {} option: IDataObject = {},
): Promise<any> { // tslint:disable-line:no-any ): Promise<any> { // tslint:disable-line:no-any
const credentials = this.getCredentials('disqusApi') as IDataObject; const credentials = this.getCredentials('disqusApi') as IDataObject;
@ -74,7 +74,7 @@ export async function disqusApiRequestAllItems(
qs: IDataObject = {}, qs: IDataObject = {},
uri?: string, uri?: string,
body: IDataObject = {}, body: IDataObject = {},
option: IDataObject = {} option: IDataObject = {},
): Promise<any> { // tslint:disable-line:no-any ): Promise<any> { // tslint:disable-line:no-any
const returnData: IDataObject[] = []; const returnData: IDataObject[] = [];

View File

@ -59,7 +59,7 @@ export async function dropboxApiRequest(this: IHookFunctions | IExecuteFunctions
if (error.error && error.error.error_summary) { if (error.error && error.error.error_summary) {
// Try to return the error prettier // Try to return the error prettier
throw new Error( throw new Error(
`Dropbox error response [${error.statusCode}]: ${error.error.error_summary}` `Dropbox error response [${error.statusCode}]: ${error.error.error_summary}`,
); );
} }

View File

@ -110,7 +110,7 @@ export class ExecuteCommand implements INodeType {
stderr, stderr,
stdout, stdout,
}, },
} },
); );
} }

View File

@ -483,7 +483,7 @@ export class GithubTrigger implements INodeType {
body: bodyData, body: bodyData,
headers: this.getHeaderData(), headers: this.getHeaderData(),
query: this.getQueryData(), query: this.getQueryData(),
} },
); );
return { return {

View File

@ -287,7 +287,7 @@ export class GitlabTrigger implements INodeType {
body: bodyData, body: bodyData,
headers: this.getHeaderData(), headers: this.getHeaderData(),
query: this.getQueryData(), query: this.getQueryData(),
} },
); );
return { return {

View File

@ -40,7 +40,7 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
errors = errors.map((e: IDataObject) => e.message); errors = errors.map((e: IDataObject) => e.message);
// Try to return the error prettier // Try to return the error prettier
throw new Error( throw new Error(
`Google Calendar error response [${error.statusCode}]: ${errors.join('|')}` `Google Calendar error response [${error.statusCode}]: ${errors.join('|')}`,
); );
} }
throw error; throw error;

View File

@ -72,14 +72,14 @@ export class GoogleCalendar implements INodeType {
// Get all the calendars to display them to user so that he can // Get all the calendars to display them to user so that he can
// select them easily // select them easily
async getCalendars( async getCalendars(
this: ILoadOptionsFunctions this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> { ): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const calendars = await googleApiRequestAllItems.call( const calendars = await googleApiRequestAllItems.call(
this, this,
'items', 'items',
'GET', 'GET',
'/calendar/v3/users/me/calendarList' '/calendar/v3/users/me/calendarList',
); );
for (const calendar of calendars) { for (const calendar of calendars) {
const calendarName = calendar.summary; const calendarName = calendar.summary;
@ -94,13 +94,13 @@ export class GoogleCalendar implements INodeType {
// Get all the colors to display them to user so that he can // Get all the colors to display them to user so that he can
// select them easily // select them easily
async getColors( async getColors(
this: ILoadOptionsFunctions this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> { ): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const { event } = await googleApiRequest.call( const { event } = await googleApiRequest.call(
this, this,
'GET', 'GET',
'/calendar/v3/colors' '/calendar/v3/colors',
); );
for (const key of Object.keys(event)) { for (const key of Object.keys(event)) {
const colorName = `Background: ${event[key].background} - Foreground: ${event[key].foreground}`; const colorName = `Background: ${event[key].background} - Foreground: ${event[key].foreground}`;
@ -115,7 +115,7 @@ export class GoogleCalendar implements INodeType {
// Get all the timezones to display them to user so that he can // Get all the timezones to display them to user so that he can
// select them easily // select them easily
async getTimezones( async getTimezones(
this: ILoadOptionsFunctions this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> { ): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
for (const timezone of moment.tz.names()) { for (const timezone of moment.tz.names()) {
@ -148,11 +148,11 @@ export class GoogleCalendar implements INodeType {
const end = this.getNodeParameter('end', i) as string; const end = this.getNodeParameter('end', i) as string;
const useDefaultReminders = this.getNodeParameter( const useDefaultReminders = this.getNodeParameter(
'useDefaultReminders', 'useDefaultReminders',
i i,
) as boolean; ) as boolean;
const additionalFields = this.getNodeParameter( const additionalFields = this.getNodeParameter(
'additionalFields', 'additionalFields',
i i,
) as IDataObject; ) as IDataObject;
if (additionalFields.maxAttendees) { if (additionalFields.maxAttendees) {
qs.maxAttendees = additionalFields.maxAttendees as number; qs.maxAttendees = additionalFields.maxAttendees as number;
@ -177,7 +177,7 @@ export class GoogleCalendar implements INodeType {
body.attendees = (additionalFields.attendees as string[]).map( body.attendees = (additionalFields.attendees as string[]).map(
attendee => { attendee => {
return { email: attendee }; return { email: attendee };
} },
); );
} }
if (additionalFields.color) { if (additionalFields.color) {
@ -213,7 +213,7 @@ export class GoogleCalendar implements INodeType {
if (!useDefaultReminders) { if (!useDefaultReminders) {
const reminders = (this.getNodeParameter( const reminders = (this.getNodeParameter(
'remindersUi', 'remindersUi',
i i,
) as IDataObject).remindersValues as IDataObject[]; ) as IDataObject).remindersValues as IDataObject[];
body.reminders = { body.reminders = {
useDefault: false, useDefault: false,
@ -242,24 +242,24 @@ export class GoogleCalendar implements INodeType {
additionalFields.repeatUntil additionalFields.repeatUntil
) { ) {
throw new Error( throw new Error(
`You can set either 'Repeat How Many Times' or 'Repeat Until' but not both` `You can set either 'Repeat How Many Times' or 'Repeat Until' but not both`,
); );
} }
if (additionalFields.repeatFrecuency) { if (additionalFields.repeatFrecuency) {
body.recurrence?.push( body.recurrence?.push(
`FREQ=${(additionalFields.repeatFrecuency as string).toUpperCase()};` `FREQ=${(additionalFields.repeatFrecuency as string).toUpperCase()};`,
); );
} }
if (additionalFields.repeatHowManyTimes) { if (additionalFields.repeatHowManyTimes) {
body.recurrence?.push( body.recurrence?.push(
`COUNT=${additionalFields.repeatHowManyTimes};` `COUNT=${additionalFields.repeatHowManyTimes};`,
); );
} }
if (additionalFields.repeatUntil) { if (additionalFields.repeatUntil) {
body.recurrence?.push( body.recurrence?.push(
`UNTIL=${moment(additionalFields.repeatUntil as string) `UNTIL=${moment(additionalFields.repeatUntil as string)
.utc() .utc()
.format('YYYYMMDDTHHmmss')}Z` .format('YYYYMMDDTHHmmss')}Z`,
); );
} }
if (body.recurrence.length !== 0) { if (body.recurrence.length !== 0) {
@ -270,7 +270,7 @@ export class GoogleCalendar implements INodeType {
'POST', 'POST',
`/calendar/v3/calendars/${calendarId}/events`, `/calendar/v3/calendars/${calendarId}/events`,
body, body,
qs qs,
); );
} }
//https://developers.google.com/calendar/v3/reference/events/delete //https://developers.google.com/calendar/v3/reference/events/delete
@ -285,7 +285,7 @@ export class GoogleCalendar implements INodeType {
this, this,
'DELETE', 'DELETE',
`/calendar/v3/calendars/${calendarId}/events/${eventId}`, `/calendar/v3/calendars/${calendarId}/events/${eventId}`,
{} {},
); );
responseData = { success: true }; responseData = { success: true };
} }
@ -305,7 +305,7 @@ export class GoogleCalendar implements INodeType {
'GET', 'GET',
`/calendar/v3/calendars/${calendarId}/events/${eventId}`, `/calendar/v3/calendars/${calendarId}/events/${eventId}`,
{}, {},
qs qs,
); );
} }
//https://developers.google.com/calendar/v3/reference/events/list //https://developers.google.com/calendar/v3/reference/events/list
@ -353,7 +353,7 @@ export class GoogleCalendar implements INodeType {
'GET', 'GET',
`/calendar/v3/calendars/${calendarId}/events`, `/calendar/v3/calendars/${calendarId}/events`,
{}, {},
qs qs,
); );
} else { } else {
qs.maxResults = this.getNodeParameter('limit', i) as number; qs.maxResults = this.getNodeParameter('limit', i) as number;
@ -362,7 +362,7 @@ export class GoogleCalendar implements INodeType {
'GET', 'GET',
`/calendar/v3/calendars/${calendarId}/events`, `/calendar/v3/calendars/${calendarId}/events`,
{}, {},
qs qs,
); );
responseData = responseData.items; responseData = responseData.items;
} }
@ -373,11 +373,11 @@ export class GoogleCalendar implements INodeType {
const eventId = this.getNodeParameter('eventId', i) as string; const eventId = this.getNodeParameter('eventId', i) as string;
const useDefaultReminders = this.getNodeParameter( const useDefaultReminders = this.getNodeParameter(
'useDefaultReminders', 'useDefaultReminders',
i i,
) as boolean; ) as boolean;
const updateFields = this.getNodeParameter( const updateFields = this.getNodeParameter(
'updateFields', 'updateFields',
i i,
) as IDataObject; ) as IDataObject;
if (updateFields.maxAttendees) { if (updateFields.maxAttendees) {
qs.maxAttendees = updateFields.maxAttendees as number; qs.maxAttendees = updateFields.maxAttendees as number;
@ -405,7 +405,7 @@ export class GoogleCalendar implements INodeType {
body.attendees = (updateFields.attendees as string[]).map( body.attendees = (updateFields.attendees as string[]).map(
attendee => { attendee => {
return { email: attendee }; return { email: attendee };
} },
); );
} }
if (updateFields.color) { if (updateFields.color) {
@ -441,7 +441,7 @@ export class GoogleCalendar implements INodeType {
if (!useDefaultReminders) { if (!useDefaultReminders) {
const reminders = (this.getNodeParameter( const reminders = (this.getNodeParameter(
'remindersUi', 'remindersUi',
i i,
) as IDataObject).remindersValues as IDataObject[]; ) as IDataObject).remindersValues as IDataObject[];
body.reminders = { body.reminders = {
useDefault: false, useDefault: false,
@ -467,12 +467,12 @@ export class GoogleCalendar implements INodeType {
body.recurrence = []; body.recurrence = [];
if (updateFields.repeatHowManyTimes && updateFields.repeatUntil) { if (updateFields.repeatHowManyTimes && updateFields.repeatUntil) {
throw new Error( throw new Error(
`You can set either 'Repeat How Many Times' or 'Repeat Until' but not both` `You can set either 'Repeat How Many Times' or 'Repeat Until' but not both`,
); );
} }
if (updateFields.repeatFrecuency) { if (updateFields.repeatFrecuency) {
body.recurrence?.push( body.recurrence?.push(
`FREQ=${(updateFields.repeatFrecuency as string).toUpperCase()};` `FREQ=${(updateFields.repeatFrecuency as string).toUpperCase()};`,
); );
} }
if (updateFields.repeatHowManyTimes) { if (updateFields.repeatHowManyTimes) {
@ -482,7 +482,7 @@ export class GoogleCalendar implements INodeType {
body.recurrence?.push( body.recurrence?.push(
`UNTIL=${moment(updateFields.repeatUntil as string) `UNTIL=${moment(updateFields.repeatUntil as string)
.utc() .utc()
.format('YYYYMMDDTHHmmss')}Z` .format('YYYYMMDDTHHmmss')}Z`,
); );
} }
if (body.recurrence.length !== 0) { if (body.recurrence.length !== 0) {
@ -495,7 +495,7 @@ export class GoogleCalendar implements INodeType {
'PATCH', 'PATCH',
`/calendar/v3/calendars/${calendarId}/events/${eventId}`, `/calendar/v3/calendars/${calendarId}/events/${eventId}`,
body, body,
qs qs,
); );
} }
} }

View File

@ -50,7 +50,7 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
// Try to return the error prettier // Try to return the error prettier
throw new Error( throw new Error(
`Google Contacts error response [${error.statusCode}]: ${errors}` `Google Contacts error response [${error.statusCode}]: ${errors}`,
); );
} }
throw error; throw error;

View File

@ -70,14 +70,14 @@ export class GoogleContacts implements INodeType {
// Get all the calendars to display them to user so that he can // Get all the calendars to display them to user so that he can
// select them easily // select them easily
async getGroups( async getGroups(
this: ILoadOptionsFunctions this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> { ): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const groups = await googleApiRequestAllItems.call( const groups = await googleApiRequestAllItems.call(
this, this,
'contactGroups', 'contactGroups',
'GET', 'GET',
`/contactGroups` `/contactGroups`,
); );
for (const group of groups) { for (const group of groups) {
const groupName = group.name; const groupName = group.name;
@ -219,7 +219,7 @@ export class GoogleContacts implements INodeType {
'POST', 'POST',
`/people:createContact`, `/people:createContact`,
body, body,
qs qs,
); );
responseData.contactId = responseData.resourceName.split('/')[1]; responseData.contactId = responseData.resourceName.split('/')[1];
@ -232,7 +232,7 @@ export class GoogleContacts implements INodeType {
this, this,
'DELETE', 'DELETE',
`/people/${contactId}:deleteContact`, `/people/${contactId}:deleteContact`,
{} {},
); );
responseData = { success: true }; responseData = { success: true };
} }
@ -253,7 +253,7 @@ export class GoogleContacts implements INodeType {
'GET', 'GET',
`/people/${contactId}`, `/people/${contactId}`,
{}, {},
qs qs,
); );
if (!rawData) { if (!rawData) {
@ -286,7 +286,7 @@ export class GoogleContacts implements INodeType {
'GET', 'GET',
`/people/me/connections`, `/people/me/connections`,
{}, {},
qs qs,
); );
} else { } else {
qs.pageSize = this.getNodeParameter('limit', i) as number; qs.pageSize = this.getNodeParameter('limit', i) as number;
@ -295,7 +295,7 @@ export class GoogleContacts implements INodeType {
'GET', 'GET',
`/people/me/connections`, `/people/me/connections`,
{}, {},
qs qs,
); );
responseData = responseData.connections; responseData = responseData.connections;
} }
@ -331,7 +331,7 @@ export class GoogleContacts implements INodeType {
'GET', 'GET',
`/people/${contactId}`, `/people/${contactId}`,
{}, {},
{ personFields: 'Names' } { personFields: 'Names' },
); );
etag = data.etag; etag = data.etag;
@ -479,7 +479,7 @@ export class GoogleContacts implements INodeType {
'PATCH', 'PATCH',
`/people/${contactId}:updateContact`, `/people/${contactId}:updateContact`,
body, body,
qs qs,
); );
responseData.contactId = responseData.resourceName.split('/')[1]; responseData.contactId = responseData.resourceName.split('/')[1];

View File

@ -121,7 +121,7 @@ function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoa
'typ': 'JWT', 'typ': 'JWT',
'alg': 'RS256', 'alg': 'RS256',
}, },
} },
); );
const options: OptionsWithUri = { const options: OptionsWithUri = {

View File

@ -66,14 +66,14 @@ export class GSuiteAdmin implements INodeType {
// Get all the domains to display them to user so that he can // Get all the domains to display them to user so that he can
// select them easily // select them easily
async getDomains( async getDomains(
this: ILoadOptionsFunctions this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> { ): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const domains = await googleApiRequestAllItems.call( const domains = await googleApiRequestAllItems.call(
this, this,
'domains', 'domains',
'GET', 'GET',
'/directory/v1/customer/my_customer/domains' '/directory/v1/customer/my_customer/domains',
); );
for (const domain of domains) { for (const domain of domains) {
const domainName = domain.domainName; const domainName = domain.domainName;
@ -88,14 +88,14 @@ export class GSuiteAdmin implements INodeType {
// Get all the schemas to display them to user so that he can // Get all the schemas to display them to user so that he can
// select them easily // select them easily
async getSchemas( async getSchemas(
this: ILoadOptionsFunctions this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> { ): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const schemas = await googleApiRequestAllItems.call( const schemas = await googleApiRequestAllItems.call(
this, this,
'schemas', 'schemas',
'GET', 'GET',
'/directory/v1/customer/my_customer/schemas' '/directory/v1/customer/my_customer/schemas',
); );
for (const schema of schemas) { for (const schema of schemas) {
const schemaName = schema.displayName; const schemaName = schema.displayName;
@ -173,7 +173,7 @@ export class GSuiteAdmin implements INodeType {
'POST', 'POST',
`/directory/v1/users`, `/directory/v1/users`,
body, body,
qs qs,
); );
if (makeAdmin) { if (makeAdmin) {
@ -182,7 +182,7 @@ export class GSuiteAdmin implements INodeType {
this, this,
'POST', 'POST',
`/directory/v1/users/${responseData.id}/makeAdmin`, `/directory/v1/users/${responseData.id}/makeAdmin`,
{ status: true } { status: true },
); );
responseData.isAdmin = true; responseData.isAdmin = true;
@ -198,7 +198,7 @@ export class GSuiteAdmin implements INodeType {
this, this,
'DELETE', 'DELETE',
`/directory/v1/users/${userId}`, `/directory/v1/users/${userId}`,
{} {},
); );
responseData = { success: true }; responseData = { success: true };
@ -230,7 +230,7 @@ export class GSuiteAdmin implements INodeType {
'GET', 'GET',
`/directory/v1/users/${userId}`, `/directory/v1/users/${userId}`,
{}, {},
qs qs,
); );
} }
@ -267,7 +267,7 @@ export class GSuiteAdmin implements INodeType {
'GET', 'GET',
`/directory/v1/users`, `/directory/v1/users`,
{}, {},
qs qs,
); );
} else { } else {
@ -279,7 +279,7 @@ export class GSuiteAdmin implements INodeType {
'GET', 'GET',
`/directory/v1/users`, `/directory/v1/users`,
{}, {},
qs qs,
); );
responseData = responseData.users; responseData = responseData.users;
@ -342,7 +342,7 @@ export class GSuiteAdmin implements INodeType {
'PUT', 'PUT',
`/directory/v1/users/${userId}`, `/directory/v1/users/${userId}`,
body, body,
qs qs,
); );
} }
} }

View File

@ -40,7 +40,7 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
errors = errors.map((e: IDataObject) => e.message); errors = errors.map((e: IDataObject) => e.message);
// Try to return the error prettier // Try to return the error prettier
throw new Error( throw new Error(
`G Suite Admin error response [${error.statusCode}]: ${errors.join('|')}` `G Suite Admin error response [${error.statusCode}]: ${errors.join('|')}`,
); );
} }
throw error; throw error;

View File

@ -136,14 +136,14 @@ export class Gmail implements INodeType {
// Get all the labels to display them to user so that he can // Get all the labels to display them to user so that he can
// select them easily // select them easily
async getLabels( async getLabels(
this: ILoadOptionsFunctions this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> { ): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const labels = await googleApiRequestAllItems.call( const labels = await googleApiRequestAllItems.call(
this, this,
'labels', 'labels',
'GET', 'GET',
'/gmail/v1/users/me/labels' '/gmail/v1/users/me/labels',
); );
for (const label of labels) { for (const label of labels) {
const labelName = label.name; const labelName = label.name;
@ -216,7 +216,7 @@ export class Gmail implements INodeType {
'GET', 'GET',
`/gmail/v1/users/me/labels`, `/gmail/v1/users/me/labels`,
{}, {},
qs qs,
); );
responseData = responseData.labels; responseData = responseData.labels;
@ -486,7 +486,7 @@ export class Gmail implements INodeType {
'GET', 'GET',
`/gmail/v1/users/me/messages`, `/gmail/v1/users/me/messages`,
{}, {},
qs qs,
); );
} else { } else {
qs.maxResults = this.getNodeParameter('limit', i) as number; qs.maxResults = this.getNodeParameter('limit', i) as number;
@ -495,7 +495,7 @@ export class Gmail implements INodeType {
'GET', 'GET',
`/gmail/v1/users/me/messages`, `/gmail/v1/users/me/messages`,
{}, {},
qs qs,
); );
responseData = responseData.messages; responseData = responseData.messages;
} }
@ -520,7 +520,7 @@ export class Gmail implements INodeType {
'GET', 'GET',
`/gmail/v1/users/me/messages/${responseData[i].id}`, `/gmail/v1/users/me/messages/${responseData[i].id}`,
body, body,
qs qs,
); );
if (format === 'resolved') { if (format === 'resolved') {
@ -692,7 +692,7 @@ export class Gmail implements INodeType {
'GET', 'GET',
`/gmail/v1/users/me/drafts`, `/gmail/v1/users/me/drafts`,
{}, {},
qs qs,
); );
} else { } else {
qs.maxResults = this.getNodeParameter('limit', i) as number; qs.maxResults = this.getNodeParameter('limit', i) as number;
@ -701,7 +701,7 @@ export class Gmail implements INodeType {
'GET', 'GET',
`/gmail/v1/users/me/drafts`, `/gmail/v1/users/me/drafts`,
{}, {},
qs qs,
); );
responseData = responseData.drafts; responseData = responseData.drafts;
} }
@ -726,7 +726,7 @@ export class Gmail implements INodeType {
'GET', 'GET',
`/gmail/v1/users/me/drafts/${responseData[i].id}`, `/gmail/v1/users/me/drafts/${responseData[i].id}`,
body, body,
qs qs,
); );
if (format === 'resolved') { if (format === 'resolved') {

View File

@ -108,7 +108,7 @@ function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoa
'typ': 'JWT', 'typ': 'JWT',
'alg': 'RS256', 'alg': 'RS256',
}, },
} },
); );
const options: OptionsWithUri = { const options: OptionsWithUri = {

View File

@ -19,7 +19,7 @@ export async function googleApiRequest(
body: IDataObject = {}, body: IDataObject = {},
qs: IDataObject = {}, qs: IDataObject = {},
uri?: string, uri?: string,
headers: IDataObject = {} headers: IDataObject = {},
): Promise<any> { // tslint:disable-line:no-any ): Promise<any> { // tslint:disable-line:no-any
const options: OptionsWithUri = { const options: OptionsWithUri = {
headers: { headers: {
@ -43,7 +43,7 @@ export async function googleApiRequest(
return await this.helpers.requestOAuth2.call( return await this.helpers.requestOAuth2.call(
this, this,
'googleTasksOAuth2Api', 'googleTasksOAuth2Api',
options options,
); );
} catch (error) { } catch (error) {
if (error.response && error.response.body && error.response.body.error) { if (error.response && error.response.body && error.response.body.error) {
@ -53,7 +53,7 @@ export async function googleApiRequest(
errors = errors.map((e: IDataObject) => e.message); errors = errors.map((e: IDataObject) => e.message);
// Try to return the error prettier // Try to return the error prettier
throw new Error( throw new Error(
`Google Tasks error response [${error.statusCode}]: ${errors.join('|')}` `Google Tasks error response [${error.statusCode}]: ${errors.join('|')}`,
); );
} }
throw error; throw error;
@ -66,7 +66,7 @@ export async function googleApiRequestAllItems(
method: string, method: string,
endpoint: string, endpoint: string,
body: IDataObject = {}, body: IDataObject = {},
query: IDataObject = {} query: IDataObject = {},
): Promise<any> { // tslint:disable-line:no-any ): Promise<any> { // tslint:disable-line:no-any
const returnData: IDataObject[] = []; const returnData: IDataObject[] = [];
@ -79,7 +79,7 @@ export async function googleApiRequestAllItems(
method, method,
endpoint, endpoint,
body, body,
query query,
); );
query.pageToken = responseData['nextPageToken']; query.pageToken = responseData['nextPageToken'];
returnData.push.apply(returnData, responseData[propertyName]); returnData.push.apply(returnData, responseData[propertyName]);

View File

@ -65,14 +65,14 @@ export class GoogleTasks implements INodeType {
// Get all the tasklists to display them to user so that he can select them easily // Get all the tasklists to display them to user so that he can select them easily
async getTasks( async getTasks(
this: ILoadOptionsFunctions this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> { ): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const tasks = await googleApiRequestAllItems.call( const tasks = await googleApiRequestAllItems.call(
this, this,
'items', 'items',
'GET', 'GET',
'/tasks/v1/users/@me/lists' '/tasks/v1/users/@me/lists',
); );
for (const task of tasks) { for (const task of tasks) {
const taskName = task.title; const taskName = task.title;
@ -105,7 +105,7 @@ export class GoogleTasks implements INodeType {
body.title = this.getNodeParameter('title', i) as string; body.title = this.getNodeParameter('title', i) as string;
const additionalFields = this.getNodeParameter( const additionalFields = this.getNodeParameter(
'additionalFields', 'additionalFields',
i i,
) as IDataObject; ) as IDataObject;
if (additionalFields.parent) { if (additionalFields.parent) {
@ -139,7 +139,7 @@ export class GoogleTasks implements INodeType {
'POST', 'POST',
`/tasks/v1/lists/${taskId}/tasks`, `/tasks/v1/lists/${taskId}/tasks`,
body, body,
qs qs,
); );
} }
if (operation === 'delete') { if (operation === 'delete') {
@ -151,7 +151,7 @@ export class GoogleTasks implements INodeType {
this, this,
'DELETE', 'DELETE',
`/tasks/v1/lists/${taskListId}/tasks/${taskId}`, `/tasks/v1/lists/${taskListId}/tasks/${taskId}`,
{} {},
); );
responseData = { success: true }; responseData = { success: true };
} }
@ -164,7 +164,7 @@ export class GoogleTasks implements INodeType {
'GET', 'GET',
`/tasks/v1/lists/${taskListId}/tasks/${taskId}`, `/tasks/v1/lists/${taskListId}/tasks/${taskId}`,
{}, {},
qs qs,
); );
} }
if (operation === 'getAll') { if (operation === 'getAll') {
@ -173,7 +173,7 @@ export class GoogleTasks implements INodeType {
const taskListId = this.getNodeParameter('task', i) as string; const taskListId = this.getNodeParameter('task', i) as string;
const options = this.getNodeParameter( const options = this.getNodeParameter(
'additionalFields', 'additionalFields',
i i,
) as IDataObject; ) as IDataObject;
if (options.completedMax) { if (options.completedMax) {
qs.completedMax = options.completedMax as string; qs.completedMax = options.completedMax as string;
@ -207,7 +207,7 @@ export class GoogleTasks implements INodeType {
'GET', 'GET',
`/tasks/v1/lists/${taskListId}/tasks`, `/tasks/v1/lists/${taskListId}/tasks`,
{}, {},
qs qs,
); );
} else { } else {
qs.maxResults = this.getNodeParameter('limit', i) as number; qs.maxResults = this.getNodeParameter('limit', i) as number;
@ -216,7 +216,7 @@ export class GoogleTasks implements INodeType {
'GET', 'GET',
`/tasks/v1/lists/${taskListId}/tasks`, `/tasks/v1/lists/${taskListId}/tasks`,
{}, {},
qs qs,
); );
responseData = responseData.items; responseData = responseData.items;
} }
@ -228,7 +228,7 @@ export class GoogleTasks implements INodeType {
const taskId = this.getNodeParameter('taskId', i) as string; const taskId = this.getNodeParameter('taskId', i) as string;
const updateFields = this.getNodeParameter( const updateFields = this.getNodeParameter(
'updateFields', 'updateFields',
i i,
) as IDataObject; ) as IDataObject;
if (updateFields.previous) { if (updateFields.previous) {
@ -264,7 +264,7 @@ export class GoogleTasks implements INodeType {
'PATCH', 'PATCH',
`/tasks/v1/lists/${taskListId}/tasks/${taskId}`, `/tasks/v1/lists/${taskListId}/tasks/${taskId}`,
body, body,
qs qs,
); );
} }
} }

View File

@ -107,7 +107,7 @@ function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoa
'typ': 'JWT', 'typ': 'JWT',
'alg': 'RS256', 'alg': 'RS256',
}, },
} },
); );
const options: OptionsWithUri = { const options: OptionsWithUri = {

View File

@ -152,13 +152,13 @@ export class GoogleTranslate implements INodeType {
methods = { methods = {
loadOptions: { loadOptions: {
async getLanguages( async getLanguages(
this: ILoadOptionsFunctions this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> { ): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const { data: { languages } } = await googleApiRequest.call( const { data: { languages } } = await googleApiRequest.call(
this, this,
'GET', 'GET',
'/language/translate/v2/languages' '/language/translate/v2/languages',
); );
for (const language of languages) { for (const language of languages) {
returnData.push({ returnData.push({

View File

@ -51,7 +51,7 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
// Try to return the error prettier // Try to return the error prettier
throw new Error( throw new Error(
`YouTube error response [${error.statusCode}]: ${errors.join('|')}` `YouTube error response [${error.statusCode}]: ${errors.join('|')}`,
); );
} }
throw error; throw error;

View File

@ -119,14 +119,14 @@ export class YouTube implements INodeType {
// Get all the languages to display them to user so that he can // Get all the languages to display them to user so that he can
// select them easily // select them easily
async getLanguages( async getLanguages(
this: ILoadOptionsFunctions this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> { ): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const languages = await googleApiRequestAllItems.call( const languages = await googleApiRequestAllItems.call(
this, this,
'items', 'items',
'GET', 'GET',
'/youtube/v3/i18nLanguages' '/youtube/v3/i18nLanguages',
); );
for (const language of languages) { for (const language of languages) {
const languageName = language.id.toUpperCase(); const languageName = language.id.toUpperCase();
@ -155,7 +155,7 @@ export class YouTube implements INodeType {
// Get all the video categories to display them to user so that he can // Get all the video categories to display them to user so that he can
// select them easily // select them easily
async getVideoCategories( async getVideoCategories(
this: ILoadOptionsFunctions this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> { ): Promise<INodePropertyOptions[]> {
const countryCode = this.getCurrentNodeParameter('regionCode') as string; const countryCode = this.getCurrentNodeParameter('regionCode') as string;
@ -169,7 +169,7 @@ export class YouTube implements INodeType {
'GET', 'GET',
'/youtube/v3/videoCategories', '/youtube/v3/videoCategories',
{}, {},
qs qs,
); );
for (const category of categories) { for (const category of categories) {
const categoryName = category.snippet.title; const categoryName = category.snippet.title;
@ -184,7 +184,7 @@ export class YouTube implements INodeType {
// Get all the playlists to display them to user so that he can // Get all the playlists to display them to user so that he can
// select them easily // select them easily
async getPlaylists( async getPlaylists(
this: ILoadOptionsFunctions this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> { ): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
const qs: IDataObject = {}; const qs: IDataObject = {};
@ -196,7 +196,7 @@ export class YouTube implements INodeType {
'GET', 'GET',
'/youtube/v3/playlists', '/youtube/v3/playlists',
{}, {},
qs qs,
); );
for (const playlist of playlists) { for (const playlist of playlists) {
const playlistName = playlist.snippet.title; const playlistName = playlist.snippet.title;
@ -249,7 +249,7 @@ export class YouTube implements INodeType {
'GET', 'GET',
`/youtube/v3/channels`, `/youtube/v3/channels`,
{}, {},
qs qs,
); );
responseData = responseData.items; responseData = responseData.items;
@ -292,7 +292,7 @@ export class YouTube implements INodeType {
'GET', 'GET',
`/youtube/v3/channels`, `/youtube/v3/channels`,
{}, {},
qs qs,
); );
} else { } else {
qs.maxResults = this.getNodeParameter('limit', i) as number; qs.maxResults = this.getNodeParameter('limit', i) as number;
@ -301,7 +301,7 @@ export class YouTube implements INodeType {
'GET', 'GET',
`/youtube/v3/channels`, `/youtube/v3/channels`,
{}, {},
qs qs,
); );
responseData = responseData.items; responseData = responseData.items;
} }
@ -400,7 +400,7 @@ export class YouTube implements INodeType {
'PUT', 'PUT',
'/youtube/v3/channels', '/youtube/v3/channels',
body, body,
qs qs,
); );
} }
//https://developers.google.com/youtube/v3/docs/channelBanners/insert //https://developers.google.com/youtube/v3/docs/channelBanners/insert
@ -452,7 +452,7 @@ export class YouTube implements INodeType {
}, },
}, },
}, },
qs qs,
); );
} }
} }
@ -485,7 +485,7 @@ export class YouTube implements INodeType {
'GET', 'GET',
`/youtube/v3/playlists`, `/youtube/v3/playlists`,
{}, {},
qs qs,
); );
responseData = responseData.items; responseData = responseData.items;
@ -525,7 +525,7 @@ export class YouTube implements INodeType {
'GET', 'GET',
`/youtube/v3/playlists`, `/youtube/v3/playlists`,
{}, {},
qs qs,
); );
} else { } else {
qs.maxResults = this.getNodeParameter('limit', i) as number; qs.maxResults = this.getNodeParameter('limit', i) as number;
@ -534,7 +534,7 @@ export class YouTube implements INodeType {
'GET', 'GET',
`/youtube/v3/playlists`, `/youtube/v3/playlists`,
{}, {},
qs qs,
); );
responseData = responseData.items; responseData = responseData.items;
} }
@ -580,7 +580,7 @@ export class YouTube implements INodeType {
'POST', 'POST',
'/youtube/v3/playlists', '/youtube/v3/playlists',
body, body,
qs qs,
); );
} }
//https://developers.google.com/youtube/v3/docs/playlists/update //https://developers.google.com/youtube/v3/docs/playlists/update
@ -629,7 +629,7 @@ export class YouTube implements INodeType {
'PUT', 'PUT',
'/youtube/v3/playlists', '/youtube/v3/playlists',
body, body,
qs qs,
); );
} }
//https://developers.google.com/youtube/v3/docs/playlists/delete //https://developers.google.com/youtube/v3/docs/playlists/delete
@ -649,7 +649,7 @@ export class YouTube implements INodeType {
this, this,
'DELETE', 'DELETE',
'/youtube/v3/playlists', '/youtube/v3/playlists',
body body,
); );
responseData = { success: true }; responseData = { success: true };
@ -682,7 +682,7 @@ export class YouTube implements INodeType {
'GET', 'GET',
`/youtube/v3/playlistItems`, `/youtube/v3/playlistItems`,
{}, {},
qs qs,
); );
responseData = responseData.items; responseData = responseData.items;
@ -717,7 +717,7 @@ export class YouTube implements INodeType {
'GET', 'GET',
`/youtube/v3/playlistItems`, `/youtube/v3/playlistItems`,
{}, {},
qs qs,
); );
} else { } else {
qs.maxResults = this.getNodeParameter('limit', i) as number; qs.maxResults = this.getNodeParameter('limit', i) as number;
@ -726,7 +726,7 @@ export class YouTube implements INodeType {
'GET', 'GET',
`/youtube/v3/playlistItems`, `/youtube/v3/playlistItems`,
{}, {},
qs qs,
); );
responseData = responseData.items; responseData = responseData.items;
} }
@ -781,7 +781,7 @@ export class YouTube implements INodeType {
'POST', 'POST',
'/youtube/v3/playlistItems', '/youtube/v3/playlistItems',
body, body,
qs qs,
); );
} }
//https://developers.google.com/youtube/v3/docs/playlistItems/delete //https://developers.google.com/youtube/v3/docs/playlistItems/delete
@ -801,7 +801,7 @@ export class YouTube implements INodeType {
this, this,
'DELETE', 'DELETE',
'/youtube/v3/playlistItems', '/youtube/v3/playlistItems',
body body,
); );
responseData = { success: true }; responseData = { success: true };
@ -837,7 +837,7 @@ export class YouTube implements INodeType {
'GET', 'GET',
`/youtube/v3/search`, `/youtube/v3/search`,
{}, {},
qs qs,
); );
} else { } else {
qs.maxResults = this.getNodeParameter('limit', i) as number; qs.maxResults = this.getNodeParameter('limit', i) as number;
@ -846,7 +846,7 @@ export class YouTube implements INodeType {
'GET', 'GET',
`/youtube/v3/search`, `/youtube/v3/search`,
{}, {},
qs qs,
); );
responseData = responseData.items; responseData = responseData.items;
} }
@ -883,7 +883,7 @@ export class YouTube implements INodeType {
'GET', 'GET',
`/youtube/v3/videos`, `/youtube/v3/videos`,
{}, {},
qs qs,
); );
responseData = responseData.items; responseData = responseData.items;
@ -999,7 +999,7 @@ export class YouTube implements INodeType {
'PUT', 'PUT',
`/youtube/v3/videos`, `/youtube/v3/videos`,
data, data,
qs qs,
); );
} }
//https://developers.google.com/youtube/v3/docs/playlists/update //https://developers.google.com/youtube/v3/docs/playlists/update
@ -1078,7 +1078,7 @@ export class YouTube implements INodeType {
'PUT', 'PUT',
'/youtube/v3/videos', '/youtube/v3/videos',
body, body,
qs qs,
); );
} }
//https://developers.google.com/youtube/v3/docs/videos/delete?hl=en //https://developers.google.com/youtube/v3/docs/videos/delete?hl=en
@ -1098,7 +1098,7 @@ export class YouTube implements INodeType {
this, this,
'DELETE', 'DELETE',
'/youtube/v3/videos', '/youtube/v3/videos',
body body,
); );
responseData = { success: true }; responseData = { success: true };
@ -1117,7 +1117,7 @@ export class YouTube implements INodeType {
this, this,
'POST', 'POST',
'/youtube/v3/videos/rate', '/youtube/v3/videos/rate',
body body,
); );
responseData = { success: true }; responseData = { success: true };
@ -1138,7 +1138,7 @@ export class YouTube implements INodeType {
'GET', 'GET',
`/youtube/v3/videoCategories`, `/youtube/v3/videoCategories`,
{}, {},
qs qs,
); );
responseData = responseData.items; responseData = responseData.items;

View File

@ -13,7 +13,7 @@ export async function harvestApiRequest(
qs: IDataObject = {}, qs: IDataObject = {},
uri: string, uri: string,
body: IDataObject = {}, body: IDataObject = {},
option: IDataObject = {} option: IDataObject = {},
): Promise<any> { // tslint:disable-line:no-any ): Promise<any> { // tslint:disable-line:no-any
const credentials = this.getCredentials('harvestApi') as IDataObject; const credentials = this.getCredentials('harvestApi') as IDataObject;
@ -82,7 +82,7 @@ export async function harvestApiRequestAllItems(
uri: string, uri: string,
resource: string, resource: string,
body: IDataObject = {}, body: IDataObject = {},
option: IDataObject = {} option: IDataObject = {},
): Promise<any> { // tslint:disable-line:no-any ): Promise<any> { // tslint:disable-line:no-any
const returnData: IDataObject[] = []; const returnData: IDataObject[] = [];

View File

@ -850,7 +850,7 @@ export class HttpRequest implements INodeType {
json: { json: {
error: response.reason, error: response.reason,
}, },
} },
); );
continue; continue;
} }

View File

@ -216,7 +216,7 @@ export class Jira implements INodeType {
const users = await jiraSoftwareCloudApiRequest.call(this, '/api/2/user/search', 'GET', {}, const users = await jiraSoftwareCloudApiRequest.call(this, '/api/2/user/search', 'GET', {},
{ {
username: "'", username: "'",
} },
); );
for (const user of users) { for (const user of users) {
const userName = user.displayName; const userName = user.displayName;

View File

@ -407,7 +407,7 @@ export class Medium implements INodeType {
const user = await mediumApiRequest.call( const user = await mediumApiRequest.call(
this, this,
'GET', 'GET',
`/me` `/me`,
); );
const userId = user.data.id; const userId = user.data.id;
@ -415,7 +415,7 @@ export class Medium implements INodeType {
const publications = await mediumApiRequest.call( const publications = await mediumApiRequest.call(
this, this,
'GET', 'GET',
`/users/${userId}/publications` `/users/${userId}/publications`,
); );
const publicationsList = publications.data; const publicationsList = publications.data;
for (const publication of publicationsList) { for (const publication of publicationsList) {
@ -510,7 +510,7 @@ export class Medium implements INodeType {
'POST', 'POST',
`/publications/${publicationId}/posts`, `/publications/${publicationId}/posts`,
bodyRequest, bodyRequest,
qs qs,
); );
} }
else { else {
@ -519,7 +519,7 @@ export class Medium implements INodeType {
'GET', 'GET',
'/me', '/me',
{}, {},
qs qs,
); );
const authorId = responseAuthorId.data.id; const authorId = responseAuthorId.data.id;
@ -528,7 +528,7 @@ export class Medium implements INodeType {
'POST', 'POST',
`/users/${authorId}/posts`, `/users/${authorId}/posts`,
bodyRequest, bodyRequest,
qs qs,
); );
responseData = responseData.data; responseData = responseData.data;
@ -547,7 +547,7 @@ export class Medium implements INodeType {
const user = await mediumApiRequest.call( const user = await mediumApiRequest.call(
this, this,
'GET', 'GET',
`/me` `/me`,
); );
const userId = user.data.id; const userId = user.data.id;
@ -555,7 +555,7 @@ export class Medium implements INodeType {
responseData = await mediumApiRequest.call( responseData = await mediumApiRequest.call(
this, this,
'GET', 'GET',
`/users/${userId}/publications` `/users/${userId}/publications`,
); );
responseData = responseData.data; responseData = responseData.data;

View File

@ -25,7 +25,7 @@ export async function messageBirdApiRequest(
method: string, method: string,
resource: string, resource: string,
body: IDataObject, body: IDataObject,
query: IDataObject = {} query: IDataObject = {},
): Promise<any> { // tslint:disable-line:no-any ): Promise<any> { // tslint:disable-line:no-any
const credentials = this.getCredentials('messageBirdApi'); const credentials = this.getCredentials('messageBirdApi');
if (credentials === undefined) { if (credentials === undefined) {

View File

@ -299,7 +299,7 @@ export class MessageBird implements INodeType {
}; };
const additionalFields = this.getNodeParameter( const additionalFields = this.getNodeParameter(
'additionalFields', 'additionalFields',
i i,
) as IDataObject; ) as IDataObject;
if (additionalFields.groupIds) { if (additionalFields.groupIds) {
@ -353,7 +353,7 @@ export class MessageBird implements INodeType {
requestMethod, requestMethod,
'/messages', '/messages',
bodyRequest, bodyRequest,
qs qs,
); );
returnData.push(responseData as IDataObject); returnData.push(responseData as IDataObject);

View File

@ -11,7 +11,7 @@ import { ITables } from './TableInterface';
*/ */
export function copyInputItem( export function copyInputItem(
item: INodeExecutionData, item: INodeExecutionData,
properties: string[] properties: string[],
): IDataObject { ): IDataObject {
// Prepare the data to insert and copy it to be returned // Prepare the data to insert and copy it to be returned
const newItem: IDataObject = {}; const newItem: IDataObject = {};
@ -36,7 +36,7 @@ export function createTableStruct(
getNodeParam: Function, getNodeParam: Function,
items: INodeExecutionData[], items: INodeExecutionData[],
additionalProperties: string[] = [], additionalProperties: string[] = [],
keyName?: string keyName?: string,
): ITables { ): ITables {
return items.reduce((tables, item, index) => { return items.reduce((tables, item, index) => {
const table = getNodeParam('table', index) as string; const table = getNodeParam('table', index) as string;
@ -69,7 +69,7 @@ export function createTableStruct(
*/ */
export function executeQueryQueue( export function executeQueryQueue(
tables: ITables, tables: ITables,
buildQueryQueue: Function buildQueryQueue: Function,
): Promise<any[]> { // tslint:disable-line:no-any ): Promise<any[]> { // tslint:disable-line:no-any
return Promise.all( return Promise.all(
Object.keys(tables).map(table => { Object.keys(tables).map(table => {
@ -79,11 +79,11 @@ export function executeQueryQueue(
table, table,
columnString, columnString,
items: tables[table][columnString], items: tables[table][columnString],
}) }),
); );
}); });
return Promise.all(columnsResults); return Promise.all(columnsResults);
}) }),
); );
} }
@ -112,7 +112,7 @@ export function extractUpdateSet(item: IDataObject, columns: string[]): string {
column => column =>
`${column} = ${ `${column} = ${
typeof item[column] === 'string' ? `'${item[column]}'` : item[column] typeof item[column] === 'string' ? `'${item[column]}'` : item[column]
}` }`,
) )
.join(','); .join(',');
} }

View File

@ -268,10 +268,10 @@ export class MicrosoftSql implements INodeType {
return pool return pool
.request() .request()
.query( .query(
`INSERT INTO ${table}(${columnString}) VALUES ${values};` `INSERT INTO ${table}(${columnString}) VALUES ${values};`,
); );
}); });
} },
); );
returnItems = items; returnItems = items;
@ -281,13 +281,13 @@ export class MicrosoftSql implements INodeType {
// ---------------------------------- // ----------------------------------
const updateKeys = items.map( const updateKeys = items.map(
(item, index) => this.getNodeParameter('updateKey', index) as string (item, index) => this.getNodeParameter('updateKey', index) as string,
); );
const tables = createTableStruct( const tables = createTableStruct(
this.getNodeParameter, this.getNodeParameter,
items, items,
['updateKey'].concat(updateKeys), ['updateKey'].concat(updateKeys),
'updateKey' 'updateKey',
); );
await executeQueryQueue( await executeQueryQueue(
tables, tables,
@ -308,14 +308,14 @@ export class MicrosoftSql implements INodeType {
const setValues = extractUpdateSet(item, columns); const setValues = extractUpdateSet(item, columns);
const condition = extractUpdateCondition( const condition = extractUpdateCondition(
item, item,
item.updateKey as string item.updateKey as string,
); );
return pool return pool
.request() .request()
.query(`UPDATE ${table} SET ${setValues} WHERE ${condition};`); .query(`UPDATE ${table} SET ${setValues} WHERE ${condition};`);
}); });
} },
); );
returnItems = items; returnItems = items;
@ -343,9 +343,9 @@ export class MicrosoftSql implements INodeType {
deleteKey => { deleteKey => {
const deleteItemsList = chunk( const deleteItemsList = chunk(
tables[table][deleteKey].map(item => tables[table][deleteKey].map(item =>
copyInputItem(item as INodeExecutionData, [deleteKey]) copyInputItem(item as INodeExecutionData, [deleteKey]),
), ),
1000 1000,
); );
const queryQueue = deleteItemsList.map(deleteValues => { const queryQueue = deleteItemsList.map(deleteValues => {
return pool return pool
@ -353,21 +353,21 @@ export class MicrosoftSql implements INodeType {
.query( .query(
`DELETE FROM ${table} WHERE ${deleteKey} IN ${extractDeleteValues( `DELETE FROM ${table} WHERE ${deleteKey} IN ${extractDeleteValues(
deleteValues, deleteValues,
deleteKey deleteKey,
)};` )};`,
); );
}); });
return Promise.all(queryQueue); return Promise.all(queryQueue);
} },
); );
return Promise.all(deleteKeyResults); return Promise.all(deleteKeyResults);
}) }),
); );
const rowsDeleted = flatten(queriesResults).reduce( const rowsDeleted = flatten(queriesResults).reduce(
(acc: number, resp: mssql.IResult<object>): number => (acc: number, resp: mssql.IResult<object>): number =>
(acc += resp.rowsAffected.reduce((sum, val) => (sum += val))), (acc += resp.rowsAffected.reduce((sum, val) => (sum += val))),
0 0,
); );
returnItems = this.helpers.returnJsonArray({ returnItems = this.helpers.returnJsonArray({

View File

@ -54,7 +54,7 @@ export async function mindeeApiRequest(this: IExecuteFunctions | IExecuteSingleF
errors = errors.map((e: IDataObject) => e.message); errors = errors.map((e: IDataObject) => e.message);
// Try to return the error prettier // Try to return the error prettier
throw new Error( throw new Error(
`Mindee error response [${error.statusCode}]: ${errors.join('|')}` `Mindee error response [${error.statusCode}]: ${errors.join('|')}`,
); );
} }
throw error; throw error;

View File

@ -159,7 +159,7 @@ export class Mindee implements INodeType {
}, },
}, },
}, },
} },
); );
if (rawData === false) { if (rawData === false) {
@ -201,7 +201,7 @@ export class Mindee implements INodeType {
}, },
}, },
}, },
} },
); );
if (rawData === false) { if (rawData === false) {

View File

@ -17,7 +17,7 @@ export class MongoDb implements INodeType {
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> { async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const { database, connectionString } = validateAndResolveMongoCredentials( const { database, connectionString } = validateAndResolveMongoCredentials(
this.getCredentials('mongoDb') this.getCredentials('mongoDb'),
); );
const client: MongoClient = await MongoClient.connect(connectionString, { const client: MongoClient = await MongoClient.connect(connectionString, {

View File

@ -15,7 +15,7 @@ import {
* @param {ICredentialDataDecryptedObject} credentials MongoDB credentials to use, unless conn string is overridden * @param {ICredentialDataDecryptedObject} credentials MongoDB credentials to use, unless conn string is overridden
*/ */
function buildParameterizedConnString( function buildParameterizedConnString(
credentials: IMongoParametricCredentials credentials: IMongoParametricCredentials,
): string { ): string {
if (credentials.port) { if (credentials.port) {
return `mongodb://${credentials.user}:${credentials.password}@${credentials.host}:${credentials.port}`; return `mongodb://${credentials.user}:${credentials.password}@${credentials.host}:${credentials.port}`;
@ -31,7 +31,7 @@ function buildParameterizedConnString(
* @param {ICredentialDataDecryptedObject} credentials raw/input MongoDB credentials to use * @param {ICredentialDataDecryptedObject} credentials raw/input MongoDB credentials to use
*/ */
function buildMongoConnectionParams( function buildMongoConnectionParams(
credentials: IMongoCredentialsType credentials: IMongoCredentialsType,
): IMongoCredentials { ): IMongoCredentials {
const sanitizedDbName = const sanitizedDbName =
credentials.database && credentials.database.trim().length > 0 credentials.database && credentials.database.trim().length > 0
@ -48,7 +48,7 @@ function buildMongoConnectionParams(
}; };
} else { } else {
throw new Error( throw new Error(
'Cannot override credentials: valid MongoDB connection string not provided ' 'Cannot override credentials: valid MongoDB connection string not provided ',
); );
} }
} else { } else {
@ -65,13 +65,13 @@ function buildMongoConnectionParams(
* @param {ICredentialDataDecryptedObject} credentials raw/input MongoDB credentials to use * @param {ICredentialDataDecryptedObject} credentials raw/input MongoDB credentials to use
*/ */
export function validateAndResolveMongoCredentials( export function validateAndResolveMongoCredentials(
credentials?: ICredentialDataDecryptedObject credentials?: ICredentialDataDecryptedObject,
): IMongoCredentials { ): IMongoCredentials {
if (credentials === undefined) { if (credentials === undefined) {
throw new Error('No credentials got returned!'); throw new Error('No credentials got returned!');
} else { } else {
return buildMongoConnectionParams( return buildMongoConnectionParams(
credentials as unknown as IMongoCredentialsType credentials as unknown as IMongoCredentialsType,
); );
} }
} }
@ -86,7 +86,7 @@ export function validateAndResolveMongoCredentials(
*/ */
export function getItemCopy( export function getItemCopy(
items: INodeExecutionData[], items: INodeExecutionData[],
properties: string[] properties: string[],
): IDataObject[] { ): IDataObject[] {
// Prepare the data to insert and copy it to be returned // Prepare the data to insert and copy it to be returned
let newItem: IDataObject; let newItem: IDataObject;

View File

@ -44,7 +44,7 @@ export async function philipsHueApiRequest(this: IExecuteFunctions | ILoadOption
// Try to return the error prettier // Try to return the error prettier
throw new Error( throw new Error(
`Philip Hue error response [${error.statusCode}]: ${errorMessage}` `Philip Hue error response [${error.statusCode}]: ${errorMessage}`,
); );
} }
throw error; throw error;

View File

@ -66,7 +66,7 @@ export class PhilipsHue implements INodeType {
// Get all the lights to display them to user so that he can // Get all the lights to display them to user so that he can
// select them easily // select them easily
async getLights( async getLights(
this: ILoadOptionsFunctions this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> { ): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
@ -75,7 +75,7 @@ export class PhilipsHue implements INodeType {
const lights = await philipsHueApiRequest.call( const lights = await philipsHueApiRequest.call(
this, this,
'GET', 'GET',
`/bridge/${user}/lights` `/bridge/${user}/lights`,
); );
for (const light of Object.keys(lights)) { for (const light of Object.keys(lights)) {
const lightName = lights[light].name; const lightName = lights[light].name;
@ -132,7 +132,7 @@ export class PhilipsHue implements INodeType {
this, this,
'PUT', 'PUT',
`/bridge/${user}/lights/${lightId}/state`, `/bridge/${user}/lights/${lightId}/state`,
body body,
); );
responseData = {}; responseData = {};

View File

@ -39,7 +39,7 @@ export function pgQuery(
getNodeParam: Function, getNodeParam: Function,
pgp: pgPromise.IMain<{}, pg.IClient>, pgp: pgPromise.IMain<{}, pg.IClient>,
db: pgPromise.IDatabase<{}, pg.IClient>, db: pgPromise.IDatabase<{}, pg.IClient>,
input: INodeExecutionData[] input: INodeExecutionData[],
): Promise<object[]> { ): Promise<object[]> {
const queries: string[] = []; const queries: string[] = [];
for (let i = 0; i < input.length; i++) { for (let i = 0; i < input.length; i++) {
@ -62,7 +62,7 @@ export async function pgInsert(
getNodeParam: Function, getNodeParam: Function,
pgp: pgPromise.IMain<{}, pg.IClient>, pgp: pgPromise.IMain<{}, pg.IClient>,
db: pgPromise.IDatabase<{}, pg.IClient>, db: pgPromise.IDatabase<{}, pg.IClient>,
items: INodeExecutionData[] items: INodeExecutionData[],
): Promise<IDataObject[][]> { ): Promise<IDataObject[][]> {
const table = getNodeParam('table', 0) as string; const table = getNodeParam('table', 0) as string;
const schema = getNodeParam('schema', 0) as string; const schema = getNodeParam('schema', 0) as string;
@ -102,7 +102,7 @@ export async function pgUpdate(
getNodeParam: Function, getNodeParam: Function,
pgp: pgPromise.IMain<{}, pg.IClient>, pgp: pgPromise.IMain<{}, pg.IClient>,
db: pgPromise.IDatabase<{}, pg.IClient>, db: pgPromise.IDatabase<{}, pg.IClient>,
items: INodeExecutionData[] items: INodeExecutionData[],
): Promise<IDataObject[]> { ): Promise<IDataObject[]> {
const table = getNodeParam('table', 0) as string; const table = getNodeParam('table', 0) as string;
const schema = getNodeParam('schema', 0) as string; const schema = getNodeParam('schema', 0) as string;

View File

@ -43,7 +43,7 @@ export async function pushoverApiRequest(this: IExecuteFunctions | IExecuteSingl
errors = errors.map((e: IDataObject) => e); errors = errors.map((e: IDataObject) => e);
// Try to return the error prettier // Try to return the error prettier
throw new Error( throw new Error(
`PushOver error response [${error.statusCode}]: ${errors.join('|')}` `PushOver error response [${error.statusCode}]: ${errors.join('|')}`,
); );
} }
throw error; throw error;

View File

@ -380,7 +380,7 @@ export class Pushover implements INodeType {
this, this,
'POST', 'POST',
`/messages.json`, `/messages.json`,
body body,
); );
} }
} }

View File

@ -40,7 +40,7 @@ export async function sendyApiRequest(this: IExecuteFunctions | ILoadOptionsFunc
errors = errors.map((e: IDataObject) => e.message); errors = errors.map((e: IDataObject) => e.message);
// Try to return the error prettier // Try to return the error prettier
throw new Error( throw new Error(
`Sendy error response [${error.statusCode}]: ${errors.join('|')}` `Sendy error response [${error.statusCode}]: ${errors.join('|')}`,
); );
} }
throw error; throw error;

View File

@ -148,7 +148,7 @@ export class Sendy implements INodeType {
this, this,
'POST', 'POST',
'/api/campaigns/create.php', '/api/campaigns/create.php',
body body,
); );
const success = [ const success = [
@ -184,7 +184,7 @@ export class Sendy implements INodeType {
this, this,
'POST', 'POST',
'/subscribe', '/subscribe',
body body,
); );
if (responseData === '1') { if (responseData === '1') {
@ -206,7 +206,7 @@ export class Sendy implements INodeType {
this, this,
'POST', 'POST',
'/api/subscribers/active-subscriber-count.php', '/api/subscribers/active-subscriber-count.php',
body body,
); );
const errors = [ const errors = [
@ -239,7 +239,7 @@ export class Sendy implements INodeType {
this, this,
'POST', 'POST',
'/api/subscribers/delete.php', '/api/subscribers/delete.php',
body body,
); );
if (responseData === '1') { if (responseData === '1') {
@ -264,7 +264,7 @@ export class Sendy implements INodeType {
this, this,
'POST', 'POST',
'/unsubscribe', '/unsubscribe',
body body,
); );
if (responseData === '1') { if (responseData === '1') {
@ -289,7 +289,7 @@ export class Sendy implements INodeType {
this, this,
'POST', 'POST',
'/api/subscribers/subscription-status.php', '/api/subscribers/subscription-status.php',
body body,
); );
const status = [ const status = [

View File

@ -336,7 +336,7 @@ export class Signl4 implements INodeType {
data, data,
{}, {},
endpoint, endpoint,
{} {},
); );
} }
// Resolve alert // Resolve alert
@ -359,7 +359,7 @@ export class Signl4 implements INodeType {
data, data,
{}, {},
endpoint, endpoint,
{} {},
); );
} }
} }

View File

@ -51,7 +51,7 @@ export async function stravaApiRequest(this: IExecuteFunctions | IExecuteSingleF
if (error.statusCode === 402) { if (error.statusCode === 402) {
throw new Error( throw new Error(
`Strava error response [${error.statusCode}]: Payment Required` `Strava error response [${error.statusCode}]: Payment Required`,
); );
} }
@ -62,7 +62,7 @@ export async function stravaApiRequest(this: IExecuteFunctions | IExecuteSingleF
errors = errors.map((e: IDataObject) => `${e.code} -> ${e.field}`); errors = errors.map((e: IDataObject) => `${e.code} -> ${e.field}`);
// Try to return the error prettier // Try to return the error prettier
throw new Error( throw new Error(
`Strava error response [${error.statusCode}]: ${errors.join('|')}` `Strava error response [${error.statusCode}]: ${errors.join('|')}`,
); );
} }
throw error; throw error;

View File

@ -197,7 +197,7 @@ export class StravaTrigger implements INodeType {
} }
throw new Error( throw new Error(
`Strava error response [${error.statusCode}]: ${errorMessage}` `Strava error response [${error.statusCode}]: ${errorMessage}`,
); );
} }
} }

View File

@ -21,7 +21,7 @@ import {
export async function getAuthorization( export async function getAuthorization(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IWebhookFunctions, this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IWebhookFunctions,
credentials?: ICredentialDataDecryptedObject credentials?: ICredentialDataDecryptedObject,
): Promise<string> { ): Promise<string> {
if (credentials === undefined) { if (credentials === undefined) {
throw new Error('No credentials got returned!'); throw new Error('No credentials got returned!');
@ -56,7 +56,7 @@ export async function taigaApiRequest(
body = {}, body = {},
query = {}, query = {},
uri?: string | undefined, uri?: string | undefined,
option = {} option = {},
): Promise<any> { // tslint:disable-line:no-any ): Promise<any> { // tslint:disable-line:no-any
const version = this.getNodeParameter('version', 0, 'cloud') as string; const version = this.getNodeParameter('version', 0, 'cloud') as string;

View File

@ -20,7 +20,7 @@ export async function todoistApiRequest(
method: string, method: string,
resource: string, resource: string,
body: any = {}, // tslint:disable-line:no-any body: any = {}, // tslint:disable-line:no-any
qs: IDataObject = {} qs: IDataObject = {},
): Promise<any> { // tslint:disable-line:no-any ): Promise<any> { // tslint:disable-line:no-any
const authentication = this.getNodeParameter('authentication', 0, 'apiKey'); const authentication = this.getNodeParameter('authentication', 0, 'apiKey');

View File

@ -42,7 +42,7 @@ export async function vonageApiRequest(this: IExecuteFunctions | IExecuteSingleF
errors = errors.map((e: IDataObject) => e.message); errors = errors.map((e: IDataObject) => e.message);
// Try to return the error prettier // Try to return the error prettier
throw new Error( throw new Error(
`Vonage error response [${error.statusCode}]: ${errors.join('|')}` `Vonage error response [${error.statusCode}]: ${errors.join('|')}`,
); );
} }
throw error; throw error;

View File

@ -17,7 +17,7 @@ import {
export async function getAuthorization( export async function getAuthorization(
this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IWebhookFunctions, this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IWebhookFunctions,
credentials?: ICredentialDataDecryptedObject credentials?: ICredentialDataDecryptedObject,
): Promise<IDataObject> { ): Promise<IDataObject> {
if (credentials === undefined) { if (credentials === undefined) {
throw new Error('No credentials got returned!'); throw new Error('No credentials got returned!');

View File

@ -71,7 +71,7 @@ export async function zoomApiRequestAllItems(
method: string, method: string,
endpoint: string, endpoint: string,
body: IDataObject = {}, body: IDataObject = {},
query: IDataObject = {} query: IDataObject = {},
): Promise<any> { // tslint:disable-line:no-any ): Promise<any> { // tslint:disable-line:no-any
const returnData: IDataObject[] = []; const returnData: IDataObject[] = [];
let responseData; let responseData;
@ -82,7 +82,7 @@ export async function zoomApiRequestAllItems(
method, method,
endpoint, endpoint,
body, body,
query query,
); );
query.page_number++; query.page_number++;
returnData.push.apply(returnData, responseData[propertyName]); returnData.push.apply(returnData, responseData[propertyName]);

View File

@ -152,7 +152,7 @@ export class Zoom implements INodeType {
loadOptions: { loadOptions: {
// Get all the timezones to display them to user so that he can select them easily // Get all the timezones to display them to user so that he can select them easily
async getTimezones( async getTimezones(
this: ILoadOptionsFunctions this: ILoadOptionsFunctions,
): Promise<INodePropertyOptions[]> { ): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
for (const timezone of moment.tz.names()) { for (const timezone of moment.tz.names()) {
@ -186,7 +186,7 @@ export class Zoom implements INodeType {
const meetingId = this.getNodeParameter('meetingId', i) as string; const meetingId = this.getNodeParameter('meetingId', i) as string;
const additionalFields = this.getNodeParameter( const additionalFields = this.getNodeParameter(
'additionalFields', 'additionalFields',
i i,
) as IDataObject; ) as IDataObject;
if (additionalFields.showPreviousOccurrences) { if (additionalFields.showPreviousOccurrences) {
@ -202,7 +202,7 @@ export class Zoom implements INodeType {
'GET', 'GET',
`/meetings/${meetingId}`, `/meetings/${meetingId}`,
{}, {},
qs qs,
); );
} }
if (operation === 'getAll') { if (operation === 'getAll') {
@ -211,7 +211,7 @@ export class Zoom implements INodeType {
const filters = this.getNodeParameter( const filters = this.getNodeParameter(
'filters', 'filters',
i i,
) as IDataObject; ) as IDataObject;
if (filters.type) { if (filters.type) {
qs.type = filters.type as string; qs.type = filters.type as string;
@ -231,7 +231,7 @@ export class Zoom implements INodeType {
const meetingId = this.getNodeParameter('meetingId', i) as string; const meetingId = this.getNodeParameter('meetingId', i) as string;
const additionalFields = this.getNodeParameter( const additionalFields = this.getNodeParameter(
'additionalFields', 'additionalFields',
i i,
) as IDataObject; ) as IDataObject;
if (additionalFields.scheduleForReminder) { if (additionalFields.scheduleForReminder) {
qs.schedule_for_reminder = additionalFields.scheduleForReminder as boolean; qs.schedule_for_reminder = additionalFields.scheduleForReminder as boolean;
@ -246,7 +246,7 @@ export class Zoom implements INodeType {
'DELETE', 'DELETE',
`/meetings/${meetingId}`, `/meetings/${meetingId}`,
{}, {},
qs qs,
); );
responseData = { success: true }; responseData = { success: true };
} }
@ -347,7 +347,7 @@ export class Zoom implements INodeType {
'POST', 'POST',
`/users/me/meetings`, `/users/me/meetings`,
body, body,
qs qs,
); );
} }
if (operation === 'update') { if (operation === 'update') {
@ -355,7 +355,7 @@ export class Zoom implements INodeType {
const meetingId = this.getNodeParameter('meetingId', i) as string; const meetingId = this.getNodeParameter('meetingId', i) as string;
const updateFields = this.getNodeParameter( const updateFields = this.getNodeParameter(
'updateFields', 'updateFields',
i i,
) as IDataObject; ) as IDataObject;
const body: IDataObject = {}; const body: IDataObject = {};
@ -448,7 +448,7 @@ export class Zoom implements INodeType {
'PATCH', 'PATCH',
`/meetings/${meetingId}`, `/meetings/${meetingId}`,
body, body,
qs qs,
); );
responseData = { success: true }; responseData = { success: true };

View File

@ -346,7 +346,7 @@ export function displayParameterPath(nodeValues: INodeParameters, parameter: INo
if (path !== '') { if (path !== '') {
resolvedNodeValues = get( resolvedNodeValues = get(
nodeValues, nodeValues,
path path,
) as INodeParameters; ) as INodeParameters;
} }
@ -355,7 +355,7 @@ export function displayParameterPath(nodeValues: INodeParameters, parameter: INo
if (path && path.split('.').indexOf('parameters') === 0) { if (path && path.split('.').indexOf('parameters') === 0) {
nodeValuesRoot = get( nodeValuesRoot = get(
nodeValues, nodeValues,
'parameters' 'parameters',
) as INodeParameters; ) as INodeParameters;
} }
@ -998,7 +998,7 @@ export function addToIssuesIfMissing(foundIssues: INodeIssues, nodeProperties: I
export function getParameterValueByPath(nodeValues: INodeParameters, parameterName: string, path: string) { export function getParameterValueByPath(nodeValues: INodeParameters, parameterName: string, path: string) {
return get( return get(
nodeValues, nodeValues,
path ? path + '.' + parameterName : parameterName path ? path + '.' + parameterName : parameterName,
); );
} }