@alepha/ui 0.13.0 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/{AdminFiles-CllAxb1B.js → AdminFiles-BjofP3OC.js} +11 -11
- package/dist/admin/AdminFiles-BjofP3OC.js.map +1 -0
- package/dist/admin/AdminFiles-DldZB7oo.js +3 -0
- package/dist/admin/AdminJobs-BOq6AZOW.js +3 -0
- package/dist/admin/{AdminJobs-BXkFtlVo.js → AdminJobs-CDnVxEv6.js} +11 -11
- package/dist/admin/AdminJobs-CDnVxEv6.js.map +1 -0
- package/dist/admin/AdminLayout-Bgx25J8m.js +3 -0
- package/dist/admin/{AdminLayout-CtkVYk-u.js → AdminLayout-CervL8LV.js} +6 -6
- package/dist/admin/AdminLayout-CervL8LV.js.map +1 -0
- package/dist/admin/AdminNotifications-BDQXt3-e.js +3 -0
- package/dist/admin/{AdminNotifications-DnnulNNV.js → AdminNotifications-DvI2989x.js} +6 -6
- package/dist/admin/AdminNotifications-DvI2989x.js.map +1 -0
- package/dist/admin/AdminParameters-D_v0GAvI.js +3 -0
- package/dist/admin/{AdminParameters-B3hvpLpu.js → AdminParameters-P1LB6ZI1.js} +7 -7
- package/dist/admin/AdminParameters-P1LB6ZI1.js.map +1 -0
- package/dist/admin/{AdminSessions-Pjdz-iZx.js → AdminSessions-CmDVneE2.js} +11 -11
- package/dist/admin/AdminSessions-CmDVneE2.js.map +1 -0
- package/dist/admin/AdminSessions-Dkk_fzWK.js +3 -0
- package/dist/admin/{AdminUsers-C1HsrRxn.js → AdminUsers-88De5pev.js} +9 -9
- package/dist/admin/AdminUsers-88De5pev.js.map +1 -0
- package/dist/admin/AdminUsers-oyAXqZ5l.js +3 -0
- package/dist/admin/AdminVerifications-D93TKymL.js +3 -0
- package/dist/admin/{AdminVerifications-VMpm30mS.js → AdminVerifications-DBVEoqJe.js} +6 -6
- package/dist/admin/AdminVerifications-DBVEoqJe.js.map +1 -0
- package/dist/admin/index.d.ts +320 -320
- package/dist/admin/index.js +17 -17
- package/dist/auth/{IconGoogle-Bfmuv9Rv.js → IconGoogle-v_58os2T.js} +1 -1
- package/dist/auth/{IconGoogle-Bfmuv9Rv.js.map → IconGoogle-v_58os2T.js.map} +1 -1
- package/dist/auth/Login-BC2jTczq.js +4 -0
- package/dist/auth/{Login-JeXFsUf5.js → Login-OCrvjs9U.js} +12 -12
- package/dist/auth/Login-OCrvjs9U.js.map +1 -0
- package/dist/auth/Register-Dh0lsQmI.js +4 -0
- package/dist/auth/{Register-CPQnvXCZ.js → Register-Ei34GSba.js} +16 -16
- package/dist/auth/Register-Ei34GSba.js.map +1 -0
- package/dist/auth/ResetPassword-BnlAQAOE.js +3 -0
- package/dist/auth/{ResetPassword-BzUjGG_-.js → ResetPassword-tO0oMzfo.js} +12 -12
- package/dist/auth/ResetPassword-tO0oMzfo.js.map +1 -0
- package/dist/auth/index.d.ts +1528 -1898
- package/dist/auth/index.js +10 -10
- package/dist/auth/index.js.map +1 -1
- package/dist/core/index.d.ts +152 -152
- package/dist/core/index.js +13 -6
- package/dist/core/index.js.map +1 -1
- package/package.json +6 -6
- package/src/admin/components/AdminParameters.tsx +1 -1
- package/src/core/components/buttons/OmnibarButton.tsx +10 -5
- package/src/core/components/layout/Omnibar.tsx +6 -1
- package/src/core/index.ts +1 -1
- package/dist/admin/AdminFiles-BM6_7_5A.cjs +0 -4
- package/dist/admin/AdminFiles-BaCIMeNt.js +0 -4
- package/dist/admin/AdminFiles-CllAxb1B.js.map +0 -1
- package/dist/admin/AdminFiles-DC3T8uWZ.cjs +0 -122
- package/dist/admin/AdminFiles-DC3T8uWZ.cjs.map +0 -1
- package/dist/admin/AdminJobs-BXkFtlVo.js.map +0 -1
- package/dist/admin/AdminJobs-C428qrNQ.cjs +0 -130
- package/dist/admin/AdminJobs-C428qrNQ.cjs.map +0 -1
- package/dist/admin/AdminJobs-DCPPaJ4i.cjs +0 -4
- package/dist/admin/AdminJobs-yC6DarGO.js +0 -4
- package/dist/admin/AdminLayout-Bqo4cd33.cjs +0 -4
- package/dist/admin/AdminLayout-CQpxfko6.js +0 -4
- package/dist/admin/AdminLayout-CiLlywAQ.cjs +0 -93
- package/dist/admin/AdminLayout-CiLlywAQ.cjs.map +0 -1
- package/dist/admin/AdminLayout-CtkVYk-u.js.map +0 -1
- package/dist/admin/AdminNotifications-DNUeJ-PW.cjs +0 -44
- package/dist/admin/AdminNotifications-DNUeJ-PW.cjs.map +0 -1
- package/dist/admin/AdminNotifications-DaMu1AQ4.js +0 -4
- package/dist/admin/AdminNotifications-DnnulNNV.js.map +0 -1
- package/dist/admin/AdminNotifications-ihgbKVCx.cjs +0 -4
- package/dist/admin/AdminParameters-B3hvpLpu.js.map +0 -1
- package/dist/admin/AdminParameters-U4lU1rUF.cjs +0 -4
- package/dist/admin/AdminParameters-gdf7036N.cjs +0 -44
- package/dist/admin/AdminParameters-gdf7036N.cjs.map +0 -1
- package/dist/admin/AdminParameters-prMcCgxf.js +0 -4
- package/dist/admin/AdminSessions-BF_P4lHs.cjs +0 -128
- package/dist/admin/AdminSessions-BF_P4lHs.cjs.map +0 -1
- package/dist/admin/AdminSessions-CATIU61I.cjs +0 -4
- package/dist/admin/AdminSessions-DqOXOpYR.js +0 -4
- package/dist/admin/AdminSessions-Pjdz-iZx.js.map +0 -1
- package/dist/admin/AdminUsers-BgTL-zSY.js +0 -4
- package/dist/admin/AdminUsers-C1HsrRxn.js.map +0 -1
- package/dist/admin/AdminUsers-HqvxwNGZ.cjs +0 -4
- package/dist/admin/AdminUsers-M2uEQbp5.cjs +0 -109
- package/dist/admin/AdminUsers-M2uEQbp5.cjs.map +0 -1
- package/dist/admin/AdminVerifications-BVssbtfU.cjs +0 -44
- package/dist/admin/AdminVerifications-BVssbtfU.cjs.map +0 -1
- package/dist/admin/AdminVerifications-Df6DRgNo.js +0 -4
- package/dist/admin/AdminVerifications-DxAtcYUR.cjs +0 -4
- package/dist/admin/AdminVerifications-VMpm30mS.js.map +0 -1
- package/dist/admin/core-CzO6aavT.js +0 -2507
- package/dist/admin/core-CzO6aavT.js.map +0 -1
- package/dist/admin/core-aFtK4l9I.cjs +0 -2530
- package/dist/admin/core-aFtK4l9I.cjs.map +0 -1
- package/dist/admin/index.cjs +0 -87
- package/dist/admin/index.cjs.map +0 -1
- package/dist/admin/index.d.cts +0 -1739
- package/dist/auth/IconGoogle-B17BTQyD.cjs +0 -69
- package/dist/auth/IconGoogle-B17BTQyD.cjs.map +0 -1
- package/dist/auth/Login-BTBmbnWl.cjs +0 -181
- package/dist/auth/Login-BTBmbnWl.cjs.map +0 -1
- package/dist/auth/Login-BcQOtG3v.js +0 -5
- package/dist/auth/Login-Btmd70Um.cjs +0 -5
- package/dist/auth/Login-JeXFsUf5.js.map +0 -1
- package/dist/auth/Register-CPQnvXCZ.js.map +0 -1
- package/dist/auth/Register-CbesZal3.cjs +0 -5
- package/dist/auth/Register-DpI_JdyO.js +0 -5
- package/dist/auth/Register-HP3rP71B.cjs +0 -323
- package/dist/auth/Register-HP3rP71B.cjs.map +0 -1
- package/dist/auth/ResetPassword-B-tkzV7g.cjs +0 -248
- package/dist/auth/ResetPassword-B-tkzV7g.cjs.map +0 -1
- package/dist/auth/ResetPassword-BlK3xEpU.js +0 -4
- package/dist/auth/ResetPassword-BzUjGG_-.js.map +0 -1
- package/dist/auth/ResetPassword-W3xjOnWy.cjs +0 -4
- package/dist/auth/chunk-DhGyd7sr.js +0 -28
- package/dist/auth/core-D1MHij1j.js +0 -1795
- package/dist/auth/core-D1MHij1j.js.map +0 -1
- package/dist/auth/core-rDZ9d92K.cjs +0 -1824
- package/dist/auth/core-rDZ9d92K.cjs.map +0 -1
- package/dist/auth/index.cjs +0 -211
- package/dist/auth/index.cjs.map +0 -1
- package/dist/auth/index.d.cts +0 -6265
- package/dist/core/index.cjs +0 -2620
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.d.cts +0 -2737
package/dist/admin/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Alepha, AlephaError, Async,
|
|
1
|
+
import * as alepha46 from "alepha";
|
|
2
|
+
import { Alepha, AlephaError, Async, FileLike, InstantiableClass, LogLevel, LoggerInterface, Primitive, Static, StreamLike, TArray, TFile, TObject, TRecord, TSchema, TStream, TString, TVoid } from "alepha";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
-
import { FC, ReactNode } from "react";
|
|
5
4
|
import { IncomingMessage, Server, ServerResponse } from "node:http";
|
|
5
|
+
import { Readable } from "node:stream";
|
|
6
|
+
import { ReadableStream } from "node:stream/web";
|
|
6
7
|
import "dayjs/plugin/relativeTime.js";
|
|
7
8
|
import dayjsDuration from "dayjs/plugin/duration.js";
|
|
8
9
|
import "dayjs/plugin/utc.js";
|
|
@@ -11,212 +12,41 @@ import "dayjs/plugin/localizedFormat.js";
|
|
|
11
12
|
import "dayjs/locale/ar.js";
|
|
12
13
|
import "dayjs/locale/fr.js";
|
|
13
14
|
import DayjsApi, { Dayjs, ManipulateType, PluginFunc } from "dayjs";
|
|
14
|
-
import {
|
|
15
|
-
import { ReadableStream } from "node:stream/web";
|
|
15
|
+
import { FC, ReactNode } from "react";
|
|
16
16
|
|
|
17
|
-
//#region ../alepha/src/
|
|
18
|
-
declare const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
//#region ../alepha/src/server/schemas/errorSchema.d.ts
|
|
18
|
+
declare const errorSchema: alepha46.TObject<{
|
|
19
|
+
error: alepha46.TString;
|
|
20
|
+
status: alepha46.TInteger;
|
|
21
|
+
message: alepha46.TString;
|
|
22
|
+
details: alepha46.TOptional<alepha46.TString>;
|
|
23
|
+
requestId: alepha46.TOptional<alepha46.TString>;
|
|
24
|
+
cause: alepha46.TOptional<alepha46.TObject<{
|
|
25
|
+
name: alepha46.TString;
|
|
26
|
+
message: alepha46.TString;
|
|
27
|
+
}>>;
|
|
27
28
|
}>;
|
|
28
|
-
type
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region ../alepha/src/datetime/providers/DateTimeProvider.d.ts
|
|
31
|
-
type DateTime = DayjsApi.Dayjs;
|
|
32
|
-
type Duration = dayjsDuration.Duration;
|
|
33
|
-
type DurationLike = number | dayjsDuration.Duration | [number, ManipulateType];
|
|
34
|
-
declare class DateTimeProvider {
|
|
35
|
-
static PLUGINS: Array<PluginFunc<any>>;
|
|
36
|
-
protected alepha: Alepha;
|
|
37
|
-
protected ref: DateTime | null;
|
|
38
|
-
protected readonly timeouts: Timeout[];
|
|
39
|
-
protected readonly intervals: Interval[];
|
|
40
|
-
constructor();
|
|
41
|
-
protected readonly onStart: alepha82.HookDescriptor<"start">;
|
|
42
|
-
protected readonly onStop: alepha82.HookDescriptor<"stop">;
|
|
43
|
-
setLocale(locale: string): void;
|
|
44
|
-
isDateTime(value: unknown): value is DateTime;
|
|
45
|
-
/**
|
|
46
|
-
* Create a new UTC DateTime instance.
|
|
47
|
-
*/
|
|
48
|
-
utc(date: string | number | Date | Dayjs | null | undefined): DateTime;
|
|
49
|
-
/**
|
|
50
|
-
* Create a new DateTime instance.
|
|
51
|
-
*/
|
|
52
|
-
of(date: string | number | Date | Dayjs | null | undefined): DateTime;
|
|
53
|
-
/**
|
|
54
|
-
* Get the current date as a string.
|
|
55
|
-
*/
|
|
56
|
-
toISOString(date?: Date | string | DateTime): string;
|
|
57
|
-
/**
|
|
58
|
-
* Get the current date.
|
|
59
|
-
*/
|
|
60
|
-
now(): DateTime;
|
|
61
|
-
/**
|
|
62
|
-
* Get the current date as a string.
|
|
63
|
-
*
|
|
64
|
-
* This is much faster than `DateTimeProvider.now().toISOString()` as it avoids creating a DateTime instance.
|
|
65
|
-
*/
|
|
66
|
-
nowISOString(): string;
|
|
67
|
-
/**
|
|
68
|
-
* Get the current date as milliseconds since epoch.
|
|
69
|
-
*
|
|
70
|
-
* This is much faster than `DateTimeProvider.now().valueOf()` as it avoids creating a DateTime instance.
|
|
71
|
-
*/
|
|
72
|
-
nowMillis(): number;
|
|
73
|
-
/**
|
|
74
|
-
* Get the current date as a string.
|
|
75
|
-
*
|
|
76
|
-
* @protected
|
|
77
|
-
*/
|
|
78
|
-
protected getCurrentDate(): DateTime;
|
|
79
|
-
/**
|
|
80
|
-
* Create a new Duration instance.
|
|
81
|
-
*/
|
|
82
|
-
duration: (duration: DurationLike, unit?: ManipulateType) => Duration;
|
|
83
|
-
isDurationLike(value: unknown): value is DurationLike;
|
|
84
|
-
/**
|
|
85
|
-
* Return a promise that resolves after the next tick.
|
|
86
|
-
* It uses `setTimeout` with 0 ms delay.
|
|
87
|
-
*/
|
|
88
|
-
tick(): Promise<void>;
|
|
89
|
-
/**
|
|
90
|
-
* Wait for a certain duration.
|
|
91
|
-
*
|
|
92
|
-
* You can clear the timeout by using the `AbortSignal` API.
|
|
93
|
-
* Aborted signal will resolve the promise immediately, it does not reject it.
|
|
94
|
-
*/
|
|
95
|
-
wait(duration: DurationLike, options?: {
|
|
96
|
-
signal?: AbortSignal;
|
|
97
|
-
now?: number;
|
|
98
|
-
}): Promise<void>;
|
|
99
|
-
createInterval(run: () => unknown, duration: DurationLike, start?: boolean): Interval;
|
|
100
|
-
/**
|
|
101
|
-
* Run a callback after a certain duration.
|
|
102
|
-
*/
|
|
103
|
-
createTimeout(callback: () => void, duration: DurationLike, now?: number): Timeout;
|
|
104
|
-
clearTimeout(timeout: Timeout): void;
|
|
105
|
-
clearInterval(interval: Interval): void;
|
|
106
|
-
/**
|
|
107
|
-
* Run a function with a deadline.
|
|
108
|
-
*/
|
|
109
|
-
deadline<T$1>(fn: (signal: AbortSignal) => Promise<T$1>, duration: DurationLike): Promise<T$1>;
|
|
110
|
-
/**
|
|
111
|
-
* Add time to the current date.
|
|
112
|
-
*/
|
|
113
|
-
travel(duration: DurationLike, unit?: ManipulateType): Promise<void>;
|
|
114
|
-
/**
|
|
115
|
-
* Stop the time.
|
|
116
|
-
*/
|
|
117
|
-
pause(): DateTime;
|
|
118
|
-
/**
|
|
119
|
-
* Reset the reference date.
|
|
120
|
-
*/
|
|
121
|
-
reset(): void;
|
|
122
|
-
}
|
|
123
|
-
interface Interval {
|
|
124
|
-
timer?: any;
|
|
125
|
-
duration: number;
|
|
126
|
-
run: () => unknown;
|
|
127
|
-
}
|
|
128
|
-
interface Timeout {
|
|
129
|
-
now: number;
|
|
130
|
-
timer?: any;
|
|
131
|
-
duration: number;
|
|
132
|
-
callback: () => void;
|
|
133
|
-
clear: () => void;
|
|
134
|
-
}
|
|
135
|
-
//#endregion
|
|
136
|
-
//#region ../alepha/src/logger/providers/LogDestinationProvider.d.ts
|
|
137
|
-
declare abstract class LogDestinationProvider {
|
|
138
|
-
abstract write(message: string, entry: LogEntry): void;
|
|
139
|
-
}
|
|
140
|
-
//#endregion
|
|
141
|
-
//#region ../alepha/src/logger/providers/LogFormatterProvider.d.ts
|
|
142
|
-
declare abstract class LogFormatterProvider {
|
|
143
|
-
abstract format(entry: LogEntry): string;
|
|
144
|
-
}
|
|
29
|
+
type ErrorSchema = Static<typeof errorSchema>;
|
|
145
30
|
//#endregion
|
|
146
|
-
//#region ../alepha/src/
|
|
147
|
-
declare class
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
get level(): string;
|
|
161
|
-
parseLevel(level: string, app: string): LogLevel;
|
|
162
|
-
private matchesPattern;
|
|
163
|
-
asLogLevel(something: string): LogLevel;
|
|
164
|
-
error(message: string, data?: unknown): void;
|
|
165
|
-
warn(message: string, data?: unknown): void;
|
|
166
|
-
info(message: string, data?: unknown): void;
|
|
167
|
-
debug(message: string, data?: unknown): void;
|
|
168
|
-
trace(message: string, data?: unknown): void;
|
|
169
|
-
protected log(level: LogLevel, message: string, data?: unknown): void;
|
|
170
|
-
protected emit(entry: LogEntry, message?: string): void;
|
|
31
|
+
//#region ../alepha/src/server/errors/HttpError.d.ts
|
|
32
|
+
declare class HttpError extends AlephaError {
|
|
33
|
+
name: string;
|
|
34
|
+
static is: (error: unknown, status?: number) => error is HttpErrorLike;
|
|
35
|
+
static toJSON(error: HttpError): ErrorSchema;
|
|
36
|
+
readonly error: string;
|
|
37
|
+
readonly status: number;
|
|
38
|
+
readonly requestId?: string;
|
|
39
|
+
readonly details?: string;
|
|
40
|
+
readonly reason?: {
|
|
41
|
+
name: string;
|
|
42
|
+
message: string;
|
|
43
|
+
};
|
|
44
|
+
constructor(options: Partial<ErrorSchema>, cause?: unknown);
|
|
171
45
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
declare const envSchema$6: alepha82.TObject<{
|
|
175
|
-
/**
|
|
176
|
-
* Default log level for the application.
|
|
177
|
-
*
|
|
178
|
-
* Default by environment:
|
|
179
|
-
* - dev = info
|
|
180
|
-
* - prod = info
|
|
181
|
-
* - test = error
|
|
182
|
-
*
|
|
183
|
-
* Levels are: "trace" | "debug" | "info" | "warn" | "error" | "silent"
|
|
184
|
-
*
|
|
185
|
-
* Level can be set for a specific module:
|
|
186
|
-
*
|
|
187
|
-
* @example
|
|
188
|
-
* LOG_LEVEL=my.module.name:debug,info # Set debug level for my.module.name and info for all other modules
|
|
189
|
-
* LOG_LEVEL=alepha:trace, info # Set trace level for all alepha modules and info for all other modules
|
|
190
|
-
*/
|
|
191
|
-
LOG_LEVEL: alepha82.TOptional<alepha82.TString>;
|
|
192
|
-
/**
|
|
193
|
-
* Built-in log formats.
|
|
194
|
-
* - "json" - JSON format, useful for structured logging and log aggregation. {@link JsonFormatterProvider}
|
|
195
|
-
* - "pretty" - Simple text format, human-readable, with colors. {@link SimpleFormatterProvider}
|
|
196
|
-
* - "raw" - Raw format, no formatting, just the message. {@link RawFormatterProvider}
|
|
197
|
-
*/
|
|
198
|
-
LOG_FORMAT: alepha82.TOptional<alepha82.TUnsafe<"json" | "pretty" | "raw">>;
|
|
199
|
-
}>;
|
|
200
|
-
declare module "alepha" {
|
|
201
|
-
interface Env extends Partial<Static<typeof envSchema$6>> {}
|
|
202
|
-
interface State {
|
|
203
|
-
/**
|
|
204
|
-
* Current log level for the application or specific modules.
|
|
205
|
-
*/
|
|
206
|
-
"alepha.logger.level"?: string;
|
|
207
|
-
}
|
|
208
|
-
interface Hooks {
|
|
209
|
-
log: {
|
|
210
|
-
message?: string;
|
|
211
|
-
entry: LogEntry;
|
|
212
|
-
};
|
|
213
|
-
}
|
|
46
|
+
interface HttpErrorLike extends Error {
|
|
47
|
+
status: number;
|
|
214
48
|
}
|
|
215
49
|
//#endregion
|
|
216
|
-
//#region ../alepha/src/server/constants/routeMethods.d.ts
|
|
217
|
-
declare const routeMethods: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "CONNECT", "TRACE"];
|
|
218
|
-
type RouteMethod = (typeof routeMethods)[number];
|
|
219
|
-
//#endregion
|
|
220
50
|
//#region ../alepha/src/router/providers/RouterProvider.d.ts
|
|
221
51
|
declare abstract class RouterProvider<T$1 extends Route = Route> {
|
|
222
52
|
protected routePathRegex: RegExp;
|
|
@@ -261,6 +91,10 @@ interface Tree<T$1 extends Route> {
|
|
|
261
91
|
};
|
|
262
92
|
}
|
|
263
93
|
//#endregion
|
|
94
|
+
//#region ../alepha/src/server/constants/routeMethods.d.ts
|
|
95
|
+
declare const routeMethods: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "CONNECT", "TRACE"];
|
|
96
|
+
type RouteMethod = (typeof routeMethods)[number];
|
|
97
|
+
//#endregion
|
|
264
98
|
//#region ../alepha/src/server/helpers/ServerReply.d.ts
|
|
265
99
|
/**
|
|
266
100
|
* Helper for building server replies.
|
|
@@ -427,6 +261,205 @@ interface WebRequestEvent {
|
|
|
427
261
|
res?: Response;
|
|
428
262
|
}
|
|
429
263
|
//#endregion
|
|
264
|
+
//#region ../alepha/src/logger/schemas/logEntrySchema.d.ts
|
|
265
|
+
declare const logEntrySchema: alepha46.TObject<{
|
|
266
|
+
level: alepha46.TUnsafe<"TRACE" | "SILENT" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
|
|
267
|
+
message: alepha46.TString;
|
|
268
|
+
service: alepha46.TString;
|
|
269
|
+
module: alepha46.TString;
|
|
270
|
+
context: alepha46.TOptional<alepha46.TString>;
|
|
271
|
+
app: alepha46.TOptional<alepha46.TString>;
|
|
272
|
+
data: alepha46.TOptional<alepha46.TAny>;
|
|
273
|
+
timestamp: alepha46.TNumber;
|
|
274
|
+
}>;
|
|
275
|
+
type LogEntry = Static<typeof logEntrySchema>;
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region ../alepha/src/datetime/providers/DateTimeProvider.d.ts
|
|
278
|
+
type DateTime = DayjsApi.Dayjs;
|
|
279
|
+
type Duration = dayjsDuration.Duration;
|
|
280
|
+
type DurationLike = number | dayjsDuration.Duration | [number, ManipulateType];
|
|
281
|
+
declare class DateTimeProvider {
|
|
282
|
+
static PLUGINS: Array<PluginFunc<any>>;
|
|
283
|
+
protected alepha: Alepha;
|
|
284
|
+
protected ref: DateTime | null;
|
|
285
|
+
protected readonly timeouts: Timeout[];
|
|
286
|
+
protected readonly intervals: Interval[];
|
|
287
|
+
constructor();
|
|
288
|
+
protected readonly onStart: alepha46.HookPrimitive<"start">;
|
|
289
|
+
protected readonly onStop: alepha46.HookPrimitive<"stop">;
|
|
290
|
+
setLocale(locale: string): void;
|
|
291
|
+
isDateTime(value: unknown): value is DateTime;
|
|
292
|
+
/**
|
|
293
|
+
* Create a new UTC DateTime instance.
|
|
294
|
+
*/
|
|
295
|
+
utc(date: string | number | Date | Dayjs | null | undefined): DateTime;
|
|
296
|
+
/**
|
|
297
|
+
* Create a new DateTime instance.
|
|
298
|
+
*/
|
|
299
|
+
of(date: string | number | Date | Dayjs | null | undefined): DateTime;
|
|
300
|
+
/**
|
|
301
|
+
* Get the current date as a string.
|
|
302
|
+
*/
|
|
303
|
+
toISOString(date?: Date | string | DateTime): string;
|
|
304
|
+
/**
|
|
305
|
+
* Get the current date.
|
|
306
|
+
*/
|
|
307
|
+
now(): DateTime;
|
|
308
|
+
/**
|
|
309
|
+
* Get the current date as a string.
|
|
310
|
+
*
|
|
311
|
+
* This is much faster than `DateTimeProvider.now().toISOString()` as it avoids creating a DateTime instance.
|
|
312
|
+
*/
|
|
313
|
+
nowISOString(): string;
|
|
314
|
+
/**
|
|
315
|
+
* Get the current date as milliseconds since epoch.
|
|
316
|
+
*
|
|
317
|
+
* This is much faster than `DateTimeProvider.now().valueOf()` as it avoids creating a DateTime instance.
|
|
318
|
+
*/
|
|
319
|
+
nowMillis(): number;
|
|
320
|
+
/**
|
|
321
|
+
* Get the current date as a string.
|
|
322
|
+
*
|
|
323
|
+
* @protected
|
|
324
|
+
*/
|
|
325
|
+
protected getCurrentDate(): DateTime;
|
|
326
|
+
/**
|
|
327
|
+
* Create a new Duration instance.
|
|
328
|
+
*/
|
|
329
|
+
duration: (duration: DurationLike, unit?: ManipulateType) => Duration;
|
|
330
|
+
isDurationLike(value: unknown): value is DurationLike;
|
|
331
|
+
/**
|
|
332
|
+
* Return a promise that resolves after the next tick.
|
|
333
|
+
* It uses `setTimeout` with 0 ms delay.
|
|
334
|
+
*/
|
|
335
|
+
tick(): Promise<void>;
|
|
336
|
+
/**
|
|
337
|
+
* Wait for a certain duration.
|
|
338
|
+
*
|
|
339
|
+
* You can clear the timeout by using the `AbortSignal` API.
|
|
340
|
+
* Aborted signal will resolve the promise immediately, it does not reject it.
|
|
341
|
+
*/
|
|
342
|
+
wait(duration: DurationLike, options?: {
|
|
343
|
+
signal?: AbortSignal;
|
|
344
|
+
now?: number;
|
|
345
|
+
}): Promise<void>;
|
|
346
|
+
createInterval(run: () => unknown, duration: DurationLike, start?: boolean): Interval;
|
|
347
|
+
/**
|
|
348
|
+
* Run a callback after a certain duration.
|
|
349
|
+
*/
|
|
350
|
+
createTimeout(callback: () => void, duration: DurationLike, now?: number): Timeout;
|
|
351
|
+
clearTimeout(timeout: Timeout): void;
|
|
352
|
+
clearInterval(interval: Interval): void;
|
|
353
|
+
/**
|
|
354
|
+
* Run a function with a deadline.
|
|
355
|
+
*/
|
|
356
|
+
deadline<T$1>(fn: (signal: AbortSignal) => Promise<T$1>, duration: DurationLike): Promise<T$1>;
|
|
357
|
+
/**
|
|
358
|
+
* Add time to the current date.
|
|
359
|
+
*/
|
|
360
|
+
travel(duration: DurationLike, unit?: ManipulateType): Promise<void>;
|
|
361
|
+
/**
|
|
362
|
+
* Stop the time.
|
|
363
|
+
*/
|
|
364
|
+
pause(): DateTime;
|
|
365
|
+
/**
|
|
366
|
+
* Reset the reference date.
|
|
367
|
+
*/
|
|
368
|
+
reset(): void;
|
|
369
|
+
}
|
|
370
|
+
interface Interval {
|
|
371
|
+
timer?: any;
|
|
372
|
+
duration: number;
|
|
373
|
+
run: () => unknown;
|
|
374
|
+
}
|
|
375
|
+
interface Timeout {
|
|
376
|
+
now: number;
|
|
377
|
+
timer?: any;
|
|
378
|
+
duration: number;
|
|
379
|
+
callback: () => void;
|
|
380
|
+
clear: () => void;
|
|
381
|
+
}
|
|
382
|
+
//#endregion
|
|
383
|
+
//#region ../alepha/src/logger/providers/LogDestinationProvider.d.ts
|
|
384
|
+
declare abstract class LogDestinationProvider {
|
|
385
|
+
abstract write(message: string, entry: LogEntry): void;
|
|
386
|
+
}
|
|
387
|
+
//#endregion
|
|
388
|
+
//#region ../alepha/src/logger/providers/LogFormatterProvider.d.ts
|
|
389
|
+
declare abstract class LogFormatterProvider {
|
|
390
|
+
abstract format(entry: LogEntry): string;
|
|
391
|
+
}
|
|
392
|
+
//#endregion
|
|
393
|
+
//#region ../alepha/src/logger/services/Logger.d.ts
|
|
394
|
+
declare class Logger implements LoggerInterface {
|
|
395
|
+
protected readonly alepha: Alepha;
|
|
396
|
+
protected readonly formatter: LogFormatterProvider;
|
|
397
|
+
protected readonly destination: LogDestinationProvider;
|
|
398
|
+
protected readonly dateTimeProvider: DateTimeProvider;
|
|
399
|
+
protected readonly levels: Record<string, number>;
|
|
400
|
+
protected readonly service: string;
|
|
401
|
+
protected readonly module: string;
|
|
402
|
+
protected readonly app?: string;
|
|
403
|
+
protected appLogLevel: string;
|
|
404
|
+
protected logLevel: LogLevel;
|
|
405
|
+
constructor(service: string, module: string);
|
|
406
|
+
get context(): string | undefined;
|
|
407
|
+
get level(): string;
|
|
408
|
+
parseLevel(level: string, app: string): LogLevel;
|
|
409
|
+
private matchesPattern;
|
|
410
|
+
asLogLevel(something: string): LogLevel;
|
|
411
|
+
error(message: string, data?: unknown): void;
|
|
412
|
+
warn(message: string, data?: unknown): void;
|
|
413
|
+
info(message: string, data?: unknown): void;
|
|
414
|
+
debug(message: string, data?: unknown): void;
|
|
415
|
+
trace(message: string, data?: unknown): void;
|
|
416
|
+
protected log(level: LogLevel, message: string, data?: unknown): void;
|
|
417
|
+
protected emit(entry: LogEntry, message?: string): void;
|
|
418
|
+
}
|
|
419
|
+
//#endregion
|
|
420
|
+
//#region ../alepha/src/logger/index.d.ts
|
|
421
|
+
declare const envSchema$6: alepha46.TObject<{
|
|
422
|
+
/**
|
|
423
|
+
* Default log level for the application.
|
|
424
|
+
*
|
|
425
|
+
* Default by environment:
|
|
426
|
+
* - dev = info
|
|
427
|
+
* - prod = info
|
|
428
|
+
* - test = error
|
|
429
|
+
*
|
|
430
|
+
* Levels are: "trace" | "debug" | "info" | "warn" | "error" | "silent"
|
|
431
|
+
*
|
|
432
|
+
* Level can be set for a specific module:
|
|
433
|
+
*
|
|
434
|
+
* @example
|
|
435
|
+
* LOG_LEVEL=my.module.name:debug,info # Set debug level for my.module.name and info for all other modules
|
|
436
|
+
* LOG_LEVEL=alepha:trace, info # Set trace level for all alepha modules and info for all other modules
|
|
437
|
+
*/
|
|
438
|
+
LOG_LEVEL: alepha46.TOptional<alepha46.TString>;
|
|
439
|
+
/**
|
|
440
|
+
* Built-in log formats.
|
|
441
|
+
* - "json" - JSON format, useful for structured logging and log aggregation. {@link JsonFormatterProvider}
|
|
442
|
+
* - "pretty" - Simple text format, human-readable, with colors. {@link SimpleFormatterProvider}
|
|
443
|
+
* - "raw" - Raw format, no formatting, just the message. {@link RawFormatterProvider}
|
|
444
|
+
*/
|
|
445
|
+
LOG_FORMAT: alepha46.TOptional<alepha46.TUnsafe<"json" | "pretty" | "raw">>;
|
|
446
|
+
}>;
|
|
447
|
+
declare module "alepha" {
|
|
448
|
+
interface Env extends Partial<Static<typeof envSchema$6>> {}
|
|
449
|
+
interface State {
|
|
450
|
+
/**
|
|
451
|
+
* Current log level for the application or specific modules.
|
|
452
|
+
*/
|
|
453
|
+
"alepha.logger.level"?: string;
|
|
454
|
+
}
|
|
455
|
+
interface Hooks {
|
|
456
|
+
log: {
|
|
457
|
+
message?: string;
|
|
458
|
+
entry: LogEntry;
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
//#endregion
|
|
430
463
|
//#region ../alepha/src/server/services/ServerRequestParser.d.ts
|
|
431
464
|
declare class ServerRequestParser {
|
|
432
465
|
protected readonly alepha: Alepha;
|
|
@@ -446,8 +479,8 @@ declare class ServerTimingProvider {
|
|
|
446
479
|
prefix: string;
|
|
447
480
|
disabled: boolean;
|
|
448
481
|
};
|
|
449
|
-
readonly onRequest:
|
|
450
|
-
readonly onResponse:
|
|
482
|
+
readonly onRequest: alepha46.HookPrimitive<"server:onRequest">;
|
|
483
|
+
readonly onResponse: alepha46.HookPrimitive<"server:onResponse">;
|
|
451
484
|
protected get handlerName(): string;
|
|
452
485
|
beginTiming(name: string): void;
|
|
453
486
|
endTiming(name: string): void;
|
|
@@ -511,11 +544,11 @@ declare class ServerProvider {
|
|
|
511
544
|
/**
|
|
512
545
|
* When a Node.js HTTP request is received from outside. (Vercel, AWS Lambda, etc.)
|
|
513
546
|
*/
|
|
514
|
-
protected readonly onNodeRequest:
|
|
547
|
+
protected readonly onNodeRequest: alepha46.HookPrimitive<"node:request">;
|
|
515
548
|
/**
|
|
516
549
|
* When a Web (Fetch API) request is received from outside. (Netlify, Cloudflare Workers, etc.)
|
|
517
550
|
*/
|
|
518
|
-
protected readonly onWebRequest:
|
|
551
|
+
protected readonly onWebRequest: alepha46.HookPrimitive<"web:request">;
|
|
519
552
|
/**
|
|
520
553
|
* Handle Node.js HTTP request event.
|
|
521
554
|
*
|
|
@@ -575,8 +608,8 @@ declare abstract class CacheProvider {
|
|
|
575
608
|
abstract clear(): Promise<void>;
|
|
576
609
|
}
|
|
577
610
|
//#endregion
|
|
578
|
-
//#region ../alepha/src/cache/
|
|
579
|
-
interface
|
|
611
|
+
//#region ../alepha/src/cache/primitives/$cache.d.ts
|
|
612
|
+
interface CachePrimitiveOptions<TReturn = any, TParameter extends any[] = any[]> {
|
|
580
613
|
/**
|
|
581
614
|
* The cache name. This is useful for invalidating multiple caches at once.
|
|
582
615
|
*
|
|
@@ -611,7 +644,7 @@ interface CacheDescriptorOptions<TReturn = any, TParameter extends any[] = any[]
|
|
|
611
644
|
*/
|
|
612
645
|
disabled?: boolean;
|
|
613
646
|
}
|
|
614
|
-
declare class
|
|
647
|
+
declare class CachePrimitive<TReturn = any, TParameter extends any[] = any[]> extends Primitive<CachePrimitiveOptions<TReturn, TParameter>> {
|
|
615
648
|
protected readonly env: {
|
|
616
649
|
CACHE_ENABLED: boolean;
|
|
617
650
|
CACHE_DEFAULT_TTL: number;
|
|
@@ -635,9 +668,9 @@ declare class CacheDescriptor<TReturn = any, TParameter extends any[] = any[]> e
|
|
|
635
668
|
protected deserialize<TReturn>(uint8Array: Uint8Array): Promise<TReturn>;
|
|
636
669
|
protected $provider(): CacheProvider;
|
|
637
670
|
}
|
|
638
|
-
interface
|
|
671
|
+
interface CachePrimitiveFn<TReturn = any, TParameter extends any[] = any[]> extends CachePrimitive<TReturn, TParameter> {
|
|
639
672
|
/**
|
|
640
|
-
* Run the cache
|
|
673
|
+
* Run the cache primitive with the provided arguments.
|
|
641
674
|
*/
|
|
642
675
|
(...args: TParameter): Promise<TReturn>;
|
|
643
676
|
}
|
|
@@ -646,7 +679,7 @@ interface CacheDescriptorFn<TReturn = any, TParameter extends any[] = any[]> ext
|
|
|
646
679
|
declare class HttpClient {
|
|
647
680
|
protected readonly log: Logger;
|
|
648
681
|
protected readonly alepha: Alepha;
|
|
649
|
-
readonly cache:
|
|
682
|
+
readonly cache: CachePrimitiveFn<HttpClientCache, any[]>;
|
|
650
683
|
protected readonly pendingRequests: HttpClientPendingRequests;
|
|
651
684
|
fetchAction(args: FetchActionArgs): Promise<FetchResponse>;
|
|
652
685
|
fetch<T$1 extends TSchema>(url: string, request?: RequestInitWithOptions<T$1>): Promise<FetchResponse<Static<T$1>>>;
|
|
@@ -714,8 +747,8 @@ interface HttpAction {
|
|
|
714
747
|
};
|
|
715
748
|
}
|
|
716
749
|
//#endregion
|
|
717
|
-
//#region ../alepha/src/server/
|
|
718
|
-
interface
|
|
750
|
+
//#region ../alepha/src/server/primitives/$action.d.ts
|
|
751
|
+
interface ActionPrimitiveOptions<TConfig extends RequestConfigSchema> extends Omit<ServerRoute, "handler" | "path" | "schema" | "mapParams"> {
|
|
719
752
|
/**
|
|
720
753
|
* Name of the action.
|
|
721
754
|
*
|
|
@@ -781,7 +814,7 @@ interface ActionDescriptorOptions<TConfig extends RequestConfigSchema> extends O
|
|
|
781
814
|
*/
|
|
782
815
|
handler: ServerActionHandler<TConfig>;
|
|
783
816
|
}
|
|
784
|
-
declare class
|
|
817
|
+
declare class ActionPrimitive<TConfig extends RequestConfigSchema> extends Primitive<ActionPrimitiveOptions<TConfig>> {
|
|
785
818
|
protected readonly log: Logger;
|
|
786
819
|
protected readonly env: {
|
|
787
820
|
SERVER_API_PREFIX: string;
|
|
@@ -849,52 +882,19 @@ type ServerActionHandler<TConfig extends RequestConfigSchema = RequestConfigSche
|
|
|
849
882
|
*/
|
|
850
883
|
interface ServerActionRequest<TConfig extends RequestConfigSchema> extends ServerRequest<TConfig> {}
|
|
851
884
|
//#endregion
|
|
852
|
-
//#region ../alepha/src/server/schemas/errorSchema.d.ts
|
|
853
|
-
declare const errorSchema: alepha82.TObject<{
|
|
854
|
-
error: alepha82.TString;
|
|
855
|
-
status: alepha82.TInteger;
|
|
856
|
-
message: alepha82.TString;
|
|
857
|
-
details: alepha82.TOptional<alepha82.TString>;
|
|
858
|
-
requestId: alepha82.TOptional<alepha82.TString>;
|
|
859
|
-
cause: alepha82.TOptional<alepha82.TObject<{
|
|
860
|
-
name: alepha82.TString;
|
|
861
|
-
message: alepha82.TString;
|
|
862
|
-
}>>;
|
|
863
|
-
}>;
|
|
864
|
-
type ErrorSchema = Static<typeof errorSchema>;
|
|
865
|
-
//#endregion
|
|
866
|
-
//#region ../alepha/src/server/errors/HttpError.d.ts
|
|
867
|
-
declare class HttpError extends AlephaError {
|
|
868
|
-
name: string;
|
|
869
|
-
static is: (error: unknown, status?: number) => error is HttpErrorLike;
|
|
870
|
-
static toJSON(error: HttpError): ErrorSchema;
|
|
871
|
-
readonly error: string;
|
|
872
|
-
readonly status: number;
|
|
873
|
-
readonly requestId?: string;
|
|
874
|
-
readonly details?: string;
|
|
875
|
-
readonly reason?: {
|
|
876
|
-
name: string;
|
|
877
|
-
message: string;
|
|
878
|
-
};
|
|
879
|
-
constructor(options: Partial<ErrorSchema>, cause?: unknown);
|
|
880
|
-
}
|
|
881
|
-
interface HttpErrorLike extends Error {
|
|
882
|
-
status: number;
|
|
883
|
-
}
|
|
884
|
-
//#endregion
|
|
885
885
|
//#region ../alepha/src/server/providers/BunHttpServerProvider.d.ts
|
|
886
|
-
declare const envSchema$5:
|
|
887
|
-
SERVER_PORT:
|
|
888
|
-
SERVER_HOST:
|
|
886
|
+
declare const envSchema$5: alepha46.TObject<{
|
|
887
|
+
SERVER_PORT: alepha46.TInteger;
|
|
888
|
+
SERVER_HOST: alepha46.TString;
|
|
889
889
|
}>;
|
|
890
890
|
declare module "alepha" {
|
|
891
891
|
interface Env extends Partial<Static<typeof envSchema$5>> {}
|
|
892
892
|
}
|
|
893
893
|
//#endregion
|
|
894
894
|
//#region ../alepha/src/server/providers/NodeHttpServerProvider.d.ts
|
|
895
|
-
declare const envSchema$4:
|
|
896
|
-
SERVER_PORT:
|
|
897
|
-
SERVER_HOST:
|
|
895
|
+
declare const envSchema$4: alepha46.TObject<{
|
|
896
|
+
SERVER_PORT: alepha46.TInteger;
|
|
897
|
+
SERVER_HOST: alepha46.TString;
|
|
898
898
|
}>;
|
|
899
899
|
declare module "alepha" {
|
|
900
900
|
interface Env extends Partial<Static<typeof envSchema$4>> {}
|
|
@@ -907,12 +907,12 @@ declare module "alepha" {
|
|
|
907
907
|
}
|
|
908
908
|
interface Hooks {
|
|
909
909
|
"action:onRequest": {
|
|
910
|
-
action:
|
|
910
|
+
action: ActionPrimitive<RequestConfigSchema>;
|
|
911
911
|
request: ServerRequest;
|
|
912
912
|
options: ClientRequestOptions;
|
|
913
913
|
};
|
|
914
914
|
"action:onResponse": {
|
|
915
|
-
action:
|
|
915
|
+
action: ActionPrimitive<RequestConfigSchema>;
|
|
916
916
|
request: ServerRequest;
|
|
917
917
|
options: ClientRequestOptions;
|
|
918
918
|
response: any;
|
|
@@ -968,7 +968,7 @@ declare module "alepha/server" {
|
|
|
968
968
|
*/
|
|
969
969
|
cache?: ServerRouteCache;
|
|
970
970
|
}
|
|
971
|
-
interface
|
|
971
|
+
interface ActionPrimitive<TConfig extends RequestConfigSchema> {
|
|
972
972
|
invalidate: () => Promise<void>;
|
|
973
973
|
}
|
|
974
974
|
}
|
|
@@ -987,11 +987,11 @@ boolean
|
|
|
987
987
|
/**
|
|
988
988
|
* If true, enables storing cached responses. (in-memory, Redis, @see alepha/cache for other providers)
|
|
989
989
|
* If a DurationLike is provided, it will be used as the TTL for the cache.
|
|
990
|
-
* If
|
|
990
|
+
* If CachePrimitiveOptions is provided, it will be used to configure the cache storage.
|
|
991
991
|
*
|
|
992
992
|
* @default false
|
|
993
993
|
*/
|
|
994
|
-
store?: true | DurationLike |
|
|
994
|
+
store?: true | DurationLike | CachePrimitiveOptions;
|
|
995
995
|
/**
|
|
996
996
|
* If true, enables ETag support for the cached responses.
|
|
997
997
|
*/
|
|
@@ -1071,13 +1071,13 @@ declare class Redirection extends Error {
|
|
|
1071
1071
|
}
|
|
1072
1072
|
//#endregion
|
|
1073
1073
|
//#region ../react/src/core/providers/ReactPageProvider.d.ts
|
|
1074
|
-
declare const envSchema$3:
|
|
1075
|
-
REACT_STRICT_MODE:
|
|
1074
|
+
declare const envSchema$3: alepha46.TObject<{
|
|
1075
|
+
REACT_STRICT_MODE: alepha46.TBoolean;
|
|
1076
1076
|
}>;
|
|
1077
1077
|
declare module "alepha" {
|
|
1078
1078
|
interface Env extends Partial<Static<typeof envSchema$3>> {}
|
|
1079
1079
|
}
|
|
1080
|
-
interface PageRouteEntry extends Omit<
|
|
1080
|
+
interface PageRouteEntry extends Omit<PagePrimitiveOptions, "children" | "parent"> {
|
|
1081
1081
|
children?: PageRouteEntry[];
|
|
1082
1082
|
}
|
|
1083
1083
|
interface PageRoute extends PageRouteEntry {
|
|
@@ -1132,19 +1132,19 @@ interface ReactRouterState {
|
|
|
1132
1132
|
//#endregion
|
|
1133
1133
|
//#region ../react/src/core/services/ReactPageService.d.ts
|
|
1134
1134
|
declare class ReactPageService {
|
|
1135
|
-
fetch(pathname: string, options?:
|
|
1135
|
+
fetch(pathname: string, options?: PagePrimitiveRenderOptions): Promise<{
|
|
1136
1136
|
html: string;
|
|
1137
1137
|
response: Response;
|
|
1138
1138
|
}>;
|
|
1139
|
-
render(name: string, options?:
|
|
1139
|
+
render(name: string, options?: PagePrimitiveRenderOptions): Promise<PagePrimitiveRenderResult>;
|
|
1140
1140
|
}
|
|
1141
1141
|
//#endregion
|
|
1142
|
-
//#region ../react/src/core/
|
|
1143
|
-
interface
|
|
1142
|
+
//#region ../react/src/core/primitives/$page.d.ts
|
|
1143
|
+
interface PagePrimitiveOptions<TConfig extends PageConfigSchema = PageConfigSchema, TProps extends object = TPropsDefault, TPropsParent extends object = TPropsParentDefault> {
|
|
1144
1144
|
/**
|
|
1145
1145
|
* Identifier name for the page. Must be unique.
|
|
1146
1146
|
*
|
|
1147
|
-
* @default
|
|
1147
|
+
* @default Primitive key
|
|
1148
1148
|
*/
|
|
1149
1149
|
name?: string;
|
|
1150
1150
|
/**
|
|
@@ -1196,11 +1196,11 @@ interface PageDescriptorOptions<TConfig extends PageConfigSchema = PageConfigSch
|
|
|
1196
1196
|
* Attach child pages to create nested routes.
|
|
1197
1197
|
* This will make the page a parent route.
|
|
1198
1198
|
*/
|
|
1199
|
-
children?: Array<
|
|
1199
|
+
children?: Array<PagePrimitive> | (() => Array<PagePrimitive>);
|
|
1200
1200
|
/**
|
|
1201
1201
|
* Define a parent page for nested routing.
|
|
1202
1202
|
*/
|
|
1203
|
-
parent?:
|
|
1203
|
+
parent?: PagePrimitive<PageConfigSchema, TPropsParent, any>;
|
|
1204
1204
|
can?: () => boolean;
|
|
1205
1205
|
/**
|
|
1206
1206
|
* Catch any error from the `resolve` function or during `rendering`.
|
|
@@ -1310,7 +1310,7 @@ interface PageDescriptorOptions<TConfig extends PageConfigSchema = PageConfigSch
|
|
|
1310
1310
|
animation?: PageAnimation;
|
|
1311
1311
|
}
|
|
1312
1312
|
type ErrorHandler = (error: Error, state: ReactRouterState) => ReactNode | Redirection | undefined;
|
|
1313
|
-
declare class
|
|
1313
|
+
declare class PagePrimitive<TConfig extends PageConfigSchema = PageConfigSchema, TProps extends object = TPropsDefault, TPropsParent extends object = TPropsParentDefault> extends Primitive<PagePrimitiveOptions<TConfig, TProps, TPropsParent>> {
|
|
1314
1314
|
protected readonly reactPageService: ReactPageService;
|
|
1315
1315
|
protected onInit(): void;
|
|
1316
1316
|
get name(): string;
|
|
@@ -1320,8 +1320,8 @@ declare class PageDescriptor<TConfig extends PageConfigSchema = PageConfigSchema
|
|
|
1320
1320
|
* This will render the page (HTML layout included or not) and return the HTML + context.
|
|
1321
1321
|
* Only valid for server-side rendering, it will throw an error if called on the client-side.
|
|
1322
1322
|
*/
|
|
1323
|
-
render(options?:
|
|
1324
|
-
fetch(options?:
|
|
1323
|
+
render(options?: PagePrimitiveRenderOptions): Promise<PagePrimitiveRenderResult>;
|
|
1324
|
+
fetch(options?: PagePrimitiveRenderOptions): Promise<{
|
|
1325
1325
|
html: string;
|
|
1326
1326
|
response: Response;
|
|
1327
1327
|
}>;
|
|
@@ -1334,7 +1334,7 @@ interface PageConfigSchema {
|
|
|
1334
1334
|
}
|
|
1335
1335
|
type TPropsDefault = any;
|
|
1336
1336
|
type TPropsParentDefault = {};
|
|
1337
|
-
interface
|
|
1337
|
+
interface PagePrimitiveRenderOptions {
|
|
1338
1338
|
params?: Record<string, string>;
|
|
1339
1339
|
query?: Record<string, string>;
|
|
1340
1340
|
/**
|
|
@@ -1346,7 +1346,7 @@ interface PageDescriptorRenderOptions {
|
|
|
1346
1346
|
html?: boolean;
|
|
1347
1347
|
hydration?: boolean;
|
|
1348
1348
|
}
|
|
1349
|
-
interface
|
|
1349
|
+
interface PagePrimitiveRenderResult {
|
|
1350
1350
|
html: string;
|
|
1351
1351
|
state: ReactRouterState;
|
|
1352
1352
|
redirect?: string;
|
|
@@ -1369,15 +1369,15 @@ type CssAnimation = {
|
|
|
1369
1369
|
};
|
|
1370
1370
|
//#endregion
|
|
1371
1371
|
//#region ../alepha/src/security/schemas/userAccountInfoSchema.d.ts
|
|
1372
|
-
declare const userAccountInfoSchema:
|
|
1373
|
-
id:
|
|
1374
|
-
name:
|
|
1375
|
-
email:
|
|
1376
|
-
username:
|
|
1377
|
-
picture:
|
|
1378
|
-
sessionId:
|
|
1379
|
-
organizations:
|
|
1380
|
-
roles:
|
|
1372
|
+
declare const userAccountInfoSchema: alepha46.TObject<{
|
|
1373
|
+
id: alepha46.TString;
|
|
1374
|
+
name: alepha46.TOptional<alepha46.TString>;
|
|
1375
|
+
email: alepha46.TOptional<alepha46.TString>;
|
|
1376
|
+
username: alepha46.TOptional<alepha46.TString>;
|
|
1377
|
+
picture: alepha46.TOptional<alepha46.TString>;
|
|
1378
|
+
sessionId: alepha46.TOptional<alepha46.TString>;
|
|
1379
|
+
organizations: alepha46.TOptional<alepha46.TArray<alepha46.TString>>;
|
|
1380
|
+
roles: alepha46.TOptional<alepha46.TArray<alepha46.TString>>;
|
|
1381
1381
|
}>;
|
|
1382
1382
|
type UserAccount = Static<typeof userAccountInfoSchema>;
|
|
1383
1383
|
//#endregion
|
|
@@ -1403,8 +1403,8 @@ interface UserAccountToken extends UserAccount {
|
|
|
1403
1403
|
}
|
|
1404
1404
|
//#endregion
|
|
1405
1405
|
//#region ../alepha/src/security/providers/SecurityProvider.d.ts
|
|
1406
|
-
declare const envSchema$2:
|
|
1407
|
-
APP_SECRET:
|
|
1406
|
+
declare const envSchema$2: alepha46.TObject<{
|
|
1407
|
+
APP_SECRET: alepha46.TString;
|
|
1408
1408
|
}>;
|
|
1409
1409
|
declare module "alepha" {
|
|
1410
1410
|
interface Env extends Partial<Static<typeof envSchema$2>> {}
|
|
@@ -1422,7 +1422,7 @@ declare module "alepha" {
|
|
|
1422
1422
|
/**
|
|
1423
1423
|
* Provides comprehensive authentication and authorization capabilities with JWT tokens, role-based access control, and user management.
|
|
1424
1424
|
*
|
|
1425
|
-
* The security module enables building secure applications using
|
|
1425
|
+
* The security module enables building secure applications using primitives like `$realm`, `$role`, and `$permission`
|
|
1426
1426
|
* on class properties. It offers JWT-based authentication, fine-grained permissions, service accounts, and seamless
|
|
1427
1427
|
* integration with various authentication providers and user management systems.
|
|
1428
1428
|
*
|
|
@@ -1497,15 +1497,15 @@ declare module "alepha/server" {
|
|
|
1497
1497
|
*/
|
|
1498
1498
|
//#endregion
|
|
1499
1499
|
//#region ../alepha/src/server-links/schemas/apiLinksResponseSchema.d.ts
|
|
1500
|
-
declare const apiLinksResponseSchema:
|
|
1501
|
-
prefix:
|
|
1502
|
-
links:
|
|
1503
|
-
name:
|
|
1504
|
-
group:
|
|
1505
|
-
path:
|
|
1506
|
-
method:
|
|
1507
|
-
requestBodyType:
|
|
1508
|
-
service:
|
|
1500
|
+
declare const apiLinksResponseSchema: alepha46.TObject<{
|
|
1501
|
+
prefix: alepha46.TOptional<alepha46.TString>;
|
|
1502
|
+
links: alepha46.TArray<alepha46.TObject<{
|
|
1503
|
+
name: alepha46.TString;
|
|
1504
|
+
group: alepha46.TOptional<alepha46.TString>;
|
|
1505
|
+
path: alepha46.TString;
|
|
1506
|
+
method: alepha46.TOptional<alepha46.TString>;
|
|
1507
|
+
requestBodyType: alepha46.TOptional<alepha46.TString>;
|
|
1508
|
+
service: alepha46.TOptional<alepha46.TString>;
|
|
1509
1509
|
}>>;
|
|
1510
1510
|
}>;
|
|
1511
1511
|
type ApiLinksResponse = Static<typeof apiLinksResponseSchema>;
|
|
@@ -1525,7 +1525,7 @@ declare module "alepha" {
|
|
|
1525
1525
|
/**
|
|
1526
1526
|
* Provides server-side link management and remote capabilities for client-server interactions.
|
|
1527
1527
|
*
|
|
1528
|
-
* The server-links module enables declarative link definitions using `$remote` and `$client`
|
|
1528
|
+
* The server-links module enables declarative link definitions using `$remote` and `$client` primitives,
|
|
1529
1529
|
* facilitating seamless API endpoint management and client-server communication. It integrates with server
|
|
1530
1530
|
* security features to ensure safe and controlled access to resources.
|
|
1531
1531
|
*
|
|
@@ -1535,8 +1535,8 @@ declare module "alepha" {
|
|
|
1535
1535
|
*/
|
|
1536
1536
|
//#endregion
|
|
1537
1537
|
//#region ../react/src/core/providers/ReactBrowserProvider.d.ts
|
|
1538
|
-
declare const envSchema$1:
|
|
1539
|
-
REACT_ROOT_ID:
|
|
1538
|
+
declare const envSchema$1: alepha46.TObject<{
|
|
1539
|
+
REACT_ROOT_ID: alepha46.TString;
|
|
1540
1540
|
}>;
|
|
1541
1541
|
declare module "alepha" {
|
|
1542
1542
|
interface Env extends Partial<Static<typeof envSchema$1>> {}
|
|
@@ -1544,8 +1544,8 @@ declare module "alepha" {
|
|
|
1544
1544
|
/**
|
|
1545
1545
|
* React browser renderer configuration atom
|
|
1546
1546
|
*/
|
|
1547
|
-
declare const reactBrowserOptions:
|
|
1548
|
-
scrollRestoration:
|
|
1547
|
+
declare const reactBrowserOptions: alepha46.Atom<alepha46.TObject<{
|
|
1548
|
+
scrollRestoration: alepha46.TUnsafe<"top" | "manual">;
|
|
1549
1549
|
}>, "alepha.react.browser.options">;
|
|
1550
1550
|
type ReactBrowserRendererOptions = Static<typeof reactBrowserOptions.schema>;
|
|
1551
1551
|
declare module "alepha" {
|
|
@@ -1560,10 +1560,10 @@ type ReactHydrationState = {
|
|
|
1560
1560
|
};
|
|
1561
1561
|
//#endregion
|
|
1562
1562
|
//#region ../react/src/core/providers/ReactServerProvider.d.ts
|
|
1563
|
-
declare const envSchema:
|
|
1564
|
-
REACT_SSR_ENABLED:
|
|
1565
|
-
REACT_ROOT_ID:
|
|
1566
|
-
REACT_SERVER_TEMPLATE:
|
|
1563
|
+
declare const envSchema: alepha46.TObject<{
|
|
1564
|
+
REACT_SSR_ENABLED: alepha46.TOptional<alepha46.TBoolean>;
|
|
1565
|
+
REACT_ROOT_ID: alepha46.TString;
|
|
1566
|
+
REACT_SERVER_TEMPLATE: alepha46.TOptional<alepha46.TString>;
|
|
1567
1567
|
}>;
|
|
1568
1568
|
declare module "alepha" {
|
|
1569
1569
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -1574,11 +1574,11 @@ declare module "alepha" {
|
|
|
1574
1574
|
/**
|
|
1575
1575
|
* React server provider configuration atom
|
|
1576
1576
|
*/
|
|
1577
|
-
declare const reactServerOptions:
|
|
1578
|
-
publicDir:
|
|
1579
|
-
staticServer:
|
|
1580
|
-
disabled:
|
|
1581
|
-
path:
|
|
1577
|
+
declare const reactServerOptions: alepha46.Atom<alepha46.TObject<{
|
|
1578
|
+
publicDir: alepha46.TString;
|
|
1579
|
+
staticServer: alepha46.TObject<{
|
|
1580
|
+
disabled: alepha46.TBoolean;
|
|
1581
|
+
path: alepha46.TString;
|
|
1582
1582
|
}>;
|
|
1583
1583
|
}>, "alepha.react.server.options">;
|
|
1584
1584
|
type ReactServerProviderOptions = Static<typeof reactServerOptions.schema>;
|
|
@@ -1683,7 +1683,7 @@ declare module "alepha" {
|
|
|
1683
1683
|
/**
|
|
1684
1684
|
* Provides full-stack React development with declarative routing, server-side rendering, and client-side hydration.
|
|
1685
1685
|
*
|
|
1686
|
-
* The React module enables building modern React applications using the `$page`
|
|
1686
|
+
* The React module enables building modern React applications using the `$page` primitive on class properties.
|
|
1687
1687
|
* It delivers seamless server-side rendering, automatic code splitting, and client-side navigation with full
|
|
1688
1688
|
* type safety and schema validation for route parameters and data.
|
|
1689
1689
|
*
|
|
@@ -1693,14 +1693,14 @@ declare module "alepha" {
|
|
|
1693
1693
|
//#endregion
|
|
1694
1694
|
//#region src/admin/AdminRouter.d.ts
|
|
1695
1695
|
declare class AdminRouter {
|
|
1696
|
-
admin:
|
|
1697
|
-
adminUsers:
|
|
1698
|
-
adminNotifications:
|
|
1699
|
-
adminSessions:
|
|
1700
|
-
adminVerifications:
|
|
1701
|
-
adminJobs:
|
|
1702
|
-
adminParameters:
|
|
1703
|
-
adminFiles:
|
|
1696
|
+
admin: PagePrimitive<PageConfigSchema, any, TPropsParentDefault>;
|
|
1697
|
+
adminUsers: PagePrimitive<PageConfigSchema, any, any>;
|
|
1698
|
+
adminNotifications: PagePrimitive<PageConfigSchema, any, any>;
|
|
1699
|
+
adminSessions: PagePrimitive<PageConfigSchema, any, any>;
|
|
1700
|
+
adminVerifications: PagePrimitive<PageConfigSchema, any, any>;
|
|
1701
|
+
adminJobs: PagePrimitive<PageConfigSchema, any, any>;
|
|
1702
|
+
adminParameters: PagePrimitive<PageConfigSchema, any, any>;
|
|
1703
|
+
adminFiles: PagePrimitive<PageConfigSchema, any, any>;
|
|
1704
1704
|
}
|
|
1705
1705
|
//#endregion
|
|
1706
1706
|
//#region src/admin/components/AdminFiles.d.ts
|
|
@@ -1739,7 +1739,7 @@ declare const AdminVerifications: () => react_jsx_runtime0.JSX.Element;
|
|
|
1739
1739
|
*
|
|
1740
1740
|
* @module alepha.ui.admin
|
|
1741
1741
|
*/
|
|
1742
|
-
declare const AlephaUIAdmin:
|
|
1742
|
+
declare const AlephaUIAdmin: alepha46.Service<alepha46.Module>;
|
|
1743
1743
|
//#endregion
|
|
1744
1744
|
export { AdminFiles, AdminJobs, AdminLayout, AdminNotifications, AdminParameters, AdminRouter, AdminSessions, type AdminSessionsProps, AdminUsers, type AdminUsersProps, AdminVerifications, AlephaUIAdmin };
|
|
1745
1745
|
//# sourceMappingURL=index.d.ts.map
|