now using tsclass
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user