n8n-nodes-cala 0.4.5 → 0.4.9

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.
@@ -3,6 +3,7 @@ export declare class CalaApi implements ICredentialType {
3
3
  name: string;
4
4
  displayName: string;
5
5
  documentationUrl: string;
6
+ icon: "file:cala.svg";
6
7
  properties: INodeProperties[];
7
8
  authenticate: IAuthenticateGeneric;
8
9
  test: ICredentialTestRequest;
@@ -6,6 +6,7 @@ class CalaApi {
6
6
  this.name = 'calaApi';
7
7
  this.displayName = 'Cala API';
8
8
  this.documentationUrl = 'https://docs.cala.ai';
9
+ this.icon = 'file:cala.svg';
9
10
  this.properties = [
10
11
  {
11
12
  displayName: 'API Key',
@@ -30,8 +30,9 @@ class Cala {
30
30
  ],
31
31
  },
32
32
  },
33
- inputs: ['main'],
34
- outputs: ['main'],
33
+ usableAsTool: true,
34
+ inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
35
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
35
36
  credentials: [
36
37
  {
37
38
  name: 'calaApi',
@@ -64,10 +65,10 @@ class Cala {
64
65
  },
65
66
  options: [
66
67
  {
67
- name: 'Search',
68
- value: 'search',
69
- action: 'Search knowledge',
70
- description: 'Answer natural language questions with sourced, researched content',
68
+ name: 'Get Entity',
69
+ value: 'getEntity',
70
+ action: 'Get an entity',
71
+ description: 'Get the full profile of an entity by its numeric ID',
71
72
  },
72
73
  {
73
74
  name: 'Query',
@@ -75,18 +76,18 @@ class Cala {
75
76
  action: 'Query knowledge',
76
77
  description: 'Filter entities by attributes using structured dot-notation syntax',
77
78
  },
79
+ {
80
+ name: 'Search',
81
+ value: 'search',
82
+ action: 'Search knowledge',
83
+ description: 'Answer natural language questions with sourced, researched content',
84
+ },
78
85
  {
79
86
  name: 'Search Entities',
80
87
  value: 'searchEntities',
81
88
  action: 'Search entities',
82
89
  description: 'Find entities by name with fuzzy matching',
83
90
  },
84
- {
85
- name: 'Get Entity',
86
- value: 'getEntity',
87
- action: 'Get an entity',
88
- description: 'Get the full profile of an entity by its numeric ID',
89
- },
90
91
  ],
91
92
  default: 'search',
92
93
  },
@@ -161,55 +162,67 @@ class Cala {
161
162
  const resource = this.getNodeParameter('resource', 0);
162
163
  const operation = this.getNodeParameter('operation', 0);
163
164
  for (let i = 0; i < items.length; i++) {
164
- let response;
165
- if (resource === 'knowledge') {
166
- if (operation === 'search') {
167
- const query = this.getNodeParameter('query', i);
168
- response = await this.helpers.httpRequestWithAuthentication.call(this, 'calaApi', {
169
- method: 'POST',
170
- url: `${BASE_URL}/v1/knowledge/search`,
171
- body: { input: query },
172
- json: true,
173
- });
174
- }
175
- else if (operation === 'query') {
176
- const query = this.getNodeParameter('query', i);
177
- response = await this.helpers.httpRequestWithAuthentication.call(this, 'calaApi', {
178
- method: 'POST',
179
- url: `${BASE_URL}/v1/knowledge/query`,
180
- body: { input: query },
181
- json: true,
182
- });
183
- }
184
- else if (operation === 'searchEntities') {
185
- const name = this.getNodeParameter('name', i);
186
- const limit = this.getNodeParameter('limit', i);
187
- response = await this.helpers.httpRequestWithAuthentication.call(this, 'calaApi', {
188
- method: 'GET',
189
- url: `${BASE_URL}/v1/knowledge/entities`,
190
- qs: { name, limit },
191
- json: true,
192
- });
193
- }
194
- else if (operation === 'getEntity') {
195
- const entityId = this.getNodeParameter('entityId', i);
196
- response = await this.helpers.httpRequestWithAuthentication.call(this, 'calaApi', {
197
- method: 'GET',
198
- url: `${BASE_URL}/v1/knowledge/entities/${entityId}`,
199
- json: true,
200
- });
165
+ try {
166
+ let response;
167
+ if (resource === 'knowledge') {
168
+ if (operation === 'search') {
169
+ const query = this.getNodeParameter('query', i);
170
+ response = await this.helpers.httpRequestWithAuthentication.call(this, 'calaApi', {
171
+ method: 'POST',
172
+ url: `${BASE_URL}/v1/knowledge/search`,
173
+ body: { input: query },
174
+ json: true,
175
+ });
176
+ }
177
+ else if (operation === 'query') {
178
+ const query = this.getNodeParameter('query', i);
179
+ response = await this.helpers.httpRequestWithAuthentication.call(this, 'calaApi', {
180
+ method: 'POST',
181
+ url: `${BASE_URL}/v1/knowledge/query`,
182
+ body: { input: query },
183
+ json: true,
184
+ });
185
+ }
186
+ else if (operation === 'searchEntities') {
187
+ const name = this.getNodeParameter('name', i);
188
+ const limit = this.getNodeParameter('limit', i);
189
+ response = await this.helpers.httpRequestWithAuthentication.call(this, 'calaApi', {
190
+ method: 'GET',
191
+ url: `${BASE_URL}/v1/knowledge/entities`,
192
+ qs: { name, limit },
193
+ json: true,
194
+ });
195
+ }
196
+ else if (operation === 'getEntity') {
197
+ const entityId = this.getNodeParameter('entityId', i);
198
+ response = await this.helpers.httpRequestWithAuthentication.call(this, 'calaApi', {
199
+ method: 'GET',
200
+ url: `${BASE_URL}/v1/knowledge/entities/${entityId}`,
201
+ json: true,
202
+ });
203
+ }
204
+ else {
205
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`);
206
+ }
201
207
  }
202
208
  else {
203
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`);
209
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown resource: ${resource}`);
204
210
  }
211
+ returnData.push({
212
+ json: response,
213
+ pairedItem: { item: i },
214
+ });
205
215
  }
206
- else {
207
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown resource: ${resource}`);
216
+ catch (error) {
217
+ if (this.continueOnFail()) {
218
+ returnData.push({
219
+ json: { error: error.message },
220
+ pairedItem: { item: i },
221
+ });
222
+ continue;
223
+ }
224
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
208
225
  }
209
- returnData.push({
210
- json: response,
211
- pairedItem: { item: i },
212
- });
213
226
  }
214
227
  return [returnData];
215
228
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-cala",
3
- "version": "0.4.5",
3
+ "version": "0.4.9",
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",
@@ -49,7 +56,7 @@
49
56
  "typescript-eslint": "^8.53.1"
50
57
  },
51
58
  "peerDependencies": {
52
- "n8n-workflow": ">=1.0.0"
59
+ "n8n-workflow": "*"
53
60
  },
54
61
  "engines": {
55
62
  "node": ">=18",
@@ -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
+ }
@@ -1,16 +0,0 @@
1
- {
2
- "node": "n8n-nodes-cala.cala",
3
- "nodeVersion": "1.0",
4
- "codexVersion": "1.0",
5
- "categories": ["AI", "Data & Storage"],
6
- "subcategories": {
7
- "AI": ["Tools"]
8
- },
9
- "resources": {
10
- "primaryDocumentation": [
11
- {
12
- "url": "https://docs.cala.ai"
13
- }
14
- ]
15
- }
16
- }