mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
OneUptime Copilot: Improve Comments on /App/FeatureSet/ApiReference/Utils/Resources.ts
This commit is contained in:
parent
d21e333c9e
commit
272a29aad1
@ -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> = {};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user