cf change wip

This commit is contained in:
noot
2024-08-13 01:29:57 +08:00
parent e86de04a69
commit c38d2c6d0c
4 changed files with 142 additions and 493 deletions
+4 -1
View File
@@ -11,6 +11,7 @@ const tldExtract = require('tld-extract').parse_host;
const providers = {
PorkBun: require('./dns_provider/porkbun'),
DigitalOcean: require('./dns_provider/digitalocean'),
Cloudflare: require('./dns_provider/cloudflare'),
};
class Domain extends Table{
@@ -52,6 +53,7 @@ class DnsProvider extends Table{
'id': {default: ()=>crypto.randomBytes(8).toString("hex")},
'name': {isRequired: true, type: 'string'},
'dnsProvider': {isRequired: true, type: 'string'},
'zoneId': {isRequired: false, type: 'string'},
}
static __intraModel(provider){
@@ -112,7 +114,8 @@ class DnsProvider extends Table{
await Domain.create({
created_by: this.created_by,
domain: domain.domain,
dnsProvider_id: this.id
dnsProvider_id: this.id,
zoneId: domain.id,
});
}
}