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