@better-auth/telemetry 1.4.0-beta.9 → 1.4.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/.turbo/turbo-build.log +6 -10
- package/dist/{index.d.cts → index.d.mts} +13 -101
- package/dist/{index.js → index.mjs} +281 -280
- package/package.json +11 -15
- package/src/detectors/detect-auth-config.ts +6 -3
- package/src/detectors/detect-database.ts +1 -1
- package/src/index.ts +8 -9
- package/src/project-id.ts +1 -1
- package/src/types.ts +5 -5
- package/src/utils/hash.ts +1 -1
- package/src/utils/id.ts +1 -1
- package/src/utils/package-json.ts +1 -0
- package/tsconfig.json +6 -7
- package/tsdown.config.ts +2 -2
- package/dist/index.cjs +0 -541
- package/dist/index.d.ts +0 -311
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
> @better-auth/telemetry@1.4.0
|
|
2
|
+
> @better-auth/telemetry@1.4.0 build /home/runner/work/better-auth/better-auth/packages/telemetry
|
|
3
3
|
> tsdown
|
|
4
4
|
|
|
5
|
-
[34mℹ[39m tsdown [2mv0.
|
|
5
|
+
[34mℹ[39m tsdown [2mv0.16.5[22m powered by rolldown [2mv1.0.0-beta.50[22m
|
|
6
6
|
[34mℹ[39m Using tsdown config: [4m/home/runner/work/better-auth/better-auth/packages/telemetry/tsdown.config.ts[24m
|
|
7
7
|
[34mℹ[39m entry: [34msrc/index.ts[39m
|
|
8
8
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
9
9
|
[34mℹ[39m Build start
|
|
10
|
-
[34mℹ[39m [
|
|
11
|
-
[34mℹ[39m [
|
|
12
|
-
[34mℹ[39m
|
|
13
|
-
[
|
|
14
|
-
[34mℹ[39m [34m[ESM][39m 2 files, total: 27.20 kB
|
|
15
|
-
[34mℹ[39m [33m[CJS][39m [2mdist/[22m[32m[1mindex.d.cts[22m[39m [2m9.34 kB[22m [2m│ gzip: 2.52 kB[22m
|
|
16
|
-
[34mℹ[39m [33m[CJS][39m 1 files, total: 9.34 kB
|
|
17
|
-
[32m✔[39m Build complete in [32m2311ms[39m
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1mindex.mjs[22m [2m17.97 kB[22m [2m│ gzip: 4.78 kB[22m
|
|
11
|
+
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.mts[22m[39m [2m 7.18 kB[22m [2m│ gzip: 1.83 kB[22m
|
|
12
|
+
[34mℹ[39m 2 files, total: 25.15 kB
|
|
13
|
+
[32m✔[39m Build complete in [32m2424ms[39m
|
|
@@ -1,112 +1,23 @@
|
|
|
1
1
|
import * as _better_auth_core0 from "@better-auth/core";
|
|
2
2
|
import { BetterAuthOptions } from "@better-auth/core";
|
|
3
|
-
import
|
|
3
|
+
import * as _better_auth_core_db0 from "@better-auth/core/db";
|
|
4
4
|
|
|
5
5
|
//#region src/types.d.ts
|
|
6
6
|
|
|
7
7
|
interface TelemetryEvent {
|
|
8
8
|
type: string;
|
|
9
|
-
anonymousId?: string;
|
|
9
|
+
anonymousId?: string | undefined;
|
|
10
10
|
payload: Record<string, any>;
|
|
11
11
|
}
|
|
12
12
|
interface TelemetryContext {
|
|
13
|
-
customTrack?: (event: TelemetryEvent) => Promise<void
|
|
14
|
-
database?: string;
|
|
15
|
-
adapter?: string;
|
|
16
|
-
skipTestCheck?: boolean;
|
|
13
|
+
customTrack?: ((event: TelemetryEvent) => Promise<void>) | undefined;
|
|
14
|
+
database?: string | undefined;
|
|
15
|
+
adapter?: string | undefined;
|
|
16
|
+
skipTestCheck?: boolean | undefined;
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
|
-
//#region ../core/dist/shared/core.MjcDoj7R.d.ts
|
|
20
|
-
type LiteralString = "" | (string & Record<never, never>);
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region ../core/dist/shared/core.CPuIItYE.d.ts
|
|
23
|
-
type DBFieldType = "string" | "number" | "boolean" | "date" | "json" | `${"string" | "number"}[]` | Array<LiteralString>;
|
|
24
|
-
type DBPrimitive = string | number | boolean | Date | null | undefined | string[] | number[];
|
|
25
|
-
type DBFieldAttributeConfig = {
|
|
26
|
-
/**
|
|
27
|
-
* If the field should be required on a new record.
|
|
28
|
-
* @default true
|
|
29
|
-
*/
|
|
30
|
-
required?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* If the value should be returned on a response body.
|
|
33
|
-
* @default true
|
|
34
|
-
*/
|
|
35
|
-
returned?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* If a value should be provided when creating a new record.
|
|
38
|
-
* @default true
|
|
39
|
-
*/
|
|
40
|
-
input?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Default value for the field
|
|
43
|
-
*
|
|
44
|
-
* Note: This will not create a default value on the database level. It will only
|
|
45
|
-
* be used when creating a new record.
|
|
46
|
-
*/
|
|
47
|
-
defaultValue?: DBPrimitive | (() => DBPrimitive);
|
|
48
|
-
/**
|
|
49
|
-
* Update value for the field
|
|
50
|
-
*
|
|
51
|
-
* Note: This will create an onUpdate trigger on the database level for supported adapters.
|
|
52
|
-
* It will be called when updating a record.
|
|
53
|
-
*/
|
|
54
|
-
onUpdate?: () => DBPrimitive;
|
|
55
|
-
/**
|
|
56
|
-
* transform the value before storing it.
|
|
57
|
-
*/
|
|
58
|
-
transform?: {
|
|
59
|
-
input?: (value: DBPrimitive) => DBPrimitive | Promise<DBPrimitive>;
|
|
60
|
-
output?: (value: DBPrimitive) => DBPrimitive | Promise<DBPrimitive>;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Reference to another model.
|
|
64
|
-
*/
|
|
65
|
-
references?: {
|
|
66
|
-
/**
|
|
67
|
-
* The model to reference.
|
|
68
|
-
*/
|
|
69
|
-
model: string;
|
|
70
|
-
/**
|
|
71
|
-
* The field on the referenced model.
|
|
72
|
-
*/
|
|
73
|
-
field: string;
|
|
74
|
-
/**
|
|
75
|
-
* The action to perform when the reference is deleted.
|
|
76
|
-
* @default "cascade"
|
|
77
|
-
*/
|
|
78
|
-
onDelete?: "no action" | "restrict" | "cascade" | "set null" | "set default";
|
|
79
|
-
};
|
|
80
|
-
unique?: boolean;
|
|
81
|
-
/**
|
|
82
|
-
* If the field should be a bigint on the database instead of integer.
|
|
83
|
-
*/
|
|
84
|
-
bigint?: boolean;
|
|
85
|
-
/**
|
|
86
|
-
* A zod schema to validate the value.
|
|
87
|
-
*/
|
|
88
|
-
validator?: {
|
|
89
|
-
input?: ZodType;
|
|
90
|
-
output?: ZodType;
|
|
91
|
-
};
|
|
92
|
-
/**
|
|
93
|
-
* The name of the field on the database.
|
|
94
|
-
*/
|
|
95
|
-
fieldName?: string;
|
|
96
|
-
/**
|
|
97
|
-
* If the field should be sortable.
|
|
98
|
-
*
|
|
99
|
-
* applicable only for `text` type.
|
|
100
|
-
* It's useful to mark fields varchar instead of text.
|
|
101
|
-
*/
|
|
102
|
-
sortable?: boolean;
|
|
103
|
-
};
|
|
104
|
-
type DBFieldAttribute<T extends DBFieldType = DBFieldType> = {
|
|
105
|
-
type: T;
|
|
106
|
-
} & DBFieldAttributeConfig;
|
|
107
|
-
//#endregion
|
|
108
19
|
//#region src/detectors/detect-auth-config.d.ts
|
|
109
|
-
declare function getTelemetryAuthConfig(options: BetterAuthOptions, context?: TelemetryContext): {
|
|
20
|
+
declare function getTelemetryAuthConfig(options: BetterAuthOptions, context?: TelemetryContext | undefined): {
|
|
110
21
|
database: string | undefined;
|
|
111
22
|
adapter: string | undefined;
|
|
112
23
|
emailVerification: {
|
|
@@ -166,7 +77,7 @@ declare function getTelemetryAuthConfig(options: BetterAuthOptions, context?: Te
|
|
|
166
77
|
modelName: string | undefined;
|
|
167
78
|
fields: Partial<Record<"createdAt" | "updatedAt" | "email" | "emailVerified" | "name" | "image", string>> | undefined;
|
|
168
79
|
additionalFields: {
|
|
169
|
-
[key: string]: DBFieldAttribute;
|
|
80
|
+
[key: string]: _better_auth_core_db0.DBFieldAttribute;
|
|
170
81
|
} | undefined;
|
|
171
82
|
changeEmail: {
|
|
172
83
|
enabled: boolean | undefined;
|
|
@@ -181,11 +92,12 @@ declare function getTelemetryAuthConfig(options: BetterAuthOptions, context?: Te
|
|
|
181
92
|
session: {
|
|
182
93
|
modelName: string | undefined;
|
|
183
94
|
additionalFields: {
|
|
184
|
-
[key: string]: DBFieldAttribute;
|
|
95
|
+
[key: string]: _better_auth_core_db0.DBFieldAttribute;
|
|
185
96
|
} | undefined;
|
|
186
97
|
cookieCache: {
|
|
187
98
|
enabled: boolean | undefined;
|
|
188
99
|
maxAge: number | undefined;
|
|
100
|
+
strategy: "compact" | "jwt" | "jwe" | undefined;
|
|
189
101
|
};
|
|
190
102
|
disableSessionRefresh: boolean | undefined;
|
|
191
103
|
expiresIn: number | undefined;
|
|
@@ -202,7 +114,7 @@ declare function getTelemetryAuthConfig(options: BetterAuthOptions, context?: Te
|
|
|
202
114
|
updateAccountOnSignIn: boolean | undefined;
|
|
203
115
|
accountLinking: {
|
|
204
116
|
enabled: boolean | undefined;
|
|
205
|
-
trustedProviders: _better_auth_core0.LiteralUnion<"github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal" | "email-password", string>[] | undefined;
|
|
117
|
+
trustedProviders: _better_auth_core0.LiteralUnion<"github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "email-password", string>[] | undefined;
|
|
206
118
|
updateUserInfoOnLink: boolean | undefined;
|
|
207
119
|
allowUnlinkingAll: boolean | undefined;
|
|
208
120
|
};
|
|
@@ -222,7 +134,7 @@ declare function getTelemetryAuthConfig(options: BetterAuthOptions, context?: Te
|
|
|
222
134
|
};
|
|
223
135
|
database: {
|
|
224
136
|
useNumberId: boolean;
|
|
225
|
-
generateId: false | _better_auth_core0.GenerateIdFn | undefined;
|
|
137
|
+
generateId: false | _better_auth_core0.GenerateIdFn | "serial" | "uuid" | undefined;
|
|
226
138
|
defaultFindManyLimit: number | undefined;
|
|
227
139
|
};
|
|
228
140
|
useSecureCookies: boolean | undefined;
|
|
@@ -304,7 +216,7 @@ declare function getTelemetryAuthConfig(options: BetterAuthOptions, context?: Te
|
|
|
304
216
|
};
|
|
305
217
|
//#endregion
|
|
306
218
|
//#region src/index.d.ts
|
|
307
|
-
declare function createTelemetry(options: BetterAuthOptions, context?: TelemetryContext): Promise<{
|
|
219
|
+
declare function createTelemetry(options: BetterAuthOptions, context?: TelemetryContext | undefined): Promise<{
|
|
308
220
|
publish: (event: TelemetryEvent) => Promise<void>;
|
|
309
221
|
}>;
|
|
310
222
|
//#endregion
|