alepha 0.15.0 → 0.15.2
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/README.md +43 -98
- package/dist/api/audits/index.d.ts +630 -653
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/audits/index.js +12 -35
- package/dist/api/audits/index.js.map +1 -1
- package/dist/api/files/index.d.ts +365 -358
- package/dist/api/files/index.d.ts.map +1 -1
- package/dist/api/files/index.js +12 -5
- package/dist/api/files/index.js.map +1 -1
- package/dist/api/jobs/index.d.ts +255 -248
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/jobs/index.js +10 -3
- package/dist/api/jobs/index.js.map +1 -1
- package/dist/api/keys/index.d.ts +413 -0
- package/dist/api/keys/index.d.ts.map +1 -0
- package/dist/api/keys/index.js +476 -0
- package/dist/api/keys/index.js.map +1 -0
- package/dist/api/notifications/index.browser.js +4 -4
- package/dist/api/notifications/index.browser.js.map +1 -1
- package/dist/api/notifications/index.d.ts +84 -78
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/notifications/index.js +14 -8
- package/dist/api/notifications/index.js.map +1 -1
- package/dist/api/parameters/index.d.ts +528 -535
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/parameters/index.js +30 -37
- package/dist/api/parameters/index.js.map +1 -1
- package/dist/api/users/index.d.ts +1221 -910
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +2556 -248
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/verifications/index.d.ts +142 -136
- package/dist/api/verifications/index.d.ts.map +1 -1
- package/dist/api/verifications/index.js +12 -4
- package/dist/api/verifications/index.js.map +1 -1
- package/dist/batch/index.d.ts +142 -162
- package/dist/batch/index.d.ts.map +1 -1
- package/dist/batch/index.js +31 -44
- package/dist/batch/index.js.map +1 -1
- package/dist/bucket/index.d.ts +595 -171
- package/dist/bucket/index.d.ts.map +1 -1
- package/dist/bucket/index.js +1856 -12
- package/dist/bucket/index.js.map +1 -1
- package/dist/cache/core/index.d.ts +225 -53
- package/dist/cache/core/index.d.ts.map +1 -1
- package/dist/cache/core/index.js +213 -7
- package/dist/cache/core/index.js.map +1 -1
- package/dist/cache/redis/index.d.ts +1 -0
- package/dist/cache/redis/index.d.ts.map +1 -1
- package/dist/cache/redis/index.js +6 -2
- package/dist/cache/redis/index.js.map +1 -1
- package/dist/cli/index.d.ts +834 -226
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2872 -417
- package/dist/cli/index.js.map +1 -1
- package/dist/command/index.d.ts +458 -310
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +2011 -76
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +309 -97
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +796 -701
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +329 -97
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +309 -97
- package/dist/core/index.native.js.map +1 -1
- package/dist/datetime/index.d.ts +59 -44
- package/dist/datetime/index.d.ts.map +1 -1
- package/dist/datetime/index.js +15 -0
- package/dist/datetime/index.js.map +1 -1
- package/dist/email/index.d.ts +314 -19
- package/dist/email/index.d.ts.map +1 -1
- package/dist/email/index.js +1852 -7
- package/dist/email/index.js.map +1 -1
- package/dist/fake/index.d.ts +5500 -5418
- package/dist/fake/index.d.ts.map +1 -1
- package/dist/fake/index.js +113 -42
- package/dist/fake/index.js.map +1 -1
- package/dist/lock/core/index.d.ts +219 -212
- package/dist/lock/core/index.d.ts.map +1 -1
- package/dist/lock/core/index.js +11 -4
- package/dist/lock/core/index.js.map +1 -1
- package/dist/lock/redis/index.d.ts.map +1 -1
- package/dist/logger/index.d.ts +41 -90
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +15 -68
- package/dist/logger/index.js.map +1 -1
- package/dist/mcp/index.d.ts +228 -230
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +32 -31
- package/dist/mcp/index.js.map +1 -1
- package/dist/orm/index.browser.js +12 -12
- package/dist/orm/index.browser.js.map +1 -1
- package/dist/orm/index.bun.js +90 -80
- package/dist/orm/index.bun.js.map +1 -1
- package/dist/orm/index.d.ts +1434 -1459
- package/dist/orm/index.d.ts.map +1 -1
- package/dist/orm/index.js +112 -130
- package/dist/orm/index.js.map +1 -1
- package/dist/queue/core/index.d.ts +262 -254
- package/dist/queue/core/index.d.ts.map +1 -1
- package/dist/queue/core/index.js +14 -6
- package/dist/queue/core/index.js.map +1 -1
- package/dist/queue/redis/index.d.ts.map +1 -1
- package/dist/react/auth/index.browser.js +108 -0
- package/dist/react/auth/index.browser.js.map +1 -0
- package/dist/react/auth/index.d.ts +100 -0
- package/dist/react/auth/index.d.ts.map +1 -0
- package/dist/react/auth/index.js +145 -0
- package/dist/react/auth/index.js.map +1 -0
- package/dist/react/core/index.d.ts +469 -0
- package/dist/react/core/index.d.ts.map +1 -0
- package/dist/react/core/index.js +464 -0
- package/dist/react/core/index.js.map +1 -0
- package/dist/react/form/index.d.ts +232 -0
- package/dist/react/form/index.d.ts.map +1 -0
- package/dist/react/form/index.js +432 -0
- package/dist/react/form/index.js.map +1 -0
- package/dist/react/head/index.browser.js +423 -0
- package/dist/react/head/index.browser.js.map +1 -0
- package/dist/react/head/index.d.ts +288 -0
- package/dist/react/head/index.d.ts.map +1 -0
- package/dist/react/head/index.js +465 -0
- package/dist/react/head/index.js.map +1 -0
- package/dist/react/i18n/index.d.ts +175 -0
- package/dist/react/i18n/index.d.ts.map +1 -0
- package/dist/react/i18n/index.js +224 -0
- package/dist/react/i18n/index.js.map +1 -0
- package/dist/react/router/index.browser.js +1980 -0
- package/dist/react/router/index.browser.js.map +1 -0
- package/dist/react/router/index.d.ts +2068 -0
- package/dist/react/router/index.d.ts.map +1 -0
- package/dist/react/router/index.js +4932 -0
- package/dist/react/router/index.js.map +1 -0
- package/dist/react/websocket/index.d.ts +117 -0
- package/dist/react/websocket/index.d.ts.map +1 -0
- package/dist/react/websocket/index.js +107 -0
- package/dist/react/websocket/index.js.map +1 -0
- package/dist/redis/index.bun.js +4 -0
- package/dist/redis/index.bun.js.map +1 -1
- package/dist/redis/index.d.ts +127 -130
- package/dist/redis/index.d.ts.map +1 -1
- package/dist/redis/index.js +16 -25
- package/dist/redis/index.js.map +1 -1
- package/dist/retry/index.d.ts +80 -71
- package/dist/retry/index.d.ts.map +1 -1
- package/dist/retry/index.js +11 -2
- package/dist/retry/index.js.map +1 -1
- package/dist/router/index.d.ts +6 -6
- package/dist/router/index.d.ts.map +1 -1
- package/dist/scheduler/index.d.ts +119 -28
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +404 -3
- package/dist/scheduler/index.js.map +1 -1
- package/dist/security/index.d.ts +642 -228
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +1579 -37
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.d.ts +1141 -111
- package/dist/server/auth/index.d.ts.map +1 -1
- package/dist/server/auth/index.js +1261 -25
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cache/index.d.ts +63 -78
- package/dist/server/cache/index.d.ts.map +1 -1
- package/dist/server/cache/index.js +7 -22
- package/dist/server/cache/index.js.map +1 -1
- package/dist/server/compress/index.d.ts +13 -5
- package/dist/server/compress/index.d.ts.map +1 -1
- package/dist/server/compress/index.js +10 -2
- package/dist/server/compress/index.js.map +1 -1
- package/dist/server/cookies/index.d.ts +46 -22
- package/dist/server/cookies/index.d.ts.map +1 -1
- package/dist/server/cookies/index.js +7 -5
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/server/core/index.d.ts +307 -196
- package/dist/server/core/index.d.ts.map +1 -1
- package/dist/server/core/index.js +271 -38
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/cors/index.d.ts +24 -34
- package/dist/server/cors/index.d.ts.map +1 -1
- package/dist/server/cors/index.js +7 -21
- package/dist/server/cors/index.js.map +1 -1
- package/dist/server/health/index.d.ts +25 -19
- package/dist/server/health/index.d.ts.map +1 -1
- package/dist/server/health/index.js +8 -2
- package/dist/server/health/index.js.map +1 -1
- package/dist/server/helmet/index.d.ts +13 -5
- package/dist/server/helmet/index.d.ts.map +1 -1
- package/dist/server/helmet/index.js +11 -3
- package/dist/server/helmet/index.js.map +1 -1
- package/dist/server/links/index.browser.js +9 -1
- package/dist/server/links/index.browser.js.map +1 -1
- package/dist/server/links/index.d.ts +133 -128
- package/dist/server/links/index.d.ts.map +1 -1
- package/dist/server/links/index.js +24 -11
- package/dist/server/links/index.js.map +1 -1
- package/dist/server/metrics/index.d.ts +524 -4
- package/dist/server/metrics/index.d.ts.map +1 -1
- package/dist/server/metrics/index.js +4472 -7
- package/dist/server/metrics/index.js.map +1 -1
- package/dist/server/multipart/index.d.ts +15 -9
- package/dist/server/multipart/index.d.ts.map +1 -1
- package/dist/server/multipart/index.js +9 -3
- package/dist/server/multipart/index.js.map +1 -1
- package/dist/server/proxy/index.d.ts +110 -104
- package/dist/server/proxy/index.d.ts.map +1 -1
- package/dist/server/proxy/index.js +8 -2
- package/dist/server/proxy/index.js.map +1 -1
- package/dist/server/rate-limit/index.d.ts +46 -51
- package/dist/server/rate-limit/index.d.ts.map +1 -1
- package/dist/server/rate-limit/index.js +18 -55
- package/dist/server/rate-limit/index.js.map +1 -1
- package/dist/server/static/index.d.ts +181 -48
- package/dist/server/static/index.d.ts.map +1 -1
- package/dist/server/static/index.js +1848 -5
- package/dist/server/static/index.js.map +1 -1
- package/dist/server/swagger/index.d.ts +348 -53
- package/dist/server/swagger/index.d.ts.map +1 -1
- package/dist/server/swagger/index.js +1849 -6
- package/dist/server/swagger/index.js.map +1 -1
- package/dist/sms/index.d.ts +312 -18
- package/dist/sms/index.d.ts.map +1 -1
- package/dist/sms/index.js +1854 -10
- package/dist/sms/index.js.map +1 -1
- package/dist/system/index.browser.js +496 -0
- package/dist/system/index.browser.js.map +1 -0
- package/dist/system/index.d.ts +1158 -0
- package/dist/system/index.d.ts.map +1 -0
- package/dist/{file → system}/index.js +412 -20
- package/dist/system/index.js.map +1 -0
- package/dist/thread/index.d.ts +82 -73
- package/dist/thread/index.d.ts.map +1 -1
- package/dist/thread/index.js +13 -4
- package/dist/thread/index.js.map +1 -1
- package/dist/topic/core/index.d.ts +330 -323
- package/dist/topic/core/index.d.ts.map +1 -1
- package/dist/topic/core/index.js +12 -5
- package/dist/topic/core/index.js.map +1 -1
- package/dist/topic/redis/index.d.ts +6 -6
- package/dist/topic/redis/index.d.ts.map +1 -1
- package/dist/vite/index.d.ts +163 -5825
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +130 -477
- package/dist/vite/index.js.map +1 -1
- package/dist/websocket/index.browser.js +3 -3
- package/dist/websocket/index.browser.js.map +1 -1
- package/dist/websocket/index.d.ts +287 -283
- package/dist/websocket/index.d.ts.map +1 -1
- package/dist/websocket/index.js +15 -11
- package/dist/websocket/index.js.map +1 -1
- package/package.json +86 -17
- package/src/api/audits/index.ts +10 -33
- package/src/api/files/__tests__/$bucket.spec.ts +1 -1
- package/src/api/files/controllers/AdminFileStatsController.spec.ts +1 -1
- package/src/api/files/controllers/FileController.spec.ts +1 -1
- package/src/api/files/index.ts +10 -3
- package/src/api/files/jobs/FileJobs.spec.ts +1 -1
- package/src/api/files/services/FileService.spec.ts +1 -1
- package/src/api/jobs/index.ts +10 -3
- package/src/api/keys/controllers/AdminApiKeyController.ts +75 -0
- package/src/api/keys/controllers/ApiKeyController.ts +103 -0
- package/src/api/keys/entities/apiKeyEntity.ts +41 -0
- package/src/api/keys/index.ts +49 -0
- package/src/api/keys/schemas/adminApiKeyQuerySchema.ts +7 -0
- package/src/api/keys/schemas/adminApiKeyResourceSchema.ts +17 -0
- package/src/api/keys/schemas/createApiKeyBodySchema.ts +7 -0
- package/src/api/keys/schemas/createApiKeyResponseSchema.ts +11 -0
- package/src/api/keys/schemas/listApiKeyResponseSchema.ts +15 -0
- package/src/api/keys/schemas/revokeApiKeyParamsSchema.ts +5 -0
- package/src/api/keys/schemas/revokeApiKeyResponseSchema.ts +5 -0
- package/src/api/keys/services/ApiKeyService.spec.ts +553 -0
- package/src/api/keys/services/ApiKeyService.ts +306 -0
- package/src/api/logs/TODO.md +52 -0
- package/src/api/notifications/index.ts +10 -4
- package/src/api/parameters/index.ts +9 -30
- package/src/api/parameters/primitives/$config.ts +12 -4
- package/src/api/parameters/services/ConfigStore.ts +9 -3
- package/src/api/users/__tests__/ApiKeys-integration.spec.ts +1035 -0
- package/src/api/users/__tests__/ApiKeys.spec.ts +401 -0
- package/src/api/users/index.ts +14 -3
- package/src/api/users/primitives/$realm.ts +33 -5
- package/src/api/users/providers/RealmProvider.ts +1 -12
- package/src/api/users/services/SessionService.ts +1 -11
- package/src/api/verifications/controllers/VerificationController.ts +2 -0
- package/src/api/verifications/index.ts +10 -4
- package/src/batch/index.ts +9 -36
- package/src/batch/primitives/$batch.ts +0 -8
- package/src/batch/providers/BatchProvider.ts +29 -2
- package/src/bucket/__tests__/shared.ts +1 -1
- package/src/bucket/index.ts +13 -6
- package/src/bucket/primitives/$bucket.ts +1 -1
- package/src/bucket/providers/LocalFileStorageProvider.ts +1 -1
- package/src/bucket/providers/MemoryFileStorageProvider.ts +1 -1
- package/src/cache/core/__tests__/shared.ts +30 -0
- package/src/cache/core/index.ts +11 -6
- package/src/cache/core/primitives/$cache.spec.ts +5 -0
- package/src/cache/core/providers/CacheProvider.ts +17 -0
- package/src/cache/core/providers/MemoryCacheProvider.ts +300 -1
- package/src/cache/redis/__tests__/cache-redis.spec.ts +5 -0
- package/src/cache/redis/providers/RedisCacheProvider.ts +9 -0
- package/src/cli/apps/AlephaCli.ts +3 -16
- package/src/cli/apps/AlephaPackageBuilderCli.ts +10 -2
- package/src/cli/atoms/appEntryOptions.ts +13 -0
- package/src/cli/atoms/buildOptions.ts +1 -1
- package/src/cli/atoms/changelogOptions.ts +1 -1
- package/src/cli/commands/build.ts +64 -52
- package/src/cli/commands/db.ts +17 -11
- package/src/cli/commands/deploy.ts +1 -1
- package/src/cli/commands/dev.ts +13 -49
- package/src/cli/commands/gen/env.ts +6 -3
- package/src/cli/commands/gen/openapi.ts +5 -2
- package/src/cli/commands/init.spec.ts +544 -0
- package/src/cli/commands/init.ts +101 -58
- package/src/cli/commands/lint.ts +8 -2
- package/src/cli/commands/typecheck.ts +11 -0
- package/src/cli/defineConfig.ts +9 -0
- package/src/cli/index.ts +2 -1
- package/src/cli/providers/AppEntryProvider.ts +131 -0
- package/src/cli/providers/ViteBuildProvider.ts +40 -0
- package/src/cli/providers/ViteDevServerProvider.ts +378 -0
- package/src/cli/services/AlephaCliUtils.ts +39 -93
- package/src/cli/services/PackageManagerUtils.ts +140 -17
- package/src/cli/services/ProjectScaffolder.ts +169 -101
- package/src/cli/services/ViteUtils.ts +82 -0
- package/src/cli/{assets/claudeMd.ts → templates/agentMd.ts} +41 -28
- package/src/cli/{assets → templates}/apiHelloControllerTs.ts +2 -1
- package/src/cli/{assets → templates}/biomeJson.ts +2 -1
- package/src/cli/{assets → templates}/dummySpecTs.ts +2 -1
- package/src/cli/{assets → templates}/editorconfig.ts +2 -1
- package/src/cli/templates/gitignore.ts +39 -0
- package/src/cli/{assets → templates}/mainBrowserTs.ts +2 -1
- package/src/cli/templates/mainCss.ts +33 -0
- package/src/cli/templates/mainServerTs.ts +33 -0
- package/src/cli/{assets → templates}/tsconfigJson.ts +2 -1
- package/src/cli/templates/webAppRouterTs.ts +50 -0
- package/src/cli/templates/webHelloComponentTsx.ts +20 -0
- package/src/command/helpers/Runner.spec.ts +4 -0
- package/src/command/helpers/Runner.ts +3 -21
- package/src/command/index.ts +12 -4
- package/src/command/providers/CliProvider.spec.ts +1067 -0
- package/src/command/providers/CliProvider.ts +203 -40
- package/src/core/Alepha.ts +3 -9
- package/src/core/__tests__/Alepha-start.spec.ts +4 -4
- package/src/core/helpers/jsonSchemaToTypeBox.spec.ts +771 -0
- package/src/core/helpers/jsonSchemaToTypeBox.ts +62 -10
- package/src/core/index.shared.ts +1 -0
- package/src/core/index.ts +20 -0
- package/src/core/primitives/$module.ts +12 -0
- package/src/core/providers/EventManager.spec.ts +0 -71
- package/src/core/providers/EventManager.ts +3 -15
- package/src/core/providers/Json.ts +2 -14
- package/src/core/providers/KeylessJsonSchemaCodec.spec.ts +257 -0
- package/src/core/providers/KeylessJsonSchemaCodec.ts +396 -14
- package/src/core/providers/SchemaValidator.spec.ts +236 -0
- package/src/datetime/index.ts +15 -0
- package/src/email/index.ts +10 -5
- package/src/email/providers/LocalEmailProvider.spec.ts +1 -1
- package/src/email/providers/LocalEmailProvider.ts +1 -1
- package/src/fake/__tests__/keyName.example.ts +1 -1
- package/src/fake/__tests__/keyName.spec.ts +5 -5
- package/src/fake/index.ts +9 -6
- package/src/fake/providers/FakeProvider.spec.ts +258 -40
- package/src/fake/providers/FakeProvider.ts +133 -19
- package/src/lock/core/index.ts +11 -4
- package/src/logger/index.ts +17 -66
- package/src/logger/providers/PrettyFormatterProvider.ts +0 -9
- package/src/mcp/errors/McpError.ts +30 -0
- package/src/mcp/index.ts +13 -27
- package/src/mcp/transports/SseMcpTransport.ts +6 -7
- package/src/orm/__tests__/PostgresProvider.spec.ts +2 -2
- package/src/orm/index.browser.ts +2 -2
- package/src/orm/index.bun.ts +4 -2
- package/src/orm/index.ts +21 -47
- package/src/orm/providers/DrizzleKitProvider.ts +3 -5
- package/src/orm/providers/drivers/BunSqliteProvider.ts +1 -0
- package/src/orm/services/Repository.ts +18 -3
- package/src/queue/core/index.ts +14 -6
- package/src/react/auth/__tests__/$auth.spec.ts +202 -0
- package/src/react/auth/hooks/useAuth.ts +32 -0
- package/src/react/auth/index.browser.ts +13 -0
- package/src/react/auth/index.shared.ts +2 -0
- package/src/react/auth/index.ts +48 -0
- package/src/react/auth/providers/ReactAuthProvider.ts +16 -0
- package/src/react/auth/services/ReactAuth.ts +135 -0
- package/src/react/core/__tests__/Router.spec.tsx +169 -0
- package/src/react/core/components/ClientOnly.tsx +49 -0
- package/src/react/core/components/ErrorBoundary.tsx +73 -0
- package/src/react/core/contexts/AlephaContext.ts +7 -0
- package/src/react/core/contexts/AlephaProvider.tsx +42 -0
- package/src/react/core/hooks/useAction.browser.spec.tsx +569 -0
- package/src/react/core/hooks/useAction.ts +480 -0
- package/src/react/core/hooks/useAlepha.ts +26 -0
- package/src/react/core/hooks/useClient.ts +17 -0
- package/src/react/core/hooks/useEvents.ts +51 -0
- package/src/react/core/hooks/useInject.ts +12 -0
- package/src/react/core/hooks/useStore.ts +52 -0
- package/src/react/core/index.ts +90 -0
- package/src/react/form/components/FormState.tsx +17 -0
- package/src/react/form/errors/FormValidationError.ts +18 -0
- package/src/react/form/hooks/useForm.browser.spec.tsx +366 -0
- package/src/react/form/hooks/useForm.ts +47 -0
- package/src/react/form/hooks/useFormState.ts +130 -0
- package/src/react/form/index.ts +44 -0
- package/src/react/form/services/FormModel.ts +614 -0
- package/src/react/head/helpers/SeoExpander.spec.ts +203 -0
- package/src/react/head/helpers/SeoExpander.ts +142 -0
- package/src/react/head/hooks/useHead.spec.tsx +288 -0
- package/src/react/head/hooks/useHead.ts +62 -0
- package/src/react/head/index.browser.ts +26 -0
- package/src/react/head/index.ts +44 -0
- package/src/react/head/interfaces/Head.ts +105 -0
- package/src/react/head/primitives/$head.ts +25 -0
- package/src/react/head/providers/BrowserHeadProvider.browser.spec.ts +196 -0
- package/src/react/head/providers/BrowserHeadProvider.ts +212 -0
- package/src/react/head/providers/HeadProvider.ts +168 -0
- package/src/react/head/providers/ServerHeadProvider.ts +31 -0
- package/src/react/i18n/__tests__/integration.spec.tsx +239 -0
- package/src/react/i18n/components/Localize.spec.tsx +357 -0
- package/src/react/i18n/components/Localize.tsx +35 -0
- package/src/react/i18n/hooks/useI18n.browser.spec.tsx +438 -0
- package/src/react/i18n/hooks/useI18n.ts +18 -0
- package/src/react/i18n/index.ts +41 -0
- package/src/react/i18n/primitives/$dictionary.ts +69 -0
- package/src/react/i18n/providers/I18nProvider.spec.ts +389 -0
- package/src/react/i18n/providers/I18nProvider.ts +278 -0
- package/src/react/router/__tests__/page-head-browser.browser.spec.ts +95 -0
- package/src/react/router/__tests__/page-head.spec.ts +48 -0
- package/src/react/router/__tests__/seo-head.spec.ts +125 -0
- package/src/react/router/atoms/ssrManifestAtom.ts +58 -0
- package/src/react/router/components/ErrorViewer.tsx +872 -0
- package/src/react/router/components/Link.tsx +23 -0
- package/src/react/router/components/NestedView.tsx +223 -0
- package/src/react/router/components/NotFound.tsx +30 -0
- package/src/react/router/constants/PAGE_PRELOAD_KEY.ts +6 -0
- package/src/react/router/contexts/RouterLayerContext.ts +12 -0
- package/src/react/router/errors/Redirection.ts +28 -0
- package/src/react/router/hooks/useActive.ts +52 -0
- package/src/react/router/hooks/useQueryParams.ts +63 -0
- package/src/react/router/hooks/useRouter.ts +20 -0
- package/src/react/router/hooks/useRouterState.ts +11 -0
- package/src/react/router/index.browser.ts +45 -0
- package/src/react/router/index.shared.ts +19 -0
- package/src/react/router/index.ts +142 -0
- package/src/react/router/primitives/$page.browser.spec.tsx +851 -0
- package/src/react/router/primitives/$page.spec.tsx +708 -0
- package/src/react/router/primitives/$page.ts +497 -0
- package/src/react/router/providers/ReactBrowserProvider.ts +309 -0
- package/src/react/router/providers/ReactBrowserRendererProvider.ts +25 -0
- package/src/react/router/providers/ReactBrowserRouterProvider.ts +168 -0
- package/src/react/router/providers/ReactPageProvider.ts +726 -0
- package/src/react/router/providers/ReactServerProvider.spec.tsx +316 -0
- package/src/react/router/providers/ReactServerProvider.ts +558 -0
- package/src/react/router/providers/ReactServerTemplateProvider.ts +979 -0
- package/src/react/router/providers/SSRManifestProvider.ts +334 -0
- package/src/react/router/services/ReactPageServerService.ts +48 -0
- package/src/react/router/services/ReactPageService.ts +27 -0
- package/src/react/router/services/ReactRouter.ts +262 -0
- package/src/react/websocket/hooks/useRoom.tsx +242 -0
- package/src/react/websocket/index.ts +7 -0
- package/src/redis/__tests__/redis.spec.ts +13 -0
- package/src/redis/index.ts +9 -25
- package/src/redis/providers/BunRedisProvider.ts +9 -0
- package/src/redis/providers/NodeRedisProvider.ts +8 -0
- package/src/redis/providers/RedisProvider.ts +16 -0
- package/src/retry/index.ts +11 -2
- package/src/router/index.ts +15 -0
- package/src/scheduler/index.ts +11 -2
- package/src/security/__tests__/BasicAuth.spec.ts +2 -0
- package/src/security/__tests__/ServerSecurityProvider.spec.ts +13 -5
- package/src/security/index.ts +15 -10
- package/src/security/interfaces/IssuerResolver.ts +27 -0
- package/src/security/primitives/$issuer.ts +55 -0
- package/src/security/providers/SecurityProvider.ts +179 -0
- package/src/security/providers/ServerBasicAuthProvider.ts +6 -2
- package/src/security/providers/ServerSecurityProvider.ts +36 -22
- package/src/server/auth/index.ts +12 -7
- package/src/server/cache/index.ts +7 -22
- package/src/server/compress/index.ts +10 -2
- package/src/server/cookies/index.ts +7 -5
- package/src/server/cookies/primitives/$cookie.ts +33 -11
- package/src/server/core/index.ts +17 -7
- package/src/server/core/interfaces/ServerRequest.ts +83 -1
- package/src/server/core/primitives/$action.spec.ts +1 -1
- package/src/server/core/primitives/$action.ts +8 -3
- package/src/server/core/providers/BunHttpServerProvider.ts +1 -1
- package/src/server/core/providers/NodeHttpServerProvider.spec.ts +125 -0
- package/src/server/core/providers/NodeHttpServerProvider.ts +77 -22
- package/src/server/core/providers/ServerLoggerProvider.ts +2 -2
- package/src/server/core/providers/ServerProvider.ts +9 -12
- package/src/server/core/services/ServerRequestParser.spec.ts +520 -0
- package/src/server/core/services/ServerRequestParser.ts +306 -13
- package/src/server/cors/index.ts +7 -21
- package/src/server/cors/primitives/$cors.ts +6 -2
- package/src/server/health/index.ts +8 -2
- package/src/server/helmet/index.ts +11 -3
- package/src/server/links/atoms/apiLinksAtom.ts +7 -0
- package/src/server/links/index.browser.ts +2 -0
- package/src/server/links/index.ts +13 -6
- package/src/server/metrics/index.ts +10 -3
- package/src/server/multipart/index.ts +9 -3
- package/src/server/proxy/index.ts +8 -2
- package/src/server/rate-limit/index.ts +21 -25
- package/src/server/rate-limit/primitives/$rateLimit.ts +6 -2
- package/src/server/rate-limit/providers/ServerRateLimitProvider.spec.ts +38 -14
- package/src/server/rate-limit/providers/ServerRateLimitProvider.ts +22 -56
- package/src/server/static/index.ts +8 -2
- package/src/server/static/providers/ServerStaticProvider.ts +1 -1
- package/src/server/swagger/index.ts +9 -4
- package/src/server/swagger/providers/ServerSwaggerProvider.ts +1 -1
- package/src/sms/index.ts +9 -5
- package/src/sms/providers/LocalSmsProvider.spec.ts +1 -1
- package/src/sms/providers/LocalSmsProvider.ts +1 -1
- package/src/system/index.browser.ts +11 -0
- package/src/system/index.ts +62 -0
- package/src/{file → system}/providers/FileSystemProvider.ts +16 -0
- package/src/{file → system}/providers/MemoryFileSystemProvider.ts +116 -3
- package/src/system/providers/MemoryShellProvider.ts +164 -0
- package/src/{file → system}/providers/NodeFileSystemProvider.spec.ts +2 -2
- package/src/{file → system}/providers/NodeFileSystemProvider.ts +36 -0
- package/src/system/providers/NodeShellProvider.ts +184 -0
- package/src/system/providers/ShellProvider.ts +74 -0
- package/src/{file → system}/services/FileDetector.spec.ts +2 -2
- package/src/thread/index.ts +11 -2
- package/src/topic/core/index.ts +12 -5
- package/src/vite/index.ts +3 -2
- package/src/vite/tasks/buildClient.ts +2 -8
- package/src/vite/tasks/buildServer.ts +84 -21
- package/src/vite/tasks/copyAssets.ts +5 -4
- package/src/vite/tasks/generateSitemap.ts +64 -23
- package/src/vite/tasks/index.ts +0 -2
- package/src/vite/tasks/prerenderPages.ts +49 -24
- package/src/websocket/index.ts +12 -8
- package/dist/file/index.d.ts +0 -839
- package/dist/file/index.d.ts.map +0 -1
- package/dist/file/index.js.map +0 -1
- package/src/cli/assets/indexHtml.ts +0 -15
- package/src/cli/assets/mainServerTs.ts +0 -24
- package/src/cli/assets/webAppRouterTs.ts +0 -15
- package/src/cli/assets/webHelloComponentTsx.ts +0 -16
- package/src/cli/commands/format.ts +0 -23
- package/src/file/index.ts +0 -43
- package/src/vite/helpers/boot.ts +0 -117
- package/src/vite/plugins/viteAlephaDev.ts +0 -177
- package/src/vite/tasks/devServer.ts +0 -71
- package/src/vite/tasks/runAlepha.ts +0 -270
- /package/dist/orm/{chunk-DtkW-qnP.js → chunk-DH6iiROE.js} +0 -0
- /package/src/cli/{assets → templates}/apiIndexTs.ts +0 -0
- /package/src/cli/{assets → templates}/webIndexTs.ts +0 -0
- /package/src/{file → system}/errors/FileError.ts +0 -0
- /package/src/{file → system}/services/FileDetector.ts +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha349 from "alepha";
|
|
2
2
|
import { Alepha, KIND, Primitive, Static, TNull, TObject, TOptional, TSchema, TUnion } from "alepha";
|
|
3
3
|
import * as alepha_server0 from "alepha/server";
|
|
4
4
|
import { ServerRequest } from "alepha/server";
|
|
5
|
-
import * as
|
|
5
|
+
import * as alepha_orm0 from "alepha/orm";
|
|
6
6
|
import { Page } from "alepha/orm";
|
|
7
7
|
import * as alepha_logger0 from "alepha/logger";
|
|
8
8
|
import "drizzle-orm/d1";
|
|
@@ -42,114 +42,114 @@ type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["properties"]]:
|
|
|
42
42
|
//#region ../../src/orm/primitives/$entity.d.ts
|
|
43
43
|
interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
|
|
44
44
|
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
* The database table name that will be created for this entity.
|
|
46
|
+
* If not provided, name will be inferred from the $repository variable name.
|
|
47
|
+
*/
|
|
48
48
|
name: string;
|
|
49
49
|
/**
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
* TypeBox schema defining the table structure and column types.
|
|
51
|
+
*/
|
|
52
52
|
schema: T;
|
|
53
53
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
* Database indexes to create for query optimization.
|
|
55
|
+
*/
|
|
56
56
|
indexes?: (Keys | {
|
|
57
57
|
/**
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
* Single column to index.
|
|
59
|
+
*/
|
|
60
60
|
column: Keys;
|
|
61
61
|
/**
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
63
|
+
*/
|
|
64
64
|
unique?: boolean;
|
|
65
65
|
/**
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
* Custom name for the index. If not provided, generates name automatically.
|
|
67
|
+
*/
|
|
68
68
|
name?: string;
|
|
69
69
|
} | {
|
|
70
70
|
/**
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
* Multiple columns for composite index (order matters for query optimization).
|
|
72
|
+
*/
|
|
73
73
|
columns: Keys[];
|
|
74
74
|
/**
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
76
|
+
*/
|
|
77
77
|
unique?: boolean;
|
|
78
78
|
/**
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
* Custom name for the index. If not provided, generates name automatically.
|
|
80
|
+
*/
|
|
81
81
|
name?: string;
|
|
82
82
|
})[];
|
|
83
83
|
/**
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
* Foreign key constraints to maintain referential integrity.
|
|
85
|
+
*/
|
|
86
86
|
foreignKeys?: Array<{
|
|
87
87
|
/**
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
* Optional name for the foreign key constraint.
|
|
89
|
+
*/
|
|
90
90
|
name?: string;
|
|
91
91
|
/**
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
* Local columns that reference the foreign table.
|
|
93
|
+
*/
|
|
94
94
|
columns: Array<keyof Static<T>>;
|
|
95
95
|
/**
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
* Referenced columns in the foreign table.
|
|
97
|
+
* Must be EntityColumn references from other entities.
|
|
98
|
+
*/
|
|
99
99
|
foreignColumns: Array<() => EntityColumn<any>>;
|
|
100
100
|
}>;
|
|
101
101
|
/**
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
102
|
+
* Additional table constraints for data validation.
|
|
103
|
+
*
|
|
104
|
+
* Constraints enforce business rules at the database level, providing
|
|
105
|
+
* an additional layer of data integrity beyond application validation.
|
|
106
|
+
*
|
|
107
|
+
* **Constraint Types**:
|
|
108
|
+
* - **Unique constraints**: Prevent duplicate values across columns
|
|
109
|
+
* - **Check constraints**: Enforce custom validation rules with SQL expressions
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* constraints: [
|
|
114
|
+
* {
|
|
115
|
+
* name: "unique_user_email",
|
|
116
|
+
* columns: ["email"],
|
|
117
|
+
* unique: true
|
|
118
|
+
* },
|
|
119
|
+
* {
|
|
120
|
+
* name: "valid_age_range",
|
|
121
|
+
* columns: ["age"],
|
|
122
|
+
* check: sql`age >= 0 AND age <= 150`
|
|
123
|
+
* },
|
|
124
|
+
* {
|
|
125
|
+
* name: "unique_user_username_per_tenant",
|
|
126
|
+
* columns: ["tenantId", "username"],
|
|
127
|
+
* unique: true
|
|
128
|
+
* }
|
|
129
|
+
* ]
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
132
|
constraints?: Array<{
|
|
133
133
|
/**
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
* Columns involved in this constraint.
|
|
135
|
+
*/
|
|
136
136
|
columns: Array<keyof Static<T>>;
|
|
137
137
|
/**
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
* Optional name for the constraint.
|
|
139
|
+
*/
|
|
140
140
|
name?: string;
|
|
141
141
|
/**
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
* Whether this is a unique constraint.
|
|
143
|
+
*/
|
|
144
144
|
unique?: boolean | {};
|
|
145
145
|
/**
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
* SQL expression for check constraint validation.
|
|
147
|
+
*/
|
|
148
148
|
check?: SQL;
|
|
149
149
|
}>;
|
|
150
150
|
/**
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
* Advanced Drizzle ORM configuration for complex table setups.
|
|
152
|
+
*/
|
|
153
153
|
config?: (self: BuildExtraConfigColumns<string, FromSchema<T>, "pg">) => PgTableExtraConfigValue[];
|
|
154
154
|
}
|
|
155
155
|
declare class EntityPrimitive<T extends TObject = TObject> {
|
|
@@ -197,8 +197,8 @@ type PgSymbols = {
|
|
|
197
197
|
[PG_REF]: PgRefOptions;
|
|
198
198
|
[PG_ENUM]: PgEnumOptions;
|
|
199
199
|
/**
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
* @deprecated Use `PG_IDENTITY` instead.
|
|
201
|
+
*/
|
|
202
202
|
[PG_SERIAL]: {};
|
|
203
203
|
};
|
|
204
204
|
type PgSymbolKeys = keyof PgSymbols;
|
|
@@ -232,7 +232,7 @@ type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]:
|
|
|
232
232
|
/**
|
|
233
233
|
* Audit severity levels for categorizing events.
|
|
234
234
|
*/
|
|
235
|
-
declare const auditSeveritySchema:
|
|
235
|
+
declare const auditSeveritySchema: alepha349.TUnsafe<"info" | "warning" | "critical">;
|
|
236
236
|
type AuditSeverity = Static<typeof auditSeveritySchema>;
|
|
237
237
|
/**
|
|
238
238
|
* Audit log entity for tracking important system events.
|
|
@@ -243,212 +243,212 @@ type AuditSeverity = Static<typeof auditSeveritySchema>;
|
|
|
243
243
|
* - When it happened (createdAt)
|
|
244
244
|
* - Context and details (metadata, ipAddress, userAgent)
|
|
245
245
|
*/
|
|
246
|
-
declare const audits:
|
|
247
|
-
id:
|
|
248
|
-
createdAt:
|
|
249
|
-
/**
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
type:
|
|
254
|
-
/**
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
action:
|
|
258
|
-
/**
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
severity:
|
|
262
|
-
/**
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
userId:
|
|
266
|
-
/**
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
userRealm:
|
|
270
|
-
/**
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
userEmail:
|
|
274
|
-
/**
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
resourceType:
|
|
278
|
-
/**
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
resourceId:
|
|
282
|
-
/**
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
description:
|
|
286
|
-
/**
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
metadata:
|
|
290
|
-
/**
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
ipAddress:
|
|
294
|
-
/**
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
userAgent:
|
|
298
|
-
/**
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
sessionId:
|
|
302
|
-
/**
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
requestId:
|
|
306
|
-
/**
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
success:
|
|
310
|
-
/**
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
errorMessage:
|
|
246
|
+
declare const audits: alepha_orm0.EntityPrimitive<alepha349.TObject<{
|
|
247
|
+
id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha349.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
|
|
248
|
+
createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha349.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
249
|
+
/**
|
|
250
|
+
* Audit event type (e.g., "auth", "user", "payment", "system").
|
|
251
|
+
* Used for categorizing and filtering audit events.
|
|
252
|
+
*/
|
|
253
|
+
type: alepha349.TString;
|
|
254
|
+
/**
|
|
255
|
+
* Specific action performed (e.g., "login", "logout", "create", "update", "delete").
|
|
256
|
+
*/
|
|
257
|
+
action: alepha349.TString;
|
|
258
|
+
/**
|
|
259
|
+
* Severity level of the event.
|
|
260
|
+
*/
|
|
261
|
+
severity: alepha_orm0.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm0.PG_DEFAULT>;
|
|
262
|
+
/**
|
|
263
|
+
* User ID who performed the action (null for system events).
|
|
264
|
+
*/
|
|
265
|
+
userId: alepha349.TOptional<alepha349.TString>;
|
|
266
|
+
/**
|
|
267
|
+
* User realm for multi-tenant support.
|
|
268
|
+
*/
|
|
269
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
270
|
+
/**
|
|
271
|
+
* User email at the time of the event (denormalized for history).
|
|
272
|
+
*/
|
|
273
|
+
userEmail: alepha349.TOptional<alepha349.TString>;
|
|
274
|
+
/**
|
|
275
|
+
* Resource type affected (e.g., "user", "order", "file").
|
|
276
|
+
*/
|
|
277
|
+
resourceType: alepha349.TOptional<alepha349.TString>;
|
|
278
|
+
/**
|
|
279
|
+
* Resource ID affected.
|
|
280
|
+
*/
|
|
281
|
+
resourceId: alepha349.TOptional<alepha349.TString>;
|
|
282
|
+
/**
|
|
283
|
+
* Human-readable description of the event.
|
|
284
|
+
*/
|
|
285
|
+
description: alepha349.TOptional<alepha349.TString>;
|
|
286
|
+
/**
|
|
287
|
+
* Additional metadata/context as JSON.
|
|
288
|
+
*/
|
|
289
|
+
metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
|
|
290
|
+
/**
|
|
291
|
+
* Client IP address.
|
|
292
|
+
*/
|
|
293
|
+
ipAddress: alepha349.TOptional<alepha349.TString>;
|
|
294
|
+
/**
|
|
295
|
+
* Client user agent.
|
|
296
|
+
*/
|
|
297
|
+
userAgent: alepha349.TOptional<alepha349.TString>;
|
|
298
|
+
/**
|
|
299
|
+
* Session ID if applicable.
|
|
300
|
+
*/
|
|
301
|
+
sessionId: alepha349.TOptional<alepha349.TString>;
|
|
302
|
+
/**
|
|
303
|
+
* Request ID for correlation.
|
|
304
|
+
*/
|
|
305
|
+
requestId: alepha349.TOptional<alepha349.TString>;
|
|
306
|
+
/**
|
|
307
|
+
* Whether the action was successful.
|
|
308
|
+
*/
|
|
309
|
+
success: alepha_orm0.PgAttr<alepha349.TBoolean, typeof alepha_orm0.PG_DEFAULT>;
|
|
310
|
+
/**
|
|
311
|
+
* Error message if the action failed.
|
|
312
|
+
*/
|
|
313
|
+
errorMessage: alepha349.TOptional<alepha349.TString>;
|
|
314
314
|
}>>;
|
|
315
|
-
declare const auditEntitySchema:
|
|
316
|
-
id:
|
|
317
|
-
createdAt:
|
|
318
|
-
/**
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
type:
|
|
323
|
-
/**
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
action:
|
|
327
|
-
/**
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
severity:
|
|
331
|
-
/**
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
userId:
|
|
335
|
-
/**
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
userRealm:
|
|
339
|
-
/**
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
userEmail:
|
|
343
|
-
/**
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
resourceType:
|
|
347
|
-
/**
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
resourceId:
|
|
351
|
-
/**
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
description:
|
|
355
|
-
/**
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
metadata:
|
|
359
|
-
/**
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
ipAddress:
|
|
363
|
-
/**
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
userAgent:
|
|
367
|
-
/**
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
sessionId:
|
|
371
|
-
/**
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
requestId:
|
|
375
|
-
/**
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
success:
|
|
379
|
-
/**
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
errorMessage:
|
|
315
|
+
declare const auditEntitySchema: alepha349.TObject<{
|
|
316
|
+
id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha349.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
|
|
317
|
+
createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha349.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
318
|
+
/**
|
|
319
|
+
* Audit event type (e.g., "auth", "user", "payment", "system").
|
|
320
|
+
* Used for categorizing and filtering audit events.
|
|
321
|
+
*/
|
|
322
|
+
type: alepha349.TString;
|
|
323
|
+
/**
|
|
324
|
+
* Specific action performed (e.g., "login", "logout", "create", "update", "delete").
|
|
325
|
+
*/
|
|
326
|
+
action: alepha349.TString;
|
|
327
|
+
/**
|
|
328
|
+
* Severity level of the event.
|
|
329
|
+
*/
|
|
330
|
+
severity: alepha_orm0.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm0.PG_DEFAULT>;
|
|
331
|
+
/**
|
|
332
|
+
* User ID who performed the action (null for system events).
|
|
333
|
+
*/
|
|
334
|
+
userId: alepha349.TOptional<alepha349.TString>;
|
|
335
|
+
/**
|
|
336
|
+
* User realm for multi-tenant support.
|
|
337
|
+
*/
|
|
338
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
339
|
+
/**
|
|
340
|
+
* User email at the time of the event (denormalized for history).
|
|
341
|
+
*/
|
|
342
|
+
userEmail: alepha349.TOptional<alepha349.TString>;
|
|
343
|
+
/**
|
|
344
|
+
* Resource type affected (e.g., "user", "order", "file").
|
|
345
|
+
*/
|
|
346
|
+
resourceType: alepha349.TOptional<alepha349.TString>;
|
|
347
|
+
/**
|
|
348
|
+
* Resource ID affected.
|
|
349
|
+
*/
|
|
350
|
+
resourceId: alepha349.TOptional<alepha349.TString>;
|
|
351
|
+
/**
|
|
352
|
+
* Human-readable description of the event.
|
|
353
|
+
*/
|
|
354
|
+
description: alepha349.TOptional<alepha349.TString>;
|
|
355
|
+
/**
|
|
356
|
+
* Additional metadata/context as JSON.
|
|
357
|
+
*/
|
|
358
|
+
metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
|
|
359
|
+
/**
|
|
360
|
+
* Client IP address.
|
|
361
|
+
*/
|
|
362
|
+
ipAddress: alepha349.TOptional<alepha349.TString>;
|
|
363
|
+
/**
|
|
364
|
+
* Client user agent.
|
|
365
|
+
*/
|
|
366
|
+
userAgent: alepha349.TOptional<alepha349.TString>;
|
|
367
|
+
/**
|
|
368
|
+
* Session ID if applicable.
|
|
369
|
+
*/
|
|
370
|
+
sessionId: alepha349.TOptional<alepha349.TString>;
|
|
371
|
+
/**
|
|
372
|
+
* Request ID for correlation.
|
|
373
|
+
*/
|
|
374
|
+
requestId: alepha349.TOptional<alepha349.TString>;
|
|
375
|
+
/**
|
|
376
|
+
* Whether the action was successful.
|
|
377
|
+
*/
|
|
378
|
+
success: alepha_orm0.PgAttr<alepha349.TBoolean, typeof alepha_orm0.PG_DEFAULT>;
|
|
379
|
+
/**
|
|
380
|
+
* Error message if the action failed.
|
|
381
|
+
*/
|
|
382
|
+
errorMessage: alepha349.TOptional<alepha349.TString>;
|
|
383
383
|
}>;
|
|
384
|
-
declare const auditEntityInsertSchema:
|
|
385
|
-
id:
|
|
386
|
-
createdAt:
|
|
387
|
-
/**
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
type:
|
|
392
|
-
/**
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
action:
|
|
396
|
-
/**
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
severity:
|
|
400
|
-
/**
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
userId:
|
|
404
|
-
/**
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
userRealm:
|
|
408
|
-
/**
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
userEmail:
|
|
412
|
-
/**
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
resourceType:
|
|
416
|
-
/**
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
resourceId:
|
|
420
|
-
/**
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
description:
|
|
424
|
-
/**
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
metadata:
|
|
428
|
-
/**
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
ipAddress:
|
|
432
|
-
/**
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
userAgent:
|
|
436
|
-
/**
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
sessionId:
|
|
440
|
-
/**
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
requestId:
|
|
444
|
-
/**
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
success:
|
|
448
|
-
/**
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
errorMessage:
|
|
384
|
+
declare const auditEntityInsertSchema: alepha_orm0.TObjectInsert<alepha349.TObject<{
|
|
385
|
+
id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha349.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
|
|
386
|
+
createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha349.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
387
|
+
/**
|
|
388
|
+
* Audit event type (e.g., "auth", "user", "payment", "system").
|
|
389
|
+
* Used for categorizing and filtering audit events.
|
|
390
|
+
*/
|
|
391
|
+
type: alepha349.TString;
|
|
392
|
+
/**
|
|
393
|
+
* Specific action performed (e.g., "login", "logout", "create", "update", "delete").
|
|
394
|
+
*/
|
|
395
|
+
action: alepha349.TString;
|
|
396
|
+
/**
|
|
397
|
+
* Severity level of the event.
|
|
398
|
+
*/
|
|
399
|
+
severity: alepha_orm0.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm0.PG_DEFAULT>;
|
|
400
|
+
/**
|
|
401
|
+
* User ID who performed the action (null for system events).
|
|
402
|
+
*/
|
|
403
|
+
userId: alepha349.TOptional<alepha349.TString>;
|
|
404
|
+
/**
|
|
405
|
+
* User realm for multi-tenant support.
|
|
406
|
+
*/
|
|
407
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
408
|
+
/**
|
|
409
|
+
* User email at the time of the event (denormalized for history).
|
|
410
|
+
*/
|
|
411
|
+
userEmail: alepha349.TOptional<alepha349.TString>;
|
|
412
|
+
/**
|
|
413
|
+
* Resource type affected (e.g., "user", "order", "file").
|
|
414
|
+
*/
|
|
415
|
+
resourceType: alepha349.TOptional<alepha349.TString>;
|
|
416
|
+
/**
|
|
417
|
+
* Resource ID affected.
|
|
418
|
+
*/
|
|
419
|
+
resourceId: alepha349.TOptional<alepha349.TString>;
|
|
420
|
+
/**
|
|
421
|
+
* Human-readable description of the event.
|
|
422
|
+
*/
|
|
423
|
+
description: alepha349.TOptional<alepha349.TString>;
|
|
424
|
+
/**
|
|
425
|
+
* Additional metadata/context as JSON.
|
|
426
|
+
*/
|
|
427
|
+
metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
|
|
428
|
+
/**
|
|
429
|
+
* Client IP address.
|
|
430
|
+
*/
|
|
431
|
+
ipAddress: alepha349.TOptional<alepha349.TString>;
|
|
432
|
+
/**
|
|
433
|
+
* Client user agent.
|
|
434
|
+
*/
|
|
435
|
+
userAgent: alepha349.TOptional<alepha349.TString>;
|
|
436
|
+
/**
|
|
437
|
+
* Session ID if applicable.
|
|
438
|
+
*/
|
|
439
|
+
sessionId: alepha349.TOptional<alepha349.TString>;
|
|
440
|
+
/**
|
|
441
|
+
* Request ID for correlation.
|
|
442
|
+
*/
|
|
443
|
+
requestId: alepha349.TOptional<alepha349.TString>;
|
|
444
|
+
/**
|
|
445
|
+
* Whether the action was successful.
|
|
446
|
+
*/
|
|
447
|
+
success: alepha_orm0.PgAttr<alepha349.TBoolean, typeof alepha_orm0.PG_DEFAULT>;
|
|
448
|
+
/**
|
|
449
|
+
* Error message if the action failed.
|
|
450
|
+
*/
|
|
451
|
+
errorMessage: alepha349.TOptional<alepha349.TString>;
|
|
452
452
|
}>>;
|
|
453
453
|
type AuditEntity = Static<typeof audits.schema>;
|
|
454
454
|
//#endregion
|
|
@@ -456,21 +456,21 @@ type AuditEntity = Static<typeof audits.schema>;
|
|
|
456
456
|
/**
|
|
457
457
|
* Query schema for searching and filtering audit logs.
|
|
458
458
|
*/
|
|
459
|
-
declare const auditQuerySchema:
|
|
460
|
-
page:
|
|
461
|
-
size:
|
|
462
|
-
sort:
|
|
463
|
-
type:
|
|
464
|
-
action:
|
|
465
|
-
severity:
|
|
466
|
-
userId:
|
|
467
|
-
userRealm:
|
|
468
|
-
resourceType:
|
|
469
|
-
resourceId:
|
|
470
|
-
success:
|
|
471
|
-
from:
|
|
472
|
-
to:
|
|
473
|
-
search:
|
|
459
|
+
declare const auditQuerySchema: alepha349.TObject<{
|
|
460
|
+
page: alepha349.TOptional<alepha349.TInteger>;
|
|
461
|
+
size: alepha349.TOptional<alepha349.TInteger>;
|
|
462
|
+
sort: alepha349.TOptional<alepha349.TString>;
|
|
463
|
+
type: alepha349.TOptional<alepha349.TString>;
|
|
464
|
+
action: alepha349.TOptional<alepha349.TString>;
|
|
465
|
+
severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
|
|
466
|
+
userId: alepha349.TOptional<alepha349.TString>;
|
|
467
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
468
|
+
resourceType: alepha349.TOptional<alepha349.TString>;
|
|
469
|
+
resourceId: alepha349.TOptional<alepha349.TString>;
|
|
470
|
+
success: alepha349.TOptional<alepha349.TBoolean>;
|
|
471
|
+
from: alepha349.TOptional<alepha349.TString>;
|
|
472
|
+
to: alepha349.TOptional<alepha349.TString>;
|
|
473
|
+
search: alepha349.TOptional<alepha349.TString>;
|
|
474
474
|
}>;
|
|
475
475
|
type AuditQuery = Static<typeof auditQuerySchema>;
|
|
476
476
|
//#endregion
|
|
@@ -478,23 +478,23 @@ type AuditQuery = Static<typeof auditQuerySchema>;
|
|
|
478
478
|
/**
|
|
479
479
|
* Schema for creating a new audit log entry.
|
|
480
480
|
*/
|
|
481
|
-
declare const createAuditSchema:
|
|
482
|
-
type:
|
|
483
|
-
action:
|
|
484
|
-
severity:
|
|
485
|
-
userId:
|
|
486
|
-
userRealm:
|
|
487
|
-
userEmail:
|
|
488
|
-
resourceType:
|
|
489
|
-
resourceId:
|
|
490
|
-
description:
|
|
491
|
-
metadata:
|
|
492
|
-
ipAddress:
|
|
493
|
-
userAgent:
|
|
494
|
-
sessionId:
|
|
495
|
-
requestId:
|
|
496
|
-
success:
|
|
497
|
-
errorMessage:
|
|
481
|
+
declare const createAuditSchema: alepha349.TObject<{
|
|
482
|
+
type: alepha349.TString;
|
|
483
|
+
action: alepha349.TString;
|
|
484
|
+
severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
|
|
485
|
+
userId: alepha349.TOptional<alepha349.TString>;
|
|
486
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
487
|
+
userEmail: alepha349.TOptional<alepha349.TString>;
|
|
488
|
+
resourceType: alepha349.TOptional<alepha349.TString>;
|
|
489
|
+
resourceId: alepha349.TOptional<alepha349.TString>;
|
|
490
|
+
description: alepha349.TOptional<alepha349.TString>;
|
|
491
|
+
metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
|
|
492
|
+
ipAddress: alepha349.TOptional<alepha349.TString>;
|
|
493
|
+
userAgent: alepha349.TOptional<alepha349.TString>;
|
|
494
|
+
sessionId: alepha349.TOptional<alepha349.TString>;
|
|
495
|
+
requestId: alepha349.TOptional<alepha349.TString>;
|
|
496
|
+
success: alepha349.TOptional<alepha349.TBoolean>;
|
|
497
|
+
errorMessage: alepha349.TOptional<alepha349.TString>;
|
|
498
498
|
}>;
|
|
499
499
|
type CreateAudit = Static<typeof createAuditSchema>;
|
|
500
500
|
//#endregion
|
|
@@ -519,98 +519,98 @@ interface AuditTypeDefinition {
|
|
|
519
519
|
declare class AuditService {
|
|
520
520
|
protected readonly alepha: Alepha;
|
|
521
521
|
protected readonly log: alepha_logger0.Logger;
|
|
522
|
-
protected readonly repo:
|
|
523
|
-
id:
|
|
524
|
-
createdAt:
|
|
525
|
-
type:
|
|
526
|
-
action:
|
|
527
|
-
severity:
|
|
528
|
-
userId:
|
|
529
|
-
userRealm:
|
|
530
|
-
userEmail:
|
|
531
|
-
resourceType:
|
|
532
|
-
resourceId:
|
|
533
|
-
description:
|
|
534
|
-
metadata:
|
|
535
|
-
ipAddress:
|
|
536
|
-
userAgent:
|
|
537
|
-
sessionId:
|
|
538
|
-
requestId:
|
|
539
|
-
success:
|
|
540
|
-
errorMessage:
|
|
522
|
+
protected readonly repo: alepha_orm0.Repository<alepha349.TObject<{
|
|
523
|
+
id: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha349.TString, typeof alepha_orm0.PG_PRIMARY_KEY>, typeof alepha_orm0.PG_DEFAULT>;
|
|
524
|
+
createdAt: alepha_orm0.PgAttr<alepha_orm0.PgAttr<alepha349.TString, typeof alepha_orm0.PG_CREATED_AT>, typeof alepha_orm0.PG_DEFAULT>;
|
|
525
|
+
type: alepha349.TString;
|
|
526
|
+
action: alepha349.TString;
|
|
527
|
+
severity: alepha_orm0.PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm0.PG_DEFAULT>;
|
|
528
|
+
userId: alepha349.TOptional<alepha349.TString>;
|
|
529
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
530
|
+
userEmail: alepha349.TOptional<alepha349.TString>;
|
|
531
|
+
resourceType: alepha349.TOptional<alepha349.TString>;
|
|
532
|
+
resourceId: alepha349.TOptional<alepha349.TString>;
|
|
533
|
+
description: alepha349.TOptional<alepha349.TString>;
|
|
534
|
+
metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
|
|
535
|
+
ipAddress: alepha349.TOptional<alepha349.TString>;
|
|
536
|
+
userAgent: alepha349.TOptional<alepha349.TString>;
|
|
537
|
+
sessionId: alepha349.TOptional<alepha349.TString>;
|
|
538
|
+
requestId: alepha349.TOptional<alepha349.TString>;
|
|
539
|
+
success: alepha_orm0.PgAttr<alepha349.TBoolean, typeof alepha_orm0.PG_DEFAULT>;
|
|
540
|
+
errorMessage: alepha349.TOptional<alepha349.TString>;
|
|
541
541
|
}>>;
|
|
542
542
|
/**
|
|
543
|
-
|
|
544
|
-
|
|
543
|
+
* Registry of audit types and their allowed actions.
|
|
544
|
+
*/
|
|
545
545
|
protected readonly auditTypes: Map<string, AuditTypeDefinition>;
|
|
546
546
|
/**
|
|
547
|
-
|
|
548
|
-
|
|
547
|
+
* Register an audit type with its allowed actions.
|
|
548
|
+
*/
|
|
549
549
|
registerType(definition: AuditTypeDefinition): void;
|
|
550
550
|
/**
|
|
551
|
-
|
|
552
|
-
|
|
551
|
+
* Get all registered audit types.
|
|
552
|
+
*/
|
|
553
553
|
getRegisteredTypes(): AuditTypeDefinition[];
|
|
554
554
|
/**
|
|
555
|
-
|
|
556
|
-
|
|
555
|
+
* Get current request context if available.
|
|
556
|
+
*/
|
|
557
557
|
protected getRequestContext(): ServerRequest | undefined;
|
|
558
558
|
/**
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
559
|
+
* Create a new audit log entry.
|
|
560
|
+
* Automatically populates ipAddress, userAgent, and requestId from the current request context.
|
|
561
|
+
*/
|
|
562
562
|
create(data: CreateAudit): Promise<AuditEntity>;
|
|
563
563
|
/**
|
|
564
|
-
|
|
565
|
-
|
|
564
|
+
* Record an audit event (convenience method).
|
|
565
|
+
*/
|
|
566
566
|
record(type: string, action: string, options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
|
|
567
567
|
/**
|
|
568
|
-
|
|
569
|
-
|
|
568
|
+
* Record an authentication event.
|
|
569
|
+
*/
|
|
570
570
|
recordAuth(action: "login" | "logout" | "login_failed" | "token_refresh" | "mfa_setup" | "mfa_verify", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
|
|
571
571
|
/**
|
|
572
|
-
|
|
573
|
-
|
|
572
|
+
* Record a user management event.
|
|
573
|
+
*/
|
|
574
574
|
recordUser(action: "create" | "update" | "delete" | "enable" | "disable" | "role_change", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
|
|
575
575
|
/**
|
|
576
|
-
|
|
577
|
-
|
|
576
|
+
* Record a data access event.
|
|
577
|
+
*/
|
|
578
578
|
recordAccess(action: "view" | "export" | "download", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
|
|
579
579
|
/**
|
|
580
|
-
|
|
581
|
-
|
|
580
|
+
* Record a security event.
|
|
581
|
+
*/
|
|
582
582
|
recordSecurity(action: "permission_denied" | "suspicious_activity" | "rate_limited" | "blocked", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
|
|
583
583
|
/**
|
|
584
|
-
|
|
585
|
-
|
|
584
|
+
* Record a system event.
|
|
585
|
+
*/
|
|
586
586
|
recordSystem(action: "startup" | "shutdown" | "config_change" | "maintenance" | "error", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
|
|
587
587
|
/**
|
|
588
|
-
|
|
589
|
-
|
|
588
|
+
* Find audit entries with filtering and pagination.
|
|
589
|
+
*/
|
|
590
590
|
find(query?: AuditQuery): Promise<Page<AuditEntity>>;
|
|
591
591
|
/**
|
|
592
|
-
|
|
593
|
-
|
|
592
|
+
* Get audit entry by ID.
|
|
593
|
+
*/
|
|
594
594
|
getById(id: string): Promise<AuditEntity>;
|
|
595
595
|
/**
|
|
596
|
-
|
|
597
|
-
|
|
596
|
+
* Get audit entries for a specific user.
|
|
597
|
+
*/
|
|
598
598
|
findByUser(userId: string, query?: Omit<AuditQuery, "userId">): Promise<Page<AuditEntity>>;
|
|
599
599
|
/**
|
|
600
|
-
|
|
601
|
-
|
|
600
|
+
* Get audit entries for a specific resource.
|
|
601
|
+
*/
|
|
602
602
|
findByResource(resourceType: string, resourceId: string, query?: Omit<AuditQuery, "resourceType" | "resourceId">): Promise<Page<AuditEntity>>;
|
|
603
603
|
/**
|
|
604
|
-
|
|
605
|
-
|
|
604
|
+
* Get audit statistics for a time period.
|
|
605
|
+
*/
|
|
606
606
|
getStats(options?: {
|
|
607
607
|
from?: Date;
|
|
608
608
|
to?: Date;
|
|
609
609
|
userRealm?: string;
|
|
610
610
|
}): Promise<AuditStats>;
|
|
611
611
|
/**
|
|
612
|
-
|
|
613
|
-
|
|
612
|
+
* Delete old audit entries (for retention policy).
|
|
613
|
+
*/
|
|
614
614
|
deleteOlderThan(date: Date): Promise<number>;
|
|
615
615
|
}
|
|
616
616
|
/**
|
|
@@ -639,262 +639,262 @@ declare class AdminAuditController {
|
|
|
639
639
|
protected readonly group = "admin:audits";
|
|
640
640
|
protected readonly auditService: AuditService;
|
|
641
641
|
/**
|
|
642
|
-
|
|
643
|
-
|
|
642
|
+
* Find audit entries with filtering and pagination.
|
|
643
|
+
*/
|
|
644
644
|
readonly findAudits: alepha_server0.ActionPrimitiveFn<{
|
|
645
|
-
query:
|
|
646
|
-
page:
|
|
647
|
-
size:
|
|
648
|
-
sort:
|
|
649
|
-
type:
|
|
650
|
-
action:
|
|
651
|
-
severity:
|
|
652
|
-
userId:
|
|
653
|
-
userRealm:
|
|
654
|
-
resourceType:
|
|
655
|
-
resourceId:
|
|
656
|
-
success:
|
|
657
|
-
from:
|
|
658
|
-
to:
|
|
659
|
-
search:
|
|
645
|
+
query: alepha349.TObject<{
|
|
646
|
+
page: alepha349.TOptional<alepha349.TInteger>;
|
|
647
|
+
size: alepha349.TOptional<alepha349.TInteger>;
|
|
648
|
+
sort: alepha349.TOptional<alepha349.TString>;
|
|
649
|
+
type: alepha349.TOptional<alepha349.TString>;
|
|
650
|
+
action: alepha349.TOptional<alepha349.TString>;
|
|
651
|
+
severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
|
|
652
|
+
userId: alepha349.TOptional<alepha349.TString>;
|
|
653
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
654
|
+
resourceType: alepha349.TOptional<alepha349.TString>;
|
|
655
|
+
resourceId: alepha349.TOptional<alepha349.TString>;
|
|
656
|
+
success: alepha349.TOptional<alepha349.TBoolean>;
|
|
657
|
+
from: alepha349.TOptional<alepha349.TString>;
|
|
658
|
+
to: alepha349.TOptional<alepha349.TString>;
|
|
659
|
+
search: alepha349.TOptional<alepha349.TString>;
|
|
660
660
|
}>;
|
|
661
|
-
response:
|
|
662
|
-
id: PgAttr<PgAttr<
|
|
663
|
-
createdAt: PgAttr<PgAttr<
|
|
664
|
-
type:
|
|
665
|
-
action:
|
|
666
|
-
severity: PgAttr<
|
|
667
|
-
userId:
|
|
668
|
-
userRealm:
|
|
669
|
-
userEmail:
|
|
670
|
-
resourceType:
|
|
671
|
-
resourceId:
|
|
672
|
-
description:
|
|
673
|
-
metadata:
|
|
674
|
-
ipAddress:
|
|
675
|
-
userAgent:
|
|
676
|
-
sessionId:
|
|
677
|
-
requestId:
|
|
678
|
-
success: PgAttr<
|
|
679
|
-
errorMessage:
|
|
661
|
+
response: alepha349.TPage<alepha349.TObject<{
|
|
662
|
+
id: PgAttr<PgAttr<alepha349.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
663
|
+
createdAt: PgAttr<PgAttr<alepha349.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
664
|
+
type: alepha349.TString;
|
|
665
|
+
action: alepha349.TString;
|
|
666
|
+
severity: PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
667
|
+
userId: alepha349.TOptional<alepha349.TString>;
|
|
668
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
669
|
+
userEmail: alepha349.TOptional<alepha349.TString>;
|
|
670
|
+
resourceType: alepha349.TOptional<alepha349.TString>;
|
|
671
|
+
resourceId: alepha349.TOptional<alepha349.TString>;
|
|
672
|
+
description: alepha349.TOptional<alepha349.TString>;
|
|
673
|
+
metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
|
|
674
|
+
ipAddress: alepha349.TOptional<alepha349.TString>;
|
|
675
|
+
userAgent: alepha349.TOptional<alepha349.TString>;
|
|
676
|
+
sessionId: alepha349.TOptional<alepha349.TString>;
|
|
677
|
+
requestId: alepha349.TOptional<alepha349.TString>;
|
|
678
|
+
success: PgAttr<alepha349.TBoolean, typeof PG_DEFAULT>;
|
|
679
|
+
errorMessage: alepha349.TOptional<alepha349.TString>;
|
|
680
680
|
}>>;
|
|
681
681
|
}>;
|
|
682
682
|
/**
|
|
683
|
-
|
|
684
|
-
|
|
683
|
+
* Get a single audit entry by ID.
|
|
684
|
+
*/
|
|
685
685
|
readonly getAudit: alepha_server0.ActionPrimitiveFn<{
|
|
686
|
-
params:
|
|
687
|
-
id:
|
|
686
|
+
params: alepha349.TObject<{
|
|
687
|
+
id: alepha349.TString;
|
|
688
688
|
}>;
|
|
689
|
-
response:
|
|
690
|
-
id: PgAttr<PgAttr<
|
|
691
|
-
createdAt: PgAttr<PgAttr<
|
|
692
|
-
type:
|
|
693
|
-
action:
|
|
694
|
-
severity: PgAttr<
|
|
695
|
-
userId:
|
|
696
|
-
userRealm:
|
|
697
|
-
userEmail:
|
|
698
|
-
resourceType:
|
|
699
|
-
resourceId:
|
|
700
|
-
description:
|
|
701
|
-
metadata:
|
|
702
|
-
ipAddress:
|
|
703
|
-
userAgent:
|
|
704
|
-
sessionId:
|
|
705
|
-
requestId:
|
|
706
|
-
success: PgAttr<
|
|
707
|
-
errorMessage:
|
|
689
|
+
response: alepha349.TObject<{
|
|
690
|
+
id: PgAttr<PgAttr<alepha349.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
691
|
+
createdAt: PgAttr<PgAttr<alepha349.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
692
|
+
type: alepha349.TString;
|
|
693
|
+
action: alepha349.TString;
|
|
694
|
+
severity: PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
695
|
+
userId: alepha349.TOptional<alepha349.TString>;
|
|
696
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
697
|
+
userEmail: alepha349.TOptional<alepha349.TString>;
|
|
698
|
+
resourceType: alepha349.TOptional<alepha349.TString>;
|
|
699
|
+
resourceId: alepha349.TOptional<alepha349.TString>;
|
|
700
|
+
description: alepha349.TOptional<alepha349.TString>;
|
|
701
|
+
metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
|
|
702
|
+
ipAddress: alepha349.TOptional<alepha349.TString>;
|
|
703
|
+
userAgent: alepha349.TOptional<alepha349.TString>;
|
|
704
|
+
sessionId: alepha349.TOptional<alepha349.TString>;
|
|
705
|
+
requestId: alepha349.TOptional<alepha349.TString>;
|
|
706
|
+
success: PgAttr<alepha349.TBoolean, typeof PG_DEFAULT>;
|
|
707
|
+
errorMessage: alepha349.TOptional<alepha349.TString>;
|
|
708
708
|
}>;
|
|
709
709
|
}>;
|
|
710
710
|
/**
|
|
711
|
-
|
|
712
|
-
|
|
711
|
+
* Create a new audit entry.
|
|
712
|
+
*/
|
|
713
713
|
readonly createAudit: alepha_server0.ActionPrimitiveFn<{
|
|
714
|
-
body:
|
|
715
|
-
type:
|
|
716
|
-
action:
|
|
717
|
-
severity:
|
|
718
|
-
userId:
|
|
719
|
-
userRealm:
|
|
720
|
-
userEmail:
|
|
721
|
-
resourceType:
|
|
722
|
-
resourceId:
|
|
723
|
-
description:
|
|
724
|
-
metadata:
|
|
725
|
-
ipAddress:
|
|
726
|
-
userAgent:
|
|
727
|
-
sessionId:
|
|
728
|
-
requestId:
|
|
729
|
-
success:
|
|
730
|
-
errorMessage:
|
|
714
|
+
body: alepha349.TObject<{
|
|
715
|
+
type: alepha349.TString;
|
|
716
|
+
action: alepha349.TString;
|
|
717
|
+
severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
|
|
718
|
+
userId: alepha349.TOptional<alepha349.TString>;
|
|
719
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
720
|
+
userEmail: alepha349.TOptional<alepha349.TString>;
|
|
721
|
+
resourceType: alepha349.TOptional<alepha349.TString>;
|
|
722
|
+
resourceId: alepha349.TOptional<alepha349.TString>;
|
|
723
|
+
description: alepha349.TOptional<alepha349.TString>;
|
|
724
|
+
metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
|
|
725
|
+
ipAddress: alepha349.TOptional<alepha349.TString>;
|
|
726
|
+
userAgent: alepha349.TOptional<alepha349.TString>;
|
|
727
|
+
sessionId: alepha349.TOptional<alepha349.TString>;
|
|
728
|
+
requestId: alepha349.TOptional<alepha349.TString>;
|
|
729
|
+
success: alepha349.TOptional<alepha349.TBoolean>;
|
|
730
|
+
errorMessage: alepha349.TOptional<alepha349.TString>;
|
|
731
731
|
}>;
|
|
732
|
-
response:
|
|
733
|
-
id: PgAttr<PgAttr<
|
|
734
|
-
createdAt: PgAttr<PgAttr<
|
|
735
|
-
type:
|
|
736
|
-
action:
|
|
737
|
-
severity: PgAttr<
|
|
738
|
-
userId:
|
|
739
|
-
userRealm:
|
|
740
|
-
userEmail:
|
|
741
|
-
resourceType:
|
|
742
|
-
resourceId:
|
|
743
|
-
description:
|
|
744
|
-
metadata:
|
|
745
|
-
ipAddress:
|
|
746
|
-
userAgent:
|
|
747
|
-
sessionId:
|
|
748
|
-
requestId:
|
|
749
|
-
success: PgAttr<
|
|
750
|
-
errorMessage:
|
|
732
|
+
response: alepha349.TObject<{
|
|
733
|
+
id: PgAttr<PgAttr<alepha349.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
734
|
+
createdAt: PgAttr<PgAttr<alepha349.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
735
|
+
type: alepha349.TString;
|
|
736
|
+
action: alepha349.TString;
|
|
737
|
+
severity: PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
738
|
+
userId: alepha349.TOptional<alepha349.TString>;
|
|
739
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
740
|
+
userEmail: alepha349.TOptional<alepha349.TString>;
|
|
741
|
+
resourceType: alepha349.TOptional<alepha349.TString>;
|
|
742
|
+
resourceId: alepha349.TOptional<alepha349.TString>;
|
|
743
|
+
description: alepha349.TOptional<alepha349.TString>;
|
|
744
|
+
metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
|
|
745
|
+
ipAddress: alepha349.TOptional<alepha349.TString>;
|
|
746
|
+
userAgent: alepha349.TOptional<alepha349.TString>;
|
|
747
|
+
sessionId: alepha349.TOptional<alepha349.TString>;
|
|
748
|
+
requestId: alepha349.TOptional<alepha349.TString>;
|
|
749
|
+
success: PgAttr<alepha349.TBoolean, typeof PG_DEFAULT>;
|
|
750
|
+
errorMessage: alepha349.TOptional<alepha349.TString>;
|
|
751
751
|
}>;
|
|
752
752
|
}>;
|
|
753
753
|
/**
|
|
754
|
-
|
|
755
|
-
|
|
754
|
+
* Get audit entries for a specific user.
|
|
755
|
+
*/
|
|
756
756
|
readonly findByUser: alepha_server0.ActionPrimitiveFn<{
|
|
757
|
-
params:
|
|
758
|
-
userId:
|
|
757
|
+
params: alepha349.TObject<{
|
|
758
|
+
userId: alepha349.TString;
|
|
759
759
|
}>;
|
|
760
|
-
query:
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
760
|
+
query: alepha349.TObject<{
|
|
761
|
+
page: alepha349.TOptional<alepha349.TInteger>;
|
|
762
|
+
type: alepha349.TOptional<alepha349.TString>;
|
|
763
|
+
size: alepha349.TOptional<alepha349.TInteger>;
|
|
764
|
+
sort: alepha349.TOptional<alepha349.TString>;
|
|
765
|
+
action: alepha349.TOptional<alepha349.TString>;
|
|
766
|
+
severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
|
|
767
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
768
|
+
resourceType: alepha349.TOptional<alepha349.TString>;
|
|
769
|
+
resourceId: alepha349.TOptional<alepha349.TString>;
|
|
770
|
+
success: alepha349.TOptional<alepha349.TBoolean>;
|
|
771
|
+
from: alepha349.TOptional<alepha349.TString>;
|
|
772
|
+
to: alepha349.TOptional<alepha349.TString>;
|
|
773
|
+
search: alepha349.TOptional<alepha349.TString>;
|
|
774
774
|
}>;
|
|
775
|
-
response:
|
|
776
|
-
id: PgAttr<PgAttr<
|
|
777
|
-
createdAt: PgAttr<PgAttr<
|
|
778
|
-
type:
|
|
779
|
-
action:
|
|
780
|
-
severity: PgAttr<
|
|
781
|
-
userId:
|
|
782
|
-
userRealm:
|
|
783
|
-
userEmail:
|
|
784
|
-
resourceType:
|
|
785
|
-
resourceId:
|
|
786
|
-
description:
|
|
787
|
-
metadata:
|
|
788
|
-
ipAddress:
|
|
789
|
-
userAgent:
|
|
790
|
-
sessionId:
|
|
791
|
-
requestId:
|
|
792
|
-
success: PgAttr<
|
|
793
|
-
errorMessage:
|
|
775
|
+
response: alepha349.TPage<alepha349.TObject<{
|
|
776
|
+
id: PgAttr<PgAttr<alepha349.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
777
|
+
createdAt: PgAttr<PgAttr<alepha349.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
778
|
+
type: alepha349.TString;
|
|
779
|
+
action: alepha349.TString;
|
|
780
|
+
severity: PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
781
|
+
userId: alepha349.TOptional<alepha349.TString>;
|
|
782
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
783
|
+
userEmail: alepha349.TOptional<alepha349.TString>;
|
|
784
|
+
resourceType: alepha349.TOptional<alepha349.TString>;
|
|
785
|
+
resourceId: alepha349.TOptional<alepha349.TString>;
|
|
786
|
+
description: alepha349.TOptional<alepha349.TString>;
|
|
787
|
+
metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
|
|
788
|
+
ipAddress: alepha349.TOptional<alepha349.TString>;
|
|
789
|
+
userAgent: alepha349.TOptional<alepha349.TString>;
|
|
790
|
+
sessionId: alepha349.TOptional<alepha349.TString>;
|
|
791
|
+
requestId: alepha349.TOptional<alepha349.TString>;
|
|
792
|
+
success: PgAttr<alepha349.TBoolean, typeof PG_DEFAULT>;
|
|
793
|
+
errorMessage: alepha349.TOptional<alepha349.TString>;
|
|
794
794
|
}>>;
|
|
795
795
|
}>;
|
|
796
796
|
/**
|
|
797
|
-
|
|
798
|
-
|
|
797
|
+
* Get audit entries for a specific resource.
|
|
798
|
+
*/
|
|
799
799
|
readonly findByResource: alepha_server0.ActionPrimitiveFn<{
|
|
800
|
-
params:
|
|
801
|
-
resourceType:
|
|
802
|
-
resourceId:
|
|
800
|
+
params: alepha349.TObject<{
|
|
801
|
+
resourceType: alepha349.TString;
|
|
802
|
+
resourceId: alepha349.TString;
|
|
803
803
|
}>;
|
|
804
|
-
query:
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
804
|
+
query: alepha349.TObject<{
|
|
805
|
+
page: alepha349.TOptional<alepha349.TInteger>;
|
|
806
|
+
type: alepha349.TOptional<alepha349.TString>;
|
|
807
|
+
size: alepha349.TOptional<alepha349.TInteger>;
|
|
808
|
+
sort: alepha349.TOptional<alepha349.TString>;
|
|
809
|
+
action: alepha349.TOptional<alepha349.TString>;
|
|
810
|
+
severity: alepha349.TOptional<alepha349.TUnsafe<"info" | "warning" | "critical">>;
|
|
811
|
+
userId: alepha349.TOptional<alepha349.TString>;
|
|
812
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
813
|
+
success: alepha349.TOptional<alepha349.TBoolean>;
|
|
814
|
+
from: alepha349.TOptional<alepha349.TString>;
|
|
815
|
+
to: alepha349.TOptional<alepha349.TString>;
|
|
816
|
+
search: alepha349.TOptional<alepha349.TString>;
|
|
817
817
|
}>;
|
|
818
|
-
response:
|
|
819
|
-
id: PgAttr<PgAttr<
|
|
820
|
-
createdAt: PgAttr<PgAttr<
|
|
821
|
-
type:
|
|
822
|
-
action:
|
|
823
|
-
severity: PgAttr<
|
|
824
|
-
userId:
|
|
825
|
-
userRealm:
|
|
826
|
-
userEmail:
|
|
827
|
-
resourceType:
|
|
828
|
-
resourceId:
|
|
829
|
-
description:
|
|
830
|
-
metadata:
|
|
831
|
-
ipAddress:
|
|
832
|
-
userAgent:
|
|
833
|
-
sessionId:
|
|
834
|
-
requestId:
|
|
835
|
-
success: PgAttr<
|
|
836
|
-
errorMessage:
|
|
818
|
+
response: alepha349.TPage<alepha349.TObject<{
|
|
819
|
+
id: PgAttr<PgAttr<alepha349.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
820
|
+
createdAt: PgAttr<PgAttr<alepha349.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
821
|
+
type: alepha349.TString;
|
|
822
|
+
action: alepha349.TString;
|
|
823
|
+
severity: PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
824
|
+
userId: alepha349.TOptional<alepha349.TString>;
|
|
825
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
826
|
+
userEmail: alepha349.TOptional<alepha349.TString>;
|
|
827
|
+
resourceType: alepha349.TOptional<alepha349.TString>;
|
|
828
|
+
resourceId: alepha349.TOptional<alepha349.TString>;
|
|
829
|
+
description: alepha349.TOptional<alepha349.TString>;
|
|
830
|
+
metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
|
|
831
|
+
ipAddress: alepha349.TOptional<alepha349.TString>;
|
|
832
|
+
userAgent: alepha349.TOptional<alepha349.TString>;
|
|
833
|
+
sessionId: alepha349.TOptional<alepha349.TString>;
|
|
834
|
+
requestId: alepha349.TOptional<alepha349.TString>;
|
|
835
|
+
success: PgAttr<alepha349.TBoolean, typeof PG_DEFAULT>;
|
|
836
|
+
errorMessage: alepha349.TOptional<alepha349.TString>;
|
|
837
837
|
}>>;
|
|
838
838
|
}>;
|
|
839
839
|
/**
|
|
840
|
-
|
|
841
|
-
|
|
840
|
+
* Get audit statistics.
|
|
841
|
+
*/
|
|
842
842
|
readonly getStats: alepha_server0.ActionPrimitiveFn<{
|
|
843
|
-
query:
|
|
844
|
-
from:
|
|
845
|
-
to:
|
|
846
|
-
userRealm:
|
|
843
|
+
query: alepha349.TObject<{
|
|
844
|
+
from: alepha349.TOptional<alepha349.TString>;
|
|
845
|
+
to: alepha349.TOptional<alepha349.TString>;
|
|
846
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
847
847
|
}>;
|
|
848
|
-
response:
|
|
849
|
-
total:
|
|
850
|
-
byType:
|
|
851
|
-
bySeverity:
|
|
852
|
-
info:
|
|
853
|
-
warning:
|
|
854
|
-
critical:
|
|
848
|
+
response: alepha349.TObject<{
|
|
849
|
+
total: alepha349.TInteger;
|
|
850
|
+
byType: alepha349.TRecord<"^.*$", alepha349.TInteger>;
|
|
851
|
+
bySeverity: alepha349.TObject<{
|
|
852
|
+
info: alepha349.TInteger;
|
|
853
|
+
warning: alepha349.TInteger;
|
|
854
|
+
critical: alepha349.TInteger;
|
|
855
855
|
}>;
|
|
856
|
-
successRate:
|
|
857
|
-
recentFailures:
|
|
858
|
-
id: PgAttr<PgAttr<
|
|
859
|
-
createdAt: PgAttr<PgAttr<
|
|
860
|
-
type:
|
|
861
|
-
action:
|
|
862
|
-
severity: PgAttr<
|
|
863
|
-
userId:
|
|
864
|
-
userRealm:
|
|
865
|
-
userEmail:
|
|
866
|
-
resourceType:
|
|
867
|
-
resourceId:
|
|
868
|
-
description:
|
|
869
|
-
metadata:
|
|
870
|
-
ipAddress:
|
|
871
|
-
userAgent:
|
|
872
|
-
sessionId:
|
|
873
|
-
requestId:
|
|
874
|
-
success: PgAttr<
|
|
875
|
-
errorMessage:
|
|
856
|
+
successRate: alepha349.TNumber;
|
|
857
|
+
recentFailures: alepha349.TArray<alepha349.TObject<{
|
|
858
|
+
id: PgAttr<PgAttr<alepha349.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
859
|
+
createdAt: PgAttr<PgAttr<alepha349.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
860
|
+
type: alepha349.TString;
|
|
861
|
+
action: alepha349.TString;
|
|
862
|
+
severity: PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
863
|
+
userId: alepha349.TOptional<alepha349.TString>;
|
|
864
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
865
|
+
userEmail: alepha349.TOptional<alepha349.TString>;
|
|
866
|
+
resourceType: alepha349.TOptional<alepha349.TString>;
|
|
867
|
+
resourceId: alepha349.TOptional<alepha349.TString>;
|
|
868
|
+
description: alepha349.TOptional<alepha349.TString>;
|
|
869
|
+
metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
|
|
870
|
+
ipAddress: alepha349.TOptional<alepha349.TString>;
|
|
871
|
+
userAgent: alepha349.TOptional<alepha349.TString>;
|
|
872
|
+
sessionId: alepha349.TOptional<alepha349.TString>;
|
|
873
|
+
requestId: alepha349.TOptional<alepha349.TString>;
|
|
874
|
+
success: PgAttr<alepha349.TBoolean, typeof PG_DEFAULT>;
|
|
875
|
+
errorMessage: alepha349.TOptional<alepha349.TString>;
|
|
876
876
|
}>>;
|
|
877
877
|
}>;
|
|
878
878
|
}>;
|
|
879
879
|
/**
|
|
880
|
-
|
|
881
|
-
|
|
880
|
+
* Get registered audit types.
|
|
881
|
+
*/
|
|
882
882
|
readonly getTypes: alepha_server0.ActionPrimitiveFn<{
|
|
883
|
-
response:
|
|
884
|
-
type:
|
|
885
|
-
description:
|
|
886
|
-
actions:
|
|
883
|
+
response: alepha349.TArray<alepha349.TObject<{
|
|
884
|
+
type: alepha349.TString;
|
|
885
|
+
description: alepha349.TOptional<alepha349.TString>;
|
|
886
|
+
actions: alepha349.TArray<alepha349.TString>;
|
|
887
887
|
}>>;
|
|
888
888
|
}>;
|
|
889
889
|
/**
|
|
890
|
-
|
|
891
|
-
|
|
890
|
+
* Get distinct values for filters.
|
|
891
|
+
*/
|
|
892
892
|
readonly getFilterOptions: alepha_server0.ActionPrimitiveFn<{
|
|
893
|
-
response:
|
|
894
|
-
types:
|
|
895
|
-
actions:
|
|
896
|
-
resourceTypes:
|
|
897
|
-
userRealms:
|
|
893
|
+
response: alepha349.TObject<{
|
|
894
|
+
types: alepha349.TArray<alepha349.TString>;
|
|
895
|
+
actions: alepha349.TArray<alepha349.TString>;
|
|
896
|
+
resourceTypes: alepha349.TArray<alepha349.TString>;
|
|
897
|
+
userRealms: alepha349.TArray<alepha349.TString>;
|
|
898
898
|
}>;
|
|
899
899
|
}>;
|
|
900
900
|
}
|
|
@@ -905,16 +905,16 @@ declare class AdminAuditController {
|
|
|
905
905
|
*/
|
|
906
906
|
interface AuditPrimitiveOptions {
|
|
907
907
|
/**
|
|
908
|
-
|
|
909
|
-
|
|
908
|
+
* Unique audit type identifier (e.g., "auth", "payment", "order").
|
|
909
|
+
*/
|
|
910
910
|
type: string;
|
|
911
911
|
/**
|
|
912
|
-
|
|
913
|
-
|
|
912
|
+
* Human-readable description of this audit type.
|
|
913
|
+
*/
|
|
914
914
|
description?: string;
|
|
915
915
|
/**
|
|
916
|
-
|
|
917
|
-
|
|
916
|
+
* List of allowed actions for this audit type.
|
|
917
|
+
*/
|
|
918
918
|
actions: string[];
|
|
919
919
|
}
|
|
920
920
|
/**
|
|
@@ -946,32 +946,32 @@ interface AuditPrimitiveOptions {
|
|
|
946
946
|
declare class AuditPrimitive extends Primitive<AuditPrimitiveOptions> {
|
|
947
947
|
protected readonly auditService: AuditService;
|
|
948
948
|
/**
|
|
949
|
-
|
|
950
|
-
|
|
949
|
+
* The audit type identifier.
|
|
950
|
+
*/
|
|
951
951
|
get type(): string;
|
|
952
952
|
/**
|
|
953
|
-
|
|
954
|
-
|
|
953
|
+
* The audit type description.
|
|
954
|
+
*/
|
|
955
955
|
get description(): string | undefined;
|
|
956
956
|
/**
|
|
957
|
-
|
|
958
|
-
|
|
957
|
+
* The allowed actions for this audit type.
|
|
958
|
+
*/
|
|
959
959
|
get actions(): string[];
|
|
960
960
|
/**
|
|
961
|
-
|
|
962
|
-
|
|
961
|
+
* Log an audit event for this type.
|
|
962
|
+
*/
|
|
963
963
|
log(action: string, options?: AuditLogOptions): Promise<void>;
|
|
964
964
|
/**
|
|
965
|
-
|
|
966
|
-
|
|
965
|
+
* Log a successful audit event.
|
|
966
|
+
*/
|
|
967
967
|
logSuccess(action: string, options?: Omit<AuditLogOptions, "success">): Promise<void>;
|
|
968
968
|
/**
|
|
969
|
-
|
|
970
|
-
|
|
969
|
+
* Log a failed audit event.
|
|
970
|
+
*/
|
|
971
971
|
logFailure(action: string, errorMessage: string, options?: Omit<AuditLogOptions, "success" | "errorMessage">): Promise<void>;
|
|
972
972
|
/**
|
|
973
|
-
|
|
974
|
-
|
|
973
|
+
* Called during initialization to register this audit type.
|
|
974
|
+
*/
|
|
975
975
|
protected onInit(): void;
|
|
976
976
|
}
|
|
977
977
|
/**
|
|
@@ -1016,68 +1016,45 @@ declare const $audit: {
|
|
|
1016
1016
|
/**
|
|
1017
1017
|
* Resource schema for audit log responses.
|
|
1018
1018
|
*/
|
|
1019
|
-
declare const auditResourceSchema:
|
|
1020
|
-
id: PgAttr<PgAttr<
|
|
1021
|
-
createdAt: PgAttr<PgAttr<
|
|
1022
|
-
type:
|
|
1023
|
-
action:
|
|
1024
|
-
severity: PgAttr<
|
|
1025
|
-
userId:
|
|
1026
|
-
userRealm:
|
|
1027
|
-
userEmail:
|
|
1028
|
-
resourceType:
|
|
1029
|
-
resourceId:
|
|
1030
|
-
description:
|
|
1031
|
-
metadata:
|
|
1032
|
-
ipAddress:
|
|
1033
|
-
userAgent:
|
|
1034
|
-
sessionId:
|
|
1035
|
-
requestId:
|
|
1036
|
-
success: PgAttr<
|
|
1037
|
-
errorMessage:
|
|
1019
|
+
declare const auditResourceSchema: alepha349.TObject<{
|
|
1020
|
+
id: PgAttr<PgAttr<alepha349.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1021
|
+
createdAt: PgAttr<PgAttr<alepha349.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1022
|
+
type: alepha349.TString;
|
|
1023
|
+
action: alepha349.TString;
|
|
1024
|
+
severity: PgAttr<alepha349.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
1025
|
+
userId: alepha349.TOptional<alepha349.TString>;
|
|
1026
|
+
userRealm: alepha349.TOptional<alepha349.TString>;
|
|
1027
|
+
userEmail: alepha349.TOptional<alepha349.TString>;
|
|
1028
|
+
resourceType: alepha349.TOptional<alepha349.TString>;
|
|
1029
|
+
resourceId: alepha349.TOptional<alepha349.TString>;
|
|
1030
|
+
description: alepha349.TOptional<alepha349.TString>;
|
|
1031
|
+
metadata: alepha349.TOptional<alepha349.TRecord<string, alepha349.TAny>>;
|
|
1032
|
+
ipAddress: alepha349.TOptional<alepha349.TString>;
|
|
1033
|
+
userAgent: alepha349.TOptional<alepha349.TString>;
|
|
1034
|
+
sessionId: alepha349.TOptional<alepha349.TString>;
|
|
1035
|
+
requestId: alepha349.TOptional<alepha349.TString>;
|
|
1036
|
+
success: PgAttr<alepha349.TBoolean, typeof PG_DEFAULT>;
|
|
1037
|
+
errorMessage: alepha349.TOptional<alepha349.TString>;
|
|
1038
1038
|
}>;
|
|
1039
1039
|
type AuditResource = Static<typeof auditResourceSchema>;
|
|
1040
1040
|
//#endregion
|
|
1041
1041
|
//#region ../../src/api/audits/index.d.ts
|
|
1042
1042
|
/**
|
|
1043
|
-
*
|
|
1043
|
+
* | type | quality | stability |
|
|
1044
|
+
* |------|---------|-----------|
|
|
1045
|
+
* | backend | standard | stable |
|
|
1044
1046
|
*
|
|
1045
|
-
*
|
|
1046
|
-
* - Audit log CRUD operations
|
|
1047
|
-
* - Filtering and searching audit events
|
|
1048
|
-
* - Audit statistics and analytics
|
|
1049
|
-
* - `$audit` primitive for domain-specific audit types
|
|
1047
|
+
* Audit trail for compliance.
|
|
1050
1048
|
*
|
|
1051
|
-
*
|
|
1052
|
-
*
|
|
1053
|
-
*
|
|
1054
|
-
*
|
|
1055
|
-
*
|
|
1056
|
-
* import { AlephaApiAudits } from "alepha/api/audits";
|
|
1057
|
-
*
|
|
1058
|
-
* const App = $module({
|
|
1059
|
-
* name: "app",
|
|
1060
|
-
* services: [AlephaApiAudits, ...],
|
|
1061
|
-
* });
|
|
1062
|
-
*
|
|
1063
|
-
* // Create domain-specific audit types
|
|
1064
|
-
* class PaymentAudits {
|
|
1065
|
-
* audit = $audit({
|
|
1066
|
-
* type: "payment",
|
|
1067
|
-
* actions: ["create", "refund", "cancel"],
|
|
1068
|
-
* });
|
|
1049
|
+
* **Features:**
|
|
1050
|
+
* - Domain-specific audit types
|
|
1051
|
+
* - Audit event logging
|
|
1052
|
+
* - Filtering and searching
|
|
1053
|
+
* - User action tracking
|
|
1069
1054
|
*
|
|
1070
|
-
*
|
|
1071
|
-
* await this.audit.log("create", {
|
|
1072
|
-
* userId,
|
|
1073
|
-
* resourceType: "payment",
|
|
1074
|
-
* resourceId: paymentId,
|
|
1075
|
-
* });
|
|
1076
|
-
* }
|
|
1077
|
-
* }
|
|
1078
|
-
* ```
|
|
1055
|
+
* @module alepha.api.audits
|
|
1079
1056
|
*/
|
|
1080
|
-
declare const AlephaApiAudits:
|
|
1057
|
+
declare const AlephaApiAudits: alepha349.Service<alepha349.Module>;
|
|
1081
1058
|
//#endregion
|
|
1082
1059
|
export { $audit, AdminAuditController, AlephaApiAudits, AuditEntity, AuditLogOptions, AuditPrimitive, AuditPrimitiveOptions, AuditQuery, AuditResource, AuditService, AuditSeverity, AuditStats, AuditTypeDefinition, CreateAudit, auditEntityInsertSchema, auditEntitySchema, auditQuerySchema, auditResourceSchema, auditSeveritySchema, audits, createAuditSchema };
|
|
1083
1060
|
//# sourceMappingURL=index.d.ts.map
|