nucleus-core-ts 0.9.180 → 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.
Files changed (110) hide show
  1. package/bin/cli.ts +31 -8
  2. package/dist/client.js +2 -2
  3. package/dist/dist/index.d.ts +2 -0
  4. package/dist/fe/components/AuthGuard/index.d.ts +1 -1
  5. package/dist/fe/components/AuthGuard/index.js +1 -1
  6. package/dist/fe/components/AuthorizationPage/components/AuthorizationPage.js +10 -1
  7. package/dist/fe/components/ChatPanel/hooks/useChat.js +1 -1
  8. package/dist/fe/components/DatePicker/utils/date.js +0 -1
  9. package/dist/fe/components/DesignSystem/components/ComponentCanvas.d.ts +1 -1
  10. package/dist/fe/components/DesignSystem/components/ComponentCanvas.js +55 -55
  11. package/dist/fe/components/DesignSystem/registry/defaultRegistry.d.ts +1 -1
  12. package/dist/fe/components/DesignSystem/registry/defaultRegistry.js +745 -745
  13. package/dist/fe/components/DevicesPage/components/DeviceCard.js +1 -0
  14. package/dist/fe/components/Tooltip/components/Tooltip.d.ts +1 -1
  15. package/dist/fe/components/Tooltip/components/Tooltip.js +57 -57
  16. package/dist/fe/components/Tooltip/index.d.ts +2 -2
  17. package/dist/fe/components/UsersPage/components/UserListItem.js +1 -1
  18. package/dist/fe/components/VerificationFlowPage/components/NodePropertiesPanel.js +3 -2
  19. package/dist/index.js +41 -29
  20. package/dist/src/Client/ApiCaller/system-tables.d.ts +18 -0
  21. package/dist/src/Client/Proxy/httpProxy.js +22 -0
  22. package/dist/src/Client/Proxy/wsProxy.js +4 -3
  23. package/dist/src/ElysiaPlugin/auditAttribution.test.d.ts +1 -0
  24. package/dist/src/ElysiaPlugin/index.d.ts +1 -1
  25. package/dist/src/ElysiaPlugin/publicRoutes.test.d.ts +1 -0
  26. package/dist/src/ElysiaPlugin/routes/auth/admin/impersonate.d.ts +1 -1
  27. package/dist/src/ElysiaPlugin/routes/auth/emailLinks/emailLinks.test.d.ts +1 -0
  28. package/dist/src/ElysiaPlugin/routes/auth/emailLinks/index.d.ts +16 -16
  29. package/dist/src/ElysiaPlugin/routes/auth/index.d.ts +5 -3
  30. package/dist/src/ElysiaPlugin/routes/auth/login/index.d.ts +1 -1
  31. package/dist/src/ElysiaPlugin/routes/auth/magicLink/index.d.ts +1 -1
  32. package/dist/src/ElysiaPlugin/routes/auth/magicLink/utils.d.ts +15 -1
  33. package/dist/src/ElysiaPlugin/routes/auth/magicLink/utils.test.d.ts +1 -0
  34. package/dist/src/ElysiaPlugin/routes/auth/oauth/index.d.ts +1 -1
  35. package/dist/src/ElysiaPlugin/routes/auth/refresh/index.d.ts +1 -1
  36. package/dist/src/ElysiaPlugin/routes/auth/register/index.d.ts +2 -2
  37. package/dist/src/ElysiaPlugin/routes/auth/register/utils.d.ts +6 -0
  38. package/dist/src/ElysiaPlugin/routes/auth/types.d.ts +4 -0
  39. package/dist/src/ElysiaPlugin/routes/auth/webauthn/index.d.ts +1 -1
  40. package/dist/src/ElysiaPlugin/routes/config/helpers.d.ts +1 -0
  41. package/dist/src/ElysiaPlugin/routes/config/helpers.test.d.ts +1 -0
  42. package/dist/src/ElysiaPlugin/routes/config/types.d.ts +1 -1
  43. package/dist/src/ElysiaPlugin/routes/entity/types.d.ts +4 -0
  44. package/dist/src/ElysiaPlugin/routes/index.d.ts +2 -2
  45. package/dist/src/ElysiaPlugin/routes/monitoring/index.d.ts +4 -0
  46. package/dist/src/ElysiaPlugin/routes/monitoring/live.d.ts +4 -0
  47. package/dist/src/ElysiaPlugin/routes/payment/marketplace/types.d.ts +14 -0
  48. package/dist/src/ElysiaPlugin/routes/payment/validation.d.ts +19 -0
  49. package/dist/src/ElysiaPlugin/routes/payment/validation.test.d.ts +1 -0
  50. package/dist/src/ElysiaPlugin/routes/shared/adminGuard.d.ts +48 -0
  51. package/dist/src/ElysiaPlugin/routes/shared/adminGuard.test.d.ts +1 -0
  52. package/dist/src/ElysiaPlugin/routes/shared/clientIp.d.ts +18 -0
  53. package/dist/src/ElysiaPlugin/routes/shared/clientIp.test.d.ts +1 -0
  54. package/dist/src/ElysiaPlugin/routes/shared/csrf.d.ts +26 -0
  55. package/dist/src/ElysiaPlugin/routes/shared/csrf.test.d.ts +1 -0
  56. package/dist/src/ElysiaPlugin/routes/shared/redact.d.ts +14 -0
  57. package/dist/src/ElysiaPlugin/routes/shared/redact.test.d.ts +1 -0
  58. package/dist/src/ElysiaPlugin/routes/shared/requestLimits.d.ts +6 -0
  59. package/dist/src/ElysiaPlugin/routes/shared/requestLimits.test.d.ts +1 -0
  60. package/dist/src/ElysiaPlugin/routes/shared/tenantBinding.d.ts +15 -0
  61. package/dist/src/ElysiaPlugin/routes/shared/tenantBinding.test.d.ts +1 -0
  62. package/dist/src/ElysiaPlugin/routes/storage/index.d.ts +1 -1
  63. package/dist/src/ElysiaPlugin/sanitizePayload.test.d.ts +1 -0
  64. package/dist/src/ElysiaPlugin/utils.d.ts +22 -4
  65. package/dist/src/Services/Auth/JWT/Verify/index.d.ts +12 -1
  66. package/dist/src/Services/Auth/JWT/jwt.test.d.ts +1 -0
  67. package/dist/src/Services/Auth/Password/password.test.d.ts +1 -0
  68. package/dist/src/Services/Authorization/Middleware/claimMatches.test.d.ts +1 -0
  69. package/dist/src/Services/Authorization/Middleware/fieldWriteClaims.test.d.ts +1 -0
  70. package/dist/src/Services/Authorization/Middleware/index.d.ts +13 -0
  71. package/dist/src/Services/Backup/BackupService.d.ts +16 -2
  72. package/dist/src/Services/Backup/encryption.d.ts +9 -0
  73. package/dist/src/Services/Backup/encryption.test.d.ts +1 -0
  74. package/dist/src/Services/Backup/types.d.ts +7 -0
  75. package/dist/src/Services/Logger/Logger.d.ts +7 -0
  76. package/dist/src/Services/Logger/auditDedup.test.d.ts +1 -0
  77. package/dist/src/Services/Logger/auditGate.test.d.ts +1 -0
  78. package/dist/src/Services/Logger/auditTaxonomy.d.ts +49 -0
  79. package/dist/src/Services/Logger/auditTaxonomy.test.d.ts +1 -0
  80. package/dist/src/Services/Logger/index.d.ts +1 -0
  81. package/dist/src/Services/Logger/redact.test.d.ts +1 -0
  82. package/dist/src/Services/Logger/transports.d.ts +16 -0
  83. package/dist/src/Services/Logger/types.d.ts +13 -0
  84. package/dist/src/Services/OAuth/OAuthService.d.ts +4 -5
  85. package/dist/src/Services/OAuth/stateStore.d.ts +33 -0
  86. package/dist/src/Services/OAuth/stateStore.test.d.ts +1 -0
  87. package/dist/src/Services/OAuth/types.d.ts +18 -0
  88. package/dist/src/Services/Payment/Marketplace/Marketplace.types.d.ts +2 -0
  89. package/dist/src/Services/Payment/Marketplace/MarketplacePayoutService.d.ts +10 -0
  90. package/dist/src/Services/Payment/Marketplace/MarketplaceService.d.ts +20 -3
  91. package/dist/src/Services/Payment/Marketplace/marketplaceLedger.test.d.ts +1 -0
  92. package/dist/src/Services/Payment/Marketplace/marketplacePayout.integration.test.d.ts +1 -0
  93. package/dist/src/Services/Payment/types.d.ts +4 -0
  94. package/dist/src/Services/RateLimiter/index.d.ts +23 -0
  95. package/dist/src/Services/RateLimiter/rateLimiter.integration.test.d.ts +1 -0
  96. package/dist/src/Services/RateLimiter/rateLimiter.test.d.ts +1 -0
  97. package/dist/src/Services/Tenant/helpers.test.d.ts +1 -0
  98. package/dist/src/Services/WebAuthn/index.d.ts +1 -2
  99. package/dist/src/Services/WebAuthn/types.d.ts +6 -0
  100. package/dist/src/Services/index.d.ts +1 -1
  101. package/dist/src/types.d.ts +176 -8
  102. package/package.json +2 -1
  103. package/schemas/config.nucleus.json +269 -17
  104. package/schemas/table.schema.json +4 -0
  105. package/scripts/audit-purge-noise.ts +120 -0
  106. package/scripts/build.ts +23 -12
  107. package/scripts/generate-types-schema.ts +2 -0
  108. package/scripts/publish.ts +6 -2
  109. package/scripts/version.ts +1 -1
  110. package/src/system.tables.json +604 -1465
package/bin/cli.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env bun
2
+
2
3
  /**
3
4
  * Nucleus CLI — unified entry point for all nucleus-core-ts commands.
4
5
  *
@@ -8,9 +9,9 @@
8
9
  * npx nucleus-core-ts help — Show available commands
9
10
  */
10
11
 
11
- import { join, dirname } from 'path'
12
- import { fileURLToPath } from 'url'
13
- import { spawn } from 'child_process'
12
+ import { spawn } from 'node:child_process'
13
+ import { dirname, join } from 'node:path'
14
+ import { fileURLToPath } from 'node:url'
14
15
 
15
16
  const BOLD = '\x1b[1m'
16
17
  const CYAN = '\x1b[36m'
@@ -23,7 +24,8 @@ const __dirname = dirname(__filename)
23
24
  const rootDir = join(__dirname, '..')
24
25
 
25
26
  const firstArg = process.argv[2] ?? ''
26
- const looksLikeFile = firstArg.endsWith('.json') || firstArg.startsWith('./') || firstArg.startsWith('/')
27
+ const looksLikeFile =
28
+ firstArg.endsWith('.json') || firstArg.startsWith('./') || firstArg.startsWith('/')
27
29
  const command = looksLikeFile ? 'generate' : firstArg
28
30
 
29
31
  function showHelp() {
@@ -34,18 +36,33 @@ ${BOLD}Usage:${RESET}
34
36
  npx nucleus-core-ts ${CYAN}<command>${RESET}
35
37
 
36
38
  ${BOLD}Commands:${RESET}
37
- ${CYAN}scaffold${RESET} Interactive project scaffolding (API + frontend + k8s + pipelines)
38
- ${CYAN}generate${RESET} Generate Drizzle schema from config.json
39
- ${CYAN}help${RESET} Show this help message
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
40
43
 
41
44
  ${BOLD}Examples:${RESET}
42
45
  ${DIM}npx nucleus-core-ts scaffold${RESET}
43
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}
44
49
  `)
45
50
  }
46
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
+
47
64
  async function runGenerate(args: string[]) {
48
- return new Promise<void>((res) => {
65
+ return new Promise<void>(() => {
49
66
  const proc = spawn('bun', ['run', join(rootDir, 'scripts', 'generate-schema.ts'), ...args], {
50
67
  cwd: process.cwd(),
51
68
  stdio: 'inherit',
@@ -73,6 +90,12 @@ switch (command) {
73
90
  break
74
91
  }
75
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
+
76
99
  case 'help':
77
100
  case '--help':
78
101
  case '-h':