@accounts/types
Advanced tools
Comparing version 0.26.0-alpha.2 to 0.26.0-alpha.3
import { User } from './user'; | ||
import { DatabaseInterface } from './database-interface'; | ||
export interface AuthenticationService { | ||
export interface AuthenticationService<CustomUser extends User = User> { | ||
server: any; | ||
serviceName: string; | ||
setStore(store: DatabaseInterface): void; | ||
authenticate(params: any): Promise<User | null>; | ||
authenticate(params: any): Promise<CustomUser | null>; | ||
} |
@@ -9,3 +9,3 @@ import { DatabaseInterface } from '../database-interface'; | ||
setStore(store: DatabaseInterface): void; | ||
associate(userId: string, params: any, infos: ConnectionInformations): Promise<any>; | ||
associate(userIdOrMfaChallenge: string | MfaChallenge, params: any, infos: ConnectionInformations): Promise<any>; | ||
challenge?(mfaChallenge: MfaChallenge, authenticator: Authenticator, infos: ConnectionInformations): Promise<any>; | ||
@@ -12,0 +12,0 @@ authenticate(mfaChallenge: MfaChallenge, authenticator: Authenticator, params: any, infos: ConnectionInformations): Promise<boolean>; |
@@ -7,6 +7,6 @@ import { User } from './user'; | ||
import { DatabaseInterfaceMfaChallenges } from './mfa-challenge/database-interface'; | ||
export interface DatabaseInterface extends DatabaseInterfaceSessions, DatabaseInterfaceServicePassword, DatabaseInterfaceAuthenticators, DatabaseInterfaceMfaChallenges { | ||
findUserById(userId: string): Promise<User | null>; | ||
export interface DatabaseInterface<CustomUser extends User = User> extends DatabaseInterfaceSessions, DatabaseInterfaceServicePassword<CustomUser>, DatabaseInterfaceAuthenticators, DatabaseInterfaceMfaChallenges { | ||
findUserById(userId: string): Promise<CustomUser | null>; | ||
createUser(user: CreateUser): Promise<string>; | ||
findUserByServiceId(serviceName: string, serviceId: string): Promise<User | null>; | ||
findUserByServiceId(serviceName: string, serviceId: string): Promise<CustomUser | null>; | ||
setService(userId: string, serviceName: string, data: object): Promise<void>; | ||
@@ -13,0 +13,0 @@ unsetService(userId: string, serviceName: string): Promise<void>; |
import { User } from '../../user'; | ||
export interface DatabaseInterfaceServicePassword { | ||
findUserByEmail(email: string): Promise<User | null>; | ||
findUserByUsername(username: string): Promise<User | null>; | ||
findUserByResetPasswordToken(token: string): Promise<User | null>; | ||
findUserByEmailVerificationToken(token: string): Promise<User | null>; | ||
export interface DatabaseInterfaceServicePassword<CustomUser extends User = User> { | ||
findUserByEmail(email: string): Promise<CustomUser | null>; | ||
findUserByUsername(username: string): Promise<CustomUser | null>; | ||
findUserByResetPasswordToken(token: string): Promise<CustomUser | null>; | ||
findUserByEmailVerificationToken(token: string): Promise<CustomUser | null>; | ||
findPasswordHash(userId: string): Promise<string | null>; | ||
@@ -8,0 +8,0 @@ setPassword(userId: string, newPassword: string): Promise<void>; |
{ | ||
"name": "@accounts/types", | ||
"version": "0.26.0-alpha.2", | ||
"version": "0.26.0-alpha.3", | ||
"description": "Accounts-js Types", | ||
@@ -51,3 +51,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "ad0914817551b832a11600613981ae5dba11c09d" | ||
"gitHead": "c117b8980f2153d497be744f1280bb2db2470514" | ||
} |
@@ -7,7 +7,7 @@ import { User } from './user'; | ||
export interface AuthenticationService { | ||
export interface AuthenticationService<CustomUser extends User = User> { | ||
server: any; | ||
serviceName: string; | ||
setStore(store: DatabaseInterface): void; | ||
authenticate(params: any): Promise<User | null>; | ||
authenticate(params: any): Promise<CustomUser | null>; | ||
} |
@@ -10,3 +10,7 @@ import { DatabaseInterface } from '../database-interface'; | ||
setStore(store: DatabaseInterface): void; | ||
associate(userId: string, params: any, infos: ConnectionInformations): Promise<any>; | ||
associate( | ||
userIdOrMfaChallenge: string | MfaChallenge, | ||
params: any, | ||
infos: ConnectionInformations | ||
): Promise<any>; | ||
challenge?( | ||
@@ -13,0 +17,0 @@ mfaChallenge: MfaChallenge, |
@@ -8,9 +8,9 @@ import { User } from './user'; | ||
export interface DatabaseInterface | ||
export interface DatabaseInterface<CustomUser extends User = User> | ||
extends DatabaseInterfaceSessions, | ||
DatabaseInterfaceServicePassword, | ||
DatabaseInterfaceServicePassword<CustomUser>, | ||
DatabaseInterfaceAuthenticators, | ||
DatabaseInterfaceMfaChallenges { | ||
// Find user by identity fields | ||
findUserById(userId: string): Promise<User | null>; | ||
findUserById(userId: string): Promise<CustomUser | null>; | ||
@@ -21,3 +21,3 @@ // Create and update users | ||
// Auth services related operations | ||
findUserByServiceId(serviceName: string, serviceId: string): Promise<User | null>; | ||
findUserByServiceId(serviceName: string, serviceId: string): Promise<CustomUser | null>; | ||
@@ -24,0 +24,0 @@ setService(userId: string, serviceName: string, data: object): Promise<void>; |
import { User } from '../../user'; | ||
export interface DatabaseInterfaceServicePassword { | ||
findUserByEmail(email: string): Promise<User | null>; | ||
export interface DatabaseInterfaceServicePassword<CustomUser extends User = User> { | ||
findUserByEmail(email: string): Promise<CustomUser | null>; | ||
findUserByUsername(username: string): Promise<User | null>; | ||
findUserByUsername(username: string): Promise<CustomUser | null>; | ||
findUserByResetPasswordToken(token: string): Promise<User | null>; | ||
findUserByResetPasswordToken(token: string): Promise<CustomUser | null>; | ||
findUserByEmailVerificationToken(token: string): Promise<User | null>; | ||
findUserByEmailVerificationToken(token: string): Promise<CustomUser | null>; | ||
@@ -12,0 +12,0 @@ findPasswordHash(userId: string): Promise<string | null>; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64693
1142