npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

noinfopath-user

v0.1.2

Published

noInfoPath user module

Downloads

3

Readme

noinfopath-user.js

@version 0.1.2

The noinfopath.user module contains services, and directives that assist in developing an application that requires as secure and customized user experience.

noLoginService : provider

Returns an instance of the LoginService class will all dependencies injected.

NoInfoPathUser : Class

This class provides an in memory representation of a NoInfoPath User. It is instanciated by the noLoginService, when an online user logs in or from the cached LocalStorage version when working offline.

Constructors

NoInfoPathUser(data)

Contstructs new new NoInfoPathUser object from a JSON structure received from a call to the noLoginService::login method or retreived from local storage.

Usage
var user = new NoInfoPathUser(data);
Parameters

|Name|Type|Description| |----|----|-----------| |data|Object|A JSON data structure recevied after a successful login or from local storage|

Methods

None.

Properties

|Name|Type|Description| |----|----|-----------| |tokenExpired|Bool|Returns true if the users bearer token has expired.|

LoginService : Class

LoginService is a backing class for the noLoginService provider. It provides the functionality for login, logout, and user registration. The LoginService requires an active network connection to the NoInfoPath REST Service.

Constructors

LoginService($q,$http,$base64,noLocalStorage,noUrl,noConfig, $rootScope)

This constructor is call via the Angular $injector service, as such, all of the parameters must injectable services.

Usage
var ls = LoginService($q, $http, $base64, noLocalStorage, noUrl, noConfig, $rootScope);
Parameters

|Name|Type|Description| |----|----|-----------| |$q|Service|AngularJS promise service| |$http|Service|AngularJS HTTP service| |$base64|Service|Base64 conversion service| |noLocalStorage|Service|NoInfoPath LocalStorage service| |noUrl|Service|NoInfoPath Url formatting service| |noConfig|Service|NoInfoPath Configuration service| |$rootScope|Service|AngularJS root scope service.|

Methods

login(userInfo)

Calls the NoInfoPath Login service offered by the NoInfoPath REST API. Upon a successful login a new NoInfoPathUser object is created, and is cached in local storage.

Usage
	noLoginService.login({username: "foo", password: "bar"})
		.then(angular.noop);
Parameters

|Name|Type|Description| |----|----|-----------| |userInfo|Object|Contains the username and password to try to authenticate.|

Returns

AngularJS $q Promise. When the promise resolves a NoInfoPathUser object will be returned.

register(registerInfo)

Calls the NoInfoPath Account Registration service offered by the NoInfoPath REST API.

Usage
	noLoginService.register({username: "foo", password: "bar", confirmPassword: "bar"})
		.then(angular.noop);
Parameters

|Name|Type|Description| |----|----|-----------| |registerInfo|Object|Contains the username, password and confirmPassword data required for registering a new user.|

Returns

AngularJS $q Promise. When the promise resolves a NoInfoPathUser object will be returned.

changePassword(updatePasswordInfo)

Calls the NoInfoPath Account Change Password service offered by the NoInfoPath REST API.

Usage
	noLoginService.changePassword({userId: "d11154b7-d48f-42e7-94c7-cf47e45e0d81", oldPassword: "hello", password: "bar", confirmPassword: "bar"})
		.then(angular.noop);
Parameters

|Name|Type|Description| |----|----|-----------| |updatePasswordInfo|Object|Contains the userId, the old password, the new password, and a confirmation of the new password. |

Returns

AngularJS $q Promise.

logout()

Logs out the current user, and deletes all data stored in local storage.

Usage
	noLoginService.logout();
Parameters

None.

Returns

Undefined

Properties

|Name|Type|Description| |----|----|-----------| |isAuthenticated|Bool|Returns true if the there is a valid user stored in local storage| |isAuthorized|Bool|Turns true if the isAuthenticated and the bearer token is valid.| |user|NoInfoPathUser|A reference to the currently logged in user.|