@noxfly/noxus 3.0.0-dev.0 → 3.0.0-dev.10

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.
Files changed (59) hide show
  1. package/README.md +132 -16
  2. package/dist/child.d.mts +118 -4
  3. package/dist/child.d.ts +118 -4
  4. package/dist/child.js +402 -859
  5. package/dist/child.js.map +1 -0
  6. package/dist/child.mjs +389 -847
  7. package/dist/child.mjs.map +1 -0
  8. package/dist/main.d.mts +517 -25
  9. package/dist/main.d.ts +517 -25
  10. package/dist/main.js +1088 -988
  11. package/dist/main.js.map +1 -0
  12. package/dist/main.mjs +983 -884
  13. package/dist/main.mjs.map +1 -0
  14. package/dist/preload.d.mts +28 -0
  15. package/dist/preload.d.ts +28 -0
  16. package/dist/preload.js +95 -0
  17. package/dist/preload.js.map +1 -0
  18. package/dist/preload.mjs +70 -0
  19. package/dist/preload.mjs.map +1 -0
  20. package/dist/renderer.d.mts +186 -23
  21. package/dist/renderer.d.ts +186 -23
  22. package/dist/renderer.js +170 -170
  23. package/dist/renderer.js.map +1 -0
  24. package/dist/renderer.mjs +159 -157
  25. package/dist/renderer.mjs.map +1 -0
  26. package/package.json +35 -21
  27. package/.editorconfig +0 -16
  28. package/.github/copilot-instructions.md +0 -32
  29. package/.vscode/settings.json +0 -3
  30. package/eslint.config.js +0 -109
  31. package/scripts/postbuild.js +0 -31
  32. package/src/DI/app-injector.ts +0 -151
  33. package/src/DI/injector-explorer.ts +0 -143
  34. package/src/DI/token.ts +0 -53
  35. package/src/app.ts +0 -217
  36. package/src/bootstrap.ts +0 -108
  37. package/src/decorators/controller.decorator.ts +0 -58
  38. package/src/decorators/guards.decorator.ts +0 -15
  39. package/src/decorators/injectable.decorator.ts +0 -81
  40. package/src/decorators/method.decorator.ts +0 -66
  41. package/src/decorators/middleware.decorator.ts +0 -15
  42. package/src/exceptions.ts +0 -57
  43. package/src/index.ts +0 -13
  44. package/src/main.ts +0 -26
  45. package/src/non-electron-process.ts +0 -22
  46. package/src/preload-bridge.ts +0 -75
  47. package/src/renderer-client.ts +0 -338
  48. package/src/renderer-events.ts +0 -110
  49. package/src/request.ts +0 -97
  50. package/src/router.ts +0 -353
  51. package/src/routes.ts +0 -78
  52. package/src/socket.ts +0 -73
  53. package/src/utils/forward-ref.ts +0 -31
  54. package/src/utils/logger.ts +0 -430
  55. package/src/utils/radix-tree.ts +0 -210
  56. package/src/utils/types.ts +0 -21
  57. package/src/window/window-manager.ts +0 -255
  58. package/tsconfig.json +0 -29
  59. package/tsup.config.ts +0 -34
package/src/app.ts DELETED
@@ -1,217 +0,0 @@
1
- /**
2
- * @copyright 2025 NoxFly
3
- * @license MIT
4
- * @author NoxFly
5
- */
6
-
7
- import { app, BrowserWindow, ipcMain, MessageChannelMain } from 'electron/main';
8
- import { Injectable } from './decorators/injectable.decorator';
9
- import { Middleware } from './decorators/middleware.decorator';
10
- import { inject } from './DI/app-injector';
11
- import { InjectorExplorer } from './DI/injector-explorer';
12
- import { IResponse, Request } from './request';
13
- import { Router } from './router';
14
- import { NoxSocket } from './socket';
15
- import { Logger } from './utils/logger';
16
- import { Type } from './utils/types';
17
- import { WindowManager } from './window/window-manager';
18
- import { Guard } from "src/main";
19
-
20
- /**
21
- * Your application service should implement IApp.
22
- * Noxus calls these lifecycle methods at the appropriate time.
23
- *
24
- * Unlike v2, IApp no longer receives a BrowserWindow in onReady.
25
- * Use the injected WindowManager instead — it is more flexible and
26
- * does not couple the lifecycle to a single pre-created window.
27
- *
28
- * @example
29
- * @Injectable({ lifetime: 'singleton', deps: [WindowManager, MyService] })
30
- * class AppService implements IApp {
31
- * constructor(private wm: WindowManager, private svc: MyService) {}
32
- *
33
- * async onReady() {
34
- * const win = await this.wm.createSplash({ webPreferences: { preload: ... } });
35
- * win.loadFile('index.html');
36
- * }
37
- *
38
- * async onActivated() { ... }
39
- * async dispose() { ... }
40
- * }
41
- */
42
- export interface IApp {
43
- dispose(): Promise<void>;
44
- onReady(): Promise<void>;
45
- onActivated(): Promise<void>;
46
- }
47
-
48
- @Injectable({ lifetime: 'singleton', deps: [Router, NoxSocket, WindowManager] })
49
- export class NoxApp {
50
- private appService: IApp | undefined;
51
-
52
- private readonly router = inject(Router);
53
- private readonly socket = inject(NoxSocket);
54
- public readonly windowManager = inject(WindowManager);
55
-
56
- // -------------------------------------------------------------------------
57
- // Initialisation
58
- // -------------------------------------------------------------------------
59
-
60
- public async init(): Promise<this> {
61
- ipcMain.on('gimme-my-port', this.giveTheRendererAPort.bind(this));
62
- app.once('activate', this.onAppActivated.bind(this));
63
- app.once('window-all-closed', this.onAllWindowsClosed.bind(this));
64
- console.log('');
65
- return this;
66
- }
67
-
68
- // -------------------------------------------------------------------------
69
- // Public API
70
- // -------------------------------------------------------------------------
71
-
72
- /**
73
- * Registers a lazy route. The file behind this prefix is dynamically
74
- * imported on the first IPC request that targets it.
75
- *
76
- * The import function should NOT statically reference heavy modules —
77
- * the whole point is to defer their loading.
78
- *
79
- * @example
80
- * noxApp.lazy('auth', () => import('./modules/auth/auth.controller.js'));
81
- * noxApp.lazy('reporting', () => import('./modules/reporting/index.js'));
82
- */
83
- public lazy(
84
- pathPrefix: string,
85
- load: () => Promise<unknown>,
86
- guards: Guard[] = [],
87
- middlewares: Middleware[] = [],
88
- ): this {
89
- this.router.registerLazyRoute(pathPrefix, load, guards, middlewares);
90
- return this;
91
- }
92
-
93
- /**
94
- * Eagerly loads a set of modules (controllers + services) before start().
95
- * Use this for modules that provide services needed by your IApp.onReady().
96
- *
97
- * All imports run in parallel; DI is flushed with the two-phase guarantee.
98
- */
99
- public async load(importFns: Array<() => Promise<unknown>>): Promise<this> {
100
- InjectorExplorer.beginAccumulate();
101
- await Promise.all(importFns.map((fn) => fn()));
102
- InjectorExplorer.flushAccumulated();
103
- return this;
104
- }
105
-
106
- /**
107
- * Registers a global middleware applied to every route.
108
- */
109
- public use(middleware: Middleware): this {
110
- this.router.defineRootMiddleware(middleware);
111
- return this;
112
- }
113
-
114
- /**
115
- * Sets the application service (implements IApp) that receives lifecycle events.
116
- * @param appClass - Class decorated with @Injectable that implements IApp.
117
- */
118
- public configure(appClass: Type<IApp>): this {
119
- this.appService = inject(appClass);
120
- return this;
121
- }
122
-
123
- /**
124
- * Calls IApp.onReady(). Should be called after configure() and any lazy()
125
- * registrations are set up.
126
- */
127
- public start(): this {
128
- this.appService?.onReady();
129
- return this;
130
- }
131
-
132
- // -------------------------------------------------------------------------
133
- // IPC
134
- // -------------------------------------------------------------------------
135
-
136
- private readonly onRendererMessage = async (event: Electron.MessageEvent): Promise<void> => {
137
- const { senderId, requestId, path, method, body }: import('./request').IRequest = event.data;
138
- const channels = this.socket.get(senderId);
139
-
140
- if (!channels) {
141
- Logger.error(`No message channel found for sender ID: ${senderId}`);
142
- return;
143
- }
144
-
145
- try {
146
- const request = new Request(event, senderId, requestId, method, path, body);
147
- const response = await this.router.handle(request);
148
- channels.request.port1.postMessage(response);
149
- }
150
- catch (err: unknown) {
151
- const response: IResponse = {
152
- requestId,
153
- status: 500,
154
- body: null,
155
- error: err instanceof Error ? err.message : 'Internal Server Error',
156
- };
157
- channels.request.port1.postMessage(response);
158
- }
159
- };
160
-
161
- private giveTheRendererAPort(event: Electron.IpcMainInvokeEvent): void {
162
- const senderId = event.sender.id;
163
-
164
- if (this.socket.get(senderId)) {
165
- this.shutdownChannel(senderId);
166
- }
167
-
168
- const requestChannel = new MessageChannelMain();
169
- const socketChannel = new MessageChannelMain();
170
-
171
- requestChannel.port1.on('message', this.onRendererMessage);
172
- requestChannel.port1.start();
173
- socketChannel.port1.start();
174
-
175
- event.sender.once('destroyed', () => this.shutdownChannel(senderId));
176
-
177
- this.socket.register(senderId, requestChannel, socketChannel);
178
- event.sender.postMessage('port', { senderId }, [requestChannel.port2, socketChannel.port2]);
179
- }
180
-
181
- // -------------------------------------------------------------------------
182
- // Lifecycle
183
- // -------------------------------------------------------------------------
184
-
185
- private onAppActivated(): void {
186
- if (process.platform === 'darwin' && BrowserWindow.getAllWindows().length === 0) {
187
- this.appService?.onActivated();
188
- }
189
- }
190
-
191
- private async onAllWindowsClosed(): Promise<void> {
192
- for (const senderId of this.socket.getSenderIds()) {
193
- this.shutdownChannel(senderId);
194
- }
195
-
196
- Logger.info('All windows closed, shutting down application...');
197
- await this.appService?.dispose();
198
-
199
- if (process.platform !== 'darwin') app.quit();
200
- }
201
-
202
- private shutdownChannel(channelSenderId: number): void {
203
- const channels = this.socket.get(channelSenderId);
204
-
205
- if (!channels) {
206
- return;
207
- }
208
-
209
- channels.request.port1.off('message', this.onRendererMessage);
210
- channels.request.port1.close();
211
- channels.request.port2.close();
212
- channels.socket.port1.close();
213
- channels.socket.port2.close();
214
-
215
- this.socket.unregister(channelSenderId);
216
- }
217
- }
package/src/bootstrap.ts DELETED
@@ -1,108 +0,0 @@
1
- /**
2
- * @copyright 2025 NoxFly
3
- * @license MIT
4
- * @author NoxFly
5
- */
6
-
7
- import { app } from 'electron/main';
8
- import { NoxApp } from './app';
9
- import { inject, RootInjector } from './DI/app-injector';
10
- import { InjectorExplorer } from './DI/injector-explorer';
11
- import { TokenKey } from './DI/token';
12
- import { RouteDefinition } from "src/routes";
13
-
14
- /**
15
- * A singleton value override: provides an already-constructed instance
16
- * for a given token, bypassing the DI factory.
17
- *
18
- * Useful for injecting external singletons (e.g. a database connection,
19
- * a logger already configured, a third-party SDK wrapper) that cannot
20
- * or should not be constructed by the DI container.
21
- *
22
- * @example
23
- * { token: MikroORM, useValue: await MikroORM.init(config) }
24
- * { token: DB_URL, useValue: process.env.DATABASE_URL }
25
- */
26
- export interface SingletonOverride<T = unknown> {
27
- token: TokenKey<T>;
28
- useValue: T;
29
- }
30
-
31
- /**
32
- * Configuration object for bootstrapApplication.
33
- */
34
- export interface BootstrapConfig {
35
- /**
36
- * Application routing table, produced by defineRoutes().
37
- * All lazy routes are registered before the app starts.
38
- */
39
- routes?: RouteDefinition[];
40
-
41
- /**
42
- * Pre-built singleton instances to inject into the DI container
43
- * before the application starts.
44
- *
45
- * This replaces the v2 module/provider declaration pattern for
46
- * external singletons.
47
- *
48
- * @example
49
- * singletons: [
50
- * { token: MikroORM, useValue: await MikroORM.init(ormConfig) },
51
- * { token: DB_URL, useValue: process.env.DATABASE_URL! },
52
- * ]
53
- */
54
- singletons?: SingletonOverride[];
55
-
56
- /**
57
- * Controllers and services to eagerly load before NoxApp.start() is called.
58
- * Each entry is a dynamic import function — files are imported in parallel.
59
- *
60
- * Use this only for things needed at startup (e.g. if your IApp service
61
- * depends on a service in an otherwise lazy module).
62
- *
63
- * Everything else should be registered via noxApp.lazy().
64
- *
65
- * @example
66
- * eagerLoad: [
67
- * () => import('./modules/auth/auth.controller.js'),
68
- * ]
69
- */
70
- eagerLoad?: Array<() => Promise<unknown>>;
71
- }
72
-
73
- /**
74
- * Bootstraps the Noxus application.
75
- */
76
- export async function bootstrapApplication(config: BootstrapConfig = {}): Promise<NoxApp> {
77
- await app.whenReady();
78
-
79
- // Build override map for the DI flush phase
80
- const overrides = new Map<TokenKey, unknown>();
81
- for (const { token, useValue } of config.singletons ?? []) {
82
- overrides.set(token, useValue);
83
- // Pre-register the binding so the injector knows the token exists
84
- RootInjector.singletons.set(token as any, useValue);
85
- }
86
-
87
- // Flush all classes enqueued by decorators at import time (two-phase)
88
- InjectorExplorer.processPending(overrides);
89
-
90
- // Resolve core framework singletons
91
- const noxApp = inject(NoxApp);
92
-
93
- // Register routes from the routing table
94
- if (config.routes?.length) {
95
- for (const route of config.routes) {
96
- noxApp.lazy(route.path, route.load, route.guards, route.middlewares);
97
- }
98
- }
99
-
100
- // Eagerly load optional modules
101
- if (config.eagerLoad?.length) {
102
- await noxApp.load(config.eagerLoad);
103
- }
104
-
105
- await noxApp.init();
106
-
107
- return noxApp;
108
- }
@@ -1,58 +0,0 @@
1
- /**
2
- * @copyright 2025 NoxFly
3
- * @license MIT
4
- * @author NoxFly
5
- */
6
-
7
- import { InjectorExplorer } from '../DI/injector-explorer';
8
- import { TokenKey } from '../DI/token';
9
- import { Type } from '../utils/types';
10
-
11
- export interface ControllerOptions {
12
- /**
13
- * Explicit constructor dependencies.
14
- */
15
- deps?: ReadonlyArray<TokenKey>;
16
- }
17
-
18
- export interface IControllerMetadata {
19
- deps: ReadonlyArray<TokenKey>;
20
- }
21
-
22
- const controllerMetaMap = new WeakMap<object, IControllerMetadata>();
23
-
24
- /**
25
- * Marks a class as a Noxus controller.
26
- * Controllers are always scope-scoped injectables.
27
- * The route prefix and guards/middlewares are declared in defineRoutes(), not here.
28
- *
29
- * @example
30
- * @Controller({ deps: [UserService] })
31
- * export class UserController {
32
- * constructor(private svc: UserService) {}
33
- *
34
- * @Get('byId/:userId')
35
- * getUserById(req: Request) { ... }
36
- * }
37
- */
38
- export function Controller(options: ControllerOptions = {}): ClassDecorator {
39
- return (target) => {
40
- const meta: IControllerMetadata = {
41
- deps: options.deps ?? [],
42
- };
43
-
44
- controllerMetaMap.set(target, meta);
45
-
46
- InjectorExplorer.enqueue({
47
- key: target as unknown as Type<unknown>,
48
- implementation: target as unknown as Type<unknown>,
49
- lifetime: 'scope',
50
- deps: options.deps ?? [],
51
- isController: true,
52
- });
53
- };
54
- }
55
-
56
- export function getControllerMetadata(target: object): IControllerMetadata | undefined {
57
- return controllerMetaMap.get(target);
58
- }
@@ -1,15 +0,0 @@
1
- /**
2
- * @copyright 2025 NoxFly
3
- * @license MIT
4
- * @author NoxFly
5
- */
6
-
7
- import { Request } from '../request';
8
- import { MaybeAsync } from '../utils/types';
9
-
10
- /**
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 }).
13
- */
14
-
15
- export type Guard = (request: Request) => MaybeAsync<boolean>;
@@ -1,81 +0,0 @@
1
- /**
2
- * @copyright 2025 NoxFly
3
- * @license MIT
4
- * @author NoxFly
5
- */
6
-
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
- }
33
-
34
- /**
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
- * }
60
- */
61
- export function Injectable(options: InjectableOptions = {}): ClassDecorator {
62
- const { lifetime = 'scope', deps = [] } = options;
63
-
64
- return (target) => {
65
- if (typeof target !== 'function' || !target.prototype) {
66
- throw new Error(`@Injectable can only be applied to classes, not ${typeof target}`);
67
- }
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
- });
78
- };
79
- }
80
-
81
- export { Token, TokenKey };
@@ -1,66 +0,0 @@
1
- /**
2
- * @copyright 2025 NoxFly
3
- * @license MIT
4
- * @author NoxFly
5
- */
6
-
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
- }
28
-
29
- export interface IRouteMetadata {
30
- method: HttpMethod;
31
- path: string;
32
- handler: string;
33
- guards: Guard[];
34
- middlewares: Middleware[];
35
- }
36
-
37
- const routeMetaMap = new WeakMap<object, IRouteMetadata[]>();
38
-
39
- function createRouteDecorator(verb: HttpMethod) {
40
- return (path: string, options: IRouteOptions = {}): MethodDecorator => {
41
- return (target, propertyKey) => {
42
- const ctor = target.constructor;
43
- const existing: IRouteMetadata[] = routeMetaMap.get(ctor) ?? [];
44
-
45
- existing.push({
46
- method: verb,
47
- path: (path ?? '').trim().replace(/^\/|\/$/g, ''),
48
- handler: propertyKey as string,
49
- guards: options.guards ?? [],
50
- middlewares: options.middlewares ?? [],
51
- });
52
-
53
- routeMetaMap.set(ctor, existing);
54
- };
55
- };
56
- }
57
-
58
- export function getRouteMetadata(target: object): IRouteMetadata[] {
59
- return routeMetaMap.get(target) ?? [];
60
- }
61
-
62
- export const Get = createRouteDecorator('GET');
63
- export const Post = createRouteDecorator('POST');
64
- export const Put = createRouteDecorator('PUT');
65
- export const Patch = createRouteDecorator('PATCH');
66
- export const Delete = createRouteDecorator('DELETE');
@@ -1,15 +0,0 @@
1
- /**
2
- * @copyright 2025 NoxFly
3
- * @license MIT
4
- * @author NoxFly
5
- */
6
-
7
- import { IResponse, Request } from '../request';
8
- import { MaybeAsync } from '../utils/types';
9
-
10
- /**
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.
13
- */
14
- export type Middleware = (request: Request, response: IResponse, next: NextFunction) => MaybeAsync<void>;
15
- export type NextFunction = () => Promise<void>;
package/src/exceptions.ts DELETED
@@ -1,57 +0,0 @@
1
- /**
2
- * @copyright 2025 NoxFly
3
- * @license MIT
4
- * @author NoxFly
5
- */
6
-
7
- export class ResponseException extends Error {
8
- public readonly status: number = 0;
9
-
10
- constructor(message?: string);
11
- constructor(statusCode?: number, message?: string);
12
- constructor(statusOrMessage?: number | string, message?: string) {
13
- let statusCode: number | undefined;
14
-
15
- if(typeof statusOrMessage === 'number') {
16
- statusCode = statusOrMessage;
17
- }
18
- else if(typeof statusOrMessage === 'string') {
19
- message = statusOrMessage;
20
- }
21
-
22
- super(message ?? "");
23
-
24
- if(statusCode !== undefined) {
25
- this.status = statusCode;
26
- }
27
-
28
- this.name = this.constructor.name
29
- .replace(/([A-Z])/g, ' $1');
30
- }
31
- }
32
-
33
- // 4XX
34
- export class BadRequestException extends ResponseException { public override readonly status = 400; }
35
- export class UnauthorizedException extends ResponseException { public override readonly status = 401; }
36
- export class PaymentRequiredException extends ResponseException { public override readonly status = 402; }
37
- export class ForbiddenException extends ResponseException { public override readonly status = 403; }
38
- export class NotFoundException extends ResponseException { public override readonly status = 404; }
39
- export class MethodNotAllowedException extends ResponseException { public override readonly status = 405; }
40
- export class NotAcceptableException extends ResponseException { public override readonly status = 406; }
41
- export class RequestTimeoutException extends ResponseException { public override readonly status = 408; }
42
- export class ConflictException extends ResponseException { public override readonly status = 409; }
43
- export class UpgradeRequiredException extends ResponseException { public override readonly status = 426; }
44
- export class TooManyRequestsException extends ResponseException { public override readonly status = 429; }
45
- // 5XX
46
- export class InternalServerException extends ResponseException { public override readonly status = 500; }
47
- export class NotImplementedException extends ResponseException { public override readonly status = 501; }
48
- export class BadGatewayException extends ResponseException { public override readonly status = 502; }
49
- export class ServiceUnavailableException extends ResponseException { public override readonly status = 503; }
50
- export class GatewayTimeoutException extends ResponseException { public override readonly status = 504; }
51
- export class HttpVersionNotSupportedException extends ResponseException { public override readonly status = 505; }
52
- export class VariantAlsoNegotiatesException extends ResponseException { public override readonly status = 506; }
53
- export class InsufficientStorageException extends ResponseException { public override readonly status = 507; }
54
- export class LoopDetectedException extends ResponseException { public override readonly status = 508; }
55
- export class NotExtendedException extends ResponseException { public override readonly status = 510; }
56
- export class NetworkAuthenticationRequiredException extends ResponseException { public override readonly status = 511; }
57
- export class NetworkConnectTimeoutException extends ResponseException { public override readonly status = 599; }
package/src/index.ts DELETED
@@ -1,13 +0,0 @@
1
- /**
2
- * @copyright 2025 NoxFly
3
- * @license MIT
4
- * @author NoxFly
5
- *
6
- * Entry point for renderer process and preload consumers.
7
- */
8
-
9
- export * from './request';
10
- export * from './preload-bridge';
11
- export * from './renderer-events';
12
- export * from './renderer-client';
13
- export type { HttpMethod, AtomicHttpMethod } from './decorators/method.decorator';
package/src/main.ts DELETED
@@ -1,26 +0,0 @@
1
- /**
2
- * @copyright 2025 NoxFly
3
- * @license MIT
4
- * @author NoxFly
5
- *
6
- * Entry point for Electron main-process consumers.
7
- */
8
-
9
- export * from './DI/app-injector';
10
- export * from './DI/token';
11
- export * from './router';
12
- export * from './app';
13
- export * from './bootstrap';
14
- export * from './exceptions';
15
- export * from './decorators/middleware.decorator';
16
- export * from './decorators/guards.decorator';
17
- export * from './decorators/controller.decorator';
18
- export * from './decorators/injectable.decorator';
19
- export * from './decorators/method.decorator';
20
- export * from './utils/logger';
21
- export * from './utils/types';
22
- export * from './utils/forward-ref';
23
- export * from './request';
24
- export * from './socket';
25
- export * from './window/window-manager';
26
- export * from './routes';
@@ -1,22 +0,0 @@
1
- /**
2
- * @copyright 2025 NoxFly
3
- * @license MIT
4
- * @author NoxFly
5
- */
6
-
7
- /**
8
- * Entry point for nodeJS non-electron process consumers.
9
- * For instance, if main process creates a child process that
10
- * wants to use Logger and DI.
11
- * Child processes must not try to communicate with the renderer
12
- * process.
13
- * order of exports here matters and can affect module resolution.
14
- * Please be cautious when modifying.
15
- */
16
-
17
- export * from './DI/app-injector';
18
- export * from './exceptions';
19
- export * from './decorators/injectable.decorator';
20
- export * from './utils/logger';
21
- export * from './utils/types';
22
- export * from './utils/forward-ref';