Skip to content

Commit 2fc2151

Browse files
moving timer to static props (#16097)
* moving timer to static props * Update new-email-received.mjs
1 parent 3b13c24 commit 2fc2151

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

components/gmail/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/gmail",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"description": "Pipedream Gmail Components",
55
"main": "gmail.app.mjs",
66
"keywords": [

components/gmail/sources/new-email-received/new-email-received.mjs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default {
1515
name: "New Email Received",
1616
description: "Emit new event when a new email is received.",
1717
type: "source",
18-
version: "0.2.1",
18+
version: "0.2.2",
1919
dedupe: "unique",
2020
props: {
2121
gmail,
@@ -33,6 +33,14 @@ export default {
3333
optional: true,
3434
default: "polling",
3535
},
36+
timer: {
37+
type: "$.interface.timer",
38+
label: "Polling Interval",
39+
description: "How often to poll for new emails",
40+
default: {
41+
intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
42+
},
43+
},
3644
serviceAccountKeyJson: {
3745
type: "string",
3846
label: "Service Account Key JSON",
@@ -120,19 +128,6 @@ export default {
120128
async additionalProps() {
121129
const newProps = {};
122130

123-
// Add timer for polling mode
124-
if (this.triggerType !== "webhook") {
125-
newProps.timer = {
126-
type: "$.interface.timer",
127-
label: "Polling Interval",
128-
description: "How often to poll for new emails",
129-
default: {
130-
intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
131-
},
132-
};
133-
return newProps;
134-
}
135-
136131
// Handle webhook mode
137132
if (this.triggerType === "webhook") {
138133
// verify that a Custom OAuth client is being used only if webhook mode is selected
@@ -150,7 +145,7 @@ export default {
150145
};
151146
newProps.timer = {
152147
type: "$.interface.timer",
153-
default: {
148+
static: {
154149
intervalSeconds: 60 * 60, // 1 hour for webhook renewal
155150
},
156151
hidden: true,

0 commit comments

Comments
 (0)