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

@universis/consents

v1.3.0

Published

A collection of tools and services for managing user consents at Universis environment

Downloads

97

Readme

@universis/consents

A collection of tools and services for managing user consents.

Installation

npm i @universis/consents

Configuration

Register UserConsentService as application service:

{
  "services": [
    {
      "serviceType": "@universis/consents#UserConsentService"
    }
  ]
}

and UserConsentSchemaLoader under settings/schema/loaders:

{
  "settings": {
    "schema": {
      "loaders": [
        {
          "loaderType": "@universis/consents#UserConsentSchemaLoader"
        }
      ]
    }
  }
}

UserConsentSchemaLoader consists of a collection of data models that are going to be used by application services for controlling user consents.

Description

This module provides a set of tools and services for managing user consents. It allows you to create, update, delete and retrieve consents. It also provides a set of tools for managing user consents in the application.

ConsentField

User consents fields are stored in the database and are associated with a user. Each consent field has a unique identifier, a name, a description, a status, a creation date and an update date etc. A consent may be archived or active. An archived consent is a consent that is no longer in use. An active consent is a consent that is currently in use.

{
  "name": "Allow contact",
  "alternateName": "allowContact",
  "description": "Allow the institution to contact me via email",
  "group": "students",
  "id": "e82f925b-28bc-487a-b517-31f014885e4d",
  "archived": false,
  "additionalType": "ConsentField",
  "dateCreated": "2024-03-21T15:38:29.351Z",
  "dateModified": "2024-03-21T15:38:29.353Z"
}

ConsentFieldGroup

Each consent field may belong to a group of consents. A consent group is a collection of consents that are related to each other. A consent group has a unique identifier, a name, a description, a creation date and an update date etc

{
  "id": "93703531-795d-41d7-b4de-4cc1fe940809",
  "name": "Student Consents",
  "alternateName": "students",
  "archived": false,
  "additionalType": "ConsentFieldGroup",
  "description": "A consent group for students",
  "dateCreated": "2024-03-21T15:41:12.917Z",
  "dateModified": "2024-03-21T15:41:12.928Z"
}

UserConsents

User consents can be retrieved by the user. The user can retrieve all their consents by calling /api/users/me/consents endpoint.

The list of user consents is being represented as a list of consent objects.

{
  "students": {
    "allowContact": {
      "val": "y",
      "metadata": {
        "time": "2024-03-21T15:29:56.258Z",
        "name": "Allow contact",
        "description": "Allow the institution to contact me via email",
      }
    },
    "sms": {
      "val": "u",
      "metadata": {
        "time": null,
        "name": "Allow sending SMS",
        "description": "Allow the institution to contact me via sms",
      }
    },
    "metadata": {
      "time": "2024-03-21T15:29:56.258Z",
      "name": "Student Consents",
      "description": "A consent group for students",
    }
  }
}

User consents can be updated by the user. The user can update their consents by calling /api/users/me/consents endpoint.

{
  "students": {
    "allowContact": {
      "val": "n"
    },
    "sms": {
      "val": "n"
    }
  }
}