@noxfly/noxus 3.0.0-dev.0 → 3.0.0-dev.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.
Files changed (37) hide show
  1. package/README.md +12 -9
  2. package/dist/child.d.mts +112 -4
  3. package/dist/child.d.ts +112 -4
  4. package/dist/child.js +30 -30
  5. package/dist/child.mjs +30 -30
  6. package/dist/main.d.mts +450 -6
  7. package/dist/main.d.ts +450 -6
  8. package/dist/main.js +229 -229
  9. package/dist/main.mjs +231 -231
  10. package/dist/preload.d.mts +28 -0
  11. package/dist/preload.d.ts +28 -0
  12. package/dist/preload.js +95 -0
  13. package/dist/preload.mjs +70 -0
  14. package/dist/renderer.d.mts +159 -22
  15. package/dist/renderer.d.ts +159 -22
  16. package/dist/renderer.js +11 -58
  17. package/dist/renderer.mjs +7 -53
  18. package/package.json +18 -13
  19. package/src/DI/injector-explorer.ts +2 -2
  20. package/src/decorators/guards.decorator.ts +1 -1
  21. package/src/decorators/middleware.decorator.ts +1 -1
  22. package/src/index.ts +2 -5
  23. package/src/{app.ts → internal/app.ts} +8 -8
  24. package/src/{bootstrap.ts → internal/bootstrap.ts} +4 -4
  25. package/src/{request.ts → internal/request.ts} +2 -2
  26. package/src/{router.ts → internal/router.ts} +9 -9
  27. package/src/{routes.ts → internal/routes.ts} +2 -2
  28. package/src/{socket.ts → internal/socket.ts} +2 -2
  29. package/src/main.ts +7 -7
  30. package/src/non-electron-process.ts +1 -1
  31. package/src/preload.ts +10 -0
  32. package/src/renderer.ts +13 -0
  33. package/tsup.config.ts +27 -11
  34. /package/src/{exceptions.ts → internal/exceptions.ts} +0 -0
  35. /package/src/{preload-bridge.ts → internal/preload-bridge.ts} +0 -0
  36. /package/src/{renderer-client.ts → internal/renderer-client.ts} +0 -0
  37. /package/src/{renderer-events.ts → internal/renderer-events.ts} +0 -0
package/README.md CHANGED
@@ -460,17 +460,17 @@ createPreloadBridge(); // exposes window.__noxus__ to the renderer
460
460
 
461
461
  ```ts
462
462
  // In the renderer (Angular, React, Vue, Vanilla...)
463
- import { NoxusClient } from '@noxfly/noxus';
463
+ import { NoxRendererClient } from '@noxfly/noxus';
464
464
 
465
- const client = new NoxusClient();
466
- await client.connect();
465
+ const client = new NoxRendererClient();
466
+ await client.setup(); // requests the MessagePort from main
467
467
 
468
468
  // Requests
469
- const users = await client.get<User[]>('users/list');
470
- const user = await client.get<User>('users/42');
471
- await client.post('users/create', { name: 'Bob' });
472
- await client.put('users/42', { name: 'Bob Updated' });
473
- await client.delete('users/42');
469
+ const users = await client.request<User[]>({ method: 'GET', path: 'users/list' });
470
+ const user = await client.request<User> ({ method: 'GET', path: 'users/42' });
471
+ await client.request({ method: 'POST', path: 'users/create', body: { name: 'Bob' } });
472
+ await client.request({ method: 'PUT', path: 'users/42', body: { name: 'Bob Updated' } });
473
+ await client.request({ method: 'DELETE', path: 'users/42' });
474
474
  ```
475
475
 
476
476
  ### Push events (main → renderer)
@@ -495,9 +495,12 @@ class NotificationService {
495
495
  On the renderer side:
496
496
 
497
497
  ```ts
498
- client.on('notification', (payload) => {
498
+ const sub = client.events.subscribe<INotification>('notification', (payload) => {
499
499
  console.log(payload.message);
500
500
  });
501
+
502
+ // Unsubscribe when done
503
+ sub.unsubscribe();
501
504
  ```
502
505
 
503
506
  ---
package/dist/child.d.mts CHANGED
@@ -1,11 +1,119 @@
1
- import { L as Lifetime, a as TokenKey } from './app-injector-Bz3Upc0y.mjs';
2
- export { A as AppInjector, F as ForwardRefFn, b as ForwardReference, I as IBinding, M as MaybeAsync, R as RootInjector, c as Token, T as Type, f as forwardRef, i as inject } from './app-injector-Bz3Upc0y.mjs';
3
-
4
1
  /**
5
2
  * @copyright 2025 NoxFly
6
3
  * @license MIT
7
4
  * @author NoxFly
8
5
  */
6
+ interface Type<T> extends Function {
7
+ new (...args: any[]): T;
8
+ }
9
+ /**
10
+ * Represents a generic type that can be either a value or a promise resolving to that value.
11
+ */
12
+ type MaybeAsync<T> = T | Promise<T>;
13
+
14
+
15
+ /**
16
+ * A function that returns a type.
17
+ * Used for forward references to types that are not yet defined.
18
+ */
19
+ interface ForwardRefFn<T = any> {
20
+ (): Type<T>;
21
+ }
22
+ /**
23
+ * A wrapper class for forward referenced types.
24
+ */
25
+ declare class ForwardReference<T = any> {
26
+ readonly forwardRefFn: ForwardRefFn<T>;
27
+ constructor(forwardRefFn: ForwardRefFn<T>);
28
+ }
29
+ /**
30
+ * Creates a forward reference to a type.
31
+ * @param fn A function that returns the type.
32
+ * @returns A ForwardReference instance.
33
+ */
34
+ declare function forwardRef<T = any>(fn: ForwardRefFn<T>): ForwardReference<T>;
35
+
36
+
37
+ /**
38
+ * A DI token uniquely identifies a dependency.
39
+ * It can wrap a class (Type<T>) or be a named symbol token.
40
+ *
41
+ * Using tokens instead of reflect-metadata means dependencies are
42
+ * declared explicitly — no magic type inference, no emitDecoratorMetadata.
43
+ *
44
+ * @example
45
+ * // Class token (most common)
46
+ * const MY_SERVICE = token(MyService);
47
+ *
48
+ * // Named symbol token (for interfaces or non-class values)
49
+ * const DB_URL = token<string>('DB_URL');
50
+ */
51
+ declare class Token<T> {
52
+ readonly target: Type<T> | string;
53
+ readonly description: string;
54
+ constructor(target: Type<T> | string);
55
+ toString(): string;
56
+ }
57
+ /**
58
+ * The key used to look up a class token in the registry.
59
+ * For class tokens, the key is the class constructor itself.
60
+ * For named tokens, the key is the Token instance.
61
+ */
62
+ type TokenKey<T = unknown> = Type<T> | Token<T>;
63
+
64
+
65
+ /**
66
+ * Lifetime of a binding in the DI container.
67
+ * - singleton: created once, shared for the lifetime of the app.
68
+ * - scope: created once per request scope.
69
+ * - transient: new instance every time it is resolved.
70
+ */
71
+ type Lifetime = 'singleton' | 'scope' | 'transient';
72
+ /**
73
+ * Internal representation of a registered binding.
74
+ */
75
+ interface IBinding<T = unknown> {
76
+ lifetime: Lifetime;
77
+ implementation: Type<T>;
78
+ /** Explicit constructor dependencies, declared by the class itself. */
79
+ deps: ReadonlyArray<TokenKey>;
80
+ instance?: T;
81
+ }
82
+ /**
83
+ * AppInjector is the core DI container.
84
+ * It no longer uses reflect-metadata — all dependency information
85
+ * comes from explicitly declared `deps` arrays on each binding.
86
+ */
87
+ declare class AppInjector {
88
+ readonly name: string | null;
89
+ readonly bindings: Map<Type<unknown> | Token<unknown>, IBinding<unknown>>;
90
+ readonly singletons: Map<Type<unknown> | Token<unknown>, unknown>;
91
+ readonly scoped: Map<Type<unknown> | Token<unknown>, unknown>;
92
+ constructor(name?: string | null);
93
+ /**
94
+ * Creates a child scope for per-request lifetime resolution.
95
+ */
96
+ createScope(): AppInjector;
97
+ /**
98
+ * Registers a binding explicitly.
99
+ */
100
+ register<T>(key: TokenKey<T>, implementation: Type<T>, lifetime: Lifetime, deps?: ReadonlyArray<TokenKey>): void;
101
+ /**
102
+ * Resolves a dependency by token or class reference.
103
+ */
104
+ resolve<T>(target: TokenKey<T> | ForwardReference<T>): T;
105
+ private _resolveForwardRef;
106
+ private _instantiate;
107
+ }
108
+ /**
109
+ * The global root injector. All singletons live here.
110
+ */
111
+ declare const RootInjector: AppInjector;
112
+ /**
113
+ * Convenience function: resolve a token from the root injector.
114
+ */
115
+ declare function inject<T>(t: TokenKey<T> | ForwardReference<T>): T;
116
+
9
117
  declare class ResponseException extends Error {
10
118
  readonly status: number;
11
119
  constructor(message?: string);
@@ -232,4 +340,4 @@ declare namespace Logger {
232
340
  };
233
341
  }
234
342
 
235
- export { BadGatewayException, BadRequestException, ConflictException, ForbiddenException, GatewayTimeoutException, HttpVersionNotSupportedException, Injectable, type InjectableOptions, InsufficientStorageException, InternalServerException, Lifetime, type LogLevel, Logger, LoopDetectedException, MethodNotAllowedException, NetworkAuthenticationRequiredException, NetworkConnectTimeoutException, NotAcceptableException, NotExtendedException, NotFoundException, NotImplementedException, PaymentRequiredException, RequestTimeoutException, ResponseException, ServiceUnavailableException, TokenKey, TooManyRequestsException, UnauthorizedException, UpgradeRequiredException, VariantAlsoNegotiatesException };
343
+ export { AppInjector, BadGatewayException, BadRequestException, ConflictException, ForbiddenException, type ForwardRefFn, ForwardReference, GatewayTimeoutException, HttpVersionNotSupportedException, type IBinding, Injectable, type InjectableOptions, InsufficientStorageException, InternalServerException, type Lifetime, type LogLevel, Logger, LoopDetectedException, type MaybeAsync, MethodNotAllowedException, NetworkAuthenticationRequiredException, NetworkConnectTimeoutException, NotAcceptableException, NotExtendedException, NotFoundException, NotImplementedException, PaymentRequiredException, RequestTimeoutException, ResponseException, RootInjector, ServiceUnavailableException, Token, type TokenKey, TooManyRequestsException, type Type, UnauthorizedException, UpgradeRequiredException, VariantAlsoNegotiatesException, forwardRef, inject };
package/dist/child.d.ts CHANGED
@@ -1,11 +1,119 @@
1
- import { L as Lifetime, a as TokenKey } from './app-injector-Bz3Upc0y.js';
2
- export { A as AppInjector, F as ForwardRefFn, b as ForwardReference, I as IBinding, M as MaybeAsync, R as RootInjector, c as Token, T as Type, f as forwardRef, i as inject } from './app-injector-Bz3Upc0y.js';
3
-
4
1
  /**
5
2
  * @copyright 2025 NoxFly
6
3
  * @license MIT
7
4
  * @author NoxFly
8
5
  */
6
+ interface Type<T> extends Function {
7
+ new (...args: any[]): T;
8
+ }
9
+ /**
10
+ * Represents a generic type that can be either a value or a promise resolving to that value.
11
+ */
12
+ type MaybeAsync<T> = T | Promise<T>;
13
+
14
+
15
+ /**
16
+ * A function that returns a type.
17
+ * Used for forward references to types that are not yet defined.
18
+ */
19
+ interface ForwardRefFn<T = any> {
20
+ (): Type<T>;
21
+ }
22
+ /**
23
+ * A wrapper class for forward referenced types.
24
+ */
25
+ declare class ForwardReference<T = any> {
26
+ readonly forwardRefFn: ForwardRefFn<T>;
27
+ constructor(forwardRefFn: ForwardRefFn<T>);
28
+ }
29
+ /**
30
+ * Creates a forward reference to a type.
31
+ * @param fn A function that returns the type.
32
+ * @returns A ForwardReference instance.
33
+ */
34
+ declare function forwardRef<T = any>(fn: ForwardRefFn<T>): ForwardReference<T>;
35
+
36
+
37
+ /**
38
+ * A DI token uniquely identifies a dependency.
39
+ * It can wrap a class (Type<T>) or be a named symbol token.
40
+ *
41
+ * Using tokens instead of reflect-metadata means dependencies are
42
+ * declared explicitly — no magic type inference, no emitDecoratorMetadata.
43
+ *
44
+ * @example
45
+ * // Class token (most common)
46
+ * const MY_SERVICE = token(MyService);
47
+ *
48
+ * // Named symbol token (for interfaces or non-class values)
49
+ * const DB_URL = token<string>('DB_URL');
50
+ */
51
+ declare class Token<T> {
52
+ readonly target: Type<T> | string;
53
+ readonly description: string;
54
+ constructor(target: Type<T> | string);
55
+ toString(): string;
56
+ }
57
+ /**
58
+ * The key used to look up a class token in the registry.
59
+ * For class tokens, the key is the class constructor itself.
60
+ * For named tokens, the key is the Token instance.
61
+ */
62
+ type TokenKey<T = unknown> = Type<T> | Token<T>;
63
+
64
+
65
+ /**
66
+ * Lifetime of a binding in the DI container.
67
+ * - singleton: created once, shared for the lifetime of the app.
68
+ * - scope: created once per request scope.
69
+ * - transient: new instance every time it is resolved.
70
+ */
71
+ type Lifetime = 'singleton' | 'scope' | 'transient';
72
+ /**
73
+ * Internal representation of a registered binding.
74
+ */
75
+ interface IBinding<T = unknown> {
76
+ lifetime: Lifetime;
77
+ implementation: Type<T>;
78
+ /** Explicit constructor dependencies, declared by the class itself. */
79
+ deps: ReadonlyArray<TokenKey>;
80
+ instance?: T;
81
+ }
82
+ /**
83
+ * AppInjector is the core DI container.
84
+ * It no longer uses reflect-metadata — all dependency information
85
+ * comes from explicitly declared `deps` arrays on each binding.
86
+ */
87
+ declare class AppInjector {
88
+ readonly name: string | null;
89
+ readonly bindings: Map<Type<unknown> | Token<unknown>, IBinding<unknown>>;
90
+ readonly singletons: Map<Type<unknown> | Token<unknown>, unknown>;
91
+ readonly scoped: Map<Type<unknown> | Token<unknown>, unknown>;
92
+ constructor(name?: string | null);
93
+ /**
94
+ * Creates a child scope for per-request lifetime resolution.
95
+ */
96
+ createScope(): AppInjector;
97
+ /**
98
+ * Registers a binding explicitly.
99
+ */
100
+ register<T>(key: TokenKey<T>, implementation: Type<T>, lifetime: Lifetime, deps?: ReadonlyArray<TokenKey>): void;
101
+ /**
102
+ * Resolves a dependency by token or class reference.
103
+ */
104
+ resolve<T>(target: TokenKey<T> | ForwardReference<T>): T;
105
+ private _resolveForwardRef;
106
+ private _instantiate;
107
+ }
108
+ /**
109
+ * The global root injector. All singletons live here.
110
+ */
111
+ declare const RootInjector: AppInjector;
112
+ /**
113
+ * Convenience function: resolve a token from the root injector.
114
+ */
115
+ declare function inject<T>(t: TokenKey<T> | ForwardReference<T>): T;
116
+
9
117
  declare class ResponseException extends Error {
10
118
  readonly status: number;
11
119
  constructor(message?: string);
@@ -232,4 +340,4 @@ declare namespace Logger {
232
340
  };
233
341
  }
234
342
 
235
- export { BadGatewayException, BadRequestException, ConflictException, ForbiddenException, GatewayTimeoutException, HttpVersionNotSupportedException, Injectable, type InjectableOptions, InsufficientStorageException, InternalServerException, Lifetime, type LogLevel, Logger, LoopDetectedException, MethodNotAllowedException, NetworkAuthenticationRequiredException, NetworkConnectTimeoutException, NotAcceptableException, NotExtendedException, NotFoundException, NotImplementedException, PaymentRequiredException, RequestTimeoutException, ResponseException, ServiceUnavailableException, TokenKey, TooManyRequestsException, UnauthorizedException, UpgradeRequiredException, VariantAlsoNegotiatesException };
343
+ export { AppInjector, BadGatewayException, BadRequestException, ConflictException, ForbiddenException, type ForwardRefFn, ForwardReference, GatewayTimeoutException, HttpVersionNotSupportedException, type IBinding, Injectable, type InjectableOptions, InsufficientStorageException, InternalServerException, type Lifetime, type LogLevel, Logger, LoopDetectedException, type MaybeAsync, MethodNotAllowedException, NetworkAuthenticationRequiredException, NetworkConnectTimeoutException, NotAcceptableException, NotExtendedException, NotFoundException, NotImplementedException, PaymentRequiredException, RequestTimeoutException, ResponseException, RootInjector, ServiceUnavailableException, Token, type TokenKey, TooManyRequestsException, type Type, UnauthorizedException, UpgradeRequiredException, VariantAlsoNegotiatesException, forwardRef, inject };
package/dist/child.js CHANGED
@@ -189,10 +189,10 @@ Did you forget to declare it in @Injectable({ deps }) or in bootstrapApplication
189
189
  }
190
190
  });
191
191
 
192
- // src/exceptions.ts
192
+ // src/internal/exceptions.ts
193
193
  var _ResponseException, ResponseException, _BadRequestException, BadRequestException, _UnauthorizedException, UnauthorizedException, _PaymentRequiredException, PaymentRequiredException, _ForbiddenException, ForbiddenException, _NotFoundException, NotFoundException, _MethodNotAllowedException, MethodNotAllowedException, _NotAcceptableException, NotAcceptableException, _RequestTimeoutException, RequestTimeoutException, _ConflictException, ConflictException, _UpgradeRequiredException, UpgradeRequiredException, _TooManyRequestsException, TooManyRequestsException, _InternalServerException, InternalServerException, _NotImplementedException, NotImplementedException, _BadGatewayException, BadGatewayException, _ServiceUnavailableException, ServiceUnavailableException, _GatewayTimeoutException, GatewayTimeoutException, _HttpVersionNotSupportedException, HttpVersionNotSupportedException, _VariantAlsoNegotiatesException, VariantAlsoNegotiatesException, _InsufficientStorageException, InsufficientStorageException, _LoopDetectedException, LoopDetectedException, _NotExtendedException, NotExtendedException, _NetworkAuthenticationRequiredException, NetworkAuthenticationRequiredException, _NetworkConnectTimeoutException, NetworkConnectTimeoutException;
194
194
  var init_exceptions = __esm({
195
- "src/exceptions.ts"() {
195
+ "src/internal/exceptions.ts"() {
196
196
  "use strict";
197
197
  _ResponseException = class _ResponseException extends Error {
198
198
  constructor(statusOrMessage, message) {
@@ -700,30 +700,6 @@ var init_method_decorator = __esm({
700
700
  }
701
701
  });
702
702
 
703
- // src/request.ts
704
- var _Request, Request;
705
- var init_request = __esm({
706
- "src/request.ts"() {
707
- "use strict";
708
- init_app_injector();
709
- _Request = class _Request {
710
- constructor(event, senderId, id, method, path2, body) {
711
- this.event = event;
712
- this.senderId = senderId;
713
- this.id = id;
714
- this.method = method;
715
- this.path = path2;
716
- this.body = body;
717
- this.context = RootInjector.createScope();
718
- this.params = {};
719
- this.path = path2.replace(/^\/|\/$/g, "");
720
- }
721
- };
722
- __name(_Request, "Request");
723
- Request = _Request;
724
- }
725
- });
726
-
727
703
  // src/utils/radix-tree.ts
728
704
  var _RadixNode, RadixNode, _RadixTree, RadixTree;
729
705
  var init_radix_tree = __esm({
@@ -886,23 +862,47 @@ var init_radix_tree = __esm({
886
862
  }
887
863
  });
888
864
 
889
- // src/router.ts
865
+ // src/internal/request.ts
866
+ var _Request, Request;
867
+ var init_request = __esm({
868
+ "src/internal/request.ts"() {
869
+ "use strict";
870
+ init_app_injector();
871
+ _Request = class _Request {
872
+ constructor(event, senderId, id, method, path2, body) {
873
+ this.event = event;
874
+ this.senderId = senderId;
875
+ this.id = id;
876
+ this.method = method;
877
+ this.path = path2;
878
+ this.body = body;
879
+ this.context = RootInjector.createScope();
880
+ this.params = {};
881
+ this.path = path2.replace(/^\/|\/$/g, "");
882
+ }
883
+ };
884
+ __name(_Request, "Request");
885
+ Request = _Request;
886
+ }
887
+ });
888
+
889
+ // src/internal/router.ts
890
890
  var router_exports = {};
891
891
  __export(router_exports, {
892
892
  Router: () => Router
893
893
  });
894
894
  var Router;
895
895
  var init_router = __esm({
896
- "src/router.ts"() {
896
+ "src/internal/router.ts"() {
897
897
  "use strict";
898
898
  init_controller_decorator();
899
899
  init_injectable_decorator();
900
900
  init_method_decorator();
901
901
  init_injector_explorer();
902
- init_exceptions();
903
- init_request();
904
902
  init_logger();
905
903
  init_radix_tree();
904
+ init_exceptions();
905
+ init_request();
906
906
  Router = class {
907
907
  constructor() {
908
908
  this.routes = new RadixTree();
package/dist/child.mjs CHANGED
@@ -178,10 +178,10 @@ Did you forget to declare it in @Injectable({ deps }) or in bootstrapApplication
178
178
  }
179
179
  });
180
180
 
181
- // src/exceptions.ts
181
+ // src/internal/exceptions.ts
182
182
  var _ResponseException, ResponseException, _BadRequestException, BadRequestException, _UnauthorizedException, UnauthorizedException, _PaymentRequiredException, PaymentRequiredException, _ForbiddenException, ForbiddenException, _NotFoundException, NotFoundException, _MethodNotAllowedException, MethodNotAllowedException, _NotAcceptableException, NotAcceptableException, _RequestTimeoutException, RequestTimeoutException, _ConflictException, ConflictException, _UpgradeRequiredException, UpgradeRequiredException, _TooManyRequestsException, TooManyRequestsException, _InternalServerException, InternalServerException, _NotImplementedException, NotImplementedException, _BadGatewayException, BadGatewayException, _ServiceUnavailableException, ServiceUnavailableException, _GatewayTimeoutException, GatewayTimeoutException, _HttpVersionNotSupportedException, HttpVersionNotSupportedException, _VariantAlsoNegotiatesException, VariantAlsoNegotiatesException, _InsufficientStorageException, InsufficientStorageException, _LoopDetectedException, LoopDetectedException, _NotExtendedException, NotExtendedException, _NetworkAuthenticationRequiredException, NetworkAuthenticationRequiredException, _NetworkConnectTimeoutException, NetworkConnectTimeoutException;
183
183
  var init_exceptions = __esm({
184
- "src/exceptions.ts"() {
184
+ "src/internal/exceptions.ts"() {
185
185
  "use strict";
186
186
  _ResponseException = class _ResponseException extends Error {
187
187
  constructor(statusOrMessage, message) {
@@ -689,30 +689,6 @@ var init_method_decorator = __esm({
689
689
  }
690
690
  });
691
691
 
692
- // src/request.ts
693
- var _Request, Request;
694
- var init_request = __esm({
695
- "src/request.ts"() {
696
- "use strict";
697
- init_app_injector();
698
- _Request = class _Request {
699
- constructor(event, senderId, id, method, path2, body) {
700
- this.event = event;
701
- this.senderId = senderId;
702
- this.id = id;
703
- this.method = method;
704
- this.path = path2;
705
- this.body = body;
706
- this.context = RootInjector.createScope();
707
- this.params = {};
708
- this.path = path2.replace(/^\/|\/$/g, "");
709
- }
710
- };
711
- __name(_Request, "Request");
712
- Request = _Request;
713
- }
714
- });
715
-
716
692
  // src/utils/radix-tree.ts
717
693
  var _RadixNode, RadixNode, _RadixTree, RadixTree;
718
694
  var init_radix_tree = __esm({
@@ -875,23 +851,47 @@ var init_radix_tree = __esm({
875
851
  }
876
852
  });
877
853
 
878
- // src/router.ts
854
+ // src/internal/request.ts
855
+ var _Request, Request;
856
+ var init_request = __esm({
857
+ "src/internal/request.ts"() {
858
+ "use strict";
859
+ init_app_injector();
860
+ _Request = class _Request {
861
+ constructor(event, senderId, id, method, path2, body) {
862
+ this.event = event;
863
+ this.senderId = senderId;
864
+ this.id = id;
865
+ this.method = method;
866
+ this.path = path2;
867
+ this.body = body;
868
+ this.context = RootInjector.createScope();
869
+ this.params = {};
870
+ this.path = path2.replace(/^\/|\/$/g, "");
871
+ }
872
+ };
873
+ __name(_Request, "Request");
874
+ Request = _Request;
875
+ }
876
+ });
877
+
878
+ // src/internal/router.ts
879
879
  var router_exports = {};
880
880
  __export(router_exports, {
881
881
  Router: () => Router
882
882
  });
883
883
  var Router;
884
884
  var init_router = __esm({
885
- "src/router.ts"() {
885
+ "src/internal/router.ts"() {
886
886
  "use strict";
887
887
  init_controller_decorator();
888
888
  init_injectable_decorator();
889
889
  init_method_decorator();
890
890
  init_injector_explorer();
891
- init_exceptions();
892
- init_request();
893
891
  init_logger();
894
892
  init_radix_tree();
893
+ init_exceptions();
894
+ init_request();
895
895
  Router = class {
896
896
  constructor() {
897
897
  this.routes = new RadixTree();