alepha 0.13.4 → 0.13.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-files/index.browser.js +5 -5
- package/dist/api-files/index.d.ts +191 -191
- package/dist/api-files/index.js +9 -9
- package/dist/api-jobs/index.browser.js +5 -5
- package/dist/api-jobs/index.d.ts +173 -173
- package/dist/api-jobs/index.js +9 -9
- package/dist/api-notifications/index.browser.js +11 -11
- package/dist/api-notifications/index.d.ts +11 -11
- package/dist/api-notifications/index.js +11 -11
- package/dist/api-parameters/index.browser.js +2 -2
- package/dist/api-parameters/index.d.ts +3 -3
- package/dist/api-parameters/index.js +3 -3
- package/dist/api-users/index.browser.js +6 -6
- package/dist/api-users/index.d.ts +55 -55
- package/dist/api-users/index.js +36 -36
- package/dist/api-verifications/index.browser.js +5 -5
- package/dist/api-verifications/index.d.ts +21 -21
- package/dist/api-verifications/index.js +10 -10
- package/dist/batch/index.d.ts +3 -3
- package/dist/batch/index.js +3 -3
- package/dist/bin/index.js +1 -1
- package/dist/bucket/index.d.ts +6 -6
- package/dist/bucket/index.js +7 -7
- package/dist/cache/index.d.ts +4 -4
- package/dist/cache/index.js +5 -5
- package/dist/cache-redis/index.d.ts +2 -2
- package/dist/cache-redis/index.js +2 -2
- package/dist/cli/{dist-lGnqsKpu.js → dist-BlfFtOk2.js} +16 -16
- package/dist/cli/{dist-lGnqsKpu.js.map → dist-BlfFtOk2.js.map} +1 -1
- package/dist/cli/index.d.ts +31 -75
- package/dist/cli/index.js +94 -171
- package/dist/cli/index.js.map +1 -1
- package/dist/command/index.d.ts +8 -8
- package/dist/command/index.js +11 -10
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +35 -35
- package/dist/core/index.d.ts +39 -39
- package/dist/core/index.js +35 -35
- package/dist/core/index.native.js +35 -35
- package/dist/datetime/index.d.ts +3 -3
- package/dist/datetime/index.js +3 -3
- package/dist/email/index.d.ts +11 -11
- package/dist/email/index.js +42 -42
- package/dist/fake/index.d.ts +2 -2
- package/dist/fake/index.js +5 -5
- package/dist/file/index.d.ts +4 -4
- package/dist/file/index.js +4 -4
- package/dist/lock/index.d.ts +5 -5
- package/dist/lock/index.js +5 -5
- package/dist/lock-redis/index.d.ts +2 -2
- package/dist/lock-redis/index.js +2 -2
- package/dist/logger/index.d.ts +11 -11
- package/dist/logger/index.js +12 -12
- package/dist/orm/index.browser.js +12 -12
- package/dist/orm/index.d.ts +52 -52
- package/dist/orm/index.js +32 -32
- package/dist/queue/index.d.ts +7 -7
- package/dist/queue/index.js +6 -6
- package/dist/queue-redis/index.d.ts +2 -2
- package/dist/queue-redis/index.js +2 -2
- package/dist/redis/index.d.ts +13 -13
- package/dist/redis/index.js +3 -3
- package/dist/retry/index.d.ts +5 -5
- package/dist/retry/index.js +5 -5
- package/dist/router/index.d.ts +1 -1
- package/dist/router/index.js +1 -1
- package/dist/scheduler/index.d.ts +4 -4
- package/dist/scheduler/index.js +7 -7
- package/dist/security/index.browser.js +7 -7
- package/dist/security/index.d.ts +15 -15
- package/dist/security/index.js +46 -46
- package/dist/server/index.browser.js +14 -14
- package/dist/server/index.d.ts +26 -26
- package/dist/server/index.js +26 -26
- package/dist/server-auth/index.browser.js +6 -6
- package/dist/server-auth/index.d.ts +163 -163
- package/dist/server-auth/index.js +13 -13
- package/dist/server-cache/index.d.ts +2 -2
- package/dist/server-cache/index.js +2 -2
- package/dist/server-compress/index.d.ts +2 -2
- package/dist/server-compress/index.js +2 -2
- package/dist/server-cookies/index.browser.js +3 -3
- package/dist/server-cookies/index.d.ts +4 -4
- package/dist/server-cookies/index.js +4 -4
- package/dist/server-cors/index.d.ts +3 -3
- package/dist/server-cors/index.js +3 -3
- package/dist/server-health/index.d.ts +3 -3
- package/dist/server-health/index.js +3 -3
- package/dist/server-helmet/index.d.ts +2 -2
- package/dist/server-helmet/index.js +2 -2
- package/dist/server-links/index.browser.js +5 -5
- package/dist/server-links/index.d.ts +40 -40
- package/dist/server-links/index.js +7 -7
- package/dist/server-metrics/index.d.ts +2 -2
- package/dist/server-metrics/index.js +86 -86
- package/dist/server-multipart/index.d.ts +2 -2
- package/dist/server-multipart/index.js +2 -2
- package/dist/server-proxy/index.d.ts +3 -3
- package/dist/server-proxy/index.js +3 -3
- package/dist/server-rate-limit/index.d.ts +3 -3
- package/dist/server-rate-limit/index.js +3 -3
- package/dist/server-security/index.browser.js +1 -1
- package/dist/server-security/index.d.ts +13 -13
- package/dist/server-security/index.js +4 -4
- package/dist/server-static/index.d.ts +3 -3
- package/dist/server-static/index.js +3 -3
- package/dist/server-swagger/index.d.ts +3 -3
- package/dist/server-swagger/index.js +3 -3
- package/dist/sms/index.d.ts +6 -6
- package/dist/sms/index.js +6 -6
- package/dist/thread/index.d.ts +3 -3
- package/dist/thread/index.js +3 -3
- package/dist/topic/index.d.ts +6 -6
- package/dist/topic/index.js +6 -6
- package/dist/topic-redis/index.d.ts +2 -2
- package/dist/topic-redis/index.js +2 -2
- package/dist/vite/index.d.ts +17 -17
- package/dist/vite/index.js +20 -20
- package/dist/websocket/index.browser.js +9 -9
- package/dist/websocket/index.d.ts +17 -17
- package/dist/websocket/index.js +10 -10
- package/package.json +5 -4
- package/src/cli/apps/AlephaCli.ts +1 -2
- package/src/cli/commands/BiomeCommands.ts +4 -6
- package/src/cli/commands/CoreCommands.ts +2 -2
- package/src/cli/commands/DrizzleCommands.ts +76 -78
- package/src/cli/commands/VerifyCommands.ts +3 -5
- package/src/cli/commands/ViteCommands.ts +6 -8
- package/src/cli/index.ts +1 -1
- package/src/cli/services/{ProjectUtils.ts → AlephaCliUtils.ts} +101 -16
- package/src/command/providers/CliProvider.ts +12 -4
- package/src/cli/services/ProcessRunner.ts +0 -89
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as alepha147 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";
|
|
@@ -9,7 +9,7 @@ import * as alepha_server0 from "alepha/server";
|
|
|
9
9
|
import { ServerLinksProvider } from "alepha/server/links";
|
|
10
10
|
import { Configuration } from "openid-client";
|
|
11
11
|
|
|
12
|
-
//#region src/server-auth/constants/routes.d.ts
|
|
12
|
+
//#region ../../src/server-auth/constants/routes.d.ts
|
|
13
13
|
declare const alephaServerAuthRoutes: {
|
|
14
14
|
login: string;
|
|
15
15
|
callback: string;
|
|
@@ -19,123 +19,123 @@ declare const alephaServerAuthRoutes: {
|
|
|
19
19
|
userinfo: string;
|
|
20
20
|
};
|
|
21
21
|
//#endregion
|
|
22
|
-
//#region src/server-auth/schemas/authenticationProviderSchema.d.ts
|
|
23
|
-
declare const authenticationProviderSchema:
|
|
24
|
-
name:
|
|
25
|
-
type:
|
|
22
|
+
//#region ../../src/server-auth/schemas/authenticationProviderSchema.d.ts
|
|
23
|
+
declare const authenticationProviderSchema: alepha147.TObject<{
|
|
24
|
+
name: alepha147.TString;
|
|
25
|
+
type: alepha147.TUnsafe<"OAUTH2" | "OIDC" | "CREDENTIALS">;
|
|
26
26
|
}>;
|
|
27
27
|
type AuthenticationProvider = Static<typeof authenticationProviderSchema>;
|
|
28
28
|
//#endregion
|
|
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:
|
|
29
|
+
//#region ../../src/server-auth/schemas/tokenResponseSchema.d.ts
|
|
30
|
+
declare const tokenResponseSchema: alepha147.TObject<{
|
|
31
|
+
provider: alepha147.TString;
|
|
32
|
+
access_token: alepha147.TString;
|
|
33
|
+
issued_at: alepha147.TNumber;
|
|
34
|
+
expires_in: alepha147.TOptional<alepha147.TNumber>;
|
|
35
|
+
refresh_token: alepha147.TOptional<alepha147.TString>;
|
|
36
|
+
refresh_token_expires_in: alepha147.TOptional<alepha147.TNumber>;
|
|
37
|
+
refresh_expires_in: alepha147.TOptional<alepha147.TNumber>;
|
|
38
|
+
id_token: alepha147.TOptional<alepha147.TString>;
|
|
39
|
+
scope: alepha147.TOptional<alepha147.TString>;
|
|
40
|
+
user: alepha147.TObject<{
|
|
41
|
+
id: alepha147.TString;
|
|
42
|
+
name: alepha147.TOptional<alepha147.TString>;
|
|
43
|
+
email: alepha147.TOptional<alepha147.TString>;
|
|
44
|
+
username: alepha147.TOptional<alepha147.TString>;
|
|
45
|
+
picture: alepha147.TOptional<alepha147.TString>;
|
|
46
|
+
sessionId: alepha147.TOptional<alepha147.TString>;
|
|
47
|
+
organizations: alepha147.TOptional<alepha147.TArray<alepha147.TString>>;
|
|
48
|
+
roles: alepha147.TOptional<alepha147.TArray<alepha147.TString>>;
|
|
49
49
|
}>;
|
|
50
|
-
api:
|
|
51
|
-
prefix:
|
|
52
|
-
links:
|
|
53
|
-
name:
|
|
54
|
-
group:
|
|
55
|
-
path:
|
|
56
|
-
method:
|
|
57
|
-
requestBodyType:
|
|
58
|
-
service:
|
|
50
|
+
api: alepha147.TObject<{
|
|
51
|
+
prefix: alepha147.TOptional<alepha147.TString>;
|
|
52
|
+
links: alepha147.TArray<alepha147.TObject<{
|
|
53
|
+
name: alepha147.TString;
|
|
54
|
+
group: alepha147.TOptional<alepha147.TString>;
|
|
55
|
+
path: alepha147.TString;
|
|
56
|
+
method: alepha147.TOptional<alepha147.TString>;
|
|
57
|
+
requestBodyType: alepha147.TOptional<alepha147.TString>;
|
|
58
|
+
service: alepha147.TOptional<alepha147.TString>;
|
|
59
59
|
}>>;
|
|
60
60
|
}>;
|
|
61
61
|
}>;
|
|
62
62
|
type TokenResponse = Static<typeof tokenResponseSchema>;
|
|
63
63
|
//#endregion
|
|
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:
|
|
64
|
+
//#region ../../src/server-auth/schemas/tokensSchema.d.ts
|
|
65
|
+
declare const tokensSchema: alepha147.TObject<{
|
|
66
|
+
provider: alepha147.TString;
|
|
67
|
+
access_token: alepha147.TString;
|
|
68
|
+
issued_at: alepha147.TNumber;
|
|
69
|
+
expires_in: alepha147.TOptional<alepha147.TNumber>;
|
|
70
|
+
refresh_token: alepha147.TOptional<alepha147.TString>;
|
|
71
|
+
refresh_token_expires_in: alepha147.TOptional<alepha147.TNumber>;
|
|
72
|
+
refresh_expires_in: alepha147.TOptional<alepha147.TNumber>;
|
|
73
|
+
id_token: alepha147.TOptional<alepha147.TString>;
|
|
74
|
+
scope: alepha147.TOptional<alepha147.TString>;
|
|
75
75
|
}>;
|
|
76
76
|
type Tokens = Static<typeof tokensSchema>;
|
|
77
77
|
//#endregion
|
|
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:
|
|
78
|
+
//#region ../../src/server-auth/schemas/userinfoResponseSchema.d.ts
|
|
79
|
+
declare const userinfoResponseSchema: alepha147.TObject<{
|
|
80
|
+
user: alepha147.TOptional<alepha147.TObject<{
|
|
81
|
+
id: alepha147.TString;
|
|
82
|
+
name: alepha147.TOptional<alepha147.TString>;
|
|
83
|
+
email: alepha147.TOptional<alepha147.TString>;
|
|
84
|
+
username: alepha147.TOptional<alepha147.TString>;
|
|
85
|
+
picture: alepha147.TOptional<alepha147.TString>;
|
|
86
|
+
sessionId: alepha147.TOptional<alepha147.TString>;
|
|
87
|
+
organizations: alepha147.TOptional<alepha147.TArray<alepha147.TString>>;
|
|
88
|
+
roles: alepha147.TOptional<alepha147.TArray<alepha147.TString>>;
|
|
89
89
|
}>>;
|
|
90
|
-
api:
|
|
91
|
-
prefix:
|
|
92
|
-
links:
|
|
93
|
-
name:
|
|
94
|
-
group:
|
|
95
|
-
path:
|
|
96
|
-
method:
|
|
97
|
-
requestBodyType:
|
|
98
|
-
service:
|
|
90
|
+
api: alepha147.TObject<{
|
|
91
|
+
prefix: alepha147.TOptional<alepha147.TString>;
|
|
92
|
+
links: alepha147.TArray<alepha147.TObject<{
|
|
93
|
+
name: alepha147.TString;
|
|
94
|
+
group: alepha147.TOptional<alepha147.TString>;
|
|
95
|
+
path: alepha147.TString;
|
|
96
|
+
method: alepha147.TOptional<alepha147.TString>;
|
|
97
|
+
requestBodyType: alepha147.TOptional<alepha147.TString>;
|
|
98
|
+
service: alepha147.TOptional<alepha147.TString>;
|
|
99
99
|
}>>;
|
|
100
100
|
}>;
|
|
101
101
|
}>;
|
|
102
102
|
type UserinfoResponse = Static<typeof userinfoResponseSchema>;
|
|
103
103
|
//#endregion
|
|
104
|
-
//#region src/server-auth/providers/ServerAuthProvider.d.ts
|
|
104
|
+
//#region ../../src/server-auth/providers/ServerAuthProvider.d.ts
|
|
105
105
|
declare class ServerAuthProvider {
|
|
106
106
|
protected readonly log: alepha_logger0.Logger;
|
|
107
107
|
protected readonly alepha: Alepha;
|
|
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<alepha147.TObject<{
|
|
112
|
+
provider: alepha147.TString;
|
|
113
|
+
codeVerifier: alepha147.TOptional<alepha147.TString>;
|
|
114
|
+
redirectUri: alepha147.TOptional<alepha147.TString>;
|
|
115
|
+
state: alepha147.TOptional<alepha147.TString>;
|
|
116
|
+
nonce: alepha147.TOptional<alepha147.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<alepha147.TObject<{
|
|
119
|
+
provider: alepha147.TString;
|
|
120
|
+
access_token: alepha147.TString;
|
|
121
|
+
issued_at: alepha147.TNumber;
|
|
122
|
+
expires_in: alepha147.TOptional<alepha147.TNumber>;
|
|
123
|
+
refresh_token: alepha147.TOptional<alepha147.TString>;
|
|
124
|
+
refresh_token_expires_in: alepha147.TOptional<alepha147.TNumber>;
|
|
125
|
+
refresh_expires_in: alepha147.TOptional<alepha147.TNumber>;
|
|
126
|
+
id_token: alepha147.TOptional<alepha147.TString>;
|
|
127
|
+
scope: alepha147.TOptional<alepha147.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: alepha147.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: alepha147.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: alepha147.TObject<{
|
|
150
|
+
user: alepha147.TOptional<alepha147.TObject<{
|
|
151
|
+
id: alepha147.TString;
|
|
152
|
+
name: alepha147.TOptional<alepha147.TString>;
|
|
153
|
+
email: alepha147.TOptional<alepha147.TString>;
|
|
154
|
+
username: alepha147.TOptional<alepha147.TString>;
|
|
155
|
+
picture: alepha147.TOptional<alepha147.TString>;
|
|
156
|
+
sessionId: alepha147.TOptional<alepha147.TString>;
|
|
157
|
+
organizations: alepha147.TOptional<alepha147.TArray<alepha147.TString>>;
|
|
158
|
+
roles: alepha147.TOptional<alepha147.TArray<alepha147.TString>>;
|
|
159
159
|
}>>;
|
|
160
|
-
api:
|
|
161
|
-
prefix:
|
|
162
|
-
links:
|
|
163
|
-
name:
|
|
164
|
-
group:
|
|
165
|
-
path:
|
|
166
|
-
method:
|
|
167
|
-
requestBodyType:
|
|
168
|
-
service:
|
|
160
|
+
api: alepha147.TObject<{
|
|
161
|
+
prefix: alepha147.TOptional<alepha147.TString>;
|
|
162
|
+
links: alepha147.TArray<alepha147.TObject<{
|
|
163
|
+
name: alepha147.TString;
|
|
164
|
+
group: alepha147.TOptional<alepha147.TString>;
|
|
165
|
+
path: alepha147.TString;
|
|
166
|
+
method: alepha147.TOptional<alepha147.TString>;
|
|
167
|
+
requestBodyType: alepha147.TOptional<alepha147.TString>;
|
|
168
|
+
service: alepha147.TOptional<alepha147.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: alepha147.TObject<{
|
|
178
|
+
provider: alepha147.TString;
|
|
179
179
|
}>;
|
|
180
|
-
body:
|
|
181
|
-
refresh_token:
|
|
182
|
-
access_token:
|
|
180
|
+
body: alepha147.TObject<{
|
|
181
|
+
refresh_token: alepha147.TString;
|
|
182
|
+
access_token: alepha147.TOptional<alepha147.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: alepha147.TObject<{
|
|
185
|
+
provider: alepha147.TString;
|
|
186
|
+
access_token: alepha147.TString;
|
|
187
|
+
issued_at: alepha147.TNumber;
|
|
188
|
+
expires_in: alepha147.TOptional<alepha147.TNumber>;
|
|
189
|
+
refresh_token: alepha147.TOptional<alepha147.TString>;
|
|
190
|
+
refresh_token_expires_in: alepha147.TOptional<alepha147.TNumber>;
|
|
191
|
+
refresh_expires_in: alepha147.TOptional<alepha147.TNumber>;
|
|
192
|
+
id_token: alepha147.TOptional<alepha147.TString>;
|
|
193
|
+
scope: alepha147.TOptional<alepha147.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: alepha147.TObject<{
|
|
201
|
+
provider: alepha147.TString;
|
|
202
202
|
}>;
|
|
203
|
-
body:
|
|
204
|
-
username:
|
|
205
|
-
password:
|
|
203
|
+
body: alepha147.TObject<{
|
|
204
|
+
username: alepha147.TString;
|
|
205
|
+
password: alepha147.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: alepha147.TObject<{
|
|
208
|
+
provider: alepha147.TString;
|
|
209
|
+
access_token: alepha147.TString;
|
|
210
|
+
issued_at: alepha147.TNumber;
|
|
211
|
+
expires_in: alepha147.TOptional<alepha147.TNumber>;
|
|
212
|
+
refresh_token: alepha147.TOptional<alepha147.TString>;
|
|
213
|
+
refresh_token_expires_in: alepha147.TOptional<alepha147.TNumber>;
|
|
214
|
+
refresh_expires_in: alepha147.TOptional<alepha147.TNumber>;
|
|
215
|
+
id_token: alepha147.TOptional<alepha147.TString>;
|
|
216
|
+
scope: alepha147.TOptional<alepha147.TString>;
|
|
217
|
+
user: alepha147.TObject<{
|
|
218
|
+
id: alepha147.TString;
|
|
219
|
+
name: alepha147.TOptional<alepha147.TString>;
|
|
220
|
+
email: alepha147.TOptional<alepha147.TString>;
|
|
221
|
+
username: alepha147.TOptional<alepha147.TString>;
|
|
222
|
+
picture: alepha147.TOptional<alepha147.TString>;
|
|
223
|
+
sessionId: alepha147.TOptional<alepha147.TString>;
|
|
224
|
+
organizations: alepha147.TOptional<alepha147.TArray<alepha147.TString>>;
|
|
225
|
+
roles: alepha147.TOptional<alepha147.TArray<alepha147.TString>>;
|
|
226
226
|
}>;
|
|
227
|
-
api:
|
|
228
|
-
prefix:
|
|
229
|
-
links:
|
|
230
|
-
name:
|
|
231
|
-
group:
|
|
232
|
-
path:
|
|
233
|
-
method:
|
|
234
|
-
requestBodyType:
|
|
235
|
-
service:
|
|
227
|
+
api: alepha147.TObject<{
|
|
228
|
+
prefix: alepha147.TOptional<alepha147.TString>;
|
|
229
|
+
links: alepha147.TArray<alepha147.TObject<{
|
|
230
|
+
name: alepha147.TString;
|
|
231
|
+
group: alepha147.TOptional<alepha147.TString>;
|
|
232
|
+
path: alepha147.TString;
|
|
233
|
+
method: alepha147.TOptional<alepha147.TString>;
|
|
234
|
+
requestBodyType: alepha147.TOptional<alepha147.TString>;
|
|
235
|
+
service: alepha147.TOptional<alepha147.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: alepha147.TObject<{
|
|
245
|
+
provider: alepha147.TString;
|
|
246
|
+
redirect_uri: alepha147.TOptional<alepha147.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: alepha147.TObject<{
|
|
259
|
+
post_logout_redirect_uri: alepha147.TOptional<alepha147.TString>;
|
|
260
260
|
}>;
|
|
261
261
|
}>;
|
|
262
262
|
protected provider(opts: string | {
|
|
@@ -295,7 +295,7 @@ interface OAuth2Profile {
|
|
|
295
295
|
[key: string]: unknown;
|
|
296
296
|
}
|
|
297
297
|
//#endregion
|
|
298
|
-
//#region src/server-auth/primitives/$auth.d.ts
|
|
298
|
+
//#region ../../src/server-auth/primitives/$auth.d.ts
|
|
299
299
|
/**
|
|
300
300
|
* Creates an authentication provider primitive for handling user login flows.
|
|
301
301
|
*
|
|
@@ -519,7 +519,7 @@ interface WithLoginFn {
|
|
|
519
519
|
login?: (provider: string) => (creds: Credentials) => Async<UserAccount | undefined>;
|
|
520
520
|
}
|
|
521
521
|
//#endregion
|
|
522
|
-
//#region src/server-auth/primitives/$authCredentials.d.ts
|
|
522
|
+
//#region ../../src/server-auth/primitives/$authCredentials.d.ts
|
|
523
523
|
/**
|
|
524
524
|
* Already configured Credentials authentication primitive.
|
|
525
525
|
*
|
|
@@ -527,7 +527,7 @@ interface WithLoginFn {
|
|
|
527
527
|
*/
|
|
528
528
|
declare const $authCredentials: (realm: RealmPrimitive & WithLoginFn, options?: Partial<CredentialsOptions>) => AuthPrimitive;
|
|
529
529
|
//#endregion
|
|
530
|
-
//#region src/server-auth/primitives/$authGithub.d.ts
|
|
530
|
+
//#region ../../src/server-auth/primitives/$authGithub.d.ts
|
|
531
531
|
/**
|
|
532
532
|
* Already configured GitHub authentication primitive.
|
|
533
533
|
*
|
|
@@ -540,7 +540,7 @@ declare const $authCredentials: (realm: RealmPrimitive & WithLoginFn, options?:
|
|
|
540
540
|
*/
|
|
541
541
|
declare const $authGithub: (realm: RealmPrimitive & WithLinkFn, options?: Partial<OidcOptions>) => AuthPrimitive;
|
|
542
542
|
//#endregion
|
|
543
|
-
//#region src/server-auth/primitives/$authGoogle.d.ts
|
|
543
|
+
//#region ../../src/server-auth/primitives/$authGoogle.d.ts
|
|
544
544
|
/**
|
|
545
545
|
* Already configured Google authentication primitive.
|
|
546
546
|
*
|
|
@@ -553,7 +553,7 @@ declare const $authGithub: (realm: RealmPrimitive & WithLinkFn, options?: Partia
|
|
|
553
553
|
*/
|
|
554
554
|
declare const $authGoogle: (realm: RealmPrimitive & WithLinkFn, options?: Partial<OidcOptions>) => AuthPrimitive;
|
|
555
555
|
//#endregion
|
|
556
|
-
//#region src/server-auth/index.d.ts
|
|
556
|
+
//#region ../../src/server-auth/index.d.ts
|
|
557
557
|
declare module "alepha" {
|
|
558
558
|
interface State {
|
|
559
559
|
/**
|
|
@@ -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: alepha147.Service<alepha147.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
|
|
@@ -6,7 +6,7 @@ import { $logger } from "alepha/logger";
|
|
|
6
6
|
import { $route, BadRequestError } from "alepha/server";
|
|
7
7
|
import { ServerLinksProvider, apiLinksResponseSchema } from "alepha/server/links";
|
|
8
8
|
|
|
9
|
-
//#region
|
|
9
|
+
//#region ../../../../node_modules/oauth4webapi/build/index.js
|
|
10
10
|
let USER_AGENT$1;
|
|
11
11
|
if (typeof navigator === "undefined" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) USER_AGENT$1 = `oauth4webapi/v3.8.3`;
|
|
12
12
|
function looseInstanceOf(input, expected) {
|
|
@@ -844,7 +844,7 @@ const _nodiscoverycheck = Symbol();
|
|
|
844
844
|
const _expectedIssuer = Symbol();
|
|
845
845
|
|
|
846
846
|
//#endregion
|
|
847
|
-
//#region
|
|
847
|
+
//#region ../../../../node_modules/openid-client/build/index.js
|
|
848
848
|
let headers;
|
|
849
849
|
let USER_AGENT;
|
|
850
850
|
if (typeof navigator === "undefined" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) {
|
|
@@ -1238,7 +1238,7 @@ function retryable(err, options) {
|
|
|
1238
1238
|
const retry = Symbol();
|
|
1239
1239
|
|
|
1240
1240
|
//#endregion
|
|
1241
|
-
//#region src/server-auth/primitives/$auth.ts
|
|
1241
|
+
//#region ../../src/server-auth/primitives/$auth.ts
|
|
1242
1242
|
/**
|
|
1243
1243
|
* Creates an authentication provider primitive for handling user login flows.
|
|
1244
1244
|
*
|
|
@@ -1372,7 +1372,7 @@ var AuthPrimitive = class extends Primitive {
|
|
|
1372
1372
|
$auth[KIND] = AuthPrimitive;
|
|
1373
1373
|
|
|
1374
1374
|
//#endregion
|
|
1375
|
-
//#region src/server-auth/constants/routes.ts
|
|
1375
|
+
//#region ../../src/server-auth/constants/routes.ts
|
|
1376
1376
|
const alephaServerAuthRoutes = {
|
|
1377
1377
|
login: "/oauth/login",
|
|
1378
1378
|
callback: "/oauth/callback",
|
|
@@ -1383,7 +1383,7 @@ const alephaServerAuthRoutes = {
|
|
|
1383
1383
|
};
|
|
1384
1384
|
|
|
1385
1385
|
//#endregion
|
|
1386
|
-
//#region src/server-auth/schemas/tokensSchema.ts
|
|
1386
|
+
//#region ../../src/server-auth/schemas/tokensSchema.ts
|
|
1387
1387
|
const tokensSchema = t.object({
|
|
1388
1388
|
provider: t.text(),
|
|
1389
1389
|
access_token: t.text({ size: "rich" }),
|
|
@@ -1397,21 +1397,21 @@ const tokensSchema = t.object({
|
|
|
1397
1397
|
});
|
|
1398
1398
|
|
|
1399
1399
|
//#endregion
|
|
1400
|
-
//#region src/server-auth/schemas/tokenResponseSchema.ts
|
|
1400
|
+
//#region ../../src/server-auth/schemas/tokenResponseSchema.ts
|
|
1401
1401
|
const tokenResponseSchema = t.extend(tokensSchema, {
|
|
1402
1402
|
user: userAccountInfoSchema,
|
|
1403
1403
|
api: apiLinksResponseSchema
|
|
1404
1404
|
});
|
|
1405
1405
|
|
|
1406
1406
|
//#endregion
|
|
1407
|
-
//#region src/server-auth/schemas/userinfoResponseSchema.ts
|
|
1407
|
+
//#region ../../src/server-auth/schemas/userinfoResponseSchema.ts
|
|
1408
1408
|
const userinfoResponseSchema = t.object({
|
|
1409
1409
|
user: t.optional(userAccountInfoSchema),
|
|
1410
1410
|
api: apiLinksResponseSchema
|
|
1411
1411
|
});
|
|
1412
1412
|
|
|
1413
1413
|
//#endregion
|
|
1414
|
-
//#region src/server-auth/providers/ServerAuthProvider.ts
|
|
1414
|
+
//#region ../../src/server-auth/providers/ServerAuthProvider.ts
|
|
1415
1415
|
var ServerAuthProvider = class {
|
|
1416
1416
|
log = $logger();
|
|
1417
1417
|
alepha = $inject(Alepha);
|
|
@@ -1793,7 +1793,7 @@ var ServerAuthProvider = class {
|
|
|
1793
1793
|
};
|
|
1794
1794
|
|
|
1795
1795
|
//#endregion
|
|
1796
|
-
//#region src/server-auth/schemas/authenticationProviderSchema.ts
|
|
1796
|
+
//#region ../../src/server-auth/schemas/authenticationProviderSchema.ts
|
|
1797
1797
|
const authenticationProviderSchema = t.object({
|
|
1798
1798
|
name: t.text({ description: "Name of the authentication provider." }),
|
|
1799
1799
|
type: t.enum([
|
|
@@ -1804,7 +1804,7 @@ const authenticationProviderSchema = t.object({
|
|
|
1804
1804
|
}, { title: "AuthenticationProvider" });
|
|
1805
1805
|
|
|
1806
1806
|
//#endregion
|
|
1807
|
-
//#region src/server-auth/primitives/$authCredentials.ts
|
|
1807
|
+
//#region ../../src/server-auth/primitives/$authCredentials.ts
|
|
1808
1808
|
/**
|
|
1809
1809
|
* Already configured Credentials authentication primitive.
|
|
1810
1810
|
*
|
|
@@ -1822,7 +1822,7 @@ const $authCredentials = (realm, options = {}) => {
|
|
|
1822
1822
|
};
|
|
1823
1823
|
|
|
1824
1824
|
//#endregion
|
|
1825
|
-
//#region src/server-auth/primitives/$authGithub.ts
|
|
1825
|
+
//#region ../../src/server-auth/primitives/$authGithub.ts
|
|
1826
1826
|
/**
|
|
1827
1827
|
* Already configured GitHub authentication primitive.
|
|
1828
1828
|
*
|
|
@@ -1882,7 +1882,7 @@ const $authGithub = (realm, options = {}) => {
|
|
|
1882
1882
|
};
|
|
1883
1883
|
|
|
1884
1884
|
//#endregion
|
|
1885
|
-
//#region src/server-auth/primitives/$authGoogle.ts
|
|
1885
|
+
//#region ../../src/server-auth/primitives/$authGoogle.ts
|
|
1886
1886
|
/**
|
|
1887
1887
|
* Already configured Google authentication primitive.
|
|
1888
1888
|
*
|
|
@@ -1918,7 +1918,7 @@ const $authGoogle = (realm, options = {}) => {
|
|
|
1918
1918
|
};
|
|
1919
1919
|
|
|
1920
1920
|
//#endregion
|
|
1921
|
-
//#region src/server-auth/index.ts
|
|
1921
|
+
//#region ../../src/server-auth/index.ts
|
|
1922
1922
|
/**
|
|
1923
1923
|
* Allow authentication services for server applications.
|
|
1924
1924
|
* It provides login and logout functionalities.
|
|
@@ -7,7 +7,7 @@ import { DateTimeProvider, DurationLike } from "alepha/datetime";
|
|
|
7
7
|
import * as alepha_logger0 from "alepha/logger";
|
|
8
8
|
import { RequestConfigSchema, ServerRequest, ServerRoute } from "alepha/server";
|
|
9
9
|
|
|
10
|
-
//#region src/server-cache/providers/ServerCacheProvider.d.ts
|
|
10
|
+
//#region ../../src/server-cache/providers/ServerCacheProvider.d.ts
|
|
11
11
|
declare module "alepha/server" {
|
|
12
12
|
interface ServerRoute {
|
|
13
13
|
/**
|
|
@@ -129,7 +129,7 @@ interface RouteCacheEntry {
|
|
|
129
129
|
hash: string;
|
|
130
130
|
}
|
|
131
131
|
//#endregion
|
|
132
|
-
//#region src/server-cache/index.d.ts
|
|
132
|
+
//#region ../../src/server-cache/index.d.ts
|
|
133
133
|
/**
|
|
134
134
|
* Plugin for Alepha Server that provides server-side caching capabilities.
|
|
135
135
|
* It uses the Alepha Cache module to cache responses from server actions ($action).
|
|
@@ -5,7 +5,7 @@ import { DateTimeProvider } from "alepha/datetime";
|
|
|
5
5
|
import { $logger } from "alepha/logger";
|
|
6
6
|
import { ActionPrimitive } from "alepha/server";
|
|
7
7
|
|
|
8
|
-
//#region src/server-cache/providers/ServerCacheProvider.ts
|
|
8
|
+
//#region ../../src/server-cache/providers/ServerCacheProvider.ts
|
|
9
9
|
ActionPrimitive.prototype.invalidate = async function() {
|
|
10
10
|
await this.alepha.inject(ServerCacheProvider).invalidate(this.route);
|
|
11
11
|
};
|
|
@@ -212,7 +212,7 @@ var ServerCacheProvider = class {
|
|
|
212
212
|
};
|
|
213
213
|
|
|
214
214
|
//#endregion
|
|
215
|
-
//#region src/server-cache/index.ts
|
|
215
|
+
//#region ../../src/server-cache/index.ts
|
|
216
216
|
/**
|
|
217
217
|
* Plugin for Alepha Server that provides server-side caching capabilities.
|
|
218
218
|
* It uses the Alepha Cache module to cache responses from server actions ($action).
|
|
@@ -3,7 +3,7 @@ import { Alepha } from "alepha";
|
|
|
3
3
|
import { ServerResponse } from "alepha/server";
|
|
4
4
|
import { Transform } from "node:stream";
|
|
5
5
|
|
|
6
|
-
//#region src/server-compress/providers/ServerCompressProvider.d.ts
|
|
6
|
+
//#region ../../src/server-compress/providers/ServerCompressProvider.d.ts
|
|
7
7
|
declare module "alepha" {
|
|
8
8
|
interface State {
|
|
9
9
|
"alepha.server.compress.options"?: ServerCompressProviderOptions;
|
|
@@ -26,7 +26,7 @@ interface ServerCompressProviderOptions {
|
|
|
26
26
|
allowedContentTypes: string[];
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
29
|
-
//#region src/server-compress/index.d.ts
|
|
29
|
+
//#region ../../src/server-compress/index.d.ts
|
|
30
30
|
/**
|
|
31
31
|
* Plugin for Alepha Server that provides server-side compression capabilities.
|
|
32
32
|
*
|
|
@@ -5,7 +5,7 @@ import { ReadableStream } from "node:stream/web";
|
|
|
5
5
|
import { promisify } from "node:util";
|
|
6
6
|
import * as zlib from "node:zlib";
|
|
7
7
|
|
|
8
|
-
//#region src/server-compress/providers/ServerCompressProvider.ts
|
|
8
|
+
//#region ../../src/server-compress/providers/ServerCompressProvider.ts
|
|
9
9
|
const gzip = promisify(zlib.gzip);
|
|
10
10
|
const createGzip = zlib.createGzip;
|
|
11
11
|
const brotli = promisify(zlib.brotliCompress);
|
|
@@ -96,7 +96,7 @@ var ServerCompressProvider = class ServerCompressProvider {
|
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
//#endregion
|
|
99
|
-
//#region src/server-compress/index.ts
|
|
99
|
+
//#region ../../src/server-compress/index.ts
|
|
100
100
|
/**
|
|
101
101
|
* Plugin for Alepha Server that provides server-side compression capabilities.
|
|
102
102
|
*
|