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

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 (117) hide show
  1. package/dist/adapters/index.d.mts +1 -1
  2. package/dist/adapters/prisma-adapter/index.mjs +1 -1
  3. package/dist/{admin-BzUJL6tr.mjs → admin-rd-xHhnP.mjs} +1 -1
  4. package/dist/{anonymous-BjlTk4gl.mjs → anonymous-qSasVeIe.mjs} +1 -1
  5. package/dist/api/index.d.mts +1 -1
  6. package/dist/api/index.mjs +1 -1
  7. package/dist/{api-Dk8Yj_J5.mjs → api-BV65Y-Rk.mjs} +5 -0
  8. package/dist/{audit-log-DgqHJ-uv.mjs → audit-log-DhRRCMrv.mjs} +21 -6
  9. package/dist/{auth-BoEA9bN7.mjs → auth-DtOjarwu.mjs} +1 -1
  10. package/dist/client/index.d.mts +1 -1
  11. package/dist/client/plugins/index.d.mts +46 -46
  12. package/dist/client/react/index.d.mts +15 -15
  13. package/dist/{client-Da7tq8m6.d.mts → client-CDaFOX7A.d.mts} +4 -4
  14. package/dist/{client-B00gkznv.d.mts → client-D8XKNpua.d.mts} +1 -1
  15. package/dist/cookies/index.d.mts +2 -2
  16. package/dist/db/index.d.mts +1 -1
  17. package/dist/{email-otp-Dw0DypjQ.mjs → email-otp-BmgAht1S.mjs} +1 -1
  18. package/dist/{generic-oauth-DFj27JY8.mjs → generic-oauth-C5_AXj2z.mjs} +1 -1
  19. package/dist/{haveibeenpwned-CzNda7Tn.mjs → haveibeenpwned-_3a5amT-.mjs} +1 -1
  20. package/dist/{index-C-IDh5yy.d.mts → index-382PsmkK.d.mts} +2 -2
  21. package/dist/{index-BjCQ3jmE.d.mts → index-3lfPQHhX.d.mts} +118 -118
  22. package/dist/{index-CMG4Pnen.d.mts → index-B4aWSJEd.d.mts} +6 -6
  23. package/dist/{index-BWYXZVsV.d.mts → index-B5r4oL5q.d.mts} +5 -5
  24. package/dist/{index-BKy-8t2n.d.mts → index-B7iZf_Dl.d.mts} +449 -112
  25. package/dist/{index-VUyESU4p.d.mts → index-BhYE1_9j.d.mts} +1 -1
  26. package/dist/{index-IX1to9TB.d.mts → index-Blq8KrTy.d.mts} +33 -33
  27. package/dist/{index-oNlp4SvD.d.mts → index-C-z4TCHD.d.mts} +10 -10
  28. package/dist/{index-D1OZ2e4m.d.mts → index-C8F7PsET.d.mts} +13 -13
  29. package/dist/{index-TrOnY3pM.d.mts → index-CExSHSFz.d.mts} +169 -169
  30. package/dist/{index-iRoaTsOj.d.mts → index-CIxFDcfQ.d.mts} +2 -2
  31. package/dist/{index-BECNG13R.d.mts → index-COFPq-mg.d.mts} +13 -13
  32. package/dist/{index-YeXSxzhX.d.mts → index-CWwQ1Q7t.d.mts} +17 -17
  33. package/dist/{index-CbBQdS-u.d.mts → index-CWxKeTtE.d.mts} +6 -6
  34. package/dist/{index-cPt-00xm.d.mts → index-D0SgItjY.d.mts} +6 -6
  35. package/dist/{index-Bhc37y9F.d.mts → index-DCliG2n6.d.mts} +3 -3
  36. package/dist/{index-CM1rFdwV.d.mts → index-DPVukjga.d.mts} +9 -9
  37. package/dist/{index-WV7VzW2H.d.mts → index-DUu0ieh6.d.mts} +8 -8
  38. package/dist/{index-Bxive_YT.d.mts → index-De2a2OyC.d.mts} +9 -9
  39. package/dist/{index-CpH-1sse.d.mts → index-Dg6Ftb6f.d.mts} +9 -9
  40. package/dist/{index-Dt2I0G4X.d.mts → index-Dgyj1fTk.d.mts} +7 -7
  41. package/dist/{index-CTqynuxm.d.mts → index-DxIqV3rU.d.mts} +4 -4
  42. package/dist/{index-jEkJ2Zfk.d.mts → index-DxRAXHrZ.d.mts} +6 -6
  43. package/dist/index.d.mts +1 -1
  44. package/dist/index.mjs +2 -2
  45. package/dist/integrations/next-js.d.mts +4 -4
  46. package/dist/integrations/node.d.mts +1 -1
  47. package/dist/integrations/react-start.d.mts +4 -4
  48. package/dist/{jwt-DBN2mu0r.mjs → jwt-Czv-v097.mjs} +1 -1
  49. package/dist/{magic-link-D9Em1aOR.mjs → magic-link-CJgE0Ngn.mjs} +1 -1
  50. package/dist/{multi-session-Dno_8DxC.mjs → multi-session-bveCXtQW.mjs} +1 -1
  51. package/dist/{oauth-proxy-DW-zt8wv.mjs → oauth-proxy-69n1xA8L.mjs} +1 -1
  52. package/dist/oauth2/index.d.mts +1 -1
  53. package/dist/oauth2/index.mjs +1 -1
  54. package/dist/{one-tap-CodeyQb8.mjs → one-tap-Cm1eHuqi.mjs} +1 -1
  55. package/dist/{organization-D4QMpChF.mjs → organization-BK3ks97y.mjs} +1 -1
  56. package/dist/plugins/admin/index.d.mts +2 -2
  57. package/dist/plugins/admin/index.mjs +2 -2
  58. package/dist/plugins/anonymous/index.d.mts +2 -2
  59. package/dist/plugins/anonymous/index.mjs +2 -2
  60. package/dist/plugins/audit-log/client.d.mts +23 -23
  61. package/dist/plugins/audit-log/index.d.mts +22 -22
  62. package/dist/plugins/audit-log/index.mjs +3 -3
  63. package/dist/plugins/bearer/index.d.mts +1 -1
  64. package/dist/plugins/captcha/index.d.mts +1 -1
  65. package/dist/plugins/custom-session/index.d.mts +2 -2
  66. package/dist/plugins/custom-session/index.mjs +1 -1
  67. package/dist/plugins/device-authorization/index.d.mts +1 -1
  68. package/dist/plugins/email-otp/index.d.mts +1 -1
  69. package/dist/plugins/email-otp/index.mjs +2 -2
  70. package/dist/plugins/generic-oauth/index.d.mts +2 -2
  71. package/dist/plugins/generic-oauth/index.mjs +2 -2
  72. package/dist/plugins/haveibeenpwned/index.d.mts +1 -1
  73. package/dist/plugins/haveibeenpwned/index.mjs +2 -2
  74. package/dist/plugins/index.d.mts +22 -22
  75. package/dist/plugins/index.mjs +17 -17
  76. package/dist/plugins/jwt/index.d.mts +2 -2
  77. package/dist/plugins/jwt/index.mjs +2 -2
  78. package/dist/plugins/magic-link/index.d.mts +1 -1
  79. package/dist/plugins/magic-link/index.mjs +2 -2
  80. package/dist/plugins/multi-session/index.d.mts +1 -1
  81. package/dist/plugins/multi-session/index.mjs +2 -2
  82. package/dist/plugins/oauth-proxy/index.d.mts +1 -1
  83. package/dist/plugins/oauth-proxy/index.mjs +2 -2
  84. package/dist/plugins/one-tap/index.d.mts +1 -1
  85. package/dist/plugins/one-tap/index.mjs +2 -2
  86. package/dist/plugins/one-time-token/index.d.mts +2 -2
  87. package/dist/plugins/one-time-token/index.mjs +17 -17
  88. package/dist/plugins/organization/index.d.mts +2 -2
  89. package/dist/plugins/organization/index.mjs +2 -2
  90. package/dist/plugins/passkey/index.d.mts +2 -2
  91. package/dist/plugins/passkey/index.mjs +1 -1
  92. package/dist/plugins/phone-number/index.d.mts +2 -2
  93. package/dist/plugins/phone-number/index.mjs +1 -1
  94. package/dist/plugins/sentinel/client.d.mts +23 -23
  95. package/dist/plugins/sentinel/index.d.mts +22 -22
  96. package/dist/plugins/sentinel/index.mjs +4 -4
  97. package/dist/plugins/two-factor/index.d.mts +2 -2
  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 +2 -2
  101. package/dist/{plugins-yF8CFUDR.mjs → plugins-RSPSU3ro.mjs} +1 -1
  102. package/dist/{registry-CqG_3Qnx.mjs → registry-GztLf62p.mjs} +14 -2
  103. package/dist/{sentinel-B4Wo79HK.mjs → sentinel-CYtaI3eO.mjs} +264 -9
  104. package/dist/src/plugins/audit-log/events.d.ts +1 -0
  105. package/dist/src/plugins/audit-log/index.d.ts +45 -0
  106. package/dist/src/plugins/sentinel/actions.d.ts +2 -0
  107. package/dist/src/plugins/sentinel/geo.d.ts +11 -0
  108. package/dist/src/plugins/sentinel/index.d.ts +248 -3
  109. package/dist/src/plugins/sentinel/schema.d.ts +37 -0
  110. package/dist/src/plugins/sentinel/store.d.ts +34 -0
  111. package/dist/src/plugins/sentinel/types.d.ts +7 -0
  112. package/dist/src/utils/has-role.d.ts +5 -0
  113. package/dist/test-utils/index.d.mts +1044 -1044
  114. package/dist/test-utils/index.mjs +18 -18
  115. package/dist/types/index.d.mts +1 -1
  116. package/dist/{username-BHNvcvsY.mjs → username-DCp6yugu.mjs} +1 -1
  117. package/package.json +3 -3
@@ -1,14 +1,14 @@
1
- import { g as User$1 } from "./index-BjCQ3jmE.mjs";
1
+ import { g as User$1 } from "./index-3lfPQHhX.mjs";
2
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_core63 from "@gatwech/core";
5
+ import * as _gatwech_core61 from "@gatwech/core";
6
6
  import { AuthContext, GenericEndpointContext, HookEndpointContext } from "@gatwech/core";
7
- import * as better_call643 from "better-call";
7
+ import * as better_call285 from "better-call";
8
8
  import { AuthEndpoint, AuthMiddleware, createAuthEndpoint as createAuthEndpoint$1, createAuthMiddleware as createAuthMiddleware$1, optionsMiddleware } from "@gatwech/core/api";
9
- import * as zod1419 from "zod";
9
+ import * as zod381 from "zod";
10
10
  import * as _gatwech_core_db14 from "@gatwech/core/db";
11
- import * as zod_v4_core207 from "zod/v4/core";
11
+ import * as zod_v4_core51 from "zod/v4/core";
12
12
 
13
13
  //#region src/plugins/api-key/schema.d.ts
14
14
  declare const apiKeySchema: ({
@@ -547,8 +547,8 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
547
547
  };
548
548
  hooks: {
549
549
  before: {
550
- matcher: (ctx: _gatwech_core63.HookEndpointContext) => boolean;
551
- handler: (inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<{
550
+ matcher: (ctx: _gatwech_core61.HookEndpointContext) => boolean;
551
+ handler: (inputContext: better_call285.MiddlewareInputContext<better_call285.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_call643.MiddlewareContext<better_call643.MiddlewareOptions, _gatwech_core63.AuthContext<_gatwech_core63.PayvoAuthOptions> & {
572
+ context: better_call285.MiddlewareContext<better_call285.MiddlewareOptions, _gatwech_core61.AuthContext<_gatwech_core61.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_call643.Middleware[];
624
+ use?: better_call285.Middleware[];
625
625
  path?: string;
626
626
  } & {
627
627
  asResponse?: AsResponse | undefined;
@@ -676,20 +676,20 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
676
676
  }>;
677
677
  options: {
678
678
  method: "POST";
679
- body: zod1419.ZodObject<{
680
- name: zod1419.ZodOptional<zod1419.ZodString>;
681
- expiresIn: zod1419.ZodDefault<zod1419.ZodNullable<zod1419.ZodOptional<zod1419.ZodNumber>>>;
682
- userId: zod1419.ZodOptional<zod1419.ZodCoercedString<unknown>>;
683
- prefix: zod1419.ZodOptional<zod1419.ZodString>;
684
- remaining: zod1419.ZodDefault<zod1419.ZodNullable<zod1419.ZodOptional<zod1419.ZodNumber>>>;
685
- metadata: zod1419.ZodOptional<zod1419.ZodAny>;
686
- refillAmount: zod1419.ZodOptional<zod1419.ZodNumber>;
687
- refillInterval: zod1419.ZodOptional<zod1419.ZodNumber>;
688
- rateLimitTimeWindow: zod1419.ZodOptional<zod1419.ZodNumber>;
689
- rateLimitMax: zod1419.ZodOptional<zod1419.ZodNumber>;
690
- rateLimitEnabled: zod1419.ZodOptional<zod1419.ZodBoolean>;
691
- permissions: zod1419.ZodOptional<zod1419.ZodRecord<zod1419.ZodString, zod1419.ZodArray<zod1419.ZodString>>>;
692
- }, zod_v4_core207.$strip>;
679
+ body: zod381.ZodObject<{
680
+ name: zod381.ZodOptional<zod381.ZodString>;
681
+ expiresIn: zod381.ZodDefault<zod381.ZodNullable<zod381.ZodOptional<zod381.ZodNumber>>>;
682
+ userId: zod381.ZodOptional<zod381.ZodCoercedString<unknown>>;
683
+ prefix: zod381.ZodOptional<zod381.ZodString>;
684
+ remaining: zod381.ZodDefault<zod381.ZodNullable<zod381.ZodOptional<zod381.ZodNumber>>>;
685
+ metadata: zod381.ZodOptional<zod381.ZodAny>;
686
+ refillAmount: zod381.ZodOptional<zod381.ZodNumber>;
687
+ refillInterval: zod381.ZodOptional<zod381.ZodNumber>;
688
+ rateLimitTimeWindow: zod381.ZodOptional<zod381.ZodNumber>;
689
+ rateLimitMax: zod381.ZodOptional<zod381.ZodNumber>;
690
+ rateLimitEnabled: zod381.ZodOptional<zod381.ZodBoolean>;
691
+ permissions: zod381.ZodOptional<zod381.ZodRecord<zod381.ZodString, zod381.ZodArray<zod381.ZodString>>>;
692
+ }, zod_v4_core51.$strip>;
693
693
  metadata: {
694
694
  openapi: {
695
695
  description: string;
@@ -855,7 +855,7 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
855
855
  } & {
856
856
  asResponse?: boolean;
857
857
  returnHeaders?: boolean;
858
- use?: better_call643.Middleware[];
858
+ use?: better_call285.Middleware[];
859
859
  path?: string;
860
860
  } & {
861
861
  asResponse?: AsResponse | undefined;
@@ -888,10 +888,10 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
888
888
  }>;
889
889
  options: {
890
890
  method: "POST";
891
- body: zod1419.ZodObject<{
892
- key: zod1419.ZodString;
893
- permissions: zod1419.ZodOptional<zod1419.ZodRecord<zod1419.ZodString, zod1419.ZodArray<zod1419.ZodString>>>;
894
- }, zod_v4_core207.$strip>;
891
+ body: zod381.ZodObject<{
892
+ key: zod381.ZodString;
893
+ permissions: zod381.ZodOptional<zod381.ZodRecord<zod381.ZodString, zod381.ZodArray<zod381.ZodString>>>;
894
+ }, zod_v4_core51.$strip>;
895
895
  metadata: {
896
896
  SERVER_ONLY: true;
897
897
  };
@@ -933,7 +933,7 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
933
933
  } & {
934
934
  asResponse?: boolean;
935
935
  returnHeaders?: boolean;
936
- use?: better_call643.Middleware[];
936
+ use?: better_call285.Middleware[];
937
937
  path?: string;
938
938
  } & {
939
939
  asResponse?: AsResponse | undefined;
@@ -990,10 +990,10 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
990
990
  }>;
991
991
  options: {
992
992
  method: "GET";
993
- query: zod1419.ZodObject<{
994
- id: zod1419.ZodString;
995
- }, zod_v4_core207.$strip>;
996
- use: ((inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<{
993
+ query: zod381.ZodObject<{
994
+ id: zod381.ZodString;
995
+ }, zod_v4_core51.$strip>;
996
+ use: ((inputContext: better_call285.MiddlewareInputContext<better_call285.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_call643.Middleware[];
1189
+ use?: better_call285.Middleware[];
1190
1190
  path?: string;
1191
1191
  } & {
1192
1192
  asResponse?: AsResponse | undefined;
@@ -1243,21 +1243,21 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
1243
1243
  }>;
1244
1244
  options: {
1245
1245
  method: "POST";
1246
- body: zod1419.ZodObject<{
1247
- keyId: zod1419.ZodString;
1248
- userId: zod1419.ZodOptional<zod1419.ZodCoercedString<unknown>>;
1249
- name: zod1419.ZodOptional<zod1419.ZodString>;
1250
- enabled: zod1419.ZodOptional<zod1419.ZodBoolean>;
1251
- remaining: zod1419.ZodOptional<zod1419.ZodNumber>;
1252
- refillAmount: zod1419.ZodOptional<zod1419.ZodNumber>;
1253
- refillInterval: zod1419.ZodOptional<zod1419.ZodNumber>;
1254
- metadata: zod1419.ZodOptional<zod1419.ZodAny>;
1255
- expiresIn: zod1419.ZodNullable<zod1419.ZodOptional<zod1419.ZodNumber>>;
1256
- rateLimitEnabled: zod1419.ZodOptional<zod1419.ZodBoolean>;
1257
- rateLimitTimeWindow: zod1419.ZodOptional<zod1419.ZodNumber>;
1258
- rateLimitMax: zod1419.ZodOptional<zod1419.ZodNumber>;
1259
- permissions: zod1419.ZodNullable<zod1419.ZodOptional<zod1419.ZodRecord<zod1419.ZodString, zod1419.ZodArray<zod1419.ZodString>>>>;
1260
- }, zod_v4_core207.$strip>;
1246
+ body: zod381.ZodObject<{
1247
+ keyId: zod381.ZodString;
1248
+ userId: zod381.ZodOptional<zod381.ZodCoercedString<unknown>>;
1249
+ name: zod381.ZodOptional<zod381.ZodString>;
1250
+ enabled: zod381.ZodOptional<zod381.ZodBoolean>;
1251
+ remaining: zod381.ZodOptional<zod381.ZodNumber>;
1252
+ refillAmount: zod381.ZodOptional<zod381.ZodNumber>;
1253
+ refillInterval: zod381.ZodOptional<zod381.ZodNumber>;
1254
+ metadata: zod381.ZodOptional<zod381.ZodAny>;
1255
+ expiresIn: zod381.ZodNullable<zod381.ZodOptional<zod381.ZodNumber>>;
1256
+ rateLimitEnabled: zod381.ZodOptional<zod381.ZodBoolean>;
1257
+ rateLimitTimeWindow: zod381.ZodOptional<zod381.ZodNumber>;
1258
+ rateLimitMax: zod381.ZodOptional<zod381.ZodNumber>;
1259
+ permissions: zod381.ZodNullable<zod381.ZodOptional<zod381.ZodRecord<zod381.ZodString, zod381.ZodArray<zod381.ZodString>>>>;
1260
+ }, zod_v4_core51.$strip>;
1261
1261
  metadata: {
1262
1262
  openapi: {
1263
1263
  description: string;
@@ -1416,7 +1416,7 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
1416
1416
  } & {
1417
1417
  asResponse?: boolean;
1418
1418
  returnHeaders?: boolean;
1419
- use?: better_call643.Middleware[];
1419
+ use?: better_call285.Middleware[];
1420
1420
  path?: string;
1421
1421
  } & {
1422
1422
  asResponse?: AsResponse | undefined;
@@ -1431,10 +1431,10 @@ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
1431
1431
  }>;
1432
1432
  options: {
1433
1433
  method: "POST";
1434
- body: zod1419.ZodObject<{
1435
- keyId: zod1419.ZodString;
1436
- }, zod_v4_core207.$strip>;
1437
- use: ((inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<{
1434
+ body: zod381.ZodObject<{
1435
+ keyId: zod381.ZodString;
1436
+ }, zod_v4_core51.$strip>;
1437
+ use: ((inputContext: better_call285.MiddlewareInputContext<better_call285.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_call643.Middleware[];
1536
+ use?: better_call285.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_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<{
1593
+ use: ((inputContext: better_call285.MiddlewareInputContext<better_call285.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_call643.Middleware[];
1772
+ use?: better_call285.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_core63.AuthContext<_gatwech_core63.PayvoAuthOptions>): {
1962
+ init(ctx: _gatwech_core61.AuthContext<_gatwech_core61.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_core63.PayvoAuthOptions> | undefined): Promise<{
1975
+ } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core61.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_core63.PayvoAuthOptions> | undefined): Promise<void>;
2000
+ } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core61.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_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<void>;
2009
+ handler: (inputContext: better_call285.MiddlewareInputContext<better_call285.MiddlewareOptions>) => Promise<void>;
2010
2010
  }[];
2011
2011
  };
2012
2012
  schema: O["storeInDatabase"] extends true ? {
@@ -2099,6 +2099,7 @@ declare const SECURITY_EVENT_TYPES: {
2099
2099
  readonly COMPROMISED_PASSWORD: "security_compromised_password";
2100
2100
  readonly STALE_ACCOUNT: "security_stale_account";
2101
2101
  readonly INVALID_EMAIL: "security_invalid_email";
2102
+ readonly UNBLOCKED: "security_unblocked";
2102
2103
  };
2103
2104
  type AuditEventType = (typeof AUDIT_EVENT_TYPES)[keyof typeof AUDIT_EVENT_TYPES] | (typeof SECURITY_EVENT_TYPES)[keyof typeof SECURITY_EVENT_TYPES];
2104
2105
  declare const ALL_EVENT_TYPES: AuditEventType[];
@@ -2323,6 +2324,43 @@ declare const schema$1: {
2323
2324
  };
2324
2325
  };
2325
2326
  };
2327
+ /** Active blocks, so an admin can list and lift them */
2328
+ sentinelBlock: {
2329
+ fields: {
2330
+ /** The counter the block is kept under, e.g. `cs:ip:203.0.113.1` */
2331
+ key: {
2332
+ type: "string";
2333
+ required: true;
2334
+ unique: true;
2335
+ };
2336
+ feature: {
2337
+ type: "string";
2338
+ required: true;
2339
+ };
2340
+ /** What was blocked: a visitor id or an IP address */
2341
+ kind: {
2342
+ type: "string";
2343
+ required: true;
2344
+ };
2345
+ identifier: {
2346
+ type: "string";
2347
+ required: true;
2348
+ };
2349
+ /** The account the attempts were on, when the block is for one */
2350
+ account: {
2351
+ type: "string";
2352
+ required: false;
2353
+ };
2354
+ blockedUntil: {
2355
+ type: "date";
2356
+ required: true;
2357
+ };
2358
+ createdAt: {
2359
+ type: "date";
2360
+ required: true;
2361
+ };
2362
+ };
2363
+ };
2326
2364
  sentinelSignIn: {
2327
2365
  fields: {
2328
2366
  userId: {
@@ -2515,6 +2553,13 @@ interface SentinelOptions {
2515
2553
  */
2516
2554
  resolveGeo?: ((ip: string) => GeoLocation | null | Promise<GeoLocation | null>) | undefined;
2517
2555
  } | undefined;
2556
+ /**
2557
+ * Roles allowed to list and lift blocks through `/sentinel/blocks` and
2558
+ * `/sentinel/unblock`
2559
+ *
2560
+ * @default ["admin"]
2561
+ */
2562
+ adminRoles?: string[] | undefined;
2518
2563
  /**
2519
2564
  * Send a security notification, e.g. by email. Required for
2520
2565
  * `unknownDeviceNotification` and the stale account notifications.
@@ -2850,6 +2895,8 @@ interface SentinelOptions {
2850
2895
  declare const SENTINEL_ERROR_CODES: {
2851
2896
  readonly POW_CHALLENGE_REQUIRED: "Challenge required";
2852
2897
  readonly SECURITY_BLOCKED: "Request blocked for security reasons";
2898
+ readonly SECURITY_ADMIN_REQUIRED: "Only an administrator can manage security blocks";
2899
+ readonly BLOCK_NOT_FOUND: "That block doesn't exist or has ended";
2853
2900
  };
2854
2901
  //#endregion
2855
2902
  //#region src/plugins/sentinel/email.d.ts
@@ -2896,7 +2943,7 @@ declare function parsePowHeader(value: string | null | undefined): {
2896
2943
  //#region src/plugins/sentinel/index.d.ts
2897
2944
  declare const sentinel: (options?: SentinelOptions | undefined) => {
2898
2945
  id: "sentinel";
2899
- init(ctx: AuthContext<_gatwech_core63.PayvoAuthOptions>): {
2946
+ init(ctx: AuthContext<_gatwech_core61.PayvoAuthOptions>): {
2900
2947
  options: {
2901
2948
  databaseHooks: {
2902
2949
  user: {
@@ -2909,7 +2956,7 @@ declare const sentinel: (options?: SentinelOptions | undefined) => {
2909
2956
  emailVerified: boolean;
2910
2957
  name: string;
2911
2958
  image?: string | null | undefined;
2912
- } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core63.PayvoAuthOptions> | undefined): Promise<{
2959
+ } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core61.PayvoAuthOptions> | undefined): Promise<{
2913
2960
  data: {
2914
2961
  normalizedEmail: string;
2915
2962
  id: string;
@@ -2929,7 +2976,7 @@ declare const sentinel: (options?: SentinelOptions | undefined) => {
2929
2976
  emailVerified: boolean;
2930
2977
  name: string;
2931
2978
  image?: string | null | undefined;
2932
- } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core63.PayvoAuthOptions> | undefined): Promise<void>;
2979
+ } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core61.PayvoAuthOptions> | undefined): Promise<void>;
2933
2980
  };
2934
2981
  update: {
2935
2982
  before(data: Partial<{
@@ -2957,28 +3004,28 @@ declare const sentinel: (options?: SentinelOptions | undefined) => {
2957
3004
  };
2958
3005
  };
2959
3006
  } | undefined;
2960
- onRequest(request: Request, ctx: AuthContext<_gatwech_core63.PayvoAuthOptions>): Promise<{
3007
+ onRequest(request: Request, ctx: AuthContext<_gatwech_core61.PayvoAuthOptions>): Promise<{
2961
3008
  response: Response;
2962
3009
  } | undefined>;
2963
3010
  hooks: {
2964
3011
  before: ({
2965
- matcher(context: _gatwech_core63.HookEndpointContext): boolean;
2966
- handler: (inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<{
3012
+ matcher(context: _gatwech_core61.HookEndpointContext): boolean;
3013
+ handler: (inputContext: better_call285.MiddlewareInputContext<better_call285.MiddlewareOptions>) => Promise<{
2967
3014
  context: {
2968
3015
  body: any;
2969
3016
  };
2970
3017
  } | undefined>;
2971
3018
  } | {
2972
- matcher(context: _gatwech_core63.HookEndpointContext): boolean;
2973
- handler: (inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<void>;
3019
+ matcher(context: _gatwech_core61.HookEndpointContext): boolean;
3020
+ handler: (inputContext: better_call285.MiddlewareInputContext<better_call285.MiddlewareOptions>) => Promise<void>;
2974
3021
  })[];
2975
3022
  after: ({
2976
- matcher(context: _gatwech_core63.HookEndpointContext): boolean;
2977
- handler: (inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<void>;
3023
+ matcher(context: _gatwech_core61.HookEndpointContext): boolean;
3024
+ handler: (inputContext: better_call285.MiddlewareInputContext<better_call285.MiddlewareOptions>) => Promise<void>;
2978
3025
  } | {
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;
3026
+ matcher(context: _gatwech_core61.HookEndpointContext): boolean;
3027
+ handler: (inputContext: better_call285.MiddlewareInputContext<better_call285.MiddlewareOptions>) => Promise<({
3028
+ 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_call285.Status;
2982
3029
  body: ({
2983
3030
  message?: string;
2984
3031
  code?: string;
@@ -3013,6 +3060,39 @@ declare const sentinel: (options?: SentinelOptions | undefined) => {
3013
3060
  };
3014
3061
  };
3015
3062
  };
3063
+ sentinelBlock: {
3064
+ fields: {
3065
+ key: {
3066
+ type: "string";
3067
+ required: true;
3068
+ unique: true;
3069
+ };
3070
+ feature: {
3071
+ type: "string";
3072
+ required: true;
3073
+ };
3074
+ kind: {
3075
+ type: "string";
3076
+ required: true;
3077
+ };
3078
+ identifier: {
3079
+ type: "string";
3080
+ required: true;
3081
+ };
3082
+ account: {
3083
+ type: "string";
3084
+ required: false;
3085
+ };
3086
+ blockedUntil: {
3087
+ type: "date";
3088
+ required: true;
3089
+ };
3090
+ createdAt: {
3091
+ type: "date";
3092
+ required: true;
3093
+ };
3094
+ };
3095
+ };
3016
3096
  sentinelSignIn: {
3017
3097
  fields: {
3018
3098
  userId: {
@@ -3096,9 +3176,221 @@ declare const sentinel: (options?: SentinelOptions | undefined) => {
3096
3176
  };
3097
3177
  };
3098
3178
  };
3179
+ endpoints: {
3180
+ listBlocks: {
3181
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0?: ({
3182
+ body?: undefined;
3183
+ } & {
3184
+ method?: "GET" | undefined;
3185
+ } & {
3186
+ query?: {
3187
+ limit?: string | number | undefined;
3188
+ offset?: string | number | undefined;
3189
+ } | undefined;
3190
+ } & {
3191
+ params?: Record<string, any>;
3192
+ } & {
3193
+ request?: Request;
3194
+ } & {
3195
+ headers?: HeadersInit;
3196
+ } & {
3197
+ asResponse?: boolean;
3198
+ returnHeaders?: boolean;
3199
+ use?: better_call285.Middleware[];
3200
+ path?: string;
3201
+ } & {
3202
+ asResponse?: AsResponse | undefined;
3203
+ returnHeaders?: ReturnHeaders | undefined;
3204
+ }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
3205
+ headers: Headers;
3206
+ response: {
3207
+ blocks: {
3208
+ id: string;
3209
+ key: string;
3210
+ feature: string;
3211
+ kind: string;
3212
+ identifier: string;
3213
+ account: string | null;
3214
+ blockedUntil: Date;
3215
+ createdAt: Date;
3216
+ }[];
3217
+ total: number;
3218
+ limit: number;
3219
+ offset: number;
3220
+ };
3221
+ } : {
3222
+ blocks: {
3223
+ id: string;
3224
+ key: string;
3225
+ feature: string;
3226
+ kind: string;
3227
+ identifier: string;
3228
+ account: string | null;
3229
+ blockedUntil: Date;
3230
+ createdAt: Date;
3231
+ }[];
3232
+ total: number;
3233
+ limit: number;
3234
+ offset: number;
3235
+ }>;
3236
+ options: {
3237
+ method: "GET";
3238
+ use: ((inputContext: better_call285.MiddlewareInputContext<better_call285.MiddlewareOptions>) => Promise<{
3239
+ session: {
3240
+ session: Record<string, any> & {
3241
+ id: string;
3242
+ createdAt: Date;
3243
+ updatedAt: Date;
3244
+ userId: string;
3245
+ expiresAt: Date;
3246
+ token: string;
3247
+ ipAddress?: string | null | undefined;
3248
+ userAgent?: string | null | undefined;
3249
+ };
3250
+ user: Record<string, any> & {
3251
+ id: string;
3252
+ createdAt: Date;
3253
+ updatedAt: Date;
3254
+ email: string;
3255
+ emailVerified: boolean;
3256
+ name: string;
3257
+ image?: string | null | undefined;
3258
+ };
3259
+ };
3260
+ }>)[];
3261
+ query: zod381.ZodOptional<zod381.ZodObject<{
3262
+ limit: zod381.ZodOptional<zod381.ZodUnion<[zod381.ZodString, zod381.ZodNumber]>>;
3263
+ offset: zod381.ZodOptional<zod381.ZodUnion<[zod381.ZodString, zod381.ZodNumber]>>;
3264
+ }, zod381.core.$strip>>;
3265
+ metadata: {
3266
+ openapi: {
3267
+ operationId: string;
3268
+ summary: string;
3269
+ description: string;
3270
+ };
3271
+ };
3272
+ } & {
3273
+ use: any[];
3274
+ };
3275
+ path: "/sentinel/blocks";
3276
+ };
3277
+ unblock: {
3278
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
3279
+ body: {
3280
+ id: string;
3281
+ };
3282
+ } & {
3283
+ method?: "POST" | undefined;
3284
+ } & {
3285
+ query?: Record<string, any> | undefined;
3286
+ } & {
3287
+ params?: Record<string, any>;
3288
+ } & {
3289
+ request?: Request;
3290
+ } & {
3291
+ headers?: HeadersInit;
3292
+ } & {
3293
+ asResponse?: boolean;
3294
+ returnHeaders?: boolean;
3295
+ use?: better_call285.Middleware[];
3296
+ path?: string;
3297
+ } & {
3298
+ asResponse?: AsResponse | undefined;
3299
+ returnHeaders?: ReturnHeaders | undefined;
3300
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
3301
+ headers: Headers;
3302
+ response: {
3303
+ success: boolean;
3304
+ };
3305
+ } : {
3306
+ success: boolean;
3307
+ }>;
3308
+ options: {
3309
+ method: "POST";
3310
+ use: ((inputContext: better_call285.MiddlewareInputContext<better_call285.MiddlewareOptions>) => Promise<{
3311
+ session: {
3312
+ session: Record<string, any> & {
3313
+ id: string;
3314
+ createdAt: Date;
3315
+ updatedAt: Date;
3316
+ userId: string;
3317
+ expiresAt: Date;
3318
+ token: string;
3319
+ ipAddress?: string | null | undefined;
3320
+ userAgent?: string | null | undefined;
3321
+ };
3322
+ user: Record<string, any> & {
3323
+ id: string;
3324
+ createdAt: Date;
3325
+ updatedAt: Date;
3326
+ email: string;
3327
+ emailVerified: boolean;
3328
+ name: string;
3329
+ image?: string | null | undefined;
3330
+ };
3331
+ };
3332
+ }>)[];
3333
+ body: zod381.ZodObject<{
3334
+ id: zod381.ZodString;
3335
+ }, zod381.core.$strip>;
3336
+ metadata: {
3337
+ openapi: {
3338
+ operationId: string;
3339
+ summary: string;
3340
+ description: string;
3341
+ };
3342
+ };
3343
+ } & {
3344
+ use: any[];
3345
+ };
3346
+ path: "/sentinel/unblock";
3347
+ };
3348
+ deleteExpired: {
3349
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0?: ({
3350
+ body?: undefined;
3351
+ } & {
3352
+ method?: "POST" | undefined;
3353
+ } & {
3354
+ query?: Record<string, any> | undefined;
3355
+ } & {
3356
+ params?: Record<string, any>;
3357
+ } & {
3358
+ request?: Request;
3359
+ } & {
3360
+ headers?: HeadersInit;
3361
+ } & {
3362
+ asResponse?: boolean;
3363
+ returnHeaders?: boolean;
3364
+ use?: better_call285.Middleware[];
3365
+ path?: string;
3366
+ } & {
3367
+ asResponse?: AsResponse | undefined;
3368
+ returnHeaders?: ReturnHeaders | undefined;
3369
+ }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
3370
+ headers: Headers;
3371
+ response: {
3372
+ success: boolean;
3373
+ };
3374
+ } : {
3375
+ success: boolean;
3376
+ }>;
3377
+ options: {
3378
+ method: "POST";
3379
+ metadata: {
3380
+ SERVER_ONLY: true;
3381
+ client: boolean;
3382
+ };
3383
+ } & {
3384
+ use: any[];
3385
+ };
3386
+ path: "/sentinel/delete-expired";
3387
+ };
3388
+ };
3099
3389
  $ERROR_CODES: {
3100
3390
  readonly POW_CHALLENGE_REQUIRED: "Challenge required";
3101
3391
  readonly SECURITY_BLOCKED: "Request blocked for security reasons";
3392
+ readonly SECURITY_ADMIN_REQUIRED: "Only an administrator can manage security blocks";
3393
+ readonly BLOCK_NOT_FOUND: "That block doesn't exist or has ended";
3102
3394
  };
3103
3395
  options: {
3104
3396
  failOpen: boolean;
@@ -3124,6 +3416,7 @@ declare const sentinel: (options?: SentinelOptions | undefined) => {
3124
3416
  isBot?: ((request: Request) => boolean | Promise<boolean>) | undefined;
3125
3417
  resolveGeo?: ((ip: string) => GeoLocation | null | Promise<GeoLocation | null>) | undefined;
3126
3418
  } | undefined;
3419
+ adminRoles?: string[] | undefined;
3127
3420
  sendNotification?: ((notification: {
3128
3421
  type: "unknown-device" | "stale-account";
3129
3422
  recipient: "user" | "admin";
@@ -3141,8 +3434,7 @@ declare const sentinel: (options?: SentinelOptions | undefined) => {
3141
3434
  credentialStuffing?: {
3142
3435
  enabled: boolean;
3143
3436
  action?: SecurityAction | undefined;
3144
- thresholds
3145
- /** Checked with the identification service, rather than taken as sent */? /** Checked with the identification service, rather than taken as sent */: {
3437
+ thresholds?: {
3146
3438
  challenge: number;
3147
3439
  block: number;
3148
3440
  } | undefined;
@@ -3226,7 +3518,7 @@ declare const AUDIT_LOG_ERROR_CODES: {
3226
3518
  };
3227
3519
  declare const auditLog: (options?: AuditLogOptions | undefined) => {
3228
3520
  id: "audit-log";
3229
- init(ctx: AuthContext<_gatwech_core63.PayvoAuthOptions>): {
3521
+ init(ctx: AuthContext<_gatwech_core61.PayvoAuthOptions>): {
3230
3522
  options: {
3231
3523
  databaseHooks: {
3232
3524
  user: {
@@ -3239,7 +3531,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3239
3531
  emailVerified: boolean;
3240
3532
  name: string;
3241
3533
  image?: string | null | undefined;
3242
- } & Record<string, unknown>, context: _gatwech_core63.GenericEndpointContext<_gatwech_core63.PayvoAuthOptions> | undefined): Promise<void>;
3534
+ } & Record<string, unknown>, context: _gatwech_core61.GenericEndpointContext<_gatwech_core61.PayvoAuthOptions> | undefined): Promise<void>;
3243
3535
  };
3244
3536
  update: {
3245
3537
  after(user: {
@@ -3250,7 +3542,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3250
3542
  emailVerified: boolean;
3251
3543
  name: string;
3252
3544
  image?: string | null | undefined;
3253
- } & Record<string, unknown>, context: _gatwech_core63.GenericEndpointContext<_gatwech_core63.PayvoAuthOptions> | undefined, data: (Partial<{
3545
+ } & Record<string, unknown>, context: _gatwech_core61.GenericEndpointContext<_gatwech_core61.PayvoAuthOptions> | undefined, data: (Partial<{
3254
3546
  id: string;
3255
3547
  createdAt: Date;
3256
3548
  updatedAt: Date;
@@ -3269,7 +3561,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3269
3561
  emailVerified: boolean;
3270
3562
  name: string;
3271
3563
  image?: string | null | undefined;
3272
- } & Record<string, unknown>, context: _gatwech_core63.GenericEndpointContext<_gatwech_core63.PayvoAuthOptions> | undefined): Promise<void>;
3564
+ } & Record<string, unknown>, context: _gatwech_core61.GenericEndpointContext<_gatwech_core61.PayvoAuthOptions> | undefined): Promise<void>;
3273
3565
  };
3274
3566
  };
3275
3567
  session: {
@@ -3283,7 +3575,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3283
3575
  token: string;
3284
3576
  ipAddress?: string | null | undefined;
3285
3577
  userAgent?: string | null | undefined;
3286
- } & Record<string, unknown>, context: _gatwech_core63.GenericEndpointContext<_gatwech_core63.PayvoAuthOptions> | undefined): Promise<void>;
3578
+ } & Record<string, unknown>, context: _gatwech_core61.GenericEndpointContext<_gatwech_core61.PayvoAuthOptions> | undefined): Promise<void>;
3287
3579
  };
3288
3580
  };
3289
3581
  account: {
@@ -3302,7 +3594,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3302
3594
  refreshTokenExpiresAt?: Date | null | undefined;
3303
3595
  scope?: string | null | undefined;
3304
3596
  password?: string | null | undefined;
3305
- }, context: _gatwech_core63.GenericEndpointContext<_gatwech_core63.PayvoAuthOptions> | undefined): Promise<void>;
3597
+ }, context: _gatwech_core61.GenericEndpointContext<_gatwech_core61.PayvoAuthOptions> | undefined): Promise<void>;
3306
3598
  };
3307
3599
  };
3308
3600
  };
@@ -3310,12 +3602,12 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3310
3602
  };
3311
3603
  hooks: {
3312
3604
  before: {
3313
- matcher(context: _gatwech_core63.HookEndpointContext): boolean;
3314
- handler: (inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<void>;
3605
+ matcher(context: _gatwech_core61.HookEndpointContext): boolean;
3606
+ handler: (inputContext: better_call285.MiddlewareInputContext<better_call285.MiddlewareOptions>) => Promise<void>;
3315
3607
  }[];
3316
3608
  after: {
3317
- matcher(context: _gatwech_core63.HookEndpointContext): boolean;
3318
- handler: (inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<void>;
3609
+ matcher(context: _gatwech_core61.HookEndpointContext): boolean;
3610
+ handler: (inputContext: better_call285.MiddlewareInputContext<better_call285.MiddlewareOptions>) => Promise<void>;
3319
3611
  }[];
3320
3612
  };
3321
3613
  endpoints: {
@@ -3344,7 +3636,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3344
3636
  } & {
3345
3637
  asResponse?: boolean;
3346
3638
  returnHeaders?: boolean;
3347
- use?: better_call643.Middleware[];
3639
+ use?: better_call285.Middleware[];
3348
3640
  path?: string;
3349
3641
  } & {
3350
3642
  asResponse?: AsResponse | undefined;
@@ -3365,7 +3657,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3365
3657
  }>;
3366
3658
  options: {
3367
3659
  method: "GET";
3368
- use: ((inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<{
3660
+ use: ((inputContext: better_call285.MiddlewareInputContext<better_call285.MiddlewareOptions>) => Promise<{
3369
3661
  session: {
3370
3662
  session: Record<string, any> & {
3371
3663
  id: string;
@@ -3388,16 +3680,16 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3388
3680
  };
3389
3681
  };
3390
3682
  }>)[];
3391
- query: zod1419.ZodOptional<zod1419.ZodObject<{
3392
- limit: zod1419.ZodOptional<zod1419.ZodUnion<[zod1419.ZodString, zod1419.ZodNumber]>>;
3393
- offset: zod1419.ZodOptional<zod1419.ZodUnion<[zod1419.ZodString, zod1419.ZodNumber]>>;
3394
- eventType: zod1419.ZodOptional<zod1419.ZodString>;
3395
- identifier: zod1419.ZodOptional<zod1419.ZodString>;
3396
- organizationId: zod1419.ZodOptional<zod1419.ZodString>;
3397
- userId: zod1419.ZodOptional<zod1419.ZodString>;
3398
- startDate: zod1419.ZodOptional<zod1419.ZodString>;
3399
- endDate: zod1419.ZodOptional<zod1419.ZodString>;
3400
- }, zod1419.core.$strip>>;
3683
+ query: zod381.ZodOptional<zod381.ZodObject<{
3684
+ limit: zod381.ZodOptional<zod381.ZodUnion<[zod381.ZodString, zod381.ZodNumber]>>;
3685
+ offset: zod381.ZodOptional<zod381.ZodUnion<[zod381.ZodString, zod381.ZodNumber]>>;
3686
+ eventType: zod381.ZodOptional<zod381.ZodString>;
3687
+ identifier: zod381.ZodOptional<zod381.ZodString>;
3688
+ organizationId: zod381.ZodOptional<zod381.ZodString>;
3689
+ userId: zod381.ZodOptional<zod381.ZodString>;
3690
+ startDate: zod381.ZodOptional<zod381.ZodString>;
3691
+ endDate: zod381.ZodOptional<zod381.ZodString>;
3692
+ }, zod381.core.$strip>>;
3401
3693
  metadata: {
3402
3694
  openapi: {
3403
3695
  operationId: string;
@@ -3512,7 +3804,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3512
3804
  } & {
3513
3805
  asResponse?: boolean;
3514
3806
  returnHeaders?: boolean;
3515
- use?: better_call643.Middleware[];
3807
+ use?: better_call285.Middleware[];
3516
3808
  path?: string;
3517
3809
  } & {
3518
3810
  asResponse?: AsResponse | undefined;
@@ -3533,7 +3825,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3533
3825
  }>;
3534
3826
  options: {
3535
3827
  method: "GET";
3536
- use: ((inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<{
3828
+ use: ((inputContext: better_call285.MiddlewareInputContext<better_call285.MiddlewareOptions>) => Promise<{
3537
3829
  session: {
3538
3830
  session: Record<string, any> & {
3539
3831
  id: string;
@@ -3556,16 +3848,16 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3556
3848
  };
3557
3849
  };
3558
3850
  }>)[];
3559
- query: zod1419.ZodOptional<zod1419.ZodObject<{
3560
- limit: zod1419.ZodOptional<zod1419.ZodUnion<[zod1419.ZodString, zod1419.ZodNumber]>>;
3561
- offset: zod1419.ZodOptional<zod1419.ZodUnion<[zod1419.ZodString, zod1419.ZodNumber]>>;
3562
- eventType: zod1419.ZodOptional<zod1419.ZodString>;
3563
- identifier: zod1419.ZodOptional<zod1419.ZodString>;
3564
- organizationId: zod1419.ZodOptional<zod1419.ZodString>;
3565
- userId: zod1419.ZodOptional<zod1419.ZodString>;
3566
- startDate: zod1419.ZodOptional<zod1419.ZodString>;
3567
- endDate: zod1419.ZodOptional<zod1419.ZodString>;
3568
- }, zod1419.core.$strip>>;
3851
+ query: zod381.ZodOptional<zod381.ZodObject<{
3852
+ limit: zod381.ZodOptional<zod381.ZodUnion<[zod381.ZodString, zod381.ZodNumber]>>;
3853
+ offset: zod381.ZodOptional<zod381.ZodUnion<[zod381.ZodString, zod381.ZodNumber]>>;
3854
+ eventType: zod381.ZodOptional<zod381.ZodString>;
3855
+ identifier: zod381.ZodOptional<zod381.ZodString>;
3856
+ organizationId: zod381.ZodOptional<zod381.ZodString>;
3857
+ userId: zod381.ZodOptional<zod381.ZodString>;
3858
+ startDate: zod381.ZodOptional<zod381.ZodString>;
3859
+ endDate: zod381.ZodOptional<zod381.ZodString>;
3860
+ }, zod381.core.$strip>>;
3569
3861
  metadata: {
3570
3862
  openapi: {
3571
3863
  operationId: string;
@@ -3671,7 +3963,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3671
3963
  } & {
3672
3964
  asResponse?: boolean;
3673
3965
  returnHeaders?: boolean;
3674
- use?: better_call643.Middleware[];
3966
+ use?: better_call285.Middleware[];
3675
3967
  path?: string;
3676
3968
  } & {
3677
3969
  asResponse?: AsResponse | undefined;
@@ -3686,7 +3978,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3686
3978
  }>;
3687
3979
  options: {
3688
3980
  method: "GET";
3689
- use: ((inputContext: better_call643.MiddlewareInputContext<better_call643.MiddlewareOptions>) => Promise<{
3981
+ use: ((inputContext: better_call285.MiddlewareInputContext<better_call285.MiddlewareOptions>) => Promise<{
3690
3982
  session: {
3691
3983
  session: Record<string, any> & {
3692
3984
  id: string;
@@ -3742,6 +4034,51 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3742
4034
  };
3743
4035
  path: "/audit-log/get-event-types";
3744
4036
  };
4037
+ deleteOldEvents: {
4038
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
4039
+ body: {
4040
+ olderThanDays: number;
4041
+ };
4042
+ } & {
4043
+ method?: "POST" | undefined;
4044
+ } & {
4045
+ query?: Record<string, any> | undefined;
4046
+ } & {
4047
+ params?: Record<string, any>;
4048
+ } & {
4049
+ request?: Request;
4050
+ } & {
4051
+ headers?: HeadersInit;
4052
+ } & {
4053
+ asResponse?: boolean;
4054
+ returnHeaders?: boolean;
4055
+ use?: better_call285.Middleware[];
4056
+ path?: string;
4057
+ } & {
4058
+ asResponse?: AsResponse | undefined;
4059
+ returnHeaders?: ReturnHeaders | undefined;
4060
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
4061
+ headers: Headers;
4062
+ response: {
4063
+ deleted: number;
4064
+ };
4065
+ } : {
4066
+ deleted: number;
4067
+ }>;
4068
+ options: {
4069
+ method: "POST";
4070
+ body: zod381.ZodObject<{
4071
+ olderThanDays: zod381.ZodNumber;
4072
+ }, zod381.core.$strip>;
4073
+ metadata: {
4074
+ SERVER_ONLY: true;
4075
+ client: boolean;
4076
+ };
4077
+ } & {
4078
+ use: any[];
4079
+ };
4080
+ path: "/audit-log/delete-old-events";
4081
+ };
3745
4082
  };
3746
4083
  schema: {
3747
4084
  auditLog: {