@aurispec/core-backend 1.0.46 → 1.0.47

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.
@@ -1,10 +1,12 @@
1
1
  import { BaseModel } from "./BaseModel";
2
- import { UserRoles } from "../common/enums/UserEnums";
3
- import { STATUS } from "../common/enums";
2
+ import { AccountStatus } from "../common/enums/UserEnums";
4
3
  import { ArticleModel } from "./ArticleModel";
4
+ import { RoleModel } from "./RoleModel";
5
5
  export declare class AdminUserModel extends BaseModel {
6
6
  email: string;
7
7
  full_name: string;
8
+ admin_id?: number;
9
+ status: AccountStatus;
8
10
  password_hash: string;
9
11
  last_login?: Date;
10
12
  is_verified: Boolean;
@@ -12,8 +14,9 @@ export declare class AdminUserModel extends BaseModel {
12
14
  verification_expires_at?: Date | null;
13
15
  reset_token?: string | null;
14
16
  reset_token_expires_at?: Date | null;
15
- status: STATUS;
16
- role: UserRoles;
17
+ role_id?: number;
17
18
  articles?: ArticleModel[];
19
+ admin: AdminUserModel;
20
+ role: RoleModel;
18
21
  }
19
22
  //# sourceMappingURL=AdminUserModel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdminUserModel.d.ts","sourceRoot":"","sources":["../../src/models/AdminUserModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,qBAEa,cAAe,SAAQ,SAAS;IAE3C,KAAK,EAAG,MAAM,CAAC;IAGf,SAAS,EAAG,MAAM,CAAC;IAGnB,aAAa,EAAG,MAAM,CAAC;IAGvB,UAAU,CAAC,EAAE,IAAI,CAAC;IAGlB,WAAW,EAAG,OAAO,CAAC;IAGtB,kBAAkB,CAAC,EAAE,MAAM,GAAG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eorm_1 = require("typeorm");
14
14
  const BaseModel_1 = require("./BaseModel");
15
15
  const UserEnums_1 = require("../common/enums/UserEnums");
16
- const enums_1 = require("../common/enums");
17
16
  const typedi_1 = require("typedi");
18
17
  const ArticleModel_1 = require("./ArticleModel");
18
+ const RoleModel_1 = require("./RoleModel");
19
19
  let AdminUserModel = class AdminUserModel extends BaseModel_1.BaseModel {
20
20
  email;
21
21
  full_name;
22
+ admin_id;
23
+ status;
22
24
  password_hash;
23
25
  last_login;
24
26
  is_verified;
@@ -26,9 +28,10 @@ let AdminUserModel = class AdminUserModel extends BaseModel_1.BaseModel {
26
28
  verification_expires_at;
27
29
  reset_token;
28
30
  reset_token_expires_at;
29
- status;
30
- role;
31
+ role_id;
31
32
  articles;
33
+ admin;
34
+ role;
32
35
  };
33
36
  exports.AdminUserModel = AdminUserModel;
34
37
  __decorate([
@@ -39,6 +42,18 @@ __decorate([
39
42
  (0, typeorm_1.Column)(),
40
43
  __metadata("design:type", String)
41
44
  ], AdminUserModel.prototype, "full_name", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.Column)({ nullable: true }),
47
+ __metadata("design:type", Number)
48
+ ], AdminUserModel.prototype, "admin_id", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({
51
+ type: "enum",
52
+ enum: UserEnums_1.AccountStatus,
53
+ default: UserEnums_1.AccountStatus.PENDING
54
+ }),
55
+ __metadata("design:type", String)
56
+ ], AdminUserModel.prototype, "status", void 0);
42
57
  __decorate([
43
58
  (0, typeorm_1.Column)(),
44
59
  __metadata("design:type", String)
@@ -68,21 +83,9 @@ __decorate([
68
83
  __metadata("design:type", Object)
69
84
  ], AdminUserModel.prototype, "reset_token_expires_at", void 0);
70
85
  __decorate([
71
- (0, typeorm_1.Column)({
72
- type: "enum",
73
- enum: enums_1.STATUS,
74
- default: enums_1.STATUS.INACTIVE,
75
- }),
76
- __metadata("design:type", String)
77
- ], AdminUserModel.prototype, "status", void 0);
78
- __decorate([
79
- (0, typeorm_1.Column)({
80
- type: "enum",
81
- enum: UserEnums_1.UserRoles,
82
- default: UserEnums_1.UserRoles.ADMIN,
83
- }),
84
- __metadata("design:type", String)
85
- ], AdminUserModel.prototype, "role", void 0);
86
+ (0, typeorm_1.Column)({ nullable: true }),
87
+ __metadata("design:type", Number)
88
+ ], AdminUserModel.prototype, "role_id", void 0);
86
89
  __decorate([
87
90
  (0, typeorm_1.OneToMany)(() => ArticleModel_1.ArticleModel, (articles) => articles.admin, {
88
91
  onDelete: "SET NULL",
@@ -90,6 +93,16 @@ __decorate([
90
93
  }),
91
94
  __metadata("design:type", Array)
92
95
  ], AdminUserModel.prototype, "articles", void 0);
96
+ __decorate([
97
+ (0, typeorm_1.ManyToOne)(() => AdminUserModel),
98
+ (0, typeorm_1.JoinColumn)({ name: 'admin_id' }),
99
+ __metadata("design:type", AdminUserModel)
100
+ ], AdminUserModel.prototype, "admin", void 0);
101
+ __decorate([
102
+ (0, typeorm_1.ManyToOne)(() => RoleModel_1.RoleModel),
103
+ (0, typeorm_1.JoinColumn)({ name: 'role_id' }),
104
+ __metadata("design:type", RoleModel_1.RoleModel)
105
+ ], AdminUserModel.prototype, "role", void 0);
93
106
  exports.AdminUserModel = AdminUserModel = __decorate([
94
107
  (0, typedi_1.Service)(),
95
108
  (0, typeorm_1.Entity)({ name: "admin_users" })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurispec/core-backend",
3
- "version": "1.0.46",
3
+ "version": "1.0.47",
4
4
  "description": "Auri spectrum's backend core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",