alepha 0.7.4 → 0.7.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/LICENSE +21 -21
- package/README.md +44 -21
- package/cache/redis.cjs +4 -8
- package/cache/redis.d.ts +30 -91
- package/cache/redis.js +1 -1
- package/cache.cjs +4 -8
- package/cache.d.ts +190 -259
- package/cache.js +1 -1
- package/core.cjs +4 -8
- package/core.d.ts +950 -925
- package/core.js +1 -1
- package/datetime.cjs +4 -8
- package/datetime.d.ts +151 -140
- package/datetime.js +1 -1
- package/lock/redis.cjs +7 -49
- package/lock/redis.d.ts +17 -14
- package/lock/redis.js +1 -47
- package/lock.cjs +4 -8
- package/lock.d.ts +117 -170
- package/lock.js +1 -1
- package/package.json +70 -40
- package/postgres.cjs +4 -8
- package/postgres.d.ts +1314 -4400
- package/postgres.js +1 -1
- package/queue/redis.cjs +8 -0
- package/queue/redis.d.ts +31 -0
- package/queue/redis.js +1 -0
- package/queue.cjs +4 -8
- package/queue.d.ts +162 -205
- package/queue.js +1 -1
- package/react/auth.cjs +4 -8
- package/react/auth.d.ts +167 -280
- package/react/auth.js +1 -1
- package/react.cjs +4 -8
- package/react.d.ts +530 -570
- package/react.js +1 -1
- package/redis.cjs +4 -8
- package/redis.d.ts +59 -132
- package/redis.js +1 -1
- package/retry.cjs +4 -8
- package/retry.d.ts +34 -31
- package/retry.js +1 -1
- package/scheduler.cjs +4 -8
- package/scheduler.d.ts +128 -155
- package/scheduler.js +1 -1
- package/security.cjs +4 -8
- package/security.d.ts +472 -595
- package/security.js +1 -1
- package/server/cache.cjs +4 -8
- package/server/cache.d.ts +73 -39
- package/server/cache.js +1 -1
- package/server/cookies.cjs +4 -8
- package/server/cookies.d.ts +46 -41
- package/server/cookies.js +1 -1
- package/server/static.cjs +4 -8
- package/server/static.d.ts +98 -95
- package/server/static.js +1 -1
- package/server/swagger.cjs +4 -8
- package/server/swagger.d.ts +106 -92
- package/server/swagger.js +1 -1
- package/server.cjs +4 -8
- package/server.d.ts +754 -1025
- package/server.js +1 -1
- package/testing.cjs +8 -0
- package/testing.d.ts +1 -0
- package/testing.js +1 -0
- package/topic/redis.cjs +8 -0
- package/topic/redis.d.ts +45 -0
- package/topic/redis.js +1 -0
- package/topic.cjs +4 -8
- package/topic.d.ts +171 -163
- package/topic.js +1 -1
- package/vite.cjs +4 -8
- package/vite.d.ts +91 -84
- package/vite.js +1 -1
- package/assets/logo.png +0 -0
- package/src/cache/redis.ts +0 -1
- package/src/cache.ts +0 -1
- package/src/core.ts +0 -1
- package/src/datetime.ts +0 -1
- package/src/lock/redis.ts +0 -1
- package/src/lock.ts +0 -1
- package/src/postgres.ts +0 -1
- package/src/queue/redis.ts +0 -1
- package/src/queue.ts +0 -1
- package/src/react/auth.ts +0 -1
- package/src/react.ts +0 -1
- package/src/redis.ts +0 -1
- package/src/retry.ts +0 -1
- package/src/scheduler.ts +0 -1
- package/src/security.ts +0 -1
- package/src/server/cache.ts +0 -1
- package/src/server/cookies.ts +0 -1
- package/src/server/static.ts +0 -1
- package/src/server/swagger.ts +0 -1
- package/src/server.ts +0 -1
- package/src/topic/redis.ts +0 -1
- package/src/topic.ts +0 -1
- package/src/vite.ts +0 -1
package/react/auth.d.ts
CHANGED
|
@@ -1,304 +1,190 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import * as
|
|
5
|
-
import {
|
|
6
|
-
import * as
|
|
7
|
-
import {
|
|
8
|
-
import { Configuration } from
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
declare const ReadonlyKind: unique symbol;
|
|
12
|
-
/** Symbol key applied to optional types */
|
|
13
|
-
declare const OptionalKind: unique symbol;
|
|
14
|
-
/** Symbol key applied to types */
|
|
15
|
-
declare const Hint: unique symbol;
|
|
16
|
-
/** Symbol key applied to types */
|
|
17
|
-
declare const Kind: unique symbol;
|
|
18
|
-
|
|
19
|
-
type TReadonly<T extends TSchema> = T & {
|
|
20
|
-
[ReadonlyKind]: 'Readonly';
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
type StringFormatOption = 'date-time' | 'time' | 'date' | 'email' | 'idn-email' | 'hostname' | 'idn-hostname' | 'ipv4' | 'ipv6' | 'uri' | 'uri-reference' | 'iri' | 'uuid' | 'iri-reference' | 'uri-template' | 'json-pointer' | 'relative-json-pointer' | 'regex' | ({} & string);
|
|
24
|
-
type StringContentEncodingOption = '7bit' | '8bit' | 'binary' | 'quoted-printable' | 'base64' | ({} & string);
|
|
25
|
-
interface StringOptions extends SchemaOptions {
|
|
26
|
-
/** The maximum string length */
|
|
27
|
-
maxLength?: number;
|
|
28
|
-
/** The minimum string length */
|
|
29
|
-
minLength?: number;
|
|
30
|
-
/** A regular expression pattern this string should match */
|
|
31
|
-
pattern?: string;
|
|
32
|
-
/** A format this string should match */
|
|
33
|
-
format?: StringFormatOption;
|
|
34
|
-
/** The content encoding for this string */
|
|
35
|
-
contentEncoding?: StringContentEncodingOption;
|
|
36
|
-
/** The content media type for this string */
|
|
37
|
-
contentMediaType?: string;
|
|
38
|
-
}
|
|
39
|
-
interface TString extends TSchema, StringOptions {
|
|
40
|
-
[Kind]: 'String';
|
|
41
|
-
static: string;
|
|
42
|
-
type: 'string';
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
interface NumberOptions extends SchemaOptions {
|
|
46
|
-
exclusiveMaximum?: number;
|
|
47
|
-
exclusiveMinimum?: number;
|
|
48
|
-
maximum?: number;
|
|
49
|
-
minimum?: number;
|
|
50
|
-
multipleOf?: number;
|
|
51
|
-
}
|
|
52
|
-
interface TNumber extends TSchema, NumberOptions {
|
|
53
|
-
[Kind]: 'Number';
|
|
54
|
-
static: number;
|
|
55
|
-
type: 'number';
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
type TOptional<T extends TSchema> = T & {
|
|
59
|
-
[OptionalKind]: 'Optional';
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/** Creates a static type from a TypeBox type */
|
|
63
|
-
type Static<Type extends TSchema, Params extends unknown[] = [], Result = (Type & {
|
|
64
|
-
params: Params;
|
|
65
|
-
})['static']> = Result;
|
|
66
|
-
|
|
67
|
-
type ReadonlyOptionalPropertyKeys<T extends TProperties> = {
|
|
68
|
-
[K in keyof T]: T[K] extends TReadonly<TSchema> ? (T[K] extends TOptional<T[K]> ? K : never) : never;
|
|
69
|
-
}[keyof T];
|
|
70
|
-
type ReadonlyPropertyKeys<T extends TProperties> = {
|
|
71
|
-
[K in keyof T]: T[K] extends TReadonly<TSchema> ? (T[K] extends TOptional<T[K]> ? never : K) : never;
|
|
72
|
-
}[keyof T];
|
|
73
|
-
type OptionalPropertyKeys<T extends TProperties> = {
|
|
74
|
-
[K in keyof T]: T[K] extends TOptional<TSchema> ? (T[K] extends TReadonly<T[K]> ? never : K) : never;
|
|
75
|
-
}[keyof T];
|
|
76
|
-
type RequiredPropertyKeys<T extends TProperties> = keyof Omit<T, ReadonlyOptionalPropertyKeys<T> | ReadonlyPropertyKeys<T> | OptionalPropertyKeys<T>>;
|
|
77
|
-
type ObjectStaticProperties<T extends TProperties, R extends Record<keyof any, unknown>> = Evaluate<(Readonly<Partial<Pick<R, ReadonlyOptionalPropertyKeys<T>>>> & Readonly<Pick<R, ReadonlyPropertyKeys<T>>> & Partial<Pick<R, OptionalPropertyKeys<T>>> & Required<Pick<R, RequiredPropertyKeys<T>>>)>;
|
|
78
|
-
type ObjectStatic<T extends TProperties, P extends unknown[]> = ObjectStaticProperties<T, {
|
|
79
|
-
[K in keyof T]: Static<T[K], P>;
|
|
80
|
-
}>;
|
|
81
|
-
type TPropertyKey = string | number;
|
|
82
|
-
type TProperties = Record<TPropertyKey, TSchema>;
|
|
83
|
-
type TAdditionalProperties = undefined | TSchema | boolean;
|
|
84
|
-
interface ObjectOptions extends SchemaOptions {
|
|
85
|
-
/** Additional property constraints for this object */
|
|
86
|
-
additionalProperties?: TAdditionalProperties;
|
|
87
|
-
/** The minimum number of properties allowed on this object */
|
|
88
|
-
minProperties?: number;
|
|
89
|
-
/** The maximum number of properties allowed on this object */
|
|
90
|
-
maxProperties?: number;
|
|
91
|
-
}
|
|
92
|
-
interface TObject<T extends TProperties = TProperties> extends TSchema, ObjectOptions {
|
|
93
|
-
[Kind]: 'Object';
|
|
94
|
-
static: ObjectStatic<T, this['params']>;
|
|
95
|
-
additionalProperties?: TAdditionalProperties;
|
|
96
|
-
type: 'object';
|
|
97
|
-
properties: T;
|
|
98
|
-
required?: string[];
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
type Evaluate<T> = T extends infer O ? {
|
|
102
|
-
[K in keyof O]: O[K];
|
|
103
|
-
} : never;
|
|
104
|
-
|
|
105
|
-
interface SchemaOptions {
|
|
106
|
-
$schema?: string;
|
|
107
|
-
/** Id for this schema */
|
|
108
|
-
$id?: string;
|
|
109
|
-
/** Title of this schema */
|
|
110
|
-
title?: string;
|
|
111
|
-
/** Description of this schema */
|
|
112
|
-
description?: string;
|
|
113
|
-
/** Default value for this schema */
|
|
114
|
-
default?: any;
|
|
115
|
-
/** Example values matching this schema */
|
|
116
|
-
examples?: any;
|
|
117
|
-
/** Optional annotation for readOnly */
|
|
118
|
-
readOnly?: boolean;
|
|
119
|
-
/** Optional annotation for writeOnly */
|
|
120
|
-
writeOnly?: boolean;
|
|
121
|
-
[prop: string]: any;
|
|
122
|
-
}
|
|
123
|
-
interface TKind {
|
|
124
|
-
[Kind]: string;
|
|
125
|
-
}
|
|
126
|
-
interface TSchema extends TKind, SchemaOptions {
|
|
127
|
-
[ReadonlyKind]?: string;
|
|
128
|
-
[OptionalKind]?: string;
|
|
129
|
-
[Hint]?: string;
|
|
130
|
-
params: unknown[];
|
|
131
|
-
static: unknown;
|
|
132
|
-
}
|
|
1
|
+
import * as _alepha_core1 from "@alepha/core";
|
|
2
|
+
import * as _alepha_core52 from "@alepha/core";
|
|
3
|
+
import { Alepha, Async, KIND, Module, OPTIONS } from "@alepha/core";
|
|
4
|
+
import * as _alepha_server41 from "@alepha/server";
|
|
5
|
+
import { HttpClient, HttpVirtualClient } from "@alepha/server";
|
|
6
|
+
import * as _alepha_server_cookies7 from "@alepha/server-cookies";
|
|
7
|
+
import { Cookies, ServerCookiesProvider } from "@alepha/server-cookies";
|
|
8
|
+
import { Configuration } from "openid-client";
|
|
9
|
+
import { UserAccountToken } from "@alepha/security";
|
|
10
|
+
import * as _sinclair_typebox2 from "@sinclair/typebox";
|
|
133
11
|
|
|
12
|
+
//#region src/descriptors/$auth.d.ts
|
|
134
13
|
declare const KEY = "AUTH";
|
|
135
14
|
type AccessToken = string;
|
|
136
15
|
interface AuthDescriptorOptions {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
16
|
+
name?: string;
|
|
17
|
+
fallback?: () => Async<AccessToken>;
|
|
18
|
+
oidc?: {
|
|
19
|
+
issuer: string;
|
|
20
|
+
clientId: string;
|
|
21
|
+
clientSecret?: string;
|
|
22
|
+
redirectUri?: string;
|
|
23
|
+
useIdToken?: boolean;
|
|
24
|
+
logoutUri?: string;
|
|
25
|
+
};
|
|
146
26
|
}
|
|
147
27
|
interface AuthDescriptor {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
28
|
+
[KIND]: typeof KEY;
|
|
29
|
+
[OPTIONS]: AuthDescriptorOptions;
|
|
30
|
+
jwks: () => string;
|
|
151
31
|
}
|
|
152
32
|
declare const $auth: {
|
|
153
|
-
|
|
154
|
-
|
|
33
|
+
(options: AuthDescriptorOptions): AuthDescriptor;
|
|
34
|
+
[KIND]: string;
|
|
155
35
|
};
|
|
156
|
-
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/providers/ReactAuthProvider.d.ts
|
|
157
38
|
declare class ReactAuthProvider {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}>;
|
|
39
|
+
protected readonly log: _alepha_core1.Logger;
|
|
40
|
+
protected readonly alepha: Alepha;
|
|
41
|
+
protected readonly serverCookiesProvider: ServerCookiesProvider;
|
|
42
|
+
protected authProviders: AuthProvider[];
|
|
43
|
+
protected readonly authorizationCode: _alepha_server_cookies7.CookieDescriptor<_sinclair_typebox2.TObject<{
|
|
44
|
+
codeVerifier: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
45
|
+
redirectUri: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
46
|
+
}>>;
|
|
47
|
+
protected readonly tokens: _alepha_server_cookies7.CookieDescriptor<_sinclair_typebox2.TObject<{
|
|
48
|
+
provider: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
49
|
+
access_token: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
50
|
+
expires_in: _sinclair_typebox2.TOptional<_sinclair_typebox2.TNumber>;
|
|
51
|
+
refresh_token: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
52
|
+
id_token: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
53
|
+
scope: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
54
|
+
issued_at: _sinclair_typebox2.TOptional<_sinclair_typebox2.TNumber>;
|
|
55
|
+
}>>;
|
|
56
|
+
readonly user: _alepha_server_cookies7.CookieDescriptor<_sinclair_typebox2.TObject<{
|
|
57
|
+
id: _sinclair_typebox2.TString;
|
|
58
|
+
name: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
59
|
+
email: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
60
|
+
picture: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
61
|
+
}>>;
|
|
62
|
+
readonly onRender: _alepha_core1.HookDescriptor<"react:server:render">;
|
|
63
|
+
protected readonly configure: _alepha_core1.HookDescriptor<"configure">;
|
|
64
|
+
protected getAccessTokenFromCookies(tokens: SessionTokens): Promise<string | undefined>;
|
|
65
|
+
/**
|
|
66
|
+
* Configure Fastify to forward Session Access Token to Header Authorization.
|
|
67
|
+
*/
|
|
68
|
+
protected readonly onRequest: _alepha_core1.HookDescriptor<"server:onRequest">;
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* @param cookies
|
|
72
|
+
* @protected
|
|
73
|
+
*/
|
|
74
|
+
protected refresh(cookies: Cookies): Promise<SessionTokens | undefined>;
|
|
75
|
+
/**
|
|
76
|
+
*
|
|
77
|
+
*/
|
|
78
|
+
readonly login: _alepha_server41.RouteDescriptor<{
|
|
79
|
+
query: _sinclair_typebox2.TObject<{
|
|
80
|
+
redirect: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
81
|
+
provider: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
202
82
|
}>;
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
83
|
+
}>;
|
|
84
|
+
/**
|
|
85
|
+
*
|
|
86
|
+
*/
|
|
87
|
+
readonly callback: _alepha_server41.RouteDescriptor<{
|
|
88
|
+
query: _sinclair_typebox2.TObject<{
|
|
89
|
+
provider: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
210
90
|
}>;
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
91
|
+
}>;
|
|
92
|
+
/**
|
|
93
|
+
*
|
|
94
|
+
* @param accessToken
|
|
95
|
+
* @protected
|
|
96
|
+
*/
|
|
97
|
+
protected userFromAccessToken(accessToken: string): {
|
|
98
|
+
id: any;
|
|
99
|
+
name: any;
|
|
100
|
+
email: any;
|
|
101
|
+
picture: any;
|
|
102
|
+
} | undefined;
|
|
103
|
+
readonly logout: _alepha_server41.RouteDescriptor<{
|
|
104
|
+
query: _sinclair_typebox2.TObject<{
|
|
105
|
+
redirect: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
106
|
+
provider: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
227
107
|
}>;
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
redirectUri: string;
|
|
237
|
-
fallback?: () => Async<AccessToken>;
|
|
238
|
-
useIdToken?: boolean;
|
|
239
|
-
}>;
|
|
240
|
-
/**
|
|
241
|
-
*
|
|
242
|
-
* @param file
|
|
243
|
-
* @protected
|
|
244
|
-
*/
|
|
245
|
-
protected isViteFile(file: string): boolean;
|
|
246
|
-
}
|
|
247
|
-
interface SessionTokens {
|
|
248
|
-
access_token?: string;
|
|
249
|
-
expires_in?: number;
|
|
250
|
-
refresh_token?: string;
|
|
251
|
-
id_token?: string;
|
|
252
|
-
scope?: string;
|
|
253
|
-
issued_at?: number;
|
|
254
|
-
provider?: string;
|
|
255
|
-
}
|
|
256
|
-
interface AuthProvider {
|
|
108
|
+
}>;
|
|
109
|
+
/**
|
|
110
|
+
*
|
|
111
|
+
* @param name
|
|
112
|
+
* @protected
|
|
113
|
+
*/
|
|
114
|
+
protected provider(name?: string): Promise<{
|
|
115
|
+
client: Configuration;
|
|
257
116
|
name: string;
|
|
258
117
|
redirectUri: string;
|
|
259
|
-
client: {
|
|
260
|
-
get: () => Promise<Configuration>;
|
|
261
|
-
};
|
|
262
118
|
fallback?: () => Async<AccessToken>;
|
|
263
119
|
useIdToken?: boolean;
|
|
120
|
+
logoutUri?: string;
|
|
121
|
+
}>;
|
|
122
|
+
/**
|
|
123
|
+
*
|
|
124
|
+
* @param file
|
|
125
|
+
* @protected
|
|
126
|
+
*/
|
|
127
|
+
protected isViteFile(file: string): boolean;
|
|
128
|
+
}
|
|
129
|
+
interface SessionTokens {
|
|
130
|
+
access_token?: string;
|
|
131
|
+
expires_in?: number;
|
|
132
|
+
refresh_token?: string;
|
|
133
|
+
id_token?: string;
|
|
134
|
+
scope?: string;
|
|
135
|
+
issued_at?: number;
|
|
136
|
+
provider?: string;
|
|
137
|
+
}
|
|
138
|
+
interface AuthProvider {
|
|
139
|
+
name: string;
|
|
140
|
+
redirectUri: string;
|
|
141
|
+
client: {
|
|
142
|
+
get: () => Promise<Configuration>;
|
|
143
|
+
};
|
|
144
|
+
fallback?: () => Async<AccessToken>;
|
|
145
|
+
useIdToken?: boolean;
|
|
146
|
+
logoutUri?: string;
|
|
264
147
|
}
|
|
265
148
|
interface ReactUser {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
149
|
+
id: string;
|
|
150
|
+
name?: string;
|
|
151
|
+
email?: string;
|
|
269
152
|
}
|
|
270
|
-
|
|
153
|
+
//#endregion
|
|
154
|
+
//#region src/hooks/useAuth.d.ts
|
|
271
155
|
declare const useAuth: () => AuthHook;
|
|
272
156
|
interface AuthHook {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
157
|
+
user?: UserAccountToken;
|
|
158
|
+
logout: () => void;
|
|
159
|
+
login: (provider?: string) => void;
|
|
160
|
+
can: <T extends object>(name: keyof HttpVirtualClient<T>) => boolean;
|
|
277
161
|
}
|
|
278
|
-
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/services/ReactAuth.d.ts
|
|
279
164
|
declare class ReactAuth {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}
|
|
294
|
-
|
|
165
|
+
protected readonly log: _alepha_core52.Logger;
|
|
166
|
+
protected readonly alepha: Alepha;
|
|
167
|
+
protected readonly client: HttpClient;
|
|
168
|
+
static path: {
|
|
169
|
+
login: string;
|
|
170
|
+
callback: string;
|
|
171
|
+
logout: string;
|
|
172
|
+
};
|
|
173
|
+
readonly onRender: _alepha_core52.HookDescriptor<"react:transition:begin">;
|
|
174
|
+
get user(): UserAccountToken | undefined;
|
|
175
|
+
protected getUserFromCookies(): UserAccountToken | undefined;
|
|
176
|
+
login(): void;
|
|
177
|
+
logout(): void;
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/index.d.ts
|
|
295
181
|
declare module "alepha/react" {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
182
|
+
interface PageReactContext {
|
|
183
|
+
user?: UserAccountToken;
|
|
184
|
+
}
|
|
185
|
+
interface ReactHydrationState {
|
|
186
|
+
user?: ReactUser;
|
|
187
|
+
}
|
|
302
188
|
}
|
|
303
189
|
/**
|
|
304
190
|
* Alepha React Authentication Module
|
|
@@ -309,8 +195,9 @@ declare module "alepha/react" {
|
|
|
309
195
|
* @module alepha.react.auth
|
|
310
196
|
*/
|
|
311
197
|
declare class AlephaReactAuth implements Module {
|
|
312
|
-
|
|
313
|
-
|
|
198
|
+
readonly name = "alepha.react.auth";
|
|
199
|
+
readonly $services: (alepha: Alepha) => void;
|
|
314
200
|
}
|
|
315
|
-
|
|
316
|
-
export { $auth,
|
|
201
|
+
//#endregion
|
|
202
|
+
export { $auth, AccessToken, AlephaReactAuth, AuthDescriptor, AuthDescriptorOptions, AuthHook, AuthProvider, ReactAuth, ReactAuthProvider, ReactUser, SessionTokens, useAuth };
|
|
203
|
+
//# sourceMappingURL=index.d.ts.map
|
package/react/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '@alepha/react-auth'
|
|
1
|
+
export * from '@alepha/react-auth'
|
package/react.cjs
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.keys(react).forEach(function (k) {
|
|
2
|
+
var m = require('@alepha/react');
|
|
3
|
+
Object.keys(m).forEach(function (k) {
|
|
8
4
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
5
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
6
|
+
get: function () { return m[k]; }
|
|
11
7
|
});
|
|
12
|
-
});
|
|
8
|
+
});
|