n8n-nodes-firecrawl-latest 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +19 -0
- package/README.md +232 -0
- package/dist/credentials/FirecrawlApi.credentials.js +22 -0
- package/dist/icons/flames-icon.svg +144 -0
- package/dist/nodes/Firecrawl/FireCrawlScraper.node.js +156 -0
- package/dist/nodes/Firecrawl/resources/batchScrape/batchScrape.methods.js +253 -0
- package/dist/nodes/Firecrawl/resources/batchScrape/batchScrape.properties.js +205 -0
- package/dist/nodes/Firecrawl/resources/crawler/crawler.methods.js +281 -0
- package/dist/nodes/Firecrawl/resources/crawler/crawler.properties.js +313 -0
- package/dist/nodes/Firecrawl/resources/deepResearch/deepResearch.methods.js +171 -0
- package/dist/nodes/Firecrawl/resources/deepResearch/deepResearch.properties.js +200 -0
- package/dist/nodes/Firecrawl/resources/extract/extract.methods.js +424 -0
- package/dist/nodes/Firecrawl/resources/extract/extract.properties.js +339 -0
- package/dist/nodes/Firecrawl/resources/llmsText/llmsText.methods.js +124 -0
- package/dist/nodes/Firecrawl/resources/llmsText/llmsText.properties.js +87 -0
- package/dist/nodes/Firecrawl/resources/map/map.methods.js +52 -0
- package/dist/nodes/Firecrawl/resources/map/map.properties.js +22 -0
- package/dist/nodes/Firecrawl/resources/scrape/scrape.methods.js +203 -0
- package/dist/nodes/Firecrawl/resources/scrape/scrape.properties.js +348 -0
- package/dist/nodes/HttpBin/HttpBin.node.js +59 -0
- package/dist/nodes/HttpBin/HttpVerbDescription.js +246 -0
- package/dist/nodes/HttpBin/httpbin.svg +18 -0
- package/index.js +7 -0
- package/package.json +58 -0
@@ -0,0 +1,339 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.extractProperties = void 0;
|
4
|
+
// Fields for the Extract resource
|
5
|
+
const extractFields = [
|
6
|
+
{
|
7
|
+
displayName: 'URL(s)',
|
8
|
+
name: 'urls',
|
9
|
+
type: 'string',
|
10
|
+
displayOptions: {
|
11
|
+
show: {
|
12
|
+
resource: ['extract'],
|
13
|
+
},
|
14
|
+
},
|
15
|
+
default: '',
|
16
|
+
required: true,
|
17
|
+
description: 'The URL(s) to extract data from. For multiple URLs, use comma-separated values or JSON array format. You can use wildcards (e.g., "https://example.com/*") to crawl all pages within a domain.',
|
18
|
+
placeholder: 'https://example.com or https://example.com/* or [https://example1.com, https://example2.com]',
|
19
|
+
},
|
20
|
+
{
|
21
|
+
displayName: 'Version',
|
22
|
+
name: 'version',
|
23
|
+
type: 'options',
|
24
|
+
displayOptions: {
|
25
|
+
show: {
|
26
|
+
resource: ['extract'],
|
27
|
+
},
|
28
|
+
},
|
29
|
+
options: [
|
30
|
+
{
|
31
|
+
name: 'V1 (Original)',
|
32
|
+
value: 'v1',
|
33
|
+
description: 'Use the original extract endpoint',
|
34
|
+
},
|
35
|
+
{
|
36
|
+
name: 'V2 (New with FIRE-1)',
|
37
|
+
value: 'v2',
|
38
|
+
description: 'Use the new extract v2 with FIRE-1 agent integration',
|
39
|
+
},
|
40
|
+
],
|
41
|
+
default: 'v1',
|
42
|
+
description: 'The extraction API version to use',
|
43
|
+
},
|
44
|
+
{
|
45
|
+
displayName: 'Extraction Method',
|
46
|
+
name: 'extractionMethod',
|
47
|
+
type: 'options',
|
48
|
+
displayOptions: {
|
49
|
+
show: {
|
50
|
+
resource: ['extract'],
|
51
|
+
},
|
52
|
+
},
|
53
|
+
options: [
|
54
|
+
{
|
55
|
+
name: 'Simple Extraction',
|
56
|
+
value: 'simple',
|
57
|
+
description: 'Extract data using a prompt',
|
58
|
+
},
|
59
|
+
{
|
60
|
+
name: 'Schema Based Extraction',
|
61
|
+
value: 'schema',
|
62
|
+
description: 'Extract data using a defined schema',
|
63
|
+
},
|
64
|
+
],
|
65
|
+
default: 'simple',
|
66
|
+
description: 'The method to use for extraction',
|
67
|
+
},
|
68
|
+
{
|
69
|
+
displayName: 'Extraction Prompt',
|
70
|
+
name: 'extractionPrompt',
|
71
|
+
type: 'string',
|
72
|
+
displayOptions: {
|
73
|
+
show: {
|
74
|
+
resource: ['extract'],
|
75
|
+
extractionMethod: ['simple'],
|
76
|
+
},
|
77
|
+
},
|
78
|
+
default: '',
|
79
|
+
required: true,
|
80
|
+
description: 'The prompt to guide the extraction process (e.g., "Extract the company mission from the page")',
|
81
|
+
placeholder: 'Extract the main content from this website',
|
82
|
+
},
|
83
|
+
{
|
84
|
+
displayName: 'System Prompt',
|
85
|
+
name: 'systemPrompt',
|
86
|
+
type: 'string',
|
87
|
+
displayOptions: {
|
88
|
+
show: {
|
89
|
+
resource: ['extract'],
|
90
|
+
extractionMethod: ['simple', 'schema'],
|
91
|
+
},
|
92
|
+
},
|
93
|
+
default: '',
|
94
|
+
description: 'Optional system prompt to provide additional context for the extraction',
|
95
|
+
placeholder: 'You are a data extraction assistant that extracts specific information from web content.',
|
96
|
+
},
|
97
|
+
{
|
98
|
+
displayName: 'Schema Definition Type',
|
99
|
+
name: 'schemaDefinitionType',
|
100
|
+
type: 'options',
|
101
|
+
displayOptions: {
|
102
|
+
show: {
|
103
|
+
resource: ['extract'],
|
104
|
+
extractionMethod: ['schema'],
|
105
|
+
},
|
106
|
+
},
|
107
|
+
options: [
|
108
|
+
{
|
109
|
+
name: 'Generate From JSON Example',
|
110
|
+
value: 'example',
|
111
|
+
description: 'Generate schema from a JSON example',
|
112
|
+
},
|
113
|
+
{
|
114
|
+
name: 'Define Below',
|
115
|
+
value: 'manual',
|
116
|
+
description: 'Define schema manually in JSON Schema format',
|
117
|
+
},
|
118
|
+
],
|
119
|
+
default: 'manual',
|
120
|
+
description: 'How to define the schema for extraction',
|
121
|
+
},
|
122
|
+
{
|
123
|
+
displayName: 'Extraction Prompt for Schema',
|
124
|
+
name: 'schemaPrompt',
|
125
|
+
type: 'string',
|
126
|
+
displayOptions: {
|
127
|
+
show: {
|
128
|
+
resource: ['extract'],
|
129
|
+
extractionMethod: ['schema'],
|
130
|
+
},
|
131
|
+
},
|
132
|
+
default: '',
|
133
|
+
description: 'Optional prompt to guide the schema-based extraction process',
|
134
|
+
placeholder: 'Extract the structured data according to the provided schema',
|
135
|
+
},
|
136
|
+
{
|
137
|
+
displayName: 'JSON Example',
|
138
|
+
name: 'jsonExample',
|
139
|
+
type: 'json',
|
140
|
+
typeOptions: {
|
141
|
+
alwaysOpenEditWindow: true,
|
142
|
+
rows: 8,
|
143
|
+
},
|
144
|
+
displayOptions: {
|
145
|
+
show: {
|
146
|
+
resource: ['extract'],
|
147
|
+
extractionMethod: ['schema'],
|
148
|
+
schemaDefinitionType: ['example'],
|
149
|
+
},
|
150
|
+
},
|
151
|
+
default: '{\n "company_mission": "Our mission is to...",\n "supports_sso": true,\n "is_open_source": false,\n "links": ["https://example.com/docs", "https://example.com/about"]\n}',
|
152
|
+
description: 'A JSON example that represents the data structure you want to extract',
|
153
|
+
hint: 'Provide a JSON object that represents the structure you want to extract',
|
154
|
+
},
|
155
|
+
{
|
156
|
+
displayName: 'Schema Definition',
|
157
|
+
name: 'schemaDefinition',
|
158
|
+
type: 'json',
|
159
|
+
typeOptions: {
|
160
|
+
alwaysOpenEditWindow: true,
|
161
|
+
rows: 12,
|
162
|
+
},
|
163
|
+
displayOptions: {
|
164
|
+
show: {
|
165
|
+
resource: ['extract'],
|
166
|
+
extractionMethod: ['schema'],
|
167
|
+
schemaDefinitionType: ['manual'],
|
168
|
+
},
|
169
|
+
},
|
170
|
+
default: '{\n "type": "object",\n "properties": {\n "company_mission": {\n "type": "string",\n "description": "The mission statement of the company"\n },\n "supports_sso": {\n "type": "boolean",\n "description": "Whether the product supports Single Sign-On"\n },\n "is_open_source": {\n "type": "boolean",\n "description": "Whether the product is open source"\n },\n "links": {\n "type": "array",\n "items": {\n "type": "string"\n },\n "description": "Important links found on the page"\n }\n },\n "required": ["company_mission"]\n}',
|
171
|
+
description: 'The schema definition in standard JSON Schema format. Define the structure you want to extract.',
|
172
|
+
hint: 'Use standard JSON Schema format with "type", "properties", and optional "required" fields',
|
173
|
+
},
|
174
|
+
{
|
175
|
+
displayName: 'Operation Mode',
|
176
|
+
name: 'operationMode',
|
177
|
+
type: 'options',
|
178
|
+
displayOptions: {
|
179
|
+
show: {
|
180
|
+
resource: ['extract'],
|
181
|
+
},
|
182
|
+
},
|
183
|
+
options: [
|
184
|
+
{
|
185
|
+
name: 'Single',
|
186
|
+
value: 'single',
|
187
|
+
description: 'Extract from a single URL at a time',
|
188
|
+
},
|
189
|
+
{
|
190
|
+
name: 'Batch',
|
191
|
+
value: 'batch',
|
192
|
+
description: 'Extract from multiple URLs in batch mode',
|
193
|
+
},
|
194
|
+
{
|
195
|
+
name: 'URL-Less',
|
196
|
+
value: 'urlless',
|
197
|
+
description: 'Extract data without providing specific URLs (search-based)',
|
198
|
+
},
|
199
|
+
],
|
200
|
+
default: 'single',
|
201
|
+
description: 'The operation mode for extraction',
|
202
|
+
},
|
203
|
+
{
|
204
|
+
displayName: 'Use Asynchronous Mode',
|
205
|
+
name: 'useAsyncMode',
|
206
|
+
type: 'boolean',
|
207
|
+
displayOptions: {
|
208
|
+
show: {
|
209
|
+
resource: ['extract'],
|
210
|
+
operationMode: ['batch', 'single'],
|
211
|
+
},
|
212
|
+
},
|
213
|
+
default: false,
|
214
|
+
description: 'Whether to process the extraction asynchronously for larger batches',
|
215
|
+
},
|
216
|
+
{
|
217
|
+
displayName: 'Job ID',
|
218
|
+
name: 'jobId',
|
219
|
+
type: 'string',
|
220
|
+
displayOptions: {
|
221
|
+
show: {
|
222
|
+
resource: ['extract'],
|
223
|
+
operationMode: ['batch', 'single'],
|
224
|
+
useAsyncMode: [true],
|
225
|
+
},
|
226
|
+
},
|
227
|
+
default: '',
|
228
|
+
description: 'Job ID for checking the status of an existing extraction job (leave empty to start a new job)',
|
229
|
+
},
|
230
|
+
{
|
231
|
+
displayName: 'Enable Web Search',
|
232
|
+
name: 'enableWebSearch',
|
233
|
+
type: 'boolean',
|
234
|
+
displayOptions: {
|
235
|
+
show: {
|
236
|
+
resource: ['extract'],
|
237
|
+
},
|
238
|
+
},
|
239
|
+
default: false,
|
240
|
+
description: 'Whether to enable web search to follow links outside the specified domain for better context',
|
241
|
+
},
|
242
|
+
{
|
243
|
+
displayName: 'Use FIRE-1 Agent',
|
244
|
+
name: 'useFire1Agent',
|
245
|
+
type: 'boolean',
|
246
|
+
displayOptions: {
|
247
|
+
show: {
|
248
|
+
resource: ['extract'],
|
249
|
+
version: ['v2'],
|
250
|
+
},
|
251
|
+
},
|
252
|
+
default: true,
|
253
|
+
description: 'Whether to use the FIRE-1 agent for advanced extraction capabilities',
|
254
|
+
},
|
255
|
+
{
|
256
|
+
displayName: 'Enable Page Actions',
|
257
|
+
name: 'enablePageActions',
|
258
|
+
type: 'boolean',
|
259
|
+
displayOptions: {
|
260
|
+
show: {
|
261
|
+
resource: ['extract'],
|
262
|
+
version: ['v2'],
|
263
|
+
useFire1Agent: [true],
|
264
|
+
},
|
265
|
+
},
|
266
|
+
default: false,
|
267
|
+
description: 'Whether to define specific page actions for the FIRE-1 agent to perform',
|
268
|
+
},
|
269
|
+
{
|
270
|
+
displayName: 'Page Actions',
|
271
|
+
name: 'pageActions',
|
272
|
+
type: 'json',
|
273
|
+
typeOptions: {
|
274
|
+
alwaysOpenEditWindow: true,
|
275
|
+
rows: 10,
|
276
|
+
},
|
277
|
+
displayOptions: {
|
278
|
+
show: {
|
279
|
+
resource: ['extract'],
|
280
|
+
version: ['v2'],
|
281
|
+
useFire1Agent: [true],
|
282
|
+
enablePageActions: [true],
|
283
|
+
},
|
284
|
+
},
|
285
|
+
default: '[\n { "type": "wait", "milliseconds": 2000 },\n { "type": "click", "selector": "button.accept-cookies" },\n { "type": "wait", "milliseconds": 1000 }\n]',
|
286
|
+
description: 'Define specific actions for the FIRE-1 agent to perform on pages',
|
287
|
+
},
|
288
|
+
{
|
289
|
+
displayName: 'Track Changes',
|
290
|
+
name: 'trackChanges',
|
291
|
+
type: 'boolean',
|
292
|
+
displayOptions: {
|
293
|
+
show: {
|
294
|
+
resource: ['extract'],
|
295
|
+
},
|
296
|
+
},
|
297
|
+
default: false,
|
298
|
+
description: 'Whether to track changes between the current extraction and previous ones',
|
299
|
+
},
|
300
|
+
{
|
301
|
+
displayName: 'Change Tracking Mode',
|
302
|
+
name: 'changeTrackingMode',
|
303
|
+
type: 'multiOptions',
|
304
|
+
displayOptions: {
|
305
|
+
show: {
|
306
|
+
resource: ['extract'],
|
307
|
+
trackChanges: [true],
|
308
|
+
},
|
309
|
+
},
|
310
|
+
options: [
|
311
|
+
{
|
312
|
+
name: 'Git-Diff',
|
313
|
+
value: 'git-diff',
|
314
|
+
description: 'Track changes using Git-style diff format',
|
315
|
+
},
|
316
|
+
{
|
317
|
+
name: 'JSON',
|
318
|
+
value: 'json',
|
319
|
+
description: 'Track changes in structured JSON format',
|
320
|
+
},
|
321
|
+
],
|
322
|
+
default: ['git-diff'],
|
323
|
+
description: 'The modes to use for change tracking',
|
324
|
+
},
|
325
|
+
{
|
326
|
+
displayName: 'Enable Debug Logs',
|
327
|
+
name: 'enableDebugLogs',
|
328
|
+
type: 'boolean',
|
329
|
+
displayOptions: {
|
330
|
+
show: {
|
331
|
+
resource: ['extract'],
|
332
|
+
},
|
333
|
+
},
|
334
|
+
default: false,
|
335
|
+
description: 'Whether to enable debug logs in the output',
|
336
|
+
},
|
337
|
+
];
|
338
|
+
// Export all properties for the Extract resource
|
339
|
+
exports.extractProperties = [...extractFields];
|
@@ -0,0 +1,124 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.llmsTextMethods = void 0;
|
7
|
+
const firecrawl_js_1 = __importDefault(require("@mendable/firecrawl-js"));
|
8
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
9
|
+
exports.llmsTextMethods = {
|
10
|
+
async execute() {
|
11
|
+
const items = this.getInputData();
|
12
|
+
const returnData = [];
|
13
|
+
// Get credentials
|
14
|
+
const credentials = await this.getCredentials('firecrawlApi');
|
15
|
+
const apiKey = credentials.apiKey;
|
16
|
+
// Initialize Firecrawl app
|
17
|
+
const firecrawl = new firecrawl_js_1.default({ apiKey });
|
18
|
+
// Process each item
|
19
|
+
for (let i = 0; i < items.length; i++) {
|
20
|
+
try {
|
21
|
+
// Get parameters
|
22
|
+
const url = this.getNodeParameter('url', i);
|
23
|
+
const maxUrls = this.getNodeParameter('maxUrls', i, 10);
|
24
|
+
const showFullText = this.getNodeParameter('showFullText', i, false);
|
25
|
+
const operationMode = this.getNodeParameter('operationMode', i);
|
26
|
+
// Prepare parameters for the API call
|
27
|
+
const params = {
|
28
|
+
maxUrls,
|
29
|
+
showFullText,
|
30
|
+
};
|
31
|
+
// Handle different operation modes
|
32
|
+
if (operationMode === 'sync') {
|
33
|
+
// Synchronous mode - wait for the generation to complete
|
34
|
+
const results = await firecrawl.generateLLMsText(url, params);
|
35
|
+
if (!results.success && 'error' in results) {
|
36
|
+
returnData.push({
|
37
|
+
json: {
|
38
|
+
success: false,
|
39
|
+
error: results.error,
|
40
|
+
},
|
41
|
+
});
|
42
|
+
}
|
43
|
+
else {
|
44
|
+
returnData.push({
|
45
|
+
json: {
|
46
|
+
success: results.success,
|
47
|
+
status: 'status' in results ? results.status : 'completed',
|
48
|
+
data: 'data' in results ? results.data : undefined,
|
49
|
+
expiresAt: 'expiresAt' in results ? results.expiresAt : undefined,
|
50
|
+
},
|
51
|
+
});
|
52
|
+
}
|
53
|
+
}
|
54
|
+
else {
|
55
|
+
// Asynchronous mode - start the process or check status
|
56
|
+
const jobId = this.getNodeParameter('jobId', i, '');
|
57
|
+
if (jobId && jobId.trim() !== '') {
|
58
|
+
// Check status of an existing job
|
59
|
+
const status = await firecrawl.checkGenerateLLMsTextStatus(jobId);
|
60
|
+
if (!status.success && 'error' in status) {
|
61
|
+
returnData.push({
|
62
|
+
json: {
|
63
|
+
success: false,
|
64
|
+
error: status.error,
|
65
|
+
jobId,
|
66
|
+
},
|
67
|
+
});
|
68
|
+
}
|
69
|
+
else {
|
70
|
+
returnData.push({
|
71
|
+
json: {
|
72
|
+
success: status.success,
|
73
|
+
status: 'status' in status ? status.status : 'unknown',
|
74
|
+
data: 'data' in status ? status.data : undefined,
|
75
|
+
expiresAt: 'expiresAt' in status ? status.expiresAt : undefined,
|
76
|
+
jobId,
|
77
|
+
},
|
78
|
+
});
|
79
|
+
}
|
80
|
+
}
|
81
|
+
else {
|
82
|
+
// Start a new asynchronous job
|
83
|
+
const job = await firecrawl.asyncGenerateLLMsText(url, params);
|
84
|
+
if (!job.success && 'error' in job) {
|
85
|
+
returnData.push({
|
86
|
+
json: {
|
87
|
+
success: false,
|
88
|
+
error: job.error,
|
89
|
+
},
|
90
|
+
});
|
91
|
+
}
|
92
|
+
else {
|
93
|
+
returnData.push({
|
94
|
+
json: {
|
95
|
+
success: true,
|
96
|
+
status: 'started',
|
97
|
+
jobId: 'jobId' in job ? job.jobId : undefined,
|
98
|
+
message: 'LLMs.txt generation started successfully. Use the job ID to check status.',
|
99
|
+
},
|
100
|
+
});
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
}
|
105
|
+
catch (error) {
|
106
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
107
|
+
console.error('LLMs.txt generation error:', errorMessage);
|
108
|
+
if (this.continueOnFail()) {
|
109
|
+
returnData.push({
|
110
|
+
json: {
|
111
|
+
success: false,
|
112
|
+
error: errorMessage,
|
113
|
+
},
|
114
|
+
});
|
115
|
+
continue;
|
116
|
+
}
|
117
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, {
|
118
|
+
itemIndex: i,
|
119
|
+
});
|
120
|
+
}
|
121
|
+
}
|
122
|
+
return [returnData];
|
123
|
+
},
|
124
|
+
};
|
@@ -0,0 +1,87 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.llmsTextProperties = void 0;
|
4
|
+
// Fields for the LLMsText resource
|
5
|
+
const llmsTextFields = [
|
6
|
+
{
|
7
|
+
displayName: 'URL',
|
8
|
+
name: 'url',
|
9
|
+
type: 'string',
|
10
|
+
displayOptions: {
|
11
|
+
show: {
|
12
|
+
resource: ['llmsText'],
|
13
|
+
},
|
14
|
+
},
|
15
|
+
default: '',
|
16
|
+
required: true,
|
17
|
+
description: 'The URL to generate LLMs.txt files from',
|
18
|
+
placeholder: 'https://example.com',
|
19
|
+
},
|
20
|
+
{
|
21
|
+
displayName: 'Max URLs',
|
22
|
+
name: 'maxUrls',
|
23
|
+
type: 'number',
|
24
|
+
typeOptions: {
|
25
|
+
minValue: 1,
|
26
|
+
maxValue: 100,
|
27
|
+
},
|
28
|
+
displayOptions: {
|
29
|
+
show: {
|
30
|
+
resource: ['llmsText'],
|
31
|
+
},
|
32
|
+
},
|
33
|
+
default: 10,
|
34
|
+
description: 'Maximum number of pages to crawl (1-100)',
|
35
|
+
},
|
36
|
+
{
|
37
|
+
displayName: 'Generate Full Text',
|
38
|
+
name: 'showFullText',
|
39
|
+
type: 'boolean',
|
40
|
+
displayOptions: {
|
41
|
+
show: {
|
42
|
+
resource: ['llmsText'],
|
43
|
+
},
|
44
|
+
},
|
45
|
+
default: false,
|
46
|
+
description: 'Whether to generate llms-full.txt in addition to llms.txt',
|
47
|
+
},
|
48
|
+
{
|
49
|
+
displayName: 'Operation Mode',
|
50
|
+
name: 'operationMode',
|
51
|
+
type: 'options',
|
52
|
+
displayOptions: {
|
53
|
+
show: {
|
54
|
+
resource: ['llmsText'],
|
55
|
+
},
|
56
|
+
},
|
57
|
+
options: [
|
58
|
+
{
|
59
|
+
name: 'Synchronous',
|
60
|
+
value: 'sync',
|
61
|
+
description: 'Wait for the generation to complete (suitable for small websites)',
|
62
|
+
},
|
63
|
+
{
|
64
|
+
name: 'Asynchronous',
|
65
|
+
value: 'async',
|
66
|
+
description: 'Start the generation process and return the job ID (suitable for larger websites)',
|
67
|
+
},
|
68
|
+
],
|
69
|
+
default: 'sync',
|
70
|
+
description: 'Whether to wait for the generation to complete or just start the process',
|
71
|
+
},
|
72
|
+
{
|
73
|
+
displayName: 'Job ID',
|
74
|
+
name: 'jobId',
|
75
|
+
type: 'string',
|
76
|
+
displayOptions: {
|
77
|
+
show: {
|
78
|
+
resource: ['llmsText'],
|
79
|
+
operationMode: ['async'],
|
80
|
+
},
|
81
|
+
},
|
82
|
+
default: '',
|
83
|
+
description: 'Job ID for checking the status of an existing LLMs.txt generation (leave empty to start a new job)',
|
84
|
+
},
|
85
|
+
];
|
86
|
+
// Export all properties for the LLMsText resource
|
87
|
+
exports.llmsTextProperties = [...llmsTextFields];
|
@@ -0,0 +1,52 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.mapMethods = void 0;
|
7
|
+
const firecrawl_js_1 = __importDefault(require("@mendable/firecrawl-js"));
|
8
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
9
|
+
exports.mapMethods = {
|
10
|
+
async execute() {
|
11
|
+
const items = this.getInputData();
|
12
|
+
const returnData = [];
|
13
|
+
// Get credentials
|
14
|
+
const credentials = await this.getCredentials('firecrawlApi');
|
15
|
+
const apiKey = credentials.apiKey;
|
16
|
+
// Initialize Firecrawl app
|
17
|
+
const firecrawl = new firecrawl_js_1.default({ apiKey });
|
18
|
+
// Process each item
|
19
|
+
for (let i = 0; i < items.length; i++) {
|
20
|
+
try {
|
21
|
+
// Get parameters
|
22
|
+
const url = this.getNodeParameter('url', i);
|
23
|
+
// Prepare map parameters
|
24
|
+
const mapParams = {};
|
25
|
+
// Map URL
|
26
|
+
const mapResponse = await firecrawl.mapUrl(url, mapParams);
|
27
|
+
// Add result to return data
|
28
|
+
returnData.push({
|
29
|
+
json: {
|
30
|
+
success: true,
|
31
|
+
data: mapResponse,
|
32
|
+
},
|
33
|
+
});
|
34
|
+
}
|
35
|
+
catch (error) {
|
36
|
+
if (this.continueOnFail()) {
|
37
|
+
returnData.push({
|
38
|
+
json: {
|
39
|
+
success: false,
|
40
|
+
error: error instanceof Error ? error.message : String(error),
|
41
|
+
},
|
42
|
+
});
|
43
|
+
continue;
|
44
|
+
}
|
45
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, {
|
46
|
+
itemIndex: i,
|
47
|
+
});
|
48
|
+
}
|
49
|
+
}
|
50
|
+
return [returnData];
|
51
|
+
},
|
52
|
+
};
|
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.mapProperties = void 0;
|
4
|
+
// Fields for the Map resource
|
5
|
+
const mapFields = [
|
6
|
+
{
|
7
|
+
displayName: 'URL',
|
8
|
+
name: 'url',
|
9
|
+
type: 'string',
|
10
|
+
displayOptions: {
|
11
|
+
show: {
|
12
|
+
resource: ['map'],
|
13
|
+
},
|
14
|
+
},
|
15
|
+
default: '',
|
16
|
+
required: true,
|
17
|
+
description: 'The starting URL to map',
|
18
|
+
placeholder: 'https://example.com',
|
19
|
+
},
|
20
|
+
];
|
21
|
+
// Export all properties for the Map resource
|
22
|
+
exports.mapProperties = [...mapFields];
|