wcz-test 6.20.0 → 6.22.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.
Files changed (42) hide show
  1. package/dist/{DialogsHooks-Bi8dZoyu.js → DialogsContext-DMZRefiY.js} +3 -35
  2. package/dist/DialogsContext-DMZRefiY.js.map +1 -0
  3. package/dist/DialogsHooks-DBK6rBoU.js +37 -0
  4. package/dist/DialogsHooks-DBK6rBoU.js.map +1 -0
  5. package/dist/{FileHooks-hWKTwLCr.js → FileHooks-BM2Oyvh6.js} +2 -3
  6. package/dist/FileHooks-BM2Oyvh6.js.map +1 -0
  7. package/dist/{RouterListItemButton-CHS7rofI.js → RouterListItemButton-Vj6OoqkV.js} +2 -2
  8. package/dist/{RouterListItemButton-CHS7rofI.js.map → RouterListItemButton-Vj6OoqkV.js.map} +1 -1
  9. package/dist/UseHook-DB7btKDE.js +11 -0
  10. package/dist/UseHook-DB7btKDE.js.map +1 -0
  11. package/dist/client.d.ts +0 -705
  12. package/dist/client.js +2 -4
  13. package/dist/client.js.map +1 -1
  14. package/dist/components.js +4 -3
  15. package/dist/components.js.map +1 -1
  16. package/dist/hooks.d.ts +15 -0
  17. package/dist/hooks.js +5 -3
  18. package/dist/hooks.js.map +1 -1
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.js +145 -54
  21. package/dist/index.js.map +1 -1
  22. package/dist/models.d.ts +0 -9
  23. package/dist/queries.js +2 -3
  24. package/dist/queries.js.map +1 -1
  25. package/dist/server.d.ts +0 -36
  26. package/dist/server.js +1 -8732
  27. package/dist/server.js.map +1 -1
  28. package/dist/{utils-DKyKGba7.js → utils-CKW5pi6k.js} +21 -2
  29. package/dist/utils-CKW5pi6k.js.map +1 -0
  30. package/dist/utils.js +1 -1
  31. package/package.json +117 -120
  32. package/dist/DialogsHooks-Bi8dZoyu.js.map +0 -1
  33. package/dist/FileHooks-hWKTwLCr.js.map +0 -1
  34. package/dist/auth-client-B6cIXYDV.js +0 -1417
  35. package/dist/auth-client-B6cIXYDV.js.map +0 -1
  36. package/dist/env-CoxTjaDr.js +0 -27
  37. package/dist/env-CoxTjaDr.js.map +0 -1
  38. package/dist/error-BhAKg8LX-X0sdNXNa.js +0 -195
  39. package/dist/error-BhAKg8LX-X0sdNXNa.js.map +0 -1
  40. package/dist/server-mxQ3s5dx-CC81W42s.js +0 -644
  41. package/dist/server-mxQ3s5dx-CC81W42s.js.map +0 -1
  42. package/dist/utils-DKyKGba7.js.map +0 -1
package/dist/client.d.ts CHANGED
@@ -1,710 +1,5 @@
1
- import { BetterFetch } from '@better-fetch/fetch';
2
- import { BetterFetchError } from '@better-fetch/fetch';
3
- import { BetterFetchPlugin } from '@better-fetch/fetch';
4
- import { BetterFetchResponse } from '@better-fetch/fetch';
5
- import { ClientFetchOption } from 'better-auth';
6
- import { ErrorContext } from '@better-fetch/fetch';
7
- import { FetchEsque } from '@better-fetch/fetch';
8
- import { OAuth2UserInfo } from 'better-auth';
9
- import { RequestContext } from '@better-fetch/fetch';
10
- import { ResponseContext } from '@better-fetch/fetch';
11
- import { RetryOptions } from '@better-fetch/fetch';
12
- import { SessionQueryParams } from 'better-auth';
13
- import { StandardSchemaV1 } from '@better-fetch/fetch';
14
- import { SuccessContext } from '@better-fetch/fetch';
15
1
  import { t } from 'i18next';
16
- import { u } from 'node_modules/better-auth/dist/helper-DU33OcfW.d.mts';
17
2
  import { useTranslation } from 'react-i18next';
18
- import { WritableAtom } from 'nanostores';
19
-
20
- export declare const authClient: {
21
- signIn: {
22
- social: <FetchOptions extends ClientFetchOption<Partial<{
23
- provider: unknown;
24
- callbackURL?: string | undefined;
25
- newUserCallbackURL?: string | undefined;
26
- errorCallbackURL?: string | undefined;
27
- disableRedirect?: boolean | undefined;
28
- idToken?: {
29
- token: string;
30
- nonce?: string | undefined;
31
- accessToken?: string | undefined;
32
- refreshToken?: string | undefined;
33
- expiresAt?: number | undefined;
34
- } | undefined;
35
- scopes?: string[] | undefined;
36
- requestSignUp?: boolean | undefined;
37
- loginHint?: string | undefined;
38
- additionalData?: Record<string, any> | undefined;
39
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: u< {
40
- provider: unknown;
41
- callbackURL?: string | undefined;
42
- newUserCallbackURL?: string | undefined;
43
- errorCallbackURL?: string | undefined;
44
- disableRedirect?: boolean | undefined;
45
- idToken?: {
46
- token: string;
47
- nonce?: string | undefined;
48
- accessToken?: string | undefined;
49
- refreshToken?: string | undefined;
50
- expiresAt?: number | undefined;
51
- } | undefined;
52
- scopes?: string[] | undefined;
53
- requestSignUp?: boolean | undefined;
54
- loginHint?: string | undefined;
55
- additionalData?: Record<string, any> | undefined;
56
- } & {
57
- fetchOptions?: FetchOptions | undefined;
58
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<NonNullable<{
59
- redirect: boolean;
60
- token: string;
61
- url: undefined;
62
- user: {
63
- id: string;
64
- email: string;
65
- name: string;
66
- image: string | null | undefined;
67
- emailVerified: boolean;
68
- createdAt: Date;
69
- updatedAt: Date;
70
- };
71
- } | {
72
- url: string;
73
- redirect: boolean;
74
- }>, {
75
- code?: string | undefined;
76
- message?: string | undefined;
77
- }, FetchOptions["throw"] extends true ? true : false>>;
78
- };
79
- } & {
80
- signOut: <FetchOptions extends ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: u< {
81
- query?: Record<string, any> | undefined;
82
- fetchOptions?: FetchOptions | undefined;
83
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
84
- success: boolean;
85
- }, {
86
- code?: string | undefined;
87
- message?: string | undefined;
88
- }, FetchOptions["throw"] extends true ? true : false>>;
89
- } & {
90
- signUp: {
91
- email: <FetchOptions extends ClientFetchOption<Partial<{
92
- name: string;
93
- email: string;
94
- password: string;
95
- image?: string | undefined;
96
- callbackURL?: string | undefined;
97
- rememberMe?: boolean | undefined;
98
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: u< {
99
- email: string;
100
- name: string;
101
- password: string;
102
- image?: string | undefined;
103
- callbackURL?: string | undefined;
104
- fetchOptions?: FetchOptions | undefined;
105
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<NonNullable<{
106
- token: null;
107
- user: {
108
- id: string;
109
- email: string;
110
- name: string;
111
- image: string | null | undefined;
112
- emailVerified: boolean;
113
- createdAt: Date;
114
- updatedAt: Date;
115
- };
116
- } | {
117
- token: string;
118
- user: {
119
- id: string;
120
- email: string;
121
- name: string;
122
- image: string | null | undefined;
123
- emailVerified: boolean;
124
- createdAt: Date;
125
- updatedAt: Date;
126
- };
127
- }>, {
128
- code?: string | undefined;
129
- message?: string | undefined;
130
- }, FetchOptions["throw"] extends true ? true : false>>;
131
- };
132
- } & {
133
- signIn: {
134
- email: <FetchOptions extends ClientFetchOption<Partial<{
135
- email: string;
136
- password: string;
137
- callbackURL?: string | undefined;
138
- rememberMe?: boolean | undefined;
139
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: u< {
140
- email: string;
141
- password: string;
142
- callbackURL?: string | undefined;
143
- rememberMe?: boolean | undefined;
144
- } & {
145
- fetchOptions?: FetchOptions | undefined;
146
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
147
- redirect: boolean;
148
- token: string;
149
- url: string | undefined;
150
- user: {
151
- id: string;
152
- email: string;
153
- name: string;
154
- image: string | null | undefined;
155
- emailVerified: boolean;
156
- createdAt: Date;
157
- updatedAt: Date;
158
- };
159
- }, {
160
- code?: string | undefined;
161
- message?: string | undefined;
162
- }, FetchOptions["throw"] extends true ? true : false>>;
163
- };
164
- } & {
165
- resetPassword: <FetchOptions extends ClientFetchOption<Partial<{
166
- newPassword: string;
167
- token?: string | undefined;
168
- }> & Record<string, any>, Partial<{
169
- token?: string | undefined;
170
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: u< {
171
- newPassword: string;
172
- token?: string | undefined;
173
- } & {
174
- fetchOptions?: FetchOptions | undefined;
175
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
176
- status: boolean;
177
- }, {
178
- code?: string | undefined;
179
- message?: string | undefined;
180
- }, FetchOptions["throw"] extends true ? true : false>>;
181
- } & {
182
- verifyEmail: <FetchOptions extends ClientFetchOption<never, Partial<{
183
- token: string;
184
- callbackURL?: string | undefined;
185
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: u< {
186
- query: {
187
- token: string;
188
- callbackURL?: string | undefined;
189
- };
190
- fetchOptions?: FetchOptions | undefined;
191
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<NonNullable<void | {
192
- status: boolean;
193
- }>, {
194
- code?: string | undefined;
195
- message?: string | undefined;
196
- }, FetchOptions["throw"] extends true ? true : false>>;
197
- } & {
198
- sendVerificationEmail: <FetchOptions extends ClientFetchOption<Partial<{
199
- email: string;
200
- callbackURL?: string | undefined;
201
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: u< {
202
- email: string;
203
- callbackURL?: string | undefined;
204
- } & {
205
- fetchOptions?: FetchOptions | undefined;
206
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
207
- status: boolean;
208
- }, {
209
- code?: string | undefined;
210
- message?: string | undefined;
211
- }, FetchOptions["throw"] extends true ? true : false>>;
212
- } & {
213
- changeEmail: <FetchOptions extends ClientFetchOption<Partial<{
214
- newEmail: string;
215
- callbackURL?: string | undefined;
216
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: u< {
217
- newEmail: string;
218
- callbackURL?: string | undefined;
219
- } & {
220
- fetchOptions?: FetchOptions | undefined;
221
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
222
- status: boolean;
223
- }, {
224
- code?: string | undefined;
225
- message?: string | undefined;
226
- }, FetchOptions["throw"] extends true ? true : false>>;
227
- } & {
228
- changePassword: <FetchOptions extends ClientFetchOption<Partial<{
229
- newPassword: string;
230
- currentPassword: string;
231
- revokeOtherSessions?: boolean | undefined;
232
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: u< {
233
- newPassword: string;
234
- currentPassword: string;
235
- revokeOtherSessions?: boolean | undefined;
236
- } & {
237
- fetchOptions?: FetchOptions | undefined;
238
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
239
- token: string | null;
240
- user: {
241
- id: string;
242
- email: string;
243
- name: string;
244
- image: string | null | undefined;
245
- emailVerified: boolean;
246
- createdAt: Date;
247
- updatedAt: Date;
248
- };
249
- }, {
250
- code?: string | undefined;
251
- message?: string | undefined;
252
- }, FetchOptions["throw"] extends true ? true : false>>;
253
- } & {
254
- updateUser: <FetchOptions extends ClientFetchOption<Partial<Partial<{}> & {
255
- name?: string | undefined;
256
- image?: string | undefined;
257
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: u< {
258
- image?: (string | null) | undefined;
259
- name?: string | undefined;
260
- fetchOptions?: FetchOptions | undefined;
261
- } & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
262
- status: boolean;
263
- }, {
264
- code?: string | undefined;
265
- message?: string | undefined;
266
- }, FetchOptions["throw"] extends true ? true : false>>;
267
- } & {
268
- deleteUser: <FetchOptions extends ClientFetchOption<Partial<{
269
- callbackURL?: string | undefined;
270
- password?: string | undefined;
271
- token?: string | undefined;
272
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: u< {
273
- callbackURL?: string | undefined;
274
- password?: string | undefined;
275
- token?: string | undefined;
276
- } & {
277
- fetchOptions?: FetchOptions | undefined;
278
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
279
- success: boolean;
280
- message: string;
281
- }, {
282
- code?: string | undefined;
283
- message?: string | undefined;
284
- }, FetchOptions["throw"] extends true ? true : false>>;
285
- } & {
286
- requestPasswordReset: <FetchOptions extends ClientFetchOption<Partial<{
287
- email: string;
288
- redirectTo?: string | undefined;
289
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: u< {
290
- email: string;
291
- redirectTo?: string | undefined;
292
- } & {
293
- fetchOptions?: FetchOptions | undefined;
294
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
295
- status: boolean;
296
- message: string;
297
- }, {
298
- code?: string | undefined;
299
- message?: string | undefined;
300
- }, FetchOptions["throw"] extends true ? true : false>>;
301
- } & {
302
- resetPassword: {
303
- ":token": <FetchOptions extends ClientFetchOption<never, Partial<{
304
- callbackURL: string;
305
- }> & Record<string, any>, {
306
- token: string;
307
- }>>(data_0: u< {
308
- query: {
309
- callbackURL: string;
310
- };
311
- fetchOptions?: FetchOptions | undefined;
312
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<never, {
313
- code?: string | undefined;
314
- message?: string | undefined;
315
- }, FetchOptions["throw"] extends true ? true : false>>;
316
- };
317
- } & {
318
- listSessions: <FetchOptions extends ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: u< {
319
- query?: Record<string, any> | undefined;
320
- fetchOptions?: FetchOptions | undefined;
321
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse<u< {
322
- id: string;
323
- createdAt: Date;
324
- updatedAt: Date;
325
- userId: string;
326
- expiresAt: Date;
327
- token: string;
328
- ipAddress?: string | null | undefined | undefined;
329
- userAgent?: string | null | undefined | undefined;
330
- }>[], {
331
- code?: string | undefined;
332
- message?: string | undefined;
333
- }, FetchOptions["throw"] extends true ? true : false>>;
334
- } & {
335
- revokeSession: <FetchOptions extends ClientFetchOption<Partial<{
336
- token: string;
337
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: u< {
338
- token: string;
339
- } & {
340
- fetchOptions?: FetchOptions | undefined;
341
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
342
- status: boolean;
343
- }, {
344
- code?: string | undefined;
345
- message?: string | undefined;
346
- }, FetchOptions["throw"] extends true ? true : false>>;
347
- } & {
348
- revokeSessions: <FetchOptions extends ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: u< {
349
- query?: Record<string, any> | undefined;
350
- fetchOptions?: FetchOptions | undefined;
351
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
352
- status: boolean;
353
- }, {
354
- code?: string | undefined;
355
- message?: string | undefined;
356
- }, FetchOptions["throw"] extends true ? true : false>>;
357
- } & {
358
- revokeOtherSessions: <FetchOptions extends ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: u< {
359
- query?: Record<string, any> | undefined;
360
- fetchOptions?: FetchOptions | undefined;
361
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
362
- status: boolean;
363
- }, {
364
- code?: string | undefined;
365
- message?: string | undefined;
366
- }, FetchOptions["throw"] extends true ? true : false>>;
367
- } & {
368
- linkSocial: <FetchOptions extends ClientFetchOption<Partial<{
369
- provider: unknown;
370
- callbackURL?: string | undefined;
371
- idToken?: {
372
- token: string;
373
- nonce?: string | undefined;
374
- accessToken?: string | undefined;
375
- refreshToken?: string | undefined;
376
- scopes?: string[] | undefined;
377
- } | undefined;
378
- requestSignUp?: boolean | undefined;
379
- scopes?: string[] | undefined;
380
- errorCallbackURL?: string | undefined;
381
- disableRedirect?: boolean | undefined;
382
- additionalData?: Record<string, any> | undefined;
383
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: u< {
384
- provider: unknown;
385
- callbackURL?: string | undefined;
386
- idToken?: {
387
- token: string;
388
- nonce?: string | undefined;
389
- accessToken?: string | undefined;
390
- refreshToken?: string | undefined;
391
- scopes?: string[] | undefined;
392
- } | undefined;
393
- requestSignUp?: boolean | undefined;
394
- scopes?: string[] | undefined;
395
- errorCallbackURL?: string | undefined;
396
- disableRedirect?: boolean | undefined;
397
- additionalData?: Record<string, any> | undefined;
398
- } & {
399
- fetchOptions?: FetchOptions | undefined;
400
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
401
- url: string;
402
- redirect: boolean;
403
- }, {
404
- code?: string | undefined;
405
- message?: string | undefined;
406
- }, FetchOptions["throw"] extends true ? true : false>>;
407
- } & {
408
- listAccounts: <FetchOptions extends ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: u< {
409
- query?: Record<string, any> | undefined;
410
- fetchOptions?: FetchOptions | undefined;
411
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
412
- id: string;
413
- providerId: string;
414
- createdAt: Date;
415
- updatedAt: Date;
416
- accountId: string;
417
- userId: string;
418
- scopes: string[];
419
- }[], {
420
- code?: string | undefined;
421
- message?: string | undefined;
422
- }, FetchOptions["throw"] extends true ? true : false>>;
423
- } & {
424
- deleteUser: {
425
- callback: <FetchOptions extends ClientFetchOption<never, Partial<{
426
- token: string;
427
- callbackURL?: string | undefined;
428
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: u< {
429
- query: {
430
- token: string;
431
- callbackURL?: string | undefined;
432
- };
433
- fetchOptions?: FetchOptions | undefined;
434
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
435
- success: boolean;
436
- message: string;
437
- }, {
438
- code?: string | undefined;
439
- message?: string | undefined;
440
- }, FetchOptions["throw"] extends true ? true : false>>;
441
- };
442
- } & {
443
- unlinkAccount: <FetchOptions extends ClientFetchOption<Partial<{
444
- providerId: string;
445
- accountId?: string | undefined;
446
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: u< {
447
- providerId: string;
448
- accountId?: string | undefined;
449
- } & {
450
- fetchOptions?: FetchOptions | undefined;
451
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
452
- status: boolean;
453
- }, {
454
- code?: string | undefined;
455
- message?: string | undefined;
456
- }, FetchOptions["throw"] extends true ? true : false>>;
457
- } & {
458
- refreshToken: <FetchOptions extends ClientFetchOption<Partial<{
459
- providerId: string;
460
- accountId?: string | undefined;
461
- userId?: string | undefined;
462
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: u< {
463
- providerId: string;
464
- accountId?: string | undefined;
465
- userId?: string | undefined;
466
- } & {
467
- fetchOptions?: FetchOptions | undefined;
468
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
469
- accessToken: string | undefined;
470
- refreshToken: string | undefined;
471
- accessTokenExpiresAt: Date | undefined;
472
- refreshTokenExpiresAt: Date | undefined;
473
- scope: string | null | undefined;
474
- idToken: string | null | undefined;
475
- providerId: string;
476
- accountId: string;
477
- }, {
478
- code?: string | undefined;
479
- message?: string | undefined;
480
- }, FetchOptions["throw"] extends true ? true : false>>;
481
- } & {
482
- getAccessToken: <FetchOptions extends ClientFetchOption<Partial<{
483
- providerId: string;
484
- accountId?: string | undefined;
485
- userId?: string | undefined;
486
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: u< {
487
- providerId: string;
488
- accountId?: string | undefined;
489
- userId?: string | undefined;
490
- } & {
491
- fetchOptions?: FetchOptions | undefined;
492
- }>, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
493
- accessToken: string;
494
- accessTokenExpiresAt: Date | undefined;
495
- scopes: string[];
496
- idToken: string | undefined;
497
- }, {
498
- code?: string | undefined;
499
- message?: string | undefined;
500
- }, FetchOptions["throw"] extends true ? true : false>>;
501
- } & {
502
- accountInfo: <FetchOptions extends ClientFetchOption<never, Partial<{
503
- accountId?: string | undefined;
504
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: u< {
505
- query?: {
506
- accountId?: string | undefined;
507
- } | undefined;
508
- fetchOptions?: FetchOptions | undefined;
509
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
510
- user: OAuth2UserInfo;
511
- data: Record<string, any>;
512
- }, {
513
- code?: string | undefined;
514
- message?: string | undefined;
515
- }, FetchOptions["throw"] extends true ? true : false>>;
516
- } & {
517
- getSession: <FetchOptions extends ClientFetchOption<never, Partial<{
518
- disableCookieCache?: unknown;
519
- disableRefresh?: unknown;
520
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: u< {
521
- query?: {
522
- disableCookieCache?: unknown;
523
- disableRefresh?: unknown;
524
- } | undefined;
525
- fetchOptions?: FetchOptions | undefined;
526
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<BetterFetchResponse< {
527
- user: {
528
- id: string;
529
- createdAt: Date;
530
- updatedAt: Date;
531
- email: string;
532
- emailVerified: boolean;
533
- name: string;
534
- image?: string | null | undefined;
535
- };
536
- session: {
537
- id: string;
538
- createdAt: Date;
539
- updatedAt: Date;
540
- userId: string;
541
- expiresAt: Date;
542
- token: string;
543
- ipAddress?: string | null | undefined;
544
- userAgent?: string | null | undefined;
545
- };
546
- } | null, {
547
- code?: string | undefined;
548
- message?: string | undefined;
549
- }, FetchOptions["throw"] extends true ? true : false>>;
550
- } & {
551
- useSession: () => {
552
- data: {
553
- user: {
554
- id: string;
555
- createdAt: Date;
556
- updatedAt: Date;
557
- email: string;
558
- emailVerified: boolean;
559
- name: string;
560
- image?: string | null | undefined;
561
- };
562
- session: {
563
- id: string;
564
- createdAt: Date;
565
- updatedAt: Date;
566
- userId: string;
567
- expiresAt: Date;
568
- token: string;
569
- ipAddress?: string | null | undefined;
570
- userAgent?: string | null | undefined;
571
- };
572
- } | null;
573
- isPending: boolean;
574
- isRefetching: boolean;
575
- error: BetterFetchError | null;
576
- refetch: (queryParams?: {
577
- query?: SessionQueryParams;
578
- } | undefined) => Promise<void>;
579
- };
580
- $Infer: {
581
- Session: {
582
- user: {
583
- id: string;
584
- createdAt: Date;
585
- updatedAt: Date;
586
- email: string;
587
- emailVerified: boolean;
588
- name: string;
589
- image?: string | null | undefined;
590
- };
591
- session: {
592
- id: string;
593
- createdAt: Date;
594
- updatedAt: Date;
595
- userId: string;
596
- expiresAt: Date;
597
- token: string;
598
- ipAddress?: string | null | undefined;
599
- userAgent?: string | null | undefined;
600
- };
601
- };
602
- };
603
- $fetch: BetterFetch< {
604
- plugins: (BetterFetchPlugin | {
605
- id: string;
606
- name: string;
607
- hooks: {
608
- onSuccess(context: SuccessContext<any>): void;
609
- };
610
- } | {
611
- id: string;
612
- name: string;
613
- hooks: {
614
- onRequest<T extends Record<string, any>>(context: RequestContext<T>): void;
615
- };
616
- } | {
617
- id: string;
618
- name: string;
619
- hooks: {
620
- onSuccess: ((context: SuccessContext<any>) => Promise<void> | void) | undefined;
621
- onError: ((context: ErrorContext) => Promise<void> | void) | undefined;
622
- onRequest: (<T extends Record<string, any>>(context: RequestContext<T>) => Promise<RequestContext | void> | RequestContext | void) | undefined;
623
- onResponse: ((context: ResponseContext) => Promise<Response | void | ResponseContext> | Response | ResponseContext | void) | undefined;
624
- };
625
- })[];
626
- cache?: RequestCache | undefined;
627
- method: string;
628
- headers?: (HeadersInit & (HeadersInit | {
629
- accept: "application/json" | "text/plain" | "application/octet-stream";
630
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
631
- authorization: "Bearer" | "Basic";
632
- })) | undefined;
633
- redirect?: RequestRedirect | undefined;
634
- credentials?: RequestCredentials;
635
- integrity?: string | undefined;
636
- keepalive?: boolean | undefined;
637
- mode?: RequestMode | undefined;
638
- priority?: RequestPriority | undefined;
639
- referrer?: string | undefined;
640
- referrerPolicy?: ReferrerPolicy | undefined;
641
- signal?: (AbortSignal | null) | undefined;
642
- window?: null | undefined;
643
- onRetry?: ((response: ResponseContext) => Promise<void> | void) | undefined;
644
- hookOptions?: {
645
- cloneResponse?: boolean;
646
- } | undefined;
647
- timeout?: number | undefined;
648
- customFetchImpl: FetchEsque;
649
- baseURL: string;
650
- throw?: boolean | undefined;
651
- auth?: ({
652
- type: "Bearer";
653
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
654
- } | {
655
- type: "Basic";
656
- username: string | (() => string | undefined) | undefined;
657
- password: string | (() => string | undefined) | undefined;
658
- } | {
659
- type: "Custom";
660
- prefix: string | (() => string | undefined) | undefined;
661
- value: string | (() => string | undefined) | undefined;
662
- }) | undefined;
663
- body?: any;
664
- query?: any;
665
- params?: any;
666
- duplex?: "full" | "half" | undefined;
667
- jsonParser: (text: string) => Promise<any> | any;
668
- retry?: RetryOptions | undefined;
669
- retryAttempt?: number | undefined;
670
- output?: (StandardSchemaV1 | typeof Blob | typeof File) | undefined;
671
- errorSchema?: StandardSchemaV1 | undefined;
672
- disableValidation?: boolean | undefined;
673
- disableSignal?: boolean | undefined;
674
- }, unknown, unknown, {}>;
675
- $store: {
676
- notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
677
- listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
678
- atoms: Record<string, WritableAtom<any>>;
679
- };
680
- $ERROR_CODES: {
681
- readonly USER_NOT_FOUND: "User not found";
682
- readonly FAILED_TO_CREATE_USER: "Failed to create user";
683
- readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
684
- readonly FAILED_TO_UPDATE_USER: "Failed to update user";
685
- readonly FAILED_TO_GET_SESSION: "Failed to get session";
686
- readonly INVALID_PASSWORD: "Invalid password";
687
- readonly INVALID_EMAIL: "Invalid email";
688
- readonly INVALID_EMAIL_OR_PASSWORD: "Invalid email or password";
689
- readonly SOCIAL_ACCOUNT_ALREADY_LINKED: "Social account already linked";
690
- readonly PROVIDER_NOT_FOUND: "Provider not found";
691
- readonly INVALID_TOKEN: "Invalid token";
692
- readonly ID_TOKEN_NOT_SUPPORTED: "id_token not supported";
693
- readonly FAILED_TO_GET_USER_INFO: "Failed to get user info";
694
- readonly USER_EMAIL_NOT_FOUND: "User email not found";
695
- readonly EMAIL_NOT_VERIFIED: "Email not verified";
696
- readonly PASSWORD_TOO_SHORT: "Password too short";
697
- readonly PASSWORD_TOO_LONG: "Password too long";
698
- readonly USER_ALREADY_EXISTS: "User already exists.";
699
- readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
700
- readonly EMAIL_CAN_NOT_BE_UPDATED: "Email can not be updated";
701
- readonly CREDENTIAL_ACCOUNT_NOT_FOUND: "Credential account not found";
702
- readonly SESSION_EXPIRED: "Session expired. Re-authenticate to perform this action.";
703
- readonly FAILED_TO_UNLINK_LAST_ACCOUNT: "You can't unlink your last account";
704
- readonly ACCOUNT_NOT_FOUND: "Account not found";
705
- readonly USER_ALREADY_HAS_PASSWORD: "User already has a password. Provide that to delete the account.";
706
- };
707
- };
708
3
 
709
4
  export declare class Platform {
710
5
  static get isAndroid(): boolean;