From 4ea925cc4a71929b499ea2e3dea9c50dd316e135 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Mon, 31 Mar 2025 15:06:05 -0700 Subject: [PATCH 1/2] moving timer to static props --- components/gmail/package.json | 2 +- .../new-email-received/new-email-received.mjs | 27 +++++++------------ 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/components/gmail/package.json b/components/gmail/package.json index 479d4edabfe0a..6d3d58ba29003 100644 --- a/components/gmail/package.json +++ b/components/gmail/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/gmail", - "version": "0.2.3", + "version": "0.2.4", "description": "Pipedream Gmail Components", "main": "gmail.app.mjs", "keywords": [ diff --git a/components/gmail/sources/new-email-received/new-email-received.mjs b/components/gmail/sources/new-email-received/new-email-received.mjs index 51ebbfa8c534d..7da680a27a29c 100644 --- a/components/gmail/sources/new-email-received/new-email-received.mjs +++ b/components/gmail/sources/new-email-received/new-email-received.mjs @@ -15,7 +15,7 @@ export default { name: "New Email Received", description: "Emit new event when a new email is received.", type: "source", - version: "0.2.1", + version: "0.2.2", dedupe: "unique", props: { gmail, @@ -33,6 +33,14 @@ export default { optional: true, default: "polling", }, + timer: { + type: "$.interface.timer", + label: "Polling Interval", + description: "How often to poll for new emails", + default: { + intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL, + }, + }, serviceAccountKeyJson: { type: "string", label: "Service Account Key JSON", @@ -120,19 +128,6 @@ export default { async additionalProps() { const newProps = {}; - // Add timer for polling mode - if (this.triggerType !== "webhook") { - newProps.timer = { - type: "$.interface.timer", - label: "Polling Interval", - description: "How often to poll for new emails", - default: { - intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL, - }, - }; - return newProps; - } - // Handle webhook mode if (this.triggerType === "webhook") { // verify that a Custom OAuth client is being used only if webhook mode is selected @@ -150,9 +145,7 @@ export default { }; newProps.timer = { type: "$.interface.timer", - default: { - intervalSeconds: 60 * 60, // 1 hour for webhook renewal - }, + intervalSeconds: 60 * 60, // 1 hour for webhook renewal hidden: true, }; From ec92170ce3692078afe3b0b33e711c4752600e77 Mon Sep 17 00:00:00 2001 From: Danny Roosevelt Date: Mon, 31 Mar 2025 15:11:48 -0700 Subject: [PATCH 2/2] Update new-email-received.mjs --- .../gmail/sources/new-email-received/new-email-received.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/gmail/sources/new-email-received/new-email-received.mjs b/components/gmail/sources/new-email-received/new-email-received.mjs index 7da680a27a29c..c549b9b17959e 100644 --- a/components/gmail/sources/new-email-received/new-email-received.mjs +++ b/components/gmail/sources/new-email-received/new-email-received.mjs @@ -145,7 +145,9 @@ export default { }; newProps.timer = { type: "$.interface.timer", - intervalSeconds: 60 * 60, // 1 hour for webhook renewal + static: { + intervalSeconds: 60 * 60, // 1 hour for webhook renewal + }, hidden: true, };