Skip to content

Commit b560b05

Browse files
committed
add: monday, nyckel
1 parent fed67fa commit b560b05

File tree

8 files changed

+32
-36
lines changed

8 files changed

+32
-36
lines changed

components/monday/actions/update-column-values/update-column-values.mjs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import common from "../common/column-values.mjs";
2-
import { axios } from "@pipedream/platform";
3-
import fs from "fs";
2+
import {
3+
axios, getFileStream,
4+
} from "@pipedream/platform";
45
import FormData from "form-data";
56
import { getColumnOptions } from "../../common/utils.mjs";
67

@@ -9,7 +10,7 @@ export default {
910
key: "monday-update-column-values",
1011
name: "Update Column Values",
1112
description: "Update multiple column values of an item. [See the documentation](https://developer.monday.com/api-reference/reference/columns#change-multiple-column-values)",
12-
version: "0.1.0",
13+
version: "0.2.0",
1314
type: "action",
1415
props: {
1516
...common.props,
@@ -50,7 +51,7 @@ export default {
5051
options: getColumnOptions(columns, id),
5152
};
5253
if (column.type === "file") {
53-
props[column.id].description += ". The path to a file in the `/tmp` directory. [See the documentation on working with files](https://pipedream.com/docs/code/nodejs/working-with-files/#writing-a-file-to-tmp)";
54+
props[column.id].description += ". Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.txt`)";
5455
}
5556
}
5657
}
@@ -62,9 +63,7 @@ export default {
6263
$, itemId, column, filePath,
6364
}) {
6465
const query = `mutation ($file: File!) { add_file_to_column (file: $file, item_id: ${itemId}, column_id: "${column.id}") { id } }`;
65-
const content = fs.createReadStream(filePath.includes("tmp/")
66-
? filePath
67-
: `/tmp/${filePath}`);
66+
const content = await getFileStream(filePath);
6867

6968
const formData = new FormData();
7069
formData.append("query", query);

components/monday/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/monday",
3-
"version": "0.7.0",
3+
"version": "0.8.0",
44
"description": "Pipedream Monday Components",
55
"main": "monday.app.mjs",
66
"keywords": [
@@ -14,7 +14,7 @@
1414
"access": "public"
1515
},
1616
"dependencies": {
17-
"@pipedream/platform": "^3.0.3",
17+
"@pipedream/platform": "^3.1.0",
1818
"form-data": "^4.0.0",
1919
"lodash.flatmap": "^4.5.0",
2020
"lodash.map": "^4.6.0",

components/nyckel/actions/classify-image/classify-image.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "nyckel-classify-image",
77
name: "Classify Image",
88
description: "Classifies image data based on pre-trained classifiers in Nyckel. [See the documentation](https://www.nyckel.com/docs#invoke-image)",
9-
version: "0.0.1",
9+
version: "0.1.0",
1010
type: "action",
1111
props: {
1212
nyckel,

components/nyckel/actions/extract-text-from-image/extract-text-from-image.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "nyckel-extract-text-from-image",
77
name: "Extract Text from Image",
88
description: "Extracts text from an image URL. [See the documentation](https://www.nyckel.com/docs#ocr-image)",
9-
version: "0.0.1",
9+
version: "0.1.0",
1010
type: "action",
1111
props: {
1212
nyckel,

components/nyckel/common/common-image.mjs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import nyckel from "../nyckel.app.mjs";
22
import FormData from "form-data";
3-
import fs from "fs";
3+
import { getFileStream } from "@pipedream/platform";
44

55
export default {
66
props: {
@@ -12,7 +12,7 @@ export default {
1212
},
1313
},
1414
methods: {
15-
getImageData() {
15+
async getImageData() {
1616
const { imageOrUrl } = this;
1717
const isUrl = imageOrUrl.startsWith("http");
1818
if (isUrl) {
@@ -27,11 +27,8 @@ export default {
2727
}
2828

2929
const data = new FormData();
30-
data.append("data", fs.createReadStream(
31-
imageOrUrl.includes("tmp/")
32-
? imageOrUrl
33-
: `/tmp/${imageOrUrl}`,
34-
));
30+
const stream = await getFileStream(imageOrUrl);
31+
data.append("data", stream);
3532

3633
return {
3734
data,

components/nyckel/nyckel.app.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export default {
2929
},
3030
imageOrUrl: {
3131
type: "string",
32-
label: "Image Path or URL",
33-
description: "The path to an image file in the `/tmp` directory. [See the documentation on working with files](https://pipedream.com/docs/code/nodejs/working-with-files/#writing-a-file-to-tmp). Alternatively, you can pass the direct URL to a file.",
32+
label: "File Path or URL",
33+
description: "An image file. Provide either a file URL or a path to a file in the `/tmp` directory (for example, `/tmp/myFile.jpg`)",
3434
},
3535
includeRegions: {
3636
type: "boolean",

components/nyckel/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/nyckel",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "Pipedream Nyckel Components",
55
"main": "nyckel.app.mjs",
66
"keywords": [
@@ -13,7 +13,7 @@
1313
"access": "public"
1414
},
1515
"dependencies": {
16-
"@pipedream/platform": "^1.6.2",
16+
"@pipedream/platform": "^3.1.0",
1717
"form-data": "^4.0.0"
1818
}
1919
}

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)