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.d4d6c834 to 0.1.0-alpha.dab12c46

lib/config.d.ts

9

lib/index.d.ts

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

export { UserObjectType, TokensType, LoginReturnType, SessionType, HashAlgorithm, PasswordType, CreateUserType, LoginUserIdentityType, PasswordLoginType, PasswordSignupFields } from './types';
import * as validators from './validators';
import { AccountsError } from './errors';
import toUsernameAndEmail from './to-username-and-email';
import config from './config';
export { PasswordSignupFields } from './password-signup-fields';
export { AccountsCommonConfiguration, HashAlgorithm } from './config';
export * from './types';
export { validators, AccountsError, toUsernameAndEmail, config };
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var types_1 = require("./types");
exports.PasswordSignupFields = types_1.PasswordSignupFields;
var validators = require("./validators");
exports.validators = validators;
var errors_1 = require("./errors");
exports.AccountsError = errors_1.AccountsError;
var to_username_and_email_1 = require("./to-username-and-email");
exports.toUsernameAndEmail = to_username_and_email_1.default;
var config_1 = require("./config");
exports.config = config_1.default;
var password_signup_fields_1 = require("./password-signup-fields");
exports.PasswordSignupFields = password_signup_fields_1.PasswordSignupFields;
//# sourceMappingURL=index.js.map

58

lib/types.d.ts

@@ -0,5 +1,13 @@

import { HashAlgorithm } from './config';
export declare type PasswordType = string | {
digest: string;
algorithm: HashAlgorithm;
};
export interface EmailRecord {
address: string;
}
export interface UserObjectType {
username?: string;
email?: string;
emails?: object[];
emails?: EmailRecord[];
id: string;

@@ -9,2 +17,14 @@ profile?: object;

}
export interface CreateUserType {
username?: string;
email?: string;
password?: PasswordType;
profile?: object;
}
export interface PasswordLoginUserIdentityType {
id?: string;
username?: string;
email?: string;
}
export declare type PasswordLoginUserType = string | PasswordLoginUserIdentityType;
export interface TokensType {

@@ -19,2 +39,7 @@ accessToken?: string;

}
export interface ImpersonateReturnType {
authorized: boolean;
tokens?: TokensType;
user?: UserObjectType;
}
export interface SessionType {

@@ -28,31 +53,2 @@ sessionId: string;

}
export declare type HashAlgorithm = 'sha' | 'sha1' | 'sha224' | 'sha256' | 'sha384' | 'sha512' | 'md5' | 'ripemd160';
export declare type PasswordType = string | {
digest: string;
algorithm: HashAlgorithm;
};
export interface CreateUserType {
username?: string;
email?: string;
password?: PasswordType;
profile?: object;
}
export interface LoginUserIdentityType {
id?: string;
username?: string;
email?: string;
}
export interface PasswordLoginType {
user: string | LoginUserIdentityType;
password: PasswordType;
}
export declare const EMAIL_ONLY = "EMAIL_ONLY";
export declare const USERNAME_AND_EMAIL = "USERNAME_AND_EMAIL";
export declare const USERNAME_AND_OPTIONAL_EMAIL = "USERNAME_AND_OPTIONAL_EMAIL";
export declare const USERNAME_ONLY = "USERNAME_ONLY";
export declare enum PasswordSignupFields {
EMAIL_ONLY = "EMAIL_ONLY",
USERNAME_AND_EMAIL = "USERNAME_AND_EMAIL",
USERNAME_AND_OPTIONAL_EMAIL = "USERNAME_AND_OPTIONAL_EMAIL",
USERNAME_ONLY = "USERNAME_ONLY",
}
export declare type HookListener = (event?: object) => void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EMAIL_ONLY = 'EMAIL_ONLY';
exports.USERNAME_AND_EMAIL = 'USERNAME_AND_EMAIL';
exports.USERNAME_AND_OPTIONAL_EMAIL = 'USERNAME_AND_OPTIONAL_EMAIL';
exports.USERNAME_ONLY = 'USERNAME_ONLY';
var PasswordSignupFields;
(function (PasswordSignupFields) {
PasswordSignupFields["EMAIL_ONLY"] = "EMAIL_ONLY";
PasswordSignupFields["USERNAME_AND_EMAIL"] = "USERNAME_AND_EMAIL";
PasswordSignupFields["USERNAME_AND_OPTIONAL_EMAIL"] = "USERNAME_AND_OPTIONAL_EMAIL";
PasswordSignupFields["USERNAME_ONLY"] = "USERNAME_ONLY";
})(PasswordSignupFields = exports.PasswordSignupFields || (exports.PasswordSignupFields = {}));
//# sourceMappingURL=types.js.map
{
"name": "@accounts/common",
"version": "0.1.0-alpha.d4d6c834",
"license": "MIT",
"version": "0.1.0-alpha.dab12c46",
"description": "Fullstack authentication and accounts-management",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"publishConfig": {
"access": "public"
},
"scripts": {
"start": "tsc --watch",
"clean": "rimraf lib",
"precompile": "npm run clean",
"compile": "tsc",
"prepublish": "npm run compile",
"test": "npm run testonly",
"test-ci": "npm lint && npm coverage",
"testonly": "jest",
"coverage": "jest --coverage"
"coverage": "npm run testonly -- --coverage",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"
},
"files": [
"lib"
],
"jest": {
"transform": {
".(ts|tsx)": "<rootDir>/../../node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx)$",
"moduleFileExtensions": [
"ts",
"js"
],
"mapCoverage": true
},
"repository": {
"type": "git",
"url": "https://github.com/js-accounts/accounts/tree/master/packages/common"
},
"keywords": [
"rest",
"graphql",
"grant",
"auth",
"authentication",
"accounts",
"users",
"oauth"
],
"author": "Tim Mikeladze",
"license": "MIT",
"devDependencies": {
"coveralls": "^2.11.14",
"localstorage-polyfill": "^1.0.1",
"regenerator-runtime": "^0.9.6",
"rimraf": "^2.6.1"
},
"dependencies": {
"lodash": "^4.16.4"
}
}

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