UNPKG

@nestdevx/tenant

Version:

Tenant module for multi-tenant NestJS applications.

56 lines 3.31 kB
"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.CreateNewTenantDto = void 0; const is_equal_to_1 = require("../../../shared/src/decorators/is-equal-to"); const class_validator_1 = require("class-validator"); class CreateNewTenantDto { } exports.CreateNewTenantDto = CreateNewTenantDto; __decorate([ (0, class_validator_1.IsString)(), (0, class_validator_1.IsNotEmpty)({ message: 'Tenant name cannot be empty' }), (0, class_validator_1.Length)(3, 50, { message: 'Tenant name must be between 3 and 50 characters' }), __metadata("design:type", String) ], CreateNewTenantDto.prototype, "name", void 0); __decorate([ (0, class_validator_1.IsString)(), (0, class_validator_1.IsOptional)(), __metadata("design:type", String) ], CreateNewTenantDto.prototype, "host", void 0); __decorate([ (0, class_validator_1.IsString)({ message: 'Database URI must be a string', always: true }), (0, class_validator_1.IsOptional)({ message: 'Database URI is optional', always: true }), __metadata("design:type", String) ], CreateNewTenantDto.prototype, "dbUri", void 0); __decorate([ (0, class_validator_1.IsEmail)({ allow_display_name: false, require_tld: true }, { message: 'Email must be a valid email address', always: true }), __metadata("design:type", String) ], CreateNewTenantDto.prototype, "adminEmail", void 0); __decorate([ (0, class_validator_1.IsStrongPassword)({ minLength: 8, minLowercase: 1, minUppercase: 1, minNumbers: 1, minSymbols: 1 }, { message: 'Password must be strong', always: true }), __metadata("design:type", String) ], CreateNewTenantDto.prototype, "adminPassword", void 0); __decorate([ (0, is_equal_to_1.IsEqualTo)("adminPassword", { message: 'Confirm password must match password', always: true }), __metadata("design:type", String) ], CreateNewTenantDto.prototype, "adminConfirmPassword", void 0); __decorate([ (0, class_validator_1.IsString)({ message: 'First name must be a string', always: true }), (0, class_validator_1.IsNotEmpty)({ message: 'First name cannot be empty', always: true }), __metadata("design:type", String) ], CreateNewTenantDto.prototype, "adminFirstName", void 0); __decorate([ (0, class_validator_1.IsNotEmpty)({ message: 'Last name cannot be empty', always: true }), (0, class_validator_1.IsString)({ message: 'Last name must be a string', always: true }), __metadata("design:type", String) ], CreateNewTenantDto.prototype, "adminLastName", void 0); //# sourceMappingURL=create-new-tenant.dto.js.map