@accounts/types
Advanced tools
Comparing version 0.25.1 to 0.25.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>; | ||
} |
export interface ConnectionInformations { | ||
ip?: string; | ||
userAgent?: string; | ||
ip?: string | null; | ||
userAgent?: string | null; | ||
} |
@@ -5,6 +5,6 @@ import { User } from './user'; | ||
import { DatabaseInterfaceServicePassword } from './services/password/database-interface'; | ||
export interface DatabaseInterface extends DatabaseInterfaceSessions, DatabaseInterfaceServicePassword { | ||
findUserById(userId: string): Promise<User | null>; | ||
export interface DatabaseInterface<CustomUser extends User = User> extends DatabaseInterfaceSessions, DatabaseInterfaceServicePassword<CustomUser> { | ||
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>; | ||
@@ -11,0 +11,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>; |
@@ -6,6 +6,6 @@ export interface Session { | ||
valid: boolean; | ||
userAgent?: string; | ||
ip?: string; | ||
userAgent?: string | null; | ||
ip?: string | null; | ||
createdAt: string; | ||
updatedAt: string; | ||
} |
{ | ||
"name": "@accounts/types", | ||
"version": "0.25.1", | ||
"version": "0.25.3", | ||
"description": "Accounts-js Types", | ||
@@ -43,11 +43,11 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"tslib": "1.10.0" | ||
"tslib": "1.11.2" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "25.1.4", | ||
"@types/node": "13.9.8", | ||
"jest": "25.1.0", | ||
"rimraf": "3.0.0" | ||
"@types/jest": "25.2.1", | ||
"@types/node": "13.13.5", | ||
"jest": "26.0.1", | ||
"rimraf": "3.0.2" | ||
}, | ||
"gitHead": "18c02edee2a382236923b4b6c221362dba3c7bb9" | ||
"gitHead": "77c35ef4c767555f10aed242e2032a17130af0bf" | ||
} |
@@ -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>; | ||
} |
export interface ConnectionInformations { | ||
ip?: string; | ||
userAgent?: string; | ||
ip?: string | null; | ||
userAgent?: string | null; | ||
} |
@@ -6,7 +6,7 @@ import { User } from './user'; | ||
export interface DatabaseInterface | ||
export interface DatabaseInterface<CustomUser extends User = User> | ||
extends DatabaseInterfaceSessions, | ||
DatabaseInterfaceServicePassword { | ||
DatabaseInterfaceServicePassword<CustomUser> { | ||
// Find user by identity fields | ||
findUserById(userId: string): Promise<User | null>; | ||
findUserById(userId: string): Promise<CustomUser | null>; | ||
@@ -17,3 +17,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>; | ||
@@ -20,0 +20,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>; |
@@ -6,6 +6,6 @@ export interface Session { | ||
valid: boolean; | ||
userAgent?: string; | ||
ip?: string; | ||
userAgent?: string | null; | ||
ip?: string | null; | ||
createdAt: string; | ||
updatedAt: string; | ||
} |
53722
+ Addedtslib@1.11.2(transitive)
- Removedtslib@1.10.0(transitive)
Updatedtslib@1.11.2