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/noinfopath-user

v2.1.0

Published

noInfoPath user module

Downloads

7

Readme

noinfopath-user.js

@version 2.0.14

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,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, noLocalStorage, noUrl, noConfig, $rootScope);
Parameters

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

Configuration

LoginService can be configured with an optional configuration hive in noConfig called noUser.

|Name|Type|Description| |----|----|-----------| |noUser|Object|Optional object within noConfig that holds the configuration for the noinfopath-user module| |noUser.storeUser|Boolean|Determines to persist user login information between browser sessions or not. Defaults to true| |noUser.noLogoutTimer|Int|noLogoutTimer directive configuration value. The amount of time in milliseconds of inactivity that elapses before the noLogoutTimer modal dialoge appears.|

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.|

updateUser(userInfo)

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

Usage
	noLoginService.updateUser(userInfo);
Parameters

|Name|Type|Description| |----|----|-----------| |userInfo|Object|An objet that contains the user to be updated, along with the properties to be updated. UserID, Email, and Username are required. FirstName and LastName are optional. |

Returns

AngularJS $q Promise Object. The promise returns the response from the WEBAPI.

noLogin : directive

Sets the credential object and a login function that calls the noLoginService login function onto the scope.

noUserMenu : directive

Sets a logout function on the scope that opens a modal to let the user log out. If there are localStores within the configuration, it also gives the option to clear local storage. There is a default logout modal, but this allows for a template to be loaded and displayed via noPrompt. Within noConfig, there is now support for a noUser.logoutTemplate which is a path to a html template. If this is not provided, it defaults to a basic noPrompt window.

noUserGroups : directive

Dynamically creates a set of checkboxes based on the number of user groups from the configured NOREST database.

noLogoutTimer is a directive that dynamically creates a modal popup that will show after a configured time informing the user that their inactivity will cause them to log out, and after 60 more seconds, log out the user.

noLogoutTimer gets the configuration from noConfig, which is detailed below.

|Name|Type|Description| |----|----|-----------| |noUser.noLogoutTimer|int|The amount of time in milliseconds of inactivity that elapses before the noLogoutTimer modal dialoge appears.|