adaptic-backend 1.0.188 → 1.0.190
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/client.cjs +1 -12
- package/package.json +1 -1
- package/prismaClient.cjs +8 -2
- package/prismaClient.d.ts +532 -2
- package/server/client.d.ts.map +1 -1
- package/server/client.js.map +1 -1
- package/server/client.mjs +1 -12
- package/server/prismaClient.d.ts +532 -2
- package/server/prismaClient.d.ts.map +1 -1
- package/server/prismaClient.js.map +1 -1
- package/server/prismaClient.mjs +7 -2
- package/server.cjs +9 -5
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"prismaClient.d.ts","sourceRoot":"","sources":["../../src/prismaClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
1
|
+
{"version":3,"file":"prismaClient.d.ts","sourceRoot":"","sources":["../../src/prismaClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,OAAO,CAAC,MAAM,CAAC;IACb,IAAI,MAAM,EAAE,YAAY,GAAG,SAAS,CAAC;CACtC;AAGD,eAAO,MAAM,MAAM;;;;0DAIe,gCAAmC,kBAErD,gCACN,kCAAkC,8BAAgB,kCAAgC,8BAAgB,2BAA2B,gCAAmC;6DAAiF,gCAAmC,oBAAoB,gCAAmC,gCAAgC,8BAAgB,8CAA4C,8BAAgB,2BAA2B,gCAAmC;iEAAqF,gCAAmC,oBAAoB,gCAAmC,oCAAoC,8BAAgB,8CAA4C,8BAAgB,2BAA2B,gCAAmC;wEAAuG,gCAAmC,oBAAoB,gCAAmC,2CAA2C,8BAAgB,8CAA4C,8BAAgB,2BAA2B,gCAAmC;gEAA+F,gCAAmC,oBAAoB,gCAAmC,mCAAmC,8BAAgB,8CAA4C,8BAAgB,2BAA2B,gCAAmC;iEAAwF,gCAAmC,oBAAoB,gCAAmC,qCAAqC,8BAAgB,kCAAgC,8BAAgB,2BAA2B,gCAAmC;wEAAwG,gCAAmC,oBAAoB,gCAAmC,4CAA4C,8BAAgB,kCAAgC,8BAAgB,2BAA2B,gCAAmC;8DAA8F,gCAAmC,oBAAoB,gCAAmC,kCAAkC,8BAAgB,kCAAgC,8BAAgB,2BAA2B,gCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAAwG,iDAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAHpoF,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"prismaClient.js","sourceRoot":"","sources":["../../src/prismaClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
1
|
+
{"version":3,"file":"prismaClient.js","sourceRoot":"","sources":["../../src/prismaClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAOnD,MAAM,CAAC,MAAM,MAAM,GACjB,MAAM,CAAC,MAAM;IACb,IAAI,YAAY,EAAE;SACf,QAAQ,CAAC,cAAc,EAAE,CAAC;SAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,GAAG,MAAsB,CAAC"}
|
package/server/prismaClient.mjs
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
import { PrismaClient } from '@prisma/client';
|
2
|
-
|
3
|
-
|
2
|
+
import { withAccelerate } from '@prisma/extension-accelerate';
|
3
|
+
import { withPulse } from '@prisma/extension-pulse';
|
4
|
+
export const prisma = global.prisma ||
|
5
|
+
new PrismaClient()
|
6
|
+
.$extends(withAccelerate())
|
7
|
+
.$extends(withPulse({ apiKey: process.env.PULSE_API_KEY || '' }));
|
8
|
+
global.prisma = prisma;
|
4
9
|
//# sourceMappingURL=prismaClient.js.map
|
package/server.cjs
CHANGED
@@ -17,7 +17,7 @@ const ws_1 = require("ws");
|
|
17
17
|
const ws_2 = require("graphql-ws/lib/use/ws");
|
18
18
|
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
19
19
|
const auth_1 = require("./middleware/auth");
|
20
|
-
const prismaClient_1 =
|
20
|
+
const prismaClient_1 = require("./prismaClient");
|
21
21
|
const startServer = async () => {
|
22
22
|
const schema = await (0, type_graphql_1.buildSchema)({
|
23
23
|
resolvers: typegraphql_prisma_1.resolvers,
|
@@ -58,10 +58,10 @@ const startServer = async () => {
|
|
58
58
|
catch (e) {
|
59
59
|
console.error('JWT verification failed:', e);
|
60
60
|
console.error('Received token:', token);
|
61
|
-
return { prisma: prismaClient_1.
|
61
|
+
return { prisma: prismaClient_1.prisma, req, authError: 'Invalid token' };
|
62
62
|
}
|
63
63
|
}
|
64
|
-
return { prisma: prismaClient_1.
|
64
|
+
return { prisma: prismaClient_1.prisma, req, user };
|
65
65
|
},
|
66
66
|
}));
|
67
67
|
// Custom error handling middleware for express
|
@@ -90,10 +90,10 @@ const startServer = async () => {
|
|
90
90
|
}
|
91
91
|
catch (e) {
|
92
92
|
console.error('JWT verification failed:', e);
|
93
|
-
return { prisma: prismaClient_1.
|
93
|
+
return { prisma: prismaClient_1.prisma, authError: 'Invalid token' };
|
94
94
|
}
|
95
95
|
}
|
96
|
-
return { prisma: prismaClient_1.
|
96
|
+
return { prisma: prismaClient_1.prisma, user };
|
97
97
|
},
|
98
98
|
}, wsServer);
|
99
99
|
const PORT = process.env.PORT || 4000;
|
@@ -114,4 +114,8 @@ process.on('uncaughtException', (error) => {
|
|
114
114
|
console.error('Uncaught Exception:', error);
|
115
115
|
// Application specific logging, throwing an error, or other logic here
|
116
116
|
});
|
117
|
+
process.on('SIGINT', async () => {
|
118
|
+
await prismaClient_1.prisma.$disconnect();
|
119
|
+
process.exit(0);
|
120
|
+
});
|
117
121
|
//# sourceMappingURL=server.js.map
|