alepha 0.14.4 → 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 +1 -4
- package/dist/api/audits/index.d.ts +619 -731
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/files/index.d.ts +185 -298
- 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 -356
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/notifications/index.d.ts +238 -350
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/parameters/index.d.ts +499 -611
- 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 +1697 -1804
- 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 +132 -132
- 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 +302 -299
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +966 -564
- package/dist/cli/index.js.map +1 -1
- package/dist/command/index.d.ts +303 -299
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +11 -7
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +419 -99
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +718 -625
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +420 -99
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +419 -99
- 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/mcp/index.d.ts +197 -197
- package/dist/mcp/index.d.ts.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 +1205 -1057
- package/dist/orm/index.d.ts.map +1 -1
- package/dist/orm/index.js +2056 -1753
- 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 +277 -277
- 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 +60 -57
- package/dist/server/cache/index.d.ts.map +1 -1
- package/dist/server/cache/index.js +1 -1
- package/dist/server/cache/index.js.map +1 -1
- package/dist/server/compress/index.d.ts +3 -3
- package/dist/server/compress/index.d.ts.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.d.ts +242 -150
- package/dist/server/core/index.d.ts.map +1 -1
- package/dist/server/core/index.js +288 -122
- 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 +84 -85
- 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/swagger/index.d.ts +48 -49
- package/dist/server/swagger/index.d.ts.map +1 -1
- package/dist/server/swagger/index.js +1 -2
- 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 +5720 -159
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +41 -18
- 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/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/commands/build.ts +41 -21
- package/src/cli/commands/db.ts +21 -18
- package/src/cli/commands/deploy.ts +17 -5
- package/src/cli/commands/dev.ts +13 -17
- package/src/cli/commands/format.ts +8 -2
- package/src/cli/commands/init.ts +74 -29
- package/src/cli/commands/lint.ts +8 -2
- package/src/cli/commands/test.ts +8 -2
- package/src/cli/commands/typecheck.ts +5 -1
- package/src/cli/commands/verify.ts +4 -2
- package/src/cli/services/AlephaCliUtils.ts +39 -600
- package/src/cli/services/PackageManagerUtils.ts +301 -0
- package/src/cli/services/ProjectScaffolder.ts +306 -0
- package/src/command/helpers/Runner.ts +15 -3
- 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/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 +19 -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/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.ts +1 -1
- package/src/server/cookies/providers/ServerCookiesProvider.ts +3 -3
- 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 +144 -21
- 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/swagger/index.ts +1 -1
- 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/tasks/buildServer.ts +12 -1
- package/src/vite/tasks/devServer.ts +3 -1
- package/src/vite/tasks/generateCloudflare.ts +7 -0
- 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/server/security/index.browser.ts +0 -10
- package/src/server/security/index.ts +0 -94
- /package/src/{server/security → security}/primitives/$basicAuth.ts +0 -0
- /package/src/{server/security → security}/providers/ServerBasicAuthProvider.ts +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha23 from "alepha";
|
|
2
2
|
import { Alepha, AlephaError, Page, PageQuery, Primitive, Static, StaticEncode, TNull, TObject, TOptional, TSchema, TUnion } from "alepha";
|
|
3
3
|
import * as alepha_api_notifications0 from "alepha/api/notifications";
|
|
4
4
|
import { VerificationController } from "alepha/api/verifications";
|
|
5
5
|
import * as alepha_server0 from "alepha/server";
|
|
6
|
-
import * as
|
|
6
|
+
import * as alepha_orm24 from "alepha/orm";
|
|
7
7
|
import { Page as Page$1, Repository } from "alepha/orm";
|
|
8
8
|
import { AuditService } from "alepha/api/audits";
|
|
9
9
|
import * as alepha_logger5 from "alepha/logger";
|
|
10
10
|
import * as alepha_bucket0 from "alepha/bucket";
|
|
11
|
-
import * as
|
|
11
|
+
import * as alepha_server_links0 from "alepha/server/links";
|
|
12
|
+
import { OAuth2Profile, ServerAuthProvider, WithLinkFn, WithLoginFn } from "alepha/server/auth";
|
|
12
13
|
import * as alepha_cache0 from "alepha/cache";
|
|
13
14
|
import { DateTime, DateTimeProvider } from "alepha/datetime";
|
|
14
|
-
import { CryptoProvider,
|
|
15
|
-
import { OAuth2Profile, ServerAuthProvider, WithLinkFn, WithLoginFn } from "alepha/server/auth";
|
|
15
|
+
import { CryptoProvider, IssuerPrimitive, IssuerPrimitiveOptions, UserAccount } from "alepha/security";
|
|
16
16
|
import { FileSystemProvider } from "alepha/file";
|
|
17
17
|
import { FileController } from "alepha/api/files";
|
|
18
18
|
import "drizzle-orm/d1";
|
|
@@ -24,33 +24,31 @@ import { PgTransactionConfig } from "drizzle-orm/pg-core/session";
|
|
|
24
24
|
import * as DrizzleKit from "drizzle-kit/api";
|
|
25
25
|
import "alepha/retry";
|
|
26
26
|
import "drizzle-orm/sqlite-core";
|
|
27
|
-
import "alepha/lock";
|
|
28
|
-
import "drizzle-orm/postgres-js";
|
|
29
|
-
import "postgres";
|
|
30
27
|
|
|
31
28
|
//#region ../../src/api/users/atoms/realmAuthSettingsAtom.d.ts
|
|
32
|
-
declare const realmAuthSettingsAtom:
|
|
33
|
-
displayName:
|
|
34
|
-
description:
|
|
35
|
-
logoUrl:
|
|
36
|
-
registrationAllowed:
|
|
37
|
-
emailEnabled:
|
|
38
|
-
emailRequired:
|
|
39
|
-
usernameEnabled:
|
|
40
|
-
usernameRequired:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
29
|
+
declare const realmAuthSettingsAtom: alepha23.Atom<alepha23.TObject<{
|
|
30
|
+
displayName: alepha23.TOptional<alepha23.TString>;
|
|
31
|
+
description: alepha23.TOptional<alepha23.TString>;
|
|
32
|
+
logoUrl: alepha23.TOptional<alepha23.TString>;
|
|
33
|
+
registrationAllowed: alepha23.TBoolean;
|
|
34
|
+
emailEnabled: alepha23.TBoolean;
|
|
35
|
+
emailRequired: alepha23.TBoolean;
|
|
36
|
+
usernameEnabled: alepha23.TBoolean;
|
|
37
|
+
usernameRequired: alepha23.TBoolean;
|
|
38
|
+
usernameRegExp: alepha23.TString;
|
|
39
|
+
phoneEnabled: alepha23.TBoolean;
|
|
40
|
+
phoneRequired: alepha23.TBoolean;
|
|
41
|
+
verifyEmailRequired: alepha23.TBoolean;
|
|
42
|
+
verifyPhoneRequired: alepha23.TBoolean;
|
|
43
|
+
firstNameLastNameEnabled: alepha23.TBoolean;
|
|
44
|
+
firstNameLastNameRequired: alepha23.TBoolean;
|
|
45
|
+
resetPasswordAllowed: alepha23.TBoolean;
|
|
46
|
+
passwordPolicy: alepha23.TObject<{
|
|
47
|
+
minLength: alepha23.TInteger;
|
|
48
|
+
requireUppercase: alepha23.TBoolean;
|
|
49
|
+
requireLowercase: alepha23.TBoolean;
|
|
50
|
+
requireNumbers: alepha23.TBoolean;
|
|
51
|
+
requireSpecialCharacters: alepha23.TBoolean;
|
|
54
52
|
}>;
|
|
55
53
|
}>, "alepha.api.users.realmAuthSettings">;
|
|
56
54
|
type RealmAuthSettings = Static<typeof realmAuthSettingsAtom.schema>;
|
|
@@ -85,114 +83,114 @@ type TObjectUpdate<T extends TObject> = TObject<{ [K in keyof T["properties"]]:
|
|
|
85
83
|
//#region ../../src/orm/primitives/$entity.d.ts
|
|
86
84
|
interface EntityPrimitiveOptions<T extends TObject, Keys = keyof Static<T>> {
|
|
87
85
|
/**
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
* The database table name that will be created for this entity.
|
|
87
|
+
* If not provided, name will be inferred from the $repository variable name.
|
|
88
|
+
*/
|
|
91
89
|
name: string;
|
|
92
90
|
/**
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
* TypeBox schema defining the table structure and column types.
|
|
92
|
+
*/
|
|
95
93
|
schema: T;
|
|
96
94
|
/**
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
* Database indexes to create for query optimization.
|
|
96
|
+
*/
|
|
99
97
|
indexes?: (Keys | {
|
|
100
98
|
/**
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
* Single column to index.
|
|
100
|
+
*/
|
|
103
101
|
column: Keys;
|
|
104
102
|
/**
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
104
|
+
*/
|
|
107
105
|
unique?: boolean;
|
|
108
106
|
/**
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
* Custom name for the index. If not provided, generates name automatically.
|
|
108
|
+
*/
|
|
111
109
|
name?: string;
|
|
112
110
|
} | {
|
|
113
111
|
/**
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
* Multiple columns for composite index (order matters for query optimization).
|
|
113
|
+
*/
|
|
116
114
|
columns: Keys[];
|
|
117
115
|
/**
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
* Whether this should be a unique index (enforces uniqueness constraint).
|
|
117
|
+
*/
|
|
120
118
|
unique?: boolean;
|
|
121
119
|
/**
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
* Custom name for the index. If not provided, generates name automatically.
|
|
121
|
+
*/
|
|
124
122
|
name?: string;
|
|
125
123
|
})[];
|
|
126
124
|
/**
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
* Foreign key constraints to maintain referential integrity.
|
|
126
|
+
*/
|
|
129
127
|
foreignKeys?: Array<{
|
|
130
128
|
/**
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
* Optional name for the foreign key constraint.
|
|
130
|
+
*/
|
|
133
131
|
name?: string;
|
|
134
132
|
/**
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
* Local columns that reference the foreign table.
|
|
134
|
+
*/
|
|
137
135
|
columns: Array<keyof Static<T>>;
|
|
138
136
|
/**
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
137
|
+
* Referenced columns in the foreign table.
|
|
138
|
+
* Must be EntityColumn references from other entities.
|
|
139
|
+
*/
|
|
142
140
|
foreignColumns: Array<() => EntityColumn<any>>;
|
|
143
141
|
}>;
|
|
144
142
|
/**
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
143
|
+
* Additional table constraints for data validation.
|
|
144
|
+
*
|
|
145
|
+
* Constraints enforce business rules at the database level, providing
|
|
146
|
+
* an additional layer of data integrity beyond application validation.
|
|
147
|
+
*
|
|
148
|
+
* **Constraint Types**:
|
|
149
|
+
* - **Unique constraints**: Prevent duplicate values across columns
|
|
150
|
+
* - **Check constraints**: Enforce custom validation rules with SQL expressions
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```ts
|
|
154
|
+
* constraints: [
|
|
155
|
+
* {
|
|
156
|
+
* name: "unique_user_email",
|
|
157
|
+
* columns: ["email"],
|
|
158
|
+
* unique: true
|
|
159
|
+
* },
|
|
160
|
+
* {
|
|
161
|
+
* name: "valid_age_range",
|
|
162
|
+
* columns: ["age"],
|
|
163
|
+
* check: sql`age >= 0 AND age <= 150`
|
|
164
|
+
* },
|
|
165
|
+
* {
|
|
166
|
+
* name: "unique_user_username_per_tenant",
|
|
167
|
+
* columns: ["tenantId", "username"],
|
|
168
|
+
* unique: true
|
|
169
|
+
* }
|
|
170
|
+
* ]
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
175
173
|
constraints?: Array<{
|
|
176
174
|
/**
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
* Columns involved in this constraint.
|
|
176
|
+
*/
|
|
179
177
|
columns: Array<keyof Static<T>>;
|
|
180
178
|
/**
|
|
181
|
-
|
|
182
|
-
|
|
179
|
+
* Optional name for the constraint.
|
|
180
|
+
*/
|
|
183
181
|
name?: string;
|
|
184
182
|
/**
|
|
185
|
-
|
|
186
|
-
|
|
183
|
+
* Whether this is a unique constraint.
|
|
184
|
+
*/
|
|
187
185
|
unique?: boolean | {};
|
|
188
186
|
/**
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
* SQL expression for check constraint validation.
|
|
188
|
+
*/
|
|
191
189
|
check?: SQL;
|
|
192
190
|
}>;
|
|
193
191
|
/**
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
* Advanced Drizzle ORM configuration for complex table setups.
|
|
193
|
+
*/
|
|
196
194
|
config?: (self: BuildExtraConfigColumns<string, FromSchema<T>, "pg">) => PgTableExtraConfigValue[];
|
|
197
195
|
}
|
|
198
196
|
declare class EntityPrimitive<T extends TObject = TObject> {
|
|
@@ -246,8 +244,8 @@ type PgSymbols = {
|
|
|
246
244
|
[PG_REF]: PgRefOptions;
|
|
247
245
|
[PG_ENUM]: PgEnumOptions;
|
|
248
246
|
/**
|
|
249
|
-
|
|
250
|
-
|
|
247
|
+
* @deprecated Use `PG_IDENTITY` instead.
|
|
248
|
+
*/
|
|
251
249
|
[PG_SERIAL]: {};
|
|
252
250
|
};
|
|
253
251
|
type PgSymbolKeys = keyof PgSymbols;
|
|
@@ -280,416 +278,416 @@ declare class DbError extends AlephaError {
|
|
|
280
278
|
//#region ../../src/orm/interfaces/FilterOperators.d.ts
|
|
281
279
|
interface FilterOperators<TValue> {
|
|
282
280
|
/**
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
281
|
+
* Test that two values are equal.
|
|
282
|
+
*
|
|
283
|
+
* Remember that the SQL standard dictates that
|
|
284
|
+
* two NULL values are not equal, so if you want to test
|
|
285
|
+
* whether a value is null, you may want to use
|
|
286
|
+
* `isNull` instead.
|
|
287
|
+
*
|
|
288
|
+
* ## Examples
|
|
289
|
+
*
|
|
290
|
+
* ```ts
|
|
291
|
+
* // Select cars made by Ford
|
|
292
|
+
* db.select().from(cars)
|
|
293
|
+
* .where(eq(cars.make, 'Ford'))
|
|
294
|
+
* ```
|
|
295
|
+
*
|
|
296
|
+
* @see isNull for a way to test equality to NULL.
|
|
297
|
+
*/
|
|
300
298
|
eq?: TValue;
|
|
301
299
|
/**
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
300
|
+
* Test that two values are not equal.
|
|
301
|
+
*
|
|
302
|
+
* Remember that the SQL standard dictates that
|
|
303
|
+
* two NULL values are not equal, so if you want to test
|
|
304
|
+
* whether a value is not null, you may want to use
|
|
305
|
+
* `isNotNull` instead.
|
|
306
|
+
*
|
|
307
|
+
* ## Examples
|
|
308
|
+
*
|
|
309
|
+
* ```ts
|
|
310
|
+
* // Select cars not made by Ford
|
|
311
|
+
* db.select().from(cars)
|
|
312
|
+
* .where(ne(cars.make, 'Ford'))
|
|
313
|
+
* ```
|
|
314
|
+
*
|
|
315
|
+
* @see isNotNull for a way to test whether a value is not null.
|
|
316
|
+
*/
|
|
319
317
|
ne?: TValue;
|
|
320
318
|
/**
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
319
|
+
* Test that the first expression passed is greater than
|
|
320
|
+
* the second expression.
|
|
321
|
+
*
|
|
322
|
+
* ## Examples
|
|
323
|
+
*
|
|
324
|
+
* ```ts
|
|
325
|
+
* // Select cars made after 2000.
|
|
326
|
+
* db.select().from(cars)
|
|
327
|
+
* .where(gt(cars.year, 2000))
|
|
328
|
+
* ```
|
|
329
|
+
*
|
|
330
|
+
* @see gte for greater-than-or-equal
|
|
331
|
+
*/
|
|
334
332
|
gt?: TValue;
|
|
335
333
|
/**
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
334
|
+
* Test that the first expression passed is greater than
|
|
335
|
+
* or equal to the second expression. Use `gt` to
|
|
336
|
+
* test whether an expression is strictly greater
|
|
337
|
+
* than another.
|
|
338
|
+
*
|
|
339
|
+
* ## Examples
|
|
340
|
+
*
|
|
341
|
+
* ```ts
|
|
342
|
+
* // Select cars made on or after 2000.
|
|
343
|
+
* db.select().from(cars)
|
|
344
|
+
* .where(gte(cars.year, 2000))
|
|
345
|
+
* ```
|
|
346
|
+
*
|
|
347
|
+
* @see gt for a strictly greater-than condition
|
|
348
|
+
*/
|
|
351
349
|
gte?: TValue;
|
|
352
350
|
/**
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
351
|
+
* Test that the first expression passed is less than
|
|
352
|
+
* the second expression.
|
|
353
|
+
*
|
|
354
|
+
* ## Examples
|
|
355
|
+
*
|
|
356
|
+
* ```ts
|
|
357
|
+
* // Select cars made before 2000.
|
|
358
|
+
* db.select().from(cars)
|
|
359
|
+
* .where(lt(cars.year, 2000))
|
|
360
|
+
* ```
|
|
361
|
+
*
|
|
362
|
+
* @see lte for greater-than-or-equal
|
|
363
|
+
*/
|
|
366
364
|
lt?: TValue;
|
|
367
365
|
/**
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
366
|
+
* Test that the first expression passed is less than
|
|
367
|
+
* or equal to the second expression.
|
|
368
|
+
*
|
|
369
|
+
* ## Examples
|
|
370
|
+
*
|
|
371
|
+
* ```ts
|
|
372
|
+
* // Select cars made before 2000.
|
|
373
|
+
* db.select().from(cars)
|
|
374
|
+
* .where(lte(cars.year, 2000))
|
|
375
|
+
* ```
|
|
376
|
+
*
|
|
377
|
+
* @see lt for a strictly less-than condition
|
|
378
|
+
*/
|
|
381
379
|
lte?: TValue;
|
|
382
380
|
/**
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
381
|
+
* Test whether the first parameter, a column or expression,
|
|
382
|
+
* has a value from a list passed as the second argument.
|
|
383
|
+
*
|
|
384
|
+
* ## Throws
|
|
385
|
+
*
|
|
386
|
+
* The argument passed in the second array can't be empty:
|
|
387
|
+
* if an empty is provided, this method will throw.
|
|
388
|
+
*
|
|
389
|
+
* ## Examples
|
|
390
|
+
*
|
|
391
|
+
* ```ts
|
|
392
|
+
* // Select cars made by Ford or GM.
|
|
393
|
+
* db.select().from(cars)
|
|
394
|
+
* .where(inArray(cars.make, ['Ford', 'GM']))
|
|
395
|
+
* ```
|
|
396
|
+
*
|
|
397
|
+
* @see notInArray for the inverse of this test
|
|
398
|
+
*/
|
|
401
399
|
inArray?: TValue[];
|
|
402
400
|
/**
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
401
|
+
* Test whether the first parameter, a column or expression,
|
|
402
|
+
* has a value that is not present in a list passed as the
|
|
403
|
+
* second argument.
|
|
404
|
+
*
|
|
405
|
+
* ## Throws
|
|
406
|
+
*
|
|
407
|
+
* The argument passed in the second array can't be empty:
|
|
408
|
+
* if an empty is provided, this method will throw.
|
|
409
|
+
*
|
|
410
|
+
* ## Examples
|
|
411
|
+
*
|
|
412
|
+
* ```ts
|
|
413
|
+
* // Select cars made by any company except Ford or GM.
|
|
414
|
+
* db.select().from(cars)
|
|
415
|
+
* .where(notInArray(cars.make, ['Ford', 'GM']))
|
|
416
|
+
* ```
|
|
417
|
+
*
|
|
418
|
+
* @see inArray for the inverse of this test
|
|
419
|
+
*/
|
|
422
420
|
notInArray?: TValue[];
|
|
423
421
|
/**
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
422
|
+
* Test whether an expression is not NULL. By the SQL standard,
|
|
423
|
+
* NULL is neither equal nor not equal to itself, so
|
|
424
|
+
* it's recommended to use `isNull` and `notIsNull` for
|
|
425
|
+
* comparisons to NULL.
|
|
426
|
+
*
|
|
427
|
+
* ## Examples
|
|
428
|
+
*
|
|
429
|
+
* ```ts
|
|
430
|
+
* // Select cars that have been discontinued.
|
|
431
|
+
* db.select().from(cars)
|
|
432
|
+
* .where(isNotNull(cars.discontinuedAt))
|
|
433
|
+
* ```
|
|
434
|
+
*
|
|
435
|
+
* @see isNull for the inverse of this test
|
|
436
|
+
*/
|
|
439
437
|
isNotNull?: true;
|
|
440
438
|
/**
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
439
|
+
* Test whether an expression is NULL. By the SQL standard,
|
|
440
|
+
* NULL is neither equal nor not equal to itself, so
|
|
441
|
+
* it's recommended to use `isNull` and `notIsNull` for
|
|
442
|
+
* comparisons to NULL.
|
|
443
|
+
*
|
|
444
|
+
* ## Examples
|
|
445
|
+
*
|
|
446
|
+
* ```ts
|
|
447
|
+
* // Select cars that have no discontinuedAt date.
|
|
448
|
+
* db.select().from(cars)
|
|
449
|
+
* .where(isNull(cars.discontinuedAt))
|
|
450
|
+
* ```
|
|
451
|
+
*
|
|
452
|
+
* @see isNotNull for the inverse of this test
|
|
453
|
+
*/
|
|
456
454
|
isNull?: true;
|
|
457
455
|
/**
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
456
|
+
* Test whether an expression is between two values. This
|
|
457
|
+
* is an easier way to express range tests, which would be
|
|
458
|
+
* expressed mathematically as `x <= a <= y` but in SQL
|
|
459
|
+
* would have to be like `a >= x AND a <= y`.
|
|
460
|
+
*
|
|
461
|
+
* Between is inclusive of the endpoints: if `column`
|
|
462
|
+
* is equal to `min` or `max`, it will be TRUE.
|
|
463
|
+
*
|
|
464
|
+
* ## Examples
|
|
465
|
+
*
|
|
466
|
+
* ```ts
|
|
467
|
+
* // Select cars made between 1990 and 2000
|
|
468
|
+
* db.select().from(cars)
|
|
469
|
+
* .where(between(cars.year, 1990, 2000))
|
|
470
|
+
* ```
|
|
471
|
+
*
|
|
472
|
+
* @see notBetween for the inverse of this test
|
|
473
|
+
*/
|
|
476
474
|
between?: [number, number];
|
|
477
475
|
/**
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
476
|
+
* Test whether an expression is not between two values.
|
|
477
|
+
*
|
|
478
|
+
* This, like `between`, includes its endpoints, so if
|
|
479
|
+
* the `column` is equal to `min` or `max`, in this case
|
|
480
|
+
* it will evaluate to FALSE.
|
|
481
|
+
*
|
|
482
|
+
* ## Examples
|
|
483
|
+
*
|
|
484
|
+
* ```ts
|
|
485
|
+
* // Exclude cars made in the 1970s
|
|
486
|
+
* db.select().from(cars)
|
|
487
|
+
* .where(notBetween(cars.year, 1970, 1979))
|
|
488
|
+
* ```
|
|
489
|
+
*
|
|
490
|
+
* @see between for the inverse of this test
|
|
491
|
+
*/
|
|
494
492
|
notBetween?: [number, number];
|
|
495
493
|
/**
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
494
|
+
* Compare a column to a pattern, which can include `%` and `_`
|
|
495
|
+
* characters to match multiple variations. Including `%`
|
|
496
|
+
* in the pattern matches zero or more characters, and including
|
|
497
|
+
* `_` will match a single character.
|
|
498
|
+
*
|
|
499
|
+
* ## Examples
|
|
500
|
+
*
|
|
501
|
+
* ```ts
|
|
502
|
+
* // Select all cars with 'Turbo' in their names.
|
|
503
|
+
* db.select().from(cars)
|
|
504
|
+
* .where(like(cars.name, '%Turbo%'))
|
|
505
|
+
* ```
|
|
506
|
+
*
|
|
507
|
+
* @see ilike for a case-insensitive version of this condition
|
|
508
|
+
*/
|
|
511
509
|
like?: string;
|
|
512
510
|
/**
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
511
|
+
* The inverse of like - this tests that a given column
|
|
512
|
+
* does not match a pattern, which can include `%` and `_`
|
|
513
|
+
* characters to match multiple variations. Including `%`
|
|
514
|
+
* in the pattern matches zero or more characters, and including
|
|
515
|
+
* `_` will match a single character.
|
|
516
|
+
*
|
|
517
|
+
* ## Examples
|
|
518
|
+
*
|
|
519
|
+
* ```ts
|
|
520
|
+
* // Select all cars that don't have "ROver" in their name.
|
|
521
|
+
* db.select().from(cars)
|
|
522
|
+
* .where(notLike(cars.name, '%Rover%'))
|
|
523
|
+
* ```
|
|
524
|
+
*
|
|
525
|
+
* @see like for the inverse condition
|
|
526
|
+
* @see notIlike for a case-insensitive version of this condition
|
|
527
|
+
*/
|
|
530
528
|
notLike?: string;
|
|
531
529
|
/**
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
530
|
+
* Case-insensitively compare a column to a pattern,
|
|
531
|
+
* which can include `%` and `_`
|
|
532
|
+
* characters to match multiple variations. Including `%`
|
|
533
|
+
* in the pattern matches zero or more characters, and including
|
|
534
|
+
* `_` will match a single character.
|
|
535
|
+
*
|
|
536
|
+
* Unlike like, this performs a case-insensitive comparison.
|
|
537
|
+
*
|
|
538
|
+
* ## Examples
|
|
539
|
+
*
|
|
540
|
+
* ```ts
|
|
541
|
+
* // Select all cars with 'Turbo' in their names.
|
|
542
|
+
* db.select().from(cars)
|
|
543
|
+
* .where(ilike(cars.name, '%Turbo%'))
|
|
544
|
+
* ```
|
|
545
|
+
*
|
|
546
|
+
* @see like for a case-sensitive version of this condition
|
|
547
|
+
*/
|
|
550
548
|
ilike?: string;
|
|
551
549
|
/**
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
550
|
+
* The inverse of ilike - this case-insensitively tests that a given column
|
|
551
|
+
* does not match a pattern, which can include `%` and `_`
|
|
552
|
+
* characters to match multiple variations. Including `%`
|
|
553
|
+
* in the pattern matches zero or more characters, and including
|
|
554
|
+
* `_` will match a single character.
|
|
555
|
+
*
|
|
556
|
+
* ## Examples
|
|
557
|
+
*
|
|
558
|
+
* ```ts
|
|
559
|
+
* // Select all cars that don't have "Rover" in their name.
|
|
560
|
+
* db.select().from(cars)
|
|
561
|
+
* .where(notLike(cars.name, '%Rover%'))
|
|
562
|
+
* ```
|
|
563
|
+
*
|
|
564
|
+
* @see ilike for the inverse condition
|
|
565
|
+
* @see notLike for a case-sensitive version of this condition
|
|
566
|
+
*/
|
|
569
567
|
notIlike?: string;
|
|
570
568
|
/**
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
569
|
+
* Syntactic sugar for case-insensitive substring matching.
|
|
570
|
+
* Automatically wraps the value with `%` wildcards on both sides.
|
|
571
|
+
*
|
|
572
|
+
* Equivalent to: `ilike: '%value%'`
|
|
573
|
+
*
|
|
574
|
+
* ## Examples
|
|
575
|
+
*
|
|
576
|
+
* ```ts
|
|
577
|
+
* // Select all cars with "Turbo" anywhere in their name.
|
|
578
|
+
* db.select().from(cars)
|
|
579
|
+
* .where({ name: { contains: 'Turbo' } })
|
|
580
|
+
* // Same as: .where(ilike(cars.name, '%Turbo%'))
|
|
581
|
+
* ```
|
|
582
|
+
*
|
|
583
|
+
* @see ilike for manual pattern matching
|
|
584
|
+
* @see startsWith for prefix matching
|
|
585
|
+
* @see endsWith for suffix matching
|
|
586
|
+
*/
|
|
589
587
|
contains?: string;
|
|
590
588
|
/**
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
589
|
+
* Syntactic sugar for case-insensitive prefix matching.
|
|
590
|
+
* Automatically appends a `%` wildcard to the end of the value.
|
|
591
|
+
*
|
|
592
|
+
* Equivalent to: `ilike: 'value%'`
|
|
593
|
+
*
|
|
594
|
+
* ## Examples
|
|
595
|
+
*
|
|
596
|
+
* ```ts
|
|
597
|
+
* // Select all cars whose names start with "Ford".
|
|
598
|
+
* db.select().from(cars)
|
|
599
|
+
* .where({ name: { startsWith: 'Ford' } })
|
|
600
|
+
* // Same as: .where(ilike(cars.name, 'Ford%'))
|
|
601
|
+
* ```
|
|
602
|
+
*
|
|
603
|
+
* @see ilike for manual pattern matching
|
|
604
|
+
* @see contains for substring matching
|
|
605
|
+
* @see endsWith for suffix matching
|
|
606
|
+
*/
|
|
609
607
|
startsWith?: string;
|
|
610
608
|
/**
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
609
|
+
* Syntactic sugar for case-insensitive suffix matching.
|
|
610
|
+
* Automatically prepends a `%` wildcard to the beginning of the value.
|
|
611
|
+
*
|
|
612
|
+
* Equivalent to: `ilike: '%value'`
|
|
613
|
+
*
|
|
614
|
+
* ## Examples
|
|
615
|
+
*
|
|
616
|
+
* ```ts
|
|
617
|
+
* // Select all cars whose names end with "Turbo".
|
|
618
|
+
* db.select().from(cars)
|
|
619
|
+
* .where({ name: { endsWith: 'Turbo' } })
|
|
620
|
+
* // Same as: .where(ilike(cars.name, '%Turbo'))
|
|
621
|
+
* ```
|
|
622
|
+
*
|
|
623
|
+
* @see ilike for manual pattern matching
|
|
624
|
+
* @see contains for substring matching
|
|
625
|
+
* @see startsWith for prefix matching
|
|
626
|
+
*/
|
|
629
627
|
endsWith?: string;
|
|
630
628
|
/**
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
629
|
+
* Test that a column or expression contains all elements of
|
|
630
|
+
* the list passed as the second argument.
|
|
631
|
+
*
|
|
632
|
+
* ## Throws
|
|
633
|
+
*
|
|
634
|
+
* The argument passed in the second array can't be empty:
|
|
635
|
+
* if an empty is provided, this method will throw.
|
|
636
|
+
*
|
|
637
|
+
* ## Examples
|
|
638
|
+
*
|
|
639
|
+
* ```ts
|
|
640
|
+
* // Select posts where its tags contain "Typescript" and "ORM".
|
|
641
|
+
* db.select().from(posts)
|
|
642
|
+
* .where(arrayContains(posts.tags, ['Typescript', 'ORM']))
|
|
643
|
+
* ```
|
|
644
|
+
*
|
|
645
|
+
* @see arrayContained to find if an array contains all elements of a column or expression
|
|
646
|
+
* @see arrayOverlaps to find if a column or expression contains any elements of an array
|
|
647
|
+
*/
|
|
650
648
|
arrayContains?: TValue;
|
|
651
649
|
/**
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
650
|
+
* Test that the list passed as the second argument contains
|
|
651
|
+
* all elements of a column or expression.
|
|
652
|
+
*
|
|
653
|
+
* ## Throws
|
|
654
|
+
*
|
|
655
|
+
* The argument passed in the second array can't be empty:
|
|
656
|
+
* if an empty is provided, this method will throw.
|
|
657
|
+
*
|
|
658
|
+
* ## Examples
|
|
659
|
+
*
|
|
660
|
+
* ```ts
|
|
661
|
+
* // Select posts where its tags contain "Typescript", "ORM" or both,
|
|
662
|
+
* // but filtering posts that have additional tags.
|
|
663
|
+
* db.select().from(posts)
|
|
664
|
+
* .where(arrayContained(posts.tags, ['Typescript', 'ORM']))
|
|
665
|
+
* ```
|
|
666
|
+
*
|
|
667
|
+
* @see arrayContains to find if a column or expression contains all elements of an array
|
|
668
|
+
* @see arrayOverlaps to find if a column or expression contains any elements of an array
|
|
669
|
+
*/
|
|
672
670
|
arrayContained?: TValue;
|
|
673
671
|
/**
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
672
|
+
* Test that a column or expression contains any elements of
|
|
673
|
+
* the list passed as the second argument.
|
|
674
|
+
*
|
|
675
|
+
* ## Throws
|
|
676
|
+
*
|
|
677
|
+
* The argument passed in the second array can't be empty:
|
|
678
|
+
* if an empty is provided, this method will throw.
|
|
679
|
+
*
|
|
680
|
+
* ## Examples
|
|
681
|
+
*
|
|
682
|
+
* ```ts
|
|
683
|
+
* // Select posts where its tags contain "Typescript", "ORM" or both.
|
|
684
|
+
* db.select().from(posts)
|
|
685
|
+
* .where(arrayOverlaps(posts.tags, ['Typescript', 'ORM']))
|
|
686
|
+
* ```
|
|
687
|
+
*
|
|
688
|
+
* @see arrayContains to find if a column or expression contains all elements of an array
|
|
689
|
+
* @see arrayContained to find if an array contains all elements of a column or expression
|
|
690
|
+
*/
|
|
693
691
|
arrayOverlaps?: TValue;
|
|
694
692
|
}
|
|
695
693
|
//#endregion
|
|
@@ -748,71 +746,71 @@ type PgQueryWhereOrSQL<T extends TObject, Relations extends PgRelationMap<TObjec
|
|
|
748
746
|
type PgQueryWhereOperators<T extends TObject> = { [Key in keyof Static<T>]?: FilterOperators<Static<T>[Key]> | Static<T>[Key] };
|
|
749
747
|
type PgQueryWhereConditions<T extends TObject, Relations extends PgRelationMap<TObject> | undefined = undefined> = {
|
|
750
748
|
/**
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
749
|
+
* Combine a list of conditions with the `and` operator. Conditions
|
|
750
|
+
* that are equal `undefined` are automatically ignored.
|
|
751
|
+
*
|
|
752
|
+
* ## Examples
|
|
753
|
+
*
|
|
754
|
+
* ```ts
|
|
755
|
+
* db.select().from(cars)
|
|
756
|
+
* .where(
|
|
757
|
+
* and(
|
|
758
|
+
* eq(cars.make, 'Volvo'),
|
|
759
|
+
* eq(cars.year, 1950),
|
|
760
|
+
* )
|
|
761
|
+
* )
|
|
762
|
+
* ```
|
|
763
|
+
*/
|
|
766
764
|
and?: Array<PgQueryWhereOrSQL<T, Relations>>;
|
|
767
765
|
/**
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
766
|
+
* Combine a list of conditions with the `or` operator. Conditions
|
|
767
|
+
* that are equal `undefined` are automatically ignored.
|
|
768
|
+
*
|
|
769
|
+
* ## Examples
|
|
770
|
+
*
|
|
771
|
+
* ```ts
|
|
772
|
+
* db.select().from(cars)
|
|
773
|
+
* .where(
|
|
774
|
+
* or(
|
|
775
|
+
* eq(cars.make, 'GM'),
|
|
776
|
+
* eq(cars.make, 'Ford'),
|
|
777
|
+
* )
|
|
778
|
+
* )
|
|
779
|
+
* ```
|
|
780
|
+
*/
|
|
783
781
|
or?: Array<PgQueryWhereOrSQL<T, Relations>>;
|
|
784
782
|
/**
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
783
|
+
* Negate the meaning of an expression using the `not` keyword.
|
|
784
|
+
*
|
|
785
|
+
* ## Examples
|
|
786
|
+
*
|
|
787
|
+
* ```ts
|
|
788
|
+
* // Select cars _not_ made by GM or Ford.
|
|
789
|
+
* db.select().from(cars)
|
|
790
|
+
* .where(not(inArray(cars.make, ['GM', 'Ford'])))
|
|
791
|
+
* ```
|
|
792
|
+
*/
|
|
795
793
|
not?: PgQueryWhereOrSQL<T, Relations>;
|
|
796
794
|
/**
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
795
|
+
* Test whether a subquery evaluates to have any rows.
|
|
796
|
+
*
|
|
797
|
+
* ## Examples
|
|
798
|
+
*
|
|
799
|
+
* ```ts
|
|
800
|
+
* // Users whose `homeCity` column has a match in a cities
|
|
801
|
+
* // table.
|
|
802
|
+
* db
|
|
803
|
+
* .select()
|
|
804
|
+
* .from(users)
|
|
805
|
+
* .where(
|
|
806
|
+
* exists(db.select()
|
|
807
|
+
* .from(cities)
|
|
808
|
+
* .where(eq(users.homeCity, cities.id))),
|
|
809
|
+
* );
|
|
810
|
+
* ```
|
|
811
|
+
*
|
|
812
|
+
* @see notExists for the inverse of this test
|
|
813
|
+
*/
|
|
816
814
|
exists?: SQLWrapper;
|
|
817
815
|
};
|
|
818
816
|
type PgQueryWhereRelations<Relations extends PgRelationMap<TObject> | undefined = undefined> = Relations extends PgRelationMap<TObject> ? { [K in keyof Relations]?: PgQueryWhere<Relations[K]["join"]["schema"], Relations[K]["with"]> } : {};
|
|
@@ -833,8 +831,8 @@ interface PgAttrField {
|
|
|
833
831
|
//#region ../../src/orm/primitives/$sequence.d.ts
|
|
834
832
|
interface SequencePrimitiveOptions extends PgSequenceOptions {
|
|
835
833
|
/**
|
|
836
|
-
|
|
837
|
-
|
|
834
|
+
* The name of the sequence. If not provided, the property key will be used.
|
|
835
|
+
*/
|
|
838
836
|
name?: string;
|
|
839
837
|
provider?: DatabaseProvider;
|
|
840
838
|
}
|
|
@@ -874,33 +872,33 @@ interface TableConfigBuilders<TConfig> {
|
|
|
874
872
|
*/
|
|
875
873
|
declare abstract class ModelBuilder {
|
|
876
874
|
/**
|
|
877
|
-
|
|
878
|
-
|
|
875
|
+
* Build a table from an entity primitive.
|
|
876
|
+
*/
|
|
879
877
|
abstract buildTable(entity: EntityPrimitive, options: {
|
|
880
878
|
tables: Map<string, unknown>;
|
|
881
879
|
enums: Map<string, unknown>;
|
|
882
880
|
schema: string;
|
|
883
881
|
}): void;
|
|
884
882
|
/**
|
|
885
|
-
|
|
886
|
-
|
|
883
|
+
* Build a sequence from a sequence primitive.
|
|
884
|
+
*/
|
|
887
885
|
abstract buildSequence(sequence: SequencePrimitive, options: {
|
|
888
886
|
sequences: Map<string, unknown>;
|
|
889
887
|
schema: string;
|
|
890
888
|
}): void;
|
|
891
889
|
/**
|
|
892
|
-
|
|
893
|
-
|
|
890
|
+
* Convert camelCase to snake_case for column names.
|
|
891
|
+
*/
|
|
894
892
|
protected toColumnName(str: string): string;
|
|
895
893
|
/**
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
894
|
+
* Build the table configuration function for any database.
|
|
895
|
+
* This includes indexes, foreign keys, constraints, and custom config.
|
|
896
|
+
*
|
|
897
|
+
* @param entity - The entity primitive
|
|
898
|
+
* @param builders - Database-specific builder functions
|
|
899
|
+
* @param tableResolver - Function to resolve entity references to table columns
|
|
900
|
+
* @param customConfigHandler - Optional handler for custom config
|
|
901
|
+
*/
|
|
904
902
|
protected buildTableConfig<TConfig, TSelf>(entity: EntityPrimitive, builders: TableConfigBuilders<TConfig>, tableResolver?: (entityName: string) => any, customConfigHandler?: (config: any, self: TSelf) => TConfig[]): ((self: TSelf) => TConfig[]) | undefined;
|
|
905
903
|
}
|
|
906
904
|
//#endregion
|
|
@@ -909,44 +907,44 @@ declare class DrizzleKitProvider {
|
|
|
909
907
|
protected readonly log: alepha_logger5.Logger;
|
|
910
908
|
protected readonly alepha: Alepha;
|
|
911
909
|
/**
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
910
|
+
* Synchronize database with current schema definitions.
|
|
911
|
+
*
|
|
912
|
+
* In development mode, it will generate and execute migrations based on the current state.
|
|
913
|
+
* In testing mode, it will generate migrations from scratch without applying them.
|
|
914
|
+
*
|
|
915
|
+
* Does nothing in production mode, you must handle migrations manually.
|
|
916
|
+
*/
|
|
919
917
|
synchronize(provider: DatabaseProvider): Promise<void>;
|
|
920
918
|
/**
|
|
921
|
-
|
|
922
|
-
|
|
919
|
+
* Mostly used for testing purposes. You can generate SQL migration statements without executing them.
|
|
920
|
+
*/
|
|
923
921
|
generateMigration(provider: DatabaseProvider, prevSnapshot?: any): Promise<{
|
|
924
922
|
statements: string[];
|
|
925
923
|
models: Record<string, unknown>;
|
|
926
924
|
snapshot?: any;
|
|
927
925
|
}>;
|
|
928
926
|
/**
|
|
929
|
-
|
|
930
|
-
|
|
927
|
+
* Load all tables, enums, sequences, etc. from the provider's repositories.
|
|
928
|
+
*/
|
|
931
929
|
getModels(provider: DatabaseProvider): Record<string, unknown>;
|
|
932
930
|
/**
|
|
933
|
-
|
|
934
|
-
|
|
931
|
+
* Load the migration snapshot from the database.
|
|
932
|
+
*/
|
|
935
933
|
protected loadDevMigrations(provider: DatabaseProvider): Promise<DevMigrations | undefined>;
|
|
936
934
|
protected saveDevMigrations(provider: DatabaseProvider, curr: Record<string, any>, devMigrations?: DevMigrations): Promise<void>;
|
|
937
935
|
protected executeStatements(statements: string[], provider: DatabaseProvider, catchErrors?: boolean): Promise<void>;
|
|
938
936
|
protected createSchemaIfNotExists(provider: DatabaseProvider, schemaName: string): Promise<void>;
|
|
939
937
|
/**
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
938
|
+
* Try to load the official Drizzle Kit API.
|
|
939
|
+
* If not available, fallback to the local kit import.
|
|
940
|
+
*/
|
|
943
941
|
importDrizzleKit(): typeof DrizzleKit;
|
|
944
942
|
}
|
|
945
|
-
declare const devMigrationsSchema:
|
|
946
|
-
id:
|
|
947
|
-
name:
|
|
948
|
-
snapshot:
|
|
949
|
-
created_at:
|
|
943
|
+
declare const devMigrationsSchema: alepha23.TObject<{
|
|
944
|
+
id: alepha23.TNumber;
|
|
945
|
+
name: alepha23.TString;
|
|
946
|
+
snapshot: alepha23.TString;
|
|
947
|
+
created_at: alepha23.TString;
|
|
950
948
|
}>;
|
|
951
949
|
type DevMigrations = Static<typeof devMigrationsSchema>;
|
|
952
950
|
//#endregion
|
|
@@ -964,6 +962,7 @@ declare abstract class DatabaseProvider {
|
|
|
964
962
|
readonly tables: Map<string, unknown>;
|
|
965
963
|
readonly sequences: Map<string, unknown>;
|
|
966
964
|
get name(): string;
|
|
965
|
+
get driver(): string;
|
|
967
966
|
get schema(): string;
|
|
968
967
|
table<T extends TObject>(entity: EntityPrimitive<T>): PgTableWithColumns<SchemaToTableConfig<T>>;
|
|
969
968
|
registerEntity(entity: EntityPrimitive): void;
|
|
@@ -971,39 +970,39 @@ declare abstract class DatabaseProvider {
|
|
|
971
970
|
abstract execute(statement: SQLLike): Promise<Record<string, unknown>[]>;
|
|
972
971
|
run<T extends TObject>(statement: SQLLike, schema: T): Promise<Array<Static<T>>>;
|
|
973
972
|
/**
|
|
974
|
-
|
|
975
|
-
|
|
973
|
+
* Get migrations folder path - can be overridden
|
|
974
|
+
*/
|
|
976
975
|
protected getMigrationsFolder(): string;
|
|
977
976
|
/**
|
|
978
|
-
|
|
979
|
-
|
|
977
|
+
* Base migration orchestration - handles environment logic
|
|
978
|
+
*/
|
|
980
979
|
migrate(): Promise<void>;
|
|
981
980
|
/**
|
|
982
|
-
|
|
983
|
-
|
|
981
|
+
* Production: run migrations from folder
|
|
982
|
+
*/
|
|
984
983
|
protected runProductionMigration(migrationsFolder: string): Promise<void>;
|
|
985
984
|
/**
|
|
986
|
-
|
|
987
|
-
|
|
985
|
+
* Test: always synchronize
|
|
986
|
+
*/
|
|
988
987
|
protected runTestMigration(): Promise<void>;
|
|
989
988
|
/**
|
|
990
|
-
|
|
991
|
-
|
|
989
|
+
* Development: default to synchronize (can be overridden)
|
|
990
|
+
*/
|
|
992
991
|
protected runDevelopmentMigration(migrationsFolder: string): Promise<void>;
|
|
993
992
|
/**
|
|
994
|
-
|
|
995
|
-
|
|
993
|
+
* Common synchronization with error handling
|
|
994
|
+
*/
|
|
996
995
|
protected synchronizeSchema(): Promise<void>;
|
|
997
996
|
/**
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
997
|
+
* Provider-specific migration execution
|
|
998
|
+
* MUST be implemented by each provider
|
|
999
|
+
*/
|
|
1001
1000
|
protected abstract executeMigrations(migrationsFolder: string): Promise<void>;
|
|
1002
1001
|
/**
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1002
|
+
* For testing purposes, generate a unique schema name.
|
|
1003
|
+
* The schema name will be generated based on the current date and time.
|
|
1004
|
+
* It will be in the format of `test_YYYYMMDD_HHMMSS_randomSuffix`.
|
|
1005
|
+
*/
|
|
1007
1006
|
protected generateTestSchemaName(): string;
|
|
1008
1007
|
}
|
|
1009
1008
|
//#endregion
|
|
@@ -1011,8 +1010,8 @@ declare abstract class DatabaseProvider {
|
|
|
1011
1010
|
declare class QueryManager {
|
|
1012
1011
|
protected readonly alepha: Alepha;
|
|
1013
1012
|
/**
|
|
1014
|
-
|
|
1015
|
-
|
|
1013
|
+
* Convert a query object to a SQL query.
|
|
1014
|
+
*/
|
|
1016
1015
|
toSQL(query: PgQueryWhereOrSQL<TObject>, options: {
|
|
1017
1016
|
schema: TObject;
|
|
1018
1017
|
col: (key: string) => PgColumn;
|
|
@@ -1020,22 +1019,22 @@ declare class QueryManager {
|
|
|
1020
1019
|
dialect: "postgresql" | "sqlite";
|
|
1021
1020
|
}): SQL | undefined;
|
|
1022
1021
|
/**
|
|
1023
|
-
|
|
1024
|
-
|
|
1022
|
+
* Check if an object has any filter operator properties.
|
|
1023
|
+
*/
|
|
1025
1024
|
protected hasFilterOperatorProperties(obj: any): boolean;
|
|
1026
1025
|
/**
|
|
1027
|
-
|
|
1028
|
-
|
|
1026
|
+
* Map a filter operator to a SQL query.
|
|
1027
|
+
*/
|
|
1029
1028
|
mapOperatorToSql(operator: FilterOperators<any> | any, column: PgColumn, columnSchema?: TObject, columnName?: string, dialect?: "postgresql" | "sqlite"): SQL | undefined;
|
|
1030
1029
|
/**
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1030
|
+
* Parse pagination sort string to orderBy format.
|
|
1031
|
+
* Format: "firstName,-lastName" -> [{ column: "firstName", direction: "asc" }, { column: "lastName", direction: "desc" }]
|
|
1032
|
+
* - Columns separated by comma
|
|
1033
|
+
* - Prefix with '-' for DESC direction
|
|
1034
|
+
*
|
|
1035
|
+
* @param sort Pagination sort string
|
|
1036
|
+
* @returns OrderBy array or single object
|
|
1037
|
+
*/
|
|
1039
1038
|
parsePaginationSort(sort: string): Array<{
|
|
1040
1039
|
column: string;
|
|
1041
1040
|
direction: "asc" | "desc";
|
|
@@ -1044,34 +1043,34 @@ declare class QueryManager {
|
|
|
1044
1043
|
direction: "asc" | "desc";
|
|
1045
1044
|
};
|
|
1046
1045
|
/**
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1046
|
+
* Normalize orderBy parameter to array format.
|
|
1047
|
+
* Supports 3 modes:
|
|
1048
|
+
* 1. String: "name" -> [{ column: "name", direction: "asc" }]
|
|
1049
|
+
* 2. Object: { column: "name", direction: "desc" } -> [{ column: "name", direction: "desc" }]
|
|
1050
|
+
* 3. Array: [{ column: "name" }, { column: "age", direction: "desc" }] -> normalized array
|
|
1051
|
+
*
|
|
1052
|
+
* @param orderBy The orderBy parameter
|
|
1053
|
+
* @returns Normalized array of order by clauses
|
|
1054
|
+
*/
|
|
1056
1055
|
normalizeOrderBy(orderBy: any): Array<{
|
|
1057
1056
|
column: string;
|
|
1058
1057
|
direction: "asc" | "desc";
|
|
1059
1058
|
}>;
|
|
1060
1059
|
/**
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1060
|
+
* Create a pagination object.
|
|
1061
|
+
*
|
|
1062
|
+
* @deprecated Use `createPagination` from alepha instead.
|
|
1063
|
+
* This method now delegates to the framework-level helper.
|
|
1064
|
+
*
|
|
1065
|
+
* @param entities The entities to paginate.
|
|
1066
|
+
* @param limit The limit of the pagination.
|
|
1067
|
+
* @param offset The offset of the pagination.
|
|
1068
|
+
* @param sort Optional sort metadata to include in response.
|
|
1069
|
+
*/
|
|
1071
1070
|
createPagination<T>(entities: T[], limit?: number, offset?: number, sort?: Array<{
|
|
1072
1071
|
column: string;
|
|
1073
1072
|
direction: "asc" | "desc";
|
|
1074
|
-
}>):
|
|
1073
|
+
}>): alepha23.Page<T>;
|
|
1075
1074
|
}
|
|
1076
1075
|
interface PgJoin {
|
|
1077
1076
|
table: string;
|
|
@@ -1084,20 +1083,20 @@ interface PgJoin {
|
|
|
1084
1083
|
//#region ../../src/orm/services/PgRelationManager.d.ts
|
|
1085
1084
|
declare class PgRelationManager {
|
|
1086
1085
|
/**
|
|
1087
|
-
|
|
1088
|
-
|
|
1086
|
+
* Recursively build joins for the query builder based on the relations map
|
|
1087
|
+
*/
|
|
1089
1088
|
buildJoins(provider: DatabaseProvider, builder: PgSelectBase<any, any, any>, joins: Array<PgJoin>, withRelations: PgRelationMap<TObject>, table: PgTableWithColumns<any>, parentKey?: string): void;
|
|
1090
1089
|
/**
|
|
1091
|
-
|
|
1092
|
-
|
|
1090
|
+
* Map a row with its joined relations based on the joins definition
|
|
1091
|
+
*/
|
|
1093
1092
|
mapRowWithJoins(record: Record<string, unknown>, row: Record<string, unknown>, schema: TObject, joins: PgJoin[], parentKey?: string): Record<string, unknown>;
|
|
1094
1093
|
/**
|
|
1095
|
-
|
|
1096
|
-
|
|
1094
|
+
* Check if all values in an object are null (indicates a left join with no match)
|
|
1095
|
+
*/
|
|
1097
1096
|
private isAllNull;
|
|
1098
1097
|
/**
|
|
1099
|
-
|
|
1100
|
-
|
|
1098
|
+
* Build a schema that includes all join properties recursively
|
|
1099
|
+
*/
|
|
1101
1100
|
buildSchemaWithJoins(baseSchema: TObject, joins: PgJoin[], parentPath?: string): TObject;
|
|
1102
1101
|
}
|
|
1103
1102
|
//#endregion
|
|
@@ -1105,216 +1104,217 @@ declare class PgRelationManager {
|
|
|
1105
1104
|
declare abstract class Repository$1<T extends TObject> {
|
|
1106
1105
|
readonly entity: EntityPrimitive<T>;
|
|
1107
1106
|
readonly provider: DatabaseProvider;
|
|
1107
|
+
protected readonly log: alepha_logger5.Logger;
|
|
1108
1108
|
protected readonly relationManager: PgRelationManager;
|
|
1109
1109
|
protected readonly queryManager: QueryManager;
|
|
1110
1110
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
1111
1111
|
protected readonly alepha: Alepha;
|
|
1112
1112
|
constructor(entity: EntityPrimitive<T>, provider?: typeof DatabaseProvider);
|
|
1113
1113
|
/**
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1114
|
+
* Represents the primary key of the table.
|
|
1115
|
+
* - Key is the name of the primary key column.
|
|
1116
|
+
* - Type is the type (TypeBox) of the primary key column.
|
|
1117
|
+
*
|
|
1118
|
+
* ID is mandatory. If the table does not have a primary key, it will throw an error.
|
|
1119
|
+
*/
|
|
1120
1120
|
get id(): {
|
|
1121
1121
|
type: TSchema;
|
|
1122
1122
|
key: keyof T["properties"];
|
|
1123
1123
|
col: PgColumn;
|
|
1124
1124
|
};
|
|
1125
1125
|
/**
|
|
1126
|
-
|
|
1127
|
-
|
|
1126
|
+
* Get Drizzle table object.
|
|
1127
|
+
*/
|
|
1128
1128
|
get table(): PgTableWithColumns<SchemaToTableConfig<T>>;
|
|
1129
1129
|
/**
|
|
1130
|
-
|
|
1131
|
-
|
|
1130
|
+
* Get SQL table name. (from Drizzle table object)
|
|
1131
|
+
*/
|
|
1132
1132
|
get tableName(): string;
|
|
1133
1133
|
/**
|
|
1134
|
-
|
|
1135
|
-
|
|
1134
|
+
* Getter for the database connection from the database provider.
|
|
1135
|
+
*/
|
|
1136
1136
|
protected get db(): PgDatabase<any>;
|
|
1137
1137
|
/**
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1138
|
+
* Execute a SQL query.
|
|
1139
|
+
*
|
|
1140
|
+
* This method allows executing raw SQL queries against the database.
|
|
1141
|
+
* This is by far the easiest way to run custom queries that are not covered by the repository's built-in methods!
|
|
1142
|
+
*
|
|
1143
|
+
* You must use the `sql` tagged template function from Drizzle ORM to create the query. https://orm.drizzle.team/docs/sql
|
|
1144
|
+
*
|
|
1145
|
+
* @example
|
|
1146
|
+
* ```ts
|
|
1147
|
+
* class App {
|
|
1148
|
+
* repository = $repository({ ... });
|
|
1149
|
+
* async getAdults() {
|
|
1150
|
+
* const users = repository.table; // Drizzle table object
|
|
1151
|
+
* await repository.query(sql`SELECT * FROM ${users} WHERE ${users.age} > ${18}`);
|
|
1152
|
+
* // or better
|
|
1153
|
+
* await repository.query((users) => sql`SELECT * FROM ${users} WHERE ${users.age} > ${18}`);
|
|
1154
|
+
* }
|
|
1155
|
+
* }
|
|
1156
|
+
* ```
|
|
1157
|
+
*/
|
|
1158
1158
|
query<R extends TObject = T>(query: SQLLike | ((table: PgTableWithColumns<SchemaToTableConfig<T>>, db: PgDatabase<any>) => SQLLike), schema?: R): Promise<Static<R>[]>;
|
|
1159
1159
|
/**
|
|
1160
|
-
|
|
1161
|
-
|
|
1160
|
+
* Map raw database fields to entity fields. (handles column name differences)
|
|
1161
|
+
*/
|
|
1162
1162
|
protected mapRawFieldsToEntity(row: Record<string, unknown>): any;
|
|
1163
1163
|
/**
|
|
1164
|
-
|
|
1165
|
-
|
|
1164
|
+
* Get a Drizzle column from the table by his name.
|
|
1165
|
+
*/
|
|
1166
1166
|
protected col(name: keyof StaticEncode<T>): PgColumn;
|
|
1167
1167
|
/**
|
|
1168
|
-
|
|
1169
|
-
|
|
1168
|
+
* Run a transaction.
|
|
1169
|
+
*/
|
|
1170
1170
|
transaction<T>(transaction: (tx: PgTransaction<any, Record<string, any>, any>) => Promise<T>, config?: PgTransactionConfig): Promise<T>;
|
|
1171
1171
|
/**
|
|
1172
|
-
|
|
1173
|
-
|
|
1172
|
+
* Start a SELECT query on the table.
|
|
1173
|
+
*/
|
|
1174
1174
|
protected rawSelect(opts?: StatementOptions): drizzle_orm_pg_core0.PgSelectBase<string, Record<string, PgColumn<drizzle_orm0.ColumnBaseConfig<drizzle_orm0.ColumnDataType, string>, {}, {}>>, "single", Record<string, "not-null">, false, never, {
|
|
1175
1175
|
[x: string]: unknown;
|
|
1176
1176
|
}[], {
|
|
1177
1177
|
[x: string]: PgColumn<drizzle_orm0.ColumnBaseConfig<drizzle_orm0.ColumnDataType, string>, {}, {}>;
|
|
1178
1178
|
}>;
|
|
1179
1179
|
/**
|
|
1180
|
-
|
|
1181
|
-
|
|
1180
|
+
* Start a SELECT DISTINCT query on the table.
|
|
1181
|
+
*/
|
|
1182
1182
|
protected rawSelectDistinct(opts?: StatementOptions, columns?: (keyof Static<T>)[]): drizzle_orm_pg_core0.PgSelectBase<string, Record<string, any>, "partial", Record<string, "not-null">, false, never, {
|
|
1183
1183
|
[x: string]: any;
|
|
1184
1184
|
}[], {
|
|
1185
1185
|
[x: string]: any;
|
|
1186
1186
|
}>;
|
|
1187
1187
|
/**
|
|
1188
|
-
|
|
1189
|
-
|
|
1188
|
+
* Start an INSERT query on the table.
|
|
1189
|
+
*/
|
|
1190
1190
|
protected rawInsert(opts?: StatementOptions): drizzle_orm_pg_core0.PgInsertBuilder<PgTableWithColumns<SchemaToTableConfig<T>>, any, false>;
|
|
1191
1191
|
/**
|
|
1192
|
-
|
|
1193
|
-
|
|
1192
|
+
* Start an UPDATE query on the table.
|
|
1193
|
+
*/
|
|
1194
1194
|
protected rawUpdate(opts?: StatementOptions): drizzle_orm_pg_core0.PgUpdateBuilder<PgTableWithColumns<SchemaToTableConfig<T>>, any>;
|
|
1195
1195
|
/**
|
|
1196
|
-
|
|
1197
|
-
|
|
1196
|
+
* Start a DELETE query on the table.
|
|
1197
|
+
*/
|
|
1198
1198
|
protected rawDelete(opts?: StatementOptions): drizzle_orm_pg_core0.PgDeleteBase<PgTableWithColumns<SchemaToTableConfig<T>>, any, undefined, undefined, false, never>;
|
|
1199
1199
|
/**
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1200
|
+
* Create a Drizzle `select` query based on a JSON query object.
|
|
1201
|
+
*
|
|
1202
|
+
* > This method is the base for `find`, `findOne`, `findById`, and `paginate`.
|
|
1203
|
+
*/
|
|
1204
1204
|
findMany<R extends PgRelationMap<T>>(query?: PgQueryRelations<T, R>, opts?: StatementOptions): Promise<PgStatic<T, R>[]>;
|
|
1205
1205
|
/**
|
|
1206
|
-
|
|
1207
|
-
|
|
1206
|
+
* Find a single entity.
|
|
1207
|
+
*/
|
|
1208
1208
|
findOne<R extends PgRelationMap<T>>(query: Pick<PgQueryRelations<T, R>, "with" | "where">, opts?: StatementOptions): Promise<PgStatic<T, R>>;
|
|
1209
1209
|
/**
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1210
|
+
* Find entities with pagination.
|
|
1211
|
+
*
|
|
1212
|
+
* It uses the same parameters as `find()`, but adds pagination metadata to the response.
|
|
1213
|
+
*
|
|
1214
|
+
* > Pagination CAN also do a count query to get the total number of elements.
|
|
1215
|
+
*/
|
|
1216
1216
|
paginate<R extends PgRelationMap<T>>(pagination?: PageQuery, query?: PgQueryRelations<T, R>, opts?: StatementOptions & {
|
|
1217
1217
|
count?: boolean;
|
|
1218
1218
|
}): Promise<Page<PgStatic<T, R>>>;
|
|
1219
1219
|
/**
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1220
|
+
* Find an entity by ID.
|
|
1221
|
+
*
|
|
1222
|
+
* This is a convenience method for `findOne` with a where clause on the primary key.
|
|
1223
|
+
* If you need more complex queries, use `findOne` instead.
|
|
1224
|
+
*/
|
|
1225
1225
|
findById(id: string | number, opts?: StatementOptions): Promise<Static<T>>;
|
|
1226
1226
|
/**
|
|
1227
|
-
|
|
1228
|
-
|
|
1227
|
+
* Helper to create a type-safe query object.
|
|
1228
|
+
*/
|
|
1229
1229
|
createQuery(): PgQuery<T>;
|
|
1230
1230
|
/**
|
|
1231
|
-
|
|
1232
|
-
|
|
1231
|
+
* Helper to create a type-safe where clause.
|
|
1232
|
+
*/
|
|
1233
1233
|
createQueryWhere(): PgQueryWhere<T>;
|
|
1234
1234
|
/**
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1235
|
+
* Create an entity.
|
|
1236
|
+
*
|
|
1237
|
+
* @param data The entity to create.
|
|
1238
|
+
* @param opts The options for creating the entity.
|
|
1239
|
+
* @returns The ID of the created entity.
|
|
1240
|
+
*/
|
|
1241
1241
|
create(data: Static<TObjectInsert<T>>, opts?: StatementOptions): Promise<Static<T>>;
|
|
1242
1242
|
/**
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1243
|
+
* Create many entities.
|
|
1244
|
+
*
|
|
1245
|
+
* Inserts are batched in chunks of 1000 to avoid hitting database limits.
|
|
1246
|
+
*
|
|
1247
|
+
* @param values The entities to create.
|
|
1248
|
+
* @param opts The statement options.
|
|
1249
|
+
* @returns The created entities.
|
|
1250
|
+
*/
|
|
1251
1251
|
createMany(values: Array<Static<TObjectInsert<T>>>, opts?: StatementOptions & {
|
|
1252
1252
|
batchSize?: number;
|
|
1253
1253
|
}): Promise<Static<T>[]>;
|
|
1254
1254
|
/**
|
|
1255
|
-
|
|
1256
|
-
|
|
1255
|
+
* Find an entity and update it.
|
|
1256
|
+
*/
|
|
1257
1257
|
updateOne(where: PgQueryWhereOrSQL<T>, data: Partial<Static<TObjectUpdate<T>>>, opts?: StatementOptions): Promise<Static<T>>;
|
|
1258
1258
|
/**
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1259
|
+
* Save a given entity.
|
|
1260
|
+
*
|
|
1261
|
+
* @example
|
|
1262
|
+
* ```ts
|
|
1263
|
+
* const entity = await repository.findById(1);
|
|
1264
|
+
* entity.name = "New Name"; // update a field
|
|
1265
|
+
* delete entity.description; // delete a field
|
|
1266
|
+
* await repository.save(entity);
|
|
1267
|
+
* ```
|
|
1268
|
+
*
|
|
1269
|
+
* Difference with `updateById/updateOne`:
|
|
1270
|
+
*
|
|
1271
|
+
* - requires the entity to be fetched first (whole object is expected)
|
|
1272
|
+
* - check pg.version() if present -> optimistic locking
|
|
1273
|
+
* - validate entity against schema
|
|
1274
|
+
* - undefined values will be set to null, not ignored!
|
|
1275
|
+
*
|
|
1276
|
+
* @see {@link DbVersionMismatchError}
|
|
1277
|
+
*/
|
|
1278
1278
|
save(entity: Static<T>, opts?: StatementOptions): Promise<void>;
|
|
1279
1279
|
/**
|
|
1280
|
-
|
|
1281
|
-
|
|
1280
|
+
* Find an entity by ID and update it.
|
|
1281
|
+
*/
|
|
1282
1282
|
updateById(id: string | number, data: Partial<Static<TObjectUpdate<T>>>, opts?: StatementOptions): Promise<Static<T>>;
|
|
1283
1283
|
/**
|
|
1284
|
-
|
|
1285
|
-
|
|
1284
|
+
* Find many entities and update all of them.
|
|
1285
|
+
*/
|
|
1286
1286
|
updateMany(where: PgQueryWhereOrSQL<T>, data: Partial<Static<TObjectUpdate<T>>>, opts?: StatementOptions): Promise<Array<number | string>>;
|
|
1287
1287
|
/**
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1288
|
+
* Find many and delete all of them.
|
|
1289
|
+
* @returns Array of deleted entity IDs
|
|
1290
|
+
*/
|
|
1291
1291
|
deleteMany(where?: PgQueryWhereOrSQL<T>, opts?: StatementOptions): Promise<Array<number | string>>;
|
|
1292
1292
|
/**
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1293
|
+
* Delete all entities.
|
|
1294
|
+
* @returns Array of deleted entity IDs
|
|
1295
|
+
*/
|
|
1296
1296
|
clear(opts?: StatementOptions): Promise<Array<number | string>>;
|
|
1297
1297
|
/**
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1298
|
+
* Delete the given entity.
|
|
1299
|
+
*
|
|
1300
|
+
* You must fetch the entity first in order to delete it.
|
|
1301
|
+
* @returns Array containing the deleted entity ID
|
|
1302
|
+
*/
|
|
1303
1303
|
destroy(entity: Static<T>, opts?: StatementOptions): Promise<Array<number | string>>;
|
|
1304
1304
|
/**
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1305
|
+
* Find an entity and delete it.
|
|
1306
|
+
* @returns Array of deleted entity IDs (should contain at most one ID)
|
|
1307
|
+
*/
|
|
1308
1308
|
deleteOne(where?: PgQueryWhereOrSQL<T>, opts?: StatementOptions): Promise<Array<number | string>>;
|
|
1309
1309
|
/**
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1310
|
+
* Find an entity by ID and delete it.
|
|
1311
|
+
* @returns Array containing the deleted entity ID
|
|
1312
|
+
* @throws DbEntityNotFoundError if the entity is not found
|
|
1313
|
+
*/
|
|
1314
1314
|
deleteById(id: string | number, opts?: StatementOptions): Promise<Array<number | string>>;
|
|
1315
1315
|
/**
|
|
1316
|
-
|
|
1317
|
-
|
|
1316
|
+
* Count entities.
|
|
1317
|
+
*/
|
|
1318
1318
|
count(where?: PgQueryWhereOrSQL<T>, opts?: StatementOptions): Promise<number>;
|
|
1319
1319
|
protected conflictMessagePattern: string;
|
|
1320
1320
|
protected handleError(error: unknown, message: string): DbError;
|
|
@@ -1323,31 +1323,31 @@ declare abstract class Repository$1<T extends TObject> {
|
|
|
1323
1323
|
}): PgQueryWhereOrSQL<T>;
|
|
1324
1324
|
protected deletedAt(): PgAttrField | undefined;
|
|
1325
1325
|
/**
|
|
1326
|
-
|
|
1327
|
-
|
|
1326
|
+
* Convert something to valid Pg Insert Value.
|
|
1327
|
+
*/
|
|
1328
1328
|
protected cast(data: any, insert: boolean): PgInsertValue<PgTableWithColumns<SchemaToTableConfig<T>>>;
|
|
1329
1329
|
/**
|
|
1330
|
-
|
|
1331
|
-
|
|
1330
|
+
* Transform a row from the database into a clean entity.
|
|
1331
|
+
*/
|
|
1332
1332
|
protected clean<T extends TObject>(row: Record<string, unknown>, schema: T): Static<T>;
|
|
1333
1333
|
/**
|
|
1334
|
-
|
|
1335
|
-
|
|
1334
|
+
* Clean a row with joins recursively
|
|
1335
|
+
*/
|
|
1336
1336
|
protected cleanWithJoins<T extends TObject>(row: Record<string, unknown>, schema: T, joins: PgJoin[], parentPath?: string): Static<T>;
|
|
1337
1337
|
/**
|
|
1338
|
-
|
|
1339
|
-
|
|
1338
|
+
* Convert a where clause to SQL.
|
|
1339
|
+
*/
|
|
1340
1340
|
protected toSQL(where: PgQueryWhereOrSQL<T>, joins?: PgJoin[]): SQL | undefined;
|
|
1341
1341
|
/**
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1342
|
+
* Get the where clause for an ID.
|
|
1343
|
+
*
|
|
1344
|
+
* @param id The ID to get the where clause for.
|
|
1345
|
+
* @returns The where clause for the ID.
|
|
1346
|
+
*/
|
|
1347
1347
|
protected getWhereId(id: string | number): PgQueryWhere<T>;
|
|
1348
1348
|
/**
|
|
1349
|
-
|
|
1350
|
-
|
|
1349
|
+
* Find a primary key in the schema.
|
|
1350
|
+
*/
|
|
1351
1351
|
protected getPrimaryKey(schema: TObject): {
|
|
1352
1352
|
key: string;
|
|
1353
1353
|
col: PgColumn<drizzle_orm0.ColumnBaseConfig<drizzle_orm0.ColumnDataType, string>, {}, {}>;
|
|
@@ -1359,189 +1359,80 @@ declare abstract class Repository$1<T extends TObject> {
|
|
|
1359
1359
|
*/
|
|
1360
1360
|
interface StatementOptions {
|
|
1361
1361
|
/**
|
|
1362
|
-
|
|
1363
|
-
|
|
1362
|
+
* Transaction to use.
|
|
1363
|
+
*/
|
|
1364
1364
|
tx?: PgTransaction<any, Record<string, any>>;
|
|
1365
1365
|
/**
|
|
1366
|
-
|
|
1367
|
-
|
|
1366
|
+
* Lock strength.
|
|
1367
|
+
*/
|
|
1368
1368
|
for?: LockStrength | {
|
|
1369
1369
|
config: LockConfig;
|
|
1370
1370
|
strength: LockStrength;
|
|
1371
1371
|
};
|
|
1372
1372
|
/**
|
|
1373
|
-
|
|
1374
|
-
|
|
1373
|
+
* If true, ignore soft delete.
|
|
1374
|
+
*/
|
|
1375
1375
|
force?: boolean;
|
|
1376
1376
|
/**
|
|
1377
|
-
|
|
1378
|
-
|
|
1377
|
+
* Force the current time.
|
|
1378
|
+
*/
|
|
1379
1379
|
now?: DateTime | string;
|
|
1380
1380
|
}
|
|
1381
1381
|
//#endregion
|
|
1382
|
-
//#region ../../src/orm/providers/drivers/NodePostgresProvider.d.ts
|
|
1383
|
-
declare module "alepha" {
|
|
1384
|
-
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
1385
|
-
}
|
|
1386
|
-
declare const envSchema: alepha1.TObject<{
|
|
1387
|
-
/**
|
|
1388
|
-
* Main configuration for database connection.
|
|
1389
|
-
* Accept a string in the format of a Postgres connection URL.
|
|
1390
|
-
* Example: postgres://user:password@localhost:5432/database
|
|
1391
|
-
* or
|
|
1392
|
-
* Example: postgres://user:password@localhost:5432/database?sslmode=require
|
|
1393
|
-
*/
|
|
1394
|
-
DATABASE_URL: alepha1.TOptional<alepha1.TString>;
|
|
1395
|
-
/**
|
|
1396
|
-
* In addition to the DATABASE_URL, you can specify the postgres schema name.
|
|
1397
|
-
*
|
|
1398
|
-
* It will monkey patch drizzle tables.
|
|
1399
|
-
*/
|
|
1400
|
-
POSTGRES_SCHEMA: alepha1.TOptional<alepha1.TString>;
|
|
1401
|
-
}>;
|
|
1402
|
-
//#endregion
|
|
1403
|
-
//#region ../../src/orm/providers/drivers/NodeSqliteProvider.d.ts
|
|
1404
|
-
/**
|
|
1405
|
-
* Configuration options for the Node.js SQLite database provider.
|
|
1406
|
-
*/
|
|
1407
|
-
declare const nodeSqliteOptions: alepha1.Atom<alepha1.TObject<{
|
|
1408
|
-
path: alepha1.TOptional<alepha1.TString>;
|
|
1409
|
-
}>, "alepha.postgres.node-sqlite.options">;
|
|
1410
|
-
type NodeSqliteProviderOptions = Static<typeof nodeSqliteOptions.schema>;
|
|
1411
|
-
declare module "alepha" {
|
|
1412
|
-
interface State {
|
|
1413
|
-
[nodeSqliteOptions.key]: NodeSqliteProviderOptions;
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
/**
|
|
1417
|
-
* Add a fake support for SQLite in Node.js based on Postgres interfaces.
|
|
1418
|
-
*
|
|
1419
|
-
* This is NOT a real SQLite provider, it's a workaround to use SQLite with Drizzle ORM.
|
|
1420
|
-
* This is NOT recommended for production use.
|
|
1421
|
-
*/
|
|
1422
|
-
//#endregion
|
|
1423
|
-
//#region ../../src/orm/index.d.ts
|
|
1424
|
-
declare module "alepha" {
|
|
1425
|
-
interface Hooks {
|
|
1426
|
-
/**
|
|
1427
|
-
* Fires before creating an entity in the repository.
|
|
1428
|
-
*/
|
|
1429
|
-
"repository:create:before": {
|
|
1430
|
-
tableName: string;
|
|
1431
|
-
data: any;
|
|
1432
|
-
};
|
|
1433
|
-
/**
|
|
1434
|
-
* Fires after creating an entity in the repository.
|
|
1435
|
-
*/
|
|
1436
|
-
"repository:create:after": {
|
|
1437
|
-
tableName: string;
|
|
1438
|
-
data: any;
|
|
1439
|
-
entity: any;
|
|
1440
|
-
};
|
|
1441
|
-
/**
|
|
1442
|
-
* Fires before updating entities in the repository.
|
|
1443
|
-
*/
|
|
1444
|
-
"repository:update:before": {
|
|
1445
|
-
tableName: string;
|
|
1446
|
-
where: any;
|
|
1447
|
-
data: any;
|
|
1448
|
-
};
|
|
1449
|
-
/**
|
|
1450
|
-
* Fires after updating entities in the repository.
|
|
1451
|
-
*/
|
|
1452
|
-
"repository:update:after": {
|
|
1453
|
-
tableName: string;
|
|
1454
|
-
where: any;
|
|
1455
|
-
data: any;
|
|
1456
|
-
entities: any[];
|
|
1457
|
-
};
|
|
1458
|
-
/**
|
|
1459
|
-
* Fires before deleting entities from the repository.
|
|
1460
|
-
*/
|
|
1461
|
-
"repository:delete:before": {
|
|
1462
|
-
tableName: string;
|
|
1463
|
-
where: any;
|
|
1464
|
-
};
|
|
1465
|
-
/**
|
|
1466
|
-
* Fires after deleting entities from the repository.
|
|
1467
|
-
*/
|
|
1468
|
-
"repository:delete:after": {
|
|
1469
|
-
tableName: string;
|
|
1470
|
-
where: any;
|
|
1471
|
-
ids: Array<string | number>;
|
|
1472
|
-
};
|
|
1473
|
-
/**
|
|
1474
|
-
* Fires before reading entities from the repository.
|
|
1475
|
-
*/
|
|
1476
|
-
"repository:read:before": {
|
|
1477
|
-
tableName: string;
|
|
1478
|
-
query: any;
|
|
1479
|
-
};
|
|
1480
|
-
/**
|
|
1481
|
-
* Fires after reading entities from the repository.
|
|
1482
|
-
*/
|
|
1483
|
-
"repository:read:after": {
|
|
1484
|
-
tableName: string;
|
|
1485
|
-
query: any;
|
|
1486
|
-
entities: any[];
|
|
1487
|
-
};
|
|
1488
|
-
}
|
|
1489
|
-
}
|
|
1490
|
-
//#endregion
|
|
1491
1382
|
//#region ../../src/api/users/entities/identities.d.ts
|
|
1492
|
-
declare const identities:
|
|
1493
|
-
id:
|
|
1494
|
-
version:
|
|
1495
|
-
createdAt:
|
|
1496
|
-
updatedAt:
|
|
1497
|
-
userId:
|
|
1498
|
-
password:
|
|
1499
|
-
provider:
|
|
1500
|
-
providerUserId:
|
|
1501
|
-
providerData:
|
|
1383
|
+
declare const identities: alepha_orm24.EntityPrimitive<alepha23.TObject<{
|
|
1384
|
+
id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1385
|
+
version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1386
|
+
createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1387
|
+
updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1388
|
+
userId: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_REF>;
|
|
1389
|
+
password: alepha23.TOptional<alepha23.TString>;
|
|
1390
|
+
provider: alepha23.TString;
|
|
1391
|
+
providerUserId: alepha23.TOptional<alepha23.TString>;
|
|
1392
|
+
providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
|
|
1502
1393
|
}>>;
|
|
1503
1394
|
type IdentityEntity = Static<typeof identities.schema>;
|
|
1504
1395
|
//#endregion
|
|
1505
1396
|
//#region ../../src/api/users/entities/sessions.d.ts
|
|
1506
|
-
declare const sessions:
|
|
1507
|
-
id:
|
|
1508
|
-
version:
|
|
1509
|
-
createdAt:
|
|
1510
|
-
updatedAt:
|
|
1511
|
-
refreshToken:
|
|
1512
|
-
userId:
|
|
1513
|
-
expiresAt:
|
|
1514
|
-
ip:
|
|
1515
|
-
userAgent:
|
|
1516
|
-
os:
|
|
1517
|
-
browser:
|
|
1518
|
-
device:
|
|
1397
|
+
declare const sessions: alepha_orm24.EntityPrimitive<alepha23.TObject<{
|
|
1398
|
+
id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1399
|
+
version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1400
|
+
createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1401
|
+
updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1402
|
+
refreshToken: alepha23.TString;
|
|
1403
|
+
userId: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_REF>;
|
|
1404
|
+
expiresAt: alepha23.TString;
|
|
1405
|
+
ip: alepha23.TOptional<alepha23.TString>;
|
|
1406
|
+
userAgent: alepha23.TOptional<alepha23.TObject<{
|
|
1407
|
+
os: alepha23.TString;
|
|
1408
|
+
browser: alepha23.TString;
|
|
1409
|
+
device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
|
|
1519
1410
|
}>>;
|
|
1520
1411
|
}>>;
|
|
1521
1412
|
type SessionEntity = Static<typeof sessions.schema>;
|
|
1522
1413
|
//#endregion
|
|
1523
1414
|
//#region ../../src/api/users/entities/users.d.ts
|
|
1524
1415
|
declare const DEFAULT_USER_REALM_NAME = "default";
|
|
1525
|
-
declare const users:
|
|
1526
|
-
id:
|
|
1527
|
-
version:
|
|
1528
|
-
createdAt:
|
|
1529
|
-
updatedAt:
|
|
1530
|
-
realm:
|
|
1531
|
-
username:
|
|
1532
|
-
email:
|
|
1533
|
-
phoneNumber:
|
|
1534
|
-
roles:
|
|
1535
|
-
firstName:
|
|
1536
|
-
lastName:
|
|
1537
|
-
picture:
|
|
1538
|
-
enabled:
|
|
1539
|
-
emailVerified:
|
|
1416
|
+
declare const users: alepha_orm24.EntityPrimitive<alepha23.TObject<{
|
|
1417
|
+
id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1418
|
+
version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1419
|
+
createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1420
|
+
updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1421
|
+
realm: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_DEFAULT>;
|
|
1422
|
+
username: alepha23.TOptional<alepha23.TString>;
|
|
1423
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
1424
|
+
phoneNumber: alepha23.TOptional<alepha23.TString>;
|
|
1425
|
+
roles: alepha_orm24.PgAttr<alepha23.TArray<alepha23.TString>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1426
|
+
firstName: alepha23.TOptional<alepha23.TString>;
|
|
1427
|
+
lastName: alepha23.TOptional<alepha23.TString>;
|
|
1428
|
+
picture: alepha23.TOptional<alepha23.TString>;
|
|
1429
|
+
enabled: alepha_orm24.PgAttr<alepha23.TBoolean, typeof alepha_orm24.PG_DEFAULT>;
|
|
1430
|
+
emailVerified: alepha_orm24.PgAttr<alepha23.TBoolean, typeof alepha_orm24.PG_DEFAULT>;
|
|
1540
1431
|
}>>;
|
|
1541
1432
|
type UserEntity = Static<typeof users.schema>;
|
|
1542
1433
|
//#endregion
|
|
1543
|
-
//#region ../../src/api/users/primitives/$
|
|
1544
|
-
type
|
|
1434
|
+
//#region ../../src/api/users/primitives/$realm.d.ts
|
|
1435
|
+
type RealmPrimitive = IssuerPrimitive & WithLinkFn & WithLoginFn;
|
|
1545
1436
|
/**
|
|
1546
1437
|
* Already configured realm for user management.
|
|
1547
1438
|
*
|
|
@@ -1555,23 +1446,23 @@ type UserRealmPrimitive = RealmPrimitive & WithLinkFn & WithLoginFn;
|
|
|
1555
1446
|
* Environment Variables:
|
|
1556
1447
|
* - `APP_SECRET`: Secret key for signing tokens (if not provided in options).
|
|
1557
1448
|
*/
|
|
1558
|
-
declare const $
|
|
1559
|
-
interface
|
|
1449
|
+
declare const $realm: (options?: RealmOptions) => RealmPrimitive;
|
|
1450
|
+
interface RealmOptions {
|
|
1560
1451
|
/**
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1452
|
+
* Secret key for signing tokens.
|
|
1453
|
+
*
|
|
1454
|
+
* If not provided, the secret from the SecurityProvider will be used (usually from the APP_SECRET environment variable).
|
|
1455
|
+
*/
|
|
1565
1456
|
secret?: string;
|
|
1566
1457
|
/**
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1458
|
+
* Issuer configuration options.
|
|
1459
|
+
*
|
|
1460
|
+
* It's already pre-configured for user management with admin and user roles.
|
|
1461
|
+
*/
|
|
1462
|
+
issuer?: Partial<IssuerPrimitiveOptions>;
|
|
1572
1463
|
/**
|
|
1573
|
-
|
|
1574
|
-
|
|
1464
|
+
* Override entities.
|
|
1465
|
+
*/
|
|
1575
1466
|
entities?: {
|
|
1576
1467
|
users?: Repository<typeof users.schema>;
|
|
1577
1468
|
identities?: Repository<typeof identities.schema>;
|
|
@@ -1590,111 +1481,111 @@ interface UserRealmOptions {
|
|
|
1590
1481
|
};
|
|
1591
1482
|
}
|
|
1592
1483
|
//#endregion
|
|
1593
|
-
//#region ../../src/api/users/providers/
|
|
1594
|
-
interface
|
|
1484
|
+
//#region ../../src/api/users/providers/RealmProvider.d.ts
|
|
1485
|
+
interface RealmRepositories {
|
|
1595
1486
|
identities: Repository<typeof identities.schema>;
|
|
1596
1487
|
sessions: Repository<typeof sessions.schema>;
|
|
1597
1488
|
users: Repository<typeof users.schema>;
|
|
1598
1489
|
}
|
|
1599
|
-
interface
|
|
1490
|
+
interface Realm {
|
|
1600
1491
|
name: string;
|
|
1601
|
-
repositories:
|
|
1492
|
+
repositories: RealmRepositories;
|
|
1602
1493
|
settings: RealmAuthSettings;
|
|
1603
1494
|
}
|
|
1604
|
-
declare class
|
|
1495
|
+
declare class RealmProvider {
|
|
1605
1496
|
protected readonly alepha: Alepha;
|
|
1606
|
-
protected readonly defaultIdentities: Repository<
|
|
1607
|
-
id:
|
|
1608
|
-
version:
|
|
1609
|
-
createdAt:
|
|
1610
|
-
updatedAt:
|
|
1611
|
-
userId:
|
|
1612
|
-
password:
|
|
1613
|
-
provider:
|
|
1614
|
-
providerUserId:
|
|
1615
|
-
providerData:
|
|
1497
|
+
protected readonly defaultIdentities: Repository<alepha23.TObject<{
|
|
1498
|
+
id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1499
|
+
version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1500
|
+
createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1501
|
+
updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1502
|
+
userId: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_REF>;
|
|
1503
|
+
password: alepha23.TOptional<alepha23.TString>;
|
|
1504
|
+
provider: alepha23.TString;
|
|
1505
|
+
providerUserId: alepha23.TOptional<alepha23.TString>;
|
|
1506
|
+
providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
|
|
1616
1507
|
}>>;
|
|
1617
|
-
protected readonly defaultSessions: Repository<
|
|
1618
|
-
id:
|
|
1619
|
-
version:
|
|
1620
|
-
createdAt:
|
|
1621
|
-
updatedAt:
|
|
1622
|
-
refreshToken:
|
|
1623
|
-
userId:
|
|
1624
|
-
expiresAt:
|
|
1625
|
-
ip:
|
|
1626
|
-
userAgent:
|
|
1627
|
-
os:
|
|
1628
|
-
browser:
|
|
1629
|
-
device:
|
|
1508
|
+
protected readonly defaultSessions: Repository<alepha23.TObject<{
|
|
1509
|
+
id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1510
|
+
version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1511
|
+
createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1512
|
+
updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1513
|
+
refreshToken: alepha23.TString;
|
|
1514
|
+
userId: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_REF>;
|
|
1515
|
+
expiresAt: alepha23.TString;
|
|
1516
|
+
ip: alepha23.TOptional<alepha23.TString>;
|
|
1517
|
+
userAgent: alepha23.TOptional<alepha23.TObject<{
|
|
1518
|
+
os: alepha23.TString;
|
|
1519
|
+
browser: alepha23.TString;
|
|
1520
|
+
device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
|
|
1630
1521
|
}>>;
|
|
1631
1522
|
}>>;
|
|
1632
|
-
protected readonly defaultUsers: Repository<
|
|
1633
|
-
id:
|
|
1634
|
-
version:
|
|
1635
|
-
createdAt:
|
|
1636
|
-
updatedAt:
|
|
1637
|
-
realm:
|
|
1638
|
-
username:
|
|
1639
|
-
email:
|
|
1640
|
-
phoneNumber:
|
|
1641
|
-
roles:
|
|
1642
|
-
firstName:
|
|
1643
|
-
lastName:
|
|
1644
|
-
picture:
|
|
1645
|
-
enabled:
|
|
1646
|
-
emailVerified:
|
|
1523
|
+
protected readonly defaultUsers: Repository<alepha23.TObject<{
|
|
1524
|
+
id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1525
|
+
version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1526
|
+
createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1527
|
+
updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1528
|
+
realm: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_DEFAULT>;
|
|
1529
|
+
username: alepha23.TOptional<alepha23.TString>;
|
|
1530
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
1531
|
+
phoneNumber: alepha23.TOptional<alepha23.TString>;
|
|
1532
|
+
roles: alepha_orm24.PgAttr<alepha23.TArray<alepha23.TString>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1533
|
+
firstName: alepha23.TOptional<alepha23.TString>;
|
|
1534
|
+
lastName: alepha23.TOptional<alepha23.TString>;
|
|
1535
|
+
picture: alepha23.TOptional<alepha23.TString>;
|
|
1536
|
+
enabled: alepha_orm24.PgAttr<alepha23.TBoolean, typeof alepha_orm24.PG_DEFAULT>;
|
|
1537
|
+
emailVerified: alepha_orm24.PgAttr<alepha23.TBoolean, typeof alepha_orm24.PG_DEFAULT>;
|
|
1647
1538
|
}>>;
|
|
1648
|
-
protected realms: Map<string,
|
|
1539
|
+
protected realms: Map<string, Realm>;
|
|
1649
1540
|
avatars: alepha_bucket0.BucketPrimitive;
|
|
1650
|
-
protected readonly onConfigure:
|
|
1651
|
-
register(
|
|
1652
|
-
/**
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
getRealm(
|
|
1656
|
-
identityRepository(
|
|
1657
|
-
sessionRepository(
|
|
1658
|
-
userRepository(
|
|
1541
|
+
protected readonly onConfigure: alepha23.HookPrimitive<"configure">;
|
|
1542
|
+
register(realmName: string, realmOptions?: RealmOptions): Realm;
|
|
1543
|
+
/**
|
|
1544
|
+
* Gets a registered realm by name, auto-creating default if needed.
|
|
1545
|
+
*/
|
|
1546
|
+
getRealm(realmName?: string): Realm;
|
|
1547
|
+
identityRepository(realmName?: string): Repository<typeof identities.schema>;
|
|
1548
|
+
sessionRepository(realmName?: string): Repository<typeof sessions.schema>;
|
|
1549
|
+
userRepository(realmName?: string): Repository<typeof users.schema>;
|
|
1659
1550
|
}
|
|
1660
1551
|
//#endregion
|
|
1661
1552
|
//#region ../../src/api/users/schemas/identityQuerySchema.d.ts
|
|
1662
|
-
declare const identityQuerySchema:
|
|
1663
|
-
page:
|
|
1664
|
-
size:
|
|
1665
|
-
sort:
|
|
1666
|
-
userId:
|
|
1667
|
-
provider:
|
|
1553
|
+
declare const identityQuerySchema: alepha23.TObject<{
|
|
1554
|
+
page: alepha23.TOptional<alepha23.TInteger>;
|
|
1555
|
+
size: alepha23.TOptional<alepha23.TInteger>;
|
|
1556
|
+
sort: alepha23.TOptional<alepha23.TString>;
|
|
1557
|
+
userId: alepha23.TOptional<alepha23.TString>;
|
|
1558
|
+
provider: alepha23.TOptional<alepha23.TString>;
|
|
1668
1559
|
}>;
|
|
1669
1560
|
type IdentityQuery = Static<typeof identityQuerySchema>;
|
|
1670
1561
|
//#endregion
|
|
1671
1562
|
//#region ../../src/api/users/services/IdentityService.d.ts
|
|
1672
1563
|
declare class IdentityService {
|
|
1673
1564
|
protected readonly log: alepha_logger5.Logger;
|
|
1674
|
-
protected readonly
|
|
1565
|
+
protected readonly realmProvider: RealmProvider;
|
|
1675
1566
|
protected readonly auditService: AuditService;
|
|
1676
|
-
identities(userRealmName?: string):
|
|
1677
|
-
id:
|
|
1678
|
-
version:
|
|
1679
|
-
createdAt:
|
|
1680
|
-
updatedAt:
|
|
1681
|
-
userId:
|
|
1682
|
-
password:
|
|
1683
|
-
provider:
|
|
1684
|
-
providerUserId:
|
|
1685
|
-
providerData:
|
|
1567
|
+
identities(userRealmName?: string): alepha_orm24.Repository<alepha23.TObject<{
|
|
1568
|
+
id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1569
|
+
version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1570
|
+
createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1571
|
+
updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1572
|
+
userId: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_REF>;
|
|
1573
|
+
password: alepha23.TOptional<alepha23.TString>;
|
|
1574
|
+
provider: alepha23.TString;
|
|
1575
|
+
providerUserId: alepha23.TOptional<alepha23.TString>;
|
|
1576
|
+
providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
|
|
1686
1577
|
}>>;
|
|
1687
1578
|
/**
|
|
1688
|
-
|
|
1689
|
-
|
|
1579
|
+
* Find identities with pagination and filtering.
|
|
1580
|
+
*/
|
|
1690
1581
|
findIdentities(q?: IdentityQuery, userRealmName?: string): Promise<Page$1<IdentityEntity>>;
|
|
1691
1582
|
/**
|
|
1692
|
-
|
|
1693
|
-
|
|
1583
|
+
* Get an identity by ID.
|
|
1584
|
+
*/
|
|
1694
1585
|
getIdentityById(id: string, userRealmName?: string): Promise<IdentityEntity>;
|
|
1695
1586
|
/**
|
|
1696
|
-
|
|
1697
|
-
|
|
1587
|
+
* Delete an identity by ID.
|
|
1588
|
+
*/
|
|
1698
1589
|
deleteIdentity(id: string, userRealmName?: string): Promise<void>;
|
|
1699
1590
|
}
|
|
1700
1591
|
//#endregion
|
|
@@ -1704,106 +1595,106 @@ declare class AdminIdentityController {
|
|
|
1704
1595
|
protected readonly group = "admin:identities";
|
|
1705
1596
|
protected readonly identityService: IdentityService;
|
|
1706
1597
|
/**
|
|
1707
|
-
|
|
1708
|
-
|
|
1598
|
+
* Find identities with pagination and filtering.
|
|
1599
|
+
*/
|
|
1709
1600
|
readonly findIdentities: alepha_server0.ActionPrimitiveFn<{
|
|
1710
|
-
query:
|
|
1711
|
-
page:
|
|
1712
|
-
size:
|
|
1713
|
-
sort:
|
|
1714
|
-
userId:
|
|
1715
|
-
provider:
|
|
1716
|
-
userRealmName:
|
|
1601
|
+
query: alepha23.TObject<{
|
|
1602
|
+
page: alepha23.TOptional<alepha23.TInteger>;
|
|
1603
|
+
size: alepha23.TOptional<alepha23.TInteger>;
|
|
1604
|
+
sort: alepha23.TOptional<alepha23.TString>;
|
|
1605
|
+
userId: alepha23.TOptional<alepha23.TString>;
|
|
1606
|
+
provider: alepha23.TOptional<alepha23.TString>;
|
|
1607
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
1717
1608
|
}>;
|
|
1718
|
-
response:
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
providerUserId:
|
|
1726
|
-
providerData:
|
|
1609
|
+
response: alepha23.TPage<alepha23.TObject<{
|
|
1610
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1611
|
+
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
1612
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1613
|
+
updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
1614
|
+
userId: PgAttr<alepha23.TString, typeof PG_REF>;
|
|
1615
|
+
provider: alepha23.TString;
|
|
1616
|
+
providerUserId: alepha23.TOptional<alepha23.TString>;
|
|
1617
|
+
providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
|
|
1727
1618
|
}>>;
|
|
1728
1619
|
}>;
|
|
1729
1620
|
/**
|
|
1730
|
-
|
|
1731
|
-
|
|
1621
|
+
* Get an identity by ID.
|
|
1622
|
+
*/
|
|
1732
1623
|
readonly getIdentity: alepha_server0.ActionPrimitiveFn<{
|
|
1733
|
-
params:
|
|
1734
|
-
id:
|
|
1624
|
+
params: alepha23.TObject<{
|
|
1625
|
+
id: alepha23.TString;
|
|
1735
1626
|
}>;
|
|
1736
|
-
query:
|
|
1737
|
-
userRealmName:
|
|
1627
|
+
query: alepha23.TObject<{
|
|
1628
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
1738
1629
|
}>;
|
|
1739
|
-
response:
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
providerUserId:
|
|
1747
|
-
providerData:
|
|
1630
|
+
response: alepha23.TObject<{
|
|
1631
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1632
|
+
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
1633
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1634
|
+
updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
1635
|
+
userId: PgAttr<alepha23.TString, typeof PG_REF>;
|
|
1636
|
+
provider: alepha23.TString;
|
|
1637
|
+
providerUserId: alepha23.TOptional<alepha23.TString>;
|
|
1638
|
+
providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
|
|
1748
1639
|
}>;
|
|
1749
1640
|
}>;
|
|
1750
1641
|
/**
|
|
1751
|
-
|
|
1752
|
-
|
|
1642
|
+
* Delete an identity.
|
|
1643
|
+
*/
|
|
1753
1644
|
readonly deleteIdentity: alepha_server0.ActionPrimitiveFn<{
|
|
1754
|
-
params:
|
|
1755
|
-
id:
|
|
1645
|
+
params: alepha23.TObject<{
|
|
1646
|
+
id: alepha23.TString;
|
|
1756
1647
|
}>;
|
|
1757
|
-
query:
|
|
1758
|
-
userRealmName:
|
|
1648
|
+
query: alepha23.TObject<{
|
|
1649
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
1759
1650
|
}>;
|
|
1760
|
-
response:
|
|
1761
|
-
ok:
|
|
1762
|
-
id:
|
|
1763
|
-
count:
|
|
1651
|
+
response: alepha23.TObject<{
|
|
1652
|
+
ok: alepha23.TBoolean;
|
|
1653
|
+
id: alepha23.TOptional<alepha23.TUnion<[alepha23.TString, alepha23.TInteger]>>;
|
|
1654
|
+
count: alepha23.TOptional<alepha23.TNumber>;
|
|
1764
1655
|
}>;
|
|
1765
1656
|
}>;
|
|
1766
1657
|
}
|
|
1767
1658
|
//#endregion
|
|
1768
1659
|
//#region ../../src/api/users/schemas/sessionQuerySchema.d.ts
|
|
1769
|
-
declare const sessionQuerySchema:
|
|
1770
|
-
page:
|
|
1771
|
-
size:
|
|
1772
|
-
sort:
|
|
1773
|
-
userId:
|
|
1660
|
+
declare const sessionQuerySchema: alepha23.TObject<{
|
|
1661
|
+
page: alepha23.TOptional<alepha23.TInteger>;
|
|
1662
|
+
size: alepha23.TOptional<alepha23.TInteger>;
|
|
1663
|
+
sort: alepha23.TOptional<alepha23.TString>;
|
|
1664
|
+
userId: alepha23.TOptional<alepha23.TString>;
|
|
1774
1665
|
}>;
|
|
1775
1666
|
type SessionQuery = Static<typeof sessionQuerySchema>;
|
|
1776
1667
|
//#endregion
|
|
1777
1668
|
//#region ../../src/api/users/services/SessionCrudService.d.ts
|
|
1778
1669
|
declare class SessionCrudService {
|
|
1779
1670
|
protected readonly log: alepha_logger5.Logger;
|
|
1780
|
-
protected readonly
|
|
1781
|
-
sessions(userRealmName?: string):
|
|
1782
|
-
id:
|
|
1783
|
-
version:
|
|
1784
|
-
createdAt:
|
|
1785
|
-
updatedAt:
|
|
1786
|
-
refreshToken:
|
|
1787
|
-
userId:
|
|
1788
|
-
expiresAt:
|
|
1789
|
-
ip:
|
|
1790
|
-
userAgent:
|
|
1791
|
-
os:
|
|
1792
|
-
browser:
|
|
1793
|
-
device:
|
|
1671
|
+
protected readonly realmProvider: RealmProvider;
|
|
1672
|
+
sessions(userRealmName?: string): alepha_orm24.Repository<alepha23.TObject<{
|
|
1673
|
+
id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1674
|
+
version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1675
|
+
createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1676
|
+
updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1677
|
+
refreshToken: alepha23.TString;
|
|
1678
|
+
userId: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_REF>;
|
|
1679
|
+
expiresAt: alepha23.TString;
|
|
1680
|
+
ip: alepha23.TOptional<alepha23.TString>;
|
|
1681
|
+
userAgent: alepha23.TOptional<alepha23.TObject<{
|
|
1682
|
+
os: alepha23.TString;
|
|
1683
|
+
browser: alepha23.TString;
|
|
1684
|
+
device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
|
|
1794
1685
|
}>>;
|
|
1795
1686
|
}>>;
|
|
1796
1687
|
/**
|
|
1797
|
-
|
|
1798
|
-
|
|
1688
|
+
* Find sessions with pagination and filtering.
|
|
1689
|
+
*/
|
|
1799
1690
|
findSessions(q?: SessionQuery, userRealmName?: string): Promise<Page$1<SessionEntity>>;
|
|
1800
1691
|
/**
|
|
1801
|
-
|
|
1802
|
-
|
|
1692
|
+
* Get a session by ID.
|
|
1693
|
+
*/
|
|
1803
1694
|
getSessionById(id: string, userRealmName?: string): Promise<SessionEntity>;
|
|
1804
1695
|
/**
|
|
1805
|
-
|
|
1806
|
-
|
|
1696
|
+
* Delete a session by ID.
|
|
1697
|
+
*/
|
|
1807
1698
|
deleteSession(id: string, userRealmName?: string): Promise<void>;
|
|
1808
1699
|
}
|
|
1809
1700
|
//#endregion
|
|
@@ -1813,208 +1704,208 @@ declare class AdminSessionController {
|
|
|
1813
1704
|
protected readonly group = "admin:sessions";
|
|
1814
1705
|
protected readonly sessionService: SessionCrudService;
|
|
1815
1706
|
/**
|
|
1816
|
-
|
|
1817
|
-
|
|
1707
|
+
* Find sessions with pagination and filtering.
|
|
1708
|
+
*/
|
|
1818
1709
|
readonly findSessions: alepha_server0.ActionPrimitiveFn<{
|
|
1819
|
-
query:
|
|
1820
|
-
page:
|
|
1821
|
-
size:
|
|
1822
|
-
sort:
|
|
1823
|
-
userId:
|
|
1824
|
-
userRealmName:
|
|
1710
|
+
query: alepha23.TObject<{
|
|
1711
|
+
page: alepha23.TOptional<alepha23.TInteger>;
|
|
1712
|
+
size: alepha23.TOptional<alepha23.TInteger>;
|
|
1713
|
+
sort: alepha23.TOptional<alepha23.TString>;
|
|
1714
|
+
userId: alepha23.TOptional<alepha23.TString>;
|
|
1715
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
1825
1716
|
}>;
|
|
1826
|
-
response:
|
|
1827
|
-
id:
|
|
1828
|
-
version:
|
|
1829
|
-
createdAt:
|
|
1830
|
-
updatedAt:
|
|
1831
|
-
refreshToken:
|
|
1832
|
-
userId:
|
|
1833
|
-
expiresAt:
|
|
1834
|
-
ip:
|
|
1835
|
-
userAgent:
|
|
1836
|
-
os:
|
|
1837
|
-
browser:
|
|
1838
|
-
device:
|
|
1717
|
+
response: alepha23.TPage<alepha23.TObject<{
|
|
1718
|
+
id: alepha23.TString;
|
|
1719
|
+
version: alepha23.TNumber;
|
|
1720
|
+
createdAt: alepha23.TString;
|
|
1721
|
+
updatedAt: alepha23.TString;
|
|
1722
|
+
refreshToken: alepha23.TString;
|
|
1723
|
+
userId: alepha23.TString;
|
|
1724
|
+
expiresAt: alepha23.TString;
|
|
1725
|
+
ip: alepha23.TOptional<alepha23.TString>;
|
|
1726
|
+
userAgent: alepha23.TOptional<alepha23.TObject<{
|
|
1727
|
+
os: alepha23.TString;
|
|
1728
|
+
browser: alepha23.TString;
|
|
1729
|
+
device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
|
|
1839
1730
|
}>>;
|
|
1840
1731
|
}>>;
|
|
1841
1732
|
}>;
|
|
1842
1733
|
/**
|
|
1843
|
-
|
|
1844
|
-
|
|
1734
|
+
* Get a session by ID.
|
|
1735
|
+
*/
|
|
1845
1736
|
readonly getSession: alepha_server0.ActionPrimitiveFn<{
|
|
1846
|
-
params:
|
|
1847
|
-
id:
|
|
1737
|
+
params: alepha23.TObject<{
|
|
1738
|
+
id: alepha23.TString;
|
|
1848
1739
|
}>;
|
|
1849
|
-
query:
|
|
1850
|
-
userRealmName:
|
|
1740
|
+
query: alepha23.TObject<{
|
|
1741
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
1851
1742
|
}>;
|
|
1852
|
-
response:
|
|
1853
|
-
id:
|
|
1854
|
-
version:
|
|
1855
|
-
createdAt:
|
|
1856
|
-
updatedAt:
|
|
1857
|
-
refreshToken:
|
|
1858
|
-
userId:
|
|
1859
|
-
expiresAt:
|
|
1860
|
-
ip:
|
|
1861
|
-
userAgent:
|
|
1862
|
-
os:
|
|
1863
|
-
browser:
|
|
1864
|
-
device:
|
|
1743
|
+
response: alepha23.TObject<{
|
|
1744
|
+
id: alepha23.TString;
|
|
1745
|
+
version: alepha23.TNumber;
|
|
1746
|
+
createdAt: alepha23.TString;
|
|
1747
|
+
updatedAt: alepha23.TString;
|
|
1748
|
+
refreshToken: alepha23.TString;
|
|
1749
|
+
userId: alepha23.TString;
|
|
1750
|
+
expiresAt: alepha23.TString;
|
|
1751
|
+
ip: alepha23.TOptional<alepha23.TString>;
|
|
1752
|
+
userAgent: alepha23.TOptional<alepha23.TObject<{
|
|
1753
|
+
os: alepha23.TString;
|
|
1754
|
+
browser: alepha23.TString;
|
|
1755
|
+
device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
|
|
1865
1756
|
}>>;
|
|
1866
1757
|
}>;
|
|
1867
1758
|
}>;
|
|
1868
1759
|
/**
|
|
1869
|
-
|
|
1870
|
-
|
|
1760
|
+
* Delete a session.
|
|
1761
|
+
*/
|
|
1871
1762
|
readonly deleteSession: alepha_server0.ActionPrimitiveFn<{
|
|
1872
|
-
params:
|
|
1873
|
-
id:
|
|
1763
|
+
params: alepha23.TObject<{
|
|
1764
|
+
id: alepha23.TString;
|
|
1874
1765
|
}>;
|
|
1875
|
-
query:
|
|
1876
|
-
userRealmName:
|
|
1766
|
+
query: alepha23.TObject<{
|
|
1767
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
1877
1768
|
}>;
|
|
1878
|
-
response:
|
|
1879
|
-
ok:
|
|
1880
|
-
id:
|
|
1881
|
-
count:
|
|
1769
|
+
response: alepha23.TObject<{
|
|
1770
|
+
ok: alepha23.TBoolean;
|
|
1771
|
+
id: alepha23.TOptional<alepha23.TUnion<[alepha23.TString, alepha23.TInteger]>>;
|
|
1772
|
+
count: alepha23.TOptional<alepha23.TNumber>;
|
|
1882
1773
|
}>;
|
|
1883
1774
|
}>;
|
|
1884
1775
|
}
|
|
1885
1776
|
//#endregion
|
|
1886
1777
|
//#region ../../src/api/users/notifications/UserNotifications.d.ts
|
|
1887
1778
|
declare class UserNotifications {
|
|
1888
|
-
readonly passwordReset: alepha_api_notifications0.NotificationPrimitive<
|
|
1889
|
-
email:
|
|
1890
|
-
code:
|
|
1891
|
-
expiresInMinutes:
|
|
1779
|
+
readonly passwordReset: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
|
|
1780
|
+
email: alepha23.TString;
|
|
1781
|
+
code: alepha23.TString;
|
|
1782
|
+
expiresInMinutes: alepha23.TNumber;
|
|
1892
1783
|
}>>;
|
|
1893
|
-
readonly emailVerification: alepha_api_notifications0.NotificationPrimitive<
|
|
1894
|
-
email:
|
|
1895
|
-
code:
|
|
1896
|
-
expiresInMinutes:
|
|
1784
|
+
readonly emailVerification: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
|
|
1785
|
+
email: alepha23.TString;
|
|
1786
|
+
code: alepha23.TString;
|
|
1787
|
+
expiresInMinutes: alepha23.TNumber;
|
|
1897
1788
|
}>>;
|
|
1898
|
-
readonly phoneVerification: alepha_api_notifications0.NotificationPrimitive<
|
|
1899
|
-
phoneNumber:
|
|
1900
|
-
code:
|
|
1901
|
-
expiresInMinutes:
|
|
1789
|
+
readonly phoneVerification: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
|
|
1790
|
+
phoneNumber: alepha23.TString;
|
|
1791
|
+
code: alepha23.TString;
|
|
1792
|
+
expiresInMinutes: alepha23.TNumber;
|
|
1902
1793
|
}>>;
|
|
1903
|
-
readonly passwordResetLink: alepha_api_notifications0.NotificationPrimitive<
|
|
1904
|
-
email:
|
|
1905
|
-
resetUrl:
|
|
1906
|
-
expiresInMinutes:
|
|
1794
|
+
readonly passwordResetLink: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
|
|
1795
|
+
email: alepha23.TString;
|
|
1796
|
+
resetUrl: alepha23.TString;
|
|
1797
|
+
expiresInMinutes: alepha23.TNumber;
|
|
1907
1798
|
}>>;
|
|
1908
|
-
readonly emailVerificationLink: alepha_api_notifications0.NotificationPrimitive<
|
|
1909
|
-
email:
|
|
1910
|
-
verifyUrl:
|
|
1911
|
-
expiresInMinutes:
|
|
1799
|
+
readonly emailVerificationLink: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
|
|
1800
|
+
email: alepha23.TString;
|
|
1801
|
+
verifyUrl: alepha23.TString;
|
|
1802
|
+
expiresInMinutes: alepha23.TNumber;
|
|
1912
1803
|
}>>;
|
|
1913
1804
|
}
|
|
1914
1805
|
//#endregion
|
|
1915
1806
|
//#region ../../src/api/users/schemas/createUserSchema.d.ts
|
|
1916
|
-
declare const createUserSchema:
|
|
1917
|
-
id:
|
|
1918
|
-
version:
|
|
1919
|
-
email:
|
|
1920
|
-
createdAt:
|
|
1921
|
-
updatedAt:
|
|
1922
|
-
username:
|
|
1923
|
-
phoneNumber:
|
|
1924
|
-
roles:
|
|
1925
|
-
firstName:
|
|
1926
|
-
lastName:
|
|
1927
|
-
picture:
|
|
1928
|
-
enabled:
|
|
1929
|
-
emailVerified:
|
|
1807
|
+
declare const createUserSchema: alepha23.TObject<{
|
|
1808
|
+
id: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>>;
|
|
1809
|
+
version: alepha23.TOptional<PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>>;
|
|
1810
|
+
email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1811
|
+
createdAt: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>>;
|
|
1812
|
+
updatedAt: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>>;
|
|
1813
|
+
username: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1814
|
+
phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1815
|
+
roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
|
|
1816
|
+
firstName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1817
|
+
lastName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1818
|
+
picture: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1819
|
+
enabled: alepha23.TOptional<PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>>;
|
|
1820
|
+
emailVerified: alepha23.TOptional<PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>>;
|
|
1930
1821
|
}>;
|
|
1931
1822
|
type CreateUser = Static<typeof createUserSchema>;
|
|
1932
1823
|
//#endregion
|
|
1933
1824
|
//#region ../../src/api/users/schemas/updateUserSchema.d.ts
|
|
1934
|
-
declare const updateUserSchema:
|
|
1935
|
-
email:
|
|
1936
|
-
realm:
|
|
1937
|
-
phoneNumber:
|
|
1938
|
-
roles:
|
|
1939
|
-
firstName:
|
|
1940
|
-
lastName:
|
|
1941
|
-
picture:
|
|
1942
|
-
enabled:
|
|
1825
|
+
declare const updateUserSchema: alepha23.TObject<{
|
|
1826
|
+
email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1827
|
+
realm: alepha23.TOptional<PgAttr<alepha23.TString, typeof PG_DEFAULT>>;
|
|
1828
|
+
phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1829
|
+
roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
|
|
1830
|
+
firstName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1831
|
+
lastName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1832
|
+
picture: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1833
|
+
enabled: alepha23.TOptional<PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>>;
|
|
1943
1834
|
}>;
|
|
1944
1835
|
type UpdateUser = Static<typeof updateUserSchema>;
|
|
1945
1836
|
//#endregion
|
|
1946
1837
|
//#region ../../src/api/users/schemas/userQuerySchema.d.ts
|
|
1947
|
-
declare const userQuerySchema:
|
|
1948
|
-
page:
|
|
1949
|
-
size:
|
|
1950
|
-
sort:
|
|
1951
|
-
email:
|
|
1952
|
-
enabled:
|
|
1953
|
-
emailVerified:
|
|
1954
|
-
roles:
|
|
1955
|
-
query:
|
|
1838
|
+
declare const userQuerySchema: alepha23.TObject<{
|
|
1839
|
+
page: alepha23.TOptional<alepha23.TInteger>;
|
|
1840
|
+
size: alepha23.TOptional<alepha23.TInteger>;
|
|
1841
|
+
sort: alepha23.TOptional<alepha23.TString>;
|
|
1842
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
1843
|
+
enabled: alepha23.TOptional<alepha23.TBoolean>;
|
|
1844
|
+
emailVerified: alepha23.TOptional<alepha23.TBoolean>;
|
|
1845
|
+
roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
|
|
1846
|
+
query: alepha23.TOptional<alepha23.TString>;
|
|
1956
1847
|
}>;
|
|
1957
1848
|
type UserQuery = Static<typeof userQuerySchema>;
|
|
1958
1849
|
//#endregion
|
|
1959
1850
|
//#region ../../src/api/users/services/UserService.d.ts
|
|
1960
1851
|
declare class UserService {
|
|
1961
1852
|
protected readonly log: alepha_logger5.Logger;
|
|
1962
|
-
protected readonly verificationController:
|
|
1853
|
+
protected readonly verificationController: alepha_server_links0.HttpVirtualClient<VerificationController>;
|
|
1963
1854
|
protected readonly userNotifications: UserNotifications;
|
|
1964
|
-
protected readonly
|
|
1855
|
+
protected readonly realmProvider: RealmProvider;
|
|
1965
1856
|
protected readonly auditService: AuditService;
|
|
1966
|
-
users(userRealmName?: string):
|
|
1967
|
-
id:
|
|
1968
|
-
version:
|
|
1969
|
-
createdAt:
|
|
1970
|
-
updatedAt:
|
|
1971
|
-
realm:
|
|
1972
|
-
username:
|
|
1973
|
-
email:
|
|
1974
|
-
phoneNumber:
|
|
1975
|
-
roles:
|
|
1976
|
-
firstName:
|
|
1977
|
-
lastName:
|
|
1978
|
-
picture:
|
|
1979
|
-
enabled:
|
|
1980
|
-
emailVerified:
|
|
1857
|
+
users(userRealmName?: string): alepha_orm24.Repository<alepha23.TObject<{
|
|
1858
|
+
id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1859
|
+
version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1860
|
+
createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1861
|
+
updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1862
|
+
realm: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_DEFAULT>;
|
|
1863
|
+
username: alepha23.TOptional<alepha23.TString>;
|
|
1864
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
1865
|
+
phoneNumber: alepha23.TOptional<alepha23.TString>;
|
|
1866
|
+
roles: alepha_orm24.PgAttr<alepha23.TArray<alepha23.TString>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1867
|
+
firstName: alepha23.TOptional<alepha23.TString>;
|
|
1868
|
+
lastName: alepha23.TOptional<alepha23.TString>;
|
|
1869
|
+
picture: alepha23.TOptional<alepha23.TString>;
|
|
1870
|
+
enabled: alepha_orm24.PgAttr<alepha23.TBoolean, typeof alepha_orm24.PG_DEFAULT>;
|
|
1871
|
+
emailVerified: alepha_orm24.PgAttr<alepha23.TBoolean, typeof alepha_orm24.PG_DEFAULT>;
|
|
1981
1872
|
}>>;
|
|
1982
1873
|
/**
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1874
|
+
* Request email verification for a user.
|
|
1875
|
+
* @param email - The email address to verify.
|
|
1876
|
+
* @param userRealmName - Optional realm name.
|
|
1877
|
+
* @param method - The verification method: "code" (default) or "link".
|
|
1878
|
+
* @param verifyUrl - Base URL for verification link (required when method is "link").
|
|
1879
|
+
*/
|
|
1989
1880
|
requestEmailVerification(email: string, userRealmName?: string, method?: "code" | "link", verifyUrl?: string): Promise<boolean>;
|
|
1990
1881
|
/**
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1882
|
+
* Verify a user's email using a valid verification token.
|
|
1883
|
+
* Supports both code (6-digit) and link (UUID) verification tokens.
|
|
1884
|
+
*/
|
|
1994
1885
|
verifyEmail(email: string, token: string, userRealmName?: string): Promise<void>;
|
|
1995
1886
|
/**
|
|
1996
|
-
|
|
1997
|
-
|
|
1887
|
+
* Check if an email is verified.
|
|
1888
|
+
*/
|
|
1998
1889
|
isEmailVerified(email: string, userRealmName?: string): Promise<boolean>;
|
|
1999
1890
|
/**
|
|
2000
|
-
|
|
2001
|
-
|
|
1891
|
+
* Find users with pagination and filtering.
|
|
1892
|
+
*/
|
|
2002
1893
|
findUsers(q?: UserQuery, userRealmName?: string): Promise<Page$1<UserEntity>>;
|
|
2003
1894
|
/**
|
|
2004
|
-
|
|
2005
|
-
|
|
1895
|
+
* Get a user by ID.
|
|
1896
|
+
*/
|
|
2006
1897
|
getUserById(id: string, userRealmName?: string): Promise<UserEntity>;
|
|
2007
1898
|
/**
|
|
2008
|
-
|
|
2009
|
-
|
|
1899
|
+
* Create a new user.
|
|
1900
|
+
*/
|
|
2010
1901
|
createUser(data: CreateUser, userRealmName?: string): Promise<UserEntity>;
|
|
2011
1902
|
/**
|
|
2012
|
-
|
|
2013
|
-
|
|
1903
|
+
* Update an existing user.
|
|
1904
|
+
*/
|
|
2014
1905
|
updateUser(id: string, data: UpdateUser, userRealmName?: string): Promise<UserEntity>;
|
|
2015
1906
|
/**
|
|
2016
|
-
|
|
2017
|
-
|
|
1907
|
+
* Delete a user by ID.
|
|
1908
|
+
*/
|
|
2018
1909
|
deleteUser(id: string, userRealmName?: string): Promise<void>;
|
|
2019
1910
|
}
|
|
2020
1911
|
//#endregion
|
|
@@ -2024,154 +1915,218 @@ declare class AdminUserController {
|
|
|
2024
1915
|
protected readonly group = "admin:users";
|
|
2025
1916
|
protected readonly userService: UserService;
|
|
2026
1917
|
/**
|
|
2027
|
-
|
|
2028
|
-
|
|
1918
|
+
* Find users with pagination and filtering.
|
|
1919
|
+
*/
|
|
2029
1920
|
readonly findUsers: alepha_server0.ActionPrimitiveFn<{
|
|
2030
|
-
query:
|
|
2031
|
-
page:
|
|
2032
|
-
size:
|
|
2033
|
-
sort:
|
|
2034
|
-
email:
|
|
2035
|
-
enabled:
|
|
2036
|
-
emailVerified:
|
|
2037
|
-
roles:
|
|
2038
|
-
query:
|
|
2039
|
-
userRealmName:
|
|
1921
|
+
query: alepha23.TObject<{
|
|
1922
|
+
page: alepha23.TOptional<alepha23.TInteger>;
|
|
1923
|
+
size: alepha23.TOptional<alepha23.TInteger>;
|
|
1924
|
+
sort: alepha23.TOptional<alepha23.TString>;
|
|
1925
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
1926
|
+
enabled: alepha23.TOptional<alepha23.TBoolean>;
|
|
1927
|
+
emailVerified: alepha23.TOptional<alepha23.TBoolean>;
|
|
1928
|
+
roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
|
|
1929
|
+
query: alepha23.TOptional<alepha23.TString>;
|
|
1930
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
2040
1931
|
}>;
|
|
2041
|
-
response:
|
|
2042
|
-
id: PgAttr<PgAttr<
|
|
2043
|
-
version: PgAttr<PgAttr<
|
|
2044
|
-
createdAt: PgAttr<PgAttr<
|
|
2045
|
-
updatedAt: PgAttr<PgAttr<
|
|
2046
|
-
realm: PgAttr<
|
|
2047
|
-
username:
|
|
2048
|
-
email:
|
|
2049
|
-
phoneNumber:
|
|
2050
|
-
roles: PgAttr<
|
|
2051
|
-
firstName:
|
|
2052
|
-
lastName:
|
|
2053
|
-
picture:
|
|
2054
|
-
enabled: PgAttr<
|
|
2055
|
-
emailVerified: PgAttr<
|
|
1932
|
+
response: alepha23.TPage<alepha23.TObject<{
|
|
1933
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1934
|
+
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
1935
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1936
|
+
updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
1937
|
+
realm: PgAttr<alepha23.TString, typeof PG_DEFAULT>;
|
|
1938
|
+
username: alepha23.TOptional<alepha23.TString>;
|
|
1939
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
1940
|
+
phoneNumber: alepha23.TOptional<alepha23.TString>;
|
|
1941
|
+
roles: PgAttr<alepha23.TArray<alepha23.TString>, typeof PG_DEFAULT>;
|
|
1942
|
+
firstName: alepha23.TOptional<alepha23.TString>;
|
|
1943
|
+
lastName: alepha23.TOptional<alepha23.TString>;
|
|
1944
|
+
picture: alepha23.TOptional<alepha23.TString>;
|
|
1945
|
+
enabled: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
1946
|
+
emailVerified: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2056
1947
|
}>>;
|
|
2057
1948
|
}>;
|
|
2058
1949
|
/**
|
|
2059
|
-
|
|
2060
|
-
|
|
1950
|
+
* Get a user by ID.
|
|
1951
|
+
*/
|
|
2061
1952
|
readonly getUser: alepha_server0.ActionPrimitiveFn<{
|
|
2062
|
-
params:
|
|
2063
|
-
id:
|
|
1953
|
+
params: alepha23.TObject<{
|
|
1954
|
+
id: alepha23.TString;
|
|
2064
1955
|
}>;
|
|
2065
|
-
query:
|
|
2066
|
-
userRealmName:
|
|
1956
|
+
query: alepha23.TObject<{
|
|
1957
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
2067
1958
|
}>;
|
|
2068
|
-
response:
|
|
2069
|
-
id: PgAttr<PgAttr<
|
|
2070
|
-
version: PgAttr<PgAttr<
|
|
2071
|
-
createdAt: PgAttr<PgAttr<
|
|
2072
|
-
updatedAt: PgAttr<PgAttr<
|
|
2073
|
-
realm: PgAttr<
|
|
2074
|
-
username:
|
|
2075
|
-
email:
|
|
2076
|
-
phoneNumber:
|
|
2077
|
-
roles: PgAttr<
|
|
2078
|
-
firstName:
|
|
2079
|
-
lastName:
|
|
2080
|
-
picture:
|
|
2081
|
-
enabled: PgAttr<
|
|
2082
|
-
emailVerified: PgAttr<
|
|
1959
|
+
response: alepha23.TObject<{
|
|
1960
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1961
|
+
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
1962
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1963
|
+
updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
1964
|
+
realm: PgAttr<alepha23.TString, typeof PG_DEFAULT>;
|
|
1965
|
+
username: alepha23.TOptional<alepha23.TString>;
|
|
1966
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
1967
|
+
phoneNumber: alepha23.TOptional<alepha23.TString>;
|
|
1968
|
+
roles: PgAttr<alepha23.TArray<alepha23.TString>, typeof PG_DEFAULT>;
|
|
1969
|
+
firstName: alepha23.TOptional<alepha23.TString>;
|
|
1970
|
+
lastName: alepha23.TOptional<alepha23.TString>;
|
|
1971
|
+
picture: alepha23.TOptional<alepha23.TString>;
|
|
1972
|
+
enabled: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
1973
|
+
emailVerified: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2083
1974
|
}>;
|
|
2084
1975
|
}>;
|
|
2085
1976
|
/**
|
|
2086
|
-
|
|
2087
|
-
|
|
1977
|
+
* Create a new user.
|
|
1978
|
+
*/
|
|
2088
1979
|
readonly createUser: alepha_server0.ActionPrimitiveFn<{
|
|
2089
|
-
query:
|
|
2090
|
-
userRealmName:
|
|
1980
|
+
query: alepha23.TObject<{
|
|
1981
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
2091
1982
|
}>;
|
|
2092
|
-
body:
|
|
2093
|
-
id:
|
|
2094
|
-
version:
|
|
2095
|
-
email:
|
|
2096
|
-
createdAt:
|
|
2097
|
-
updatedAt:
|
|
2098
|
-
username:
|
|
2099
|
-
phoneNumber:
|
|
2100
|
-
roles:
|
|
2101
|
-
firstName:
|
|
2102
|
-
lastName:
|
|
2103
|
-
picture:
|
|
2104
|
-
enabled:
|
|
2105
|
-
emailVerified:
|
|
1983
|
+
body: alepha23.TObject<{
|
|
1984
|
+
id: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>>;
|
|
1985
|
+
version: alepha23.TOptional<PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>>;
|
|
1986
|
+
email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1987
|
+
createdAt: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>>;
|
|
1988
|
+
updatedAt: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>>;
|
|
1989
|
+
username: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1990
|
+
phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1991
|
+
roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
|
|
1992
|
+
firstName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1993
|
+
lastName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1994
|
+
picture: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1995
|
+
enabled: alepha23.TOptional<PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>>;
|
|
1996
|
+
emailVerified: alepha23.TOptional<PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>>;
|
|
2106
1997
|
}>;
|
|
2107
|
-
response:
|
|
2108
|
-
id: PgAttr<PgAttr<
|
|
2109
|
-
version: PgAttr<PgAttr<
|
|
2110
|
-
createdAt: PgAttr<PgAttr<
|
|
2111
|
-
updatedAt: PgAttr<PgAttr<
|
|
2112
|
-
realm: PgAttr<
|
|
2113
|
-
username:
|
|
2114
|
-
email:
|
|
2115
|
-
phoneNumber:
|
|
2116
|
-
roles: PgAttr<
|
|
2117
|
-
firstName:
|
|
2118
|
-
lastName:
|
|
2119
|
-
picture:
|
|
2120
|
-
enabled: PgAttr<
|
|
2121
|
-
emailVerified: PgAttr<
|
|
1998
|
+
response: alepha23.TObject<{
|
|
1999
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
2000
|
+
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
2001
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
2002
|
+
updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
2003
|
+
realm: PgAttr<alepha23.TString, typeof PG_DEFAULT>;
|
|
2004
|
+
username: alepha23.TOptional<alepha23.TString>;
|
|
2005
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
2006
|
+
phoneNumber: alepha23.TOptional<alepha23.TString>;
|
|
2007
|
+
roles: PgAttr<alepha23.TArray<alepha23.TString>, typeof PG_DEFAULT>;
|
|
2008
|
+
firstName: alepha23.TOptional<alepha23.TString>;
|
|
2009
|
+
lastName: alepha23.TOptional<alepha23.TString>;
|
|
2010
|
+
picture: alepha23.TOptional<alepha23.TString>;
|
|
2011
|
+
enabled: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2012
|
+
emailVerified: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2122
2013
|
}>;
|
|
2123
2014
|
}>;
|
|
2124
2015
|
/**
|
|
2125
|
-
|
|
2126
|
-
|
|
2016
|
+
* Update a user.
|
|
2017
|
+
*/
|
|
2127
2018
|
readonly updateUser: alepha_server0.ActionPrimitiveFn<{
|
|
2128
|
-
params:
|
|
2129
|
-
id:
|
|
2019
|
+
params: alepha23.TObject<{
|
|
2020
|
+
id: alepha23.TString;
|
|
2130
2021
|
}>;
|
|
2131
|
-
query:
|
|
2132
|
-
userRealmName:
|
|
2022
|
+
query: alepha23.TObject<{
|
|
2023
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
2133
2024
|
}>;
|
|
2134
|
-
body:
|
|
2135
|
-
email:
|
|
2136
|
-
realm:
|
|
2137
|
-
phoneNumber:
|
|
2138
|
-
roles:
|
|
2139
|
-
firstName:
|
|
2140
|
-
lastName:
|
|
2141
|
-
picture:
|
|
2142
|
-
enabled:
|
|
2025
|
+
body: alepha23.TObject<{
|
|
2026
|
+
email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
2027
|
+
realm: alepha23.TOptional<PgAttr<alepha23.TString, typeof PG_DEFAULT>>;
|
|
2028
|
+
phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
2029
|
+
roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
|
|
2030
|
+
firstName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
2031
|
+
lastName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
2032
|
+
picture: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
2033
|
+
enabled: alepha23.TOptional<PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>>;
|
|
2143
2034
|
}>;
|
|
2144
|
-
response:
|
|
2145
|
-
id: PgAttr<PgAttr<
|
|
2146
|
-
version: PgAttr<PgAttr<
|
|
2147
|
-
createdAt: PgAttr<PgAttr<
|
|
2148
|
-
updatedAt: PgAttr<PgAttr<
|
|
2149
|
-
realm: PgAttr<
|
|
2150
|
-
username:
|
|
2151
|
-
email:
|
|
2152
|
-
phoneNumber:
|
|
2153
|
-
roles: PgAttr<
|
|
2154
|
-
firstName:
|
|
2155
|
-
lastName:
|
|
2156
|
-
picture:
|
|
2157
|
-
enabled: PgAttr<
|
|
2158
|
-
emailVerified: PgAttr<
|
|
2035
|
+
response: alepha23.TObject<{
|
|
2036
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
2037
|
+
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
2038
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
2039
|
+
updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
2040
|
+
realm: PgAttr<alepha23.TString, typeof PG_DEFAULT>;
|
|
2041
|
+
username: alepha23.TOptional<alepha23.TString>;
|
|
2042
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
2043
|
+
phoneNumber: alepha23.TOptional<alepha23.TString>;
|
|
2044
|
+
roles: PgAttr<alepha23.TArray<alepha23.TString>, typeof PG_DEFAULT>;
|
|
2045
|
+
firstName: alepha23.TOptional<alepha23.TString>;
|
|
2046
|
+
lastName: alepha23.TOptional<alepha23.TString>;
|
|
2047
|
+
picture: alepha23.TOptional<alepha23.TString>;
|
|
2048
|
+
enabled: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2049
|
+
emailVerified: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2159
2050
|
}>;
|
|
2160
2051
|
}>;
|
|
2161
2052
|
/**
|
|
2162
|
-
|
|
2163
|
-
|
|
2053
|
+
* Delete a user.
|
|
2054
|
+
*/
|
|
2164
2055
|
readonly deleteUser: alepha_server0.ActionPrimitiveFn<{
|
|
2165
|
-
params:
|
|
2166
|
-
id:
|
|
2056
|
+
params: alepha23.TObject<{
|
|
2057
|
+
id: alepha23.TString;
|
|
2167
2058
|
}>;
|
|
2168
|
-
query:
|
|
2169
|
-
userRealmName:
|
|
2059
|
+
query: alepha23.TObject<{
|
|
2060
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
2170
2061
|
}>;
|
|
2171
|
-
response:
|
|
2172
|
-
ok:
|
|
2173
|
-
id:
|
|
2174
|
-
count:
|
|
2062
|
+
response: alepha23.TObject<{
|
|
2063
|
+
ok: alepha23.TBoolean;
|
|
2064
|
+
id: alepha23.TOptional<alepha23.TUnion<[alepha23.TString, alepha23.TInteger]>>;
|
|
2065
|
+
count: alepha23.TOptional<alepha23.TNumber>;
|
|
2066
|
+
}>;
|
|
2067
|
+
}>;
|
|
2068
|
+
}
|
|
2069
|
+
//#endregion
|
|
2070
|
+
//#region ../../src/api/users/controllers/RealmController.d.ts
|
|
2071
|
+
/**
|
|
2072
|
+
* Controller for exposing realm configuration.
|
|
2073
|
+
* Uses $route instead of $action to keep endpoints hidden from API documentation.
|
|
2074
|
+
*/
|
|
2075
|
+
declare class RealmController {
|
|
2076
|
+
protected readonly url = "/realms";
|
|
2077
|
+
protected readonly group = "realms";
|
|
2078
|
+
protected readonly realmProvider: RealmProvider;
|
|
2079
|
+
protected readonly serverAuthProvider: ServerAuthProvider;
|
|
2080
|
+
/**
|
|
2081
|
+
* Get realm configuration settings.
|
|
2082
|
+
* This endpoint is not exposed in the API documentation.
|
|
2083
|
+
*/
|
|
2084
|
+
readonly getRealmConfig: alepha_server0.ActionPrimitiveFn<{
|
|
2085
|
+
query: alepha23.TObject<{
|
|
2086
|
+
realmName: alepha23.TOptional<alepha23.TString>;
|
|
2087
|
+
}>;
|
|
2088
|
+
response: alepha23.TObject<{
|
|
2089
|
+
settings: alepha23.TObject<{
|
|
2090
|
+
displayName: alepha23.TOptional<alepha23.TString>;
|
|
2091
|
+
description: alepha23.TOptional<alepha23.TString>;
|
|
2092
|
+
logoUrl: alepha23.TOptional<alepha23.TString>;
|
|
2093
|
+
registrationAllowed: alepha23.TBoolean;
|
|
2094
|
+
emailEnabled: alepha23.TBoolean;
|
|
2095
|
+
emailRequired: alepha23.TBoolean;
|
|
2096
|
+
usernameEnabled: alepha23.TBoolean;
|
|
2097
|
+
usernameRequired: alepha23.TBoolean;
|
|
2098
|
+
usernameRegExp: alepha23.TString;
|
|
2099
|
+
phoneEnabled: alepha23.TBoolean;
|
|
2100
|
+
phoneRequired: alepha23.TBoolean;
|
|
2101
|
+
verifyEmailRequired: alepha23.TBoolean;
|
|
2102
|
+
verifyPhoneRequired: alepha23.TBoolean;
|
|
2103
|
+
firstNameLastNameEnabled: alepha23.TBoolean;
|
|
2104
|
+
firstNameLastNameRequired: alepha23.TBoolean;
|
|
2105
|
+
resetPasswordAllowed: alepha23.TBoolean;
|
|
2106
|
+
passwordPolicy: alepha23.TObject<{
|
|
2107
|
+
minLength: alepha23.TInteger;
|
|
2108
|
+
requireUppercase: alepha23.TBoolean;
|
|
2109
|
+
requireLowercase: alepha23.TBoolean;
|
|
2110
|
+
requireNumbers: alepha23.TBoolean;
|
|
2111
|
+
requireSpecialCharacters: alepha23.TBoolean;
|
|
2112
|
+
}>;
|
|
2113
|
+
}>;
|
|
2114
|
+
realmName: alepha23.TString;
|
|
2115
|
+
authenticationMethods: alepha23.TArray<alepha23.TObject<{
|
|
2116
|
+
name: alepha23.TString;
|
|
2117
|
+
type: alepha23.TUnsafe<"OAUTH2" | "OIDC" | "CREDENTIALS">;
|
|
2118
|
+
}>>;
|
|
2119
|
+
}>;
|
|
2120
|
+
}>;
|
|
2121
|
+
readonly checkUsernameAvailability: alepha_server0.ActionPrimitiveFn<{
|
|
2122
|
+
query: alepha23.TObject<{
|
|
2123
|
+
realmName: alepha23.TOptional<alepha23.TString>;
|
|
2124
|
+
}>;
|
|
2125
|
+
body: alepha23.TObject<{
|
|
2126
|
+
username: alepha23.TString;
|
|
2127
|
+
}>;
|
|
2128
|
+
response: alepha23.TObject<{
|
|
2129
|
+
available: alepha23.TBoolean;
|
|
2175
2130
|
}>;
|
|
2176
2131
|
}>;
|
|
2177
2132
|
}
|
|
@@ -2183,10 +2138,10 @@ declare class AdminUserController {
|
|
|
2183
2138
|
* Requires the intent ID from Phase 1, the verification code,
|
|
2184
2139
|
* and the new password.
|
|
2185
2140
|
*/
|
|
2186
|
-
declare const completePasswordResetRequestSchema:
|
|
2187
|
-
intentId:
|
|
2188
|
-
code:
|
|
2189
|
-
newPassword:
|
|
2141
|
+
declare const completePasswordResetRequestSchema: alepha23.TObject<{
|
|
2142
|
+
intentId: alepha23.TString;
|
|
2143
|
+
code: alepha23.TString;
|
|
2144
|
+
newPassword: alepha23.TString;
|
|
2190
2145
|
}>;
|
|
2191
2146
|
type CompletePasswordResetRequest = Static<typeof completePasswordResetRequestSchema>;
|
|
2192
2147
|
//#endregion
|
|
@@ -2197,9 +2152,9 @@ type CompletePasswordResetRequest = Static<typeof completePasswordResetRequestSc
|
|
|
2197
2152
|
* Contains the intent ID needed for Phase 2 completion,
|
|
2198
2153
|
* along with expiration time.
|
|
2199
2154
|
*/
|
|
2200
|
-
declare const passwordResetIntentResponseSchema:
|
|
2201
|
-
intentId:
|
|
2202
|
-
expiresAt:
|
|
2155
|
+
declare const passwordResetIntentResponseSchema: alepha23.TObject<{
|
|
2156
|
+
intentId: alepha23.TString;
|
|
2157
|
+
expiresAt: alepha23.TString;
|
|
2203
2158
|
}>;
|
|
2204
2159
|
type PasswordResetIntentResponse = Static<typeof passwordResetIntentResponseSchema>;
|
|
2205
2160
|
//#endregion
|
|
@@ -2218,93 +2173,93 @@ declare class CredentialService {
|
|
|
2218
2173
|
protected readonly log: alepha_logger5.Logger;
|
|
2219
2174
|
protected readonly cryptoProvider: CryptoProvider;
|
|
2220
2175
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
2221
|
-
protected readonly verificationController:
|
|
2176
|
+
protected readonly verificationController: alepha_server_links0.HttpVirtualClient<VerificationController>;
|
|
2222
2177
|
protected readonly userNotifications: UserNotifications;
|
|
2223
|
-
protected readonly
|
|
2178
|
+
protected readonly realmProvider: RealmProvider;
|
|
2224
2179
|
protected readonly auditService: AuditService;
|
|
2225
2180
|
protected readonly intentCache: alepha_cache0.CachePrimitiveFn<PasswordResetIntent, any[]>;
|
|
2226
|
-
users(userRealmName?: string): Repository$1<
|
|
2227
|
-
id: PgAttr<PgAttr<
|
|
2228
|
-
version: PgAttr<PgAttr<
|
|
2229
|
-
createdAt: PgAttr<PgAttr<
|
|
2230
|
-
updatedAt: PgAttr<PgAttr<
|
|
2231
|
-
realm: PgAttr<
|
|
2232
|
-
username:
|
|
2233
|
-
email:
|
|
2234
|
-
phoneNumber:
|
|
2235
|
-
roles: PgAttr<
|
|
2236
|
-
firstName:
|
|
2237
|
-
lastName:
|
|
2238
|
-
picture:
|
|
2239
|
-
enabled: PgAttr<
|
|
2240
|
-
emailVerified: PgAttr<
|
|
2181
|
+
users(userRealmName?: string): Repository$1<alepha23.TObject<{
|
|
2182
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
2183
|
+
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
2184
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
2185
|
+
updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
2186
|
+
realm: PgAttr<alepha23.TString, typeof PG_DEFAULT>;
|
|
2187
|
+
username: alepha23.TOptional<alepha23.TString>;
|
|
2188
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
2189
|
+
phoneNumber: alepha23.TOptional<alepha23.TString>;
|
|
2190
|
+
roles: PgAttr<alepha23.TArray<alepha23.TString>, typeof PG_DEFAULT>;
|
|
2191
|
+
firstName: alepha23.TOptional<alepha23.TString>;
|
|
2192
|
+
lastName: alepha23.TOptional<alepha23.TString>;
|
|
2193
|
+
picture: alepha23.TOptional<alepha23.TString>;
|
|
2194
|
+
enabled: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2195
|
+
emailVerified: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2241
2196
|
}>>;
|
|
2242
|
-
sessions(userRealmName?: string): Repository$1<
|
|
2243
|
-
id: PgAttr<PgAttr<
|
|
2244
|
-
version: PgAttr<PgAttr<
|
|
2245
|
-
createdAt: PgAttr<PgAttr<
|
|
2246
|
-
updatedAt: PgAttr<PgAttr<
|
|
2247
|
-
refreshToken:
|
|
2248
|
-
userId: PgAttr<
|
|
2249
|
-
expiresAt:
|
|
2250
|
-
ip:
|
|
2251
|
-
userAgent:
|
|
2252
|
-
os:
|
|
2253
|
-
browser:
|
|
2254
|
-
device:
|
|
2197
|
+
sessions(userRealmName?: string): Repository$1<alepha23.TObject<{
|
|
2198
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
2199
|
+
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
2200
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
2201
|
+
updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
2202
|
+
refreshToken: alepha23.TString;
|
|
2203
|
+
userId: PgAttr<alepha23.TString, typeof PG_REF>;
|
|
2204
|
+
expiresAt: alepha23.TString;
|
|
2205
|
+
ip: alepha23.TOptional<alepha23.TString>;
|
|
2206
|
+
userAgent: alepha23.TOptional<alepha23.TObject<{
|
|
2207
|
+
os: alepha23.TString;
|
|
2208
|
+
browser: alepha23.TString;
|
|
2209
|
+
device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
|
|
2255
2210
|
}>>;
|
|
2256
2211
|
}>>;
|
|
2257
|
-
identities(userRealmName?: string): Repository$1<
|
|
2258
|
-
id: PgAttr<PgAttr<
|
|
2259
|
-
version: PgAttr<PgAttr<
|
|
2260
|
-
createdAt: PgAttr<PgAttr<
|
|
2261
|
-
updatedAt: PgAttr<PgAttr<
|
|
2262
|
-
userId: PgAttr<
|
|
2263
|
-
password:
|
|
2264
|
-
provider:
|
|
2265
|
-
providerUserId:
|
|
2266
|
-
providerData:
|
|
2212
|
+
identities(userRealmName?: string): Repository$1<alepha23.TObject<{
|
|
2213
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
2214
|
+
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
2215
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
2216
|
+
updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
2217
|
+
userId: PgAttr<alepha23.TString, typeof PG_REF>;
|
|
2218
|
+
password: alepha23.TOptional<alepha23.TString>;
|
|
2219
|
+
provider: alepha23.TString;
|
|
2220
|
+
providerUserId: alepha23.TOptional<alepha23.TString>;
|
|
2221
|
+
providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
|
|
2267
2222
|
}>>;
|
|
2268
2223
|
/**
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2224
|
+
* Phase 1: Create a password reset intent.
|
|
2225
|
+
*
|
|
2226
|
+
* Validates the email, checks for existing user with credentials,
|
|
2227
|
+
* sends verification code, and stores the intent in cache.
|
|
2228
|
+
*
|
|
2229
|
+
* @param email - User's email address
|
|
2230
|
+
* @param userRealmName - Optional realm name
|
|
2231
|
+
* @returns Intent response with intentId and expiration (always returns for security)
|
|
2232
|
+
*/
|
|
2278
2233
|
createPasswordResetIntent(email: string, userRealmName?: string): Promise<PasswordResetIntentResponse>;
|
|
2279
2234
|
/**
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2235
|
+
* Phase 2: Complete password reset using an intent.
|
|
2236
|
+
*
|
|
2237
|
+
* Validates the verification code, updates the password,
|
|
2238
|
+
* and invalidates all existing sessions.
|
|
2239
|
+
*
|
|
2240
|
+
* @param body - Request body with intentId, code, and newPassword
|
|
2241
|
+
*/
|
|
2287
2242
|
completePasswordReset(body: CompletePasswordResetRequest): Promise<void>;
|
|
2288
2243
|
/**
|
|
2289
|
-
|
|
2290
|
-
|
|
2244
|
+
* @deprecated Use createPasswordResetIntent instead
|
|
2245
|
+
*/
|
|
2291
2246
|
requestPasswordReset(email: string, userRealmName?: string): Promise<boolean>;
|
|
2292
2247
|
/**
|
|
2293
|
-
|
|
2294
|
-
|
|
2248
|
+
* @deprecated Use completePasswordReset instead
|
|
2249
|
+
*/
|
|
2295
2250
|
validateResetToken(email: string, token: string, _userRealmName?: string): Promise<string>;
|
|
2296
2251
|
/**
|
|
2297
|
-
|
|
2298
|
-
|
|
2252
|
+
* @deprecated Use completePasswordReset instead
|
|
2253
|
+
*/
|
|
2299
2254
|
resetPassword(email: string, token: string, newPassword: string, userRealmName?: string): Promise<void>;
|
|
2300
2255
|
}
|
|
2301
2256
|
//#endregion
|
|
2302
2257
|
//#region ../../src/api/users/schemas/completeRegistrationRequestSchema.d.ts
|
|
2303
|
-
declare const completeRegistrationRequestSchema:
|
|
2304
|
-
intentId:
|
|
2305
|
-
emailCode:
|
|
2306
|
-
phoneCode:
|
|
2307
|
-
captchaToken:
|
|
2258
|
+
declare const completeRegistrationRequestSchema: alepha23.TObject<{
|
|
2259
|
+
intentId: alepha23.TString;
|
|
2260
|
+
emailCode: alepha23.TOptional<alepha23.TString>;
|
|
2261
|
+
phoneCode: alepha23.TOptional<alepha23.TString>;
|
|
2262
|
+
captchaToken: alepha23.TOptional<alepha23.TString>;
|
|
2308
2263
|
}>;
|
|
2309
2264
|
type CompleteRegistrationRequest = Static<typeof completeRegistrationRequestSchema>;
|
|
2310
2265
|
//#endregion
|
|
@@ -2313,24 +2268,24 @@ type CompleteRegistrationRequest = Static<typeof completeRegistrationRequestSche
|
|
|
2313
2268
|
* Schema for user registration request body.
|
|
2314
2269
|
* Password is always required, other fields depend on realm settings.
|
|
2315
2270
|
*/
|
|
2316
|
-
declare const registerRequestSchema:
|
|
2317
|
-
password:
|
|
2318
|
-
username:
|
|
2319
|
-
email:
|
|
2320
|
-
phoneNumber:
|
|
2321
|
-
firstName:
|
|
2322
|
-
lastName:
|
|
2323
|
-
picture:
|
|
2271
|
+
declare const registerRequestSchema: alepha23.TObject<{
|
|
2272
|
+
password: alepha23.TString;
|
|
2273
|
+
username: alepha23.TOptional<alepha23.TString>;
|
|
2274
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
2275
|
+
phoneNumber: alepha23.TOptional<alepha23.TString>;
|
|
2276
|
+
firstName: alepha23.TOptional<alepha23.TString>;
|
|
2277
|
+
lastName: alepha23.TOptional<alepha23.TString>;
|
|
2278
|
+
picture: alepha23.TOptional<alepha23.TString>;
|
|
2324
2279
|
}>;
|
|
2325
2280
|
type RegisterRequest = Static<typeof registerRequestSchema>;
|
|
2326
2281
|
//#endregion
|
|
2327
2282
|
//#region ../../src/api/users/schemas/registrationIntentResponseSchema.d.ts
|
|
2328
|
-
declare const registrationIntentResponseSchema:
|
|
2329
|
-
intentId:
|
|
2330
|
-
expectCaptcha:
|
|
2331
|
-
expectEmailVerification:
|
|
2332
|
-
expectPhoneVerification:
|
|
2333
|
-
expiresAt:
|
|
2283
|
+
declare const registrationIntentResponseSchema: alepha23.TObject<{
|
|
2284
|
+
intentId: alepha23.TString;
|
|
2285
|
+
expectCaptcha: alepha23.TBoolean;
|
|
2286
|
+
expectEmailVerification: alepha23.TBoolean;
|
|
2287
|
+
expectPhoneVerification: alepha23.TBoolean;
|
|
2288
|
+
expiresAt: alepha23.TString;
|
|
2334
2289
|
}>;
|
|
2335
2290
|
type RegistrationIntentResponse = Static<typeof registrationIntentResponseSchema>;
|
|
2336
2291
|
//#endregion
|
|
@@ -2360,44 +2315,44 @@ declare class RegistrationService {
|
|
|
2360
2315
|
protected readonly log: alepha_logger5.Logger;
|
|
2361
2316
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
2362
2317
|
protected readonly cryptoProvider: CryptoProvider;
|
|
2363
|
-
protected readonly verificationController:
|
|
2318
|
+
protected readonly verificationController: alepha_server_links0.HttpVirtualClient<VerificationController>;
|
|
2364
2319
|
protected readonly userNotifications: UserNotifications;
|
|
2365
|
-
protected readonly
|
|
2320
|
+
protected readonly realmProvider: RealmProvider;
|
|
2366
2321
|
protected readonly auditService: AuditService;
|
|
2367
2322
|
protected readonly intentCache: alepha_cache0.CachePrimitiveFn<RegistrationIntent, any[]>;
|
|
2368
2323
|
/**
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2324
|
+
* Phase 1: Create a registration intent.
|
|
2325
|
+
*
|
|
2326
|
+
* Validates the registration data, checks for existing users,
|
|
2327
|
+
* creates verification sessions, and stores the intent in cache.
|
|
2328
|
+
*/
|
|
2374
2329
|
createRegistrationIntent(body: RegisterRequest, userRealmName?: string): Promise<RegistrationIntentResponse>;
|
|
2375
2330
|
/**
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2331
|
+
* Phase 2: Complete registration using an intent.
|
|
2332
|
+
*
|
|
2333
|
+
* Validates all requirements (verification codes, captcha),
|
|
2334
|
+
* creates the user and credentials, and returns the user.
|
|
2335
|
+
*/
|
|
2381
2336
|
completeRegistration(body: CompleteRegistrationRequest): Promise<UserEntity>;
|
|
2382
2337
|
/**
|
|
2383
|
-
|
|
2384
|
-
|
|
2338
|
+
* Check if username, email, and phone are available.
|
|
2339
|
+
*/
|
|
2385
2340
|
protected checkUserAvailability(body: Pick<RegisterRequest, "username" | "email" | "phoneNumber">, userRealmName?: string): Promise<void>;
|
|
2386
2341
|
/**
|
|
2387
|
-
|
|
2388
|
-
|
|
2342
|
+
* Send email verification code.
|
|
2343
|
+
*/
|
|
2389
2344
|
protected sendEmailVerification(email: string): Promise<void>;
|
|
2390
2345
|
/**
|
|
2391
|
-
|
|
2392
|
-
|
|
2346
|
+
* Send phone verification code.
|
|
2347
|
+
*/
|
|
2393
2348
|
protected sendPhoneVerification(phoneNumber: string): Promise<void>;
|
|
2394
2349
|
/**
|
|
2395
|
-
|
|
2396
|
-
|
|
2350
|
+
* Verify email code using verification service.
|
|
2351
|
+
*/
|
|
2397
2352
|
protected verifyEmailCode(email: string, code: string): Promise<void>;
|
|
2398
2353
|
/**
|
|
2399
|
-
|
|
2400
|
-
|
|
2354
|
+
* Verify phone code using verification service.
|
|
2355
|
+
*/
|
|
2401
2356
|
protected verifyPhoneCode(phoneNumber: string, code: string): Promise<void>;
|
|
2402
2357
|
}
|
|
2403
2358
|
//#endregion
|
|
@@ -2409,361 +2364,299 @@ declare class UserController {
|
|
|
2409
2364
|
protected readonly userService: UserService;
|
|
2410
2365
|
protected readonly registrationService: RegistrationService;
|
|
2411
2366
|
/**
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2367
|
+
* Phase 1: Create a registration intent.
|
|
2368
|
+
* Validates data, creates verification sessions, and stores intent in cache.
|
|
2369
|
+
*/
|
|
2415
2370
|
readonly createRegistrationIntent: alepha_server0.ActionPrimitiveFn<{
|
|
2416
|
-
body:
|
|
2417
|
-
password:
|
|
2418
|
-
username:
|
|
2419
|
-
email:
|
|
2420
|
-
phoneNumber:
|
|
2421
|
-
firstName:
|
|
2422
|
-
lastName:
|
|
2423
|
-
picture:
|
|
2371
|
+
body: alepha23.TObject<{
|
|
2372
|
+
password: alepha23.TString;
|
|
2373
|
+
username: alepha23.TOptional<alepha23.TString>;
|
|
2374
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
2375
|
+
phoneNumber: alepha23.TOptional<alepha23.TString>;
|
|
2376
|
+
firstName: alepha23.TOptional<alepha23.TString>;
|
|
2377
|
+
lastName: alepha23.TOptional<alepha23.TString>;
|
|
2378
|
+
picture: alepha23.TOptional<alepha23.TString>;
|
|
2424
2379
|
}>;
|
|
2425
|
-
query:
|
|
2426
|
-
userRealmName:
|
|
2380
|
+
query: alepha23.TObject<{
|
|
2381
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
2427
2382
|
}>;
|
|
2428
|
-
response:
|
|
2429
|
-
intentId:
|
|
2430
|
-
expectCaptcha:
|
|
2431
|
-
expectEmailVerification:
|
|
2432
|
-
expectPhoneVerification:
|
|
2433
|
-
expiresAt:
|
|
2383
|
+
response: alepha23.TObject<{
|
|
2384
|
+
intentId: alepha23.TString;
|
|
2385
|
+
expectCaptcha: alepha23.TBoolean;
|
|
2386
|
+
expectEmailVerification: alepha23.TBoolean;
|
|
2387
|
+
expectPhoneVerification: alepha23.TBoolean;
|
|
2388
|
+
expiresAt: alepha23.TString;
|
|
2434
2389
|
}>;
|
|
2435
2390
|
}>;
|
|
2436
2391
|
/**
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2392
|
+
* Phase 2: Complete registration using an intent.
|
|
2393
|
+
* Validates verification codes and creates the user.
|
|
2394
|
+
*/
|
|
2440
2395
|
readonly createUserFromIntent: alepha_server0.ActionPrimitiveFn<{
|
|
2441
|
-
body:
|
|
2442
|
-
intentId:
|
|
2443
|
-
emailCode:
|
|
2444
|
-
phoneCode:
|
|
2445
|
-
captchaToken:
|
|
2396
|
+
body: alepha23.TObject<{
|
|
2397
|
+
intentId: alepha23.TString;
|
|
2398
|
+
emailCode: alepha23.TOptional<alepha23.TString>;
|
|
2399
|
+
phoneCode: alepha23.TOptional<alepha23.TString>;
|
|
2400
|
+
captchaToken: alepha23.TOptional<alepha23.TString>;
|
|
2446
2401
|
}>;
|
|
2447
|
-
response:
|
|
2448
|
-
id: PgAttr<PgAttr<
|
|
2449
|
-
version: PgAttr<PgAttr<
|
|
2450
|
-
createdAt: PgAttr<PgAttr<
|
|
2451
|
-
updatedAt: PgAttr<PgAttr<
|
|
2452
|
-
realm: PgAttr<
|
|
2453
|
-
username:
|
|
2454
|
-
email:
|
|
2455
|
-
phoneNumber:
|
|
2456
|
-
roles: PgAttr<
|
|
2457
|
-
firstName:
|
|
2458
|
-
lastName:
|
|
2459
|
-
picture:
|
|
2460
|
-
enabled: PgAttr<
|
|
2461
|
-
emailVerified: PgAttr<
|
|
2402
|
+
response: alepha23.TObject<{
|
|
2403
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
2404
|
+
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
2405
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
2406
|
+
updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
2407
|
+
realm: PgAttr<alepha23.TString, typeof PG_DEFAULT>;
|
|
2408
|
+
username: alepha23.TOptional<alepha23.TString>;
|
|
2409
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
2410
|
+
phoneNumber: alepha23.TOptional<alepha23.TString>;
|
|
2411
|
+
roles: PgAttr<alepha23.TArray<alepha23.TString>, typeof PG_DEFAULT>;
|
|
2412
|
+
firstName: alepha23.TOptional<alepha23.TString>;
|
|
2413
|
+
lastName: alepha23.TOptional<alepha23.TString>;
|
|
2414
|
+
picture: alepha23.TOptional<alepha23.TString>;
|
|
2415
|
+
enabled: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2416
|
+
emailVerified: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2462
2417
|
}>;
|
|
2463
2418
|
}>;
|
|
2464
2419
|
/**
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2420
|
+
* Phase 1: Create a password reset intent.
|
|
2421
|
+
* Validates email, sends verification code, and stores intent in cache.
|
|
2422
|
+
*/
|
|
2468
2423
|
readonly createPasswordResetIntent: alepha_server0.ActionPrimitiveFn<{
|
|
2469
|
-
query:
|
|
2470
|
-
userRealmName:
|
|
2424
|
+
query: alepha23.TObject<{
|
|
2425
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
2471
2426
|
}>;
|
|
2472
|
-
body:
|
|
2473
|
-
email:
|
|
2427
|
+
body: alepha23.TObject<{
|
|
2428
|
+
email: alepha23.TString;
|
|
2474
2429
|
}>;
|
|
2475
|
-
response:
|
|
2476
|
-
intentId:
|
|
2477
|
-
expiresAt:
|
|
2430
|
+
response: alepha23.TObject<{
|
|
2431
|
+
intentId: alepha23.TString;
|
|
2432
|
+
expiresAt: alepha23.TString;
|
|
2478
2433
|
}>;
|
|
2479
2434
|
}>;
|
|
2480
2435
|
/**
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2436
|
+
* Phase 2: Complete password reset using an intent.
|
|
2437
|
+
* Validates verification code, updates password, and invalidates sessions.
|
|
2438
|
+
*/
|
|
2484
2439
|
readonly completePasswordReset: alepha_server0.ActionPrimitiveFn<{
|
|
2485
|
-
body:
|
|
2486
|
-
intentId:
|
|
2487
|
-
code:
|
|
2488
|
-
newPassword:
|
|
2440
|
+
body: alepha23.TObject<{
|
|
2441
|
+
intentId: alepha23.TString;
|
|
2442
|
+
code: alepha23.TString;
|
|
2443
|
+
newPassword: alepha23.TString;
|
|
2489
2444
|
}>;
|
|
2490
|
-
response:
|
|
2491
|
-
ok:
|
|
2492
|
-
id:
|
|
2493
|
-
count:
|
|
2445
|
+
response: alepha23.TObject<{
|
|
2446
|
+
ok: alepha23.TBoolean;
|
|
2447
|
+
id: alepha23.TOptional<alepha23.TUnion<[alepha23.TString, alepha23.TInteger]>>;
|
|
2448
|
+
count: alepha23.TOptional<alepha23.TNumber>;
|
|
2494
2449
|
}>;
|
|
2495
2450
|
}>;
|
|
2496
2451
|
/**
|
|
2497
|
-
|
|
2498
|
-
|
|
2452
|
+
* @deprecated Use createPasswordResetIntent instead
|
|
2453
|
+
*/
|
|
2499
2454
|
requestPasswordReset: alepha_server0.ActionPrimitiveFn<{
|
|
2500
|
-
query:
|
|
2501
|
-
userRealmName:
|
|
2455
|
+
query: alepha23.TObject<{
|
|
2456
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
2502
2457
|
}>;
|
|
2503
|
-
body:
|
|
2504
|
-
email:
|
|
2458
|
+
body: alepha23.TObject<{
|
|
2459
|
+
email: alepha23.TString;
|
|
2505
2460
|
}>;
|
|
2506
|
-
response:
|
|
2507
|
-
success:
|
|
2508
|
-
message:
|
|
2461
|
+
response: alepha23.TObject<{
|
|
2462
|
+
success: alepha23.TBoolean;
|
|
2463
|
+
message: alepha23.TString;
|
|
2509
2464
|
}>;
|
|
2510
2465
|
}>;
|
|
2511
2466
|
/**
|
|
2512
|
-
|
|
2513
|
-
|
|
2467
|
+
* @deprecated Use completePasswordReset instead
|
|
2468
|
+
*/
|
|
2514
2469
|
validateResetToken: alepha_server0.ActionPrimitiveFn<{
|
|
2515
|
-
query:
|
|
2516
|
-
email:
|
|
2517
|
-
token:
|
|
2518
|
-
userRealmName:
|
|
2470
|
+
query: alepha23.TObject<{
|
|
2471
|
+
email: alepha23.TString;
|
|
2472
|
+
token: alepha23.TString;
|
|
2473
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
2519
2474
|
}>;
|
|
2520
|
-
response:
|
|
2521
|
-
valid:
|
|
2522
|
-
email:
|
|
2475
|
+
response: alepha23.TObject<{
|
|
2476
|
+
valid: alepha23.TBoolean;
|
|
2477
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
2523
2478
|
}>;
|
|
2524
2479
|
}>;
|
|
2525
2480
|
/**
|
|
2526
|
-
|
|
2527
|
-
|
|
2481
|
+
* @deprecated Use completePasswordReset instead
|
|
2482
|
+
*/
|
|
2528
2483
|
resetPassword: alepha_server0.ActionPrimitiveFn<{
|
|
2529
|
-
query:
|
|
2530
|
-
userRealmName:
|
|
2484
|
+
query: alepha23.TObject<{
|
|
2485
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
2531
2486
|
}>;
|
|
2532
|
-
body:
|
|
2533
|
-
email:
|
|
2534
|
-
token:
|
|
2535
|
-
newPassword:
|
|
2487
|
+
body: alepha23.TObject<{
|
|
2488
|
+
email: alepha23.TString;
|
|
2489
|
+
token: alepha23.TString;
|
|
2490
|
+
newPassword: alepha23.TString;
|
|
2536
2491
|
}>;
|
|
2537
|
-
response:
|
|
2538
|
-
success:
|
|
2539
|
-
message:
|
|
2492
|
+
response: alepha23.TObject<{
|
|
2493
|
+
success: alepha23.TBoolean;
|
|
2494
|
+
message: alepha23.TString;
|
|
2540
2495
|
}>;
|
|
2541
2496
|
}>;
|
|
2542
2497
|
/**
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2498
|
+
* Request email verification.
|
|
2499
|
+
* Generates a verification token using verification service and sends an email to the user.
|
|
2500
|
+
* @param method - The verification method: "code" (default) sends a 6-digit code, "link" sends a clickable verification link.
|
|
2501
|
+
* @param verifyUrl - Required when method is "link". The base URL for the verification link. Token and email will be appended as query params.
|
|
2502
|
+
*/
|
|
2548
2503
|
requestEmailVerification: alepha_server0.ActionPrimitiveFn<{
|
|
2549
|
-
query:
|
|
2550
|
-
userRealmName:
|
|
2551
|
-
method:
|
|
2552
|
-
verifyUrl:
|
|
2504
|
+
query: alepha23.TObject<{
|
|
2505
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
2506
|
+
method: alepha23.TOptional<alepha23.TUnsafe<"link" | "code">>;
|
|
2507
|
+
verifyUrl: alepha23.TOptional<alepha23.TString>;
|
|
2553
2508
|
}>;
|
|
2554
|
-
body:
|
|
2555
|
-
email:
|
|
2509
|
+
body: alepha23.TObject<{
|
|
2510
|
+
email: alepha23.TString;
|
|
2556
2511
|
}>;
|
|
2557
|
-
response:
|
|
2558
|
-
success:
|
|
2559
|
-
message:
|
|
2512
|
+
response: alepha23.TObject<{
|
|
2513
|
+
success: alepha23.TBoolean;
|
|
2514
|
+
message: alepha23.TString;
|
|
2560
2515
|
}>;
|
|
2561
2516
|
}>;
|
|
2562
2517
|
/**
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2518
|
+
* Verify email with a valid token.
|
|
2519
|
+
* Updates the user's emailVerified status.
|
|
2520
|
+
*/
|
|
2566
2521
|
verifyEmail: alepha_server0.ActionPrimitiveFn<{
|
|
2567
|
-
query:
|
|
2568
|
-
userRealmName:
|
|
2522
|
+
query: alepha23.TObject<{
|
|
2523
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
2569
2524
|
}>;
|
|
2570
|
-
body:
|
|
2571
|
-
email:
|
|
2572
|
-
token:
|
|
2525
|
+
body: alepha23.TObject<{
|
|
2526
|
+
email: alepha23.TString;
|
|
2527
|
+
token: alepha23.TString;
|
|
2573
2528
|
}>;
|
|
2574
|
-
response:
|
|
2575
|
-
success:
|
|
2576
|
-
message:
|
|
2529
|
+
response: alepha23.TObject<{
|
|
2530
|
+
success: alepha23.TBoolean;
|
|
2531
|
+
message: alepha23.TString;
|
|
2577
2532
|
}>;
|
|
2578
2533
|
}>;
|
|
2579
2534
|
/**
|
|
2580
|
-
|
|
2581
|
-
|
|
2535
|
+
* Check if an email is verified.
|
|
2536
|
+
*/
|
|
2582
2537
|
checkEmailVerification: alepha_server0.ActionPrimitiveFn<{
|
|
2583
|
-
query:
|
|
2584
|
-
email:
|
|
2585
|
-
userRealmName:
|
|
2586
|
-
}>;
|
|
2587
|
-
response: alepha1.TObject<{
|
|
2588
|
-
verified: alepha1.TBoolean;
|
|
2589
|
-
}>;
|
|
2590
|
-
}>;
|
|
2591
|
-
}
|
|
2592
|
-
//#endregion
|
|
2593
|
-
//#region ../../src/api/users/controllers/UserRealmController.d.ts
|
|
2594
|
-
/**
|
|
2595
|
-
* Controller for exposing realm configuration.
|
|
2596
|
-
* Uses $route instead of $action to keep endpoints hidden from API documentation.
|
|
2597
|
-
*/
|
|
2598
|
-
declare class UserRealmController {
|
|
2599
|
-
protected readonly url = "/realms";
|
|
2600
|
-
protected readonly group = "realms";
|
|
2601
|
-
protected readonly userRealmProvider: UserRealmProvider;
|
|
2602
|
-
protected readonly serverAuthProvider: ServerAuthProvider;
|
|
2603
|
-
/**
|
|
2604
|
-
* Get realm configuration settings.
|
|
2605
|
-
* This endpoint is not exposed in the API documentation.
|
|
2606
|
-
*/
|
|
2607
|
-
readonly getRealmConfig: alepha_server0.ActionPrimitiveFn<{
|
|
2608
|
-
query: alepha1.TObject<{
|
|
2609
|
-
userRealmName: alepha1.TOptional<alepha1.TString>;
|
|
2610
|
-
}>;
|
|
2611
|
-
response: alepha1.TObject<{
|
|
2612
|
-
settings: alepha1.TObject<{
|
|
2613
|
-
displayName: alepha1.TOptional<alepha1.TString>;
|
|
2614
|
-
description: alepha1.TOptional<alepha1.TString>;
|
|
2615
|
-
logoUrl: alepha1.TOptional<alepha1.TString>;
|
|
2616
|
-
registrationAllowed: alepha1.TBoolean;
|
|
2617
|
-
emailEnabled: alepha1.TBoolean;
|
|
2618
|
-
emailRequired: alepha1.TBoolean;
|
|
2619
|
-
usernameEnabled: alepha1.TBoolean;
|
|
2620
|
-
usernameRequired: alepha1.TBoolean;
|
|
2621
|
-
phoneEnabled: alepha1.TBoolean;
|
|
2622
|
-
phoneRequired: alepha1.TBoolean;
|
|
2623
|
-
verifyEmailRequired: alepha1.TBoolean;
|
|
2624
|
-
verifyPhoneRequired: alepha1.TBoolean;
|
|
2625
|
-
firstNameLastNameEnabled: alepha1.TBoolean;
|
|
2626
|
-
firstNameLastNameRequired: alepha1.TBoolean;
|
|
2627
|
-
resetPasswordAllowed: alepha1.TBoolean;
|
|
2628
|
-
passwordPolicy: alepha1.TObject<{
|
|
2629
|
-
minLength: alepha1.TInteger;
|
|
2630
|
-
requireUppercase: alepha1.TBoolean;
|
|
2631
|
-
requireLowercase: alepha1.TBoolean;
|
|
2632
|
-
requireNumbers: alepha1.TBoolean;
|
|
2633
|
-
requireSpecialCharacters: alepha1.TBoolean;
|
|
2634
|
-
}>;
|
|
2635
|
-
}>;
|
|
2636
|
-
realmName: alepha1.TString;
|
|
2637
|
-
authenticationMethods: alepha1.TArray<alepha1.TObject<{
|
|
2638
|
-
name: alepha1.TString;
|
|
2639
|
-
type: alepha1.TUnsafe<"OAUTH2" | "OIDC" | "CREDENTIALS">;
|
|
2640
|
-
}>>;
|
|
2641
|
-
}>;
|
|
2642
|
-
}>;
|
|
2643
|
-
readonly checkUsernameAvailability: alepha_server0.ActionPrimitiveFn<{
|
|
2644
|
-
query: alepha1.TObject<{
|
|
2645
|
-
userRealmName: alepha1.TOptional<alepha1.TString>;
|
|
2646
|
-
}>;
|
|
2647
|
-
body: alepha1.TObject<{
|
|
2648
|
-
username: alepha1.TString;
|
|
2538
|
+
query: alepha23.TObject<{
|
|
2539
|
+
email: alepha23.TString;
|
|
2540
|
+
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
2649
2541
|
}>;
|
|
2650
|
-
response:
|
|
2651
|
-
|
|
2542
|
+
response: alepha23.TObject<{
|
|
2543
|
+
verified: alepha23.TBoolean;
|
|
2652
2544
|
}>;
|
|
2653
2545
|
}>;
|
|
2654
2546
|
}
|
|
2655
2547
|
//#endregion
|
|
2656
2548
|
//#region ../../src/api/users/schemas/identityResourceSchema.d.ts
|
|
2657
|
-
declare const identityResourceSchema:
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
providerUserId:
|
|
2665
|
-
providerData:
|
|
2549
|
+
declare const identityResourceSchema: alepha23.TObject<{
|
|
2550
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
2551
|
+
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
2552
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
2553
|
+
updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
2554
|
+
userId: PgAttr<alepha23.TString, typeof PG_REF>;
|
|
2555
|
+
provider: alepha23.TString;
|
|
2556
|
+
providerUserId: alepha23.TOptional<alepha23.TString>;
|
|
2557
|
+
providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
|
|
2666
2558
|
}>;
|
|
2667
2559
|
type IdentityResource = Static<typeof identityResourceSchema>;
|
|
2668
2560
|
//#endregion
|
|
2669
2561
|
//#region ../../src/api/users/schemas/loginSchema.d.ts
|
|
2670
|
-
declare const loginSchema:
|
|
2671
|
-
username:
|
|
2672
|
-
password:
|
|
2562
|
+
declare const loginSchema: alepha23.TObject<{
|
|
2563
|
+
username: alepha23.TString;
|
|
2564
|
+
password: alepha23.TString;
|
|
2673
2565
|
}>;
|
|
2674
2566
|
type LoginInput = Static<typeof loginSchema>;
|
|
2675
2567
|
//#endregion
|
|
2568
|
+
//#region ../../src/api/users/schemas/realmConfigSchema.d.ts
|
|
2569
|
+
declare const realmConfigSchema: alepha23.TObject<{
|
|
2570
|
+
settings: alepha23.TObject<{
|
|
2571
|
+
displayName: alepha23.TOptional<alepha23.TString>;
|
|
2572
|
+
description: alepha23.TOptional<alepha23.TString>;
|
|
2573
|
+
logoUrl: alepha23.TOptional<alepha23.TString>;
|
|
2574
|
+
registrationAllowed: alepha23.TBoolean;
|
|
2575
|
+
emailEnabled: alepha23.TBoolean;
|
|
2576
|
+
emailRequired: alepha23.TBoolean;
|
|
2577
|
+
usernameEnabled: alepha23.TBoolean;
|
|
2578
|
+
usernameRequired: alepha23.TBoolean;
|
|
2579
|
+
usernameRegExp: alepha23.TString;
|
|
2580
|
+
phoneEnabled: alepha23.TBoolean;
|
|
2581
|
+
phoneRequired: alepha23.TBoolean;
|
|
2582
|
+
verifyEmailRequired: alepha23.TBoolean;
|
|
2583
|
+
verifyPhoneRequired: alepha23.TBoolean;
|
|
2584
|
+
firstNameLastNameEnabled: alepha23.TBoolean;
|
|
2585
|
+
firstNameLastNameRequired: alepha23.TBoolean;
|
|
2586
|
+
resetPasswordAllowed: alepha23.TBoolean;
|
|
2587
|
+
passwordPolicy: alepha23.TObject<{
|
|
2588
|
+
minLength: alepha23.TInteger;
|
|
2589
|
+
requireUppercase: alepha23.TBoolean;
|
|
2590
|
+
requireLowercase: alepha23.TBoolean;
|
|
2591
|
+
requireNumbers: alepha23.TBoolean;
|
|
2592
|
+
requireSpecialCharacters: alepha23.TBoolean;
|
|
2593
|
+
}>;
|
|
2594
|
+
}>;
|
|
2595
|
+
realmName: alepha23.TString;
|
|
2596
|
+
authenticationMethods: alepha23.TArray<alepha23.TObject<{
|
|
2597
|
+
name: alepha23.TString;
|
|
2598
|
+
type: alepha23.TUnsafe<"OAUTH2" | "OIDC" | "CREDENTIALS">;
|
|
2599
|
+
}>>;
|
|
2600
|
+
}>;
|
|
2601
|
+
type RealmConfig = Static<typeof realmConfigSchema>;
|
|
2602
|
+
//#endregion
|
|
2676
2603
|
//#region ../../src/api/users/schemas/registerSchema.d.ts
|
|
2677
|
-
declare const registerSchema:
|
|
2678
|
-
username:
|
|
2679
|
-
email:
|
|
2680
|
-
password:
|
|
2681
|
-
confirmPassword:
|
|
2682
|
-
firstName:
|
|
2683
|
-
lastName:
|
|
2604
|
+
declare const registerSchema: alepha23.TObject<{
|
|
2605
|
+
username: alepha23.TString;
|
|
2606
|
+
email: alepha23.TString;
|
|
2607
|
+
password: alepha23.TString;
|
|
2608
|
+
confirmPassword: alepha23.TString;
|
|
2609
|
+
firstName: alepha23.TOptional<alepha23.TString>;
|
|
2610
|
+
lastName: alepha23.TOptional<alepha23.TString>;
|
|
2684
2611
|
}>;
|
|
2685
2612
|
type RegisterInput = Static<typeof registerSchema>;
|
|
2686
2613
|
//#endregion
|
|
2687
2614
|
//#region ../../src/api/users/schemas/resetPasswordSchema.d.ts
|
|
2688
|
-
declare const resetPasswordRequestSchema:
|
|
2689
|
-
email:
|
|
2615
|
+
declare const resetPasswordRequestSchema: alepha23.TObject<{
|
|
2616
|
+
email: alepha23.TString;
|
|
2690
2617
|
}>;
|
|
2691
|
-
declare const resetPasswordSchema:
|
|
2692
|
-
token:
|
|
2693
|
-
password:
|
|
2694
|
-
confirmPassword:
|
|
2618
|
+
declare const resetPasswordSchema: alepha23.TObject<{
|
|
2619
|
+
token: alepha23.TString;
|
|
2620
|
+
password: alepha23.TString;
|
|
2621
|
+
confirmPassword: alepha23.TString;
|
|
2695
2622
|
}>;
|
|
2696
2623
|
type ResetPasswordRequest = Static<typeof resetPasswordRequestSchema>;
|
|
2697
2624
|
type ResetPasswordInput = Static<typeof resetPasswordSchema>;
|
|
2698
2625
|
//#endregion
|
|
2699
2626
|
//#region ../../src/api/users/schemas/sessionResourceSchema.d.ts
|
|
2700
|
-
declare const sessionResourceSchema:
|
|
2701
|
-
id:
|
|
2702
|
-
version:
|
|
2703
|
-
createdAt:
|
|
2704
|
-
updatedAt:
|
|
2705
|
-
refreshToken:
|
|
2706
|
-
userId:
|
|
2707
|
-
expiresAt:
|
|
2708
|
-
ip:
|
|
2709
|
-
userAgent:
|
|
2710
|
-
os:
|
|
2711
|
-
browser:
|
|
2712
|
-
device:
|
|
2627
|
+
declare const sessionResourceSchema: alepha23.TObject<{
|
|
2628
|
+
id: alepha23.TString;
|
|
2629
|
+
version: alepha23.TNumber;
|
|
2630
|
+
createdAt: alepha23.TString;
|
|
2631
|
+
updatedAt: alepha23.TString;
|
|
2632
|
+
refreshToken: alepha23.TString;
|
|
2633
|
+
userId: alepha23.TString;
|
|
2634
|
+
expiresAt: alepha23.TString;
|
|
2635
|
+
ip: alepha23.TOptional<alepha23.TString>;
|
|
2636
|
+
userAgent: alepha23.TOptional<alepha23.TObject<{
|
|
2637
|
+
os: alepha23.TString;
|
|
2638
|
+
browser: alepha23.TString;
|
|
2639
|
+
device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
|
|
2713
2640
|
}>>;
|
|
2714
2641
|
}>;
|
|
2715
2642
|
type SessionResource = Static<typeof sessionResourceSchema>;
|
|
2716
2643
|
//#endregion
|
|
2717
|
-
//#region ../../src/api/users/schemas/userRealmConfigSchema.d.ts
|
|
2718
|
-
declare const userRealmConfigSchema: alepha1.TObject<{
|
|
2719
|
-
settings: alepha1.TObject<{
|
|
2720
|
-
displayName: alepha1.TOptional<alepha1.TString>;
|
|
2721
|
-
description: alepha1.TOptional<alepha1.TString>;
|
|
2722
|
-
logoUrl: alepha1.TOptional<alepha1.TString>;
|
|
2723
|
-
registrationAllowed: alepha1.TBoolean;
|
|
2724
|
-
emailEnabled: alepha1.TBoolean;
|
|
2725
|
-
emailRequired: alepha1.TBoolean;
|
|
2726
|
-
usernameEnabled: alepha1.TBoolean;
|
|
2727
|
-
usernameRequired: alepha1.TBoolean;
|
|
2728
|
-
phoneEnabled: alepha1.TBoolean;
|
|
2729
|
-
phoneRequired: alepha1.TBoolean;
|
|
2730
|
-
verifyEmailRequired: alepha1.TBoolean;
|
|
2731
|
-
verifyPhoneRequired: alepha1.TBoolean;
|
|
2732
|
-
firstNameLastNameEnabled: alepha1.TBoolean;
|
|
2733
|
-
firstNameLastNameRequired: alepha1.TBoolean;
|
|
2734
|
-
resetPasswordAllowed: alepha1.TBoolean;
|
|
2735
|
-
passwordPolicy: alepha1.TObject<{
|
|
2736
|
-
minLength: alepha1.TInteger;
|
|
2737
|
-
requireUppercase: alepha1.TBoolean;
|
|
2738
|
-
requireLowercase: alepha1.TBoolean;
|
|
2739
|
-
requireNumbers: alepha1.TBoolean;
|
|
2740
|
-
requireSpecialCharacters: alepha1.TBoolean;
|
|
2741
|
-
}>;
|
|
2742
|
-
}>;
|
|
2743
|
-
realmName: alepha1.TString;
|
|
2744
|
-
authenticationMethods: alepha1.TArray<alepha1.TObject<{
|
|
2745
|
-
name: alepha1.TString;
|
|
2746
|
-
type: alepha1.TUnsafe<"OAUTH2" | "OIDC" | "CREDENTIALS">;
|
|
2747
|
-
}>>;
|
|
2748
|
-
}>;
|
|
2749
|
-
type UserRealmConfig = Static<typeof userRealmConfigSchema>;
|
|
2750
|
-
//#endregion
|
|
2751
2644
|
//#region ../../src/api/users/schemas/userResourceSchema.d.ts
|
|
2752
|
-
declare const userResourceSchema:
|
|
2753
|
-
id: PgAttr<PgAttr<
|
|
2754
|
-
version: PgAttr<PgAttr<
|
|
2755
|
-
createdAt: PgAttr<PgAttr<
|
|
2756
|
-
updatedAt: PgAttr<PgAttr<
|
|
2757
|
-
realm: PgAttr<
|
|
2758
|
-
username:
|
|
2759
|
-
email:
|
|
2760
|
-
phoneNumber:
|
|
2761
|
-
roles: PgAttr<
|
|
2762
|
-
firstName:
|
|
2763
|
-
lastName:
|
|
2764
|
-
picture:
|
|
2765
|
-
enabled: PgAttr<
|
|
2766
|
-
emailVerified: PgAttr<
|
|
2645
|
+
declare const userResourceSchema: alepha23.TObject<{
|
|
2646
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
2647
|
+
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
2648
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
2649
|
+
updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
2650
|
+
realm: PgAttr<alepha23.TString, typeof PG_DEFAULT>;
|
|
2651
|
+
username: alepha23.TOptional<alepha23.TString>;
|
|
2652
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
2653
|
+
phoneNumber: alepha23.TOptional<alepha23.TString>;
|
|
2654
|
+
roles: PgAttr<alepha23.TArray<alepha23.TString>, typeof PG_DEFAULT>;
|
|
2655
|
+
firstName: alepha23.TOptional<alepha23.TString>;
|
|
2656
|
+
lastName: alepha23.TOptional<alepha23.TString>;
|
|
2657
|
+
picture: alepha23.TOptional<alepha23.TString>;
|
|
2658
|
+
enabled: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2659
|
+
emailVerified: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2767
2660
|
}>;
|
|
2768
2661
|
type UserResource = Static<typeof userResourceSchema>;
|
|
2769
2662
|
//#endregion
|
|
@@ -2774,95 +2667,95 @@ declare class SessionService {
|
|
|
2774
2667
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
2775
2668
|
protected readonly cryptoProvider: CryptoProvider;
|
|
2776
2669
|
protected readonly log: alepha_logger5.Logger;
|
|
2777
|
-
protected readonly
|
|
2778
|
-
protected readonly fileController:
|
|
2670
|
+
protected readonly realmProvider: RealmProvider;
|
|
2671
|
+
protected readonly fileController: alepha_server_links0.HttpVirtualClient<FileController>;
|
|
2779
2672
|
protected readonly auditService: AuditService;
|
|
2780
|
-
users(userRealmName?: string): Repository$1<
|
|
2781
|
-
id: PgAttr<PgAttr<
|
|
2782
|
-
version: PgAttr<PgAttr<
|
|
2783
|
-
createdAt: PgAttr<PgAttr<
|
|
2784
|
-
updatedAt: PgAttr<PgAttr<
|
|
2785
|
-
realm: PgAttr<
|
|
2786
|
-
username:
|
|
2787
|
-
email:
|
|
2788
|
-
phoneNumber:
|
|
2789
|
-
roles: PgAttr<
|
|
2790
|
-
firstName:
|
|
2791
|
-
lastName:
|
|
2792
|
-
picture:
|
|
2793
|
-
enabled: PgAttr<
|
|
2794
|
-
emailVerified: PgAttr<
|
|
2673
|
+
users(userRealmName?: string): Repository$1<alepha23.TObject<{
|
|
2674
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
2675
|
+
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
2676
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
2677
|
+
updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
2678
|
+
realm: PgAttr<alepha23.TString, typeof PG_DEFAULT>;
|
|
2679
|
+
username: alepha23.TOptional<alepha23.TString>;
|
|
2680
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
2681
|
+
phoneNumber: alepha23.TOptional<alepha23.TString>;
|
|
2682
|
+
roles: PgAttr<alepha23.TArray<alepha23.TString>, typeof PG_DEFAULT>;
|
|
2683
|
+
firstName: alepha23.TOptional<alepha23.TString>;
|
|
2684
|
+
lastName: alepha23.TOptional<alepha23.TString>;
|
|
2685
|
+
picture: alepha23.TOptional<alepha23.TString>;
|
|
2686
|
+
enabled: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2687
|
+
emailVerified: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2795
2688
|
}>>;
|
|
2796
|
-
sessions(userRealmName?: string): Repository$1<
|
|
2797
|
-
id: PgAttr<PgAttr<
|
|
2798
|
-
version: PgAttr<PgAttr<
|
|
2799
|
-
createdAt: PgAttr<PgAttr<
|
|
2800
|
-
updatedAt: PgAttr<PgAttr<
|
|
2801
|
-
refreshToken:
|
|
2802
|
-
userId: PgAttr<
|
|
2803
|
-
expiresAt:
|
|
2804
|
-
ip:
|
|
2805
|
-
userAgent:
|
|
2806
|
-
os:
|
|
2807
|
-
browser:
|
|
2808
|
-
device:
|
|
2689
|
+
sessions(userRealmName?: string): Repository$1<alepha23.TObject<{
|
|
2690
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
2691
|
+
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
2692
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
2693
|
+
updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
2694
|
+
refreshToken: alepha23.TString;
|
|
2695
|
+
userId: PgAttr<alepha23.TString, typeof PG_REF>;
|
|
2696
|
+
expiresAt: alepha23.TString;
|
|
2697
|
+
ip: alepha23.TOptional<alepha23.TString>;
|
|
2698
|
+
userAgent: alepha23.TOptional<alepha23.TObject<{
|
|
2699
|
+
os: alepha23.TString;
|
|
2700
|
+
browser: alepha23.TString;
|
|
2701
|
+
device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
|
|
2809
2702
|
}>>;
|
|
2810
2703
|
}>>;
|
|
2811
|
-
identities(userRealmName?: string): Repository$1<
|
|
2812
|
-
id: PgAttr<PgAttr<
|
|
2813
|
-
version: PgAttr<PgAttr<
|
|
2814
|
-
createdAt: PgAttr<PgAttr<
|
|
2815
|
-
updatedAt: PgAttr<PgAttr<
|
|
2816
|
-
userId: PgAttr<
|
|
2817
|
-
password:
|
|
2818
|
-
provider:
|
|
2819
|
-
providerUserId:
|
|
2820
|
-
providerData:
|
|
2704
|
+
identities(userRealmName?: string): Repository$1<alepha23.TObject<{
|
|
2705
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
2706
|
+
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
2707
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
2708
|
+
updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
2709
|
+
userId: PgAttr<alepha23.TString, typeof PG_REF>;
|
|
2710
|
+
password: alepha23.TOptional<alepha23.TString>;
|
|
2711
|
+
provider: alepha23.TString;
|
|
2712
|
+
providerUserId: alepha23.TOptional<alepha23.TString>;
|
|
2713
|
+
providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
|
|
2821
2714
|
}>>;
|
|
2822
2715
|
/**
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2716
|
+
* Random delay to prevent timing attacks (50-200ms)
|
|
2717
|
+
* Uses cryptographically secure random number generation
|
|
2718
|
+
*/
|
|
2826
2719
|
protected randomDelay(): Promise<void>;
|
|
2827
2720
|
/**
|
|
2828
|
-
|
|
2829
|
-
|
|
2721
|
+
* Validate user credentials and return the user if valid.
|
|
2722
|
+
*/
|
|
2830
2723
|
login(provider: string, username: string, password: string, userRealmName?: string): Promise<UserEntity>;
|
|
2831
2724
|
createSession(user: UserAccount, expiresIn: number, userRealmName?: string): Promise<{
|
|
2832
2725
|
refreshToken: string;
|
|
2833
2726
|
sessionId: string;
|
|
2834
2727
|
}>;
|
|
2835
2728
|
refreshSession(refreshToken: string, userRealmName?: string): Promise<{
|
|
2836
|
-
user: PgStatic<
|
|
2837
|
-
id: PgAttr<PgAttr<
|
|
2838
|
-
version: PgAttr<PgAttr<
|
|
2839
|
-
createdAt: PgAttr<PgAttr<
|
|
2840
|
-
updatedAt: PgAttr<PgAttr<
|
|
2841
|
-
realm: PgAttr<
|
|
2842
|
-
username:
|
|
2843
|
-
email:
|
|
2844
|
-
phoneNumber:
|
|
2845
|
-
roles: PgAttr<
|
|
2846
|
-
firstName:
|
|
2847
|
-
lastName:
|
|
2848
|
-
picture:
|
|
2849
|
-
enabled: PgAttr<
|
|
2850
|
-
emailVerified: PgAttr<
|
|
2851
|
-
}>, PgRelationMap<
|
|
2852
|
-
id: PgAttr<PgAttr<
|
|
2853
|
-
version: PgAttr<PgAttr<
|
|
2854
|
-
createdAt: PgAttr<PgAttr<
|
|
2855
|
-
updatedAt: PgAttr<PgAttr<
|
|
2856
|
-
realm: PgAttr<
|
|
2857
|
-
username:
|
|
2858
|
-
email:
|
|
2859
|
-
phoneNumber:
|
|
2860
|
-
roles: PgAttr<
|
|
2861
|
-
firstName:
|
|
2862
|
-
lastName:
|
|
2863
|
-
picture:
|
|
2864
|
-
enabled: PgAttr<
|
|
2865
|
-
emailVerified: PgAttr<
|
|
2729
|
+
user: PgStatic<alepha23.TObject<{
|
|
2730
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
2731
|
+
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
2732
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
2733
|
+
updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
2734
|
+
realm: PgAttr<alepha23.TString, typeof PG_DEFAULT>;
|
|
2735
|
+
username: alepha23.TOptional<alepha23.TString>;
|
|
2736
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
2737
|
+
phoneNumber: alepha23.TOptional<alepha23.TString>;
|
|
2738
|
+
roles: PgAttr<alepha23.TArray<alepha23.TString>, typeof PG_DEFAULT>;
|
|
2739
|
+
firstName: alepha23.TOptional<alepha23.TString>;
|
|
2740
|
+
lastName: alepha23.TOptional<alepha23.TString>;
|
|
2741
|
+
picture: alepha23.TOptional<alepha23.TString>;
|
|
2742
|
+
enabled: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2743
|
+
emailVerified: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2744
|
+
}>, PgRelationMap<alepha23.TObject<{
|
|
2745
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
2746
|
+
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
2747
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
2748
|
+
updatedAt: PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
2749
|
+
realm: PgAttr<alepha23.TString, typeof PG_DEFAULT>;
|
|
2750
|
+
username: alepha23.TOptional<alepha23.TString>;
|
|
2751
|
+
email: alepha23.TOptional<alepha23.TString>;
|
|
2752
|
+
phoneNumber: alepha23.TOptional<alepha23.TString>;
|
|
2753
|
+
roles: PgAttr<alepha23.TArray<alepha23.TString>, typeof PG_DEFAULT>;
|
|
2754
|
+
firstName: alepha23.TOptional<alepha23.TString>;
|
|
2755
|
+
lastName: alepha23.TOptional<alepha23.TString>;
|
|
2756
|
+
picture: alepha23.TOptional<alepha23.TString>;
|
|
2757
|
+
enabled: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2758
|
+
emailVerified: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
2866
2759
|
}>>>;
|
|
2867
2760
|
expiresIn: number;
|
|
2868
2761
|
sessionId: string;
|
|
@@ -2924,7 +2817,7 @@ declare class SessionService {
|
|
|
2924
2817
|
*
|
|
2925
2818
|
* @module alepha.api.users
|
|
2926
2819
|
*/
|
|
2927
|
-
declare const AlephaApiUsers:
|
|
2820
|
+
declare const AlephaApiUsers: alepha23.Service<alepha23.Module>;
|
|
2928
2821
|
//#endregion
|
|
2929
|
-
export { $
|
|
2822
|
+
export { $realm, AdminIdentityController, AdminSessionController, AdminUserController, AlephaApiUsers, CompletePasswordResetRequest, CompleteRegistrationRequest, CreateUser, CredentialService, DEFAULT_USER_REALM_NAME, IdentityEntity, IdentityQuery, IdentityResource, IdentityService, LoginInput, PasswordResetIntentResponse, Realm, RealmAuthSettings, RealmConfig, RealmController, RealmOptions, RealmPrimitive, RealmProvider, RealmRepositories, RegisterInput, RegistrationIntentResponse, RegistrationService, ResetPasswordInput, ResetPasswordRequest, SessionCrudService, SessionEntity, SessionQuery, SessionResource, SessionService, UpdateUser, UserController, UserEntity, UserQuery, UserResource, UserService, completePasswordResetRequestSchema, completeRegistrationRequestSchema, createUserSchema, identities, identityQuerySchema, identityResourceSchema, loginSchema, passwordResetIntentResponseSchema, realmAuthSettingsAtom, realmConfigSchema, registerSchema, registrationIntentResponseSchema, resetPasswordRequestSchema, resetPasswordSchema, sessionQuerySchema, sessionResourceSchema, sessions, updateUserSchema, userQuerySchema, userResourceSchema, users };
|
|
2930
2823
|
//# sourceMappingURL=index.d.ts.map
|