now returning promises

This commit is contained in:
Philipp Kunz 2016-04-27 03:08:14 +02:00
parent 229b652c69
commit 71dcdd0d66
4 changed files with 34 additions and 6 deletions

View File

@ -18,11 +18,11 @@ cflareInstance.auth({
key:""
});
cflareInstance.createRecord();
cflareInstance.removeRecord();
cflareInstance.copyRecord();
cflareInstance.listRecords();
cflareInstance.listDomains();
cflareInstance.createRecord(); // returns promise with resolve function getting the response;
cflareInstance.removeRecord(); // returns promise with resolve function getting the response;
cflareInstance.copyRecord(); // returns promise with resolve function getting the response;
cflareInstance.listRecords(); // returns promise with resolve function getting the response;
cflareInstance.listDomains(); // returns promise with resolve function getting the response;
```
### About the authors:

View File

@ -22,6 +22,7 @@
"homepage": "https://github.com/pushrocks/cflare#readme",
"dependencies": {
"beautylog": "^4.1.2",
"q": "^1.4.1",
"request": "^2.72.0"
},
"devDependencies": {

View File

@ -5,8 +5,34 @@ import helpers = require("./cflare.classes.helpers");
class cflare {
private authEmail:string;
private authKey:string;
private authCheck(){
return (this.authEmail && this.authKey); //check if auth is available
}
constructor(){
};
auth(optionsArg:{email:string,key:string}){
this.authEmail = optionsArg.email;
this.authKey = optionsArg.key;
}
createRecord(){
let done = plugins.q.defer();
return done.promise;
};
removeRecord(){
let done = plugins.q.defer();
return done.promise;
};
listRecords(){
let done = plugins.q.defer();
return done.promise;
}
listDomains(){
let done = plugins.q.defer();
return done.promise;
};
request(){
let done = plugins.q.defer();
return done.promise;
}
};

View File

@ -1,3 +1,4 @@
/// <reference path="./typings/main.d.ts" />
export let beautylog = require("beautylog");
export let q = require("q");
export let request = require("request");