@riktajs/core 0.9.0 → 0.10.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 (93) hide show
  1. package/README.md +132 -132
  2. package/dist/core/application.d.ts +1 -1
  3. package/dist/core/application.js +36 -43
  4. package/dist/core/config/abstract-config-provider.js +8 -13
  5. package/dist/core/config/env-loader.js +12 -17
  6. package/dist/core/config/index.d.ts +2 -2
  7. package/dist/core/config/index.js +2 -18
  8. package/dist/core/constants.js +18 -21
  9. package/dist/core/container/abstract-class.utils.d.ts +1 -1
  10. package/dist/core/container/abstract-class.utils.js +14 -24
  11. package/dist/core/container/container.d.ts +2 -2
  12. package/dist/core/container/container.js +16 -20
  13. package/dist/core/container/implements.decorator.d.ts +1 -1
  14. package/dist/core/container/implements.decorator.js +17 -23
  15. package/dist/core/container/index.d.ts +5 -5
  16. package/dist/core/container/index.js +5 -21
  17. package/dist/core/container/injection-token.js +1 -5
  18. package/dist/core/container/request-scope.d.ts +1 -1
  19. package/dist/core/container/request-scope.js +4 -8
  20. package/dist/core/decorators/apply-decorators.js +3 -7
  21. package/dist/core/decorators/autowired.decorator.d.ts +1 -1
  22. package/dist/core/decorators/autowired.decorator.js +12 -16
  23. package/dist/core/decorators/config-property.decorator.js +9 -15
  24. package/dist/core/decorators/controller.decorator.js +9 -12
  25. package/dist/core/decorators/create-param-decorator.d.ts +1 -1
  26. package/dist/core/decorators/create-param-decorator.js +7 -12
  27. package/dist/core/decorators/index.d.ts +9 -9
  28. package/dist/core/decorators/index.js +9 -25
  29. package/dist/core/decorators/injectable.decorator.d.ts +1 -1
  30. package/dist/core/decorators/injectable.decorator.js +8 -11
  31. package/dist/core/decorators/param.decorator.d.ts +1 -1
  32. package/dist/core/decorators/param.decorator.js +14 -17
  33. package/dist/core/decorators/provider.decorator.d.ts +2 -2
  34. package/dist/core/decorators/provider.decorator.js +12 -17
  35. package/dist/core/decorators/route.decorator.js +13 -17
  36. package/dist/core/discovery.d.ts +1 -1
  37. package/dist/core/discovery.js +25 -57
  38. package/dist/core/exceptions/catch.decorator.d.ts +1 -1
  39. package/dist/core/exceptions/catch.decorator.js +6 -11
  40. package/dist/core/exceptions/config.exceptions.js +3 -9
  41. package/dist/core/exceptions/discovery.exception.js +1 -5
  42. package/dist/core/exceptions/exception-filter.js +5 -10
  43. package/dist/core/exceptions/exceptions.d.ts +1 -1
  44. package/dist/core/exceptions/exceptions.js +19 -40
  45. package/dist/core/exceptions/http-exception.js +1 -5
  46. package/dist/core/exceptions/index.d.ts +7 -7
  47. package/dist/core/exceptions/index.js +7 -39
  48. package/dist/core/exceptions/validation.exception.d.ts +1 -1
  49. package/dist/core/exceptions/validation.exception.js +2 -6
  50. package/dist/core/guards/can-activate.interface.d.ts +1 -1
  51. package/dist/core/guards/can-activate.interface.js +1 -2
  52. package/dist/core/guards/execution-context.d.ts +1 -1
  53. package/dist/core/guards/execution-context.js +1 -5
  54. package/dist/core/guards/index.d.ts +3 -3
  55. package/dist/core/guards/index.js +2 -8
  56. package/dist/core/guards/use-guards.decorator.d.ts +2 -2
  57. package/dist/core/guards/use-guards.decorator.js +10 -14
  58. package/dist/core/index.d.ts +17 -17
  59. package/dist/core/index.js +17 -35
  60. package/dist/core/interceptors/index.d.ts +2 -2
  61. package/dist/core/interceptors/index.js +1 -6
  62. package/dist/core/interceptors/interceptor.interface.d.ts +1 -1
  63. package/dist/core/interceptors/interceptor.interface.js +1 -2
  64. package/dist/core/interceptors/use-interceptors.decorator.d.ts +2 -2
  65. package/dist/core/interceptors/use-interceptors.decorator.js +10 -14
  66. package/dist/core/lifecycle/event-bus.d.ts +1 -1
  67. package/dist/core/lifecycle/event-bus.js +4 -7
  68. package/dist/core/lifecycle/index.d.ts +3 -3
  69. package/dist/core/lifecycle/index.js +3 -19
  70. package/dist/core/lifecycle/interfaces.js +1 -2
  71. package/dist/core/lifecycle/on.decorator.d.ts +1 -1
  72. package/dist/core/lifecycle/on.decorator.js +5 -9
  73. package/dist/core/metadata.d.ts +2 -2
  74. package/dist/core/metadata.js +26 -43
  75. package/dist/core/middleware/index.d.ts +3 -3
  76. package/dist/core/middleware/index.js +2 -9
  77. package/dist/core/middleware/middleware.decorator.js +2 -5
  78. package/dist/core/middleware/rikta-middleware.interface.js +1 -2
  79. package/dist/core/middleware/use-middleware.decorator.d.ts +2 -2
  80. package/dist/core/middleware/use-middleware.decorator.js +10 -14
  81. package/dist/core/profiler/index.d.ts +2 -2
  82. package/dist/core/profiler/index.js +1 -8
  83. package/dist/core/profiler/performance-profiler.d.ts +1 -1
  84. package/dist/core/profiler/performance-profiler.js +6 -12
  85. package/dist/core/registry.d.ts +1 -1
  86. package/dist/core/registry.js +4 -7
  87. package/dist/core/router/router.d.ts +2 -2
  88. package/dist/core/router/router.js +31 -35
  89. package/dist/core/types.d.ts +3 -3
  90. package/dist/core/types.js +1 -2
  91. package/dist/index.d.ts +2 -2
  92. package/dist/index.js +2 -20
  93. package/package.json +8 -1
@@ -1,39 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DiscoveryException = exports.ConfigProviderInstantiationException = exports.ConfigProviderNotFoundException = exports.ConfigProviderAlreadyRegisteredException = exports.getCatchMetadata = exports.CATCH_METADATA = exports.Catch = exports.createExceptionHandler = exports.GlobalExceptionFilter = exports.GatewayTimeoutException = exports.ServiceUnavailableException = exports.BadGatewayException = exports.NotImplementedException = exports.InternalServerErrorException = exports.TooManyRequestsException = exports.UnprocessableEntityException = exports.UnsupportedMediaTypeException = exports.PayloadTooLargeException = exports.GoneException = exports.ConflictException = exports.RequestTimeoutException = exports.NotAcceptableException = exports.MethodNotAllowedException = exports.NotFoundException = exports.ForbiddenException = exports.UnauthorizedException = exports.BadRequestException = exports.ValidationException = exports.HttpException = void 0;
4
- var http_exception_1 = require("./http-exception");
5
- Object.defineProperty(exports, "HttpException", { enumerable: true, get: function () { return http_exception_1.HttpException; } });
6
- var validation_exception_1 = require("./validation.exception");
7
- Object.defineProperty(exports, "ValidationException", { enumerable: true, get: function () { return validation_exception_1.ValidationException; } });
8
- var exceptions_1 = require("./exceptions");
9
- Object.defineProperty(exports, "BadRequestException", { enumerable: true, get: function () { return exceptions_1.BadRequestException; } });
10
- Object.defineProperty(exports, "UnauthorizedException", { enumerable: true, get: function () { return exceptions_1.UnauthorizedException; } });
11
- Object.defineProperty(exports, "ForbiddenException", { enumerable: true, get: function () { return exceptions_1.ForbiddenException; } });
12
- Object.defineProperty(exports, "NotFoundException", { enumerable: true, get: function () { return exceptions_1.NotFoundException; } });
13
- Object.defineProperty(exports, "MethodNotAllowedException", { enumerable: true, get: function () { return exceptions_1.MethodNotAllowedException; } });
14
- Object.defineProperty(exports, "NotAcceptableException", { enumerable: true, get: function () { return exceptions_1.NotAcceptableException; } });
15
- Object.defineProperty(exports, "RequestTimeoutException", { enumerable: true, get: function () { return exceptions_1.RequestTimeoutException; } });
16
- Object.defineProperty(exports, "ConflictException", { enumerable: true, get: function () { return exceptions_1.ConflictException; } });
17
- Object.defineProperty(exports, "GoneException", { enumerable: true, get: function () { return exceptions_1.GoneException; } });
18
- Object.defineProperty(exports, "PayloadTooLargeException", { enumerable: true, get: function () { return exceptions_1.PayloadTooLargeException; } });
19
- Object.defineProperty(exports, "UnsupportedMediaTypeException", { enumerable: true, get: function () { return exceptions_1.UnsupportedMediaTypeException; } });
20
- Object.defineProperty(exports, "UnprocessableEntityException", { enumerable: true, get: function () { return exceptions_1.UnprocessableEntityException; } });
21
- Object.defineProperty(exports, "TooManyRequestsException", { enumerable: true, get: function () { return exceptions_1.TooManyRequestsException; } });
22
- Object.defineProperty(exports, "InternalServerErrorException", { enumerable: true, get: function () { return exceptions_1.InternalServerErrorException; } });
23
- Object.defineProperty(exports, "NotImplementedException", { enumerable: true, get: function () { return exceptions_1.NotImplementedException; } });
24
- Object.defineProperty(exports, "BadGatewayException", { enumerable: true, get: function () { return exceptions_1.BadGatewayException; } });
25
- Object.defineProperty(exports, "ServiceUnavailableException", { enumerable: true, get: function () { return exceptions_1.ServiceUnavailableException; } });
26
- Object.defineProperty(exports, "GatewayTimeoutException", { enumerable: true, get: function () { return exceptions_1.GatewayTimeoutException; } });
27
- var exception_filter_1 = require("./exception-filter");
28
- Object.defineProperty(exports, "GlobalExceptionFilter", { enumerable: true, get: function () { return exception_filter_1.GlobalExceptionFilter; } });
29
- Object.defineProperty(exports, "createExceptionHandler", { enumerable: true, get: function () { return exception_filter_1.createExceptionHandler; } });
30
- var catch_decorator_1 = require("./catch.decorator");
31
- Object.defineProperty(exports, "Catch", { enumerable: true, get: function () { return catch_decorator_1.Catch; } });
32
- Object.defineProperty(exports, "CATCH_METADATA", { enumerable: true, get: function () { return catch_decorator_1.CATCH_METADATA; } });
33
- Object.defineProperty(exports, "getCatchMetadata", { enumerable: true, get: function () { return catch_decorator_1.getCatchMetadata; } });
34
- var config_exceptions_1 = require("./config.exceptions");
35
- Object.defineProperty(exports, "ConfigProviderAlreadyRegisteredException", { enumerable: true, get: function () { return config_exceptions_1.ConfigProviderAlreadyRegisteredException; } });
36
- Object.defineProperty(exports, "ConfigProviderNotFoundException", { enumerable: true, get: function () { return config_exceptions_1.ConfigProviderNotFoundException; } });
37
- Object.defineProperty(exports, "ConfigProviderInstantiationException", { enumerable: true, get: function () { return config_exceptions_1.ConfigProviderInstantiationException; } });
38
- var discovery_exception_1 = require("./discovery.exception");
39
- Object.defineProperty(exports, "DiscoveryException", { enumerable: true, get: function () { return discovery_exception_1.DiscoveryException; } });
1
+ export { HttpException } from './http-exception.js';
2
+ export { ValidationException } from './validation.exception.js';
3
+ export { BadRequestException, UnauthorizedException, ForbiddenException, NotFoundException, MethodNotAllowedException, NotAcceptableException, RequestTimeoutException, ConflictException, GoneException, PayloadTooLargeException, UnsupportedMediaTypeException, UnprocessableEntityException, TooManyRequestsException, InternalServerErrorException, NotImplementedException, BadGatewayException, ServiceUnavailableException, GatewayTimeoutException, } from './exceptions.js';
4
+ export { GlobalExceptionFilter, createExceptionHandler, } from './exception-filter.js';
5
+ export { Catch, CATCH_METADATA, getCatchMetadata } from './catch.decorator.js';
6
+ export { ConfigProviderAlreadyRegisteredException, ConfigProviderNotFoundException, ConfigProviderInstantiationException, } from './config.exceptions.js';
7
+ export { DiscoveryException, } from './discovery.exception.js';
@@ -1,5 +1,5 @@
1
1
  import type { ZodError } from 'zod';
2
- import { HttpException } from './http-exception';
2
+ import { HttpException } from './http-exception.js';
3
3
  export interface ValidationErrorDetails {
4
4
  path: (string | number)[];
5
5
  message: string;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ValidationException = void 0;
4
- const http_exception_1 = require("./http-exception");
5
- class ValidationException extends http_exception_1.HttpException {
1
+ import { HttpException } from './http-exception.js';
2
+ export class ValidationException extends HttpException {
6
3
  zodError;
7
4
  errors;
8
5
  constructor(zodError, message = 'Validation failed') {
@@ -34,4 +31,3 @@ class ValidationException extends http_exception_1.HttpException {
34
31
  return this.zodError.format();
35
32
  }
36
33
  }
37
- exports.ValidationException = ValidationException;
@@ -1,4 +1,4 @@
1
- import type { ExecutionContext } from './execution-context';
1
+ import type { ExecutionContext } from './execution-context.js';
2
2
  export interface CanActivate {
3
3
  canActivate(context: ExecutionContext): boolean | Promise<boolean>;
4
4
  }
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { FastifyRequest, FastifyReply } from 'fastify';
2
- import type { Constructor } from '../types';
2
+ import type { Constructor } from '../types.js';
3
3
  export interface HttpArgumentsHost {
4
4
  getRequest<T = FastifyRequest>(): T;
5
5
  getResponse<T = FastifyReply>(): T;
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExecutionContextImpl = void 0;
4
- class ExecutionContextImpl {
1
+ export class ExecutionContextImpl {
5
2
  request;
6
3
  reply;
7
4
  controllerClass;
@@ -36,4 +33,3 @@ class ExecutionContextImpl {
36
33
  return Reflect.getMetadata(key, this.controllerClass, this.handlerName);
37
34
  }
38
35
  }
39
- exports.ExecutionContextImpl = ExecutionContextImpl;
@@ -1,3 +1,3 @@
1
- export { CanActivate } from './can-activate.interface';
2
- export { ExecutionContext, ExecutionContextImpl } from './execution-context';
3
- export { UseGuards, getGuardsMetadata } from './use-guards.decorator';
1
+ export { CanActivate } from './can-activate.interface.js';
2
+ export { ExecutionContext, ExecutionContextImpl } from './execution-context.js';
3
+ export { UseGuards, getGuardsMetadata } from './use-guards.decorator.js';
@@ -1,8 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getGuardsMetadata = exports.UseGuards = exports.ExecutionContextImpl = void 0;
4
- var execution_context_1 = require("./execution-context");
5
- Object.defineProperty(exports, "ExecutionContextImpl", { enumerable: true, get: function () { return execution_context_1.ExecutionContextImpl; } });
6
- var use_guards_decorator_1 = require("./use-guards.decorator");
7
- Object.defineProperty(exports, "UseGuards", { enumerable: true, get: function () { return use_guards_decorator_1.UseGuards; } });
8
- Object.defineProperty(exports, "getGuardsMetadata", { enumerable: true, get: function () { return use_guards_decorator_1.getGuardsMetadata; } });
1
+ export { ExecutionContextImpl } from './execution-context.js';
2
+ export { UseGuards, getGuardsMetadata } from './use-guards.decorator.js';
@@ -1,6 +1,6 @@
1
1
  import 'reflect-metadata';
2
- import type { Constructor } from '../types';
3
- import type { CanActivate } from './can-activate.interface';
2
+ import type { Constructor } from '../types.js';
3
+ import type { CanActivate } from './can-activate.interface.js';
4
4
  export type GuardClass = Constructor<CanActivate>;
5
5
  export declare function UseGuards(...guards: GuardClass[]): ClassDecorator & MethodDecorator;
6
6
  export declare function getGuardsMetadata(target: Constructor, propertyKey?: string | symbol): GuardClass[];
@@ -1,26 +1,22 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UseGuards = UseGuards;
4
- exports.getGuardsMetadata = getGuardsMetadata;
5
- require("reflect-metadata");
6
- const constants_1 = require("../constants");
7
- function UseGuards(...guards) {
1
+ import 'reflect-metadata';
2
+ import { GUARDS_METADATA } from '../constants.js';
3
+ export function UseGuards(...guards) {
8
4
  return (target, propertyKey) => {
9
5
  if (propertyKey !== undefined) {
10
- const existingGuards = Reflect.getMetadata(constants_1.GUARDS_METADATA, target.constructor, propertyKey) ?? [];
11
- Reflect.defineMetadata(constants_1.GUARDS_METADATA, [...existingGuards, ...guards], target.constructor, propertyKey);
6
+ const existingGuards = Reflect.getMetadata(GUARDS_METADATA, target.constructor, propertyKey) ?? [];
7
+ Reflect.defineMetadata(GUARDS_METADATA, [...existingGuards, ...guards], target.constructor, propertyKey);
12
8
  }
13
9
  else {
14
- const existingGuards = Reflect.getMetadata(constants_1.GUARDS_METADATA, target) ?? [];
15
- Reflect.defineMetadata(constants_1.GUARDS_METADATA, [...existingGuards, ...guards], target);
10
+ const existingGuards = Reflect.getMetadata(GUARDS_METADATA, target) ?? [];
11
+ Reflect.defineMetadata(GUARDS_METADATA, [...existingGuards, ...guards], target);
16
12
  }
17
13
  };
18
14
  }
19
- function getGuardsMetadata(target, propertyKey) {
20
- const classGuards = Reflect.getMetadata(constants_1.GUARDS_METADATA, target) ?? [];
15
+ export function getGuardsMetadata(target, propertyKey) {
16
+ const classGuards = Reflect.getMetadata(GUARDS_METADATA, target) ?? [];
21
17
  if (!propertyKey) {
22
18
  return classGuards;
23
19
  }
24
- const methodGuards = Reflect.getMetadata(constants_1.GUARDS_METADATA, target, propertyKey) ?? [];
20
+ const methodGuards = Reflect.getMetadata(GUARDS_METADATA, target, propertyKey) ?? [];
25
21
  return [...classGuards, ...methodGuards];
26
22
  }
@@ -1,19 +1,19 @@
1
- export * from './types';
2
- export * from './constants';
3
- export * from './container';
4
- export * from './registry';
5
- export * from './discovery';
6
- export * from './lifecycle';
7
- export * from './router/router';
8
- export * from './application';
9
- export * from './decorators';
10
- export * from './exceptions';
11
- export * from './guards';
12
- export * from './middleware';
13
- export * from './interceptors';
14
- export * from './config';
15
- export * from './metadata';
16
- export * from './profiler';
1
+ export * from './types.js';
2
+ export * from './constants.js';
3
+ export * from './container/index.js';
4
+ export * from './registry.js';
5
+ export * from './discovery.js';
6
+ export * from './lifecycle/index.js';
7
+ export * from './router/router.js';
8
+ export * from './application.js';
9
+ export * from './decorators/index.js';
10
+ export * from './exceptions/index.js';
11
+ export * from './guards/index.js';
12
+ export * from './middleware/index.js';
13
+ export * from './interceptors/index.js';
14
+ export * from './config/index.js';
15
+ export * from './metadata.js';
16
+ export * from './profiler/index.js';
17
17
  export { z } from 'zod';
18
- export type { ZodType, ZodSchema, ZodError, ZodIssue, infer as ZodInfer } from 'zod';
18
+ export type { ZodError, ZodIssue, infer as ZodInfer, input as ZodInput, output as ZodOutput } from 'zod';
19
19
  export type { FastifyInstance, FastifyRequest, FastifyReply } from 'fastify';
@@ -1,35 +1,17 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.z = void 0;
18
- __exportStar(require("./types"), exports);
19
- __exportStar(require("./constants"), exports);
20
- __exportStar(require("./container"), exports);
21
- __exportStar(require("./registry"), exports);
22
- __exportStar(require("./discovery"), exports);
23
- __exportStar(require("./lifecycle"), exports);
24
- __exportStar(require("./router/router"), exports);
25
- __exportStar(require("./application"), exports);
26
- __exportStar(require("./decorators"), exports);
27
- __exportStar(require("./exceptions"), exports);
28
- __exportStar(require("./guards"), exports);
29
- __exportStar(require("./middleware"), exports);
30
- __exportStar(require("./interceptors"), exports);
31
- __exportStar(require("./config"), exports);
32
- __exportStar(require("./metadata"), exports);
33
- __exportStar(require("./profiler"), exports);
34
- var zod_1 = require("zod");
35
- Object.defineProperty(exports, "z", { enumerable: true, get: function () { return zod_1.z; } });
1
+ export * from './types.js';
2
+ export * from './constants.js';
3
+ export * from './container/index.js';
4
+ export * from './registry.js';
5
+ export * from './discovery.js';
6
+ export * from './lifecycle/index.js';
7
+ export * from './router/router.js';
8
+ export * from './application.js';
9
+ export * from './decorators/index.js';
10
+ export * from './exceptions/index.js';
11
+ export * from './guards/index.js';
12
+ export * from './middleware/index.js';
13
+ export * from './interceptors/index.js';
14
+ export * from './config/index.js';
15
+ export * from './metadata.js';
16
+ export * from './profiler/index.js';
17
+ export { z } from 'zod';
@@ -1,2 +1,2 @@
1
- export { Interceptor, CallHandler } from './interceptor.interface';
2
- export { UseInterceptors, getInterceptorsMetadata, InterceptorClass } from './use-interceptors.decorator';
1
+ export { Interceptor, CallHandler } from './interceptor.interface.js';
2
+ export { UseInterceptors, getInterceptorsMetadata, InterceptorClass } from './use-interceptors.decorator.js';
@@ -1,6 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getInterceptorsMetadata = exports.UseInterceptors = void 0;
4
- var use_interceptors_decorator_1 = require("./use-interceptors.decorator");
5
- Object.defineProperty(exports, "UseInterceptors", { enumerable: true, get: function () { return use_interceptors_decorator_1.UseInterceptors; } });
6
- Object.defineProperty(exports, "getInterceptorsMetadata", { enumerable: true, get: function () { return use_interceptors_decorator_1.getInterceptorsMetadata; } });
1
+ export { UseInterceptors, getInterceptorsMetadata } from './use-interceptors.decorator.js';
@@ -1,4 +1,4 @@
1
- import { ExecutionContext } from '../guards/execution-context';
1
+ import { ExecutionContext } from '../guards/execution-context.js';
2
2
  export interface Interceptor {
3
3
  intercept(context: ExecutionContext, next: CallHandler): Promise<unknown>;
4
4
  }
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,6 +1,6 @@
1
1
  import 'reflect-metadata';
2
- import { Constructor } from '../types';
3
- import type { Interceptor } from './interceptor.interface';
2
+ import { Constructor } from '../types.js';
3
+ import type { Interceptor } from './interceptor.interface.js';
4
4
  export type InterceptorClass = Constructor<Interceptor>;
5
5
  export declare function UseInterceptors(...interceptors: InterceptorClass[]): ClassDecorator & MethodDecorator;
6
6
  export declare function getInterceptorsMetadata(controllerClass: Constructor, methodName: string | symbol): InterceptorClass[];
@@ -1,23 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UseInterceptors = UseInterceptors;
4
- exports.getInterceptorsMetadata = getInterceptorsMetadata;
5
- require("reflect-metadata");
6
- const constants_1 = require("../constants");
7
- function UseInterceptors(...interceptors) {
1
+ import 'reflect-metadata';
2
+ import { INTERCEPTORS_METADATA } from '../constants.js';
3
+ export function UseInterceptors(...interceptors) {
8
4
  return (target, propertyKey, descriptor) => {
9
5
  if (propertyKey && descriptor) {
10
- const existingInterceptors = Reflect.getMetadata(constants_1.INTERCEPTORS_METADATA, target.constructor, propertyKey) ?? [];
11
- Reflect.defineMetadata(constants_1.INTERCEPTORS_METADATA, [...existingInterceptors, ...interceptors], target.constructor, propertyKey);
6
+ const existingInterceptors = Reflect.getMetadata(INTERCEPTORS_METADATA, target.constructor, propertyKey) ?? [];
7
+ Reflect.defineMetadata(INTERCEPTORS_METADATA, [...existingInterceptors, ...interceptors], target.constructor, propertyKey);
12
8
  }
13
9
  else {
14
- const existingInterceptors = Reflect.getMetadata(constants_1.INTERCEPTORS_METADATA, target) ?? [];
15
- Reflect.defineMetadata(constants_1.INTERCEPTORS_METADATA, [...existingInterceptors, ...interceptors], target);
10
+ const existingInterceptors = Reflect.getMetadata(INTERCEPTORS_METADATA, target) ?? [];
11
+ Reflect.defineMetadata(INTERCEPTORS_METADATA, [...existingInterceptors, ...interceptors], target);
16
12
  }
17
13
  };
18
14
  }
19
- function getInterceptorsMetadata(controllerClass, methodName) {
20
- const controllerInterceptors = Reflect.getMetadata(constants_1.INTERCEPTORS_METADATA, controllerClass) ?? [];
21
- const methodInterceptors = Reflect.getMetadata(constants_1.INTERCEPTORS_METADATA, controllerClass, methodName) ?? [];
15
+ export function getInterceptorsMetadata(controllerClass, methodName) {
16
+ const controllerInterceptors = Reflect.getMetadata(INTERCEPTORS_METADATA, controllerClass) ?? [];
17
+ const methodInterceptors = Reflect.getMetadata(INTERCEPTORS_METADATA, controllerClass, methodName) ?? [];
22
18
  return [...controllerInterceptors, ...methodInterceptors];
23
19
  }
@@ -1,4 +1,4 @@
1
- import { Constructor } from '../types';
1
+ import { Constructor } from '../types.js';
2
2
  export interface EventPayload {
3
3
  'app:discovery': {
4
4
  files: string[];
@@ -1,13 +1,10 @@
1
- "use strict";
2
1
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
2
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
3
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
6
  };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.EventBus = void 0;
10
- const injectable_decorator_1 = require("../decorators/injectable.decorator");
7
+ import { Injectable } from '../decorators/injectable.decorator.js';
11
8
  let EventBus = class EventBus {
12
9
  listeners = new Map();
13
10
  onceListeners = new Map();
@@ -105,7 +102,7 @@ let EventBus = class EventBus {
105
102
  return [...this.ownerUnsubscribers.keys()];
106
103
  }
107
104
  };
108
- exports.EventBus = EventBus;
109
- exports.EventBus = EventBus = __decorate([
110
- (0, injectable_decorator_1.Injectable)()
105
+ EventBus = __decorate([
106
+ Injectable()
111
107
  ], EventBus);
108
+ export { EventBus };
@@ -1,3 +1,3 @@
1
- export * from './event-bus';
2
- export * from './on.decorator';
3
- export * from './interfaces';
1
+ export * from './event-bus.js';
2
+ export * from './on.decorator.js';
3
+ export * from './interfaces.js';
@@ -1,19 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./event-bus"), exports);
18
- __exportStar(require("./on.decorator"), exports);
19
- __exportStar(require("./interfaces"), exports);
1
+ export * from './event-bus.js';
2
+ export * from './on.decorator.js';
3
+ export * from './interfaces.js';
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import 'reflect-metadata';
2
- import { LifecycleEvent } from './event-bus';
2
+ import { LifecycleEvent } from './event-bus.js';
3
3
  export declare const ON_EVENT_METADATA: unique symbol;
4
4
  export interface OnEventMetadata {
5
5
  event: string;
@@ -1,17 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ON_EVENT_METADATA = void 0;
4
- exports.On = On;
5
- require("reflect-metadata");
6
- exports.ON_EVENT_METADATA = Symbol('on:event:metadata');
7
- function On(event, options) {
1
+ import 'reflect-metadata';
2
+ export const ON_EVENT_METADATA = Symbol('on:event:metadata');
3
+ export function On(event, options) {
8
4
  return (target, propertyKey) => {
9
- const existing = Reflect.getMetadata(exports.ON_EVENT_METADATA, target.constructor) ?? [];
5
+ const existing = Reflect.getMetadata(ON_EVENT_METADATA, target.constructor) ?? [];
10
6
  existing.push({
11
7
  event,
12
8
  methodName: String(propertyKey),
13
9
  priority: options?.priority ?? 0,
14
10
  });
15
- Reflect.defineMetadata(exports.ON_EVENT_METADATA, existing, target.constructor);
11
+ Reflect.defineMetadata(ON_EVENT_METADATA, existing, target.constructor);
16
12
  };
17
13
  }
@@ -1,6 +1,6 @@
1
1
  import 'reflect-metadata';
2
- import type { RouteDefinition, ControllerMetadata } from './types';
3
- import type { ParamMetadata } from './decorators/param.decorator';
2
+ import type { RouteDefinition, ControllerMetadata } from './types.js';
3
+ import type { ParamMetadata } from './decorators/param.decorator.js';
4
4
  type Constructor<T = unknown> = new (...args: any[]) => T;
5
5
  export declare function getControllerMetadata(target: Constructor): ControllerMetadata | undefined;
6
6
  export declare function isController(target: Constructor): boolean;
@@ -1,73 +1,56 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getControllerMetadata = getControllerMetadata;
4
- exports.isController = isController;
5
- exports.getControllerPath = getControllerPath;
6
- exports.getRoutes = getRoutes;
7
- exports.hasRoutes = hasRoutes;
8
- exports.getParamMetadata = getParamMetadata;
9
- exports.getParamMetadataByIndex = getParamMetadataByIndex;
10
- exports.getHttpCode = getHttpCode;
11
- exports.getGuards = getGuards;
12
- exports.getZodSchema = getZodSchema;
13
- exports.getClassMetadata = getClassMetadata;
14
- exports.getMethodMetadata = getMethodMetadata;
15
- exports.hasClassMetadata = hasClassMetadata;
16
- exports.hasMethodMetadata = hasMethodMetadata;
17
- exports.getMethodsWithMetadata = getMethodsWithMetadata;
18
- require("reflect-metadata");
19
- const constants_1 = require("./constants");
20
- function getControllerMetadata(target) {
21
- return Reflect.getMetadata(constants_1.CONTROLLER_METADATA, target);
1
+ import 'reflect-metadata';
2
+ import { CONTROLLER_METADATA, ROUTES_METADATA, PARAM_METADATA, HTTP_CODE_METADATA, GUARDS_METADATA, ZOD_SCHEMA_METADATA, } from './constants.js';
3
+ export function getControllerMetadata(target) {
4
+ return Reflect.getMetadata(CONTROLLER_METADATA, target);
22
5
  }
23
- function isController(target) {
24
- return Reflect.hasMetadata(constants_1.CONTROLLER_METADATA, target);
6
+ export function isController(target) {
7
+ return Reflect.hasMetadata(CONTROLLER_METADATA, target);
25
8
  }
26
- function getControllerPath(target) {
9
+ export function getControllerPath(target) {
27
10
  const meta = getControllerMetadata(target);
28
11
  return meta?.prefix ?? '';
29
12
  }
30
- function getRoutes(target) {
31
- return Reflect.getMetadata(constants_1.ROUTES_METADATA, target) || [];
13
+ export function getRoutes(target) {
14
+ return Reflect.getMetadata(ROUTES_METADATA, target) || [];
32
15
  }
33
- function hasRoutes(target) {
16
+ export function hasRoutes(target) {
34
17
  const routes = getRoutes(target);
35
18
  return routes.length > 0;
36
19
  }
37
- function getParamMetadata(target, methodName) {
38
- return Reflect.getMetadata(constants_1.PARAM_METADATA, target.prototype, methodName) || [];
20
+ export function getParamMetadata(target, methodName) {
21
+ return Reflect.getMetadata(PARAM_METADATA, target.prototype, methodName) || [];
39
22
  }
40
- function getParamMetadataByIndex(target, methodName, paramIndex) {
23
+ export function getParamMetadataByIndex(target, methodName, paramIndex) {
41
24
  const params = getParamMetadata(target, methodName);
42
25
  return params.find(p => p.index === paramIndex);
43
26
  }
44
- function getHttpCode(target, methodName) {
45
- return Reflect.getMetadata(constants_1.HTTP_CODE_METADATA, target.prototype, methodName);
27
+ export function getHttpCode(target, methodName) {
28
+ return Reflect.getMetadata(HTTP_CODE_METADATA, target.prototype, methodName);
46
29
  }
47
- function getGuards(target, methodName) {
30
+ export function getGuards(target, methodName) {
48
31
  if (methodName) {
49
- const methodGuards = Reflect.getMetadata(constants_1.GUARDS_METADATA, target.prototype, methodName) || [];
50
- const controllerGuards = Reflect.getMetadata(constants_1.GUARDS_METADATA, target) || [];
32
+ const methodGuards = Reflect.getMetadata(GUARDS_METADATA, target.prototype, methodName) || [];
33
+ const controllerGuards = Reflect.getMetadata(GUARDS_METADATA, target) || [];
51
34
  return [...controllerGuards, ...methodGuards];
52
35
  }
53
- return Reflect.getMetadata(constants_1.GUARDS_METADATA, target) || [];
36
+ return Reflect.getMetadata(GUARDS_METADATA, target) || [];
54
37
  }
55
- function getZodSchema(target, methodName) {
56
- return Reflect.getMetadata(constants_1.ZOD_SCHEMA_METADATA, target.prototype, methodName);
38
+ export function getZodSchema(target, methodName) {
39
+ return Reflect.getMetadata(ZOD_SCHEMA_METADATA, target.prototype, methodName);
57
40
  }
58
- function getClassMetadata(metadataKey, target) {
41
+ export function getClassMetadata(metadataKey, target) {
59
42
  return Reflect.getMetadata(metadataKey, target);
60
43
  }
61
- function getMethodMetadata(metadataKey, target, methodName) {
44
+ export function getMethodMetadata(metadataKey, target, methodName) {
62
45
  return Reflect.getMetadata(metadataKey, target.prototype, methodName);
63
46
  }
64
- function hasClassMetadata(metadataKey, target) {
47
+ export function hasClassMetadata(metadataKey, target) {
65
48
  return Reflect.hasMetadata(metadataKey, target);
66
49
  }
67
- function hasMethodMetadata(metadataKey, target, methodName) {
50
+ export function hasMethodMetadata(metadataKey, target, methodName) {
68
51
  return Reflect.hasMetadata(metadataKey, target.prototype, methodName);
69
52
  }
70
- function getMethodsWithMetadata(metadataKey, target) {
53
+ export function getMethodsWithMetadata(metadataKey, target) {
71
54
  const methods = [];
72
55
  const prototype = target.prototype;
73
56
  const propertyNames = Object.getOwnPropertyNames(prototype);
@@ -1,3 +1,3 @@
1
- export { Middleware } from './middleware.decorator';
2
- export { RiktaMiddleware, NextFunction } from './rikta-middleware.interface';
3
- export { UseMiddleware, getMiddlewareMetadata, getMiddlewareMetadata as getMiddlewaresMetadata, MiddlewareClass } from './use-middleware.decorator';
1
+ export { Middleware } from './middleware.decorator.js';
2
+ export { RiktaMiddleware, NextFunction } from './rikta-middleware.interface.js';
3
+ export { UseMiddleware, getMiddlewareMetadata, getMiddlewareMetadata as getMiddlewaresMetadata, MiddlewareClass } from './use-middleware.decorator.js';
@@ -1,9 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMiddlewaresMetadata = exports.getMiddlewareMetadata = exports.UseMiddleware = exports.Middleware = void 0;
4
- var middleware_decorator_1 = require("./middleware.decorator");
5
- Object.defineProperty(exports, "Middleware", { enumerable: true, get: function () { return middleware_decorator_1.Middleware; } });
6
- var use_middleware_decorator_1 = require("./use-middleware.decorator");
7
- Object.defineProperty(exports, "UseMiddleware", { enumerable: true, get: function () { return use_middleware_decorator_1.UseMiddleware; } });
8
- Object.defineProperty(exports, "getMiddlewareMetadata", { enumerable: true, get: function () { return use_middleware_decorator_1.getMiddlewareMetadata; } });
9
- Object.defineProperty(exports, "getMiddlewaresMetadata", { enumerable: true, get: function () { return use_middleware_decorator_1.getMiddlewareMetadata; } });
1
+ export { Middleware } from './middleware.decorator.js';
2
+ export { UseMiddleware, getMiddlewareMetadata, getMiddlewareMetadata as getMiddlewaresMetadata } from './use-middleware.decorator.js';
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Middleware = Middleware;
4
- require("reflect-metadata");
5
- function Middleware() {
1
+ import 'reflect-metadata';
2
+ export function Middleware() {
6
3
  return (target) => {
7
4
  Reflect.defineMetadata('middleware', true, target);
8
5
  Reflect.defineMetadata('injectable', true, target);
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,6 +1,6 @@
1
1
  import 'reflect-metadata';
2
- import type { Constructor } from '../types';
3
- import type { RiktaMiddleware } from './rikta-middleware.interface';
2
+ import type { Constructor } from '../types.js';
3
+ import type { RiktaMiddleware } from './rikta-middleware.interface.js';
4
4
  export type MiddlewareClass = Constructor<RiktaMiddleware>;
5
5
  export declare function UseMiddleware(...middleware: MiddlewareClass[]): ClassDecorator & MethodDecorator;
6
6
  export declare function getMiddlewareMetadata(target: Constructor, propertyKey?: string | symbol): MiddlewareClass[];