@soulbatical/tetra-dev-toolkit 1.12.0 → 1.12.1

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.
@@ -23,6 +23,14 @@ import { readFileSync, existsSync } from 'fs'
23
23
  import { join, basename, dirname } from 'path'
24
24
  import { glob } from 'glob'
25
25
 
26
+ export const meta = {
27
+ id: 'mixed-db-usage',
28
+ name: 'Mixed DB Usage',
29
+ category: 'security',
30
+ severity: 'critical',
31
+ description: 'Controllers must use exactly ONE DB helper type matching their naming convention. Detects systemDB misuse when user context is available.'
32
+ }
33
+
26
34
  const DB_PATTERNS = {
27
35
  systemDB: { level: 'SYSTEM', pattern: /systemDB\s*\(/g, desc: 'System-level (cron, webhooks)' },
28
36
  adminDB: { level: 'ADMIN', pattern: /adminDB\s*\(/g, desc: 'Admin operations (org-scoped)' },
@@ -57,7 +65,7 @@ function hasUserContext(content) {
57
65
  content.includes('authenticateToken')
58
66
  }
59
67
 
60
- export async function check(projectRoot, config = {}) {
68
+ export async function run(config, projectRoot) {
61
69
  const results = {
62
70
  name: 'Mixed DB Usage',
63
71
  slug: 'mixed-db-usage',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soulbatical/tetra-dev-toolkit",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "publishConfig": {
5
5
  "access": "restricted"
6
6
  },