Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "google_calendar-add-attendees-to-event",
name: "Add Attendees To Event",
description: "Add attendees to an existing event. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#update)",
version: "0.0.1",
version: "0.0.2",
type: "action",
props: {
googleCalendar,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "google_calendar-create-event",
name: "Create Event",
description: "Create an event in a Google Calendar. [See the documentation](https://developers.google.com/calendar/api/v3/reference/events/insert)",
version: "0.2.3",
version: "0.2.4",
type: "action",
props: {
googleCalendar,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "google_calendar-delete-event",
name: "Delete an Event",
description: "Delete an event from a Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#delete)",
version: "0.1.5",
version: "0.1.6",
type: "action",
props: {
googleCalendar,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "google_calendar-get-calendar",
name: "Retrieve Calendar Details",
description: "Retrieve calendar details of a Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Calendars.html#get)",
version: "0.1.6",
version: "0.1.7",
type: "action",
props: {
googleCalendar,
Expand Down
2 changes: 1 addition & 1 deletion components/google_calendar/actions/get-event/get-event.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "google_calendar-get-event",
name: "Retrieve Event Details",
description: "Retrieve event details from Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#get)",
version: "0.1.6",
version: "0.1.7",
type: "action",
props: {
googleCalendar,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "google_calendar-list-calendars",
name: "List Calendars",
description: "Retrieve a list of calendars from Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Calendarlist.html#list)",
version: "0.1.6",
version: "0.1.7",
type: "action",
props: {
googleCalendar,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "google_calendar-list-events",
name: "List Events",
description: "Retrieve a list of event from the Google Calendar. [See the documentation](https://developers.google.com/calendar/api/v3/reference/events/list)",
version: "0.0.6",
version: "0.0.7",
type: "action",
props: {
googleCalendar,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "google_calendar-query-free-busy-calendars",
name: "Retrieve Free/Busy Calendar Details",
description: "Retrieve free/busy calendar details from Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Freebusy.html#query)",
version: "0.1.6",
version: "0.1.7",
type: "action",
props: {
googleCalendar,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "google_calendar-quick-add-event",
name: "Add Quick Event",
description: "Create a quick event to the Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#quickAdd)",
version: "0.1.5",
version: "0.1.6",
type: "action",
props: {
googleCalendar,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "google_calendar-update-event",
name: "Update Event",
description: "Update an event from Google Calendar. [See the documentation](https://googleapis.dev/nodejs/googleapis/latest/calendar/classes/Resource$Events.html#update)",
version: "0.0.8",
version: "0.0.9",
type: "action",
props: {
googleCalendar,
Expand Down
29 changes: 28 additions & 1 deletion components/google_calendar/google_calendar.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,27 @@ export default {
auth,
});
},
retryWithExponentialBackoff(func, maxAttempts = 3, baseDelayS = 2) {
let attempt = 0;

const execute = async () => {
try {
return await func();
} catch (error) {
if (attempt >= maxAttempts) {
throw error;
}

const delayMs = Math.pow(baseDelayS, attempt) * 1000;
await new Promise((resolve) => setTimeout(resolve, delayMs));

attempt++;
return execute();
}
};

return execute();
},
async requestHandler({
api, method, args = {},
}) {
Expand All @@ -305,7 +326,8 @@ export default {
} = args;
try {
const calendar = this.client();
const response = await calendar[api][method](otherArgs);
const fn = () => calendar[api][method](otherArgs);
const response = await this.retryWithExponentialBackoff(fn);
return returnOnlyData
? response.data
: response;
Expand Down Expand Up @@ -454,6 +476,9 @@ export default {
args,
});
},
// Used to get the nextSyncToken. Since we don't need
// to actually retrieve any events, we set "updatedMin"
// to the current timestamp
async fullSync(calendarId) {
let nextSyncToken = null;
let nextPageToken = null;
Expand All @@ -462,6 +487,8 @@ export default {
await this.listEvents({
calendarId,
pageToken: nextPageToken,
orderBy: "updated",
updatedMin: new Date().toISOString(),
});
nextPageToken = syncResp?.nextPageToken;
nextSyncToken = syncResp?.nextSyncToken;
Expand Down
2 changes: 1 addition & 1 deletion components/google_calendar/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/google_calendar",
"version": "0.5.4",
"version": "0.5.5",
"description": "Pipedream Google_calendar Components",
"main": "google_calendar.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "google_calendar-event-cancelled",
name: "New Cancelled Event",
description: "Emit new event when a Google Calendar event is cancelled or deleted",
version: "0.1.9",
version: "0.1.10",
type: "source",
dedupe: "unique",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "google_calendar-event-ended",
name: "New Ended Event",
description: "Emit new event when a Google Calendar event ends",
version: "0.1.9",
version: "0.1.10",
type: "source",
dedupe: "unique",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "google_calendar-new-calendar",
name: "New Calendar Created",
description: "Emit new event when a calendar is created.",
version: "0.1.9",
version: "0.1.10",
type: "source",
dedupe: "unique",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "google_calendar-new-event-search",
name: "New Event Matching a Search",
description: "Emit new event when a Google Calendar event is created that matches a search",
version: "0.1.9",
version: "0.1.10",
type: "source",
dedupe: "unique",
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
type: "source",
name: "New Created or Updated Event (Instant)",
description: "Emit new event when a Google Calendar events is created or updated (does not emit cancelled events)",
version: "0.1.12",
version: "0.1.13",
dedupe: "unique",
props: {
googleCalendar,
Expand Down Expand Up @@ -265,6 +265,7 @@ export default {
calendarId,
syncToken,
pageToken: nextPageToken,
maxResults: 2500,
});
if (syncStatus === 410) {
console.log("Sync token invalid, resyncing");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
description: `Emit new event based on a time interval before an upcoming event in the calendar. This source uses Pipedream's Task Scheduler.
[See the documentation](https://pipedream.com/docs/examples/waiting-to-execute-next-step-of-workflow/#step-1-create-a-task-scheduler-event-source)
for more information and instructions for connecting your Pipedream account.`,
version: "0.0.7",
version: "0.0.8",
type: "source",
props: {
pipedream: taskScheduler.props.pipedream,
Expand Down
Loading