wrms
v0.0.3
Published
WRMS API wrapper
Downloads
11
Readme
WRMS interface
An API client interface to WRMS.
Usage
const WRMS = require('wrms')
const wrms = new WRMS({
endpoint: 'https://wrms.example.org',
username: 'username',
password: 'password'
})
wrms.user.lookup({field: 'email', key: '[email protected]'})
.then((res) => {
// res is a resultset of users
})
wrms.work_request.search({q: 'search term'})
.then((res) => {
// res is a resultset of work requests
})
Tests
Credentials for tests live in .env
. These need to be valid for your WRMS environment (eg WRMS_TEST_USER_MAIL
will be an existing user's email). See tests for more.
WRMS_URL=https://wrms.example.org
WRMS_USERNAME=exampleuser
WRMS_PASSWORD=secretpass
[email protected]
WRMS_TEST_WR_SEARCH_TERM="search term"
WRMS_TEST_WR_ID=123
But wait! There's more variables you can set in .env
.
WRMS_SSL_INSECURE=true
when someone forgets to renew a cert
TODO
- Permit
new WRMS(creds)
to accept{ endpoint: 'xx', wrms3_auth: 'xyz' }
if we already have a cookie. (Is this a good idea or does it encourage bad ones?) - Do we need WRMSv2 API endpoints? Seems like there are some useful parts there, like "recent timesheets".
- If
WRMS_EXTRA_COOKIES
isn't set, politely reject calls to v2 API. docs/assign-user.js
- WRMS forms don't let you easily assign a user to a ticket outside their systems, but I suspect API will.- Is
api.php/times/record
API v1, andapi2/request_update
API v2? Does API v2 correspond to WRMS v3? (api2/login
returnswrms3_auth
cookie). Yes. API v1 is WRMS v2; API v2 is WRMS v3.
References
- WRMS3
- WRMS API v2
- WRMS API v1
- PHP client libs
- Perl client libs
- WR#286231: Port wr.php to WRMSv3 and make it API driven
Related projects
Other things that might be of interest.