start with tests

This commit is contained in:
Philipp Kunz 2016-05-15 19:51:48 +02:00
parent 6cc91c0a5e
commit b2182ec63d
16 changed files with 119 additions and 17 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ ts/**/*.js
ts/**/*.js.map ts/**/*.js.map
.idea/ .idea/
node_modules/ node_modules/
nogit/

15
dist/cflare.classes.cflareaccount.d.ts vendored Normal file
View File

@ -0,0 +1,15 @@
export declare class CflareAccount {
private authEmail;
private authKey;
private authCheck();
constructor();
auth(optionsArg: {
email: string;
key: string;
}): void;
createRecord(): any;
removeRecord(): any;
listRecords(domainName: string): any;
listDomains(): any;
request(methodArg: string, routeArg: string): any;
}

67
dist/cflare.classes.cflareaccount.js vendored Normal file

File diff suppressed because one or more lines are too long

0
dist/cflare.classes.helpers.d.ts vendored Normal file
View File

View File

@ -1,3 +1,3 @@
"use strict"; "use strict";
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJjZmxhcmUuY2xhc3Nlcy5oZWxwZXJzLmpzIiwic291cmNlc0NvbnRlbnQiOltdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ== //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJjZmxhcmUuY2xhc3Nlcy5oZWxwZXJzLmpzIiwic291cmNlc0NvbnRlbnQiOltdfQ==

View File

@ -1,10 +0,0 @@
"use strict";
var cflare = (function () {
function cflare() {
}
;
return cflare;
}());
;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNmbGFyZS5jbGFzc2VzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFJQTtJQUdJO0lBRUEsQ0FBQzs7SUFFTCxhQUFDO0FBQUQsQ0FQQSxBQU9DLElBQUE7QUFBQSxDQUFDIiwiZmlsZSI6ImNmbGFyZS5jbGFzc2VzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxuaW1wb3J0IHBsdWdpbnMgPSByZXF1aXJlKFwiLi9jZmxhcmUucGx1Z2luc1wiKTtcbmltcG9ydCBoZWxwZXJzID0gcmVxdWlyZShcIi4vY2ZsYXJlLmNsYXNzZXMuaGVscGVyc1wiKTtcblxuY2xhc3MgY2ZsYXJlIHtcbiAgICBwcml2YXRlIGF1dGhFbWFpbDpzdHJpbmc7XG4gICAgcHJpdmF0ZSBhdXRoS2V5OnN0cmluZztcbiAgICBjb25zdHJ1Y3Rvcigpe1xuICAgICAgICBcbiAgICB9O1xuICAgIFxufTsiXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=

3
dist/cflare.plugins.d.ts vendored Normal file
View File

@ -0,0 +1,3 @@
export declare let beautylog: any;
export declare let q: any;
export declare let request: any;

View File

@ -1,6 +1,7 @@
"use strict"; "use strict";
/// <reference path="./typings/main.d.ts" /> /// <reference path="./typings/main.d.ts" />
exports.beautylog = require("beautylog"); exports.beautylog = require("beautylog");
exports.q = require("q");
exports.request = require("request"); exports.request = require("request");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNmbGFyZS5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSw0Q0FBNEM7QUFDakMsaUJBQVMsR0FBRyxPQUFPLENBQUMsV0FBVyxDQUFDLENBQUM7QUFDakMsZUFBTyxHQUFHLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FBQyIsImZpbGUiOiJjZmxhcmUucGx1Z2lucy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cbmV4cG9ydCBsZXQgYmVhdXR5bG9nID0gcmVxdWlyZShcImJlYXV0eWxvZ1wiKTtcbmV4cG9ydCBsZXQgcmVxdWVzdCA9IHJlcXVpcmUoXCJyZXF1ZXN0XCIpOyJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ== //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNmbGFyZS5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSw0Q0FBNEM7QUFDakMsaUJBQVMsR0FBRyxPQUFPLENBQUMsV0FBVyxDQUFDLENBQUM7QUFDakMsU0FBQyxHQUFHLE9BQU8sQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNqQixlQUFPLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUFDIiwiZmlsZSI6ImNmbGFyZS5wbHVnaW5zLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxyXG5leHBvcnQgbGV0IGJlYXV0eWxvZyA9IHJlcXVpcmUoXCJiZWF1dHlsb2dcIik7XHJcbmV4cG9ydCBsZXQgcSA9IHJlcXVpcmUoXCJxXCIpO1xyXG5leHBvcnQgbGV0IHJlcXVlc3QgPSByZXF1aXJlKFwicmVxdWVzdFwiKTsiXX0=

1
dist/index.d.ts vendored Normal file
View File

@ -0,0 +1 @@
export { CflareAccount } from "./cflare.classes.cflareaccount";

5
dist/index.js vendored
View File

@ -1,3 +1,6 @@
"use strict"; "use strict";
/// <reference path="./typings/main.d.ts" />
var cflare_classes_cflareaccount_1 = require("./cflare.classes.cflareaccount");
exports.CflareAccount = cflare_classes_cflareaccount_1.CflareAccount;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0= //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSw0Q0FBNEM7QUFDNUMsNkNBQTRCLGdDQUFnQyxDQUFDO0FBQXJELHFFQUFxRCIsImZpbGUiOiJpbmRleC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cclxuZXhwb3J0IHtDZmxhcmVBY2NvdW50fSBmcm9tIFwiLi9jZmxhcmUuY2xhc3Nlcy5jZmxhcmVhY2NvdW50XCI7Il19

View File

@ -21,11 +21,11 @@
}, },
"homepage": "https://github.com/pushrocks/cflare#readme", "homepage": "https://github.com/pushrocks/cflare#readme",
"dependencies": { "dependencies": {
"beautylog": "^4.1.2", "beautylog": "^5.0.0",
"q": "^1.4.1", "q": "^1.4.1",
"request": "^2.72.0" "request": "^2.72.0"
}, },
"devDependencies": { "devDependencies": {
"npmts": "^5.0.4" "npmts": "^5.1.5"
} }
} }

0
test/test.d.ts vendored Normal file
View File

11
test/test.js Normal file
View File

@ -0,0 +1,11 @@
"use strict";
/// <reference path="../ts/typings/main.d.ts" />
var cflare = require("../dist/index");
var nogit = require("../nogit/nogit.json");
var testCflareAccount = new cflare.CflareAccount();
testCflareAccount.auth({
email: nogit.cfemail,
key: nogit.cfkey
});
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLGdEQUFnRDtBQUNoRCxJQUFPLE1BQU0sV0FBVyxlQUFlLENBQUMsQ0FBQztBQUN6QyxJQUFJLEtBQUssR0FBRyxPQUFPLENBQUMscUJBQXFCLENBQUMsQ0FBQztBQUUzQyxJQUFJLGlCQUFpQixHQUFHLElBQUksTUFBTSxDQUFDLGFBQWEsRUFBRSxDQUFDO0FBQ25ELGlCQUFpQixDQUFDLElBQUksQ0FBQztJQUNuQixLQUFLLEVBQUUsS0FBSyxDQUFDLE9BQU87SUFDcEIsR0FBRyxFQUFFLEtBQUssQ0FBQyxLQUFLO0NBQ25CLENBQUMsQ0FBQyIsImZpbGUiOiJ0ZXN0LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4uL3RzL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cclxuaW1wb3J0IGNmbGFyZSA9IHJlcXVpcmUoXCIuLi9kaXN0L2luZGV4XCIpO1xyXG5sZXQgbm9naXQgPSByZXF1aXJlKFwiLi4vbm9naXQvbm9naXQuanNvblwiKTtcclxuXHJcbmxldCB0ZXN0Q2ZsYXJlQWNjb3VudCA9IG5ldyBjZmxhcmUuQ2ZsYXJlQWNjb3VudCgpO1xyXG50ZXN0Q2ZsYXJlQWNjb3VudC5hdXRoKHtcclxuICAgIGVtYWlsOiBub2dpdC5jZmVtYWlsLFxyXG4gICAga2V5OiBub2dpdC5jZmtleVxyXG59KTtcclxuXHJcbiJdfQ==

10
test/test.ts Normal file
View File

@ -0,0 +1,10 @@
/// <reference path="../ts/typings/main.d.ts" />
import cflare = require("../dist/index");
let nogit = require("../nogit/nogit.json");
let testCflareAccount = new cflare.CflareAccount();
testCflareAccount.auth({
email: nogit.cfemail,
key: nogit.cfkey
});

View File

@ -2,7 +2,7 @@
import plugins = require("./cflare.plugins"); import plugins = require("./cflare.plugins");
import helpers = require("./cflare.classes.helpers"); import helpers = require("./cflare.classes.helpers");
class cflare { export class CflareAccount {
private authEmail:string; private authEmail:string;
private authKey:string; private authKey:string;
private authCheck(){ private authCheck(){

View File

@ -1,2 +1,2 @@
/// <reference path="./typings/main.d.ts" /> /// <reference path="./typings/main.d.ts" />
import plugins = require("./cflare.plugins"); export {CflareAccount} from "./cflare.classes.cflareaccount";