mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
30 lines
529 B
TypeScript
30 lines
529 B
TypeScript
import CW = require('simple-cw-node');
|
|
var client = CW();
|
|
var Deferred:any = client.Deferred;
|
|
|
|
// initialize.
|
|
client.init({ token: 'YOUR_TOKEN' });
|
|
|
|
// get your info.
|
|
client.get('me', function (err, res) {
|
|
console.log(arguments);
|
|
});
|
|
|
|
// create room.
|
|
client.post('rooms', {
|
|
name: 'room',
|
|
members_admin_ids: '123456789,987654321',
|
|
description: 'description'
|
|
}, (err, res) => {
|
|
console.log('created.');
|
|
});
|
|
|
|
client
|
|
.get('me')
|
|
.done((res:any) => {
|
|
console.log(res.body)
|
|
})
|
|
.fail((err:any) => {
|
|
console.error(err);
|
|
});
|