entropic-bond 1.59.3 → 1.59.4
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/lib/auth/auth-mock.d.ts +6 -6
- package/lib/auth/auth.d.ts +9 -9
- package/lib/auth/user-auth-types.d.ts +4 -1
- package/lib/entropic-bond.js +4 -1
- package/lib/entropic-bond.js.map +1 -1
- package/lib/entropic-bond.umd.cjs +1 -1
- package/lib/entropic-bond.umd.cjs.map +1 -1
- package/lib/persistent/persistent.d.ts +1 -2
- package/lib/server-auth/server-auth-mock.d.ts +3 -3
- package/lib/store/data-source.d.ts +1 -1
- package/lib/types/utility-types.d.ts +2 -2
- package/lib/utils/utils.d.ts +1 -1
- package/package.json +3 -3
package/lib/auth/auth-mock.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Collection } from '../types/utility-types';
|
|
2
2
|
import { AuthService } from './auth';
|
|
3
|
-
import { UserCredentials, SignData, AuthProvider } from './user-auth-types';
|
|
3
|
+
import { UserCredentials, SignData, AuthProvider, CredentialsCustomData } from './user-auth-types';
|
|
4
4
|
export declare class AuthMock extends AuthService {
|
|
5
|
-
signUp<T extends
|
|
6
|
-
login<T extends
|
|
7
|
-
onAuthStateChange<T extends
|
|
5
|
+
signUp<T extends CredentialsCustomData>(signData: SignData): Promise<UserCredentials<T>>;
|
|
6
|
+
login<T extends CredentialsCustomData>(signData: SignData): Promise<UserCredentials<T>>;
|
|
7
|
+
onAuthStateChange<T extends CredentialsCustomData>(onChange: (userCredentials: UserCredentials<T>) => void): void;
|
|
8
8
|
logout(): Promise<void>;
|
|
9
9
|
resetEmailPassword(email: string): Promise<void>;
|
|
10
10
|
resendVerificationEmail(email: string, _password: string, _verificationLink: string): Promise<void>;
|
|
@@ -12,8 +12,8 @@ export declare class AuthMock extends AuthService {
|
|
|
12
12
|
linkAdditionalProvider(provider: AuthProvider): Promise<unknown>;
|
|
13
13
|
unlinkProvider(provider: AuthProvider): Promise<unknown>;
|
|
14
14
|
flush(): Promise<void>;
|
|
15
|
-
fakeRegisteredUser<T extends
|
|
16
|
-
get fakeRegisteredUsers(): Collection<UserCredentials<
|
|
15
|
+
fakeRegisteredUser<T extends CredentialsCustomData>(userCredentials: UserCredentials<T>): this;
|
|
16
|
+
get fakeRegisteredUsers(): Collection<UserCredentials<CredentialsCustomData>>;
|
|
17
17
|
private userCredentials;
|
|
18
18
|
private pendingPromises;
|
|
19
19
|
private _loggedUser;
|
package/lib/auth/auth.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { AuthProvider, SignData, UserCredentials } from './user-auth-types';
|
|
1
|
+
import { AuthProvider, CredentialsCustomData, SignData, UserCredentials } from './user-auth-types';
|
|
2
2
|
/**
|
|
3
3
|
* The AuthService class is an abstract class that defines the interface of an authentication service.
|
|
4
4
|
* You should derive from this class to implement your own authentication service.
|
|
5
5
|
*/
|
|
6
6
|
export declare abstract class AuthService {
|
|
7
|
-
abstract signUp<T extends
|
|
8
|
-
abstract login<T extends
|
|
7
|
+
abstract signUp<T extends CredentialsCustomData>(signData: SignData): Promise<UserCredentials<T>>;
|
|
8
|
+
abstract login<T extends CredentialsCustomData>(signData: SignData): Promise<UserCredentials<T>>;
|
|
9
9
|
abstract logout(): Promise<void>;
|
|
10
10
|
abstract resetEmailPassword(email: string): Promise<void>;
|
|
11
11
|
abstract refreshToken(): Promise<void>;
|
|
12
12
|
abstract linkAdditionalProvider(provider: AuthProvider): Promise<unknown>;
|
|
13
13
|
abstract unlinkProvider(provider: AuthProvider): Promise<unknown>;
|
|
14
|
-
abstract onAuthStateChange<T extends
|
|
14
|
+
abstract onAuthStateChange<T extends CredentialsCustomData>(onChange: (userCredentials: UserCredentials<T> | undefined) => void): void;
|
|
15
15
|
abstract resendVerificationEmail(email: string, password: string, verificationLink: string): Promise<void>;
|
|
16
16
|
}
|
|
17
17
|
export type AuthErrorCode = 'wrongPassword' | 'popupClosedByUser' | 'userNotFound' | 'invalidEmail' | 'missingPassword' | 'missingEmail';
|
|
@@ -22,7 +22,7 @@ export interface AuthError {
|
|
|
22
22
|
/**
|
|
23
23
|
* Types the callback to accept a user credentials object
|
|
24
24
|
*/
|
|
25
|
-
export type ResovedCallback<T extends
|
|
25
|
+
export type ResovedCallback<T extends CredentialsCustomData> = (credentials: UserCredentials<T>) => void;
|
|
26
26
|
export type RejectedCallback = (reason: AuthError) => void;
|
|
27
27
|
/**
|
|
28
28
|
* The Auth class is a singleton that provides a unified interface to the authentication service.
|
|
@@ -55,7 +55,7 @@ export declare class Auth extends AuthService {
|
|
|
55
55
|
* // Sign up a new user with a Google account
|
|
56
56
|
* Auth.instance.signUp({ authProvider: 'google'})
|
|
57
57
|
*/
|
|
58
|
-
signUp<T extends
|
|
58
|
+
signUp<T extends CredentialsCustomData>(singData: SignData): Promise<UserCredentials<T>>;
|
|
59
59
|
/**
|
|
60
60
|
* Logs in an existing user
|
|
61
61
|
* @param singData the data to be used to log in the user
|
|
@@ -66,7 +66,7 @@ export declare class Auth extends AuthService {
|
|
|
66
66
|
* // Log in an existing user with a Google account
|
|
67
67
|
* Auth.instance.login({ authProvider: 'google'})
|
|
68
68
|
*/
|
|
69
|
-
login<T extends
|
|
69
|
+
login<T extends CredentialsCustomData>(singData: SignData): Promise<UserCredentials<T>>;
|
|
70
70
|
/**
|
|
71
71
|
* Logs out the current user
|
|
72
72
|
* @returns a promise that resolves when the user is logged out
|
|
@@ -100,12 +100,12 @@ export declare class Auth extends AuthService {
|
|
|
100
100
|
* }
|
|
101
101
|
* })
|
|
102
102
|
*/
|
|
103
|
-
onAuthStateChange<T extends
|
|
103
|
+
onAuthStateChange<T extends CredentialsCustomData>(onChange: (userCredentials: UserCredentials<T>) => void): import('..').Unsubscriber;
|
|
104
104
|
/**
|
|
105
105
|
* Removes a listener that was added by `onAuthStateChange` method.
|
|
106
106
|
* @param onChange the listener to be removed
|
|
107
107
|
*/
|
|
108
|
-
removeAuthStateChange<T extends
|
|
108
|
+
removeAuthStateChange<T extends CredentialsCustomData>(onChange: (userCredentials: UserCredentials<T>) => void): void;
|
|
109
109
|
/**
|
|
110
110
|
* Links an additional authentication provider to the authenticated user.
|
|
111
111
|
* @param provider the provider to be linked
|
package/lib/entropic-bond.js
CHANGED
|
@@ -797,7 +797,10 @@ var S = class extends c {
|
|
|
797
797
|
return {
|
|
798
798
|
limit: (t) => e,
|
|
799
799
|
operations: (t) => this.retrieveQueryDocs(e, t),
|
|
800
|
-
sort: ({ order: t, propertyName: n }) => e.sort((e, r) =>
|
|
800
|
+
sort: ({ order: t, propertyName: n }) => e.sort((e, r) => {
|
|
801
|
+
let i = this.deepValue(e, n), a = this.deepValue(r, n);
|
|
802
|
+
return t === "asc" ? i > a ? 1 : -1 : i < a ? 1 : -1;
|
|
803
|
+
})
|
|
801
804
|
}[t](n);
|
|
802
805
|
}
|
|
803
806
|
retrieveQueryDocs(e, t) {
|