@geekmidas/testkit 10.0.0-alpha.2 → 10.0.0-alpha.4
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.
- package/dist/{Factory-CVR3GdkW.d.mts → Factory-AWn1IulI.d.cts} +2 -2
- package/dist/{Factory-CVR3GdkW.d.mts.map → Factory-AWn1IulI.d.cts.map} +1 -1
- package/dist/{Factory-Cwzho3c8.d.cts → Factory-C15SSK8_.d.mts} +2 -2
- package/dist/{Factory-Cwzho3c8.d.cts.map → Factory-C15SSK8_.d.mts.map} +1 -1
- package/dist/Factory.d.cts +2 -2
- package/dist/Factory.d.mts +2 -2
- package/dist/{KyselyFactory-DRlMv-WT.d.mts → KyselyFactory-C9Snz24z.d.mts} +3 -3
- package/dist/{KyselyFactory-DRlMv-WT.d.mts.map → KyselyFactory-C9Snz24z.d.mts.map} +1 -1
- package/dist/{KyselyFactory-hMcVtvJq.d.cts → KyselyFactory-CxUJCi--.d.cts} +3 -3
- package/dist/{KyselyFactory-hMcVtvJq.d.cts.map → KyselyFactory-CxUJCi--.d.cts.map} +1 -1
- package/dist/KyselyFactory.d.cts +3 -3
- package/dist/KyselyFactory.d.mts +3 -3
- package/dist/{ObjectionFactory-DW-qwnqO.d.cts → ObjectionFactory-CYvaa0kU.d.cts} +3 -3
- package/dist/{ObjectionFactory-DW-qwnqO.d.cts.map → ObjectionFactory-CYvaa0kU.d.cts.map} +1 -1
- package/dist/{ObjectionFactory-DkJUf-uM.d.mts → ObjectionFactory-Cf2WI4o_.d.mts} +3 -3
- package/dist/{ObjectionFactory-DkJUf-uM.d.mts.map → ObjectionFactory-Cf2WI4o_.d.mts.map} +1 -1
- package/dist/ObjectionFactory.d.cts +3 -3
- package/dist/ObjectionFactory.d.mts +3 -3
- package/dist/better-auth.cjs +14 -7
- package/dist/better-auth.cjs.map +1 -1
- package/dist/better-auth.d.cts +3 -2
- package/dist/better-auth.d.cts.map +1 -1
- package/dist/better-auth.d.mts +3 -2
- package/dist/better-auth.d.mts.map +1 -1
- package/dist/better-auth.mjs +14 -7
- package/dist/better-auth.mjs.map +1 -1
- package/dist/{directory-C6DuuNyc.d.cts → directory-zIEh5ZPl.d.cts} +3 -3
- package/dist/{directory-C6DuuNyc.d.cts.map → directory-zIEh5ZPl.d.cts.map} +1 -1
- package/dist/{faker-DsYCplsG.d.mts → faker-B6bmbGCM.d.mts} +3 -3
- package/dist/{faker-DsYCplsG.d.mts.map → faker-B6bmbGCM.d.mts.map} +1 -1
- package/dist/{faker-Dg3trU4a.d.cts → faker-DvxiCtxc.d.cts} +3 -3
- package/dist/{faker-Dg3trU4a.d.cts.map → faker-DvxiCtxc.d.cts.map} +1 -1
- package/dist/faker.d.cts +1 -1
- package/dist/faker.d.mts +1 -1
- package/dist/kysely.d.cts +3 -3
- package/dist/kysely.d.mts +3 -3
- package/dist/objection.d.cts +3 -3
- package/dist/objection.d.mts +3 -3
- package/dist/os/directory.d.cts +1 -1
- package/dist/os/index.d.cts +1 -1
- package/package.json +15 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FakerFactory } from "./faker-
|
|
1
|
+
import { FakerFactory } from "./faker-DvxiCtxc.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/Factory.d.ts
|
|
4
4
|
|
|
@@ -144,4 +144,4 @@ type ExtractSeedAttrs<T> = T extends ((context: {
|
|
|
144
144
|
//# sourceMappingURL=Factory.d.ts.map
|
|
145
145
|
//#endregion
|
|
146
146
|
export { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder };
|
|
147
|
-
//# sourceMappingURL=Factory-
|
|
147
|
+
//# sourceMappingURL=Factory-AWn1IulI.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Factory-
|
|
1
|
+
{"version":3,"file":"Factory-AWn1IulI.d.cts","names":[],"sources":["../src/Factory.ts"],"sourcesContent":[],"mappings":";;;;;;AA2BA;;;;;;;;;;;;;;;;;;;;;;;AAiD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AAO,SAAS,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgCrD;SAKW;WAAgB;MAAa;MAAS,QAAQ;;;;;KAMzD,sBAAsB;;;;aAK/B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FakerFactory } from "./faker-
|
|
1
|
+
import { FakerFactory } from "./faker-B6bmbGCM.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/Factory.d.ts
|
|
4
4
|
|
|
@@ -144,4 +144,4 @@ type ExtractSeedAttrs<T> = T extends ((context: {
|
|
|
144
144
|
//# sourceMappingURL=Factory.d.ts.map
|
|
145
145
|
//#endregion
|
|
146
146
|
export { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder };
|
|
147
|
-
//# sourceMappingURL=Factory-
|
|
147
|
+
//# sourceMappingURL=Factory-C15SSK8_.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Factory-
|
|
1
|
+
{"version":3,"file":"Factory-C15SSK8_.d.mts","names":[],"sources":["../src/Factory.ts"],"sourcesContent":[],"mappings":";;;;;;AA2BA;;;;;;;;;;;;;;;;;;;;;;;AAiD6B,uBAjDP,OAiDO,CAAA,iBAhDX,MAgDW,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,cA/Cd,MA+Cc,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,CAAA;EAAQ;;;;;;;;;;;;;;;;EAavB,OAAA,UAAA,CAAA,aA1CkB,WA0ClB,CAAA,CAAA,MAAA,EA1CuC,IA0CvC,CAAA,EA1C8C,IA0C9C;EA8BF;;;;;;EAK0C,SAAW,MAAA,CAAA,UAAA,MApEhC,QAoEgC,CAAA,CAAA,WAAA,EAnElD,CAmEkD,EAAA,KAAA,CAAA,EAlEvD,UAkEuD,CAlE5C,QAkE4C,CAlEnC,CAkEmC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAjE7D,OAiE6D,CAjErD,OAiEqD,CAjE7C,UAiE6C,CAjElC,QAiEkC,CAjEzB,CAiEyB,CAAA,CAAA,CAAA,CAAA;EAAM;AAAP;AAgChE;;;;;EAKsD,SAAe,UAAA,CAAA,UAAA,MA7FhC,QA6FgC,CAAA,CAAA,KAAA,EAAA,MAAA,EAAA,WAAA,EA3FtD,CA2FsD,EAAA,KAAA,CAAA,EAzFhE,UAyFgE,CAzFrD,QAyFqD,CAzF5C,CAyF4C,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,GAAA,EAAA,MAAA,EAAA,KAAA,EAtFzD,YAsFyD,EAAA,GArF3D,OAqF2D,CArFnD,UAqFmD,CArFxC,QAqFwC,CArF/B,CAqF+B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EApFjE,OAoFiE,CApFzD,OAoFyD,CApFjD,UAoFiD,CApFtC,QAoFsC,CApF7B,CAoF6B,CAAA,CAAA,CAAA,EAAA,CAAA;EAAM;AAAP;AAMpE;;;;AAKI;gCAtF2B,iBACnB,WACF,iBAAiB,MAAM,MAC7B,WAAW,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8BT,kFAKA,gBAAgB,aAAa,OAAO,SAAS,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgCrD;SAKW;WAAgB;MAAa;MAAS,QAAQ;;;;;KAMzD,sBAAsB;;;;aAK/B"}
|
package/dist/Factory.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./faker-
|
|
2
|
-
import { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder } from "./Factory-
|
|
1
|
+
import "./faker-DvxiCtxc.cjs";
|
|
2
|
+
import { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder } from "./Factory-AWn1IulI.cjs";
|
|
3
3
|
export { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder };
|
package/dist/Factory.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./faker-
|
|
2
|
-
import { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder } from "./Factory-
|
|
1
|
+
import "./faker-B6bmbGCM.mjs";
|
|
2
|
+
import { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder } from "./Factory-C15SSK8_.mjs";
|
|
3
3
|
export { ExtractSeedAttrs, Factory, FactorySeed, MixedFactoryBuilder };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FakerFactory } from "./faker-
|
|
2
|
-
import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-
|
|
1
|
+
import { FakerFactory } from "./faker-B6bmbGCM.mjs";
|
|
2
|
+
import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-C15SSK8_.mjs";
|
|
3
3
|
import { ControlledTransaction, Insertable, Kysely, Selectable } from "kysely";
|
|
4
4
|
|
|
5
5
|
//#region src/KyselyFactory.d.ts
|
|
@@ -225,4 +225,4 @@ declare class KyselyFactory<DB, Builders extends Record<string, any>, Seeds exte
|
|
|
225
225
|
//# sourceMappingURL=KyselyFactory.d.ts.map
|
|
226
226
|
//#endregion
|
|
227
227
|
export { KyselyFactory };
|
|
228
|
-
//# sourceMappingURL=KyselyFactory-
|
|
228
|
+
//# sourceMappingURL=KyselyFactory-C9Snz24z.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KyselyFactory-
|
|
1
|
+
{"version":3,"file":"KyselyFactory-C9Snz24z.d.mts","names":[],"sources":["../src/KyselyFactory.ts"],"sourcesContent":[],"mappings":";;;;;;;;AA+CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4GK,cA5GQ,aA4GR,CAAA,EAAA,EAAA,iBA1Ga,MA0Gb,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,cAzGU,MAyGV,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,SAxGK,OAwGL,CAxGa,QAwGb,EAxGuB,KAwGvB,CAAA,CAAA;EAAO,QACoB,QAAA;EAAE,QAAC,KAAA;EAAS,QAAvB,EAAA;EAAU;;;;;;;;;;;;;;;;;;;;;EAwJf,OACK,UAAA,CAAA,aA5OoB,WA4OpB,CAAA,CAAA,MAAA,EA5OyC,IA4OzC,CAAA,EA5OgD,IA4OhD;EAAQ;;;;;;;EAClB,WACuB,CAAA,QAAA,EAlOd,QAkOc,EAAA,KAAA,EAjOjB,KAiOiB,EAAA,EAAA,EAhOpB,MAgOoB,CAhOb,EAgOa,CAAA,GAhOP,qBAgOO,CAhOe,EAgOf,EAAA,EAAA,CAAA;EAAQ;;;;;;;;;;;;;;;;;;;;;;;AApQzB;;;;;;;;;;;;;;;;;;;;;;;;mDA0FS,2BACV,QAAQ,WAAW,GAAG,eAAe,QAClD,WAAW,GAAG,sCAGN,WAAW,GAAG,oBAEhB;WAEC;aACE;QACL,OAAO;WACJ;QAEL,QAAQ,WAAW,GAAG,eACtB,QAAQ,QAAQ,WAAW,GAAG,8CAG1B,gBACE,aACL,OAAO,YACJ,iBACH,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAuEgB,uBACf,WACL,WAAW,SAAS,SAC1B,QAAQ,QAAQ,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAqEN,sCAEnB,WACL,WAAW,SAAS,SAC1B,QAAQ,QAAQ,WAAW,SAAS;6BACN,sCAEnB,+BAGL,iBACH,WAAW,SAAS,SAAS,QAAQ,WAAW,SAAS,UAC5D,QAAQ,QAAQ,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAsDlB,iBACV,WACF,iBAAiB,MAAM,MAC7B,WAAW,MAAM"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FakerFactory } from "./faker-
|
|
2
|
-
import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-
|
|
1
|
+
import { FakerFactory } from "./faker-DvxiCtxc.cjs";
|
|
2
|
+
import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-AWn1IulI.cjs";
|
|
3
3
|
import { ControlledTransaction, Insertable, Kysely, Selectable } from "kysely";
|
|
4
4
|
|
|
5
5
|
//#region src/KyselyFactory.d.ts
|
|
@@ -225,4 +225,4 @@ declare class KyselyFactory<DB, Builders extends Record<string, any>, Seeds exte
|
|
|
225
225
|
//# sourceMappingURL=KyselyFactory.d.ts.map
|
|
226
226
|
//#endregion
|
|
227
227
|
export { KyselyFactory };
|
|
228
|
-
//# sourceMappingURL=KyselyFactory-
|
|
228
|
+
//# sourceMappingURL=KyselyFactory-CxUJCi--.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KyselyFactory-
|
|
1
|
+
{"version":3,"file":"KyselyFactory-CxUJCi--.d.cts","names":[],"sources":["../src/KyselyFactory.ts"],"sourcesContent":[],"mappings":";;;;;;;;AA+CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4GK,cA5GQ,aA4GR,CAAA,EAAA,EAAA,iBA1Ga,MA0Gb,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,cAzGU,MAyGV,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,SAxGK,OAwGL,CAxGa,QAwGb,EAxGuB,KAwGvB,CAAA,CAAA;EAAO,QACoB,QAAA;EAAE,QAAC,KAAA;EAAS,QAAvB,EAAA;EAAU;;;;;;;;;;;;;;;;;;;;;EAwJf,OACK,UAAA,CAAA,aA5OoB,WA4OpB,CAAA,CAAA,MAAA,EA5OyC,IA4OzC,CAAA,EA5OgD,IA4OhD;EAAQ;;;;;;;EAClB,WACuB,CAAA,QAAA,EAlOd,QAkOc,EAAA,KAAA,EAjOjB,KAiOiB,EAAA,EAAA,EAhOpB,MAgOoB,CAhOb,EAgOa,CAAA,GAhOP,qBAgOO,CAhOe,EAgOf,EAAA,EAAA,CAAA;EAAQ;;;;;;;;;;;;;;;;;;;;;;;AApQzB;;;;;;;;;;;;;;;;;;;;;;;;mDA0FS,2BACV,QAAQ,WAAW,GAAG,eAAe,QAClD,WAAW,GAAG,sCAGN,WAAW,GAAG,oBAEhB;WAEC;aACE;QACL,OAAO;WACJ;QAEL,QAAQ,WAAW,GAAG,eACtB,QAAQ,QAAQ,WAAW,GAAG,8CAG1B,gBACE,aACL,OAAO,YACJ,iBACH,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAuEgB,uBACf,WACL,WAAW,SAAS,SAC1B,QAAQ,QAAQ,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAqEN,sCAEnB,WACL,WAAW,SAAS,SAC1B,QAAQ,QAAQ,WAAW,SAAS;6BACN,sCAEnB,+BAGL,iBACH,WAAW,SAAS,SAAS,QAAQ,WAAW,SAAS,UAC5D,QAAQ,QAAQ,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAsDlB,iBACV,WACF,iBAAiB,MAAM,MAC7B,WAAW,MAAM"}
|
package/dist/KyselyFactory.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./faker-
|
|
2
|
-
import "./Factory-
|
|
3
|
-
import { KyselyFactory } from "./KyselyFactory-
|
|
1
|
+
import "./faker-DvxiCtxc.cjs";
|
|
2
|
+
import "./Factory-AWn1IulI.cjs";
|
|
3
|
+
import { KyselyFactory } from "./KyselyFactory-CxUJCi--.cjs";
|
|
4
4
|
export { KyselyFactory };
|
package/dist/KyselyFactory.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./faker-
|
|
2
|
-
import "./Factory-
|
|
3
|
-
import { KyselyFactory } from "./KyselyFactory-
|
|
1
|
+
import "./faker-B6bmbGCM.mjs";
|
|
2
|
+
import "./Factory-C15SSK8_.mjs";
|
|
3
|
+
import { KyselyFactory } from "./KyselyFactory-C9Snz24z.mjs";
|
|
4
4
|
export { KyselyFactory };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FakerFactory } from "./faker-
|
|
2
|
-
import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-
|
|
1
|
+
import { FakerFactory } from "./faker-DvxiCtxc.cjs";
|
|
2
|
+
import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-AWn1IulI.cjs";
|
|
3
3
|
import { Knex } from "knex";
|
|
4
4
|
import { Model } from "objection";
|
|
5
5
|
|
|
@@ -238,4 +238,4 @@ declare class ObjectionFactory<Builders extends Record<string, any>, Seeds exten
|
|
|
238
238
|
//# sourceMappingURL=ObjectionFactory.d.ts.map
|
|
239
239
|
//#endregion
|
|
240
240
|
export { ObjectionFactory };
|
|
241
|
-
//# sourceMappingURL=ObjectionFactory-
|
|
241
|
+
//# sourceMappingURL=ObjectionFactory-CYvaa0kU.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectionFactory-
|
|
1
|
+
{"version":3,"file":"ObjectionFactory-CYvaa0kU.d.cts","names":[],"sources":["../src/ObjectionFactory.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAyCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0Gc,cA1GD,gBA0GC,CAAA,iBAzGI,MAyGJ,CAAA,MAAA,EAAA,GAAA,CAAA,EAAA,cAxGC,MAwGD,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA,SAvGJ,OAuGI,CAvGI,QAuGJ,EAvGc,KAuGd,CAAA,CAAA;EAAM,QAAd,QAAA;EAAO,QAqDO,KAAA;EAAQ,QACX,EAAA;EAAK;;;;;;;;;;;;;;;;;;;;;EA2GX,OACuB,UAAA,CAAA,aAnPO,WAmPP,CAAA,CAAA,MAAA,EAnP4B,IAmP5B,CAAA,EAnPmC,IAmPnC;EAAQ;;;;;;;;;;;;;;;;;;;AAzQzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6CAmFO,qBACR,QAAQ,aAAa,WAAW,QAAQ,aAAa,kCAE1D,aAAa,qBAEV;WAEJ;aACE;QACL;WACG;QAEL,QAAQ,aAAa,WACrB,QAAQ,QAAQ,aAAa,0CAGzB,gBACE,aACL,aACG,iBACH,QAAQ;;;;;;;;wBAqDM,iBACH,WACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAoCgB,uBACf,WACL,WAAW,SAAS,SAC1B,QAAQ,QAAQ,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA+DN,sCAEnB,WACL,WAAW,SAAS,SAC1B,QAAQ,QAAQ,WAAW,SAAS;6BACN,sCAEnB,+BACe,iBAAiB,WAAW,SAAS,SAC/D,QAAQ,QAAQ,WAAW,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAgFlB,iBACV,WACF,iBAAiB,MAAM,MAC7B,WAAW,MAAM"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FakerFactory } from "./faker-
|
|
2
|
-
import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-
|
|
1
|
+
import { FakerFactory } from "./faker-B6bmbGCM.mjs";
|
|
2
|
+
import { ExtractSeedAttrs, Factory, FactorySeed } from "./Factory-C15SSK8_.mjs";
|
|
3
3
|
import { Knex } from "knex";
|
|
4
4
|
import { Model } from "objection";
|
|
5
5
|
|
|
@@ -238,4 +238,4 @@ declare class ObjectionFactory<Builders extends Record<string, any>, Seeds exten
|
|
|
238
238
|
//# sourceMappingURL=ObjectionFactory.d.ts.map
|
|
239
239
|
//#endregion
|
|
240
240
|
export { ObjectionFactory };
|
|
241
|
-
//# sourceMappingURL=ObjectionFactory-
|
|
241
|
+
//# sourceMappingURL=ObjectionFactory-Cf2WI4o_.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectionFactory-
|
|
1
|
+
{"version":3,"file":"ObjectionFactory-Cf2WI4o_.d.mts","names":[],"sources":["../src/ObjectionFactory.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAyCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A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ionFactory } from "./ObjectionFactory-CYvaa0kU.cjs";
|
|
4
4
|
export { ObjectionFactory };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./faker-
|
|
2
|
-
import "./Factory-
|
|
3
|
-
import { ObjectionFactory } from "./ObjectionFactory-
|
|
1
|
+
import "./faker-B6bmbGCM.mjs";
|
|
2
|
+
import "./Factory-C15SSK8_.mjs";
|
|
3
|
+
import { ObjectionFactory } from "./ObjectionFactory-Cf2WI4o_.mjs";
|
|
4
4
|
export { ObjectionFactory };
|
package/dist/better-auth.cjs
CHANGED
|
@@ -122,7 +122,8 @@ const memoryAdapter = (config = {}, store = /* @__PURE__ */ new Map()) => {
|
|
|
122
122
|
const modelData = storeInstance.getModel(modelName);
|
|
123
123
|
const transformedWhere = transformWhereClause({
|
|
124
124
|
model,
|
|
125
|
-
where
|
|
125
|
+
where,
|
|
126
|
+
action: "findOne"
|
|
126
127
|
});
|
|
127
128
|
for (const record of modelData.values()) if (matchesWhere(record, transformedWhere)) return record;
|
|
128
129
|
return null;
|
|
@@ -136,7 +137,8 @@ const memoryAdapter = (config = {}, store = /* @__PURE__ */ new Map()) => {
|
|
|
136
137
|
const modelData = storeInstance.getModel(modelName);
|
|
137
138
|
const transformedWhere = transformWhereClause({
|
|
138
139
|
model,
|
|
139
|
-
where
|
|
140
|
+
where,
|
|
141
|
+
action: "findMany"
|
|
140
142
|
});
|
|
141
143
|
let results = Array.from(modelData.values()).filter((record) => matchesWhere(record, transformedWhere));
|
|
142
144
|
if (sortBy) results = applySorting(results, sortBy);
|
|
@@ -153,7 +155,8 @@ const memoryAdapter = (config = {}, store = /* @__PURE__ */ new Map()) => {
|
|
|
153
155
|
const modelData = storeInstance.getModel(modelName);
|
|
154
156
|
const transformedWhere = transformWhereClause({
|
|
155
157
|
model,
|
|
156
|
-
where
|
|
158
|
+
where,
|
|
159
|
+
action: "update"
|
|
157
160
|
});
|
|
158
161
|
for (const [id, record] of modelData.entries()) if (matchesWhere(record, transformedWhere)) {
|
|
159
162
|
const updated = {
|
|
@@ -174,7 +177,8 @@ const memoryAdapter = (config = {}, store = /* @__PURE__ */ new Map()) => {
|
|
|
174
177
|
const modelData = storeInstance.getModel(modelName);
|
|
175
178
|
const transformedWhere = transformWhereClause({
|
|
176
179
|
model,
|
|
177
|
-
where
|
|
180
|
+
where,
|
|
181
|
+
action: "updateMany"
|
|
178
182
|
});
|
|
179
183
|
let count = 0;
|
|
180
184
|
for (const [id, record] of modelData.entries()) if (matchesWhere(record, transformedWhere)) {
|
|
@@ -195,7 +199,8 @@ const memoryAdapter = (config = {}, store = /* @__PURE__ */ new Map()) => {
|
|
|
195
199
|
const modelData = storeInstance.getModel(modelName);
|
|
196
200
|
const transformedWhere = transformWhereClause({
|
|
197
201
|
model,
|
|
198
|
-
where
|
|
202
|
+
where,
|
|
203
|
+
action: "delete"
|
|
199
204
|
});
|
|
200
205
|
for (const [id, record] of modelData.entries()) if (matchesWhere(record, transformedWhere)) {
|
|
201
206
|
modelData.delete(id);
|
|
@@ -211,7 +216,8 @@ const memoryAdapter = (config = {}, store = /* @__PURE__ */ new Map()) => {
|
|
|
211
216
|
const modelData = storeInstance.getModel(modelName);
|
|
212
217
|
const transformedWhere = transformWhereClause({
|
|
213
218
|
model,
|
|
214
|
-
where
|
|
219
|
+
where,
|
|
220
|
+
action: "deleteMany"
|
|
215
221
|
});
|
|
216
222
|
const toDelete = [];
|
|
217
223
|
for (const [id, record] of modelData.entries()) if (matchesWhere(record, transformedWhere)) toDelete.push(id);
|
|
@@ -223,7 +229,8 @@ const memoryAdapter = (config = {}, store = /* @__PURE__ */ new Map()) => {
|
|
|
223
229
|
const modelData = storeInstance.getModel(modelName);
|
|
224
230
|
const transformedWhere = transformWhereClause({
|
|
225
231
|
model,
|
|
226
|
-
where
|
|
232
|
+
where,
|
|
233
|
+
action: "count"
|
|
227
234
|
});
|
|
228
235
|
return Array.from(modelData.values()).filter((record) => matchesWhere(record, transformedWhere)).length;
|
|
229
236
|
}
|
package/dist/better-auth.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"better-auth.cjs","names":["initialData?: Record<string, any[]>","data: Map<string, any>","modelName: string","result: Record<string, any[]>","record: any","where?: Where[]","result: boolean | null","records: any[]","sortBy?: SortBy","config: MemoryAdapterConfig","toDelete: string[]"],"sources":["../src/better-auth.ts"],"sourcesContent":["import {\n\tcreateAdapterFactory,\n\ttype DBAdapterDebugLogOption,\n\ttype Where,\n} from 'better-auth/adapters';\n\ninterface MemoryAdapterConfig {\n\tdebugLogs?: DBAdapterDebugLogOption;\n\tusePlural?: boolean;\n\tinitialData?: Record<string, any[]>;\n}\n\nclass MemoryStore {\n\tconstructor(\n\t\tinitialData?: Record<string, any[]>,\n\t\tprivate readonly data: Map<string, any> = new Map(),\n\t) {\n\t\tif (initialData) {\n\t\t\tfor (const [model, records] of Object.entries(initialData)) {\n\t\t\t\tconst modelData = new Map();\n\t\t\t\tfor (const record of records) {\n\t\t\t\t\tmodelData.set(record.id, { ...record });\n\t\t\t\t}\n\t\t\t\tthis.data.set(model, modelData);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetModel(modelName: string): Map<string, any> {\n\t\tif (!this.data.has(modelName)) {\n\t\t\tthis.data.set(modelName, new Map());\n\t\t}\n\t\treturn this.data.get(modelName)!;\n\t}\n\n\tclear() {\n\t\tthis.data.clear();\n\t}\n\n\tgetAllData() {\n\t\tconst result: Record<string, any[]> = {};\n\t\tfor (const [model, records] of this.data.entries()) {\n\t\t\tresult[model] = Array.from(records.values());\n\t\t}\n\t\treturn result;\n\t}\n}\n\nfunction matchesWhere(record: any, where?: Where[]): boolean {\n\tif (!where || where.length === 0) return true;\n\n\tlet result: boolean | null = null;\n\n\tfor (const condition of where) {\n\t\tconst { field, value, operator = 'eq', connector = 'AND' } = condition;\n\t\tconst recordValue = record[field];\n\n\t\tlet matches = false;\n\n\t\tswitch (operator) {\n\t\t\tcase 'eq':\n\t\t\t\tmatches = recordValue === value;\n\t\t\t\tbreak;\n\t\t\tcase 'ne':\n\t\t\t\tmatches = recordValue !== value;\n\t\t\t\tbreak;\n\t\t\tcase 'lt':\n\t\t\t\tmatches = value != null && recordValue < value;\n\t\t\t\tbreak;\n\t\t\tcase 'lte':\n\t\t\t\tmatches = value != null && recordValue <= value;\n\t\t\t\tbreak;\n\t\t\tcase 'gt':\n\t\t\t\tmatches = value != null && recordValue > value;\n\t\t\t\tbreak;\n\t\t\tcase 'gte':\n\t\t\t\tmatches = value != null && recordValue >= value;\n\t\t\t\tbreak;\n\t\t\tcase 'in':\n\t\t\t\tmatches =\n\t\t\t\t\tArray.isArray(value) && (value as unknown[]).includes(recordValue);\n\t\t\t\tbreak;\n\t\t\tcase 'not_in':\n\t\t\t\tmatches =\n\t\t\t\t\tArray.isArray(value) && !(value as unknown[]).includes(recordValue);\n\t\t\t\tbreak;\n\t\t\tcase 'contains':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.includes(value);\n\t\t\t\tbreak;\n\t\t\tcase 'starts_with':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.startsWith(value);\n\t\t\t\tbreak;\n\t\t\tcase 'ends_with':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.endsWith(value);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmatches = recordValue === value;\n\t\t}\n\n\t\t// Apply connector logic\n\t\tif (result === null) {\n\t\t\tresult = matches;\n\t\t} else if (connector === 'OR') {\n\t\t\tresult = result || matches;\n\t\t} else {\n\t\t\t// Default: AND\n\t\t\tresult = result && matches;\n\t\t}\n\t}\n\n\treturn result ?? true;\n}\ntype SortBy = {\n\tfield: string;\n\tdirection: 'asc' | 'desc';\n};\n\nfunction applySorting(records: any[], sortBy?: SortBy): any[] {\n\tif (!sortBy) return records;\n\n\tconst { field, direction } = sortBy;\n\n\treturn records.sort((a, b) => {\n\t\tconst aVal = a[field];\n\t\tconst bVal = b[field];\n\n\t\tif (aVal === bVal) return 0;\n\t\tif (aVal == null) return direction === 'asc' ? -1 : 1;\n\t\tif (bVal == null) return direction === 'asc' ? 1 : -1;\n\n\t\tconst comparison = aVal < bVal ? -1 : 1;\n\t\treturn direction === 'asc' ? comparison : -comparison;\n\t});\n}\n\nexport const memoryAdapter = (\n\tconfig: MemoryAdapterConfig = {},\n\tstore = new Map(),\n) => {\n\tconst storeInstance = new MemoryStore(config.initialData, store);\n\n\tconst adapterInstance = createAdapterFactory({\n\t\tconfig: {\n\t\t\tadapterId: 'memory-adapter',\n\t\t\tadapterName: 'Memory Adapter',\n\t\t\tusePlural: config.usePlural ?? false,\n\t\t\tdebugLogs: config.debugLogs ?? false,\n\t\t\tsupportsJSON: true,\n\t\t\tsupportsDates: true,\n\t\t\tsupportsBooleans: true,\n\t\t\tsupportsNumericIds: false,\n\t\t},\n\n\t\t// Note: The framework automatically transforms field names in both directions:\n\t\t// - Input data is already transformed before reaching the adapter (e.g., email -> email_address)\n\t\t// - Output data is automatically transformed after the adapter returns (e.g., email_address -> email)\n\t\t// Therefore, we should NOT call transformInput or transformOutput ourselves.\n\t\tadapter: ({ debugLog, getModelName, transformWhereClause }) => ({\n\t\t\tcreate: async ({ data, model }) => {\n\t\t\t\tdebugLog('CREATE', { model, data });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\n\t\t\t\t// Data is already transformed by the framework - store directly\n\t\t\t\tconst record = data as Record<string, unknown>;\n\t\t\t\tif (!record.id) {\n\t\t\t\t\trecord.id = crypto.randomUUID();\n\t\t\t\t}\n\n\t\t\t\tconst id = record.id as string;\n\t\t\t\tmodelData.set(id, { ...record });\n\t\t\t\treturn modelData.get(id);\n\t\t\t},\n\n\t\t\tfindOne: async ({ where, model }) => {\n\t\t\t\tdebugLog('FIND_ONE', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({ model, where });\n\n\t\t\t\tfor (const record of modelData.values()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\treturn record;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t},\n\n\t\t\tfindMany: async ({ where, model, limit, offset, sortBy }) => {\n\t\t\t\tdebugLog('FIND_MANY', { model, where });\n\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({ model, where });\n\n\t\t\t\tlet results = Array.from(modelData.values()).filter((record) =>\n\t\t\t\t\tmatchesWhere(record, transformedWhere),\n\t\t\t\t);\n\n\t\t\t\tif (sortBy) {\n\t\t\t\t\tresults = applySorting(results, sortBy);\n\t\t\t\t}\n\n\t\t\t\tif (offset) {\n\t\t\t\t\tresults = results.slice(offset);\n\t\t\t\t}\n\t\t\t\tif (limit) {\n\t\t\t\t\tresults = results.slice(0, limit);\n\t\t\t\t}\n\n\t\t\t\treturn results;\n\t\t\t},\n\n\t\t\tupdate: async ({ where, update, model }) => {\n\t\t\t\tdebugLog('UPDATE', { model, where });\n\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({ model, where });\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\t// Update data is already transformed by the framework\n\t\t\t\t\t\tconst updated = { ...record, ...update };\n\t\t\t\t\t\tmodelData.set(id, updated);\n\t\t\t\t\t\treturn updated;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t},\n\n\t\t\tupdateMany: async ({ where, update, model }) => {\n\t\t\t\tdebugLog('UPDATE_MANY', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({ model, where });\n\n\t\t\t\tlet count = 0;\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\t// Update data is already transformed by the framework\n\t\t\t\t\t\tmodelData.set(id, { ...record, ...update });\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn count;\n\t\t\t},\n\n\t\t\tdelete: async ({ where, model }) => {\n\t\t\t\tdebugLog('DELETE', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({ model, where });\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\tmodelData.delete(id);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tdeleteMany: async ({ where, model }) => {\n\t\t\t\tdebugLog('DELETE_MANY', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({ model, where });\n\n\t\t\t\tconst toDelete: string[] = [];\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\ttoDelete.push(id);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (const id of toDelete) {\n\t\t\t\t\tmodelData.delete(id);\n\t\t\t\t}\n\t\t\t\treturn toDelete.length;\n\t\t\t},\n\n\t\t\tcount: async ({ where, model }) => {\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({ model, where });\n\n\t\t\t\treturn Array.from(modelData.values()).filter((record) =>\n\t\t\t\t\tmatchesWhere(record, transformedWhere),\n\t\t\t\t).length;\n\t\t\t},\n\t\t}),\n\t});\n\n\t// Add utility methods to the adapter\n\treturn Object.assign(adapterInstance, {\n\t\tclear: () => store.clear(),\n\t\tgetAllData: () => storeInstance.getAllData(),\n\t\tgetStore: () => store,\n\t});\n};\n"],"mappings":";;;;AAYA,IAAM,cAAN,MAAkB;CACjB,YACCA,aACiBC,uBAAyB,IAAI,OAC7C;EADgB;AAEjB,MAAI,YACH,MAAK,MAAM,CAAC,OAAO,QAAQ,IAAI,OAAO,QAAQ,YAAY,EAAE;GAC3D,MAAM,4BAAY,IAAI;AACtB,QAAK,MAAM,UAAU,QACpB,WAAU,IAAI,OAAO,IAAI,EAAE,GAAG,OAAQ,EAAC;AAExC,QAAK,KAAK,IAAI,OAAO,UAAU;EAC/B;CAEF;CAED,SAASC,WAAqC;AAC7C,OAAK,KAAK,KAAK,IAAI,UAAU,CAC5B,MAAK,KAAK,IAAI,2BAAW,IAAI,MAAM;AAEpC,SAAO,KAAK,KAAK,IAAI,UAAU;CAC/B;CAED,QAAQ;AACP,OAAK,KAAK,OAAO;CACjB;CAED,aAAa;EACZ,MAAMC,SAAgC,CAAE;AACxC,OAAK,MAAM,CAAC,OAAO,QAAQ,IAAI,KAAK,KAAK,SAAS,CACjD,QAAO,SAAS,MAAM,KAAK,QAAQ,QAAQ,CAAC;AAE7C,SAAO;CACP;AACD;AAED,SAAS,aAAaC,QAAaC,OAA0B;AAC5D,MAAK,SAAS,MAAM,WAAW,EAAG,QAAO;CAEzC,IAAIC,SAAyB;AAE7B,MAAK,MAAM,aAAa,OAAO;EAC9B,MAAM,EAAE,OAAO,OAAO,WAAW,MAAM,YAAY,OAAO,GAAG;EAC7D,MAAM,cAAc,OAAO;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M,mBAAmB,qBAAqB;KAAE;KAAO;IAAO,EAAC;AAE/D,SAAK,MAAM,CAAC,IAAI,OAAO,IAAI,UAAU,SAAS,CAC7C,KAAI,aAAa,QAAQ,iBAAiB,EAAE;AAC3C,eAAU,OAAO,GAAG;AACpB;IACA;GAEF;GAED,YAAY,OAAO,EAAE,OAAO,OAAO,KAAK;AACvC,aAAS,eAAe;KAAE;KAAO;IAAO,EAAC;IACzC,MAAM,YAAY,aAAa,MAAM;IACrC,MAAM,YAAY,cAAc,SAAS,UAAU;IACnD,MAAM,mBAAmB,qBAAqB;KAAE;KAAO;IAAO,EAAC;IAE/D,MAAMC,WAAqB,CAAE;AAC7B,SAAK,MAAM,CAAC,IAAI,OAAO,IAAI,UAAU,SAAS,CAC7C,KAAI,aAAa,QAAQ,iBAAiB,CACzC,UAAS,KAAK,GAAG;AAInB,SAAK,MAAM,MAAM,SAChB,WAAU,OAAO,GAAG;AAErB,WAAO,SAAS;GAChB;GAED,OAAO,OAAO,EAAE,OAAO,OAAO,KAAK;IAClC,MAAM,YAAY,aAAa,MAAM;IACrC,MAAM,YAAY,cAAc,SAAS,UAAU;IACnD,MAAM,mBAAmB,qBAAqB;KAAE;KAAO;IAAO,EAAC;AAE/D,WAAO,MAAM,KAAK,UAAU,QAAQ,CAAC,CAAC,OAAO,CAAC,WAC7C,aAAa,QAAQ,iBAAiB,CACtC,CAAC;GACF;EACD;CACD,EAAC;AAGF,QAAO,OAAO,OAAO,iBAAiB;EACrC,OAAO,MAAM,MAAM,OAAO;EAC1B,YAAY,MAAM,cAAc,YAAY;EAC5C,UAAU,MAAM;CAChB,EAAC;AACF"}
|
|
1
|
+
{"version":3,"file":"better-auth.cjs","names":["initialData?: Record<string, any[]>","data: Map<string, any>","modelName: string","result: Record<string, any[]>","record: any","where?: Where[]","result: boolean | null","records: any[]","sortBy?: SortBy","config: MemoryAdapterConfig","toDelete: string[]"],"sources":["../src/better-auth.ts"],"sourcesContent":["import {\n\tcreateAdapterFactory,\n\ttype DBAdapterDebugLogOption,\n\ttype Where,\n} from 'better-auth/adapters';\n\ninterface MemoryAdapterConfig {\n\tdebugLogs?: DBAdapterDebugLogOption;\n\tusePlural?: boolean;\n\tinitialData?: Record<string, any[]>;\n}\n\nclass MemoryStore {\n\tconstructor(\n\t\tinitialData?: Record<string, any[]>,\n\t\tprivate readonly data: Map<string, any> = new Map(),\n\t) {\n\t\tif (initialData) {\n\t\t\tfor (const [model, records] of Object.entries(initialData)) {\n\t\t\t\tconst modelData = new Map();\n\t\t\t\tfor (const record of records) {\n\t\t\t\t\tmodelData.set(record.id, { ...record });\n\t\t\t\t}\n\t\t\t\tthis.data.set(model, modelData);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetModel(modelName: string): Map<string, any> {\n\t\tif (!this.data.has(modelName)) {\n\t\t\tthis.data.set(modelName, new Map());\n\t\t}\n\t\treturn this.data.get(modelName)!;\n\t}\n\n\tclear() {\n\t\tthis.data.clear();\n\t}\n\n\tgetAllData() {\n\t\tconst result: Record<string, any[]> = {};\n\t\tfor (const [model, records] of this.data.entries()) {\n\t\t\tresult[model] = Array.from(records.values());\n\t\t}\n\t\treturn result;\n\t}\n}\n\nfunction matchesWhere(record: any, where?: Where[]): boolean {\n\tif (!where || where.length === 0) return true;\n\n\tlet result: boolean | null = null;\n\n\tfor (const condition of where) {\n\t\tconst { field, value, operator = 'eq', connector = 'AND' } = condition;\n\t\tconst recordValue = record[field];\n\n\t\tlet matches = false;\n\n\t\tswitch (operator) {\n\t\t\tcase 'eq':\n\t\t\t\tmatches = recordValue === value;\n\t\t\t\tbreak;\n\t\t\tcase 'ne':\n\t\t\t\tmatches = recordValue !== value;\n\t\t\t\tbreak;\n\t\t\tcase 'lt':\n\t\t\t\tmatches = value != null && recordValue < value;\n\t\t\t\tbreak;\n\t\t\tcase 'lte':\n\t\t\t\tmatches = value != null && recordValue <= value;\n\t\t\t\tbreak;\n\t\t\tcase 'gt':\n\t\t\t\tmatches = value != null && recordValue > value;\n\t\t\t\tbreak;\n\t\t\tcase 'gte':\n\t\t\t\tmatches = value != null && recordValue >= value;\n\t\t\t\tbreak;\n\t\t\tcase 'in':\n\t\t\t\tmatches =\n\t\t\t\t\tArray.isArray(value) && (value as unknown[]).includes(recordValue);\n\t\t\t\tbreak;\n\t\t\tcase 'not_in':\n\t\t\t\tmatches =\n\t\t\t\t\tArray.isArray(value) && !(value as unknown[]).includes(recordValue);\n\t\t\t\tbreak;\n\t\t\tcase 'contains':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.includes(value);\n\t\t\t\tbreak;\n\t\t\tcase 'starts_with':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.startsWith(value);\n\t\t\t\tbreak;\n\t\t\tcase 'ends_with':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.endsWith(value);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmatches = recordValue === value;\n\t\t}\n\n\t\t// Apply connector logic\n\t\tif (result === null) {\n\t\t\tresult = matches;\n\t\t} else if (connector === 'OR') {\n\t\t\tresult = result || matches;\n\t\t} else {\n\t\t\t// Default: AND\n\t\t\tresult = result && matches;\n\t\t}\n\t}\n\n\treturn result ?? true;\n}\ntype SortBy = {\n\tfield: string;\n\tdirection: 'asc' | 'desc';\n};\n\nfunction applySorting(records: any[], sortBy?: SortBy): any[] {\n\tif (!sortBy) return records;\n\n\tconst { field, direction } = sortBy;\n\n\treturn records.sort((a, b) => {\n\t\tconst aVal = a[field];\n\t\tconst bVal = b[field];\n\n\t\tif (aVal === bVal) return 0;\n\t\tif (aVal == null) return direction === 'asc' ? -1 : 1;\n\t\tif (bVal == null) return direction === 'asc' ? 1 : -1;\n\n\t\tconst comparison = aVal < bVal ? -1 : 1;\n\t\treturn direction === 'asc' ? comparison : -comparison;\n\t});\n}\n\nexport const memoryAdapter = (\n\tconfig: MemoryAdapterConfig = {},\n\tstore = new Map(),\n) => {\n\tconst storeInstance = new MemoryStore(config.initialData, store);\n\n\tconst adapterInstance = createAdapterFactory({\n\t\tconfig: {\n\t\t\tadapterId: 'memory-adapter',\n\t\t\tadapterName: 'Memory Adapter',\n\t\t\tusePlural: config.usePlural ?? false,\n\t\t\tdebugLogs: config.debugLogs ?? false,\n\t\t\tsupportsJSON: true,\n\t\t\tsupportsDates: true,\n\t\t\tsupportsBooleans: true,\n\t\t\tsupportsNumericIds: false,\n\t\t},\n\n\t\t// Note: The framework automatically transforms field names in both directions:\n\t\t// - Input data is already transformed before reaching the adapter (e.g., email -> email_address)\n\t\t// - Output data is automatically transformed after the adapter returns (e.g., email_address -> email)\n\t\t// Therefore, we should NOT call transformInput or transformOutput ourselves.\n\t\tadapter: ({ debugLog, getModelName, transformWhereClause }) => ({\n\t\t\tcreate: async ({ data, model }) => {\n\t\t\t\tdebugLog('CREATE', { model, data });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\n\t\t\t\t// Data is already transformed by the framework - store directly\n\t\t\t\tconst record = data as Record<string, unknown>;\n\t\t\t\tif (!record.id) {\n\t\t\t\t\trecord.id = crypto.randomUUID();\n\t\t\t\t}\n\n\t\t\t\tconst id = record.id as string;\n\t\t\t\tmodelData.set(id, { ...record });\n\t\t\t\treturn modelData.get(id);\n\t\t\t},\n\n\t\t\tfindOne: async ({ where, model }) => {\n\t\t\t\tdebugLog('FIND_ONE', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'findOne',\n\t\t\t\t});\n\n\t\t\t\tfor (const record of modelData.values()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\treturn record;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t},\n\n\t\t\tfindMany: async ({ where, model, limit, offset, sortBy }) => {\n\t\t\t\tdebugLog('FIND_MANY', { model, where });\n\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'findMany',\n\t\t\t\t});\n\n\t\t\t\tlet results = Array.from(modelData.values()).filter((record) =>\n\t\t\t\t\tmatchesWhere(record, transformedWhere),\n\t\t\t\t);\n\n\t\t\t\tif (sortBy) {\n\t\t\t\t\tresults = applySorting(results, sortBy);\n\t\t\t\t}\n\n\t\t\t\tif (offset) {\n\t\t\t\t\tresults = results.slice(offset);\n\t\t\t\t}\n\t\t\t\tif (limit) {\n\t\t\t\t\tresults = results.slice(0, limit);\n\t\t\t\t}\n\n\t\t\t\treturn results;\n\t\t\t},\n\n\t\t\tupdate: async ({ where, update, model }) => {\n\t\t\t\tdebugLog('UPDATE', { model, where });\n\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'update',\n\t\t\t\t});\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\t// Update data is already transformed by the framework\n\t\t\t\t\t\tconst updated = { ...record, ...update };\n\t\t\t\t\t\tmodelData.set(id, updated);\n\t\t\t\t\t\treturn updated;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t},\n\n\t\t\tupdateMany: async ({ where, update, model }) => {\n\t\t\t\tdebugLog('UPDATE_MANY', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'updateMany',\n\t\t\t\t});\n\n\t\t\t\tlet count = 0;\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\t// Update data is already transformed by the framework\n\t\t\t\t\t\tmodelData.set(id, { ...record, ...update });\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn count;\n\t\t\t},\n\n\t\t\tdelete: async ({ where, model }) => {\n\t\t\t\tdebugLog('DELETE', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'delete',\n\t\t\t\t});\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\tmodelData.delete(id);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tdeleteMany: async ({ where, model }) => {\n\t\t\t\tdebugLog('DELETE_MANY', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'deleteMany',\n\t\t\t\t});\n\n\t\t\t\tconst toDelete: string[] = [];\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\ttoDelete.push(id);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (const id of toDelete) {\n\t\t\t\t\tmodelData.delete(id);\n\t\t\t\t}\n\t\t\t\treturn toDelete.length;\n\t\t\t},\n\n\t\t\tcount: async ({ where, model }) => {\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'count',\n\t\t\t\t});\n\n\t\t\t\treturn Array.from(modelData.values()).filter((record) =>\n\t\t\t\t\tmatchesWhere(record, transformedWhere),\n\t\t\t\t).length;\n\t\t\t},\n\t\t}),\n\t});\n\n\t// Add utility methods to the adapter\n\treturn Object.assign(adapterInstance, {\n\t\tclear: () => store.clear(),\n\t\tgetAllData: () => storeInstance.getAllData(),\n\t\tgetStore: () => store,\n\t});\n};\n"],"mappings":";;;;AAYA,IAAM,cAAN,MAAkB;CACjB,YACCA,aACiBC,uBAAyB,IAAI,OAC7C;EADgB;AAEjB,MAAI,YACH,MAAK,MAAM,CAAC,OAAO,QAAQ,IAAI,OAAO,QAAQ,YAAY,EAAE;GAC3D,MAAM,4BAAY,IAAI;AACtB,QAAK,MAAM,UAAU,QACpB,WAAU,IAAI,OAAO,IAAI,EAAE,GAAG,OAAQ,EAAC;AAExC,QAAK,KAAK,IAAI,OAAO,UAAU;EAC/B;CAEF;CAED,SAASC,WAAqC;AAC7C,OAAK,KAAK,KAAK,IAAI,UAAU,CAC5B,MAAK,KAAK,IAAI,2BAAW,IAAI,MAAM;AAEpC,SAAO,KAAK,KAAK,IAAI,UAAU;CAC/B;CAED,QAAQ;AACP,OAAK,KAAK,OAAO;CACjB;CAED,aAAa;EACZ,MAAMC,SAAgC,CAAE;AACxC,OAAK,MAAM,CAAC,OAAO,QAAQ,IAAI,KAAK,KAAK,SAAS,CACjD,QAAO,SAAS,MAAM,KAAK,QAAQ,QAAQ,CAAC;AAE7C,SAAO;CACP;AACD;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B,YAAY,MAAM,cAAc,YAAY;EAC5C,UAAU,MAAM;CAChB,EAAC;AACF"}
|
package/dist/better-auth.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _better_auth_core0 from "@better-auth/core";
|
|
2
|
+
import * as better_auth_adapters1 from "better-auth/adapters";
|
|
2
3
|
import { DBAdapterDebugLogOption } from "better-auth/adapters";
|
|
3
4
|
|
|
4
5
|
//#region src/better-auth.d.ts
|
|
@@ -7,7 +8,7 @@ interface MemoryAdapterConfig {
|
|
|
7
8
|
usePlural?: boolean;
|
|
8
9
|
initialData?: Record<string, any[]>;
|
|
9
10
|
}
|
|
10
|
-
declare const memoryAdapter: (config?: MemoryAdapterConfig, store?: Map<any, any>) =>
|
|
11
|
+
declare const memoryAdapter: (config?: MemoryAdapterConfig, store?: Map<any, any>) => better_auth_adapters1.AdapterFactory<_better_auth_core0.BetterAuthOptions> & {
|
|
11
12
|
clear: () => void;
|
|
12
13
|
getAllData: () => Record<string, any[]>;
|
|
13
14
|
getStore: () => Map<any, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"better-auth.d.cts","names":[],"sources":["../src/better-auth.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"better-auth.d.cts","names":[],"sources":["../src/better-auth.ts"],"sourcesContent":[],"mappings":";;;;;UAMU,mBAAA;cACG;;gBAEE;AALe;AAED,cA0IhB,aA1IgB,EAAA,CAAA,MAAA,CAAA,EA2IpB,mBA3IoB,EAAA,KAAA,CAAA,EA4I5B,GA5I4B,CAAA,GAAA,EAAA,GAAA,CAAA,EAAA,GA4IX,qBAAA,CAAA,cA5IW,CA4I5B,kBAAA,CAAiB,iBAAA,CA5IW,GAAA;EAAA,KAChB,EAAA,GAAA,GAAA,IAAA;EAAuB,UAErB,EAAA,GAAA,GAyIG,MAzIH,CAAA,MAAA,EAAA,GAAA,EAAA,CAAA;EAAM,QAAA,EAAA,GAAA,MAAA,CAAA,GAAA,EAAA,GAAA,CAAA;AAuIrB,CAAA"}
|
package/dist/better-auth.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as better_auth_adapters3 from "better-auth/adapters";
|
|
2
2
|
import { DBAdapterDebugLogOption } from "better-auth/adapters";
|
|
3
|
+
import * as _better_auth_core2 from "@better-auth/core";
|
|
3
4
|
|
|
4
5
|
//#region src/better-auth.d.ts
|
|
5
6
|
interface MemoryAdapterConfig {
|
|
@@ -7,7 +8,7 @@ interface MemoryAdapterConfig {
|
|
|
7
8
|
usePlural?: boolean;
|
|
8
9
|
initialData?: Record<string, any[]>;
|
|
9
10
|
}
|
|
10
|
-
declare const memoryAdapter: (config?: MemoryAdapterConfig, store?: Map<any, any>) =>
|
|
11
|
+
declare const memoryAdapter: (config?: MemoryAdapterConfig, store?: Map<any, any>) => better_auth_adapters3.AdapterFactory<_better_auth_core2.BetterAuthOptions> & {
|
|
11
12
|
clear: () => void;
|
|
12
13
|
getAllData: () => Record<string, any[]>;
|
|
13
14
|
getStore: () => Map<any, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"better-auth.d.mts","names":[],"sources":["../src/better-auth.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"better-auth.d.mts","names":[],"sources":["../src/better-auth.ts"],"sourcesContent":[],"mappings":";;;;;UAMU,mBAAA;cACG;;gBAEE;AALe;AAED,cA0IhB,aA1IgB,EAAA,CAAA,MAAA,CAAA,EA2IpB,mBA3IoB,EAAA,KAAA,CAAA,EA4I5B,GA5I4B,CAAA,GAAA,EAAA,GAAA,CAAA,EAAA,GA4IX,qBAAA,CAAA,cA5IW,CA4I5B,kBAAA,CAAiB,iBAAA,CA5IW,GAAA;EAAA,KAChB,EAAA,GAAA,GAAA,IAAA;EAAuB,UAErB,EAAA,GAAA,GAyIG,MAzIH,CAAA,MAAA,EAAA,GAAA,EAAA,CAAA;EAAM,QAAA,EAAA,GAAA,MAAA,CAAA,GAAA,EAAA,GAAA,CAAA;AAuIrB,CAAA"}
|
package/dist/better-auth.mjs
CHANGED
|
@@ -121,7 +121,8 @@ const memoryAdapter = (config = {}, store = /* @__PURE__ */ new Map()) => {
|
|
|
121
121
|
const modelData = storeInstance.getModel(modelName);
|
|
122
122
|
const transformedWhere = transformWhereClause({
|
|
123
123
|
model,
|
|
124
|
-
where
|
|
124
|
+
where,
|
|
125
|
+
action: "findOne"
|
|
125
126
|
});
|
|
126
127
|
for (const record of modelData.values()) if (matchesWhere(record, transformedWhere)) return record;
|
|
127
128
|
return null;
|
|
@@ -135,7 +136,8 @@ const memoryAdapter = (config = {}, store = /* @__PURE__ */ new Map()) => {
|
|
|
135
136
|
const modelData = storeInstance.getModel(modelName);
|
|
136
137
|
const transformedWhere = transformWhereClause({
|
|
137
138
|
model,
|
|
138
|
-
where
|
|
139
|
+
where,
|
|
140
|
+
action: "findMany"
|
|
139
141
|
});
|
|
140
142
|
let results = Array.from(modelData.values()).filter((record) => matchesWhere(record, transformedWhere));
|
|
141
143
|
if (sortBy) results = applySorting(results, sortBy);
|
|
@@ -152,7 +154,8 @@ const memoryAdapter = (config = {}, store = /* @__PURE__ */ new Map()) => {
|
|
|
152
154
|
const modelData = storeInstance.getModel(modelName);
|
|
153
155
|
const transformedWhere = transformWhereClause({
|
|
154
156
|
model,
|
|
155
|
-
where
|
|
157
|
+
where,
|
|
158
|
+
action: "update"
|
|
156
159
|
});
|
|
157
160
|
for (const [id, record] of modelData.entries()) if (matchesWhere(record, transformedWhere)) {
|
|
158
161
|
const updated = {
|
|
@@ -173,7 +176,8 @@ const memoryAdapter = (config = {}, store = /* @__PURE__ */ new Map()) => {
|
|
|
173
176
|
const modelData = storeInstance.getModel(modelName);
|
|
174
177
|
const transformedWhere = transformWhereClause({
|
|
175
178
|
model,
|
|
176
|
-
where
|
|
179
|
+
where,
|
|
180
|
+
action: "updateMany"
|
|
177
181
|
});
|
|
178
182
|
let count = 0;
|
|
179
183
|
for (const [id, record] of modelData.entries()) if (matchesWhere(record, transformedWhere)) {
|
|
@@ -194,7 +198,8 @@ const memoryAdapter = (config = {}, store = /* @__PURE__ */ new Map()) => {
|
|
|
194
198
|
const modelData = storeInstance.getModel(modelName);
|
|
195
199
|
const transformedWhere = transformWhereClause({
|
|
196
200
|
model,
|
|
197
|
-
where
|
|
201
|
+
where,
|
|
202
|
+
action: "delete"
|
|
198
203
|
});
|
|
199
204
|
for (const [id, record] of modelData.entries()) if (matchesWhere(record, transformedWhere)) {
|
|
200
205
|
modelData.delete(id);
|
|
@@ -210,7 +215,8 @@ const memoryAdapter = (config = {}, store = /* @__PURE__ */ new Map()) => {
|
|
|
210
215
|
const modelData = storeInstance.getModel(modelName);
|
|
211
216
|
const transformedWhere = transformWhereClause({
|
|
212
217
|
model,
|
|
213
|
-
where
|
|
218
|
+
where,
|
|
219
|
+
action: "deleteMany"
|
|
214
220
|
});
|
|
215
221
|
const toDelete = [];
|
|
216
222
|
for (const [id, record] of modelData.entries()) if (matchesWhere(record, transformedWhere)) toDelete.push(id);
|
|
@@ -222,7 +228,8 @@ const memoryAdapter = (config = {}, store = /* @__PURE__ */ new Map()) => {
|
|
|
222
228
|
const modelData = storeInstance.getModel(modelName);
|
|
223
229
|
const transformedWhere = transformWhereClause({
|
|
224
230
|
model,
|
|
225
|
-
where
|
|
231
|
+
where,
|
|
232
|
+
action: "count"
|
|
226
233
|
});
|
|
227
234
|
return Array.from(modelData.values()).filter((record) => matchesWhere(record, transformedWhere)).length;
|
|
228
235
|
}
|
package/dist/better-auth.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"better-auth.mjs","names":["initialData?: Record<string, any[]>","data: Map<string, any>","modelName: string","result: Record<string, any[]>","record: any","where?: Where[]","result: boolean | null","records: any[]","sortBy?: SortBy","config: MemoryAdapterConfig","toDelete: string[]"],"sources":["../src/better-auth.ts"],"sourcesContent":["import {\n\tcreateAdapterFactory,\n\ttype DBAdapterDebugLogOption,\n\ttype Where,\n} from 'better-auth/adapters';\n\ninterface MemoryAdapterConfig {\n\tdebugLogs?: DBAdapterDebugLogOption;\n\tusePlural?: boolean;\n\tinitialData?: Record<string, any[]>;\n}\n\nclass MemoryStore {\n\tconstructor(\n\t\tinitialData?: Record<string, any[]>,\n\t\tprivate readonly data: Map<string, any> = new Map(),\n\t) {\n\t\tif (initialData) {\n\t\t\tfor (const [model, records] of Object.entries(initialData)) {\n\t\t\t\tconst modelData = new Map();\n\t\t\t\tfor (const record of records) {\n\t\t\t\t\tmodelData.set(record.id, { ...record });\n\t\t\t\t}\n\t\t\t\tthis.data.set(model, modelData);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetModel(modelName: string): Map<string, any> {\n\t\tif (!this.data.has(modelName)) {\n\t\t\tthis.data.set(modelName, new Map());\n\t\t}\n\t\treturn this.data.get(modelName)!;\n\t}\n\n\tclear() {\n\t\tthis.data.clear();\n\t}\n\n\tgetAllData() {\n\t\tconst result: Record<string, any[]> = {};\n\t\tfor (const [model, records] of this.data.entries()) {\n\t\t\tresult[model] = Array.from(records.values());\n\t\t}\n\t\treturn result;\n\t}\n}\n\nfunction matchesWhere(record: any, where?: Where[]): boolean {\n\tif (!where || where.length === 0) return true;\n\n\tlet result: boolean | null = null;\n\n\tfor (const condition of where) {\n\t\tconst { field, value, operator = 'eq', connector = 'AND' } = condition;\n\t\tconst recordValue = record[field];\n\n\t\tlet matches = false;\n\n\t\tswitch (operator) {\n\t\t\tcase 'eq':\n\t\t\t\tmatches = recordValue === value;\n\t\t\t\tbreak;\n\t\t\tcase 'ne':\n\t\t\t\tmatches = recordValue !== value;\n\t\t\t\tbreak;\n\t\t\tcase 'lt':\n\t\t\t\tmatches = value != null && recordValue < value;\n\t\t\t\tbreak;\n\t\t\tcase 'lte':\n\t\t\t\tmatches = value != null && recordValue <= value;\n\t\t\t\tbreak;\n\t\t\tcase 'gt':\n\t\t\t\tmatches = value != null && recordValue > value;\n\t\t\t\tbreak;\n\t\t\tcase 'gte':\n\t\t\t\tmatches = value != null && recordValue >= value;\n\t\t\t\tbreak;\n\t\t\tcase 'in':\n\t\t\t\tmatches =\n\t\t\t\t\tArray.isArray(value) && (value as unknown[]).includes(recordValue);\n\t\t\t\tbreak;\n\t\t\tcase 'not_in':\n\t\t\t\tmatches =\n\t\t\t\t\tArray.isArray(value) && !(value as unknown[]).includes(recordValue);\n\t\t\t\tbreak;\n\t\t\tcase 'contains':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.includes(value);\n\t\t\t\tbreak;\n\t\t\tcase 'starts_with':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.startsWith(value);\n\t\t\t\tbreak;\n\t\t\tcase 'ends_with':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.endsWith(value);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmatches = recordValue === value;\n\t\t}\n\n\t\t// Apply connector logic\n\t\tif (result === null) {\n\t\t\tresult = matches;\n\t\t} else if (connector === 'OR') {\n\t\t\tresult = result || matches;\n\t\t} else {\n\t\t\t// Default: AND\n\t\t\tresult = result && matches;\n\t\t}\n\t}\n\n\treturn result ?? true;\n}\ntype SortBy = {\n\tfield: string;\n\tdirection: 'asc' | 'desc';\n};\n\nfunction applySorting(records: any[], sortBy?: SortBy): any[] {\n\tif (!sortBy) return records;\n\n\tconst { field, direction } = sortBy;\n\n\treturn records.sort((a, b) => {\n\t\tconst aVal = a[field];\n\t\tconst bVal = b[field];\n\n\t\tif (aVal === bVal) return 0;\n\t\tif (aVal == null) return direction === 'asc' ? -1 : 1;\n\t\tif (bVal == null) return direction === 'asc' ? 1 : -1;\n\n\t\tconst comparison = aVal < bVal ? -1 : 1;\n\t\treturn direction === 'asc' ? comparison : -comparison;\n\t});\n}\n\nexport const memoryAdapter = (\n\tconfig: MemoryAdapterConfig = {},\n\tstore = new Map(),\n) => {\n\tconst storeInstance = new MemoryStore(config.initialData, store);\n\n\tconst adapterInstance = createAdapterFactory({\n\t\tconfig: {\n\t\t\tadapterId: 'memory-adapter',\n\t\t\tadapterName: 'Memory Adapter',\n\t\t\tusePlural: config.usePlural ?? false,\n\t\t\tdebugLogs: config.debugLogs ?? false,\n\t\t\tsupportsJSON: true,\n\t\t\tsupportsDates: true,\n\t\t\tsupportsBooleans: true,\n\t\t\tsupportsNumericIds: false,\n\t\t},\n\n\t\t// Note: The framework automatically transforms field names in both directions:\n\t\t// - Input data is already transformed before reaching the adapter (e.g., email -> email_address)\n\t\t// - Output data is automatically transformed after the adapter returns (e.g., email_address -> email)\n\t\t// Therefore, we should NOT call transformInput or transformOutput ourselves.\n\t\tadapter: ({ debugLog, getModelName, transformWhereClause }) => ({\n\t\t\tcreate: async ({ data, model }) => {\n\t\t\t\tdebugLog('CREATE', { model, data });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\n\t\t\t\t// Data is already transformed by the framework - store directly\n\t\t\t\tconst record = data as Record<string, unknown>;\n\t\t\t\tif (!record.id) {\n\t\t\t\t\trecord.id = crypto.randomUUID();\n\t\t\t\t}\n\n\t\t\t\tconst id = record.id as string;\n\t\t\t\tmodelData.set(id, { ...record });\n\t\t\t\treturn modelData.get(id);\n\t\t\t},\n\n\t\t\tfindOne: async ({ where, model }) => {\n\t\t\t\tdebugLog('FIND_ONE', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({ model, where });\n\n\t\t\t\tfor (const record of modelData.values()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\treturn record;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t},\n\n\t\t\tfindMany: async ({ where, model, limit, offset, sortBy }) => {\n\t\t\t\tdebugLog('FIND_MANY', { model, where });\n\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({ model, where });\n\n\t\t\t\tlet results = Array.from(modelData.values()).filter((record) =>\n\t\t\t\t\tmatchesWhere(record, transformedWhere),\n\t\t\t\t);\n\n\t\t\t\tif (sortBy) {\n\t\t\t\t\tresults = applySorting(results, sortBy);\n\t\t\t\t}\n\n\t\t\t\tif (offset) {\n\t\t\t\t\tresults = results.slice(offset);\n\t\t\t\t}\n\t\t\t\tif (limit) {\n\t\t\t\t\tresults = results.slice(0, limit);\n\t\t\t\t}\n\n\t\t\t\treturn results;\n\t\t\t},\n\n\t\t\tupdate: async ({ where, update, model }) => {\n\t\t\t\tdebugLog('UPDATE', { model, where });\n\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({ model, where });\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\t// Update data is already transformed by the framework\n\t\t\t\t\t\tconst updated = { ...record, ...update };\n\t\t\t\t\t\tmodelData.set(id, updated);\n\t\t\t\t\t\treturn updated;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t},\n\n\t\t\tupdateMany: async ({ where, update, model }) => {\n\t\t\t\tdebugLog('UPDATE_MANY', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({ model, where });\n\n\t\t\t\tlet count = 0;\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\t// Update data is already transformed by the framework\n\t\t\t\t\t\tmodelData.set(id, { ...record, ...update });\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn count;\n\t\t\t},\n\n\t\t\tdelete: async ({ where, model }) => {\n\t\t\t\tdebugLog('DELETE', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({ model, where });\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\tmodelData.delete(id);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tdeleteMany: async ({ where, model }) => {\n\t\t\t\tdebugLog('DELETE_MANY', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({ model, where });\n\n\t\t\t\tconst toDelete: string[] = [];\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\ttoDelete.push(id);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (const id of toDelete) {\n\t\t\t\t\tmodelData.delete(id);\n\t\t\t\t}\n\t\t\t\treturn toDelete.length;\n\t\t\t},\n\n\t\t\tcount: async ({ where, model }) => {\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({ model, where });\n\n\t\t\t\treturn Array.from(modelData.values()).filter((record) =>\n\t\t\t\t\tmatchesWhere(record, transformedWhere),\n\t\t\t\t).length;\n\t\t\t},\n\t\t}),\n\t});\n\n\t// Add utility methods to the adapter\n\treturn Object.assign(adapterInstance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AO,EAAC;IACzC,MAAM,YAAY,aAAa,MAAM;IACrC,MAAM,YAAY,cAAc,SAAS,UAAU;IACnD,MAAM,mBAAmB,qBAAqB;KAAE;KAAO;IAAO,EAAC;IAE/D,MAAMC,WAAqB,CAAE;AAC7B,SAAK,MAAM,CAAC,IAAI,OAAO,IAAI,UAAU,SAAS,CAC7C,KAAI,aAAa,QAAQ,iBAAiB,CACzC,UAAS,KAAK,GAAG;AAInB,SAAK,MAAM,MAAM,SAChB,WAAU,OAAO,GAAG;AAErB,WAAO,SAAS;GAChB;GAED,OAAO,OAAO,EAAE,OAAO,OAAO,KAAK;IAClC,MAAM,YAAY,aAAa,MAAM;IACrC,MAAM,YAAY,cAAc,SAAS,UAAU;IACnD,MAAM,mBAAmB,qBAAqB;KAAE;KAAO;IAAO,EAAC;AAE/D,WAAO,MAAM,KAAK,UAAU,QAAQ,CAAC,CAAC,OAAO,CAAC,WAC7C,aAAa,QAAQ,iBAAiB,CACtC,CAAC;GACF;EACD;CACD,EAAC;AAGF,QAAO,OAAO,OAAO,iBAAiB;EACrC,OAAO,MAAM,MAAM,OAAO;EAC1B,YAAY,MAAM,cAAc,YAAY;EAC5C,UAAU,MAAM;CAChB,EAAC;AACF"}
|
|
1
|
+
{"version":3,"file":"better-auth.mjs","names":["initialData?: Record<string, any[]>","data: Map<string, any>","modelName: string","result: Record<string, any[]>","record: any","where?: Where[]","result: boolean | null","records: any[]","sortBy?: SortBy","config: MemoryAdapterConfig","toDelete: string[]"],"sources":["../src/better-auth.ts"],"sourcesContent":["import {\n\tcreateAdapterFactory,\n\ttype DBAdapterDebugLogOption,\n\ttype Where,\n} from 'better-auth/adapters';\n\ninterface MemoryAdapterConfig {\n\tdebugLogs?: DBAdapterDebugLogOption;\n\tusePlural?: boolean;\n\tinitialData?: Record<string, any[]>;\n}\n\nclass MemoryStore {\n\tconstructor(\n\t\tinitialData?: Record<string, any[]>,\n\t\tprivate readonly data: Map<string, any> = new Map(),\n\t) {\n\t\tif (initialData) {\n\t\t\tfor (const [model, records] of Object.entries(initialData)) {\n\t\t\t\tconst modelData = new Map();\n\t\t\t\tfor (const record of records) {\n\t\t\t\t\tmodelData.set(record.id, { ...record });\n\t\t\t\t}\n\t\t\t\tthis.data.set(model, modelData);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetModel(modelName: string): Map<string, any> {\n\t\tif (!this.data.has(modelName)) {\n\t\t\tthis.data.set(modelName, new Map());\n\t\t}\n\t\treturn this.data.get(modelName)!;\n\t}\n\n\tclear() {\n\t\tthis.data.clear();\n\t}\n\n\tgetAllData() {\n\t\tconst result: Record<string, any[]> = {};\n\t\tfor (const [model, records] of this.data.entries()) {\n\t\t\tresult[model] = Array.from(records.values());\n\t\t}\n\t\treturn result;\n\t}\n}\n\nfunction matchesWhere(record: any, where?: Where[]): boolean {\n\tif (!where || where.length === 0) return true;\n\n\tlet result: boolean | null = null;\n\n\tfor (const condition of where) {\n\t\tconst { field, value, operator = 'eq', connector = 'AND' } = condition;\n\t\tconst recordValue = record[field];\n\n\t\tlet matches = false;\n\n\t\tswitch (operator) {\n\t\t\tcase 'eq':\n\t\t\t\tmatches = recordValue === value;\n\t\t\t\tbreak;\n\t\t\tcase 'ne':\n\t\t\t\tmatches = recordValue !== value;\n\t\t\t\tbreak;\n\t\t\tcase 'lt':\n\t\t\t\tmatches = value != null && recordValue < value;\n\t\t\t\tbreak;\n\t\t\tcase 'lte':\n\t\t\t\tmatches = value != null && recordValue <= value;\n\t\t\t\tbreak;\n\t\t\tcase 'gt':\n\t\t\t\tmatches = value != null && recordValue > value;\n\t\t\t\tbreak;\n\t\t\tcase 'gte':\n\t\t\t\tmatches = value != null && recordValue >= value;\n\t\t\t\tbreak;\n\t\t\tcase 'in':\n\t\t\t\tmatches =\n\t\t\t\t\tArray.isArray(value) && (value as unknown[]).includes(recordValue);\n\t\t\t\tbreak;\n\t\t\tcase 'not_in':\n\t\t\t\tmatches =\n\t\t\t\t\tArray.isArray(value) && !(value as unknown[]).includes(recordValue);\n\t\t\t\tbreak;\n\t\t\tcase 'contains':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.includes(value);\n\t\t\t\tbreak;\n\t\t\tcase 'starts_with':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.startsWith(value);\n\t\t\t\tbreak;\n\t\t\tcase 'ends_with':\n\t\t\t\tmatches =\n\t\t\t\t\ttypeof recordValue === 'string' &&\n\t\t\t\t\ttypeof value === 'string' &&\n\t\t\t\t\trecordValue.endsWith(value);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmatches = recordValue === value;\n\t\t}\n\n\t\t// Apply connector logic\n\t\tif (result === null) {\n\t\t\tresult = matches;\n\t\t} else if (connector === 'OR') {\n\t\t\tresult = result || matches;\n\t\t} else {\n\t\t\t// Default: AND\n\t\t\tresult = result && matches;\n\t\t}\n\t}\n\n\treturn result ?? true;\n}\ntype SortBy = {\n\tfield: string;\n\tdirection: 'asc' | 'desc';\n};\n\nfunction applySorting(records: any[], sortBy?: SortBy): any[] {\n\tif (!sortBy) return records;\n\n\tconst { field, direction } = sortBy;\n\n\treturn records.sort((a, b) => {\n\t\tconst aVal = a[field];\n\t\tconst bVal = b[field];\n\n\t\tif (aVal === bVal) return 0;\n\t\tif (aVal == null) return direction === 'asc' ? -1 : 1;\n\t\tif (bVal == null) return direction === 'asc' ? 1 : -1;\n\n\t\tconst comparison = aVal < bVal ? -1 : 1;\n\t\treturn direction === 'asc' ? comparison : -comparison;\n\t});\n}\n\nexport const memoryAdapter = (\n\tconfig: MemoryAdapterConfig = {},\n\tstore = new Map(),\n) => {\n\tconst storeInstance = new MemoryStore(config.initialData, store);\n\n\tconst adapterInstance = createAdapterFactory({\n\t\tconfig: {\n\t\t\tadapterId: 'memory-adapter',\n\t\t\tadapterName: 'Memory Adapter',\n\t\t\tusePlural: config.usePlural ?? false,\n\t\t\tdebugLogs: config.debugLogs ?? false,\n\t\t\tsupportsJSON: true,\n\t\t\tsupportsDates: true,\n\t\t\tsupportsBooleans: true,\n\t\t\tsupportsNumericIds: false,\n\t\t},\n\n\t\t// Note: The framework automatically transforms field names in both directions:\n\t\t// - Input data is already transformed before reaching the adapter (e.g., email -> email_address)\n\t\t// - Output data is automatically transformed after the adapter returns (e.g., email_address -> email)\n\t\t// Therefore, we should NOT call transformInput or transformOutput ourselves.\n\t\tadapter: ({ debugLog, getModelName, transformWhereClause }) => ({\n\t\t\tcreate: async ({ data, model }) => {\n\t\t\t\tdebugLog('CREATE', { model, data });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\n\t\t\t\t// Data is already transformed by the framework - store directly\n\t\t\t\tconst record = data as Record<string, unknown>;\n\t\t\t\tif (!record.id) {\n\t\t\t\t\trecord.id = crypto.randomUUID();\n\t\t\t\t}\n\n\t\t\t\tconst id = record.id as string;\n\t\t\t\tmodelData.set(id, { ...record });\n\t\t\t\treturn modelData.get(id);\n\t\t\t},\n\n\t\t\tfindOne: async ({ where, model }) => {\n\t\t\t\tdebugLog('FIND_ONE', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'findOne',\n\t\t\t\t});\n\n\t\t\t\tfor (const record of modelData.values()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\treturn record;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t},\n\n\t\t\tfindMany: async ({ where, model, limit, offset, sortBy }) => {\n\t\t\t\tdebugLog('FIND_MANY', { model, where });\n\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'findMany',\n\t\t\t\t});\n\n\t\t\t\tlet results = Array.from(modelData.values()).filter((record) =>\n\t\t\t\t\tmatchesWhere(record, transformedWhere),\n\t\t\t\t);\n\n\t\t\t\tif (sortBy) {\n\t\t\t\t\tresults = applySorting(results, sortBy);\n\t\t\t\t}\n\n\t\t\t\tif (offset) {\n\t\t\t\t\tresults = results.slice(offset);\n\t\t\t\t}\n\t\t\t\tif (limit) {\n\t\t\t\t\tresults = results.slice(0, limit);\n\t\t\t\t}\n\n\t\t\t\treturn results;\n\t\t\t},\n\n\t\t\tupdate: async ({ where, update, model }) => {\n\t\t\t\tdebugLog('UPDATE', { model, where });\n\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'update',\n\t\t\t\t});\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\t// Update data is already transformed by the framework\n\t\t\t\t\t\tconst updated = { ...record, ...update };\n\t\t\t\t\t\tmodelData.set(id, updated);\n\t\t\t\t\t\treturn updated;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t},\n\n\t\t\tupdateMany: async ({ where, update, model }) => {\n\t\t\t\tdebugLog('UPDATE_MANY', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'updateMany',\n\t\t\t\t});\n\n\t\t\t\tlet count = 0;\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\t// Update data is already transformed by the framework\n\t\t\t\t\t\tmodelData.set(id, { ...record, ...update });\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn count;\n\t\t\t},\n\n\t\t\tdelete: async ({ where, model }) => {\n\t\t\t\tdebugLog('DELETE', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'delete',\n\t\t\t\t});\n\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\tmodelData.delete(id);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tdeleteMany: async ({ where, model }) => {\n\t\t\t\tdebugLog('DELETE_MANY', { model, where });\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'deleteMany',\n\t\t\t\t});\n\n\t\t\t\tconst toDelete: string[] = [];\n\t\t\t\tfor (const [id, record] of modelData.entries()) {\n\t\t\t\t\tif (matchesWhere(record, transformedWhere)) {\n\t\t\t\t\t\ttoDelete.push(id);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (const id of toDelete) {\n\t\t\t\t\tmodelData.delete(id);\n\t\t\t\t}\n\t\t\t\treturn toDelete.length;\n\t\t\t},\n\n\t\t\tcount: async ({ where, model }) => {\n\t\t\t\tconst modelName = getModelName(model);\n\t\t\t\tconst modelData = storeInstance.getModel(modelName);\n\t\t\t\tconst transformedWhere = transformWhereClause({\n\t\t\t\t\tmodel,\n\t\t\t\t\twhere,\n\t\t\t\t\taction: 'count',\n\t\t\t\t});\n\n\t\t\t\treturn Array.from(modelData.values()).filter((record) =>\n\t\t\t\t\tmatchesWhere(record, transformedWhere),\n\t\t\t\t).length;\n\t\t\t},\n\t\t}),\n\t});\n\n\t// Add utility methods to the adapter\n\treturn Object.assign(adapterInstance, {\n\t\tclear: () => store.clear(),\n\t\tgetAllData: () => storeInstance.getAllData(),\n\t\tgetStore: () => store,\n\t});\n};\n"],"mappings":";;;AAYA,IAAM,cAAN,MAAkB;CACjB,YACCA,aACiBC,uBAAyB,IAAI,OAC7C;EADgB;AAEjB,MAAI,YACH,MAAK,MAAM,CAAC,OAAO,QAAQ,IAAI,OAAO,QAAQ,YAAY,EAAE;GAC3D,MAAM,4BAAY,IAAI;AACtB,QAAK,MAAM,UAAU,QACpB,WAAU,IAAI,OAAO,IAAI,EAAE,GAAG,OAAQ,EAAC;AAExC,QAAK,KAAK,IAAI,OAAO,UAAU;EAC/B;CAEF;CAED,SAASC,WAAqC;AAC7C,OAAK,KAAK,KAAK,IAAI,UAAU,CAC5B,MAAK,KAAK,IAAI,2BAAW,IAAI,MAAM;AAEpC,SAAO,KAAK,KAAK,IAAI,UAAU;CAC/B;CAED,QAAQ;AACP,OAAK,KAAK,OAAO;CACjB;CAED,aAAa;EACZ,MAAMC,SAAgC,CAAE;AACxC,OAAK,MAAM,CAAC,OAAO,QAAQ,IAAI,KAAK,KAAK,SAAS,CACjD,QAAO,SAAS,MAAM,KAAK,QAAQ,QAAQ,CAAC;AAE7C,SAAO;CACP;AACD;AAED,SAAS,aAAaC,QAAaC,OAA0B;AAC5D,MAAK,SAAS,MAAM,WAAW,EAAG,QAAO;CAEzC,IAAIC,SAAyB;AAE7B,MAAK,MAAM,aAAa,OAAO;EAC9B,MAAM,EAAE,OAAO,OAAO,WAAW,MAAM,YAAY,OAAO,GAAG;EAC7D,MAAM,cAAc,OAAO;EAE3B,IAAI,UAAU;AAEd,UAAQ,UAAR;GAC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mBAAmB,qBAAqB;KAC7C;KACA;KACA,QAAQ;IACR,EAAC;AAEF,SAAK,MAAM,CAAC,IAAI,OAAO,IAAI,UAAU,SAAS,CAC7C,KAAI,aAAa,QAAQ,iBAAiB,EAAE;AAC3C,eAAU,OAAO,GAAG;AACpB;IACA;GAEF;GAED,YAAY,OAAO,EAAE,OAAO,OAAO,KAAK;AACvC,aAAS,eAAe;KAAE;KAAO;IAAO,EAAC;IACzC,MAAM,YAAY,aAAa,MAAM;IACrC,MAAM,YAAY,cAAc,SAAS,UAAU;IACnD,MAAM,mBAAmB,qBAAqB;KAC7C;KACA;KACA,QAAQ;IACR,EAAC;IAEF,MAAMC,WAAqB,CAAE;AAC7B,SAAK,MAAM,CAAC,IAAI,OAAO,IAAI,UAAU,SAAS,CAC7C,KAAI,aAAa,QAAQ,iBAAiB,CACzC,UAAS,KAAK,GAAG;AAInB,SAAK,MAAM,MAAM,SAChB,WAAU,OAAO,GAAG;AAErB,WAAO,SAAS;GAChB;GAED,OAAO,OAAO,EAAE,OAAO,OAAO,KAAK;IAClC,MAAM,YAAY,aAAa,MAAM;IACrC,MAAM,YAAY,cAAc,SAAS,UAAU;IACnD,MAAM,mBAAmB,qBAAqB;KAC7C;KACA;KACA,QAAQ;IACR,EAAC;AAEF,WAAO,MAAM,KAAK,UAAU,QAAQ,CAAC,CAAC,OAAO,CAAC,WAC7C,aAAa,QAAQ,iBAAiB,CACtC,CAAC;GACF;EACD;CACD,EAAC;AAGF,QAAO,OAAO,OAAO,iBAAiB;EACrC,OAAO,MAAM,MAAM,OAAO;EAC1B,YAAY,MAAM,cAAc,YAAY;EAC5C,UAAU,MAAM;CAChB,EAAC;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as vitest7 from "vitest";
|
|
2
2
|
|
|
3
3
|
//#region src/os/directory.d.ts
|
|
4
|
-
declare const itWithDir:
|
|
4
|
+
declare const itWithDir: vitest7.TestAPI<{
|
|
5
5
|
dir: string;
|
|
6
6
|
}>;
|
|
7
7
|
interface DirectoryFixtures {
|
|
@@ -10,4 +10,4 @@ interface DirectoryFixtures {
|
|
|
10
10
|
//# sourceMappingURL=directory.d.ts.map
|
|
11
11
|
//#endregion
|
|
12
12
|
export { DirectoryFixtures, itWithDir };
|
|
13
|
-
//# sourceMappingURL=directory-
|
|
13
|
+
//# sourceMappingURL=directory-zIEh5ZPl.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directory-
|
|
1
|
+
{"version":3,"file":"directory-zIEh5ZPl.d.cts","names":[],"sources":["../src/os/directory.ts"],"sourcesContent":[],"mappings":";;;cAMa,WAeX,OAAA,CAfoB;;;AAAT,UAiBI,iBAAA,CAjBK;EAiBL,GAAA,EAAA,MAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _faker_js_faker4 from "@faker-js/faker";
|
|
2
2
|
|
|
3
3
|
//#region src/faker.d.ts
|
|
4
4
|
|
|
@@ -134,7 +134,7 @@ declare function coordinateOutsideRadius(center: Coordinate, minRadiusMeters: nu
|
|
|
134
134
|
* const productPrice = faker.price();
|
|
135
135
|
* ```
|
|
136
136
|
*/
|
|
137
|
-
declare const faker$1: Readonly<
|
|
137
|
+
declare const faker$1: Readonly<_faker_js_faker4.Faker & {
|
|
138
138
|
timestamps: typeof timestamps;
|
|
139
139
|
identifier: typeof identifier;
|
|
140
140
|
sequence: typeof sequence;
|
|
@@ -163,4 +163,4 @@ type Timestamps = {
|
|
|
163
163
|
type FakerFactory = typeof faker$1;
|
|
164
164
|
//#endregion
|
|
165
165
|
export { FakerFactory, Timestamps, coordinateInRadius, faker$1 as faker, identifier, resetAllSequences, resetSequence, sequence, timestamps };
|
|
166
|
-
//# sourceMappingURL=faker-
|
|
166
|
+
//# sourceMappingURL=faker-B6bmbGCM.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faker-
|
|
1
|
+
{"version":3,"file":"faker-B6bmbGCM.d.mts","names":[],"sources":["../src/faker.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkFA;AA2BA;AAmCA;AA2BA;AA0BA;AAEC;AAca;AASd;;;;AAGa;AA4BZ;;;;AAMY;AA2DA,iBA5OG,UAAA,CAAA,CAyPf,EAzP6B,UAyP7B;;;;;;;;;;;;AAbiB;AAmBlB;;AAEY,iBAtOI,UAAA,CAsOJ,MAAA,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA;;AAEI;AAOhB;;;;;;;;;;;;;;;;;;iBA5MgB,QAAA;;;;;;;;;;;;;;;;;;;iBA2BA,aAAA;;;;;;;;;;;;;;;;;;iBA0BA,iBAAA,CAAA;;;;;;;;;;;;;iBAgBP,KAAA,CAAA;KAIJ,UAAA;;;;iBAKW,kBAAA,SACP,6BAEN;iBA8BM,uBAAA,SACA,+DAGN;;;;;;;;;;;;;;;;;;;;cA2DU,SAAK,SAajB,gBAAA,CAbiB,KAAA;qBAAA;;;;;;;;;;;;;;;KAmBN,UAAA;;aAEA;;aAEA;;;;;;KAOA,YAAA,UAAsB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _faker_js_faker2 from "@faker-js/faker";
|
|
2
2
|
|
|
3
3
|
//#region src/faker.d.ts
|
|
4
4
|
|
|
@@ -134,7 +134,7 @@ declare function coordinateOutsideRadius(center: Coordinate, minRadiusMeters: nu
|
|
|
134
134
|
* const productPrice = faker.price();
|
|
135
135
|
* ```
|
|
136
136
|
*/
|
|
137
|
-
declare const faker: Readonly<
|
|
137
|
+
declare const faker: Readonly<_faker_js_faker2.Faker & {
|
|
138
138
|
timestamps: typeof timestamps;
|
|
139
139
|
identifier: typeof identifier;
|
|
140
140
|
sequence: typeof sequence;
|
|
@@ -163,4 +163,4 @@ type Timestamps = {
|
|
|
163
163
|
type FakerFactory = typeof faker;
|
|
164
164
|
//#endregion
|
|
165
165
|
export { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps };
|
|
166
|
-
//# sourceMappingURL=faker-
|
|
166
|
+
//# sourceMappingURL=faker-DvxiCtxc.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faker-
|
|
1
|
+
{"version":3,"file":"faker-DvxiCtxc.d.cts","names":[],"sources":["../src/faker.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkFA;AA2BA;AAmCA;AA2BA;AA0BA;AAEC;AAca;AASd;;;;AAGa;AA4BZ;;;;AAMY;AA2DA,iBA5OG,UAAA,CAAA,CAyPf,EAzP6B,UAyP7B;;;;;;;;;;;;AAbiB;AAmBlB;;AAEY,iBAtOI,UAAA,CAsOJ,MAAA,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA;;AAEI;AAOhB;;;;;;;;;;;;;;;;;;iBA5MgB,QAAA;;;;;;;;;;;;;;;;;;;iBA2BA,aAAA;;;;;;;;;;;;;;;;;;iBA0BA,iBAAA,CAAA;;;;;;;;;;;;;iBAgBP,KAAA,CAAA;KAIJ,UAAA;;;;iBAKW,kBAAA,SACP,6BAEN;iBA8BM,uBAAA,SACA,+DAGN;;;;;;;;;;;;;;;;;;;;cA2DU,OAAK,SAajB,gBAAA,CAbiB,KAAA;qBAAA;;;;;;;;;;;;;;;KAmBN,UAAA;;aAEA;;aAEA;;;;;;KAOA,YAAA,UAAsB"}
|
package/dist/faker.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps } from "./faker-
|
|
1
|
+
import { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps } from "./faker-DvxiCtxc.cjs";
|
|
2
2
|
export { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps };
|
package/dist/faker.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps } from "./faker-
|
|
1
|
+
import { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps } from "./faker-B6bmbGCM.mjs";
|
|
2
2
|
export { FakerFactory, Timestamps, coordinateInRadius, faker, identifier, resetAllSequences, resetSequence, sequence, timestamps };
|
package/dist/kysely.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FakerFactory, faker } from "./faker-
|
|
2
|
-
import { ExtractSeedAttrs, FactorySeed } from "./Factory-
|
|
3
|
-
import { KyselyFactory } from "./KyselyFactory-
|
|
1
|
+
import { FakerFactory, faker } from "./faker-DvxiCtxc.cjs";
|
|
2
|
+
import { ExtractSeedAttrs, FactorySeed } from "./Factory-AWn1IulI.cjs";
|
|
3
|
+
import { KyselyFactory } from "./KyselyFactory-CxUJCi--.cjs";
|
|
4
4
|
import "./PostgresMigrator-CeYy-eHF.cjs";
|
|
5
5
|
import { PostgresKyselyMigrator } from "./PostgresKyselyMigrator-B2M6Gjvv.cjs";
|
|
6
6
|
import { DatabaseConnection, DatabaseFixtures, ExtendedDatabaseFixtures, FixtureCreators, IsolationLevel, TestWithExtendedFixtures, TransactionWrapperOptions } from "./VitestTransactionIsolator-glcxyS_R.cjs";
|
package/dist/kysely.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FakerFactory, faker } from "./faker-
|
|
2
|
-
import { ExtractSeedAttrs, FactorySeed } from "./Factory-
|
|
3
|
-
import { KyselyFactory } from "./KyselyFactory-
|
|
1
|
+
import { FakerFactory, faker } from "./faker-B6bmbGCM.mjs";
|
|
2
|
+
import { ExtractSeedAttrs, FactorySeed } from "./Factory-C15SSK8_.mjs";
|
|
3
|
+
import { KyselyFactory } from "./KyselyFactory-C9Snz24z.mjs";
|
|
4
4
|
import "./PostgresMigrator-C_QQ6q35.mjs";
|
|
5
5
|
import { PostgresKyselyMigrator } from "./PostgresKyselyMigrator-CvwXycJE.mjs";
|
|
6
6
|
import { DatabaseConnection, DatabaseFixtures, ExtendedDatabaseFixtures, FixtureCreators, IsolationLevel, TestWithExtendedFixtures, TransactionWrapperOptions } from "./VitestTransactionIsolator-BLaw80cx.mjs";
|
package/dist/objection.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FakerFactory, faker } from "./faker-
|
|
2
|
-
import { ExtractSeedAttrs, FactorySeed } from "./Factory-
|
|
3
|
-
import { ObjectionFactory } from "./ObjectionFactory-
|
|
1
|
+
import { FakerFactory, faker } from "./faker-DvxiCtxc.cjs";
|
|
2
|
+
import { ExtractSeedAttrs, FactorySeed } from "./Factory-AWn1IulI.cjs";
|
|
3
|
+
import { ObjectionFactory } from "./ObjectionFactory-CYvaa0kU.cjs";
|
|
4
4
|
import "./PostgresMigrator-CeYy-eHF.cjs";
|
|
5
5
|
import { PostgresObjectionMigrator } from "./PostgresObjectionMigrator-DHVC9h_P.cjs";
|
|
6
6
|
import { DatabaseConnection, DatabaseFixtures, ExtendedDatabaseFixtures, FixtureCreators, IsolationLevel, TestWithExtendedFixtures, TransactionWrapperOptions } from "./VitestTransactionIsolator-glcxyS_R.cjs";
|
package/dist/objection.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FakerFactory, faker } from "./faker-
|
|
2
|
-
import { ExtractSeedAttrs, FactorySeed } from "./Factory-
|
|
3
|
-
import { ObjectionFactory } from "./ObjectionFactory-
|
|
1
|
+
import { FakerFactory, faker } from "./faker-B6bmbGCM.mjs";
|
|
2
|
+
import { ExtractSeedAttrs, FactorySeed } from "./Factory-C15SSK8_.mjs";
|
|
3
|
+
import { ObjectionFactory } from "./ObjectionFactory-Cf2WI4o_.mjs";
|
|
4
4
|
import "./PostgresMigrator-C_QQ6q35.mjs";
|
|
5
5
|
import { PostgresObjectionMigrator } from "./PostgresObjectionMigrator-1j6YIB1c.mjs";
|
|
6
6
|
import { DatabaseConnection, DatabaseFixtures, ExtendedDatabaseFixtures, FixtureCreators, IsolationLevel, TestWithExtendedFixtures, TransactionWrapperOptions } from "./VitestTransactionIsolator-BLaw80cx.mjs";
|
package/dist/os/directory.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DirectoryFixtures, itWithDir } from "../directory-
|
|
1
|
+
import { DirectoryFixtures, itWithDir } from "../directory-zIEh5ZPl.cjs";
|
|
2
2
|
export { DirectoryFixtures, itWithDir };
|
package/dist/os/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { itWithDir } from "../directory-
|
|
1
|
+
import { itWithDir } from "../directory-zIEh5ZPl.cjs";
|
|
2
2
|
export { itWithDir };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geekmidas/testkit",
|
|
3
|
-
"version": "10.0.0-alpha.
|
|
3
|
+
"version": "10.0.0-alpha.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -119,16 +119,16 @@
|
|
|
119
119
|
"dist"
|
|
120
120
|
],
|
|
121
121
|
"dependencies": {
|
|
122
|
-
"@faker-js/faker": "~
|
|
123
|
-
"@geekmidas/envkit": "^10.0.0-alpha.
|
|
124
|
-
"@geekmidas/
|
|
125
|
-
"@geekmidas/
|
|
122
|
+
"@faker-js/faker": "~10.6.0",
|
|
123
|
+
"@geekmidas/envkit": "^10.0.0-alpha.4",
|
|
124
|
+
"@geekmidas/services": "^10.0.0-alpha.4",
|
|
125
|
+
"@geekmidas/logger": "^10.0.0-alpha.4"
|
|
126
126
|
},
|
|
127
127
|
"devDependencies": {
|
|
128
|
-
"@types/pg": "~8.
|
|
129
|
-
"@geekmidas/envkit": "^10.0.0-alpha.
|
|
130
|
-
"@geekmidas/logger": "^10.0.0-alpha.
|
|
131
|
-
"@geekmidas/services": "^10.0.0-alpha.
|
|
128
|
+
"@types/pg": "~8.23.1",
|
|
129
|
+
"@geekmidas/envkit": "^10.0.0-alpha.4",
|
|
130
|
+
"@geekmidas/logger": "^10.0.0-alpha.4",
|
|
131
|
+
"@geekmidas/services": "^10.0.0-alpha.4"
|
|
132
132
|
},
|
|
133
133
|
"repository": {
|
|
134
134
|
"type": "git",
|
|
@@ -139,14 +139,14 @@
|
|
|
139
139
|
"access": "public"
|
|
140
140
|
},
|
|
141
141
|
"peerDependencies": {
|
|
142
|
-
"kysely": "~0.29.
|
|
143
|
-
"pg": "
|
|
144
|
-
"knex": "
|
|
145
|
-
"objection": "
|
|
142
|
+
"kysely": "~0.29.6",
|
|
143
|
+
"pg": ">=8.23.0",
|
|
144
|
+
"knex": ">=3.3.0",
|
|
145
|
+
"objection": ">=3.1.5",
|
|
146
146
|
"db-errors": "~0.2.3",
|
|
147
147
|
"vitest": "~3.2.4",
|
|
148
|
-
"@types/aws-lambda": ">=8.10.
|
|
149
|
-
"better-auth": ">=1.
|
|
148
|
+
"@types/aws-lambda": ">=8.10.163",
|
|
149
|
+
"better-auth": ">=1.7.5"
|
|
150
150
|
},
|
|
151
151
|
"peerDependenciesMeta": {
|
|
152
152
|
"kysely": {
|