@gatwech/auth 1.0.0-beta.22 → 1.0.0-beta.24

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 (81) hide show
  1. package/dist/adapters/index.d.mts +1 -1
  2. package/dist/api/index.d.mts +1 -1
  3. package/dist/{audit-log-DgqHJ-uv.mjs → audit-log-DhRRCMrv.mjs} +21 -6
  4. package/dist/client/index.d.mts +1 -1
  5. package/dist/client/plugins/index.d.mts +27 -27
  6. package/dist/client/react/index.d.mts +1 -1
  7. package/dist/{client-ukvqpcbI.d.mts → client-CGV_kj99.d.mts} +1 -1
  8. package/dist/{client-DO9MgP_0.d.mts → client-CT-acJeN.d.mts} +1 -1
  9. package/dist/cookies/index.d.mts +2 -2
  10. package/dist/db/index.d.mts +1 -1
  11. package/dist/{index-BfLofiXO.d.mts → index-B-i2ob-C.d.mts} +9 -9
  12. package/dist/{index-CTSeVJJB.d.mts → index-B6to9CaK.d.mts} +1 -1
  13. package/dist/{index-hP8gvyp-.d.mts → index-BRUQHEUF.d.mts} +5 -5
  14. package/dist/{index-D3uQsW8T.d.mts → index-BYxt8qOP.d.mts} +33 -33
  15. package/dist/{index-CRNh-5Tc.d.mts → index-CGGitykk.d.mts} +7 -7
  16. package/dist/{index-eOfQxlQV.d.mts → index-CHMYUshk.d.mts} +13 -13
  17. package/dist/{index-Dl0bD1_6.d.mts → index-CLhlur69.d.mts} +6 -6
  18. package/dist/{index-DngQlUSI.d.mts → index-CZtQ0rUe.d.mts} +113 -113
  19. package/dist/{index-Dkm27DLN.d.mts → index-Cl9ITXy1.d.mts} +10 -10
  20. package/dist/{index-SYRh5FW7.d.mts → index-Clwezlxm.d.mts} +8 -8
  21. package/dist/{index-BzzhaGLe.d.mts → index-Czr_eQFE.d.mts} +6 -6
  22. package/dist/{index-DKirx_GW.d.mts → index-D5cyFBEb.d.mts} +4 -4
  23. package/dist/{index-BC0aAKsT.d.mts → index-D85KXOKz.d.mts} +3 -3
  24. package/dist/{index-CxhQu1HM.d.mts → index-DGRGLg16.d.mts} +2 -2
  25. package/dist/{index-B4hJVVRn.d.mts → index-DWGj7du8.d.mts} +19 -19
  26. package/dist/{index-AiKdOFSd.d.mts → index-DWSbFJWU.d.mts} +387 -49
  27. package/dist/{index-Do8AV4PF.d.mts → index-DYqQWdEv.d.mts} +13 -13
  28. package/dist/{index-DlS-HqZR.d.mts → index-Dmjw6re9.d.mts} +2 -2
  29. package/dist/{index-CRiKKdkb.d.mts → index-Dt6JhAV4.d.mts} +6 -6
  30. package/dist/{index-pdl9MzQu.d.mts → index-Hoybqpnt.d.mts} +9 -9
  31. package/dist/{index-DSoiUc1C.d.mts → index-JzSy-vFn.d.mts} +166 -166
  32. package/dist/{index-D-rjuF7p.d.mts → index-UDzaYKxq.d.mts} +9 -9
  33. package/dist/{index-CBGNX7W1.d.mts → index-rcUKPBBy.d.mts} +6 -6
  34. package/dist/index.d.mts +1 -1
  35. package/dist/integrations/next-js.d.mts +4 -4
  36. package/dist/integrations/node.d.mts +1 -1
  37. package/dist/integrations/react-start.d.mts +4 -4
  38. package/dist/oauth2/index.d.mts +1 -1
  39. package/dist/plugins/admin/index.d.mts +2 -2
  40. package/dist/plugins/anonymous/index.d.mts +2 -2
  41. package/dist/plugins/audit-log/client.d.mts +23 -23
  42. package/dist/plugins/audit-log/index.d.mts +22 -22
  43. package/dist/plugins/audit-log/index.mjs +2 -2
  44. package/dist/plugins/bearer/index.d.mts +1 -1
  45. package/dist/plugins/captcha/index.d.mts +1 -1
  46. package/dist/plugins/custom-session/index.d.mts +2 -2
  47. package/dist/plugins/device-authorization/index.d.mts +1 -1
  48. package/dist/plugins/email-otp/index.d.mts +1 -1
  49. package/dist/plugins/generic-oauth/index.d.mts +2 -2
  50. package/dist/plugins/haveibeenpwned/index.d.mts +1 -1
  51. package/dist/plugins/index.d.mts +22 -22
  52. package/dist/plugins/index.mjs +3 -3
  53. package/dist/plugins/jwt/index.d.mts +2 -2
  54. package/dist/plugins/magic-link/index.d.mts +1 -1
  55. package/dist/plugins/multi-session/index.d.mts +1 -1
  56. package/dist/plugins/oauth-proxy/index.d.mts +1 -1
  57. package/dist/plugins/one-tap/index.d.mts +1 -1
  58. package/dist/plugins/one-time-token/index.d.mts +2 -2
  59. package/dist/plugins/one-time-token/index.mjs +3 -3
  60. package/dist/plugins/organization/index.d.mts +2 -2
  61. package/dist/plugins/passkey/index.d.mts +2 -2
  62. package/dist/plugins/phone-number/index.d.mts +2 -2
  63. package/dist/plugins/sentinel/client.d.mts +23 -23
  64. package/dist/plugins/sentinel/index.d.mts +22 -22
  65. package/dist/plugins/sentinel/index.mjs +2 -2
  66. package/dist/plugins/two-factor/index.d.mts +2 -2
  67. package/dist/plugins/username/index.d.mts +1 -1
  68. package/dist/{registry-CqG_3Qnx.mjs → registry-GztLf62p.mjs} +14 -2
  69. package/dist/{sentinel-B-2jmmZh.mjs → sentinel-b8XEetew.mjs} +265 -9
  70. package/dist/src/plugins/audit-log/events.d.ts +1 -0
  71. package/dist/src/plugins/audit-log/index.d.ts +45 -0
  72. package/dist/src/plugins/sentinel/actions.d.ts +2 -0
  73. package/dist/src/plugins/sentinel/index.d.ts +247 -0
  74. package/dist/src/plugins/sentinel/schema.d.ts +37 -0
  75. package/dist/src/plugins/sentinel/store.d.ts +34 -0
  76. package/dist/src/plugins/sentinel/types.d.ts +7 -0
  77. package/dist/src/utils/has-role.d.ts +5 -0
  78. package/dist/test-utils/index.d.mts +273 -273
  79. package/dist/test-utils/index.mjs +3 -3
  80. package/dist/types/index.d.mts +1 -1
  81. package/package.json +3 -3
@@ -1,10 +1,10 @@
1
- import { g as User$1 } from "./index-DngQlUSI.mjs";
1
+ import { g as User$1 } from "./index-CZtQ0rUe.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_core57 from "@gatwech/core";
5
+ import * as _gatwech_core55 from "@gatwech/core";
6
6
  import { AuthContext, GenericEndpointContext, HookEndpointContext } from "@gatwech/core";
7
- import * as better_call271 from "better-call";
7
+ import * as better_call239 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 zod381 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_core57.HookEndpointContext) => boolean;
551
- handler: (inputContext: better_call271.MiddlewareInputContext<better_call271.MiddlewareOptions>) => Promise<{
550
+ matcher: (ctx: _gatwech_core55.HookEndpointContext) => boolean;
551
+ handler: (inputContext: better_call239.MiddlewareInputContext<better_call239.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_call271.MiddlewareContext<better_call271.MiddlewareOptions, _gatwech_core57.AuthContext<_gatwech_core57.PayvoAuthOptions> & {
572
+ context: better_call239.MiddlewareContext<better_call239.MiddlewareOptions, _gatwech_core55.AuthContext<_gatwech_core55.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_call271.Middleware[];
624
+ use?: better_call239.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_call271.Middleware[];
858
+ use?: better_call239.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_call271.Middleware[];
936
+ use?: better_call239.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: zod381.ZodObject<{
994
994
  id: zod381.ZodString;
995
995
  }, zod_v4_core51.$strip>;
996
- use: ((inputContext: better_call271.MiddlewareInputContext<better_call271.MiddlewareOptions>) => Promise<{
996
+ use: ((inputContext: better_call239.MiddlewareInputContext<better_call239.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_call271.Middleware[];
1189
+ use?: better_call239.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_call271.Middleware[];
1419
+ use?: better_call239.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: zod381.ZodObject<{
1435
1435
  keyId: zod381.ZodString;
1436
1436
  }, zod_v4_core51.$strip>;
1437
- use: ((inputContext: better_call271.MiddlewareInputContext<better_call271.MiddlewareOptions>) => Promise<{
1437
+ use: ((inputContext: better_call239.MiddlewareInputContext<better_call239.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_call271.Middleware[];
1536
+ use?: better_call239.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_call271.MiddlewareInputContext<better_call271.MiddlewareOptions>) => Promise<{
1593
+ use: ((inputContext: better_call239.MiddlewareInputContext<better_call239.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_call271.Middleware[];
1772
+ use?: better_call239.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_core57.AuthContext<_gatwech_core57.PayvoAuthOptions>): {
1962
+ init(ctx: _gatwech_core55.AuthContext<_gatwech_core55.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_core57.PayvoAuthOptions> | undefined): Promise<{
1975
+ } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core55.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_core57.PayvoAuthOptions> | undefined): Promise<void>;
2000
+ } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core55.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_call271.MiddlewareInputContext<better_call271.MiddlewareOptions>) => Promise<void>;
2009
+ handler: (inputContext: better_call239.MiddlewareInputContext<better_call239.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_core57.PayvoAuthOptions>): {
2946
+ init(ctx: AuthContext<_gatwech_core55.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_core57.PayvoAuthOptions> | undefined): Promise<{
2959
+ } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core55.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_core57.PayvoAuthOptions> | undefined): Promise<void>;
2979
+ } & Record<string, unknown>, context: GenericEndpointContext<_gatwech_core55.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_core57.PayvoAuthOptions>): Promise<{
3007
+ onRequest(request: Request, ctx: AuthContext<_gatwech_core55.PayvoAuthOptions>): Promise<{
2961
3008
  response: Response;
2962
3009
  } | undefined>;
2963
3010
  hooks: {
2964
3011
  before: ({
2965
- matcher(context: _gatwech_core57.HookEndpointContext): boolean;
2966
- handler: (inputContext: better_call271.MiddlewareInputContext<better_call271.MiddlewareOptions>) => Promise<{
3012
+ matcher(context: _gatwech_core55.HookEndpointContext): boolean;
3013
+ handler: (inputContext: better_call239.MiddlewareInputContext<better_call239.MiddlewareOptions>) => Promise<{
2967
3014
  context: {
2968
3015
  body: any;
2969
3016
  };
2970
3017
  } | undefined>;
2971
3018
  } | {
2972
- matcher(context: _gatwech_core57.HookEndpointContext): boolean;
2973
- handler: (inputContext: better_call271.MiddlewareInputContext<better_call271.MiddlewareOptions>) => Promise<void>;
3019
+ matcher(context: _gatwech_core55.HookEndpointContext): boolean;
3020
+ handler: (inputContext: better_call239.MiddlewareInputContext<better_call239.MiddlewareOptions>) => Promise<void>;
2974
3021
  })[];
2975
3022
  after: ({
2976
- matcher(context: _gatwech_core57.HookEndpointContext): boolean;
2977
- handler: (inputContext: better_call271.MiddlewareInputContext<better_call271.MiddlewareOptions>) => Promise<void>;
3023
+ matcher(context: _gatwech_core55.HookEndpointContext): boolean;
3024
+ handler: (inputContext: better_call239.MiddlewareInputContext<better_call239.MiddlewareOptions>) => Promise<void>;
2978
3025
  } | {
2979
- matcher(context: _gatwech_core57.HookEndpointContext): boolean;
2980
- handler: (inputContext: better_call271.MiddlewareInputContext<better_call271.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_call271.Status;
3026
+ matcher(context: _gatwech_core55.HookEndpointContext): boolean;
3027
+ handler: (inputContext: better_call239.MiddlewareInputContext<better_call239.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_call239.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_call239.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_call239.MiddlewareInputContext<better_call239.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_call239.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_call239.MiddlewareInputContext<better_call239.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_call239.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";
@@ -3225,7 +3518,7 @@ declare const AUDIT_LOG_ERROR_CODES: {
3225
3518
  };
3226
3519
  declare const auditLog: (options?: AuditLogOptions | undefined) => {
3227
3520
  id: "audit-log";
3228
- init(ctx: AuthContext<_gatwech_core57.PayvoAuthOptions>): {
3521
+ init(ctx: AuthContext<_gatwech_core55.PayvoAuthOptions>): {
3229
3522
  options: {
3230
3523
  databaseHooks: {
3231
3524
  user: {
@@ -3238,7 +3531,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3238
3531
  emailVerified: boolean;
3239
3532
  name: string;
3240
3533
  image?: string | null | undefined;
3241
- } & Record<string, unknown>, context: _gatwech_core57.GenericEndpointContext<_gatwech_core57.PayvoAuthOptions> | undefined): Promise<void>;
3534
+ } & Record<string, unknown>, context: _gatwech_core55.GenericEndpointContext<_gatwech_core55.PayvoAuthOptions> | undefined): Promise<void>;
3242
3535
  };
3243
3536
  update: {
3244
3537
  after(user: {
@@ -3249,7 +3542,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3249
3542
  emailVerified: boolean;
3250
3543
  name: string;
3251
3544
  image?: string | null | undefined;
3252
- } & Record<string, unknown>, context: _gatwech_core57.GenericEndpointContext<_gatwech_core57.PayvoAuthOptions> | undefined, data: (Partial<{
3545
+ } & Record<string, unknown>, context: _gatwech_core55.GenericEndpointContext<_gatwech_core55.PayvoAuthOptions> | undefined, data: (Partial<{
3253
3546
  id: string;
3254
3547
  createdAt: Date;
3255
3548
  updatedAt: Date;
@@ -3268,7 +3561,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3268
3561
  emailVerified: boolean;
3269
3562
  name: string;
3270
3563
  image?: string | null | undefined;
3271
- } & Record<string, unknown>, context: _gatwech_core57.GenericEndpointContext<_gatwech_core57.PayvoAuthOptions> | undefined): Promise<void>;
3564
+ } & Record<string, unknown>, context: _gatwech_core55.GenericEndpointContext<_gatwech_core55.PayvoAuthOptions> | undefined): Promise<void>;
3272
3565
  };
3273
3566
  };
3274
3567
  session: {
@@ -3282,7 +3575,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3282
3575
  token: string;
3283
3576
  ipAddress?: string | null | undefined;
3284
3577
  userAgent?: string | null | undefined;
3285
- } & Record<string, unknown>, context: _gatwech_core57.GenericEndpointContext<_gatwech_core57.PayvoAuthOptions> | undefined): Promise<void>;
3578
+ } & Record<string, unknown>, context: _gatwech_core55.GenericEndpointContext<_gatwech_core55.PayvoAuthOptions> | undefined): Promise<void>;
3286
3579
  };
3287
3580
  };
3288
3581
  account: {
@@ -3301,7 +3594,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3301
3594
  refreshTokenExpiresAt?: Date | null | undefined;
3302
3595
  scope?: string | null | undefined;
3303
3596
  password?: string | null | undefined;
3304
- }, context: _gatwech_core57.GenericEndpointContext<_gatwech_core57.PayvoAuthOptions> | undefined): Promise<void>;
3597
+ }, context: _gatwech_core55.GenericEndpointContext<_gatwech_core55.PayvoAuthOptions> | undefined): Promise<void>;
3305
3598
  };
3306
3599
  };
3307
3600
  };
@@ -3309,12 +3602,12 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3309
3602
  };
3310
3603
  hooks: {
3311
3604
  before: {
3312
- matcher(context: _gatwech_core57.HookEndpointContext): boolean;
3313
- handler: (inputContext: better_call271.MiddlewareInputContext<better_call271.MiddlewareOptions>) => Promise<void>;
3605
+ matcher(context: _gatwech_core55.HookEndpointContext): boolean;
3606
+ handler: (inputContext: better_call239.MiddlewareInputContext<better_call239.MiddlewareOptions>) => Promise<void>;
3314
3607
  }[];
3315
3608
  after: {
3316
- matcher(context: _gatwech_core57.HookEndpointContext): boolean;
3317
- handler: (inputContext: better_call271.MiddlewareInputContext<better_call271.MiddlewareOptions>) => Promise<void>;
3609
+ matcher(context: _gatwech_core55.HookEndpointContext): boolean;
3610
+ handler: (inputContext: better_call239.MiddlewareInputContext<better_call239.MiddlewareOptions>) => Promise<void>;
3318
3611
  }[];
3319
3612
  };
3320
3613
  endpoints: {
@@ -3343,7 +3636,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3343
3636
  } & {
3344
3637
  asResponse?: boolean;
3345
3638
  returnHeaders?: boolean;
3346
- use?: better_call271.Middleware[];
3639
+ use?: better_call239.Middleware[];
3347
3640
  path?: string;
3348
3641
  } & {
3349
3642
  asResponse?: AsResponse | undefined;
@@ -3364,7 +3657,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3364
3657
  }>;
3365
3658
  options: {
3366
3659
  method: "GET";
3367
- use: ((inputContext: better_call271.MiddlewareInputContext<better_call271.MiddlewareOptions>) => Promise<{
3660
+ use: ((inputContext: better_call239.MiddlewareInputContext<better_call239.MiddlewareOptions>) => Promise<{
3368
3661
  session: {
3369
3662
  session: Record<string, any> & {
3370
3663
  id: string;
@@ -3511,7 +3804,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3511
3804
  } & {
3512
3805
  asResponse?: boolean;
3513
3806
  returnHeaders?: boolean;
3514
- use?: better_call271.Middleware[];
3807
+ use?: better_call239.Middleware[];
3515
3808
  path?: string;
3516
3809
  } & {
3517
3810
  asResponse?: AsResponse | undefined;
@@ -3532,7 +3825,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3532
3825
  }>;
3533
3826
  options: {
3534
3827
  method: "GET";
3535
- use: ((inputContext: better_call271.MiddlewareInputContext<better_call271.MiddlewareOptions>) => Promise<{
3828
+ use: ((inputContext: better_call239.MiddlewareInputContext<better_call239.MiddlewareOptions>) => Promise<{
3536
3829
  session: {
3537
3830
  session: Record<string, any> & {
3538
3831
  id: string;
@@ -3670,7 +3963,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3670
3963
  } & {
3671
3964
  asResponse?: boolean;
3672
3965
  returnHeaders?: boolean;
3673
- use?: better_call271.Middleware[];
3966
+ use?: better_call239.Middleware[];
3674
3967
  path?: string;
3675
3968
  } & {
3676
3969
  asResponse?: AsResponse | undefined;
@@ -3685,7 +3978,7 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3685
3978
  }>;
3686
3979
  options: {
3687
3980
  method: "GET";
3688
- use: ((inputContext: better_call271.MiddlewareInputContext<better_call271.MiddlewareOptions>) => Promise<{
3981
+ use: ((inputContext: better_call239.MiddlewareInputContext<better_call239.MiddlewareOptions>) => Promise<{
3689
3982
  session: {
3690
3983
  session: Record<string, any> & {
3691
3984
  id: string;
@@ -3741,6 +4034,51 @@ declare const auditLog: (options?: AuditLogOptions | undefined) => {
3741
4034
  };
3742
4035
  path: "/audit-log/get-event-types";
3743
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_call239.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
+ };
3744
4082
  };
3745
4083
  schema: {
3746
4084
  auditLog: {