feat: artefact version auto-advance, post_id on artefacts, test-email endpoint
Deploy / deploy (push) Successful in 13s

- Auto-advance artefact to next working version on rejection/revision
- Add post_id field to artefact creation
- Add request timeout (20s) to NocoDB client
- Add POST /api/admin/test-email for diagnosing SMTP issues
- Fix FK column creation logging

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
fahed
2026-05-11 12:27:23 +03:00
parent a67b2afb0d
commit 94ce012837
7 changed files with 391 additions and 276 deletions
+27 -12
View File
@@ -40,29 +40,44 @@ function buildWhere(conditions) {
.join('~and');
}
const REQUEST_TIMEOUT_MS = 20_000;
async function request(method, url, body) {
const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
const opts = {
method,
headers: {
'xc-token': NOCODB_TOKEN,
'Content-Type': 'application/json',
},
signal: controller.signal,
};
if (body !== undefined) opts.body = JSON.stringify(body);
const res = await fetch(url, opts);
if (!res.ok) {
let details;
try { details = await res.json(); } catch {}
throw new NocoDBError(
`NocoDB ${method} ${url} failed: ${res.status}`,
res.status,
details
);
try {
const res = await fetch(url, opts);
clearTimeout(timer);
if (!res.ok) {
let details;
try { details = await res.json(); } catch {}
throw new NocoDBError(
`NocoDB ${method} ${url} failed: ${res.status}`,
res.status,
details
);
}
// DELETE returns empty or {msg}
const text = await res.text();
return text ? JSON.parse(text) : {};
} catch (err) {
clearTimeout(timer);
if (err.name === 'AbortError') {
throw new NocoDBError(`NocoDB ${method} ${url} timed out after ${REQUEST_TIMEOUT_MS}ms`, 408);
}
throw err;
}
// DELETE returns empty or {msg}
const text = await res.text();
return text ? JSON.parse(text) : {};
}
// ─── Link Resolution ─────────────────────────────────────────