Skip to content

Commit 50958a3

Browse files
committed
Airtable new actions
1 parent 5ab8a83 commit 50958a3

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import airtable from "../../airtable_oauth.app.mjs";
2+
3+
export default {
4+
key: "airtable_oauth-list-bases",
5+
name: "List Bases",
6+
description:
7+
"Get the list of bases that can be accessed. [See the documentation](https://airtable.com/developers/web/api/list-bases)",
8+
type: "action",
9+
version: "0.0.1",
10+
props: {
11+
airtable,
12+
},
13+
async run({ $ }) {
14+
const { bases } = await this.airtable.listBases({
15+
$,
16+
});
17+
$.export(
18+
"$summary",
19+
`Successfully retrieved ${bases.length} bases`,
20+
);
21+
return bases;
22+
},
23+
};
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import airtable from "../../airtable_oauth.app.mjs";
2+
3+
export default {
4+
key: "airtable_oauth-list-tables",
5+
name: "List Tables",
6+
description:
7+
"Get a list of tables in the selected base. [See the documentation](https://airtable.com/developers/web/api/get-base-schema)",
8+
type: "action",
9+
version: "0.0.1",
10+
props: {
11+
airtable,
12+
baseId: {
13+
propDefinition: [
14+
airtable,
15+
"baseId",
16+
],
17+
},
18+
},
19+
async run({ $ }) {
20+
const { tables } = await this.airtable.listTables({
21+
$,
22+
baseId: this.baseId,
23+
});
24+
$.export(
25+
"$summary",
26+
`Successfully retrieved ${tables.length} tables`,
27+
);
28+
return tables;
29+
},
30+
};

0 commit comments

Comments
 (0)