@ackplus/nest-dynamic-templates
Version:
Dynamic template management for NestJS applications
87 lines • 4.02 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateTemplateLayoutDto = void 0;
const tslib_1 = require("tslib");
const class_validator_1 = require("class-validator");
const template_types_1 = require("../interfaces/template.types");
const swagger_1 = require("@nestjs/swagger");
class CreateTemplateLayoutDto {
constructor() {
this.engine = template_types_1.TemplateEngineEnum.NUNJUCKS;
this.scope = 'system';
this.locale = 'en';
this.isActive = true;
}
}
exports.CreateTemplateLayoutDto = CreateTemplateLayoutDto;
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' }),
tslib_1.__metadata("design:type", String)
], CreateTemplateLayoutDto.prototype, "name", void 0);
tslib_1.__decorate([
(0, swagger_1.ApiProperty)({ type: String }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsOptional)(),
tslib_1.__metadata("design:type", String)
], CreateTemplateLayoutDto.prototype, "type", void 0);
tslib_1.__decorate([
(0, swagger_1.ApiPropertyOptional)({ type: String }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsNotEmpty)(),
tslib_1.__metadata("design:type", String)
], CreateTemplateLayoutDto.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)(),
tslib_1.__metadata("design:type", String)
], CreateTemplateLayoutDto.prototype, "description", 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, class_validator_1.IsOptional)(),
tslib_1.__metadata("design:type", String)
], CreateTemplateLayoutDto.prototype, "engine", void 0);
tslib_1.__decorate([
(0, swagger_1.ApiProperty)({ enum: template_types_1.TemplateLanguageEnum, type: String }),
(0, class_validator_1.IsEnum)(template_types_1.TemplateLanguageEnum),
(0, class_validator_1.IsNotEmpty)(),
tslib_1.__metadata("design:type", String)
], CreateTemplateLayoutDto.prototype, "language", void 0);
tslib_1.__decorate([
(0, swagger_1.ApiProperty)({ type: String, nullable: true }),
(0, class_validator_1.IsString)(),
tslib_1.__metadata("design:type", String)
], CreateTemplateLayoutDto.prototype, "content", void 0);
tslib_1.__decorate([
(0, swagger_1.ApiPropertyOptional)({ type: String, default: 'system' }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsOptional)(),
tslib_1.__metadata("design:type", String)
], CreateTemplateLayoutDto.prototype, "scope", void 0);
tslib_1.__decorate([
(0, swagger_1.ApiPropertyOptional)({ type: String }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsOptional)(),
tslib_1.__metadata("design:type", String)
], CreateTemplateLayoutDto.prototype, "scopeId", void 0);
tslib_1.__decorate([
(0, swagger_1.ApiPropertyOptional)({ type: String, nullable: true, default: 'en' }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsOptional)(),
tslib_1.__metadata("design:type", String)
], CreateTemplateLayoutDto.prototype, "locale", void 0);
tslib_1.__decorate([
(0, swagger_1.ApiPropertyOptional)({ type: Object, nullable: true }),
(0, class_validator_1.IsOptional)(),
tslib_1.__metadata("design:type", Object)
], CreateTemplateLayoutDto.prototype, "previewContext", void 0);
tslib_1.__decorate([
(0, swagger_1.ApiPropertyOptional)({ type: Boolean, nullable: true }),
(0, class_validator_1.IsOptional)(),
tslib_1.__metadata("design:type", Boolean)
], CreateTemplateLayoutDto.prototype, "isActive", void 0);
//# sourceMappingURL=create-template-layout.dto.js.map
;