adaptic-backend 1.0.253 → 1.0.254

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adaptic-backend",
3
- "version": "1.0.253",
3
+ "version": "1.0.254",
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",
@@ -1,7 +1,6 @@
1
1
  import { Request, Response, NextFunction } from "express";
2
- interface AuthenticatedRequest extends Request {
2
+ export interface AuthenticatedRequest extends Request {
3
3
  user?: any;
4
4
  }
5
5
  export declare const authMiddleware: (req: AuthenticatedRequest, res: Response, next: NextFunction) => Response<any, Record<string, any>> | undefined;
6
- export {};
7
6
  //# sourceMappingURL=auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/middleware/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG1D,UAAU,oBAAqB,SAAQ,OAAO;IAC5C,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,eAAO,MAAM,cAAc,QAAS,oBAAoB,OAAO,QAAQ,QAAQ,YAAY,mDAa1F,CAAC"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/middleware/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG1D,MAAM,WAAW,oBAAqB,SAAQ,OAAO;IACnD,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,eAAO,MAAM,cAAc,QAAS,oBAAoB,OAAO,QAAQ,QAAQ,YAAY,mDAa1F,CAAC"}
package/server.cjs CHANGED
@@ -56,7 +56,7 @@ const startServer = async () => {
56
56
  });
57
57
  const app = (0, express_1.default)();
58
58
  const httpServer = (0, http_1.createServer)(app);
59
- app.use('/api', auth_1.authMiddleware);
59
+ app.use('/api', (req, res, next) => (0, auth_1.authMiddleware)(req, res, next));
60
60
  const server = new server_1.ApolloServer({
61
61
  schema,
62
62
  introspection: true,
@@ -117,7 +117,7 @@ const startServer = async () => {
117
117
  },
118
118
  });
119
119
  await server.start();
120
- app.use((0, cors_1.default)(), body_parser_1.default.json(), (0, express4_1.expressMiddleware)(server, {
120
+ app.use('/graphql', (0, cors_1.default)(), body_parser_1.default.json(), (0, express4_1.expressMiddleware)(server, {
121
121
  context: async ({ req }) => {
122
122
  var _a;
123
123
  console.log('Received headers:', req.headers);