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

@accounts/common

Package Overview
Dependencies
Maintainers
5
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@accounts/common - npm Package Compare versions

Comparing version 0.1.0-alpha.c4d98db4 to 0.1.0-alpha.cdeba60e

6

lib/errors.d.ts

@@ -1,9 +0,9 @@

import { PasswordLoginUserType } from './types';
import { LoginUserIdentityType } from './types';
export declare class AccountsError extends Error {
loginInfo: PasswordLoginUserType;
loginInfo: LoginUserIdentityType;
errorCode: string | number;
epochTime: number;
constructor(message: string, loginInfo?: PasswordLoginUserType, errorCode?: string | number);
constructor(message: string, loginInfo?: LoginUserIdentityType, errorCode?: string | number);
toString(): string;
serialize(): string;
}

@@ -13,3 +13,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var AccountsError = (function (_super) {
var AccountsError = /** @class */ (function (_super) {
__extends(AccountsError, _super);

@@ -16,0 +16,0 @@ function AccountsError(message, loginInfo, errorCode) {

@@ -1,2 +0,8 @@

declare const toUsernameAndEmail: ({user, username, email, id}: {
/**
* Given a username, user and/or email figure out the username and/or email.
*
* @param {Object} An object containing at least `username`, `user` and/or `email`.
* @returns {Object} An object containing `username` and `email`.
*/
declare const toUsernameAndEmail: ({ user, username, email, id, }: {
user?: string;

@@ -3,0 +9,0 @@ username?: string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var validators_1 = require("./validators");
/**
* Given a username, user and/or email figure out the username and/or email.
*
* @param {Object} An object containing at least `username`, `user` and/or `email`.
* @returns {Object} An object containing `username` and `email`.
*/
var toUsernameAndEmail = function (_a) {

@@ -5,0 +11,0 @@ var user = _a.user, username = _a.username, email = _a.email, id = _a.id;

@@ -1,8 +0,10 @@

import { HashAlgorithm } from './config';
export declare type PasswordType = string | {
digest: string;
algorithm: HashAlgorithm;
};
export interface TokenRecord {
token: string;
address: string;
when: number;
reason: string;
}
export interface EmailRecord {
address: string;
verified: boolean;
}

@@ -20,6 +22,6 @@ export interface UserObjectType {

email?: string;
password?: PasswordType;
profile?: object;
[additionalKey: string]: any;
}
export interface PasswordLoginUserIdentityType {
export interface LoginUserIdentityType {
id?: string;

@@ -29,3 +31,2 @@ username?: string;

}
export declare type PasswordLoginUserType = string | PasswordLoginUserIdentityType;
export interface TokensType {

@@ -37,3 +38,2 @@ accessToken?: string;

sessionId: string;
user: UserObjectType;
tokens: TokensType;

@@ -47,4 +47,5 @@ }

export interface SessionType {
sessionId: string;
id: string;
userId: string;
token: string;
valid: boolean;

@@ -51,0 +52,0 @@ userAgent?: string;

{
"name": "@accounts/common",
"version": "0.1.0-alpha.c4d98db4",
"version": "0.1.0-alpha.cdeba60e",
"description": "Fullstack authentication and accounts-management",

@@ -15,8 +15,7 @@ "main": "lib/index.js",

"compile": "tsc",
"prepublish": "npm run compile",
"prepublishOnly": "npm run compile",
"test": "npm run testonly",
"test-ci": "npm lint && npm coverage",
"testonly": "jest",
"coverage": "npm run testonly -- --coverage",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"
"coverage": "npm run testonly -- --coverage"
},

@@ -54,6 +53,4 @@ "files": [

"devDependencies": {
"coveralls": "^2.11.14",
"localstorage-polyfill": "^1.0.1",
"regenerator-runtime": "^0.9.6",
"rimraf": "^2.6.1"
"localstorage-polyfill": "1.0.1",
"regenerator-runtime": "0.11.1"
},

@@ -60,0 +57,0 @@ "dependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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