better-supabase 0.6.1 → 0.7.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.
Files changed (108) hide show
  1. package/dist/{adapter-CHnPkCPd.js → adapter-iKgjHVPx.js} +34 -4
  2. package/dist/ai-sdk/batches/index.d.ts +1 -1
  3. package/dist/ai-sdk/index.d.ts +1 -1
  4. package/dist/ai-sdk/mcp/index.d.ts +3 -3
  5. package/dist/{api-keys-rCGtKaZA.d.ts → api-keys-CIjghYjV.d.ts} +1 -1
  6. package/dist/astro/index.d.ts +4 -4
  7. package/dist/astro/index.js +2 -2
  8. package/dist/blocks/ai-providers/index.d.ts +1 -1
  9. package/dist/blocks/api-keys/index.d.ts +2 -2
  10. package/dist/blocks/audit/index.js +1 -1
  11. package/dist/blocks/connectors/index.d.ts +1 -1
  12. package/dist/blocks/data-lifecycle/index.d.ts +1 -1
  13. package/dist/blocks/data-lifecycle/index.js +1 -1
  14. package/dist/blocks/entitlements/index.d.ts +1 -1
  15. package/dist/blocks/index.d.ts +1 -1
  16. package/dist/blocks/sso/index.d.ts +1 -1
  17. package/dist/blocks/workflow-builder/index.d.ts +2 -2
  18. package/dist/blocks/workflow-builder/react/index.d.ts +1 -1
  19. package/dist/chat-sdk/index.d.ts +1 -1
  20. package/dist/cli/bin.js +1 -1
  21. package/dist/cli/{doctor-BMqBgM3X.js → doctor-DJk0aeBi.js} +66 -14
  22. package/dist/cli/{gen-DeuDgPxN.js → gen-CCMc39Dx.js} +1 -1
  23. package/dist/cli/gen-DRmzPI75.js +2 -0
  24. package/dist/cli/index.d.ts +1 -1
  25. package/dist/cli/index.js +3 -3
  26. package/dist/cli/{init-C7Xd0Kda.js → init-BHuEQrQK.js} +1 -1
  27. package/dist/cli/{introspect-CSnMJ94U.js → introspect-DzR2nyQb.js} +1 -1
  28. package/dist/cli/{run-C8tnlHSb.js → run-BqDPh9UH.js} +7 -7
  29. package/dist/cli/{sql-D0GUtUPp.js → sql-B8csQPyn.js} +13 -54
  30. package/dist/cli/sql-layout-D6cphHT3.js +69 -0
  31. package/dist/cli/{version-C_4JwyiM.js → version-59gcepIG.js} +1 -1
  32. package/dist/{composite-pSfeJNce.d.ts → composite--yqry7uW.d.ts} +3 -3
  33. package/dist/{composite-CLqs9-OA.js → composite-DXVUibdi.js} +1 -1
  34. package/dist/{connectors-hkLCwyEz.d.ts → connectors-CrpknU0P.d.ts} +1 -1
  35. package/dist/credentials/index.d.ts +2 -2
  36. package/dist/{csv-CPAzEmB6.js → csv-DCK-PT1n.js} +1 -1
  37. package/dist/edge/index.d.ts +5 -5
  38. package/dist/edge/index.js +3 -3
  39. package/dist/elysia/index.d.ts +1 -1
  40. package/dist/{ended-jLfvw8h-.d.ts → ended-XjeGQ5XW.d.ts} +4 -1
  41. package/dist/{entitlements-DHrY2UDZ.d.ts → entitlements-BKSVGtrG.d.ts} +1 -1
  42. package/dist/eve/index.d.ts +2 -2
  43. package/dist/eve/index.js +1 -1
  44. package/dist/{executor-D14tGopJ.d.ts → executor-BVBFM86G.d.ts} +1 -1
  45. package/dist/expo/index.d.ts +2 -2
  46. package/dist/expo/index.js +3 -3
  47. package/dist/{framework-CdPDPpFs.d.ts → framework-BmzgK32X.d.ts} +4 -4
  48. package/dist/{framework-xjTBoyBB.js → framework-a7aRCIqv.js} +1 -1
  49. package/dist/h3/index.d.ts +1 -1
  50. package/dist/h3/v1/index.d.ts +1 -1
  51. package/dist/hono/index.d.ts +6 -6
  52. package/dist/hono/index.js +2 -2
  53. package/dist/{index-DDrYaUcq.d.ts → index-CdZKQF98.d.ts} +1 -1
  54. package/dist/{index-CtuakVRc.d.ts → index-CewnYSpv.d.ts} +1 -1
  55. package/dist/{kit-B5tid-q5.d.ts → kit-CkNzZUqv.d.ts} +3 -3
  56. package/dist/mcp/index.d.ts +3 -3
  57. package/dist/mcp/index.js +1 -1
  58. package/dist/mcp/sdk/index.d.ts +3 -3
  59. package/dist/mcp/sdk/index.js +1 -1
  60. package/dist/nestjs/index.d.ts +2 -2
  61. package/dist/next/index.d.ts +13 -8
  62. package/dist/next/index.js +5 -5
  63. package/dist/node/index.d.ts +2 -2
  64. package/dist/orpc/index.d.ts +4 -4
  65. package/dist/orpc/index.js +1 -1
  66. package/dist/otel/index.js +5 -5
  67. package/dist/{provider-BH5UWZJ6.d.ts → provider-D-UEMvSD.d.ts} +1 -1
  68. package/dist/react/index.d.ts +5 -5
  69. package/dist/react/server.d.ts +5 -5
  70. package/dist/react/session.d.ts +2 -2
  71. package/dist/react-router/index.d.ts +4 -4
  72. package/dist/react-router/index.js +2 -2
  73. package/dist/{refusal-D1rgbzNq.d.ts → refusal-DhSU2Vvr.d.ts} +1 -1
  74. package/dist/{resolve-KW8nCeL6.d.ts → resolve-ChTYeTEl.d.ts} +3 -0
  75. package/dist/{resolve-D_IcnvFd.js → resolve-tJZY3FEa.js} +12 -7
  76. package/dist/{resource-D6Uc7Sk7.d.ts → resource-IPS5xi9q.d.ts} +1 -1
  77. package/dist/{respond-DoBijysA.d.ts → respond-DprrgyXX.d.ts} +1 -1
  78. package/dist/server/index.d.ts +47 -10
  79. package/dist/server/index.js +27 -5
  80. package/dist/{server-C6DWVEVG.d.ts → server-Bh0EVSwU.d.ts} +32 -3
  81. package/dist/solid/index.d.ts +2 -2
  82. package/dist/solid-start/index.d.ts +4 -4
  83. package/dist/solid-start/index.js +2 -2
  84. package/dist/sql/index.d.ts +10 -0
  85. package/dist/sql/index.js +52 -5
  86. package/dist/ssr/index.d.ts +4 -4
  87. package/dist/ssr/index.js +1 -1
  88. package/dist/{support-zIa1URaN.js → support-ig_K4PvS.js} +1 -1
  89. package/dist/{support-view-33Oi07TT.d.ts → support-view-CVOJJLpc.d.ts} +1 -1
  90. package/dist/svelte/index.d.ts +1 -1
  91. package/dist/sveltekit/index.d.ts +4 -4
  92. package/dist/sveltekit/index.js +2 -2
  93. package/dist/tanstack-start/index.d.ts +4 -4
  94. package/dist/tanstack-start/index.js +2 -2
  95. package/dist/{tenant-icPeuUBN.d.ts → tenant-BxNFk9bx.d.ts} +1 -1
  96. package/dist/testing/index.d.ts +5 -5
  97. package/dist/{types-TaiEeBGA.d.ts → types-6rocye-y.d.ts} +1 -1
  98. package/dist/{types-BI-0Sl2v.d.ts → types-AYOvcyep.d.ts} +1 -1
  99. package/dist/{vault-CSO7ss5C.d.ts → vault-wlbBhqm7.d.ts} +1 -1
  100. package/dist/vercel-connect/index.d.ts +1 -1
  101. package/dist/{version-CQt77F3T.js → version-C6OfRAIn.js} +1 -1
  102. package/dist/{view-DbxLNu8L.d.ts → view-CF7ihnkg.d.ts} +1 -1
  103. package/dist/vue/index.d.ts +2 -2
  104. package/dist/workflow-sdk/builder/index.d.ts +2 -2
  105. package/package.json +1 -1
  106. package/schemas/doctor-report-v1.json +2 -0
  107. package/skills/better-supabase-auth/SKILL.md +8 -4
  108. package/dist/cli/gen-4JlOwgWG.js +0 -2
package/dist/sql/index.js CHANGED
@@ -9,7 +9,7 @@ import { t as FINAL_RUN_STATES$1 } from "../run-state-CgBKzYMW.js";
9
9
  import { t as AI_MESSAGE_PART_TYPES } from "../message-CaKlqdsX.js";
10
10
  import { A as jwtClaim, B as replaceColumnCheck, C as canIn, D as disabledHelpersNeedLaterTables, E as disabledHelpers, F as pageSize, G as splitTable$1, H as serviceGrant, I as quotedTable, J as userGrant, K as tenantIn, L as raise$1, M as membershipDisabledAt, N as membershipSuspended, O as ensureCheck, P as organizationMissing, R as recordTrigger, S as addForeignKey, T as columnsObject, U as serviceOnly$1, V as schemaPreamble, W as sha256Hex, _ as SCHEMA, a as MODULE_PERMISSION_SCOPES, b as activeMembership, c as modulePermission, d as roleNames, f as roleScopeIs, g as NOTHING, h as EQUIVALENT_TRIGGERS, i as MODULE_PERMISSIONS, j as memberAddedRecord, k as jsonSchemaChecks, l as modulePermissionKey, m as tenantScope, n as WORKFLOW_SDK_WORLD, o as accessModel, p as rolesOf, q as updatedAt, s as hasPlatformRoles, u as providerPlatformRoles, v as SERVICE_CALLER, w as columnRef, x as addExtraColumns, y as accessDefinesDisabledHelpers, z as renameSql } from "../workflow-sdk-world-D-prir6O.js";
11
11
  import { c as templateFunctions, i as fillTemplate, o as resolveProviderSql, s as scopeProblems, t as SCOPE_ID_TYPES } from "../access-sql-B0dF-SoF.js";
12
- import { t as VERSION } from "../version-CQt77F3T.js";
12
+ import { t as VERSION } from "../version-C6OfRAIn.js";
13
13
  //#region src/sql/api-schema.ts
14
14
  /** The roles PostgREST runs a request as. */
15
15
  const API_ROLES = /* @__PURE__ */ new Set([
@@ -35127,6 +35127,33 @@ function declaredTables(files, schemas) {
35127
35127
  }
35128
35128
  return [...found];
35129
35129
  }
35130
+ const RLS_TOGGLE = new RegExp(String.raw`\balter\s+table\s+(?:if\s+exists\s+)?(?:only\s+)?(${NAME}(?:\s*\.\s*${NAME})?)\s+(enable|disable)\s+row\s+level\s+security\b`, "gi");
35131
+ /**
35132
+ * The tables in `schemas` that `files` leave with row level security on:
35133
+ * `alter table ... enable row level security`, until a later `disable` or
35134
+ * `drop table`.
35135
+ */
35136
+ function rlsTables(files, schemas) {
35137
+ const found = /* @__PURE__ */ new Set();
35138
+ for (const file of files) {
35139
+ const text = withoutComments(file.text);
35140
+ inOrder([[...text.matchAll(RLS_TOGGLE)].map((match) => ({
35141
+ index: match.index,
35142
+ apply: () => {
35143
+ const table = qualified$1(match[1]);
35144
+ if (!schemas.includes(table.slice(0, table.indexOf(".")))) return;
35145
+ if (match[2].toLowerCase() === "enable") found.add(table);
35146
+ else found.delete(table);
35147
+ }
35148
+ })), [...text.matchAll(DROP_TABLE)].map((match) => ({
35149
+ index: match.index,
35150
+ apply: () => {
35151
+ for (const table of droppedTables(match[1])) found.delete(table);
35152
+ }
35153
+ }))]);
35154
+ }
35155
+ return [...found];
35156
+ }
35130
35157
  const TABLE_CONSTRAINT = /^(constraint|check|unique|primary|foreign|exclude|like)\b/i;
35131
35158
  /**
35132
35159
  * Columns each `create table` in `files` declares, as `schema.table` to
@@ -35509,6 +35536,23 @@ $$;
35509
35536
  revoke execute on function better_supabase.session_active() from public, anon;
35510
35537
  grant execute on function better_supabase.session_active() to authenticated;
35511
35538
 
35539
+ -- The last sign-in of many users in one query, for admin lists. auth.users
35540
+ -- isn't readable through the Data API, so only the service role calls this.
35541
+ create or replace function better_supabase.last_sign_ins(p_users uuid[])
35542
+ returns table (user_id uuid, last_sign_in_at timestamptz)
35543
+ language sql
35544
+ stable
35545
+ security definer
35546
+ set search_path = ''
35547
+ as $$
35548
+ select u.id, u.last_sign_in_at
35549
+ from auth.users u
35550
+ where u.id = any(p_users)
35551
+ $$;
35552
+
35553
+ revoke execute on function better_supabase.last_sign_ins(uuid[]) from public, anon, authenticated;
35554
+ grant execute on function better_supabase.last_sign_ins(uuid[]) to service_role;
35555
+
35512
35556
  -- Restrictive, so it applies on top of the table's other policies. Wrapped in
35513
35557
  -- a select, it runs one indexed lookup per statement:
35514
35558
  -- create policy session_required on public.invoices as restrictive
@@ -37401,17 +37445,20 @@ const keyOf = (name) => name.includes(".") ? name : `public.${name}`;
37401
37445
  * Each listed table's complete privilege set: everything is revoked from
37402
37446
  * the API roles first, then the listed privileges are granted. Policy
37403
37447
  * grants fill tables `expose` doesn't list, with every privilege for
37404
- * `service_role`.
37448
+ * `service_role`. With policy grants on, a declared table that `expose`
37449
+ * doesn't list, with RLS on and no permissive policy reaching it, is service-only.
37405
37450
  */
37406
37451
  function tableGrants(layout) {
37407
37452
  const listed = layout.grants ?? [];
37408
37453
  const named = new Set(listed.map((grant) => keyOf(grant.table)));
37409
37454
  const derived = (layout.policyGrants ?? []).filter((grant) => !named.has(keyOf(grant.table)));
37410
37455
  const derivedTables = [...new Set(derived.map((grant) => grant.table))];
37456
+ const reached = new Set((layout.policyGrants ?? []).map((grant) => keyOf(grant.table)));
37457
+ const serviceOnly = layout.policyGrants === void 0 ? [] : (layout.declaredTables ?? []).filter((table) => (layout.rlsTables ?? []).includes(table) && !named.has(keyOf(table)) && !reached.has(keyOf(table)));
37411
37458
  const grants = [
37412
37459
  ...listed,
37413
37460
  ...derived,
37414
- ...derivedTables.map((table) => ({
37461
+ ...[...derivedTables, ...serviceOnly].map((table) => ({
37415
37462
  table,
37416
37463
  role: "service_role",
37417
37464
  privileges: [
@@ -37429,7 +37476,7 @@ function tableGrants(layout) {
37429
37476
  });
37430
37477
  const all = [...statements, ...functions];
37431
37478
  if (all.length === 0) return "";
37432
- return `\n-- config.expose${derived.length > 0 ? " and the policies (sql.modules.grants.options.fromPolicies)" : ""}\n${all.join("\n")}\n`;
37479
+ return `\n-- config.expose${derived.length > 0 || serviceOnly.length > 0 ? " and the policies (sql.modules.grants.options.fromPolicies)" : ""}\n${all.join("\n")}\n`;
37433
37480
  }
37434
37481
  /** A jsonb column and the JSON Schema its values must match. */
37435
37482
  /** Users with a membership in a tenant of `customer`, from the provider's membership tables. */
@@ -38225,4 +38272,4 @@ async function compileReadSets(sets) {
38225
38272
  return Promise.all(names.map((name) => compileReadSet(byName.get(name))));
38226
38273
  }
38227
38274
  //#endregion
38228
- export { AUDIT_CATEGORIES, MODULE_ID_TYPES, SCOPE_ID_TYPES, SQL_MODULES, adoptedColumnProblems, auditRegistrations, compileReadSet, compileReadSets, contractSignature, customContracts, declaredTables, extensionSchema, isModuleIdType, migrationOptionUses, moduleBody, moduleDeprecations, moduleEventTriggers, moduleFilePaths, moduleFileVersion, moduleIdType, moduleLayout, modulePermissionKeys, moduleSchemaExtensions, moduleTopics, moduleVersion, policyGrants, renderModules, resolveModules, resolveProviderSql, sameModuleFile, scopeProblems, sharedRolesProblems, templateFunctions, upgradePlan };
38275
+ export { AUDIT_CATEGORIES, MODULE_ID_TYPES, SCOPE_ID_TYPES, SQL_MODULES, adoptedColumnProblems, auditRegistrations, compileReadSet, compileReadSets, contractSignature, customContracts, declaredTables, extensionSchema, isModuleIdType, migrationOptionUses, moduleBody, moduleDeprecations, moduleEventTriggers, moduleFilePaths, moduleFileVersion, moduleIdType, moduleLayout, modulePermissionKeys, moduleSchemaExtensions, moduleTopics, moduleVersion, policyGrants, renderModules, resolveModules, resolveProviderSql, rlsTables, sameModuleFile, scopeProblems, sharedRolesProblems, templateFunctions, upgradePlan };
@@ -1,6 +1,6 @@
1
1
  import { _ as writeSession, a as CookieWrite, c as StoredSession, d as clearSessionAtScopes, f as parseCookies, g as sessionEncoding, h as sessionCookieName, i as CookieScope, l as WriteSessionOptions, m as serializeCookie, n as CookieOptions, o as DEFAULT_SESSION_ENCODING, p as readSession, r as CookieRecord, s as SessionEncoding, t as AUTH_CACHE_HEADERS, u as applyCookieWrites } from "../session-ChiXDZdZ.js";
2
- import { a as ResolveAuthOptions, l as resolveAuth, n as AuthResolver, r as AuthState, s as authContext, t as AuthResolution } from "../resolve-KW8nCeL6.js";
3
- import { n as toSession, t as AuthSession } from "../view-DbxLNu8L.js";
4
- import { r as MembershipClaim } from "../entitlements-DHrY2UDZ.js";
5
- import { a as sessionStatus, c as refreshSession, i as clearSessionCookies, n as SessionStatus, o as RefreshOptions, r as SessionStatusOptions, s as RefreshOutcome, t as ClearSessionCookiesOptions } from "../ended-jLfvw8h-.js";
2
+ import { a as ResolveAuthOptions, l as resolveAuth, n as AuthResolver, r as AuthState, s as authContext, t as AuthResolution } from "../resolve-ChTYeTEl.js";
3
+ import { n as toSession, t as AuthSession } from "../view-CF7ihnkg.js";
4
+ import { r as MembershipClaim } from "../entitlements-BKSVGtrG.js";
5
+ import { a as sessionStatus, c as refreshSession, i as clearSessionCookies, n as SessionStatus, o as RefreshOptions, r as SessionStatusOptions, s as RefreshOutcome, t as ClearSessionCookiesOptions } from "../ended-XjeGQ5XW.js";
6
6
  export { AUTH_CACHE_HEADERS, type AuthResolution, type AuthResolver, type AuthSession, type AuthState, type ClearSessionCookiesOptions, type CookieOptions, type CookieRecord, type CookieScope, type CookieWrite, DEFAULT_SESSION_ENCODING, type MembershipClaim, type RefreshOptions, type RefreshOutcome, type ResolveAuthOptions, type SessionEncoding, type SessionStatus, type SessionStatusOptions, type StoredSession, type WriteSessionOptions, applyCookieWrites, authContext, clearSessionAtScopes, clearSessionCookies, parseCookies, readSession, refreshSession, resolveAuth, serializeCookie, sessionCookieName, sessionEncoding, sessionStatus, toSession, writeSession };
package/dist/ssr/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { _ as writeSession, a as refreshSession, c as AUTH_CACHE_HEADERS, d as clearSessionAtScopes, f as parseCookies, g as sessionEncoding, h as sessionCookieName, i as resolveAuth, l as DEFAULT_SESSION_ENCODING, m as serializeCookie, o as clearSessionCookies, p as readSession, s as sessionStatus, t as authContext, u as applyCookieWrites } from "../resolve-D_IcnvFd.js";
1
+ import { _ as writeSession, a as refreshSession, c as AUTH_CACHE_HEADERS, d as clearSessionAtScopes, f as parseCookies, g as sessionEncoding, h as sessionCookieName, i as resolveAuth, l as DEFAULT_SESSION_ENCODING, m as serializeCookie, o as clearSessionCookies, p as readSession, s as sessionStatus, t as authContext, u as applyCookieWrites } from "../resolve-tJZY3FEa.js";
2
2
  import { n as toSession } from "../view-BeFcRV6G.js";
3
3
  export { AUTH_CACHE_HEADERS, DEFAULT_SESSION_ENCODING, applyCookieWrites, authContext, clearSessionAtScopes, clearSessionCookies, parseCookies, readSession, refreshSession, resolveAuth, serializeCookie, sessionCookieName, sessionEncoding, sessionStatus, toSession, writeSession };
@@ -3,7 +3,7 @@ import { t as temporal } from "./temporal-required-BVvW7SYJ.js";
3
3
  import { a as ok, r as err, s as toDbError, t as AsyncResult } from "./result-DzUbqgdW.js";
4
4
  import { n as validate } from "./standard-BK0cqJ7y.js";
5
5
  import { t as fromPgError } from "./executor-De1Of3m3.js";
6
- import { d as clearSupportCookie, f as supportCookie, m as supportCookieValue } from "./adapter-CHnPkCPd.js";
6
+ import { d as clearSupportCookie, f as supportCookie, m as supportCookieValue } from "./adapter-iKgjHVPx.js";
7
7
  import { r as sqlIdent } from "./template--jDkl3UP.js";
8
8
  import { i as emitBlockEvent } from "./block-events-CrT8r7Fe.js";
9
9
  //#region src/auth/support.ts
@@ -1,4 +1,4 @@
1
- import { t as AuthSession } from "./view-DbxLNu8L.js";
1
+ import { t as AuthSession } from "./view-CF7ihnkg.js";
2
2
  //#region src/auth/support-view.d.ts
3
3
  /** A running support session as the target's view shows it, for a banner. */
4
4
  interface SupportView {
@@ -2,7 +2,7 @@ import { b as DbError } from "../result-D7y2fT87.js";
2
2
  import { it as QuerySpec } from "../define-CJJkkr1-.js";
3
3
  import { n as TemplateValues } from "../template-CwO38Do8.js";
4
4
  import { t as AuthSnapshot } from "../bind-Bu_ZNa3W.js";
5
- import { t as AuthSession } from "../view-DbxLNu8L.js";
5
+ import { t as AuthSession } from "../view-CF7ihnkg.js";
6
6
  import { S as Topic, f as PresenceMember, u as EventSchemas, w as TopicHandlers, x as SubscriptionStatus } from "../index-DunNRdnT.js";
7
7
  import { a as BroadcastOptions, c as LiveCountSource, d as PresenceTopic, f as UseActionOptions, i as ActionState, l as LiveQueryHookOptions, n as ActionInputOf, o as ClientLike, r as ActionResultOf, s as LiveCountHookOptions, t as fieldErrorsOf, u as PresenceHookOptions } from "../field-errors-BFOa7WhB.js";
8
8
  import { SupabaseClient } from "@supabase/supabase-js";
@@ -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-C6DWVEVG.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-B5tid-q5.js";
5
- import { t as RefusalRedirects } from "../refusal-D1rgbzNq.js";
6
- import { n as FrameworkOptions, t as FrameworkLocals } from "../framework-CdPDPpFs.js";
3
+ import { t as BetterServer } from "../server-Bh0EVSwU.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-BmzgK32X.js";
7
7
  import { t as Validated } from "../shared-DDSjEGDR.js";
8
8
  import { i as tagFor } from "../tags-Cx-LnIQP.js";
9
9
  import { AnyEntry, Contributions } from "@supabase/middleware";
@@ -1,12 +1,12 @@
1
1
  import { t as DbException } from "../db-exception-CnWcYPxL.js";
2
2
  import { r as dbErrorOf } from "../errors-B11Duf73.js";
3
3
  import { o as toProblem } from "../problem-BreOl8b8.js";
4
- import { c as extendServer, n as flushEvents, s as createServer } from "../adapter-CHnPkCPd.js";
4
+ import { c as extendServer, n as flushEvents, s as createServer } from "../adapter-iKgjHVPx.js";
5
5
  import { t as defaultExpose } from "../respond-BUgsXNgk.js";
6
6
  import { r as tagFor } from "../tags-B99_U9Pp.js";
7
7
  import { i as requireCaller, o as runAction } from "../kit-Fm-Fv7q5.js";
8
8
  import { n as bufferInPlace, t as around } from "../shared-CBxosKK3.js";
9
- import { a as platformWaitUntil, i as localsOf, n as actionInput, r as frameworkEntry } from "../framework-xjTBoyBB.js";
9
+ import { a as platformWaitUntil, i as localsOf, n as actionInput, r as frameworkEntry } from "../framework-a7aRCIqv.js";
10
10
  import { i as refusalTarget } from "../refusal-CeJWxmkH.js";
11
11
  //#region src/bridges/sveltekit.ts
12
12
  /**
@@ -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-C6DWVEVG.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-B5tid-q5.js";
5
- import { t as RefusalRedirects } from "../refusal-D1rgbzNq.js";
6
- import { n as FrameworkOptions, t as FrameworkLocals } from "../framework-CdPDPpFs.js";
3
+ import { t as BetterServer } from "../server-Bh0EVSwU.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-BmzgK32X.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,8 +1,8 @@
1
- import { c as extendServer, n as flushEvents, s as createServer } from "../adapter-CHnPkCPd.js";
1
+ import { c as extendServer, n as flushEvents, s as createServer } from "../adapter-iKgjHVPx.js";
2
2
  import { t as defaultExpose } from "../respond-BUgsXNgk.js";
3
3
  import { i as requireCaller, o as runAction } from "../kit-Fm-Fv7q5.js";
4
4
  import { n as bufferInPlace, t as around } from "../shared-CBxosKK3.js";
5
- import { i as localsOf, r as frameworkEntry } from "../framework-xjTBoyBB.js";
5
+ import { i as localsOf, r as frameworkEntry } from "../framework-a7aRCIqv.js";
6
6
  import { r as refusalResponse } from "../refusal-CeJWxmkH.js";
7
7
  //#region src/bridges/tanstack-start.ts
8
8
  /** The `response` of a request middleware's `next()` result; server function results have none. */
@@ -1,5 +1,5 @@
1
1
  import { t as AuthSnapshot } from "./bind-Bu_ZNa3W.js";
2
- import { t as AuthSession } from "./view-DbxLNu8L.js";
2
+ import { t as AuthSession } from "./view-CF7ihnkg.js";
3
3
  //#region src/auth/tenant.d.ts
4
4
  /**
5
5
  * The active tenant of a user session: the `claim` claim (`tenant_id` by
@@ -2,25 +2,25 @@ import { H as Update, L as TableKey, P as SchemaMeta, a as AnyModels, i as AnyFu
2
2
  import { r as Executor } from "../executor-DvsBbNBS.js";
3
3
  import { t as SqlClient } from "../executor-DbvExCFC.js";
4
4
  import { m as RequestContext, n as AnyPlugin } from "../plugin-FGY8UhYm.js";
5
- import { n as AuthResolver } from "../resolve-KW8nCeL6.js";
6
- import { a as CredentialSubject, i as CredentialRef, r as CredentialProvider } from "../provider-BH5UWZJ6.js";
5
+ import { n as AuthResolver } from "../resolve-ChTYeTEl.js";
6
+ import { a as CredentialSubject, i as CredentialRef, r as CredentialProvider } from "../provider-D-UEMvSD.js";
7
7
  import { k as QueueBackend } from "../queue-CLJurhdy.js";
8
8
  import { n as Embedder } from "../knowledge-BXBbT0Tr.js";
9
9
  import { o as StreamStore } from "../store-CGjgWu5n.js";
10
10
  import { B as DbStats, b as Db, t as BetterSupabase, u as CacheAdapter } from "../define-CJJkkr1-.js";
11
11
  import { r as EventSink, t as CloudEvent } from "../cloud-event-C1JCc1bH.js";
12
12
  import { t as BetterPostgres } from "../pool-CAu2nLrL.js";
13
- import { i as ServerContext, o as ServerOptions, z as SupportSessionStore } from "../server-C6DWVEVG.js";
13
+ import { V as SupportSessionStore, i as ServerContext, o as ServerOptions } from "../server-Bh0EVSwU.js";
14
14
  import { s as Impersonator } from "../mfa-Daak8ukG.js";
15
15
  import { n as SessionActor, r as SessionDelegation } from "../actor-CQTlc1Hh.js";
16
- import { r as GuardOptions } from "../respond-DoBijysA.js";
16
+ import { r as GuardOptions } from "../respond-DprrgyXX.js";
17
17
  import { i as AuthorizationProvider } from "../authorization-BFCqamMs.js";
18
18
  import { i as AiTaskRun, o as AiTaskRunner, t as AiTask } from "../ai-tasks-Cd1HMFvB.js";
19
19
  import { D as ResolvedConfig, _ as GeneratorInput, h as Generator, v as GeneratorModel } from "../config-D44Y7PAv.js";
20
20
  import { a as BlockTransportMiddleware } from "../block-hooks-plbZ0AbJ.js";
21
21
  import { t as NotificationChannel } from "../channel-_2Mx1Oyu.js";
22
22
  import { c as WebhookSecretStore, i as WebhookSigner, m as WebhookTransport } from "../signers-4y62_VIi.js";
23
- import { T as WorkflowGraph, i as BuilderStarter, r as BuilderStartCall, s as GraphCompiler } from "../types-BI-0Sl2v.js";
23
+ import { T as WorkflowGraph, i as BuilderStarter, r as BuilderStartCall, s as GraphCompiler } from "../types-AYOvcyep.js";
24
24
  import { t as EveDocumentBackend } from "../eve-gT2Fpjut.js";
25
25
  import { SupabaseClient } from "@supabase/supabase-js";
26
26
  import { Message, StateAdapter } from "chat";
@@ -1,7 +1,7 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { t as AsyncResult, w as ErrorMapper } from "./result-D7y2fT87.js";
3
3
  import { t as BlockTransport } from "./block-transport-DvaoPuZ9.js";
4
- import { i as CredentialRef, r as CredentialProvider } from "./provider-BH5UWZJ6.js";
4
+ import { i as CredentialRef, r as CredentialProvider } from "./provider-D-UEMvSD.js";
5
5
  import { i as CursorPageOptions, r as BlockTemporalOptions } from "./block-helpers-CKtbFcRv.js";
6
6
  //#region src/blocks/ai-providers/types.d.ts
7
7
  /** A tenant's own key for a provider. The key itself stays in the credential provider. */
@@ -1,7 +1,7 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { t as AsyncResult, w as ErrorMapper } from "./result-D7y2fT87.js";
3
3
  import { t as BlockTransport } from "./block-transport-DvaoPuZ9.js";
4
- import { i as CredentialRef, o as CredentialToken, r as CredentialProvider } from "./provider-BH5UWZJ6.js";
4
+ import { i as CredentialRef, o as CredentialToken, r as CredentialProvider } from "./provider-D-UEMvSD.js";
5
5
  import { r as BlockTemporalOptions } from "./block-helpers-CKtbFcRv.js";
6
6
  import { a as WorkflowSchedule, u as WorkflowStarter } from "./workflows-B0j9WKPu.js";
7
7
  //#region src/blocks/workflow-builder/graph.d.ts
@@ -1,6 +1,6 @@
1
1
  import { t as AsyncResult, w as ErrorMapper } from "./result-D7y2fT87.js";
2
2
  import { t as BlockTransport } from "./block-transport-DvaoPuZ9.js";
3
- import { c as SetCredentialOptions, i as CredentialRef, r as CredentialProvider } from "./provider-BH5UWZJ6.js";
3
+ import { c as SetCredentialOptions, i as CredentialRef, r as CredentialProvider } from "./provider-D-UEMvSD.js";
4
4
  //#region src/credentials/vault.d.ts
5
5
  /** How a request the third party sends is signed with the stored secret. */
6
6
  type VaultInboundScheme = "standard-webhooks" | "hmac-sha256" | "shared-secret";
@@ -1,4 +1,4 @@
1
- import { a as CredentialSubject, r as CredentialProvider } from "../provider-BH5UWZJ6.js";
1
+ import { a as CredentialSubject, r as CredentialProvider } from "../provider-D-UEMvSD.js";
2
2
  //#region src/vercel-connect/vercel-connect.d.ts
3
3
  interface ConnectTokenParams {
4
4
  subject: CredentialSubject;
@@ -1,4 +1,4 @@
1
1
  //#region src/core/version.ts
2
- const VERSION = "0.6.1";
2
+ const VERSION = "0.7.1";
3
3
  //#endregion
4
4
  export { VERSION as t };
@@ -1,5 +1,5 @@
1
1
  import { b as DbError } from "./result-D7y2fT87.js";
2
- import { i as InvalidReason, r as AuthState } from "./resolve-KW8nCeL6.js";
2
+ import { i as InvalidReason, r as AuthState } from "./resolve-ChTYeTEl.js";
3
3
  import { n as AmrEntry, s as Impersonator, t as Aal } from "./mfa-Daak8ukG.js";
4
4
  import { n as SessionActor, r as SessionDelegation } from "./actor-CQTlc1Hh.js";
5
5
  import { JWTClaims, UserClaims } from "@supabase/server";
@@ -2,9 +2,9 @@ import { b as DbError } from "../result-D7y2fT87.js";
2
2
  import { it as QuerySpec } from "../define-CJJkkr1-.js";
3
3
  import { n as TemplateValues } from "../template-CwO38Do8.js";
4
4
  import { t as AuthSnapshot } from "../bind-Bu_ZNa3W.js";
5
- import { t as AuthSession } from "../view-DbxLNu8L.js";
5
+ import { t as AuthSession } from "../view-CF7ihnkg.js";
6
6
  import { S as Topic, f as PresenceMember, u as EventSchemas, w as TopicHandlers, x as SubscriptionStatus } from "../index-DunNRdnT.js";
7
- import { t as SupportView } from "../support-view-33Oi07TT.js";
7
+ import { t as SupportView } from "../support-view-CVOJJLpc.js";
8
8
  import { a as BroadcastOptions, c as LiveCountSource, d as PresenceTopic, f as UseActionOptions, i as ActionState, l as LiveQueryHookOptions, n as ActionInputOf, o as ClientLike, r as ActionResultOf, s as LiveCountHookOptions, t as fieldErrorsOf, u as PresenceHookOptions } from "../field-errors-BFOa7WhB.js";
9
9
  import { SupabaseClient } from "@supabase/supabase-js";
10
10
  import { App, ComputedRef, MaybeRefOrGetter, Ref } from "vue";
@@ -1,5 +1,5 @@
1
- import { T as WorkflowGraph, c as NodeRunRecord, i as BuilderStarter } from "../../types-BI-0Sl2v.js";
2
- import { i as executeGraph, n as GraphStepCall, r as approvalToken, t as GraphRuntime } from "../../executor-D14tGopJ.js";
1
+ import { T as WorkflowGraph, c as NodeRunRecord, i as BuilderStarter } from "../../types-AYOvcyep.js";
2
+ import { i as executeGraph, n as GraphStepCall, r as approvalToken, t as GraphRuntime } from "../../executor-BVBFM86G.js";
3
3
  import { o as WorkflowFn } from "../../workflow-sdk-B3yLD6Br.js";
4
4
  import { World } from "@workflow/world";
5
5
  //#region src/workflow-sdk/builder/builder.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-supabase",
3
- "version": "0.6.1",
3
+ "version": "0.7.1",
4
4
  "description": "Strongly typed Supabase: generated schema, typed repositories, plugins, auth glue, framework integrations and the better-supabase CLI.",
5
5
  "keywords": [
6
6
  "cli",
@@ -48,6 +48,8 @@
48
48
  "BS112",
49
49
  "BS113",
50
50
  "BS114",
51
+ "BS115",
52
+ "BS116",
51
53
  "BS200",
52
54
  "BS204",
53
55
  "BS205",
@@ -115,10 +115,14 @@ A proxy or middleware with its own Supabase client calls
115
115
  Done when the irreversible action returns `SESSION_REVOKED` for a signed-out
116
116
  session in a test.
117
117
 
118
- To lock a user out, call `bs.suspendAccount(userId, { suspended: true })`
119
- (it bans the user in Auth and ends every session and refresh token), or
120
- `bs.endSessions(userId)` to sign them out everywhere without a ban. A ban
121
- alone leaves the refresh tokens, which work again once the ban is lifted. To
118
+ To lock a user out, call `bs.suspendAccount(userId, { suspended: true })`.
119
+ It bans the user in Auth and keeps the sessions, so Auth answers with
120
+ `user_banned`, `sessionStatus` returns `"banned"` and the `session_active()`
121
+ policy refuses the user's tokens. `{ suspended: false }` ends every session
122
+ and refresh token, then lifts the ban. Without the `sessions` SQL module, pass
123
+ `endSessions: true` to delete the sessions on suspension too (the app then
124
+ sees `"ended"`). `bs.endSessions(userId)` signs a user out everywhere without
125
+ a ban. To
122
126
  switch a member off in one organization only, use the organizations block's
123
127
  `suspendMember`.
124
128
 
@@ -1,2 +0,0 @@
1
- import { n as genCommand } from "./gen-DeuDgPxN.js";
2
- export { genCommand };