@ixiam/n8n-nodes-civicrm 1.0.3 → 1.0.5

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.
@@ -14,24 +14,23 @@ export class CiviCrmApi implements ICredentialType {
14
14
  properties: {
15
15
  headers: {
16
16
  'X-Civi-Auth': '={{"Bearer " + $credentials.apiToken}}',
17
- 'Content-Type': 'application/x-www-form-urlencoded',
18
17
  },
19
18
  },
20
19
  };
21
20
 
22
- // Credential test button
21
+ // Credential test button (requerido por n8n)
23
22
  test = {
24
23
  request: {
25
24
  method: 'POST' as IHttpRequestMethods,
26
25
  url: '={{$credentials.baseUrl.replace(/\\/$/, "")}}/civicrm/ajax/api4/Contact/get',
27
26
  headers: {
28
27
  'X-Civi-Auth': '={{"Bearer " + $credentials.apiToken}}',
29
- 'Content-Type': 'application/x-www-form-urlencoded',
28
+ 'Content-Type': 'application/json',
30
29
  },
31
30
  body: {
32
- params: '={"limit":1}', // API4 compatible
31
+ limit: 1,
33
32
  },
34
- json: true,
33
+ // IMPORTANTE: no pongas json: true aquí, rompe el tipo de test
35
34
  },
36
35
  };
37
36
 
@@ -52,7 +51,7 @@ export class CiviCrmApi implements ICredentialType {
52
51
  typeOptions: { password: true },
53
52
  default: '',
54
53
  required: true,
55
- description: 'Sent as "X-Civi-Auth: Bearer <token>"',
54
+ description: 'Sent as "X-Civi-Auth: Bearer <token>"',
56
55
  },
57
56
  ];
58
57
  }
@@ -8,7 +8,6 @@ export declare class CiviCrmApi implements ICredentialType {
8
8
  properties: {
9
9
  headers: {
10
10
  'X-Civi-Auth': string;
11
- 'Content-Type': string;
12
11
  };
13
12
  };
14
13
  };
@@ -21,9 +20,8 @@ export declare class CiviCrmApi implements ICredentialType {
21
20
  'Content-Type': string;
22
21
  };
23
22
  body: {
24
- params: string;
23
+ limit: number;
25
24
  };
26
- json: boolean;
27
25
  };
28
26
  };
29
27
  properties: INodeProperties[];
@@ -11,23 +11,22 @@ class CiviCrmApi {
11
11
  properties: {
12
12
  headers: {
13
13
  'X-Civi-Auth': '={{"Bearer " + $credentials.apiToken}}',
14
- 'Content-Type': 'application/x-www-form-urlencoded',
15
14
  },
16
15
  },
17
16
  };
18
- // Credential test button
17
+ // Credential test button (requerido por n8n)
19
18
  this.test = {
20
19
  request: {
21
20
  method: 'POST',
22
21
  url: '={{$credentials.baseUrl.replace(/\\/$/, "")}}/civicrm/ajax/api4/Contact/get',
23
22
  headers: {
24
23
  'X-Civi-Auth': '={{"Bearer " + $credentials.apiToken}}',
25
- 'Content-Type': 'application/x-www-form-urlencoded',
24
+ 'Content-Type': 'application/json',
26
25
  },
27
26
  body: {
28
- params: '={"limit":1}', // API4 compatible
27
+ limit: 1,
29
28
  },
30
- json: true,
29
+ // IMPORTANTE: no pongas json: true aquí, rompe el tipo de test
31
30
  },
32
31
  };
33
32
  this.properties = [
@@ -47,7 +46,7 @@ class CiviCrmApi {
47
46
  typeOptions: { password: true },
48
47
  default: '',
49
48
  required: true,
50
- description: 'Sent as "X-Civi-Auth: Bearer &lt;token&gt;"',
49
+ description: 'Sent as "X-Civi-Auth: Bearer <token>"',
51
50
  },
52
51
  ];
53
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ixiam/n8n-nodes-civicrm",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
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": [