diff --git a/utils/lib/Quickstart.ts b/utils/lib/Quickstart.ts index 903b042cd9..1f2854d2de 100644 --- a/utils/lib/Quickstart.ts +++ b/utils/lib/Quickstart.ts @@ -23,7 +23,7 @@ import type { QuickstartSupportLevel, } from '../types/QuickstartMutationVariable'; import type { QuickstartConfig } from '../types/QuickstartConfig'; -import { ArtifactQuickstartConfig } from '../types/Artifact'; +import { ArtifactQuickstartConfig, ArtifactQuickstartConfigSupportLevel } from '../types/Artifact'; export interface QuickstartMutationResponse { quickstart: { @@ -35,6 +35,9 @@ interface SupportLevelMap { [key: string]: QuickstartSupportLevel; } +// FIXME: We will want to clean this up and conform to the `Artifact` types +// when we go to cleanup the deprecated mutation functionality after we have +// finalized the new quickstart publishing pipeline. const SUPPORT_LEVEL_ENUMS: SupportLevelMap = { 'New Relic': 'NEW_RELIC', Community: 'COMMUNITY', @@ -243,7 +246,9 @@ class Quickstart { Component.removeBasePath(path.dirname(this.configPath), this.basePath) ), summary: summary && summary.trim(), - supportLevel: SUPPORT_LEVEL_ENUMS[level], + supportLevel: SUPPORT_LEVEL_ENUMS[ + level + ].toLowerCase() as ArtifactQuickstartConfigSupportLevel, dataSourceIds: dataSourceIds, alertConditions: alertPolicies, dashboards, diff --git a/utils/schema/artifact.json b/utils/schema/artifact.json index 3d0b21e365..73a4eab384 100644 --- a/utils/schema/artifact.json +++ b/utils/schema/artifact.json @@ -95,7 +95,7 @@ } }, "supportLevel": { - "enum": ["NEW_RELIC", "COMMUNITY", "VERIFIED", "ENTERPRISE"] + "enum": ["new_relic", "community", "verified", "enterprise"] }, "iconUrl": { "type": "string" diff --git a/utils/types/Artifact.ts b/utils/types/Artifact.ts index 8f322f2ab0..388642e7b2 100644 --- a/utils/types/Artifact.ts +++ b/utils/types/Artifact.ts @@ -43,15 +43,15 @@ type QuickstartConfigDocumentation = { url: string; }; -export type QuickstartConfigSupportLevel = - | 'NEW_RELIC' - | 'COMMUNITY' - | 'VERIFIED' +export type ArtifactQuickstartConfigSupportLevel = + | 'new_relic' + | 'community' + | 'verified' // Enterprise is deprecated. However some quickstarts still have this support // level within their config. - | 'ENTERPRISE'; + | 'enterprise'; -type QuickstartConfig = { +export interface ArtifactQuickstartConfig { quickstartUuid: string; description: string; displayName: string; @@ -60,15 +60,12 @@ type QuickstartConfig = { iconUrl: string; keywords?: string[]; summary: string; - supportLevel: QuickstartConfigSupportLevel; + supportLevel: ArtifactQuickstartConfigSupportLevel; alertConditions?: string[]; dashboards?: string[]; dataSourceIds?: string[]; -}; - -export interface ArtifactQuickstartConfig extends QuickstartConfig { authors: Array<{ name: string }>; -} +}; /* -- Dashboard -- */