@asenajs/asena 0.3.3 → 0.5.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.
Files changed (136) hide show
  1. package/README.md +165 -140
  2. package/dist/index.d.ts +2 -1
  3. package/dist/index.js +2 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/adapter/AsenaAdapter.d.ts +19 -3
  6. package/dist/lib/adapter/AsenaAdapter.js.map +1 -1
  7. package/dist/lib/adapter/AsenaWebsocketAdapter.d.ts +2 -2
  8. package/dist/lib/adapter/AsenaWebsocketAdapter.js.map +1 -1
  9. package/dist/lib/adapter/types/RouteParams.d.ts +3 -0
  10. package/dist/lib/adapter/types/ServeOptions.d.ts +2 -2
  11. package/dist/lib/adapter/types/index.d.ts +4 -4
  12. package/dist/lib/adapter/types/index.js +4 -4
  13. package/dist/lib/adapter/types/index.js.map +1 -1
  14. package/dist/lib/ioc/CircularDependencyDetector.d.ts +49 -0
  15. package/dist/lib/ioc/CircularDependencyDetector.js +69 -0
  16. package/dist/lib/ioc/CircularDependencyDetector.js.map +1 -0
  17. package/dist/lib/ioc/Container.d.ts +16 -0
  18. package/dist/lib/ioc/Container.js +61 -11
  19. package/dist/lib/ioc/Container.js.map +1 -1
  20. package/dist/lib/ioc/CoreContainer.d.ts +78 -0
  21. package/dist/lib/ioc/CoreContainer.js +139 -0
  22. package/dist/lib/ioc/CoreContainer.js.map +1 -0
  23. package/dist/lib/ioc/IocEngine.d.ts +16 -6
  24. package/dist/lib/ioc/IocEngine.js +35 -7
  25. package/dist/lib/ioc/IocEngine.js.map +1 -1
  26. package/dist/lib/ioc/component/decorators/Inject.d.ts +24 -4
  27. package/dist/lib/ioc/component/decorators/Inject.js +44 -7
  28. package/dist/lib/ioc/component/decorators/Inject.js.map +1 -1
  29. package/dist/lib/ioc/component/index.d.ts +1 -1
  30. package/dist/lib/ioc/component/index.js +1 -1
  31. package/dist/lib/ioc/component/index.js.map +1 -1
  32. package/dist/lib/ioc/constants/ComponentConstants.d.ts +27 -18
  33. package/dist/lib/ioc/constants/ComponentConstants.js +34 -20
  34. package/dist/lib/ioc/constants/ComponentConstants.js.map +1 -1
  35. package/dist/lib/ioc/decorators/CoreService.d.ts +8 -0
  36. package/dist/lib/ioc/decorators/CoreService.js +27 -0
  37. package/dist/lib/ioc/decorators/CoreService.js.map +1 -0
  38. package/dist/lib/ioc/decorators/index.d.ts +1 -0
  39. package/dist/lib/ioc/decorators/index.js +2 -0
  40. package/dist/lib/ioc/decorators/index.js.map +1 -0
  41. package/dist/lib/ioc/index.d.ts +5 -0
  42. package/dist/lib/ioc/index.js +5 -0
  43. package/dist/lib/ioc/index.js.map +1 -1
  44. package/dist/lib/ioc/types/CoreBootstrapPhase.d.ts +15 -0
  45. package/dist/lib/ioc/types/CoreBootstrapPhase.js +17 -0
  46. package/dist/lib/ioc/types/CoreBootstrapPhase.js.map +1 -0
  47. package/dist/lib/ioc/types/ICoreService.d.ts +9 -0
  48. package/dist/lib/ioc/types/ICoreService.js +2 -0
  49. package/dist/lib/ioc/types/ICoreService.js.map +1 -0
  50. package/dist/lib/ioc/types/ICoreServiceNamesType.d.ts +19 -0
  51. package/dist/lib/ioc/types/ICoreServiceNamesType.js +25 -0
  52. package/dist/lib/ioc/types/ICoreServiceNamesType.js.map +1 -0
  53. package/dist/lib/ioc/types/decorators/ControllerParams.d.ts +1 -1
  54. package/dist/lib/ioc/types/index.d.ts +3 -0
  55. package/dist/lib/ioc/types/index.js +3 -0
  56. package/dist/lib/ioc/types/index.js.map +1 -1
  57. package/dist/lib/server/AsenaServer.d.ts +85 -14
  58. package/dist/lib/server/AsenaServer.js +176 -68
  59. package/dist/lib/server/AsenaServer.js.map +1 -1
  60. package/dist/lib/server/AsenaServerFactory.d.ts +26 -0
  61. package/dist/lib/server/AsenaServerFactory.js +66 -0
  62. package/dist/lib/server/AsenaServerFactory.js.map +1 -0
  63. package/dist/lib/server/config/AsenaConfig.d.ts +91 -18
  64. package/dist/lib/server/decorators/Override.js +1 -1
  65. package/dist/lib/server/decorators/Override.js.map +1 -1
  66. package/dist/lib/server/decorators/components/Config.d.ts +1 -1
  67. package/dist/lib/server/decorators/components/Config.js +1 -1
  68. package/dist/lib/server/decorators/components/Config.js.map +1 -1
  69. package/dist/lib/server/decorators/components/Controller.d.ts +1 -1
  70. package/dist/lib/server/decorators/components/Controller.js +1 -2
  71. package/dist/lib/server/decorators/components/Controller.js.map +1 -1
  72. package/dist/lib/server/decorators/components/Middleware.js +1 -2
  73. package/dist/lib/server/decorators/components/Middleware.js.map +1 -1
  74. package/dist/lib/server/decorators/components/Schedule.d.ts +1 -1
  75. package/dist/lib/server/decorators/components/Schedule.js +1 -2
  76. package/dist/lib/server/decorators/components/Schedule.js.map +1 -1
  77. package/dist/lib/server/decorators/components/WebSocket.d.ts +1 -1
  78. package/dist/lib/server/decorators/components/WebSocket.js +1 -2
  79. package/dist/lib/server/decorators/components/WebSocket.js.map +1 -1
  80. package/dist/lib/server/decorators/index.d.ts +2 -0
  81. package/dist/lib/server/decorators/index.js +2 -0
  82. package/dist/lib/server/decorators/index.js.map +1 -1
  83. package/dist/lib/server/index.d.ts +3 -0
  84. package/dist/lib/server/index.js +4 -0
  85. package/dist/lib/server/index.js.map +1 -1
  86. package/dist/lib/server/messaging/Ulak.d.ts +224 -0
  87. package/dist/lib/server/messaging/Ulak.js +351 -0
  88. package/dist/lib/server/messaging/Ulak.js.map +1 -0
  89. package/dist/lib/server/messaging/index.d.ts +8 -0
  90. package/dist/lib/server/messaging/index.js +9 -0
  91. package/dist/lib/server/messaging/index.js.map +1 -0
  92. package/dist/lib/server/messaging/types.d.ts +73 -0
  93. package/dist/lib/server/messaging/types.js +35 -0
  94. package/dist/lib/server/messaging/types.js.map +1 -0
  95. package/dist/lib/server/src/services/PrepareConfigService.d.ts +9 -5
  96. package/dist/lib/server/src/services/PrepareConfigService.js +32 -7
  97. package/dist/lib/server/src/services/PrepareConfigService.js.map +1 -1
  98. package/dist/lib/server/src/services/PrepareMiddlewareService.d.ts +8 -5
  99. package/dist/lib/server/src/services/PrepareMiddlewareService.js +27 -7
  100. package/dist/lib/server/src/services/PrepareMiddlewareService.js.map +1 -1
  101. package/dist/lib/server/src/services/PrepareStaticServeConfigService.d.ts +8 -5
  102. package/dist/lib/server/src/services/PrepareStaticServeConfigService.js +27 -6
  103. package/dist/lib/server/src/services/PrepareStaticServeConfigService.js.map +1 -1
  104. package/dist/lib/server/src/services/PrepareValidatorService.d.ts +8 -5
  105. package/dist/lib/server/src/services/PrepareValidatorService.js +27 -6
  106. package/dist/lib/server/src/services/PrepareValidatorService.js.map +1 -1
  107. package/dist/lib/server/src/services/PrepareWebsocketService.d.ts +9 -5
  108. package/dist/lib/server/src/services/PrepareWebsocketService.js +35 -9
  109. package/dist/lib/server/src/services/PrepareWebsocketService.js.map +1 -1
  110. package/dist/lib/server/web/decorators/http.base.d.ts +1 -1
  111. package/dist/lib/server/web/decorators/http.base.js.map +1 -1
  112. package/dist/lib/server/web/decorators/methods/Connect.d.ts +1 -1
  113. package/dist/lib/server/web/decorators/methods/Delete.d.ts +1 -1
  114. package/dist/lib/server/web/decorators/methods/Get.d.ts +1 -1
  115. package/dist/lib/server/web/decorators/methods/Head.d.ts +1 -1
  116. package/dist/lib/server/web/decorators/methods/Options.d.ts +1 -1
  117. package/dist/lib/server/web/decorators/methods/Patch.d.ts +1 -1
  118. package/dist/lib/server/web/decorators/methods/Post.d.ts +1 -1
  119. package/dist/lib/server/web/decorators/methods/Put.d.ts +1 -1
  120. package/dist/lib/server/web/decorators/methods/Trace.d.ts +1 -1
  121. package/dist/lib/server/web/websocket/AsenaSocket.js.map +1 -1
  122. package/dist/lib/server/web/websocket/AsenaWebSocketServer.d.ts +3 -16
  123. package/dist/lib/server/web/websocket/AsenaWebSocketServer.js +3 -20
  124. package/dist/lib/server/web/websocket/AsenaWebSocketServer.js.map +1 -1
  125. package/dist/lib/server/web/websocket/index.d.ts +1 -1
  126. package/dist/lib/server/web/websocket/index.js +1 -1
  127. package/dist/lib/server/web/websocket/index.js.map +1 -1
  128. package/dist/lib/utils/patternMatcher.d.ts +41 -0
  129. package/dist/lib/utils/patternMatcher.js +99 -0
  130. package/dist/lib/utils/patternMatcher.js.map +1 -0
  131. package/dist/lib/utils/typedMetadata.d.ts +3 -3
  132. package/dist/lib/utils/typedMetadata.js.map +1 -1
  133. package/package.json +19 -8
  134. package/dist/lib/server/src/PrepareService.d.ts +0 -8
  135. package/dist/lib/server/src/PrepareService.js +0 -9
  136. package/dist/lib/server/src/PrepareService.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Inject.js","sourceRoot":"","sources":["../../../../../lib/ioc/component/decorators/Inject.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAE1G;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,SAAyB,EAAE,UAAwC,EAAqB,EAAE;IAC/G,OAAO,CAAC,MAAc,EAAE,WAAmB,EAAQ,EAAE;QACnD,MAAM,YAAY,GAChB,mBAAmB,CAAe,kBAAkB,CAAC,aAAa,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;QAEhG,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,CAAC;YAC/B,YAAY,CAAC,WAAW,CAAC;gBACvB,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAS,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAChH,CAAC;QAED,mBAAmB,CAAe,kBAAkB,CAAC,aAAa,EAAE,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QAEtG,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,WAAW,GACf,mBAAmB,CAAc,kBA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;QAC7B,CAAC;aAAM,CAAC;YACN,uBAAuB;YACvB,cAAc,GAAG,gBAAgB,CAAS,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACnF,CAAC;QAED,mBAAmB;QACnB,MAAM,YAAY,GAChB,mBAAmB,CAAe,kBAAkB,CAAC,aAAa,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;QAEhG,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,CAAC;YAC/B,YAAY,CAAC,WAAW,CAAC,GAAG,cAAc,CAAC;QAC7C,CAAC;QAED,mBAAmB,CAAe,kBAAkB,CAAC,aAAa,EAAE,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QAEtG,+BAA+B;QAC/B,IAAI,kBAAkB,EAAE,CAAC;YACvB,MAAM,WAAW,GACf,mBAAmB,CAAc,kBAAkB,CAAC,aAAa,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;YAE/F,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC9B,WAAW,CAAC,WAAW,CAAC,GAAG,kBAAkB,CAAC;YAChD,CAAC;YAED,mBAAmB,CAAc,kBAAkB,CAAC,aAAa,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QACtG,CAAC;IACH,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
1
  export * from './decorators';
2
- export * from "./Scope";
2
+ export * from './Scope';
@@ -1,3 +1,3 @@
1
1
  export * from './decorators';
2
- export * from "./Scope";
2
+ export * from './Scope';
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/ioc/component/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/ioc/component/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
@@ -1,21 +1,30 @@
1
1
  /**
2
- * Enum representing various component constants used in the IOC (Inversion of Control) container.
2
+ * @description Component constants used in the IOC (Inversion of Control) container.
3
+ * All keys are Symbols to prevent naming collisions and external manipulation.
3
4
  */
4
- export declare enum ComponentConstants {
5
- RouteKey = "_routeKey",
6
- DependencyKey = "_IDependencies",
7
- SoftDependencyKey = "_ISoftDependencies",
8
- PostConstructKey = "_IPostConstruct",
9
- ScopeKey = "_IScope",
10
- NameKey = "_IName",
11
- StrategyKey = "_IStrategy",
12
- InterfaceKey = "_Interface",
13
- PathKey = "_IPath",
14
- MiddlewaresKey = "_IMiddlewares",
15
- CronKey = "_ICron",
16
- IOCObjectKey = "_IIocObject",
17
- OverrideKey = "_IOverride",
18
- ExpressionKey = "_IExpression",
19
- ValidatorKey = "_IValidator",
20
- StaticServeRootKey = "_IStaticServeRoot"
5
+ export declare class ComponentConstants {
6
+ static readonly NameKey: unique symbol;
7
+ static readonly TypeKey: unique symbol;
8
+ static readonly ScopeKey: unique symbol;
9
+ static readonly PathKey: unique symbol;
10
+ static readonly InterfaceKey: unique symbol;
11
+ static readonly DependencyKey: unique symbol;
12
+ static readonly SoftDependencyKey: unique symbol;
13
+ static readonly StrategyKey: unique symbol;
14
+ static readonly ExpressionKey: unique symbol;
15
+ static readonly PostConstructKey: unique symbol;
16
+ static readonly OverrideKey: unique symbol;
17
+ static readonly IOCObjectKey: unique symbol;
18
+ static readonly CronKey: unique symbol;
19
+ static readonly ControllerConfigKey: unique symbol;
20
+ static readonly RouteKey: unique symbol;
21
+ static readonly MiddlewaresKey: unique symbol;
22
+ static readonly ValidatorKey: unique symbol;
23
+ static readonly MethodKey: unique symbol;
24
+ static readonly RoutePathKey: unique symbol;
25
+ static readonly RouteMiddlewaresKey: unique symbol;
26
+ static readonly RouteValidatorKey: unique symbol;
27
+ static readonly WebSocketPathKey: unique symbol;
28
+ static readonly WebSocketMiddlewaresKey: unique symbol;
29
+ static readonly StaticServeRootKey: unique symbol;
21
30
  }
@@ -1,23 +1,37 @@
1
1
  /**
2
- * Enum representing various component constants used in the IOC (Inversion of Control) container.
2
+ * @description Component constants used in the IOC (Inversion of Control) container.
3
+ * All keys are Symbols to prevent naming collisions and external manipulation.
3
4
  */
4
- export var ComponentConstants;
5
- (function (ComponentConstants) {
6
- ComponentConstants["RouteKey"] = "_routeKey";
7
- ComponentConstants["DependencyKey"] = "_IDependencies";
8
- ComponentConstants["SoftDependencyKey"] = "_ISoftDependencies";
9
- ComponentConstants["PostConstructKey"] = "_IPostConstruct";
10
- ComponentConstants["ScopeKey"] = "_IScope";
11
- ComponentConstants["NameKey"] = "_IName";
12
- ComponentConstants["StrategyKey"] = "_IStrategy";
13
- ComponentConstants["InterfaceKey"] = "_Interface";
14
- ComponentConstants["PathKey"] = "_IPath";
15
- ComponentConstants["MiddlewaresKey"] = "_IMiddlewares";
16
- ComponentConstants["CronKey"] = "_ICron";
17
- ComponentConstants["IOCObjectKey"] = "_IIocObject";
18
- ComponentConstants["OverrideKey"] = "_IOverride";
19
- ComponentConstants["ExpressionKey"] = "_IExpression";
20
- ComponentConstants["ValidatorKey"] = "_IValidator";
21
- ComponentConstants["StaticServeRootKey"] = "_IStaticServeRoot";
22
- })(ComponentConstants || (ComponentConstants = {}));
5
+ export class ComponentConstants {
6
+ // Component metadata keys - Symbol based for uniqueness
7
+ static NameKey = Symbol('component:name');
8
+ static TypeKey = Symbol('component:type');
9
+ static ScopeKey = Symbol('component:scope');
10
+ static PathKey = Symbol('component:path');
11
+ static InterfaceKey = Symbol('component:interface');
12
+ static DependencyKey = Symbol('component:dependency');
13
+ static SoftDependencyKey = Symbol('component:softDependency');
14
+ static StrategyKey = Symbol('component:strategy');
15
+ static ExpressionKey = Symbol('component:expression');
16
+ static PostConstructKey = Symbol('component:postConstruct');
17
+ static OverrideKey = Symbol('component:override');
18
+ static IOCObjectKey = Symbol('component:iocObject');
19
+ static CronKey = Symbol('component:cron');
20
+ // Controller specific
21
+ static ControllerConfigKey = Symbol('controller:config');
22
+ static RouteKey = Symbol('controller:route');
23
+ // Middleware specific
24
+ static MiddlewaresKey = Symbol('middleware:middlewares');
25
+ static ValidatorKey = Symbol('middleware:validator');
26
+ // Route specific
27
+ static MethodKey = Symbol('route:method');
28
+ static RoutePathKey = Symbol('route:path');
29
+ static RouteMiddlewaresKey = Symbol('route:middlewares');
30
+ static RouteValidatorKey = Symbol('route:validator');
31
+ // WebSocket specific
32
+ static WebSocketPathKey = Symbol('websocket:path');
33
+ static WebSocketMiddlewaresKey = Symbol('websocket:middlewares');
34
+ // Static Serve specific
35
+ static StaticServeRootKey = Symbol('staticServe:root');
36
+ }
23
37
  //# sourceMappingURL=ComponentConstants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ComponentConstants.js","sourceRoot":"","sources":["../../../../lib/ioc/constants/ComponentConstants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,kBAiBX;AAjBD,WAAY,kBAAkB;IAC5B,4CAAsB,CAAA;IACtB,sDAAgC,CAAA;IAChC,8DAAwC,CAAA;IACxC,0DAAoC,CAAA;IACpC,0CAAoB,CAAA;IACpB,wCAAkB,CAAA;IAClB,gDAA0B,CAAA;IAC1B,iDAA2B,CAAA;IAC3B,wCAAkB,CAAA;IAClB,sDAAgC,CAAA;IAChC,wCAAkB,CAAA;IAClB,kDAA4B,CAAA;IAC5B,gDAA0B,CAAA;IAC1B,oDAA8B,CAAA;IAC9B,kDAA4B,CAAA;IAC5B,8DAAwC,CAAA;AAC1C,CAAC,EAjBW,kBAAkB,KAAlB,kBAAkB,QAiB7B"}
1
+ {"version":3,"file":"ComponentConstants.js","sourceRoot":"","sources":["../../../../lib/ioc/constants/ComponentConstants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAE7B,wDAAwD;IACjD,MAAM,CAAU,OAAO,GAAG,MAAM,C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BAAmB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;IAElE,MAAM,CAAU,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAErE,qBAAqB;IACd,MAAM,CAAU,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAE5D,MAAM,CAAU,uBAAuB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAEjF,wBAAwB;IACjB,MAAM,CAAU,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const CORE_SERVICE: unique symbol;
2
+ /**
3
+ * @description Decorator for marking core framework services
4
+ * Core services are always singletons and managed by CoreContainer
5
+ * @param {string} name - Optional service name (defaults to class name)
6
+ * @returns {Function} Class decorator
7
+ */
8
+ export declare function CoreService(name?: string): (target: any) => void;
@@ -0,0 +1,27 @@
1
+ import { defineTypedMetadata, getOwnTypedMetadata } from '../../utils/typedMetadata';
2
+ import { ComponentConstants } from '../constants';
3
+ import { Scope } from '../component';
4
+ export const CORE_SERVICE = Symbol('CORE_SERVICE');
5
+ /**
6
+ * @description Decorator for marking core framework services
7
+ * Core services are always singletons and managed by CoreContainer
8
+ * @param {string} name - Optional service name (defaults to class name)
9
+ * @returns {Function} Class decorator
10
+ */
11
+ export function CoreService(name) {
12
+ return function (target) {
13
+ defineTypedMetadata(CORE_SERVICE, true, target);
14
+ const serviceName = name || target.name;
15
+ defineTypedMetadata(ComponentConstants.NameKey, serviceName, target);
16
+ defineTypedMetadata(ComponentConstants.ScopeKey, Scope.SINGLETON, target);
17
+ // Initialize dependency metadata for injection to work
18
+ if (getOwnTypedMetadata(ComponentConstants.DependencyKey, target) === undefined) {
19
+ defineTypedMetadata(ComponentConstants.DependencyKey, {}, target);
20
+ }
21
+ // Initialize strategy metadata for injection to work
22
+ if (getOwnTypedMetadata(ComponentConstants.StrategyKey, target) === undefined) {
23
+ defineTypedMetadata(ComponentConstants.StrategyKey, {}, target);
24
+ }
25
+ };
26
+ }
27
+ //# sourceMappingURL=CoreService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoreService.js","sourceRoot":"","sources":["../../../../lib/ioc/decorators/CoreService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGrC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,IAAa;IACvC,OAAO,UAAU,MAAW;QAC1B,mBAAmB,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QAChD,MAAM,WAAW,GAAG,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC;QAExC,mBAAmB,CAAC,kBAAkB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;QACrE,mBAAmB,CAAC,kBAAkB,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAE1E,uDAAuD;QACvD,IAAI,mBAAmB,CAAe,kBAAkB,CAAC,aAAa,EAAE,MAAM,CAAC,KAAK,SAAS,EAAE,CAAC;YAC9F,mBAAmB,CAAe,kBAAkB,CAAC,aAAa,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;QAClF,CAAC;QAED,qDAAqD;QACrD,IAAI,mBAAmB,CAAa,kBAAkB,CAAC,WAAW,EAAE,MAAM,CAAC,KAAK,SAAS,EAAE,CAAC;YAC1F,mBAAmB,CAAa,kBAAkB,CAAC,WAAW,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;QAC9E,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './CoreService';
@@ -0,0 +1,2 @@
1
+ export * from './CoreService';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/ioc/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
@@ -1,2 +1,7 @@
1
1
  export * from './IocEngine';
2
2
  export * from './Container';
3
+ export * from './CoreContainer';
4
+ export * from './CircularDependencyDetector';
5
+ export * from './decorators';
6
+ export * from './types';
7
+ export * from './constants';
@@ -1,3 +1,8 @@
1
1
  export * from './IocEngine';
2
2
  export * from './Container';
3
+ export * from './CoreContainer';
4
+ export * from './CircularDependencyDetector';
5
+ export * from './decorators';
6
+ export * from './types';
7
+ export * from './constants';
3
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/ioc/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/ioc/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @description Enum representing the bootstrap phases of the CoreContainer
3
+ * These phases define the order in which core services are initialized
4
+ */
5
+ export declare enum CoreBootstrapPhase {
6
+ CONTAINER_INIT = "CONTAINER_INIT",
7
+ LOGGER_INIT = "LOGGER_INIT",
8
+ IOC_ENGINE_INIT = "IOC_ENGINE_INIT",
9
+ HTTP_ADAPTER_INIT = "HTTP_ADAPTER_INIT",
10
+ PREPARE_SERVICES_INIT = "PREPARE_SERVICES_INIT",
11
+ USER_COMPONENTS_SCAN = "USER_COMPONENTS_SCAN",
12
+ USER_COMPONENTS_INIT = "USER_COMPONENTS_INIT",
13
+ APPLICATION_SETUP = "APPLICATION_SETUP",
14
+ SERVER_READY = "SERVER_READY"
15
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @description Enum representing the bootstrap phases of the CoreContainer
3
+ * These phases define the order in which core services are initialized
4
+ */
5
+ export var CoreBootstrapPhase;
6
+ (function (CoreBootstrapPhase) {
7
+ CoreBootstrapPhase["CONTAINER_INIT"] = "CONTAINER_INIT";
8
+ CoreBootstrapPhase["LOGGER_INIT"] = "LOGGER_INIT";
9
+ CoreBootstrapPhase["IOC_ENGINE_INIT"] = "IOC_ENGINE_INIT";
10
+ CoreBootstrapPhase["HTTP_ADAPTER_INIT"] = "HTTP_ADAPTER_INIT";
11
+ CoreBootstrapPhase["PREPARE_SERVICES_INIT"] = "PREPARE_SERVICES_INIT";
12
+ CoreBootstrapPhase["USER_COMPONENTS_SCAN"] = "USER_COMPONENTS_SCAN";
13
+ CoreBootstrapPhase["USER_COMPONENTS_INIT"] = "USER_COMPONENTS_INIT";
14
+ CoreBootstrapPhase["APPLICATION_SETUP"] = "APPLICATION_SETUP";
15
+ CoreBootstrapPhase["SERVER_READY"] = "SERVER_READY";
16
+ })(CoreBootstrapPhase || (CoreBootstrapPhase = {}));
17
+ //# sourceMappingURL=CoreBootstrapPhase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CoreBootstrapPhase.js","sourceRoot":"","sources":["../../../../lib/ioc/types/CoreBootstrapPhase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAN,IAAY,kBAUX;AAVD,WAAY,kBAAkB;IAC5B,uDAAiC,CAAA;IACjC,iDAA2B,CAAA;IAC3B,yDAAmC,CAAA;IACnC,6DAAuC,CAAA;IACvC,qEAA+C,CAAA;IAC/C,mEAA6C,CAAA;IAC7C,mEAA6C,CAAA;IAC7C,6DAAuC,CAAA;IACvC,mDAA6B,CAAA;AAC/B,CAAC,EAVW,kBAAkB,KAAlB,kBAAkB,QAU7B"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @description Interface for core framework services
3
+ * Provides lifecycle hooks for initialization and cleanup
4
+ */
5
+ export interface ICoreService {
6
+ readonly serviceName: string;
7
+ onInit?(): Promise<void> | void;
8
+ onDestroy?(): Promise<void> | void;
9
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ICoreService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ICoreService.js","sourceRoot":"","sources":["../../../../lib/ioc/types/ICoreService.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @description Object containing all core service names
3
+ * Used for type-safe service resolution and plugin system access
4
+ * All core services are managed by CoreContainer and AsenaServerFactory
5
+ */
6
+ export declare enum ICoreServiceNames {
7
+ CONTAINER = "Container",
8
+ SERVER_LOGGER = "ServerLogger",
9
+ IOC_ENGINE = "IocEngine",
10
+ ASENA_ADAPTER = "AsenaAdapter",
11
+ __ULAK__ = "__Ulak__",
12
+ PREPARE_MIDDLEWARE_SERVICE = "PrepareMiddlewareService",
13
+ PREPARE_CONFIG_SERVICE = "PrepareConfigService",
14
+ PREPARE_WEBSOCKET_SERVICE = "PrepareWebsocketService",
15
+ PREPARE_VALIDATOR_SERVICE = "PrepareValidatorService",
16
+ PREPARE_STATIC_SERVE_CONFIG_SERVICE = "PrepareStaticServeConfigService",
17
+ CORE_CONTAINER = "CoreContainer",
18
+ ASENA_SERVER = "AsenaServer"
19
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @description Object containing all core service names
3
+ * Used for type-safe service resolution and plugin system access
4
+ * All core services are managed by CoreContainer and AsenaServerFactory
5
+ */
6
+ export var ICoreServiceNames;
7
+ (function (ICoreServiceNames) {
8
+ // Core Infrastructure Services (Phase 1-4)
9
+ ICoreServiceNames["CONTAINER"] = "Container";
10
+ ICoreServiceNames["SERVER_LOGGER"] = "ServerLogger";
11
+ ICoreServiceNames["IOC_ENGINE"] = "IocEngine";
12
+ ICoreServiceNames["ASENA_ADAPTER"] = "AsenaAdapter";
13
+ // Internal Messaging Services (Phase 5)
14
+ ICoreServiceNames["__ULAK__"] = "__Ulak__";
15
+ // Prepare Services (Phase 5)
16
+ ICoreServiceNames["PREPARE_MIDDLEWARE_SERVICE"] = "PrepareMiddlewareService";
17
+ ICoreServiceNames["PREPARE_CONFIG_SERVICE"] = "PrepareConfigService";
18
+ ICoreServiceNames["PREPARE_WEBSOCKET_SERVICE"] = "PrepareWebsocketService";
19
+ ICoreServiceNames["PREPARE_VALIDATOR_SERVICE"] = "PrepareValidatorService";
20
+ ICoreServiceNames["PREPARE_STATIC_SERVE_CONFIG_SERVICE"] = "PrepareStaticServeConfigService";
21
+ // Factory Services (Phase 6+)
22
+ ICoreServiceNames["CORE_CONTAINER"] = "CoreContainer";
23
+ ICoreServiceNames["ASENA_SERVER"] = "AsenaServer";
24
+ })(ICoreServiceNames || (ICoreServiceNames = {}));
25
+ //# sourceMappingURL=ICoreServiceNamesType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ICoreServiceNamesType.js","sourceRoot":"","sources":["../../../../lib/ioc/types/ICoreServiceNamesType.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,iBAoBX;AApBD,WAAY,iBAAiB;IAC3B,2CAA2C;IAC3C,4CAAuB,CAAA;IACvB,mDAA8B,CAAA;IAC9B,6CAAwB,CAAA;IACxB,mDAA8B,CAAA;IAE9B,wCAAwC;IACxC,0CAAqB,CAAA;IAErB,6BAA6B;IAC7B,4EAAuD,CAAA;IACvD,oEAA+C,CAAA;IAC/C,0EAAqD,CAAA;IACrD,0EAAqD,CAAA;IACrD,4FAAuE,CAAA;IAEvE,8BAA8B;IAC9B,qDAAgC,CAAA;IAChC,iDAA4B,CAAA;AAC9B,CAAC,EApBW,iBAAiB,KAAjB,iBAAiB,QAoB5B"}
@@ -1,6 +1,6 @@
1
1
  import type { ComponentParams } from './ComponentParams';
2
2
  import type { AsenaContext } from '../../../adapter';
3
- import type { MiddlewareClass } from "../../../server/web/middleware";
3
+ import type { MiddlewareClass } from '../../../server/web/middleware';
4
4
  export interface ControllerParams<C extends AsenaContext<any, any> = AsenaContext<any, any>> extends ComponentParams {
5
5
  path: string;
6
6
  middlewares?: MiddlewareClass<C>[];
@@ -6,3 +6,6 @@ export * from './decorators/ScheduleParams';
6
6
  export * from './IocConfig';
7
7
  export * from './InjectableComponent';
8
8
  export * from './ContainerService';
9
+ export * from './ICoreService';
10
+ export * from './CoreBootstrapPhase';
11
+ export { ICoreServiceNames } from './ICoreServiceNamesType';
@@ -6,4 +6,7 @@ export * from './decorators/ScheduleParams';
6
6
  export * from './IocConfig';
7
7
  export * from './InjectableComponent';
8
8
  export * from './ContainerService';
9
+ export * from './ICoreService';
10
+ export * from './CoreBootstrapPhase';
11
+ export { ICoreServiceNames } from './ICoreServiceNamesType';
9
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/ioc/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/ioc/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,32 +1,103 @@
1
- import type { Class } from './types';
2
- import type { Container } from '../ioc';
1
+ import { type CoreContainer, type ICoreService } from '../ioc';
3
2
  import type { AsenaAdapter } from '../adapter';
4
- import { type ServerLogger } from '../logger';
5
- export declare class AsenaServer<A extends AsenaAdapter<any, any>> {
6
- private _port;
7
- private controllers;
8
- private _components;
9
- private _ioc;
3
+ /**
4
+ * @description AsenaServer - Main server class for Asena framework
5
+ * Now a core service managed by IoC container with field injection
6
+ */
7
+ export declare class AsenaServer<A extends AsenaAdapter<any, any>> implements ICoreService {
8
+ serviceName: string;
9
+ private _coreContainer;
10
+ private _adapter;
10
11
  private _logger;
11
- private readonly _adapter;
12
12
  private prepareMiddleware;
13
13
  private prepareConfigService;
14
14
  private prepareWebsocketService;
15
15
  private prepareValidatorService;
16
16
  private prepareStaticServeConfigService;
17
- constructor(adapter: A, logger: ServerLogger);
18
- initialize(): Promise<Container>;
19
- start(gc?: boolean): Promise<void>;
20
- components(components: Class[]): this;
17
+ private _port;
18
+ private _gc;
19
+ private controllers;
20
+ /**
21
+ * @description Lifecycle hook - called after dependencies are injected
22
+ * @returns {void}
23
+ */
24
+ onInit(): void;
25
+ /**
26
+ * @description Start the server
27
+ * Main entry point after factory creation
28
+ * @returns {Promise<void>}
29
+ */
30
+ start(): Promise<void>;
31
+ /**
32
+ * @description Configure server port
33
+ * Builder pattern for API compatibility
34
+ * @param {number} port - Port number
35
+ * @returns {this}
36
+ */
21
37
  port(port: number): this;
22
- logger(value: ServerLogger): this;
38
+ /**
39
+ * @description Get current CoreContainer instance
40
+ * @returns {CoreContainer}
41
+ */
42
+ get coreContainer(): CoreContainer;
43
+ /**
44
+ * @description Initialize and register all controllers
45
+ * @returns {Promise<void>}
46
+ */
23
47
  private initializeControllers;
48
+ /**
49
+ * @description Validate and set controllers from container
50
+ * @returns {Promise<void>}
51
+ */
24
52
  private validateAndSetControllers;
53
+ /**
54
+ * @description Prepare static serve configuration
55
+ * @param {StaticServeClass} staticServeClass - Static serve class
56
+ * @returns {Promise<BaseStaticServeParams>}
57
+ */
25
58
  private prepareStaticServeConfig;
59
+ /**
60
+ * @description Prepare top-level middlewares for controller or websocket
61
+ * @param {PrepareMiddlewareParams} params - Middleware parameters
62
+ * @param {boolean} websocket - Whether this is for websocket
63
+ * @returns {Promise<BaseMiddleware[]>}
64
+ */
26
65
  private prepareTopMiddlewares;
66
+ /**
67
+ * @description Prepare validator instance
68
+ * @param {ValidatorClass<any>} Validator - Validator class
69
+ * @returns {Promise<BaseValidator>}
70
+ */
27
71
  private prepareValidator;
72
+ /**
73
+ * @description Prepare route-level middlewares
74
+ * @param {ApiParams} middlewareParams - Middleware parameters
75
+ * @returns {Promise<BaseMiddleware[]>}
76
+ */
28
77
  private prepareRouteMiddleware;
78
+ /**
79
+ * @description Prepare middlewares from classes
80
+ * @param {MiddlewareClass[]} middlewares - Middleware classes
81
+ * @returns {Promise<BaseMiddleware[]>}
82
+ */
29
83
  private prepareMiddlewares;
84
+ /**
85
+ * @description Prepare and register WebSocket routes
86
+ * @returns {Promise<void>}
87
+ */
30
88
  private prepareWebSocket;
89
+ /**
90
+ * @description Normalizes global middleware entry to config format
91
+ * Handles backward compatibility (MiddlewareClass → GlobalMiddlewareConfig)
92
+ *
93
+ * @param entry - Middleware entry (class or config object)
94
+ * @returns Normalized config object
95
+ */
96
+ private normalizeMiddlewareEntry;
97
+ /**
98
+ * @description Prepare and apply configuration
99
+ * Updated to support pattern-based global middlewares
100
+ * @returns {Promise<void>}
101
+ */
31
102
  private prepareConfigs;
32
103
  }