n8n-nodes-crawl4ai-onuro 0.2.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.
Files changed (71) hide show
  1. package/LICENSE +21 -0
  2. package/LICENSE.md +19 -0
  3. package/README.md +129 -0
  4. package/dist/credentials/Crawl4aiApi.credentials.d.ts +7 -0
  5. package/dist/credentials/Crawl4aiApi.credentials.js +228 -0
  6. package/dist/credentials/Crawl4aiApi.credentials.js.map +1 -0
  7. package/dist/nodes/Crawl4aiBasicCrawler/Crawl4aiBasicCrawler.node.d.ts +5 -0
  8. package/dist/nodes/Crawl4aiBasicCrawler/Crawl4aiBasicCrawler.node.js +37 -0
  9. package/dist/nodes/Crawl4aiBasicCrawler/Crawl4aiBasicCrawler.node.js.map +1 -0
  10. package/dist/nodes/Crawl4aiBasicCrawler/actions/crawlMultipleUrls.operation.d.ts +4 -0
  11. package/dist/nodes/Crawl4aiBasicCrawler/actions/crawlMultipleUrls.operation.js +421 -0
  12. package/dist/nodes/Crawl4aiBasicCrawler/actions/crawlMultipleUrls.operation.js.map +1 -0
  13. package/dist/nodes/Crawl4aiBasicCrawler/actions/crawlSingleUrl.operation.d.ts +4 -0
  14. package/dist/nodes/Crawl4aiBasicCrawler/actions/crawlSingleUrl.operation.js +422 -0
  15. package/dist/nodes/Crawl4aiBasicCrawler/actions/crawlSingleUrl.operation.js.map +1 -0
  16. package/dist/nodes/Crawl4aiBasicCrawler/actions/operations.d.ts +8 -0
  17. package/dist/nodes/Crawl4aiBasicCrawler/actions/operations.js +67 -0
  18. package/dist/nodes/Crawl4aiBasicCrawler/actions/operations.js.map +1 -0
  19. package/dist/nodes/Crawl4aiBasicCrawler/actions/processRawHtml.operation.d.ts +4 -0
  20. package/dist/nodes/Crawl4aiBasicCrawler/actions/processRawHtml.operation.js +148 -0
  21. package/dist/nodes/Crawl4aiBasicCrawler/actions/processRawHtml.operation.js.map +1 -0
  22. package/dist/nodes/Crawl4aiBasicCrawler/actions/router.d.ts +2 -0
  23. package/dist/nodes/Crawl4aiBasicCrawler/actions/router.js +37 -0
  24. package/dist/nodes/Crawl4aiBasicCrawler/actions/router.js.map +1 -0
  25. package/dist/nodes/Crawl4aiBasicCrawler/crawl4ai.svg +6 -0
  26. package/dist/nodes/Crawl4aiBasicCrawler/helpers/apiClient.d.ts +15 -0
  27. package/dist/nodes/Crawl4aiBasicCrawler/helpers/apiClient.js +271 -0
  28. package/dist/nodes/Crawl4aiBasicCrawler/helpers/apiClient.js.map +1 -0
  29. package/dist/nodes/Crawl4aiBasicCrawler/helpers/formatters.d.ts +5 -0
  30. package/dist/nodes/Crawl4aiBasicCrawler/helpers/formatters.js +96 -0
  31. package/dist/nodes/Crawl4aiBasicCrawler/helpers/formatters.js.map +1 -0
  32. package/dist/nodes/Crawl4aiBasicCrawler/helpers/interfaces.d.ts +119 -0
  33. package/dist/nodes/Crawl4aiBasicCrawler/helpers/interfaces.js +3 -0
  34. package/dist/nodes/Crawl4aiBasicCrawler/helpers/interfaces.js.map +1 -0
  35. package/dist/nodes/Crawl4aiBasicCrawler/helpers/utils.d.ts +8 -0
  36. package/dist/nodes/Crawl4aiBasicCrawler/helpers/utils.js +80 -0
  37. package/dist/nodes/Crawl4aiBasicCrawler/helpers/utils.js.map +1 -0
  38. package/dist/nodes/Crawl4aiContentExtractor/Crawl4aiContentExtractor.node.d.ts +5 -0
  39. package/dist/nodes/Crawl4aiContentExtractor/Crawl4aiContentExtractor.node.js +38 -0
  40. package/dist/nodes/Crawl4aiContentExtractor/Crawl4aiContentExtractor.node.js.map +1 -0
  41. package/dist/nodes/Crawl4aiContentExtractor/actions/cssExtractor.operation.d.ts +4 -0
  42. package/dist/nodes/Crawl4aiContentExtractor/actions/cssExtractor.operation.js +295 -0
  43. package/dist/nodes/Crawl4aiContentExtractor/actions/cssExtractor.operation.js.map +1 -0
  44. package/dist/nodes/Crawl4aiContentExtractor/actions/jsonExtractor.operation.d.ts +4 -0
  45. package/dist/nodes/Crawl4aiContentExtractor/actions/jsonExtractor.operation.js +328 -0
  46. package/dist/nodes/Crawl4aiContentExtractor/actions/jsonExtractor.operation.js.map +1 -0
  47. package/dist/nodes/Crawl4aiContentExtractor/actions/llmExtractor.operation.d.ts +4 -0
  48. package/dist/nodes/Crawl4aiContentExtractor/actions/llmExtractor.operation.js +417 -0
  49. package/dist/nodes/Crawl4aiContentExtractor/actions/llmExtractor.operation.js.map +1 -0
  50. package/dist/nodes/Crawl4aiContentExtractor/actions/operations.d.ts +8 -0
  51. package/dist/nodes/Crawl4aiContentExtractor/actions/operations.js +67 -0
  52. package/dist/nodes/Crawl4aiContentExtractor/actions/operations.js.map +1 -0
  53. package/dist/nodes/Crawl4aiContentExtractor/actions/router.d.ts +2 -0
  54. package/dist/nodes/Crawl4aiContentExtractor/actions/router.js +37 -0
  55. package/dist/nodes/Crawl4aiContentExtractor/actions/router.js.map +1 -0
  56. package/dist/nodes/Crawl4aiContentExtractor/crawl4ai.svg +6 -0
  57. package/dist/nodes/Crawl4aiContentExtractor/helpers/apiClient.d.ts +1 -0
  58. package/dist/nodes/Crawl4aiContentExtractor/helpers/apiClient.js +7 -0
  59. package/dist/nodes/Crawl4aiContentExtractor/helpers/apiClient.js.map +1 -0
  60. package/dist/nodes/Crawl4aiContentExtractor/helpers/formatters.d.ts +1 -0
  61. package/dist/nodes/Crawl4aiContentExtractor/helpers/formatters.js +8 -0
  62. package/dist/nodes/Crawl4aiContentExtractor/helpers/formatters.js.map +1 -0
  63. package/dist/nodes/Crawl4aiContentExtractor/helpers/interfaces.d.ts +1 -0
  64. package/dist/nodes/Crawl4aiContentExtractor/helpers/interfaces.js +3 -0
  65. package/dist/nodes/Crawl4aiContentExtractor/helpers/interfaces.js.map +1 -0
  66. package/dist/nodes/Crawl4aiContentExtractor/helpers/utils.d.ts +9 -0
  67. package/dist/nodes/Crawl4aiContentExtractor/helpers/utils.js +93 -0
  68. package/dist/nodes/Crawl4aiContentExtractor/helpers/utils.js.map +1 -0
  69. package/dist/tsconfig.tsbuildinfo +1 -0
  70. package/index.js +14 -0
  71. package/package.json +68 -0
@@ -0,0 +1,417 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const utils_1 = require("../helpers/utils");
7
+ const formatters_1 = require("../../Crawl4aiBasicCrawler/helpers/formatters");
8
+ exports.description = [
9
+ {
10
+ displayName: 'URL',
11
+ name: 'url',
12
+ type: 'string',
13
+ required: true,
14
+ default: '',
15
+ placeholder: 'https://example.com',
16
+ description: 'The URL to extract content from',
17
+ displayOptions: {
18
+ show: {
19
+ operation: ['llmExtractor'],
20
+ },
21
+ },
22
+ },
23
+ {
24
+ displayName: 'Extraction Instructions',
25
+ name: 'instruction',
26
+ type: 'string',
27
+ typeOptions: {
28
+ rows: 4,
29
+ },
30
+ required: true,
31
+ default: '',
32
+ placeholder: 'Extract the product name, price, and description from this page.',
33
+ description: 'Instructions for the LLM on what to extract from the page',
34
+ displayOptions: {
35
+ show: {
36
+ operation: ['llmExtractor'],
37
+ },
38
+ },
39
+ },
40
+ {
41
+ displayName: 'Schema Fields',
42
+ name: 'schemaFields',
43
+ placeholder: 'Add Schema Field',
44
+ type: 'fixedCollection',
45
+ typeOptions: {
46
+ multipleValues: true,
47
+ },
48
+ default: {},
49
+ required: true,
50
+ displayOptions: {
51
+ show: {
52
+ operation: ['llmExtractor'],
53
+ },
54
+ },
55
+ options: [
56
+ {
57
+ name: 'fieldsValues',
58
+ displayName: 'Fields',
59
+ values: [
60
+ {
61
+ displayName: 'Field Name',
62
+ name: 'name',
63
+ type: 'string',
64
+ required: true,
65
+ default: '',
66
+ placeholder: 'title',
67
+ description: 'Name of the field to extract',
68
+ },
69
+ {
70
+ displayName: 'Field Type',
71
+ name: 'fieldType',
72
+ type: 'options',
73
+ options: [
74
+ {
75
+ name: 'String',
76
+ value: 'string',
77
+ description: 'Plain text string',
78
+ },
79
+ {
80
+ name: 'Number',
81
+ value: 'number',
82
+ description: 'Numeric value',
83
+ },
84
+ {
85
+ name: 'Boolean',
86
+ value: 'boolean',
87
+ description: 'True/false value',
88
+ },
89
+ {
90
+ name: 'Array',
91
+ value: 'array',
92
+ description: 'Array of values',
93
+ },
94
+ ],
95
+ default: 'string',
96
+ description: 'Type of the field',
97
+ },
98
+ {
99
+ displayName: 'Description',
100
+ name: 'description',
101
+ type: 'string',
102
+ default: '',
103
+ placeholder: 'The main title of the product',
104
+ description: 'Description of the field to help the LLM understand what to extract',
105
+ },
106
+ {
107
+ displayName: 'Required',
108
+ name: 'required',
109
+ type: 'boolean',
110
+ default: true,
111
+ description: 'Whether this field is required',
112
+ },
113
+ ],
114
+ },
115
+ ],
116
+ },
117
+ {
118
+ displayName: 'Browser Options',
119
+ name: 'browserOptions',
120
+ type: 'collection',
121
+ placeholder: 'Add Option',
122
+ default: {},
123
+ displayOptions: {
124
+ show: {
125
+ operation: ['llmExtractor'],
126
+ },
127
+ },
128
+ options: [
129
+ {
130
+ displayName: 'Enable JavaScript',
131
+ name: 'javaScriptEnabled',
132
+ type: 'boolean',
133
+ default: true,
134
+ description: 'Whether to enable JavaScript execution',
135
+ },
136
+ {
137
+ displayName: 'Headless Mode',
138
+ name: 'headless',
139
+ type: 'boolean',
140
+ default: true,
141
+ description: 'Whether to run browser in headless mode',
142
+ },
143
+ {
144
+ displayName: 'JavaScript Code',
145
+ name: 'jsCode',
146
+ type: 'string',
147
+ typeOptions: {
148
+ rows: 4,
149
+ },
150
+ default: '',
151
+ placeholder: 'document.querySelector("button.load-more").click();',
152
+ description: 'JavaScript code to execute before extraction (e.g., to click buttons, scroll)',
153
+ },
154
+ {
155
+ displayName: 'Timeout (MS)',
156
+ name: 'timeout',
157
+ type: 'number',
158
+ default: 60000,
159
+ description: 'Maximum time to wait for the browser to load the page',
160
+ },
161
+ {
162
+ displayName: 'Viewport Height',
163
+ name: 'viewportHeight',
164
+ type: 'number',
165
+ default: 800,
166
+ description: 'The height of the browser viewport',
167
+ },
168
+ {
169
+ displayName: 'Viewport Width',
170
+ name: 'viewportWidth',
171
+ type: 'number',
172
+ default: 1280,
173
+ description: 'The width of the browser viewport',
174
+ },
175
+ ],
176
+ },
177
+ {
178
+ displayName: 'LLM Options',
179
+ name: 'llmOptions',
180
+ type: 'collection',
181
+ placeholder: 'Add Option',
182
+ default: {},
183
+ displayOptions: {
184
+ show: {
185
+ operation: ['llmExtractor'],
186
+ },
187
+ },
188
+ options: [
189
+ {
190
+ displayName: 'LLM Provider',
191
+ name: 'llmProvider',
192
+ type: 'options',
193
+ options: [
194
+ {
195
+ name: 'Anthropic Claude 3 Sonnet',
196
+ value: 'anthropic/claude-3-sonnet',
197
+ description: 'Anthropic Claude 3 Sonnet',
198
+ },
199
+ {
200
+ name: 'Groq Llama 3 70B',
201
+ value: 'groq/llama3-70b-8192',
202
+ description: 'Groq Llama 3 70B',
203
+ },
204
+ {
205
+ name: 'Ollama Llama 3',
206
+ value: 'ollama/llama3',
207
+ description: 'Ollama Llama 3 (Local)',
208
+ },
209
+ {
210
+ name: 'OpenAI GPT-3.5 Turbo',
211
+ value: 'openai/gpt-3.5-turbo',
212
+ description: 'OpenAI GPT-3.5 Turbo',
213
+ },
214
+ {
215
+ name: 'OpenAI GPT-4o',
216
+ value: 'openai/gpt-4o',
217
+ description: 'OpenAI GPT-4o',
218
+ },
219
+ ],
220
+ default: 'openai/gpt-4o',
221
+ description: 'LLM provider to use for extraction',
222
+ displayOptions: {
223
+ show: {
224
+ overrideProvider: [true],
225
+ },
226
+ },
227
+ },
228
+ {
229
+ displayName: 'Max Tokens',
230
+ name: 'maxTokens',
231
+ type: 'number',
232
+ default: 2000,
233
+ description: 'Maximum number of tokens for the LLM response',
234
+ },
235
+ {
236
+ displayName: 'Override LLM Provider',
237
+ name: 'overrideProvider',
238
+ type: 'boolean',
239
+ default: false,
240
+ description: 'Whether to override the LLM provider from credentials',
241
+ },
242
+ {
243
+ displayName: 'Provider API Key',
244
+ name: 'apiKey',
245
+ type: 'string',
246
+ typeOptions: {
247
+ password: true,
248
+ },
249
+ default: '',
250
+ description: 'API key for the LLM provider (leave empty to use API key from credentials)',
251
+ displayOptions: {
252
+ show: {
253
+ overrideProvider: [true],
254
+ },
255
+ },
256
+ },
257
+ {
258
+ displayName: 'Temperature',
259
+ name: 'temperature',
260
+ type: 'number',
261
+ typeOptions: {
262
+ minValue: 0,
263
+ maxValue: 1,
264
+ numberPrecision: 1,
265
+ },
266
+ default: 0,
267
+ description: 'Controls randomness: 0 for deterministic results, higher for more creativity',
268
+ },
269
+ ],
270
+ },
271
+ {
272
+ displayName: 'Options',
273
+ name: 'options',
274
+ type: 'collection',
275
+ placeholder: 'Add Option',
276
+ default: {},
277
+ displayOptions: {
278
+ show: {
279
+ operation: ['llmExtractor'],
280
+ },
281
+ },
282
+ options: [
283
+ {
284
+ displayName: 'Cache Mode',
285
+ name: 'cacheMode',
286
+ type: 'options',
287
+ options: [
288
+ {
289
+ name: 'Enabled (Read/Write)',
290
+ value: 'enabled',
291
+ description: 'Use cache if available, save new results to cache',
292
+ },
293
+ {
294
+ name: 'Bypass (Force Fresh)',
295
+ value: 'bypass',
296
+ description: 'Ignore cache, always fetch fresh content',
297
+ },
298
+ {
299
+ name: 'Only (Read Only)',
300
+ value: 'only',
301
+ description: 'Only use cache, do not make new requests',
302
+ },
303
+ ],
304
+ default: 'enabled',
305
+ description: 'How to use the cache when crawling',
306
+ },
307
+ {
308
+ displayName: 'Include Original Text',
309
+ name: 'includeFullText',
310
+ type: 'boolean',
311
+ default: false,
312
+ description: 'Whether to include the original webpage text in output',
313
+ },
314
+ {
315
+ displayName: 'CSS Selector',
316
+ name: 'cssSelector',
317
+ type: 'string',
318
+ default: '',
319
+ placeholder: 'article.content',
320
+ description: 'CSS selector to focus extraction on a specific part of the page (leave empty for full page)',
321
+ },
322
+ ],
323
+ },
324
+ ];
325
+ async function execute(items, nodeOptions) {
326
+ var _a;
327
+ const allResults = [];
328
+ const credentials = (await this.getCredentials('crawl4aiApi'));
329
+ if (!credentials.enableLlm) {
330
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'LLM features are not enabled in Crawl4AI credentials. Please enable them and configure an LLM provider.', { itemIndex: 0 });
331
+ }
332
+ for (let i = 0; i < items.length; i++) {
333
+ try {
334
+ const url = this.getNodeParameter('url', i, '');
335
+ const instruction = this.getNodeParameter('instruction', i, '');
336
+ const schemaFieldsValues = this.getNodeParameter('schemaFields.fieldsValues', i, []);
337
+ const browserOptions = this.getNodeParameter('browserOptions', i, {});
338
+ const llmOptions = this.getNodeParameter('llmOptions', i, {});
339
+ const options = this.getNodeParameter('options', i, {});
340
+ if (!url) {
341
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'URL cannot be empty.', { itemIndex: i });
342
+ }
343
+ if (!(0, utils_1.isValidUrl)(url)) {
344
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Invalid URL: ${url}`, { itemIndex: i });
345
+ }
346
+ if (!instruction) {
347
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Extraction instructions cannot be empty.', { itemIndex: i });
348
+ }
349
+ if (!schemaFieldsValues || schemaFieldsValues.length === 0) {
350
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'At least one schema field must be defined.', { itemIndex: i });
351
+ }
352
+ const schemaProperties = {};
353
+ const requiredFields = [];
354
+ schemaFieldsValues.forEach(field => {
355
+ const fieldName = field.name;
356
+ schemaProperties[fieldName] = {
357
+ name: fieldName,
358
+ type: field.fieldType,
359
+ description: field.description || undefined,
360
+ };
361
+ if (field.required === true) {
362
+ requiredFields.push(fieldName);
363
+ }
364
+ });
365
+ const schema = {
366
+ title: 'ExtractedData',
367
+ type: 'object',
368
+ properties: schemaProperties,
369
+ required: requiredFields.length > 0 ? requiredFields : undefined,
370
+ };
371
+ let provider = credentials.llmProvider || 'openai/gpt-4o';
372
+ let apiKey = credentials.apiKey;
373
+ if (llmOptions.overrideProvider === true) {
374
+ provider = llmOptions.llmProvider || provider;
375
+ apiKey = llmOptions.apiKey || apiKey;
376
+ }
377
+ const browserConfig = (0, utils_1.createBrowserConfig)(browserOptions);
378
+ const extraArgs = {};
379
+ if (llmOptions.temperature !== undefined) {
380
+ extraArgs.temperature = llmOptions.temperature;
381
+ }
382
+ if (llmOptions.maxTokens !== undefined) {
383
+ extraArgs.max_tokens = llmOptions.maxTokens;
384
+ }
385
+ const extractionStrategy = (0, utils_1.createLlmExtractionStrategy)(schema, instruction, provider, apiKey, Object.keys(extraArgs).length > 0 ? extraArgs : undefined);
386
+ const crawler = await (0, utils_1.getCrawl4aiClient)(this);
387
+ const result = await crawler.arun(url, {
388
+ browserConfig,
389
+ extractionStrategy,
390
+ cacheMode: options.cacheMode || 'enabled',
391
+ jsCode: browserOptions.jsCode,
392
+ cssSelector: options.cssSelector,
393
+ });
394
+ const extractedData = (0, formatters_1.parseExtractedJson)(result);
395
+ const formattedResult = (0, formatters_1.formatExtractionResult)(result, extractedData, options.includeFullText);
396
+ allResults.push({
397
+ json: formattedResult,
398
+ pairedItem: { item: i },
399
+ });
400
+ }
401
+ catch (error) {
402
+ if (this.continueOnFail()) {
403
+ const node = this.getNode();
404
+ const errorItemIndex = (_a = error.itemIndex) !== null && _a !== void 0 ? _a : i;
405
+ allResults.push({
406
+ json: items[i].json,
407
+ error: new n8n_workflow_1.NodeOperationError(node, error.message, { itemIndex: errorItemIndex }),
408
+ pairedItem: { item: i },
409
+ });
410
+ continue;
411
+ }
412
+ throw error;
413
+ }
414
+ }
415
+ return allResults;
416
+ }
417
+ //# sourceMappingURL=llmExtractor.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llmExtractor.operation.js","sourceRoot":"","sources":["../../../../nodes/Crawl4aiContentExtractor/actions/llmExtractor.operation.ts"],"names":[],"mappings":";;;AAkVA,0BAiJC;AA7dD,+CAAkD;AAIlD,4CAK0B;AAC1B,8EAA2G;AAG9F,QAAA,WAAW,GAAsB;IAC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J,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAEhB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;gBAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;gBAC5B,MAAM,cAAc,GAAG,MAAC,KAAa,CAAC,SAAS,mCAAI,CAAC,CAAC;gBACrD,UAAU,CAAC,IAAI,CAAC;oBACf,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;oBACnB,KAAK,EAAE,IAAI,iCAAkB,CAAC,IAAI,EAAG,KAAe,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;oBAC5F,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;iBACvB,CAAC,CAAC;gBACH,SAAS;YACV,CAAC;YAED,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { INodeProperties, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ import type { Crawl4aiNodeOptions } from '../helpers/interfaces';
3
+ type OperationExecuteFunction = (this: IExecuteFunctions, items: INodeExecutionData[], nodeOptions: Crawl4aiNodeOptions) => Promise<INodeExecutionData[]>;
4
+ export declare const operations: {
5
+ [key: string]: OperationExecuteFunction;
6
+ };
7
+ export declare const description: INodeProperties[];
8
+ export {};
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.description = exports.operations = void 0;
27
+ const cssExtractor = __importStar(require("./cssExtractor.operation"));
28
+ const llmExtractor = __importStar(require("./llmExtractor.operation"));
29
+ const jsonExtractor = __importStar(require("./jsonExtractor.operation"));
30
+ exports.operations = {
31
+ cssExtractor: cssExtractor.execute,
32
+ llmExtractor: llmExtractor.execute,
33
+ jsonExtractor: jsonExtractor.execute,
34
+ };
35
+ exports.description = [
36
+ {
37
+ displayName: 'Operation',
38
+ name: 'operation',
39
+ type: 'options',
40
+ noDataExpression: true,
41
+ options: [
42
+ {
43
+ name: 'CSS Selector Extractor',
44
+ value: 'cssExtractor',
45
+ description: 'Extract structured content using CSS selectors',
46
+ action: 'Extract with CSS selectors',
47
+ },
48
+ {
49
+ name: 'LLM Extractor',
50
+ value: 'llmExtractor',
51
+ description: 'Extract structured content using LLM models',
52
+ action: 'Extract with LLM',
53
+ },
54
+ {
55
+ name: 'JSON Extractor',
56
+ value: 'jsonExtractor',
57
+ description: 'Extract JSON data from a webpage',
58
+ action: 'Extract JSON data',
59
+ },
60
+ ],
61
+ default: 'cssExtractor',
62
+ },
63
+ ...cssExtractor.description,
64
+ ...llmExtractor.description,
65
+ ...jsonExtractor.description,
66
+ ];
67
+ //# sourceMappingURL=operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../nodes/Crawl4aiContentExtractor/actions/operations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,uEAAyD;AACzD,uEAAyD;AACzD,yEAA2D;AAW9C,QAAA,UAAU,GAAgD;IACrE,YAAY,EAAE,YAAY,CAAC,OAAO;IAClC,YAAY,EAAE,YAAY,CAAC,OAAO;IAClC,aAAa,EAAE,aAAa,CAAC,OAAO;CACrC,CAAC;AAGW,QAAA,WAAW,GAAsB;IAC5C;QACE,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,wBAAwB;gBAC9B,KAAK,EAAE,cAAc;gBACrB,WAAW,EAAE,gDAAgD;gBAC7D,MAAM,EAAE,4BAA4B;aACrC;YACD;gBACE,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,cAAc;gBACrB,WAAW,EAAE,6CAA6C;gBAC1D,MAAM,EAAE,kBAAkB;aAC3B;YACD;gBACE,IAAI,EAAE,gBAAgB;gBACtB,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,kCAAkC;gBAC/C,MAAM,EAAE,mBAAmB;aAC5B;SACF;QACD,OAAO,EAAE,cAAc;KACxB;IAGD,GAAG,YAAY,CAAC,WAAW;IAC3B,GAAG,YAAY,CAAC,WAAW;IAC3B,GAAG,aAAa,CAAC,WAAW;CAC7B,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ export declare function router(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.router = router;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const operations_1 = require("./operations");
6
+ async function router() {
7
+ const items = this.getInputData();
8
+ let returnData = [];
9
+ const node = this.getNode();
10
+ const operation = this.getNodeParameter('operation', 0);
11
+ const nodeOptions = this.getNodeParameter('options', 0, {});
12
+ const continueOnFail = this.continueOnFail();
13
+ try {
14
+ const executeFunction = operations_1.operations[operation];
15
+ if (!executeFunction) {
16
+ throw new n8n_workflow_1.NodeOperationError(node, `The operation "${operation}" is not supported!`, { itemIndex: 0 });
17
+ }
18
+ returnData = await executeFunction.call(this, items, nodeOptions);
19
+ }
20
+ catch (error) {
21
+ if (continueOnFail) {
22
+ returnData = items.map((item, index) => {
23
+ var _a;
24
+ return ({
25
+ json: item.json,
26
+ error: new n8n_workflow_1.NodeOperationError(node, error.message, { itemIndex: (_a = error.itemIndex) !== null && _a !== void 0 ? _a : index }),
27
+ pairedItem: { item: index },
28
+ });
29
+ });
30
+ }
31
+ else {
32
+ throw error;
33
+ }
34
+ }
35
+ return this.prepareOutputData(returnData);
36
+ }
37
+ //# sourceMappingURL=router.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../nodes/Crawl4aiContentExtractor/actions/router.ts"],"names":[],"mappings":";;AAYA,wBA0CC;AAlDD,+CAAkD;AAMlD,6CAA0C;AAEnC,KAAK,UAAU,MAAM;IAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;IAClC,IAAI,UAAU,GAAyB,EAAE,CAAC;IAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAG5B,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAW,CAAC;IAElE,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAAwB,CAAC;IAEnF,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;IAE7C,IAAI,CAAC;QAIH,MAAM,eAAe,GAAG,uBAAU,CAAC,SAAS,CAAC,CAAC;QAE9C,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAI,iCAAkB,CAAC,IAAI,EAAE,kBAAkB,SAAS,qBAAqB,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;QACzG,CAAC;QAGD,UAAU,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;IAGpE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,cAAc,EAAE,CAAC;YAEnB,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;;gBAAC,OAAA,CAAC;oBACvC,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,KAAK,EAAE,IAAI,iCAAkB,CAAC,IAAI,EAAG,KAAe,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,MAAC,KAAa,CAAC,SAAS,mCAAI,KAAK,EAAE,CAAC;oBAC/G,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;iBAC5B,CAAC,CAAA;aAAA,CAAC,CAAC;QACN,CAAC;aAAM,CAAC;YAEN,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAGD,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,6 @@
1
+ <svg width="125" height="125" viewBox="0 0 125 125" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M97.9985 112.342C100.508 113.052 109.518 112.342 112.998 112.342C115.388 112.342 113.518 109.342 112.918 108.422C104.248 95.342 91.1384 82.562 81.5285 69.812C76.2984 62.882 74.9885 63.922 80.5185 56.852C90.9785 43.472 104.318 29.912 113.938 16.272C114.478 15.502 116.358 12.332 113.998 12.332H98.9985L65.0385 53.362C63.3985 55.542 61.2685 56.252 59.4785 53.842C49.0685 42.152 39.6885 27.562 29.0185 16.322C28.1485 15.402 24.8485 12.342 23.9985 12.342H9.49845C9.20845 14.352 10.0185 15.692 11.0485 17.292C19.5585 30.492 34.5985 44.842 44.4785 57.862C45.3585 59.022 47.5085 61.602 47.5085 62.842C47.5085 64.422 41.9185 70.992 40.4885 72.832C31.9985 83.732 19.2285 96.252 12.0485 107.392C11.0185 108.992 10.2085 110.332 10.4985 112.342H25.9985C26.2785 112.342 27.7685 111.392 28.1985 111.032L58.9585 72.312C62.0885 68.412 63.9885 71.082 66.4685 73.862C71.0985 79.042 95.0084 111.502 97.9884 112.342H97.9985ZM15.2285 39.622C13.8485 38.472 2.99845 35.892 2.49845 36.352C1.69845 37.092 4.48845 40.322 5.10845 41.242C10.0985 48.622 16.6885 55.302 21.3685 62.682C20.7885 65.612 1.27845 87.322 2.49845 88.352C3.27845 89.012 13.4185 87.262 14.8185 86.422C17.2285 80.942 31.4485 68.162 32.3385 63.632C32.5685 62.472 32.6985 61.412 31.9985 60.362L15.2285 39.622ZM122.488 36.342C122.008 35.882 111.138 38.462 109.758 39.612C107.848 41.222 95.7985 56.652 94.0485 59.382C92.0985 62.432 92.0985 63.242 94.0485 66.282C95.9985 69.322 107.648 84.242 109.758 86.052C110.698 86.862 120.568 89.432 121.988 89.342C123.058 89.272 122.518 87.222 122.008 86.322C119.418 81.732 112.078 74.542 108.518 69.812C107.458 68.402 103.808 64.042 103.808 62.842C103.808 60.872 118.558 43.672 120.918 40.272C121.448 39.502 123.168 37.012 122.488 36.352V36.342Z" fill="black"/>
3
+ <path d="M97.9985 112.342C95.0185 111.502 71.1085 79.042 66.4785 73.862C63.9885 71.082 62.0985 68.412 58.9685 72.312L28.2085 111.032C27.7785 111.402 26.2885 112.342 26.0085 112.342H10.5085C10.2185 110.332 11.0285 108.992 12.0585 107.392C19.2385 96.242 32.0085 83.732 40.4985 72.832C41.9285 70.992 47.5185 64.422 47.5185 62.842C47.5185 61.602 45.3785 59.022 44.4885 57.862C34.5985 44.842 19.5485 30.492 11.0485 17.292C10.0185 15.692 9.20845 14.352 9.49845 12.342H23.9985C24.8485 12.342 28.1485 15.402 29.0185 16.322C39.6885 27.562 49.0685 42.162 59.4785 53.862C61.2585 56.272 63.3885 55.562 65.0385 53.382L98.9985 12.342H113.998C116.358 12.342 114.478 15.512 113.938 16.282C104.318 29.922 90.9785 43.472 80.5185 56.862C74.9885 63.932 76.3085 62.882 81.5285 69.822C91.1384 82.572 104.248 95.352 112.918 108.432C113.518 109.342 115.388 112.352 112.998 112.352C109.518 112.352 100.508 113.062 97.9985 112.352V112.342Z" fill="#4AD7D6"/>
4
+ <path d="M122.488 36.342C123.168 37.002 121.448 39.492 120.918 40.262C118.558 43.672 103.808 60.872 103.808 62.832C103.808 64.032 107.458 68.402 108.518 69.802C112.078 74.542 119.418 81.722 122.008 86.312C122.518 87.212 123.048 89.272 121.988 89.332C120.568 89.422 110.708 86.852 109.758 86.042C107.648 84.232 95.9085 69.172 94.0485 66.272C92.0985 63.222 92.0985 62.412 94.0485 59.372C95.7985 56.642 107.848 41.212 109.758 39.602C111.138 38.442 122.008 35.872 122.488 36.332V36.342Z" fill="#4AD7D6"/>
5
+ <path d="M15.2285 39.622L32.0185 60.352C32.7185 61.402 32.5885 62.462 32.3585 63.622C31.4585 68.152 17.2485 80.932 14.8385 86.412C13.4385 87.252 3.29845 89.002 2.51845 88.342C1.29845 87.312 20.8085 65.612 21.3885 62.672C16.7085 55.292 10.1185 48.612 5.12845 41.232C4.50845 40.322 1.71845 37.082 2.51845 36.342C3.01845 35.882 13.8685 38.462 15.2485 39.612L15.2285 39.622Z" fill="#4AD7D6"/>
6
+ </svg>
@@ -0,0 +1 @@
1
+ export { Crawl4aiClient, createCrawlerInstance } from '../../Crawl4aiBasicCrawler/helpers/apiClient';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createCrawlerInstance = exports.Crawl4aiClient = void 0;
4
+ var apiClient_1 = require("../../Crawl4aiBasicCrawler/helpers/apiClient");
5
+ Object.defineProperty(exports, "Crawl4aiClient", { enumerable: true, get: function () { return apiClient_1.Crawl4aiClient; } });
6
+ Object.defineProperty(exports, "createCrawlerInstance", { enumerable: true, get: function () { return apiClient_1.createCrawlerInstance; } });
7
+ //# sourceMappingURL=apiClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiClient.js","sourceRoot":"","sources":["../../../../nodes/Crawl4aiContentExtractor/helpers/apiClient.ts"],"names":[],"mappings":";;;AACA,0EAGsD;AAFpD,2GAAA,cAAc,OAAA;AACd,kHAAA,qBAAqB,OAAA"}
@@ -0,0 +1 @@
1
+ export { formatCrawlResult, parseExtractedJson, formatExtractionResult } from '../../Crawl4aiBasicCrawler/helpers/formatters';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatExtractionResult = exports.parseExtractedJson = exports.formatCrawlResult = void 0;
4
+ var formatters_1 = require("../../Crawl4aiBasicCrawler/helpers/formatters");
5
+ Object.defineProperty(exports, "formatCrawlResult", { enumerable: true, get: function () { return formatters_1.formatCrawlResult; } });
6
+ Object.defineProperty(exports, "parseExtractedJson", { enumerable: true, get: function () { return formatters_1.parseExtractedJson; } });
7
+ Object.defineProperty(exports, "formatExtractionResult", { enumerable: true, get: function () { return formatters_1.formatExtractionResult; } });
8
+ //# sourceMappingURL=formatters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../../nodes/Crawl4aiContentExtractor/helpers/formatters.ts"],"names":[],"mappings":";;;AACA,4EAIuD;AAHrD,+GAAA,iBAAiB,OAAA;AACjB,gHAAA,kBAAkB,OAAA;AAClB,oHAAA,sBAAsB,OAAA"}
@@ -0,0 +1 @@
1
+ export { Crawl4aiApiCredentials, Crawl4aiNodeOptions, BrowserConfig, CrawlerRunConfig, CrawlResult, Link, Media, CssSelectorField, CssSelectorSchema, LlmSchemaField, LlmSchema } from '../../Crawl4aiBasicCrawler/helpers/interfaces';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../nodes/Crawl4aiContentExtractor/helpers/interfaces.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ export { getCrawl4aiClient, createBrowserConfig, createCrawlerRunConfig, safeJsonParse, cleanText, isValidUrl } from '../../Crawl4aiBasicCrawler/helpers/utils';
2
+ import { IDataObject } from 'n8n-workflow';
3
+ import { CssSelectorSchema, LlmSchema } from './interfaces';
4
+ export declare function createCssSelectorExtractionStrategy(schema: CssSelectorSchema): any;
5
+ export declare function createLlmExtractionStrategy(schema: LlmSchema, instruction: string, provider: string, apiKey?: string, extraArgs?: {
6
+ temperature?: number;
7
+ max_tokens?: number;
8
+ }): any;
9
+ export declare function cleanExtractedData(data: IDataObject): IDataObject;