@n8n/ai-utilities 0.31.0 → 0.32.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/cjs/index.d.ts +3 -1
- package/dist/cjs/index.js +6 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/typecheck.tsbuildinfo +1 -1
- package/dist/cjs/utils/follow-redirects.d.ts +3 -1
- package/dist/cjs/utils/follow-redirects.js +10 -1
- package/dist/cjs/utils/follow-redirects.js.map +1 -1
- package/dist/cjs/utils/http-proxy-agent.d.ts +8 -2
- package/dist/cjs/utils/http-proxy-agent.js +22 -16
- package/dist/cjs/utils/http-proxy-agent.js.map +1 -1
- package/dist/cjs/utils/refreshing-auth-fetch.d.ts +8 -0
- package/dist/cjs/utils/refreshing-auth-fetch.js +68 -0
- package/dist/cjs/utils/refreshing-auth-fetch.js.map +1 -0
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +6 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/typecheck.tsbuildinfo +1 -1
- package/dist/esm/utils/follow-redirects.d.ts +3 -1
- package/dist/esm/utils/follow-redirects.js +10 -1
- package/dist/esm/utils/follow-redirects.js.map +1 -1
- package/dist/esm/utils/http-proxy-agent.d.ts +8 -2
- package/dist/esm/utils/http-proxy-agent.js +22 -16
- package/dist/esm/utils/http-proxy-agent.js.map +1 -1
- package/dist/esm/utils/refreshing-auth-fetch.d.ts +8 -0
- package/dist/esm/utils/refreshing-auth-fetch.js +68 -0
- package/dist/esm/utils/refreshing-auth-fetch.js.map +1 -0
- package/package.json +12 -12
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export interface FollowRedirectsOptions {
|
|
2
|
-
onBeforeHop?: (url: string
|
|
2
|
+
onBeforeHop?: (url: string, info: {
|
|
3
|
+
crossedOrigin: boolean;
|
|
4
|
+
}) => void | Promise<void>;
|
|
3
5
|
maxRedirects?: number;
|
|
4
6
|
}
|
|
5
7
|
export declare function fetchFollowingRedirects(fetcher: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>, url: string | URL, init?: RequestInit, options?: FollowRedirectsOptions): Promise<Response>;
|
|
@@ -3,15 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fetchFollowingRedirects = fetchFollowingRedirects;
|
|
4
4
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
5
|
const DEFAULT_MAX_REDIRECTS = 20;
|
|
6
|
+
const CREDENTIAL_HEADERS = ['authorization', 'cookie', 'proxy-authorization'];
|
|
6
7
|
async function fetchFollowingRedirects(fetcher, url, init, options) {
|
|
7
8
|
const maxRedirects = options?.maxRedirects ?? DEFAULT_MAX_REDIRECTS;
|
|
8
9
|
let currentInput = url;
|
|
9
10
|
let currentInit = { ...init };
|
|
10
11
|
let hops = 0;
|
|
12
|
+
let crossedOrigin = false;
|
|
11
13
|
while (true) {
|
|
12
14
|
const currentUrlString = currentInput instanceof URL ? currentInput.href : currentInput;
|
|
13
15
|
if (options?.onBeforeHop) {
|
|
14
|
-
await options.onBeforeHop(currentUrlString);
|
|
16
|
+
await options.onBeforeHop(currentUrlString, { crossedOrigin });
|
|
15
17
|
}
|
|
16
18
|
const response = await fetcher(currentInput, {
|
|
17
19
|
...currentInit,
|
|
@@ -30,6 +32,13 @@ async function fetchFollowingRedirects(fetcher, url, init, options) {
|
|
|
30
32
|
}
|
|
31
33
|
await response.body?.cancel().catch(() => { });
|
|
32
34
|
currentInput = new URL(location, currentUrlString);
|
|
35
|
+
if (currentInput.origin !== new URL(currentUrlString).origin) {
|
|
36
|
+
crossedOrigin = true;
|
|
37
|
+
const headers = new Headers(currentInit.headers);
|
|
38
|
+
for (const header of CREDENTIAL_HEADERS)
|
|
39
|
+
headers.delete(header);
|
|
40
|
+
currentInit = { ...currentInit, headers };
|
|
41
|
+
}
|
|
33
42
|
const method = (currentInit.method ?? 'GET').toUpperCase();
|
|
34
43
|
const isUnsafe = method !== 'GET' && method !== 'HEAD';
|
|
35
44
|
if (response.status === 303 ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"follow-redirects.js","sourceRoot":"","sources":["../../../src/utils/follow-redirects.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;AAEhD,MAAM,qBAAqB,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"follow-redirects.js","sourceRoot":"","sources":["../../../src/utils/follow-redirects.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;AAEhD,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAajC,MAAM,kBAAkB,GAAG,CAAC,eAAe,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC;AAOvE,KAAK,kCACX,OAA4E,EAC5E,GAAiB,EACjB,IAAkB,EAClB,OAAgC;IAEhC,MAAM,YAAY,GAAG,OAAO,EAAE,YAAY,IAAI,qBAAqB,CAAC;IACpE,IAAI,YAAY,GAAiB,GAAG,CAAC;IACrC,IAAI,WAAW,GAAgB,EAAE,GAAG,IAAI,EAAE,CAAC;IAC3C,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,aAAa,GAAG,KAAK,CAAC;IAE1B,OAAO,IAAI,EAAE,CAAC;QACb,MAAM,gBAAgB,GAAG,YAAY,YAAY,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC;QACxF,IAAI,OAAO,EAAE,WAAW,EAAE,CAAC;YAC1B,MAAM,OAAO,CAAC,WAAW,CAAC,gBAAgB,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC;QAChE,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,YAAY,EAAE;YAC5C,GAAG,WAAW;YACd,QAAQ,EAAE,QAAQ;SAClB,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,MAAM,GAAG,GAAG,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;YACrD,OAAO,QAAQ,CAAC;QAC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AE,IAAI,EAAE,SAAS,EAAE,CAAC;QAClE,CAAC;IACF,CAAC;AACF,CAAC"}
|
|
@@ -6,6 +6,12 @@ export interface AgentTimeoutOptions {
|
|
|
6
6
|
bodyTimeout?: number;
|
|
7
7
|
connectTimeout?: number;
|
|
8
8
|
}
|
|
9
|
-
export declare function getProxyAgent(targetUrl?: string, timeoutOptions?: AgentTimeoutOptions, lookup?: LookupFunction): Agent | ProxyAgent
|
|
10
|
-
export
|
|
9
|
+
export declare function getProxyAgent(targetUrl?: string, timeoutOptions?: AgentTimeoutOptions, lookup?: LookupFunction): Agent | ProxyAgent;
|
|
10
|
+
export interface ProxyFetchOptions {
|
|
11
|
+
input: RequestInfo | URL;
|
|
12
|
+
init?: RequestInit;
|
|
13
|
+
timeoutOptions?: AgentTimeoutOptions;
|
|
14
|
+
lookup: LookupFunction;
|
|
15
|
+
}
|
|
16
|
+
export declare function proxyFetch({ input, init, timeoutOptions, lookup, }: ProxyFetchOptions): Promise<Response>;
|
|
11
17
|
export declare function getNodeProxyAgent(targetUrl?: string, agentOptions?: AgentOptions): import("https").Agent | undefined;
|
|
@@ -4,10 +4,12 @@ exports.getProxyAgent = getProxyAgent;
|
|
|
4
4
|
exports.proxyFetch = proxyFetch;
|
|
5
5
|
exports.getNodeProxyAgent = getNodeProxyAgent;
|
|
6
6
|
const proxy_1 = require("@n8n/backend-network/proxy");
|
|
7
|
+
const node_dns_1 = require("node:dns");
|
|
7
8
|
const undici_1 = require("undici");
|
|
8
9
|
const DEFAULT_TIMEOUT = parseInt(process.env.N8N_AI_TIMEOUT_MAX ?? '3600000', 10);
|
|
9
10
|
const PROXY_FALLBACK_TARGET = 'https://example.nonexistent/';
|
|
10
|
-
|
|
11
|
+
let sharedAgent;
|
|
12
|
+
function getProxyAgent(targetUrl, timeoutOptions, lookup = node_dns_1.lookup) {
|
|
11
13
|
const proxyUrl = (0, proxy_1.resolveProxyUrl)(targetUrl, PROXY_FALLBACK_TARGET);
|
|
12
14
|
const agentOptions = {
|
|
13
15
|
headersTimeout: timeoutOptions?.headersTimeout ?? DEFAULT_TIMEOUT,
|
|
@@ -16,24 +18,28 @@ function getProxyAgent(targetUrl, timeoutOptions, lookup) {
|
|
|
16
18
|
connectTimeout: timeoutOptions.connectTimeout,
|
|
17
19
|
}),
|
|
18
20
|
};
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
return new undici_1.Agent({ ...agentOptions, connect: { lookup } });
|
|
22
|
-
}
|
|
23
|
-
if (timeoutOptions) {
|
|
24
|
-
return new undici_1.Agent(agentOptions);
|
|
25
|
-
}
|
|
26
|
-
if (process.env.N8N_AI_TIMEOUT_MAX) {
|
|
27
|
-
return new undici_1.Agent(agentOptions);
|
|
28
|
-
}
|
|
29
|
-
return undefined;
|
|
21
|
+
if (proxyUrl) {
|
|
22
|
+
return new undici_1.ProxyAgent({ uri: proxyUrl, ...agentOptions });
|
|
30
23
|
}
|
|
31
|
-
|
|
24
|
+
const isDefaultCase = !timeoutOptions && !process.env.N8N_AI_TIMEOUT_MAX && lookup === node_dns_1.lookup;
|
|
25
|
+
if (isDefaultCase) {
|
|
26
|
+
sharedAgent ??= new undici_1.Agent({ ...agentOptions, connect: { lookup } });
|
|
27
|
+
return sharedAgent;
|
|
28
|
+
}
|
|
29
|
+
return new undici_1.Agent({ ...agentOptions, connect: { lookup } });
|
|
32
30
|
}
|
|
33
|
-
async function proxyFetch(input, init, timeoutOptions, lookup) {
|
|
34
|
-
const
|
|
31
|
+
async function proxyFetch({ input, init, timeoutOptions, lookup, }) {
|
|
32
|
+
const isRequest = typeof input !== 'string' && !(input instanceof URL);
|
|
33
|
+
const targetUrl = isRequest ? input.url : input.toString();
|
|
35
34
|
const dispatcher = getProxyAgent(targetUrl, timeoutOptions, lookup);
|
|
36
|
-
return (await (0, undici_1.fetch)(
|
|
35
|
+
return (await (0, undici_1.fetch)(targetUrl, {
|
|
36
|
+
...(isRequest && {
|
|
37
|
+
method: input.method,
|
|
38
|
+
headers: [...input.headers],
|
|
39
|
+
body: input.body === null ? undefined : await input.arrayBuffer(),
|
|
40
|
+
signal: input.signal,
|
|
41
|
+
redirect: input.redirect,
|
|
42
|
+
}),
|
|
37
43
|
...init,
|
|
38
44
|
dispatcher,
|
|
39
45
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-proxy-agent.js","sourceRoot":"","sources":["../../../src/utils/http-proxy-agent.ts"],"names":[],"mappings":";;;;;AAkBA,sDAAoF;
|
|
1
|
+
{"version":3,"file":"http-proxy-agent.js","sourceRoot":"","sources":["../../../src/utils/http-proxy-agent.ts"],"names":[],"mappings":";;;;;AAkBA,sDAAoF;AACpF,uCAAmD;AAInD,mCAAiE;AAejE,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,SAAS,EAAE,EAAE,CAAC,CAAC;AAMlF,MAAM,qBAAqB,GAAG,8BAA8B,CAAC;AAO7D,IAAI,WAA8B,CAAC;AAkBnC,uBACC,SAAkB,EAClB,cAAoC,EACpC,MAAM,GAAmB,iBAAa;IAEtC,MAAM,QAAQ,GAAG,IAAA,uBAAe,EAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC;IAEnE,MAAM,YAAY,GAAG;QACpB,cAAc,EAAE,cAAc,EAAE,cAAc,IAAI,eAAe;QACjE,WAAW,EAAE,cAAc,EAAE,WAAW,IAAI,eAAe;QAC3D,GAAG,CAAC,cAAc,EAAE,cAAc,KAAK,SAAS,IAAI;YACnD,cAAc,EAAE,cAAc,CAAC,cAAc;SAC7C,CAAC;KACF,CAAC;IAEF,IAAI,QAAQ,EAAE,CAAC;QACd,OAAO,IAAI,mBAAU,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,YAAY,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,aAAa,GAClB,CAAC,cAAc,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,MAAM,KAAK,iBAAa,CA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AAI,CAAC,QAAQ,EAAE,CAAC;QACf,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,OAAO,IAAA,6BAAqB,EAAC,SAAS,IAAI,qBAAqB,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;AAC1F,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface RefreshingAuthFetchOptions {
|
|
2
|
+
baseFetch: typeof fetch;
|
|
3
|
+
initialHeaders?: HeadersInit;
|
|
4
|
+
refreshHeaders?: (current: Headers) => Promise<HeadersInit | null>;
|
|
5
|
+
shouldRefresh?: () => boolean;
|
|
6
|
+
assertAllowedUrl?: (url: string) => void | Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare function createRefreshingAuthFetch({ baseFetch, initialHeaders, refreshHeaders, shouldRefresh, assertAllowedUrl, }: RefreshingAuthFetchOptions): typeof fetch;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createRefreshingAuthFetch = createRefreshingAuthFetch;
|
|
4
|
+
const follow_redirects_1 = require("./follow-redirects");
|
|
5
|
+
function mergeHeaders(requestHeaders, authHeaders) {
|
|
6
|
+
const merged = new Headers(requestHeaders);
|
|
7
|
+
authHeaders.forEach((value, name) => merged.set(name, value));
|
|
8
|
+
return merged;
|
|
9
|
+
}
|
|
10
|
+
function getInputHeaders(input, init) {
|
|
11
|
+
return init?.headers ?? (input instanceof Request ? input.headers : undefined);
|
|
12
|
+
}
|
|
13
|
+
function createRefreshingAuthFetch({ baseFetch, initialHeaders, refreshHeaders, shouldRefresh, assertAllowedUrl, }) {
|
|
14
|
+
let authHeaders = new Headers(initialHeaders);
|
|
15
|
+
let authVersion = 0;
|
|
16
|
+
let refreshInFlight;
|
|
17
|
+
const refresh = async () => {
|
|
18
|
+
refreshInFlight ??= (async () => {
|
|
19
|
+
const refreshed = await refreshHeaders?.(new Headers(authHeaders));
|
|
20
|
+
if (!refreshed)
|
|
21
|
+
return false;
|
|
22
|
+
authHeaders = new Headers(refreshed);
|
|
23
|
+
authVersion += 1;
|
|
24
|
+
return true;
|
|
25
|
+
})();
|
|
26
|
+
try {
|
|
27
|
+
return await refreshInFlight;
|
|
28
|
+
}
|
|
29
|
+
finally {
|
|
30
|
+
refreshInFlight = undefined;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return async (input, init) => {
|
|
34
|
+
let retried = false;
|
|
35
|
+
let sendAuth = true;
|
|
36
|
+
const authedFetch = async (requestInput, requestInit) => {
|
|
37
|
+
if (sendAuth && refreshHeaders && shouldRefresh?.()) {
|
|
38
|
+
await refresh();
|
|
39
|
+
}
|
|
40
|
+
const requestAuthVersion = authVersion;
|
|
41
|
+
const execute = async () => await baseFetch(requestInput instanceof Request ? requestInput.clone() : requestInput, {
|
|
42
|
+
...requestInit,
|
|
43
|
+
headers: sendAuth
|
|
44
|
+
? mergeHeaders(getInputHeaders(requestInput, requestInit), authHeaders)
|
|
45
|
+
: getInputHeaders(requestInput, requestInit),
|
|
46
|
+
});
|
|
47
|
+
const response = await execute();
|
|
48
|
+
if (response.status !== 401 || !refreshHeaders || retried || !sendAuth)
|
|
49
|
+
return response;
|
|
50
|
+
retried = true;
|
|
51
|
+
const canRetry = authVersion !== requestAuthVersion || (await refresh());
|
|
52
|
+
if (!canRetry)
|
|
53
|
+
return response;
|
|
54
|
+
await response.body?.cancel().catch(() => { });
|
|
55
|
+
return await execute();
|
|
56
|
+
};
|
|
57
|
+
if (!assertAllowedUrl)
|
|
58
|
+
return await authedFetch(input, init);
|
|
59
|
+
const startUrl = input instanceof Request ? input.url : input;
|
|
60
|
+
return await (0, follow_redirects_1.fetchFollowingRedirects)(authedFetch, startUrl, init, {
|
|
61
|
+
onBeforeHop: async (hopUrl, { crossedOrigin }) => {
|
|
62
|
+
sendAuth = !crossedOrigin;
|
|
63
|
+
await assertAllowedUrl(hopUrl);
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=refreshing-auth-fetch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshing-auth-fetch.js","sourceRoot":"","sources":["../../../src/utils/refreshing-auth-fetch.ts"],"names":[],"mappings":";;;AAAA,yDAA6D;AAU7D,SAAS,YAAY,CAAC,cAAuC,EAAE,WAAoB;IAClF,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;IAC3C,WAAW,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAC9D,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,eAAe,CAAC,KAAwB,EAAE,IAAkB;IACpE,OAAO,IAAI,EAAE,OAAO,IAAI,CAAC,KAAK,YAAY,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AAChF,CAAC;AAED,mCAA0C,EACzC,SAAS,EACT,cAAc,EACd,cAAc,EACd,aAAa,EACb,gBAAgB,GACY;IAC5B,IAAI,WAAW,GAAG,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;IAC9C,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,IAAI,eAA6C,CAAC;IAElD,MAAM,OAAO,GAAG,KAAK,IAAsB,EAAE;QAC5C,eAAe,KAAK,CAAC,KAAK,IAAI,EAAE;YAC/B,MAAM,SAAS,GAAG,MAAM,cAAc,EAAE,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC;YACnE,IAAI,CAAC,SAAS;gBAAE,OAAO,KAAK,CAAC;YAC7B,WAAW,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;YACrC,WAAW,IAAI,CAAC,CAAC;YACjB,OAAO,IAAI,CAAC;QACb,CAAC,CAAC,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MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;YAC9C,OAAO,MAAM,OAAO,EAAE,CAAC;QACxB,CAAC,CAAC;QAEF,IAAI,CAAC,gBAAgB;YAAE,OAAO,MAAM,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAI7D,MAAM,QAAQ,GAAG,KAAK,YAAY,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;QAC9D,OAAO,MAAM,IAAA,0CAAuB,EAAC,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE;YACjE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE;gBAChD,QAAQ,GAAG,CAAC,aAAa,CAAC;gBAC1B,MAAM,gBAAgB,CAAC,MAAM,CAAC,CAAC;YAChC,CAAC;SACD,CAAC,CAAC;IACJ,CAAC,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/ai-utilities",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "Utilities for building AI nodes in n8n",
|
|
5
5
|
"types": "dist/esm/index.d.ts",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -99,11 +99,12 @@
|
|
|
99
99
|
},
|
|
100
100
|
"files": [
|
|
101
101
|
"dist",
|
|
102
|
-
"
|
|
103
|
-
"
|
|
102
|
+
"LICENSE_EE.md",
|
|
103
|
+
"LICENSE.md"
|
|
104
104
|
],
|
|
105
105
|
"devDependencies": {
|
|
106
106
|
"@types/json-schema": "^7.0.15",
|
|
107
|
+
"@n8n/vitest-config": "1.21.0",
|
|
107
108
|
"@vitest/coverage-v8": "4.1.9",
|
|
108
109
|
"vite": "^8.0.2",
|
|
109
110
|
"vitest": "^4.1.9",
|
|
@@ -115,8 +116,7 @@
|
|
|
115
116
|
"tsx": "^4.19.3",
|
|
116
117
|
"typescript": "7.0.2",
|
|
117
118
|
"axios": "1.18.0",
|
|
118
|
-
"nock": "14.0.14"
|
|
119
|
-
"@n8n/vitest-config": "1.21.0"
|
|
119
|
+
"nock": "14.0.14"
|
|
120
120
|
},
|
|
121
121
|
"dependencies": {
|
|
122
122
|
"zod": "3.25.76",
|
|
@@ -128,17 +128,17 @@
|
|
|
128
128
|
"@langchain/openai": "1.4.4",
|
|
129
129
|
"langchain": "1.2.30",
|
|
130
130
|
"lodash": "4.18.1",
|
|
131
|
+
"@n8n/api-types": "1.39.0",
|
|
132
|
+
"@n8n/backend-network": "1.13.0",
|
|
133
|
+
"@n8n/config": "2.37.0",
|
|
134
|
+
"@n8n/typescript-config": "1.11.0",
|
|
135
|
+
"@n8n/utils": "1.47.0",
|
|
136
|
+
"n8n-workflow": "2.39.0",
|
|
131
137
|
"tmp-promise": "3.0.3",
|
|
132
138
|
"js-tiktoken": "1.0.21",
|
|
133
139
|
"@thednp/dommatrix": "^3.1.1",
|
|
134
140
|
"pdf-parse": "2.4.5",
|
|
135
|
-
"undici": "^7.29.0"
|
|
136
|
-
"@n8n/api-types": "1.38.0",
|
|
137
|
-
"@n8n/backend-network": "1.12.0",
|
|
138
|
-
"@n8n/typescript-config": "1.11.0",
|
|
139
|
-
"@n8n/config": "2.36.0",
|
|
140
|
-
"n8n-workflow": "2.38.0",
|
|
141
|
-
"@n8n/utils": "1.46.0"
|
|
141
|
+
"undici": "^7.29.0"
|
|
142
142
|
},
|
|
143
143
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
144
144
|
"homepage": "https://n8n.io",
|