nucleus-core-ts 0.9.500 → 0.9.600
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/bin/cli.ts +28 -7
- package/dist/client.js +2 -2
- package/dist/dist/index.d.ts +2 -0
- package/dist/index.js +5 -5
- package/dist/src/Client/ApiCaller/system-tables.d.ts +18 -0
- package/dist/src/ElysiaPlugin/auditAttribution.test.d.ts +1 -0
- package/dist/src/ElysiaPlugin/utils.d.ts +17 -1
- package/dist/src/Services/Logger/Logger.d.ts +7 -0
- package/dist/src/Services/Logger/auditDedup.test.d.ts +1 -0
- package/dist/src/Services/Logger/auditGate.test.d.ts +1 -0
- package/dist/src/Services/Logger/auditTaxonomy.d.ts +49 -0
- package/dist/src/Services/Logger/auditTaxonomy.test.d.ts +1 -0
- package/dist/src/Services/Logger/index.d.ts +1 -0
- package/dist/src/Services/Logger/transports.d.ts +16 -0
- package/dist/src/Services/Logger/types.d.ts +13 -0
- package/dist/src/types.d.ts +28 -8
- package/package.json +1 -1
- package/schemas/config.nucleus.json +416 -51
- package/schemas/nucleus.tables.schema.json +3 -1
- package/schemas/table.schema.json +116 -21
- package/scripts/audit-purge-noise.ts +120 -0
- package/src/system.tables.json +24 -0
package/bin/cli.ts
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
* npx nucleus-core-ts help — Show available commands
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { spawn } from 'child_process'
|
|
13
|
-
import { dirname, join } from 'path'
|
|
14
|
-
import { fileURLToPath } from 'url'
|
|
12
|
+
import { spawn } from 'node:child_process'
|
|
13
|
+
import { dirname, join } from 'node:path'
|
|
14
|
+
import { fileURLToPath } from 'node:url'
|
|
15
15
|
|
|
16
16
|
const BOLD = '\x1b[1m'
|
|
17
17
|
const CYAN = '\x1b[36m'
|
|
@@ -36,18 +36,33 @@ ${BOLD}Usage:${RESET}
|
|
|
36
36
|
npx nucleus-core-ts ${CYAN}<command>${RESET}
|
|
37
37
|
|
|
38
38
|
${BOLD}Commands:${RESET}
|
|
39
|
-
${CYAN}scaffold${RESET}
|
|
40
|
-
${CYAN}generate${RESET}
|
|
41
|
-
${CYAN}
|
|
39
|
+
${CYAN}scaffold${RESET} Interactive project scaffolding (API + frontend + k8s + pipelines)
|
|
40
|
+
${CYAN}generate${RESET} Generate Drizzle schema from config.json
|
|
41
|
+
${CYAN}audit:purge-noise${RESET} Delete historical low-signal audit_logs rows (dry-run by default)
|
|
42
|
+
${CYAN}help${RESET} Show this help message
|
|
42
43
|
|
|
43
44
|
${BOLD}Examples:${RESET}
|
|
44
45
|
${DIM}npx nucleus-core-ts scaffold${RESET}
|
|
45
46
|
${DIM}npx nucleus-core-ts generate src/config.json src/drizzle${RESET}
|
|
47
|
+
${DIM}npx nucleus-core-ts audit:purge-noise # dry run, all schemas${RESET}
|
|
48
|
+
${DIM}npx nucleus-core-ts audit:purge-noise --execute # actually delete${RESET}
|
|
46
49
|
`)
|
|
47
50
|
}
|
|
48
51
|
|
|
52
|
+
async function runScript(scriptRelPath: string, args: string[]) {
|
|
53
|
+
return new Promise<void>(() => {
|
|
54
|
+
const proc = spawn('bun', ['run', join(rootDir, scriptRelPath), ...args], {
|
|
55
|
+
cwd: process.cwd(),
|
|
56
|
+
stdio: 'inherit',
|
|
57
|
+
})
|
|
58
|
+
proc.on('close', (code) => {
|
|
59
|
+
process.exit(code ?? 1)
|
|
60
|
+
})
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
49
64
|
async function runGenerate(args: string[]) {
|
|
50
|
-
return new Promise<void>((
|
|
65
|
+
return new Promise<void>(() => {
|
|
51
66
|
const proc = spawn('bun', ['run', join(rootDir, 'scripts', 'generate-schema.ts'), ...args], {
|
|
52
67
|
cwd: process.cwd(),
|
|
53
68
|
stdio: 'inherit',
|
|
@@ -75,6 +90,12 @@ switch (command) {
|
|
|
75
90
|
break
|
|
76
91
|
}
|
|
77
92
|
|
|
93
|
+
case 'audit:purge-noise':
|
|
94
|
+
case 'audit-purge-noise': {
|
|
95
|
+
await runScript(join('scripts', 'audit-purge-noise.ts'), process.argv.slice(3))
|
|
96
|
+
break
|
|
97
|
+
}
|
|
98
|
+
|
|
78
99
|
case 'help':
|
|
79
100
|
case '--help':
|
|
80
101
|
case '-h':
|