n8n-nodes-geekflare-api 0.1.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 +21 -0
- package/README.md +319 -0
- package/dist/credentials/GeekflareApi.credentials.d.ts +7 -0
- package/dist/credentials/GeekflareApi.credentials.js +25 -0
- package/dist/credentials/GeekflareApi.credentials.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/Geekflare/Geekflare.node.d.ts +5 -0
- package/dist/nodes/Geekflare/Geekflare.node.js +882 -0
- package/dist/nodes/Geekflare/Geekflare.node.js.map +1 -0
- package/dist/nodes/Geekflare/favicon.svg +33 -0
- package/package.json +57 -0
|
@@ -0,0 +1,882 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Geekflare = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
class Geekflare {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: "Geekflare",
|
|
9
|
+
name: "geekflare",
|
|
10
|
+
icon: "file:favicon.svg",
|
|
11
|
+
group: ["transform"],
|
|
12
|
+
version: 1,
|
|
13
|
+
subtitle: '={{$parameter["operation"]}}',
|
|
14
|
+
description: "Web scraping, screenshots, DNS, SEO audits, security checks and more via the Geekflare API",
|
|
15
|
+
defaults: {
|
|
16
|
+
name: "Geekflare",
|
|
17
|
+
},
|
|
18
|
+
inputs: ["main"],
|
|
19
|
+
outputs: ["main"],
|
|
20
|
+
credentials: [
|
|
21
|
+
{
|
|
22
|
+
name: "geekflareApi",
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
properties: [
|
|
27
|
+
{
|
|
28
|
+
displayName: "Operation",
|
|
29
|
+
name: "operation",
|
|
30
|
+
type: "options",
|
|
31
|
+
noDataExpression: true,
|
|
32
|
+
options: [
|
|
33
|
+
{
|
|
34
|
+
name: "Broken Link Check",
|
|
35
|
+
value: "brokenlink",
|
|
36
|
+
description: "Find broken links on a webpage",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "DNS Record Lookup",
|
|
40
|
+
value: "dnsrecord",
|
|
41
|
+
description: "Retrieve DNS records for a domain",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "DNSSEC Check",
|
|
45
|
+
value: "dnssec",
|
|
46
|
+
description: "Verify DNSSEC configuration",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "HTTP Header Inspect",
|
|
50
|
+
value: "httpheader",
|
|
51
|
+
description: "Retrieve HTTP response headers",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "HTTP Protocol Check",
|
|
55
|
+
value: "httpprotocol",
|
|
56
|
+
description: "Detect which HTTP version a server uses",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "Lighthouse Audit",
|
|
60
|
+
value: "lighthouse",
|
|
61
|
+
description: "Run a Google Lighthouse performance audit",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "Load Time",
|
|
65
|
+
value: "loadtime",
|
|
66
|
+
description: "Measure full page load time",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "Meta Scraping",
|
|
70
|
+
value: "metascraping",
|
|
71
|
+
description: "Extract meta tags and Open Graph data",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "Mixed Content Check",
|
|
75
|
+
value: "mixedcontent",
|
|
76
|
+
description: "Detect HTTP resources on HTTPS pages",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "MTR Trace",
|
|
80
|
+
value: "mtr",
|
|
81
|
+
description: "Run an MTR network trace to a host",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "Open Port Scan",
|
|
85
|
+
value: "openport",
|
|
86
|
+
description: "Scan for open ports on a host",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "Ping",
|
|
90
|
+
value: "ping",
|
|
91
|
+
description: "Ping a host and measure latency",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "Redirect Chain Check",
|
|
95
|
+
value: "redirectcheck",
|
|
96
|
+
description: "Trace all redirects for a URL",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: "Screenshot",
|
|
100
|
+
value: "screenshot",
|
|
101
|
+
description: "Capture a full screenshot of a webpage",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
name: "Search",
|
|
105
|
+
value: "search",
|
|
106
|
+
description: "Perform a web, news, or image search",
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: "Site Up Check",
|
|
110
|
+
value: "up",
|
|
111
|
+
description: "Check if a website is online",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: "TLS/SSL Scan",
|
|
115
|
+
value: "tlsscan",
|
|
116
|
+
description: "Analyze TLS/SSL certificate and configuration",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
name: "TTFB Measurement",
|
|
120
|
+
value: "ttfb",
|
|
121
|
+
description: "Measure Time to First Byte",
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: "URL to PDF",
|
|
125
|
+
value: "url2pdf",
|
|
126
|
+
description: "Convert a webpage to a PDF file",
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "Web Scraping",
|
|
130
|
+
value: "webscraping",
|
|
131
|
+
description: "Scrape content from any webpage",
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
default: "webscraping",
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
displayName: "URL",
|
|
138
|
+
name: "url",
|
|
139
|
+
type: "string",
|
|
140
|
+
default: "",
|
|
141
|
+
required: true,
|
|
142
|
+
placeholder: "https://example.com",
|
|
143
|
+
displayOptions: {
|
|
144
|
+
show: {
|
|
145
|
+
operation: [
|
|
146
|
+
"webscraping",
|
|
147
|
+
"metascraping",
|
|
148
|
+
"screenshot",
|
|
149
|
+
"dnsrecord",
|
|
150
|
+
"up",
|
|
151
|
+
"redirectcheck",
|
|
152
|
+
"brokenlink",
|
|
153
|
+
"url2pdf",
|
|
154
|
+
"openport",
|
|
155
|
+
"tlsscan",
|
|
156
|
+
"ttfb",
|
|
157
|
+
"loadtime",
|
|
158
|
+
"httpheader",
|
|
159
|
+
"httpprotocol",
|
|
160
|
+
"mixedcontent",
|
|
161
|
+
"dnssec",
|
|
162
|
+
"mtr",
|
|
163
|
+
"ping",
|
|
164
|
+
"lighthouse",
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
// ── Web Scraping ──────────────────────────────────────────────
|
|
170
|
+
{
|
|
171
|
+
displayName: "Formats",
|
|
172
|
+
name: "format",
|
|
173
|
+
type: "multiOptions",
|
|
174
|
+
options: [
|
|
175
|
+
{ name: "HTML", value: "html" },
|
|
176
|
+
{ name: "HTML LLM", value: "html-llm" },
|
|
177
|
+
{ name: "JSON", value: "json" },
|
|
178
|
+
{ name: "Markdown", value: "markdown" },
|
|
179
|
+
{ name: "Markdown LLM", value: "markdown-llm" },
|
|
180
|
+
{ name: "Text", value: "text" },
|
|
181
|
+
{ name: "Text LLM", value: "text-llm" },
|
|
182
|
+
],
|
|
183
|
+
default: ["markdown"],
|
|
184
|
+
description: "Output formats to return. Select up to 3.",
|
|
185
|
+
displayOptions: { show: { operation: ["webscraping"] } },
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
displayName: "Additional Options",
|
|
189
|
+
name: "webscrapingOptions",
|
|
190
|
+
type: "collection",
|
|
191
|
+
placeholder: "Add Option",
|
|
192
|
+
default: {},
|
|
193
|
+
displayOptions: { show: { operation: ["webscraping"] } },
|
|
194
|
+
options: [
|
|
195
|
+
{
|
|
196
|
+
displayName: "Block Ads",
|
|
197
|
+
name: "blockAds",
|
|
198
|
+
type: "boolean",
|
|
199
|
+
default: true,
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
displayName: "Device",
|
|
203
|
+
name: "device",
|
|
204
|
+
type: "options",
|
|
205
|
+
options: [
|
|
206
|
+
{ name: "Desktop", value: "desktop" },
|
|
207
|
+
{ name: "Mobile", value: "mobile" },
|
|
208
|
+
],
|
|
209
|
+
default: "desktop",
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
displayName: "File Output",
|
|
213
|
+
name: "fileOutput",
|
|
214
|
+
type: "boolean",
|
|
215
|
+
default: false,
|
|
216
|
+
description: "Whether to generate a download URL for the scraped data",
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
displayName: "Proxy Country",
|
|
220
|
+
name: "proxyCountry",
|
|
221
|
+
type: "string",
|
|
222
|
+
default: "",
|
|
223
|
+
placeholder: "us, gb, de, in ...",
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
displayName: "Render JavaScript",
|
|
227
|
+
name: "renderJS",
|
|
228
|
+
type: "boolean",
|
|
229
|
+
default: true,
|
|
230
|
+
description: "Whether to execute JavaScript before extracting. Enable for dynamic sites.",
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
displayName: "Stealth Mode",
|
|
234
|
+
name: "stealth",
|
|
235
|
+
type: "boolean",
|
|
236
|
+
default: false,
|
|
237
|
+
description: "Whether to bypass CAPTCHAs. Requests will take longer.",
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
},
|
|
241
|
+
// ── Meta Scraping ─────────────────────────────────────────────
|
|
242
|
+
{
|
|
243
|
+
displayName: "Format",
|
|
244
|
+
name: "metaFormat",
|
|
245
|
+
type: "options",
|
|
246
|
+
options: [
|
|
247
|
+
{ name: "JSON", value: "json" },
|
|
248
|
+
{ name: "Markdown", value: "markdown" },
|
|
249
|
+
],
|
|
250
|
+
default: "json",
|
|
251
|
+
displayOptions: { show: { operation: ["metascraping"] } },
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
displayName: "Additional Options",
|
|
255
|
+
name: "metascrapingOptions",
|
|
256
|
+
type: "collection",
|
|
257
|
+
placeholder: "Add Option",
|
|
258
|
+
default: {},
|
|
259
|
+
displayOptions: { show: { operation: ["metascraping"] } },
|
|
260
|
+
options: [
|
|
261
|
+
{
|
|
262
|
+
displayName: "Block Ads",
|
|
263
|
+
name: "blockAds",
|
|
264
|
+
type: "boolean",
|
|
265
|
+
default: true,
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
displayName: "Device",
|
|
269
|
+
name: "device",
|
|
270
|
+
type: "options",
|
|
271
|
+
options: [
|
|
272
|
+
{ name: "Desktop", value: "desktop" },
|
|
273
|
+
{ name: "Mobile", value: "mobile" },
|
|
274
|
+
],
|
|
275
|
+
default: "desktop",
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
displayName: "File Output",
|
|
279
|
+
name: "fileOutput",
|
|
280
|
+
type: "boolean",
|
|
281
|
+
default: false,
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
displayName: "Proxy Country",
|
|
285
|
+
name: "proxyCountry",
|
|
286
|
+
type: "string",
|
|
287
|
+
default: "",
|
|
288
|
+
placeholder: "us, gb, de, in ...",
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
displayName: "Render JavaScript",
|
|
292
|
+
name: "renderJS",
|
|
293
|
+
type: "boolean",
|
|
294
|
+
default: true,
|
|
295
|
+
},
|
|
296
|
+
],
|
|
297
|
+
},
|
|
298
|
+
// ── Screenshot ────────────────────────────────────────────────
|
|
299
|
+
{
|
|
300
|
+
displayName: "Additional Options",
|
|
301
|
+
name: "screenshotOptions",
|
|
302
|
+
type: "collection",
|
|
303
|
+
placeholder: "Add Option",
|
|
304
|
+
default: {},
|
|
305
|
+
displayOptions: { show: { operation: ["screenshot"] } },
|
|
306
|
+
options: [
|
|
307
|
+
{
|
|
308
|
+
displayName: "Add Timestamp",
|
|
309
|
+
name: "addTimestamp",
|
|
310
|
+
type: "boolean",
|
|
311
|
+
default: false,
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
displayName: "Block Ads",
|
|
315
|
+
name: "blockAds",
|
|
316
|
+
type: "boolean",
|
|
317
|
+
default: true,
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
displayName: "Delay (seconds)",
|
|
321
|
+
name: "delay",
|
|
322
|
+
type: "number",
|
|
323
|
+
default: 0,
|
|
324
|
+
placeholder: "2",
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
displayName: "Device",
|
|
328
|
+
name: "device",
|
|
329
|
+
type: "options",
|
|
330
|
+
options: [
|
|
331
|
+
{ name: "Desktop", value: "desktop" },
|
|
332
|
+
{ name: "Mobile", value: "mobile" },
|
|
333
|
+
],
|
|
334
|
+
default: "desktop",
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
displayName: "Full Page",
|
|
338
|
+
name: "fullPage",
|
|
339
|
+
type: "boolean",
|
|
340
|
+
default: false,
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
displayName: "Hide Cookies Banner",
|
|
344
|
+
name: "hideCookie",
|
|
345
|
+
type: "boolean",
|
|
346
|
+
default: true,
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
displayName: "Highlight Links",
|
|
350
|
+
name: "highlightLinks",
|
|
351
|
+
type: "boolean",
|
|
352
|
+
default: false,
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
displayName: "Image Quality (1-100)",
|
|
356
|
+
name: "quality",
|
|
357
|
+
type: "number",
|
|
358
|
+
default: 90,
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
displayName: "Image Type",
|
|
362
|
+
name: "type",
|
|
363
|
+
type: "options",
|
|
364
|
+
options: [
|
|
365
|
+
{ name: "JPEG", value: "jpeg" },
|
|
366
|
+
{ name: "PNG", value: "png" },
|
|
367
|
+
{ name: "WEBP", value: "webp" },
|
|
368
|
+
],
|
|
369
|
+
default: "png",
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
displayName: "Page Height (px)",
|
|
373
|
+
name: "pageHeight",
|
|
374
|
+
type: "number",
|
|
375
|
+
default: 0,
|
|
376
|
+
placeholder: "2000",
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
displayName: "Proxy Country",
|
|
380
|
+
name: "proxyCountry",
|
|
381
|
+
type: "string",
|
|
382
|
+
default: "",
|
|
383
|
+
placeholder: "us, gb, de, in ...",
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
displayName: "Scale Factor",
|
|
387
|
+
name: "scaleFactor",
|
|
388
|
+
type: "number",
|
|
389
|
+
default: 1,
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
displayName: "Skip CAPTCHA",
|
|
393
|
+
name: "skipCaptcha",
|
|
394
|
+
type: "boolean",
|
|
395
|
+
default: true,
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
displayName: "Viewport Height (px)",
|
|
399
|
+
name: "viewportHeight",
|
|
400
|
+
type: "number",
|
|
401
|
+
default: 0,
|
|
402
|
+
placeholder: "768",
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
displayName: "Viewport Width (px)",
|
|
406
|
+
name: "viewportWidth",
|
|
407
|
+
type: "number",
|
|
408
|
+
default: 0,
|
|
409
|
+
placeholder: "1366",
|
|
410
|
+
},
|
|
411
|
+
],
|
|
412
|
+
},
|
|
413
|
+
// ── DNS Record ────────────────────────────────────────────────
|
|
414
|
+
{
|
|
415
|
+
displayName: "DNS Record Types",
|
|
416
|
+
name: "types",
|
|
417
|
+
type: "multiOptions",
|
|
418
|
+
options: [
|
|
419
|
+
{ name: "A", value: "A" },
|
|
420
|
+
{ name: "AAAA", value: "AAAA" },
|
|
421
|
+
{ name: "CAA", value: "CAA" },
|
|
422
|
+
{ name: "CNAME", value: "CNAME" },
|
|
423
|
+
{ name: "MX", value: "MX" },
|
|
424
|
+
{ name: "NS", value: "NS" },
|
|
425
|
+
{ name: "SOA", value: "SOA" },
|
|
426
|
+
{ name: "SRV", value: "SRV" },
|
|
427
|
+
{ name: "TXT", value: "TXT" },
|
|
428
|
+
],
|
|
429
|
+
default: ["A", "AAAA", "CNAME", "MX", "NS"],
|
|
430
|
+
displayOptions: { show: { operation: ["dnsrecord"] } },
|
|
431
|
+
},
|
|
432
|
+
// ── Site Up / Redirect / Broken Link / TTFB / HTTP Header / HTTP Protocol / MTR / Load Time / Mixed Content ──
|
|
433
|
+
{
|
|
434
|
+
displayName: "Additional Options",
|
|
435
|
+
name: "commonOptions",
|
|
436
|
+
type: "collection",
|
|
437
|
+
placeholder: "Add Option",
|
|
438
|
+
default: {},
|
|
439
|
+
displayOptions: {
|
|
440
|
+
show: {
|
|
441
|
+
operation: [
|
|
442
|
+
"up",
|
|
443
|
+
"redirectcheck",
|
|
444
|
+
"brokenlink",
|
|
445
|
+
"ttfb",
|
|
446
|
+
"httpheader",
|
|
447
|
+
"httpprotocol",
|
|
448
|
+
"mtr",
|
|
449
|
+
"loadtime",
|
|
450
|
+
"mixedcontent",
|
|
451
|
+
],
|
|
452
|
+
},
|
|
453
|
+
},
|
|
454
|
+
options: [
|
|
455
|
+
{
|
|
456
|
+
displayName: "Follow Redirect",
|
|
457
|
+
name: "followRedirect",
|
|
458
|
+
type: "boolean",
|
|
459
|
+
default: false,
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
displayName: "Proxy Country",
|
|
463
|
+
name: "proxyCountry",
|
|
464
|
+
type: "string",
|
|
465
|
+
default: "",
|
|
466
|
+
placeholder: "us, gb, de, in ...",
|
|
467
|
+
},
|
|
468
|
+
],
|
|
469
|
+
},
|
|
470
|
+
// ── URL to PDF ────────────────────────────────────────────────
|
|
471
|
+
{
|
|
472
|
+
displayName: "Additional Options",
|
|
473
|
+
name: "url2pdfOptions",
|
|
474
|
+
type: "collection",
|
|
475
|
+
placeholder: "Add Option",
|
|
476
|
+
default: {},
|
|
477
|
+
displayOptions: { show: { operation: ["url2pdf"] } },
|
|
478
|
+
options: [
|
|
479
|
+
{
|
|
480
|
+
displayName: "Add Timestamp",
|
|
481
|
+
name: "addTimestamp",
|
|
482
|
+
type: "boolean",
|
|
483
|
+
default: false,
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
displayName: "Device",
|
|
487
|
+
name: "device",
|
|
488
|
+
type: "options",
|
|
489
|
+
options: [
|
|
490
|
+
{ name: "Desktop", value: "desktop" },
|
|
491
|
+
{ name: "Mobile", value: "mobile" },
|
|
492
|
+
],
|
|
493
|
+
default: "desktop",
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
displayName: "Hide Cookies Banner",
|
|
497
|
+
name: "hideCookie",
|
|
498
|
+
type: "boolean",
|
|
499
|
+
default: true,
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
displayName: "Margin Bottom (mm)",
|
|
503
|
+
name: "marginBottom",
|
|
504
|
+
type: "number",
|
|
505
|
+
default: 25,
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
displayName: "Margin Left (mm)",
|
|
509
|
+
name: "marginLeft",
|
|
510
|
+
type: "number",
|
|
511
|
+
default: 25,
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
displayName: "Margin Right (mm)",
|
|
515
|
+
name: "marginRight",
|
|
516
|
+
type: "number",
|
|
517
|
+
default: 25,
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
displayName: "Margin Top (mm)",
|
|
521
|
+
name: "marginTop",
|
|
522
|
+
type: "number",
|
|
523
|
+
default: 25,
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
displayName: "Orientation",
|
|
527
|
+
name: "orientation",
|
|
528
|
+
type: "options",
|
|
529
|
+
options: [
|
|
530
|
+
{ name: "Landscape", value: "landscape" },
|
|
531
|
+
{ name: "Portrait", value: "portrait" },
|
|
532
|
+
],
|
|
533
|
+
default: "portrait",
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
displayName: "Paper Format",
|
|
537
|
+
name: "format",
|
|
538
|
+
type: "options",
|
|
539
|
+
options: [
|
|
540
|
+
{ name: "A0", value: "a0" },
|
|
541
|
+
{ name: "A1", value: "a1" },
|
|
542
|
+
{ name: "A2", value: "a2" },
|
|
543
|
+
{ name: "A3", value: "a3" },
|
|
544
|
+
{ name: "A4", value: "a4" },
|
|
545
|
+
{ name: "A5", value: "a5" },
|
|
546
|
+
{ name: "A6", value: "a6" },
|
|
547
|
+
{ name: "Legal", value: "legal" },
|
|
548
|
+
{ name: "Letter", value: "letter" },
|
|
549
|
+
],
|
|
550
|
+
default: "a4",
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
displayName: "Proxy Country",
|
|
554
|
+
name: "proxyCountry",
|
|
555
|
+
type: "string",
|
|
556
|
+
default: "",
|
|
557
|
+
placeholder: "us, gb, de, in ...",
|
|
558
|
+
},
|
|
559
|
+
{ displayName: "Scale", name: "scale", type: "number", default: 1 },
|
|
560
|
+
{
|
|
561
|
+
displayName: "Skip CAPTCHA",
|
|
562
|
+
name: "skipCaptcha",
|
|
563
|
+
type: "boolean",
|
|
564
|
+
default: true,
|
|
565
|
+
},
|
|
566
|
+
],
|
|
567
|
+
},
|
|
568
|
+
// ── Open Port Scan ────────────────────────────────────────────
|
|
569
|
+
{
|
|
570
|
+
displayName: "Additional Options",
|
|
571
|
+
name: "openportOptions",
|
|
572
|
+
type: "collection",
|
|
573
|
+
placeholder: "Add Option",
|
|
574
|
+
default: {},
|
|
575
|
+
displayOptions: { show: { operation: ["openport"] } },
|
|
576
|
+
options: [
|
|
577
|
+
{
|
|
578
|
+
displayName: "Custom Port Ranges",
|
|
579
|
+
name: "portRanges",
|
|
580
|
+
type: "string",
|
|
581
|
+
default: "",
|
|
582
|
+
placeholder: "80,443,1000-1010",
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
displayName: "Top Ports",
|
|
586
|
+
name: "topPorts",
|
|
587
|
+
type: "options",
|
|
588
|
+
options: [
|
|
589
|
+
{ name: "Top 50", value: "50" },
|
|
590
|
+
{ name: "Top 100", value: "100" },
|
|
591
|
+
{ name: "Top 500", value: "500" },
|
|
592
|
+
{ name: "Top 1000", value: "1000" },
|
|
593
|
+
{ name: "Top 5000", value: "5000" },
|
|
594
|
+
],
|
|
595
|
+
default: "",
|
|
596
|
+
},
|
|
597
|
+
],
|
|
598
|
+
},
|
|
599
|
+
// ── Lighthouse ────────────────────────────────────────────────
|
|
600
|
+
{
|
|
601
|
+
displayName: "Additional Options",
|
|
602
|
+
name: "lighthouseOptions",
|
|
603
|
+
type: "collection",
|
|
604
|
+
placeholder: "Add Option",
|
|
605
|
+
default: {},
|
|
606
|
+
displayOptions: { show: { operation: ["lighthouse"] } },
|
|
607
|
+
options: [
|
|
608
|
+
{
|
|
609
|
+
displayName: "Device",
|
|
610
|
+
name: "device",
|
|
611
|
+
type: "options",
|
|
612
|
+
options: [
|
|
613
|
+
{ name: "Desktop", value: "desktop" },
|
|
614
|
+
{ name: "Mobile", value: "mobile" },
|
|
615
|
+
],
|
|
616
|
+
default: "desktop",
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
displayName: "Extra Parameters",
|
|
620
|
+
name: "parameters",
|
|
621
|
+
type: "string",
|
|
622
|
+
default: "",
|
|
623
|
+
placeholder: "--only-categories=seo",
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
displayName: "Follow Redirect",
|
|
627
|
+
name: "followRedirect",
|
|
628
|
+
type: "boolean",
|
|
629
|
+
default: false,
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
displayName: "Proxy Country",
|
|
633
|
+
name: "proxyCountry",
|
|
634
|
+
type: "string",
|
|
635
|
+
default: "",
|
|
636
|
+
placeholder: "us, gb, de, in ...",
|
|
637
|
+
},
|
|
638
|
+
],
|
|
639
|
+
},
|
|
640
|
+
// ── Search ────────────────────────────────────────────────────
|
|
641
|
+
{
|
|
642
|
+
displayName: "Search Query",
|
|
643
|
+
name: "query",
|
|
644
|
+
type: "string",
|
|
645
|
+
default: "",
|
|
646
|
+
required: true,
|
|
647
|
+
placeholder: "best running shoes",
|
|
648
|
+
displayOptions: { show: { operation: ["search"] } },
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
displayName: "Additional Options",
|
|
652
|
+
name: "searchOptions",
|
|
653
|
+
type: "collection",
|
|
654
|
+
placeholder: "Add Option",
|
|
655
|
+
default: {},
|
|
656
|
+
displayOptions: { show: { operation: ["search"] } },
|
|
657
|
+
options: [
|
|
658
|
+
{
|
|
659
|
+
displayName: "Category",
|
|
660
|
+
name: "category",
|
|
661
|
+
type: "options",
|
|
662
|
+
options: [
|
|
663
|
+
{ name: "Code", value: "code" },
|
|
664
|
+
{ name: "General", value: "general" },
|
|
665
|
+
{ name: "Research", value: "research" },
|
|
666
|
+
],
|
|
667
|
+
default: "general",
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
displayName: "Exclude Domains",
|
|
671
|
+
name: "excludeDomains",
|
|
672
|
+
type: "string",
|
|
673
|
+
default: "",
|
|
674
|
+
placeholder: "pinterest.com",
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
displayName: "Format",
|
|
678
|
+
name: "format",
|
|
679
|
+
type: "options",
|
|
680
|
+
options: [
|
|
681
|
+
{ name: "HTML", value: "html" },
|
|
682
|
+
{ name: "JSON", value: "json" },
|
|
683
|
+
{ name: "Markdown", value: "markdown" },
|
|
684
|
+
],
|
|
685
|
+
default: "json",
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
displayName: "Grounded Answer",
|
|
689
|
+
name: "groundedAnswer",
|
|
690
|
+
type: "boolean",
|
|
691
|
+
default: false,
|
|
692
|
+
description: "Whether to generate an AI answer synthesized from search results",
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
displayName: "Include Domains",
|
|
696
|
+
name: "includeDomains",
|
|
697
|
+
type: "string",
|
|
698
|
+
default: "",
|
|
699
|
+
placeholder: "reddit.com,stackoverflow.com",
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
displayName: "Location / Country",
|
|
703
|
+
name: "location",
|
|
704
|
+
type: "string",
|
|
705
|
+
default: "",
|
|
706
|
+
placeholder: "us, gb, de, in ...",
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
displayName: "Result Limit",
|
|
710
|
+
name: "limit",
|
|
711
|
+
type: "number",
|
|
712
|
+
default: 10,
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
displayName: "Scrape Limit",
|
|
716
|
+
name: "scrapeLimit",
|
|
717
|
+
type: "number",
|
|
718
|
+
default: 3,
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
displayName: "Scrape Results",
|
|
722
|
+
name: "scrape",
|
|
723
|
+
type: "boolean",
|
|
724
|
+
default: false,
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
displayName: "Source",
|
|
728
|
+
name: "source",
|
|
729
|
+
type: "options",
|
|
730
|
+
options: [
|
|
731
|
+
{ name: "Images", value: "images" },
|
|
732
|
+
{ name: "News", value: "news" },
|
|
733
|
+
{ name: "Web", value: "web" },
|
|
734
|
+
],
|
|
735
|
+
default: "web",
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
displayName: "Time Filter",
|
|
739
|
+
name: "time",
|
|
740
|
+
type: "string",
|
|
741
|
+
default: "",
|
|
742
|
+
placeholder: "any, d, w, m, y, d7, h6",
|
|
743
|
+
},
|
|
744
|
+
],
|
|
745
|
+
},
|
|
746
|
+
],
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
async execute() {
|
|
750
|
+
const items = this.getInputData();
|
|
751
|
+
const returnData = [];
|
|
752
|
+
const credentials = await this.getCredentials("geekflareApi");
|
|
753
|
+
const apiKey = credentials.apiKey;
|
|
754
|
+
const baseUrl = "https://api.geekflare.com";
|
|
755
|
+
for (let i = 0; i < items.length; i++) {
|
|
756
|
+
const operation = this.getNodeParameter("operation", i);
|
|
757
|
+
let body = {};
|
|
758
|
+
try {
|
|
759
|
+
if (operation === "webscraping") {
|
|
760
|
+
const url = this.getNodeParameter("url", i);
|
|
761
|
+
const format = this.getNodeParameter("format", i);
|
|
762
|
+
const opts = this.getNodeParameter("webscrapingOptions", i);
|
|
763
|
+
body = { url, format, ...stripEmpty(opts) };
|
|
764
|
+
}
|
|
765
|
+
else if (operation === "metascraping") {
|
|
766
|
+
const url = this.getNodeParameter("url", i);
|
|
767
|
+
const format = this.getNodeParameter("metaFormat", i);
|
|
768
|
+
const opts = this.getNodeParameter("metascrapingOptions", i);
|
|
769
|
+
body = { url, format, ...stripEmpty(opts) };
|
|
770
|
+
}
|
|
771
|
+
else if (operation === "screenshot") {
|
|
772
|
+
const url = this.getNodeParameter("url", i);
|
|
773
|
+
const opts = this.getNodeParameter("screenshotOptions", i);
|
|
774
|
+
body = { url, ...stripEmpty(opts) };
|
|
775
|
+
}
|
|
776
|
+
else if (operation === "dnsrecord") {
|
|
777
|
+
const url = this.getNodeParameter("url", i);
|
|
778
|
+
const types = this.getNodeParameter("types", i);
|
|
779
|
+
body = { url, types };
|
|
780
|
+
}
|
|
781
|
+
else if ([
|
|
782
|
+
"up",
|
|
783
|
+
"redirectcheck",
|
|
784
|
+
"brokenlink",
|
|
785
|
+
"ttfb",
|
|
786
|
+
"httpheader",
|
|
787
|
+
"httpprotocol",
|
|
788
|
+
"mtr",
|
|
789
|
+
"loadtime",
|
|
790
|
+
"mixedcontent",
|
|
791
|
+
].includes(operation)) {
|
|
792
|
+
const url = this.getNodeParameter("url", i);
|
|
793
|
+
const opts = this.getNodeParameter("commonOptions", i);
|
|
794
|
+
body = { url, ...stripEmpty(opts) };
|
|
795
|
+
}
|
|
796
|
+
else if (["tlsscan", "dnssec", "ping"].includes(operation)) {
|
|
797
|
+
const url = this.getNodeParameter("url", i);
|
|
798
|
+
body = { url };
|
|
799
|
+
}
|
|
800
|
+
else if (operation === "url2pdf") {
|
|
801
|
+
const url = this.getNodeParameter("url", i);
|
|
802
|
+
const opts = this.getNodeParameter("url2pdfOptions", i);
|
|
803
|
+
const flat = stripEmpty(opts);
|
|
804
|
+
const margin = {};
|
|
805
|
+
if (flat.marginTop !== undefined) {
|
|
806
|
+
margin.top = flat.marginTop;
|
|
807
|
+
delete flat.marginTop;
|
|
808
|
+
}
|
|
809
|
+
if (flat.marginBottom !== undefined) {
|
|
810
|
+
margin.bottom = flat.marginBottom;
|
|
811
|
+
delete flat.marginBottom;
|
|
812
|
+
}
|
|
813
|
+
if (flat.marginLeft !== undefined) {
|
|
814
|
+
margin.left = flat.marginLeft;
|
|
815
|
+
delete flat.marginLeft;
|
|
816
|
+
}
|
|
817
|
+
if (flat.marginRight !== undefined) {
|
|
818
|
+
margin.right = flat.marginRight;
|
|
819
|
+
delete flat.marginRight;
|
|
820
|
+
}
|
|
821
|
+
body = { url, ...flat };
|
|
822
|
+
if (Object.keys(margin).length > 0)
|
|
823
|
+
body.margin = margin;
|
|
824
|
+
}
|
|
825
|
+
else if (operation === "openport") {
|
|
826
|
+
const url = this.getNodeParameter("url", i);
|
|
827
|
+
const opts = this.getNodeParameter("openportOptions", i);
|
|
828
|
+
body = { url, ...stripEmpty(opts) };
|
|
829
|
+
}
|
|
830
|
+
else if (operation === "lighthouse") {
|
|
831
|
+
const url = this.getNodeParameter("url", i);
|
|
832
|
+
const opts = this.getNodeParameter("lighthouseOptions", i);
|
|
833
|
+
body = { url, ...stripEmpty(opts) };
|
|
834
|
+
}
|
|
835
|
+
else if (operation === "search") {
|
|
836
|
+
const query = this.getNodeParameter("query", i);
|
|
837
|
+
const opts = this.getNodeParameter("searchOptions", i);
|
|
838
|
+
body = { query, ...stripEmpty(opts) };
|
|
839
|
+
}
|
|
840
|
+
else {
|
|
841
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`, { itemIndex: i });
|
|
842
|
+
}
|
|
843
|
+
const response = await this.helpers.httpRequest({
|
|
844
|
+
method: "POST",
|
|
845
|
+
url: `${baseUrl}/${operation}`,
|
|
846
|
+
headers: {
|
|
847
|
+
"x-api-key": apiKey,
|
|
848
|
+
"Content-Type": "application/json",
|
|
849
|
+
},
|
|
850
|
+
body,
|
|
851
|
+
json: true,
|
|
852
|
+
});
|
|
853
|
+
returnData.push({
|
|
854
|
+
json: response,
|
|
855
|
+
pairedItem: { item: i },
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
catch (error) {
|
|
859
|
+
if (this.continueOnFail()) {
|
|
860
|
+
returnData.push({
|
|
861
|
+
json: { error: error.message },
|
|
862
|
+
pairedItem: { item: i },
|
|
863
|
+
});
|
|
864
|
+
continue;
|
|
865
|
+
}
|
|
866
|
+
throw error;
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
return [returnData];
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
exports.Geekflare = Geekflare;
|
|
873
|
+
function stripEmpty(obj) {
|
|
874
|
+
const result = {};
|
|
875
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
876
|
+
if (value !== "" && value !== null && value !== undefined && value !== 0) {
|
|
877
|
+
result[key] = value;
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
return result;
|
|
881
|
+
}
|
|
882
|
+
//# sourceMappingURL=Geekflare.node.js.map
|