@polymorphic/excal
v1.0.0-rc2
Published
A js client for our Exchange Calendar service.
Downloads
3
Readme
exCal
Exchange Calendar
A js client for our Exchange Calendar service.
Install
$ npm install --save @polymorphic/excal
Usage (javascript)
const exCal = require('excal').exCal;
exCal.setClientCode('123-456-789');
Usage (typeScript)
import { exCal } from 'excal';
exCal.setClientCode('123-456-789');
Examples
Get Availability
const location = 'Boardroom 1';
const date = new Date();
const email = '[email protected]';
const password = 'exchange_password';
const uri = 'https://exchange.co.za/EWS/Exchange.asmx';
exCal.getAvailability(location, date, email, password, uri).then(results => {});
Results
[{
start: Date,
end: Date,
duration: number
}]
Get Bookings
const location = 'Boardroom 1';
const date = new Date();
const email = '[email protected]';
const password = 'exchange_password';
const uri = 'https://exchange.co.za/EWS/Exchange.asmx';
exCal.getBookings(location, date, email, password, uri).then(results => {});
Results
[{
start: Date,
end: Date,
duration: number
}]
Post Booking
const email = '[email protected]';
const password = 'exchange_password';
const uri = 'https://exchange.co.za/EWS/Exchange.asmx';
const booking = {
location: 'Boardroom 1',
start: new Date(),
end: new Date(),
subject: 'The Meeting Name',
body: 'A description of the meeting'
};
exCal.postBooking(email, password, uri, booking);
Results
The result is a Promise
that returns void
;
Post Booking
const email = '[email protected]';
const password = 'exchange_password';
const uri = 'https://exchange.co.za/EWS/Exchange.asmx';
const booking = {
location: 'Boardroom 1',
start: new Date()
};
exCal.removeBooking(email, password, uri, booking);
Results
The result is a Promise
that returns void
;