@ackplus/nest-dynamic-templates
Version:
Dynamic template management for NestJS applications
91 lines • 3.66 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.RenderTemplateOutputDTO = exports.RenderTemplateDto = 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 RenderTemplateDto {
constructor() {
this.locale = 'en';
this.scope = 'system';
}
}
exports.RenderTemplateDto = RenderTemplateDto;
tslib_1.__decorate([
(0, swagger_1.ApiPropertyOptional)({
type: String,
default: 'en',
description: 'The locale code, i.e en, fr, es, etc.'
}),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsOptional)(),
tslib_1.__metadata("design:type", String)
], RenderTemplateDto.prototype, "locale", 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.ValidateIf)((object, value) => !object?.content),
tslib_1.__metadata("design:type", String)
], RenderTemplateDto.prototype, "name", 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.ValidateIf)((object, value) => !object?.name),
tslib_1.__metadata("design:type", String)
], RenderTemplateDto.prototype, "content", 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)(),
(0, class_validator_1.ValidateIf)((object, value) => !object?.name),
tslib_1.__metadata("design:type", String)
], RenderTemplateDto.prototype, "language", void 0);
tslib_1.__decorate([
(0, swagger_1.ApiPropertyOptional)({
type: String,
default: 'system',
description: 'The scope of the template, i.e user, organization, etc.'
}),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsOptional)(),
tslib_1.__metadata("design:type", String)
], RenderTemplateDto.prototype, "scope", void 0);
tslib_1.__decorate([
(0, swagger_1.ApiPropertyOptional)({
type: String,
default: null,
description: 'The scope id of the template, i.e user id, organization id, etc.'
}),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsOptional)(),
tslib_1.__metadata("design:type", String)
], RenderTemplateDto.prototype, "scopeId", void 0);
tslib_1.__decorate([
(0, swagger_1.ApiPropertyOptional)({
type: String,
nullable: true,
description: 'The context of the template'
}),
(0, class_validator_1.IsObject)(),
(0, class_validator_1.IsOptional)(),
tslib_1.__metadata("design:type", Object)
], RenderTemplateDto.prototype, "context", void 0);
class RenderTemplateOutputDTO {
}
exports.RenderTemplateOutputDTO = RenderTemplateOutputDTO;
tslib_1.__decorate([
(0, swagger_1.ApiProperty)({ type: String }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsNotEmpty)(),
tslib_1.__metadata("design:type", String)
], RenderTemplateOutputDTO.prototype, "content", void 0);
tslib_1.__decorate([
(0, swagger_1.ApiProperty)({ type: String }),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsNotEmpty)(),
tslib_1.__metadata("design:type", String)
], RenderTemplateOutputDTO.prototype, "subject", void 0);
//# sourceMappingURL=render-template.dto.js.map
;