# @wwu-restek/srapi

> This module (class) simplifies the process of implementing calls to StarRez's REST API by providing a few wrapper functions.

Latest version **2.0.1** (published 2019-01-17) · GPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install @wwu-restek/srapi
pnpm add @wwu-restek/srapi
yarn add @wwu-restek/srapi
bun add @wwu-restek/srapi
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2019-01-17 |
| First published | 2018-01-19 |
| Weekly downloads | 0 |
| License | GPL-3.0-or-later |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 18.6 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Author | Brent Carey |
| Maintainers | covinga, grootva, jared0801, tristan-smith, truongl, wwubrent, wwurestek |

## Links

- npm: https://www.npmjs.com/package/@wwu-restek/srapi
- npm.io page: https://npm.io/package/@wwu-restek/srapi

## Dependencies (3)

- [xml2js](https://npm.io/package/xml2js.md) ^0.4.19
- [request](https://npm.io/package/request.md) ^2.85.0
- [request-promise-native](https://npm.io/package/request-promise-native.md) ^1.0.5

## Recent versions

- 2.0.1 (latest) — 2019-01-17
- 1.4.2 — 2018-12-21
- 1.4.1 — 2018-12-21
- 1.4.0 — 2018-12-10
- 1.3.4 — 2018-09-11
- 1.3.2 — 2018-05-07
- 1.3.1 — 2018-05-07
- 1.2.1 — 2018-03-21
- 1.2.0 — 2018-03-08
- 1.1.0 — 2018-03-02
- 1.0.8 — 2018-01-21
- 1.0.7 — 2018-01-20
- 1.0.6 — 2018-01-20
- 1.0.5 — 2018-01-19
- 1.0.4 — 2018-01-19
- … 2 more at https://npm.io/package/@wwu-restek/srapi/versions

## README

# StarRez API Wrapper for Node.js

This module (class) simplifies the process of implementing calls to StarRez's REST API by providing a few wrapper functions.

The module requires a file named sr-credentials.json in the project root (same directory as your main file).  This file is not included, for security reasons.  It should look something like:

```js
{
  "user": "<your StarRez user name with API permissions>",
  "token": "abcdefg1234567"
}
```

You'll have to get the token from the StarRez web client.  You cannot use your password.

## Documentation is not complete.

## Crash Course
The module exports a single class:  SRAPI.  You must instantiate an SRAPI object by passsing a boolean value indicating whether you want to use the production database. Otherwise, it defaults to the sandbox environment.

To use SRAPI, do something like this:

```js
const SRAPI = require('./srapi/api');

const sr = new SRAPI(false);

sr.get('Entry', 6410).then((me) => {
  console.log(me.NameFirst);
}).catch(console.error);
```

Refer to the JSDocs for more information about the various methods.

---
_Source: https://npm.io/package/@wwu-restek/srapi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
