alepha 0.7.7 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,18 @@
1
- import * as _alepha_core0 from "@alepha/core";
2
- import { Alepha, KIND, Module, OPTIONS, TObject } from "@alepha/core";
3
- import { ServerActionDescriptorProvider, ServerRouteAction, ServerRouterProvider } from "@alepha/server";
4
- import { ServerStaticProvider } from "@alepha/server-static";
1
+ import { Alepha, HookDescriptor, KIND, Module, OPTIONS, TObject } from "alepha";
2
+ import { ServerActionDescriptorProvider, ServerRouteAction, ServerRouterProvider } from "alepha/server";
3
+ import { ServerStaticProvider } from "alepha/server/static";
5
4
  import { OpenAPIV3 } from "openapi-types";
6
5
 
7
6
  //#region src/descriptors/$swagger.d.ts
8
7
  interface SwaggerDescriptorOptions {
9
8
  info: OpenAPIV3.InfoObject;
10
9
  /**
11
- * @default: "/docs"
12
- */
10
+ * @default: "/docs"
11
+ */
13
12
  prefix?: string;
14
13
  /**
15
- * If true, docs will be disabled.
16
- */
14
+ * If true, docs will be disabled.
15
+ */
17
16
  disabled?: boolean;
18
17
  excludeTags?: string[];
19
18
  ui?: boolean | SwaggerUiOptions;
@@ -23,53 +22,53 @@ interface SwaggerUiOptions {
23
22
  root?: string;
24
23
  initOAuth?: {
25
24
  /**
26
- * Default clientId.
27
- */
25
+ * Default clientId.
26
+ */
28
27
  clientId?: string;
29
28
  /**
30
- * realm query parameter (for oauth1) added to authorizationUrl and tokenUrl.
31
- */
29
+ * realm query parameter (for oauth1) added to authorizationUrl and tokenUrl.
30
+ */
32
31
  realm?: string;
33
32
  /**
34
- * application name, displayed in authorization popup.
35
- */
33
+ * application name, displayed in authorization popup.
34
+ */
36
35
  appName?: string;
37
36
  /**
38
- * scope separator for passing scopes, encoded before calling, default
39
- * value is a space (encoded value %20).
40
- *
41
- * @default ' '
42
- */
37
+ * scope separator for passing scopes, encoded before calling, default
38
+ * value is a space (encoded value %20).
39
+ *
40
+ * @default ' '
41
+ */
43
42
  scopeSeparator?: string;
44
43
  /**
45
- * string array or scope separator (i.e. space) separated string of
46
- * initially selected oauth scopes
47
- *
48
- * @default []
49
- */
44
+ * string array or scope separator (i.e. space) separated string of
45
+ * initially selected oauth scopes
46
+ *
47
+ * @default []
48
+ */
50
49
  scopes?: string | string[];
51
50
  /**
52
- * Additional query parameters added to authorizationUrl and tokenUrl.
53
- * MUST be an object
54
- */
51
+ * Additional query parameters added to authorizationUrl and tokenUrl.
52
+ * MUST be an object
53
+ */
55
54
  additionalQueryStringParams?: {
56
55
  [key: string]: any;
57
56
  };
58
57
  /**
59
- * Only activated for the accessCode flow. During the authorization_code
60
- * request to the tokenUrl, pass the Client Password using the HTTP Basic
61
- * Authentication scheme (Authorization header with Basic
62
- * base64encode(client_id + client_secret)).
63
- *
64
- * @default false
65
- */
58
+ * Only activated for the accessCode flow. During the authorization_code
59
+ * request to the tokenUrl, pass the Client Password using the HTTP Basic
60
+ * Authentication scheme (Authorization header with Basic
61
+ * base64encode(client_id + client_secret)).
62
+ *
63
+ * @default false
64
+ */
66
65
  useBasicAuthenticationWithAccessCodeGrant?: boolean;
67
66
  /**
68
- * Only applies to Authorization Code flows. Proof Key for Code Exchange
69
- * brings enhanced security for OAuth public clients.
70
- *
71
- * @default false
72
- */
67
+ * Only applies to Authorization Code flows. Proof Key for Code Exchange
68
+ * brings enhanced security for OAuth public clients.
69
+ *
70
+ * @default false
71
+ */
73
72
  usePkceWithAuthorizationCodeGrant?: boolean;
74
73
  };
75
74
  }
@@ -89,8 +88,8 @@ declare class ServerSwaggerProvider {
89
88
  protected readonly serverStaticProvider: ServerStaticProvider;
90
89
  protected readonly serverRouterProvider: ServerRouterProvider;
91
90
  protected readonly alepha: Alepha;
92
- protected readonly configure: _alepha_core0.HookDescriptor<"configure">;
93
- protected configureOpenApi(doc: SwaggerDescriptorOptions): any;
91
+ protected readonly configure: HookDescriptor<"configure">;
92
+ protected configureOpenApi(doc: SwaggerDescriptorOptions): OpenAPIV3.Document;
94
93
  isBodyMultipart(schema: TObject): boolean;
95
94
  replacePathParams(url: string): string;
96
95
  getResponseSchema(route: ServerRouteAction): {
@@ -103,16 +102,17 @@ declare class ServerSwaggerProvider {
103
102
  }
104
103
  //#endregion
105
104
  //#region src/index.d.ts
105
+ // ---------------------------------------------------------------------------------------------------------------------
106
106
  /**
107
- * Alepha Server Swagger Module
108
- *
109
- * Plugin for Alepha Server that provides Swagger documentation capabilities.
110
- * It generates OpenAPI v3 documentation for the server's endpoints ($action).
111
- * It also provides a Swagger UI for interactive API documentation.
112
- *
113
- * @see {@link ServerSwaggerProvider}
114
- * @module alepha.server.swagger
115
- */
107
+ * Alepha Server Swagger Module
108
+ *
109
+ * Plugin for Alepha Server that provides Swagger documentation capabilities.
110
+ * It generates OpenAPI v3 documentation for the server's endpoints ($action).
111
+ * It also provides a Swagger UI for interactive API documentation.
112
+ *
113
+ * @see {@link ServerSwaggerProvider}
114
+ * @module alepha.server.swagger
115
+ */
116
116
  declare class AlephaServerSwagger implements Module {
117
117
  readonly name = "alepha.server.swagger";
118
118
  readonly $services: (alepha: Alepha) => Alepha;
package/server.d.ts CHANGED
@@ -1,30 +1,27 @@
1
- import * as _alepha_core1 from "@alepha/core";
2
- import * as _alepha_core3 from "@alepha/core";
3
- import * as _alepha_core7 from "@alepha/core";
4
- import * as _alepha_core9 from "@alepha/core";
5
- import * as _alepha_core71 from "@alepha/core";
6
- import * as _alepha_core10 from "@alepha/core";
7
- import * as _alepha_core15 from "@alepha/core";
8
- import * as _alepha_core23 from "@alepha/core";
9
- import { Alepha, Async, FileLike, KIND, KIND as KIND$1, Module, OPTIONS, Static, StreamLike, TObject, TSchema } from "@alepha/core";
10
- import { JwtProvider, Permission, SecurityProvider, ServiceAccountDescriptor, UserAccountToken } from "@alepha/security";
11
- import { BusboyConfig } from "@fastify/busboy";
12
- import * as _alepha_cache2 from "@alepha/cache";
1
+ import * as _alepha_core1 from "alepha";
2
+ import * as _alepha_core3 from "alepha";
3
+ import * as _alepha_core7 from "alepha";
4
+ import * as _alepha_core8 from "alepha";
5
+ import * as _alepha_core12 from "alepha";
6
+ import * as _alepha_core15 from "alepha";
7
+ import * as _alepha_core24 from "alepha";
8
+ import { Alepha, Async, FileLike, KIND, Module, OPTIONS, Static, StreamLike, TObject, TSchema } from "alepha";
9
+ import { JwtProvider, Permission, SecurityProvider, ServiceAccountDescriptor, UserAccountToken } from "alepha/security";
10
+ import * as _alepha_cache2 from "alepha/cache";
13
11
  import { Readable } from "node:stream";
14
12
  import { ReadableStream } from "node:stream/web";
15
- import { Route, RouterProvider } from "@alepha/router";
13
+ import { Route, RouterProvider } from "alepha/router";
16
14
  import { IncomingMessage, ServerResponse as ServerResponse$1 } from "node:http";
17
- import { DurationLike } from "@alepha/datetime";
18
- import * as _sinclair_typebox13 from "@sinclair/typebox";
19
- import * as _sinclair_typebox37 from "@sinclair/typebox";
20
- import * as _sinclair_typebox21 from "@sinclair/typebox";
21
- import * as _sinclair_typebox27 from "@sinclair/typebox";
22
- import * as _sinclair_typebox63 from "@sinclair/typebox";
23
- import * as http18 from "http";
15
+ import { DurationLike } from "alepha/datetime";
16
+ import * as _sinclair_typebox38 from "@sinclair/typebox";
17
+ import * as _sinclair_typebox64 from "@sinclair/typebox";
18
+ import * as _sinclair_typebox30 from "@sinclair/typebox";
19
+ import * as http20 from "http";
24
20
 
25
21
  //#region src/constants/routeMethods.d.ts
26
22
  declare const routeMethods: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "CONNECT", "TRACE"];
27
23
  type RouteMethod = (typeof routeMethods)[number];
24
+ //# sourceMappingURL=routeMethods.d.ts.map
28
25
  //#endregion
29
26
  //#region src/helpers/ServerReply.d.ts
30
27
  declare class ServerReply {
@@ -37,6 +34,7 @@ declare class ServerReply {
37
34
  setStatus(status: number): void;
38
35
  setHeader(name: string, value: string): void;
39
36
  }
37
+ //# sourceMappingURL=ServerReply.d.ts.map
40
38
  //#endregion
41
39
  //#region src/interfaces/index.d.ts
42
40
  interface RequestConfigSchema {
@@ -111,6 +109,7 @@ type ServerRouteSecure = boolean | {
111
109
  realms?: string[];
112
110
  organizations?: string[];
113
111
  };
112
+ //# sourceMappingURL=index.d.ts.map
114
113
  //#endregion
115
114
  //#region src/helpers/ActionDescriptorHelper.d.ts
116
115
  declare class ActionDescriptorHelper {
@@ -129,6 +128,7 @@ declare class ActionDescriptorHelper {
129
128
  protected short(name: string): string;
130
129
  fetchLinks(_url: string): void;
131
130
  }
131
+ //# sourceMappingURL=ActionDescriptorHelper.d.ts.map
132
132
  //#endregion
133
133
  //#region src/services/HttpClient.d.ts
134
134
  declare class HttpClient {
@@ -271,7 +271,7 @@ interface ActionDescriptorOptions<TConfig extends RequestConfigSchema = RequestC
271
271
  handler?: ServerHandler<TConfig>;
272
272
  }
273
273
  interface ActionDescriptor<TConfig extends RequestConfigSchema = RequestConfigSchema> {
274
- [KIND$1]: typeof KEY$1;
274
+ [KIND]: typeof KEY$1;
275
275
  [OPTIONS]: ActionDescriptorOptions<TConfig>;
276
276
  /**
277
277
  * Fetch or just call local route when available.
@@ -288,7 +288,7 @@ interface ActionDescriptor<TConfig extends RequestConfigSchema = RequestConfigSc
288
288
  }
289
289
  declare const $action: {
290
290
  <TConfig extends RequestConfigSchema>(options: ActionDescriptorOptions<TConfig>): ActionDescriptor<TConfig>;
291
- [KIND$1]: string;
291
+ [KIND]: string;
292
292
  };
293
293
  type ClientRequestEntry<TConfig extends RequestConfigSchema = RequestConfigSchema, T = ClientRequestEntryContainer<TConfig>> = { [K in keyof T as T[K] extends undefined ? never : K]: T[K] };
294
294
  type ClientRequestEntryContainer<TConfig extends RequestConfigSchema = RequestConfigSchema> = {
@@ -350,48 +350,101 @@ declare const isHttpError: (error: unknown) => error is HttpErrorLike;
350
350
  interface HttpErrorLike extends Error {
351
351
  status: number;
352
352
  }
353
+ //# sourceMappingURL=HttpError.d.ts.map
353
354
  //#endregion
354
355
  //#region src/descriptors/$route.d.ts
355
356
  declare const KEY = "ROUTE";
356
357
  interface RouteDescriptorOptions<TConfig extends RequestConfigSchema = RequestConfigSchema> extends ServerRoute<TConfig> {}
357
358
  type RouteDescriptor<TConfig extends RequestConfigSchema = RequestConfigSchema> = {
358
- [KIND$1]: typeof KEY;
359
+ [KIND]: typeof KEY;
359
360
  [OPTIONS]: RouteDescriptorOptions<TConfig>;
360
361
  };
361
362
  declare const $route: {
362
363
  <TConfig extends RequestConfigSchema = RequestConfigSchema>(options: RouteDescriptorOptions<TConfig>): RouteDescriptor<TConfig>;
363
- [KIND$1]: string;
364
+ [KIND]: string;
364
365
  };
365
366
  //#endregion
366
367
  //#region src/errors/BadRequestError.d.ts
367
368
  declare class BadRequestError extends HttpError {
368
369
  constructor(message?: string, cause?: unknown);
369
370
  }
371
+ //# sourceMappingURL=BadRequestError.d.ts.map
370
372
  //#endregion
371
373
  //#region src/errors/ConflictError.d.ts
372
374
  declare class ConflictError extends HttpError {
373
375
  constructor(message?: string, cause?: unknown);
374
376
  }
377
+ //# sourceMappingURL=ConflictError.d.ts.map
375
378
  //#endregion
376
379
  //#region src/errors/ForbiddenError.d.ts
377
380
  declare class ForbiddenError extends HttpError {
378
381
  constructor(message?: string, cause?: unknown);
379
382
  }
383
+ //# sourceMappingURL=ForbiddenError.d.ts.map
380
384
  //#endregion
381
385
  //#region src/errors/NotFoundError.d.ts
382
386
  declare class NotFoundError extends HttpError {
383
387
  constructor(message?: string, cause?: unknown);
384
388
  }
389
+ //# sourceMappingURL=NotFoundError.d.ts.map
385
390
  //#endregion
386
391
  //#region src/errors/UnauthorizedError.d.ts
387
392
  declare class UnauthorizedError extends HttpError {
388
393
  constructor(message?: string, cause?: unknown);
389
394
  }
395
+ //# sourceMappingURL=UnauthorizedError.d.ts.map
390
396
  //#endregion
391
397
  //#region src/errors/ValidationError.d.ts
392
398
  declare class ValidationError extends HttpError {
393
399
  constructor(message?: string, cause?: unknown);
394
400
  }
401
+ //# sourceMappingURL=ValidationError.d.ts.map
402
+ //#endregion
403
+ //#region src/schemas/apiLinksResponseSchema.d.ts
404
+ declare const apiLinkSchema: _sinclair_typebox38.TObject<{
405
+ name: _sinclair_typebox38.TString;
406
+ path: _sinclair_typebox38.TString;
407
+ method: _sinclair_typebox38.TOptional<_sinclair_typebox38.TString>;
408
+ group: _sinclair_typebox38.TOptional<_sinclair_typebox38.TString>;
409
+ requestBodyType: _sinclair_typebox38.TOptional<_sinclair_typebox38.TString>;
410
+ service: _sinclair_typebox38.TOptional<_sinclair_typebox38.TString>;
411
+ }>;
412
+ declare const apiLinksResponseSchema: _sinclair_typebox38.TObject<{
413
+ prefix: _sinclair_typebox38.TOptional<_sinclair_typebox38.TString>;
414
+ links: _sinclair_typebox38.TArray<_sinclair_typebox38.TObject<{
415
+ name: _sinclair_typebox38.TString;
416
+ path: _sinclair_typebox38.TString;
417
+ method: _sinclair_typebox38.TOptional<_sinclair_typebox38.TString>;
418
+ group: _sinclair_typebox38.TOptional<_sinclair_typebox38.TString>;
419
+ requestBodyType: _sinclair_typebox38.TOptional<_sinclair_typebox38.TString>;
420
+ service: _sinclair_typebox38.TOptional<_sinclair_typebox38.TString>;
421
+ }>>;
422
+ }>;
423
+ type ApiLinksResponse = Static<typeof apiLinksResponseSchema>;
424
+ type ApiLink = Static<typeof apiLinkSchema>;
425
+ //# sourceMappingURL=apiLinksResponseSchema.d.ts.map
426
+ //#endregion
427
+ //#region src/schemas/errorSchema.d.ts
428
+ declare const errorSchema: _sinclair_typebox64.TObject<{
429
+ error: _sinclair_typebox64.TString;
430
+ status: _sinclair_typebox64.TNumber;
431
+ message: _sinclair_typebox64.TString;
432
+ details: _sinclair_typebox64.TOptional<_sinclair_typebox64.TString>;
433
+ cause: _sinclair_typebox64.TOptional<_sinclair_typebox64.TObject<{
434
+ name: _sinclair_typebox64.TString;
435
+ message: _sinclair_typebox64.TString;
436
+ }>>;
437
+ }>;
438
+ //# sourceMappingURL=errorSchema.d.ts.map
439
+ //#endregion
440
+ //#region src/schemas/okSchema.d.ts
441
+ declare const okSchema: _sinclair_typebox30.TObject<{
442
+ ok: _sinclair_typebox30.TBoolean;
443
+ id: _sinclair_typebox30.TOptional<_sinclair_typebox30.TUnion<[_sinclair_typebox30.TString, _sinclair_typebox30.TInteger]>>;
444
+ count: _sinclair_typebox30.TOptional<_sinclair_typebox30.TNumber>;
445
+ }>;
446
+ type Ok = Static<typeof okSchema>;
447
+ //# sourceMappingURL=okSchema.d.ts.map
395
448
  //#endregion
396
449
  //#region src/providers/features/ServerLoggerProvider.d.ts
397
450
  declare class ServerLoggerProvider {
@@ -401,31 +454,7 @@ declare class ServerLoggerProvider {
401
454
  readonly onError: _alepha_core3.HookDescriptor<"server:onError">;
402
455
  readonly onResponse: _alepha_core3.HookDescriptor<"server:onResponse">;
403
456
  }
404
- //#endregion
405
- //#region src/providers/features/ServerMultipartProvider.d.ts
406
- declare class ServerMultipartProvider {
407
- protected readonly helper: ActionDescriptorHelper;
408
- protected readonly alepha: Alepha;
409
- readonly onRequest: _alepha_core7.HookDescriptor<"server:onRequest">;
410
- readonly onSend: _alepha_core7.HookDescriptor<"server:onResponse">;
411
- handleMultipartBodyFromNode(route: ServerRoute, stream: IncomingMessage): Promise<{
412
- body: Record<string, any>;
413
- cleanup: () => Promise<void>;
414
- }>;
415
- parseMultipart(req: IncomingMessage, config?: Omit<BusboyConfig, "headers">): Promise<MultipartResult>;
416
- }
417
- interface MultipartResult {
418
- fields: Record<string, string | string[]>;
419
- files: Record<string, HybridFile>;
420
- }
421
- interface HybridFile extends FileLike {
422
- cleanup(): Promise<void>;
423
- _state: {
424
- cleanup: boolean;
425
- size: number;
426
- tmpPath: string;
427
- };
428
- }
457
+ //# sourceMappingURL=ServerLoggerProvider.d.ts.map
429
458
  //#endregion
430
459
  //#region src/providers/features/ServerNotReadyProvider.d.ts
431
460
  /**
@@ -437,27 +466,29 @@ interface HybridFile extends FileLike {
437
466
  */
438
467
  declare class ServerNotReadyProvider {
439
468
  protected readonly alepha: Alepha;
440
- readonly onRequest: _alepha_core9.HookDescriptor<"server:onRequest">;
469
+ readonly onRequest: _alepha_core7.HookDescriptor<"server:onRequest">;
441
470
  }
471
+ //# sourceMappingURL=ServerNotReadyProvider.d.ts.map
442
472
  //#endregion
443
473
  //#region src/providers/features/ServerSecurityProvider.d.ts
444
474
  declare class ServerSecurityProvider {
445
- protected readonly log: _alepha_core71.Logger;
475
+ protected readonly log: _alepha_core8.Logger;
446
476
  protected readonly securityProvider: SecurityProvider;
447
477
  protected readonly jwtProvider: JwtProvider;
448
478
  protected readonly alepha: Alepha;
449
- readonly onClientRequest: _alepha_core71.HookDescriptor<"client:onRequest">;
450
- protected readonly onRequest: _alepha_core71.HookDescriptor<"server:onRequest">;
451
- protected readonly onRoute: _alepha_core71.HookDescriptor<"server:onRoute">;
479
+ readonly onClientRequest: _alepha_core8.HookDescriptor<"client:onRequest">;
480
+ protected readonly onRequest: _alepha_core8.HookDescriptor<"server:onRequest">;
481
+ protected readonly onRoute: _alepha_core8.HookDescriptor<"server:onRoute">;
452
482
  }
483
+ //# sourceMappingURL=ServerSecurityProvider.d.ts.map
453
484
  //#endregion
454
485
  //#region src/providers/features/ServerTimingProvider.d.ts
455
486
  type TimingMap = Record<string, [number, number]>;
456
487
  declare class ServerTimingProvider {
457
- protected readonly log: _alepha_core10.Logger;
488
+ protected readonly log: _alepha_core12.Logger;
458
489
  protected readonly alepha: Alepha;
459
- readonly onRequest: _alepha_core10.HookDescriptor<"server:onRequest">;
460
- readonly onResponse: _alepha_core10.HookDescriptor<"server:onResponse">;
490
+ readonly onRequest: _alepha_core12.HookDescriptor<"server:onRequest">;
491
+ readonly onResponse: _alepha_core12.HookDescriptor<"server:onResponse">;
461
492
  protected get handlerName(): string;
462
493
  beginTiming(name: string): void;
463
494
  endTiming(name: string): void;
@@ -491,22 +522,25 @@ declare class ServerRouterProvider extends RouterProvider<ServerRouteWithHandler
491
522
  }, request: ServerRequestConfig): void;
492
523
  serializeResponse(route: ServerRoute, reply: ServerReply, responseKind: ResponseKind): void;
493
524
  }
525
+ //# sourceMappingURL=ServerRouterProvider.d.ts.map
494
526
  //#endregion
495
527
  //#region src/providers/platforms/ServerProvider.d.ts
496
- declare class ServerProvider {
497
- constructor();
498
- get hostname(): string;
528
+ declare abstract class ServerProvider {
529
+ protected readonly alepha: Alepha;
530
+ abstract get hostname(): string;
531
+ protected isViteNotFound(url?: string, route?: Route, params?: Record<string, string>): boolean;
499
532
  }
533
+ //# sourceMappingURL=ServerProvider.d.ts.map
500
534
  //#endregion
501
535
  //#region src/providers/platforms/NodeHttpServerProvider.d.ts
502
536
  declare const envSchema$1: _alepha_core15.TObject<{
503
- SERVER_PORT: _sinclair_typebox13.TNumber;
504
- SERVER_HOST: _sinclair_typebox13.TString;
537
+ SERVER_PORT: _alepha_core15.TNumber;
538
+ SERVER_HOST: _alepha_core15.TString;
505
539
  }>;
506
540
  declare module "alepha" {
507
541
  interface Env extends Partial<Static<typeof envSchema$1>> {}
508
542
  }
509
- declare class NodeHttpServerProvider implements ServerProvider {
543
+ declare class NodeHttpServerProvider extends ServerProvider {
510
544
  protected readonly alepha: Alepha;
511
545
  protected readonly log: _alepha_core15.Logger;
512
546
  protected readonly env: {
@@ -514,11 +548,11 @@ declare class NodeHttpServerProvider implements ServerProvider {
514
548
  SERVER_HOST: string;
515
549
  };
516
550
  protected readonly router: ServerRouterProvider;
517
- protected readonly server: http18.Server<typeof IncomingMessage, typeof ServerResponse$1>;
518
- handle(req: IncomingMessage, res: ServerResponse$1): Promise<number | void>;
551
+ protected readonly server: http20.Server<typeof IncomingMessage, typeof ServerResponse$1>;
552
+ protected readonly onNodeRequest: _alepha_core15.HookDescriptor<"node:request">;
553
+ handle(req: IncomingMessage, res: ServerResponse$1): Promise<void>;
519
554
  createRouterRequest(req: IncomingMessage, res: ServerResponse$1, params?: Record<string, string>): ServerRawRequest;
520
555
  getProtocol(req: IncomingMessage): "http" | "https";
521
- shouldHaveBody(method: string): boolean;
522
556
  get hostname(): string;
523
557
  readonly start: _alepha_core15.HookDescriptor<"start">;
524
558
  protected readonly stop: _alepha_core15.HookDescriptor<"stop">;
@@ -526,35 +560,12 @@ declare class NodeHttpServerProvider implements ServerProvider {
526
560
  protected close(): Promise<void>;
527
561
  }
528
562
  //#endregion
529
- //#region src/schemas/apiLinksResponseSchema.d.ts
530
- declare const apiLinkSchema: _sinclair_typebox37.TObject<{
531
- name: _sinclair_typebox37.TString;
532
- path: _sinclair_typebox37.TString;
533
- method: _sinclair_typebox37.TOptional<_sinclair_typebox37.TString>;
534
- group: _sinclair_typebox37.TOptional<_sinclair_typebox37.TString>;
535
- requestBodyType: _sinclair_typebox37.TOptional<_sinclair_typebox37.TString>;
536
- service: _sinclair_typebox37.TOptional<_sinclair_typebox37.TString>;
537
- }>;
538
- declare const apiLinksResponseSchema: _sinclair_typebox37.TObject<{
539
- prefix: _sinclair_typebox37.TOptional<_sinclair_typebox37.TString>;
540
- links: _sinclair_typebox37.TArray<_sinclair_typebox37.TObject<{
541
- name: _sinclair_typebox37.TString;
542
- path: _sinclair_typebox37.TString;
543
- method: _sinclair_typebox37.TOptional<_sinclair_typebox37.TString>;
544
- group: _sinclair_typebox37.TOptional<_sinclair_typebox37.TString>;
545
- requestBodyType: _sinclair_typebox37.TOptional<_sinclair_typebox37.TString>;
546
- service: _sinclair_typebox37.TOptional<_sinclair_typebox37.TString>;
547
- }>>;
548
- }>;
549
- type ApiLinksResponse = Static<typeof apiLinksResponseSchema>;
550
- type ApiLink = Static<typeof apiLinkSchema>;
551
- //#endregion
552
563
  //#region src/providers/ServerActionDescriptorProvider.d.ts
553
- declare const envSchema: _alepha_core23.TObject<{
554
- SERVER_API_PREFIX: _sinclair_typebox21.TString;
555
- SERVER_SECURITY_ENABLED: _sinclair_typebox21.TBoolean;
564
+ declare const envSchema: _alepha_core24.TObject<{
565
+ SERVER_API_PREFIX: _alepha_core24.TString;
566
+ SERVER_SECURITY_ENABLED: _alepha_core24.TBoolean;
556
567
  }>;
557
- declare module "alepha/core" {
568
+ declare module "alepha" {
558
569
  interface Env extends Partial<Static<typeof envSchema>> {}
559
570
  interface State {
560
571
  /**
@@ -566,7 +577,7 @@ declare module "alepha/core" {
566
577
  }
567
578
  }
568
579
  declare class ServerActionDescriptorProvider {
569
- protected readonly log: _alepha_core23.Logger;
580
+ protected readonly log: _alepha_core24.Logger;
570
581
  protected readonly alepha: Alepha;
571
582
  protected readonly env: {
572
583
  SERVER_API_PREFIX: string;
@@ -579,7 +590,7 @@ declare class ServerActionDescriptorProvider {
579
590
  protected readonly actions: ServerRouteAction[];
580
591
  getActions(): ServerRouteAction<RequestConfigSchema>[];
581
592
  getPrefix(): string;
582
- readonly configure: _alepha_core23.HookDescriptor<"configure">;
593
+ readonly configure: _alepha_core24.HookDescriptor<"configure">;
583
594
  registerAction(value: ActionDescriptor, key: string, instance: any, prefix?: string): Promise<void>;
584
595
  /**
585
596
  * Check a mock function for the specified route.
@@ -622,29 +633,13 @@ interface ServerRouteAction<TConfig extends RequestConfigSchema = RequestConfigS
622
633
  }
623
634
  type LocalHandler<TConfig extends RequestConfigSchema = RequestConfigSchema> = (config?: ServerRequestConfigEntry<TConfig>, options?: ClientRequestOptions) => Promise<any>;
624
635
  //#endregion
625
- //#region src/schemas/errorSchema.d.ts
626
- declare const errorSchema: _sinclair_typebox27.TObject<{
627
- error: _sinclair_typebox27.TString;
628
- status: _sinclair_typebox27.TNumber;
629
- message: _sinclair_typebox27.TString;
630
- details: _sinclair_typebox27.TOptional<_sinclair_typebox27.TString>;
631
- cause: _sinclair_typebox27.TOptional<_sinclair_typebox27.TObject<{
632
- name: _sinclair_typebox27.TString;
633
- message: _sinclair_typebox27.TString;
634
- }>>;
635
- }>;
636
- //#endregion
637
- //#region src/schemas/okSchema.d.ts
638
- declare const okSchema: _sinclair_typebox63.TObject<{
639
- ok: _sinclair_typebox63.TBoolean;
640
- id: _sinclair_typebox63.TOptional<_sinclair_typebox63.TUnion<[_sinclair_typebox63.TString, _sinclair_typebox63.TInteger]>>;
641
- count: _sinclair_typebox63.TOptional<_sinclair_typebox63.TNumber>;
642
- }>;
643
- type Ok = Static<typeof okSchema>;
644
- //#endregion
645
636
  //#region src/index.d.ts
646
- declare module "@alepha/core" {
637
+ declare module "alepha" {
647
638
  interface Hooks {
639
+ "node:request": {
640
+ req: IncomingMessage;
641
+ res: ServerResponse$1;
642
+ };
648
643
  "server:onRoute": {
649
644
  route: ServerRoute;
650
645
  };
@@ -688,6 +683,8 @@ declare class AlephaServer implements Module {
688
683
  readonly name = "alepha.server";
689
684
  readonly $services: (alepha: Alepha) => void;
690
685
  }
686
+ //# sourceMappingURL=index.d.ts.map
687
+
691
688
  //#endregion
692
- export { $action, $route, ActionDescriptor, ActionDescriptorHelper, ActionDescriptorOptions, AlephaServer, ApiLink, ApiLinksResponse, BadRequestError, ClientRequestEntry, ClientRequestEntryContainer, ClientRequestOptions, ClientRequestResponse, ConflictError, FetchActionArgs, FetchOptions, FetchResponse, ForbiddenError, HttpAction, HttpClient, HttpClientPendingRequests, HttpError, HttpErrorLike, KIND, LocalHandler, NodeHttpServerProvider, NotFoundError, Ok, RequestConfigSchema, ResponseBodyType, ResponseKind, RouteDescriptor, RouteDescriptorOptions, RouteMethod, ServerActionDescriptorProvider, ServerHandler, ServerLoggerProvider, ServerMiddlewareHandler, ServerMultipartProvider, ServerNotReadyProvider, ServerProvider, ServerRawRequest, ServerRemote, ServerReply, ServerRequest, ServerRequestConfig, ServerRequestConfigEntry, ServerResponse, ServerResponseBody, ServerRoute, ServerRouteAction, ServerRouteSecure, ServerRouteWithHandler, ServerRouterProvider, ServerSecurityProvider, ServerTimingProvider, UnauthorizedError, ValidationError, apiLinkSchema, apiLinksResponseSchema, errorNameByStatus, errorSchema, isHttpError, isServerAction, okSchema, routeMethods };
689
+ export { $action, $route, ActionDescriptor, ActionDescriptorHelper, ActionDescriptorOptions, AlephaServer, ApiLink, ApiLinksResponse, BadRequestError, ClientRequestEntry, ClientRequestEntryContainer, ClientRequestOptions, ClientRequestResponse, ConflictError, FetchActionArgs, FetchOptions, FetchResponse, ForbiddenError, HttpAction, HttpClient, HttpClientPendingRequests, HttpError, HttpErrorLike, LocalHandler, NodeHttpServerProvider, NotFoundError, Ok, RequestConfigSchema, ResponseBodyType, ResponseKind, RouteDescriptor, RouteDescriptorOptions, RouteMethod, ServerActionDescriptorProvider, ServerHandler, ServerLoggerProvider, ServerMiddlewareHandler, ServerNotReadyProvider, ServerProvider, ServerRawRequest, ServerRemote, ServerReply, ServerRequest, ServerRequestConfig, ServerRequestConfigEntry, ServerResponse, ServerResponseBody, ServerRoute, ServerRouteAction, ServerRouteSecure, ServerRouteWithHandler, ServerRouterProvider, ServerSecurityProvider, ServerTimingProvider, UnauthorizedError, ValidationError, apiLinkSchema, apiLinksResponseSchema, errorNameByStatus, errorSchema, isHttpError, isServerAction, okSchema, routeMethods };
693
690
  //# sourceMappingURL=index.d.ts.map
package/topic/redis.d.ts CHANGED
@@ -1,42 +1,43 @@
1
- import { SubscribeCallback, TopicProvider, UnSubscribeFn } from "@alepha/topic";
2
- import * as _alepha_core0 from "@alepha/core";
3
- import { Alepha } from "@alepha/core";
4
- import { RedisProvider, RedisSubscriberProvider } from "@alepha/redis";
1
+ import { SubscribeCallback, TopicProvider, UnSubscribeFn } from "alepha/topic";
2
+ import { Alepha, HookDescriptor, Logger, Module, Static, TObject, TString } from "alepha";
3
+ import { RedisProvider, RedisSubscriberProvider } from "alepha/redis";
5
4
 
6
5
  //#region src/providers/RedisTopicProvider.d.ts
6
+ declare const envSchema: TObject<{
7
+ REDIS_TOPIC_PREFIX: TString;
8
+ }>;
7
9
  declare class RedisTopicProvider implements TopicProvider {
8
- protected readonly env: {
9
- REDIS_TOPIC_PREFIX: string;
10
- };
10
+ protected readonly env: Static<typeof envSchema>;
11
11
  protected readonly redisProvider: RedisProvider;
12
12
  protected readonly redisSubscriberProvider: RedisSubscriberProvider;
13
- protected readonly log: _alepha_core0.Logger;
14
- protected readonly stop: _alepha_core0.HookDescriptor<"stop">;
13
+ protected readonly log: Logger;
14
+ protected readonly stop: HookDescriptor<"stop">;
15
15
  prefix(queue: string): string;
16
16
  /**
17
- * Publish a message to a topic.
18
- */
17
+ * Publish a message to a topic.
18
+ */
19
19
  publish(topic: string, message: string): Promise<void>;
20
20
  /**
21
- * Subscribe to a topic.
22
- */
21
+ * Subscribe to a topic.
22
+ */
23
23
  subscribe(name: string, callback: SubscribeCallback): Promise<UnSubscribeFn>;
24
24
  /**
25
- * Unsubscribe from a topic.
26
- */
25
+ * Unsubscribe from a topic.
26
+ */
27
27
  unsubscribe(name: string, callback?: SubscribeCallback): Promise<void>;
28
28
  }
29
29
  //#endregion
30
30
  //#region src/index.d.ts
31
+ // ---------------------------------------------------------------------------------------------------------------------
31
32
  /**
32
- * Alepha Topic Redis Module.
33
- *
34
- * Plugin for Alepha Topic that provides Redis pub/sub capabilities.
35
- *
36
- * @see {@link RedisTopicProvider}
37
- * @module alepha.topic.redis
38
- */
39
- declare class AlephaTopicRedis {
33
+ * Alepha Topic Redis Module.
34
+ *
35
+ * Plugin for Alepha Topic that provides Redis pub/sub capabilities.
36
+ *
37
+ * @see {@link RedisTopicProvider}
38
+ * @module alepha.topic.redis
39
+ */
40
+ declare class AlephaTopicRedis implements Module {
40
41
  readonly name = "alepha.topic.redis";
41
42
  readonly $services: (alepha: Alepha) => Alepha;
42
43
  }