n8n-nodes-cala 0.4.2 → 0.4.4

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 CHANGED
@@ -75,17 +75,74 @@ Ask a natural language question and get back a researched answer with sources.
75
75
 
76
76
  Filter entities by attributes using dot-notation syntax.
77
77
 
78
- **Input:** `"startups.location=Spain.funding>10M.funding<=50M"`
78
+ **Input:** `"startups.location=Spain.funding>10M"`
79
+
80
+ **Output:**
81
+ ```json
82
+ {
83
+ "results": [
84
+ {
85
+ "startup": "SeQura",
86
+ "sector": "Fintech / BNPL",
87
+ "hq": "Barcelona",
88
+ "funding_round": "Series D (Nov 2024)",
89
+ "amount": "~€410M (incl. debt)"
90
+ },
91
+ {
92
+ "startup": "TravelPerk",
93
+ "sector": "Business Travel SaaS",
94
+ "hq": "Barcelona",
95
+ "funding_round": "Series D (Nov 2024)"
96
+ }
97
+ ],
98
+ "entities": [
99
+ { "id": "df8ea521-f2b1-47f7-9b46-419e179d914b", "name": "SeQura", "entity_type": "Organization" },
100
+ { "id": "2f0da3c2-4d1d-41f5-b433-82df365c27de", "name": "TravelPerk", "entity_type": "Organization" }
101
+ ]
102
+ }
103
+ ```
79
104
 
80
105
  ### Search Entities
81
106
 
82
107
  Find entities by name (supports fuzzy matching). Returns a list of matches with IDs.
83
108
 
84
- **Input:** `"OpenAI"` returns entity IDs you can pass to **Get Entity**.
109
+ **Input:** `"OpenAI"` with limit `3`
110
+
111
+ **Output:**
112
+ ```json
113
+ {
114
+ "entities": [
115
+ { "id": "e5bb591a-d308-4aa5-9672-96046d366cde", "name": "OpenAI", "entity_type": "Organization" },
116
+ { "id": "7eacce50-c89f-44a8-b8e4-a41f543683f2", "name": "OpenAI Codex", "entity_type": "Product" },
117
+ { "id": "e849412b-dcee-4df1-9461-a7cbdb9c32c7", "name": "OpenAI, Inc.", "entity_type": "Organization" }
118
+ ]
119
+ }
120
+ ```
85
121
 
86
122
  ### Get Entity
87
123
 
88
- Get the full profile of an entity by its numeric ID (from Search or Search Entities results).
124
+ Get the full profile of an entity by its ID (from Search or Search Entities results).
125
+
126
+ **Input:** `"932ba22a-5310-4b21-bbb7-6b91741c8bb3"`
127
+
128
+ **Output:**
129
+ ```json
130
+ {
131
+ "properties": {
132
+ "name": {
133
+ "value": "Hydnum Steel",
134
+ "sources": [{ "name": "Cala AI", "document": "", "date": "2026-03-05" }]
135
+ },
136
+ "registered_address": {
137
+ "value": "Calle Serrano North 45, Madrid, Spain",
138
+ "sources": [{ "name": "CB Insights", "document": "https://www.cbinsights.com/company/hydnum-steel", "date": "2026-03-02" }]
139
+ }
140
+ },
141
+ "id": { "value": "932ba22a-5310-4b21-bbb7-6b91741c8bb3", "sources": [] },
142
+ "relationships": { "outgoing": {}, "incoming": {} },
143
+ "numerical_observations": []
144
+ }
145
+ ```
89
146
 
90
147
  ## Resources
91
148
 
@@ -1,8 +1,9 @@
1
- import { ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
1
+ import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
2
  export declare class CalaApi implements ICredentialType {
3
3
  name: string;
4
4
  displayName: string;
5
5
  documentationUrl: string;
6
6
  properties: INodeProperties[];
7
+ authenticate: IAuthenticateGeneric;
7
8
  test: ICredentialTestRequest;
8
9
  }
@@ -19,17 +19,19 @@ class CalaApi {
19
19
  description: 'Your Cala API key',
20
20
  },
21
21
  ];
22
- this.test = {
23
- request: {
24
- baseURL: 'https://api.cala.ai',
25
- url: '/v1/knowledge/search',
26
- method: 'POST',
22
+ this.authenticate = {
23
+ type: 'generic',
24
+ properties: {
27
25
  headers: {
28
26
  'X-API-KEY': '={{$credentials.apiKey}}',
29
27
  },
30
- body: {
31
- input: 'test',
32
- },
28
+ },
29
+ };
30
+ this.test = {
31
+ request: {
32
+ baseURL: 'https://api.cala.ai',
33
+ url: '/v1/knowledge/entities',
34
+ method: 'GET',
33
35
  },
34
36
  };
35
37
  }
@@ -144,12 +144,6 @@ class Cala {
144
144
  async execute() {
145
145
  const items = this.getInputData();
146
146
  const returnData = [];
147
- const credentials = await this.getCredentials('calaApi');
148
- const apiKey = credentials.apiKey;
149
- const headers = { 'Content-Type': 'application/json' };
150
- if (apiKey) {
151
- headers['X-API-KEY'] = apiKey;
152
- }
153
147
  const resource = this.getNodeParameter('resource', 0);
154
148
  const operation = this.getNodeParameter('operation', 0);
155
149
  for (let i = 0; i < items.length; i++) {
@@ -157,20 +151,18 @@ class Cala {
157
151
  if (resource === 'knowledge') {
158
152
  if (operation === 'search') {
159
153
  const query = this.getNodeParameter('query', i);
160
- response = await this.helpers.httpRequest({
154
+ response = await this.helpers.httpRequestWithAuthentication.call(this, 'calaApi', {
161
155
  method: 'POST',
162
156
  url: `${BASE_URL}/v1/knowledge/search`,
163
- headers,
164
157
  body: { input: query },
165
158
  json: true,
166
159
  });
167
160
  }
168
161
  else if (operation === 'query') {
169
162
  const query = this.getNodeParameter('query', i);
170
- response = await this.helpers.httpRequest({
163
+ response = await this.helpers.httpRequestWithAuthentication.call(this, 'calaApi', {
171
164
  method: 'POST',
172
165
  url: `${BASE_URL}/v1/knowledge/query`,
173
- headers,
174
166
  body: { input: query },
175
167
  json: true,
176
168
  });
@@ -178,20 +170,18 @@ class Cala {
178
170
  else if (operation === 'searchEntities') {
179
171
  const name = this.getNodeParameter('name', i);
180
172
  const limit = this.getNodeParameter('limit', i);
181
- response = await this.helpers.httpRequest({
173
+ response = await this.helpers.httpRequestWithAuthentication.call(this, 'calaApi', {
182
174
  method: 'GET',
183
175
  url: `${BASE_URL}/v1/knowledge/entities`,
184
- headers,
185
176
  qs: { name, limit },
186
177
  json: true,
187
178
  });
188
179
  }
189
180
  else if (operation === 'getEntity') {
190
181
  const entityId = this.getNodeParameter('entityId', i);
191
- response = await this.helpers.httpRequest({
182
+ response = await this.helpers.httpRequestWithAuthentication.call(this, 'calaApi', {
192
183
  method: 'GET',
193
184
  url: `${BASE_URL}/v1/knowledge/entities/${entityId}`,
194
- headers,
195
185
  json: true,
196
186
  });
197
187
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-cala",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "n8n nodes for Cala AI knowledge search",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",
@@ -23,6 +23,13 @@
23
23
  "bugs": {
24
24
  "url": "https://github.com/cala-ai/cala-n8n-node/issues"
25
25
  },
26
+ "scripts": {
27
+ "build": "tsc && gulp build:icons",
28
+ "dev": "tsc --watch",
29
+ "test": "jest",
30
+ "lint": "eslint nodes credentials",
31
+ "prepublishOnly": "npm run build"
32
+ },
26
33
  "files": [
27
34
  "dist",
28
35
  "LICENSE",
@@ -58,10 +65,5 @@
58
65
  "volta": {
59
66
  "node": "22.13.1"
60
67
  },
61
- "scripts": {
62
- "build": "tsc && gulp build:icons",
63
- "dev": "tsc --watch",
64
- "test": "jest",
65
- "lint": "eslint nodes credentials"
66
- }
67
- }
68
+ "packageManager": "pnpm@10.2.1"
69
+ }