alepha 0.15.3 → 0.15.5
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 +26 -11
- package/dist/api/audits/index.d.ts +335 -335
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/audits/index.js +11 -3
- package/dist/api/audits/index.js.map +1 -1
- package/dist/api/files/index.d.ts +3 -3
- package/dist/api/files/index.js +4 -3
- package/dist/api/files/index.js.map +1 -1
- package/dist/api/jobs/index.d.ts +198 -155
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/jobs/index.js +103 -5
- package/dist/api/jobs/index.js.map +1 -1
- package/dist/api/keys/index.d.ts +198 -198
- package/dist/api/keys/index.d.ts.map +1 -1
- package/dist/api/keys/index.js +3 -3
- package/dist/api/keys/index.js.map +1 -1
- package/dist/api/notifications/index.browser.js +1 -0
- package/dist/api/notifications/index.browser.js.map +1 -1
- package/dist/api/notifications/index.d.ts +3 -3
- package/dist/api/notifications/index.js +4 -3
- package/dist/api/notifications/index.js.map +1 -1
- package/dist/api/parameters/index.d.ts +263 -263
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/parameters/index.js +41 -30
- package/dist/api/parameters/index.js.map +1 -1
- package/dist/api/users/index.d.ts +383 -77
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +284 -72
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/verifications/index.d.ts +131 -131
- package/dist/api/verifications/index.d.ts.map +1 -1
- package/dist/api/verifications/index.js +3 -3
- package/dist/api/verifications/index.js.map +1 -1
- package/dist/batch/index.d.ts +3 -3
- package/dist/batch/index.js +3 -3
- package/dist/batch/index.js.map +1 -1
- package/dist/bucket/index.d.ts +3 -3
- package/dist/bucket/index.js +6 -6
- package/dist/bucket/index.js.map +1 -1
- package/dist/cache/core/index.d.ts +3 -3
- package/dist/cache/core/index.js +3 -3
- package/dist/cache/core/index.js.map +1 -1
- package/dist/cli/index.d.ts +5612 -20
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +122 -91
- package/dist/cli/index.js.map +1 -1
- package/dist/command/index.d.ts +11 -4
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +8 -6
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +4 -8
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +3 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js.map +1 -1
- package/dist/datetime/index.d.ts +3 -3
- package/dist/datetime/index.js +3 -3
- package/dist/datetime/index.js.map +1 -1
- package/dist/email/index.d.ts +16 -16
- package/dist/email/index.d.ts.map +1 -1
- package/dist/email/index.js +10562 -10
- package/dist/email/index.js.map +1 -1
- package/dist/fake/index.d.ts +3 -3
- package/dist/fake/index.js +3 -3
- package/dist/fake/index.js.map +1 -1
- package/dist/lock/core/index.d.ts +9 -4
- package/dist/lock/core/index.d.ts.map +1 -1
- package/dist/lock/core/index.js +12 -4
- package/dist/lock/core/index.js.map +1 -1
- package/dist/logger/index.d.ts +3 -3
- package/dist/logger/index.js +6 -3
- package/dist/logger/index.js.map +1 -1
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +3 -3
- package/dist/mcp/index.js.map +1 -1
- package/dist/orm/index.d.ts +12 -12
- package/dist/orm/index.js +4 -4
- package/dist/orm/index.js.map +1 -1
- package/dist/queue/core/index.d.ts +3 -3
- package/dist/queue/core/index.js +3 -3
- package/dist/queue/core/index.js.map +1 -1
- package/dist/react/auth/index.browser.js +2 -1
- package/dist/react/auth/index.browser.js.map +1 -1
- package/dist/react/auth/index.d.ts +3 -3
- package/dist/react/auth/index.js +5 -4
- package/dist/react/auth/index.js.map +1 -1
- package/dist/react/core/index.d.ts +6 -6
- package/dist/react/core/index.js +3 -3
- package/dist/react/core/index.js.map +1 -1
- package/dist/react/form/index.d.ts +3 -3
- package/dist/react/form/index.js +3 -3
- package/dist/react/form/index.js.map +1 -1
- package/dist/react/head/index.d.ts +3 -3
- package/dist/react/head/index.js +3 -3
- package/dist/react/head/index.js.map +1 -1
- package/dist/react/i18n/index.d.ts +3 -3
- package/dist/react/i18n/index.js +3 -3
- package/dist/react/i18n/index.js.map +1 -1
- package/dist/react/intro/index.css +337 -0
- package/dist/react/intro/index.css.map +1 -0
- package/dist/react/intro/index.d.ts +10 -0
- package/dist/react/intro/index.d.ts.map +1 -0
- package/dist/react/intro/index.js +222 -0
- package/dist/react/intro/index.js.map +1 -0
- package/dist/react/router/index.browser.js +2 -2
- package/dist/react/router/index.browser.js.map +1 -1
- package/dist/react/router/index.d.ts +11 -1
- package/dist/react/router/index.d.ts.map +1 -1
- package/dist/react/router/index.js +21 -11
- package/dist/react/router/index.js.map +1 -1
- package/dist/redis/index.d.ts +22 -22
- package/dist/redis/index.js +3 -3
- package/dist/redis/index.js.map +1 -1
- package/dist/retry/index.d.ts +3 -3
- package/dist/retry/index.js +3 -3
- package/dist/retry/index.js.map +1 -1
- package/dist/scheduler/index.d.ts +16 -4
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +45 -7
- package/dist/scheduler/index.js.map +1 -1
- package/dist/security/index.d.ts +3 -3
- package/dist/security/index.js +5 -5
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.d.ts +3 -3
- package/dist/server/auth/index.js +3 -3
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cache/index.d.ts +3 -3
- package/dist/server/cache/index.js +3 -3
- 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/compress/index.js +4 -3
- package/dist/server/compress/index.js.map +1 -1
- package/dist/server/cookies/index.d.ts +3 -3
- package/dist/server/cookies/index.js +3 -3
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/server/core/index.d.ts +14 -25
- package/dist/server/core/index.d.ts.map +1 -1
- package/dist/server/core/index.js +13 -29
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/cors/index.d.ts +3 -3
- package/dist/server/cors/index.js +3 -3
- package/dist/server/cors/index.js.map +1 -1
- package/dist/server/health/index.d.ts +20 -20
- package/dist/server/health/index.js +3 -3
- package/dist/server/health/index.js.map +1 -1
- package/dist/server/helmet/index.d.ts +3 -3
- package/dist/server/helmet/index.js +3 -3
- package/dist/server/helmet/index.js.map +1 -1
- package/dist/server/links/index.d.ts +42 -42
- package/dist/server/links/index.d.ts.map +1 -1
- package/dist/server/links/index.js +4 -4
- package/dist/server/links/index.js.map +1 -1
- package/dist/server/metrics/index.d.ts +3 -3
- package/dist/server/metrics/index.js +3 -3
- package/dist/server/metrics/index.js.map +1 -1
- package/dist/server/multipart/index.d.ts +3 -3
- package/dist/server/multipart/index.js +3 -3
- package/dist/server/multipart/index.js.map +1 -1
- package/dist/server/proxy/index.d.ts +3 -3
- package/dist/server/proxy/index.js +3 -3
- package/dist/server/proxy/index.js.map +1 -1
- package/dist/server/rate-limit/index.d.ts +3 -3
- package/dist/server/rate-limit/index.js +3 -3
- package/dist/server/rate-limit/index.js.map +1 -1
- package/dist/server/static/index.d.ts +3 -3
- package/dist/server/static/index.js +6 -6
- package/dist/server/static/index.js.map +1 -1
- package/dist/server/swagger/index.d.ts +3 -3
- package/dist/server/swagger/index.js +6 -6
- package/dist/server/swagger/index.js.map +1 -1
- package/dist/sms/index.d.ts +3 -3
- package/dist/sms/index.js +6 -6
- package/dist/sms/index.js.map +1 -1
- package/dist/system/index.d.ts +3 -3
- package/dist/system/index.js +3 -3
- package/dist/system/index.js.map +1 -1
- package/dist/thread/index.d.ts +3 -3
- package/dist/thread/index.js +3 -3
- package/dist/thread/index.js.map +1 -1
- package/dist/topic/core/index.d.ts +3 -3
- package/dist/topic/core/index.js +3 -3
- package/dist/topic/core/index.js.map +1 -1
- package/dist/vite/index.d.ts +6286 -4
- package/dist/vite/index.d.ts.map +1 -1
- package/dist/vite/index.js +28 -2
- package/dist/vite/index.js.map +1 -1
- package/dist/websocket/index.d.ts +37 -37
- package/dist/websocket/index.d.ts.map +1 -1
- package/dist/websocket/index.js +3 -3
- package/dist/websocket/index.js.map +1 -1
- package/package.json +12 -4
- package/src/api/audits/controllers/AdminAuditController.ts +8 -0
- package/src/api/audits/index.ts +3 -3
- package/src/api/files/controllers/AdminFileStatsController.ts +1 -0
- package/src/api/files/index.ts +3 -3
- package/src/api/jobs/controllers/AdminJobController.ts +18 -2
- package/src/api/jobs/index.ts +4 -3
- package/src/api/jobs/services/JobAudits.spec.ts +89 -0
- package/src/api/jobs/services/JobAudits.ts +101 -0
- package/src/api/keys/index.ts +3 -3
- package/src/api/notifications/controllers/AdminNotificationController.ts +1 -0
- package/src/api/notifications/index.ts +3 -3
- package/src/api/parameters/controllers/AdminConfigController.ts +10 -0
- package/src/api/parameters/index.ts +5 -3
- package/src/api/users/__tests__/ApiKeys-integration.spec.ts +1 -1
- package/src/api/users/__tests__/ApiKeys.spec.ts +1 -1
- package/src/api/users/__tests__/EmailVerification.spec.ts +16 -1
- package/src/api/users/__tests__/PasswordReset.spec.ts +11 -0
- package/src/api/users/atoms/realmAuthSettingsAtom.ts +10 -0
- package/src/api/users/controllers/AdminIdentityController.ts +3 -0
- package/src/api/users/controllers/AdminSessionController.ts +3 -0
- package/src/api/users/controllers/AdminUserController.ts +5 -0
- package/src/api/users/index.ts +8 -9
- package/src/api/users/primitives/$realm.ts +117 -19
- package/src/api/users/providers/RealmProvider.ts +15 -7
- package/src/api/users/services/CredentialService.spec.ts +11 -0
- package/src/api/users/services/CredentialService.ts +47 -24
- package/src/api/users/services/IdentityService.ts +12 -4
- package/src/api/users/services/RegistrationService.spec.ts +11 -0
- package/src/api/users/services/RegistrationService.ts +33 -12
- package/src/api/users/services/SessionService.ts +83 -12
- package/src/api/users/services/UserAudits.ts +47 -0
- package/src/api/users/services/UserFiles.ts +19 -0
- package/src/api/users/services/UserJobs.spec.ts +107 -0
- package/src/api/users/services/UserJobs.ts +62 -0
- package/src/api/users/services/UserParameters.ts +23 -0
- package/src/api/users/services/UserService.ts +34 -17
- package/src/api/verifications/index.ts +3 -3
- package/src/batch/index.ts +3 -3
- package/src/bucket/index.ts +3 -3
- package/src/cache/core/index.ts +3 -3
- package/src/cli/commands/build.ts +1 -0
- package/src/cli/commands/db.ts +9 -0
- package/src/cli/commands/init.spec.ts +2 -17
- package/src/cli/commands/init.ts +37 -1
- package/src/cli/providers/ViteDevServerProvider.ts +36 -2
- package/src/cli/services/AlephaCliUtils.ts +17 -0
- package/src/cli/services/PackageManagerUtils.ts +15 -1
- package/src/cli/services/ProjectScaffolder.ts +8 -13
- package/src/cli/templates/agentMd.ts +2 -25
- package/src/cli/templates/apiAppSecurityTs.ts +37 -2
- package/src/cli/templates/mainCss.ts +2 -32
- package/src/cli/templates/webAppRouterTs.ts +5 -5
- package/src/cli/templates/webHomeComponentTsx.ts +10 -0
- package/src/command/helpers/Runner.ts +14 -1
- package/src/command/index.ts +3 -3
- package/src/core/helpers/primitive.ts +0 -5
- package/src/core/index.ts +3 -3
- package/src/datetime/index.ts +3 -3
- package/src/email/index.ts +3 -3
- package/src/email/index.workerd.ts +36 -0
- package/src/email/providers/LocalEmailProvider.ts +2 -2
- package/src/email/providers/WorkermailerEmailProvider.ts +221 -0
- package/src/fake/index.ts +3 -3
- package/src/lock/core/index.ts +3 -3
- package/src/lock/core/primitives/$lock.ts +13 -1
- package/src/logger/index.ts +3 -3
- package/src/logger/providers/PrettyFormatterProvider.ts +7 -0
- package/src/mcp/index.ts +3 -3
- package/src/orm/index.ts +3 -3
- package/src/orm/providers/drivers/NodeSqliteProvider.ts +1 -1
- package/src/queue/core/index.ts +3 -3
- package/src/react/auth/index.ts +3 -3
- package/src/react/auth/services/ReactAuth.ts +3 -1
- package/src/react/core/index.ts +3 -3
- package/src/react/form/index.ts +3 -3
- package/src/react/head/index.ts +3 -3
- package/src/react/i18n/index.ts +3 -3
- package/src/react/intro/components/GettingStarted.css +334 -0
- package/src/react/intro/components/GettingStarted.tsx +276 -0
- package/src/react/intro/index.ts +1 -0
- package/src/react/router/atoms/ssrManifestAtom.ts +7 -0
- package/src/react/router/index.browser.ts +2 -0
- package/src/react/router/index.ts +2 -0
- package/src/react/router/providers/ReactServerProvider.ts +14 -4
- package/src/react/router/providers/SSRManifestProvider.ts +7 -0
- package/src/redis/index.ts +3 -3
- package/src/retry/index.ts +3 -3
- package/src/router/index.ts +3 -3
- package/src/scheduler/index.ts +3 -3
- package/src/scheduler/index.workerd.ts +43 -0
- package/src/scheduler/providers/CronProvider.ts +53 -6
- package/src/scheduler/providers/WorkerdCronProvider.ts +102 -0
- package/src/security/index.ts +3 -3
- package/src/security/providers/JwtProvider.ts +2 -2
- package/src/server/auth/index.ts +3 -3
- package/src/server/cache/index.ts +3 -3
- package/src/server/compress/index.ts +3 -3
- package/src/server/compress/providers/ServerCompressProvider.ts +6 -0
- package/src/server/cookies/index.ts +3 -3
- package/src/server/core/index.ts +3 -3
- package/src/server/core/primitives/$action.spec.ts +3 -2
- package/src/server/core/primitives/$action.ts +6 -2
- package/src/server/core/providers/NodeHttpServerProvider.ts +2 -15
- package/src/server/core/providers/ServerProvider.ts +4 -2
- package/src/server/core/providers/ServerRouterProvider.ts +5 -27
- package/src/server/cors/index.ts +3 -3
- package/src/server/health/index.ts +3 -3
- package/src/server/helmet/index.ts +3 -3
- package/src/server/links/index.ts +3 -3
- package/src/server/links/providers/ServerLinksProvider.spec.ts +332 -0
- package/src/server/links/providers/ServerLinksProvider.ts +1 -1
- package/src/server/metrics/index.ts +3 -3
- package/src/server/multipart/index.ts +3 -3
- package/src/server/proxy/index.ts +3 -3
- package/src/server/rate-limit/index.ts +3 -3
- package/src/server/static/index.ts +3 -3
- package/src/server/swagger/index.ts +3 -3
- package/src/sms/index.ts +3 -3
- package/src/system/index.ts +3 -3
- package/src/thread/index.ts +3 -3
- package/src/topic/core/index.ts +3 -3
- package/src/vite/tasks/generateCloudflare.ts +38 -2
- package/src/websocket/index.ts +3 -3
- package/src/cli/templates/webHelloComponentTsx.ts +0 -30
- /package/src/api/users/{notifications → services}/UserNotifications.ts +0 -0
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import * as alepha23 from "alepha";
|
|
2
2
|
import { Alepha, AlephaError, FileLike, Json, Page, PageQuery, Primitive, Static, StaticEncode, StreamLike, TNull, TObject, TOptional, TSchema, TUnion } from "alepha";
|
|
3
|
-
import * as alepha_api_notifications0 from "alepha/api/notifications";
|
|
4
|
-
import { VerificationController } from "alepha/api/verifications";
|
|
5
3
|
import * as alepha_server0 from "alepha/server";
|
|
6
4
|
import * as alepha_orm24 from "alepha/orm";
|
|
7
5
|
import { Page as Page$1, Repository } from "alepha/orm";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import * as alepha_bucket0 from "alepha/bucket";
|
|
6
|
+
import * as alepha_logger6 from "alepha/logger";
|
|
7
|
+
import { AuditService, CreateAudit } from "alepha/api/audits";
|
|
11
8
|
import * as alepha_server_links0 from "alepha/server/links";
|
|
9
|
+
import * as alepha_api_notifications0 from "alepha/api/notifications";
|
|
12
10
|
import { OAuth2Profile, ServerAuthProvider, WithLinkFn, WithLoginFn } from "alepha/server/auth";
|
|
13
11
|
import * as alepha_cache0 from "alepha/cache";
|
|
14
12
|
import { DateTime, DateTimeProvider } from "alepha/datetime";
|
|
15
13
|
import { CryptoProvider, IssuerPrimitive, IssuerPrimitiveOptions, UserAccount } from "alepha/security";
|
|
16
14
|
import { Readable } from "node:stream";
|
|
17
|
-
import {
|
|
15
|
+
import { VerificationController } from "alepha/api/verifications";
|
|
16
|
+
import * as alepha_bucket0 from "alepha/bucket";
|
|
17
|
+
import * as alepha_api_jobs0 from "alepha/api/jobs";
|
|
18
|
+
import * as alepha_api_parameters0 from "alepha/api/parameters";
|
|
18
19
|
import "drizzle-orm/d1";
|
|
19
20
|
import * as drizzle_orm0 from "drizzle-orm";
|
|
20
21
|
import { BuildExtraConfigColumns, SQL, SQLWrapper } from "drizzle-orm";
|
|
@@ -23,7 +24,9 @@ import { LockConfig, LockStrength, PgColumn, PgColumnBuilderBase, PgDatabase, Pg
|
|
|
23
24
|
import { PgTransactionConfig } from "drizzle-orm/pg-core/session";
|
|
24
25
|
import * as DrizzleKit from "drizzle-kit/api";
|
|
25
26
|
import "alepha/retry";
|
|
27
|
+
import * as typebox0 from "typebox";
|
|
26
28
|
import "drizzle-orm/sqlite-core";
|
|
29
|
+
import { FileController } from "alepha/api/files";
|
|
27
30
|
|
|
28
31
|
//#region ../../src/api/users/atoms/realmAuthSettingsAtom.d.ts
|
|
29
32
|
declare const realmAuthSettingsAtom: alepha23.Atom<alepha23.TObject<{
|
|
@@ -43,6 +46,8 @@ declare const realmAuthSettingsAtom: alepha23.Atom<alepha23.TObject<{
|
|
|
43
46
|
firstNameLastNameEnabled: alepha23.TBoolean;
|
|
44
47
|
firstNameLastNameRequired: alepha23.TBoolean;
|
|
45
48
|
resetPasswordAllowed: alepha23.TBoolean;
|
|
49
|
+
adminEmails: alepha23.TArray<alepha23.TString>;
|
|
50
|
+
adminUsernames: alepha23.TArray<alepha23.TString>;
|
|
46
51
|
passwordPolicy: alepha23.TObject<{
|
|
47
52
|
minLength: alepha23.TInteger;
|
|
48
53
|
requireUppercase: alepha23.TBoolean;
|
|
@@ -904,7 +909,7 @@ declare abstract class ModelBuilder {
|
|
|
904
909
|
//#endregion
|
|
905
910
|
//#region ../../src/orm/providers/DrizzleKitProvider.d.ts
|
|
906
911
|
declare class DrizzleKitProvider {
|
|
907
|
-
protected readonly log:
|
|
912
|
+
protected readonly log: alepha_logger6.Logger;
|
|
908
913
|
protected readonly alepha: Alepha;
|
|
909
914
|
/**
|
|
910
915
|
* Synchronize database with current schema definitions.
|
|
@@ -952,7 +957,7 @@ type DevMigrations = Static<typeof devMigrationsSchema>;
|
|
|
952
957
|
type SQLLike = SQLWrapper | string;
|
|
953
958
|
declare abstract class DatabaseProvider {
|
|
954
959
|
protected readonly alepha: Alepha;
|
|
955
|
-
protected readonly log:
|
|
960
|
+
protected readonly log: alepha_logger6.Logger;
|
|
956
961
|
protected abstract readonly builder: ModelBuilder;
|
|
957
962
|
protected abstract readonly kit: DrizzleKitProvider;
|
|
958
963
|
abstract readonly db: PgDatabase<any>;
|
|
@@ -1107,7 +1112,7 @@ declare class PgRelationManager {
|
|
|
1107
1112
|
declare abstract class Repository$1<T extends TObject> {
|
|
1108
1113
|
readonly entity: EntityPrimitive<T>;
|
|
1109
1114
|
readonly provider: DatabaseProvider;
|
|
1110
|
-
protected readonly log:
|
|
1115
|
+
protected readonly log: alepha_logger6.Logger;
|
|
1111
1116
|
protected readonly relationManager: PgRelationManager;
|
|
1112
1117
|
protected readonly queryManager: QueryManager;
|
|
1113
1118
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
@@ -1452,6 +1457,62 @@ type RealmPrimitive = IssuerPrimitive & WithLinkFn & WithLoginFn;
|
|
|
1452
1457
|
* - `APP_SECRET`: Secret key for signing tokens (if not provided in options).
|
|
1453
1458
|
*/
|
|
1454
1459
|
declare const $realm: (options?: RealmOptions) => RealmPrimitive;
|
|
1460
|
+
interface RealmFeatures {
|
|
1461
|
+
/**
|
|
1462
|
+
* Enable job execution tracking and purge functionality.
|
|
1463
|
+
*
|
|
1464
|
+
* @default false
|
|
1465
|
+
*/
|
|
1466
|
+
jobs?: boolean;
|
|
1467
|
+
/**
|
|
1468
|
+
* Enable notification system for password reset, verification emails, etc.
|
|
1469
|
+
*
|
|
1470
|
+
* @default false
|
|
1471
|
+
*/
|
|
1472
|
+
notifications?: boolean;
|
|
1473
|
+
/**
|
|
1474
|
+
* Enable API key authentication for programmatic access.
|
|
1475
|
+
*
|
|
1476
|
+
* When enabled, users can create API keys to access protected endpoints
|
|
1477
|
+
* without using JWT tokens. API keys are useful for:
|
|
1478
|
+
* - Programmatic access (CLI tools, scripts)
|
|
1479
|
+
* - Long-lived authentication tokens
|
|
1480
|
+
* - Third-party integrations (MCP servers)
|
|
1481
|
+
*
|
|
1482
|
+
* API keys can be passed via:
|
|
1483
|
+
* - Query parameter: `?api_key=ak_xxx`
|
|
1484
|
+
* - Bearer header: `Authorization: Bearer ak_xxx`
|
|
1485
|
+
*
|
|
1486
|
+
* @default false
|
|
1487
|
+
*/
|
|
1488
|
+
apiKeys?: boolean;
|
|
1489
|
+
/**
|
|
1490
|
+
* Enable runtime configuration management.
|
|
1491
|
+
*
|
|
1492
|
+
* Allows configuring realm settings at runtime with versioning and scheduled activation.
|
|
1493
|
+
*
|
|
1494
|
+
* @default false
|
|
1495
|
+
*/
|
|
1496
|
+
parameters?: boolean;
|
|
1497
|
+
/**
|
|
1498
|
+
* Enable file management for avatar uploads and attachments.
|
|
1499
|
+
*
|
|
1500
|
+
* @default false
|
|
1501
|
+
*/
|
|
1502
|
+
files?: boolean;
|
|
1503
|
+
/**
|
|
1504
|
+
* Enable audit trail for compliance and event logging.
|
|
1505
|
+
*
|
|
1506
|
+
* @default false
|
|
1507
|
+
*/
|
|
1508
|
+
audits?: boolean;
|
|
1509
|
+
/**
|
|
1510
|
+
* Enable organization management to group users.
|
|
1511
|
+
*
|
|
1512
|
+
* @default false
|
|
1513
|
+
*/
|
|
1514
|
+
organizations?: boolean;
|
|
1515
|
+
}
|
|
1455
1516
|
interface RealmOptions {
|
|
1456
1517
|
/**
|
|
1457
1518
|
* Secret key for signing tokens.
|
|
@@ -1480,19 +1541,11 @@ interface RealmOptions {
|
|
|
1480
1541
|
github?: true;
|
|
1481
1542
|
};
|
|
1482
1543
|
/**
|
|
1483
|
-
* Enable
|
|
1484
|
-
*
|
|
1485
|
-
* When enabled, users can create API keys to access protected endpoints
|
|
1486
|
-
* without using JWT tokens. API keys are useful for:
|
|
1487
|
-
* - Programmatic access (CLI tools, scripts)
|
|
1488
|
-
* - Long-lived authentication tokens
|
|
1489
|
-
* - Third-party integrations
|
|
1544
|
+
* Enable or disable realm features.
|
|
1490
1545
|
*
|
|
1491
|
-
*
|
|
1492
|
-
* - Query parameter: `?api_key=ak_xxx`
|
|
1493
|
-
* - Bearer header: `Authorization: Bearer ak_xxx`
|
|
1546
|
+
* Features control which modules are loaded with the realm.
|
|
1494
1547
|
*/
|
|
1495
|
-
|
|
1548
|
+
features?: Partial<RealmFeatures>;
|
|
1496
1549
|
}
|
|
1497
1550
|
//#endregion
|
|
1498
1551
|
//#region ../../src/api/users/providers/RealmProvider.d.ts
|
|
@@ -1505,6 +1558,7 @@ interface Realm {
|
|
|
1505
1558
|
name: string;
|
|
1506
1559
|
repositories: RealmRepositories;
|
|
1507
1560
|
settings: RealmAuthSettings;
|
|
1561
|
+
features: RealmFeatures;
|
|
1508
1562
|
}
|
|
1509
1563
|
declare class RealmProvider {
|
|
1510
1564
|
protected readonly alepha: Alepha;
|
|
@@ -1551,7 +1605,6 @@ declare class RealmProvider {
|
|
|
1551
1605
|
emailVerified: alepha_orm24.PgAttr<alepha23.TBoolean, typeof alepha_orm24.PG_DEFAULT>;
|
|
1552
1606
|
}>>;
|
|
1553
1607
|
protected realms: Map<string, Realm>;
|
|
1554
|
-
avatars: alepha_bucket0.BucketPrimitive;
|
|
1555
1608
|
register(realmName: string, realmOptions?: RealmOptions): Realm;
|
|
1556
1609
|
/**
|
|
1557
1610
|
* Gets a registered realm by name, auto-creating default if needed.
|
|
@@ -1572,11 +1625,150 @@ declare const identityQuerySchema: alepha23.TObject<{
|
|
|
1572
1625
|
}>;
|
|
1573
1626
|
type IdentityQuery = Static<typeof identityQuerySchema>;
|
|
1574
1627
|
//#endregion
|
|
1628
|
+
//#region ../../src/api/users/services/UserAudits.d.ts
|
|
1629
|
+
type AuditContext = Omit<CreateAudit, "type" | "action">;
|
|
1630
|
+
/**
|
|
1631
|
+
* User-specific audit wrapper service.
|
|
1632
|
+
*
|
|
1633
|
+
* This service wraps the core AuditService to provide user-related audit logging.
|
|
1634
|
+
* It is lazy-loaded when the `audits` feature is enabled in the realm.
|
|
1635
|
+
*/
|
|
1636
|
+
declare class UserAudits {
|
|
1637
|
+
protected readonly auditService: AuditService;
|
|
1638
|
+
/**
|
|
1639
|
+
* Record a user-related audit event.
|
|
1640
|
+
*/
|
|
1641
|
+
recordUser(action: "create" | "update" | "delete" | "role_change" | "enable" | "disable", context: AuditContext): Promise<{
|
|
1642
|
+
description?: string | undefined;
|
|
1643
|
+
userId?: string | undefined;
|
|
1644
|
+
userAgent?: string | undefined;
|
|
1645
|
+
userRealm?: string | undefined;
|
|
1646
|
+
userEmail?: string | undefined;
|
|
1647
|
+
resourceType?: string | undefined;
|
|
1648
|
+
resourceId?: string | undefined;
|
|
1649
|
+
metadata?: typebox0.StaticRecord<[], "Decode", {}, {
|
|
1650
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1651
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1652
|
+
type: alepha23.TString;
|
|
1653
|
+
action: alepha23.TString;
|
|
1654
|
+
severity: PgAttr<alepha23.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
1655
|
+
userId: alepha23.TOptional<alepha23.TString>;
|
|
1656
|
+
userRealm: alepha23.TOptional<alepha23.TString>;
|
|
1657
|
+
userEmail: alepha23.TOptional<alepha23.TString>;
|
|
1658
|
+
resourceType: alepha23.TOptional<alepha23.TString>;
|
|
1659
|
+
resourceId: alepha23.TOptional<alepha23.TString>;
|
|
1660
|
+
description: alepha23.TOptional<alepha23.TString>;
|
|
1661
|
+
metadata: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
|
|
1662
|
+
ipAddress: alepha23.TOptional<alepha23.TString>;
|
|
1663
|
+
userAgent: alepha23.TOptional<alepha23.TString>;
|
|
1664
|
+
sessionId: alepha23.TOptional<alepha23.TString>;
|
|
1665
|
+
requestId: alepha23.TOptional<alepha23.TString>;
|
|
1666
|
+
success: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
1667
|
+
errorMessage: alepha23.TOptional<alepha23.TString>;
|
|
1668
|
+
}, string, alepha23.TAny> | undefined;
|
|
1669
|
+
ipAddress?: string | undefined;
|
|
1670
|
+
sessionId?: string | undefined;
|
|
1671
|
+
requestId?: string | undefined;
|
|
1672
|
+
errorMessage?: string | undefined;
|
|
1673
|
+
type: string;
|
|
1674
|
+
id: string;
|
|
1675
|
+
createdAt: string;
|
|
1676
|
+
success: boolean;
|
|
1677
|
+
action: string;
|
|
1678
|
+
severity: "info" | "warning" | "critical";
|
|
1679
|
+
}>;
|
|
1680
|
+
/**
|
|
1681
|
+
* Record an authentication-related audit event.
|
|
1682
|
+
*/
|
|
1683
|
+
recordAuth(action: "login" | "logout" | "login_failed" | "token_refresh", context: AuditContext): Promise<{
|
|
1684
|
+
description?: string | undefined;
|
|
1685
|
+
userId?: string | undefined;
|
|
1686
|
+
userAgent?: string | undefined;
|
|
1687
|
+
userRealm?: string | undefined;
|
|
1688
|
+
userEmail?: string | undefined;
|
|
1689
|
+
resourceType?: string | undefined;
|
|
1690
|
+
resourceId?: string | undefined;
|
|
1691
|
+
metadata?: typebox0.StaticRecord<[], "Decode", {}, {
|
|
1692
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1693
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1694
|
+
type: alepha23.TString;
|
|
1695
|
+
action: alepha23.TString;
|
|
1696
|
+
severity: PgAttr<alepha23.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
1697
|
+
userId: alepha23.TOptional<alepha23.TString>;
|
|
1698
|
+
userRealm: alepha23.TOptional<alepha23.TString>;
|
|
1699
|
+
userEmail: alepha23.TOptional<alepha23.TString>;
|
|
1700
|
+
resourceType: alepha23.TOptional<alepha23.TString>;
|
|
1701
|
+
resourceId: alepha23.TOptional<alepha23.TString>;
|
|
1702
|
+
description: alepha23.TOptional<alepha23.TString>;
|
|
1703
|
+
metadata: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
|
|
1704
|
+
ipAddress: alepha23.TOptional<alepha23.TString>;
|
|
1705
|
+
userAgent: alepha23.TOptional<alepha23.TString>;
|
|
1706
|
+
sessionId: alepha23.TOptional<alepha23.TString>;
|
|
1707
|
+
requestId: alepha23.TOptional<alepha23.TString>;
|
|
1708
|
+
success: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
1709
|
+
errorMessage: alepha23.TOptional<alepha23.TString>;
|
|
1710
|
+
}, string, alepha23.TAny> | undefined;
|
|
1711
|
+
ipAddress?: string | undefined;
|
|
1712
|
+
sessionId?: string | undefined;
|
|
1713
|
+
requestId?: string | undefined;
|
|
1714
|
+
errorMessage?: string | undefined;
|
|
1715
|
+
type: string;
|
|
1716
|
+
id: string;
|
|
1717
|
+
createdAt: string;
|
|
1718
|
+
success: boolean;
|
|
1719
|
+
action: string;
|
|
1720
|
+
severity: "info" | "warning" | "critical";
|
|
1721
|
+
}>;
|
|
1722
|
+
/**
|
|
1723
|
+
* Record a generic audit event.
|
|
1724
|
+
*/
|
|
1725
|
+
record(category: string, action: string, context: AuditContext): Promise<{
|
|
1726
|
+
description?: string | undefined;
|
|
1727
|
+
userId?: string | undefined;
|
|
1728
|
+
userAgent?: string | undefined;
|
|
1729
|
+
userRealm?: string | undefined;
|
|
1730
|
+
userEmail?: string | undefined;
|
|
1731
|
+
resourceType?: string | undefined;
|
|
1732
|
+
resourceId?: string | undefined;
|
|
1733
|
+
metadata?: typebox0.StaticRecord<[], "Decode", {}, {
|
|
1734
|
+
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
1735
|
+
createdAt: PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1736
|
+
type: alepha23.TString;
|
|
1737
|
+
action: alepha23.TString;
|
|
1738
|
+
severity: PgAttr<alepha23.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
1739
|
+
userId: alepha23.TOptional<alepha23.TString>;
|
|
1740
|
+
userRealm: alepha23.TOptional<alepha23.TString>;
|
|
1741
|
+
userEmail: alepha23.TOptional<alepha23.TString>;
|
|
1742
|
+
resourceType: alepha23.TOptional<alepha23.TString>;
|
|
1743
|
+
resourceId: alepha23.TOptional<alepha23.TString>;
|
|
1744
|
+
description: alepha23.TOptional<alepha23.TString>;
|
|
1745
|
+
metadata: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
|
|
1746
|
+
ipAddress: alepha23.TOptional<alepha23.TString>;
|
|
1747
|
+
userAgent: alepha23.TOptional<alepha23.TString>;
|
|
1748
|
+
sessionId: alepha23.TOptional<alepha23.TString>;
|
|
1749
|
+
requestId: alepha23.TOptional<alepha23.TString>;
|
|
1750
|
+
success: PgAttr<alepha23.TBoolean, typeof PG_DEFAULT>;
|
|
1751
|
+
errorMessage: alepha23.TOptional<alepha23.TString>;
|
|
1752
|
+
}, string, alepha23.TAny> | undefined;
|
|
1753
|
+
ipAddress?: string | undefined;
|
|
1754
|
+
sessionId?: string | undefined;
|
|
1755
|
+
requestId?: string | undefined;
|
|
1756
|
+
errorMessage?: string | undefined;
|
|
1757
|
+
type: string;
|
|
1758
|
+
id: string;
|
|
1759
|
+
createdAt: string;
|
|
1760
|
+
success: boolean;
|
|
1761
|
+
action: string;
|
|
1762
|
+
severity: "info" | "warning" | "critical";
|
|
1763
|
+
}>;
|
|
1764
|
+
}
|
|
1765
|
+
//#endregion
|
|
1575
1766
|
//#region ../../src/api/users/services/IdentityService.d.ts
|
|
1576
1767
|
declare class IdentityService {
|
|
1577
|
-
protected readonly
|
|
1768
|
+
protected readonly alepha: Alepha;
|
|
1769
|
+
protected readonly log: alepha_logger6.Logger;
|
|
1578
1770
|
protected readonly realmProvider: RealmProvider;
|
|
1579
|
-
protected
|
|
1771
|
+
protected userAudits(realmName?: string): UserAudits | undefined;
|
|
1580
1772
|
identities(userRealmName?: string): alepha_orm24.Repository<alepha23.TObject<{
|
|
1581
1773
|
id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1582
1774
|
version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
|
|
@@ -1680,7 +1872,7 @@ type SessionQuery = Static<typeof sessionQuerySchema>;
|
|
|
1680
1872
|
//#endregion
|
|
1681
1873
|
//#region ../../src/api/users/services/SessionCrudService.d.ts
|
|
1682
1874
|
declare class SessionCrudService {
|
|
1683
|
-
protected readonly log:
|
|
1875
|
+
protected readonly log: alepha_logger6.Logger;
|
|
1684
1876
|
protected readonly realmProvider: RealmProvider;
|
|
1685
1877
|
sessions(userRealmName?: string): alepha_orm24.Repository<alepha23.TObject<{
|
|
1686
1878
|
id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
|
|
@@ -1787,44 +1979,15 @@ declare class AdminSessionController {
|
|
|
1787
1979
|
}>;
|
|
1788
1980
|
}
|
|
1789
1981
|
//#endregion
|
|
1790
|
-
//#region ../../src/api/users/notifications/UserNotifications.d.ts
|
|
1791
|
-
declare class UserNotifications {
|
|
1792
|
-
readonly passwordReset: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
|
|
1793
|
-
email: alepha23.TString;
|
|
1794
|
-
code: alepha23.TString;
|
|
1795
|
-
expiresInMinutes: alepha23.TNumber;
|
|
1796
|
-
}>>;
|
|
1797
|
-
readonly emailVerification: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
|
|
1798
|
-
email: alepha23.TString;
|
|
1799
|
-
code: alepha23.TString;
|
|
1800
|
-
expiresInMinutes: alepha23.TNumber;
|
|
1801
|
-
}>>;
|
|
1802
|
-
readonly phoneVerification: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
|
|
1803
|
-
phoneNumber: alepha23.TString;
|
|
1804
|
-
code: alepha23.TString;
|
|
1805
|
-
expiresInMinutes: alepha23.TNumber;
|
|
1806
|
-
}>>;
|
|
1807
|
-
readonly passwordResetLink: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
|
|
1808
|
-
email: alepha23.TString;
|
|
1809
|
-
resetUrl: alepha23.TString;
|
|
1810
|
-
expiresInMinutes: alepha23.TNumber;
|
|
1811
|
-
}>>;
|
|
1812
|
-
readonly emailVerificationLink: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
|
|
1813
|
-
email: alepha23.TString;
|
|
1814
|
-
verifyUrl: alepha23.TString;
|
|
1815
|
-
expiresInMinutes: alepha23.TNumber;
|
|
1816
|
-
}>>;
|
|
1817
|
-
}
|
|
1818
|
-
//#endregion
|
|
1819
1982
|
//#region ../../src/api/users/schemas/createUserSchema.d.ts
|
|
1820
1983
|
declare const createUserSchema: alepha23.TObject<{
|
|
1984
|
+
email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1985
|
+
phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1821
1986
|
id: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>>;
|
|
1822
1987
|
version: alepha23.TOptional<PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>>;
|
|
1823
|
-
email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1824
1988
|
createdAt: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>>;
|
|
1825
1989
|
updatedAt: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>>;
|
|
1826
1990
|
username: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1827
|
-
phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1828
1991
|
roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
|
|
1829
1992
|
firstName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1830
1993
|
lastName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
@@ -1837,8 +2000,8 @@ type CreateUser = Static<typeof createUserSchema>;
|
|
|
1837
2000
|
//#region ../../src/api/users/schemas/updateUserSchema.d.ts
|
|
1838
2001
|
declare const updateUserSchema: alepha23.TObject<{
|
|
1839
2002
|
email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1840
|
-
realm: alepha23.TOptional<PgAttr<alepha23.TString, typeof PG_DEFAULT>>;
|
|
1841
2003
|
phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
2004
|
+
realm: alepha23.TOptional<PgAttr<alepha23.TString, typeof PG_DEFAULT>>;
|
|
1842
2005
|
roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
|
|
1843
2006
|
firstName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1844
2007
|
lastName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
@@ -1860,13 +2023,43 @@ declare const userQuerySchema: alepha23.TObject<{
|
|
|
1860
2023
|
}>;
|
|
1861
2024
|
type UserQuery = Static<typeof userQuerySchema>;
|
|
1862
2025
|
//#endregion
|
|
2026
|
+
//#region ../../src/api/users/services/UserNotifications.d.ts
|
|
2027
|
+
declare class UserNotifications {
|
|
2028
|
+
readonly passwordReset: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
|
|
2029
|
+
email: alepha23.TString;
|
|
2030
|
+
code: alepha23.TString;
|
|
2031
|
+
expiresInMinutes: alepha23.TNumber;
|
|
2032
|
+
}>>;
|
|
2033
|
+
readonly emailVerification: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
|
|
2034
|
+
email: alepha23.TString;
|
|
2035
|
+
code: alepha23.TString;
|
|
2036
|
+
expiresInMinutes: alepha23.TNumber;
|
|
2037
|
+
}>>;
|
|
2038
|
+
readonly phoneVerification: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
|
|
2039
|
+
phoneNumber: alepha23.TString;
|
|
2040
|
+
code: alepha23.TString;
|
|
2041
|
+
expiresInMinutes: alepha23.TNumber;
|
|
2042
|
+
}>>;
|
|
2043
|
+
readonly passwordResetLink: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
|
|
2044
|
+
email: alepha23.TString;
|
|
2045
|
+
resetUrl: alepha23.TString;
|
|
2046
|
+
expiresInMinutes: alepha23.TNumber;
|
|
2047
|
+
}>>;
|
|
2048
|
+
readonly emailVerificationLink: alepha_api_notifications0.NotificationPrimitive<alepha23.TObject<{
|
|
2049
|
+
email: alepha23.TString;
|
|
2050
|
+
verifyUrl: alepha23.TString;
|
|
2051
|
+
expiresInMinutes: alepha23.TNumber;
|
|
2052
|
+
}>>;
|
|
2053
|
+
}
|
|
2054
|
+
//#endregion
|
|
1863
2055
|
//#region ../../src/api/users/services/UserService.d.ts
|
|
1864
2056
|
declare class UserService {
|
|
1865
|
-
protected readonly
|
|
2057
|
+
protected readonly alepha: Alepha;
|
|
2058
|
+
protected readonly log: alepha_logger6.Logger;
|
|
1866
2059
|
protected readonly verificationController: alepha_server_links0.HttpVirtualClient<VerificationController>;
|
|
1867
|
-
protected readonly userNotifications: UserNotifications;
|
|
1868
2060
|
protected readonly realmProvider: RealmProvider;
|
|
1869
|
-
protected
|
|
2061
|
+
protected userAudits(realmName?: string): UserAudits | undefined;
|
|
2062
|
+
protected userNotifications(realmName?: string): UserNotifications | undefined;
|
|
1870
2063
|
users(userRealmName?: string): alepha_orm24.Repository<alepha23.TObject<{
|
|
1871
2064
|
id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
|
|
1872
2065
|
version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
|
|
@@ -1994,13 +2187,13 @@ declare class AdminUserController {
|
|
|
1994
2187
|
userRealmName: alepha23.TOptional<alepha23.TString>;
|
|
1995
2188
|
}>;
|
|
1996
2189
|
body: alepha23.TObject<{
|
|
2190
|
+
email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
2191
|
+
phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
1997
2192
|
id: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>>;
|
|
1998
2193
|
version: alepha23.TOptional<PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>>;
|
|
1999
|
-
email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
2000
2194
|
createdAt: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>>;
|
|
2001
2195
|
updatedAt: alepha23.TOptional<PgAttr<PgAttr<alepha23.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>>;
|
|
2002
2196
|
username: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
2003
|
-
phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
2004
2197
|
roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
|
|
2005
2198
|
firstName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
2006
2199
|
lastName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
@@ -2037,8 +2230,8 @@ declare class AdminUserController {
|
|
|
2037
2230
|
}>;
|
|
2038
2231
|
body: alepha23.TObject<{
|
|
2039
2232
|
email: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
2040
|
-
realm: alepha23.TOptional<PgAttr<alepha23.TString, typeof PG_DEFAULT>>;
|
|
2041
2233
|
phoneNumber: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
2234
|
+
realm: alepha23.TOptional<PgAttr<alepha23.TString, typeof PG_DEFAULT>>;
|
|
2042
2235
|
roles: alepha23.TOptional<alepha23.TArray<alepha23.TString>>;
|
|
2043
2236
|
firstName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
2044
2237
|
lastName: alepha23.TOptional<alepha23.TOptional<alepha23.TString>>;
|
|
@@ -2116,6 +2309,8 @@ declare class RealmController {
|
|
|
2116
2309
|
firstNameLastNameEnabled: alepha23.TBoolean;
|
|
2117
2310
|
firstNameLastNameRequired: alepha23.TBoolean;
|
|
2118
2311
|
resetPasswordAllowed: alepha23.TBoolean;
|
|
2312
|
+
adminEmails: alepha23.TArray<alepha23.TString>;
|
|
2313
|
+
adminUsernames: alepha23.TArray<alepha23.TString>;
|
|
2119
2314
|
passwordPolicy: alepha23.TObject<{
|
|
2120
2315
|
minLength: alepha23.TInteger;
|
|
2121
2316
|
requireUppercase: alepha23.TBoolean;
|
|
@@ -2183,13 +2378,14 @@ interface PasswordResetIntent {
|
|
|
2183
2378
|
expiresAt: string;
|
|
2184
2379
|
}
|
|
2185
2380
|
declare class CredentialService {
|
|
2186
|
-
protected readonly
|
|
2381
|
+
protected readonly alepha: Alepha;
|
|
2382
|
+
protected readonly log: alepha_logger6.Logger;
|
|
2187
2383
|
protected readonly cryptoProvider: CryptoProvider;
|
|
2188
2384
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
2189
2385
|
protected readonly verificationController: alepha_server_links0.HttpVirtualClient<VerificationController>;
|
|
2190
|
-
protected readonly userNotifications: UserNotifications;
|
|
2191
2386
|
protected readonly realmProvider: RealmProvider;
|
|
2192
|
-
protected
|
|
2387
|
+
protected userAudits(realmName?: string): UserAudits | undefined;
|
|
2388
|
+
protected userNotifications(realmName?: string): UserNotifications | undefined;
|
|
2193
2389
|
protected readonly intentCache: alepha_cache0.CachePrimitiveFn<PasswordResetIntent, any[]>;
|
|
2194
2390
|
users(userRealmName?: string): Repository$1<alepha23.TObject<{
|
|
2195
2391
|
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
@@ -2325,14 +2521,15 @@ interface RegistrationIntent {
|
|
|
2325
2521
|
expiresAt: string;
|
|
2326
2522
|
}
|
|
2327
2523
|
declare class RegistrationService {
|
|
2328
|
-
protected readonly
|
|
2524
|
+
protected readonly alepha: Alepha;
|
|
2525
|
+
protected readonly log: alepha_logger6.Logger;
|
|
2329
2526
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
2330
2527
|
protected readonly cryptoProvider: CryptoProvider;
|
|
2331
2528
|
protected readonly verificationController: alepha_server_links0.HttpVirtualClient<VerificationController>;
|
|
2332
|
-
protected readonly userNotifications: UserNotifications;
|
|
2333
2529
|
protected readonly realmProvider: RealmProvider;
|
|
2334
|
-
protected readonly auditService: AuditService;
|
|
2335
2530
|
protected readonly intentCache: alepha_cache0.CachePrimitiveFn<RegistrationIntent, any[]>;
|
|
2531
|
+
protected userAudits(realmName?: string): UserAudits | undefined;
|
|
2532
|
+
protected userNotifications(realmName?: string): UserNotifications | undefined;
|
|
2336
2533
|
/**
|
|
2337
2534
|
* Phase 1: Create a registration intent.
|
|
2338
2535
|
*
|
|
@@ -2354,11 +2551,11 @@ declare class RegistrationService {
|
|
|
2354
2551
|
/**
|
|
2355
2552
|
* Send email verification code.
|
|
2356
2553
|
*/
|
|
2357
|
-
protected sendEmailVerification(email: string): Promise<void>;
|
|
2554
|
+
protected sendEmailVerification(email: string, realmName?: string): Promise<void>;
|
|
2358
2555
|
/**
|
|
2359
2556
|
* Send phone verification code.
|
|
2360
2557
|
*/
|
|
2361
|
-
protected sendPhoneVerification(phoneNumber: string): Promise<void>;
|
|
2558
|
+
protected sendPhoneVerification(phoneNumber: string, realmName?: string): Promise<void>;
|
|
2362
2559
|
/**
|
|
2363
2560
|
* Verify email code using verification service.
|
|
2364
2561
|
*/
|
|
@@ -2597,6 +2794,8 @@ declare const realmConfigSchema: alepha23.TObject<{
|
|
|
2597
2794
|
firstNameLastNameEnabled: alepha23.TBoolean;
|
|
2598
2795
|
firstNameLastNameRequired: alepha23.TBoolean;
|
|
2599
2796
|
resetPasswordAllowed: alepha23.TBoolean;
|
|
2797
|
+
adminEmails: alepha23.TArray<alepha23.TString>;
|
|
2798
|
+
adminUsernames: alepha23.TArray<alepha23.TString>;
|
|
2600
2799
|
passwordPolicy: alepha23.TObject<{
|
|
2601
2800
|
minLength: alepha23.TInteger;
|
|
2602
2801
|
requireUppercase: alepha23.TBoolean;
|
|
@@ -2977,10 +3176,10 @@ declare class SessionService {
|
|
|
2977
3176
|
protected readonly fsp: FileSystemProvider;
|
|
2978
3177
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
2979
3178
|
protected readonly cryptoProvider: CryptoProvider;
|
|
2980
|
-
protected readonly log:
|
|
3179
|
+
protected readonly log: alepha_logger6.Logger;
|
|
2981
3180
|
protected readonly realmProvider: RealmProvider;
|
|
2982
3181
|
protected readonly fileController: alepha_server_links0.HttpVirtualClient<FileController>;
|
|
2983
|
-
protected
|
|
3182
|
+
protected userAudits(realmName?: string): UserAudits | undefined;
|
|
2984
3183
|
users(userRealmName?: string): Repository$1<alepha23.TObject<{
|
|
2985
3184
|
id: PgAttr<PgAttr<alepha23.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
2986
3185
|
version: PgAttr<PgAttr<alepha23.TInteger, typeof PG_VERSION>, typeof PG_DEFAULT>;
|
|
@@ -3023,6 +3222,16 @@ declare class SessionService {
|
|
|
3023
3222
|
providerUserId: alepha23.TOptional<alepha23.TString>;
|
|
3024
3223
|
providerData: alepha23.TOptional<alepha23.TRecord<string, alepha23.TAny>>;
|
|
3025
3224
|
}>>;
|
|
3225
|
+
/**
|
|
3226
|
+
* Check if user should be auto-promoted to admin based on adminEmails/adminUsernames settings.
|
|
3227
|
+
* If user matches and doesn't have admin role, promote them.
|
|
3228
|
+
*/
|
|
3229
|
+
protected ensureAdminRole(user: {
|
|
3230
|
+
id: string;
|
|
3231
|
+
email?: string | null;
|
|
3232
|
+
username?: string | null;
|
|
3233
|
+
roles: string[];
|
|
3234
|
+
}, userRealmName?: string): Promise<boolean>;
|
|
3026
3235
|
/**
|
|
3027
3236
|
* Random delay to prevent timing attacks (50-200ms)
|
|
3028
3237
|
* Uses cryptographically secure random number generation
|
|
@@ -3074,8 +3283,8 @@ declare class SessionService {
|
|
|
3074
3283
|
deleteSession(refreshToken: string, userRealmName?: string): Promise<void>;
|
|
3075
3284
|
link(provider: string, profile: OAuth2Profile, userRealmName?: string): Promise<{
|
|
3076
3285
|
email?: string | undefined;
|
|
3077
|
-
username?: string | undefined;
|
|
3078
3286
|
phoneNumber?: string | undefined;
|
|
3287
|
+
username?: string | undefined;
|
|
3079
3288
|
firstName?: string | undefined;
|
|
3080
3289
|
lastName?: string | undefined;
|
|
3081
3290
|
picture?: string | undefined;
|
|
@@ -3119,11 +3328,108 @@ declare class SessionService {
|
|
|
3119
3328
|
}>;
|
|
3120
3329
|
}
|
|
3121
3330
|
//#endregion
|
|
3331
|
+
//#region ../../src/api/users/services/UserFiles.d.ts
|
|
3332
|
+
/**
|
|
3333
|
+
* User-specific file storage wrapper service.
|
|
3334
|
+
*
|
|
3335
|
+
* This service provides file storage for user-related files such as:
|
|
3336
|
+
* - User avatars/profile pictures
|
|
3337
|
+
*
|
|
3338
|
+
* It is lazy-loaded when the `files` feature is enabled in the realm.
|
|
3339
|
+
*/
|
|
3340
|
+
declare class UserFiles {
|
|
3341
|
+
/**
|
|
3342
|
+
* Bucket for user avatar storage.
|
|
3343
|
+
*/
|
|
3344
|
+
readonly avatars: alepha_bucket0.BucketPrimitive;
|
|
3345
|
+
}
|
|
3346
|
+
//#endregion
|
|
3347
|
+
//#region ../../src/api/users/services/UserJobs.d.ts
|
|
3348
|
+
/**
|
|
3349
|
+
* User-specific jobs wrapper service.
|
|
3350
|
+
*
|
|
3351
|
+
* This service handles user-related scheduled jobs such as:
|
|
3352
|
+
* - Session purge (cleaning up expired sessions)
|
|
3353
|
+
* - Verification code cleanup
|
|
3354
|
+
* - Inactive user notifications
|
|
3355
|
+
*
|
|
3356
|
+
* It is lazy-loaded when the `jobs` feature is enabled in the realm.
|
|
3357
|
+
*/
|
|
3358
|
+
declare class UserJobs {
|
|
3359
|
+
protected readonly log: alepha_logger6.Logger;
|
|
3360
|
+
protected readonly dateTimeProvider: DateTimeProvider;
|
|
3361
|
+
protected readonly sessionRepository: alepha_orm24.Repository<alepha23.TObject<{
|
|
3362
|
+
id: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_PRIMARY_KEY>, typeof alepha_orm24.PG_DEFAULT>;
|
|
3363
|
+
version: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TInteger, typeof alepha_orm24.PG_VERSION>, typeof alepha_orm24.PG_DEFAULT>;
|
|
3364
|
+
createdAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_CREATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
3365
|
+
updatedAt: alepha_orm24.PgAttr<alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_UPDATED_AT>, typeof alepha_orm24.PG_DEFAULT>;
|
|
3366
|
+
refreshToken: alepha23.TString;
|
|
3367
|
+
userId: alepha_orm24.PgAttr<alepha23.TString, typeof alepha_orm24.PG_REF>;
|
|
3368
|
+
expiresAt: alepha23.TString;
|
|
3369
|
+
ip: alepha23.TOptional<alepha23.TString>;
|
|
3370
|
+
userAgent: alepha23.TOptional<alepha23.TObject<{
|
|
3371
|
+
os: alepha23.TString;
|
|
3372
|
+
browser: alepha23.TString;
|
|
3373
|
+
device: alepha23.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
|
|
3374
|
+
}>>;
|
|
3375
|
+
}>>;
|
|
3376
|
+
/**
|
|
3377
|
+
* Purge expired sessions from the database.
|
|
3378
|
+
*
|
|
3379
|
+
* This job runs daily at 3:00 AM and removes all sessions
|
|
3380
|
+
* where the `expiresAt` timestamp has passed.
|
|
3381
|
+
*/
|
|
3382
|
+
readonly purgeExpiredSessions: alepha_api_jobs0.JobPrimitive;
|
|
3383
|
+
}
|
|
3384
|
+
//#endregion
|
|
3385
|
+
//#region ../../src/api/users/services/UserParameters.d.ts
|
|
3386
|
+
/**
|
|
3387
|
+
* User-specific configuration service.
|
|
3388
|
+
*
|
|
3389
|
+
* This service wraps the core ConfigStore to provide realm settings management.
|
|
3390
|
+
* It is lazy-loaded when the `parameters` feature is enabled in the realm.
|
|
3391
|
+
*/
|
|
3392
|
+
declare class UserParameters {
|
|
3393
|
+
/**
|
|
3394
|
+
* Realm authentication settings configuration.
|
|
3395
|
+
*
|
|
3396
|
+
* Controls user registration, login methods, verification requirements,
|
|
3397
|
+
* and password policies for the realm.
|
|
3398
|
+
*/
|
|
3399
|
+
readonly realmSettings: alepha_api_parameters0.ConfigPrimitive<typebox0.TObject<{
|
|
3400
|
+
displayName: typebox0.TOptional<typebox0.TString>;
|
|
3401
|
+
description: typebox0.TOptional<typebox0.TString>;
|
|
3402
|
+
logoUrl: typebox0.TOptional<typebox0.TString>;
|
|
3403
|
+
registrationAllowed: typebox0.TBoolean;
|
|
3404
|
+
emailEnabled: typebox0.TBoolean;
|
|
3405
|
+
emailRequired: typebox0.TBoolean;
|
|
3406
|
+
usernameEnabled: typebox0.TBoolean;
|
|
3407
|
+
usernameRequired: typebox0.TBoolean;
|
|
3408
|
+
usernameRegExp: typebox0.TString;
|
|
3409
|
+
phoneEnabled: typebox0.TBoolean;
|
|
3410
|
+
phoneRequired: typebox0.TBoolean;
|
|
3411
|
+
verifyEmailRequired: typebox0.TBoolean;
|
|
3412
|
+
verifyPhoneRequired: typebox0.TBoolean;
|
|
3413
|
+
firstNameLastNameEnabled: typebox0.TBoolean;
|
|
3414
|
+
firstNameLastNameRequired: typebox0.TBoolean;
|
|
3415
|
+
resetPasswordAllowed: typebox0.TBoolean;
|
|
3416
|
+
adminEmails: typebox0.TArray<typebox0.TString>;
|
|
3417
|
+
adminUsernames: typebox0.TArray<typebox0.TString>;
|
|
3418
|
+
passwordPolicy: typebox0.TObject<{
|
|
3419
|
+
minLength: typebox0.TInteger;
|
|
3420
|
+
requireUppercase: typebox0.TBoolean;
|
|
3421
|
+
requireLowercase: typebox0.TBoolean;
|
|
3422
|
+
requireNumbers: typebox0.TBoolean;
|
|
3423
|
+
requireSpecialCharacters: typebox0.TBoolean;
|
|
3424
|
+
}>;
|
|
3425
|
+
}>>;
|
|
3426
|
+
}
|
|
3427
|
+
//#endregion
|
|
3122
3428
|
//#region ../../src/api/users/index.d.ts
|
|
3123
3429
|
/**
|
|
3124
|
-
* |
|
|
3125
|
-
*
|
|
3126
|
-
* |
|
|
3430
|
+
* | Stability | Since | Runtime |
|
|
3431
|
+
* |-----------|-------|---------|
|
|
3432
|
+
* | 3 - stable | 0.5.0 | node, bun, workerd|
|
|
3127
3433
|
*
|
|
3128
3434
|
* Complete user management with multi-realm support for multi-tenant applications.
|
|
3129
3435
|
*
|
|
@@ -3141,5 +3447,5 @@ declare class SessionService {
|
|
|
3141
3447
|
*/
|
|
3142
3448
|
declare const AlephaApiUsers: alepha23.Service<alepha23.Module>;
|
|
3143
3449
|
//#endregion
|
|
3144
|
-
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 };
|
|
3450
|
+
export { $realm, AdminIdentityController, AdminSessionController, AdminUserController, AlephaApiUsers, CompletePasswordResetRequest, CompleteRegistrationRequest, CreateUser, CredentialService, DEFAULT_USER_REALM_NAME, IdentityEntity, IdentityQuery, IdentityResource, IdentityService, LoginInput, PasswordResetIntentResponse, Realm, RealmAuthSettings, RealmConfig, RealmController, RealmFeatures, RealmOptions, RealmPrimitive, RealmProvider, RealmRepositories, RegisterInput, RegistrationIntentResponse, RegistrationService, ResetPasswordInput, ResetPasswordRequest, SessionCrudService, SessionEntity, SessionQuery, SessionResource, SessionService, UpdateUser, UserAudits, UserController, UserEntity, UserFiles, UserJobs, UserNotifications, UserParameters, UserQuery, UserResource, UserService, completePasswordResetRequestSchema, completeRegistrationRequestSchema, createUserSchema, identities, identityQuerySchema, identityResourceSchema, loginSchema, passwordResetIntentResponseSchema, realmAuthSettingsAtom, realmConfigSchema, registerSchema, registrationIntentResponseSchema, resetPasswordRequestSchema, resetPasswordSchema, sessionQuerySchema, sessionResourceSchema, sessions, updateUserSchema, userQuerySchema, userResourceSchema, users };
|
|
3145
3451
|
//# sourceMappingURL=index.d.ts.map
|