feat: manage files via manifestattachment with auth and cascade trigger, format API.md method signatures

This commit is contained in:
seb
2026-09-16 16:49:59 +02:00
parent 8b97948a75
commit 8f23dd8c75
14 changed files with 2058 additions and 1362 deletions

View File

@@ -32,7 +32,7 @@ function parseSchema(source) {
const trimmed = line.trim().replace(/,$/, '');
if (!trimmed || trimmed.startsWith('CONSTRAINT')) {
const fkMatch = trimmed.match(
/CONSTRAINT\s+(\w+)\s+FOREIGN KEY\s*\(([^)]+)\)\s+REFERENCES\s+(\w+)\(([^)]+)\)(?:\s+ON DELETE\s+(.+))?/i
/CONSTRAINT\s+(\w+)\s+FOREIGN KEY\s*\(([^)]+)\)\s+REFERENCES\s+\[?(\w+)\]?\(([^)]+)\)(?:\s+ON DELETE\s+(.+))?/i
);
if (fkMatch) {
const constraintName = fkMatch[1];
@@ -105,7 +105,7 @@ function parseSchema(source) {
}
const alterFkRegex =
/ALTER TABLE\s+(\w+)\s+ADD CONSTRAINT\s+(\w+)\s+FOREIGN KEY\s*\(([^)]+)\)\s+REFERENCES\s+(\w+)\(([^)]+)\)(?:\s+ON DELETE\s+([\w\s]+?))?\s*;/gi;
/ALTER TABLE\s+(\w+)\s+ADD CONSTRAINT\s+(\w+)\s+FOREIGN KEY\s*\(([^)]+)\)\s+REFERENCES\s+\[?(\w+)\]?\(([^)]+)\)(?:\s+ON DELETE\s+([\w\s]+?))?\s*;/gi;
let alterMatch;
while ((alterMatch = alterFkRegex.exec(sqlBlock)) !== null) {
@@ -361,12 +361,12 @@ const CLUSTERS = [
{
id: 'media',
label: 'Media',
tables: ['pic', 'articlepic', 'categorypic', 'brandpic'],
tables: ['pic', 'articlepic', 'categorypic', 'brandpic', 'file'],
},
{
id: 'manifests',
label: 'Documents',
tables: ['manifest', 'manifestarticle', 'ledger'],
tables: ['manifest', 'manifestarticle', 'manifestattachment', 'ledger'],
},
{
id: 'commerce',