alepha 0.13.5 → 0.13.6
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-users/index.d.ts +777 -777
- package/dist/redis/index.d.ts +10 -10
- package/dist/scheduler/index.d.ts +6 -6
- package/dist/security/index.d.ts +28 -28
- package/dist/server-auth/index.d.ts +152 -152
- package/dist/websocket/index.d.ts +7 -7
- package/package.json +1 -1
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.HookPrimitive<"start">;
|
|
34
|
+
protected readonly stop: alepha3.HookPrimitive<"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.HookPrimitive<"start">;
|
|
63
|
+
protected readonly stop: alepha3.HookPrimitive<"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,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha4 from "alepha";
|
|
2
2
|
import { Alepha, Async, KIND, Primitive, Static } from "alepha";
|
|
3
3
|
import * as alepha_lock0 from "alepha/lock";
|
|
4
4
|
import { DateTime, DateTimeProvider, DurationLike } from "alepha/datetime";
|
|
@@ -23,8 +23,8 @@ declare class CronProvider {
|
|
|
23
23
|
protected readonly log: alepha_logger0.Logger;
|
|
24
24
|
protected readonly cronJobs: Array<CronJob>;
|
|
25
25
|
getCronJobs(): Array<CronJob>;
|
|
26
|
-
protected readonly start:
|
|
27
|
-
protected readonly stop:
|
|
26
|
+
protected readonly start: alepha4.HookPrimitive<"start">;
|
|
27
|
+
protected readonly stop: alepha4.HookPrimitive<"stop">;
|
|
28
28
|
protected boot(name: string | CronJob): void;
|
|
29
29
|
abort(name: string | CronJob): void;
|
|
30
30
|
/**
|
|
@@ -87,8 +87,8 @@ type SchedulerPrimitiveOptions = {
|
|
|
87
87
|
*/
|
|
88
88
|
lock?: boolean;
|
|
89
89
|
};
|
|
90
|
-
declare const envSchema:
|
|
91
|
-
SCHEDULER_PREFIX:
|
|
90
|
+
declare const envSchema: alepha4.TObject<{
|
|
91
|
+
SCHEDULER_PREFIX: alepha4.TOptional<alepha4.TString>;
|
|
92
92
|
}>;
|
|
93
93
|
declare module "alepha" {
|
|
94
94
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -139,7 +139,7 @@ declare module "alepha" {
|
|
|
139
139
|
* @see {@link $scheduler}
|
|
140
140
|
* @module alepha.scheduler
|
|
141
141
|
*/
|
|
142
|
-
declare const AlephaScheduler:
|
|
142
|
+
declare const AlephaScheduler: alepha4.Service<alepha4.Module>;
|
|
143
143
|
//#endregion
|
|
144
144
|
export { $scheduler, AlephaScheduler, CRON, CronJob, CronProvider, SchedulerHandlerArguments, SchedulerPrimitive, SchedulerPrimitiveOptions };
|
|
145
145
|
//# sourceMappingURL=index.d.ts.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, KIND, Primitive, 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
|
|
@@ -64,24 +64,24 @@ interface UserAccountToken extends UserAccount {
|
|
|
64
64
|
}
|
|
65
65
|
//#endregion
|
|
66
66
|
//#region ../../src/security/schemas/permissionSchema.d.ts
|
|
67
|
-
declare const permissionSchema:
|
|
68
|
-
name:
|
|
69
|
-
group:
|
|
70
|
-
description:
|
|
71
|
-
method:
|
|
72
|
-
path:
|
|
67
|
+
declare const permissionSchema: alepha1.TObject<{
|
|
68
|
+
name: alepha1.TString;
|
|
69
|
+
group: alepha1.TOptional<alepha1.TString>;
|
|
70
|
+
description: alepha1.TOptional<alepha1.TString>;
|
|
71
|
+
method: alepha1.TOptional<alepha1.TString>;
|
|
72
|
+
path: alepha1.TOptional<alepha1.TString>;
|
|
73
73
|
}>;
|
|
74
74
|
type Permission = Static<typeof permissionSchema>;
|
|
75
75
|
//#endregion
|
|
76
76
|
//#region ../../src/security/schemas/roleSchema.d.ts
|
|
77
|
-
declare const roleSchema:
|
|
78
|
-
name:
|
|
79
|
-
description:
|
|
80
|
-
default:
|
|
81
|
-
permissions:
|
|
82
|
-
name:
|
|
83
|
-
ownership:
|
|
84
|
-
exclude:
|
|
77
|
+
declare const roleSchema: alepha1.TObject<{
|
|
78
|
+
name: alepha1.TString;
|
|
79
|
+
description: alepha1.TOptional<alepha1.TString>;
|
|
80
|
+
default: alepha1.TOptional<alepha1.TBoolean>;
|
|
81
|
+
permissions: alepha1.TArray<alepha1.TObject<{
|
|
82
|
+
name: alepha1.TString;
|
|
83
|
+
ownership: alepha1.TOptional<alepha1.TBoolean>;
|
|
84
|
+
exclude: alepha1.TOptional<alepha1.TArray<alepha1.TString>>;
|
|
85
85
|
}>>;
|
|
86
86
|
}>;
|
|
87
87
|
type Role = Static<typeof roleSchema>;
|
|
@@ -154,8 +154,8 @@ interface JwtParseResult {
|
|
|
154
154
|
//#endregion
|
|
155
155
|
//#region ../../src/security/providers/SecurityProvider.d.ts
|
|
156
156
|
declare const DEFAULT_APP_SECRET = "05759934015388327323179852515731";
|
|
157
|
-
declare const envSchema:
|
|
158
|
-
APP_SECRET:
|
|
157
|
+
declare const envSchema: alepha1.TObject<{
|
|
158
|
+
APP_SECRET: alepha1.TString;
|
|
159
159
|
}>;
|
|
160
160
|
declare module "alepha" {
|
|
161
161
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -179,7 +179,7 @@ declare class SecurityProvider {
|
|
|
179
179
|
* The realms configured for the security provider.
|
|
180
180
|
*/
|
|
181
181
|
protected readonly realms: Realm[];
|
|
182
|
-
protected start:
|
|
182
|
+
protected start: alepha1.HookPrimitive<"start">;
|
|
183
183
|
/**
|
|
184
184
|
* Adds a role to one or more realms.
|
|
185
185
|
*
|
|
@@ -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, Oauth2ServiceAccountPrimitiveOptions, Permission, PermissionPrimitive, PermissionPrimitiveOptions, Realm, RealmExternal, RealmInternal, RealmPrimitive, RealmPrimitiveOptions, RealmSettings, Role, RolePrimitive, RolePrimitiveOptions, SecurityCheckResult, SecurityError, SecurityProvider, ServiceAccountPrimitive, ServiceAccountPrimitiveOptions, ServiceAccountStore, UserAccount, UserAccountToken, permissionSchema, roleSchema, userAccountInfoSchema };
|
|
598
598
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha163 from "alepha";
|
|
2
2
|
import { Alepha, Async, KIND, Primitive, Static } from "alepha";
|
|
3
3
|
import * as alepha_server_cookies0 from "alepha/server/cookies";
|
|
4
4
|
import { Cookies, ServerCookiesProvider } from "alepha/server/cookies";
|
|
@@ -20,82 +20,82 @@ declare const alephaServerAuthRoutes: {
|
|
|
20
20
|
};
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region ../../src/server-auth/schemas/authenticationProviderSchema.d.ts
|
|
23
|
-
declare const authenticationProviderSchema:
|
|
24
|
-
name:
|
|
25
|
-
type:
|
|
23
|
+
declare const authenticationProviderSchema: alepha163.TObject<{
|
|
24
|
+
name: alepha163.TString;
|
|
25
|
+
type: alepha163.TUnsafe<"OAUTH2" | "OIDC" | "CREDENTIALS">;
|
|
26
26
|
}>;
|
|
27
27
|
type AuthenticationProvider = Static<typeof authenticationProviderSchema>;
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region ../../src/server-auth/schemas/tokenResponseSchema.d.ts
|
|
30
|
-
declare const tokenResponseSchema:
|
|
31
|
-
provider:
|
|
32
|
-
access_token:
|
|
33
|
-
issued_at:
|
|
34
|
-
expires_in:
|
|
35
|
-
refresh_token:
|
|
36
|
-
refresh_token_expires_in:
|
|
37
|
-
refresh_expires_in:
|
|
38
|
-
id_token:
|
|
39
|
-
scope:
|
|
40
|
-
user:
|
|
41
|
-
id:
|
|
42
|
-
name:
|
|
43
|
-
email:
|
|
44
|
-
username:
|
|
45
|
-
picture:
|
|
46
|
-
sessionId:
|
|
47
|
-
organizations:
|
|
48
|
-
roles:
|
|
30
|
+
declare const tokenResponseSchema: alepha163.TObject<{
|
|
31
|
+
provider: alepha163.TString;
|
|
32
|
+
access_token: alepha163.TString;
|
|
33
|
+
issued_at: alepha163.TNumber;
|
|
34
|
+
expires_in: alepha163.TOptional<alepha163.TNumber>;
|
|
35
|
+
refresh_token: alepha163.TOptional<alepha163.TString>;
|
|
36
|
+
refresh_token_expires_in: alepha163.TOptional<alepha163.TNumber>;
|
|
37
|
+
refresh_expires_in: alepha163.TOptional<alepha163.TNumber>;
|
|
38
|
+
id_token: alepha163.TOptional<alepha163.TString>;
|
|
39
|
+
scope: alepha163.TOptional<alepha163.TString>;
|
|
40
|
+
user: alepha163.TObject<{
|
|
41
|
+
id: alepha163.TString;
|
|
42
|
+
name: alepha163.TOptional<alepha163.TString>;
|
|
43
|
+
email: alepha163.TOptional<alepha163.TString>;
|
|
44
|
+
username: alepha163.TOptional<alepha163.TString>;
|
|
45
|
+
picture: alepha163.TOptional<alepha163.TString>;
|
|
46
|
+
sessionId: alepha163.TOptional<alepha163.TString>;
|
|
47
|
+
organizations: alepha163.TOptional<alepha163.TArray<alepha163.TString>>;
|
|
48
|
+
roles: alepha163.TOptional<alepha163.TArray<alepha163.TString>>;
|
|
49
49
|
}>;
|
|
50
|
-
api:
|
|
51
|
-
prefix:
|
|
52
|
-
links:
|
|
53
|
-
name:
|
|
54
|
-
group:
|
|
55
|
-
path:
|
|
56
|
-
method:
|
|
57
|
-
requestBodyType:
|
|
58
|
-
service:
|
|
50
|
+
api: alepha163.TObject<{
|
|
51
|
+
prefix: alepha163.TOptional<alepha163.TString>;
|
|
52
|
+
links: alepha163.TArray<alepha163.TObject<{
|
|
53
|
+
name: alepha163.TString;
|
|
54
|
+
group: alepha163.TOptional<alepha163.TString>;
|
|
55
|
+
path: alepha163.TString;
|
|
56
|
+
method: alepha163.TOptional<alepha163.TString>;
|
|
57
|
+
requestBodyType: alepha163.TOptional<alepha163.TString>;
|
|
58
|
+
service: alepha163.TOptional<alepha163.TString>;
|
|
59
59
|
}>>;
|
|
60
60
|
}>;
|
|
61
61
|
}>;
|
|
62
62
|
type TokenResponse = Static<typeof tokenResponseSchema>;
|
|
63
63
|
//#endregion
|
|
64
64
|
//#region ../../src/server-auth/schemas/tokensSchema.d.ts
|
|
65
|
-
declare const tokensSchema:
|
|
66
|
-
provider:
|
|
67
|
-
access_token:
|
|
68
|
-
issued_at:
|
|
69
|
-
expires_in:
|
|
70
|
-
refresh_token:
|
|
71
|
-
refresh_token_expires_in:
|
|
72
|
-
refresh_expires_in:
|
|
73
|
-
id_token:
|
|
74
|
-
scope:
|
|
65
|
+
declare const tokensSchema: alepha163.TObject<{
|
|
66
|
+
provider: alepha163.TString;
|
|
67
|
+
access_token: alepha163.TString;
|
|
68
|
+
issued_at: alepha163.TNumber;
|
|
69
|
+
expires_in: alepha163.TOptional<alepha163.TNumber>;
|
|
70
|
+
refresh_token: alepha163.TOptional<alepha163.TString>;
|
|
71
|
+
refresh_token_expires_in: alepha163.TOptional<alepha163.TNumber>;
|
|
72
|
+
refresh_expires_in: alepha163.TOptional<alepha163.TNumber>;
|
|
73
|
+
id_token: alepha163.TOptional<alepha163.TString>;
|
|
74
|
+
scope: alepha163.TOptional<alepha163.TString>;
|
|
75
75
|
}>;
|
|
76
76
|
type Tokens = Static<typeof tokensSchema>;
|
|
77
77
|
//#endregion
|
|
78
78
|
//#region ../../src/server-auth/schemas/userinfoResponseSchema.d.ts
|
|
79
|
-
declare const userinfoResponseSchema:
|
|
80
|
-
user:
|
|
81
|
-
id:
|
|
82
|
-
name:
|
|
83
|
-
email:
|
|
84
|
-
username:
|
|
85
|
-
picture:
|
|
86
|
-
sessionId:
|
|
87
|
-
organizations:
|
|
88
|
-
roles:
|
|
79
|
+
declare const userinfoResponseSchema: alepha163.TObject<{
|
|
80
|
+
user: alepha163.TOptional<alepha163.TObject<{
|
|
81
|
+
id: alepha163.TString;
|
|
82
|
+
name: alepha163.TOptional<alepha163.TString>;
|
|
83
|
+
email: alepha163.TOptional<alepha163.TString>;
|
|
84
|
+
username: alepha163.TOptional<alepha163.TString>;
|
|
85
|
+
picture: alepha163.TOptional<alepha163.TString>;
|
|
86
|
+
sessionId: alepha163.TOptional<alepha163.TString>;
|
|
87
|
+
organizations: alepha163.TOptional<alepha163.TArray<alepha163.TString>>;
|
|
88
|
+
roles: alepha163.TOptional<alepha163.TArray<alepha163.TString>>;
|
|
89
89
|
}>>;
|
|
90
|
-
api:
|
|
91
|
-
prefix:
|
|
92
|
-
links:
|
|
93
|
-
name:
|
|
94
|
-
group:
|
|
95
|
-
path:
|
|
96
|
-
method:
|
|
97
|
-
requestBodyType:
|
|
98
|
-
service:
|
|
90
|
+
api: alepha163.TObject<{
|
|
91
|
+
prefix: alepha163.TOptional<alepha163.TString>;
|
|
92
|
+
links: alepha163.TArray<alepha163.TObject<{
|
|
93
|
+
name: alepha163.TString;
|
|
94
|
+
group: alepha163.TOptional<alepha163.TString>;
|
|
95
|
+
path: alepha163.TString;
|
|
96
|
+
method: alepha163.TOptional<alepha163.TString>;
|
|
97
|
+
requestBodyType: alepha163.TOptional<alepha163.TString>;
|
|
98
|
+
service: alepha163.TOptional<alepha163.TString>;
|
|
99
99
|
}>>;
|
|
100
100
|
}>;
|
|
101
101
|
}>;
|
|
@@ -108,34 +108,34 @@ declare class ServerAuthProvider {
|
|
|
108
108
|
protected readonly serverCookiesProvider: ServerCookiesProvider;
|
|
109
109
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
110
110
|
protected readonly serverLinksProvider: ServerLinksProvider;
|
|
111
|
-
protected readonly authorizationCode: alepha_server_cookies0.AbstractCookiePrimitive<
|
|
112
|
-
provider:
|
|
113
|
-
codeVerifier:
|
|
114
|
-
redirectUri:
|
|
115
|
-
state:
|
|
116
|
-
nonce:
|
|
111
|
+
protected readonly authorizationCode: alepha_server_cookies0.AbstractCookiePrimitive<alepha163.TObject<{
|
|
112
|
+
provider: alepha163.TString;
|
|
113
|
+
codeVerifier: alepha163.TOptional<alepha163.TString>;
|
|
114
|
+
redirectUri: alepha163.TOptional<alepha163.TString>;
|
|
115
|
+
state: alepha163.TOptional<alepha163.TString>;
|
|
116
|
+
nonce: alepha163.TOptional<alepha163.TString>;
|
|
117
117
|
}>>;
|
|
118
|
-
readonly tokens: alepha_server_cookies0.AbstractCookiePrimitive<
|
|
119
|
-
provider:
|
|
120
|
-
access_token:
|
|
121
|
-
issued_at:
|
|
122
|
-
expires_in:
|
|
123
|
-
refresh_token:
|
|
124
|
-
refresh_token_expires_in:
|
|
125
|
-
refresh_expires_in:
|
|
126
|
-
id_token:
|
|
127
|
-
scope:
|
|
118
|
+
readonly tokens: alepha_server_cookies0.AbstractCookiePrimitive<alepha163.TObject<{
|
|
119
|
+
provider: alepha163.TString;
|
|
120
|
+
access_token: alepha163.TString;
|
|
121
|
+
issued_at: alepha163.TNumber;
|
|
122
|
+
expires_in: alepha163.TOptional<alepha163.TNumber>;
|
|
123
|
+
refresh_token: alepha163.TOptional<alepha163.TString>;
|
|
124
|
+
refresh_token_expires_in: alepha163.TOptional<alepha163.TNumber>;
|
|
125
|
+
refresh_expires_in: alepha163.TOptional<alepha163.TNumber>;
|
|
126
|
+
id_token: alepha163.TOptional<alepha163.TString>;
|
|
127
|
+
scope: alepha163.TOptional<alepha163.TString>;
|
|
128
128
|
}>>;
|
|
129
129
|
get identities(): Array<AuthPrimitive>;
|
|
130
130
|
getAuthenticationProviders(filters?: {
|
|
131
131
|
realmName?: string;
|
|
132
132
|
}): AuthenticationProvider[];
|
|
133
|
-
protected readonly configure:
|
|
133
|
+
protected readonly configure: alepha163.HookPrimitive<"configure">;
|
|
134
134
|
protected getAccessTokens(tokens: Tokens): string | undefined;
|
|
135
135
|
/**
|
|
136
136
|
* Fill request headers with access token from cookies or fallback to provider's fallback function.
|
|
137
137
|
*/
|
|
138
|
-
protected readonly onRequest:
|
|
138
|
+
protected readonly onRequest: alepha163.HookPrimitive<"server:onRequest">;
|
|
139
139
|
/**
|
|
140
140
|
* Convert cookies to tokens.
|
|
141
141
|
* If the tokens are expired, try to refresh them using the refresh token.
|
|
@@ -146,26 +146,26 @@ declare class ServerAuthProvider {
|
|
|
146
146
|
* Get user information.
|
|
147
147
|
*/
|
|
148
148
|
readonly userinfo: alepha_server0.RoutePrimitive<{
|
|
149
|
-
response:
|
|
150
|
-
user:
|
|
151
|
-
id:
|
|
152
|
-
name:
|
|
153
|
-
email:
|
|
154
|
-
username:
|
|
155
|
-
picture:
|
|
156
|
-
sessionId:
|
|
157
|
-
organizations:
|
|
158
|
-
roles:
|
|
149
|
+
response: alepha163.TObject<{
|
|
150
|
+
user: alepha163.TOptional<alepha163.TObject<{
|
|
151
|
+
id: alepha163.TString;
|
|
152
|
+
name: alepha163.TOptional<alepha163.TString>;
|
|
153
|
+
email: alepha163.TOptional<alepha163.TString>;
|
|
154
|
+
username: alepha163.TOptional<alepha163.TString>;
|
|
155
|
+
picture: alepha163.TOptional<alepha163.TString>;
|
|
156
|
+
sessionId: alepha163.TOptional<alepha163.TString>;
|
|
157
|
+
organizations: alepha163.TOptional<alepha163.TArray<alepha163.TString>>;
|
|
158
|
+
roles: alepha163.TOptional<alepha163.TArray<alepha163.TString>>;
|
|
159
159
|
}>>;
|
|
160
|
-
api:
|
|
161
|
-
prefix:
|
|
162
|
-
links:
|
|
163
|
-
name:
|
|
164
|
-
group:
|
|
165
|
-
path:
|
|
166
|
-
method:
|
|
167
|
-
requestBodyType:
|
|
168
|
-
service:
|
|
160
|
+
api: alepha163.TObject<{
|
|
161
|
+
prefix: alepha163.TOptional<alepha163.TString>;
|
|
162
|
+
links: alepha163.TArray<alepha163.TObject<{
|
|
163
|
+
name: alepha163.TString;
|
|
164
|
+
group: alepha163.TOptional<alepha163.TString>;
|
|
165
|
+
path: alepha163.TString;
|
|
166
|
+
method: alepha163.TOptional<alepha163.TString>;
|
|
167
|
+
requestBodyType: alepha163.TOptional<alepha163.TString>;
|
|
168
|
+
service: alepha163.TOptional<alepha163.TString>;
|
|
169
169
|
}>>;
|
|
170
170
|
}>;
|
|
171
171
|
}>;
|
|
@@ -174,65 +174,65 @@ declare class ServerAuthProvider {
|
|
|
174
174
|
* Refresh a token for internal providers.
|
|
175
175
|
*/
|
|
176
176
|
readonly refresh: alepha_server0.RoutePrimitive<{
|
|
177
|
-
query:
|
|
178
|
-
provider:
|
|
177
|
+
query: alepha163.TObject<{
|
|
178
|
+
provider: alepha163.TString;
|
|
179
179
|
}>;
|
|
180
|
-
body:
|
|
181
|
-
refresh_token:
|
|
182
|
-
access_token:
|
|
180
|
+
body: alepha163.TObject<{
|
|
181
|
+
refresh_token: alepha163.TString;
|
|
182
|
+
access_token: alepha163.TOptional<alepha163.TString>;
|
|
183
183
|
}>;
|
|
184
|
-
response:
|
|
185
|
-
provider:
|
|
186
|
-
access_token:
|
|
187
|
-
issued_at:
|
|
188
|
-
expires_in:
|
|
189
|
-
refresh_token:
|
|
190
|
-
refresh_token_expires_in:
|
|
191
|
-
refresh_expires_in:
|
|
192
|
-
id_token:
|
|
193
|
-
scope:
|
|
184
|
+
response: alepha163.TObject<{
|
|
185
|
+
provider: alepha163.TString;
|
|
186
|
+
access_token: alepha163.TString;
|
|
187
|
+
issued_at: alepha163.TNumber;
|
|
188
|
+
expires_in: alepha163.TOptional<alepha163.TNumber>;
|
|
189
|
+
refresh_token: alepha163.TOptional<alepha163.TString>;
|
|
190
|
+
refresh_token_expires_in: alepha163.TOptional<alepha163.TNumber>;
|
|
191
|
+
refresh_expires_in: alepha163.TOptional<alepha163.TNumber>;
|
|
192
|
+
id_token: alepha163.TOptional<alepha163.TString>;
|
|
193
|
+
scope: alepha163.TOptional<alepha163.TString>;
|
|
194
194
|
}>;
|
|
195
195
|
}>;
|
|
196
196
|
/**
|
|
197
197
|
* Login for local password-based authentication.
|
|
198
198
|
*/
|
|
199
199
|
readonly token: alepha_server0.RoutePrimitive<{
|
|
200
|
-
query:
|
|
201
|
-
provider:
|
|
200
|
+
query: alepha163.TObject<{
|
|
201
|
+
provider: alepha163.TString;
|
|
202
202
|
}>;
|
|
203
|
-
body:
|
|
204
|
-
username:
|
|
205
|
-
password:
|
|
203
|
+
body: alepha163.TObject<{
|
|
204
|
+
username: alepha163.TString;
|
|
205
|
+
password: alepha163.TString;
|
|
206
206
|
}>;
|
|
207
|
-
response:
|
|
208
|
-
provider:
|
|
209
|
-
access_token:
|
|
210
|
-
issued_at:
|
|
211
|
-
expires_in:
|
|
212
|
-
refresh_token:
|
|
213
|
-
refresh_token_expires_in:
|
|
214
|
-
refresh_expires_in:
|
|
215
|
-
id_token:
|
|
216
|
-
scope:
|
|
217
|
-
user:
|
|
218
|
-
id:
|
|
219
|
-
name:
|
|
220
|
-
email:
|
|
221
|
-
username:
|
|
222
|
-
picture:
|
|
223
|
-
sessionId:
|
|
224
|
-
organizations:
|
|
225
|
-
roles:
|
|
207
|
+
response: alepha163.TObject<{
|
|
208
|
+
provider: alepha163.TString;
|
|
209
|
+
access_token: alepha163.TString;
|
|
210
|
+
issued_at: alepha163.TNumber;
|
|
211
|
+
expires_in: alepha163.TOptional<alepha163.TNumber>;
|
|
212
|
+
refresh_token: alepha163.TOptional<alepha163.TString>;
|
|
213
|
+
refresh_token_expires_in: alepha163.TOptional<alepha163.TNumber>;
|
|
214
|
+
refresh_expires_in: alepha163.TOptional<alepha163.TNumber>;
|
|
215
|
+
id_token: alepha163.TOptional<alepha163.TString>;
|
|
216
|
+
scope: alepha163.TOptional<alepha163.TString>;
|
|
217
|
+
user: alepha163.TObject<{
|
|
218
|
+
id: alepha163.TString;
|
|
219
|
+
name: alepha163.TOptional<alepha163.TString>;
|
|
220
|
+
email: alepha163.TOptional<alepha163.TString>;
|
|
221
|
+
username: alepha163.TOptional<alepha163.TString>;
|
|
222
|
+
picture: alepha163.TOptional<alepha163.TString>;
|
|
223
|
+
sessionId: alepha163.TOptional<alepha163.TString>;
|
|
224
|
+
organizations: alepha163.TOptional<alepha163.TArray<alepha163.TString>>;
|
|
225
|
+
roles: alepha163.TOptional<alepha163.TArray<alepha163.TString>>;
|
|
226
226
|
}>;
|
|
227
|
-
api:
|
|
228
|
-
prefix:
|
|
229
|
-
links:
|
|
230
|
-
name:
|
|
231
|
-
group:
|
|
232
|
-
path:
|
|
233
|
-
method:
|
|
234
|
-
requestBodyType:
|
|
235
|
-
service:
|
|
227
|
+
api: alepha163.TObject<{
|
|
228
|
+
prefix: alepha163.TOptional<alepha163.TString>;
|
|
229
|
+
links: alepha163.TArray<alepha163.TObject<{
|
|
230
|
+
name: alepha163.TString;
|
|
231
|
+
group: alepha163.TOptional<alepha163.TString>;
|
|
232
|
+
path: alepha163.TString;
|
|
233
|
+
method: alepha163.TOptional<alepha163.TString>;
|
|
234
|
+
requestBodyType: alepha163.TOptional<alepha163.TString>;
|
|
235
|
+
service: alepha163.TOptional<alepha163.TString>;
|
|
236
236
|
}>>;
|
|
237
237
|
}>;
|
|
238
238
|
}>;
|
|
@@ -241,9 +241,9 @@ declare class ServerAuthProvider {
|
|
|
241
241
|
* Oauth2/OIDC login route.
|
|
242
242
|
*/
|
|
243
243
|
readonly login: alepha_server0.RoutePrimitive<{
|
|
244
|
-
query:
|
|
245
|
-
provider:
|
|
246
|
-
redirect_uri:
|
|
244
|
+
query: alepha163.TObject<{
|
|
245
|
+
provider: alepha163.TString;
|
|
246
|
+
redirect_uri: alepha163.TOptional<alepha163.TString>;
|
|
247
247
|
}>;
|
|
248
248
|
}>;
|
|
249
249
|
/**
|
|
@@ -255,8 +255,8 @@ declare class ServerAuthProvider {
|
|
|
255
255
|
* Logout route for OAuth2/OIDC providers.
|
|
256
256
|
*/
|
|
257
257
|
readonly logout: alepha_server0.RoutePrimitive<{
|
|
258
|
-
query:
|
|
259
|
-
post_logout_redirect_uri:
|
|
258
|
+
query: alepha163.TObject<{
|
|
259
|
+
post_logout_redirect_uri: alepha163.TOptional<alepha163.TString>;
|
|
260
260
|
}>;
|
|
261
261
|
}>;
|
|
262
262
|
protected provider(opts: string | {
|
|
@@ -577,7 +577,7 @@ declare module "alepha" {
|
|
|
577
577
|
* @see {@link ServerAuthProvider}
|
|
578
578
|
* @module alepha.server.auth
|
|
579
579
|
*/
|
|
580
|
-
declare const AlephaServerAuth:
|
|
580
|
+
declare const AlephaServerAuth: alepha163.Service<alepha163.Module>;
|
|
581
581
|
//#endregion
|
|
582
582
|
export { $auth, $authCredentials, $authGithub, $authGoogle, AccessToken, AlephaServerAuth, AuthExternal, AuthInternal, AuthPrimitive, AuthPrimitiveOptions, AuthenticationProvider, Credentials, CredentialsFn, CredentialsOptions, LinkAccountFn, LinkAccountOptions, OAuth2Options, OAuth2Profile, OidcOptions, ServerAuthProvider, TokenResponse, Tokens, UserinfoResponse, WithLinkFn, WithLoginFn, alephaServerAuthRoutes, authenticationProviderSchema, tokenResponseSchema, tokensSchema, userinfoResponseSchema };
|
|
583
583
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as alepha42 from "alepha";
|
|
2
2
|
import { Alepha, KIND, Primitive, Static, TObject, TString, TUnion } from "alepha";
|
|
3
3
|
import * as alepha_topic0 from "alepha/topic";
|
|
4
|
-
import * as
|
|
4
|
+
import * as alepha_logger1 from "alepha/logger";
|
|
5
5
|
import { WebSocket as WebSocket$1, WebSocketServer } from "ws";
|
|
6
6
|
import { IncomingMessage } from "node:http";
|
|
7
7
|
|
|
@@ -452,7 +452,7 @@ declare class WebSocketPrimitive<TClient extends TWSObject, TServer extends TWSO
|
|
|
452
452
|
* and messages can be targeted to specific rooms.
|
|
453
453
|
*/
|
|
454
454
|
declare class RoomManager {
|
|
455
|
-
protected readonly log:
|
|
455
|
+
protected readonly log: alepha_logger1.Logger;
|
|
456
456
|
/**
|
|
457
457
|
* Maps roomId → Set<connectionId>
|
|
458
458
|
*/
|
|
@@ -533,7 +533,7 @@ declare class WebSocketChannelConnection<TClient extends TWSObject, TServer exte
|
|
|
533
533
|
};
|
|
534
534
|
protected readonly env: Static<typeof envSchema$1>;
|
|
535
535
|
protected readonly alepha: Alepha;
|
|
536
|
-
protected readonly log:
|
|
536
|
+
protected readonly log: alepha_logger1.Logger;
|
|
537
537
|
protected ws?: WebSocket;
|
|
538
538
|
protected reconnectAttempts: number;
|
|
539
539
|
protected reconnectTimer?: number;
|
|
@@ -607,7 +607,7 @@ declare class WebSocketChannelConnection<TClient extends TWSObject, TServer exte
|
|
|
607
607
|
* One connection per channel, multiple rooms per connection.
|
|
608
608
|
*/
|
|
609
609
|
declare class WebSocketClient {
|
|
610
|
-
protected readonly log:
|
|
610
|
+
protected readonly log: alepha_logger1.Logger;
|
|
611
611
|
protected readonly alepha: Alepha;
|
|
612
612
|
protected readonly env: {
|
|
613
613
|
WEBSOCKET_URL: string;
|
|
@@ -694,7 +694,7 @@ declare const webSocketMessageSchema: {
|
|
|
694
694
|
* - Horizontal scaling without losing messages
|
|
695
695
|
*/
|
|
696
696
|
declare class WebSocketTopicService {
|
|
697
|
-
protected readonly log:
|
|
697
|
+
protected readonly log: alepha_logger1.Logger;
|
|
698
698
|
/**
|
|
699
699
|
* Handler function to be called when a message is received from the topic
|
|
700
700
|
* This is set by the WebSocket provider during initialization
|
|
@@ -756,7 +756,7 @@ declare class NodeWebSocketServerProvider extends WebSocketServerProvider {
|
|
|
756
756
|
protected readonly alepha: Alepha;
|
|
757
757
|
protected readonly roomManager: RoomManager;
|
|
758
758
|
protected readonly topicService: WebSocketTopicService;
|
|
759
|
-
protected readonly log:
|
|
759
|
+
protected readonly log: alepha_logger1.Logger;
|
|
760
760
|
protected readonly env: {
|
|
761
761
|
WEBSOCKET_PATH: string;
|
|
762
762
|
};
|
|
@@ -796,7 +796,7 @@ declare class NodeWebSocketConnection implements WebSocketConnection {
|
|
|
796
796
|
protected readonly ws: WebSocket$1;
|
|
797
797
|
protected readonly provider: NodeWebSocketServerProvider;
|
|
798
798
|
protected readonly endpoint: WebSocketPrimitiveOptions<any, any>;
|
|
799
|
-
protected readonly log:
|
|
799
|
+
protected readonly log: alepha_logger1.Logger;
|
|
800
800
|
metadata?: Record<string, any>;
|
|
801
801
|
constructor(id: string, userId: string | undefined, roomIds: string[], ws: WebSocket$1, provider: NodeWebSocketServerProvider, endpoint: WebSocketPrimitiveOptions<any, any>);
|
|
802
802
|
get readyState(): WebSocketState;
|