@accounts/types
Advanced tools
Comparing version 0.19.0 to 0.19.1-alpha.2.17
@@ -10,2 +10,4 @@ export * from './types/database-interface'; | ||
export * from './types/login-result'; | ||
export * from './types/mfa-login-result'; | ||
export * from './types/mfa-login-attempt'; | ||
export * from './types/impersonation-result'; | ||
@@ -12,0 +14,0 @@ export * from './types/login-user-identity'; |
export interface CreateUser { | ||
username?: string; | ||
email?: string; | ||
mfaChallenges?: string[]; | ||
[additionalKey: string]: any; | ||
} |
import { User } from './user'; | ||
import { Session } from './session'; | ||
import { MfaLoginAttempt } from './mfa-login-attempt'; | ||
import { CreateUser } from './create-user'; | ||
import { ConnectionInformations } from './connection-informations'; | ||
export interface DatabaseInterface extends DatabaseInterfaceSessions { | ||
export interface DatabaseInterface extends DatabaseInterfaceSessions, DatabaseInterfaceMfaLoginAttempts { | ||
findUserByEmail(email: string): Promise<User | null>; | ||
@@ -26,2 +27,7 @@ findUserByUsername(username: string): Promise<User | null>; | ||
} | ||
export interface DatabaseInterfaceMfaLoginAttempts { | ||
createMfaLoginAttempt(mfaToken: string, loginToken: string, userId: string): Promise<void>; | ||
getMfaLoginAttempt(mfaToken: string): Promise<MfaLoginAttempt | null>; | ||
removeMfaLoginAttempt(mfaToken: string): Promise<void>; | ||
} | ||
export interface DatabaseInterfaceSessions { | ||
@@ -31,5 +37,5 @@ findSessionById(sessionId: string): Promise<Session | null>; | ||
createSession(userId: string, token: string, connection: ConnectionInformations, extraData?: object): Promise<string>; | ||
updateSession(sessionId: string, connection: ConnectionInformations): Promise<void>; | ||
updateSession(sessionId: string, connection: ConnectionInformations, newToken?: string): Promise<void>; | ||
invalidateSession(sessionId: string): Promise<void>; | ||
invalidateAllSessions(userId: string): Promise<void>; | ||
} |
@@ -8,2 +8,3 @@ import { EmailRecord } from './email-record'; | ||
deactivated: boolean; | ||
mfaChallenges?: string[]; | ||
} |
{ | ||
"name": "@accounts/types", | ||
"version": "0.19.0", | ||
"version": "0.19.1-alpha.2.17+1d0a3901", | ||
"description": "Accounts-js Types", | ||
@@ -47,7 +47,7 @@ "main": "lib/index.js", | ||
"@types/jest": "24.0.18", | ||
"@types/node": "12.7.2", | ||
"@types/node": "12.7.4", | ||
"jest": "24.9.0", | ||
"rimraf": "3.0.0" | ||
}, | ||
"gitHead": "c0a7905161c702350efd4f7a622c55ede495a42b" | ||
"gitHead": "1d0a3901760c599054c0ccdd3bcb0443e854646a" | ||
} |
@@ -10,2 +10,4 @@ export * from './types/database-interface'; | ||
export * from './types/login-result'; | ||
export * from './types/mfa-login-result'; | ||
export * from './types/mfa-login-attempt'; | ||
export * from './types/impersonation-result'; | ||
@@ -12,0 +14,0 @@ export * from './types/login-user-identity'; |
export interface CreateUser { | ||
username?: string; | ||
email?: string; | ||
mfaChallenges?: string[]; | ||
[additionalKey: string]: any; | ||
} |
import { User } from './user'; | ||
import { Session } from './session'; | ||
import { MfaLoginAttempt } from './mfa-login-attempt'; | ||
import { CreateUser } from './create-user'; | ||
import { ConnectionInformations } from './connection-informations'; | ||
export interface DatabaseInterface extends DatabaseInterfaceSessions { | ||
export interface DatabaseInterface | ||
extends DatabaseInterfaceSessions, | ||
DatabaseInterfaceMfaLoginAttempts { | ||
// Find user by identity fields | ||
@@ -61,2 +64,8 @@ findUserByEmail(email: string): Promise<User | null>; | ||
export interface DatabaseInterfaceMfaLoginAttempts { | ||
createMfaLoginAttempt(mfaToken: string, loginToken: string, userId: string): Promise<void>; | ||
getMfaLoginAttempt(mfaToken: string): Promise<MfaLoginAttempt | null>; | ||
removeMfaLoginAttempt(mfaToken: string): Promise<void>; | ||
} | ||
export interface DatabaseInterfaceSessions { | ||
@@ -74,3 +83,7 @@ findSessionById(sessionId: string): Promise<Session | null>; | ||
updateSession(sessionId: string, connection: ConnectionInformations): Promise<void>; | ||
updateSession( | ||
sessionId: string, | ||
connection: ConnectionInformations, | ||
newToken?: string | ||
): Promise<void>; | ||
@@ -77,0 +90,0 @@ invalidateSession(sessionId: string): Promise<void>; |
@@ -9,2 +9,3 @@ import { EmailRecord } from './email-record'; | ||
deactivated: boolean; | ||
mfaChallenges?: string[]; | ||
} |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
17582
73
353
1