alepha 0.12.1 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-jobs/index.d.ts +26 -26
- package/dist/api-notifications/index.d.ts +111 -111
- package/dist/api-users/index.d.cts +1221 -1221
- package/dist/api-users/index.d.ts +1239 -1239
- package/dist/api-verifications/index.d.ts +94 -94
- package/dist/redis/index.d.ts +10 -10
- package/dist/security/index.d.cts +32 -32
- package/dist/security/index.d.ts +28 -28
- package/dist/server-auth/index.d.cts +193 -193
- package/dist/server-auth/index.d.ts +193 -193
- package/dist/server-links/index.d.cts +34 -34
- package/dist/server-links/index.d.ts +34 -34
- package/dist/websocket/index.d.cts +7 -7
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha62 from "alepha";
|
|
2
2
|
import { Static } from "alepha";
|
|
3
3
|
import * as alepha_server0 from "alepha/server";
|
|
4
4
|
import { DateTimeProvider } from "alepha/datetime";
|
|
@@ -6,35 +6,35 @@ import * as alepha_logger0 from "alepha/logger";
|
|
|
6
6
|
import * as alepha_orm56 from "alepha/orm";
|
|
7
7
|
|
|
8
8
|
//#region src/api-verifications/entities/verifications.d.ts
|
|
9
|
-
declare const verifications: alepha_orm56.EntityDescriptor<
|
|
10
|
-
id: alepha_orm56.PgAttr<alepha_orm56.PgAttr<
|
|
11
|
-
createdAt: alepha_orm56.PgAttr<alepha_orm56.PgAttr<
|
|
12
|
-
updatedAt: alepha_orm56.PgAttr<alepha_orm56.PgAttr<
|
|
13
|
-
version: alepha_orm56.PgAttr<alepha_orm56.PgAttr<
|
|
14
|
-
type:
|
|
15
|
-
target:
|
|
16
|
-
code:
|
|
17
|
-
verifiedAt:
|
|
18
|
-
attempts: alepha_orm56.PgAttr<
|
|
9
|
+
declare const verifications: alepha_orm56.EntityDescriptor<alepha62.TObject<{
|
|
10
|
+
id: alepha_orm56.PgAttr<alepha_orm56.PgAttr<alepha62.TString, typeof alepha_orm56.PG_PRIMARY_KEY>, typeof alepha_orm56.PG_DEFAULT>;
|
|
11
|
+
createdAt: alepha_orm56.PgAttr<alepha_orm56.PgAttr<alepha62.TString, typeof alepha_orm56.PG_CREATED_AT>, typeof alepha_orm56.PG_DEFAULT>;
|
|
12
|
+
updatedAt: alepha_orm56.PgAttr<alepha_orm56.PgAttr<alepha62.TString, typeof alepha_orm56.PG_UPDATED_AT>, typeof alepha_orm56.PG_DEFAULT>;
|
|
13
|
+
version: alepha_orm56.PgAttr<alepha_orm56.PgAttr<alepha62.TInteger, typeof alepha_orm56.PG_VERSION>, typeof alepha_orm56.PG_DEFAULT>;
|
|
14
|
+
type: alepha62.TUnsafe<"link" | "code">;
|
|
15
|
+
target: alepha62.TString;
|
|
16
|
+
code: alepha62.TString;
|
|
17
|
+
verifiedAt: alepha62.TOptional<alepha62.TString>;
|
|
18
|
+
attempts: alepha_orm56.PgAttr<alepha62.TInteger, typeof alepha_orm56.PG_DEFAULT>;
|
|
19
19
|
}>>;
|
|
20
20
|
type VerificationEntity = Static<typeof verifications.schema>;
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/api-verifications/schemas/verificationSettingsSchema.d.ts
|
|
23
|
-
declare const verificationSettingsSchema:
|
|
24
|
-
code:
|
|
25
|
-
maxAttempts:
|
|
26
|
-
codeLength:
|
|
27
|
-
codeExpiration:
|
|
28
|
-
verificationCooldown:
|
|
29
|
-
limitPerDay:
|
|
23
|
+
declare const verificationSettingsSchema: alepha62.TObject<{
|
|
24
|
+
code: alepha62.TObject<{
|
|
25
|
+
maxAttempts: alepha62.TInteger;
|
|
26
|
+
codeLength: alepha62.TInteger;
|
|
27
|
+
codeExpiration: alepha62.TInteger;
|
|
28
|
+
verificationCooldown: alepha62.TInteger;
|
|
29
|
+
limitPerDay: alepha62.TInteger;
|
|
30
30
|
}>;
|
|
31
|
-
link:
|
|
32
|
-
maxAttempts:
|
|
33
|
-
codeExpiration:
|
|
34
|
-
verificationCooldown:
|
|
35
|
-
limitPerDay:
|
|
31
|
+
link: alepha62.TObject<{
|
|
32
|
+
maxAttempts: alepha62.TInteger;
|
|
33
|
+
codeExpiration: alepha62.TInteger;
|
|
34
|
+
verificationCooldown: alepha62.TInteger;
|
|
35
|
+
limitPerDay: alepha62.TInteger;
|
|
36
36
|
}>;
|
|
37
|
-
purgeDays:
|
|
37
|
+
purgeDays: alepha62.TInteger;
|
|
38
38
|
}>;
|
|
39
39
|
type VerificationSettings = Static<typeof verificationSettingsSchema>;
|
|
40
40
|
//#endregion
|
|
@@ -42,21 +42,21 @@ type VerificationSettings = Static<typeof verificationSettingsSchema>;
|
|
|
42
42
|
/**
|
|
43
43
|
* Verification settings configuration atom
|
|
44
44
|
*/
|
|
45
|
-
declare const verificationOptions:
|
|
46
|
-
code:
|
|
47
|
-
maxAttempts:
|
|
48
|
-
codeLength:
|
|
49
|
-
codeExpiration:
|
|
50
|
-
verificationCooldown:
|
|
51
|
-
limitPerDay:
|
|
45
|
+
declare const verificationOptions: alepha62.Atom<alepha62.TObject<{
|
|
46
|
+
code: alepha62.TObject<{
|
|
47
|
+
maxAttempts: alepha62.TInteger;
|
|
48
|
+
codeLength: alepha62.TInteger;
|
|
49
|
+
codeExpiration: alepha62.TInteger;
|
|
50
|
+
verificationCooldown: alepha62.TInteger;
|
|
51
|
+
limitPerDay: alepha62.TInteger;
|
|
52
52
|
}>;
|
|
53
|
-
link:
|
|
54
|
-
maxAttempts:
|
|
55
|
-
codeExpiration:
|
|
56
|
-
verificationCooldown:
|
|
57
|
-
limitPerDay:
|
|
53
|
+
link: alepha62.TObject<{
|
|
54
|
+
maxAttempts: alepha62.TInteger;
|
|
55
|
+
codeExpiration: alepha62.TInteger;
|
|
56
|
+
verificationCooldown: alepha62.TInteger;
|
|
57
|
+
limitPerDay: alepha62.TInteger;
|
|
58
58
|
}>;
|
|
59
|
-
purgeDays:
|
|
59
|
+
purgeDays: alepha62.TInteger;
|
|
60
60
|
}>, "alepha.api.verifications.options">;
|
|
61
61
|
type VerificationOptions = Static<typeof verificationOptions.schema>;
|
|
62
62
|
declare module "alepha" {
|
|
@@ -85,23 +85,23 @@ declare class VerificationParameters {
|
|
|
85
85
|
}
|
|
86
86
|
//#endregion
|
|
87
87
|
//#region src/api-verifications/schemas/requestVerificationCodeResponseSchema.d.ts
|
|
88
|
-
declare const requestVerificationCodeResponseSchema:
|
|
89
|
-
token:
|
|
90
|
-
codeExpiration:
|
|
91
|
-
verificationCooldown:
|
|
92
|
-
maxVerificationAttempts:
|
|
88
|
+
declare const requestVerificationCodeResponseSchema: alepha62.TObject<{
|
|
89
|
+
token: alepha62.TString;
|
|
90
|
+
codeExpiration: alepha62.TInteger;
|
|
91
|
+
verificationCooldown: alepha62.TInteger;
|
|
92
|
+
maxVerificationAttempts: alepha62.TInteger;
|
|
93
93
|
}>;
|
|
94
94
|
type RequestVerificationResponse = Static<typeof requestVerificationCodeResponseSchema>;
|
|
95
95
|
//#endregion
|
|
96
96
|
//#region src/api-verifications/schemas/validateVerificationCodeResponseSchema.d.ts
|
|
97
|
-
declare const validateVerificationCodeResponseSchema:
|
|
98
|
-
ok:
|
|
99
|
-
alreadyVerified:
|
|
97
|
+
declare const validateVerificationCodeResponseSchema: alepha62.TObject<{
|
|
98
|
+
ok: alepha62.TBoolean;
|
|
99
|
+
alreadyVerified: alepha62.TOptional<alepha62.TBoolean>;
|
|
100
100
|
}>;
|
|
101
101
|
type ValidateVerificationCodeResponse = Static<typeof validateVerificationCodeResponseSchema>;
|
|
102
102
|
//#endregion
|
|
103
103
|
//#region src/api-verifications/schemas/verificationTypeEnumSchema.d.ts
|
|
104
|
-
declare const verificationTypeEnumSchema:
|
|
104
|
+
declare const verificationTypeEnumSchema: alepha62.TUnsafe<"link" | "code">;
|
|
105
105
|
type VerificationTypeEnum = Static<typeof verificationTypeEnumSchema>;
|
|
106
106
|
//#endregion
|
|
107
107
|
//#region src/api-verifications/services/VerificationService.d.ts
|
|
@@ -109,38 +109,38 @@ declare class VerificationService {
|
|
|
109
109
|
protected readonly log: alepha_logger0.Logger;
|
|
110
110
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
111
111
|
protected readonly verificationParameters: VerificationParameters;
|
|
112
|
-
protected readonly verificationRepository: alepha_orm56.Repository<
|
|
113
|
-
id: alepha_orm56.PgAttr<alepha_orm56.PgAttr<
|
|
114
|
-
createdAt: alepha_orm56.PgAttr<alepha_orm56.PgAttr<
|
|
115
|
-
updatedAt: alepha_orm56.PgAttr<alepha_orm56.PgAttr<
|
|
116
|
-
version: alepha_orm56.PgAttr<alepha_orm56.PgAttr<
|
|
117
|
-
type:
|
|
118
|
-
target:
|
|
119
|
-
code:
|
|
120
|
-
verifiedAt:
|
|
121
|
-
attempts: alepha_orm56.PgAttr<
|
|
112
|
+
protected readonly verificationRepository: alepha_orm56.Repository<alepha62.TObject<{
|
|
113
|
+
id: alepha_orm56.PgAttr<alepha_orm56.PgAttr<alepha62.TString, typeof alepha_orm56.PG_PRIMARY_KEY>, typeof alepha_orm56.PG_DEFAULT>;
|
|
114
|
+
createdAt: alepha_orm56.PgAttr<alepha_orm56.PgAttr<alepha62.TString, typeof alepha_orm56.PG_CREATED_AT>, typeof alepha_orm56.PG_DEFAULT>;
|
|
115
|
+
updatedAt: alepha_orm56.PgAttr<alepha_orm56.PgAttr<alepha62.TString, typeof alepha_orm56.PG_UPDATED_AT>, typeof alepha_orm56.PG_DEFAULT>;
|
|
116
|
+
version: alepha_orm56.PgAttr<alepha_orm56.PgAttr<alepha62.TInteger, typeof alepha_orm56.PG_VERSION>, typeof alepha_orm56.PG_DEFAULT>;
|
|
117
|
+
type: alepha62.TUnsafe<"link" | "code">;
|
|
118
|
+
target: alepha62.TString;
|
|
119
|
+
code: alepha62.TString;
|
|
120
|
+
verifiedAt: alepha62.TOptional<alepha62.TString>;
|
|
121
|
+
attempts: alepha_orm56.PgAttr<alepha62.TInteger, typeof alepha_orm56.PG_DEFAULT>;
|
|
122
122
|
}>>;
|
|
123
123
|
findByEntry(entry: VerificationEntry): Promise<VerificationEntity>;
|
|
124
|
-
findRecentsByEntry(entry: VerificationEntry): Promise<alepha_orm56.PgStatic<
|
|
125
|
-
id: alepha_orm56.PgAttr<alepha_orm56.PgAttr<
|
|
126
|
-
createdAt: alepha_orm56.PgAttr<alepha_orm56.PgAttr<
|
|
127
|
-
updatedAt: alepha_orm56.PgAttr<alepha_orm56.PgAttr<
|
|
128
|
-
version: alepha_orm56.PgAttr<alepha_orm56.PgAttr<
|
|
129
|
-
type:
|
|
130
|
-
target:
|
|
131
|
-
code:
|
|
132
|
-
verifiedAt:
|
|
133
|
-
attempts: alepha_orm56.PgAttr<
|
|
134
|
-
}>, alepha_orm56.PgRelationMap<
|
|
135
|
-
id: alepha_orm56.PgAttr<alepha_orm56.PgAttr<
|
|
136
|
-
createdAt: alepha_orm56.PgAttr<alepha_orm56.PgAttr<
|
|
137
|
-
updatedAt: alepha_orm56.PgAttr<alepha_orm56.PgAttr<
|
|
138
|
-
version: alepha_orm56.PgAttr<alepha_orm56.PgAttr<
|
|
139
|
-
type:
|
|
140
|
-
target:
|
|
141
|
-
code:
|
|
142
|
-
verifiedAt:
|
|
143
|
-
attempts: alepha_orm56.PgAttr<
|
|
124
|
+
findRecentsByEntry(entry: VerificationEntry): Promise<alepha_orm56.PgStatic<alepha62.TObject<{
|
|
125
|
+
id: alepha_orm56.PgAttr<alepha_orm56.PgAttr<alepha62.TString, typeof alepha_orm56.PG_PRIMARY_KEY>, typeof alepha_orm56.PG_DEFAULT>;
|
|
126
|
+
createdAt: alepha_orm56.PgAttr<alepha_orm56.PgAttr<alepha62.TString, typeof alepha_orm56.PG_CREATED_AT>, typeof alepha_orm56.PG_DEFAULT>;
|
|
127
|
+
updatedAt: alepha_orm56.PgAttr<alepha_orm56.PgAttr<alepha62.TString, typeof alepha_orm56.PG_UPDATED_AT>, typeof alepha_orm56.PG_DEFAULT>;
|
|
128
|
+
version: alepha_orm56.PgAttr<alepha_orm56.PgAttr<alepha62.TInteger, typeof alepha_orm56.PG_VERSION>, typeof alepha_orm56.PG_DEFAULT>;
|
|
129
|
+
type: alepha62.TUnsafe<"link" | "code">;
|
|
130
|
+
target: alepha62.TString;
|
|
131
|
+
code: alepha62.TString;
|
|
132
|
+
verifiedAt: alepha62.TOptional<alepha62.TString>;
|
|
133
|
+
attempts: alepha_orm56.PgAttr<alepha62.TInteger, typeof alepha_orm56.PG_DEFAULT>;
|
|
134
|
+
}>, alepha_orm56.PgRelationMap<alepha62.TObject<{
|
|
135
|
+
id: alepha_orm56.PgAttr<alepha_orm56.PgAttr<alepha62.TString, typeof alepha_orm56.PG_PRIMARY_KEY>, typeof alepha_orm56.PG_DEFAULT>;
|
|
136
|
+
createdAt: alepha_orm56.PgAttr<alepha_orm56.PgAttr<alepha62.TString, typeof alepha_orm56.PG_CREATED_AT>, typeof alepha_orm56.PG_DEFAULT>;
|
|
137
|
+
updatedAt: alepha_orm56.PgAttr<alepha_orm56.PgAttr<alepha62.TString, typeof alepha_orm56.PG_UPDATED_AT>, typeof alepha_orm56.PG_DEFAULT>;
|
|
138
|
+
version: alepha_orm56.PgAttr<alepha_orm56.PgAttr<alepha62.TInteger, typeof alepha_orm56.PG_VERSION>, typeof alepha_orm56.PG_DEFAULT>;
|
|
139
|
+
type: alepha62.TUnsafe<"link" | "code">;
|
|
140
|
+
target: alepha62.TString;
|
|
141
|
+
code: alepha62.TString;
|
|
142
|
+
verifiedAt: alepha62.TOptional<alepha62.TString>;
|
|
143
|
+
attempts: alepha_orm56.PgAttr<alepha62.TInteger, typeof alepha_orm56.PG_DEFAULT>;
|
|
144
144
|
}>>>[]>;
|
|
145
145
|
/**
|
|
146
146
|
* Creates a verification entry and returns the token.
|
|
@@ -163,30 +163,30 @@ declare class VerificationController {
|
|
|
163
163
|
readonly url = "/verifications";
|
|
164
164
|
readonly group = "verifications";
|
|
165
165
|
readonly requestVerificationCode: alepha_server0.ActionDescriptorFn<{
|
|
166
|
-
params:
|
|
167
|
-
type:
|
|
166
|
+
params: alepha62.TObject<{
|
|
167
|
+
type: alepha62.TUnsafe<"link" | "code">;
|
|
168
168
|
}>;
|
|
169
|
-
body:
|
|
170
|
-
target:
|
|
169
|
+
body: alepha62.TObject<{
|
|
170
|
+
target: alepha62.TString;
|
|
171
171
|
}>;
|
|
172
|
-
response:
|
|
173
|
-
token:
|
|
174
|
-
codeExpiration:
|
|
175
|
-
verificationCooldown:
|
|
176
|
-
maxVerificationAttempts:
|
|
172
|
+
response: alepha62.TObject<{
|
|
173
|
+
token: alepha62.TString;
|
|
174
|
+
codeExpiration: alepha62.TInteger;
|
|
175
|
+
verificationCooldown: alepha62.TInteger;
|
|
176
|
+
maxVerificationAttempts: alepha62.TInteger;
|
|
177
177
|
}>;
|
|
178
178
|
}>;
|
|
179
179
|
readonly validateVerificationCode: alepha_server0.ActionDescriptorFn<{
|
|
180
|
-
params:
|
|
181
|
-
type:
|
|
180
|
+
params: alepha62.TObject<{
|
|
181
|
+
type: alepha62.TUnsafe<"link" | "code">;
|
|
182
182
|
}>;
|
|
183
|
-
body:
|
|
184
|
-
target:
|
|
185
|
-
token:
|
|
183
|
+
body: alepha62.TObject<{
|
|
184
|
+
target: alepha62.TString;
|
|
185
|
+
token: alepha62.TString;
|
|
186
186
|
}>;
|
|
187
|
-
response:
|
|
188
|
-
ok:
|
|
189
|
-
alreadyVerified:
|
|
187
|
+
response: alepha62.TObject<{
|
|
188
|
+
ok: alepha62.TBoolean;
|
|
189
|
+
alreadyVerified: alepha62.TOptional<alepha62.TBoolean>;
|
|
190
190
|
}>;
|
|
191
191
|
}>;
|
|
192
192
|
}
|
|
@@ -201,7 +201,7 @@ declare class VerificationController {
|
|
|
201
201
|
*
|
|
202
202
|
* @module alepha.api.verifications
|
|
203
203
|
*/
|
|
204
|
-
declare const AlephaApiVerification:
|
|
204
|
+
declare const AlephaApiVerification: alepha62.Service<alepha62.Module>;
|
|
205
205
|
//#endregion
|
|
206
206
|
export { AlephaApiVerification, RequestVerificationResponse, ValidateVerificationCodeResponse, VerificationController, VerificationEntry, VerificationService, VerificationTypeEnum, requestVerificationCodeResponseSchema, validateVerificationCodeResponseSchema, verificationTypeEnumSchema };
|
|
207
207
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/redis/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha3 from "alepha";
|
|
2
2
|
import { Alepha, Static } from "alepha";
|
|
3
3
|
import { RedisClientType, SetOptions, createClient } from "@redis/client";
|
|
4
4
|
import * as alepha_logger0 from "alepha/logger";
|
|
5
5
|
|
|
6
6
|
//#region src/redis/providers/RedisProvider.d.ts
|
|
7
|
-
declare const envSchema:
|
|
8
|
-
REDIS_PORT:
|
|
9
|
-
REDIS_HOST:
|
|
10
|
-
REDIS_PASSWORD:
|
|
7
|
+
declare const envSchema: alepha3.TObject<{
|
|
8
|
+
REDIS_PORT: alepha3.TInteger;
|
|
9
|
+
REDIS_HOST: alepha3.TString;
|
|
10
|
+
REDIS_PASSWORD: alepha3.TOptional<alepha3.TString>;
|
|
11
11
|
}>;
|
|
12
12
|
declare module "alepha" {
|
|
13
13
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -30,8 +30,8 @@ declare class RedisProvider {
|
|
|
30
30
|
};
|
|
31
31
|
protected readonly client: RedisClient;
|
|
32
32
|
get publisher(): RedisClient;
|
|
33
|
-
protected readonly start:
|
|
34
|
-
protected readonly stop:
|
|
33
|
+
protected readonly start: alepha3.HookDescriptor<"start">;
|
|
34
|
+
protected readonly stop: alepha3.HookDescriptor<"stop">;
|
|
35
35
|
/**
|
|
36
36
|
* Connect to the Redis server.
|
|
37
37
|
*/
|
|
@@ -59,8 +59,8 @@ declare class RedisSubscriberProvider {
|
|
|
59
59
|
protected readonly redisProvider: RedisProvider;
|
|
60
60
|
protected readonly client: RedisClient;
|
|
61
61
|
get subscriber(): RedisClient;
|
|
62
|
-
protected readonly start:
|
|
63
|
-
protected readonly stop:
|
|
62
|
+
protected readonly start: alepha3.HookDescriptor<"start">;
|
|
63
|
+
protected readonly stop: alepha3.HookDescriptor<"stop">;
|
|
64
64
|
connect(): Promise<void>;
|
|
65
65
|
close(): Promise<void>;
|
|
66
66
|
/**
|
|
@@ -76,7 +76,7 @@ declare class RedisSubscriberProvider {
|
|
|
76
76
|
* @see {@link RedisProvider}
|
|
77
77
|
* @module alepha.redis
|
|
78
78
|
*/
|
|
79
|
-
declare const AlephaRedis:
|
|
79
|
+
declare const AlephaRedis: alepha3.Service<alepha3.Module>;
|
|
80
80
|
//#endregion
|
|
81
81
|
export { AlephaRedis, RedisClient, RedisClientOptions, RedisProvider, RedisSetOptions, RedisSubscriberProvider };
|
|
82
82
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha28 from "alepha";
|
|
2
2
|
import { Alepha, Descriptor, KIND, Static } from "alepha";
|
|
3
|
-
import * as
|
|
3
|
+
import * as alepha_logger1 from "alepha/logger";
|
|
4
4
|
import { CryptoKey, FlattenedJWSInput, JSONWebKeySet, JWSHeaderParameters, JWTHeaderParameters, JWTPayload, JWTVerifyResult, KeyObject } from "jose";
|
|
5
5
|
import { JWTVerifyOptions } from "jose/jwt/verify";
|
|
6
6
|
import { DateTimeProvider, Duration, DurationLike } from "alepha/datetime";
|
|
7
7
|
import { UnauthorizedError } from "alepha/server";
|
|
8
8
|
|
|
9
9
|
//#region src/security/schemas/userAccountInfoSchema.d.ts
|
|
10
|
-
declare const userAccountInfoSchema:
|
|
11
|
-
id:
|
|
12
|
-
name:
|
|
13
|
-
email:
|
|
14
|
-
username:
|
|
15
|
-
picture:
|
|
16
|
-
sessionId:
|
|
17
|
-
organizations:
|
|
18
|
-
roles:
|
|
10
|
+
declare const userAccountInfoSchema: alepha28.TObject<{
|
|
11
|
+
id: alepha28.TString;
|
|
12
|
+
name: alepha28.TOptional<alepha28.TString>;
|
|
13
|
+
email: alepha28.TOptional<alepha28.TString>;
|
|
14
|
+
username: alepha28.TOptional<alepha28.TString>;
|
|
15
|
+
picture: alepha28.TOptional<alepha28.TString>;
|
|
16
|
+
sessionId: alepha28.TOptional<alepha28.TString>;
|
|
17
|
+
organizations: alepha28.TOptional<alepha28.TArray<alepha28.TString>>;
|
|
18
|
+
roles: alepha28.TOptional<alepha28.TArray<alepha28.TString>>;
|
|
19
19
|
}>;
|
|
20
20
|
type UserAccount = Static<typeof userAccountInfoSchema>;
|
|
21
21
|
//#endregion
|
|
@@ -41,24 +41,24 @@ interface UserAccountToken extends UserAccount {
|
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/security/schemas/permissionSchema.d.ts
|
|
44
|
-
declare const permissionSchema:
|
|
45
|
-
name:
|
|
46
|
-
group:
|
|
47
|
-
description:
|
|
48
|
-
method:
|
|
49
|
-
path:
|
|
44
|
+
declare const permissionSchema: alepha28.TObject<{
|
|
45
|
+
name: alepha28.TString;
|
|
46
|
+
group: alepha28.TOptional<alepha28.TString>;
|
|
47
|
+
description: alepha28.TOptional<alepha28.TString>;
|
|
48
|
+
method: alepha28.TOptional<alepha28.TString>;
|
|
49
|
+
path: alepha28.TOptional<alepha28.TString>;
|
|
50
50
|
}>;
|
|
51
51
|
type Permission = Static<typeof permissionSchema>;
|
|
52
52
|
//#endregion
|
|
53
53
|
//#region src/security/schemas/roleSchema.d.ts
|
|
54
|
-
declare const roleSchema:
|
|
55
|
-
name:
|
|
56
|
-
description:
|
|
57
|
-
default:
|
|
58
|
-
permissions:
|
|
59
|
-
name:
|
|
60
|
-
ownership:
|
|
61
|
-
exclude:
|
|
54
|
+
declare const roleSchema: alepha28.TObject<{
|
|
55
|
+
name: alepha28.TString;
|
|
56
|
+
description: alepha28.TOptional<alepha28.TString>;
|
|
57
|
+
default: alepha28.TOptional<alepha28.TBoolean>;
|
|
58
|
+
permissions: alepha28.TArray<alepha28.TObject<{
|
|
59
|
+
name: alepha28.TString;
|
|
60
|
+
ownership: alepha28.TOptional<alepha28.TBoolean>;
|
|
61
|
+
exclude: alepha28.TOptional<alepha28.TArray<alepha28.TString>>;
|
|
62
62
|
}>>;
|
|
63
63
|
}>;
|
|
64
64
|
type Role = Static<typeof roleSchema>;
|
|
@@ -68,7 +68,7 @@ type Role = Static<typeof roleSchema>;
|
|
|
68
68
|
* Provides utilities for working with JSON Web Tokens (JWT).
|
|
69
69
|
*/
|
|
70
70
|
declare class JwtProvider {
|
|
71
|
-
protected readonly log:
|
|
71
|
+
protected readonly log: alepha_logger1.Logger;
|
|
72
72
|
protected readonly keystore: KeyLoaderHolder[];
|
|
73
73
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
74
74
|
protected readonly encoder: TextEncoder;
|
|
@@ -131,8 +131,8 @@ interface JwtParseResult {
|
|
|
131
131
|
//#endregion
|
|
132
132
|
//#region src/security/providers/SecurityProvider.d.ts
|
|
133
133
|
declare const DEFAULT_APP_SECRET = "05759934015388327323179852515731";
|
|
134
|
-
declare const envSchema:
|
|
135
|
-
APP_SECRET:
|
|
134
|
+
declare const envSchema: alepha28.TObject<{
|
|
135
|
+
APP_SECRET: alepha28.TString;
|
|
136
136
|
}>;
|
|
137
137
|
declare module "alepha" {
|
|
138
138
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -141,7 +141,7 @@ declare class SecurityProvider {
|
|
|
141
141
|
protected readonly UNKNOWN_USER_NAME = "Anonymous User";
|
|
142
142
|
protected readonly PERMISSION_REGEXP: RegExp;
|
|
143
143
|
protected readonly PERMISSION_REGEXP_WILDCARD: RegExp;
|
|
144
|
-
protected readonly log:
|
|
144
|
+
protected readonly log: alepha_logger1.Logger;
|
|
145
145
|
protected readonly jwt: JwtProvider;
|
|
146
146
|
protected readonly env: {
|
|
147
147
|
APP_SECRET: string;
|
|
@@ -156,7 +156,7 @@ declare class SecurityProvider {
|
|
|
156
156
|
* The realms configured for the security provider.
|
|
157
157
|
*/
|
|
158
158
|
protected readonly realms: Realm[];
|
|
159
|
-
protected start:
|
|
159
|
+
protected start: alepha28.HookDescriptor<"start">;
|
|
160
160
|
/**
|
|
161
161
|
* Adds a role to one or more realms.
|
|
162
162
|
*
|
|
@@ -400,7 +400,7 @@ declare class RealmDescriptor extends Descriptor<RealmDescriptorOptions> {
|
|
|
400
400
|
protected readonly securityProvider: SecurityProvider;
|
|
401
401
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
402
402
|
protected readonly jwt: JwtProvider;
|
|
403
|
-
protected readonly log:
|
|
403
|
+
protected readonly log: alepha_logger1.Logger;
|
|
404
404
|
get name(): string;
|
|
405
405
|
get accessTokenExpiration(): Duration;
|
|
406
406
|
get refreshTokenExpiration(): Duration;
|
|
@@ -592,7 +592,7 @@ declare module "alepha" {
|
|
|
592
592
|
* @see {@link $permission}
|
|
593
593
|
* @module alepha.security
|
|
594
594
|
*/
|
|
595
|
-
declare const AlephaSecurity:
|
|
595
|
+
declare const AlephaSecurity: alepha28.Service<alepha28.Module>;
|
|
596
596
|
//#endregion
|
|
597
597
|
export { $permission, $realm, $role, $serviceAccount, AccessTokenResponse, AlephaSecurity, CreateTokenOptions, CryptoProvider, DEFAULT_APP_SECRET, ExtendedJWTPayload, InvalidCredentialsError, InvalidPermissionError, JwtParseResult, JwtProvider, JwtSignOptions, KeyLoader, KeyLoaderHolder, Oauth2ServiceAccountDescriptorOptions, Permission, PermissionDescriptor, PermissionDescriptorOptions, Realm, RealmDescriptor, RealmDescriptorOptions, RealmExternal, RealmInternal, RealmSettings, Role, RoleDescriptor, RoleDescriptorOptions, SecurityCheckResult, SecurityError, SecurityProvider, ServiceAccountDescriptor, ServiceAccountDescriptorOptions, ServiceAccountStore, UserAccount, UserAccountToken, permissionSchema, roleSchema, userAccountInfoSchema };
|
|
598
598
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/security/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha1 from "alepha";
|
|
2
2
|
import { Alepha, Descriptor, KIND, Static } from "alepha";
|
|
3
3
|
import * as alepha_logger0 from "alepha/logger";
|
|
4
4
|
import { DateTimeProvider, Duration, DurationLike } from "alepha/datetime";
|
|
@@ -7,15 +7,15 @@ import { CryptoKey, FlattenedJWSInput, JSONWebKeySet, JWSHeaderParameters, JWTHe
|
|
|
7
7
|
import { JWTVerifyOptions } from "jose/jwt/verify";
|
|
8
8
|
|
|
9
9
|
//#region src/security/schemas/userAccountInfoSchema.d.ts
|
|
10
|
-
declare const userAccountInfoSchema:
|
|
11
|
-
id:
|
|
12
|
-
name:
|
|
13
|
-
email:
|
|
14
|
-
username:
|
|
15
|
-
picture:
|
|
16
|
-
sessionId:
|
|
17
|
-
organizations:
|
|
18
|
-
roles:
|
|
10
|
+
declare const userAccountInfoSchema: alepha1.TObject<{
|
|
11
|
+
id: alepha1.TString;
|
|
12
|
+
name: alepha1.TOptional<alepha1.TString>;
|
|
13
|
+
email: alepha1.TOptional<alepha1.TString>;
|
|
14
|
+
username: alepha1.TOptional<alepha1.TString>;
|
|
15
|
+
picture: alepha1.TOptional<alepha1.TString>;
|
|
16
|
+
sessionId: alepha1.TOptional<alepha1.TString>;
|
|
17
|
+
organizations: alepha1.TOptional<alepha1.TArray<alepha1.TString>>;
|
|
18
|
+
roles: alepha1.TOptional<alepha1.TArray<alepha1.TString>>;
|
|
19
19
|
}>;
|
|
20
20
|
type UserAccount = Static<typeof userAccountInfoSchema>;
|
|
21
21
|
//#endregion
|
|
@@ -41,24 +41,24 @@ interface UserAccountToken extends UserAccount {
|
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/security/schemas/permissionSchema.d.ts
|
|
44
|
-
declare const permissionSchema:
|
|
45
|
-
name:
|
|
46
|
-
group:
|
|
47
|
-
description:
|
|
48
|
-
method:
|
|
49
|
-
path:
|
|
44
|
+
declare const permissionSchema: alepha1.TObject<{
|
|
45
|
+
name: alepha1.TString;
|
|
46
|
+
group: alepha1.TOptional<alepha1.TString>;
|
|
47
|
+
description: alepha1.TOptional<alepha1.TString>;
|
|
48
|
+
method: alepha1.TOptional<alepha1.TString>;
|
|
49
|
+
path: alepha1.TOptional<alepha1.TString>;
|
|
50
50
|
}>;
|
|
51
51
|
type Permission = Static<typeof permissionSchema>;
|
|
52
52
|
//#endregion
|
|
53
53
|
//#region src/security/schemas/roleSchema.d.ts
|
|
54
|
-
declare const roleSchema:
|
|
55
|
-
name:
|
|
56
|
-
description:
|
|
57
|
-
default:
|
|
58
|
-
permissions:
|
|
59
|
-
name:
|
|
60
|
-
ownership:
|
|
61
|
-
exclude:
|
|
54
|
+
declare const roleSchema: alepha1.TObject<{
|
|
55
|
+
name: alepha1.TString;
|
|
56
|
+
description: alepha1.TOptional<alepha1.TString>;
|
|
57
|
+
default: alepha1.TOptional<alepha1.TBoolean>;
|
|
58
|
+
permissions: alepha1.TArray<alepha1.TObject<{
|
|
59
|
+
name: alepha1.TString;
|
|
60
|
+
ownership: alepha1.TOptional<alepha1.TBoolean>;
|
|
61
|
+
exclude: alepha1.TOptional<alepha1.TArray<alepha1.TString>>;
|
|
62
62
|
}>>;
|
|
63
63
|
}>;
|
|
64
64
|
type Role = Static<typeof roleSchema>;
|
|
@@ -131,8 +131,8 @@ interface JwtParseResult {
|
|
|
131
131
|
//#endregion
|
|
132
132
|
//#region src/security/providers/SecurityProvider.d.ts
|
|
133
133
|
declare const DEFAULT_APP_SECRET = "05759934015388327323179852515731";
|
|
134
|
-
declare const envSchema:
|
|
135
|
-
APP_SECRET:
|
|
134
|
+
declare const envSchema: alepha1.TObject<{
|
|
135
|
+
APP_SECRET: alepha1.TString;
|
|
136
136
|
}>;
|
|
137
137
|
declare module "alepha" {
|
|
138
138
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -156,7 +156,7 @@ declare class SecurityProvider {
|
|
|
156
156
|
* The realms configured for the security provider.
|
|
157
157
|
*/
|
|
158
158
|
protected readonly realms: Realm[];
|
|
159
|
-
protected start:
|
|
159
|
+
protected start: alepha1.HookDescriptor<"start">;
|
|
160
160
|
/**
|
|
161
161
|
* Adds a role to one or more realms.
|
|
162
162
|
*
|
|
@@ -592,7 +592,7 @@ declare module "alepha" {
|
|
|
592
592
|
* @see {@link $permission}
|
|
593
593
|
* @module alepha.security
|
|
594
594
|
*/
|
|
595
|
-
declare const AlephaSecurity:
|
|
595
|
+
declare const AlephaSecurity: alepha1.Service<alepha1.Module>;
|
|
596
596
|
//#endregion
|
|
597
597
|
export { $permission, $realm, $role, $serviceAccount, AccessTokenResponse, AlephaSecurity, CreateTokenOptions, CryptoProvider, DEFAULT_APP_SECRET, ExtendedJWTPayload, InvalidCredentialsError, InvalidPermissionError, JwtParseResult, JwtProvider, JwtSignOptions, KeyLoader, KeyLoaderHolder, Oauth2ServiceAccountDescriptorOptions, Permission, PermissionDescriptor, PermissionDescriptorOptions, Realm, RealmDescriptor, RealmDescriptorOptions, RealmExternal, RealmInternal, RealmSettings, Role, RoleDescriptor, RoleDescriptorOptions, SecurityCheckResult, SecurityError, SecurityProvider, ServiceAccountDescriptor, ServiceAccountDescriptorOptions, ServiceAccountStore, UserAccount, UserAccountToken, permissionSchema, roleSchema, userAccountInfoSchema };
|
|
598
598
|
//# sourceMappingURL=index.d.ts.map
|