mirror of
https://github.com/n8n-io/n8n.git
synced 2026-12-04 00:30:34 +00:00
ci: Add a weekly broken link check with lychee (no-changelog) (#39740)
This commit is contained in:
1 parent
7b6dc99815
commit
bf42c73adc
34 files changed
+732
-50
No files matched your search
@@ -25,7 +25,7 @@ Complete reference for n8n's `.github/` folder.
|
||||
│ ├── update-changelog.mjs # Generate CHANGELOG
|
||||
│ ├── trim-fe-packageJson.js # Strip frontend devDeps
|
||||
│ ├── ensure-provenance-fields.mjs # Add license/author fields
|
||||
│ ├── validate-docs-links.js # Check documentation URLs
|
||||
│ ├── link-check/ # Weekly link check config and report
|
||||
│ ├── check-inflight.mjs # Reject inflight in checked-in pnpm lockfiles
|
||||
│ ├── send-build-stats.mjs # Turbo build telemetry → webhook
|
||||
│ └── docker/
|
||||
@@ -652,7 +652,6 @@ Push to master
|
||||
| Daily 00:00 | `test-db.yml` | Database compatibility |
|
||||
| Daily 00:00 | `test-e2e-performance-reusable.yml`| Browser performance and idle memory baselines |
|
||||
| Daily 00:00 | `release-storybook.yml` | Storybook deploy |
|
||||
| Daily 00:00 | `util-check-docs-urls.yml` | Doc link validation |
|
||||
| Daily 01:30, 02:30, 03:30 | `test-benchmark-nightly.yml` | Performance benchmarks |
|
||||
| Daily 02:00 | `test-get-n8n.yml` | get.n8n.io installer health |
|
||||
| Daily 02:00 | `test-e2e-pc-nightly.yml` | E2E on the `-pc` image |
|
||||
@@ -663,6 +662,7 @@ Push to master
|
||||
| Daily 08:00 | `build-v3-nightly.yml` | Nightly v3 Docker images |
|
||||
| Monday 00:00 | `util-update-node-popularity.yml` | Node usage stats |
|
||||
| Monday 02:00 | `test-e2e-coverage-weekly.yml` | Weekly E2E coverage |
|
||||
| Monday 06:00 | `test-link-check-weekly.yml` | Broken links in `packages/` |
|
||||
| Wednesday 04:00 | `util-update-get-n8n-versions.yml` | get-n8n stable versions |
|
||||
| Saturday 22:00 | `test-evals-ai.yml` | AI workflow evals |
|
||||
| 1st of month 04:00 | `util-refresh-cubic-schema.yml` | Refresh vendored cubic schema |
|
||||
@@ -850,7 +850,7 @@ Scripts in `.github/scripts/`:
|
||||
|
||||
| Script | Purpose | Called By |
|
||||
|-------------------------|-------------------|---------------------------|
|
||||
| `validate-docs-links.js`| Check doc URLs | `util-check-docs-urls.yml`|
|
||||
| `link-check/check-report.mjs` | Decide which lychee failures are broken links | `test-link-check-weekly.yml` |
|
||||
| `send-build-stats.mjs` | Build telemetry | `setup-nodejs` action |
|
||||
| `resolve-pnpm-version.mjs` | Publish the pinned pnpm version and its executable cache key | `setup-nodejs` action |
|
||||
| `nightly-sbom-context.mjs` | Resolve the source SHA and image tag for nightly SBOM validation | `test-sbom-nightly.yml` |
|
||||
|
||||
@@ -0,0 +1,236 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Decide which failures in a lychee JSON report are broken links.
|
||||
*
|
||||
* Usage:
|
||||
* node .github/scripts/link-check/check-report.mjs lychee-report.json
|
||||
*
|
||||
* Lychee cannot do this itself: it cannot run a browser, it checks anchors the
|
||||
* same way on all hosts, and it does not know when a line changed.
|
||||
*
|
||||
* - Missing anchors count only on docs.n8n.io. Many other sites add their
|
||||
* anchors with JavaScript.
|
||||
* - 403, 429, 999, rejected redirects, 5xx, timeouts, and network errors open
|
||||
* again in headless Chrome. Many sites block HTTP clients but serve browsers,
|
||||
* and a later request shows if a failure persists. Chrome opens no new links
|
||||
* after 8 minutes, and an open page can take one more minute. Links that
|
||||
* Chrome did not open count as broken.
|
||||
* - A broken docs.n8n.io link on a line that changed in the last 30 days is
|
||||
* pending, because code often ships before its docs page. Needs git history
|
||||
* for that period.
|
||||
* - Other failures, such as 404, are broken.
|
||||
*
|
||||
* Prints the broken and pending links, adds them to $GITHUB_STEP_SUMMARY, and
|
||||
* exits 1 if there are broken links. Needs Chrome, which GitHub-hosted and
|
||||
* Blacksmith Ubuntu runners include.
|
||||
*/
|
||||
import { execFileSync } from 'node:child_process';
|
||||
import { appendFile, readFile } from 'node:fs/promises';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
|
||||
const STRICT_ANCHOR_HOST = 'docs.n8n.io';
|
||||
const BROWSER_CONCURRENCY = 4;
|
||||
const BROWSER_BUDGET_MS = 8 * 60 * 1000;
|
||||
const GRACE_PERIOD_MS = 30 * 24 * 60 * 60 * 1000;
|
||||
const BROWSER_STATUSES = new Set([403, 429, 999]);
|
||||
const CHALLENGE_TITLE = /just a moment|attention required|security checkpoint/i;
|
||||
|
||||
export function collectFailures(report) {
|
||||
const failures = [
|
||||
...Object.entries(report.error_map ?? {}),
|
||||
...Object.entries(report.timeout_map ?? {}),
|
||||
].flatMap(([file, entries]) =>
|
||||
entries.map((entry) => ({
|
||||
file,
|
||||
line: entry.span?.line,
|
||||
url: entry.url,
|
||||
// A remapped URL is checked at its new address. The report shows the URL from the code.
|
||||
sourceUrl: entry.remap?.original?.url ?? entry.url,
|
||||
code: entry.status?.code ?? null,
|
||||
text: entry.status?.text ?? '',
|
||||
})),
|
||||
);
|
||||
|
||||
// Lychee reports a repeated URL as "Error (cached)" without the reason.
|
||||
const firstReport = new Map(
|
||||
failures.filter((f) => !f.text.includes('(cached)')).map((f) => [f.url, f]),
|
||||
);
|
||||
return failures.map((f) => {
|
||||
const first = firstReport.get(f.url);
|
||||
return first ? { ...f, code: first.code, text: first.text } : f;
|
||||
});
|
||||
}
|
||||
|
||||
export function classify({ url, code, text }) {
|
||||
if (code === null && /fragment/i.test(text)) {
|
||||
return new URL(url).hostname === STRICT_ANCHOR_HOST ? 'broken' : 'ignore';
|
||||
}
|
||||
if (
|
||||
/^timeout$|^network error/i.test(text) ||
|
||||
BROWSER_STATUSES.has(code) ||
|
||||
(code >= 300 && code < 400) ||
|
||||
code >= 500
|
||||
) {
|
||||
return 'browser';
|
||||
}
|
||||
return 'broken';
|
||||
}
|
||||
|
||||
export function isBrowserPass({ status, title }) {
|
||||
return (
|
||||
status > 0 && status < 400 && !/\b404\b|not found/i.test(title) && !CHALLENGE_TITLE.test(title)
|
||||
);
|
||||
}
|
||||
|
||||
/** Returns the commit time of a `git blame --porcelain` line in ms, or null if the commit is at the edge of the fetched history. */
|
||||
export function parseBlameTime(porcelain) {
|
||||
if (/^boundary$/m.test(porcelain)) return null;
|
||||
const time = porcelain.match(/^committer-time (\d+)$/m);
|
||||
return time ? Number(time[1]) * 1000 : null;
|
||||
}
|
||||
|
||||
export function isInGracePeriod({ url }, changedAt, now) {
|
||||
return (
|
||||
new URL(url).hostname === STRICT_ANCHOR_HOST &&
|
||||
changedAt !== null &&
|
||||
now - changedAt < GRACE_PERIOD_MS
|
||||
);
|
||||
}
|
||||
|
||||
function lineChangedAt({ file, line }) {
|
||||
try {
|
||||
const porcelain = execFileSync(
|
||||
'git',
|
||||
['blame', '--porcelain', '-L', `${line},${line}`, '--', file],
|
||||
{
|
||||
encoding: 'utf8',
|
||||
stdio: ['ignore', 'pipe', 'ignore'],
|
||||
},
|
||||
);
|
||||
return parseBlameTime(porcelain);
|
||||
} catch {
|
||||
// A line that git cannot blame counts as old, so the link is reported.
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async function checkPage(context, url) {
|
||||
const page = await context.newPage();
|
||||
try {
|
||||
const response = await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 30_000 });
|
||||
let status = response?.status() ?? 0;
|
||||
page.on('response', (r) => {
|
||||
if (r.request().isNavigationRequest() && r.frame() === page.mainFrame()) status = r.status();
|
||||
});
|
||||
// Bot challenges such as Cloudflare's pass after a few seconds, then reload the page.
|
||||
await page
|
||||
.waitForFunction(
|
||||
(source) => !new RegExp(source, 'i').test(document.title),
|
||||
CHALLENGE_TITLE.source,
|
||||
{ timeout: 30_000 },
|
||||
)
|
||||
.catch(() => {});
|
||||
const result = { status, title: await page.title() };
|
||||
console.log(`browser: ${result.status} "${result.title}" ${url}`);
|
||||
return result;
|
||||
} catch (error) {
|
||||
const reason = error.message.split('\n')[0];
|
||||
console.log(`browser: failed ${url}: ${reason}`);
|
||||
return { status: 0, title: reason };
|
||||
} finally {
|
||||
await page.close();
|
||||
}
|
||||
}
|
||||
|
||||
/** Splits URLs into groups by host, so that each host gets one request at a time. */
|
||||
export function groupByHost(urls) {
|
||||
return [...Map.groupBy(urls, (url) => new URL(url).hostname).values()];
|
||||
}
|
||||
|
||||
async function checkInBrowser(urls) {
|
||||
const { chromium } = await import('playwright-core');
|
||||
const browser = await chromium.launch({ channel: 'chrome' });
|
||||
const version = browser.version();
|
||||
// The default headless user agent contains "HeadlessChrome", which bot filters block.
|
||||
const context = await browser.newContext({
|
||||
userAgent: `Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${version} Safari/537.36`,
|
||||
});
|
||||
|
||||
const queue = groupByHost(urls);
|
||||
const results = new Map();
|
||||
const skipped = [];
|
||||
const deadline = Date.now() + BROWSER_BUDGET_MS;
|
||||
const worker = async () => {
|
||||
for (let group = queue.shift(); group; group = queue.shift()) {
|
||||
for (const url of group) {
|
||||
if (Date.now() > deadline) skipped.push(url);
|
||||
else results.set(url, await checkPage(context, url));
|
||||
}
|
||||
}
|
||||
};
|
||||
await Promise.all(Array.from({ length: BROWSER_CONCURRENCY }, worker));
|
||||
await browser.close();
|
||||
if (skipped.length > 0) {
|
||||
console.log(`browser: time budget used, did not open ${skipped.length} links`);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
function formatReport(broken) {
|
||||
const byUrl = Map.groupBy(broken, (f) => f.url);
|
||||
return [...byUrl].map(([url, list]) => {
|
||||
const where = list.map((f) => `${f.file}:${f.line}`).join(', ');
|
||||
return `- ${list[0].sourceUrl} (${list[0].text || list[0].code}) in ${where}`;
|
||||
});
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const [reportPath] = process.argv.slice(2);
|
||||
if (!reportPath) throw new Error('Usage: check-report.mjs <lychee-report.json>');
|
||||
|
||||
const report = JSON.parse(await readFile(reportPath, 'utf8'));
|
||||
// An empty or unexpected report means lychee checked nothing, not that every link works.
|
||||
if (!('error_map' in report) || !report.total) {
|
||||
throw new Error(`Lychee report has no checked links: ${reportPath}`);
|
||||
}
|
||||
const failures = collectFailures(report);
|
||||
const toBrowser = [
|
||||
...new Set(failures.filter((f) => classify(f) === 'browser').map((f) => f.url)),
|
||||
];
|
||||
const browserResults = toBrowser.length > 0 ? await checkInBrowser(toBrowser) : new Map();
|
||||
|
||||
const broken = failures.flatMap((f) => {
|
||||
const kind = classify(f);
|
||||
if (kind === 'broken') return [f];
|
||||
if (kind !== 'browser') return [];
|
||||
// Links that Chrome did not open keep the reason from lychee.
|
||||
const result = browserResults.get(f.url);
|
||||
if (!result) return [f];
|
||||
return isBrowserPass(result)
|
||||
? []
|
||||
: [{ ...f, text: `browser ${result.status} "${result.title}"` }];
|
||||
});
|
||||
const now = Date.now();
|
||||
const pending = new Set(broken.filter((f) => isInGracePeriod(f, lineChangedAt(f), now)));
|
||||
const lines = formatReport(broken.filter((f) => !pending.has(f)));
|
||||
const pendingLines = formatReport([...pending]);
|
||||
const summary = [
|
||||
lines.length === 0
|
||||
? 'No broken links found.'
|
||||
: `Found ${lines.length} broken links:\n\n${lines.join('\n')}`,
|
||||
pendingLines.length > 0 &&
|
||||
`${pendingLines.length} docs.n8n.io links changed in the last 30 days and do not work yet:\n\n${pendingLines.join('\n')}`,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join('\n\n');
|
||||
|
||||
console.log(summary);
|
||||
if (process.env.GITHUB_STEP_SUMMARY) {
|
||||
await appendFile(process.env.GITHUB_STEP_SUMMARY, `## Link check\n\n${summary}\n`);
|
||||
}
|
||||
if (lines.length > 0) process.exit(1);
|
||||
}
|
||||
|
||||
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
|
||||
await main();
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
|
||||
import {
|
||||
classify,
|
||||
collectFailures,
|
||||
groupByHost,
|
||||
isBrowserPass,
|
||||
isInGracePeriod,
|
||||
parseBlameTime,
|
||||
} from './check-report.mjs';
|
||||
|
||||
const entry = (url, status, line = 1) => ({ url, status, span: { line, column: 1 } });
|
||||
|
||||
test('collectFailures reuses the first reason for cached entries', () => {
|
||||
const report = {
|
||||
error_map: {
|
||||
'a.ts': [entry('https://x.com/#a', { text: 'Cannot find fragment' })],
|
||||
'b.ts': [entry('https://x.com/#a', { text: 'Error (cached)' }, 7)],
|
||||
},
|
||||
timeout_map: { 'c.ts': [entry('https://slow.com/', { text: 'Timeout' })] },
|
||||
};
|
||||
|
||||
assert.deepEqual(
|
||||
collectFailures(report).map(({ file, line, text }) => ({ file, line, text })),
|
||||
[
|
||||
{ file: 'a.ts', line: 1, text: 'Cannot find fragment' },
|
||||
{ file: 'b.ts', line: 7, text: 'Cannot find fragment' },
|
||||
{ file: 'c.ts', line: 1, text: 'Timeout' },
|
||||
],
|
||||
);
|
||||
});
|
||||
|
||||
test('collectFailures keeps the URL from the code for remapped links', () => {
|
||||
const remapped = {
|
||||
...entry('https://registry.npmjs.org/x', { code: 404, text: 'Not Found' }),
|
||||
remap: { original: { url: 'https://www.npmjs.com/package/x' } },
|
||||
};
|
||||
const [failure] = collectFailures({ error_map: { 'a.ts': [remapped] } });
|
||||
assert.equal(failure.url, 'https://registry.npmjs.org/x');
|
||||
assert.equal(failure.sourceUrl, 'https://www.npmjs.com/package/x');
|
||||
});
|
||||
|
||||
test('classify counts missing anchors only on docs.n8n.io', () => {
|
||||
const text = 'Cannot find fragment';
|
||||
assert.equal(classify({ url: 'https://docs.n8n.io/page/#a', code: null, text }), 'broken');
|
||||
assert.equal(classify({ url: 'https://github.com/x#a', code: null, text }), 'ignore');
|
||||
});
|
||||
|
||||
test('classify sends blocked, redirected, failing, timed-out, and unreachable links to the browser', () => {
|
||||
for (const code of [302, 403, 429, 500, 503, 999]) {
|
||||
assert.equal(classify({ url: 'https://x.com/', code, text: '' }), 'browser');
|
||||
}
|
||||
assert.equal(classify({ url: 'https://x.com/', code: null, text: 'Timeout' }), 'browser');
|
||||
assert.equal(
|
||||
classify({ url: 'https://x.com/', code: null, text: 'Network error: Connection failed' }),
|
||||
'browser',
|
||||
);
|
||||
});
|
||||
|
||||
test('classify treats other failures as broken', () => {
|
||||
assert.equal(classify({ url: 'https://x.com/', code: 404, text: '' }), 'broken');
|
||||
assert.equal(classify({ url: 'https://x.com/', code: 410, text: '' }), 'broken');
|
||||
});
|
||||
|
||||
test('isBrowserPass rejects error statuses and not-found pages', () => {
|
||||
assert.equal(isBrowserPass({ status: 200, title: 'Convert string - Stack Overflow' }), true);
|
||||
assert.equal(isBrowserPass({ status: 403, title: 'Just a moment...' }), false);
|
||||
assert.equal(isBrowserPass({ status: 200, title: 'Just a moment...' }), false);
|
||||
assert.equal(isBrowserPass({ status: 200, title: 'Page not found' }), false);
|
||||
assert.equal(isBrowserPass({ status: 200, title: '404 Error | Salesforce Developers' }), false);
|
||||
assert.equal(isBrowserPass({ status: 0, title: '' }), false);
|
||||
});
|
||||
|
||||
test('parseBlameTime reads the commit time and treats history boundaries as unknown', () => {
|
||||
const blame = 'abc 1 1 1\nauthor A\ncommitter-time 1790000000\nfilename x.ts\n\tline';
|
||||
assert.equal(parseBlameTime(blame), 1790000000000);
|
||||
assert.equal(parseBlameTime(blame.replace('filename', 'boundary\nfilename')), null);
|
||||
});
|
||||
|
||||
test('isInGracePeriod applies only to recent docs.n8n.io lines', () => {
|
||||
const day = 24 * 60 * 60 * 1000;
|
||||
const now = 100 * day;
|
||||
const docs = { url: 'https://docs.n8n.io/page/' };
|
||||
assert.equal(isInGracePeriod(docs, now - 29 * day, now), true);
|
||||
assert.equal(isInGracePeriod(docs, now - 31 * day, now), false);
|
||||
assert.equal(isInGracePeriod(docs, null, now), false);
|
||||
assert.equal(isInGracePeriod({ url: 'https://example.org/' }, now - day, now), false);
|
||||
});
|
||||
|
||||
test('groupByHost keeps the URLs of one host together', () => {
|
||||
assert.deepEqual(groupByHost(['https://a.com/1', 'https://b.com/1', 'https://a.com/2']), [
|
||||
['https://a.com/1', 'https://a.com/2'],
|
||||
['https://b.com/1'],
|
||||
]);
|
||||
});
|
||||
@@ -0,0 +1,127 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Prepare the input for lychee: a copy of each file in packages/ with only the
|
||||
* links that a person follows.
|
||||
*
|
||||
* Usage, from the repository root:
|
||||
* node .github/scripts/link-check/extract.mjs <out-dir>
|
||||
*
|
||||
* Lychee cannot do this itself. Its exclude rules see only the URL or the file
|
||||
* path, so they cannot tell an API base URL in a string from a help link.
|
||||
*
|
||||
* - `git grep` lists the tracked files with a URL, a credential docs slug, or
|
||||
* DOCS_DOMAIN.
|
||||
* - Each copy keeps HTML and markdown links, doc link properties, comments,
|
||||
* URLs in text that is not an example, and all lines of codex, locale, and
|
||||
* markdown files. Other lines are blank, so the report shows the real file:line.
|
||||
* - URLs that the code builds at runtime (credential slugs, DOCS_DOMAIN) are
|
||||
* expanded, and string escapes that lychee reads as part of a URL are removed.
|
||||
*
|
||||
* Prints the paths of the copies. Run lychee in <out-dir>, so that its report
|
||||
* shows repository paths.
|
||||
*/
|
||||
import { spawn } from 'node:child_process';
|
||||
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
||||
import { dirname, join } from 'node:path';
|
||||
import { createInterface } from 'node:readline';
|
||||
import { pathToFileURL } from 'node:url';
|
||||
|
||||
const FILE_PATTERNS = ['http://', 'https://', "documentationUrl = '", 'DOCS_DOMAIN'];
|
||||
const FILE_GLOBS = ['ts', 'vue', 'json', 'mjs', 'js', 'md'].map((ext) => `packages/**/*.${ext}`);
|
||||
|
||||
const KEY =
|
||||
/(?:doc|docs|documentation|help|learn|guide|info|more|reference|support|pricing|terms|privacy|legal|page|article|blog|video|tutorial)\w*(?:url|uri|link|href)["']?\s*[:=]/i;
|
||||
const KEY_AT_END = new RegExp(String.raw`${KEY.source}\s*$`, 'i');
|
||||
const LINK = new RegExp(
|
||||
[
|
||||
String.raw`href=`,
|
||||
String.raw`\bto=["']`,
|
||||
String.raw`\]\(https?://`,
|
||||
String.raw`docs\.n8n\.io`,
|
||||
String.raw`DOCS_DOMAIN`,
|
||||
KEY.source,
|
||||
String.raw`^\s*(?://|\*|/\*)`,
|
||||
String.raw`\s//.*https?://`,
|
||||
String.raw`<!--.*https?://`,
|
||||
].join('|'),
|
||||
'i',
|
||||
);
|
||||
// A URL after a word, such as "refer to https://...", unless the text is an example.
|
||||
const IN_TEXT = /[^\s"'`=(]\s+https?:\/\//;
|
||||
const EXAMPLE = /placeholder|e\.g\.|for example|if the url is|\bhint\s*:/i;
|
||||
const CREDENTIAL_SLUG = /documentationUrl = '([\w/-]+)'/g;
|
||||
|
||||
function normalize(raw, credential) {
|
||||
const line = raw.includes('\\') ? raw.replaceAll('\\"', '"').replaceAll('\\n', ' ') : raw;
|
||||
if (credential) {
|
||||
return line.replace(
|
||||
CREDENTIAL_SLUG,
|
||||
"documentationUrl = 'https://docs.n8n.io/integrations/builtin/credentials/$1/'",
|
||||
);
|
||||
}
|
||||
return line.includes('${DOCS_DOMAIN}') ? line.replaceAll('${DOCS_DOMAIN}', 'docs.n8n.io') : line;
|
||||
}
|
||||
|
||||
// Only a doc link property with its value on the next line ends with ":" or "=".
|
||||
const endsWithKey = (line) => /[:=]\s*$/.test(line) && KEY_AT_END.test(line);
|
||||
|
||||
/** Returns the text of `path` with every line blanked that has no link to check. */
|
||||
export function filterText(path, text) {
|
||||
const keepAll = /(\.node\.json|\/locales\/[^/]+\.json|\.md)$/.test(path);
|
||||
const credential = path.endsWith('.credentials.ts');
|
||||
const lines = text.split('\n').map((raw) => normalize(raw, credential));
|
||||
// Markdown keeps its code fences, so that lychee skips code blocks as it does by default.
|
||||
if (keepAll) return lines.join('\n');
|
||||
return lines
|
||||
.map((line, i) => {
|
||||
// Most lines have no URL, and lychee finds nothing to check on them.
|
||||
if (!line.includes('http')) return '';
|
||||
// The formatter can put the value of a doc link property on the next line.
|
||||
const afterKey = i > 0 && endsWithKey(lines[i - 1]);
|
||||
const keep = afterKey || LINK.test(line) || (IN_TEXT.test(line) && !EXAMPLE.test(line));
|
||||
return keep ? line : '';
|
||||
})
|
||||
.join('\n');
|
||||
}
|
||||
|
||||
/** Yields the files that git grep finds, while it is still searching. */
|
||||
async function* listFiles() {
|
||||
const patterns = FILE_PATTERNS.flatMap((pattern) => ['-e', pattern]);
|
||||
const git = spawn('git', ['grep', '-l', '-F', ...patterns, '--', ...FILE_GLOBS], {
|
||||
stdio: ['ignore', 'pipe', 'inherit'],
|
||||
});
|
||||
const exit = new Promise((resolve) => git.on('close', resolve));
|
||||
for await (const file of createInterface({ input: git.stdout })) yield file;
|
||||
// git grep exits 1 when no file matches.
|
||||
const code = await exit;
|
||||
if (code !== 0 && code !== 1) throw new Error(`git grep exited with ${code}`);
|
||||
}
|
||||
|
||||
async function extract(file, outDir) {
|
||||
const text = filterText(file, await readFile(file, 'utf8'));
|
||||
// A file without URLs gives lychee nothing to check.
|
||||
if (!text.includes('http')) return null;
|
||||
const target = join(outDir, file);
|
||||
await mkdir(dirname(target), { recursive: true });
|
||||
await writeFile(target, text);
|
||||
return file;
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const [outDir] = process.argv.slice(2);
|
||||
if (!outDir) throw new Error('Usage: extract.mjs <out-dir>');
|
||||
|
||||
const pending = [];
|
||||
for await (const file of listFiles()) pending.push(extract(file, outDir));
|
||||
const written = await Promise.all(pending);
|
||||
process.stdout.write(
|
||||
written
|
||||
.filter(Boolean)
|
||||
.map((file) => `${file}\n`)
|
||||
.join(''),
|
||||
);
|
||||
}
|
||||
|
||||
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
|
||||
await main();
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
|
||||
import { filterText } from './extract.mjs';
|
||||
|
||||
const filter = (path, lines) => filterText(path, lines.join('\n')).split('\n');
|
||||
|
||||
test('keeps links that a person follows and blanks other URLs', () => {
|
||||
const lines = [
|
||||
"baseURL: 'https://api.example.org/v1',",
|
||||
'description: \'See <a href="https://docs.example.org/a">docs</a>\',',
|
||||
"docsUrl: 'https://docs.example.org/b',",
|
||||
'docURL:',
|
||||
"\t'https://docs.example.org/c',",
|
||||
'// https://docs.example.org/d',
|
||||
"description: 'Refer to https://docs.example.org/e for details.',",
|
||||
"placeholder: 'e.g. https://my.example.org/f',",
|
||||
];
|
||||
const kept = filter('node.ts', lines).map((line) => line !== '');
|
||||
assert.deepEqual(kept, [false, true, true, false, true, true, true, false]);
|
||||
});
|
||||
|
||||
test('expands credential docs slugs and the docs domain constant', () => {
|
||||
assert.deepEqual(filter('X.credentials.ts', ["\tdocumentationUrl = 'slack';"]), [
|
||||
"\tdocumentationUrl = 'https://docs.n8n.io/integrations/builtin/credentials/slack/';",
|
||||
]);
|
||||
assert.deepEqual(filter('urls.ts', ['const docsUrl = `https://${DOCS_DOMAIN}/a`;']), [
|
||||
'const docsUrl = `https://docs.n8n.io/a`;',
|
||||
]);
|
||||
});
|
||||
|
||||
test('removes string escapes from URLs', () => {
|
||||
assert.deepEqual(filter('en.json', ['"a": "<a href=\\"https://x.org/\\">x</a>\\nmore"']), [
|
||||
'"a": "<a href="https://x.org/">x</a> more"',
|
||||
]);
|
||||
});
|
||||
|
||||
test('keeps every line of codex, locale, and markdown files', () => {
|
||||
assert.deepEqual(filter('X.node.json', ['{"url": "https://docs.example.org/g"}']), [
|
||||
'{"url": "https://docs.example.org/g"}',
|
||||
]);
|
||||
assert.deepEqual(filter('README.md', ["baseURL: 'https://docs.example.org/h'"]), [
|
||||
"baseURL: 'https://docs.example.org/h'",
|
||||
]);
|
||||
assert.deepEqual(filter('README.md', ['```sh', 'curl https://x.org/i.sh', '```']), [
|
||||
'```sh',
|
||||
'curl https://x.org/i.sh',
|
||||
'```',
|
||||
]);
|
||||
});
|
||||
@@ -0,0 +1,79 @@
|
||||
# Weekly check of the links in packages/. See .github/workflows/test-link-check-weekly.yml.
|
||||
# Run from the repository root:
|
||||
# dir=$(mktemp -d)
|
||||
# node .github/scripts/link-check/extract.mjs "$dir" \
|
||||
# | (cd "$dir" && lychee --config "$OLDPWD/.github/scripts/link-check/lychee.toml" --files-from - --output "$OLDPWD/report.json")
|
||||
# node .github/scripts/link-check/check-report.mjs report.json
|
||||
|
||||
no_progress = true
|
||||
mode = "plain"
|
||||
format = "json"
|
||||
include_fragments = "anchor-only"
|
||||
|
||||
user_agent = "Mozilla/5.0 (compatible; n8n-link-check; +https://github.com/n8n-io/n8n)"
|
||||
timeout = 20
|
||||
# Retries wait 5, 10, 20, and 40 seconds, so that short server outages pass.
|
||||
max_retries = 4
|
||||
retry_wait_time = 5
|
||||
max_redirects = 10
|
||||
max_concurrency = 32
|
||||
host_concurrency = 4
|
||||
host_request_interval = "100ms"
|
||||
scheme = ["https", "http"]
|
||||
exclude_all_private = true
|
||||
|
||||
# npmjs.com shows GitHub runners a bot challenge, also in a browser. The registry API does not.
|
||||
remap = ['^https://(?:www\.)?npmjs\.com/package/(.+)$ https://registry.npmjs.org/$1']
|
||||
|
||||
exclude_path = [
|
||||
'\.(test|spec)\.',
|
||||
'/__tests?__/',
|
||||
'/(test|tests|fixtures|e2e)/',
|
||||
'test-helpers\.ts$',
|
||||
'^packages/quality/',
|
||||
# These comments contain URLs that lychee cannot parse, which fails the run.
|
||||
'^packages/@n8n/engine/src/database/data-source\.ts$',
|
||||
'^packages/@n8n/utils/src/scrub-secrets\.ts$',
|
||||
]
|
||||
|
||||
exclude = [
|
||||
# Template strings and URLs built at runtime.
|
||||
'%7B', '\{', '\$', '%24',
|
||||
# Placeholder and example values.
|
||||
'^https?://([^/@]*@)?[^./:@]+(:\d+)?(/|$)',
|
||||
'^https?://([^/]+\.)?(example|test)\.(com|org|net|nonexistent)',
|
||||
'^https?://([^/]*\.)?(your|my-|xyzcompany|contoso|tenant123|company\.|n8n\.host)',
|
||||
'^https?://(resourcename\.openai\.azure\.com|bucket\.host|mcp\.github\.com)',
|
||||
'xxxxx|USERID|PRESENTATION_ID|/org/repo|/owner/repo|/user/repository|1ABC123XYZ',
|
||||
'^https?://(example\.rocket\.chat|docs\.myservice\.com)',
|
||||
'^https://github\.com/(acme|myuser)/',
|
||||
# A private document in a code comment.
|
||||
'^https://docs\.google\.com/document/d/1TUJGUf5HUv9e6MJBzcOsPruxXDeGMnGYTBWfkMagcg4',
|
||||
'^https://samltest\.id/',
|
||||
# API endpoints. They reject plain GET requests.
|
||||
'^https?://api[.-][^/]*/(.*/)?v\d+(\.\d+)?(/|$)',
|
||||
'/oauth2?/(v\d+/)?(token|authorize)',
|
||||
'^https?://[^/]+\.googleapis\.com',
|
||||
'^https?://graph\.microsoft\.com',
|
||||
'^https://(eu\.)?api\.smith\.langchain\.com',
|
||||
'^https://www\.reddit\.com/.*\.json$',
|
||||
# A URL prefix that the editor appends package names to.
|
||||
'^https://www\.npmjs\.com/package/$',
|
||||
# Bot checks block GitHub runners, also in a browser.
|
||||
'^https://www\.contentful\.com/',
|
||||
'^https://postgrest\.org/',
|
||||
'^https?://stackoverflow\.com/',
|
||||
# The OpenAI dashboard passes the bot check only sometimes. Its docs paths redirect, so lychee checks them.
|
||||
'^https://platform\.openai\.com/(api-keys|assistants|home|playground|settings|storage|usage)',
|
||||
# Private to n8n employees.
|
||||
'^https://n8nio\.slack\.com/',
|
||||
'^https://github\.com/n8n-io/(license-management|lang-tracer)',
|
||||
# SCIM is not generally available yet, so its docs page is not published.
|
||||
'^https://docs\.n8n\.io/user-management/scim/',
|
||||
# Attribution headers copied as-is from a third-party library.
|
||||
'^http://(getsprink\.com|brett-zamir\.me)',
|
||||
]
|
||||
|
||||
# docs.n8n.io has most of the links. It is our own site, so allow a shorter interval.
|
||||
[hosts."docs.n8n.io"]
|
||||
request_interval = "50ms"
|
||||
@@ -6,7 +6,7 @@
|
||||
},
|
||||
"packageManager": "pnpm@12.4.2",
|
||||
"scripts": {
|
||||
"test": "node --test --experimental-test-module-mocks ./*.test.mjs ./docker/*.test.mjs ./owners/*.test.mjs ./quality/*.test.mjs ./slack/*.test.mjs ./stale/*.test.mjs ../../scripts/*.test.mjs ../../scripts/codespace-preview/*.test.mjs ../../scripts/telemetry/*.test.mjs ../../scripts/licenses/*.test.mjs ../../scripts/mutation-health/*.test.mjs ../../.devcontainer/codespaces/*.test.mjs",
|
||||
"test": "node --test --experimental-test-module-mocks ./*.test.mjs ./docker/*.test.mjs ./owners/*.test.mjs ./quality/*.test.mjs ./slack/*.test.mjs ./stale/*.test.mjs ./link-check/*.test.mjs ../../scripts/*.test.mjs ../../scripts/codespace-preview/*.test.mjs ../../scripts/telemetry/*.test.mjs ../../scripts/licenses/*.test.mjs ../../scripts/mutation-health/*.test.mjs ../../.devcontainer/codespaces/*.test.mjs",
|
||||
"generate-sbom": "FETCH_LICENSE=true cdxgen -t pnpm --no-install-deps --profile license-compliance --spec-version 1.6 -o ../../sbom-source.cdx.json ../../compiled/",
|
||||
"enrich-sbom": "node ../../scripts/licenses/enrich-sbom.mjs ../../sbom-source.cdx.json --nested-sbom-root=../../compiled/node_modules",
|
||||
"render-licenses-md": "node ../../scripts/licenses/render-licenses-md.mjs ../../sbom-source.cdx.json ../../packages/cli/THIRD_PARTY_LICENSES.md ../../compiled/node_modules",
|
||||
@@ -19,6 +19,7 @@
|
||||
"ajv": "8.20.0",
|
||||
"conventional-changelog": "7.2.0",
|
||||
"minimatch": "10.2.5",
|
||||
"playwright-core": "1.62.1",
|
||||
"semver": "7.7.4",
|
||||
"tempfile": "6.0.1",
|
||||
"yaml": "^2.8.3"
|
||||
|
||||
Generated
+10
@@ -181,6 +181,9 @@ importers:
|
||||
minimatch:
|
||||
specifier: 10.2.5
|
||||
version: 10.2.5
|
||||
playwright-core:
|
||||
specifier: 1.62.1
|
||||
version: 1.62.1
|
||||
semver:
|
||||
specifier: 7.7.4
|
||||
version: 7.7.4
|
||||
@@ -986,6 +989,11 @@ packages:
|
||||
picocolors@1.1.1:
|
||||
resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}
|
||||
|
||||
playwright-core@1.62.1:
|
||||
resolution: {integrity: sha512-wPYSwEBJY9GHraISXqyqtx0na0LpO3XEX7jNDhntbex7tzUS7kLnZsOlFruFJB4Hi/rhDMjXGqHewDZ68nYZVw==}
|
||||
engines: {node: '>=20'}
|
||||
hasBin: true
|
||||
|
||||
proc-log@6.1.0:
|
||||
resolution: {integrity: sha512-iG+GYldRf2BQ0UDUAd6JQ/RwzaQy6mXmsk/IzlYyal4A4SNFw54MeH4/tLkF4I5WoWG9SQwuqWzS99jaFQHBuQ==}
|
||||
engines: {node: ^20.17.0 || >=22.9.0}
|
||||
@@ -2101,6 +2109,8 @@ snapshots:
|
||||
|
||||
picocolors@1.1.1: {}
|
||||
|
||||
playwright-core@1.62.1: {}
|
||||
|
||||
proc-log@6.1.0: {}
|
||||
|
||||
qs@6.15.3:
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
name: 'Test: Link Check Weekly'
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 6 * * 1'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: Check links in packages/
|
||||
runs-on: ${{ vars.RUNNER_PROVIDER == 'github' && 'ubuntu-latest' || 'blacksmith-2vcpu-ubuntu-2204' }}
|
||||
timeout-minutes: 20
|
||||
env:
|
||||
LYCHEE_VERSION: '0.24.2'
|
||||
LYCHEE_SHA256: '73657a111819a30c47c08352896796f23d64e4eb2b3ed39b6d32149241566fc5'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
# The report script uses git blame to find links on lines that changed in the last 30 days.
|
||||
- name: Fetch recent history
|
||||
run: git fetch --quiet --shallow-since="35 days ago" origin "$GITHUB_SHA"
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: ./.github/actions/setup-nodejs
|
||||
with:
|
||||
build-command: ''
|
||||
install-command: pnpm install --frozen-lockfile --dir ./.github/scripts --lockfile-dir ${{ github.workspace }}/.github/scripts --ignore-workspace
|
||||
cache-dependency-path: .github/scripts/pnpm-lock.yaml
|
||||
|
||||
# The musl build runs on Ubuntu 22.04. The glibc build needs a newer glibc.
|
||||
- name: Install lychee
|
||||
run: |
|
||||
curl -sSfL -o lychee.tar.gz "https://github.com/lycheeverse/lychee/releases/download/lychee-v${LYCHEE_VERSION}/lychee-x86_64-unknown-linux-musl.tar.gz"
|
||||
echo "${LYCHEE_SHA256} lychee.tar.gz" | sha256sum --check
|
||||
tar -xzf lychee.tar.gz --strip-components=1 -C /usr/local/bin lychee-x86_64-unknown-linux-musl/lychee
|
||||
lychee --version
|
||||
|
||||
# The next step decides which failures are broken links.
|
||||
- name: Run lychee
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
# Lychee runs on filtered copies of the files, so its report shows the repository paths.
|
||||
dir="$RUNNER_TEMP/link-check"
|
||||
mkdir -p "$dir"
|
||||
node .github/scripts/link-check/extract.mjs "$dir" \
|
||||
| (cd "$dir" && lychee --config "$GITHUB_WORKSPACE/.github/scripts/link-check/lychee.toml" --files-from - --output "$GITHUB_WORKSPACE/lychee-report.json") \
|
||||
2> >(grep -v 'No files found for this input source' >&2) || status=$?
|
||||
# Lychee exits 2 when it finds failing links. Any other failure stops the job.
|
||||
if [ "${status:-0}" -ne 0 ] && [ "${status:-0}" -ne 2 ]; then exit "$status"; fi
|
||||
|
||||
- name: Check report
|
||||
run: node .github/scripts/link-check/check-report.mjs lychee-report.json
|
||||
|
||||
- name: Upload report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: lychee-report
|
||||
path: lychee-report.json
|
||||
if-no-files-found: ignore
|
||||
|
||||
notify-on-failure:
|
||||
name: Notify on failure
|
||||
runs-on: ubuntu-latest
|
||||
needs: [check]
|
||||
if: ${{ always() && contains(needs.*.result, 'failure') }}
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
sparse-checkout: .github/scripts/slack
|
||||
sparse-checkout-cone-mode: false
|
||||
- name: Notify Slack
|
||||
env:
|
||||
SLACK_TOKEN: ${{ secrets.QBOT_SLACK_TOKEN }}
|
||||
run: |
|
||||
node .github/scripts/slack/notify.mjs \
|
||||
--channel '#team-nodes' \
|
||||
--text "Weekly link check failed - ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||
@@ -419,6 +419,7 @@ packages/frontend/editor-ui/src/app/composables/usePolicyViolationToast.ts @n8n-
|
||||
.github/workflows/ @n8n-io/qa-dx required
|
||||
.github/workflows/community-pr-close-stale.yml @n8n-io/community-engineering
|
||||
.github/scripts/ @n8n-io/qa-dx required
|
||||
.github/scripts/link-check/ @n8n-io/nodes
|
||||
.github/actions/ @n8n-io/qa-dx required
|
||||
.github/poutine-rules/ @n8n-io/qa-dx required
|
||||
docker/ @n8n-io/qa-dx
|
||||
|
||||
@@ -56,7 +56,7 @@ n8n is [fair-code](https://faircode.io) distributed under the [Sustainable Use L
|
||||
|
||||
[Enterprise Licenses](mailto:license@n8n.io) available for additional features and support.
|
||||
|
||||
Additional information about the license model can be found in the [docs](https://docs.n8n.io/sustainable-use-license/).
|
||||
Additional information about the license model can be found in the [docs](https://docs.n8n.io/n8n-community-license/).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ export interface OpenAIModelOptions {
|
||||
|
||||
/**
|
||||
* Should be set to `true` in tenancies with Zero Data Retention
|
||||
* @see https://platform.openai.com/docs/guides/your-data
|
||||
* @see https://developers.openai.com/api/docs/guides/your-data
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
@@ -71,7 +71,7 @@ export interface OpenAIModelOptions {
|
||||
/**
|
||||
* Used by OpenAI to cache responses for similar requests to optimize your cache
|
||||
* hit rates. Replaces the `user` field.
|
||||
* [Learn more](https://platform.openai.com/docs/guides/prompt-caching).
|
||||
* [Learn more](https://developers.openai.com/api/docs/guides/prompt-caching).
|
||||
*/
|
||||
promptCacheKey?: string;
|
||||
|
||||
@@ -109,7 +109,7 @@ export interface OpenAIModelOptions {
|
||||
streamUsage?: boolean;
|
||||
|
||||
/** Holds any additional parameters that are valid to pass to {@link
|
||||
* https://platform.openai.com/docs/api-reference/completions/create |
|
||||
* https://developers.openai.com/api/reference/resources/completions/methods/create |
|
||||
* `openai.createCompletion`} that are not explicitly specified on this interface
|
||||
*/
|
||||
additionalParams?: Record<string, unknown>;
|
||||
|
||||
@@ -4,7 +4,7 @@ This is an n8n community node. It lets you use _app/service name_ in your n8n wo
|
||||
|
||||
_App/service name_ is _one or two sentences describing the service this node integrates with_.
|
||||
|
||||
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
|
||||
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/n8n-community-license/) workflow automation platform.
|
||||
|
||||
[Installation](#installation)
|
||||
[Operations](#operations)
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
This is an n8n community node. It lets you use GitHub Issues in your n8n workflows.
|
||||
|
||||
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
|
||||
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/n8n-community-license/) workflow automation platform.
|
||||
|
||||
[Installation](#installation)
|
||||
[Operations](#operations)
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ This is an n8n community node. It lets you use _app/service name_ in your n8n wo
|
||||
|
||||
_App/service name_ is _one or two sentences describing the service this node integrates with_.
|
||||
|
||||
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
|
||||
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/n8n-community-license/) workflow automation platform.
|
||||
|
||||
[Installation](#installation)
|
||||
[Operations](#operations)
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ This is an n8n community node. It lets you use _app/service name_ in your n8n wo
|
||||
|
||||
_App/service name_ is _one or two sentences describing the service this node integrates with_.
|
||||
|
||||
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
|
||||
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/n8n-community-license/) workflow automation platform.
|
||||
|
||||
[Installation](#installation)
|
||||
[Operations](#operations)
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ This is an n8n community node. It lets you use _app/service name_ in your n8n wo
|
||||
|
||||
_App/service name_ is _one or two sentences describing the service this node integrates with_.
|
||||
|
||||
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
|
||||
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/n8n-community-license/) workflow automation platform.
|
||||
|
||||
[Installation](#installation)
|
||||
[Operations](#operations)
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ This is an n8n community node. It lets you use _app/service name_ in your n8n wo
|
||||
|
||||
_App/service name_ is _one or two sentences describing the service this node integrates with_.
|
||||
|
||||
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
|
||||
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/n8n-community-license/) workflow automation platform.
|
||||
|
||||
[Installation](#installation)
|
||||
[Operations](#operations)
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ This is an n8n community node. It lets you use _app/service name_ in your n8n wo
|
||||
|
||||
_App/service name_ is _one or two sentences describing the service this node integrates with_.
|
||||
|
||||
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
|
||||
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/n8n-community-license/) workflow automation platform.
|
||||
|
||||
[Installation](#installation)
|
||||
[Operations](#operations)
|
||||
|
||||
@@ -279,7 +279,7 @@ export class OpenAiAssistant implements INodeType {
|
||||
},
|
||||
{
|
||||
displayName:
|
||||
'Upload files for retrieval using the <a href="https://platform.openai.com/playground" target="_blank">OpenAI website<a/>',
|
||||
'Upload files for retrieval using the <a href="https://platform.openai.com/storage/files" target="_blank">OpenAI website<a/>',
|
||||
name: 'noticeTools',
|
||||
type: 'notice',
|
||||
typeOptions: {
|
||||
|
||||
@@ -731,7 +731,7 @@ export class LmChatOpenAi implements INodeType {
|
||||
name: 'promptConfig',
|
||||
type: 'fixedCollection',
|
||||
description:
|
||||
'Configure the reusable prompt template configured via OpenAI Dashboard. <a href="https://platform.openai.com/docs/guides/prompt-engineering#reusable-prompts">Learn more</a>.',
|
||||
'Configure the reusable prompt template configured via OpenAI Dashboard. <a href="https://developers.openai.com/api/docs/guides/prompting/migrate-from-prompt-object">Learn more</a>.',
|
||||
default: { promptOptions: [{ promptId: '' }] },
|
||||
options: [
|
||||
{
|
||||
|
||||
Vendored
-1
@@ -167,7 +167,6 @@ export async function execute(this: IExecuteFunctions, i: number): Promise<INode
|
||||
// updating file_ids for file_search directly is not supported by OpenAI API
|
||||
// only updating vector_store_ids for file_search is supported
|
||||
// support for this to be added as part of ADO-2968
|
||||
// https://platform.openai.com/docs/api-reference/assistants/modifyAssistant
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -285,7 +285,7 @@ const properties: INodeProperties[] = [
|
||||
name: 'promptConfig',
|
||||
type: 'fixedCollection',
|
||||
description:
|
||||
'Configure the reusable prompt template configured via OpenAI Dashboard. <a href="https://platform.openai.com/docs/guides/prompt-engineering#reusable-prompts">Learn more</a>.',
|
||||
'Configure the reusable prompt template configured via OpenAI Dashboard. <a href="https://developers.openai.com/api/docs/guides/prompting/migrate-from-prompt-object">Learn more</a>.',
|
||||
default: { promptOptions: [{ promptId: '' }] },
|
||||
options: [
|
||||
{
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
<a href="https://badge.fury.io/js/typeorm">
|
||||
<img src="https://badge.fury.io/js/typeorm.svg">
|
||||
</a>
|
||||
<a href="https://join.slack.com/t/typeorm/shared_invite/zt-uu12ljeb-OH_0086I379fUDApYJHNuw">
|
||||
<img src="https://img.shields.io/badge/chat-on%20slack-blue.svg">
|
||||
</a>
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
@@ -1205,7 +1202,7 @@ Learn more about QueryBuilder [here](./docs/select-query-builder.md).
|
||||
|
||||
## Samples
|
||||
|
||||
Take a look at the samples in [sample](https://github.com/typeorm/typeorm/tree/master/sample) for examples of usage.
|
||||
Take a look at the samples in [sample](https://github.com/typeorm/typeorm/tree/0.3.28/sample) for examples of usage.
|
||||
|
||||
There are a few repositories that you can clone and start with:
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ const ANTHROPIC_TOOL_ALIASES: Record<string, string> = {
|
||||
'anthropic.web_search': 'anthropic.web_search_20250305',
|
||||
};
|
||||
|
||||
// OpenAI (https://platform.openai.com/docs/guides/tools-web-search)
|
||||
// OpenAI (https://developers.openai.com/api/docs/guides/tools-web-search)
|
||||
//
|
||||
// OpenAI tool IDs are unversioned (e.g. `openai.web_search`,
|
||||
// `openai.image_generation`), so no aliasing is needed today — the config
|
||||
|
||||
@@ -12,10 +12,10 @@ Create a n8n workflow which you want to execute via chat. The workflow has to be
|
||||
|
||||
Open the **Chat Trigger** node and add your domain to the **Allowed Origins (CORS)** field. This makes sure that only requests from your domain are accepted.
|
||||
|
||||
[See example workflow](https://github.com/n8n-io/n8n/blob/master/packages/%40n8n/chat/resources/workflow.json)
|
||||
[See example workflow](https://github.com/n8n-io/n8n/blob/master/packages/frontend/%40n8n/chat/resources/workflow.json)
|
||||
|
||||
To use streaming responses, you need to enable the **Streaming response** response mode in the **Chat Trigger** node.
|
||||
[See example workflow with streaming](https://github.com/n8n-io/n8n/blob/master/packages/%40n8n/chat/resources/workflow-streaming.json)
|
||||
[See example workflow with streaming](https://github.com/n8n-io/n8n/blob/master/packages/frontend/%40n8n/chat/resources/workflow-streaming.json)
|
||||
|
||||
> Make sure the workflow is **Active.**
|
||||
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ export const READY_TO_RUN_WORKFLOW_V6: WorkflowDataCreate = {
|
||||
{
|
||||
parameters: {
|
||||
content:
|
||||
'✅ This AI News agent is ready to use. Chat with it! \n✨ We gave you free OpenAI credits\n💡 Next: [Connect a Google Sheet](https://n8n.io/workflows/7639-talk-to-your-google-sheets-using-chatgpt-5/) to chat with your data',
|
||||
'✅ This AI News agent is ready to use. Chat with it! \n✨ We gave you free OpenAI credits\n💡 Next: [Connect a Google Sheet](https://n8n.io/workflows/7449-talk-to-your-google-sheets-using-chatgpt-5/) to chat with your data',
|
||||
height: 80,
|
||||
width: 448,
|
||||
color: 4,
|
||||
|
||||
@@ -15,7 +15,7 @@ export class HubspotApi implements ICredentialType {
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName:
|
||||
'On 30 November, 2022 Hubspot will remove API key support. You will have to connect to HubSpot using private app or Oauth2 auth method. <a target="_blank" href="https://developers.hubspot.com/changelog/upcoming-api-key-sunset">More details (HubSpot.com)</a>',
|
||||
'On 30 November, 2022 Hubspot will remove API key support. You will have to connect to HubSpot using private app or Oauth2 auth method. <a target="_blank" href="https://developers.hubspot.com/docs/apps/legacy-apps/private-apps/overview">More details (HubSpot.com)</a>',
|
||||
name: 'notice',
|
||||
type: 'notice',
|
||||
default: '',
|
||||
|
||||
@@ -11,7 +11,7 @@ export class TwakeServerApi implements ICredentialType {
|
||||
|
||||
httpRequestNode = {
|
||||
name: 'Twake Server',
|
||||
docsUrl: 'https://doc.twake.app/developers-api/home',
|
||||
docsUrl: 'https://docs.n8n.io/integrations/builtin/credentials/twake/',
|
||||
apiBaseUrl: '',
|
||||
};
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export class ZoomApi implements ICredentialType {
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName:
|
||||
'On 1 June, 2023 Zoom will remove JWT App support. You will have to connect to Zoom using the Oauth2 auth method. <a target="_blank" href="https://developers.zoom.us/docs/integrations/oauth/">More details (zoom.us)</a>',
|
||||
'On 1 June, 2023 Zoom will remove JWT App support. You will have to connect to Zoom using the Oauth2 auth method. <a target="_blank" href="https://developers.zoom.us/docs/integrations/create/">More details (zoom.us)</a>',
|
||||
name: 'notice',
|
||||
type: 'notice',
|
||||
default: '',
|
||||
|
||||
@@ -87,7 +87,7 @@ export async function getAccessToken(
|
||||
grant_type: 'client_credentials',
|
||||
scope: 'api.organization',
|
||||
deviceName: 'n8n',
|
||||
deviceType: 2, // https://github.com/bitwarden/server/blob/master/src/Core/Enums/DeviceType.cs
|
||||
deviceType: 2, // https://github.com/bitwarden/server/blob/main/src/Libraries/Clients/DeviceType.cs
|
||||
deviceIdentifier: 'n8n',
|
||||
},
|
||||
uri: await getTokenUrl.call(this),
|
||||
|
||||
@@ -1686,7 +1686,7 @@ export class Mailchimp implements INodeType {
|
||||
for (let i = 0; i < length; i++) {
|
||||
try {
|
||||
if (resource === 'listGroup') {
|
||||
//https://mailchimp.com/developer/reference/lists/interest-categories/#get_/lists/-list_id-/interest-categories/-interest_category_id-
|
||||
//https://mailchimp.com/developer/marketing/api/lists/interest-categories/list-interest-category-interests/
|
||||
if (operation === 'getAll') {
|
||||
const listId = this.getNodeParameter('list', i) as string;
|
||||
const categoryId = this.getNodeParameter('groupCategory', i) as string;
|
||||
@@ -1715,7 +1715,7 @@ export class Mailchimp implements INodeType {
|
||||
}
|
||||
}
|
||||
if (resource === 'member') {
|
||||
//https://mailchimp.com/developer/reference/lists/list-members/#post_/lists/-list_id-/members
|
||||
//https://mailchimp.com/developer/marketing/api/lists/members/create-member/
|
||||
if (operation === 'create') {
|
||||
const listId = this.getNodeParameter('list', i) as string;
|
||||
const email = this.getNodeParameter('email', i) as string;
|
||||
@@ -1815,7 +1815,7 @@ export class Mailchimp implements INodeType {
|
||||
body,
|
||||
);
|
||||
}
|
||||
//https://mailchimp.com/developer/reference/lists/list-members/
|
||||
//https://mailchimp.com/developer/marketing/api/lists/members/create-member-action-delete-permanent/
|
||||
if (operation === 'delete') {
|
||||
const listId = this.getNodeParameter('list', i) as string;
|
||||
const email = this.getNodeParameter('email', i) as string;
|
||||
@@ -1827,7 +1827,7 @@ export class Mailchimp implements INodeType {
|
||||
);
|
||||
responseData = { success: true };
|
||||
}
|
||||
//https://mailchimp.com/developer/reference/lists/list-members/#get_/lists/-list_id-/members/-subscriber_hash-
|
||||
//https://mailchimp.com/developer/marketing/api/lists/members/get-member/
|
||||
if (operation === 'get') {
|
||||
const listId = this.getNodeParameter('list', i) as string;
|
||||
const email = this.getNodeParameter('email', i) as string;
|
||||
@@ -1849,7 +1849,7 @@ export class Mailchimp implements INodeType {
|
||||
qs,
|
||||
);
|
||||
}
|
||||
//https://mailchimp.com/developer/reference/lists/list-members/#get_/lists/-list_id-/members
|
||||
//https://mailchimp.com/developer/marketing/api/lists/members/list-members/
|
||||
if (operation === 'getAll') {
|
||||
const listId = this.getNodeParameter('list', i) as string;
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
@@ -1901,7 +1901,7 @@ export class Mailchimp implements INodeType {
|
||||
responseData = responseData.members;
|
||||
}
|
||||
}
|
||||
//https://mailchimp.com/developer/reference/lists/list-members/#put_/lists/-list_id-/members/-subscriber_hash-
|
||||
//https://mailchimp.com/developer/marketing/api/lists/members/upsert-member/
|
||||
if (operation === 'update') {
|
||||
const listId = this.getNodeParameter('list', i) as string;
|
||||
const email = this.getNodeParameter('email', i) as string;
|
||||
@@ -2008,7 +2008,7 @@ export class Mailchimp implements INodeType {
|
||||
}
|
||||
}
|
||||
if (resource === 'memberTag') {
|
||||
//https://mailchimp.com/developer/reference/lists/list-members/list-member-tags/#post_/lists/-list_id-/members/-subscriber_hash-/tags
|
||||
//https://mailchimp.com/developer/marketing/api/lists/members/create-member-tag/
|
||||
if (operation === 'create') {
|
||||
const listId = this.getNodeParameter('list', i) as string;
|
||||
const email = this.getNodeParameter('email', i) as string;
|
||||
@@ -2039,7 +2039,7 @@ export class Mailchimp implements INodeType {
|
||||
);
|
||||
responseData = { success: true };
|
||||
}
|
||||
//https://mailchimp.com/developer/reference/lists/list-members/list-member-tags/#post_/lists/-list_id-/members/-subscriber_hash-/tags
|
||||
//https://mailchimp.com/developer/marketing/api/lists/members/create-member-tag/
|
||||
if (operation === 'delete') {
|
||||
const listId = this.getNodeParameter('list', i) as string;
|
||||
const email = this.getNodeParameter('email', i) as string;
|
||||
@@ -2071,7 +2071,7 @@ export class Mailchimp implements INodeType {
|
||||
}
|
||||
}
|
||||
if (resource === 'campaign') {
|
||||
//https://mailchimp.com/developer/api/marketing/campaigns/list-campaigns/
|
||||
//https://mailchimp.com/developer/marketing/api/campaigns/list/
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
const options = this.getNodeParameter('options', i);
|
||||
@@ -2133,7 +2133,7 @@ export class Mailchimp implements INodeType {
|
||||
responseData = responseData.campaigns;
|
||||
}
|
||||
}
|
||||
//https://mailchimp.com/developer/api/marketing/campaigns/send-campaign/
|
||||
//https://mailchimp.com/developer/marketing/api/campaigns/create-action-send/
|
||||
if (operation === 'send') {
|
||||
const campaignId = this.getNodeParameter('campaignId', i) as string;
|
||||
responseData = await mailchimpApiRequest.call(
|
||||
@@ -2144,7 +2144,7 @@ export class Mailchimp implements INodeType {
|
||||
);
|
||||
responseData = { success: true };
|
||||
}
|
||||
//https://mailchimp.com/developer/api/marketing/campaigns/get-campaign-info/
|
||||
//https://mailchimp.com/developer/marketing/api/campaigns/get/
|
||||
if (operation === 'get') {
|
||||
const campaignId = this.getNodeParameter('campaignId', i) as string;
|
||||
responseData = await mailchimpApiRequest.call(
|
||||
@@ -2154,7 +2154,7 @@ export class Mailchimp implements INodeType {
|
||||
{},
|
||||
);
|
||||
}
|
||||
//https://mailchimp.com/developer/api/marketing/campaigns/delete-campaign/
|
||||
//https://mailchimp.com/developer/marketing/api/campaigns/delete/
|
||||
if (operation === 'delete') {
|
||||
const campaignId = this.getNodeParameter('campaignId', i) as string;
|
||||
responseData = await mailchimpApiRequest.call(
|
||||
@@ -2165,7 +2165,7 @@ export class Mailchimp implements INodeType {
|
||||
);
|
||||
responseData = { success: true };
|
||||
}
|
||||
//https://mailchimp.com/developer/api/marketing/campaigns/replicate-campaign/
|
||||
//https://mailchimp.com/developer/marketing/api/campaigns/create-action-replicate/
|
||||
if (operation === 'replicate') {
|
||||
const campaignId = this.getNodeParameter('campaignId', i) as string;
|
||||
responseData = await mailchimpApiRequest.call(
|
||||
@@ -2175,7 +2175,7 @@ export class Mailchimp implements INodeType {
|
||||
{},
|
||||
);
|
||||
}
|
||||
//https://mailchimp.com/developer/api/marketing/campaigns/resend-campaign/
|
||||
//https://mailchimp.com/developer/marketing/api/campaigns/create-action-create-resend/
|
||||
if (operation === 'resend') {
|
||||
const campaignId = this.getNodeParameter('campaignId', i) as string;
|
||||
responseData = await mailchimpApiRequest.call(
|
||||
|
||||
@@ -119,7 +119,7 @@ export class Phantombuster implements INodeType {
|
||||
for (let i = 0; i < length; i++) {
|
||||
try {
|
||||
if (resource === 'agent') {
|
||||
//https://hub.phantombuster.com/reference#post_agents-delete-1
|
||||
// https://hub.phantombuster.com/reference/post_agents-delete
|
||||
if (operation === 'delete') {
|
||||
const agentId = this.getNodeParameter('agentId', i) as string;
|
||||
|
||||
@@ -129,7 +129,7 @@ export class Phantombuster implements INodeType {
|
||||
|
||||
responseData = { success: true };
|
||||
}
|
||||
//https://hub.phantombuster.com/reference#get_agents-fetch-1
|
||||
// https://hub.phantombuster.com/reference/get_agents-fetch
|
||||
if (operation === 'get') {
|
||||
const agentId = this.getNodeParameter('agentId', i) as string;
|
||||
|
||||
@@ -141,7 +141,7 @@ export class Phantombuster implements INodeType {
|
||||
{ id: agentId },
|
||||
);
|
||||
}
|
||||
//https://hub.phantombuster.com/reference#get_agents-fetch-output-1
|
||||
// https://hub.phantombuster.com/reference/get_agents-fetch-output
|
||||
if (operation === 'getOutput') {
|
||||
const agentId = this.getNodeParameter('agentId', i) as string;
|
||||
|
||||
@@ -188,7 +188,7 @@ export class Phantombuster implements INodeType {
|
||||
responseData = responseData.splice(0, limit);
|
||||
}
|
||||
}
|
||||
//https://hub.phantombuster.com/reference#post_agents-launch-1
|
||||
// https://hub.phantombuster.com/reference/post_agents-launch
|
||||
// https://hub.phantombuster.com/reference/post_agents-launch-sync
|
||||
if (operation === 'launch' || operation === 'launchSync') {
|
||||
const agentId = this.getNodeParameter('agentId', i) as string;
|
||||
|
||||
@@ -13,7 +13,7 @@ recorded as `cdx:license:elected` in the SBOM. No copyleft license is in force.
|
||||
|
||||
| Scope | License | Notes |
|
||||
|---|---|---|
|
||||
| `@n8n/*`, `n8n`, `n8n-core`, `n8n-nodes-base`, `n8n-workflow`, `n8n-editor-ui` | `LicenseRef-n8n-sustainable-use` | Full text at https://docs.n8n.io/sustainable-use-license/ |
|
||||
| `@n8n/*`, `n8n`, `n8n-core`, `n8n-nodes-base`, `n8n-workflow`, `n8n-editor-ui` | `LicenseRef-n8n-sustainable-use` | Full text at https://docs.n8n.io/n8n-community-license/ |
|
||||
| Community tooling, codemirror extensions | `MIT` / `Apache-2.0` / `ISC` | Intentionally OSI-licensed |
|
||||
| `@n8n_io/license-sdk`, `@n8n_io/ai-assistant-sdk` | `LicenseRef-n8n-enterprise` | EE-only runtime components; require enterprise contract |
|
||||
| All third-party npm dependencies | Permissive OSI | No copyleft; dual-licensed packages elect MIT |
|
||||
|
||||
Reference in new issue
Block a user