@n8n/n8n-nodes-langchain 1.122.57 → 1.122.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -30,7 +30,6 @@ var templates_exports = {};
|
|
|
30
30
|
__export(templates_exports, {
|
|
31
31
|
createPage: () => createPage,
|
|
32
32
|
escapeForScriptContext: () => escapeForScriptContext,
|
|
33
|
-
getSanitizedCustomCss: () => getSanitizedCustomCss,
|
|
34
33
|
getSanitizedI18nConfig: () => getSanitizedI18nConfig,
|
|
35
34
|
getSanitizedInitialMessages: () => getSanitizedInitialMessages
|
|
36
35
|
});
|
|
@@ -68,8 +67,14 @@ function getSanitizedI18nConfig(config) {
|
|
|
68
67
|
}
|
|
69
68
|
return sanitized;
|
|
70
69
|
}
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
const CUSTOM_CSS_ELEMENT_ID = "n8n-chat-custom-css";
|
|
71
|
+
function buildCustomCssScript(customCss) {
|
|
72
|
+
if (!customCss) return "";
|
|
73
|
+
return `
|
|
74
|
+
<script>
|
|
75
|
+
document.getElementById(${escapeForScriptContext(CUSTOM_CSS_ELEMENT_ID)}).textContent =
|
|
76
|
+
${escapeForScriptContext(customCss)};
|
|
77
|
+
</script>`;
|
|
73
78
|
}
|
|
74
79
|
function createPage({
|
|
75
80
|
instanceId,
|
|
@@ -98,7 +103,7 @@ function createPage({
|
|
|
98
103
|
const sanitizedShowWelcomeScreen = !!showWelcomeScreen;
|
|
99
104
|
const sanitizedAllowFileUploads = !!allowFileUploads;
|
|
100
105
|
const sanitizedAllowedFilesMimeTypes = sanitizeUserInput(allowedFilesMimeTypes?.toString() ?? "");
|
|
101
|
-
const
|
|
106
|
+
const customCssScript = buildCustomCssScript(customCss?.toString() ?? "");
|
|
102
107
|
const sanitizedLoadPreviousSession = validLoadPreviousSessionOptions.includes(
|
|
103
108
|
loadPreviousSession
|
|
104
109
|
) ? loadPreviousSession : "notSupported";
|
|
@@ -120,7 +125,7 @@ function createPage({
|
|
|
120
125
|
height: 100%;
|
|
121
126
|
}
|
|
122
127
|
</style>
|
|
123
|
-
<style>${
|
|
128
|
+
<style id="${CUSTOM_CSS_ELEMENT_ID}"></style>${customCssScript}
|
|
124
129
|
</head>
|
|
125
130
|
<body>
|
|
126
131
|
<script type="module">
|
|
@@ -184,7 +189,6 @@ function createPage({
|
|
|
184
189
|
0 && (module.exports = {
|
|
185
190
|
createPage,
|
|
186
191
|
escapeForScriptContext,
|
|
187
|
-
getSanitizedCustomCss,
|
|
188
192
|
getSanitizedI18nConfig,
|
|
189
193
|
getSanitizedInitialMessages
|
|
190
194
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../nodes/trigger/ChatTrigger/templates.ts"],"sourcesContent":["import sanitizeHtml from 'sanitize-html';\n\nimport type { AuthenticationChatOption, LoadPreviousSessionChatOption } from './types';\n\nfunction sanitizeUserInput(input: unknown): string {\n\t// Only strings and numbers are meaningful display values; sanitize-html\n\t// requires a string input, so coerce numbers and drop everything else.\n\tconst value = typeof input === 'string' ? input : typeof input === 'number' ? String(input) : '';\n\t// Sanitize HTML tags and entities\n\tlet sanitized = sanitizeHtml(value, {\n\t\tallowedTags: [],\n\t\tallowedAttributes: {},\n\t});\n\t// Remove dangerous protocols\n\tsanitized = sanitized.replace(/javascript:/gi, '');\n\tsanitized = sanitized.replace(/data:/gi, '');\n\tsanitized = sanitized.replace(/vbscript:/gi, '');\n\treturn sanitized;\n}\n\nexport function getSanitizedInitialMessages(initialMessages: string): string[] {\n\tconst sanitizedString = sanitizeUserInput(initialMessages);\n\n\treturn sanitizedString\n\t\t.split('\\n')\n\t\t.map((line) => line.trim())\n\t\t.filter((line) => line !== '');\n}\n\nconst SCRIPT_CONTEXT_ESCAPES: Record<string, string> = {\n\t'<': '\\\\u003c',\n\t'>': '\\\\u003e',\n\t'&': '\\\\u0026',\n\t'\\u2028': '\\\\u2028',\n\t'\\u2029': '\\\\u2029',\n};\n\n// Returns a JSON literal safe to embed inside an inline <script> block. Escapes\n// `<`/`>` to prevent </script> breakout and U+2028/U+2029 for legacy JS engines.\n// For string inputs the returned literal includes surrounding double quotes \\u2014\n// do not add quotes at the call site.\nexport function escapeForScriptContext(value: string | object): string {\n\treturn JSON.stringify(value).replace(/[<>&\\u2028\\u2029]/g, (c) => SCRIPT_CONTEXT_ESCAPES[c]);\n}\n\nexport function getSanitizedI18nConfig(config: Record<string, string>): Record<string, string> {\n\tconst sanitized: Record<string, string> = {};\n\n\tfor (const [key, value] of Object.entries<string>(config)) {\n\t\tsanitized[key] = sanitizeUserInput(value);\n\t}\n\n\treturn sanitized;\n}\nexport function getSanitizedCustomCss(customCss: string): string {\n\t// Strip any sequence that could close the <style> context.\n\t// Browsers treat </style followed by /, space, tab, or > as a closing tag,\n\t// so we remove all </style variants (case-insensitive) to prevent breakout.\n\treturn customCss.replace(/<\\/style/gi, '');\n}\n\nexport function createPage({\n\tinstanceId,\n\twebhookUrl,\n\tshowWelcomeScreen,\n\tloadPreviousSession,\n\ti18n: { en },\n\tinitialMessages,\n\tauthentication,\n\tallowFileUploads,\n\tallowedFilesMimeTypes,\n\tcustomCss,\n\tenableStreaming,\n}: {\n\tinstanceId: string;\n\twebhookUrl?: string;\n\tshowWelcomeScreen?: boolean;\n\tloadPreviousSession?: LoadPreviousSessionChatOption;\n\ti18n: {\n\t\ten: Record<string, string>;\n\t};\n\tinitialMessages: string;\n\tmode: 'test' | 'production';\n\tauthentication: AuthenticationChatOption;\n\tallowFileUploads?: boolean;\n\tallowedFilesMimeTypes?: string;\n\tcustomCss?: string;\n\tenableStreaming?: boolean;\n}) {\n\tconst validAuthenticationOptions: AuthenticationChatOption[] = [\n\t\t'none',\n\t\t'basicAuth',\n\t\t'n8nUserAuth',\n\t];\n\tconst validLoadPreviousSessionOptions: LoadPreviousSessionChatOption[] = [\n\t\t'manually',\n\t\t'memory',\n\t\t'notSupported',\n\t];\n\n\tconst sanitizedAuthentication = validAuthenticationOptions.includes(authentication)\n\t\t? authentication\n\t\t: 'none';\n\tconst sanitizedShowWelcomeScreen = !!showWelcomeScreen;\n\tconst sanitizedAllowFileUploads = !!allowFileUploads;\n\tconst sanitizedAllowedFilesMimeTypes = sanitizeUserInput(allowedFilesMimeTypes?.toString() ?? '');\n\tconst sanitizedCustomCss = getSanitizedCustomCss(customCss?.toString() ?? '');\n\n\tconst sanitizedLoadPreviousSession = validLoadPreviousSessionOptions.includes(\n\t\tloadPreviousSession as LoadPreviousSessionChatOption,\n\t)\n\t\t? loadPreviousSession\n\t\t: 'notSupported';\n\n\tconst sanitizedInitialMessages = getSanitizedInitialMessages(initialMessages);\n\tconst sanitizedI18nConfig = getSanitizedI18nConfig(en || {});\n\n\treturn `<!doctype html>\n\t<html lang=\"en\">\n\t\t<head>\n\t\t\t<meta charset=\"utf-8\">\n\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\t\t\t<title>Chat</title>\n\t\t\t<link href=\"https://cdn.jsdelivr.net/npm/normalize.css@8.0.1/normalize.min.css\" rel=\"stylesheet\" />\n\t\t\t<link href=\"https://cdn.jsdelivr.net/npm/@n8n/chat/dist/style.css\" rel=\"stylesheet\" />\n\t\t\t<style>\n\t\t\t\thtml,\n\t\t\t\tbody,\n\t\t\t\t#n8n-chat {\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\theight: 100%;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<style>${sanitizedCustomCss}</style>\n\t\t</head>\n\t\t<body>\n\t\t\t<script type=\"module\">\n\t\t\t\timport { createChat } from 'https://cdn.jsdelivr.net/npm/@n8n/chat/dist/chat.bundle.es.js';\n\n\t\t\t\t(async function () {\n\t\t\t\t\tconst authentication = '${sanitizedAuthentication}';\n\t\t\t\t\tlet metadata;\n\t\t\t\t\tif (authentication === 'n8nUserAuth') {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst response = await fetch('/rest/login', {\n\t\t\t\t\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\t\t\t\t\theaders: { 'browser-id': localStorage.getItem('n8n-browserId') }\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tif (response.status !== 200) {\n\t\t\t\t\t\t\t\tthrow new Error('Not logged in');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst responseData = await response.json();\n\t\t\t\t\t\t\tmetadata = {\n\t\t\t\t\t\t\t\tuser: {\n\t\t\t\t\t\t\t\t\tid: responseData.data.id,\n\t\t\t\t\t\t\t\t\tfirstName: responseData.data.firstName,\n\t\t\t\t\t\t\t\t\tlastName: responseData.data.lastName,\n\t\t\t\t\t\t\t\t\temail: responseData.data.email,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\twindow.location.href = '/signin?redirect=' + window.location.href;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcreateChat({\n\t\t\t\t\t\tmode: 'fullscreen',\n\t\t\t\t\t\twebhookUrl: ${escapeForScriptContext(webhookUrl ?? '')},\n\t\t\t\t\t\tshowWelcomeScreen: ${sanitizedShowWelcomeScreen},\n\t\t\t\t\t\tloadPreviousSession: ${sanitizedLoadPreviousSession !== 'notSupported'},\n\t\t\t\t\t\tmetadata: metadata,\n\t\t\t\t\t\twebhookConfig: {\n\t\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t\t\t'X-Instance-Id': '${instanceId}',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tallowFileUploads: ${sanitizedAllowFileUploads},\n\t\t\t\t\t\tallowedFilesMimeTypes: ${escapeForScriptContext(sanitizedAllowedFilesMimeTypes)},\n\t\t\t\t\t\ti18n: {\n\t\t\t\t\t\t\t${Object.keys(sanitizedI18nConfig).length ? `en: ${escapeForScriptContext(sanitizedI18nConfig)},` : ''}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t${sanitizedInitialMessages.length ? `initialMessages: ${escapeForScriptContext(sanitizedInitialMessages)},` : ''}\n\t\t\t\t\t\tenableStreaming: ${!!enableStreaming},\n\t\t\t\t\t});\n\t\t\t\t})();\n\t\t\t</script>\n\t\t</body>\n\t</html>`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAyB;AAIzB,SAAS,kBAAkB,OAAwB;AAGlD,QAAM,QAAQ,OAAO,UAAU,WAAW,QAAQ,OAAO,UAAU,WAAW,OAAO,KAAK,IAAI;AAE9F,MAAI,gBAAY,qBAAAA,SAAa,OAAO;AAAA,IACnC,aAAa,CAAC;AAAA,IACd,mBAAmB,CAAC;AAAA,EACrB,CAAC;AAED,cAAY,UAAU,QAAQ,iBAAiB,EAAE;AACjD,cAAY,UAAU,QAAQ,WAAW,EAAE;AAC3C,cAAY,UAAU,QAAQ,eAAe,EAAE;AAC/C,SAAO;AACR;AAEO,SAAS,4BAA4B,iBAAmC;AAC9E,QAAM,kBAAkB,kBAAkB,eAAe;AAEzD,SAAO,gBACL,MAAM,IAAI,EACV,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,EACzB,OAAO,CAAC,SAAS,SAAS,EAAE;AAC/B;AAEA,MAAM,yBAAiD;AAAA,EACtD,KAAK;AAAA,EACL,KAAK;AAAA,EACL,KAAK;AAAA,EACL,UAAU;AAAA,EACV,UAAU;AACX;AAMO,SAAS,uBAAuB,OAAgC;AACtE,SAAO,KAAK,UAAU,KAAK,EAAE,QAAQ,sBAAsB,CAAC,MAAM,uBAAuB,CAAC,CAAC;AAC5F;AAEO,SAAS,uBAAuB,QAAwD;AAC9F,QAAM,YAAoC,CAAC;AAE3C,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAgB,MAAM,GAAG;AAC1D,cAAU,GAAG,IAAI,kBAAkB,KAA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A;AAAA;AAAA;AAAA,4BAKhD,UAAU;AAAA;AAAA;AAAA,0BAGZ,yBAAyB;AAAA,+BACpB,uBAAuB,8BAA8B,CAAC;AAAA;AAAA,SAE5E,OAAO,KAAK,mBAAmB,EAAE,SAAS,OAAO,uBAAuB,mBAAmB,CAAC,MAAM,EAAE;AAAA;AAAA,QAErG,yBAAyB,SAAS,oBAAoB,uBAAuB,wBAAwB,CAAC,MAAM,EAAE;AAAA,yBAC7F,CAAC,CAAC,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAM1C;","names":["sanitizeHtml"]}
|
|
1
|
+
{"version":3,"sources":["../../../../nodes/trigger/ChatTrigger/templates.ts"],"sourcesContent":["import sanitizeHtml from 'sanitize-html';\n\nimport type { AuthenticationChatOption, LoadPreviousSessionChatOption } from './types';\n\nfunction sanitizeUserInput(input: unknown): string {\n\t// Only strings and numbers are meaningful display values; sanitize-html\n\t// requires a string input, so coerce numbers and drop everything else.\n\tconst value = typeof input === 'string' ? input : typeof input === 'number' ? String(input) : '';\n\t// Sanitize HTML tags and entities\n\tlet sanitized = sanitizeHtml(value, {\n\t\tallowedTags: [],\n\t\tallowedAttributes: {},\n\t});\n\t// Remove dangerous protocols\n\tsanitized = sanitized.replace(/javascript:/gi, '');\n\tsanitized = sanitized.replace(/data:/gi, '');\n\tsanitized = sanitized.replace(/vbscript:/gi, '');\n\treturn sanitized;\n}\n\nexport function getSanitizedInitialMessages(initialMessages: string): string[] {\n\tconst sanitizedString = sanitizeUserInput(initialMessages);\n\n\treturn sanitizedString\n\t\t.split('\\n')\n\t\t.map((line) => line.trim())\n\t\t.filter((line) => line !== '');\n}\n\nconst SCRIPT_CONTEXT_ESCAPES: Record<string, string> = {\n\t'<': '\\\\u003c',\n\t'>': '\\\\u003e',\n\t'&': '\\\\u0026',\n\t'\\u2028': '\\\\u2028',\n\t'\\u2029': '\\\\u2029',\n};\n\n// Returns a JSON literal safe to embed inside an inline <script> block. Escapes\n// `<`/`>` to prevent </script> breakout and U+2028/U+2029 for legacy JS engines.\n// For string inputs the returned literal includes surrounding double quotes \\u2014\n// do not add quotes at the call site.\nexport function escapeForScriptContext(value: string | object): string {\n\treturn JSON.stringify(value).replace(/[<>&\\u2028\\u2029]/g, (c) => SCRIPT_CONTEXT_ESCAPES[c]);\n}\n\nexport function getSanitizedI18nConfig(config: Record<string, string>): Record<string, string> {\n\tconst sanitized: Record<string, string> = {};\n\n\tfor (const [key, value] of Object.entries<string>(config)) {\n\t\tsanitized[key] = sanitizeUserInput(value);\n\t}\n\n\treturn sanitized;\n}\n\n/** Ties the empty element the page ships to the script that fills it. */\nconst CUSTOM_CSS_ELEMENT_ID = 'n8n-chat-custom-css';\n\n/**\n * Applies the user's custom CSS without ever placing it in an HTML context.\n *\n * Interpolating it into `<style>...</style>` put it one `</style` away from the HTML\n * parser, and no amount of stripping closes that: removing an inner `</style` splices\n * the text around it into a real closing tag, so the filter builds the sequence it is\n * meant to remove. Assigning `textContent` parses no markup at all, so the CSS reaches\n * the CSS parser byte for byte and cannot reach the HTML one.\n *\n * Escaping is the same `escapeForScriptContext` the rest of this page's values use. A\n * classic script, so it runs before the body is parsed and the styles are never applied\n * late. The element stays where the old `<style>` was, which keeps the cascade order.\n */\nfunction buildCustomCssScript(customCss: string): string {\n\tif (!customCss) return '';\n\n\treturn `\n\t\t\t<script>\n\t\t\t\tdocument.getElementById(${escapeForScriptContext(CUSTOM_CSS_ELEMENT_ID)}).textContent =\n\t\t\t\t\t${escapeForScriptContext(customCss)};\n\t\t\t</script>`;\n}\n\nexport function createPage({\n\tinstanceId,\n\twebhookUrl,\n\tshowWelcomeScreen,\n\tloadPreviousSession,\n\ti18n: { en },\n\tinitialMessages,\n\tauthentication,\n\tallowFileUploads,\n\tallowedFilesMimeTypes,\n\tcustomCss,\n\tenableStreaming,\n}: {\n\tinstanceId: string;\n\twebhookUrl?: string;\n\tshowWelcomeScreen?: boolean;\n\tloadPreviousSession?: LoadPreviousSessionChatOption;\n\ti18n: {\n\t\ten: Record<string, string>;\n\t};\n\tinitialMessages: string;\n\tmode: 'test' | 'production';\n\tauthentication: AuthenticationChatOption;\n\tallowFileUploads?: boolean;\n\tallowedFilesMimeTypes?: string;\n\tcustomCss?: string;\n\tenableStreaming?: boolean;\n}) {\n\tconst validAuthenticationOptions: AuthenticationChatOption[] = [\n\t\t'none',\n\t\t'basicAuth',\n\t\t'n8nUserAuth',\n\t];\n\tconst validLoadPreviousSessionOptions: LoadPreviousSessionChatOption[] = [\n\t\t'manually',\n\t\t'memory',\n\t\t'notSupported',\n\t];\n\n\tconst sanitizedAuthentication = validAuthenticationOptions.includes(authentication)\n\t\t? authentication\n\t\t: 'none';\n\tconst sanitizedShowWelcomeScreen = !!showWelcomeScreen;\n\tconst sanitizedAllowFileUploads = !!allowFileUploads;\n\tconst sanitizedAllowedFilesMimeTypes = sanitizeUserInput(allowedFilesMimeTypes?.toString() ?? '');\n\tconst customCssScript = buildCustomCssScript(customCss?.toString() ?? '');\n\n\tconst sanitizedLoadPreviousSession = validLoadPreviousSessionOptions.includes(\n\t\tloadPreviousSession as LoadPreviousSessionChatOption,\n\t)\n\t\t? loadPreviousSession\n\t\t: 'notSupported';\n\n\tconst sanitizedInitialMessages = getSanitizedInitialMessages(initialMessages);\n\tconst sanitizedI18nConfig = getSanitizedI18nConfig(en || {});\n\n\treturn `<!doctype html>\n\t<html lang=\"en\">\n\t\t<head>\n\t\t\t<meta charset=\"utf-8\">\n\t\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\t\t\t<title>Chat</title>\n\t\t\t<link href=\"https://cdn.jsdelivr.net/npm/normalize.css@8.0.1/normalize.min.css\" rel=\"stylesheet\" />\n\t\t\t<link href=\"https://cdn.jsdelivr.net/npm/@n8n/chat/dist/style.css\" rel=\"stylesheet\" />\n\t\t\t<style>\n\t\t\t\thtml,\n\t\t\t\tbody,\n\t\t\t\t#n8n-chat {\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\theight: 100%;\n\t\t\t\t}\n\t\t\t</style>\n\t\t\t<style id=\"${CUSTOM_CSS_ELEMENT_ID}\"></style>${customCssScript}\n\t\t</head>\n\t\t<body>\n\t\t\t<script type=\"module\">\n\t\t\t\timport { createChat } from 'https://cdn.jsdelivr.net/npm/@n8n/chat/dist/chat.bundle.es.js';\n\n\t\t\t\t(async function () {\n\t\t\t\t\tconst authentication = '${sanitizedAuthentication}';\n\t\t\t\t\tlet metadata;\n\t\t\t\t\tif (authentication === 'n8nUserAuth') {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst response = await fetch('/rest/login', {\n\t\t\t\t\t\t\t\t\tmethod: 'GET',\n\t\t\t\t\t\t\t\t\theaders: { 'browser-id': localStorage.getItem('n8n-browserId') }\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tif (response.status !== 200) {\n\t\t\t\t\t\t\t\tthrow new Error('Not logged in');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst responseData = await response.json();\n\t\t\t\t\t\t\tmetadata = {\n\t\t\t\t\t\t\t\tuser: {\n\t\t\t\t\t\t\t\t\tid: responseData.data.id,\n\t\t\t\t\t\t\t\t\tfirstName: responseData.data.firstName,\n\t\t\t\t\t\t\t\t\tlastName: responseData.data.lastName,\n\t\t\t\t\t\t\t\t\temail: responseData.data.email,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\twindow.location.href = '/signin?redirect=' + window.location.href;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcreateChat({\n\t\t\t\t\t\tmode: 'fullscreen',\n\t\t\t\t\t\twebhookUrl: ${escapeForScriptContext(webhookUrl ?? '')},\n\t\t\t\t\t\tshowWelcomeScreen: ${sanitizedShowWelcomeScreen},\n\t\t\t\t\t\tloadPreviousSession: ${sanitizedLoadPreviousSession !== 'notSupported'},\n\t\t\t\t\t\tmetadata: metadata,\n\t\t\t\t\t\twebhookConfig: {\n\t\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t\t\t'X-Instance-Id': '${instanceId}',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tallowFileUploads: ${sanitizedAllowFileUploads},\n\t\t\t\t\t\tallowedFilesMimeTypes: ${escapeForScriptContext(sanitizedAllowedFilesMimeTypes)},\n\t\t\t\t\t\ti18n: {\n\t\t\t\t\t\t\t${Object.keys(sanitizedI18nConfig).length ? `en: ${escapeForScriptContext(sanitizedI18nConfig)},` : ''}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t${sanitizedInitialMessages.length ? `initialMessages: ${escapeForScriptContext(sanitizedInitialMessages)},` : ''}\n\t\t\t\t\t\tenableStreaming: ${!!enableStreaming},\n\t\t\t\t\t});\n\t\t\t\t})();\n\t\t\t</script>\n\t\t</body>\n\t</html>`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAyB;AAIzB,SAAS,kBAAkB,OAAwB;AAGlD,QAAM,QAAQ,OAAO,UAAU,WAAW,QAAQ,OAAO,UAAU,WAAW,OAAO,KAAK,IAAI;AAE9F,MAAI,gBAAY,qBAAAA,SAAa,OAAO;AAAA,IACnC,aAAa,CAAC;AAAA,IACd,mBAAmB,CAAC;AAAA,EACrB,CAAC;AAED,cAAY,UAAU,QAAQ,iBAAiB,EAAE;AACjD,cAAY,UAAU,QAAQ,WAAW,EAAE;AAC3C,cAAY,UAAU,QAAQ,eAAe,EAAE;AAC/C,SAAO;AACR;AAEO,SAAS,4BAA4B,iBAAmC;AAC9E,QAAM,kBAAkB,kBAAkB,eAAe;AAEzD,SAAO,gBACL,MAAM,IAAI,EACV,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,EACzB,OAAO,CAAC,SAAS,SAAS,EAA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,QAAM,sBAAsB,uBAAuB,MAAM,CAAC,CAAC;AAE3D,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAgBQ,qBAAqB,aAAa,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAOlC,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBA8BlC,uBAAuB,cAAc,EAAE,CAAC;AAAA,2BACjC,0BAA0B;AAAA,6BACxB,iCAAiC,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA,4BAKhD,UAAU;AAAA;AAAA;AAAA,0BAGZ,yBAAyB;AAAA,+BACpB,uBAAuB,8BAA8B,CAAC;AAAA;AAAA,SAE5E,OAAO,KAAK,mBAAmB,EAAE,SAAS,OAAO,uBAAuB,mBAAmB,CAAC,MAAM,EAAE;AAAA;AAAA,QAErG,yBAAyB,SAAS,oBAAoB,uBAAuB,wBAAwB,CAAC,MAAM,EAAE;AAAA,yBAC7F,CAAC,CAAC,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAM1C;","names":["sanitizeHtml"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/n8n-nodes-langchain",
|
|
3
|
-
"version": "1.122.
|
|
3
|
+
"version": "1.122.59",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
"jest-mock-extended": "^3.0.4",
|
|
161
161
|
"tsup": "^8.5.1",
|
|
162
162
|
"@n8n/eslint-plugin-community-nodes": "0.7.0",
|
|
163
|
-
"n8n-core": "1.122.
|
|
163
|
+
"n8n-core": "1.122.50"
|
|
164
164
|
},
|
|
165
165
|
"dependencies": {
|
|
166
166
|
"@aws-sdk/client-sso-oidc": "3.808.0",
|
|
@@ -190,7 +190,7 @@
|
|
|
190
190
|
"@langchain/redis": "1.0.1",
|
|
191
191
|
"@langchain/textsplitters": "1.0.1",
|
|
192
192
|
"@langchain/weaviate": "1.0.1",
|
|
193
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
193
|
+
"@modelcontextprotocol/sdk": "^1.31.0",
|
|
194
194
|
"@mozilla/readability": "0.6.0",
|
|
195
195
|
"@n8n/typeorm": "0.3.20-15",
|
|
196
196
|
"@pinecone-database/pinecone": "^5.0.2",
|
|
@@ -229,14 +229,14 @@
|
|
|
229
229
|
"weaviate-client": "3.6.2",
|
|
230
230
|
"zod": "3.25.67",
|
|
231
231
|
"zod-to-json-schema": "3.23.3",
|
|
232
|
-
"@n8n/client-oauth2": "0.33.
|
|
232
|
+
"@n8n/client-oauth2": "0.33.7",
|
|
233
233
|
"@n8n/di": "0.10.0",
|
|
234
|
-
"@n8n/
|
|
234
|
+
"@n8n/errors": "0.5.1",
|
|
235
235
|
"@n8n/config": "1.65.9",
|
|
236
236
|
"@n8n/typescript-config": "1.3.1",
|
|
237
|
-
"n8n-
|
|
238
|
-
"n8n-
|
|
239
|
-
"
|
|
237
|
+
"@n8n/json-schema-to-zod": "1.6.0",
|
|
238
|
+
"n8n-nodes-base": "1.121.54",
|
|
239
|
+
"n8n-workflow": "1.120.32"
|
|
240
240
|
},
|
|
241
241
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
242
242
|
"homepage": "https://n8n.io",
|