@better-auth/infra 0.2.8 → 0.2.10
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/client.d.mts +4 -5
- package/dist/client.mjs +5 -3
- package/dist/{dash-client-B6U89e1S.d.mts → dash-client-CZzJyRrV.d.mts} +1 -3
- package/dist/index.d.mts +583 -563
- package/dist/index.mjs +393 -81
- package/dist/native.d.mts +1 -1
- package/dist/native.mjs +5 -3
- package/dist/{pow-retry-BTL4g3RP.mjs → pow-retry-D2RRftJr.mjs} +34 -1
- package/package.json +13 -12
package/dist/client.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { a as DashGetAuditLogsInput, i as DashGetAllAuditLogsInput, n as DashAuditLogsResponse, o as dashClient, r as DashClientOptions, t as DashAuditLog } from "./dash-client-
|
|
2
|
-
import * as _$_better_fetch_fetch0 from "@better-fetch/fetch";
|
|
1
|
+
import { a as DashGetAuditLogsInput, i as DashGetAllAuditLogsInput, n as DashAuditLogsResponse, o as dashClient, r as DashClientOptions, t as DashAuditLog } from "./dash-client-CZzJyRrV.mjs";
|
|
3
2
|
|
|
4
3
|
//#region src/sentinel/client.d.ts
|
|
5
4
|
interface SentinelClientOptions {
|
|
@@ -36,15 +35,15 @@ declare const sentinelClient: (options?: SentinelClientOptions) => {
|
|
|
36
35
|
id: string;
|
|
37
36
|
name: string;
|
|
38
37
|
hooks: {
|
|
39
|
-
onRequest<T extends Record<string, any>>(context:
|
|
38
|
+
onRequest<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>): Promise<import("@better-fetch/fetch").RequestContext<T>>;
|
|
40
39
|
onResponse?: undefined;
|
|
41
40
|
};
|
|
42
41
|
} | {
|
|
43
42
|
id: string;
|
|
44
43
|
name: string;
|
|
45
44
|
hooks: {
|
|
46
|
-
onResponse(context:
|
|
47
|
-
onRequest<T extends Record<string, any>>(context:
|
|
45
|
+
onResponse(context: import("@better-fetch/fetch").ResponseContext): Promise<import("@better-fetch/fetch").ResponseContext>;
|
|
46
|
+
onRequest<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>): Promise<import("@better-fetch/fetch").RequestContext<T>>;
|
|
48
47
|
};
|
|
49
48
|
})[];
|
|
50
49
|
};
|
package/dist/client.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./constants-CvriWQVc.mjs";
|
|
2
2
|
import { n as createKV } from "./fetch-DiAhoiKA.mjs";
|
|
3
|
-
import { a as
|
|
3
|
+
import { a as resolveSentinelClientIdentifyUrl, i as solvePoWChallenge, l as hash, n as decodePoWChallenge, o as generateRequestId, r as encodePoWSolution, s as identify, t as createPowRetryTimeout, u as dashClient } from "./pow-retry-D2RRftJr.mjs";
|
|
4
4
|
import { env } from "@better-auth/core/env";
|
|
5
5
|
//#region src/sentinel/fingerprint.ts
|
|
6
6
|
function murmurhash3(str, seed = 0) {
|
|
@@ -422,11 +422,13 @@ async function waitForIdentify(timeoutMs) {
|
|
|
422
422
|
}
|
|
423
423
|
//#endregion
|
|
424
424
|
//#region src/sentinel/client.ts
|
|
425
|
-
const DEFAULT_IDENTIFY_URL = "https://kv.better-auth.com";
|
|
426
425
|
const sentinelClient = (options) => {
|
|
427
426
|
const autoSolve = options?.autoSolveChallenge !== false;
|
|
428
427
|
const $kv = createKV({
|
|
429
|
-
kvUrl:
|
|
428
|
+
kvUrl: resolveSentinelClientIdentifyUrl({
|
|
429
|
+
identifyUrl: options?.identifyUrl,
|
|
430
|
+
envKvUrl: env.BETTER_AUTH_KV_URL
|
|
431
|
+
}),
|
|
430
432
|
kvTimeout: options?.kvTimeout
|
|
431
433
|
});
|
|
432
434
|
if (typeof window !== "undefined") {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import * as _$_better_fetch_fetch0 from "@better-fetch/fetch";
|
|
2
|
-
|
|
3
1
|
//#region src/dash-client.d.ts
|
|
4
2
|
interface DashAuditLog {
|
|
5
3
|
eventType: string;
|
|
@@ -58,7 +56,7 @@ interface DashClientOptions {
|
|
|
58
56
|
}
|
|
59
57
|
declare const dashClient: (options?: DashClientOptions) => {
|
|
60
58
|
id: "dash";
|
|
61
|
-
getActions: ($fetch:
|
|
59
|
+
getActions: ($fetch: import("@better-fetch/fetch").BetterFetch) => {
|
|
62
60
|
dash: {
|
|
63
61
|
getAuditLogs: (input?: DashGetAuditLogsInput) => Promise<{
|
|
64
62
|
data: null;
|