@gatwech/auth 1.0.0-beta.19 → 1.0.0-beta.21

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 (134) hide show
  1. package/dist/adapters/drizzle-adapter/index.mjs +11 -2
  2. package/dist/adapters/index.d.mts +2 -2
  3. package/dist/adapters/kysely-adapter/index.mjs +1 -1
  4. package/dist/adapters/memory-adapter/index.d.mts +1 -1
  5. package/dist/adapters/memory-adapter/index.mjs +2 -2
  6. package/dist/api/index.d.mts +2 -2
  7. package/dist/api/index.mjs +1 -1
  8. package/dist/{audit-log-DKsUWR8O.mjs → audit-log-DgqHJ-uv.mjs} +132 -63
  9. package/dist/{auth-vfCyIIeV.mjs → auth-BoEA9bN7.mjs} +14 -1
  10. package/dist/client/index.d.mts +18 -18
  11. package/dist/client/plugins/index.d.mts +28 -28
  12. package/dist/client/plugins/index.mjs +2 -2
  13. package/dist/client/react/index.d.mts +16 -16
  14. package/dist/{client-CSOs1YN7.d.mts → client-B00gkznv.d.mts} +1 -1
  15. package/dist/{client-4QEb0rUr.mjs → client-CMsC6-rl.mjs} +1 -1
  16. package/dist/{client-DZHNfxuR.d.mts → client-Da7tq8m6.d.mts} +4 -4
  17. package/dist/cookies/index.d.mts +3 -3
  18. package/dist/db/index.d.mts +2 -2
  19. package/dist/db/index.mjs +1 -1
  20. package/dist/{db-7vHnL1XA.mjs → db-CV59HpEF.mjs} +2 -2
  21. package/dist/{index-mxEUX2Gs.d.mts → index-BECNG13R.d.mts} +13 -13
  22. package/dist/{index-DRM35ir1.d.mts → index-BKy-8t2n.d.mts} +118 -65
  23. package/dist/{index-Df0KhQRf-BEa5tdwJ.d.mts → index-BL_t8cRp-C4QYBsac.d.mts} +56 -17
  24. package/dist/{index-DXVU0HGr.d.mts → index-BWYXZVsV.d.mts} +5 -5
  25. package/dist/{index-Df4SvZaE.d.mts → index-Bhc37y9F.d.mts} +3 -3
  26. package/dist/{index-BNhJglHC.d.mts → index-BjCQ3jmE.d.mts} +119 -119
  27. package/dist/{index-Cv9iMevV.d.mts → index-Bxive_YT.d.mts} +9 -9
  28. package/dist/{index-CgeC2eGC.d.mts → index-C-IDh5yy.d.mts} +2 -2
  29. package/dist/{index-COGe8UJx.d.mts → index-CM1rFdwV.d.mts} +9 -9
  30. package/dist/{index-zBdYQGaS.d.mts → index-CMG4Pnen.d.mts} +6 -6
  31. package/dist/{index-Blmhq6eA.d.mts → index-CTqynuxm.d.mts} +4 -4
  32. package/dist/{index-DS-R7st3.d.mts → index-CbBQdS-u.d.mts} +6 -6
  33. package/dist/{index-Db8jqUq2.d.mts → index-CpH-1sse.d.mts} +10 -10
  34. package/dist/{index-CUknVRZp.d.mts → index-D1OZ2e4m.d.mts} +14 -14
  35. package/dist/{index-CaqpCfE5.d.mts → index-Dt2I0G4X.d.mts} +7 -7
  36. package/dist/{index-EABwA_BH.d.mts → index-IX1to9TB.d.mts} +34 -34
  37. package/dist/{index-CKnPAS5n.d.mts → index-TrOnY3pM.d.mts} +170 -170
  38. package/dist/{index-CsxtcAO0.d.mts → index-VUyESU4p.d.mts} +1 -1
  39. package/dist/{index-CP3FNbOZ.d.mts → index-WV7VzW2H.d.mts} +8 -8
  40. package/dist/{index-xoYsoOiR.d.mts → index-YeXSxzhX.d.mts} +3 -3
  41. package/dist/{index-DG-X1PK5.d.mts → index-cPt-00xm.d.mts} +6 -6
  42. package/dist/{index-BNDRYfTF.d.mts → index-iRoaTsOj.d.mts} +2 -2
  43. package/dist/{index-BAVzFqII.d.mts → index-jEkJ2Zfk.d.mts} +6 -6
  44. package/dist/{index-DyH_CgmX.d.mts → index-oNlp4SvD.d.mts} +10 -10
  45. package/dist/index.d.mts +2 -2
  46. package/dist/index.mjs +3 -3
  47. package/dist/integrations/next-js.d.mts +4 -4
  48. package/dist/integrations/node.d.mts +2 -2
  49. package/dist/integrations/react-start.d.mts +4 -4
  50. package/dist/{kysely-adapter-Bkm1liPW.mjs → kysely-adapter-BidlNTiV.mjs} +4 -2
  51. package/dist/oauth2/index.d.mts +2 -2
  52. package/dist/oauth2/index.mjs +1 -1
  53. package/dist/{organization-CkTKs7bx.mjs → organization-D4QMpChF.mjs} +1 -1
  54. package/dist/plugins/admin/index.d.mts +3 -3
  55. package/dist/plugins/admin/index.mjs +1 -1
  56. package/dist/plugins/anonymous/index.d.mts +3 -3
  57. package/dist/plugins/anonymous/index.mjs +1 -1
  58. package/dist/plugins/audit-log/client.d.mts +24 -24
  59. package/dist/plugins/audit-log/index.d.mts +23 -23
  60. package/dist/plugins/audit-log/index.mjs +2 -2
  61. package/dist/plugins/bearer/index.d.mts +1 -1
  62. package/dist/plugins/captcha/index.d.mts +1 -1
  63. package/dist/plugins/custom-session/index.d.mts +3 -3
  64. package/dist/plugins/custom-session/index.mjs +1 -1
  65. package/dist/plugins/device-authorization/index.d.mts +1 -1
  66. package/dist/plugins/device-authorization/index.mjs +1 -1
  67. package/dist/plugins/email-otp/index.d.mts +2 -2
  68. package/dist/plugins/email-otp/index.mjs +1 -1
  69. package/dist/plugins/generic-oauth/index.d.mts +3 -3
  70. package/dist/plugins/generic-oauth/index.mjs +1 -1
  71. package/dist/plugins/haveibeenpwned/index.d.mts +1 -1
  72. package/dist/plugins/haveibeenpwned/index.mjs +1 -1
  73. package/dist/plugins/index.d.mts +23 -23
  74. package/dist/plugins/index.mjs +5 -5
  75. package/dist/plugins/jwt/index.d.mts +3 -3
  76. package/dist/plugins/jwt/index.mjs +1 -1
  77. package/dist/plugins/magic-link/index.d.mts +1 -1
  78. package/dist/plugins/magic-link/index.mjs +1 -1
  79. package/dist/plugins/multi-session/index.d.mts +2 -2
  80. package/dist/plugins/multi-session/index.mjs +1 -1
  81. package/dist/plugins/oauth-proxy/index.d.mts +1 -1
  82. package/dist/plugins/oauth-proxy/index.mjs +1 -1
  83. package/dist/plugins/one-tap/index.d.mts +1 -1
  84. package/dist/plugins/one-tap/index.mjs +1 -1
  85. package/dist/plugins/one-time-token/index.d.mts +3 -3
  86. package/dist/plugins/one-time-token/index.mjs +5 -5
  87. package/dist/plugins/organization/index.d.mts +3 -3
  88. package/dist/plugins/organization/index.mjs +2 -2
  89. package/dist/plugins/passkey/index.d.mts +3 -3
  90. package/dist/plugins/passkey/index.mjs +1 -1
  91. package/dist/plugins/phone-number/index.d.mts +3 -3
  92. package/dist/plugins/phone-number/index.mjs +1 -1
  93. package/dist/plugins/sentinel/client.d.mts +24 -24
  94. package/dist/plugins/sentinel/client.mjs +2 -2
  95. package/dist/plugins/sentinel/index.d.mts +23 -23
  96. package/dist/plugins/sentinel/index.mjs +3 -3
  97. package/dist/plugins/two-factor/index.d.mts +3 -3
  98. package/dist/plugins/two-factor/index.mjs +1 -1
  99. package/dist/plugins/username/index.d.mts +1 -1
  100. package/dist/plugins/username/index.mjs +1 -1
  101. package/dist/{pow-OK01yPG3.mjs → pow-DvkUopsK.mjs} +17 -1
  102. package/dist/{sentinel-C-D1IHJo.mjs → sentinel-B4Wo79HK.mjs} +326 -92
  103. package/dist/src/adapters/memory-adapter/memory-adapter.d.ts +1 -1
  104. package/dist/src/adapters/prisma-adapter/test/auth.d.ts +1 -1
  105. package/dist/src/adapters/tests/auth-flow.d.ts +3 -3
  106. package/dist/src/adapters/tests/normal.d.ts +10 -2
  107. package/dist/src/adapters/tests/number-id.d.ts +4 -4
  108. package/dist/src/adapters/tests/performance.d.ts +3 -3
  109. package/dist/src/adapters/tests/transactions.d.ts +3 -3
  110. package/dist/src/api/index.d.ts +8 -8
  111. package/dist/src/plugins/admin/admin.d.ts +2 -2
  112. package/dist/src/plugins/api-key/index.d.ts +2 -2
  113. package/dist/src/plugins/audit-log/index.d.ts +5 -14
  114. package/dist/src/plugins/audit-log/remote.d.ts +4 -4
  115. package/dist/src/plugins/audit-log/types.d.ts +22 -0
  116. package/dist/src/plugins/email-otp/index.d.ts +1 -1
  117. package/dist/src/plugins/multi-session/index.d.ts +8 -8
  118. package/dist/src/plugins/organization/routes/crud-access-control.d.ts +8 -8
  119. package/dist/src/plugins/organization/routes/crud-invites.d.ts +46 -46
  120. package/dist/src/plugins/organization/routes/crud-members.d.ts +40 -40
  121. package/dist/src/plugins/organization/routes/crud-org.d.ts +36 -36
  122. package/dist/src/plugins/organization/routes/crud-team.d.ts +50 -50
  123. package/dist/src/plugins/sentinel/email.d.ts +9 -3
  124. package/dist/src/plugins/sentinel/index.d.ts +10 -1
  125. package/dist/src/plugins/sentinel/intel.d.ts +8 -1
  126. package/dist/src/plugins/sentinel/memory-cache.d.ts +12 -0
  127. package/dist/src/plugins/sentinel/schema.d.ts +4 -0
  128. package/dist/src/plugins/sentinel/store.d.ts +7 -0
  129. package/dist/src/plugins/sentinel/types.d.ts +29 -1
  130. package/dist/src/test-utils/test-instance.d.ts +25 -25
  131. package/dist/test-utils/index.d.mts +293 -293
  132. package/dist/test-utils/index.mjs +7 -7
  133. package/dist/types/index.d.mts +2 -2
  134. package/package.json +3 -3
@@ -1,10 +1,10 @@
1
- import { g as User$1 } from "./index-BNhJglHC.mjs";
2
- import { n as DBPrimitive } from "./index-Df0KhQRf-BEa5tdwJ.mjs";
1
+ import { g as User$1 } from "./index-BjCQ3jmE.mjs";
2
+ import { n as DBPrimitive } from "./index-BL_t8cRp-C4QYBsac.mjs";
3
3
  import { t as InferOptionSchema } from "./plugins-Dy_FrD4Y.mjs";
4
4
  import { o as Statements } from "./index-CxlWnL9c.mjs";
5
- import * as _gatwech_core61 from "@gatwech/core";
5
+ import * as _gatwech_core63 from "@gatwech/core";
6
6
  import { AuthContext, GenericEndpointContext, HookEndpointContext } from "@gatwech/core";
7
- import * as better_call636 from "better-call";
7
+ import * as better_call643 from "better-call";
8
8
  import { AuthEndpoint, AuthMiddleware, createAuthEndpoint as createAuthEndpoint$1, createAuthMiddleware as createAuthMiddleware$1, optionsMiddleware } from "@gatwech/core/api";
9
9
  import * as zod1419 from "zod";
10
10
  import * as _gatwech_core_db14 from "@gatwech/core/db";
@@ -547,8 +547,8 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
547
547
  };
548
548
  hooks: {
549
549
  before: {
550
- matcher: (ctx: _gatwech_core61.HookEndpointContext) => boolean;
551
- handler: (inputContext: better_call636.MiddlewareInputContext<better_call636.MiddlewareOptions>) => Promise<{
550
+ matcher: (ctx: _gatwech_core63.HookEndpointContext) => boolean;
551
+ handler: (inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<{
552
552
  user: {
553
553
  id: string;
554
554
  createdAt: Date;
@@ -569,7 +569,7 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
569
569
  expiresAt: Date;
570
570
  };
571
571
  } | {
572
- context: better_call636.MiddlewareContext<better_call636.MiddlewareOptions, _gatwech_core61.AuthContext<_gatwech_core61.PayvoAuthOptions> & {
572
+ context: better_call643.MiddlewareContext<better_call643.MiddlewareOptions, _gatwech_core63.AuthContext<_gatwech_core63.PayvoAuthOptions> & {
573
573
  returned?: unknown | undefined;
574
574
  responseHeaders?: Headers | undefined;
575
575
  }>;
@@ -621,7 +621,7 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
621
621
  } & {
622
622
  asResponse?: boolean;
623
623
  returnHeaders?: boolean;
624
- use?: better_call636.Middleware[];
624
+ use?: better_call643.Middleware[];
625
625
  path?: string;
626
626
  } & {
627
627
  asResponse?: AsResponse | undefined;
@@ -855,7 +855,7 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
855
855
  } & {
856
856
  asResponse?: boolean;
857
857
  returnHeaders?: boolean;
858
- use?: better_call636.Middleware[];
858
+ use?: better_call643.Middleware[];
859
859
  path?: string;
860
860
  } & {
861
861
  asResponse?: AsResponse | undefined;
@@ -933,7 +933,7 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
933
933
  } & {
934
934
  asResponse?: boolean;
935
935
  returnHeaders?: boolean;
936
- use?: better_call636.Middleware[];
936
+ use?: better_call643.Middleware[];
937
937
  path?: string;
938
938
  } & {
939
939
  asResponse?: AsResponse | undefined;
@@ -993,7 +993,7 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
993
993
  query: zod1419.ZodObject<{
994
994
  id: zod1419.ZodString;
995
995
  }, zod_v4_core207.$strip>;
996
- use: ((inputContext: better_call636.MiddlewareInputContext<better_call636.MiddlewareOptions>) => Promise<{
996
+ use: ((inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<{
997
997
  session: {
998
998
  session: Record<string, any> & {
999
999
  id: string;
@@ -1186,7 +1186,7 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
1186
1186
  } & {
1187
1187
  asResponse?: boolean;
1188
1188
  returnHeaders?: boolean;
1189
- use?: better_call636.Middleware[];
1189
+ use?: better_call643.Middleware[];
1190
1190
  path?: string;
1191
1191
  } & {
1192
1192
  asResponse?: AsResponse | undefined;
@@ -1416,7 +1416,7 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
1416
1416
  } & {
1417
1417
  asResponse?: boolean;
1418
1418
  returnHeaders?: boolean;
1419
- use?: better_call636.Middleware[];
1419
+ use?: better_call643.Middleware[];
1420
1420
  path?: string;
1421
1421
  } & {
1422
1422
  asResponse?: AsResponse | undefined;
@@ -1434,7 +1434,7 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
1434
1434
  body: zod1419.ZodObject<{
1435
1435
  keyId: zod1419.ZodString;
1436
1436
  }, zod_v4_core207.$strip>;
1437
- use: ((inputContext: better_call636.MiddlewareInputContext<better_call636.MiddlewareOptions>) => Promise<{
1437
+ use: ((inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<{
1438
1438
  session: {
1439
1439
  session: Record<string, any> & {
1440
1440
  id: string;
@@ -1533,7 +1533,7 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
1533
1533
  } & {
1534
1534
  asResponse?: boolean;
1535
1535
  returnHeaders?: boolean;
1536
- use?: better_call636.Middleware[];
1536
+ use?: better_call643.Middleware[];
1537
1537
  path?: string;
1538
1538
  } & {
1539
1539
  asResponse?: AsResponse | undefined;
@@ -1590,7 +1590,7 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
1590
1590
  }[]>;
1591
1591
  options: {
1592
1592
  method: "GET";
1593
- use: ((inputContext: better_call636.MiddlewareInputContext<better_call636.MiddlewareOptions>) => Promise<{
1593
+ use: ((inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<{
1594
1594
  session: {
1595
1595
  session: Record<string, any> & {
1596
1596
  id: string;
@@ -1769,7 +1769,7 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
1769
1769
  } & {
1770
1770
  asResponse?: boolean;
1771
1771
  returnHeaders?: boolean;
1772
- use?: better_call636.Middleware[];
1772
+ use?: better_call643.Middleware[];
1773
1773
  path?: string;
1774
1774
  } & {
1775
1775
  asResponse?: AsResponse | undefined;
@@ -1959,7 +1959,7 @@ interface LastLoginMethodOptions {
1959
1959
  */
1960
1960
  declare const lastLoginMethod: <O extends LastLoginMethodOptions>(userConfig?: O | undefined) => {
1961
1961
  id: "last-login-method";
1962
- init(ctx: _gatwech_core61.AuthContext<_gatwech_core61.PayvoAuthOptions>): {
1962
+ init(ctx: _gatwech_core63.AuthContext<_gatwech_core63.PayvoAuthOptions>): {
1963
1963
  options: {
1964
1964
  databaseHooks: {
1965
1965
  user: {
@@ -1972,7 +1972,7 @@ declare const lastLoginMethod: <O extends LastLoginMethodOptions>(userConfig?: O
1972
1972
  emailVerified: boolean;
1973
1973
  name: string;
1974
1974
  image?: string | null | undefined;
1975
- } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core61.PayvoAuthOptions> | undefined): Promise<{
1975
+ } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core63.PayvoAuthOptions> | undefined): Promise<{
1976
1976
  data: {
1977
1977
  lastLoginMethod: any;
1978
1978
  id: string;
@@ -1997,7 +1997,7 @@ declare const lastLoginMethod: <O extends LastLoginMethodOptions>(userConfig?: O
1997
1997
  token: string;
1998
1998
  ipAddress?: string | null | undefined;
1999
1999
  userAgent?: string | null | undefined;
2000
- } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core61.PayvoAuthOptions> | undefined): Promise<void>;
2000
+ } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core63.PayvoAuthOptions> | undefined): Promise<void>;
2001
2001
  };
2002
2002
  };
2003
2003
  };
@@ -2006,7 +2006,7 @@ declare const lastLoginMethod: <O extends LastLoginMethodOptions>(userConfig?: O
2006
2006
  hooks: {
2007
2007
  after: {
2008
2008
  matcher(): true;
2009
- handler: (inputContext: better_call636.MiddlewareInputContext<better_call636.MiddlewareOptions>) => Promise<void>;
2009
+ handler: (inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<void>;
2010
2010
  }[];
2011
2011
  };
2012
2012
  schema: O["storeInDatabase"] extends true ? {
@@ -2230,6 +2230,10 @@ interface AuditLogOptions {
2230
2230
  headers?: Record<string, string> | undefined;
2231
2231
  /**
2232
2232
  * Configure how events are batched before they are sent
2233
+ *
2234
+ * @deprecated Ignored: each event is sent as it's recorded, in the
2235
+ * background. Use `advanced.backgroundTasks` to keep serverless
2236
+ * functions alive until it's sent.
2233
2237
  */
2234
2238
  batch?: {
2235
2239
  /**
@@ -2276,6 +2280,24 @@ interface AuditLogOptions {
2276
2280
  * @default ["admin"]
2277
2281
  */
2278
2282
  adminRoles?: string[] | undefined;
2283
+ /**
2284
+ * Organization member roles allowed to read the events of their
2285
+ * organization through `/audit-log/get-all-audit-logs`
2286
+ *
2287
+ * @default ["owner", "admin"]
2288
+ */
2289
+ organizationAdminRoles?: string[] | undefined;
2290
+ /**
2291
+ * Include failed sign-ins and security decisions made on a user's account
2292
+ * before they were signed in in their own events. They are matched by the
2293
+ * email that was typed, in lower case or as the user's email is stored, so
2294
+ * anyone's attempt shows up; the IP address, user agent, visitor id and
2295
+ * details are left out. Only the latest 50 events since the account was
2296
+ * created are included.
2297
+ *
2298
+ * @default true
2299
+ */
2300
+ showAttemptsOnOwnAccount?: boolean | undefined;
2279
2301
  /**
2280
2302
  * Custom schema for the audit log plugin
2281
2303
  */
@@ -2361,6 +2383,10 @@ declare const schema$1: {
2361
2383
  type: "string";
2362
2384
  required: true;
2363
2385
  };
2386
+ path: {
2387
+ type: "string";
2388
+ required: false;
2389
+ };
2364
2390
  ipAddress: {
2365
2391
  type: "string";
2366
2392
  required: false;
@@ -2634,9 +2660,37 @@ interface SentinelOptions {
2634
2660
  * @default "block"
2635
2661
  */
2636
2662
  action?: SecurityAction | undefined;
2663
+ /**
2664
+ * Maximum accounts per IP address within `ipWindowSeconds`. This
2665
+ * limit catches sign-ups that send no visitor id, or a different
2666
+ * one each time, so it is higher than the per-visitor limit to
2667
+ * allow for networks that share an address. Acts with `action`.
2668
+ *
2669
+ * @default 10
2670
+ */
2671
+ maxAccountsPerIp?: number | undefined;
2672
+ /**
2673
+ * How long sign-ups are remembered per IP address, in seconds.
2674
+ * Clamped to between 1 and 365 days.
2675
+ *
2676
+ * @default 86400 (1 day)
2677
+ */
2678
+ ipWindowSeconds?: number | undefined;
2679
+ /**
2680
+ * Challenge sign-ups whose visitor id is missing or wasn't
2681
+ * verified by the identification service. Without the service
2682
+ * (`kvUrl` and an API key), every visitor id is unverified.
2683
+ *
2684
+ * Visitor limits are only reliable with the identification
2685
+ * service, since a client can send any id otherwise.
2686
+ *
2687
+ * @default false
2688
+ */
2689
+ requireVerifiedVisitor?: boolean | undefined;
2637
2690
  } | undefined;
2638
2691
  /**
2639
- * Detect automated clients. `true` challenges them.
2692
+ * Detect automated clients on sign-in, sign-up, password reset and
2693
+ * verification requests. `true` challenges them.
2640
2694
  */
2641
2695
  botBlocking?: (boolean | {
2642
2696
  action: SecurityAction;
@@ -2842,7 +2896,7 @@ declare function parsePowHeader(value: string | null | undefined): {
2842
2896
  //#region src/plugins/sentinel/index.d.ts
2843
2897
  declare const sentinel: (options?: SentinelOptions | undefined) => {
2844
2898
  id: "sentinel";
2845
- init(ctx: AuthContext<_gatwech_core61.PayvoAuthOptions>): {
2899
+ init(ctx: AuthContext<_gatwech_core63.PayvoAuthOptions>): {
2846
2900
  options: {
2847
2901
  databaseHooks: {
2848
2902
  user: {
@@ -2855,7 +2909,7 @@ declare const sentinel: (options?: SentinelOptions | undefined) => {
2855
2909
  emailVerified: boolean;
2856
2910
  name: string;
2857
2911
  image?: string | null | undefined;
2858
- } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core61.PayvoAuthOptions> | undefined): Promise<{
2912
+ } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core63.PayvoAuthOptions> | undefined): Promise<{
2859
2913
  data: {
2860
2914
  normalizedEmail: string;
2861
2915
  id: string;
@@ -2875,7 +2929,7 @@ declare const sentinel: (options?: SentinelOptions | undefined) => {
2875
2929
  emailVerified: boolean;
2876
2930
  name: string;
2877
2931
  image?: string | null | undefined;
2878
- } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core61.PayvoAuthOptions> | undefined): Promise<void>;
2932
+ } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core63.PayvoAuthOptions> | undefined): Promise<void>;
2879
2933
  };
2880
2934
  update: {
2881
2935
  before(data: Partial<{
@@ -2903,28 +2957,28 @@ declare const sentinel: (options?: SentinelOptions | undefined) => {
2903
2957
  };
2904
2958
  };
2905
2959
  } | undefined;
2906
- onRequest(request: Request, ctx: AuthContext<_gatwech_core61.PayvoAuthOptions>): Promise<{
2960
+ onRequest(request: Request, ctx: AuthContext<_gatwech_core63.PayvoAuthOptions>): Promise<{
2907
2961
  response: Response;
2908
2962
  } | undefined>;
2909
2963
  hooks: {
2910
2964
  before: ({
2911
- matcher(context: _gatwech_core61.HookEndpointContext): boolean;
2912
- handler: (inputContext: better_call636.MiddlewareInputContext<better_call636.MiddlewareOptions>) => Promise<{
2965
+ matcher(context: _gatwech_core63.HookEndpointContext): boolean;
2966
+ handler: (inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<{
2913
2967
  context: {
2914
2968
  body: any;
2915
2969
  };
2916
2970
  } | undefined>;
2917
2971
  } | {
2918
- matcher(context: _gatwech_core61.HookEndpointContext): boolean;
2919
- handler: (inputContext: better_call636.MiddlewareInputContext<better_call636.MiddlewareOptions>) => Promise<void>;
2972
+ matcher(context: _gatwech_core63.HookEndpointContext): boolean;
2973
+ handler: (inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<void>;
2920
2974
  })[];
2921
2975
  after: ({
2922
- matcher(context: _gatwech_core61.HookEndpointContext): boolean;
2923
- handler: (inputContext: better_call636.MiddlewareInputContext<better_call636.MiddlewareOptions>) => Promise<void>;
2976
+ matcher(context: _gatwech_core63.HookEndpointContext): boolean;
2977
+ handler: (inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<void>;
2924
2978
  } | {
2925
- matcher(context: _gatwech_core61.HookEndpointContext): boolean;
2926
- handler: (inputContext: better_call636.MiddlewareInputContext<better_call636.MiddlewareOptions>) => Promise<({
2927
- status: ("OK" | "CREATED" | "ACCEPTED" | "NO_CONTENT" | "MULTIPLE_CHOICES" | "MOVED_PERMANENTLY" | "FOUND" | "SEE_OTHER" | "NOT_MODIFIED" | "TEMPORARY_REDIRECT" | "BAD_REQUEST" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "PROXY_AUTHENTICATION_REQUIRED" | "REQUEST_TIMEOUT" | "CONFLICT" | "GONE" | "LENGTH_REQUIRED" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "URI_TOO_LONG" | "UNSUPPORTED_MEDIA_TYPE" | "RANGE_NOT_SATISFIABLE" | "EXPECTATION_FAILED" | "I'M_A_TEAPOT" | "MISDIRECTED_REQUEST" | "UNPROCESSABLE_ENTITY" | "LOCKED" | "FAILED_DEPENDENCY" | "TOO_EARLY" | "UPGRADE_REQUIRED" | "PRECONDITION_REQUIRED" | "TOO_MANY_REQUESTS" | "REQUEST_HEADER_FIELDS_TOO_LARGE" | "UNAVAILABLE_FOR_LEGAL_REASONS" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "HTTP_VERSION_NOT_SUPPORTED" | "VARIANT_ALSO_NEGOTIATES" | "INSUFFICIENT_STORAGE" | "LOOP_DETECTED" | "NOT_EXTENDED" | "NETWORK_AUTHENTICATION_REQUIRED") | better_call636.Status;
2979
+ matcher(context: _gatwech_core63.HookEndpointContext): boolean;
2980
+ handler: (inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<({
2981
+ status: ("OK" | "CREATED" | "ACCEPTED" | "NO_CONTENT" | "MULTIPLE_CHOICES" | "MOVED_PERMANENTLY" | "FOUND" | "SEE_OTHER" | "NOT_MODIFIED" | "TEMPORARY_REDIRECT" | "BAD_REQUEST" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "PROXY_AUTHENTICATION_REQUIRED" | "REQUEST_TIMEOUT" | "CONFLICT" | "GONE" | "LENGTH_REQUIRED" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "URI_TOO_LONG" | "UNSUPPORTED_MEDIA_TYPE" | "RANGE_NOT_SATISFIABLE" | "EXPECTATION_FAILED" | "I'M_A_TEAPOT" | "MISDIRECTED_REQUEST" | "UNPROCESSABLE_ENTITY" | "LOCKED" | "FAILED_DEPENDENCY" | "TOO_EARLY" | "UPGRADE_REQUIRED" | "PRECONDITION_REQUIRED" | "TOO_MANY_REQUESTS" | "REQUEST_HEADER_FIELDS_TOO_LARGE" | "UNAVAILABLE_FOR_LEGAL_REASONS" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "HTTP_VERSION_NOT_SUPPORTED" | "VARIANT_ALSO_NEGOTIATES" | "INSUFFICIENT_STORAGE" | "LOOP_DETECTED" | "NOT_EXTENDED" | "NETWORK_AUTHENTICATION_REQUIRED") | better_call643.Status;
2928
2982
  body: ({
2929
2983
  message?: string;
2930
2984
  code?: string;
@@ -3019,6 +3073,10 @@ declare const sentinel: (options?: SentinelOptions | undefined) => {
3019
3073
  type: "string";
3020
3074
  required: true;
3021
3075
  };
3076
+ path: {
3077
+ type: "string";
3078
+ required: false;
3079
+ };
3022
3080
  ipAddress: {
3023
3081
  type: "string";
3024
3082
  required: false;
@@ -3083,7 +3141,8 @@ declare const sentinel: (options?: SentinelOptions | undefined) => {
3083
3141
  credentialStuffing?: {
3084
3142
  enabled: boolean;
3085
3143
  action?: SecurityAction | undefined;
3086
- thresholds?: {
3144
+ thresholds
3145
+ /** Checked with the identification service, rather than taken as sent */? /** Checked with the identification service, rather than taken as sent */: {
3087
3146
  challenge: number;
3088
3147
  block: number;
3089
3148
  } | undefined;
@@ -3111,6 +3170,9 @@ declare const sentinel: (options?: SentinelOptions | undefined) => {
3111
3170
  maxAccountsPerVisitor?: number | undefined;
3112
3171
  retentionSeconds?: number | undefined;
3113
3172
  action?: SecurityAction | undefined;
3173
+ maxAccountsPerIp?: number | undefined;
3174
+ ipWindowSeconds?: number | undefined;
3175
+ requireVerifiedVisitor?: boolean | undefined;
3114
3176
  } | undefined;
3115
3177
  botBlocking?: (boolean | {
3116
3178
  action: SecurityAction;
@@ -3164,7 +3226,7 @@ declare const AUDIT_LOG_ERROR_CODES: {
3164
3226
  };
3165
3227
  declare const auditLog: (options?: AuditLogOptions | undefined) => {
3166
3228
  id: "audit-log";
3167
- init(ctx: AuthContext<_gatwech_core61.PayvoAuthOptions>): {
3229
+ init(ctx: AuthContext<_gatwech_core63.PayvoAuthOptions>): {
3168
3230
  options: {
3169
3231
  databaseHooks: {
3170
3232
  user: {
@@ -3177,10 +3239,10 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3177
3239
  emailVerified: boolean;
3178
3240
  name: string;
3179
3241
  image?: string | null | undefined;
3180
- } & Record<string, unknown>, context: _gatwech_core61.GenericEndpointContext<_gatwech_core61.PayvoAuthOptions> | undefined): Promise<void>;
3242
+ } & Record<string, unknown>, context: _gatwech_core63.GenericEndpointContext<_gatwech_core63.PayvoAuthOptions> | undefined): Promise<void>;
3181
3243
  };
3182
3244
  update: {
3183
- before(data: Partial<{
3245
+ after(user: {
3184
3246
  id: string;
3185
3247
  createdAt: Date;
3186
3248
  updatedAt: Date;
@@ -3188,18 +3250,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3188
3250
  emailVerified: boolean;
3189
3251
  name: string;
3190
3252
  image?: string | null | undefined;
3191
- }> & Record<string, unknown>, context: _gatwech_core61.GenericEndpointContext<_gatwech_core61.PayvoAuthOptions> | undefined): Promise<{
3192
- data: Partial<{
3193
- id: string;
3194
- createdAt: Date;
3195
- updatedAt: Date;
3196
- email: string;
3197
- emailVerified: boolean;
3198
- name: string;
3199
- image?: string | null | undefined;
3200
- }> & Record<string, unknown>;
3201
- }>;
3202
- after(user: {
3253
+ } & Record<string, unknown>, context: _gatwech_core63.GenericEndpointContext<_gatwech_core63.PayvoAuthOptions> | undefined, data: (Partial<{
3203
3254
  id: string;
3204
3255
  createdAt: Date;
3205
3256
  updatedAt: Date;
@@ -3207,7 +3258,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3207
3258
  emailVerified: boolean;
3208
3259
  name: string;
3209
3260
  image?: string | null | undefined;
3210
- } & Record<string, unknown>, context: _gatwech_core61.GenericEndpointContext<_gatwech_core61.PayvoAuthOptions> | undefined): Promise<void>;
3261
+ }> & Record<string, unknown>) | undefined): Promise<void>;
3211
3262
  };
3212
3263
  delete: {
3213
3264
  after(user: {
@@ -3218,7 +3269,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3218
3269
  emailVerified: boolean;
3219
3270
  name: string;
3220
3271
  image?: string | null | undefined;
3221
- } & Record<string, unknown>, context: _gatwech_core61.GenericEndpointContext<_gatwech_core61.PayvoAuthOptions> | undefined): Promise<void>;
3272
+ } & Record<string, unknown>, context: _gatwech_core63.GenericEndpointContext<_gatwech_core63.PayvoAuthOptions> | undefined): Promise<void>;
3222
3273
  };
3223
3274
  };
3224
3275
  session: {
@@ -3232,7 +3283,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3232
3283
  token: string;
3233
3284
  ipAddress?: string | null | undefined;
3234
3285
  userAgent?: string | null | undefined;
3235
- } & Record<string, unknown>, context: _gatwech_core61.GenericEndpointContext<_gatwech_core61.PayvoAuthOptions> | undefined): Promise<void>;
3286
+ } & Record<string, unknown>, context: _gatwech_core63.GenericEndpointContext<_gatwech_core63.PayvoAuthOptions> | undefined): Promise<void>;
3236
3287
  };
3237
3288
  };
3238
3289
  account: {
@@ -3251,7 +3302,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3251
3302
  refreshTokenExpiresAt?: Date | null | undefined;
3252
3303
  scope?: string | null | undefined;
3253
3304
  password?: string | null | undefined;
3254
- }, context: _gatwech_core61.GenericEndpointContext<_gatwech_core61.PayvoAuthOptions> | undefined): Promise<void>;
3305
+ }, context: _gatwech_core63.GenericEndpointContext<_gatwech_core63.PayvoAuthOptions> | undefined): Promise<void>;
3255
3306
  };
3256
3307
  };
3257
3308
  };
@@ -3259,12 +3310,12 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3259
3310
  };
3260
3311
  hooks: {
3261
3312
  before: {
3262
- matcher(context: _gatwech_core61.HookEndpointContext): boolean;
3263
- handler: (inputContext: better_call636.MiddlewareInputContext<better_call636.MiddlewareOptions>) => Promise<void>;
3313
+ matcher(context: _gatwech_core63.HookEndpointContext): boolean;
3314
+ handler: (inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<void>;
3264
3315
  }[];
3265
3316
  after: {
3266
- matcher(context: _gatwech_core61.HookEndpointContext): boolean;
3267
- handler: (inputContext: better_call636.MiddlewareInputContext<better_call636.MiddlewareOptions>) => Promise<void>;
3317
+ matcher(context: _gatwech_core63.HookEndpointContext): boolean;
3318
+ handler: (inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<void>;
3268
3319
  }[];
3269
3320
  };
3270
3321
  endpoints: {
@@ -3293,7 +3344,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3293
3344
  } & {
3294
3345
  asResponse?: boolean;
3295
3346
  returnHeaders?: boolean;
3296
- use?: better_call636.Middleware[];
3347
+ use?: better_call643.Middleware[];
3297
3348
  path?: string;
3298
3349
  } & {
3299
3350
  asResponse?: AsResponse | undefined;
@@ -3314,7 +3365,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3314
3365
  }>;
3315
3366
  options: {
3316
3367
  method: "GET";
3317
- use: ((inputContext: better_call636.MiddlewareInputContext<better_call636.MiddlewareOptions>) => Promise<{
3368
+ use: ((inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<{
3318
3369
  session: {
3319
3370
  session: Record<string, any> & {
3320
3371
  id: string;
@@ -3461,7 +3512,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3461
3512
  } & {
3462
3513
  asResponse?: boolean;
3463
3514
  returnHeaders?: boolean;
3464
- use?: better_call636.Middleware[];
3515
+ use?: better_call643.Middleware[];
3465
3516
  path?: string;
3466
3517
  } & {
3467
3518
  asResponse?: AsResponse | undefined;
@@ -3482,7 +3533,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3482
3533
  }>;
3483
3534
  options: {
3484
3535
  method: "GET";
3485
- use: ((inputContext: better_call636.MiddlewareInputContext<better_call636.MiddlewareOptions>) => Promise<{
3536
+ use: ((inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<{
3486
3537
  session: {
3487
3538
  session: Record<string, any> & {
3488
3539
  id: string;
@@ -3620,7 +3671,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3620
3671
  } & {
3621
3672
  asResponse?: boolean;
3622
3673
  returnHeaders?: boolean;
3623
- use?: better_call636.Middleware[];
3674
+ use?: better_call643.Middleware[];
3624
3675
  path?: string;
3625
3676
  } & {
3626
3677
  asResponse?: AsResponse | undefined;
@@ -3635,7 +3686,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3635
3686
  }>;
3636
3687
  options: {
3637
3688
  method: "GET";
3638
- use: ((inputContext: better_call636.MiddlewareInputContext<better_call636.MiddlewareOptions>) => Promise<{
3689
+ use: ((inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<{
3639
3690
  session: {
3640
3691
  session: Record<string, any> & {
3641
3692
  id: string;
@@ -3750,6 +3801,8 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3750
3801
  database: boolean;
3751
3802
  trackFailedSignIns: boolean;
3752
3803
  adminRoles: string[];
3804
+ organizationAdminRoles: string[];
3805
+ showAttemptsOnOwnAccount: boolean;
3753
3806
  remote?: {
3754
3807
  apiUrl?: string | undefined;
3755
3808
  apiKey?: string | undefined;
@@ -25,7 +25,7 @@ type InternalLogger = { [K in LogLevel]: (...params: LogHandlerParams) => void }
25
25
  };
26
26
  declare const createLogger: (options?: Logger | undefined) => InternalLogger;
27
27
  //#endregion
28
- //#region ../core/dist/index-Df0KhQRf.d.mts
28
+ //#region ../core/dist/index-BL_t8cRp.d.mts
29
29
  //#region src/db/type.d.ts
30
30
  type DBPreservedModels = "user" | "account" | "session" | "verification" | "rate-limit" | "organization" | "member" | "invitation" | "jwks" | "passkey" | "two-factor";
31
31
  type DBFieldType = "string" | "number" | "boolean" | "date" | "json" | `${"string" | "number"}[]` | Array<LiteralString>;
@@ -137,7 +137,7 @@ interface SecondaryStorage {
137
137
  * @param key - Key to get
138
138
  * @returns - Value of the key
139
139
  */
140
- get: (key: string) => Awaitable$1<unknown>;
140
+ get: (key: string) => Awaitable<unknown>;
141
141
  /**
142
142
  * Atomically get a value and delete it from storage.
143
143
  *
@@ -149,7 +149,7 @@ interface SecondaryStorage {
149
149
  * breaking release, or require database-backed verification storage for
150
150
  * security-sensitive consume paths.
151
151
  */
152
- getAndDelete?: (key: string) => Awaitable$1<unknown>;
152
+ getAndDelete?: (key: string) => Awaitable<unknown>;
153
153
  /**
154
154
  * Atomically increment the counter at `key` by one, returning the
155
155
  * post-increment value.
@@ -164,7 +164,7 @@ interface SecondaryStorage {
164
164
  * this required for secondary-storage-backed rate limiting in the next minor
165
165
  * on `next`.
166
166
  */
167
- increment?: (key: string, ttl: number) => Awaitable$1<number>;
167
+ increment?: (key: string, ttl: number) => Awaitable<number>;
168
168
  set: (
169
169
  /**
170
170
  * Key to store
@@ -177,12 +177,12 @@ interface SecondaryStorage {
177
177
  /**
178
178
  * Time to live in seconds
179
179
  */
180
- ttl?: number | undefined) => Awaitable$1<void | null | unknown>;
180
+ ttl?: number | undefined) => Awaitable<void | null | unknown>;
181
181
  /**
182
182
  *
183
183
  * @param key - Key to delete
184
184
  */
185
- delete: (key: string) => Awaitable$1<void | null | string>;
185
+ delete: (key: string) => Awaitable<void | null | string>;
186
186
  }
187
187
  //#endregion
188
188
  //#region src/db/plugin.d.ts
@@ -912,7 +912,7 @@ type PayvoAuthCookies = {
912
912
  //#endregion
913
913
  //#region src/types/helper.d.ts
914
914
  type Primitive = string | number | symbol | bigint | boolean | null | undefined;
915
- type Awaitable$1<T> = T | Promise<T>;
915
+ type Awaitable<T> = T | Promise<T>;
916
916
  type LiteralString = "" | (string & Record<never, never>);
917
917
  type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>);
918
918
  //#endregion
@@ -1118,7 +1118,7 @@ type SocialProviders = { [K in SocialProviderList[number]]?: Parameters<(typeof
1118
1118
  type SocialProviderList = typeof socialProviderList;
1119
1119
  //#endregion
1120
1120
  //#region src/types/plugin.d.ts
1121
- type Awaitable<T> = T | Promise<T>;
1121
+ type Awaitable$1<T> = T | Promise<T>;
1122
1122
  type DeepPartial<T> = T extends Function ? T : T extends object ? { [K in keyof T]?: DeepPartial<T[K]> } : T;
1123
1123
  type HookEndpointContext = Partial<EndpointContext<string, any> & Omit<InputContext<string, any>, "method">> & {
1124
1124
  path: string;
@@ -1134,7 +1134,7 @@ type PayvoAuthPlugin = {
1134
1134
  * The init function is called when the plugin is initialized.
1135
1135
  * You can return a new context or modify the existing context.
1136
1136
  */
1137
- init?: ((ctx: AuthContext) => Awaitable<{
1137
+ init?: ((ctx: AuthContext) => Awaitable$1<{
1138
1138
  context?: DeepPartial<Omit<AuthContext, "options">>;
1139
1139
  options?: Partial<PayvoAuthOptions>;
1140
1140
  }> | void | Promise<void>) | undefined;
@@ -1355,6 +1355,27 @@ type PayvoAuthAdvancedOptions = {
1355
1355
  * Payvo Auth. And could lead to security vulnerabilities.
1356
1356
  */
1357
1357
  disableOriginCheck?: boolean | undefined;
1358
+ /**
1359
+ * Run deferred work, such as sending events to a remote service, after the
1360
+ * response is sent. On serverless platforms, pass the platform's hook so
1361
+ * the function stays alive until the work finishes.
1362
+ *
1363
+ * @example
1364
+ * // Vercel
1365
+ * import { waitUntil } from "@vercel/functions";
1366
+ * advanced: { backgroundTasks: { handler: waitUntil } }
1367
+ *
1368
+ * @example
1369
+ * // Cloudflare Workers, with the execution context kept in AsyncLocalStorage
1370
+ * advanced: {
1371
+ * backgroundTasks: {
1372
+ * handler: (promise) => executionContext.getStore()?.waitUntil(promise),
1373
+ * },
1374
+ * }
1375
+ */
1376
+ backgroundTasks?: {
1377
+ handler: (promise: Promise<unknown>) => void;
1378
+ } | undefined;
1358
1379
  /**
1359
1380
  * Configure cookies to be cross subdomains
1360
1381
  */
@@ -2100,9 +2121,10 @@ type PayvoAuthOptions = {
2100
2121
  data: Optional<User & Record<string, any>>;
2101
2122
  }>;
2102
2123
  /**
2103
- * Hook that is called after a user is updated.
2124
+ * Hook that is called after a user is updated. `data` holds the
2125
+ * fields that were written, after every `before` hook ran.
2104
2126
  */
2105
- after?: (user: User & Record<string, unknown>, context?: GenericEndpointContext) => Promise<void>;
2127
+ after?: (user: User & Record<string, unknown>, context?: GenericEndpointContext, data?: Partial<User> & Record<string, unknown>) => Promise<void>;
2106
2128
  };
2107
2129
  delete?: {
2108
2130
  /**
@@ -2147,9 +2169,10 @@ type PayvoAuthOptions = {
2147
2169
  data: Optional<Session & Record<string, any>>;
2148
2170
  }>;
2149
2171
  /**
2150
- * Hook that is called after a session is updated.
2172
+ * Hook that is called after a session is updated. `data` holds the
2173
+ * fields that were written, after every `before` hook ran.
2151
2174
  */
2152
- after?: (session: Session & Record<string, unknown>, context?: GenericEndpointContext) => Promise<void>;
2175
+ after?: (session: Session & Record<string, unknown>, context?: GenericEndpointContext, data?: Partial<Session> & Record<string, unknown>) => Promise<void>;
2153
2176
  };
2154
2177
  delete?: {
2155
2178
  /**
@@ -2194,9 +2217,10 @@ type PayvoAuthOptions = {
2194
2217
  data: Optional<Account & Record<string, any>>;
2195
2218
  }>;
2196
2219
  /**
2197
- * Hook that is called after a account is updated.
2220
+ * Hook that is called after a account is updated. `data` holds the
2221
+ * fields that were written, after every `before` hook ran.
2198
2222
  */
2199
- after?: (account: Account & Record<string, unknown>, context?: GenericEndpointContext) => Promise<void>;
2223
+ after?: (account: Account & Record<string, unknown>, context?: GenericEndpointContext, data?: Partial<Account> & Record<string, unknown>) => Promise<void>;
2200
2224
  };
2201
2225
  delete?: {
2202
2226
  /**
@@ -2238,9 +2262,11 @@ type PayvoAuthOptions = {
2238
2262
  data: Optional<Verification & Record<string, any>>;
2239
2263
  }>;
2240
2264
  /**
2241
- * Hook that is called after a verification is updated.
2265
+ * Hook that is called after a verification is updated. `data`
2266
+ * holds the fields that were written, after every `before` hook
2267
+ * ran.
2242
2268
  */
2243
- after?: (verification: Verification & Record<string, unknown>, context?: GenericEndpointContext) => Promise<void>;
2269
+ after?: (verification: Verification & Record<string, unknown>, context?: GenericEndpointContext, data?: Partial<Verification> & Record<string, unknown>) => Promise<void>;
2244
2270
  };
2245
2271
  delete?: {
2246
2272
  /**
@@ -2524,6 +2550,19 @@ type AuthContext<Options extends PayvoAuthOptions = PayvoAuthOptions> = {
2524
2550
  * @default false
2525
2551
  */
2526
2552
  skipCSRFCheck: boolean;
2553
+ /**
2554
+ * Runs work after the response without blocking it, e.g. sending an
2555
+ * event to a remote service.
2556
+ *
2557
+ * This is inferred from the `options.advanced?.backgroundTasks?.handler`
2558
+ * option. Without one, the promise runs on its own.
2559
+ */
2560
+ runInBackground: (promise: Promise<unknown>) => void;
2561
+ /**
2562
+ * Runs work in the background when `advanced.backgroundTasks` is
2563
+ * configured, and awaits it otherwise, for work that must finish
2564
+ */
2565
+ runInBackgroundOrAwait: (promise: Promise<unknown> | void) => Awaitable<unknown>;
2527
2566
  };
2528
2567
  //#endregion
2529
2568
  //#region src/types/plugin-client.d.ts