Compare commits

..

3 Commits

Author SHA1 Message Date
208fba0887 1.0.1 2017-06-04 18:09:49 +02:00
2f065b57fc add type TRecord, update ci 2017-06-04 18:09:46 +02:00
3503fbc7b3 1.0.0 2017-06-04 17:31:10 +02:00
8 changed files with 26 additions and 14 deletions

View File

@ -1,4 +1,10 @@
image: hosttoday/ht-docker-node:npmts # gitzone standard
image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .yarn/
key: "$CI_BUILD_STAGE"
stages: stages:
- test - test
@ -10,6 +16,7 @@ testLEGACY:
stage: test stage: test
script: script:
- npmci test legacy - npmci test legacy
coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
allow_failure: true allow_failure: true
@ -18,6 +25,7 @@ testLTS:
stage: test stage: test
script: script:
- npmci test lts - npmci test lts
coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
@ -25,6 +33,7 @@ testSTABLE:
stage: test stage: test
script: script:
- npmci test stable - npmci test stable
coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
@ -47,10 +56,13 @@ trigger:
- docker - docker
pages: pages:
image: hosttoday/ht-docker-node:npmpage image: hosttoday/ht-docker-node:npmci
stage: pages stage: pages
script: script:
- npmci command npmpage --publish gitlab - npmci command yarn global add npmpage
- npmci command npmpage
tags:
- docker
only: only:
- tags - tags
artifacts: artifacts:

View File

@ -9,9 +9,9 @@ export declare class CflareAccount {
key: string; key: string;
}): void; }): void;
getZoneId(domainName: string): Promise<string>; getZoneId(domainName: string): Promise<string>;
getRecord(domainNameArg: string, typeArg: string): Promise<interfaces.ICflareRecord>; getRecord(domainNameArg: string, typeArg: interfaces.TRecord): Promise<interfaces.ICflareRecord>;
createRecord(domainNameArg: string, typeArg: string, contentArg: string): Promise<{}>; createRecord(domainNameArg: string, typeArg: interfaces.TRecord, contentArg: string): Promise<{}>;
removeRecord(domainNameArg: string, typeArg: string): Promise<{}>; removeRecord(domainNameArg: string, typeArg: interfaces.TRecord): Promise<{}>;
updateRecord(domainNameArg: string, typeArg: string, valueArg: any): Promise<{}>; updateRecord(domainNameArg: string, typeArg: string, valueArg: any): Promise<{}>;
/** /**
* list all records of a specified domain name * list all records of a specified domain name

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
export declare type TRecord = ''; export declare type TRecord = 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'SRV' | 'LOC' | 'MX' | 'NS' | 'SPF';
export interface ICflareZone { export interface ICflareZone {
'id': string; 'id': string;
'name': string; 'name': string;

View File

@ -1,6 +1,6 @@
{ {
"name": "cflare", "name": "cflare",
"version": "0.0.20", "version": "1.0.1",
"description": "easy cloudflare management", "description": "easy cloudflare management",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "dist/index.d.ts", "typings": "dist/index.d.ts",

View File

@ -27,7 +27,7 @@ export class CflareAccount {
} }
} }
getRecord (domainNameArg: string, typeArg: string): Promise<interfaces.ICflareRecord> { getRecord (domainNameArg: string, typeArg: interfaces.TRecord): Promise<interfaces.ICflareRecord> {
let done = plugins.q.defer() let done = plugins.q.defer()
let result: interfaces.ICflareRecord let result: interfaces.ICflareRecord
@ -42,7 +42,7 @@ export class CflareAccount {
return done.promise return done.promise
} }
async createRecord (domainNameArg: string, typeArg: string, contentArg: string) { async createRecord (domainNameArg: string, typeArg: interfaces.TRecord, contentArg: string) {
let done = plugins.q.defer() let done = plugins.q.defer()
let domain = new plugins.smartstring.Domain(domainNameArg) let domain = new plugins.smartstring.Domain(domainNameArg)
let domainIdArg = await this.getZoneId(domain.zoneName) let domainIdArg = await this.getZoneId(domain.zoneName)
@ -58,7 +58,7 @@ export class CflareAccount {
return done.promise return done.promise
} }
removeRecord (domainNameArg: string, typeArg: string) { removeRecord (domainNameArg: string, typeArg: interfaces.TRecord) {
let done = plugins.q.defer() let done = plugins.q.defer()
let domain = new plugins.smartstring.Domain(domainNameArg) let domain = new plugins.smartstring.Domain(domainNameArg)
this.getRecord(domain.fullName, typeArg) this.getRecord(domain.fullName, typeArg)

View File

@ -1,6 +1,6 @@
import * as plugins from './cflare.plugins' import * as plugins from './cflare.plugins'
export type TRecord = '' export type TRecord = 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'SRV' | 'LOC' | 'MX' | 'NS' | 'SPF'
export interface ICflareZone { export interface ICflareZone {
'id': string 'id': string

View File

@ -1,2 +1,2 @@
import "typings-global"; import 'typings-global'
export {CflareAccount} from "./cflare.classes.cflareaccount"; export {CflareAccount} from "./cflare.classes.cflareaccount";