Remove InsightsGenerator project (#1764)

This commit is contained in:
Karl Burtram
2022-12-07 10:56:12 -08:00
committed by GitHub
parent eee37cb2ce
commit c9f310cb47
20 changed files with 0 additions and 1985 deletions

View File

@@ -19,7 +19,6 @@ using Microsoft.SqlTools.ServiceLayer.DisasterRecovery;
using Microsoft.SqlTools.ServiceLayer.EditData;
using Microsoft.SqlTools.ServiceLayer.FileBrowser;
using Microsoft.SqlTools.ServiceLayer.Hosting;
using Microsoft.SqlTools.ServiceLayer.InsightsGenerator;
using Microsoft.SqlTools.ServiceLayer.LanguageExtensibility;
using Microsoft.SqlTools.ServiceLayer.LanguageServices;
using Microsoft.SqlTools.ServiceLayer.Metadata;
@@ -160,9 +159,6 @@ namespace Microsoft.SqlTools.ServiceLayer
NotebookConvertService.Instance.InitializeService(serviceHost);
serviceProvider.RegisterSingleService(NotebookConvertService.Instance);
InsightsGeneratorService.Instance.InitializeService(serviceHost);
serviceProvider.RegisterSingleService(InsightsGeneratorService.Instance);
#if INCLUDE_MIGRATION
MigrationService.Instance.InitializeService(serviceHost);
serviceProvider.RegisterSingleService(MigrationService.Instance);

View File

@@ -1,46 +0,0 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
using Microsoft.SqlTools.ServiceLayer.Utility;
using Microsoft.SqlTools.Utility;
namespace Microsoft.SqlTools.ServiceLayer.InsightsGenerator.Contracts
{
public class AccessibleChartData
{
public string[] Columns { get; set; }
public string[][] Rows { get; set; }
}
/// <summary>
/// Query insights generator parameters
/// </summary>
public class QueryInsightsGeneratorParams : GeneralRequestDetails
{
public AccessibleChartData Data { get; set; }
}
/// <summary>
/// Query insights generator result
/// </summary>
public class InsightsGeneratorResult : ResultStatus
{
public string InsightsText { get; set; }
}
/// <summary>
/// Query insights generato request type
/// </summary>
public class QueryInsightsGeneratorRequest
{
/// <summary>
/// Request definition
/// </summary>
public static readonly
RequestType<QueryInsightsGeneratorParams, InsightsGeneratorResult> Type =
RequestType<QueryInsightsGeneratorParams, InsightsGeneratorResult>.Create("insights/query");
}
}

View File

@@ -1,78 +0,0 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System;
using System.Threading.Tasks;
using Microsoft.SqlTools.Hosting.Protocol;
using Microsoft.SqlTools.ServiceLayer.Hosting;
using Microsoft.SqlTools.ServiceLayer.InsightsGenerator.Contracts;
using Microsoft.InsightsGenerator;
namespace Microsoft.SqlTools.ServiceLayer.InsightsGenerator
{
/// <summary>
/// Service responsible for securing credentials in a platform-neutral manner. This provides
/// a generic API for read, save and delete credentials
/// </summary>
public class InsightsGeneratorService
{
/// <summary>
/// Singleton service instance
/// </summary>
private static Lazy<InsightsGeneratorService> instance
= new Lazy<InsightsGeneratorService>(() => new InsightsGeneratorService());
/// <summary>
/// Gets the singleton service instance
/// </summary>
public static InsightsGeneratorService Instance
{
get
{
return instance.Value;
}
}
/// <summary>
/// Initializes the service instance
/// </summary>
public void InitializeService(ServiceHost serviceHost)
{
// Insights Generatoe request handlers
serviceHost.SetRequestHandler(QueryInsightsGeneratorRequest.Type, HandleQueryInsightGeneratorRequest);
}
internal async Task HandleQueryInsightGeneratorRequest(QueryInsightsGeneratorParams parameters, RequestContext<InsightsGeneratorResult> requestContext)
{
Microsoft.InsightsGenerator.DataArray dataArray = new Microsoft.InsightsGenerator.DataArray(){
ColumnNames = parameters.Data.Columns,
Cells = parameters.Data.Rows
};
Workflow insightWorkFlow = new Workflow();
try
{
string insightText = await insightWorkFlow.ProcessInputData(dataArray);
insightText = insightText.Replace("\\n", "");
await requestContext.SendResult(new InsightsGeneratorResult()
{
InsightsText = insightText,
Success = true,
ErrorMessage = null
});
}
catch (Exception ex)
{
await requestContext.SendResult(new InsightsGeneratorResult()
{
Success = false,
ErrorMessage = ex.Message
});
}
}
}
}

View File

@@ -67,7 +67,6 @@
<ProjectReference Include="../Microsoft.SqlTools.Hosting/Microsoft.SqlTools.Hosting.csproj" />
<ProjectReference Include="../Microsoft.SqlTools.Credentials/Microsoft.SqlTools.Credentials.csproj" />
<ProjectReference Include="../Microsoft.SqlTools.ManagedBatchParser/Microsoft.SqlTools.ManagedBatchParser.csproj" />
<ProjectReference Include="../Microsoft.InsightsGenerator/Microsoft.InsightsGenerator.csproj" />
</ItemGroup>
<ItemGroup>
<Content Include="..\..\Notice.txt">