faire-auth 1.0.4 → 1.1.0
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/{adapter-factory-lKIOf2OR.mjs → adapter-factory-qPVW8x9-.mjs} +34 -36
- package/dist/{adapter-factory-D1I7joki.cjs → adapter-factory-u8r3oTez.cjs} +66 -68
- package/dist/adapters/drizzle-adapter/index.cjs +34 -40
- package/dist/adapters/drizzle-adapter/index.d.cts +4 -9
- package/dist/adapters/drizzle-adapter/index.d.mts +4 -9
- package/dist/adapters/drizzle-adapter/index.mjs +20 -26
- package/dist/adapters/index.cjs +11 -16
- package/dist/adapters/index.d.cts +11 -37
- package/dist/adapters/index.d.mts +11 -37
- package/dist/adapters/index.mjs +4 -13
- package/dist/adapters/kysely-adapter/index.cjs +270 -11
- package/dist/adapters/kysely-adapter/index.d.cts +9 -19
- package/dist/adapters/kysely-adapter/index.d.mts +9 -19
- package/dist/adapters/kysely-adapter/index.mjs +267 -9
- package/dist/adapters/memory-adapter/index.cjs +146 -9
- package/dist/adapters/memory-adapter/index.d.cts +4 -10
- package/dist/adapters/memory-adapter/index.d.mts +4 -10
- package/dist/adapters/memory-adapter/index.mjs +145 -9
- package/dist/adapters/mongodb-adapter/index.cjs +13 -21
- package/dist/adapters/mongodb-adapter/index.d.cts +3 -8
- package/dist/adapters/mongodb-adapter/index.d.mts +4 -9
- package/dist/adapters/mongodb-adapter/index.mjs +12 -20
- package/dist/adapters/prisma-adapter/index.cjs +12 -20
- package/dist/adapters/prisma-adapter/index.d.cts +4 -8
- package/dist/adapters/prisma-adapter/index.d.mts +4 -8
- package/dist/adapters/prisma-adapter/index.mjs +5 -13
- package/dist/adapters/test.cjs +86 -69
- package/dist/adapters/test.d.cts +7 -11
- package/dist/adapters/test.d.mts +7 -11
- package/dist/adapters/test.mjs +83 -66
- package/dist/api/index.cjs +3 -20
- package/dist/api/index.d.cts +2 -3
- package/dist/api/index.d.mts +2 -3
- package/dist/api/index.mjs +1 -20
- package/dist/api/middleware/index.cjs +4 -11
- package/dist/api/middleware/index.d.cts +3 -9
- package/dist/api/middleware/index.d.mts +3 -9
- package/dist/api/middleware/index.mjs +3 -11
- package/dist/{api-B4RDwBty.mjs → api-0f-F-Fi2.mjs} +292 -189
- package/dist/{api-CaRC1Gio.cjs → api-LjfH6hQi.cjs} +557 -452
- package/dist/{test-utils/bun-sqlite-dialect-BZBvHchL.cjs → bun-sqlite-dialect-BHkarnxN.cjs} +5 -9
- package/dist/{test-utils/bun-sqlite-dialect-BSWhhKNs.mjs → bun-sqlite-dialect-BiZBuEF6.mjs} +6 -9
- package/dist/client/index.cjs +8 -15
- package/dist/client/index.d.cts +9 -14
- package/dist/client/index.d.mts +9 -14
- package/dist/client/index.mjs +7 -15
- package/dist/client/lynx/index.cjs +10 -18
- package/dist/client/lynx/index.d.cts +402 -71
- package/dist/client/lynx/index.d.mts +402 -71
- package/dist/client/lynx/index.mjs +5 -13
- package/dist/client/plugins/index.cjs +3 -5
- package/dist/client/plugins/index.d.cts +5 -10
- package/dist/client/plugins/index.d.mts +5 -10
- package/dist/client/plugins/index.mjs +2 -4
- package/dist/client/react/index.cjs +6 -14
- package/dist/client/react/index.d.cts +402 -71
- package/dist/client/react/index.d.mts +402 -71
- package/dist/client/react/index.mjs +5 -13
- package/dist/client/solid/index.cjs +6 -14
- package/dist/client/solid/index.d.cts +393 -57
- package/dist/client/solid/index.d.mts +393 -57
- package/dist/client/solid/index.mjs +5 -13
- package/dist/client/svelte/index.cjs +5 -10
- package/dist/client/svelte/index.d.cts +400 -67
- package/dist/client/svelte/index.d.mts +400 -67
- package/dist/client/svelte/index.mjs +4 -10
- package/dist/client/vue/index.cjs +6 -14
- package/dist/client/vue/index.d.cts +401 -68
- package/dist/client/vue/index.d.mts +401 -68
- package/dist/client/vue/index.mjs +5 -13
- package/dist/{cookies-BTs1o992.mjs → cookies-D9aY_gJh.mjs} +25 -21
- package/dist/{cookies-BTl72THv.cjs → cookies-DQ52rcOy.cjs} +119 -115
- package/dist/crypto/index.cjs +10 -8
- package/dist/crypto/index.d.cts +5 -13
- package/dist/crypto/index.d.mts +5 -13
- package/dist/crypto/index.mjs +2 -5
- package/dist/{crypto-DH2Aa7jN.mjs → crypto-BH-hD0lJ.mjs} +7 -10
- package/dist/{crypto-DpSCnrTp.cjs → crypto-BITfWVwD.cjs} +24 -27
- package/dist/db/index.cjs +1135 -29
- package/dist/db/index.d.cts +1 -2
- package/dist/db/index.d.mts +1 -2
- package/dist/db/index.mjs +1115 -16
- package/dist/defu-D2h4S3X-.mjs +87 -0
- package/dist/defu-DWS5RPWt.cjs +134 -0
- package/dist/{email-verification-DI_0H4JC.cjs → email-verification-DOPnSgbI.cjs} +65 -71
- package/dist/{email-verification-C_lBu_JY.mjs → email-verification-YSR5n5lb.mjs} +23 -29
- package/dist/{hono-CO-zsqI-.mjs → hono-BAV2wQkK.mjs} +16 -33
- package/dist/hono-SVQuc5Ru.mjs +4 -0
- package/dist/hono-pgK4H_U1.cjs +9 -0
- package/dist/{hono-DnW5crl1.cjs → hono-tyFFJFdS.cjs} +42 -60
- package/dist/index-B86Cy0dE.d.cts +2 -0
- package/dist/index-B86Cy0dE.d.mts +2 -0
- package/dist/index.cjs +115 -150
- package/dist/index.d.cts +4 -5
- package/dist/index.d.mts +4 -5
- package/dist/index.mjs +45 -80
- package/dist/integrations/next-js.cjs +5 -9
- package/dist/integrations/next-js.d.cts +6 -14
- package/dist/integrations/next-js.d.mts +6 -14
- package/dist/integrations/next-js.mjs +4 -9
- package/dist/integrations/node.cjs +16 -14
- package/dist/integrations/node.d.cts +6 -14
- package/dist/integrations/node.d.mts +6 -14
- package/dist/integrations/node.mjs +15 -13
- package/dist/integrations/react-start.cjs +7 -11
- package/dist/integrations/react-start.d.cts +5 -13
- package/dist/integrations/react-start.d.mts +5 -13
- package/dist/integrations/react-start.mjs +6 -11
- package/dist/integrations/solid-start.cjs +3 -5
- package/dist/integrations/solid-start.d.cts +2 -5
- package/dist/integrations/solid-start.d.mts +2 -5
- package/dist/integrations/solid-start.mjs +2 -4
- package/dist/integrations/svelte-kit.cjs +6 -10
- package/dist/integrations/svelte-kit.d.cts +11 -23
- package/dist/integrations/svelte-kit.d.mts +11 -23
- package/dist/integrations/svelte-kit.mjs +5 -10
- package/dist/{ip-BjNYspCH.mjs → ip-6Lv2o42m.mjs} +4 -9
- package/dist/{ip-C17Qdq-G.cjs → ip-DPydExzV.cjs} +21 -27
- package/dist/{json--tl7Grvs.cjs → json-D3aq-nH2.cjs} +9 -13
- package/dist/{json-B1v2qRTQ.mjs → json-DooGMtnJ.mjs} +2 -5
- package/dist/{logged-CyGfp8_H.mjs → logged-B83SzMnJ.mjs} +6 -10
- package/dist/{logged-Dv3st5qc.cjs → logged-BIpCpnVY.cjs} +13 -18
- package/dist/{middleware-CE6OhDkq.mjs → middleware-Cakg4e1D.mjs} +2 -4
- package/dist/{middleware-CWvRH4EW.cjs → middleware-Cd-VkNxB.cjs} +17 -20
- package/dist/{node-sqlite-dialect-w4DAg0PH.mjs → node-sqlite-dialect-BMVOjEMh.mjs} +6 -9
- package/dist/{test-utils/node-sqlite-dialect-BgJqjBOu.cjs → node-sqlite-dialect-D3QPFROH.cjs} +5 -9
- package/dist/oauth2/index.cjs +166 -22
- package/dist/oauth2/index.d.cts +5 -17
- package/dist/oauth2/index.d.mts +5 -17
- package/dist/oauth2/index.mjs +156 -16
- package/dist/{origin-check-DjLTuZQ8.cjs → origin-check-BflGhEEN.cjs} +34 -38
- package/dist/{origin-check-8Gajklvh.mjs → origin-check-CRgs1M7k.mjs} +13 -16
- package/dist/{parser-B25ylT5u.mjs → parser-CqwvpF6l.cjs} +12 -10
- package/dist/{parser-B_wxvaAr.cjs → parser-DcKDjjHO.mjs} +7 -22
- package/dist/plugins/access/index.cjs +38 -4
- package/dist/plugins/access/index.d.cts +36 -2
- package/dist/plugins/access/index.d.mts +36 -2
- package/dist/plugins/access/index.mjs +36 -3
- package/dist/plugins/bearer/index.cjs +52 -7
- package/dist/plugins/bearer/index.d.cts +27 -4
- package/dist/plugins/bearer/index.d.mts +27 -4
- package/dist/plugins/bearer/index.mjs +51 -7
- package/dist/plugins/index.cjs +1385 -842
- package/dist/plugins/index.d.cts +489 -7566
- package/dist/plugins/index.d.mts +489 -7566
- package/dist/plugins/index.mjs +1118 -576
- package/dist/plugins/passkey/index.cjs +551 -15
- package/dist/plugins/passkey/index.d.cts +123 -4
- package/dist/plugins/passkey/index.d.mts +123 -4
- package/dist/plugins/passkey/index.mjs +547 -15
- package/dist/{chunk-BFnQceUY.mjs → rolldown-runtime-BKpuH2hG.mjs} +6 -7
- package/dist/{chunk-fPmz2rbM.cjs → rolldown-runtime-C_Pgydhf.cjs} +22 -24
- package/dist/{schema-DTIwLLmf.mjs → schema-CFCpv0tK.mjs} +3 -6
- package/dist/{schema-CirKflVs.cjs → schema-b-lKhMkG.cjs} +51 -55
- package/dist/{session-CM3rmOYF.mjs → session-BGjJgihS.mjs} +51 -74
- package/dist/{session-Cwrj4GfV.cjs → session-CzZSMmQC.cjs} +197 -219
- package/dist/shared.d.cts +1581 -0
- package/dist/shared.d.mts +1581 -0
- package/dist/social-providers/index.cjs +9 -9
- package/dist/social-providers/index.d.cts +1 -1
- package/dist/social-providers/index.d.mts +1 -1
- package/dist/social-providers/index.mjs +3 -5
- package/dist/social-providers-CjPww-qf.mjs +6 -0
- package/dist/social-providers-D7w_7Ym8.cjs +10 -0
- package/dist/{state-CvSihlVT.cjs → state-2OrNjOO-.cjs} +24 -24
- package/dist/{state-CQghgH9I.mjs → state-Dooeisfq.mjs} +17 -17
- package/dist/{bun-sqlite-dialect-DPgTzc0w.cjs → test-utils/bun-sqlite-dialect-BHkarnxN.cjs} +5 -9
- package/dist/{bun-sqlite-dialect-6NqeV3px.mjs → test-utils/bun-sqlite-dialect-BiZBuEF6.mjs} +6 -9
- package/dist/test-utils/index.cjs +8831 -7941
- package/dist/test-utils/index.d.cts +310 -12440
- package/dist/test-utils/index.d.mts +313 -12440
- package/dist/test-utils/index.mjs +8591 -7701
- package/dist/test-utils/{node-sqlite-dialect-DAQXiobH.mjs → node-sqlite-dialect-BMVOjEMh.mjs} +6 -9
- package/dist/{node-sqlite-dialect-DP11CB0y.cjs → test-utils/node-sqlite-dialect-D3QPFROH.cjs} +5 -9
- package/dist/types/index.d.cts +2 -3
- package/dist/types/index.d.mts +2 -3
- package/dist/types/index.mjs +1 -1
- package/dist/{url-BoUuoIwZ.mjs → url-CJtdrrUu.mjs} +12 -13
- package/dist/{url-Ce7CVaQD.cjs → url-DjCmCUHS.cjs} +42 -44
- package/dist/utils/cookies.cjs +29 -30
- package/dist/utils/cookies.d.cts +21 -25
- package/dist/utils/cookies.d.mts +20 -24
- package/dist/utils/cookies.mjs +2 -7
- package/dist/utils-C7OHyfHa.mjs +4 -0
- package/dist/utils-iX0Vy_UL.cjs +3 -0
- package/package.json +40 -30
- package/dist/access-BZ7-AbTM.cjs +0 -51
- package/dist/access-D0DRqUKC.mjs +0 -39
- package/dist/bearer-DDzrp5M7.cjs +0 -60
- package/dist/bearer-WZcs7gxL.mjs +0 -54
- package/dist/db-4tUsQJXd.mjs +0 -1119
- package/dist/db-ChMbb_U-.cjs +0 -1180
- package/dist/defu-BmOYq4PU.cjs +0 -34
- package/dist/defu-D9ZTXqlo.mjs +0 -28
- package/dist/hono-C14rpOEa.cjs +0 -13
- package/dist/hono-CoKYWnXA.mjs +0 -7
- package/dist/hono-D0VqxVy1.d.mts +0 -18
- package/dist/hono-DOM31WQz.d.cts +0 -18
- package/dist/index--DLiUhEn.d.mts +0 -33
- package/dist/index-B4bqEDYG.d.mts +0 -992
- package/dist/index-BDhhaE6Y.d.cts +0 -3
- package/dist/index-Boa0SV4h.d.cts +0 -13350
- package/dist/index-Bykgiq3o.d.cts +0 -13350
- package/dist/index-CF9iq55a.d.mts +0 -3
- package/dist/index-CRt_fppq.d.mts +0 -41
- package/dist/index-CdLyn7qP.d.cts +0 -41
- package/dist/index-ClFGA8tb.d.mts +0 -33
- package/dist/index-ClOM0wFf.d.cts +0 -992
- package/dist/index-CsxNfGAV.d.mts +0 -13350
- package/dist/index-DKnO_Zfm.d.cts +0 -992
- package/dist/index-DRYO4mGd.d.cts +0 -33
- package/dist/index-Dsua4U8w.d.cts +0 -33
- package/dist/index-DxXFCG2_.d.mts +0 -13350
- package/dist/index-gtCVvDvC.d.mts +0 -992
- package/dist/kysely-adapter-CtIdoHa8.mjs +0 -270
- package/dist/kysely-adapter-QZTx077T.cjs +0 -288
- package/dist/memory-adapter-17RZd5df.cjs +0 -154
- package/dist/memory-adapter-Dp4XdCZK.mjs +0 -148
- package/dist/oauth2-5RL4cVNS.cjs +0 -177
- package/dist/oauth2-C56wz-n9.mjs +0 -159
- package/dist/passkey-BTT-v5c-.cjs +0 -512
- package/dist/passkey-CzY_W2us.mjs +0 -505
- package/dist/request-1NL_1lyJ.mjs +0 -58
- package/dist/request-CPNlp-DK.cjs +0 -100
- package/dist/social-providers-B8RK5yqI.mjs +0 -9
- package/dist/social-providers-BmFOIIPk.cjs +0 -13
- package/dist/utils-44aDDP8f.cjs +0 -2
- package/dist/utils-D4vZd1-9.mjs +0 -4
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
const require_index = require('./index.cjs');
|
|
2
1
|
let kysely = require("kysely");
|
|
3
|
-
|
|
4
|
-
//#region src/adapters/kysely-adapter/bun-sqlite-dialect.ts
|
|
2
|
+
// src/adapters/kysely-adapter/bun-sqlite-dialect.ts
|
|
5
3
|
var BunSqliteAdapter = class {
|
|
6
4
|
get supportsCreateIfNotExists() {
|
|
7
5
|
return true;
|
|
@@ -57,8 +55,8 @@ var BunSqliteConnection = class {
|
|
|
57
55
|
this.#db = db;
|
|
58
56
|
}
|
|
59
57
|
executeQuery(compiledQuery) {
|
|
60
|
-
const { sql
|
|
61
|
-
const stmt = this.#db.prepare(sql
|
|
58
|
+
const { sql, parameters } = compiledQuery;
|
|
59
|
+
const stmt = this.#db.prepare(sql);
|
|
62
60
|
return Promise.resolve({ rows: stmt.all(parameters) });
|
|
63
61
|
}
|
|
64
62
|
async *streamQuery() {
|
|
@@ -69,7 +67,7 @@ var ConnectionMutex = class {
|
|
|
69
67
|
#promise;
|
|
70
68
|
#resolve;
|
|
71
69
|
async lock() {
|
|
72
|
-
while (this.#promise) await this.#promise;
|
|
70
|
+
while (this.#promise !== void 0) await this.#promise;
|
|
73
71
|
this.#promise = new Promise((resolve) => {
|
|
74
72
|
this.#resolve = resolve;
|
|
75
73
|
});
|
|
@@ -151,6 +149,4 @@ var BunSqliteDialect = class {
|
|
|
151
149
|
return new BunSqliteIntrospector(db);
|
|
152
150
|
}
|
|
153
151
|
};
|
|
154
|
-
|
|
155
|
-
//#endregion
|
|
156
|
-
exports.BunSqliteDialect = BunSqliteDialect;
|
|
152
|
+
exports.BunSqliteDialect = BunSqliteDialect;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { CompiledQuery, DEFAULT_MIGRATION_LOCK_TABLE, DEFAULT_MIGRATION_TABLE, DefaultQueryCompiler,
|
|
2
|
-
|
|
3
|
-
//#region src/adapters/kysely-adapter/bun-sqlite-dialect.ts
|
|
1
|
+
import { CompiledQuery, DEFAULT_MIGRATION_LOCK_TABLE, DEFAULT_MIGRATION_TABLE, DefaultQueryCompiler, sql } from "kysely";
|
|
2
|
+
// src/adapters/kysely-adapter/bun-sqlite-dialect.ts
|
|
4
3
|
var BunSqliteAdapter = class {
|
|
5
4
|
get supportsCreateIfNotExists() {
|
|
6
5
|
return true;
|
|
@@ -56,8 +55,8 @@ var BunSqliteConnection = class {
|
|
|
56
55
|
this.#db = db;
|
|
57
56
|
}
|
|
58
57
|
executeQuery(compiledQuery) {
|
|
59
|
-
const { sql
|
|
60
|
-
const stmt = this.#db.prepare(sql
|
|
58
|
+
const { sql, parameters } = compiledQuery;
|
|
59
|
+
const stmt = this.#db.prepare(sql);
|
|
61
60
|
return Promise.resolve({ rows: stmt.all(parameters) });
|
|
62
61
|
}
|
|
63
62
|
async *streamQuery() {
|
|
@@ -68,7 +67,7 @@ var ConnectionMutex = class {
|
|
|
68
67
|
#promise;
|
|
69
68
|
#resolve;
|
|
70
69
|
async lock() {
|
|
71
|
-
while (this.#promise) await this.#promise;
|
|
70
|
+
while (this.#promise !== void 0) await this.#promise;
|
|
72
71
|
this.#promise = new Promise((resolve) => {
|
|
73
72
|
this.#resolve = resolve;
|
|
74
73
|
});
|
|
@@ -150,6 +149,4 @@ var BunSqliteDialect = class {
|
|
|
150
149
|
return new BunSqliteIntrospector(db);
|
|
151
150
|
}
|
|
152
151
|
};
|
|
153
|
-
|
|
154
|
-
//#endregion
|
|
155
|
-
export { BunSqliteAdapter, BunSqliteDialect, BunSqliteDriver, BunSqliteIntrospector, BunSqliteQueryCompiler };
|
|
152
|
+
export { BunSqliteDialect };
|
package/dist/client/index.cjs
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
const require_url = require(
|
|
3
|
-
require(
|
|
4
|
-
require(
|
|
5
|
-
|
|
6
|
-
require('../parser-B_wxvaAr.cjs');
|
|
7
|
-
|
|
8
|
-
//#region src/client/vanilla.ts
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_url = require("../url-DjCmCUHS.cjs");
|
|
3
|
+
const require_hono = require("../hono-tyFFJFdS.cjs");
|
|
4
|
+
const require_logged = require("../logged-BIpCpnVY.cjs");
|
|
5
|
+
// src/client/vanilla.ts
|
|
9
6
|
const capitalizeFirstLetter = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
10
7
|
const createAuthClient = () => (options) => {
|
|
11
8
|
const baseURL = require_url.getBaseURL(options.baseURL, options.basePath);
|
|
@@ -21,11 +18,9 @@ const createAuthClient = () => (options) => {
|
|
|
21
18
|
return require_hono.createHonoClient({
|
|
22
19
|
baseURL,
|
|
23
20
|
createFetchOptions: options.fetchOptions
|
|
24
|
-
}, routes, require_logged.
|
|
21
|
+
}, routes, require_logged.LoggerAPI.wrap($fetch, "fetch", "immediate"), pluginsAtoms, atomListeners);
|
|
25
22
|
};
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region src/client/index.ts
|
|
23
|
+
// src/client/index.ts
|
|
29
24
|
const InferPlugin = () => ({
|
|
30
25
|
id: "infer-server-plugin",
|
|
31
26
|
$InferServerPlugin: {}
|
|
@@ -33,9 +28,7 @@ const InferPlugin = () => ({
|
|
|
33
28
|
function InferAuth() {
|
|
34
29
|
return {};
|
|
35
30
|
}
|
|
36
|
-
|
|
37
|
-
//#endregion
|
|
38
31
|
exports.InferAuth = InferAuth;
|
|
39
32
|
exports.InferPlugin = InferPlugin;
|
|
40
33
|
exports.createAuthClient = createAuthClient;
|
|
41
|
-
exports.useAuthQuery = require_hono.useAuthQuery;
|
|
34
|
+
exports.useAuthQuery = require_hono.useAuthQuery;
|
package/dist/client/index.d.cts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import "../
|
|
3
|
-
import { t as index_d_exports } from "../index-BDhhaE6Y.cjs";
|
|
1
|
+
import { $ as FaireAuthClientPlugin, J as AtomListener, K as InferResolvedHooks, Q as CreateSchemaType, X as Client, Y as CamelCase, Z as ClientOptions, at as InferPluginsFromClient, bt as FaireAuthPlugin, ct as IsSignal, dt as Store, et as Inc, ft as FetchOptions, ht as FaireAuthOptions, it as InferErrorCodes, lt as RevalidateOptions, nt as InferAdditionalAsClient, ot as InferSessionFromClient, q as createAuthClient, rt as InferAdditionalFromClient, st as InferUserFromClient, tt as InferActions, ut as SessionQueryParams } from "../shared.cjs";
|
|
2
|
+
import { t as index_d_exports } from "../index-B86Cy0dE.cjs";
|
|
4
3
|
import { BetterFetch, BetterFetchError, BetterFetchOption } from "@better-fetch/fetch";
|
|
5
4
|
import { PreinitializedWritableAtom } from "nanostores";
|
|
6
|
-
export * from "@better-fetch/fetch";
|
|
7
|
-
export * from "nanostores";
|
|
8
|
-
|
|
9
|
-
//#region src/client/query.d.ts
|
|
10
|
-
declare const useAuthQuery: <T>(initializedAtom: PreinitializedWritableAtom<any> | PreinitializedWritableAtom<any>[], path: string, $fetch: BetterFetch, options?: ((value: {
|
|
5
|
+
export type * from "@better-fetch/fetch";
|
|
6
|
+
export type * from "nanostores";
|
|
7
|
+
export declare const useAuthQuery: <T>(initializedAtom: PreinitializedWritableAtom<any> | PreinitializedWritableAtom<any>[], path: string, $fetch: BetterFetch, options?: ((value: {
|
|
11
8
|
data: null | T;
|
|
12
9
|
error: BetterFetchError | null;
|
|
13
10
|
isPending: boolean;
|
|
@@ -18,14 +15,12 @@ declare const useAuthQuery: <T>(initializedAtom: PreinitializedWritableAtom<any>
|
|
|
18
15
|
isRefetching: boolean;
|
|
19
16
|
refetch: () => void;
|
|
20
17
|
}> & object;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
declare const InferPlugin: <T extends FaireAuthPlugin>() => {
|
|
24
|
-
id: "infer-server-plugin";
|
|
18
|
+
export declare const InferPlugin: <T extends FaireAuthPlugin>() => {
|
|
19
|
+
id: string;
|
|
25
20
|
$InferServerPlugin: T;
|
|
26
21
|
};
|
|
27
|
-
declare function InferAuth<O extends {
|
|
22
|
+
export declare function InferAuth<O extends {
|
|
28
23
|
options: FaireAuthOptions;
|
|
29
24
|
}>(): O["options"];
|
|
30
25
|
type SocialProvider = index_d_exports.SocialProvider;
|
|
31
|
-
export { AtomListener, CamelCase, Client, ClientOptions, CreateSchemaType, FaireAuthClientPlugin, type FetchOptions, Inc, InferActions, InferAdditionalAsClient, InferAdditionalFromClient,
|
|
26
|
+
export { type AtomListener, type CamelCase, type Client, type ClientOptions, type CreateSchemaType, type FaireAuthClientPlugin, type FetchOptions, type Inc, type InferActions, type InferAdditionalAsClient, type InferAdditionalFromClient, type InferErrorCodes, type InferPluginsFromClient, InferResolvedHooks, type InferSessionFromClient, type InferUserFromClient, type IsSignal, type RevalidateOptions, type SessionQueryParams, type SocialProvider, type Store, createAuthClient };
|
package/dist/client/index.d.mts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import "../
|
|
3
|
-
import { t as index_d_exports } from "../index-CF9iq55a.mjs";
|
|
1
|
+
import { $ as CreateSchemaType, J as createAuthClient, Q as ClientOptions, X as CamelCase, Y as AtomListener, Z as Client, at as InferErrorCodes, ct as InferUserFromClient, dt as SessionQueryParams, et as FaireAuthClientPlugin, ft as Store, gt as FaireAuthOptions, it as InferAdditionalFromClient, lt as IsSignal, nt as InferActions, ot as InferPluginsFromClient, pt as FetchOptions, q as InferResolvedHooks, rt as InferAdditionalAsClient, st as InferSessionFromClient, tt as Inc, ut as RevalidateOptions, xt as FaireAuthPlugin } from "../shared.mjs";
|
|
2
|
+
import { t as index_d_exports } from "../index-B86Cy0dE.mjs";
|
|
4
3
|
import { BetterFetch, BetterFetchError, BetterFetchOption } from "@better-fetch/fetch";
|
|
5
4
|
import { PreinitializedWritableAtom } from "nanostores";
|
|
6
|
-
export * from "@better-fetch/fetch";
|
|
7
|
-
export * from "nanostores";
|
|
8
|
-
|
|
9
|
-
//#region src/client/query.d.ts
|
|
10
|
-
declare const useAuthQuery: <T>(initializedAtom: PreinitializedWritableAtom<any> | PreinitializedWritableAtom<any>[], path: string, $fetch: BetterFetch, options?: ((value: {
|
|
5
|
+
export type * from "@better-fetch/fetch";
|
|
6
|
+
export type * from "nanostores";
|
|
7
|
+
export declare const useAuthQuery: <T>(initializedAtom: PreinitializedWritableAtom<any> | PreinitializedWritableAtom<any>[], path: string, $fetch: BetterFetch, options?: ((value: {
|
|
11
8
|
data: null | T;
|
|
12
9
|
error: BetterFetchError | null;
|
|
13
10
|
isPending: boolean;
|
|
@@ -18,14 +15,12 @@ declare const useAuthQuery: <T>(initializedAtom: PreinitializedWritableAtom<any>
|
|
|
18
15
|
isRefetching: boolean;
|
|
19
16
|
refetch: () => void;
|
|
20
17
|
}> & object;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
declare const InferPlugin: <T extends FaireAuthPlugin>() => {
|
|
24
|
-
id: "infer-server-plugin";
|
|
18
|
+
export declare const InferPlugin: <T extends FaireAuthPlugin>() => {
|
|
19
|
+
id: string;
|
|
25
20
|
$InferServerPlugin: T;
|
|
26
21
|
};
|
|
27
|
-
declare function InferAuth<O extends {
|
|
22
|
+
export declare function InferAuth<O extends {
|
|
28
23
|
options: FaireAuthOptions;
|
|
29
24
|
}>(): O["options"];
|
|
30
25
|
type SocialProvider = index_d_exports.SocialProvider;
|
|
31
|
-
export { AtomListener, CamelCase, Client, ClientOptions, CreateSchemaType, FaireAuthClientPlugin, type FetchOptions, Inc, InferActions, InferAdditionalAsClient, InferAdditionalFromClient,
|
|
26
|
+
export { type AtomListener, type CamelCase, type Client, type ClientOptions, type CreateSchemaType, type FaireAuthClientPlugin, type FetchOptions, type Inc, type InferActions, type InferAdditionalAsClient, type InferAdditionalFromClient, type InferErrorCodes, type InferPluginsFromClient, InferResolvedHooks, type InferSessionFromClient, type InferUserFromClient, type IsSignal, type RevalidateOptions, type SessionQueryParams, type SocialProvider, type Store, createAuthClient };
|
package/dist/client/index.mjs
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t as
|
|
3
|
-
import "../
|
|
4
|
-
|
|
5
|
-
import { n as getClientConfig, r as useAuthQuery, t as createHonoClient } from "../hono-CO-zsqI-.mjs";
|
|
6
|
-
import "../parser-B25ylT5u.mjs";
|
|
7
|
-
|
|
8
|
-
//#region src/client/vanilla.ts
|
|
1
|
+
import { t as getBaseURL } from "../url-CJtdrrUu.mjs";
|
|
2
|
+
import { n as getClientConfig, r as useAuthQuery, t as createHonoClient } from "../hono-BAV2wQkK.mjs";
|
|
3
|
+
import { t as LoggerAPI } from "../logged-B83SzMnJ.mjs";
|
|
4
|
+
// src/client/vanilla.ts
|
|
9
5
|
const capitalizeFirstLetter = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
10
6
|
const createAuthClient = () => (options) => {
|
|
11
7
|
const baseURL = getBaseURL(options.baseURL, options.basePath);
|
|
@@ -21,11 +17,9 @@ const createAuthClient = () => (options) => {
|
|
|
21
17
|
return createHonoClient({
|
|
22
18
|
baseURL,
|
|
23
19
|
createFetchOptions: options.fetchOptions
|
|
24
|
-
}, routes,
|
|
20
|
+
}, routes, LoggerAPI.wrap($fetch, "fetch", "immediate"), pluginsAtoms, atomListeners);
|
|
25
21
|
};
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region src/client/index.ts
|
|
22
|
+
// src/client/index.ts
|
|
29
23
|
const InferPlugin = () => ({
|
|
30
24
|
id: "infer-server-plugin",
|
|
31
25
|
$InferServerPlugin: {}
|
|
@@ -33,6 +27,4 @@ const InferPlugin = () => ({
|
|
|
33
27
|
function InferAuth() {
|
|
34
28
|
return {};
|
|
35
29
|
}
|
|
36
|
-
|
|
37
|
-
//#endregion
|
|
38
|
-
export { InferAuth, InferPlugin, createAuthClient, useAuthQuery };
|
|
30
|
+
export { InferAuth, InferPlugin, createAuthClient, useAuthQuery };
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
const require_url = require(
|
|
3
|
-
require(
|
|
4
|
-
require('../../defu-BmOYq4PU.cjs');
|
|
5
|
-
const require_hono = require('../../hono-DnW5crl1.cjs');
|
|
6
|
-
require('../../parser-B_wxvaAr.cjs');
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_url = require("../../url-DjCmCUHS.cjs");
|
|
3
|
+
const require_hono = require("../../hono-tyFFJFdS.cjs");
|
|
7
4
|
let nanostores = require("nanostores");
|
|
8
|
-
let
|
|
9
|
-
|
|
10
|
-
//#region src/client/lynx/lynx-store.ts
|
|
5
|
+
let _lynx_js_react = require("@lynx-js/react");
|
|
6
|
+
// src/client/lynx/lynx-store.ts
|
|
11
7
|
/**
|
|
12
8
|
* Subscribe to store changes and get store's value.
|
|
13
9
|
*
|
|
@@ -32,9 +28,9 @@ let __lynx_js_react = require("@lynx-js/react");
|
|
|
32
28
|
* @returns Store value.
|
|
33
29
|
*/
|
|
34
30
|
function useStore(store, options = {}) {
|
|
35
|
-
let snapshotRef = (0,
|
|
31
|
+
let snapshotRef = (0, _lynx_js_react.useRef)(store.get());
|
|
36
32
|
const { keys, deps = [store, keys] } = options;
|
|
37
|
-
let subscribe = (0,
|
|
33
|
+
let subscribe = (0, _lynx_js_react.useCallback)((onChange) => {
|
|
38
34
|
const emitChange = (value) => {
|
|
39
35
|
if (snapshotRef.current === value) return;
|
|
40
36
|
snapshotRef.current = value;
|
|
@@ -45,11 +41,9 @@ function useStore(store, options = {}) {
|
|
|
45
41
|
return store.listen(emitChange);
|
|
46
42
|
}, deps);
|
|
47
43
|
let get = () => snapshotRef.current;
|
|
48
|
-
return (0,
|
|
44
|
+
return (0, _lynx_js_react.useSyncExternalStore)(subscribe, get, get);
|
|
49
45
|
}
|
|
50
|
-
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/client/lynx/index.ts
|
|
46
|
+
// src/client/lynx/index.ts
|
|
53
47
|
function getAtomKey(str) {
|
|
54
48
|
return `use${capitalizeFirstLetter(str)}`;
|
|
55
49
|
}
|
|
@@ -72,8 +66,6 @@ const createAuthClient = () => (options) => {
|
|
|
72
66
|
createFetchOptions: options.fetchOptions
|
|
73
67
|
}, routes, $fetch, pluginsAtoms, atomListeners);
|
|
74
68
|
};
|
|
75
|
-
|
|
76
|
-
//#endregion
|
|
77
69
|
exports.capitalizeFirstLetter = capitalizeFirstLetter;
|
|
78
70
|
exports.createAuthClient = createAuthClient;
|
|
79
|
-
exports.useStore = useStore;
|
|
71
|
+
exports.useStore = useStore;
|