Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@accounts/types

Package Overview
Dependencies
Maintainers
6
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@accounts/types - npm Package Compare versions

Comparing version 0.19.0 to 0.19.1-alpha.2.17

lib/types/mfa-login-attempt.d.ts

2

lib/index.d.ts

@@ -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;
}

10

lib/types/database-interface.d.ts
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[];
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc