n8n-nodes-confirm8 0.5.0 β 0.7.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 +162 -0
- package/dist/credentials/ApiCustomCredentials.credentials.js +3 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +18 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# β
n8n-nodes-confirm8 - CORRIGIDO
|
|
2
|
+
|
|
3
|
+
## π΄ Problemas Encontrados e Corrigidos
|
|
4
|
+
|
|
5
|
+
### 1. **Nomenclatura dos Arquivos** βββ
|
|
6
|
+
Os arquivos enviados tinham **underscore** em vez de **ponto**:
|
|
7
|
+
|
|
8
|
+
**ANTES (Incorreto):**
|
|
9
|
+
```
|
|
10
|
+
ApiCustom_node.ts
|
|
11
|
+
ApiAgentNode_node.ts
|
|
12
|
+
ApiAgentTool_node.ts
|
|
13
|
+
ApiCustomCredentials_credentials.ts
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
**DEPOIS (Correto):**
|
|
17
|
+
```
|
|
18
|
+
ApiCustom.node.ts β
|
|
19
|
+
ApiAgentNode.node.ts β
|
|
20
|
+
ApiAgentTool.node.ts β
|
|
21
|
+
ApiCustomCredentials.credentials.ts β
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### 2. **Erro CrΓtico nas Credenciais** βββ
|
|
25
|
+
|
|
26
|
+
O mΓ©todo `authenticate()` estava usando `credentials.apiKey` que **nΓ£o existe**!
|
|
27
|
+
|
|
28
|
+
**ANTES (Incorreto):**
|
|
29
|
+
```typescript
|
|
30
|
+
async authenticate(credentials, requestOptions) {
|
|
31
|
+
requestOptions.headers.Authorization = `Bearer ${credentials.apiKey}`; // β apiKey nΓ£o existe!
|
|
32
|
+
return requestOptions;
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**DEPOIS (Correto):**
|
|
37
|
+
```typescript
|
|
38
|
+
async authenticate(credentials, requestOptions) {
|
|
39
|
+
requestOptions.headers = requestOptions.headers || {};
|
|
40
|
+
requestOptions.headers.Authorization = `Bearer ${credentials.bearerToken}`; // β
|
|
41
|
+
requestOptions.headers['X-API-DOMAIN'] = credentials.apiDomain as string; // β
|
|
42
|
+
requestOptions.headers['X-APIKEY-TOKEN'] = credentials.apiKeyToken as string; // β
|
|
43
|
+
return requestOptions;
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 3. **Index.ts Incorreto** βββ
|
|
48
|
+
|
|
49
|
+
O arquivo `nodes/index.ts` tinha imports errados.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## π Estrutura Final Correta
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
n8n-nodes-confirm8/
|
|
57
|
+
βββ nodes/
|
|
58
|
+
β βββ ApiCustom/
|
|
59
|
+
β β βββ ApiCustom.node.ts β
|
|
60
|
+
β β βββ ApiAgentNode.node.ts β
|
|
61
|
+
β β βββ ApiAgentTool.node.ts β
|
|
62
|
+
β β βββ api.svg
|
|
63
|
+
β β βββ api-agent.svg
|
|
64
|
+
β βββ index.ts β
|
|
65
|
+
βββ credentials/
|
|
66
|
+
β βββ ApiCustomCredentials.credentials.ts β
|
|
67
|
+
β βββ index.ts β
|
|
68
|
+
βββ index.ts β
|
|
69
|
+
βββ package.json
|
|
70
|
+
βββ tsconfig.json
|
|
71
|
+
βββ gulpfile.js
|
|
72
|
+
βββ LICENSE
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## π Como Usar Este Pacote Corrigido
|
|
78
|
+
|
|
79
|
+
### 1. Instalar DependΓͺncias
|
|
80
|
+
```bash
|
|
81
|
+
npm install
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 2. Compilar
|
|
85
|
+
```bash
|
|
86
|
+
npm run build
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### 3. Verificar se compilou corretamente
|
|
90
|
+
```bash
|
|
91
|
+
ls -la dist/
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
VocΓͺ deve ver:
|
|
95
|
+
```
|
|
96
|
+
dist/
|
|
97
|
+
βββ credentials/
|
|
98
|
+
β βββ ApiCustomCredentials.credentials.js
|
|
99
|
+
β βββ ApiCustomCredentials.credentials.d.ts
|
|
100
|
+
βββ nodes/
|
|
101
|
+
β βββ ApiCustom/
|
|
102
|
+
β βββ ApiCustom.node.js
|
|
103
|
+
β βββ ApiAgentNode.node.js
|
|
104
|
+
β βββ ApiAgentTool.node.js
|
|
105
|
+
βββ index.js
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### 4. Publicar no NPM
|
|
109
|
+
```bash
|
|
110
|
+
npm login
|
|
111
|
+
npm publish
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### 5. Instalar no n8n
|
|
115
|
+
```bash
|
|
116
|
+
# Via interface do n8n
|
|
117
|
+
Settings β Community Nodes β Install β n8n-nodes-confirm8
|
|
118
|
+
|
|
119
|
+
# OU via CLI
|
|
120
|
+
npm install n8n-nodes-confirm8
|
|
121
|
+
|
|
122
|
+
# IMPORTANTE: Sempre reinicie o n8n apΓ³s instalar!
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## β οΈ Por que deu erro antes?
|
|
128
|
+
|
|
129
|
+
1. **Nomenclatura:** n8n procura por `.node.ts`, nΓ£o `_node.ts`
|
|
130
|
+
2. **Credenciais:** O mΓ©todo authenticate estava chamando um campo que nΓ£o existia
|
|
131
|
+
3. **Imports:** Os paths estavam incorretos no index.ts
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## β¨ O que foi corrigido:
|
|
136
|
+
|
|
137
|
+
β
Renomeado: `_node.ts` β `.node.ts`
|
|
138
|
+
β
Renomeado: `_credentials.ts` β `.credentials.ts`
|
|
139
|
+
β
Corrigido: mΓ©todo `authenticate()` nas credenciais
|
|
140
|
+
β
Corrigido: todos os arquivos `index.ts`
|
|
141
|
+
β
Verificado: estrutura de pastas
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## π Teste Final
|
|
146
|
+
|
|
147
|
+
ApΓ³s build, verifique:
|
|
148
|
+
```bash
|
|
149
|
+
node -e "const pkg = require('./dist/index.js'); console.log('Nodes:', pkg.nodes.length); console.log('Credentials:', pkg.credentials.length);"
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Deve retornar:
|
|
153
|
+
```
|
|
154
|
+
Nodes: 3
|
|
155
|
+
Credentials: 1
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## π Pronto!
|
|
161
|
+
|
|
162
|
+
Agora seu pacote estΓ‘ 100% correto e pronto para ser publicado no NPM!
|
|
@@ -59,7 +59,9 @@ class ApiCustomCredentials {
|
|
|
59
59
|
}
|
|
60
60
|
async authenticate(credentials, requestOptions) {
|
|
61
61
|
requestOptions.headers = requestOptions.headers || {};
|
|
62
|
-
requestOptions.headers.Authorization = `Bearer ${credentials.
|
|
62
|
+
requestOptions.headers.Authorization = `Bearer ${credentials.bearerToken}`;
|
|
63
|
+
requestOptions.headers['X-API-DOMAIN'] = credentials.apiDomain;
|
|
64
|
+
requestOptions.headers['X-APIKEY-TOKEN'] = credentials.apiKeyToken;
|
|
63
65
|
return requestOptions;
|
|
64
66
|
}
|
|
65
67
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export * from "./nodes/ApiCustom/ApiCustom.node";
|
|
2
|
+
export * from "./nodes/ApiCustom/ApiAgentNode.node";
|
|
3
|
+
export * from "./nodes/ApiCustom/ApiAgentTool.node";
|
|
4
|
+
export * from "./credentials/ApiCustomCredentials.credentials";
|
|
5
|
+
import { ApiCustomNode } from "./nodes/ApiCustom/ApiCustom.node";
|
|
6
|
+
import { ApiCustomCredentials } from "./credentials/ApiCustomCredentials.credentials";
|
|
3
7
|
export declare const nodes: (typeof ApiCustomNode)[];
|
|
4
8
|
export declare const credentials: (typeof ApiCustomCredentials)[];
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
exports.credentials = exports.nodes = void 0;
|
|
18
|
+
__exportStar(require("./nodes/ApiCustom/ApiCustom.node"), exports);
|
|
19
|
+
__exportStar(require("./nodes/ApiCustom/ApiAgentNode.node"), exports);
|
|
20
|
+
__exportStar(require("./nodes/ApiCustom/ApiAgentTool.node"), exports);
|
|
21
|
+
__exportStar(require("./credentials/ApiCustomCredentials.credentials"), exports);
|
|
4
22
|
const ApiCustom_node_1 = require("./nodes/ApiCustom/ApiCustom.node");
|
|
5
23
|
const ApiAgentNode_node_1 = require("./nodes/ApiCustom/ApiAgentNode.node");
|
|
6
24
|
const ApiAgentTool_node_1 = require("./nodes/ApiCustom/ApiAgentTool.node");
|