n8n-nodes-couchbase 0.1.5 → 1.0.0
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 +133 -65
- package/dist/credentials/CouchbaseApi.credentials.d.ts +8 -0
- package/dist/credentials/CouchbaseApi.credentials.js +39 -0
- package/dist/credentials/CouchbaseApi.credentials.js.map +1 -0
- package/dist/credentials/ExampleCredentialsApi.credentials.d.ts +8 -0
- package/dist/credentials/ExampleCredentialsApi.credentials.js +46 -0
- package/dist/credentials/ExampleCredentialsApi.credentials.js.map +1 -0
- package/dist/credentials/HttpBinApi.credentials.d.ts +9 -0
- package/dist/credentials/HttpBinApi.credentials.js +43 -0
- package/dist/credentials/HttpBinApi.credentials.js.map +1 -0
- package/dist/nodes/Couchbase/Couchbase.node.d.ts +35 -0
- package/dist/nodes/Couchbase/Couchbase.node.js +303 -0
- package/dist/nodes/Couchbase/Couchbase.node.js.map +1 -0
- package/dist/nodes/Couchbase/Couchbase.node.json +18 -0
- package/dist/nodes/Couchbase/CouchbaseProperties.d.ts +16 -0
- package/dist/nodes/Couchbase/CouchbaseProperties.js +478 -0
- package/dist/nodes/Couchbase/CouchbaseProperties.js.map +1 -0
- package/dist/nodes/Couchbase/couchbase.dark.svg +14 -0
- package/dist/nodes/Couchbase/couchbase.svg +14 -0
- package/dist/nodes/ExampleNode/ExampleNode.node.d.ts +5 -0
- package/dist/nodes/ExampleNode/ExampleNode.node.js +59 -0
- package/dist/nodes/ExampleNode/ExampleNode.node.js.map +1 -0
- package/dist/nodes/HttpBin/HttpBin.node.d.ts +4 -0
- package/dist/nodes/HttpBin/HttpBin.node.js +55 -0
- package/dist/nodes/HttpBin/HttpBin.node.js.map +1 -0
- package/dist/nodes/HttpBin/HttpBin.node.json +18 -0
- package/dist/nodes/HttpBin/HttpVerbDescription.d.ts +3 -0
- package/dist/nodes/HttpBin/HttpVerbDescription.js +236 -0
- package/dist/nodes/HttpBin/HttpVerbDescription.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreCouchbase/VectorStoreCouchbase.node.d.ts +16 -0
- package/dist/nodes/vector_store/VectorStoreCouchbase/VectorStoreCouchbase.node.js +407 -0
- package/dist/nodes/vector_store/VectorStoreCouchbase/VectorStoreCouchbase.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreCouchbase/mongodb.dark.svg +3 -0
- package/dist/nodes/vector_store/VectorStoreCouchbase/mongodb.svg +3 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/__tests__/utils.test.d.ts +0 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/__tests__/utils.test.js +2 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/__tests__/utils.test.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/constants.d.ts +4 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/constants.js +45 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/constants.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.d.ts +15 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js +227 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.test.d.ts +0 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.test.js +2 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.test.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.d.ts +0 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.js +2 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/methods/listSearch.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/insertOperation.test.d.ts +0 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/insertOperation.test.js +2 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/insertOperation.test.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/loadOperation.test.d.ts +0 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/loadOperation.test.js +2 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/loadOperation.test.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/operationHandlers.test.d.ts +0 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/operationHandlers.test.js +2 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/operationHandlers.test.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/retrieveAsToolOperation.test.d.ts +0 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/retrieveAsToolOperation.test.js +2 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/retrieveAsToolOperation.test.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/retrieveOperation.test.d.ts +0 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/retrieveOperation.test.js +2 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/retrieveOperation.test.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/updateOperation.test.d.ts +0 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/updateOperation.test.js +2 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/__tests__/updateOperation.test.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.d.ts +5 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.js +22 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.d.ts +5 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.js +36 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.d.ts +5 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.js +34 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.d.ts +5 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js +43 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.d.ts +5 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.js +17 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.d.ts +5 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.js +40 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/types.d.ts +31 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/types.js +3 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/types.js.map +1 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/utils.d.ts +6 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/utils.js +22 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/utils.js.map +1 -0
- package/dist/nodes/vector_store/shared/processDocuments.d.ts +25 -0
- package/dist/nodes/vector_store/shared/processDocuments.js +46 -0
- package/dist/nodes/vector_store/shared/processDocuments.js.map +1 -0
- package/dist/package.json +29 -19
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/N8nBinaryLoader.d.ts +18 -0
- package/dist/utils/N8nBinaryLoader.js +159 -0
- package/dist/utils/N8nBinaryLoader.js.map +1 -0
- package/dist/utils/N8nJsonLoader.d.ts +11 -0
- package/dist/utils/N8nJsonLoader.js +67 -0
- package/dist/utils/N8nJsonLoader.js.map +1 -0
- package/dist/utils/N8nTool.d.ts +10 -0
- package/dist/utils/N8nTool.js +86 -0
- package/dist/utils/N8nTool.js.map +1 -0
- package/dist/utils/helpers.d.ts +23 -0
- package/dist/utils/helpers.js +172 -0
- package/dist/utils/helpers.js.map +1 -0
- package/dist/utils/logWrapper.d.ts +27 -0
- package/dist/utils/logWrapper.js +297 -0
- package/dist/utils/logWrapper.js.map +1 -0
- package/dist/utils/sharedFields.d.ts +6 -0
- package/dist/utils/sharedFields.js +122 -0
- package/dist/utils/sharedFields.js.map +1 -0
- package/package.json +35 -27
- package/dist/credentials/CouchbaseCredentialsApi.credentials.d.ts +0 -7
- package/dist/credentials/CouchbaseCredentialsApi.credentials.js +0 -50
- package/dist/credentials/CouchbaseCredentialsApi.credentials.js.map +0 -1
- package/dist/nodes/CouchbaseDB/CouchbaseNode.node.d.ts +0 -6
- package/dist/nodes/CouchbaseDB/CouchbaseNode.node.js +0 -206
- package/dist/nodes/CouchbaseDB/CouchbaseNode.node.js.map +0 -1
- package/dist/nodes/CouchbaseNode/CouchbaseNode.node.d.ts +0 -6
- package/dist/nodes/CouchbaseNode/CouchbaseNode.node.js +0 -293
- package/dist/nodes/CouchbaseNode/CouchbaseNode.node.js.map +0 -1
- /package/dist/nodes/{CouchbaseDB → Couchbase}/CBLogomark.svg +0 -0
- /package/dist/nodes/{CouchbaseNode/CBLogomark.svg → vector_store/VectorStoreCouchbase/couchbase.svg} +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-base.httpbin",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Development", "Developer Tools"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "http://httpbin.org/#/Auth/get_bearer"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "http://httpbin.org/"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.httpVerbFields = exports.httpVerbOperations = void 0;
|
|
4
|
+
exports.httpVerbOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: {
|
|
12
|
+
resource: ['httpVerb'],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
options: [
|
|
16
|
+
{
|
|
17
|
+
name: 'GET',
|
|
18
|
+
value: 'get',
|
|
19
|
+
description: 'Perform a GET request',
|
|
20
|
+
routing: {
|
|
21
|
+
request: {
|
|
22
|
+
method: 'GET',
|
|
23
|
+
url: '/get',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
action: 'Get a http verb',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'DELETE',
|
|
30
|
+
value: 'delete',
|
|
31
|
+
description: 'Perform a DELETE request',
|
|
32
|
+
routing: {
|
|
33
|
+
request: {
|
|
34
|
+
method: 'DELETE',
|
|
35
|
+
url: '/delete',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
action: 'Delete a http verb',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
default: 'get',
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
const getOperation = [
|
|
45
|
+
{
|
|
46
|
+
displayName: 'Type of Data',
|
|
47
|
+
name: 'typeofData',
|
|
48
|
+
default: 'queryParameter',
|
|
49
|
+
description: 'Select type of data to send [Query Parameters]',
|
|
50
|
+
displayOptions: {
|
|
51
|
+
show: {
|
|
52
|
+
resource: ['httpVerb'],
|
|
53
|
+
operation: ['get'],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
type: 'options',
|
|
57
|
+
options: [
|
|
58
|
+
{
|
|
59
|
+
name: 'Query',
|
|
60
|
+
value: 'queryParameter',
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
required: true,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
displayName: 'Query Parameters',
|
|
67
|
+
name: 'arguments',
|
|
68
|
+
default: {},
|
|
69
|
+
description: "The request's query parameters",
|
|
70
|
+
displayOptions: {
|
|
71
|
+
show: {
|
|
72
|
+
resource: ['httpVerb'],
|
|
73
|
+
operation: ['get'],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
options: [
|
|
77
|
+
{
|
|
78
|
+
name: 'keyvalue',
|
|
79
|
+
displayName: 'Key:Value',
|
|
80
|
+
values: [
|
|
81
|
+
{
|
|
82
|
+
displayName: 'Key',
|
|
83
|
+
name: 'key',
|
|
84
|
+
type: 'string',
|
|
85
|
+
default: '',
|
|
86
|
+
required: true,
|
|
87
|
+
description: 'Key of query parameter',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
displayName: 'Value',
|
|
91
|
+
name: 'value',
|
|
92
|
+
type: 'string',
|
|
93
|
+
default: '',
|
|
94
|
+
routing: {
|
|
95
|
+
send: {
|
|
96
|
+
property: '={{$parent.key}}',
|
|
97
|
+
type: 'query',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
required: true,
|
|
101
|
+
description: 'Value of query parameter',
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
type: 'fixedCollection',
|
|
107
|
+
typeOptions: {
|
|
108
|
+
multipleValues: true,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
];
|
|
112
|
+
const deleteOperation = [
|
|
113
|
+
{
|
|
114
|
+
displayName: 'Type of Data',
|
|
115
|
+
name: 'typeofData',
|
|
116
|
+
default: 'queryParameter',
|
|
117
|
+
description: 'Select type of data to send [Query Parameter Arguments, JSON-Body]',
|
|
118
|
+
displayOptions: {
|
|
119
|
+
show: {
|
|
120
|
+
resource: ['httpVerb'],
|
|
121
|
+
operation: ['delete'],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
options: [
|
|
125
|
+
{
|
|
126
|
+
name: 'Query',
|
|
127
|
+
value: 'queryParameter',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'JSON',
|
|
131
|
+
value: 'jsonData',
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
required: true,
|
|
135
|
+
type: 'options',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
displayName: 'Query Parameters',
|
|
139
|
+
name: 'arguments',
|
|
140
|
+
default: {},
|
|
141
|
+
description: "The request's query parameters",
|
|
142
|
+
displayOptions: {
|
|
143
|
+
show: {
|
|
144
|
+
resource: ['httpVerb'],
|
|
145
|
+
operation: ['delete'],
|
|
146
|
+
typeofData: ['queryParameter'],
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
options: [
|
|
150
|
+
{
|
|
151
|
+
name: 'keyvalue',
|
|
152
|
+
displayName: 'Key:Value',
|
|
153
|
+
values: [
|
|
154
|
+
{
|
|
155
|
+
displayName: 'Key',
|
|
156
|
+
name: 'key',
|
|
157
|
+
type: 'string',
|
|
158
|
+
default: '',
|
|
159
|
+
required: true,
|
|
160
|
+
description: 'Key of query parameter',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
displayName: 'Value',
|
|
164
|
+
name: 'value',
|
|
165
|
+
type: 'string',
|
|
166
|
+
default: '',
|
|
167
|
+
routing: {
|
|
168
|
+
send: {
|
|
169
|
+
property: '={{$parent.key}}',
|
|
170
|
+
type: 'query',
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
required: true,
|
|
174
|
+
description: 'Value of query parameter',
|
|
175
|
+
},
|
|
176
|
+
],
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
type: 'fixedCollection',
|
|
180
|
+
typeOptions: {
|
|
181
|
+
multipleValues: true,
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
displayName: 'JSON Object',
|
|
186
|
+
name: 'arguments',
|
|
187
|
+
default: {},
|
|
188
|
+
description: "The request's JSON properties",
|
|
189
|
+
displayOptions: {
|
|
190
|
+
show: {
|
|
191
|
+
resource: ['httpVerb'],
|
|
192
|
+
operation: ['delete'],
|
|
193
|
+
typeofData: ['jsonData'],
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
options: [
|
|
197
|
+
{
|
|
198
|
+
name: 'keyvalue',
|
|
199
|
+
displayName: 'Key:Value',
|
|
200
|
+
values: [
|
|
201
|
+
{
|
|
202
|
+
displayName: 'Key',
|
|
203
|
+
name: 'key',
|
|
204
|
+
type: 'string',
|
|
205
|
+
default: '',
|
|
206
|
+
required: true,
|
|
207
|
+
description: 'Key of JSON property',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
displayName: 'Value',
|
|
211
|
+
name: 'value',
|
|
212
|
+
type: 'string',
|
|
213
|
+
default: '',
|
|
214
|
+
routing: {
|
|
215
|
+
send: {
|
|
216
|
+
property: '={{$parent.key}}',
|
|
217
|
+
type: 'body',
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
required: true,
|
|
221
|
+
description: 'Value of JSON property',
|
|
222
|
+
},
|
|
223
|
+
],
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
type: 'fixedCollection',
|
|
227
|
+
typeOptions: {
|
|
228
|
+
multipleValues: true,
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
];
|
|
232
|
+
exports.httpVerbFields = [
|
|
233
|
+
...getOperation,
|
|
234
|
+
...deleteOperation,
|
|
235
|
+
];
|
|
236
|
+
//# sourceMappingURL=HttpVerbDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpVerbDescription.js","sourceRoot":"","sources":["../../../nodes/HttpBin/HttpVerbDescription.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ILoadOptionsFunctions } from 'n8n-workflow';
|
|
2
|
+
declare const VectorStoreCouchbase_base: {
|
|
3
|
+
new (): {
|
|
4
|
+
description: import("n8n-workflow").INodeTypeDescription;
|
|
5
|
+
methods: {
|
|
6
|
+
listSearch?: {
|
|
7
|
+
[key: string]: (this: ILoadOptionsFunctions, filter?: string, paginationToken?: string) => Promise<import("n8n-workflow").INodeListSearchResult>;
|
|
8
|
+
};
|
|
9
|
+
} | undefined;
|
|
10
|
+
execute(this: import("n8n-workflow").IExecuteFunctions): Promise<import("n8n-workflow").INodeExecutionData[][]>;
|
|
11
|
+
supplyData(this: import("n8n-workflow").ISupplyDataFunctions, itemIndex: number): Promise<import("n8n-workflow").SupplyData>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare class VectorStoreCouchbase extends VectorStoreCouchbase_base {
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VectorStoreCouchbase = void 0;
|
|
4
|
+
const couchbase_1 = require("@langchain/community/vectorstores/couchbase");
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const sharedFields_1 = require("../../../utils/sharedFields");
|
|
7
|
+
const createVectorStoreNode_1 = require("../shared/createVectorStoreNode/createVectorStoreNode");
|
|
8
|
+
const couchbase_2 = require("couchbase");
|
|
9
|
+
const mongoCollectionRLC = {
|
|
10
|
+
displayName: 'Couchbase Collection',
|
|
11
|
+
name: 'couchbaseCollection',
|
|
12
|
+
type: 'resourceLocator',
|
|
13
|
+
default: { mode: 'list', value: '' },
|
|
14
|
+
required: true,
|
|
15
|
+
modes: [
|
|
16
|
+
{
|
|
17
|
+
displayName: 'From List',
|
|
18
|
+
name: 'list',
|
|
19
|
+
type: 'list',
|
|
20
|
+
typeOptions: {
|
|
21
|
+
searchListMethod: 'couchbaseCollectionSearch',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
displayName: 'Name',
|
|
26
|
+
name: 'name',
|
|
27
|
+
type: 'string',
|
|
28
|
+
placeholder: 'e.g. my_collection',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
const couchbaseBucket = {
|
|
33
|
+
displayName: 'Couchbase Bucket',
|
|
34
|
+
name: 'couchbaseBucket',
|
|
35
|
+
type: 'resourceLocator',
|
|
36
|
+
default: { mode: 'list', value: '' },
|
|
37
|
+
required: true,
|
|
38
|
+
modes: [
|
|
39
|
+
{
|
|
40
|
+
displayName: 'From List',
|
|
41
|
+
name: 'list',
|
|
42
|
+
type: 'list',
|
|
43
|
+
typeOptions: {
|
|
44
|
+
searchListMethod: 'couchbaseBucketSearch',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
displayName: 'Name',
|
|
49
|
+
name: 'name',
|
|
50
|
+
type: 'string',
|
|
51
|
+
placeholder: 'e.g. my_bucket',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
const couchbaseScope = {
|
|
56
|
+
displayName: 'Couchbase Scope',
|
|
57
|
+
name: 'couchbaseScope',
|
|
58
|
+
type: 'resourceLocator',
|
|
59
|
+
default: { mode: 'list', value: '' },
|
|
60
|
+
required: true,
|
|
61
|
+
modes: [
|
|
62
|
+
{
|
|
63
|
+
displayName: 'From List',
|
|
64
|
+
name: 'list',
|
|
65
|
+
type: 'list',
|
|
66
|
+
typeOptions: {
|
|
67
|
+
searchListMethod: 'couchbaseScopeSearch',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
displayName: 'Name',
|
|
72
|
+
name: 'name',
|
|
73
|
+
type: 'string',
|
|
74
|
+
placeholder: 'e.g. my_scope',
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
};
|
|
78
|
+
const vectorIndexName = {
|
|
79
|
+
displayName: 'Vector Index Name',
|
|
80
|
+
name: 'vectorIndexName',
|
|
81
|
+
type: 'resourceLocator',
|
|
82
|
+
default: { mode: 'list', value: '' },
|
|
83
|
+
required: true,
|
|
84
|
+
description: 'The name of the vector index',
|
|
85
|
+
modes: [
|
|
86
|
+
{
|
|
87
|
+
displayName: 'From List',
|
|
88
|
+
name: 'list',
|
|
89
|
+
type: 'list',
|
|
90
|
+
typeOptions: {
|
|
91
|
+
searchListMethod: 'getCouchbaseSearchIndexes',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
displayName: 'Name',
|
|
96
|
+
name: 'name',
|
|
97
|
+
type: 'string',
|
|
98
|
+
placeholder: 'e.g. my_index',
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
};
|
|
102
|
+
const embeddingField = {
|
|
103
|
+
displayName: 'Embedding',
|
|
104
|
+
name: 'embedding',
|
|
105
|
+
type: 'string',
|
|
106
|
+
default: 'embedding',
|
|
107
|
+
description: 'The field with the embedding array',
|
|
108
|
+
required: true,
|
|
109
|
+
};
|
|
110
|
+
const metadataField = {
|
|
111
|
+
displayName: 'Metadata Field',
|
|
112
|
+
name: 'metadata_field',
|
|
113
|
+
type: 'string',
|
|
114
|
+
default: 'text',
|
|
115
|
+
description: 'The text field of the raw data',
|
|
116
|
+
required: true,
|
|
117
|
+
};
|
|
118
|
+
const sharedFields = [
|
|
119
|
+
couchbaseBucket,
|
|
120
|
+
couchbaseScope,
|
|
121
|
+
mongoCollectionRLC,
|
|
122
|
+
embeddingField,
|
|
123
|
+
metadataField,
|
|
124
|
+
vectorIndexName,
|
|
125
|
+
];
|
|
126
|
+
const mongoNamespaceField = {
|
|
127
|
+
displayName: 'Namespace',
|
|
128
|
+
name: 'namespace',
|
|
129
|
+
type: 'string',
|
|
130
|
+
description: 'Logical partition for documents. Uses metadata.namespace field for filtering.',
|
|
131
|
+
default: '',
|
|
132
|
+
};
|
|
133
|
+
const retrieveFields = [
|
|
134
|
+
{
|
|
135
|
+
displayName: 'Options',
|
|
136
|
+
name: 'options',
|
|
137
|
+
type: 'collection',
|
|
138
|
+
placeholder: 'Add Option',
|
|
139
|
+
default: {},
|
|
140
|
+
options: [mongoNamespaceField, sharedFields_1.metadataFilterField],
|
|
141
|
+
},
|
|
142
|
+
];
|
|
143
|
+
const insertFields = [
|
|
144
|
+
{
|
|
145
|
+
displayName: 'Options',
|
|
146
|
+
name: 'options',
|
|
147
|
+
type: 'collection',
|
|
148
|
+
placeholder: 'Add Option',
|
|
149
|
+
default: {},
|
|
150
|
+
options: [
|
|
151
|
+
{
|
|
152
|
+
displayName: 'Clear Namespace',
|
|
153
|
+
name: 'clearNamespace',
|
|
154
|
+
type: 'boolean',
|
|
155
|
+
default: false,
|
|
156
|
+
description: 'Whether to clear documents in the namespace before inserting new data',
|
|
157
|
+
},
|
|
158
|
+
mongoNamespaceField,
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
];
|
|
162
|
+
async function connectToCouchbase(context) {
|
|
163
|
+
console.log('connecting');
|
|
164
|
+
const credentials = await context.getCredentials('couchbaseApi');
|
|
165
|
+
console.log(credentials);
|
|
166
|
+
const connectionString = credentials.CouchbaseConnection;
|
|
167
|
+
const username = credentials.CouchbaseUsername;
|
|
168
|
+
const password = credentials.CouchbasePassword;
|
|
169
|
+
const couchbaseBucket = context.getNodeParameter('couchbaseBucket');
|
|
170
|
+
console.log('couchbaseBucket');
|
|
171
|
+
console.log(couchbaseBucket);
|
|
172
|
+
const couchbaseScope = context.getNodeParameter('couchbaseScope');
|
|
173
|
+
console.log('couchbaseScope');
|
|
174
|
+
console.log(couchbaseScope);
|
|
175
|
+
const couchbaseCollection = context.getNodeParameter('couchbaseCollection');
|
|
176
|
+
console.log('couchbaseCollection');
|
|
177
|
+
console.log(couchbaseCollection);
|
|
178
|
+
let cluster;
|
|
179
|
+
let collection;
|
|
180
|
+
try {
|
|
181
|
+
cluster = await (0, couchbase_2.connect)(connectionString, {
|
|
182
|
+
username: username,
|
|
183
|
+
password: password,
|
|
184
|
+
configProfile: 'wanDevelopment',
|
|
185
|
+
});
|
|
186
|
+
const bucket = cluster.bucket(couchbaseBucket.value);
|
|
187
|
+
collection = bucket.scope(couchbaseCollection.value).collection(couchbaseCollection.value);
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
throw error;
|
|
191
|
+
}
|
|
192
|
+
return { cluster, collection };
|
|
193
|
+
}
|
|
194
|
+
async function getCouchbaseSearchIndexes() {
|
|
195
|
+
const { cluster } = await connectToCouchbase(this);
|
|
196
|
+
try {
|
|
197
|
+
const searchIndexes = await cluster.searchIndexes().getAllIndexes();
|
|
198
|
+
const allIndexes = [];
|
|
199
|
+
for (const idx of searchIndexes) {
|
|
200
|
+
allIndexes.push({
|
|
201
|
+
name: `${idx.name}`,
|
|
202
|
+
value: `${idx.name}`
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
return { results: allIndexes };
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Error: ${error.message}`);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
async function couchbaseBucketSearch() {
|
|
212
|
+
const { cluster } = await connectToCouchbase(this);
|
|
213
|
+
try {
|
|
214
|
+
const buckets = await cluster.buckets().getAllBuckets();
|
|
215
|
+
const allBuckets = [];
|
|
216
|
+
for (const bucket of buckets) {
|
|
217
|
+
allBuckets.push({
|
|
218
|
+
name: `${bucket.name}`,
|
|
219
|
+
value: `${bucket.name}`
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
return { results: allBuckets };
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Error: ${error.message}`);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
async function couchbaseScopeSearch() {
|
|
229
|
+
const selectedBucket = this.getNodeParameter('couchbaseBucket');
|
|
230
|
+
const { cluster } = await connectToCouchbase(this);
|
|
231
|
+
try {
|
|
232
|
+
const bucket = cluster.bucket(selectedBucket.value);
|
|
233
|
+
const bucketManager = bucket.collections();
|
|
234
|
+
const scopes = await bucketManager.getAllScopes();
|
|
235
|
+
const allScopes = [];
|
|
236
|
+
for (const scope of scopes) {
|
|
237
|
+
allScopes.push({
|
|
238
|
+
name: `${scope.name}`,
|
|
239
|
+
value: `${scope.name}`
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
return { results: allScopes };
|
|
243
|
+
}
|
|
244
|
+
catch (error) {
|
|
245
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Error: ${error.message}`);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
async function couchbaseCollectionSearch() {
|
|
249
|
+
const { cluster } = await connectToCouchbase(this);
|
|
250
|
+
try {
|
|
251
|
+
const selectedBucket = this.getNodeParameter('couchbaseBucket');
|
|
252
|
+
const selectedScope = this.getNodeParameter('couchbaseScope');
|
|
253
|
+
const bucketName = selectedBucket.value;
|
|
254
|
+
const bucket = cluster.bucket(bucketName);
|
|
255
|
+
const bucketManager = bucket.collections();
|
|
256
|
+
const scopes = await bucketManager.getAllScopes();
|
|
257
|
+
const filteredScopes = selectedScope && selectedScope.value
|
|
258
|
+
? scopes.filter(scope => scope.name === selectedScope.value)
|
|
259
|
+
: scopes;
|
|
260
|
+
const allCollections = [];
|
|
261
|
+
for (const scope of filteredScopes) {
|
|
262
|
+
for (const collection of scope.collections) {
|
|
263
|
+
allCollections.push({
|
|
264
|
+
name: `${collection.name}`,
|
|
265
|
+
value: `${collection.name}`
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return { results: allCollections };
|
|
270
|
+
}
|
|
271
|
+
catch (error) {
|
|
272
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Error: ${error.message}`);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
class VectorStoreCouchbase extends (0, createVectorStoreNode_1.createVectorStoreNode)({
|
|
276
|
+
meta: {
|
|
277
|
+
displayName: 'Couchbase Vector Store',
|
|
278
|
+
name: 'vectorStoreCouchbase',
|
|
279
|
+
description: 'Work with your data in Couchbase Vector Store',
|
|
280
|
+
icon: { light: 'file:couchbase.svg', dark: 'file:couchbase.svg' },
|
|
281
|
+
docsUrl: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoremongodbatlas/',
|
|
282
|
+
credentials: [
|
|
283
|
+
{
|
|
284
|
+
name: 'couchbaseApi',
|
|
285
|
+
required: true,
|
|
286
|
+
},
|
|
287
|
+
],
|
|
288
|
+
operationModes: ['load', 'insert', 'retrieve', 'update', 'retrieve-as-tool'],
|
|
289
|
+
},
|
|
290
|
+
methods: { listSearch: { couchbaseBucketSearch, couchbaseCollectionSearch, couchbaseScopeSearch, getCouchbaseSearchIndexes } },
|
|
291
|
+
retrieveFields,
|
|
292
|
+
loadFields: retrieveFields,
|
|
293
|
+
insertFields,
|
|
294
|
+
sharedFields,
|
|
295
|
+
async getVectorStoreClient(context, _filter, embeddings, itemIndex) {
|
|
296
|
+
try {
|
|
297
|
+
try {
|
|
298
|
+
const couchbaseBucketName = context.getNodeParameter('couchbaseBucket', itemIndex, '', {
|
|
299
|
+
extractValue: true,
|
|
300
|
+
});
|
|
301
|
+
console.log('couchbaseBucketName');
|
|
302
|
+
console.log(couchbaseBucketName);
|
|
303
|
+
const couchbaseScopeName = context.getNodeParameter('couchbaseScope', itemIndex, '', {
|
|
304
|
+
extractValue: true,
|
|
305
|
+
});
|
|
306
|
+
console.log('couchbaseScopeName');
|
|
307
|
+
console.log(couchbaseScopeName);
|
|
308
|
+
const couchbaseCollectionName = context.getNodeParameter('couchbaseCollection', itemIndex, '', {
|
|
309
|
+
extractValue: true,
|
|
310
|
+
});
|
|
311
|
+
console.log('couchbaseCollectionName');
|
|
312
|
+
console.log(couchbaseCollectionName);
|
|
313
|
+
const couchbaseVectorIndexName = context.getNodeParameter('vectorIndexName', itemIndex, '', {
|
|
314
|
+
extractValue: true,
|
|
315
|
+
});
|
|
316
|
+
console.log('couchbaseVectorIndexName');
|
|
317
|
+
console.log(couchbaseVectorIndexName);
|
|
318
|
+
const embeddingFieldName = context.getNodeParameter('embedding', itemIndex, '', {
|
|
319
|
+
extractValue: true,
|
|
320
|
+
});
|
|
321
|
+
const metadataFieldName = context.getNodeParameter('metadata_field', itemIndex, '', {
|
|
322
|
+
extractValue: true,
|
|
323
|
+
});
|
|
324
|
+
console.log('embeddingFieldName');
|
|
325
|
+
console.log(embeddingFieldName);
|
|
326
|
+
console.log('metadataFieldName');
|
|
327
|
+
console.log(metadataFieldName);
|
|
328
|
+
const { cluster } = await connectToCouchbase(context);
|
|
329
|
+
const couchbaseConfig = {
|
|
330
|
+
cluster,
|
|
331
|
+
bucketName: couchbaseBucketName,
|
|
332
|
+
scopeName: couchbaseScopeName,
|
|
333
|
+
collectionName: couchbaseCollectionName,
|
|
334
|
+
indexName: 'color-test',
|
|
335
|
+
textKey: 'description',
|
|
336
|
+
embeddingKey: 'embedding_vector_dot',
|
|
337
|
+
};
|
|
338
|
+
console.log('yo');
|
|
339
|
+
console.log(couchbaseConfig);
|
|
340
|
+
const couchbaseVectorStore = couchbase_1.CouchbaseVectorStore.initialize(embeddings, couchbaseConfig);
|
|
341
|
+
return couchbaseVectorStore;
|
|
342
|
+
}
|
|
343
|
+
catch (error) {
|
|
344
|
+
throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Error: ${error.message}`, {
|
|
345
|
+
itemIndex,
|
|
346
|
+
description: 'Please check your MongoDB Atlas connection details',
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
finally {
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
catch (error) {
|
|
353
|
+
throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Error: ${error.message}`, {
|
|
354
|
+
itemIndex,
|
|
355
|
+
description: 'Please check your MongoDB Atlas connection details',
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
async populateVectorStore(context, embeddings, documents, itemIndex) {
|
|
360
|
+
try {
|
|
361
|
+
try {
|
|
362
|
+
const couchbaseBucketName = context.getNodeParameter('couchbaseBucket', itemIndex, '', {
|
|
363
|
+
extractValue: true,
|
|
364
|
+
});
|
|
365
|
+
const couchbaseScopeName = context.getNodeParameter('couchbaseScope', itemIndex, '', {
|
|
366
|
+
extractValue: true,
|
|
367
|
+
});
|
|
368
|
+
const couchbaseCollectionName = context.getNodeParameter('couchbaseCollection', itemIndex, '', {
|
|
369
|
+
extractValue: true,
|
|
370
|
+
});
|
|
371
|
+
const couchbaseVectorIndexName = context.getNodeParameter('vectorIndexName', itemIndex, '', {
|
|
372
|
+
extractValue: true,
|
|
373
|
+
});
|
|
374
|
+
const { cluster } = await connectToCouchbase(context);
|
|
375
|
+
const couchbaseConfig = {
|
|
376
|
+
cluster,
|
|
377
|
+
bucketName: couchbaseBucketName,
|
|
378
|
+
scopeName: couchbaseScopeName,
|
|
379
|
+
collectionName: couchbaseCollectionName,
|
|
380
|
+
indexName: couchbaseVectorIndexName,
|
|
381
|
+
};
|
|
382
|
+
console.log('hi');
|
|
383
|
+
console.log(couchbaseConfig);
|
|
384
|
+
const res = await couchbase_1.CouchbaseVectorStore.fromDocuments(documents, embeddings, couchbaseConfig);
|
|
385
|
+
console.log('res');
|
|
386
|
+
console.log(res);
|
|
387
|
+
}
|
|
388
|
+
catch (error) {
|
|
389
|
+
throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Error: ${error.message}`, {
|
|
390
|
+
itemIndex,
|
|
391
|
+
description: 'Please check your MongoDB Atlas connection details',
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
finally {
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
catch (error) {
|
|
398
|
+
throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Error: ${error.message}`, {
|
|
399
|
+
itemIndex,
|
|
400
|
+
description: 'Please check your MongoDB Atlas connection details',
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
}) {
|
|
405
|
+
}
|
|
406
|
+
exports.VectorStoreCouchbase = VectorStoreCouchbase;
|
|
407
|
+
//# sourceMappingURL=VectorStoreCouchbase.node.js.map
|