šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Book a DemoInstallSign in
Socket

validation-monitoring-module-test

Package Overview
Dependencies
Maintainers
3
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

validation-monitoring-module-test

This module is used to validate publications in the context of the Flemish government.

1.0.14
latest
npm
Version published
Weekly downloads
20
400%
Maintainers
3
Weekly downloads
Ā 
Created
Source

project-logo

VALIDATION-MONITORING-MODULE

last-commit repo-top-language repo-language-count


Table of Contents
  • Overview
  • Features
  • Repository Structure
  • Installation
  • Usage
  • Documentation

Overview

The Validation Monitoring Module is an npm module designed to safeguard the integrity of data published to a triple store, crucial in scenarios involving multiple publishers. It meticulously compares publications against a predefined data blueprint, pinpointing discrepancies and enforcing data structure compliance according to specified standards.

Crafted with Test-Driven Development (TDD) principles at its core, this npm module emphasizes reliability and robustness from the ground up. Developed in TypeScript for enhanced type safety and transpiled to JavaScript for wide-ranging compatibility, it incorporates an extensive suite of Jest tests. This rigorous testing approach ensures the module performs reliably under various scenarios, making it a trustworthy addition to any Node.js project.

Features

Document Type Validation

Publications must meet structural requirements to ensure consistency and readability. The module supports validation for the following document types:

- Besluitenlijst
- Notule
- Agenda

In addition to specific document types, each publication is required to have a title, validated as a string to ensure it is present and correctly formatted. For "Notule" documents, there is an additional requirement to validate the maturity level, ensuring that these documents not only meet structural standards but also adhere to designated maturity criteria, adding a layer of depth to the validation process.

Validation Glue

In order to properly validate an agenda item exists in a publication, we need to know the following:

- Agenda item
  - title
  - resolution
  - vote
  - decision
- Session
  - time
  - governing body

Repository Structure

└── validation-monitoring-module/
    ā”œā”€ā”€ README.md
    ā”œā”€ā”€ files
    │   └── notulen.ttl
    ā”œā”€ā”€ jest.config.js
    ā”œā”€ā”€ package-lock.json
    ā”œā”€ā”€ package.json
    ā”œā”€ā”€ src
    │   ā”œā”€ā”€ index.ts
    │   ā”œā”€ā”€ queries.ts
    │   ā”œā”€ā”€ tests
    │   └── validation.ts
    ā”œā”€ā”€ tsconfig.json
    ā”œā”€ā”€ tslint.json
    ā”œā”€ā”€ tsup.config.ts
    └── yarn.lock

Installation

From source

  • Clone the validation-monitoring-module repository:
$ git clone https://github.com/lblod/validation-monitoring-tool
  • Change to the project directory:
$ cd validation-monitoring-module
  • Install the dependencies:
$ > npm install

From npm

  • Install the module from npm:
$ > npm install validation-monitoring-module

Usage

To use the module, import it into your project:

import { validatePublication, getBlueprintOfDocumentType, fetchDocument } from 'validation-monitoring-module/index';

Then, call the validatePublication function with the publication data to validate:

const blueprint: Bindings[] = await getBlueprintOfDocumentType('Notulen');
const publication: Bindings[] = await fetchDocument(NOTULEN_LINK, PROXY);

const validationResult = await validatePublication(publication, blueprint);

The validatePublication function returns an array of subjects. Each subject is structured as follows:

[key: number]: {
  name: string,
  totalCount: number,
  type: string,
  typeName: string,
  url: string,
  usedShape: string,
  validCount: number,
  validatedProperties: {
    [key: number]: {
      name: string,
}

Testing

Run the test suite using the command below:

npm run test

Documentation

Link to the full documentation here.

Return

FAQs

Package last updated on 24 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts