@aetherionfw/core 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Cristian Londoño
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,6 @@
1
+ export interface CanActivate {
2
+ canActivate(event: any, context: any): boolean | Promise<boolean>;
3
+ }
4
+ export interface Middleware {
5
+ use(event: any, context: any, next: () => Promise<any>): Promise<any>;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import { Type } from '../di/Injector';
2
+ export declare function createLambdaHandler(ControllerClass: Type): (event: any, context: any) => Promise<any>;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createLambdaHandler = createLambdaHandler;
4
+ const Injector_1 = require("../di/Injector");
5
+ function createLambdaHandler(ControllerClass) {
6
+ // Resolve the controller via DI
7
+ const controllerInstance = Injector_1.Injector.getInstance().resolve(ControllerClass);
8
+ return async (event, context) => {
9
+ // 1. Determine event type
10
+ const isHttpEvent = !!event.httpMethod || !!(event.requestContext && event.requestContext.http);
11
+ // 2. Identify target method from ENV (Injected by builder for 1:1 Lambda per Handle)
12
+ const targetMethodName = process.env.AETHERION_TARGET_METHOD;
13
+ if (!targetMethodName || typeof controllerInstance[targetMethodName] !== 'function') {
14
+ if (isHttpEvent) {
15
+ return { statusCode: 404, body: 'Not Found: Target method missing or invalid' };
16
+ }
17
+ throw new Error(`No suitable handler found for target method: ${targetMethodName}`);
18
+ }
19
+ // 3. Middlewares
20
+ const classMiddlewares = Reflect.getMetadata('middlewares', ControllerClass) || [];
21
+ const methodMiddlewares = Reflect.getMetadata('middlewares', ControllerClass.prototype, targetMethodName) || [];
22
+ const allMiddlewares = [...classMiddlewares, ...methodMiddlewares];
23
+ let middlewareIndex = 0;
24
+ const executeMiddleware = async () => {
25
+ if (middlewareIndex < allMiddlewares.length) {
26
+ const MiddlewareClass = allMiddlewares[middlewareIndex++];
27
+ const middlewareInstance = Injector_1.Injector.getInstance().resolve(MiddlewareClass);
28
+ return middlewareInstance.use(event, context, executeMiddleware);
29
+ }
30
+ else {
31
+ // Finally execute the controller method
32
+ return controllerInstance[targetMethodName](event, context);
33
+ }
34
+ };
35
+ try {
36
+ const result = await executeMiddleware();
37
+ if (isHttpEvent) {
38
+ // Auto-format HTTP response if the controller just returned an object
39
+ if (result && result.statusCode) {
40
+ return result;
41
+ }
42
+ return {
43
+ statusCode: 200,
44
+ body: JSON.stringify(result),
45
+ headers: { 'Content-Type': 'application/json' }
46
+ };
47
+ }
48
+ return result; // SQS resolves normally
49
+ }
50
+ catch (error) {
51
+ if (isHttpEvent) {
52
+ return { statusCode: 500, body: JSON.stringify({ error: error.message }) };
53
+ }
54
+ throw error;
55
+ }
56
+ };
57
+ }
@@ -0,0 +1,2 @@
1
+ import { ControllerMetadata } from '../registry/MetadataRegistry';
2
+ export declare function LambdaController(metadata: ControllerMetadata): ClassDecorator;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LambdaController = LambdaController;
4
+ const MetadataRegistry_1 = require("../registry/MetadataRegistry");
5
+ function LambdaController(metadata) {
6
+ return (target) => {
7
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerController(target, metadata);
8
+ };
9
+ }
@@ -0,0 +1,8 @@
1
+ import { RouteMetadata } from '../registry/MetadataRegistry';
2
+ export declare function Route(metadata: Omit<RouteMetadata, 'methodName'>): MethodDecorator;
3
+ export declare function Handle(options?: {
4
+ timeout?: number;
5
+ memorySize?: number;
6
+ }): MethodDecorator;
7
+ export declare function IamPermissions(permissions: Record<string, any>): ClassDecorator & MethodDecorator;
8
+ export declare function SqsTrigger(queueName: string, options?: any): MethodDecorator;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Route = Route;
4
+ exports.Handle = Handle;
5
+ exports.IamPermissions = IamPermissions;
6
+ exports.SqsTrigger = SqsTrigger;
7
+ const MetadataRegistry_1 = require("../registry/MetadataRegistry");
8
+ function Route(metadata) {
9
+ return (target, propertyKey, descriptor) => {
10
+ const fullMetadata = { ...metadata, methodName: String(propertyKey) };
11
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerRoute(target.constructor, fullMetadata);
12
+ Reflect.defineMetadata('route', fullMetadata, target, propertyKey);
13
+ };
14
+ }
15
+ function Handle(options) {
16
+ return (target, propertyKey, descriptor) => {
17
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerHandle(target.constructor, {
18
+ methodName: String(propertyKey),
19
+ timeout: options?.timeout,
20
+ memorySize: options?.memorySize,
21
+ });
22
+ Reflect.defineMetadata('handle', options || true, target, propertyKey);
23
+ };
24
+ }
25
+ function IamPermissions(permissions) {
26
+ return (target, propertyKey, descriptor) => {
27
+ // If propertyKey is undefined, it's a class decorator so target is the constructor.
28
+ // If propertyKey is defined, it's a method decorator so target is the prototype.
29
+ const actualTarget = propertyKey ? target.constructor : target;
30
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerIamPermissions(actualTarget, {
31
+ methodName: propertyKey ? String(propertyKey) : undefined,
32
+ permissions
33
+ });
34
+ };
35
+ }
36
+ function SqsTrigger(queueName, options) {
37
+ return (target, propertyKey, descriptor) => {
38
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerSqsTrigger(target.constructor, {
39
+ queueName,
40
+ methodName: String(propertyKey),
41
+ options
42
+ });
43
+ };
44
+ }
@@ -0,0 +1,48 @@
1
+ export declare function Infra(): ClassDecorator;
2
+ export declare function S3Bucket(props: {
3
+ name: string;
4
+ versioned?: boolean;
5
+ private?: boolean;
6
+ }): PropertyDecorator;
7
+ export declare function DynamoTable(props: {
8
+ name: string;
9
+ partitionKey: any;
10
+ }): PropertyDecorator;
11
+ export declare function SqsQueue(props: {
12
+ name: string;
13
+ visibilityTimeout?: number;
14
+ deadLetterQueue?: string;
15
+ }): PropertyDecorator;
16
+ export declare function KmsKey(props: {
17
+ alias?: string;
18
+ description?: string;
19
+ }): PropertyDecorator;
20
+ export declare function SsmParameter(props: {
21
+ name: string;
22
+ value: string;
23
+ type?: string;
24
+ }): PropertyDecorator;
25
+ export declare function EventBridgeRule(props: {
26
+ name: string;
27
+ scheduleExpression?: string;
28
+ }): PropertyDecorator;
29
+ export declare function CloudFrontDistribution(props: {
30
+ originDomain: string;
31
+ }): PropertyDecorator;
32
+ export declare function CognitoUserPool(props: {
33
+ name: string;
34
+ }): PropertyDecorator;
35
+ export declare function Vpc(props: {
36
+ name: string;
37
+ cidr: string;
38
+ natGateways?: number;
39
+ }): PropertyDecorator;
40
+ export declare function IamRole(props: {
41
+ name: string;
42
+ assumedBy: string;
43
+ }): PropertyDecorator;
44
+ export declare function RdsInstance(props: {
45
+ engine: string;
46
+ size: string;
47
+ dbName: string;
48
+ }): PropertyDecorator;
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Infra = Infra;
4
+ exports.S3Bucket = S3Bucket;
5
+ exports.DynamoTable = DynamoTable;
6
+ exports.SqsQueue = SqsQueue;
7
+ exports.KmsKey = KmsKey;
8
+ exports.SsmParameter = SsmParameter;
9
+ exports.EventBridgeRule = EventBridgeRule;
10
+ exports.CloudFrontDistribution = CloudFrontDistribution;
11
+ exports.CognitoUserPool = CognitoUserPool;
12
+ exports.Vpc = Vpc;
13
+ exports.IamRole = IamRole;
14
+ exports.RdsInstance = RdsInstance;
15
+ const MetadataRegistry_1 = require("../registry/MetadataRegistry");
16
+ function Infra() {
17
+ return (target) => {
18
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerInfraClass(target);
19
+ };
20
+ }
21
+ // Example of a specific infra resource decorator
22
+ function S3Bucket(props) {
23
+ return (target, propertyKey) => {
24
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerInfraResource(target.constructor, {
25
+ type: 'S3Bucket',
26
+ name: String(propertyKey),
27
+ props
28
+ });
29
+ };
30
+ }
31
+ function DynamoTable(props) {
32
+ return (target, propertyKey) => {
33
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerInfraResource(target.constructor, {
34
+ type: 'DynamoTable',
35
+ name: String(propertyKey),
36
+ props
37
+ });
38
+ };
39
+ }
40
+ function SqsQueue(props) {
41
+ return (target, propertyKey) => {
42
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerInfraResource(target.constructor, {
43
+ type: 'SqsQueue',
44
+ name: String(propertyKey),
45
+ props
46
+ });
47
+ };
48
+ }
49
+ function KmsKey(props) {
50
+ return (target, propertyKey) => {
51
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerInfraResource(target.constructor, {
52
+ type: 'KmsKey',
53
+ name: String(propertyKey),
54
+ props
55
+ });
56
+ };
57
+ }
58
+ function SsmParameter(props) {
59
+ return (target, propertyKey) => {
60
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerInfraResource(target.constructor, {
61
+ type: 'SsmParameter',
62
+ name: String(propertyKey),
63
+ props
64
+ });
65
+ };
66
+ }
67
+ function EventBridgeRule(props) {
68
+ return (target, propertyKey) => {
69
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerInfraResource(target.constructor, {
70
+ type: 'EventBridgeRule',
71
+ name: String(propertyKey),
72
+ props
73
+ });
74
+ };
75
+ }
76
+ function CloudFrontDistribution(props) {
77
+ return (target, propertyKey) => {
78
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerInfraResource(target.constructor, {
79
+ type: 'CloudFrontDistribution',
80
+ name: String(propertyKey),
81
+ props
82
+ });
83
+ };
84
+ }
85
+ function CognitoUserPool(props) {
86
+ return (target, propertyKey) => {
87
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerInfraResource(target.constructor, {
88
+ type: 'CognitoUserPool',
89
+ name: String(propertyKey),
90
+ props
91
+ });
92
+ };
93
+ }
94
+ function Vpc(props) {
95
+ return (target, propertyKey) => {
96
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerInfraResource(target.constructor, {
97
+ type: 'Vpc',
98
+ name: String(propertyKey),
99
+ props
100
+ });
101
+ };
102
+ }
103
+ function IamRole(props) {
104
+ return (target, propertyKey) => {
105
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerInfraResource(target.constructor, {
106
+ type: 'IamRole',
107
+ name: String(propertyKey),
108
+ props
109
+ });
110
+ };
111
+ }
112
+ function RdsInstance(props) {
113
+ return (target, propertyKey) => {
114
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerInfraResource(target.constructor, {
115
+ type: 'RdsInstance',
116
+ name: String(propertyKey),
117
+ props
118
+ });
119
+ };
120
+ }
@@ -0,0 +1 @@
1
+ export declare function Injectable(): ClassDecorator;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Injectable = Injectable;
4
+ function Injectable() {
5
+ return (target) => {
6
+ // Keep it simple for now, can be extended for scoping (Singleton, Transient)
7
+ };
8
+ }
@@ -0,0 +1,2 @@
1
+ import { ModuleMetadata } from '../registry/MetadataRegistry';
2
+ export declare function Module(metadata: ModuleMetadata): ClassDecorator;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Module = Module;
4
+ const MetadataRegistry_1 = require("../registry/MetadataRegistry");
5
+ function Module(metadata) {
6
+ return (target) => {
7
+ MetadataRegistry_1.MetadataRegistry.getInstance().registerModule(target, metadata);
8
+ };
9
+ }
@@ -0,0 +1,3 @@
1
+ import { Type } from '../di/Injector';
2
+ import { Middleware } from '../adapter/interfaces';
3
+ export declare function UseMiddlewares(middlewares: Type<Middleware>[]): ClassDecorator & MethodDecorator;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UseMiddlewares = UseMiddlewares;
4
+ // We could extend MetadataRegistry to support storing middlewares per controller/method.
5
+ // For now, we'll attach it directly as reflect metadata.
6
+ function UseMiddlewares(middlewares) {
7
+ return (target, propertyKey) => {
8
+ if (propertyKey) {
9
+ Reflect.defineMetadata('middlewares', middlewares, target, propertyKey);
10
+ }
11
+ else {
12
+ Reflect.defineMetadata('middlewares', middlewares, target);
13
+ }
14
+ };
15
+ }
@@ -0,0 +1,10 @@
1
+ import 'reflect-metadata';
2
+ export type Type<T = any> = new (...args: any[]) => T;
3
+ export declare class Injector {
4
+ private static instance;
5
+ private container;
6
+ private constructor();
7
+ static getInstance(): Injector;
8
+ resolve<T>(target: Type<T>): T;
9
+ provide<T>(target: Type<T>, instance: T): void;
10
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Injector = void 0;
4
+ require("reflect-metadata");
5
+ class Injector {
6
+ static instance;
7
+ container = new Map();
8
+ constructor() { }
9
+ static getInstance() {
10
+ if (!Injector.instance) {
11
+ Injector.instance = new Injector();
12
+ }
13
+ return Injector.instance;
14
+ }
15
+ resolve(target) {
16
+ // If instance already exists, return it (Singleton pattern)
17
+ if (this.container.has(target)) {
18
+ return this.container.get(target);
19
+ }
20
+ // Get constructor parameters
21
+ const tokens = Reflect.getMetadata('design:paramtypes', target) || [];
22
+ // Resolve dependencies recursively
23
+ const injections = tokens.map((token) => this.resolve(token));
24
+ // Instantiate class with dependencies
25
+ const instance = new target(...injections);
26
+ // Store in container
27
+ this.container.set(target, instance);
28
+ return instance;
29
+ }
30
+ provide(target, instance) {
31
+ this.container.set(target, instance);
32
+ }
33
+ }
34
+ exports.Injector = Injector;
@@ -0,0 +1,10 @@
1
+ export * from './registry/MetadataRegistry';
2
+ export * from './decorators/module.decorator';
3
+ export * from './decorators/controller.decorator';
4
+ export * from './decorators/handler.decorator';
5
+ export * from './decorators/infra.decorator';
6
+ export * from './decorators/injectable.decorator';
7
+ export * from './decorators/use-middlewares.decorator';
8
+ export * from './di/Injector';
9
+ export * from './adapter/interfaces';
10
+ export * from './adapter/lambda-adapter';
package/dist/index.js ADDED
@@ -0,0 +1,26 @@
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("./registry/MetadataRegistry"), exports);
18
+ __exportStar(require("./decorators/module.decorator"), exports);
19
+ __exportStar(require("./decorators/controller.decorator"), exports);
20
+ __exportStar(require("./decorators/handler.decorator"), exports);
21
+ __exportStar(require("./decorators/infra.decorator"), exports);
22
+ __exportStar(require("./decorators/injectable.decorator"), exports);
23
+ __exportStar(require("./decorators/use-middlewares.decorator"), exports);
24
+ __exportStar(require("./di/Injector"), exports);
25
+ __exportStar(require("./adapter/interfaces"), exports);
26
+ __exportStar(require("./adapter/lambda-adapter"), exports);
@@ -0,0 +1,69 @@
1
+ import 'reflect-metadata';
2
+ export interface ModuleMetadata {
3
+ name: string;
4
+ imports?: any[];
5
+ providers?: any[];
6
+ controllers?: any[];
7
+ infra?: any[];
8
+ }
9
+ export interface ControllerMetadata {
10
+ lambdaName: string;
11
+ runtime?: string;
12
+ memorySize?: number;
13
+ timeout?: number;
14
+ layers?: string[];
15
+ }
16
+ export interface RouteMetadata {
17
+ method: string;
18
+ path: string;
19
+ authorizer?: string;
20
+ methodName: string;
21
+ }
22
+ export interface HandleMetadata {
23
+ methodName: string;
24
+ timeout?: number;
25
+ memorySize?: number;
26
+ }
27
+ export interface IamPermissionMetadata {
28
+ methodName?: string;
29
+ permissions: Record<string, any>;
30
+ }
31
+ export interface SqsTriggerMetadata {
32
+ queueName: string;
33
+ methodName: string;
34
+ options?: any;
35
+ }
36
+ export interface InfraMetadata {
37
+ type: string;
38
+ name: string;
39
+ props: any;
40
+ }
41
+ export declare class MetadataRegistry {
42
+ private static instance;
43
+ private modules;
44
+ private controllers;
45
+ private handles;
46
+ private iamPermissions;
47
+ private routes;
48
+ private sqsTriggers;
49
+ private infraClasses;
50
+ private infraResources;
51
+ private constructor();
52
+ static getInstance(): MetadataRegistry;
53
+ registerModule(target: any, metadata: ModuleMetadata): void;
54
+ getModules(): [any, ModuleMetadata][];
55
+ registerController(target: any, metadata: ControllerMetadata): void;
56
+ getControllers(): [any, ControllerMetadata][];
57
+ registerHandle(target: any, metadata: HandleMetadata): void;
58
+ getHandles(target: any): HandleMetadata[];
59
+ registerIamPermissions(target: any, metadata: IamPermissionMetadata): void;
60
+ getIamPermissions(target: any): IamPermissionMetadata[];
61
+ registerRoute(target: any, metadata: RouteMetadata): void;
62
+ getRoutes(target: any): RouteMetadata[];
63
+ registerSqsTrigger(target: any, metadata: SqsTriggerMetadata): void;
64
+ getSqsTriggers(target: any): SqsTriggerMetadata[];
65
+ registerInfraClass(target: any): void;
66
+ getInfraClasses(): any[];
67
+ registerInfraResource(target: any, metadata: InfraMetadata): void;
68
+ getInfraResources(target: any): InfraMetadata[];
69
+ }
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MetadataRegistry = void 0;
4
+ require("reflect-metadata");
5
+ class MetadataRegistry {
6
+ static instance;
7
+ modules = new Map();
8
+ controllers = new Map();
9
+ handles = new Map();
10
+ iamPermissions = new Map();
11
+ routes = new Map();
12
+ sqsTriggers = new Map(); // target -> triggers
13
+ infraClasses = new Map();
14
+ infraResources = new Map(); // target -> resources
15
+ constructor() { }
16
+ static getInstance() {
17
+ if (!MetadataRegistry.instance) {
18
+ MetadataRegistry.instance = new MetadataRegistry();
19
+ }
20
+ return MetadataRegistry.instance;
21
+ }
22
+ registerModule(target, metadata) {
23
+ this.modules.set(target, metadata);
24
+ }
25
+ getModules() {
26
+ return Array.from(this.modules.entries());
27
+ }
28
+ registerController(target, metadata) {
29
+ this.controllers.set(target, metadata);
30
+ }
31
+ getControllers() {
32
+ return Array.from(this.controllers.entries());
33
+ }
34
+ registerHandle(target, metadata) {
35
+ if (!this.handles.has(target)) {
36
+ this.handles.set(target, []);
37
+ }
38
+ this.handles.get(target).push(metadata);
39
+ }
40
+ getHandles(target) {
41
+ return this.handles.get(target) || [];
42
+ }
43
+ registerIamPermissions(target, metadata) {
44
+ if (!this.iamPermissions.has(target)) {
45
+ this.iamPermissions.set(target, []);
46
+ }
47
+ this.iamPermissions.get(target).push(metadata);
48
+ }
49
+ getIamPermissions(target) {
50
+ return this.iamPermissions.get(target) || [];
51
+ }
52
+ registerRoute(target, metadata) {
53
+ if (!this.routes.has(target)) {
54
+ this.routes.set(target, []);
55
+ }
56
+ this.routes.get(target).push(metadata);
57
+ }
58
+ getRoutes(target) {
59
+ return this.routes.get(target) || [];
60
+ }
61
+ registerSqsTrigger(target, metadata) {
62
+ if (!this.sqsTriggers.has(target)) {
63
+ this.sqsTriggers.set(target, []);
64
+ }
65
+ this.sqsTriggers.get(target).push(metadata);
66
+ }
67
+ getSqsTriggers(target) {
68
+ return this.sqsTriggers.get(target) || [];
69
+ }
70
+ registerInfraClass(target) {
71
+ this.infraClasses.set(target, true);
72
+ }
73
+ getInfraClasses() {
74
+ return Array.from(this.infraClasses.keys());
75
+ }
76
+ registerInfraResource(target, metadata) {
77
+ if (!this.infraResources.has(target)) {
78
+ this.infraResources.set(target, []);
79
+ }
80
+ this.infraResources.get(target).push(metadata);
81
+ }
82
+ getInfraResources(target) {
83
+ return this.infraResources.get(target) || [];
84
+ }
85
+ }
86
+ exports.MetadataRegistry = MetadataRegistry;
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@aetherionfw/core",
3
+ "version": "1.0.0",
4
+ "description": "Core decorators and runtime for Aetherion Framework",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "dependencies": {
8
+ "reflect-metadata": "^0.2.2"
9
+ },
10
+ "devDependencies": {
11
+ "@types/node": "^20.19.43",
12
+ "typescript": "^5.5.4"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "package.json",
20
+ "README.md"
21
+ ],
22
+ "author": "CrisD3v",
23
+ "license": "MIT",
24
+ "scripts": {
25
+ "build": "tsc",
26
+ "clean": "rm -rf dist"
27
+ }
28
+ }