appflare 0.2.2 → 0.2.3

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.
@@ -43,9 +43,9 @@ export class AppflareRealtimeDurableObject {
43
43
  const authToken =
44
44
  typeof payload?.authToken === "string" ? payload.authToken : "";
45
45
 
46
- if (!token || !authToken) {
46
+ if (!token ) {
47
47
  return new Response(
48
- JSON.stringify({ message: "token and authToken are required" }),
48
+ JSON.stringify({ message: "token is required" }),
49
49
  {
50
50
  status: 400,
51
51
  headers: { "content-type": "application/json" },
@@ -104,7 +104,7 @@ export class AppflareRealtimeDurableObject {
104
104
  const token = url.searchParams.get("token") ?? "";
105
105
  const authToken = url.searchParams.get("authToken") ?? "";
106
106
  const subscription = this.subscriptions.get(token);
107
- if (!subscription || !authToken || subscription.authToken !== authToken) {
107
+ if (!subscription) {
108
108
  return new Response("Unauthorized", { status: 401 });
109
109
  }
110
110
 
@@ -14,8 +14,8 @@ function registerRealtimeRoutes(
14
14
  const authToken = typeof body.authToken === "string" ? body.authToken : "";
15
15
  const rawArgs = isRecord(body.args) ? body.args : {};
16
16
 
17
- if (!queryName || !authToken) {
18
- return c.json({ message: "queryName and authToken are required" }, 400);
17
+ if (!queryName) {
18
+ return c.json({ message: "queryName is required" }, 400);
19
19
  }
20
20
 
21
21
  const operation = (realtimeQueryHandlers as Record<
@@ -95,8 +95,8 @@ function registerRealtimeRoutes(
95
95
  const token = typeof body.token === "string" ? body.token : "";
96
96
  const authToken = typeof body.authToken === "string" ? body.authToken : "";
97
97
 
98
- if (!token || !authToken) {
99
- return c.json({ message: "token and authToken are required" }, 400);
98
+ if (!token ) {
99
+ return c.json({ message: "token is required" }, 400);
100
100
  }
101
101
 
102
102
  const authSession = await validateAuthToken(
package/index.ts CHANGED
@@ -18,10 +18,3 @@ export {
18
18
  type SchemaDefinition,
19
19
  type TableDefinition,
20
20
  } from "./schema";
21
- export { useQuery } from "./react";
22
- export { useInfiniteQuery } from "./react";
23
- export { useMutation } from "./react";
24
- export type {
25
- UseAppflareQueryOptions,
26
- UseAppflareInfiniteQueryOptions,
27
- } from "./react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appflare",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "bin": {
5
5
  "appflare": "./cli/index.ts"
6
6
  },