UNPKG

@ackplus/nest-dynamic-templates

Version:

Dynamic template management for NestJS applications

121 lines 5.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NestDynamicTemplateLayout = void 0; const tslib_1 = require("tslib"); const typeorm_1 = require("typeorm"); const class_validator_1 = require("class-validator"); const template_types_1 = require("../interfaces/template.types"); const swagger_1 = require("@nestjs/swagger"); let NestDynamicTemplateLayout = class NestDynamicTemplateLayout { }; exports.NestDynamicTemplateLayout = NestDynamicTemplateLayout; tslib_1.__decorate([ (0, swagger_1.ApiProperty)({ type: String, format: 'uuid', readOnly: true }), (0, typeorm_1.PrimaryGeneratedColumn)('uuid'), tslib_1.__metadata("design:type", String) ], NestDynamicTemplateLayout.prototype, "id", void 0); tslib_1.__decorate([ (0, swagger_1.ApiProperty)({ type: String }), (0, class_validator_1.IsString)(), (0, class_validator_1.IsNotEmpty)(), (0, class_validator_1.Matches)(/^[a-z0-9\-_]+$/, { message: 'Invalid template name format' }), (0, typeorm_1.Column)(), tslib_1.__metadata("design:type", String) ], NestDynamicTemplateLayout.prototype, "name", void 0); tslib_1.__decorate([ (0, swagger_1.ApiProperty)({ type: String, nullable: true }), (0, class_validator_1.IsString)(), (0, class_validator_1.IsOptional)(), (0, typeorm_1.Column)({ nullable: true }), tslib_1.__metadata("design:type", String) ], NestDynamicTemplateLayout.prototype, "displayName", void 0); tslib_1.__decorate([ (0, swagger_1.ApiProperty)({ type: String, nullable: true }), (0, class_validator_1.IsString)(), (0, class_validator_1.IsOptional)(), (0, typeorm_1.Column)({ type: 'text', nullable: true }), tslib_1.__metadata("design:type", String) ], NestDynamicTemplateLayout.prototype, "description", void 0); tslib_1.__decorate([ (0, swagger_1.ApiProperty)({ type: String }), (0, class_validator_1.IsString)(), (0, class_validator_1.IsOptional)(), (0, typeorm_1.Column)({ type: 'text' }), tslib_1.__metadata("design:type", String) ], NestDynamicTemplateLayout.prototype, "type", void 0); tslib_1.__decorate([ (0, swagger_1.ApiProperty)({ enum: template_types_1.TemplateEngineEnum, type: String }), (0, class_validator_1.IsEnum)(template_types_1.TemplateEngineEnum), (0, typeorm_1.Column)({ type: 'text', enum: template_types_1.TemplateEngineEnum, default: template_types_1.TemplateEngineEnum.NUNJUCKS }), tslib_1.__metadata("design:type", String) ], NestDynamicTemplateLayout.prototype, "engine", void 0); tslib_1.__decorate([ (0, swagger_1.ApiProperty)({ enum: template_types_1.TemplateLanguageEnum, type: String, nullable: true }), (0, class_validator_1.IsEnum)(template_types_1.TemplateLanguageEnum), (0, class_validator_1.IsOptional)(), (0, typeorm_1.Column)({ type: 'text' }), tslib_1.__metadata("design:type", String) ], NestDynamicTemplateLayout.prototype, "language", void 0); tslib_1.__decorate([ (0, swagger_1.ApiProperty)({ type: String }), (0, class_validator_1.IsString)(), (0, class_validator_1.IsOptional)(), (0, typeorm_1.Column)('text'), tslib_1.__metadata("design:type", String) ], NestDynamicTemplateLayout.prototype, "content", void 0); tslib_1.__decorate([ (0, swagger_1.ApiProperty)({ type: String, nullable: true }), (0, class_validator_1.IsString)(), (0, class_validator_1.IsOptional)(), (0, typeorm_1.Column)({ nullable: true }), tslib_1.__metadata("design:type", String) ], NestDynamicTemplateLayout.prototype, "templateLayoutName", void 0); tslib_1.__decorate([ (0, swagger_1.ApiProperty)({ type: String, nullable: true }), (0, class_validator_1.IsString)(), (0, typeorm_1.Column)({ nullable: true, default: 'system' }), tslib_1.__metadata("design:type", String) ], NestDynamicTemplateLayout.prototype, "scope", void 0); tslib_1.__decorate([ (0, swagger_1.ApiProperty)({ type: String, nullable: true }), (0, class_validator_1.IsString)(), (0, typeorm_1.Column)({ nullable: true }), tslib_1.__metadata("design:type", String) ], NestDynamicTemplateLayout.prototype, "scopeId", void 0); tslib_1.__decorate([ (0, swagger_1.ApiProperty)({ type: String, nullable: true }), (0, class_validator_1.IsString)(), (0, typeorm_1.Column)({ nullable: true, default: 'en' }), tslib_1.__metadata("design:type", String) ], NestDynamicTemplateLayout.prototype, "locale", void 0); tslib_1.__decorate([ (0, swagger_1.ApiProperty)({ type: Object, nullable: true }), (0, class_validator_1.IsOptional)(), (0, typeorm_1.Column)('simple-json', { nullable: true }), tslib_1.__metadata("design:type", Object) ], NestDynamicTemplateLayout.prototype, "previewContext", void 0); tslib_1.__decorate([ (0, swagger_1.ApiProperty)({ type: Boolean }), (0, class_validator_1.IsBoolean)(), (0, typeorm_1.Column)({ default: true }), tslib_1.__metadata("design:type", Boolean) ], NestDynamicTemplateLayout.prototype, "isActive", void 0); tslib_1.__decorate([ (0, swagger_1.ApiProperty)({ type: Date, readOnly: true }), (0, typeorm_1.CreateDateColumn)(), tslib_1.__metadata("design:type", Date) ], NestDynamicTemplateLayout.prototype, "createdAt", void 0); tslib_1.__decorate([ (0, swagger_1.ApiProperty)({ type: Date, readOnly: true }), (0, typeorm_1.UpdateDateColumn)(), tslib_1.__metadata("design:type", Date) ], NestDynamicTemplateLayout.prototype, "updatedAt", void 0); exports.NestDynamicTemplateLayout = NestDynamicTemplateLayout = tslib_1.__decorate([ (0, typeorm_1.Entity)('nest_dynamic_template_layouts'), (0, typeorm_1.Index)(['name', 'scope', 'scopeId', 'locale'], { unique: true }) ], NestDynamicTemplateLayout); //# sourceMappingURL=template-layout.entity.js.map