fix: Google Contacts node warm up request, Google Calendar node events>getAll fields option (#10700)

This commit is contained in:
Michael Kret 2024-09-10 15:31:00 +03:00 committed by GitHub
parent 4b2b5235db
commit 22c70d5069
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 26 additions and 0 deletions

View file

@ -656,6 +656,15 @@ export const eventFields: INodeProperties[] = [
default: '', default: '',
description: 'At least some part of the event must be before this time', description: 'At least some part of the event must be before this time',
}, },
{
displayName: 'Fields',
name: 'fields',
type: 'string',
placeholder: 'e.g. items(ID,status,summary)',
default: '',
description:
"Specify fields to return, by default a predefined by Google set of commonly used fields would be returned. To return all fields, use '*', <a href='https://developers.google.com/calendar/api/guides/performance#partial' target='_blank'>more info</a>.",
},
{ {
displayName: 'iCalUID', displayName: 'iCalUID',
name: 'iCalUID', name: 'iCalUID',

View file

@ -436,6 +436,10 @@ export class GoogleCalendar implements INodeType {
if (options.updatedMin) { if (options.updatedMin) {
qs.updatedMin = addTimezoneToDate(options.updatedMin as string, tz || timezone); qs.updatedMin = addTimezoneToDate(options.updatedMin as string, tz || timezone);
} }
if (options.fields) {
qs.fields = options.fields as string;
}
if (returnAll) { if (returnAll) {
responseData = await googleApiRequestAllItems.call( responseData = await googleApiRequestAllItems.call(
this, this,

View file

@ -92,6 +92,19 @@ export class GoogleContacts implements INodeType {
let responseData; let responseData;
const resource = this.getNodeParameter('resource', 0); const resource = this.getNodeParameter('resource', 0);
const operation = this.getNodeParameter('operation', 0); const operation = this.getNodeParameter('operation', 0);
// Warmup cache
// https://developers.google.com/people/v1/contacts#protocol_1
if (resource === 'contact' && operation === 'getAll') {
await googleApiRequest.call(this, 'GET', '/people:searchContacts', undefined, {
query: '',
readMask: 'names',
});
await googleApiRequest.call(this, 'GET', '/people/me/connections', undefined, {
personFields: 'names',
});
}
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
try { try {
if (resource === 'contact') { if (resource === 'contact') {