npm.io
1.0.0-rc2 • Published 8 years ago

@polymorphic/excal

Licence
LicenseRef-LICENSE
Version
1.0.0-rc2
Deps
0
Size
7 kB
Vulns
0
Weekly
0

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 = 'user@exchange.co.za';
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 = 'user@exchange.co.za';
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 = 'user@exchange.co.za';
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 = 'user@exchange.co.za';
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;