n8n-nodes-couchbase 0.1.5 → 1.1.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 +26 -52
- 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/nodes/Couchbase/Couchbase.node.d.ts +14 -0
- package/dist/nodes/Couchbase/Couchbase.node.js +173 -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 +511 -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/icons/couchbase.dark.svg +14 -0
- package/dist/nodes/icons/couchbase.svg +14 -0
- package/dist/nodes/vector_store/VectorStoreCouchbaseSearch/VectorStoreCouchbaseSearch.node.d.ts +16 -0
- package/dist/nodes/vector_store/VectorStoreCouchbaseSearch/VectorStoreCouchbaseSearch.node.js +335 -0
- package/dist/nodes/vector_store/VectorStoreCouchbaseSearch/VectorStoreCouchbaseSearch.node.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/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 +16 -0
- package/dist/nodes/vector_store/shared/processDocuments.js +28 -0
- package/dist/nodes/vector_store/shared/processDocuments.js.map +1 -0
- package/dist/package.json +37 -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/couchbase/connectToCouchbase.d.ts +6 -0
- package/dist/utils/couchbase/connectToCouchbase.js +88 -0
- package/dist/utils/couchbase/connectToCouchbase.js.map +1 -0
- package/dist/utils/couchbase/populateCouchbaseRLs.d.ts +25 -0
- package/dist/utils/couchbase/populateCouchbaseRLs.js +121 -0
- package/dist/utils/couchbase/populateCouchbaseRLs.js.map +1 -0
- package/dist/utils/couchbase/validateBucketScopeCollection.d.ts +2 -0
- package/dist/utils/couchbase/validateBucketScopeCollection.js +53 -0
- package/dist/utils/couchbase/validateBucketScopeCollection.js.map +1 -0
- package/dist/utils/helpers.d.ts +10 -0
- package/dist/utils/helpers.js +61 -0
- package/dist/utils/helpers.js.map +1 -0
- package/dist/utils/logWrapper.d.ts +20 -0
- package/dist/utils/logWrapper.js +285 -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 +43 -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/CBLogomark.svg +0 -350
- 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/CBLogomark.svg +0 -350
- 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
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMetadataFiltersValues = getMetadataFiltersValues;
|
|
4
|
+
exports.isBaseChatMemory = isBaseChatMemory;
|
|
5
|
+
exports.isBaseChatMessageHistory = isBaseChatMessageHistory;
|
|
6
|
+
exports.isToolsInstance = isToolsInstance;
|
|
7
|
+
exports.logAiEvent = logAiEvent;
|
|
8
|
+
exports.escapeSingleCurlyBrackets = escapeSingleCurlyBrackets;
|
|
9
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
10
|
+
function hasMethods(obj, ...methodNames) {
|
|
11
|
+
return methodNames.every((methodName) => typeof obj === 'object' &&
|
|
12
|
+
obj !== null &&
|
|
13
|
+
methodName in obj &&
|
|
14
|
+
typeof obj[methodName] === 'function');
|
|
15
|
+
}
|
|
16
|
+
function getMetadataFiltersValues(ctx, itemIndex) {
|
|
17
|
+
const options = ctx.getNodeParameter('options', itemIndex, {});
|
|
18
|
+
if (options.metadata) {
|
|
19
|
+
const { metadataValues: metadata } = options.metadata;
|
|
20
|
+
if (metadata.length > 0) {
|
|
21
|
+
return metadata.reduce((acc, { name, value }) => ({ ...acc, [name]: value }), {});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (options.searchFilterJson) {
|
|
25
|
+
return ctx.getNodeParameter('options.searchFilterJson', itemIndex, '', {
|
|
26
|
+
ensureType: 'object',
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
function isBaseChatMemory(obj) {
|
|
32
|
+
return hasMethods(obj, 'loadMemoryVariables', 'saveContext');
|
|
33
|
+
}
|
|
34
|
+
function isBaseChatMessageHistory(obj) {
|
|
35
|
+
return hasMethods(obj, 'getMessages', 'addMessage');
|
|
36
|
+
}
|
|
37
|
+
function isToolsInstance(model) {
|
|
38
|
+
var _a;
|
|
39
|
+
const namespace = (_a = model === null || model === void 0 ? void 0 : model.lc_namespace) !== null && _a !== void 0 ? _a : [];
|
|
40
|
+
return namespace.includes('tools');
|
|
41
|
+
}
|
|
42
|
+
function logAiEvent(executeFunctions, event, data) {
|
|
43
|
+
try {
|
|
44
|
+
executeFunctions.logAiEvent(event, data ? (0, n8n_workflow_1.jsonStringify)(data) : undefined);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
executeFunctions.logger.debug(`Error logging AI event: ${event}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function escapeSingleCurlyBrackets(text) {
|
|
51
|
+
if (text === undefined)
|
|
52
|
+
return undefined;
|
|
53
|
+
let result = text;
|
|
54
|
+
result = result
|
|
55
|
+
.replace(/(?<!{){{{(?!{)/g, '{{{{')
|
|
56
|
+
.replace(/(?<!})}}}(?!})/g, '}}}}')
|
|
57
|
+
.replace(/(?<!{){(?!{)/g, '{{')
|
|
58
|
+
.replace(/(?<!})}(?!})/g, '}}');
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../utils/helpers.ts"],"names":[],"mappings":";;AAqBA,4DAyBC;AAED,4CAEC;AAED,4DAEC;AAED,0CAIC;AAED,gCAUC;AAED,8DAgBC;AAvFD,+CAA6C;AAQ7C,SAAS,UAAU,CAAI,GAAY,EAAE,GAAG,WAAmC;IAC1E,OAAO,WAAW,CAAC,KAAK,CACvB,CAAC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K,uBAAL,KAAK,CAAW,YAAY,mCAAI,EAAE,CAAC;IAEtD,OAAO,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC;AAED,SAAgB,UAAU,CACzB,gBAA0D,EAC1D,KAAc,EACd,IAAkB;IAElB,IAAI,CAAC;QACJ,gBAAgB,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,IAAA,4BAAa,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC5E,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,2BAA2B,KAAK,EAAE,CAAC,CAAC;IACnE,CAAC;AACF,CAAC;AAED,SAAgB,yBAAyB,CAAC,IAAa;IACtD,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAEzC,IAAI,MAAM,GAAG,IAAI,CAAC;IAElB,MAAM,GAAG,MAAM;SAEb,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC;SAClC,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC;SAGlC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;SAE9B,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;IAEjC,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BaseChatMemory } from '@langchain/community/memory/chat_memory';
|
|
2
|
+
import type { BaseChatMessageHistory } from '@langchain/core/chat_history';
|
|
3
|
+
import type { Document } from '@langchain/core/documents';
|
|
4
|
+
import { Embeddings } from '@langchain/core/embeddings';
|
|
5
|
+
import { BaseRetriever } from '@langchain/core/retrievers';
|
|
6
|
+
import type { Tool } from '@langchain/core/tools';
|
|
7
|
+
import { VectorStore } from '@langchain/core/vectorstores';
|
|
8
|
+
import { TextSplitter } from '@langchain/textsplitters';
|
|
9
|
+
import type { BaseDocumentLoader } from 'langchain/dist/document_loaders/base';
|
|
10
|
+
import type { IExecuteFunctions, ISupplyDataFunctions, NodeConnectionType } from 'n8n-workflow';
|
|
11
|
+
import { N8nBinaryLoader } from './N8nBinaryLoader';
|
|
12
|
+
import { N8nJsonLoader } from './N8nJsonLoader';
|
|
13
|
+
export declare function callMethodAsync<T>(this: T, parameters: {
|
|
14
|
+
executeFunctions: IExecuteFunctions | ISupplyDataFunctions;
|
|
15
|
+
connectionType: NodeConnectionType;
|
|
16
|
+
currentNodeRunIndex: number;
|
|
17
|
+
method: (...args: any[]) => Promise<unknown>;
|
|
18
|
+
arguments: unknown[];
|
|
19
|
+
}): Promise<unknown>;
|
|
20
|
+
export declare function logWrapper(originalInstance: Tool | BaseChatMemory | BaseChatMessageHistory | BaseRetriever | Embeddings | Document[] | Document | BaseDocumentLoader | TextSplitter | VectorStore | N8nBinaryLoader | N8nJsonLoader, executeFunctions: IExecuteFunctions | ISupplyDataFunctions): BaseChatMemory | BaseChatMessageHistory | Tool | VectorStore | Embeddings | N8nBinaryLoader | TextSplitter | Document<Record<string, any>> | Document<Record<string, any>>[] | BaseDocumentLoader | N8nJsonLoader | BaseRetriever<Record<string, any>>;
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.callMethodAsync = callMethodAsync;
|
|
4
|
+
exports.logWrapper = logWrapper;
|
|
5
|
+
const embeddings_1 = require("@langchain/core/embeddings");
|
|
6
|
+
const retrievers_1 = require("@langchain/core/retrievers");
|
|
7
|
+
const vectorstores_1 = require("@langchain/core/vectorstores");
|
|
8
|
+
const textsplitters_1 = require("@langchain/textsplitters");
|
|
9
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
10
|
+
const helpers_1 = require("./helpers");
|
|
11
|
+
const N8nBinaryLoader_1 = require("./N8nBinaryLoader");
|
|
12
|
+
const N8nJsonLoader_1 = require("./N8nJsonLoader");
|
|
13
|
+
async function callMethodAsync(parameters) {
|
|
14
|
+
try {
|
|
15
|
+
return await parameters.method.call(this, ...parameters.arguments);
|
|
16
|
+
}
|
|
17
|
+
catch (e) {
|
|
18
|
+
const connectedNode = parameters.executeFunctions.getNode();
|
|
19
|
+
const error = new n8n_workflow_1.NodeOperationError(connectedNode, e, {
|
|
20
|
+
functionality: 'configuration-node',
|
|
21
|
+
});
|
|
22
|
+
const metadata = (0, n8n_workflow_1.parseErrorMetadata)(error);
|
|
23
|
+
parameters.executeFunctions.addOutputData(parameters.connectionType, parameters.currentNodeRunIndex, error, metadata);
|
|
24
|
+
if (error.message) {
|
|
25
|
+
if (!error.description) {
|
|
26
|
+
error.description = error.message;
|
|
27
|
+
}
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
throw new n8n_workflow_1.NodeOperationError(connectedNode, `Error on node "${connectedNode.name}" which is connected via input "${parameters.connectionType}"`, { functionality: 'configuration-node' });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function logWrapper(originalInstance, executeFunctions) {
|
|
34
|
+
return new Proxy(originalInstance, {
|
|
35
|
+
get: (target, prop) => {
|
|
36
|
+
let connectionType;
|
|
37
|
+
if ((0, helpers_1.isBaseChatMemory)(originalInstance)) {
|
|
38
|
+
if (prop === 'loadMemoryVariables' && 'loadMemoryVariables' in target) {
|
|
39
|
+
return async (values) => {
|
|
40
|
+
var _a;
|
|
41
|
+
connectionType = n8n_workflow_1.NodeConnectionTypes.AiMemory;
|
|
42
|
+
const { index } = executeFunctions.addInputData(connectionType, [
|
|
43
|
+
[{ json: { action: 'loadMemoryVariables', values } }],
|
|
44
|
+
]);
|
|
45
|
+
const response = (await callMethodAsync.call(target, {
|
|
46
|
+
executeFunctions,
|
|
47
|
+
connectionType,
|
|
48
|
+
currentNodeRunIndex: index,
|
|
49
|
+
method: target[prop],
|
|
50
|
+
arguments: [values],
|
|
51
|
+
}));
|
|
52
|
+
const chatHistory = (_a = response === null || response === void 0 ? void 0 : response.chat_history) !== null && _a !== void 0 ? _a : response;
|
|
53
|
+
executeFunctions.addOutputData(connectionType, index, [
|
|
54
|
+
[{ json: { action: 'loadMemoryVariables', chatHistory } }],
|
|
55
|
+
]);
|
|
56
|
+
return response;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
else if (prop === 'saveContext' && 'saveContext' in target) {
|
|
60
|
+
return async (input, output) => {
|
|
61
|
+
connectionType = n8n_workflow_1.NodeConnectionTypes.AiMemory;
|
|
62
|
+
const { index } = executeFunctions.addInputData(connectionType, [
|
|
63
|
+
[{ json: { action: 'saveContext', input, output } }],
|
|
64
|
+
]);
|
|
65
|
+
const response = (await callMethodAsync.call(target, {
|
|
66
|
+
executeFunctions,
|
|
67
|
+
connectionType,
|
|
68
|
+
currentNodeRunIndex: index,
|
|
69
|
+
method: target[prop],
|
|
70
|
+
arguments: [input, output],
|
|
71
|
+
}));
|
|
72
|
+
const chatHistory = await target.chatHistory.getMessages();
|
|
73
|
+
executeFunctions.addOutputData(connectionType, index, [
|
|
74
|
+
[{ json: { action: 'saveContext', chatHistory } }],
|
|
75
|
+
]);
|
|
76
|
+
return response;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if ((0, helpers_1.isBaseChatMessageHistory)(originalInstance)) {
|
|
81
|
+
if (prop === 'getMessages' && 'getMessages' in target) {
|
|
82
|
+
return async () => {
|
|
83
|
+
connectionType = n8n_workflow_1.NodeConnectionTypes.AiMemory;
|
|
84
|
+
const { index } = executeFunctions.addInputData(connectionType, [
|
|
85
|
+
[{ json: { action: 'getMessages' } }],
|
|
86
|
+
]);
|
|
87
|
+
const response = (await callMethodAsync.call(target, {
|
|
88
|
+
executeFunctions,
|
|
89
|
+
connectionType,
|
|
90
|
+
currentNodeRunIndex: index,
|
|
91
|
+
method: target[prop],
|
|
92
|
+
arguments: [],
|
|
93
|
+
}));
|
|
94
|
+
const payload = { action: 'getMessages', response };
|
|
95
|
+
executeFunctions.addOutputData(connectionType, index, [[{ json: payload }]]);
|
|
96
|
+
(0, helpers_1.logAiEvent)(executeFunctions, 'ai-messages-retrieved-from-memory', { response });
|
|
97
|
+
return response;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
else if (prop === 'addMessage' && 'addMessage' in target) {
|
|
101
|
+
return async (message) => {
|
|
102
|
+
connectionType = n8n_workflow_1.NodeConnectionTypes.AiMemory;
|
|
103
|
+
const payload = { action: 'addMessage', message };
|
|
104
|
+
const { index } = executeFunctions.addInputData(connectionType, [[{ json: payload }]]);
|
|
105
|
+
await callMethodAsync.call(target, {
|
|
106
|
+
executeFunctions,
|
|
107
|
+
connectionType,
|
|
108
|
+
currentNodeRunIndex: index,
|
|
109
|
+
method: target[prop],
|
|
110
|
+
arguments: [message],
|
|
111
|
+
});
|
|
112
|
+
(0, helpers_1.logAiEvent)(executeFunctions, 'ai-message-added-to-memory', { message });
|
|
113
|
+
executeFunctions.addOutputData(connectionType, index, [[{ json: payload }]]);
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (originalInstance instanceof retrievers_1.BaseRetriever) {
|
|
118
|
+
if (prop === 'getRelevantDocuments' && 'getRelevantDocuments' in target) {
|
|
119
|
+
return async (query, config) => {
|
|
120
|
+
var _a, _b, _c, _d;
|
|
121
|
+
connectionType = n8n_workflow_1.NodeConnectionTypes.AiRetriever;
|
|
122
|
+
const { index } = executeFunctions.addInputData(connectionType, [
|
|
123
|
+
[{ json: { query, config } }],
|
|
124
|
+
]);
|
|
125
|
+
const response = (await callMethodAsync.call(target, {
|
|
126
|
+
executeFunctions,
|
|
127
|
+
connectionType,
|
|
128
|
+
currentNodeRunIndex: index,
|
|
129
|
+
method: target[prop],
|
|
130
|
+
arguments: [query, config],
|
|
131
|
+
}));
|
|
132
|
+
const executionId = (_b = (_a = response[0]) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.executionId;
|
|
133
|
+
const workflowId = (_d = (_c = response[0]) === null || _c === void 0 ? void 0 : _c.metadata) === null || _d === void 0 ? void 0 : _d.workflowId;
|
|
134
|
+
const metadata = {};
|
|
135
|
+
if (executionId && workflowId) {
|
|
136
|
+
metadata.subExecution = {
|
|
137
|
+
executionId,
|
|
138
|
+
workflowId,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
(0, helpers_1.logAiEvent)(executeFunctions, 'ai-documents-retrieved', { query });
|
|
142
|
+
executeFunctions.addOutputData(connectionType, index, [[{ json: { response } }]], metadata);
|
|
143
|
+
return response;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (originalInstance instanceof embeddings_1.Embeddings) {
|
|
148
|
+
if (prop === 'embedDocuments' && 'embedDocuments' in target) {
|
|
149
|
+
return async (documents) => {
|
|
150
|
+
connectionType = n8n_workflow_1.NodeConnectionTypes.AiEmbedding;
|
|
151
|
+
const { index } = executeFunctions.addInputData(connectionType, [
|
|
152
|
+
[{ json: { documents } }],
|
|
153
|
+
]);
|
|
154
|
+
const response = (await callMethodAsync.call(target, {
|
|
155
|
+
executeFunctions,
|
|
156
|
+
connectionType,
|
|
157
|
+
currentNodeRunIndex: index,
|
|
158
|
+
method: target[prop],
|
|
159
|
+
arguments: [documents],
|
|
160
|
+
}));
|
|
161
|
+
(0, helpers_1.logAiEvent)(executeFunctions, 'ai-document-embedded');
|
|
162
|
+
executeFunctions.addOutputData(connectionType, index, [[{ json: { response } }]]);
|
|
163
|
+
return response;
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
if (prop === 'embedQuery' && 'embedQuery' in target) {
|
|
167
|
+
return async (query) => {
|
|
168
|
+
connectionType = n8n_workflow_1.NodeConnectionTypes.AiEmbedding;
|
|
169
|
+
const { index } = executeFunctions.addInputData(connectionType, [
|
|
170
|
+
[{ json: { query } }],
|
|
171
|
+
]);
|
|
172
|
+
const response = (await callMethodAsync.call(target, {
|
|
173
|
+
executeFunctions,
|
|
174
|
+
connectionType,
|
|
175
|
+
currentNodeRunIndex: index,
|
|
176
|
+
method: target[prop],
|
|
177
|
+
arguments: [query],
|
|
178
|
+
}));
|
|
179
|
+
(0, helpers_1.logAiEvent)(executeFunctions, 'ai-query-embedded');
|
|
180
|
+
executeFunctions.addOutputData(connectionType, index, [[{ json: { response } }]]);
|
|
181
|
+
return response;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (originalInstance instanceof N8nJsonLoader_1.N8nJsonLoader ||
|
|
186
|
+
originalInstance instanceof N8nBinaryLoader_1.N8nBinaryLoader) {
|
|
187
|
+
if (prop === 'processAll' && 'processAll' in target) {
|
|
188
|
+
return async (items) => {
|
|
189
|
+
connectionType = n8n_workflow_1.NodeConnectionTypes.AiDocument;
|
|
190
|
+
const { index } = executeFunctions.addInputData(connectionType, [items]);
|
|
191
|
+
const response = (await callMethodAsync.call(target, {
|
|
192
|
+
executeFunctions,
|
|
193
|
+
connectionType,
|
|
194
|
+
currentNodeRunIndex: index,
|
|
195
|
+
method: target[prop],
|
|
196
|
+
arguments: [items],
|
|
197
|
+
}));
|
|
198
|
+
executeFunctions.addOutputData(connectionType, index, [[{ json: { response } }]]);
|
|
199
|
+
return response;
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
if (prop === 'processItem' && 'processItem' in target) {
|
|
203
|
+
return async (item, itemIndex) => {
|
|
204
|
+
connectionType = n8n_workflow_1.NodeConnectionTypes.AiDocument;
|
|
205
|
+
const { index } = executeFunctions.addInputData(connectionType, [[item]]);
|
|
206
|
+
const response = (await callMethodAsync.call(target, {
|
|
207
|
+
executeFunctions,
|
|
208
|
+
connectionType,
|
|
209
|
+
currentNodeRunIndex: index,
|
|
210
|
+
method: target[prop],
|
|
211
|
+
arguments: [item, itemIndex],
|
|
212
|
+
}));
|
|
213
|
+
(0, helpers_1.logAiEvent)(executeFunctions, 'ai-document-processed');
|
|
214
|
+
executeFunctions.addOutputData(connectionType, index, [
|
|
215
|
+
[{ json: { response }, pairedItem: { item: itemIndex } }],
|
|
216
|
+
]);
|
|
217
|
+
return response;
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
if (originalInstance instanceof textsplitters_1.TextSplitter) {
|
|
222
|
+
if (prop === 'splitText' && 'splitText' in target) {
|
|
223
|
+
return async (text) => {
|
|
224
|
+
connectionType = n8n_workflow_1.NodeConnectionTypes.AiTextSplitter;
|
|
225
|
+
const { index } = executeFunctions.addInputData(connectionType, [
|
|
226
|
+
[{ json: { textSplitter: text } }],
|
|
227
|
+
]);
|
|
228
|
+
const response = (await callMethodAsync.call(target, {
|
|
229
|
+
executeFunctions,
|
|
230
|
+
connectionType,
|
|
231
|
+
currentNodeRunIndex: index,
|
|
232
|
+
method: target[prop],
|
|
233
|
+
arguments: [text],
|
|
234
|
+
}));
|
|
235
|
+
(0, helpers_1.logAiEvent)(executeFunctions, 'ai-text-split');
|
|
236
|
+
executeFunctions.addOutputData(connectionType, index, [[{ json: { response } }]]);
|
|
237
|
+
return response;
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
if ((0, helpers_1.isToolsInstance)(originalInstance)) {
|
|
242
|
+
if (prop === '_call' && '_call' in target) {
|
|
243
|
+
return async (query) => {
|
|
244
|
+
connectionType = n8n_workflow_1.NodeConnectionTypes.AiTool;
|
|
245
|
+
const { index } = executeFunctions.addInputData(connectionType, [
|
|
246
|
+
[{ json: { query } }],
|
|
247
|
+
]);
|
|
248
|
+
const response = (await callMethodAsync.call(target, {
|
|
249
|
+
executeFunctions,
|
|
250
|
+
connectionType,
|
|
251
|
+
currentNodeRunIndex: index,
|
|
252
|
+
method: target[prop],
|
|
253
|
+
arguments: [query],
|
|
254
|
+
}));
|
|
255
|
+
(0, helpers_1.logAiEvent)(executeFunctions, 'ai-tool-called', { query, response });
|
|
256
|
+
executeFunctions.addOutputData(connectionType, index, [[{ json: { response } }]]);
|
|
257
|
+
return response;
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
if (originalInstance instanceof vectorstores_1.VectorStore) {
|
|
262
|
+
if (prop === 'similaritySearch' && 'similaritySearch' in target) {
|
|
263
|
+
return async (query, k, filter, _callbacks) => {
|
|
264
|
+
connectionType = n8n_workflow_1.NodeConnectionTypes.AiVectorStore;
|
|
265
|
+
const { index } = executeFunctions.addInputData(connectionType, [
|
|
266
|
+
[{ json: { query, k, filter } }],
|
|
267
|
+
]);
|
|
268
|
+
const response = (await callMethodAsync.call(target, {
|
|
269
|
+
executeFunctions,
|
|
270
|
+
connectionType,
|
|
271
|
+
currentNodeRunIndex: index,
|
|
272
|
+
method: target[prop],
|
|
273
|
+
arguments: [query, k, filter, _callbacks],
|
|
274
|
+
}));
|
|
275
|
+
(0, helpers_1.logAiEvent)(executeFunctions, 'ai-vector-store-searched', { query });
|
|
276
|
+
executeFunctions.addOutputData(connectionType, index, [[{ json: { response } }]]);
|
|
277
|
+
return response;
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return target[prop];
|
|
282
|
+
},
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
//# sourceMappingURL=logWrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logWrapper.js","sourceRoot":"","sources":["../../utils/logWrapper.ts"],"names":[],"mappings":";;AAyBA,0CAwCC;AAED,gCA2UC;AA1YD,2DAAwD;AAGxD,2DAA2D;AAE3D,+DAA2D;AAC3D,4DAAwD;AASxD,+CAA2F;AAE3F,uCAAoG;AACpG,uDAAoD;AACpD,mDAAgD;AAEzC,KAAK,UAAU,eAAe,CAEpC,UAMC;IAED,IAAI,CAAC;QACJ,OAAO,MAAM,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;IACpE,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACZ,MAAM,aAAa,GAAG,UAAU,CAAC,gB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AAE,CAAC;oBACjE,OAAO,KAAK,EACX,KAAa,EACb,CAAU,EACV,MAAqC,EACrC,UAAkC,EACZ,EAAE;wBACxB,cAAc,GAAG,kCAAmB,CAAC,aAAa,CAAC;wBACnD,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAgB,CAAC,YAAY,CAAC,cAAc,EAAE;4BAC/D,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;yBAChC,CAAC,CAAC;wBAEH,MAAM,QAAQ,GAAG,CAAC,MAAM,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE;4BACpD,gBAAgB;4BAChB,cAAc;4BACd,mBAAmB,EAAE,KAAK;4BAC1B,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC;4BACpB,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC;yBACzC,CAAC,CAAyC,CAAC;wBAE5C,IAAA,oBAAU,EAAC,gBAAgB,EAAE,0BAA0B,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;wBACpE,gBAAgB,CAAC,aAAa,CAAC,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;wBAElF,OAAO,QAAQ,CAAC;oBACjB,CAAC,CAAC;gBACH,CAAC;YACF,CAAC;YAGD,OAAQ,MAAc,CAAC,IAAI,CAAC,CAAC;QAC9B,CAAC;KACD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NodeConnectionTypes, type INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare const metadataFilterField: INodeProperties;
|
|
3
|
+
export declare function getTemplateNoticeField(templateId: number): INodeProperties;
|
|
4
|
+
type AllowedConnectionTypes = typeof NodeConnectionTypes.AiAgent | typeof NodeConnectionTypes.AiChain | typeof NodeConnectionTypes.AiDocument | typeof NodeConnectionTypes.AiVectorStore | typeof NodeConnectionTypes.AiRetriever;
|
|
5
|
+
export declare function getConnectionHintNoticeField(connectionTypes: AllowedConnectionTypes[]): INodeProperties;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.metadataFilterField = void 0;
|
|
4
|
+
exports.getTemplateNoticeField = getTemplateNoticeField;
|
|
5
|
+
exports.getConnectionHintNoticeField = getConnectionHintNoticeField;
|
|
6
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
7
|
+
exports.metadataFilterField = {
|
|
8
|
+
displayName: 'Metadata Filter',
|
|
9
|
+
name: 'metadata',
|
|
10
|
+
type: 'fixedCollection',
|
|
11
|
+
description: 'Metadata to filter the document by',
|
|
12
|
+
typeOptions: {
|
|
13
|
+
multipleValues: true,
|
|
14
|
+
},
|
|
15
|
+
default: {},
|
|
16
|
+
placeholder: 'Add filter field',
|
|
17
|
+
options: [
|
|
18
|
+
{
|
|
19
|
+
name: 'metadataValues',
|
|
20
|
+
displayName: 'Fields to Set',
|
|
21
|
+
values: [
|
|
22
|
+
{
|
|
23
|
+
displayName: 'Name',
|
|
24
|
+
name: 'name',
|
|
25
|
+
type: 'string',
|
|
26
|
+
default: '',
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Value',
|
|
31
|
+
name: 'value',
|
|
32
|
+
type: 'string',
|
|
33
|
+
default: '',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
function getTemplateNoticeField(templateId) {
|
|
40
|
+
return {
|
|
41
|
+
displayName: `Save time with an <a href="/templates/${templateId}" target="_blank">example</a> of how this node works`,
|
|
42
|
+
name: 'notice',
|
|
43
|
+
type: 'notice',
|
|
44
|
+
default: '',
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const connectionsString = {
|
|
48
|
+
[n8n_workflow_1.NodeConnectionTypes.AiAgent]: {
|
|
49
|
+
connection: '',
|
|
50
|
+
locale: 'AI Agent',
|
|
51
|
+
},
|
|
52
|
+
[n8n_workflow_1.NodeConnectionTypes.AiChain]: {
|
|
53
|
+
connection: '',
|
|
54
|
+
locale: 'AI Chain',
|
|
55
|
+
},
|
|
56
|
+
[n8n_workflow_1.NodeConnectionTypes.AiDocument]: {
|
|
57
|
+
connection: n8n_workflow_1.NodeConnectionTypes.AiDocument,
|
|
58
|
+
locale: 'Document Loader',
|
|
59
|
+
},
|
|
60
|
+
[n8n_workflow_1.NodeConnectionTypes.AiVectorStore]: {
|
|
61
|
+
connection: n8n_workflow_1.NodeConnectionTypes.AiVectorStore,
|
|
62
|
+
locale: 'Vector Store',
|
|
63
|
+
},
|
|
64
|
+
[n8n_workflow_1.NodeConnectionTypes.AiRetriever]: {
|
|
65
|
+
connection: n8n_workflow_1.NodeConnectionTypes.AiRetriever,
|
|
66
|
+
locale: 'Vector Store Retriever',
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
function determineArticle(nextWord) {
|
|
70
|
+
const vowels = /^[aeiouAEIOU]/;
|
|
71
|
+
return vowels.test(nextWord) ? 'an' : 'a';
|
|
72
|
+
}
|
|
73
|
+
const getConnectionParameterString = (connectionType) => {
|
|
74
|
+
if (connectionType === '')
|
|
75
|
+
return "data-action-parameter-creatorview='AI'";
|
|
76
|
+
return `data-action-parameter-connectiontype='${connectionType}'`;
|
|
77
|
+
};
|
|
78
|
+
const getAhref = (connectionType) => `<a class="test" data-action='openSelectiveNodeCreator'${getConnectionParameterString(connectionType.connection)}'>${connectionType.locale}</a>`;
|
|
79
|
+
function getConnectionHintNoticeField(connectionTypes) {
|
|
80
|
+
const groupedConnections = new Map();
|
|
81
|
+
connectionTypes.forEach((connectionType) => {
|
|
82
|
+
var _a;
|
|
83
|
+
const connectionString = connectionsString[connectionType].connection;
|
|
84
|
+
const localeString = connectionsString[connectionType].locale;
|
|
85
|
+
if (!groupedConnections.has(connectionString)) {
|
|
86
|
+
groupedConnections.set(connectionString, [localeString]);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
(_a = groupedConnections.get(connectionString)) === null || _a === void 0 ? void 0 : _a.push(localeString);
|
|
90
|
+
});
|
|
91
|
+
let displayName;
|
|
92
|
+
if (groupedConnections.size === 1) {
|
|
93
|
+
const [[connection, locales]] = Array.from(groupedConnections);
|
|
94
|
+
displayName = `This node must be connected to ${determineArticle(locales[0])} ${locales[0]
|
|
95
|
+
.toLowerCase()
|
|
96
|
+
.replace(/^ai /, 'AI ')}. <a data-action='openSelectiveNodeCreator' ${getConnectionParameterString(connection)}>Insert one</a>`;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
const ahrefs = Array.from(groupedConnections, ([connection, locales]) => {
|
|
100
|
+
const locale = locales.length > 1
|
|
101
|
+
? locales
|
|
102
|
+
.map((localeString, index, { length }) => {
|
|
103
|
+
return ((index === 0 ? `${determineArticle(localeString)} ` : '') +
|
|
104
|
+
(index < length - 1 ? `${localeString} or ` : localeString));
|
|
105
|
+
})
|
|
106
|
+
.join('')
|
|
107
|
+
: `${determineArticle(locales[0])} ${locales[0]}`;
|
|
108
|
+
return getAhref({ connection, locale });
|
|
109
|
+
});
|
|
110
|
+
displayName = `This node needs to be connected to ${ahrefs.join(' or ')}.`;
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
displayName,
|
|
114
|
+
name: 'notice',
|
|
115
|
+
type: 'notice',
|
|
116
|
+
default: '',
|
|
117
|
+
typeOptions: {
|
|
118
|
+
containerClass: 'ndv-connection-hint-notice',
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=sharedFields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sharedFields.js","sourceRoot":"","sources":["../../utils/sharedFields.ts"],"names":[],"mapp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,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;IAC5E,CAAC;IAED,OAAO;QACN,WAAW;QACX,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE;YACZ,cAAc,EAAE,4BAA4B;SAC5C;KACD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,54 +1,70 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-couchbase",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Community node for using Couchbase Key-Value, Query, and Full-Text Search with n8n.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package"
|
|
7
7
|
],
|
|
8
8
|
"license": "MIT",
|
|
9
|
-
"homepage": "",
|
|
9
|
+
"homepage": "https://github.com/Couchbase-Ecosystem/n8n-nodes-couchbase#readme",
|
|
10
10
|
"author": {
|
|
11
|
-
"name": "
|
|
12
|
-
"email": "
|
|
11
|
+
"name": "Elliot Scribner",
|
|
12
|
+
"email": "elliot.scribner@couchbase.com"
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": "https://github.com/
|
|
16
|
+
"url": "https://github.com/Couchbase-Ecosystem/n8n-nodes-couchbase.git"
|
|
17
17
|
},
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"dev": "tsc --watch",
|
|
22
|
-
"format": "prettier nodes credentials --write",
|
|
23
|
-
"lint": "eslint nodes credentials package.json",
|
|
24
|
-
"lintfix": "eslint nodes credentials package.json --fix",
|
|
25
|
-
"prepublishOnly": "npm run build && npm run lint -c .eslintrc.prepublish.js nodes credentials package.json"
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=18.10",
|
|
20
|
+
"pnpm": ">=9.1"
|
|
26
21
|
},
|
|
22
|
+
"main": "index.js",
|
|
27
23
|
"files": [
|
|
28
24
|
"dist"
|
|
29
25
|
],
|
|
30
26
|
"n8n": {
|
|
31
27
|
"n8nNodesApiVersion": 1,
|
|
32
28
|
"credentials": [
|
|
33
|
-
"dist/credentials/
|
|
29
|
+
"dist/credentials/CouchbaseApi.credentials.js"
|
|
34
30
|
],
|
|
35
31
|
"nodes": [
|
|
36
|
-
"dist/nodes/
|
|
32
|
+
"dist/nodes/Couchbase/Couchbase.node.js",
|
|
33
|
+
"dist/nodes/Couchbase/vector_store/VectorStoreCouchbaseSearch.node.js"
|
|
37
34
|
]
|
|
38
35
|
},
|
|
39
36
|
"devDependencies": {
|
|
40
|
-
"@types/
|
|
41
|
-
"@
|
|
42
|
-
"
|
|
43
|
-
"eslint-plugin-n8n-nodes-base": "^1.
|
|
37
|
+
"@types/node": "^22.13.5",
|
|
38
|
+
"@typescript-eslint/parser": "^7.15.0",
|
|
39
|
+
"eslint": "^8.56.0",
|
|
40
|
+
"eslint-plugin-n8n-nodes-base": "^1.16.1",
|
|
44
41
|
"gulp": "^4.0.2",
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
42
|
+
"nodemon": "^3.1.9",
|
|
43
|
+
"prettier": "^3.3.2",
|
|
44
|
+
"sqlite3": "^5.1.7",
|
|
45
|
+
"tsc-alias": "^1.8.13",
|
|
46
|
+
"typescript": "^5.5.3"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"n8n-workflow": "*"
|
|
49
50
|
},
|
|
50
51
|
"dependencies": {
|
|
51
|
-
"
|
|
52
|
-
"
|
|
52
|
+
"@langchain/community": "^0.3.38",
|
|
53
|
+
"@langchain/core": "^0.3.43",
|
|
54
|
+
"@langchain/textsplitters": "^0.1.0",
|
|
55
|
+
"langchain": "^0.3.19",
|
|
56
|
+
"couchbase": "^4.4.5",
|
|
57
|
+
"tmp-promise": "^3.0.3",
|
|
58
|
+
"uuid": "^11.1.0",
|
|
59
|
+
"zod": "^3.24.2"
|
|
60
|
+
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"preinstall": "npx only-allow pnpm",
|
|
63
|
+
"build": "tsc && gulp build:icons",
|
|
64
|
+
"dev": "tsc --watch",
|
|
65
|
+
"dev:ui": "nodemon -w nodes -w credentials -w utils --ext ts --exec 'tsc && tsc-alias && cd $HOME/.n8n/custom && COREPACK_ENABLE_STRICT=0 pnpm install && cd - && n8n'",
|
|
66
|
+
"format": "prettier nodes credentials --write",
|
|
67
|
+
"lint": "eslint nodes credentials package.json",
|
|
68
|
+
"lintfix": "eslint nodes credentials package.json --fix"
|
|
53
69
|
}
|
|
54
|
-
}
|
|
70
|
+
}
|