Files
cloudron-box/src/dns/noop.js

67 lines
1.8 KiB
JavaScript
Raw Normal View History

'use strict';
exports = module.exports = {
2021-08-13 17:22:28 -07:00
removePrivateFields,
injectPrivateFields,
upsert,
get,
del,
wait,
verifyDomainConfig
};
2021-08-13 17:22:28 -07:00
const assert = require('assert'),
debug = require('debug')('box:dns/noop');
function removePrivateFields(domainObject) {
return domainObject;
}
2019-10-23 10:02:04 -07:00
// eslint-disable-next-line no-unused-vars
function injectPrivateFields(newConfig, currentConfig) {
}
async function upsert(domainObject, location, type, values) {
assert.strictEqual(typeof domainObject, 'object');
assert.strictEqual(typeof location, 'string');
assert.strictEqual(typeof type, 'string');
2021-05-02 11:26:08 -07:00
assert(Array.isArray(values));
debug('upsert: %s for zone %s of type %s with values %j', location, domainObject.zoneName, type, values);
return;
}
async function get(domainObject, location, type) {
assert.strictEqual(typeof domainObject, 'object');
assert.strictEqual(typeof location, 'string');
assert.strictEqual(typeof type, 'string');
return []; // returning ip confuses apptask into thinking the entry already exists
}
async function del(domainObject, location, type, values) {
assert.strictEqual(typeof domainObject, 'object');
assert.strictEqual(typeof location, 'string');
assert.strictEqual(typeof type, 'string');
2021-05-02 11:26:08 -07:00
assert(Array.isArray(values));
return;
}
async function wait(domainObject, location, type, value, options) {
assert.strictEqual(typeof domainObject, 'object');
assert.strictEqual(typeof location, 'string');
assert.strictEqual(typeof type, 'string');
assert.strictEqual(typeof value, 'string');
assert(options && typeof options === 'object'); // { interval: 5000, times: 50000 }
// do nothing
}
async function verifyDomainConfig(domainObject) {
assert.strictEqual(typeof domainObject, 'object');
return {};
}