alepha 0.7.6 → 0.7.7
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 -44
- package/core.d.ts +2 -1
- package/datetime.d.ts +4 -4
- package/package.json +60 -25
- package/postgres.d.ts +262 -201
- package/react/auth.d.ts +4 -9
- package/react/head.cjs +8 -0
- package/react/head.d.ts +86 -0
- package/react/head.js +1 -0
- package/react.d.ts +54 -103
- package/scheduler.d.ts +0 -1
- package/security.d.ts +9 -22
- package/server/cache.d.ts +2 -2
- package/server/cookies.d.ts +5 -2
- package/server/cors.cjs +8 -0
- package/server/cors.d.ts +25 -0
- package/server/cors.js +1 -0
- package/server/health.cjs +8 -0
- package/server/health.d.ts +42 -0
- package/server/health.js +1 -0
- package/server/links.cjs +8 -0
- package/server/links.d.ts +188 -0
- package/server/links.js +1 -0
- package/server/proxy.cjs +8 -0
- package/server/proxy.d.ts +41 -0
- package/server/proxy.js +1 -0
- package/server.d.ts +207 -421
- package/topic.d.ts +0 -16
package/react/auth.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as _alepha_core1 from "@alepha/core";
|
|
2
2
|
import * as _alepha_core52 from "@alepha/core";
|
|
3
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
4
|
import * as _alepha_server_cookies7 from "@alepha/server-cookies";
|
|
7
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 "@alepha/server-links";
|
|
9
10
|
import { UserAccountToken } from "@alepha/security";
|
|
10
11
|
import * as _sinclair_typebox2 from "@sinclair/typebox";
|
|
11
12
|
|
|
@@ -59,7 +60,7 @@ declare class ReactAuthProvider {
|
|
|
59
60
|
email: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
60
61
|
picture: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
61
62
|
}>>;
|
|
62
|
-
readonly onRender: _alepha_core1.HookDescriptor<"react:server:render">;
|
|
63
|
+
readonly onRender: _alepha_core1.HookDescriptor<"react:server:render:begin">;
|
|
63
64
|
protected readonly configure: _alepha_core1.HookDescriptor<"configure">;
|
|
64
65
|
protected getAccessTokenFromCookies(tokens: SessionTokens): Promise<string | undefined>;
|
|
65
66
|
/**
|
|
@@ -72,18 +73,12 @@ declare class ReactAuthProvider {
|
|
|
72
73
|
* @protected
|
|
73
74
|
*/
|
|
74
75
|
protected refresh(cookies: Cookies): Promise<SessionTokens | undefined>;
|
|
75
|
-
/**
|
|
76
|
-
*
|
|
77
|
-
*/
|
|
78
76
|
readonly login: _alepha_server41.RouteDescriptor<{
|
|
79
77
|
query: _sinclair_typebox2.TObject<{
|
|
80
78
|
redirect: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
81
79
|
provider: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
|
82
80
|
}>;
|
|
83
81
|
}>;
|
|
84
|
-
/**
|
|
85
|
-
*
|
|
86
|
-
*/
|
|
87
82
|
readonly callback: _alepha_server41.RouteDescriptor<{
|
|
88
83
|
query: _sinclair_typebox2.TObject<{
|
|
89
84
|
provider: _sinclair_typebox2.TOptional<_sinclair_typebox2.TString>;
|
package/react/head.cjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var m = require('@alepha/react-head');
|
|
3
|
+
Object.keys(m).forEach(function (k) {
|
|
4
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: function () { return m[k]; }
|
|
7
|
+
});
|
|
8
|
+
});
|
package/react/head.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { PageConfigSchema, PageReactContext, PageRoute, RouterState, TPropsDefault, TPropsParentDefault } from "@alepha/react";
|
|
2
|
+
import * as _alepha_core1 from "@alepha/core";
|
|
3
|
+
import { Alepha, Module } from "@alepha/core";
|
|
4
|
+
|
|
5
|
+
//#region src/interfaces/Head.d.ts
|
|
6
|
+
interface Head extends SimpleHead {
|
|
7
|
+
description?: string;
|
|
8
|
+
keywords?: string[];
|
|
9
|
+
author?: string;
|
|
10
|
+
robots?: string;
|
|
11
|
+
themeColor?: string;
|
|
12
|
+
viewport?: string | {
|
|
13
|
+
width?: string;
|
|
14
|
+
height?: string;
|
|
15
|
+
initialScale?: string;
|
|
16
|
+
maximumScale?: string;
|
|
17
|
+
userScalable?: "no" | "yes" | "0" | "1";
|
|
18
|
+
interactiveWidget?: "resizes-visual" | "resizes-content" | "overlays-content";
|
|
19
|
+
};
|
|
20
|
+
og?: {
|
|
21
|
+
title?: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
image?: string;
|
|
24
|
+
url?: string;
|
|
25
|
+
type?: string;
|
|
26
|
+
};
|
|
27
|
+
twitter?: {
|
|
28
|
+
card?: string;
|
|
29
|
+
title?: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
image?: string;
|
|
32
|
+
site?: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
interface SimpleHead {
|
|
36
|
+
title?: string;
|
|
37
|
+
titleSeparator?: string;
|
|
38
|
+
htmlAttributes?: Record<string, string>;
|
|
39
|
+
bodyAttributes?: Record<string, string>;
|
|
40
|
+
meta?: Array<{
|
|
41
|
+
name: string;
|
|
42
|
+
content: string;
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/hooks/useHead.d.ts
|
|
47
|
+
declare const useHead: (head?: Head | ((previous?: Head) => Head)) => void;
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/providers/HeadProvider.d.ts
|
|
50
|
+
declare class HeadProvider {
|
|
51
|
+
fillHead(state: RouterState, context: PageReactContext): void;
|
|
52
|
+
protected fillHeadByPage(page: PageRoute, context: PageReactContext, props: Record<string, any>): void;
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/providers/ServerHeadProvider.d.ts
|
|
56
|
+
declare class ServerHeadProvider {
|
|
57
|
+
protected readonly headProvider: HeadProvider;
|
|
58
|
+
protected readonly onServerRenderEnd: _alepha_core1.HookDescriptor<"react:server:render:end">;
|
|
59
|
+
renderHead(template: string, head: SimpleHead): string;
|
|
60
|
+
protected mergeAttributes(existing: string, attrs: Record<string, string>): string;
|
|
61
|
+
protected parseAttributes(attrStr: string): Record<string, string>;
|
|
62
|
+
protected escapeHtml(str: string): string;
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/index.d.ts
|
|
66
|
+
declare module "alepha/react" {
|
|
67
|
+
interface PageDescriptorOptions<TConfig extends PageConfigSchema = PageConfigSchema, TProps extends object = TPropsDefault, TPropsParent extends object = TPropsParentDefault> {
|
|
68
|
+
head?: Head | ((props: TProps, previous?: Head) => Head);
|
|
69
|
+
}
|
|
70
|
+
interface PageReactContext {
|
|
71
|
+
head: Head;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Alepha React Head Module
|
|
76
|
+
*
|
|
77
|
+
* @see {@link ServerHeadProvider}
|
|
78
|
+
* @module alepha.react.head
|
|
79
|
+
*/
|
|
80
|
+
declare class AlephaReactHead implements Module {
|
|
81
|
+
readonly name = "alepha.react.head";
|
|
82
|
+
readonly $services: (alepha: Alepha) => Alepha;
|
|
83
|
+
}
|
|
84
|
+
//#endregion
|
|
85
|
+
export { AlephaReactHead, Head, ServerHeadProvider, SimpleHead, useHead };
|
|
86
|
+
//# sourceMappingURL=index.d.ts.map
|
package/react/head.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@alepha/react-head'
|
package/react.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alepha_core12 from "@alepha/core";
|
|
2
2
|
import * as _alepha_core23 from "@alepha/core";
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as _alepha_core16 from "@alepha/core";
|
|
4
|
+
import * as _alepha_core6 from "@alepha/core";
|
|
5
5
|
import { Alepha, Async, KIND, Module, OPTIONS, Service, Static, TObject, TSchema } from "@alepha/core";
|
|
6
|
-
import { ApiLinksResponse,
|
|
6
|
+
import { ApiLinksResponse, ServerHandler, ServerRequest, ServerRouterProvider, ServerTimingProvider } from "@alepha/server";
|
|
7
7
|
import { ServerRouteCache } from "@alepha/server-cache";
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
8
|
+
import * as react19 from "react";
|
|
9
|
+
import * as react20 from "react";
|
|
10
10
|
import React, { AnchorHTMLAttributes, ErrorInfo, FC, PropsWithChildren, ReactNode } from "react";
|
|
11
|
-
import * as react_jsx_runtime20 from "react/jsx-runtime";
|
|
12
11
|
import * as react_jsx_runtime22 from "react/jsx-runtime";
|
|
12
|
+
import * as react_jsx_runtime21 from "react/jsx-runtime";
|
|
13
|
+
import { ClientScope, HttpVirtualClient, LinkProvider } from "@alepha/server-links";
|
|
13
14
|
import { ServerStaticProvider } from "@alepha/server-static";
|
|
14
15
|
import { Route, RouterProvider } from "@alepha/router";
|
|
16
|
+
import * as _sinclair_typebox11 from "@sinclair/typebox";
|
|
15
17
|
import * as _sinclair_typebox1 from "@sinclair/typebox";
|
|
16
|
-
import * as _sinclair_typebox6 from "@sinclair/typebox";
|
|
17
18
|
import { Root } from "react-dom/client";
|
|
18
19
|
|
|
19
20
|
//#region src/components/ClientOnly.d.ts
|
|
@@ -111,7 +112,6 @@ interface PageDescriptorOptions<TConfig extends PageConfigSchema = PageConfigSch
|
|
|
111
112
|
[OPTIONS]: PageDescriptorOptions<PageConfigSchema, TPropsParent>;
|
|
112
113
|
};
|
|
113
114
|
can?: () => boolean;
|
|
114
|
-
head?: Head | ((props: TProps, previous?: Head) => Head);
|
|
115
115
|
errorHandler?: (error: Error) => ReactNode;
|
|
116
116
|
prerender?: boolean | {
|
|
117
117
|
entries?: Array<Partial<PageRequestConfig<TConfig>>>;
|
|
@@ -142,49 +142,13 @@ declare const $page: {
|
|
|
142
142
|
interface PageDescriptorRenderOptions {
|
|
143
143
|
params?: Record<string, string>;
|
|
144
144
|
query?: Record<string, string>;
|
|
145
|
-
|
|
145
|
+
html?: boolean;
|
|
146
|
+
hydration?: boolean;
|
|
146
147
|
}
|
|
147
148
|
interface PageDescriptorRenderResult {
|
|
148
149
|
html: string;
|
|
149
150
|
context: PageReactContext;
|
|
150
151
|
}
|
|
151
|
-
interface Head {
|
|
152
|
-
title?: string;
|
|
153
|
-
description?: string;
|
|
154
|
-
titleSeparator?: string;
|
|
155
|
-
htmlAttributes?: Record<string, string>;
|
|
156
|
-
bodyAttributes?: Record<string, string>;
|
|
157
|
-
meta?: Array<{
|
|
158
|
-
name: string;
|
|
159
|
-
content: string;
|
|
160
|
-
}>;
|
|
161
|
-
keywords?: string[];
|
|
162
|
-
author?: string;
|
|
163
|
-
robots?: string;
|
|
164
|
-
themeColor?: string;
|
|
165
|
-
viewport?: string | {
|
|
166
|
-
width?: string;
|
|
167
|
-
height?: string;
|
|
168
|
-
initialScale?: string;
|
|
169
|
-
maximumScale?: string;
|
|
170
|
-
userScalable?: "no" | "yes" | "0" | "1";
|
|
171
|
-
interactiveWidget?: "resizes-visual" | "resizes-content" | "overlays-content";
|
|
172
|
-
};
|
|
173
|
-
og?: {
|
|
174
|
-
title?: string;
|
|
175
|
-
description?: string;
|
|
176
|
-
image?: string;
|
|
177
|
-
url?: string;
|
|
178
|
-
type?: string;
|
|
179
|
-
};
|
|
180
|
-
twitter?: {
|
|
181
|
-
card?: string;
|
|
182
|
-
title?: string;
|
|
183
|
-
description?: string;
|
|
184
|
-
image?: string;
|
|
185
|
-
site?: string;
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
152
|
interface PageRequestConfig<TConfig extends PageConfigSchema = PageConfigSchema> {
|
|
189
153
|
params: TConfig["params"] extends TSchema ? Static<TConfig["params"]> : Record<string, string>;
|
|
190
154
|
query: TConfig["query"] extends TSchema ? Static<TConfig["query"]> : Record<string, string>;
|
|
@@ -192,14 +156,14 @@ interface PageRequestConfig<TConfig extends PageConfigSchema = PageConfigSchema>
|
|
|
192
156
|
type PageResolve<TConfig extends PageConfigSchema = PageConfigSchema, TPropsParent extends object = TPropsParentDefault> = PageRequestConfig<TConfig> & TPropsParent & PageReactContext;
|
|
193
157
|
//#endregion
|
|
194
158
|
//#region src/providers/PageDescriptorProvider.d.ts
|
|
195
|
-
declare const envSchema$1:
|
|
196
|
-
REACT_STRICT_MODE:
|
|
159
|
+
declare const envSchema$1: _alepha_core12.TObject<{
|
|
160
|
+
REACT_STRICT_MODE: _sinclair_typebox11.TBoolean;
|
|
197
161
|
}>;
|
|
198
162
|
declare module "alepha" {
|
|
199
163
|
interface Env extends Partial<Static<typeof envSchema$1>> {}
|
|
200
164
|
}
|
|
201
165
|
declare class PageDescriptorProvider {
|
|
202
|
-
protected readonly log:
|
|
166
|
+
protected readonly log: _alepha_core12.Logger;
|
|
203
167
|
protected readonly env: {
|
|
204
168
|
REACT_STRICT_MODE: boolean;
|
|
205
169
|
};
|
|
@@ -215,7 +179,6 @@ declare class PageDescriptorProvider {
|
|
|
215
179
|
createLayers(route: PageRoute, request: PageRequest): Promise<CreateLayersResult>;
|
|
216
180
|
protected getErrorHandler(route: PageRoute): ((error: Error) => ReactNode) | undefined;
|
|
217
181
|
protected createElement(page: PageRoute, props: Record<string, any>): Promise<ReactNode>;
|
|
218
|
-
protected fillHead(page: PageRoute, ctx: PageRequest, props: Record<string, any>): void;
|
|
219
182
|
renderError(error: Error): ReactNode;
|
|
220
183
|
renderEmptyView(): ReactNode;
|
|
221
184
|
href(page: {
|
|
@@ -225,7 +188,7 @@ declare class PageDescriptorProvider {
|
|
|
225
188
|
}, params?: Record<string, any>): string;
|
|
226
189
|
compile(path: string, params?: Record<string, string>): string;
|
|
227
190
|
protected renderView(index: number, path: string, view: ReactNode | undefined, page: PageRoute): ReactNode;
|
|
228
|
-
protected readonly configure:
|
|
191
|
+
protected readonly configure: _alepha_core12.HookDescriptor<"configure">;
|
|
229
192
|
protected map(pages: Array<{
|
|
230
193
|
value: {
|
|
231
194
|
[OPTIONS]: PageDescriptorOptions;
|
|
@@ -261,6 +224,7 @@ interface Layer {
|
|
|
261
224
|
element: ReactNode;
|
|
262
225
|
index: number;
|
|
263
226
|
path: string;
|
|
227
|
+
route?: PageRoute;
|
|
264
228
|
}
|
|
265
229
|
type PreviousLayerData = Omit<Layer, "element" | "index" | "path">;
|
|
266
230
|
interface AnchorProps {
|
|
@@ -302,33 +266,10 @@ interface CreateLayersResult extends RouterState {
|
|
|
302
266
|
*/
|
|
303
267
|
interface PageReactContext {
|
|
304
268
|
url: URL;
|
|
305
|
-
head: Head;
|
|
306
269
|
onError: (error: Error) => ReactNode;
|
|
307
270
|
links?: ApiLinksResponse;
|
|
308
271
|
}
|
|
309
272
|
//#endregion
|
|
310
|
-
//#region src/providers/ServerHeadProvider.d.ts
|
|
311
|
-
interface Head$1 {
|
|
312
|
-
title?: string;
|
|
313
|
-
htmlAttributes?: Record<string, string>;
|
|
314
|
-
bodyAttributes?: Record<string, string>;
|
|
315
|
-
meta?: Array<{
|
|
316
|
-
name: string;
|
|
317
|
-
content: string;
|
|
318
|
-
}>;
|
|
319
|
-
}
|
|
320
|
-
declare class ServerHeadProvider {
|
|
321
|
-
renderHead(template: string, head: Head$1): string;
|
|
322
|
-
mergeAttributes(existing: string, attrs: Record<string, string>): string;
|
|
323
|
-
parseAttributes(attrStr: string): Record<string, string>;
|
|
324
|
-
escapeHtml(str: string): string;
|
|
325
|
-
}
|
|
326
|
-
//#endregion
|
|
327
|
-
//#region src/providers/BrowserHeadProvider.d.ts
|
|
328
|
-
declare class BrowserHeadProvider {
|
|
329
|
-
renderHead(document: Document, head: Head$1): void;
|
|
330
|
-
}
|
|
331
|
-
//#endregion
|
|
332
273
|
//#region src/providers/BrowserRouterProvider.d.ts
|
|
333
274
|
interface BrowserRoute extends Route {
|
|
334
275
|
page: PageRoute;
|
|
@@ -345,11 +286,10 @@ declare class BrowserRouterProvider extends RouterProvider<BrowserRoute> {
|
|
|
345
286
|
//#endregion
|
|
346
287
|
//#region src/providers/ReactBrowserProvider.d.ts
|
|
347
288
|
declare class ReactBrowserProvider {
|
|
348
|
-
protected readonly log:
|
|
349
|
-
protected readonly client:
|
|
289
|
+
protected readonly log: _alepha_core16.Logger;
|
|
290
|
+
protected readonly client: LinkProvider;
|
|
350
291
|
protected readonly alepha: Alepha;
|
|
351
292
|
protected readonly router: BrowserRouterProvider;
|
|
352
|
-
protected readonly headProvider: BrowserHeadProvider;
|
|
353
293
|
protected root: Root;
|
|
354
294
|
transitioning?: {
|
|
355
295
|
to: string;
|
|
@@ -368,8 +308,7 @@ declare class ReactBrowserProvider {
|
|
|
368
308
|
* Get embedded layers from the server.
|
|
369
309
|
*/
|
|
370
310
|
protected getHydrationState(): ReactHydrationState | undefined;
|
|
371
|
-
readonly ready:
|
|
372
|
-
readonly onTransitionEnd: _alepha_core15.HookDescriptor<"react:transition:end">;
|
|
311
|
+
readonly ready: _alepha_core16.HookDescriptor<"ready">;
|
|
373
312
|
}
|
|
374
313
|
interface RouterGoOptions {
|
|
375
314
|
replace?: boolean;
|
|
@@ -426,7 +365,7 @@ interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
|
426
365
|
to: string | PageDescriptor;
|
|
427
366
|
children?: React.ReactNode;
|
|
428
367
|
}
|
|
429
|
-
declare const Link: (props: LinkProps) =>
|
|
368
|
+
declare const Link: (props: LinkProps) => react_jsx_runtime22.JSX.Element | null;
|
|
430
369
|
//#endregion
|
|
431
370
|
//#region src/components/NestedView.d.ts
|
|
432
371
|
interface NestedViewProps {
|
|
@@ -453,7 +392,7 @@ interface NestedViewProps {
|
|
|
453
392
|
* }
|
|
454
393
|
* ```
|
|
455
394
|
*/
|
|
456
|
-
declare const NestedView: (props: NestedViewProps) =>
|
|
395
|
+
declare const NestedView: (props: NestedViewProps) => react_jsx_runtime21.JSX.Element;
|
|
457
396
|
//#endregion
|
|
458
397
|
//#region src/contexts/RouterContext.d.ts
|
|
459
398
|
interface RouterContextValue {
|
|
@@ -461,14 +400,14 @@ interface RouterContextValue {
|
|
|
461
400
|
state: RouterState;
|
|
462
401
|
context: PageReactContext;
|
|
463
402
|
}
|
|
464
|
-
declare const RouterContext:
|
|
403
|
+
declare const RouterContext: react19.Context<RouterContextValue | undefined>;
|
|
465
404
|
//#endregion
|
|
466
405
|
//#region src/contexts/RouterLayerContext.d.ts
|
|
467
406
|
interface RouterLayerContextValue {
|
|
468
407
|
index: number;
|
|
469
408
|
path: string;
|
|
470
409
|
}
|
|
471
|
-
declare const RouterLayerContext:
|
|
410
|
+
declare const RouterLayerContext: react20.Context<RouterLayerContextValue | undefined>;
|
|
472
411
|
//#endregion
|
|
473
412
|
//#region src/hooks/RouterHookApi.d.ts
|
|
474
413
|
declare class RouterHookApi {
|
|
@@ -578,11 +517,11 @@ declare const useRouterEvents: (opts?: {
|
|
|
578
517
|
declare const useRouterState: () => RouterState;
|
|
579
518
|
//#endregion
|
|
580
519
|
//#region src/providers/ReactServerProvider.d.ts
|
|
581
|
-
declare const envSchema:
|
|
582
|
-
REACT_SERVER_DIST:
|
|
583
|
-
REACT_SERVER_PREFIX:
|
|
584
|
-
REACT_SSR_ENABLED:
|
|
585
|
-
REACT_ROOT_ID:
|
|
520
|
+
declare const envSchema: _alepha_core6.TObject<{
|
|
521
|
+
REACT_SERVER_DIST: _sinclair_typebox1.TString;
|
|
522
|
+
REACT_SERVER_PREFIX: _sinclair_typebox1.TString;
|
|
523
|
+
REACT_SSR_ENABLED: _sinclair_typebox1.TOptional<_sinclair_typebox1.TBoolean>;
|
|
524
|
+
REACT_ROOT_ID: _sinclair_typebox1.TString;
|
|
586
525
|
}>;
|
|
587
526
|
declare module "alepha/core" {
|
|
588
527
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -592,12 +531,11 @@ declare module "alepha/core" {
|
|
|
592
531
|
}
|
|
593
532
|
}
|
|
594
533
|
declare class ReactServerProvider {
|
|
595
|
-
protected readonly log:
|
|
534
|
+
protected readonly log: _alepha_core6.Logger;
|
|
596
535
|
protected readonly alepha: Alepha;
|
|
597
536
|
protected readonly pageDescriptorProvider: PageDescriptorProvider;
|
|
598
537
|
protected readonly serverStaticProvider: ServerStaticProvider;
|
|
599
538
|
protected readonly serverRouterProvider: ServerRouterProvider;
|
|
600
|
-
protected readonly headProvider: ServerHeadProvider;
|
|
601
539
|
protected readonly serverTimingProvider: ServerTimingProvider;
|
|
602
540
|
protected readonly env: {
|
|
603
541
|
REACT_SSR_ENABLED?: boolean | undefined;
|
|
@@ -606,8 +544,8 @@ declare class ReactServerProvider {
|
|
|
606
544
|
REACT_ROOT_ID: string;
|
|
607
545
|
};
|
|
608
546
|
protected readonly ROOT_DIV_REGEX: RegExp;
|
|
609
|
-
readonly onConfigure:
|
|
610
|
-
get template(): string
|
|
547
|
+
readonly onConfigure: _alepha_core6.HookDescriptor<"configure">;
|
|
548
|
+
get template(): string;
|
|
611
549
|
protected registerPages(templateLoader: TemplateLoader): Promise<void>;
|
|
612
550
|
protected getPublicDirectory(): string;
|
|
613
551
|
protected configureStaticServer(root: string): Promise<void>;
|
|
@@ -615,15 +553,16 @@ declare class ReactServerProvider {
|
|
|
615
553
|
/**
|
|
616
554
|
* For testing purposes, creates a render function that can be used.
|
|
617
555
|
*/
|
|
618
|
-
protected createRenderFunction(name: string, withIndex?: boolean): (options?: {
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
556
|
+
protected createRenderFunction(name: string, withIndex?: boolean): (options?: PageDescriptorRenderOptions) => Promise<{
|
|
557
|
+
context: PageRequest;
|
|
558
|
+
state: CreateLayersResult;
|
|
559
|
+
html: string;
|
|
560
|
+
} | {
|
|
622
561
|
context: PageRequest;
|
|
623
562
|
html: string;
|
|
624
563
|
}>;
|
|
625
564
|
protected createHandler(page: PageRoute, templateLoader: TemplateLoader): ServerHandler;
|
|
626
|
-
renderToHtml(template: string, state: RouterState, context: PageReactContext): string;
|
|
565
|
+
renderToHtml(template: string, state: RouterState, context: PageReactContext, hydration?: boolean): string;
|
|
627
566
|
protected fillTemplate(response: {
|
|
628
567
|
html: string;
|
|
629
568
|
}, app: string, script: string): void;
|
|
@@ -633,21 +572,33 @@ type TemplateLoader = () => Promise<string | undefined>;
|
|
|
633
572
|
//#region src/index.d.ts
|
|
634
573
|
declare module "@alepha/core" {
|
|
635
574
|
interface Hooks {
|
|
575
|
+
"react:router:createLayers": {
|
|
576
|
+
request: ServerRequest;
|
|
577
|
+
context: PageRequest;
|
|
578
|
+
layers: PageRequest[];
|
|
579
|
+
};
|
|
580
|
+
"react:server:render:begin": {
|
|
581
|
+
request?: ServerRequest;
|
|
582
|
+
context: PageRequest;
|
|
583
|
+
};
|
|
584
|
+
"react:server:render:end": {
|
|
585
|
+
request?: ServerRequest;
|
|
586
|
+
context: PageRequest;
|
|
587
|
+
state: RouterState;
|
|
588
|
+
html: string;
|
|
589
|
+
};
|
|
636
590
|
"react:browser:render": {
|
|
637
591
|
state: RouterState;
|
|
638
592
|
context: PageReactContext;
|
|
639
593
|
hydration?: ReactHydrationState;
|
|
640
594
|
};
|
|
641
|
-
"react:server:render": {
|
|
642
|
-
request: ServerRequest;
|
|
643
|
-
pageRequest: PageRequest;
|
|
644
|
-
};
|
|
645
595
|
"react:transition:begin": {
|
|
646
596
|
state: RouterState;
|
|
647
597
|
context: PageReactContext;
|
|
648
598
|
};
|
|
649
599
|
"react:transition:success": {
|
|
650
600
|
state: RouterState;
|
|
601
|
+
context: PageReactContext;
|
|
651
602
|
};
|
|
652
603
|
"react:transition:error": {
|
|
653
604
|
error: Error;
|
|
@@ -674,5 +625,5 @@ declare class AlephaReact implements Module {
|
|
|
674
625
|
readonly $services: (alepha: Alepha) => Alepha;
|
|
675
626
|
}
|
|
676
627
|
//#endregion
|
|
677
|
-
export { $page, AlephaReact, AnchorProps, ClientOnly, CreateLayersResult, ErrorBoundary,
|
|
628
|
+
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 };
|
|
678
629
|
//# sourceMappingURL=index.d.ts.map
|
package/scheduler.d.ts
CHANGED
|
@@ -97,7 +97,6 @@ declare class SchedulerDescriptorProvider {
|
|
|
97
97
|
protected readonly configure: _alepha_core2.HookDescriptor<"configure">;
|
|
98
98
|
protected readonly start: _alepha_core2.HookDescriptor<"start">;
|
|
99
99
|
protected readonly stop: _alepha_core2.HookDescriptor<"stop">;
|
|
100
|
-
protected createContextId(): string;
|
|
101
100
|
/**
|
|
102
101
|
* Get the schedulers.
|
|
103
102
|
*/
|
package/security.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Alepha, KIND, OPTIONS, Static } from "@alepha/core";
|
|
|
4
4
|
import { DateTimeProvider } from "@alepha/datetime";
|
|
5
5
|
import { CryptoKey, FlattenedJWSInput, JSONWebKeySet, JWSHeaderParameters, JWTHeaderParameters, JWTPayload, JWTVerifyResult, KeyObject } from "jose";
|
|
6
6
|
import * as _sinclair_typebox8 from "@sinclair/typebox";
|
|
7
|
-
import * as
|
|
7
|
+
import * as _sinclair_typebox18 from "@sinclair/typebox";
|
|
8
8
|
import * as _sinclair_typebox1 from "@sinclair/typebox";
|
|
9
9
|
|
|
10
10
|
//#region src/interfaces/UserAccountInfo.d.ts
|
|
@@ -45,7 +45,6 @@ declare const permissionSchema: _sinclair_typebox8.TObject<{
|
|
|
45
45
|
description: _sinclair_typebox8.TOptional<_sinclair_typebox8.TString>;
|
|
46
46
|
method: _sinclair_typebox8.TOptional<_sinclair_typebox8.TString>;
|
|
47
47
|
path: _sinclair_typebox8.TOptional<_sinclair_typebox8.TString>;
|
|
48
|
-
contentType: _sinclair_typebox8.TOptional<_sinclair_typebox8.TString>;
|
|
49
48
|
}>;
|
|
50
49
|
type Permission = Static<typeof permissionSchema>;
|
|
51
50
|
//#endregion
|
|
@@ -96,9 +95,6 @@ interface UserAccountToken extends UserAccountInfo {
|
|
|
96
95
|
* Access token for the user.
|
|
97
96
|
*/
|
|
98
97
|
token?: string;
|
|
99
|
-
/**
|
|
100
|
-
*
|
|
101
|
-
*/
|
|
102
98
|
realm?: string;
|
|
103
99
|
/**
|
|
104
100
|
* Is user dedicated to his own resources for this scope ?
|
|
@@ -108,14 +104,14 @@ interface UserAccountToken extends UserAccountInfo {
|
|
|
108
104
|
}
|
|
109
105
|
//#endregion
|
|
110
106
|
//#region src/schemas/roleSchema.d.ts
|
|
111
|
-
declare const roleSchema:
|
|
112
|
-
name:
|
|
113
|
-
description:
|
|
114
|
-
default:
|
|
115
|
-
permissions:
|
|
116
|
-
name:
|
|
117
|
-
ownership:
|
|
118
|
-
exclude:
|
|
107
|
+
declare const roleSchema: _sinclair_typebox18.TObject<{
|
|
108
|
+
name: _sinclair_typebox18.TString;
|
|
109
|
+
description: _sinclair_typebox18.TOptional<_sinclair_typebox18.TString>;
|
|
110
|
+
default: _sinclair_typebox18.TOptional<_sinclair_typebox18.TBoolean>;
|
|
111
|
+
permissions: _sinclair_typebox18.TArray<_sinclair_typebox18.TObject<{
|
|
112
|
+
name: _sinclair_typebox18.TString;
|
|
113
|
+
ownership: _sinclair_typebox18.TOptional<_sinclair_typebox18.TBoolean>;
|
|
114
|
+
exclude: _sinclair_typebox18.TOptional<_sinclair_typebox18.TArray<_sinclair_typebox18.TString>>;
|
|
119
115
|
}>>;
|
|
120
116
|
}>;
|
|
121
117
|
type Role = Static<typeof roleSchema>;
|
|
@@ -361,13 +357,7 @@ declare class SecurityProvider {
|
|
|
361
357
|
* A realm definition.
|
|
362
358
|
*/
|
|
363
359
|
interface Realm {
|
|
364
|
-
/**
|
|
365
|
-
*
|
|
366
|
-
*/
|
|
367
360
|
name: string;
|
|
368
|
-
/**
|
|
369
|
-
*
|
|
370
|
-
*/
|
|
371
361
|
roles: Role[];
|
|
372
362
|
/**
|
|
373
363
|
* The secret key for the realm.
|
|
@@ -464,9 +454,6 @@ interface RoleDescriptorOptions {
|
|
|
464
454
|
* Describe the role.
|
|
465
455
|
*/
|
|
466
456
|
description?: string;
|
|
467
|
-
/**
|
|
468
|
-
*
|
|
469
|
-
*/
|
|
470
457
|
permissions?: Array<string | {
|
|
471
458
|
name: string;
|
|
472
459
|
ownership?: boolean;
|
package/server/cache.d.ts
CHANGED
|
@@ -55,8 +55,8 @@ type RouteLike = {
|
|
|
55
55
|
*
|
|
56
56
|
* @example
|
|
57
57
|
* ```ts
|
|
58
|
-
* import { Alepha } from "
|
|
59
|
-
* import { $action } from "
|
|
58
|
+
* import { Alepha } from "alepha";
|
|
59
|
+
* import { $action } from "alepha/server";
|
|
60
60
|
* import { AlephaServerCache } from "alepha/server/cache";
|
|
61
61
|
*
|
|
62
62
|
* class ApiServer {
|
package/server/cookies.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as _alepha_core1 from "@alepha/core";
|
|
2
2
|
import { KIND, OPTIONS, Static, TSchema } from "@alepha/core";
|
|
3
3
|
import { DurationLike } from "@alepha/datetime";
|
|
4
|
-
import "@alepha/server";
|
|
5
4
|
|
|
6
5
|
//#region src/descriptors/$cookie.d.ts
|
|
7
6
|
interface CookieDescriptorOptions<T extends TSchema> {
|
|
@@ -56,6 +55,10 @@ declare module "alepha/server" {
|
|
|
56
55
|
cookies: Cookies;
|
|
57
56
|
}
|
|
58
57
|
}
|
|
58
|
+
declare class AlephaServerCookies {
|
|
59
|
+
readonly name = "alepha.server.cookies";
|
|
60
|
+
readonly $services: (alepha: any) => void;
|
|
61
|
+
}
|
|
59
62
|
//#endregion
|
|
60
|
-
export { $cookie, Cookie, CookieDescriptor, CookieDescriptorOptions, Cookies, ServerCookiesProvider };
|
|
63
|
+
export { $cookie, AlephaServerCookies, Cookie, CookieDescriptor, CookieDescriptorOptions, Cookies, ServerCookiesProvider };
|
|
61
64
|
//# sourceMappingURL=index.d.ts.map
|
package/server/cors.cjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var m = require('@alepha/server-cors');
|
|
3
|
+
Object.keys(m).forEach(function (k) {
|
|
4
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: function () { return m[k]; }
|
|
7
|
+
});
|
|
8
|
+
});
|
package/server/cors.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as _alepha_core0 from "@alepha/core";
|
|
2
|
+
import { Alepha, Module } from "@alepha/core";
|
|
3
|
+
|
|
4
|
+
//#region src/providers/ServerCorsProvider.d.ts
|
|
5
|
+
declare class ServerCorsProvider {
|
|
6
|
+
options: CorsOptions;
|
|
7
|
+
protected readonly onRequest: _alepha_core0.HookDescriptor<"server:onRequest">;
|
|
8
|
+
isOriginAllowed(origin: string | undefined, allowed: CorsOptions["origin"]): boolean;
|
|
9
|
+
}
|
|
10
|
+
interface CorsOptions {
|
|
11
|
+
origin?: string | string[] | ((origin: string | undefined) => boolean);
|
|
12
|
+
methods: string[];
|
|
13
|
+
headers: string[];
|
|
14
|
+
credentials?: boolean;
|
|
15
|
+
maxAge?: number;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/index.d.ts
|
|
19
|
+
declare class AlephaServerCors implements Module {
|
|
20
|
+
readonly name = "alepha.server.cors";
|
|
21
|
+
readonly $services: (alepha: Alepha) => void;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { AlephaServerCors, CorsOptions, ServerCorsProvider };
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
package/server/cors.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@alepha/server-cors'
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var m = require('@alepha/server-health');
|
|
3
|
+
Object.keys(m).forEach(function (k) {
|
|
4
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: function () { return m[k]; }
|
|
7
|
+
});
|
|
8
|
+
});
|