alepha 0.20.2 → 0.20.4
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 +0 -1
- package/assets/swagger-ui/swagger-ui-bundle.js +1 -1
- package/assets/swagger-ui/swagger-ui.css +1 -1
- package/dist/api/audits/index.browser.js +49 -0
- package/dist/api/audits/index.browser.js.map +1 -1
- package/dist/api/audits/index.js +49 -0
- package/dist/api/audits/index.js.map +1 -1
- package/dist/api/files/index.js.map +1 -1
- package/dist/api/jobs/index.d.ts +2 -61
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/jobs/index.js.map +1 -1
- package/dist/api/keys/index.d.ts +4 -4
- package/dist/api/keys/index.js.map +1 -1
- package/dist/api/notifications/index.d.ts +1 -10
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/parameters/index.browser.js +37 -0
- package/dist/api/parameters/index.browser.js.map +1 -1
- package/dist/api/parameters/index.d.ts +12 -68
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/parameters/index.js +57 -4
- package/dist/api/parameters/index.js.map +1 -1
- package/dist/api/payments/index.js.map +1 -1
- package/dist/api/users/index.browser.js +6 -0
- package/dist/api/users/index.browser.js.map +1 -1
- package/dist/api/users/index.d.ts +148 -227
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +60 -14
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/verifications/index.d.ts.map +1 -1
- package/dist/api/verifications/index.js +2 -1
- package/dist/api/verifications/index.js.map +1 -1
- package/dist/bucket/index.d.ts +77 -107
- package/dist/bucket/index.d.ts.map +1 -1
- package/dist/bucket/index.js +153 -5
- package/dist/bucket/index.js.map +1 -1
- package/dist/bucket/index.workerd.js +12 -2
- package/dist/bucket/index.workerd.js.map +1 -1
- package/dist/cache/core/index.d.ts +26 -0
- package/dist/cache/core/index.d.ts.map +1 -1
- package/dist/cache/core/index.js +11 -1
- package/dist/cache/core/index.js.map +1 -1
- package/dist/cache/core/index.workerd.js +11 -1
- package/dist/cache/core/index.workerd.js.map +1 -1
- package/dist/captcha/index.js.map +1 -1
- package/dist/cli/config/index.d.ts +7 -5
- package/dist/cli/config/index.d.ts.map +1 -1
- package/dist/cli/config/index.js +2 -3
- package/dist/cli/config/index.js.map +1 -1
- package/dist/cli/core/index.d.ts +637 -11660
- package/dist/cli/core/index.d.ts.map +1 -1
- package/dist/cli/core/index.js +707 -532
- package/dist/cli/core/index.js.map +1 -1
- package/dist/cli/devtools/index.d.ts +4 -8
- package/dist/cli/devtools/index.d.ts.map +1 -1
- package/dist/cli/devtools/index.js +20 -16
- package/dist/cli/devtools/index.js.map +1 -1
- package/dist/cli/platform/index.d.ts +51 -77
- package/dist/cli/platform/index.d.ts.map +1 -1
- package/dist/cli/platform/index.js +65 -15
- package/dist/cli/platform/index.js.map +1 -1
- package/dist/cli/vendor/index.d.ts +10 -13
- package/dist/cli/vendor/index.d.ts.map +1 -1
- package/dist/cli/vendor/index.js +30 -12
- package/dist/cli/vendor/index.js.map +1 -1
- package/dist/command/index.js +1 -1
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +27 -3
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +8 -11
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +27 -3
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +27 -3
- package/dist/core/index.native.js.map +1 -1
- package/dist/core/index.workerd.js +27 -3
- package/dist/core/index.workerd.js.map +1 -1
- package/dist/crypto/index.js.map +1 -1
- package/dist/datetime/index.d.ts +69 -10
- package/dist/datetime/index.d.ts.map +1 -1
- package/dist/datetime/index.js +135 -13
- package/dist/datetime/index.js.map +1 -1
- package/dist/email/core/index.js.map +1 -1
- package/dist/email/smtp/index.js +130 -16
- package/dist/email/smtp/index.js.map +1 -1
- package/dist/fake/index.js.map +1 -1
- package/dist/lock/core/index.d.ts +30 -2
- package/dist/lock/core/index.d.ts.map +1 -1
- package/dist/lock/core/index.js +35 -12
- package/dist/lock/core/index.js.map +1 -1
- package/dist/lock/redis/index.js.map +1 -1
- package/dist/logger/index.js +32 -1
- package/dist/logger/index.js.map +1 -1
- package/dist/mcp/index.d.ts +238 -31
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +198 -67
- package/dist/mcp/index.js.map +1 -1
- package/dist/orm/core/index.browser.js +2 -362
- package/dist/orm/core/index.browser.js.map +1 -1
- package/dist/orm/core/index.bun.js +18 -409
- package/dist/orm/core/index.bun.js.map +1 -1
- package/dist/orm/core/index.d.ts +41 -194
- package/dist/orm/core/index.d.ts.map +1 -1
- package/dist/orm/core/index.js +27 -422
- package/dist/orm/core/index.js.map +1 -1
- package/dist/orm/postgres/index.bun.js +17 -20
- package/dist/orm/postgres/index.bun.js.map +1 -1
- package/dist/orm/postgres/index.d.ts +1 -5
- package/dist/orm/postgres/index.d.ts.map +1 -1
- package/dist/orm/postgres/index.js +17 -20
- package/dist/orm/postgres/index.js.map +1 -1
- package/dist/react/core/index.d.ts +102 -1
- package/dist/react/core/index.d.ts.map +1 -1
- package/dist/react/core/index.js +65 -1
- package/dist/react/core/index.js.map +1 -1
- package/dist/react/form/index.d.ts +6 -0
- package/dist/react/form/index.d.ts.map +1 -1
- package/dist/react/form/index.js +7 -7
- package/dist/react/form/index.js.map +1 -1
- package/dist/react/i18n/index.d.ts +7 -1
- package/dist/react/i18n/index.d.ts.map +1 -1
- package/dist/react/i18n/index.js +6 -0
- package/dist/react/i18n/index.js.map +1 -1
- package/dist/react/intro/index.js +22 -17
- package/dist/react/intro/index.js.map +1 -1
- package/dist/react/router/index.browser.js +98 -4
- package/dist/react/router/index.browser.js.map +1 -1
- package/dist/react/router/index.d.ts +58 -5
- package/dist/react/router/index.d.ts.map +1 -1
- package/dist/react/router/index.js +122 -6
- package/dist/react/router/index.js.map +1 -1
- package/dist/react/testing/{chunk-DBEY4PJZ.js → chunk-6Ep1yQYe.js} +1 -1
- package/dist/react/testing/index.js +1 -1
- package/dist/react/testing/index.js.map +1 -1
- package/dist/react/ui/index.d.ts +195 -1
- package/dist/react/ui/index.d.ts.map +1 -1
- package/dist/react/ui/index.js +64 -1
- package/dist/react/ui/index.js.map +1 -1
- package/dist/react/websocket/index.js.map +1 -1
- package/dist/redis/index.js.map +1 -1
- package/dist/scheduler/index.d.ts +1 -2
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js +1 -1
- package/dist/scheduler/index.js.map +1 -1
- package/dist/scheduler/index.workerd.js +1 -1
- package/dist/scheduler/index.workerd.js.map +1 -1
- package/dist/security/index.browser.js.map +1 -1
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +2 -2
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.d.ts.map +1 -1
- package/dist/server/auth/index.js +24 -10
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/server/core/index.browser.js +10 -3
- package/dist/server/core/index.browser.js.map +1 -1
- package/dist/server/core/index.d.ts +1 -4
- package/dist/server/core/index.d.ts.map +1 -1
- package/dist/server/core/index.js +47 -9
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/links/index.browser.js.map +1 -1
- package/dist/server/links/index.js.map +1 -1
- package/dist/server/metrics/index.js +19 -1
- package/dist/server/metrics/index.js.map +1 -1
- package/dist/server/rate-limit/index.js.map +1 -1
- package/dist/server/static/index.js.map +1 -1
- package/dist/server/swagger/index.d.ts.map +1 -1
- package/dist/server/swagger/index.js +4 -5
- package/dist/server/swagger/index.js.map +1 -1
- package/dist/sms/index.js.map +1 -1
- package/dist/system/index.browser.js.map +1 -1
- package/dist/system/index.js.map +1 -1
- package/dist/system/index.workerd.js.map +1 -1
- package/dist/topic/core/index.js.map +1 -1
- package/dist/websocket/index.browser.js +32 -5
- package/dist/websocket/index.browser.js.map +1 -1
- package/dist/websocket/index.d.ts +3 -1
- package/dist/websocket/index.d.ts.map +1 -1
- package/dist/websocket/index.js +42 -6
- package/dist/websocket/index.js.map +1 -1
- package/package.json +685 -274
- package/src/api/files/__tests__/FileController.spec.ts +1 -1
- package/src/api/jobs/__tests__/$job.spec.ts +5 -1
- package/src/api/parameters/services/ParameterProvider.ts +21 -4
- package/src/api/users/__tests__/SessionService.spec.ts +99 -0
- package/src/api/users/__tests__/UserJobs.spec.ts +67 -0
- package/src/api/users/atoms/realmAuthSettingsAtom.ts +15 -0
- package/src/api/users/entities/sessions.ts +6 -0
- package/src/api/users/jobs/UserJobs.ts +44 -17
- package/src/api/users/providers/RealmProvider.ts +4 -0
- package/src/api/users/schemas/userQuerySchema.ts +0 -1
- package/src/api/users/services/SessionService.ts +27 -0
- package/src/api/users/services/UserService.ts +1 -5
- package/src/api/verifications/__tests__/CodeVerification.spec.ts +14 -0
- package/src/api/verifications/__tests__/LinkVerification.spec.ts +14 -0
- package/src/api/verifications/services/VerificationService.ts +1 -0
- package/src/bucket/__tests__/NodeS3BucketProvider.spec.ts +74 -0
- package/src/bucket/index.ts +19 -2
- package/src/bucket/primitives/$bucket.ts +9 -1
- package/src/bucket/providers/CloudflareR2Provider.ts +2 -137
- package/src/bucket/providers/NodeS3BucketProvider.ts +218 -0
- package/src/cache/core/index.ts +29 -0
- package/src/cache/core/primitives/$cache.ts +14 -1
- package/src/cli/config/defineConfig.ts +13 -15
- package/src/cli/core/__tests__/init.spec.ts +214 -7
- package/src/cli/core/commands/init.ts +12 -0
- package/src/cli/core/services/PackageManagerUtils.ts +23 -6
- package/src/cli/core/services/ProjectScaffolder.ts +315 -33
- package/src/cli/core/tasks/BuildCloudflareTask.ts +5 -0
- package/src/cli/core/tasks/BuildDockerTask.ts +9 -10
- package/src/cli/core/tasks/BuildServerTask.ts +8 -0
- package/src/cli/core/templates/agentMd.ts +2 -10
- package/src/cli/core/templates/apiIndexTs.ts +23 -1
- package/src/cli/core/templates/componentsJsonTs.ts +39 -0
- package/src/cli/core/templates/mainCss.ts +1 -0
- package/src/cli/core/templates/saasAdminLayoutTsx.ts +77 -0
- package/src/cli/core/templates/saasAdminPagesTsx.ts +26 -0
- package/src/cli/core/templates/saasAuthLayoutTsx.ts +20 -0
- package/src/cli/core/templates/saasAuthPagesTsx.ts +62 -0
- package/src/cli/core/templates/saasRealmProviderTs.ts +46 -0
- package/src/cli/core/templates/webAppRouterTs.ts +104 -1
- package/src/cli/core/templates/webIndexTs.ts +23 -1
- package/src/cli/devtools/index.ts +12 -26
- package/src/cli/platform/__tests__/SecretsCommand.spec.ts +2 -0
- package/src/cli/platform/index.ts +15 -24
- package/src/cli/vendor/atoms/vendorOptions.ts +1 -1
- package/src/cli/vendor/index.ts +14 -23
- package/src/command/providers/CliProvider.ts +1 -1
- package/src/core/Alepha.ts +11 -1
- package/src/core/helpers/ref.ts +18 -0
- package/src/core/index.shared.ts +1 -0
- package/src/core/interfaces/Service.ts +3 -1
- package/src/core/providers/SchemaValidator.ts +9 -1
- package/src/core/providers/TypeProvider.ts +2 -3
- package/src/datetime/REFACTORING.md +118 -0
- package/src/datetime/providers/DateTimeProvider.ts +203 -24
- package/src/lock/core/index.ts +31 -0
- package/src/lock/core/primitives/$lock.ts +14 -1
- package/src/logger/services/Logger.ts +1 -1
- package/src/mcp/__tests__/$resource.spec.ts +1 -1
- package/src/mcp/__tests__/$tool.spec.ts +1 -1
- package/src/mcp/__tests__/McpServerProvider.spec.ts +1 -1
- package/src/mcp/__tests__/jsonrpc.spec.ts +1 -1
- package/src/mcp/helpers/jsonrpc.ts +26 -1
- package/src/mcp/index.ts +10 -5
- package/src/mcp/interfaces/McpTypes.ts +83 -6
- package/src/mcp/primitives/$prompt.ts +18 -1
- package/src/mcp/primitives/$resource.ts +18 -1
- package/src/mcp/primitives/$tool.ts +83 -7
- package/src/mcp/providers/McpServerProvider.ts +74 -16
- package/src/mcp/transports/StreamableHttpMcpTransport.ts +226 -0
- package/src/orm/REFACTORING.md +330 -0
- package/src/orm/__tests__/$repository-tests.ts +1 -0
- package/src/orm/__tests__/orm-next-tests.ts +2 -67
- package/src/orm/__tests__/orm-next.spec.ts +0 -21
- package/src/orm/core/index.shared.ts +0 -2
- package/src/orm/core/index.ts +1 -2
- package/src/orm/core/primitives/$repository.ts +3 -6
- package/src/orm/core/primitives/$transactional.ts +11 -0
- package/src/orm/core/providers/drivers/DatabaseProvider.ts +0 -5
- package/src/orm/core/providers/drivers/NodeSqliteProvider.ts +11 -13
- package/src/orm/core/schemas/updateSchema.ts +1 -1
- package/src/orm/core/services/ModelBuilder.ts +1 -13
- package/src/orm/core/services/PgRelationManager.ts +4 -2
- package/src/orm/core/services/Repository.ts +1 -42
- package/src/orm/core/services/SqliteModelBuilder.ts +2 -33
- package/src/orm/postgres/services/PostgresModelBuilder.ts +10 -45
- package/src/react/core/__tests__/useQuery.browser.spec.tsx +86 -0
- package/src/react/core/hooks/useQuery.ts +153 -0
- package/src/react/core/index.ts +1 -0
- package/src/react/form/services/FormModel.ts +15 -6
- package/src/react/form/services/parseField.ts +8 -0
- package/src/react/i18n/providers/I18nProvider.ts +8 -2
- package/src/react/intro/components/GettingStartedAuthSlide.tsx +11 -4
- package/src/react/router/__tests__/$page.spec.tsx +0 -16
- package/src/react/router/__tests__/ReactBrowserProvider.browser.spec.ts +213 -2
- package/src/react/router/__tests__/ssr.spec.tsx +339 -0
- package/src/react/router/primitives/$page.ts +28 -4
- package/src/react/router/providers/ReactBrowserProvider.ts +73 -0
- package/src/react/router/providers/ReactBrowserRouterProvider.ts +1 -1
- package/src/react/router/providers/ReactPageProvider.ts +27 -9
- package/src/react/router/providers/ReactPreloadProvider.ts +1 -1
- package/src/react/router/providers/ReactServerProvider.ts +1 -0
- package/src/react/ui/atoms/uiThemeListAtom.ts +36 -0
- package/src/react/ui/index.ts +6 -0
- package/src/react/ui/services/SchemaControl.ts +209 -0
- package/src/scheduler/providers/CronProvider.ts +1 -1
- package/src/security/primitives/$basicAuth.ts +1 -1
- package/src/security/primitives/$issuer.ts +6 -3
- package/src/server/auth/providers/ServerAuthProvider.ts +5 -1
- package/src/server/core/__tests__/ServerRouterProvider-serializationError.spec.ts +75 -0
- package/src/server/core/__tests__/ServerRouterProvider-validationError.spec.ts +306 -0
- package/src/server/core/errors/ValidationError.ts +13 -1
- package/src/server/core/interfaces/ServerRequest.ts +1 -0
- package/src/server/core/primitives/$action.ts +16 -5
- package/src/server/core/providers/ServerProvider.ts +1 -1
- package/src/server/core/providers/ServerRouterProvider.ts +28 -6
- package/src/server/core/services/HttpClient.ts +1 -1
- package/src/server/swagger/providers/ServerSwaggerProvider.ts +6 -8
- package/src/websocket/providers/NodeWebSocketServerProvider.ts +10 -4
- package/src/websocket/services/WebSocketClient.ts +11 -5
- package/src/mcp/transports/SseMcpTransport.ts +0 -182
- package/src/orm/core/__tests__/parseQueryString.spec.ts +0 -196
- package/src/orm/core/helpers/parseQueryString.ts +0 -502
- package/src/orm/core/primitives/$view.ts +0 -88
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _$alepha from "alepha";
|
|
2
|
-
import { Alepha, AlephaError, Page, PageQuery, Primitive, Static, StaticEncode, TNull, TObject, TOptional, TSchema, TUnion } from "alepha";
|
|
2
|
+
import { Alepha, AlephaError, Page, PageQuery, Primitive, SchemaValidator, Static, StaticEncode, TNull, TObject, TOptional, TSchema, TUnion } from "alepha";
|
|
3
3
|
import { AuditService, CreateAudit } from "alepha/api/audits";
|
|
4
4
|
import * as _$alepha_bucket0 from "alepha/bucket";
|
|
5
5
|
import { CryptoProvider, IssuerPrimitive, IssuerPrimitiveOptions, UserAccount } from "alepha/security";
|
|
@@ -71,9 +71,112 @@ declare const realmAuthSettingsAtom: _$alepha.Atom<_$alepha.TObject<{
|
|
|
71
71
|
accountMaxAttempts: _$alepha.TInteger;
|
|
72
72
|
windowMs: _$alepha.TInteger;
|
|
73
73
|
}>;
|
|
74
|
+
refreshToken: _$alepha.TObject<{
|
|
75
|
+
expirationIdle: _$alepha.TOptional<_$alepha.TInteger>;
|
|
76
|
+
}>;
|
|
74
77
|
}>, "alepha.api.users.realmAuthSettings">;
|
|
75
78
|
type RealmAuthSettings = Static<typeof realmAuthSettingsAtom.schema>;
|
|
76
79
|
//#endregion
|
|
80
|
+
//#region ../../src/api/users/audits/UserAudits.d.ts
|
|
81
|
+
type AuditContext = Omit<CreateAudit, "type" | "action">;
|
|
82
|
+
/**
|
|
83
|
+
* User-specific audit wrapper service.
|
|
84
|
+
*
|
|
85
|
+
* This service wraps the core AuditService to provide user-related audit logging.
|
|
86
|
+
*
|
|
87
|
+
* Declared as a module variant — not auto-injected. It is instantiated
|
|
88
|
+
* lazily the first time something calls `alepha.inject(UserAudits)`.
|
|
89
|
+
*/
|
|
90
|
+
declare class UserAudits {
|
|
91
|
+
protected readonly auditService: AuditService;
|
|
92
|
+
/**
|
|
93
|
+
* Record a user-related audit event.
|
|
94
|
+
*/
|
|
95
|
+
recordUser(action: "create" | "update" | "delete" | "role_change" | "enable" | "disable", context: AuditContext): Promise<{
|
|
96
|
+
description?: string | undefined;
|
|
97
|
+
userId?: string | undefined;
|
|
98
|
+
userRealm?: string | undefined;
|
|
99
|
+
userEmail?: string | undefined;
|
|
100
|
+
resourceType?: string | undefined;
|
|
101
|
+
resourceId?: string | undefined;
|
|
102
|
+
metadata?: Record<string, any> | undefined;
|
|
103
|
+
ipAddress?: string | undefined;
|
|
104
|
+
userAgent?: string | undefined;
|
|
105
|
+
sessionId?: string | undefined;
|
|
106
|
+
requestId?: string | undefined;
|
|
107
|
+
errorMessage?: string | undefined;
|
|
108
|
+
type: string;
|
|
109
|
+
id: string;
|
|
110
|
+
createdAt: string;
|
|
111
|
+
action: string;
|
|
112
|
+
severity: "info" | "warning" | "critical";
|
|
113
|
+
success: boolean;
|
|
114
|
+
}>;
|
|
115
|
+
/**
|
|
116
|
+
* Record an authentication-related audit event.
|
|
117
|
+
*/
|
|
118
|
+
recordAuth(action: "login" | "logout" | "login_failed" | "token_refresh", context: AuditContext): Promise<{
|
|
119
|
+
description?: string | undefined;
|
|
120
|
+
userId?: string | undefined;
|
|
121
|
+
userRealm?: string | undefined;
|
|
122
|
+
userEmail?: string | undefined;
|
|
123
|
+
resourceType?: string | undefined;
|
|
124
|
+
resourceId?: string | undefined;
|
|
125
|
+
metadata?: Record<string, any> | undefined;
|
|
126
|
+
ipAddress?: string | undefined;
|
|
127
|
+
userAgent?: string | undefined;
|
|
128
|
+
sessionId?: string | undefined;
|
|
129
|
+
requestId?: string | undefined;
|
|
130
|
+
errorMessage?: string | undefined;
|
|
131
|
+
type: string;
|
|
132
|
+
id: string;
|
|
133
|
+
createdAt: string;
|
|
134
|
+
action: string;
|
|
135
|
+
severity: "info" | "warning" | "critical";
|
|
136
|
+
success: boolean;
|
|
137
|
+
}>;
|
|
138
|
+
/**
|
|
139
|
+
* Record a generic audit event.
|
|
140
|
+
*/
|
|
141
|
+
record(category: string, action: string, context: AuditContext): Promise<{
|
|
142
|
+
description?: string | undefined;
|
|
143
|
+
userId?: string | undefined;
|
|
144
|
+
userRealm?: string | undefined;
|
|
145
|
+
userEmail?: string | undefined;
|
|
146
|
+
resourceType?: string | undefined;
|
|
147
|
+
resourceId?: string | undefined;
|
|
148
|
+
metadata?: Record<string, any> | undefined;
|
|
149
|
+
ipAddress?: string | undefined;
|
|
150
|
+
userAgent?: string | undefined;
|
|
151
|
+
sessionId?: string | undefined;
|
|
152
|
+
requestId?: string | undefined;
|
|
153
|
+
errorMessage?: string | undefined;
|
|
154
|
+
type: string;
|
|
155
|
+
id: string;
|
|
156
|
+
createdAt: string;
|
|
157
|
+
action: string;
|
|
158
|
+
severity: "info" | "warning" | "critical";
|
|
159
|
+
success: boolean;
|
|
160
|
+
}>;
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region ../../src/api/users/buckets/UserBuckets.d.ts
|
|
164
|
+
/**
|
|
165
|
+
* User-specific file storage wrapper service.
|
|
166
|
+
*
|
|
167
|
+
* This service provides file storage for user-related files such as:
|
|
168
|
+
* - User avatars/profile pictures
|
|
169
|
+
*
|
|
170
|
+
* Declared as a module variant — not auto-injected. It is instantiated
|
|
171
|
+
* lazily the first time something calls `alepha.inject(UserBuckets)`.
|
|
172
|
+
*/
|
|
173
|
+
declare class UserBuckets {
|
|
174
|
+
/**
|
|
175
|
+
* Bucket for user avatar storage.
|
|
176
|
+
*/
|
|
177
|
+
readonly avatars: _$alepha_bucket0.BucketPrimitive;
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
77
180
|
//#region ../../src/orm/core/schemas/insertSchema.d.ts
|
|
78
181
|
/**
|
|
79
182
|
* Transforms a TObject schema for insert operations.
|
|
@@ -355,6 +458,19 @@ declare class DbError extends AlephaError {
|
|
|
355
458
|
constructor(message: string, cause?: unknown);
|
|
356
459
|
}
|
|
357
460
|
//#endregion
|
|
461
|
+
//#region ../../src/orm/core/helpers/pgAttr.d.ts
|
|
462
|
+
/**
|
|
463
|
+
* Type representation.
|
|
464
|
+
*/
|
|
465
|
+
type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
|
|
466
|
+
interface PgAttrField {
|
|
467
|
+
key: string;
|
|
468
|
+
type: TSchema;
|
|
469
|
+
data: any;
|
|
470
|
+
nested?: any[];
|
|
471
|
+
one?: boolean;
|
|
472
|
+
}
|
|
473
|
+
//#endregion
|
|
358
474
|
//#region ../../src/orm/core/interfaces/FilterOperators.d.ts
|
|
359
475
|
interface FilterOperators<TValue> {
|
|
360
476
|
/**
|
|
@@ -901,19 +1017,6 @@ type PgQueryWhereConditions<T extends TObject, Relations extends PgRelationMap<T
|
|
|
901
1017
|
};
|
|
902
1018
|
type PgQueryWhereRelations<Relations extends PgRelationMap<TObject> | undefined = undefined> = Relations extends PgRelationMap<TObject> ? { [K in keyof Relations]?: PgQueryWhere<Relations[K]["join"]["schema"], Relations[K]["with"]> } : {};
|
|
903
1019
|
//#endregion
|
|
904
|
-
//#region ../../src/orm/core/helpers/pgAttr.d.ts
|
|
905
|
-
/**
|
|
906
|
-
* Type representation.
|
|
907
|
-
*/
|
|
908
|
-
type PgAttr<T extends TSchema, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
|
|
909
|
-
interface PgAttrField {
|
|
910
|
-
key: string;
|
|
911
|
-
type: TSchema;
|
|
912
|
-
data: any;
|
|
913
|
-
nested?: any[];
|
|
914
|
-
one?: boolean;
|
|
915
|
-
}
|
|
916
|
-
//#endregion
|
|
917
1020
|
//#region ../../src/orm/core/interfaces/AggregateQuery.d.ts
|
|
918
1021
|
type AggregateOp = "count" | "sum" | "avg" | "min" | "max";
|
|
919
1022
|
/**
|
|
@@ -985,35 +1088,6 @@ interface AggregateQuery<T extends TObject, S extends AggregateSelect<T>> {
|
|
|
985
1088
|
offset?: number;
|
|
986
1089
|
}
|
|
987
1090
|
//#endregion
|
|
988
|
-
//#region ../../src/orm/core/primitives/$view.d.ts
|
|
989
|
-
interface ViewPrimitiveOptions<T extends TObject> {
|
|
990
|
-
/**
|
|
991
|
-
* The database view name.
|
|
992
|
-
*/
|
|
993
|
-
name: string;
|
|
994
|
-
/**
|
|
995
|
-
* TypeBox schema defining the view's columns.
|
|
996
|
-
*/
|
|
997
|
-
schema: T;
|
|
998
|
-
/**
|
|
999
|
-
* SQL query that defines the view.
|
|
1000
|
-
*/
|
|
1001
|
-
query: SQL;
|
|
1002
|
-
/**
|
|
1003
|
-
* Whether this is a materialized view (PostgreSQL only).
|
|
1004
|
-
* Materialized views store results on disk and can be refreshed.
|
|
1005
|
-
*/
|
|
1006
|
-
materialized?: boolean;
|
|
1007
|
-
}
|
|
1008
|
-
declare class ViewPrimitive<T extends TObject = TObject> {
|
|
1009
|
-
readonly options: ViewPrimitiveOptions<T>;
|
|
1010
|
-
readonly isView = true;
|
|
1011
|
-
constructor(options: ViewPrimitiveOptions<T>);
|
|
1012
|
-
get name(): string;
|
|
1013
|
-
get schema(): T;
|
|
1014
|
-
get materialized(): boolean;
|
|
1015
|
-
}
|
|
1016
|
-
//#endregion
|
|
1017
1091
|
//#region ../../src/orm/core/providers/DbCacheProvider.d.ts
|
|
1018
1092
|
/**
|
|
1019
1093
|
* Database query cache using a simple in-memory Map.
|
|
@@ -1097,13 +1171,6 @@ declare abstract class ModelBuilder {
|
|
|
1097
1171
|
schemas: Map<string, unknown>;
|
|
1098
1172
|
schema: string;
|
|
1099
1173
|
}): void;
|
|
1100
|
-
/**
|
|
1101
|
-
* Build a view from a view primitive.
|
|
1102
|
-
*/
|
|
1103
|
-
abstract buildView(view: ViewPrimitive, options: {
|
|
1104
|
-
tables: Map<string, unknown>;
|
|
1105
|
-
schema: string;
|
|
1106
|
-
}): void;
|
|
1107
1174
|
/**
|
|
1108
1175
|
* Build a sequence from a sequence primitive.
|
|
1109
1176
|
*/
|
|
@@ -6126,7 +6193,6 @@ declare abstract class DatabaseProvider {
|
|
|
6126
6193
|
protected parseOperation(sql: string): string;
|
|
6127
6194
|
table<T extends TObject>(entity: EntityPrimitive<T>): PgTableWithColumns<SchemaToTableConfig<T>>;
|
|
6128
6195
|
registerEntity(entity: EntityPrimitive): void;
|
|
6129
|
-
registerView(view: ViewPrimitive): void;
|
|
6130
6196
|
registerSequence(sequence: SequencePrimitive): void;
|
|
6131
6197
|
/**
|
|
6132
6198
|
* Rebuild all models into fresh maps using a different schema.
|
|
@@ -6255,6 +6321,7 @@ interface PgJoin {
|
|
|
6255
6321
|
//#endregion
|
|
6256
6322
|
//#region ../../src/orm/core/services/PgRelationManager.d.ts
|
|
6257
6323
|
declare class PgRelationManager {
|
|
6324
|
+
protected readonly schemaValidator: SchemaValidator;
|
|
6258
6325
|
/**
|
|
6259
6326
|
* Recursively build joins for the query builder based on the relations map
|
|
6260
6327
|
*/
|
|
@@ -6305,10 +6372,6 @@ declare abstract class Repository$1<T extends TObject> {
|
|
|
6305
6372
|
* Get SQL table name. (from Drizzle table object)
|
|
6306
6373
|
*/
|
|
6307
6374
|
get tableName(): string;
|
|
6308
|
-
/**
|
|
6309
|
-
* Whether this repository is backed by a view (read-only).
|
|
6310
|
-
*/
|
|
6311
|
-
get isReadOnly(): boolean;
|
|
6312
6375
|
/**
|
|
6313
6376
|
* Getter for the database connection from the database provider.
|
|
6314
6377
|
*
|
|
@@ -6583,14 +6646,6 @@ declare abstract class Repository$1<T extends TObject> {
|
|
|
6583
6646
|
* Clean a row with joins recursively
|
|
6584
6647
|
*/
|
|
6585
6648
|
protected cleanWithJoins<T extends TObject>(row: Record<string, unknown>, schema: T, joins: PgJoin[], parentPath?: string): Static<T>;
|
|
6586
|
-
/**
|
|
6587
|
-
* Throw if this repository is read-only (backed by a view).
|
|
6588
|
-
*/
|
|
6589
|
-
protected assertWritable(): void;
|
|
6590
|
-
/**
|
|
6591
|
-
* Refresh a materialized view. PostgreSQL only.
|
|
6592
|
-
*/
|
|
6593
|
-
refresh(): Promise<void>;
|
|
6594
6649
|
/**
|
|
6595
6650
|
* Build a cache key from method name and query parameters.
|
|
6596
6651
|
*/
|
|
@@ -6695,163 +6750,6 @@ declare module "alepha" {
|
|
|
6695
6750
|
interface Env extends Partial<Static<typeof databaseEnvSchema>> {}
|
|
6696
6751
|
} //# sourceMappingURL=databaseEnvSchema.d.ts.map
|
|
6697
6752
|
//#endregion
|
|
6698
|
-
//#region ../../src/api/users/audits/UserAudits.d.ts
|
|
6699
|
-
type AuditContext = Omit<CreateAudit, "type" | "action">;
|
|
6700
|
-
/**
|
|
6701
|
-
* User-specific audit wrapper service.
|
|
6702
|
-
*
|
|
6703
|
-
* This service wraps the core AuditService to provide user-related audit logging.
|
|
6704
|
-
*
|
|
6705
|
-
* Declared as a module variant — not auto-injected. It is instantiated
|
|
6706
|
-
* lazily the first time something calls `alepha.inject(UserAudits)`.
|
|
6707
|
-
*/
|
|
6708
|
-
declare class UserAudits {
|
|
6709
|
-
protected readonly auditService: AuditService;
|
|
6710
|
-
/**
|
|
6711
|
-
* Record a user-related audit event.
|
|
6712
|
-
*/
|
|
6713
|
-
recordUser(action: "create" | "update" | "delete" | "role_change" | "enable" | "disable", context: AuditContext): Promise<{
|
|
6714
|
-
description?: string | undefined;
|
|
6715
|
-
userId?: string | undefined;
|
|
6716
|
-
userRealm?: string | undefined;
|
|
6717
|
-
userEmail?: string | undefined;
|
|
6718
|
-
resourceType?: string | undefined;
|
|
6719
|
-
resourceId?: string | undefined;
|
|
6720
|
-
metadata?: _$typebox.StaticRecord<[], "Decode", {}, {
|
|
6721
|
-
id: PgAttr<PgAttr<_$alepha.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
6722
|
-
createdAt: PgAttr<PgAttr<_$alepha.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
6723
|
-
type: _$alepha.TString;
|
|
6724
|
-
action: _$alepha.TString;
|
|
6725
|
-
severity: PgAttr<_$alepha.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
6726
|
-
userId: _$alepha.TOptional<_$alepha.TString>;
|
|
6727
|
-
userRealm: _$alepha.TOptional<_$alepha.TString>;
|
|
6728
|
-
userEmail: _$alepha.TOptional<_$alepha.TString>;
|
|
6729
|
-
resourceType: _$alepha.TOptional<_$alepha.TString>;
|
|
6730
|
-
resourceId: _$alepha.TOptional<_$alepha.TString>;
|
|
6731
|
-
description: _$alepha.TOptional<_$alepha.TString>;
|
|
6732
|
-
metadata: _$alepha.TOptional<_$alepha.TRecord<string, _$alepha.TAny>>;
|
|
6733
|
-
ipAddress: _$alepha.TOptional<_$alepha.TString>;
|
|
6734
|
-
userAgent: _$alepha.TOptional<_$alepha.TString>;
|
|
6735
|
-
sessionId: _$alepha.TOptional<_$alepha.TString>;
|
|
6736
|
-
requestId: _$alepha.TOptional<_$alepha.TString>;
|
|
6737
|
-
success: PgAttr<_$alepha.TBoolean, typeof PG_DEFAULT>;
|
|
6738
|
-
errorMessage: _$alepha.TOptional<_$alepha.TString>;
|
|
6739
|
-
}, string, _$alepha.TAny> | undefined;
|
|
6740
|
-
ipAddress?: string | undefined;
|
|
6741
|
-
userAgent?: string | undefined;
|
|
6742
|
-
sessionId?: string | undefined;
|
|
6743
|
-
requestId?: string | undefined;
|
|
6744
|
-
errorMessage?: string | undefined;
|
|
6745
|
-
type: string;
|
|
6746
|
-
id: string;
|
|
6747
|
-
createdAt: string;
|
|
6748
|
-
action: string;
|
|
6749
|
-
severity: "info" | "warning" | "critical";
|
|
6750
|
-
success: boolean;
|
|
6751
|
-
}>;
|
|
6752
|
-
/**
|
|
6753
|
-
* Record an authentication-related audit event.
|
|
6754
|
-
*/
|
|
6755
|
-
recordAuth(action: "login" | "logout" | "login_failed" | "token_refresh", context: AuditContext): Promise<{
|
|
6756
|
-
description?: string | undefined;
|
|
6757
|
-
userId?: string | undefined;
|
|
6758
|
-
userRealm?: string | undefined;
|
|
6759
|
-
userEmail?: string | undefined;
|
|
6760
|
-
resourceType?: string | undefined;
|
|
6761
|
-
resourceId?: string | undefined;
|
|
6762
|
-
metadata?: _$typebox.StaticRecord<[], "Decode", {}, {
|
|
6763
|
-
id: PgAttr<PgAttr<_$alepha.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
6764
|
-
createdAt: PgAttr<PgAttr<_$alepha.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
6765
|
-
type: _$alepha.TString;
|
|
6766
|
-
action: _$alepha.TString;
|
|
6767
|
-
severity: PgAttr<_$alepha.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
6768
|
-
userId: _$alepha.TOptional<_$alepha.TString>;
|
|
6769
|
-
userRealm: _$alepha.TOptional<_$alepha.TString>;
|
|
6770
|
-
userEmail: _$alepha.TOptional<_$alepha.TString>;
|
|
6771
|
-
resourceType: _$alepha.TOptional<_$alepha.TString>;
|
|
6772
|
-
resourceId: _$alepha.TOptional<_$alepha.TString>;
|
|
6773
|
-
description: _$alepha.TOptional<_$alepha.TString>;
|
|
6774
|
-
metadata: _$alepha.TOptional<_$alepha.TRecord<string, _$alepha.TAny>>;
|
|
6775
|
-
ipAddress: _$alepha.TOptional<_$alepha.TString>;
|
|
6776
|
-
userAgent: _$alepha.TOptional<_$alepha.TString>;
|
|
6777
|
-
sessionId: _$alepha.TOptional<_$alepha.TString>;
|
|
6778
|
-
requestId: _$alepha.TOptional<_$alepha.TString>;
|
|
6779
|
-
success: PgAttr<_$alepha.TBoolean, typeof PG_DEFAULT>;
|
|
6780
|
-
errorMessage: _$alepha.TOptional<_$alepha.TString>;
|
|
6781
|
-
}, string, _$alepha.TAny> | undefined;
|
|
6782
|
-
ipAddress?: string | undefined;
|
|
6783
|
-
userAgent?: string | undefined;
|
|
6784
|
-
sessionId?: string | undefined;
|
|
6785
|
-
requestId?: string | undefined;
|
|
6786
|
-
errorMessage?: string | undefined;
|
|
6787
|
-
type: string;
|
|
6788
|
-
id: string;
|
|
6789
|
-
createdAt: string;
|
|
6790
|
-
action: string;
|
|
6791
|
-
severity: "info" | "warning" | "critical";
|
|
6792
|
-
success: boolean;
|
|
6793
|
-
}>;
|
|
6794
|
-
/**
|
|
6795
|
-
* Record a generic audit event.
|
|
6796
|
-
*/
|
|
6797
|
-
record(category: string, action: string, context: AuditContext): Promise<{
|
|
6798
|
-
description?: string | undefined;
|
|
6799
|
-
userId?: string | undefined;
|
|
6800
|
-
userRealm?: string | undefined;
|
|
6801
|
-
userEmail?: string | undefined;
|
|
6802
|
-
resourceType?: string | undefined;
|
|
6803
|
-
resourceId?: string | undefined;
|
|
6804
|
-
metadata?: _$typebox.StaticRecord<[], "Decode", {}, {
|
|
6805
|
-
id: PgAttr<PgAttr<_$alepha.TString, typeof PG_PRIMARY_KEY>, typeof PG_DEFAULT>;
|
|
6806
|
-
createdAt: PgAttr<PgAttr<_$alepha.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
6807
|
-
type: _$alepha.TString;
|
|
6808
|
-
action: _$alepha.TString;
|
|
6809
|
-
severity: PgAttr<_$alepha.TUnsafe<"info" | "warning" | "critical">, typeof PG_DEFAULT>;
|
|
6810
|
-
userId: _$alepha.TOptional<_$alepha.TString>;
|
|
6811
|
-
userRealm: _$alepha.TOptional<_$alepha.TString>;
|
|
6812
|
-
userEmail: _$alepha.TOptional<_$alepha.TString>;
|
|
6813
|
-
resourceType: _$alepha.TOptional<_$alepha.TString>;
|
|
6814
|
-
resourceId: _$alepha.TOptional<_$alepha.TString>;
|
|
6815
|
-
description: _$alepha.TOptional<_$alepha.TString>;
|
|
6816
|
-
metadata: _$alepha.TOptional<_$alepha.TRecord<string, _$alepha.TAny>>;
|
|
6817
|
-
ipAddress: _$alepha.TOptional<_$alepha.TString>;
|
|
6818
|
-
userAgent: _$alepha.TOptional<_$alepha.TString>;
|
|
6819
|
-
sessionId: _$alepha.TOptional<_$alepha.TString>;
|
|
6820
|
-
requestId: _$alepha.TOptional<_$alepha.TString>;
|
|
6821
|
-
success: PgAttr<_$alepha.TBoolean, typeof PG_DEFAULT>;
|
|
6822
|
-
errorMessage: _$alepha.TOptional<_$alepha.TString>;
|
|
6823
|
-
}, string, _$alepha.TAny> | undefined;
|
|
6824
|
-
ipAddress?: string | undefined;
|
|
6825
|
-
userAgent?: string | undefined;
|
|
6826
|
-
sessionId?: string | undefined;
|
|
6827
|
-
requestId?: string | undefined;
|
|
6828
|
-
errorMessage?: string | undefined;
|
|
6829
|
-
type: string;
|
|
6830
|
-
id: string;
|
|
6831
|
-
createdAt: string;
|
|
6832
|
-
action: string;
|
|
6833
|
-
severity: "info" | "warning" | "critical";
|
|
6834
|
-
success: boolean;
|
|
6835
|
-
}>;
|
|
6836
|
-
}
|
|
6837
|
-
//#endregion
|
|
6838
|
-
//#region ../../src/api/users/buckets/UserBuckets.d.ts
|
|
6839
|
-
/**
|
|
6840
|
-
* User-specific file storage wrapper service.
|
|
6841
|
-
*
|
|
6842
|
-
* This service provides file storage for user-related files such as:
|
|
6843
|
-
* - User avatars/profile pictures
|
|
6844
|
-
*
|
|
6845
|
-
* Declared as a module variant — not auto-injected. It is instantiated
|
|
6846
|
-
* lazily the first time something calls `alepha.inject(UserBuckets)`.
|
|
6847
|
-
*/
|
|
6848
|
-
declare class UserBuckets {
|
|
6849
|
-
/**
|
|
6850
|
-
* Bucket for user avatar storage.
|
|
6851
|
-
*/
|
|
6852
|
-
readonly avatars: _$alepha_bucket0.BucketPrimitive;
|
|
6853
|
-
}
|
|
6854
|
-
//#endregion
|
|
6855
6753
|
//#region ../../src/api/users/entities/identities.d.ts
|
|
6856
6754
|
declare const identities: _$alepha_orm0.EntityPrimitive<_$alepha.TObject<{
|
|
6857
6755
|
id: _$alepha_orm0.PgAttr<_$alepha_orm0.PgAttr<_$alepha.TString, typeof _$alepha_orm0.PG_PRIMARY_KEY>, typeof _$alepha_orm0.PG_DEFAULT>;
|
|
@@ -6875,6 +6773,12 @@ declare const sessions: _$alepha_orm0.EntityPrimitive<_$alepha.TObject<{
|
|
|
6875
6773
|
refreshToken: _$alepha.TString;
|
|
6876
6774
|
userId: _$alepha_orm0.PgAttr<_$alepha.TString, typeof _$alepha_orm0.PG_REF>;
|
|
6877
6775
|
expiresAt: _$alepha.TString;
|
|
6776
|
+
/**
|
|
6777
|
+
* Last time the session was used to refresh an access token.
|
|
6778
|
+
* Used by realm `refreshToken.expirationIdle` to invalidate idle sessions.
|
|
6779
|
+
* `null` on existing rows pre-migration — falls back to `createdAt`.
|
|
6780
|
+
*/
|
|
6781
|
+
lastUsedAt: _$alepha.TOptional<_$alepha.TString>;
|
|
6878
6782
|
ip: _$alepha.TOptional<_$alepha.TString>;
|
|
6879
6783
|
userAgent: _$alepha.TOptional<_$alepha.TObject<{
|
|
6880
6784
|
os: _$alepha.TString;
|
|
@@ -7047,6 +6951,7 @@ declare class RealmProvider {
|
|
|
7047
6951
|
refreshToken: _$alepha.TString;
|
|
7048
6952
|
userId: _$alepha_orm0.PgAttr<_$alepha.TString, typeof _$alepha_orm0.PG_REF>;
|
|
7049
6953
|
expiresAt: _$alepha.TString;
|
|
6954
|
+
lastUsedAt: _$alepha.TOptional<_$alepha.TString>;
|
|
7050
6955
|
ip: _$alepha.TOptional<_$alepha.TString>;
|
|
7051
6956
|
userAgent: _$alepha.TOptional<_$alepha.TObject<{
|
|
7052
6957
|
os: _$alepha.TString;
|
|
@@ -7211,6 +7116,7 @@ declare class SessionCrudService {
|
|
|
7211
7116
|
refreshToken: _$alepha.TString;
|
|
7212
7117
|
userId: _$alepha_orm0.PgAttr<_$alepha.TString, typeof _$alepha_orm0.PG_REF>;
|
|
7213
7118
|
expiresAt: _$alepha.TString;
|
|
7119
|
+
lastUsedAt: _$alepha.TOptional<_$alepha.TString>;
|
|
7214
7120
|
ip: _$alepha.TOptional<_$alepha.TString>;
|
|
7215
7121
|
userAgent: _$alepha.TOptional<_$alepha.TObject<{
|
|
7216
7122
|
os: _$alepha.TString;
|
|
@@ -7351,7 +7257,7 @@ declare const createUserSchema: _$alepha.TObject<{
|
|
|
7351
7257
|
createdAt: _$alepha.TOptional<PgAttr<PgAttr<_$alepha.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>>;
|
|
7352
7258
|
updatedAt: _$alepha.TOptional<PgAttr<PgAttr<_$alepha.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>>;
|
|
7353
7259
|
username: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
7354
|
-
roles: _$alepha.TOptional<_$alepha.TArray<_$alepha.TString>>;
|
|
7260
|
+
roles: _$alepha.TOptional<PgAttr<_$alepha.TArray<_$alepha.TString>, typeof PG_DEFAULT>>;
|
|
7355
7261
|
firstName: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
7356
7262
|
lastName: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
7357
7263
|
picture: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
@@ -7366,7 +7272,7 @@ declare const updateUserSchema: _$alepha.TObject<{
|
|
|
7366
7272
|
email: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
7367
7273
|
phoneNumber: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
7368
7274
|
realm: _$alepha.TOptional<PgAttr<_$alepha.TString, typeof PG_DEFAULT>>;
|
|
7369
|
-
roles: _$alepha.TOptional<_$alepha.TArray<_$alepha.TString>>;
|
|
7275
|
+
roles: _$alepha.TOptional<PgAttr<_$alepha.TArray<_$alepha.TString>, typeof PG_DEFAULT>>;
|
|
7370
7276
|
firstName: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
7371
7277
|
lastName: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
7372
7278
|
picture: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
@@ -7383,7 +7289,6 @@ declare const userQuerySchema: _$alepha.TObject<{
|
|
|
7383
7289
|
enabled: _$alepha.TOptional<_$alepha.TBoolean>;
|
|
7384
7290
|
emailVerified: _$alepha.TOptional<_$alepha.TBoolean>;
|
|
7385
7291
|
roles: _$alepha.TOptional<_$alepha.TArray<_$alepha.TString>>;
|
|
7386
|
-
query: _$alepha.TOptional<_$alepha.TString>;
|
|
7387
7292
|
}>;
|
|
7388
7293
|
type UserQuery = Static<typeof userQuerySchema>;
|
|
7389
7294
|
//#endregion
|
|
@@ -7468,7 +7373,6 @@ declare class AdminUserController {
|
|
|
7468
7373
|
enabled: _$alepha.TOptional<_$alepha.TBoolean>;
|
|
7469
7374
|
emailVerified: _$alepha.TOptional<_$alepha.TBoolean>;
|
|
7470
7375
|
roles: _$alepha.TOptional<_$alepha.TArray<_$alepha.TString>>;
|
|
7471
|
-
query: _$alepha.TOptional<_$alepha.TString>;
|
|
7472
7376
|
userRealmName: _$alepha.TOptional<_$alepha.TString>;
|
|
7473
7377
|
}>;
|
|
7474
7378
|
response: _$alepha.TPage<_$alepha.TObject<{
|
|
@@ -7533,7 +7437,7 @@ declare class AdminUserController {
|
|
|
7533
7437
|
createdAt: _$alepha.TOptional<PgAttr<PgAttr<_$alepha.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>>;
|
|
7534
7438
|
updatedAt: _$alepha.TOptional<PgAttr<PgAttr<_$alepha.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>>;
|
|
7535
7439
|
username: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
7536
|
-
roles: _$alepha.TOptional<_$alepha.TArray<_$alepha.TString>>;
|
|
7440
|
+
roles: _$alepha.TOptional<PgAttr<_$alepha.TArray<_$alepha.TString>, typeof PG_DEFAULT>>;
|
|
7537
7441
|
firstName: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
7538
7442
|
lastName: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
7539
7443
|
picture: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
@@ -7573,7 +7477,7 @@ declare class AdminUserController {
|
|
|
7573
7477
|
email: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
7574
7478
|
phoneNumber: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
7575
7479
|
realm: _$alepha.TOptional<PgAttr<_$alepha.TString, typeof PG_DEFAULT>>;
|
|
7576
|
-
roles: _$alepha.TOptional<_$alepha.TArray<_$alepha.TString>>;
|
|
7480
|
+
roles: _$alepha.TOptional<PgAttr<_$alepha.TArray<_$alepha.TString>, typeof PG_DEFAULT>>;
|
|
7577
7481
|
firstName: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
7578
7482
|
lastName: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
7579
7483
|
picture: _$alepha.TOptional<_$alepha.TOptional<_$alepha.TString>>;
|
|
@@ -7665,6 +7569,9 @@ declare class RealmController {
|
|
|
7665
7569
|
accountMaxAttempts: _$alepha.TInteger;
|
|
7666
7570
|
windowMs: _$alepha.TInteger;
|
|
7667
7571
|
}>;
|
|
7572
|
+
refreshToken: _$alepha.TObject<{
|
|
7573
|
+
expirationIdle: _$alepha.TOptional<_$alepha.TInteger>;
|
|
7574
|
+
}>;
|
|
7668
7575
|
}>;
|
|
7669
7576
|
realmName: _$alepha.TString;
|
|
7670
7577
|
authenticationMethods: _$alepha.TArray<_$alepha.TObject<{
|
|
@@ -7760,6 +7667,7 @@ declare class CredentialService {
|
|
|
7760
7667
|
refreshToken: _$alepha.TString;
|
|
7761
7668
|
userId: PgAttr<_$alepha.TString, typeof PG_REF>;
|
|
7762
7669
|
expiresAt: _$alepha.TString;
|
|
7670
|
+
lastUsedAt: _$alepha.TOptional<_$alepha.TString>;
|
|
7763
7671
|
ip: _$alepha.TOptional<_$alepha.TString>;
|
|
7764
7672
|
userAgent: _$alepha.TOptional<_$alepha.TObject<{
|
|
7765
7673
|
os: _$alepha.TString;
|
|
@@ -8138,6 +8046,7 @@ declare class UserJobs {
|
|
|
8138
8046
|
refreshToken: _$alepha.TString;
|
|
8139
8047
|
userId: _$alepha_orm0.PgAttr<_$alepha.TString, typeof _$alepha_orm0.PG_REF>;
|
|
8140
8048
|
expiresAt: _$alepha.TString;
|
|
8049
|
+
lastUsedAt: _$alepha.TOptional<_$alepha.TString>;
|
|
8141
8050
|
ip: _$alepha.TOptional<_$alepha.TString>;
|
|
8142
8051
|
userAgent: _$alepha.TOptional<_$alepha.TObject<{
|
|
8143
8052
|
os: _$alepha.TString;
|
|
@@ -8145,10 +8054,18 @@ declare class UserJobs {
|
|
|
8145
8054
|
device: _$alepha.TUnsafe<"MOBILE" | "DESKTOP" | "TABLET">;
|
|
8146
8055
|
}>>;
|
|
8147
8056
|
}>>;
|
|
8057
|
+
protected readonly realmProvider: RealmProvider;
|
|
8148
8058
|
/**
|
|
8149
8059
|
* Purge expired sessions from the database.
|
|
8150
8060
|
*
|
|
8151
|
-
* Runs hourly (at :00) and deletes
|
|
8061
|
+
* Runs hourly (at :00) and deletes:
|
|
8062
|
+
* - sessions whose absolute `expiresAt` has passed
|
|
8063
|
+
* - sessions whose `lastUsedAt` exceeds the realm's `refreshToken.expirationIdle`
|
|
8064
|
+
* (when configured). Falls back to `createdAt` for sessions without a
|
|
8065
|
+
* recorded `lastUsedAt`.
|
|
8066
|
+
*
|
|
8067
|
+
* The idle sweep is best-effort cleanup — runtime enforcement happens in
|
|
8068
|
+
* `SessionService.refreshSession()`.
|
|
8152
8069
|
*/
|
|
8153
8070
|
readonly purgeExpiredSessions: _$alepha_api_jobs0.JobPrimitive<_$alepha.TSchema>;
|
|
8154
8071
|
}
|
|
@@ -8205,6 +8122,9 @@ declare const realmConfigSchema: _$alepha.TObject<{
|
|
|
8205
8122
|
accountMaxAttempts: _$alepha.TInteger;
|
|
8206
8123
|
windowMs: _$alepha.TInteger;
|
|
8207
8124
|
}>;
|
|
8125
|
+
refreshToken: _$alepha.TObject<{
|
|
8126
|
+
expirationIdle: _$alepha.TOptional<_$alepha.TInteger>;
|
|
8127
|
+
}>;
|
|
8208
8128
|
}>;
|
|
8209
8129
|
realmName: _$alepha.TString;
|
|
8210
8130
|
authenticationMethods: _$alepha.TArray<_$alepha.TObject<{
|
|
@@ -8313,6 +8233,7 @@ declare class SessionService {
|
|
|
8313
8233
|
refreshToken: _$alepha.TString;
|
|
8314
8234
|
userId: PgAttr<_$alepha.TString, typeof PG_REF>;
|
|
8315
8235
|
expiresAt: _$alepha.TString;
|
|
8236
|
+
lastUsedAt: _$alepha.TOptional<_$alepha.TString>;
|
|
8316
8237
|
ip: _$alepha.TOptional<_$alepha.TString>;
|
|
8317
8238
|
userAgent: _$alepha.TOptional<_$alepha.TObject<{
|
|
8318
8239
|
os: _$alepha.TString;
|