now using tsclass
This commit is contained in:
parent
d3d5f72193
commit
9c036925fd
7
dist/cflare.classes.cflareaccount.d.ts
vendored
7
dist/cflare.classes.cflareaccount.d.ts
vendored
@ -1,5 +1,6 @@
|
||||
import 'typings-global';
|
||||
import * as interfaces from './cflare.interfaces';
|
||||
import { TDnsRecord } from 'tsclass';
|
||||
export declare class CflareAccount {
|
||||
private authEmail;
|
||||
private authKey;
|
||||
@ -9,9 +10,9 @@ export declare class CflareAccount {
|
||||
key: string;
|
||||
}): void;
|
||||
getZoneId(domainName: string): Promise<string>;
|
||||
getRecord(domainNameArg: string, typeArg: interfaces.TRecord): Promise<interfaces.ICflareRecord>;
|
||||
createRecord(domainNameArg: string, typeArg: interfaces.TRecord, contentArg: string): Promise<{}>;
|
||||
removeRecord(domainNameArg: string, typeArg: interfaces.TRecord): Promise<{}>;
|
||||
getRecord(domainNameArg: string, typeArg: TDnsRecord): Promise<interfaces.ICflareRecord>;
|
||||
createRecord(domainNameArg: string, typeArg: TDnsRecord, contentArg: string): Promise<{}>;
|
||||
removeRecord(domainNameArg: string, typeArg: TDnsRecord): Promise<{}>;
|
||||
updateRecord(domainNameArg: string, typeArg: string, valueArg: any): Promise<{}>;
|
||||
/**
|
||||
* list all records of a specified domain name
|
||||
|
3
dist/cflare.classes.cflareaccount.js
vendored
3
dist/cflare.classes.cflareaccount.js
vendored
File diff suppressed because one or more lines are too long
1
dist/cflare.interfaces.d.ts
vendored
1
dist/cflare.interfaces.d.ts
vendored
@ -1,4 +1,3 @@
|
||||
export declare type TRecord = 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'SRV' | 'LOC' | 'MX' | 'NS' | 'SPF';
|
||||
export interface ICflareZone {
|
||||
'id': string;
|
||||
'name': string;
|
||||
|
12
dist/cflare.plugins.d.ts
vendored
12
dist/cflare.plugins.d.ts
vendored
@ -1,6 +1,8 @@
|
||||
import 'typings-global';
|
||||
export declare let beautylog: any;
|
||||
export import q = require('smartq');
|
||||
export import smartrequest = require('smartrequest');
|
||||
export import smartstring = require('smartstring');
|
||||
export import smartdelay = require('smartdelay');
|
||||
import * as beautylog from 'beautylog';
|
||||
import * as q from 'smartq';
|
||||
import * as smartdelay from 'smartdelay';
|
||||
import * as smartrequest from 'smartrequest';
|
||||
import * as smartstring from 'smartstring';
|
||||
import * as tsclass from 'tsclass';
|
||||
export { beautylog, q, smartdelay, smartrequest, smartstring, tsclass };
|
||||
|
19
dist/cflare.plugins.js
vendored
19
dist/cflare.plugins.js
vendored
@ -1,9 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
require("typings-global");
|
||||
exports.beautylog = require('beautylog');
|
||||
exports.q = require("smartq");
|
||||
exports.smartrequest = require("smartrequest");
|
||||
exports.smartstring = require("smartstring");
|
||||
exports.smartdelay = require("smartdelay");
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2ZsYXJlLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9jZmxhcmUucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF1QjtBQUNaLFFBQUEsU0FBUyxHQUFHLE9BQU8sQ0FBQyxXQUFXLENBQUMsQ0FBQTtBQUMzQyw4QkFBbUM7QUFDbkMsK0NBQW9EO0FBQ3BELDZDQUFrRDtBQUNsRCwyQ0FBZ0QifQ==
|
||||
const beautylog = require("beautylog");
|
||||
exports.beautylog = beautylog;
|
||||
const q = require("smartq");
|
||||
exports.q = q;
|
||||
const smartdelay = require("smartdelay");
|
||||
exports.smartdelay = smartdelay;
|
||||
const smartrequest = require("smartrequest");
|
||||
exports.smartrequest = smartrequest;
|
||||
const smartstring = require("smartstring");
|
||||
exports.smartstring = smartstring;
|
||||
const tsclass = require("tsclass");
|
||||
exports.tsclass = tsclass;
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2ZsYXJlLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9jZmxhcmUucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDBCQUF1QjtBQUN2Qix1Q0FBc0M7QUFRcEMsOEJBQVM7QUFQWCw0QkFBMkI7QUFRekIsY0FBQztBQVBILHlDQUF3QztBQVF0QyxnQ0FBVTtBQVBaLDZDQUE0QztBQVExQyxvQ0FBWTtBQVBkLDJDQUEwQztBQVF4QyxrQ0FBVztBQVBiLG1DQUFrQztBQVFoQywwQkFBTyJ9
|
@ -27,6 +27,7 @@
|
||||
"smartq": "^1.1.1",
|
||||
"smartrequest": "^1.0.6",
|
||||
"smartstring": "^2.0.24",
|
||||
"tsclass": "^1.0.12",
|
||||
"typings-global": "^1.0.17"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -2,11 +2,14 @@ import 'typings-global'
|
||||
import plugins = require('./cflare.plugins')
|
||||
import * as interfaces from './cflare.interfaces'
|
||||
|
||||
// interfaces
|
||||
import { TDnsRecord } from 'tsclass'
|
||||
|
||||
export class CflareAccount {
|
||||
private authEmail: string
|
||||
private authKey: string
|
||||
constructor() {
|
||||
|
||||
// Nothing here
|
||||
}
|
||||
|
||||
auth (optionsArg: { email: string, key: string }) {
|
||||
@ -28,7 +31,7 @@ export class CflareAccount {
|
||||
}
|
||||
|
||||
}
|
||||
getRecord (domainNameArg: string, typeArg: interfaces.TRecord): Promise<interfaces.ICflareRecord> {
|
||||
getRecord (domainNameArg: string, typeArg: TDnsRecord): Promise<interfaces.ICflareRecord> {
|
||||
let done = plugins.q.defer()
|
||||
let result: interfaces.ICflareRecord
|
||||
|
||||
@ -43,7 +46,7 @@ export class CflareAccount {
|
||||
return done.promise
|
||||
}
|
||||
|
||||
async createRecord (domainNameArg: string, typeArg: interfaces.TRecord, contentArg: string) {
|
||||
async createRecord (domainNameArg: string, typeArg: TDnsRecord, contentArg: string) {
|
||||
let done = plugins.q.defer()
|
||||
let domain = new plugins.smartstring.Domain(domainNameArg)
|
||||
let domainIdArg = await this.getZoneId(domain.zoneName)
|
||||
@ -59,7 +62,7 @@ export class CflareAccount {
|
||||
return done.promise
|
||||
}
|
||||
|
||||
removeRecord (domainNameArg: string, typeArg: interfaces.TRecord) {
|
||||
removeRecord (domainNameArg: string, typeArg: TDnsRecord) {
|
||||
let done = plugins.q.defer()
|
||||
let domain = new plugins.smartstring.Domain(domainNameArg)
|
||||
this.getRecord(domain.fullName, typeArg)
|
||||
|
@ -1,7 +1,5 @@
|
||||
import * as plugins from './cflare.plugins'
|
||||
|
||||
export type TRecord = 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'SRV' | 'LOC' | 'MX' | 'NS' | 'SPF'
|
||||
|
||||
export interface ICflareZone {
|
||||
'id': string
|
||||
'name': string
|
||||
|
@ -1,6 +1,16 @@
|
||||
import 'typings-global'
|
||||
export let beautylog = require('beautylog')
|
||||
export import q = require('smartq')
|
||||
export import smartrequest = require('smartrequest')
|
||||
export import smartstring = require('smartstring')
|
||||
export import smartdelay = require('smartdelay')
|
||||
import * as beautylog from 'beautylog'
|
||||
import * as q from 'smartq'
|
||||
import * as smartdelay from 'smartdelay'
|
||||
import * as smartrequest from 'smartrequest'
|
||||
import * as smartstring from 'smartstring'
|
||||
import * as tsclass from 'tsclass'
|
||||
|
||||
export {
|
||||
beautylog,
|
||||
q,
|
||||
smartdelay,
|
||||
smartrequest,
|
||||
smartstring,
|
||||
tsclass
|
||||
}
|
||||
|
@ -606,6 +606,10 @@ through2@^2.0.1:
|
||||
readable-stream "^2.1.5"
|
||||
xtend "~4.0.1"
|
||||
|
||||
tsclass@^1.0.12:
|
||||
version "1.0.12"
|
||||
resolved "https://registry.yarnpkg.com/tsclass/-/tsclass-1.0.12.tgz#350c4e567ca7ae7fa426b95bbb77ec478ec0edef"
|
||||
|
||||
type-detect@0.1.1:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822"
|
||||
|
Loading…
Reference in New Issue
Block a user