From 31c0f5e8638c5050a801bbdb97fede0d40ec6d92 Mon Sep 17 00:00:00 2001 From: Steve McDougall Date: Mon, 8 Apr 2024 11:35:47 +0100 Subject: [PATCH] :feature: Adding AI Readiness --- pkg/types/insights.go | 1 + pkg/views/insights.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/pkg/types/insights.go b/pkg/types/insights.go index 864d265..a154e52 100644 --- a/pkg/types/insights.go +++ b/pkg/types/insights.go @@ -25,6 +25,7 @@ type Report struct { TotalEndpoints int `json:"total_endpoints"` CreatedAt string `json:"created_at"` ScorePercentage int `json:"score_percentage"` + AIReady bool `json:"is_ai_ready"` Grade string `json:"grade"` Industry Industry `json:"industry,omitempty"` Categories []Category `json:"categories"` diff --git a/pkg/views/insights.go b/pkg/views/insights.go index 6493e07..0214a64 100644 --- a/pkg/views/insights.go +++ b/pkg/views/insights.go @@ -2,6 +2,7 @@ package views import ( "fmt" + "github.com/pterm/pterm" "github.com/treblle/treblle-cli/pkg/styles" "github.com/treblle/treblle-cli/pkg/types" @@ -49,6 +50,11 @@ func ShowInsightsDetails(apiResponse *types.ApiResponse) { prefixPrinter.Println( pterm.NewStyle(pterm.FgLightWhite).Sprint(apiResponse.Report.ScorePercentage), ) + + prefixPrinter.Prefix.Text = "AI Ready" + prefixPrinter.Println( + pterm.NewStyle(pterm.FgLightWhite).Sprint(apiResponse.Report.AIReady), + ) } func ShowInsightsTechnologyDiscovery(apiResponse *types.ApiResponse) {