@oliveiratco1/n8n-nodes-grid402 1.0.2 → 1.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/README.md +25 -4
- package/dist/nodes/Grid402/Grid402.node.js +306 -10
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @oliveiratco1/n8n-nodes-grid402 ⚡
|
|
2
2
|
|
|
3
|
-
Conector oficial de **Community Node para n8n** do **Grid402** (`https://grid402.online`) — Hub de
|
|
3
|
+
Conector oficial de **Community Node para n8n** do **Grid402** (`https://grid402.online`) — Hub de 31 Micro-Serviços de Dados Públicos Abertos, KYB Brasil (Receita Federal CNPJ, Simples/MEI, Sanções CGU CEIS/CNEP, Dossiê 360º com Veredito IA), Segurança Web3 (Token Safety, Chain Telemetry), SEC EDGAR, Auditoria CVE/OSV, Mercados Preditivos, Execução em Lote (Batch), Dias Úteis Bancários ANBIMA, Extração Web-to-Markdown e Verificação Zero-PII de E-mails Corporativos (via `POST`).
|
|
4
4
|
|
|
5
5
|
100% em conformidade com a **LGPD (Art. 1º)**, **GDPR (Recital 14)** e **Lei de Acesso à Informação (Lei nº 12.527/2011 - LAI)**: processa exclusivamente registros públicos de Pessoas Jurídicas e fatos técnicos de rede, com descarte estrito de dados pessoais (Zero-PII e Zero-Retention) e assinatura criptográfica de autenticidade (`_oracle_proof` ECDSA `secp256k1`).
|
|
6
6
|
|
|
@@ -25,7 +25,7 @@ No painel do seu n8n:
|
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
-
## 🛠️ Operações Incluídas (
|
|
28
|
+
## 🛠️ Operações Incluídas (31 Operações: Micro-Serviços + Gestão de Saldo)
|
|
29
29
|
|
|
30
30
|
- **KYB Brasil e Compliance Corporativo (Zero-PII):**
|
|
31
31
|
- `Dossiê 360º KYB Brasil + Veredito IA` (`APPROVED`, `FLAGGED`, `REJECTED` + Score 0-100 + Receita Federal + Simples/MEI + CGU CEIS/CNEP)
|
|
@@ -34,8 +34,16 @@ No painel do seu n8n:
|
|
|
34
34
|
- `Sanções CGU CEIS e CNEP por CNPJ`
|
|
35
35
|
- `Compliance Score 360 por CNPJ`
|
|
36
36
|
- `Auditoria KYB Global (CNPJ + OFAC + GLEIF LEI)`
|
|
37
|
-
- **
|
|
38
|
-
- `
|
|
37
|
+
- **Web3 Security, DeFi Guardrails e Telemetria Multi-Chain:**
|
|
38
|
+
- `Auditoria de Segurança de Token Multi-Chain` (`token-safety`: score 0-100, veredito, honeypot e liquidez DEX via GoPlus + DexScreener em Base, Ethereum, Polygon, Arbitrum e Solana)
|
|
39
|
+
- `Telemetria Multi-Chain` (`chain-telemetry`: bloco/slot, gas/priority fees, latência RPC e TVL DeFiLlama)
|
|
40
|
+
- **Mercados Financeiros, SEC EDGAR, Previsões e DevSecOps:**
|
|
41
|
+
- `Empresa & Filings SEC EDGAR EUA` (`sec-company`: CIK/Ticker, formulários 10-K/10-Q/8-K e fatos XBRL opcionais)
|
|
42
|
+
- `Mercados de Previsão Normalizados` (`prediction-markets`: Polymarket + Kalshi)
|
|
43
|
+
- `Auditoria de Vulnerabilidades OSV + CISA KEV` (`vuln-audit`: pacotes npm/PyPI/Go/Maven/Packagist/crates.io ou IDs CVE/GHSA)
|
|
44
|
+
- **Automação B2B, Batch, IA e RAG:**
|
|
45
|
+
- `Execução em Lote Multi-Serviço (POST /api/v1/batch)` (1 a 5 consultas em 1 chamada, cobrança exata por item e estorno automático no Session Pass em falhas)
|
|
46
|
+
- `Verificar E-mail Corporativo B2B Zero-PII (POST /api/v1/email-verify)` (Sintaxe RFC, MX, SPF, DMARC, disposable e score 0-100 via JSON body sem query string)
|
|
39
47
|
- `Extrair Site para Markdown Limpo / RAG` (Conversão anti-SSRF de páginas web para Markdown)
|
|
40
48
|
- **Financeiro, Calendário Bancário ANBIMA e Endereçamento:**
|
|
41
49
|
- `Dias Úteis Bancários ANBIMA (D+N)`
|
|
@@ -49,4 +57,17 @@ No painel do seu n8n:
|
|
|
49
57
|
- **Rede, Segurança e Identidade Global:**
|
|
50
58
|
- `Resolução DNS Autoritativa`, `Inspeção TLS/SSL`, `Inteligência BGP/ASN`, `Auditoria Completa de Domínio`, `GLEIF LEI`, `OFAC SDN / ONU` e `Notarização Criptográfica SHA-256 + ECDSA`.
|
|
51
59
|
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## 📦 Workflows Prontos para Importar no n8n (Copiar / Importar JSON)
|
|
63
|
+
|
|
64
|
+
No n8n, clique em **Workflows → Import from URL** (ou baixe o `.json` e use **Import from File**):
|
|
65
|
+
|
|
66
|
+
1. **Enriquecimento B2B + Dossiê KYB 360º (`email-verify` + `dossier` + `extract`):**
|
|
67
|
+
- Arquivo: [`examples/n8n/grid402_b2b_lead_kyb_enrichment_workflow.json`](https://github.com/oliveiratc/Grid402/blob/main/examples/n8n/grid402_b2b_lead_kyb_enrichment_workflow.json)
|
|
68
|
+
- Valida o e-mail corporativo (Zero-PII), consulta o Dossiê 360º com Veredito IA (`APPROVED`/`FLAGGED`/`REJECTED`) e extrai o site do lead em Markdown limpo.
|
|
69
|
+
2. **Compliance CNPJ + Endereçamento CEP (`compliance` + `cep`):**
|
|
70
|
+
- Arquivo: [`examples/n8n/grid402_cnpj_compliance_workflow.json`](https://github.com/oliveiratc/Grid402/blob/main/examples/n8n/grid402_cnpj_compliance_workflow.json)
|
|
71
|
+
- Cruza Receita Federal + Sanções CGU (CEIS/CNEP) + consulta CEP com código IBGE.
|
|
72
|
+
|
|
52
73
|
Licença MIT • Grid402 Network Intelligence (`https://grid402.online`)
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
class Grid402 {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.description = {
|
|
6
|
-
displayName: 'Grid402 (CNPJ, KYB 360,
|
|
6
|
+
displayName: 'Grid402 (CNPJ, KYB 360, Web3, SEC, Vuln & Batch)',
|
|
7
7
|
name: 'grid402',
|
|
8
8
|
icon: 'file:grid402.svg',
|
|
9
9
|
group: ['transform'],
|
|
10
10
|
version: 1,
|
|
11
11
|
subtitle: '={{$parameter["operation"]}}',
|
|
12
|
-
description: '
|
|
12
|
+
description: '31 APIs públicas verificáveis (Zero-PII): Token Safety, Prediction Markets, SEC EDGAR, Vuln Audit (OSV+KEV), Chain Telemetry, Multi-Service Batch, Dossiê KYB 360 IA, Receita Federal CNPJ, Simples/MEI, Sanções CGU, ANBIMA, Web-to-Markdown, Email Verify POST, GLEIF LEI, OFAC e DNS/SSL.',
|
|
13
13
|
defaults: {
|
|
14
14
|
name: 'Grid402',
|
|
15
15
|
},
|
|
@@ -53,8 +53,14 @@ class Grid402 {
|
|
|
53
53
|
{ name: 'Identidade Corporativa Global GLEIF LEI (2 cr)', value: 'lei', description: 'Consulta código ISO 17442 LEI em 200+ jurisdições (CC0 1.0)' },
|
|
54
54
|
{ name: 'Triagem Global OFAC SDN / ONU e AML Web3 (4 cr)', value: 'ofac', description: 'Triagem de sanções internacionais para carteiras 0x ou entidades' },
|
|
55
55
|
{ name: 'Notarização Criptográfica SHA-256 + ECDSA (1 cr)', value: 'notarize', description: 'Carimbo do tempo M2M e prova de existência Zero-Retention' },
|
|
56
|
+
{ name: 'Auditoria de Segurança de Token Multi-Chain (3 cr)', value: 'token-safety', description: 'Score de risco 0-100, veredito (SAFE/CAUTION/HIGH_RISK/CRITICAL), honeypot e liquidez DEX via GoPlus + DexScreener (Base, Ethereum, Polygon, Arbitrum, Solana)' },
|
|
57
|
+
{ name: 'Mercados de Previsão: Polymarket + Kalshi (2 cr)', value: 'prediction-markets', description: 'Probabilidades implícitas 0-100%, volume 24h e liquidez agregados do Polymarket e Kalshi' },
|
|
58
|
+
{ name: 'Empresa & Filings SEC EDGAR EUA (2 cr)', value: 'sec-company', description: 'Perfil corporativo SEC EDGAR (CIK/Ticker), formulários 10-K/10-Q/8-K e fatos financeiros XBRL opcionais' },
|
|
59
|
+
{ name: 'Auditoria de Vulnerabilidades OSV + CISA KEV (1 cr)', value: 'vuln-audit', description: 'Auditoria determinística de pacotes (npm, PyPI, Go, Maven, Packagist, crates.io) ou CVE/GHSA com CISA KEV' },
|
|
60
|
+
{ name: 'Telemetria Multi-Chain: RPC + TVL DeFiLlama (1 cr)', value: 'chain-telemetry', description: 'Altura de bloco/slot, gas/priority fees, latência RPC e TVL DeFiLlama (Base, Ethereum, Polygon, Arbitrum, Solana)' },
|
|
61
|
+
{ name: 'Execução em Lote Multi-Serviço: 1-5 Itens (Soma)', value: 'batch', description: 'Executa até 5 consultas Grid402 em 1 chamada POST (máx. 2 no sandbox) com cobrança exata e estorno automático por falha' },
|
|
56
62
|
{ name: 'Consultar Saldo do Session Pass (Gratuito)', value: 'pass-balance', description: 'Verifica créditos restantes, validade e Spend Controls do seu pass_g402_...' },
|
|
57
|
-
{ name: 'Status Geral dos
|
|
63
|
+
{ name: 'Status Geral dos 31 Serviços (Gratuito)', value: 'summary', description: 'Resumo de saúde e latência de todos os 31 serviços do Grid402' },
|
|
58
64
|
],
|
|
59
65
|
},
|
|
60
66
|
{
|
|
@@ -245,6 +251,216 @@ class Grid402 {
|
|
|
245
251
|
},
|
|
246
252
|
},
|
|
247
253
|
},
|
|
254
|
+
{
|
|
255
|
+
displayName: 'Endereço do Token (EVM 0x ou Solana Base58)',
|
|
256
|
+
name: 'tokenAddress',
|
|
257
|
+
type: 'string',
|
|
258
|
+
default: '',
|
|
259
|
+
placeholder: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
|
|
260
|
+
description: 'Contrato do token EVM (0x + 40 hex) ou mint Solana Base58',
|
|
261
|
+
displayOptions: {
|
|
262
|
+
show: {
|
|
263
|
+
operation: ['token-safety'],
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
displayName: 'Rede Blockchain (Chain)',
|
|
269
|
+
name: 'chain',
|
|
270
|
+
type: 'string',
|
|
271
|
+
default: '',
|
|
272
|
+
placeholder: 'base (ou ethereum, polygon, arbitrum, solana)',
|
|
273
|
+
description: 'Rede alvo (base, ethereum, polygon, arbitrum ou solana; deixe vazio para autodetecção em Token Safety ou padrão base em Chain Telemetry)',
|
|
274
|
+
displayOptions: {
|
|
275
|
+
show: {
|
|
276
|
+
operation: ['token-safety', 'chain-telemetry'],
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
displayName: 'Busca (Keyword)',
|
|
282
|
+
name: 'query',
|
|
283
|
+
type: 'string',
|
|
284
|
+
default: '',
|
|
285
|
+
placeholder: 'bitcoin',
|
|
286
|
+
description: 'Filtro opcional de busca por palavra-chave (parâmetro q)',
|
|
287
|
+
displayOptions: {
|
|
288
|
+
show: {
|
|
289
|
+
operation: ['prediction-markets'],
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
displayName: 'Fonte de Mercados',
|
|
295
|
+
name: 'pmSource',
|
|
296
|
+
type: 'options',
|
|
297
|
+
default: 'all',
|
|
298
|
+
options: [
|
|
299
|
+
{ name: 'Todas (Polymarket + Kalshi)', value: 'all' },
|
|
300
|
+
{ name: 'Polymarket', value: 'polymarket' },
|
|
301
|
+
{ name: 'Kalshi', value: 'kalshi' },
|
|
302
|
+
],
|
|
303
|
+
displayOptions: {
|
|
304
|
+
show: {
|
|
305
|
+
operation: ['prediction-markets'],
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
displayName: 'Status do Mercado',
|
|
311
|
+
name: 'pmStatus',
|
|
312
|
+
type: 'options',
|
|
313
|
+
default: 'active',
|
|
314
|
+
options: [
|
|
315
|
+
{ name: 'Ativos', value: 'active' },
|
|
316
|
+
{ name: 'Encerrados', value: 'closed' },
|
|
317
|
+
],
|
|
318
|
+
displayOptions: {
|
|
319
|
+
show: {
|
|
320
|
+
operation: ['prediction-markets'],
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
displayName: 'Ticker da Ação (EUA)',
|
|
326
|
+
name: 'ticker',
|
|
327
|
+
type: 'string',
|
|
328
|
+
default: '',
|
|
329
|
+
placeholder: 'AAPL',
|
|
330
|
+
description: 'Símbolo do ticker negociado nos EUA (ex.: AAPL, MSFT). Informe Ticker ou CIK.',
|
|
331
|
+
displayOptions: {
|
|
332
|
+
show: {
|
|
333
|
+
operation: ['sec-company'],
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
displayName: 'CIK SEC EDGAR (Opcional se Ticker informado)',
|
|
339
|
+
name: 'cik',
|
|
340
|
+
type: 'string',
|
|
341
|
+
default: '',
|
|
342
|
+
placeholder: '0000320193',
|
|
343
|
+
description: 'Central Index Key de 1 a 10 dígitos na SEC',
|
|
344
|
+
displayOptions: {
|
|
345
|
+
show: {
|
|
346
|
+
operation: ['sec-company'],
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
displayName: 'Formulários SEC (Opcional)',
|
|
352
|
+
name: 'forms',
|
|
353
|
+
type: 'string',
|
|
354
|
+
default: '',
|
|
355
|
+
placeholder: '10-K,10-Q,8-K',
|
|
356
|
+
description: 'Lista separada por vírgula de tipos de formulário SEC',
|
|
357
|
+
displayOptions: {
|
|
358
|
+
show: {
|
|
359
|
+
operation: ['sec-company'],
|
|
360
|
+
},
|
|
361
|
+
},
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
displayName: 'Limite de Resultados',
|
|
365
|
+
name: 'limit',
|
|
366
|
+
type: 'number',
|
|
367
|
+
default: 10,
|
|
368
|
+
description: 'Quantidade máxima de itens retornados (1-20 em Prediction Markets, 1-25 em SEC EDGAR)',
|
|
369
|
+
displayOptions: {
|
|
370
|
+
show: {
|
|
371
|
+
operation: ['prediction-markets', 'sec-company'],
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
displayName: 'Incluir Fatos XBRL (US-GAAP)',
|
|
377
|
+
name: 'includeFacts',
|
|
378
|
+
type: 'boolean',
|
|
379
|
+
default: false,
|
|
380
|
+
description: 'Quando ativo, inclui métricas financeiras XBRL US-GAAP limitadas a 8 MB',
|
|
381
|
+
displayOptions: {
|
|
382
|
+
show: {
|
|
383
|
+
operation: ['sec-company'],
|
|
384
|
+
},
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
displayName: 'ID da Vulnerabilidade (CVE / GHSA — Opcional)',
|
|
389
|
+
name: 'vulnId',
|
|
390
|
+
type: 'string',
|
|
391
|
+
default: '',
|
|
392
|
+
placeholder: 'CVE-2021-44228',
|
|
393
|
+
description: 'Consulte por ID direto (CVE/GHSA) OU informe Ecossistema + Pacote',
|
|
394
|
+
displayOptions: {
|
|
395
|
+
show: {
|
|
396
|
+
operation: ['vuln-audit'],
|
|
397
|
+
},
|
|
398
|
+
},
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
displayName: 'Ecossistema do Pacote',
|
|
402
|
+
name: 'ecosystem',
|
|
403
|
+
type: 'string',
|
|
404
|
+
default: 'npm',
|
|
405
|
+
placeholder: 'npm, PyPI, Go, Maven, Packagist, crates.io, NuGet, RubyGems',
|
|
406
|
+
description: 'Ecossistema do pacote para consulta no OSV.dev',
|
|
407
|
+
displayOptions: {
|
|
408
|
+
show: {
|
|
409
|
+
operation: ['vuln-audit'],
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
displayName: 'Nome do Pacote',
|
|
415
|
+
name: 'packageName',
|
|
416
|
+
type: 'string',
|
|
417
|
+
default: '',
|
|
418
|
+
placeholder: 'lodash',
|
|
419
|
+
description: 'Nome do pacote a auditar (ex.: lodash, requests)',
|
|
420
|
+
displayOptions: {
|
|
421
|
+
show: {
|
|
422
|
+
operation: ['vuln-audit'],
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
displayName: 'Versão do Pacote (Opcional)',
|
|
428
|
+
name: 'packageVersion',
|
|
429
|
+
type: 'string',
|
|
430
|
+
default: '',
|
|
431
|
+
placeholder: '4.17.20',
|
|
432
|
+
description: 'Versão específica para filtrar vulnerabilidades aplicáveis',
|
|
433
|
+
displayOptions: {
|
|
434
|
+
show: {
|
|
435
|
+
operation: ['vuln-audit'],
|
|
436
|
+
},
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
displayName: 'Itens do Lote (JSON Array, 1-5 itens)',
|
|
441
|
+
name: 'batchItems',
|
|
442
|
+
type: 'json',
|
|
443
|
+
default: '[\n {"service": "dns", "params": {"domain": "base.org"}},\n {"service": "chain-telemetry", "params": {"chain": "base"}}\n]',
|
|
444
|
+
description: 'Array JSON com 1 a 5 objetos {"service":"...","params":{...}} (máx. 2 itens em modo sandbox)',
|
|
445
|
+
displayOptions: {
|
|
446
|
+
show: {
|
|
447
|
+
operation: ['batch'],
|
|
448
|
+
},
|
|
449
|
+
},
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
displayName: 'Idempotency-Key (Opcional)',
|
|
453
|
+
name: 'idempotencyKey',
|
|
454
|
+
type: 'string',
|
|
455
|
+
default: '',
|
|
456
|
+
placeholder: 'batch-kyb-2026-001',
|
|
457
|
+
description: 'Chave opcional de idempotência para evitar cobrança duplicada em retries (TTL 300s)',
|
|
458
|
+
displayOptions: {
|
|
459
|
+
show: {
|
|
460
|
+
operation: ['batch'],
|
|
461
|
+
},
|
|
462
|
+
},
|
|
463
|
+
},
|
|
248
464
|
],
|
|
249
465
|
};
|
|
250
466
|
}
|
|
@@ -287,6 +503,13 @@ class Grid402 {
|
|
|
287
503
|
const isFreeOperation = operation === 'summary' || operation === 'pass-balance';
|
|
288
504
|
const qs = new URLSearchParams();
|
|
289
505
|
let path = `/api/v1/${operation}`;
|
|
506
|
+
let httpMethod = 'GET';
|
|
507
|
+
let requestBody;
|
|
508
|
+
|
|
509
|
+
const headers = {
|
|
510
|
+
'Accept': 'application/json',
|
|
511
|
+
'User-Agent': 'n8n-nodes-grid402/1.1.0',
|
|
512
|
+
};
|
|
290
513
|
|
|
291
514
|
if (operation === 'summary') {
|
|
292
515
|
path = '/status';
|
|
@@ -297,7 +520,9 @@ class Grid402 {
|
|
|
297
520
|
const cleanCnpj = String(getParam('cnpj', '')).replace(/\D/g, '');
|
|
298
521
|
qs.set('cnpj', cleanCnpj);
|
|
299
522
|
} else if (operation === 'email-verify') {
|
|
300
|
-
|
|
523
|
+
httpMethod = 'POST';
|
|
524
|
+
headers['Content-Type'] = 'application/json';
|
|
525
|
+
requestBody = JSON.stringify({ email: String(getParam('email', '')).trim() });
|
|
301
526
|
} else if (operation === 'extract') {
|
|
302
527
|
qs.set('url', String(getParam('url', '')).trim());
|
|
303
528
|
const maxChars = getParam('maxChars', 12000);
|
|
@@ -332,13 +557,80 @@ class Grid402 {
|
|
|
332
557
|
qs.set('content', String(getParam('content', '')));
|
|
333
558
|
} else if (operation === 'global-markets') {
|
|
334
559
|
qs.set('market', String(getParam('market', 'US')).trim());
|
|
560
|
+
} else if (operation === 'token-safety') {
|
|
561
|
+
const tokenAddress = String(getParam('tokenAddress', '') || getParam('address', '')).trim();
|
|
562
|
+
const chain = String(getParam('chain', '')).trim();
|
|
563
|
+
if (tokenAddress) qs.set('address', tokenAddress);
|
|
564
|
+
if (chain) qs.set('chain', chain);
|
|
565
|
+
} else if (operation === 'prediction-markets') {
|
|
566
|
+
const qVal = String(getParam('query', '') || getParam('q', '')).trim();
|
|
567
|
+
const sourceVal = String(getParam('pmSource', '') || getParam('source', 'all')).trim();
|
|
568
|
+
const statusVal = String(getParam('pmStatus', '') || getParam('status', 'active')).trim();
|
|
569
|
+
const limitVal = getParam('limit', 10);
|
|
570
|
+
if (qVal) qs.set('q', qVal);
|
|
571
|
+
if (sourceVal) qs.set('source', sourceVal);
|
|
572
|
+
if (statusVal) qs.set('status', statusVal);
|
|
573
|
+
if (limitVal !== '' && limitVal !== null && limitVal !== undefined) qs.set('limit', String(limitVal));
|
|
574
|
+
} else if (operation === 'sec-company') {
|
|
575
|
+
const tickerVal = String(getParam('ticker', '')).trim();
|
|
576
|
+
const cikVal = String(getParam('cik', '')).trim();
|
|
577
|
+
const formsVal = String(getParam('forms', '')).trim();
|
|
578
|
+
const limitVal = getParam('limit', 10);
|
|
579
|
+
const includeFactsVal = getParam('includeFacts', getParam('include_facts', false));
|
|
580
|
+
if (tickerVal) qs.set('ticker', tickerVal);
|
|
581
|
+
if (cikVal) qs.set('cik', cikVal);
|
|
582
|
+
if (formsVal) qs.set('forms', formsVal);
|
|
583
|
+
if (limitVal !== '' && limitVal !== null && limitVal !== undefined) qs.set('limit', String(limitVal));
|
|
584
|
+
if (includeFactsVal === true || includeFactsVal === 'true' || includeFactsVal === 1 || includeFactsVal === '1') {
|
|
585
|
+
qs.set('include_facts', 'true');
|
|
586
|
+
}
|
|
587
|
+
} else if (operation === 'vuln-audit') {
|
|
588
|
+
const vulnIdVal = String(getParam('vulnId', '') || getParam('id', '')).trim();
|
|
589
|
+
const ecoVal = String(getParam('ecosystem', '')).trim();
|
|
590
|
+
const pkgVal = String(getParam('packageName', '') || getParam('package', '')).trim();
|
|
591
|
+
const verVal = String(getParam('packageVersion', '') || getParam('version', '')).trim();
|
|
592
|
+
if (vulnIdVal && !pkgVal) {
|
|
593
|
+
qs.set('id', vulnIdVal);
|
|
594
|
+
} else {
|
|
595
|
+
if (ecoVal) qs.set('ecosystem', ecoVal);
|
|
596
|
+
if (pkgVal) qs.set('package', pkgVal);
|
|
597
|
+
if (verVal) qs.set('version', verVal);
|
|
598
|
+
if (vulnIdVal) qs.set('id', vulnIdVal);
|
|
599
|
+
}
|
|
600
|
+
} else if (operation === 'chain-telemetry') {
|
|
601
|
+
const chainVal = String(getParam('chain', 'base')).trim() || 'base';
|
|
602
|
+
qs.set('chain', chainVal);
|
|
603
|
+
} else if (operation === 'batch') {
|
|
604
|
+
httpMethod = 'POST';
|
|
605
|
+
headers['Content-Type'] = 'application/json';
|
|
606
|
+
const rawBatch = getParam('batchItems', getParam('items', '[]'));
|
|
607
|
+
let parsedItems;
|
|
608
|
+
try {
|
|
609
|
+
const decoded = typeof rawBatch === 'string' ? JSON.parse(rawBatch) : rawBatch;
|
|
610
|
+
parsedItems = Array.isArray(decoded) ? decoded : (decoded && Array.isArray(decoded.items) ? decoded.items : null);
|
|
611
|
+
} catch (parseErr) {
|
|
612
|
+
const errMsg = `JSON inválido em batchItems: ${parseErr.message}`;
|
|
613
|
+
if (canContinueOnFail()) {
|
|
614
|
+
returnData.push({ json: { error: 'InvalidBatchJSON', message: errMsg }, pairedItem: { item: i } });
|
|
615
|
+
continue;
|
|
616
|
+
}
|
|
617
|
+
throw new Error(errMsg);
|
|
618
|
+
}
|
|
619
|
+
if (!Array.isArray(parsedItems) || parsedItems.length === 0 || parsedItems.length > 5) {
|
|
620
|
+
const errMsg = 'Operação batch requer entre 1 e 5 itens em batchItems.';
|
|
621
|
+
if (canContinueOnFail()) {
|
|
622
|
+
returnData.push({ json: { error: 'InvalidBatchItems', message: errMsg }, pairedItem: { item: i } });
|
|
623
|
+
continue;
|
|
624
|
+
}
|
|
625
|
+
throw new Error(errMsg);
|
|
626
|
+
}
|
|
627
|
+
const idempKey = String(getParam('idempotencyKey', '') || getParam('idempotency_key', '')).trim();
|
|
628
|
+
if (idempKey) {
|
|
629
|
+
headers['Idempotency-Key'] = idempKey;
|
|
630
|
+
}
|
|
631
|
+
requestBody = JSON.stringify({ items: parsedItems });
|
|
335
632
|
}
|
|
336
633
|
|
|
337
|
-
const headers = {
|
|
338
|
-
'Accept': 'application/json',
|
|
339
|
-
'User-Agent': 'n8n-nodes-grid402/1.1.0',
|
|
340
|
-
};
|
|
341
|
-
|
|
342
634
|
let effectiveBaseUrl = baseUrl;
|
|
343
635
|
|
|
344
636
|
if (!isFreeOperation) {
|
|
@@ -390,7 +682,11 @@ class Grid402 {
|
|
|
390
682
|
const queryString = qs.toString();
|
|
391
683
|
const fullUrl = `${effectiveBaseUrl}${path}${queryString ? '?' + queryString : ''}`;
|
|
392
684
|
|
|
393
|
-
const
|
|
685
|
+
const fetchOpts = { method: httpMethod, headers };
|
|
686
|
+
if (requestBody !== undefined) {
|
|
687
|
+
fetchOpts.body = requestBody;
|
|
688
|
+
}
|
|
689
|
+
const response = await fetch(fullUrl, fetchOpts);
|
|
394
690
|
const data = await response.json().catch(() => ({ status: response.status }));
|
|
395
691
|
|
|
396
692
|
if (response.status === 402 || response.status === 429) {
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliveiratco1/n8n-nodes-grid402",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"description": "Official n8n Community Node for Grid402 -
|
|
7
|
+
"description": "Official n8n Community Node for Grid402 - 31 Verifiable Public Data, Token Safety, Prediction Markets, SEC EDGAR, Vuln Audit (OSV+CISA KEV), Chain Telemetry, Multi-Service Batch, Brazil KYB 360 (CNPJ, Simples/MEI, CGU Sanctions), ANBIMA Workdays, Web-to-Markdown, Zero-PII POST Email Verify, GLEIF LEI, OFAC and Network Utility APIs with Session Pass (Pix/Card/USDC) and ECDSA Oracle Proof.",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"n8n-community-node-package",
|
|
10
10
|
"n8n",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"LICENSE"
|
|
41
41
|
],
|
|
42
42
|
"scripts": {
|
|
43
|
+
"build": "node --check index.js && node --check dist/nodes/Grid402/Grid402.node.js && node --check dist/credentials/Grid402Api.credentials.js",
|
|
43
44
|
"test": "node test_n8n_node.cjs"
|
|
44
45
|
},
|
|
45
46
|
"n8n": {
|