alepha 0.20.5 → 0.20.7
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/AGENTS.md +0 -1
- package/CLAUDE.md +0 -1
- package/assets/agents-template.md +0 -1
- package/dist/api/audits/index.browser.js +1 -0
- package/dist/api/audits/index.browser.js.map +1 -1
- package/dist/api/audits/index.d.ts +701 -654
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/audits/index.js +24 -1
- package/dist/api/audits/index.js.map +1 -1
- package/dist/api/files/index.browser.js +1 -0
- package/dist/api/files/index.browser.js.map +1 -1
- package/dist/api/files/index.d.ts +193 -166
- package/dist/api/files/index.d.ts.map +1 -1
- package/dist/api/files/index.js +52 -0
- package/dist/api/files/index.js.map +1 -1
- package/dist/api/jobs/index.browser.js +40 -14
- package/dist/api/jobs/index.browser.js.map +1 -1
- package/dist/api/jobs/index.d.ts +639 -333
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/jobs/index.js +495 -162
- package/dist/api/jobs/index.js.map +1 -1
- package/dist/api/keys/index.d.ts +222 -188
- package/dist/api/keys/index.d.ts.map +1 -1
- package/dist/api/keys/index.js +54 -0
- package/dist/api/keys/index.js.map +1 -1
- package/dist/api/notifications/index.d.ts +265 -236
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/notifications/index.js +55 -13
- package/dist/api/notifications/index.js.map +1 -1
- package/dist/api/organizations/index.d.ts +100 -97
- package/dist/api/organizations/index.d.ts.map +1 -1
- package/dist/api/organizations/index.js.map +1 -1
- package/dist/api/parameters/index.d.ts +332 -314
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/parameters/index.js +37 -0
- package/dist/api/parameters/index.js.map +1 -1
- package/dist/api/payments/index.d.ts +431 -376
- package/dist/api/payments/index.d.ts.map +1 -1
- package/dist/api/payments/index.js +202 -87
- package/dist/api/payments/index.js.map +1 -1
- package/dist/api/subscriptions/index.d.ts +1695 -0
- package/dist/api/subscriptions/index.d.ts.map +1 -0
- package/dist/api/subscriptions/index.js +1919 -0
- package/dist/api/subscriptions/index.js.map +1 -0
- package/dist/api/users/index.d.ts +1001 -844
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +237 -28
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/verifications/index.d.ts +123 -122
- package/dist/api/verifications/index.d.ts.map +1 -1
- package/dist/api/verifications/index.js.map +1 -1
- package/dist/batch/index.js.map +1 -1
- package/dist/bucket/index.d.ts +21 -2
- package/dist/bucket/index.d.ts.map +1 -1
- package/dist/bucket/index.js +47 -0
- package/dist/bucket/index.js.map +1 -1
- package/dist/bucket/index.workerd.js +24 -0
- package/dist/bucket/index.workerd.js.map +1 -1
- package/dist/cache/core/index.d.ts +134 -7
- package/dist/cache/core/index.d.ts.map +1 -1
- package/dist/cache/core/index.js +181 -15
- package/dist/cache/core/index.js.map +1 -1
- package/dist/cache/core/index.workerd.js +181 -15
- package/dist/cache/core/index.workerd.js.map +1 -1
- package/dist/cache/database/index.d.ts +156 -0
- package/dist/cache/database/index.d.ts.map +1 -0
- package/dist/cache/database/index.js +266 -0
- package/dist/cache/database/index.js.map +1 -0
- package/dist/cache/redis/index.d.ts +3 -2
- package/dist/cache/redis/index.d.ts.map +1 -1
- package/dist/cache/redis/index.js.map +1 -1
- package/dist/captcha/index.js.map +1 -1
- package/dist/cli/config/index.js.map +1 -1
- package/dist/cli/core/index.d.ts +142 -128
- package/dist/cli/core/index.d.ts.map +1 -1
- package/dist/cli/core/index.js +160 -13
- package/dist/cli/core/index.js.map +1 -1
- package/dist/cli/devtools/index.d.ts +3 -2
- package/dist/cli/devtools/index.d.ts.map +1 -1
- package/dist/cli/devtools/index.js.map +1 -1
- package/dist/cli/platform/index.d.ts +346 -290
- package/dist/cli/platform/index.d.ts.map +1 -1
- package/dist/cli/platform/index.js +106 -7
- package/dist/cli/platform/index.js.map +1 -1
- package/dist/cli/vendor/index.d.ts +12 -11
- package/dist/cli/vendor/index.d.ts.map +1 -1
- package/dist/cli/vendor/index.js.map +1 -1
- package/dist/command/index.d.ts +6 -5
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +1 -1
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +119 -118
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +1 -1
- package/dist/core/index.native.js.map +1 -1
- package/dist/core/index.workerd.js +1 -1
- package/dist/core/index.workerd.js.map +1 -1
- package/dist/crypto/index.browser.js.map +1 -1
- package/dist/crypto/index.d.ts +3 -2
- package/dist/crypto/index.d.ts.map +1 -1
- package/dist/crypto/index.js.map +1 -1
- package/dist/datetime/index.js.map +1 -1
- package/dist/email/brevo/index.js.map +1 -1
- package/dist/email/core/index.d.ts +3 -2
- package/dist/email/core/index.d.ts.map +1 -1
- package/dist/email/core/index.js.map +1 -1
- package/dist/email/core/index.workerd.js.map +1 -1
- package/dist/email/smtp/index.d.ts +7 -6
- package/dist/email/smtp/index.d.ts.map +1 -1
- package/dist/email/smtp/index.js.map +1 -1
- package/dist/fake/index.js.map +1 -1
- package/dist/lock/core/index.d.ts +5 -4
- package/dist/lock/core/index.d.ts.map +1 -1
- package/dist/lock/core/index.js.map +1 -1
- package/dist/lock/redis/index.js.map +1 -1
- package/dist/logger/index.d.ts +10 -9
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js.map +1 -1
- package/dist/mcp/index.d.ts +9 -8
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/orm/core/index.browser.js +9 -3
- package/dist/orm/core/index.browser.js.map +1 -1
- package/dist/orm/core/index.bun.js +31 -10
- package/dist/orm/core/index.bun.js.map +1 -1
- package/dist/orm/core/index.d.ts +33 -14
- package/dist/orm/core/index.d.ts.map +1 -1
- package/dist/orm/core/index.js +31 -10
- package/dist/orm/core/index.js.map +1 -1
- package/dist/orm/postgres/index.bun.js.map +1 -1
- package/dist/orm/postgres/index.d.ts +6 -5
- package/dist/orm/postgres/index.d.ts.map +1 -1
- package/dist/orm/postgres/index.js.map +1 -1
- package/dist/queue/core/index.d.ts +5 -4
- package/dist/queue/core/index.d.ts.map +1 -1
- package/dist/queue/core/index.js.map +1 -1
- package/dist/queue/core/index.workerd.js.map +1 -1
- package/dist/queue/redis/index.d.ts +3 -2
- package/dist/queue/redis/index.d.ts.map +1 -1
- package/dist/queue/redis/index.js.map +1 -1
- package/dist/react/auth/index.browser.js.map +1 -1
- package/dist/react/auth/index.js.map +1 -1
- package/dist/react/core/index.js.map +1 -1
- package/dist/react/form/index.d.ts +5 -0
- package/dist/react/form/index.d.ts.map +1 -1
- package/dist/react/form/index.js +8 -4
- package/dist/react/form/index.js.map +1 -1
- package/dist/react/head/index.browser.js.map +1 -1
- package/dist/react/head/index.js.map +1 -1
- package/dist/react/i18n/index.d.ts +2 -1
- package/dist/react/i18n/index.d.ts.map +1 -1
- package/dist/react/i18n/index.js.map +1 -1
- package/dist/react/intro/index.js.map +1 -1
- package/dist/react/router/index.browser.js.map +1 -1
- package/dist/react/router/index.d.ts +206 -205
- package/dist/react/router/index.d.ts.map +1 -1
- package/dist/react/router/index.js.map +1 -1
- package/dist/react/testing/index.js.map +1 -1
- package/dist/react/ui/index.d.ts +11 -11
- package/dist/react/ui/index.d.ts.map +1 -1
- package/dist/react/ui/index.js.map +1 -1
- package/dist/redis/index.bun.js.map +1 -1
- package/dist/redis/index.js.map +1 -1
- package/dist/retry/index.js.map +1 -1
- package/dist/router/index.js.map +1 -1
- package/dist/scheduler/index.d.ts +25 -2
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +12 -0
- package/dist/scheduler/index.js.map +1 -1
- package/dist/scheduler/index.workerd.js +12 -0
- package/dist/scheduler/index.workerd.js.map +1 -1
- package/dist/security/index.browser.js +29 -1
- package/dist/security/index.browser.js.map +1 -1
- package/dist/security/index.d.ts +82 -35
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +56 -3
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.d.ts +163 -158
- package/dist/server/auth/index.d.ts.map +1 -1
- package/dist/server/auth/index.js +16 -4
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cookies/index.browser.js.map +1 -1
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/server/core/index.browser.js.map +1 -1
- package/dist/server/core/index.d.ts +35 -34
- package/dist/server/core/index.d.ts.map +1 -1
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/cors/index.d.ts +7 -6
- package/dist/server/cors/index.d.ts.map +1 -1
- package/dist/server/cors/index.js.map +1 -1
- package/dist/server/etag/index.js.map +1 -1
- package/dist/server/health/index.d.ts +16 -15
- package/dist/server/health/index.d.ts.map +1 -1
- package/dist/server/health/index.js.map +1 -1
- package/dist/server/links/index.browser.js.map +1 -1
- package/dist/server/links/index.d.ts +51 -50
- package/dist/server/links/index.d.ts.map +1 -1
- package/dist/server/links/index.js.map +1 -1
- package/dist/server/metrics/index.js.map +1 -1
- package/dist/server/proxy/index.js.map +1 -1
- package/dist/server/rate-limit/index.d.ts +6 -5
- package/dist/server/rate-limit/index.d.ts.map +1 -1
- package/dist/server/rate-limit/index.js.map +1 -1
- package/dist/server/static/index.js.map +1 -1
- package/dist/server/swagger/index.d.ts +2 -1
- package/dist/server/swagger/index.d.ts.map +1 -1
- package/dist/server/swagger/index.js.map +1 -1
- package/dist/sms/index.js.map +1 -1
- package/dist/system/index.browser.js.map +1 -1
- package/dist/system/index.js.map +1 -1
- package/dist/system/index.workerd.js.map +1 -1
- package/dist/topic/core/index.js.map +1 -1
- package/dist/topic/redis/index.d.ts +3 -2
- package/dist/topic/redis/index.d.ts.map +1 -1
- package/dist/topic/redis/index.js.map +1 -1
- package/package.json +33 -39
- package/src/api/audits/controllers/AdminAuditController.ts +29 -0
- package/src/api/audits/entities/audits.ts +1 -0
- package/src/api/files/controllers/FileController.ts +24 -0
- package/src/api/files/entities/files.ts +1 -0
- package/src/api/files/services/FileService.ts +41 -0
- package/src/api/jobs/__tests__/$job.spec.ts +501 -24
- package/src/api/jobs/entities/jobExecutionEntity.ts +4 -3
- package/src/api/jobs/index.ts +47 -10
- package/src/api/jobs/primitives/$job.ts +22 -9
- package/src/api/jobs/providers/DirectJobDispatcher.ts +71 -0
- package/src/api/jobs/providers/JobDispatcher.ts +49 -0
- package/src/api/jobs/providers/JobProvider.ts +385 -147
- package/src/api/jobs/providers/JobQueueProvider.ts +43 -18
- package/src/api/jobs/schemas/jobConfigAtom.ts +9 -3
- package/src/api/jobs/schemas/jobExecutionResourceSchema.ts +11 -0
- package/src/api/jobs/schemas/jobRegistrationSchema.ts +4 -2
- package/src/api/jobs/services/JobService.ts +21 -11
- package/src/api/keys/controllers/AdminApiKeyController.ts +23 -0
- package/src/api/keys/entities/apiKeyEntity.ts +1 -0
- package/src/api/keys/services/ApiKeyService.ts +42 -0
- package/src/api/notifications/__tests__/AlephaApiNotifications.spec.ts +63 -0
- package/src/api/notifications/controllers/AdminNotificationController.ts +48 -1
- package/src/api/notifications/index.ts +13 -3
- package/src/api/notifications/jobs/NotificationJobs.ts +0 -6
- package/src/api/parameters/controllers/AdminParameterController.ts +26 -0
- package/src/api/parameters/services/ParameterProvider.ts +18 -0
- package/src/api/payments/controllers/MockCheckoutController.ts +146 -0
- package/src/api/payments/index.ts +3 -0
- package/src/api/payments/providers/MemoryPaymentProvider.ts +9 -4
- package/src/api/payments/providers/PaymentProvider.ts +25 -9
- package/src/api/payments/services/PaymentService.ts +3 -0
- package/src/api/subscriptions/__tests__/BillingService.spec.ts +218 -0
- package/src/api/subscriptions/__tests__/SubscriptionService.spec.ts +278 -0
- package/src/api/subscriptions/controllers/AdminSubscriptionController.ts +212 -0
- package/src/api/subscriptions/controllers/SubscriptionController.ts +189 -0
- package/src/api/subscriptions/entities/subscriptionEvents.ts +54 -0
- package/src/api/subscriptions/entities/subscriptions.ts +68 -0
- package/src/api/subscriptions/index.ts +133 -0
- package/src/api/subscriptions/jobs/SubscriptionJobs.ts +382 -0
- package/src/api/subscriptions/middleware/$requireLimit.ts +50 -0
- package/src/api/subscriptions/middleware/$requirePlan.ts +49 -0
- package/src/api/subscriptions/notifications/SubscriptionNotifications.ts +110 -0
- package/src/api/subscriptions/schemas/cancelSubscriptionSchema.ts +8 -0
- package/src/api/subscriptions/schemas/changePlanSchema.ts +9 -0
- package/src/api/subscriptions/schemas/createSubscriptionSchema.ts +11 -0
- package/src/api/subscriptions/schemas/entitlementsSchema.ts +21 -0
- package/src/api/subscriptions/schemas/mrrSchema.ts +13 -0
- package/src/api/subscriptions/schemas/planDefinitionSchema.ts +71 -0
- package/src/api/subscriptions/schemas/planResourceSchema.ts +25 -0
- package/src/api/subscriptions/schemas/subscriptionEventResourceSchema.ts +8 -0
- package/src/api/subscriptions/schemas/subscriptionQuerySchema.ts +19 -0
- package/src/api/subscriptions/schemas/subscriptionResourceSchema.ts +6 -0
- package/src/api/subscriptions/schemas/subscriptionSettingsSchema.ts +32 -0
- package/src/api/subscriptions/schemas/subscriptionStatsSchema.ts +23 -0
- package/src/api/subscriptions/services/BillingService.ts +437 -0
- package/src/api/subscriptions/services/SubscriptionConfig.ts +56 -0
- package/src/api/subscriptions/services/SubscriptionService.ts +867 -0
- package/src/api/subscriptions/services/UsageService.ts +118 -0
- package/src/api/users/__tests__/Registration-emailMode.spec.ts +203 -0
- package/src/api/users/__tests__/UsernameSlugger.spec.ts +138 -0
- package/src/api/users/atoms/realmAuthSettingsAtom.ts +41 -3
- package/src/api/users/controllers/AdminSessionController.ts +29 -0
- package/src/api/users/controllers/AdminUserController.ts +32 -0
- package/src/api/users/index.ts +3 -0
- package/src/api/users/services/CredentialService.ts +5 -0
- package/src/api/users/services/RegistrationService.ts +49 -1
- package/src/api/users/services/SessionCrudService.ts +16 -0
- package/src/api/users/services/SessionService.ts +17 -59
- package/src/api/users/services/UsernameSlugger.ts +195 -0
- package/src/bucket/primitives/$bucket.ts +21 -0
- package/src/bucket/providers/CloudflareR2Provider.ts +15 -0
- package/src/bucket/providers/FileStorageProvider.ts +9 -0
- package/src/bucket/providers/LocalFileStorageProvider.ts +14 -0
- package/src/bucket/providers/MemoryFileStorageProvider.ts +9 -0
- package/src/bucket/providers/NodeS3BucketProvider.ts +35 -0
- package/src/cache/core/__tests__/$cache.memory.spec.ts +450 -0
- package/src/cache/core/__tests__/$cache.swr.spec.ts +394 -0
- package/src/cache/core/index.ts +16 -0
- package/src/cache/core/primitives/$cache.ts +367 -24
- package/src/cache/database/__tests__/DatabaseCacheProvider.behavior.spec.ts +203 -0
- package/src/cache/database/__tests__/DatabaseCacheProvider.spec.ts +110 -0
- package/src/cache/database/entities/cacheEntries.ts +55 -0
- package/src/cache/database/index.ts +36 -0
- package/src/cache/database/providers/DatabaseCacheProvider.ts +348 -0
- package/src/cli/core/services/ProjectScaffolder.ts +0 -2
- package/src/cli/core/tasks/BuildCloudflareTask.ts +33 -3
- package/src/cli/core/tasks/BuildSitemapTask.ts +7 -0
- package/src/cli/core/tasks/BuildVercelTask.ts +82 -3
- package/src/cli/core/templates/agentMd.ts +39 -4
- package/src/cli/core/templates/biomeJson.ts +25 -1
- package/src/cli/core/templates/saasAdminLayoutTsx.ts +2 -2
- package/src/cli/platform/__tests__/CloudflareAdapter.spec.ts +117 -0
- package/src/cli/platform/__tests__/detectResources.spec.ts +96 -0
- package/src/cli/platform/adapters/CloudflareAdapter.ts +104 -7
- package/src/cli/platform/atoms/platformOptions.ts +13 -0
- package/src/cli/platform/commands/platform.ts +7 -1
- package/src/cli/platform/schemas/platform.ts +1 -0
- package/src/cli/platform/services/CloudflareApi.ts +61 -0
- package/src/cli/platform/services/PlatformOrchestrator.ts +9 -4
- package/src/core/__tests__/$module.spec.ts +2 -2
- package/src/core/primitives/$module.ts +4 -4
- package/src/mcp/providers/McpServerProvider.ts +1 -1
- package/src/orm/core/providers/DatabaseTypeProvider.ts +9 -3
- package/src/orm/core/providers/drivers/DatabaseProvider.ts +1 -1
- package/src/orm/core/schemas/insertSchema.ts +10 -2
- package/src/orm/core/services/Repository.ts +27 -7
- package/src/react/form/hooks/useFormState.ts +8 -1
- package/src/react/form/index.ts +10 -1
- package/src/react/form/services/FormModel.ts +9 -3
- package/src/scheduler/index.ts +14 -0
- package/src/scheduler/providers/CronProvider.ts +13 -0
- package/src/security/atoms/currentTenantAtom.ts +34 -0
- package/src/security/index.browser.ts +1 -0
- package/src/security/index.ts +12 -1
- package/src/security/primitives/$issuer.ts +17 -1
- package/src/security/providers/SecurityProvider.ts +37 -0
- package/src/server/auth/__tests__/validateRedirectUri.spec.ts +78 -0
- package/src/server/auth/providers/ServerAuthProvider.ts +21 -5
- package/tsconfig.base.json +2 -1
- package/dist/react/websocket/index.d.ts +0 -117
- package/dist/react/websocket/index.d.ts.map +0 -1
- package/dist/react/websocket/index.js +0 -108
- package/dist/react/websocket/index.js.map +0 -1
- package/dist/websocket/index.browser.js +0 -844
- package/dist/websocket/index.browser.js.map +0 -1
- package/dist/websocket/index.d.ts +0 -876
- package/dist/websocket/index.d.ts.map +0 -1
- package/dist/websocket/index.js +0 -1175
- package/dist/websocket/index.js.map +0 -1
- package/src/react/websocket/hooks/useRoom.tsx +0 -251
- package/src/react/websocket/index.ts +0 -7
- package/src/websocket/__tests__/$channel.spec.ts +0 -30
- package/src/websocket/__tests__/$websocket-new.spec.ts +0 -195
- package/src/websocket/__tests__/RoomManager.spec.ts +0 -146
- package/src/websocket/__tests__/websocket-integration.spec.ts +0 -951
- package/src/websocket/errors/WebSocketError.ts +0 -34
- package/src/websocket/index.browser.ts +0 -25
- package/src/websocket/index.shared.ts +0 -8
- package/src/websocket/index.ts +0 -85
- package/src/websocket/interfaces/WebSocketInterfaces.ts +0 -252
- package/src/websocket/primitives/$channel.ts +0 -131
- package/src/websocket/primitives/$websocket.ts +0 -107
- package/src/websocket/providers/NodeWebSocketServerProvider.ts +0 -617
- package/src/websocket/providers/WebSocketServerProvider.ts +0 -56
- package/src/websocket/services/RoomManager.ts +0 -160
- package/src/websocket/services/WebSocketClient.ts +0 -642
- package/src/websocket/services/WebSocketTopicService.ts +0 -108
|
@@ -1,537 +1,237 @@
|
|
|
1
1
|
import * as _$alepha from "alepha";
|
|
2
2
|
import { Alepha, KIND, Primitive, Static, TNull, TObject, TOptional, TSchema, TUnion } from "alepha";
|
|
3
|
-
import * as _$alepha_server0 from "alepha/server";
|
|
4
|
-
import { ServerRequest } from "alepha/server";
|
|
5
3
|
import * as _$alepha_orm0 from "alepha/orm";
|
|
6
4
|
import { Page } from "alepha/orm";
|
|
5
|
+
import * as _$alepha_server0 from "alepha/server";
|
|
6
|
+
import { ServerRequest } from "alepha/server";
|
|
7
7
|
import * as _$alepha_logger0 from "alepha/logger";
|
|
8
|
+
import * as _$typebox from "typebox";
|
|
8
9
|
import { BuildExtraConfigColumns, SQL } from "drizzle-orm";
|
|
9
10
|
import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, UpdateDeleteAction } from "drizzle-orm/pg-core";
|
|
10
|
-
//#region ../../src/
|
|
11
|
+
//#region ../../src/api/audits/entities/audits.d.ts
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
-
* All default properties at the root level are made optional.
|
|
14
|
-
* Generated columns are excluded entirely.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* Before: { name: string; age: number(default=0); fullName: generated }
|
|
18
|
-
* After: { name: string; age?: number; }
|
|
13
|
+
* Audit severity levels for categorizing events.
|
|
19
14
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} ? never : K]: T["properties"][K] extends {
|
|
23
|
-
[PG_DEFAULT]: any;
|
|
24
|
-
} | {
|
|
25
|
-
"~optional": true;
|
|
26
|
-
} ? TOptional<T["properties"][K]> : T["properties"][K] }>;
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region ../../src/orm/core/schemas/updateSchema.d.ts
|
|
15
|
+
declare const auditSeveritySchema: _$typebox.TUnsafe<"info" | "warning" | "critical">;
|
|
16
|
+
type AuditSeverity = Static<typeof auditSeveritySchema>;
|
|
29
17
|
/**
|
|
30
|
-
*
|
|
31
|
-
* All optional properties at the root level are made nullable (i.e., `T | null`).
|
|
32
|
-
* Generated columns are excluded entirely.
|
|
18
|
+
* Audit log entity for tracking important system events.
|
|
33
19
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
20
|
+
* Stores comprehensive audit information including:
|
|
21
|
+
* - Who performed the action (userId, userRealm)
|
|
22
|
+
* - What happened (type, action, resource)
|
|
23
|
+
* - When it happened (createdAt)
|
|
24
|
+
* - Context and details (metadata, ipAddress, userAgent)
|
|
37
25
|
*/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
//#region ../../src/orm/core/primitives/$entity.d.ts
|
|
43
|
-
interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
|
|
26
|
+
declare const audits: _$alepha_orm0.EntityPrimitive<_$typebox.TObject<{
|
|
27
|
+
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
28
|
+
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
29
|
+
organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
|
|
44
30
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
31
|
+
* Audit event type (e.g., "auth", "user", "payment", "system").
|
|
32
|
+
* Used for categorizing and filtering audit events.
|
|
47
33
|
*/
|
|
48
|
-
|
|
34
|
+
type: _$typebox.TString;
|
|
49
35
|
/**
|
|
50
|
-
*
|
|
36
|
+
* Specific action performed (e.g., "login", "logout", "create", "update", "delete").
|
|
51
37
|
*/
|
|
52
|
-
|
|
38
|
+
action: _$typebox.TString;
|
|
53
39
|
/**
|
|
54
|
-
*
|
|
40
|
+
* Severity level of the event.
|
|
55
41
|
*/
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Single column to index.
|
|
59
|
-
*/
|
|
60
|
-
column: Keys;
|
|
61
|
-
/**
|
|
62
|
-
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
63
|
-
*/
|
|
64
|
-
unique?: boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Custom name for the index. If not provided, generates name automatically.
|
|
67
|
-
*/
|
|
68
|
-
name?: string;
|
|
69
|
-
/**
|
|
70
|
-
* Partial index condition. Only rows matching this SQL expression are indexed.
|
|
71
|
-
*/
|
|
72
|
-
where?: SQL;
|
|
73
|
-
} | {
|
|
74
|
-
/**
|
|
75
|
-
* Multiple columns for composite index (order matters for query optimization).
|
|
76
|
-
*/
|
|
77
|
-
columns: Keys[];
|
|
78
|
-
/**
|
|
79
|
-
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
80
|
-
*/
|
|
81
|
-
unique?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Custom name for the index. If not provided, generates name automatically.
|
|
84
|
-
*/
|
|
85
|
-
name?: string;
|
|
86
|
-
/**
|
|
87
|
-
* Partial index condition. Only rows matching this SQL expression are indexed.
|
|
88
|
-
*/
|
|
89
|
-
where?: SQL;
|
|
90
|
-
} | {
|
|
91
|
-
/**
|
|
92
|
-
* SQL expressions for expression-based indexes.
|
|
93
|
-
*
|
|
94
|
-
* Can include column references and SQL functions like `LOWER()`, `UPPER()`, etc.
|
|
95
|
-
* Columns and expressions can be mixed together.
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* ```ts
|
|
99
|
-
* // Case-insensitive unique username per realm
|
|
100
|
-
* indexes: [{
|
|
101
|
-
* expressions: (self) => [self.realm, sql`LOWER(${self.username})`],
|
|
102
|
-
* unique: true,
|
|
103
|
-
* name: "users_realm_username_lower_idx",
|
|
104
|
-
* }]
|
|
105
|
-
* ```
|
|
106
|
-
*/
|
|
107
|
-
expressions: (self: Record<Keys & string, any>) => (SQL | any)[];
|
|
108
|
-
/**
|
|
109
|
-
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
110
|
-
*/
|
|
111
|
-
unique?: boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Custom name for the index. If not provided, generates name automatically.
|
|
114
|
-
*/
|
|
115
|
-
name: string;
|
|
116
|
-
/**
|
|
117
|
-
* Partial index condition. Only rows matching this SQL expression are indexed.
|
|
118
|
-
*/
|
|
119
|
-
where?: SQL;
|
|
120
|
-
})[];
|
|
42
|
+
severity: _$alepha_orm0.PgAttr<_$typebox.TUnsafe<"info" | "warning" | "critical">, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
121
43
|
/**
|
|
122
|
-
*
|
|
44
|
+
* User ID who performed the action (null for system events).
|
|
123
45
|
*/
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Optional name for the foreign key constraint.
|
|
127
|
-
*/
|
|
128
|
-
name?: string;
|
|
129
|
-
/**
|
|
130
|
-
* Local columns that reference the foreign table.
|
|
131
|
-
*/
|
|
132
|
-
columns: Array<keyof Static<T>>;
|
|
133
|
-
/**
|
|
134
|
-
* Referenced columns in the foreign table.
|
|
135
|
-
* Must be EntityColumn references from other entities.
|
|
136
|
-
*/
|
|
137
|
-
foreignColumns: Array<() => EntityColumn<any>>;
|
|
138
|
-
}>;
|
|
46
|
+
userId: _$typebox.TOptional<_$typebox.TString>;
|
|
139
47
|
/**
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
* Constraints enforce business rules at the database level, providing
|
|
143
|
-
* an additional layer of data integrity beyond application validation.
|
|
144
|
-
*
|
|
145
|
-
* **Constraint Types**:
|
|
146
|
-
* - **Unique constraints**: Prevent duplicate values across columns
|
|
147
|
-
* - **Check constraints**: Enforce custom validation rules with SQL expressions
|
|
148
|
-
*
|
|
149
|
-
* @example
|
|
150
|
-
* ```ts
|
|
151
|
-
* constraints: [
|
|
152
|
-
* {
|
|
153
|
-
* name: "unique_user_email",
|
|
154
|
-
* columns: ["email"],
|
|
155
|
-
* unique: true
|
|
156
|
-
* },
|
|
157
|
-
* {
|
|
158
|
-
* name: "valid_age_range",
|
|
159
|
-
* columns: ["age"],
|
|
160
|
-
* check: sql`age >= 0 AND age <= 150`
|
|
161
|
-
* },
|
|
162
|
-
* {
|
|
163
|
-
* name: "unique_user_username_per_tenant",
|
|
164
|
-
* columns: ["tenantId", "username"],
|
|
165
|
-
* unique: true
|
|
166
|
-
* }
|
|
167
|
-
* ]
|
|
168
|
-
* ```
|
|
48
|
+
* User realm for multi-tenant support.
|
|
169
49
|
*/
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Columns involved in this constraint.
|
|
173
|
-
*/
|
|
174
|
-
columns: Array<keyof Static<T>>;
|
|
175
|
-
/**
|
|
176
|
-
* Optional name for the constraint.
|
|
177
|
-
*/
|
|
178
|
-
name?: string;
|
|
179
|
-
/**
|
|
180
|
-
* Whether this is a unique constraint.
|
|
181
|
-
*/
|
|
182
|
-
unique?: boolean | {};
|
|
183
|
-
/**
|
|
184
|
-
* SQL expression for check constraint validation.
|
|
185
|
-
*/
|
|
186
|
-
check?: SQL;
|
|
187
|
-
}>;
|
|
50
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
188
51
|
/**
|
|
189
|
-
*
|
|
52
|
+
* User email at the time of the event (denormalized for history).
|
|
190
53
|
*/
|
|
191
|
-
|
|
192
|
-
}
|
|
193
|
-
declare class EntityPrimitive<T extends TObject = TObject> {
|
|
194
|
-
readonly options: EntityPrimitiveOptions<T>;
|
|
195
|
-
constructor(options: EntityPrimitiveOptions<T>);
|
|
196
|
-
alias(alias: string): this;
|
|
197
|
-
get cols(): EntityColumns<T>;
|
|
198
|
-
get name(): string;
|
|
199
|
-
get schema(): T;
|
|
200
|
-
get insertSchema(): TObjectInsert<T>;
|
|
201
|
-
get updateSchema(): TObjectUpdate<T>;
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Convert a schema to columns.
|
|
205
|
-
*/
|
|
206
|
-
type FromSchema<T extends TObject> = { [key in keyof T["properties"]]: PgColumnBuilderBase };
|
|
207
|
-
type EntityColumn<T extends TObject> = {
|
|
208
|
-
name: string;
|
|
209
|
-
entity: EntityPrimitive<T>;
|
|
210
|
-
};
|
|
211
|
-
type EntityColumns<T extends TObject> = { [key in keyof T["properties"]]: EntityColumn<T> };
|
|
212
|
-
//#endregion
|
|
213
|
-
//#region ../../src/orm/core/constants/PG_SYMBOLS.d.ts
|
|
214
|
-
declare const PG_DEFAULT: unique symbol;
|
|
215
|
-
declare const PG_PRIMARY_KEY: unique symbol;
|
|
216
|
-
declare const PG_CREATED_AT: unique symbol;
|
|
217
|
-
declare const PG_UPDATED_AT: unique symbol;
|
|
218
|
-
declare const PG_DELETED_AT: unique symbol;
|
|
219
|
-
declare const PG_VERSION: unique symbol;
|
|
220
|
-
declare const PG_IDENTITY: unique symbol;
|
|
221
|
-
declare const PG_ENUM: unique symbol;
|
|
222
|
-
declare const PG_REF: unique symbol;
|
|
223
|
-
declare const PG_GENERATED: unique symbol;
|
|
224
|
-
declare const PG_ORGANIZATION: unique symbol;
|
|
225
|
-
/**
|
|
226
|
-
* @deprecated Use `PG_IDENTITY` instead.
|
|
227
|
-
*/
|
|
228
|
-
declare const PG_SERIAL: unique symbol;
|
|
229
|
-
type PgSymbols = {
|
|
230
|
-
[PG_DEFAULT]: {};
|
|
231
|
-
[PG_PRIMARY_KEY]: {};
|
|
232
|
-
[PG_CREATED_AT]: {};
|
|
233
|
-
[PG_UPDATED_AT]: {};
|
|
234
|
-
[PG_DELETED_AT]: {};
|
|
235
|
-
[PG_VERSION]: {};
|
|
236
|
-
[PG_IDENTITY]: PgIdentityOptions;
|
|
237
|
-
[PG_REF]: PgRefOptions;
|
|
238
|
-
[PG_ENUM]: PgEnumOptions;
|
|
239
|
-
[PG_GENERATED]: PgGeneratedOptions;
|
|
240
|
-
[PG_ORGANIZATION]: {};
|
|
54
|
+
userEmail: _$typebox.TOptional<_$typebox.TString>;
|
|
241
55
|
/**
|
|
242
|
-
*
|
|
56
|
+
* Resource type affected (e.g., "user", "order", "file").
|
|
243
57
|
*/
|
|
244
|
-
|
|
245
|
-
};
|
|
246
|
-
type PgSymbolKeys = keyof PgSymbols;
|
|
247
|
-
type PgIdentityOptions = {
|
|
248
|
-
mode: "always" | "byDefault";
|
|
249
|
-
} & PgSequenceOptions & {
|
|
250
|
-
name?: string;
|
|
251
|
-
};
|
|
252
|
-
interface PgEnumOptions {
|
|
253
|
-
name?: string;
|
|
254
|
-
description?: string;
|
|
255
|
-
}
|
|
256
|
-
interface PgGeneratedOptions {
|
|
58
|
+
resourceType: _$typebox.TOptional<_$typebox.TString>;
|
|
257
59
|
/**
|
|
258
|
-
*
|
|
60
|
+
* Resource ID affected.
|
|
259
61
|
*/
|
|
260
|
-
|
|
62
|
+
resourceId: _$typebox.TOptional<_$typebox.TString>;
|
|
261
63
|
/**
|
|
262
|
-
*
|
|
263
|
-
* - `"stored"` — value is computed on write and stored on disk (default for PostgreSQL).
|
|
264
|
-
* - `"virtual"` — value is computed on read (default for SQLite).
|
|
64
|
+
* Human-readable description of the event.
|
|
265
65
|
*/
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
interface PgRefOptions {
|
|
269
|
-
ref: () => {
|
|
270
|
-
name: string;
|
|
271
|
-
entity: EntityPrimitive;
|
|
272
|
-
};
|
|
273
|
-
actions?: {
|
|
274
|
-
onUpdate?: UpdateDeleteAction;
|
|
275
|
-
onDelete?: UpdateDeleteAction;
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
//#endregion
|
|
279
|
-
//#region ../../src/orm/core/helpers/pgAttr.d.ts
|
|
280
|
-
/**
|
|
281
|
-
* Type representation.
|
|
282
|
-
*/
|
|
283
|
-
type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
|
|
284
|
-
//#endregion
|
|
285
|
-
//#region ../../src/orm/core/schemas/databaseEnvSchema.d.ts
|
|
286
|
-
/**
|
|
287
|
-
* Base database environment schema.
|
|
288
|
-
*
|
|
289
|
-
* Defines the `DATABASE_URL` connection string used by all ORM providers
|
|
290
|
-
* to determine the database driver and connection target.
|
|
291
|
-
*
|
|
292
|
-
* Supported URL formats:
|
|
293
|
-
* - `sqlite://:memory:` or `sqlite://./path/to/db` — SQLite (Node.js or Bun)
|
|
294
|
-
* - `postgres://user:password@host:port/database` — PostgreSQL (Node.js or Bun)
|
|
295
|
-
* - `pglite://:memory:` or `pglite://./path` — PGlite (embedded Postgres)
|
|
296
|
-
* - `d1://BINDING_NAME` — Cloudflare D1
|
|
297
|
-
* - `hyperdrive://BINDING_NAME` — Cloudflare Hyperdrive
|
|
298
|
-
*/
|
|
299
|
-
declare const databaseEnvSchema: _$alepha.TObject<{
|
|
300
|
-
DATABASE_URL: _$alepha.TOptional<_$alepha.TString>;
|
|
301
|
-
/**
|
|
302
|
-
* Enable or disable push-based schema synchronization (drizzle-kit push).
|
|
303
|
-
*
|
|
304
|
-
* Defaults to `true` in development and test, `false` in production.
|
|
305
|
-
* Set to `false` in development to skip automatic schema sync
|
|
306
|
-
* (e.g. when managing migrations manually).
|
|
307
|
-
*/
|
|
308
|
-
DATABASE_SYNC: _$alepha.TOptional<_$alepha.TBoolean>;
|
|
309
|
-
}>;
|
|
310
|
-
declare module "alepha" {
|
|
311
|
-
interface Env extends Partial<Static<typeof databaseEnvSchema>> {}
|
|
312
|
-
} //# sourceMappingURL=databaseEnvSchema.d.ts.map
|
|
313
|
-
//#endregion
|
|
314
|
-
//#region ../../src/api/audits/entities/audits.d.ts
|
|
315
|
-
/**
|
|
316
|
-
* Audit severity levels for categorizing events.
|
|
317
|
-
*/
|
|
318
|
-
declare const auditSeveritySchema: _$alepha.TUnsafe<"info" | "warning" | "critical">;
|
|
319
|
-
type AuditSeverity = Static<typeof auditSeveritySchema>;
|
|
320
|
-
/**
|
|
321
|
-
* Audit log entity for tracking important system events.
|
|
322
|
-
*
|
|
323
|
-
* Stores comprehensive audit information including:
|
|
324
|
-
* - Who performed the action (userId, userRealm)
|
|
325
|
-
* - What happened (type, action, resource)
|
|
326
|
-
* - When it happened (createdAt)
|
|
327
|
-
* - Context and details (metadata, ipAddress, userAgent)
|
|
328
|
-
*/
|
|
329
|
-
declare const audits: _$alepha_orm0.EntityPrimitive<_$alepha.TObject<{
|
|
330
|
-
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$alepha.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
331
|
-
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$alepha.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
332
|
-
/**
|
|
333
|
-
* Audit event type (e.g., "auth", "user", "payment", "system").
|
|
334
|
-
* Used for categorizing and filtering audit events.
|
|
335
|
-
*/
|
|
336
|
-
type: _$alepha.TString;
|
|
337
|
-
/**
|
|
338
|
-
* Specific action performed (e.g., "login", "logout", "create", "update", "delete").
|
|
339
|
-
*/
|
|
340
|
-
action: _$alepha.TString;
|
|
341
|
-
/**
|
|
342
|
-
* Severity level of the event.
|
|
343
|
-
*/
|
|
344
|
-
severity: _$alepha_orm0.PgAttr<_$alepha.TUnsafe<"info" | "warning" | "critical">, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
345
|
-
/**
|
|
346
|
-
* User ID who performed the action (null for system events).
|
|
347
|
-
*/
|
|
348
|
-
userId: _$alepha.TOptional<_$alepha.TString>;
|
|
349
|
-
/**
|
|
350
|
-
* User realm for multi-tenant support.
|
|
351
|
-
*/
|
|
352
|
-
userRealm: _$alepha.TOptional<_$alepha.TString>;
|
|
353
|
-
/**
|
|
354
|
-
* User email at the time of the event (denormalized for history).
|
|
355
|
-
*/
|
|
356
|
-
userEmail: _$alepha.TOptional<_$alepha.TString>;
|
|
357
|
-
/**
|
|
358
|
-
* Resource type affected (e.g., "user", "order", "file").
|
|
359
|
-
*/
|
|
360
|
-
resourceType: _$alepha.TOptional<_$alepha.TString>;
|
|
361
|
-
/**
|
|
362
|
-
* Resource ID affected.
|
|
363
|
-
*/
|
|
364
|
-
resourceId: _$alepha.TOptional<_$alepha.TString>;
|
|
365
|
-
/**
|
|
366
|
-
* Human-readable description of the event.
|
|
367
|
-
*/
|
|
368
|
-
description: _$alepha.TOptional<_$alepha.TString>;
|
|
66
|
+
description: _$typebox.TOptional<_$typebox.TString>;
|
|
369
67
|
/**
|
|
370
68
|
* Additional metadata/context as JSON.
|
|
371
69
|
*/
|
|
372
|
-
metadata: _$
|
|
70
|
+
metadata: _$typebox.TOptional<_$typebox.TRecord<string, _$typebox.TAny>>;
|
|
373
71
|
/**
|
|
374
72
|
* Client IP address.
|
|
375
73
|
*/
|
|
376
|
-
ipAddress: _$
|
|
74
|
+
ipAddress: _$typebox.TOptional<_$typebox.TString>;
|
|
377
75
|
/**
|
|
378
76
|
* Client user agent.
|
|
379
77
|
*/
|
|
380
|
-
userAgent: _$
|
|
78
|
+
userAgent: _$typebox.TOptional<_$typebox.TString>;
|
|
381
79
|
/**
|
|
382
80
|
* Session ID if applicable.
|
|
383
81
|
*/
|
|
384
|
-
sessionId: _$
|
|
82
|
+
sessionId: _$typebox.TOptional<_$typebox.TString>;
|
|
385
83
|
/**
|
|
386
84
|
* Request ID for correlation.
|
|
387
85
|
*/
|
|
388
|
-
requestId: _$
|
|
86
|
+
requestId: _$typebox.TOptional<_$typebox.TString>;
|
|
389
87
|
/**
|
|
390
88
|
* Whether the action was successful.
|
|
391
89
|
*/
|
|
392
|
-
success: _$alepha_orm0.PgAttr<_$
|
|
90
|
+
success: _$alepha_orm0.PgAttr<_$typebox.TBoolean, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
393
91
|
/**
|
|
394
92
|
* Error message if the action failed.
|
|
395
93
|
*/
|
|
396
|
-
errorMessage: _$
|
|
94
|
+
errorMessage: _$typebox.TOptional<_$typebox.TString>;
|
|
397
95
|
}>>;
|
|
398
|
-
declare const auditEntitySchema: _$
|
|
399
|
-
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$
|
|
400
|
-
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$
|
|
96
|
+
declare const auditEntitySchema: _$typebox.TObject<{
|
|
97
|
+
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
98
|
+
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
99
|
+
organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
|
|
401
100
|
/**
|
|
402
101
|
* Audit event type (e.g., "auth", "user", "payment", "system").
|
|
403
102
|
* Used for categorizing and filtering audit events.
|
|
404
103
|
*/
|
|
405
|
-
type: _$
|
|
104
|
+
type: _$typebox.TString;
|
|
406
105
|
/**
|
|
407
106
|
* Specific action performed (e.g., "login", "logout", "create", "update", "delete").
|
|
408
107
|
*/
|
|
409
|
-
action: _$
|
|
108
|
+
action: _$typebox.TString;
|
|
410
109
|
/**
|
|
411
110
|
* Severity level of the event.
|
|
412
111
|
*/
|
|
413
|
-
severity: _$alepha_orm0.PgAttr<_$
|
|
112
|
+
severity: _$alepha_orm0.PgAttr<_$typebox.TUnsafe<"info" | "warning" | "critical">, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
414
113
|
/**
|
|
415
114
|
* User ID who performed the action (null for system events).
|
|
416
115
|
*/
|
|
417
|
-
userId: _$
|
|
116
|
+
userId: _$typebox.TOptional<_$typebox.TString>;
|
|
418
117
|
/**
|
|
419
118
|
* User realm for multi-tenant support.
|
|
420
119
|
*/
|
|
421
|
-
userRealm: _$
|
|
120
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
422
121
|
/**
|
|
423
122
|
* User email at the time of the event (denormalized for history).
|
|
424
123
|
*/
|
|
425
|
-
userEmail: _$
|
|
124
|
+
userEmail: _$typebox.TOptional<_$typebox.TString>;
|
|
426
125
|
/**
|
|
427
126
|
* Resource type affected (e.g., "user", "order", "file").
|
|
428
127
|
*/
|
|
429
|
-
resourceType: _$
|
|
128
|
+
resourceType: _$typebox.TOptional<_$typebox.TString>;
|
|
430
129
|
/**
|
|
431
130
|
* Resource ID affected.
|
|
432
131
|
*/
|
|
433
|
-
resourceId: _$
|
|
132
|
+
resourceId: _$typebox.TOptional<_$typebox.TString>;
|
|
434
133
|
/**
|
|
435
134
|
* Human-readable description of the event.
|
|
436
135
|
*/
|
|
437
|
-
description: _$
|
|
136
|
+
description: _$typebox.TOptional<_$typebox.TString>;
|
|
438
137
|
/**
|
|
439
138
|
* Additional metadata/context as JSON.
|
|
440
139
|
*/
|
|
441
|
-
metadata: _$
|
|
140
|
+
metadata: _$typebox.TOptional<_$typebox.TRecord<string, _$typebox.TAny>>;
|
|
442
141
|
/**
|
|
443
142
|
* Client IP address.
|
|
444
143
|
*/
|
|
445
|
-
ipAddress: _$
|
|
144
|
+
ipAddress: _$typebox.TOptional<_$typebox.TString>;
|
|
446
145
|
/**
|
|
447
146
|
* Client user agent.
|
|
448
147
|
*/
|
|
449
|
-
userAgent: _$
|
|
148
|
+
userAgent: _$typebox.TOptional<_$typebox.TString>;
|
|
450
149
|
/**
|
|
451
150
|
* Session ID if applicable.
|
|
452
151
|
*/
|
|
453
|
-
sessionId: _$
|
|
152
|
+
sessionId: _$typebox.TOptional<_$typebox.TString>;
|
|
454
153
|
/**
|
|
455
154
|
* Request ID for correlation.
|
|
456
155
|
*/
|
|
457
|
-
requestId: _$
|
|
156
|
+
requestId: _$typebox.TOptional<_$typebox.TString>;
|
|
458
157
|
/**
|
|
459
158
|
* Whether the action was successful.
|
|
460
159
|
*/
|
|
461
|
-
success: _$alepha_orm0.PgAttr<_$
|
|
160
|
+
success: _$alepha_orm0.PgAttr<_$typebox.TBoolean, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
462
161
|
/**
|
|
463
162
|
* Error message if the action failed.
|
|
464
163
|
*/
|
|
465
|
-
errorMessage: _$
|
|
164
|
+
errorMessage: _$typebox.TOptional<_$typebox.TString>;
|
|
466
165
|
}>;
|
|
467
|
-
declare const auditEntityInsertSchema: _$alepha_orm0.TObjectInsert<_$
|
|
468
|
-
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$
|
|
469
|
-
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$
|
|
166
|
+
declare const auditEntityInsertSchema: _$alepha_orm0.TObjectInsert<_$typebox.TObject<{
|
|
167
|
+
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
168
|
+
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
169
|
+
organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
|
|
470
170
|
/**
|
|
471
171
|
* Audit event type (e.g., "auth", "user", "payment", "system").
|
|
472
172
|
* Used for categorizing and filtering audit events.
|
|
473
173
|
*/
|
|
474
|
-
type: _$
|
|
174
|
+
type: _$typebox.TString;
|
|
475
175
|
/**
|
|
476
176
|
* Specific action performed (e.g., "login", "logout", "create", "update", "delete").
|
|
477
177
|
*/
|
|
478
|
-
action: _$
|
|
178
|
+
action: _$typebox.TString;
|
|
479
179
|
/**
|
|
480
180
|
* Severity level of the event.
|
|
481
181
|
*/
|
|
482
|
-
severity: _$alepha_orm0.PgAttr<_$
|
|
182
|
+
severity: _$alepha_orm0.PgAttr<_$typebox.TUnsafe<"info" | "warning" | "critical">, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
483
183
|
/**
|
|
484
184
|
* User ID who performed the action (null for system events).
|
|
485
185
|
*/
|
|
486
|
-
userId: _$
|
|
186
|
+
userId: _$typebox.TOptional<_$typebox.TString>;
|
|
487
187
|
/**
|
|
488
188
|
* User realm for multi-tenant support.
|
|
489
189
|
*/
|
|
490
|
-
userRealm: _$
|
|
190
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
491
191
|
/**
|
|
492
192
|
* User email at the time of the event (denormalized for history).
|
|
493
193
|
*/
|
|
494
|
-
userEmail: _$
|
|
194
|
+
userEmail: _$typebox.TOptional<_$typebox.TString>;
|
|
495
195
|
/**
|
|
496
196
|
* Resource type affected (e.g., "user", "order", "file").
|
|
497
197
|
*/
|
|
498
|
-
resourceType: _$
|
|
198
|
+
resourceType: _$typebox.TOptional<_$typebox.TString>;
|
|
499
199
|
/**
|
|
500
200
|
* Resource ID affected.
|
|
501
201
|
*/
|
|
502
|
-
resourceId: _$
|
|
202
|
+
resourceId: _$typebox.TOptional<_$typebox.TString>;
|
|
503
203
|
/**
|
|
504
204
|
* Human-readable description of the event.
|
|
505
205
|
*/
|
|
506
|
-
description: _$
|
|
206
|
+
description: _$typebox.TOptional<_$typebox.TString>;
|
|
507
207
|
/**
|
|
508
208
|
* Additional metadata/context as JSON.
|
|
509
209
|
*/
|
|
510
|
-
metadata: _$
|
|
210
|
+
metadata: _$typebox.TOptional<_$typebox.TRecord<string, _$typebox.TAny>>;
|
|
511
211
|
/**
|
|
512
212
|
* Client IP address.
|
|
513
213
|
*/
|
|
514
|
-
ipAddress: _$
|
|
214
|
+
ipAddress: _$typebox.TOptional<_$typebox.TString>;
|
|
515
215
|
/**
|
|
516
216
|
* Client user agent.
|
|
517
217
|
*/
|
|
518
|
-
userAgent: _$
|
|
218
|
+
userAgent: _$typebox.TOptional<_$typebox.TString>;
|
|
519
219
|
/**
|
|
520
220
|
* Session ID if applicable.
|
|
521
221
|
*/
|
|
522
|
-
sessionId: _$
|
|
222
|
+
sessionId: _$typebox.TOptional<_$typebox.TString>;
|
|
523
223
|
/**
|
|
524
224
|
* Request ID for correlation.
|
|
525
225
|
*/
|
|
526
|
-
requestId: _$
|
|
226
|
+
requestId: _$typebox.TOptional<_$typebox.TString>;
|
|
527
227
|
/**
|
|
528
228
|
* Whether the action was successful.
|
|
529
229
|
*/
|
|
530
|
-
success: _$alepha_orm0.PgAttr<_$
|
|
230
|
+
success: _$alepha_orm0.PgAttr<_$typebox.TBoolean, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
531
231
|
/**
|
|
532
232
|
* Error message if the action failed.
|
|
533
233
|
*/
|
|
534
|
-
errorMessage: _$
|
|
234
|
+
errorMessage: _$typebox.TOptional<_$typebox.TString>;
|
|
535
235
|
}>>;
|
|
536
236
|
type AuditEntity = Static<typeof audits.schema>;
|
|
537
237
|
//#endregion
|
|
@@ -539,21 +239,21 @@ type AuditEntity = Static<typeof audits.schema>;
|
|
|
539
239
|
/**
|
|
540
240
|
* Query schema for searching and filtering audit logs.
|
|
541
241
|
*/
|
|
542
|
-
declare const auditQuerySchema: _$
|
|
543
|
-
page: _$
|
|
544
|
-
size: _$
|
|
545
|
-
sort: _$
|
|
546
|
-
type: _$
|
|
547
|
-
action: _$
|
|
548
|
-
severity: _$
|
|
549
|
-
userId: _$
|
|
550
|
-
userRealm: _$
|
|
551
|
-
resourceType: _$
|
|
552
|
-
resourceId: _$
|
|
553
|
-
success: _$
|
|
554
|
-
from: _$
|
|
555
|
-
to: _$
|
|
556
|
-
search: _$
|
|
242
|
+
declare const auditQuerySchema: _$typebox.TObject<{
|
|
243
|
+
page: _$typebox.TOptional<_$typebox.TInteger>;
|
|
244
|
+
size: _$typebox.TOptional<_$typebox.TInteger>;
|
|
245
|
+
sort: _$typebox.TOptional<_$typebox.TString>;
|
|
246
|
+
type: _$typebox.TOptional<_$typebox.TString>;
|
|
247
|
+
action: _$typebox.TOptional<_$typebox.TString>;
|
|
248
|
+
severity: _$typebox.TOptional<_$typebox.TUnsafe<"info" | "warning" | "critical">>;
|
|
249
|
+
userId: _$typebox.TOptional<_$typebox.TString>;
|
|
250
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
251
|
+
resourceType: _$typebox.TOptional<_$typebox.TString>;
|
|
252
|
+
resourceId: _$typebox.TOptional<_$typebox.TString>;
|
|
253
|
+
success: _$typebox.TOptional<_$typebox.TBoolean>;
|
|
254
|
+
from: _$typebox.TOptional<_$typebox.TString>;
|
|
255
|
+
to: _$typebox.TOptional<_$typebox.TString>;
|
|
256
|
+
search: _$typebox.TOptional<_$typebox.TString>;
|
|
557
257
|
}>;
|
|
558
258
|
type AuditQuery = Static<typeof auditQuerySchema>;
|
|
559
259
|
//#endregion
|
|
@@ -561,23 +261,23 @@ type AuditQuery = Static<typeof auditQuerySchema>;
|
|
|
561
261
|
/**
|
|
562
262
|
* Schema for creating a new audit log entry.
|
|
563
263
|
*/
|
|
564
|
-
declare const createAuditSchema: _$
|
|
565
|
-
type: _$
|
|
566
|
-
action: _$
|
|
567
|
-
severity: _$
|
|
568
|
-
userId: _$
|
|
569
|
-
userRealm: _$
|
|
570
|
-
userEmail: _$
|
|
571
|
-
resourceType: _$
|
|
572
|
-
resourceId: _$
|
|
573
|
-
description: _$
|
|
574
|
-
metadata: _$
|
|
575
|
-
ipAddress: _$
|
|
576
|
-
userAgent: _$
|
|
577
|
-
sessionId: _$
|
|
578
|
-
requestId: _$
|
|
579
|
-
success: _$
|
|
580
|
-
errorMessage: _$
|
|
264
|
+
declare const createAuditSchema: _$typebox.TObject<{
|
|
265
|
+
type: _$typebox.TString;
|
|
266
|
+
action: _$typebox.TString;
|
|
267
|
+
severity: _$typebox.TOptional<_$typebox.TUnsafe<"info" | "warning" | "critical">>;
|
|
268
|
+
userId: _$typebox.TOptional<_$typebox.TString>;
|
|
269
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
270
|
+
userEmail: _$typebox.TOptional<_$typebox.TString>;
|
|
271
|
+
resourceType: _$typebox.TOptional<_$typebox.TString>;
|
|
272
|
+
resourceId: _$typebox.TOptional<_$typebox.TString>;
|
|
273
|
+
description: _$typebox.TOptional<_$typebox.TString>;
|
|
274
|
+
metadata: _$typebox.TOptional<_$typebox.TRecord<string, _$typebox.TAny>>;
|
|
275
|
+
ipAddress: _$typebox.TOptional<_$typebox.TString>;
|
|
276
|
+
userAgent: _$typebox.TOptional<_$typebox.TString>;
|
|
277
|
+
sessionId: _$typebox.TOptional<_$typebox.TString>;
|
|
278
|
+
requestId: _$typebox.TOptional<_$typebox.TString>;
|
|
279
|
+
success: _$typebox.TOptional<_$typebox.TBoolean>;
|
|
280
|
+
errorMessage: _$typebox.TOptional<_$typebox.TString>;
|
|
581
281
|
}>;
|
|
582
282
|
type CreateAudit = Static<typeof createAuditSchema>;
|
|
583
283
|
//#endregion
|
|
@@ -602,25 +302,26 @@ interface AuditTypeDefinition {
|
|
|
602
302
|
declare class AuditService {
|
|
603
303
|
protected readonly alepha: Alepha;
|
|
604
304
|
protected readonly log: _$alepha_logger0.Logger;
|
|
605
|
-
protected readonly repo: _$alepha_orm0.Repository<_$
|
|
606
|
-
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$
|
|
607
|
-
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
305
|
+
protected readonly repo: _$alepha_orm0.Repository<_$typebox.TObject<{
|
|
306
|
+
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
307
|
+
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
308
|
+
organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
|
|
309
|
+
type: _$typebox.TString;
|
|
310
|
+
action: _$typebox.TString;
|
|
311
|
+
severity: _$alepha_orm0.PgAttr<_$typebox.TUnsafe<"info" | "warning" | "critical">, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
312
|
+
userId: _$typebox.TOptional<_$typebox.TString>;
|
|
313
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
314
|
+
userEmail: _$typebox.TOptional<_$typebox.TString>;
|
|
315
|
+
resourceType: _$typebox.TOptional<_$typebox.TString>;
|
|
316
|
+
resourceId: _$typebox.TOptional<_$typebox.TString>;
|
|
317
|
+
description: _$typebox.TOptional<_$typebox.TString>;
|
|
318
|
+
metadata: _$typebox.TOptional<_$typebox.TRecord<string, _$typebox.TAny>>;
|
|
319
|
+
ipAddress: _$typebox.TOptional<_$typebox.TString>;
|
|
320
|
+
userAgent: _$typebox.TOptional<_$typebox.TString>;
|
|
321
|
+
sessionId: _$typebox.TOptional<_$typebox.TString>;
|
|
322
|
+
requestId: _$typebox.TOptional<_$typebox.TString>;
|
|
323
|
+
success: _$alepha_orm0.PgAttr<_$typebox.TBoolean, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
324
|
+
errorMessage: _$typebox.TOptional<_$typebox.TString>;
|
|
624
325
|
}>>;
|
|
625
326
|
/**
|
|
626
327
|
* Registry of audit types and their allowed actions.
|
|
@@ -721,73 +422,108 @@ declare class AdminAuditController {
|
|
|
721
422
|
protected readonly url = "/audits";
|
|
722
423
|
protected readonly group = "admin:audits";
|
|
723
424
|
protected readonly auditService: AuditService;
|
|
425
|
+
protected readonly repo: _$alepha_orm0.Repository<_$typebox.TObject<{
|
|
426
|
+
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
427
|
+
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
428
|
+
organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
|
|
429
|
+
type: _$typebox.TString;
|
|
430
|
+
action: _$typebox.TString;
|
|
431
|
+
severity: _$alepha_orm0.PgAttr<_$typebox.TUnsafe<"info" | "warning" | "critical">, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
432
|
+
userId: _$typebox.TOptional<_$typebox.TString>;
|
|
433
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
434
|
+
userEmail: _$typebox.TOptional<_$typebox.TString>;
|
|
435
|
+
resourceType: _$typebox.TOptional<_$typebox.TString>;
|
|
436
|
+
resourceId: _$typebox.TOptional<_$typebox.TString>;
|
|
437
|
+
description: _$typebox.TOptional<_$typebox.TString>;
|
|
438
|
+
metadata: _$typebox.TOptional<_$typebox.TRecord<string, _$typebox.TAny>>;
|
|
439
|
+
ipAddress: _$typebox.TOptional<_$typebox.TString>;
|
|
440
|
+
userAgent: _$typebox.TOptional<_$typebox.TString>;
|
|
441
|
+
sessionId: _$typebox.TOptional<_$typebox.TString>;
|
|
442
|
+
requestId: _$typebox.TOptional<_$typebox.TString>;
|
|
443
|
+
success: _$alepha_orm0.PgAttr<_$typebox.TBoolean, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
444
|
+
errorMessage: _$typebox.TOptional<_$typebox.TString>;
|
|
445
|
+
}>>;
|
|
724
446
|
/**
|
|
725
447
|
* Find audit entries with filtering and pagination.
|
|
726
448
|
*/
|
|
727
449
|
readonly findAudits: _$alepha_server0.ActionPrimitiveFn<{
|
|
728
|
-
query: _$
|
|
729
|
-
page: _$
|
|
730
|
-
size: _$
|
|
731
|
-
sort: _$
|
|
732
|
-
type: _$
|
|
733
|
-
action: _$
|
|
734
|
-
severity: _$
|
|
735
|
-
userId: _$
|
|
736
|
-
userRealm: _$
|
|
737
|
-
resourceType: _$
|
|
738
|
-
resourceId: _$
|
|
739
|
-
success: _$
|
|
740
|
-
from: _$
|
|
741
|
-
to: _$
|
|
742
|
-
search: _$
|
|
450
|
+
query: _$typebox.TObject<{
|
|
451
|
+
page: _$typebox.TOptional<_$typebox.TInteger>;
|
|
452
|
+
size: _$typebox.TOptional<_$typebox.TInteger>;
|
|
453
|
+
sort: _$typebox.TOptional<_$typebox.TString>;
|
|
454
|
+
type: _$typebox.TOptional<_$typebox.TString>;
|
|
455
|
+
action: _$typebox.TOptional<_$typebox.TString>;
|
|
456
|
+
severity: _$typebox.TOptional<_$typebox.TUnsafe<"info" | "warning" | "critical">>;
|
|
457
|
+
userId: _$typebox.TOptional<_$typebox.TString>;
|
|
458
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
459
|
+
resourceType: _$typebox.TOptional<_$typebox.TString>;
|
|
460
|
+
resourceId: _$typebox.TOptional<_$typebox.TString>;
|
|
461
|
+
success: _$typebox.TOptional<_$typebox.TBoolean>;
|
|
462
|
+
from: _$typebox.TOptional<_$typebox.TString>;
|
|
463
|
+
to: _$typebox.TOptional<_$typebox.TString>;
|
|
464
|
+
search: _$typebox.TOptional<_$typebox.TString>;
|
|
743
465
|
}>;
|
|
744
|
-
response: _$alepha.TPage<_$
|
|
745
|
-
id: PgAttr<PgAttr<_$
|
|
746
|
-
createdAt: PgAttr<PgAttr<_$
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
466
|
+
response: _$alepha.TPage<_$typebox.TObject<{
|
|
467
|
+
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
468
|
+
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
469
|
+
organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
|
|
470
|
+
type: _$typebox.TString;
|
|
471
|
+
action: _$typebox.TString;
|
|
472
|
+
severity: _$alepha_orm0.PgAttr<_$typebox.TUnsafe<"info" | "warning" | "critical">, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
473
|
+
userId: _$typebox.TOptional<_$typebox.TString>;
|
|
474
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
475
|
+
userEmail: _$typebox.TOptional<_$typebox.TString>;
|
|
476
|
+
resourceType: _$typebox.TOptional<_$typebox.TString>;
|
|
477
|
+
resourceId: _$typebox.TOptional<_$typebox.TString>;
|
|
478
|
+
description: _$typebox.TOptional<_$typebox.TString>;
|
|
479
|
+
metadata: _$typebox.TOptional<_$typebox.TRecord<string, _$typebox.TAny>>;
|
|
480
|
+
ipAddress: _$typebox.TOptional<_$typebox.TString>;
|
|
481
|
+
userAgent: _$typebox.TOptional<_$typebox.TString>;
|
|
482
|
+
sessionId: _$typebox.TOptional<_$typebox.TString>;
|
|
483
|
+
requestId: _$typebox.TOptional<_$typebox.TString>;
|
|
484
|
+
success: _$alepha_orm0.PgAttr<_$typebox.TBoolean, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
485
|
+
errorMessage: _$typebox.TOptional<_$typebox.TString>;
|
|
763
486
|
}>>;
|
|
764
487
|
}>;
|
|
765
488
|
/**
|
|
766
489
|
* Get a single audit entry by ID.
|
|
767
490
|
*/
|
|
768
491
|
readonly getAudit: _$alepha_server0.ActionPrimitiveFn<{
|
|
769
|
-
params: _$
|
|
770
|
-
id: _$
|
|
492
|
+
params: _$typebox.TObject<{
|
|
493
|
+
id: _$typebox.TString;
|
|
494
|
+
}>;
|
|
495
|
+
response: _$typebox.TObject<{
|
|
496
|
+
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
497
|
+
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
498
|
+
organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
|
|
499
|
+
type: _$typebox.TString;
|
|
500
|
+
action: _$typebox.TString;
|
|
501
|
+
severity: _$alepha_orm0.PgAttr<_$typebox.TUnsafe<"info" | "warning" | "critical">, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
502
|
+
userId: _$typebox.TOptional<_$typebox.TString>;
|
|
503
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
504
|
+
userEmail: _$typebox.TOptional<_$typebox.TString>;
|
|
505
|
+
resourceType: _$typebox.TOptional<_$typebox.TString>;
|
|
506
|
+
resourceId: _$typebox.TOptional<_$typebox.TString>;
|
|
507
|
+
description: _$typebox.TOptional<_$typebox.TString>;
|
|
508
|
+
metadata: _$typebox.TOptional<_$typebox.TRecord<string, _$typebox.TAny>>;
|
|
509
|
+
ipAddress: _$typebox.TOptional<_$typebox.TString>;
|
|
510
|
+
userAgent: _$typebox.TOptional<_$typebox.TString>;
|
|
511
|
+
sessionId: _$typebox.TOptional<_$typebox.TString>;
|
|
512
|
+
requestId: _$typebox.TOptional<_$typebox.TString>;
|
|
513
|
+
success: _$alepha_orm0.PgAttr<_$typebox.TBoolean, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
514
|
+
errorMessage: _$typebox.TOptional<_$typebox.TString>;
|
|
515
|
+
}>;
|
|
516
|
+
}>;
|
|
517
|
+
/**
|
|
518
|
+
* Delete many audit entries by id in one repository call. Use with care —
|
|
519
|
+
* audit logs are usually retained for compliance reasons.
|
|
520
|
+
*/
|
|
521
|
+
readonly deleteAudits: _$alepha_server0.ActionPrimitiveFn<{
|
|
522
|
+
body: _$typebox.TObject<{
|
|
523
|
+
ids: _$typebox.TArray<_$typebox.TString>;
|
|
771
524
|
}>;
|
|
772
|
-
response: _$
|
|
773
|
-
|
|
774
|
-
createdAt: PgAttr<PgAttr<_$alepha.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
775
|
-
type: _$alepha.TString;
|
|
776
|
-
action: _$alepha.TString;
|
|
777
|
-
severity: PgAttr<_$alepha.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
778
|
-
userId: _$alepha.TOptional<_$alepha.TString>;
|
|
779
|
-
userRealm: _$alepha.TOptional<_$alepha.TString>;
|
|
780
|
-
userEmail: _$alepha.TOptional<_$alepha.TString>;
|
|
781
|
-
resourceType: _$alepha.TOptional<_$alepha.TString>;
|
|
782
|
-
resourceId: _$alepha.TOptional<_$alepha.TString>;
|
|
783
|
-
description: _$alepha.TOptional<_$alepha.TString>;
|
|
784
|
-
metadata: _$alepha.TOptional<_$alepha.TRecord<string, _$alepha.TAny>>;
|
|
785
|
-
ipAddress: _$alepha.TOptional<_$alepha.TString>;
|
|
786
|
-
userAgent: _$alepha.TOptional<_$alepha.TString>;
|
|
787
|
-
sessionId: _$alepha.TOptional<_$alepha.TString>;
|
|
788
|
-
requestId: _$alepha.TOptional<_$alepha.TString>;
|
|
789
|
-
success: PgAttr<_$alepha.TBoolean, typeof PG_DEFAULT>;
|
|
790
|
-
errorMessage: _$alepha.TOptional<_$alepha.TString>;
|
|
525
|
+
response: _$typebox.TObject<{
|
|
526
|
+
deleted: _$typebox.TArray<_$typebox.TString>;
|
|
791
527
|
}>;
|
|
792
528
|
}>;
|
|
793
529
|
/**
|
|
@@ -795,168 +531,172 @@ declare class AdminAuditController {
|
|
|
795
531
|
* System-only — this permission should never be assigned to human roles.
|
|
796
532
|
*/
|
|
797
533
|
readonly createAudit: _$alepha_server0.ActionPrimitiveFn<{
|
|
798
|
-
body: _$
|
|
799
|
-
type: _$
|
|
800
|
-
action: _$
|
|
801
|
-
severity: _$
|
|
802
|
-
userId: _$
|
|
803
|
-
userRealm: _$
|
|
804
|
-
userEmail: _$
|
|
805
|
-
resourceType: _$
|
|
806
|
-
resourceId: _$
|
|
807
|
-
description: _$
|
|
808
|
-
metadata: _$
|
|
809
|
-
ipAddress: _$
|
|
810
|
-
userAgent: _$
|
|
811
|
-
sessionId: _$
|
|
812
|
-
requestId: _$
|
|
813
|
-
success: _$
|
|
814
|
-
errorMessage: _$
|
|
534
|
+
body: _$typebox.TObject<{
|
|
535
|
+
type: _$typebox.TString;
|
|
536
|
+
action: _$typebox.TString;
|
|
537
|
+
severity: _$typebox.TOptional<_$typebox.TUnsafe<"info" | "warning" | "critical">>;
|
|
538
|
+
userId: _$typebox.TOptional<_$typebox.TString>;
|
|
539
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
540
|
+
userEmail: _$typebox.TOptional<_$typebox.TString>;
|
|
541
|
+
resourceType: _$typebox.TOptional<_$typebox.TString>;
|
|
542
|
+
resourceId: _$typebox.TOptional<_$typebox.TString>;
|
|
543
|
+
description: _$typebox.TOptional<_$typebox.TString>;
|
|
544
|
+
metadata: _$typebox.TOptional<_$typebox.TRecord<string, _$typebox.TAny>>;
|
|
545
|
+
ipAddress: _$typebox.TOptional<_$typebox.TString>;
|
|
546
|
+
userAgent: _$typebox.TOptional<_$typebox.TString>;
|
|
547
|
+
sessionId: _$typebox.TOptional<_$typebox.TString>;
|
|
548
|
+
requestId: _$typebox.TOptional<_$typebox.TString>;
|
|
549
|
+
success: _$typebox.TOptional<_$typebox.TBoolean>;
|
|
550
|
+
errorMessage: _$typebox.TOptional<_$typebox.TString>;
|
|
815
551
|
}>;
|
|
816
|
-
response: _$
|
|
817
|
-
id: PgAttr<PgAttr<_$
|
|
818
|
-
createdAt: PgAttr<PgAttr<_$
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
552
|
+
response: _$typebox.TObject<{
|
|
553
|
+
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
554
|
+
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
555
|
+
organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
|
|
556
|
+
type: _$typebox.TString;
|
|
557
|
+
action: _$typebox.TString;
|
|
558
|
+
severity: _$alepha_orm0.PgAttr<_$typebox.TUnsafe<"info" | "warning" | "critical">, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
559
|
+
userId: _$typebox.TOptional<_$typebox.TString>;
|
|
560
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
561
|
+
userEmail: _$typebox.TOptional<_$typebox.TString>;
|
|
562
|
+
resourceType: _$typebox.TOptional<_$typebox.TString>;
|
|
563
|
+
resourceId: _$typebox.TOptional<_$typebox.TString>;
|
|
564
|
+
description: _$typebox.TOptional<_$typebox.TString>;
|
|
565
|
+
metadata: _$typebox.TOptional<_$typebox.TRecord<string, _$typebox.TAny>>;
|
|
566
|
+
ipAddress: _$typebox.TOptional<_$typebox.TString>;
|
|
567
|
+
userAgent: _$typebox.TOptional<_$typebox.TString>;
|
|
568
|
+
sessionId: _$typebox.TOptional<_$typebox.TString>;
|
|
569
|
+
requestId: _$typebox.TOptional<_$typebox.TString>;
|
|
570
|
+
success: _$alepha_orm0.PgAttr<_$typebox.TBoolean, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
571
|
+
errorMessage: _$typebox.TOptional<_$typebox.TString>;
|
|
835
572
|
}>;
|
|
836
573
|
}>;
|
|
837
574
|
/**
|
|
838
575
|
* Get audit entries for a specific user.
|
|
839
576
|
*/
|
|
840
577
|
readonly findByUser: _$alepha_server0.ActionPrimitiveFn<{
|
|
841
|
-
params: _$
|
|
842
|
-
userId: _$
|
|
578
|
+
params: _$typebox.TObject<{
|
|
579
|
+
userId: _$typebox.TString;
|
|
843
580
|
}>;
|
|
844
|
-
query: _$
|
|
845
|
-
type: _$
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
sort: _$
|
|
850
|
-
userRealm: _$
|
|
851
|
-
resourceType: _$
|
|
852
|
-
resourceId: _$
|
|
853
|
-
success: _$
|
|
854
|
-
page: _$
|
|
855
|
-
size: _$
|
|
856
|
-
from: _$
|
|
857
|
-
to: _$
|
|
581
|
+
query: _$typebox.TObject<{
|
|
582
|
+
type: _$typebox.TOptional<_$typebox.TString>;
|
|
583
|
+
action: _$typebox.TOptional<_$typebox.TString>;
|
|
584
|
+
severity: _$typebox.TOptional<_$typebox.TUnsafe<"info" | "warning" | "critical">>;
|
|
585
|
+
search: _$typebox.TOptional<_$typebox.TString>;
|
|
586
|
+
sort: _$typebox.TOptional<_$typebox.TString>;
|
|
587
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
588
|
+
resourceType: _$typebox.TOptional<_$typebox.TString>;
|
|
589
|
+
resourceId: _$typebox.TOptional<_$typebox.TString>;
|
|
590
|
+
success: _$typebox.TOptional<_$typebox.TBoolean>;
|
|
591
|
+
page: _$typebox.TOptional<_$typebox.TInteger>;
|
|
592
|
+
size: _$typebox.TOptional<_$typebox.TInteger>;
|
|
593
|
+
from: _$typebox.TOptional<_$typebox.TString>;
|
|
594
|
+
to: _$typebox.TOptional<_$typebox.TString>;
|
|
858
595
|
}>;
|
|
859
|
-
response: _$alepha.TPage<_$
|
|
860
|
-
id: PgAttr<PgAttr<_$
|
|
861
|
-
createdAt: PgAttr<PgAttr<_$
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
596
|
+
response: _$alepha.TPage<_$typebox.TObject<{
|
|
597
|
+
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
598
|
+
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
599
|
+
organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
|
|
600
|
+
type: _$typebox.TString;
|
|
601
|
+
action: _$typebox.TString;
|
|
602
|
+
severity: _$alepha_orm0.PgAttr<_$typebox.TUnsafe<"info" | "warning" | "critical">, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
603
|
+
userId: _$typebox.TOptional<_$typebox.TString>;
|
|
604
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
605
|
+
userEmail: _$typebox.TOptional<_$typebox.TString>;
|
|
606
|
+
resourceType: _$typebox.TOptional<_$typebox.TString>;
|
|
607
|
+
resourceId: _$typebox.TOptional<_$typebox.TString>;
|
|
608
|
+
description: _$typebox.TOptional<_$typebox.TString>;
|
|
609
|
+
metadata: _$typebox.TOptional<_$typebox.TRecord<string, _$typebox.TAny>>;
|
|
610
|
+
ipAddress: _$typebox.TOptional<_$typebox.TString>;
|
|
611
|
+
userAgent: _$typebox.TOptional<_$typebox.TString>;
|
|
612
|
+
sessionId: _$typebox.TOptional<_$typebox.TString>;
|
|
613
|
+
requestId: _$typebox.TOptional<_$typebox.TString>;
|
|
614
|
+
success: _$alepha_orm0.PgAttr<_$typebox.TBoolean, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
615
|
+
errorMessage: _$typebox.TOptional<_$typebox.TString>;
|
|
878
616
|
}>>;
|
|
879
617
|
}>;
|
|
880
618
|
/**
|
|
881
619
|
* Get audit entries for a specific resource.
|
|
882
620
|
*/
|
|
883
621
|
readonly findByResource: _$alepha_server0.ActionPrimitiveFn<{
|
|
884
|
-
params: _$
|
|
885
|
-
resourceType: _$
|
|
886
|
-
resourceId: _$
|
|
622
|
+
params: _$typebox.TObject<{
|
|
623
|
+
resourceType: _$typebox.TString;
|
|
624
|
+
resourceId: _$typebox.TString;
|
|
887
625
|
}>;
|
|
888
|
-
query: _$
|
|
889
|
-
type: _$
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
sort: _$
|
|
894
|
-
userId: _$
|
|
895
|
-
userRealm: _$
|
|
896
|
-
success: _$
|
|
897
|
-
page: _$
|
|
898
|
-
size: _$
|
|
899
|
-
from: _$
|
|
900
|
-
to: _$
|
|
626
|
+
query: _$typebox.TObject<{
|
|
627
|
+
type: _$typebox.TOptional<_$typebox.TString>;
|
|
628
|
+
action: _$typebox.TOptional<_$typebox.TString>;
|
|
629
|
+
severity: _$typebox.TOptional<_$typebox.TUnsafe<"info" | "warning" | "critical">>;
|
|
630
|
+
search: _$typebox.TOptional<_$typebox.TString>;
|
|
631
|
+
sort: _$typebox.TOptional<_$typebox.TString>;
|
|
632
|
+
userId: _$typebox.TOptional<_$typebox.TString>;
|
|
633
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
634
|
+
success: _$typebox.TOptional<_$typebox.TBoolean>;
|
|
635
|
+
page: _$typebox.TOptional<_$typebox.TInteger>;
|
|
636
|
+
size: _$typebox.TOptional<_$typebox.TInteger>;
|
|
637
|
+
from: _$typebox.TOptional<_$typebox.TString>;
|
|
638
|
+
to: _$typebox.TOptional<_$typebox.TString>;
|
|
901
639
|
}>;
|
|
902
|
-
response: _$alepha.TPage<_$
|
|
903
|
-
id: PgAttr<PgAttr<_$
|
|
904
|
-
createdAt: PgAttr<PgAttr<_$
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
640
|
+
response: _$alepha.TPage<_$typebox.TObject<{
|
|
641
|
+
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
642
|
+
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
643
|
+
organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
|
|
644
|
+
type: _$typebox.TString;
|
|
645
|
+
action: _$typebox.TString;
|
|
646
|
+
severity: _$alepha_orm0.PgAttr<_$typebox.TUnsafe<"info" | "warning" | "critical">, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
647
|
+
userId: _$typebox.TOptional<_$typebox.TString>;
|
|
648
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
649
|
+
userEmail: _$typebox.TOptional<_$typebox.TString>;
|
|
650
|
+
resourceType: _$typebox.TOptional<_$typebox.TString>;
|
|
651
|
+
resourceId: _$typebox.TOptional<_$typebox.TString>;
|
|
652
|
+
description: _$typebox.TOptional<_$typebox.TString>;
|
|
653
|
+
metadata: _$typebox.TOptional<_$typebox.TRecord<string, _$typebox.TAny>>;
|
|
654
|
+
ipAddress: _$typebox.TOptional<_$typebox.TString>;
|
|
655
|
+
userAgent: _$typebox.TOptional<_$typebox.TString>;
|
|
656
|
+
sessionId: _$typebox.TOptional<_$typebox.TString>;
|
|
657
|
+
requestId: _$typebox.TOptional<_$typebox.TString>;
|
|
658
|
+
success: _$alepha_orm0.PgAttr<_$typebox.TBoolean, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
659
|
+
errorMessage: _$typebox.TOptional<_$typebox.TString>;
|
|
921
660
|
}>>;
|
|
922
661
|
}>;
|
|
923
662
|
/**
|
|
924
663
|
* Get audit statistics.
|
|
925
664
|
*/
|
|
926
665
|
readonly getAuditStats: _$alepha_server0.ActionPrimitiveFn<{
|
|
927
|
-
query: _$
|
|
928
|
-
from: _$
|
|
929
|
-
to: _$
|
|
930
|
-
userRealm: _$
|
|
666
|
+
query: _$typebox.TObject<{
|
|
667
|
+
from: _$typebox.TOptional<_$typebox.TString>;
|
|
668
|
+
to: _$typebox.TOptional<_$typebox.TString>;
|
|
669
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
931
670
|
}>;
|
|
932
|
-
response: _$
|
|
933
|
-
total: _$
|
|
934
|
-
byType: _$
|
|
935
|
-
bySeverity: _$
|
|
936
|
-
info: _$
|
|
937
|
-
warning: _$
|
|
938
|
-
critical: _$
|
|
671
|
+
response: _$typebox.TObject<{
|
|
672
|
+
total: _$typebox.TInteger;
|
|
673
|
+
byType: _$typebox.TRecord<"^.*$", _$typebox.TInteger>;
|
|
674
|
+
bySeverity: _$typebox.TObject<{
|
|
675
|
+
info: _$typebox.TInteger;
|
|
676
|
+
warning: _$typebox.TInteger;
|
|
677
|
+
critical: _$typebox.TInteger;
|
|
939
678
|
}>;
|
|
940
|
-
successRate: _$
|
|
941
|
-
recentFailures: _$
|
|
942
|
-
id: PgAttr<PgAttr<_$
|
|
943
|
-
createdAt: PgAttr<PgAttr<_$
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
679
|
+
successRate: _$typebox.TNumber;
|
|
680
|
+
recentFailures: _$typebox.TArray<_$typebox.TObject<{
|
|
681
|
+
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
682
|
+
createdAt: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_CREATED_AT>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
683
|
+
organizationId: _$alepha_orm0.PgAttr<_$typebox.TString, typeof _$alepha_orm0.PG_ORGANIZATION>;
|
|
684
|
+
type: _$typebox.TString;
|
|
685
|
+
action: _$typebox.TString;
|
|
686
|
+
severity: _$alepha_orm0.PgAttr<_$typebox.TUnsafe<"info" | "warning" | "critical">, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
687
|
+
userId: _$typebox.TOptional<_$typebox.TString>;
|
|
688
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
689
|
+
userEmail: _$typebox.TOptional<_$typebox.TString>;
|
|
690
|
+
resourceType: _$typebox.TOptional<_$typebox.TString>;
|
|
691
|
+
resourceId: _$typebox.TOptional<_$typebox.TString>;
|
|
692
|
+
description: _$typebox.TOptional<_$typebox.TString>;
|
|
693
|
+
metadata: _$typebox.TOptional<_$typebox.TRecord<string, _$typebox.TAny>>;
|
|
694
|
+
ipAddress: _$typebox.TOptional<_$typebox.TString>;
|
|
695
|
+
userAgent: _$typebox.TOptional<_$typebox.TString>;
|
|
696
|
+
sessionId: _$typebox.TOptional<_$typebox.TString>;
|
|
697
|
+
requestId: _$typebox.TOptional<_$typebox.TString>;
|
|
698
|
+
success: _$alepha_orm0.PgAttr<_$typebox.TBoolean, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
699
|
+
errorMessage: _$typebox.TOptional<_$typebox.TString>;
|
|
960
700
|
}>>;
|
|
961
701
|
}>;
|
|
962
702
|
}>;
|
|
@@ -964,21 +704,21 @@ declare class AdminAuditController {
|
|
|
964
704
|
* Get registered audit types.
|
|
965
705
|
*/
|
|
966
706
|
readonly getTypes: _$alepha_server0.ActionPrimitiveFn<{
|
|
967
|
-
response: _$
|
|
968
|
-
type: _$
|
|
969
|
-
description: _$
|
|
970
|
-
actions: _$
|
|
707
|
+
response: _$typebox.TArray<_$typebox.TObject<{
|
|
708
|
+
type: _$typebox.TString;
|
|
709
|
+
description: _$typebox.TOptional<_$typebox.TString>;
|
|
710
|
+
actions: _$typebox.TArray<_$typebox.TString>;
|
|
971
711
|
}>>;
|
|
972
712
|
}>;
|
|
973
713
|
/**
|
|
974
714
|
* Get distinct values for filters.
|
|
975
715
|
*/
|
|
976
716
|
readonly getFilterOptions: _$alepha_server0.ActionPrimitiveFn<{
|
|
977
|
-
response: _$
|
|
978
|
-
types: _$
|
|
979
|
-
actions: _$
|
|
980
|
-
resourceTypes: _$
|
|
981
|
-
userRealms: _$
|
|
717
|
+
response: _$typebox.TObject<{
|
|
718
|
+
types: _$typebox.TArray<_$typebox.TString>;
|
|
719
|
+
actions: _$typebox.TArray<_$typebox.TString>;
|
|
720
|
+
resourceTypes: _$typebox.TArray<_$typebox.TString>;
|
|
721
|
+
userRealms: _$typebox.TArray<_$typebox.TString>;
|
|
982
722
|
}>;
|
|
983
723
|
}>;
|
|
984
724
|
}
|
|
@@ -1096,29 +836,336 @@ declare const $audit: {
|
|
|
1096
836
|
[KIND]: typeof AuditPrimitive;
|
|
1097
837
|
};
|
|
1098
838
|
//#endregion
|
|
839
|
+
//#region ../../src/orm/core/schemas/insertSchema.d.ts
|
|
840
|
+
/**
|
|
841
|
+
* Transforms a TObject schema for insert operations.
|
|
842
|
+
* All default properties at the root level are made optional.
|
|
843
|
+
* Generated columns are excluded entirely.
|
|
844
|
+
*
|
|
845
|
+
* @example
|
|
846
|
+
* Before: { name: string; age: number(default=0); fullName: generated }
|
|
847
|
+
* After: { name: string; age?: number; }
|
|
848
|
+
*/
|
|
849
|
+
type TObjectInsert<T extends TObject> = TObject<{ [K in keyof T["properties"] as T["properties"][K] extends {
|
|
850
|
+
[PG_GENERATED]: any;
|
|
851
|
+
} ? never : K]: T["properties"][K] extends {
|
|
852
|
+
[PG_DEFAULT]: any;
|
|
853
|
+
} | {
|
|
854
|
+
[PG_ORGANIZATION]: any;
|
|
855
|
+
} | {
|
|
856
|
+
"~optional": true;
|
|
857
|
+
} ? TOptional<T["properties"][K]> : T["properties"][K] }>;
|
|
858
|
+
//#endregion
|
|
859
|
+
//#region ../../src/orm/core/schemas/updateSchema.d.ts
|
|
860
|
+
/**
|
|
861
|
+
* Transforms a TObject schema for update operations.
|
|
862
|
+
* All optional properties at the root level are made nullable (i.e., `T | null`).
|
|
863
|
+
* Generated columns are excluded entirely.
|
|
864
|
+
*
|
|
865
|
+
* @example
|
|
866
|
+
* Before: { name?: string; age: number; fullName: generated }
|
|
867
|
+
* After: { name?: string | null; age: number; }
|
|
868
|
+
*/
|
|
869
|
+
type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["properties"] as T["properties"][K] extends {
|
|
870
|
+
[PG_GENERATED]: any;
|
|
871
|
+
} ? never : K]: T["properties"][K] extends TOptional<infer U> ? TOptional<TUnion<[U, TNull]>> : T["properties"][K] }>;
|
|
872
|
+
//#endregion
|
|
873
|
+
//#region ../../src/orm/core/primitives/$entity.d.ts
|
|
874
|
+
interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
|
|
875
|
+
/**
|
|
876
|
+
* The database table name that will be created for this entity.
|
|
877
|
+
* If not provided, name will be inferred from the $repository variable name.
|
|
878
|
+
*/
|
|
879
|
+
name: string;
|
|
880
|
+
/**
|
|
881
|
+
* TypeBox schema defining the table structure and column types.
|
|
882
|
+
*/
|
|
883
|
+
schema: T;
|
|
884
|
+
/**
|
|
885
|
+
* Database indexes to create for query optimization.
|
|
886
|
+
*/
|
|
887
|
+
indexes?: (Keys | {
|
|
888
|
+
/**
|
|
889
|
+
* Single column to index.
|
|
890
|
+
*/
|
|
891
|
+
column: Keys;
|
|
892
|
+
/**
|
|
893
|
+
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
894
|
+
*/
|
|
895
|
+
unique?: boolean;
|
|
896
|
+
/**
|
|
897
|
+
* Custom name for the index. If not provided, generates name automatically.
|
|
898
|
+
*/
|
|
899
|
+
name?: string;
|
|
900
|
+
/**
|
|
901
|
+
* Partial index condition. Only rows matching this SQL expression are indexed.
|
|
902
|
+
*/
|
|
903
|
+
where?: SQL;
|
|
904
|
+
} | {
|
|
905
|
+
/**
|
|
906
|
+
* Multiple columns for composite index (order matters for query optimization).
|
|
907
|
+
*/
|
|
908
|
+
columns: Keys[];
|
|
909
|
+
/**
|
|
910
|
+
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
911
|
+
*/
|
|
912
|
+
unique?: boolean;
|
|
913
|
+
/**
|
|
914
|
+
* Custom name for the index. If not provided, generates name automatically.
|
|
915
|
+
*/
|
|
916
|
+
name?: string;
|
|
917
|
+
/**
|
|
918
|
+
* Partial index condition. Only rows matching this SQL expression are indexed.
|
|
919
|
+
*/
|
|
920
|
+
where?: SQL;
|
|
921
|
+
} | {
|
|
922
|
+
/**
|
|
923
|
+
* SQL expressions for expression-based indexes.
|
|
924
|
+
*
|
|
925
|
+
* Can include column references and SQL functions like `LOWER()`, `UPPER()`, etc.
|
|
926
|
+
* Columns and expressions can be mixed together.
|
|
927
|
+
*
|
|
928
|
+
* @example
|
|
929
|
+
* ```ts
|
|
930
|
+
* // Case-insensitive unique username per realm
|
|
931
|
+
* indexes: [{
|
|
932
|
+
* expressions: (self) => [self.realm, sql`LOWER(${self.username})`],
|
|
933
|
+
* unique: true,
|
|
934
|
+
* name: "users_realm_username_lower_idx",
|
|
935
|
+
* }]
|
|
936
|
+
* ```
|
|
937
|
+
*/
|
|
938
|
+
expressions: (self: Record<Keys & string, any>) => (SQL | any)[];
|
|
939
|
+
/**
|
|
940
|
+
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
941
|
+
*/
|
|
942
|
+
unique?: boolean;
|
|
943
|
+
/**
|
|
944
|
+
* Custom name for the index. If not provided, generates name automatically.
|
|
945
|
+
*/
|
|
946
|
+
name: string;
|
|
947
|
+
/**
|
|
948
|
+
* Partial index condition. Only rows matching this SQL expression are indexed.
|
|
949
|
+
*/
|
|
950
|
+
where?: SQL;
|
|
951
|
+
})[];
|
|
952
|
+
/**
|
|
953
|
+
* Foreign key constraints to maintain referential integrity.
|
|
954
|
+
*/
|
|
955
|
+
foreignKeys?: Array<{
|
|
956
|
+
/**
|
|
957
|
+
* Optional name for the foreign key constraint.
|
|
958
|
+
*/
|
|
959
|
+
name?: string;
|
|
960
|
+
/**
|
|
961
|
+
* Local columns that reference the foreign table.
|
|
962
|
+
*/
|
|
963
|
+
columns: Array<keyof Static<T>>;
|
|
964
|
+
/**
|
|
965
|
+
* Referenced columns in the foreign table.
|
|
966
|
+
* Must be EntityColumn references from other entities.
|
|
967
|
+
*/
|
|
968
|
+
foreignColumns: Array<() => EntityColumn<any>>;
|
|
969
|
+
}>;
|
|
970
|
+
/**
|
|
971
|
+
* Additional table constraints for data validation.
|
|
972
|
+
*
|
|
973
|
+
* Constraints enforce business rules at the database level, providing
|
|
974
|
+
* an additional layer of data integrity beyond application validation.
|
|
975
|
+
*
|
|
976
|
+
* **Constraint Types**:
|
|
977
|
+
* - **Unique constraints**: Prevent duplicate values across columns
|
|
978
|
+
* - **Check constraints**: Enforce custom validation rules with SQL expressions
|
|
979
|
+
*
|
|
980
|
+
* @example
|
|
981
|
+
* ```ts
|
|
982
|
+
* constraints: [
|
|
983
|
+
* {
|
|
984
|
+
* name: "unique_user_email",
|
|
985
|
+
* columns: ["email"],
|
|
986
|
+
* unique: true
|
|
987
|
+
* },
|
|
988
|
+
* {
|
|
989
|
+
* name: "valid_age_range",
|
|
990
|
+
* columns: ["age"],
|
|
991
|
+
* check: sql`age >= 0 AND age <= 150`
|
|
992
|
+
* },
|
|
993
|
+
* {
|
|
994
|
+
* name: "unique_user_username_per_tenant",
|
|
995
|
+
* columns: ["tenantId", "username"],
|
|
996
|
+
* unique: true
|
|
997
|
+
* }
|
|
998
|
+
* ]
|
|
999
|
+
* ```
|
|
1000
|
+
*/
|
|
1001
|
+
constraints?: Array<{
|
|
1002
|
+
/**
|
|
1003
|
+
* Columns involved in this constraint.
|
|
1004
|
+
*/
|
|
1005
|
+
columns: Array<keyof Static<T>>;
|
|
1006
|
+
/**
|
|
1007
|
+
* Optional name for the constraint.
|
|
1008
|
+
*/
|
|
1009
|
+
name?: string;
|
|
1010
|
+
/**
|
|
1011
|
+
* Whether this is a unique constraint.
|
|
1012
|
+
*/
|
|
1013
|
+
unique?: boolean | {};
|
|
1014
|
+
/**
|
|
1015
|
+
* SQL expression for check constraint validation.
|
|
1016
|
+
*/
|
|
1017
|
+
check?: SQL;
|
|
1018
|
+
}>;
|
|
1019
|
+
/**
|
|
1020
|
+
* Advanced Drizzle ORM configuration for complex table setups.
|
|
1021
|
+
*/
|
|
1022
|
+
config?: (self: BuildExtraConfigColumns<string, FromSchema<T>, "pg">) => PgTableExtraConfigValue[];
|
|
1023
|
+
}
|
|
1024
|
+
declare class EntityPrimitive<T extends TObject = TObject> {
|
|
1025
|
+
readonly options: EntityPrimitiveOptions<T>;
|
|
1026
|
+
constructor(options: EntityPrimitiveOptions<T>);
|
|
1027
|
+
alias(alias: string): this;
|
|
1028
|
+
get cols(): EntityColumns<T>;
|
|
1029
|
+
get name(): string;
|
|
1030
|
+
get schema(): T;
|
|
1031
|
+
get insertSchema(): TObjectInsert<T>;
|
|
1032
|
+
get updateSchema(): TObjectUpdate<T>;
|
|
1033
|
+
}
|
|
1034
|
+
/**
|
|
1035
|
+
* Convert a schema to columns.
|
|
1036
|
+
*/
|
|
1037
|
+
type FromSchema<T extends TObject> = { [key in keyof T["properties"]]: PgColumnBuilderBase };
|
|
1038
|
+
type EntityColumn<T extends TObject> = {
|
|
1039
|
+
name: string;
|
|
1040
|
+
entity: EntityPrimitive<T>;
|
|
1041
|
+
};
|
|
1042
|
+
type EntityColumns<T extends TObject> = { [key in keyof T["properties"]]: EntityColumn<T> };
|
|
1043
|
+
//#endregion
|
|
1044
|
+
//#region ../../src/orm/core/constants/PG_SYMBOLS.d.ts
|
|
1045
|
+
declare const PG_DEFAULT: unique symbol;
|
|
1046
|
+
declare const PG_PRIMARY_KEY: unique symbol;
|
|
1047
|
+
declare const PG_CREATED_AT: unique symbol;
|
|
1048
|
+
declare const PG_UPDATED_AT: unique symbol;
|
|
1049
|
+
declare const PG_DELETED_AT: unique symbol;
|
|
1050
|
+
declare const PG_VERSION: unique symbol;
|
|
1051
|
+
declare const PG_IDENTITY: unique symbol;
|
|
1052
|
+
declare const PG_ENUM: unique symbol;
|
|
1053
|
+
declare const PG_REF: unique symbol;
|
|
1054
|
+
declare const PG_GENERATED: unique symbol;
|
|
1055
|
+
declare const PG_ORGANIZATION: unique symbol;
|
|
1056
|
+
/**
|
|
1057
|
+
* @deprecated Use `PG_IDENTITY` instead.
|
|
1058
|
+
*/
|
|
1059
|
+
declare const PG_SERIAL: unique symbol;
|
|
1060
|
+
type PgSymbols = {
|
|
1061
|
+
[PG_DEFAULT]: {};
|
|
1062
|
+
[PG_PRIMARY_KEY]: {};
|
|
1063
|
+
[PG_CREATED_AT]: {};
|
|
1064
|
+
[PG_UPDATED_AT]: {};
|
|
1065
|
+
[PG_DELETED_AT]: {};
|
|
1066
|
+
[PG_VERSION]: {};
|
|
1067
|
+
[PG_IDENTITY]: PgIdentityOptions;
|
|
1068
|
+
[PG_REF]: PgRefOptions;
|
|
1069
|
+
[PG_ENUM]: PgEnumOptions;
|
|
1070
|
+
[PG_GENERATED]: PgGeneratedOptions;
|
|
1071
|
+
[PG_ORGANIZATION]: {};
|
|
1072
|
+
/**
|
|
1073
|
+
* @deprecated Use `PG_IDENTITY` instead.
|
|
1074
|
+
*/
|
|
1075
|
+
[PG_SERIAL]: {};
|
|
1076
|
+
};
|
|
1077
|
+
type PgSymbolKeys = keyof PgSymbols;
|
|
1078
|
+
type PgIdentityOptions = {
|
|
1079
|
+
mode: "always" | "byDefault";
|
|
1080
|
+
} & PgSequenceOptions & {
|
|
1081
|
+
name?: string;
|
|
1082
|
+
};
|
|
1083
|
+
interface PgEnumOptions {
|
|
1084
|
+
name?: string;
|
|
1085
|
+
description?: string;
|
|
1086
|
+
}
|
|
1087
|
+
interface PgGeneratedOptions {
|
|
1088
|
+
/**
|
|
1089
|
+
* SQL expression for the generated column.
|
|
1090
|
+
*/
|
|
1091
|
+
expression: SQL;
|
|
1092
|
+
/**
|
|
1093
|
+
* Storage mode for the generated column.
|
|
1094
|
+
* - `"stored"` — value is computed on write and stored on disk (default for PostgreSQL).
|
|
1095
|
+
* - `"virtual"` — value is computed on read (default for SQLite).
|
|
1096
|
+
*/
|
|
1097
|
+
mode?: "stored" | "virtual";
|
|
1098
|
+
}
|
|
1099
|
+
interface PgRefOptions {
|
|
1100
|
+
ref: () => {
|
|
1101
|
+
name: string;
|
|
1102
|
+
entity: EntityPrimitive;
|
|
1103
|
+
};
|
|
1104
|
+
actions?: {
|
|
1105
|
+
onUpdate?: UpdateDeleteAction;
|
|
1106
|
+
onDelete?: UpdateDeleteAction;
|
|
1107
|
+
};
|
|
1108
|
+
}
|
|
1109
|
+
//#endregion
|
|
1110
|
+
//#region ../../src/orm/core/helpers/pgAttr.d.ts
|
|
1111
|
+
/**
|
|
1112
|
+
* Type representation.
|
|
1113
|
+
*/
|
|
1114
|
+
type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
|
|
1115
|
+
//#endregion
|
|
1116
|
+
//#region ../../src/orm/core/schemas/databaseEnvSchema.d.ts
|
|
1117
|
+
/**
|
|
1118
|
+
* Base database environment schema.
|
|
1119
|
+
*
|
|
1120
|
+
* Defines the `DATABASE_URL` connection string used by all ORM providers
|
|
1121
|
+
* to determine the database driver and connection target.
|
|
1122
|
+
*
|
|
1123
|
+
* Supported URL formats:
|
|
1124
|
+
* - `sqlite://:memory:` or `sqlite://./path/to/db` — SQLite (Node.js or Bun)
|
|
1125
|
+
* - `postgres://user:password@host:port/database` — PostgreSQL (Node.js or Bun)
|
|
1126
|
+
* - `pglite://:memory:` or `pglite://./path` — PGlite (embedded Postgres)
|
|
1127
|
+
* - `d1://BINDING_NAME` — Cloudflare D1
|
|
1128
|
+
* - `hyperdrive://BINDING_NAME` — Cloudflare Hyperdrive
|
|
1129
|
+
*/
|
|
1130
|
+
declare const databaseEnvSchema: _$typebox.TObject<{
|
|
1131
|
+
DATABASE_URL: _$typebox.TOptional<_$typebox.TString>;
|
|
1132
|
+
/**
|
|
1133
|
+
* Enable or disable push-based schema synchronization (drizzle-kit push).
|
|
1134
|
+
*
|
|
1135
|
+
* Defaults to `true` in development and test, `false` in production.
|
|
1136
|
+
* Set to `false` in development to skip automatic schema sync
|
|
1137
|
+
* (e.g. when managing migrations manually).
|
|
1138
|
+
*/
|
|
1139
|
+
DATABASE_SYNC: _$typebox.TOptional<_$typebox.TBoolean>;
|
|
1140
|
+
}>;
|
|
1141
|
+
declare module "alepha" {
|
|
1142
|
+
interface Env extends Partial<Static<typeof databaseEnvSchema>> {}
|
|
1143
|
+
} //# sourceMappingURL=databaseEnvSchema.d.ts.map
|
|
1144
|
+
//#endregion
|
|
1099
1145
|
//#region ../../src/api/audits/schemas/auditResourceSchema.d.ts
|
|
1100
1146
|
/**
|
|
1101
1147
|
* Resource schema for audit log responses.
|
|
1102
1148
|
*/
|
|
1103
|
-
declare const auditResourceSchema: _$
|
|
1104
|
-
id: PgAttr<PgAttr<_$
|
|
1105
|
-
createdAt: PgAttr<PgAttr<_$
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1149
|
+
declare const auditResourceSchema: _$typebox.TObject<{
|
|
1150
|
+
id: PgAttr<PgAttr<_$typebox.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1151
|
+
createdAt: PgAttr<PgAttr<_$typebox.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1152
|
+
organizationId: PgAttr<_$typebox.TString, typeof PG_ORGANIZATION>;
|
|
1153
|
+
type: _$typebox.TString;
|
|
1154
|
+
action: _$typebox.TString;
|
|
1155
|
+
severity: PgAttr<_$typebox.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
1156
|
+
userId: _$typebox.TOptional<_$typebox.TString>;
|
|
1157
|
+
userRealm: _$typebox.TOptional<_$typebox.TString>;
|
|
1158
|
+
userEmail: _$typebox.TOptional<_$typebox.TString>;
|
|
1159
|
+
resourceType: _$typebox.TOptional<_$typebox.TString>;
|
|
1160
|
+
resourceId: _$typebox.TOptional<_$typebox.TString>;
|
|
1161
|
+
description: _$typebox.TOptional<_$typebox.TString>;
|
|
1162
|
+
metadata: _$typebox.TOptional<_$typebox.TRecord<string, _$typebox.TAny>>;
|
|
1163
|
+
ipAddress: _$typebox.TOptional<_$typebox.TString>;
|
|
1164
|
+
userAgent: _$typebox.TOptional<_$typebox.TString>;
|
|
1165
|
+
sessionId: _$typebox.TOptional<_$typebox.TString>;
|
|
1166
|
+
requestId: _$typebox.TOptional<_$typebox.TString>;
|
|
1167
|
+
success: PgAttr<_$typebox.TBoolean, typeof PG_DEFAULT>;
|
|
1168
|
+
errorMessage: _$typebox.TOptional<_$typebox.TString>;
|
|
1122
1169
|
}>;
|
|
1123
1170
|
type AuditResource = Static<typeof auditResourceSchema>;
|
|
1124
1171
|
//#endregion
|