evogram-gramjs 1.1.1 → 1.1.2
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.
|
@@ -18,6 +18,7 @@ export declare class DatabaseService {
|
|
|
18
18
|
saveSession(session: Partial<SessionEntity>): Promise<SessionEntity | null>;
|
|
19
19
|
updateSession(sessionId: string, session: Partial<SessionEntity>): Promise<SessionEntity | null>;
|
|
20
20
|
getSession(sessionId: string): Promise<SessionEntity | null>;
|
|
21
|
+
getSessionByUserId(userId: number): Promise<SessionEntity | null>;
|
|
21
22
|
getSessions(): Promise<SessionEntity[]>;
|
|
22
23
|
/**
|
|
23
24
|
* Закрывает подключение к базе данных
|
|
@@ -64,6 +64,13 @@ class DatabaseService {
|
|
|
64
64
|
return yield this.sessionRepository.findOne({ where: { sessionId } });
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
+
getSessionByUserId(userId) {
|
|
68
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
if (!this.isReady())
|
|
70
|
+
throw new Error('База данных не инициализирована');
|
|
71
|
+
return yield this.sessionRepository.findOne({ where: { userId } });
|
|
72
|
+
});
|
|
73
|
+
}
|
|
67
74
|
getSessions() {
|
|
68
75
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
69
76
|
if (!this.isReady())
|