@ixiam/n8n-nodes-civicrm 1.0.8 → 1.0.10
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.
|
@@ -1,40 +1,16 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
|
|
2
|
+
ICredentialDataDecryptedObject,
|
|
3
|
+
ICredentialTestFunctions,
|
|
4
|
+
ICredentialsDecrypted,
|
|
3
5
|
INodeProperties,
|
|
4
|
-
IHttpRequestMethods,
|
|
5
6
|
} from 'n8n-workflow';
|
|
6
7
|
|
|
7
|
-
export class CiviCrmApi
|
|
8
|
+
export class CiviCrmApi {
|
|
9
|
+
|
|
8
10
|
name = 'civiCrmApi';
|
|
9
11
|
displayName = 'CiviCRM API';
|
|
10
12
|
documentationUrl = 'https://docs.civicrm.org/dev/en/latest/api/';
|
|
11
13
|
|
|
12
|
-
// ✔ NECESARIO PARA QUE N8N ACEPTE EL TEST
|
|
13
|
-
extends = ['genericApi' as const];
|
|
14
|
-
|
|
15
|
-
authenticate = {
|
|
16
|
-
type: 'generic' as const,
|
|
17
|
-
properties: {
|
|
18
|
-
headers: {
|
|
19
|
-
'X-Civi-Auth': '={{"Bearer " + $credentials.apiToken}}',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
test = {
|
|
25
|
-
request: {
|
|
26
|
-
method: 'POST' as IHttpRequestMethods,
|
|
27
|
-
url: '={{$credentials.baseUrl.replace(/\\/$/, "")}}/civicrm/ajax/api4/Contact/get',
|
|
28
|
-
headers: {
|
|
29
|
-
'X-Civi-Auth': '={{"Bearer " + $credentials.apiToken}}',
|
|
30
|
-
'Content-Type': 'application/json',
|
|
31
|
-
},
|
|
32
|
-
body: {
|
|
33
|
-
limit: 1,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
14
|
properties: INodeProperties[] = [
|
|
39
15
|
{
|
|
40
16
|
displayName: 'Base URL',
|
|
@@ -52,4 +28,28 @@ export class CiviCrmApi implements ICredentialType {
|
|
|
52
28
|
required: true,
|
|
53
29
|
},
|
|
54
30
|
];
|
|
31
|
+
|
|
32
|
+
// ✔ Autenticación genérica (esto sí es válido)
|
|
33
|
+
authenticate = {
|
|
34
|
+
type: 'generic',
|
|
35
|
+
properties: {
|
|
36
|
+
headers: {
|
|
37
|
+
'X-Civi-Auth': '={{"Bearer " + $credentials.apiToken}}',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
test = {
|
|
43
|
+
httpRequest: {
|
|
44
|
+
method: 'POST',
|
|
45
|
+
url: '={{ $credentials.baseUrl.replace(/\\/$/, "") }}/civicrm/ajax/api4/Contact/get',
|
|
46
|
+
headers: {
|
|
47
|
+
'X-Civi-Auth': '={{ "Bearer " + $credentials.apiToken }}',
|
|
48
|
+
'Content-Type': 'application/json',
|
|
49
|
+
},
|
|
50
|
+
body: {
|
|
51
|
+
limit: 1,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
55
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare class CiviCrmApi
|
|
1
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class CiviCrmApi {
|
|
3
3
|
name: string;
|
|
4
4
|
displayName: string;
|
|
5
5
|
documentationUrl: string;
|
|
6
|
-
|
|
6
|
+
properties: INodeProperties[];
|
|
7
7
|
authenticate: {
|
|
8
|
-
type:
|
|
8
|
+
type: string;
|
|
9
9
|
properties: {
|
|
10
10
|
headers: {
|
|
11
11
|
'X-Civi-Auth': string;
|
|
@@ -13,8 +13,8 @@ export declare class CiviCrmApi implements ICredentialType {
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
test: {
|
|
16
|
-
|
|
17
|
-
method:
|
|
16
|
+
httpRequest: {
|
|
17
|
+
method: string;
|
|
18
18
|
url: string;
|
|
19
19
|
headers: {
|
|
20
20
|
'X-Civi-Auth': string;
|
|
@@ -25,5 +25,4 @@ export declare class CiviCrmApi implements ICredentialType {
|
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
-
properties: INodeProperties[];
|
|
29
28
|
}
|
|
@@ -6,8 +6,24 @@ class CiviCrmApi {
|
|
|
6
6
|
this.name = 'civiCrmApi';
|
|
7
7
|
this.displayName = 'CiviCRM API';
|
|
8
8
|
this.documentationUrl = 'https://docs.civicrm.org/dev/en/latest/api/';
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Base URL',
|
|
12
|
+
name: 'baseUrl',
|
|
13
|
+
type: 'string',
|
|
14
|
+
default: '',
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
displayName: 'API Token',
|
|
19
|
+
name: 'apiToken',
|
|
20
|
+
type: 'string',
|
|
21
|
+
typeOptions: { password: true },
|
|
22
|
+
default: '',
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
// ✔ Autenticación genérica (esto sí es válido)
|
|
11
27
|
this.authenticate = {
|
|
12
28
|
type: 'generic',
|
|
13
29
|
properties: {
|
|
@@ -17,11 +33,11 @@ class CiviCrmApi {
|
|
|
17
33
|
},
|
|
18
34
|
};
|
|
19
35
|
this.test = {
|
|
20
|
-
|
|
36
|
+
httpRequest: {
|
|
21
37
|
method: 'POST',
|
|
22
|
-
url: '={{$credentials.baseUrl.replace(/\\/$/, "")}}/civicrm/ajax/api4/Contact/get',
|
|
38
|
+
url: '={{ $credentials.baseUrl.replace(/\\/$/, "") }}/civicrm/ajax/api4/Contact/get',
|
|
23
39
|
headers: {
|
|
24
|
-
'X-Civi-Auth': '={{"Bearer " + $credentials.apiToken}}',
|
|
40
|
+
'X-Civi-Auth': '={{ "Bearer " + $credentials.apiToken }}',
|
|
25
41
|
'Content-Type': 'application/json',
|
|
26
42
|
},
|
|
27
43
|
body: {
|
|
@@ -29,23 +45,6 @@ class CiviCrmApi {
|
|
|
29
45
|
},
|
|
30
46
|
},
|
|
31
47
|
};
|
|
32
|
-
this.properties = [
|
|
33
|
-
{
|
|
34
|
-
displayName: 'Base URL',
|
|
35
|
-
name: 'baseUrl',
|
|
36
|
-
type: 'string',
|
|
37
|
-
default: '',
|
|
38
|
-
required: true,
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
displayName: 'API Token',
|
|
42
|
-
name: 'apiToken',
|
|
43
|
-
type: 'string',
|
|
44
|
-
typeOptions: { password: true },
|
|
45
|
-
default: '',
|
|
46
|
-
required: true,
|
|
47
|
-
},
|
|
48
|
-
];
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
50
|
exports.CiviCrmApi = CiviCrmApi;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ixiam/n8n-nodes-civicrm",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Full-featured CiviCRM API v4 integration for n8n with support for Contacts, Memberships, Groups, Relationships, Activities and structured sub-entities like Email, Phone, and Address.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|