qarpeo 0.1.15 → 0.1.16

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.
@@ -2209,7 +2209,7 @@ const whoami = defineCommand({
2209
2209
  const main = defineCommand({
2210
2210
  meta: {
2211
2211
  name: "qp",
2212
- version: "0.1.15",
2212
+ version: "0.1.16",
2213
2213
  description: "Cloudflare-native powerhouse module for Nuxt"
2214
2214
  },
2215
2215
  subCommands: {
package/dist/module.mjs CHANGED
@@ -19,7 +19,7 @@ import 'drizzle-orm/node-sqlite';
19
19
  import 'node:process';
20
20
  import 'node:readline/promises';
21
21
 
22
- const version = "0.1.15";
22
+ const version = "0.1.16";
23
23
 
24
24
  function ensureDevEnv(rootDir) {
25
25
  const envPath = join(rootDir, ".env");
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<Response>>;
1
+ declare const _default: import("nuxt/server").EventHandler<Promise<Response>>;
2
2
  export default _default;
@@ -1,11 +1,19 @@
1
- import { defineEventHandler, readRawBody } from "h3";
1
+ import { defineEventHandler, getRequestURL, getRequestHeaders, readBody } from "nuxt/server";
2
2
  import { serverAuth } from "../../utils/auth.mjs";
3
3
  export default defineEventHandler(async (event) => {
4
4
  const auth = serverAuth(event);
5
- const req = event.req instanceof Request ? event.req : new Request(`http://${event.headers?.get?.("host") || "localhost"}${event.path || "/api/auth"}`, {
6
- method: event.method,
7
- headers: event.headers,
8
- body: ["POST", "PUT", "PATCH"].includes(event.method) ? await readRawBody(event) : void 0
5
+ const req = event.web?.request || event.req;
6
+ if (req instanceof Request) {
7
+ return auth.handler(req);
8
+ }
9
+ const url = getRequestURL(event);
10
+ const headers = getRequestHeaders(event);
11
+ const method = event.method || "GET";
12
+ const body = ["POST", "PUT", "PATCH"].includes(method) ? await readBody(event).catch(() => void 0) : void 0;
13
+ const request = new Request(url.toString(), {
14
+ method,
15
+ headers,
16
+ body: body ? typeof body === "string" ? body : JSON.stringify(body) : void 0
9
17
  });
10
- return auth.handler(req);
18
+ return auth.handler(request);
11
19
  });
@@ -1,6 +1,6 @@
1
1
  import { betterAuth } from "better-auth";
2
2
  import { drizzleAdapter } from "@better-auth/drizzle-adapter";
3
- import { createError } from "h3";
3
+ import { createError } from "nuxt/server";
4
4
  import { useDrizzle } from "./drizzle.mjs";
5
5
  import * as authSchema from "#qarpeo/auth/schema";
6
6
  export function serverAuth(event) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qarpeo",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "Zero-config Cloudflare Edge Platform for Nuxt",
5
5
  "keywords": [
6
6
  "analytics-engine",