@takentrade/takentrade-libs 1.2.65 → 1.2.67
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.
|
@@ -147,13 +147,11 @@ export interface DeviceVerificationMailData extends BaseEmailData {
|
|
|
147
147
|
otp: string;
|
|
148
148
|
deviceId: string;
|
|
149
149
|
deviceName?: string;
|
|
150
|
-
ipAddress?: string;
|
|
151
150
|
time?: string;
|
|
152
151
|
expiration?: string;
|
|
153
152
|
}
|
|
154
153
|
export interface NewDeviceNotificationData extends BaseEmailData {
|
|
155
154
|
deviceId: string;
|
|
156
|
-
ipAddress: string;
|
|
157
155
|
loginTime: string;
|
|
158
156
|
deviceInfo?: string;
|
|
159
157
|
location?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnModuleDestroy, OnModuleInit } from '@nestjs/common';
|
|
2
2
|
import { PrismaClient } from '@prisma/client';
|
|
3
|
-
export declare class PrismaService extends PrismaClient implements OnModuleInit {
|
|
3
|
+
export declare class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
|
|
4
4
|
onModuleInit(): Promise<void>;
|
|
5
|
-
|
|
5
|
+
onModuleDestroy(): Promise<void>;
|
|
6
6
|
}
|
|
@@ -11,12 +11,16 @@ const common_1 = require("@nestjs/common");
|
|
|
11
11
|
const client_1 = require("@prisma/client");
|
|
12
12
|
let PrismaService = class PrismaService extends client_1.PrismaClient {
|
|
13
13
|
async onModuleInit() {
|
|
14
|
-
|
|
14
|
+
try {
|
|
15
|
+
await this.$connect();
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
common_1.Logger.error('Failed to connect to database', error);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
15
21
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
app.close().catch(console.error);
|
|
19
|
-
});
|
|
22
|
+
async onModuleDestroy() {
|
|
23
|
+
await this.$disconnect();
|
|
20
24
|
}
|
|
21
25
|
};
|
|
22
26
|
exports.PrismaService = PrismaService;
|