Skip to content

Commit 26e3319

Browse files
committed
Merge branch 'master' into issue-14969
2 parents 69dc28c + 6e57daa commit 26e3319

File tree

292 files changed

+3844
-976
lines changed

Some content is hidden

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

292 files changed

+3844
-976
lines changed

components/airtable_oauth/actions/common/common.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ export default {
1010
],
1111
withLabel: true,
1212
},
13+
warningAlert: {
14+
type: "alert",
15+
alertType: "warning",
16+
content: "**Note:** if using a custom expression to specify the `Base` (e.g. `{{steps.mydata.$return_value}}`) you should also use a custom expression for the `Table`, and any other props that depend on it.",
17+
},
1318
tableId: {
1419
propDefinition: [
1520
airtable,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import common from "../common/common.mjs";
33
export default {
44
key: "airtable_oauth-create-comment",
55
name: "Create Comment",
6-
description: "Create a new comment on a record. [See the documentation](https://airtable.com/developers/web/api/create-comment)",
7-
version: "0.0.7",
6+
description: "Create a comment on a selected record. [See the documentation](https://airtable.com/developers/web/api/create-comment)",
7+
version: "0.0.8",
88
type: "action",
99
props: {
1010
...common.props,
@@ -23,7 +23,7 @@ export default {
2323
comment: {
2424
type: "string",
2525
label: "Comment",
26-
description: "The text comment",
26+
description: "The text comment to create",
2727
},
2828
},
2929
async run({ $ }) {

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

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,53 @@
1+
import constants from "../../sources/common/constants.mjs";
12
import common from "../common/common.mjs";
23

34
export default {
45
key: "airtable_oauth-create-field",
56
name: "Create Field",
67
description: "Create a new field in a table. [See the documentation](https://airtable.com/developers/web/api/create-field)",
7-
version: "0.0.7",
8+
version: "0.1.0",
89
type: "action",
910
props: {
1011
...common.props,
11-
field: {
12+
name: {
1213
type: "string",
13-
label: "Field",
14-
description: "A JSON object representing the field. Refer to [field types](https://airtable.com/developers/web/api/model/field-type) for supported field types, the write format for field options, and other specifics for certain field types.",
14+
label: "Field Name",
15+
description: "The name of the field",
16+
},
17+
type: {
18+
type: "string",
19+
label: "Field Type",
20+
description: "The field type. [See the documentation](https://airtable.com/developers/web/api/model/field-type) for more information.",
21+
options: constants.FIELD_TYPES,
22+
},
23+
description: {
24+
type: "string",
25+
label: "Field Description",
26+
description: "The description of the field",
27+
optional: true,
28+
},
29+
options: {
30+
type: "object",
31+
label: "Field Options",
32+
description: "The options for the field as a JSON object, e.g. `{ \"color\": \"greenBright\" }`. Each type has a specific set of options - [see the documentation](https://airtable.com/developers/web/api/field-model) for more information.",
33+
optional: true,
1534
},
1635
},
1736
async run({ $ }) {
18-
const field = typeof this.field === "object"
19-
? this.field
20-
: JSON.parse(this.field);
21-
const data = {
22-
...field,
23-
};
37+
const {
38+
description, name, options, type,
39+
} = this;
2440
const response = await this.airtable.createField({
2541
baseId: this.baseId.value,
2642
tableId: this.tableId.value,
27-
data,
43+
data: {
44+
name,
45+
type,
46+
description,
47+
options: typeof options === "string"
48+
? JSON.parse(options)
49+
: options,
50+
},
2851
$,
2952
});
3053

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

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import chunk from "lodash.chunk";
22
import airtable from "../../airtable_oauth.app.mjs";
33
import common from "../common/common.mjs";
4+
import { ConfigurationError } from "@pipedream/platform";
45

56
const BATCH_SIZE = 10; // The Airtable API allows us to update up to 10 rows per request.
67

78
export default {
89
key: "airtable_oauth-create-multiple-records",
910
name: "Create Multiple Records",
10-
description: "Create one or more records in a table by passing an array of objects containing field names and values as key/value pairs. [See the documentation](https://airtable.com/developers/web/api/create-records)",
11-
version: "0.0.7",
11+
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",
1213
type: "action",
1314
props: {
1415
...common.props,
@@ -18,6 +19,15 @@ export default {
1819
"records",
1920
],
2021
},
22+
customExpressionInfo: {
23+
type: "alert",
24+
alertType: "info",
25+
content: `You can use a custom expression that evaluates to an object for each entry in the array, e.g. \`{{ { "foo": "bar", "id": 123 } }}\`.
26+
\\
27+
You can also reference an object exported by a previous step, e.g. \`{{steps.foo.$return_value}}\`.
28+
\\
29+
If desired, you can use a custom expression in the same fashion for the entire array instead of providing individual values.`,
30+
},
2131
typecast: {
2232
propDefinition: [
2333
airtable,
@@ -39,9 +49,18 @@ export default {
3949
if (!Array.isArray(data)) {
4050
data = JSON.parse(data);
4151
}
42-
data = data.map((fields) => ({
43-
fields,
44-
}));
52+
data = data.map((fields, index) => {
53+
if (typeof fields === "string") {
54+
try {
55+
fields = JSON.parse(fields);
56+
} catch (err) {
57+
throw new ConfigurationError(`Error parsing record (index ${index}) as JSON: ${err.message}`);
58+
}
59+
}
60+
return {
61+
fields,
62+
};
63+
});
4564
if (!data.length) {
4665
throw new Error("No Airtable record data passed to step. Please pass at least one record");
4766
}

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ import commonActions from "../../common/actions.mjs";
44

55
export default {
66
key: "airtable_oauth-create-or-update-record",
7-
name: "Create Single Record Or Update",
8-
description: "Updates a record if `recordId` is provided or adds a record to a table.",
9-
version: "0.0.8",
7+
name: "Create or Update Record",
8+
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",
1010
type: "action",
1111
props: {
1212
...common.props,
13-
// eslint-disable-next-line pipedream/props-label,pipedream/props-description
1413
tableId: {
1514
...common.props.tableId,
1615
reloadProps: true,
@@ -27,7 +26,7 @@ export default {
2726
}),
2827
],
2928
optional: true,
30-
description: "Enter a [record ID](https://support.airtable.com/hc/en-us/articles/360051564873-Record-ID) if you want to update an existing record. Leave blank to create a new record.",
29+
description: "To update an existing record, select it from the list or provide its [Record ID](https://support.airtable.com/hc/en-us/articles/360051564873-Record-ID). If left blank, a new record will be created.",
3130
},
3231
typecast: {
3332
propDefinition: [

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.8",
9+
version: "0.0.9",
1010
type: "action",
1111
props: {
1212
...common.props,

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

Lines changed: 4 additions & 4 deletions
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.7",
7+
version: "0.0.8",
88
type: "action",
99
props: {
1010
airtable,
@@ -17,18 +17,18 @@ export default {
1717
name: {
1818
type: "string",
1919
label: "Name",
20-
description: "The name for the table",
20+
description: "The name of the table",
2121
},
2222
description: {
2323
type: "string",
2424
label: "Description",
25-
description: "The description for the table",
25+
description: "The description of the table",
2626
optional: true,
2727
},
2828
fields: {
2929
type: "string[]",
3030
label: "Fields",
31-
description: "A list of JSON objects representing the fields in the table. Refer to [field types](https://airtable.com/developers/web/api/model/field-type) for supported field types, the write format for field options, and other specifics for certain field types.",
31+
description: "A list of JSON objects representing the fields in the table. [See the documentation](https://airtable.com/developers/web/api/model/field-type) for supported field types, the write format for field options, and other specifics for certain field types.",
3232
},
3333
},
3434
async run({ $ }) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import common from "../common/common.mjs";
44
export default {
55
key: "airtable_oauth-delete-record",
66
name: "Delete Record",
7-
description: "Delete a record from a table by record ID. [See the documentation](https://airtable.com/developers/web/api/delete-record)",
8-
version: "0.0.7",
7+
description: "Delete a selected record from a table. [See the documentation](https://airtable.com/developers/web/api/delete-record)",
8+
version: "0.0.8",
99
type: "action",
1010
props: {
1111
...common.props,

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ import commonActions from "../../common/actions.mjs";
55
export default {
66
key: "airtable_oauth-get-record-or-create",
77
name: "Get Record Or Create",
8-
description: "Get a record from a table by record ID or create a new register.",
9-
version: "0.0.8",
8+
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",
1010
type: "action",
1111
props: {
1212
...common.props,
13-
// eslint-disable-next-line pipedream/props-label,pipedream/props-description
1413
tableId: {
1514
...common.props.tableId,
1615
reloadProps: true,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import commonActions from "../../common/actions.mjs";
55
export default {
66
key: "airtable_oauth-get-record",
77
name: "Get Record",
8-
description: "Get a record from a table by record ID. [See the documentation](https://airtable.com/developers/web/api/get-record)",
9-
version: "0.0.8",
8+
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",
1010
type: "action",
1111
props: {
1212
...common.props,

0 commit comments

Comments
 (0)