alepha 0.9.1 → 0.9.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/command.d.ts CHANGED
@@ -14,12 +14,20 @@ interface Timer {
14
14
  name: string;
15
15
  duration: string;
16
16
  }
17
+ interface RunOptions {
18
+ /**
19
+ * Rename the command for logging purposes.
20
+ */
21
+ alias?: string;
22
+ /**
23
+ * If true, the command will not be logged.
24
+ */
25
+ silent?: boolean;
26
+ }
17
27
  interface RunnerMethod {
18
- (cmd: string | Array<string | Task>, fn?: () => any): Promise<string>;
19
- rm: (glob: string | string[]) => Promise<string>;
20
- cp: (source: string, dest: string, options?: {
21
- alias?: string;
22
- }) => Promise<string>;
28
+ (cmd: string | Array<string | Task>, fn?: () => any, options?: RunOptions): Promise<string>;
29
+ rm: (glob: string | string[], options?: RunOptions) => Promise<string>;
30
+ cp: (source: string, dest: string, options?: RunOptions) => Promise<string>;
23
31
  }
24
32
  declare class Runner {
25
33
  protected readonly log: Logger;
@@ -77,6 +85,10 @@ interface CommandDescriptorOptions<T extends TObject> {
77
85
  * A TypeBox object schema defining the flags for the command.
78
86
  */
79
87
  flags?: T;
88
+ /**
89
+ * If false, skip summary message at the end of the command execution.
90
+ */
91
+ summary?: boolean;
80
92
  }
81
93
  declare class CommandDescriptor<T extends TObject = TObject> extends Descriptor<CommandDescriptorOptions<T>> {
82
94
  readonly flags: TObject<{}>;
@@ -157,5 +169,5 @@ declare module "@sinclair/typebox" {
157
169
  //# sourceMappingURL=index.d.ts.map
158
170
 
159
171
  //#endregion
160
- export { $command, AlephaCommand, CliProvider, CommandDescriptor, CommandDescriptorOptions, CommandError, CommandHandlerArgs, Runner, RunnerMethod, Task };
172
+ export { $command, AlephaCommand, CliProvider, CommandDescriptor, CommandDescriptorOptions, CommandError, CommandHandlerArgs, RunOptions, Runner, RunnerMethod, Task };
161
173
  //# sourceMappingURL=index.d.ts.map
package/core.d.ts CHANGED
@@ -137,6 +137,7 @@ declare class AlsProvider {
137
137
  constructor();
138
138
  createContextId(): string;
139
139
  run<R>(callback: () => R, data?: Record<string, any>): R;
140
+ exists(): boolean;
140
141
  get<T>(key: string): T | undefined;
141
142
  set<T>(key: string, value: T): void;
142
143
  }
package/lock.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as _alepha_core1 from "alepha";
2
1
  import * as _alepha_core0$1 from "alepha";
2
+ import * as _alepha_core5 from "alepha";
3
3
  import * as _alepha_core0 from "alepha";
4
4
  import { AsyncFn, Descriptor, KIND, Static } from "alepha";
5
5
  import * as _alepha_topic0 from "alepha/topic";
@@ -89,14 +89,14 @@ interface LockDescriptorOptions<TFunc extends AsyncFn> {
89
89
  */
90
90
  gracePeriod?: ((...args: Parameters<TFunc>) => DurationLike | undefined) | DurationLike;
91
91
  }
92
- declare const envSchema: _alepha_core1.TObject<{
93
- LOCK_PREFIX_KEY: _alepha_core1.TString;
92
+ declare const envSchema: _alepha_core0$1.TObject<{
93
+ LOCK_PREFIX_KEY: _alepha_core0$1.TString;
94
94
  }>;
95
95
  declare module "alepha" {
96
96
  interface Env extends Partial<Static<typeof envSchema>> {}
97
97
  }
98
98
  declare class LockDescriptor<TFunc extends AsyncFn> extends Descriptor<LockDescriptorOptions<TFunc>> {
99
- protected readonly log: _alepha_core1.Logger;
99
+ protected readonly log: _alepha_core0$1.Logger;
100
100
  protected readonly provider: LockProvider;
101
101
  protected readonly env: {
102
102
  LOCK_PREFIX_KEY: string;
@@ -105,8 +105,8 @@ declare class LockDescriptor<TFunc extends AsyncFn> extends Descriptor<LockDescr
105
105
  protected readonly id: `${string}-${string}-${string}-${string}-${string}`;
106
106
  readonly maxDuration: dayjs_plugin_duration0.Duration;
107
107
  protected readonly topicLockEnd: _alepha_topic0.TopicDescriptor<{
108
- payload: _alepha_core1.TObject<{
109
- name: _alepha_core1.TString;
108
+ payload: _alepha_core0$1.TObject<{
109
+ name: _alepha_core0$1.TString;
110
110
  }>;
111
111
  }>;
112
112
  run(...args: Parameters<TFunc>): Promise<void>;
@@ -137,7 +137,7 @@ declare abstract class LockTopicProvider extends TopicProvider {}
137
137
  */
138
138
  declare class MemoryLockProvider implements LockProvider {
139
139
  protected readonly dateTimeProvider: DateTimeProvider;
140
- protected readonly log: _alepha_core0$1.Logger;
140
+ protected readonly log: _alepha_core5.Logger;
141
141
  /**
142
142
  * The in-memory store.
143
143
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alepha",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=22.0.0"
@@ -15,45 +15,47 @@
15
15
  "main": "./core.js",
16
16
  "types": "./core.d.ts",
17
17
  "dependencies": {
18
- "@alepha/batch": "0.9.1",
19
- "@alepha/bucket": "0.9.1",
20
- "@alepha/cache": "0.9.1",
21
- "@alepha/cache-redis": "0.9.1",
22
- "@alepha/command": "0.9.1",
23
- "@alepha/core": "0.9.1",
24
- "@alepha/datetime": "0.9.1",
25
- "@alepha/file": "0.9.1",
26
- "@alepha/lock": "0.9.1",
27
- "@alepha/lock-redis": "0.9.1",
28
- "@alepha/postgres": "0.9.1",
29
- "@alepha/queue": "0.9.1",
30
- "@alepha/queue-redis": "0.9.1",
31
- "@alepha/react": "0.9.1",
32
- "@alepha/react-auth": "0.9.1",
33
- "@alepha/react-head": "0.9.1",
34
- "@alepha/redis": "0.9.1",
35
- "@alepha/retry": "0.9.1",
36
- "@alepha/router": "0.9.1",
37
- "@alepha/scheduler": "0.9.1",
38
- "@alepha/security": "0.9.1",
39
- "@alepha/server": "0.9.1",
40
- "@alepha/server-cache": "0.9.1",
41
- "@alepha/server-compress": "0.9.1",
42
- "@alepha/server-cookies": "0.9.1",
43
- "@alepha/server-cors": "0.9.1",
44
- "@alepha/server-health": "0.9.1",
45
- "@alepha/server-helmet": "0.9.1",
46
- "@alepha/server-links": "0.9.1",
47
- "@alepha/server-metrics": "0.9.1",
48
- "@alepha/server-multipart": "0.9.1",
49
- "@alepha/server-proxy": "0.9.1",
50
- "@alepha/server-security": "0.9.1",
51
- "@alepha/server-static": "0.9.1",
52
- "@alepha/server-swagger": "0.9.1",
53
- "@alepha/testing": "0.9.1",
54
- "@alepha/topic": "0.9.1",
55
- "@alepha/topic-redis": "0.9.1",
56
- "@alepha/vite": "0.9.1"
18
+ "@alepha/batch": "0.9.2",
19
+ "@alepha/bucket": "0.9.2",
20
+ "@alepha/cache": "0.9.2",
21
+ "@alepha/cache-redis": "0.9.2",
22
+ "@alepha/command": "0.9.2",
23
+ "@alepha/core": "0.9.2",
24
+ "@alepha/datetime": "0.9.2",
25
+ "@alepha/file": "0.9.2",
26
+ "@alepha/lock": "0.9.2",
27
+ "@alepha/lock-redis": "0.9.2",
28
+ "@alepha/postgres": "0.9.2",
29
+ "@alepha/queue": "0.9.2",
30
+ "@alepha/queue-redis": "0.9.2",
31
+ "@alepha/react": "0.9.2",
32
+ "@alepha/react-auth": "0.9.2",
33
+ "@alepha/react-form": "0.9.2",
34
+ "@alepha/react-head": "0.9.2",
35
+ "@alepha/react-i18n": "0.9.2",
36
+ "@alepha/redis": "0.9.2",
37
+ "@alepha/retry": "0.9.2",
38
+ "@alepha/router": "0.9.2",
39
+ "@alepha/scheduler": "0.9.2",
40
+ "@alepha/security": "0.9.2",
41
+ "@alepha/server": "0.9.2",
42
+ "@alepha/server-cache": "0.9.2",
43
+ "@alepha/server-compress": "0.9.2",
44
+ "@alepha/server-cookies": "0.9.2",
45
+ "@alepha/server-cors": "0.9.2",
46
+ "@alepha/server-health": "0.9.2",
47
+ "@alepha/server-helmet": "0.9.2",
48
+ "@alepha/server-links": "0.9.2",
49
+ "@alepha/server-metrics": "0.9.2",
50
+ "@alepha/server-multipart": "0.9.2",
51
+ "@alepha/server-proxy": "0.9.2",
52
+ "@alepha/server-security": "0.9.2",
53
+ "@alepha/server-static": "0.9.2",
54
+ "@alepha/server-swagger": "0.9.2",
55
+ "@alepha/testing": "0.9.2",
56
+ "@alepha/topic": "0.9.2",
57
+ "@alepha/topic-redis": "0.9.2",
58
+ "@alepha/vite": "0.9.2"
57
59
  },
58
60
  "devDependencies": {
59
61
  "tsdown": "^0.13.0"
@@ -147,11 +149,21 @@
147
149
  "require": "./react/auth.cjs",
148
150
  "types": "./react/auth.d.ts"
149
151
  },
152
+ "./react/form": {
153
+ "import": "./react/form.js",
154
+ "require": "./react/form.cjs",
155
+ "types": "./react/form.d.ts"
156
+ },
150
157
  "./react/head": {
151
158
  "import": "./react/head.js",
152
159
  "require": "./react/head.cjs",
153
160
  "types": "./react/head.d.ts"
154
161
  },
162
+ "./react/i18n": {
163
+ "import": "./react/i18n.js",
164
+ "require": "./react/i18n.cjs",
165
+ "types": "./react/i18n.d.ts"
166
+ },
155
167
  "./redis": {
156
168
  "import": "./redis.js",
157
169
  "require": "./redis.cjs",
@@ -285,7 +297,9 @@
285
297
  "queue-redis",
286
298
  "react",
287
299
  "react-auth",
300
+ "react-form",
288
301
  "react-head",
302
+ "react-i18n",
289
303
  "redis",
290
304
  "retry",
291
305
  "router",
package/postgres.d.ts CHANGED
@@ -19,8 +19,8 @@ import postgres from "postgres";
19
19
  import * as _alepha_retry0 from "alepha/retry";
20
20
  import * as _sinclair_typebox9 from "@sinclair/typebox";
21
21
  import * as _sinclair_typebox16 from "@sinclair/typebox";
22
- import * as _sinclair_typebox18 from "@sinclair/typebox";
23
22
  import * as _sinclair_typebox17 from "@sinclair/typebox";
23
+ import * as _sinclair_typebox18 from "@sinclair/typebox";
24
24
  import * as _sinclair_typebox6 from "@sinclair/typebox";
25
25
  import * as _sinclair_typebox0 from "@sinclair/typebox";
26
26
  import { Evaluate, IntegerOptions, Kind, NumberOptions, ObjectOptions, OptionalKind, Static as Static$1, StringOptions, TAdditionalProperties, TArray, TBoolean, TInteger, TIntersect, TObject as TObject$1, TOptional, TOptionalWithFlag, TPick, TProperties, TReadonly, TRecord, TSchema as TSchema$2 } from "@sinclair/typebox";
@@ -1406,11 +1406,11 @@ declare const createdAtSchema: PgAttr<PgAttr<_sinclair_typebox16.TString, typeof
1406
1406
  /**
1407
1407
  * @deprecated Use `pg.primaryKey()` instead.
1408
1408
  */
1409
- declare const legacyIdSchema: PgAttr<PgAttr<PgAttr<_sinclair_typebox18.TInteger, typeof PG_PRIMARY_KEY>, typeof PG_SERIAL>, typeof PG_DEFAULT>;
1409
+ declare const legacyIdSchema: PgAttr<PgAttr<PgAttr<_sinclair_typebox17.TInteger, typeof PG_PRIMARY_KEY>, typeof PG_SERIAL>, typeof PG_DEFAULT>;
1410
1410
  //# sourceMappingURL=legacyIdSchema.d.ts.map
1411
1411
  //#endregion
1412
1412
  //#region src/schemas/updatedAtSchema.d.ts
1413
- declare const updatedAtSchema: PgAttr<PgAttr<_sinclair_typebox17.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
1413
+ declare const updatedAtSchema: PgAttr<PgAttr<_sinclair_typebox18.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
1414
1414
  //# sourceMappingURL=updatedAtSchema.d.ts.map
1415
1415
 
1416
1416
  //#endregion
package/react/form.cjs ADDED
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+ var m = require('@alepha/react-form');
3
+ Object.keys(m).forEach(function (k) {
4
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
5
+ enumerable: true,
6
+ get: function () { return m[k]; }
7
+ });
8
+ });
@@ -0,0 +1,117 @@
1
+ import * as _alepha_core0 from "alepha";
2
+ import { Static, TObject, TSchema } from "alepha";
3
+ import { InputHTMLAttributes } from "react";
4
+
5
+ //#region src/hooks/useForm.d.ts
6
+
7
+ /**
8
+ * Custom hook to create a form with validation and field management.
9
+ * This hook uses TypeBox schemas to define the structure and validation rules for the form.
10
+ * It provides a way to handle form submission, field creation, and value management.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * import { t } from "alepha";
15
+ *
16
+ * const form = useForm({
17
+ * schema: t.object({
18
+ * username: t.string(),
19
+ * password: t.string(),
20
+ * }),
21
+ * handler: (values) => {
22
+ * console.log("Form submitted with values:", values);
23
+ * },
24
+ * });
25
+ *
26
+ * return (
27
+ * <form onSubmit={form.onSubmit}>
28
+ * <input {...form.input("username")} />
29
+ * <input {...form.input("password")} />
30
+ * <button type="submit">Submit</button>
31
+ * </form>
32
+ * );
33
+ * ```
34
+ */
35
+ declare const useForm: <T extends TObject>(options: UseFormOptions<T>) => UseFormReturn<T>;
36
+ declare const getValueFromInput: (input: FormDataEntryValue, schema: TSchema) => any;
37
+ declare const valueToInputEntry: (value: any) => string | number;
38
+ type UseFormOptions<T extends TObject> = {
39
+ /**
40
+ * The schema defining the structure and validation rules for the form.
41
+ * This should be a TypeBox schema object.
42
+ */
43
+ schema: T;
44
+ /**
45
+ * Callback function to handle form submission.
46
+ * This function will receive the parsed and validated form values.
47
+ */
48
+ handler: (values: Static<T>, args: {
49
+ form: HTMLFormElement;
50
+ }) => void;
51
+ /**
52
+ * Optional callback to handle changes in form values.
53
+ * This can be used to update state or perform side effects when values change.
54
+ */
55
+ onValuesChange?: (values: Static<T>, previous: Static<T>) => void;
56
+ /**
57
+ * Optional initial values for the form fields.
58
+ * This can be used to pre-populate the form with existing data.
59
+ */
60
+ initialValues?: Static<T>;
61
+ /**
62
+ * Optional function to create custom field attributes.
63
+ * This can be used to add custom validation, styles, or other attributes.
64
+ */
65
+ onCreateField?: (name: keyof Static<T> & string, schema: TSchema) => InputHTMLAttributes<unknown>;
66
+ /**
67
+ * If defined, this will generate a unique ID for each field, prefixed with this string.
68
+ *
69
+ * > "username" with id="form-123" will become "form-123-username".
70
+ *
71
+ * If omitted, IDs will not be generated.
72
+ */
73
+ id?: string;
74
+ };
75
+ type UseFormReturn<T extends TObject> = {
76
+ /**
77
+ * Function to handle form submission.
78
+ * This should be attached to the form's onSubmit event.
79
+ *
80
+ * @example
81
+ * ```tsx
82
+ * const form = useForm();
83
+ *
84
+ * return <form onSubmit={form.onSubmit}></form>;
85
+ * ```
86
+ */
87
+ onSubmit?: (event: FormEventLike) => void;
88
+ /**
89
+ * Creates an input field for the specified schema property.
90
+ */
91
+ input: SchemaToInput<T>;
92
+ };
93
+ type SchemaToInput<T extends TObject> = { [K in keyof T["properties"]]: T["properties"][K] extends TObject ? SchemaToInput<T["properties"][K]> : InputHTMLAttributes<unknown> };
94
+ interface FormEventLike {
95
+ currentTarget: HTMLFormElement;
96
+ preventDefault: () => void;
97
+ }
98
+ //# sourceMappingURL=useForm.d.ts.map
99
+ //#endregion
100
+ //#region src/index.d.ts
101
+ /**
102
+ * React hooks for managing forms in Alepha applications.
103
+ *
104
+ * This module provides a set of hooks to simplify form handling, validation, and submission in React applications built with Alepha.
105
+ *
106
+ * It includes:
107
+ * - `useForm`: A hook for managing form state, validation, and submission.
108
+ *
109
+ * @see {@link useForm}
110
+ * @module alepha.react.form
111
+ */
112
+ declare const AlephaReactForm: _alepha_core0.ModuleDescriptor;
113
+ //# sourceMappingURL=index.d.ts.map
114
+
115
+ //#endregion
116
+ export { AlephaReactForm, FormEventLike, SchemaToInput, UseFormOptions, UseFormReturn, getValueFromInput, useForm, valueToInputEntry };
117
+ //# sourceMappingURL=index.d.ts.map
package/react/form.js ADDED
@@ -0,0 +1 @@
1
+ export * from '@alepha/react-form'
package/react/i18n.cjs ADDED
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+ var m = require('@alepha/react-i18n');
3
+ Object.keys(m).forEach(function (k) {
4
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
5
+ enumerable: true,
6
+ get: function () { return m[k]; }
7
+ });
8
+ });
@@ -0,0 +1,73 @@
1
+ import * as _alepha_core0$1 from "alepha";
2
+ import * as _alepha_core0 from "alepha";
3
+ import { Alepha, Descriptor, KIND } from "alepha";
4
+
5
+ //#region src/providers/I18nProvider.d.ts
6
+ declare class I18nProvider {
7
+ logger: _alepha_core0$1.Logger;
8
+ alepha: Alepha;
9
+ registry: Array<{
10
+ name: string;
11
+ lang: string;
12
+ loader: () => Promise<Record<string, string>>;
13
+ translations: Record<string, string>;
14
+ }>;
15
+ options: {
16
+ fallbackLang: string;
17
+ };
18
+ onRender: _alepha_core0$1.HookDescriptor<"server:onRequest">;
19
+ onStart: _alepha_core0$1.HookDescriptor<"start">;
20
+ setLang(lang: string): Promise<void>;
21
+ get lang(): string;
22
+ translate: (key: string) => string;
23
+ }
24
+ //# sourceMappingURL=I18nProvider.d.ts.map
25
+ //#endregion
26
+ //#region src/descriptors/$dictionary.d.ts
27
+ declare const $dictionary: {
28
+ <T extends Record<string, string>>(options: DictionaryDescriptorOptions<T>): DictionaryDescriptor<T>;
29
+ [KIND]: typeof DictionaryDescriptor;
30
+ };
31
+ interface DictionaryDescriptorOptions<T extends Record<string, string>> {
32
+ lang?: string;
33
+ name?: string;
34
+ lazy: () => Promise<{
35
+ default: T;
36
+ }>;
37
+ }
38
+ declare class DictionaryDescriptor<T extends Record<string, string>> extends Descriptor<DictionaryDescriptorOptions<T>> {
39
+ protected provider: I18nProvider;
40
+ protected onInit(): void;
41
+ }
42
+ //# sourceMappingURL=$dictionary.d.ts.map
43
+ //#endregion
44
+ //#region src/hooks/useI18n.d.ts
45
+ /**
46
+ * Hook to access the i18n service.
47
+ */
48
+ declare const useI18n: <S extends object, K extends keyof ServiceDictionary<S>>() => {
49
+ lang: string;
50
+ setLang: (lang: string) => Promise<void>;
51
+ tr: (key: keyof ServiceDictionary<S>[K]) => string;
52
+ };
53
+ type ServiceDictionary<T extends object> = { [K in keyof T]: T[K] extends DictionaryDescriptor<infer U> ? U : never };
54
+ //#endregion
55
+ //#region src/index.d.ts
56
+ declare module "alepha" {
57
+ interface State {
58
+ "react.i18n.lang"?: string;
59
+ }
60
+ }
61
+ /**
62
+ * Add i18n support to your Alepha React application. SSR and CSR compatible.
63
+ *
64
+ * It supports lazy loading of translations and provides a context to access the current language.
65
+ *
66
+ * @module alepha.react.i18n
67
+ */
68
+ declare const AlephaReactI18n: _alepha_core0.ModuleDescriptor;
69
+ //# sourceMappingURL=index.d.ts.map
70
+
71
+ //#endregion
72
+ export { $dictionary, AlephaReactI18n, DictionaryDescriptor, DictionaryDescriptorOptions, I18nProvider, useI18n };
73
+ //# sourceMappingURL=index.d.ts.map
package/react/i18n.js ADDED
@@ -0,0 +1 @@
1
+ export * from '@alepha/react-i18n'
package/react.d.ts CHANGED
@@ -1,18 +1,19 @@
1
- import * as _alepha_core10 from "alepha";
1
+ import * as _alepha_core2 from "alepha";
2
2
  import * as _alepha_core16 from "alepha";
3
- import * as _alepha_core14 from "alepha";
4
3
  import * as _alepha_core0$1 from "alepha";
4
+ import * as _alepha_core6 from "alepha";
5
5
  import * as _alepha_core0 from "alepha";
6
- import { Alepha, Async, Descriptor, KIND, Service, Static, TObject, TSchema } from "alepha";
7
- import { ApiLinksResponse, ServerHandler, ServerRequest, ServerRouterProvider, ServerTimingProvider } from "alepha/server";
6
+ import { Alepha, Async, Descriptor, KIND, Service, State, Static, TObject, TSchema } from "alepha";
7
+ import { ApiLinksResponse, RequestConfigSchema, ServerHandler, ServerRequest, ServerRouterProvider, ServerTimingProvider } from "alepha/server";
8
8
  import { ServerRouteCache } from "alepha/server/cache";
9
- import { ClientScope, HttpVirtualClient, LinkProvider } from "alepha/server/links";
9
+ import { ClientScope, HttpVirtualClient, LinkProvider, VirtualAction } from "alepha/server/links";
10
10
  import * as react0$1 from "react";
11
11
  import * as react0 from "react";
12
+ import * as react1 from "react";
12
13
  import React, { AnchorHTMLAttributes, ErrorInfo, FC, PropsWithChildren, ReactNode } from "react";
13
14
  import * as react_jsx_runtime0$1 from "react/jsx-runtime";
14
- import * as react_jsx_runtime1 from "react/jsx-runtime";
15
15
  import * as react_jsx_runtime0 from "react/jsx-runtime";
16
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
16
17
  import { Route, RouterProvider } from "alepha/router";
17
18
  import { ServerStaticProvider } from "alepha/server/static";
18
19
  import { Root } from "react-dom/client";
@@ -157,14 +158,14 @@ type PageResolve<TConfig extends PageConfigSchema = PageConfigSchema, TPropsPare
157
158
  //# sourceMappingURL=$page.d.ts.map
158
159
  //#endregion
159
160
  //#region src/providers/PageDescriptorProvider.d.ts
160
- declare const envSchema$1: _alepha_core10.TObject<{
161
- REACT_STRICT_MODE: _alepha_core10.TBoolean;
161
+ declare const envSchema$1: _alepha_core2.TObject<{
162
+ REACT_STRICT_MODE: _alepha_core2.TBoolean;
162
163
  }>;
163
164
  declare module "alepha" {
164
165
  interface Env extends Partial<Static<typeof envSchema$1>> {}
165
166
  }
166
167
  declare class PageDescriptorProvider {
167
- protected readonly log: _alepha_core10.Logger;
168
+ protected readonly log: _alepha_core2.Logger;
168
169
  protected readonly env: {
169
170
  REACT_STRICT_MODE: boolean;
170
171
  };
@@ -189,7 +190,7 @@ declare class PageDescriptorProvider {
189
190
  }, params?: Record<string, any>): string;
190
191
  compile(path: string, params?: Record<string, string>): string;
191
192
  protected renderView(index: number, path: string, view: ReactNode | undefined, page: PageRoute): ReactNode;
192
- protected readonly configure: _alepha_core10.HookDescriptor<"configure">;
193
+ protected readonly configure: _alepha_core2.HookDescriptor<"configure">;
193
194
  protected map(pages: Array<PageDescriptor>, target: PageDescriptor): PageRouteEntry;
194
195
  add(entry: PageRouteEntry): void;
195
196
  protected createMatch(page: PageRoute): string;
@@ -284,7 +285,7 @@ declare class BrowserRouterProvider extends RouterProvider<BrowserRoute> {
284
285
  //#endregion
285
286
  //#region src/providers/ReactBrowserProvider.d.ts
286
287
  declare class ReactBrowserProvider {
287
- protected readonly log: _alepha_core14.Logger;
288
+ protected readonly log: _alepha_core0$1.Logger;
288
289
  protected readonly client: LinkProvider;
289
290
  protected readonly alepha: Alepha;
290
291
  protected readonly router: BrowserRouterProvider;
@@ -308,7 +309,7 @@ declare class ReactBrowserProvider {
308
309
  * Get embedded layers from the server.
309
310
  */
310
311
  protected getHydrationState(): ReactHydrationState | undefined;
311
- readonly ready: _alepha_core14.HookDescriptor<"ready">;
312
+ readonly ready: _alepha_core0$1.HookDescriptor<"ready">;
312
313
  }
313
314
  interface RouterGoOptions {
314
315
  replace?: boolean;
@@ -393,19 +394,22 @@ interface NestedViewProps {
393
394
  * }
394
395
  * ```
395
396
  */
396
- declare const NestedView: (props: NestedViewProps) => react_jsx_runtime1.JSX.Element;
397
+ declare const NestedView: (props: NestedViewProps) => react_jsx_runtime0.JSX.Element;
397
398
  //#endregion
398
399
  //#region src/components/NotFound.d.ts
399
- declare function NotFoundPage(): react_jsx_runtime0.JSX.Element;
400
+ declare function NotFoundPage(): react_jsx_runtime1.JSX.Element;
400
401
  //# sourceMappingURL=NotFound.d.ts.map
401
402
  //#endregion
403
+ //#region src/contexts/AlephaContext.d.ts
404
+ declare const AlephaContext: react0$1.Context<Alepha | undefined>;
405
+ //# sourceMappingURL=AlephaContext.d.ts.map
406
+ //#endregion
402
407
  //#region src/contexts/RouterContext.d.ts
403
408
  interface RouterContextValue {
404
- alepha: Alepha;
405
409
  state: RouterState;
406
410
  context: PageReactContext;
407
411
  }
408
- declare const RouterContext: react0$1.Context<RouterContextValue | undefined>;
412
+ declare const RouterContext: react0.Context<RouterContextValue | undefined>;
409
413
  //# sourceMappingURL=RouterContext.d.ts.map
410
414
  //#endregion
411
415
  //#region src/contexts/RouterLayerContext.d.ts
@@ -413,7 +417,7 @@ interface RouterLayerContextValue {
413
417
  index: number;
414
418
  path: string;
415
419
  }
416
- declare const RouterLayerContext: react0.Context<RouterLayerContextValue | undefined>;
420
+ declare const RouterLayerContext: react1.Context<RouterLayerContextValue | undefined>;
417
421
  //# sourceMappingURL=RouterLayerContext.d.ts.map
418
422
  //#endregion
419
423
  //#region src/hooks/RouterHookApi.d.ts
@@ -501,7 +505,7 @@ declare const useClient: <T extends object>(_scope?: ClientScope) => HttpVirtual
501
505
  //# sourceMappingURL=useClient.d.ts.map
502
506
  //#endregion
503
507
  //#region src/hooks/useInject.d.ts
504
- declare const useInject: <T extends object>(clazz: Service<T>) => T;
508
+ declare const useInject: <T extends object>(service: Service<T>) => T;
505
509
  //# sourceMappingURL=useInject.d.ts.map
506
510
  //#endregion
507
511
  //#region src/hooks/useQueryParams.d.ts
@@ -535,15 +539,34 @@ declare const useRouterEvents: (opts?: {
535
539
  //#region src/hooks/useRouterState.d.ts
536
540
  declare const useRouterState: () => RouterState;
537
541
  //# sourceMappingURL=useRouterState.d.ts.map
538
-
542
+ //#endregion
543
+ //#region src/hooks/useSchema.d.ts
544
+ declare const useSchema: <TConfig extends RequestConfigSchema>(action: VirtualAction<TConfig>) => UseSchemaReturn<TConfig>;
545
+ type UseSchemaReturn<TConfig extends RequestConfigSchema> = TConfig & {
546
+ loading: boolean;
547
+ };
548
+ /**
549
+ * Get an action schema during server-side rendering (SSR) or client-side rendering (CSR).
550
+ */
551
+ declare const ssrSchemaLoading: (alepha: Alepha, name: string) => RequestConfigSchema | {
552
+ loading: boolean;
553
+ };
554
+ //# sourceMappingURL=useSchema.d.ts.map
555
+ //#endregion
556
+ //#region src/hooks/useStore.d.ts
557
+ /**
558
+ * Hook to access and mutate the Alepha state.
559
+ */
560
+ declare const useStore: <Key extends keyof State>(key: Key) => [State[Key], (value: State[Key]) => void];
561
+ //# sourceMappingURL=useStore.d.ts.map
539
562
  //#endregion
540
563
  //#region src/providers/ReactServerProvider.d.ts
541
- declare const envSchema: _alepha_core0$1.TObject<{
542
- REACT_SERVER_DIST: _alepha_core0$1.TString;
543
- REACT_SERVER_PREFIX: _alepha_core0$1.TString;
544
- REACT_SSR_ENABLED: _alepha_core0$1.TOptional<_alepha_core0$1.TBoolean>;
545
- REACT_ROOT_ID: _alepha_core0$1.TString;
546
- REACT_SERVER_TEMPLATE: _alepha_core0$1.TOptional<_alepha_core0$1.TString>;
564
+ declare const envSchema: _alepha_core6.TObject<{
565
+ REACT_SERVER_DIST: _alepha_core6.TString;
566
+ REACT_SERVER_PREFIX: _alepha_core6.TString;
567
+ REACT_SSR_ENABLED: _alepha_core6.TOptional<_alepha_core6.TBoolean>;
568
+ REACT_ROOT_ID: _alepha_core6.TString;
569
+ REACT_SERVER_TEMPLATE: _alepha_core6.TOptional<_alepha_core6.TString>;
547
570
  }>;
548
571
  declare module "alepha" {
549
572
  interface Env extends Partial<Static<typeof envSchema>> {}
@@ -552,7 +575,7 @@ declare module "alepha" {
552
575
  }
553
576
  }
554
577
  declare class ReactServerProvider {
555
- protected readonly log: _alepha_core0$1.Logger;
578
+ protected readonly log: _alepha_core6.Logger;
556
579
  protected readonly alepha: Alepha;
557
580
  protected readonly pageDescriptorProvider: PageDescriptorProvider;
558
581
  protected readonly serverStaticProvider: ServerStaticProvider;
@@ -566,7 +589,7 @@ declare class ReactServerProvider {
566
589
  REACT_ROOT_ID: string;
567
590
  };
568
591
  protected readonly ROOT_DIV_REGEX: RegExp;
569
- readonly onConfigure: _alepha_core0$1.HookDescriptor<"configure">;
592
+ readonly onConfigure: _alepha_core6.HookDescriptor<"configure">;
570
593
  get template(): string;
571
594
  protected registerPages(templateLoader: TemplateLoader): Promise<void>;
572
595
  protected getPublicDirectory(): string;
@@ -647,5 +670,5 @@ declare const AlephaReact: _alepha_core0.ModuleDescriptor;
647
670
  //# sourceMappingURL=index.d.ts.map
648
671
 
649
672
  //#endregion
650
- export { $page, AlephaReact, AnchorProps, ClientOnly, CreateLayersResult, ErrorBoundary, HrefLike, Layer, Link, NestedView, NotFoundPage as NotFound, PageConfigSchema, PageDescriptor, PageDescriptorOptions, PageDescriptorProvider, PageDescriptorRenderOptions, PageDescriptorRenderResult, PageReactContext, PageRequest, PageRequestConfig, PageResolve, PageRoute, PageRouteEntry, PreviousLayerData, ReactBrowserProvider, ReactHydrationState, ReactServerProvider, RedirectionError, RouterContext, RouterContextValue, RouterGoOptions, RouterHookApi, RouterLayerContext, RouterLayerContextValue, RouterRenderResult, RouterStackItem, RouterState, TPropsDefault, TPropsParentDefault, TransitionOptions, UseActiveHook, UseQueryParamsHookOptions, VirtualRouter, isPageRoute, useActive, useAlepha, useClient, useInject, useQueryParams, useRouter, useRouterEvents, useRouterState };
673
+ export { $page, AlephaContext, AlephaReact, AnchorProps, ClientOnly, CreateLayersResult, ErrorBoundary, HrefLike, Layer, Link, NestedView, NotFoundPage as NotFound, PageConfigSchema, PageDescriptor, PageDescriptorOptions, PageDescriptorProvider, PageDescriptorRenderOptions, PageDescriptorRenderResult, PageReactContext, PageRequest, PageRequestConfig, PageResolve, PageRoute, PageRouteEntry, PreviousLayerData, ReactBrowserProvider, ReactHydrationState, ReactServerProvider, RedirectionError, RouterContext, RouterContextValue, RouterGoOptions, RouterHookApi, RouterLayerContext, RouterLayerContextValue, RouterRenderResult, RouterStackItem, RouterState, TPropsDefault, TPropsParentDefault, TransitionOptions, UseActiveHook, UseQueryParamsHookOptions, UseSchemaReturn, VirtualRouter, isPageRoute, ssrSchemaLoading, useActive, useAlepha, useClient, useInject, useQueryParams, useRouter, useRouterEvents, useRouterState, useSchema, useStore };
651
674
  //# sourceMappingURL=index.d.ts.map
package/security.d.ts CHANGED
@@ -4,8 +4,8 @@ import * as _alepha_core0 from "alepha";
4
4
  import { Alepha, Descriptor, KIND, Static } from "alepha";
5
5
  import { DateTimeProvider } from "alepha/datetime";
6
6
  import { CryptoKey, FlattenedJWSInput, JSONWebKeySet, JWSHeaderParameters, JWTHeaderParameters, JWTPayload, JWTVerifyResult, KeyObject } from "jose";
7
+ import * as _sinclair_typebox13 from "@sinclair/typebox";
7
8
  import * as _sinclair_typebox0 from "@sinclair/typebox";
8
- import * as _sinclair_typebox9 from "@sinclair/typebox";
9
9
 
10
10
  //#region src/interfaces/UserAccountInfo.d.ts
11
11
  /**
@@ -55,25 +55,25 @@ interface UserAccountToken extends UserAccountInfo {
55
55
  //# sourceMappingURL=UserAccountToken.d.ts.map
56
56
  //#endregion
57
57
  //#region src/schemas/permissionSchema.d.ts
58
- declare const permissionSchema: _sinclair_typebox0.TObject<{
59
- name: _sinclair_typebox0.TString;
60
- group: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
61
- description: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
62
- method: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
63
- path: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
58
+ declare const permissionSchema: _sinclair_typebox13.TObject<{
59
+ name: _sinclair_typebox13.TString;
60
+ group: _sinclair_typebox13.TOptional<_sinclair_typebox13.TString>;
61
+ description: _sinclair_typebox13.TOptional<_sinclair_typebox13.TString>;
62
+ method: _sinclair_typebox13.TOptional<_sinclair_typebox13.TString>;
63
+ path: _sinclair_typebox13.TOptional<_sinclair_typebox13.TString>;
64
64
  }>;
65
65
  type Permission = Static<typeof permissionSchema>;
66
66
  //# sourceMappingURL=permissionSchema.d.ts.map
67
67
  //#endregion
68
68
  //#region src/schemas/roleSchema.d.ts
69
- declare const roleSchema: _sinclair_typebox9.TObject<{
70
- name: _sinclair_typebox9.TString;
71
- description: _sinclair_typebox9.TOptional<_sinclair_typebox9.TString>;
72
- default: _sinclair_typebox9.TOptional<_sinclair_typebox9.TBoolean>;
73
- permissions: _sinclair_typebox9.TArray<_sinclair_typebox9.TObject<{
74
- name: _sinclair_typebox9.TString;
75
- ownership: _sinclair_typebox9.TOptional<_sinclair_typebox9.TBoolean>;
76
- exclude: _sinclair_typebox9.TOptional<_sinclair_typebox9.TArray<_sinclair_typebox9.TString>>;
69
+ declare const roleSchema: _sinclair_typebox0.TObject<{
70
+ name: _sinclair_typebox0.TString;
71
+ description: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
72
+ default: _sinclair_typebox0.TOptional<_sinclair_typebox0.TBoolean>;
73
+ permissions: _sinclair_typebox0.TArray<_sinclair_typebox0.TObject<{
74
+ name: _sinclair_typebox0.TString;
75
+ ownership: _sinclair_typebox0.TOptional<_sinclair_typebox0.TBoolean>;
76
+ exclude: _sinclair_typebox0.TOptional<_sinclair_typebox0.TArray<_sinclair_typebox0.TString>>;
77
77
  }>>;
78
78
  }>;
79
79
  type Role = Static<typeof roleSchema>;
package/server/links.d.ts CHANGED
@@ -19,6 +19,7 @@ declare class LinkProvider {
19
19
  pushLink(link: HttpClientLink): void;
20
20
  getLinks(force?: boolean): Promise<HttpClientLink[]>;
21
21
  client<T extends object>(scope?: ClientScope): HttpVirtualClient<T>;
22
+ protected createVirtualAction<T extends RequestConfigSchema>(name: string, scope?: ClientScope): VirtualAction<T>;
22
23
  /**
23
24
  * Resolve a link by its name and call it.
24
25
  * - If link is local, it will call the local handler.
@@ -41,11 +42,11 @@ interface ClientScope {
41
42
  group?: string;
42
43
  service?: string;
43
44
  }
44
- type HttpVirtualClient<T> = { [K in keyof T as T[K] extends ActionDescriptor<RequestConfigSchema> ? K : never]: T[K] extends ActionDescriptor<infer Schema> ? T[K] & {
45
- (config?: ClientRequestEntry<Schema>, opts?: ClientRequestOptions): Promise<ClientRequestResponse<Schema>>;
45
+ type HttpVirtualClient<T> = { [K in keyof T as T[K] extends ActionDescriptor<RequestConfigSchema> ? K : never]: T[K] extends ActionDescriptor<infer Schema> ? VirtualAction<Schema> : never };
46
+ interface VirtualAction<T extends RequestConfigSchema> extends Pick<ActionDescriptor<T>, "name" | "run" | "fetch"> {
47
+ (config?: ClientRequestEntry<T>, opts?: ClientRequestOptions): Promise<ClientRequestResponse<T>>;
46
48
  can: () => boolean;
47
- schema: Schema;
48
- } : never };
49
+ }
49
50
  //# sourceMappingURL=LinkProvider.d.ts.map
50
51
  //#endregion
51
52
  //#region src/descriptors/$client.d.ts
@@ -198,5 +199,5 @@ declare const AlephaServerLinks: _alepha_core0.ModuleDescriptor;
198
199
  //# sourceMappingURL=index.d.ts.map
199
200
 
200
201
  //#endregion
201
- export { $client, $remote, AlephaServerLinks, ClientScope, FetchLinksOptions, GetLinksOptions, HttpClientLink, HttpVirtualClient, LinkProvider, RemoteDescriptor, RemoteDescriptorOptions, RemoteDescriptorProvider, ServerLinksProvider, ServerRemote };
202
+ export { $client, $remote, AlephaServerLinks, ClientScope, FetchLinksOptions, GetLinksOptions, HttpClientLink, HttpVirtualClient, LinkProvider, RemoteDescriptor, RemoteDescriptorOptions, RemoteDescriptorProvider, ServerLinksProvider, ServerRemote, VirtualAction };
202
203
  //# sourceMappingURL=index.d.ts.map
package/server.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _alepha_core1 from "alepha";
2
2
  import * as _alepha_core0$1 from "alepha";
3
+ import * as _alepha_core6 from "alepha";
3
4
  import * as _alepha_core2 from "alepha";
4
- import * as _alepha_core9 from "alepha";
5
5
  import * as _alepha_core13 from "alepha";
6
6
  import * as _alepha_core14 from "alepha";
7
7
  import * as _alepha_core0 from "alepha";
@@ -12,9 +12,9 @@ import { Route, RouterProvider } from "alepha/router";
12
12
  import * as _alepha_cache0 from "alepha/cache";
13
13
  import { IncomingMessage, ServerResponse as ServerResponse$1 } from "node:http";
14
14
  import { DateTimeProvider, DurationLike } from "alepha/datetime";
15
+ import * as _sinclair_typebox17 from "@sinclair/typebox";
16
+ import * as _sinclair_typebox7 from "@sinclair/typebox";
15
17
  import * as _sinclair_typebox0 from "@sinclair/typebox";
16
- import * as _sinclair_typebox33 from "@sinclair/typebox";
17
- import * as _sinclair_typebox25 from "@sinclair/typebox";
18
18
  import * as http0 from "http";
19
19
 
20
20
  //#region src/constants/routeMethods.d.ts
@@ -470,23 +470,23 @@ declare const isMultipart: (options: {
470
470
  //# sourceMappingURL=isMultipart.d.ts.map
471
471
  //#endregion
472
472
  //#region src/schemas/apiLinksResponseSchema.d.ts
473
- declare const apiLinkSchema: _sinclair_typebox0.TObject<{
474
- name: _sinclair_typebox0.TString;
475
- path: _sinclair_typebox0.TString;
476
- method: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
477
- group: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
478
- requestBodyType: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
479
- service: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
473
+ declare const apiLinkSchema: _sinclair_typebox17.TObject<{
474
+ name: _sinclair_typebox17.TString;
475
+ path: _sinclair_typebox17.TString;
476
+ method: _sinclair_typebox17.TOptional<_sinclair_typebox17.TString>;
477
+ group: _sinclair_typebox17.TOptional<_sinclair_typebox17.TString>;
478
+ requestBodyType: _sinclair_typebox17.TOptional<_sinclair_typebox17.TString>;
479
+ service: _sinclair_typebox17.TOptional<_sinclair_typebox17.TString>;
480
480
  }>;
481
- declare const apiLinksResponseSchema: _sinclair_typebox0.TObject<{
482
- prefix: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
483
- links: _sinclair_typebox0.TArray<_sinclair_typebox0.TObject<{
484
- name: _sinclair_typebox0.TString;
485
- path: _sinclair_typebox0.TString;
486
- method: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
487
- group: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
488
- requestBodyType: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
489
- service: _sinclair_typebox0.TOptional<_sinclair_typebox0.TString>;
481
+ declare const apiLinksResponseSchema: _sinclair_typebox17.TObject<{
482
+ prefix: _sinclair_typebox17.TOptional<_sinclair_typebox17.TString>;
483
+ links: _sinclair_typebox17.TArray<_sinclair_typebox17.TObject<{
484
+ name: _sinclair_typebox17.TString;
485
+ path: _sinclair_typebox17.TString;
486
+ method: _sinclair_typebox17.TOptional<_sinclair_typebox17.TString>;
487
+ group: _sinclair_typebox17.TOptional<_sinclair_typebox17.TString>;
488
+ requestBodyType: _sinclair_typebox17.TOptional<_sinclair_typebox17.TString>;
489
+ service: _sinclair_typebox17.TOptional<_sinclair_typebox17.TString>;
490
490
  }>>;
491
491
  }>;
492
492
  type ApiLinksResponse = Static<typeof apiLinksResponseSchema>;
@@ -494,31 +494,31 @@ type ApiLink = Static<typeof apiLinkSchema>;
494
494
  //# sourceMappingURL=apiLinksResponseSchema.d.ts.map
495
495
  //#endregion
496
496
  //#region src/schemas/errorSchema.d.ts
497
- declare const errorSchema: _sinclair_typebox33.TObject<{
498
- error: _sinclair_typebox33.TString;
499
- status: _sinclair_typebox33.TNumber;
500
- message: _sinclair_typebox33.TString;
501
- details: _sinclair_typebox33.TOptional<_sinclair_typebox33.TString>;
502
- cause: _sinclair_typebox33.TOptional<_sinclair_typebox33.TObject<{
503
- name: _sinclair_typebox33.TString;
504
- message: _sinclair_typebox33.TString;
497
+ declare const errorSchema: _sinclair_typebox7.TObject<{
498
+ error: _sinclair_typebox7.TString;
499
+ status: _sinclair_typebox7.TNumber;
500
+ message: _sinclair_typebox7.TString;
501
+ details: _sinclair_typebox7.TOptional<_sinclair_typebox7.TString>;
502
+ cause: _sinclair_typebox7.TOptional<_sinclair_typebox7.TObject<{
503
+ name: _sinclair_typebox7.TString;
504
+ message: _sinclair_typebox7.TString;
505
505
  }>>;
506
506
  }>;
507
507
  //# sourceMappingURL=errorSchema.d.ts.map
508
508
  //#endregion
509
509
  //#region src/schemas/okSchema.d.ts
510
- declare const okSchema: _sinclair_typebox25.TObject<{
511
- ok: _sinclair_typebox25.TBoolean;
512
- id: _sinclair_typebox25.TOptional<_sinclair_typebox25.TUnion<[_sinclair_typebox25.TString, _sinclair_typebox25.TInteger]>>;
513
- count: _sinclair_typebox25.TOptional<_sinclair_typebox25.TNumber>;
510
+ declare const okSchema: _sinclair_typebox0.TObject<{
511
+ ok: _sinclair_typebox0.TBoolean;
512
+ id: _sinclair_typebox0.TOptional<_sinclair_typebox0.TUnion<[_sinclair_typebox0.TString, _sinclair_typebox0.TInteger]>>;
513
+ count: _sinclair_typebox0.TOptional<_sinclair_typebox0.TNumber>;
514
514
  }>;
515
515
  type Ok = Static<typeof okSchema>;
516
516
  //# sourceMappingURL=okSchema.d.ts.map
517
517
  //#endregion
518
518
  //#region src/providers/NodeHttpServerProvider.d.ts
519
- declare const envSchema: _alepha_core2.TObject<{
520
- SERVER_PORT: _alepha_core2.TNumber;
521
- SERVER_HOST: _alepha_core2.TString;
519
+ declare const envSchema: _alepha_core6.TObject<{
520
+ SERVER_PORT: _alepha_core6.TNumber;
521
+ SERVER_HOST: _alepha_core6.TString;
522
522
  }>;
523
523
  declare module "alepha" {
524
524
  interface Env extends Partial<Static<typeof envSchema>> {}
@@ -526,31 +526,31 @@ declare module "alepha" {
526
526
  declare class NodeHttpServerProvider extends ServerProvider {
527
527
  protected readonly alepha: Alepha;
528
528
  protected readonly dateTimeProvider: DateTimeProvider;
529
- protected readonly log: _alepha_core2.Logger;
529
+ protected readonly log: _alepha_core6.Logger;
530
530
  protected readonly env: {
531
531
  SERVER_PORT: number;
532
532
  SERVER_HOST: string;
533
533
  };
534
534
  protected readonly router: ServerRouterProvider;
535
535
  protected readonly server: http0.Server<typeof IncomingMessage, typeof ServerResponse$1>;
536
- protected readonly onNodeRequest: _alepha_core2.HookDescriptor<"node:request">;
536
+ protected readonly onNodeRequest: _alepha_core6.HookDescriptor<"node:request">;
537
537
  handle(req: IncomingMessage, res: ServerResponse$1): Promise<void>;
538
538
  createRouterRequest(req: IncomingMessage, res: ServerResponse$1, params?: Record<string, string>): ServerRawRequest;
539
539
  getProtocol(req: IncomingMessage): "http" | "https";
540
540
  get hostname(): string;
541
- readonly start: _alepha_core2.HookDescriptor<"start">;
542
- protected readonly stop: _alepha_core2.HookDescriptor<"stop">;
541
+ readonly start: _alepha_core6.HookDescriptor<"start">;
542
+ protected readonly stop: _alepha_core6.HookDescriptor<"stop">;
543
543
  protected listen(): Promise<void>;
544
544
  protected close(): Promise<void>;
545
545
  }
546
546
  //#endregion
547
547
  //#region src/providers/ServerLoggerProvider.d.ts
548
548
  declare class ServerLoggerProvider {
549
- protected readonly log: _alepha_core9.Logger;
549
+ protected readonly log: _alepha_core2.Logger;
550
550
  protected readonly alepha: Alepha;
551
- readonly onRequest: _alepha_core9.HookDescriptor<"server:onRequest">;
552
- readonly onError: _alepha_core9.HookDescriptor<"server:onError">;
553
- readonly onResponse: _alepha_core9.HookDescriptor<"server:onResponse">;
551
+ readonly onRequest: _alepha_core2.HookDescriptor<"server:onRequest">;
552
+ readonly onError: _alepha_core2.HookDescriptor<"server:onError">;
553
+ readonly onResponse: _alepha_core2.HookDescriptor<"server:onResponse">;
554
554
  }
555
555
  //# sourceMappingURL=ServerLoggerProvider.d.ts.map
556
556
  //#endregion
package/topic.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as _alepha_core2 from "alepha";
2
1
  import * as _alepha_core0$1 from "alepha";
2
+ import * as _alepha_core1 from "alepha";
3
3
  import * as _alepha_core0 from "alepha";
4
4
  import { Alepha, Descriptor, KIND, Service, Static, TSchema } from "alepha";
5
5
  import { DateTimeProvider, DurationLike } from "alepha/datetime";
@@ -76,7 +76,7 @@ interface TopicDescriptorOptions<T extends TopicMessageSchema> {
76
76
  handler?: TopicHandler<T>;
77
77
  }
78
78
  declare class TopicDescriptor<T extends TopicMessageSchema> extends Descriptor<TopicDescriptorOptions<T>> {
79
- protected readonly log: _alepha_core2.Logger;
79
+ protected readonly log: _alepha_core0$1.Logger;
80
80
  protected readonly dateTimeProvider: DateTimeProvider;
81
81
  readonly provider: TopicProvider;
82
82
  get name(): string;
@@ -127,9 +127,9 @@ declare class TopicTimeoutError extends Error {
127
127
  //#endregion
128
128
  //#region src/providers/MemoryTopicProvider.d.ts
129
129
  declare class MemoryTopicProvider extends TopicProvider {
130
- protected readonly log: _alepha_core0$1.Logger;
130
+ protected readonly log: _alepha_core1.Logger;
131
131
  protected readonly subscriptions: Record<string, SubscribeCallback[]>;
132
- protected readonly start: _alepha_core0$1.HookDescriptor<"start">;
132
+ protected readonly start: _alepha_core1.HookDescriptor<"start">;
133
133
  /**
134
134
  * Publish a message to a topic.
135
135
  *