@cv-tec/validations 0.0.5 → 0.0.6
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/entities/cv-tec-user.d.ts +2 -1
- package/dist/entities/cv-tec-user.js +3 -2
- package/dist/entities/cv-tec-user.js.map +1 -1
- package/dist/entities/entity.d.ts +4 -0
- package/dist/entities/entity.js +14 -0
- package/dist/entities/entity.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
@@ -1,10 +1,11 @@
|
|
1
|
+
import { Entity } from './entity';
|
1
2
|
export interface ICvTecUser {
|
2
3
|
firstname: string;
|
3
4
|
lastname: string;
|
4
5
|
email: string;
|
5
6
|
password: string;
|
6
7
|
}
|
7
|
-
export declare class CvTecUser {
|
8
|
+
export declare class CvTecUser extends Entity<ICvTecUser> {
|
8
9
|
firstname: string;
|
9
10
|
lastname: string;
|
10
11
|
email: string;
|
@@ -13,9 +13,10 @@ exports.CvTecUser = void 0;
|
|
13
13
|
const class_validator_1 = require("class-validator");
|
14
14
|
// import { IsValidEmailDomain } from '../custom-class-validators/is-validate-email-domain'
|
15
15
|
const is_bcrypt_hash_1 = require("../custom-class-validators/is-bcrypt-hash");
|
16
|
-
|
16
|
+
const entity_1 = require("./entity");
|
17
|
+
class CvTecUser extends entity_1.Entity {
|
17
18
|
constructor(user) {
|
18
|
-
|
19
|
+
super(user);
|
19
20
|
}
|
20
21
|
}
|
21
22
|
exports.CvTecUser = CvTecUser;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cv-tec-user.js","sourceRoot":"","sources":["../../src/entities/cv-tec-user.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2E;AAC3E,2FAA2F;AAC3F,8EAAwE;
|
1
|
+
{"version":3,"file":"cv-tec-user.js","sourceRoot":"","sources":["../../src/entities/cv-tec-user.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA2E;AAC3E,2FAA2F;AAC3F,8EAAwE;AACxE,qCAAiC;AAQjC,MAAa,SAAU,SAAQ,eAAkB;IAuB/C,YAAY,IAAgB;QAC1B,KAAK,CAAC,IAAI,CAAC,CAAA;IACb,CAAC;CACF;AA1BD,8BA0BC;AAtBC;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,GAAE;IACV,uBAAuB;;;wCACT;AAQd;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,6BAAY,GAAE;;2CACE"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.Entity = void 0;
|
4
|
+
const class_validator_1 = require("class-validator");
|
5
|
+
class Entity {
|
6
|
+
constructor(props) {
|
7
|
+
Object.entries(props).forEach((e) => (this[e[0]] = e[1]));
|
8
|
+
}
|
9
|
+
async validate() {
|
10
|
+
return (0, class_validator_1.validate)(this);
|
11
|
+
}
|
12
|
+
}
|
13
|
+
exports.Entity = Entity;
|
14
|
+
//# sourceMappingURL=entity.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../src/entities/entity.ts"],"names":[],"mappings":";;;AAAA,qDAA0C;AAE1C,MAAsB,MAAM;IAC1B,YAAY,KAAQ;QAClB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3D,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,OAAO,IAAA,0BAAQ,EAAC,IAAI,CAAC,CAAA;IACvB,CAAC;CACF;AARD,wBAQC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.CvTecUser = void 0;
|
3
|
+
exports.Entity = exports.CvTecUser = void 0;
|
4
4
|
var cv_tec_user_1 = require("./entities/cv-tec-user");
|
5
5
|
Object.defineProperty(exports, "CvTecUser", { enumerable: true, get: function () { return cv_tec_user_1.CvTecUser; } });
|
6
|
+
var entity_1 = require("./entities/entity");
|
7
|
+
Object.defineProperty(exports, "Entity", { enumerable: true, get: function () { return entity_1.Entity; } });
|
6
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,sDAA8D;AAArD,wGAAA,SAAS,OAAA"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,sDAA8D;AAArD,wGAAA,SAAS,OAAA;AAClB,4CAA0C;AAAjC,gGAAA,MAAM,OAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@cv-tec/validations",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.6",
|
4
4
|
"private": false,
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"types": "./dist/index.d.ts",
|
@@ -14,9 +14,9 @@
|
|
14
14
|
"dev": "nodemon",
|
15
15
|
"build": "tsc --project tsconfig.build.json && tsc-alias -p tsconfig.build.json",
|
16
16
|
"build:dev": "nodemon --config nodemon.dev.json",
|
17
|
-
"publish:patch": "npm version patch && npm run build && npm publish
|
18
|
-
"publish:minor": "npm version minor && npm run build && npm publish
|
19
|
-
"publish:major": "npm version major && npm run build && npm publish
|
17
|
+
"publish:patch": "npm version patch && npm run build && npm publish",
|
18
|
+
"publish:minor": "npm version minor && npm run build && npm publish",
|
19
|
+
"publish:major": "npm version major && npm run build && npm publish"
|
20
20
|
},
|
21
21
|
"author": "",
|
22
22
|
"license": "ISC",
|