n8n-nodes-cala 0.4.4 → 0.4.8

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',
@@ -32,6 +33,9 @@ class CalaApi {
32
33
  baseURL: 'https://api.cala.ai',
33
34
  url: '/v1/knowledge/entities',
34
35
  method: 'GET',
36
+ qs: {
37
+ name: 'test',
38
+ },
35
39
  },
36
40
  };
37
41
  }
@@ -16,8 +16,23 @@ class Cala {
16
16
  defaults: {
17
17
  name: 'Cala',
18
18
  },
19
- inputs: ['main'],
20
- outputs: ['main'],
19
+ codex: {
20
+ categories: ['AI'],
21
+ subcategories: {
22
+ AI: ['Tools'],
23
+ },
24
+ alias: ['cala', 'knowledge', 'search', 'ai', 'rag'],
25
+ resources: {
26
+ primaryDocumentation: [
27
+ {
28
+ url: 'https://cala.ai',
29
+ },
30
+ ],
31
+ },
32
+ },
33
+ usableAsTool: true,
34
+ inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
35
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
21
36
  credentials: [
22
37
  {
23
38
  name: 'calaApi',
@@ -50,10 +65,10 @@ class Cala {
50
65
  },
51
66
  options: [
52
67
  {
53
- name: 'Search',
54
- value: 'search',
55
- action: 'Search knowledge',
56
- 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',
57
72
  },
58
73
  {
59
74
  name: 'Query',
@@ -61,18 +76,18 @@ class Cala {
61
76
  action: 'Query knowledge',
62
77
  description: 'Filter entities by attributes using structured dot-notation syntax',
63
78
  },
79
+ {
80
+ name: 'Search',
81
+ value: 'search',
82
+ action: 'Search knowledge',
83
+ description: 'Answer natural language questions with sourced, researched content',
84
+ },
64
85
  {
65
86
  name: 'Search Entities',
66
87
  value: 'searchEntities',
67
88
  action: 'Search entities',
68
89
  description: 'Find entities by name with fuzzy matching',
69
90
  },
70
- {
71
- name: 'Get Entity',
72
- value: 'getEntity',
73
- action: 'Get an entity',
74
- description: 'Get the full profile of an entity by its numeric ID',
75
- },
76
91
  ],
77
92
  default: 'search',
78
93
  },
@@ -132,7 +147,7 @@ class Cala {
132
147
  name: 'entityId',
133
148
  type: 'number',
134
149
  required: true,
135
- default: 0,
150
+ default: null,
136
151
  description: 'The numeric ID of the entity to retrieve',
137
152
  displayOptions: {
138
153
  show: { resource: ['knowledge'], operation: ['getEntity'] },
@@ -147,55 +162,67 @@ class Cala {
147
162
  const resource = this.getNodeParameter('resource', 0);
148
163
  const operation = this.getNodeParameter('operation', 0);
149
164
  for (let i = 0; i < items.length; i++) {
150
- let response;
151
- if (resource === 'knowledge') {
152
- if (operation === 'search') {
153
- const query = this.getNodeParameter('query', i);
154
- response = await this.helpers.httpRequestWithAuthentication.call(this, 'calaApi', {
155
- method: 'POST',
156
- url: `${BASE_URL}/v1/knowledge/search`,
157
- body: { input: query },
158
- json: true,
159
- });
160
- }
161
- else if (operation === 'query') {
162
- const query = this.getNodeParameter('query', i);
163
- response = await this.helpers.httpRequestWithAuthentication.call(this, 'calaApi', {
164
- method: 'POST',
165
- url: `${BASE_URL}/v1/knowledge/query`,
166
- body: { input: query },
167
- json: true,
168
- });
169
- }
170
- else if (operation === 'searchEntities') {
171
- const name = this.getNodeParameter('name', i);
172
- const limit = this.getNodeParameter('limit', i);
173
- response = await this.helpers.httpRequestWithAuthentication.call(this, 'calaApi', {
174
- method: 'GET',
175
- url: `${BASE_URL}/v1/knowledge/entities`,
176
- qs: { name, limit },
177
- json: true,
178
- });
179
- }
180
- else if (operation === 'getEntity') {
181
- const entityId = this.getNodeParameter('entityId', i);
182
- response = await this.helpers.httpRequestWithAuthentication.call(this, 'calaApi', {
183
- method: 'GET',
184
- url: `${BASE_URL}/v1/knowledge/entities/${entityId}`,
185
- json: true,
186
- });
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
+ }
187
207
  }
188
208
  else {
189
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`);
209
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown resource: ${resource}`);
190
210
  }
211
+ returnData.push({
212
+ json: response,
213
+ pairedItem: { item: i },
214
+ });
191
215
  }
192
- else {
193
- 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);
194
225
  }
195
- returnData.push({
196
- json: response,
197
- pairedItem: { item: i },
198
- });
199
226
  }
200
227
  return [returnData];
201
228
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-cala",
3
- "version": "0.4.4",
3
+ "version": "0.4.8",
4
4
  "description": "n8n nodes for Cala AI knowledge search",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",
@@ -56,7 +56,7 @@
56
56
  "typescript-eslint": "^8.53.1"
57
57
  },
58
58
  "peerDependencies": {
59
- "n8n-workflow": ">=1.0.0"
59
+ "n8n-workflow": "*"
60
60
  },
61
61
  "engines": {
62
62
  "node": ">=18",
@@ -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
- }