From 272a29aad1b55a1c618ce710d6748dd4fb0f0df8 Mon Sep 17 00:00:00 2001 From: simlarsen Date: Wed, 10 Jul 2024 20:31:24 +0000 Subject: [PATCH] OneUptime Copilot: Improve Comments on /App/FeatureSet/ApiReference/Utils/Resources.ts --- App/FeatureSet/ApiReference/Utils/Resources.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/App/FeatureSet/ApiReference/Utils/Resources.ts b/App/FeatureSet/ApiReference/Utils/Resources.ts index c57e287a13..57b63fd469 100644 --- a/App/FeatureSet/ApiReference/Utils/Resources.ts +++ b/App/FeatureSet/ApiReference/Utils/Resources.ts @@ -12,12 +12,14 @@ export interface ModelDocumentation { } export default class ResourceUtil { + // Get all resources that should have documentation enabled public static getResources(): Array { const resources: Array = 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 { const featuredResources: Array = [ "Monitor", @@ -59,6 +62,7 @@ export default class ResourceUtil { ); } + // Create a dictionary of resources indexed by their path public static getResourceDictionaryByPath(): Dictionary { const dict: Dictionary = {};