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

@hmcts/rpx-xui-node-lib

v2.29.5-exui-2079-rc10

Published

Common nodejs library components for XUI

Downloads

5,772

Readme

rpx-xui-node-lib

Common Nodejs library components for XUI

Commitizen friendly Semantic-Release

Committing to this library

It should be noted that this library adheres to the gitflow convention. Please use proper naming conventions for your feature/bug branches. Also, when committing please use conventional commits (@see this guide). This style is now enforced using git commit hooks and there are a number of ways to commit.

Commitizen

This is the preferred way of generating a commit against this library as it ensures the commit is formatted correctly and also allows you to interactively build your commit. To do so, you can either type yarn commit or git cz

Alternative

You can still use git commit however in doing so you have to manually enforce the commit standard and type (please be aware that your commit will still get linted and may fail otherwise).

Get User Session Timeout

getUserSessionTimeout() allows a 3rd party application to calculate the Session Notification Timeout for a User, based on their User Roles, and an array of Session Notification Timeouts, as defined by the 3rd party service.

Feature example:

A W&P User on Manage Cases should have a Total Idle Time of 12 minutes, and should show the Session Timeout Modal 3 minutes before the end of their session.

Whereas a Manage Organisation application user should have an Total Idle Time of 50 minutes, and should show the Session Timeout Modal 10 minutes before the end of their session.

Session Notification Timeouts shape

"sessionTimeouts": [
    {
      "idleModalDisplayTime": 3,
      "pattern": "-dwpresponsewriter",
      "totalIdleTime": 12
    },
    {
      "idleModalDisplayTime": 3,
      "pattern": "-homeoffice",
      "totalIdleTime": 12
    },
    {
      "idleModalDisplayTime": 10,
      "pattern": "-solicitor",
      "totalIdleTime": 50
    },
    {
      "idleModalDisplayTime": 10,
      "pattern": ".",
      "totalIdleTime": 480
    }
  ]

The Session Timeout configuration should be in PRIORITY ORDER, with the DEFAULT for this application being the last item in the array.

The application DEFAULT is defined using the wildcard pattern ie '.'

User Roles shape

[
    'pui-organisation-manager',
    'pui-user-manager',
    'pui-finance-manager',
]

Steps to implement:

  1. Include the node library within your package.json file ie.
yarn add @hmcts/rpx-xui-node-lib@latest --save
  1. Import the function
import { getUserSessionTimeout } from '@hmcts/rpx-xui-node-lib'
  1. Include the function call, and pass in the Users roles, and sessionTimeouts as set by your team. @see above for shape inputs.
const sessionTimeout = getUserSessionTimeout(roles, sessionTimeouts)
  1. Handle the returned object ie.
{
  "idleModalDisplayTime": 3,
  "pattern": "-homeoffice",
  "totalIdleTime": 12
}

This object can be passed through to an UI. If the UI is in Angular, the Angular UI can then implement the Timeout Notification Service and Timeout Notification Service Modal, which the object generated by this Node API can be transfered into.

@see https://github.com/hmcts/rpx-xui-common-lib#timeout-notification-service for an example of how to integrate the Timeout Notification Service and Timeout Notification Service Modal.

END2