Skip to content

Commit a01d796

Browse files
committed
new-row-added-polling source
1 parent faa586a commit a01d796

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

components/google_sheets/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/google_sheets",
3-
"version": "0.7.12",
3+
"version": "0.8.0",
44
"description": "Pipedream Google_sheets Components",
55
"main": "google_sheets.app.mjs",
66
"keywords": [
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import googleSheets from "../../google_sheets.app.mjs";
2+
import common from "../common/new-row-added.mjs";
3+
import base from "../common/http-based/base.mjs";
4+
import { DEFAULT_POLLING_SOURCE_TIMER_INTERVAL } from "@pipedream/platform";
5+
6+
export default {
7+
...common,
8+
key: "google_sheets-new-row-added-polling",
9+
name: "New Row Added",
10+
description: "Emit new event each time a row or rows are added to the bottom of a spreadsheet.",
11+
version: "0.0.1",
12+
dedupe: "unique",
13+
type: "source",
14+
props: {
15+
googleSheets,
16+
db: "$.service.db",
17+
timer: {
18+
type: "$.interface.timer",
19+
static: {
20+
intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
21+
},
22+
},
23+
watchedDrive: {
24+
propDefinition: [
25+
googleSheets,
26+
"watchedDrive",
27+
],
28+
description: "Defaults to My Drive. To select a [Shared Drive](https://support.google.com/a/users/answer/9310351) instead, select it from this list.",
29+
},
30+
sheetID: {
31+
propDefinition: [
32+
googleSheets,
33+
"sheetID",
34+
(c) => ({
35+
driveId: googleSheets.methods.getDriveId(c.watchedDrive),
36+
}),
37+
],
38+
},
39+
...common.props,
40+
},
41+
methods: {
42+
...base.methods,
43+
...common.methods,
44+
},
45+
async run() {
46+
const spreadsheet = await this.googleSheets.getSpreadsheet(this.sheetID);
47+
return this.processSpreadsheet(spreadsheet);
48+
},
49+
};

0 commit comments

Comments
 (0)