diff --git a/Configurations/Entities/XAiMcpServerEntityConfiguration .cs b/Configurations/Entities/XAiMcpServerEntityConfiguration .cs new file mode 100644 index 0000000..2605536 --- /dev/null +++ b/Configurations/Entities/XAiMcpServerEntityConfiguration .cs @@ -0,0 +1,17 @@ +using System; +using xAiModels.Constants; +using xDataService.Providers; +using xAiModels.Models.Entities; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; + +namespace xAiModels.Configurations.Entities +{ + public class XAiMcpServerEntityConfiguration : XBaseEntityTypeConfiguration + { + public override void Configure(EntityTypeBuilder builder) + { + builder.ToTable(XAiModelsConstants.XAiMcpServerTable); + } + } +} \ No newline at end of file diff --git a/Configurations/XAiModelMappersProfile.cs b/Configurations/XAiModelMappersProfile.cs index 6c81e4d..6d2b0d8 100644 --- a/Configurations/XAiModelMappersProfile.cs +++ b/Configurations/XAiModelMappersProfile.cs @@ -25,6 +25,10 @@ namespace xAiModels.Configurations // XAiProject ... CreateMap(); + // + CreateMap(); + CreateMap(); + // // XAiConversation ... CreateMap(); diff --git a/Constants/XAiModelsConstants.cs b/Constants/XAiModelsConstants.cs index 0087de7..5faada5 100644 --- a/Constants/XAiModelsConstants.cs +++ b/Constants/XAiModelsConstants.cs @@ -5,24 +5,27 @@ namespace xAiModels.Constants // // Service Extensions Log Tag ... public const string XAiModelsDILogTag = "XAiModels"; - + // // Table Mapping Identifiers ... public const string XAiVectorTable = "AiVectors"; public const string XAiMessageTable = "AiMessages"; public const string XAiProjectTable = "AiProjects"; + public const string XAiMcpServerTable = "AiMcpServers"; public const string XAiConversationTable = "AiConversations"; // // GraphQL Collection Mappings ... public const string XAiMessageSingleName = "aiMessage"; public const string XAiProjectSingleName = "aiProject"; + public const string XAiMcpServerSingleName = "aiMcpServer"; public const string XAiConversationSignleName = "aiConversation"; public const string XAiMessageCollectionName = "aiMessages"; public const string XAiProjectCollectionName = "AiProjectsa"; + public const string XAiMcpServerCollectionName = "aiMcpServers"; public const string XAiConversationCollectionName = "aiConversations"; - + public const string XAiVectorSingleName = "aiVector"; public const string XAiVectorCollectionName = "aiVectors"; @@ -34,6 +37,9 @@ namespace xAiModels.Constants public const string XAiProjectDtoHub = "aiProjectDto"; public const string XAiProjectEntityHub = "aiProjectEntity"; + public const string XAiMcpServerDtoHub = "aiMcpServerDto"; + public const string XAiMcpServerEntityHub = "aiMcpServerEntity"; + public const string XAiConversationDtoHub = "aiConversationDto"; public const string XAiConversationEntityHub = "aiConversationEntity"; @@ -48,18 +54,19 @@ namespace xAiModels.Constants // // EF Repositories Helper Extensions ... + public const string GetXAiVectorEFRepositoryDescriptor = "GetXAiVectorEFRepositoryDescriptor"; public const string GetXAiMessageEFRepositoryDescriptor = "GetXAiMessageEFRepositoryDescriptor"; public const string GetXAiProjectEFRepositoryDescriptor = "GetXAiProjectEFRepositoryDescriptor"; + public const string GetXAiMcpServerEFRepositoryDescriptor = "GetXAiMcpServerEFRepositoryDescriptor"; public const string GetXAiConversationEFRepositoryDescriptor = "GetXAiConversationEFRepositoryDescriptor"; - public const string GetXAiVectorEFRepositoryDescriptor = "GetXAiVectorEFRepositoryDescriptor"; // - public const string DefaultXAiProjectTitleResourceID = "XAiPrjT"; - public const string DefaultXAiConversationTitleResourceID = "XAiCnvT"; - public const string DefaultXAiProjectDescriptionResourceID = "XAiPrjD"; + public const string DefaultXAiProjectTitleResourceID = "XAiPrjT"; + public const string DefaultXAiConversationTitleResourceID = "XAiCnvT"; + public const string DefaultXAiProjectDescriptionResourceID = "XAiPrjD"; // - public const string XOpenAINoKey = "no-key-required"; + public const string XOpenAINoKey = "no-key-required"; // // Knowledge (Persistent RAG) ... diff --git a/Interfaces/Dtos/IXAiMcpServerDtoHub.cs b/Interfaces/Dtos/IXAiMcpServerDtoHub.cs new file mode 100644 index 0000000..9d37aa3 --- /dev/null +++ b/Interfaces/Dtos/IXAiMcpServerDtoHub.cs @@ -0,0 +1,10 @@ +using System; +using xAiModels.Models.Dtos; +using xPushService.Interfaces; +using xAiModels.Models.Entities; + +namespace xAiModels.Interfaces.Dtos +{ + public interface IXAiMcpServerDtoHub : IXBaseDtoHub + { } +} \ No newline at end of file diff --git a/Interfaces/Dtos/IXAiMcpServerRepositoryService.cs b/Interfaces/Dtos/IXAiMcpServerRepositoryService.cs new file mode 100644 index 0000000..75c8646 --- /dev/null +++ b/Interfaces/Dtos/IXAiMcpServerRepositoryService.cs @@ -0,0 +1,10 @@ +using System; +using xAiModels.Models.Dtos; +using xDataService.Interfaces; +using xAiModels.Models.Entities; + +namespace xAiModels.Interfaces.Dtos +{ + public interface IXAiMcpServerRepositoryService : IXBaseRepositoryService + { } +} \ No newline at end of file diff --git a/Interfaces/Dtos/IXAiMcpServerServiceProvider.cs b/Interfaces/Dtos/IXAiMcpServerServiceProvider.cs new file mode 100644 index 0000000..6fcfb8d --- /dev/null +++ b/Interfaces/Dtos/IXAiMcpServerServiceProvider.cs @@ -0,0 +1,11 @@ +using System; +using xAiModels.Models.Dtos; +using xPushService.Interfaces; +using xAiModels.Providers.Dtos; +using xAiModels.Models.Entities; + +namespace xAiModels.Interfaces.Dtos +{ + public interface IXAiMcpServerServiceProvider : IXBaseDtoProvider + { } +} \ No newline at end of file diff --git a/Interfaces/Enrichers/IXAiMcpServerEnricher.cs b/Interfaces/Enrichers/IXAiMcpServerEnricher.cs new file mode 100644 index 0000000..40ffbd6 --- /dev/null +++ b/Interfaces/Enrichers/IXAiMcpServerEnricher.cs @@ -0,0 +1,31 @@ +using System.Threading; +using System.Threading.Tasks; +using xAiModels.Models.Dtos; +using xAiModels.Models.Entities; +using System.Collections.Generic; + +namespace xAiModels.Interfaces.Enrichers +{ + public interface IXAiMcpServerEnricher + { + Task Enrich( + XAiMcpServer source, + CancellationToken cancellationToken = default + ); + + Task Enrich( + XAiMcpServerDto source, + CancellationToken cancellationToken = default + ); + + Task> EnrichRange( + IEnumerable sources, + CancellationToken cancellationToken = default + ); + + Task> EnrichRange( + IEnumerable sources, + CancellationToken cancellationToken = default + ); + } +} \ No newline at end of file diff --git a/Interfaces/Entities/IXAiMcpServerEntityHub.cs b/Interfaces/Entities/IXAiMcpServerEntityHub.cs new file mode 100644 index 0000000..e17c9ac --- /dev/null +++ b/Interfaces/Entities/IXAiMcpServerEntityHub.cs @@ -0,0 +1,9 @@ +using System; +using xPushService.Interfaces; +using xAiModels.Models.Entities; + +namespace xAiModels.Interfaces.Entities +{ + public interface IXAiMcpServerEntityHub : IXBaseEntityHub + { } +} \ No newline at end of file diff --git a/Interfaces/Entities/IXAiMcpServerGraphQLTypeHelper.cs b/Interfaces/Entities/IXAiMcpServerGraphQLTypeHelper.cs new file mode 100644 index 0000000..56ca81c --- /dev/null +++ b/Interfaces/Entities/IXAiMcpServerGraphQLTypeHelper.cs @@ -0,0 +1,9 @@ +using System; +using xDataService.Interfaces; +using xAiModels.Models.Entities; + +namespace xAiModels.Interfaces.Entities +{ + public interface IXAiMcpServerGraphQLTypeHelper : IXBaseGraphQLTypeHelper + { } +} \ No newline at end of file diff --git a/Interfaces/Entities/IXAiMcpServerKeyGenerator.cs b/Interfaces/Entities/IXAiMcpServerKeyGenerator.cs new file mode 100644 index 0000000..4c92a1d --- /dev/null +++ b/Interfaces/Entities/IXAiMcpServerKeyGenerator.cs @@ -0,0 +1,9 @@ +using System; +using xDataService.Interfaces; +using xAiModels.Models.Entities; + +namespace xAiModels.Interfaces.Entities +{ + public interface IXAiMcpServerKeyGenerator : IXKeyGenerator + { } +} \ No newline at end of file diff --git a/Interfaces/Entities/IXAiMcpServerRepository.cs b/Interfaces/Entities/IXAiMcpServerRepository.cs new file mode 100644 index 0000000..0b91531 --- /dev/null +++ b/Interfaces/Entities/IXAiMcpServerRepository.cs @@ -0,0 +1,8 @@ +using System; +using xDataService.Interfaces; +using xAiModels.Models.Entities; + +namespace xAiModels.Interfaces.Entities +{ + public interface IXAiMcpServerRepository : IXBaseRepository { } +} \ No newline at end of file diff --git a/Interfaces/Entities/IXAiMcpServerRepositoryEvents.cs b/Interfaces/Entities/IXAiMcpServerRepositoryEvents.cs new file mode 100644 index 0000000..951d5c1 --- /dev/null +++ b/Interfaces/Entities/IXAiMcpServerRepositoryEvents.cs @@ -0,0 +1,8 @@ +using xDataService.Interfaces; +using xAiModels.Models.Entities; + +namespace xAiModels.Interfaces.Entities +{ + public interface IXAiMcpServerRepositoryEvents : IXBaseRepositoryEvents + { } +} \ No newline at end of file diff --git a/Interfaces/Entities/IXAiMcpServerRepositoryProvider.cs b/Interfaces/Entities/IXAiMcpServerRepositoryProvider.cs new file mode 100644 index 0000000..54c7275 --- /dev/null +++ b/Interfaces/Entities/IXAiMcpServerRepositoryProvider.cs @@ -0,0 +1,10 @@ +using System; +using xPushService.Interfaces; +using xAiModels.Models.Entities; +using xAiModels.Providers.Entities; + +namespace xAiModels.Interfaces.Entities +{ + public interface IXAiMcpServerRepositoryProvider : IXBaseEntityProvider + { } +} \ No newline at end of file diff --git a/Models/Dtos/XAiMcpServerDto.cs b/Models/Dtos/XAiMcpServerDto.cs new file mode 100644 index 0000000..1f0c987 --- /dev/null +++ b/Models/Dtos/XAiMcpServerDto.cs @@ -0,0 +1,53 @@ +using System; +using xModels.Base; +using xModels.Dtos; + +namespace xAiModels.Models.Dtos +{ + public class XAiMcpServerDto : XBaseGuidIDEntityDto + { + /// + /// Owner ... + /// + public string OwnerId { get; set; } + public virtual XPersonDto Owner { get; set; } + + /// + /// MCP Server Name ... + /// + public string Name { get; set; } + + /// + /// Description ... + /// + public string Description { get; set; } + + /// + /// Enabled or Disabled ... + /// + public bool Enabled { get; set; } = true; + + /// + /// Environment Variables as JSON Object ... + /// + public string EnvironmentVariables { get; set; } + + /// + /// Endpoint to Connect ... + /// + public string Endpoint { get; set; } + + /// + /// Headers List as Json Object ... + /// + public string Headers { get; set; } + + /// + /// Timout Secconds ... + /// + public int TimeoutSeconds { get; set; } = 30; + + public DateTime CreatedOn { get; set; } + public DateTime UpdatedAt { get; set; } + } +} \ No newline at end of file diff --git a/Models/Entities/XAiMcpServer.cs b/Models/Entities/XAiMcpServer.cs new file mode 100644 index 0000000..0a8c38c --- /dev/null +++ b/Models/Entities/XAiMcpServer.cs @@ -0,0 +1,61 @@ +using System; +using xModels.Base; +using System.ComponentModel.DataAnnotations; + +namespace xAiModels.Models.Entities +{ + /// + /// An MCP Server Descriptor for Adding Tools to XAI ... + /// + public class XAiMcpServer : XBaseGuidIDEntity + { + /// + /// Owner ... + /// + [Required] + [StringLength(255)] + public string OwnerId { get; set; } + + /// + /// MCP Server Name ... + /// + [Required] + [StringLength(255)] + public string Name { get; set; } + + /// + /// Description ... + /// + [StringLength(1000)] + public string Description { get; set; } + + /// + /// Enabled or Disabled ... + /// + public bool Enabled { get; set; } = true; + + /// + /// Environment Variables as JSON Object ... + /// + public string EnvironmentVariables { get; set; } + + /// + /// Endpoint to Connect ... + /// + [StringLength(1000)] + public string Endpoint { get; set; } + + /// + /// Headers List as Json Object ... + /// + public string Headers { get; set; } + + /// + /// Timout Secconds ... + /// + public int TimeoutSeconds { get; set; } = 30; + + public DateTime CreatedOn { get; set; } + public DateTime UpdatedAt { get; set; } + } +} \ No newline at end of file diff --git a/Providers/Dtos/XAiMcpServerDtoHub.cs b/Providers/Dtos/XAiMcpServerDtoHub.cs new file mode 100644 index 0000000..21e4e7b --- /dev/null +++ b/Providers/Dtos/XAiMcpServerDtoHub.cs @@ -0,0 +1,17 @@ +using System; +using xPushService.Base; +using xAiModels.Models.Dtos; +using xAiModels.Interfaces.Dtos; +using xAiModels.Models.Entities; +using Microsoft.Extensions.Logging; + +namespace xAiModels.Providers.Dtos +{ + public class XAiMcpServerDtoHub : XBaseDtoHub, IXAiMcpServerDtoHub + { + public XAiMcpServerDtoHub( + ILogger logger + ) : base(logger) + { } + } +} \ No newline at end of file diff --git a/Providers/Dtos/XAiMcpServerRepositoryService.cs b/Providers/Dtos/XAiMcpServerRepositoryService.cs new file mode 100644 index 0000000..f606e5a --- /dev/null +++ b/Providers/Dtos/XAiMcpServerRepositoryService.cs @@ -0,0 +1,26 @@ +using System; +using xAiModels.Models.Dtos; +using xDataService.Providers; +using xAiModels.Configurations; +using xAiModels.Interfaces.Dtos; +using xAiModels.Models.Entities; +using xAiModels.Interfaces.Entities; +using xAiModels.Interfaces.Enrichers; + +namespace xAiModels.Providers.Dtos +{ + public class XAiMcpServerRepositoryService : XBaseRepositoryService, IXAiMcpServerRepositoryService + { + private readonly IXAiMcpServerEnricher enricher; + private readonly IXAiMcpServerRepository repository; + + public XAiMcpServerRepositoryService( + IXAiMcpServerRepository repository, + IXAiMcpServerEnricher enricher + ) : base(repository, mapperProfiles: [new XAiModelMappersProfile()]) + { + this.enricher = enricher; + this.repository = repository; + } + } +} \ No newline at end of file diff --git a/Providers/Dtos/XAiMcpServerServiceProvider.cs b/Providers/Dtos/XAiMcpServerServiceProvider.cs new file mode 100644 index 0000000..cba4585 --- /dev/null +++ b/Providers/Dtos/XAiMcpServerServiceProvider.cs @@ -0,0 +1,22 @@ +using System; +using xPushService.Base; +using xAiModels.Models.Dtos; +using xAiModels.Interfaces.Dtos; +using xAiModels.Models.Entities; +using xDataService.Configuration; +using xIdentityService.Interfaces; +using Microsoft.AspNetCore.SignalR; + +namespace xAiModels.Providers.Dtos +{ + public class XAiMcpServerServiceProvider : XBaseDtoProvider, IXAiMcpServerServiceProvider + { + public XAiMcpServerServiceProvider( + IHubContext hub, + XDataServiceConfiguration dataConfiguration, + IXAiMcpServerRepositoryService service, + IXIdentityProvider identityProvider = null + ) : base(hub, dataConfiguration, service, identityProvider) + { } + } +} \ No newline at end of file diff --git a/Providers/Enrichers/XAiMcpServerEnricher.cs b/Providers/Enrichers/XAiMcpServerEnricher.cs new file mode 100644 index 0000000..44c2d35 --- /dev/null +++ b/Providers/Enrichers/XAiMcpServerEnricher.cs @@ -0,0 +1,79 @@ +using System.Linq; +using xModels.Dtos; +using System.Threading; +using xCommons.Extensions; +using xAiModels.Models.Dtos; +using System.Threading.Tasks; +using xAiModels.Models.Entities; +using System.Collections.Generic; +using xIdentityService.Interfaces; +using xAiModels.Interfaces.Enrichers; + +namespace xAiModels.Providers.Enrichers +{ + public class XAiMcpServerEnricher : IXAiMcpServerEnricher + { + private readonly IXPersonService personService; + + public XAiMcpServerEnricher( + IXPersonService personService + ) + { + this.personService = personService; + } + + public virtual async Task Enrich( + XAiMcpServer source, + CancellationToken cancellationToken = default + ) + { + // + var result = source.MapConvert(); + result = await Enrich( + source: result, + cancellationToken: cancellationToken + ); + + // + return result; + } + + public virtual async Task Enrich( + XAiMcpServerDto source, + CancellationToken cancellationToken = default + ) + { + // + XPersonDto owner = null; + if (!source.OwnerId.IsNullOrEmpty()) + { + owner = await personService.GetPerson(source.OwnerId); + } + + // + var result = source.MapConvert(); + result.Owner = owner; + + // + return result; + } + + public virtual async Task> EnrichRange( + IEnumerable sources, + CancellationToken cancellationToken = default + ) + { + var tasks = sources.Select(x => Enrich(x, cancellationToken)); + return await Task.WhenAll(tasks); + } + + public virtual async Task> EnrichRange( + IEnumerable sources, + CancellationToken cancellationToken = default + ) + { + var tasks = sources.Select(x => Enrich(x, cancellationToken)); + return await Task.WhenAll(tasks); + } + } +} \ No newline at end of file diff --git a/Providers/Entities/XAiMcpServerEFRepository.cs b/Providers/Entities/XAiMcpServerEFRepository.cs new file mode 100644 index 0000000..19d1c9e --- /dev/null +++ b/Providers/Entities/XAiMcpServerEFRepository.cs @@ -0,0 +1,22 @@ +using System; +using xDataService.Db; +using xDataService.Providers; +using xDataService.Interfaces; +using xAiModels.Models.Entities; +using xDataService.Configuration; +using xAiModels.Interfaces.Entities; + +namespace xAiModels.Providers.Entities +{ + public class XAiMcpServerEFRepository : XBaseEFRepository, IXAiMcpServerRepository + where TContext : XDbContext + { + public XAiMcpServerEFRepository( + IXUnitOfWorks unitOfWorks, + XDataServiceConfiguration configuration, + IXAiMcpServerKeyGenerator keyGenerator = null, + IXAiMcpServerRepositoryEvents baseRepositoryEvents = null + ) : base(unitOfWorks, configuration, keyGenerator, baseRepositoryEvents) + { } + } +} \ No newline at end of file diff --git a/Providers/Entities/XAiMcpServerEntityHub.cs b/Providers/Entities/XAiMcpServerEntityHub.cs new file mode 100644 index 0000000..d09ccb5 --- /dev/null +++ b/Providers/Entities/XAiMcpServerEntityHub.cs @@ -0,0 +1,16 @@ +using System; +using xPushService.Base; +using xAiModels.Models.Entities; +using Microsoft.Extensions.Logging; +using xAiModels.Interfaces.Entities; + +namespace xAiModels.Providers.Entities +{ + public class XAiMcpServerEntityHub : XBaseEntityHub, IXAiMcpServerEntityHub + { + public XAiMcpServerEntityHub( + ILogger logger + ) : base(logger) + { } + } +} \ No newline at end of file diff --git a/Providers/Entities/XAiMcpServerInMemoryRepository.cs b/Providers/Entities/XAiMcpServerInMemoryRepository.cs new file mode 100644 index 0000000..5deadaf --- /dev/null +++ b/Providers/Entities/XAiMcpServerInMemoryRepository.cs @@ -0,0 +1,18 @@ +using System; +using xDataService.Providers; +using xAiModels.Models.Entities; +using xDataService.Configuration; +using xAiModels.Interfaces.Entities; + +namespace xAiModels.Providers.Entities +{ + public class XAiMcpServerInMemoryRepository : XBaseInMemoryRepository, IXAiMcpServerRepository + { + public XAiMcpServerInMemoryRepository( + XDataServiceConfiguration configuration, + IXAiMcpServerKeyGenerator keyGenerator = null, + IXAiMcpServerRepositoryEvents baseRepositoryEvents = null + ) : base(configuration, keyGenerator, baseRepositoryEvents) + { } + } +} \ No newline at end of file diff --git a/Providers/Entities/XAiMcpServerKeyGenerator.cs b/Providers/Entities/XAiMcpServerKeyGenerator.cs new file mode 100644 index 0000000..18188e1 --- /dev/null +++ b/Providers/Entities/XAiMcpServerKeyGenerator.cs @@ -0,0 +1,9 @@ +using xDataService.Providers; +using xAiModels.Models.Entities; +using xAiModels.Interfaces.Entities; + +namespace xAiModels.Providers.Entities +{ + public class XAiMcpServerKeyGenerator : XGuidKeyGenerator, IXAiMcpServerKeyGenerator + { } +} \ No newline at end of file diff --git a/Providers/Entities/XAiMcpServerMongoRepository.cs b/Providers/Entities/XAiMcpServerMongoRepository.cs new file mode 100644 index 0000000..1d31661 --- /dev/null +++ b/Providers/Entities/XAiMcpServerMongoRepository.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using xAiModels.Interfaces.Entities; +using xAiModels.Models.Entities; +using xDataService.Configuration; +using xDataService.Providers; + +namespace xAiModels.Providers.Entities +{ + public class XAiMcpServerMongoRepository : XBaseMongoRepository, IXAiMcpServerRepository + { + public XAiMcpServerMongoRepository( + XDataBaseConfiguration dbConfiguration, + XDataServiceConfiguration configuration, + string collectionName = null, + IXAiMcpServerKeyGenerator keyGenerator = null, + IXAiMcpServerRepositoryEvents baseRepositoryEvents = null + ) : base(dbConfiguration, configuration, collectionName, keyGenerator, baseRepositoryEvents) + { } + } +} \ No newline at end of file diff --git a/Providers/Entities/XAiMcpServerRepositoryEvents.cs b/Providers/Entities/XAiMcpServerRepositoryEvents.cs new file mode 100644 index 0000000..ab11127 --- /dev/null +++ b/Providers/Entities/XAiMcpServerRepositoryEvents.cs @@ -0,0 +1,9 @@ +using xDataService.Providers; +using xAiModels.Models.Entities; +using xAiModels.Interfaces.Entities; + +namespace xAiModels.Providers.Entities +{ + public class XAiMcpServerRepositoryEvents : XBaseRepositoryEvents, IXAiMcpServerRepositoryEvents + { } +} \ No newline at end of file diff --git a/Providers/Entities/XAiMcpServerRepositoryProvider.cs b/Providers/Entities/XAiMcpServerRepositoryProvider.cs new file mode 100644 index 0000000..2f92c6f --- /dev/null +++ b/Providers/Entities/XAiMcpServerRepositoryProvider.cs @@ -0,0 +1,21 @@ +using System; +using xPushService.Base; +using xAiModels.Models.Entities; +using xDataService.Configuration; +using xIdentityService.Interfaces; +using Microsoft.AspNetCore.SignalR; +using xAiModels.Interfaces.Entities; + +namespace xAiModels.Providers.Entities +{ + public class XAiMcpServerRepositoryProvider : XBaseEntityProvider, IXAiMcpServerRepositoryProvider + { + public XAiMcpServerRepositoryProvider( + IHubContext hub, + IXAiMcpServerRepository repository, + XDataServiceConfiguration dataConfiguration, + IXIdentityProvider identityProvider = null + ) : base(hub, repository, dataConfiguration, identityProvider) + { } + } +} \ No newline at end of file diff --git a/Providers/GraphQL/XAiMcpServerGraphQLTypeHelper.cs b/Providers/GraphQL/XAiMcpServerGraphQLTypeHelper.cs new file mode 100644 index 0000000..50e4284 --- /dev/null +++ b/Providers/GraphQL/XAiMcpServerGraphQLTypeHelper.cs @@ -0,0 +1,21 @@ +using System; +using xAiModels.Constants; +using xDataService.GraphQL; +using xAiModels.Models.Entities; +using xAiModels.Interfaces.Entities; + +namespace xAiModels.Providers.GraphQL +{ + public class XAiMcpServerGraphQLTypeHelper : XBaseGraphQLTypeHelper, IXAiMcpServerGraphQLTypeHelper + { + public override string GetInQueryCollectionName() + { + return XAiModelsConstants.XAiMcpServerCollectionName; + } + + public override string GetInQuerySingleName() + { + return XAiModelsConstants.XAiMcpServerSingleName; + } + } +} \ No newline at end of file diff --git a/Providers/GraphQL/XAiMcpServerGraphQuery.cs b/Providers/GraphQL/XAiMcpServerGraphQuery.cs new file mode 100644 index 0000000..1ce9c30 --- /dev/null +++ b/Providers/GraphQL/XAiMcpServerGraphQuery.cs @@ -0,0 +1,23 @@ +using System; +using GraphQL.Types; +using xDataService.GraphQL; +using xAiModels.Models.Entities; +using xDataService.Configuration; +using xAiModels.Interfaces.Entities; + +namespace xAiModels.Providers.GraphQL +{ + public class XAiMcpServerGraphQuery : XBaseGraphQLQuery + { + public XAiMcpServerGraphQuery( + XDataServiceConfiguration configuration, + IXAiMcpServerRepository repository, + IXAiMcpServerGraphQLTypeHelper helper + ) : base( + configuration, + repository, + helper + ) + { } + } +} \ No newline at end of file diff --git a/Providers/GraphQL/XAiMcpServerGraphSchema.cs b/Providers/GraphQL/XAiMcpServerGraphSchema.cs new file mode 100644 index 0000000..0ac32b2 --- /dev/null +++ b/Providers/GraphQL/XAiMcpServerGraphSchema.cs @@ -0,0 +1,13 @@ +using System; +using GraphQL.Types; + +namespace xAiModels.Providers.GraphQL +{ + public class XAiMcpServerGraphSchema : Schema + { + public XAiMcpServerGraphSchema(IServiceProvider services) : base(services) + { + Query = (XAiMcpServerGraphQuery)services.GetService(typeof(XAiMcpServerGraphQuery)); + } + } +} \ No newline at end of file diff --git a/Providers/GraphQL/XAiMcpServerGraphType.cs b/Providers/GraphQL/XAiMcpServerGraphType.cs new file mode 100644 index 0000000..aee9fb6 --- /dev/null +++ b/Providers/GraphQL/XAiMcpServerGraphType.cs @@ -0,0 +1,23 @@ +using System; +using xDataService.GraphQL; +using xAiModels.Models.Entities; + +namespace xAiModels.Providers.GraphQL +{ + public class XAiMcpServerGraphType: XBaseGraphObjectType + { + public XAiMcpServerGraphType() : base() + { + Field(x => x.Name); + Field(x => x.Enabled); + Field(x => x.OwnerId); + Field(x => x.Headers); + Field(x => x.Endpoint); + Field(x => x.CreatedOn); + Field(x => x.UpdatedAt); + Field(x => x.Description); + Field(x => x.TimeoutSeconds); + Field(x => x.EnvironmentVariables); + } + } +} \ No newline at end of file diff --git a/Providers/XAiMcpServerEntityRegisterar .cs b/Providers/XAiMcpServerEntityRegisterar .cs new file mode 100644 index 0000000..51e6348 --- /dev/null +++ b/Providers/XAiMcpServerEntityRegisterar .cs @@ -0,0 +1,35 @@ +using System; +using xDataService.Providers; +using xDataService.Interfaces; +using xAiModels.Models.Entities; +using Microsoft.EntityFrameworkCore; +using xAiModels.Configurations.Entities; + +namespace xAiModels.Providers +{ + public class XAiMcpServerEntityRegisterar : XBaseEntityRegisterar, IXEntityRegisterar + { + public XAiMcpServerEntityRegisterar() + : base(nameof(XAiMcpServerEntityRegisterar)) + { + // + // Add Entity ... + AddEntity(); + } + + /// + /// Configure Entities ... + /// + /// + public override void ConfigureEntities(ModelBuilder modelBuilder) + { + // + // Configure Entity Using Provided ... + modelBuilder + .ApplyConfigurationsFromAssembly(typeof(XAiMcpServerEntityConfiguration).Assembly); + + // + base.ConfigureEntities(modelBuilder); + } + } +} \ No newline at end of file