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 CHANGED
@@ -10,12 +10,7 @@ const context_cjs_1 = require("@apollo/client/link/context/context.cjs");
10
10
  const getToken_1 = require("./getToken.cjs");
11
11
  const error_cjs_1 = require("@apollo/client/link/error/error.cjs");
12
12
  const cross_fetch_1 = __importDefault(require("cross-fetch"));
13
- const https_1 = require("https");
14
- const http_1 = require("http");
15
13
  const httpUrl = process.env.BACKEND_HTTPS_URL || process.env.NODE_ENV === "production" ? "https://api.adaptic.ai/graphql" : "http://localhost:4000/graphql";
16
- const httpAgent = new http_1.Agent({ keepAlive: false });
17
- const httpsAgent = new https_1.Agent({ keepAlive: false });
18
- const agent = httpUrl.startsWith("https") ? httpsAgent : httpAgent;
19
14
  /**
20
15
  * Function to get the authentication token using the custom getToken implementation
21
16
  */
@@ -45,13 +40,7 @@ async function getAuthToken(req) {
45
40
  * Function to create a new Apollo Client instance
46
41
  */
47
42
  function createApolloClient(req) {
48
- const httpLink = new client_1.HttpLink({
49
- uri: httpUrl,
50
- fetch: cross_fetch_1.default,
51
- fetchOptions: {
52
- agent: agent,
53
- },
54
- });
43
+ const httpLink = new client_1.HttpLink({ uri: httpUrl, fetch: cross_fetch_1.default });
55
44
  const authLink = (0, context_cjs_1.setContext)(async (_, { headers }) => {
56
45
  const token = await getAuthToken(req);
57
46
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adaptic-backend",
3
- "version": "1.0.188",
3
+ "version": "1.0.190",
4
4
  "description": "Backend executable CRUD functions with dynamic variables construction, and type definitions for the Adaptic AI platform.",
5
5
  "type": "module",
6
6
  "types": "index.d.ts",
package/prismaClient.cjs CHANGED
@@ -1,6 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.prisma = void 0;
3
4
  const client_1 = require("@prisma/client");
4
- const prisma = new client_1.PrismaClient();
5
- exports.default = prisma;
5
+ const extension_accelerate_1 = require("@prisma/extension-accelerate");
6
+ const extension_pulse_1 = require("@prisma/extension-pulse");
7
+ exports.prisma = global.prisma ||
8
+ new client_1.PrismaClient()
9
+ .$extends((0, extension_accelerate_1.withAccelerate)())
10
+ .$extends((0, extension_pulse_1.withPulse)({ apiKey: process.env.PULSE_API_KEY || '' }));
11
+ global.prisma = exports.prisma;
6
12
  //# sourceMappingURL=prismaClient.js.map