faire-auth 1.0.0 → 1.0.1
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/{access-Crt-IJ2P.cjs → access-BZ7-AbTM.cjs} +1 -1
- package/dist/{adapter-factory-DT-_2aHJ.cjs → adapter-factory-D1I7joki.cjs} +2 -2
- package/dist/adapters/drizzle-adapter/index.cjs +5 -5
- package/dist/adapters/drizzle-adapter/index.d.cts +1 -1
- package/dist/adapters/drizzle-adapter/index.d.mts +2 -2
- package/dist/adapters/drizzle-adapter/index.mjs +3 -3
- package/dist/adapters/index.cjs +4 -4
- package/dist/adapters/index.d.cts +1 -1
- package/dist/adapters/index.d.mts +2 -2
- package/dist/adapters/index.mjs +3 -3
- package/dist/adapters/kysely-adapter/index.cjs +5 -5
- package/dist/adapters/kysely-adapter/index.d.cts +1 -1
- package/dist/adapters/kysely-adapter/index.d.mts +2 -2
- package/dist/adapters/kysely-adapter/index.mjs +4 -4
- package/dist/adapters/memory-adapter/index.cjs +5 -5
- package/dist/adapters/memory-adapter/index.d.cts +1 -1
- package/dist/adapters/memory-adapter/index.d.mts +2 -2
- package/dist/adapters/memory-adapter/index.mjs +4 -4
- package/dist/adapters/mongodb-adapter/index.cjs +294 -6
- package/dist/adapters/mongodb-adapter/index.d.cts +34 -2
- package/dist/adapters/mongodb-adapter/index.d.mts +35 -3
- package/dist/adapters/mongodb-adapter/index.mjs +291 -4
- package/dist/adapters/prisma-adapter/index.cjs +5 -5
- package/dist/adapters/prisma-adapter/index.d.cts +1 -1
- package/dist/adapters/prisma-adapter/index.d.mts +2 -2
- package/dist/adapters/prisma-adapter/index.mjs +3 -3
- package/dist/adapters/test.cjs +3 -3
- package/dist/adapters/test.d.cts +1 -1
- package/dist/adapters/test.d.mts +2 -2
- package/dist/adapters/test.mjs +2 -2
- package/dist/api/index.cjs +15 -15
- package/dist/api/index.d.cts +1 -1
- package/dist/api/index.d.mts +2 -2
- package/dist/api/index.mjs +8 -8
- package/dist/api/middleware/index.cjs +8 -8
- package/dist/api/middleware/index.d.cts +3 -3
- package/dist/api/middleware/index.d.mts +4 -4
- package/dist/api/middleware/index.mjs +3 -3
- package/dist/{api-_B7qO28y.mjs → api-B4RDwBty.mjs} +7 -7
- package/dist/{api-Bm89BLgN.cjs → api-CaRC1Gio.cjs} +12 -12
- package/dist/{bearer-CHeREcGT.cjs → bearer-DDzrp5M7.cjs} +2 -2
- package/dist/{bearer-0SeEmaS4.mjs → bearer-WZcs7gxL.mjs} +1 -1
- package/dist/{bun-sqlite-dialect-wuaC2-gh.cjs → bun-sqlite-dialect-DPgTzc0w.cjs} +1 -1
- package/dist/{chunk-Ceigfy4P.mjs → chunk-BFnQceUY.mjs} +1 -13
- package/dist/{chunk-oakRccI5.cjs → chunk-fPmz2rbM.cjs} +0 -9
- package/dist/client/index.cjs +26 -7
- package/dist/client/index.d.cts +27 -4
- package/dist/client/index.d.mts +28 -5
- package/dist/client/index.mjs +25 -6
- package/dist/client/lynx/index.cjs +5 -5
- package/dist/client/lynx/index.d.cts +9 -9
- package/dist/client/lynx/index.d.mts +27 -27
- package/dist/client/lynx/index.mjs +3 -3
- package/dist/client/plugins/index.d.cts +1 -1
- package/dist/client/plugins/index.d.mts +2 -2
- package/dist/client/react/index.cjs +5 -5
- package/dist/client/react/index.d.cts +9 -9
- package/dist/client/react/index.d.mts +3 -3
- package/dist/client/react/index.mjs +3 -3
- package/dist/client/solid/index.cjs +5 -5
- package/dist/client/solid/index.d.cts +16 -16
- package/dist/client/solid/index.d.mts +17 -17
- package/dist/client/solid/index.mjs +3 -3
- package/dist/client/svelte/index.cjs +4 -4
- package/dist/client/svelte/index.d.cts +16 -16
- package/dist/client/svelte/index.d.mts +27 -27
- package/dist/client/svelte/index.mjs +3 -3
- package/dist/client/vue/index.cjs +5 -5
- package/dist/client/vue/index.d.cts +27 -27
- package/dist/client/vue/index.d.mts +28 -28
- package/dist/client/vue/index.mjs +3 -3
- package/dist/{cookies-B5xeA6i8.cjs → cookies-BTl72THv.cjs} +3 -3
- package/dist/{cookies-Ch1JfQIz.mjs → cookies-BTs1o992.mjs} +2 -2
- package/dist/crypto/index.cjs +1 -1
- package/dist/crypto/index.d.cts +2 -2
- package/dist/crypto/index.d.mts +3 -3
- package/dist/crypto/index.mjs +1 -1
- package/dist/{crypto-CyQRFtkq.mjs → crypto-DH2Aa7jN.mjs} +1 -1
- package/dist/{crypto-CcTxYH82.cjs → crypto-DpSCnrTp.cjs} +1 -1
- package/dist/db/index.cjs +10 -10
- package/dist/db/index.d.cts +1 -1
- package/dist/db/index.d.mts +2 -2
- package/dist/db/index.mjs +6 -6
- package/dist/{db-xiJtoDgz.mjs → db-4tUsQJXd.mjs} +3 -3
- package/dist/{db-BTKyYu-_.cjs → db-ChMbb_U-.cjs} +8 -8
- package/dist/{email-verification-CWhj2qfb.mjs → email-verification-C_lBu_JY.mjs} +3 -3
- package/dist/{email-verification-C-AsfJsb.cjs → email-verification-DI_0H4JC.cjs} +5 -5
- package/dist/{hono-Cdukwu5K.cjs → hono-C14rpOEa.cjs} +1 -1
- package/dist/{hono-Covz10jU.mjs → hono-CO-zsqI-.mjs} +2 -2
- package/dist/{hono-BEq1NYVX.cjs → hono-DnW5crl1.cjs} +4 -4
- package/dist/index-BC42NdCJ.d.mts +992 -0
- package/dist/{index-B-WeOMzg.d.cts → index-BNCikaaH.d.cts} +834 -834
- package/dist/{index-Qu-iJGNr.d.mts → index-BfbDrljm.d.cts} +15 -15
- package/dist/index-BotKDRUI.d.mts +13350 -0
- package/dist/index-CL5oW5Uh.d.cts +13350 -0
- package/dist/index-ClFGA8tb.d.mts +33 -0
- package/dist/index-DCuvAh3N.d.mts +992 -0
- package/dist/{index-jlessPI0.d.mts → index-DK2ECcVe.d.mts} +382 -382
- package/dist/{index-B09P9p5_.d.cts → index-Dsua4U8w.d.cts} +6 -6
- package/dist/index-KQ5RLFjm.d.cts +33 -0
- package/dist/{index-BVHscLQl.d.cts → index-w-IdIOQJ.d.cts} +15 -15
- package/dist/{index-ppgcFe12.d.mts → index-ztVZPQdV.d.mts} +6 -6
- package/dist/index.cjs +721 -27
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +711 -16
- package/dist/integrations/next-js.cjs +3 -3
- package/dist/integrations/next-js.d.cts +3 -3
- package/dist/integrations/next-js.d.mts +6 -6
- package/dist/integrations/next-js.mjs +2 -2
- package/dist/integrations/node.d.cts +1 -1
- package/dist/integrations/node.d.mts +2 -2
- package/dist/integrations/react-start.cjs +3 -3
- package/dist/integrations/react-start.d.cts +5 -5
- package/dist/integrations/react-start.d.mts +6 -6
- package/dist/integrations/react-start.mjs +2 -2
- package/dist/integrations/svelte-kit.cjs +3 -3
- package/dist/integrations/svelte-kit.d.cts +5 -5
- package/dist/integrations/svelte-kit.d.mts +6 -6
- package/dist/integrations/svelte-kit.mjs +2 -2
- package/dist/{ip-B5SwXaMB.cjs → ip-C17Qdq-G.cjs} +2 -2
- package/dist/{json-CcJ2HjGo.cjs → json--tl7Grvs.cjs} +1 -1
- package/dist/{kysely-adapter-DRuoT_X8.mjs → kysely-adapter-CtIdoHa8.mjs} +3 -3
- package/dist/{kysely-adapter-Bxi7sPdG.cjs → kysely-adapter-QZTx077T.cjs} +4 -4
- package/dist/{logged-DQK3C64b.cjs → logged-Dv3st5qc.cjs} +1 -1
- package/dist/{memory-adapter-BlnDIAAX.cjs → memory-adapter-17RZd5df.cjs} +2 -2
- package/dist/{memory-adapter-Db3tsJTn.mjs → memory-adapter-Dp4XdCZK.mjs} +1 -1
- package/dist/{node-sqlite-dialect-mJWC8LWQ.cjs → node-sqlite-dialect-DP11CB0y.cjs} +1 -1
- package/dist/oauth2/index.cjs +11 -11
- package/dist/oauth2/index.d.cts +1 -1
- package/dist/oauth2/index.d.mts +2 -2
- package/dist/oauth2/index.mjs +6 -6
- package/dist/{oauth2-BLeOEi7Y.cjs → oauth2-5RL4cVNS.cjs} +3 -3
- package/dist/{oauth2-B8M0lW9l.mjs → oauth2-C56wz-n9.mjs} +2 -2
- package/dist/{origin-check-id9lTnqZ.cjs → origin-check-DjLTuZQ8.cjs} +2 -2
- package/dist/{passkey-B6N20LSS.cjs → passkey-BTT-v5c-.cjs} +4 -4
- package/dist/{passkey-DJsR_GX3.mjs → passkey-CzY_W2us.mjs} +2 -2
- package/dist/plugins/access/index.cjs +1 -1
- package/dist/plugins/access/index.d.cts +1 -1
- package/dist/plugins/access/index.d.mts +1 -1
- package/dist/plugins/access/index.mjs +1 -1
- package/dist/plugins/bearer/index.cjs +4 -4
- package/dist/plugins/bearer/index.d.cts +2 -2
- package/dist/plugins/bearer/index.d.mts +3 -3
- package/dist/plugins/bearer/index.mjs +3 -3
- package/dist/plugins/index.cjs +5215 -31
- package/dist/plugins/index.d.cts +270 -270
- package/dist/plugins/index.d.mts +352 -352
- package/dist/plugins/index.mjs +5202 -19
- package/dist/plugins/passkey/index.cjs +10 -10
- package/dist/plugins/passkey/index.d.cts +2 -2
- package/dist/plugins/passkey/index.d.mts +3 -3
- package/dist/plugins/passkey/index.mjs +5 -5
- package/dist/{schema-D-qjygfE.cjs → schema-CirKflVs.cjs} +2 -2
- package/dist/{session-rH8ougDl.mjs → session-CM3rmOYF.mjs} +1 -1
- package/dist/{session-De9POJTW.cjs → session-Cwrj4GfV.cjs} +5 -5
- package/dist/social-providers/index.cjs +1 -1
- package/dist/social-providers/index.d.cts +1 -1
- package/dist/social-providers/index.d.mts +1 -1
- package/dist/social-providers/index.mjs +1 -1
- package/dist/{social-providers-DoYJhBe3.mjs → social-providers-B8RK5yqI.mjs} +1 -1
- package/dist/{social-providers-DcFNUT0S.cjs → social-providers-BmFOIIPk.cjs} +1 -1
- package/dist/{state-CqJfCIl9.mjs → state-CQghgH9I.mjs} +1 -1
- package/dist/{state--f7fwIGh.cjs → state-CvSihlVT.cjs} +2 -2
- package/dist/test-utils/bun-sqlite-dialect-BSWhhKNs.mjs +155 -0
- package/dist/test-utils/bun-sqlite-dialect-BZBvHchL.cjs +156 -0
- package/dist/test-utils/index.cjs +8927 -482
- package/dist/test-utils/index.d.cts +8637 -579
- package/dist/test-utils/index.d.mts +8636 -576
- package/dist/test-utils/index.mjs +8712 -265
- package/dist/test-utils/node-sqlite-dialect-BgJqjBOu.cjs +156 -0
- package/dist/test-utils/node-sqlite-dialect-DAQXiobH.mjs +155 -0
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.mts +2 -2
- package/dist/{url-D2yvKaM7.cjs → url-Ce7CVaQD.cjs} +1 -1
- package/dist/utils/cookies.cjs +4 -4
- package/dist/utils/cookies.d.cts +1 -1
- package/dist/utils/cookies.d.mts +2 -2
- package/dist/utils/cookies.mjs +2 -2
- package/package.json +2 -2
- package/dist/auth-Bo9PDt5j.cjs +0 -739
- package/dist/auth-Ds4AG4h4.mjs +0 -709
- package/dist/index-C2-2QDyS.d.cts +0 -35
- package/dist/index-CWAqWfoZ.d.cts +0 -27
- package/dist/index-CYSShrFx.d.mts +0 -27
- package/dist/index-to0RO38U.d.mts +0 -35
- package/dist/mongodb-adapter-C_qGQED5.mjs +0 -291
- package/dist/mongodb-adapter-C_qfK87x.cjs +0 -297
- package/dist/plugins-C1lm2Wj3.cjs +0 -5254
- package/dist/plugins-Dai1QkRU.mjs +0 -5199
- package/dist/vanilla-Bu2PmFzE.cjs +0 -30
- package/dist/vanilla-TfHqeiC7.mjs +0 -25
- /package/dist/{access-B5bBI4uT.mjs → access-D0DRqUKC.mjs} +0 -0
- /package/dist/{adapter-factory-BXei1QRX.mjs → adapter-factory-lKIOf2OR.mjs} +0 -0
- /package/dist/{bun-sqlite-dialect-CfkBo2v5.mjs → bun-sqlite-dialect-6NqeV3px.mjs} +0 -0
- /package/dist/{defu-B0Svx_x4.cjs → defu-BmOYq4PU.cjs} +0 -0
- /package/dist/{defu-SZkpHhbR.mjs → defu-D9ZTXqlo.mjs} +0 -0
- /package/dist/{hono-DuE14mmj.d.mts → hono-D0VqxVy1.d.mts} +0 -0
- /package/dist/{index-B5_0QTLg.d.mts → index-BDhhaE6Y.d.cts} +0 -0
- /package/dist/{index-B7SKyR_a.d.cts → index-CF9iq55a.d.mts} +0 -0
- /package/dist/{index-CTwrVluH.d.mts → index-CRt_fppq.d.mts} +0 -0
- /package/dist/{index-cs4Sh0En.d.cts → index-CdLyn7qP.d.cts} +0 -0
- /package/dist/{node-sqlite-dialect-BfBzyOAg.mjs → node-sqlite-dialect-w4DAg0PH.mjs} +0 -0
- /package/dist/{parser-CeAer-RM.mjs → parser-B25ylT5u.mjs} +0 -0
- /package/dist/{parser-CdncAl9i.cjs → parser-B_wxvaAr.cjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-
|
|
2
|
-
const require_json = require('./json
|
|
1
|
+
const require_chunk = require('./chunk-fPmz2rbM.cjs');
|
|
2
|
+
const require_json = require('./json--tl7Grvs.cjs');
|
|
3
3
|
let __faire_auth_core_env = require("@faire-auth/core/env");
|
|
4
4
|
let __faire_auth_core_error = require("@faire-auth/core/error");
|
|
5
5
|
let __faire_auth_core_static = require("@faire-auth/core/static");
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_chunk = require('../../chunk-
|
|
2
|
-
require('../../crypto-
|
|
3
|
-
require('../../json
|
|
4
|
-
require('../../state
|
|
1
|
+
const require_chunk = require('../../chunk-fPmz2rbM.cjs');
|
|
2
|
+
require('../../crypto-DpSCnrTp.cjs');
|
|
3
|
+
require('../../json--tl7Grvs.cjs');
|
|
4
|
+
require('../../state-CvSihlVT.cjs');
|
|
5
5
|
require('../../request-CPNlp-DK.cjs');
|
|
6
6
|
require('../../utils-44aDDP8f.cjs');
|
|
7
|
-
const require_adapter_factory = require('../../adapter-factory-
|
|
7
|
+
const require_adapter_factory = require('../../adapter-factory-D1I7joki.cjs');
|
|
8
8
|
let __faire_auth_core_error = require("@faire-auth/core/error");
|
|
9
9
|
let drizzle_orm = require("drizzle-orm");
|
|
10
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as FaireAuthOptions } from "../../index-
|
|
2
|
-
import "../../hono-
|
|
1
|
+
import { I as FaireAuthOptions } from "../../index-BotKDRUI.mjs";
|
|
2
|
+
import "../../hono-D0VqxVy1.mjs";
|
|
3
3
|
import { DBAdapter, DBAdapterDebugLogOption } from "@faire-auth/core/db/adapter";
|
|
4
4
|
|
|
5
5
|
//#region src/adapters/drizzle-adapter/drizzle-adapter.d.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../../crypto-
|
|
1
|
+
import "../../crypto-DH2Aa7jN.mjs";
|
|
2
2
|
import "../../json-B1v2qRTQ.mjs";
|
|
3
|
-
import "../../state-
|
|
3
|
+
import "../../state-CQghgH9I.mjs";
|
|
4
4
|
import "../../request-1NL_1lyJ.mjs";
|
|
5
5
|
import "../../utils-D4vZd1-9.mjs";
|
|
6
|
-
import { t as createAdapterFactory } from "../../adapter-factory-
|
|
6
|
+
import { t as createAdapterFactory } from "../../adapter-factory-lKIOf2OR.mjs";
|
|
7
7
|
import { FaireAuthError } from "@faire-auth/core/error";
|
|
8
8
|
import { and, asc, count, desc, eq, gt, gte, inArray, like, lt, lte, ne, notInArray, or, sql } from "drizzle-orm";
|
|
9
9
|
|
package/dist/adapters/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
require('../crypto-
|
|
2
|
-
require('../json
|
|
3
|
-
require('../state
|
|
1
|
+
require('../crypto-DpSCnrTp.cjs');
|
|
2
|
+
require('../json--tl7Grvs.cjs');
|
|
3
|
+
require('../state-CvSihlVT.cjs');
|
|
4
4
|
require('../request-CPNlp-DK.cjs');
|
|
5
5
|
require('../utils-44aDDP8f.cjs');
|
|
6
|
-
const require_adapter_factory = require('../adapter-factory-
|
|
6
|
+
const require_adapter_factory = require('../adapter-factory-D1I7joki.cjs');
|
|
7
7
|
|
|
8
8
|
//#region src/adapters/index.ts
|
|
9
9
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as FaireAuthOptions$1, gn as Where$1, hn as TransactionAdapter, un as AdapterSchemaCreation } from "../index-
|
|
1
|
+
import { I as FaireAuthOptions$1, gn as Where$1, hn as TransactionAdapter, un as AdapterSchemaCreation } from "../index-BNCikaaH.cjs";
|
|
2
2
|
import "../hono-DOM31WQz.cjs";
|
|
3
3
|
import { CustomAdapter as CustomAdapter$1, DBAdapter, DBAdapterFactoryConfig } from "@faire-auth/core/db/adapter";
|
|
4
4
|
import { Prettify } from "@faire-auth/core/types";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as FaireAuthOptions$1, gn as Where$1, hn as TransactionAdapter, un as AdapterSchemaCreation } from "../index-
|
|
2
|
-
import "../hono-
|
|
1
|
+
import { I as FaireAuthOptions$1, gn as Where$1, hn as TransactionAdapter, un as AdapterSchemaCreation } from "../index-BotKDRUI.mjs";
|
|
2
|
+
import "../hono-D0VqxVy1.mjs";
|
|
3
3
|
import { DBFieldAttribute, FaireAuthDBSchema } from "@faire-auth/core/db";
|
|
4
4
|
import { CustomAdapter as CustomAdapter$1, DBAdapter, DBAdapterFactoryConfig } from "@faire-auth/core/db/adapter";
|
|
5
5
|
import { Prettify } from "@faire-auth/core/types";
|
package/dist/adapters/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../crypto-
|
|
1
|
+
import "../crypto-DH2Aa7jN.mjs";
|
|
2
2
|
import "../json-B1v2qRTQ.mjs";
|
|
3
|
-
import "../state-
|
|
3
|
+
import "../state-CQghgH9I.mjs";
|
|
4
4
|
import "../request-1NL_1lyJ.mjs";
|
|
5
5
|
import "../utils-D4vZd1-9.mjs";
|
|
6
|
-
import { t as createAdapterFactory } from "../adapter-factory-
|
|
6
|
+
import { t as createAdapterFactory } from "../adapter-factory-lKIOf2OR.mjs";
|
|
7
7
|
|
|
8
8
|
export * from "@faire-auth/core/db/adapter"
|
|
9
9
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
require('../../crypto-
|
|
2
|
-
require('../../json
|
|
3
|
-
require('../../state
|
|
1
|
+
require('../../crypto-DpSCnrTp.cjs');
|
|
2
|
+
require('../../json--tl7Grvs.cjs');
|
|
3
|
+
require('../../state-CvSihlVT.cjs');
|
|
4
4
|
require('../../request-CPNlp-DK.cjs');
|
|
5
5
|
require('../../utils-44aDDP8f.cjs');
|
|
6
|
-
const require_kysely_adapter = require('../../kysely-adapter-
|
|
7
|
-
require('../../adapter-factory-
|
|
6
|
+
const require_kysely_adapter = require('../../kysely-adapter-QZTx077T.cjs');
|
|
7
|
+
require('../../adapter-factory-D1I7joki.cjs');
|
|
8
8
|
|
|
9
9
|
exports.createKyselyAdapter = require_kysely_adapter.createKyselyAdapter;
|
|
10
10
|
exports.getKyselyDatabaseType = require_kysely_adapter.getKyselyDatabaseType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as FaireAuthOptions, Wt as KyselyDatabaseType } from "../../index-
|
|
1
|
+
import { I as FaireAuthOptions, Wt as KyselyDatabaseType } from "../../index-BNCikaaH.cjs";
|
|
2
2
|
import "../../hono-DOM31WQz.cjs";
|
|
3
3
|
import { DBAdapter, DBAdapterDebugLogOption } from "@faire-auth/core/db/adapter";
|
|
4
4
|
import { Kysely } from "kysely";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as FaireAuthOptions, Wt as KyselyDatabaseType } from "../../index-
|
|
2
|
-
import "../../hono-
|
|
1
|
+
import { I as FaireAuthOptions, Wt as KyselyDatabaseType } from "../../index-BotKDRUI.mjs";
|
|
2
|
+
import "../../hono-D0VqxVy1.mjs";
|
|
3
3
|
import { Kysely } from "kysely";
|
|
4
4
|
import { DBAdapter, DBAdapterDebugLogOption } from "@faire-auth/core/db/adapter";
|
|
5
5
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../../crypto-
|
|
1
|
+
import "../../crypto-DH2Aa7jN.mjs";
|
|
2
2
|
import "../../json-B1v2qRTQ.mjs";
|
|
3
|
-
import "../../state-
|
|
3
|
+
import "../../state-CQghgH9I.mjs";
|
|
4
4
|
import "../../request-1NL_1lyJ.mjs";
|
|
5
5
|
import "../../utils-D4vZd1-9.mjs";
|
|
6
|
-
import { n as createKyselyAdapter, r as getKyselyDatabaseType, t as kyselyAdapter } from "../../kysely-adapter-
|
|
7
|
-
import "../../adapter-factory-
|
|
6
|
+
import { n as createKyselyAdapter, r as getKyselyDatabaseType, t as kyselyAdapter } from "../../kysely-adapter-CtIdoHa8.mjs";
|
|
7
|
+
import "../../adapter-factory-lKIOf2OR.mjs";
|
|
8
8
|
|
|
9
9
|
export { createKyselyAdapter, getKyselyDatabaseType, kyselyAdapter };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
require('../../crypto-
|
|
2
|
-
require('../../json
|
|
3
|
-
require('../../state
|
|
1
|
+
require('../../crypto-DpSCnrTp.cjs');
|
|
2
|
+
require('../../json--tl7Grvs.cjs');
|
|
3
|
+
require('../../state-CvSihlVT.cjs');
|
|
4
4
|
require('../../request-CPNlp-DK.cjs');
|
|
5
5
|
require('../../utils-44aDDP8f.cjs');
|
|
6
|
-
require('../../adapter-factory-
|
|
7
|
-
const require_memory_adapter = require('../../memory-adapter-
|
|
6
|
+
require('../../adapter-factory-D1I7joki.cjs');
|
|
7
|
+
const require_memory_adapter = require('../../memory-adapter-17RZd5df.cjs');
|
|
8
8
|
|
|
9
9
|
exports.memoryAdapter = require_memory_adapter.memoryAdapter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as FaireAuthOptions } from "../../index-
|
|
1
|
+
import { I as FaireAuthOptions } from "../../index-BNCikaaH.cjs";
|
|
2
2
|
import "../../hono-DOM31WQz.cjs";
|
|
3
3
|
import { DBAdapterDebugLogOption } from "@faire-auth/core/db/adapter";
|
|
4
4
|
import * as _faire_auth_core_db11 from "@faire-auth/core/db";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as FaireAuthOptions } from "../../index-
|
|
2
|
-
import "../../hono-
|
|
1
|
+
import { I as FaireAuthOptions } from "../../index-BotKDRUI.mjs";
|
|
2
|
+
import "../../hono-D0VqxVy1.mjs";
|
|
3
3
|
import * as _faire_auth_core_db11 from "@faire-auth/core/db";
|
|
4
4
|
import { DBAdapterDebugLogOption } from "@faire-auth/core/db/adapter";
|
|
5
5
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../../crypto-
|
|
1
|
+
import "../../crypto-DH2Aa7jN.mjs";
|
|
2
2
|
import "../../json-B1v2qRTQ.mjs";
|
|
3
|
-
import "../../state-
|
|
3
|
+
import "../../state-CQghgH9I.mjs";
|
|
4
4
|
import "../../request-1NL_1lyJ.mjs";
|
|
5
5
|
import "../../utils-D4vZd1-9.mjs";
|
|
6
|
-
import "../../adapter-factory-
|
|
7
|
-
import { t as memoryAdapter } from "../../memory-adapter-
|
|
6
|
+
import "../../adapter-factory-lKIOf2OR.mjs";
|
|
7
|
+
import { t as memoryAdapter } from "../../memory-adapter-Dp4XdCZK.mjs";
|
|
8
8
|
|
|
9
9
|
export { memoryAdapter };
|
|
@@ -1,9 +1,297 @@
|
|
|
1
|
-
require('../../
|
|
2
|
-
require('../../
|
|
3
|
-
require('../../
|
|
1
|
+
const require_chunk = require('../../chunk-fPmz2rbM.cjs');
|
|
2
|
+
require('../../crypto-DpSCnrTp.cjs');
|
|
3
|
+
require('../../json--tl7Grvs.cjs');
|
|
4
|
+
require('../../state-CvSihlVT.cjs');
|
|
4
5
|
require('../../request-CPNlp-DK.cjs');
|
|
5
6
|
require('../../utils-44aDDP8f.cjs');
|
|
6
|
-
require('../../adapter-factory-
|
|
7
|
-
|
|
7
|
+
const require_adapter_factory = require('../../adapter-factory-D1I7joki.cjs');
|
|
8
|
+
let mongodb = require("mongodb");
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
//#region src/adapters/mongodb-adapter/mongodb-adapter.ts
|
|
11
|
+
const mongodbAdapter = (db, config) => {
|
|
12
|
+
let lazyOptions;
|
|
13
|
+
const createCustomAdapter = (db$1, session) => ({ options, getFieldName, schema, getDefaultModelName }) => {
|
|
14
|
+
function serializeID({ field, value, model }) {
|
|
15
|
+
model = getDefaultModelName(model);
|
|
16
|
+
if (field === "id" || field === "_id" || schema[model].fields[field]?.references?.field === "id") {
|
|
17
|
+
if (typeof value !== "string") {
|
|
18
|
+
if (value instanceof mongodb.ObjectId) return value;
|
|
19
|
+
if (Array.isArray(value)) return value.map((v) => {
|
|
20
|
+
if (typeof v === "string") try {
|
|
21
|
+
return new mongodb.ObjectId(v);
|
|
22
|
+
} catch (e) {
|
|
23
|
+
return v;
|
|
24
|
+
}
|
|
25
|
+
if (v instanceof mongodb.ObjectId) return v;
|
|
26
|
+
throw new Error("Invalid id value");
|
|
27
|
+
});
|
|
28
|
+
throw new Error("Invalid id value");
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
return new mongodb.ObjectId(value);
|
|
32
|
+
} catch (e) {
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
function convertWhereClause({ where, model }) {
|
|
39
|
+
if (!where.length) return {};
|
|
40
|
+
const conditions = where.map((w) => {
|
|
41
|
+
const { field: field_, value, operator = "eq", connector = "AND" } = w;
|
|
42
|
+
let condition;
|
|
43
|
+
let field = getFieldName({
|
|
44
|
+
model,
|
|
45
|
+
field: field_
|
|
46
|
+
});
|
|
47
|
+
if (field === "id") field = "_id";
|
|
48
|
+
switch (operator.toLowerCase()) {
|
|
49
|
+
case "eq":
|
|
50
|
+
condition = { [field]: serializeID({
|
|
51
|
+
field,
|
|
52
|
+
value,
|
|
53
|
+
model
|
|
54
|
+
}) };
|
|
55
|
+
break;
|
|
56
|
+
case "in":
|
|
57
|
+
condition = { [field]: { $in: Array.isArray(value) ? value.map((v) => serializeID({
|
|
58
|
+
field,
|
|
59
|
+
value: v,
|
|
60
|
+
model
|
|
61
|
+
})) : [serializeID({
|
|
62
|
+
field,
|
|
63
|
+
value,
|
|
64
|
+
model
|
|
65
|
+
})] } };
|
|
66
|
+
break;
|
|
67
|
+
case "not_in":
|
|
68
|
+
condition = { [field]: { $nin: Array.isArray(value) ? value.map((v) => serializeID({
|
|
69
|
+
field,
|
|
70
|
+
value: v,
|
|
71
|
+
model
|
|
72
|
+
})) : [serializeID({
|
|
73
|
+
field,
|
|
74
|
+
value,
|
|
75
|
+
model
|
|
76
|
+
})] } };
|
|
77
|
+
break;
|
|
78
|
+
case "gt":
|
|
79
|
+
condition = { [field]: { $gt: value } };
|
|
80
|
+
break;
|
|
81
|
+
case "gte":
|
|
82
|
+
condition = { [field]: { $gte: value } };
|
|
83
|
+
break;
|
|
84
|
+
case "lt":
|
|
85
|
+
condition = { [field]: { $lt: value } };
|
|
86
|
+
break;
|
|
87
|
+
case "lte":
|
|
88
|
+
condition = { [field]: { $lte: value } };
|
|
89
|
+
break;
|
|
90
|
+
case "ne":
|
|
91
|
+
condition = { [field]: { $ne: value } };
|
|
92
|
+
break;
|
|
93
|
+
case "contains":
|
|
94
|
+
condition = { [field]: { $regex: `.*${escapeForMongoRegex(value)}.*` } };
|
|
95
|
+
break;
|
|
96
|
+
case "starts_with":
|
|
97
|
+
condition = { [field]: { $regex: `^${escapeForMongoRegex(value)}` } };
|
|
98
|
+
break;
|
|
99
|
+
case "ends_with":
|
|
100
|
+
condition = { [field]: { $regex: `${escapeForMongoRegex(value)}$` } };
|
|
101
|
+
break;
|
|
102
|
+
default: throw new Error(`Unsupported operator: ${operator}`);
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
condition,
|
|
106
|
+
connector
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
if (conditions.length === 1) return conditions[0].condition;
|
|
110
|
+
const andConditions = conditions.filter((c) => c.connector === "AND").map((c) => c.condition);
|
|
111
|
+
const orConditions = conditions.filter((c) => c.connector === "OR").map((c) => c.condition);
|
|
112
|
+
let clause = {};
|
|
113
|
+
if (andConditions.length) clause = {
|
|
114
|
+
...clause,
|
|
115
|
+
$and: andConditions
|
|
116
|
+
};
|
|
117
|
+
if (orConditions.length) clause = {
|
|
118
|
+
...clause,
|
|
119
|
+
$or: orConditions
|
|
120
|
+
};
|
|
121
|
+
return clause;
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
async create({ model, data: values }) {
|
|
125
|
+
return {
|
|
126
|
+
_id: (await db$1.collection(model).insertOne(values, { ...session && { session } })).insertedId.toString(),
|
|
127
|
+
...values
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
async findOne({ model, where, select }) {
|
|
131
|
+
const clause = convertWhereClause({
|
|
132
|
+
where,
|
|
133
|
+
model
|
|
134
|
+
});
|
|
135
|
+
const projection = select ? Object.fromEntries(select.map((field) => [getFieldName({
|
|
136
|
+
field,
|
|
137
|
+
model
|
|
138
|
+
}), 1])) : void 0;
|
|
139
|
+
const res = await db$1.collection(model).findOne(clause, {
|
|
140
|
+
...session && { session },
|
|
141
|
+
...projection && { projection }
|
|
142
|
+
});
|
|
143
|
+
if (!res) return null;
|
|
144
|
+
return res;
|
|
145
|
+
},
|
|
146
|
+
async findMany({ model, where, limit, offset, sortBy }) {
|
|
147
|
+
const clause = where ? convertWhereClause({
|
|
148
|
+
where,
|
|
149
|
+
model
|
|
150
|
+
}) : {};
|
|
151
|
+
const cursor = db$1.collection(model).find(clause, { ...session && { session } });
|
|
152
|
+
if (limit) cursor.limit(limit);
|
|
153
|
+
if (offset) cursor.skip(offset);
|
|
154
|
+
if (sortBy) cursor.sort(getFieldName({
|
|
155
|
+
field: sortBy.field,
|
|
156
|
+
model
|
|
157
|
+
}), sortBy.direction === "desc" ? -1 : 1);
|
|
158
|
+
return await cursor.toArray();
|
|
159
|
+
},
|
|
160
|
+
async count({ model, where }) {
|
|
161
|
+
const clause = where ? convertWhereClause({
|
|
162
|
+
where,
|
|
163
|
+
model
|
|
164
|
+
}) : {};
|
|
165
|
+
return await db$1.collection(model).countDocuments(clause, { ...session && { session } });
|
|
166
|
+
},
|
|
167
|
+
async update({ model, where, update: values }) {
|
|
168
|
+
const clause = convertWhereClause({
|
|
169
|
+
where,
|
|
170
|
+
model
|
|
171
|
+
});
|
|
172
|
+
const res = await db$1.collection(model).findOneAndUpdate(clause, { $set: values }, {
|
|
173
|
+
...session && { session },
|
|
174
|
+
returnDocument: "after"
|
|
175
|
+
});
|
|
176
|
+
if (!res) return null;
|
|
177
|
+
return res;
|
|
178
|
+
},
|
|
179
|
+
async updateMany({ model, where, update: values }) {
|
|
180
|
+
const clause = convertWhereClause({
|
|
181
|
+
where,
|
|
182
|
+
model
|
|
183
|
+
});
|
|
184
|
+
return (await db$1.collection(model).updateMany(clause, { $set: values }, { ...session && { session } })).modifiedCount;
|
|
185
|
+
},
|
|
186
|
+
async delete({ model, where }) {
|
|
187
|
+
const clause = convertWhereClause({
|
|
188
|
+
where,
|
|
189
|
+
model
|
|
190
|
+
});
|
|
191
|
+
await db$1.collection(model).deleteOne(clause, { ...session && { session } });
|
|
192
|
+
},
|
|
193
|
+
async deleteMany({ model, where }) {
|
|
194
|
+
const clause = convertWhereClause({
|
|
195
|
+
where,
|
|
196
|
+
model
|
|
197
|
+
});
|
|
198
|
+
return (await db$1.collection(model).deleteMany(clause, { ...session && { session } })).deletedCount;
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
let lazyAdapter = null;
|
|
203
|
+
let adapterOptions = null;
|
|
204
|
+
adapterOptions = {
|
|
205
|
+
config: {
|
|
206
|
+
adapterId: "mongodb-adapter",
|
|
207
|
+
adapterName: "MongoDB Adapter",
|
|
208
|
+
usePlural: config?.usePlural ?? false,
|
|
209
|
+
debugLogs: config?.debugLogs ?? false,
|
|
210
|
+
mapKeysTransformInput: { id: "_id" },
|
|
211
|
+
mapKeysTransformOutput: { _id: "id" },
|
|
212
|
+
supportsNumericIds: false,
|
|
213
|
+
transaction: config?.client && (config?.transaction ?? true) ? async (cb) => {
|
|
214
|
+
if (!config.client) return cb(lazyAdapter(lazyOptions));
|
|
215
|
+
const session = config.client.startSession();
|
|
216
|
+
try {
|
|
217
|
+
session.startTransaction();
|
|
218
|
+
const result = await cb(require_adapter_factory.createAdapterFactory({
|
|
219
|
+
config: adapterOptions.config,
|
|
220
|
+
adapter: createCustomAdapter(db, session)
|
|
221
|
+
})(lazyOptions));
|
|
222
|
+
await session.commitTransaction();
|
|
223
|
+
return result;
|
|
224
|
+
} catch (err) {
|
|
225
|
+
await session.abortTransaction();
|
|
226
|
+
throw err;
|
|
227
|
+
} finally {
|
|
228
|
+
await session.endSession();
|
|
229
|
+
}
|
|
230
|
+
} : false,
|
|
231
|
+
customTransformInput({ action, data, field, fieldAttributes, schema, model, options }) {
|
|
232
|
+
if (field === "_id" || fieldAttributes.references?.field === "id") {
|
|
233
|
+
if (action === "update") {
|
|
234
|
+
if (typeof data === "string") try {
|
|
235
|
+
return new mongodb.ObjectId(data);
|
|
236
|
+
} catch (error) {
|
|
237
|
+
return data;
|
|
238
|
+
}
|
|
239
|
+
return data;
|
|
240
|
+
}
|
|
241
|
+
if (Array.isArray(data)) return data.map((v) => {
|
|
242
|
+
if (typeof v === "string") try {
|
|
243
|
+
return new mongodb.ObjectId(v);
|
|
244
|
+
} catch (error) {
|
|
245
|
+
return v;
|
|
246
|
+
}
|
|
247
|
+
return v;
|
|
248
|
+
});
|
|
249
|
+
if (typeof data === "string") try {
|
|
250
|
+
return new mongodb.ObjectId(data);
|
|
251
|
+
} catch (error) {
|
|
252
|
+
return new mongodb.ObjectId();
|
|
253
|
+
}
|
|
254
|
+
if (data === null && fieldAttributes.references?.field === "id") return null;
|
|
255
|
+
return new mongodb.ObjectId();
|
|
256
|
+
}
|
|
257
|
+
return data;
|
|
258
|
+
},
|
|
259
|
+
customTransformOutput({ data, field, fieldAttributes }) {
|
|
260
|
+
if (field === "id" || fieldAttributes.references?.field === "id") {
|
|
261
|
+
if (data instanceof mongodb.ObjectId) return data.toHexString();
|
|
262
|
+
if (Array.isArray(data)) return data.map((v) => {
|
|
263
|
+
if (v instanceof mongodb.ObjectId) return v.toHexString();
|
|
264
|
+
return v;
|
|
265
|
+
});
|
|
266
|
+
return data;
|
|
267
|
+
}
|
|
268
|
+
return data;
|
|
269
|
+
},
|
|
270
|
+
customIdGenerator(props) {
|
|
271
|
+
return new mongodb.ObjectId().toString();
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
adapter: createCustomAdapter(db)
|
|
275
|
+
};
|
|
276
|
+
lazyAdapter = require_adapter_factory.createAdapterFactory(adapterOptions);
|
|
277
|
+
return (options) => {
|
|
278
|
+
lazyOptions = options;
|
|
279
|
+
return lazyAdapter(options);
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* Safely escape user input for use in a MongoDB regex.
|
|
284
|
+
* This ensures the resulting pattern is treated as literal text,
|
|
285
|
+
* and not as a regex with special syntax.
|
|
286
|
+
*
|
|
287
|
+
* @param input - The input string to escape. Any type that isn't a string will be converted to an empty string.
|
|
288
|
+
* @param maxLength - The maximum length of the input string to escape. Defaults to 256. This is to prevent DOS attacks.
|
|
289
|
+
* @returns The escaped string.
|
|
290
|
+
*/
|
|
291
|
+
function escapeForMongoRegex(input, maxLength = 256) {
|
|
292
|
+
if (typeof input !== "string") return "";
|
|
293
|
+
return input.slice(0, maxLength).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
//#endregion
|
|
297
|
+
exports.mongodbAdapter = mongodbAdapter;
|
|
@@ -1,4 +1,36 @@
|
|
|
1
|
-
import "../../index-
|
|
1
|
+
import { I as FaireAuthOptions } from "../../index-BNCikaaH.cjs";
|
|
2
2
|
import "../../hono-DOM31WQz.cjs";
|
|
3
|
-
import {
|
|
3
|
+
import { DBAdapter, DBAdapterDebugLogOption } from "@faire-auth/core/db/adapter";
|
|
4
|
+
import { Db, MongoClient } from "mongodb";
|
|
5
|
+
|
|
6
|
+
//#region src/adapters/mongodb-adapter/mongodb-adapter.d.ts
|
|
7
|
+
interface MongoDBAdapterConfig {
|
|
8
|
+
/**
|
|
9
|
+
* MongoDB client instance
|
|
10
|
+
* If not provided, Database transactions won't be enabled.
|
|
11
|
+
*/
|
|
12
|
+
client?: MongoClient;
|
|
13
|
+
/**
|
|
14
|
+
* Enable debug logs for the adapter
|
|
15
|
+
*
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
debugLogs?: DBAdapterDebugLogOption;
|
|
19
|
+
/**
|
|
20
|
+
* Use plural table names
|
|
21
|
+
*
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
usePlural?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Whether to execute multiple operations in a transaction.
|
|
27
|
+
*
|
|
28
|
+
* If the database doesn't support transactions,
|
|
29
|
+
* set this to `false` and operations will be executed sequentially.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
transaction?: boolean;
|
|
33
|
+
}
|
|
34
|
+
declare const mongodbAdapter: (db: Db, config?: MongoDBAdapterConfig) => (options: FaireAuthOptions) => DBAdapter<FaireAuthOptions>;
|
|
35
|
+
//#endregion
|
|
4
36
|
export { MongoDBAdapterConfig, mongodbAdapter };
|
|
@@ -1,4 +1,36 @@
|
|
|
1
|
-
import "../../index-
|
|
2
|
-
import "../../hono-
|
|
3
|
-
import {
|
|
1
|
+
import { I as FaireAuthOptions } from "../../index-BotKDRUI.mjs";
|
|
2
|
+
import "../../hono-D0VqxVy1.mjs";
|
|
3
|
+
import { DBAdapter, DBAdapterDebugLogOption } from "@faire-auth/core/db/adapter";
|
|
4
|
+
import { Db, MongoClient } from "mongodb";
|
|
5
|
+
|
|
6
|
+
//#region src/adapters/mongodb-adapter/mongodb-adapter.d.ts
|
|
7
|
+
interface MongoDBAdapterConfig {
|
|
8
|
+
/**
|
|
9
|
+
* MongoDB client instance
|
|
10
|
+
* If not provided, Database transactions won't be enabled.
|
|
11
|
+
*/
|
|
12
|
+
client?: MongoClient;
|
|
13
|
+
/**
|
|
14
|
+
* Enable debug logs for the adapter
|
|
15
|
+
*
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
debugLogs?: DBAdapterDebugLogOption;
|
|
19
|
+
/**
|
|
20
|
+
* Use plural table names
|
|
21
|
+
*
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
usePlural?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Whether to execute multiple operations in a transaction.
|
|
27
|
+
*
|
|
28
|
+
* If the database doesn't support transactions,
|
|
29
|
+
* set this to `false` and operations will be executed sequentially.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
transaction?: boolean;
|
|
33
|
+
}
|
|
34
|
+
declare const mongodbAdapter: (db: Db, config?: MongoDBAdapterConfig) => (options: FaireAuthOptions) => DBAdapter<FaireAuthOptions>;
|
|
35
|
+
//#endregion
|
|
4
36
|
export { MongoDBAdapterConfig, mongodbAdapter };
|