Skip to content

Commit 59b58d2

Browse files
Merging pull request #17858
* added firecrawl's map-url functionality * versions * pnpm-lock.yaml * pnpm-lock.yaml * pnpm-lock.yaml --------- Co-authored-by: Michelle Bergeron <[email protected]>
1 parent 1724575 commit 59b58d2

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import firecrawl from "../../firecrawl.app.mjs";
2+
3+
export default {
4+
key: "firecrawl-map-url",
5+
name: "Map URL",
6+
description: "Maps a given URL using Firecrawl's Map endpoint. Optionally, you can provide a search term to filter the mapping. [See the documentation](https://docs.firecrawl.dev/features/map)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
firecrawl,
11+
url: {
12+
propDefinition: [
13+
firecrawl,
14+
"url",
15+
],
16+
description: "The URL to map using Firecrawl.",
17+
},
18+
search: {
19+
type: "string",
20+
label: "Search",
21+
description: "Optional search term to filter the mapping results. [See the documentation](https://docs.firecrawl.dev/features/map).",
22+
optional: true,
23+
},
24+
},
25+
async run({ $ }) {
26+
const {
27+
firecrawl, search, ...data
28+
} = this;
29+
30+
// Including search parameter in payload only when its not empty
31+
if (search && search.trim() !== "") {
32+
data.search = search.trim();
33+
}
34+
35+
const response = await firecrawl._makeRequest({
36+
$,
37+
path: "/map",
38+
method: "POST",
39+
data,
40+
});
41+
42+
console.log("Firecrawl Response:", response);
43+
44+
if ($ && typeof $.export === "function") {
45+
$.export("$summary", `Mapped URL: ${this.url}`);
46+
}
47+
return response;
48+
},
49+
};

components/firecrawl/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/firecrawl",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"description": "Pipedream FireCrawl Components",
55
"main": "firecrawl.app.mjs",
66
"keywords": [

0 commit comments

Comments
 (0)