better-supabase 0.29.0 → 0.30.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.
Files changed (143) hide show
  1. package/dist/ai-sdk/agents/index.d.ts +2 -2
  2. package/dist/{app-tables-DekyKNQ8.d.ts → app-tables-yyVncXEt.d.ts} +1 -1
  3. package/dist/{authorization-C7nuWMuB.d.ts → authorization-CDU9tYA_.d.ts} +14 -0
  4. package/dist/{bind-DmUGUsBd.d.ts → bind-p7asfI6H.d.ts} +1 -1
  5. package/dist/{block-env-DWtZsqhH.d.ts → block-env-B8wG3xeh.d.ts} +3 -3
  6. package/dist/blocks/ai-chat/index.d.ts +3 -3
  7. package/dist/blocks/announcements/index.d.ts +3 -3
  8. package/dist/blocks/api-keys/index.d.ts +1 -1
  9. package/dist/blocks/attachments/index.d.ts +1 -1
  10. package/dist/blocks/audit/index.d.ts +2 -2
  11. package/dist/blocks/automations/index.d.ts +1 -1
  12. package/dist/blocks/billing/index.d.ts +1 -1
  13. package/dist/blocks/bookings/index.d.ts +1 -1
  14. package/dist/blocks/calendar/index.d.ts +1 -1
  15. package/dist/blocks/calendar/index.js +1 -1
  16. package/dist/blocks/comments/index.d.ts +4 -4
  17. package/dist/blocks/entitlements/index.d.ts +2 -2
  18. package/dist/blocks/forms/index.d.ts +1 -1
  19. package/dist/blocks/inbox/index.d.ts +4 -4
  20. package/dist/blocks/index.d.ts +1 -1
  21. package/dist/blocks/messaging/index.d.ts +4 -4
  22. package/dist/blocks/mfa/index.d.ts +1 -1
  23. package/dist/blocks/notifications/index.d.ts +3 -3
  24. package/dist/blocks/onboarding/index.d.ts +1 -1
  25. package/dist/blocks/organizations/index.d.ts +2 -2
  26. package/dist/blocks/permissions/index.d.ts +1 -1
  27. package/dist/blocks/push/index.d.ts +1 -1
  28. package/dist/blocks/reactions/index.d.ts +3 -3
  29. package/dist/blocks/saved-views/index.d.ts +1 -1
  30. package/dist/blocks/search/index.d.ts +2 -2
  31. package/dist/blocks/sessions/index.d.ts +1 -1
  32. package/dist/blocks/settings/index.d.ts +1 -1
  33. package/dist/blocks/subjects/index.d.ts +1 -1
  34. package/dist/blocks/tags/index.d.ts +1 -1
  35. package/dist/blocks/undo/index.d.ts +1 -1
  36. package/dist/blocks/usage/index.d.ts +1 -1
  37. package/dist/blocks/workflow-editor/index.d.ts +3 -3
  38. package/dist/blocks/workflows/index.d.ts +3 -3
  39. package/dist/cli/add-BdhGOwkB.js +1 -0
  40. package/dist/cli/{add-CrQ3jS7t.js → add-D4w-Axib.js} +9 -9
  41. package/dist/cli/{add-BKkV99g9.js → add-Dggyehsy.js} +2 -2
  42. package/dist/cli/{app-table-files-PnPOpuB4.js → app-table-files-CiGuwLkO.js} +2 -2
  43. package/dist/cli/{backfill-DDDLhinm.js → backfill-DjVjXW_P.js} +1 -1
  44. package/dist/cli/bin.js +1 -1
  45. package/dist/cli/{blocks-BCVcjvbm.js → blocks-Bbmb6W_F.js} +1 -1
  46. package/dist/cli/{blocks-tRfYx_mh.js → blocks-jRL9K1R8.js} +1 -1
  47. package/dist/cli/{cache-DQZ09YOg.js → cache-BuoIFlUJ.js} +1 -1
  48. package/dist/cli/{codemod-HKuwQmi_.js → codemod-DRavXBCb.js} +1 -1
  49. package/dist/cli/{content-mapper-B0ehR7K-.js → content-mapper-BCtyfKXl.js} +2 -2
  50. package/dist/cli/{doctor-CXJOhwLB.js → doctor-Di2ZekfN.js} +49 -16
  51. package/dist/cli/{env-BM242BCV.js → env-B2CbnbzD.js} +1 -1
  52. package/dist/cli/env-CynGCICL.js +1 -0
  53. package/dist/cli/{gen-B7rw4j19.js → gen-STKC9vkK.js} +12 -12
  54. package/dist/cli/index.d.ts +1 -1
  55. package/dist/cli/index.js +6 -6
  56. package/dist/cli/{init-C1bXXB_P.js → init-DW6_nIwj.js} +8 -8
  57. package/dist/cli/{live-PpAh9pAc.js → live-0G4Plw3K.js} +2 -2
  58. package/dist/cli/{mcp-BRNAchdH.js → mcp-flKS8iU5.js} +2 -2
  59. package/dist/cli/{metadata-dAAKb_kR.js → metadata-VARUbXEe.js} +3 -3
  60. package/dist/cli/{migrate-BWYXFnaW.js → migrate-Bkq07XcT.js} +1 -1
  61. package/dist/cli/{migration-safety-DGQswWZy.js → migration-safety-BfVeza5j.js} +1 -1
  62. package/dist/cli/{migrations-Cqk-lJwu.js → migrations-BCq7Zs2E.js} +2 -2
  63. package/dist/cli/{module-migration-8-hMiZtW.js → module-migration-lbeUrsYv.js} +2 -2
  64. package/dist/cli/{powersync-BWQ-8T3G.js → powersync-B15CfH5Y.js} +3 -3
  65. package/dist/cli/powersync-DnBsDchT.js +1 -0
  66. package/dist/cli/{print-DSTnq5xz.js → print-DjxpBRnv.js} +2 -2
  67. package/dist/cli/{providers-Cjf5iOp5.js → providers-dyxcHQY3.js} +1 -1
  68. package/dist/cli/{remove-CwG8cPv1.js → remove-BLq5gbal.js} +5 -5
  69. package/dist/cli/{render-B18iAdsT.js → render-CizUf3RW.js} +3 -3
  70. package/dist/cli/{run-CvPl8iQd.js → run-ChEjR7yw.js} +2 -2
  71. package/dist/cli/{run-Wx_2Acgv.js → run-ChOY6s4o.js} +8 -8
  72. package/dist/cli/{run-C2Yg5MWt.js → run-MwM__teL.js} +24 -24
  73. package/dist/cli/{shared-BHbtUOvh.js → shared-DV5wIv-7.js} +1 -1
  74. package/dist/cli/{snapshot-CXgsUPGj.js → snapshot-B5LXkVMC.js} +2 -2
  75. package/dist/cli/{source-B6aMAoEK.js → source-BoLNG_2A.js} +1 -1
  76. package/dist/cli/{spec-EO0TP84d.js → spec-D6QeE2Zx.js} +1 -1
  77. package/dist/cli/{spec-BcYic005.js → spec-Dz-PGCaM.js} +2 -2
  78. package/dist/cli/{sql-layout-CkxDNVEH.js → sql-layout-zo02f3Dm.js} +2 -2
  79. package/dist/cli/{stack-env-6hS-WEmh.js → stack-env-3ziggrU3.js} +1 -1
  80. package/dist/cli/{sync-pq6gmlhG.js → sync-m-oZ_SyI.js} +4 -4
  81. package/dist/cli/{upgrade-Dp9p7A69.js → upgrade-C9sgVZ5z.js} +5 -5
  82. package/dist/cli/{upgrade-BoHb4h9P.js → upgrade-WwEJaX3i.js} +2 -2
  83. package/dist/cli/{version-CQHFm-ak.js → version-D2BQuqta.js} +1 -1
  84. package/dist/client/index.d.ts +5 -5
  85. package/dist/client/native/index.d.ts +4 -4
  86. package/dist/config/index.d.ts +2 -2
  87. package/dist/{context-B4TsE2gY.d.ts → context-nbYYjv7U.d.ts} +13 -1
  88. package/dist/{controller-CtwAsnVV.d.ts → controller-TRocodqG.d.ts} +1 -1
  89. package/dist/create/index.d.ts +3 -3
  90. package/dist/create/index.js +1 -1
  91. package/dist/create/lite/index.d.ts +3 -3
  92. package/dist/create/lite/index.js +1 -1
  93. package/dist/{entitlements-Bw3eYGKJ.d.ts → entitlements-B1i1-wfe.d.ts} +1 -1
  94. package/dist/{field-errors-DkzFduux.d.ts → field-errors-tJvehEFc.d.ts} +4 -4
  95. package/dist/{index-CBQT_nXf.d.ts → index-8US7qlvW.d.ts} +2 -2
  96. package/dist/{index-BNgpz_BV.d.ts → index-BKrxynq9.d.ts} +2 -2
  97. package/dist/{index-CB66nl14.d.ts → index-BkzXwuIN.d.ts} +1 -1
  98. package/dist/{index-BxckmAFc.d.ts → index-CWAQRWY8.d.ts} +2 -2
  99. package/dist/{index-Cw5gGSP8.d.ts → index-zsgNmE8m.d.ts} +6 -6
  100. package/dist/mapper/bin.js +5 -5
  101. package/dist/mcp/index.d.ts +1 -1
  102. package/dist/next/index.d.ts +86 -11
  103. package/dist/next/index.js +189 -49
  104. package/dist/{operations-CqmQrTKw.d.ts → operations-CB9atU2e.d.ts} +1 -1
  105. package/dist/{options-C4LuqmdG.js → options-BKBy5wM_.js} +2 -1
  106. package/dist/otel/index.js +4 -4
  107. package/dist/{ports-6LBgr1Aa.d.ts → ports-hpbyMySO.d.ts} +1 -1
  108. package/dist/powersync/index.d.ts +2 -2
  109. package/dist/preset/index.d.ts +3 -3
  110. package/dist/{project-C4NA_van.js → project-B32wb5J6.js} +1 -1
  111. package/dist/{push-token-BXsrJ7W9.d.ts → push-token-DQ1ycFPU.d.ts} +1 -1
  112. package/dist/react/index.d.ts +5 -5
  113. package/dist/react/native/index.d.ts +1 -1
  114. package/dist/react/server.d.ts +5 -5
  115. package/dist/realtime/index.d.ts +3 -3
  116. package/dist/records/index.d.ts +3 -3
  117. package/dist/server/index.d.ts +3 -3
  118. package/dist/server/index.js +1 -1
  119. package/dist/sign-in-BzihC_8k.d.ts +50 -0
  120. package/dist/{sign-in-NO7LWlw4.js → sign-in-Cyj3ZlFX.js} +120 -25
  121. package/dist/solid/index.d.ts +5 -5
  122. package/dist/sql/index.d.ts +4 -4
  123. package/dist/sql/index.js +2 -2
  124. package/dist/{sql-CoBySj2F.js → sql-CyeDg3Yh.js} +279 -171
  125. package/dist/ssr/index.d.ts +1 -1
  126. package/dist/svelte/index.d.ts +5 -5
  127. package/dist/{tenant-Ded341Qz.d.ts → tenant-C9YE_kqK.d.ts} +1 -1
  128. package/dist/testing/index.d.ts +3 -3
  129. package/dist/{topic-XDdKzlrn.d.ts → topic-breZqx_4.d.ts} +1 -1
  130. package/dist/{types-BFwB-E1j.d.ts → types-C3I7S51U.d.ts} +2 -2
  131. package/dist/vue/index.d.ts +5 -5
  132. package/dist/{watch-topic-DpN_GEoS.d.ts → watch-topic-ItO3dz8m.d.ts} +1 -1
  133. package/dist/workflow-sdk/world/index.js +1 -1
  134. package/dist/{workflow-sdk-CaEw822d.js → workflow-sdk-BWPsdzVK.js} +36 -8
  135. package/dist/yjs/index.d.ts +1 -1
  136. package/package.json +1 -1
  137. package/schemas/config-v1.json +2 -1
  138. package/schemas/doctor-report-v1.json +1 -0
  139. package/skills/better-supabase-auth/SKILL.md +8 -1
  140. package/dist/cli/add-CwhrRJz5.js +0 -1
  141. package/dist/cli/env-uqfUbUzk.js +0 -1
  142. package/dist/cli/powersync-CbYxLsjv.js +0 -1
  143. package/dist/sign-in-CfwJAJJL.d.ts +0 -24
@@ -2,7 +2,7 @@ import { t as DbException } from "../db-exception-Lngc1W49.js";
2
2
  import { n as dbError } from "../errors-BVFgt8BZ.js";
3
3
  import { t as isList } from "../guards-6F2bCtQR.js";
4
4
  import { t as isStorageApi } from "../storage-api-Dg78Wqsg.js";
5
- import { r as err } from "../result-ntFBW2p2.js";
5
+ import { a as ok, r as err } from "../result-ntFBW2p2.js";
6
6
  import { o as isReadSet } from "../read-set-B1sDib5O.js";
7
7
  import { n as validate } from "../standard-BA3mLh6w.js";
8
8
  import { n as StatsRecorder, t as EMPTY_STATS } from "../stats-BHl1-zj9.js";
@@ -15,10 +15,10 @@ import { n as methodOf } from "../block-method-C9hWdHom.js";
15
15
  import { t as tenantOf } from "../tenant-BgIiMQpo.js";
16
16
  import { t as loadTimeline } from "../timeline--VU3A1e4.js";
17
17
  import { T as serverCore, b as isPrefetch, c as extendServer, n as flushEvents, p as supportCookieMaxAge, r as handle, s as createServer, t as bearerRequest, v as outageResponse } from "../adapter-D4aNBxhm.js";
18
- import { g as sessionCookieName, t as clientIp, v as writeSession } from "../resolve-B0mW2m7f.js";
19
- import { a as isSessionSnapshot, f as checkAal, i as authzVersionOf, n as toSession, o as issuedAtOf, s as sessionCacheKey } from "../view-C8Ve14ja.js";
18
+ import { d as clearSessionAtScopes, g as sessionCookieName, t as clientIp, u as applyCookieWrites, v as writeSession } from "../resolve-B0mW2m7f.js";
19
+ import { a as isSessionSnapshot, f as checkAal, i as authzVersionOf, l as snapshotOf, n as toSession, o as issuedAtOf, s as sessionCacheKey } from "../view-C8Ve14ja.js";
20
20
  import { i as guard, n as defaultExpose, s as settle } from "../respond-CZMWbUs3.js";
21
- import { i as supportSessions, n as passwordGrant, r as safeRedirectPath, t as needsMfa } from "../sign-in-NO7LWlw4.js";
21
+ import { a as passwordGrant, c as revokeSession, i as otpGrant, l as safeRedirectPath, n as mfaGrant, o as pkceGrant, r as needsMfa, s as pkcePair, t as authorizeUrlFor, u as supportSessions } from "../sign-in-Cyj3ZlFX.js";
22
22
  import { i as defineAction } from "../resource-BUJcZKiW.js";
23
23
  import { r as tagFor, t as cacheTagsOf } from "../tags-CIZTqtlY.js";
24
24
  import { i as requireCaller, n as formDataObject, t as authorizeCaller } from "../kit-Bcd9wYCV.js";
@@ -471,38 +471,138 @@ function resourceRoutes(serve) {
471
471
  }
472
472
  //#endregion
473
473
  //#region src/next/sign-in.ts
474
+ /** How long the PKCE verifier cookie lives, in seconds. */
475
+ const VERIFIER_MAX_AGE = 600;
476
+ function refused(auth) {
477
+ return {
478
+ ok: false,
479
+ data: null,
480
+ error: auth.kind === "invalid" ? auth.error : dbError("unauthorized", "The new session did not verify")
481
+ };
482
+ }
474
483
  /**
475
- * Signs in on the server, writes the session cookies through the request's
476
- * cookie jar and returns the same-origin path to go to next.
484
+ * The server-side sign-in and sign-out flows. Each runs one Auth call, then one
485
+ * commit: it verifies the new token, writes or clears the session cookies
486
+ * through the request's cookie jar, and publishes the session to later reads in
487
+ * the same request. The result carries no token: it crosses the action
488
+ * boundary, and the session is on the request's reads.
477
489
  */
478
- async function signInWithPassword(credentials, options, deps) {
479
- const { env, auth } = deps;
480
- const secretKey = env.secretKey;
481
- const ip = secretKey && auth?.clientIp !== false ? (auth?.clientIp ?? clientIp)(deps.request) : void 0;
482
- const granted = await passwordGrant({
490
+ function authFlows(deps) {
491
+ const { auth } = deps;
492
+ const cookieName = () => auth?.cookie?.name ?? sessionCookieName(deps.env().url);
493
+ const verifierName = () => `${cookieName()}-code-verifier`;
494
+ const grantOptions = async () => {
495
+ const env = deps.env();
496
+ const secretKey = env.secretKey;
497
+ const ip = secretKey && auth?.clientIp !== false ? (auth?.clientIp ?? clientIp)(await deps.request()) : void 0;
498
+ return {
499
+ url: env.url,
500
+ publishableKey: env.publishableKey,
501
+ ...secretKey && ip ? { forwardedFor: {
502
+ ip,
503
+ secretKey
504
+ } } : {},
505
+ ...auth?.fetch ? { fetch: auth.fetch } : {},
506
+ ...auth?.refreshTimeoutMs === void 0 ? {} : { timeoutMs: auth.refreshTimeoutMs }
507
+ };
508
+ };
509
+ /** Verifies, writes the cookies and publishes `stored` (`null` clears). */
510
+ const commit = async (granted, next, options) => {
511
+ if (!granted.ok) return granted;
512
+ const stored = granted.data;
513
+ const resolution = await deps.verify(stored?.access_token ?? null);
514
+ if (stored && resolution.auth.kind !== "user") return refused(resolution.auth);
515
+ const jar = await deps.jar();
516
+ const existing = jar.getAll();
517
+ const writes = [...writeSession(existing, cookieName(), stored, auth?.cookie?.options, auth?.cookie?.encode === void 0 ? {} : { encode: auth.cookie.encode }), ...stored ? [] : clearSessionAtScopes(existing, cookieName(), deps.cookieScopes ?? [])];
518
+ for (const write of writes) jar.set(write.name, write.value, write.options);
519
+ const headers = new Headers((await deps.request()).headers);
520
+ headers.set("cookie", applyCookieWrites(existing, writes).map((cookie) => `${cookie.name}=${encodeURIComponent(cookie.value)}`).join("; "));
521
+ await deps.publish(resolution, new Request("http://next.local/", { headers }));
522
+ return {
523
+ ok: true,
524
+ data: {
525
+ redirectTo: safeRedirectPath(next, options.fallback ?? "/"),
526
+ mfa: stored !== null && needsMfa(stored) && snapshotOf(resolution.auth)?.claims["aal"] !== "aal2"
527
+ },
528
+ error: null
529
+ };
530
+ };
531
+ const signIn = async (credentials, options = {}) => commit(await passwordGrant({
483
532
  email: credentials.email,
484
533
  password: credentials.password
485
- }, {
486
- url: env.url,
487
- publishableKey: env.publishableKey,
488
- ...secretKey && ip ? { forwardedFor: {
489
- ip,
490
- secretKey
491
- } } : {},
492
- ...auth?.fetch ? { fetch: auth.fetch } : {},
493
- ...auth?.refreshTimeoutMs === void 0 ? {} : { timeoutMs: auth.refreshTimeoutMs }
494
- });
495
- if (!granted.ok) return granted;
496
- const writes = writeSession(deps.jar.getAll(), auth?.cookie?.name ?? sessionCookieName(env.url), granted.data, auth?.cookie?.options, auth?.cookie?.encode === void 0 ? {} : { encode: auth.cookie.encode });
497
- for (const write of writes) deps.jar.set(write.name, write.value, write.options);
498
- await deps.seed(granted.data.access_token);
534
+ }, await grantOptions()), credentials.next, options);
499
535
  return {
500
- ok: true,
501
- data: {
502
- redirectTo: safeRedirectPath(credentials.next, options.fallback ?? "/"),
503
- mfa: needsMfa(granted.data)
536
+ signIn,
537
+ verifyOtp: async (params, options = {}) => commit(await otpGrant(params, await grantOptions()), params.next, options),
538
+ async authorizeUrl(params) {
539
+ const { verifier, challenge } = await pkcePair();
540
+ (await deps.jar()).set(verifierName(), verifier, {
541
+ path: "/",
542
+ ...auth?.cookie?.options,
543
+ httpOnly: true,
544
+ sameSite: "lax",
545
+ maxAge: VERIFIER_MAX_AGE
546
+ });
547
+ const next = safeRedirectPath(params.next, "");
548
+ const redirectTo = new URL(params.redirectTo);
549
+ if (next) redirectTo.searchParams.set("next", next);
550
+ return { url: authorizeUrlFor(deps.env().url, {
551
+ ...params,
552
+ redirectTo: redirectTo.href
553
+ }, challenge) };
504
554
  },
505
- error: null
555
+ async exchangeCode(params, options = {}) {
556
+ const jar = await deps.jar();
557
+ const verifier = jar.getAll().find((cookie) => cookie.name === verifierName())?.value;
558
+ jar.set(verifierName(), "", {
559
+ path: "/",
560
+ ...auth?.cookie?.options,
561
+ httpOnly: true,
562
+ sameSite: "lax",
563
+ maxAge: 0
564
+ });
565
+ if (!verifier) return {
566
+ ok: false,
567
+ data: null,
568
+ error: dbError("unauthorized", "Code exchange failed", { code: "code_verifier_missing" })
569
+ };
570
+ return commit(await pkceGrant({
571
+ code: params.code,
572
+ verifier
573
+ }, await grantOptions()), params.next, options);
574
+ },
575
+ async verifyMfa(params, options = {}) {
576
+ const current = await deps.current();
577
+ if (!current) return {
578
+ ok: false,
579
+ data: null,
580
+ error: dbError("unauthorized", "MFA verification needs a session")
581
+ };
582
+ return commit(await mfaGrant({
583
+ accessToken: current.accessToken,
584
+ factorId: params.factorId,
585
+ code: params.code
586
+ }, await grantOptions()), params.next, options);
587
+ },
588
+ async signOut(params = {}, options = {}) {
589
+ const scope = params.scope ?? "local";
590
+ const current = await deps.current();
591
+ if (current) {
592
+ const revoked = await revokeSession(current.accessToken, scope, await grantOptions());
593
+ if (!revoked.ok) return revoked;
594
+ }
595
+ if (current) deps.signedOut(current.userId);
596
+ if (scope === "others") return {
597
+ ok: true,
598
+ data: {
599
+ redirectTo: safeRedirectPath(params.next, options.fallback ?? "/"),
600
+ mfa: false
601
+ },
602
+ error: null
603
+ };
604
+ return commit(ok(null), params.next, options);
605
+ }
506
606
  };
507
607
  }
508
608
  //#endregion
@@ -617,7 +717,19 @@ function createNext(betterSupabase, options = {}) {
617
717
  const jar = await cookies();
618
718
  for (const write of writes) jar.set(write.name, write.value, write.options);
619
719
  };
620
- const incomingRequest = async () => new Request("http://next.local/", { headers: new Headers(await headers()) });
720
+ /**
721
+ * The incoming request, with the cookie header rebuilt from the cookie jar:
722
+ * in a Server Action or a route handler the jar already holds this request's
723
+ * writes (a sign-in, a sign-out), and the header never does.
724
+ */
725
+ const incomingRequest = async () => {
726
+ const [incomingHeaders, jar] = await Promise.all([headers(), cookies()]);
727
+ const forwarded = new Headers(incomingHeaders);
728
+ const cookie = jar.getAll().map(({ name, value }) => `${name}=${encodeURIComponent(value)}`).join("; ");
729
+ if (cookie === "") forwarded.delete("cookie");
730
+ else forwarded.set("cookie", cookie);
731
+ return new Request("http://next.local/", { headers: forwarded });
732
+ };
621
733
  /**
622
734
  * The incoming request, once its dynamic APIs are awaited. Auth reads cookies
623
735
  * and then the clock: `io()` marks that as I/O for Cache Components without
@@ -635,10 +747,21 @@ function createNext(betterSupabase, options = {}) {
635
747
  });
636
748
  };
637
749
  /**
750
+ * The request's auth generation. A sign-in or sign-out in the request bumps
751
+ * it and stores the committed session, so the cached reads below miss once
752
+ * and answer from it; a render that never commits keys every read on 0.
753
+ */
754
+ const box = cache(() => ({
755
+ generation: 0,
756
+ committed: void 0
757
+ }));
758
+ /**
638
759
  * One token verification per render scope backs `context()`, `session()` and
639
760
  * `cached()`.
640
761
  */
641
- const incoming = cache(async () => {
762
+ const incomingAt = cache(async (_generation) => {
763
+ const committed = box().committed;
764
+ if (committed) return committed;
642
765
  const request = await requestScope();
643
766
  await base.snapshot(request);
644
767
  return {
@@ -646,7 +769,12 @@ function createNext(betterSupabase, options = {}) {
646
769
  resolution: await base.resolve(request, { refresh: false })
647
770
  };
648
771
  });
649
- const getRequestSession = cache(async () => base.snapshot(await requestScope()));
772
+ const incoming = () => incomingAt(box().generation);
773
+ const getRequestSessionAt = cache(async (_generation) => {
774
+ const committed = box().committed;
775
+ return committed ? snapshotOf(committed.resolution.auth) : base.snapshot(await requestScope());
776
+ });
777
+ const getRequestSession = () => getRequestSessionAt(box().generation);
650
778
  const tenantClaim = claimsOf(betterSupabase.meta).tenant;
651
779
  /** The tenant `scoped` resolved for a context, when it wasn't the claim. */
652
780
  const scopedTenants = /* @__PURE__ */ new WeakMap();
@@ -657,7 +785,7 @@ function createNext(betterSupabase, options = {}) {
657
785
  */
658
786
  const authorizeCaller$1 = (ctx, checks, input) => authorizeCaller(ctx.auth, checks, input, tenantFor(ctx, toSession(ctx.auth)), base.authorizer, ctx);
659
787
  /** `null` runs `NextOptions.tenant`; a string is the caller's explicit tenant. */
660
- const scoped = cache(async (explicit) => {
788
+ const scopedAt = cache(async (explicit, _generation) => {
661
789
  const { request, resolution } = await incoming();
662
790
  const [tenant, support] = await Promise.all([explicit ?? options.tenant?.(request, resolution.auth), base.support.current(request, resolution.auth)]);
663
791
  const ctx = core.context(resolution, request, {
@@ -667,10 +795,11 @@ function createNext(betterSupabase, options = {}) {
667
795
  if (tenant !== void 0) scopedTenants.set(ctx, tenant);
668
796
  return ctx;
669
797
  });
670
- const current = (tenant) => scoped(tenant ?? null);
798
+ const current = (tenant) => scopedAt(tenant ?? null, box().generation);
671
799
  const context = (first, contextOptions) => first instanceof Request ? base.context(first, contextOptions) : current(first?.tenant ?? contextOptions?.tenant);
672
800
  /** In a support session, the target's view: `impersonator` names the admin. */
673
- const session = cache(async () => toSession(options.support ? (await current()).auth : (await incoming()).resolution.auth));
801
+ const sessionAt = cache(async (_generation) => toSession(options.support ? (await current()).auth : (await incoming()).resolution.auth));
802
+ const session = () => sessionAt(box().generation);
674
803
  const supportCookieName = options.support?.options.cookie?.name ?? "bsb-support";
675
804
  const supportCookieOptions = {
676
805
  httpOnly: true,
@@ -706,6 +835,28 @@ function createNext(betterSupabase, options = {}) {
706
835
  return result;
707
836
  }))
708
837
  });
838
+ const flows = authFlows({
839
+ env: () => base.env,
840
+ auth: options.auth,
841
+ cookieScopes: options.cookieScopes,
842
+ request: incomingRequest,
843
+ jar: cookies,
844
+ current: getRequestSession,
845
+ verify: (token) => base.resolve(bearerRequest(token)),
846
+ async publish(resolution, request) {
847
+ await base.sessions.seed(resolution.auth);
848
+ const scope = box();
849
+ scope.committed = {
850
+ request,
851
+ resolution
852
+ };
853
+ scope.generation += 1;
854
+ },
855
+ signedOut: (userId) => {
856
+ invalidateAll([sessionTag(userId)]);
857
+ forget(userId);
858
+ }
859
+ });
709
860
  const next = extendServer(withAccounts, {
710
861
  session,
711
862
  getRequestSession,
@@ -971,19 +1122,8 @@ function createNext(betterSupabase, options = {}) {
971
1122
  error: stopped.error
972
1123
  };
973
1124
  },
974
- async signIn(credentials, signInOptions = {}) {
975
- const request = await incomingRequest();
976
- return signInWithPassword(credentials, signInOptions, {
977
- env: base.env,
978
- auth: options.auth,
979
- request,
980
- jar: await cookies(),
981
- seed: async (accessToken) => {
982
- const verified = await base.resolve(bearerRequest(accessToken));
983
- await base.sessions.seed(verified.auth);
984
- }
985
- });
986
- },
1125
+ ...flows,
1126
+ signInWithPassword: (credentials, signInOptions) => flows.signIn(credentials, signInOptions),
987
1127
  cacheTag(table, id, tagOptions = {}) {
988
1128
  cacheTag(...tableTags(table, tagOptions), ...id === void 0 ? [] : [tagFor(table, id)]);
989
1129
  },
@@ -1,4 +1,4 @@
1
- import { r as AuthorizationOperation } from "./authorization-C7nuWMuB.js";
1
+ import { r as AuthorizationOperation } from "./authorization-CDU9tYA_.js";
2
2
  //#region src/core/operations.d.ts
3
3
  /** Operations by name, as `authorization.operations` or a module's own defaults. */
4
4
  type OperationTable = Readonly<Record<string, AuthorizationOperation>>;
@@ -9,7 +9,8 @@ const calendarSqlOptions = blockOptions({
9
9
  recurrence: option.string({ default: "inline" }),
10
10
  rdates: option.boolean({ default: false }),
11
11
  attendeeKey: option.string({ default: "email" }),
12
- calendarDetails: option.boolean({ default: false })
12
+ calendarDetails: option.boolean({ default: false }),
13
+ ruleDialect: option.unknown()
13
14
  });
14
15
  //#endregion
15
16
  export { calendarSqlOptions as t };
@@ -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.29.0");
43
+ const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.30.0");
44
44
  let histogram;
45
- if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.29.0")).createHistogram("db.client.operation.duration", {
45
+ if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.30.0")).createHistogram("db.client.operation.duration", {
46
46
  unit: "s",
47
47
  description: "Duration of database client operations.",
48
48
  advice: { explicitBucketBoundaries: [
@@ -219,7 +219,7 @@ function otel(options = {}) {
219
219
  * `betterSupabase.events`. Returns a function that stops listening.
220
220
  */
221
221
  function traceAuth(betterSupabase, options = {}) {
222
- const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.29.0");
222
+ const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.30.0");
223
223
  const offAuth = betterSupabase.events.on("auth", (event) => {
224
224
  const span = tracer.startSpan("auth.resolve", {
225
225
  kind: SpanKind.INTERNAL,
@@ -257,7 +257,7 @@ function traceAuth(betterSupabase, options = {}) {
257
257
  * an error status. Returns a function that stops listening.
258
258
  */
259
259
  function traceBlockEvents(betterSupabase, options = {}) {
260
- const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.29.0");
260
+ const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.30.0");
261
261
  return betterSupabase.events.on("block", (event) => {
262
262
  const attributes = {
263
263
  ...options.attributes,
@@ -1,5 +1,5 @@
1
1
  import { t as AsyncResult } from "./result-DZeA5KS6.js";
2
- import { n as TopicPort } from "./watch-topic-DpN_GEoS.js";
2
+ import { n as TopicPort } from "./watch-topic-ItO3dz8m.js";
3
3
  import { SupabaseClient } from "@supabase/supabase-js";
4
4
  //#region src/client/ports.d.ts
5
5
  /**
@@ -2,8 +2,8 @@ import { f as Result } from "../result-DZeA5KS6.js";
2
2
  import { Bt as Executor } from "../types-CPl9uJ0G.js";
3
3
  import { t as BlockTransport } from "../block-transport-9EUA3q_I.js";
4
4
  import { C as UploadRouteOptions, E as uploadRoute, S as UploadRoute, T as uploadOutcome, _ as UploadConnectorOptions, b as UploadOutcome, c as LocalTablesOption, d as CreateUploadRepository, f as CrudEntryLike, g as UploadConnector, h as RejectedStore, m as RejectedChange, n as DataEngine, p as CrudQueueLike, s as LiveEngineOptions, v as UploadErrorContext, w as createUploadConnector, x as UploadRepository, y as UploadFunction } from "../data-engine-rvbR2C4F.js";
5
- import { n as TopicPort } from "../watch-topic-DpN_GEoS.js";
6
- import { t as AuthSnapshot } from "../bind-DmUGUsBd.js";
5
+ import { n as TopicPort } from "../watch-topic-ItO3dz8m.js";
6
+ import { t as AuthSnapshot } from "../bind-p7asfI6H.js";
7
7
  import { C as quoteSqliteIdent, S as likeToGlob, _ as SqliteQuery, a as postgrestTimestamp, b as SqliteValue, c as sqliteCompiler, d as SqliteDecode, f as SqliteInsertPlan, g as SqlitePlan, h as SqliteNested, i as fromSqliteError, l as SqliteColumn, m as SqliteKeys, n as SqliteDatabaseLike, o as CheckSqliteOptions, p as SqliteKeyedPlan, r as SqliteExecutorOptions, s as checkSqlite, t as SqliteContextLike, u as SqliteCompilerOptions, v as SqliteReturning, w as sqliteValue, x as compileSqlite, y as SqliteSelectPlan } from "../executor-BfirBzOr.js";
8
8
  //#region src/powersync/sync.d.ts
9
9
  /** The part of PowerSync's `SyncStatus` the engine reads. */
@@ -1,4 +1,4 @@
1
- import { $n as PresetGroup, Ai as PresetValueInfo, At as PresetConflict, Ci as PresetConventions, Ct as ConfigConventions, Di as PresetFramework, Dt as expandPreset, Ei as PresetFieldValue, Et as conventionConfig, Ft as presetBlockConflict, Gn as presetFromSpec, It as resolvePreset, Jn as DEFAULT_PRESET_NAME, Kn as presetOfSpec, Mi as presetField, Mt as ResolvedPreset, Ni as presetValueLabel, Nt as ResolvedPresetBlock, Oi as PresetPlatforms, Ot as presetConfig, Pt as listNames, Qn as PRESET_NAMES, Si as PresetAccess, Ti as PresetFieldKey, Tt as PresetInput, Wn as PresetSpec, Xn as PRESETS, Yn as NamedPreset, Zn as PRESET_GROUPS, _i as CONVENTION_FIELDS, _r as AppColumnFormat, bi as PRESET_TENANT_NAMES, di as INSTANCE_NAME, er as PresetName, fi as instancePrefix, gi as PresetGlueItem, hi as PresetCatalogManifest, ji as integrationsForFramework, jt as PresetIntegration, ki as PresetScope, kt as presetOf, mi as PresetCatalogBlock, nr as isPresetName, pi as PresetCatalog, qn as presetSpec, rr as namedPreset, tr as defaultPreset, ui as CORE_BLOCKS, ur as APP_COLUMN_FORMATS, vi as DEFAULT_CONVENTIONS, wi as PresetField, wt as ExpandedConfig, xi as Preset, yi as PRESET_FRAMEWORKS } from "../context-B4TsE2gY.js";
2
- import { $ as readDesignFile, A as DesignFile, B as designFileSource, C as diffAppTables, D as DESIGN_FILE, E as CreateDesign, F as MAX_DESIGN_CODE_LENGTH, G as isDesignCode, H as designOf, I as createQuery, J as presetApplyCommand, K as parseDesign, L as createUrl, M as DesignParseIssue, N as DesignParseResult, O as DESIGN_FORMAT, P as DesignTooLongError, Q as presetKey, R as decodeDesign, S as DiffOptions, T as CREATE_URL, U as designSchema, V as designFormat, W as encodeDesign, X as presetConfigSource, Y as presetArgumentOf, Z as presetInstallCommand, _ as glueCommand, a as blockRequires, b as DesignChange, c as installedBlocks, d as instancesOf, et as safeDesignFileSource, f as presetInstances, g as PROVIDER_COMMENT, h as withoutInstance, i as blockEntities, it as PRESET_CATALOG, j as DesignParseError, k as DesignErrorCode, l as instanceBlock, m as withInstance, n as BlockInstance, nt as appDefaultError, o as canAddInstance, p as withEntityName, q as presetAndDesignOf, r as PresetInstance, rt as isAppDefault, s as entityName, t as BlockEntity, tt as safeParseDesign, u as instanceNameProblem, v as presetBlocksSource, w as diffDesigns, x as DesignChangeKind, y as presetGlue, z as designConfig } from "../index-CB66nl14.js";
3
- import { i as appReservedColumns, n as appIdentifierError, r as appNameLengthError, t as APP_NAME_MAX } from "../app-tables-DekyKNQ8.js";
1
+ import { $n as PresetGroup, Ai as PresetValueInfo, At as PresetConflict, Ci as PresetConventions, Ct as ConfigConventions, Di as PresetFramework, Dt as expandPreset, Ei as PresetFieldValue, Et as conventionConfig, Ft as presetBlockConflict, Gn as presetFromSpec, It as resolvePreset, Jn as DEFAULT_PRESET_NAME, Kn as presetOfSpec, Mi as presetField, Mt as ResolvedPreset, Ni as presetValueLabel, Nt as ResolvedPresetBlock, Oi as PresetPlatforms, Ot as presetConfig, Pt as listNames, Qn as PRESET_NAMES, Si as PresetAccess, Ti as PresetFieldKey, Tt as PresetInput, Wn as PresetSpec, Xn as PRESETS, Yn as NamedPreset, Zn as PRESET_GROUPS, _i as CONVENTION_FIELDS, _r as AppColumnFormat, bi as PRESET_TENANT_NAMES, di as INSTANCE_NAME, er as PresetName, fi as instancePrefix, gi as PresetGlueItem, hi as PresetCatalogManifest, ji as integrationsForFramework, jt as PresetIntegration, ki as PresetScope, kt as presetOf, mi as PresetCatalogBlock, nr as isPresetName, pi as PresetCatalog, qn as presetSpec, rr as namedPreset, tr as defaultPreset, ui as CORE_BLOCKS, ur as APP_COLUMN_FORMATS, vi as DEFAULT_CONVENTIONS, wi as PresetField, wt as ExpandedConfig, xi as Preset, yi as PRESET_FRAMEWORKS } from "../context-nbYYjv7U.js";
2
+ import { $ as readDesignFile, A as DesignFile, B as designFileSource, C as diffAppTables, D as DESIGN_FILE, E as CreateDesign, F as MAX_DESIGN_CODE_LENGTH, G as isDesignCode, H as designOf, I as createQuery, J as presetApplyCommand, K as parseDesign, L as createUrl, M as DesignParseIssue, N as DesignParseResult, O as DESIGN_FORMAT, P as DesignTooLongError, Q as presetKey, R as decodeDesign, S as DiffOptions, T as CREATE_URL, U as designSchema, V as designFormat, W as encodeDesign, X as presetConfigSource, Y as presetArgumentOf, Z as presetInstallCommand, _ as glueCommand, a as blockRequires, b as DesignChange, c as installedBlocks, d as instancesOf, et as safeDesignFileSource, f as presetInstances, g as PROVIDER_COMMENT, h as withoutInstance, i as blockEntities, it as PRESET_CATALOG, j as DesignParseError, k as DesignErrorCode, l as instanceBlock, m as withInstance, n as BlockInstance, nt as appDefaultError, o as canAddInstance, p as withEntityName, q as presetAndDesignOf, r as PresetInstance, rt as isAppDefault, s as entityName, t as BlockEntity, tt as safeParseDesign, u as instanceNameProblem, v as presetBlocksSource, w as diffDesigns, x as DesignChangeKind, y as presetGlue, z as designConfig } from "../index-BkzXwuIN.js";
3
+ import { i as appReservedColumns, n as appIdentifierError, r as appNameLengthError, t as APP_NAME_MAX } from "../app-tables-yyVncXEt.js";
4
4
  export { APP_COLUMN_FORMATS, APP_NAME_MAX, type AppColumnFormat, type BlockEntity, type BlockInstance, CONVENTION_FIELDS, CREATE_URL, type ConfigConventions, type CreateDesign, DEFAULT_CONVENTIONS, DEFAULT_PRESET_NAME, DESIGN_FILE, DESIGN_FORMAT, type DesignChange, type DesignChangeKind, type DesignErrorCode, type DesignFile, DesignParseError, type DesignParseIssue, type DesignParseResult, DesignTooLongError, type DiffOptions, type ExpandedConfig, INSTANCE_NAME, MAX_DESIGN_CODE_LENGTH, type NamedPreset, PRESETS, PRESET_CATALOG, PRESET_FRAMEWORKS, PRESET_GROUPS, PRESET_NAMES, PRESET_TENANT_NAMES, PROVIDER_COMMENT, type Preset, type PresetAccess, type PresetCatalog, type PresetCatalogBlock, type PresetCatalogManifest, type PresetConflict, type PresetConventions, type PresetField, type PresetFieldKey, type PresetFieldValue, type PresetFramework, type PresetGlueItem, type PresetGroup, type PresetInput, type PresetInstance, type PresetIntegration, type PresetName, type PresetPlatforms, type PresetScope, type PresetSpec, type PresetValueInfo, type ResolvedPreset, type ResolvedPresetBlock, CORE_BLOCKS as SINGLE_INSTANCE_BLOCKS, appDefaultError, appIdentifierError, appNameLengthError, appReservedColumns, blockEntities, blockRequires, canAddInstance, conventionConfig, createQuery, createUrl, decodeDesign, defaultPreset, designConfig, designFileSource, designFormat, designOf, designSchema, diffAppTables, diffDesigns, encodeDesign, entityName, expandPreset, glueCommand, installedBlocks, instanceBlock, instanceNameProblem, instancePrefix, instancesOf, integrationsForFramework, isAppDefault, isDesignCode, isPresetName, listNames, namedPreset, parseDesign, presetAndDesignOf, presetApplyCommand, presetArgumentOf, presetBlockConflict, presetBlocksSource, presetConfig, presetConfigSource, presetField, presetFromSpec, presetGlue, presetInstallCommand, presetInstances, presetKey, presetOf, presetOfSpec, presetSpec, presetValueLabel, readDesignFile, resolvePreset, safeDesignFileSource, safeParseDesign, withEntityName, withInstance, withoutInstance };
@@ -2,7 +2,7 @@ import { a as presetOf, d as resolvePreset } from "./config-bqKaPjst.js";
2
2
  import { M as PRESET_CATALOG, b as isAppDefault, d as appIdentifierError, f as appNameLengthError, p as appReservedColumns, y as appDefaultError } from "./instances-C7qUTjhJ.js";
3
3
  import { c as resolveConfig } from "./config-r7njjNgh.js";
4
4
  import { D as designOf, M as parseDesign, j as jsonPointer, k as encodeDesign, v as DesignParseError, w as designConfig, y as DesignTooLongError } from "./preset-DCdEnJj9.js";
5
- import { F as renderBlocks, S as moduleLayout, nt as SQL_MODULES } from "./sql-CoBySj2F.js";
5
+ import { F as renderBlocks, S as moduleLayout, nt as SQL_MODULES } from "./sql-CyeDg3Yh.js";
6
6
  //#region src/create/column-keys.ts
7
7
  /** The most options a select takes, and the longest option. */
8
8
  const MAX_OPTIONS = 100;
@@ -1,4 +1,4 @@
1
- import { s as PushTokenPort } from "./ports-6LBgr1Aa.js";
1
+ import { s as PushTokenPort } from "./ports-hpbyMySO.js";
2
2
  //#region src/client/native/push-token.d.ts
3
3
  /** The part of `expo-notifications` the push token port uses. */
4
4
  interface ExpoNotificationsLike {
@@ -1,13 +1,13 @@
1
1
  import { t as escapeLike } from "../escape-like-PReMbEEU.js";
2
2
  import { n as Impersonator } from "../impersonation-YTa9dZUv.js";
3
3
  import { i as DataEntry, m as RejectedChange, n as DataEngine, o as DataSyncState } from "../data-engine-rvbR2C4F.js";
4
- import { t as tenantOf } from "../tenant-Ded341Qz.js";
4
+ import { t as tenantOf } from "../tenant-C9YE_kqK.js";
5
5
  import { t as AuthSession } from "../view-C8_xvD-j.js";
6
- import { r as LiveCountSeed } from "../index-BNgpz_BV.js";
7
- import { r as MembershipClaim } from "../entitlements-Bw3eYGKJ.js";
8
- import { D as ProfileOf, O as UseActionOptions, S as LiveCountHookOptions, _ as ActionResultOf, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, h as BlockRefetchOn, l as BlockEventSource, m as BlockQueryState, o as DataSource, p as BlockQueryOptions, s as DataState, t as fieldErrorsOf, u as BlockMutationActions, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-DkzFduux.js";
6
+ import { r as LiveCountSeed } from "../index-BKrxynq9.js";
7
+ import { r as MembershipClaim } from "../entitlements-B1i1-wfe.js";
8
+ import { D as ProfileOf, O as UseActionOptions, S as LiveCountHookOptions, _ as ActionResultOf, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, h as BlockRefetchOn, l as BlockEventSource, m as BlockQueryState, o as DataSource, p as BlockQueryOptions, s as DataState, t as fieldErrorsOf, u as BlockMutationActions, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-tJvehEFc.js";
9
9
  import { n as supportOf, t as SupportView } from "../support-view-nqUWKHEs.js";
10
- import { $ as UseActionFormOptions, A as useController, B as RecordListUrl, C as useConflicts, D as defineDataHooks, E as DataView, F as RecordFormState, G as RecordInitial, H as useRecordListState, I as UseRecordFormOptions, J as RecordState, K as RecordProviderKit, L as useRecordForm, M as useBlockEvent, N as useBlockMutation, O as useBlockEnv, P as useBlockQuery, Q as ActionHandle, R as RecordListQueryStates, S as Conflicts, T as DataHooks, U as RecordActionsOf, V as RecordListUrlState, W as RecordContextValue, X as createRecordProvider, Y as RecordWriteHandlers, Z as ActionForm, _ as useRealtimeRelay, a as Upload, at as LiveCount, b as PresenceTopic, c as UseImageOptions, ct as useBroadcast, d as useSignedUrl, dt as useSupabase, et as useAction, f as useUpload, g as UseRealtimeRelayOptions, h as useDebouncedSearch, i as StorageImage, it as BetterSupabaseProviderProps, j as useLatest, k as useBlockTenant, l as UseUploadOptions, lt as useLiveCount, m as DebouncedSearchOptions, n as SignedUrl, nt as BetterHooks, o as UploadStatus, ot as createHooks, p as DebouncedSearch, q as RecordProviderProps, r as SignedUrlSource, rt as BetterSupabaseProvider, s as UploadTarget, st as useAuth, t as ImageSource, tt as useActionForm, u as useImage, ut as useLiveQuery, v as Presence, w as useSyncStatus, x as usePresence, y as PresenceHookOptions, z as RecordListState } from "../index-Cw5gGSP8.js";
10
+ import { $ as UseActionFormOptions, A as useController, B as RecordListUrl, C as useConflicts, D as defineDataHooks, E as DataView, F as RecordFormState, G as RecordInitial, H as useRecordListState, I as UseRecordFormOptions, J as RecordState, K as RecordProviderKit, L as useRecordForm, M as useBlockEvent, N as useBlockMutation, O as useBlockEnv, P as useBlockQuery, Q as ActionHandle, R as RecordListQueryStates, S as Conflicts, T as DataHooks, U as RecordActionsOf, V as RecordListUrlState, W as RecordContextValue, X as createRecordProvider, Y as RecordWriteHandlers, Z as ActionForm, _ as useRealtimeRelay, a as Upload, at as LiveCount, b as PresenceTopic, c as UseImageOptions, ct as useBroadcast, d as useSignedUrl, dt as useSupabase, et as useAction, f as useUpload, g as UseRealtimeRelayOptions, h as useDebouncedSearch, i as StorageImage, it as BetterSupabaseProviderProps, j as useLatest, k as useBlockTenant, l as UseUploadOptions, lt as useLiveCount, m as DebouncedSearchOptions, n as SignedUrl, nt as BetterHooks, o as UploadStatus, ot as createHooks, p as DebouncedSearch, q as RecordProviderProps, r as SignedUrlSource, rt as BetterSupabaseProvider, s as UploadTarget, st as useAuth, t as ImageSource, tt as useActionForm, u as useImage, ut as useLiveQuery, v as Presence, w as useSyncStatus, x as usePresence, y as PresenceHookOptions, z as RecordListState } from "../index-zsgNmE8m.js";
11
11
  import { SessionProvider, SessionProviderProps, useSession, useSupportSession } from "./session.js";
12
12
  import { a as useSignIn, i as SignOut, n as PendingState, o as useSignOut, r as SignIn, t as AuthHookOptions } from "../sign-in-D54FLMQy.js";
13
13
  export { type ActionForm, type ActionHandle, type ActionInputOf, type ActionResultOf, type AuthHookOptions, type AuthSession, type BetterHooks, BetterSupabaseProvider, type BetterSupabaseProviderProps, type BlockEventSource, type BlockMutationActions, type BlockMutationState, type BlockQueryActions, type BlockQueryOptions, type BlockQueryState, type BlockRefetchOn, type BroadcastOptions, type ClaimsOf, type ClientLike, type Conflicts, type DataEngine, type DataEntry, type DataHooks, type DataSource, type DataState, type DataSyncState, type DataView, type DataWrites, type DebouncedSearch, type DebouncedSearchOptions, type ImageSource, type Impersonator, type LiveCount, type LiveCountHookOptions, type LiveCountSeed, type LiveQueryHookOptions, type MembershipClaim, type PendingState, type Presence, type PresenceHookOptions, type PresenceTopic, type ProfileOf, type RecordActionsOf, type RecordContextValue, type RecordFormState, type RecordInitial, type RecordListQueryStates, type RecordListState, type RecordListUrl, type RecordListUrlState, type RecordProviderKit, type RecordProviderProps, type RecordState, type RecordWriteHandlers, type RejectedChange, SessionProvider, type SessionProviderProps, type SignIn, type SignOut, type SignedUrl, type SignedUrlSource, type StorageImage, type SupportView, type Upload, type UploadStatus, type UploadTarget, type UseActionFormOptions, type UseActionOptions, type UseImageOptions, type UseRealtimeRelayOptions, type UseRecordFormOptions, type UseUploadOptions, createHooks, createRecordProvider, defineDataHooks, escapeLike, fieldErrorsOf, supportOf, tenantOf, useAction, useActionForm, useAuth, useBlockEnv, useBlockEvent, useBlockMutation, useBlockQuery, useBlockTenant, useBroadcast, useConflicts, useController, useDebouncedSearch, useImage, useLatest, useLiveCount, useLiveQuery, usePresence, useRealtimeRelay, useRecordForm, useRecordListState, useSession, useSignIn, useSignOut, useSignedUrl, useSupabase, useSupportSession, useSyncStatus, useUpload };
@@ -1,4 +1,4 @@
1
- import { t as AuthSnapshot } from "../../bind-DmUGUsBd.js";
1
+ import { t as AuthSnapshot } from "../../bind-p7asfI6H.js";
2
2
  import { a as OAuthSignInOptions, i as OAuthClient, n as AuthLinkClient, o as WebBrowserLike, r as AuthLinkResult, t as AuthFailure } from "../../auth-link-B4NL84XU.js";
3
3
  import { n as PendingState } from "../../sign-in-D54FLMQy.js";
4
4
  import { Provider } from "@supabase/supabase-js";
@@ -1,13 +1,13 @@
1
1
  import { t as escapeLike } from "../escape-like-PReMbEEU.js";
2
2
  import { mt as QuerySpec } from "../define-D8_9X5fZ.js";
3
3
  import { n as Impersonator } from "../impersonation-YTa9dZUv.js";
4
- import { t as tenantOf } from "../tenant-Ded341Qz.js";
4
+ import { t as tenantOf } from "../tenant-C9YE_kqK.js";
5
5
  import { t as AuthSession } from "../view-C8_xvD-j.js";
6
- import { r as LiveCountSeed } from "../index-BNgpz_BV.js";
7
- import { r as MembershipClaim } from "../entitlements-Bw3eYGKJ.js";
8
- import { D as ProfileOf, O as UseActionOptions, S as LiveCountHookOptions, _ as ActionResultOf, b as ClaimsOf, g as ActionInputOf, t as fieldErrorsOf, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-DkzFduux.js";
6
+ import { r as LiveCountSeed } from "../index-BKrxynq9.js";
7
+ import { r as MembershipClaim } from "../entitlements-B1i1-wfe.js";
8
+ import { D as ProfileOf, O as UseActionOptions, S as LiveCountHookOptions, _ as ActionResultOf, b as ClaimsOf, g as ActionInputOf, t as fieldErrorsOf, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-tJvehEFc.js";
9
9
  import { n as supportOf, t as SupportView } from "../support-view-nqUWKHEs.js";
10
- import { $ as UseActionFormOptions, A as useController$1, B as RecordListUrl, C as useConflicts$1, D as defineDataHooks$1, F as RecordFormState, G as RecordInitial, H as useRecordListState$1, I as UseRecordFormOptions, J as RecordState, K as RecordProviderKit, L as useRecordForm$1, M as useBlockEvent$1, N as useBlockMutation$1, O as useBlockEnv$1, P as useBlockQuery$1, Q as ActionHandle, R as RecordListQueryStates, U as RecordActionsOf, V as RecordListUrlState, W as RecordContextValue, X as createRecordProvider$1, Y as RecordWriteHandlers, Z as ActionForm, _ as useRealtimeRelay$1, a as Upload, at as LiveCount, b as PresenceTopic, c as UseImageOptions, ct as useBroadcast, d as useSignedUrl$1, dt as useSupabase, f as useUpload$1, g as UseRealtimeRelayOptions, h as useDebouncedSearch$1, i as StorageImage, it as BetterSupabaseProviderProps, j as useLatest$1, k as useBlockTenant$1, l as UseUploadOptions, m as DebouncedSearchOptions, n as SignedUrl, nt as BetterHooks, o as UploadStatus, p as DebouncedSearch, q as RecordProviderProps, r as SignedUrlSource, rt as BetterSupabaseProvider, s as UploadTarget, st as useAuth, t as ImageSource, u as useImage$1, ut as useLiveQuery, v as Presence, w as useSyncStatus$1, x as usePresence$1, y as PresenceHookOptions, z as RecordListState } from "../index-Cw5gGSP8.js";
10
+ import { $ as UseActionFormOptions, A as useController$1, B as RecordListUrl, C as useConflicts$1, D as defineDataHooks$1, F as RecordFormState, G as RecordInitial, H as useRecordListState$1, I as UseRecordFormOptions, J as RecordState, K as RecordProviderKit, L as useRecordForm$1, M as useBlockEvent$1, N as useBlockMutation$1, O as useBlockEnv$1, P as useBlockQuery$1, Q as ActionHandle, R as RecordListQueryStates, U as RecordActionsOf, V as RecordListUrlState, W as RecordContextValue, X as createRecordProvider$1, Y as RecordWriteHandlers, Z as ActionForm, _ as useRealtimeRelay$1, a as Upload, at as LiveCount, b as PresenceTopic, c as UseImageOptions, ct as useBroadcast, d as useSignedUrl$1, dt as useSupabase, f as useUpload$1, g as UseRealtimeRelayOptions, h as useDebouncedSearch$1, i as StorageImage, it as BetterSupabaseProviderProps, j as useLatest$1, k as useBlockTenant$1, l as UseUploadOptions, m as DebouncedSearchOptions, n as SignedUrl, nt as BetterHooks, o as UploadStatus, p as DebouncedSearch, q as RecordProviderProps, r as SignedUrlSource, rt as BetterSupabaseProvider, s as UploadTarget, st as useAuth, t as ImageSource, u as useImage$1, ut as useLiveQuery, v as Presence, w as useSyncStatus$1, x as usePresence$1, y as PresenceHookOptions, z as RecordListState } from "../index-zsgNmE8m.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-D54FLMQy.js";
13
13
  //#region src/react/server.d.ts
@@ -1,8 +1,8 @@
1
1
  import { D as AccessTopicPolicy, E as AccessPolicySql } from "../types-CPl9uJ0G.js";
2
2
  import { et as TemplateParams, tt as TemplateValues } from "../bucket-SvRQwYS4.js";
3
3
  import { t as RealtimeStatus } from "../realtime-status-BhNkb-Ow.js";
4
- import { A as TriggerTopic, C as TopicSubscription, D as TriggerLookup, E as TopicTriggerValue, F as FanOutResult, I as TopicFanOutOptions, M as defineTopic, N as rowChange, O as TriggerOptions, P as rowKeys, S as TopicSubscribeOptions, T as TopicTriggerOptions, _ as TopicMessage, a as PresenceOutput, b as TopicPermission, c as RealtimeClient, d as SubscribeOptions, f as Subscription, g as TopicHandlers, h as TopicEvent, i as PresenceOptions, j as TriggerValue, k as TriggerPayloadMode, l as RowChange, m as Topic, n as PresenceInput, o as PresenceSchema, p as SubscriptionStatus, r as PresenceMember, s as PresenceSubscription, t as EventSchemas, u as RowKeys, v as TopicOptions, w as TopicTriggerLookup, x as TopicSqlOptions, y as TopicPayload } from "../topic-XDdKzlrn.js";
5
- import { a as watchTopic, i as topicPort, n as TopicPort, r as TopicWatch, t as TopicHandle } from "../watch-topic-DpN_GEoS.js";
6
- import { S as relayTopicPort, _ as subjectPresenceValues, a as LiveSource, b as RelayEventSourceConstructor, c as liveCount, d as realtimeChanges, f as SUBJECT_PRESENCE_TEMPLATE, g as subjectPresenceTopic, h as subjectPresence, i as LiveQueryOptions, l as liveQuery, m as SubjectPresenceValues, n as LiveCountOptions, o as LiveSubscription, p as SubjectPresenceTopic, r as LiveCountSeed, s as RealtimeChangesOptions, t as CountRunner, u as liveTopic, v as RelayClientOptions, x as relayRealtimeClient, y as RelayEventSource } from "../index-BNgpz_BV.js";
4
+ import { A as TriggerTopic, C as TopicSubscription, D as TriggerLookup, E as TopicTriggerValue, F as FanOutResult, I as TopicFanOutOptions, M as defineTopic, N as rowChange, O as TriggerOptions, P as rowKeys, S as TopicSubscribeOptions, T as TopicTriggerOptions, _ as TopicMessage, a as PresenceOutput, b as TopicPermission, c as RealtimeClient, d as SubscribeOptions, f as Subscription, g as TopicHandlers, h as TopicEvent, i as PresenceOptions, j as TriggerValue, k as TriggerPayloadMode, l as RowChange, m as Topic, n as PresenceInput, o as PresenceSchema, p as SubscriptionStatus, r as PresenceMember, s as PresenceSubscription, t as EventSchemas, u as RowKeys, v as TopicOptions, w as TopicTriggerLookup, x as TopicSqlOptions, y as TopicPayload } from "../topic-breZqx_4.js";
5
+ import { a as watchTopic, i as topicPort, n as TopicPort, r as TopicWatch, t as TopicHandle } from "../watch-topic-ItO3dz8m.js";
6
+ import { S as relayTopicPort, _ as subjectPresenceValues, a as LiveSource, b as RelayEventSourceConstructor, c as liveCount, d as realtimeChanges, f as SUBJECT_PRESENCE_TEMPLATE, g as subjectPresenceTopic, h as subjectPresence, i as LiveQueryOptions, l as liveQuery, m as SubjectPresenceValues, n as LiveCountOptions, o as LiveSubscription, p as SubjectPresenceTopic, r as LiveCountSeed, s as RealtimeChangesOptions, t as CountRunner, u as liveTopic, v as RelayClientOptions, x as relayRealtimeClient, y as RelayEventSource } from "../index-BKrxynq9.js";
7
7
  import { n as subjectReaders, t as SubjectReadersOptions } from "../subject-readers-CB5Te02u.js";
8
8
  export { type AccessPolicySql, type AccessTopicPolicy, type CountRunner, type EventSchemas, type FanOutResult, type LiveCountOptions, type LiveCountSeed, type LiveQueryOptions, type LiveSource, type LiveSubscription, type PresenceInput, type PresenceMember, type PresenceOptions, type PresenceOutput, type PresenceSchema, type PresenceSubscription, type RealtimeChangesOptions, type RealtimeClient, type RealtimeStatus, type RelayClientOptions, type RelayEventSource, type RelayEventSourceConstructor, type RowChange, type RowKeys, SUBJECT_PRESENCE_TEMPLATE, type SubjectPresenceTopic, type SubjectPresenceValues, type SubjectReadersOptions, type SubscribeOptions, type Subscription, type SubscriptionStatus, type TemplateParams, type TemplateValues, type Topic, type TopicEvent, type TopicFanOutOptions, type TopicHandle, type TopicHandlers, type TopicMessage, type TopicOptions, type TopicPayload, type TopicPermission, type TopicPort, type TopicSqlOptions, type TopicSubscribeOptions, type TopicSubscription, type TopicTriggerLookup, type TopicTriggerOptions, type TopicTriggerValue, type TopicWatch, type TriggerLookup, type TriggerOptions, type TriggerPayloadMode, type TriggerTopic, type TriggerValue, defineTopic, liveCount, liveQuery, liveTopic, realtimeChanges, relayRealtimeClient, relayTopicPort, rowChange, rowKeys, subjectPresence, subjectPresenceTopic, subjectPresenceValues, subjectReaders, topicPort, watchTopic };
@@ -2,9 +2,9 @@ import { b as DbError, t as AsyncResult } from "../result-DZeA5KS6.js";
2
2
  import { $ as RecordRef } from "../types-CPl9uJ0G.js";
3
3
  import { _n as recordBindingWrite, an as RecordBindingDefinition, cn as RecordBindingResult, dn as RecordBindingWriteName, fn as RecordBindingWriteOutput, gn as defineRecordBinding, hn as TimelineItem, in as RecordBindingData, ln as RecordBindingWrite, mn as RecordRowInput, nn as AnyRecordBindingWrite, on as RecordBindingOptions, pn as RecordBindingWrites, rn as RecordBinding, sn as RecordBindingPermissions, tn as AnyRecordBinding, un as RecordBindingWriteInput, vn as recordEventMatches, yn as recordRowInput } from "../define-block-DWVZSZv1.js";
4
4
  import { A as BindingBlocks, B as PermissionFlags, C as defineRecordType, D as recordPermissionKeys, E as recordCan, F as LoadBindingsOptions, H as can, I as LoadedBindings, L as bindingCan, M as BindingName, N as BindingOf, O as recordSubject, P as BindingSource, R as countBinding, S as RecordWriteInput, T as plainData, U as permissionFlags, V as PermissionSet, _ as RecordTypeBlocks, b as RecordTypeWriteInput, d as BindingWritesOf, f as Plain, g as RecordType, h as RecordCan, j as BindingCheck, k as recordWriteInput, m as PlainBindings, p as PlainBinding, v as RecordTypePermissions, w as findBindingWrite, x as RecordTypeWriteOutput, y as RecordTypeSpec, z as loadBindings } from "../index-BM6NmKSc.js";
5
- import { p as SubscriptionStatus } from "../topic-XDdKzlrn.js";
6
- import { n as TopicPort } from "../watch-topic-DpN_GEoS.js";
7
- import { n as Controller, t as AuthPort } from "../controller-CtwAsnVV.js";
5
+ import { p as SubscriptionStatus } from "../topic-breZqx_4.js";
6
+ import { n as TopicPort } from "../watch-topic-ItO3dz8m.js";
7
+ import { n as Controller, t as AuthPort } from "../controller-TRocodqG.js";
8
8
  import { a as RecordSummaryOptions, c as Subjects, f as MyWorkKind, i as RecordSummary, n as MyWorkItem, r as MyWorkOptions } from "../subjects-CiBNKy2y.js";
9
9
  import { a as timelineBindings, c as RecordListCells, d as RecordListQuery, f as RecordListRow, h as defineRecordList, i as loadTimeline, l as RecordListColumn, m as RecordListSpec, n as Timeline, o as RecordList, p as RecordListSource, r as TimelineEntry, s as RecordListCell, t as LoadTimelineOptions, u as RecordListPage } from "../timeline-DvXtXq5q.js";
10
10
  import { a as RecordFormOptions, c as recordForm, i as RecordFormInput, n as RecordFormCustomField, o as RecordFormResult, r as RecordFormField, s as RecordFormValues, t as RecordForm } from "../record-form-CubgBrtI.js";
@@ -13,7 +13,7 @@ import { A as isSessionSnapshot, C as DeleteAccountResult, D as SessionMemoStats
13
13
  import { n as Impersonator, r as impersonatorOf, t as ImpersonationOptions } from "../impersonation-YTa9dZUv.js";
14
14
  import { a as checkAal, i as amrOf, n as AmrEntry, r as aalOf, t as Aal } from "../mfa-oIOYTpvc.js";
15
15
  import { _ as SupportAuthorize, a as AutomationHooks, b as TicketSubject, c as ChatActionHook, d as IdentityRef, f as IdentityTarget, g as SubscriberPolicy, h as SubscriberEvent, i as AuthorizationHooks, l as DelegationPermissions, m as Subscriber, n as Approver, o as AutomationRef, p as PrincipalByIdentity, r as ApproverOf, s as ChatAction, t as ApprovalRequestRef, u as DelegationRef, v as SupportAuthorizeInput, x as defineAuthorizationHooks, y as SupportDecision } from "../authorization-hooks-BWhkMZfH.js";
16
- import { c as RealtimeClient } from "../topic-XDdKzlrn.js";
16
+ import { c as RealtimeClient } from "../topic-breZqx_4.js";
17
17
  import { n as toSession, t as AuthSession } from "../view-C8_xvD-j.js";
18
18
  import { C as SupportSessionStore, E as supportClaims, S as SupportSession, T as sqlSupportStore, _ as SupportCallerClaims, a as SupportPolicy, b as SupportRequest, c as supportSessions, d as clearSupportCookie, f as supportCookie, g as SupportApprover, h as SupportApprovalQuery, i as SupportOptions, l as SUPPORT_COOKIE, m as SqlSupportStoreOptions, n as SupportApi, o as SupportSessions, p as supportCookieValue, r as SupportExpireRouteOptions, s as SupportStartRequest, t as ActiveSupport, u as SupportCookieOptions, v as SupportEndedBy, w as SupportStartInput, x as SupportRequestInput, y as SupportListFilter } from "../support-BxyPOFk4.js";
19
19
  import { a as serverCore, i as ServerCore, n as SessionEntryConfig, r as withSession, t as AuthOutageHook } from "../session-BOzx2qHC.js";
@@ -26,9 +26,9 @@ import { i as JwsAlgorithm, n as Jwks, r as JwksOfOptions } from "../jws-D0toeQl
26
26
  import { i as ResourcePagination } from "../resource-WxN0IsvB.js";
27
27
  import { a as ResourceHandler, c as ResourceList, l as ResourceRouteOptions, s as ResourceInput } from "../resource-types-BVbHgTPg.js";
28
28
  import { a as claimsFingerprint, i as SessionWatchStatus, n as SessionStatusRouteOptions, o as sessionStatusRoute, r as SessionStatusServer, t as SessionStatusBody } from "../session-status-BP8eYVnA.js";
29
- import { i as tagFor, n as cacheTagsOf, r as tagCache, t as TagOptions } from "../tags-Cm48BsOa.js";
30
29
  import { n as RefreshOutcome, r as refreshSession } from "../refresh-D02Pbf5B.js";
31
- import { n as passwordGrant, r as safeRedirectPath, t as PasswordGrantOptions } from "../sign-in-CfwJAJJL.js";
30
+ import { i as PasswordGrantOptions, o as passwordGrant, s as safeRedirectPath } from "../sign-in-BzihC_8k.js";
31
+ import { i as tagFor, n as cacheTagsOf, r as tagCache, t as TagOptions } from "../tags-Cm48BsOa.js";
32
32
  import { n as supportOf, t as SupportView } from "../support-view-nqUWKHEs.js";
33
33
  import { a as sessionStatus, i as clearSessionCookies, n as SessionStatus, o as authContext, r as SessionStatusOptions, t as ClearSessionCookiesOptions } from "../ended-EZzN9QTM.js";
34
34
  import { SupabaseClient } from "@supabase/supabase-js";
@@ -17,7 +17,7 @@ import { a as refreshSession, c as AUTH_CACHE_HEADERS, g as sessionCookieName, i
17
17
  import { i as defineAuthorizer, o as requestMemo, t as bindAuthorizer } from "../authorizer-BGhXaDmo.js";
18
18
  import { a as isSessionSnapshot, c as sessionMemo, d as amrOf, f as checkAal, i as authzVersionOf, l as snapshotOf, n as toSession, o as issuedAtOf, s as sessionCacheKey, u as aalOf } from "../view-C8Ve14ja.js";
19
19
  import { a as isResult, i as guard, o as respond, s as settle } from "../respond-CZMWbUs3.js";
20
- import { a as sqlSupportStore, i as supportSessions, n as passwordGrant, o as supportClaims, r as safeRedirectPath } from "../sign-in-NO7LWlw4.js";
20
+ import { a as passwordGrant, d as sqlSupportStore, f as supportClaims, l as safeRedirectPath, u as supportSessions } from "../sign-in-Cyj3ZlFX.js";
21
21
  import { t as subjectReaders } from "../subject-readers-VHcrWhmq.js";
22
22
  import { t as postgresExecutor } from "../executor-C2Ne-Scm.js";
23
23
  import { n as jwtClaimsOf, r as userClaimsOf, t as authModeOf } from "../claims-DTy6R6my.js";
@@ -0,0 +1,50 @@
1
+ import { f as Result } from "./result-DZeA5KS6.js";
2
+ import { _ as StoredSession } from "./resolve-CtX6T0c0.js";
3
+ import { t as RefreshOptions } from "./refresh-D02Pbf5B.js";
4
+ //#region src/auth/sign-in.d.ts
5
+ /**
6
+ * `next` when it is a same-origin path (`/dashboard?tab=1`), else `fallback`.
7
+ * Use it on any `?next=` or `redirectTo` value a request carries, so the value
8
+ * can't send the user to another origin.
9
+ */
10
+ declare function safeRedirectPath(next: string | null | undefined, fallback: string): string;
11
+ type PasswordGrantOptions = Omit<RefreshOptions, "now"> & {
12
+ readonly now?: () => number;
13
+ };
14
+ /** The email link and code types `/auth/v1/verify` accepts. */
15
+ type EmailOtpType = "signup" | "invite" | "magiclink" | "recovery" | "email_change" | "email";
16
+ /** A link's `token_hash`, or the email and the code Auth sent to it. */
17
+ type OtpParams = {
18
+ readonly type: EmailOtpType;
19
+ readonly tokenHash: string;
20
+ } | {
21
+ readonly type: EmailOtpType;
22
+ readonly email: string;
23
+ readonly token: string;
24
+ };
25
+ /** Where `logout` ends sessions: this one, every one, or every other one. */
26
+ type SignOutScope = "local" | "global" | "others";
27
+ /**
28
+ * Signs in with an email and a password against the Auth server's password
29
+ * grant, without a supabase-js client. Returns the session to write as
30
+ * cookies.
31
+ */
32
+ declare function passwordGrant(credentials: {
33
+ readonly email: string;
34
+ readonly password: string;
35
+ }, options: PasswordGrantOptions): Promise<Result<StoredSession>>;
36
+ interface AuthorizeUrlParams {
37
+ /** The OAuth provider, such as `github` or `google`. */
38
+ readonly provider: string;
39
+ /**
40
+ * The absolute URL of the callback route that calls `exchangeCode`. It must
41
+ * be in the project's redirect allow list.
42
+ */
43
+ readonly redirectTo: string;
44
+ /** Space-separated provider scopes. */
45
+ readonly scopes?: string;
46
+ /** Extra query parameters for the provider, such as `prompt`. */
47
+ readonly queryParams?: Readonly<Record<string, string>>;
48
+ }
49
+ //#endregion
50
+ export { SignOutScope as a, PasswordGrantOptions as i, EmailOtpType as n, passwordGrant as o, OtpParams as r, safeRedirectPath as s, AuthorizeUrlParams as t };