alepha 0.9.3 → 0.9.4
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/README.md +46 -0
- package/batch.d.ts +3 -6
- package/bucket.d.ts +7 -14
- package/cache/redis.d.ts +7 -7
- package/cache.d.ts +2 -6
- package/command.d.ts +11 -11
- package/core.d.ts +99 -254
- package/datetime.d.ts +3 -7
- package/file.d.ts +0 -3
- package/lock/redis.d.ts +2 -5
- package/lock.d.ts +8 -15
- package/logger.cjs +8 -0
- package/logger.d.ts +222 -0
- package/logger.js +1 -0
- package/package.json +50 -42
- package/postgres.d.ts +192 -271
- package/queue/redis.d.ts +0 -2
- package/queue.d.ts +11 -19
- package/react/auth.d.ts +217 -134
- package/react/form.d.ts +113 -72
- package/react/head.d.ts +7 -14
- package/react/i18n.d.ts +23 -28
- package/react.d.ts +274 -256
- package/redis.d.ts +12 -12
- package/retry.d.ts +0 -4
- package/router.d.ts +0 -1
- package/scheduler.d.ts +9 -13
- package/security.d.ts +68 -86
- package/server/cache.d.ts +3 -5
- package/server/compress.d.ts +0 -3
- package/server/cookies.d.ts +4 -7
- package/server/cors.d.ts +1 -5
- package/server/health.d.ts +0 -3
- package/server/helmet.d.ts +28 -28
- package/server/links.d.ts +144 -42
- package/server/metrics.d.ts +1 -5
- package/server/multipart.d.ts +0 -2
- package/server/proxy.d.ts +3 -7
- package/server/security.d.ts +6 -7
- package/server/static.d.ts +4 -8
- package/server/swagger.d.ts +2 -6
- package/server.d.ts +72 -96
- package/topic/redis.d.ts +3 -6
- package/topic.d.ts +5 -13
- package/vite.d.ts +5 -7
package/server.d.ts
CHANGED
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
import * as _alepha_core5 from "alepha";
|
|
2
|
-
import * as _alepha_core4 from "alepha";
|
|
3
|
-
import * as _alepha_core11 from "alepha";
|
|
4
|
-
import * as _alepha_core6 from "alepha";
|
|
5
|
-
import * as _alepha_core10 from "alepha";
|
|
6
1
|
import * as _alepha_core1 from "alepha";
|
|
7
|
-
import * as _alepha_core0 from "alepha";
|
|
8
2
|
import { Alepha, AlephaError, Async, Descriptor, FileLike, KIND, Static, StreamLike, TObject, TSchema } from "alepha";
|
|
3
|
+
import * as _alepha_logger0 from "alepha/logger";
|
|
9
4
|
import { Readable } from "node:stream";
|
|
10
5
|
import { ReadableStream } from "node:stream/web";
|
|
11
6
|
import { Route, RouterProvider } from "alepha/router";
|
|
12
7
|
import * as _alepha_cache0 from "alepha/cache";
|
|
13
8
|
import { IncomingMessage, ServerResponse as ServerResponse$1 } from "node:http";
|
|
14
9
|
import { DateTimeProvider, DurationLike } from "alepha/datetime";
|
|
15
|
-
import * as
|
|
16
|
-
import * as _sinclair_typebox25 from "@sinclair/typebox";
|
|
17
|
-
import * as _sinclair_typebox35 from "@sinclair/typebox";
|
|
10
|
+
import * as _sinclair_typebox7 from "@sinclair/typebox";
|
|
18
11
|
import * as http0 from "http";
|
|
19
12
|
|
|
20
13
|
//#region src/constants/routeMethods.d.ts
|
|
21
14
|
declare const routeMethods: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "CONNECT", "TRACE"];
|
|
22
15
|
type RouteMethod = (typeof routeMethods)[number];
|
|
23
|
-
//# sourceMappingURL=routeMethods.d.ts.map
|
|
24
16
|
//#endregion
|
|
25
17
|
//#region src/helpers/ServerReply.d.ts
|
|
26
18
|
declare class ServerReply {
|
|
@@ -33,7 +25,22 @@ declare class ServerReply {
|
|
|
33
25
|
setStatus(status: number): void;
|
|
34
26
|
setHeader(name: string, value: string): void;
|
|
35
27
|
}
|
|
36
|
-
//#
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/services/UserAgentParser.d.ts
|
|
30
|
+
interface UserAgentInfo {
|
|
31
|
+
os: "Windows" | "Android" | "Ubuntu" | "MacOS" | "iOS" | "Linux" | "FreeBSD" | "OpenBSD" | "ChromeOS" | "BlackBerry" | "Symbian" | "Windows Phone";
|
|
32
|
+
browser: "Chrome" | "Firefox" | "Safari" | "Edge" | "Opera" | "Internet Explorer" | "Brave" | "Vivaldi" | "Samsung Browser" | "UC Browser" | "Yandex";
|
|
33
|
+
device: "Mobile" | "Desktop" | "Tablet";
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Simple User-Agent parser to detect OS, browser, and device type.
|
|
37
|
+
* This parser is not exhaustive and may not cover all edge cases.
|
|
38
|
+
*
|
|
39
|
+
* Use result for non
|
|
40
|
+
*/
|
|
41
|
+
declare class UserAgentParser {
|
|
42
|
+
parse(userAgent?: string): UserAgentInfo;
|
|
43
|
+
}
|
|
37
44
|
//#endregion
|
|
38
45
|
//#region src/interfaces/ServerRequest.d.ts
|
|
39
46
|
interface RequestConfigSchema {
|
|
@@ -53,6 +60,14 @@ type ServerRequestConfigEntry<TConfig extends RequestConfigSchema = RequestConfi
|
|
|
53
60
|
interface ServerRequest<TConfig extends RequestConfigSchema = RequestConfigSchema> extends ServerRequestConfig<TConfig> {
|
|
54
61
|
method: RouteMethod;
|
|
55
62
|
url: URL;
|
|
63
|
+
ip?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Browser user agent information.
|
|
66
|
+
* Information are not guaranteed to be accurate. Use with caution.
|
|
67
|
+
*
|
|
68
|
+
* @see {@link UserAgentParser}
|
|
69
|
+
*/
|
|
70
|
+
userAgent: UserAgentInfo;
|
|
56
71
|
metadata: Record<string, any>;
|
|
57
72
|
reply: ServerReply;
|
|
58
73
|
raw: {
|
|
@@ -97,7 +112,6 @@ interface ServerRawRequest {
|
|
|
97
112
|
};
|
|
98
113
|
};
|
|
99
114
|
}
|
|
100
|
-
//# sourceMappingURL=ServerRequest.d.ts.map
|
|
101
115
|
//#endregion
|
|
102
116
|
//#region src/providers/ServerProvider.d.ts
|
|
103
117
|
declare abstract class ServerProvider {
|
|
@@ -105,8 +119,19 @@ declare abstract class ServerProvider {
|
|
|
105
119
|
abstract get hostname(): string;
|
|
106
120
|
protected isViteNotFound(url?: string, route?: Route, params?: Record<string, string>): boolean;
|
|
107
121
|
}
|
|
108
|
-
//#
|
|
109
|
-
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/providers/ServerTimingProvider.d.ts
|
|
124
|
+
type TimingMap = Record<string, [number, number]>;
|
|
125
|
+
declare class ServerTimingProvider {
|
|
126
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
127
|
+
protected readonly alepha: Alepha;
|
|
128
|
+
readonly onRequest: _alepha_core1.HookDescriptor<"server:onRequest">;
|
|
129
|
+
readonly onResponse: _alepha_core1.HookDescriptor<"server:onResponse">;
|
|
130
|
+
protected get handlerName(): string;
|
|
131
|
+
beginTiming(name: string): void;
|
|
132
|
+
endTiming(name: string): void;
|
|
133
|
+
protected setDuration(name: string, timing: TimingMap): void;
|
|
134
|
+
}
|
|
110
135
|
//#endregion
|
|
111
136
|
//#region src/providers/ServerRouterProvider.d.ts
|
|
112
137
|
/**
|
|
@@ -119,9 +144,12 @@ declare abstract class ServerProvider {
|
|
|
119
144
|
declare class ServerRouterProvider extends RouterProvider<ServerRouteMatcher> {
|
|
120
145
|
protected readonly alepha: Alepha;
|
|
121
146
|
protected readonly routes: ServerRoute[];
|
|
147
|
+
protected readonly serverTimingProvider: ServerTimingProvider;
|
|
148
|
+
protected readonly userAgentParser: UserAgentParser;
|
|
122
149
|
getRoutes(): ServerRoute[];
|
|
123
150
|
createRoute<TConfig extends RequestConfigSchema = RequestConfigSchema>(route: ServerRoute<TConfig>): void;
|
|
124
151
|
onRequest(route: ServerRoute, rawRequest: ServerRawRequest, responseKind: ResponseKind): Promise<ServerResponse>;
|
|
152
|
+
protected getClientIp(request: ServerRawRequest): string | undefined;
|
|
125
153
|
protected processRequest(request: ServerRequest, route: ServerRoute, responseKind: ResponseKind): Promise<{
|
|
126
154
|
status: number;
|
|
127
155
|
headers: Record<string, string> & {
|
|
@@ -130,18 +158,17 @@ declare class ServerRouterProvider extends RouterProvider<ServerRouteMatcher> {
|
|
|
130
158
|
body: any;
|
|
131
159
|
}>;
|
|
132
160
|
protected runRouteHandler(route: ServerRoute, request: ServerRequest, responseKind: ResponseKind): Promise<void>;
|
|
161
|
+
serializeResponse(route: ServerRoute, reply: ServerReply, responseKind: ResponseKind): void;
|
|
133
162
|
protected getResponseType(schema?: RequestConfigSchema): ResponseKind;
|
|
134
163
|
protected errorHandler(route: ServerRoute, request: ServerRequest, error: Error): Promise<void>;
|
|
135
164
|
validateRequest(route: {
|
|
136
165
|
schema?: RequestConfigSchema;
|
|
137
166
|
}, request: ServerRequestConfig): void;
|
|
138
|
-
serializeResponse(route: ServerRoute, reply: ServerReply, responseKind: ResponseKind): void;
|
|
139
167
|
}
|
|
140
|
-
//# sourceMappingURL=ServerRouterProvider.d.ts.map
|
|
141
168
|
//#endregion
|
|
142
169
|
//#region src/services/HttpClient.d.ts
|
|
143
170
|
declare class HttpClient {
|
|
144
|
-
protected readonly log:
|
|
171
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
145
172
|
protected readonly alepha: Alepha;
|
|
146
173
|
readonly cache: _alepha_cache0.CacheDescriptorFn<HttpClientCache, any[]>;
|
|
147
174
|
protected readonly pendingRequests: HttpClientPendingRequests;
|
|
@@ -203,6 +230,7 @@ interface HttpAction {
|
|
|
203
230
|
method?: string;
|
|
204
231
|
prefix?: string;
|
|
205
232
|
path: string;
|
|
233
|
+
requestBodyType?: string;
|
|
206
234
|
schema?: {
|
|
207
235
|
params?: TObject;
|
|
208
236
|
query?: TObject;
|
|
@@ -300,7 +328,7 @@ interface ActionDescriptorOptions<TConfig extends RequestConfigSchema> extends O
|
|
|
300
328
|
handler: ServerActionHandler<TConfig>;
|
|
301
329
|
}
|
|
302
330
|
declare class ActionDescriptor<TConfig extends RequestConfigSchema> extends Descriptor<ActionDescriptorOptions<TConfig>> {
|
|
303
|
-
protected readonly log:
|
|
331
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
304
332
|
protected readonly env: {
|
|
305
333
|
SERVER_API_PREFIX: string;
|
|
306
334
|
};
|
|
@@ -366,7 +394,6 @@ type ServerActionHandler<TConfig extends RequestConfigSchema = RequestConfigSche
|
|
|
366
394
|
* This is NOT Server Request, but a specific type for actions.
|
|
367
395
|
*/
|
|
368
396
|
interface ServerActionRequest<TConfig extends RequestConfigSchema> extends ServerRequest<TConfig> {}
|
|
369
|
-
//# sourceMappingURL=$action.d.ts.map
|
|
370
397
|
//#endregion
|
|
371
398
|
//#region src/errors/HttpError.d.ts
|
|
372
399
|
declare const isHttpError: (error: unknown, status?: number) => error is HttpErrorLike;
|
|
@@ -407,7 +434,6 @@ declare const errorNameByStatus: Record<number, string>;
|
|
|
407
434
|
interface HttpErrorLike extends Error {
|
|
408
435
|
status: number;
|
|
409
436
|
}
|
|
410
|
-
//# sourceMappingURL=HttpError.d.ts.map
|
|
411
437
|
//#endregion
|
|
412
438
|
//#region src/descriptors/$route.d.ts
|
|
413
439
|
/**
|
|
@@ -427,100 +453,67 @@ declare class RouteDescriptor<TConfig extends RequestConfigSchema> extends Descr
|
|
|
427
453
|
protected readonly serverRouterProvider: ServerRouterProvider;
|
|
428
454
|
protected onInit(): void;
|
|
429
455
|
}
|
|
430
|
-
//# sourceMappingURL=$route.d.ts.map
|
|
431
456
|
//#endregion
|
|
432
457
|
//#region src/errors/BadRequestError.d.ts
|
|
433
458
|
declare class BadRequestError extends HttpError {
|
|
434
459
|
constructor(message?: string, cause?: unknown);
|
|
435
460
|
}
|
|
436
|
-
//# sourceMappingURL=BadRequestError.d.ts.map
|
|
437
461
|
//#endregion
|
|
438
462
|
//#region src/errors/ConflictError.d.ts
|
|
439
463
|
declare class ConflictError extends HttpError {
|
|
440
464
|
constructor(message?: string, cause?: unknown);
|
|
441
465
|
}
|
|
442
|
-
//# sourceMappingURL=ConflictError.d.ts.map
|
|
443
466
|
//#endregion
|
|
444
467
|
//#region src/errors/ForbiddenError.d.ts
|
|
445
468
|
declare class ForbiddenError extends HttpError {
|
|
446
469
|
constructor(message?: string, cause?: unknown);
|
|
447
470
|
}
|
|
448
|
-
//# sourceMappingURL=ForbiddenError.d.ts.map
|
|
449
471
|
//#endregion
|
|
450
472
|
//#region src/errors/NotFoundError.d.ts
|
|
451
473
|
declare class NotFoundError extends HttpError {
|
|
452
474
|
constructor(message?: string, cause?: unknown);
|
|
453
475
|
}
|
|
454
|
-
//# sourceMappingURL=NotFoundError.d.ts.map
|
|
455
476
|
//#endregion
|
|
456
477
|
//#region src/errors/UnauthorizedError.d.ts
|
|
457
478
|
declare class UnauthorizedError extends HttpError {
|
|
458
479
|
constructor(message?: string, cause?: unknown);
|
|
459
480
|
}
|
|
460
|
-
//# sourceMappingURL=UnauthorizedError.d.ts.map
|
|
461
481
|
//#endregion
|
|
462
482
|
//#region src/errors/ValidationError.d.ts
|
|
463
483
|
declare class ValidationError extends HttpError {
|
|
464
484
|
constructor(message?: string, cause?: unknown);
|
|
465
485
|
}
|
|
466
|
-
//# sourceMappingURL=ValidationError.d.ts.map
|
|
467
486
|
//#endregion
|
|
468
487
|
//#region src/helpers/isMultipart.d.ts
|
|
469
488
|
declare const isMultipart: (options: {
|
|
470
489
|
schema?: RequestConfigSchema;
|
|
490
|
+
requestBodyType?: string;
|
|
471
491
|
}) => boolean;
|
|
472
|
-
//# sourceMappingURL=isMultipart.d.ts.map
|
|
473
|
-
//#endregion
|
|
474
|
-
//#region src/schemas/apiLinksResponseSchema.d.ts
|
|
475
|
-
declare const apiLinkSchema: _sinclair_typebox0.TObject<{
|
|
476
|
-
name: _sinclair_typebox0.TString;
|
|
477
|
-
path: _sinclair_typebox0.TString;
|
|
478
|
-
method: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
479
|
-
group: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
480
|
-
requestBodyType: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
481
|
-
service: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
482
|
-
}>;
|
|
483
|
-
declare const apiLinksResponseSchema: _sinclair_typebox0.TObject<{
|
|
484
|
-
prefix: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
485
|
-
links: _sinclair_typebox0.TArray<_sinclair_typebox0.TObject<{
|
|
486
|
-
name: _sinclair_typebox0.TString;
|
|
487
|
-
path: _sinclair_typebox0.TString;
|
|
488
|
-
method: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
489
|
-
group: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
490
|
-
requestBodyType: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
491
|
-
service: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
|
|
492
|
-
}>>;
|
|
493
|
-
}>;
|
|
494
|
-
type ApiLinksResponse = Static<typeof apiLinksResponseSchema>;
|
|
495
|
-
type ApiLink = Static<typeof apiLinkSchema>;
|
|
496
|
-
//# sourceMappingURL=apiLinksResponseSchema.d.ts.map
|
|
497
492
|
//#endregion
|
|
498
493
|
//#region src/schemas/errorSchema.d.ts
|
|
499
|
-
declare const errorSchema:
|
|
500
|
-
error:
|
|
501
|
-
status:
|
|
502
|
-
message:
|
|
503
|
-
details:
|
|
504
|
-
cause:
|
|
505
|
-
name:
|
|
506
|
-
message:
|
|
494
|
+
declare const errorSchema: _sinclair_typebox7.TObject<{
|
|
495
|
+
error: _sinclair_typebox7.TString;
|
|
496
|
+
status: _sinclair_typebox7.TNumber;
|
|
497
|
+
message: _sinclair_typebox7.TString;
|
|
498
|
+
details: _sinclair_typebox7.TOptional<_sinclair_typebox7.TString>;
|
|
499
|
+
cause: _sinclair_typebox7.TOptional<_sinclair_typebox7.TObject<{
|
|
500
|
+
name: _sinclair_typebox7.TString;
|
|
501
|
+
message: _sinclair_typebox7.TString;
|
|
507
502
|
}>>;
|
|
508
503
|
}>;
|
|
509
|
-
//# sourceMappingURL=errorSchema.d.ts.map
|
|
510
504
|
//#endregion
|
|
511
505
|
//#region src/schemas/okSchema.d.ts
|
|
512
|
-
declare const okSchema:
|
|
513
|
-
ok:
|
|
514
|
-
id:
|
|
515
|
-
count:
|
|
506
|
+
declare const okSchema: _sinclair_typebox7.TObject<{
|
|
507
|
+
ok: _sinclair_typebox7.TBoolean;
|
|
508
|
+
id: _sinclair_typebox7.TOptional<_sinclair_typebox7.TUnion<[_sinclair_typebox7.TString, _sinclair_typebox7.TInteger]>>;
|
|
509
|
+
count: _sinclair_typebox7.TOptional<_sinclair_typebox7.TNumber>;
|
|
516
510
|
}>;
|
|
517
511
|
type Ok = Static<typeof okSchema>;
|
|
518
|
-
//# sourceMappingURL=okSchema.d.ts.map
|
|
519
512
|
//#endregion
|
|
520
513
|
//#region src/providers/NodeHttpServerProvider.d.ts
|
|
521
|
-
declare const envSchema:
|
|
522
|
-
SERVER_PORT:
|
|
523
|
-
SERVER_HOST:
|
|
514
|
+
declare const envSchema: _alepha_core1.TObject<{
|
|
515
|
+
SERVER_PORT: _alepha_core1.TNumber;
|
|
516
|
+
SERVER_HOST: _alepha_core1.TString;
|
|
524
517
|
}>;
|
|
525
518
|
declare module "alepha" {
|
|
526
519
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -528,33 +521,32 @@ declare module "alepha" {
|
|
|
528
521
|
declare class NodeHttpServerProvider extends ServerProvider {
|
|
529
522
|
protected readonly alepha: Alepha;
|
|
530
523
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
531
|
-
protected readonly log:
|
|
524
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
532
525
|
protected readonly env: {
|
|
533
526
|
SERVER_PORT: number;
|
|
534
527
|
SERVER_HOST: string;
|
|
535
528
|
};
|
|
536
529
|
protected readonly router: ServerRouterProvider;
|
|
537
530
|
protected readonly server: http0.Server<typeof IncomingMessage, typeof ServerResponse$1>;
|
|
538
|
-
protected readonly onNodeRequest:
|
|
531
|
+
protected readonly onNodeRequest: _alepha_core1.HookDescriptor<"node:request">;
|
|
539
532
|
handle(req: IncomingMessage, res: ServerResponse$1): Promise<void>;
|
|
540
533
|
createRouterRequest(req: IncomingMessage, res: ServerResponse$1, params?: Record<string, string>): ServerRawRequest;
|
|
541
534
|
getProtocol(req: IncomingMessage): "http" | "https";
|
|
542
535
|
get hostname(): string;
|
|
543
|
-
readonly start:
|
|
544
|
-
protected readonly stop:
|
|
536
|
+
readonly start: _alepha_core1.HookDescriptor<"start">;
|
|
537
|
+
protected readonly stop: _alepha_core1.HookDescriptor<"stop">;
|
|
545
538
|
protected listen(): Promise<void>;
|
|
546
539
|
protected close(): Promise<void>;
|
|
547
540
|
}
|
|
548
541
|
//#endregion
|
|
549
542
|
//#region src/providers/ServerLoggerProvider.d.ts
|
|
550
543
|
declare class ServerLoggerProvider {
|
|
551
|
-
protected readonly log:
|
|
544
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
552
545
|
protected readonly alepha: Alepha;
|
|
553
|
-
readonly onRequest:
|
|
554
|
-
readonly onError:
|
|
555
|
-
readonly onResponse:
|
|
546
|
+
readonly onRequest: _alepha_core1.HookDescriptor<"server:onRequest">;
|
|
547
|
+
readonly onError: _alepha_core1.HookDescriptor<"server:onError">;
|
|
548
|
+
readonly onResponse: _alepha_core1.HookDescriptor<"server:onResponse">;
|
|
556
549
|
}
|
|
557
|
-
//# sourceMappingURL=ServerLoggerProvider.d.ts.map
|
|
558
550
|
//#endregion
|
|
559
551
|
//#region src/providers/ServerNotReadyProvider.d.ts
|
|
560
552
|
/**
|
|
@@ -565,22 +557,8 @@ declare class ServerLoggerProvider {
|
|
|
565
557
|
* The response also includes a `Retry-After` header indicating that the client should retry after 5 seconds.
|
|
566
558
|
*/
|
|
567
559
|
declare class ServerNotReadyProvider {
|
|
568
|
-
protected readonly alepha: Alepha;
|
|
569
|
-
readonly onRequest: _alepha_core10.HookDescriptor<"server:onRequest">;
|
|
570
|
-
}
|
|
571
|
-
//# sourceMappingURL=ServerNotReadyProvider.d.ts.map
|
|
572
|
-
//#endregion
|
|
573
|
-
//#region src/providers/ServerTimingProvider.d.ts
|
|
574
|
-
type TimingMap = Record<string, [number, number]>;
|
|
575
|
-
declare class ServerTimingProvider {
|
|
576
|
-
protected readonly log: _alepha_core1.Logger;
|
|
577
560
|
protected readonly alepha: Alepha;
|
|
578
561
|
readonly onRequest: _alepha_core1.HookDescriptor<"server:onRequest">;
|
|
579
|
-
readonly onResponse: _alepha_core1.HookDescriptor<"server:onResponse">;
|
|
580
|
-
protected get handlerName(): string;
|
|
581
|
-
beginTiming(name: string): void;
|
|
582
|
-
endTiming(name: string): void;
|
|
583
|
-
protected setDuration(name: string, timing: TimingMap): void;
|
|
584
562
|
}
|
|
585
563
|
//#endregion
|
|
586
564
|
//#region src/index.d.ts
|
|
@@ -648,9 +626,7 @@ declare module "alepha" {
|
|
|
648
626
|
* @see {@link $action}
|
|
649
627
|
* @module alepha.server
|
|
650
628
|
*/
|
|
651
|
-
declare const AlephaServer:
|
|
652
|
-
//# sourceMappingURL=index.d.ts.map
|
|
653
|
-
|
|
629
|
+
declare const AlephaServer: _alepha_core1.Service<_alepha_core1.Module>;
|
|
654
630
|
//#endregion
|
|
655
|
-
export { $action, $route, ActionDescriptor, ActionDescriptorOptions, AlephaServer,
|
|
631
|
+
export { $action, $route, ActionDescriptor, ActionDescriptorOptions, AlephaServer, BadRequestError, ClientRequestEntry, ClientRequestEntryContainer, ClientRequestOptions, ClientRequestResponse, ConflictError, FetchActionArgs, FetchOptions, FetchResponse, ForbiddenError, HttpAction, HttpClient, HttpClientPendingRequests, HttpError, HttpErrorLike, NodeHttpServerProvider, NotFoundError, Ok, RequestConfigSchema, ResponseBodyType, ResponseKind, RouteDescriptor, RouteDescriptorOptions, RouteMethod, ServerActionHandler, ServerActionRequest, ServerHandler, ServerLoggerProvider, ServerMiddlewareHandler, ServerNotReadyProvider, ServerProvider, ServerRawRequest, ServerReply, ServerRequest, ServerRequestConfig, ServerRequestConfigEntry, ServerResponse, ServerResponseBody, ServerRoute, ServerRouteMatcher, ServerRouterProvider, ServerTimingProvider, UnauthorizedError, ValidationError, errorNameByStatus, errorSchema, isHttpError, isMultipart, okSchema, routeMethods };
|
|
656
632
|
//# sourceMappingURL=index.d.ts.map
|
package/topic/redis.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _alepha_core1 from "alepha";
|
|
2
|
-
import * as _alepha_core0 from "alepha";
|
|
3
2
|
import { Alepha } from "alepha";
|
|
4
3
|
import { SubscribeCallback, TopicProvider, UnSubscribeFn } from "alepha/topic";
|
|
4
|
+
import * as _alepha_logger0 from "alepha/logger";
|
|
5
5
|
import { RedisProvider, RedisSubscriberProvider } from "alepha/redis";
|
|
6
6
|
|
|
7
7
|
//#region src/providers/RedisTopicProvider.d.ts
|
|
@@ -12,7 +12,7 @@ declare class RedisTopicProvider extends TopicProvider {
|
|
|
12
12
|
protected readonly alepha: Alepha;
|
|
13
13
|
protected readonly redisProvider: RedisProvider;
|
|
14
14
|
protected readonly redisSubscriberProvider: RedisSubscriberProvider;
|
|
15
|
-
protected readonly log:
|
|
15
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
16
16
|
protected readonly start: _alepha_core1.HookDescriptor<"start">;
|
|
17
17
|
prefix(queue: string): string;
|
|
18
18
|
/**
|
|
@@ -28,7 +28,6 @@ declare class RedisTopicProvider extends TopicProvider {
|
|
|
28
28
|
*/
|
|
29
29
|
unsubscribe(name: string, callback?: SubscribeCallback): Promise<void>;
|
|
30
30
|
}
|
|
31
|
-
//# sourceMappingURL=RedisTopicProvider.d.ts.map
|
|
32
31
|
//#endregion
|
|
33
32
|
//#region src/index.d.ts
|
|
34
33
|
/**
|
|
@@ -37,9 +36,7 @@ declare class RedisTopicProvider extends TopicProvider {
|
|
|
37
36
|
* @see {@link RedisTopicProvider}
|
|
38
37
|
* @module alepha.topic.redis
|
|
39
38
|
*/
|
|
40
|
-
declare const AlephaTopicRedis:
|
|
41
|
-
//# sourceMappingURL=index.d.ts.map
|
|
42
|
-
|
|
39
|
+
declare const AlephaTopicRedis: _alepha_core1.Service<_alepha_core1.Module>;
|
|
43
40
|
//#endregion
|
|
44
41
|
export { AlephaTopicRedis, RedisTopicProvider };
|
|
45
42
|
//# sourceMappingURL=index.d.ts.map
|
package/topic.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as _alepha_core1 from "alepha";
|
|
2
|
-
import * as _alepha_core2 from "alepha";
|
|
3
|
-
import * as _alepha_core0 from "alepha";
|
|
4
2
|
import { Alepha, Descriptor, KIND, Service, Static, TSchema } from "alepha";
|
|
5
3
|
import { DateTimeProvider, DurationLike } from "alepha/datetime";
|
|
4
|
+
import * as _alepha_logger0 from "alepha/logger";
|
|
6
5
|
|
|
7
6
|
//#region src/providers/TopicProvider.d.ts
|
|
8
7
|
/**
|
|
@@ -37,7 +36,6 @@ declare abstract class TopicProvider {
|
|
|
37
36
|
}
|
|
38
37
|
type SubscribeCallback = (message: string) => Promise<void> | void;
|
|
39
38
|
type UnSubscribeFn = () => Promise<void>;
|
|
40
|
-
//# sourceMappingURL=TopicProvider.d.ts.map
|
|
41
39
|
//#endregion
|
|
42
40
|
//#region src/descriptors/$topic.d.ts
|
|
43
41
|
/**
|
|
@@ -76,7 +74,7 @@ interface TopicDescriptorOptions<T extends TopicMessageSchema> {
|
|
|
76
74
|
handler?: TopicHandler<T>;
|
|
77
75
|
}
|
|
78
76
|
declare class TopicDescriptor<T extends TopicMessageSchema> extends Descriptor<TopicDescriptorOptions<T>> {
|
|
79
|
-
protected readonly log:
|
|
77
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
80
78
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
81
79
|
readonly provider: TopicProvider;
|
|
82
80
|
get name(): string;
|
|
@@ -100,7 +98,6 @@ interface TopicMessageSchema {
|
|
|
100
98
|
payload: TSchema;
|
|
101
99
|
}
|
|
102
100
|
type TopicHandler<T extends TopicMessageSchema = TopicMessageSchema> = (message: TopicMessage<T>) => unknown;
|
|
103
|
-
//# sourceMappingURL=$topic.d.ts.map
|
|
104
101
|
//#endregion
|
|
105
102
|
//#region src/descriptors/$subscriber.d.ts
|
|
106
103
|
/**
|
|
@@ -115,7 +112,6 @@ interface SubscriberDescriptorOptions<T extends TopicMessageSchema> {
|
|
|
115
112
|
handler: TopicHandler<T>;
|
|
116
113
|
}
|
|
117
114
|
declare class SubscriberDescriptor<T extends TopicMessageSchema> extends Descriptor<SubscriberDescriptorOptions<T>> {}
|
|
118
|
-
//# sourceMappingURL=$subscriber.d.ts.map
|
|
119
115
|
//#endregion
|
|
120
116
|
//#region src/errors/TopicTimeoutError.d.ts
|
|
121
117
|
declare class TopicTimeoutError extends Error {
|
|
@@ -123,13 +119,12 @@ declare class TopicTimeoutError extends Error {
|
|
|
123
119
|
readonly timeout: number;
|
|
124
120
|
constructor(topic: string, timeout: number);
|
|
125
121
|
}
|
|
126
|
-
//# sourceMappingURL=TopicTimeoutError.d.ts.map
|
|
127
122
|
//#endregion
|
|
128
123
|
//#region src/providers/MemoryTopicProvider.d.ts
|
|
129
124
|
declare class MemoryTopicProvider extends TopicProvider {
|
|
130
|
-
protected readonly log:
|
|
125
|
+
protected readonly log: _alepha_logger0.Logger;
|
|
131
126
|
protected readonly subscriptions: Record<string, SubscribeCallback[]>;
|
|
132
|
-
protected readonly start:
|
|
127
|
+
protected readonly start: _alepha_core1.HookDescriptor<"start">;
|
|
133
128
|
/**
|
|
134
129
|
* Publish a message to a topic.
|
|
135
130
|
*
|
|
@@ -151,7 +146,6 @@ declare class MemoryTopicProvider extends TopicProvider {
|
|
|
151
146
|
*/
|
|
152
147
|
unsubscribe(topic: string): Promise<void>;
|
|
153
148
|
}
|
|
154
|
-
//# sourceMappingURL=MemoryTopicProvider.d.ts.map
|
|
155
149
|
//#endregion
|
|
156
150
|
//#region src/index.d.ts
|
|
157
151
|
/**
|
|
@@ -163,9 +157,7 @@ declare class MemoryTopicProvider extends TopicProvider {
|
|
|
163
157
|
* @see {@link $subscriber}
|
|
164
158
|
* @module alepha.topic
|
|
165
159
|
*/
|
|
166
|
-
declare const AlephaTopic:
|
|
167
|
-
//# sourceMappingURL=index.d.ts.map
|
|
168
|
-
|
|
160
|
+
declare const AlephaTopic: _alepha_core1.Service<_alepha_core1.Module>;
|
|
169
161
|
//#endregion
|
|
170
162
|
export { $subscriber, $topic, AlephaTopic, MemoryTopicProvider, SubscribeCallback, SubscriberDescriptor, SubscriberDescriptorOptions, TopicDescriptor, TopicDescriptorOptions, TopicHandler, TopicMessage, TopicMessageSchema, TopicProvider, TopicTimeoutError, TopicWaitOptions, UnSubscribeFn };
|
|
171
163
|
//# sourceMappingURL=index.d.ts.map
|
package/vite.d.ts
CHANGED
|
@@ -34,7 +34,6 @@ interface ViteCompressOptions {
|
|
|
34
34
|
}
|
|
35
35
|
declare function viteCompress(options?: ViteCompressOptions): Plugin;
|
|
36
36
|
declare function compressFile(options: ViteCompressOptions | undefined, filePath: string): Promise<void>;
|
|
37
|
-
//# sourceMappingURL=viteCompress.d.ts.map
|
|
38
37
|
//#endregion
|
|
39
38
|
//#region src/helpers/buildClient.d.ts
|
|
40
39
|
interface BuildClientOptions {
|
|
@@ -91,13 +90,16 @@ interface VercelConfig {
|
|
|
91
90
|
projectName?: string;
|
|
92
91
|
orgId?: string;
|
|
93
92
|
projectId?: string;
|
|
93
|
+
crons?: Array<{
|
|
94
|
+
path: string;
|
|
95
|
+
schedule: string;
|
|
96
|
+
}>;
|
|
94
97
|
}
|
|
95
98
|
declare function viteAlephaBuildVercel(opts?: ViteAlephaBuildVercelOptions): Promise<{
|
|
96
99
|
name: string;
|
|
97
100
|
apply: string;
|
|
98
101
|
writeBundle(): void;
|
|
99
102
|
}>;
|
|
100
|
-
//# sourceMappingURL=viteAlephaBuildVercel.d.ts.map
|
|
101
103
|
//#endregion
|
|
102
104
|
//#region src/viteAlephaBuild.d.ts
|
|
103
105
|
interface ViteAlephaBuildOptions {
|
|
@@ -126,7 +128,6 @@ interface ViteAlephaBuildOptions {
|
|
|
126
128
|
docker?: boolean | ViteAlephaBuildDockerOptions;
|
|
127
129
|
}
|
|
128
130
|
declare function viteAlephaBuild(options?: ViteAlephaBuildOptions): Promise<Plugin>;
|
|
129
|
-
//# sourceMappingURL=viteAlephaBuild.d.ts.map
|
|
130
131
|
//#endregion
|
|
131
132
|
//#region src/viteAlephaDev.d.ts
|
|
132
133
|
interface ViteAlephaDevOptions {
|
|
@@ -141,24 +142,21 @@ interface ViteAlephaDevOptions {
|
|
|
141
142
|
* @default false
|
|
142
143
|
*/
|
|
143
144
|
debug?: boolean;
|
|
145
|
+
onReload?: () => void;
|
|
144
146
|
}
|
|
145
147
|
/**
|
|
146
148
|
* Plug Alepha into Vite development server.
|
|
147
149
|
*/
|
|
148
150
|
declare function viteAlephaDev(options?: ViteAlephaDevOptions): Promise<Plugin>;
|
|
149
|
-
//# sourceMappingURL=viteAlephaDev.d.ts.map
|
|
150
151
|
//#endregion
|
|
151
152
|
//#region src/viteAlepha.d.ts
|
|
152
153
|
type ViteAlephaOptions = ViteAlephaDevOptions & ViteAlephaBuildOptions;
|
|
153
154
|
declare function viteAlepha(options?: ViteAlephaOptions): (Plugin | Promise<Plugin>)[];
|
|
154
|
-
//# sourceMappingURL=viteAlepha.d.ts.map
|
|
155
155
|
//#endregion
|
|
156
156
|
//#region src/index.d.ts
|
|
157
157
|
declare global {
|
|
158
158
|
var __alepha: Alepha;
|
|
159
159
|
}
|
|
160
|
-
//# sourceMappingURL=index.d.ts.map
|
|
161
|
-
|
|
162
160
|
//#endregion
|
|
163
161
|
export { VercelConfig, ViteAlephaBuildOptions, ViteAlephaBuildVercelOptions, ViteAlephaDevOptions, ViteAlephaOptions, ViteCompressOptions, compressFile, viteAlepha, viteAlephaBuild, viteAlephaBuildVercel, viteAlephaDev, viteCompress };
|
|
164
162
|
//# sourceMappingURL=index.d.ts.map
|