@n8n/n8n-nodes-langchain 0.7.4 → 0.9.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/dist/build.tsbuildinfo +1 -1
- package/dist/credentials/GooglePalmApi.credentials.js +1 -1
- package/dist/credentials/GooglePalmApi.credentials.js.map +1 -1
- package/dist/credentials/MistralCloudApi.credentials.d.ts +9 -0
- package/dist/credentials/MistralCloudApi.credentials.js +37 -0
- package/dist/credentials/MistralCloudApi.credentials.js.map +1 -0
- package/dist/credentials/QdrantApi.credentials.d.ts +9 -0
- package/dist/credentials/QdrantApi.credentials.js +45 -0
- package/dist/credentials/QdrantApi.credentials.js.map +1 -0
- package/dist/credentials/SerpApi.credentials.js +1 -1
- package/dist/credentials/SerpApi.credentials.js.map +1 -1
- package/dist/known/credentials.json +15 -0
- package/dist/known/nodes.json +16 -0
- package/dist/nodes/agents/Agent/Agent.node.js +1 -1
- package/dist/nodes/agents/Agent/Agent.node.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/description.js +13 -0
- package/dist/nodes/agents/Agent/agents/ConversationalAgent/description.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.js +13 -0
- package/dist/nodes/agents/Agent/agents/OpenAiFunctionsAgent/description.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/description.js +13 -0
- package/dist/nodes/agents/Agent/agents/PlanAndExecuteAgent/description.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ReActAgent/description.js +13 -0
- package/dist/nodes/agents/Agent/agents/ReActAgent/description.js.map +1 -1
- package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js +17 -0
- package/dist/nodes/agents/OpenAiAssistant/OpenAiAssistant.node.js.map +1 -1
- package/dist/nodes/chains/ChainLLM/ChainLlm.node.js +13 -1
- package/dist/nodes/chains/ChainLLM/ChainLlm.node.js.map +1 -1
- package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js +13 -1
- package/dist/nodes/chains/ChainRetrievalQA/ChainRetrievalQa.node.js.map +1 -1
- package/dist/nodes/document_loaders/DocumentBinaryInputLoader/DocumentBinaryInputLoader.node.js +1 -1
- package/dist/nodes/document_loaders/DocumentBinaryInputLoader/binary.svg +1 -3
- package/dist/nodes/document_loaders/DocumentDefaultDataLoader/binary.svg +1 -3
- package/dist/nodes/document_loaders/DocumentGithubLoader/github.svg +1 -1
- package/dist/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.js +1 -1
- package/dist/nodes/document_loaders/DocumentJSONInputLoader/DocumentJsonInputLoader.node.js.map +1 -1
- package/dist/nodes/document_loaders/DocumentJSONInputLoader/json.svg +1 -48
- package/dist/nodes/embeddings/EmbeddingsAwsBedrock/bedrock.svg +1 -18
- package/dist/nodes/embeddings/EmbeddingsCohere/cohere.svg +1 -93
- package/dist/nodes/embeddings/EmbeddingsGooglePalm/google.svg +1 -1
- package/dist/nodes/embeddings/EmbeddingsHuggingFaceInference/huggingface.svg +1 -8
- package/dist/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.d.ts +5 -0
- package/dist/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.js +142 -0
- package/dist/nodes/embeddings/EmbeddingsMistralCloud/EmbeddingsMistralCloud.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsMistralCloud/mistral.svg +262 -0
- package/dist/nodes/embeddings/EmbeddingsOpenAI/openAi.svg +1 -7
- package/dist/nodes/llms/LMChatAnthropic/anthropic.svg +1 -1
- package/dist/nodes/llms/LMChatOllama/ollama.svg +1 -43
- package/dist/nodes/llms/LMChatOpenAi/openAi.svg +1 -7
- package/dist/nodes/llms/LMCohere/cohere.svg +1 -93
- package/dist/nodes/llms/LMOllama/ollama.svg +1 -43
- package/dist/nodes/llms/LMOpenAi/openAi.svg +1 -7
- package/dist/nodes/llms/LMOpenHuggingFaceInference/huggingface.svg +1 -8
- package/dist/nodes/llms/LmChatAwsBedrock/bedrock.svg +1 -18
- package/dist/nodes/llms/LmChatGooglePalm/google.svg +1 -1
- package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.d.ts +5 -0
- package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js +181 -0
- package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js.map +1 -0
- package/dist/nodes/llms/LmChatMistralCloud/mistral.svg +262 -0
- package/dist/nodes/llms/LmGooglePalm/google.svg +1 -1
- package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js +18 -1
- package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js.map +1 -1
- package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js +18 -1
- package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js.map +1 -1
- package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js +22 -1
- package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js.map +1 -1
- package/dist/nodes/memory/MemoryRedisChat/redis.svg +1 -1
- package/dist/nodes/memory/MemoryXata/MemoryXata.node.js +18 -1
- package/dist/nodes/memory/MemoryXata/MemoryXata.node.js.map +1 -1
- package/dist/nodes/memory/MemoryXata/xata.svg +1 -1
- package/dist/nodes/memory/MemoryZep/MemoryZep.node.js +18 -1
- package/dist/nodes/memory/MemoryZep/MemoryZep.node.js.map +1 -1
- package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js +0 -2
- package/dist/nodes/output_parser/OutputParserStructured/OutputParserStructured.node.js.map +1 -1
- package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.js +2 -5
- package/dist/nodes/retrievers/RetrieverWorkflow/RetrieverWorkflow.node.js.map +1 -1
- package/dist/nodes/tools/ToolSerpApi/serpApi.svg +1 -13
- package/dist/nodes/tools/ToolWikipedia/wikipedia.svg +1 -41
- package/dist/nodes/tools/ToolWolframAlpha/wolfram-alpha.svg +1 -23
- package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.js +2 -5
- package/dist/nodes/tools/ToolWorkflow/ToolWorkflow.node.js.map +1 -1
- package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.d.ts +5 -0
- package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js +390 -0
- package/dist/nodes/trigger/ChatTrigger/ChatTrigger.node.js.map +1 -0
- package/dist/nodes/trigger/ChatTrigger/GenericFunctions.d.ts +2 -0
- package/dist/nodes/trigger/ChatTrigger/GenericFunctions.js +51 -0
- package/dist/nodes/trigger/ChatTrigger/GenericFunctions.js.map +1 -0
- package/dist/nodes/trigger/ChatTrigger/error.d.ts +4 -0
- package/dist/nodes/trigger/ChatTrigger/error.js +20 -0
- package/dist/nodes/trigger/ChatTrigger/error.js.map +1 -0
- package/dist/nodes/trigger/ChatTrigger/templates.d.ts +13 -0
- package/dist/nodes/trigger/ChatTrigger/templates.js +86 -0
- package/dist/nodes/trigger/ChatTrigger/templates.js.map +1 -0
- package/dist/nodes/trigger/ChatTrigger/types.d.ts +2 -0
- package/dist/nodes/trigger/ChatTrigger/types.js +3 -0
- package/dist/nodes/trigger/ChatTrigger/types.js.map +1 -0
- package/dist/nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.js +1 -0
- package/dist/nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js +1 -1
- package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js +1 -1
- package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStorePinecone/pinecone.svg +1 -1
- package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.js +1 -1
- package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStorePineconeInsert/pinecone.svg +1 -1
- package/dist/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.js +1 -1
- package/dist/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStorePineconeLoad/pinecone.svg +1 -1
- package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.d.ts +12 -0
- package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js +71 -0
- package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreQdrant/qdrant.svg +21 -0
- package/dist/nodes/vector_store/VectorStoreSupabase/supabase.svg +1 -15
- package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.js +1 -1
- package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreSupabaseInsert/supabase.svg +1 -15
- package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.js +1 -1
- package/dist/nodes/vector_store/VectorStoreSupabaseLoad/VectorStoreSupabaseLoad.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreSupabaseLoad/supabase.svg +1 -15
- package/dist/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.js +1 -1
- package/dist/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.js +1 -1
- package/dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.js.map +1 -1
- package/dist/nodes/vector_store/shared/descriptions.d.ts +1 -0
- package/dist/nodes/vector_store/shared/descriptions.js +23 -1
- package/dist/nodes/vector_store/shared/descriptions.js.map +1 -1
- package/dist/nodes/vector_store/shared/methods/listSearch.d.ts +6 -0
- package/dist/nodes/vector_store/shared/methods/listSearch.js +16 -1
- package/dist/nodes/vector_store/shared/methods/listSearch.js.map +1 -1
- package/dist/types/credentials.json +4 -2
- package/dist/types/nodes.json +27 -23
- package/dist/utils/N8nBinaryLoader.js.map +1 -1
- package/package.json +15 -4
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChatTrigger = void 0;
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
5
|
+
const templates_1 = require("./templates");
|
|
6
|
+
const GenericFunctions_1 = require("./GenericFunctions");
|
|
7
|
+
const CHAT_TRIGGER_PATH_IDENTIFIER = 'chat';
|
|
8
|
+
class ChatTrigger {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.description = {
|
|
11
|
+
displayName: 'Chat Trigger',
|
|
12
|
+
name: 'chatTrigger',
|
|
13
|
+
icon: 'fa:comments',
|
|
14
|
+
group: ['trigger'],
|
|
15
|
+
version: 1,
|
|
16
|
+
description: 'Runs the workflow when an n8n generated webchat is submitted',
|
|
17
|
+
defaults: {
|
|
18
|
+
name: 'Chat Trigger',
|
|
19
|
+
},
|
|
20
|
+
codex: {
|
|
21
|
+
categories: ['Core Nodes'],
|
|
22
|
+
resources: {
|
|
23
|
+
primaryDocumentation: [
|
|
24
|
+
{
|
|
25
|
+
url: 'https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-langchain.chattrigger/',
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
subcategories: {
|
|
30
|
+
'Core Nodes': ['Other Trigger Nodes'],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
supportsCORS: true,
|
|
34
|
+
maxNodes: 1,
|
|
35
|
+
inputs: `={{ (() => {
|
|
36
|
+
if (!['hostedChat', 'webhook'].includes($parameter.mode)) {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
if ($parameter.options?.loadPreviousSession !== 'memory') {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return [
|
|
44
|
+
{
|
|
45
|
+
displayName: 'Memory',
|
|
46
|
+
maxConnections: 1,
|
|
47
|
+
type: '${"ai_memory"}',
|
|
48
|
+
required: true,
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
})() }}`,
|
|
52
|
+
outputs: ['main'],
|
|
53
|
+
credentials: [
|
|
54
|
+
{
|
|
55
|
+
name: 'httpBasicAuth',
|
|
56
|
+
required: true,
|
|
57
|
+
displayOptions: {
|
|
58
|
+
show: {
|
|
59
|
+
authentication: ['basicAuth'],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
webhooks: [
|
|
65
|
+
{
|
|
66
|
+
name: 'setup',
|
|
67
|
+
httpMethod: 'GET',
|
|
68
|
+
responseMode: 'onReceived',
|
|
69
|
+
path: CHAT_TRIGGER_PATH_IDENTIFIER,
|
|
70
|
+
ndvHideUrl: true,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'default',
|
|
74
|
+
httpMethod: 'POST',
|
|
75
|
+
responseMode: '={{$parameter.options?.["responseMode"] || "lastNode" }}',
|
|
76
|
+
path: CHAT_TRIGGER_PATH_IDENTIFIER,
|
|
77
|
+
ndvHideMethod: true,
|
|
78
|
+
ndvHideUrl: '={{ !$parameter.public }}',
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
eventTriggerDescription: 'Waiting for you to submit the chat',
|
|
82
|
+
activationMessage: 'You can now make calls to your production chat URL.',
|
|
83
|
+
triggerPanel: false,
|
|
84
|
+
properties: [
|
|
85
|
+
{
|
|
86
|
+
displayName: 'Make Chat Publicly Available',
|
|
87
|
+
name: 'public',
|
|
88
|
+
type: 'boolean',
|
|
89
|
+
default: false,
|
|
90
|
+
description: 'Whether the chat should be publicly available or only accessible through the manual chat interface',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
displayName: 'Mode',
|
|
94
|
+
name: 'mode',
|
|
95
|
+
type: 'options',
|
|
96
|
+
options: [
|
|
97
|
+
{
|
|
98
|
+
name: 'Hosted Chat',
|
|
99
|
+
value: 'hostedChat',
|
|
100
|
+
description: 'Chat on a page served by n8n',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'Embedded Chat',
|
|
104
|
+
value: 'webhook',
|
|
105
|
+
description: 'Chat through a widget embedded in another page, or by calling a webhook',
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
default: 'hostedChat',
|
|
109
|
+
displayOptions: {
|
|
110
|
+
show: {
|
|
111
|
+
public: [true],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
displayName: 'Chat will be live at the URL above once you activate this workflow. Live executions will show up in the ‘executions’ tab',
|
|
117
|
+
name: 'hostedChatNotice',
|
|
118
|
+
type: 'notice',
|
|
119
|
+
displayOptions: {
|
|
120
|
+
show: {
|
|
121
|
+
mode: ['hostedChat'],
|
|
122
|
+
public: [true],
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
default: '',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
displayName: 'Follow the instructions <a href="https://www.npmjs.com/package/@n8n/chat" target="_blank">here</a> to embed chat in a webpage (or just call the webhook URL at the top of this section). Chat will be live once you activate this workflow',
|
|
129
|
+
name: 'embeddedChatNotice',
|
|
130
|
+
type: 'notice',
|
|
131
|
+
displayOptions: {
|
|
132
|
+
show: {
|
|
133
|
+
mode: ['webhook'],
|
|
134
|
+
public: [true],
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
default: '',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
displayName: 'Authentication',
|
|
141
|
+
name: 'authentication',
|
|
142
|
+
type: 'options',
|
|
143
|
+
displayOptions: {
|
|
144
|
+
show: {
|
|
145
|
+
public: [true],
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
options: [
|
|
149
|
+
{
|
|
150
|
+
name: 'Basic Auth',
|
|
151
|
+
value: 'basicAuth',
|
|
152
|
+
description: 'Simple username and password (the same one for all users)',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: 'n8n User Auth',
|
|
156
|
+
value: 'n8nUserAuth',
|
|
157
|
+
description: 'Require user to be logged in with their n8n account',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: 'None',
|
|
161
|
+
value: 'none',
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
default: 'none',
|
|
165
|
+
description: 'The way to authenticate',
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
displayName: 'Initial Message(s)',
|
|
169
|
+
name: 'initialMessages',
|
|
170
|
+
type: 'string',
|
|
171
|
+
displayOptions: {
|
|
172
|
+
show: {
|
|
173
|
+
mode: ['hostedChat'],
|
|
174
|
+
public: [true],
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
typeOptions: {
|
|
178
|
+
rows: 3,
|
|
179
|
+
},
|
|
180
|
+
default: 'Hi there! 👋\nMy name is Nathan. How can I assist you today?',
|
|
181
|
+
description: 'Default messages shown at the start of the chat, one per line',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
displayName: 'Options',
|
|
185
|
+
name: 'options',
|
|
186
|
+
type: 'collection',
|
|
187
|
+
displayOptions: {
|
|
188
|
+
show: {
|
|
189
|
+
mode: ['hostedChat', 'webhook'],
|
|
190
|
+
public: [true],
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
placeholder: 'Add Field',
|
|
194
|
+
default: {},
|
|
195
|
+
options: [
|
|
196
|
+
{
|
|
197
|
+
displayName: 'Input Placeholder',
|
|
198
|
+
name: 'inputPlaceholder',
|
|
199
|
+
type: 'string',
|
|
200
|
+
displayOptions: {
|
|
201
|
+
show: {
|
|
202
|
+
'/mode': ['hostedChat'],
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
default: 'Type your question..',
|
|
206
|
+
placeholder: 'e.g. Type your message here',
|
|
207
|
+
description: 'Shown as placeholder text in the chat input field',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
displayName: 'Load Previous Session',
|
|
211
|
+
name: 'loadPreviousSession',
|
|
212
|
+
type: 'options',
|
|
213
|
+
options: [
|
|
214
|
+
{
|
|
215
|
+
name: 'Off',
|
|
216
|
+
value: 'notSupported',
|
|
217
|
+
description: 'Loading messages of previous session is turned off',
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: 'From Memory',
|
|
221
|
+
value: 'memory',
|
|
222
|
+
description: 'Load session messages from memory',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: 'Manually',
|
|
226
|
+
value: 'manually',
|
|
227
|
+
description: 'Manually return messages of session',
|
|
228
|
+
},
|
|
229
|
+
],
|
|
230
|
+
default: 'notSupported',
|
|
231
|
+
description: 'If loading messages of a previous session should be enabled',
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
displayName: 'Response Mode',
|
|
235
|
+
name: 'responseMode',
|
|
236
|
+
type: 'options',
|
|
237
|
+
options: [
|
|
238
|
+
{
|
|
239
|
+
name: 'When Last Node Finishes',
|
|
240
|
+
value: 'lastNode',
|
|
241
|
+
description: 'Returns data of the last-executed node',
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "Using 'Respond to Webhook' Node",
|
|
245
|
+
value: 'responseNode',
|
|
246
|
+
description: 'Response defined in that node',
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
default: 'lastNode',
|
|
250
|
+
description: 'When and how to respond to the webhook',
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
displayName: 'Require Button Click to Start Chat',
|
|
254
|
+
name: 'showWelcomeScreen',
|
|
255
|
+
type: 'boolean',
|
|
256
|
+
displayOptions: {
|
|
257
|
+
show: {
|
|
258
|
+
'/mode': ['hostedChat'],
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
default: false,
|
|
262
|
+
description: 'Whether to show the welcome screen at the start of the chat',
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
displayName: 'Start Conversation Button Text',
|
|
266
|
+
name: 'getStarted',
|
|
267
|
+
type: 'string',
|
|
268
|
+
displayOptions: {
|
|
269
|
+
show: {
|
|
270
|
+
showWelcomeScreen: [true],
|
|
271
|
+
'/mode': ['hostedChat'],
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
default: 'New Conversation',
|
|
275
|
+
placeholder: 'e.g. New Conversation',
|
|
276
|
+
description: 'Shown as part of the welcome screen, in the middle of the chat window',
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
displayName: 'Subtitle',
|
|
280
|
+
name: 'subtitle',
|
|
281
|
+
type: 'string',
|
|
282
|
+
displayOptions: {
|
|
283
|
+
show: {
|
|
284
|
+
'/mode': ['hostedChat'],
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
default: "Start a chat. We're here to help you 24/7.",
|
|
288
|
+
placeholder: "e.g. We're here for you",
|
|
289
|
+
description: 'Shown at the top of the chat, under the title',
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
displayName: 'Title',
|
|
293
|
+
name: 'title',
|
|
294
|
+
type: 'string',
|
|
295
|
+
displayOptions: {
|
|
296
|
+
show: {
|
|
297
|
+
'/mode': ['hostedChat'],
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
default: 'Hi there! 👋',
|
|
301
|
+
placeholder: 'e.g. Welcome',
|
|
302
|
+
description: 'Shown at the top of the chat',
|
|
303
|
+
},
|
|
304
|
+
],
|
|
305
|
+
},
|
|
306
|
+
],
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
async webhook() {
|
|
310
|
+
var _a, _b;
|
|
311
|
+
const res = this.getResponseObject();
|
|
312
|
+
const isPublic = this.getNodeParameter('public', false);
|
|
313
|
+
const nodeMode = this.getNodeParameter('mode', 'hostedChat');
|
|
314
|
+
if (!isPublic) {
|
|
315
|
+
res.status(404).end();
|
|
316
|
+
return {
|
|
317
|
+
noWebhookResponse: true,
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
const webhookName = this.getWebhookName();
|
|
321
|
+
const mode = this.getMode() === 'manual' ? 'test' : 'production';
|
|
322
|
+
const bodyData = (_a = this.getBodyData()) !== null && _a !== void 0 ? _a : {};
|
|
323
|
+
const options = this.getNodeParameter('options', {});
|
|
324
|
+
if (nodeMode === 'hostedChat') {
|
|
325
|
+
try {
|
|
326
|
+
await (0, GenericFunctions_1.validateAuth)(this);
|
|
327
|
+
}
|
|
328
|
+
catch (error) {
|
|
329
|
+
if (error) {
|
|
330
|
+
res.writeHead(error.responseCode, {
|
|
331
|
+
'www-authenticate': 'Basic realm="Webhook"',
|
|
332
|
+
});
|
|
333
|
+
res.end(error.message);
|
|
334
|
+
return { noWebhookResponse: true };
|
|
335
|
+
}
|
|
336
|
+
throw error;
|
|
337
|
+
}
|
|
338
|
+
if (webhookName === 'setup') {
|
|
339
|
+
const webhookUrlRaw = this.getNodeWebhookUrl('default');
|
|
340
|
+
const webhookUrl = mode === 'test' ? webhookUrlRaw.replace('/webhook', '/webhook-test') : webhookUrlRaw;
|
|
341
|
+
const authentication = this.getNodeParameter('authentication');
|
|
342
|
+
const initialMessagesRaw = this.getNodeParameter('initialMessages', '');
|
|
343
|
+
const initialMessages = initialMessagesRaw
|
|
344
|
+
.split('\n')
|
|
345
|
+
.filter((line) => line)
|
|
346
|
+
.map((line) => line.trim());
|
|
347
|
+
const instanceId = this.getInstanceId();
|
|
348
|
+
const i18nConfig = (0, lodash_1.pick)(options, ['getStarted', 'inputPlaceholder', 'subtitle', 'title']);
|
|
349
|
+
const page = (0, templates_1.createPage)({
|
|
350
|
+
i18n: {
|
|
351
|
+
en: i18nConfig,
|
|
352
|
+
},
|
|
353
|
+
showWelcomeScreen: options.showWelcomeScreen,
|
|
354
|
+
loadPreviousSession: options.loadPreviousSession,
|
|
355
|
+
initialMessages,
|
|
356
|
+
webhookUrl,
|
|
357
|
+
mode,
|
|
358
|
+
instanceId,
|
|
359
|
+
authentication,
|
|
360
|
+
});
|
|
361
|
+
res.status(200).send(page).end();
|
|
362
|
+
return {
|
|
363
|
+
noWebhookResponse: true,
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
if (bodyData.action === 'loadPreviousSession') {
|
|
368
|
+
if ((options === null || options === void 0 ? void 0 : options.loadPreviousSession) === 'memory') {
|
|
369
|
+
const memory = (await this.getInputConnectionData("ai_memory", 0));
|
|
370
|
+
const messages = ((_b = (await (memory === null || memory === void 0 ? void 0 : memory.chatHistory.getMessages()))) !== null && _b !== void 0 ? _b : []).map((message) => message === null || message === void 0 ? void 0 : message.toJSON());
|
|
371
|
+
return {
|
|
372
|
+
webhookResponse: { data: messages },
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
else if ((options === null || options === void 0 ? void 0 : options.loadPreviousSession) === 'notSupported') {
|
|
376
|
+
return {
|
|
377
|
+
webhookResponse: { data: [] },
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
const returnData = { ...bodyData };
|
|
382
|
+
const webhookResponse = { status: 200 };
|
|
383
|
+
return {
|
|
384
|
+
webhookResponse,
|
|
385
|
+
workflowData: [this.helpers.returnJsonArray(returnData)],
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
exports.ChatTrigger = ChatTrigger;
|
|
390
|
+
//# sourceMappingURL=ChatTrigger.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatTrigger.node.js","sourceRoot":"","sources":["../../../../nodes/trigger/ChatTrigger/ChatTrigger.node.ts"],"names":[],"mappings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CAAE,mBAAmB,MAAK,cAAc,EAAE,CAAC;gBAE5D,OAAO;oBACN,eAAe,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;iBAC7B,CAAC;YACH,CAAC;QACF,CAAC;QAED,MAAM,UAAU,GAAgB,EAAE,GAAG,QAAQ,EAAE,CAAC;QAChD,MAAM,eAAe,GAAgB,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;QACrD,OAAO;YACN,eAAe;YACf,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;SACxD,CAAC;IACH,CAAC;CACD;AA3ZD,kCA2ZC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.validateAuth = void 0;
|
|
7
|
+
const basic_auth_1 = __importDefault(require("basic-auth"));
|
|
8
|
+
const error_1 = require("./error");
|
|
9
|
+
async function validateAuth(context) {
|
|
10
|
+
const authentication = context.getNodeParameter('authentication');
|
|
11
|
+
const req = context.getRequestObject();
|
|
12
|
+
const headers = context.getHeaderData();
|
|
13
|
+
if (authentication === 'none') {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
else if (authentication === 'basicAuth') {
|
|
17
|
+
let expectedAuth;
|
|
18
|
+
try {
|
|
19
|
+
expectedAuth = await context.getCredentials('httpBasicAuth');
|
|
20
|
+
}
|
|
21
|
+
catch { }
|
|
22
|
+
if (expectedAuth === undefined || !expectedAuth.user || !expectedAuth.password) {
|
|
23
|
+
throw new error_1.ChatTriggerAuthorizationError(500, 'No authentication data defined on node!');
|
|
24
|
+
}
|
|
25
|
+
const providedAuth = (0, basic_auth_1.default)(req);
|
|
26
|
+
if (!providedAuth)
|
|
27
|
+
throw new error_1.ChatTriggerAuthorizationError(401);
|
|
28
|
+
if (providedAuth.name !== expectedAuth.user || providedAuth.pass !== expectedAuth.password) {
|
|
29
|
+
throw new error_1.ChatTriggerAuthorizationError(403);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else if (authentication === 'n8nUserAuth') {
|
|
33
|
+
const webhookName = context.getWebhookName();
|
|
34
|
+
function getCookie(name) {
|
|
35
|
+
var _a;
|
|
36
|
+
const value = `; ${headers.cookie}`;
|
|
37
|
+
const parts = value.split(`; ${name}=`);
|
|
38
|
+
if (parts.length === 2) {
|
|
39
|
+
return (_a = parts.pop()) === null || _a === void 0 ? void 0 : _a.split(';').shift();
|
|
40
|
+
}
|
|
41
|
+
return '';
|
|
42
|
+
}
|
|
43
|
+
const authCookie = getCookie('n8n-auth');
|
|
44
|
+
if (!authCookie && webhookName !== 'setup') {
|
|
45
|
+
throw new error_1.ChatTriggerAuthorizationError(500, 'User not authenticated!');
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
exports.validateAuth = validateAuth;
|
|
51
|
+
//# sourceMappingURL=GenericFunctions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../../nodes/trigger/ChatTrigger/GenericFunctions.ts"],"names":[],"mappings":";;;;;;AACA,4DAAmC;AACnC,mCAAwD;AAGjD,KAAK,UAAU,YAAY,CAAC,OAA0B;IAC5D,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC,gBAAgB,CAA6B,CAAC;IAC9F,MAAM,GAAG,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IACvC,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAExC,IAAI,cAAc,KAAK,MAAM,EAAE,CAAC;QAC/B,OAAO;IACR,CAAC;SAAM,IAAI,cAAc,KAAK,WAAW,EAAE,CAAC;QAE3C,IAAI,YAAwD,CAAC;QAC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AA6B,CAAC,GAAG,EAAE,yBAAyB,CAAC,CAAC;QACzE,CAAC;IACF,CAAC;IAED,OAAO;AACR,CAAC;AAhDD,oCAgDC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChatTriggerAuthorizationError = void 0;
|
|
4
|
+
class ChatTriggerAuthorizationError extends Error {
|
|
5
|
+
constructor(responseCode, message) {
|
|
6
|
+
if (message === undefined) {
|
|
7
|
+
message = 'Authorization problem!';
|
|
8
|
+
if (responseCode === 401) {
|
|
9
|
+
message = 'Authorization is required!';
|
|
10
|
+
}
|
|
11
|
+
else if (responseCode === 403) {
|
|
12
|
+
message = 'Authorization data is wrong!';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
super(message);
|
|
16
|
+
this.responseCode = responseCode;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.ChatTriggerAuthorizationError = ChatTriggerAuthorizationError;
|
|
20
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../../nodes/trigger/ChatTrigger/error.ts"],"names":[],"mappings":";;;AAAA,MAAa,6BAA8B,SAAQ,KAAK;IACvD,YACU,YAAoB,EAC7B,OAAgB;QAEhB,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC3B,OAAO,GAAG,wBAAwB,CAAC;YACnC,IAAI,YAAY,KAAK,GAAG,EAAE,CAAC;gBAC1B,OAAO,GAAG,4BAA4B,CAAC;YACxC,CAAC;iBAAM,IAAI,YAAY,KAAK,GAAG,EAAE,CAAC;gBACjC,OAAO,GAAG,8BAA8B,CAAC;YAC1C,CAAC;QACF,CAAC;QACD,KAAK,CAAC,OAAO,CAAC,CAAC;QAXN,iBAAY,GAAZ,YAAY,CAAQ;IAY9B,CAAC;CACD;AAfD,sEAeC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AuthenticationChatOption, LoadPreviousSessionChatOption } from './types';
|
|
2
|
+
export declare function createPage({ instanceId, webhookUrl, showWelcomeScreen, loadPreviousSession, i18n: { en }, initialMessages, authentication, }: {
|
|
3
|
+
instanceId: string;
|
|
4
|
+
webhookUrl?: string;
|
|
5
|
+
showWelcomeScreen?: boolean;
|
|
6
|
+
loadPreviousSession?: LoadPreviousSessionChatOption;
|
|
7
|
+
i18n: {
|
|
8
|
+
en: Record<string, string>;
|
|
9
|
+
};
|
|
10
|
+
initialMessages: string[];
|
|
11
|
+
mode: 'test' | 'production';
|
|
12
|
+
authentication: AuthenticationChatOption;
|
|
13
|
+
}): string;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPage = void 0;
|
|
4
|
+
function createPage({ instanceId, webhookUrl, showWelcomeScreen, loadPreviousSession, i18n: { en }, initialMessages, authentication, }) {
|
|
5
|
+
const validAuthenticationOptions = [
|
|
6
|
+
'none',
|
|
7
|
+
'basicAuth',
|
|
8
|
+
'n8nUserAuth',
|
|
9
|
+
];
|
|
10
|
+
const validLoadPreviousSessionOptions = [
|
|
11
|
+
'manually',
|
|
12
|
+
'memory',
|
|
13
|
+
'notSupported',
|
|
14
|
+
];
|
|
15
|
+
const sanitizedAuthentication = validAuthenticationOptions.includes(authentication)
|
|
16
|
+
? authentication
|
|
17
|
+
: 'none';
|
|
18
|
+
const sanitizedShowWelcomeScreen = !!showWelcomeScreen;
|
|
19
|
+
const sanitizedLoadPreviousSession = validLoadPreviousSessionOptions.includes(loadPreviousSession)
|
|
20
|
+
? loadPreviousSession
|
|
21
|
+
: 'notSupported';
|
|
22
|
+
return `<doctype html>
|
|
23
|
+
<html lang="en">
|
|
24
|
+
<head>
|
|
25
|
+
<meta charset="utf-8">
|
|
26
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
27
|
+
<title>Chat</title>
|
|
28
|
+
<link href="https://cdn.jsdelivr.net/npm/normalize.css@8.0.1/normalize.min.css" rel="stylesheet" />
|
|
29
|
+
<link href="https://cdn.jsdelivr.net/npm/@n8n/chat/style.css" rel="stylesheet" />
|
|
30
|
+
</head>
|
|
31
|
+
<body>
|
|
32
|
+
<script type="module">
|
|
33
|
+
import { createChat } from 'https://cdn.jsdelivr.net/npm/@n8n/chat@latest/chat.bundle.es.js';
|
|
34
|
+
|
|
35
|
+
(async function () {
|
|
36
|
+
const authentication = '${sanitizedAuthentication}';
|
|
37
|
+
let metadata;
|
|
38
|
+
if (authentication === 'n8nUserAuth') {
|
|
39
|
+
try {
|
|
40
|
+
const response = await fetch('/rest/login', {
|
|
41
|
+
method: 'GET'
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
if (response.status !== 200) {
|
|
45
|
+
throw new Error('Not logged in');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const responseData = await response.json();
|
|
49
|
+
metadata = {
|
|
50
|
+
user: {
|
|
51
|
+
id: responseData.data.id,
|
|
52
|
+
firstName: responseData.data.firstName,
|
|
53
|
+
lastName: responseData.data.lastName,
|
|
54
|
+
email: responseData.data.email,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
} catch (error) {
|
|
58
|
+
window.location.href = '/signin?redirect=' + window.location.href;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
createChat({
|
|
64
|
+
mode: 'fullscreen',
|
|
65
|
+
webhookUrl: '${webhookUrl}',
|
|
66
|
+
showWelcomeScreen: ${sanitizedShowWelcomeScreen},
|
|
67
|
+
loadPreviousSession: ${sanitizedLoadPreviousSession !== 'notSupported'},
|
|
68
|
+
metadata: metadata,
|
|
69
|
+
webhookConfig: {
|
|
70
|
+
headers: {
|
|
71
|
+
'Content-Type': 'application/json',
|
|
72
|
+
'X-Instance-Id': '${instanceId}',
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
i18n: {
|
|
76
|
+
${en ? `en: ${JSON.stringify(en)},` : ''}
|
|
77
|
+
},
|
|
78
|
+
${initialMessages.length ? `initialMessages: ${JSON.stringify(initialMessages)},` : ''}
|
|
79
|
+
});
|
|
80
|
+
})();
|
|
81
|
+
</script>
|
|
82
|
+
</body>
|
|
83
|
+
</html>`;
|
|
84
|
+
}
|
|
85
|
+
exports.createPage = createPage;
|
|
86
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../../nodes/trigger/ChatTrigger/templates.ts"],"names":[],"mappings":";;;AAEA,SAAgB,UAAU,CAAC,EAC1B,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,IAAI,EAAE,EAAE,EAAE,EAAE,EACZ,eAAe,EACf,cAAc,GAYd;IACA,MAAM,0BAA0B,GAA+B;QAC9D,MAAM;QACN,WAAW;QACX,aAAa;KACb,CAAC;IACF,MAAM,+BAA+B,GAAoC;QACxE,UAAU;QACV,QAAQ;QACR,cAAc;KACd,CAAC;IAEF,MAAM,uBAAuB,GAAG,0BAA0B,CAAC,QAAQ,CAAC,cAAc,CAAC;QAClF,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,MAAM,CAAC;IACV,MAAM,0BAA0B,GAAG,CAAC,CAAC,iBAAiB,CAAC;IACvD,MAAM,4BAA4B,GAAG,+BAA+B,CAAC,QAAQ,CAC5E,mBAAoD,CACpD;QACA,CAAC,CAAC,mBAAmB;QACrB,CAAC,CAAC,cAAc,CAAC;IAElB,OAAO;;;;;;;;;;;;;;+BAcuB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA6BjC,UAAU;2BACJ,0BAA0B;6BACxB,4BAA4B,KAAK,cAAc;;;;;4BAKhD,UAAU;;;;SAI7B,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;;QAEvC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,oBAAoB,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;;;;;SAKnF,CAAC;AACV,CAAC;AAvGD,gCAuGC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../nodes/trigger/ChatTrigger/types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ManualChatTrigger.node.js","sourceRoot":"","sources":["../../../../nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.ts"],"names":[],"mappings":";;;AAQA,MAAa,iBAAiB;IAA9B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,qBAAqB;YAClC,IAAI,EAAE,mBAAmB;YACzB,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,CAAC,SAAS,CAAC;YAClB,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC;YACjB,WAAW,EAAE,0CAA0C;YACvD,uBAAuB,EAAE,EAAE;YAC3B,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE;gBACT,IAAI,EAAE,4BAA4B;gBAClC,KAAK,EAAE,SAAS;aAChB;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,YAAY,CAAC;gBAC1B,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,4FAA4F;yBACjG;qBACD;iBACD;gBACD,aAAa,EAAE;oBACd,YAAY,EAAE,CAAC,qBAAqB,CAAC;iBACrC;aACD;YACD,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,QAAyB;YAClC,UAAU,EAAE;gBACX;oBACC,WAAW,EACV,iHAAiH;oBAClH,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;iBACX;gBACD;oBAEC,WAAW,EAAE,2BAA2B;oBACxC,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE;wBACZ,MAAM,EAAE,UAAU;qBAClB;oBACD,OAAO,EAAE,EAAE;iBACX;aACD;SACD,CAAC;IAWH,CAAC;IATA,KAAK,CAAC,OAAO;QACZ,MAAM,qBAAqB,GAAG,KAAK,IAAI,EAAE;YACxC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,CAAC,CAAC;QAEF,OAAO;YACN,qBAAqB;SACrB,CAAC;IACH,CAAC;CACD;
|
|
1
|
+
{"version":3,"file":"ManualChatTrigger.node.js","sourceRoot":"","sources":["../../../../nodes/trigger/ManualChatTrigger/ManualChatTrigger.node.ts"],"names":[],"mappings":";;;AAQA,MAAa,iBAAiB;IAA9B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,qBAAqB;YAClC,IAAI,EAAE,mBAAmB;YACzB,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,CAAC,SAAS,CAAC;YAClB,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC;YACjB,WAAW,EAAE,0CAA0C;YACvD,uBAAuB,EAAE,EAAE;YAC3B,QAAQ,EAAE,CAAC;YACX,MAAM,EAAE,IAAI;YACZ,QAAQ,EAAE;gBACT,IAAI,EAAE,4BAA4B;gBAClC,KAAK,EAAE,SAAS;aAChB;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,YAAY,CAAC;gBAC1B,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,4FAA4F;yBACjG;qBACD;iBACD;gBACD,aAAa,EAAE;oBACd,YAAY,EAAE,CAAC,qBAAqB,CAAC;iBACrC;aACD;YACD,MAAM,EAAE,EAAE;YACV,OAAO,EAAE,QAAyB;YAClC,UAAU,EAAE;gBACX;oBACC,WAAW,EACV,iHAAiH;oBAClH,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;iBACX;gBACD;oBAEC,WAAW,EAAE,2BAA2B;oBACxC,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE;wBACZ,MAAM,EAAE,UAAU;qBAClB;oBACD,OAAO,EAAE,EAAE;iBACX;aACD;SACD,CAAC;IAWH,CAAC;IATA,KAAK,CAAC,OAAO;QACZ,MAAM,qBAAqB,GAAG,KAAK,IAAI,EAAE;YACxC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,CAAC,CAAC;QAEF,OAAO;YACN,qBAAqB;SACrB,CAAC;IACH,CAAC;CACD;AA5DD,8CA4DC"}
|
|
@@ -24,7 +24,7 @@ class VectorStoreInMemoryInsert {
|
|
|
24
24
|
resources: {
|
|
25
25
|
primaryDocumentation: [
|
|
26
26
|
{
|
|
27
|
-
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.
|
|
27
|
+
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/',
|
|
28
28
|
},
|
|
29
29
|
],
|
|
30
30
|
},
|
package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorStoreInMemoryInsert.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.ts"],"names":[],"mappings":";;;AAWA,iEAA8D;AAC9D,iFAA8E;AAG9E,MAAa,yBAAyB;IAAtC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,2BAA2B;YACjC,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,MAAM,EAAE,IAAI;YACZ,WAAW,EAAE,4CAA4C;YACzD,QAAQ,EAAE;gBACT,IAAI,EAAE,+BAA+B;aACrC;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,eAAe,CAAC;iBACrB;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"VectorStoreInMemoryInsert.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.ts"],"names":[],"mappings":";;;AAWA,iEAA8D;AAC9D,iFAA8E;AAG9E,MAAa,yBAAyB;IAAtC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,2BAA2B;YACjC,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,MAAM,EAAE,IAAI;YACZ,WAAW,EAAE,4CAA4C;YACzD,QAAQ,EAAE;gBACT,IAAI,EAAE,+BAA+B;aACrC;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,eAAe,CAAC;iBACrB;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,4GAA4G;yBACjH;qBACD;iBACD;aACD;YAED,MAAM,EAAE;;gBAEP;oBACC,WAAW,EAAE,UAAU;oBACvB,cAAc,EAAE,CAAC;oBACjB,IAAI,eAA+B;oBACnC,QAAQ,EAAE,IAAI;iBACd;gBACD;oBACC,WAAW,EAAE,WAAW;oBACxB,cAAc,EAAE,CAAC;oBACjB,IAAI,gBAAgC;oBACpC,Q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