now returning promises
This commit is contained in:
parent
229b652c69
commit
71dcdd0d66
10
README.md
10
README.md
@ -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:
|
||||
|
@ -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": {
|
||||
|
@ -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;
|
||||
}
|
||||
};
|
@ -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");
|
Loading…
Reference in New Issue
Block a user