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.
|
@@ -30,8 +30,9 @@ class Cala {
|
|
|
30
30
|
],
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
|
|
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: '
|
|
68
|
-
value: '
|
|
69
|
-
action: '
|
|
70
|
-
description: '
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
if (
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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
|
|
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
|
-
|
|
207
|
-
|
|
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.
|
|
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": "
|
|
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
|
-
"
|
|
62
|
-
|
|
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
|
-
}
|