alepha 0.8.0 → 0.9.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/LICENSE +21 -21
- package/README.md +47 -44
- package/batch.d.ts +87 -88
- package/bucket.cjs +8 -0
- package/bucket.d.ts +194 -0
- package/bucket.js +1 -0
- package/cache/redis.d.ts +14 -16
- package/cache.d.ts +101 -170
- package/command.d.ts +70 -77
- package/core.d.ts +1043 -887
- package/datetime.d.ts +91 -117
- package/file.cjs +8 -0
- package/file.d.ts +56 -0
- package/file.js +1 -0
- package/lock/redis.d.ts +11 -13
- package/lock.d.ts +125 -117
- package/package.json +66 -38
- package/postgres.d.ts +232 -275
- package/queue/redis.d.ts +13 -15
- package/queue.d.ts +88 -116
- package/react/auth.d.ts +50 -55
- package/react/head.d.ts +5 -8
- package/react.d.ts +71 -73
- package/redis.d.ts +32 -14
- package/retry.d.ts +70 -58
- package/router.cjs +8 -0
- package/router.d.ts +45 -0
- package/router.js +1 -0
- package/scheduler.d.ts +54 -96
- package/security.d.ts +117 -119
- package/server/cache.d.ts +22 -31
- package/server/compress.d.ts +16 -7
- package/server/cookies.d.ts +70 -61
- package/server/cors.d.ts +15 -13
- package/server/health.d.ts +23 -26
- package/server/helmet.d.ts +17 -20
- package/server/links.d.ts +113 -90
- package/server/metrics.d.ts +25 -23
- package/server/multipart.d.ts +12 -16
- package/server/proxy.d.ts +25 -20
- package/server/security.cjs +8 -0
- package/server/security.d.ts +90 -0
- package/server/security.js +1 -0
- package/server/static.d.ts +67 -68
- package/server/swagger.d.ts +77 -65
- package/server.d.ts +265 -308
- package/topic/redis.d.ts +25 -26
- package/topic.d.ts +76 -122
- package/vite.d.ts +52 -36
package/queue/redis.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import * as _alepha_core0 from "alepha";
|
|
2
|
+
import { Static } from "alepha";
|
|
1
3
|
import { QueueProvider } from "alepha/queue";
|
|
2
|
-
import { Alepha, Module, Static, TObject, TString } from "alepha";
|
|
3
4
|
import { RedisProvider } from "alepha/redis";
|
|
5
|
+
import * as _sinclair_typebox0 from "@sinclair/typebox";
|
|
4
6
|
|
|
5
7
|
//#region src/providers/RedisQueueProvider.d.ts
|
|
6
|
-
declare const envSchema: TObject<{
|
|
7
|
-
REDIS_QUEUE_PREFIX: TString;
|
|
8
|
+
declare const envSchema: _sinclair_typebox0.TObject<{
|
|
9
|
+
REDIS_QUEUE_PREFIX: _sinclair_typebox0.TString;
|
|
8
10
|
}>;
|
|
9
11
|
declare class RedisQueueProvider implements QueueProvider {
|
|
10
12
|
protected readonly env: Static<typeof envSchema>;
|
|
@@ -15,19 +17,15 @@ declare class RedisQueueProvider implements QueueProvider {
|
|
|
15
17
|
}
|
|
16
18
|
//#endregion
|
|
17
19
|
//#region src/index.d.ts
|
|
18
|
-
// ---------------------------------------------------------------------------------------------------------------------
|
|
19
20
|
/**
|
|
20
|
-
* Alepha Queue Redis
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
readonly name = "alepha.queue.redis";
|
|
29
|
-
readonly $services: (alepha: Alepha) => Alepha;
|
|
30
|
-
}
|
|
21
|
+
* Plugin for Alepha Queue that provides Redis queue capabilities.
|
|
22
|
+
*
|
|
23
|
+
* @see {@link RedisQueueProvider}
|
|
24
|
+
* @module alepha.queue.redis
|
|
25
|
+
*/
|
|
26
|
+
declare const AlephaQueueRedis: _alepha_core0.ModuleDescriptor;
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
28
|
+
|
|
31
29
|
//#endregion
|
|
32
30
|
export { AlephaQueueRedis, RedisQueueProvider };
|
|
33
31
|
//# sourceMappingURL=index.d.ts.map
|
package/queue.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import * as _alepha_core0 from "alepha";
|
|
2
1
|
import * as _alepha_core1 from "alepha";
|
|
3
|
-
import
|
|
2
|
+
import * as _alepha_core2 from "alepha";
|
|
3
|
+
import * as _alepha_core0$1 from "alepha";
|
|
4
|
+
import * as _alepha_core0 from "alepha";
|
|
5
|
+
import { Alepha, Descriptor, KIND, Service, Static, TSchema } from "alepha";
|
|
4
6
|
import { DateTimeProvider } from "alepha/datetime";
|
|
5
7
|
|
|
6
8
|
//#region src/providers/QueueProvider.d.ts
|
|
@@ -28,96 +30,36 @@ declare abstract class QueueProvider {
|
|
|
28
30
|
}
|
|
29
31
|
//# sourceMappingURL=QueueProvider.d.ts.map
|
|
30
32
|
//#endregion
|
|
31
|
-
//#region src/descriptors/$queue.d.ts
|
|
32
|
-
declare const KEY$1 = "QUEUE";
|
|
33
|
-
/**
|
|
34
|
-
* Queue descriptor.
|
|
35
|
-
*/
|
|
36
|
-
declare const $queue: {
|
|
37
|
-
<T extends QueueMessageSchema>(options: QueueDescriptorOptions<T>): QueueDescriptor<T>;
|
|
38
|
-
[KIND]: string;
|
|
39
|
-
};
|
|
40
|
-
interface QueueMessageSchema {
|
|
41
|
-
headers?: TSchema;
|
|
42
|
-
payload: TSchema;
|
|
43
|
-
}
|
|
44
|
-
interface QueueDescriptorOptions<T extends QueueMessageSchema> {
|
|
45
|
-
name?: string;
|
|
46
|
-
description?: string;
|
|
47
|
-
provider?: "memory" | (() => QueueProvider);
|
|
48
|
-
schema: T;
|
|
49
|
-
handler?: (message: {
|
|
50
|
-
payload: Static<T["payload"]>;
|
|
51
|
-
}) => Promise<void>;
|
|
52
|
-
}
|
|
53
|
-
interface QueueDescriptor<T extends QueueMessageSchema = QueueMessageSchema> {
|
|
54
|
-
[KIND]: typeof KEY$1;
|
|
55
|
-
[OPTIONS]: QueueDescriptorOptions<T>;
|
|
56
|
-
name(): string;
|
|
57
|
-
provider(): QueueProvider;
|
|
58
|
-
push(...payload: Array<Static<T["payload"]>>): Promise<void>;
|
|
59
|
-
}
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/descriptors/$consumer.d.ts
|
|
62
|
-
declare const KEY = "CONSUMER";
|
|
63
|
-
/**
|
|
64
|
-
* Consumer descriptor.
|
|
65
|
-
*/
|
|
66
|
-
declare const $consumer: {
|
|
67
|
-
<T extends QueueMessageSchema>(options: ConsumerDescriptorOptions<T>): ConsumerDescriptor<T>;
|
|
68
|
-
[KIND]: string;
|
|
69
|
-
};
|
|
70
|
-
interface ConsumerDescriptorOptions<T extends QueueMessageSchema = QueueMessageSchema> {
|
|
71
|
-
queue: QueueDescriptor<T>;
|
|
72
|
-
handler: (message: {
|
|
73
|
-
payload: Static<T["payload"]>;
|
|
74
|
-
}) => Promise<void>;
|
|
75
|
-
}
|
|
76
|
-
interface ConsumerDescriptor<T extends QueueMessageSchema = QueueMessageSchema> {
|
|
77
|
-
[KIND]: typeof KEY;
|
|
78
|
-
[OPTIONS]: ConsumerDescriptorOptions<T>;
|
|
79
|
-
queue(): QueueDescriptor<T>;
|
|
80
|
-
stop(): Promise<void>;
|
|
81
|
-
}
|
|
82
|
-
//#endregion
|
|
83
33
|
//#region src/providers/MemoryQueueProvider.d.ts
|
|
84
34
|
declare class MemoryQueueProvider implements QueueProvider {
|
|
85
|
-
protected readonly log:
|
|
35
|
+
protected readonly log: _alepha_core1.Logger;
|
|
86
36
|
protected queueList: Record<string, string[]>;
|
|
87
37
|
push(queue: string, ...messages: string[]): Promise<void>;
|
|
88
38
|
pop(queue: string): Promise<string | undefined>;
|
|
89
39
|
}
|
|
90
40
|
//# sourceMappingURL=MemoryQueueProvider.d.ts.map
|
|
91
41
|
//#endregion
|
|
92
|
-
//#region src/providers/
|
|
93
|
-
declare const envSchema:
|
|
42
|
+
//#region src/providers/WorkerProvider.d.ts
|
|
43
|
+
declare const envSchema: _alepha_core2.TObject<{
|
|
94
44
|
/**
|
|
95
45
|
* The interval in milliseconds to wait before checking for new messages.
|
|
96
46
|
*/
|
|
97
|
-
QUEUE_WORKER_INTERVAL:
|
|
47
|
+
QUEUE_WORKER_INTERVAL: _alepha_core2.TNumber;
|
|
98
48
|
/**
|
|
99
49
|
* The maximum interval in milliseconds to wait before checking for new messages.
|
|
100
50
|
*/
|
|
101
|
-
QUEUE_WORKER_MAX_INTERVAL:
|
|
51
|
+
QUEUE_WORKER_MAX_INTERVAL: _alepha_core2.TNumber;
|
|
102
52
|
/**
|
|
103
53
|
* The number of workers to run concurrently. Defaults to 1.
|
|
104
54
|
* Useful only if you are doing a lot of I/O.
|
|
105
55
|
*/
|
|
106
|
-
QUEUE_WORKER_CONCURRENCY:
|
|
56
|
+
QUEUE_WORKER_CONCURRENCY: _alepha_core2.TNumber;
|
|
107
57
|
}>;
|
|
108
58
|
declare module "alepha" {
|
|
109
59
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
110
60
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
consumers: Array<ConsumerDescriptorOptions>;
|
|
114
|
-
workerPromises: Array<Promise<void>>;
|
|
115
|
-
isWorkersRunning: boolean;
|
|
116
|
-
abortController: AbortController;
|
|
117
|
-
workerIntervals: Record<number, number>;
|
|
118
|
-
}
|
|
119
|
-
declare class QueueDescriptorProvider {
|
|
120
|
-
protected readonly log: _alepha_core1.Logger;
|
|
61
|
+
declare class WorkerProvider {
|
|
62
|
+
protected readonly log: _alepha_core2.Logger;
|
|
121
63
|
protected readonly env: {
|
|
122
64
|
QUEUE_WORKER_INTERVAL: number;
|
|
123
65
|
QUEUE_WORKER_MAX_INTERVAL: number;
|
|
@@ -125,43 +67,19 @@ declare class QueueDescriptorProvider {
|
|
|
125
67
|
};
|
|
126
68
|
protected readonly alepha: Alepha;
|
|
127
69
|
protected readonly queueProvider: QueueProvider;
|
|
128
|
-
protected readonly memoryQueueProvider: MemoryQueueProvider;
|
|
129
70
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
130
|
-
protected
|
|
131
|
-
protected
|
|
132
|
-
protected
|
|
133
|
-
protected
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Process the descriptors.
|
|
138
|
-
*
|
|
139
|
-
* @protected
|
|
140
|
-
*/
|
|
141
|
-
protected processDescriptors(): void;
|
|
142
|
-
/**
|
|
143
|
-
* Process the queue descriptors.
|
|
144
|
-
*
|
|
145
|
-
* @protected
|
|
146
|
-
*/
|
|
147
|
-
protected processQueueDescriptors(): void;
|
|
148
|
-
/**
|
|
149
|
-
* Process the consumer descriptors.
|
|
150
|
-
*/
|
|
151
|
-
protected processConsumerDescriptors(): void;
|
|
152
|
-
/**
|
|
153
|
-
* Get the provider for the queue.
|
|
154
|
-
*/
|
|
155
|
-
protected provider(options: QueueDescriptorOptions<any>): QueueProvider;
|
|
156
|
-
/**
|
|
157
|
-
* Push an item to the queue.
|
|
158
|
-
*/
|
|
159
|
-
protected push<T extends QueueMessageSchema>(queue: QueueDescriptor<T>, ...payloads: Array<Static<T["payload"]>>): Promise<void>;
|
|
71
|
+
protected workerPromises: Array<Promise<void>>;
|
|
72
|
+
protected isWorkersRunning: boolean;
|
|
73
|
+
protected abortController: AbortController;
|
|
74
|
+
protected workerIntervals: Record<number, number>;
|
|
75
|
+
protected consumers: Array<Consumer>;
|
|
76
|
+
protected readonly start: _alepha_core2.HookDescriptor<"start">;
|
|
160
77
|
/**
|
|
161
78
|
* Start the workers.
|
|
162
79
|
* This method will create an endless loop that will check for new messages!
|
|
163
80
|
*/
|
|
164
|
-
protected startWorkers(
|
|
81
|
+
protected startWorkers(): void;
|
|
82
|
+
protected readonly stop: _alepha_core2.HookDescriptor<"stop">;
|
|
165
83
|
/**
|
|
166
84
|
* Wait for the next message, where `n` is the worker number.
|
|
167
85
|
*
|
|
@@ -171,16 +89,13 @@ declare class QueueDescriptorProvider {
|
|
|
171
89
|
/**
|
|
172
90
|
* Get the next message.
|
|
173
91
|
*/
|
|
174
|
-
protected getNextMessage(
|
|
175
|
-
consumer: ConsumerDescriptorOptions;
|
|
176
|
-
message: string;
|
|
177
|
-
}>;
|
|
92
|
+
protected getNextMessage(): Promise<undefined | NextMessage>;
|
|
178
93
|
/**
|
|
179
94
|
* Process a message from a queue.
|
|
180
95
|
*/
|
|
181
96
|
protected processMessage(response: {
|
|
182
97
|
message: any;
|
|
183
|
-
consumer:
|
|
98
|
+
consumer: Consumer;
|
|
184
99
|
}): Promise<void>;
|
|
185
100
|
/**
|
|
186
101
|
* Stop the workers.
|
|
@@ -188,26 +103,83 @@ declare class QueueDescriptorProvider {
|
|
|
188
103
|
* This method will stop the workers and wait for them to finish processing.
|
|
189
104
|
*/
|
|
190
105
|
protected stopWorkers(): Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
* Force the workers to get back to work. zug zug!
|
|
108
|
+
*/
|
|
109
|
+
wakeUp(): void;
|
|
110
|
+
}
|
|
111
|
+
interface Consumer<T extends TSchema = TSchema> {
|
|
112
|
+
queue: QueueDescriptor<T>;
|
|
113
|
+
handler: (message: QueueMessage<T>) => Promise<void>;
|
|
114
|
+
}
|
|
115
|
+
interface NextMessage {
|
|
116
|
+
consumer: Consumer;
|
|
117
|
+
message: string;
|
|
191
118
|
}
|
|
192
119
|
//#endregion
|
|
120
|
+
//#region src/descriptors/$queue.d.ts
|
|
121
|
+
/**
|
|
122
|
+
* Create a new queue.
|
|
123
|
+
*/
|
|
124
|
+
declare const $queue: {
|
|
125
|
+
<T extends TSchema>(options: QueueDescriptorOptions<T>): QueueDescriptor<T>;
|
|
126
|
+
[KIND]: typeof QueueDescriptor;
|
|
127
|
+
};
|
|
128
|
+
interface QueueDescriptorOptions<T extends TSchema> {
|
|
129
|
+
name?: string;
|
|
130
|
+
description?: string;
|
|
131
|
+
provider?: "memory" | Service<QueueProvider>;
|
|
132
|
+
schema: T;
|
|
133
|
+
handler?: (message: QueueMessage<T>) => Promise<void>;
|
|
134
|
+
}
|
|
135
|
+
declare class QueueDescriptor<T extends TSchema> extends Descriptor<QueueDescriptorOptions<T>> {
|
|
136
|
+
protected readonly log: _alepha_core0$1.Logger;
|
|
137
|
+
protected readonly workerProvider: WorkerProvider;
|
|
138
|
+
readonly provider: QueueProvider | MemoryQueueProvider;
|
|
139
|
+
push(...payloads: Array<Static<T>>): Promise<void>;
|
|
140
|
+
get name(): string;
|
|
141
|
+
protected $provider(): QueueProvider | MemoryQueueProvider;
|
|
142
|
+
}
|
|
143
|
+
interface QueueMessageSchema {
|
|
144
|
+
payload: TSchema;
|
|
145
|
+
}
|
|
146
|
+
interface QueueMessage<T extends TSchema> {
|
|
147
|
+
payload: Static<T>;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=$queue.d.ts.map
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/descriptors/$consumer.d.ts
|
|
152
|
+
/**
|
|
153
|
+
* Consumer descriptor.
|
|
154
|
+
*/
|
|
155
|
+
declare const $consumer: {
|
|
156
|
+
<T extends TSchema>(options: ConsumerDescriptorOptions<T>): ConsumerDescriptor<T>;
|
|
157
|
+
[KIND]: typeof ConsumerDescriptor;
|
|
158
|
+
};
|
|
159
|
+
interface ConsumerDescriptorOptions<T extends TSchema> {
|
|
160
|
+
queue: QueueDescriptor<T>;
|
|
161
|
+
handler: (message: {
|
|
162
|
+
payload: Static<T["payload"]>;
|
|
163
|
+
}) => Promise<void>;
|
|
164
|
+
}
|
|
165
|
+
declare class ConsumerDescriptor<T extends TSchema> extends Descriptor<ConsumerDescriptorOptions<T>> {}
|
|
166
|
+
//# sourceMappingURL=$consumer.d.ts.map
|
|
167
|
+
//#endregion
|
|
193
168
|
//#region src/index.d.ts
|
|
194
169
|
/**
|
|
195
|
-
*
|
|
170
|
+
* Provides asynchronous message queuing and processing capabilities through declarative queue descriptors.
|
|
196
171
|
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
172
|
+
* The queue module enables reliable background job processing and message passing using the `$queue` descriptor
|
|
173
|
+
* on class properties. It supports schema validation, automatic retries, and multiple queue backends for
|
|
174
|
+
* building scalable, decoupled applications with robust error handling.
|
|
200
175
|
*
|
|
201
176
|
* @see {@link $queue}
|
|
202
177
|
* @see {@link $consumer}
|
|
203
178
|
* @module alepha.queue
|
|
204
179
|
*/
|
|
205
|
-
declare
|
|
206
|
-
readonly name = "alepha.queue";
|
|
207
|
-
readonly $services: (alepha: Alepha) => Alepha;
|
|
208
|
-
}
|
|
180
|
+
declare const AlephaQueue: _alepha_core0.ModuleDescriptor;
|
|
209
181
|
//# sourceMappingURL=index.d.ts.map
|
|
210
182
|
|
|
211
183
|
//#endregion
|
|
212
|
-
export { $consumer, $queue, AlephaQueue, ConsumerDescriptor, ConsumerDescriptorOptions, MemoryQueueProvider, QueueDescriptor, QueueDescriptorOptions,
|
|
184
|
+
export { $consumer, $queue, AlephaQueue, ConsumerDescriptor, ConsumerDescriptorOptions, MemoryQueueProvider, QueueDescriptor, QueueDescriptorOptions, QueueMessage, QueueMessageSchema, QueueProvider };
|
|
213
185
|
//# sourceMappingURL=index.d.ts.map
|
package/react/auth.d.ts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import * as _alepha_core0$1 from "alepha";
|
|
2
|
+
import * as _alepha_core4 from "alepha";
|
|
3
|
+
import * as _alepha_core0 from "alepha";
|
|
4
|
+
import { Alepha, Async, Descriptor, KIND } from "alepha";
|
|
5
|
+
import * as _alepha_server_cookies0 from "alepha/server/cookies";
|
|
5
6
|
import { Cookies, ServerCookiesProvider } from "alepha/server/cookies";
|
|
6
|
-
import * as
|
|
7
|
+
import * as _alepha_server0 from "alepha/server";
|
|
7
8
|
import { HttpClient } from "alepha/server";
|
|
8
9
|
import { Configuration } from "openid-client";
|
|
9
10
|
import { HttpVirtualClient } from "alepha/server/links";
|
|
10
11
|
import { UserAccountToken } from "alepha/security";
|
|
11
|
-
import * as
|
|
12
|
+
import * as _sinclair_typebox0 from "@sinclair/typebox";
|
|
12
13
|
|
|
13
14
|
//#region src/descriptors/$auth.d.ts
|
|
14
|
-
declare const
|
|
15
|
-
|
|
15
|
+
declare const $auth: {
|
|
16
|
+
(options: AuthDescriptorOptions): AuthDescriptor;
|
|
17
|
+
[KIND]: typeof AuthDescriptor;
|
|
18
|
+
};
|
|
16
19
|
interface AuthDescriptorOptions {
|
|
17
20
|
name?: string;
|
|
18
21
|
fallback?: () => Async<AccessToken>;
|
|
@@ -25,63 +28,60 @@ interface AuthDescriptorOptions {
|
|
|
25
28
|
logoutUri?: string;
|
|
26
29
|
};
|
|
27
30
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
jwks: () => string;
|
|
31
|
+
declare class AuthDescriptor extends Descriptor<AuthDescriptorOptions> {
|
|
32
|
+
get name(): string;
|
|
33
|
+
jwks(): string;
|
|
32
34
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
[KIND]: string;
|
|
36
|
-
};
|
|
35
|
+
type AccessToken = string;
|
|
36
|
+
//# sourceMappingURL=$auth.d.ts.map
|
|
37
37
|
//#endregion
|
|
38
38
|
//#region src/providers/ReactAuthProvider.d.ts
|
|
39
39
|
declare class ReactAuthProvider {
|
|
40
|
-
protected readonly log:
|
|
40
|
+
protected readonly log: _alepha_core0$1.Logger;
|
|
41
41
|
protected readonly alepha: Alepha;
|
|
42
42
|
protected readonly serverCookiesProvider: ServerCookiesProvider;
|
|
43
43
|
protected authProviders: AuthProvider[];
|
|
44
|
-
protected readonly authorizationCode:
|
|
45
|
-
codeVerifier:
|
|
46
|
-
redirectUri:
|
|
44
|
+
protected readonly authorizationCode: _alepha_server_cookies0.CookieDescriptor<_sinclair_typebox0.TObject<{
|
|
45
|
+
codeVerifier: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
46
|
+
redirectUri: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
47
47
|
}>>;
|
|
48
|
-
readonly tokens:
|
|
49
|
-
provider:
|
|
50
|
-
access_token:
|
|
51
|
-
expires_in:
|
|
52
|
-
refresh_token:
|
|
53
|
-
id_token:
|
|
54
|
-
scope:
|
|
55
|
-
issued_at:
|
|
48
|
+
readonly tokens: _alepha_server_cookies0.CookieDescriptor<_sinclair_typebox0.TObject<{
|
|
49
|
+
provider: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
50
|
+
access_token: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
51
|
+
expires_in: _sinclair_typebox0.TOptional<_sinclair_typebox0.TNumber>;
|
|
52
|
+
refresh_token: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
53
|
+
id_token: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
54
|
+
scope: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
55
|
+
issued_at: _sinclair_typebox0.TOptional<_sinclair_typebox0.TNumber>;
|
|
56
56
|
}>>;
|
|
57
|
-
readonly user:
|
|
58
|
-
id:
|
|
59
|
-
name:
|
|
60
|
-
email:
|
|
61
|
-
picture:
|
|
57
|
+
readonly user: _alepha_server_cookies0.CookieDescriptor<_sinclair_typebox0.TObject<{
|
|
58
|
+
id: _sinclair_typebox0.TString;
|
|
59
|
+
name: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
60
|
+
email: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
61
|
+
picture: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
62
62
|
}>>;
|
|
63
|
-
readonly onRender:
|
|
64
|
-
protected readonly configure:
|
|
63
|
+
readonly onRender: _alepha_core0$1.HookDescriptor<"react:server:render:begin">;
|
|
64
|
+
protected readonly configure: _alepha_core0$1.HookDescriptor<"configure">;
|
|
65
65
|
protected getAccessTokenFromCookies(tokens: SessionTokens): Promise<string | undefined>;
|
|
66
66
|
/**
|
|
67
67
|
* Configure Fastify to forward Session Access Token to Header Authorization.
|
|
68
68
|
*/
|
|
69
|
-
protected readonly onRequest:
|
|
69
|
+
protected readonly onRequest: _alepha_core0$1.HookDescriptor<"server:onRequest">;
|
|
70
70
|
/**
|
|
71
71
|
*
|
|
72
72
|
* @param cookies
|
|
73
73
|
* @protected
|
|
74
74
|
*/
|
|
75
75
|
protected refresh(cookies: Cookies): Promise<SessionTokens | undefined>;
|
|
76
|
-
readonly login:
|
|
77
|
-
query:
|
|
78
|
-
redirect:
|
|
79
|
-
provider:
|
|
76
|
+
readonly login: _alepha_server0.RouteDescriptor<{
|
|
77
|
+
query: _sinclair_typebox0.TObject<{
|
|
78
|
+
redirect: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
79
|
+
provider: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
80
80
|
}>;
|
|
81
81
|
}>;
|
|
82
|
-
readonly callback:
|
|
83
|
-
query:
|
|
84
|
-
provider:
|
|
82
|
+
readonly callback: _alepha_server0.RouteDescriptor<{
|
|
83
|
+
query: _sinclair_typebox0.TObject<{
|
|
84
|
+
provider: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
85
85
|
}>;
|
|
86
86
|
}>;
|
|
87
87
|
/**
|
|
@@ -95,10 +95,10 @@ declare class ReactAuthProvider {
|
|
|
95
95
|
email: any;
|
|
96
96
|
picture: any;
|
|
97
97
|
} | undefined;
|
|
98
|
-
readonly logout:
|
|
99
|
-
query:
|
|
100
|
-
redirect:
|
|
101
|
-
provider:
|
|
98
|
+
readonly logout: _alepha_server0.RouteDescriptor<{
|
|
99
|
+
query: _sinclair_typebox0.TObject<{
|
|
100
|
+
redirect: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
101
|
+
provider: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
102
102
|
}>;
|
|
103
103
|
}>;
|
|
104
104
|
/**
|
|
@@ -159,7 +159,7 @@ interface AuthHook {
|
|
|
159
159
|
//#endregion
|
|
160
160
|
//#region src/services/ReactAuth.d.ts
|
|
161
161
|
declare class ReactAuth {
|
|
162
|
-
protected readonly log:
|
|
162
|
+
protected readonly log: _alepha_core4.Logger;
|
|
163
163
|
protected readonly alepha: Alepha;
|
|
164
164
|
protected readonly client: HttpClient;
|
|
165
165
|
static path: {
|
|
@@ -167,7 +167,7 @@ declare class ReactAuth {
|
|
|
167
167
|
callback: string;
|
|
168
168
|
logout: string;
|
|
169
169
|
};
|
|
170
|
-
readonly onRender:
|
|
170
|
+
readonly onRender: _alepha_core4.HookDescriptor<"react:transition:begin">;
|
|
171
171
|
get user(): UserAccountToken | undefined;
|
|
172
172
|
protected getUserFromCookies(): UserAccountToken | undefined;
|
|
173
173
|
login(): void;
|
|
@@ -185,17 +185,12 @@ declare module "alepha/react" {
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
/**
|
|
188
|
-
* Alepha React Authentication Module
|
|
189
|
-
*
|
|
190
188
|
* The ReactAuthModule provides authentication services for React applications.
|
|
191
189
|
*
|
|
192
190
|
* @see {@link ReactAuthProvider}
|
|
193
191
|
* @module alepha.react.auth
|
|
194
192
|
*/
|
|
195
|
-
declare
|
|
196
|
-
readonly name = "alepha.react.auth";
|
|
197
|
-
readonly $services: (alepha: Alepha) => void;
|
|
198
|
-
}
|
|
193
|
+
declare const AlephaReactAuth: _alepha_core0.ModuleDescriptor;
|
|
199
194
|
//# sourceMappingURL=index.d.ts.map
|
|
200
195
|
|
|
201
196
|
//#endregion
|
package/react/head.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import * as _alepha_core0$1 from "alepha";
|
|
2
|
+
import * as _alepha_core0 from "alepha";
|
|
1
3
|
import { PageConfigSchema, PageReactContext, PageRoute, RouterState, TPropsDefault, TPropsParentDefault } from "alepha/react";
|
|
2
|
-
import * as _alepha_core1 from "alepha";
|
|
3
|
-
import { Alepha, Module } from "alepha";
|
|
4
4
|
|
|
5
5
|
//#region src/interfaces/Head.d.ts
|
|
6
6
|
interface Head extends SimpleHead {
|
|
@@ -58,7 +58,7 @@ declare class HeadProvider {
|
|
|
58
58
|
//#region src/providers/ServerHeadProvider.d.ts
|
|
59
59
|
declare class ServerHeadProvider {
|
|
60
60
|
protected readonly headProvider: HeadProvider;
|
|
61
|
-
protected readonly onServerRenderEnd:
|
|
61
|
+
protected readonly onServerRenderEnd: _alepha_core0$1.HookDescriptor<"react:server:render:end">;
|
|
62
62
|
renderHead(template: string, head: SimpleHead): string;
|
|
63
63
|
protected mergeAttributes(existing: string, attrs: Record<string, string>): string;
|
|
64
64
|
protected parseAttributes(attrStr: string): Record<string, string>;
|
|
@@ -76,15 +76,12 @@ declare module "alepha/react" {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
79
|
+
* Fill `<head>` server & client side.
|
|
80
80
|
*
|
|
81
81
|
* @see {@link ServerHeadProvider}
|
|
82
82
|
* @module alepha.react.head
|
|
83
83
|
*/
|
|
84
|
-
declare
|
|
85
|
-
readonly name = "alepha.react.head";
|
|
86
|
-
readonly $services: (alepha: Alepha) => Alepha;
|
|
87
|
-
}
|
|
84
|
+
declare const AlephaReactHead: _alepha_core0.ModuleDescriptor;
|
|
88
85
|
//# sourceMappingURL=index.d.ts.map
|
|
89
86
|
|
|
90
87
|
//#endregion
|