Skip to content

Commit 12a7e8c

Browse files
authored
[TRIGGER] Airtable Polling Trigger with filter (#16072)
1 parent 5d39c54 commit 12a7e8c

File tree

28 files changed

+61
-40
lines changed

28 files changed

+61
-40
lines changed

components/airtable_oauth/actions/create-comment/create-comment.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "airtable_oauth-create-comment",
55
name: "Create Comment",
66
description: "Create a comment on a selected record. [See the documentation](https://airtable.com/developers/web/api/create-comment)",
7-
version: "0.0.8",
7+
version: "0.0.9",
88
type: "action",
99
props: {
1010
...common.props,

components/airtable_oauth/actions/create-field/create-field.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "airtable_oauth-create-field",
66
name: "Create Field",
77
description: "Create a new field in a table. [See the documentation](https://airtable.com/developers/web/api/create-field)",
8-
version: "0.1.0",
8+
version: "0.1.1",
99
type: "action",
1010
props: {
1111
...common.props,

components/airtable_oauth/actions/create-multiple-records/create-multiple-records.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default {
99
key: "airtable_oauth-create-multiple-records",
1010
name: "Create Multiple Records",
1111
description: "Create one or more records in a table in a single operation with an array. [See the documentation](https://airtable.com/developers/web/api/create-records)",
12-
version: "0.0.8",
12+
version: "0.0.9",
1313
type: "action",
1414
props: {
1515
...common.props,

components/airtable_oauth/actions/create-or-update-record/create-or-update-record.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "airtable_oauth-create-or-update-record",
77
name: "Create or Update Record",
88
description: "Create a new record or update an existing one. [See the documentation](https://airtable.com/developers/web/api/create-records)",
9-
version: "0.1.0",
9+
version: "0.1.1",
1010
type: "action",
1111
props: {
1212
...common.props,

components/airtable_oauth/actions/create-single-record/create-single-record.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "airtable_oauth-create-single-record",
77
name: "Create Single Record",
88
description: "Adds a record to a table.",
9-
version: "0.0.9",
9+
version: "0.0.10",
1010
type: "action",
1111
props: {
1212
...common.props,

components/airtable_oauth/actions/create-table/create-table.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "airtable_oauth-create-table",
55
name: "Create Table",
66
description: "Create a new table. [See the documentation](https://airtable.com/developers/web/api/create-table)",
7-
version: "0.0.8",
7+
version: "0.0.9",
88
type: "action",
99
props: {
1010
airtable,

components/airtable_oauth/actions/delete-record/delete-record.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "airtable_oauth-delete-record",
66
name: "Delete Record",
77
description: "Delete a selected record from a table. [See the documentation](https://airtable.com/developers/web/api/delete-record)",
8-
version: "0.0.8",
8+
version: "0.0.9",
99
type: "action",
1010
props: {
1111
...common.props,

components/airtable_oauth/actions/get-record-or-create/get-record-or-create.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "airtable_oauth-get-record-or-create",
77
name: "Get Record Or Create",
88
description: "Get a specific record, or create one if it doesn't exist. [See the documentation](https://airtable.com/developers/web/api/create-records)",
9-
version: "0.0.9",
9+
version: "0.0.10",
1010
type: "action",
1111
props: {
1212
...common.props,

components/airtable_oauth/actions/get-record/get-record.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "airtable_oauth-get-record",
77
name: "Get Record",
88
description: "Get data of a selected record from a table. [See the documentation](https://airtable.com/developers/web/api/get-record)",
9-
version: "0.0.9",
9+
version: "0.0.10",
1010
type: "action",
1111
props: {
1212
...common.props,

components/airtable_oauth/actions/list-records-in-view/list-records-in-view.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
name: "List Records in View",
77
description: "Retrieve records from a view, optionally sorting and filtering results. [See the documentation](https://airtable.com/developers/web/api/list-views)",
88
type: "action",
9-
version: "0.0.8",
9+
version: "0.0.9",
1010
...commonList,
1111
props: {
1212
accountTierAlert: {

components/airtable_oauth/actions/list-records/list-records.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
name: "List Records",
77
description: "Retrieve records from a table, optionally sorting and filtering results. [See the documentation](https://airtable.com/developers/web/api/list-records)",
88
type: "action",
9-
version: "0.0.8",
9+
version: "0.0.9",
1010
...commonList,
1111
props: {
1212
...common.props,

components/airtable_oauth/actions/search-records/search-records.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "airtable_oauth-search-records",
66
name: "Search Records",
77
description: "Search for a record by formula or by field value. [See the documentation](https://airtable.com/developers/web/api/list-records)",
8-
version: "0.0.10",
8+
version: "0.0.11",
99
type: "action",
1010
props: {
1111
...common.props,

components/airtable_oauth/actions/update-comment/update-comment.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "airtable_oauth-update-comment",
55
name: "Update Comment",
66
description: "Update an existing comment on a selected record. [See the documentation](https://airtable.com/developers/web/api/update-comment)",
7-
version: "0.0.8",
7+
version: "0.0.9",
88
type: "action",
99
props: {
1010
...common.props,

components/airtable_oauth/actions/update-field/update-field.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "airtable_oauth-update-field",
66
name: "Update Field",
77
description: "Update an existing field in a table. [See the documentation](https://airtable.com/developers/web/api/update-field)",
8-
version: "0.0.8",
8+
version: "0.0.9",
99
type: "action",
1010
props: {
1111
...common.props,

components/airtable_oauth/actions/update-record/update-record.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "airtable_oauth-update-record",
77
name: "Update Record",
88
description: "Update a single record in a table by Record ID. [See the documentation](https://airtable.com/developers/web/api/update-record)",
9-
version: "0.0.9",
9+
version: "0.0.10",
1010
type: "action",
1111
props: {
1212
...common.props,

components/airtable_oauth/actions/update-table/update-table.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "airtable_oauth-update-table",
55
name: "Update Table",
66
description: "Update an existing table. [See the documentation](https://airtable.com/developers/web/api/update-table)",
7-
version: "0.0.8",
7+
version: "0.0.9",
88
type: "action",
99
props: {
1010
...common.props,

components/airtable_oauth/airtable_oauth.app.mjs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -282,16 +282,22 @@ You can also reference an object exported by a previous step, e.g. \`{{steps.foo
282282
}) {
283283
const base = this.base(baseId);
284284
const data = [];
285-
await base(tableId).select({
286-
...params,
287-
})
288-
.eachPage(function page(records, fetchNextPage) {
289-
records.forEach(function(record) {
290-
data.push(record._rawJson);
285+
286+
try {
287+
await base(tableId).select({
288+
...params,
289+
})
290+
.eachPage(function page(records, fetchNextPage) {
291+
records.forEach(function(record) {
292+
data.push(record._rawJson);
293+
});
294+
fetchNextPage();
291295
});
292-
fetchNextPage();
293-
});
294-
return data;
296+
return data;
297+
298+
} catch (err) {
299+
this.throwFormattedError(err);
300+
}
295301
},
296302
listComments({
297303
baseId, tableId, recordId, ...args

components/airtable_oauth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/airtable_oauth",
3-
"version": "0.4.2",
3+
"version": "0.4.3",
44
"description": "Pipedream Airtable (OAuth) Components",
55
"main": "airtable_oauth.app.mjs",
66
"keywords": [

components/airtable_oauth/sources/common/common.mjs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ export default {
1717
"baseId",
1818
],
1919
},
20+
filterByFormula: {
21+
propDefinition: [
22+
airtable,
23+
"filterByFormula",
24+
],
25+
},
2026
},
2127
hooks: {
2228
activate() {
@@ -42,9 +48,17 @@ export default {
4248
const formattedTimestamp = new Date(timestampMillis).toISOString();
4349
this._setLastTimestamp(formattedTimestamp);
4450
},
45-
getListRecordsParams(params) {
51+
getListRecordsParams({
52+
formula, ...params
53+
} = {}) {
54+
let filterByFormula = formula;
55+
56+
if (this.filterByFormula) {
57+
filterByFormula = `AND(${formula}, ${this.filterByFormula})`;
58+
}
59+
4660
return {
47-
filterByFormula: `LAST_MODIFIED_TIME() > "${this._getLastTimestamp()}"`,
61+
filterByFormula,
4862
returnFieldsByFieldId: this.returnFieldsByFieldId || false,
4963
...params,
5064
};

components/airtable_oauth/sources/new-field/new-field.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "New Field Created (Instant)",
66
description: "Emit new event when a field is created in the selected table. [See the documentation](https://airtable.com/developers/web/api/get-base-schema)",
77
key: "airtable_oauth-new-field",
8-
version: "1.0.0",
8+
version: "1.0.1",
99
type: "source",
1010
dedupe: "unique",
1111
methods: {

components/airtable_oauth/sources/new-modified-or-deleted-records-instant/new-modified-or-deleted-records-instant.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
name: "New Record Created, Updated or Deleted (Instant)",
99
description: "Emit new event when a record is added, updated, or deleted in a table or selected view.",
1010
key: "airtable_oauth-new-modified-or-deleted-records-instant",
11-
version: "0.1.0",
11+
version: "0.1.1",
1212
type: "source",
1313
dedupe: "unique",
1414
props: {

components/airtable_oauth/sources/new-modified-or-deleted-records/new-modified-or-deleted-records.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
name: "New, Modified or Deleted Records",
77
description: "Emit new event each time a record is added, updated, or deleted in an Airtable table. Supports tables up to 10,000 records",
88
key: "airtable_oauth-new-modified-or-deleted-records",
9-
version: "0.0.9",
9+
version: "0.0.10",
1010
type: "source",
1111
dedupe: "unique",
1212
props: {
@@ -53,7 +53,9 @@ export default {
5353
const prevAllRecordIds = this._getPrevAllRecordIds();
5454

5555
const lastTimestamp = this._getLastTimestamp();
56-
const params = this.getListRecordsParams();
56+
const params = this.getListRecordsParams({
57+
formula: `LAST_MODIFIED_TIME() > "${lastTimestamp}"`,
58+
});
5759

5860
const records = await this.airtable.listRecords({
5961
baseId,

components/airtable_oauth/sources/new-or-modified-field/new-or-modified-field.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
name: "New or Modified Field (Instant)",
77
description: "Emit new event when a field is created or updated in the selected table",
88
key: "airtable_oauth-new-or-modified-field",
9-
version: "1.0.0",
9+
version: "1.0.1",
1010
type: "source",
1111
dedupe: "unique",
1212
methods: {

components/airtable_oauth/sources/new-or-modified-records-in-view/new-or-modified-records-in-view.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
name: "New or Modified Records in View",
77
description: "Emit new event for each new or modified record in a view",
88
key: "airtable_oauth-new-or-modified-records-in-view",
9-
version: "0.0.10",
9+
version: "0.0.11",
1010
type: "source",
1111
props: {
1212
...base.props,
@@ -50,6 +50,7 @@ export default {
5050
const lastTimestamp = this._getLastTimestamp();
5151
const params = this.getListRecordsParams({
5252
view: viewId,
53+
formula: `LAST_MODIFIED_TIME() > "${lastTimestamp}"`,
5354
});
5455

5556
const records = await this.airtable.listRecords({

components/airtable_oauth/sources/new-or-modified-records/new-or-modified-records.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
name: "New or Modified Records (Instant)",
77
key: "airtable_oauth-new-or-modified-records",
88
description: "Emit new event for each new or modified record in a table or view",
9-
version: "1.0.0",
9+
version: "1.0.1",
1010
type: "source",
1111
dedupe: "unique",
1212
methods: {

components/airtable_oauth/sources/new-records-in-view/new-records-in-view.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
name: "New Records in View",
77
description: "Emit new event for each new record in a view",
88
key: "airtable_oauth-new-records-in-view",
9-
version: "0.0.9",
9+
version: "0.0.10",
1010
type: "source",
1111
dedupe: "unique",
1212
props: {
@@ -51,7 +51,7 @@ export default {
5151
const lastTimestamp = this._getLastTimestamp();
5252
const params = this.getListRecordsParams({
5353
view: viewId,
54-
filterByFormula: `CREATED_TIME() > "${lastTimestamp}"`,
54+
formula: `CREATED_TIME() > "${lastTimestamp}"`,
5555
});
5656

5757
const records = await this.airtable.listRecords({

components/airtable_oauth/sources/new-records/new-records.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "New Record(s) Created (Instant)",
66
description: "Emit new event for each new record in a table",
77
key: "airtable_oauth-new-records",
8-
version: "1.0.0",
8+
version: "1.0.1",
99
type: "source",
1010
dedupe: "unique",
1111
methods: {

pnpm-lock.yaml

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)