From 496ba986bfeed47bafe9b91408c7cfc4e72eff4e Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Tue, 22 Jan 2019 12:12:46 +0100 Subject: [PATCH] Add missing wait() function for namecheap backend --- src/dns/namecheap.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/dns/namecheap.js b/src/dns/namecheap.js index e834cf5da..380cb39df 100644 --- a/src/dns/namecheap.js +++ b/src/dns/namecheap.js @@ -4,8 +4,8 @@ exports = module.exports = { upsert: upsert, get: get, del: del, - waitForDns: require('./waitfordns.js'), - verifyDnsConfig: verifyDnsConfig + verifyDnsConfig: verifyDnsConfig, + wait: wait }; var assert = require('assert'), @@ -15,7 +15,8 @@ var assert = require('assert'), DomainsError = require('../domains.js').DomainsError, Namecheap = require('namecheap'), sysinfo = require('../sysinfo.js'), - util = require('util'); + util = require('util'), + waitForDns = require('./waitfordns.js'); var namecheap; @@ -263,3 +264,16 @@ function verifyDnsConfig(domainObject, callback) { }); }); } + +function wait(domainObject, subdomain, type, value, options, callback) { + assert.strictEqual(typeof domainObject, 'object'); + assert.strictEqual(typeof subdomain, 'string'); + assert.strictEqual(typeof type, 'string'); + assert.strictEqual(typeof value, 'string'); + assert(options && typeof options === 'object'); // { interval: 5000, times: 50000 } + assert.strictEqual(typeof callback, 'function'); + + const fqdn = domains.fqdn(subdomain, domainObject); + + waitForDns(fqdn, domainObject.zoneName, type, value, options, callback); +}