@cauth/core 0.0.7 → 0.0.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/index.d.ts +7 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -100,7 +100,7 @@ type FNError = {
|
|
|
100
100
|
* @template T - The type of the value.
|
|
101
101
|
* @template E - The type of the errors, which must extend { type: string; error: Error }.
|
|
102
102
|
*/
|
|
103
|
-
type Result
|
|
103
|
+
type Result<T, E extends FNError = FNError> = {
|
|
104
104
|
success: true;
|
|
105
105
|
value: T;
|
|
106
106
|
} | {
|
|
@@ -298,7 +298,7 @@ declare class _CAuth<T extends string[], TContractor extends RoutesContract<any>
|
|
|
298
298
|
FN: {
|
|
299
299
|
Login: ({
|
|
300
300
|
...args
|
|
301
|
-
}: LoginSchemaType) => Promise<Result
|
|
301
|
+
}: LoginSchemaType) => Promise<Result<{
|
|
302
302
|
account: Account;
|
|
303
303
|
tokens: Tokens;
|
|
304
304
|
}>>;
|
|
@@ -310,10 +310,10 @@ declare class _CAuth<T extends string[], TContractor extends RoutesContract<any>
|
|
|
310
310
|
}>>;
|
|
311
311
|
Logout: ({
|
|
312
312
|
...args
|
|
313
|
-
}: LogoutSchemaType) => Promise<Result<
|
|
313
|
+
}: LogoutSchemaType) => Promise<Result<unknown>>;
|
|
314
314
|
Refresh: ({
|
|
315
315
|
...args
|
|
316
|
-
}: RefreshTokenSchemaType) => Promise<Result
|
|
316
|
+
}: RefreshTokenSchemaType) => Promise<Result<{
|
|
317
317
|
account: Account;
|
|
318
318
|
tokens: Tokens;
|
|
319
319
|
}>>;
|
|
@@ -326,13 +326,13 @@ declare class _CAuth<T extends string[], TContractor extends RoutesContract<any>
|
|
|
326
326
|
password?: string;
|
|
327
327
|
usePassword?: boolean;
|
|
328
328
|
otpPurpose: OtpPurpose;
|
|
329
|
-
}) => Promise<Result
|
|
329
|
+
}) => Promise<Result<{
|
|
330
330
|
id: string;
|
|
331
331
|
code: string;
|
|
332
332
|
}>>;
|
|
333
333
|
LoginWithOTP: (args: Omit<LoginSchemaType, "password"> & {
|
|
334
334
|
code: string;
|
|
335
|
-
}) => Promise<Result
|
|
335
|
+
}) => Promise<Result<{
|
|
336
336
|
account: Account;
|
|
337
337
|
tokens: Tokens;
|
|
338
338
|
}>>;
|
|
@@ -340,7 +340,7 @@ declare class _CAuth<T extends string[], TContractor extends RoutesContract<any>
|
|
|
340
340
|
id: string;
|
|
341
341
|
code: string;
|
|
342
342
|
otpPurpose: OtpPurpose;
|
|
343
|
-
}) => Promise<Result
|
|
343
|
+
}) => Promise<Result<{
|
|
344
344
|
isValid: boolean;
|
|
345
345
|
}>>;
|
|
346
346
|
};
|