better-convex-nuxt 0.1.5 → 0.1.6

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/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.0.0"
6
6
  },
7
- "version": "0.1.5",
7
+ "version": "0.1.6",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -19,14 +19,14 @@ export async function fetchQuery(convexUrl, query, args, options) {
19
19
  headers["Authorization"] = `Bearer ${options.authToken}`;
20
20
  }
21
21
  try {
22
- const response = await $fetch(`${convexUrl}/api/query`, {
22
+ const response = await fetch(`${convexUrl}/api/query`, {
23
23
  method: "POST",
24
24
  headers,
25
- body: {
25
+ body: JSON.stringify({
26
26
  path: functionPath,
27
27
  args: args ?? {}
28
- }
29
- });
28
+ })
29
+ }).then((r) => r.json());
30
30
  const result = parseConvexResponse(response);
31
31
  log("Success", result);
32
32
  return result;
@@ -55,14 +55,14 @@ export async function fetchMutation(convexUrl, mutation, args, options) {
55
55
  headers["Authorization"] = `Bearer ${options.authToken}`;
56
56
  }
57
57
  try {
58
- const response = await $fetch(`${convexUrl}/api/mutation`, {
58
+ const response = await fetch(`${convexUrl}/api/mutation`, {
59
59
  method: "POST",
60
60
  headers,
61
- body: {
61
+ body: JSON.stringify({
62
62
  path: functionPath,
63
63
  args: args ?? {}
64
- }
65
- });
64
+ })
65
+ }).then((r) => r.json());
66
66
  const result = parseConvexResponse(response);
67
67
  log("Success", result);
68
68
  return result;
@@ -91,14 +91,14 @@ export async function fetchAction(convexUrl, action, args, options) {
91
91
  headers["Authorization"] = `Bearer ${options.authToken}`;
92
92
  }
93
93
  try {
94
- const response = await $fetch(`${convexUrl}/api/action`, {
94
+ const response = await fetch(`${convexUrl}/api/action`, {
95
95
  method: "POST",
96
96
  headers,
97
- body: {
97
+ body: JSON.stringify({
98
98
  path: functionPath,
99
99
  args: args ?? {}
100
- }
101
- });
100
+ })
101
+ }).then((r) => r.json());
102
102
  const result = parseConvexResponse(response);
103
103
  log("Success", result);
104
104
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-convex-nuxt",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Full-featured Convex integration for Nuxt with SSR, real-time subscriptions, authentication, and permissions",
5
5
  "keywords": [
6
6
  "authentication",
@@ -35,6 +35,9 @@
35
35
  "*": {
36
36
  ".": [
37
37
  "./dist/types.d.mts"
38
+ ],
39
+ "server": [
40
+ "./dist/runtime/server/utils/convex.d.ts"
38
41
  ]
39
42
  }
40
43
  },
@@ -42,6 +45,10 @@
42
45
  ".": {
43
46
  "types": "./dist/types.d.mts",
44
47
  "import": "./dist/module.mjs"
48
+ },
49
+ "./server": {
50
+ "types": "./dist/runtime/server/utils/convex.d.ts",
51
+ "import": "./dist/runtime/server/utils/convex.js"
45
52
  }
46
53
  },
47
54
  "scripts": {