@choiceform/shared-auth 0.1.18 → 0.1.19
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/README.md +370 -139
- package/dist/core.d.ts +109 -66
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +3 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/init.d.ts +109 -66
- package/dist/init.d.ts.map +1 -1
- package/dist/lib/auth-client.d.ts +108 -66
- package/dist/lib/auth-client.d.ts.map +1 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +1 -0
- package/dist/services/referral-service.d.ts +54 -0
- package/dist/services/referral-service.d.ts.map +1 -0
- package/dist/services/referral-service.js +54 -0
- package/dist/store/utils.d.ts +1 -1
- package/dist/store/utils.d.ts.map +1 -1
- package/dist/types/user.d.ts +4 -0
- package/dist/types/user.d.ts.map +1 -1
- package/dist/utils/user-mapper.d.ts.map +1 -1
- package/dist/utils/user-mapper.js +2 -0
- package/package.json +11 -12
- package/dist/components/auth-sync.d.ts +0 -27
- package/dist/components/auth-sync.d.ts.map +0 -1
- package/dist/components/auth-sync.js +0 -117
- package/dist/components/protected-route.d.ts +0 -18
- package/dist/components/protected-route.d.ts.map +0 -1
- package/dist/components/protected-route.js +0 -34
- package/dist/components/sign-in-page.d.ts +0 -21
- package/dist/components/sign-in-page.d.ts.map +0 -1
- package/dist/components/sign-in-page.js +0 -31
package/dist/core.d.ts
CHANGED
|
@@ -152,6 +152,7 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
152
152
|
success: boolean;
|
|
153
153
|
}>;
|
|
154
154
|
};
|
|
155
|
+
referralService: import("./services").ReferralService;
|
|
155
156
|
setActiveOrganization: (request: SetActiveOrganizationRequest) => Promise<Organization>;
|
|
156
157
|
setActiveTeam: (request: SetActiveTeamRequest) => Promise<void>;
|
|
157
158
|
setActiveOrganizationAndTeam: (organizationId: string, teamId: string) => Promise<Organization>;
|
|
@@ -174,7 +175,7 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
174
175
|
requestSignUp?: boolean | undefined;
|
|
175
176
|
loginHint?: string | undefined;
|
|
176
177
|
additionalData?: Record<string, any> | undefined;
|
|
177
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
178
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
178
179
|
provider: (string & {}) | "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" | "vercel";
|
|
179
180
|
callbackURL?: string | undefined;
|
|
180
181
|
newUserCallbackURL?: string | undefined;
|
|
@@ -193,7 +194,7 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
193
194
|
additionalData?: Record<string, any> | undefined;
|
|
194
195
|
} & {
|
|
195
196
|
fetchOptions?: FetchOptions | undefined;
|
|
196
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
197
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<NonNullable<{
|
|
197
198
|
redirect: boolean;
|
|
198
199
|
url: string;
|
|
199
200
|
} | {
|
|
@@ -215,10 +216,10 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
215
216
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
216
217
|
};
|
|
217
218
|
} & {
|
|
218
|
-
signOut: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
219
|
+
signOut: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
219
220
|
query?: Record<string, any> | undefined;
|
|
220
221
|
fetchOptions?: FetchOptions | undefined;
|
|
221
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
222
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
222
223
|
success: boolean;
|
|
223
224
|
}, {
|
|
224
225
|
code?: string | undefined;
|
|
@@ -233,14 +234,14 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
233
234
|
image?: string | undefined;
|
|
234
235
|
callbackURL?: string | undefined;
|
|
235
236
|
rememberMe?: boolean | undefined;
|
|
236
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
237
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
237
238
|
email: string;
|
|
238
239
|
name: string;
|
|
239
240
|
password: string;
|
|
240
241
|
image?: string | undefined;
|
|
241
242
|
callbackURL?: string | undefined;
|
|
242
243
|
fetchOptions?: FetchOptions | undefined;
|
|
243
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
244
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<NonNullable<{
|
|
244
245
|
token: null;
|
|
245
246
|
user: {
|
|
246
247
|
id: string;
|
|
@@ -274,14 +275,14 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
274
275
|
password: string;
|
|
275
276
|
callbackURL?: string | undefined;
|
|
276
277
|
rememberMe?: boolean | undefined;
|
|
277
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
278
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
278
279
|
email: string;
|
|
279
280
|
password: string;
|
|
280
281
|
callbackURL?: string | undefined;
|
|
281
282
|
rememberMe?: boolean | undefined;
|
|
282
283
|
} & {
|
|
283
284
|
fetchOptions?: FetchOptions | undefined;
|
|
284
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
285
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
285
286
|
redirect: boolean;
|
|
286
287
|
token: string;
|
|
287
288
|
url?: string | undefined;
|
|
@@ -305,12 +306,12 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
305
306
|
token?: string | undefined;
|
|
306
307
|
}> & Record<string, any>, Partial<{
|
|
307
308
|
token?: string | undefined;
|
|
308
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
309
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
309
310
|
newPassword: string;
|
|
310
311
|
token?: string | undefined;
|
|
311
312
|
} & {
|
|
312
313
|
fetchOptions?: FetchOptions | undefined;
|
|
313
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
314
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
314
315
|
status: boolean;
|
|
315
316
|
}, {
|
|
316
317
|
code?: string | undefined;
|
|
@@ -320,13 +321,13 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
320
321
|
verifyEmail: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
|
|
321
322
|
token: string;
|
|
322
323
|
callbackURL?: string | undefined;
|
|
323
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
324
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
324
325
|
query: {
|
|
325
326
|
token: string;
|
|
326
327
|
callbackURL?: string | undefined;
|
|
327
328
|
};
|
|
328
329
|
fetchOptions?: FetchOptions | undefined;
|
|
329
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
330
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<NonNullable<void | {
|
|
330
331
|
status: boolean;
|
|
331
332
|
}>, {
|
|
332
333
|
code?: string | undefined;
|
|
@@ -336,12 +337,12 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
336
337
|
sendVerificationEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
|
|
337
338
|
email: string;
|
|
338
339
|
callbackURL?: string | undefined;
|
|
339
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
340
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
340
341
|
email: string;
|
|
341
342
|
callbackURL?: string | undefined;
|
|
342
343
|
} & {
|
|
343
344
|
fetchOptions?: FetchOptions | undefined;
|
|
344
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
345
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
345
346
|
status: boolean;
|
|
346
347
|
}, {
|
|
347
348
|
code?: string | undefined;
|
|
@@ -351,12 +352,12 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
351
352
|
changeEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
|
|
352
353
|
newEmail: string;
|
|
353
354
|
callbackURL?: string | undefined;
|
|
354
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
355
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
355
356
|
newEmail: string;
|
|
356
357
|
callbackURL?: string | undefined;
|
|
357
358
|
} & {
|
|
358
359
|
fetchOptions?: FetchOptions | undefined;
|
|
359
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
360
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
360
361
|
status: boolean;
|
|
361
362
|
}, {
|
|
362
363
|
code?: string | undefined;
|
|
@@ -367,13 +368,13 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
367
368
|
newPassword: string;
|
|
368
369
|
currentPassword: string;
|
|
369
370
|
revokeOtherSessions?: boolean | undefined;
|
|
370
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
371
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
371
372
|
newPassword: string;
|
|
372
373
|
currentPassword: string;
|
|
373
374
|
revokeOtherSessions?: boolean | undefined;
|
|
374
375
|
} & {
|
|
375
376
|
fetchOptions?: FetchOptions | undefined;
|
|
376
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
377
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
377
378
|
token: string | null;
|
|
378
379
|
user: {
|
|
379
380
|
id: string;
|
|
@@ -391,12 +392,12 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
391
392
|
} & {
|
|
392
393
|
updateUser: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<Partial<{}> & {
|
|
393
394
|
name?: string | undefined;
|
|
394
|
-
image?: string | undefined;
|
|
395
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
395
|
+
image?: string | undefined | null;
|
|
396
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
396
397
|
image?: (string | null) | undefined;
|
|
397
398
|
name?: string | undefined;
|
|
398
399
|
fetchOptions?: FetchOptions | undefined;
|
|
399
|
-
} & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
400
|
+
} & Partial<{}>> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
400
401
|
status: boolean;
|
|
401
402
|
}, {
|
|
402
403
|
code?: string | undefined;
|
|
@@ -407,13 +408,13 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
407
408
|
callbackURL?: string | undefined;
|
|
408
409
|
password?: string | undefined;
|
|
409
410
|
token?: string | undefined;
|
|
410
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
411
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
411
412
|
callbackURL?: string | undefined;
|
|
412
413
|
password?: string | undefined;
|
|
413
414
|
token?: string | undefined;
|
|
414
415
|
} & {
|
|
415
416
|
fetchOptions?: FetchOptions | undefined;
|
|
416
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
417
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
417
418
|
success: boolean;
|
|
418
419
|
message: string;
|
|
419
420
|
}, {
|
|
@@ -424,12 +425,12 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
424
425
|
requestPasswordReset: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
|
|
425
426
|
email: string;
|
|
426
427
|
redirectTo?: string | undefined;
|
|
427
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
428
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
428
429
|
email: string;
|
|
429
430
|
redirectTo?: string | undefined;
|
|
430
431
|
} & {
|
|
431
432
|
fetchOptions?: FetchOptions | undefined;
|
|
432
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
433
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
433
434
|
status: boolean;
|
|
434
435
|
message: string;
|
|
435
436
|
}, {
|
|
@@ -442,21 +443,21 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
442
443
|
callbackURL: string;
|
|
443
444
|
}> & Record<string, any>, {
|
|
444
445
|
token: string;
|
|
445
|
-
}>>(data_0: import("better-auth
|
|
446
|
+
}>>(data_0: import("better-auth").Prettify<{
|
|
446
447
|
query: {
|
|
447
448
|
callbackURL: string;
|
|
448
449
|
};
|
|
449
450
|
fetchOptions?: FetchOptions | undefined;
|
|
450
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
451
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<never, {
|
|
451
452
|
code?: string | undefined;
|
|
452
453
|
message?: string | undefined;
|
|
453
454
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
454
455
|
};
|
|
455
456
|
} & {
|
|
456
|
-
listSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
457
|
+
listSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
457
458
|
query?: Record<string, any> | undefined;
|
|
458
459
|
fetchOptions?: FetchOptions | undefined;
|
|
459
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
460
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<import("better-auth").Prettify<{
|
|
460
461
|
id: string;
|
|
461
462
|
createdAt: Date;
|
|
462
463
|
updatedAt: Date;
|
|
@@ -472,31 +473,31 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
472
473
|
} & {
|
|
473
474
|
revokeSession: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
|
|
474
475
|
token: string;
|
|
475
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
476
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
476
477
|
token: string;
|
|
477
478
|
} & {
|
|
478
479
|
fetchOptions?: FetchOptions | undefined;
|
|
479
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
480
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
480
481
|
status: boolean;
|
|
481
482
|
}, {
|
|
482
483
|
code?: string | undefined;
|
|
483
484
|
message?: string | undefined;
|
|
484
485
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
485
486
|
} & {
|
|
486
|
-
revokeSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
487
|
+
revokeSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
487
488
|
query?: Record<string, any> | undefined;
|
|
488
489
|
fetchOptions?: FetchOptions | undefined;
|
|
489
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
490
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
490
491
|
status: boolean;
|
|
491
492
|
}, {
|
|
492
493
|
code?: string | undefined;
|
|
493
494
|
message?: string | undefined;
|
|
494
495
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
495
496
|
} & {
|
|
496
|
-
revokeOtherSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
497
|
+
revokeOtherSessions: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
497
498
|
query?: Record<string, any> | undefined;
|
|
498
499
|
fetchOptions?: FetchOptions | undefined;
|
|
499
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
500
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
500
501
|
status: boolean;
|
|
501
502
|
}, {
|
|
502
503
|
code?: string | undefined;
|
|
@@ -518,7 +519,7 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
518
519
|
errorCallbackURL?: string | undefined;
|
|
519
520
|
disableRedirect?: boolean | undefined;
|
|
520
521
|
additionalData?: Record<string, any> | undefined;
|
|
521
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
522
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
522
523
|
provider: unknown;
|
|
523
524
|
callbackURL?: string | undefined;
|
|
524
525
|
idToken?: {
|
|
@@ -535,7 +536,7 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
535
536
|
additionalData?: Record<string, any> | undefined;
|
|
536
537
|
} & {
|
|
537
538
|
fetchOptions?: FetchOptions | undefined;
|
|
538
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
539
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
539
540
|
url: string;
|
|
540
541
|
redirect: boolean;
|
|
541
542
|
}, {
|
|
@@ -543,10 +544,10 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
543
544
|
message?: string | undefined;
|
|
544
545
|
}, FetchOptions["throw"] extends true ? true : false>>;
|
|
545
546
|
} & {
|
|
546
|
-
listAccounts: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
547
|
+
listAccounts: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
547
548
|
query?: Record<string, any> | undefined;
|
|
548
549
|
fetchOptions?: FetchOptions | undefined;
|
|
549
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
550
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
550
551
|
id: string;
|
|
551
552
|
providerId: string;
|
|
552
553
|
createdAt: Date;
|
|
@@ -563,13 +564,13 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
563
564
|
callback: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
|
|
564
565
|
token: string;
|
|
565
566
|
callbackURL?: string | undefined;
|
|
566
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
567
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
567
568
|
query: {
|
|
568
569
|
token: string;
|
|
569
570
|
callbackURL?: string | undefined;
|
|
570
571
|
};
|
|
571
572
|
fetchOptions?: FetchOptions | undefined;
|
|
572
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
573
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
573
574
|
success: boolean;
|
|
574
575
|
message: string;
|
|
575
576
|
}, {
|
|
@@ -581,12 +582,12 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
581
582
|
unlinkAccount: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
|
|
582
583
|
providerId: string;
|
|
583
584
|
accountId?: string | undefined;
|
|
584
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
585
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
585
586
|
providerId: string;
|
|
586
587
|
accountId?: string | undefined;
|
|
587
588
|
} & {
|
|
588
589
|
fetchOptions?: FetchOptions | undefined;
|
|
589
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
590
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
590
591
|
status: boolean;
|
|
591
592
|
}, {
|
|
592
593
|
code?: string | undefined;
|
|
@@ -597,13 +598,13 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
597
598
|
providerId: string;
|
|
598
599
|
accountId?: string | undefined;
|
|
599
600
|
userId?: string | undefined;
|
|
600
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
601
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
601
602
|
providerId: string;
|
|
602
603
|
accountId?: string | undefined;
|
|
603
604
|
userId?: string | undefined;
|
|
604
605
|
} & {
|
|
605
606
|
fetchOptions?: FetchOptions | undefined;
|
|
606
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
607
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
607
608
|
accessToken: string | undefined;
|
|
608
609
|
refreshToken: string | undefined;
|
|
609
610
|
accessTokenExpiresAt: Date | undefined;
|
|
@@ -621,13 +622,13 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
621
622
|
providerId: string;
|
|
622
623
|
accountId?: string | undefined;
|
|
623
624
|
userId?: string | undefined;
|
|
624
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth
|
|
625
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
625
626
|
providerId: string;
|
|
626
627
|
accountId?: string | undefined;
|
|
627
628
|
userId?: string | undefined;
|
|
628
629
|
} & {
|
|
629
630
|
fetchOptions?: FetchOptions | undefined;
|
|
630
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("
|
|
631
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
631
632
|
accessToken: string;
|
|
632
633
|
accessTokenExpiresAt: Date | undefined;
|
|
633
634
|
scopes: string[];
|
|
@@ -639,12 +640,12 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
639
640
|
} & {
|
|
640
641
|
accountInfo: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
|
|
641
642
|
accountId?: string | undefined;
|
|
642
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
643
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
643
644
|
query?: {
|
|
644
645
|
accountId?: string | undefined;
|
|
645
646
|
} | undefined;
|
|
646
647
|
fetchOptions?: FetchOptions | undefined;
|
|
647
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
648
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
648
649
|
user: import("better-auth").OAuth2UserInfo;
|
|
649
650
|
data: Record<string, any>;
|
|
650
651
|
}, {
|
|
@@ -655,13 +656,13 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
655
656
|
getSession: <FetchOptions extends import("better-auth").ClientFetchOption<never, Partial<{
|
|
656
657
|
disableCookieCache?: unknown;
|
|
657
658
|
disableRefresh?: unknown;
|
|
658
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth
|
|
659
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import("better-auth").Prettify<{
|
|
659
660
|
query?: {
|
|
660
661
|
disableCookieCache?: unknown;
|
|
661
662
|
disableRefresh?: unknown;
|
|
662
663
|
} | undefined;
|
|
663
664
|
fetchOptions?: FetchOptions | undefined;
|
|
664
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("
|
|
665
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import("better-auth/client").BetterFetchResponse<{
|
|
665
666
|
user: {
|
|
666
667
|
id: string;
|
|
667
668
|
createdAt: Date;
|
|
@@ -710,7 +711,7 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
710
711
|
} | null;
|
|
711
712
|
isPending: boolean;
|
|
712
713
|
isRefetching: boolean;
|
|
713
|
-
error: import("
|
|
714
|
+
error: import("better-auth/client").BetterFetchError | null;
|
|
714
715
|
refetch: (queryParams?: {
|
|
715
716
|
query?: import("better-auth").SessionQueryParams;
|
|
716
717
|
} | undefined) => Promise<void>;
|
|
@@ -738,21 +739,21 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
738
739
|
};
|
|
739
740
|
};
|
|
740
741
|
};
|
|
741
|
-
$fetch: import("
|
|
742
|
-
plugins: (import("
|
|
742
|
+
$fetch: import("better-auth/client").BetterFetch<{
|
|
743
|
+
plugins: (import("better-auth/client").BetterFetchPlugin<Record<string, any>> | {
|
|
743
744
|
id: string;
|
|
744
745
|
name: string;
|
|
745
746
|
hooks: {
|
|
746
|
-
onSuccess(context: import("
|
|
747
|
+
onSuccess(context: import("better-auth/client").SuccessContext<any>): void;
|
|
747
748
|
};
|
|
748
749
|
} | {
|
|
749
750
|
id: string;
|
|
750
751
|
name: string;
|
|
751
752
|
hooks: {
|
|
752
|
-
onSuccess: ((context: import("
|
|
753
|
-
onError: ((context: import("
|
|
754
|
-
onRequest: (<T extends Record<string, any>>(context: import("
|
|
755
|
-
onResponse: ((context: import("
|
|
753
|
+
onSuccess: ((context: import("better-auth/client").SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
754
|
+
onError: ((context: import("better-auth/client").ErrorContext) => Promise<void> | void) | undefined;
|
|
755
|
+
onRequest: (<T extends Record<string, any>>(context: import("better-auth/client").RequestContext<T>) => Promise<import("better-auth/client").RequestContext | void> | import("better-auth/client").RequestContext | void) | undefined;
|
|
756
|
+
onResponse: ((context: import("better-auth/client").ResponseContext) => Promise<Response | void | import("better-auth/client").ResponseContext> | Response | import("better-auth/client").ResponseContext | void) | undefined;
|
|
756
757
|
};
|
|
757
758
|
})[];
|
|
758
759
|
cache?: RequestCache | undefined;
|
|
@@ -772,12 +773,12 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
772
773
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
773
774
|
signal?: (AbortSignal | null) | undefined;
|
|
774
775
|
window?: null | undefined;
|
|
775
|
-
onRetry?: ((response: import("
|
|
776
|
+
onRetry?: ((response: import("better-auth/client").ResponseContext) => Promise<void> | void) | undefined;
|
|
776
777
|
hookOptions?: {
|
|
777
778
|
cloneResponse?: boolean;
|
|
778
779
|
} | undefined;
|
|
779
780
|
timeout?: number | undefined;
|
|
780
|
-
customFetchImpl: import("
|
|
781
|
+
customFetchImpl: import("better-auth/client").FetchEsque;
|
|
781
782
|
baseURL: string;
|
|
782
783
|
throw?: boolean | undefined;
|
|
783
784
|
auth?: ({
|
|
@@ -797,20 +798,62 @@ export declare function createAuth(config: AuthConfig): {
|
|
|
797
798
|
params?: any;
|
|
798
799
|
duplex?: "full" | "half" | undefined;
|
|
799
800
|
jsonParser: (text: string) => Promise<any> | any;
|
|
800
|
-
retry?: import("
|
|
801
|
+
retry?: import("better-auth/client").RetryOptions | undefined;
|
|
801
802
|
retryAttempt?: number | undefined;
|
|
802
|
-
output?: (import("
|
|
803
|
-
errorSchema?: import("
|
|
803
|
+
output?: (import("better-auth/client").StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
804
|
+
errorSchema?: import("better-auth/client").StandardSchemaV1 | undefined;
|
|
804
805
|
disableValidation?: boolean | undefined;
|
|
805
806
|
disableSignal?: boolean | undefined;
|
|
806
807
|
}, unknown, unknown, {}>;
|
|
807
808
|
$store: {
|
|
808
809
|
notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
|
|
809
810
|
listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
|
|
810
|
-
atoms: Record<string, import("
|
|
811
|
+
atoms: Record<string, import("better-auth/client").WritableAtom<any>>;
|
|
811
812
|
};
|
|
812
813
|
$ERROR_CODES: {
|
|
813
|
-
|
|
814
|
+
readonly USER_NOT_FOUND: "User not found";
|
|
815
|
+
readonly FAILED_TO_CREATE_USER: "Failed to create user";
|
|
816
|
+
readonly FAILED_TO_CREATE_SESSION: "Failed to create session";
|
|
817
|
+
readonly FAILED_TO_UPDATE_USER: "Failed to update user";
|
|
818
|
+
readonly FAILED_TO_GET_SESSION: "Failed to get session";
|
|
819
|
+
readonly INVALID_PASSWORD: "Invalid password";
|
|
820
|
+
readonly INVALID_EMAIL: "Invalid email";
|
|
821
|
+
readonly INVALID_EMAIL_OR_PASSWORD: "Invalid email or password";
|
|
822
|
+
readonly SOCIAL_ACCOUNT_ALREADY_LINKED: "Social account already linked";
|
|
823
|
+
readonly PROVIDER_NOT_FOUND: "Provider not found";
|
|
824
|
+
readonly INVALID_TOKEN: "Invalid token";
|
|
825
|
+
readonly ID_TOKEN_NOT_SUPPORTED: "id_token not supported";
|
|
826
|
+
readonly FAILED_TO_GET_USER_INFO: "Failed to get user info";
|
|
827
|
+
readonly USER_EMAIL_NOT_FOUND: "User email not found";
|
|
828
|
+
readonly EMAIL_NOT_VERIFIED: "Email not verified";
|
|
829
|
+
readonly PASSWORD_TOO_SHORT: "Password too short";
|
|
830
|
+
readonly PASSWORD_TOO_LONG: "Password too long";
|
|
831
|
+
readonly USER_ALREADY_EXISTS: "User already exists.";
|
|
832
|
+
readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
|
|
833
|
+
readonly EMAIL_CAN_NOT_BE_UPDATED: "Email can not be updated";
|
|
834
|
+
readonly CREDENTIAL_ACCOUNT_NOT_FOUND: "Credential account not found";
|
|
835
|
+
readonly SESSION_EXPIRED: "Session expired. Re-authenticate to perform this action.";
|
|
836
|
+
readonly FAILED_TO_UNLINK_LAST_ACCOUNT: "You can't unlink your last account";
|
|
837
|
+
readonly ACCOUNT_NOT_FOUND: "Account not found";
|
|
838
|
+
readonly USER_ALREADY_HAS_PASSWORD: "User already has a password. Provide that to delete the account.";
|
|
839
|
+
readonly CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: "Cross-site navigation login blocked. This request appears to be a CSRF attack.";
|
|
840
|
+
readonly VERIFICATION_EMAIL_NOT_ENABLED: "Verification email isn't enabled";
|
|
841
|
+
readonly EMAIL_ALREADY_VERIFIED: "Email is already verified";
|
|
842
|
+
readonly EMAIL_MISMATCH: "Email mismatch";
|
|
843
|
+
readonly SESSION_NOT_FRESH: "Session is not fresh";
|
|
844
|
+
readonly LINKED_ACCOUNT_ALREADY_EXISTS: "Linked account already exists";
|
|
845
|
+
readonly INVALID_ORIGIN: "Invalid origin";
|
|
846
|
+
readonly INVALID_CALLBACK_URL: "Invalid callbackURL";
|
|
847
|
+
readonly INVALID_REDIRECT_URL: "Invalid redirectURL";
|
|
848
|
+
readonly INVALID_ERROR_CALLBACK_URL: "Invalid errorCallbackURL";
|
|
849
|
+
readonly INVALID_NEW_USER_CALLBACK_URL: "Invalid newUserCallbackURL";
|
|
850
|
+
readonly MISSING_OR_NULL_ORIGIN: "Missing or null Origin";
|
|
851
|
+
readonly CALLBACK_URL_REQUIRED: "callbackURL is required";
|
|
852
|
+
readonly FAILED_TO_CREATE_VERIFICATION: "Unable to create verification";
|
|
853
|
+
readonly FIELD_NOT_ALLOWED: "Field not allowed to be set";
|
|
854
|
+
readonly ASYNC_VALIDATION_NOT_SUPPORTED: "Async validation is not supported";
|
|
855
|
+
readonly VALIDATION_ERROR: "Validation Error";
|
|
856
|
+
readonly MISSING_FIELD: "Field is required";
|
|
814
857
|
};
|
|
815
858
|
};
|
|
816
859
|
getCurrentUser: () => import("./types").SessionUser | null;
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAUH,OAAO,KAAK,EACV,UAAU,EAEV,YAAY,EACZ,4BAA4B,EAC5B,oBAAoB,EAIrB,MAAM,SAAS,CAAA;AAEhB,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA0HtB,CAAC;;;;yBAsB2iD,CAAC;;;;;;;;;;qCA1EvjD,4BAA4B,KACpC,OAAO,CAAC,YAAY,CAAC;6BAUc,oBAAoB,KAAG,OAAO,CAAC,IAAI,CAAC;mDAUxD,MAAM,UACd,MAAM,KACb,OAAO,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA1ER,CAAC;qBAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+C1B,CAAC;;mBACP,CAAC;;;;;oBAOgE,CAAC;uBAGxC,CAAC;qBACxB,CAAC;qBAGK,CAAC;gBAA+B,CAAC;oBACxC,CAAC;oBAA2C,CAAC;0BAC1C,CAAC;kBACgB,CAAC;kBACtB,CAAF;mBAEwB,CAAC;uBAKvB,CAAC;6BACI,CAAC;;mBACa,CAAA;;;iBAEF,CAAC;gBAGE,CAAC;;;;;;;;;;;;gBAyBI,CAAC;iBAChB,CAAC;kBAGX,CAAA;kBAAiB,CAAC;;iBAEM,CAAC;wBAExB,CAAC;kBACF,CAAF;uBAEI,CAAA;6BACoC,CAAC;yBAE9B,CAAC;;;2BAC+B,CAAC;mHAKwE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAV/F,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;;;;;EAO7C;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA"}
|
package/dist/core.js
CHANGED
|
@@ -28,6 +28,7 @@ import { createAuthComputed } from "./store/computed";
|
|
|
28
28
|
import { waitForAuth as waitForAuthUtil, createUserManager } from "./store/utils";
|
|
29
29
|
import { createApiClient, createAuthApi, createOrganizationApi, createTeamApi } from "./api";
|
|
30
30
|
import { createAuthService } from "./services/auth-service";
|
|
31
|
+
import { createReferralService } from "./services/referral-service";
|
|
31
32
|
export function createAuth(config) {
|
|
32
33
|
// ============================================================
|
|
33
34
|
// 1. Better Auth 客户端
|
|
@@ -73,6 +74,7 @@ export function createAuth(config) {
|
|
|
73
74
|
signOut: authClient.signOut,
|
|
74
75
|
signUp: signUp ? { email: signUp.email } : undefined,
|
|
75
76
|
});
|
|
77
|
+
const referralService = createReferralService(apiClient);
|
|
76
78
|
// ============================================================
|
|
77
79
|
// 5. Active 状态管理
|
|
78
80
|
// ============================================================
|
|
@@ -113,6 +115,7 @@ export function createAuth(config) {
|
|
|
113
115
|
storeActions,
|
|
114
116
|
// Service Layer
|
|
115
117
|
authService,
|
|
118
|
+
referralService,
|
|
116
119
|
// Active 状态管理
|
|
117
120
|
setActiveOrganization,
|
|
118
121
|
setActiveTeam,
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export { createAuthStore, createTokenStorage } from "./store/state";
|
|
|
16
16
|
export { createStoreActions, type StoreActions } from "./store/actions";
|
|
17
17
|
export { createAuthComputed } from "./store/computed";
|
|
18
18
|
export { getCurrentUser, getCurrentUserId, isAuthenticated, isLoading, isLoaded, waitForAuth, getAuthToken, getAuthTokenSync, getAuthHeaders, getAuthHeadersSync, handle401Response, createUserManager, } from "./store/utils";
|
|
19
|
-
export { createAuthService, type AuthService, type AuthServiceConfig, type BetterAuthClientMethods, setupCompanionTeam, createCallbackService, type CallbackService, } from "./services";
|
|
19
|
+
export { createAuthService, type AuthService, type AuthServiceConfig, type BetterAuthClientMethods, setupCompanionTeam, createCallbackService, type CallbackService, createReferralService, needsReferral, getReferralFields, type ReferralService, type ReferralResponse, type ReferralErrorType, type ReferralResult, type NeedsReferralOptions, } from "./services";
|
|
20
20
|
export { createApiClient, createAuthApi, createOrganizationApi, createTeamApi, parseErrorResponse, } from "./api";
|
|
21
21
|
export type { ApiClient, ApiClientConfig, ApiResponse, TokenStorage, UnauthorizedHandler, AuthApi, OrganizationApi, TeamApi, } from "./api";
|
|
22
22
|
export { useAuthInit, initializeAuth, useAuthSync, type UseAuthSyncConfig, type UseAuthSyncResult, useProtectedRoute, type UseProtectedRouteConfig, type UseProtectedRouteResult, type ProtectionStatus, useEmailVerification, type UseEmailVerificationConfig, type UseEmailVerificationResult, } from "./hooks";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAM5C,YAAY,EAEV,WAAW,EACX,mBAAmB,EACnB,OAAO,EACP,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAEhB,OAAO,EAEP,WAAW,EACX,oBAAoB,EAEpB,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,4BAA4B,EAC5B,gBAAgB,EAChB,UAAU,EACV,MAAM,EACN,UAAU,EACV,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,EAElB,IAAI,EACJ,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACV,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EAEtB,YAAY,EACZ,cAAc,EACd,cAAc,GACf,MAAM,SAAS,CAAA;AAMhB,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,eAAe,CAAA;AAMtB,OAAO,EAEL,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAE5B,kBAAkB,EAElB,qBAAqB,EACrB,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,9 @@ createAuthService,
|
|
|
30
30
|
// 伴生团队
|
|
31
31
|
setupCompanionTeam,
|
|
32
32
|
// 回调服务
|
|
33
|
-
createCallbackService,
|
|
33
|
+
createCallbackService,
|
|
34
|
+
// 邀请码服务
|
|
35
|
+
createReferralService, needsReferral, getReferralFields, } from "./services";
|
|
34
36
|
// ============================================================
|
|
35
37
|
// API Layer - HTTP 请求
|
|
36
38
|
// ============================================================
|