@gatwech/auth 1.0.0-beta.20 → 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 (133) 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 +2 -2
  11. package/dist/client/plugins/index.d.mts +47 -47
  12. package/dist/client/plugins/index.mjs +2 -2
  13. package/dist/client/react/index.d.mts +2 -2
  14. package/dist/{client-F67q-Lbi.d.mts → client-B00gkznv.d.mts} +1 -1
  15. package/dist/{client-4QEb0rUr.mjs → client-CMsC6-rl.mjs} +1 -1
  16. package/dist/{client-C_qmyez2.d.mts → client-Da7tq8m6.d.mts} +1 -1
  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-BX7rl07Z.d.mts → index-BECNG13R.d.mts} +13 -13
  22. package/dist/{index-D57DuhZR.d.mts → index-BKy-8t2n.d.mts} +179 -126
  23. package/dist/{index-Df0KhQRf-BEa5tdwJ.d.mts → index-BL_t8cRp-C4QYBsac.d.mts} +56 -17
  24. package/dist/{index-D6ku0rUC.d.mts → index-BWYXZVsV.d.mts} +5 -5
  25. package/dist/{index-DwPAddfE.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-CzpdkTdv.d.mts → index-Bxive_YT.d.mts} +9 -9
  28. package/dist/{index-DGeoJ4gu.d.mts → index-C-IDh5yy.d.mts} +2 -2
  29. package/dist/{index-Dnd8S4S4.d.mts → index-CM1rFdwV.d.mts} +9 -9
  30. package/dist/{index-CNd5jqLl.d.mts → index-CMG4Pnen.d.mts} +4 -4
  31. package/dist/{index-4I1YhYhk.d.mts → index-CTqynuxm.d.mts} +4 -4
  32. package/dist/{index-CP8x1TFq.d.mts → index-CbBQdS-u.d.mts} +6 -6
  33. package/dist/{index-DyXi7S2M.d.mts → index-CpH-1sse.d.mts} +10 -10
  34. package/dist/{index-CC920PPp.d.mts → index-D1OZ2e4m.d.mts} +14 -14
  35. package/dist/{index-CofuaNMl.d.mts → index-Dt2I0G4X.d.mts} +7 -7
  36. package/dist/{index-XfE0WjTN.d.mts → index-IX1to9TB.d.mts} +34 -34
  37. package/dist/{index-KhbNmMmG.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-CBiGsvDd.d.mts → index-WV7VzW2H.d.mts} +8 -8
  40. package/dist/{index-Bml-PCqP.d.mts → index-YeXSxzhX.d.mts} +19 -19
  41. package/dist/{index-BsSKcKgO.d.mts → index-cPt-00xm.d.mts} +6 -6
  42. package/dist/{index-sb-UFLuo.d.mts → index-iRoaTsOj.d.mts} +2 -2
  43. package/dist/{index-DFSRYWFI.d.mts → index-jEkJ2Zfk.d.mts} +6 -6
  44. package/dist/{index-DTkcY7xH.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-DiPqydKG.mjs → sentinel-B4Wo79HK.mjs} +295 -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/index.d.ts +10 -1
  124. package/dist/src/plugins/sentinel/intel.d.ts +8 -1
  125. package/dist/src/plugins/sentinel/memory-cache.d.ts +12 -0
  126. package/dist/src/plugins/sentinel/schema.d.ts +4 -0
  127. package/dist/src/plugins/sentinel/store.d.ts +7 -0
  128. package/dist/src/plugins/sentinel/types.d.ts +29 -1
  129. package/dist/src/test-utils/test-instance.d.ts +25 -25
  130. package/dist/test-utils/index.d.mts +1045 -1045
  131. package/dist/test-utils/index.mjs +7 -7
  132. package/dist/types/index.d.mts +2 -2
  133. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- import { g as User, h as Session } from "./index-BNhJglHC.mjs";
1
+ import { g as User, h as Session } from "./index-BjCQ3jmE.mjs";
2
2
  import { GenericEndpointContext, PayvoAuthCookies, PayvoAuthOptions } from "@gatwech/core";
3
3
  import { CookieOptions } from "better-call";
4
4
  import "zod";
@@ -1,9 +1,9 @@
1
- import { g as User } from "./index-BNhJglHC.mjs";
2
- import * as _gatwech_core27 from "@gatwech/core";
1
+ import { g as User } from "./index-BjCQ3jmE.mjs";
2
+ import * as _gatwech_core22 from "@gatwech/core";
3
3
  import { GenericEndpointContext } from "@gatwech/core";
4
4
  import * as _gatwech_core_oauth20 from "@gatwech/core/oauth2";
5
5
  import { OAuth2Tokens, OAuth2UserInfo, OAuthProvider } from "@gatwech/core/oauth2";
6
- import * as better_call71 from "better-call";
6
+ import * as better_call151 from "better-call";
7
7
  import * as z$1 from "zod";
8
8
 
9
9
  //#region src/plugins/generic-oauth/index.d.ts
@@ -136,7 +136,7 @@ interface GenericOAuthOptions {
136
136
  */
137
137
  declare const genericOAuth: (options: GenericOAuthOptions) => {
138
138
  id: "generic-oauth";
139
- init: (ctx: _gatwech_core27.AuthContext<_gatwech_core27.PayvoAuthOptions>) => {
139
+ init: (ctx: _gatwech_core22.AuthContext<_gatwech_core22.PayvoAuthOptions>) => {
140
140
  context: {
141
141
  socialProviders: OAuthProvider<Record<string, any>, Partial<_gatwech_core_oauth20.ProviderOptions<any>>>[];
142
142
  };
@@ -182,7 +182,7 @@ declare const genericOAuth: (options: GenericOAuthOptions) => {
182
182
  } & {
183
183
  asResponse?: boolean;
184
184
  returnHeaders?: boolean;
185
- use?: better_call71.Middleware[];
185
+ use?: better_call151.Middleware[];
186
186
  path?: string;
187
187
  } & {
188
188
  asResponse?: AsResponse | undefined;
@@ -262,7 +262,7 @@ declare const genericOAuth: (options: GenericOAuthOptions) => {
262
262
  } & {
263
263
  asResponse?: boolean;
264
264
  returnHeaders?: boolean;
265
- use?: better_call71.Middleware[];
265
+ use?: better_call151.Middleware[];
266
266
  path?: string;
267
267
  } & {
268
268
  asResponse?: AsResponse | undefined;
@@ -343,7 +343,7 @@ declare const genericOAuth: (options: GenericOAuthOptions) => {
343
343
  } & {
344
344
  asResponse?: boolean;
345
345
  returnHeaders?: boolean;
346
- use?: better_call71.Middleware[];
346
+ use?: better_call151.Middleware[];
347
347
  path?: string;
348
348
  } & {
349
349
  asResponse?: AsResponse | undefined;
@@ -366,7 +366,7 @@ declare const genericOAuth: (options: GenericOAuthOptions) => {
366
366
  scopes: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
367
367
  errorCallbackURL: z$1.ZodOptional<z$1.ZodString>;
368
368
  }, z$1.core.$strip>;
369
- use: ((inputContext: better_call71.MiddlewareInputContext<better_call71.MiddlewareOptions>) => Promise<{
369
+ use: ((inputContext: better_call151.MiddlewareInputContext<better_call151.MiddlewareOptions>) => Promise<{
370
370
  session: {
371
371
  session: Record<string, any> & {
372
372
  id: string;
@@ -1,9 +1,9 @@
1
1
  import { o as LiteralString } from "./helper-BgOIGHsu.mjs";
2
- import { g as User } from "./index-BNhJglHC.mjs";
2
+ import { g as User } from "./index-BjCQ3jmE.mjs";
3
3
  import { t as InferOptionSchema } from "./plugins-Dy_FrD4Y.mjs";
4
- import * as _gatwech_core1 from "@gatwech/core";
4
+ import * as _gatwech_core50 from "@gatwech/core";
5
5
  import { PayvoAuthPlugin } from "@gatwech/core";
6
- import * as better_call5 from "better-call";
6
+ import * as better_call209 from "better-call";
7
7
  import * as z$1 from "zod";
8
8
  import * as _better_fetch_fetch19 from "@better-fetch/fetch";
9
9
 
@@ -274,7 +274,7 @@ declare const twoFactor: (options?: TwoFactorOptions | undefined) => {
274
274
  } & {
275
275
  asResponse?: boolean;
276
276
  returnHeaders?: boolean;
277
- use?: better_call5.Middleware[];
277
+ use?: better_call209.Middleware[];
278
278
  path?: string;
279
279
  } & {
280
280
  asResponse?: AsResponse | undefined;
@@ -295,7 +295,7 @@ declare const twoFactor: (options?: TwoFactorOptions | undefined) => {
295
295
  password: z$1.ZodString;
296
296
  issuer: z$1.ZodOptional<z$1.ZodString>;
297
297
  }, z$1.core.$strip>;
298
- use: ((inputContext: better_call5.MiddlewareInputContext<better_call5.MiddlewareOptions>) => Promise<{
298
+ use: ((inputContext: better_call209.MiddlewareInputContext<better_call209.MiddlewareOptions>) => Promise<{
299
299
  session: {
300
300
  session: Record<string, any> & {
301
301
  id: string;
@@ -387,7 +387,7 @@ declare const twoFactor: (options?: TwoFactorOptions | undefined) => {
387
387
  } & {
388
388
  asResponse?: boolean;
389
389
  returnHeaders?: boolean;
390
- use?: better_call5.Middleware[];
390
+ use?: better_call209.Middleware[];
391
391
  path?: string;
392
392
  } & {
393
393
  asResponse?: AsResponse | undefined;
@@ -405,7 +405,7 @@ declare const twoFactor: (options?: TwoFactorOptions | undefined) => {
405
405
  body: z$1.ZodObject<{
406
406
  password: z$1.ZodString;
407
407
  }, z$1.core.$strip>;
408
- use: ((inputContext: better_call5.MiddlewareInputContext<better_call5.MiddlewareOptions>) => Promise<{
408
+ use: ((inputContext: better_call209.MiddlewareInputContext<better_call209.MiddlewareOptions>) => Promise<{
409
409
  session: {
410
410
  session: Record<string, any> & {
411
411
  id: string;
@@ -476,7 +476,7 @@ declare const twoFactor: (options?: TwoFactorOptions | undefined) => {
476
476
  } & {
477
477
  asResponse?: boolean;
478
478
  returnHeaders?: boolean;
479
- use?: better_call5.Middleware[];
479
+ use?: better_call209.Middleware[];
480
480
  path?: string;
481
481
  } & {
482
482
  asResponse?: AsResponse | undefined;
@@ -629,7 +629,7 @@ declare const twoFactor: (options?: TwoFactorOptions | undefined) => {
629
629
  } & {
630
630
  asResponse?: boolean;
631
631
  returnHeaders?: boolean;
632
- use?: better_call5.Middleware[];
632
+ use?: better_call209.Middleware[];
633
633
  path?: string;
634
634
  } & {
635
635
  asResponse?: AsResponse | undefined;
@@ -649,7 +649,7 @@ declare const twoFactor: (options?: TwoFactorOptions | undefined) => {
649
649
  body: z$1.ZodObject<{
650
650
  password: z$1.ZodString;
651
651
  }, z$1.core.$strip>;
652
- use: ((inputContext: better_call5.MiddlewareInputContext<better_call5.MiddlewareOptions>) => Promise<{
652
+ use: ((inputContext: better_call209.MiddlewareInputContext<better_call209.MiddlewareOptions>) => Promise<{
653
653
  session: {
654
654
  session: Record<string, any> & {
655
655
  id: string;
@@ -727,7 +727,7 @@ declare const twoFactor: (options?: TwoFactorOptions | undefined) => {
727
727
  } & {
728
728
  asResponse?: boolean;
729
729
  returnHeaders?: boolean;
730
- use?: better_call5.Middleware[];
730
+ use?: better_call209.Middleware[];
731
731
  path?: string;
732
732
  } & {
733
733
  asResponse?: AsResponse | undefined;
@@ -773,7 +773,7 @@ declare const twoFactor: (options?: TwoFactorOptions | undefined) => {
773
773
  } & {
774
774
  asResponse?: boolean;
775
775
  returnHeaders?: boolean;
776
- use?: better_call5.Middleware[];
776
+ use?: better_call209.Middleware[];
777
777
  path?: string;
778
778
  } & {
779
779
  asResponse?: AsResponse | undefined;
@@ -838,7 +838,7 @@ declare const twoFactor: (options?: TwoFactorOptions | undefined) => {
838
838
  } & {
839
839
  asResponse?: boolean;
840
840
  returnHeaders?: boolean;
841
- use?: better_call5.Middleware[];
841
+ use?: better_call209.Middleware[];
842
842
  path?: string;
843
843
  } & {
844
844
  asResponse?: AsResponse | undefined;
@@ -966,7 +966,7 @@ declare const twoFactor: (options?: TwoFactorOptions | undefined) => {
966
966
  } & {
967
967
  asResponse?: boolean;
968
968
  returnHeaders?: boolean;
969
- use?: better_call5.Middleware[];
969
+ use?: better_call209.Middleware[];
970
970
  path?: string;
971
971
  } & {
972
972
  asResponse?: AsResponse | undefined;
@@ -1031,7 +1031,7 @@ declare const twoFactor: (options?: TwoFactorOptions | undefined) => {
1031
1031
  } & {
1032
1032
  asResponse?: boolean;
1033
1033
  returnHeaders?: boolean;
1034
- use?: better_call5.Middleware[];
1034
+ use?: better_call209.Middleware[];
1035
1035
  path?: string;
1036
1036
  } & {
1037
1037
  asResponse?: AsResponse | undefined;
@@ -1046,7 +1046,7 @@ declare const twoFactor: (options?: TwoFactorOptions | undefined) => {
1046
1046
  }>;
1047
1047
  options: {
1048
1048
  method: "POST";
1049
- use: ((inputContext: better_call5.MiddlewareInputContext<better_call5.MiddlewareOptions>) => Promise<{
1049
+ use: ((inputContext: better_call209.MiddlewareInputContext<better_call209.MiddlewareOptions>) => Promise<{
1050
1050
  session: {
1051
1051
  session: Record<string, any> & {
1052
1052
  id: string;
@@ -1119,7 +1119,7 @@ declare const twoFactor: (options?: TwoFactorOptions | undefined) => {
1119
1119
  } & {
1120
1120
  asResponse?: boolean;
1121
1121
  returnHeaders?: boolean;
1122
- use?: better_call5.Middleware[];
1122
+ use?: better_call209.Middleware[];
1123
1123
  path?: string;
1124
1124
  } & {
1125
1125
  asResponse?: AsResponse | undefined;
@@ -1188,8 +1188,8 @@ declare const twoFactor: (options?: TwoFactorOptions | undefined) => {
1188
1188
  options: TwoFactorOptions | undefined;
1189
1189
  hooks: {
1190
1190
  after: {
1191
- matcher(context: _gatwech_core1.HookEndpointContext): boolean;
1192
- handler: (inputContext: better_call5.MiddlewareInputContext<better_call5.MiddlewareOptions>) => Promise<{
1191
+ matcher(context: _gatwech_core50.HookEndpointContext): boolean;
1192
+ handler: (inputContext: better_call209.MiddlewareInputContext<better_call209.MiddlewareOptions>) => Promise<{
1193
1193
  twoFactorRedirect: boolean;
1194
1194
  } | undefined>;
1195
1195
  }[];
@@ -1,7 +1,7 @@
1
- import { f as InferSession, p as InferUser } from "./index-BNhJglHC.mjs";
2
- import * as _gatwech_core0 from "@gatwech/core";
1
+ import { f as InferSession, p as InferUser } from "./index-BjCQ3jmE.mjs";
2
+ import * as _gatwech_core11 from "@gatwech/core";
3
3
  import { GenericEndpointContext, PayvoAuthOptions } from "@gatwech/core";
4
- import * as better_call2 from "better-call";
4
+ import * as better_call127 from "better-call";
5
5
  import * as z$1 from "zod";
6
6
 
7
7
  //#region src/plugins/custom-session/index.d.ts
@@ -19,8 +19,8 @@ declare const customSession: <Returns extends Record<string, any>, O extends Pay
19
19
  id: "custom-session";
20
20
  hooks: {
21
21
  after: {
22
- matcher: (ctx: _gatwech_core0.HookEndpointContext) => boolean;
23
- handler: (inputContext: better_call2.MiddlewareInputContext<better_call2.MiddlewareOptions>) => Promise<Awaited<Returns>[] | undefined>;
22
+ matcher: (ctx: _gatwech_core11.HookEndpointContext) => boolean;
23
+ handler: (inputContext: better_call127.MiddlewareInputContext<better_call127.MiddlewareOptions>) => Promise<Awaited<Returns>[] | undefined>;
24
24
  }[];
25
25
  };
26
26
  endpoints: {
@@ -43,7 +43,7 @@ declare const customSession: <Returns extends Record<string, any>, O extends Pay
43
43
  } & {
44
44
  asResponse?: boolean;
45
45
  returnHeaders?: boolean;
46
- use?: better_call2.Middleware[];
46
+ use?: better_call127.Middleware[];
47
47
  path?: string;
48
48
  } & {
49
49
  asResponse?: AsResponse | undefined;
@@ -1,4 +1,4 @@
1
- import * as better_call113 from "better-call";
1
+ import * as better_call134 from "better-call";
2
2
  import * as z$1 from "zod";
3
3
 
4
4
  //#region src/plugins/one-tap/index.d.ts
@@ -38,7 +38,7 @@ declare const oneTap: (options?: OneTapOptions | undefined) => {
38
38
  } & {
39
39
  asResponse?: boolean;
40
40
  returnHeaders?: boolean;
41
- use?: better_call113.Middleware[];
41
+ use?: better_call134.Middleware[];
42
42
  path?: string;
43
43
  } & {
44
44
  asResponse?: AsResponse | undefined;
@@ -1,5 +1,5 @@
1
1
  import { t as InferOptionSchema } from "./plugins-Dy_FrD4Y.mjs";
2
- import * as better_call29 from "better-call";
2
+ import * as better_call146 from "better-call";
3
3
  import * as z$1 from "zod";
4
4
  import { StringValue } from "ms";
5
5
 
@@ -180,7 +180,7 @@ declare const deviceAuthorization: (options?: Partial<DeviceAuthorizationOptions
180
180
  } & {
181
181
  asResponse?: boolean;
182
182
  returnHeaders?: boolean;
183
- use?: better_call29.Middleware[];
183
+ use?: better_call146.Middleware[];
184
184
  path?: string;
185
185
  } & {
186
186
  asResponse?: AsResponse | undefined;
@@ -303,7 +303,7 @@ declare const deviceAuthorization: (options?: Partial<DeviceAuthorizationOptions
303
303
  } & {
304
304
  asResponse?: boolean;
305
305
  returnHeaders?: boolean;
306
- use?: better_call29.Middleware[];
306
+ use?: better_call146.Middleware[];
307
307
  path?: string;
308
308
  } & {
309
309
  asResponse?: AsResponse | undefined;
@@ -407,7 +407,7 @@ declare const deviceAuthorization: (options?: Partial<DeviceAuthorizationOptions
407
407
  } & {
408
408
  asResponse?: boolean;
409
409
  returnHeaders?: boolean;
410
- use?: better_call29.Middleware[];
410
+ use?: better_call146.Middleware[];
411
411
  path?: string;
412
412
  } & {
413
413
  asResponse?: AsResponse | undefined;
@@ -484,7 +484,7 @@ declare const deviceAuthorization: (options?: Partial<DeviceAuthorizationOptions
484
484
  } & {
485
485
  asResponse?: boolean;
486
486
  returnHeaders?: boolean;
487
- use?: better_call29.Middleware[];
487
+ use?: better_call146.Middleware[];
488
488
  path?: string;
489
489
  } & {
490
490
  asResponse?: AsResponse | undefined;
@@ -556,7 +556,7 @@ declare const deviceAuthorization: (options?: Partial<DeviceAuthorizationOptions
556
556
  } & {
557
557
  asResponse?: boolean;
558
558
  returnHeaders?: boolean;
559
- use?: better_call29.Middleware[];
559
+ use?: better_call146.Middleware[];
560
560
  path?: string;
561
561
  } & {
562
562
  asResponse?: AsResponse | undefined;
@@ -1,5 +1,5 @@
1
- import * as _gatwech_core23 from "@gatwech/core";
2
- import * as better_call60 from "better-call";
1
+ import * as _gatwech_core14 from "@gatwech/core";
2
+ import * as better_call135 from "better-call";
3
3
  import * as z$1 from "zod";
4
4
 
5
5
  //#region src/plugins/oauth-proxy/index.d.ts
@@ -48,7 +48,7 @@ declare const oAuthProxy: (opts?: OAuthProxyOptions | undefined) => {
48
48
  } & {
49
49
  asResponse?: boolean;
50
50
  returnHeaders?: boolean;
51
- use?: better_call60.Middleware[];
51
+ use?: better_call135.Middleware[];
52
52
  path?: string;
53
53
  } & {
54
54
  asResponse?: AsResponse | undefined;
@@ -63,7 +63,7 @@ declare const oAuthProxy: (opts?: OAuthProxyOptions | undefined) => {
63
63
  callbackURL: z$1.ZodString;
64
64
  cookies: z$1.ZodString;
65
65
  }, z$1.core.$strip>;
66
- use: ((inputContext: better_call60.MiddlewareInputContext<better_call60.MiddlewareOptions>) => Promise<void>)[];
66
+ use: ((inputContext: better_call135.MiddlewareInputContext<better_call135.MiddlewareOptions>) => Promise<void>)[];
67
67
  metadata: {
68
68
  openapi: {
69
69
  description: string;
@@ -96,12 +96,12 @@ declare const oAuthProxy: (opts?: OAuthProxyOptions | undefined) => {
96
96
  };
97
97
  hooks: {
98
98
  after: {
99
- matcher(context: _gatwech_core23.HookEndpointContext): boolean;
100
- handler: (inputContext: better_call60.MiddlewareInputContext<better_call60.MiddlewareOptions>) => Promise<void>;
99
+ matcher(context: _gatwech_core14.HookEndpointContext): boolean;
100
+ handler: (inputContext: better_call135.MiddlewareInputContext<better_call135.MiddlewareOptions>) => Promise<void>;
101
101
  }[];
102
102
  before: ({
103
103
  matcher(): true;
104
- handler: (inputContext: better_call60.MiddlewareInputContext<better_call60.MiddlewareOptions>) => Promise<{
104
+ handler: (inputContext: better_call135.MiddlewareInputContext<better_call135.MiddlewareOptions>) => Promise<{
105
105
  context: {
106
106
  context: {
107
107
  oauthConfig: {
@@ -111,9 +111,9 @@ declare const oAuthProxy: (opts?: OAuthProxyOptions | undefined) => {
111
111
  };
112
112
  } | undefined>;
113
113
  } | {
114
- matcher(context: _gatwech_core23.HookEndpointContext): boolean;
115
- handler: (inputContext: better_call60.MiddlewareInputContext<better_call60.MiddlewareOptions>) => Promise<{
116
- context: better_call60.MiddlewareContext<better_call60.MiddlewareOptions, _gatwech_core23.AuthContext<_gatwech_core23.PayvoAuthOptions> & {
114
+ matcher(context: _gatwech_core14.HookEndpointContext): boolean;
115
+ handler: (inputContext: better_call135.MiddlewareInputContext<better_call135.MiddlewareOptions>) => Promise<{
116
+ context: better_call135.MiddlewareContext<better_call135.MiddlewareOptions, _gatwech_core14.AuthContext<_gatwech_core14.PayvoAuthOptions> & {
117
117
  returned?: unknown | undefined;
118
118
  responseHeaders?: Headers | undefined;
119
119
  }>;
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { h as UnionToIntersection, u as Prettify } from "./helper-BgOIGHsu.mjs";
2
- import { A as Where, An as generateId, B as InferPluginsFromClient, C as AdapterInstance, Cn as StandardSchemaV1, D as DBAdapterSchemaCreation, Dn as getTelemetryAuthConfig, E as DBAdapterInstance, En as getCurrentAdapter, F as ClientStore, G as PayvoAuthClientPlugin, H as InferUserFromClient, I as InferActions, K as SessionQueryParams, L as InferAdditionalFromClient, M as AtomListener, Mn as generateState, N as ClientAtomListener, Nn as parseState, O as DBTransactionAdapter, P as ClientOptions, Q as APIError, R as InferClientAPI, S as Adapter, T as DBAdapter, Tn as createTelemetry, U as IsSignal, V as InferSessionFromClient, W as PayvoAuthClientOptions, X as WithJsDoc, Y as Auth, Z as payvoAuth, _ as Verification, a as PayvoAuthRateLimitOptions, b as InferAPI, c as AdditionalSessionFieldsOutput, d as InferPluginTypes, f as InferSession, g as User, h as Session, i as PayvoAuthPlugin, j as init, jn as HIDE_METADATA, k as TransactionAdapter, kn as capitalizeFirstLetter, l as AdditionalUserFieldsInput, m as RateLimit, n as PayvoAuthCookies, o as Account, p as InferUser, q as Store, r as PayvoAuthOptions, s as AdditionalSessionFieldsInput, t as PayvoAuthAdvancedOptions, u as AdditionalUserFieldsOutput, v as FilterActions, w as AdapterSchemaCreation, wn as TelemetryEvent, x as InferSessionAPI, y as FilteredAPI, z as InferErrorCodes } from "./index-BNhJglHC.mjs";
2
+ import { A as Where, An as generateId, B as InferPluginsFromClient, C as AdapterInstance, Cn as StandardSchemaV1, D as DBAdapterSchemaCreation, Dn as getTelemetryAuthConfig, E as DBAdapterInstance, En as getCurrentAdapter, F as ClientStore, G as PayvoAuthClientPlugin, H as InferUserFromClient, I as InferActions, K as SessionQueryParams, L as InferAdditionalFromClient, M as AtomListener, Mn as generateState, N as ClientAtomListener, Nn as parseState, O as DBTransactionAdapter, P as ClientOptions, Q as APIError, R as InferClientAPI, S as Adapter, T as DBAdapter, Tn as createTelemetry, U as IsSignal, V as InferSessionFromClient, W as PayvoAuthClientOptions, X as WithJsDoc, Y as Auth, Z as payvoAuth, _ as Verification, a as PayvoAuthRateLimitOptions, b as InferAPI, c as AdditionalSessionFieldsOutput, d as InferPluginTypes, f as InferSession, g as User, h as Session, i as PayvoAuthPlugin, j as init, jn as HIDE_METADATA, k as TransactionAdapter, kn as capitalizeFirstLetter, l as AdditionalUserFieldsInput, m as RateLimit, n as PayvoAuthCookies, o as Account, p as InferUser, q as Store, r as PayvoAuthOptions, s as AdditionalSessionFieldsInput, t as PayvoAuthAdvancedOptions, u as AdditionalUserFieldsOutput, v as FilterActions, w as AdapterSchemaCreation, wn as TelemetryEvent, x as InferSessionAPI, y as FilteredAPI, z as InferErrorCodes } from "./index-BjCQ3jmE.mjs";
3
3
  import "./types-DNQ9XQrB.mjs";
4
- import "./index-Df0KhQRf-BEa5tdwJ.mjs";
4
+ import "./index-BL_t8cRp-C4QYBsac.mjs";
5
5
  import { n as InferPluginErrorCodes, t as InferOptionSchema } from "./plugins-Dy_FrD4Y.mjs";
6
6
  export * from "@gatwech/core";
7
7
  export * from "@gatwech/core/env";
package/dist/index.mjs CHANGED
@@ -8,15 +8,15 @@ import "./jwt-CmxZAGe2.mjs";
8
8
  import "./random-32E3cU5o.mjs";
9
9
  import "./cookies-BuvlgcA-.mjs";
10
10
  import "./date-CMr04reD.mjs";
11
- import "./db-7vHnL1XA.mjs";
11
+ import "./db-CV59HpEF.mjs";
12
12
  import "./dialect-HsWUfpYY.mjs";
13
13
  import "./get-tables-CKvSyDST.mjs";
14
14
  import "./types-DCPpFKUB.mjs";
15
15
  import { t as capitalizeFirstLetter } from "./misc-fKH4d5XQ.mjs";
16
16
  import "./session-BB3oqApE.mjs";
17
17
  import "./adapter-factory-xbLUJt85.mjs";
18
- import "./kysely-adapter-Bkm1liPW.mjs";
19
- import { t as payvoAuth } from "./auth-vfCyIIeV.mjs";
18
+ import "./kysely-adapter-BidlNTiV.mjs";
19
+ import { t as payvoAuth } from "./auth-BoEA9bN7.mjs";
20
20
  import "./password-5CdcAVaH.mjs";
21
21
  import { getCurrentAdapter } from "@gatwech/core/context";
22
22
  import { createTelemetry, getTelemetryAuthConfig } from "@gatwech/telemetry";
@@ -1,5 +1,5 @@
1
- import * as _gatwech_core29 from "@gatwech/core";
2
- import * as better_call81 from "better-call";
1
+ import * as _gatwech_core9 from "@gatwech/core";
2
+ import * as better_call118 from "better-call";
3
3
 
4
4
  //#region src/integrations/next-js.d.ts
5
5
  declare function toNextJsHandler(auth: {
@@ -12,8 +12,8 @@ declare const nextCookies: () => {
12
12
  id: "next-cookies";
13
13
  hooks: {
14
14
  after: {
15
- matcher(ctx: _gatwech_core29.HookEndpointContext): true;
16
- handler: (inputContext: better_call81.MiddlewareInputContext<better_call81.MiddlewareOptions>) => Promise<void>;
15
+ matcher(ctx: _gatwech_core9.HookEndpointContext): true;
16
+ handler: (inputContext: better_call118.MiddlewareInputContext<better_call118.MiddlewareOptions>) => Promise<void>;
17
17
  }[];
18
18
  };
19
19
  };
@@ -1,7 +1,7 @@
1
1
  import "../helper-BgOIGHsu.mjs";
2
- import { Y as Auth } from "../index-BNhJglHC.mjs";
2
+ import { Y as Auth } from "../index-BjCQ3jmE.mjs";
3
3
  import "../types-DNQ9XQrB.mjs";
4
- import "../index-Df0KhQRf-BEa5tdwJ.mjs";
4
+ import "../index-BL_t8cRp-C4QYBsac.mjs";
5
5
  import "../plugins-Dy_FrD4Y.mjs";
6
6
  import * as http0 from "http";
7
7
  import { IncomingHttpHeaders } from "http";
@@ -1,13 +1,13 @@
1
- import * as _gatwech_core52 from "@gatwech/core";
2
- import * as better_call135 from "better-call";
1
+ import * as _gatwech_core0 from "@gatwech/core";
2
+ import * as better_call0 from "better-call";
3
3
 
4
4
  //#region src/integrations/react-start.d.ts
5
5
  declare const reactStartCookies: () => {
6
6
  id: "react-start-cookies";
7
7
  hooks: {
8
8
  after: {
9
- matcher(ctx: _gatwech_core52.HookEndpointContext): true;
10
- handler: (inputContext: better_call135.MiddlewareInputContext<better_call135.MiddlewareOptions>) => Promise<void>;
9
+ matcher(ctx: _gatwech_core0.HookEndpointContext): true;
10
+ handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>;
11
11
  }[];
12
12
  };
13
13
  };
@@ -121,7 +121,8 @@ const kyselyAdapter = (db, config) => {
121
121
  let query = db$1.updateTable(model).set(values);
122
122
  if (and) query = query.where((eb) => eb.and(and.map((expr) => expr(eb))));
123
123
  if (or) query = query.where((eb) => eb.or(or.map((expr) => expr(eb))));
124
- return (await query.execute()).length;
124
+ const res = await query.executeTakeFirst();
125
+ return Number(res.numUpdatedRows);
125
126
  },
126
127
  async count({ model, where }) {
127
128
  const { and, or } = convertWhereClause(model, where);
@@ -145,7 +146,8 @@ const kyselyAdapter = (db, config) => {
145
146
  let query = db$1.deleteFrom(model);
146
147
  if (and) query = query.where((eb) => eb.and(and.map((expr) => expr(eb))));
147
148
  if (or) query = query.where((eb) => eb.or(or.map((expr) => expr(eb))));
148
- return (await query.execute()).length;
149
+ const res = await query.executeTakeFirst();
150
+ return Number(res.numDeletedRows);
149
151
  },
150
152
  options: config
151
153
  };
@@ -1,7 +1,7 @@
1
1
  import "../helper-BgOIGHsu.mjs";
2
- import { Mn as generateState, Nn as parseState, g as User, o as Account } from "../index-BNhJglHC.mjs";
2
+ import { Mn as generateState, Nn as parseState, g as User, o as Account } from "../index-BjCQ3jmE.mjs";
3
3
  import "../types-DNQ9XQrB.mjs";
4
- import "../index-Df0KhQRf-BEa5tdwJ.mjs";
4
+ import "../index-BL_t8cRp-C4QYBsac.mjs";
5
5
  import "../plugins-Dy_FrD4Y.mjs";
6
6
  import { AuthContext, GenericEndpointContext } from "@gatwech/core";
7
7
  export * from "@gatwech/core/oauth2";
@@ -8,7 +8,7 @@ import "../jwt-CmxZAGe2.mjs";
8
8
  import "../random-32E3cU5o.mjs";
9
9
  import "../cookies-BuvlgcA-.mjs";
10
10
  import "../date-CMr04reD.mjs";
11
- import "../db-7vHnL1XA.mjs";
11
+ import "../db-CV59HpEF.mjs";
12
12
  import "../dialect-HsWUfpYY.mjs";
13
13
  import "../get-tables-CKvSyDST.mjs";
14
14
  import "../types-DCPpFKUB.mjs";
@@ -2,7 +2,7 @@ import { t as generateId } from "./utils-B03WRaGi.mjs";
2
2
  import { t as APIError$1 } from "./api-Dk8Yj_J5.mjs";
3
3
  import { c as setSessionCookie } from "./cookies-BuvlgcA-.mjs";
4
4
  import { t as getDate } from "./date-CMr04reD.mjs";
5
- import { i as toZodSchema } from "./db-7vHnL1XA.mjs";
5
+ import { i as toZodSchema } from "./db-CV59HpEF.mjs";
6
6
  import { a as requestOnlySessionMiddleware, r as getSessionFromCtx, u as sessionMiddleware } from "./session-BB3oqApE.mjs";
7
7
  import { n as parser_default } from "./parser-D7EkhAjZ.mjs";
8
8
  import { r as defaultRoles } from "./access-CrwEFPHE.mjs";
@@ -1,8 +1,8 @@
1
1
  import "../../helper-BgOIGHsu.mjs";
2
- import "../../index-BNhJglHC.mjs";
2
+ import "../../index-BjCQ3jmE.mjs";
3
3
  import "../../types-DNQ9XQrB.mjs";
4
- import "../../index-Df0KhQRf-BEa5tdwJ.mjs";
4
+ import "../../index-BL_t8cRp-C4QYBsac.mjs";
5
5
  import "../../plugins-Dy_FrD4Y.mjs";
6
6
  import "../../index-CxlWnL9c.mjs";
7
- import { a as UserWithRole, i as SessionWithImpersonatedBy, n as AdminOptions, r as InferAdminRolesFromOption, t as admin } from "../../index-XfE0WjTN.mjs";
7
+ import { a as UserWithRole, i as SessionWithImpersonatedBy, n as AdminOptions, r as InferAdminRolesFromOption, t as admin } from "../../index-IX1to9TB.mjs";
8
8
  export { AdminOptions, InferAdminRolesFromOption, SessionWithImpersonatedBy, UserWithRole, admin };
@@ -8,7 +8,7 @@ import "../../jwt-CmxZAGe2.mjs";
8
8
  import "../../random-32E3cU5o.mjs";
9
9
  import "../../cookies-BuvlgcA-.mjs";
10
10
  import "../../date-CMr04reD.mjs";
11
- import "../../db-7vHnL1XA.mjs";
11
+ import "../../db-CV59HpEF.mjs";
12
12
  import "../../dialect-HsWUfpYY.mjs";
13
13
  import "../../get-tables-CKvSyDST.mjs";
14
14
  import "../../types-DCPpFKUB.mjs";
@@ -1,7 +1,7 @@
1
1
  import "../../helper-BgOIGHsu.mjs";
2
- import "../../index-BNhJglHC.mjs";
2
+ import "../../index-BjCQ3jmE.mjs";
3
3
  import "../../types-DNQ9XQrB.mjs";
4
- import "../../index-Df0KhQRf-BEa5tdwJ.mjs";
4
+ import "../../index-BL_t8cRp-C4QYBsac.mjs";
5
5
  import "../../plugins-Dy_FrD4Y.mjs";
6
- import { n as UserWithAnonymous, r as anonymous, t as AnonymousOptions } from "../../index-CNd5jqLl.mjs";
6
+ import { n as UserWithAnonymous, r as anonymous, t as AnonymousOptions } from "../../index-CMG4Pnen.mjs";
7
7
  export { AnonymousOptions, UserWithAnonymous, anonymous };
@@ -8,7 +8,7 @@ import "../../jwt-CmxZAGe2.mjs";
8
8
  import "../../random-32E3cU5o.mjs";
9
9
  import "../../cookies-BuvlgcA-.mjs";
10
10
  import "../../date-CMr04reD.mjs";
11
- import "../../db-7vHnL1XA.mjs";
11
+ import "../../db-CV59HpEF.mjs";
12
12
  import "../../dialect-HsWUfpYY.mjs";
13
13
  import "../../get-tables-CKvSyDST.mjs";
14
14
  import "../../types-DCPpFKUB.mjs";
@@ -1,30 +1,30 @@
1
1
  import "../../helper-BgOIGHsu.mjs";
2
- import "../../index-BNhJglHC.mjs";
2
+ import "../../index-BjCQ3jmE.mjs";
3
3
  import "../../types-DNQ9XQrB.mjs";
4
- import "../../index-Df0KhQRf-BEa5tdwJ.mjs";
4
+ import "../../index-BL_t8cRp-C4QYBsac.mjs";
5
5
  import "../../plugins-Dy_FrD4Y.mjs";
6
6
  import "../../index-CxlWnL9c.mjs";
7
- import "../../index-XfE0WjTN.mjs";
8
- import "../../index-CNd5jqLl.mjs";
9
- import "../../index-D57DuhZR.mjs";
10
- import "../../index-CP8x1TFq.mjs";
11
- import "../../index-DGeoJ4gu.mjs";
12
- import "../../index-BsSKcKgO.mjs";
13
- import "../../index-DFSRYWFI.mjs";
14
- import "../../index-CC920PPp.mjs";
15
- import "../../index-CBiGsvDd.mjs";
16
- import "../../index-DwPAddfE.mjs";
17
- import "../../index-Dnd8S4S4.mjs";
18
- import "../../index-4I1YhYhk.mjs";
19
- import "../../index-DyXi7S2M.mjs";
20
- import "../../index-DTkcY7xH.mjs";
21
- import "../../index-sb-UFLuo.mjs";
22
- import "../../index-D6ku0rUC.mjs";
7
+ import "../../index-IX1to9TB.mjs";
8
+ import "../../index-CMG4Pnen.mjs";
9
+ import "../../index-BKy-8t2n.mjs";
10
+ import "../../index-CbBQdS-u.mjs";
11
+ import "../../index-C-IDh5yy.mjs";
12
+ import "../../index-cPt-00xm.mjs";
13
+ import "../../index-jEkJ2Zfk.mjs";
14
+ import "../../index-D1OZ2e4m.mjs";
15
+ import "../../index-WV7VzW2H.mjs";
16
+ import "../../index-Bhc37y9F.mjs";
17
+ import "../../index-CM1rFdwV.mjs";
18
+ import "../../index-CTqynuxm.mjs";
19
+ import "../../index-CpH-1sse.mjs";
20
+ import "../../index-oNlp4SvD.mjs";
21
+ import "../../index-iRoaTsOj.mjs";
22
+ import "../../index-BWYXZVsV.mjs";
23
23
  import "../../index-QmocqGM-.mjs";
24
- import "../../index-KhbNmMmG.mjs";
25
- import "../../index-CofuaNMl.mjs";
26
- import "../../index-Bml-PCqP.mjs";
27
- import "../../index-BX7rl07Z.mjs";
28
- import "../../index-CzpdkTdv.mjs";
29
- import { t as auditLogClient } from "../../client-F67q-Lbi.mjs";
24
+ import "../../index-TrOnY3pM.mjs";
25
+ import "../../index-Dt2I0G4X.mjs";
26
+ import "../../index-YeXSxzhX.mjs";
27
+ import "../../index-BECNG13R.mjs";
28
+ import "../../index-Bxive_YT.mjs";
29
+ import { t as auditLogClient } from "../../client-B00gkznv.mjs";
30
30
  export { auditLogClient };