Initial commit - Event Planner application

This commit is contained in:
mberlin
2026-03-18 14:55:56 -03:00
commit 86d779eb4d
7548 changed files with 1006324 additions and 0 deletions

6
dist/core/services/auth.service.d.ts vendored Normal file
View File

@@ -0,0 +1,6 @@
export declare class AuthService {
private readonly jwtSecret;
sign(payload: Record<string, any>, expiresIn?: string): string;
verify(token: string): Record<string, any> | null;
}
//# sourceMappingURL=auth.service.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../../src/core/services/auth.service.ts"],"names":[],"mappings":"AAGA,qBACa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA0D;IAEpF,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,SAAS,SAAO,GAAG,MAAM;IAI5D,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;CAQlD"}

65
dist/core/services/auth.service.js vendored Normal file
View File

@@ -0,0 +1,65 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.AuthService = void 0;
const common_1 = require("@nestjs/common");
const jwt = __importStar(require("jsonwebtoken"));
let AuthService = class AuthService {
constructor() {
this.jwtSecret = process.env.JWT_SECRET || 'default_secret';
}
sign(payload, expiresIn = '1d') {
return jwt.sign(payload, this.jwtSecret, { expiresIn });
}
verify(token) {
try {
const decoded = jwt.verify(token, this.jwtSecret);
return typeof decoded === 'string' ? { sub: decoded } : decoded;
}
catch {
return null;
}
}
};
exports.AuthService = AuthService;
exports.AuthService = AuthService = __decorate([
(0, common_1.Injectable)()
], AuthService);

View File

@@ -0,0 +1,11 @@
export declare class ModuleLinkerService {
/**
* Hydrates data from multiple modules by IDs for frontend consumption.
* @param links Array of objects with moduleName and id
*/
hydrate(links: Array<{
moduleName: string;
id: string;
}>): Promise<any[]>;
}
//# sourceMappingURL=module-linker.service.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"module-linker.service.d.ts","sourceRoot":"","sources":["../../../src/core/services/module-linker.service.ts"],"names":[],"mappings":"AAEA,qBACa,mBAAmB;IAC9B;;;OAGG;IACG,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;CAKhF"}

View File

@@ -0,0 +1,25 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ModuleLinkerService = void 0;
const common_1 = require("@nestjs/common");
let ModuleLinkerService = class ModuleLinkerService {
/**
* Hydrates data from multiple modules by IDs for frontend consumption.
* @param links Array of objects with moduleName and id
*/
async hydrate(links) {
// Implement hydration logic here, e.g. fetch from APIs or repositories
// ...existing code...
return [];
}
};
exports.ModuleLinkerService = ModuleLinkerService;
exports.ModuleLinkerService = ModuleLinkerService = __decorate([
(0, common_1.Injectable)()
], ModuleLinkerService);

View File

@@ -0,0 +1,13 @@
export type AdminModuleInfo = {
key: string;
name: string;
description?: string;
routePrefix?: string;
version?: string;
};
export declare class ModuleRegistryService {
private modules;
registerModule(info: AdminModuleInfo): void;
getModules(): AdminModuleInfo[];
}
//# sourceMappingURL=module-registry.service.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"module-registry.service.d.ts","sourceRoot":"","sources":["../../../src/core/services/module-registry.service.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,qBACa,qBAAqB;IAChC,OAAO,CAAC,OAAO,CAAyB;IAExC,cAAc,CAAC,IAAI,EAAE,eAAe;IAMpC,UAAU,IAAI,eAAe,EAAE;CAGhC"}

View File

@@ -0,0 +1,27 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ModuleRegistryService = void 0;
const common_1 = require("@nestjs/common");
let ModuleRegistryService = class ModuleRegistryService {
constructor() {
this.modules = [];
}
registerModule(info) {
if (!this.modules.find((m) => m.key === info.key)) {
this.modules.push(info);
}
}
getModules() {
return [...this.modules];
}
};
exports.ModuleRegistryService = ModuleRegistryService;
exports.ModuleRegistryService = ModuleRegistryService = __decorate([
(0, common_1.Injectable)()
], ModuleRegistryService);

View File

@@ -0,0 +1,10 @@
export interface NotificationProvider {
send(options: {
to: string;
subject: string;
body: string;
metadata?: any;
}): Promise<void>;
}
export type NotificationChannel = 'email' | 'whatsapp' | 'sms' | 'custom';
//# sourceMappingURL=notification-provider.interface.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"notification-provider.interface.d.ts","sourceRoot":"","sources":["../../../src/core/services/notification-provider.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,GAAG,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7F;AAED,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,UAAU,GAAG,KAAK,GAAG,QAAQ,CAAC"}

View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@@ -0,0 +1,10 @@
import { MikroORM } from '@mikro-orm/core';
import { NotificationRule } from '../entities/notification-rule.entity';
export declare class NotificationRuleService {
private readonly orm;
constructor(orm: MikroORM);
private get em();
getRulesForEvent(tenantId: string, module: string, event: string): Promise<NotificationRule[]>;
createRule(tenantId: string, rule: Partial<NotificationRule>): Promise<NotificationRule>;
}
//# sourceMappingURL=notification-rule.service.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"notification-rule.service.d.ts","sourceRoot":"","sources":["../../../src/core/services/notification-rule.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,qBACa,uBAAuB;IACtB,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,QAAQ;IAE1C,OAAO,KAAK,EAAE,GAEb;IAEK,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAI9F,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAS/F"}

View File

@@ -0,0 +1,40 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotificationRuleService = void 0;
const common_1 = require("@nestjs/common");
const core_1 = require("@mikro-orm/core");
const notification_rule_entity_1 = require("../entities/notification-rule.entity");
let NotificationRuleService = class NotificationRuleService {
constructor(orm) {
this.orm = orm;
}
get em() {
return this.orm.em.fork();
}
async getRulesForEvent(tenantId, module, event) {
return this.em.find(notification_rule_entity_1.NotificationRule, { tenantId, module, event });
}
async createRule(tenantId, rule) {
const entity = this.em.create(notification_rule_entity_1.NotificationRule, {
tenantId,
...rule,
});
this.em.persist(entity);
await this.em.flush();
return entity;
}
};
exports.NotificationRuleService = NotificationRuleService;
exports.NotificationRuleService = NotificationRuleService = __decorate([
(0, common_1.Injectable)(),
__metadata("design:paramtypes", [core_1.MikroORM])
], NotificationRuleService);

View File

@@ -0,0 +1,8 @@
import { NotificationProvider, NotificationChannel } from './notification-provider.interface';
export declare class NotificationService {
private providers;
constructor();
registerProvider(channel: NotificationChannel, provider: NotificationProvider): void;
send(channel: NotificationChannel, to: string, subject: string, body: string, metadata?: any): Promise<void>;
}
//# sourceMappingURL=notification.service.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"notification.service.d.ts","sourceRoot":"","sources":["../../../src/core/services/notification.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAI9F,qBACa,mBAAmB;IAC9B,OAAO,CAAC,SAAS,CAAgE;;IAQjF,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,oBAAoB;IAIvE,IAAI,CACR,OAAO,EAAE,mBAAmB,EAC5B,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,GAAG;CAQjB"}

View File

@@ -0,0 +1,38 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotificationService = void 0;
const common_1 = require("@nestjs/common");
const email_provider_1 = require("./providers/email.provider");
const whatsapp_provider_1 = require("./providers/whatsapp.provider");
let NotificationService = class NotificationService {
constructor() {
this.providers = {};
// Registramos proveedores por defecto (puede reemplazarse desde el código de inicialización)
this.registerProvider('email', new email_provider_1.EmailProvider());
this.registerProvider('whatsapp', new whatsapp_provider_1.WhatsappProvider());
}
registerProvider(channel, provider) {
this.providers[channel] = provider;
}
async send(channel, to, subject, body, metadata) {
const provider = this.providers[channel];
if (!provider) {
throw new Error(`No provider registered for channel ${channel}`);
}
await provider.send({ to, subject, body, metadata });
}
};
exports.NotificationService = NotificationService;
exports.NotificationService = NotificationService = __decorate([
(0, common_1.Injectable)(),
__metadata("design:paramtypes", [])
], NotificationService);

View File

@@ -0,0 +1,10 @@
import { NotificationProvider } from '../notification-provider.interface';
export declare class EmailProvider implements NotificationProvider {
send(options: {
to: string;
subject: string;
body: string;
metadata?: any;
}): Promise<void>;
}
//# sourceMappingURL=email.provider.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"email.provider.d.ts","sourceRoot":"","sources":["../../../../src/core/services/providers/email.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,qBAAa,aAAc,YAAW,oBAAoB;IAClD,IAAI,CAAC,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,GAAG,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAKlG"}

View File

@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmailProvider = void 0;
class EmailProvider {
async send(options) {
// Implementación concreta que use un servicio como Resend, Mailgun o similar.
// ...existing code...
console.log('[EmailProvider] Sending email to', options.to);
}
}
exports.EmailProvider = EmailProvider;

View File

@@ -0,0 +1,10 @@
import { NotificationProvider } from '../notification-provider.interface';
export declare class WhatsappProvider implements NotificationProvider {
send(options: {
to: string;
subject: string;
body: string;
metadata?: any;
}): Promise<void>;
}
//# sourceMappingURL=whatsapp.provider.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"whatsapp.provider.d.ts","sourceRoot":"","sources":["../../../../src/core/services/providers/whatsapp.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,qBAAa,gBAAiB,YAAW,oBAAoB;IACrD,IAAI,CAAC,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,GAAG,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAKlG"}

View File

@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WhatsappProvider = void 0;
class WhatsappProvider {
async send(options) {
// Implementación concreta que use un servicio de WhatsApp Business API o similar.
// ...existing code...
console.log('[WhatsappProvider] Sending message to', options.to);
}
}
exports.WhatsappProvider = WhatsappProvider;

7
dist/core/services/token.service.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
import { AuthToken } from '../entities/token.entity';
export declare class TokenService {
private tokens;
createToken(name?: string, expiresInHours?: number): AuthToken;
validate(tokenString: string): AuthToken | null;
}
//# sourceMappingURL=token.service.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"token.service.d.ts","sourceRoot":"","sources":["../../../src/core/services/token.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,qBACa,YAAY;IAEvB,OAAO,CAAC,MAAM,CAAmB;IAEjC,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS;IAW9D,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;CAMhD"}

40
dist/core/services/token.service.js vendored Normal file
View File

@@ -0,0 +1,40 @@
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
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;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TokenService = void 0;
const common_1 = require("@nestjs/common");
const uuid_1 = require("uuid");
const token_entity_1 = require("../entities/token.entity");
let TokenService = class TokenService {
constructor() {
// En una implementación real esto debería usar el repositorio de MikroORM.
this.tokens = [];
}
createToken(name, expiresInHours) {
const token = new token_entity_1.AuthToken();
token.token = (0, uuid_1.v4)();
token.name = name;
if (expiresInHours) {
token.expiresAt = new Date(Date.now() + expiresInHours * 60 * 60 * 1000);
}
this.tokens.push(token);
return token;
}
validate(tokenString) {
const token = this.tokens.find((t) => t.token === tokenString);
if (!token)
return null;
if (token.expiresAt && token.expiresAt < new Date())
return null;
return token;
}
};
exports.TokenService = TokenService;
exports.TokenService = TokenService = __decorate([
(0, common_1.Injectable)()
], TokenService);