Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

governify-agreement-analyzer

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

governify-agreement-analyzer

Governify Agreement Analyzer

  • 0.5.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-57.14%
Maintainers
2
Weekly downloads
 
Created
Source

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.5.4 is the latest stable version of governify-agreement-analyzer component. see release note for details.

For running:

  • Download latest version from 0.5.4

Build Status

Keywords

FAQs

Package last updated on 06 Jul 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc