mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
👕 Fix lint issue
This commit is contained in:
@@ -40,7 +40,7 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
|
||||
errors = errors.map((e: IDataObject) => e.message);
|
||||
// Try to return the error prettier
|
||||
throw new Error(
|
||||
`Google Calendar error response [${error.statusCode}]: ${errors.join('|')}`
|
||||
`Google Calendar error response [${error.statusCode}]: ${errors.join('|')}`,
|
||||
);
|
||||
}
|
||||
throw error;
|
||||
|
||||
@@ -72,14 +72,14 @@ export class GoogleCalendar implements INodeType {
|
||||
// Get all the calendars to display them to user so that he can
|
||||
// select them easily
|
||||
async getCalendars(
|
||||
this: ILoadOptionsFunctions
|
||||
this: ILoadOptionsFunctions,
|
||||
): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const calendars = await googleApiRequestAllItems.call(
|
||||
this,
|
||||
'items',
|
||||
'GET',
|
||||
'/calendar/v3/users/me/calendarList'
|
||||
'/calendar/v3/users/me/calendarList',
|
||||
);
|
||||
for (const calendar of calendars) {
|
||||
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
|
||||
// select them easily
|
||||
async getColors(
|
||||
this: ILoadOptionsFunctions
|
||||
this: ILoadOptionsFunctions,
|
||||
): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const { event } = await googleApiRequest.call(
|
||||
this,
|
||||
'GET',
|
||||
'/calendar/v3/colors'
|
||||
'/calendar/v3/colors',
|
||||
);
|
||||
for (const key of Object.keys(event)) {
|
||||
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
|
||||
// select them easily
|
||||
async getTimezones(
|
||||
this: ILoadOptionsFunctions
|
||||
this: ILoadOptionsFunctions,
|
||||
): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
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 useDefaultReminders = this.getNodeParameter(
|
||||
'useDefaultReminders',
|
||||
i
|
||||
i,
|
||||
) as boolean;
|
||||
const additionalFields = this.getNodeParameter(
|
||||
'additionalFields',
|
||||
i
|
||||
i,
|
||||
) as IDataObject;
|
||||
if (additionalFields.maxAttendees) {
|
||||
qs.maxAttendees = additionalFields.maxAttendees as number;
|
||||
@@ -177,7 +177,7 @@ export class GoogleCalendar implements INodeType {
|
||||
body.attendees = (additionalFields.attendees as string[]).map(
|
||||
attendee => {
|
||||
return { email: attendee };
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
if (additionalFields.color) {
|
||||
@@ -213,7 +213,7 @@ export class GoogleCalendar implements INodeType {
|
||||
if (!useDefaultReminders) {
|
||||
const reminders = (this.getNodeParameter(
|
||||
'remindersUi',
|
||||
i
|
||||
i,
|
||||
) as IDataObject).remindersValues as IDataObject[];
|
||||
body.reminders = {
|
||||
useDefault: false,
|
||||
@@ -242,24 +242,24 @@ export class GoogleCalendar implements INodeType {
|
||||
additionalFields.repeatUntil
|
||||
) {
|
||||
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) {
|
||||
body.recurrence?.push(
|
||||
`FREQ=${(additionalFields.repeatFrecuency as string).toUpperCase()};`
|
||||
`FREQ=${(additionalFields.repeatFrecuency as string).toUpperCase()};`,
|
||||
);
|
||||
}
|
||||
if (additionalFields.repeatHowManyTimes) {
|
||||
body.recurrence?.push(
|
||||
`COUNT=${additionalFields.repeatHowManyTimes};`
|
||||
`COUNT=${additionalFields.repeatHowManyTimes};`,
|
||||
);
|
||||
}
|
||||
if (additionalFields.repeatUntil) {
|
||||
body.recurrence?.push(
|
||||
`UNTIL=${moment(additionalFields.repeatUntil as string)
|
||||
.utc()
|
||||
.format('YYYYMMDDTHHmmss')}Z`
|
||||
.format('YYYYMMDDTHHmmss')}Z`,
|
||||
);
|
||||
}
|
||||
if (body.recurrence.length !== 0) {
|
||||
@@ -270,7 +270,7 @@ export class GoogleCalendar implements INodeType {
|
||||
'POST',
|
||||
`/calendar/v3/calendars/${calendarId}/events`,
|
||||
body,
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
}
|
||||
//https://developers.google.com/calendar/v3/reference/events/delete
|
||||
@@ -285,7 +285,7 @@ export class GoogleCalendar implements INodeType {
|
||||
this,
|
||||
'DELETE',
|
||||
`/calendar/v3/calendars/${calendarId}/events/${eventId}`,
|
||||
{}
|
||||
{},
|
||||
);
|
||||
responseData = { success: true };
|
||||
}
|
||||
@@ -305,7 +305,7 @@ export class GoogleCalendar implements INodeType {
|
||||
'GET',
|
||||
`/calendar/v3/calendars/${calendarId}/events/${eventId}`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
}
|
||||
//https://developers.google.com/calendar/v3/reference/events/list
|
||||
@@ -353,7 +353,7 @@ export class GoogleCalendar implements INodeType {
|
||||
'GET',
|
||||
`/calendar/v3/calendars/${calendarId}/events`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
} else {
|
||||
qs.maxResults = this.getNodeParameter('limit', i) as number;
|
||||
@@ -362,7 +362,7 @@ export class GoogleCalendar implements INodeType {
|
||||
'GET',
|
||||
`/calendar/v3/calendars/${calendarId}/events`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
responseData = responseData.items;
|
||||
}
|
||||
@@ -373,11 +373,11 @@ export class GoogleCalendar implements INodeType {
|
||||
const eventId = this.getNodeParameter('eventId', i) as string;
|
||||
const useDefaultReminders = this.getNodeParameter(
|
||||
'useDefaultReminders',
|
||||
i
|
||||
i,
|
||||
) as boolean;
|
||||
const updateFields = this.getNodeParameter(
|
||||
'updateFields',
|
||||
i
|
||||
i,
|
||||
) as IDataObject;
|
||||
if (updateFields.maxAttendees) {
|
||||
qs.maxAttendees = updateFields.maxAttendees as number;
|
||||
@@ -405,7 +405,7 @@ export class GoogleCalendar implements INodeType {
|
||||
body.attendees = (updateFields.attendees as string[]).map(
|
||||
attendee => {
|
||||
return { email: attendee };
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
if (updateFields.color) {
|
||||
@@ -441,7 +441,7 @@ export class GoogleCalendar implements INodeType {
|
||||
if (!useDefaultReminders) {
|
||||
const reminders = (this.getNodeParameter(
|
||||
'remindersUi',
|
||||
i
|
||||
i,
|
||||
) as IDataObject).remindersValues as IDataObject[];
|
||||
body.reminders = {
|
||||
useDefault: false,
|
||||
@@ -467,12 +467,12 @@ export class GoogleCalendar implements INodeType {
|
||||
body.recurrence = [];
|
||||
if (updateFields.repeatHowManyTimes && updateFields.repeatUntil) {
|
||||
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) {
|
||||
body.recurrence?.push(
|
||||
`FREQ=${(updateFields.repeatFrecuency as string).toUpperCase()};`
|
||||
`FREQ=${(updateFields.repeatFrecuency as string).toUpperCase()};`,
|
||||
);
|
||||
}
|
||||
if (updateFields.repeatHowManyTimes) {
|
||||
@@ -482,7 +482,7 @@ export class GoogleCalendar implements INodeType {
|
||||
body.recurrence?.push(
|
||||
`UNTIL=${moment(updateFields.repeatUntil as string)
|
||||
.utc()
|
||||
.format('YYYYMMDDTHHmmss')}Z`
|
||||
.format('YYYYMMDDTHHmmss')}Z`,
|
||||
);
|
||||
}
|
||||
if (body.recurrence.length !== 0) {
|
||||
@@ -495,7 +495,7 @@ export class GoogleCalendar implements INodeType {
|
||||
'PATCH',
|
||||
`/calendar/v3/calendars/${calendarId}/events/${eventId}`,
|
||||
body,
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
|
||||
|
||||
// Try to return the error prettier
|
||||
throw new Error(
|
||||
`Google Contacts error response [${error.statusCode}]: ${errors}`
|
||||
`Google Contacts error response [${error.statusCode}]: ${errors}`,
|
||||
);
|
||||
}
|
||||
throw error;
|
||||
|
||||
@@ -70,14 +70,14 @@ export class GoogleContacts implements INodeType {
|
||||
// Get all the calendars to display them to user so that he can
|
||||
// select them easily
|
||||
async getGroups(
|
||||
this: ILoadOptionsFunctions
|
||||
this: ILoadOptionsFunctions,
|
||||
): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const groups = await googleApiRequestAllItems.call(
|
||||
this,
|
||||
'contactGroups',
|
||||
'GET',
|
||||
`/contactGroups`
|
||||
`/contactGroups`,
|
||||
);
|
||||
for (const group of groups) {
|
||||
const groupName = group.name;
|
||||
@@ -219,7 +219,7 @@ export class GoogleContacts implements INodeType {
|
||||
'POST',
|
||||
`/people:createContact`,
|
||||
body,
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
|
||||
responseData.contactId = responseData.resourceName.split('/')[1];
|
||||
@@ -232,7 +232,7 @@ export class GoogleContacts implements INodeType {
|
||||
this,
|
||||
'DELETE',
|
||||
`/people/${contactId}:deleteContact`,
|
||||
{}
|
||||
{},
|
||||
);
|
||||
responseData = { success: true };
|
||||
}
|
||||
@@ -253,7 +253,7 @@ export class GoogleContacts implements INodeType {
|
||||
'GET',
|
||||
`/people/${contactId}`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
|
||||
if (!rawData) {
|
||||
@@ -286,7 +286,7 @@ export class GoogleContacts implements INodeType {
|
||||
'GET',
|
||||
`/people/me/connections`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
} else {
|
||||
qs.pageSize = this.getNodeParameter('limit', i) as number;
|
||||
@@ -295,7 +295,7 @@ export class GoogleContacts implements INodeType {
|
||||
'GET',
|
||||
`/people/me/connections`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
responseData = responseData.connections;
|
||||
}
|
||||
@@ -331,7 +331,7 @@ export class GoogleContacts implements INodeType {
|
||||
'GET',
|
||||
`/people/${contactId}`,
|
||||
{},
|
||||
{ personFields: 'Names' }
|
||||
{ personFields: 'Names' },
|
||||
);
|
||||
|
||||
etag = data.etag;
|
||||
@@ -479,7 +479,7 @@ export class GoogleContacts implements INodeType {
|
||||
'PATCH',
|
||||
`/people/${contactId}:updateContact`,
|
||||
body,
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
|
||||
responseData.contactId = responseData.resourceName.split('/')[1];
|
||||
|
||||
@@ -121,7 +121,7 @@ function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoa
|
||||
'typ': 'JWT',
|
||||
'alg': 'RS256',
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const options: OptionsWithUri = {
|
||||
|
||||
@@ -66,14 +66,14 @@ export class GSuiteAdmin implements INodeType {
|
||||
// Get all the domains to display them to user so that he can
|
||||
// select them easily
|
||||
async getDomains(
|
||||
this: ILoadOptionsFunctions
|
||||
this: ILoadOptionsFunctions,
|
||||
): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const domains = await googleApiRequestAllItems.call(
|
||||
this,
|
||||
'domains',
|
||||
'GET',
|
||||
'/directory/v1/customer/my_customer/domains'
|
||||
'/directory/v1/customer/my_customer/domains',
|
||||
);
|
||||
for (const domain of domains) {
|
||||
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
|
||||
// select them easily
|
||||
async getSchemas(
|
||||
this: ILoadOptionsFunctions
|
||||
this: ILoadOptionsFunctions,
|
||||
): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const schemas = await googleApiRequestAllItems.call(
|
||||
this,
|
||||
'schemas',
|
||||
'GET',
|
||||
'/directory/v1/customer/my_customer/schemas'
|
||||
'/directory/v1/customer/my_customer/schemas',
|
||||
);
|
||||
for (const schema of schemas) {
|
||||
const schemaName = schema.displayName;
|
||||
@@ -173,7 +173,7 @@ export class GSuiteAdmin implements INodeType {
|
||||
'POST',
|
||||
`/directory/v1/users`,
|
||||
body,
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
|
||||
if (makeAdmin) {
|
||||
@@ -182,7 +182,7 @@ export class GSuiteAdmin implements INodeType {
|
||||
this,
|
||||
'POST',
|
||||
`/directory/v1/users/${responseData.id}/makeAdmin`,
|
||||
{ status: true }
|
||||
{ status: true },
|
||||
);
|
||||
|
||||
responseData.isAdmin = true;
|
||||
@@ -198,7 +198,7 @@ export class GSuiteAdmin implements INodeType {
|
||||
this,
|
||||
'DELETE',
|
||||
`/directory/v1/users/${userId}`,
|
||||
{}
|
||||
{},
|
||||
);
|
||||
|
||||
responseData = { success: true };
|
||||
@@ -230,7 +230,7 @@ export class GSuiteAdmin implements INodeType {
|
||||
'GET',
|
||||
`/directory/v1/users/${userId}`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ export class GSuiteAdmin implements INodeType {
|
||||
'GET',
|
||||
`/directory/v1/users`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
|
||||
} else {
|
||||
@@ -279,7 +279,7 @@ export class GSuiteAdmin implements INodeType {
|
||||
'GET',
|
||||
`/directory/v1/users`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
|
||||
responseData = responseData.users;
|
||||
@@ -342,7 +342,7 @@ export class GSuiteAdmin implements INodeType {
|
||||
'PUT',
|
||||
`/directory/v1/users/${userId}`,
|
||||
body,
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
|
||||
errors = errors.map((e: IDataObject) => e.message);
|
||||
// Try to return the error prettier
|
||||
throw new Error(
|
||||
`G Suite Admin error response [${error.statusCode}]: ${errors.join('|')}`
|
||||
`G Suite Admin error response [${error.statusCode}]: ${errors.join('|')}`,
|
||||
);
|
||||
}
|
||||
throw error;
|
||||
|
||||
@@ -136,14 +136,14 @@ export class Gmail implements INodeType {
|
||||
// Get all the labels to display them to user so that he can
|
||||
// select them easily
|
||||
async getLabels(
|
||||
this: ILoadOptionsFunctions
|
||||
this: ILoadOptionsFunctions,
|
||||
): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const labels = await googleApiRequestAllItems.call(
|
||||
this,
|
||||
'labels',
|
||||
'GET',
|
||||
'/gmail/v1/users/me/labels'
|
||||
'/gmail/v1/users/me/labels',
|
||||
);
|
||||
for (const label of labels) {
|
||||
const labelName = label.name;
|
||||
@@ -216,7 +216,7 @@ export class Gmail implements INodeType {
|
||||
'GET',
|
||||
`/gmail/v1/users/me/labels`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
|
||||
responseData = responseData.labels;
|
||||
@@ -486,7 +486,7 @@ export class Gmail implements INodeType {
|
||||
'GET',
|
||||
`/gmail/v1/users/me/messages`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
} else {
|
||||
qs.maxResults = this.getNodeParameter('limit', i) as number;
|
||||
@@ -495,7 +495,7 @@ export class Gmail implements INodeType {
|
||||
'GET',
|
||||
`/gmail/v1/users/me/messages`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
responseData = responseData.messages;
|
||||
}
|
||||
@@ -520,7 +520,7 @@ export class Gmail implements INodeType {
|
||||
'GET',
|
||||
`/gmail/v1/users/me/messages/${responseData[i].id}`,
|
||||
body,
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
|
||||
if (format === 'resolved') {
|
||||
@@ -692,7 +692,7 @@ export class Gmail implements INodeType {
|
||||
'GET',
|
||||
`/gmail/v1/users/me/drafts`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
} else {
|
||||
qs.maxResults = this.getNodeParameter('limit', i) as number;
|
||||
@@ -701,7 +701,7 @@ export class Gmail implements INodeType {
|
||||
'GET',
|
||||
`/gmail/v1/users/me/drafts`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
responseData = responseData.drafts;
|
||||
}
|
||||
@@ -726,7 +726,7 @@ export class Gmail implements INodeType {
|
||||
'GET',
|
||||
`/gmail/v1/users/me/drafts/${responseData[i].id}`,
|
||||
body,
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
|
||||
if (format === 'resolved') {
|
||||
|
||||
@@ -108,7 +108,7 @@ function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoa
|
||||
'typ': 'JWT',
|
||||
'alg': 'RS256',
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const options: OptionsWithUri = {
|
||||
|
||||
@@ -19,7 +19,7 @@ export async function googleApiRequest(
|
||||
body: IDataObject = {},
|
||||
qs: IDataObject = {},
|
||||
uri?: string,
|
||||
headers: IDataObject = {}
|
||||
headers: IDataObject = {},
|
||||
): Promise<any> { // tslint:disable-line:no-any
|
||||
const options: OptionsWithUri = {
|
||||
headers: {
|
||||
@@ -43,7 +43,7 @@ export async function googleApiRequest(
|
||||
return await this.helpers.requestOAuth2.call(
|
||||
this,
|
||||
'googleTasksOAuth2Api',
|
||||
options
|
||||
options,
|
||||
);
|
||||
} catch (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);
|
||||
// Try to return the error prettier
|
||||
throw new Error(
|
||||
`Google Tasks error response [${error.statusCode}]: ${errors.join('|')}`
|
||||
`Google Tasks error response [${error.statusCode}]: ${errors.join('|')}`,
|
||||
);
|
||||
}
|
||||
throw error;
|
||||
@@ -66,7 +66,7 @@ export async function googleApiRequestAllItems(
|
||||
method: string,
|
||||
endpoint: string,
|
||||
body: IDataObject = {},
|
||||
query: IDataObject = {}
|
||||
query: IDataObject = {},
|
||||
): Promise<any> { // tslint:disable-line:no-any
|
||||
const returnData: IDataObject[] = [];
|
||||
|
||||
@@ -79,7 +79,7 @@ export async function googleApiRequestAllItems(
|
||||
method,
|
||||
endpoint,
|
||||
body,
|
||||
query
|
||||
query,
|
||||
);
|
||||
query.pageToken = responseData['nextPageToken'];
|
||||
returnData.push.apply(returnData, responseData[propertyName]);
|
||||
|
||||
@@ -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
|
||||
|
||||
async getTasks(
|
||||
this: ILoadOptionsFunctions
|
||||
this: ILoadOptionsFunctions,
|
||||
): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const tasks = await googleApiRequestAllItems.call(
|
||||
this,
|
||||
'items',
|
||||
'GET',
|
||||
'/tasks/v1/users/@me/lists'
|
||||
'/tasks/v1/users/@me/lists',
|
||||
);
|
||||
for (const task of tasks) {
|
||||
const taskName = task.title;
|
||||
@@ -105,7 +105,7 @@ export class GoogleTasks implements INodeType {
|
||||
body.title = this.getNodeParameter('title', i) as string;
|
||||
const additionalFields = this.getNodeParameter(
|
||||
'additionalFields',
|
||||
i
|
||||
i,
|
||||
) as IDataObject;
|
||||
|
||||
if (additionalFields.parent) {
|
||||
@@ -139,7 +139,7 @@ export class GoogleTasks implements INodeType {
|
||||
'POST',
|
||||
`/tasks/v1/lists/${taskId}/tasks`,
|
||||
body,
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
}
|
||||
if (operation === 'delete') {
|
||||
@@ -151,7 +151,7 @@ export class GoogleTasks implements INodeType {
|
||||
this,
|
||||
'DELETE',
|
||||
`/tasks/v1/lists/${taskListId}/tasks/${taskId}`,
|
||||
{}
|
||||
{},
|
||||
);
|
||||
responseData = { success: true };
|
||||
}
|
||||
@@ -164,7 +164,7 @@ export class GoogleTasks implements INodeType {
|
||||
'GET',
|
||||
`/tasks/v1/lists/${taskListId}/tasks/${taskId}`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
}
|
||||
if (operation === 'getAll') {
|
||||
@@ -173,7 +173,7 @@ export class GoogleTasks implements INodeType {
|
||||
const taskListId = this.getNodeParameter('task', i) as string;
|
||||
const options = this.getNodeParameter(
|
||||
'additionalFields',
|
||||
i
|
||||
i,
|
||||
) as IDataObject;
|
||||
if (options.completedMax) {
|
||||
qs.completedMax = options.completedMax as string;
|
||||
@@ -207,7 +207,7 @@ export class GoogleTasks implements INodeType {
|
||||
'GET',
|
||||
`/tasks/v1/lists/${taskListId}/tasks`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
} else {
|
||||
qs.maxResults = this.getNodeParameter('limit', i) as number;
|
||||
@@ -216,7 +216,7 @@ export class GoogleTasks implements INodeType {
|
||||
'GET',
|
||||
`/tasks/v1/lists/${taskListId}/tasks`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
responseData = responseData.items;
|
||||
}
|
||||
@@ -228,7 +228,7 @@ export class GoogleTasks implements INodeType {
|
||||
const taskId = this.getNodeParameter('taskId', i) as string;
|
||||
const updateFields = this.getNodeParameter(
|
||||
'updateFields',
|
||||
i
|
||||
i,
|
||||
) as IDataObject;
|
||||
|
||||
if (updateFields.previous) {
|
||||
@@ -264,7 +264,7 @@ export class GoogleTasks implements INodeType {
|
||||
'PATCH',
|
||||
`/tasks/v1/lists/${taskListId}/tasks/${taskId}`,
|
||||
body,
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoa
|
||||
'typ': 'JWT',
|
||||
'alg': 'RS256',
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const options: OptionsWithUri = {
|
||||
|
||||
@@ -152,13 +152,13 @@ export class GoogleTranslate implements INodeType {
|
||||
methods = {
|
||||
loadOptions: {
|
||||
async getLanguages(
|
||||
this: ILoadOptionsFunctions
|
||||
this: ILoadOptionsFunctions,
|
||||
): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const { data: { languages } } = await googleApiRequest.call(
|
||||
this,
|
||||
'GET',
|
||||
'/language/translate/v2/languages'
|
||||
'/language/translate/v2/languages',
|
||||
);
|
||||
for (const language of languages) {
|
||||
returnData.push({
|
||||
|
||||
@@ -51,7 +51,7 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF
|
||||
|
||||
// Try to return the error prettier
|
||||
throw new Error(
|
||||
`YouTube error response [${error.statusCode}]: ${errors.join('|')}`
|
||||
`YouTube error response [${error.statusCode}]: ${errors.join('|')}`,
|
||||
);
|
||||
}
|
||||
throw error;
|
||||
|
||||
@@ -119,14 +119,14 @@ export class YouTube implements INodeType {
|
||||
// Get all the languages to display them to user so that he can
|
||||
// select them easily
|
||||
async getLanguages(
|
||||
this: ILoadOptionsFunctions
|
||||
this: ILoadOptionsFunctions,
|
||||
): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const languages = await googleApiRequestAllItems.call(
|
||||
this,
|
||||
'items',
|
||||
'GET',
|
||||
'/youtube/v3/i18nLanguages'
|
||||
'/youtube/v3/i18nLanguages',
|
||||
);
|
||||
for (const language of languages) {
|
||||
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
|
||||
// select them easily
|
||||
async getVideoCategories(
|
||||
this: ILoadOptionsFunctions
|
||||
this: ILoadOptionsFunctions,
|
||||
): Promise<INodePropertyOptions[]> {
|
||||
const countryCode = this.getCurrentNodeParameter('regionCode') as string;
|
||||
|
||||
@@ -169,7 +169,7 @@ export class YouTube implements INodeType {
|
||||
'GET',
|
||||
'/youtube/v3/videoCategories',
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
for (const category of categories) {
|
||||
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
|
||||
// select them easily
|
||||
async getPlaylists(
|
||||
this: ILoadOptionsFunctions
|
||||
this: ILoadOptionsFunctions,
|
||||
): Promise<INodePropertyOptions[]> {
|
||||
const returnData: INodePropertyOptions[] = [];
|
||||
const qs: IDataObject = {};
|
||||
@@ -196,7 +196,7 @@ export class YouTube implements INodeType {
|
||||
'GET',
|
||||
'/youtube/v3/playlists',
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
for (const playlist of playlists) {
|
||||
const playlistName = playlist.snippet.title;
|
||||
@@ -249,7 +249,7 @@ export class YouTube implements INodeType {
|
||||
'GET',
|
||||
`/youtube/v3/channels`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
|
||||
responseData = responseData.items;
|
||||
@@ -292,7 +292,7 @@ export class YouTube implements INodeType {
|
||||
'GET',
|
||||
`/youtube/v3/channels`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
} else {
|
||||
qs.maxResults = this.getNodeParameter('limit', i) as number;
|
||||
@@ -301,7 +301,7 @@ export class YouTube implements INodeType {
|
||||
'GET',
|
||||
`/youtube/v3/channels`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
responseData = responseData.items;
|
||||
}
|
||||
@@ -400,7 +400,7 @@ export class YouTube implements INodeType {
|
||||
'PUT',
|
||||
'/youtube/v3/channels',
|
||||
body,
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
}
|
||||
//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',
|
||||
`/youtube/v3/playlists`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
|
||||
responseData = responseData.items;
|
||||
@@ -525,7 +525,7 @@ export class YouTube implements INodeType {
|
||||
'GET',
|
||||
`/youtube/v3/playlists`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
} else {
|
||||
qs.maxResults = this.getNodeParameter('limit', i) as number;
|
||||
@@ -534,7 +534,7 @@ export class YouTube implements INodeType {
|
||||
'GET',
|
||||
`/youtube/v3/playlists`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
responseData = responseData.items;
|
||||
}
|
||||
@@ -580,7 +580,7 @@ export class YouTube implements INodeType {
|
||||
'POST',
|
||||
'/youtube/v3/playlists',
|
||||
body,
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
}
|
||||
//https://developers.google.com/youtube/v3/docs/playlists/update
|
||||
@@ -629,7 +629,7 @@ export class YouTube implements INodeType {
|
||||
'PUT',
|
||||
'/youtube/v3/playlists',
|
||||
body,
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
}
|
||||
//https://developers.google.com/youtube/v3/docs/playlists/delete
|
||||
@@ -649,7 +649,7 @@ export class YouTube implements INodeType {
|
||||
this,
|
||||
'DELETE',
|
||||
'/youtube/v3/playlists',
|
||||
body
|
||||
body,
|
||||
);
|
||||
|
||||
responseData = { success: true };
|
||||
@@ -682,7 +682,7 @@ export class YouTube implements INodeType {
|
||||
'GET',
|
||||
`/youtube/v3/playlistItems`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
|
||||
responseData = responseData.items;
|
||||
@@ -717,7 +717,7 @@ export class YouTube implements INodeType {
|
||||
'GET',
|
||||
`/youtube/v3/playlistItems`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
} else {
|
||||
qs.maxResults = this.getNodeParameter('limit', i) as number;
|
||||
@@ -726,7 +726,7 @@ export class YouTube implements INodeType {
|
||||
'GET',
|
||||
`/youtube/v3/playlistItems`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
responseData = responseData.items;
|
||||
}
|
||||
@@ -781,7 +781,7 @@ export class YouTube implements INodeType {
|
||||
'POST',
|
||||
'/youtube/v3/playlistItems',
|
||||
body,
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
}
|
||||
//https://developers.google.com/youtube/v3/docs/playlistItems/delete
|
||||
@@ -801,7 +801,7 @@ export class YouTube implements INodeType {
|
||||
this,
|
||||
'DELETE',
|
||||
'/youtube/v3/playlistItems',
|
||||
body
|
||||
body,
|
||||
);
|
||||
|
||||
responseData = { success: true };
|
||||
@@ -837,7 +837,7 @@ export class YouTube implements INodeType {
|
||||
'GET',
|
||||
`/youtube/v3/search`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
} else {
|
||||
qs.maxResults = this.getNodeParameter('limit', i) as number;
|
||||
@@ -846,7 +846,7 @@ export class YouTube implements INodeType {
|
||||
'GET',
|
||||
`/youtube/v3/search`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
responseData = responseData.items;
|
||||
}
|
||||
@@ -883,7 +883,7 @@ export class YouTube implements INodeType {
|
||||
'GET',
|
||||
`/youtube/v3/videos`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
|
||||
responseData = responseData.items;
|
||||
@@ -999,7 +999,7 @@ export class YouTube implements INodeType {
|
||||
'PUT',
|
||||
`/youtube/v3/videos`,
|
||||
data,
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
}
|
||||
//https://developers.google.com/youtube/v3/docs/playlists/update
|
||||
@@ -1078,7 +1078,7 @@ export class YouTube implements INodeType {
|
||||
'PUT',
|
||||
'/youtube/v3/videos',
|
||||
body,
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
}
|
||||
//https://developers.google.com/youtube/v3/docs/videos/delete?hl=en
|
||||
@@ -1098,7 +1098,7 @@ export class YouTube implements INodeType {
|
||||
this,
|
||||
'DELETE',
|
||||
'/youtube/v3/videos',
|
||||
body
|
||||
body,
|
||||
);
|
||||
|
||||
responseData = { success: true };
|
||||
@@ -1117,7 +1117,7 @@ export class YouTube implements INodeType {
|
||||
this,
|
||||
'POST',
|
||||
'/youtube/v3/videos/rate',
|
||||
body
|
||||
body,
|
||||
);
|
||||
|
||||
responseData = { success: true };
|
||||
@@ -1138,7 +1138,7 @@ export class YouTube implements INodeType {
|
||||
'GET',
|
||||
`/youtube/v3/videoCategories`,
|
||||
{},
|
||||
qs
|
||||
qs,
|
||||
);
|
||||
responseData = responseData.items;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user