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

governify-agreement-analyzer

v0.6.6

Published

Governify Agreement Analyzer

Downloads

8

Readme

Governify Agreement Analyzer

This is a Node.js API REST to analyze agreements defined by following the iAgree Specification.

Governify Agreement Analyzer provides some features, such as:

  • An API for programmers to peform agreement analysis operations.
  • An API REST to peform agreement analysis operations over a service.

Governify Agreement Analyzer executes all CSP by using the Reasoner tool defined on governify-csp-tools project, which in turn executes the CSP based on MiniZinc language.

Governify Agreement Analyzer has been developed on TypeScript and transpiled to JavaScript in order to be executed as a Node.js module. Also, it has been developed by following the project-template-nodejs development guidelines.

Install

$ npm install governify-agreement-analyzer

Basic usage

You can easily use this library in your project:

// Import
var AgreementAnalyzer = require("governify-agreement-analyzer");

// Configure analyzer
var config = {
    agreement: {
        file: "agreement.yaml"
    },
    reasoner: {
      type: "api",
      folder: "csp_files",
      api: {
        version: "v2",
        server: "https://minizinc.modules.designer.governify.io/module-minizinc",
        operationPath: "models/csp/operations/execute"
      }
    }
};

// Create an Analyzer instance
var analyzer = new AgreementAnalyzer(config);

// Execute an analysis operation
analyzer.isConsistent(function (err, sol) {
    if (err) {
        // manage error
        console.log(err);
    } else {
        console.log(sol);
    }
});

or deploy the analyzer as an API REST service:

// Import Agreement Analyzer API
var AgreementAnalyzerServer = require("governify-agreement-analyzer").api;
var api = new AgreementAnalyzerServer();
var app = require("connect")();

// Start API
api.initialize(app);

Once you deploy the API REST, you can now send a POST request over http://localhost:8080/api/v1/analysis/isConsistent with the configuration of Analyzer.

You can download agreement.yaml here.

Follow the analyzer configuration for more details.

Analyzer configuration

An example:

var configuration = { 
  "agreement": {
    "file": "agreement.yaml" // use 'url' property for remote agreements 
  },
  "reasoner": {
    "type": "local",
    "folder": "csp_files"
  }
}

Please, consider:

  • Reasoner can be configured for local, remote or docker execution. Please, take a look at reasoner documentation to know which are the requirements to run reasoner in each environment.
  • Use agreement.file property to define use an local agreement file located in your project. You can also use agreement.url to define a remote agreement file.

The JSON schema associated to analyzer configuration:

---
type: 'object'
properties:
  agreement:
    type: 'object'
    properties:
      file:
        type: 'string'
      url: 
        type: 'string'
      content: 
        type: 'object'
  reasoner:
    # Reasoner configuration of governify-csp-tools project
    type: 'object'
    properties:
      type:
        enum:
        - 'local'
        - 'api'
        - 'docker'
      folder:
        type: 'string' 
      api:
        type: 'object'
        properties:
          version:
            type: 'string'
          server:
            type: 'string'
          operationPath:
            type: 'string'
    required:
      - 'type'
      - 'folder'

Latest release

The version 0.6.6 is the latest stable version of governify-agreement-analyzer component. see release note for details.

For running:

  • Download latest version from 0.6.6

Build Status