@farm.js/auth 0.1.0-beta.6 → 0.1.0-beta.8

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.ts CHANGED
@@ -1,31 +1,531 @@
1
1
  import type { FarmAuthClientOptions, FarmAuthCredentials, FarmAuthSignUpInput } from "./types.js";
2
2
  export declare function createFarmAuthClient(options?: FarmAuthClientOptions): {
3
- signIn: (input: FarmAuthCredentials) => any;
4
- signUp: (input: FarmAuthSignUpInput) => any;
5
- signOut: () => any;
6
- getSession: () => any;
3
+ signIn: (input: FarmAuthCredentials) => Promise<{
4
+ data: Omit<{
5
+ redirect: boolean;
6
+ token: string;
7
+ url?: string | undefined;
8
+ user: {
9
+ id: string;
10
+ createdAt: Date;
11
+ updatedAt: Date;
12
+ email: string;
13
+ emailVerified: boolean;
14
+ name: string;
15
+ image?: string | null | undefined | undefined;
16
+ };
17
+ }, "user"> & {
18
+ user: import("better-auth").StripEmptyObjects<{
19
+ id: string;
20
+ createdAt: Date;
21
+ updatedAt: Date;
22
+ email: string;
23
+ emailVerified: boolean;
24
+ name: string;
25
+ image?: string | null | undefined;
26
+ }>;
27
+ };
28
+ error: null;
29
+ } | {
30
+ data: null;
31
+ error: {
32
+ code?: string | undefined | undefined;
33
+ message?: string | undefined | undefined;
34
+ status: number;
35
+ statusText: string;
36
+ };
37
+ }>;
38
+ signUp: (input: FarmAuthSignUpInput) => Promise<{
39
+ data: (Omit<{
40
+ token: null;
41
+ user: {
42
+ id: string;
43
+ createdAt: Date;
44
+ updatedAt: Date;
45
+ email: string;
46
+ emailVerified: boolean;
47
+ name: string;
48
+ image?: string | null | undefined | undefined;
49
+ };
50
+ }, "user"> & {
51
+ user: import("better-auth").StripEmptyObjects<{
52
+ id: string;
53
+ createdAt: Date;
54
+ updatedAt: Date;
55
+ email: string;
56
+ emailVerified: boolean;
57
+ name: string;
58
+ image?: string | null | undefined;
59
+ }>;
60
+ }) | (Omit<{
61
+ token: string;
62
+ user: {
63
+ id: string;
64
+ createdAt: Date;
65
+ updatedAt: Date;
66
+ email: string;
67
+ emailVerified: boolean;
68
+ name: string;
69
+ image?: string | null | undefined | undefined;
70
+ };
71
+ }, "user"> & {
72
+ user: import("better-auth").StripEmptyObjects<{
73
+ id: string;
74
+ createdAt: Date;
75
+ updatedAt: Date;
76
+ email: string;
77
+ emailVerified: boolean;
78
+ name: string;
79
+ image?: string | null | undefined;
80
+ }>;
81
+ });
82
+ error: null;
83
+ } | {
84
+ data: null;
85
+ error: {
86
+ code?: string | undefined | undefined;
87
+ message?: string | undefined | undefined;
88
+ status: number;
89
+ statusText: string;
90
+ };
91
+ }>;
92
+ signOut: () => Promise<{
93
+ data: {
94
+ success: boolean;
95
+ };
96
+ error: null;
97
+ } | {
98
+ data: null;
99
+ error: {
100
+ code?: string | undefined | undefined;
101
+ message?: string | undefined | undefined;
102
+ status: number;
103
+ statusText: string;
104
+ };
105
+ }>;
106
+ getSession: () => Promise<{
107
+ data: {
108
+ user: import("better-auth").StripEmptyObjects<{
109
+ id: string;
110
+ createdAt: Date;
111
+ updatedAt: Date;
112
+ email: string;
113
+ emailVerified: boolean;
114
+ name: string;
115
+ image?: string | null | undefined;
116
+ }>;
117
+ session: import("better-auth").StripEmptyObjects<{
118
+ id: string;
119
+ createdAt: Date;
120
+ updatedAt: Date;
121
+ userId: string;
122
+ expiresAt: Date;
123
+ token: string;
124
+ ipAddress?: string | null | undefined;
125
+ userAgent?: string | null | undefined;
126
+ }>;
127
+ } | null;
128
+ error: null;
129
+ } | {
130
+ data: null;
131
+ error: {
132
+ code?: string | undefined | undefined;
133
+ message?: string | undefined | undefined;
134
+ status: number;
135
+ statusText: string;
136
+ };
137
+ }>;
7
138
  useAuth: () => {
8
- user: any;
9
- session: any;
10
- isPending: any;
11
- isRefetching: any;
12
- error: any;
13
- refetch: any;
14
- signIn: (input: FarmAuthCredentials) => any;
15
- signUp: (input: FarmAuthSignUpInput) => any;
16
- signOut: () => any;
139
+ user: import("better-auth").StripEmptyObjects<{
140
+ id: string;
141
+ createdAt: Date;
142
+ updatedAt: Date;
143
+ email: string;
144
+ emailVerified: boolean;
145
+ name: string;
146
+ image?: string | null | undefined;
147
+ }> | null;
148
+ session: import("better-auth").StripEmptyObjects<{
149
+ id: string;
150
+ createdAt: Date;
151
+ updatedAt: Date;
152
+ userId: string;
153
+ expiresAt: Date;
154
+ token: string;
155
+ ipAddress?: string | null | undefined;
156
+ userAgent?: string | null | undefined;
157
+ }> | null;
158
+ isPending: boolean;
159
+ isRefetching: boolean;
160
+ error: import("better-auth/react").BetterFetchError | null;
161
+ refetch: (queryParams?: {
162
+ query?: import("better-auth").SessionQueryParams;
163
+ } | undefined) => Promise<void>;
164
+ signIn: (input: FarmAuthCredentials) => Promise<{
165
+ data: Omit<{
166
+ redirect: boolean;
167
+ token: string;
168
+ url?: string | undefined;
169
+ user: {
170
+ id: string;
171
+ createdAt: Date;
172
+ updatedAt: Date;
173
+ email: string;
174
+ emailVerified: boolean;
175
+ name: string;
176
+ image?: string | null | undefined | undefined;
177
+ };
178
+ }, "user"> & {
179
+ user: import("better-auth").StripEmptyObjects<{
180
+ id: string;
181
+ createdAt: Date;
182
+ updatedAt: Date;
183
+ email: string;
184
+ emailVerified: boolean;
185
+ name: string;
186
+ image?: string | null | undefined;
187
+ }>;
188
+ };
189
+ error: null;
190
+ } | {
191
+ data: null;
192
+ error: {
193
+ code?: string | undefined | undefined;
194
+ message?: string | undefined | undefined;
195
+ status: number;
196
+ statusText: string;
197
+ };
198
+ }>;
199
+ signUp: (input: FarmAuthSignUpInput) => Promise<{
200
+ data: (Omit<{
201
+ token: null;
202
+ user: {
203
+ id: string;
204
+ createdAt: Date;
205
+ updatedAt: Date;
206
+ email: string;
207
+ emailVerified: boolean;
208
+ name: string;
209
+ image?: string | null | undefined | undefined;
210
+ };
211
+ }, "user"> & {
212
+ user: import("better-auth").StripEmptyObjects<{
213
+ id: string;
214
+ createdAt: Date;
215
+ updatedAt: Date;
216
+ email: string;
217
+ emailVerified: boolean;
218
+ name: string;
219
+ image?: string | null | undefined;
220
+ }>;
221
+ }) | (Omit<{
222
+ token: string;
223
+ user: {
224
+ id: string;
225
+ createdAt: Date;
226
+ updatedAt: Date;
227
+ email: string;
228
+ emailVerified: boolean;
229
+ name: string;
230
+ image?: string | null | undefined | undefined;
231
+ };
232
+ }, "user"> & {
233
+ user: import("better-auth").StripEmptyObjects<{
234
+ id: string;
235
+ createdAt: Date;
236
+ updatedAt: Date;
237
+ email: string;
238
+ emailVerified: boolean;
239
+ name: string;
240
+ image?: string | null | undefined;
241
+ }>;
242
+ });
243
+ error: null;
244
+ } | {
245
+ data: null;
246
+ error: {
247
+ code?: string | undefined | undefined;
248
+ message?: string | undefined | undefined;
249
+ status: number;
250
+ statusText: string;
251
+ };
252
+ }>;
253
+ signOut: () => Promise<{
254
+ data: {
255
+ success: boolean;
256
+ };
257
+ error: null;
258
+ } | {
259
+ data: null;
260
+ error: {
261
+ code?: string | undefined | undefined;
262
+ message?: string | undefined | undefined;
263
+ status: number;
264
+ statusText: string;
265
+ };
266
+ }>;
17
267
  };
18
268
  };
19
- export declare const getSession: () => any, signIn: (input: FarmAuthCredentials) => any, signOut: () => any, signUp: (input: FarmAuthSignUpInput) => any, useAuth: () => {
20
- user: any;
21
- session: any;
22
- isPending: any;
23
- isRefetching: any;
24
- error: any;
25
- refetch: any;
26
- signIn: (input: FarmAuthCredentials) => any;
27
- signUp: (input: FarmAuthSignUpInput) => any;
28
- signOut: () => any;
269
+ export declare const getSession: () => Promise<{
270
+ data: {
271
+ user: import("better-auth").StripEmptyObjects<{
272
+ id: string;
273
+ createdAt: Date;
274
+ updatedAt: Date;
275
+ email: string;
276
+ emailVerified: boolean;
277
+ name: string;
278
+ image?: string | null | undefined;
279
+ }>;
280
+ session: import("better-auth").StripEmptyObjects<{
281
+ id: string;
282
+ createdAt: Date;
283
+ updatedAt: Date;
284
+ userId: string;
285
+ expiresAt: Date;
286
+ token: string;
287
+ ipAddress?: string | null | undefined;
288
+ userAgent?: string | null | undefined;
289
+ }>;
290
+ } | null;
291
+ error: null;
292
+ } | {
293
+ data: null;
294
+ error: {
295
+ code?: string | undefined | undefined;
296
+ message?: string | undefined | undefined;
297
+ status: number;
298
+ statusText: string;
299
+ };
300
+ }>, signIn: (input: FarmAuthCredentials) => Promise<{
301
+ data: Omit<{
302
+ redirect: boolean;
303
+ token: string;
304
+ url?: string | undefined;
305
+ user: {
306
+ id: string;
307
+ createdAt: Date;
308
+ updatedAt: Date;
309
+ email: string;
310
+ emailVerified: boolean;
311
+ name: string;
312
+ image?: string | null | undefined | undefined;
313
+ };
314
+ }, "user"> & {
315
+ user: import("better-auth").StripEmptyObjects<{
316
+ id: string;
317
+ createdAt: Date;
318
+ updatedAt: Date;
319
+ email: string;
320
+ emailVerified: boolean;
321
+ name: string;
322
+ image?: string | null | undefined;
323
+ }>;
324
+ };
325
+ error: null;
326
+ } | {
327
+ data: null;
328
+ error: {
329
+ code?: string | undefined | undefined;
330
+ message?: string | undefined | undefined;
331
+ status: number;
332
+ statusText: string;
333
+ };
334
+ }>, signOut: () => Promise<{
335
+ data: {
336
+ success: boolean;
337
+ };
338
+ error: null;
339
+ } | {
340
+ data: null;
341
+ error: {
342
+ code?: string | undefined | undefined;
343
+ message?: string | undefined | undefined;
344
+ status: number;
345
+ statusText: string;
346
+ };
347
+ }>, signUp: (input: FarmAuthSignUpInput) => Promise<{
348
+ data: (Omit<{
349
+ token: null;
350
+ user: {
351
+ id: string;
352
+ createdAt: Date;
353
+ updatedAt: Date;
354
+ email: string;
355
+ emailVerified: boolean;
356
+ name: string;
357
+ image?: string | null | undefined | undefined;
358
+ };
359
+ }, "user"> & {
360
+ user: import("better-auth").StripEmptyObjects<{
361
+ id: string;
362
+ createdAt: Date;
363
+ updatedAt: Date;
364
+ email: string;
365
+ emailVerified: boolean;
366
+ name: string;
367
+ image?: string | null | undefined;
368
+ }>;
369
+ }) | (Omit<{
370
+ token: string;
371
+ user: {
372
+ id: string;
373
+ createdAt: Date;
374
+ updatedAt: Date;
375
+ email: string;
376
+ emailVerified: boolean;
377
+ name: string;
378
+ image?: string | null | undefined | undefined;
379
+ };
380
+ }, "user"> & {
381
+ user: import("better-auth").StripEmptyObjects<{
382
+ id: string;
383
+ createdAt: Date;
384
+ updatedAt: Date;
385
+ email: string;
386
+ emailVerified: boolean;
387
+ name: string;
388
+ image?: string | null | undefined;
389
+ }>;
390
+ });
391
+ error: null;
392
+ } | {
393
+ data: null;
394
+ error: {
395
+ code?: string | undefined | undefined;
396
+ message?: string | undefined | undefined;
397
+ status: number;
398
+ statusText: string;
399
+ };
400
+ }>, useAuth: () => {
401
+ user: import("better-auth").StripEmptyObjects<{
402
+ id: string;
403
+ createdAt: Date;
404
+ updatedAt: Date;
405
+ email: string;
406
+ emailVerified: boolean;
407
+ name: string;
408
+ image?: string | null | undefined;
409
+ }> | null;
410
+ session: import("better-auth").StripEmptyObjects<{
411
+ id: string;
412
+ createdAt: Date;
413
+ updatedAt: Date;
414
+ userId: string;
415
+ expiresAt: Date;
416
+ token: string;
417
+ ipAddress?: string | null | undefined;
418
+ userAgent?: string | null | undefined;
419
+ }> | null;
420
+ isPending: boolean;
421
+ isRefetching: boolean;
422
+ error: import("better-auth/react").BetterFetchError | null;
423
+ refetch: (queryParams?: {
424
+ query?: import("better-auth").SessionQueryParams;
425
+ } | undefined) => Promise<void>;
426
+ signIn: (input: FarmAuthCredentials) => Promise<{
427
+ data: Omit<{
428
+ redirect: boolean;
429
+ token: string;
430
+ url?: string | undefined;
431
+ user: {
432
+ id: string;
433
+ createdAt: Date;
434
+ updatedAt: Date;
435
+ email: string;
436
+ emailVerified: boolean;
437
+ name: string;
438
+ image?: string | null | undefined | undefined;
439
+ };
440
+ }, "user"> & {
441
+ user: import("better-auth").StripEmptyObjects<{
442
+ id: string;
443
+ createdAt: Date;
444
+ updatedAt: Date;
445
+ email: string;
446
+ emailVerified: boolean;
447
+ name: string;
448
+ image?: string | null | undefined;
449
+ }>;
450
+ };
451
+ error: null;
452
+ } | {
453
+ data: null;
454
+ error: {
455
+ code?: string | undefined | undefined;
456
+ message?: string | undefined | undefined;
457
+ status: number;
458
+ statusText: string;
459
+ };
460
+ }>;
461
+ signUp: (input: FarmAuthSignUpInput) => Promise<{
462
+ data: (Omit<{
463
+ token: null;
464
+ user: {
465
+ id: string;
466
+ createdAt: Date;
467
+ updatedAt: Date;
468
+ email: string;
469
+ emailVerified: boolean;
470
+ name: string;
471
+ image?: string | null | undefined | undefined;
472
+ };
473
+ }, "user"> & {
474
+ user: import("better-auth").StripEmptyObjects<{
475
+ id: string;
476
+ createdAt: Date;
477
+ updatedAt: Date;
478
+ email: string;
479
+ emailVerified: boolean;
480
+ name: string;
481
+ image?: string | null | undefined;
482
+ }>;
483
+ }) | (Omit<{
484
+ token: string;
485
+ user: {
486
+ id: string;
487
+ createdAt: Date;
488
+ updatedAt: Date;
489
+ email: string;
490
+ emailVerified: boolean;
491
+ name: string;
492
+ image?: string | null | undefined | undefined;
493
+ };
494
+ }, "user"> & {
495
+ user: import("better-auth").StripEmptyObjects<{
496
+ id: string;
497
+ createdAt: Date;
498
+ updatedAt: Date;
499
+ email: string;
500
+ emailVerified: boolean;
501
+ name: string;
502
+ image?: string | null | undefined;
503
+ }>;
504
+ });
505
+ error: null;
506
+ } | {
507
+ data: null;
508
+ error: {
509
+ code?: string | undefined | undefined;
510
+ message?: string | undefined | undefined;
511
+ status: number;
512
+ statusText: string;
513
+ };
514
+ }>;
515
+ signOut: () => Promise<{
516
+ data: {
517
+ success: boolean;
518
+ };
519
+ error: null;
520
+ } | {
521
+ data: null;
522
+ error: {
523
+ code?: string | undefined | undefined;
524
+ message?: string | undefined | undefined;
525
+ status: number;
526
+ statusText: string;
527
+ };
528
+ }>;
29
529
  };
30
530
  export type { FarmAuthClientOptions, FarmAuthCredentials, FarmAuthSignUpInput } from "./types.js";
31
531
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAElG,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,qBAA0B;oBAG/C,mBAAmB;oBAInB,mBAAmB;;;;;;;;;;wBAJnB,mBAAmB;wBAInB,mBAAmB;;;EAmC3C;AAID,eAAO,MAAQ,UAAU,aAAE,MAAM,UA3CR,mBAAmB,UA2CT,OAAO,aAAE,MAAM,UAvCzB,mBAAmB,UAuCQ,OAAO;;;;;;;oBA3ClC,mBAAmB;oBAInB,mBAAmB;;CAuCiC,CAAC;AAE9E,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAElG,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,qBAA0B;oBAG/C,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAInB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0CwgB,CAAC;;wBA9C5hB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAInB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmC3C;AAID,eAAO,MAAQ,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAE,MAAM,UA3CR,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2CT,OAAO;;;;;;;;;;;;;IAAE,MAAM,UAvCzB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuCQ,OAAO;;;;;;;;;;;;;;;;;;;;;;;;aAGyf,CAAC;;oBA9C5hB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAInB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCiC,CAAC;AAE9E,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farm.js/auth",
3
- "version": "0.1.0-beta.6",
3
+ "version": "0.1.0-beta.8",
4
4
  "description": "Farm-native authentication with email/password, server helpers, and React hooks",
5
5
  "license": "MIT",
6
6
  "repository": {