@cv-tec/validations 0.0.11 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-class-transform/map-transform.d.ts +3 -0
- package/dist/custom-class-transform/map-transform.js +29 -0
- package/dist/custom-class-transform/map-transform.js.map +1 -0
- package/dist/custom-class-validators/is-record-key-locale.d.ts +6 -0
- package/dist/custom-class-validators/is-record-key-locale.js +37 -0
- package/dist/custom-class-validators/is-record-key-locale.js.map +1 -0
- package/dist/custom-class-validators/is-record-key-uuid.d.ts +6 -0
- package/dist/custom-class-validators/is-record-key-uuid.js +37 -0
- package/dist/custom-class-validators/is-record-key-uuid.js.map +1 -0
- package/dist/entities/cv-info/cv-info.d.ts +7 -4
- package/dist/entities/cv-info/cv-info.js +24 -8
- package/dist/entities/cv-info/cv-info.js.map +1 -1
- package/dist/entities/cv-info/cv-info.mocks.js +5 -4
- package/dist/entities/cv-info/cv-info.mocks.js.map +1 -1
- package/dist/entities/cv-info/index.d.ts +8 -1
- package/dist/entities/cv-info/index.js +22 -1
- package/dist/entities/cv-info/index.js.map +1 -1
- package/dist/entities/cv-info/language.d.ts +1 -0
- package/dist/entities/cv-info/language.js +3 -0
- package/dist/entities/cv-info/language.js.map +1 -1
- package/dist/entities/cv-info/skills.d.ts +3 -1
- package/dist/entities/cv-info/skills.js +7 -5
- package/dist/entities/cv-info/skills.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +21 -13
- package/dist/index.js.map +1 -1
- package/dist/type-validation/common/address.d.ts +11 -0
- package/dist/type-validation/common/address.js +49 -0
- package/dist/type-validation/common/address.js.map +1 -0
- package/dist/type-validation/common/category.d.ts +6 -0
- package/dist/type-validation/common/category.js +26 -0
- package/dist/type-validation/common/category.js.map +1 -0
- package/dist/type-validation/common/coordinates.d.ts +16 -0
- package/dist/type-validation/common/coordinates.js +71 -0
- package/dist/type-validation/common/coordinates.js.map +1 -0
- package/dist/type-validation/common/experience.d.ts +14 -0
- package/dist/type-validation/common/experience.js +81 -0
- package/dist/type-validation/common/experience.js.map +1 -0
- package/dist/type-validation/common/formation.d.ts +13 -0
- package/dist/type-validation/common/formation.js +57 -0
- package/dist/type-validation/common/formation.js.map +1 -0
- package/dist/type-validation/common/hobby.d.ts +8 -0
- package/dist/type-validation/common/hobby.js +33 -0
- package/dist/type-validation/common/hobby.js.map +1 -0
- package/dist/type-validation/common/index.d.ts +4 -0
- package/dist/type-validation/common/index.js +12 -0
- package/dist/type-validation/common/index.js.map +1 -0
- package/dist/type-validation/common/interval-date.d.ts +8 -0
- package/dist/type-validation/common/interval-date.js +34 -0
- package/dist/type-validation/common/interval-date.js.map +1 -0
- package/dist/type-validation/common/language.d.ts +7 -0
- package/dist/type-validation/common/language.js +29 -0
- package/dist/type-validation/common/language.js.map +1 -0
- package/dist/type-validation/common/mission.d.ts +13 -0
- package/dist/type-validation/common/mission.js +73 -0
- package/dist/type-validation/common/mission.js.map +1 -0
- package/dist/type-validation/common/profile.d.ts +12 -0
- package/dist/type-validation/common/profile.js +52 -0
- package/dist/type-validation/common/profile.js.map +1 -0
- package/dist/type-validation/common/reference.d.ts +11 -0
- package/dist/type-validation/common/reference.js +48 -0
- package/dist/type-validation/common/reference.js.map +1 -0
- package/dist/type-validation/common/skill.d.ts +15 -0
- package/dist/type-validation/common/skill.js +39 -0
- package/dist/type-validation/common/skill.js.map +1 -0
- package/dist/type-validation/dto/auth.d.ts +18 -0
- package/dist/type-validation/dto/auth.js +72 -0
- package/dist/type-validation/dto/auth.js.map +1 -0
- package/dist/type-validation/dto/cv-info/cv-info-dto.d.ts +34 -0
- package/dist/type-validation/dto/cv-info/cv-info-dto.js +95 -0
- package/dist/type-validation/dto/cv-info/cv-info-dto.js.map +1 -0
- package/dist/type-validation/dto/cv-info/cv-info.d.ts +34 -0
- package/dist/type-validation/dto/cv-info/cv-info.js +95 -0
- package/dist/type-validation/dto/cv-info/cv-info.js.map +1 -0
- package/dist/type-validation/dto/cv-info/experience-dto.d.ts +10 -0
- package/dist/type-validation/dto/cv-info/experience-dto.js +36 -0
- package/dist/type-validation/dto/cv-info/experience-dto.js.map +1 -0
- package/dist/type-validation/dto/cv-info/formation-dto.d.ts +8 -0
- package/dist/type-validation/dto/cv-info/formation-dto.js +26 -0
- package/dist/type-validation/dto/cv-info/formation-dto.js.map +1 -0
- package/dist/type-validation/dto/cv-info/hobby-dto.d.ts +8 -0
- package/dist/type-validation/dto/cv-info/hobby-dto.js +26 -0
- package/dist/type-validation/dto/cv-info/hobby-dto.js.map +1 -0
- package/dist/type-validation/dto/cv-info/index.d.ts +7 -0
- package/dist/type-validation/dto/cv-info/index.js +24 -0
- package/dist/type-validation/dto/cv-info/index.js.map +1 -0
- package/dist/type-validation/dto/cv-info/language-dto.d.ts +8 -0
- package/dist/type-validation/dto/cv-info/language-dto.js +28 -0
- package/dist/type-validation/dto/cv-info/language-dto.js.map +1 -0
- package/dist/type-validation/dto/cv-info/mission-dto.d.ts +8 -0
- package/dist/type-validation/dto/cv-info/mission-dto.js +26 -0
- package/dist/type-validation/dto/cv-info/mission-dto.js.map +1 -0
- package/dist/type-validation/dto/cv-info/reference-dto.d.ts +8 -0
- package/dist/type-validation/dto/cv-info/reference-dto.js +26 -0
- package/dist/type-validation/dto/cv-info/reference-dto.js.map +1 -0
- package/dist/type-validation/dto/cv-info/skills-dto.d.ts +41 -0
- package/dist/type-validation/dto/cv-info/skills-dto.js +84 -0
- package/dist/type-validation/dto/cv-info/skills-dto.js.map +1 -0
- package/dist/type-validation/dto/index.d.ts +2 -0
- package/dist/type-validation/dto/index.js +19 -0
- package/dist/type-validation/dto/index.js.map +1 -0
- package/dist/type-validation/entities/cv-info/cv-info.d.ts +24 -0
- package/dist/type-validation/entities/cv-info/cv-info.js +99 -0
- package/dist/type-validation/entities/cv-info/cv-info.js.map +1 -0
- package/dist/type-validation/entities/cv-info/experience.d.ts +9 -0
- package/dist/type-validation/entities/cv-info/experience.js +40 -0
- package/dist/type-validation/entities/cv-info/experience.js.map +1 -0
- package/dist/type-validation/entities/cv-info/formation.d.ts +7 -0
- package/dist/type-validation/entities/cv-info/formation.js +27 -0
- package/dist/type-validation/entities/cv-info/formation.js.map +1 -0
- package/dist/type-validation/entities/cv-info/hobby.d.ts +7 -0
- package/dist/type-validation/entities/cv-info/hobby.js +27 -0
- package/dist/type-validation/entities/cv-info/hobby.js.map +1 -0
- package/dist/type-validation/entities/cv-info/index.d.ts +7 -0
- package/dist/type-validation/entities/cv-info/index.js +20 -0
- package/dist/type-validation/entities/cv-info/index.js.map +1 -0
- package/dist/type-validation/entities/cv-info/language.d.ts +7 -0
- package/dist/type-validation/entities/cv-info/language.js +27 -0
- package/dist/type-validation/entities/cv-info/language.js.map +1 -0
- package/dist/type-validation/entities/cv-info/mission.d.ts +7 -0
- package/dist/type-validation/entities/cv-info/mission.js +27 -0
- package/dist/type-validation/entities/cv-info/mission.js.map +1 -0
- package/dist/type-validation/entities/cv-info/reference.d.ts +7 -0
- package/dist/type-validation/entities/cv-info/reference.js +27 -0
- package/dist/type-validation/entities/cv-info/reference.js.map +1 -0
- package/dist/type-validation/entities/cv-info/skills.d.ts +20 -0
- package/dist/type-validation/entities/cv-info/skills.js +70 -0
- package/dist/type-validation/entities/cv-info/skills.js.map +1 -0
- package/dist/type-validation/entities/cv-tec-user.d.ts +10 -0
- package/dist/type-validation/entities/cv-tec-user.js +46 -0
- package/dist/type-validation/entities/cv-tec-user.js.map +1 -0
- package/dist/type-validation/entities/index.d.ts +2 -0
- package/dist/type-validation/entities/index.js +19 -0
- package/dist/type-validation/entities/index.js.map +1 -0
- package/dist/type-validation/index.d.ts +3 -0
- package/dist/type-validation/index.js +20 -0
- package/dist/type-validation/index.js.map +1 -0
- package/dist/type-validation/mocks/index.d.ts +17 -0
- package/dist/type-validation/mocks/index.js +172 -0
- package/dist/type-validation/mocks/index.js.map +1 -0
- package/dist/type-validation/root-class-validation.d.ts +25 -0
- package/dist/type-validation/root-class-validation.js +61 -0
- package/dist/type-validation/root-class-validation.js.map +1 -0
- package/dist/utils/array-object.mapper.d.ts +23 -0
- package/dist/utils/array-object.mapper.js +124 -0
- package/dist/utils/array-object.mapper.js.map +1 -0
- package/dist/utils/array.mapper.d.ts +0 -0
- package/dist/utils/array.mapper.js +2 -0
- package/dist/utils/array.mapper.js.map +1 -0
- package/dist/utils/cv-info.mapper.d.ts +0 -0
- package/dist/utils/cv-info.mapper.js +2 -0
- package/dist/utils/cv-info.mapper.js.map +1 -0
- package/package.json +1 -1
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
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;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.LanguigeEntity = void 0;
|
13
|
+
const language_1 = require("../../../type-validation/common/language");
|
14
|
+
const class_validator_1 = require("class-validator");
|
15
|
+
class LanguigeEntity extends language_1.Language {
|
16
|
+
constructor(param) {
|
17
|
+
super(param);
|
18
|
+
}
|
19
|
+
}
|
20
|
+
exports.LanguigeEntity = LanguigeEntity;
|
21
|
+
__decorate([
|
22
|
+
(0, class_validator_1.IsInt)(),
|
23
|
+
(0, class_validator_1.Max)(15),
|
24
|
+
(0, class_validator_1.Min)(0),
|
25
|
+
__metadata("design:type", Number)
|
26
|
+
], LanguigeEntity.prototype, "$index", void 0);
|
27
|
+
//# sourceMappingURL=language.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"language.js","sourceRoot":"","sources":["../../../../src/type-validation/entities/cv-info/language.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gEAA4D;AAE5D,qDAAiD;AAIjD,MAAa,cAAe,SAAQ,mBAAQ;IAC1C,YAAY,KAAsB;QAChC,KAAK,CAAC,KAAK,CAAC,CAAA;IACd,CAAC;CAKF;AARD,wCAQC;AADC;IAHC,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,EAAE,CAAC;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;;8CACQ"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { Mission } from '../../../type-validation/common/mission';
|
2
|
+
import { RootClassValidation } from '../../../type-validation/root-class-validation';
|
3
|
+
export type IMissionEntity = Omit<MissionEntity, keyof RootClassValidation>;
|
4
|
+
export declare class MissionEntity extends Mission {
|
5
|
+
constructor(params: IMissionEntity);
|
6
|
+
$index: number;
|
7
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
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;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.MissionEntity = void 0;
|
13
|
+
const mission_1 = require("../../../type-validation/common/mission");
|
14
|
+
const class_validator_1 = require("class-validator");
|
15
|
+
class MissionEntity extends mission_1.Mission {
|
16
|
+
constructor(params) {
|
17
|
+
super(params);
|
18
|
+
}
|
19
|
+
}
|
20
|
+
exports.MissionEntity = MissionEntity;
|
21
|
+
__decorate([
|
22
|
+
(0, class_validator_1.IsInt)(),
|
23
|
+
(0, class_validator_1.Max)(15),
|
24
|
+
(0, class_validator_1.Min)(0),
|
25
|
+
__metadata("design:type", Number)
|
26
|
+
], MissionEntity.prototype, "$index", void 0);
|
27
|
+
//# sourceMappingURL=mission.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"mission.js","sourceRoot":"","sources":["../../../../src/type-validation/entities/cv-info/mission.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8DAA0D;AAE1D,qDAAiD;AAGjD,MAAa,aAAc,SAAQ,iBAAO;IACxC,YAAY,MAAsB;QAChC,KAAK,CAAC,MAAM,CAAC,CAAA;IACf,CAAC;CAKF;AARD,sCAQC;AADC;IAHC,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,EAAE,CAAC;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;;6CACQ"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { Reference } from '../../../type-validation/common/reference';
|
2
|
+
import { RootClassValidation } from '../../../type-validation/root-class-validation';
|
3
|
+
export type IReferenceEntity = Omit<ReferenceEntity, keyof RootClassValidation>;
|
4
|
+
export declare class ReferenceEntity extends Reference {
|
5
|
+
constructor(param?: IReferenceEntity);
|
6
|
+
$index: number;
|
7
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
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;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.ReferenceEntity = void 0;
|
13
|
+
const reference_1 = require("../../../type-validation/common/reference");
|
14
|
+
const class_validator_1 = require("class-validator");
|
15
|
+
class ReferenceEntity extends reference_1.Reference {
|
16
|
+
constructor(param) {
|
17
|
+
super(param);
|
18
|
+
}
|
19
|
+
}
|
20
|
+
exports.ReferenceEntity = ReferenceEntity;
|
21
|
+
__decorate([
|
22
|
+
(0, class_validator_1.IsInt)(),
|
23
|
+
(0, class_validator_1.Max)(15),
|
24
|
+
(0, class_validator_1.Min)(0),
|
25
|
+
__metadata("design:type", Number)
|
26
|
+
], ReferenceEntity.prototype, "$index", void 0);
|
27
|
+
//# sourceMappingURL=reference.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"reference.js","sourceRoot":"","sources":["../../../../src/type-validation/entities/cv-info/reference.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kEAA8D;AAE9D,qDAAiD;AAIjD,MAAa,eAAgB,SAAQ,qBAAS;IAC5C,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAA;IACd,CAAC;CAKF;AARD,0CAQC;AADC;IAHC,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,EAAE,CAAC;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;;+CACQ"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { Category } from '../../../type-validation/common/category';
|
2
|
+
import { Skill } from '../../../type-validation/common/skill';
|
3
|
+
import { CATEGORIES_KEY, CATEGORIZED_ITEMS_KEY } from '../../../type-validation/dto';
|
4
|
+
import { RootClassValidation } from '../../../type-validation/root-class-validation';
|
5
|
+
export type ISkillEntity = Omit<SkillEntity, keyof RootClassValidation>;
|
6
|
+
export declare class SkillEntity extends Skill {
|
7
|
+
constructor(param: ISkillEntity);
|
8
|
+
$index: number;
|
9
|
+
}
|
10
|
+
export type ICategoryEntity = Omit<CategoryEntity, keyof RootClassValidation>;
|
11
|
+
export declare class CategoryEntity extends Category {
|
12
|
+
constructor(param: ICategoryEntity);
|
13
|
+
$index: number;
|
14
|
+
}
|
15
|
+
export type ISkillsContainerEntity = Omit<SkillsContainerEntity, keyof RootClassValidation>;
|
16
|
+
export declare class SkillsContainerEntity extends RootClassValidation {
|
17
|
+
constructor(param: ISkillsContainerEntity);
|
18
|
+
[CATEGORIES_KEY]?: Record<string, ICategoryEntity>;
|
19
|
+
[CATEGORIZED_ITEMS_KEY]?: Record<string, ISkillEntity>;
|
20
|
+
}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
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;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
var _a, _b;
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
13
|
+
exports.SkillsContainerEntity = exports.CategoryEntity = exports.SkillEntity = void 0;
|
14
|
+
const map_transform_1 = require("../../../custom-class-transform/map-transform");
|
15
|
+
const is_record_key_uuid_1 = require("../../../custom-class-validators/is-record-key-uuid");
|
16
|
+
const category_1 = require("../../../type-validation/common/category");
|
17
|
+
const skill_1 = require("../../../type-validation/common/skill");
|
18
|
+
const dto_1 = require("../../../type-validation/dto");
|
19
|
+
const root_class_validation_1 = require("../../../type-validation/root-class-validation");
|
20
|
+
const class_validator_1 = require("class-validator");
|
21
|
+
class SkillEntity extends skill_1.Skill {
|
22
|
+
constructor(param) {
|
23
|
+
super(param);
|
24
|
+
}
|
25
|
+
}
|
26
|
+
exports.SkillEntity = SkillEntity;
|
27
|
+
__decorate([
|
28
|
+
(0, class_validator_1.IsInt)(),
|
29
|
+
(0, class_validator_1.Max)(15),
|
30
|
+
(0, class_validator_1.Min)(0),
|
31
|
+
__metadata("design:type", Number)
|
32
|
+
], SkillEntity.prototype, "$index", void 0);
|
33
|
+
class CategoryEntity extends category_1.Category {
|
34
|
+
constructor(param) {
|
35
|
+
super(param);
|
36
|
+
}
|
37
|
+
}
|
38
|
+
exports.CategoryEntity = CategoryEntity;
|
39
|
+
__decorate([
|
40
|
+
(0, class_validator_1.IsInt)(),
|
41
|
+
(0, class_validator_1.Max)(15),
|
42
|
+
(0, class_validator_1.Min)(0),
|
43
|
+
__metadata("design:type", Number)
|
44
|
+
], CategoryEntity.prototype, "$index", void 0);
|
45
|
+
class SkillsContainerEntity extends root_class_validation_1.RootClassValidation {
|
46
|
+
constructor(param) {
|
47
|
+
super(param);
|
48
|
+
}
|
49
|
+
}
|
50
|
+
exports.SkillsContainerEntity = SkillsContainerEntity;
|
51
|
+
_a = dto_1.CATEGORIES_KEY, _b = dto_1.CATEGORIZED_ITEMS_KEY;
|
52
|
+
__decorate([
|
53
|
+
(0, map_transform_1.MapTransform)(),
|
54
|
+
(0, map_transform_1.TransformToMap)(CategoryEntity),
|
55
|
+
(0, class_validator_1.ValidateNested)({
|
56
|
+
each: true,
|
57
|
+
}),
|
58
|
+
(0, is_record_key_uuid_1.IsRecordKeyUuid)(),
|
59
|
+
__metadata("design:type", Object)
|
60
|
+
], SkillsContainerEntity.prototype, _a, void 0);
|
61
|
+
__decorate([
|
62
|
+
(0, map_transform_1.MapTransform)(),
|
63
|
+
(0, map_transform_1.TransformToMap)(SkillEntity),
|
64
|
+
(0, class_validator_1.ValidateNested)({
|
65
|
+
each: true,
|
66
|
+
}),
|
67
|
+
(0, is_record_key_uuid_1.IsRecordKeyUuid)(),
|
68
|
+
__metadata("design:type", Object)
|
69
|
+
], SkillsContainerEntity.prototype, _b, void 0);
|
70
|
+
//# sourceMappingURL=skills.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../../../src/type-validation/entities/cv-info/skills.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,0EAAqF;AACrF,qFAA8E;AAC9E,gEAA4D;AAC5D,0DAAsD;AACtD,+CAA6E;AAC7E,mFAA6E;AAC7E,qDAAiE;AAIjE,MAAa,WAAY,SAAQ,aAAK;IACpC,YAAY,KAAmB;QAC7B,KAAK,CAAC,KAAK,CAAC,CAAA;IACd,CAAC;CAKF;AARD,kCAQC;AADC;IAHC,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,EAAE,CAAC;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;;2CACQ;AAKjB,MAAa,cAAe,SAAQ,mBAAQ;IAC1C,YAAY,KAAsB;QAChC,KAAK,CAAC,KAAK,CAAC,CAAA;IACd,CAAC;CAKF;AARD,wCAQC;AADC;IAHC,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,EAAE,CAAC;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;;8CACQ;AAQjB,MAAa,qBAAsB,SAAQ,2CAAmB;IAC5D,YAAY,KAA6B;QACvC,KAAK,CAAC,KAAK,CAAC,CAAA;IACd,CAAC;CAiBF;AApBD,sDAoBC;KATE,oBAAc,OAQd,2BAAqB;AARtB;IANC,IAAA,4BAAY,GAAE;IACd,IAAA,8BAAc,EAAC,cAAc,CAAC;IAC9B,IAAA,gCAAc,EAAC;QACd,IAAI,EAAE,IAAI;KACX,CAAC;IACD,IAAA,oCAAe,GAAE;;+CACiC;AAQnD;IANC,IAAA,4BAAY,GAAE;IACd,IAAA,8BAAc,EAAC,WAAW,CAAC;IAC3B,IAAA,gCAAc,EAAC;QACd,IAAI,EAAE,IAAI;KACX,CAAC;IACD,IAAA,oCAAe,GAAE;;+CACoC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import 'reflect-metadata';
|
2
|
+
import { RootClassValidation } from '../../type-validation/root-class-validation';
|
3
|
+
export type ICvTecUser = Omit<CvTecUser, keyof RootClassValidation>;
|
4
|
+
export declare class CvTecUser extends RootClassValidation {
|
5
|
+
firstname: string;
|
6
|
+
lastname: string;
|
7
|
+
email: string;
|
8
|
+
password: string;
|
9
|
+
constructor(user: ICvTecUser);
|
10
|
+
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
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;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.CvTecUser = void 0;
|
13
|
+
require("reflect-metadata");
|
14
|
+
const class_validator_1 = require("class-validator");
|
15
|
+
const is_bcrypt_hash_1 = require("../../custom-class-validators/is-bcrypt-hash");
|
16
|
+
const root_class_validation_1 = require("../../type-validation/root-class-validation");
|
17
|
+
const is_valid_email_domain_1 = require("../../custom-class-validators/is-valid-email-domain");
|
18
|
+
class CvTecUser extends root_class_validation_1.RootClassValidation {
|
19
|
+
constructor(user) {
|
20
|
+
super(user);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
exports.CvTecUser = CvTecUser;
|
24
|
+
__decorate([
|
25
|
+
(0, class_validator_1.IsNotEmpty)(),
|
26
|
+
(0, class_validator_1.MinLength)(2),
|
27
|
+
(0, class_validator_1.MaxLength)(20),
|
28
|
+
__metadata("design:type", String)
|
29
|
+
], CvTecUser.prototype, "firstname", void 0);
|
30
|
+
__decorate([
|
31
|
+
(0, class_validator_1.IsNotEmpty)(),
|
32
|
+
(0, class_validator_1.MinLength)(2),
|
33
|
+
(0, class_validator_1.MaxLength)(20),
|
34
|
+
__metadata("design:type", String)
|
35
|
+
], CvTecUser.prototype, "lastname", void 0);
|
36
|
+
__decorate([
|
37
|
+
(0, class_validator_1.IsEmail)({ allow_ip_domain: false }),
|
38
|
+
(0, is_valid_email_domain_1.IsValidEmailDomain)(),
|
39
|
+
__metadata("design:type", String)
|
40
|
+
], CvTecUser.prototype, "email", void 0);
|
41
|
+
__decorate([
|
42
|
+
(0, class_validator_1.IsOptional)(),
|
43
|
+
(0, is_bcrypt_hash_1.IsBcryptHash)({}),
|
44
|
+
__metadata("design:type", String)
|
45
|
+
], CvTecUser.prototype, "password", void 0);
|
46
|
+
//# sourceMappingURL=cv-tec-user.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cv-tec-user.js","sourceRoot":"","sources":["../../../src/type-validation/entities/cv-tec-user.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4BAAyB;AACzB,qDAAuF;AACvF,6EAAuE;AACvE,mFAA6E;AAC7E,2FAAoF;AAIpF,MAAa,SAAU,SAAQ,2CAAmB;IAmBhD,YAAY,IAAgB;QAC1B,KAAK,CAAC,IAAI,CAAC,CAAA;IACb,CAAC;CACF;AAtBD,8BAsBC;AAlBC;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,2BAAS,EAAC,EAAE,CAAC;;4CACI;AAKlB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,2BAAS,EAAC,EAAE,CAAC;;2CACG;AAIjB;IAFC,IAAA,yBAAO,EAAC,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;IACnC,IAAA,0CAAkB,GAAE;;wCACP;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,6BAAY,EAAC,EAAE,CAAC;;2CACA"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./cv-tec-user"), exports);
|
18
|
+
__exportStar(require("./cv-info"), exports);
|
19
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/type-validation/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B;AAC7B,4CAAyB"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./common"), exports);
|
18
|
+
__exportStar(require("./entities"), exports);
|
19
|
+
__exportStar(require("./dto"), exports);
|
20
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/type-validation/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,6CAA0B;AAC1B,wCAAqB"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { IAddress, ICoordinates, IIntervalDate, IProfile } from '../common';
|
2
|
+
import { ICategoryDto, ICvInfoDto, IExperienceDto, IFormationDto, IHobbyDto, ILanguageDto, IReferenceDto, ISkillDto, ISkillsContainerDto } from '../dto';
|
3
|
+
import { IMissionDto } from '../dto/cv-info/mission-dto';
|
4
|
+
export declare const intervalDate: IIntervalDate;
|
5
|
+
export declare const address: IAddress;
|
6
|
+
export declare const coordinates: ICoordinates;
|
7
|
+
export declare const profile: IProfile;
|
8
|
+
export declare const formation: IFormationDto;
|
9
|
+
export declare const mission: IMissionDto;
|
10
|
+
export declare const experience: IExperienceDto;
|
11
|
+
export declare const language: ILanguageDto;
|
12
|
+
export declare const refrence: IReferenceDto;
|
13
|
+
export declare const hobby: IHobbyDto;
|
14
|
+
export declare const skill: ISkillDto;
|
15
|
+
export declare const category: ICategoryDto;
|
16
|
+
export declare const skills: ISkillsContainerDto;
|
17
|
+
export declare const cvInfo: ICvInfoDto;
|
@@ -0,0 +1,172 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.cvInfo = exports.skills = exports.category = exports.skill = exports.hobby = exports.refrence = exports.language = exports.experience = exports.mission = exports.formation = exports.profile = exports.coordinates = exports.address = exports.intervalDate = void 0;
|
4
|
+
exports.intervalDate = {
|
5
|
+
start: new Date().toString(),
|
6
|
+
end: new Date().toString(),
|
7
|
+
};
|
8
|
+
exports.address = {
|
9
|
+
city: 'Paris',
|
10
|
+
country: 'France',
|
11
|
+
province: 'Ile de France',
|
12
|
+
street: '1 rue de Rivoli',
|
13
|
+
zipCode: '75000',
|
14
|
+
};
|
15
|
+
exports.coordinates = {
|
16
|
+
address: Object.assign({}, exports.address),
|
17
|
+
email: 'test@gmail.com',
|
18
|
+
phone: '+33769000000',
|
19
|
+
linkedin: 'https://www.linkedin.com',
|
20
|
+
github: 'https://www.github.com',
|
21
|
+
additional_1: 'sdqcqsc',
|
22
|
+
additional_2: 'qqscqsqs',
|
23
|
+
additional_3: 'sdfsdcsd',
|
24
|
+
additional_4: 'qsdqsd',
|
25
|
+
};
|
26
|
+
exports.profile = {
|
27
|
+
coordinates: Object.assign({}, exports.coordinates),
|
28
|
+
about: "bonjour le monde, je m'appelle baracus et je suis développeur",
|
29
|
+
firstname: 'Baracus',
|
30
|
+
lastname: 'Barghod',
|
31
|
+
profileName: 'Dev',
|
32
|
+
};
|
33
|
+
exports.formation = {
|
34
|
+
$id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb68',
|
35
|
+
domain: 'Informatique',
|
36
|
+
intervalDate: {
|
37
|
+
start: new Date().toString(),
|
38
|
+
},
|
39
|
+
establishment: 'Université de Lyon',
|
40
|
+
certification: 'Master en Génie Logiciel',
|
41
|
+
location: 'Lyon',
|
42
|
+
description: 'Acquisition de compétences avancées en développement logiciel et architecture des systèmes.',
|
43
|
+
};
|
44
|
+
exports.mission = {
|
45
|
+
$id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
|
46
|
+
client: 'FinancePro',
|
47
|
+
context: 'Plateforme de gestion de paiements en ligne.',
|
48
|
+
location: 'Lyon',
|
49
|
+
position: 'Développeuse Backend',
|
50
|
+
project: 'Gestion de transactions bancaires',
|
51
|
+
tasks: ['Développement d’un moteur de paiement', 'Sécurisation des données bancaires'],
|
52
|
+
skillsUsed: ['Node.js', 'PostgreSQL', 'CI/CD'],
|
53
|
+
};
|
54
|
+
exports.experience = {
|
55
|
+
$id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
|
56
|
+
company: 'TechCorp',
|
57
|
+
location: 'Paris',
|
58
|
+
intervalDate: {
|
59
|
+
start: new Date().toString(),
|
60
|
+
},
|
61
|
+
context: "Développement d'applications web pour des clients internationaux.",
|
62
|
+
position: 'Développeuse Full Stack',
|
63
|
+
projectName: 'Refonte du site e-commerce',
|
64
|
+
skillsUsed: ['JavaScript', 'React.js', 'Node.js'],
|
65
|
+
tasks: [
|
66
|
+
'Développement frontend et backend',
|
67
|
+
'Optimisation des performances',
|
68
|
+
'Mise en place de tests unitaires',
|
69
|
+
],
|
70
|
+
missions: [
|
71
|
+
Object.assign({}, exports.mission),
|
72
|
+
],
|
73
|
+
};
|
74
|
+
exports.language = {
|
75
|
+
$id: 'fr',
|
76
|
+
level: 1,
|
77
|
+
};
|
78
|
+
exports.refrence = {
|
79
|
+
$id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb77',
|
80
|
+
name: 'Paul Durand',
|
81
|
+
position: 'CTO chez TechCorp',
|
82
|
+
phone: '+33612345678',
|
83
|
+
email: 'paul.durand@techcorp.com',
|
84
|
+
linkedIn: 'https://linkedin.com/test',
|
85
|
+
};
|
86
|
+
exports.hobby = {
|
87
|
+
$id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb77',
|
88
|
+
name: 'Photographie',
|
89
|
+
desciption: "j'aime la photographie en haute montagne et aussi les volcan",
|
90
|
+
};
|
91
|
+
exports.skill = {
|
92
|
+
$id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
|
93
|
+
skillName: 'JavaScript',
|
94
|
+
level: 90,
|
95
|
+
$refCategoryId: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb62',
|
96
|
+
};
|
97
|
+
exports.category = {
|
98
|
+
$id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
|
99
|
+
categoryName: 'test',
|
100
|
+
};
|
101
|
+
exports.skills = {
|
102
|
+
$categories: [
|
103
|
+
{ $id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb77', categoryName: 'Développement Web' },
|
104
|
+
{ $id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb78', categoryName: 'Bases de données' },
|
105
|
+
{ $id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb79', categoryName: 'Outils DevOps' },
|
106
|
+
],
|
107
|
+
$list: [
|
108
|
+
{
|
109
|
+
$id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb80',
|
110
|
+
skillName: 'JavaScript',
|
111
|
+
level: 90,
|
112
|
+
$refCategoryId: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb77',
|
113
|
+
},
|
114
|
+
{
|
115
|
+
$id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb81',
|
116
|
+
skillName: 'React.js',
|
117
|
+
level: 85,
|
118
|
+
$refCategoryId: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb77',
|
119
|
+
},
|
120
|
+
{
|
121
|
+
$id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb82',
|
122
|
+
skillName: 'Node.js',
|
123
|
+
level: 80,
|
124
|
+
$refCategoryId: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb77',
|
125
|
+
},
|
126
|
+
{
|
127
|
+
$id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb83',
|
128
|
+
skillName: 'PostgreSQL',
|
129
|
+
level: 75,
|
130
|
+
$refCategoryId: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb78',
|
131
|
+
},
|
132
|
+
{
|
133
|
+
$id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb84',
|
134
|
+
skillName: 'MongoDB',
|
135
|
+
level: 70,
|
136
|
+
$refCategoryId: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb78',
|
137
|
+
},
|
138
|
+
{
|
139
|
+
$id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb85',
|
140
|
+
skillName: 'Docker',
|
141
|
+
level: 65,
|
142
|
+
$refCategoryId: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb79',
|
143
|
+
},
|
144
|
+
{
|
145
|
+
$id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb86',
|
146
|
+
skillName: 'CI/CD',
|
147
|
+
level: 60,
|
148
|
+
$refCategoryId: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb79',
|
149
|
+
},
|
150
|
+
{ $id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb87', skillName: 'Git', level: 85 },
|
151
|
+
{
|
152
|
+
$id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb88',
|
153
|
+
skillName: 'Agile/Scrum',
|
154
|
+
level: 80,
|
155
|
+
},
|
156
|
+
{
|
157
|
+
$id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb89',
|
158
|
+
skillName: 'Test Driven Development',
|
159
|
+
level: 75,
|
160
|
+
},
|
161
|
+
],
|
162
|
+
};
|
163
|
+
exports.cvInfo = {
|
164
|
+
$ownerId: '1f005a0d-c1cd-6a30-aef7-6485be5a46c8',
|
165
|
+
formations: [Object.assign({}, exports.formation)],
|
166
|
+
profile: Object.assign({}, exports.profile),
|
167
|
+
hobbies: [Object.assign({}, exports.hobby)],
|
168
|
+
languages: [Object.assign({}, exports.language)],
|
169
|
+
references: [Object.assign({}, exports.refrence)],
|
170
|
+
skills: Object.assign({}, exports.skills),
|
171
|
+
};
|
172
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/type-validation/mocks/index.ts"],"names":[],"mappings":";;;AAca,QAAA,YAAY,GAAkB;IACzC,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC5B,GAAG,EAAE,IAAI,IAAI,EAAE,CAAC,QAAQ,EAAE;CAC3B,CAAA;AACY,QAAA,OAAO,GAAa;IAC/B,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,eAAe;IACzB,MAAM,EAAE,iBAAiB;IACzB,OAAO,EAAE,OAAO;CACjB,CAAA;AAEY,QAAA,WAAW,GAAiB;IACvC,OAAO,oBAAO,eAAO,CAAE;IACvB,KAAK,EAAE,gBAAgB;IACvB,KAAK,EAAE,cAAc;IACrB,QAAQ,EAAE,0BAA0B;IACpC,MAAM,EAAE,wBAAwB;IAChC,YAAY,EAAE,SAAS;IACvB,YAAY,EAAE,UAAU;IACxB,YAAY,EAAE,UAAU;IACxB,YAAY,EAAE,QAAQ;CACvB,CAAA;AAEY,QAAA,OAA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AE,EAAE;YACT,cAAc,EAAE,sCAAsC;SACvD;QACD;YACE,GAAG,EAAE,sCAAsC;YAC3C,SAAS,EAAE,SAAS;YACpB,KAAK,EAAE,EAAE;YACT,cAAc,EAAE,sCAAsC;SACvD;QACD;YACE,GAAG,EAAE,sCAAsC;YAC3C,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,EAAE;YACT,cAAc,EAAE,sCAAsC;SACvD;QACD;YACE,GAAG,EAAE,sCAAsC;YAC3C,SAAS,EAAE,OAAO;YAClB,KAAK,EAAE,EAAE;YACT,cAAc,EAAE,sCAAsC;SACvD;QACD,EAAE,GAAG,EAAE,sCAAsC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;QAC5E;YACE,GAAG,EAAE,sCAAsC;YAC3C,SAAS,EAAE,aAAa;YACxB,KAAK,EAAE,EAAE;SACV;QACD;YACE,GAAG,EAAE,sCAAsC;YAC3C,SAAS,EAAE,yBAAyB;YACpC,KAAK,EAAE,EAAE;SACV;KACF;CACF,CAAA;AAEY,QAAA,MAAM,GAAe;IAChC,QAAQ,EAAE,sCAAsC;IAChD,UAAU,EAAE,mBAAM,iBAAS,EAAG;IAC9B,OAAO,oBAAO,eAAO,CAAE;IACvB,OAAO,EAAE,mBAAM,aAAK,EAAG;IACvB,SAAS,EAAE,mBAAM,gBAAQ,EAAG;IAC5B,UAAU,EAAE,mBAAM,gBAAQ,EAAG;IAC7B,MAAM,oBAAO,cAAM,CAAE;CACtB,CAAA"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { ValidationError } from 'class-validator';
|
2
|
+
export interface IValidationOptions {
|
3
|
+
parse: boolean;
|
4
|
+
whitelist: boolean;
|
5
|
+
forbidNonWhitelisted: boolean;
|
6
|
+
skipMissingProperties: boolean;
|
7
|
+
}
|
8
|
+
export declare abstract class RootClassValidation {
|
9
|
+
/**
|
10
|
+
*
|
11
|
+
* @param obj
|
12
|
+
*/
|
13
|
+
constructor(obj?: object);
|
14
|
+
/**
|
15
|
+
*
|
16
|
+
* @returns
|
17
|
+
*/
|
18
|
+
validate(options?: Partial<IValidationOptions>): Promise<ValidationError[] | string[]>;
|
19
|
+
/**
|
20
|
+
*
|
21
|
+
* @param validationError
|
22
|
+
* @returns
|
23
|
+
*/
|
24
|
+
private parseValidationError;
|
25
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
3
|
+
var t = {};
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
5
|
+
t[p] = s[p];
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
9
|
+
t[p[i]] = s[p[i]];
|
10
|
+
}
|
11
|
+
return t;
|
12
|
+
};
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
14
|
+
exports.RootClassValidation = void 0;
|
15
|
+
const class_transformer_1 = require("class-transformer");
|
16
|
+
const class_validator_1 = require("class-validator");
|
17
|
+
class RootClassValidation {
|
18
|
+
/**
|
19
|
+
*
|
20
|
+
* @param obj
|
21
|
+
*/
|
22
|
+
constructor(obj) {
|
23
|
+
if (obj)
|
24
|
+
Object.assign(this, (0, class_transformer_1.plainToInstance)(this.constructor, obj));
|
25
|
+
}
|
26
|
+
/**
|
27
|
+
*
|
28
|
+
* @returns
|
29
|
+
*/
|
30
|
+
async validate(options) {
|
31
|
+
const _options = Object.assign({ parse: true, forbidNonWhitelisted: true, whitelist: true, skipMissingProperties: false }, options);
|
32
|
+
const { parse } = _options, otherOptions = __rest(_options, ["parse"]);
|
33
|
+
const errors = await (0, class_validator_1.validate)(this, otherOptions);
|
34
|
+
if (!parse) {
|
35
|
+
return errors;
|
36
|
+
}
|
37
|
+
return errors.map((err) => this.parseValidationError('', err)).flat();
|
38
|
+
}
|
39
|
+
/**
|
40
|
+
*
|
41
|
+
* @param validationError
|
42
|
+
* @returns
|
43
|
+
*/
|
44
|
+
parseValidationError(parent, validationError) {
|
45
|
+
const { constraints, children, property } = validationError;
|
46
|
+
const allError = [];
|
47
|
+
if (children) {
|
48
|
+
allError.push(...children
|
49
|
+
.map((child) => this.parseValidationError(parent ? `${parent}.${property}` : property, child).flat())
|
50
|
+
.flat());
|
51
|
+
}
|
52
|
+
if (constraints) {
|
53
|
+
allError.push(...Object.keys(constraints).map((c) => {
|
54
|
+
return parent ? `${parent}.${property}.${c}` : `${property}.${c}`;
|
55
|
+
}));
|
56
|
+
}
|
57
|
+
return allError;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
exports.RootClassValidation = RootClassValidation;
|
61
|
+
//# sourceMappingURL=root-class-validation.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"root-class-validation.js","sourceRoot":"","sources":["../../src/type-validation/root-class-validation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,yDAAqE;AACrE,qDAA2D;AAQ3D,MAAsB,mBAAmB;IACvC;;;OAGG;IACH,YAAY,GAAY;QACtB,IAAI,GAAG;YACL,MAAM,CAAC,MAAM,CACX,IAAI,EACJ,IAAA,mCAAe,EAAC,IAAI,CAAC,WAAqC,EAAE,GAAG,CAAC,CACjE,CAAA;IACL,CAAC;IACD;;;OAGG;IACH,KAAK,CAAC,QAAQ,CAAC,OAAqC;QAClD,MAAM,QAAQ,mBACZ,KAAK,EAAE,IAAI,EACX,oBAAoB,EAAE,IAAI,EAC1B,SAAS,EAAE,IAAI,EACf,qBAAqB,EAAE,KAAK,IACzB,OAAO,CACX,CAAA;QAED,MAAM,EAAE,KAAK,KAAsB,QAAQ,EAAzB,YAAY,UAAK,QAAQ,EAArC,SAA0B,CAAW,CAAA;QAC3C,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAQ,EAAC,IAAI,EAA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IMapArrayFieldsToObjet {
|
6
|
+
keyCondition: (str: string) => boolean;
|
7
|
+
valCondition: (o: object) => boolean;
|
8
|
+
}
|
9
|
+
/**
|
10
|
+
*
|
11
|
+
* @param obj
|
12
|
+
* @param optionsParam
|
13
|
+
* @returns
|
14
|
+
*/
|
15
|
+
export declare const mapObjectFieldToArray: (obj: object, optionsParam?: Partial<IMapObjectFieldToArray>) => unknown;
|
16
|
+
/**
|
17
|
+
*
|
18
|
+
* @param obj
|
19
|
+
* @param optionsParam
|
20
|
+
* @returns
|
21
|
+
*/
|
22
|
+
export declare const mapArrayFieldsToObjet: (obj: object, optionsParam?: Partial<IMapArrayFieldsToObjet>) => unknown;
|
23
|
+
export {};
|