@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,5 +1,5 @@
1
1
  import { t as generateRandomString } from "./random-32E3cU5o.mjs";
2
- import { n as POW_REASON_HEADER, o as parsePowHeader, r as POW_SOLUTION_HEADER, s as solveChallenge, t as POW_CHALLENGE_HEADER } from "./pow-OK01yPG3.mjs";
2
+ import { n as POW_REASON_HEADER, o as parsePowHeader, r as POW_SOLUTION_HEADER, s as solveChallenge, t as POW_CHALLENGE_HEADER } from "./pow-DvkUopsK.mjs";
3
3
  import { betterFetch } from "@better-fetch/fetch";
4
4
 
5
5
  //#region src/plugins/sentinel/client.ts
@@ -1,4 +1,4 @@
1
- import { c as sentinel } from "./index-D57DuhZR.mjs";
1
+ import { c as sentinel } from "./index-BKy-8t2n.mjs";
2
2
  import * as _better_fetch_fetch16 from "@better-fetch/fetch";
3
3
 
4
4
  //#region src/plugins/sentinel/client.d.ts
@@ -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 { a as getCookies, c as setCookieCache, d as getChunkedCookie, f as parseSetCookieHeader, i as getCookieCache, l as setSessionCookie, n as createCookieGetter, o as getSessionCookie, p as setCookieToHeader, r as deleteSessionCookie, s as parseCookies, t as EligibleCookies, u as createSessionStore } from "../index-CsxtcAO0.mjs";
6
+ import { a as getCookies, c as setCookieCache, d as getChunkedCookie, f as parseSetCookieHeader, i as getCookieCache, l as setSessionCookie, n as createCookieGetter, o as getSessionCookie, p as setCookieToHeader, r as deleteSessionCookie, s as parseCookies, t as EligibleCookies, u as createSessionStore } from "../index-VUyESU4p.mjs";
7
7
  export { EligibleCookies, createCookieGetter, createSessionStore, deleteSessionCookie, getChunkedCookie, getCookieCache, getCookies, getSessionCookie, parseCookies, parseSetCookieHeader, setCookieCache, setCookieToHeader, setSessionCookie };
@@ -1,7 +1,7 @@
1
1
  import "../helper-BgOIGHsu.mjs";
2
- import { $t as mergeSchema, Jt as convertFromDB, Qt as toZodSchema, Sn as createFieldAttribute, Xt as getAdapter, Yt as convertToDB, Zt as FieldAttributeToSchema, _n as InferFieldsInput, an as parseSessionOutput, bn as InferValueType, cn as createInternalAdapter, dn as getMigrations, en as parseAccountInput, fn as matchType, gn as InferFieldsFromPlugins, hn as InferFieldsFromOptions, in as parseSessionInput, ln as getAuthTables, mn as InferAdditionalFieldsFromPluginOptions, nn as parseAdditionalUserInput, on as parseUserInput, pn as FieldAttributeToObject, qt as getWithHooks, rn as parseInputData, sn as parseUserOutput, tn as parseAccountOutput, un as getSchema, vn as InferFieldsInputClient, xn as PluginFieldAttribute, yn as InferFieldsOutput } from "../index-BNhJglHC.mjs";
2
+ import { $t as mergeSchema, Jt as convertFromDB, Qt as toZodSchema, Sn as createFieldAttribute, Xt as getAdapter, Yt as convertToDB, Zt as FieldAttributeToSchema, _n as InferFieldsInput, an as parseSessionOutput, bn as InferValueType, cn as createInternalAdapter, dn as getMigrations, en as parseAccountInput, fn as matchType, gn as InferFieldsFromPlugins, hn as InferFieldsFromOptions, in as parseSessionInput, ln as getAuthTables, mn as InferAdditionalFieldsFromPluginOptions, nn as parseAdditionalUserInput, on as parseUserInput, pn as FieldAttributeToObject, qt as getWithHooks, rn as parseInputData, sn as parseUserOutput, tn as parseAccountOutput, un as getSchema, vn as InferFieldsInputClient, xn as PluginFieldAttribute, yn as InferFieldsOutput } 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
  export * from "@gatwech/core/db";
7
7
  export { FieldAttributeToObject, FieldAttributeToSchema, InferAdditionalFieldsFromPluginOptions, InferFieldsFromOptions, InferFieldsFromPlugins, InferFieldsInput, InferFieldsInputClient, InferFieldsOutput, InferValueType, PluginFieldAttribute, convertFromDB, convertToDB, createFieldAttribute, createInternalAdapter, getAdapter, getAuthTables, getMigrations, getSchema, getWithHooks, matchType, mergeSchema, parseAccountInput, parseAccountOutput, parseAdditionalUserInput, parseInputData, parseSessionInput, parseSessionOutput, parseUserInput, parseUserOutput, toZodSchema };
package/dist/db/index.mjs CHANGED
@@ -5,7 +5,7 @@ import "../crypto-CCyta8xj.mjs";
5
5
  import "../jwt-CmxZAGe2.mjs";
6
6
  import "../random-32E3cU5o.mjs";
7
7
  import { a as parseAdditionalUserInput, c as parseSessionOutput, i as parseAccountOutput, l as parseUserInput, n as mergeSchema, o as parseInputData, r as parseAccountInput, s as parseSessionInput, u as parseUserOutput } from "../date-CMr04reD.mjs";
8
- import { a as createInternalAdapter, c as matchType, i as toZodSchema, l as getSchema, n as convertToDB, o as getWithHooks, r as getAdapter, s as getMigrations, t as convertFromDB, u as createFieldAttribute } from "../db-7vHnL1XA.mjs";
8
+ import { a as createInternalAdapter, c as matchType, i as toZodSchema, l as getSchema, n as convertToDB, o as getWithHooks, r as getAdapter, s as getMigrations, t as convertFromDB, u as createFieldAttribute } from "../db-CV59HpEF.mjs";
9
9
  import "../dialect-HsWUfpYY.mjs";
10
10
  import { t as getAuthTables } from "../get-tables-CKvSyDST.mjs";
11
11
  import "../types-DCPpFKUB.mjs";
@@ -384,7 +384,7 @@ function getWithHooks(adapter, ctx) {
384
384
  }) : customUpdated;
385
385
  for (const hook of hooks || []) {
386
386
  const toRun = hook[model]?.update?.after;
387
- if (toRun) await toRun(updated, context);
387
+ if (toRun) await toRun(updated, context, actualData);
388
388
  }
389
389
  return updated;
390
390
  }
@@ -410,7 +410,7 @@ function getWithHooks(adapter, ctx) {
410
410
  }) : customUpdated;
411
411
  for (const hook of hooks || []) {
412
412
  const toRun = hook[model]?.update?.after;
413
- if (toRun) await toRun(updated, context);
413
+ if (toRun) await toRun(updated, context, actualData);
414
414
  }
415
415
  return updated;
416
416
  }
@@ -1,5 +1,5 @@
1
1
  import { t as InferOptionSchema } from "./plugins-Dy_FrD4Y.mjs";
2
- import * as better_call43 from "better-call";
2
+ import * as better_call192 from "better-call";
3
3
  import * as z$1 from "zod";
4
4
  import * as _simplewebauthn_server0 from "@simplewebauthn/server";
5
5
  import { AuthenticationResponseJSON, CredentialDeviceType, PublicKeyCredentialCreationOptionsJSON } from "@simplewebauthn/server";
@@ -139,7 +139,7 @@ declare const passkey: (options?: PasskeyOptions | undefined) => {
139
139
  } & {
140
140
  asResponse?: boolean;
141
141
  returnHeaders?: boolean;
142
- use?: better_call43.Middleware[];
142
+ use?: better_call192.Middleware[];
143
143
  path?: string;
144
144
  } & {
145
145
  asResponse?: AsResponse | undefined;
@@ -150,7 +150,7 @@ declare const passkey: (options?: PasskeyOptions | undefined) => {
150
150
  } : PublicKeyCredentialCreationOptionsJSON>;
151
151
  options: {
152
152
  method: "GET";
153
- use: ((inputContext: better_call43.MiddlewareInputContext<better_call43.MiddlewareOptions>) => Promise<{
153
+ use: ((inputContext: better_call192.MiddlewareInputContext<better_call192.MiddlewareOptions>) => Promise<{
154
154
  session: {
155
155
  session: Record<string, any> & {
156
156
  id: string;
@@ -318,7 +318,7 @@ declare const passkey: (options?: PasskeyOptions | undefined) => {
318
318
  } & {
319
319
  asResponse?: boolean;
320
320
  returnHeaders?: boolean;
321
- use?: better_call43.Middleware[];
321
+ use?: better_call192.Middleware[];
322
322
  path?: string;
323
323
  } & {
324
324
  asResponse?: AsResponse | undefined;
@@ -443,7 +443,7 @@ declare const passkey: (options?: PasskeyOptions | undefined) => {
443
443
  } & {
444
444
  asResponse?: boolean;
445
445
  returnHeaders?: boolean;
446
- use?: better_call43.Middleware[];
446
+ use?: better_call192.Middleware[];
447
447
  path?: string;
448
448
  } & {
449
449
  asResponse?: AsResponse | undefined;
@@ -458,7 +458,7 @@ declare const passkey: (options?: PasskeyOptions | undefined) => {
458
458
  response: z$1.ZodAny;
459
459
  name: z$1.ZodOptional<z$1.ZodString>;
460
460
  }, z$1.core.$strip>;
461
- use: ((inputContext: better_call43.MiddlewareInputContext<better_call43.MiddlewareOptions>) => Promise<{
461
+ use: ((inputContext: better_call192.MiddlewareInputContext<better_call192.MiddlewareOptions>) => Promise<{
462
462
  session: {
463
463
  session: Record<string, any> & {
464
464
  id: string;
@@ -524,7 +524,7 @@ declare const passkey: (options?: PasskeyOptions | undefined) => {
524
524
  } & {
525
525
  asResponse?: boolean;
526
526
  returnHeaders?: boolean;
527
- use?: better_call43.Middleware[];
527
+ use?: better_call192.Middleware[];
528
528
  path?: string;
529
529
  } & {
530
530
  asResponse?: AsResponse | undefined;
@@ -626,7 +626,7 @@ declare const passkey: (options?: PasskeyOptions | undefined) => {
626
626
  } & {
627
627
  asResponse?: boolean;
628
628
  returnHeaders?: boolean;
629
- use?: better_call43.Middleware[];
629
+ use?: better_call192.Middleware[];
630
630
  path?: string;
631
631
  } & {
632
632
  asResponse?: AsResponse | undefined;
@@ -637,7 +637,7 @@ declare const passkey: (options?: PasskeyOptions | undefined) => {
637
637
  } : Passkey[]>;
638
638
  options: {
639
639
  method: "GET";
640
- use: ((inputContext: better_call43.MiddlewareInputContext<better_call43.MiddlewareOptions>) => Promise<{
640
+ use: ((inputContext: better_call192.MiddlewareInputContext<better_call192.MiddlewareOptions>) => Promise<{
641
641
  session: {
642
642
  session: Record<string, any> & {
643
643
  id: string;
@@ -720,7 +720,7 @@ declare const passkey: (options?: PasskeyOptions | undefined) => {
720
720
  } & {
721
721
  asResponse?: boolean;
722
722
  returnHeaders?: boolean;
723
- use?: better_call43.Middleware[];
723
+ use?: better_call192.Middleware[];
724
724
  path?: string;
725
725
  } & {
726
726
  asResponse?: AsResponse | undefined;
@@ -734,7 +734,7 @@ declare const passkey: (options?: PasskeyOptions | undefined) => {
734
734
  body: z$1.ZodObject<{
735
735
  id: z$1.ZodString;
736
736
  }, z$1.core.$strip>;
737
- use: ((inputContext: better_call43.MiddlewareInputContext<better_call43.MiddlewareOptions>) => Promise<{
737
+ use: ((inputContext: better_call192.MiddlewareInputContext<better_call192.MiddlewareOptions>) => Promise<{
738
738
  session: {
739
739
  session: Record<string, any> & {
740
740
  id: string;
@@ -820,7 +820,7 @@ declare const passkey: (options?: PasskeyOptions | undefined) => {
820
820
  } & {
821
821
  asResponse?: boolean;
822
822
  returnHeaders?: boolean;
823
- use?: better_call43.Middleware[];
823
+ use?: better_call192.Middleware[];
824
824
  path?: string;
825
825
  } & {
826
826
  asResponse?: AsResponse | undefined;
@@ -839,7 +839,7 @@ declare const passkey: (options?: PasskeyOptions | undefined) => {
839
839
  id: z$1.ZodString;
840
840
  name: z$1.ZodString;
841
841
  }, z$1.core.$strip>;
842
- use: ((inputContext: better_call43.MiddlewareInputContext<better_call43.MiddlewareOptions>) => Promise<{
842
+ use: ((inputContext: better_call192.MiddlewareInputContext<better_call192.MiddlewareOptions>) => Promise<{
843
843
  session: {
844
844
  session: Record<string, any> & {
845
845
  id: string;