better-supabase 0.6.0 → 0.7.0
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/{adapter-Bc1o3zyy.js → adapter-B-tL8hqg.js} +104 -25
- package/dist/ai-sdk/batches/index.d.ts +1 -1
- package/dist/ai-sdk/index.d.ts +1 -1
- package/dist/ai-sdk/mcp/index.d.ts +3 -3
- package/dist/{api-keys-rCGtKaZA.d.ts → api-keys-CIjghYjV.d.ts} +1 -1
- package/dist/astro/index.d.ts +4 -4
- package/dist/astro/index.js +2 -2
- package/dist/blocks/ai-providers/index.d.ts +1 -1
- package/dist/blocks/api-keys/index.d.ts +2 -2
- package/dist/blocks/attachments/index.d.ts +18 -4
- package/dist/blocks/attachments/index.js +16 -4
- package/dist/blocks/audit/index.js +1 -1
- package/dist/blocks/connectors/index.d.ts +1 -1
- package/dist/blocks/data-lifecycle/index.d.ts +11 -3
- package/dist/blocks/data-lifecycle/index.js +8 -3
- package/dist/blocks/entitlements/index.d.ts +1 -1
- package/dist/blocks/index.d.ts +1 -1
- package/dist/blocks/sso/index.d.ts +1 -1
- package/dist/blocks/workflow-builder/index.d.ts +2 -2
- package/dist/blocks/workflow-builder/react/index.d.ts +1 -1
- package/dist/chat-sdk/index.d.ts +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{doctor-B4JOm_ox.js → doctor-CVdnLahA.js} +66 -14
- package/dist/cli/{gen-BGLb_zou.js → gen-AIf4MREI.js} +1 -1
- package/dist/cli/gen-DSrahEdX.js +2 -0
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +3 -3
- package/dist/cli/{init-BIIwclPg.js → init-Cr6arjXU.js} +1 -1
- package/dist/cli/{introspect-DNUTuNvb.js → introspect-Bzuv1HHj.js} +1 -1
- package/dist/cli/{run-DNWxHynX.js → run-BO052mki.js} +7 -7
- package/dist/cli/{sql-D0GUtUPp.js → sql-B8csQPyn.js} +13 -54
- package/dist/cli/sql-layout-D6cphHT3.js +69 -0
- package/dist/cli/{version-hr88OZG0.js → version-Bp4fyubI.js} +1 -1
- package/dist/{composite-DhE66P5u.js → composite-C6I8ZyaF.js} +1 -1
- package/dist/{composite-Bt1YK3Ke.d.ts → composite-CpHLEo-G.d.ts} +3 -3
- package/dist/{connectors-hkLCwyEz.d.ts → connectors-CrpknU0P.d.ts} +1 -1
- package/dist/credentials/index.d.ts +2 -2
- package/dist/{csv-CPAzEmB6.js → csv-DCK-PT1n.js} +1 -1
- package/dist/edge/index.d.ts +5 -5
- package/dist/edge/index.js +3 -3
- package/dist/elysia/index.d.ts +1 -1
- package/dist/{ended-jLfvw8h-.d.ts → ended-XjeGQ5XW.d.ts} +4 -1
- package/dist/{entitlements-DHrY2UDZ.d.ts → entitlements-BKSVGtrG.d.ts} +1 -1
- package/dist/eve/index.d.ts +2 -2
- package/dist/eve/index.js +1 -1
- package/dist/{executor-D14tGopJ.d.ts → executor-BVBFM86G.d.ts} +1 -1
- package/dist/expo/index.d.ts +2 -2
- package/dist/expo/index.js +3 -3
- package/dist/{framework-CONDyPYx.js → framework-BDCpJI7o.js} +1 -1
- package/dist/{framework-DuVb4Xa8.d.ts → framework-KIPvRQJU.d.ts} +4 -4
- package/dist/h3/index.d.ts +1 -1
- package/dist/h3/v1/index.d.ts +1 -1
- package/dist/hono/index.d.ts +6 -6
- package/dist/hono/index.js +2 -2
- package/dist/{index-DDrYaUcq.d.ts → index-CdZKQF98.d.ts} +1 -1
- package/dist/{index-CtuakVRc.d.ts → index-CewnYSpv.d.ts} +1 -1
- package/dist/{kit-B5tid-q5.d.ts → kit-CkNzZUqv.d.ts} +3 -3
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/sdk/index.d.ts +3 -3
- package/dist/mcp/sdk/index.js +1 -1
- package/dist/nestjs/index.d.ts +2 -2
- package/dist/next/index.d.ts +13 -8
- package/dist/next/index.js +5 -5
- package/dist/node/index.d.ts +2 -2
- package/dist/orpc/index.d.ts +4 -4
- package/dist/orpc/index.js +1 -1
- package/dist/otel/index.js +5 -5
- package/dist/{provider-BH5UWZJ6.d.ts → provider-D-UEMvSD.d.ts} +1 -1
- package/dist/react/index.d.ts +5 -5
- package/dist/react/server.d.ts +5 -5
- package/dist/react/session.d.ts +2 -2
- package/dist/react-router/index.d.ts +4 -4
- package/dist/react-router/index.js +2 -2
- package/dist/{refusal-D1rgbzNq.d.ts → refusal-DhSU2Vvr.d.ts} +1 -1
- package/dist/{resolve-KW8nCeL6.d.ts → resolve-ChTYeTEl.d.ts} +3 -0
- package/dist/{resolve-D_IcnvFd.js → resolve-tJZY3FEa.js} +12 -7
- package/dist/{resource-D6Uc7Sk7.d.ts → resource-IPS5xi9q.d.ts} +1 -1
- package/dist/{respond-DoBijysA.d.ts → respond-DprrgyXX.d.ts} +1 -1
- package/dist/server/index.d.ts +47 -10
- package/dist/server/index.js +27 -5
- package/dist/{server-CeVeeXwz.d.ts → server-ZSJ9rCcV.d.ts} +27 -3
- package/dist/solid/index.d.ts +2 -2
- package/dist/solid-start/index.d.ts +4 -4
- package/dist/solid-start/index.js +2 -2
- package/dist/sql/index.d.ts +10 -0
- package/dist/sql/index.js +82 -13
- package/dist/ssr/index.d.ts +4 -4
- package/dist/ssr/index.js +1 -1
- package/dist/{support-BivNqSpK.js → support-DWwzVf-O.js} +1 -1
- package/dist/{support-view-33Oi07TT.d.ts → support-view-CVOJJLpc.d.ts} +1 -1
- package/dist/svelte/index.d.ts +1 -1
- package/dist/sveltekit/index.d.ts +4 -4
- package/dist/sveltekit/index.js +2 -2
- package/dist/tanstack-start/index.d.ts +4 -4
- package/dist/tanstack-start/index.js +2 -2
- package/dist/{tenant-icPeuUBN.d.ts → tenant-BxNFk9bx.d.ts} +1 -1
- package/dist/testing/index.d.ts +5 -5
- package/dist/{types-TaiEeBGA.d.ts → types-6rocye-y.d.ts} +1 -1
- package/dist/{types-BI-0Sl2v.d.ts → types-AYOvcyep.d.ts} +1 -1
- package/dist/{vault-CSO7ss5C.d.ts → vault-wlbBhqm7.d.ts} +1 -1
- package/dist/vercel-connect/index.d.ts +1 -1
- package/dist/{version-Bvv6aLjZ.js → version--AolB5ej.js} +1 -1
- package/dist/{view-DbxLNu8L.d.ts → view-CF7ihnkg.d.ts} +1 -1
- package/dist/vue/index.d.ts +2 -2
- package/dist/workflow-sdk/builder/index.d.ts +2 -2
- package/package.json +1 -1
- package/schemas/doctor-report-v1.json +2 -0
- package/dist/cli/gen-DAH8FM2W.js +0 -2
package/dist/expo/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as DbException } from "../db-exception-CnWcYPxL.js";
|
|
2
2
|
import { o as toProblem } from "../problem-BreOl8b8.js";
|
|
3
|
-
import { a as unexpectedResponse, c as extendServer, s as createServer, y as refreshFor } from "../adapter-
|
|
4
|
-
import { m as serializeCookie } from "../resolve-
|
|
3
|
+
import { a as unexpectedResponse, c as extendServer, s as createServer, y as refreshFor } from "../adapter-B-tL8hqg.js";
|
|
4
|
+
import { m as serializeCookie } from "../resolve-tJZY3FEa.js";
|
|
5
5
|
import { a as respond, r as guard, t as defaultExpose } from "../respond-BUgsXNgk.js";
|
|
6
|
-
import { t as withBetterSupabase } from "../composite-
|
|
6
|
+
import { t as withBetterSupabase } from "../composite-C6I8ZyaF.js";
|
|
7
7
|
import { r as handoffOf } from "../shared-CBxosKK3.js";
|
|
8
8
|
import { bufferRequest, pipeline, seedContext } from "@supabase/middleware";
|
|
9
9
|
import { StatusError, setResponseHeaders } from "expo-server";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as toSession } from "./view-BeFcRV6G.js";
|
|
2
|
-
import { t as withBetterSupabase } from "./composite-
|
|
2
|
+
import { t as withBetterSupabase } from "./composite-C6I8ZyaF.js";
|
|
3
3
|
//#region src/server/framework.ts
|
|
4
4
|
/** Every caller: the framework factories guard per loader, action or route instead. */
|
|
5
5
|
const EVERY_CALLER = [
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as AnyModels, i as AnyFunctions } from "./types-6BdhkmZe.js";
|
|
2
|
-
import { o as ServerOptions } from "./server-
|
|
3
|
-
import { t as AuthSession } from "./view-
|
|
4
|
-
import { a as SessionEntryConfig, n as BetterSupabaseContributions } from "./composite-
|
|
5
|
-
import { t as RefusalRedirects } from "./refusal-
|
|
2
|
+
import { o as ServerOptions } from "./server-ZSJ9rCcV.js";
|
|
3
|
+
import { t as AuthSession } from "./view-CF7ihnkg.js";
|
|
4
|
+
import { a as SessionEntryConfig, n as BetterSupabaseContributions } from "./composite-CpHLEo-G.js";
|
|
5
|
+
import { t as RefusalRedirects } from "./refusal-DhSU2Vvr.js";
|
|
6
6
|
//#region src/server/framework.d.ts
|
|
7
7
|
/** What the framework factories (`createSvelteKit`, `createReactRouter`, `createTanStackStart`) take. */
|
|
8
8
|
interface FrameworkOptions extends ServerOptions, RefusalRedirects, Pick<SessionEntryConfig, "checkSession" | "cookieScopes" | "encode"> {
|
package/dist/h3/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as RouteGuardOptions } from "../refusal-
|
|
1
|
+
import { n as RouteGuardOptions } from "../refusal-DhSU2Vvr.js";
|
|
2
2
|
import { t as Validated } from "../shared-DDSjEGDR.js";
|
|
3
3
|
import { AnyEntry, Contributions } from "@supabase/middleware";
|
|
4
4
|
//#region src/bridges/h3.d.ts
|
package/dist/h3/v1/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as RouteGuardOptions } from "../../refusal-
|
|
1
|
+
import { n as RouteGuardOptions } from "../../refusal-DhSU2Vvr.js";
|
|
2
2
|
import { t as Validated } from "../../shared-DDSjEGDR.js";
|
|
3
3
|
import { n as NodeRequestHead, t as NodeHeaderTarget } from "../../node-headers-AO06VhqH.js";
|
|
4
4
|
import { AnyEntry, Contributions } from "@supabase/middleware";
|
package/dist/hono/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { L as TableKey, a as AnyModels, i as AnyFunctions } from "../types-6BdhkmZe.js";
|
|
2
|
-
import { r as AuthState } from "../resolve-
|
|
2
|
+
import { r as AuthState } from "../resolve-ChTYeTEl.js";
|
|
3
3
|
import { t as BetterSupabase } from "../define-CJJkkr1-.js";
|
|
4
|
-
import { i as ServerContext, o as ServerOptions, t as BetterServer } from "../server-
|
|
5
|
-
import { t as AuthSession } from "../view-
|
|
6
|
-
import { i as MiddlewareOptions, r as GuardOptions } from "../respond-
|
|
7
|
-
import { s as BlockRequireOptions } from "../kit-
|
|
8
|
-
import { a as ResourceRouteOptions } from "../resource-
|
|
4
|
+
import { i as ServerContext, o as ServerOptions, t as BetterServer } from "../server-ZSJ9rCcV.js";
|
|
5
|
+
import { t as AuthSession } from "../view-CF7ihnkg.js";
|
|
6
|
+
import { i as MiddlewareOptions, r as GuardOptions } from "../respond-DprrgyXX.js";
|
|
7
|
+
import { s as BlockRequireOptions } from "../kit-CkNzZUqv.js";
|
|
8
|
+
import { a as ResourceRouteOptions } from "../resource-IPS5xi9q.js";
|
|
9
9
|
import { AnyEntry, Contributions, ValidateEntries } from "@supabase/middleware";
|
|
10
10
|
import { Context, ErrorHandler, Hono, MiddlewareHandler } from "hono";
|
|
11
11
|
//#region src/bridges/hono.d.ts
|
package/dist/hono/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as dbErrorOf } from "../errors-B11Duf73.js";
|
|
2
2
|
import { a as problemResponse } from "../problem-BreOl8b8.js";
|
|
3
|
-
import { a as unexpectedResponse, c as extendServer, n as flushEvents, s as createServer } from "../adapter-
|
|
3
|
+
import { a as unexpectedResponse, c as extendServer, n as flushEvents, s as createServer } from "../adapter-B-tL8hqg.js";
|
|
4
4
|
import { n as toSession } from "../view-BeFcRV6G.js";
|
|
5
5
|
import { a as respond, t as defaultExpose } from "../respond-BUgsXNgk.js";
|
|
6
|
-
import { t as withBetterSupabase } from "../composite-
|
|
6
|
+
import { t as withBetterSupabase } from "../composite-C6I8ZyaF.js";
|
|
7
7
|
import { t as defineResource } from "../resource-BsvzCMlX.js";
|
|
8
8
|
import { i as requireCaller } from "../kit-Fm-Fv7q5.js";
|
|
9
9
|
import { r as handoffOf } from "../shared-CBxosKK3.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as RouteGuardOptions } from "./refusal-
|
|
1
|
+
import { n as RouteGuardOptions } from "./refusal-DhSU2Vvr.js";
|
|
2
2
|
import { t as Validated } from "./shared-DDSjEGDR.js";
|
|
3
3
|
import { AnyEntry, Contributions } from "@supabase/middleware";
|
|
4
4
|
import { IncomingMessage, ServerResponse } from "node:http";
|
|
@@ -3,7 +3,7 @@ import { it as QuerySpec } from "./define-CJJkkr1-.js";
|
|
|
3
3
|
import { C as UrlOptions, S as UploadOptions, x as UploadBody } from "./bucket-Cl46E3jS.js";
|
|
4
4
|
import { n as TemplateValues } from "./template-CwO38Do8.js";
|
|
5
5
|
import { t as AuthSnapshot } from "./bind-Bu_ZNa3W.js";
|
|
6
|
-
import { t as AuthSession } from "./view-
|
|
6
|
+
import { t as AuthSession } from "./view-CF7ihnkg.js";
|
|
7
7
|
import { S as Topic, _ as RealtimeClient, f as PresenceMember, g as PresenceSubscription, p as PresenceOptions, r as LiveCountSeed, u as EventSchemas, w as TopicHandlers, x as SubscriptionStatus, y as SubscribeOptions } from "./index-DunNRdnT.js";
|
|
8
8
|
import { a as BroadcastOptions, f as UseActionOptions, l as LiveQueryHookOptions, n as ActionInputOf, o as ClientLike, r as ActionResultOf, s as LiveCountHookOptions } from "./field-errors-BFOa7WhB.js";
|
|
9
9
|
import { SupabaseClient } from "@supabase/supabase-js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { b as DbError } from "./result-D7y2fT87.js";
|
|
2
|
-
import { r as AuthState } from "./resolve-
|
|
3
|
-
import { t as AuthSession } from "./view-
|
|
4
|
-
import { r as GuardOptions } from "./respond-
|
|
2
|
+
import { r as AuthState } from "./resolve-ChTYeTEl.js";
|
|
3
|
+
import { t as AuthSession } from "./view-CF7ihnkg.js";
|
|
4
|
+
import { r as GuardOptions } from "./respond-DprrgyXX.js";
|
|
5
5
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
6
6
|
//#region src/server/kit.d.ts
|
|
7
7
|
/** What a server action returns: plain data, safe across any serialization boundary. */
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { L as TableKey, a as AnyModels, i as AnyFunctions } from "../types-6BdhkmZe.js";
|
|
2
2
|
import { t as BetterSupabase } from "../define-CJJkkr1-.js";
|
|
3
|
-
import { i as ServerContext, o as ServerOptions, t as BetterServer } from "../server-
|
|
4
|
-
import { r as GuardOptions } from "../respond-
|
|
3
|
+
import { i as ServerContext, o as ServerOptions, t as BetterServer } from "../server-ZSJ9rCcV.js";
|
|
4
|
+
import { r as GuardOptions } from "../respond-DprrgyXX.js";
|
|
5
5
|
import { i as ResourceOperation } from "../index-Bxih3l0u.js";
|
|
6
|
-
import { a as ResourceRouteOptions } from "../resource-
|
|
6
|
+
import { a as ResourceRouteOptions } from "../resource-IPS5xi9q.js";
|
|
7
7
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
8
8
|
//#region src/mcp/mcp.d.ts
|
|
9
9
|
export declare const MCP_PROTOCOL_VERSION: string;
|
package/dist/mcp/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { n as validate } from "../standard-BK0cqJ7y.js";
|
|
|
4
4
|
import { a as problemResponse, o as toProblem } from "../problem-BreOl8b8.js";
|
|
5
5
|
import { t as SPEC_PINS } from "../spec-pins--j6mTok4.js";
|
|
6
6
|
import { t as buildJsonSchema } from "../json-schema-CvER4kgT.js";
|
|
7
|
-
import { c as extendServer, l as withExtra, n as flushEvents, s as createServer } from "../adapter-
|
|
7
|
+
import { c as extendServer, l as withExtra, n as flushEvents, s as createServer } from "../adapter-B-tL8hqg.js";
|
|
8
8
|
import { n as jsonResponse, t as jsonReplacer } from "../json-CEnpTHlZ.js";
|
|
9
9
|
import { o as settle, r as guard, t as defaultExpose } from "../respond-BUgsXNgk.js";
|
|
10
10
|
import { t as defineResource } from "../resource-BsvzCMlX.js";
|
package/dist/mcp/sdk/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as AnyModels, i as AnyFunctions } from "../../types-6BdhkmZe.js";
|
|
2
|
-
import { r as AuthState } from "../../resolve-
|
|
2
|
+
import { r as AuthState } from "../../resolve-ChTYeTEl.js";
|
|
3
3
|
import { t as BetterSupabase } from "../../define-CJJkkr1-.js";
|
|
4
|
-
import { i as ServerContext$1, o as ServerOptions, t as BetterServer } from "../../server-
|
|
5
|
-
import { r as GuardOptions, t as AllowedCaller } from "../../respond-
|
|
4
|
+
import { i as ServerContext$1, o as ServerOptions, t as BetterServer } from "../../server-ZSJ9rCcV.js";
|
|
5
|
+
import { r as GuardOptions, t as AllowedCaller } from "../../respond-DprrgyXX.js";
|
|
6
6
|
import { AuthInfo, CallToolResult, Icon, InputRequiredResult, OAuthTokenVerifier, RegisteredTool, ScopeChallengeHandler, ServerContext, StandardSchemaWithJSON, ToolAnnotations } from "@modelcontextprotocol/server";
|
|
7
7
|
//#region src/mcp/sdk/sdk.d.ts
|
|
8
8
|
interface McpAuthOptions extends ServerOptions, Omit<GuardOptions, "scopes"> {
|
package/dist/mcp/sdk/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as delegationOf } from "../../impersonation-DcqaTBHx.js";
|
|
2
|
-
import { c as extendServer, i as resolveToken, l as withExtra, n as flushEvents, s as createServer } from "../../adapter-
|
|
2
|
+
import { c as extendServer, i as resolveToken, l as withExtra, n as flushEvents, s as createServer } from "../../adapter-B-tL8hqg.js";
|
|
3
3
|
import { r as guard } from "../../respond-BUgsXNgk.js";
|
|
4
4
|
import { a as withCors, i as metadataPreflight, n as endpointPreflight, r as isMetadataRequest, t as discovery } from "../../http-DdYadv-o.js";
|
|
5
5
|
import { OAuthError, bearerAuthChallengeResponse, verifyBearerToken } from "@modelcontextprotocol/server";
|
package/dist/nestjs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as RouteGuardOptions } from "../refusal-
|
|
1
|
+
import { n as RouteGuardOptions } from "../refusal-DhSU2Vvr.js";
|
|
2
2
|
import { t as Validated } from "../shared-DDSjEGDR.js";
|
|
3
|
-
import { l as ToNodeOptions } from "../index-
|
|
3
|
+
import { l as ToNodeOptions } from "../index-CdZKQF98.js";
|
|
4
4
|
import { AnyEntry } from "@supabase/middleware";
|
|
5
5
|
import { IncomingMessage, ServerResponse } from "node:http";
|
|
6
6
|
//#region src/nestjs/index.d.ts
|
package/dist/next/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { a as AnyModels, i as AnyFunctions } from "../types-6BdhkmZe.js";
|
|
2
|
-
import { r as AuthState } from "../resolve-
|
|
2
|
+
import { r as AuthState } from "../resolve-ChTYeTEl.js";
|
|
3
3
|
import { B as DbStats, K as ReadSet, it as QuerySpec, t as BetterSupabase, u as CacheAdapter } from "../define-CJJkkr1-.js";
|
|
4
|
-
import { C as
|
|
4
|
+
import { A as supportSessions, C as ActiveSupport, D as SupportPolicy, E as SupportOptions, O as SupportSessions, i as ServerContext, k as SupportStartRequest, n as ContextOptions, o as ServerOptions, t as BetterServer } from "../server-ZSJ9rCcV.js";
|
|
5
5
|
import { n as AmrEntry, s as Impersonator, t as Aal } from "../mfa-Daak8ukG.js";
|
|
6
|
-
import { t as tenantOf } from "../tenant-
|
|
7
|
-
import { n as toSession, t as AuthSession } from "../view-
|
|
8
|
-
import { n as AuthKind, r as GuardOptions } from "../respond-
|
|
9
|
-
import { a as AuthorizedContext, c as Unwrapped, i as AuthorizeOptions, n as ActionParsed, r as ActionResult, t as ActionInput } from "../kit-
|
|
6
|
+
import { t as tenantOf } from "../tenant-BxNFk9bx.js";
|
|
7
|
+
import { n as toSession, t as AuthSession } from "../view-CF7ihnkg.js";
|
|
8
|
+
import { n as AuthKind, r as GuardOptions } from "../respond-DprrgyXX.js";
|
|
9
|
+
import { a as AuthorizedContext, c as Unwrapped, i as AuthorizeOptions, n as ActionParsed, r as ActionResult, t as ActionInput } from "../kit-CkNzZUqv.js";
|
|
10
10
|
import { r as LiveCountSeed, t as CountRunner } from "../index-DunNRdnT.js";
|
|
11
|
-
import { r as MembershipClaim } from "../entitlements-
|
|
11
|
+
import { r as MembershipClaim } from "../entitlements-BKSVGtrG.js";
|
|
12
12
|
import { i as tagFor, t as TagOptions } from "../tags-Cx-LnIQP.js";
|
|
13
|
-
import { n as supportOf, t as SupportView } from "../support-view-
|
|
13
|
+
import { n as supportOf, t as SupportView } from "../support-view-CVOJJLpc.js";
|
|
14
14
|
import { NextRequest } from "next/server.js";
|
|
15
15
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
16
16
|
//#region src/next/collector.d.ts
|
|
@@ -78,6 +78,11 @@ interface ProxyOptions<C = unknown, P = unknown> {
|
|
|
78
78
|
interface EndedSessionOptions {
|
|
79
79
|
readonly paths?: readonly string[];
|
|
80
80
|
readonly redirect?: string;
|
|
81
|
+
/** The `reason` query value on the redirect. Defaults to `session_ended` and `account_banned`. */
|
|
82
|
+
readonly reasons?: {
|
|
83
|
+
readonly ended?: string;
|
|
84
|
+
readonly banned?: string;
|
|
85
|
+
};
|
|
81
86
|
}
|
|
82
87
|
interface ActionOptions<S extends StandardSchemaV1 | undefined, C = unknown, P = unknown, R extends boolean = boolean> extends GuardOptions, AuthorizeOptions<ActionParsed<S>, C, P, R> {
|
|
83
88
|
/** Validates the input (plain object or `FormData`) with any Standard Schema. */
|
package/dist/next/index.js
CHANGED
|
@@ -9,10 +9,10 @@ import { a as problemResponse } from "../problem-BreOl8b8.js";
|
|
|
9
9
|
import { i as claimsOf } from "../claims-PqzCxaTD.js";
|
|
10
10
|
import { t as supportOf } from "../support-view-g4YLBeqX.js";
|
|
11
11
|
import { t as tenantOf } from "../tenant-I1TEZ_BX.js";
|
|
12
|
-
import { C as serverCore, c as extendServer, l as withExtra, n as flushEvents, p as supportCookieMaxAge, r as handle, s as createServer, t as bearerRequest, v as isPrefetch } from "../adapter-
|
|
12
|
+
import { C as serverCore, c as extendServer, l as withExtra, n as flushEvents, p as supportCookieMaxAge, r as handle, s as createServer, t as bearerRequest, v as isPrefetch } from "../adapter-B-tL8hqg.js";
|
|
13
13
|
import { a as checkAal, n as toSession } from "../view-BeFcRV6G.js";
|
|
14
14
|
import { o as settle, r as guard, t as defaultExpose } from "../respond-BUgsXNgk.js";
|
|
15
|
-
import { t as supportSessions } from "../support-
|
|
15
|
+
import { t as supportSessions } from "../support-DWwzVf-O.js";
|
|
16
16
|
import { r as tagFor, t as cacheTagsOf } from "../tags-B99_U9Pp.js";
|
|
17
17
|
import { n as formDataObject } from "../kit-Fm-Fv7q5.js";
|
|
18
18
|
import { cache } from "react";
|
|
@@ -286,9 +286,9 @@ function requireAal(level, options = {}) {
|
|
|
286
286
|
return NextResponse.redirect(target);
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
|
-
function endedRedirect(request, path) {
|
|
289
|
+
function endedRedirect(request, path, reason) {
|
|
290
290
|
const target = new URL(path, request.url);
|
|
291
|
-
target.searchParams.set("reason",
|
|
291
|
+
target.searchParams.set("reason", reason);
|
|
292
292
|
return NextResponse.redirect(target);
|
|
293
293
|
}
|
|
294
294
|
function shouldCheckSession(request, options = {}) {
|
|
@@ -485,7 +485,7 @@ function createNext(betterSupabase, options = {}) {
|
|
|
485
485
|
const rendersSignedOut = proxyOptions.expiredPrefetch === "render" && resolution.auth.kind === "anon" && resolution.auth.reason === "expired" && isPrefetch(request);
|
|
486
486
|
const protectMethods = proxyOptions.protectMethods;
|
|
487
487
|
const runsProtect = protectMethods === true ? true : (protectMethods ?? ["GET", "HEAD"]).includes(request.method);
|
|
488
|
-
const custom = (resolution.sessionEnded === true && sessionCheck?.redirect !== void 0 && request.nextUrl.pathname !== sessionCheck.redirect ? endedRedirect(request, sessionCheck.redirect) : void 0) ?? (rendersSignedOut || !runsProtect ? void 0 : await proxyOptions.protect?.(resolution.auth, request));
|
|
488
|
+
const custom = (resolution.sessionEnded === true && sessionCheck?.redirect !== void 0 && request.nextUrl.pathname !== sessionCheck.redirect ? endedRedirect(request, sessionCheck.redirect, resolution.sessionEndedReason === "banned" ? sessionCheck.reasons?.banned ?? "account_banned" : sessionCheck.reasons?.ended ?? "session_ended") : void 0) ?? (rendersSignedOut || !runsProtect ? void 0 : await proxyOptions.protect?.(resolution.auth, request));
|
|
489
489
|
const initial = custom ?? early;
|
|
490
490
|
if (!initial && resolution.cookies.length === 0 && !id && !proxyOptions.after && !proxyOptions.serverTiming) {
|
|
491
491
|
flushAfter();
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as RouteGuardOptions } from "../refusal-
|
|
1
|
+
import { n as RouteGuardOptions } from "../refusal-DhSU2Vvr.js";
|
|
2
2
|
import { i as toWebHeaders, r as applyWebHeaders, t as NodeHeaderTarget } from "../node-headers-AO06VhqH.js";
|
|
3
|
-
import { _ as toNodeHandler, a as FastifyReplyLike, b as toWebRequest, c as KoaMiddleware, d as guard, f as koaGuard, g as toKoa, h as toFastify, i as FastifyHook, l as ToNodeOptions, m as toExpress, n as ExpressMiddleware, o as FastifyRequestLike, p as problemErrorHandler, r as ExpressResponse, s as KoaContextLike, t as ExpressErrorHandler, u as fastifyGuard, v as WebRequestOptions, y as sendWebResponse } from "../index-
|
|
3
|
+
import { _ as toNodeHandler, a as FastifyReplyLike, b as toWebRequest, c as KoaMiddleware, d as guard, f as koaGuard, g as toKoa, h as toFastify, i as FastifyHook, l as ToNodeOptions, m as toExpress, n as ExpressMiddleware, o as FastifyRequestLike, p as problemErrorHandler, r as ExpressResponse, s as KoaContextLike, t as ExpressErrorHandler, u as fastifyGuard, v as WebRequestOptions, y as sendWebResponse } from "../index-CdZKQF98.js";
|
|
4
4
|
export { ExpressErrorHandler, ExpressMiddleware, ExpressResponse, FastifyHook, FastifyReplyLike, FastifyRequestLike, KoaContextLike, KoaMiddleware, type NodeHeaderTarget, type RouteGuardOptions, ToNodeOptions, type WebRequestOptions, applyWebHeaders, fastifyGuard, guard, koaGuard, problemErrorHandler, sendWebResponse, toExpress, toFastify, toKoa, toNodeHandler, toWebHeaders, toWebRequest };
|
package/dist/orpc/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { b as DbError, f as Result } from "../result-D7y2fT87.js";
|
|
2
2
|
import { a as AnyModels, i as AnyFunctions } from "../types-6BdhkmZe.js";
|
|
3
|
-
import { r as AuthState } from "../resolve-
|
|
3
|
+
import { r as AuthState } from "../resolve-ChTYeTEl.js";
|
|
4
4
|
import { i as ProblemDetails } from "../problem-DD8LZFjc.js";
|
|
5
5
|
import { t as BetterSupabase } from "../define-CJJkkr1-.js";
|
|
6
|
-
import { i as ServerContext, o as ServerOptions, t as BetterServer } from "../server-
|
|
7
|
-
import { i as MiddlewareOptions, r as GuardOptions } from "../respond-
|
|
8
|
-
import { s as BlockRequireOptions } from "../kit-
|
|
6
|
+
import { i as ServerContext, o as ServerOptions, t as BetterServer } from "../server-ZSJ9rCcV.js";
|
|
7
|
+
import { i as MiddlewareOptions, r as GuardOptions } from "../respond-DprrgyXX.js";
|
|
8
|
+
import { s as BlockRequireOptions } from "../kit-CkNzZUqv.js";
|
|
9
9
|
import { t as Validated } from "../shared-DDSjEGDR.js";
|
|
10
10
|
import { AnyEntry, Contributions } from "@supabase/middleware";
|
|
11
11
|
import { BuilderWithMiddlewares, DecoratedMiddleware, ORPCError } from "@orpc/server";
|
package/dist/orpc/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { r as dbErrorOf } from "../errors-B11Duf73.js";
|
|
|
2
2
|
import { o as toProblem } from "../problem-BreOl8b8.js";
|
|
3
3
|
import { i as claimsOf } from "../claims-PqzCxaTD.js";
|
|
4
4
|
import { t as tenantOf } from "../tenant-I1TEZ_BX.js";
|
|
5
|
-
import { c as extendServer, n as flushEvents, s as createServer, y as refreshFor } from "../adapter-
|
|
5
|
+
import { c as extendServer, n as flushEvents, s as createServer, y as refreshFor } from "../adapter-B-tL8hqg.js";
|
|
6
6
|
import { n as toSession } from "../view-BeFcRV6G.js";
|
|
7
7
|
import { o as settle, r as guard, t as defaultExpose } from "../respond-BUgsXNgk.js";
|
|
8
8
|
import { t as authorizeCaller } from "../kit-Fm-Fv7q5.js";
|
package/dist/otel/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as definePlugin } from "../plugin-tfXW1-qO.js";
|
|
2
2
|
import { t as SPEC_PINS } from "../spec-pins--j6mTok4.js";
|
|
3
3
|
import { r as blockEventAttributes } from "../block-events-CrT8r7Fe.js";
|
|
4
|
-
import "../version
|
|
4
|
+
import "../version--AolB5ej.js";
|
|
5
5
|
import { SpanKind, SpanStatusCode, context, metrics, propagation, trace } from "@opentelemetry/api";
|
|
6
6
|
//#region src/otel/index.ts
|
|
7
7
|
const INSTRUMENTATION_NAME = "better-supabase";
|
|
@@ -40,9 +40,9 @@ function systemOf(executor) {
|
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
42
|
function otel(options = {}) {
|
|
43
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.
|
|
43
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.7.0");
|
|
44
44
|
let histogram;
|
|
45
|
-
if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.
|
|
45
|
+
if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.7.0")).createHistogram("db.client.operation.duration", {
|
|
46
46
|
unit: "s",
|
|
47
47
|
description: "Duration of database client operations.",
|
|
48
48
|
advice: { explicitBucketBoundaries: [
|
|
@@ -181,7 +181,7 @@ function otel(options = {}) {
|
|
|
181
181
|
* Returns a function that stops listening.
|
|
182
182
|
*/
|
|
183
183
|
function traceAuth(betterSupabase, options = {}) {
|
|
184
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.
|
|
184
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.7.0");
|
|
185
185
|
const offAuth = betterSupabase.events.on("auth", (event) => {
|
|
186
186
|
const span = tracer.startSpan("auth.resolve", {
|
|
187
187
|
kind: SpanKind.INTERNAL,
|
|
@@ -219,7 +219,7 @@ function traceAuth(betterSupabase, options = {}) {
|
|
|
219
219
|
* set an error status. Returns a function that stops listening.
|
|
220
220
|
*/
|
|
221
221
|
function traceBlockEvents(betterSupabase, options = {}) {
|
|
222
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.
|
|
222
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.7.0");
|
|
223
223
|
return betterSupabase.events.on("block", (event) => {
|
|
224
224
|
const attributes = {
|
|
225
225
|
...options.attributes,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { b as DbError, t as AsyncResult } from "./result-D7y2fT87.js";
|
|
3
|
-
import { r as AuthState } from "./resolve-
|
|
3
|
+
import { r as AuthState } from "./resolve-ChTYeTEl.js";
|
|
4
4
|
//#region src/credentials/provider.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Names a credential without holding it. Tables store this as a
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as escapeLike } from "../escape-like-ImTK0ps_.js";
|
|
2
2
|
import { s as Impersonator } from "../mfa-Daak8ukG.js";
|
|
3
|
-
import { t as tenantOf } from "../tenant-
|
|
4
|
-
import { t as AuthSession } from "../view-
|
|
3
|
+
import { t as tenantOf } from "../tenant-BxNFk9bx.js";
|
|
4
|
+
import { t as AuthSession } from "../view-CF7ihnkg.js";
|
|
5
5
|
import { r as LiveCountSeed } from "../index-DunNRdnT.js";
|
|
6
|
-
import { r as MembershipClaim } from "../entitlements-
|
|
7
|
-
import { n as supportOf, t as SupportView } from "../support-view-
|
|
6
|
+
import { r as MembershipClaim } from "../entitlements-BKSVGtrG.js";
|
|
7
|
+
import { n as supportOf, t as SupportView } from "../support-view-CVOJJLpc.js";
|
|
8
8
|
import { a as BroadcastOptions, f as UseActionOptions, l as LiveQueryHookOptions, n as ActionInputOf, o as ClientLike, r as ActionResultOf, s as LiveCountHookOptions, t as fieldErrorsOf } from "../field-errors-BFOa7WhB.js";
|
|
9
|
-
import { A as useLiveCount, C as BetterSupabaseProviderProps, D as createHooks, E as ProfileOf, M as useSupabase, O as useAuth, S as BetterSupabaseProvider, T as LiveCount, _ as ActionHandle, a as UploadTarget, b as useActionForm, c as useUpload, d as useDebouncedSearch, f as Presence, g as ActionForm, h as usePresence, i as UploadStatus, j as useLiveQuery, k as useBroadcast, l as DebouncedSearch, m as PresenceTopic, n as SignedUrlSource, o as UseUploadOptions, p as PresenceHookOptions, r as Upload, s as useSignedUrl, t as SignedUrl, u as DebouncedSearchOptions, v as UseActionFormOptions, w as ClaimsOf, x as BetterHooks, y as useAction } from "../index-
|
|
9
|
+
import { A as useLiveCount, C as BetterSupabaseProviderProps, D as createHooks, E as ProfileOf, M as useSupabase, O as useAuth, S as BetterSupabaseProvider, T as LiveCount, _ as ActionHandle, a as UploadTarget, b as useActionForm, c as useUpload, d as useDebouncedSearch, f as Presence, g as ActionForm, h as usePresence, i as UploadStatus, j as useLiveQuery, k as useBroadcast, l as DebouncedSearch, m as PresenceTopic, n as SignedUrlSource, o as UseUploadOptions, p as PresenceHookOptions, r as Upload, s as useSignedUrl, t as SignedUrl, u as DebouncedSearchOptions, v as UseActionFormOptions, w as ClaimsOf, x as BetterHooks, y as useAction } from "../index-CewnYSpv.js";
|
|
10
10
|
import { SessionProvider, SessionProviderProps, useSession, useSupportSession } from "./session.js";
|
|
11
11
|
import { a as useSignIn, i as SignOut, n as PendingState, o as useSignOut, r as SignIn, t as AuthHookOptions } from "../sign-in-BCV5S2WZ.js";
|
|
12
12
|
export { type ActionForm, type ActionHandle, type ActionInputOf, type ActionResultOf, type AuthHookOptions, type AuthSession, type BetterHooks, BetterSupabaseProvider, type BetterSupabaseProviderProps, type BroadcastOptions, type ClaimsOf, type ClientLike, type DebouncedSearch, type DebouncedSearchOptions, type Impersonator, type LiveCount, type LiveCountHookOptions, type LiveCountSeed, type LiveQueryHookOptions, type MembershipClaim, type PendingState, type Presence, type PresenceHookOptions, type PresenceTopic, type ProfileOf, SessionProvider, type SessionProviderProps, type SignIn, type SignOut, type SignedUrl, type SignedUrlSource, type SupportView, type Upload, type UploadStatus, type UploadTarget, type UseActionFormOptions, type UseActionOptions, type UseUploadOptions, createHooks, escapeLike, fieldErrorsOf, supportOf, tenantOf, useAction, useActionForm, useAuth, useBroadcast, useDebouncedSearch, useLiveCount, useLiveQuery, usePresence, useSession, useSignIn, useSignOut, useSignedUrl, useSupabase, useSupportSession, useUpload };
|
package/dist/react/server.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as escapeLike } from "../escape-like-ImTK0ps_.js";
|
|
2
2
|
import { it as QuerySpec } from "../define-CJJkkr1-.js";
|
|
3
3
|
import { s as Impersonator } from "../mfa-Daak8ukG.js";
|
|
4
|
-
import { t as tenantOf } from "../tenant-
|
|
5
|
-
import { t as AuthSession } from "../view-
|
|
4
|
+
import { t as tenantOf } from "../tenant-BxNFk9bx.js";
|
|
5
|
+
import { t as AuthSession } from "../view-CF7ihnkg.js";
|
|
6
6
|
import { r as LiveCountSeed } from "../index-DunNRdnT.js";
|
|
7
|
-
import { r as MembershipClaim } from "../entitlements-
|
|
8
|
-
import { n as supportOf, t as SupportView } from "../support-view-
|
|
7
|
+
import { r as MembershipClaim } from "../entitlements-BKSVGtrG.js";
|
|
8
|
+
import { n as supportOf, t as SupportView } from "../support-view-CVOJJLpc.js";
|
|
9
9
|
import { a as BroadcastOptions, f as UseActionOptions, l as LiveQueryHookOptions, n as ActionInputOf, o as ClientLike, r as ActionResultOf, s as LiveCountHookOptions, t as fieldErrorsOf } from "../field-errors-BFOa7WhB.js";
|
|
10
|
-
import { C as BetterSupabaseProviderProps, E as ProfileOf, M as useSupabase, O as useAuth, S as BetterSupabaseProvider, T as LiveCount, _ as ActionHandle, a as UploadTarget, c as useUpload$1, d as useDebouncedSearch$1, f as Presence, g as ActionForm, h as usePresence$1, i as UploadStatus, j as useLiveQuery, k as useBroadcast, l as DebouncedSearch, m as PresenceTopic, n as SignedUrlSource, o as UseUploadOptions, p as PresenceHookOptions, r as Upload, s as useSignedUrl$1, t as SignedUrl, u as DebouncedSearchOptions, v as UseActionFormOptions, w as ClaimsOf, x as BetterHooks } from "../index-
|
|
10
|
+
import { C as BetterSupabaseProviderProps, E as ProfileOf, M as useSupabase, O as useAuth, S as BetterSupabaseProvider, T as LiveCount, _ as ActionHandle, a as UploadTarget, c as useUpload$1, d as useDebouncedSearch$1, f as Presence, g as ActionForm, h as usePresence$1, i as UploadStatus, j as useLiveQuery, k as useBroadcast, l as DebouncedSearch, m as PresenceTopic, n as SignedUrlSource, o as UseUploadOptions, p as PresenceHookOptions, r as Upload, s as useSignedUrl$1, t as SignedUrl, u as DebouncedSearchOptions, v as UseActionFormOptions, w as ClaimsOf, x as BetterHooks } from "../index-CewnYSpv.js";
|
|
11
11
|
import { SessionProvider, SessionProviderProps } from "./session.js";
|
|
12
12
|
import { a as useSignIn$1, i as SignOut, n as PendingState, o as useSignOut$1, r as SignIn, t as AuthHookOptions } from "../sign-in-BCV5S2WZ.js";
|
|
13
13
|
//#region src/react/server.d.ts
|
package/dist/react/session.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as AuthSession } from "../view-
|
|
2
|
-
import { t as SupportView } from "../support-view-
|
|
1
|
+
import { t as AuthSession } from "../view-CF7ihnkg.js";
|
|
2
|
+
import { t as SupportView } from "../support-view-CVOJJLpc.js";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
//#region src/react/session.d.ts
|
|
5
5
|
export interface SessionProviderProps {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as AnyModels, i as AnyFunctions } from "../types-6BdhkmZe.js";
|
|
2
2
|
import { t as BetterSupabase } from "../define-CJJkkr1-.js";
|
|
3
|
-
import { t as BetterServer } from "../server-
|
|
4
|
-
import { a as AuthorizedContext, c as Unwrapped, i as AuthorizeOptions, n as ActionParsed, o as BlockActionOptions, r as ActionResult, s as BlockRequireOptions } from "../kit-
|
|
5
|
-
import { t as RefusalRedirects } from "../refusal-
|
|
6
|
-
import { n as FrameworkOptions, t as FrameworkLocals } from "../framework-
|
|
3
|
+
import { t as BetterServer } from "../server-ZSJ9rCcV.js";
|
|
4
|
+
import { a as AuthorizedContext, c as Unwrapped, i as AuthorizeOptions, n as ActionParsed, o as BlockActionOptions, r as ActionResult, s as BlockRequireOptions } from "../kit-CkNzZUqv.js";
|
|
5
|
+
import { t as RefusalRedirects } from "../refusal-DhSU2Vvr.js";
|
|
6
|
+
import { n as FrameworkOptions, t as FrameworkLocals } from "../framework-KIPvRQJU.js";
|
|
7
7
|
import { t as Validated } from "../shared-DDSjEGDR.js";
|
|
8
8
|
import { AnyEntry, Contributions } from "@supabase/middleware";
|
|
9
9
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as problemResponse } from "../problem-BreOl8b8.js";
|
|
2
|
-
import { c as extendServer, n as flushEvents, s as createServer } from "../adapter-
|
|
2
|
+
import { c as extendServer, n as flushEvents, s as createServer } from "../adapter-B-tL8hqg.js";
|
|
3
3
|
import { o as settle, t as defaultExpose } from "../respond-BUgsXNgk.js";
|
|
4
4
|
import { i as requireCaller, o as runAction } from "../kit-Fm-Fv7q5.js";
|
|
5
5
|
import { n as bufferInPlace, t as around } from "../shared-CBxosKK3.js";
|
|
6
|
-
import { i as localsOf, n as actionInput, r as frameworkEntry } from "../framework-
|
|
6
|
+
import { i as localsOf, n as actionInput, r as frameworkEntry } from "../framework-BDCpJI7o.js";
|
|
7
7
|
import { r as refusalResponse } from "../refusal-CeJWxmkH.js";
|
|
8
8
|
//#region src/bridges/react-router.ts
|
|
9
9
|
/**
|
|
@@ -147,7 +147,10 @@ interface AuthResolution<C = unknown, P = unknown> {
|
|
|
147
147
|
readonly requestCookies: readonly CookieRecord[];
|
|
148
148
|
/** Adds `cookies` and `headers` to a response. */
|
|
149
149
|
apply(response: Response): Response;
|
|
150
|
+
/** The session was ended server-side (revoked, deleted or banned); the cookies are cleared. */
|
|
150
151
|
readonly sessionEnded?: boolean;
|
|
152
|
+
/** Why `sessionEnded` is set: `banned` when Auth rejected the user as banned. */
|
|
153
|
+
readonly sessionEndedReason?: "ended" | "banned";
|
|
151
154
|
}
|
|
152
155
|
/** The first `x-forwarded-for` hop, the client as your edge saw it. */
|
|
153
156
|
declare function clientIp(request: Request): string | undefined;
|
|
@@ -164,8 +164,8 @@ async function sessionStatus(input, options) {
|
|
|
164
164
|
},
|
|
165
165
|
signal: AbortSignal.timeout(options.timeoutMs ?? DEFAULT_TIMEOUT_MS$1)
|
|
166
166
|
});
|
|
167
|
+
if (response.status === 401 || response.status === 403) return (await response.json().catch(() => null))?.["error_code"] === "user_banned" ? "banned" : "ended";
|
|
167
168
|
await response.body?.cancel();
|
|
168
|
-
if (response.status === 401 || response.status === 403) return "ended";
|
|
169
169
|
return response.ok ? "active" : "unknown";
|
|
170
170
|
} catch {
|
|
171
171
|
return "unknown";
|
|
@@ -237,6 +237,7 @@ async function request(refreshToken, options, now) {
|
|
|
237
237
|
ok: false,
|
|
238
238
|
reason: response.status >= 500 || response.status === 429 ? "network" : "rejected",
|
|
239
239
|
status: response.status,
|
|
240
|
+
...typeof body?.["error_code"] === "string" ? { code: body["error_code"] } : {},
|
|
240
241
|
message
|
|
241
242
|
};
|
|
242
243
|
}
|
|
@@ -502,12 +503,15 @@ async function verifyOnce(credentials, modes, options, source) {
|
|
|
502
503
|
reason: "none"
|
|
503
504
|
};
|
|
504
505
|
}
|
|
505
|
-
function resolution(auth, cookies, writes = [], ended
|
|
506
|
+
function resolution(auth, cookies, writes = [], ended) {
|
|
506
507
|
const headers = writes.length > 0 ? AUTH_CACHE_HEADERS : {};
|
|
507
508
|
let requestCookies;
|
|
508
509
|
return {
|
|
509
510
|
auth,
|
|
510
|
-
...ended ? {
|
|
511
|
+
...ended ? {
|
|
512
|
+
sessionEnded: true,
|
|
513
|
+
sessionEndedReason: ended
|
|
514
|
+
} : {},
|
|
511
515
|
cookies: writes,
|
|
512
516
|
headers,
|
|
513
517
|
/** Parsed on first read: bearer requests rarely need their cookies. */
|
|
@@ -588,16 +592,17 @@ async function resolveAuth(request, options) {
|
|
|
588
592
|
token: session.access_token,
|
|
589
593
|
apikey: null
|
|
590
594
|
}, ["user"], options, "cookie");
|
|
591
|
-
|
|
595
|
+
const status = state.kind === "user" && options.checkSession ? await sessionStatus(state.token, {
|
|
592
596
|
url: options.env.url,
|
|
593
597
|
publishableKey: options.env.publishableKey,
|
|
594
598
|
...options.fetch ? { fetch: options.fetch } : {},
|
|
595
599
|
...options.refreshTimeoutMs === void 0 ? {} : { timeoutMs: options.refreshTimeoutMs },
|
|
596
600
|
...options.now ? { now: options.now } : {}
|
|
597
|
-
})
|
|
601
|
+
}) : void 0;
|
|
602
|
+
if (status === "ended" || status === "banned") return resolution({
|
|
598
603
|
kind: "anon",
|
|
599
604
|
reason: "signed_out"
|
|
600
|
-
}, cookies, options.refresh ? writeSession(cookies(), name, null, options.cookie?.options, encoding) : [],
|
|
605
|
+
}, cookies, options.refresh ? writeSession(cookies(), name, null, options.cookie?.options, encoding) : [], status);
|
|
601
606
|
if (state.kind !== "invalid" || state.reason !== "token" || state.error.kind === "network") return resolution(state, cookies);
|
|
602
607
|
if (!options.refresh) return resolution({
|
|
603
608
|
kind: "anon",
|
|
@@ -643,7 +648,7 @@ async function resolveAuth(request, options) {
|
|
|
643
648
|
return resolution({
|
|
644
649
|
kind: "anon",
|
|
645
650
|
reason: "signed_out"
|
|
646
|
-
}, cookies, writeSession(cookies(), name, null, options.cookie?.options, encoding));
|
|
651
|
+
}, cookies, writeSession(cookies(), name, null, options.cookie?.options, encoding), outcome.code === "user_banned" ? "banned" : void 0);
|
|
647
652
|
}
|
|
648
653
|
const writes = writeSession(cookies(), name, outcome.session, options.cookie?.options, encoding);
|
|
649
654
|
return resolution(await verify({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { E as ValidationIssue, f as Result } from "./result-D7y2fT87.js";
|
|
2
2
|
import { H as Update, L as TableKey, R as TableMeta, a as AnyModels, i as AnyFunctions, x as Insert } from "./types-6BdhkmZe.js";
|
|
3
3
|
import { It as SelectArg, t as BetterSupabase } from "./define-CJJkkr1-.js";
|
|
4
|
-
import { a as RespondOptions } from "./respond-
|
|
4
|
+
import { a as RespondOptions } from "./respond-DprrgyXX.js";
|
|
5
5
|
import { i as ResourceOperation } from "./index-Bxih3l0u.js";
|
|
6
6
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
7
7
|
//#region src/server/resource.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { b as DbError } from "./result-D7y2fT87.js";
|
|
2
|
-
import { r as AuthState } from "./resolve-
|
|
2
|
+
import { r as AuthState } from "./resolve-ChTYeTEl.js";
|
|
3
3
|
import { t as Aal } from "./mfa-Daak8ukG.js";
|
|
4
4
|
//#region src/server/refresh.d.ts
|
|
5
5
|
/** A router or browser prefetch, by its request headers. */
|