@topgroup/diginext
Version:
A BUILD SERVER & CLI to deploy apps to any Kubernetes clusters.
59 lines (58 loc) • 2.97 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.dxDeleteDomainRecord = exports.dxUpdateDomainRecord = exports.dxGetDomainRecordByName = exports.dxGetAllDomainRecords = exports.dxGetDomains = exports.dxCreateDomain = void 0;
const app_config_1 = require("../../app.config");
const const_1 = require("../../config/const");
const dx_api_1 = require("./dx-api");
async function dxCreateDomain(params, dxKey, options) {
if ((0, app_config_1.IsTest)())
return { status: 1, data: { domain: `${params.name}.${const_1.DIGINEXT_DOMAIN}`, domain_record: "" } };
return (0, dx_api_1.dxApi)({ url: "/domains/create", data: params, method: "POST", dxKey, isDebugging: options === null || options === void 0 ? void 0 : options.isDebugging });
}
exports.dxCreateDomain = dxCreateDomain;
async function dxGetDomains(dxKey, options) {
if ((0, app_config_1.IsTest)())
return { status: 1, data: [] };
return (0, dx_api_1.dxApi)({ url: "/domains", method: "GET", dxKey, isDebugging: options === null || options === void 0 ? void 0 : options.isDebugging });
}
exports.dxGetDomains = dxGetDomains;
async function dxGetAllDomainRecords(dxKey, options) {
if ((0, app_config_1.IsTest)())
return { status: 1, data: [] };
return (0, dx_api_1.dxApi)({ url: `/domains/records`, method: "GET", dxKey, isDebugging: options === null || options === void 0 ? void 0 : options.isDebugging });
}
exports.dxGetAllDomainRecords = dxGetAllDomainRecords;
async function dxGetDomainRecordByName(recordQuery, dxKey, options) {
if ((0, app_config_1.IsTest)())
return { status: 1, data: [] };
return (0, dx_api_1.dxApi)({
url: `/domains/records/${recordQuery.name}?type=${recordQuery.type}`,
method: "GET",
dxKey,
isDebugging: options === null || options === void 0 ? void 0 : options.isDebugging,
});
}
exports.dxGetDomainRecordByName = dxGetDomainRecordByName;
async function dxUpdateDomainRecord(recordQuery, recordData, dxKey, options) {
if ((0, app_config_1.IsTest)())
return { status: 1, data: { domain: `${recordData.name}.${const_1.DIGINEXT_DOMAIN}`, domain_record: "" } };
return (0, dx_api_1.dxApi)({
url: `/domains/records/${recordQuery.name}?type=${recordQuery.type}`,
data: recordData,
method: "PATCH",
dxKey,
isDebugging: options === null || options === void 0 ? void 0 : options.isDebugging,
});
}
exports.dxUpdateDomainRecord = dxUpdateDomainRecord;
async function dxDeleteDomainRecord(recordQuery, dxKey, options) {
if ((0, app_config_1.IsTest)())
return { status: 1, data: {} };
return (0, dx_api_1.dxApi)({
url: `/domains/records/${recordQuery.name}?type=${recordQuery.type}`,
method: "DELETE",
dxKey,
isDebugging: options === null || options === void 0 ? void 0 : options.isDebugging,
});
}
exports.dxDeleteDomainRecord = dxDeleteDomainRecord;