{"_id":"@brechtvdv/lib-decision-validation","name":"@brechtvdv/lib-decision-validation","dist-tags":{"latest":"1.0.34-pre-release"},"versions":{"1.0.34-pre-release":{"name":"@brechtvdv/lib-decision-validation","version":"1.0.34-pre-release","publishConfig":{"access":"public"},"description":"This module is used to validate publications in the context of the Flemish government.","main":"dist/index.js","typings":"dist/index.d.ts","license":"MIT","author":{"name":"Senne Bels","email":"sennebels@gmail.com","url":"https://sennebels.xyz"},"contributors":[{"name":"Lenny Bontenakel"}],"scripts":{"build":"tsup","test":"jest","format":"prettier --write \"src/**/*.ts\"","lint":"tslint -p tsconfig.json","lint:fix":"tslint -p tsconfig.json --fix","prepublish":"tsc"},"keywords":[],"include":["src/**/*"],"devDependencies":{"@comunica/types":"^3.1.0","@types/jest":"^29.5.12","@types/jquery":"^3.5.29","esbuild":"^0.20.0","esbuild-plugin-tsc":"^0.4.0","http-request-mock":"^1.8.19","jest":"^29.7.0","npm-dts":"^1.3.12","prettier":"^3.2.5","rdf-js":"^4.0.2","ts-jest":"^29.1.1","tslint":"^6.1.3","tslint-config-prettier":"^1.18.0","typescript":"^5.3.3"},"dependencies":{"@comunica/actor-http-proxy":"^3.0.3","@comunica/query-sparql":"^3.0.3","dom-serializer":"^2.0.0","domutils":"^3.1.0","html-dom-parser":"^5.0.8","lib-decision-shapes":"^0.0.16","n3":"^1.17.3","tsup":"^8.0.2"},"gitHead":"9ce604e9561275c10a6c229cdaf0212bb723f554","_id":"@brechtvdv/lib-decision-validation@1.0.34-pre-release","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-f3+9NTXCVk0/h+p7/d9aZvyUD3QdZoECs2q6UHC84e6oKPdOK8DJJLcznJf2wlkeiYO8+3oE2ehNXXodDcaLzA==","shasum":"c1767df59db13a27ca31bef34a0d7a3eb7f01b66","tarball":"https://registry.npmjs.org/@brechtvdv/lib-decision-validation/-/lib-decision-validation-1.0.34-pre-release.tgz","fileCount":26,"unpackedSize":77895,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHrL4zekIDg41xefq9rMB7OsrdEcGpgg4wk0A7R14JBDAiApcHjqFtVKXa/B/Z536sJHzj52oMhbK+WQWZd3Es6rEQ=="}]},"_npmUser":{"name":"brechtvdv","email":"br5cht@hotmail.com"},"directories":{},"maintainers":[{"name":"brechtvdv","email":"br5cht@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/lib-decision-validation_1.0.34-pre-release_1725894068640_0.6024870510690044"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-09T15:01:08.538Z","1.0.34-pre-release":"2024-09-09T15:01:08.871Z","modified":"2024-09-09T15:01:09.139Z"},"maintainers":[{"name":"brechtvdv","email":"br5cht@hotmail.com"}],"description":"This module is used to validate publications in the context of the Flemish government.","keywords":[],"contributors":[{"name":"Lenny Bontenakel"}],"author":{"name":"Senne Bels","email":"sennebels@gmail.com","url":"https://sennebels.xyz"},"license":"MIT","readme":"<p align=\"center\">\n  <img src=\"https://ui.vlaanderen.be/3.latest/icons/app-icon/icon-highres-precomposed.png\" width=\"100\" alt=\"project-logo\">\n</p>\n<p align=\"center\">\n    <h1 align=\"center\">APP-VALIDATION-TOOL</h1>\n</p>\n<p align=\"center\">\n\t<img src=\"https://img.shields.io/github/last-commit/lblod/app-validation-tool?style=default&logo=git&logoColor=white&color=0080ff\" alt=\"last-commit\">\n\t<img src=\"https://img.shields.io/github/languages/top/lblod/app-validation-tool?style=default&color=0080ff\" alt=\"repo-top-language\">\n\t<img src=\"https://img.shields.io/github/languages/count/lblod/app-validation-tool?style=default&color=0080ff\" alt=\"repo-language-count\">\n<p>\n\n<br><!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary><br>\n\n- [Overview](#overview)\n- [Features](#features)\n  - [Document Type Validation](#document-type-validation)\n  - [Validation Glue](#validation-glue)\n- [Repository Structure](#repository-structure)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Testing](#testing)\n- [Documentation](#documentation)\n</details>\n<hr>\n\n##  Overview\n\nThe App Validation Tool is an [npm module](https://www.npmjs.com/package/validation-monitoring-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.\n\nCrafted 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.\n\n## Features\n\n### Document Type Validation\n\nPublications must meet structural requirements to ensure consistency and readability. The module supports validation for the following document types:\n\n    - Besluitenlijst\n    - Notule\n    - Agenda\n\nIn 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.\n\n### Validation Glue\n\nIn order to properly validate an agenda item exists in a publication, we need to know the following:\n\n    - Agenda item\n      - title\n      - resolution\n      - vote\n      - decision\n    - Session\n      - time\n      - governing body\n\n##  Repository Structure\n\n```sh\n└── app-validation-tool/\n    ├── README.md\n    ├── files\n    │   └── basic-agenda.ttl\n    │   └── decision-list.ttl\n    │   └── notulen.ttl\n    ├── jest.config.js\n    ├── package-lock.json\n    ├── package.json\n    ├── src\n    │   ├── index.ts\n    │   ├── queries.ts\n    │   ├── tests\n    │   ├── examples.ts\n    │   └── validation.ts\n    ├── tsconfig.json\n    ├── tslint.json\n    ├── tsup.config.ts\n    └── yarn.lock\n```\n\n## Installation\n\n<h4>From <code>source</code></h4>\n\n> 1. Clone the app-validation-tool repository:\n>\n> ```console\n> $ git clone https://github.com/lblod/app-validation-tool\n> ```\n>\n> 2. Change to the project directory:\n> ```console\n> $ cd app-validation-tool\n> ```\n>\n> 3. Install the dependencies:\n> ```console\n> $ > npm install\n> ```\n\n<h4>From <code>npm</code></h4>\n\n> 1. Install the module from npm:\n> ```console\n> $ > npm install app-validation-tool\n> ```\n\n\n## Usage\n\n> To use the module, import it into your project:\n> ```javascript\n> import { validatePublication, getBlueprintOfDocumentType, fetchDocument, getExampleOfDocumentType } from 'app-validation-tool/dist';\n> ```\n>\n> Then, call the `validatePublication` function with the publication data to validate:\n> ```typescript\n> const blueprint: Bindings[] = await getBlueprintOfDocumentType('Notulen');\n> const example: Document = getExampleOfDocumentType('Notulen');\n> const publication: Bindings[] = await fetchDocument(NOTULEN_LINK, PROXY);\n>\n> const validationResult = await validatePublication(publication, blueprint, example);\n> ```\n>\n> The `validatePublication` function returns an array of subjects. Each subject is structured as follows:\n> ```typescript\n> [key: number]: {\n>   name: string,\n>   totalCount: number,\n>   type: string,\n>   typeName: string,\n>   url: string,\n>   usedShape: string,\n>   validCount: number,\n>   validatedProperties: {\n>     [key: number]: {\n>       name: string,\n> }\n> ```\n\n\n### Testing\n\n> Run the test suite using the command below:\n> ```console\n> npm run test\n> ```\n\n## Documentation\n\nLink to the full documentation [here](https://app.gitbook.com/o/-MP9Yduzf5xu7wIebqPG/s/o6NmI5BUsBB4lH0um5Q4/).\n\n[**Return**](#overview)\n","readmeFilename":"README.md"}