n8n-nodes-firecrawl
Version:
FireCrawl nodes for n8n
186 lines • 6.8 kB
JavaScript
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.methods = exports.properties = void 0;
const helpers = __importStar(require("../helpers"));
const methods_1 = require("../helpers/methods");
const hooks_1 = require("./hooks");
const defaultResource = __importStar(require("./default"));
const authenticationProperties = [];
const resourceSelect = [
{
displayName: 'Resource',
name: 'resource',
type: 'hidden',
noDataExpression: true,
options: [
{
name: 'Default',
value: 'Default',
},
],
default: '',
},
];
const extraProperties = [
{
displayName: 'Use Custom Body',
name: 'useCustomBody',
type: 'boolean',
description: 'Whether to use a custom body',
default: false,
},
{
displayName: 'Custom Body',
name: 'customBody',
type: 'json',
default: '{\n "url": "string",\n "limit": 0,\n "excludePaths": [\n "string"\n ],\n "allowBackwardLinks": true,\n "webhook": "string",\n "scrapeOptions": {\n "formats": [\n "markdown"\n ],\n "extract": {\n "schema": "string",\n "systemPrompt": "string",\n "prompt": "string"\n }\n }\n}',
description: 'Custom body to send',
routing: {
request: {
body: {
customBody: '={{JSON.parse($value)}}',
},
},
send: {
preSend: [helpers.hooks.preSendActionCustonBody],
},
},
displayOptions: {
show: {
useCustomBody: [true],
resource: ['Default'],
operation: ['Submit A Crawl Job'],
},
},
},
{
displayName: 'Custom Body',
name: 'customBody',
type: 'json',
default: '{\n "url": "string",\n "excludePaths": [\n "string"\n ],\n "limit": 0,\n "scrapeOptions": {\n "formats": [\n "markdown"\n ],\n "extract": {\n "schema": "string",\n "systemPrompt": "string",\n "prompt": "string"\n }\n }\n}',
description: 'Custom body to send',
routing: {
request: {
body: {
customBody: '={{JSON.parse($value)}}',
},
},
send: {
preSend: [helpers.hooks.preSendActionCustonBody],
},
},
displayOptions: {
show: {
useCustomBody: [true],
resource: ['Default'],
operation: ['Crawl Url With Websocket Monitoring'],
},
},
},
{
displayName: 'Custom Body',
name: 'customBody',
type: 'json',
default: '{\n "url": "string",\n "limit": 0,\n "webhook": "string",\n "excludePaths": [\n "string"\n ],\n "scrapeOptions": {\n "formats": [\n "markdown"\n ],\n "extract": {\n "schema": "string",\n "systemPrompt": "string",\n "prompt": "string"\n }\n }\n}',
description: 'Custom body to send',
routing: {
request: {
body: {
customBody: '={{JSON.parse($value)}}',
},
},
send: {
preSend: [helpers.hooks.preSendActionCustonBody],
},
},
displayOptions: {
show: {
useCustomBody: [true],
resource: ['Default'],
operation: ['Submit A Crawl Job With A Webhook'],
},
},
},
{
displayName: 'Custom Body',
name: 'customBody',
type: 'json',
default: '{\n "url": "string",\n "formats": [\n "markdown"\n ],\n "extract": {\n "schema": "string",\n "systemPrompt": "string",\n "prompt": "string"\n },\n "actions": [\n {\n "type": "wait",\n "selector": "string",\n "milliseconds": 0,\n "text": "string",\n "key": "string"\n }\n ]\n}',
description: 'Custom body to send',
routing: {
request: {
body: {
customBody: '={{JSON.parse($value)}}',
},
},
send: {
preSend: [helpers.hooks.preSendActionCustonBody],
},
},
displayOptions: {
show: {
useCustomBody: [true],
resource: ['Default'],
operation: ['Scrape A Url And Get Its Content'],
},
},
},
{
displayName: 'Custom Body',
name: 'customBody',
type: 'json',
default: '{\n "url": "https://firecrawl.dev",\n "search": "docs"\n}',
description: 'Custom body to send',
routing: {
request: {
body: {
customBody: '={{JSON.parse($value)}}',
},
},
send: {
preSend: [helpers.hooks.preSendActionCustonBody],
},
},
displayOptions: {
show: {
useCustomBody: [true],
resource: ['Default'],
operation: ['Map A Website And Get Urls'],
},
},
},
];
const rawProperties = [
...authenticationProperties,
...resourceSelect,
...defaultResource.properties,
...extraProperties,
];
const { properties, methods: selfMethods } = (0, hooks_1.runHooks)(rawProperties);
exports.properties = properties;
const methods = (0, methods_1.aggregateNodeMethods)([selfMethods, defaultResource.methods]);
exports.methods = methods;
//# sourceMappingURL=index.js.map