@lfai/egeria-js-commons
Version:
Common module for storing static data such as key value objects, SVGs, icon mappings, API urls.
49 lines (48 loc) • 1.07 kB
JavaScript
import { authHeader, egeriaFetch } from '../../http';
/**
*
* HTTP API request for retrieving all the asset types.
*
* @since 0.1.0
* @access public
*
*
* @return {Promise} Returns a promise with the request.
*
*/
function getAll() {
return egeriaFetch(`/api/glossaries`, 'GET', authHeader(), {});
}
/**
*
* HTTP API request for retrieving all the glossary categories.
*
* @since 0.1.0
* @access public
*
*
* @return {Promise} Returns a promise with the request.
*
*/
function getGlossaryCategories(glossaryGUID) {
return egeriaFetch(`/api/glossaries/${glossaryGUID}/categories`, 'GET', authHeader(), {});
}
/**
*
* HTTP API request for retrieving all the glossary terms.
*
* @since 0.1.0
* @access public
*
*
* @return {Promise} Returns a promise with the request.
*
*/
function getGlossaryTerms(categoryGUID) {
return egeriaFetch(`/api/glossaries/categories/${categoryGUID}/terms`, 'GET', authHeader(), {});
}
export const glossaries = {
getAll,
getGlossaryCategories,
getGlossaryTerms
};