alepha 0.9.0 → 0.9.1
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 +14 -0
- package/core.d.ts +16 -11
- package/package.json +40 -40
- package/postgres.d.ts +4 -4
- package/react.d.ts +16 -15
- package/security.d.ts +15 -15
- package/server/security.d.ts +3 -1
- package/server.d.ts +42 -41
- package/topic.d.ts +4 -4
package/command.d.ts
CHANGED
|
@@ -17,6 +17,9 @@ interface Timer {
|
|
|
17
17
|
interface RunnerMethod {
|
|
18
18
|
(cmd: string | Array<string | Task>, fn?: () => any): Promise<string>;
|
|
19
19
|
rm: (glob: string | string[]) => Promise<string>;
|
|
20
|
+
cp: (source: string, dest: string, options?: {
|
|
21
|
+
alias?: string;
|
|
22
|
+
}) => Promise<string>;
|
|
20
23
|
}
|
|
21
24
|
declare class Runner {
|
|
22
25
|
protected readonly log: Logger;
|
|
@@ -24,6 +27,7 @@ declare class Runner {
|
|
|
24
27
|
protected readonly startTime: number;
|
|
25
28
|
readonly run: RunnerMethod;
|
|
26
29
|
constructor(log: Logger);
|
|
30
|
+
protected createRunMethod(): RunnerMethod;
|
|
27
31
|
protected exec(cmd: string): Promise<string>;
|
|
28
32
|
/**
|
|
29
33
|
* Executes one or more tasks.
|
|
@@ -140,6 +144,16 @@ declare class CliProvider {
|
|
|
140
144
|
* @module alepha.command
|
|
141
145
|
*/
|
|
142
146
|
declare const AlephaCommand: _alepha_core0.ModuleDescriptor;
|
|
147
|
+
declare module "@sinclair/typebox" {
|
|
148
|
+
interface StringOptions {
|
|
149
|
+
/**
|
|
150
|
+
* Additional aliases for the flags.
|
|
151
|
+
*
|
|
152
|
+
* @module alepha.command
|
|
153
|
+
*/
|
|
154
|
+
aliases?: string[];
|
|
155
|
+
}
|
|
156
|
+
}
|
|
143
157
|
//# sourceMappingURL=index.d.ts.map
|
|
144
158
|
|
|
145
159
|
//#endregion
|
package/core.d.ts
CHANGED
|
@@ -495,7 +495,10 @@ declare class Alepha {
|
|
|
495
495
|
* Modules are used to group services and provide a way to register them in the container.
|
|
496
496
|
*/
|
|
497
497
|
protected modules: Array<ModuleDefinition>;
|
|
498
|
-
protected substitutions: Map<Service,
|
|
498
|
+
protected substitutions: Map<Service, {
|
|
499
|
+
use: Service;
|
|
500
|
+
module?: ModuleDefinition;
|
|
501
|
+
}>;
|
|
499
502
|
protected configurations: Map<Service, object>;
|
|
500
503
|
protected descriptorRegistry: Map<Service<Descriptor<{}>>, Descriptor<{}>[]>;
|
|
501
504
|
/**
|
|
@@ -629,10 +632,12 @@ declare class Alepha {
|
|
|
629
632
|
* > It's useful for testing or for providing different implementations of a service.
|
|
630
633
|
* > If you are interested in configuring a service, use Alepha#configure() instead.
|
|
631
634
|
*
|
|
632
|
-
* @param
|
|
635
|
+
* @param serviceEntry - The service to register in the container.
|
|
633
636
|
* @return Current instance of Alepha.
|
|
634
637
|
*/
|
|
635
|
-
with<T extends object>(
|
|
638
|
+
with<T extends object>(serviceEntry: ServiceEntry<T> | {
|
|
639
|
+
default: ServiceEntry<T>;
|
|
640
|
+
}): this;
|
|
636
641
|
/**
|
|
637
642
|
* Get the instance of the specified service and apply some changes, depending on the options.
|
|
638
643
|
* - If the service is already registered, it will return the existing instance. (except if `skipCache` is true)
|
|
@@ -814,14 +819,6 @@ interface Env extends LoggerEnv {
|
|
|
814
819
|
* Optional root module name.
|
|
815
820
|
*/
|
|
816
821
|
MODULE_NAME?: string;
|
|
817
|
-
/**
|
|
818
|
-
* If true, the container will not automatically register the default providers based on the descriptors.
|
|
819
|
-
*
|
|
820
|
-
* It means that you have to alepha.with(ServiceModule) manually. No magic.
|
|
821
|
-
*
|
|
822
|
-
* @default false
|
|
823
|
-
*/
|
|
824
|
-
EXPLICIT_PROVIDERS?: boolean;
|
|
825
822
|
}
|
|
826
823
|
interface State {
|
|
827
824
|
log: Logger;
|
|
@@ -1436,6 +1433,14 @@ declare function isEmail(value: string): boolean;
|
|
|
1436
1433
|
//# sourceMappingURL=TypeProvider.d.ts.map
|
|
1437
1434
|
//#endregion
|
|
1438
1435
|
//#region src/index.d.ts
|
|
1436
|
+
declare global {
|
|
1437
|
+
interface ImportMetaEnv {
|
|
1438
|
+
SSR: boolean;
|
|
1439
|
+
}
|
|
1440
|
+
interface ImportMeta {
|
|
1441
|
+
readonly env: ImportMetaEnv;
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1439
1444
|
/**
|
|
1440
1445
|
*
|
|
1441
1446
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alepha",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.0.0"
|
|
@@ -15,45 +15,45 @@
|
|
|
15
15
|
"main": "./core.js",
|
|
16
16
|
"types": "./core.d.ts",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@alepha/batch": "0.9.
|
|
19
|
-
"@alepha/bucket": "0.9.
|
|
20
|
-
"@alepha/cache": "0.9.
|
|
21
|
-
"@alepha/cache-redis": "0.9.
|
|
22
|
-
"@alepha/command": "0.9.
|
|
23
|
-
"@alepha/core": "0.9.
|
|
24
|
-
"@alepha/datetime": "0.9.
|
|
25
|
-
"@alepha/file": "0.9.
|
|
26
|
-
"@alepha/lock": "0.9.
|
|
27
|
-
"@alepha/lock-redis": "0.9.
|
|
28
|
-
"@alepha/postgres": "0.9.
|
|
29
|
-
"@alepha/queue": "0.9.
|
|
30
|
-
"@alepha/queue-redis": "0.9.
|
|
31
|
-
"@alepha/react": "0.9.
|
|
32
|
-
"@alepha/react-auth": "0.9.
|
|
33
|
-
"@alepha/react-head": "0.9.
|
|
34
|
-
"@alepha/redis": "0.9.
|
|
35
|
-
"@alepha/retry": "0.9.
|
|
36
|
-
"@alepha/router": "0.9.
|
|
37
|
-
"@alepha/scheduler": "0.9.
|
|
38
|
-
"@alepha/security": "0.9.
|
|
39
|
-
"@alepha/server": "0.9.
|
|
40
|
-
"@alepha/server-cache": "0.9.
|
|
41
|
-
"@alepha/server-compress": "0.9.
|
|
42
|
-
"@alepha/server-cookies": "0.9.
|
|
43
|
-
"@alepha/server-cors": "0.9.
|
|
44
|
-
"@alepha/server-health": "0.9.
|
|
45
|
-
"@alepha/server-helmet": "0.9.
|
|
46
|
-
"@alepha/server-links": "0.9.
|
|
47
|
-
"@alepha/server-metrics": "0.9.
|
|
48
|
-
"@alepha/server-multipart": "0.9.
|
|
49
|
-
"@alepha/server-proxy": "0.9.
|
|
50
|
-
"@alepha/server-security": "0.9.
|
|
51
|
-
"@alepha/server-static": "0.9.
|
|
52
|
-
"@alepha/server-swagger": "0.9.
|
|
53
|
-
"@alepha/testing": "0.9.
|
|
54
|
-
"@alepha/topic": "0.9.
|
|
55
|
-
"@alepha/topic-redis": "0.9.
|
|
56
|
-
"@alepha/vite": "0.9.
|
|
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"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"tsdown": "^0.13.0"
|
package/postgres.d.ts
CHANGED
|
@@ -18,9 +18,9 @@ import { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
|
18
18
|
import postgres from "postgres";
|
|
19
19
|
import * as _alepha_retry0 from "alepha/retry";
|
|
20
20
|
import * as _sinclair_typebox9 from "@sinclair/typebox";
|
|
21
|
-
import * as _sinclair_typebox17 from "@sinclair/typebox";
|
|
22
|
-
import * as _sinclair_typebox18 from "@sinclair/typebox";
|
|
23
21
|
import * as _sinclair_typebox16 from "@sinclair/typebox";
|
|
22
|
+
import * as _sinclair_typebox18 from "@sinclair/typebox";
|
|
23
|
+
import * as _sinclair_typebox17 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";
|
|
@@ -1398,7 +1398,7 @@ declare class NodePostgresProvider extends PostgresProvider {
|
|
|
1398
1398
|
type PgAttr<T extends TSchema$1, TAttr extends PgSymbolKeys> = T & { [K in TAttr]: PgSymbols[K] };
|
|
1399
1399
|
//#endregion
|
|
1400
1400
|
//#region src/schemas/createdAtSchema.d.ts
|
|
1401
|
-
declare const createdAtSchema: PgAttr<PgAttr<
|
|
1401
|
+
declare const createdAtSchema: PgAttr<PgAttr<_sinclair_typebox16.TString, typeof PG_CREATED_AT>, typeof PG_DEFAULT>;
|
|
1402
1402
|
//# sourceMappingURL=createdAtSchema.d.ts.map
|
|
1403
1403
|
|
|
1404
1404
|
//#endregion
|
|
@@ -1410,7 +1410,7 @@ declare const legacyIdSchema: PgAttr<PgAttr<PgAttr<_sinclair_typebox18.TInteger,
|
|
|
1410
1410
|
//# sourceMappingURL=legacyIdSchema.d.ts.map
|
|
1411
1411
|
//#endregion
|
|
1412
1412
|
//#region src/schemas/updatedAtSchema.d.ts
|
|
1413
|
-
declare const updatedAtSchema: PgAttr<PgAttr<
|
|
1413
|
+
declare const updatedAtSchema: PgAttr<PgAttr<_sinclair_typebox17.TString, typeof PG_UPDATED_AT>, typeof PG_DEFAULT>;
|
|
1414
1414
|
//# sourceMappingURL=updatedAtSchema.d.ts.map
|
|
1415
1415
|
|
|
1416
1416
|
//#endregion
|
package/react.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alepha_core10 from "alepha";
|
|
2
|
+
import * as _alepha_core16 from "alepha";
|
|
2
3
|
import * as _alepha_core14 from "alepha";
|
|
3
|
-
import * as _alepha_core12 from "alepha";
|
|
4
4
|
import * as _alepha_core0$1 from "alepha";
|
|
5
5
|
import * as _alepha_core0 from "alepha";
|
|
6
6
|
import { Alepha, Async, Descriptor, KIND, Service, Static, TObject, TSchema } from "alepha";
|
|
@@ -10,9 +10,9 @@ import { ClientScope, HttpVirtualClient, LinkProvider } from "alepha/server/link
|
|
|
10
10
|
import * as react0$1 from "react";
|
|
11
11
|
import * as react0 from "react";
|
|
12
12
|
import React, { AnchorHTMLAttributes, ErrorInfo, FC, PropsWithChildren, ReactNode } from "react";
|
|
13
|
+
import * as react_jsx_runtime0$1 from "react/jsx-runtime";
|
|
13
14
|
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
14
15
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
15
|
-
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
16
16
|
import { Route, RouterProvider } from "alepha/router";
|
|
17
17
|
import { ServerStaticProvider } from "alepha/server/static";
|
|
18
18
|
import { Root } from "react-dom/client";
|
|
@@ -157,14 +157,14 @@ type PageResolve<TConfig extends PageConfigSchema = PageConfigSchema, TPropsPare
|
|
|
157
157
|
//# sourceMappingURL=$page.d.ts.map
|
|
158
158
|
//#endregion
|
|
159
159
|
//#region src/providers/PageDescriptorProvider.d.ts
|
|
160
|
-
declare const envSchema$1:
|
|
161
|
-
REACT_STRICT_MODE:
|
|
160
|
+
declare const envSchema$1: _alepha_core10.TObject<{
|
|
161
|
+
REACT_STRICT_MODE: _alepha_core10.TBoolean;
|
|
162
162
|
}>;
|
|
163
163
|
declare module "alepha" {
|
|
164
164
|
interface Env extends Partial<Static<typeof envSchema$1>> {}
|
|
165
165
|
}
|
|
166
166
|
declare class PageDescriptorProvider {
|
|
167
|
-
protected readonly log:
|
|
167
|
+
protected readonly log: _alepha_core10.Logger;
|
|
168
168
|
protected readonly env: {
|
|
169
169
|
REACT_STRICT_MODE: boolean;
|
|
170
170
|
};
|
|
@@ -189,7 +189,7 @@ declare class PageDescriptorProvider {
|
|
|
189
189
|
}, params?: Record<string, any>): string;
|
|
190
190
|
compile(path: string, params?: Record<string, string>): string;
|
|
191
191
|
protected renderView(index: number, path: string, view: ReactNode | undefined, page: PageRoute): ReactNode;
|
|
192
|
-
protected readonly configure:
|
|
192
|
+
protected readonly configure: _alepha_core10.HookDescriptor<"configure">;
|
|
193
193
|
protected map(pages: Array<PageDescriptor>, target: PageDescriptor): PageRouteEntry;
|
|
194
194
|
add(entry: PageRouteEntry): void;
|
|
195
195
|
protected createMatch(page: PageRoute): string;
|
|
@@ -272,11 +272,11 @@ interface BrowserRoute extends Route {
|
|
|
272
272
|
page: PageRoute;
|
|
273
273
|
}
|
|
274
274
|
declare class BrowserRouterProvider extends RouterProvider<BrowserRoute> {
|
|
275
|
-
protected readonly log:
|
|
275
|
+
protected readonly log: _alepha_core16.Logger;
|
|
276
276
|
protected readonly alepha: Alepha;
|
|
277
277
|
protected readonly pageDescriptorProvider: PageDescriptorProvider;
|
|
278
278
|
add(entry: PageRouteEntry): void;
|
|
279
|
-
protected readonly configure:
|
|
279
|
+
protected readonly configure: _alepha_core16.HookDescriptor<"configure">;
|
|
280
280
|
transition(url: URL, options?: TransitionOptions): Promise<RouterRenderResult>;
|
|
281
281
|
root(state: RouterState, context: PageReactContext): ReactNode;
|
|
282
282
|
}
|
|
@@ -284,7 +284,7 @@ declare class BrowserRouterProvider extends RouterProvider<BrowserRoute> {
|
|
|
284
284
|
//#endregion
|
|
285
285
|
//#region src/providers/ReactBrowserProvider.d.ts
|
|
286
286
|
declare class ReactBrowserProvider {
|
|
287
|
-
protected readonly log:
|
|
287
|
+
protected readonly log: _alepha_core14.Logger;
|
|
288
288
|
protected readonly client: LinkProvider;
|
|
289
289
|
protected readonly alepha: Alepha;
|
|
290
290
|
protected readonly router: BrowserRouterProvider;
|
|
@@ -308,7 +308,7 @@ declare class ReactBrowserProvider {
|
|
|
308
308
|
* Get embedded layers from the server.
|
|
309
309
|
*/
|
|
310
310
|
protected getHydrationState(): ReactHydrationState | undefined;
|
|
311
|
-
readonly ready:
|
|
311
|
+
readonly ready: _alepha_core14.HookDescriptor<"ready">;
|
|
312
312
|
}
|
|
313
313
|
interface RouterGoOptions {
|
|
314
314
|
replace?: boolean;
|
|
@@ -366,7 +366,7 @@ interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
|
366
366
|
to: string | PageDescriptor;
|
|
367
367
|
children?: React.ReactNode;
|
|
368
368
|
}
|
|
369
|
-
declare const Link: (props: LinkProps) =>
|
|
369
|
+
declare const Link: (props: LinkProps) => react_jsx_runtime0$1.JSX.Element | null;
|
|
370
370
|
//#endregion
|
|
371
371
|
//#region src/components/NestedView.d.ts
|
|
372
372
|
interface NestedViewProps {
|
|
@@ -393,10 +393,10 @@ interface NestedViewProps {
|
|
|
393
393
|
* }
|
|
394
394
|
* ```
|
|
395
395
|
*/
|
|
396
|
-
declare const NestedView: (props: NestedViewProps) =>
|
|
396
|
+
declare const NestedView: (props: NestedViewProps) => react_jsx_runtime1.JSX.Element;
|
|
397
397
|
//#endregion
|
|
398
398
|
//#region src/components/NotFound.d.ts
|
|
399
|
-
declare function NotFoundPage():
|
|
399
|
+
declare function NotFoundPage(): react_jsx_runtime0.JSX.Element;
|
|
400
400
|
//# sourceMappingURL=NotFound.d.ts.map
|
|
401
401
|
//#endregion
|
|
402
402
|
//#region src/contexts/RouterContext.d.ts
|
|
@@ -543,11 +543,11 @@ declare const envSchema: _alepha_core0$1.TObject<{
|
|
|
543
543
|
REACT_SERVER_PREFIX: _alepha_core0$1.TString;
|
|
544
544
|
REACT_SSR_ENABLED: _alepha_core0$1.TOptional<_alepha_core0$1.TBoolean>;
|
|
545
545
|
REACT_ROOT_ID: _alepha_core0$1.TString;
|
|
546
|
+
REACT_SERVER_TEMPLATE: _alepha_core0$1.TOptional<_alepha_core0$1.TString>;
|
|
546
547
|
}>;
|
|
547
548
|
declare module "alepha" {
|
|
548
549
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
549
550
|
interface State {
|
|
550
|
-
"react.server.template"?: string;
|
|
551
551
|
"react.server.ssr"?: boolean;
|
|
552
552
|
}
|
|
553
553
|
}
|
|
@@ -560,6 +560,7 @@ declare class ReactServerProvider {
|
|
|
560
560
|
protected readonly serverTimingProvider: ServerTimingProvider;
|
|
561
561
|
protected readonly env: {
|
|
562
562
|
REACT_SSR_ENABLED?: boolean | undefined;
|
|
563
|
+
REACT_SERVER_TEMPLATE?: string | undefined;
|
|
563
564
|
REACT_SERVER_DIST: string;
|
|
564
565
|
REACT_SERVER_PREFIX: string;
|
|
565
566
|
REACT_ROOT_ID: string;
|
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";
|
|
8
7
|
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:
|
|
59
|
-
name:
|
|
60
|
-
group:
|
|
61
|
-
description:
|
|
62
|
-
method:
|
|
63
|
-
path:
|
|
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>;
|
|
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:
|
|
70
|
-
name:
|
|
71
|
-
description:
|
|
72
|
-
default:
|
|
73
|
-
permissions:
|
|
74
|
-
name:
|
|
75
|
-
ownership:
|
|
76
|
-
exclude:
|
|
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>>;
|
|
77
77
|
}>>;
|
|
78
78
|
}>;
|
|
79
79
|
type Role = Static<typeof roleSchema>;
|
package/server/security.d.ts
CHANGED
|
@@ -62,7 +62,9 @@ declare module "alepha/server" {
|
|
|
62
62
|
* If true, the route will be protected by the security provider.
|
|
63
63
|
* All actions are secure by default, but you can disable it for specific actions.
|
|
64
64
|
*/
|
|
65
|
-
secure?: boolean
|
|
65
|
+
secure?: boolean | {
|
|
66
|
+
optional?: boolean;
|
|
67
|
+
};
|
|
66
68
|
}
|
|
67
69
|
interface ClientRequestOptions extends FetchOptions {
|
|
68
70
|
/**
|
package/server.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _alepha_core1 from "alepha";
|
|
2
2
|
import * as _alepha_core0$1 from "alepha";
|
|
3
|
-
import * as _alepha_core5 from "alepha";
|
|
4
|
-
import * as _alepha_core13 from "alepha";
|
|
5
|
-
import * as _alepha_core12 from "alepha";
|
|
6
3
|
import * as _alepha_core2 from "alepha";
|
|
4
|
+
import * as _alepha_core9 from "alepha";
|
|
5
|
+
import * as _alepha_core13 from "alepha";
|
|
6
|
+
import * as _alepha_core14 from "alepha";
|
|
7
7
|
import * as _alepha_core0 from "alepha";
|
|
8
8
|
import { Alepha, Async, Descriptor, FileLike, KIND, Static, StreamLike, TObject, TSchema } from "alepha";
|
|
9
9
|
import { Readable } from "node:stream";
|
|
@@ -11,10 +11,10 @@ import { ReadableStream } from "node:stream/web";
|
|
|
11
11
|
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
|
-
import { DurationLike } from "alepha/datetime";
|
|
15
|
-
import * as _sinclair_typebox7 from "@sinclair/typebox";
|
|
16
|
-
import * as _sinclair_typebox33 from "@sinclair/typebox";
|
|
14
|
+
import { DateTimeProvider, DurationLike } from "alepha/datetime";
|
|
17
15
|
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:
|
|
474
|
-
name:
|
|
475
|
-
path:
|
|
476
|
-
method:
|
|
477
|
-
group:
|
|
478
|
-
requestBodyType:
|
|
479
|
-
service:
|
|
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>;
|
|
480
480
|
}>;
|
|
481
|
-
declare const apiLinksResponseSchema:
|
|
482
|
-
prefix:
|
|
483
|
-
links:
|
|
484
|
-
name:
|
|
485
|
-
path:
|
|
486
|
-
method:
|
|
487
|
-
group:
|
|
488
|
-
requestBodyType:
|
|
489
|
-
service:
|
|
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>;
|
|
490
490
|
}>>;
|
|
491
491
|
}>;
|
|
492
492
|
type ApiLinksResponse = Static<typeof apiLinksResponseSchema>;
|
|
@@ -507,49 +507,50 @@ declare const errorSchema: _sinclair_typebox33.TObject<{
|
|
|
507
507
|
//# sourceMappingURL=errorSchema.d.ts.map
|
|
508
508
|
//#endregion
|
|
509
509
|
//#region src/schemas/okSchema.d.ts
|
|
510
|
-
declare const okSchema:
|
|
511
|
-
ok:
|
|
512
|
-
id:
|
|
513
|
-
count:
|
|
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>;
|
|
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:
|
|
520
|
-
SERVER_PORT:
|
|
521
|
-
SERVER_HOST:
|
|
519
|
+
declare const envSchema: _alepha_core2.TObject<{
|
|
520
|
+
SERVER_PORT: _alepha_core2.TNumber;
|
|
521
|
+
SERVER_HOST: _alepha_core2.TString;
|
|
522
522
|
}>;
|
|
523
523
|
declare module "alepha" {
|
|
524
524
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
525
525
|
}
|
|
526
526
|
declare class NodeHttpServerProvider extends ServerProvider {
|
|
527
527
|
protected readonly alepha: Alepha;
|
|
528
|
-
protected readonly
|
|
528
|
+
protected readonly dateTimeProvider: DateTimeProvider;
|
|
529
|
+
protected readonly log: _alepha_core2.Logger;
|
|
529
530
|
protected readonly env: {
|
|
530
531
|
SERVER_PORT: number;
|
|
531
532
|
SERVER_HOST: string;
|
|
532
533
|
};
|
|
533
534
|
protected readonly router: ServerRouterProvider;
|
|
534
535
|
protected readonly server: http0.Server<typeof IncomingMessage, typeof ServerResponse$1>;
|
|
535
|
-
protected readonly onNodeRequest:
|
|
536
|
+
protected readonly onNodeRequest: _alepha_core2.HookDescriptor<"node:request">;
|
|
536
537
|
handle(req: IncomingMessage, res: ServerResponse$1): Promise<void>;
|
|
537
538
|
createRouterRequest(req: IncomingMessage, res: ServerResponse$1, params?: Record<string, string>): ServerRawRequest;
|
|
538
539
|
getProtocol(req: IncomingMessage): "http" | "https";
|
|
539
540
|
get hostname(): string;
|
|
540
|
-
readonly start:
|
|
541
|
-
protected readonly stop:
|
|
541
|
+
readonly start: _alepha_core2.HookDescriptor<"start">;
|
|
542
|
+
protected readonly stop: _alepha_core2.HookDescriptor<"stop">;
|
|
542
543
|
protected listen(): Promise<void>;
|
|
543
544
|
protected close(): Promise<void>;
|
|
544
545
|
}
|
|
545
546
|
//#endregion
|
|
546
547
|
//#region src/providers/ServerLoggerProvider.d.ts
|
|
547
548
|
declare class ServerLoggerProvider {
|
|
548
|
-
protected readonly log:
|
|
549
|
+
protected readonly log: _alepha_core9.Logger;
|
|
549
550
|
protected readonly alepha: Alepha;
|
|
550
|
-
readonly onRequest:
|
|
551
|
-
readonly onError:
|
|
552
|
-
readonly onResponse:
|
|
551
|
+
readonly onRequest: _alepha_core9.HookDescriptor<"server:onRequest">;
|
|
552
|
+
readonly onError: _alepha_core9.HookDescriptor<"server:onError">;
|
|
553
|
+
readonly onResponse: _alepha_core9.HookDescriptor<"server:onResponse">;
|
|
553
554
|
}
|
|
554
555
|
//# sourceMappingURL=ServerLoggerProvider.d.ts.map
|
|
555
556
|
//#endregion
|
|
@@ -563,17 +564,17 @@ declare class ServerLoggerProvider {
|
|
|
563
564
|
*/
|
|
564
565
|
declare class ServerNotReadyProvider {
|
|
565
566
|
protected readonly alepha: Alepha;
|
|
566
|
-
readonly onRequest:
|
|
567
|
+
readonly onRequest: _alepha_core13.HookDescriptor<"server:onRequest">;
|
|
567
568
|
}
|
|
568
569
|
//# sourceMappingURL=ServerNotReadyProvider.d.ts.map
|
|
569
570
|
//#endregion
|
|
570
571
|
//#region src/providers/ServerTimingProvider.d.ts
|
|
571
572
|
type TimingMap = Record<string, [number, number]>;
|
|
572
573
|
declare class ServerTimingProvider {
|
|
573
|
-
protected readonly log:
|
|
574
|
+
protected readonly log: _alepha_core14.Logger;
|
|
574
575
|
protected readonly alepha: Alepha;
|
|
575
|
-
readonly onRequest:
|
|
576
|
-
readonly onResponse:
|
|
576
|
+
readonly onRequest: _alepha_core14.HookDescriptor<"server:onRequest">;
|
|
577
|
+
readonly onResponse: _alepha_core14.HookDescriptor<"server:onResponse">;
|
|
577
578
|
protected get handlerName(): string;
|
|
578
579
|
beginTiming(name: string): void;
|
|
579
580
|
endTiming(name: string): void;
|
package/topic.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import * as _alepha_core2 from "alepha";
|
|
1
2
|
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:
|
|
79
|
+
protected readonly log: _alepha_core2.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:
|
|
130
|
+
protected readonly log: _alepha_core0$1.Logger;
|
|
131
131
|
protected readonly subscriptions: Record<string, SubscribeCallback[]>;
|
|
132
|
-
protected readonly start:
|
|
132
|
+
protected readonly start: _alepha_core0$1.HookDescriptor<"start">;
|
|
133
133
|
/**
|
|
134
134
|
* Publish a message to a topic.
|
|
135
135
|
*
|