@nest-boot/auth 7.0.0 → 7.1.0
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/adapters/mikro-orm-adapter.d.ts +23 -0
- package/dist/adapters/mikro-orm-adapter.js +155 -0
- package/dist/adapters/mikro-orm-adapter.js.map +1 -0
- package/dist/auth-module-options.interface.d.ts +12 -0
- package/dist/auth-module-options.interface.js.map +1 -0
- package/dist/auth.constants.d.ts +2 -4
- package/dist/auth.constants.js +3 -5
- package/dist/auth.constants.js.map +1 -1
- package/dist/auth.guard.d.ts +6 -35
- package/dist/auth.guard.js +15 -102
- package/dist/auth.guard.js.map +1 -1
- package/dist/auth.middleware.d.ts +13 -0
- package/dist/auth.middleware.js +64 -0
- package/dist/auth.middleware.js.map +1 -0
- package/dist/auth.module-definition.d.ts +1 -1
- package/dist/auth.module.d.ts +11 -1
- package/dist/auth.module.js +46 -13
- package/dist/auth.module.js.map +1 -1
- package/dist/auth.service.d.ts +3 -61
- package/dist/auth.service.js +5 -109
- package/dist/auth.service.js.map +1 -1
- package/dist/decorators/current-session.decorator.d.ts +1 -0
- package/dist/decorators/current-session.decorator.js +15 -0
- package/dist/decorators/current-session.decorator.js.map +1 -0
- package/dist/decorators/current-user.decorator.d.ts +1 -1
- package/dist/decorators/current-user.decorator.js +9 -4
- package/dist/decorators/current-user.decorator.js.map +1 -1
- package/dist/decorators/index.d.ts +2 -3
- package/dist/decorators/index.js +2 -3
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/public.decorator.d.ts +2 -0
- package/dist/decorators/public.decorator.js +8 -0
- package/dist/decorators/public.decorator.js.map +1 -0
- package/dist/entities/account.entity.d.ts +16 -0
- package/dist/entities/account.entity.js +87 -0
- package/dist/entities/account.entity.js.map +1 -0
- package/dist/entities/index.d.ts +3 -1
- package/dist/entities/index.js +3 -1
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/session.entity.d.ts +11 -0
- package/dist/entities/session.entity.js +68 -0
- package/dist/entities/session.entity.js.map +1 -0
- package/dist/entities/user.entity.d.ts +5 -8
- package/dist/entities/user.entity.js +31 -40
- package/dist/entities/user.entity.js.map +1 -1
- package/dist/entities/verification.entity.d.ts +9 -0
- package/dist/entities/verification.entity.js +55 -0
- package/dist/entities/verification.entity.js.map +1 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +7 -17
- package/dist/decorators/can.decorator.d.ts +0 -1
- package/dist/decorators/can.decorator.js +0 -8
- package/dist/decorators/can.decorator.js.map +0 -1
- package/dist/decorators/current-personal-access-token.decorator.d.ts +0 -1
- package/dist/decorators/current-personal-access-token.decorator.js +0 -10
- package/dist/decorators/current-personal-access-token.decorator.js.map +0 -1
- package/dist/decorators/require-auth.decorator.d.ts +0 -1
- package/dist/decorators/require-auth.decorator.js +0 -8
- package/dist/decorators/require-auth.decorator.js.map +0 -1
- package/dist/entities/personal-access-token.entity.d.ts +0 -14
- package/dist/entities/personal-access-token.entity.js +0 -72
- package/dist/entities/personal-access-token.entity.js.map +0 -1
- package/dist/interfaces/auth-module-options.interface.d.ts +0 -10
- package/dist/interfaces/auth-module-options.interface.js.map +0 -1
- package/dist/interfaces/index.d.ts +0 -1
- package/dist/interfaces/index.js +0 -18
- package/dist/interfaces/index.js.map +0 -1
- package/dist/utils/random-string.util.d.ts +0 -6
- package/dist/utils/random-string.util.js +0 -26
- package/dist/utils/random-string.util.js.map +0 -1
- /package/dist/{interfaces/auth-module-options.interface.js → auth-module-options.interface.js} +0 -0
package/dist/auth.service.d.ts
CHANGED
|
@@ -1,63 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { HashService } from "@nest-boot/hash";
|
|
3
|
-
import { PersonalAccessToken, User } from "./entities";
|
|
4
|
-
import { AuthModuleOptions } from "./interfaces";
|
|
5
|
-
/**
|
|
6
|
-
* Service responsible for handling authentication-related operations.
|
|
7
|
-
*/
|
|
1
|
+
import { Auth } from "better-auth";
|
|
8
2
|
export declare class AuthService {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
private readonly options;
|
|
12
|
-
private readonly User;
|
|
13
|
-
private readonly PersonalAccessToken;
|
|
14
|
-
private readonly expiresIn?;
|
|
15
|
-
/**
|
|
16
|
-
* Constructs a new instance of the AuthService class.
|
|
17
|
-
* @param em The EntityManager instance.
|
|
18
|
-
* @param hashService The HashService instance.
|
|
19
|
-
* @param options The options for the Auth module.
|
|
20
|
-
*/
|
|
21
|
-
constructor(em: EntityManager, hashService: HashService, options: AuthModuleOptions);
|
|
22
|
-
/**
|
|
23
|
-
* Attempts to authenticate a user with the provided email and password.
|
|
24
|
-
* @param email The user's email.
|
|
25
|
-
* @param password The user's password.
|
|
26
|
-
* @returns The authenticated user if successful, otherwise null.
|
|
27
|
-
*/
|
|
28
|
-
attempt(email: string, password: string): Promise<import("@mikro-orm/core").Loaded<User, never, "*", never> | null>;
|
|
29
|
-
/**
|
|
30
|
-
* Retrieves a personal access token by its token value.
|
|
31
|
-
* @param token The token value.
|
|
32
|
-
* @returns The personal access token if found, otherwise null.
|
|
33
|
-
*/
|
|
34
|
-
getToken(token: string): Promise<PersonalAccessToken | null>;
|
|
35
|
-
/**
|
|
36
|
-
* Creates a new personal access token for a user.
|
|
37
|
-
* @param user The user for whom the token is created.
|
|
38
|
-
* @param name The name of the token.
|
|
39
|
-
* @param permissions The permissions associated with the token.
|
|
40
|
-
* @param expiresIn The expiration time for the token.
|
|
41
|
-
* @returns An object containing the token and the personal access token entity.
|
|
42
|
-
*/
|
|
43
|
-
createToken(user: User, name: string, permissions?: string[], expiresIn?: number): Promise<{
|
|
44
|
-
token: string;
|
|
45
|
-
personalAccessToken: PersonalAccessToken;
|
|
46
|
-
}>;
|
|
47
|
-
/**
|
|
48
|
-
* Deletes a personal access token.
|
|
49
|
-
* @param personalAccessToken - The personal access token to be deleted.
|
|
50
|
-
* @returns A Promise that resolves when the token is successfully deleted.
|
|
51
|
-
*/
|
|
52
|
-
deleteToken(personalAccessToken: PersonalAccessToken): Promise<void>;
|
|
53
|
-
/**
|
|
54
|
-
* Registers a new user.
|
|
55
|
-
* @param name The user's name.
|
|
56
|
-
* @param email The user's email.
|
|
57
|
-
* @param password The user's password.
|
|
58
|
-
* @param permissions The permissions associated with the user.
|
|
59
|
-
* @returns The registered user.
|
|
60
|
-
*/
|
|
61
|
-
register(name: string, email: string, password: string, permissions?: string[]): Promise<User>;
|
|
62
|
-
updateLastUsedAt(personalAccessToken: PersonalAccessToken): Promise<void>;
|
|
3
|
+
readonly auth: Auth;
|
|
4
|
+
constructor(auth: Auth);
|
|
63
5
|
}
|
package/dist/auth.service.js
CHANGED
|
@@ -13,120 +13,16 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.AuthService = void 0;
|
|
16
|
-
const core_1 = require("@mikro-orm/core");
|
|
17
|
-
const hash_1 = require("@nest-boot/hash");
|
|
18
16
|
const common_1 = require("@nestjs/common");
|
|
19
|
-
const
|
|
20
|
-
const entities_1 = require("./entities");
|
|
21
|
-
const random_string_util_1 = require("./utils/random-string.util");
|
|
22
|
-
/**
|
|
23
|
-
* Service responsible for handling authentication-related operations.
|
|
24
|
-
*/
|
|
17
|
+
const auth_constants_1 = require("./auth.constants");
|
|
25
18
|
let AuthService = class AuthService {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
* @param em The EntityManager instance.
|
|
29
|
-
* @param hashService The HashService instance.
|
|
30
|
-
* @param options The options for the Auth module.
|
|
31
|
-
*/
|
|
32
|
-
constructor(em, hashService, options) {
|
|
33
|
-
this.em = em;
|
|
34
|
-
this.hashService = hashService;
|
|
35
|
-
this.options = options;
|
|
36
|
-
this.User = this.options?.entities?.User ?? entities_1.User;
|
|
37
|
-
this.PersonalAccessToken =
|
|
38
|
-
this.options?.entities?.PersonalAccessToken ?? entities_1.PersonalAccessToken;
|
|
39
|
-
this.expiresIn = this.options?.expiresIn;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Attempts to authenticate a user with the provided email and password.
|
|
43
|
-
* @param email The user's email.
|
|
44
|
-
* @param password The user's password.
|
|
45
|
-
* @returns The authenticated user if successful, otherwise null.
|
|
46
|
-
*/
|
|
47
|
-
async attempt(email, password) {
|
|
48
|
-
const user = await this.em.findOne(this.User, { email }, { filters: false });
|
|
49
|
-
if (
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
|
|
51
|
-
user === null ||
|
|
52
|
-
user.password === null ||
|
|
53
|
-
!(await this.hashService.verify(user.password, password))) {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
return user;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Retrieves a personal access token by its token value.
|
|
60
|
-
* @param token The token value.
|
|
61
|
-
* @returns The personal access token if found, otherwise null.
|
|
62
|
-
*/
|
|
63
|
-
async getToken(token) {
|
|
64
|
-
return await this.em.findOne(this.PersonalAccessToken, {
|
|
65
|
-
token,
|
|
66
|
-
}, { populate: ["user"] });
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Creates a new personal access token for a user.
|
|
70
|
-
* @param user The user for whom the token is created.
|
|
71
|
-
* @param name The name of the token.
|
|
72
|
-
* @param permissions The permissions associated with the token.
|
|
73
|
-
* @param expiresIn The expiration time for the token.
|
|
74
|
-
* @returns An object containing the token and the personal access token entity.
|
|
75
|
-
*/
|
|
76
|
-
async createToken(user, name, permissions = ["*"], expiresIn) {
|
|
77
|
-
const token = (0, random_string_util_1.randomString)(48);
|
|
78
|
-
expiresIn = expiresIn ?? this.expiresIn;
|
|
79
|
-
const personalAccessToken = this.em.create(this.PersonalAccessToken, {
|
|
80
|
-
user,
|
|
81
|
-
name,
|
|
82
|
-
token,
|
|
83
|
-
permissions,
|
|
84
|
-
expiresAt: typeof expiresIn !== "undefined"
|
|
85
|
-
? new Date(Date.now() + expiresIn)
|
|
86
|
-
: null,
|
|
87
|
-
});
|
|
88
|
-
await this.em.persistAndFlush(personalAccessToken);
|
|
89
|
-
return { token, personalAccessToken };
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Deletes a personal access token.
|
|
93
|
-
* @param personalAccessToken - The personal access token to be deleted.
|
|
94
|
-
* @returns A Promise that resolves when the token is successfully deleted.
|
|
95
|
-
*/
|
|
96
|
-
async deleteToken(personalAccessToken) {
|
|
97
|
-
await this.em.remove(personalAccessToken).flush();
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Registers a new user.
|
|
101
|
-
* @param name The user's name.
|
|
102
|
-
* @param email The user's email.
|
|
103
|
-
* @param password The user's password.
|
|
104
|
-
* @param permissions The permissions associated with the user.
|
|
105
|
-
* @returns The registered user.
|
|
106
|
-
*/
|
|
107
|
-
async register(name, email, password, permissions = []) {
|
|
108
|
-
const hashedPassword = await this.hashService.create(password);
|
|
109
|
-
const user = this.em.create(this.User, {
|
|
110
|
-
name,
|
|
111
|
-
email,
|
|
112
|
-
password: hashedPassword,
|
|
113
|
-
permissions,
|
|
114
|
-
createdAt: new Date(),
|
|
115
|
-
updatedAt: new Date(),
|
|
116
|
-
});
|
|
117
|
-
await this.em.persistAndFlush(user);
|
|
118
|
-
return user;
|
|
119
|
-
}
|
|
120
|
-
async updateLastUsedAt(personalAccessToken) {
|
|
121
|
-
personalAccessToken.lastUsedAt = new Date();
|
|
122
|
-
await this.em.flush();
|
|
19
|
+
constructor(auth) {
|
|
20
|
+
this.auth = auth;
|
|
123
21
|
}
|
|
124
22
|
};
|
|
125
23
|
exports.AuthService = AuthService;
|
|
126
24
|
exports.AuthService = AuthService = __decorate([
|
|
127
|
-
(0, common_1.
|
|
128
|
-
|
|
129
|
-
__metadata("design:paramtypes", [core_1.EntityManager,
|
|
130
|
-
hash_1.HashService, Object])
|
|
25
|
+
__param(0, (0, common_1.Inject)(auth_constants_1.AUTH_TOKEN)),
|
|
26
|
+
__metadata("design:paramtypes", [Object])
|
|
131
27
|
], AuthService);
|
|
132
28
|
//# sourceMappingURL=auth.service.js.map
|
package/dist/auth.service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../src/auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../src/auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAwC;AAGxC,qDAA8C;AAE9C,IAAa,WAAW,GAAxB,MAAa,WAAW;IACtB,YAEkB,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;IACzB,CAAC;CACL,CAAA;AALY,kCAAW;sBAAX,WAAW;IAEnB,WAAA,IAAA,eAAM,EAAC,2BAAU,CAAC,CAAA;;GAFV,WAAW,CAKvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CurrentSession: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CurrentSession = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
exports.CurrentSession = (0, common_1.createParamDecorator)((data, context) => {
|
|
6
|
+
let res;
|
|
7
|
+
if (context.getType() === "graphql") {
|
|
8
|
+
res = context.getArgByIndex(2).req.res;
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
res = context.switchToHttp().getResponse();
|
|
12
|
+
}
|
|
13
|
+
return res.locals.session;
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=current-session.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"current-session.decorator.js","sourceRoot":"","sources":["../../src/decorators/current-session.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAwE;AAG3D,QAAA,cAAc,GAAG,IAAA,6BAAoB,EAChD,CAAC,IAAa,EAAE,OAAyB,EAAE,EAAE;IAC3C,IAAI,GAAa,CAAC;IAElB,IAAI,OAAO,CAAC,OAAO,EAAa,KAAK,SAAS,EAAE,CAAC;QAC/C,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACzC,CAAC;SAAM,CAAC;QACN,GAAG,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,WAAW,EAAE,CAAC;IAC7C,CAAC;IAED,OAAO,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC;AAC5B,CAAC,CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const CurrentUser: (...dataOrPipes:
|
|
1
|
+
export declare const CurrentUser: (...dataOrPipes: unknown[]) => ParameterDecorator;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CurrentUser = void 0;
|
|
4
|
-
const request_context_1 = require("@nest-boot/request-context");
|
|
5
4
|
const common_1 = require("@nestjs/common");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
exports.CurrentUser = (0, common_1.createParamDecorator)((data, context) => {
|
|
6
|
+
let res;
|
|
7
|
+
if (context.getType() === "graphql") {
|
|
8
|
+
res = context.getArgByIndex(2).req.res;
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
res = context.switchToHttp().getResponse();
|
|
12
|
+
}
|
|
13
|
+
return res.locals.user;
|
|
9
14
|
});
|
|
10
15
|
//# sourceMappingURL=current-user.decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"current-user.decorator.js","sourceRoot":"","sources":["../../src/decorators/current-user.decorator.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"current-user.decorator.js","sourceRoot":"","sources":["../../src/decorators/current-user.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAwE;AAG3D,QAAA,WAAW,GAAG,IAAA,6BAAoB,EAC7C,CAAC,IAAa,EAAE,OAAyB,EAAE,EAAE;IAC3C,IAAI,GAAa,CAAC;IAElB,IAAI,OAAO,CAAC,OAAO,EAAa,KAAK,SAAS,EAAE,CAAC;QAC/C,GAAG,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACzC,CAAC;SAAM,CAAC;QACN,GAAG,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,WAAW,EAAE,CAAC;IAC7C,CAAC;IAED,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;AACzB,CAAC,CACF,CAAC"}
|
package/dist/decorators/index.js
CHANGED
|
@@ -14,8 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./current-personal-access-token.decorator"), exports);
|
|
17
|
+
__exportStar(require("./current-session.decorator"), exports);
|
|
19
18
|
__exportStar(require("./current-user.decorator"), exports);
|
|
20
|
-
__exportStar(require("./
|
|
19
|
+
__exportStar(require("./public.decorator"), exports);
|
|
21
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,2DAAyC;AACzC,qDAAmC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Public = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
const auth_constants_1 = require("../auth.constants");
|
|
6
|
+
const Public = (value = true) => (0, common_1.SetMetadata)(auth_constants_1.IS_PUBLIC_KEY, value);
|
|
7
|
+
exports.Public = Public;
|
|
8
|
+
//# sourceMappingURL=public.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.decorator.js","sourceRoot":"","sources":["../../src/decorators/public.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAE7C,sDAAkD;AAE3C,MAAM,MAAM,GAAG,CAAC,KAAK,GAAG,IAAI,EAAE,EAAE,CAAC,IAAA,oBAAW,EAAC,8BAAa,EAAE,KAAK,CAAC,CAAC;AAA7D,QAAA,MAAM,UAAuD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseEntity, Opt } from "@mikro-orm/core";
|
|
2
|
+
export declare abstract class BaseAccount extends BaseEntity {
|
|
3
|
+
id: Opt<string>;
|
|
4
|
+
accountId: string;
|
|
5
|
+
providerId: string;
|
|
6
|
+
userId: string;
|
|
7
|
+
accessToken?: Opt<string>;
|
|
8
|
+
refreshToken?: Opt<string>;
|
|
9
|
+
idToken?: Opt<string>;
|
|
10
|
+
accessTokenExpiresAt?: Opt<Date>;
|
|
11
|
+
refreshTokenExpiresAt?: Opt<Date>;
|
|
12
|
+
scope?: Opt<string>;
|
|
13
|
+
password?: Opt<string>;
|
|
14
|
+
createdAt: Opt<Date>;
|
|
15
|
+
updatedAt: Opt<Date>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
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.BaseAccount = void 0;
|
|
13
|
+
const core_1 = require("@mikro-orm/core");
|
|
14
|
+
const crypto_1 = require("crypto");
|
|
15
|
+
let BaseAccount = class BaseAccount extends core_1.BaseEntity {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.id = (0, crypto_1.randomUUID)();
|
|
19
|
+
this.createdAt = new Date();
|
|
20
|
+
this.updatedAt = new Date();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.BaseAccount = BaseAccount;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, core_1.PrimaryKey)({ type: core_1.t.uuid }),
|
|
26
|
+
__metadata("design:type", Object)
|
|
27
|
+
], BaseAccount.prototype, "id", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, core_1.Property)({ type: core_1.t.text }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], BaseAccount.prototype, "accountId", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, core_1.Property)({ type: core_1.t.text }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], BaseAccount.prototype, "providerId", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, core_1.ManyToOne)(() => "User", {
|
|
38
|
+
fieldName: "user_id",
|
|
39
|
+
mapToPk: true,
|
|
40
|
+
cascade: [core_1.Cascade.REMOVE],
|
|
41
|
+
}),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], BaseAccount.prototype, "userId", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, core_1.Property)({ type: core_1.t.text, nullable: true }),
|
|
46
|
+
__metadata("design:type", Object)
|
|
47
|
+
], BaseAccount.prototype, "accessToken", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, core_1.Property)({ type: core_1.t.text, nullable: true }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], BaseAccount.prototype, "refreshToken", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, core_1.Property)({ type: core_1.t.text, nullable: true }),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], BaseAccount.prototype, "idToken", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, core_1.Property)({ type: core_1.t.datetime, nullable: true }),
|
|
58
|
+
__metadata("design:type", Object)
|
|
59
|
+
], BaseAccount.prototype, "accessTokenExpiresAt", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, core_1.Property)({ type: core_1.t.datetime, nullable: true }),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], BaseAccount.prototype, "refreshTokenExpiresAt", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, core_1.Property)({ type: core_1.t.text, nullable: true }),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], BaseAccount.prototype, "scope", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, core_1.Property)({ type: core_1.t.text, nullable: true }),
|
|
70
|
+
__metadata("design:type", Object)
|
|
71
|
+
], BaseAccount.prototype, "password", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, core_1.Property)({ type: core_1.t.datetime, defaultRaw: "now()" }),
|
|
74
|
+
__metadata("design:type", Object)
|
|
75
|
+
], BaseAccount.prototype, "createdAt", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, core_1.Property)({
|
|
78
|
+
type: core_1.t.datetime,
|
|
79
|
+
defaultRaw: "now()",
|
|
80
|
+
onUpdate: () => new Date(),
|
|
81
|
+
}),
|
|
82
|
+
__metadata("design:type", Object)
|
|
83
|
+
], BaseAccount.prototype, "updatedAt", void 0);
|
|
84
|
+
exports.BaseAccount = BaseAccount = __decorate([
|
|
85
|
+
(0, core_1.Entity)({ abstract: true })
|
|
86
|
+
], BaseAccount);
|
|
87
|
+
//# sourceMappingURL=account.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.entity.js","sourceRoot":"","sources":["../../src/entities/account.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CASyB;AACzB,mCAAoC;AAG7B,IAAe,WAAW,GAA1B,MAAe,WAAY,SAAQ,iBAAU;IAA7C;;QAEL,OAAE,GAAgB,IAAA,mBAAU,GAAE,CAAC;QAqC/B,cAAS,GAAc,IAAI,IAAI,EAAE,CAAC;QAOlC,cAAS,GAAc,IAAI,IAAI,EAAE,CAAC;IACpC,CAAC;CAAA,CAAA;AA/CqB,kCAAW;AAE/B;IADC,IAAA,iBAAU,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,CAAC;;uCACE;AAG/B;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,CAAC;;8CACR;AAGnB;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,CAAC;;+CACP;AAOpB;IALC,IAAA,gBAAS,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE;QACvB,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,CAAC,cAAO,CAAC,MAAM,CAAC;KAC1B,CAAC;;2CACc;AAGhB;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACjB;AAG1B;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDAChB;AAG3B;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACrB;AAGtB;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACd;AAGjC;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DACb;AAGlC;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACvB;AAGpB;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACpB;AAGvB;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;;8CAClB;AAOlC;IALC,IAAA,eAAQ,EAAC;QACR,IAAI,EAAE,QAAC,CAAC,QAAQ;QAChB,UAAU,EAAE,OAAO;QACnB,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;KAC3B,CAAC;;8CACgC;sBA9Cd,WAAW;IADhC,IAAA,aAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;GACL,WAAW,CA+ChC"}
|
package/dist/entities/index.d.ts
CHANGED
package/dist/entities/index.js
CHANGED
|
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./account.entity"), exports);
|
|
18
|
+
__exportStar(require("./session.entity"), exports);
|
|
18
19
|
__exportStar(require("./user.entity"), exports);
|
|
20
|
+
__exportStar(require("./verification.entity"), exports);
|
|
19
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,mDAAiC;AACjC,gDAA8B;AAC9B,wDAAsC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseEntity, Opt } from "@mikro-orm/core";
|
|
2
|
+
export declare abstract class BaseSession extends BaseEntity {
|
|
3
|
+
id: Opt<string>;
|
|
4
|
+
token: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
expiresAt: Date;
|
|
7
|
+
ipAddress?: Opt<string>;
|
|
8
|
+
userAgent?: Opt<string>;
|
|
9
|
+
createdAt: Opt<Date>;
|
|
10
|
+
updatedAt: Opt<Date>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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.BaseSession = void 0;
|
|
13
|
+
const core_1 = require("@mikro-orm/core");
|
|
14
|
+
const crypto_1 = require("crypto");
|
|
15
|
+
let BaseSession = class BaseSession extends core_1.BaseEntity {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.id = (0, crypto_1.randomUUID)();
|
|
19
|
+
this.createdAt = new Date();
|
|
20
|
+
this.updatedAt = new Date();
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
exports.BaseSession = BaseSession;
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, core_1.PrimaryKey)({ type: core_1.t.uuid }),
|
|
26
|
+
__metadata("design:type", Object)
|
|
27
|
+
], BaseSession.prototype, "id", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, core_1.Property)({ type: core_1.t.text }),
|
|
30
|
+
(0, core_1.Unique)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], BaseSession.prototype, "token", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, core_1.ManyToOne)(() => "User", {
|
|
35
|
+
fieldName: "user_id",
|
|
36
|
+
mapToPk: true,
|
|
37
|
+
cascade: [core_1.Cascade.REMOVE],
|
|
38
|
+
}),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], BaseSession.prototype, "userId", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, core_1.Property)({ type: core_1.t.datetime }),
|
|
43
|
+
__metadata("design:type", Date)
|
|
44
|
+
], BaseSession.prototype, "expiresAt", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, core_1.Property)({ type: core_1.t.text, nullable: true }),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], BaseSession.prototype, "ipAddress", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, core_1.Property)({ type: core_1.t.text, nullable: true }),
|
|
51
|
+
__metadata("design:type", Object)
|
|
52
|
+
], BaseSession.prototype, "userAgent", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, core_1.Property)({ type: core_1.t.datetime, defaultRaw: "now()" }),
|
|
55
|
+
__metadata("design:type", Object)
|
|
56
|
+
], BaseSession.prototype, "createdAt", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, core_1.Property)({
|
|
59
|
+
type: core_1.t.datetime,
|
|
60
|
+
defaultRaw: "now()",
|
|
61
|
+
onUpdate: () => new Date(),
|
|
62
|
+
}),
|
|
63
|
+
__metadata("design:type", Object)
|
|
64
|
+
], BaseSession.prototype, "updatedAt", void 0);
|
|
65
|
+
exports.BaseSession = BaseSession = __decorate([
|
|
66
|
+
(0, core_1.Entity)({ abstract: true })
|
|
67
|
+
], BaseSession);
|
|
68
|
+
//# sourceMappingURL=session.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.entity.js","sourceRoot":"","sources":["../../src/entities/session.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAUyB;AACzB,mCAAoC;AAG7B,IAAe,WAAW,GAA1B,MAAe,WAAY,SAAQ,iBAAU;IAA7C;;QAEL,OAAE,GAAgB,IAAA,mBAAU,GAAE,CAAC;QAuB/B,cAAS,GAAc,IAAI,IAAI,EAAE,CAAC;QAOlC,cAAS,GAAc,IAAI,IAAI,EAAE,CAAC;IACpC,CAAC;CAAA,CAAA;AAjCqB,kCAAW;AAE/B;IADC,IAAA,iBAAU,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,CAAC;;uCACE;AAI/B;IAFC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,CAAC;IAC1B,IAAA,aAAM,GAAE;;0CACM;AAOf;IALC,IAAA,gBAAS,EAAC,GAAG,EAAE,CAAC,MAAM,EAAE;QACvB,SAAS,EAAE,SAAS;QACpB,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,CAAC,cAAO,CAAC,MAAM,CAAC;KAC1B,CAAC;;2CACc;AAGhB;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,QAAQ,EAAE,CAAC;8BACnB,IAAI;8CAAC;AAGjB;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACnB;AAGxB;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACnB;AAGxB;IADC,IAAA,eAAQ,EAAC,EAAE,IAAI,EAAE,QAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;;8CAClB;AAOlC;IALC,IAAA,eAAQ,EAAC;QACR,IAAI,EAAE,QAAC,CAAC,QAAQ;QAChB,UAAU,EAAE,OAAO;QACnB,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;KAC3B,CAAC;;8CACgC;sBAhCd,WAAW;IADhC,IAAA,aAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;GACL,WAAW,CAiChC"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
constructor(data: Pick<User, "id" | "name" | "email" | "password"> & Partial<Pick<User, "permissions" | "createdAt" | "updatedAt" | "personalAccessTokens">>);
|
|
5
|
-
id: string;
|
|
1
|
+
import { BaseEntity, Opt } from "@mikro-orm/core";
|
|
2
|
+
export declare abstract class BaseUser extends BaseEntity {
|
|
3
|
+
id: Opt<string>;
|
|
6
4
|
name: string;
|
|
7
5
|
email: string;
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
emailVerified: boolean;
|
|
7
|
+
image?: Opt<string>;
|
|
10
8
|
createdAt: Opt<Date>;
|
|
11
9
|
updatedAt: Opt<Date>;
|
|
12
|
-
personalAccessTokens: Collection<PersonalAccessToken, object>;
|
|
13
10
|
}
|
|
@@ -9,61 +9,52 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.BaseUser = void 0;
|
|
13
13
|
const core_1 = require("@mikro-orm/core");
|
|
14
|
-
const
|
|
15
|
-
let
|
|
16
|
-
constructor(
|
|
17
|
-
|
|
14
|
+
const crypto_1 = require("crypto");
|
|
15
|
+
let BaseUser = class BaseUser extends core_1.BaseEntity {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.id = (0, crypto_1.randomUUID)();
|
|
18
19
|
this.createdAt = new Date();
|
|
19
20
|
this.updatedAt = new Date();
|
|
20
|
-
this.personalAccessTokens = new core_1.Collection(this);
|
|
21
|
-
this.id = data.id;
|
|
22
|
-
this.name = data.name;
|
|
23
|
-
this.email = data.email;
|
|
24
|
-
this.password = data.password;
|
|
25
|
-
data.permissions !== void 0 && (this.permissions = data.permissions);
|
|
26
|
-
data.createdAt !== void 0 && (this.createdAt = data.createdAt);
|
|
27
|
-
data.updatedAt !== void 0 && (this.updatedAt = data.updatedAt);
|
|
28
|
-
data.personalAccessTokens !== void 0 &&
|
|
29
|
-
(this.personalAccessTokens = data.personalAccessTokens);
|
|
30
21
|
}
|
|
31
22
|
};
|
|
32
|
-
exports.
|
|
23
|
+
exports.BaseUser = BaseUser;
|
|
33
24
|
__decorate([
|
|
34
|
-
(0, core_1.PrimaryKey)(),
|
|
35
|
-
__metadata("design:type",
|
|
36
|
-
],
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, core_1.Property)({ type: core_1.t.string }),
|
|
39
|
-
__metadata("design:type", String)
|
|
40
|
-
], User.prototype, "name", void 0);
|
|
25
|
+
(0, core_1.PrimaryKey)({ type: core_1.t.uuid }),
|
|
26
|
+
__metadata("design:type", Object)
|
|
27
|
+
], BaseUser.prototype, "id", void 0);
|
|
41
28
|
__decorate([
|
|
42
|
-
(0, core_1.Property)({ type: core_1.t.
|
|
29
|
+
(0, core_1.Property)({ type: core_1.t.text }),
|
|
43
30
|
__metadata("design:type", String)
|
|
44
|
-
],
|
|
31
|
+
], BaseUser.prototype, "name", void 0);
|
|
45
32
|
__decorate([
|
|
46
|
-
(0, core_1.Property)({ type: core_1.t.
|
|
33
|
+
(0, core_1.Property)({ type: core_1.t.text }),
|
|
34
|
+
(0, core_1.Unique)(),
|
|
47
35
|
__metadata("design:type", String)
|
|
48
|
-
],
|
|
36
|
+
], BaseUser.prototype, "email", void 0);
|
|
49
37
|
__decorate([
|
|
50
|
-
(0, core_1.Property)({ type: core_1.t.
|
|
51
|
-
__metadata("design:type",
|
|
52
|
-
],
|
|
38
|
+
(0, core_1.Property)({ type: core_1.t.boolean, default: false }),
|
|
39
|
+
__metadata("design:type", Boolean)
|
|
40
|
+
], BaseUser.prototype, "emailVerified", void 0);
|
|
53
41
|
__decorate([
|
|
54
|
-
(0, core_1.Property)(),
|
|
42
|
+
(0, core_1.Property)({ type: core_1.t.text, nullable: true }),
|
|
55
43
|
__metadata("design:type", Object)
|
|
56
|
-
],
|
|
44
|
+
], BaseUser.prototype, "image", void 0);
|
|
57
45
|
__decorate([
|
|
58
|
-
(0, core_1.Property)(),
|
|
46
|
+
(0, core_1.Property)({ type: core_1.t.datetime, defaultRaw: "now()" }),
|
|
59
47
|
__metadata("design:type", Object)
|
|
60
|
-
],
|
|
48
|
+
], BaseUser.prototype, "createdAt", void 0);
|
|
61
49
|
__decorate([
|
|
62
|
-
(0, core_1.
|
|
50
|
+
(0, core_1.Property)({
|
|
51
|
+
type: core_1.t.datetime,
|
|
52
|
+
defaultRaw: "now()",
|
|
53
|
+
onUpdate: () => new Date(),
|
|
54
|
+
}),
|
|
63
55
|
__metadata("design:type", Object)
|
|
64
|
-
],
|
|
65
|
-
exports.
|
|
66
|
-
(0, core_1.Entity)()
|
|
67
|
-
|
|
68
|
-
], User);
|
|
56
|
+
], BaseUser.prototype, "updatedAt", void 0);
|
|
57
|
+
exports.BaseUser = BaseUser = __decorate([
|
|
58
|
+
(0, core_1.Entity)({ abstract: true })
|
|
59
|
+
], BaseUser);
|
|
69
60
|
//# sourceMappingURL=user.entity.js.map
|