Skip to content

Commit 60e9e81

Browse files
authored
Merge branch 'master' into sdk/connect-workflow-invocation
2 parents 866efdd + 86aaf90 commit 60e9e81

File tree

142 files changed

+2909
-287
lines changed

Some content is hidden

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

142 files changed

+2909
-287
lines changed

components/anthropic/actions/chat/chat.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import constants from "../common/constants.mjs";
33

44
export default {
55
name: "Chat",
6-
version: "0.0.8",
6+
version: "0.0.9",
77
key: "anthropic-chat",
88
description: "The Chat API. [See the documentation](https://docs.anthropic.com/claude/reference/messages_post)",
99
type: "action",

components/anthropic/actions/common/constants.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export default {
22
MESSAGE_MODELS: [
3+
"claude-3-5-sonnet-20241022",
34
"claude-3-5-sonnet-20240620",
45
"claude-3-opus-20240229",
56
"claude-3-sonnet-20240229",

components/anthropic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/anthropic",
3-
"version": "0.0.10",
3+
"version": "0.0.11",
44
"description": "Pipedream Anthropic (Claude) Components",
55
"main": "anthropic.app.mjs",
66
"keywords": [
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import enrichley from "../../enrichley.app.mjs";
2+
3+
export default {
4+
key: "enrichley-validate-email",
5+
name: "Validate Email",
6+
description: "Checks the validity of a single email address using Enrichley. [See the documentation](https://enrichley.readme.io/reference/validatesingleemail)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
enrichley,
11+
email: {
12+
type: "string",
13+
label: "Email",
14+
description: "The email address to validate",
15+
},
16+
},
17+
async run({ $ }) {
18+
const response = await this.enrichley.validateEmail({
19+
$,
20+
data: {
21+
email: this.email,
22+
},
23+
});
24+
$.export("$summary", `Successfully retrieved status for email: ${this.email}`);
25+
return response;
26+
},
27+
};
Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,32 @@
1+
import { axios } from "@pipedream/platform";
2+
13
export default {
24
type: "app",
35
app: "enrichley",
4-
propDefinitions: {},
56
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
7+
_baseUrl() {
8+
return "https://api.enrichley.io/api/v1";
9+
},
10+
_makeRequest({
11+
$ = this,
12+
path,
13+
...opts
14+
}) {
15+
return axios($, {
16+
url: `${this._baseUrl()}${path}`,
17+
headers: {
18+
"Accept": "application/json",
19+
"X-API-Key": `${this.$auth.api_key}`,
20+
},
21+
...opts,
22+
});
23+
},
24+
validateEmail(opts = {}) {
25+
return this._makeRequest({
26+
method: "POST",
27+
path: "/validate-single-email",
28+
...opts,
29+
});
930
},
1031
},
11-
};
32+
};

components/enrichley/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/enrichley",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Pipedream Enrichley Components",
55
"main": "enrichley.app.mjs",
66
"keywords": [
@@ -11,5 +11,8 @@
1111
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
1212
"publishConfig": {
1313
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.0.3"
1417
}
15-
}
18+
}

components/fal_ai/fal_ai.app.mjs

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: "fal_ai",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};

components/fal_ai/package.json

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

components/google_sheets/actions/add-multiple-rows/add-multiple-rows.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default {
1111
key: "google_sheets-add-multiple-rows",
1212
name: "Add Multiple Rows",
1313
description: "Add multiple rows of data to a Google Sheet. [See the documentation](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append)",
14-
version: "0.2.8",
14+
version: "0.2.9",
1515
type: "action",
1616
props: {
1717
googleSheets,

components/google_sheets/actions/add-single-row/add-single-row.mjs

Lines changed: 73 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import common from "../common/worksheet.mjs";
22
import { ConfigurationError } from "@pipedream/platform";
33
import { parseArray } from "../../common/utils.mjs";
4+
import { isDynamicExpression } from "../common/worksheet.mjs";
45

56
const { googleSheets } = common.props;
67

@@ -9,7 +10,7 @@ export default {
910
key: "google_sheets-add-single-row",
1011
name: "Add Single Row",
1112
description: "Add a single row of data to Google Sheets. [See the documentation](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append)",
12-
version: "2.1.10",
13+
version: "2.1.11",
1314
type: "action",
1415
props: {
1516
googleSheets,
@@ -27,6 +28,7 @@ export default {
2728
driveId: googleSheets.methods.getDriveId(c.drive),
2829
}),
2930
],
31+
reloadProps: true,
3032
},
3133
worksheetId: {
3234
propDefinition: [
@@ -36,42 +38,81 @@ export default {
3638
sheetId: c.sheetId?.value || c.sheetId,
3739
}),
3840
],
39-
type: "string",
40-
label: "Worksheet ID",
41-
},
42-
hasHeaders: {
43-
type: "boolean",
44-
label: "Does the first row of the sheet have headers?",
45-
description: "If the first row of your document has headers, we'll retrieve them to make it easy to enter the value for each column. Please note, that if you are referencing a worksheet using a custom expression referencing data from another step, e.g. `{{steps.my_step.$return_value}}` this prop cannot be used. If you want to retrieve the header row, select both **Spreadsheet** and **Worksheet ID** from the dropdowns above.",
41+
description: "Select a worksheet or enter a custom expression. When referencing a spreadsheet dynamically, you must provide a custom expression for the worksheet.",
42+
async options({ sheetId }) {
43+
// If sheetId is a dynamic reference, don't load options
44+
if (isDynamicExpression(sheetId)) {
45+
return [];
46+
}
47+
48+
// Otherwise, call the original options function with the correct context
49+
const origOptions = googleSheets.propDefinitions.worksheetIDs.options;
50+
return origOptions.call(this, {
51+
sheetId,
52+
});
53+
},
4654
reloadProps: true,
4755
},
56+
hasHeaders: common.props.hasHeaders,
4857
},
4958
async additionalProps() {
5059
const {
5160
sheetId,
5261
worksheetId,
62+
hasHeaders,
5363
} = this;
5464

65+
// If using dynamic expressions for either sheetId or worksheetId, return only array input
66+
if (isDynamicExpression(sheetId) || isDynamicExpression(worksheetId)) {
67+
return {
68+
myColumnData: {
69+
type: "string[]",
70+
label: "Values",
71+
description: "Provide a value for each cell of the row. Google Sheets accepts strings, numbers and boolean values for each cell. To set a cell to an empty value, pass an empty string.",
72+
},
73+
};
74+
}
75+
5576
const props = {};
56-
if (this.hasHeaders) {
57-
const worksheet = await this.getWorksheetById(sheetId, worksheetId);
77+
if (hasHeaders) {
78+
try {
79+
const worksheet = await this.getWorksheetById(sheetId, worksheetId);
80+
const { values } = await this.googleSheets.getSpreadsheetValues(sheetId, `${worksheet?.properties?.title}!1:1`);
5881

59-
const { values } = await this.googleSheets.getSpreadsheetValues(sheetId, `${worksheet?.properties?.title}!1:1`);
60-
if (!values[0]?.length) {
61-
throw new ConfigurationError("Could not find a header row. Please either add headers and click \"Refresh fields\" or adjust the action configuration to continue.");
62-
}
63-
for (let i = 0; i < values[0]?.length; i++) {
64-
props[`col_${i.toString().padStart(4, "0")}`] = {
82+
if (!values?.[0]?.length) {
83+
throw new ConfigurationError("Could not find a header row. Please either add headers and click \"Refresh fields\" or set 'Does the first row of the sheet have headers?' to false.");
84+
}
85+
86+
for (let i = 0; i < values[0]?.length; i++) {
87+
props[`col_${i.toString().padStart(4, "0")}`] = {
88+
type: "string",
89+
label: values[0][i],
90+
optional: true,
91+
};
92+
}
93+
props.allColumns = {
6594
type: "string",
66-
label: values[0][i],
67-
optional: true,
95+
hidden: true,
96+
default: JSON.stringify(values),
97+
};
98+
} catch (err) {
99+
console.error("Error fetching headers:", err);
100+
// Fallback to basic column input if headers can't be fetched
101+
return {
102+
headerError: {
103+
type: "string",
104+
label: "Header Fetch Error",
105+
description: `Unable to fetch headers: ${err.message}. Using simple column input instead.`,
106+
optional: true,
107+
hidden: true,
108+
},
109+
myColumnData: {
110+
type: "string[]",
111+
label: "Values",
112+
description: "Provide a value for each cell of the row. Google Sheets accepts strings, numbers and boolean values for each cell. To set a cell to an empty value, pass an empty string.",
113+
},
68114
};
69115
}
70-
props.allColumns = {
71-
type: "string",
72-
hidden: true,
73-
default: JSON.stringify(values),
74-
};
75116
} else {
76117
props.myColumnData = {
77118
type: "string[]",
@@ -94,7 +135,11 @@ export default {
94135
const worksheet = await this.getWorksheetById(sheetId, worksheetId);
95136

96137
let cells;
97-
if (this.hasHeaders) {
138+
if (this.hasHeaders
139+
&& !isDynamicExpression(sheetId)
140+
&& !isDynamicExpression(worksheetId)
141+
&& this.allColumns
142+
) {
98143
const rows = JSON.parse(this.allColumns);
99144
const [
100145
headers,
@@ -103,10 +148,11 @@ export default {
103148
.map((_, i) => `col_${i.toString().padStart(4, "0")}`)
104149
.map((column) => this[column] ?? "");
105150
} else {
151+
// For dynamic references or no headers, use the array input
106152
cells = this.googleSheets.sanitizedArray(this.myColumnData);
107153
}
108154

109-
// validate input
155+
// Validate input
110156
if (!cells || !cells.length) {
111157
throw new ConfigurationError("Please enter an array of elements in `Cells / Column Values`.");
112158
}
@@ -118,15 +164,15 @@ export default {
118164
}
119165

120166
const {
121-
arr,
167+
arr: sanitizedCells,
122168
convertedIndexes,
123169
} = this.googleSheets.arrayValuesToString(cells);
124170

125171
const data = await this.googleSheets.addRowsToSheet({
126172
spreadsheetId: sheetId,
127173
range: worksheet?.properties?.title,
128174
rows: [
129-
arr,
175+
sanitizedCells,
130176
],
131177
});
132178

0 commit comments

Comments
 (0)