Compare commits
2 Commits
989b19d338
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b60fb432ff | ||
|
|
996c6e9241 |
25
dist/admin/admin.controller.d.ts
vendored
25
dist/admin/admin.controller.d.ts
vendored
@@ -1,25 +0,0 @@
|
|||||||
import { GiftService } from '../gift/services/gift.service';
|
|
||||||
import { GuestService } from '../guest/services/guest.service';
|
|
||||||
import { TodoService } from '../todo/services/todo.service';
|
|
||||||
import { ModuleRegistryService } from '../core/services/module-registry.service';
|
|
||||||
export declare class AdminController {
|
|
||||||
private readonly moduleRegistry;
|
|
||||||
private readonly guestService;
|
|
||||||
private readonly giftService;
|
|
||||||
private readonly todoService;
|
|
||||||
constructor(moduleRegistry: ModuleRegistryService, guestService: GuestService, giftService: GiftService, todoService: TodoService);
|
|
||||||
getModules(): import("../core/services/module-registry.service").AdminModuleInfo[];
|
|
||||||
private getTenantId;
|
|
||||||
listGuests(tenantId?: string): Promise<import("../guest/entities/guest.entity").Guest[]>;
|
|
||||||
createGuest(tenantId: string, body: any): Promise<import("../guest/entities/guest.entity").Guest>;
|
|
||||||
updateGuestRsvp(tenantId: string, id: string, body: any): Promise<import("../guest/entities/guest.entity").Guest | null>;
|
|
||||||
listTodos(tenantId?: string): Promise<import("../todo/entities/todo.entity").TodoItem[]>;
|
|
||||||
createTodo(tenantId: string, body: Record<string, any>): Promise<import("../todo/entities/todo.entity").TodoItem>;
|
|
||||||
completeTodo(tenantId: string, id: string): Promise<import("../todo/entities/todo.entity").TodoItem | null>;
|
|
||||||
listGifts(tenantId?: string): Promise<import("../gift/entities/gift.entity").Gift[]>;
|
|
||||||
createGift(tenantId: string, body: any): Promise<import("../gift/entities/gift.entity").Gift>;
|
|
||||||
getGift(tenantId: string, id: string): Promise<import("../gift/entities/gift.entity").Gift | null>;
|
|
||||||
createContribution(tenantId: string, id: string, body: any): Promise<import("../gift/entities/gift.entity").GiftContribution>;
|
|
||||||
listContributions(tenantId: string, id: string): Promise<import("../gift/entities/gift.entity").GiftContribution[]>;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=admin.controller.d.ts.map
|
|
||||||
1
dist/admin/admin.controller.d.ts.map
vendored
1
dist/admin/admin.controller.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"admin.controller.d.ts","sourceRoot":"","sources":["../../src/admin/admin.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAIjF,qBACa,eAAe;IAExB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAHX,cAAc,EAAE,qBAAqB,EACrC,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW;IAI3C,UAAU;IAIV,OAAO,CAAC,WAAW;IAMnB,UAAU,CAAoB,QAAQ,CAAC,EAAE,MAAM;IAK/C,WAAW,CACU,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,GAAG;IAMnB,eAAe,CACM,QAAQ,EAAE,MAAM,EACtB,EAAE,EAAE,MAAM,EACf,IAAI,EAAE,GAAG;IAOnB,SAAS,CAAoB,QAAQ,CAAC,EAAE,MAAM;IAK9C,UAAU,CACW,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAMnC,YAAY,CACS,QAAQ,EAAE,MAAM,EACtB,EAAE,EAAE,MAAM;IAOzB,SAAS,CAAoB,QAAQ,CAAC,EAAE,MAAM;IAK9C,UAAU,CACW,QAAQ,EAAE,MAAM,EAC3B,IAAI,EAAE,GAAG;IAMnB,OAAO,CACc,QAAQ,EAAE,MAAM,EACtB,EAAE,EAAE,MAAM;IAMzB,kBAAkB,CACG,QAAQ,EAAE,MAAM,EACtB,EAAE,EAAE,MAAM,EACf,IAAI,EAAE,GAAG;IASnB,iBAAiB,CACI,QAAQ,EAAE,MAAM,EACtB,EAAE,EAAE,MAAM;CAI1B"}
|
|
||||||
175
dist/admin/admin.controller.js
vendored
175
dist/admin/admin.controller.js
vendored
@@ -1,175 +0,0 @@
|
|||||||
"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);
|
|
||||||
};
|
|
||||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
||||||
return function (target, key) { decorator(target, key, paramIndex); }
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.AdminController = void 0;
|
|
||||||
const common_1 = require("@nestjs/common");
|
|
||||||
const gift_service_1 = require("../gift/services/gift.service");
|
|
||||||
const guest_service_1 = require("../guest/services/guest.service");
|
|
||||||
const todo_service_1 = require("../todo/services/todo.service");
|
|
||||||
const module_registry_service_1 = require("../core/services/module-registry.service");
|
|
||||||
const DEFAULT_TENANT = process.env.DEFAULT_TENANT_ID ?? 'default';
|
|
||||||
let AdminController = class AdminController {
|
|
||||||
constructor(moduleRegistry, guestService, giftService, todoService) {
|
|
||||||
this.moduleRegistry = moduleRegistry;
|
|
||||||
this.guestService = guestService;
|
|
||||||
this.giftService = giftService;
|
|
||||||
this.todoService = todoService;
|
|
||||||
}
|
|
||||||
getModules() {
|
|
||||||
return this.moduleRegistry.getModules();
|
|
||||||
}
|
|
||||||
getTenantId(tenantId) {
|
|
||||||
return tenantId ?? DEFAULT_TENANT;
|
|
||||||
}
|
|
||||||
// Guests
|
|
||||||
listGuests(tenantId) {
|
|
||||||
return this.guestService.listGuests(this.getTenantId(tenantId));
|
|
||||||
}
|
|
||||||
createGuest(tenantId, body) {
|
|
||||||
return this.guestService.createGuest(this.getTenantId(tenantId), body);
|
|
||||||
}
|
|
||||||
updateGuestRsvp(tenantId, id, body) {
|
|
||||||
return this.guestService.updateRsvp(this.getTenantId(tenantId), id, body);
|
|
||||||
}
|
|
||||||
// Todos
|
|
||||||
listTodos(tenantId) {
|
|
||||||
return this.todoService.listTodos(this.getTenantId(tenantId));
|
|
||||||
}
|
|
||||||
createTodo(tenantId, body) {
|
|
||||||
return this.todoService.createTodo(this.getTenantId(tenantId), body);
|
|
||||||
}
|
|
||||||
completeTodo(tenantId, id) {
|
|
||||||
return this.todoService.markComplete(this.getTenantId(tenantId), id);
|
|
||||||
}
|
|
||||||
// Gifts
|
|
||||||
listGifts(tenantId) {
|
|
||||||
return this.giftService.listGifts(this.getTenantId(tenantId));
|
|
||||||
}
|
|
||||||
createGift(tenantId, body) {
|
|
||||||
return this.giftService.createGift(this.getTenantId(tenantId), body);
|
|
||||||
}
|
|
||||||
getGift(tenantId, id) {
|
|
||||||
return this.giftService.getGiftById(this.getTenantId(tenantId), id);
|
|
||||||
}
|
|
||||||
createContribution(tenantId, id, body) {
|
|
||||||
return this.giftService.createContribution(this.getTenantId(tenantId), {
|
|
||||||
...body,
|
|
||||||
giftId: id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
listContributions(tenantId, id) {
|
|
||||||
return this.giftService.listContributions(this.getTenantId(tenantId), id);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
exports.AdminController = AdminController;
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Get)('modules'),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", []),
|
|
||||||
__metadata("design:returntype", void 0)
|
|
||||||
], AdminController.prototype, "getModules", null);
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Get)('guest'),
|
|
||||||
__param(0, (0, common_1.Query)('tenantId')),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [String]),
|
|
||||||
__metadata("design:returntype", void 0)
|
|
||||||
], AdminController.prototype, "listGuests", null);
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Post)('guest'),
|
|
||||||
__param(0, (0, common_1.Query)('tenantId')),
|
|
||||||
__param(1, (0, common_1.Body)()),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [String, Object]),
|
|
||||||
__metadata("design:returntype", void 0)
|
|
||||||
], AdminController.prototype, "createGuest", null);
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Patch)('guest/:id/rsvp'),
|
|
||||||
__param(0, (0, common_1.Query)('tenantId')),
|
|
||||||
__param(1, (0, common_1.Param)('id')),
|
|
||||||
__param(2, (0, common_1.Body)()),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [String, String, Object]),
|
|
||||||
__metadata("design:returntype", void 0)
|
|
||||||
], AdminController.prototype, "updateGuestRsvp", null);
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Get)('todo'),
|
|
||||||
__param(0, (0, common_1.Query)('tenantId')),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [String]),
|
|
||||||
__metadata("design:returntype", void 0)
|
|
||||||
], AdminController.prototype, "listTodos", null);
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Post)('todo'),
|
|
||||||
__param(0, (0, common_1.Query)('tenantId')),
|
|
||||||
__param(1, (0, common_1.Body)()),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [String, Object]),
|
|
||||||
__metadata("design:returntype", void 0)
|
|
||||||
], AdminController.prototype, "createTodo", null);
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Patch)('todo/:id/complete'),
|
|
||||||
__param(0, (0, common_1.Query)('tenantId')),
|
|
||||||
__param(1, (0, common_1.Param)('id')),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [String, String]),
|
|
||||||
__metadata("design:returntype", void 0)
|
|
||||||
], AdminController.prototype, "completeTodo", null);
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Get)('gift'),
|
|
||||||
__param(0, (0, common_1.Query)('tenantId')),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [String]),
|
|
||||||
__metadata("design:returntype", void 0)
|
|
||||||
], AdminController.prototype, "listGifts", null);
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Post)('gift'),
|
|
||||||
__param(0, (0, common_1.Query)('tenantId')),
|
|
||||||
__param(1, (0, common_1.Body)()),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [String, Object]),
|
|
||||||
__metadata("design:returntype", void 0)
|
|
||||||
], AdminController.prototype, "createGift", null);
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Get)('gift/:id'),
|
|
||||||
__param(0, (0, common_1.Query)('tenantId')),
|
|
||||||
__param(1, (0, common_1.Param)('id')),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [String, String]),
|
|
||||||
__metadata("design:returntype", void 0)
|
|
||||||
], AdminController.prototype, "getGift", null);
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Post)('gift/:id/contribution'),
|
|
||||||
__param(0, (0, common_1.Query)('tenantId')),
|
|
||||||
__param(1, (0, common_1.Param)('id')),
|
|
||||||
__param(2, (0, common_1.Body)()),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [String, String, Object]),
|
|
||||||
__metadata("design:returntype", void 0)
|
|
||||||
], AdminController.prototype, "createContribution", null);
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Get)('gift/:id/contributions'),
|
|
||||||
__param(0, (0, common_1.Query)('tenantId')),
|
|
||||||
__param(1, (0, common_1.Param)('id')),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [String, String]),
|
|
||||||
__metadata("design:returntype", void 0)
|
|
||||||
], AdminController.prototype, "listContributions", null);
|
|
||||||
exports.AdminController = AdminController = __decorate([
|
|
||||||
(0, common_1.Controller)('admin'),
|
|
||||||
__metadata("design:paramtypes", [module_registry_service_1.ModuleRegistryService,
|
|
||||||
guest_service_1.GuestService,
|
|
||||||
gift_service_1.GiftService,
|
|
||||||
todo_service_1.TodoService])
|
|
||||||
], AdminController);
|
|
||||||
3
dist/admin/admin.module.d.ts
vendored
3
dist/admin/admin.module.d.ts
vendored
@@ -1,3 +0,0 @@
|
|||||||
export declare class AdminModule {
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=admin.module.d.ts.map
|
|
||||||
1
dist/admin/admin.module.d.ts.map
vendored
1
dist/admin/admin.module.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"admin.module.d.ts","sourceRoot":"","sources":["../../src/admin/admin.module.ts"],"names":[],"mappings":"AAOA,qBAIa,WAAW;CAAG"}
|
|
||||||
24
dist/admin/admin.module.js
vendored
24
dist/admin/admin.module.js
vendored
@@ -1,24 +0,0 @@
|
|||||||
"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.AdminModule = void 0;
|
|
||||||
const common_1 = require("@nestjs/common");
|
|
||||||
const core_module_1 = require("../core/core.module");
|
|
||||||
const gift_module_1 = require("../gift/gift.module");
|
|
||||||
const guest_module_1 = require("../guest/guest.module");
|
|
||||||
const todo_module_1 = require("../todo/todo.module");
|
|
||||||
const admin_controller_1 = require("./admin.controller");
|
|
||||||
let AdminModule = class AdminModule {
|
|
||||||
};
|
|
||||||
exports.AdminModule = AdminModule;
|
|
||||||
exports.AdminModule = AdminModule = __decorate([
|
|
||||||
(0, common_1.Module)({
|
|
||||||
imports: [core_module_1.CoreModule, gift_module_1.GiftModule, guest_module_1.GuestModule, todo_module_1.TodoModule],
|
|
||||||
controllers: [admin_controller_1.AdminController],
|
|
||||||
})
|
|
||||||
], AdminModule);
|
|
||||||
3
dist/app.module.d.ts
vendored
3
dist/app.module.d.ts
vendored
@@ -1,3 +0,0 @@
|
|||||||
export declare class AppModule {
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=app.module.d.ts.map
|
|
||||||
1
dist/app.module.d.ts.map
vendored
1
dist/app.module.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"app.module.d.ts","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":"AASA,qBAiBa,SAAS;CAAG"}
|
|
||||||
39
dist/app.module.js
vendored
39
dist/app.module.js
vendored
@@ -1,39 +0,0 @@
|
|||||||
"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.AppModule = void 0;
|
|
||||||
const common_1 = require("@nestjs/common");
|
|
||||||
const serve_static_1 = require("@nestjs/serve-static");
|
|
||||||
const path_1 = require("path");
|
|
||||||
const core_module_1 = require("./core/core.module");
|
|
||||||
const gift_module_1 = require("./gift/gift.module");
|
|
||||||
const guest_module_1 = require("./guest/guest.module");
|
|
||||||
const todo_module_1 = require("./todo/todo.module");
|
|
||||||
const admin_module_1 = require("./admin/admin.module");
|
|
||||||
let AppModule = class AppModule {
|
|
||||||
};
|
|
||||||
exports.AppModule = AppModule;
|
|
||||||
exports.AppModule = AppModule = __decorate([
|
|
||||||
(0, common_1.Module)({
|
|
||||||
imports: [
|
|
||||||
serve_static_1.ServeStaticModule.forRoot({
|
|
||||||
rootPath: (0, path_1.join)(__dirname, '..', 'public'),
|
|
||||||
serveRoot: '/admin',
|
|
||||||
exclude: ['/admin/modules'],
|
|
||||||
serveStaticOptions: {
|
|
||||||
index: 'admin.html',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
core_module_1.CoreModule,
|
|
||||||
gift_module_1.GiftModule,
|
|
||||||
guest_module_1.GuestModule,
|
|
||||||
todo_module_1.TodoModule,
|
|
||||||
admin_module_1.AdminModule,
|
|
||||||
],
|
|
||||||
})
|
|
||||||
], AppModule);
|
|
||||||
10
dist/core/api/auth.controller.d.ts
vendored
10
dist/core/api/auth.controller.d.ts
vendored
@@ -1,10 +0,0 @@
|
|||||||
import { TokenService } from '../services/token.service';
|
|
||||||
export declare class AuthController {
|
|
||||||
private readonly tokenService;
|
|
||||||
constructor(tokenService: TokenService);
|
|
||||||
createToken(body: {
|
|
||||||
name?: string;
|
|
||||||
expiresInHours?: number;
|
|
||||||
}): import("../entities/token.entity").AuthToken;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=auth.controller.d.ts.map
|
|
||||||
1
dist/core/api/auth.controller.d.ts.map
vendored
1
dist/core/api/auth.controller.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"auth.controller.d.ts","sourceRoot":"","sources":["../../../src/core/api/auth.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,qBACa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAZ,YAAY,EAAE,YAAY;IAGvD,WAAW,CAAS,IAAI,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE;CAGrE"}
|
|
||||||
37
dist/core/api/auth.controller.js
vendored
37
dist/core/api/auth.controller.js
vendored
@@ -1,37 +0,0 @@
|
|||||||
"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);
|
|
||||||
};
|
|
||||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
||||||
return function (target, key) { decorator(target, key, paramIndex); }
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.AuthController = void 0;
|
|
||||||
const common_1 = require("@nestjs/common");
|
|
||||||
const token_service_1 = require("../services/token.service");
|
|
||||||
let AuthController = class AuthController {
|
|
||||||
constructor(tokenService) {
|
|
||||||
this.tokenService = tokenService;
|
|
||||||
}
|
|
||||||
createToken(body) {
|
|
||||||
return this.tokenService.createToken(body.name, body.expiresInHours);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
exports.AuthController = AuthController;
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Post)('token'),
|
|
||||||
__param(0, (0, common_1.Body)()),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [Object]),
|
|
||||||
__metadata("design:returntype", void 0)
|
|
||||||
], AuthController.prototype, "createToken", null);
|
|
||||||
exports.AuthController = AuthController = __decorate([
|
|
||||||
(0, common_1.Controller)('auth'),
|
|
||||||
__metadata("design:paramtypes", [token_service_1.TokenService])
|
|
||||||
], AuthController);
|
|
||||||
8
dist/core/auth.guard.d.ts
vendored
8
dist/core/auth.guard.d.ts
vendored
@@ -1,8 +0,0 @@
|
|||||||
import { CanActivate, ExecutionContext } from '@nestjs/common';
|
|
||||||
import { AuthService } from './services/auth.service';
|
|
||||||
export declare class AuthGuard implements CanActivate {
|
|
||||||
private readonly authService;
|
|
||||||
constructor(authService: AuthService);
|
|
||||||
canActivate(context: ExecutionContext): boolean;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=auth.guard.d.ts.map
|
|
||||||
1
dist/core/auth.guard.d.ts.map
vendored
1
dist/core/auth.guard.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"auth.guard.d.ts","sourceRoot":"","sources":["../../src/core/auth.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAqC,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,qBACa,SAAU,YAAW,WAAW;IAC/B,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAErD,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;CAuBhD"}
|
|
||||||
43
dist/core/auth.guard.js
vendored
43
dist/core/auth.guard.js
vendored
@@ -1,43 +0,0 @@
|
|||||||
"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.AuthGuard = void 0;
|
|
||||||
const common_1 = require("@nestjs/common");
|
|
||||||
const auth_service_1 = require("./services/auth.service");
|
|
||||||
let AuthGuard = class AuthGuard {
|
|
||||||
constructor(authService) {
|
|
||||||
this.authService = authService;
|
|
||||||
}
|
|
||||||
canActivate(context) {
|
|
||||||
const request = context.switchToHttp().getRequest();
|
|
||||||
// Allow the admin UI endpoints to be accessed without authentication.
|
|
||||||
// The UI is served from /admin and calls /api/admin/modules.
|
|
||||||
if (request.method === 'GET' && request.url?.startsWith('/api/admin')) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
const authHeader = request.headers['authorization'] || '';
|
|
||||||
const token = Array.isArray(authHeader) ? authHeader[0] : authHeader;
|
|
||||||
if (!token) {
|
|
||||||
throw new common_1.UnauthorizedException();
|
|
||||||
}
|
|
||||||
const payload = this.authService.verify(token.replace(/^Bearer\s+/i, ''));
|
|
||||||
if (!payload) {
|
|
||||||
throw new common_1.UnauthorizedException();
|
|
||||||
}
|
|
||||||
request.user = payload;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
exports.AuthGuard = AuthGuard;
|
|
||||||
exports.AuthGuard = AuthGuard = __decorate([
|
|
||||||
(0, common_1.Injectable)(),
|
|
||||||
__metadata("design:paramtypes", [auth_service_1.AuthService])
|
|
||||||
], AuthGuard);
|
|
||||||
3
dist/core/auth.module.d.ts
vendored
3
dist/core/auth.module.d.ts
vendored
@@ -1,3 +0,0 @@
|
|||||||
export declare class AuthModule {
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=auth.module.d.ts.map
|
|
||||||
1
dist/core/auth.module.d.ts.map
vendored
1
dist/core/auth.module.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../../src/core/auth.module.ts"],"names":[],"mappings":"AAKA,qBAIa,UAAU;CAAG"}
|
|
||||||
22
dist/core/auth.module.js
vendored
22
dist/core/auth.module.js
vendored
@@ -1,22 +0,0 @@
|
|||||||
"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.AuthModule = void 0;
|
|
||||||
const common_1 = require("@nestjs/common");
|
|
||||||
const auth_service_1 = require("./services/auth.service");
|
|
||||||
const token_service_1 = require("./services/token.service");
|
|
||||||
const auth_guard_1 = require("./auth.guard");
|
|
||||||
let AuthModule = class AuthModule {
|
|
||||||
};
|
|
||||||
exports.AuthModule = AuthModule;
|
|
||||||
exports.AuthModule = AuthModule = __decorate([
|
|
||||||
(0, common_1.Module)({
|
|
||||||
providers: [auth_service_1.AuthService, token_service_1.TokenService, auth_guard_1.AuthGuard],
|
|
||||||
exports: [auth_service_1.AuthService, token_service_1.TokenService, auth_guard_1.AuthGuard],
|
|
||||||
})
|
|
||||||
], AuthModule);
|
|
||||||
3
dist/core/core.module.d.ts
vendored
3
dist/core/core.module.d.ts
vendored
@@ -1,3 +0,0 @@
|
|||||||
export declare class CoreModule {
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=core.module.d.ts.map
|
|
||||||
1
dist/core/core.module.d.ts.map
vendored
1
dist/core/core.module.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"core.module.d.ts","sourceRoot":"","sources":["../../src/core/core.module.ts"],"names":[],"mappings":"AAWA,qBAoCa,UAAU;CAAG"}
|
|
||||||
60
dist/core/core.module.js
vendored
60
dist/core/core.module.js
vendored
@@ -1,60 +0,0 @@
|
|||||||
"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.CoreModule = void 0;
|
|
||||||
const common_1 = require("@nestjs/common");
|
|
||||||
const event_emitter_1 = require("@nestjs/event-emitter");
|
|
||||||
const nestjs_1 = require("@mikro-orm/nestjs");
|
|
||||||
const auth_module_1 = require("./auth.module");
|
|
||||||
const module_linker_service_1 = require("./services/module-linker.service");
|
|
||||||
const notification_service_1 = require("./services/notification.service");
|
|
||||||
const notification_rule_service_1 = require("./services/notification-rule.service");
|
|
||||||
const module_registry_service_1 = require("./services/module-registry.service");
|
|
||||||
const auth_controller_1 = require("./api/auth.controller");
|
|
||||||
const notification_rule_entity_1 = require("./entities/notification-rule.entity");
|
|
||||||
let CoreModule = class CoreModule {
|
|
||||||
};
|
|
||||||
exports.CoreModule = CoreModule;
|
|
||||||
exports.CoreModule = CoreModule = __decorate([
|
|
||||||
(0, common_1.Module)({
|
|
||||||
imports: [
|
|
||||||
event_emitter_1.EventEmitterModule.forRoot(),
|
|
||||||
nestjs_1.MikroOrmModule.forRoot({
|
|
||||||
driver: (require('@mikro-orm/postgresql').PostgreSqlDriver),
|
|
||||||
host: process.env.DB_HOST || 'localhost',
|
|
||||||
port: Number(process.env.DB_PORT) || 5432,
|
|
||||||
user: process.env.DB_USER || 'postgres',
|
|
||||||
password: process.env.DB_PASSWORD || 'postgres',
|
|
||||||
dbName: process.env.DB_NAME || 'planner',
|
|
||||||
autoLoadEntities: true,
|
|
||||||
migrations: {
|
|
||||||
path: 'dist/migrations',
|
|
||||||
transactional: true,
|
|
||||||
emit: 'js',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
auth_module_1.AuthModule,
|
|
||||||
nestjs_1.MikroOrmModule.forFeature([notification_rule_entity_1.NotificationRuleSchema]),
|
|
||||||
],
|
|
||||||
providers: [
|
|
||||||
module_linker_service_1.ModuleLinkerService,
|
|
||||||
notification_service_1.NotificationService,
|
|
||||||
notification_rule_service_1.NotificationRuleService,
|
|
||||||
module_registry_service_1.ModuleRegistryService,
|
|
||||||
],
|
|
||||||
controllers: [auth_controller_1.AuthController],
|
|
||||||
exports: [
|
|
||||||
event_emitter_1.EventEmitterModule,
|
|
||||||
auth_module_1.AuthModule,
|
|
||||||
module_linker_service_1.ModuleLinkerService,
|
|
||||||
notification_service_1.NotificationService,
|
|
||||||
notification_rule_service_1.NotificationRuleService,
|
|
||||||
module_registry_service_1.ModuleRegistryService,
|
|
||||||
],
|
|
||||||
})
|
|
||||||
], CoreModule);
|
|
||||||
3
dist/core/database.module.d.ts
vendored
3
dist/core/database.module.d.ts
vendored
@@ -1,3 +0,0 @@
|
|||||||
export declare class DatabaseModule {
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=database.module.d.ts.map
|
|
||||||
1
dist/core/database.module.d.ts.map
vendored
1
dist/core/database.module.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"database.module.d.ts","sourceRoot":"","sources":["../../src/core/database.module.ts"],"names":[],"mappings":"AAIA,qBAqBa,cAAc;CAAG"}
|
|
||||||
38
dist/core/database.module.js
vendored
38
dist/core/database.module.js
vendored
@@ -1,38 +0,0 @@
|
|||||||
"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.DatabaseModule = void 0;
|
|
||||||
const common_1 = require("@nestjs/common");
|
|
||||||
const nestjs_1 = require("@mikro-orm/nestjs");
|
|
||||||
const postgresql_1 = require("@mikro-orm/postgresql");
|
|
||||||
let DatabaseModule = class DatabaseModule {
|
|
||||||
};
|
|
||||||
exports.DatabaseModule = DatabaseModule;
|
|
||||||
exports.DatabaseModule = DatabaseModule = __decorate([
|
|
||||||
(0, common_1.Module)({
|
|
||||||
imports: [
|
|
||||||
nestjs_1.MikroOrmModule.forRoot({
|
|
||||||
driver: postgresql_1.PostgreSqlDriver,
|
|
||||||
host: process.env.DB_HOST || 'localhost',
|
|
||||||
port: Number(process.env.DB_PORT) || 5432,
|
|
||||||
user: process.env.DB_USER || 'postgres',
|
|
||||||
password: process.env.DB_PASSWORD || 'postgres',
|
|
||||||
dbName: process.env.DB_NAME || 'planner',
|
|
||||||
autoLoadEntities: true,
|
|
||||||
entities: ['./dist/**/*.entity.js'],
|
|
||||||
entitiesTs: ['./src/**/*.entity.ts'],
|
|
||||||
migrations: {
|
|
||||||
path: 'dist/migrations',
|
|
||||||
transactional: true,
|
|
||||||
emit: 'js',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
exports: [nestjs_1.MikroOrmModule],
|
|
||||||
})
|
|
||||||
], DatabaseModule);
|
|
||||||
8
dist/core/entities/base.entity.d.ts
vendored
8
dist/core/entities/base.entity.d.ts
vendored
@@ -1,8 +0,0 @@
|
|||||||
export declare abstract class BaseEntity {
|
|
||||||
id: string;
|
|
||||||
tenantId: string;
|
|
||||||
metadata?: Record<string, any>;
|
|
||||||
createdAt: Date;
|
|
||||||
updatedAt: Date;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=base.entity.d.ts.map
|
|
||||||
1
dist/core/entities/base.entity.d.ts.map
vendored
1
dist/core/entities/base.entity.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"base.entity.d.ts","sourceRoot":"","sources":["../../../src/core/entities/base.entity.ts"],"names":[],"mappings":"AAEA,8BAAsB,UAAU;IAC9B,EAAE,EAAE,MAAM,CAAY;IACtB,QAAQ,EAAG,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,SAAS,EAAE,IAAI,CAAc;IAC7B,SAAS,EAAE,IAAI,CAAc;CAC9B"}
|
|
||||||
12
dist/core/entities/base.entity.js
vendored
12
dist/core/entities/base.entity.js
vendored
@@ -1,12 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.BaseEntity = void 0;
|
|
||||||
const uuid_1 = require("uuid");
|
|
||||||
class BaseEntity {
|
|
||||||
constructor() {
|
|
||||||
this.id = (0, uuid_1.v4)();
|
|
||||||
this.createdAt = new Date();
|
|
||||||
this.updatedAt = new Date();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.BaseEntity = BaseEntity;
|
|
||||||
10
dist/core/entities/notification-rule.entity.d.ts
vendored
10
dist/core/entities/notification-rule.entity.d.ts
vendored
@@ -1,10 +0,0 @@
|
|||||||
import { EntitySchema } from '@mikro-orm/core';
|
|
||||||
import { BaseEntity } from './base.entity';
|
|
||||||
export declare class NotificationRule extends BaseEntity {
|
|
||||||
module: string;
|
|
||||||
event: string;
|
|
||||||
channels: Array<'email' | 'whatsapp' | 'sms' | 'custom'>;
|
|
||||||
conditions?: Record<string, any>;
|
|
||||||
}
|
|
||||||
export declare const NotificationRuleSchema: EntitySchema<NotificationRule, never, import("@mikro-orm/core").EntityCtor<NotificationRule>>;
|
|
||||||
//# sourceMappingURL=notification-rule.entity.d.ts.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"notification-rule.entity.d.ts","sourceRoot":"","sources":["../../../src/core/entities/notification-rule.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,qBAAa,gBAAiB,SAAQ,UAAU;IAC9C,MAAM,EAAG,MAAM,CAAC;IAEhB,KAAK,EAAG,MAAM,CAAC;IAEf,QAAQ,EAAG,KAAK,CAAC,OAAO,GAAG,UAAU,GAAG,KAAK,GAAG,QAAQ,CAAC,CAAC;IAE1D,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAED,eAAO,MAAM,sBAAsB,+FAejC,CAAC"}
|
|
||||||
23
dist/core/entities/notification-rule.entity.js
vendored
23
dist/core/entities/notification-rule.entity.js
vendored
@@ -1,23 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.NotificationRuleSchema = exports.NotificationRule = void 0;
|
|
||||||
const core_1 = require("@mikro-orm/core");
|
|
||||||
const base_entity_1 = require("./base.entity");
|
|
||||||
class NotificationRule extends base_entity_1.BaseEntity {
|
|
||||||
}
|
|
||||||
exports.NotificationRule = NotificationRule;
|
|
||||||
exports.NotificationRuleSchema = new core_1.EntitySchema({
|
|
||||||
class: NotificationRule,
|
|
||||||
tableName: 'notification_rules',
|
|
||||||
properties: {
|
|
||||||
id: { primary: true, type: 'uuid', defaultRaw: 'uuid_generate_v4()' },
|
|
||||||
tenantId: { type: 'string' },
|
|
||||||
metadata: { type: 'json', nullable: true },
|
|
||||||
createdAt: { type: 'date', defaultRaw: 'now()' },
|
|
||||||
updatedAt: { type: 'date', defaultRaw: 'now()' },
|
|
||||||
module: { type: 'string' },
|
|
||||||
event: { type: 'string' },
|
|
||||||
channels: { type: 'json' },
|
|
||||||
conditions: { type: 'json', nullable: true },
|
|
||||||
},
|
|
||||||
});
|
|
||||||
13
dist/core/entities/token.entity.d.ts
vendored
13
dist/core/entities/token.entity.d.ts
vendored
@@ -1,13 +0,0 @@
|
|||||||
import { EntitySchema } from '@mikro-orm/core';
|
|
||||||
export declare class AuthToken {
|
|
||||||
id: string;
|
|
||||||
tenantId: string;
|
|
||||||
token: string;
|
|
||||||
name?: string;
|
|
||||||
expiresAt?: Date;
|
|
||||||
metadata?: Record<string, any>;
|
|
||||||
createdAt: Date;
|
|
||||||
updatedAt: Date;
|
|
||||||
}
|
|
||||||
export declare const AuthTokenSchema: EntitySchema<AuthToken, never, import("@mikro-orm/core").EntityCtor<AuthToken>>;
|
|
||||||
//# sourceMappingURL=token.entity.d.ts.map
|
|
||||||
1
dist/core/entities/token.entity.d.ts.map
vendored
1
dist/core/entities/token.entity.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"token.entity.d.ts","sourceRoot":"","sources":["../../../src/core/entities/token.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,qBAAa,SAAS;IACpB,EAAE,EAAG,MAAM,CAAC;IACZ,QAAQ,EAAG,MAAM,CAAC;IAClB,KAAK,EAAG,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,SAAS,EAAG,IAAI,CAAC;IACjB,SAAS,EAAG,IAAI,CAAC;CAClB;AAED,eAAO,MAAM,eAAe,iFAwC1B,CAAC"}
|
|
||||||
48
dist/core/entities/token.entity.js
vendored
48
dist/core/entities/token.entity.js
vendored
@@ -1,48 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.AuthTokenSchema = exports.AuthToken = void 0;
|
|
||||||
const core_1 = require("@mikro-orm/core");
|
|
||||||
class AuthToken {
|
|
||||||
}
|
|
||||||
exports.AuthToken = AuthToken;
|
|
||||||
exports.AuthTokenSchema = new core_1.EntitySchema({
|
|
||||||
class: AuthToken,
|
|
||||||
tableName: 'auth_tokens',
|
|
||||||
properties: {
|
|
||||||
id: {
|
|
||||||
primary: true,
|
|
||||||
type: 'uuid',
|
|
||||||
default: 'uuid_generate_v4()',
|
|
||||||
},
|
|
||||||
tenantId: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: false,
|
|
||||||
},
|
|
||||||
token: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: false,
|
|
||||||
},
|
|
||||||
name: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: true,
|
|
||||||
},
|
|
||||||
expiresAt: {
|
|
||||||
type: 'date',
|
|
||||||
nullable: true,
|
|
||||||
},
|
|
||||||
metadata: {
|
|
||||||
type: 'json',
|
|
||||||
nullable: true,
|
|
||||||
},
|
|
||||||
createdAt: {
|
|
||||||
type: 'date',
|
|
||||||
nullable: false,
|
|
||||||
defaultRaw: 'now()',
|
|
||||||
},
|
|
||||||
updatedAt: {
|
|
||||||
type: 'date',
|
|
||||||
nullable: false,
|
|
||||||
defaultRaw: 'now()',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
6
dist/core/services/auth.service.d.ts
vendored
6
dist/core/services/auth.service.d.ts
vendored
@@ -1,6 +0,0 @@
|
|||||||
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
|
|
||||||
1
dist/core/services/auth.service.d.ts.map
vendored
1
dist/core/services/auth.service.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"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
65
dist/core/services/auth.service.js
vendored
@@ -1,65 +0,0 @@
|
|||||||
"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);
|
|
||||||
11
dist/core/services/module-linker.service.d.ts
vendored
11
dist/core/services/module-linker.service.d.ts
vendored
@@ -1,11 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"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"}
|
|
||||||
25
dist/core/services/module-linker.service.js
vendored
25
dist/core/services/module-linker.service.js
vendored
@@ -1,25 +0,0 @@
|
|||||||
"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);
|
|
||||||
13
dist/core/services/module-registry.service.d.ts
vendored
13
dist/core/services/module-registry.service.d.ts
vendored
@@ -1,13 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"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"}
|
|
||||||
27
dist/core/services/module-registry.service.js
vendored
27
dist/core/services/module-registry.service.js
vendored
@@ -1,27 +0,0 @@
|
|||||||
"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);
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"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"}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"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"}
|
|
||||||
40
dist/core/services/notification-rule.service.js
vendored
40
dist/core/services/notification-rule.service.js
vendored
@@ -1,40 +0,0 @@
|
|||||||
"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);
|
|
||||||
8
dist/core/services/notification.service.d.ts
vendored
8
dist/core/services/notification.service.d.ts
vendored
@@ -1,8 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"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"}
|
|
||||||
38
dist/core/services/notification.service.js
vendored
38
dist/core/services/notification.service.js
vendored
@@ -1,38 +0,0 @@
|
|||||||
"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);
|
|
||||||
10
dist/core/services/providers/email.provider.d.ts
vendored
10
dist/core/services/providers/email.provider.d.ts
vendored
@@ -1,10 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"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"}
|
|
||||||
11
dist/core/services/providers/email.provider.js
vendored
11
dist/core/services/providers/email.provider.js
vendored
@@ -1,11 +0,0 @@
|
|||||||
"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;
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"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"}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
"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
7
dist/core/services/token.service.d.ts
vendored
@@ -1,7 +0,0 @@
|
|||||||
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
|
|
||||||
1
dist/core/services/token.service.d.ts.map
vendored
1
dist/core/services/token.service.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"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
40
dist/core/services/token.service.js
vendored
@@ -1,40 +0,0 @@
|
|||||||
"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);
|
|
||||||
7
dist/core/workflows/base-workflow.d.ts
vendored
7
dist/core/workflows/base-workflow.d.ts
vendored
@@ -1,7 +0,0 @@
|
|||||||
import { Logger } from '@nestjs/common';
|
|
||||||
export declare abstract class BaseWorkflow {
|
|
||||||
protected readonly logger: Logger;
|
|
||||||
abstract execute(...args: any[]): Promise<any>;
|
|
||||||
protected logExecution(message: string, context?: any): void;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=base-workflow.d.ts.map
|
|
||||||
1
dist/core/workflows/base-workflow.d.ts.map
vendored
1
dist/core/workflows/base-workflow.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"base-workflow.d.ts","sourceRoot":"","sources":["../../../src/core/workflows/base-workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,8BAAsB,YAAY;IAChC,SAAS,CAAC,QAAQ,CAAC,MAAM,SAAqC;IAE9D,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAE9C,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;CAMtD"}
|
|
||||||
16
dist/core/workflows/base-workflow.js
vendored
16
dist/core/workflows/base-workflow.js
vendored
@@ -1,16 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.BaseWorkflow = void 0;
|
|
||||||
const common_1 = require("@nestjs/common");
|
|
||||||
class BaseWorkflow {
|
|
||||||
constructor() {
|
|
||||||
this.logger = new common_1.Logger(this.constructor.name);
|
|
||||||
}
|
|
||||||
logExecution(message, context) {
|
|
||||||
this.logger.log(`[WORKFLOW] ${message}`);
|
|
||||||
if (context) {
|
|
||||||
this.logger.debug(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.BaseWorkflow = BaseWorkflow;
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
export declare class CreateContributionDto {
|
|
||||||
giftId: string;
|
|
||||||
contributorName: string;
|
|
||||||
contributorEmail?: string;
|
|
||||||
amount: number;
|
|
||||||
type?: 'individual' | 'group';
|
|
||||||
metadata?: Record<string, any>;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=create-contribution.dto.d.ts.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"create-contribution.dto.d.ts","sourceRoot":"","sources":["../../../../src/gift/api/dto/create-contribution.dto.ts"],"names":[],"mappings":"AAAA,qBAAa,qBAAqB;IAChC,MAAM,EAAG,MAAM,CAAC;IAChB,eAAe,EAAG,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAG,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC"}
|
|
||||||
6
dist/gift/api/dto/create-contribution.dto.js
vendored
6
dist/gift/api/dto/create-contribution.dto.js
vendored
@@ -1,6 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.CreateContributionDto = void 0;
|
|
||||||
class CreateContributionDto {
|
|
||||||
}
|
|
||||||
exports.CreateContributionDto = CreateContributionDto;
|
|
||||||
10
dist/gift/api/dto/create-gift.dto.d.ts
vendored
10
dist/gift/api/dto/create-gift.dto.d.ts
vendored
@@ -1,10 +0,0 @@
|
|||||||
export declare class CreateGiftDto {
|
|
||||||
name: string;
|
|
||||||
description?: string;
|
|
||||||
imageUrl?: string;
|
|
||||||
price?: number;
|
|
||||||
experience?: boolean;
|
|
||||||
ownerId?: string;
|
|
||||||
metadata?: Record<string, any>;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=create-gift.dto.d.ts.map
|
|
||||||
1
dist/gift/api/dto/create-gift.dto.d.ts.map
vendored
1
dist/gift/api/dto/create-gift.dto.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"create-gift.dto.d.ts","sourceRoot":"","sources":["../../../../src/gift/api/dto/create-gift.dto.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAa;IACxB,IAAI,EAAG,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC"}
|
|
||||||
6
dist/gift/api/dto/create-gift.dto.js
vendored
6
dist/gift/api/dto/create-gift.dto.js
vendored
@@ -1,6 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.CreateGiftDto = void 0;
|
|
||||||
class CreateGiftDto {
|
|
||||||
}
|
|
||||||
exports.CreateGiftDto = CreateGiftDto;
|
|
||||||
14
dist/gift/api/gift.controller.d.ts
vendored
14
dist/gift/api/gift.controller.d.ts
vendored
@@ -1,14 +0,0 @@
|
|||||||
import { Request } from 'express';
|
|
||||||
import { GiftService } from '../services/gift.service';
|
|
||||||
import { CreateGiftDto } from './dto/create-gift.dto';
|
|
||||||
import { CreateContributionDto } from './dto/create-contribution.dto';
|
|
||||||
export declare class GiftController {
|
|
||||||
private readonly giftService;
|
|
||||||
constructor(giftService: GiftService);
|
|
||||||
createGift(req: Request, tenantId: string, dto: CreateGiftDto): Promise<import("../entities/gift.entity").Gift>;
|
|
||||||
listGifts(tenantId: string): Promise<import("../entities/gift.entity").Gift[]>;
|
|
||||||
contribute(tenantId: string, dto: CreateContributionDto): Promise<import("../entities/gift.entity").GiftContribution>;
|
|
||||||
getGift(req: Request, tenantId: string, id: string): Promise<import("../entities/gift.entity").Gift | null>;
|
|
||||||
listContributions(req: Request, tenantId: string, id: string): Promise<import("../entities/gift.entity").GiftContribution[]>;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=gift.controller.d.ts.map
|
|
||||||
1
dist/gift/api/gift.controller.d.ts.map
vendored
1
dist/gift/api/gift.controller.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"gift.controller.d.ts","sourceRoot":"","sources":["../../../src/gift/api/gift.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,qBACa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,WAAW;IAG/C,UAAU,CACP,GAAG,EAAE,OAAO,EACK,QAAQ,EAAE,MAAM,EAChC,GAAG,EAAE,aAAa;IAOtB,SAAS,CAAyB,QAAQ,EAAE,MAAM;IAKlD,UAAU,CACU,QAAQ,EAAE,MAAM,EAChC,GAAG,EAAE,qBAAqB;IAM9B,OAAO,CACJ,GAAG,EAAE,OAAO,EACK,QAAQ,EAAE,MAAM,EAC3B,EAAE,EAAE,MAAM;IAOnB,iBAAiB,CACd,GAAG,EAAE,OAAO,EACK,QAAQ,EAAE,MAAM,EAC3B,EAAE,EAAE,MAAM;CAK1B"}
|
|
||||||
89
dist/gift/api/gift.controller.js
vendored
89
dist/gift/api/gift.controller.js
vendored
@@ -1,89 +0,0 @@
|
|||||||
"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);
|
|
||||||
};
|
|
||||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
||||||
return function (target, key) { decorator(target, key, paramIndex); }
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.GiftController = void 0;
|
|
||||||
const common_1 = require("@nestjs/common");
|
|
||||||
const gift_service_1 = require("../services/gift.service");
|
|
||||||
const create_gift_dto_1 = require("./dto/create-gift.dto");
|
|
||||||
const create_contribution_dto_1 = require("./dto/create-contribution.dto");
|
|
||||||
let GiftController = class GiftController {
|
|
||||||
constructor(giftService) {
|
|
||||||
this.giftService = giftService;
|
|
||||||
}
|
|
||||||
async createGift(req, tenantId, dto) {
|
|
||||||
const ownerId = req.user?.id;
|
|
||||||
return this.giftService.createGift(tenantId, { ...dto, ownerId });
|
|
||||||
}
|
|
||||||
async listGifts(tenantId) {
|
|
||||||
return this.giftService.listGifts(tenantId);
|
|
||||||
}
|
|
||||||
async contribute(tenantId, dto) {
|
|
||||||
return this.giftService.createContribution(tenantId, dto);
|
|
||||||
}
|
|
||||||
async getGift(req, tenantId, id) {
|
|
||||||
const requesterId = req.user?.id;
|
|
||||||
return this.giftService.getGiftById(tenantId, id, requesterId);
|
|
||||||
}
|
|
||||||
async listContributions(req, tenantId, id) {
|
|
||||||
const requesterId = req.user?.id;
|
|
||||||
return this.giftService.listContributions(tenantId, id, requesterId);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
exports.GiftController = GiftController;
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Post)(),
|
|
||||||
__param(0, (0, common_1.Req)()),
|
|
||||||
__param(1, (0, common_1.Headers)('x-tenant-id')),
|
|
||||||
__param(2, (0, common_1.Body)()),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [Object, String, create_gift_dto_1.CreateGiftDto]),
|
|
||||||
__metadata("design:returntype", Promise)
|
|
||||||
], GiftController.prototype, "createGift", null);
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Get)(),
|
|
||||||
__param(0, (0, common_1.Headers)('x-tenant-id')),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [String]),
|
|
||||||
__metadata("design:returntype", Promise)
|
|
||||||
], GiftController.prototype, "listGifts", null);
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Post)('contribution'),
|
|
||||||
__param(0, (0, common_1.Headers)('x-tenant-id')),
|
|
||||||
__param(1, (0, common_1.Body)()),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [String, create_contribution_dto_1.CreateContributionDto]),
|
|
||||||
__metadata("design:returntype", Promise)
|
|
||||||
], GiftController.prototype, "contribute", null);
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Get)(':id'),
|
|
||||||
__param(0, (0, common_1.Req)()),
|
|
||||||
__param(1, (0, common_1.Headers)('x-tenant-id')),
|
|
||||||
__param(2, (0, common_1.Param)('id')),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [Object, String, String]),
|
|
||||||
__metadata("design:returntype", Promise)
|
|
||||||
], GiftController.prototype, "getGift", null);
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Get)(':id/contributions'),
|
|
||||||
__param(0, (0, common_1.Req)()),
|
|
||||||
__param(1, (0, common_1.Headers)('x-tenant-id')),
|
|
||||||
__param(2, (0, common_1.Param)('id')),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [Object, String, String]),
|
|
||||||
__metadata("design:returntype", Promise)
|
|
||||||
], GiftController.prototype, "listContributions", null);
|
|
||||||
exports.GiftController = GiftController = __decorate([
|
|
||||||
(0, common_1.Controller)('gift'),
|
|
||||||
__metadata("design:paramtypes", [gift_service_1.GiftService])
|
|
||||||
], GiftController);
|
|
||||||
22
dist/gift/entities/gift.entity.d.ts
vendored
22
dist/gift/entities/gift.entity.d.ts
vendored
@@ -1,22 +0,0 @@
|
|||||||
import { EntitySchema } from '@mikro-orm/core';
|
|
||||||
import { BaseEntity } from '../../core/entities/base.entity';
|
|
||||||
export declare class Gift extends BaseEntity {
|
|
||||||
name: string;
|
|
||||||
description?: string;
|
|
||||||
imageUrl?: string;
|
|
||||||
price?: number;
|
|
||||||
experience?: boolean;
|
|
||||||
status: string;
|
|
||||||
ownerId?: string;
|
|
||||||
}
|
|
||||||
export declare const GiftSchema: EntitySchema<Gift, never, import("@mikro-orm/core").EntityCtor<Gift>>;
|
|
||||||
export declare class GiftContribution extends BaseEntity {
|
|
||||||
giftId: string;
|
|
||||||
contributorName: string;
|
|
||||||
contributorEmail?: string;
|
|
||||||
amount: number;
|
|
||||||
type: string;
|
|
||||||
status: string;
|
|
||||||
}
|
|
||||||
export declare const GiftContributionSchema: EntitySchema<GiftContribution, never, import("@mikro-orm/core").EntityCtor<GiftContribution>>;
|
|
||||||
//# sourceMappingURL=gift.entity.d.ts.map
|
|
||||||
1
dist/gift/entities/gift.entity.d.ts.map
vendored
1
dist/gift/entities/gift.entity.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"gift.entity.d.ts","sourceRoot":"","sources":["../../../src/gift/entities/gift.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7D,qBAAa,IAAK,SAAQ,UAAU;IAClC,IAAI,EAAG,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,MAAM,CAAa;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,UAAU,uEAoDrB,CAAC;AAEH,qBAAa,gBAAiB,SAAQ,UAAU;IAC9C,MAAM,EAAG,MAAM,CAAC;IAChB,eAAe,EAAG,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAG,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAgB;IAC5B,MAAM,EAAE,MAAM,CAAa;CAC5B;AAED,eAAO,MAAM,sBAAsB,+FA8CjC,CAAC"}
|
|
||||||
121
dist/gift/entities/gift.entity.js
vendored
121
dist/gift/entities/gift.entity.js
vendored
@@ -1,121 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.GiftContributionSchema = exports.GiftContribution = exports.GiftSchema = exports.Gift = void 0;
|
|
||||||
const core_1 = require("@mikro-orm/core");
|
|
||||||
const uuid_1 = require("uuid");
|
|
||||||
const base_entity_1 = require("../../core/entities/base.entity");
|
|
||||||
class Gift extends base_entity_1.BaseEntity {
|
|
||||||
constructor() {
|
|
||||||
super(...arguments);
|
|
||||||
this.status = 'pending';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.Gift = Gift;
|
|
||||||
exports.GiftSchema = new core_1.EntitySchema({
|
|
||||||
class: Gift,
|
|
||||||
tableName: 'gifts',
|
|
||||||
properties: {
|
|
||||||
id: {
|
|
||||||
type: 'uuid',
|
|
||||||
primary: true,
|
|
||||||
default: (0, uuid_1.v4)(),
|
|
||||||
},
|
|
||||||
tenantId: {
|
|
||||||
type: 'string',
|
|
||||||
},
|
|
||||||
metadata: {
|
|
||||||
type: 'json',
|
|
||||||
nullable: true,
|
|
||||||
},
|
|
||||||
createdAt: {
|
|
||||||
type: 'date',
|
|
||||||
default: new Date(),
|
|
||||||
},
|
|
||||||
updatedAt: {
|
|
||||||
type: 'date',
|
|
||||||
default: new Date(),
|
|
||||||
},
|
|
||||||
name: {
|
|
||||||
type: 'string',
|
|
||||||
},
|
|
||||||
description: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: true,
|
|
||||||
},
|
|
||||||
imageUrl: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: true,
|
|
||||||
},
|
|
||||||
price: {
|
|
||||||
type: 'float',
|
|
||||||
nullable: true,
|
|
||||||
},
|
|
||||||
experience: {
|
|
||||||
type: 'boolean',
|
|
||||||
nullable: true,
|
|
||||||
},
|
|
||||||
status: {
|
|
||||||
type: 'string',
|
|
||||||
default: 'pending',
|
|
||||||
},
|
|
||||||
ownerId: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
class GiftContribution extends base_entity_1.BaseEntity {
|
|
||||||
constructor() {
|
|
||||||
super(...arguments);
|
|
||||||
this.type = 'individual';
|
|
||||||
this.status = 'pending';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.GiftContribution = GiftContribution;
|
|
||||||
exports.GiftContributionSchema = new core_1.EntitySchema({
|
|
||||||
class: GiftContribution,
|
|
||||||
tableName: 'gift_contributions',
|
|
||||||
properties: {
|
|
||||||
id: {
|
|
||||||
type: 'uuid',
|
|
||||||
primary: true,
|
|
||||||
default: (0, uuid_1.v4)(),
|
|
||||||
},
|
|
||||||
tenantId: {
|
|
||||||
type: 'string',
|
|
||||||
},
|
|
||||||
metadata: {
|
|
||||||
type: 'json',
|
|
||||||
nullable: true,
|
|
||||||
},
|
|
||||||
createdAt: {
|
|
||||||
type: 'date',
|
|
||||||
default: new Date(),
|
|
||||||
},
|
|
||||||
updatedAt: {
|
|
||||||
type: 'date',
|
|
||||||
default: new Date(),
|
|
||||||
},
|
|
||||||
giftId: {
|
|
||||||
type: 'uuid',
|
|
||||||
},
|
|
||||||
contributorName: {
|
|
||||||
type: 'string',
|
|
||||||
},
|
|
||||||
contributorEmail: {
|
|
||||||
type: 'string',
|
|
||||||
nullable: true,
|
|
||||||
},
|
|
||||||
amount: {
|
|
||||||
type: 'float',
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
type: 'string',
|
|
||||||
default: 'individual',
|
|
||||||
},
|
|
||||||
status: {
|
|
||||||
type: 'string',
|
|
||||||
default: 'pending',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
3
dist/gift/gift.module.d.ts
vendored
3
dist/gift/gift.module.d.ts
vendored
@@ -1,3 +0,0 @@
|
|||||||
export declare class GiftModule {
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=gift.module.d.ts.map
|
|
||||||
1
dist/gift/gift.module.d.ts.map
vendored
1
dist/gift/gift.module.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"gift.module.d.ts","sourceRoot":"","sources":["../../src/gift/gift.module.ts"],"names":[],"mappings":"AASA,qBASa,UAAU;CAAG"}
|
|
||||||
31
dist/gift/gift.module.js
vendored
31
dist/gift/gift.module.js
vendored
@@ -1,31 +0,0 @@
|
|||||||
"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.GiftModule = void 0;
|
|
||||||
const common_1 = require("@nestjs/common");
|
|
||||||
const nestjs_1 = require("@mikro-orm/nestjs");
|
|
||||||
const core_module_1 = require("../core/core.module");
|
|
||||||
const gift_service_1 = require("./services/gift.service");
|
|
||||||
const gift_controller_1 = require("./api/gift.controller");
|
|
||||||
const gift_subscriber_1 = require("./subscribers/gift.subscriber");
|
|
||||||
const gift_entity_1 = require("./entities/gift.entity");
|
|
||||||
const gift_registration_1 = require("./gift.registration");
|
|
||||||
let GiftModule = class GiftModule {
|
|
||||||
};
|
|
||||||
exports.GiftModule = GiftModule;
|
|
||||||
exports.GiftModule = GiftModule = __decorate([
|
|
||||||
(0, common_1.Module)({
|
|
||||||
imports: [
|
|
||||||
core_module_1.CoreModule,
|
|
||||||
nestjs_1.MikroOrmModule.forFeature({ entities: [gift_entity_1.GiftSchema, gift_entity_1.GiftContributionSchema] }),
|
|
||||||
],
|
|
||||||
providers: [gift_service_1.GiftService, gift_subscriber_1.GiftSubscriber, gift_registration_1.GiftModuleRegistration],
|
|
||||||
controllers: [gift_controller_1.GiftController],
|
|
||||||
exports: [gift_service_1.GiftService],
|
|
||||||
})
|
|
||||||
], GiftModule);
|
|
||||||
8
dist/gift/gift.registration.d.ts
vendored
8
dist/gift/gift.registration.d.ts
vendored
@@ -1,8 +0,0 @@
|
|||||||
import { OnModuleInit } from '@nestjs/common';
|
|
||||||
import { ModuleRegistryService } from '../core/services/module-registry.service';
|
|
||||||
export declare class GiftModuleRegistration implements OnModuleInit {
|
|
||||||
private readonly moduleRegistry;
|
|
||||||
constructor(moduleRegistry: ModuleRegistryService);
|
|
||||||
onModuleInit(): void;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=gift.registration.d.ts.map
|
|
||||||
1
dist/gift/gift.registration.d.ts.map
vendored
1
dist/gift/gift.registration.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"gift.registration.d.ts","sourceRoot":"","sources":["../../src/gift/gift.registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,qBACa,sBAAuB,YAAW,YAAY;IAC7C,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,qBAAqB;IAElE,YAAY;CAQb"}
|
|
||||||
32
dist/gift/gift.registration.js
vendored
32
dist/gift/gift.registration.js
vendored
@@ -1,32 +0,0 @@
|
|||||||
"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.GiftModuleRegistration = void 0;
|
|
||||||
const common_1 = require("@nestjs/common");
|
|
||||||
const module_registry_service_1 = require("../core/services/module-registry.service");
|
|
||||||
let GiftModuleRegistration = class GiftModuleRegistration {
|
|
||||||
constructor(moduleRegistry) {
|
|
||||||
this.moduleRegistry = moduleRegistry;
|
|
||||||
}
|
|
||||||
onModuleInit() {
|
|
||||||
this.moduleRegistry.registerModule({
|
|
||||||
key: 'gift',
|
|
||||||
name: 'Regalos',
|
|
||||||
description: 'Gestión de lista de regalos, aportes individuales y grupales.',
|
|
||||||
routePrefix: '/gift',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
exports.GiftModuleRegistration = GiftModuleRegistration;
|
|
||||||
exports.GiftModuleRegistration = GiftModuleRegistration = __decorate([
|
|
||||||
(0, common_1.Injectable)(),
|
|
||||||
__metadata("design:paramtypes", [module_registry_service_1.ModuleRegistryService])
|
|
||||||
], GiftModuleRegistration);
|
|
||||||
17
dist/gift/services/gift.service.d.ts
vendored
17
dist/gift/services/gift.service.d.ts
vendored
@@ -1,17 +0,0 @@
|
|||||||
import { MikroORM } from '@mikro-orm/core';
|
|
||||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
|
||||||
import { Gift, GiftContribution } from '../entities/gift.entity';
|
|
||||||
import { CreateGiftDto } from '../api/dto/create-gift.dto';
|
|
||||||
import { CreateContributionDto } from '../api/dto/create-contribution.dto';
|
|
||||||
export declare class GiftService {
|
|
||||||
private readonly orm;
|
|
||||||
private readonly eventEmitter;
|
|
||||||
constructor(orm: MikroORM, eventEmitter: EventEmitter2);
|
|
||||||
private get em();
|
|
||||||
createGift(tenantId: string, dto: CreateGiftDto): Promise<Gift>;
|
|
||||||
createContribution(tenantId: string, dto: CreateContributionDto): Promise<GiftContribution>;
|
|
||||||
listGifts(tenantId: string): Promise<Gift[]>;
|
|
||||||
getGiftById(tenantId: string, id: string, requesterId?: string): Promise<Gift | null>;
|
|
||||||
listContributions(tenantId: string, giftId: string, requesterId?: string): Promise<GiftContribution[]>;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=gift.service.d.ts.map
|
|
||||||
1
dist/gift/services/gift.service.d.ts.map
vendored
1
dist/gift/services/gift.service.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"gift.service.d.ts","sourceRoot":"","sources":["../../../src/gift/services/gift.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,qBACa,WAAW;IAEpB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,GAAG,EAAE,QAAQ,EACb,YAAY,EAAE,aAAa;IAG9C,OAAO,KAAK,EAAE,GAEb;IAEK,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAW/D,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,qBAAqB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAW3F,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAI5C,WAAW,CACf,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,EACV,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IASjB,iBAAiB,CACrB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,gBAAgB,EAAE,CAAC;CAK/B"}
|
|
||||||
69
dist/gift/services/gift.service.js
vendored
69
dist/gift/services/gift.service.js
vendored
@@ -1,69 +0,0 @@
|
|||||||
"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.GiftService = void 0;
|
|
||||||
const common_1 = require("@nestjs/common");
|
|
||||||
const core_1 = require("@mikro-orm/core");
|
|
||||||
const event_emitter_1 = require("@nestjs/event-emitter");
|
|
||||||
const gift_entity_1 = require("../entities/gift.entity");
|
|
||||||
let GiftService = class GiftService {
|
|
||||||
constructor(orm, eventEmitter) {
|
|
||||||
this.orm = orm;
|
|
||||||
this.eventEmitter = eventEmitter;
|
|
||||||
}
|
|
||||||
get em() {
|
|
||||||
return this.orm.em.fork();
|
|
||||||
}
|
|
||||||
async createGift(tenantId, dto) {
|
|
||||||
const gift = this.em.create(gift_entity_1.Gift, {
|
|
||||||
tenantId,
|
|
||||||
...dto,
|
|
||||||
});
|
|
||||||
this.em.persist(gift);
|
|
||||||
await this.em.flush();
|
|
||||||
this.eventEmitter.emit('gift.created', { gift });
|
|
||||||
return gift;
|
|
||||||
}
|
|
||||||
async createContribution(tenantId, dto) {
|
|
||||||
const contribution = this.em.create(gift_entity_1.GiftContribution, {
|
|
||||||
tenantId,
|
|
||||||
...dto,
|
|
||||||
});
|
|
||||||
this.em.persist(contribution);
|
|
||||||
await this.em.flush();
|
|
||||||
this.eventEmitter.emit('gift.contribution', { contribution });
|
|
||||||
return contribution;
|
|
||||||
}
|
|
||||||
async listGifts(tenantId) {
|
|
||||||
return this.em.find(gift_entity_1.Gift, { tenantId });
|
|
||||||
}
|
|
||||||
async getGiftById(tenantId, id, requesterId) {
|
|
||||||
const gift = await this.em.findOne(gift_entity_1.Gift, { tenantId, id });
|
|
||||||
if (!gift)
|
|
||||||
return null;
|
|
||||||
if (requesterId && gift.ownerId && gift.ownerId !== requesterId) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return gift;
|
|
||||||
}
|
|
||||||
async listContributions(tenantId, giftId, requesterId) {
|
|
||||||
const gift = await this.getGiftById(tenantId, giftId, requesterId);
|
|
||||||
if (!gift)
|
|
||||||
return [];
|
|
||||||
return this.em.find(gift_entity_1.GiftContribution, { tenantId, giftId });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
exports.GiftService = GiftService;
|
|
||||||
exports.GiftService = GiftService = __decorate([
|
|
||||||
(0, common_1.Injectable)(),
|
|
||||||
__metadata("design:paramtypes", [core_1.MikroORM,
|
|
||||||
event_emitter_1.EventEmitter2])
|
|
||||||
], GiftService);
|
|
||||||
10
dist/gift/subscribers/gift.subscriber.d.ts
vendored
10
dist/gift/subscribers/gift.subscriber.d.ts
vendored
@@ -1,10 +0,0 @@
|
|||||||
import { NotificationService } from '../../core/services/notification.service';
|
|
||||||
import { NotificationRuleService } from '../../core/services/notification-rule.service';
|
|
||||||
export declare class GiftSubscriber {
|
|
||||||
private readonly notificationService;
|
|
||||||
private readonly notificationRuleService;
|
|
||||||
constructor(notificationService: NotificationService, notificationRuleService: NotificationRuleService);
|
|
||||||
handleGiftCreated(payload: any): Promise<void>;
|
|
||||||
handleGiftContribution(payload: any): Promise<void>;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=gift.subscriber.d.ts.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"gift.subscriber.d.ts","sourceRoot":"","sources":["../../../src/gift/subscribers/gift.subscriber.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AAExF,qBACa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,uBAAuB;gBADvB,mBAAmB,EAAE,mBAAmB,EACxC,uBAAuB,EAAE,uBAAuB;IAI7D,iBAAiB,CAAC,OAAO,EAAE,GAAG;IAgB9B,sBAAsB,CAAC,OAAO,EAAE,GAAG;CAc1C"}
|
|
||||||
58
dist/gift/subscribers/gift.subscriber.js
vendored
58
dist/gift/subscribers/gift.subscriber.js
vendored
@@ -1,58 +0,0 @@
|
|||||||
"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.GiftSubscriber = void 0;
|
|
||||||
const event_emitter_1 = require("@nestjs/event-emitter");
|
|
||||||
const common_1 = require("@nestjs/common");
|
|
||||||
const notification_service_1 = require("../../core/services/notification.service");
|
|
||||||
const notification_rule_service_1 = require("../../core/services/notification-rule.service");
|
|
||||||
let GiftSubscriber = class GiftSubscriber {
|
|
||||||
constructor(notificationService, notificationRuleService) {
|
|
||||||
this.notificationService = notificationService;
|
|
||||||
this.notificationRuleService = notificationRuleService;
|
|
||||||
}
|
|
||||||
async handleGiftCreated(payload) {
|
|
||||||
const { gift } = payload;
|
|
||||||
const rules = await this.notificationRuleService.getRulesForEvent(gift.tenantId, 'gift', 'gift.created');
|
|
||||||
for (const rule of rules) {
|
|
||||||
for (const channel of rule.channels) {
|
|
||||||
await this.notificationService.send(channel, gift.metadata?.notifyTo || '', 'Nuevo regalo creado', `Se ha creado el regalo: ${gift.name}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
async handleGiftContribution(payload) {
|
|
||||||
const { contribution } = payload;
|
|
||||||
const rules = await this.notificationRuleService.getRulesForEvent(contribution.tenantId, 'gift', 'gift.contribution');
|
|
||||||
for (const rule of rules) {
|
|
||||||
for (const channel of rule.channels) {
|
|
||||||
await this.notificationService.send(channel, contribution.metadata?.notifyTo || '', 'Nuevo aporte a regalo', `Se ha registrado un aporte de ${contribution.amount} al regalo (${contribution.giftId}).`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
exports.GiftSubscriber = GiftSubscriber;
|
|
||||||
__decorate([
|
|
||||||
(0, event_emitter_1.OnEvent)('gift.created'),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [Object]),
|
|
||||||
__metadata("design:returntype", Promise)
|
|
||||||
], GiftSubscriber.prototype, "handleGiftCreated", null);
|
|
||||||
__decorate([
|
|
||||||
(0, event_emitter_1.OnEvent)('gift.contribution'),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [Object]),
|
|
||||||
__metadata("design:returntype", Promise)
|
|
||||||
], GiftSubscriber.prototype, "handleGiftContribution", null);
|
|
||||||
exports.GiftSubscriber = GiftSubscriber = __decorate([
|
|
||||||
(0, common_1.Injectable)(),
|
|
||||||
__metadata("design:paramtypes", [notification_service_1.NotificationService,
|
|
||||||
notification_rule_service_1.NotificationRuleService])
|
|
||||||
], GiftSubscriber);
|
|
||||||
5
dist/gift/workflows/gift.workflow.d.ts
vendored
5
dist/gift/workflows/gift.workflow.d.ts
vendored
@@ -1,5 +0,0 @@
|
|||||||
import { BaseWorkflow } from '../../core/workflows/base-workflow';
|
|
||||||
export declare class GiftWorkflow extends BaseWorkflow {
|
|
||||||
execute(...args: any[]): Promise<any>;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=gift.workflow.d.ts.map
|
|
||||||
1
dist/gift/workflows/gift.workflow.d.ts.map
vendored
1
dist/gift/workflows/gift.workflow.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"gift.workflow.d.ts","sourceRoot":"","sources":["../../../src/gift/workflows/gift.workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE,qBAAa,YAAa,SAAQ,YAAY;IACtC,OAAO,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;CAM5C"}
|
|
||||||
13
dist/gift/workflows/gift.workflow.js
vendored
13
dist/gift/workflows/gift.workflow.js
vendored
@@ -1,13 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.GiftWorkflow = void 0;
|
|
||||||
const base_workflow_1 = require("../../core/workflows/base-workflow");
|
|
||||||
class GiftWorkflow extends base_workflow_1.BaseWorkflow {
|
|
||||||
async execute(...args) {
|
|
||||||
this.logExecution('Ejecutando workflow de regalo', args);
|
|
||||||
// Lógica de workflow para regalos
|
|
||||||
// ...existing code...
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.GiftWorkflow = GiftWorkflow;
|
|
||||||
7
dist/guest/api/dto/create-guest.dto.d.ts
vendored
7
dist/guest/api/dto/create-guest.dto.d.ts
vendored
@@ -1,7 +0,0 @@
|
|||||||
export declare class CreateGuestDto {
|
|
||||||
name: string;
|
|
||||||
email?: string;
|
|
||||||
phone?: string;
|
|
||||||
metadata?: Record<string, any>;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=create-guest.dto.d.ts.map
|
|
||||||
1
dist/guest/api/dto/create-guest.dto.d.ts.map
vendored
1
dist/guest/api/dto/create-guest.dto.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"create-guest.dto.d.ts","sourceRoot":"","sources":["../../../../src/guest/api/dto/create-guest.dto.ts"],"names":[],"mappings":"AAAA,qBAAa,cAAc;IACzB,IAAI,EAAG,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC"}
|
|
||||||
6
dist/guest/api/dto/create-guest.dto.js
vendored
6
dist/guest/api/dto/create-guest.dto.js
vendored
@@ -1,6 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.CreateGuestDto = void 0;
|
|
||||||
class CreateGuestDto {
|
|
||||||
}
|
|
||||||
exports.CreateGuestDto = CreateGuestDto;
|
|
||||||
5
dist/guest/api/dto/update-rsvp.dto.d.ts
vendored
5
dist/guest/api/dto/update-rsvp.dto.d.ts
vendored
@@ -1,5 +0,0 @@
|
|||||||
export declare class UpdateRsvpDto {
|
|
||||||
rsvp: boolean;
|
|
||||||
tableId?: string;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=update-rsvp.dto.d.ts.map
|
|
||||||
1
dist/guest/api/dto/update-rsvp.dto.d.ts.map
vendored
1
dist/guest/api/dto/update-rsvp.dto.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"update-rsvp.dto.d.ts","sourceRoot":"","sources":["../../../../src/guest/api/dto/update-rsvp.dto.ts"],"names":[],"mappings":"AAAA,qBAAa,aAAa;IACxB,IAAI,EAAG,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
||||||
6
dist/guest/api/dto/update-rsvp.dto.js
vendored
6
dist/guest/api/dto/update-rsvp.dto.js
vendored
@@ -1,6 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.UpdateRsvpDto = void 0;
|
|
||||||
class UpdateRsvpDto {
|
|
||||||
}
|
|
||||||
exports.UpdateRsvpDto = UpdateRsvpDto;
|
|
||||||
11
dist/guest/api/guest.controller.d.ts
vendored
11
dist/guest/api/guest.controller.d.ts
vendored
@@ -1,11 +0,0 @@
|
|||||||
import { GuestService } from '../services/guest.service';
|
|
||||||
import { CreateGuestDto } from './dto/create-guest.dto';
|
|
||||||
import { UpdateRsvpDto } from './dto/update-rsvp.dto';
|
|
||||||
export declare class GuestController {
|
|
||||||
private readonly guestService;
|
|
||||||
constructor(guestService: GuestService);
|
|
||||||
createGuest(tenantId: string, dto: CreateGuestDto): Promise<import("../entities/guest.entity").Guest>;
|
|
||||||
listGuests(tenantId: string): Promise<import("../entities/guest.entity").Guest[]>;
|
|
||||||
updateRsvp(tenantId: string, id: string, dto: UpdateRsvpDto): Promise<import("../entities/guest.entity").Guest | null>;
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=guest.controller.d.ts.map
|
|
||||||
1
dist/guest/api/guest.controller.d.ts.map
vendored
1
dist/guest/api/guest.controller.d.ts.map
vendored
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"guest.controller.d.ts","sourceRoot":"","sources":["../../../src/guest/api/guest.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEtD,qBACa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAZ,YAAY,EAAE,YAAY;IAGjD,WAAW,CACS,QAAQ,EAAE,MAAM,EAChC,GAAG,EAAE,cAAc;IAMvB,UAAU,CAAyB,QAAQ,EAAE,MAAM;IAKnD,UAAU,CACU,QAAQ,EAAE,MAAM,EAC3B,EAAE,EAAE,MAAM,EACf,GAAG,EAAE,aAAa;CAI7B"}
|
|
||||||
62
dist/guest/api/guest.controller.js
vendored
62
dist/guest/api/guest.controller.js
vendored
@@ -1,62 +0,0 @@
|
|||||||
"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);
|
|
||||||
};
|
|
||||||
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
||||||
return function (target, key) { decorator(target, key, paramIndex); }
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.GuestController = void 0;
|
|
||||||
const common_1 = require("@nestjs/common");
|
|
||||||
const guest_service_1 = require("../services/guest.service");
|
|
||||||
const create_guest_dto_1 = require("./dto/create-guest.dto");
|
|
||||||
const update_rsvp_dto_1 = require("./dto/update-rsvp.dto");
|
|
||||||
let GuestController = class GuestController {
|
|
||||||
constructor(guestService) {
|
|
||||||
this.guestService = guestService;
|
|
||||||
}
|
|
||||||
async createGuest(tenantId, dto) {
|
|
||||||
return this.guestService.createGuest(tenantId, dto);
|
|
||||||
}
|
|
||||||
async listGuests(tenantId) {
|
|
||||||
return this.guestService.listGuests(tenantId);
|
|
||||||
}
|
|
||||||
async updateRsvp(tenantId, id, dto) {
|
|
||||||
return this.guestService.updateRsvp(tenantId, id, dto);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
exports.GuestController = GuestController;
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Post)(),
|
|
||||||
__param(0, (0, common_1.Headers)('x-tenant-id')),
|
|
||||||
__param(1, (0, common_1.Body)()),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [String, create_guest_dto_1.CreateGuestDto]),
|
|
||||||
__metadata("design:returntype", Promise)
|
|
||||||
], GuestController.prototype, "createGuest", null);
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Get)(),
|
|
||||||
__param(0, (0, common_1.Headers)('x-tenant-id')),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [String]),
|
|
||||||
__metadata("design:returntype", Promise)
|
|
||||||
], GuestController.prototype, "listGuests", null);
|
|
||||||
__decorate([
|
|
||||||
(0, common_1.Patch)(':id/rsvp'),
|
|
||||||
__param(0, (0, common_1.Headers)('x-tenant-id')),
|
|
||||||
__param(1, (0, common_1.Param)('id')),
|
|
||||||
__param(2, (0, common_1.Body)()),
|
|
||||||
__metadata("design:type", Function),
|
|
||||||
__metadata("design:paramtypes", [String, String, update_rsvp_dto_1.UpdateRsvpDto]),
|
|
||||||
__metadata("design:returntype", Promise)
|
|
||||||
], GuestController.prototype, "updateRsvp", null);
|
|
||||||
exports.GuestController = GuestController = __decorate([
|
|
||||||
(0, common_1.Controller)('guest'),
|
|
||||||
__metadata("design:paramtypes", [guest_service_1.GuestService])
|
|
||||||
], GuestController);
|
|
||||||
18
dist/guest/entities/guest.entity.d.ts
vendored
18
dist/guest/entities/guest.entity.d.ts
vendored
@@ -1,18 +0,0 @@
|
|||||||
import { EntitySchema } from '@mikro-orm/core';
|
|
||||||
import { BaseEntity } from '../../core/entities/base.entity';
|
|
||||||
export declare class Guest extends BaseEntity {
|
|
||||||
name: string;
|
|
||||||
email?: string;
|
|
||||||
phone?: string;
|
|
||||||
rsvp: boolean;
|
|
||||||
tableId?: string;
|
|
||||||
}
|
|
||||||
export declare const GuestSchema: EntitySchema<Guest, never, import("@mikro-orm/core").EntityCtor<Guest>>;
|
|
||||||
export declare class GuestNotificationPreference extends BaseEntity {
|
|
||||||
guestId: string;
|
|
||||||
email: boolean;
|
|
||||||
whatsapp: boolean;
|
|
||||||
metadata?: Record<string, any>;
|
|
||||||
}
|
|
||||||
export declare const GuestNotificationPreferenceSchema: EntitySchema<GuestNotificationPreference, never, import("@mikro-orm/core").EntityCtor<GuestNotificationPreference>>;
|
|
||||||
//# sourceMappingURL=guest.entity.d.ts.map
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user