Files
cloudron-box/src/location.js
Girish Ramakrishnan 5c98b6f080 crash fixes
2023-08-17 13:02:36 +05:30

29 lines
864 B
JavaScript

'use strict';
const assert = require('assert');
class Location {
constructor(subdomain, domain, type, certificate) {
assert(subdomain === null || typeof subdomain === 'string');
assert(domain === null || typeof domain === 'string');
assert.strictEqual(typeof type, 'string');
this.subdomain = subdomain;
this.domain = domain;
this.type = type;
this.certificate = certificate || null;
this.fqdn = domain ? (subdomain + (subdomain ? '.' : '') + domain) : '';
}
}
// subdomain (table) types
Location.TYPE_PRIMARY = 'primary';
Location.TYPE_SECONDARY = 'secondary';
Location.TYPE_REDIRECT = 'redirect';
Location.TYPE_ALIAS = 'alias';
Location.TYPE_DASHBOARD = 'dashboard';
Location.TYPE_MAIL = 'mail';
Location.TYPE_DIRECTORY_SERVER = 'directoryserver';
exports = module.exports = Location;