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 🙏

© 2022 – Pkg Stats / Ryan Hefner

@slmdevs/celeraone

v1.1.9

Published

This is a NPM Package to use for all the CeleraOne interactions.

Downloads

65

Readme

This is a NPM Package to use for all the CeleraOne interactions.


Users


Find user

Async function to fetch a specific user from CeleraOne

Parameters

| Name | Type | Example | Description | | ---- | ---- | ------- | ----------- | | contractorId | string | payway-550198b3a67201153c000007 | The users social security number |

Execution

import { findUser } from '@slmdevs/celeraone'

const user = await findUser('payway-550198b3a67201153c000007')

Response

{
  "userId": "b16eccba-4016-4968-90b2-3176172c5421",
  "login": "[email protected]",
  "accountState": "registered",
  "socialSecurityNumber": "199009249179",
  "firstName": "Sven",
  "lastName": "Svensson",
  "email": "[email protected]"
}

Update user password (hashed_password)

Async function to update a users hashed_password in CeleraOne

| Name | Type | Example | Description | | ---- | ---- | ------- | ----------- | | userId | string | b16eccba-4016-4968-90b2-3176172c5421 | The userId the user has in CeleraOne | | passwordHash | string | $2a$10$bZlWSl9mMRapbiCdV0qIwuaD52GGfKUPV0hASAerMqeMz2BFlO14C | The bcrypt hash |

Execution

import { updateUserPassword } from '@slmdevs/celeraone'

const success = await updateUserPassword('b16eccba-4016-4968-90b2-3176172c5421', '$2a$10$bZlWSl9mMRapbiCdV0qIwuaD52GGfKUPV0hASAerMqeMz2BFlO14C')

Response

true / false

Update user login

Async function to update the users login

Parameters

| Name | Type | Example | Description | | ---- | ---- | ------- | ----------- | | userId | string | b16eccba-4016-4968-90b2-3176172c5421 | The userId the user has in CeleraOne | | newLogin | string | [email protected] | The new login for the user |

Execution

import { updateUserLogin } from '@slmdevs/celeraone'

const success = await updateUserLogin('b16eccba-4016-4968-90b2-3176172c5421', '[email protected]')

Response

true / false

Update the users MasterData

Async function to update the users MasterData in CeleraOne

Parameters

| Name | Type | Example | Description | | ---- | ---- | ------- | ----------- | | userId | string | b16eccba-4016-4968-90b2-3176172c5421 | The userId the user has in CeleraOne | | data | MasterDataInterface | { first_name: 'Sven', last_name: 'Svensson' } | The MasterData properties that you want to update |

Execution

import { updateUserMasterData } from '@slmdevs/celeraone'

const success = await updateUserMasterData('b16eccba-4016-4968-90b2-3176172c5421', {
  first_name: 'Sven',
  last_name: 'Svensson'
})

Response

true / false

Add user propertyy

Async function to add a property to the user in CeleraOne

Parameters

| Name | Type | Example | Description | | ---- | ---- | ------- | ----------- | | userId | string | b16eccba-4016-4968-90b2-3176172c5421 | The userId the user has in CeleraOne | | name | string | active_prodcuts | The property name | | value | string | 'gp-digital-bas,e-tidning' | The value to be set |

Execution

import { addUserProperty } from '@slmdevs/celeraone'

const success = await addUserProperty('5a9b882c-59e7-4221-b009-736aa3351604', 'active_products', 'hejsan123')

Response

true / false

Import user

Async function to import a user into CeleraOne

Parameters

| Name | Type | Example | Description | | ---- | ---- | ------- | ----------- | | user | UserInterface | { socialSecurityNumber: '199009249179', email: '[email protected]', firstName: 'Sven', lastName: 'Svensson', hashedPassword: '$2a$10$bZlWSl9mMRapbiCdV0qIwuaD52GGfKUPV0hASAerMqeMz2BFlO14C' } | The user object that will be imported |

Execution

import { importUser } from '@slmdevs/celeraone'

const userId = await importUser({
    socialSecurityNumber: '199009249179',
    email: '[email protected]',
    firstName: 'Sven',
    lastName: 'Svensson',
    hashedPassword: '$2a$10$bZlWSl9mMRapbiCdV0qIwuaD52GGfKUPV0hASAerMqeMz2BFlO14C'
})

Response

4dd949a7-1231-4267-8131-c05d93f7936e

Get userId via users session_id

Async function to fetch the userId from the users session_id

Parameters

| Name | Type | Example | Description | | ---- | ---- | ------- | ----------- | | sessionId | string | 76d67999399263996f177f8e08a74677 | The users session_id | | serviceId | ServiceId | ServiceId.GP | The serviceId in CeleraOne |

Execution

import { getUserIdFromSessionId, ServiceId } from `@slmdevs/celeraone`

const userId = await getUserIdFromSessionId('76d67999399263996f177f8e08a74677', ServiceId.GP)

Response

461df36e-9c9e-4049-b7ef-0c3aa39fd704