ministry-platform
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Ministry Platform

Teamcity Status

an npm package for interacting with the Ministry Platform Rest API

Usage

Prerequisites

This package uses async/await, so requires a node version > 7.6

Build a request

currently, only GET requests with select columns, filters, and table in implemented.

const MP = require('ministry-platform');
const mp = new MP();
   
const selectColumns = []
selectColumns.push('User_ID_Table_Contact_ID_Table.[Contact_ID]')
selectColumns.push('Role_ID_Table.[Role_Name]')
selectColumns.push('dp_User_Roles.[User_Role_ID]')
const filter = `User_ID_Table_Contact_ID_Table.[Contact_ID] = 7680320 and Role_ID_Table.[Role_Name] LIKE 'pushpay'` 
const table = 'dp_User_Roles'
const data = await mp.withSelectColumns(selectColumns)
    .withFilter(filter)
    .fromTable(table)
    .get()
console.info("data:", data);

to run the above example, you can run node example.js, just remember to set your environment variables.

Development

Install dependencies

npm i

Run tests

npm test
# or, to run tests as you change files 
npm test:watch

Environment Variables needed

  • MP_REST_API_ENDPOINT = "https://adminint.crossroads.net/ministryplatformapi"
  • MP_OAUTH_BASE_URL = "https://adminint.crossroads.net/ministryplatformapi/oauth"
  • MP_USERNAME = "mpuser"
  • MP_PASSWORD = "password1$3"
  • MP_CLIENT_ID = "client-id"
  • MP_CLIENT_SECRET = "mysecret"

Readme

Keywords

none

Package Sidebar

Install

npm i ministry-platform

Weekly Downloads

10

Version

1.0.0

License

ISC

Unpacked Size

15.7 kB

Total Files

8

Last publish

Collaborators

  • candrews_crds
  • rdonnelly02
  • tcmacdonald
  • dan.rye
  • dillon.courts
  • d3m
  • crds_npm_org