@kineticdata/react
Version:
A React library for the Kinetic Platform
649 lines (647 loc) • 30.8 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.updateTenant = exports.updateSystemUser = exports.updateSystemSecurity = exports.updateSystemIngress = exports.updateSystemFilestore = exports.updateSystemDefaultSmtpAdapter = exports.updateSystemDefaultSQLDbAdapter = exports.updateSystem = exports.updateElasticSearchConfig = exports.updateCassandraConfig = exports.systemLogin = exports.rotateEncryptionKey = exports.restartTenantDeployments = exports.restartResources = exports.resetSystemLicense = exports.refreshSystemToken = exports.postPlatformComponentRestart = exports.migrateTenant = exports.importSystemLicense = exports.fetchTrustedCertificates = exports.fetchTenants = exports.fetchTenantDeploymentStatus = exports.fetchTenant = exports.fetchTaskDbAdapters = exports.fetchTaskDbAdapter = exports.fetchSystemUser = exports.fetchSystemSecurity = exports.fetchSystemLicenseStats = exports.fetchSystemLicenseCheck = exports.fetchSystemLicense = exports.fetchSystemIngress = exports.fetchSystemFilestore = exports.fetchSystemDefaultSmtpAdapter = exports.fetchSystemDefaultSQLDbAdapter = exports.fetchSystemBackgroundTasks = exports.fetchSystemBackgroundTask = exports.fetchSystem = exports.fetchPlatformComponentStatus = exports.fetchNotifications = exports.fetchNotificationLabels = exports.fetchElasticSearchConfig = exports.fetchCassandraConfig = exports.deleteTrustedCertificate = exports.deleteTenant = exports.deleteSystemLicense = exports.deleteSystemBackgroundTask = exports.createTrustedCertificate = exports.createTenant = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
var _axios = _interopRequireDefault(require("axios"));
var _http = require("../http");
var fetchTenants = exports.fetchTenants = function fetchTenants() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
// Build URL and fetch the space.
return _axios["default"].get('/app/system-coordinator/api/v1/tenants', {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
tenants: response.data.tenants,
nextPageToken: response.data.nextPageToken
};
})["catch"](_http.handleErrors);
};
var fetchTenant = exports.fetchTenant = function fetchTenant() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var slug = options.slug;
if (!slug) {
throw new Error('fetchTenant failed! The option "slug" is required.');
}
// Build URL and fetch the space.
return _axios["default"].get("/app/system-coordinator/api/v1/tenants/".concat(slug), {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
tenant: response.data.tenant
};
})["catch"](_http.handleErrors);
};
var updateTenant = exports.updateTenant = function updateTenant() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var slug = options.slug,
tenant = options.tenant,
multipart = options.multipart;
if (!tenant) {
throw new Error('updateTenant failed! The option "tenant" is required.');
}
if (!slug) {
throw new Error('updateTenant failed! The option "slug" is required.');
}
return _axios["default"].put("/app/system-coordinator/api/v1/tenants/".concat(slug), !multipart ? tenant : (0, _http.formDataBuilder)(tenant), {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
tenant: response.data.tenant
};
})["catch"](_http.handleErrors);
};
var createTenant = exports.createTenant = function createTenant() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var tenant = options.tenant,
multipart = options.multipart;
if (!tenant) {
throw new Error('createTenant failed! The option "tenant" is required.');
}
return _axios["default"].post('/app/system-coordinator/api/v1/tenants', !multipart ? tenant : (0, _http.formDataBuilder)(tenant), {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
tenant: response.data.tenant
};
})["catch"](_http.handleErrors);
};
var migrateTenant = exports.migrateTenant = function migrateTenant() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var slug = options.slug,
tenant = options.tenant,
multipart = options.multipart;
if (!tenant) {
throw new Error('migrateTenant failed! The option "tenant" is required.');
}
if (!slug) {
throw new Error('migrateTenant failed! The option "slug" is required.');
}
return _axios["default"].post("/app/system-coordinator/api/v1/tenants/".concat(slug), !multipart ? tenant : (0, _http.formDataBuilder)(tenant), {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
tenant: response.data.tenant
};
})["catch"](_http.handleErrors);
};
var deleteTenant = exports.deleteTenant = function deleteTenant() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var slug = options.slug;
if (!slug) {
throw new Error('createTenant failed! The option "slug" is required.');
}
return _axios["default"]["delete"]("/app/system-coordinator/api/v1/tenants/".concat(slug), {
params: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, (0, _http.paramBuilder)(options)), {}, {
deleteDatabase: options.deleteDatabase || undefined
}),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
tenant: response.data.tenant
};
})["catch"](_http.handleErrors);
};
var fetchTenantDeploymentStatus = exports.fetchTenantDeploymentStatus = function fetchTenantDeploymentStatus() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var slug = options.slug,
deployment = options.deployment;
if (!slug) {
throw new Error('fetchTenantTaskStatus failed! The option "slug" is required.');
}
if (!deployment) {
throw new Error('fetchTenantTaskStatus failed! The option "deployment" is required.');
}
return _axios["default"].get("/app/system-coordinator/api/v1/tenants/".concat(slug, "/deployments/").concat(deployment, "/status")).then(function (_ref) {
var data = _ref.data;
return {
deployment: data
};
})["catch"](_http.handleErrors);
};
// Restarts deployments for tenant(s).
// If `slug` is omitted, all tenants will have their deployment(s) restarted.
// If `deployment` is omitted, all deployments will be restarted.
var restartTenantDeployments = exports.restartTenantDeployments = function restartTenantDeployments() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var slug = options.slug,
deployment = options.deployment;
return _axios["default"].post("/app/system-coordinator/api/v1/tenants/".concat(slug ? "".concat(slug, "/") : '', "deployments/").concat(deployment ? "".concat(deployment, "/") : '', "restart"), {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return response.data;
})["catch"](_http.handleErrors);
};
var fetchSystem = exports.fetchSystem = function fetchSystem() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
// Build URL and fetch the system config.
return _axios["default"].get('/app/system-coordinator/components/core/app/api/v1/config', {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
system: response.data
};
})["catch"](_http.handleErrors);
};
var updateSystem = exports.updateSystem = function updateSystem() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var system = options.system;
if (!system) {
throw new Error('updateSystem failed! The option "system" is required.');
}
// Build URL and fetch the system config.
return _axios["default"].put('/app/system-coordinator/components/core/app/api/v1/config', system, {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
system: response.data
};
})["catch"](_http.handleErrors);
};
var fetchSystemUser = exports.fetchSystemUser = function fetchSystemUser() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
// Build URL and fetch the space.
return _axios["default"].get('/app/system-coordinator/api/v1/platform/system-user', {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
user: response.data
};
})["catch"](_http.handleErrors);
};
var updateSystemUser = exports.updateSystemUser = function updateSystemUser() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var user = options.user;
if (!user) {
throw new Error('updateSystemUser failed! The option "user" is required.');
}
return _axios["default"].put('/app/system-coordinator/api/v1/platform/system-user', user, {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
user: response.data
};
})["catch"](_http.handleErrors);
};
var fetchSystemIngress = exports.fetchSystemIngress = function fetchSystemIngress() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return _axios["default"].get('/app/system-coordinator/api/v1/platform/ingress', {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
ingress: response.data.ingress
};
})["catch"](_http.handleErrors);
};
var updateSystemIngress = exports.updateSystemIngress = function updateSystemIngress() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var ingress = options.ingress,
multipart = options.multipart;
return _axios["default"].put('/app/system-coordinator/api/v1/platform/ingress', !multipart ? ingress : (0, _http.formDataBuilder)(ingress), {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
ingress: response.data.ingress
};
})["catch"](_http.handleErrors);
};
var fetchTaskDbAdapters = exports.fetchTaskDbAdapters = function fetchTaskDbAdapters() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
// Build URL and fetch the space.
return _axios["default"].get("/app/system-coordinator/api/v1/meta/task-db-adapters", {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return response.data;
})
// .then(response => ({ space: response.data.space }))
["catch"](_http.handleErrors);
};
var fetchTaskDbAdapter = exports.fetchTaskDbAdapter = function fetchTaskDbAdapter() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
// Build URL and fetch the space.
return _axios["default"].get("/app/system-coordinator/api/v1/meta/task-db-adapters/".concat(options.type), {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
adapter: response.data.adapter
};
})["catch"](_http.handleErrors);
};
var fetchSystemDefaultSQLDbAdapter = exports.fetchSystemDefaultSQLDbAdapter = function fetchSystemDefaultSQLDbAdapter() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
// Build URL and fetch the space.
return _axios["default"].get("/app/system-coordinator/api/v1/platform/default-task-db-adapter", {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
adapter: response.data.adapter
};
})["catch"](_http.handleErrors);
};
var updateSystemDefaultSQLDbAdapter = exports.updateSystemDefaultSQLDbAdapter = function updateSystemDefaultSQLDbAdapter() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var adapter = options.adapter,
multipart = options.multipart;
if (!adapter) {
throw new Error('updateSystemDefaultSQLDbAdapter failed! The option "adapter" is required.');
}
return _axios["default"].put("/app/system-coordinator/api/v1/platform/default-task-db-adapter", !multipart ? adapter : (0, _http.formDataBuilder)(adapter), {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
adapter: response.data.adapter
};
})["catch"](_http.handleErrors);
};
var fetchSystemDefaultSmtpAdapter = exports.fetchSystemDefaultSmtpAdapter = function fetchSystemDefaultSmtpAdapter() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
// Build URL and fetch the space.
return _axios["default"].get('/app/system-coordinator/api/v1/platform/default-smtp-adapter', {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
adapter: response.data.adapter
};
})["catch"](_http.handleErrors);
};
var updateSystemDefaultSmtpAdapter = exports.updateSystemDefaultSmtpAdapter = function updateSystemDefaultSmtpAdapter() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var adapter = options.adapter;
if (!adapter) {
throw new Error('updateSystemDefaultSmtpAdapter failed! The option "adapter" is required.');
}
return _axios["default"].put('/app/system-coordinator/api/v1/platform/default-smtp-adapter', adapter, {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
adapter: response.data.adapter
};
})["catch"](_http.handleErrors);
};
var fetchSystemFilestore = exports.fetchSystemFilestore = function fetchSystemFilestore() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
// Build URL and fetch the space.
return _axios["default"].get('/app/system-coordinator/components/agent/app/api/v1/spaces/SYSTEM/filestores/system', {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return response.data;
})["catch"](_http.handleErrors);
};
var updateSystemFilestore = exports.updateSystemFilestore = function updateSystemFilestore() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var filestore = options.filestore;
if (!filestore) {
throw new Error('updateSystemFilestore failed! The option "adapter" is required.');
}
return _axios["default"].put('/app/system-coordinator/components/agent/app/api/v1/spaces/SYSTEM/filestores/system', filestore, {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
filestore: response.data.filestore
};
})["catch"](_http.handleErrors);
};
var VALID_RESTARTABLE_COMPONENTS = ['agent', 'core', 'loghub', 'indexer'];
var postPlatformComponentRestart = exports.postPlatformComponentRestart = function postPlatformComponentRestart() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
if (!options.component || !VALID_RESTARTABLE_COMPONENTS.includes(options.component)) {
throw new Error('postPlatformComponentRestart failed! The "component" option was missing or invalid.');
}
return _axios["default"].post("/app/system-coordinator/api/v1/platform/components/".concat(options.component, "/restart")).then(function (_ref2) {
var data = _ref2.data;
return {
component: data.component,
message: data.message
};
})["catch"](_http.handleErrors);
};
var fetchPlatformComponentStatus = exports.fetchPlatformComponentStatus = function fetchPlatformComponentStatus() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return _axios["default"].get('/app/system-coordinator/api/v1/platform/components').then(function (_ref3) {
var data = _ref3.data;
return {
components: data.components
};
})["catch"](_http.handleErrors);
};
var systemLogin = exports.systemLogin = function systemLogin() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var username = options.username,
password = options.password;
return _axios["default"].post('/app/system-coordinator/login', {
username: username,
password: password
}, {}).then(function (response) {
return response.data;
})["catch"](_http.handleErrors);
};
var refreshSystemToken = exports.refreshSystemToken = function refreshSystemToken() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return _axios["default"].post('/app/system-coordinator/refresh', {}, {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return response.data;
})["catch"](_http.handleErrors);
};
var fetchCassandraConfig = exports.fetchCassandraConfig = function fetchCassandraConfig() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return _axios["default"].get('/app/system-coordinator/api/v1/platform/cassandra', {}, {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
adapter: response.data.adapter
};
})["catch"](_http.handleErrors);
};
var updateCassandraConfig = exports.updateCassandraConfig = function updateCassandraConfig() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var adapter = options.adapter,
multipart = options.multipart;
return _axios["default"].put('/app/system-coordinator/api/v1/platform/cassandra', !multipart ? adapter : (0, _http.formDataBuilder)(adapter), {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
adapter: response.data.adapter
};
})["catch"](_http.handleErrors);
};
var fetchElasticSearchConfig = exports.fetchElasticSearchConfig = function fetchElasticSearchConfig() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return _axios["default"].get('/app/system-coordinator/api/v1/platform/elasticsearch', {}, {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
adapter: response.data.adapter
};
})["catch"](_http.handleErrors);
};
var updateElasticSearchConfig = exports.updateElasticSearchConfig = function updateElasticSearchConfig() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var adapter = options.adapter,
multipart = options.multipart;
return _axios["default"].put('/app/system-coordinator/api/v1/platform/elasticsearch', !multipart ? adapter : (0, _http.formDataBuilder)(adapter), {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
adapter: response.data.adapter
};
})["catch"](_http.handleErrors);
};
var fetchSystemSecurity = exports.fetchSystemSecurity = function fetchSystemSecurity() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return _axios["default"].get('/app/system-coordinator/api/v1/platform/system-security', {}, {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
systemSecurity: response.data
};
})["catch"](_http.handleErrors);
};
var updateSystemSecurity = exports.updateSystemSecurity = function updateSystemSecurity() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var systemSecurity = options.systemSecurity;
if (!systemSecurity) {
throw new Error('updateSystemSecurity failed! The option "systemSecurity" is required.');
}
return _axios["default"].put("/app/system-coordinator/api/v1/platform/system-security", systemSecurity, {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
systemSecurity: response.data
};
})["catch"](_http.handleErrors);
};
var fetchSystemLicense = exports.fetchSystemLicense = function fetchSystemLicense() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return _axios["default"].get('/app/system-coordinator/components/core/app/api/v1/license', {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
system: response.data
};
})["catch"](_http.handleErrors);
};
var deleteSystemLicense = exports.deleteSystemLicense = function deleteSystemLicense() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return _axios["default"]["delete"]('/app/system-coordinator/components/core/app/api/v1/license', {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
system: response.data
};
})["catch"](_http.handleErrors);
};
var resetSystemLicense = exports.resetSystemLicense = function resetSystemLicense() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return _axios["default"].put('/app/system-coordinator/components/core/app/api/v1/license/reset', {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
system: response.data
};
})["catch"](_http.handleErrors);
};
var importSystemLicense = exports.importSystemLicense = function importSystemLicense() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var content = options.content;
var data = new FormData();
data.set('content', content);
var headers = {
'Content-Type': 'multipart/form-data'
};
return _axios["default"].post('/app/system-coordinator/components/core/app/api/v1/license', data, {
headers: headers
}).then(function (response) {
return {
system: response.data
};
})["catch"](_http.handleErrors);
};
var fetchSystemLicenseStats = exports.fetchSystemLicenseStats = function fetchSystemLicenseStats() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return _axios["default"].get('/app/system-coordinator/components/core/app/api/v1/license/statistics', {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
system: response.data
};
})["catch"](_http.handleErrors);
};
var fetchSystemLicenseCheck = exports.fetchSystemLicenseCheck = function fetchSystemLicenseCheck() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return _axios["default"].get('/app/system-coordinator/components/core/app/api/v1/license/check', {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
system: response.data
};
})["catch"](_http.handleErrors);
};
var fetchSystemBackgroundTasks = exports.fetchSystemBackgroundTasks = function fetchSystemBackgroundTasks() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return _axios["default"].get('/app/system-coordinator/api/v1/backgroundTasks', {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
backgroundTasks: response.data.backgroundTasks
};
})["catch"](_http.handleErrors);
};
var fetchSystemBackgroundTask = exports.fetchSystemBackgroundTask = function fetchSystemBackgroundTask() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var id = options.id;
if (!id) {
throw new Error('fetchSystemBackgroundTask failed! The option "id" is required.');
}
return _axios["default"].get("/app/system-coordinator/api/v1/backgroundTasks/".concat(id), {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
backgroundTask: response.data.backgroundTask
};
})["catch"](_http.handleErrors);
};
var deleteSystemBackgroundTask = exports.deleteSystemBackgroundTask = function deleteSystemBackgroundTask() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var id = options.id;
if (!id) {
throw new Error('deleteSystemBackgroundTask failed! The option "id" is required.');
}
return _axios["default"]["delete"]("/app/system-coordinator/api/v1/backgroundTasks/".concat(id), {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
backgroundTask: response.data.backgroundTask
};
})["catch"](_http.handleErrors);
};
var rotateEncryptionKey = exports.rotateEncryptionKey = function rotateEncryptionKey() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var spaceSlug = options.spaceSlug;
return _axios["default"].post(spaceSlug ? "/app/system-coordinator/api/v1/tenants/".concat(spaceSlug, "/rotateEncryptionKey") : '/app/system-coordinator/api/v1/platform/rotateEncryptionKey', {}, {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
system: response.data
};
})["catch"](_http.handleErrors);
};
var fetchTrustedCertificates = exports.fetchTrustedCertificates = function fetchTrustedCertificates() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var spaceSlug = options.spaceSlug;
return _axios["default"].get(spaceSlug ? "/app/system-coordinator/api/v1/tenants/".concat(spaceSlug, "/trusted") : '/app/system-coordinator/api/v1/platform/trusted', {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
trustedCertificates: response.data.trustedCertificates
};
})["catch"](_http.handleErrors);
};
var createTrustedCertificate = exports.createTrustedCertificate = function createTrustedCertificate() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var spaceSlug = options.spaceSlug,
certificates = options.certificates;
if (!certificates) {
throw new Error('createTenant failed! The option "certificates" is required.');
}
return _axios["default"].post(spaceSlug ? "/app/system-coordinator/api/v1/tenants/".concat(spaceSlug, "/trusted") : '/app/system-coordinator/api/v1/platform/trusted', (0, _http.formDataBuilder)({
certificates: certificates
}), {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
trustedCertificates: response.data.trustedCertificates
};
})["catch"](_http.handleErrors);
};
var deleteTrustedCertificate = exports.deleteTrustedCertificate = function deleteTrustedCertificate() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var spaceSlug = options.spaceSlug,
fingerprint = options.fingerprint;
if (!fingerprint) {
throw new Error('createTenant failed! The option "fingerprint" is required.');
}
return _axios["default"]["delete"](spaceSlug ? "/app/system-coordinator/api/v1/tenants/".concat(spaceSlug, "/trusted/").concat(fingerprint) : "/app/system-coordinator/api/v1/platform/trusted/".concat(fingerprint), {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
trustedCertificates: response.data.trustedCertificates
};
})["catch"](_http.handleErrors);
};
var fetchNotifications = exports.fetchNotifications = function fetchNotifications() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return _axios["default"].get('/app/system-coordinator/api/v1/platform/notifications', {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
notifications: response.data
};
})["catch"](_http.handleErrors);
};
var fetchNotificationLabels = exports.fetchNotificationLabels = function fetchNotificationLabels() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return _axios["default"].get('/app/system-coordinator/api/v1/platform/notifications/labels', {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
notifications: response.data
};
})["catch"](_http.handleErrors);
};
var restartResources = exports.restartResources = function restartResources(_ref4) {
var _ref4$options = _ref4.options,
options = _ref4$options === void 0 ? {} : _ref4$options,
notification = _ref4.notification;
return _axios["default"].post('/app/system-coordinator/api/v1/platform/restartResources', (0, _objectSpread2["default"])({}, notification), {
params: (0, _http.paramBuilder)(options),
headers: (0, _http.headerBuilder)(options)
}).then(function (response) {
return {
trustedCertificates: response.data.trustedCertificates
};
})["catch"](_http.handleErrors);
};