@noxfly/noxus 2.5.0 → 3.0.0-dev.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.
- package/README.md +403 -341
- package/dist/app-injector-Bz3Upc0y.d.mts +125 -0
- package/dist/app-injector-Bz3Upc0y.d.ts +125 -0
- package/dist/child.d.mts +48 -22
- package/dist/child.d.ts +48 -22
- package/dist/child.js +1111 -1341
- package/dist/child.mjs +1087 -1295
- package/dist/main.d.mts +301 -309
- package/dist/main.d.ts +301 -309
- package/dist/main.js +1471 -1650
- package/dist/main.mjs +1420 -1570
- package/dist/renderer.d.mts +3 -3
- package/dist/renderer.d.ts +3 -3
- package/dist/renderer.js +109 -135
- package/dist/renderer.mjs +109 -135
- package/dist/request-BlTtiHbi.d.ts +112 -0
- package/dist/request-qJ9EiDZc.d.mts +112 -0
- package/package.json +7 -7
- package/src/DI/app-injector.ts +95 -106
- package/src/DI/injector-explorer.ts +93 -119
- package/src/DI/token.ts +53 -0
- package/src/app.ts +141 -168
- package/src/bootstrap.ts +78 -54
- package/src/decorators/controller.decorator.ts +38 -27
- package/src/decorators/guards.decorator.ts +5 -64
- package/src/decorators/injectable.decorator.ts +68 -15
- package/src/decorators/method.decorator.ts +40 -81
- package/src/decorators/middleware.decorator.ts +5 -72
- package/src/index.ts +2 -0
- package/src/main.ts +4 -8
- package/src/non-electron-process.ts +0 -1
- package/src/preload-bridge.ts +1 -1
- package/src/renderer-client.ts +2 -2
- package/src/renderer-events.ts +1 -1
- package/src/request.ts +3 -3
- package/src/router.ts +190 -431
- package/src/routes.ts +78 -0
- package/src/socket.ts +4 -4
- package/src/window/window-manager.ts +255 -0
- package/tsconfig.json +5 -10
- package/tsup.config.ts +2 -2
- package/dist/app-injector-B3MvgV3k.d.mts +0 -95
- package/dist/app-injector-B3MvgV3k.d.ts +0 -95
- package/dist/request-CdpZ9qZL.d.ts +0 -167
- package/dist/request-Dx_5Prte.d.mts +0 -167
- package/src/decorators/inject.decorator.ts +0 -24
- package/src/decorators/injectable.metadata.ts +0 -15
- package/src/decorators/module.decorator.ts +0 -75
|
@@ -4,71 +4,12 @@
|
|
|
4
4
|
* @author NoxFly
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { Request } from '
|
|
8
|
-
import {
|
|
9
|
-
import { MaybeAsync, Type } from 'src/utils/types';
|
|
7
|
+
import { Request } from '../request';
|
|
8
|
+
import { MaybeAsync } from '../utils/types';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* The `canActivate` method can return either a value or a Promise.
|
|
15
|
-
* Use it on a class that should be registered as a guard in the application.
|
|
16
|
-
* Guards can be used to protect routes or controller actions.
|
|
17
|
-
* For example, you can use guards to check if the user is authenticated or has the right permissions.
|
|
18
|
-
* You can use the `Authorize` decorator to register guards for a controller or a controller action.
|
|
19
|
-
* @see Authorize
|
|
11
|
+
* A guard decides whether an incoming request should reach the handler.
|
|
12
|
+
* Implement this interface and pass the class to @Controller({ guards }) or @Get('path', { guards }).
|
|
20
13
|
*/
|
|
21
|
-
export interface IGuard {
|
|
22
|
-
canActivate(request: Request): MaybeAsync<boolean>;
|
|
23
|
-
}
|
|
24
14
|
|
|
25
|
-
|
|
26
|
-
* Can be used to protect the routes of a controller.
|
|
27
|
-
* Can be used on a controller class or on a controller method.
|
|
28
|
-
*/
|
|
29
|
-
export function Authorize(...guardClasses: Type<IGuard>[]): MethodDecorator & ClassDecorator {
|
|
30
|
-
return (target: Function | object, propertyKey?: string | symbol) => {
|
|
31
|
-
let key: string;
|
|
32
|
-
|
|
33
|
-
// Method decorator
|
|
34
|
-
if(propertyKey) {
|
|
35
|
-
const ctrlName = target.constructor.name;
|
|
36
|
-
const actionName = propertyKey as string;
|
|
37
|
-
key = `${ctrlName}.${actionName}`;
|
|
38
|
-
}
|
|
39
|
-
// Class decorator
|
|
40
|
-
else {
|
|
41
|
-
const ctrlName = (target as Type<unknown>).name;
|
|
42
|
-
key = `${ctrlName}`;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if(authorizations.has(key)) {
|
|
46
|
-
throw new Error(`Guard(s) already registered for ${key}`);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
authorizations.set(key, guardClasses);
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Gets the guards for a controller or a controller action.
|
|
55
|
-
* @param controllerName The name of the controller to get the guards for.
|
|
56
|
-
* @returns An array of guards for the controller.
|
|
57
|
-
*/
|
|
58
|
-
export function getGuardForController(controllerName: string): Type<IGuard>[] {
|
|
59
|
-
const key = `${controllerName}`;
|
|
60
|
-
return authorizations.get(key) ?? [];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Gets the guards for a controller action.
|
|
65
|
-
* @param controllerName The name of the controller to get the guards for.
|
|
66
|
-
* @param actionName The name of the action to get the guards for.
|
|
67
|
-
* @returns An array of guards for the controller action.
|
|
68
|
-
*/
|
|
69
|
-
export function getGuardForControllerAction(controllerName: string, actionName: string): Type<IGuard>[] {
|
|
70
|
-
const key = `${controllerName}.${actionName}`;
|
|
71
|
-
return authorizations.get(key) ?? [];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const authorizations = new Map<string, Type<IGuard>[]>();
|
|
15
|
+
export type Guard = (request: Request) => MaybeAsync<boolean>;
|
|
@@ -4,25 +4,78 @@
|
|
|
4
4
|
* @author NoxFly
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { Lifetime } from
|
|
8
|
-
import { InjectorExplorer } from
|
|
9
|
-
import {
|
|
10
|
-
import { Type } from
|
|
11
|
-
|
|
7
|
+
import { Lifetime } from '../DI/app-injector';
|
|
8
|
+
import { InjectorExplorer } from '../DI/injector-explorer';
|
|
9
|
+
import { Token, TokenKey } from '../DI/token';
|
|
10
|
+
import { Type } from '../utils/types';
|
|
11
|
+
|
|
12
|
+
export interface InjectableOptions {
|
|
13
|
+
/**
|
|
14
|
+
* Lifetime of this injectable.
|
|
15
|
+
* @default 'scope'
|
|
16
|
+
*/
|
|
17
|
+
lifetime?: Lifetime;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Explicit list of constructor dependencies, in the same order as the constructor parameters.
|
|
21
|
+
* Each entry is either a class constructor or a Token created with token().
|
|
22
|
+
*
|
|
23
|
+
* This replaces reflect-metadata / emitDecoratorMetadata entirely.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* @Injectable({ lifetime: 'singleton', deps: [MyRepo, DB_URL] })
|
|
27
|
+
* class MyService {
|
|
28
|
+
* constructor(private repo: MyRepo, private dbUrl: string) {}
|
|
29
|
+
* }
|
|
30
|
+
*/
|
|
31
|
+
deps?: ReadonlyArray<TokenKey>;
|
|
32
|
+
}
|
|
12
33
|
|
|
13
34
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
35
|
+
* Marks a class as injectable into the Noxus DI container.
|
|
36
|
+
*
|
|
37
|
+
* Unlike the v2 @Injectable, this decorator:
|
|
38
|
+
* - Does NOT require reflect-metadata or emitDecoratorMetadata.
|
|
39
|
+
* - Requires you to declare deps explicitly when the class has constructor parameters.
|
|
40
|
+
* - Supports standalone usage — no module declaration needed.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* // No dependencies
|
|
44
|
+
* @Injectable()
|
|
45
|
+
* class Logger {}
|
|
46
|
+
*
|
|
47
|
+
* // With dependencies
|
|
48
|
+
* @Injectable({ lifetime: 'singleton', deps: [Logger, MyRepo] })
|
|
49
|
+
* class MyService {
|
|
50
|
+
* constructor(private logger: Logger, private repo: MyRepo) {}
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* // With a named token
|
|
54
|
+
* const DB_URL = token<string>('DB_URL');
|
|
55
|
+
*
|
|
56
|
+
* @Injectable({ deps: [DB_URL] })
|
|
57
|
+
* class DbService {
|
|
58
|
+
* constructor(private url: string) {}
|
|
59
|
+
* }
|
|
19
60
|
*/
|
|
20
|
-
export function Injectable(
|
|
61
|
+
export function Injectable(options: InjectableOptions = {}): ClassDecorator {
|
|
62
|
+
const { lifetime = 'scope', deps = [] } = options;
|
|
63
|
+
|
|
21
64
|
return (target) => {
|
|
22
|
-
if (typeof target !==
|
|
23
|
-
throw new Error(`@Injectable can only be
|
|
65
|
+
if (typeof target !== 'function' || !target.prototype) {
|
|
66
|
+
throw new Error(`@Injectable can only be applied to classes, not ${typeof target}`);
|
|
24
67
|
}
|
|
25
|
-
|
|
26
|
-
|
|
68
|
+
|
|
69
|
+
const key = target as unknown as Type<unknown>;
|
|
70
|
+
|
|
71
|
+
InjectorExplorer.enqueue({
|
|
72
|
+
key,
|
|
73
|
+
implementation: key,
|
|
74
|
+
lifetime,
|
|
75
|
+
deps,
|
|
76
|
+
isController: false,
|
|
77
|
+
});
|
|
27
78
|
};
|
|
28
79
|
}
|
|
80
|
+
|
|
81
|
+
export { Token, TokenKey };
|
|
@@ -4,104 +4,63 @@
|
|
|
4
4
|
* @author NoxFly
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Guard } from './guards.decorator';
|
|
8
|
+
import { Middleware } from './middleware.decorator';
|
|
9
|
+
|
|
10
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'BATCH';
|
|
11
|
+
export type AtomicHttpMethod = Exclude<HttpMethod, 'BATCH'>;
|
|
12
|
+
|
|
13
|
+
const ATOMIC_METHODS = new Set<AtomicHttpMethod>(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']);
|
|
14
|
+
export function isAtomicHttpMethod(m: unknown): m is AtomicHttpMethod {
|
|
15
|
+
return typeof m === 'string' && ATOMIC_METHODS.has(m as AtomicHttpMethod);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface IRouteOptions {
|
|
19
|
+
/**
|
|
20
|
+
* Guards specific to this route (merged with controller guards).
|
|
21
|
+
*/
|
|
22
|
+
guards?: Guard[];
|
|
23
|
+
/**
|
|
24
|
+
* Middlewares specific to this route (merged with controller middlewares).
|
|
25
|
+
*/
|
|
26
|
+
middlewares?: Middleware[];
|
|
27
|
+
}
|
|
9
28
|
|
|
10
|
-
/**
|
|
11
|
-
* IRouteMetadata interface defines the metadata for a route.
|
|
12
|
-
* It includes the HTTP method, path, handler name, and guards associated with the route.
|
|
13
|
-
* This metadata is used to register the route in the application.
|
|
14
|
-
* This is the configuration that waits a route's decorator.
|
|
15
|
-
*/
|
|
16
29
|
export interface IRouteMetadata {
|
|
17
30
|
method: HttpMethod;
|
|
18
31
|
path: string;
|
|
19
32
|
handler: string;
|
|
20
|
-
guards:
|
|
33
|
+
guards: Guard[];
|
|
34
|
+
middlewares: Middleware[];
|
|
21
35
|
}
|
|
22
36
|
|
|
23
|
-
|
|
24
|
-
* The different HTTP methods that can be used in the application.
|
|
25
|
-
*/
|
|
26
|
-
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'BATCH';
|
|
37
|
+
const routeMetaMap = new WeakMap<object, IRouteMetadata[]>();
|
|
27
38
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
*/
|
|
31
|
-
export type AtomicHttpMethod = Exclude<HttpMethod, 'BATCH'>;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* The configuration that waits a route's decorator.
|
|
35
|
-
* It contains the HTTP method, path, handler, and guards for the route.
|
|
36
|
-
* @param verb The HTTP method for the route.
|
|
37
|
-
* @returns A method decorator that registers the route with the specified HTTP method.
|
|
38
|
-
*/
|
|
39
|
-
function createRouteDecorator(verb: HttpMethod): (path: string) => MethodDecorator {
|
|
40
|
-
return (path: string): MethodDecorator => {
|
|
39
|
+
function createRouteDecorator(verb: HttpMethod) {
|
|
40
|
+
return (path: string, options: IRouteOptions = {}): MethodDecorator => {
|
|
41
41
|
return (target, propertyKey) => {
|
|
42
|
-
const
|
|
42
|
+
const ctor = target.constructor;
|
|
43
|
+
const existing: IRouteMetadata[] = routeMetaMap.get(ctor) ?? [];
|
|
43
44
|
|
|
44
|
-
|
|
45
|
+
existing.push({
|
|
45
46
|
method: verb,
|
|
46
|
-
path: path.trim().replace(/^\/|\/$/g, ''),
|
|
47
|
+
path: (path ?? '').trim().replace(/^\/|\/$/g, ''),
|
|
47
48
|
handler: propertyKey as string,
|
|
48
|
-
guards:
|
|
49
|
-
|
|
49
|
+
guards: options.guards ?? [],
|
|
50
|
+
middlewares: options.middlewares ?? [],
|
|
51
|
+
});
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Reflect.defineMetadata(ROUTE_METADATA_KEY, existingRoutes, target.constructor);
|
|
53
|
+
routeMetaMap.set(ctor, existing);
|
|
54
54
|
};
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
* This metadata includes the HTTP method, path, handler, and guards defined by the route decorators.
|
|
61
|
-
* @see Get
|
|
62
|
-
* @see Post
|
|
63
|
-
* @see Put
|
|
64
|
-
* @see Patch
|
|
65
|
-
* @see Delete
|
|
66
|
-
* @param target The target class to get the route metadata from.
|
|
67
|
-
* @returns An array of route metadata if it exists, otherwise an empty array.
|
|
68
|
-
*/
|
|
69
|
-
export function getRouteMetadata(target: Type<unknown>): IRouteMetadata[] {
|
|
70
|
-
return Reflect.getMetadata(ROUTE_METADATA_KEY, target) || [];
|
|
58
|
+
export function getRouteMetadata(target: object): IRouteMetadata[] {
|
|
59
|
+
return routeMetaMap.get(target) ?? [];
|
|
71
60
|
}
|
|
72
61
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
*/
|
|
78
|
-
export const Get = createRouteDecorator('GET');
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Route decorator that defines a leaf in the routing tree, attaching it to a controller method
|
|
82
|
-
* that will be called when the route is matched.
|
|
83
|
-
* This route will have to be called with the POST method.
|
|
84
|
-
*/
|
|
85
|
-
export const Post = createRouteDecorator('POST');
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Route decorator that defines a leaf in the routing tree, attaching it to a controller method
|
|
89
|
-
* that will be called when the route is matched.
|
|
90
|
-
* This route will have to be called with the PUT method.
|
|
91
|
-
*/
|
|
92
|
-
export const Put = createRouteDecorator('PUT');
|
|
93
|
-
/**
|
|
94
|
-
* Route decorator that defines a leaf in the routing tree, attaching it to a controller method
|
|
95
|
-
* that will be called when the route is matched.
|
|
96
|
-
* This route will have to be called with the PATCH method.
|
|
97
|
-
*/
|
|
98
|
-
export const Patch = createRouteDecorator('PATCH');
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Route decorator that defines a leaf in the routing tree, attaching it to a controller method
|
|
102
|
-
* that will be called when the route is matched.
|
|
103
|
-
* This route will have to be called with the DELETE method.
|
|
104
|
-
*/
|
|
62
|
+
export const Get = createRouteDecorator('GET');
|
|
63
|
+
export const Post = createRouteDecorator('POST');
|
|
64
|
+
export const Put = createRouteDecorator('PUT');
|
|
65
|
+
export const Patch = createRouteDecorator('PATCH');
|
|
105
66
|
export const Delete = createRouteDecorator('DELETE');
|
|
106
|
-
|
|
107
|
-
export const ROUTE_METADATA_KEY = Symbol('ROUTE_METADATA_KEY');
|
|
@@ -4,79 +4,12 @@
|
|
|
4
4
|
* @author NoxFly
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { IResponse, Request } from
|
|
8
|
-
import {
|
|
9
|
-
import { MaybeAsync, Type } from "src/utils/types";
|
|
7
|
+
import { IResponse, Request } from '../request';
|
|
8
|
+
import { MaybeAsync } from '../utils/types';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* A middleware intercepts requests before they reach guards and the handler.
|
|
12
|
+
* Implement this interface and pass the class to @Controller({ middlewares }) or per-route options.
|
|
14
13
|
*/
|
|
14
|
+
export type Middleware = (request: Request, response: IResponse, next: NextFunction) => MaybeAsync<void>;
|
|
15
15
|
export type NextFunction = () => Promise<void>;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* IMiddleware interface defines a middleware that can be used in the application.
|
|
19
|
-
* It has an `invoke` method that takes a request, a response, and a next function.
|
|
20
|
-
* The `invoke` method can return a MaybeAsync, which means it can return either a value or a Promise.
|
|
21
|
-
*
|
|
22
|
-
* Use it on a class that should be registered as a middleware in the application.
|
|
23
|
-
*/
|
|
24
|
-
export interface IMiddleware {
|
|
25
|
-
invoke(request: Request, response: IResponse, next: NextFunction): MaybeAsync<void>;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* UseMiddlewares decorator can be used to register middlewares for a controller or a controller action.
|
|
30
|
-
*
|
|
31
|
-
* @param mdlw - The middlewares list to register for the controller or the controller action.
|
|
32
|
-
*/
|
|
33
|
-
export function UseMiddlewares(mdlw: Type<IMiddleware>[]): ClassDecorator & MethodDecorator {
|
|
34
|
-
return (target: Function | object, propertyKey?: string | symbol) => {
|
|
35
|
-
let key: string;
|
|
36
|
-
|
|
37
|
-
// Method decorator
|
|
38
|
-
if(propertyKey) {
|
|
39
|
-
const ctrlName = target.constructor.name;
|
|
40
|
-
const actionName = propertyKey as string;
|
|
41
|
-
key = `${ctrlName}.${actionName}`;
|
|
42
|
-
}
|
|
43
|
-
// Class decorator
|
|
44
|
-
else {
|
|
45
|
-
const ctrlName = (target as Type<unknown>).name;
|
|
46
|
-
key = `${ctrlName}`;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if(middlewares.has(key)) {
|
|
50
|
-
throw new Error(`Middlewares(s) already registered for ${key}`);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
middlewares.set(key, mdlw);
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Gets the middlewares for a controller or a controller action.
|
|
59
|
-
* This function retrieves the middlewares registered with the UseMiddlewares decorator.
|
|
60
|
-
* It returns an array of middleware classes that can be used to process requests for the specified controller.
|
|
61
|
-
* @param controllerName The name of the controller to get the middlewares for.
|
|
62
|
-
* @returns An array of middlewares for the controller.
|
|
63
|
-
*/
|
|
64
|
-
export function getMiddlewaresForController(controllerName: string): Type<IMiddleware>[] {
|
|
65
|
-
const key = `${controllerName}`;
|
|
66
|
-
return middlewares.get(key) ?? [];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Gets the middlewares for a controller action.
|
|
71
|
-
* This function retrieves the middlewares registered with the UseMiddlewares decorator for a specific action in a controller.
|
|
72
|
-
* It returns an array of middleware classes that can be used to process requests for the specified controller action.
|
|
73
|
-
* @param controllerName The name of the controller to get the middlewares for.
|
|
74
|
-
* @param actionName The name of the action to get the middlewares for.
|
|
75
|
-
* @returns An array of middlewares for the controller action.
|
|
76
|
-
*/
|
|
77
|
-
export function getMiddlewaresForControllerAction(controllerName: string, actionName: string): Type<IMiddleware>[] {
|
|
78
|
-
const key = `${controllerName}.${actionName}`;
|
|
79
|
-
return middlewares.get(key) ?? [];
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const middlewares = new Map<string, Type<IMiddleware>[]>();
|
package/src/index.ts
CHANGED
package/src/main.ts
CHANGED
|
@@ -2,15 +2,12 @@
|
|
|
2
2
|
* @copyright 2025 NoxFly
|
|
3
3
|
* @license MIT
|
|
4
4
|
* @author NoxFly
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
5
|
+
*
|
|
8
6
|
* Entry point for Electron main-process consumers.
|
|
9
|
-
* order of exports here matters and can affect module resolution.
|
|
10
|
-
* Please be cautious when modifying.
|
|
11
7
|
*/
|
|
12
8
|
|
|
13
9
|
export * from './DI/app-injector';
|
|
10
|
+
export * from './DI/token';
|
|
14
11
|
export * from './router';
|
|
15
12
|
export * from './app';
|
|
16
13
|
export * from './bootstrap';
|
|
@@ -19,12 +16,11 @@ export * from './decorators/middleware.decorator';
|
|
|
19
16
|
export * from './decorators/guards.decorator';
|
|
20
17
|
export * from './decorators/controller.decorator';
|
|
21
18
|
export * from './decorators/injectable.decorator';
|
|
22
|
-
export * from './decorators/inject.decorator';
|
|
23
19
|
export * from './decorators/method.decorator';
|
|
24
|
-
export * from './decorators/module.decorator';
|
|
25
20
|
export * from './utils/logger';
|
|
26
21
|
export * from './utils/types';
|
|
27
22
|
export * from './utils/forward-ref';
|
|
28
23
|
export * from './request';
|
|
29
24
|
export * from './socket';
|
|
30
|
-
|
|
25
|
+
export * from './window/window-manager';
|
|
26
|
+
export * from './routes';
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
export * from './DI/app-injector';
|
|
18
18
|
export * from './exceptions';
|
|
19
19
|
export * from './decorators/injectable.decorator';
|
|
20
|
-
export * from './decorators/inject.decorator';
|
|
21
20
|
export * from './utils/logger';
|
|
22
21
|
export * from './utils/types';
|
|
23
22
|
export * from './utils/forward-ref';
|
package/src/preload-bridge.ts
CHANGED
package/src/renderer-client.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @author NoxFly
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { IBatchRequestItem, IBatchResponsePayload, IRequest, IResponse } from '
|
|
8
|
-
import { RendererEventRegistry } from '
|
|
7
|
+
import { IBatchRequestItem, IBatchResponsePayload, IRequest, IResponse } from './request';
|
|
8
|
+
import { RendererEventRegistry } from './renderer-events';
|
|
9
9
|
|
|
10
10
|
export interface IPortRequester {
|
|
11
11
|
requestPort(): void;
|
package/src/renderer-events.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Lightweight event registry to help renderer processes subscribe to
|
|
9
9
|
* push messages sent by the main process through Noxus.
|
|
10
10
|
*/
|
|
11
|
-
import { IRendererEventMessage, isRendererEventMessage } from '
|
|
11
|
+
import { IRendererEventMessage, isRendererEventMessage } from './request';
|
|
12
12
|
|
|
13
13
|
export type RendererEventHandler<TPayload = unknown> = (payload: TPayload) => void;
|
|
14
14
|
|
package/src/request.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* @author NoxFly
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
import { AtomicHttpMethod, HttpMethod } from '
|
|
9
|
-
import { AppInjector, RootInjector } from '
|
|
7
|
+
|
|
8
|
+
import { AtomicHttpMethod, HttpMethod } from './decorators/method.decorator';
|
|
9
|
+
import { AppInjector, RootInjector } from './DI/app-injector';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* The Request class represents an HTTP request in the Noxus framework.
|