n8n-nodes-confirm8 0.10.0 → 0.12.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
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# n8n-nodes-confirm8
|
|
2
|
+
|
|
3
|
+
Node simples para n8n que conecta com a API Confirm8.
|
|
4
|
+
|
|
5
|
+
## ✨ Características
|
|
6
|
+
|
|
7
|
+
- ✅ **Sem credenciais separadas** - Tudo configurado diretamente no node
|
|
8
|
+
- ✅ **Simples de usar** - Configure uma vez e use
|
|
9
|
+
- ✅ **Operações básicas** - Users e Clients
|
|
10
|
+
|
|
11
|
+
## 📦 Instalação
|
|
12
|
+
|
|
13
|
+
### Via n8n Interface
|
|
14
|
+
|
|
15
|
+
1. Settings → Community Nodes → Install
|
|
16
|
+
2. Digite: `n8n-nodes-confirm8`
|
|
17
|
+
3. **REINICIE o n8n**
|
|
18
|
+
|
|
19
|
+
### Via npm
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install n8n-nodes-confirm8
|
|
23
|
+
# Reinicie o n8n
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## 🚀 Como Usar
|
|
27
|
+
|
|
28
|
+
1. Adicione o node "API Confirm8" ao workflow
|
|
29
|
+
2. Configure os campos:
|
|
30
|
+
- **Base URL**: `https://api.confirm8.com`
|
|
31
|
+
- **Bearer Token**: Seu token
|
|
32
|
+
- **X-API-DOMAIN**: Seu domínio
|
|
33
|
+
- **X-APIKEY-TOKEN**: Sua chave
|
|
34
|
+
3. Escolha Resource e Operation
|
|
35
|
+
4. Execute!
|
|
36
|
+
|
|
37
|
+
## 📋 Operações Disponíveis
|
|
38
|
+
|
|
39
|
+
### User
|
|
40
|
+
- Get - Buscar usuário por ID
|
|
41
|
+
- Get All - Listar todos
|
|
42
|
+
- Create - Criar novo
|
|
43
|
+
- Update - Atualizar existente
|
|
44
|
+
|
|
45
|
+
### Client
|
|
46
|
+
- Get - Buscar cliente por ID
|
|
47
|
+
- Get All - Listar todos
|
|
48
|
+
|
|
49
|
+
## 🔧 Desenvolvimento
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm install
|
|
53
|
+
npm run build
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## 📄 Licença
|
|
57
|
+
|
|
58
|
+
MIT
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -15,4 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./nodes/Confirm8/ApiConfirm8.node"), exports);
|
|
18
|
-
__exportStar(require("./credentials/Confirm8Api.credentials"), exports);
|
|
@@ -17,13 +17,48 @@ class ApiConfirm8 {
|
|
|
17
17
|
},
|
|
18
18
|
inputs: ['main'],
|
|
19
19
|
outputs: ['main'],
|
|
20
|
-
|
|
20
|
+
properties: [
|
|
21
|
+
// API Configuration
|
|
21
22
|
{
|
|
22
|
-
|
|
23
|
+
displayName: 'Base URL',
|
|
24
|
+
name: 'baseUrl',
|
|
25
|
+
type: 'string',
|
|
26
|
+
default: '',
|
|
27
|
+
placeholder: 'https://api.confirm8.com',
|
|
23
28
|
required: true,
|
|
29
|
+
description: 'Base URL of your API',
|
|
24
30
|
},
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
{
|
|
32
|
+
displayName: 'Bearer Token',
|
|
33
|
+
name: 'bearerToken',
|
|
34
|
+
type: 'string',
|
|
35
|
+
typeOptions: {
|
|
36
|
+
password: true,
|
|
37
|
+
},
|
|
38
|
+
default: '',
|
|
39
|
+
required: true,
|
|
40
|
+
description: 'Bearer token for authentication',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
displayName: 'X-API-DOMAIN',
|
|
44
|
+
name: 'apiDomain',
|
|
45
|
+
type: 'string',
|
|
46
|
+
default: '',
|
|
47
|
+
required: true,
|
|
48
|
+
description: 'API Domain header value',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
displayName: 'X-APIKEY-TOKEN',
|
|
52
|
+
name: 'apiKeyToken',
|
|
53
|
+
type: 'string',
|
|
54
|
+
typeOptions: {
|
|
55
|
+
password: true,
|
|
56
|
+
},
|
|
57
|
+
default: '',
|
|
58
|
+
required: true,
|
|
59
|
+
description: 'API Key Token header value',
|
|
60
|
+
},
|
|
61
|
+
// Resource Selection
|
|
27
62
|
{
|
|
28
63
|
displayName: 'Resource',
|
|
29
64
|
name: 'resource',
|
|
@@ -187,6 +222,11 @@ class ApiConfirm8 {
|
|
|
187
222
|
const returnData = [];
|
|
188
223
|
for (let i = 0; i < items.length; i++) {
|
|
189
224
|
try {
|
|
225
|
+
// Get API configuration
|
|
226
|
+
const baseUrl = this.getNodeParameter('baseUrl', i);
|
|
227
|
+
const bearerToken = this.getNodeParameter('bearerToken', i);
|
|
228
|
+
const apiDomain = this.getNodeParameter('apiDomain', i);
|
|
229
|
+
const apiKeyToken = this.getNodeParameter('apiKeyToken', i);
|
|
190
230
|
const resource = this.getNodeParameter('resource', i);
|
|
191
231
|
const operation = this.getNodeParameter('operation', i);
|
|
192
232
|
let endpoint = '';
|
|
@@ -225,18 +265,23 @@ class ApiConfirm8 {
|
|
|
225
265
|
endpoint = `/clients/${clientId}`;
|
|
226
266
|
}
|
|
227
267
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
268
|
+
// Make the request
|
|
269
|
+
const url = `${baseUrl}${endpoint}`;
|
|
270
|
+
const options = {
|
|
271
|
+
method,
|
|
272
|
+
uri: url,
|
|
232
273
|
headers: {
|
|
274
|
+
'Authorization': `Bearer ${bearerToken}`,
|
|
275
|
+
'X-API-DOMAIN': apiDomain,
|
|
276
|
+
'X-APIKEY-TOKEN': apiKeyToken,
|
|
233
277
|
'Content-Type': 'application/json',
|
|
234
278
|
},
|
|
279
|
+
json: true,
|
|
235
280
|
};
|
|
236
281
|
if (method !== 'GET' && Object.keys(body).length > 0) {
|
|
237
|
-
|
|
282
|
+
options['body'] = body;
|
|
238
283
|
}
|
|
239
|
-
const responseData = await this.helpers.
|
|
284
|
+
const responseData = await this.helpers.request(options);
|
|
240
285
|
returnData.push({
|
|
241
286
|
json: responseData,
|
|
242
287
|
pairedItem: { item: i },
|
|
@@ -246,7 +291,7 @@ class ApiConfirm8 {
|
|
|
246
291
|
if (this.continueOnFail()) {
|
|
247
292
|
returnData.push({
|
|
248
293
|
json: {
|
|
249
|
-
error: error
|
|
294
|
+
error: error || 'Unknown Error',
|
|
250
295
|
},
|
|
251
296
|
pairedItem: { item: i },
|
|
252
297
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-confirm8",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "n8n node for Confirm8 API",
|
|
3
|
+
"version": "0.12.0",
|
|
4
|
+
"description": "Simple n8n node for Confirm8 API - no credentials needed",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Bill Hebert",
|
|
7
7
|
"keywords": [
|
|
@@ -20,9 +20,6 @@
|
|
|
20
20
|
"dev": "tsc --watch"
|
|
21
21
|
},
|
|
22
22
|
"n8n": {
|
|
23
|
-
"credentials": [
|
|
24
|
-
"dist/credentials/Confirm8Api.credentials.js"
|
|
25
|
-
],
|
|
26
23
|
"nodes": [
|
|
27
24
|
"dist/nodes/Confirm8/ApiConfirm8.node.js"
|
|
28
25
|
]
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ICredentialType, INodeProperties, ICredentialTestRequest, IHttpRequestOptions, ICredentialDataDecryptedObject } from 'n8n-workflow';
|
|
2
|
-
export declare class Confirm8Api implements ICredentialType {
|
|
3
|
-
name: string;
|
|
4
|
-
displayName: string;
|
|
5
|
-
documentationUrl: string;
|
|
6
|
-
properties: INodeProperties[];
|
|
7
|
-
test: ICredentialTestRequest;
|
|
8
|
-
authenticate(credentials: ICredentialDataDecryptedObject, requestOptions: IHttpRequestOptions): Promise<IHttpRequestOptions>;
|
|
9
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Confirm8Api = void 0;
|
|
4
|
-
class Confirm8Api {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.name = 'confirm8Api';
|
|
7
|
-
this.displayName = 'Confirm8 API';
|
|
8
|
-
this.documentationUrl = 'https://confirm8.com/api/docs';
|
|
9
|
-
this.properties = [
|
|
10
|
-
{
|
|
11
|
-
displayName: 'Base URL',
|
|
12
|
-
name: 'baseUrl',
|
|
13
|
-
type: 'string',
|
|
14
|
-
default: '',
|
|
15
|
-
placeholder: 'https://api.confirm8.com',
|
|
16
|
-
required: true,
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
displayName: 'Bearer Token',
|
|
20
|
-
name: 'bearerToken',
|
|
21
|
-
type: 'string',
|
|
22
|
-
typeOptions: {
|
|
23
|
-
password: true,
|
|
24
|
-
},
|
|
25
|
-
default: '',
|
|
26
|
-
required: true,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
displayName: 'X-API-DOMAIN',
|
|
30
|
-
name: 'apiDomain',
|
|
31
|
-
type: 'string',
|
|
32
|
-
default: '',
|
|
33
|
-
required: true,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
displayName: 'X-APIKEY-TOKEN',
|
|
37
|
-
name: 'apiKeyToken',
|
|
38
|
-
type: 'string',
|
|
39
|
-
typeOptions: {
|
|
40
|
-
password: true,
|
|
41
|
-
},
|
|
42
|
-
default: '',
|
|
43
|
-
required: true,
|
|
44
|
-
},
|
|
45
|
-
];
|
|
46
|
-
this.test = {
|
|
47
|
-
request: {
|
|
48
|
-
baseURL: '={{$credentials.baseUrl}}',
|
|
49
|
-
url: '/health',
|
|
50
|
-
method: 'GET',
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
async authenticate(credentials, requestOptions) {
|
|
55
|
-
requestOptions.baseURL = credentials.baseUrl;
|
|
56
|
-
requestOptions.headers = requestOptions.headers || {};
|
|
57
|
-
requestOptions.headers['Authorization'] = `Bearer ${credentials.bearerToken}`;
|
|
58
|
-
requestOptions.headers['X-API-DOMAIN'] = credentials.apiDomain;
|
|
59
|
-
requestOptions.headers['X-APIKEY-TOKEN'] = credentials.apiKeyToken;
|
|
60
|
-
return requestOptions;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
exports.Confirm8Api = Confirm8Api;
|