@better-auth/infra 0.2.5 → 0.2.7
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 +7 -2
- package/dist/client.mjs +34 -20
- package/dist/{constants-DdWGfvz1.mjs → constants-CvriWQVc.mjs} +6 -2
- package/dist/{dash-client-hJHp7l_X.d.mts → dash-client-B6U89e1S.d.mts} +22 -1
- package/dist/email.d.mts +5 -0
- package/dist/email.mjs +33 -31
- package/dist/fetch-DiAhoiKA.mjs +26 -0
- package/dist/index.d.mts +70 -9
- package/dist/index.mjs +607 -461
- package/dist/native.d.mts +7 -2
- package/dist/native.mjs +28 -15
- package/dist/{pow-BUuN_EKw.mjs → pow-retry-BTL4g3RP.mjs} +56 -36
- package/package.json +6 -6
package/dist/client.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as DashGetAuditLogsInput, i as DashGetAllAuditLogsInput, n as DashAuditLogsResponse, o as dashClient, r as DashClientOptions, t as DashAuditLog } from "./dash-client-B6U89e1S.mjs";
|
|
2
2
|
import * as _$_better_fetch_fetch0 from "@better-fetch/fetch";
|
|
3
3
|
|
|
4
4
|
//#region src/sentinel/client.d.ts
|
|
@@ -8,6 +8,11 @@ interface SentinelClientOptions {
|
|
|
8
8
|
* @default "https://kv.better-auth.com"
|
|
9
9
|
*/
|
|
10
10
|
identifyUrl?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Timeout for KV identify and related HTTP requests (milliseconds).
|
|
13
|
+
* @default 1000
|
|
14
|
+
*/
|
|
15
|
+
kvTimeout?: number;
|
|
11
16
|
/**
|
|
12
17
|
* Whether to automatically solve PoW challenges (default: true)
|
|
13
18
|
*/
|
|
@@ -44,4 +49,4 @@ declare const sentinelClient: (options?: SentinelClientOptions) => {
|
|
|
44
49
|
})[];
|
|
45
50
|
};
|
|
46
51
|
//#endregion
|
|
47
|
-
export { type DashAuditLog, type DashAuditLogsResponse, type DashClientOptions, type DashGetAuditLogsInput, type SentinelClientOptions, dashClient, sentinelClient };
|
|
52
|
+
export { type DashAuditLog, type DashAuditLogsResponse, type DashClientOptions, type DashGetAllAuditLogsInput, type DashGetAuditLogsInput, type SentinelClientOptions, dashClient, sentinelClient };
|
package/dist/client.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import "./constants-CvriWQVc.mjs";
|
|
2
|
+
import { n as createKV } from "./fetch-DiAhoiKA.mjs";
|
|
3
|
+
import { a as generateRequestId, c as hash, i as solvePoWChallenge, l as dashClient, n as decodePoWChallenge, o as identify, r as encodePoWSolution, t as createPowRetryTimeout } from "./pow-retry-BTL4g3RP.mjs";
|
|
3
4
|
import { env } from "@better-auth/core/env";
|
|
4
5
|
//#region src/sentinel/fingerprint.ts
|
|
5
6
|
function murmurhash3(str, seed = 0) {
|
|
@@ -384,7 +385,7 @@ async function getFingerprint() {
|
|
|
384
385
|
return null;
|
|
385
386
|
}
|
|
386
387
|
}
|
|
387
|
-
async function sendIdentify(
|
|
388
|
+
async function sendIdentify($kv) {
|
|
388
389
|
if (identifySent || typeof window === "undefined") return;
|
|
389
390
|
const fingerprint = await getFingerprint();
|
|
390
391
|
if (!fingerprint) return;
|
|
@@ -401,7 +402,7 @@ async function sendIdentify(identifyUrl) {
|
|
|
401
402
|
incognito: detectIncognito()
|
|
402
403
|
};
|
|
403
404
|
try {
|
|
404
|
-
await identify(
|
|
405
|
+
await identify($kv, payload);
|
|
405
406
|
} catch (error) {
|
|
406
407
|
console.warn("[Dash] Identify request failed:", error);
|
|
407
408
|
} finally {
|
|
@@ -411,24 +412,30 @@ async function sendIdentify(identifyUrl) {
|
|
|
411
412
|
/**
|
|
412
413
|
* Wait for identify to complete, with a timeout
|
|
413
414
|
* Returns immediately if identify hasn't started or has completed
|
|
415
|
+
*
|
|
416
|
+
* When `timeoutMs` is omitted or nullish, {@link KV_TIMEOUT_MS} is used.
|
|
414
417
|
*/
|
|
415
|
-
async function waitForIdentify(timeoutMs
|
|
418
|
+
async function waitForIdentify(timeoutMs) {
|
|
416
419
|
if (!identifyCompletePromise) return;
|
|
417
|
-
|
|
420
|
+
const ms = timeoutMs ?? 1e3;
|
|
421
|
+
await Promise.race([identifyCompletePromise, new Promise((resolve) => setTimeout(resolve, ms))]);
|
|
418
422
|
}
|
|
419
423
|
//#endregion
|
|
420
424
|
//#region src/sentinel/client.ts
|
|
421
425
|
const DEFAULT_IDENTIFY_URL = "https://kv.better-auth.com";
|
|
422
426
|
const sentinelClient = (options) => {
|
|
423
427
|
const autoSolve = options?.autoSolveChallenge !== false;
|
|
424
|
-
const
|
|
428
|
+
const $kv = createKV({
|
|
429
|
+
kvUrl: options?.identifyUrl ?? env.BETTER_AUTH_KV_URL ?? DEFAULT_IDENTIFY_URL,
|
|
430
|
+
kvTimeout: options?.kvTimeout
|
|
431
|
+
});
|
|
425
432
|
if (typeof window !== "undefined") {
|
|
426
433
|
const scheduleIdentify = () => {
|
|
427
434
|
if ("requestIdleCallback" in window) window.requestIdleCallback(() => {
|
|
428
|
-
sendIdentify(
|
|
435
|
+
sendIdentify($kv);
|
|
429
436
|
});
|
|
430
437
|
else setTimeout(() => {
|
|
431
|
-
sendIdentify(
|
|
438
|
+
sendIdentify($kv);
|
|
432
439
|
}, 100);
|
|
433
440
|
};
|
|
434
441
|
if (document.readyState === "complete") scheduleIdentify();
|
|
@@ -441,7 +448,7 @@ const sentinelClient = (options) => {
|
|
|
441
448
|
name: "sentinel-fingerprint",
|
|
442
449
|
hooks: { async onRequest(context) {
|
|
443
450
|
if (typeof window === "undefined") return context;
|
|
444
|
-
await waitForIdentify(
|
|
451
|
+
await waitForIdentify(options?.kvTimeout);
|
|
445
452
|
const fingerprint = await getFingerprint();
|
|
446
453
|
if (!fingerprint) return context;
|
|
447
454
|
const headers = context.headers || new Headers();
|
|
@@ -483,16 +490,23 @@ const sentinelClient = (options) => {
|
|
|
483
490
|
retryHeaders.set("Content-Type", "application/json");
|
|
484
491
|
let body;
|
|
485
492
|
if (context.request && context.request.body) body = context.request._originalBody;
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
493
|
+
const req = context.request;
|
|
494
|
+
const powRetry = createPowRetryTimeout(req.timeout);
|
|
495
|
+
try {
|
|
496
|
+
const retryResponse = await fetch(originalUrl, {
|
|
497
|
+
method: req.method || "POST",
|
|
498
|
+
headers: retryHeaders,
|
|
499
|
+
body,
|
|
500
|
+
credentials: "include",
|
|
501
|
+
...powRetry.signal ? { signal: powRetry.signal } : {}
|
|
502
|
+
});
|
|
503
|
+
return {
|
|
504
|
+
...context,
|
|
505
|
+
response: retryResponse
|
|
506
|
+
};
|
|
507
|
+
} finally {
|
|
508
|
+
powRetry.cleanup?.();
|
|
509
|
+
}
|
|
496
510
|
} catch (error) {
|
|
497
511
|
console.error("[Sentinel] Failed to solve PoW challenge:", error);
|
|
498
512
|
options?.onChallengeFailed?.(error instanceof Error ? error : new Error(String(error)));
|
|
@@ -11,6 +11,10 @@ const INFRA_API_URL = env.BETTER_AUTH_API_URL || "https://dash.better-auth.com";
|
|
|
11
11
|
*/
|
|
12
12
|
const INFRA_KV_URL = env.BETTER_AUTH_KV_URL || "https://kv.better-auth.com";
|
|
13
13
|
/** Timeout for KV HTTP operations (ms) */
|
|
14
|
-
const KV_TIMEOUT_MS =
|
|
14
|
+
const KV_TIMEOUT_MS = 1e3;
|
|
15
|
+
/**
|
|
16
|
+
* Timeout for API calls HTTP calls (ms)
|
|
17
|
+
*/
|
|
18
|
+
const INFRA_API_TIMEOUT_MS = 3e3;
|
|
15
19
|
//#endregion
|
|
16
|
-
export {
|
|
20
|
+
export { KV_TIMEOUT_MS as i, INFRA_API_URL as n, INFRA_KV_URL as r, INFRA_API_TIMEOUT_MS as t };
|
|
@@ -40,6 +40,15 @@ interface DashGetAuditLogsInput {
|
|
|
40
40
|
user?: UserLike | null;
|
|
41
41
|
session?: SessionLike | null;
|
|
42
42
|
}
|
|
43
|
+
interface DashGetAllAuditLogsInput {
|
|
44
|
+
limit?: number;
|
|
45
|
+
offset?: number;
|
|
46
|
+
organizationId?: string;
|
|
47
|
+
userId?: string;
|
|
48
|
+
eventType?: string;
|
|
49
|
+
identifier?: string;
|
|
50
|
+
session?: SessionLike | null;
|
|
51
|
+
}
|
|
43
52
|
interface DashClientOptions {
|
|
44
53
|
resolveUserId?: (input: {
|
|
45
54
|
userId?: string;
|
|
@@ -62,11 +71,23 @@ declare const dashClient: (options?: DashClientOptions) => {
|
|
|
62
71
|
data: DashAuditLogsResponse;
|
|
63
72
|
error: null;
|
|
64
73
|
}>;
|
|
74
|
+
getAllAuditLogs: (input?: DashGetAllAuditLogsInput) => Promise<{
|
|
75
|
+
data: null;
|
|
76
|
+
error: {
|
|
77
|
+
message?: string | undefined;
|
|
78
|
+
status: number;
|
|
79
|
+
statusText: string;
|
|
80
|
+
};
|
|
81
|
+
} | {
|
|
82
|
+
data: DashAuditLogsResponse;
|
|
83
|
+
error: null;
|
|
84
|
+
}>;
|
|
65
85
|
};
|
|
66
86
|
};
|
|
67
87
|
pathMethods: {
|
|
68
88
|
"/events/audit-logs": "GET";
|
|
89
|
+
"/events/all-audit-logs": "GET";
|
|
69
90
|
};
|
|
70
91
|
};
|
|
71
92
|
//#endregion
|
|
72
|
-
export {
|
|
93
|
+
export { DashGetAuditLogsInput as a, DashGetAllAuditLogsInput as i, DashAuditLogsResponse as n, dashClient as o, DashClientOptions as r, DashAuditLog as t };
|
package/dist/email.d.mts
CHANGED
|
@@ -146,6 +146,11 @@ interface SendEmailResult {
|
|
|
146
146
|
interface EmailConfig {
|
|
147
147
|
apiKey?: string;
|
|
148
148
|
apiUrl?: string;
|
|
149
|
+
/**
|
|
150
|
+
* Timeout for Dash email API HTTP requests (milliseconds).
|
|
151
|
+
* @default 3000
|
|
152
|
+
*/
|
|
153
|
+
apiTimeout?: number;
|
|
149
154
|
}
|
|
150
155
|
/**
|
|
151
156
|
* Type-safe send email options
|
package/dist/email.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as INFRA_API_URL } from "./constants-CvriWQVc.mjs";
|
|
2
2
|
import { logger } from "better-auth";
|
|
3
3
|
import { env } from "@better-auth/core/env";
|
|
4
|
+
import { createFetch } from "@better-fetch/fetch";
|
|
4
5
|
//#region src/email.ts
|
|
5
6
|
/**
|
|
6
7
|
* Email sending module for @better-auth/infra
|
|
@@ -34,6 +35,11 @@ function createEmailSender(config) {
|
|
|
34
35
|
const apiUrl = baseUrl.endsWith("/api") ? baseUrl : `${baseUrl}/api`;
|
|
35
36
|
const apiKey = config?.apiKey || env.BETTER_AUTH_API_KEY || "";
|
|
36
37
|
if (!apiKey) logger.warn("[Dash] No API key provided for email sending. Set BETTER_AUTH_API_KEY environment variable or pass apiKey in config.");
|
|
38
|
+
const $api = createFetch({
|
|
39
|
+
baseURL: apiUrl,
|
|
40
|
+
headers: { Authorization: `Bearer ${apiKey}` },
|
|
41
|
+
timeout: config?.apiTimeout ?? 3e3
|
|
42
|
+
});
|
|
37
43
|
/**
|
|
38
44
|
* Send an email using a template from Better Auth Infra
|
|
39
45
|
*/
|
|
@@ -43,26 +49,26 @@ function createEmailSender(config) {
|
|
|
43
49
|
error: "API key not configured"
|
|
44
50
|
};
|
|
45
51
|
try {
|
|
46
|
-
const
|
|
52
|
+
const { data, error } = await $api("/v1/email/send", {
|
|
47
53
|
method: "POST",
|
|
48
|
-
|
|
49
|
-
"Content-Type": "application/json",
|
|
50
|
-
Authorization: `Bearer ${apiKey}`
|
|
51
|
-
},
|
|
52
|
-
body: JSON.stringify({
|
|
54
|
+
body: {
|
|
53
55
|
template: options.template,
|
|
54
56
|
to: options.to,
|
|
55
57
|
variables: options.variables || {},
|
|
56
58
|
subject: options.subject
|
|
57
|
-
}
|
|
59
|
+
}
|
|
58
60
|
});
|
|
59
|
-
if (
|
|
61
|
+
if (error) return {
|
|
60
62
|
success: false,
|
|
61
|
-
error:
|
|
63
|
+
error: error.message || `HTTP ${error.status}`
|
|
64
|
+
};
|
|
65
|
+
if (typeof data !== "object" || Array.isArray(data)) return {
|
|
66
|
+
success: false,
|
|
67
|
+
error: "Failed to parse JSON"
|
|
62
68
|
};
|
|
63
69
|
return {
|
|
64
70
|
success: true,
|
|
65
|
-
messageId:
|
|
71
|
+
messageId: data.messageId
|
|
66
72
|
};
|
|
67
73
|
} catch (error) {
|
|
68
74
|
logger.warn("[Dash] Email send failed:", error);
|
|
@@ -81,13 +87,9 @@ function createEmailSender(config) {
|
|
|
81
87
|
failures: Object.fromEntries(options.emails.map((e) => [e.to, [{ error: "API key not configured" }]]))
|
|
82
88
|
};
|
|
83
89
|
try {
|
|
84
|
-
const
|
|
90
|
+
const { data, error } = await $api("/v1/email/send-bulk", {
|
|
85
91
|
method: "POST",
|
|
86
|
-
|
|
87
|
-
"Content-Type": "application/json",
|
|
88
|
-
Authorization: `Bearer ${apiKey}`
|
|
89
|
-
},
|
|
90
|
-
body: JSON.stringify({
|
|
92
|
+
body: {
|
|
91
93
|
template: options.template,
|
|
92
94
|
emails: options.emails.map((e) => ({
|
|
93
95
|
to: e.to,
|
|
@@ -95,19 +97,19 @@ function createEmailSender(config) {
|
|
|
95
97
|
})),
|
|
96
98
|
subject: options.subject,
|
|
97
99
|
variables: options.variables || {}
|
|
98
|
-
}
|
|
100
|
+
}
|
|
99
101
|
});
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
if (error) return {
|
|
103
|
+
success: false,
|
|
104
|
+
failures: Object.fromEntries(options.emails.map((e) => [e.to, [{ error: error.message || `HTTP ${error.status}` }]]))
|
|
105
|
+
};
|
|
106
|
+
if (typeof data !== "object" || Array.isArray(data) || typeof data.success !== "boolean") return {
|
|
107
|
+
success: false,
|
|
108
|
+
failures: Object.fromEntries(options.emails.map((e) => [e.to, [{ error: "Failed to parse JSON" }]]))
|
|
109
|
+
};
|
|
108
110
|
return {
|
|
109
|
-
success:
|
|
110
|
-
failures:
|
|
111
|
+
success: data.success,
|
|
112
|
+
failures: data.failures
|
|
111
113
|
};
|
|
112
114
|
} catch (error) {
|
|
113
115
|
logger.warn("[Dash] Bulk email send failed:", error);
|
|
@@ -123,9 +125,9 @@ function createEmailSender(config) {
|
|
|
123
125
|
async function getTemplates() {
|
|
124
126
|
if (!apiKey) return [];
|
|
125
127
|
try {
|
|
126
|
-
const
|
|
127
|
-
if (!
|
|
128
|
-
return
|
|
128
|
+
const { data, error } = await $api("/v1/email/templates", { method: "GET" });
|
|
129
|
+
if (error || !data || !Array.isArray(data)) return [];
|
|
130
|
+
return data;
|
|
129
131
|
} catch (error) {
|
|
130
132
|
logger.warn("[Dash] Failed to fetch email templates:", error);
|
|
131
133
|
return [];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import "./constants-CvriWQVc.mjs";
|
|
2
|
+
import { createFetch } from "@better-fetch/fetch";
|
|
3
|
+
//#region src/fetch.ts
|
|
4
|
+
function createAPI(options, fetchOptions) {
|
|
5
|
+
return createFetch({
|
|
6
|
+
baseURL: options.apiUrl,
|
|
7
|
+
headers: {
|
|
8
|
+
"user-agent": "better-auth",
|
|
9
|
+
"x-api-key": options.apiKey
|
|
10
|
+
},
|
|
11
|
+
timeout: options.apiTimeout,
|
|
12
|
+
...fetchOptions
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function createKV(options, fetchOptions) {
|
|
16
|
+
const headers = { "user-agent": "better-auth" };
|
|
17
|
+
if (options.apiKey) headers["x-api-key"] = options.apiKey;
|
|
18
|
+
return createFetch({
|
|
19
|
+
baseURL: options.kvUrl,
|
|
20
|
+
headers,
|
|
21
|
+
timeout: options.kvTimeout ?? 1e3,
|
|
22
|
+
...fetchOptions
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { createKV as n, createAPI as t };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { EMAIL_TEMPLATES, EmailConfig, EmailTemplateId, EmailTemplateVariables, SendBulkEmailsOptions, SendBulkEmailsResult, SendEmailOptions, SendEmailResult, createEmailSender, sendBulkEmails, sendEmail } from "./email.mjs";
|
|
2
2
|
import * as _$better_auth0 from "better-auth";
|
|
3
3
|
import { Account, AuthContext, BetterAuthPlugin, GenericEndpointContext, Session, User } from "better-auth";
|
|
4
|
+
import * as _$_better_fetch_fetch0 from "@better-fetch/fetch";
|
|
5
|
+
import { createFetch } from "@better-fetch/fetch";
|
|
4
6
|
import * as _$jose from "jose";
|
|
5
7
|
import * as zod from "zod";
|
|
6
8
|
import z$1 from "zod";
|
|
@@ -448,6 +450,16 @@ interface InfraPluginConnectionOptions {
|
|
|
448
450
|
* @default process.env.BETTER_AUTH_API_KEY
|
|
449
451
|
*/
|
|
450
452
|
apiKey?: string;
|
|
453
|
+
/**
|
|
454
|
+
* Timeout for Dash API HTTP requests (milliseconds).
|
|
455
|
+
* @default 3000
|
|
456
|
+
*/
|
|
457
|
+
apiTimeout?: number;
|
|
458
|
+
/**
|
|
459
|
+
* Timeout for KV HTTP requests (milliseconds).
|
|
460
|
+
* @default 1000
|
|
461
|
+
*/
|
|
462
|
+
kvTimeout?: number;
|
|
451
463
|
}
|
|
452
464
|
/**
|
|
453
465
|
* Configuration options for the dash plugin.
|
|
@@ -483,21 +495,31 @@ interface SentinelOptions extends InfraPluginConnectionOptions {
|
|
|
483
495
|
}
|
|
484
496
|
/**
|
|
485
497
|
* Internal connection options with required fields resolved.
|
|
486
|
-
* @internal
|
|
487
498
|
*/
|
|
488
499
|
interface InfraPluginConnectionOptionsInternal extends InfraPluginConnectionOptions {
|
|
489
500
|
apiUrl: string;
|
|
490
501
|
kvUrl: string;
|
|
491
502
|
apiKey: string;
|
|
503
|
+
apiTimeout: number;
|
|
504
|
+
kvTimeout: number;
|
|
492
505
|
}
|
|
493
506
|
/**
|
|
494
507
|
* Internal options with required fields resolved
|
|
495
|
-
* @internal
|
|
496
508
|
*/
|
|
497
|
-
interface DashOptionsInternal extends Omit<DashOptions, keyof InfraPluginConnectionOptions>, InfraPluginConnectionOptionsInternal {
|
|
509
|
+
interface DashOptionsInternal extends Omit<DashOptions, keyof InfraPluginConnectionOptions>, InfraPluginConnectionOptionsInternal {
|
|
510
|
+
/**
|
|
511
|
+
* Shared Dash HTTP client from {@link createAPI}; injected by {@link dash} when wiring endpoints.
|
|
512
|
+
*
|
|
513
|
+
* @internal
|
|
514
|
+
*/
|
|
515
|
+
$api: ReturnType<typeof _$_better_fetch_fetch0.createFetch>;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Resolved dash options from {@link resolveDashOptions} / plugin-stored config; excludes injected `$api`.
|
|
519
|
+
*/
|
|
520
|
+
type DashOptionsResolved = Omit<DashOptionsInternal, "$api">;
|
|
498
521
|
/**
|
|
499
522
|
* Internal sentinel options with required fields resolved.
|
|
500
|
-
* @internal
|
|
501
523
|
*/
|
|
502
524
|
interface SentinelOptionsInternal extends Omit<SentinelOptions, keyof InfraPluginConnectionOptions>, InfraPluginConnectionOptionsInternal {}
|
|
503
525
|
/**
|
|
@@ -513,7 +535,7 @@ interface LocationData {
|
|
|
513
535
|
type LocationDataContext = LocationData;
|
|
514
536
|
type InfraEndpointContext = (GenericEndpointContext & {
|
|
515
537
|
context: {
|
|
516
|
-
identification
|
|
538
|
+
identification?: Identification | null | undefined;
|
|
517
539
|
visitorId: string | null;
|
|
518
540
|
requestId: string | null;
|
|
519
541
|
location: LocationData | undefined;
|
|
@@ -608,6 +630,11 @@ interface SendSMSResult {
|
|
|
608
630
|
interface SMSConfig {
|
|
609
631
|
apiKey?: string;
|
|
610
632
|
apiUrl?: string;
|
|
633
|
+
/**
|
|
634
|
+
* Timeout for Dash SMS API HTTP requests (milliseconds).
|
|
635
|
+
* @default 3000
|
|
636
|
+
*/
|
|
637
|
+
apiTimeout?: number;
|
|
611
638
|
}
|
|
612
639
|
/**
|
|
613
640
|
* Options for sending SMS
|
|
@@ -726,7 +753,7 @@ interface DashIdRow {
|
|
|
726
753
|
id: string;
|
|
727
754
|
}
|
|
728
755
|
//#endregion
|
|
729
|
-
//#region ../../node_modules/.bun/@better-auth+scim@1.6.
|
|
756
|
+
//#region ../../node_modules/.bun/@better-auth+scim@1.6.9+b412fc3af1df8c24/node_modules/@better-auth/scim/dist/index.d.mts
|
|
730
757
|
//#region src/types.d.ts
|
|
731
758
|
interface SCIMProvider {
|
|
732
759
|
id: string;
|
|
@@ -4596,7 +4623,7 @@ declare function normalizeEmail(email: string, context: AuthContext): string;
|
|
|
4596
4623
|
//#region src/index.d.ts
|
|
4597
4624
|
declare const dash: <O extends DashOptions>(options?: O) => {
|
|
4598
4625
|
id: "dash";
|
|
4599
|
-
options:
|
|
4626
|
+
options: DashOptionsResolved;
|
|
4600
4627
|
version: string;
|
|
4601
4628
|
init(ctx: _$better_auth0.AuthContext): {
|
|
4602
4629
|
options: {
|
|
@@ -4649,7 +4676,7 @@ declare const dash: <O extends DashOptions>(options?: O) => {
|
|
|
4649
4676
|
userAgent?: string | null | undefined;
|
|
4650
4677
|
} & Record<string, unknown>, _ctx: _$better_auth0.GenericEndpointContext | null): Promise<{
|
|
4651
4678
|
data: {
|
|
4652
|
-
loginMethod: string | null
|
|
4679
|
+
loginMethod: string | null;
|
|
4653
4680
|
};
|
|
4654
4681
|
} | undefined>;
|
|
4655
4682
|
after(session: {
|
|
@@ -5637,6 +5664,40 @@ declare const dash: <O extends DashOptions>(options?: O) => {
|
|
|
5637
5664
|
eventType: zod.ZodOptional<zod.ZodString>;
|
|
5638
5665
|
}, zod_v4_core0.$strip>>;
|
|
5639
5666
|
}, UserEventsResponse>;
|
|
5667
|
+
getAllAuditLogs: _$better_call0.StrictEndpoint<"/events/all-audit-logs", {
|
|
5668
|
+
method: "GET";
|
|
5669
|
+
use: ((inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
5670
|
+
session: {
|
|
5671
|
+
session: Record<string, any> & {
|
|
5672
|
+
id: string;
|
|
5673
|
+
createdAt: Date;
|
|
5674
|
+
updatedAt: Date;
|
|
5675
|
+
userId: string;
|
|
5676
|
+
expiresAt: Date;
|
|
5677
|
+
token: string;
|
|
5678
|
+
ipAddress?: string | null | undefined;
|
|
5679
|
+
userAgent?: string | null | undefined;
|
|
5680
|
+
};
|
|
5681
|
+
user: Record<string, any> & {
|
|
5682
|
+
id: string;
|
|
5683
|
+
createdAt: Date;
|
|
5684
|
+
updatedAt: Date;
|
|
5685
|
+
email: string;
|
|
5686
|
+
emailVerified: boolean;
|
|
5687
|
+
name: string;
|
|
5688
|
+
image?: string | null | undefined;
|
|
5689
|
+
};
|
|
5690
|
+
};
|
|
5691
|
+
}>)[];
|
|
5692
|
+
query: zod.ZodOptional<zod.ZodObject<{
|
|
5693
|
+
limit: zod.ZodOptional<zod.ZodUnion<[zod.ZodNumber, zod.ZodPipe<zod.ZodString, zod.ZodTransform<number, string>>]>>;
|
|
5694
|
+
offset: zod.ZodOptional<zod.ZodUnion<[zod.ZodNumber, zod.ZodPipe<zod.ZodString, zod.ZodTransform<number, string>>]>>;
|
|
5695
|
+
userId: zod.ZodOptional<zod.ZodString>;
|
|
5696
|
+
organizationId: zod.ZodOptional<zod.ZodString>;
|
|
5697
|
+
eventType: zod.ZodOptional<zod.ZodString>;
|
|
5698
|
+
identifier: zod.ZodOptional<zod.ZodString>;
|
|
5699
|
+
}, zod_v4_core0.$strip>>;
|
|
5700
|
+
}, UserEventsResponse>;
|
|
5640
5701
|
getEventTypes: _$better_call0.StrictEndpoint<"/events/types", {
|
|
5641
5702
|
method: "GET";
|
|
5642
5703
|
use: ((inputContext: _$better_call0.MiddlewareInputContext<_$better_call0.MiddlewareOptions>) => Promise<{
|
|
@@ -5872,4 +5933,4 @@ declare const dash: <O extends DashOptions>(options?: O) => {
|
|
|
5872
5933
|
} : {};
|
|
5873
5934
|
};
|
|
5874
5935
|
//#endregion
|
|
5875
|
-
export { type APIError, CHALLENGE_TTL, type CompromisedPasswordResult, type CredentialStuffingResult, DBField, DEFAULT_DIFFICULTY, DashAddTeamMemberResponse, DashBanManyResponse, DashCheckUserByEmailResponse, DashCheckUserExistsResponse, DashCompleteInvitationResponse, DashConfigResponse, DashCreateOrganizationBody, DashCreateOrganizationResponse, DashCreateTeamResponse, DashCreateUserResponse, DashDeleteManyUsersResponse, DashDirectoryCreateResponse, DashDirectoryDeleteResponse, DashDirectoryItem, DashDirectoryRegenerateTokenResponse, DashExecuteAdapterCountResponse, DashExecuteAdapterFindManyResponse, DashExecuteAdapterFindOneResponse, DashExecuteAdapterMutationResponse, DashExecuteAdapterResponse, DashExportOrganizationsResponse, DashIdRow, DashInviteMemberResponse, DashMaybeSuccessResponse, type DashOptions, DashOptionsInternal, DashOrganizationAddMemberResponse, DashOrganizationDeleteManyResponse, DashOrganizationDetailResponse, DashOrganizationInvitationItem, DashOrganizationInvitationListResponse, DashOrganizationInvitationStatusItem, DashOrganizationListResponse, DashOrganizationMember, DashOrganizationMemberListItem, DashOrganizationMemberListResponse, DashOrganizationMemberUser, DashOrganizationOptionsResponse, DashOrganizationTeamItem, DashOrganizationTeamListResponse, DashOrganizationUpdateMemberRoleResponse, DashOrganizationUpdateResponse, DashSendManyVerificationEmailsResponse, DashSessionRevokeManyResponse, DashSsoCreateProviderResponse, DashSsoDeleteResponse, DashSsoMarkDomainVerifiedResponse, DashSsoProviderItem, DashSsoProviderSummary, DashSsoUpdateProviderResponse, DashSsoVerificationTokenResponse, DashSsoVerifyDomainResponse, DashSuccessResponse, DashTeam, DashTeamMember, DashTeamMemberListResponse, DashTwoFactorBackupCodesResponse, DashTwoFactorEnableResponse, DashTwoFactorTotpViewResponse, DashUpdateTeamResponse, DashUpdateUserResponse, DashUserDetailsResponse, DashUserGraphDataResponse, DashUserListResponse, DashUserOrganizationsResponse, DashUserRetentionDataResponse, DashUserStatsActivePeriod, DashUserStatsResponse, DashUserStatsSignUpPeriod, DashValidateResponse, DirectorySyncConnection, EMAIL_TEMPLATES, type EmailConfig, type EmailTemplateId, type EmailTemplateVariables, type Endpoint, type EndpointOptions, type EventLocation, type EventTypesResponse, type ImpossibleTravelResult, InfraEndpointContext, InfraPluginConnectionOptions, InfraPluginConnectionOptionsInternal, LocationData, LocationDataContext, type PoWChallenge, type PoWSolution, SCIMPlugin, type SMSConfig, type SMSTemplateId, type SMSTemplateVariables, SMS_TEMPLATES, type SecurityEvent, type SecurityEventType, type SecurityOptions, type SecurityVerdict, type SendBulkEmailsOptions, type SendBulkEmailsResult, type SendEmailOptions, type SendEmailResult, type SendSMSOptions, type SendSMSResult, type SentinelOptions, SentinelOptionsInternal, type StaleUserResult, type ThresholdConfig, USER_EVENT_TYPES, type UserEvent, type UserEventType, type UserEventsResponse, createEmailSender, createSMSSender, dash, decodePoWChallenge, encodePoWSolution, normalizeEmail, sendBulkEmails, sendEmail, sendSMS, sentinel, solvePoWChallenge, verifyPoWSolution };
|
|
5936
|
+
export { type APIError, CHALLENGE_TTL, type CompromisedPasswordResult, type CredentialStuffingResult, DBField, DEFAULT_DIFFICULTY, DashAddTeamMemberResponse, DashBanManyResponse, DashCheckUserByEmailResponse, DashCheckUserExistsResponse, DashCompleteInvitationResponse, DashConfigResponse, DashCreateOrganizationBody, DashCreateOrganizationResponse, DashCreateTeamResponse, DashCreateUserResponse, DashDeleteManyUsersResponse, DashDirectoryCreateResponse, DashDirectoryDeleteResponse, DashDirectoryItem, DashDirectoryRegenerateTokenResponse, DashExecuteAdapterCountResponse, DashExecuteAdapterFindManyResponse, DashExecuteAdapterFindOneResponse, DashExecuteAdapterMutationResponse, DashExecuteAdapterResponse, DashExportOrganizationsResponse, DashIdRow, DashInviteMemberResponse, DashMaybeSuccessResponse, type DashOptions, DashOptionsInternal, DashOptionsResolved, DashOrganizationAddMemberResponse, DashOrganizationDeleteManyResponse, DashOrganizationDetailResponse, DashOrganizationInvitationItem, DashOrganizationInvitationListResponse, DashOrganizationInvitationStatusItem, DashOrganizationListResponse, DashOrganizationMember, DashOrganizationMemberListItem, DashOrganizationMemberListResponse, DashOrganizationMemberUser, DashOrganizationOptionsResponse, DashOrganizationTeamItem, DashOrganizationTeamListResponse, DashOrganizationUpdateMemberRoleResponse, DashOrganizationUpdateResponse, DashSendManyVerificationEmailsResponse, DashSessionRevokeManyResponse, DashSsoCreateProviderResponse, DashSsoDeleteResponse, DashSsoMarkDomainVerifiedResponse, DashSsoProviderItem, DashSsoProviderSummary, DashSsoUpdateProviderResponse, DashSsoVerificationTokenResponse, DashSsoVerifyDomainResponse, DashSuccessResponse, DashTeam, DashTeamMember, DashTeamMemberListResponse, DashTwoFactorBackupCodesResponse, DashTwoFactorEnableResponse, DashTwoFactorTotpViewResponse, DashUpdateTeamResponse, DashUpdateUserResponse, DashUserDetailsResponse, DashUserGraphDataResponse, DashUserListResponse, DashUserOrganizationsResponse, DashUserRetentionDataResponse, DashUserStatsActivePeriod, DashUserStatsResponse, DashUserStatsSignUpPeriod, DashValidateResponse, DirectorySyncConnection, EMAIL_TEMPLATES, type EmailConfig, type EmailTemplateId, type EmailTemplateVariables, type Endpoint, type EndpointOptions, type EventLocation, type EventTypesResponse, type ImpossibleTravelResult, InfraEndpointContext, InfraPluginConnectionOptions, InfraPluginConnectionOptionsInternal, LocationData, LocationDataContext, type PoWChallenge, type PoWSolution, SCIMPlugin, type SMSConfig, type SMSTemplateId, type SMSTemplateVariables, SMS_TEMPLATES, type SecurityEvent, type SecurityEventType, type SecurityOptions, type SecurityVerdict, type SendBulkEmailsOptions, type SendBulkEmailsResult, type SendEmailOptions, type SendEmailResult, type SendSMSOptions, type SendSMSResult, type SentinelOptions, SentinelOptionsInternal, type StaleUserResult, type ThresholdConfig, USER_EVENT_TYPES, type UserEvent, type UserEventType, type UserEventsResponse, createEmailSender, createSMSSender, dash, decodePoWChallenge, encodePoWSolution, normalizeEmail, sendBulkEmails, sendEmail, sendSMS, sentinel, solvePoWChallenge, verifyPoWSolution };
|