New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

godata-api-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

godata-api-wrapper

Javascript library to handle Go.Data queries easier

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Go.Data API Wrapper (WIP)

Javascript API wrapper around DHIS2. It handles authentication automatically given user credentials.

Installation

This package is not currently in the npm ecosystem, so in order to install it in a project, it should be added as a git repository.

  {
    "dependencies": {
      "godata-api-wrapper": "git+ssh://git@github.com/WISCENTD-UPC/godata-api-wrapper.git#develop"
    }
  }

After configuring the package.json npm install should be executed

Usage

Creation of the api wrapper:

  const API = require('godata-api-wrapper')
  const api = new API({
    baseURL: '',
    credentials: {
      email: 'username',
      password: 'password'
    }
  })

API Docs

  • api.login(credentials): Explicit login request. Credentials are optional if they were already defined in the creation of the api handler. This is generally not necessary since, for every endpoint, a middleware already checks if login is needed and performs it automatically.

  • api.getUsers(): Get all users.

  • api.getLocations(): Get all locations.

  • api.createLocation(location): Create location from an object.

  • api.deleteLocation(id): Delete location given its ID.

  • api.getOutbreaks(): Get all outbreaks.

  • api.createOutbreak(body): Create an outbreak from an object.

  • api.deleteOutbreak(id): Delete an outbreak given its ID. It handles automatically deactivating the outbreak for all users before deleting it.

  • api.activateOutbreakForUser(userID, outbreakID): Activate an outbreak given outbreakID for user with userID ID.

  • api.removeActiveOutbreakFromUser(userID): Remove active outbreak from user given its ID.

  • api.getOutbreakCases(outbreakID): Get cases from outbreak given its ID.

  • api.getOutbreakCase(outbreakID, caseID): Get additional information from a case (give its ID) of an outreak (given its ID).

  • api.createOutbreakCase(outbreakID, case): Create a case from an object associated with an outbreak given its ID.

  • api.deleteOutbreakCase(outbreakID, caseID): Delete a case (given its ID) from an outbreak (given its ID).

Testing

npm test

Keywords

FAQs

Package last updated on 12 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

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