Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

rentdynamics

RentDynamics11.7kMIT0.6.2TypeScript support: included

Package to help facilitate communicating with the Rent Dynamics API

Rent, Dynamics

readme

Rent Dynamics JS

Circle CI Badge codecov Dependency Status Dev Dependency Status Peer Dependency Status NPM Version MIT License

CDN

Include jsSHA and our CDN

<script src="https://cdnjs.cloudflare.com/ajax/libs/jsSHA/2.3.1/sha.js"></script>
<script src="https://cdnjs.rentdynamics.com/rentdynamics.latest.js"></script>
var options = {
  apiKey: '<insert-key-here>',
  apiSecretKey: '<insert-secret-key-here>'
};
var rdClient = new RentDynamics.Client(options);
rdClient.login('<username>', '<password>').then(function(result) {
  ...
});
// Then you can make api calls
rdClient.get('/data').then(function(result) {
  ...
});

NPM

Install with npm: npm install rentdynamics

import { Client } from 'rentdynamics';

let options = {
  apiKey: '<insert-key-here>',
  apiSecretKey: '<insert-secret-key-here>'
};
let rdClient = new Client(options);
rdClient.login('<username>', '<password>').then((result: object) => {
  ...
});
// Then you can make api calls
rdClient.get('/data').then((result: array | object) => {
  ...
});

Values

ClientOptions

  • apiKey: string (default is undefined)
  • apiSecretKey: string (default is undefined)
  • authToken: string (default is undefined)
  • development: boolean (default is false)
  • service: string (default is undefined)
  • developmentUrl: string (default is undefined) (This will only be used if development is set to true)
  • baseUrl: string (default is undefined) (This will only be used if development is set to false)

Client (requires a ClientOptions to be passed in)

  • get(endpoint: string): Promise<any>
  • put(endpoint: string, payload: object): Promise<any>
  • post(endpoint: string, payload: object): Promise<any>
  • delete(endpoint: string): Promise<any>
  • login(username: string, password: string): Promise<any>
  • logout(): Promise<any>

Available Endpoints

  • appointmentTimes for a given community group

    Examples

    There are 4 different ways to format the response.

  • only the time, no date (this is the default when the 'dateFormat' argument is omitted)

    rdClient.get(`/appointmentTimes/${communityGroupId}?appointmentDate=10/31/2019&dateFormat=timeonly`).then(function(result) {
    // result is a list of local appointmentTimes
    // Example: ["10:00 AM","10:15 AM",...,"05:15 PM","05:30 PM"]
    });
  • utc

    rdClient.get(`/appointmentTimes/${communityGroupId}?appointmentDate=10/31/2019&dateFormat=utc`).then(function(result) {
    // result is a list of appointmentTimes in utc
    // Example: ["2020-01-05T17:00:00Z","2020-01-05T17:15:00Z",...,"2020-01-06T00:15:00Z","2020-01-06T05:30:00Z"]
    });
  • the local time of the property without an offset

    rdClient.get(`/appointmentTimes/${communityGroupId}?appointmentDate=10/31/2019&dateFormat=localWithoutOffset`).then(function(result) {
    // result is a list of appointment dates & times in local time without any offset information
    // Example: ["2020-01-05T10:00:00","2020-01-05T10:15:00",...,"2020-01-05T17:15:00","2020-01-05T17:30:00"]
    });
  • the local time of the property with an offset

    rdClient.get(`/appointmentTimes/${communityGroupId}?appointmentDate=10/31/2019&dateFormat=localWithOffset`).then(function(result) {
    // result is a list of appointment dates & times in local time with the timezone offset of the property
    // Example: ["2020-01-05T10:00:00-0700","2020-01-05T10:15:00-0700",...,"2020-01-05T17:15:00-0700","2020-01-05T17:30:00-0700"]
    });

Testing

  • npm test > Runs all the tests and checks the code coverage.

changelog

Rent Dynamics JS Helpers Change Log

v0.6.1

Fixes

  • Fixed null response bug causing it to error out when parsing json

v0.5.2

Fixes

  • Fixed ReferenceError in our constructor

v0.5.1

Fixes

  • Fixed the way we access fetch to work on mobile applications

v0.5.0

Features

  • Updated the GET method to optionally take an object of query parameters

v0.4.0

Features

  • Updated the Network calls to work in a node environment

v0.3.0

Features

  • Added a logout function

v0.2.1

Features

  • Updated getBaseUrl to work better when using your own local environment

v0.2.0

Features

  • Updated getHeaders and getNonce to not always need an apiKey or apiSecretKey

v0.1.0

Features

  • Initial Release
  • Basic login
  • GET, PUT, POST, DELETE