Skip to content

Commit d8a00fe

Browse files
authored
Merge branch 'master' into fix/supabase-client-update
2 parents 88c3799 + 9ed1acb commit d8a00fe

File tree

156 files changed

+4184
-199
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+4184
-199
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import app from "../../aitable_ai.app.mjs";
2+
3+
export default {
4+
key: "aitable_ai-create-datasheet",
5+
name: "Create Datasheet",
6+
description: "Create a datasheet in the specified space. [See the documentation](https://developers.aitable.ai/api/reference#tag/Datasheet/operation/create-datasheets)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
spaceId: {
12+
propDefinition: [
13+
app,
14+
"spaceId",
15+
],
16+
},
17+
name: {
18+
propDefinition: [
19+
app,
20+
"name",
21+
],
22+
},
23+
description: {
24+
propDefinition: [
25+
app,
26+
"description",
27+
],
28+
},
29+
folderId: {
30+
propDefinition: [
31+
app,
32+
"folderId",
33+
],
34+
},
35+
},
36+
37+
async run({ $ }) {
38+
const response = await this.app.createDatasheet({
39+
$,
40+
spaceId: this.spaceId,
41+
data: {
42+
name: this.name,
43+
description: this.description,
44+
folderId: this.folderId,
45+
},
46+
});
47+
$.export("$summary", `Successfully created Datasheet with ID '${response.data.id}'`);
48+
return response;
49+
},
50+
};
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import app from "../../aitable_ai.app.mjs";
2+
3+
export default {
4+
key: "aitable_ai-create-field",
5+
name: "Create Field",
6+
description: "Create a new field in the specified datasheet. [See the documentation](https://developers.aitable.ai/api/reference#tag/Field/operation/create-fields)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
spaceId: {
12+
propDefinition: [
13+
app,
14+
"spaceId",
15+
],
16+
},
17+
type: {
18+
propDefinition: [
19+
app,
20+
"type",
21+
],
22+
},
23+
name: {
24+
propDefinition: [
25+
app,
26+
"name",
27+
],
28+
description: "Name of the Field",
29+
},
30+
},
31+
32+
async run({ $ }) {
33+
const response = await this.app.createField({
34+
$,
35+
spaceId: this.spaceId,
36+
data: {
37+
type: this.type,
38+
name: this.name,
39+
},
40+
});
41+
$.export("$summary", `Successfully sent request to create field. Result: '${response.message}'`);
42+
return response;
43+
},
44+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import app from "../../aitable_ai.app.mjs";
2+
3+
export default {
4+
key: "aitable_ai-delete-field",
5+
name: "Delete Field",
6+
description: "Delete a field in the specified datasheet. [See the documentation](https://developers.aitable.ai/api/reference/#tag/Field/operation/delete-fields)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
app,
11+
spaceId: {
12+
propDefinition: [
13+
app,
14+
"spaceId",
15+
],
16+
},
17+
fieldId: {
18+
propDefinition: [
19+
app,
20+
"fieldId",
21+
],
22+
},
23+
},
24+
25+
async run({ $ }) {
26+
const response = await this.app.deleteField({
27+
$,
28+
spaceId: this.spaceId,
29+
fieldId: this.fieldId,
30+
});
31+
$.export("$summary", `Successfully deleted the field with ID '${this.fieldId}'`);
32+
return response;
33+
},
34+
};
Lines changed: 115 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,121 @@
1+
import { axios } from "@pipedream/platform";
2+
import constants from "./common/constants.mjs";
3+
14
export default {
25
type: "app",
36
app: "aitable_ai",
4-
propDefinitions: {},
7+
propDefinitions: {
8+
spaceId: {
9+
type: "string",
10+
label: "Space ID",
11+
description: "ID of the Space",
12+
async options() {
13+
const response = await this.getSpaces({});
14+
const spaceIds = response.data.spaces;
15+
return spaceIds.map(({
16+
id, name,
17+
}) => ({
18+
value: id,
19+
label: name,
20+
}));
21+
},
22+
},
23+
fieldId: {
24+
type: "string",
25+
label: "Field ID",
26+
description: "ID of the Field",
27+
async options() {
28+
const response = await this.getFields({});
29+
const fieldIds = response.data.fields;
30+
return fieldIds.map(({
31+
id, name,
32+
}) => ({
33+
value: id,
34+
label: name,
35+
}));
36+
},
37+
},
38+
name: {
39+
type: "string",
40+
label: "Name",
41+
description: "Name of the Datasheet",
42+
},
43+
description: {
44+
type: "string",
45+
label: "Description",
46+
description: "Description of the Datasheet",
47+
},
48+
folderId: {
49+
type: "string",
50+
label: "Folder ID",
51+
description: "The Folder ID is located in the `URL` when the folder is selected on the `Workbench page`, i.e.: if the URL is `https://aitable.ai/workbench/123456`, the `Folder ID` is 123456",
52+
optional: true,
53+
},
54+
type: {
55+
type: "string",
56+
label: "Type",
57+
description: "Type of the Field",
58+
options: constants.FIELD_TYPES,
59+
},
60+
},
561
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
62+
_baseUrl() {
63+
return "https://aitable.ai/fusion/v1";
64+
},
65+
async _makeRequest(opts = {}) {
66+
const {
67+
$ = this,
68+
path,
69+
headers,
70+
...otherOpts
71+
} = opts;
72+
return axios($, {
73+
...otherOpts,
74+
url: this._baseUrl() + path,
75+
headers: {
76+
...headers,
77+
Authorization: `Bearer ${this.$auth.api_token}`,
78+
},
79+
});
80+
},
81+
async createDatasheet({
82+
spaceId, ...args
83+
}) {
84+
return this._makeRequest({
85+
path: `/spaces/${spaceId}/datasheets`,
86+
method: "post",
87+
...args,
88+
});
89+
},
90+
async createField({
91+
spaceId, ...args
92+
}) {
93+
return this._makeRequest({
94+
path: `/spaces/${spaceId}/datasheets/${this.$auth.datasheet_id}/fields`,
95+
method: "post",
96+
...args,
97+
});
98+
},
99+
async deleteField({
100+
spaceId, fieldId, ...args
101+
}) {
102+
return this._makeRequest({
103+
path: `/spaces/${spaceId}/datasheets/${this.$auth.datasheet_id}/fields/${fieldId}`,
104+
method: "delete",
105+
...args,
106+
});
107+
},
108+
async getSpaces(args = {}) {
109+
return this._makeRequest({
110+
path: "/spaces",
111+
...args,
112+
});
113+
},
114+
async getFields(args = {}) {
115+
return this._makeRequest({
116+
path: `/datasheets/${this.$auth.datasheet_id}/fields`,
117+
...args,
118+
});
9119
},
10120
},
11-
};
121+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
FIELD_TYPES: [
3+
"Text",
4+
"URL",
5+
"Phone",
6+
"Email",
7+
"WorkDoc",
8+
"AutoNumber",
9+
"CreatedBy",
10+
],
11+
};

components/aitable_ai/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/aitable_ai",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Pipedream AITable.ai Components",
55
"main": "aitable_ai.app.mjs",
66
"keywords": [
@@ -11,5 +11,8 @@
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1212
"publishConfig": {
1313
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.0.3"
1417
}
15-
}
18+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
type: "app",
3+
app: "donorbox",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};

components/donorbox/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/donorbox",
3+
"version": "0.0.1",
4+
"description": "Pipedream Donorbox Components",
5+
"main": "donorbox.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"donorbox"
9+
],
10+
"homepage": "https://pipedream.com/apps/donorbox",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}

0 commit comments

Comments
 (0)