easywork-common-lib 1.0.0 → 1.0.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.
Files changed (37) hide show
  1. package/dist/eslint.config.d.ts +2 -0
  2. package/dist/eslint.config.js +47 -0
  3. package/dist/eslint.config.js.map +1 -0
  4. package/dist/src/common/database/base.entity.d.ts +9 -0
  5. package/dist/src/common/database/base.entity.js +83 -0
  6. package/dist/src/common/database/base.entity.js.map +1 -0
  7. package/dist/src/common/database/index.d.ts +1 -0
  8. package/dist/src/common/database/index.js +18 -0
  9. package/dist/src/common/database/index.js.map +1 -0
  10. package/dist/src/entities/group.entity.d.ts +4 -0
  11. package/dist/src/entities/group.entity.js +36 -0
  12. package/dist/src/entities/group.entity.js.map +1 -0
  13. package/dist/src/entities/index.d.ts +7 -0
  14. package/dist/src/entities/index.js +24 -0
  15. package/dist/src/entities/index.js.map +1 -0
  16. package/dist/src/entities/otp-log.entity.d.ts +8 -0
  17. package/dist/src/entities/otp-log.entity.js +67 -0
  18. package/dist/src/entities/otp-log.entity.js.map +1 -0
  19. package/dist/src/entities/permission.entity.d.ts +7 -0
  20. package/dist/src/entities/permission.entity.js +60 -0
  21. package/dist/src/entities/permission.entity.js.map +1 -0
  22. package/dist/src/entities/profile.entity.d.ts +9 -0
  23. package/dist/src/entities/profile.entity.js +78 -0
  24. package/dist/src/entities/profile.entity.js.map +1 -0
  25. package/dist/src/entities/protocol.entity.d.ts +8 -0
  26. package/dist/src/entities/protocol.entity.js +66 -0
  27. package/dist/src/entities/protocol.entity.js.map +1 -0
  28. package/dist/src/entities/refresh-token.entity.d.ts +8 -0
  29. package/dist/src/entities/refresh-token.entity.js +61 -0
  30. package/dist/src/entities/refresh-token.entity.js.map +1 -0
  31. package/dist/src/entities/role.entity.d.ts +5 -0
  32. package/dist/src/entities/role.entity.js +46 -0
  33. package/dist/src/entities/role.entity.js.map +1 -0
  34. package/dist/src/entities/user.entity.d.ts +17 -0
  35. package/dist/src/entities/user.entity.js +157 -0
  36. package/dist/src/entities/user.entity.js.map +1 -0
  37. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ declare const _exports: any;
2
+ export = _exports;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const rubiin = require("@antfu/eslint-config").default;
4
+ module.exports = rubiin({
5
+ stylistic: {
6
+ semi: true,
7
+ quotes: "double",
8
+ },
9
+ yaml: true,
10
+ jsonc: true,
11
+ markdown: false,
12
+ gitignore: true,
13
+ typescript: {
14
+ tsconfigPath: "tsconfig.json",
15
+ },
16
+ overrides: {
17
+ test: {
18
+ "ts/unbound-method": "off",
19
+ },
20
+ typescript: {
21
+ "ts/no-misused-promises": [
22
+ "error",
23
+ {
24
+ checksVoidReturn: false,
25
+ },
26
+ ],
27
+ "ts/no-floating-promises": [
28
+ "error",
29
+ {
30
+ ignoreIIFE: true,
31
+ },
32
+ ],
33
+ "unicorn/prefer-top-level-await": "off",
34
+ "unicorn/prevent-abbreviations": [
35
+ "error",
36
+ {
37
+ ignore: ["\\.e2e*", "\\.spec*", "\\.decorator*", "\\*idx*"],
38
+ allowList: {
39
+ ProcessEnv: true,
40
+ UUIDParam: true,
41
+ },
42
+ },
43
+ ],
44
+ },
45
+ },
46
+ });
47
+ //# sourceMappingURL=eslint.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eslint.config.js","sourceRoot":"","sources":["../eslint.config.js"],"names":[],"mappings":";;AAAA,MAAM,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAAC;AAEvD,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC;IACtB,SAAS,EAAE;QACT,IAAI,EAAE,IAAI;QACV,MAAM,EAAE,QAAQ;KACjB;IACD,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;IACX,QAAQ,EAAE,KAAK;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV,YAAY,EAAE,eAAe;KAC9B;IACD,SAAS,EAAE;QACT,IAAI,EAAE;YACJ,mBAAmB,EAAE,KAAK;SAC3B;QACD,UAAU,EAAE;YACV,wBAAwB,EAAE;gBACxB,OAAO;gBACP;oBACE,gBAAgB,EAAE,KAAK;iBACxB;aACF;YACD,yBAAyB,EAAE;gBACzB,OAAO;gBACP;oBACE,UAAU,EAAE,IAAI;iBACjB;aACF;YACD,gCAAgC,EAAE,KAAK;YACvC,+BAA+B,EAAE;gBAC/B,OAAO;gBACP;oBACE,MAAM,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC;oBAC3D,SAAS,EAAE;wBACT,UAAU,EAAE,IAAI;wBAChB,SAAS,EAAE,IAAI;qBAChB;iBACF;aACF;SACF;KACF;CACF,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { BaseEntity as EntityBase } from "typeorm";
2
+ export declare abstract class BaseEntity extends EntityBase {
3
+ id?: string;
4
+ isActive?: boolean;
5
+ isDeleted?: boolean;
6
+ createdAt?: Date;
7
+ updatedAt?: Date;
8
+ deletedAt?: Date;
9
+ }
@@ -0,0 +1,83 @@
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.BaseEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ let BaseEntity = class BaseEntity extends typeorm_1.BaseEntity {
15
+ constructor() {
16
+ super(...arguments);
17
+ Object.defineProperty(this, "id", {
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true,
21
+ value: void 0
22
+ });
23
+ Object.defineProperty(this, "isActive", {
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true,
27
+ value: void 0
28
+ });
29
+ Object.defineProperty(this, "isDeleted", {
30
+ enumerable: true,
31
+ configurable: true,
32
+ writable: true,
33
+ value: void 0
34
+ });
35
+ Object.defineProperty(this, "createdAt", {
36
+ enumerable: true,
37
+ configurable: true,
38
+ writable: true,
39
+ value: void 0
40
+ });
41
+ Object.defineProperty(this, "updatedAt", {
42
+ enumerable: true,
43
+ configurable: true,
44
+ writable: true,
45
+ value: void 0
46
+ });
47
+ Object.defineProperty(this, "deletedAt", {
48
+ enumerable: true,
49
+ configurable: true,
50
+ writable: true,
51
+ value: void 0
52
+ });
53
+ }
54
+ };
55
+ exports.BaseEntity = BaseEntity;
56
+ __decorate([
57
+ (0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
58
+ __metadata("design:type", String)
59
+ ], BaseEntity.prototype, "id", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.Column)({ default: true }),
62
+ __metadata("design:type", Boolean)
63
+ ], BaseEntity.prototype, "isActive", void 0);
64
+ __decorate([
65
+ (0, typeorm_1.Column)({ default: false }),
66
+ __metadata("design:type", Boolean)
67
+ ], BaseEntity.prototype, "isDeleted", void 0);
68
+ __decorate([
69
+ (0, typeorm_1.CreateDateColumn)(),
70
+ __metadata("design:type", Date)
71
+ ], BaseEntity.prototype, "createdAt", void 0);
72
+ __decorate([
73
+ (0, typeorm_1.UpdateDateColumn)(),
74
+ __metadata("design:type", Date)
75
+ ], BaseEntity.prototype, "updatedAt", void 0);
76
+ __decorate([
77
+ (0, typeorm_1.DeleteDateColumn)(),
78
+ __metadata("design:type", Date)
79
+ ], BaseEntity.prototype, "deletedAt", void 0);
80
+ exports.BaseEntity = BaseEntity = __decorate([
81
+ (0, typeorm_1.Entity)()
82
+ ], BaseEntity);
83
+ //# sourceMappingURL=base.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.entity.js","sourceRoot":"","sources":["../../../../src/common/database/base.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAQiB;AAGV,IAAe,UAAU,GAAzB,MAAe,UAAW,SAAQ,oBAAU;IAA5C;;QAEL;;;;;WAAY;QAGZ;;;;;WAAmB;QAGnB;;;;;WAAoB;QAGpB;;;;;WAAiB;QAGjB;;;;;WAAiB;QAGjB;;;;;WAAiB;IACnB,CAAC;CAAA,CAAA;AAlBqB,gCAAU;AAE9B;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;sCACnB;AAGZ;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;4CACP;AAGnB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;6CACP;AAGpB;IADC,IAAA,0BAAgB,GAAE;8BACP,IAAI;6CAAC;AAGjB;IADC,IAAA,0BAAgB,GAAE;8BACP,IAAI;6CAAC;AAGjB;IADC,IAAA,0BAAgB,GAAE;8BACP,IAAI;6CAAC;qBAjBG,UAAU;IAD/B,IAAA,gBAAM,GAAE;GACa,UAAU,CAkB/B"}
@@ -0,0 +1 @@
1
+ export * from "./base.entity";
@@ -0,0 +1,18 @@
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("./base.entity"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/common/database/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B"}
@@ -0,0 +1,4 @@
1
+ import { BaseEntity } from "@common/database";
2
+ export declare class Group extends BaseEntity {
3
+ name: string;
4
+ }
@@ -0,0 +1,36 @@
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.Group = void 0;
13
+ const database_1 = require("@common/database");
14
+ const class_validator_1 = require("class-validator");
15
+ const typeorm_1 = require("typeorm");
16
+ let Group = class Group extends database_1.BaseEntity {
17
+ constructor() {
18
+ super(...arguments);
19
+ Object.defineProperty(this, "name", {
20
+ enumerable: true,
21
+ configurable: true,
22
+ writable: true,
23
+ value: void 0
24
+ });
25
+ }
26
+ };
27
+ exports.Group = Group;
28
+ __decorate([
29
+ (0, class_validator_1.MinLength)(3),
30
+ (0, typeorm_1.Column)({ unique: true }),
31
+ __metadata("design:type", String)
32
+ ], Group.prototype, "name", void 0);
33
+ exports.Group = Group = __decorate([
34
+ (0, typeorm_1.Entity)()
35
+ ], Group);
36
+ //# sourceMappingURL=group.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"group.entity.js","sourceRoot":"","sources":["../../../src/entities/group.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA8C;AAC9C,qDAA4C;AAC5C,qCAAyC;AAGlC,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,qBAAU;IAA9B;;QAGL;;;;;WAAa;IACf,CAAC;CAAA,CAAA;AAJY,sBAAK;AAGhB;IAFC,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;mCACZ;gBAHF,KAAK;IADjB,IAAA,gBAAM,GAAE;GACI,KAAK,CAIjB"}
@@ -0,0 +1,7 @@
1
+ export * from "./user.entity";
2
+ export * from "./protocol.entity";
3
+ export * from "./otp-log.entity";
4
+ export * from "./refresh-token.entity";
5
+ export * from "./profile.entity";
6
+ export * from "./role.entity";
7
+ export * from "./permission.entity";
@@ -0,0 +1,24 @@
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("./user.entity"), exports);
18
+ __exportStar(require("./protocol.entity"), exports);
19
+ __exportStar(require("./otp-log.entity"), exports);
20
+ __exportStar(require("./refresh-token.entity"), exports);
21
+ __exportStar(require("./profile.entity"), exports);
22
+ __exportStar(require("./role.entity"), exports);
23
+ __exportStar(require("./permission.entity"), exports);
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,oDAAkC;AAClC,mDAAiC;AACjC,yDAAuC;AACvC,mDAAiC;AACjC,gDAA8B;AAC9B,sDAAoC"}
@@ -0,0 +1,8 @@
1
+ import { BaseEntity } from "@common/database";
2
+ import { User } from "./user.entity";
3
+ export declare class OtpLog extends BaseEntity {
4
+ expiresIn: Date;
5
+ otpCode?: string;
6
+ user: User;
7
+ isUsed?: boolean;
8
+ }
@@ -0,0 +1,67 @@
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.OtpLog = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const database_1 = require("@common/database");
15
+ const user_entity_1 = require("./user.entity");
16
+ let OtpLog = class OtpLog extends database_1.BaseEntity {
17
+ constructor() {
18
+ super(...arguments);
19
+ Object.defineProperty(this, "expiresIn", {
20
+ enumerable: true,
21
+ configurable: true,
22
+ writable: true,
23
+ value: void 0
24
+ });
25
+ Object.defineProperty(this, "otpCode", {
26
+ enumerable: true,
27
+ configurable: true,
28
+ writable: true,
29
+ value: void 0
30
+ });
31
+ Object.defineProperty(this, "user", {
32
+ enumerable: true,
33
+ configurable: true,
34
+ writable: true,
35
+ value: void 0
36
+ });
37
+ Object.defineProperty(this, "isUsed", {
38
+ enumerable: true,
39
+ configurable: true,
40
+ writable: true,
41
+ value: void 0
42
+ });
43
+ }
44
+ };
45
+ exports.OtpLog = OtpLog;
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ type: "timestamp" }),
48
+ __metadata("design:type", Date)
49
+ ], OtpLog.prototype, "expiresIn", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.Column)({ length: 20, nullable: true }),
52
+ __metadata("design:type", String)
53
+ ], OtpLog.prototype, "otpCode", void 0);
54
+ __decorate([
55
+ (0, typeorm_1.ManyToOne)(() => user_entity_1.User, { eager: false, nullable: false }),
56
+ (0, typeorm_1.JoinColumn)(),
57
+ __metadata("design:type", user_entity_1.User)
58
+ ], OtpLog.prototype, "user", void 0);
59
+ __decorate([
60
+ (0, typeorm_1.Column)({ default: false }),
61
+ __metadata("design:type", Boolean)
62
+ ], OtpLog.prototype, "isUsed", void 0);
63
+ exports.OtpLog = OtpLog = __decorate([
64
+ (0, typeorm_1.Entity)(),
65
+ (0, typeorm_1.Index)(["otpCode"], { unique: true })
66
+ ], OtpLog);
67
+ //# sourceMappingURL=otp-log.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"otp-log.entity.js","sourceRoot":"","sources":["../../../src/entities/otp-log.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuE;AACvE,+CAA8C;AAC9C,+CAAqC;AAI9B,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,qBAAU;IAA/B;;QAEL;;;;;WAAiB;QAGjB;;;;;WAAiB;QAIjB;;;;;WAAY;QAGZ;;;;;WAAiB;IACnB,CAAC;CAAA,CAAA;AAbY,wBAAM;AAEjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BAClB,IAAI;yCAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCACtB;AAIjB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IACxD,IAAA,oBAAU,GAAE;8BACN,kBAAI;oCAAC;AAGZ;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;sCACV;iBAZN,MAAM;IAFlB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GACxB,MAAM,CAalB"}
@@ -0,0 +1,7 @@
1
+ import { BaseEntity } from "@common/database";
2
+ import { Role } from "./role.entity";
3
+ export declare class Permission extends BaseEntity {
4
+ resource: string;
5
+ action: string;
6
+ roles?: Role[];
7
+ }
@@ -0,0 +1,60 @@
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.Permission = void 0;
13
+ const database_1 = require("@common/database");
14
+ const typeorm_1 = require("typeorm");
15
+ const role_entity_1 = require("./role.entity");
16
+ let Permission = class Permission extends database_1.BaseEntity {
17
+ constructor() {
18
+ super(...arguments);
19
+ Object.defineProperty(this, "resource", {
20
+ enumerable: true,
21
+ configurable: true,
22
+ writable: true,
23
+ value: void 0
24
+ });
25
+ Object.defineProperty(this, "action", {
26
+ enumerable: true,
27
+ configurable: true,
28
+ writable: true,
29
+ value: void 0
30
+ });
31
+ Object.defineProperty(this, "roles", {
32
+ enumerable: true,
33
+ configurable: true,
34
+ writable: true,
35
+ value: void 0
36
+ });
37
+ }
38
+ };
39
+ exports.Permission = Permission;
40
+ __decorate([
41
+ (0, typeorm_1.Column)(),
42
+ __metadata("design:type", String)
43
+ ], Permission.prototype, "resource", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)(),
46
+ __metadata("design:type", String)
47
+ ], Permission.prototype, "action", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.ManyToMany)(() => role_entity_1.Role, {
50
+ onDelete: "CASCADE",
51
+ onUpdate: "CASCADE",
52
+ }),
53
+ (0, typeorm_1.JoinTable)(),
54
+ __metadata("design:type", Array)
55
+ ], Permission.prototype, "roles", void 0);
56
+ exports.Permission = Permission = __decorate([
57
+ (0, typeorm_1.Entity)(),
58
+ (0, typeorm_1.Index)(["resource", "action"], { unique: true })
59
+ ], Permission);
60
+ //# sourceMappingURL=permission.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permission.entity.js","sourceRoot":"","sources":["../../../src/entities/permission.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA8C;AAC9C,qCAAuE;AACvE,+CAAqC;AAI9B,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,qBAAU;IAAnC;;QAEL;;;;;WAAiB;QAGjB;;;;;WAAe;QAOf;;;;;WAAe;IACjB,CAAC;CAAA,CAAA;AAbY,gCAAU;AAErB;IADC,IAAA,gBAAM,GAAE;;4CACQ;AAGjB;IADC,IAAA,gBAAM,GAAE;;0CACM;AAOf;IALC,IAAA,oBAAU,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE;QACtB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,IAAA,mBAAS,GAAE;;yCACG;qBAZJ,UAAU;IAFtB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GACnC,UAAU,CAatB"}
@@ -0,0 +1,9 @@
1
+ import { BaseEntity } from "@common/database";
2
+ import { User } from "./user.entity";
3
+ export declare class Profile extends BaseEntity {
4
+ firstName: string;
5
+ lastName: string;
6
+ idcard: string;
7
+ birthday: Date;
8
+ user: User;
9
+ }
@@ -0,0 +1,78 @@
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.Profile = void 0;
13
+ const database_1 = require("@common/database");
14
+ const typeorm_1 = require("typeorm");
15
+ const user_entity_1 = require("./user.entity");
16
+ let Profile = class Profile extends database_1.BaseEntity {
17
+ constructor() {
18
+ super(...arguments);
19
+ Object.defineProperty(this, "firstName", {
20
+ enumerable: true,
21
+ configurable: true,
22
+ writable: true,
23
+ value: void 0
24
+ });
25
+ Object.defineProperty(this, "lastName", {
26
+ enumerable: true,
27
+ configurable: true,
28
+ writable: true,
29
+ value: void 0
30
+ });
31
+ Object.defineProperty(this, "idcard", {
32
+ enumerable: true,
33
+ configurable: true,
34
+ writable: true,
35
+ value: void 0
36
+ });
37
+ Object.defineProperty(this, "birthday", {
38
+ enumerable: true,
39
+ configurable: true,
40
+ writable: true,
41
+ value: void 0
42
+ });
43
+ Object.defineProperty(this, "user", {
44
+ enumerable: true,
45
+ configurable: true,
46
+ writable: true,
47
+ value: void 0
48
+ });
49
+ }
50
+ };
51
+ exports.Profile = Profile;
52
+ __decorate([
53
+ (0, typeorm_1.Column)(),
54
+ __metadata("design:type", String)
55
+ ], Profile.prototype, "firstName", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Column)(),
58
+ __metadata("design:type", String)
59
+ ], Profile.prototype, "lastName", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.Column)({ unique: true }),
62
+ __metadata("design:type", String)
63
+ ], Profile.prototype, "idcard", void 0);
64
+ __decorate([
65
+ (0, typeorm_1.Column)({ nullable: true }),
66
+ __metadata("design:type", Date)
67
+ ], Profile.prototype, "birthday", void 0);
68
+ __decorate([
69
+ (0, typeorm_1.OneToOne)(() => user_entity_1.User, user => user.profile, {
70
+ onDelete: "CASCADE",
71
+ onUpdate: "CASCADE",
72
+ }),
73
+ __metadata("design:type", user_entity_1.User)
74
+ ], Profile.prototype, "user", void 0);
75
+ exports.Profile = Profile = __decorate([
76
+ (0, typeorm_1.Entity)("user_profile")
77
+ ], Profile);
78
+ //# sourceMappingURL=profile.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.entity.js","sourceRoot":"","sources":["../../../src/entities/profile.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA8C;AAC9C,qCAAmD;AACnD,+CAAqC;AAG9B,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,qBAAU;IAAhC;;QAEL;;;;;WAAkB;QAGlB;;;;;WAAiB;QAGjB;;;;;WAAe;QAGf;;;;;WAAe;QAMf;;;;;WAAW;IACb,CAAC;CAAA,CAAA;AAlBY,0BAAO;AAElB;IADC,IAAA,gBAAM,GAAE;;0CACS;AAGlB;IADC,IAAA,gBAAM,GAAE;;yCACQ;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;uCACV;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BACjB,IAAI;yCAAC;AAMf;IAJC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE;QAC1C,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;KACpB,CAAC;8BACI,kBAAI;qCAAC;kBAjBA,OAAO;IADnB,IAAA,gBAAM,EAAC,cAAc,CAAC;GACV,OAAO,CAkBnB"}
@@ -0,0 +1,8 @@
1
+ import { BaseEntity } from "@common/database";
2
+ export declare class Protocol extends BaseEntity {
3
+ loginAttemptInterval: number;
4
+ loginIntervalUnit: string;
5
+ loginMaxRetry: number;
6
+ otpExpiryInMinutes: number;
7
+ constructor(partial?: Partial<Protocol>);
8
+ }
@@ -0,0 +1,66 @@
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.Protocol = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const database_1 = require("@common/database");
15
+ let Protocol = class Protocol extends database_1.BaseEntity {
16
+ constructor(partial) {
17
+ super();
18
+ Object.defineProperty(this, "loginAttemptInterval", {
19
+ enumerable: true,
20
+ configurable: true,
21
+ writable: true,
22
+ value: void 0
23
+ });
24
+ Object.defineProperty(this, "loginIntervalUnit", {
25
+ enumerable: true,
26
+ configurable: true,
27
+ writable: true,
28
+ value: void 0
29
+ });
30
+ Object.defineProperty(this, "loginMaxRetry", {
31
+ enumerable: true,
32
+ configurable: true,
33
+ writable: true,
34
+ value: void 0
35
+ });
36
+ Object.defineProperty(this, "otpExpiryInMinutes", {
37
+ enumerable: true,
38
+ configurable: true,
39
+ writable: true,
40
+ value: void 0
41
+ });
42
+ Object.assign(this, partial);
43
+ }
44
+ };
45
+ exports.Protocol = Protocol;
46
+ __decorate([
47
+ (0, typeorm_1.Column)(),
48
+ __metadata("design:type", Number)
49
+ ], Protocol.prototype, "loginAttemptInterval", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.Column)(),
52
+ __metadata("design:type", String)
53
+ ], Protocol.prototype, "loginIntervalUnit", void 0);
54
+ __decorate([
55
+ (0, typeorm_1.Column)(),
56
+ __metadata("design:type", Number)
57
+ ], Protocol.prototype, "loginMaxRetry", void 0);
58
+ __decorate([
59
+ (0, typeorm_1.Column)(),
60
+ __metadata("design:type", Number)
61
+ ], Protocol.prototype, "otpExpiryInMinutes", void 0);
62
+ exports.Protocol = Protocol = __decorate([
63
+ (0, typeorm_1.Entity)(),
64
+ __metadata("design:paramtypes", [Object])
65
+ ], Protocol);
66
+ //# sourceMappingURL=protocol.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.entity.js","sourceRoot":"","sources":["../../../src/entities/protocol.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAyC;AACzC,+CAA8C;AAKvC,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,qBAAU;IAatC,YAAY,OAA2B;QACrC,KAAK,EAAE,CAAC;QAZV;;;;;WAA8B;QAG9B;;;;;WAA2B;QAG3B;;;;;WAAuB;QAGvB;;;;;WAA4B;QAI1B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;CACF,CAAA;AAjBY,4BAAQ;AAEnB;IADC,IAAA,gBAAM,GAAE;;sDACqB;AAG9B;IADC,IAAA,gBAAM,GAAE;;mDACkB;AAG3B;IADC,IAAA,gBAAM,GAAE;;+CACc;AAGvB;IADC,IAAA,gBAAM,GAAE;;oDACmB;mBAXjB,QAAQ;IADpB,IAAA,gBAAM,GAAE;;GACI,QAAQ,CAiBpB"}
@@ -0,0 +1,8 @@
1
+ import { BaseEntity } from "@common/database";
2
+ import { User } from "./user.entity";
3
+ export declare class RefreshToken extends BaseEntity {
4
+ expiresIn: Date;
5
+ user: User;
6
+ isRevoked?: boolean;
7
+ constructor(partial?: Partial<RefreshToken>);
8
+ }
@@ -0,0 +1,61 @@
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.RefreshToken = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const database_1 = require("@common/database");
15
+ const user_entity_1 = require("./user.entity");
16
+ let RefreshToken = class RefreshToken extends database_1.BaseEntity {
17
+ constructor(partial) {
18
+ super();
19
+ Object.defineProperty(this, "expiresIn", {
20
+ enumerable: true,
21
+ configurable: true,
22
+ writable: true,
23
+ value: void 0
24
+ });
25
+ Object.defineProperty(this, "user", {
26
+ enumerable: true,
27
+ configurable: true,
28
+ writable: true,
29
+ value: void 0
30
+ });
31
+ Object.defineProperty(this, "isRevoked", {
32
+ enumerable: true,
33
+ configurable: true,
34
+ writable: true,
35
+ value: void 0
36
+ });
37
+ Object.assign(this, partial);
38
+ }
39
+ };
40
+ exports.RefreshToken = RefreshToken;
41
+ __decorate([
42
+ (0, typeorm_1.Column)(),
43
+ __metadata("design:type", Date)
44
+ ], RefreshToken.prototype, "expiresIn", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.ManyToOne)(() => user_entity_1.User, {
47
+ eager: false,
48
+ onDelete: "CASCADE",
49
+ onUpdate: "CASCADE",
50
+ }),
51
+ __metadata("design:type", user_entity_1.User)
52
+ ], RefreshToken.prototype, "user", void 0);
53
+ __decorate([
54
+ (0, typeorm_1.Column)({ default: false }),
55
+ __metadata("design:type", Boolean)
56
+ ], RefreshToken.prototype, "isRevoked", void 0);
57
+ exports.RefreshToken = RefreshToken = __decorate([
58
+ (0, typeorm_1.Entity)(),
59
+ __metadata("design:paramtypes", [Object])
60
+ ], RefreshToken);
61
+ //# sourceMappingURL=refresh-token.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refresh-token.entity.js","sourceRoot":"","sources":["../../../src/entities/refresh-token.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAoD;AACpD,+CAA8C;AAC9C,+CAAqC;AAG9B,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,qBAAU;IAc1C,YAAY,OAA+B;QACzC,KAAK,EAAE,CAAC;QAbV;;;;;WAAiB;QAOjB;;;;;WAAY;QAGZ;;;;;WAAoB;QAIlB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;CACF,CAAA;AAlBY,oCAAY;AAEvB;IADC,IAAA,gBAAM,GAAE;8BACG,IAAI;+CAAC;AAOjB;IALC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE;QACrB,KAAK,EAAE,KAAK;QACZ,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;KACpB,CAAC;8BACK,kBAAI;0CAAC;AAGZ;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;+CACP;uBAZT,YAAY;IADxB,IAAA,gBAAM,GAAE;;GACI,YAAY,CAkBxB"}
@@ -0,0 +1,5 @@
1
+ import { BaseEntity } from "@common/database";
2
+ export declare class Role extends BaseEntity {
3
+ name: string;
4
+ isDefault: boolean;
5
+ }
@@ -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.Role = void 0;
13
+ const database_1 = require("@common/database");
14
+ const class_validator_1 = require("class-validator");
15
+ const typeorm_1 = require("typeorm");
16
+ let Role = class Role extends database_1.BaseEntity {
17
+ constructor() {
18
+ super(...arguments);
19
+ Object.defineProperty(this, "name", {
20
+ enumerable: true,
21
+ configurable: true,
22
+ writable: true,
23
+ value: void 0
24
+ });
25
+ Object.defineProperty(this, "isDefault", {
26
+ enumerable: true,
27
+ configurable: true,
28
+ writable: true,
29
+ value: void 0
30
+ });
31
+ }
32
+ };
33
+ exports.Role = Role;
34
+ __decorate([
35
+ (0, class_validator_1.MinLength)(3),
36
+ (0, typeorm_1.Column)({ unique: true }),
37
+ __metadata("design:type", String)
38
+ ], Role.prototype, "name", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Column)({ default: false }),
41
+ __metadata("design:type", Boolean)
42
+ ], Role.prototype, "isDefault", void 0);
43
+ exports.Role = Role = __decorate([
44
+ (0, typeorm_1.Entity)()
45
+ ], Role);
46
+ //# sourceMappingURL=role.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role.entity.js","sourceRoot":"","sources":["../../../src/entities/role.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA8C;AAC9C,qDAA4C;AAC5C,qCAAyC;AAGlC,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,qBAAU;IAA7B;;QAGL;;;;;WAAa;QAGb;;;;;WAAmB;IACrB,CAAC;CAAA,CAAA;AAPY,oBAAI;AAGf;IAFC,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;kCACZ;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;uCACR;eANR,IAAI;IADhB,IAAA,gBAAM,GAAE;GACI,IAAI,CAOhB"}
@@ -0,0 +1,17 @@
1
+ import { BaseEntity } from "@common/database";
2
+ import { Profile } from "./profile.entity";
3
+ import { Role } from "./role.entity";
4
+ export declare class User extends BaseEntity {
5
+ username: string;
6
+ email: string;
7
+ bio: string;
8
+ avatar: string;
9
+ hash: string;
10
+ twoFactorSecret?: string;
11
+ isTwoFactorEnabled?: boolean;
12
+ phone?: string;
13
+ isVerified?: boolean;
14
+ lastLogin?: Date;
15
+ profile: Profile;
16
+ roles?: Role[];
17
+ }
@@ -0,0 +1,157 @@
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.User = void 0;
13
+ const database_1 = require("@common/database");
14
+ const typeorm_1 = require("typeorm");
15
+ const class_transformer_1 = require("class-transformer");
16
+ const profile_entity_1 = require("./profile.entity");
17
+ const role_entity_1 = require("./role.entity");
18
+ let User = class User extends database_1.BaseEntity {
19
+ constructor() {
20
+ super(...arguments);
21
+ Object.defineProperty(this, "username", {
22
+ enumerable: true,
23
+ configurable: true,
24
+ writable: true,
25
+ value: void 0
26
+ });
27
+ Object.defineProperty(this, "email", {
28
+ enumerable: true,
29
+ configurable: true,
30
+ writable: true,
31
+ value: void 0
32
+ });
33
+ Object.defineProperty(this, "bio", {
34
+ enumerable: true,
35
+ configurable: true,
36
+ writable: true,
37
+ value: void 0
38
+ });
39
+ Object.defineProperty(this, "avatar", {
40
+ enumerable: true,
41
+ configurable: true,
42
+ writable: true,
43
+ value: void 0
44
+ });
45
+ Object.defineProperty(this, "hash", {
46
+ enumerable: true,
47
+ configurable: true,
48
+ writable: true,
49
+ value: void 0
50
+ });
51
+ Object.defineProperty(this, "twoFactorSecret", {
52
+ enumerable: true,
53
+ configurable: true,
54
+ writable: true,
55
+ value: void 0
56
+ });
57
+ Object.defineProperty(this, "isTwoFactorEnabled", {
58
+ enumerable: true,
59
+ configurable: true,
60
+ writable: true,
61
+ value: void 0
62
+ });
63
+ Object.defineProperty(this, "phone", {
64
+ enumerable: true,
65
+ configurable: true,
66
+ writable: true,
67
+ value: void 0
68
+ });
69
+ Object.defineProperty(this, "isVerified", {
70
+ enumerable: true,
71
+ configurable: true,
72
+ writable: true,
73
+ value: void 0
74
+ });
75
+ Object.defineProperty(this, "lastLogin", {
76
+ enumerable: true,
77
+ configurable: true,
78
+ writable: true,
79
+ value: void 0
80
+ });
81
+ Object.defineProperty(this, "profile", {
82
+ enumerable: true,
83
+ configurable: true,
84
+ writable: true,
85
+ value: void 0
86
+ });
87
+ Object.defineProperty(this, "roles", {
88
+ enumerable: true,
89
+ configurable: true,
90
+ writable: true,
91
+ value: void 0
92
+ });
93
+ }
94
+ };
95
+ exports.User = User;
96
+ __decorate([
97
+ (0, typeorm_1.Column)({ unique: true }),
98
+ __metadata("design:type", String)
99
+ ], User.prototype, "username", void 0);
100
+ __decorate([
101
+ (0, typeorm_1.Column)({ unique: true }),
102
+ __metadata("design:type", String)
103
+ ], User.prototype, "email", void 0);
104
+ __decorate([
105
+ (0, typeorm_1.Column)({ type: "text" }),
106
+ __metadata("design:type", String)
107
+ ], User.prototype, "bio", void 0);
108
+ __decorate([
109
+ (0, typeorm_1.Column)({ type: "text" }),
110
+ __metadata("design:type", String)
111
+ ], User.prototype, "avatar", void 0);
112
+ __decorate([
113
+ (0, class_transformer_1.Exclude)(),
114
+ (0, typeorm_1.Column)({ type: "text" }),
115
+ __metadata("design:type", String)
116
+ ], User.prototype, "hash", void 0);
117
+ __decorate([
118
+ (0, class_transformer_1.Exclude)(),
119
+ (0, typeorm_1.Column)({ nullable: true }),
120
+ __metadata("design:type", String)
121
+ ], User.prototype, "twoFactorSecret", void 0);
122
+ __decorate([
123
+ (0, typeorm_1.Column)({ default: false }),
124
+ __metadata("design:type", Boolean)
125
+ ], User.prototype, "isTwoFactorEnabled", void 0);
126
+ __decorate([
127
+ (0, typeorm_1.Column)({ unique: true }),
128
+ __metadata("design:type", String)
129
+ ], User.prototype, "phone", void 0);
130
+ __decorate([
131
+ (0, typeorm_1.Column)({ default: false }),
132
+ __metadata("design:type", Boolean)
133
+ ], User.prototype, "isVerified", void 0);
134
+ __decorate([
135
+ (0, typeorm_1.Column)({ type: "timestamp", nullable: true }),
136
+ __metadata("design:type", Date)
137
+ ], User.prototype, "lastLogin", void 0);
138
+ __decorate([
139
+ (0, typeorm_1.OneToOne)(() => profile_entity_1.Profile, {
140
+ onDelete: "CASCADE",
141
+ onUpdate: "CASCADE",
142
+ }),
143
+ (0, typeorm_1.JoinColumn)(),
144
+ __metadata("design:type", profile_entity_1.Profile)
145
+ ], User.prototype, "profile", void 0);
146
+ __decorate([
147
+ (0, typeorm_1.ManyToMany)(() => role_entity_1.Role, {
148
+ onDelete: "CASCADE",
149
+ onUpdate: "CASCADE",
150
+ }),
151
+ (0, typeorm_1.JoinTable)(),
152
+ __metadata("design:type", Array)
153
+ ], User.prototype, "roles", void 0);
154
+ exports.User = User = __decorate([
155
+ (0, typeorm_1.Entity)()
156
+ ], User);
157
+ //# sourceMappingURL=user.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA8C;AAC9C,qCAAsF;AACtF,yDAA4C;AAC5C,qDAA2C;AAC3C,+CAAqC;AAG9B,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,qBAAU;IAA7B;;QAEL;;;;;WAAkB;QAGlB;;;;;WAAe;QAGf;;;;;WAAa;QAGb;;;;;WAAgB;QAIhB;;;;;WAAc;QAId;;;;;WAAyB;QAGzB;;;;;WAA6B;QAG7B;;;;;WAAe;QAGf;;;;;WAAqB;QAGrB;;;;;WAAiB;QAOjB;;;;;WAAiB;QAOjB;;;;;WAAe;IACjB,CAAC;CAAA,CAAA;AA9CY,oBAAI;AAEf;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;sCACP;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;mCACV;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iCACZ;AAGb;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oCACT;AAIhB;IAFC,IAAA,2BAAO,GAAE;IACT,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kCACX;AAId;IAFC,IAAA,2BAAO,GAAE;IACT,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACF;AAGzB;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;gDACE;AAG7B;IADC,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;mCACV;AAGf;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;wCACN;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;8BAClC,IAAI;uCAAC;AAOjB;IALC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,wBAAO,EAAE;QACvB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,IAAA,oBAAU,GAAE;8BACJ,wBAAO;qCAAC;AAOjB;IALC,IAAA,oBAAU,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE;QACtB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,IAAA,mBAAS,GAAE;;mCACG;eA7CJ,IAAI;IADhB,IAAA,gBAAM,GAAE;GACI,IAAI,CA8ChB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easywork-common-lib",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Paquete de librerías compartidas para EasyWork",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",