better-auth 0.7.2-beta.4 → 0.7.2-beta.5

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 (55) hide show
  1. package/dist/adapters/drizzle.d.cts +2 -2
  2. package/dist/adapters/drizzle.d.ts +2 -2
  3. package/dist/adapters/kysely.d.cts +2 -2
  4. package/dist/adapters/kysely.d.ts +2 -2
  5. package/dist/adapters/mongodb.cjs +1 -1
  6. package/dist/adapters/mongodb.d.cts +2 -2
  7. package/dist/adapters/mongodb.d.ts +2 -2
  8. package/dist/adapters/mongodb.js +1 -1
  9. package/dist/adapters/prisma.d.cts +2 -2
  10. package/dist/adapters/prisma.d.ts +2 -2
  11. package/dist/api.d.cts +2 -2
  12. package/dist/api.d.ts +2 -2
  13. package/dist/{auth-BYO4oVzl.d.cts → auth-Dmar8nso.d.ts} +55 -55
  14. package/dist/{auth-Dhq27-3h.d.ts → auth-OD4ZDXz2.d.cts} +55 -55
  15. package/dist/client/plugins.d.cts +4 -4
  16. package/dist/client/plugins.d.ts +4 -4
  17. package/dist/client.d.cts +2 -2
  18. package/dist/client.d.ts +2 -2
  19. package/dist/cookies.d.cts +2 -2
  20. package/dist/cookies.d.ts +2 -2
  21. package/dist/db.d.cts +3 -3
  22. package/dist/db.d.ts +3 -3
  23. package/dist/{index-CoWW39cW.d.ts → index-BX5IvEjE.d.cts} +8 -9
  24. package/dist/{index-D2xgatRc.d.cts → index-BXrPCVYF.d.ts} +8 -9
  25. package/dist/index.d.cts +3 -3
  26. package/dist/index.d.ts +3 -3
  27. package/dist/node.d.cts +2 -2
  28. package/dist/node.d.ts +2 -2
  29. package/dist/oauth2.d.cts +4 -4
  30. package/dist/oauth2.d.ts +4 -4
  31. package/dist/plugins.cjs +1 -1
  32. package/dist/plugins.d.cts +4 -4
  33. package/dist/plugins.d.ts +4 -4
  34. package/dist/plugins.js +1 -1
  35. package/dist/react.d.cts +2 -2
  36. package/dist/react.d.ts +2 -2
  37. package/dist/social.d.cts +1 -1
  38. package/dist/social.d.ts +1 -1
  39. package/dist/solid-start.d.cts +2 -2
  40. package/dist/solid-start.d.ts +2 -2
  41. package/dist/solid.d.cts +2 -2
  42. package/dist/solid.d.ts +2 -2
  43. package/dist/{state-DKkih1Nb.d.ts → state-BsZ0OxLG.d.ts} +1 -1
  44. package/dist/{state-B5cXxYBw.d.cts → state-R6SxX42I.d.cts} +1 -1
  45. package/dist/svelte-kit.d.cts +2 -2
  46. package/dist/svelte-kit.d.ts +2 -2
  47. package/dist/svelte.d.cts +2 -2
  48. package/dist/svelte.d.ts +2 -2
  49. package/dist/types.d.cts +4 -4
  50. package/dist/types.d.ts +4 -4
  51. package/dist/vue.d.cts +2 -2
  52. package/dist/vue.d.ts +2 -2
  53. package/package.json +1 -1
  54. package/dist/{index-DUqGSAH3.d.cts → index-DGElGUbq.d.cts} +4 -4
  55. package/dist/{index-DUqGSAH3.d.ts → index-DGElGUbq.d.ts} +4 -4
@@ -1,8 +1,8 @@
1
- import { A as Adapter } from '../auth-BYO4oVzl.cjs';
1
+ import { A as Adapter } from '../auth-OD4ZDXz2.cjs';
2
2
  import 'node_modules/better-call/dist/router-Bn7zn81P';
3
3
  import 'zod';
4
4
  import 'kysely';
5
- import '../index-DUqGSAH3.cjs';
5
+ import '../index-DGElGUbq.cjs';
6
6
  import 'better-call';
7
7
  import 'better-sqlite3';
8
8
 
@@ -1,8 +1,8 @@
1
- import { A as Adapter } from '../auth-Dhq27-3h.js';
1
+ import { A as Adapter } from '../auth-Dmar8nso.js';
2
2
  import 'node_modules/better-call/dist/router-Bn7zn81P';
3
3
  import 'zod';
4
4
  import 'kysely';
5
- import '../index-DUqGSAH3.js';
5
+ import '../index-DGElGUbq.js';
6
6
  import 'better-call';
7
7
  import 'better-sqlite3';
8
8
 
@@ -1,8 +1,8 @@
1
1
  import { Kysely } from 'kysely';
2
- import { e as BetterAuthOptions, K as KyselyDatabaseType, F as FieldAttribute, A as Adapter } from '../auth-BYO4oVzl.cjs';
2
+ import { e as BetterAuthOptions, K as KyselyDatabaseType, F as FieldAttribute, A as Adapter } from '../auth-OD4ZDXz2.cjs';
3
3
  import 'node_modules/better-call/dist/router-Bn7zn81P';
4
4
  import 'zod';
5
- import '../index-DUqGSAH3.cjs';
5
+ import '../index-DGElGUbq.cjs';
6
6
  import 'better-call';
7
7
  import 'better-sqlite3';
8
8
 
@@ -1,8 +1,8 @@
1
1
  import { Kysely } from 'kysely';
2
- import { e as BetterAuthOptions, K as KyselyDatabaseType, F as FieldAttribute, A as Adapter } from '../auth-Dhq27-3h.js';
2
+ import { e as BetterAuthOptions, K as KyselyDatabaseType, F as FieldAttribute, A as Adapter } from '../auth-Dmar8nso.js';
3
3
  import 'node_modules/better-call/dist/router-Bn7zn81P';
4
4
  import 'zod';
5
- import '../index-DUqGSAH3.js';
5
+ import '../index-DGElGUbq.js';
6
6
  import 'better-call';
7
7
  import 'better-sqlite3';
8
8
 
@@ -1 +1 @@
1
- "use strict";var h=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var $=Object.prototype.hasOwnProperty;var b=(c,r)=>{for(var i in r)h(c,i,{get:r[i],enumerable:!0})},A=(c,r,i,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of m(r))!$.call(c,o)&&o!==i&&h(c,o,{get:()=>r[o],enumerable:!(a=g(r,o))||a.enumerable});return c};var k=c=>A(h({},"__esModule",{value:!0}),c);var D={};b(D,{mongodbAdapter:()=>O});module.exports=k(D);var p=require("mongodb");function w(c){if(!c)return{};function r(e){return e==="id"?"_id":e}function i(e,t){if(e==="id"){if(typeof t!="string"){if(t instanceof p.ObjectId)return t;if(Array.isArray(t))return t.map(n=>{if(typeof n=="string")try{return new p.ObjectId(n)}catch{return n}if(n instanceof p.ObjectId)return n;throw new Error("Invalid id value")});throw new Error("Invalid id value")}try{return new p.ObjectId(t)}catch{return t}}return t}let a=c.map(e=>{let{field:t,value:n,operator:u="eq",connector:f="AND"}=e,l;switch(u.toLowerCase()){case"eq":l={[r(t)]:i(t,n)};break;case"in":l={[r(t)]:{$in:Array.isArray(n)?i(t,n):[i(t,n)]}};break;case"gt":l={[r(t)]:{$gt:n}};break;case"gte":l={[r(t)]:{$gte:n}};break;case"lt":l={[r(t)]:{$lt:n}};break;case"lte":l={[r(t)]:{$lte:n}};break;case"ne":l={[r(t)]:{$ne:n}};break;case"contains":l={[r(t)]:{$regex:`.*${n}.*`}};break;case"starts_with":l={[r(t)]:{$regex:`${n}.*`}};break;case"ends_with":l={[r(t)]:{$regex:`.*${n}`}};break;default:throw new Error(`Unsupported operator: ${u}`)}return{condition:l,connector:f}}),o=a.filter(e=>e.connector==="AND").map(e=>e.condition),d=a.filter(e=>e.connector==="OR").map(e=>e.condition),s={};return o.length&&(s={...s,$and:o}),d.length&&(s={...s,$or:d}),s}function y(c){let{_id:r,...i}=c;return{...i,id:r}}function C(c){return c.reduce((i,a)=>(i[a]=1,i),{})}var O=(c,r)=>{let i=c,a=o=>r?.usePlural?`${o}s`:o;return{id:"mongodb",async create(o){let{model:d,data:s}=o;s.id&&(s.id=void 0);let t=(await i.collection(a(d)).insertOne(s)).insertedId,n={...s,id:t};return y(n)},async findOne(o){let{model:d,where:s,select:e}=o,t=w(s),n={};e&&(n=C(e));let u=await i.collection(a(d)).findOne(t,{projection:n});if(!u)return null;let f=y(u);return e?.length&&!e.includes("id")&&(f.id=void 0),f},async findMany(o){let{model:d,where:s,limit:e,offset:t,sortBy:n}=o,u=w(s);return(await i.collection(a(d)).find(u).skip(t||0).limit(e||100).sort(n?.field||"_id",n?.direction==="desc"?-1:1).toArray()).map(y)},async update(o){let{model:d,where:s,update:e}=o,t=w(s);if(e.id&&delete e.id,s.length===1){let n=await i.collection(a(d)).findOneAndUpdate(t,{$set:e},{returnDocument:"after"});return y(n)}return await i.collection(a(d)).updateMany(t,{$set:e}),{}},async delete(o){let{model:d,where:s}=o,e=w(s);await i.collection(a(d)).findOneAndDelete(e)},async deleteMany(o){let{model:d,where:s}=o,e=w(s);await i.collection(a(d)).deleteMany(e)}}};0&&(module.exports={mongodbAdapter});
1
+ "use strict";var h=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var $=Object.prototype.hasOwnProperty;var b=(c,r)=>{for(var i in r)h(c,i,{get:r[i],enumerable:!0})},A=(c,r,i,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of m(r))!$.call(c,o)&&o!==i&&h(c,o,{get:()=>r[o],enumerable:!(a=g(r,o))||a.enumerable});return c};var k=c=>A(h({},"__esModule",{value:!0}),c);var D={};b(D,{mongodbAdapter:()=>O});module.exports=k(D);var p=require("mongodb");function w(c){if(!c)return{};function r(e){return e==="id"?"_id":e}function i(e,t){if(e==="id"){if(typeof t!="string"){if(t instanceof p.ObjectId)return t;if(Array.isArray(t))return t.map(n=>{if(typeof n=="string")try{return new p.ObjectId(n)}catch{return n}if(n instanceof p.ObjectId)return n;throw new Error("Invalid id value")});throw new Error("Invalid id value")}try{return new p.ObjectId(t)}catch{return t}}return t}let a=c.map(e=>{let{field:t,value:n,operator:u="eq",connector:f="AND"}=e,l;switch(u.toLowerCase()){case"eq":l={[r(t)]:i(t,n)};break;case"in":l={[r(t)]:{$in:Array.isArray(n)?i(t,n):[i(t,n)]}};break;case"gt":l={[r(t)]:{$gt:n}};break;case"gte":l={[r(t)]:{$gte:n}};break;case"lt":l={[r(t)]:{$lt:n}};break;case"lte":l={[r(t)]:{$lte:n}};break;case"ne":l={[r(t)]:{$ne:n}};break;case"contains":l={[r(t)]:{$regex:`.*${n}.*`}};break;case"starts_with":l={[r(t)]:{$regex:`${n}.*`}};break;case"ends_with":l={[r(t)]:{$regex:`.*${n}`}};break;default:throw new Error(`Unsupported operator: ${u}`)}return{condition:l,connector:f}}),o=a.filter(e=>e.connector==="AND").map(e=>e.condition),d=a.filter(e=>e.connector==="OR").map(e=>e.condition),s={};return o.length&&(s={...s,$and:o}),d.length&&(s={...s,$or:d}),s}function y(c){let{_id:r,...i}=c;return{...i,id:r}}function C(c){return c.reduce((i,a)=>(i[a]=1,i),{})}var O=(c,r)=>{let i=c,a=o=>r?.usePlural?`${o}s`:o;return{id:"mongodb",async create(o){let{model:d,data:s}=o;s.id&&delete s.id;let t=(await i.collection(a(d)).insertOne(s)).insertedId,n={...s,id:t};return y(n)},async findOne(o){let{model:d,where:s,select:e}=o,t=w(s),n={};e&&(n=C(e));let u=await i.collection(a(d)).findOne(t,{projection:n});if(!u)return null;let f=y(u);return e?.length&&!e.includes("id")&&(f.id=void 0),f},async findMany(o){let{model:d,where:s,limit:e,offset:t,sortBy:n}=o,u=w(s);return(await i.collection(a(d)).find(u).skip(t||0).limit(e||100).sort(n?.field||"_id",n?.direction==="desc"?-1:1).toArray()).map(y)},async update(o){let{model:d,where:s,update:e}=o,t=w(s);if(e.id&&delete e.id,s.length===1){let n=await i.collection(a(d)).findOneAndUpdate(t,{$set:e},{returnDocument:"after"});return y(n)}return await i.collection(a(d)).updateMany(t,{$set:e}),{}},async delete(o){let{model:d,where:s}=o,e=w(s);await i.collection(a(d)).findOneAndDelete(e)},async deleteMany(o){let{model:d,where:s}=o,e=w(s);await i.collection(a(d)).deleteMany(e)}}};0&&(module.exports={mongodbAdapter});
@@ -3,11 +3,11 @@ import { EventEmitter } from 'events';
3
3
  import { TcpNetConnectOpts } from 'net';
4
4
  import { Readable } from 'stream';
5
5
  import { ConnectionOptions as ConnectionOptions$1, TLSSocketOptions } from 'tls';
6
- import { W as Where } from '../auth-BYO4oVzl.cjs';
6
+ import { W as Where } from '../auth-OD4ZDXz2.cjs';
7
7
  import 'node_modules/better-call/dist/router-Bn7zn81P';
8
8
  import 'zod';
9
9
  import 'kysely';
10
- import '../index-DUqGSAH3.cjs';
10
+ import '../index-DGElGUbq.cjs';
11
11
  import 'better-call';
12
12
  import 'better-sqlite3';
13
13
 
@@ -3,11 +3,11 @@ import { EventEmitter } from 'events';
3
3
  import { TcpNetConnectOpts } from 'net';
4
4
  import { Readable } from 'stream';
5
5
  import { ConnectionOptions as ConnectionOptions$1, TLSSocketOptions } from 'tls';
6
- import { W as Where } from '../auth-Dhq27-3h.js';
6
+ import { W as Where } from '../auth-Dmar8nso.js';
7
7
  import 'node_modules/better-call/dist/router-Bn7zn81P';
8
8
  import 'zod';
9
9
  import 'kysely';
10
- import '../index-DUqGSAH3.js';
10
+ import '../index-DGElGUbq.js';
11
11
  import 'better-call';
12
12
  import 'better-sqlite3';
13
13
 
@@ -1 +1 @@
1
- import{ObjectId as p}from"mongodb";function w(l){if(!l)return{};function s(e){return e==="id"?"_id":e}function i(e,t){if(e==="id"){if(typeof t!="string"){if(t instanceof p)return t;if(Array.isArray(t))return t.map(n=>{if(typeof n=="string")try{return new p(n)}catch{return n}if(n instanceof p)return n;throw new Error("Invalid id value")});throw new Error("Invalid id value")}try{return new p(t)}catch{return t}}return t}let a=l.map(e=>{let{field:t,value:n,operator:u="eq",connector:f="AND"}=e,d;switch(u.toLowerCase()){case"eq":d={[s(t)]:i(t,n)};break;case"in":d={[s(t)]:{$in:Array.isArray(n)?i(t,n):[i(t,n)]}};break;case"gt":d={[s(t)]:{$gt:n}};break;case"gte":d={[s(t)]:{$gte:n}};break;case"lt":d={[s(t)]:{$lt:n}};break;case"lte":d={[s(t)]:{$lte:n}};break;case"ne":d={[s(t)]:{$ne:n}};break;case"contains":d={[s(t)]:{$regex:`.*${n}.*`}};break;case"starts_with":d={[s(t)]:{$regex:`${n}.*`}};break;case"ends_with":d={[s(t)]:{$regex:`.*${n}`}};break;default:throw new Error(`Unsupported operator: ${u}`)}return{condition:d,connector:f}}),o=a.filter(e=>e.connector==="AND").map(e=>e.condition),c=a.filter(e=>e.connector==="OR").map(e=>e.condition),r={};return o.length&&(r={...r,$and:o}),c.length&&(r={...r,$or:c}),r}function y(l){let{_id:s,...i}=l;return{...i,id:s}}function h(l){return l.reduce((i,a)=>(i[a]=1,i),{})}var m=(l,s)=>{let i=l,a=o=>s?.usePlural?`${o}s`:o;return{id:"mongodb",async create(o){let{model:c,data:r}=o;r.id&&(r.id=void 0);let t=(await i.collection(a(c)).insertOne(r)).insertedId,n={...r,id:t};return y(n)},async findOne(o){let{model:c,where:r,select:e}=o,t=w(r),n={};e&&(n=h(e));let u=await i.collection(a(c)).findOne(t,{projection:n});if(!u)return null;let f=y(u);return e?.length&&!e.includes("id")&&(f.id=void 0),f},async findMany(o){let{model:c,where:r,limit:e,offset:t,sortBy:n}=o,u=w(r);return(await i.collection(a(c)).find(u).skip(t||0).limit(e||100).sort(n?.field||"_id",n?.direction==="desc"?-1:1).toArray()).map(y)},async update(o){let{model:c,where:r,update:e}=o,t=w(r);if(e.id&&delete e.id,r.length===1){let n=await i.collection(a(c)).findOneAndUpdate(t,{$set:e},{returnDocument:"after"});return y(n)}return await i.collection(a(c)).updateMany(t,{$set:e}),{}},async delete(o){let{model:c,where:r}=o,e=w(r);await i.collection(a(c)).findOneAndDelete(e)},async deleteMany(o){let{model:c,where:r}=o,e=w(r);await i.collection(a(c)).deleteMany(e)}}};export{m as mongodbAdapter};
1
+ import{ObjectId as p}from"mongodb";function w(l){if(!l)return{};function s(e){return e==="id"?"_id":e}function i(e,t){if(e==="id"){if(typeof t!="string"){if(t instanceof p)return t;if(Array.isArray(t))return t.map(n=>{if(typeof n=="string")try{return new p(n)}catch{return n}if(n instanceof p)return n;throw new Error("Invalid id value")});throw new Error("Invalid id value")}try{return new p(t)}catch{return t}}return t}let a=l.map(e=>{let{field:t,value:n,operator:u="eq",connector:f="AND"}=e,d;switch(u.toLowerCase()){case"eq":d={[s(t)]:i(t,n)};break;case"in":d={[s(t)]:{$in:Array.isArray(n)?i(t,n):[i(t,n)]}};break;case"gt":d={[s(t)]:{$gt:n}};break;case"gte":d={[s(t)]:{$gte:n}};break;case"lt":d={[s(t)]:{$lt:n}};break;case"lte":d={[s(t)]:{$lte:n}};break;case"ne":d={[s(t)]:{$ne:n}};break;case"contains":d={[s(t)]:{$regex:`.*${n}.*`}};break;case"starts_with":d={[s(t)]:{$regex:`${n}.*`}};break;case"ends_with":d={[s(t)]:{$regex:`.*${n}`}};break;default:throw new Error(`Unsupported operator: ${u}`)}return{condition:d,connector:f}}),o=a.filter(e=>e.connector==="AND").map(e=>e.condition),c=a.filter(e=>e.connector==="OR").map(e=>e.condition),r={};return o.length&&(r={...r,$and:o}),c.length&&(r={...r,$or:c}),r}function y(l){let{_id:s,...i}=l;return{...i,id:s}}function h(l){return l.reduce((i,a)=>(i[a]=1,i),{})}var m=(l,s)=>{let i=l,a=o=>s?.usePlural?`${o}s`:o;return{id:"mongodb",async create(o){let{model:c,data:r}=o;r.id&&delete r.id;let t=(await i.collection(a(c)).insertOne(r)).insertedId,n={...r,id:t};return y(n)},async findOne(o){let{model:c,where:r,select:e}=o,t=w(r),n={};e&&(n=h(e));let u=await i.collection(a(c)).findOne(t,{projection:n});if(!u)return null;let f=y(u);return e?.length&&!e.includes("id")&&(f.id=void 0),f},async findMany(o){let{model:c,where:r,limit:e,offset:t,sortBy:n}=o,u=w(r);return(await i.collection(a(c)).find(u).skip(t||0).limit(e||100).sort(n?.field||"_id",n?.direction==="desc"?-1:1).toArray()).map(y)},async update(o){let{model:c,where:r,update:e}=o,t=w(r);if(e.id&&delete e.id,r.length===1){let n=await i.collection(a(c)).findOneAndUpdate(t,{$set:e},{returnDocument:"after"});return y(n)}return await i.collection(a(c)).updateMany(t,{$set:e}),{}},async delete(o){let{model:c,where:r}=o,e=w(r);await i.collection(a(c)).findOneAndDelete(e)},async deleteMany(o){let{model:c,where:r}=o,e=w(r);await i.collection(a(c)).deleteMany(e)}}};export{m as mongodbAdapter};
@@ -1,8 +1,8 @@
1
- import { A as Adapter } from '../auth-BYO4oVzl.cjs';
1
+ import { A as Adapter } from '../auth-OD4ZDXz2.cjs';
2
2
  import 'node_modules/better-call/dist/router-Bn7zn81P';
3
3
  import 'zod';
4
4
  import 'kysely';
5
- import '../index-DUqGSAH3.cjs';
5
+ import '../index-DGElGUbq.cjs';
6
6
  import 'better-call';
7
7
  import 'better-sqlite3';
8
8
 
@@ -1,8 +1,8 @@
1
- import { A as Adapter } from '../auth-Dhq27-3h.js';
1
+ import { A as Adapter } from '../auth-Dmar8nso.js';
2
2
  import 'node_modules/better-call/dist/router-Bn7zn81P';
3
3
  import 'zod';
4
4
  import 'kysely';
5
- import '../index-DUqGSAH3.js';
5
+ import '../index-DGElGUbq.js';
6
6
  import 'better-call';
7
7
  import 'better-sqlite3';
8
8
 
package/dist/api.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'node_modules/better-call/dist/router-Bn7zn81P';
2
- export { b as AuthEndpoint, d as AuthMiddleware, a1 as callbackOAuth, aj as changeEmail, ag as changePassword, a as createAuthEndpoint, c as createAuthMiddleware, ac as createEmailVerificationToken, ai as deleteUser, ak as error, a9 as forgetPassword, aa as forgetPasswordCallback, Z as getEndpoints, a2 as getSession, a3 as getSessionFromCtx, ao as linkSocialAccount, a5 as listSessions, an as listUserAccounts, al as ok, o as optionsMiddleware, ap as originCheckMiddleware, ab as resetPassword, a6 as revokeSession, a7 as revokeSessions, _ as router, ad as sendVerificationEmail, a4 as sessionMiddleware, ah as setPassword, a0 as signInEmail, $ as signInOAuth, a8 as signOut, am as signUpEmail, af as updateUser, ae as verifyEmail } from './auth-BYO4oVzl.cjs';
3
- import './index-DUqGSAH3.cjs';
2
+ export { b as AuthEndpoint, d as AuthMiddleware, a1 as callbackOAuth, aj as changeEmail, ag as changePassword, a as createAuthEndpoint, c as createAuthMiddleware, ac as createEmailVerificationToken, ai as deleteUser, ak as error, a9 as forgetPassword, aa as forgetPasswordCallback, Z as getEndpoints, a2 as getSession, a3 as getSessionFromCtx, ao as linkSocialAccount, a5 as listSessions, an as listUserAccounts, al as ok, o as optionsMiddleware, ap as originCheckMiddleware, ab as resetPassword, a6 as revokeSession, a7 as revokeSessions, _ as router, ad as sendVerificationEmail, a4 as sessionMiddleware, ah as setPassword, a0 as signInEmail, $ as signInOAuth, a8 as signOut, am as signUpEmail, af as updateUser, ae as verifyEmail } from './auth-OD4ZDXz2.cjs';
3
+ import './index-DGElGUbq.cjs';
4
4
  export { APIError } from 'better-call';
5
5
  import 'zod';
6
6
  import 'kysely';
package/dist/api.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'node_modules/better-call/dist/router-Bn7zn81P';
2
- export { b as AuthEndpoint, d as AuthMiddleware, a1 as callbackOAuth, aj as changeEmail, ag as changePassword, a as createAuthEndpoint, c as createAuthMiddleware, ac as createEmailVerificationToken, ai as deleteUser, ak as error, a9 as forgetPassword, aa as forgetPasswordCallback, Z as getEndpoints, a2 as getSession, a3 as getSessionFromCtx, ao as linkSocialAccount, a5 as listSessions, an as listUserAccounts, al as ok, o as optionsMiddleware, ap as originCheckMiddleware, ab as resetPassword, a6 as revokeSession, a7 as revokeSessions, _ as router, ad as sendVerificationEmail, a4 as sessionMiddleware, ah as setPassword, a0 as signInEmail, $ as signInOAuth, a8 as signOut, am as signUpEmail, af as updateUser, ae as verifyEmail } from './auth-Dhq27-3h.js';
3
- import './index-DUqGSAH3.js';
2
+ export { b as AuthEndpoint, d as AuthMiddleware, a1 as callbackOAuth, aj as changeEmail, ag as changePassword, a as createAuthEndpoint, c as createAuthMiddleware, ac as createEmailVerificationToken, ai as deleteUser, ak as error, a9 as forgetPassword, aa as forgetPasswordCallback, Z as getEndpoints, a2 as getSession, a3 as getSessionFromCtx, ao as linkSocialAccount, a5 as listSessions, an as listUserAccounts, al as ok, o as optionsMiddleware, ap as originCheckMiddleware, ab as resetPassword, a6 as revokeSession, a7 as revokeSessions, _ as router, ad as sendVerificationEmail, a4 as sessionMiddleware, ah as setPassword, a0 as signInEmail, $ as signInOAuth, a8 as signOut, am as signUpEmail, af as updateUser, ae as verifyEmail } from './auth-Dmar8nso.js';
3
+ import './index-DGElGUbq.js';
4
4
  export { APIError } from 'better-call';
5
5
  import 'zod';
6
6
  import 'kysely';
@@ -2,7 +2,7 @@ import * as node_modules_better_call_dist_router_Bn7zn81P from 'node_modules/bet
2
2
  import * as zod from 'zod';
3
3
  import { ZodSchema, z, ZodObject, ZodOptional, ZodString } from 'zod';
4
4
  import { Kysely, Migration, PostgresPool, MysqlPool, Dialect } from 'kysely';
5
- import { a as User, A as Account, S as Session, V as Verification, e as OAuthProvider, L as LiteralString, D as DeepPartial, U as UnionToIntersection, c as StripEmptyObjects, f as SocialProviders, g as SocialProviderList, P as Prettify } from './index-DUqGSAH3.cjs';
5
+ import { a as User, A as Account, S as Session, V as Verification, e as OAuthProvider, L as LiteralString, D as DeepPartial, U as UnionToIntersection, c as StripEmptyObjects, f as SocialProviders, g as SocialProviderList, P as Prettify } from './index-DGElGUbq.js';
6
6
  import * as better_call from 'better-call';
7
7
  import { ContextTools, CookieOptions, Endpoint, EndpointResponse, Context, Prettify as Prettify$1 } from 'better-call';
8
8
  import { Database } from 'better-sqlite3';
@@ -143,13 +143,13 @@ declare const createInternalAdapter: (adapter: Adapter, ctx: {
143
143
  }>;
144
144
  createAccount: <T>(account: Omit<Account, "id" | "createdAt" | "updatedAt"> & Partial<Account> & Record<string, any>) => Promise<T & {
145
145
  id: string;
146
+ userId: string;
146
147
  providerId: string;
147
148
  accountId: string;
148
- userId: string;
149
+ expiresAt?: Date | null | undefined;
149
150
  accessToken?: string | null | undefined;
150
151
  refreshToken?: string | null | undefined;
151
152
  idToken?: string | null | undefined;
152
- expiresAt?: Date | null | undefined;
153
153
  password?: string | null | undefined;
154
154
  }>;
155
155
  listSessions: (userId: string) => Promise<{
@@ -204,13 +204,13 @@ declare const createInternalAdapter: (adapter: Adapter, ctx: {
204
204
  };
205
205
  accounts: {
206
206
  id: string;
207
+ userId: string;
207
208
  providerId: string;
208
209
  accountId: string;
209
- userId: string;
210
+ expiresAt?: Date | null | undefined;
210
211
  accessToken?: string | null | undefined;
211
212
  refreshToken?: string | null | undefined;
212
213
  idToken?: string | null | undefined;
213
- expiresAt?: Date | null | undefined;
214
214
  password?: string | null | undefined;
215
215
  }[];
216
216
  } | null>;
@@ -229,13 +229,13 @@ declare const createInternalAdapter: (adapter: Adapter, ctx: {
229
229
  updatePassword: (userId: string, password: string) => Promise<any>;
230
230
  findAccounts: (userId: string) => Promise<{
231
231
  id: string;
232
+ userId: string;
232
233
  providerId: string;
233
234
  accountId: string;
234
- userId: string;
235
+ expiresAt?: Date | null | undefined;
235
236
  accessToken?: string | null | undefined;
236
237
  refreshToken?: string | null | undefined;
237
238
  idToken?: string | null | undefined;
238
- expiresAt?: Date | null | undefined;
239
239
  password?: string | null | undefined;
240
240
  }[]>;
241
241
  updateAccount: (accountId: string, data: Partial<Account>) => Promise<any>;
@@ -1358,13 +1358,13 @@ declare const signInEmail: {
1358
1358
  */
1359
1359
  dontRememberMe: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1360
1360
  }, "strip", z.ZodTypeAny, {
1361
- password: string;
1362
1361
  email: string;
1362
+ password: string;
1363
1363
  callbackURL?: string | undefined;
1364
1364
  dontRememberMe?: boolean | undefined;
1365
1365
  }, {
1366
- password: string;
1367
1366
  email: string;
1367
+ password: string;
1368
1368
  callbackURL?: string | undefined;
1369
1369
  dontRememberMe?: boolean | undefined;
1370
1370
  }>;
@@ -1403,13 +1403,13 @@ declare const signInEmail: {
1403
1403
  */
1404
1404
  dontRememberMe: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
1405
1405
  }, "strip", z.ZodTypeAny, {
1406
- password: string;
1407
1406
  email: string;
1407
+ password: string;
1408
1408
  callbackURL?: string | undefined;
1409
1409
  dontRememberMe?: boolean | undefined;
1410
1410
  }, {
1411
- password: string;
1412
1411
  email: string;
1412
+ password: string;
1413
1413
  callbackURL?: string | undefined;
1414
1414
  dontRememberMe?: boolean | undefined;
1415
1415
  }>;
@@ -2586,13 +2586,13 @@ declare const listUserAccounts: {
2586
2586
  asResponse: true;
2587
2587
  }] ? Response : {
2588
2588
  id: string;
2589
+ userId: string;
2589
2590
  providerId: string;
2590
2591
  accountId: string;
2591
- userId: string;
2592
+ expiresAt?: Date | null | undefined;
2592
2593
  accessToken?: string | null | undefined;
2593
2594
  refreshToken?: string | null | undefined;
2594
2595
  idToken?: string | null | undefined;
2595
- expiresAt?: Date | null | undefined;
2596
2596
  password?: string | null | undefined;
2597
2597
  }[]>;
2598
2598
  path: "/list-accounts";
@@ -2955,13 +2955,13 @@ declare function getEndpoints<C extends AuthContext, Option extends BetterAuthOp
2955
2955
  email: zod.ZodString;
2956
2956
  password: zod.ZodString;
2957
2957
  }, zod.UnknownKeysParam, zod.ZodTypeAny, {
2958
- password: string;
2959
2958
  email: string;
2960
2959
  name: string;
2961
- }, {
2962
2960
  password: string;
2961
+ }, {
2963
2962
  email: string;
2964
2963
  name: string;
2964
+ password: string;
2965
2965
  }> & toZod<AdditionalUserFieldsInput<Option>>;
2966
2966
  }>> extends true ? [better_call.Context<"/sign-up/email", {
2967
2967
  method: "POST";
@@ -2977,13 +2977,13 @@ declare function getEndpoints<C extends AuthContext, Option extends BetterAuthOp
2977
2977
  email: zod.ZodString;
2978
2978
  password: zod.ZodString;
2979
2979
  }, zod.UnknownKeysParam, zod.ZodTypeAny, {
2980
- password: string;
2981
2980
  email: string;
2982
2981
  name: string;
2983
- }, {
2984
2982
  password: string;
2983
+ }, {
2985
2984
  email: string;
2986
2985
  name: string;
2986
+ password: string;
2987
2987
  }> & toZod<AdditionalUserFieldsInput<Option>>;
2988
2988
  }>] : [(better_call.Context<"/sign-up/email", {
2989
2989
  method: "POST";
@@ -2999,13 +2999,13 @@ declare function getEndpoints<C extends AuthContext, Option extends BetterAuthOp
2999
2999
  email: zod.ZodString;
3000
3000
  password: zod.ZodString;
3001
3001
  }, zod.UnknownKeysParam, zod.ZodTypeAny, {
3002
- password: string;
3003
3002
  email: string;
3004
3003
  name: string;
3005
- }, {
3006
3004
  password: string;
3005
+ }, {
3007
3006
  email: string;
3008
3007
  name: string;
3008
+ password: string;
3009
3009
  }> & toZod<AdditionalUserFieldsInput<Option>>;
3010
3010
  }> | undefined)?]>(...ctx: C_1): Promise<C_1 extends [{
3011
3011
  asResponse: true;
@@ -3053,13 +3053,13 @@ declare function getEndpoints<C extends AuthContext, Option extends BetterAuthOp
3053
3053
  email: zod.ZodString;
3054
3054
  password: zod.ZodString;
3055
3055
  }, zod.UnknownKeysParam, zod.ZodTypeAny, {
3056
- password: string;
3057
3056
  email: string;
3058
3057
  name: string;
3059
- }, {
3060
3058
  password: string;
3059
+ }, {
3061
3060
  email: string;
3062
3061
  name: string;
3062
+ password: string;
3063
3063
  }> & toZod<AdditionalUserFieldsInput<Option>>;
3064
3064
  };
3065
3065
  method: better_call.Method | better_call.Method[];
@@ -3074,13 +3074,13 @@ declare function getEndpoints<C extends AuthContext, Option extends BetterAuthOp
3074
3074
  callbackURL: zod.ZodOptional<zod.ZodString>;
3075
3075
  dontRememberMe: zod.ZodOptional<zod.ZodDefault<zod.ZodBoolean>>;
3076
3076
  }, "strip", zod.ZodTypeAny, {
3077
- password: string;
3078
3077
  email: string;
3078
+ password: string;
3079
3079
  callbackURL?: string | undefined;
3080
3080
  dontRememberMe?: boolean | undefined;
3081
3081
  }, {
3082
- password: string;
3083
3082
  email: string;
3083
+ password: string;
3084
3084
  callbackURL?: string | undefined;
3085
3085
  dontRememberMe?: boolean | undefined;
3086
3086
  }>;
@@ -3115,13 +3115,13 @@ declare function getEndpoints<C extends AuthContext, Option extends BetterAuthOp
3115
3115
  callbackURL: zod.ZodOptional<zod.ZodString>;
3116
3116
  dontRememberMe: zod.ZodOptional<zod.ZodDefault<zod.ZodBoolean>>;
3117
3117
  }, "strip", zod.ZodTypeAny, {
3118
- password: string;
3119
3118
  email: string;
3119
+ password: string;
3120
3120
  callbackURL?: string | undefined;
3121
3121
  dontRememberMe?: boolean | undefined;
3122
3122
  }, {
3123
- password: string;
3124
3123
  email: string;
3124
+ password: string;
3125
3125
  callbackURL?: string | undefined;
3126
3126
  dontRememberMe?: boolean | undefined;
3127
3127
  }>;
@@ -4097,13 +4097,13 @@ declare function getEndpoints<C extends AuthContext, Option extends BetterAuthOp
4097
4097
  asResponse: true;
4098
4098
  }] ? Response : {
4099
4099
  id: string;
4100
+ userId: string;
4100
4101
  providerId: string;
4101
4102
  accountId: string;
4102
- userId: string;
4103
+ expiresAt?: Date | null | undefined;
4103
4104
  accessToken?: string | null | undefined;
4104
4105
  refreshToken?: string | null | undefined;
4105
4106
  idToken?: string | null | undefined;
4106
- expiresAt?: Date | null | undefined;
4107
4107
  password?: string | null | undefined;
4108
4108
  }[]>;
4109
4109
  path: "/list-accounts";
@@ -4357,13 +4357,13 @@ declare const router: <C extends AuthContext, Option extends BetterAuthOptions>(
4357
4357
  email: zod.ZodString;
4358
4358
  password: zod.ZodString;
4359
4359
  }, zod.UnknownKeysParam, zod.ZodTypeAny, {
4360
- password: string;
4361
4360
  email: string;
4362
4361
  name: string;
4363
- }, {
4364
4362
  password: string;
4363
+ }, {
4365
4364
  email: string;
4366
4365
  name: string;
4366
+ password: string;
4367
4367
  }> & toZod<AdditionalUserFieldsInput<Option>>;
4368
4368
  }>> extends true ? [better_call.Context<"/sign-up/email", {
4369
4369
  method: "POST";
@@ -4379,13 +4379,13 @@ declare const router: <C extends AuthContext, Option extends BetterAuthOptions>(
4379
4379
  email: zod.ZodString;
4380
4380
  password: zod.ZodString;
4381
4381
  }, zod.UnknownKeysParam, zod.ZodTypeAny, {
4382
- password: string;
4383
4382
  email: string;
4384
4383
  name: string;
4385
- }, {
4386
4384
  password: string;
4385
+ }, {
4387
4386
  email: string;
4388
4387
  name: string;
4388
+ password: string;
4389
4389
  }> & toZod<AdditionalUserFieldsInput<Option>>;
4390
4390
  }>] : [(better_call.Context<"/sign-up/email", {
4391
4391
  method: "POST";
@@ -4401,13 +4401,13 @@ declare const router: <C extends AuthContext, Option extends BetterAuthOptions>(
4401
4401
  email: zod.ZodString;
4402
4402
  password: zod.ZodString;
4403
4403
  }, zod.UnknownKeysParam, zod.ZodTypeAny, {
4404
- password: string;
4405
4404
  email: string;
4406
4405
  name: string;
4407
- }, {
4408
4406
  password: string;
4407
+ }, {
4409
4408
  email: string;
4410
4409
  name: string;
4410
+ password: string;
4411
4411
  }> & toZod<AdditionalUserFieldsInput<Option>>;
4412
4412
  }> | undefined)?]>(...ctx: C_1): Promise<C_1 extends [{
4413
4413
  asResponse: true;
@@ -4455,13 +4455,13 @@ declare const router: <C extends AuthContext, Option extends BetterAuthOptions>(
4455
4455
  email: zod.ZodString;
4456
4456
  password: zod.ZodString;
4457
4457
  }, zod.UnknownKeysParam, zod.ZodTypeAny, {
4458
- password: string;
4459
4458
  email: string;
4460
4459
  name: string;
4461
- }, {
4462
4460
  password: string;
4461
+ }, {
4463
4462
  email: string;
4464
4463
  name: string;
4464
+ password: string;
4465
4465
  }> & toZod<AdditionalUserFieldsInput<Option>>;
4466
4466
  };
4467
4467
  method: better_call.Method | better_call.Method[];
@@ -4476,13 +4476,13 @@ declare const router: <C extends AuthContext, Option extends BetterAuthOptions>(
4476
4476
  callbackURL: zod.ZodOptional<zod.ZodString>;
4477
4477
  dontRememberMe: zod.ZodOptional<zod.ZodDefault<zod.ZodBoolean>>;
4478
4478
  }, "strip", zod.ZodTypeAny, {
4479
- password: string;
4480
4479
  email: string;
4480
+ password: string;
4481
4481
  callbackURL?: string | undefined;
4482
4482
  dontRememberMe?: boolean | undefined;
4483
4483
  }, {
4484
- password: string;
4485
4484
  email: string;
4485
+ password: string;
4486
4486
  callbackURL?: string | undefined;
4487
4487
  dontRememberMe?: boolean | undefined;
4488
4488
  }>;
@@ -4517,13 +4517,13 @@ declare const router: <C extends AuthContext, Option extends BetterAuthOptions>(
4517
4517
  callbackURL: zod.ZodOptional<zod.ZodString>;
4518
4518
  dontRememberMe: zod.ZodOptional<zod.ZodDefault<zod.ZodBoolean>>;
4519
4519
  }, "strip", zod.ZodTypeAny, {
4520
- password: string;
4521
4520
  email: string;
4521
+ password: string;
4522
4522
  callbackURL?: string | undefined;
4523
4523
  dontRememberMe?: boolean | undefined;
4524
4524
  }, {
4525
- password: string;
4526
4525
  email: string;
4526
+ password: string;
4527
4527
  callbackURL?: string | undefined;
4528
4528
  dontRememberMe?: boolean | undefined;
4529
4529
  }>;
@@ -5499,13 +5499,13 @@ declare const router: <C extends AuthContext, Option extends BetterAuthOptions>(
5499
5499
  asResponse: true;
5500
5500
  }] ? Response : {
5501
5501
  id: string;
5502
+ userId: string;
5502
5503
  providerId: string;
5503
5504
  accountId: string;
5504
- userId: string;
5505
+ expiresAt?: Date | null | undefined;
5505
5506
  accessToken?: string | null | undefined;
5506
5507
  refreshToken?: string | null | undefined;
5507
5508
  idToken?: string | null | undefined;
5508
- expiresAt?: Date | null | undefined;
5509
5509
  password?: string | null | undefined;
5510
5510
  }[]>;
5511
5511
  path: "/list-accounts";
@@ -5761,13 +5761,13 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O) => {
5761
5761
  email: zod.ZodString;
5762
5762
  password: zod.ZodString;
5763
5763
  }, zod.UnknownKeysParam, zod.ZodTypeAny, {
5764
- password: string;
5765
5764
  email: string;
5766
5765
  name: string;
5767
- }, {
5768
5766
  password: string;
5767
+ }, {
5769
5768
  email: string;
5770
5769
  name: string;
5770
+ password: string;
5771
5771
  }> & toZod<AdditionalUserFieldsInput<O>>;
5772
5772
  }>> extends true ? [better_call.Context<"/sign-up/email", {
5773
5773
  method: "POST";
@@ -5783,13 +5783,13 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O) => {
5783
5783
  email: zod.ZodString;
5784
5784
  password: zod.ZodString;
5785
5785
  }, zod.UnknownKeysParam, zod.ZodTypeAny, {
5786
- password: string;
5787
5786
  email: string;
5788
5787
  name: string;
5789
- }, {
5790
5788
  password: string;
5789
+ }, {
5791
5790
  email: string;
5792
5791
  name: string;
5792
+ password: string;
5793
5793
  }> & toZod<AdditionalUserFieldsInput<O>>;
5794
5794
  }>] : [(better_call.Context<"/sign-up/email", {
5795
5795
  method: "POST";
@@ -5805,13 +5805,13 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O) => {
5805
5805
  email: zod.ZodString;
5806
5806
  password: zod.ZodString;
5807
5807
  }, zod.UnknownKeysParam, zod.ZodTypeAny, {
5808
- password: string;
5809
5808
  email: string;
5810
5809
  name: string;
5811
- }, {
5812
5810
  password: string;
5811
+ }, {
5813
5812
  email: string;
5814
5813
  name: string;
5814
+ password: string;
5815
5815
  }> & toZod<AdditionalUserFieldsInput<O>>;
5816
5816
  }> | undefined)?]>(...ctx: C): Promise<C extends [{
5817
5817
  asResponse: true;
@@ -5859,13 +5859,13 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O) => {
5859
5859
  email: zod.ZodString;
5860
5860
  password: zod.ZodString;
5861
5861
  }, zod.UnknownKeysParam, zod.ZodTypeAny, {
5862
- password: string;
5863
5862
  email: string;
5864
5863
  name: string;
5865
- }, {
5866
5864
  password: string;
5865
+ }, {
5867
5866
  email: string;
5868
5867
  name: string;
5868
+ password: string;
5869
5869
  }> & toZod<AdditionalUserFieldsInput<O>>;
5870
5870
  };
5871
5871
  method: better_call.Method | better_call.Method[];
@@ -5880,13 +5880,13 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O) => {
5880
5880
  callbackURL: zod.ZodOptional<zod.ZodString>;
5881
5881
  dontRememberMe: zod.ZodOptional<zod.ZodDefault<zod.ZodBoolean>>;
5882
5882
  }, "strip", zod.ZodTypeAny, {
5883
- password: string;
5884
5883
  email: string;
5884
+ password: string;
5885
5885
  callbackURL?: string | undefined;
5886
5886
  dontRememberMe?: boolean | undefined;
5887
5887
  }, {
5888
- password: string;
5889
5888
  email: string;
5889
+ password: string;
5890
5890
  callbackURL?: string | undefined;
5891
5891
  dontRememberMe?: boolean | undefined;
5892
5892
  }>;
@@ -5921,13 +5921,13 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O) => {
5921
5921
  callbackURL: zod.ZodOptional<zod.ZodString>;
5922
5922
  dontRememberMe: zod.ZodOptional<zod.ZodDefault<zod.ZodBoolean>>;
5923
5923
  }, "strip", zod.ZodTypeAny, {
5924
- password: string;
5925
5924
  email: string;
5925
+ password: string;
5926
5926
  callbackURL?: string | undefined;
5927
5927
  dontRememberMe?: boolean | undefined;
5928
5928
  }, {
5929
- password: string;
5930
5929
  email: string;
5930
+ password: string;
5931
5931
  callbackURL?: string | undefined;
5932
5932
  dontRememberMe?: boolean | undefined;
5933
5933
  }>;
@@ -6903,13 +6903,13 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O) => {
6903
6903
  asResponse: true;
6904
6904
  }] ? Response : {
6905
6905
  id: string;
6906
+ userId: string;
6906
6907
  providerId: string;
6907
6908
  accountId: string;
6908
- userId: string;
6909
+ expiresAt?: Date | null | undefined;
6909
6910
  accessToken?: string | null | undefined;
6910
6911
  refreshToken?: string | null | undefined;
6911
6912
  idToken?: string | null | undefined;
6912
- expiresAt?: Date | null | undefined;
6913
6913
  password?: string | null | undefined;
6914
6914
  }[]>;
6915
6915
  path: "/list-accounts";