fix(core): update

This commit is contained in:
2020-02-10 11:26:13 +00:00
parent 12f4456ebd
commit 7ec0fe78fc
7 changed files with 141 additions and 420 deletions

View File

@ -112,6 +112,9 @@ export class CloudflareAccount {
throw new Error(`could not remove record for ${domainNameArg} with type ${typeArg}`);
}
},
/**
* cleanrecord allows the cleaning of any previous records to avoid unwanted sideeffects
*/
/**
* updates a record
* @param domainNameArg
@ -164,6 +167,14 @@ export class CloudflareAccount {
purge_everything: true
};
const respone = await this.request('DELETE', requestUrl, payload);
},
// acme convenience functions
acmeSetDnsChallenge: async (dnsChallenge: plugins.tsclass.network.IDnsChallenge) => {
await this.convenience.removeRecord(dnsChallenge.hostName, 'TXT');
await this.convenience.createRecord(dnsChallenge.hostName, 'TXT', dnsChallenge.challenge);
},
acmeRemoveDnsChallenge: async (dnsChallenge: plugins.tsclass.network.IDnsChallenge) => {
await this.convenience.removeRecord(dnsChallenge.hostName, 'TXT');
}
};

View File

View File

@ -2,5 +2,5 @@ import * as plugins from './cloudflare.plugins';
import * as interfaces from './interfaces';
export class CloudflareZone {
// TODO
public static async createFromApiObject() {}
}

View File

@ -8,4 +8,6 @@ export class ZoneManager {
constructor(cfAccountArg: CloudflareAccount) {
this.cfAccount = cfAccountArg;
}
public getZones() {}
}