@cequrebackends/cequre-ts 0.12.0 → 0.12.1

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.
@@ -45,6 +45,7 @@ class BunServerProvider {
45
45
  tls: finalTls,
46
46
  ...config.maxRequestBodySize ? { maxRequestBodySize: config.maxRequestBodySize } : {},
47
47
  ...config.routes ? { routes: config.routes } : {},
48
+ websocket: config.websocket,
48
49
  fetch: config.fetch
49
50
  });
50
51
  console.log(`\uD83D\uDE80 Cequre starting on http://${this.server.hostname}:${this.server.port}`);
package/dist/index.js CHANGED
@@ -2022,7 +2022,7 @@ class CequreRuntime {
2022
2022
  }
2023
2023
  return checkSecureChannel(room, req, user);
2024
2024
  };
2025
- this.router.get(`${prefix}/ws`, async (ctx) => this.realtimeProvider?.websocket?.route?.({ path: `${prefix}/ws`, onJoinRoom })(ctx.request, undefined));
2025
+ this.router.get(`${prefix}/ws`, async (ctx) => this.realtimeProvider?.websocket?.route?.({ path: `${prefix}/ws`, onJoinRoom })(ctx.request, ctx.state));
2026
2026
  this.router.get(`${prefix}/sse`, async (ctx) => {
2027
2027
  const resolveUser = async (request) => {
2028
2028
  const reqCtx = await this.getContext(request);
@@ -2939,7 +2939,7 @@ class CequreRuntime {
2939
2939
  tls: finalTls,
2940
2940
  ...maxRequestBodySize ? { maxRequestBodySize } : {},
2941
2941
  routes: nativeRoutes,
2942
- fetch: async (req) => {
2942
+ fetch: async (req, srv) => {
2943
2943
  if (this.shuttingDown) {
2944
2944
  return new Response("Service Unavailable", { status: 503, headers: { Connection: "close" } });
2945
2945
  }
@@ -2968,7 +2968,7 @@ class CequreRuntime {
2968
2968
  await plugin.beforeRequest(ctx);
2969
2969
  }
2970
2970
  let executionPromise = (async () => {
2971
- let r2 = await this.router.handle(req, undefined, ctx.user, this);
2971
+ let r2 = await this.router.handle(req, srv, ctx.user, this);
2972
2972
  return r2 || new Response("Not found", { status: 404 });
2973
2973
  })();
2974
2974
  const timeoutMs = this.schema.core?.api?.requestTimeoutMs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cequrebackends/cequre-ts",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "The Cequre Universal Runtime Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",