alepha 0.7.7 → 0.8.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/batch.cjs +8 -0
- package/batch.d.ts +114 -0
- package/batch.js +1 -0
- package/cache/redis.d.ts +15 -18
- package/cache.d.ts +115 -119
- package/command.cjs +8 -0
- package/command.d.ts +154 -0
- package/command.js +1 -0
- package/core.d.ts +798 -794
- package/datetime.d.ts +76 -76
- package/lock/redis.d.ts +12 -12
- package/lock.d.ts +70 -75
- package/package.json +72 -34
- package/postgres.d.ts +202 -156
- package/queue/redis.d.ts +15 -13
- package/queue.d.ts +16 -13
- package/react/auth.d.ts +15 -10
- package/react/head.d.ts +9 -3
- package/react.d.ts +59 -36
- package/redis.d.ts +20 -27
- package/retry.d.ts +74 -54
- package/scheduler.d.ts +14 -12
- package/security.d.ts +38 -28
- package/server/cache.d.ts +7 -5
- package/server/compress.cjs +8 -0
- package/server/compress.d.ts +26 -0
- package/server/compress.js +1 -0
- package/server/cookies.d.ts +68 -14
- package/server/cors.d.ts +7 -3
- package/server/health.d.ts +24 -24
- package/server/helmet.cjs +8 -0
- package/server/helmet.d.ts +72 -0
- package/server/helmet.js +1 -0
- package/server/links.d.ts +79 -88
- package/server/metrics.cjs +8 -0
- package/server/metrics.d.ts +37 -0
- package/server/metrics.js +1 -0
- package/server/multipart.cjs +8 -0
- package/server/multipart.d.ts +48 -0
- package/server/multipart.js +1 -0
- package/server/proxy.d.ts +7 -7
- package/server/static.d.ts +63 -51
- package/server/swagger.d.ts +50 -50
- package/server.d.ts +114 -117
- package/topic/redis.d.ts +24 -23
- package/topic.d.ts +9 -3
- package/vite.d.ts +8 -1
package/queue/redis.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { QueueProvider } from "
|
|
2
|
-
import { Alepha, Module } from "
|
|
3
|
-
import { RedisProvider } from "
|
|
1
|
+
import { QueueProvider } from "alepha/queue";
|
|
2
|
+
import { Alepha, Module, Static, TObject, TString } from "alepha";
|
|
3
|
+
import { RedisProvider } from "alepha/redis";
|
|
4
4
|
|
|
5
5
|
//#region src/providers/RedisQueueProvider.d.ts
|
|
6
|
+
declare const envSchema: TObject<{
|
|
7
|
+
REDIS_QUEUE_PREFIX: TString;
|
|
8
|
+
}>;
|
|
6
9
|
declare class RedisQueueProvider implements QueueProvider {
|
|
7
|
-
protected readonly env:
|
|
8
|
-
REDIS_QUEUE_PREFIX: string;
|
|
9
|
-
};
|
|
10
|
+
protected readonly env: Static<typeof envSchema>;
|
|
10
11
|
protected readonly redisProvider: RedisProvider;
|
|
11
12
|
prefix(queue: string): string;
|
|
12
13
|
push(queue: string, message: string): Promise<void>;
|
|
@@ -14,14 +15,15 @@ declare class RedisQueueProvider implements QueueProvider {
|
|
|
14
15
|
}
|
|
15
16
|
//#endregion
|
|
16
17
|
//#region src/index.d.ts
|
|
18
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
17
19
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
* Alepha Queue Redis Module
|
|
21
|
+
*
|
|
22
|
+
* Plugin for Alepha Queue that provides Redis queue capabilities.
|
|
23
|
+
*
|
|
24
|
+
* @see {@link RedisQueueProvider}
|
|
25
|
+
* @module alepha.queue.redis
|
|
26
|
+
*/
|
|
25
27
|
declare class AlephaQueueRedis implements Module {
|
|
26
28
|
readonly name = "alepha.queue.redis";
|
|
27
29
|
readonly $services: (alepha: Alepha) => Alepha;
|
package/queue.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import * as _alepha_core0 from "
|
|
2
|
-
import * as
|
|
3
|
-
import { Alepha, KIND, Module, OPTIONS, Static, TSchema } from "
|
|
4
|
-
import { DateTimeProvider } from "
|
|
5
|
-
import * as _sinclair_typebox1 from "@sinclair/typebox";
|
|
1
|
+
import * as _alepha_core0 from "alepha";
|
|
2
|
+
import * as _alepha_core1 from "alepha";
|
|
3
|
+
import { Alepha, KIND, Module, OPTIONS, Static, TSchema } from "alepha";
|
|
4
|
+
import { DateTimeProvider } from "alepha/datetime";
|
|
6
5
|
|
|
7
6
|
//#region src/providers/QueueProvider.d.ts
|
|
8
7
|
/**
|
|
@@ -27,6 +26,7 @@ declare abstract class QueueProvider {
|
|
|
27
26
|
*/
|
|
28
27
|
abstract pop(queue: string): Promise<string | undefined>;
|
|
29
28
|
}
|
|
29
|
+
//# sourceMappingURL=QueueProvider.d.ts.map
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region src/descriptors/$queue.d.ts
|
|
32
32
|
declare const KEY$1 = "QUEUE";
|
|
@@ -87,22 +87,23 @@ declare class MemoryQueueProvider implements QueueProvider {
|
|
|
87
87
|
push(queue: string, ...messages: string[]): Promise<void>;
|
|
88
88
|
pop(queue: string): Promise<string | undefined>;
|
|
89
89
|
}
|
|
90
|
+
//# sourceMappingURL=MemoryQueueProvider.d.ts.map
|
|
90
91
|
//#endregion
|
|
91
92
|
//#region src/providers/QueueDescriptorProvider.d.ts
|
|
92
|
-
declare const envSchema:
|
|
93
|
+
declare const envSchema: _alepha_core1.TObject<{
|
|
93
94
|
/**
|
|
94
95
|
* The interval in milliseconds to wait before checking for new messages.
|
|
95
96
|
*/
|
|
96
|
-
QUEUE_WORKER_INTERVAL:
|
|
97
|
+
QUEUE_WORKER_INTERVAL: _alepha_core1.TNumber;
|
|
97
98
|
/**
|
|
98
99
|
* The maximum interval in milliseconds to wait before checking for new messages.
|
|
99
100
|
*/
|
|
100
|
-
QUEUE_WORKER_MAX_INTERVAL:
|
|
101
|
+
QUEUE_WORKER_MAX_INTERVAL: _alepha_core1.TNumber;
|
|
101
102
|
/**
|
|
102
103
|
* The number of workers to run concurrently. Defaults to 1.
|
|
103
104
|
* Useful only if you are doing a lot of I/O.
|
|
104
105
|
*/
|
|
105
|
-
QUEUE_WORKER_CONCURRENCY:
|
|
106
|
+
QUEUE_WORKER_CONCURRENCY: _alepha_core1.TNumber;
|
|
106
107
|
}>;
|
|
107
108
|
declare module "alepha" {
|
|
108
109
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -116,7 +117,7 @@ interface QueueDescriptorProviderState {
|
|
|
116
117
|
workerIntervals: Record<number, number>;
|
|
117
118
|
}
|
|
118
119
|
declare class QueueDescriptorProvider {
|
|
119
|
-
protected readonly log:
|
|
120
|
+
protected readonly log: _alepha_core1.Logger;
|
|
120
121
|
protected readonly env: {
|
|
121
122
|
QUEUE_WORKER_INTERVAL: number;
|
|
122
123
|
QUEUE_WORKER_MAX_INTERVAL: number;
|
|
@@ -127,9 +128,9 @@ declare class QueueDescriptorProvider {
|
|
|
127
128
|
protected readonly memoryQueueProvider: MemoryQueueProvider;
|
|
128
129
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
129
130
|
protected readonly state: QueueDescriptorProviderState;
|
|
130
|
-
protected readonly configure:
|
|
131
|
-
protected readonly start:
|
|
132
|
-
protected readonly stop:
|
|
131
|
+
protected readonly configure: _alepha_core1.HookDescriptor<"configure">;
|
|
132
|
+
protected readonly start: _alepha_core1.HookDescriptor<"start">;
|
|
133
|
+
protected readonly stop: _alepha_core1.HookDescriptor<"stop">;
|
|
133
134
|
getQueues(): QueueDescriptor<QueueMessageSchema>[];
|
|
134
135
|
getConsumers(): ConsumerDescriptorOptions<QueueMessageSchema>[];
|
|
135
136
|
/**
|
|
@@ -205,6 +206,8 @@ declare class AlephaQueue implements Module {
|
|
|
205
206
|
readonly name = "alepha.queue";
|
|
206
207
|
readonly $services: (alepha: Alepha) => Alepha;
|
|
207
208
|
}
|
|
209
|
+
//# sourceMappingURL=index.d.ts.map
|
|
210
|
+
|
|
208
211
|
//#endregion
|
|
209
212
|
export { $consumer, $queue, AlephaQueue, ConsumerDescriptor, ConsumerDescriptorOptions, MemoryQueueProvider, QueueDescriptor, QueueDescriptorOptions, QueueDescriptorProvider, QueueDescriptorProviderState, QueueMessageSchema, QueueProvider };
|
|
210
213
|
//# sourceMappingURL=index.d.ts.map
|
package/react/auth.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as _alepha_core1 from "
|
|
2
|
-
import * as _alepha_core52 from "
|
|
3
|
-
import { Alepha, Async, KIND, Module, OPTIONS } from "
|
|
4
|
-
import * as _alepha_server_cookies7 from "
|
|
5
|
-
import { Cookies, ServerCookiesProvider } from "
|
|
6
|
-
import * as _alepha_server41 from "
|
|
7
|
-
import { HttpClient } from "
|
|
1
|
+
import * as _alepha_core1 from "alepha";
|
|
2
|
+
import * as _alepha_core52 from "alepha";
|
|
3
|
+
import { Alepha, Async, KIND, Module, OPTIONS } from "alepha";
|
|
4
|
+
import * as _alepha_server_cookies7 from "alepha/server/cookies";
|
|
5
|
+
import { Cookies, ServerCookiesProvider } from "alepha/server/cookies";
|
|
6
|
+
import * as _alepha_server41 from "alepha/server";
|
|
7
|
+
import { HttpClient } from "alepha/server";
|
|
8
8
|
import { Configuration } from "openid-client";
|
|
9
|
-
import { HttpVirtualClient } from "
|
|
10
|
-
import { UserAccountToken } from "
|
|
9
|
+
import { HttpVirtualClient } from "alepha/server/links";
|
|
10
|
+
import { UserAccountToken } from "alepha/security";
|
|
11
11
|
import * as _sinclair_typebox2 from "@sinclair/typebox";
|
|
12
12
|
|
|
13
13
|
//#region src/descriptors/$auth.d.ts
|
|
@@ -45,7 +45,7 @@ declare class ReactAuthProvider {
|
|
|
45
45
|
codeVerifier: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
46
46
|
redirectUri: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
47
47
|
}>>;
|
|
48
|
-
|
|
48
|
+
readonly tokens: _alepha_server_cookies7.CookieDescriptor<_sinclair_typebox2.TObject<{
|
|
49
49
|
provider: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
50
50
|
access_token: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
51
51
|
expires_in: _sinclair_typebox2.TOptional<_sinclair_typebox2.TNumber>;
|
|
@@ -145,6 +145,7 @@ interface ReactUser {
|
|
|
145
145
|
name?: string;
|
|
146
146
|
email?: string;
|
|
147
147
|
}
|
|
148
|
+
//# sourceMappingURL=ReactAuthProvider.d.ts.map
|
|
148
149
|
//#endregion
|
|
149
150
|
//#region src/hooks/useAuth.d.ts
|
|
150
151
|
declare const useAuth: () => AuthHook;
|
|
@@ -154,6 +155,7 @@ interface AuthHook {
|
|
|
154
155
|
login: (provider?: string) => void;
|
|
155
156
|
can: <T extends object>(name: keyof HttpVirtualClient<T>) => boolean;
|
|
156
157
|
}
|
|
158
|
+
//# sourceMappingURL=useAuth.d.ts.map
|
|
157
159
|
//#endregion
|
|
158
160
|
//#region src/services/ReactAuth.d.ts
|
|
159
161
|
declare class ReactAuth {
|
|
@@ -171,6 +173,7 @@ declare class ReactAuth {
|
|
|
171
173
|
login(): void;
|
|
172
174
|
logout(): void;
|
|
173
175
|
}
|
|
176
|
+
//# sourceMappingURL=ReactAuth.d.ts.map
|
|
174
177
|
//#endregion
|
|
175
178
|
//#region src/index.d.ts
|
|
176
179
|
declare module "alepha/react" {
|
|
@@ -193,6 +196,8 @@ declare class AlephaReactAuth implements Module {
|
|
|
193
196
|
readonly name = "alepha.react.auth";
|
|
194
197
|
readonly $services: (alepha: Alepha) => void;
|
|
195
198
|
}
|
|
199
|
+
//# sourceMappingURL=index.d.ts.map
|
|
200
|
+
|
|
196
201
|
//#endregion
|
|
197
202
|
export { $auth, AccessToken, AlephaReactAuth, AuthDescriptor, AuthDescriptorOptions, AuthHook, AuthProvider, ReactAuth, ReactAuthProvider, ReactUser, SessionTokens, useAuth };
|
|
198
203
|
//# sourceMappingURL=index.d.ts.map
|
package/react/head.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PageConfigSchema, PageReactContext, PageRoute, RouterState, TPropsDefault, TPropsParentDefault } from "
|
|
2
|
-
import * as _alepha_core1 from "
|
|
3
|
-
import { Alepha, Module } from "
|
|
1
|
+
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 {
|
|
@@ -42,15 +42,18 @@ interface SimpleHead {
|
|
|
42
42
|
content: string;
|
|
43
43
|
}>;
|
|
44
44
|
}
|
|
45
|
+
//# sourceMappingURL=Head.d.ts.map
|
|
45
46
|
//#endregion
|
|
46
47
|
//#region src/hooks/useHead.d.ts
|
|
47
48
|
declare const useHead: (head?: Head | ((previous?: Head) => Head)) => void;
|
|
49
|
+
//# sourceMappingURL=useHead.d.ts.map
|
|
48
50
|
//#endregion
|
|
49
51
|
//#region src/providers/HeadProvider.d.ts
|
|
50
52
|
declare class HeadProvider {
|
|
51
53
|
fillHead(state: RouterState, context: PageReactContext): void;
|
|
52
54
|
protected fillHeadByPage(page: PageRoute, context: PageReactContext, props: Record<string, any>): void;
|
|
53
55
|
}
|
|
56
|
+
//# sourceMappingURL=HeadProvider.d.ts.map
|
|
54
57
|
//#endregion
|
|
55
58
|
//#region src/providers/ServerHeadProvider.d.ts
|
|
56
59
|
declare class ServerHeadProvider {
|
|
@@ -61,6 +64,7 @@ declare class ServerHeadProvider {
|
|
|
61
64
|
protected parseAttributes(attrStr: string): Record<string, string>;
|
|
62
65
|
protected escapeHtml(str: string): string;
|
|
63
66
|
}
|
|
67
|
+
//# sourceMappingURL=ServerHeadProvider.d.ts.map
|
|
64
68
|
//#endregion
|
|
65
69
|
//#region src/index.d.ts
|
|
66
70
|
declare module "alepha/react" {
|
|
@@ -81,6 +85,8 @@ declare class AlephaReactHead implements Module {
|
|
|
81
85
|
readonly name = "alepha.react.head";
|
|
82
86
|
readonly $services: (alepha: Alepha) => Alepha;
|
|
83
87
|
}
|
|
88
|
+
//# sourceMappingURL=index.d.ts.map
|
|
89
|
+
|
|
84
90
|
//#endregion
|
|
85
91
|
export { AlephaReactHead, Head, ServerHeadProvider, SimpleHead, useHead };
|
|
86
92
|
//# sourceMappingURL=index.d.ts.map
|
package/react.d.ts
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as _alepha_core16 from "
|
|
4
|
-
import * as
|
|
5
|
-
import { Alepha, Async, KIND, Module, OPTIONS, Service, Static, TObject, TSchema } from "
|
|
6
|
-
import { ApiLinksResponse, ServerHandler, ServerRequest, ServerRouterProvider, ServerTimingProvider } from "
|
|
7
|
-
import { ServerRouteCache } from "
|
|
8
|
-
import
|
|
9
|
-
import * as
|
|
1
|
+
import * as _alepha_core11 from "alepha";
|
|
2
|
+
import * as _alepha_core18 from "alepha";
|
|
3
|
+
import * as _alepha_core16 from "alepha";
|
|
4
|
+
import * as _alepha_core1 from "alepha";
|
|
5
|
+
import { Alepha, Async, KIND, Module, OPTIONS, Service, Static, TObject, TSchema } from "alepha";
|
|
6
|
+
import { ApiLinksResponse, ServerHandler, ServerRequest, ServerRouterProvider, ServerTimingProvider } from "alepha/server";
|
|
7
|
+
import { ServerRouteCache } from "alepha/server/cache";
|
|
8
|
+
import { ClientScope, HttpVirtualClient, LinkProvider } from "alepha/server/links";
|
|
9
|
+
import * as react23 from "react";
|
|
10
|
+
import * as react24 from "react";
|
|
10
11
|
import React, { AnchorHTMLAttributes, ErrorInfo, FC, PropsWithChildren, ReactNode } from "react";
|
|
11
12
|
import * as react_jsx_runtime22 from "react/jsx-runtime";
|
|
12
|
-
import * as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { Route, RouterProvider } from "@alepha/router";
|
|
16
|
-
import * as _sinclair_typebox11 from "@sinclair/typebox";
|
|
17
|
-
import * as _sinclair_typebox1 from "@sinclair/typebox";
|
|
13
|
+
import * as react_jsx_runtime20 from "react/jsx-runtime";
|
|
14
|
+
import { ServerStaticProvider } from "alepha/server/static";
|
|
15
|
+
import { Route, RouterProvider } from "alepha/router";
|
|
18
16
|
import { Root } from "react-dom/client";
|
|
19
17
|
|
|
20
18
|
//#region src/components/ClientOnly.d.ts
|
|
@@ -107,13 +105,21 @@ interface PageDescriptorOptions<TConfig extends PageConfigSchema = PageConfigSch
|
|
|
107
105
|
*/
|
|
108
106
|
children?: Array<{
|
|
109
107
|
[OPTIONS]: PageDescriptorOptions;
|
|
110
|
-
}
|
|
108
|
+
}> | (() => Array<{
|
|
109
|
+
[OPTIONS]: PageDescriptorOptions;
|
|
110
|
+
}>);
|
|
111
111
|
parent?: {
|
|
112
112
|
[OPTIONS]: PageDescriptorOptions<PageConfigSchema, TPropsParent>;
|
|
113
113
|
};
|
|
114
114
|
can?: () => boolean;
|
|
115
115
|
errorHandler?: (error: Error) => ReactNode;
|
|
116
|
-
|
|
116
|
+
/**
|
|
117
|
+
* If true, the page will be rendered on the build time.
|
|
118
|
+
* Works only with viteAlepha plugin.
|
|
119
|
+
*
|
|
120
|
+
* Replace boolean by an object to define static entries. (e.g. list of params/query)
|
|
121
|
+
*/
|
|
122
|
+
static?: boolean | {
|
|
117
123
|
entries?: Array<Partial<PageRequestConfig<TConfig>>>;
|
|
118
124
|
};
|
|
119
125
|
/**
|
|
@@ -156,14 +162,14 @@ interface PageRequestConfig<TConfig extends PageConfigSchema = PageConfigSchema>
|
|
|
156
162
|
type PageResolve<TConfig extends PageConfigSchema = PageConfigSchema, TPropsParent extends object = TPropsParentDefault> = PageRequestConfig<TConfig> & TPropsParent & PageReactContext;
|
|
157
163
|
//#endregion
|
|
158
164
|
//#region src/providers/PageDescriptorProvider.d.ts
|
|
159
|
-
declare const envSchema$1:
|
|
160
|
-
REACT_STRICT_MODE:
|
|
165
|
+
declare const envSchema$1: _alepha_core11.TObject<{
|
|
166
|
+
REACT_STRICT_MODE: _alepha_core11.TBoolean;
|
|
161
167
|
}>;
|
|
162
168
|
declare module "alepha" {
|
|
163
169
|
interface Env extends Partial<Static<typeof envSchema$1>> {}
|
|
164
170
|
}
|
|
165
171
|
declare class PageDescriptorProvider {
|
|
166
|
-
protected readonly log:
|
|
172
|
+
protected readonly log: _alepha_core11.Logger;
|
|
167
173
|
protected readonly env: {
|
|
168
174
|
REACT_STRICT_MODE: boolean;
|
|
169
175
|
};
|
|
@@ -188,7 +194,7 @@ declare class PageDescriptorProvider {
|
|
|
188
194
|
}, params?: Record<string, any>): string;
|
|
189
195
|
compile(path: string, params?: Record<string, string>): string;
|
|
190
196
|
protected renderView(index: number, path: string, view: ReactNode | undefined, page: PageRoute): ReactNode;
|
|
191
|
-
protected readonly configure:
|
|
197
|
+
protected readonly configure: _alepha_core11.HookDescriptor<"configure">;
|
|
192
198
|
protected map(pages: Array<{
|
|
193
199
|
value: {
|
|
194
200
|
[OPTIONS]: PageDescriptorOptions;
|
|
@@ -275,14 +281,15 @@ interface BrowserRoute extends Route {
|
|
|
275
281
|
page: PageRoute;
|
|
276
282
|
}
|
|
277
283
|
declare class BrowserRouterProvider extends RouterProvider<BrowserRoute> {
|
|
278
|
-
protected readonly log:
|
|
284
|
+
protected readonly log: _alepha_core18.Logger;
|
|
279
285
|
protected readonly alepha: Alepha;
|
|
280
286
|
protected readonly pageDescriptorProvider: PageDescriptorProvider;
|
|
281
287
|
add(entry: PageRouteEntry): void;
|
|
282
|
-
protected readonly configure:
|
|
288
|
+
protected readonly configure: _alepha_core18.HookDescriptor<"configure">;
|
|
283
289
|
transition(url: URL, options?: TransitionOptions): Promise<RouterRenderResult>;
|
|
284
290
|
root(state: RouterState, context: PageReactContext): ReactNode;
|
|
285
291
|
}
|
|
292
|
+
//# sourceMappingURL=BrowserRouterProvider.d.ts.map
|
|
286
293
|
//#endregion
|
|
287
294
|
//#region src/providers/ReactBrowserProvider.d.ts
|
|
288
295
|
declare class ReactBrowserProvider {
|
|
@@ -319,6 +326,7 @@ interface ReactHydrationState {
|
|
|
319
326
|
layers?: Array<PreviousLayerData>;
|
|
320
327
|
links?: ApiLinksResponse;
|
|
321
328
|
}
|
|
329
|
+
//# sourceMappingURL=ReactBrowserProvider.d.ts.map
|
|
322
330
|
//#endregion
|
|
323
331
|
//#region src/components/ErrorBoundary.d.ts
|
|
324
332
|
/**
|
|
@@ -378,7 +386,7 @@ interface NestedViewProps {
|
|
|
378
386
|
*
|
|
379
387
|
* @example
|
|
380
388
|
* ```tsx
|
|
381
|
-
* import { NestedView } from "
|
|
389
|
+
* import { NestedView } from "alepha/react";
|
|
382
390
|
*
|
|
383
391
|
* class App {
|
|
384
392
|
* parent = $page({
|
|
@@ -392,7 +400,7 @@ interface NestedViewProps {
|
|
|
392
400
|
* }
|
|
393
401
|
* ```
|
|
394
402
|
*/
|
|
395
|
-
declare const NestedView: (props: NestedViewProps) =>
|
|
403
|
+
declare const NestedView: (props: NestedViewProps) => react_jsx_runtime20.JSX.Element;
|
|
396
404
|
//#endregion
|
|
397
405
|
//#region src/contexts/RouterContext.d.ts
|
|
398
406
|
interface RouterContextValue {
|
|
@@ -400,14 +408,16 @@ interface RouterContextValue {
|
|
|
400
408
|
state: RouterState;
|
|
401
409
|
context: PageReactContext;
|
|
402
410
|
}
|
|
403
|
-
declare const RouterContext:
|
|
411
|
+
declare const RouterContext: react23.Context<RouterContextValue | undefined>;
|
|
412
|
+
//# sourceMappingURL=RouterContext.d.ts.map
|
|
404
413
|
//#endregion
|
|
405
414
|
//#region src/contexts/RouterLayerContext.d.ts
|
|
406
415
|
interface RouterLayerContextValue {
|
|
407
416
|
index: number;
|
|
408
417
|
path: string;
|
|
409
418
|
}
|
|
410
|
-
declare const RouterLayerContext:
|
|
419
|
+
declare const RouterLayerContext: react24.Context<RouterLayerContextValue | undefined>;
|
|
420
|
+
//# sourceMappingURL=RouterLayerContext.d.ts.map
|
|
411
421
|
//#endregion
|
|
412
422
|
//#region src/hooks/RouterHookApi.d.ts
|
|
413
423
|
declare class RouterHookApi {
|
|
@@ -463,12 +473,14 @@ type HrefLike = string | {
|
|
|
463
473
|
};
|
|
464
474
|
};
|
|
465
475
|
type VirtualRouter<T> = { [K in keyof T as T[K] extends PageDescriptor ? K : never]: T[K] };
|
|
476
|
+
//# sourceMappingURL=RouterHookApi.d.ts.map
|
|
466
477
|
//#endregion
|
|
467
478
|
//#region src/errors/RedirectionError.d.ts
|
|
468
479
|
declare class RedirectionError extends Error {
|
|
469
480
|
readonly page: HrefLike;
|
|
470
481
|
constructor(page: HrefLike);
|
|
471
482
|
}
|
|
483
|
+
//# sourceMappingURL=RedirectionError.d.ts.map
|
|
472
484
|
//#endregion
|
|
473
485
|
//#region src/hooks/useActive.d.ts
|
|
474
486
|
declare const useActive: (path: HrefLike) => UseActiveHook;
|
|
@@ -478,15 +490,19 @@ interface UseActiveHook {
|
|
|
478
490
|
isPending: boolean;
|
|
479
491
|
name?: string;
|
|
480
492
|
}
|
|
493
|
+
//# sourceMappingURL=useActive.d.ts.map
|
|
481
494
|
//#endregion
|
|
482
495
|
//#region src/hooks/useAlepha.d.ts
|
|
483
496
|
declare const useAlepha: () => Alepha;
|
|
497
|
+
//# sourceMappingURL=useAlepha.d.ts.map
|
|
484
498
|
//#endregion
|
|
485
499
|
//#region src/hooks/useClient.d.ts
|
|
486
500
|
declare const useClient: <T extends object>(_scope?: ClientScope) => HttpVirtualClient<T>;
|
|
501
|
+
//# sourceMappingURL=useClient.d.ts.map
|
|
487
502
|
//#endregion
|
|
488
503
|
//#region src/hooks/useInject.d.ts
|
|
489
504
|
declare const useInject: <T extends object>(clazz: Service<T>) => T;
|
|
505
|
+
//# sourceMappingURL=useInject.d.ts.map
|
|
490
506
|
//#endregion
|
|
491
507
|
//#region src/hooks/useQueryParams.d.ts
|
|
492
508
|
interface UseQueryParamsHookOptions {
|
|
@@ -495,9 +511,11 @@ interface UseQueryParamsHookOptions {
|
|
|
495
511
|
push?: boolean;
|
|
496
512
|
}
|
|
497
513
|
declare const useQueryParams: <T extends TObject>(schema: T, options?: UseQueryParamsHookOptions) => [Static<T>, (data: Static<T>) => void];
|
|
514
|
+
//# sourceMappingURL=useQueryParams.d.ts.map
|
|
498
515
|
//#endregion
|
|
499
516
|
//#region src/hooks/useRouter.d.ts
|
|
500
517
|
declare const useRouter: () => RouterHookApi;
|
|
518
|
+
//# sourceMappingURL=useRouter.d.ts.map
|
|
501
519
|
//#endregion
|
|
502
520
|
//#region src/hooks/useRouterEvents.d.ts
|
|
503
521
|
declare const useRouterEvents: (opts?: {
|
|
@@ -512,18 +530,21 @@ declare const useRouterEvents: (opts?: {
|
|
|
512
530
|
error: Error;
|
|
513
531
|
}) => void;
|
|
514
532
|
}, deps?: any[]) => void;
|
|
533
|
+
//# sourceMappingURL=useRouterEvents.d.ts.map
|
|
515
534
|
//#endregion
|
|
516
535
|
//#region src/hooks/useRouterState.d.ts
|
|
517
536
|
declare const useRouterState: () => RouterState;
|
|
537
|
+
//# sourceMappingURL=useRouterState.d.ts.map
|
|
538
|
+
|
|
518
539
|
//#endregion
|
|
519
540
|
//#region src/providers/ReactServerProvider.d.ts
|
|
520
|
-
declare const envSchema:
|
|
521
|
-
REACT_SERVER_DIST:
|
|
522
|
-
REACT_SERVER_PREFIX:
|
|
523
|
-
REACT_SSR_ENABLED:
|
|
524
|
-
REACT_ROOT_ID:
|
|
541
|
+
declare const envSchema: _alepha_core1.TObject<{
|
|
542
|
+
REACT_SERVER_DIST: _alepha_core1.TString;
|
|
543
|
+
REACT_SERVER_PREFIX: _alepha_core1.TString;
|
|
544
|
+
REACT_SSR_ENABLED: _alepha_core1.TOptional<_alepha_core1.TBoolean>;
|
|
545
|
+
REACT_ROOT_ID: _alepha_core1.TString;
|
|
525
546
|
}>;
|
|
526
|
-
declare module "alepha
|
|
547
|
+
declare module "alepha" {
|
|
527
548
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
528
549
|
interface State {
|
|
529
550
|
"ReactServerProvider.template"?: string;
|
|
@@ -531,7 +552,7 @@ declare module "alepha/core" {
|
|
|
531
552
|
}
|
|
532
553
|
}
|
|
533
554
|
declare class ReactServerProvider {
|
|
534
|
-
protected readonly log:
|
|
555
|
+
protected readonly log: _alepha_core1.Logger;
|
|
535
556
|
protected readonly alepha: Alepha;
|
|
536
557
|
protected readonly pageDescriptorProvider: PageDescriptorProvider;
|
|
537
558
|
protected readonly serverStaticProvider: ServerStaticProvider;
|
|
@@ -544,7 +565,7 @@ declare class ReactServerProvider {
|
|
|
544
565
|
REACT_ROOT_ID: string;
|
|
545
566
|
};
|
|
546
567
|
protected readonly ROOT_DIV_REGEX: RegExp;
|
|
547
|
-
readonly onConfigure:
|
|
568
|
+
readonly onConfigure: _alepha_core1.HookDescriptor<"configure">;
|
|
548
569
|
get template(): string;
|
|
549
570
|
protected registerPages(templateLoader: TemplateLoader): Promise<void>;
|
|
550
571
|
protected getPublicDirectory(): string;
|
|
@@ -570,7 +591,7 @@ declare class ReactServerProvider {
|
|
|
570
591
|
type TemplateLoader = () => Promise<string | undefined>;
|
|
571
592
|
//#endregion
|
|
572
593
|
//#region src/index.d.ts
|
|
573
|
-
declare module "
|
|
594
|
+
declare module "alepha" {
|
|
574
595
|
interface Hooks {
|
|
575
596
|
"react:router:createLayers": {
|
|
576
597
|
request: ServerRequest;
|
|
@@ -624,6 +645,8 @@ declare class AlephaReact implements Module {
|
|
|
624
645
|
readonly name = "alepha.react";
|
|
625
646
|
readonly $services: (alepha: Alepha) => Alepha;
|
|
626
647
|
}
|
|
648
|
+
//# sourceMappingURL=index.d.ts.map
|
|
649
|
+
|
|
627
650
|
//#endregion
|
|
628
651
|
export { $page, AlephaReact, AnchorProps, ClientOnly, CreateLayersResult, ErrorBoundary, HrefLike, Layer, Link, NestedView, PageConfigSchema, PageDescriptor, PageDescriptorOptions, PageDescriptorProvider, PageDescriptorRenderOptions, PageDescriptorRenderResult, PageReactContext, PageRequest, PageRequestConfig, PageResolve, PageRoute, PageRouteEntry, PreviousLayerData, ReactBrowserProvider, ReactHydrationState, ReactServerProvider, RedirectionError, RouterContext, RouterContextValue, RouterGoOptions, RouterHookApi, RouterLayerContext, RouterLayerContextValue, RouterRenderResult, RouterStackItem, RouterState, TPropsDefault, TPropsParentDefault, TransitionOptions, UseActiveHook, UseQueryParamsHookOptions, VirtualRouter, isPageRoute, useActive, useAlepha, useClient, useInject, useQueryParams, useRouter, useRouterEvents, useRouterState };
|
|
629
652
|
//# sourceMappingURL=index.d.ts.map
|
package/redis.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as _alepha_core0 from "@alepha/core";
|
|
3
|
-
import { Alepha, Static } from "@alepha/core";
|
|
1
|
+
import { Alepha, HookDescriptor, Logger, Static, TNumber, TObject, TOptional, TString } from "alepha";
|
|
4
2
|
import { RedisClientType, SetOptions, createClient } from "@redis/client";
|
|
5
|
-
import * as _sinclair_typebox3 from "@sinclair/typebox";
|
|
6
3
|
|
|
7
4
|
//#region src/providers/RedisProvider.d.ts
|
|
8
|
-
declare const envSchema:
|
|
9
|
-
REDIS_PORT:
|
|
10
|
-
REDIS_HOST:
|
|
11
|
-
REDIS_PASSWORD:
|
|
5
|
+
declare const envSchema: TObject<{
|
|
6
|
+
REDIS_PORT: TNumber;
|
|
7
|
+
REDIS_HOST: TString;
|
|
8
|
+
REDIS_PASSWORD: TOptional<TString>;
|
|
12
9
|
}>;
|
|
13
10
|
declare module "alepha" {
|
|
14
11
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -19,24 +16,20 @@ type RedisClient = RedisClientType<{}, {}, {}, 3, {
|
|
|
19
16
|
type RedisClientOptions = Parameters<typeof createClient>[0];
|
|
20
17
|
type RedisSetOptions = SetOptions;
|
|
21
18
|
declare class RedisProvider {
|
|
22
|
-
protected readonly log:
|
|
19
|
+
protected readonly log: Logger;
|
|
23
20
|
protected readonly alepha: Alepha;
|
|
24
|
-
protected readonly env:
|
|
25
|
-
REDIS_PASSWORD?: string | undefined;
|
|
26
|
-
REDIS_PORT: number;
|
|
27
|
-
REDIS_HOST: string;
|
|
28
|
-
};
|
|
21
|
+
protected readonly env: Static<typeof envSchema>;
|
|
29
22
|
protected readonly client: RedisClient;
|
|
30
23
|
get publisher(): RedisClient;
|
|
31
|
-
protected readonly start:
|
|
32
|
-
protected readonly stop:
|
|
24
|
+
protected readonly start: HookDescriptor<"start">;
|
|
25
|
+
protected readonly stop: HookDescriptor<"stop">;
|
|
33
26
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
* Connect to the Redis server.
|
|
28
|
+
*/
|
|
36
29
|
connect(): Promise<void>;
|
|
37
30
|
/**
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
* Close the connection to the Redis server.
|
|
32
|
+
*/
|
|
40
33
|
close(): Promise<void>;
|
|
41
34
|
duplicate(options?: Partial<RedisClientOptions>): RedisClient;
|
|
42
35
|
get(key: string): Promise<Buffer | undefined>;
|
|
@@ -45,25 +38,25 @@ declare class RedisProvider {
|
|
|
45
38
|
keys(pattern: string): Promise<string[]>;
|
|
46
39
|
del(keys: string[]): Promise<void>;
|
|
47
40
|
/**
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
* Redis subscriber client factory method.
|
|
42
|
+
*/
|
|
50
43
|
protected createClient(): RedisClient;
|
|
51
44
|
}
|
|
52
45
|
//#endregion
|
|
53
46
|
//#region src/providers/RedisSubscriberProvider.d.ts
|
|
54
47
|
declare class RedisSubscriberProvider {
|
|
55
|
-
protected readonly log:
|
|
48
|
+
protected readonly log: Logger;
|
|
56
49
|
protected readonly alepha: Alepha;
|
|
57
50
|
protected readonly redisProvider: RedisProvider;
|
|
58
51
|
protected readonly client: RedisClient;
|
|
59
52
|
get subscriber(): RedisClient;
|
|
60
|
-
protected readonly start:
|
|
61
|
-
protected readonly stop:
|
|
53
|
+
protected readonly start: HookDescriptor<"start">;
|
|
54
|
+
protected readonly stop: HookDescriptor<"stop">;
|
|
62
55
|
connect(): Promise<void>;
|
|
63
56
|
close(): Promise<void>;
|
|
64
57
|
/**
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
* Redis subscriber client factory method.
|
|
59
|
+
*/
|
|
67
60
|
protected createClient(): RedisClient;
|
|
68
61
|
}
|
|
69
62
|
//#endregion
|