@better-auth/electron 1.6.0-beta.0 → 1.6.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/{client-CMv-uqSO.d.mts → client-D6xRwPM0.d.mts} +8 -1
- package/dist/client.d.mts +1 -1
- package/dist/client.mjs +1 -1
- package/dist/index.d.mts +140 -124
- package/dist/index.mjs +1 -1
- package/dist/preload.d.mts +747 -562
- package/dist/preload.mjs +2 -2
- package/dist/proxy.d.mts +1 -1
- package/dist/proxy.mjs +1 -1
- package/dist/storage.d.mts +1 -1
- package/dist/{version-BqMHXjG-.mjs → version-Cf5gNNxE.mjs} +1 -1
- package/package.json +6 -6
|
@@ -241,7 +241,14 @@ interface ElectronProxyClientOptions extends ElectronSharedClientOptions {
|
|
|
241
241
|
//#region src/authenticate.d.ts
|
|
242
242
|
declare const kElectron: unique symbol;
|
|
243
243
|
declare const requestAuthOptionsSchema: z.ZodObject<{
|
|
244
|
-
|
|
244
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
245
|
+
callbackURL: z.ZodOptional<z.ZodString>;
|
|
246
|
+
newUserCallbackURL: z.ZodOptional<z.ZodString>;
|
|
247
|
+
errorCallbackURL: z.ZodOptional<z.ZodString>;
|
|
248
|
+
disableRedirect: z.ZodOptional<z.ZodBoolean>;
|
|
249
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
250
|
+
requestSignUp: z.ZodOptional<z.ZodBoolean>;
|
|
251
|
+
additionalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
245
252
|
}, z.core.$strip>;
|
|
246
253
|
type ElectronRequestAuthOptions = z.infer<typeof requestAuthOptionsSchema>;
|
|
247
254
|
/**
|
package/dist/client.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as setupRenderer, a as authenticate, c as ElectronClientOptions, d as Storage, f as FetchUserImageResult, g as SetupRendererConfig, h as ExposedBridges, i as ElectronRequestAuthOptions, l as ElectronProxyClientOptions, m as normalizeUserOutput, n as handleDeepLink, o as kElectron, p as fetchUserImage, r as ElectronAuthenticateOptions, s as requestAuth, t as electronClient, u as ElectronSharedClientOptions, y as ElectronSharedOptions } from "./client-
|
|
1
|
+
import { _ as setupRenderer, a as authenticate, c as ElectronClientOptions, d as Storage, f as FetchUserImageResult, g as SetupRendererConfig, h as ExposedBridges, i as ElectronRequestAuthOptions, l as ElectronProxyClientOptions, m as normalizeUserOutput, n as handleDeepLink, o as kElectron, p as fetchUserImage, r as ElectronAuthenticateOptions, s as requestAuth, t as electronClient, u as ElectronSharedClientOptions, y as ElectronSharedOptions } from "./client-D6xRwPM0.mjs";
|
|
2
2
|
export { ElectronAuthenticateOptions, ElectronClientOptions, ElectronProxyClientOptions, ElectronRequestAuthOptions, ElectronSharedClientOptions, ElectronSharedOptions, ExposedBridges, FetchUserImageResult, SetupRendererConfig, Storage, authenticate, electronClient, fetchUserImage, handleDeepLink, kElectron, normalizeUserOutput, requestAuth, setupRenderer };
|
package/dist/client.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PACKAGE_VERSION } from "./version-
|
|
1
|
+
import { t as PACKAGE_VERSION } from "./version-Cf5gNNxE.mjs";
|
|
2
2
|
import { n as isProcessType, r as parseProtocolScheme, t as getChannelPrefixWithDelimiter } from "./utils-DxDKRT6e.mjs";
|
|
3
3
|
import { BetterAuthError } from "@better-auth/core/error";
|
|
4
4
|
import { base64, base64Url } from "@better-auth/utils/base64";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { f as FetchUserImageResult, m as normalizeUserOutput, p as fetchUserImage, v as ElectronOptions, y as ElectronSharedOptions } from "./client-
|
|
1
|
+
import { f as FetchUserImageResult, m as normalizeUserOutput, p as fetchUserImage, v as ElectronOptions, y as ElectronSharedOptions } from "./client-D6xRwPM0.mjs";
|
|
2
2
|
import * as better_auth0 from "better-auth";
|
|
3
|
+
import * as z from "zod";
|
|
3
4
|
import * as _better_auth_core0 from "@better-auth/core";
|
|
4
5
|
import { HookEndpointContext } from "@better-auth/core";
|
|
5
6
|
import * as better_call0 from "better-call";
|
|
@@ -21,10 +22,10 @@ declare const electron: (options?: ElectronOptions | undefined) => {
|
|
|
21
22
|
hooks: {
|
|
22
23
|
after: ({
|
|
23
24
|
matcher: (ctx: HookEndpointContext) => boolean;
|
|
24
|
-
handler:
|
|
25
|
+
handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<void>;
|
|
25
26
|
} | {
|
|
26
27
|
matcher: (ctx: HookEndpointContext) => boolean;
|
|
27
|
-
handler:
|
|
28
|
+
handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<better_call0.MiddlewareContext<better_call0.MiddlewareOptions, {
|
|
28
29
|
returned?: unknown | undefined;
|
|
29
30
|
responseHeaders?: Headers | undefined;
|
|
30
31
|
} & better_auth0.PluginContext<better_auth0.BetterAuthOptions> & better_auth0.InfoContext & {
|
|
@@ -154,156 +155,171 @@ declare const electron: (options?: ElectronOptions | undefined) => {
|
|
|
154
155
|
runInBackgroundOrAwait: (promise: Promise<unknown> | void) => better_auth0.Awaitable<unknown>;
|
|
155
156
|
}> | {
|
|
156
157
|
electron_authorization_code: string;
|
|
157
|
-
} | undefined
|
|
158
|
+
} | undefined>;
|
|
158
159
|
})[];
|
|
159
160
|
};
|
|
160
161
|
endpoints: {
|
|
161
|
-
electronToken: better_call0.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
162
|
+
electronToken: better_call0.StrictEndpoint<"/electron/token", {
|
|
163
|
+
method: "POST";
|
|
164
|
+
body: z.ZodObject<{
|
|
165
|
+
token: z.ZodString;
|
|
166
|
+
state: z.ZodString;
|
|
167
|
+
code_verifier: z.ZodString;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
metadata: {
|
|
170
|
+
scope: "http";
|
|
171
|
+
openapi: {
|
|
172
|
+
description: string;
|
|
173
|
+
operationId: string;
|
|
174
|
+
responses: {
|
|
175
|
+
200: {
|
|
176
|
+
description: string;
|
|
177
|
+
content: {
|
|
178
|
+
"application/json": {
|
|
179
|
+
schema: {
|
|
180
|
+
type: "object";
|
|
181
|
+
properties: {
|
|
182
|
+
token: {
|
|
183
|
+
type: string;
|
|
184
|
+
};
|
|
185
|
+
user: {
|
|
186
|
+
type: string;
|
|
187
|
+
$ref: string;
|
|
188
|
+
};
|
|
187
189
|
};
|
|
190
|
+
required: string[];
|
|
188
191
|
};
|
|
189
|
-
required: string[];
|
|
190
192
|
};
|
|
191
193
|
};
|
|
192
194
|
};
|
|
193
195
|
};
|
|
194
196
|
};
|
|
195
197
|
};
|
|
196
|
-
},
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
198
|
+
}, {
|
|
199
|
+
token: string;
|
|
200
|
+
user: better_auth0.User & Record<string, any>;
|
|
201
|
+
}>;
|
|
202
|
+
electronInitOAuthProxy: better_call0.StrictEndpoint<"/electron/init-oauth-proxy", {
|
|
203
|
+
method: "GET";
|
|
204
|
+
query: z.ZodObject<{
|
|
205
|
+
provider: z.ZodString;
|
|
206
|
+
state: z.ZodString;
|
|
207
|
+
code_challenge: z.ZodString;
|
|
208
|
+
code_challenge_method: z.ZodOptional<z.ZodString>;
|
|
209
|
+
}, z.core.$strip>;
|
|
210
|
+
metadata: {
|
|
211
|
+
scope: "http";
|
|
212
|
+
openapi: {
|
|
213
|
+
description: string;
|
|
214
|
+
operationId: string;
|
|
215
|
+
responses: {
|
|
216
|
+
200: {
|
|
217
|
+
description: string;
|
|
218
|
+
content: {
|
|
219
|
+
"application/json": {
|
|
220
|
+
schema: {
|
|
221
|
+
type: "object";
|
|
222
|
+
properties: {
|
|
223
|
+
url: {
|
|
224
|
+
type: string;
|
|
225
|
+
nullable: boolean;
|
|
226
|
+
};
|
|
227
|
+
redirect: {
|
|
228
|
+
type: string;
|
|
229
|
+
};
|
|
230
|
+
user: {
|
|
231
|
+
type: string;
|
|
232
|
+
$ref: string;
|
|
233
|
+
};
|
|
234
|
+
token: {
|
|
235
|
+
type: string;
|
|
236
|
+
};
|
|
233
237
|
};
|
|
238
|
+
required: string[];
|
|
234
239
|
};
|
|
235
|
-
required: string[];
|
|
236
240
|
};
|
|
237
241
|
};
|
|
238
242
|
};
|
|
239
243
|
};
|
|
240
244
|
};
|
|
241
245
|
};
|
|
242
|
-
}, undefined>;
|
|
243
|
-
electronTransferUser: better_call0.Endpoint<"/electron/transfer-user", "POST", {
|
|
244
|
-
callbackURL?: string | undefined;
|
|
245
246
|
}, {
|
|
246
|
-
|
|
247
|
-
state: string;
|
|
248
|
-
code_challenge: string;
|
|
249
|
-
code_challenge_method?: string | undefined;
|
|
250
|
-
}, [better_call0.Middleware<(inputContext: Record<string, any>) => Promise<{
|
|
251
|
-
session: {
|
|
252
|
-
session: Record<string, any> & {
|
|
253
|
-
id: string;
|
|
254
|
-
createdAt: Date;
|
|
255
|
-
updatedAt: Date;
|
|
256
|
-
userId: string;
|
|
257
|
-
expiresAt: Date;
|
|
258
|
-
token: string;
|
|
259
|
-
ipAddress?: string | null | undefined;
|
|
260
|
-
userAgent?: string | null | undefined;
|
|
261
|
-
};
|
|
262
|
-
user: Record<string, any> & {
|
|
263
|
-
id: string;
|
|
264
|
-
createdAt: Date;
|
|
265
|
-
updatedAt: Date;
|
|
266
|
-
email: string;
|
|
267
|
-
emailVerified: boolean;
|
|
268
|
-
name: string;
|
|
269
|
-
image?: string | null | undefined;
|
|
270
|
-
};
|
|
271
|
-
};
|
|
272
|
-
}>>], {
|
|
273
|
-
url: string | null;
|
|
247
|
+
url: string | undefined;
|
|
274
248
|
redirect: boolean;
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
249
|
+
user?: better_auth0.User & Record<string, any>;
|
|
250
|
+
token?: string;
|
|
251
|
+
} | undefined>;
|
|
252
|
+
electronTransferUser: better_call0.StrictEndpoint<"/electron/transfer-user", {
|
|
253
|
+
method: "POST";
|
|
254
|
+
query: z.ZodObject<{
|
|
255
|
+
client_id: z.ZodString;
|
|
256
|
+
state: z.ZodString;
|
|
257
|
+
code_challenge: z.ZodString;
|
|
258
|
+
code_challenge_method: z.ZodOptional<z.ZodString>;
|
|
259
|
+
}, z.core.$strip>;
|
|
260
|
+
body: z.ZodObject<{
|
|
261
|
+
callbackURL: z.ZodOptional<z.ZodString>;
|
|
262
|
+
}, z.core.$strip>;
|
|
263
|
+
use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
|
|
264
|
+
session: {
|
|
265
|
+
session: Record<string, any> & {
|
|
266
|
+
id: string;
|
|
267
|
+
createdAt: Date;
|
|
268
|
+
updatedAt: Date;
|
|
269
|
+
userId: string;
|
|
270
|
+
expiresAt: Date;
|
|
271
|
+
token: string;
|
|
272
|
+
ipAddress?: string | null | undefined;
|
|
273
|
+
userAgent?: string | null | undefined;
|
|
274
|
+
};
|
|
275
|
+
user: Record<string, any> & {
|
|
276
|
+
id: string;
|
|
277
|
+
createdAt: Date;
|
|
278
|
+
updatedAt: Date;
|
|
279
|
+
email: string;
|
|
280
|
+
emailVerified: boolean;
|
|
281
|
+
name: string;
|
|
282
|
+
image?: string | null | undefined;
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
}>)[];
|
|
286
|
+
requireHeaders: true;
|
|
287
|
+
metadata: {
|
|
288
|
+
openapi: {
|
|
289
|
+
description: string;
|
|
290
|
+
operationId: string;
|
|
291
|
+
responses: {
|
|
292
|
+
200: {
|
|
293
|
+
description: string;
|
|
294
|
+
content: {
|
|
295
|
+
"application/json": {
|
|
296
|
+
schema: {
|
|
297
|
+
type: "object";
|
|
298
|
+
properties: {
|
|
299
|
+
url: {
|
|
300
|
+
type: string;
|
|
301
|
+
nullable: boolean;
|
|
302
|
+
};
|
|
303
|
+
redirect: {
|
|
304
|
+
type: string;
|
|
305
|
+
};
|
|
306
|
+
electron_authorization_code: {
|
|
307
|
+
type: string;
|
|
308
|
+
};
|
|
297
309
|
};
|
|
310
|
+
required: string[];
|
|
298
311
|
};
|
|
299
|
-
required: string[];
|
|
300
312
|
};
|
|
301
313
|
};
|
|
302
314
|
};
|
|
303
315
|
};
|
|
304
316
|
};
|
|
305
317
|
};
|
|
306
|
-
},
|
|
318
|
+
}, {
|
|
319
|
+
url: string | null;
|
|
320
|
+
redirect: boolean;
|
|
321
|
+
electron_authorization_code: string;
|
|
322
|
+
}>;
|
|
307
323
|
};
|
|
308
324
|
options: {
|
|
309
325
|
codeExpiresIn: number;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PACKAGE_VERSION } from "./version-
|
|
1
|
+
import { t as PACKAGE_VERSION } from "./version-Cf5gNNxE.mjs";
|
|
2
2
|
import { createAuthMiddleware } from "@better-auth/core/api";
|
|
3
3
|
import { APIError, BASE_ERROR_CODES } from "@better-auth/core/error";
|
|
4
4
|
import { base64Url } from "@better-auth/utils/base64";
|