@hammadj/better-auth-telemetry 1.5.0-beta.9

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.
@@ -0,0 +1,52 @@
1
+
2
+ > @hammadj/better-auth-telemetry@1.5.0-beta.9 build /Users/hammadjutt/Dev/better-auth-fork/packages/telemetry
3
+ > tsdown
4
+
5
+ β„Ή tsdown v0.20.1 powered by rolldown v1.0.0-rc.1
6
+ β„Ή config file: /Users/hammadjutt/Dev/better-auth-fork/packages/telemetry/tsdown.config.ts
7
+ β„Ή entry: src/index.ts
8
+ β„Ή tsconfig: tsconfig.json
9
+ β„Ή Build start
10
+ β„Ή Cleaning 2 files
11
+ β„Ή dist/index.mjs 18.13 kB β”‚ gzip: 4.82 kB
12
+ β„Ή dist/index.mjs.map 34.54 kB β”‚ gzip: 8.82 kB
13
+ β„Ή dist/index.d.mts  4.91 kB β”‚ gzip: 1.30 kB
14
+ β„Ή 3 files, total: 57.57 kB
15
+ src/index.ts (2:54) [UNRESOLVED_IMPORT] Warning: Could not resolve '@better-auth/core/env' in src/index.ts
16
+ β•­─[ src/index.ts:2:55 ]
17
+ β”‚
18
+ 2 β”‚ import { ENV, getBooleanEnvVar, isTest, logger } from "@better-auth/core/env";
19
+  β”‚ ───────────┬───────────
20
+  β”‚ ╰───────────── Module not found, treating it as an external dependency
21
+ ───╯
22
+
23
+ src/detectors/detect-project-info.ts (2:20) [UNRESOLVED_IMPORT] Warning: Could not resolve '@better-auth/core/env' in src/detectors/detect-project-info.ts
24
+ β•­─[ src/detectors/detect-project-info.ts:2:21 ]
25
+ β”‚
26
+ 2 β”‚ import { env } from "@better-auth/core/env";
27
+  β”‚ ───────────┬───────────
28
+  β”‚ ╰───────────── Module not found, treating it as an external dependency
29
+ ───╯
30
+
31
+ src/detectors/detect-runtime.ts (1:34) [UNRESOLVED_IMPORT] Warning: Could not resolve '@better-auth/core/env' in src/detectors/detect-runtime.ts
32
+ β•­─[ src/detectors/detect-runtime.ts:1:35 ]
33
+ β”‚
34
+ 1 β”‚ import { getEnvVar, isTest } from "@better-auth/core/env";
35
+  β”‚ ───────────┬───────────
36
+  β”‚ ╰───────────── Module not found, treating it as an external dependency
37
+ ───╯
38
+
39
+ src/detectors/detect-system-info.ts (1:20) [UNRESOLVED_IMPORT] Warning: Could not resolve '@better-auth/core/env' in src/detectors/detect-system-info.ts
40
+ β•­─[ src/detectors/detect-system-info.ts:1:21 ]
41
+ β”‚
42
+ 1 β”‚ import { env } from "@better-auth/core/env";
43
+  β”‚ ───────────┬───────────
44
+  β”‚ ╰───────────── Module not found, treating it as an external dependency
45
+ ───╯
46
+
47
+ [PLUGIN_TIMINGS] Warning: Your build spent significant time in plugins. Here is a breakdown:
48
+ - tsdown:external (66%)
49
+ - rolldown-plugin-dts:generate (34%)
50
+ See https://rolldown.rs/options/checks#plugintimings for more details.
51
+
52
+ βœ” Build complete in 5527ms
package/LICENSE.md ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+ Copyright (c) 2024 - present, Bereket Engida
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ this software and associated documentation files (the β€œSoftware”), to deal in
6
+ the Software without restriction, including without limitation the rights to
7
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8
+ the Software, and to permit persons to whom the Software is furnished to do so,
9
+ subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED β€œAS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18
+ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20
+ DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,217 @@
1
+ import { BetterAuthOptions } from "@better-auth/core";
2
+
3
+ //#region src/types.d.ts
4
+ interface TelemetryEvent {
5
+ type: string;
6
+ anonymousId?: string | undefined;
7
+ payload: Record<string, any>;
8
+ }
9
+ interface TelemetryContext {
10
+ customTrack?: ((event: TelemetryEvent) => Promise<void>) | undefined;
11
+ database?: string | undefined;
12
+ adapter?: string | undefined;
13
+ skipTestCheck?: boolean | undefined;
14
+ }
15
+ //#endregion
16
+ //#region src/detectors/detect-auth-config.d.ts
17
+ declare function getTelemetryAuthConfig(options: BetterAuthOptions, context?: TelemetryContext | undefined): {
18
+ database: string | undefined;
19
+ adapter: string | undefined;
20
+ emailVerification: {
21
+ sendVerificationEmail: boolean;
22
+ sendOnSignUp: boolean;
23
+ sendOnSignIn: boolean;
24
+ autoSignInAfterVerification: boolean;
25
+ expiresIn: any;
26
+ onEmailVerification: boolean;
27
+ afterEmailVerification: boolean;
28
+ };
29
+ emailAndPassword: {
30
+ enabled: boolean;
31
+ disableSignUp: boolean;
32
+ requireEmailVerification: boolean;
33
+ maxPasswordLength: any;
34
+ minPasswordLength: any;
35
+ sendResetPassword: boolean;
36
+ resetPasswordTokenExpiresIn: any;
37
+ onPasswordReset: boolean;
38
+ password: {
39
+ hash: boolean;
40
+ verify: boolean;
41
+ };
42
+ autoSignIn: boolean;
43
+ revokeSessionsOnPasswordReset: boolean;
44
+ };
45
+ socialProviders: ({
46
+ id?: undefined;
47
+ mapProfileToUser?: undefined;
48
+ disableDefaultScope?: undefined;
49
+ disableIdTokenSignIn?: undefined;
50
+ disableImplicitSignUp?: undefined;
51
+ disableSignUp?: undefined;
52
+ getUserInfo?: undefined;
53
+ overrideUserInfoOnSignIn?: undefined;
54
+ prompt?: undefined;
55
+ verifyIdToken?: undefined;
56
+ scope?: undefined;
57
+ refreshAccessToken?: undefined;
58
+ } | {
59
+ id: string;
60
+ mapProfileToUser: boolean;
61
+ disableDefaultScope: boolean;
62
+ disableIdTokenSignIn: boolean;
63
+ disableImplicitSignUp: any;
64
+ disableSignUp: any;
65
+ getUserInfo: boolean;
66
+ overrideUserInfoOnSignIn: boolean;
67
+ prompt: any;
68
+ verifyIdToken: boolean;
69
+ scope: any;
70
+ refreshAccessToken: boolean;
71
+ })[];
72
+ plugins: any;
73
+ user: {
74
+ modelName: any;
75
+ fields: any;
76
+ additionalFields: any;
77
+ changeEmail: {
78
+ enabled: any;
79
+ sendChangeEmailVerification: boolean;
80
+ };
81
+ };
82
+ verification: {
83
+ modelName: any;
84
+ disableCleanup: any;
85
+ fields: any;
86
+ };
87
+ session: {
88
+ modelName: any;
89
+ additionalFields: any;
90
+ cookieCache: {
91
+ enabled: any;
92
+ maxAge: any;
93
+ strategy: any;
94
+ };
95
+ disableSessionRefresh: any;
96
+ expiresIn: any;
97
+ fields: any;
98
+ freshAge: any;
99
+ preserveSessionInDatabase: any;
100
+ storeSessionInDatabase: any;
101
+ updateAge: any;
102
+ };
103
+ account: {
104
+ modelName: any;
105
+ fields: any;
106
+ encryptOAuthTokens: any;
107
+ updateAccountOnSignIn: any;
108
+ accountLinking: {
109
+ enabled: any;
110
+ trustedProviders: any;
111
+ updateUserInfoOnLink: any;
112
+ allowUnlinkingAll: any;
113
+ };
114
+ };
115
+ hooks: {
116
+ after: boolean;
117
+ before: boolean;
118
+ };
119
+ secondaryStorage: boolean;
120
+ advanced: {
121
+ cookiePrefix: boolean;
122
+ cookies: boolean;
123
+ crossSubDomainCookies: {
124
+ domain: boolean;
125
+ enabled: any;
126
+ additionalCookies: any;
127
+ };
128
+ database: {
129
+ useNumberId: boolean;
130
+ generateId: any;
131
+ defaultFindManyLimit: any;
132
+ };
133
+ useSecureCookies: any;
134
+ ipAddress: {
135
+ disableIpTracking: any;
136
+ ipAddressHeaders: any;
137
+ };
138
+ disableCSRFCheck: any;
139
+ cookieAttributes: {
140
+ expires: any;
141
+ secure: any;
142
+ sameSite: any;
143
+ domain: boolean;
144
+ path: any;
145
+ httpOnly: any;
146
+ };
147
+ };
148
+ trustedOrigins: any;
149
+ rateLimit: {
150
+ storage: any;
151
+ modelName: any;
152
+ window: any;
153
+ customStorage: boolean;
154
+ enabled: any;
155
+ max: any;
156
+ };
157
+ onAPIError: {
158
+ errorURL: any;
159
+ onError: boolean;
160
+ throw: any;
161
+ };
162
+ logger: {
163
+ disabled: any;
164
+ level: any;
165
+ log: boolean;
166
+ };
167
+ databaseHooks: {
168
+ user: {
169
+ create: {
170
+ after: boolean;
171
+ before: boolean;
172
+ };
173
+ update: {
174
+ after: boolean;
175
+ before: boolean;
176
+ };
177
+ };
178
+ session: {
179
+ create: {
180
+ after: boolean;
181
+ before: boolean;
182
+ };
183
+ update: {
184
+ after: boolean;
185
+ before: boolean;
186
+ };
187
+ };
188
+ account: {
189
+ create: {
190
+ after: boolean;
191
+ before: boolean;
192
+ };
193
+ update: {
194
+ after: boolean;
195
+ before: boolean;
196
+ };
197
+ };
198
+ verification: {
199
+ create: {
200
+ after: boolean;
201
+ before: boolean;
202
+ };
203
+ update: {
204
+ after: boolean;
205
+ before: boolean;
206
+ };
207
+ };
208
+ };
209
+ };
210
+ //#endregion
211
+ //#region src/index.d.ts
212
+ declare function createTelemetry(options: BetterAuthOptions, context?: TelemetryContext | undefined): Promise<{
213
+ publish: (event: TelemetryEvent) => Promise<void>;
214
+ }>;
215
+ //#endregion
216
+ export { type TelemetryEvent, createTelemetry, getTelemetryAuthConfig };
217
+ //# sourceMappingURL=index.d.mts.map