alepha 0.14.3 → 0.15.0
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 +2 -5
- package/dist/api/audits/index.d.ts +620 -811
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/files/index.d.ts +185 -377
- package/dist/api/files/index.d.ts.map +1 -1
- package/dist/api/files/index.js +0 -1
- package/dist/api/files/index.js.map +1 -1
- package/dist/api/jobs/index.d.ts +245 -435
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/notifications/index.d.ts +238 -429
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/parameters/index.d.ts +236 -427
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/users/index.browser.js +1 -2
- package/dist/api/users/index.browser.js.map +1 -1
- package/dist/api/users/index.d.ts +1010 -1196
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +178 -151
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/verifications/index.d.ts +17 -17
- package/dist/api/verifications/index.d.ts.map +1 -1
- package/dist/batch/index.d.ts +122 -122
- package/dist/batch/index.d.ts.map +1 -1
- package/dist/batch/index.js +1 -2
- package/dist/batch/index.js.map +1 -1
- package/dist/bucket/index.d.ts +163 -163
- package/dist/bucket/index.d.ts.map +1 -1
- package/dist/cache/core/index.d.ts +46 -46
- package/dist/cache/core/index.d.ts.map +1 -1
- package/dist/cache/redis/index.d.ts.map +1 -1
- package/dist/cli/index.d.ts +384 -285
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +1113 -623
- package/dist/cli/index.js.map +1 -1
- package/dist/command/index.d.ts +299 -300
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +13 -9
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +445 -103
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +733 -625
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +446 -103
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +445 -103
- package/dist/core/index.native.js.map +1 -1
- package/dist/datetime/index.d.ts +44 -44
- package/dist/datetime/index.d.ts.map +1 -1
- package/dist/datetime/index.js +4 -4
- package/dist/datetime/index.js.map +1 -1
- package/dist/email/index.d.ts +97 -50
- package/dist/email/index.d.ts.map +1 -1
- package/dist/email/index.js +129 -33
- package/dist/email/index.js.map +1 -1
- package/dist/fake/index.d.ts +7981 -14
- package/dist/fake/index.d.ts.map +1 -1
- package/dist/file/index.d.ts +523 -390
- package/dist/file/index.d.ts.map +1 -1
- package/dist/file/index.js +253 -1
- package/dist/file/index.js.map +1 -1
- package/dist/lock/core/index.d.ts +208 -208
- package/dist/lock/core/index.d.ts.map +1 -1
- package/dist/lock/redis/index.d.ts.map +1 -1
- package/dist/logger/index.d.ts +25 -26
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +12 -2
- package/dist/logger/index.js.map +1 -1
- package/dist/mcp/index.d.ts +197 -197
- 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/chunk-DtkW-qnP.js +38 -0
- package/dist/orm/index.browser.js.map +1 -1
- package/dist/orm/index.bun.js +2814 -0
- package/dist/orm/index.bun.js.map +1 -0
- package/dist/orm/index.d.ts +1228 -1216
- package/dist/orm/index.d.ts.map +1 -1
- package/dist/orm/index.js +2041 -1967
- package/dist/orm/index.js.map +1 -1
- package/dist/queue/core/index.d.ts +248 -248
- package/dist/queue/core/index.d.ts.map +1 -1
- package/dist/queue/redis/index.d.ts.map +1 -1
- package/dist/redis/index.bun.js +285 -0
- package/dist/redis/index.bun.js.map +1 -0
- package/dist/redis/index.d.ts +118 -136
- package/dist/redis/index.d.ts.map +1 -1
- package/dist/redis/index.js +18 -38
- package/dist/redis/index.js.map +1 -1
- package/dist/retry/index.d.ts +69 -69
- package/dist/retry/index.d.ts.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 +25 -25
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/security/index.browser.js +5 -1
- package/dist/security/index.browser.js.map +1 -1
- package/dist/security/index.d.ts +417 -254
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +386 -86
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.d.ts +110 -110
- package/dist/server/auth/index.d.ts.map +1 -1
- package/dist/server/auth/index.js +20 -20
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cache/index.d.ts +62 -47
- package/dist/server/cache/index.d.ts.map +1 -1
- package/dist/server/cache/index.js +56 -3
- package/dist/server/cache/index.js.map +1 -1
- package/dist/server/compress/index.d.ts +6 -0
- package/dist/server/compress/index.d.ts.map +1 -1
- package/dist/server/compress/index.js +36 -1
- package/dist/server/compress/index.js.map +1 -1
- package/dist/server/cookies/index.d.ts +6 -6
- package/dist/server/cookies/index.d.ts.map +1 -1
- package/dist/server/cookies/index.js +3 -3
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/server/core/index.browser.js +2 -2
- package/dist/server/core/index.browser.js.map +1 -1
- package/dist/server/core/index.d.ts +242 -150
- package/dist/server/core/index.d.ts.map +1 -1
- package/dist/server/core/index.js +294 -125
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/cors/index.d.ts +11 -12
- package/dist/server/cors/index.d.ts.map +1 -1
- package/dist/server/health/index.d.ts +0 -1
- package/dist/server/health/index.d.ts.map +1 -1
- package/dist/server/helmet/index.d.ts +2 -2
- package/dist/server/helmet/index.d.ts.map +1 -1
- package/dist/server/links/index.browser.js.map +1 -1
- package/dist/server/links/index.d.ts +123 -124
- package/dist/server/links/index.d.ts.map +1 -1
- package/dist/server/links/index.js +1 -2
- package/dist/server/links/index.js.map +1 -1
- package/dist/server/metrics/index.d.ts.map +1 -1
- package/dist/server/multipart/index.d.ts +6 -6
- package/dist/server/multipart/index.d.ts.map +1 -1
- package/dist/server/proxy/index.d.ts +102 -103
- package/dist/server/proxy/index.d.ts.map +1 -1
- package/dist/server/rate-limit/index.d.ts +16 -16
- package/dist/server/rate-limit/index.d.ts.map +1 -1
- package/dist/server/static/index.d.ts +44 -44
- package/dist/server/static/index.d.ts.map +1 -1
- package/dist/server/static/index.js +4 -0
- package/dist/server/static/index.js.map +1 -1
- package/dist/server/swagger/index.d.ts +48 -49
- package/dist/server/swagger/index.d.ts.map +1 -1
- package/dist/server/swagger/index.js +3 -5
- package/dist/server/swagger/index.js.map +1 -1
- package/dist/sms/index.d.ts +13 -11
- package/dist/sms/index.d.ts.map +1 -1
- package/dist/sms/index.js +7 -7
- package/dist/sms/index.js.map +1 -1
- package/dist/thread/index.d.ts +71 -72
- package/dist/thread/index.d.ts.map +1 -1
- package/dist/topic/core/index.d.ts +318 -318
- package/dist/topic/core/index.d.ts.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 +5805 -249
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +599 -513
- package/dist/vite/index.js.map +1 -1
- package/dist/websocket/index.browser.js +6 -6
- package/dist/websocket/index.browser.js.map +1 -1
- package/dist/websocket/index.d.ts +247 -247
- package/dist/websocket/index.d.ts.map +1 -1
- package/dist/websocket/index.js +6 -6
- package/dist/websocket/index.js.map +1 -1
- package/package.json +9 -14
- package/src/api/files/controllers/AdminFileStatsController.ts +0 -1
- package/src/api/users/atoms/realmAuthSettingsAtom.ts +5 -0
- package/src/api/users/controllers/{UserRealmController.ts → RealmController.ts} +11 -11
- package/src/api/users/entities/users.ts +1 -1
- package/src/api/users/index.ts +8 -8
- package/src/api/users/primitives/{$userRealm.ts → $realm.ts} +17 -19
- package/src/api/users/providers/{UserRealmProvider.ts → RealmProvider.ts} +26 -30
- package/src/api/users/schemas/{userRealmConfigSchema.ts → realmConfigSchema.ts} +2 -2
- package/src/api/users/services/CredentialService.ts +7 -7
- package/src/api/users/services/IdentityService.ts +4 -4
- package/src/api/users/services/RegistrationService.spec.ts +25 -27
- package/src/api/users/services/RegistrationService.ts +38 -27
- package/src/api/users/services/SessionCrudService.ts +3 -3
- package/src/api/users/services/SessionService.spec.ts +3 -3
- package/src/api/users/services/SessionService.ts +28 -9
- package/src/api/users/services/UserService.ts +7 -7
- package/src/batch/providers/BatchProvider.ts +1 -2
- package/src/cli/apps/AlephaCli.ts +0 -2
- package/src/cli/apps/AlephaPackageBuilderCli.ts +38 -19
- package/src/cli/assets/apiHelloControllerTs.ts +18 -0
- package/src/cli/assets/apiIndexTs.ts +16 -0
- package/src/cli/assets/claudeMd.ts +303 -0
- package/src/cli/assets/mainBrowserTs.ts +2 -2
- package/src/cli/assets/mainServerTs.ts +24 -0
- package/src/cli/assets/webAppRouterTs.ts +15 -0
- package/src/cli/assets/webHelloComponentTsx.ts +16 -0
- package/src/cli/assets/webIndexTs.ts +16 -0
- package/src/cli/atoms/buildOptions.ts +88 -0
- package/src/cli/commands/build.ts +70 -87
- package/src/cli/commands/db.ts +21 -22
- package/src/cli/commands/deploy.ts +17 -5
- package/src/cli/commands/dev.ts +22 -14
- package/src/cli/commands/format.ts +8 -2
- package/src/cli/commands/gen/env.ts +53 -0
- package/src/cli/commands/gen/openapi.ts +1 -1
- package/src/cli/commands/gen/resource.ts +15 -0
- package/src/cli/commands/gen.ts +7 -1
- package/src/cli/commands/init.ts +74 -30
- package/src/cli/commands/lint.ts +8 -2
- package/src/cli/commands/test.ts +8 -3
- package/src/cli/commands/typecheck.ts +5 -1
- package/src/cli/commands/verify.ts +5 -3
- package/src/cli/defineConfig.ts +49 -7
- package/src/cli/index.ts +0 -1
- package/src/cli/services/AlephaCliUtils.ts +39 -589
- package/src/cli/services/PackageManagerUtils.ts +301 -0
- package/src/cli/services/ProjectScaffolder.ts +306 -0
- package/src/command/helpers/Runner.spec.ts +2 -2
- package/src/command/helpers/Runner.ts +16 -4
- package/src/command/primitives/$command.ts +0 -6
- package/src/command/providers/CliProvider.ts +1 -3
- package/src/core/Alepha.ts +42 -0
- package/src/core/__tests__/Alepha-graph.spec.ts +4 -0
- package/src/core/index.shared.ts +1 -0
- package/src/core/index.ts +2 -0
- package/src/core/primitives/$hook.ts +6 -2
- package/src/core/primitives/$module.spec.ts +4 -0
- package/src/core/providers/AlsProvider.ts +1 -1
- package/src/core/providers/CodecManager.spec.ts +12 -6
- package/src/core/providers/CodecManager.ts +26 -6
- package/src/core/providers/EventManager.ts +169 -13
- package/src/core/providers/KeylessJsonSchemaCodec.spec.ts +621 -0
- package/src/core/providers/KeylessJsonSchemaCodec.ts +407 -0
- package/src/core/providers/StateManager.spec.ts +27 -16
- package/src/email/providers/LocalEmailProvider.spec.ts +111 -87
- package/src/email/providers/LocalEmailProvider.ts +52 -15
- package/src/email/providers/NodemailerEmailProvider.ts +167 -56
- package/src/file/errors/FileError.ts +7 -0
- package/src/file/index.ts +9 -1
- package/src/file/providers/MemoryFileSystemProvider.ts +393 -0
- package/src/logger/index.ts +15 -3
- package/src/mcp/transports/StdioMcpTransport.ts +1 -1
- package/src/orm/index.browser.ts +1 -19
- package/src/orm/index.bun.ts +77 -0
- package/src/orm/index.shared-server.ts +22 -0
- package/src/orm/index.shared.ts +15 -0
- package/src/orm/index.ts +13 -39
- package/src/orm/providers/drivers/BunPostgresProvider.ts +3 -5
- package/src/orm/providers/drivers/BunSqliteProvider.ts +1 -1
- package/src/orm/providers/drivers/CloudflareD1Provider.ts +4 -0
- package/src/orm/providers/drivers/DatabaseProvider.ts +4 -0
- package/src/orm/providers/drivers/PglitePostgresProvider.ts +4 -0
- package/src/orm/services/Repository.ts +8 -0
- package/src/queue/core/providers/WorkerProvider.spec.ts +48 -32
- package/src/redis/index.bun.ts +35 -0
- package/src/redis/providers/BunRedisProvider.ts +12 -43
- package/src/redis/providers/BunRedisSubscriberProvider.ts +2 -3
- package/src/redis/providers/NodeRedisProvider.ts +16 -34
- package/src/{server/security → security}/__tests__/BasicAuth.spec.ts +11 -11
- package/src/{server/security → security}/__tests__/ServerSecurityProvider-realm.spec.ts +21 -16
- package/src/{server/security/providers → security/__tests__}/ServerSecurityProvider.spec.ts +5 -5
- package/src/security/index.browser.ts +5 -0
- package/src/security/index.ts +90 -7
- package/src/security/primitives/{$realm.spec.ts → $issuer.spec.ts} +11 -11
- package/src/security/primitives/{$realm.ts → $issuer.ts} +20 -17
- package/src/security/primitives/$role.ts +5 -5
- package/src/security/primitives/$serviceAccount.spec.ts +5 -5
- package/src/security/primitives/$serviceAccount.ts +3 -3
- package/src/{server/security → security}/providers/ServerSecurityProvider.ts +5 -7
- package/src/server/auth/primitives/$auth.ts +10 -10
- package/src/server/auth/primitives/$authCredentials.ts +3 -3
- package/src/server/auth/primitives/$authGithub.ts +3 -3
- package/src/server/auth/primitives/$authGoogle.ts +3 -3
- package/src/server/auth/providers/ServerAuthProvider.ts +13 -13
- package/src/server/cache/providers/ServerCacheProvider.spec.ts +183 -0
- package/src/server/cache/providers/ServerCacheProvider.ts +95 -10
- package/src/server/compress/providers/ServerCompressProvider.ts +61 -2
- package/src/server/cookies/providers/ServerCookiesProvider.ts +3 -3
- package/src/server/core/helpers/ServerReply.ts +2 -2
- package/src/server/core/providers/NodeHttpServerProvider.ts +25 -6
- package/src/server/core/providers/ServerBodyParserProvider.ts +19 -23
- package/src/server/core/providers/ServerLoggerProvider.ts +23 -19
- package/src/server/core/providers/ServerProvider.ts +155 -22
- package/src/server/core/providers/ServerRouterProvider.ts +259 -115
- package/src/server/core/providers/ServerTimingProvider.ts +2 -2
- package/src/server/links/index.ts +1 -1
- package/src/server/links/providers/LinkProvider.ts +1 -1
- package/src/server/static/providers/ServerStaticProvider.ts +10 -0
- package/src/server/swagger/index.ts +1 -1
- package/src/server/swagger/providers/ServerSwaggerProvider.ts +5 -8
- package/src/sms/providers/LocalSmsProvider.spec.ts +153 -111
- package/src/sms/providers/LocalSmsProvider.ts +8 -7
- package/src/vite/helpers/boot.ts +28 -17
- package/src/vite/helpers/importViteReact.ts +13 -0
- package/src/vite/index.ts +1 -21
- package/src/vite/plugins/viteAlephaDev.ts +16 -1
- package/src/vite/plugins/viteAlephaSsrPreload.ts +222 -0
- package/src/vite/tasks/buildClient.ts +11 -0
- package/src/vite/tasks/buildServer.ts +59 -4
- package/src/vite/tasks/devServer.ts +71 -0
- package/src/vite/tasks/generateCloudflare.ts +7 -0
- package/src/vite/tasks/index.ts +2 -1
- package/dist/server/security/index.browser.js +0 -13
- package/dist/server/security/index.browser.js.map +0 -1
- package/dist/server/security/index.d.ts +0 -173
- package/dist/server/security/index.d.ts.map +0 -1
- package/dist/server/security/index.js +0 -311
- package/dist/server/security/index.js.map +0 -1
- package/src/cli/assets/appRouterTs.ts +0 -9
- package/src/cli/assets/mainTs.ts +0 -13
- package/src/cli/assets/viteConfigTs.ts +0 -14
- package/src/cli/commands/run.ts +0 -24
- package/src/server/security/index.browser.ts +0 -10
- package/src/server/security/index.ts +0 -94
- package/src/vite/plugins/viteAlepha.ts +0 -37
- package/src/vite/plugins/viteAlephaBuild.ts +0 -281
- /package/src/{server/security → security}/primitives/$basicAuth.ts +0 -0
- /package/src/{server/security → security}/providers/ServerBasicAuthProvider.ts +0 -0
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha381 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_orm12 from "alepha/orm";
|
|
6
6
|
import { Page } from "alepha/orm";
|
|
7
7
|
import * as alepha_logger0 from "alepha/logger";
|
|
8
|
-
import "bun";
|
|
9
|
-
import "bun:sqlite";
|
|
10
|
-
import "drizzle-orm/bun-sql";
|
|
11
|
-
import "drizzle-orm/bun-sqlite";
|
|
12
8
|
import "drizzle-orm/d1";
|
|
13
9
|
import { BuildExtraConfigColumns, SQL } from "drizzle-orm";
|
|
14
10
|
import { PgColumnBuilderBase, PgSequenceOptions, PgTableExtraConfigValue, UpdateDeleteAction } from "drizzle-orm/pg-core";
|
|
15
11
|
import "alepha/datetime";
|
|
16
12
|
import "alepha/retry";
|
|
17
|
-
import "alepha/lock";
|
|
18
13
|
import "drizzle-orm/sqlite-core";
|
|
19
|
-
import "drizzle-orm/postgres-js";
|
|
20
|
-
import "postgres";
|
|
21
14
|
|
|
22
15
|
//#region ../../src/orm/schemas/insertSchema.d.ts
|
|
23
16
|
/**
|
|
@@ -49,114 +42,114 @@ type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["properties"]]:
|
|
|
49
42
|
//#region ../../src/orm/primitives/$entity.d.ts
|
|
50
43
|
interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
|
|
51
44
|
/**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
+
*/
|
|
55
48
|
name: string;
|
|
56
49
|
/**
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
* TypeBox schema defining the table structure and column types.
|
|
51
|
+
*/
|
|
59
52
|
schema: T;
|
|
60
53
|
/**
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
* Database indexes to create for query optimization.
|
|
55
|
+
*/
|
|
63
56
|
indexes?: (Keys | {
|
|
64
57
|
/**
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
* Single column to index.
|
|
59
|
+
*/
|
|
67
60
|
column: Keys;
|
|
68
61
|
/**
|
|
69
|
-
|
|
70
|
-
|
|
62
|
+
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
63
|
+
*/
|
|
71
64
|
unique?: boolean;
|
|
72
65
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
66
|
+
* Custom name for the index. If not provided, generates name automatically.
|
|
67
|
+
*/
|
|
75
68
|
name?: string;
|
|
76
69
|
} | {
|
|
77
70
|
/**
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
* Multiple columns for composite index (order matters for query optimization).
|
|
72
|
+
*/
|
|
80
73
|
columns: Keys[];
|
|
81
74
|
/**
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
76
|
+
*/
|
|
84
77
|
unique?: boolean;
|
|
85
78
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
79
|
+
* Custom name for the index. If not provided, generates name automatically.
|
|
80
|
+
*/
|
|
88
81
|
name?: string;
|
|
89
82
|
})[];
|
|
90
83
|
/**
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
* Foreign key constraints to maintain referential integrity.
|
|
85
|
+
*/
|
|
93
86
|
foreignKeys?: Array<{
|
|
94
87
|
/**
|
|
95
|
-
|
|
96
|
-
|
|
88
|
+
* Optional name for the foreign key constraint.
|
|
89
|
+
*/
|
|
97
90
|
name?: string;
|
|
98
91
|
/**
|
|
99
|
-
|
|
100
|
-
|
|
92
|
+
* Local columns that reference the foreign table.
|
|
93
|
+
*/
|
|
101
94
|
columns: Array<keyof Static<T>>;
|
|
102
95
|
/**
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
96
|
+
* Referenced columns in the foreign table.
|
|
97
|
+
* Must be EntityColumn references from other entities.
|
|
98
|
+
*/
|
|
106
99
|
foreignColumns: Array<() => EntityColumn<any>>;
|
|
107
100
|
}>;
|
|
108
101
|
/**
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
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
|
+
*/
|
|
139
132
|
constraints?: Array<{
|
|
140
133
|
/**
|
|
141
|
-
|
|
142
|
-
|
|
134
|
+
* Columns involved in this constraint.
|
|
135
|
+
*/
|
|
143
136
|
columns: Array<keyof Static<T>>;
|
|
144
137
|
/**
|
|
145
|
-
|
|
146
|
-
|
|
138
|
+
* Optional name for the constraint.
|
|
139
|
+
*/
|
|
147
140
|
name?: string;
|
|
148
141
|
/**
|
|
149
|
-
|
|
150
|
-
|
|
142
|
+
* Whether this is a unique constraint.
|
|
143
|
+
*/
|
|
151
144
|
unique?: boolean | {};
|
|
152
145
|
/**
|
|
153
|
-
|
|
154
|
-
|
|
146
|
+
* SQL expression for check constraint validation.
|
|
147
|
+
*/
|
|
155
148
|
check?: SQL;
|
|
156
149
|
}>;
|
|
157
150
|
/**
|
|
158
|
-
|
|
159
|
-
|
|
151
|
+
* Advanced Drizzle ORM configuration for complex table setups.
|
|
152
|
+
*/
|
|
160
153
|
config?: (self: BuildExtraConfigColumns<string, FromSchema<T>, "pg">) => PgTableExtraConfigValue[];
|
|
161
154
|
}
|
|
162
155
|
declare class EntityPrimitive<T extends TObject = TObject> {
|
|
@@ -204,8 +197,8 @@ type PgSymbols = {
|
|
|
204
197
|
[PG_REF]: PgRefOptions;
|
|
205
198
|
[PG_ENUM]: PgEnumOptions;
|
|
206
199
|
/**
|
|
207
|
-
|
|
208
|
-
|
|
200
|
+
* @deprecated Use `PG_IDENTITY` instead.
|
|
201
|
+
*/
|
|
209
202
|
[PG_SERIAL]: {};
|
|
210
203
|
};
|
|
211
204
|
type PgSymbolKeys = keyof PgSymbols;
|
|
@@ -235,195 +228,11 @@ interface PgRefOptions {
|
|
|
235
228
|
*/
|
|
236
229
|
type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
|
|
237
230
|
//#endregion
|
|
238
|
-
//#region ../../src/orm/providers/drivers/BunPostgresProvider.d.ts
|
|
239
|
-
declare module "alepha" {
|
|
240
|
-
interface Env extends Partial<Static<typeof envSchema$1>> {}
|
|
241
|
-
}
|
|
242
|
-
declare const envSchema$1: alepha579.TObject<{
|
|
243
|
-
/**
|
|
244
|
-
* Main configuration for database connection.
|
|
245
|
-
* Accept a string in the format of a Postgres connection URL.
|
|
246
|
-
* Example: postgres://user:password@localhost:5432/database
|
|
247
|
-
* or
|
|
248
|
-
* Example: postgres://user:password@localhost:5432/database?sslmode=require
|
|
249
|
-
*/
|
|
250
|
-
DATABASE_URL: alepha579.TOptional<alepha579.TString>;
|
|
251
|
-
/**
|
|
252
|
-
* In addition to the DATABASE_URL, you can specify the postgres schema name.
|
|
253
|
-
*/
|
|
254
|
-
POSTGRES_SCHEMA: alepha579.TOptional<alepha579.TString>;
|
|
255
|
-
}>;
|
|
256
|
-
/**
|
|
257
|
-
* Bun PostgreSQL provider using Drizzle ORM with Bun's native SQL client.
|
|
258
|
-
*
|
|
259
|
-
* This provider uses Bun's built-in SQL class for PostgreSQL connections,
|
|
260
|
-
* which provides excellent performance on the Bun runtime.
|
|
261
|
-
*
|
|
262
|
-
* @example
|
|
263
|
-
* ```ts
|
|
264
|
-
* // Set DATABASE_URL environment variable
|
|
265
|
-
* // DATABASE_URL=postgres://user:password@localhost:5432/database
|
|
266
|
-
*
|
|
267
|
-
* // Or configure programmatically
|
|
268
|
-
* alepha.with({
|
|
269
|
-
* provide: DatabaseProvider,
|
|
270
|
-
* use: BunPostgresProvider,
|
|
271
|
-
* });
|
|
272
|
-
* ```
|
|
273
|
-
*/
|
|
274
|
-
//#endregion
|
|
275
|
-
//#region ../../src/orm/providers/drivers/BunSqliteProvider.d.ts
|
|
276
|
-
/**
|
|
277
|
-
* Configuration options for the Bun SQLite database provider.
|
|
278
|
-
*/
|
|
279
|
-
declare const bunSqliteOptions: alepha579.Atom<alepha579.TObject<{
|
|
280
|
-
path: alepha579.TOptional<alepha579.TString>;
|
|
281
|
-
}>, "alepha.postgres.bun-sqlite.options">;
|
|
282
|
-
type BunSqliteProviderOptions = Static<typeof bunSqliteOptions.schema>;
|
|
283
|
-
declare module "alepha" {
|
|
284
|
-
interface State {
|
|
285
|
-
[bunSqliteOptions.key]: BunSqliteProviderOptions;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* Bun SQLite provider using Drizzle ORM with Bun's native SQLite client.
|
|
290
|
-
*
|
|
291
|
-
* This provider uses Bun's built-in `bun:sqlite` for SQLite connections,
|
|
292
|
-
* which provides excellent performance on the Bun runtime.
|
|
293
|
-
*
|
|
294
|
-
* @example
|
|
295
|
-
* ```ts
|
|
296
|
-
* // Set DATABASE_URL environment variable
|
|
297
|
-
* // DATABASE_URL=sqlite://./my-database.db
|
|
298
|
-
*
|
|
299
|
-
* // Or configure programmatically
|
|
300
|
-
* alepha.with({
|
|
301
|
-
* provide: DatabaseProvider,
|
|
302
|
-
* use: BunSqliteProvider,
|
|
303
|
-
* });
|
|
304
|
-
*
|
|
305
|
-
* // Or use options atom
|
|
306
|
-
* alepha.store.mut(bunSqliteOptions, (old) => ({
|
|
307
|
-
* ...old,
|
|
308
|
-
* path: ":memory:",
|
|
309
|
-
* }));
|
|
310
|
-
* ```
|
|
311
|
-
*/
|
|
312
|
-
//#endregion
|
|
313
|
-
//#region ../../src/orm/providers/drivers/NodePostgresProvider.d.ts
|
|
314
|
-
declare module "alepha" {
|
|
315
|
-
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
316
|
-
}
|
|
317
|
-
declare const envSchema: alepha579.TObject<{
|
|
318
|
-
/**
|
|
319
|
-
* Main configuration for database connection.
|
|
320
|
-
* Accept a string in the format of a Postgres connection URL.
|
|
321
|
-
* Example: postgres://user:password@localhost:5432/database
|
|
322
|
-
* or
|
|
323
|
-
* Example: postgres://user:password@localhost:5432/database?sslmode=require
|
|
324
|
-
*/
|
|
325
|
-
DATABASE_URL: alepha579.TOptional<alepha579.TString>;
|
|
326
|
-
/**
|
|
327
|
-
* In addition to the DATABASE_URL, you can specify the postgres schema name.
|
|
328
|
-
*
|
|
329
|
-
* It will monkey patch drizzle tables.
|
|
330
|
-
*/
|
|
331
|
-
POSTGRES_SCHEMA: alepha579.TOptional<alepha579.TString>;
|
|
332
|
-
}>;
|
|
333
|
-
//#endregion
|
|
334
|
-
//#region ../../src/orm/providers/drivers/NodeSqliteProvider.d.ts
|
|
335
|
-
/**
|
|
336
|
-
* Configuration options for the Node.js SQLite database provider.
|
|
337
|
-
*/
|
|
338
|
-
declare const nodeSqliteOptions: alepha579.Atom<alepha579.TObject<{
|
|
339
|
-
path: alepha579.TOptional<alepha579.TString>;
|
|
340
|
-
}>, "alepha.postgres.node-sqlite.options">;
|
|
341
|
-
type NodeSqliteProviderOptions = Static<typeof nodeSqliteOptions.schema>;
|
|
342
|
-
declare module "alepha" {
|
|
343
|
-
interface State {
|
|
344
|
-
[nodeSqliteOptions.key]: NodeSqliteProviderOptions;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* Add a fake support for SQLite in Node.js based on Postgres interfaces.
|
|
349
|
-
*
|
|
350
|
-
* This is NOT a real SQLite provider, it's a workaround to use SQLite with Drizzle ORM.
|
|
351
|
-
* This is NOT recommended for production use.
|
|
352
|
-
*/
|
|
353
|
-
//#endregion
|
|
354
|
-
//#region ../../src/orm/index.d.ts
|
|
355
|
-
declare module "alepha" {
|
|
356
|
-
interface Hooks {
|
|
357
|
-
/**
|
|
358
|
-
* Fires before creating an entity in the repository.
|
|
359
|
-
*/
|
|
360
|
-
"repository:create:before": {
|
|
361
|
-
tableName: string;
|
|
362
|
-
data: any;
|
|
363
|
-
};
|
|
364
|
-
/**
|
|
365
|
-
* Fires after creating an entity in the repository.
|
|
366
|
-
*/
|
|
367
|
-
"repository:create:after": {
|
|
368
|
-
tableName: string;
|
|
369
|
-
data: any;
|
|
370
|
-
entity: any;
|
|
371
|
-
};
|
|
372
|
-
/**
|
|
373
|
-
* Fires before updating entities in the repository.
|
|
374
|
-
*/
|
|
375
|
-
"repository:update:before": {
|
|
376
|
-
tableName: string;
|
|
377
|
-
where: any;
|
|
378
|
-
data: any;
|
|
379
|
-
};
|
|
380
|
-
/**
|
|
381
|
-
* Fires after updating entities in the repository.
|
|
382
|
-
*/
|
|
383
|
-
"repository:update:after": {
|
|
384
|
-
tableName: string;
|
|
385
|
-
where: any;
|
|
386
|
-
data: any;
|
|
387
|
-
entities: any[];
|
|
388
|
-
};
|
|
389
|
-
/**
|
|
390
|
-
* Fires before deleting entities from the repository.
|
|
391
|
-
*/
|
|
392
|
-
"repository:delete:before": {
|
|
393
|
-
tableName: string;
|
|
394
|
-
where: any;
|
|
395
|
-
};
|
|
396
|
-
/**
|
|
397
|
-
* Fires after deleting entities from the repository.
|
|
398
|
-
*/
|
|
399
|
-
"repository:delete:after": {
|
|
400
|
-
tableName: string;
|
|
401
|
-
where: any;
|
|
402
|
-
ids: Array<string | number>;
|
|
403
|
-
};
|
|
404
|
-
/**
|
|
405
|
-
* Fires before reading entities from the repository.
|
|
406
|
-
*/
|
|
407
|
-
"repository:read:before": {
|
|
408
|
-
tableName: string;
|
|
409
|
-
query: any;
|
|
410
|
-
};
|
|
411
|
-
/**
|
|
412
|
-
* Fires after reading entities from the repository.
|
|
413
|
-
*/
|
|
414
|
-
"repository:read:after": {
|
|
415
|
-
tableName: string;
|
|
416
|
-
query: any;
|
|
417
|
-
entities: any[];
|
|
418
|
-
};
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
//#endregion
|
|
422
231
|
//#region ../../src/api/audits/entities/audits.d.ts
|
|
423
232
|
/**
|
|
424
233
|
* Audit severity levels for categorizing events.
|
|
425
234
|
*/
|
|
426
|
-
declare const auditSeveritySchema:
|
|
235
|
+
declare const auditSeveritySchema: alepha381.TUnsafe<"info" | "warning" | "critical">;
|
|
427
236
|
type AuditSeverity = Static<typeof auditSeveritySchema>;
|
|
428
237
|
/**
|
|
429
238
|
* Audit log entity for tracking important system events.
|
|
@@ -434,212 +243,212 @@ type AuditSeverity = Static<typeof auditSeveritySchema>;
|
|
|
434
243
|
* - When it happened (createdAt)
|
|
435
244
|
* - Context and details (metadata, ipAddress, userAgent)
|
|
436
245
|
*/
|
|
437
|
-
declare const audits:
|
|
438
|
-
id:
|
|
439
|
-
createdAt:
|
|
440
|
-
/**
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
type:
|
|
445
|
-
/**
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
action:
|
|
449
|
-
/**
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
severity:
|
|
453
|
-
/**
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
userId:
|
|
457
|
-
/**
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
userRealm:
|
|
461
|
-
/**
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
userEmail:
|
|
465
|
-
/**
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
resourceType:
|
|
469
|
-
/**
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
resourceId:
|
|
473
|
-
/**
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
description:
|
|
477
|
-
/**
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
metadata:
|
|
481
|
-
/**
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
ipAddress:
|
|
485
|
-
/**
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
userAgent:
|
|
489
|
-
/**
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
sessionId:
|
|
493
|
-
/**
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
requestId:
|
|
497
|
-
/**
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
success:
|
|
501
|
-
/**
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
errorMessage:
|
|
246
|
+
declare const audits: alepha_orm12.EntityPrimitive<alepha381.TObject<{
|
|
247
|
+
id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
|
|
248
|
+
createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
|
|
249
|
+
/**
|
|
250
|
+
* Audit event type (e.g., "auth", "user", "payment", "system").
|
|
251
|
+
* Used for categorizing and filtering audit events.
|
|
252
|
+
*/
|
|
253
|
+
type: alepha381.TString;
|
|
254
|
+
/**
|
|
255
|
+
* Specific action performed (e.g., "login", "logout", "create", "update", "delete").
|
|
256
|
+
*/
|
|
257
|
+
action: alepha381.TString;
|
|
258
|
+
/**
|
|
259
|
+
* Severity level of the event.
|
|
260
|
+
*/
|
|
261
|
+
severity: alepha_orm12.PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
|
|
262
|
+
/**
|
|
263
|
+
* User ID who performed the action (null for system events).
|
|
264
|
+
*/
|
|
265
|
+
userId: alepha381.TOptional<alepha381.TString>;
|
|
266
|
+
/**
|
|
267
|
+
* User realm for multi-tenant support.
|
|
268
|
+
*/
|
|
269
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
270
|
+
/**
|
|
271
|
+
* User email at the time of the event (denormalized for history).
|
|
272
|
+
*/
|
|
273
|
+
userEmail: alepha381.TOptional<alepha381.TString>;
|
|
274
|
+
/**
|
|
275
|
+
* Resource type affected (e.g., "user", "order", "file").
|
|
276
|
+
*/
|
|
277
|
+
resourceType: alepha381.TOptional<alepha381.TString>;
|
|
278
|
+
/**
|
|
279
|
+
* Resource ID affected.
|
|
280
|
+
*/
|
|
281
|
+
resourceId: alepha381.TOptional<alepha381.TString>;
|
|
282
|
+
/**
|
|
283
|
+
* Human-readable description of the event.
|
|
284
|
+
*/
|
|
285
|
+
description: alepha381.TOptional<alepha381.TString>;
|
|
286
|
+
/**
|
|
287
|
+
* Additional metadata/context as JSON.
|
|
288
|
+
*/
|
|
289
|
+
metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
|
|
290
|
+
/**
|
|
291
|
+
* Client IP address.
|
|
292
|
+
*/
|
|
293
|
+
ipAddress: alepha381.TOptional<alepha381.TString>;
|
|
294
|
+
/**
|
|
295
|
+
* Client user agent.
|
|
296
|
+
*/
|
|
297
|
+
userAgent: alepha381.TOptional<alepha381.TString>;
|
|
298
|
+
/**
|
|
299
|
+
* Session ID if applicable.
|
|
300
|
+
*/
|
|
301
|
+
sessionId: alepha381.TOptional<alepha381.TString>;
|
|
302
|
+
/**
|
|
303
|
+
* Request ID for correlation.
|
|
304
|
+
*/
|
|
305
|
+
requestId: alepha381.TOptional<alepha381.TString>;
|
|
306
|
+
/**
|
|
307
|
+
* Whether the action was successful.
|
|
308
|
+
*/
|
|
309
|
+
success: alepha_orm12.PgAttr<alepha381.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
|
|
310
|
+
/**
|
|
311
|
+
* Error message if the action failed.
|
|
312
|
+
*/
|
|
313
|
+
errorMessage: alepha381.TOptional<alepha381.TString>;
|
|
505
314
|
}>>;
|
|
506
|
-
declare const auditEntitySchema:
|
|
507
|
-
id:
|
|
508
|
-
createdAt:
|
|
509
|
-
/**
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
type:
|
|
514
|
-
/**
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
action:
|
|
518
|
-
/**
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
severity:
|
|
522
|
-
/**
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
userId:
|
|
526
|
-
/**
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
userRealm:
|
|
530
|
-
/**
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
userEmail:
|
|
534
|
-
/**
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
resourceType:
|
|
538
|
-
/**
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
resourceId:
|
|
542
|
-
/**
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
description:
|
|
546
|
-
/**
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
metadata:
|
|
550
|
-
/**
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
ipAddress:
|
|
554
|
-
/**
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
userAgent:
|
|
558
|
-
/**
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
sessionId:
|
|
562
|
-
/**
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
requestId:
|
|
566
|
-
/**
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
success:
|
|
570
|
-
/**
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
errorMessage:
|
|
315
|
+
declare const auditEntitySchema: alepha381.TObject<{
|
|
316
|
+
id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
|
|
317
|
+
createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
|
|
318
|
+
/**
|
|
319
|
+
* Audit event type (e.g., "auth", "user", "payment", "system").
|
|
320
|
+
* Used for categorizing and filtering audit events.
|
|
321
|
+
*/
|
|
322
|
+
type: alepha381.TString;
|
|
323
|
+
/**
|
|
324
|
+
* Specific action performed (e.g., "login", "logout", "create", "update", "delete").
|
|
325
|
+
*/
|
|
326
|
+
action: alepha381.TString;
|
|
327
|
+
/**
|
|
328
|
+
* Severity level of the event.
|
|
329
|
+
*/
|
|
330
|
+
severity: alepha_orm12.PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
|
|
331
|
+
/**
|
|
332
|
+
* User ID who performed the action (null for system events).
|
|
333
|
+
*/
|
|
334
|
+
userId: alepha381.TOptional<alepha381.TString>;
|
|
335
|
+
/**
|
|
336
|
+
* User realm for multi-tenant support.
|
|
337
|
+
*/
|
|
338
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
339
|
+
/**
|
|
340
|
+
* User email at the time of the event (denormalized for history).
|
|
341
|
+
*/
|
|
342
|
+
userEmail: alepha381.TOptional<alepha381.TString>;
|
|
343
|
+
/**
|
|
344
|
+
* Resource type affected (e.g., "user", "order", "file").
|
|
345
|
+
*/
|
|
346
|
+
resourceType: alepha381.TOptional<alepha381.TString>;
|
|
347
|
+
/**
|
|
348
|
+
* Resource ID affected.
|
|
349
|
+
*/
|
|
350
|
+
resourceId: alepha381.TOptional<alepha381.TString>;
|
|
351
|
+
/**
|
|
352
|
+
* Human-readable description of the event.
|
|
353
|
+
*/
|
|
354
|
+
description: alepha381.TOptional<alepha381.TString>;
|
|
355
|
+
/**
|
|
356
|
+
* Additional metadata/context as JSON.
|
|
357
|
+
*/
|
|
358
|
+
metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
|
|
359
|
+
/**
|
|
360
|
+
* Client IP address.
|
|
361
|
+
*/
|
|
362
|
+
ipAddress: alepha381.TOptional<alepha381.TString>;
|
|
363
|
+
/**
|
|
364
|
+
* Client user agent.
|
|
365
|
+
*/
|
|
366
|
+
userAgent: alepha381.TOptional<alepha381.TString>;
|
|
367
|
+
/**
|
|
368
|
+
* Session ID if applicable.
|
|
369
|
+
*/
|
|
370
|
+
sessionId: alepha381.TOptional<alepha381.TString>;
|
|
371
|
+
/**
|
|
372
|
+
* Request ID for correlation.
|
|
373
|
+
*/
|
|
374
|
+
requestId: alepha381.TOptional<alepha381.TString>;
|
|
375
|
+
/**
|
|
376
|
+
* Whether the action was successful.
|
|
377
|
+
*/
|
|
378
|
+
success: alepha_orm12.PgAttr<alepha381.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
|
|
379
|
+
/**
|
|
380
|
+
* Error message if the action failed.
|
|
381
|
+
*/
|
|
382
|
+
errorMessage: alepha381.TOptional<alepha381.TString>;
|
|
574
383
|
}>;
|
|
575
|
-
declare const auditEntityInsertSchema:
|
|
576
|
-
id:
|
|
577
|
-
createdAt:
|
|
578
|
-
/**
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
type:
|
|
583
|
-
/**
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
action:
|
|
587
|
-
/**
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
severity:
|
|
591
|
-
/**
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
userId:
|
|
595
|
-
/**
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
userRealm:
|
|
599
|
-
/**
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
userEmail:
|
|
603
|
-
/**
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
resourceType:
|
|
607
|
-
/**
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
resourceId:
|
|
611
|
-
/**
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
description:
|
|
615
|
-
/**
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
metadata:
|
|
619
|
-
/**
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
ipAddress:
|
|
623
|
-
/**
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
userAgent:
|
|
627
|
-
/**
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
sessionId:
|
|
631
|
-
/**
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
requestId:
|
|
635
|
-
/**
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
success:
|
|
639
|
-
/**
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
errorMessage:
|
|
384
|
+
declare const auditEntityInsertSchema: alepha_orm12.TObjectInsert<alepha381.TObject<{
|
|
385
|
+
id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
|
|
386
|
+
createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
|
|
387
|
+
/**
|
|
388
|
+
* Audit event type (e.g., "auth", "user", "payment", "system").
|
|
389
|
+
* Used for categorizing and filtering audit events.
|
|
390
|
+
*/
|
|
391
|
+
type: alepha381.TString;
|
|
392
|
+
/**
|
|
393
|
+
* Specific action performed (e.g., "login", "logout", "create", "update", "delete").
|
|
394
|
+
*/
|
|
395
|
+
action: alepha381.TString;
|
|
396
|
+
/**
|
|
397
|
+
* Severity level of the event.
|
|
398
|
+
*/
|
|
399
|
+
severity: alepha_orm12.PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
|
|
400
|
+
/**
|
|
401
|
+
* User ID who performed the action (null for system events).
|
|
402
|
+
*/
|
|
403
|
+
userId: alepha381.TOptional<alepha381.TString>;
|
|
404
|
+
/**
|
|
405
|
+
* User realm for multi-tenant support.
|
|
406
|
+
*/
|
|
407
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
408
|
+
/**
|
|
409
|
+
* User email at the time of the event (denormalized for history).
|
|
410
|
+
*/
|
|
411
|
+
userEmail: alepha381.TOptional<alepha381.TString>;
|
|
412
|
+
/**
|
|
413
|
+
* Resource type affected (e.g., "user", "order", "file").
|
|
414
|
+
*/
|
|
415
|
+
resourceType: alepha381.TOptional<alepha381.TString>;
|
|
416
|
+
/**
|
|
417
|
+
* Resource ID affected.
|
|
418
|
+
*/
|
|
419
|
+
resourceId: alepha381.TOptional<alepha381.TString>;
|
|
420
|
+
/**
|
|
421
|
+
* Human-readable description of the event.
|
|
422
|
+
*/
|
|
423
|
+
description: alepha381.TOptional<alepha381.TString>;
|
|
424
|
+
/**
|
|
425
|
+
* Additional metadata/context as JSON.
|
|
426
|
+
*/
|
|
427
|
+
metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
|
|
428
|
+
/**
|
|
429
|
+
* Client IP address.
|
|
430
|
+
*/
|
|
431
|
+
ipAddress: alepha381.TOptional<alepha381.TString>;
|
|
432
|
+
/**
|
|
433
|
+
* Client user agent.
|
|
434
|
+
*/
|
|
435
|
+
userAgent: alepha381.TOptional<alepha381.TString>;
|
|
436
|
+
/**
|
|
437
|
+
* Session ID if applicable.
|
|
438
|
+
*/
|
|
439
|
+
sessionId: alepha381.TOptional<alepha381.TString>;
|
|
440
|
+
/**
|
|
441
|
+
* Request ID for correlation.
|
|
442
|
+
*/
|
|
443
|
+
requestId: alepha381.TOptional<alepha381.TString>;
|
|
444
|
+
/**
|
|
445
|
+
* Whether the action was successful.
|
|
446
|
+
*/
|
|
447
|
+
success: alepha_orm12.PgAttr<alepha381.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
|
|
448
|
+
/**
|
|
449
|
+
* Error message if the action failed.
|
|
450
|
+
*/
|
|
451
|
+
errorMessage: alepha381.TOptional<alepha381.TString>;
|
|
643
452
|
}>>;
|
|
644
453
|
type AuditEntity = Static<typeof audits.schema>;
|
|
645
454
|
//#endregion
|
|
@@ -647,21 +456,21 @@ type AuditEntity = Static<typeof audits.schema>;
|
|
|
647
456
|
/**
|
|
648
457
|
* Query schema for searching and filtering audit logs.
|
|
649
458
|
*/
|
|
650
|
-
declare const auditQuerySchema:
|
|
651
|
-
page:
|
|
652
|
-
size:
|
|
653
|
-
sort:
|
|
654
|
-
type:
|
|
655
|
-
action:
|
|
656
|
-
severity:
|
|
657
|
-
userId:
|
|
658
|
-
userRealm:
|
|
659
|
-
resourceType:
|
|
660
|
-
resourceId:
|
|
661
|
-
success:
|
|
662
|
-
from:
|
|
663
|
-
to:
|
|
664
|
-
search:
|
|
459
|
+
declare const auditQuerySchema: alepha381.TObject<{
|
|
460
|
+
page: alepha381.TOptional<alepha381.TInteger>;
|
|
461
|
+
size: alepha381.TOptional<alepha381.TInteger>;
|
|
462
|
+
sort: alepha381.TOptional<alepha381.TString>;
|
|
463
|
+
type: alepha381.TOptional<alepha381.TString>;
|
|
464
|
+
action: alepha381.TOptional<alepha381.TString>;
|
|
465
|
+
severity: alepha381.TOptional<alepha381.TUnsafe<"info" | "warning" | "critical">>;
|
|
466
|
+
userId: alepha381.TOptional<alepha381.TString>;
|
|
467
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
468
|
+
resourceType: alepha381.TOptional<alepha381.TString>;
|
|
469
|
+
resourceId: alepha381.TOptional<alepha381.TString>;
|
|
470
|
+
success: alepha381.TOptional<alepha381.TBoolean>;
|
|
471
|
+
from: alepha381.TOptional<alepha381.TString>;
|
|
472
|
+
to: alepha381.TOptional<alepha381.TString>;
|
|
473
|
+
search: alepha381.TOptional<alepha381.TString>;
|
|
665
474
|
}>;
|
|
666
475
|
type AuditQuery = Static<typeof auditQuerySchema>;
|
|
667
476
|
//#endregion
|
|
@@ -669,23 +478,23 @@ type AuditQuery = Static<typeof auditQuerySchema>;
|
|
|
669
478
|
/**
|
|
670
479
|
* Schema for creating a new audit log entry.
|
|
671
480
|
*/
|
|
672
|
-
declare const createAuditSchema:
|
|
673
|
-
type:
|
|
674
|
-
action:
|
|
675
|
-
severity:
|
|
676
|
-
userId:
|
|
677
|
-
userRealm:
|
|
678
|
-
userEmail:
|
|
679
|
-
resourceType:
|
|
680
|
-
resourceId:
|
|
681
|
-
description:
|
|
682
|
-
metadata:
|
|
683
|
-
ipAddress:
|
|
684
|
-
userAgent:
|
|
685
|
-
sessionId:
|
|
686
|
-
requestId:
|
|
687
|
-
success:
|
|
688
|
-
errorMessage:
|
|
481
|
+
declare const createAuditSchema: alepha381.TObject<{
|
|
482
|
+
type: alepha381.TString;
|
|
483
|
+
action: alepha381.TString;
|
|
484
|
+
severity: alepha381.TOptional<alepha381.TUnsafe<"info" | "warning" | "critical">>;
|
|
485
|
+
userId: alepha381.TOptional<alepha381.TString>;
|
|
486
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
487
|
+
userEmail: alepha381.TOptional<alepha381.TString>;
|
|
488
|
+
resourceType: alepha381.TOptional<alepha381.TString>;
|
|
489
|
+
resourceId: alepha381.TOptional<alepha381.TString>;
|
|
490
|
+
description: alepha381.TOptional<alepha381.TString>;
|
|
491
|
+
metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
|
|
492
|
+
ipAddress: alepha381.TOptional<alepha381.TString>;
|
|
493
|
+
userAgent: alepha381.TOptional<alepha381.TString>;
|
|
494
|
+
sessionId: alepha381.TOptional<alepha381.TString>;
|
|
495
|
+
requestId: alepha381.TOptional<alepha381.TString>;
|
|
496
|
+
success: alepha381.TOptional<alepha381.TBoolean>;
|
|
497
|
+
errorMessage: alepha381.TOptional<alepha381.TString>;
|
|
689
498
|
}>;
|
|
690
499
|
type CreateAudit = Static<typeof createAuditSchema>;
|
|
691
500
|
//#endregion
|
|
@@ -710,98 +519,98 @@ interface AuditTypeDefinition {
|
|
|
710
519
|
declare class AuditService {
|
|
711
520
|
protected readonly alepha: Alepha;
|
|
712
521
|
protected readonly log: alepha_logger0.Logger;
|
|
713
|
-
protected readonly repo:
|
|
714
|
-
id:
|
|
715
|
-
createdAt:
|
|
716
|
-
type:
|
|
717
|
-
action:
|
|
718
|
-
severity:
|
|
719
|
-
userId:
|
|
720
|
-
userRealm:
|
|
721
|
-
userEmail:
|
|
722
|
-
resourceType:
|
|
723
|
-
resourceId:
|
|
724
|
-
description:
|
|
725
|
-
metadata:
|
|
726
|
-
ipAddress:
|
|
727
|
-
userAgent:
|
|
728
|
-
sessionId:
|
|
729
|
-
requestId:
|
|
730
|
-
success:
|
|
731
|
-
errorMessage:
|
|
522
|
+
protected readonly repo: alepha_orm12.Repository<alepha381.TObject<{
|
|
523
|
+
id: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_PRIMARY_KEY>, typeof alepha_orm12.PG_DEFAULT>;
|
|
524
|
+
createdAt: alepha_orm12.PgAttr<alepha_orm12.PgAttr<alepha381.TString, typeof alepha_orm12.PG_CREATED_AT>, typeof alepha_orm12.PG_DEFAULT>;
|
|
525
|
+
type: alepha381.TString;
|
|
526
|
+
action: alepha381.TString;
|
|
527
|
+
severity: alepha_orm12.PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof alepha_orm12.PG_DEFAULT>;
|
|
528
|
+
userId: alepha381.TOptional<alepha381.TString>;
|
|
529
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
530
|
+
userEmail: alepha381.TOptional<alepha381.TString>;
|
|
531
|
+
resourceType: alepha381.TOptional<alepha381.TString>;
|
|
532
|
+
resourceId: alepha381.TOptional<alepha381.TString>;
|
|
533
|
+
description: alepha381.TOptional<alepha381.TString>;
|
|
534
|
+
metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
|
|
535
|
+
ipAddress: alepha381.TOptional<alepha381.TString>;
|
|
536
|
+
userAgent: alepha381.TOptional<alepha381.TString>;
|
|
537
|
+
sessionId: alepha381.TOptional<alepha381.TString>;
|
|
538
|
+
requestId: alepha381.TOptional<alepha381.TString>;
|
|
539
|
+
success: alepha_orm12.PgAttr<alepha381.TBoolean, typeof alepha_orm12.PG_DEFAULT>;
|
|
540
|
+
errorMessage: alepha381.TOptional<alepha381.TString>;
|
|
732
541
|
}>>;
|
|
733
542
|
/**
|
|
734
|
-
|
|
735
|
-
|
|
543
|
+
* Registry of audit types and their allowed actions.
|
|
544
|
+
*/
|
|
736
545
|
protected readonly auditTypes: Map<string, AuditTypeDefinition>;
|
|
737
546
|
/**
|
|
738
|
-
|
|
739
|
-
|
|
547
|
+
* Register an audit type with its allowed actions.
|
|
548
|
+
*/
|
|
740
549
|
registerType(definition: AuditTypeDefinition): void;
|
|
741
550
|
/**
|
|
742
|
-
|
|
743
|
-
|
|
551
|
+
* Get all registered audit types.
|
|
552
|
+
*/
|
|
744
553
|
getRegisteredTypes(): AuditTypeDefinition[];
|
|
745
554
|
/**
|
|
746
|
-
|
|
747
|
-
|
|
555
|
+
* Get current request context if available.
|
|
556
|
+
*/
|
|
748
557
|
protected getRequestContext(): ServerRequest | undefined;
|
|
749
558
|
/**
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
559
|
+
* Create a new audit log entry.
|
|
560
|
+
* Automatically populates ipAddress, userAgent, and requestId from the current request context.
|
|
561
|
+
*/
|
|
753
562
|
create(data: CreateAudit): Promise<AuditEntity>;
|
|
754
563
|
/**
|
|
755
|
-
|
|
756
|
-
|
|
564
|
+
* Record an audit event (convenience method).
|
|
565
|
+
*/
|
|
757
566
|
record(type: string, action: string, options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
|
|
758
567
|
/**
|
|
759
|
-
|
|
760
|
-
|
|
568
|
+
* Record an authentication event.
|
|
569
|
+
*/
|
|
761
570
|
recordAuth(action: "login" | "logout" | "login_failed" | "token_refresh" | "mfa_setup" | "mfa_verify", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
|
|
762
571
|
/**
|
|
763
|
-
|
|
764
|
-
|
|
572
|
+
* Record a user management event.
|
|
573
|
+
*/
|
|
765
574
|
recordUser(action: "create" | "update" | "delete" | "enable" | "disable" | "role_change", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
|
|
766
575
|
/**
|
|
767
|
-
|
|
768
|
-
|
|
576
|
+
* Record a data access event.
|
|
577
|
+
*/
|
|
769
578
|
recordAccess(action: "view" | "export" | "download", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
|
|
770
579
|
/**
|
|
771
|
-
|
|
772
|
-
|
|
580
|
+
* Record a security event.
|
|
581
|
+
*/
|
|
773
582
|
recordSecurity(action: "permission_denied" | "suspicious_activity" | "rate_limited" | "blocked", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
|
|
774
583
|
/**
|
|
775
|
-
|
|
776
|
-
|
|
584
|
+
* Record a system event.
|
|
585
|
+
*/
|
|
777
586
|
recordSystem(action: "startup" | "shutdown" | "config_change" | "maintenance" | "error", options?: Omit<CreateAudit, "type" | "action">): Promise<AuditEntity>;
|
|
778
587
|
/**
|
|
779
|
-
|
|
780
|
-
|
|
588
|
+
* Find audit entries with filtering and pagination.
|
|
589
|
+
*/
|
|
781
590
|
find(query?: AuditQuery): Promise<Page<AuditEntity>>;
|
|
782
591
|
/**
|
|
783
|
-
|
|
784
|
-
|
|
592
|
+
* Get audit entry by ID.
|
|
593
|
+
*/
|
|
785
594
|
getById(id: string): Promise<AuditEntity>;
|
|
786
595
|
/**
|
|
787
|
-
|
|
788
|
-
|
|
596
|
+
* Get audit entries for a specific user.
|
|
597
|
+
*/
|
|
789
598
|
findByUser(userId: string, query?: Omit<AuditQuery, "userId">): Promise<Page<AuditEntity>>;
|
|
790
599
|
/**
|
|
791
|
-
|
|
792
|
-
|
|
600
|
+
* Get audit entries for a specific resource.
|
|
601
|
+
*/
|
|
793
602
|
findByResource(resourceType: string, resourceId: string, query?: Omit<AuditQuery, "resourceType" | "resourceId">): Promise<Page<AuditEntity>>;
|
|
794
603
|
/**
|
|
795
|
-
|
|
796
|
-
|
|
604
|
+
* Get audit statistics for a time period.
|
|
605
|
+
*/
|
|
797
606
|
getStats(options?: {
|
|
798
607
|
from?: Date;
|
|
799
608
|
to?: Date;
|
|
800
609
|
userRealm?: string;
|
|
801
610
|
}): Promise<AuditStats>;
|
|
802
611
|
/**
|
|
803
|
-
|
|
804
|
-
|
|
612
|
+
* Delete old audit entries (for retention policy).
|
|
613
|
+
*/
|
|
805
614
|
deleteOlderThan(date: Date): Promise<number>;
|
|
806
615
|
}
|
|
807
616
|
/**
|
|
@@ -830,262 +639,262 @@ declare class AdminAuditController {
|
|
|
830
639
|
protected readonly group = "admin:audits";
|
|
831
640
|
protected readonly auditService: AuditService;
|
|
832
641
|
/**
|
|
833
|
-
|
|
834
|
-
|
|
642
|
+
* Find audit entries with filtering and pagination.
|
|
643
|
+
*/
|
|
835
644
|
readonly findAudits: alepha_server0.ActionPrimitiveFn<{
|
|
836
|
-
query:
|
|
837
|
-
page:
|
|
838
|
-
size:
|
|
839
|
-
sort:
|
|
840
|
-
type:
|
|
841
|
-
action:
|
|
842
|
-
severity:
|
|
843
|
-
userId:
|
|
844
|
-
userRealm:
|
|
845
|
-
resourceType:
|
|
846
|
-
resourceId:
|
|
847
|
-
success:
|
|
848
|
-
from:
|
|
849
|
-
to:
|
|
850
|
-
search:
|
|
645
|
+
query: alepha381.TObject<{
|
|
646
|
+
page: alepha381.TOptional<alepha381.TInteger>;
|
|
647
|
+
size: alepha381.TOptional<alepha381.TInteger>;
|
|
648
|
+
sort: alepha381.TOptional<alepha381.TString>;
|
|
649
|
+
type: alepha381.TOptional<alepha381.TString>;
|
|
650
|
+
action: alepha381.TOptional<alepha381.TString>;
|
|
651
|
+
severity: alepha381.TOptional<alepha381.TUnsafe<"info" | "warning" | "critical">>;
|
|
652
|
+
userId: alepha381.TOptional<alepha381.TString>;
|
|
653
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
654
|
+
resourceType: alepha381.TOptional<alepha381.TString>;
|
|
655
|
+
resourceId: alepha381.TOptional<alepha381.TString>;
|
|
656
|
+
success: alepha381.TOptional<alepha381.TBoolean>;
|
|
657
|
+
from: alepha381.TOptional<alepha381.TString>;
|
|
658
|
+
to: alepha381.TOptional<alepha381.TString>;
|
|
659
|
+
search: alepha381.TOptional<alepha381.TString>;
|
|
851
660
|
}>;
|
|
852
|
-
response:
|
|
853
|
-
id: PgAttr<PgAttr<
|
|
854
|
-
createdAt: PgAttr<PgAttr<
|
|
855
|
-
type:
|
|
856
|
-
action:
|
|
857
|
-
severity: PgAttr<
|
|
858
|
-
userId:
|
|
859
|
-
userRealm:
|
|
860
|
-
userEmail:
|
|
861
|
-
resourceType:
|
|
862
|
-
resourceId:
|
|
863
|
-
description:
|
|
864
|
-
metadata:
|
|
865
|
-
ipAddress:
|
|
866
|
-
userAgent:
|
|
867
|
-
sessionId:
|
|
868
|
-
requestId:
|
|
869
|
-
success: PgAttr<
|
|
870
|
-
errorMessage:
|
|
661
|
+
response: alepha381.TPage<alepha381.TObject<{
|
|
662
|
+
id: PgAttr<PgAttr<alepha381.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
663
|
+
createdAt: PgAttr<PgAttr<alepha381.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
664
|
+
type: alepha381.TString;
|
|
665
|
+
action: alepha381.TString;
|
|
666
|
+
severity: PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
667
|
+
userId: alepha381.TOptional<alepha381.TString>;
|
|
668
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
669
|
+
userEmail: alepha381.TOptional<alepha381.TString>;
|
|
670
|
+
resourceType: alepha381.TOptional<alepha381.TString>;
|
|
671
|
+
resourceId: alepha381.TOptional<alepha381.TString>;
|
|
672
|
+
description: alepha381.TOptional<alepha381.TString>;
|
|
673
|
+
metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
|
|
674
|
+
ipAddress: alepha381.TOptional<alepha381.TString>;
|
|
675
|
+
userAgent: alepha381.TOptional<alepha381.TString>;
|
|
676
|
+
sessionId: alepha381.TOptional<alepha381.TString>;
|
|
677
|
+
requestId: alepha381.TOptional<alepha381.TString>;
|
|
678
|
+
success: PgAttr<alepha381.TBoolean, typeof PG_DEFAULT>;
|
|
679
|
+
errorMessage: alepha381.TOptional<alepha381.TString>;
|
|
871
680
|
}>>;
|
|
872
681
|
}>;
|
|
873
682
|
/**
|
|
874
|
-
|
|
875
|
-
|
|
683
|
+
* Get a single audit entry by ID.
|
|
684
|
+
*/
|
|
876
685
|
readonly getAudit: alepha_server0.ActionPrimitiveFn<{
|
|
877
|
-
params:
|
|
878
|
-
id:
|
|
686
|
+
params: alepha381.TObject<{
|
|
687
|
+
id: alepha381.TString;
|
|
879
688
|
}>;
|
|
880
|
-
response:
|
|
881
|
-
id: PgAttr<PgAttr<
|
|
882
|
-
createdAt: PgAttr<PgAttr<
|
|
883
|
-
type:
|
|
884
|
-
action:
|
|
885
|
-
severity: PgAttr<
|
|
886
|
-
userId:
|
|
887
|
-
userRealm:
|
|
888
|
-
userEmail:
|
|
889
|
-
resourceType:
|
|
890
|
-
resourceId:
|
|
891
|
-
description:
|
|
892
|
-
metadata:
|
|
893
|
-
ipAddress:
|
|
894
|
-
userAgent:
|
|
895
|
-
sessionId:
|
|
896
|
-
requestId:
|
|
897
|
-
success: PgAttr<
|
|
898
|
-
errorMessage:
|
|
689
|
+
response: alepha381.TObject<{
|
|
690
|
+
id: PgAttr<PgAttr<alepha381.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
691
|
+
createdAt: PgAttr<PgAttr<alepha381.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
692
|
+
type: alepha381.TString;
|
|
693
|
+
action: alepha381.TString;
|
|
694
|
+
severity: PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
695
|
+
userId: alepha381.TOptional<alepha381.TString>;
|
|
696
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
697
|
+
userEmail: alepha381.TOptional<alepha381.TString>;
|
|
698
|
+
resourceType: alepha381.TOptional<alepha381.TString>;
|
|
699
|
+
resourceId: alepha381.TOptional<alepha381.TString>;
|
|
700
|
+
description: alepha381.TOptional<alepha381.TString>;
|
|
701
|
+
metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
|
|
702
|
+
ipAddress: alepha381.TOptional<alepha381.TString>;
|
|
703
|
+
userAgent: alepha381.TOptional<alepha381.TString>;
|
|
704
|
+
sessionId: alepha381.TOptional<alepha381.TString>;
|
|
705
|
+
requestId: alepha381.TOptional<alepha381.TString>;
|
|
706
|
+
success: PgAttr<alepha381.TBoolean, typeof PG_DEFAULT>;
|
|
707
|
+
errorMessage: alepha381.TOptional<alepha381.TString>;
|
|
899
708
|
}>;
|
|
900
709
|
}>;
|
|
901
710
|
/**
|
|
902
|
-
|
|
903
|
-
|
|
711
|
+
* Create a new audit entry.
|
|
712
|
+
*/
|
|
904
713
|
readonly createAudit: alepha_server0.ActionPrimitiveFn<{
|
|
905
|
-
body:
|
|
906
|
-
type:
|
|
907
|
-
action:
|
|
908
|
-
severity:
|
|
909
|
-
userId:
|
|
910
|
-
userRealm:
|
|
911
|
-
userEmail:
|
|
912
|
-
resourceType:
|
|
913
|
-
resourceId:
|
|
914
|
-
description:
|
|
915
|
-
metadata:
|
|
916
|
-
ipAddress:
|
|
917
|
-
userAgent:
|
|
918
|
-
sessionId:
|
|
919
|
-
requestId:
|
|
920
|
-
success:
|
|
921
|
-
errorMessage:
|
|
714
|
+
body: alepha381.TObject<{
|
|
715
|
+
type: alepha381.TString;
|
|
716
|
+
action: alepha381.TString;
|
|
717
|
+
severity: alepha381.TOptional<alepha381.TUnsafe<"info" | "warning" | "critical">>;
|
|
718
|
+
userId: alepha381.TOptional<alepha381.TString>;
|
|
719
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
720
|
+
userEmail: alepha381.TOptional<alepha381.TString>;
|
|
721
|
+
resourceType: alepha381.TOptional<alepha381.TString>;
|
|
722
|
+
resourceId: alepha381.TOptional<alepha381.TString>;
|
|
723
|
+
description: alepha381.TOptional<alepha381.TString>;
|
|
724
|
+
metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
|
|
725
|
+
ipAddress: alepha381.TOptional<alepha381.TString>;
|
|
726
|
+
userAgent: alepha381.TOptional<alepha381.TString>;
|
|
727
|
+
sessionId: alepha381.TOptional<alepha381.TString>;
|
|
728
|
+
requestId: alepha381.TOptional<alepha381.TString>;
|
|
729
|
+
success: alepha381.TOptional<alepha381.TBoolean>;
|
|
730
|
+
errorMessage: alepha381.TOptional<alepha381.TString>;
|
|
922
731
|
}>;
|
|
923
|
-
response:
|
|
924
|
-
id: PgAttr<PgAttr<
|
|
925
|
-
createdAt: PgAttr<PgAttr<
|
|
926
|
-
type:
|
|
927
|
-
action:
|
|
928
|
-
severity: PgAttr<
|
|
929
|
-
userId:
|
|
930
|
-
userRealm:
|
|
931
|
-
userEmail:
|
|
932
|
-
resourceType:
|
|
933
|
-
resourceId:
|
|
934
|
-
description:
|
|
935
|
-
metadata:
|
|
936
|
-
ipAddress:
|
|
937
|
-
userAgent:
|
|
938
|
-
sessionId:
|
|
939
|
-
requestId:
|
|
940
|
-
success: PgAttr<
|
|
941
|
-
errorMessage:
|
|
732
|
+
response: alepha381.TObject<{
|
|
733
|
+
id: PgAttr<PgAttr<alepha381.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
734
|
+
createdAt: PgAttr<PgAttr<alepha381.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
735
|
+
type: alepha381.TString;
|
|
736
|
+
action: alepha381.TString;
|
|
737
|
+
severity: PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
738
|
+
userId: alepha381.TOptional<alepha381.TString>;
|
|
739
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
740
|
+
userEmail: alepha381.TOptional<alepha381.TString>;
|
|
741
|
+
resourceType: alepha381.TOptional<alepha381.TString>;
|
|
742
|
+
resourceId: alepha381.TOptional<alepha381.TString>;
|
|
743
|
+
description: alepha381.TOptional<alepha381.TString>;
|
|
744
|
+
metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
|
|
745
|
+
ipAddress: alepha381.TOptional<alepha381.TString>;
|
|
746
|
+
userAgent: alepha381.TOptional<alepha381.TString>;
|
|
747
|
+
sessionId: alepha381.TOptional<alepha381.TString>;
|
|
748
|
+
requestId: alepha381.TOptional<alepha381.TString>;
|
|
749
|
+
success: PgAttr<alepha381.TBoolean, typeof PG_DEFAULT>;
|
|
750
|
+
errorMessage: alepha381.TOptional<alepha381.TString>;
|
|
942
751
|
}>;
|
|
943
752
|
}>;
|
|
944
753
|
/**
|
|
945
|
-
|
|
946
|
-
|
|
754
|
+
* Get audit entries for a specific user.
|
|
755
|
+
*/
|
|
947
756
|
readonly findByUser: alepha_server0.ActionPrimitiveFn<{
|
|
948
|
-
params:
|
|
949
|
-
userId:
|
|
757
|
+
params: alepha381.TObject<{
|
|
758
|
+
userId: alepha381.TString;
|
|
950
759
|
}>;
|
|
951
|
-
query:
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
760
|
+
query: alepha381.TObject<{
|
|
761
|
+
type: alepha381.TOptional<alepha381.TString>;
|
|
762
|
+
search: alepha381.TOptional<alepha381.TString>;
|
|
763
|
+
action: alepha381.TOptional<alepha381.TString>;
|
|
764
|
+
severity: alepha381.TOptional<alepha381.TUnsafe<"info" | "warning" | "critical">>;
|
|
765
|
+
sort: alepha381.TOptional<alepha381.TString>;
|
|
766
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
767
|
+
resourceType: alepha381.TOptional<alepha381.TString>;
|
|
768
|
+
resourceId: alepha381.TOptional<alepha381.TString>;
|
|
769
|
+
success: alepha381.TOptional<alepha381.TBoolean>;
|
|
770
|
+
page: alepha381.TOptional<alepha381.TInteger>;
|
|
771
|
+
size: alepha381.TOptional<alepha381.TInteger>;
|
|
772
|
+
from: alepha381.TOptional<alepha381.TString>;
|
|
773
|
+
to: alepha381.TOptional<alepha381.TString>;
|
|
965
774
|
}>;
|
|
966
|
-
response:
|
|
967
|
-
id: PgAttr<PgAttr<
|
|
968
|
-
createdAt: PgAttr<PgAttr<
|
|
969
|
-
type:
|
|
970
|
-
action:
|
|
971
|
-
severity: PgAttr<
|
|
972
|
-
userId:
|
|
973
|
-
userRealm:
|
|
974
|
-
userEmail:
|
|
975
|
-
resourceType:
|
|
976
|
-
resourceId:
|
|
977
|
-
description:
|
|
978
|
-
metadata:
|
|
979
|
-
ipAddress:
|
|
980
|
-
userAgent:
|
|
981
|
-
sessionId:
|
|
982
|
-
requestId:
|
|
983
|
-
success: PgAttr<
|
|
984
|
-
errorMessage:
|
|
775
|
+
response: alepha381.TPage<alepha381.TObject<{
|
|
776
|
+
id: PgAttr<PgAttr<alepha381.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
777
|
+
createdAt: PgAttr<PgAttr<alepha381.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
778
|
+
type: alepha381.TString;
|
|
779
|
+
action: alepha381.TString;
|
|
780
|
+
severity: PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
781
|
+
userId: alepha381.TOptional<alepha381.TString>;
|
|
782
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
783
|
+
userEmail: alepha381.TOptional<alepha381.TString>;
|
|
784
|
+
resourceType: alepha381.TOptional<alepha381.TString>;
|
|
785
|
+
resourceId: alepha381.TOptional<alepha381.TString>;
|
|
786
|
+
description: alepha381.TOptional<alepha381.TString>;
|
|
787
|
+
metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
|
|
788
|
+
ipAddress: alepha381.TOptional<alepha381.TString>;
|
|
789
|
+
userAgent: alepha381.TOptional<alepha381.TString>;
|
|
790
|
+
sessionId: alepha381.TOptional<alepha381.TString>;
|
|
791
|
+
requestId: alepha381.TOptional<alepha381.TString>;
|
|
792
|
+
success: PgAttr<alepha381.TBoolean, typeof PG_DEFAULT>;
|
|
793
|
+
errorMessage: alepha381.TOptional<alepha381.TString>;
|
|
985
794
|
}>>;
|
|
986
795
|
}>;
|
|
987
796
|
/**
|
|
988
|
-
|
|
989
|
-
|
|
797
|
+
* Get audit entries for a specific resource.
|
|
798
|
+
*/
|
|
990
799
|
readonly findByResource: alepha_server0.ActionPrimitiveFn<{
|
|
991
|
-
params:
|
|
992
|
-
resourceType:
|
|
993
|
-
resourceId:
|
|
800
|
+
params: alepha381.TObject<{
|
|
801
|
+
resourceType: alepha381.TString;
|
|
802
|
+
resourceId: alepha381.TString;
|
|
994
803
|
}>;
|
|
995
|
-
query:
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
804
|
+
query: alepha381.TObject<{
|
|
805
|
+
type: alepha381.TOptional<alepha381.TString>;
|
|
806
|
+
search: alepha381.TOptional<alepha381.TString>;
|
|
807
|
+
action: alepha381.TOptional<alepha381.TString>;
|
|
808
|
+
severity: alepha381.TOptional<alepha381.TUnsafe<"info" | "warning" | "critical">>;
|
|
809
|
+
sort: alepha381.TOptional<alepha381.TString>;
|
|
810
|
+
userId: alepha381.TOptional<alepha381.TString>;
|
|
811
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
812
|
+
success: alepha381.TOptional<alepha381.TBoolean>;
|
|
813
|
+
page: alepha381.TOptional<alepha381.TInteger>;
|
|
814
|
+
size: alepha381.TOptional<alepha381.TInteger>;
|
|
815
|
+
from: alepha381.TOptional<alepha381.TString>;
|
|
816
|
+
to: alepha381.TOptional<alepha381.TString>;
|
|
1008
817
|
}>;
|
|
1009
|
-
response:
|
|
1010
|
-
id: PgAttr<PgAttr<
|
|
1011
|
-
createdAt: PgAttr<PgAttr<
|
|
1012
|
-
type:
|
|
1013
|
-
action:
|
|
1014
|
-
severity: PgAttr<
|
|
1015
|
-
userId:
|
|
1016
|
-
userRealm:
|
|
1017
|
-
userEmail:
|
|
1018
|
-
resourceType:
|
|
1019
|
-
resourceId:
|
|
1020
|
-
description:
|
|
1021
|
-
metadata:
|
|
1022
|
-
ipAddress:
|
|
1023
|
-
userAgent:
|
|
1024
|
-
sessionId:
|
|
1025
|
-
requestId:
|
|
1026
|
-
success: PgAttr<
|
|
1027
|
-
errorMessage:
|
|
818
|
+
response: alepha381.TPage<alepha381.TObject<{
|
|
819
|
+
id: PgAttr<PgAttr<alepha381.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
820
|
+
createdAt: PgAttr<PgAttr<alepha381.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
821
|
+
type: alepha381.TString;
|
|
822
|
+
action: alepha381.TString;
|
|
823
|
+
severity: PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
824
|
+
userId: alepha381.TOptional<alepha381.TString>;
|
|
825
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
826
|
+
userEmail: alepha381.TOptional<alepha381.TString>;
|
|
827
|
+
resourceType: alepha381.TOptional<alepha381.TString>;
|
|
828
|
+
resourceId: alepha381.TOptional<alepha381.TString>;
|
|
829
|
+
description: alepha381.TOptional<alepha381.TString>;
|
|
830
|
+
metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
|
|
831
|
+
ipAddress: alepha381.TOptional<alepha381.TString>;
|
|
832
|
+
userAgent: alepha381.TOptional<alepha381.TString>;
|
|
833
|
+
sessionId: alepha381.TOptional<alepha381.TString>;
|
|
834
|
+
requestId: alepha381.TOptional<alepha381.TString>;
|
|
835
|
+
success: PgAttr<alepha381.TBoolean, typeof PG_DEFAULT>;
|
|
836
|
+
errorMessage: alepha381.TOptional<alepha381.TString>;
|
|
1028
837
|
}>>;
|
|
1029
838
|
}>;
|
|
1030
839
|
/**
|
|
1031
|
-
|
|
1032
|
-
|
|
840
|
+
* Get audit statistics.
|
|
841
|
+
*/
|
|
1033
842
|
readonly getStats: alepha_server0.ActionPrimitiveFn<{
|
|
1034
|
-
query:
|
|
1035
|
-
from:
|
|
1036
|
-
to:
|
|
1037
|
-
userRealm:
|
|
843
|
+
query: alepha381.TObject<{
|
|
844
|
+
from: alepha381.TOptional<alepha381.TString>;
|
|
845
|
+
to: alepha381.TOptional<alepha381.TString>;
|
|
846
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
1038
847
|
}>;
|
|
1039
|
-
response:
|
|
1040
|
-
total:
|
|
1041
|
-
byType:
|
|
1042
|
-
bySeverity:
|
|
1043
|
-
info:
|
|
1044
|
-
warning:
|
|
1045
|
-
critical:
|
|
848
|
+
response: alepha381.TObject<{
|
|
849
|
+
total: alepha381.TInteger;
|
|
850
|
+
byType: alepha381.TRecord<"^.*$", alepha381.TInteger>;
|
|
851
|
+
bySeverity: alepha381.TObject<{
|
|
852
|
+
info: alepha381.TInteger;
|
|
853
|
+
warning: alepha381.TInteger;
|
|
854
|
+
critical: alepha381.TInteger;
|
|
1046
855
|
}>;
|
|
1047
|
-
successRate:
|
|
1048
|
-
recentFailures:
|
|
1049
|
-
id: PgAttr<PgAttr<
|
|
1050
|
-
createdAt: PgAttr<PgAttr<
|
|
1051
|
-
type:
|
|
1052
|
-
action:
|
|
1053
|
-
severity: PgAttr<
|
|
1054
|
-
userId:
|
|
1055
|
-
userRealm:
|
|
1056
|
-
userEmail:
|
|
1057
|
-
resourceType:
|
|
1058
|
-
resourceId:
|
|
1059
|
-
description:
|
|
1060
|
-
metadata:
|
|
1061
|
-
ipAddress:
|
|
1062
|
-
userAgent:
|
|
1063
|
-
sessionId:
|
|
1064
|
-
requestId:
|
|
1065
|
-
success: PgAttr<
|
|
1066
|
-
errorMessage:
|
|
856
|
+
successRate: alepha381.TNumber;
|
|
857
|
+
recentFailures: alepha381.TArray<alepha381.TObject<{
|
|
858
|
+
id: PgAttr<PgAttr<alepha381.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
859
|
+
createdAt: PgAttr<PgAttr<alepha381.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
860
|
+
type: alepha381.TString;
|
|
861
|
+
action: alepha381.TString;
|
|
862
|
+
severity: PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
863
|
+
userId: alepha381.TOptional<alepha381.TString>;
|
|
864
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
865
|
+
userEmail: alepha381.TOptional<alepha381.TString>;
|
|
866
|
+
resourceType: alepha381.TOptional<alepha381.TString>;
|
|
867
|
+
resourceId: alepha381.TOptional<alepha381.TString>;
|
|
868
|
+
description: alepha381.TOptional<alepha381.TString>;
|
|
869
|
+
metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
|
|
870
|
+
ipAddress: alepha381.TOptional<alepha381.TString>;
|
|
871
|
+
userAgent: alepha381.TOptional<alepha381.TString>;
|
|
872
|
+
sessionId: alepha381.TOptional<alepha381.TString>;
|
|
873
|
+
requestId: alepha381.TOptional<alepha381.TString>;
|
|
874
|
+
success: PgAttr<alepha381.TBoolean, typeof PG_DEFAULT>;
|
|
875
|
+
errorMessage: alepha381.TOptional<alepha381.TString>;
|
|
1067
876
|
}>>;
|
|
1068
877
|
}>;
|
|
1069
878
|
}>;
|
|
1070
879
|
/**
|
|
1071
|
-
|
|
1072
|
-
|
|
880
|
+
* Get registered audit types.
|
|
881
|
+
*/
|
|
1073
882
|
readonly getTypes: alepha_server0.ActionPrimitiveFn<{
|
|
1074
|
-
response:
|
|
1075
|
-
type:
|
|
1076
|
-
description:
|
|
1077
|
-
actions:
|
|
883
|
+
response: alepha381.TArray<alepha381.TObject<{
|
|
884
|
+
type: alepha381.TString;
|
|
885
|
+
description: alepha381.TOptional<alepha381.TString>;
|
|
886
|
+
actions: alepha381.TArray<alepha381.TString>;
|
|
1078
887
|
}>>;
|
|
1079
888
|
}>;
|
|
1080
889
|
/**
|
|
1081
|
-
|
|
1082
|
-
|
|
890
|
+
* Get distinct values for filters.
|
|
891
|
+
*/
|
|
1083
892
|
readonly getFilterOptions: alepha_server0.ActionPrimitiveFn<{
|
|
1084
|
-
response:
|
|
1085
|
-
types:
|
|
1086
|
-
actions:
|
|
1087
|
-
resourceTypes:
|
|
1088
|
-
userRealms:
|
|
893
|
+
response: alepha381.TObject<{
|
|
894
|
+
types: alepha381.TArray<alepha381.TString>;
|
|
895
|
+
actions: alepha381.TArray<alepha381.TString>;
|
|
896
|
+
resourceTypes: alepha381.TArray<alepha381.TString>;
|
|
897
|
+
userRealms: alepha381.TArray<alepha381.TString>;
|
|
1089
898
|
}>;
|
|
1090
899
|
}>;
|
|
1091
900
|
}
|
|
@@ -1096,16 +905,16 @@ declare class AdminAuditController {
|
|
|
1096
905
|
*/
|
|
1097
906
|
interface AuditPrimitiveOptions {
|
|
1098
907
|
/**
|
|
1099
|
-
|
|
1100
|
-
|
|
908
|
+
* Unique audit type identifier (e.g., "auth", "payment", "order").
|
|
909
|
+
*/
|
|
1101
910
|
type: string;
|
|
1102
911
|
/**
|
|
1103
|
-
|
|
1104
|
-
|
|
912
|
+
* Human-readable description of this audit type.
|
|
913
|
+
*/
|
|
1105
914
|
description?: string;
|
|
1106
915
|
/**
|
|
1107
|
-
|
|
1108
|
-
|
|
916
|
+
* List of allowed actions for this audit type.
|
|
917
|
+
*/
|
|
1109
918
|
actions: string[];
|
|
1110
919
|
}
|
|
1111
920
|
/**
|
|
@@ -1137,32 +946,32 @@ interface AuditPrimitiveOptions {
|
|
|
1137
946
|
declare class AuditPrimitive extends Primitive<AuditPrimitiveOptions> {
|
|
1138
947
|
protected readonly auditService: AuditService;
|
|
1139
948
|
/**
|
|
1140
|
-
|
|
1141
|
-
|
|
949
|
+
* The audit type identifier.
|
|
950
|
+
*/
|
|
1142
951
|
get type(): string;
|
|
1143
952
|
/**
|
|
1144
|
-
|
|
1145
|
-
|
|
953
|
+
* The audit type description.
|
|
954
|
+
*/
|
|
1146
955
|
get description(): string | undefined;
|
|
1147
956
|
/**
|
|
1148
|
-
|
|
1149
|
-
|
|
957
|
+
* The allowed actions for this audit type.
|
|
958
|
+
*/
|
|
1150
959
|
get actions(): string[];
|
|
1151
960
|
/**
|
|
1152
|
-
|
|
1153
|
-
|
|
961
|
+
* Log an audit event for this type.
|
|
962
|
+
*/
|
|
1154
963
|
log(action: string, options?: AuditLogOptions): Promise<void>;
|
|
1155
964
|
/**
|
|
1156
|
-
|
|
1157
|
-
|
|
965
|
+
* Log a successful audit event.
|
|
966
|
+
*/
|
|
1158
967
|
logSuccess(action: string, options?: Omit<AuditLogOptions, "success">): Promise<void>;
|
|
1159
968
|
/**
|
|
1160
|
-
|
|
1161
|
-
|
|
969
|
+
* Log a failed audit event.
|
|
970
|
+
*/
|
|
1162
971
|
logFailure(action: string, errorMessage: string, options?: Omit<AuditLogOptions, "success" | "errorMessage">): Promise<void>;
|
|
1163
972
|
/**
|
|
1164
|
-
|
|
1165
|
-
|
|
973
|
+
* Called during initialization to register this audit type.
|
|
974
|
+
*/
|
|
1166
975
|
protected onInit(): void;
|
|
1167
976
|
}
|
|
1168
977
|
/**
|
|
@@ -1207,25 +1016,25 @@ declare const $audit: {
|
|
|
1207
1016
|
/**
|
|
1208
1017
|
* Resource schema for audit log responses.
|
|
1209
1018
|
*/
|
|
1210
|
-
declare const auditResourceSchema:
|
|
1211
|
-
id: PgAttr<PgAttr<
|
|
1212
|
-
createdAt: PgAttr<PgAttr<
|
|
1213
|
-
type:
|
|
1214
|
-
action:
|
|
1215
|
-
severity: PgAttr<
|
|
1216
|
-
userId:
|
|
1217
|
-
userRealm:
|
|
1218
|
-
userEmail:
|
|
1219
|
-
resourceType:
|
|
1220
|
-
resourceId:
|
|
1221
|
-
description:
|
|
1222
|
-
metadata:
|
|
1223
|
-
ipAddress:
|
|
1224
|
-
userAgent:
|
|
1225
|
-
sessionId:
|
|
1226
|
-
requestId:
|
|
1227
|
-
success: PgAttr<
|
|
1228
|
-
errorMessage:
|
|
1019
|
+
declare const auditResourceSchema: alepha381.TObject<{
|
|
1020
|
+
id: PgAttr<PgAttr<alepha381.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1021
|
+
createdAt: PgAttr<PgAttr<alepha381.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1022
|
+
type: alepha381.TString;
|
|
1023
|
+
action: alepha381.TString;
|
|
1024
|
+
severity: PgAttr<alepha381.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
1025
|
+
userId: alepha381.TOptional<alepha381.TString>;
|
|
1026
|
+
userRealm: alepha381.TOptional<alepha381.TString>;
|
|
1027
|
+
userEmail: alepha381.TOptional<alepha381.TString>;
|
|
1028
|
+
resourceType: alepha381.TOptional<alepha381.TString>;
|
|
1029
|
+
resourceId: alepha381.TOptional<alepha381.TString>;
|
|
1030
|
+
description: alepha381.TOptional<alepha381.TString>;
|
|
1031
|
+
metadata: alepha381.TOptional<alepha381.TRecord<string, alepha381.TAny>>;
|
|
1032
|
+
ipAddress: alepha381.TOptional<alepha381.TString>;
|
|
1033
|
+
userAgent: alepha381.TOptional<alepha381.TString>;
|
|
1034
|
+
sessionId: alepha381.TOptional<alepha381.TString>;
|
|
1035
|
+
requestId: alepha381.TOptional<alepha381.TString>;
|
|
1036
|
+
success: PgAttr<alepha381.TBoolean, typeof PG_DEFAULT>;
|
|
1037
|
+
errorMessage: alepha381.TOptional<alepha381.TString>;
|
|
1229
1038
|
}>;
|
|
1230
1039
|
type AuditResource = Static<typeof auditResourceSchema>;
|
|
1231
1040
|
//#endregion
|
|
@@ -1268,7 +1077,7 @@ type AuditResource = Static<typeof auditResourceSchema>;
|
|
|
1268
1077
|
* }
|
|
1269
1078
|
* ```
|
|
1270
1079
|
*/
|
|
1271
|
-
declare const AlephaApiAudits:
|
|
1080
|
+
declare const AlephaApiAudits: alepha381.Service<alepha381.Module>;
|
|
1272
1081
|
//#endregion
|
|
1273
1082
|
export { $audit, AdminAuditController, AlephaApiAudits, AuditEntity, AuditLogOptions, AuditPrimitive, AuditPrimitiveOptions, AuditQuery, AuditResource, AuditService, AuditSeverity, AuditStats, AuditTypeDefinition, CreateAudit, auditEntityInsertSchema, auditEntitySchema, auditQuerySchema, auditResourceSchema, auditSeveritySchema, audits, createAuditSchema };
|
|
1274
1083
|
//# sourceMappingURL=index.d.ts.map
|