Merge branch 'master' of github.com:OneUptime/oneuptime

This commit is contained in:
Simon Larsen 2024-07-10 21:33:40 +01:00
commit 2862d1e69b
No known key found for this signature in database
GPG Key ID: 96C5DCA24769DBCA

View File

@ -12,12 +12,14 @@ export interface ModelDocumentation {
}
export default class ResourceUtil {
// Get all resources that should have documentation enabled
public static getResources(): Array<ModelDocumentation> {
const resources: Array<ModelDocumentation> = Models.filter(
(model: typeof BaseModel) => {
const modelInstance: BaseModel = new model();
let showDocs: boolean = modelInstance.enableDocumentation;
// If billing is enabled, do not show master admin API docs
if (modelInstance.isMasterAdminApiDocs && IsBillingEnabled) {
showDocs = false;
}
@ -40,6 +42,7 @@ export default class ResourceUtil {
return resources;
}
// Get featured resources that are pre-selected
public static getFeaturedResources(): Array<ModelDocumentation> {
const featuredResources: Array<string> = [
"Monitor",
@ -59,6 +62,7 @@ export default class ResourceUtil {
);
}
// Create a dictionary of resources indexed by their path
public static getResourceDictionaryByPath(): Dictionary<ModelDocumentation> {
const dict: Dictionary<ModelDocumentation> = {};