@memberjunction/server 3.3.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +59 -0
  2. package/dist/auth/BaseAuthProvider.d.ts +1 -0
  3. package/dist/auth/BaseAuthProvider.d.ts.map +1 -1
  4. package/dist/auth/BaseAuthProvider.js +2 -0
  5. package/dist/auth/BaseAuthProvider.js.map +1 -1
  6. package/dist/auth/IAuthProvider.d.ts +1 -0
  7. package/dist/auth/IAuthProvider.d.ts.map +1 -1
  8. package/dist/config.js +2 -2
  9. package/dist/config.js.map +1 -1
  10. package/dist/generated/generated.d.ts +431 -2
  11. package/dist/generated/generated.d.ts.map +1 -1
  12. package/dist/generated/generated.js +3052 -379
  13. package/dist/generated/generated.js.map +1 -1
  14. package/dist/generic/ResolverBase.d.ts +1 -0
  15. package/dist/generic/ResolverBase.d.ts.map +1 -1
  16. package/dist/generic/ResolverBase.js +30 -0
  17. package/dist/generic/ResolverBase.js.map +1 -1
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +2 -2
  21. package/dist/index.js.map +1 -1
  22. package/dist/resolvers/APIKeyResolver.d.ts +2 -1
  23. package/dist/resolvers/APIKeyResolver.d.ts.map +1 -1
  24. package/dist/resolvers/APIKeyResolver.js +4 -1
  25. package/dist/resolvers/APIKeyResolver.js.map +1 -1
  26. package/dist/resolvers/ActionResolver.d.ts +2 -1
  27. package/dist/resolvers/ActionResolver.d.ts.map +1 -1
  28. package/dist/resolvers/ActionResolver.js +4 -1
  29. package/dist/resolvers/ActionResolver.js.map +1 -1
  30. package/dist/resolvers/DatasetResolver.d.ts +5 -4
  31. package/dist/resolvers/DatasetResolver.d.ts.map +1 -1
  32. package/dist/resolvers/DatasetResolver.js +7 -4
  33. package/dist/resolvers/DatasetResolver.js.map +1 -1
  34. package/dist/resolvers/EntityCommunicationsResolver.d.ts +2 -1
  35. package/dist/resolvers/EntityCommunicationsResolver.d.ts.map +1 -1
  36. package/dist/resolvers/EntityCommunicationsResolver.js +3 -1
  37. package/dist/resolvers/EntityCommunicationsResolver.js.map +1 -1
  38. package/dist/resolvers/GetDataContextDataResolver.d.ts +2 -1
  39. package/dist/resolvers/GetDataContextDataResolver.d.ts.map +1 -1
  40. package/dist/resolvers/GetDataContextDataResolver.js +10 -3
  41. package/dist/resolvers/GetDataContextDataResolver.js.map +1 -1
  42. package/dist/resolvers/MCPResolver.d.ts +37 -0
  43. package/dist/resolvers/MCPResolver.d.ts.map +1 -0
  44. package/dist/resolvers/MCPResolver.js +363 -0
  45. package/dist/resolvers/MCPResolver.js.map +1 -0
  46. package/dist/resolvers/MergeRecordsResolver.d.ts +2 -1
  47. package/dist/resolvers/MergeRecordsResolver.d.ts.map +1 -1
  48. package/dist/resolvers/MergeRecordsResolver.js +3 -1
  49. package/dist/resolvers/MergeRecordsResolver.js.map +1 -1
  50. package/dist/resolvers/QueryResolver.d.ts +2 -1
  51. package/dist/resolvers/QueryResolver.d.ts.map +1 -1
  52. package/dist/resolvers/QueryResolver.js +6 -1
  53. package/dist/resolvers/QueryResolver.js.map +1 -1
  54. package/dist/resolvers/ReportResolver.d.ts +2 -1
  55. package/dist/resolvers/ReportResolver.d.ts.map +1 -1
  56. package/dist/resolvers/ReportResolver.js +4 -1
  57. package/dist/resolvers/ReportResolver.js.map +1 -1
  58. package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
  59. package/dist/resolvers/RunAIAgentResolver.js +2 -0
  60. package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
  61. package/dist/resolvers/RunAIPromptResolver.d.ts.map +1 -1
  62. package/dist/resolvers/RunAIPromptResolver.js +3 -0
  63. package/dist/resolvers/RunAIPromptResolver.js.map +1 -1
  64. package/dist/resolvers/RunTemplateResolver.d.ts.map +1 -1
  65. package/dist/resolvers/RunTemplateResolver.js +1 -0
  66. package/dist/resolvers/RunTemplateResolver.js.map +1 -1
  67. package/dist/resolvers/TaskResolver.d.ts.map +1 -1
  68. package/dist/resolvers/TaskResolver.js +1 -0
  69. package/dist/resolvers/TaskResolver.js.map +1 -1
  70. package/dist/resolvers/UserResolver.d.ts.map +1 -1
  71. package/dist/resolvers/UserResolver.js +4 -0
  72. package/dist/resolvers/UserResolver.js.map +1 -1
  73. package/package.json +47 -46
  74. package/src/auth/BaseAuthProvider.ts +3 -0
  75. package/src/auth/IAuthProvider.ts +5 -0
  76. package/src/config.ts +2 -2
  77. package/src/generated/generated.ts +2020 -334
  78. package/src/generic/ResolverBase.ts +89 -3
  79. package/src/index.ts +10 -2
  80. package/src/resolvers/APIKeyResolver.ts +8 -1
  81. package/src/resolvers/ActionResolver.ts +8 -1
  82. package/src/resolvers/DatasetResolver.ts +11 -4
  83. package/src/resolvers/EntityCommunicationsResolver.ts +5 -1
  84. package/src/resolvers/GetDataContextDataResolver.ts +14 -6
  85. package/src/resolvers/MCPResolver.ts +480 -0
  86. package/src/resolvers/MergeRecordsResolver.ts +5 -1
  87. package/src/resolvers/QueryResolver.ts +17 -3
  88. package/src/resolvers/ReportResolver.ts +8 -1
  89. package/src/resolvers/RunAIAgentResolver.ts +6 -0
  90. package/src/resolvers/RunAIPromptResolver.ts +10 -1
  91. package/src/resolvers/RunTemplateResolver.ts +4 -1
  92. package/src/resolvers/TaskResolver.ts +3 -0
  93. package/src/resolvers/UserResolver.ts +15 -3
  94. package/dist/resolvers/AskSkipResolver.d.ts +0 -123
  95. package/dist/resolvers/AskSkipResolver.d.ts.map +0 -1
  96. package/dist/resolvers/AskSkipResolver.js +0 -1788
  97. package/dist/resolvers/AskSkipResolver.js.map +0 -1
  98. package/dist/scheduler/LearningCycleScheduler.d.ts +0 -4
  99. package/dist/scheduler/LearningCycleScheduler.d.ts.map +0 -1
  100. package/dist/scheduler/LearningCycleScheduler.js +0 -4
  101. package/dist/scheduler/LearningCycleScheduler.js.map +0 -1
  102. package/src/resolvers/AskSkipResolver.ts +0 -3446
  103. package/src/scheduler/LearningCycleScheduler.ts +0 -320
@@ -19,7 +19,7 @@ import { mj_core_schema } from '../config.js';
19
19
 
20
20
 
21
21
 
22
- import { ActionAuthorizationEntity, ActionCategoryEntity, ActionContextTypeEntity, ActionContextEntity, ActionExecutionLogEntity, ActionFilterEntity, ActionLibraryEntity, ActionParamEntity, ActionResultCodeEntity, ActionEntity, AIActionEntity, AIAgentActionEntity, AIAgentLearningCycleEntity, AIAgentModelEntity, AIAgentNoteTypeEntity, AIAgentNoteEntity, AIAgentRequestEntity, AIAgentEntity, AIModelActionEntity, AIModelTypeEntity, AIModelEntity, AIPromptCategoryEntity, AIPromptTypeEntity, AIPromptEntity, AIResultCacheEntity, ApplicationEntityEntity, ApplicationSettingEntity, ApplicationEntity, AuditLogTypeEntity, AuditLogEntity, AuthorizationRoleEntity, AuthorizationEntity, CommunicationBaseMessageTypeEntity, CommunicationLogEntity, CommunicationProviderMessageTypeEntity, CommunicationProviderEntity, CommunicationRunEntity, CompanyEntity, CompanyIntegrationRecordMapEntity, CompanyIntegrationRunAPILogEntity, CompanyIntegrationRunDetailEntity, CompanyIntegrationRunEntity, CompanyIntegrationEntity, ContentFileTypeEntity, ContentItemAttributeEntity, ContentItemTagEntity, ContentItemEntity, ContentProcessRunEntity, ContentSourceParamEntity, ContentSourceTypeParamEntity, ContentSourceTypeEntity, ContentSourceEntity, ContentTypeAttributeEntity, ContentTypeEntity, ConversationDetailEntity, ConversationEntity, DashboardCategoryEntity, DashboardEntity, DataContextItemEntity, DataContextEntity, DatasetItemEntity, DatasetEntity, DuplicateRunDetailMatchEntity, DuplicateRunDetailEntity, DuplicateRunEntity, EmployeeCompanyIntegrationEntity, EmployeeRoleEntity, EmployeeSkillEntity, EmployeeEntity, EntityEntity, EntityActionFilterEntity, EntityActionInvocationTypeEntity, EntityActionInvocationEntity, EntityActionParamEntity, EntityActionEntity, EntityAIActionEntity, EntityCommunicationFieldEntity, EntityCommunicationMessageTypeEntity, EntityDocumentRunEntity, EntityDocumentSettingEntity, EntityDocumentTypeEntity, EntityDocumentEntity, EntityFieldValueEntity, EntityFieldEntity, EntityPermissionEntity, EntityRecordDocumentEntity, EntityRelationshipDisplayComponentEntity, EntityRelationshipEntity, EntitySettingEntity, ErrorLogEntity, ExplorerNavigationItemEntity, FileCategoryEntity, FileEntityRecordLinkEntity, FileStorageProviderEntity, FileEntity, GeneratedCodeCategoryEntity, GeneratedCodeEntity, IntegrationURLFormatEntity, IntegrationEntity, LibraryEntity, LibraryItemEntity, ListCategoryEntity, ListDetailEntity, ListEntity, AccessControlRuleEntity, AIAgentArtifactTypeEntity, AIAgentConfigurationEntity, AIAgentDataSourceEntity, AIAgentExampleEntity, AIAgentModalityEntity, AIAgentPermissionEntity, AIAgentPromptEntity, AIAgentRelationshipEntity, AIAgentRunMediaEntity, AIAgentRunStepEntity, AIAgentRunEntity, AIAgentStepPathEntity, AIAgentStepEntity, AIAgentTypeEntity, AIArchitectureEntity, AIConfigurationParamEntity, AIConfigurationEntity, AICredentialBindingEntity, AIModalityEntity, AIModelArchitectureEntity, AIModelCostEntity, AIModelModalityEntity, AIModelPriceTypeEntity, AIModelPriceUnitTypeEntity, AIModelVendorEntity, AIPromptModelEntity, AIPromptRunMediaEntity, AIPromptRunEntity, AIVendorTypeDefinitionEntity, AIVendorTypeEntity, AIVendorEntity, APIApplicationScopeEntity, APIApplicationEntity, APIKeyApplicationEntity, APIKeyScopeEntity, APIKeyUsageLogEntity, APIKeyEntity, APIScopeEntity, ArtifactPermissionEntity, ArtifactTypeEntity, ArtifactUseEntity, ArtifactVersionAttributeEntity, ArtifactVersionEntity, ArtifactEntity, CollectionArtifactEntity, CollectionPermissionEntity, CollectionEntity, ComponentDependencyEntity, ComponentLibraryEntity, ComponentLibraryLinkEntity, ComponentRegistryEntity, ComponentEntity, ConversationArtifactPermissionEntity, ConversationArtifactVersionEntity, ConversationArtifactEntity, ConversationDetailArtifactEntity, ConversationDetailAttachmentEntity, ConversationDetailRatingEntity, CredentialCategoryEntity, CredentialTypeEntity, CredentialEntity, DashboardCategoryLinkEntity, DashboardCategoryPermissionEntity, DashboardPartTypeEntity, DashboardPermissionEntity, DashboardUserPreferenceEntity, DashboardUserStateEntity, EncryptionAlgorithmEntity, EncryptionKeySourceEntity, EncryptionKeyEntity, EnvironmentEntity, FileStorageAccountEntity, ListInvitationEntity, ListShareEntity, ProjectEntity, PublicLinkEntity, QueryParameterEntity, RecordLinkEntity, ReportUserStateEntity, ReportVersionEntity, ScheduledJobRunEntity, ScheduledJobTypeEntity, ScheduledJobEntity, TaskDependencyEntity, TaskTypeEntity, TaskEntity, TestRubricEntity, TestRunFeedbackEntity, TestRunEntity, TestSuiteRunEntity, TestSuiteTestEntity, TestSuiteEntity, TestTypeEntity, TestEntity, UserNotificationPreferenceEntity, UserNotificationTypeEntity, UserSettingEntity, OutputDeliveryTypeEntity, OutputFormatTypeEntity, OutputTriggerTypeEntity, QueryEntity, QueryCategoryEntity, QueryEntityEntity, QueryFieldEntity, QueryPermissionEntity, QueueTaskEntity, QueueTypeEntity, QueueEntity, RecommendationItemEntity, RecommendationProviderEntity, RecommendationRunEntity, RecommendationEntity, RecordChangeReplayRunEntity, RecordChangeEntity, RecordMergeDeletionLogEntity, RecordMergeLogEntity, ReportCategoryEntity, ReportSnapshotEntity, ReportEntity, ResourceLinkEntity, ResourcePermissionEntity, ResourceTypeEntity, RoleEntity, RowLevelSecurityFilterEntity, ScheduledActionParamEntity, ScheduledActionEntity, SchemaInfoEntity, SkillEntity, TaggedItemEntity, TagEntity, TemplateCategoryEntity, TemplateContentTypeEntity, TemplateContentEntity, TemplateParamEntity, TemplateEntity, UserApplicationEntityEntity, UserApplicationEntity, UserFavoriteEntity, UserNotificationEntity, UserRecordLogEntity, UserRoleEntity, UserViewCategoryEntity, UserViewRunDetailEntity, UserViewRunEntity, UserViewEntity, UserEntity, VectorDatabaseEntity, VectorIndexEntity, VersionInstallationEntity, WorkflowEngineEntity, WorkflowRunEntity, WorkflowEntity, WorkspaceItemEntity, WorkspaceEntity } from '@memberjunction/core-entities';
22
+ import { ActionAuthorizationEntity, ActionCategoryEntity, ActionContextTypeEntity, ActionContextEntity, ActionExecutionLogEntity, ActionFilterEntity, ActionLibraryEntity, ActionParamEntity, ActionResultCodeEntity, ActionEntity, AIActionEntity, AIAgentActionEntity, AIAgentLearningCycleEntity, AIAgentModelEntity, AIAgentNoteTypeEntity, AIAgentNoteEntity, AIAgentRequestEntity, AIAgentEntity, AIModelActionEntity, AIModelTypeEntity, AIModelEntity, AIPromptCategoryEntity, AIPromptTypeEntity, AIPromptEntity, AIResultCacheEntity, ApplicationEntityEntity, ApplicationSettingEntity, ApplicationEntity, AuditLogTypeEntity, AuditLogEntity, AuthorizationRoleEntity, AuthorizationEntity, CommunicationBaseMessageTypeEntity, CommunicationLogEntity, CommunicationProviderMessageTypeEntity, CommunicationProviderEntity, CommunicationRunEntity, CompanyEntity, CompanyIntegrationRecordMapEntity, CompanyIntegrationRunAPILogEntity, CompanyIntegrationRunDetailEntity, CompanyIntegrationRunEntity, CompanyIntegrationEntity, ContentFileTypeEntity, ContentItemAttributeEntity, ContentItemTagEntity, ContentItemEntity, ContentProcessRunEntity, ContentSourceParamEntity, ContentSourceTypeParamEntity, ContentSourceTypeEntity, ContentSourceEntity, ContentTypeAttributeEntity, ContentTypeEntity, ConversationDetailEntity, ConversationEntity, DashboardCategoryEntity, DashboardEntity, DataContextItemEntity, DataContextEntity, DatasetItemEntity, DatasetEntity, DuplicateRunDetailMatchEntity, DuplicateRunDetailEntity, DuplicateRunEntity, EmployeeCompanyIntegrationEntity, EmployeeRoleEntity, EmployeeSkillEntity, EmployeeEntity, EntityEntity, EntityActionFilterEntity, EntityActionInvocationTypeEntity, EntityActionInvocationEntity, EntityActionParamEntity, EntityActionEntity, EntityAIActionEntity, EntityCommunicationFieldEntity, EntityCommunicationMessageTypeEntity, EntityDocumentRunEntity, EntityDocumentSettingEntity, EntityDocumentTypeEntity, EntityDocumentEntity, EntityFieldValueEntity, EntityFieldEntity, EntityPermissionEntity, EntityRecordDocumentEntity, EntityRelationshipDisplayComponentEntity, EntityRelationshipEntity, EntitySettingEntity, ErrorLogEntity, ExplorerNavigationItemEntity, FileCategoryEntity, FileEntityRecordLinkEntity, FileStorageProviderEntity, FileEntity, GeneratedCodeCategoryEntity, GeneratedCodeEntity, IntegrationURLFormatEntity, IntegrationEntity, LibraryEntity, LibraryItemEntity, ListCategoryEntity, ListDetailEntity, ListEntity, AccessControlRuleEntity, AIAgentArtifactTypeEntity, AIAgentConfigurationEntity, AIAgentDataSourceEntity, AIAgentExampleEntity, AIAgentModalityEntity, AIAgentPermissionEntity, AIAgentPromptEntity, AIAgentRelationshipEntity, AIAgentRunMediaEntity, AIAgentRunStepEntity, AIAgentRunEntity, AIAgentStepPathEntity, AIAgentStepEntity, AIAgentTypeEntity, AIArchitectureEntity, AIConfigurationParamEntity, AIConfigurationEntity, AICredentialBindingEntity, AIModalityEntity, AIModelArchitectureEntity, AIModelCostEntity, AIModelModalityEntity, AIModelPriceTypeEntity, AIModelPriceUnitTypeEntity, AIModelVendorEntity, AIPromptModelEntity, AIPromptRunMediaEntity, AIPromptRunEntity, AIVendorTypeDefinitionEntity, AIVendorTypeEntity, AIVendorEntity, APIApplicationScopeEntity, APIApplicationEntity, APIKeyApplicationEntity, APIKeyScopeEntity, APIKeyUsageLogEntity, APIKeyEntity, APIScopeEntity, ArtifactPermissionEntity, ArtifactTypeEntity, ArtifactUseEntity, ArtifactVersionAttributeEntity, ArtifactVersionEntity, ArtifactEntity, CollectionArtifactEntity, CollectionPermissionEntity, CollectionEntity, ComponentDependencyEntity, ComponentLibraryEntity, ComponentLibraryLinkEntity, ComponentRegistryEntity, ComponentEntity, ConversationArtifactPermissionEntity, ConversationArtifactVersionEntity, ConversationArtifactEntity, ConversationDetailArtifactEntity, ConversationDetailAttachmentEntity, ConversationDetailRatingEntity, CredentialCategoryEntity, CredentialTypeEntity, CredentialEntity, DashboardCategoryLinkEntity, DashboardCategoryPermissionEntity, DashboardPartTypeEntity, DashboardPermissionEntity, DashboardUserPreferenceEntity, DashboardUserStateEntity, EncryptionAlgorithmEntity, EncryptionKeySourceEntity, EncryptionKeyEntity, EnvironmentEntity, FileStorageAccountEntity, ListInvitationEntity, ListShareEntity, MCPServerConnectionPermissionEntity, MCPServerConnectionToolEntity, MCPServerConnectionEntity, MCPServerToolEntity, MCPServerEntity, MCPToolExecutionLogEntity, ProjectEntity, PublicLinkEntity, QueryParameterEntity, RecordLinkEntity, ReportUserStateEntity, ReportVersionEntity, ScheduledJobRunEntity, ScheduledJobTypeEntity, ScheduledJobEntity, TaskDependencyEntity, TaskTypeEntity, TaskEntity, TestRubricEntity, TestRunFeedbackEntity, TestRunEntity, TestSuiteRunEntity, TestSuiteTestEntity, TestSuiteEntity, TestTypeEntity, TestEntity, UserNotificationPreferenceEntity, UserNotificationTypeEntity, UserSettingEntity, OutputDeliveryTypeEntity, OutputFormatTypeEntity, OutputTriggerTypeEntity, QueryEntity, QueryCategoryEntity, QueryEntityEntity, QueryFieldEntity, QueryPermissionEntity, QueueTaskEntity, QueueTypeEntity, QueueEntity, RecommendationItemEntity, RecommendationProviderEntity, RecommendationRunEntity, RecommendationEntity, RecordChangeReplayRunEntity, RecordChangeEntity, RecordMergeDeletionLogEntity, RecordMergeLogEntity, ReportCategoryEntity, ReportSnapshotEntity, ReportEntity, ResourceLinkEntity, ResourcePermissionEntity, ResourceTypeEntity, RoleEntity, RowLevelSecurityFilterEntity, ScheduledActionParamEntity, ScheduledActionEntity, SchemaInfoEntity, SkillEntity, TaggedItemEntity, TagEntity, TemplateCategoryEntity, TemplateContentTypeEntity, TemplateContentEntity, TemplateParamEntity, TemplateEntity, UserApplicationEntityEntity, UserApplicationEntity, UserFavoriteEntity, UserNotificationEntity, UserRecordLogEntity, UserRoleEntity, UserViewCategoryEntity, UserViewRunDetailEntity, UserViewRunEntity, UserViewEntity, UserEntity, VectorDatabaseEntity, VectorIndexEntity, VersionInstallationEntity, WorkflowEngineEntity, WorkflowRunEntity, WorkflowEntity, WorkspaceItemEntity, WorkspaceEntity } from '@memberjunction/core-entities';
23
23
 
24
24
 
25
25
  //****************************************************************************
@@ -233,6 +233,9 @@ export class MJActionCategory_ {
233
233
  @Field(() => [MJAction_])
234
234
  Actions_CategoryIDArray: MJAction_[]; // Link to Actions
235
235
 
236
+ @Field(() => [MJMCPServerTool_])
237
+ MJ_MCPServerTools_GeneratedActionCategoryIDArray: MJMCPServerTool_[]; // Link to MJ_MCPServerTools
238
+
236
239
  }
237
240
 
238
241
  //****************************************************************************
@@ -361,6 +364,17 @@ export class MJActionCategoryResolver extends ResolverBase {
361
364
  return result;
362
365
  }
363
366
 
367
+ @FieldResolver(() => [MJMCPServerTool_])
368
+ async MJ_MCPServerTools_GeneratedActionCategoryIDArray(@Root() mjactioncategory_: MJActionCategory_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
369
+ this.CheckUserReadPermissions('MJ: MCP Server Tools', userPayload);
370
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
371
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
372
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPServerTools] WHERE [GeneratedActionCategoryID]='${mjactioncategory_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Server Tools', userPayload, EntityPermissionType.Read, 'AND');
373
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
374
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: MCP Server Tools', rows, this.GetUserFromPayload(userPayload));
375
+ return result;
376
+ }
377
+
364
378
  @Mutation(() => MJActionCategory_)
365
379
  async CreateMJActionCategory(
366
380
  @Arg('input', () => CreateMJActionCategoryInput) input: CreateMJActionCategoryInput,
@@ -1812,6 +1826,9 @@ export class MJAction_ {
1812
1826
  @Field(() => [MJAIAgentAction_])
1813
1827
  AIAgentActions_ActionIDArray: MJAIAgentAction_[]; // Link to AIAgentActions
1814
1828
 
1829
+ @Field(() => [MJMCPServerTool_])
1830
+ MJ_MCPServerTools_GeneratedActionIDArray: MJMCPServerTool_[]; // Link to MJ_MCPServerTools
1831
+
1815
1832
  @Field(() => [MJActionContext_])
1816
1833
  ActionContexts_ActionIDArray: MJActionContext_[]; // Link to ActionContexts
1817
1834
 
@@ -2087,6 +2104,17 @@ export class MJActionResolver extends ResolverBase {
2087
2104
  return result;
2088
2105
  }
2089
2106
 
2107
+ @FieldResolver(() => [MJMCPServerTool_])
2108
+ async MJ_MCPServerTools_GeneratedActionIDArray(@Root() mjaction_: MJAction_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2109
+ this.CheckUserReadPermissions('MJ: MCP Server Tools', userPayload);
2110
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2111
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2112
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPServerTools] WHERE [GeneratedActionID]='${mjaction_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Server Tools', userPayload, EntityPermissionType.Read, 'AND');
2113
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2114
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: MCP Server Tools', rows, this.GetUserFromPayload(userPayload));
2115
+ return result;
2116
+ }
2117
+
2090
2118
  @FieldResolver(() => [MJActionContext_])
2091
2119
  async ActionContexts_ActionIDArray(@Root() mjaction_: MJAction_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2092
2120
  this.CheckUserReadPermissions('Action Contexts', userPayload);
@@ -9807,6 +9835,9 @@ export class MJCompany_ {
9807
9835
  @Field(() => [MJWorkflow_])
9808
9836
  Workflows_CompanyNameArray: MJWorkflow_[]; // Link to Workflows
9809
9837
 
9838
+ @Field(() => [MJMCPServerConnection_])
9839
+ MJ_MCPServerConnections_CompanyIDArray: MJMCPServerConnection_[]; // Link to MJ_MCPServerConnections
9840
+
9810
9841
  @Field(() => [MJAIAgentNote_])
9811
9842
  AIAgentNotes_CompanyIDArray: MJAIAgentNote_[]; // Link to AIAgentNotes
9812
9843
 
@@ -9969,6 +10000,17 @@ export class MJCompanyResolver extends ResolverBase {
9969
10000
  return result;
9970
10001
  }
9971
10002
 
10003
+ @FieldResolver(() => [MJMCPServerConnection_])
10004
+ async MJ_MCPServerConnections_CompanyIDArray(@Root() mjcompany_: MJCompany_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
10005
+ this.CheckUserReadPermissions('MJ: MCP Server Connections', userPayload);
10006
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
10007
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
10008
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPServerConnections] WHERE [CompanyID]='${mjcompany_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Server Connections', userPayload, EntityPermissionType.Read, 'AND');
10009
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
10010
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: MCP Server Connections', rows, this.GetUserFromPayload(userPayload));
10011
+ return result;
10012
+ }
10013
+
9972
10014
  @FieldResolver(() => [MJAIAgentNote_])
9973
10015
  async AIAgentNotes_CompanyIDArray(@Root() mjcompany_: MJCompany_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
9974
10016
  this.CheckUserReadPermissions('AI Agent Notes', userPayload);
@@ -34982,12 +35024,12 @@ export class MJAPIApplication_ {
34982
35024
  @MaxLength(10)
34983
35025
  _mj__UpdatedAt: Date;
34984
35026
 
34985
- @Field(() => [MJAPIApplicationScope_])
34986
- MJ_APIApplicationScopes_ApplicationIDArray: MJAPIApplicationScope_[]; // Link to MJ_APIApplicationScopes
34987
-
34988
35027
  @Field(() => [MJAPIKeyUsageLog_])
34989
35028
  MJ_APIKeyUsageLogs_ApplicationIDArray: MJAPIKeyUsageLog_[]; // Link to MJ_APIKeyUsageLogs
34990
35029
 
35030
+ @Field(() => [MJAPIApplicationScope_])
35031
+ MJ_APIApplicationScopes_ApplicationIDArray: MJAPIApplicationScope_[]; // Link to MJ_APIApplicationScopes
35032
+
34991
35033
  @Field(() => [MJAPIKeyApplication_])
34992
35034
  MJ_APIKeyApplications_ApplicationIDArray: MJAPIKeyApplication_[]; // Link to MJ_APIKeyApplications
34993
35035
 
@@ -35091,25 +35133,25 @@ export class MJAPIApplicationResolver extends ResolverBase {
35091
35133
  return result;
35092
35134
  }
35093
35135
 
35094
- @FieldResolver(() => [MJAPIApplicationScope_])
35095
- async MJ_APIApplicationScopes_ApplicationIDArray(@Root() mjapiapplication_: MJAPIApplication_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
35096
- this.CheckUserReadPermissions('MJ: API Application Scopes', userPayload);
35136
+ @FieldResolver(() => [MJAPIKeyUsageLog_])
35137
+ async MJ_APIKeyUsageLogs_ApplicationIDArray(@Root() mjapiapplication_: MJAPIApplication_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
35138
+ this.CheckUserReadPermissions('MJ: API Key Usage Logs', userPayload);
35097
35139
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
35098
35140
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
35099
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAPIApplicationScopes] WHERE [ApplicationID]='${mjapiapplication_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: API Application Scopes', userPayload, EntityPermissionType.Read, 'AND');
35141
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAPIKeyUsageLogs] WHERE [ApplicationID]='${mjapiapplication_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: API Key Usage Logs', userPayload, EntityPermissionType.Read, 'AND');
35100
35142
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
35101
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: API Application Scopes', rows, this.GetUserFromPayload(userPayload));
35143
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: API Key Usage Logs', rows, this.GetUserFromPayload(userPayload));
35102
35144
  return result;
35103
35145
  }
35104
35146
 
35105
- @FieldResolver(() => [MJAPIKeyUsageLog_])
35106
- async MJ_APIKeyUsageLogs_ApplicationIDArray(@Root() mjapiapplication_: MJAPIApplication_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
35107
- this.CheckUserReadPermissions('MJ: API Key Usage Logs', userPayload);
35147
+ @FieldResolver(() => [MJAPIApplicationScope_])
35148
+ async MJ_APIApplicationScopes_ApplicationIDArray(@Root() mjapiapplication_: MJAPIApplication_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
35149
+ this.CheckUserReadPermissions('MJ: API Application Scopes', userPayload);
35108
35150
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
35109
35151
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
35110
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAPIKeyUsageLogs] WHERE [ApplicationID]='${mjapiapplication_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: API Key Usage Logs', userPayload, EntityPermissionType.Read, 'AND');
35152
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAPIApplicationScopes] WHERE [ApplicationID]='${mjapiapplication_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: API Application Scopes', userPayload, EntityPermissionType.Read, 'AND');
35111
35153
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
35112
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: API Key Usage Logs', rows, this.GetUserFromPayload(userPayload));
35154
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: API Application Scopes', rows, this.GetUserFromPayload(userPayload));
35113
35155
  return result;
35114
35156
  }
35115
35157
 
@@ -36068,6 +36110,9 @@ export class MJAPIScope_ {
36068
36110
  @Field(() => Boolean, {description: `Whether this scope is currently active. Inactive scopes are ignored during authorization.`})
36069
36111
  IsActive: boolean;
36070
36112
 
36113
+ @Field({nullable: true, description: `JSON configuration for UI presentation. Schema: { "icon": "fa-solid fa-xxx", "color": "#hexcolor" }. Icon should be a Font Awesome class. Color should be a hex color code.`})
36114
+ UIConfig?: string;
36115
+
36071
36116
  @Field({nullable: true})
36072
36117
  @MaxLength(200)
36073
36118
  Parent?: string;
@@ -36115,6 +36160,9 @@ export class CreateMJAPIScopeInput {
36115
36160
 
36116
36161
  @Field(() => Boolean, { nullable: true })
36117
36162
  IsActive?: boolean;
36163
+
36164
+ @Field({ nullable: true })
36165
+ UIConfig: string | null;
36118
36166
  }
36119
36167
 
36120
36168
 
@@ -36147,6 +36195,9 @@ export class UpdateMJAPIScopeInput {
36147
36195
  @Field(() => Boolean, { nullable: true })
36148
36196
  IsActive?: boolean;
36149
36197
 
36198
+ @Field({ nullable: true })
36199
+ UIConfig?: string | null;
36200
+
36150
36201
  @Field(() => [KeyValuePairInput], { nullable: true })
36151
36202
  OldValues___?: KeyValuePairInput[];
36152
36203
  }
@@ -40913,6 +40964,9 @@ export class MJCredentialType_ {
40913
40964
  @Field(() => [MJCredential_])
40914
40965
  MJ_Credentials_CredentialTypeIDArray: MJCredential_[]; // Link to MJ_Credentials
40915
40966
 
40967
+ @Field(() => [MJMCPServer_])
40968
+ MJ_MCPServers_CredentialTypeIDArray: MJMCPServer_[]; // Link to MJ_MCPServers
40969
+
40916
40970
  @Field(() => [MJAIVendor_])
40917
40971
  MJ_AIVendors_CredentialTypeIDArray: MJAIVendor_[]; // Link to MJ_AIVendors
40918
40972
 
@@ -41045,6 +41099,17 @@ export class MJCredentialTypeResolver extends ResolverBase {
41045
41099
  return result;
41046
41100
  }
41047
41101
 
41102
+ @FieldResolver(() => [MJMCPServer_])
41103
+ async MJ_MCPServers_CredentialTypeIDArray(@Root() mjcredentialtype_: MJCredentialType_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
41104
+ this.CheckUserReadPermissions('MJ: MCP Servers', userPayload);
41105
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
41106
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
41107
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPServers] WHERE [CredentialTypeID]='${mjcredentialtype_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Servers', userPayload, EntityPermissionType.Read, 'AND');
41108
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
41109
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: MCP Servers', rows, this.GetUserFromPayload(userPayload));
41110
+ return result;
41111
+ }
41112
+
41048
41113
  @FieldResolver(() => [MJAIVendor_])
41049
41114
  async MJ_AIVendors_CredentialTypeIDArray(@Root() mjcredentialtype_: MJCredentialType_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
41050
41115
  this.CheckUserReadPermissions('MJ: AI Vendors', userPayload);
@@ -41153,6 +41218,9 @@ export class MJCredential_ {
41153
41218
  @Field(() => [MJFileStorageAccount_])
41154
41219
  MJ_FileStorageAccounts_CredentialIDArray: MJFileStorageAccount_[]; // Link to MJ_FileStorageAccounts
41155
41220
 
41221
+ @Field(() => [MJMCPServerConnection_])
41222
+ MJ_MCPServerConnections_CredentialIDArray: MJMCPServerConnection_[]; // Link to MJ_MCPServerConnections
41223
+
41156
41224
  @Field(() => [MJAICredentialBinding_])
41157
41225
  MJ_AICredentialBindings_CredentialIDArray: MJAICredentialBinding_[]; // Link to MJ_AICredentialBindings
41158
41226
 
@@ -41315,6 +41383,17 @@ export class MJCredentialResolver extends ResolverBase {
41315
41383
  return result;
41316
41384
  }
41317
41385
 
41386
+ @FieldResolver(() => [MJMCPServerConnection_])
41387
+ async MJ_MCPServerConnections_CredentialIDArray(@Root() mjcredential_: MJCredential_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
41388
+ this.CheckUserReadPermissions('MJ: MCP Server Connections', userPayload);
41389
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
41390
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
41391
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPServerConnections] WHERE [CredentialID]='${mjcredential_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Server Connections', userPayload, EntityPermissionType.Read, 'AND');
41392
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
41393
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: MCP Server Connections', rows, this.GetUserFromPayload(userPayload));
41394
+ return result;
41395
+ }
41396
+
41318
41397
  @FieldResolver(() => [MJAICredentialBinding_])
41319
41398
  async MJ_AICredentialBindings_CredentialIDArray(@Root() mjcredential_: MJCredential_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
41320
41399
  this.CheckUserReadPermissions('MJ: AI Credential Bindings', userPayload);
@@ -44009,39 +44088,34 @@ export class MJListShareResolver extends ResolverBase {
44009
44088
  }
44010
44089
 
44011
44090
  //****************************************************************************
44012
- // ENTITY CLASS for MJ: Projects
44091
+ // ENTITY CLASS for MJ: MCP Server Connection Permissions
44013
44092
  //****************************************************************************
44014
- @ObjectType({ description: `Container for grouping related conversations around a common topic, client, or initiative. Supports nesting for sub-projects.` })
44015
- export class MJProject_ {
44093
+ @ObjectType()
44094
+ export class MJMCPServerConnectionPermission_ {
44016
44095
  @Field()
44017
44096
  @MaxLength(16)
44018
44097
  ID: string;
44019
44098
 
44020
44099
  @Field()
44021
44100
  @MaxLength(16)
44022
- EnvironmentID: string;
44101
+ MCPServerConnectionID: string;
44023
44102
 
44024
- @Field({nullable: true})
44103
+ @Field({nullable: true, description: `FK to User (mutually exclusive with RoleID)`})
44025
44104
  @MaxLength(16)
44026
- ParentID?: string;
44027
-
44028
- @Field({description: `Display name for the project`})
44029
- @MaxLength(510)
44030
- Name: string;
44105
+ UserID?: string;
44031
44106
 
44032
- @Field({nullable: true, description: `Detailed description of the project goals and scope`})
44033
- Description?: string;
44107
+ @Field({nullable: true, description: `FK to Role (mutually exclusive with UserID)`})
44108
+ @MaxLength(16)
44109
+ RoleID?: string;
44034
44110
 
44035
- @Field({nullable: true, description: `Hex color code for project badges in UI (#RRGGBB format)`})
44036
- @MaxLength(14)
44037
- Color?: string;
44111
+ @Field(() => Boolean, {description: `Can invoke tools via this connection`})
44112
+ CanExecute: boolean;
44038
44113
 
44039
- @Field({nullable: true, description: `Font Awesome icon class for UI display`})
44040
- @MaxLength(100)
44041
- Icon?: string;
44114
+ @Field(() => Boolean, {description: `Can modify connection settings`})
44115
+ CanModify: boolean;
44042
44116
 
44043
- @Field(() => Boolean, {description: `Indicates if this project is archived and should be hidden from active lists`})
44044
- IsArchived: boolean;
44117
+ @Field(() => Boolean, {description: `Can see credential info (but not decrypt)`})
44118
+ CanViewCredentials: boolean;
44045
44119
 
44046
44120
  @Field()
44047
44121
  @MaxLength(10)
@@ -44053,98 +44127,83 @@ export class MJProject_ {
44053
44127
 
44054
44128
  @Field()
44055
44129
  @MaxLength(510)
44056
- Environment: string;
44130
+ MCPServerConnection: string;
44057
44131
 
44058
44132
  @Field({nullable: true})
44059
- @MaxLength(510)
44060
- Parent?: string;
44133
+ @MaxLength(200)
44134
+ User?: string;
44061
44135
 
44062
44136
  @Field({nullable: true})
44063
- @MaxLength(16)
44064
- RootParentID?: string;
44137
+ @MaxLength(100)
44138
+ Role?: string;
44065
44139
 
44066
- @Field(() => [MJProject_])
44067
- MJ_Projects_ParentIDArray: MJProject_[]; // Link to MJ_Projects
44068
-
44069
- @Field(() => [MJConversation_])
44070
- Conversations_ProjectIDArray: MJConversation_[]; // Link to Conversations
44071
-
44072
- @Field(() => [MJTask_])
44073
- MJ_Tasks_ProjectIDArray: MJTask_[]; // Link to MJ_Tasks
44074
-
44075
44140
  }
44076
44141
 
44077
44142
  //****************************************************************************
44078
- // INPUT TYPE for MJ: Projects
44143
+ // INPUT TYPE for MJ: MCP Server Connection Permissions
44079
44144
  //****************************************************************************
44080
44145
  @InputType()
44081
- export class CreateMJProjectInput {
44146
+ export class CreateMJMCPServerConnectionPermissionInput {
44082
44147
  @Field({ nullable: true })
44083
44148
  ID?: string;
44084
44149
 
44085
44150
  @Field({ nullable: true })
44086
- EnvironmentID?: string;
44087
-
44088
- @Field({ nullable: true })
44089
- ParentID: string | null;
44151
+ MCPServerConnectionID?: string;
44090
44152
 
44091
44153
  @Field({ nullable: true })
44092
- Name?: string;
44154
+ UserID: string | null;
44093
44155
 
44094
44156
  @Field({ nullable: true })
44095
- Description: string | null;
44157
+ RoleID: string | null;
44096
44158
 
44097
- @Field({ nullable: true })
44098
- Color: string | null;
44159
+ @Field(() => Boolean, { nullable: true })
44160
+ CanExecute?: boolean;
44099
44161
 
44100
- @Field({ nullable: true })
44101
- Icon: string | null;
44162
+ @Field(() => Boolean, { nullable: true })
44163
+ CanModify?: boolean;
44102
44164
 
44103
44165
  @Field(() => Boolean, { nullable: true })
44104
- IsArchived?: boolean;
44166
+ CanViewCredentials?: boolean;
44105
44167
  }
44106
44168
 
44107
44169
 
44108
44170
  //****************************************************************************
44109
- // INPUT TYPE for MJ: Projects
44171
+ // INPUT TYPE for MJ: MCP Server Connection Permissions
44110
44172
  //****************************************************************************
44111
44173
  @InputType()
44112
- export class UpdateMJProjectInput {
44174
+ export class UpdateMJMCPServerConnectionPermissionInput {
44113
44175
  @Field()
44114
44176
  ID: string;
44115
44177
 
44116
44178
  @Field({ nullable: true })
44117
- EnvironmentID?: string;
44118
-
44119
- @Field({ nullable: true })
44120
- ParentID?: string | null;
44179
+ MCPServerConnectionID?: string;
44121
44180
 
44122
44181
  @Field({ nullable: true })
44123
- Name?: string;
44182
+ UserID?: string | null;
44124
44183
 
44125
44184
  @Field({ nullable: true })
44126
- Description?: string | null;
44185
+ RoleID?: string | null;
44127
44186
 
44128
- @Field({ nullable: true })
44129
- Color?: string | null;
44187
+ @Field(() => Boolean, { nullable: true })
44188
+ CanExecute?: boolean;
44130
44189
 
44131
- @Field({ nullable: true })
44132
- Icon?: string | null;
44190
+ @Field(() => Boolean, { nullable: true })
44191
+ CanModify?: boolean;
44133
44192
 
44134
44193
  @Field(() => Boolean, { nullable: true })
44135
- IsArchived?: boolean;
44194
+ CanViewCredentials?: boolean;
44136
44195
 
44137
44196
  @Field(() => [KeyValuePairInput], { nullable: true })
44138
44197
  OldValues___?: KeyValuePairInput[];
44139
44198
  }
44140
44199
 
44141
44200
  //****************************************************************************
44142
- // RESOLVER for MJ: Projects
44201
+ // RESOLVER for MJ: MCP Server Connection Permissions
44143
44202
  //****************************************************************************
44144
44203
  @ObjectType()
44145
- export class RunMJProjectViewResult {
44146
- @Field(() => [MJProject_])
44147
- Results: MJProject_[];
44204
+ export class RunMJMCPServerConnectionPermissionViewResult {
44205
+ @Field(() => [MJMCPServerConnectionPermission_])
44206
+ Results: MJMCPServerConnectionPermission_[];
44148
44207
 
44149
44208
  @Field(() => String, {nullable: true})
44150
44209
  UserViewRunID?: string;
@@ -44165,140 +44224,91 @@ export class RunMJProjectViewResult {
44165
44224
  Success: boolean;
44166
44225
  }
44167
44226
 
44168
- @Resolver(MJProject_)
44169
- export class MJProjectResolver extends ResolverBase {
44170
- @Query(() => RunMJProjectViewResult)
44171
- async RunMJProjectViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44227
+ @Resolver(MJMCPServerConnectionPermission_)
44228
+ export class MJMCPServerConnectionPermissionResolver extends ResolverBase {
44229
+ @Query(() => RunMJMCPServerConnectionPermissionViewResult)
44230
+ async RunMJMCPServerConnectionPermissionViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44172
44231
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44173
44232
  return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
44174
44233
  }
44175
44234
 
44176
- @Query(() => RunMJProjectViewResult)
44177
- async RunMJProjectViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44235
+ @Query(() => RunMJMCPServerConnectionPermissionViewResult)
44236
+ async RunMJMCPServerConnectionPermissionViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44178
44237
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44179
44238
  return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
44180
44239
  }
44181
44240
 
44182
- @Query(() => RunMJProjectViewResult)
44183
- async RunMJProjectDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44241
+ @Query(() => RunMJMCPServerConnectionPermissionViewResult)
44242
+ async RunMJMCPServerConnectionPermissionDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44184
44243
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44185
- input.EntityName = 'MJ: Projects';
44244
+ input.EntityName = 'MJ: MCP Server Connection Permissions';
44186
44245
  return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
44187
44246
  }
44188
- @Query(() => MJProject_, { nullable: true })
44189
- async MJProject(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJProject_ | null> {
44190
- this.CheckUserReadPermissions('MJ: Projects', userPayload);
44247
+ @Query(() => MJMCPServerConnectionPermission_, { nullable: true })
44248
+ async MJMCPServerConnectionPermission(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJMCPServerConnectionPermission_ | null> {
44249
+ this.CheckUserReadPermissions('MJ: MCP Server Connection Permissions', userPayload);
44191
44250
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44192
44251
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
44193
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwProjects] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Projects', userPayload, EntityPermissionType.Read, 'AND');
44252
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPServerConnectionPermissions] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Server Connection Permissions', userPayload, EntityPermissionType.Read, 'AND');
44194
44253
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
44195
- const result = await this.MapFieldNamesToCodeNames('MJ: Projects', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
44254
+ const result = await this.MapFieldNamesToCodeNames('MJ: MCP Server Connection Permissions', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
44196
44255
  return result;
44197
44256
  }
44198
44257
 
44199
- @FieldResolver(() => [MJProject_])
44200
- async MJ_Projects_ParentIDArray(@Root() mjproject_: MJProject_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
44201
- this.CheckUserReadPermissions('MJ: Projects', userPayload);
44202
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44203
- const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
44204
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwProjects] WHERE [ParentID]='${mjproject_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Projects', userPayload, EntityPermissionType.Read, 'AND');
44205
- const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
44206
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Projects', rows, this.GetUserFromPayload(userPayload));
44207
- return result;
44208
- }
44209
-
44210
- @FieldResolver(() => [MJConversation_])
44211
- async Conversations_ProjectIDArray(@Root() mjproject_: MJProject_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
44212
- this.CheckUserReadPermissions('Conversations', userPayload);
44213
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44214
- const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
44215
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwConversations] WHERE [ProjectID]='${mjproject_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'Conversations', userPayload, EntityPermissionType.Read, 'AND');
44216
- const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
44217
- const result = await this.ArrayMapFieldNamesToCodeNames('Conversations', rows, this.GetUserFromPayload(userPayload));
44218
- return result;
44219
- }
44220
-
44221
- @FieldResolver(() => [MJTask_])
44222
- async MJ_Tasks_ProjectIDArray(@Root() mjproject_: MJProject_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
44223
- this.CheckUserReadPermissions('MJ: Tasks', userPayload);
44224
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44225
- const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
44226
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwTasks] WHERE [ProjectID]='${mjproject_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Tasks', userPayload, EntityPermissionType.Read, 'AND');
44227
- const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
44228
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Tasks', rows, this.GetUserFromPayload(userPayload));
44229
- return result;
44230
- }
44231
-
44232
- @Mutation(() => MJProject_)
44233
- async CreateMJProject(
44234
- @Arg('input', () => CreateMJProjectInput) input: CreateMJProjectInput,
44258
+ @Mutation(() => MJMCPServerConnectionPermission_)
44259
+ async CreateMJMCPServerConnectionPermission(
44260
+ @Arg('input', () => CreateMJMCPServerConnectionPermissionInput) input: CreateMJMCPServerConnectionPermissionInput,
44235
44261
  @Ctx() { providers, userPayload }: AppContext,
44236
44262
  @PubSub() pubSub: PubSubEngine
44237
44263
  ) {
44238
44264
  const provider = GetReadWriteProvider(providers);
44239
- return this.CreateRecord('MJ: Projects', input, provider, userPayload, pubSub)
44265
+ return this.CreateRecord('MJ: MCP Server Connection Permissions', input, provider, userPayload, pubSub)
44240
44266
  }
44241
44267
 
44242
- @Mutation(() => MJProject_)
44243
- async UpdateMJProject(
44244
- @Arg('input', () => UpdateMJProjectInput) input: UpdateMJProjectInput,
44268
+ @Mutation(() => MJMCPServerConnectionPermission_)
44269
+ async UpdateMJMCPServerConnectionPermission(
44270
+ @Arg('input', () => UpdateMJMCPServerConnectionPermissionInput) input: UpdateMJMCPServerConnectionPermissionInput,
44245
44271
  @Ctx() { providers, userPayload }: AppContext,
44246
44272
  @PubSub() pubSub: PubSubEngine
44247
44273
  ) {
44248
44274
  const provider = GetReadWriteProvider(providers);
44249
- return this.UpdateRecord('MJ: Projects', input, provider, userPayload, pubSub);
44275
+ return this.UpdateRecord('MJ: MCP Server Connection Permissions', input, provider, userPayload, pubSub);
44250
44276
  }
44251
44277
 
44252
- @Mutation(() => MJProject_)
44253
- async DeleteMJProject(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44278
+ @Mutation(() => MJMCPServerConnectionPermission_)
44279
+ async DeleteMJMCPServerConnectionPermission(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44254
44280
  const provider = GetReadWriteProvider(providers);
44255
44281
  const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
44256
- return this.DeleteRecord('MJ: Projects', key, options, provider, userPayload, pubSub);
44282
+ return this.DeleteRecord('MJ: MCP Server Connection Permissions', key, options, provider, userPayload, pubSub);
44257
44283
  }
44258
44284
 
44259
44285
  }
44260
44286
 
44261
44287
  //****************************************************************************
44262
- // ENTITY CLASS for MJ: Public Links
44288
+ // ENTITY CLASS for MJ: MCP Server Connection Tools
44263
44289
  //****************************************************************************
44264
- @ObjectType({ description: `Shareable links for external access to artifacts and other resources. Supports password protection and expiration.` })
44265
- export class MJPublicLink_ {
44290
+ @ObjectType()
44291
+ export class MJMCPServerConnectionTool_ {
44266
44292
  @Field()
44267
44293
  @MaxLength(16)
44268
44294
  ID: string;
44269
44295
 
44270
- @Field({description: `Type of resource being shared (Artifact, Conversation, Collection)`})
44271
- @MaxLength(100)
44272
- ResourceType: string;
44273
-
44274
44296
  @Field()
44275
44297
  @MaxLength(16)
44276
- ResourceID: string;
44277
-
44278
- @Field({description: `Unique token for accessing the shared resource via URL`})
44279
- @MaxLength(510)
44280
- Token: string;
44281
-
44282
- @Field({nullable: true, description: `SHA256 hash of optional password for additional security`})
44283
- @MaxLength(510)
44284
- PasswordHash?: string;
44285
-
44286
- @Field({nullable: true, description: `Optional expiration date/time for this public link`})
44287
- @MaxLength(10)
44288
- ExpiresAt?: Date;
44289
-
44290
- @Field(() => Int, {nullable: true, description: `Maximum number of times this link can be viewed`})
44291
- MaxViews?: number;
44292
-
44293
- @Field(() => Int, {description: `Current count of how many times this link has been viewed`})
44294
- CurrentViews: number;
44298
+ MCPServerConnectionID: string;
44295
44299
 
44296
44300
  @Field()
44297
44301
  @MaxLength(16)
44298
- UserID: string;
44302
+ MCPServerToolID: string;
44299
44303
 
44300
- @Field(() => Boolean, {description: `Indicates if this link is currently active and accessible`})
44301
- IsActive: boolean;
44304
+ @Field(() => Boolean, {description: `Whether this tool is enabled for the connection`})
44305
+ IsEnabled: boolean;
44306
+
44307
+ @Field({nullable: true, description: `JSON default values for tool inputs`})
44308
+ DefaultInputValues?: string;
44309
+
44310
+ @Field(() => Int, {nullable: true, description: `Override rate limit for this specific tool`})
44311
+ MaxCallsPerMinute?: number;
44302
44312
 
44303
44313
  @Field()
44304
44314
  @MaxLength(10)
@@ -44309,94 +44319,74 @@ export class MJPublicLink_ {
44309
44319
  _mj__UpdatedAt: Date;
44310
44320
 
44311
44321
  @Field()
44312
- @MaxLength(200)
44313
- User: string;
44322
+ @MaxLength(510)
44323
+ MCPServerConnection: string;
44324
+
44325
+ @Field({nullable: true})
44326
+ @MaxLength(510)
44327
+ MCPServerTool?: string;
44314
44328
 
44315
44329
  }
44316
44330
 
44317
44331
  //****************************************************************************
44318
- // INPUT TYPE for MJ: Public Links
44332
+ // INPUT TYPE for MJ: MCP Server Connection Tools
44319
44333
  //****************************************************************************
44320
44334
  @InputType()
44321
- export class CreateMJPublicLinkInput {
44335
+ export class CreateMJMCPServerConnectionToolInput {
44322
44336
  @Field({ nullable: true })
44323
44337
  ID?: string;
44324
44338
 
44325
44339
  @Field({ nullable: true })
44326
- ResourceType?: string;
44327
-
44328
- @Field({ nullable: true })
44329
- ResourceID?: string;
44340
+ MCPServerConnectionID?: string;
44330
44341
 
44331
44342
  @Field({ nullable: true })
44332
- Token?: string;
44343
+ MCPServerToolID?: string;
44333
44344
 
44334
- @Field({ nullable: true })
44335
- PasswordHash: string | null;
44345
+ @Field(() => Boolean, { nullable: true })
44346
+ IsEnabled?: boolean;
44336
44347
 
44337
44348
  @Field({ nullable: true })
44338
- ExpiresAt: Date | null;
44339
-
44340
- @Field(() => Int, { nullable: true })
44341
- MaxViews: number | null;
44349
+ DefaultInputValues: string | null;
44342
44350
 
44343
44351
  @Field(() => Int, { nullable: true })
44344
- CurrentViews?: number;
44345
-
44346
- @Field({ nullable: true })
44347
- UserID?: string;
44348
-
44349
- @Field(() => Boolean, { nullable: true })
44350
- IsActive?: boolean;
44352
+ MaxCallsPerMinute: number | null;
44351
44353
  }
44352
44354
 
44353
44355
 
44354
44356
  //****************************************************************************
44355
- // INPUT TYPE for MJ: Public Links
44357
+ // INPUT TYPE for MJ: MCP Server Connection Tools
44356
44358
  //****************************************************************************
44357
44359
  @InputType()
44358
- export class UpdateMJPublicLinkInput {
44360
+ export class UpdateMJMCPServerConnectionToolInput {
44359
44361
  @Field()
44360
44362
  ID: string;
44361
44363
 
44362
44364
  @Field({ nullable: true })
44363
- ResourceType?: string;
44364
-
44365
- @Field({ nullable: true })
44366
- ResourceID?: string;
44365
+ MCPServerConnectionID?: string;
44367
44366
 
44368
44367
  @Field({ nullable: true })
44369
- Token?: string;
44368
+ MCPServerToolID?: string;
44370
44369
 
44371
- @Field({ nullable: true })
44372
- PasswordHash?: string | null;
44370
+ @Field(() => Boolean, { nullable: true })
44371
+ IsEnabled?: boolean;
44373
44372
 
44374
44373
  @Field({ nullable: true })
44375
- ExpiresAt?: Date | null;
44376
-
44377
- @Field(() => Int, { nullable: true })
44378
- MaxViews?: number | null;
44374
+ DefaultInputValues?: string | null;
44379
44375
 
44380
44376
  @Field(() => Int, { nullable: true })
44381
- CurrentViews?: number;
44382
-
44383
- @Field({ nullable: true })
44384
- UserID?: string;
44385
-
44386
- @Field(() => Boolean, { nullable: true })
44387
- IsActive?: boolean;
44377
+ MaxCallsPerMinute?: number | null;
44388
44378
 
44389
44379
  @Field(() => [KeyValuePairInput], { nullable: true })
44390
44380
  OldValues___?: KeyValuePairInput[];
44391
44381
  }
44392
44382
 
44393
44383
  //****************************************************************************
44394
- // RESOLVER for MJ: Public Links
44384
+ // RESOLVER for MJ: MCP Server Connection Tools
44395
44385
  //****************************************************************************
44396
44386
  @ObjectType()
44397
- export class RunMJPublicLinkViewResult {
44398
- @Field(() => [MJPublicLink_])
44399
- Results: MJPublicLink_[];
44387
+ export class RunMJMCPServerConnectionToolViewResult {
44388
+ @Field(() => [MJMCPServerConnectionTool_])
44389
+ Results: MJMCPServerConnectionTool_[];
44400
44390
 
44401
44391
  @Field(() => String, {nullable: true})
44402
44392
  UserViewRunID?: string;
@@ -44417,108 +44407,129 @@ export class RunMJPublicLinkViewResult {
44417
44407
  Success: boolean;
44418
44408
  }
44419
44409
 
44420
- @Resolver(MJPublicLink_)
44421
- export class MJPublicLinkResolver extends ResolverBase {
44422
- @Query(() => RunMJPublicLinkViewResult)
44423
- async RunMJPublicLinkViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44410
+ @Resolver(MJMCPServerConnectionTool_)
44411
+ export class MJMCPServerConnectionToolResolver extends ResolverBase {
44412
+ @Query(() => RunMJMCPServerConnectionToolViewResult)
44413
+ async RunMJMCPServerConnectionToolViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44424
44414
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44425
44415
  return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
44426
44416
  }
44427
44417
 
44428
- @Query(() => RunMJPublicLinkViewResult)
44429
- async RunMJPublicLinkViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44418
+ @Query(() => RunMJMCPServerConnectionToolViewResult)
44419
+ async RunMJMCPServerConnectionToolViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44430
44420
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44431
44421
  return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
44432
44422
  }
44433
44423
 
44434
- @Query(() => RunMJPublicLinkViewResult)
44435
- async RunMJPublicLinkDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44424
+ @Query(() => RunMJMCPServerConnectionToolViewResult)
44425
+ async RunMJMCPServerConnectionToolDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44436
44426
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44437
- input.EntityName = 'MJ: Public Links';
44427
+ input.EntityName = 'MJ: MCP Server Connection Tools';
44438
44428
  return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
44439
44429
  }
44440
- @Query(() => MJPublicLink_, { nullable: true })
44441
- async MJPublicLink(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJPublicLink_ | null> {
44442
- this.CheckUserReadPermissions('MJ: Public Links', userPayload);
44430
+ @Query(() => MJMCPServerConnectionTool_, { nullable: true })
44431
+ async MJMCPServerConnectionTool(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJMCPServerConnectionTool_ | null> {
44432
+ this.CheckUserReadPermissions('MJ: MCP Server Connection Tools', userPayload);
44443
44433
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44444
44434
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
44445
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwPublicLinks] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Public Links', userPayload, EntityPermissionType.Read, 'AND');
44435
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPServerConnectionTools] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Server Connection Tools', userPayload, EntityPermissionType.Read, 'AND');
44446
44436
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
44447
- const result = await this.MapFieldNamesToCodeNames('MJ: Public Links', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
44437
+ const result = await this.MapFieldNamesToCodeNames('MJ: MCP Server Connection Tools', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
44448
44438
  return result;
44449
44439
  }
44450
44440
 
44451
- @Mutation(() => MJPublicLink_)
44452
- async CreateMJPublicLink(
44453
- @Arg('input', () => CreateMJPublicLinkInput) input: CreateMJPublicLinkInput,
44441
+ @Mutation(() => MJMCPServerConnectionTool_)
44442
+ async CreateMJMCPServerConnectionTool(
44443
+ @Arg('input', () => CreateMJMCPServerConnectionToolInput) input: CreateMJMCPServerConnectionToolInput,
44454
44444
  @Ctx() { providers, userPayload }: AppContext,
44455
44445
  @PubSub() pubSub: PubSubEngine
44456
44446
  ) {
44457
44447
  const provider = GetReadWriteProvider(providers);
44458
- return this.CreateRecord('MJ: Public Links', input, provider, userPayload, pubSub)
44448
+ return this.CreateRecord('MJ: MCP Server Connection Tools', input, provider, userPayload, pubSub)
44459
44449
  }
44460
44450
 
44461
- @Mutation(() => MJPublicLink_)
44462
- async UpdateMJPublicLink(
44463
- @Arg('input', () => UpdateMJPublicLinkInput) input: UpdateMJPublicLinkInput,
44451
+ @Mutation(() => MJMCPServerConnectionTool_)
44452
+ async UpdateMJMCPServerConnectionTool(
44453
+ @Arg('input', () => UpdateMJMCPServerConnectionToolInput) input: UpdateMJMCPServerConnectionToolInput,
44464
44454
  @Ctx() { providers, userPayload }: AppContext,
44465
44455
  @PubSub() pubSub: PubSubEngine
44466
44456
  ) {
44467
44457
  const provider = GetReadWriteProvider(providers);
44468
- return this.UpdateRecord('MJ: Public Links', input, provider, userPayload, pubSub);
44458
+ return this.UpdateRecord('MJ: MCP Server Connection Tools', input, provider, userPayload, pubSub);
44469
44459
  }
44470
44460
 
44471
- @Mutation(() => MJPublicLink_)
44472
- async DeleteMJPublicLink(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44461
+ @Mutation(() => MJMCPServerConnectionTool_)
44462
+ async DeleteMJMCPServerConnectionTool(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44473
44463
  const provider = GetReadWriteProvider(providers);
44474
44464
  const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
44475
- return this.DeleteRecord('MJ: Public Links', key, options, provider, userPayload, pubSub);
44465
+ return this.DeleteRecord('MJ: MCP Server Connection Tools', key, options, provider, userPayload, pubSub);
44476
44466
  }
44477
44467
 
44478
44468
  }
44479
44469
 
44480
44470
  //****************************************************************************
44481
- // ENTITY CLASS for MJ: Query Parameters
44471
+ // ENTITY CLASS for MJ: MCP Server Connections
44482
44472
  //****************************************************************************
44483
- @ObjectType({ description: `Stores parameter definitions for parameterized queries that use Nunjucks templates. Each parameter represents a dynamic value that can be passed when executing the query. Parameters are automatically extracted from the query template by the QueryEntityServer using LLM analysis, or can be manually defined. The combination of parameter metadata and validation filters creates a self-documenting, type-safe query execution system.` })
44484
- export class MJQueryParameter_ {
44473
+ @ObjectType()
44474
+ export class MJMCPServerConnection_ {
44485
44475
  @Field()
44486
44476
  @MaxLength(16)
44487
44477
  ID: string;
44488
44478
 
44489
44479
  @Field()
44490
44480
  @MaxLength(16)
44491
- QueryID: string;
44481
+ MCPServerID: string;
44492
44482
 
44493
- @Field({description: `The name of the parameter as it appears in the Nunjucks template. This must match exactly with the parameter reference in the SQL template. For example, if the template contains {{ userEmail | required | email }}, the Name would be "userEmail". Parameter names should follow JavaScript identifier rules: start with a letter, and contain only letters, numbers, and underscores.`})
44483
+ @Field({description: `Connection name (unique per company)`})
44494
44484
  @MaxLength(510)
44495
44485
  Name: string;
44496
44486
 
44497
- @Field({description: `The data type of the parameter used for validation and type conversion. Valid values are: "string" for text values, "number" for integers or decimals, "date" for date/datetime values (ISO 8601 format expected), "boolean" for true/false values, and "array" for multiple values (typically used with IN clauses). The type determines which validation filters can be applied and how the parameter is processed.`})
44487
+ @Field({nullable: true})
44488
+ Description?: string;
44489
+
44490
+ @Field({nullable: true, description: `FK to Credential entity (uses existing credential types)`})
44491
+ @MaxLength(16)
44492
+ CredentialID?: string;
44493
+
44494
+ @Field({nullable: true, description: `Custom header name for API key auth (default: X-API-Key)`})
44495
+ @MaxLength(200)
44496
+ CustomHeaderName?: string;
44497
+
44498
+ @Field({nullable: true, description: `Optional company association. NULL means the connection is global and available to all companies. Non-NULL restricts the connection to that specific company.`})
44499
+ @MaxLength(16)
44500
+ CompanyID?: string;
44501
+
44502
+ @Field()
44498
44503
  @MaxLength(100)
44499
- Type: string;
44504
+ Status: string;
44500
44505
 
44501
- @Field(() => Boolean, {nullable: true, description: `Indicates whether this parameter must be provided when executing the query. When true, the query execution will fail if the parameter is not supplied and no DefaultValue is set. This is automatically determined by the presence of the "required" filter in the template, but can be manually overridden. Required parameters ensure data integrity and prevent unintended query behavior.`})
44502
- IsRequired?: boolean;
44506
+ @Field(() => Boolean, {description: `Auto-sync tools when connecting`})
44507
+ AutoSyncTools: boolean;
44503
44508
 
44504
- @Field({nullable: true, description: `The default value to use when the parameter is not provided during query execution. This value must be compatible with the parameter Type. For arrays, use JSON format like ["value1","value2"]. Default values allow queries to have sensible fallbacks while still accepting custom inputs. If a parameter is required (IsRequired=true), the default value is ignored.`})
44505
- DefaultValue?: string;
44509
+ @Field(() => Boolean, {description: `Auto-generate MJ Actions for discovered tools`})
44510
+ AutoGenerateActions: boolean;
44506
44511
 
44507
- @Field({nullable: true, description: `Human-readable description explaining the purpose and usage of this parameter. This is typically generated by LLM analysis of the query context but can be manually edited. Good descriptions include: what the parameter filters or controls, valid value ranges or formats, business meaning, and any special considerations. This text is shown in UI to help users understand what value to provide.`})
44508
- Description?: string;
44512
+ @Field(() => Boolean, {description: `Log all tool calls to execution log`})
44513
+ LogToolCalls: boolean;
44509
44514
 
44510
- @Field({nullable: true, description: `A concrete example value demonstrating the proper format for this parameter. Generated by LLM based on the query context and validation filters. For example: "john@example.com" for an email parameter, "2024-01-15" for a date, or "["active","pending"]" for a status array. Sample values help users understand the expected format and can be used in API documentation.`})
44511
- SampleValue?: string;
44515
+ @Field(() => Boolean, {description: `Include input parameters in logs`})
44516
+ LogInputParameters: boolean;
44512
44517
 
44513
- @Field({nullable: true, description: `JSON array of Nunjucks filter definitions that validate and transform the parameter value. Each filter is an object with "name" and optional "args" properties. Filters are applied in order and can include: validation (required, email, min, max), transformation (trim, upper, lower), SQL safety (sqlsafe, sqljoin), and type conversion (number, date). Example: [{"name":"required"},{"name":"email"},{"name":"sqlsafe"}]. The filter chain ensures type safety and prevents SQL injection.`})
44514
- ValidationFilters?: string;
44518
+ @Field(() => Boolean, {description: `Include output content in logs`})
44519
+ LogOutputContent: boolean;
44515
44520
 
44516
- @Field({description: `Indicates how this parameter was identified and added to the system. "AI" means it was automatically detected by LLM analysis of the query template, including extraction of parameter name, type inference from filters, and generation of description. "Manual" means it was explicitly defined by a user. This helps track which parameters might need human review and provides transparency about the source of metadata.`})
44517
- @MaxLength(100)
44518
- DetectionMethod: string;
44521
+ @Field(() => Int, {nullable: true, description: `Max output size to log in bytes (default: 100KB)`})
44522
+ MaxOutputLogSize?: number;
44519
44523
 
44520
- @Field(() => Float, {nullable: true, description: `Confidence score (0.00-1.00) indicating how certain the AI was about this parameter detection. Only populated when DetectionMethod="AI". Higher scores indicate the LLM was more confident about the parameter name, type, and usage. Scores above 0.80 are generally reliable, 0.60-0.80 may benefit from human review, and below 0.60 should be manually verified. This helps prioritize which auto-detected parameters need human attention.`})
44521
- AutoDetectConfidenceScore?: number;
44524
+ @Field({nullable: true})
44525
+ @MaxLength(10)
44526
+ LastConnectedAt?: Date;
44527
+
44528
+ @Field({nullable: true})
44529
+ LastErrorMessage?: string;
44530
+
44531
+ @Field({nullable: true, description: `JSON object of environment variables for Stdio transport`})
44532
+ EnvironmentVars?: string;
44522
44533
 
44523
44534
  @Field()
44524
44535
  @MaxLength(10)
@@ -44530,99 +44541,152 @@ export class MJQueryParameter_ {
44530
44541
 
44531
44542
  @Field()
44532
44543
  @MaxLength(510)
44533
- Query: string;
44544
+ MCPServer: string;
44545
+
44546
+ @Field({nullable: true})
44547
+ @MaxLength(400)
44548
+ Credential?: string;
44549
+
44550
+ @Field({nullable: true})
44551
+ @MaxLength(100)
44552
+ Company?: string;
44534
44553
 
44554
+ @Field(() => [MJMCPServerConnectionTool_])
44555
+ MJ_MCPServerConnectionTools_MCPServerConnectionIDArray: MJMCPServerConnectionTool_[]; // Link to MJ_MCPServerConnectionTools
44556
+
44557
+ @Field(() => [MJMCPToolExecutionLog_])
44558
+ MJ_MCPToolExecutionLogs_MCPServerConnectionIDArray: MJMCPToolExecutionLog_[]; // Link to MJ_MCPToolExecutionLogs
44559
+
44560
+ @Field(() => [MJMCPServerConnectionPermission_])
44561
+ MJ_MCPServerConnectionPermissions_MCPServerConnectionIDArray: MJMCPServerConnectionPermission_[]; // Link to MJ_MCPServerConnectionPermissions
44562
+
44535
44563
  }
44536
44564
 
44537
44565
  //****************************************************************************
44538
- // INPUT TYPE for MJ: Query Parameters
44566
+ // INPUT TYPE for MJ: MCP Server Connections
44539
44567
  //****************************************************************************
44540
44568
  @InputType()
44541
- export class CreateMJQueryParameterInput {
44569
+ export class CreateMJMCPServerConnectionInput {
44542
44570
  @Field({ nullable: true })
44543
44571
  ID?: string;
44544
44572
 
44545
44573
  @Field({ nullable: true })
44546
- QueryID?: string;
44574
+ MCPServerID?: string;
44547
44575
 
44548
44576
  @Field({ nullable: true })
44549
44577
  Name?: string;
44550
44578
 
44551
44579
  @Field({ nullable: true })
44552
- Type?: string;
44580
+ Description: string | null;
44553
44581
 
44554
- @Field(() => Boolean, { nullable: true })
44555
- IsRequired?: boolean | null;
44582
+ @Field({ nullable: true })
44583
+ CredentialID: string | null;
44556
44584
 
44557
44585
  @Field({ nullable: true })
44558
- DefaultValue: string | null;
44586
+ CustomHeaderName: string | null;
44559
44587
 
44560
44588
  @Field({ nullable: true })
44561
- Description: string | null;
44589
+ CompanyID: string | null;
44562
44590
 
44563
44591
  @Field({ nullable: true })
44564
- SampleValue: string | null;
44592
+ Status?: string;
44593
+
44594
+ @Field(() => Boolean, { nullable: true })
44595
+ AutoSyncTools?: boolean;
44596
+
44597
+ @Field(() => Boolean, { nullable: true })
44598
+ AutoGenerateActions?: boolean;
44599
+
44600
+ @Field(() => Boolean, { nullable: true })
44601
+ LogToolCalls?: boolean;
44602
+
44603
+ @Field(() => Boolean, { nullable: true })
44604
+ LogInputParameters?: boolean;
44605
+
44606
+ @Field(() => Boolean, { nullable: true })
44607
+ LogOutputContent?: boolean;
44608
+
44609
+ @Field(() => Int, { nullable: true })
44610
+ MaxOutputLogSize?: number | null;
44565
44611
 
44566
44612
  @Field({ nullable: true })
44567
- ValidationFilters: string | null;
44613
+ LastConnectedAt: Date | null;
44568
44614
 
44569
44615
  @Field({ nullable: true })
44570
- DetectionMethod?: string;
44616
+ LastErrorMessage: string | null;
44571
44617
 
44572
- @Field(() => Float, { nullable: true })
44573
- AutoDetectConfidenceScore: number | null;
44618
+ @Field({ nullable: true })
44619
+ EnvironmentVars: string | null;
44574
44620
  }
44575
44621
 
44576
44622
 
44577
44623
  //****************************************************************************
44578
- // INPUT TYPE for MJ: Query Parameters
44624
+ // INPUT TYPE for MJ: MCP Server Connections
44579
44625
  //****************************************************************************
44580
44626
  @InputType()
44581
- export class UpdateMJQueryParameterInput {
44627
+ export class UpdateMJMCPServerConnectionInput {
44582
44628
  @Field()
44583
44629
  ID: string;
44584
44630
 
44585
44631
  @Field({ nullable: true })
44586
- QueryID?: string;
44632
+ MCPServerID?: string;
44587
44633
 
44588
44634
  @Field({ nullable: true })
44589
44635
  Name?: string;
44590
44636
 
44591
44637
  @Field({ nullable: true })
44592
- Type?: string;
44638
+ Description?: string | null;
44593
44639
 
44594
- @Field(() => Boolean, { nullable: true })
44595
- IsRequired?: boolean | null;
44640
+ @Field({ nullable: true })
44641
+ CredentialID?: string | null;
44596
44642
 
44597
44643
  @Field({ nullable: true })
44598
- DefaultValue?: string | null;
44644
+ CustomHeaderName?: string | null;
44599
44645
 
44600
44646
  @Field({ nullable: true })
44601
- Description?: string | null;
44647
+ CompanyID?: string | null;
44602
44648
 
44603
44649
  @Field({ nullable: true })
44604
- SampleValue?: string | null;
44650
+ Status?: string;
44651
+
44652
+ @Field(() => Boolean, { nullable: true })
44653
+ AutoSyncTools?: boolean;
44654
+
44655
+ @Field(() => Boolean, { nullable: true })
44656
+ AutoGenerateActions?: boolean;
44657
+
44658
+ @Field(() => Boolean, { nullable: true })
44659
+ LogToolCalls?: boolean;
44660
+
44661
+ @Field(() => Boolean, { nullable: true })
44662
+ LogInputParameters?: boolean;
44663
+
44664
+ @Field(() => Boolean, { nullable: true })
44665
+ LogOutputContent?: boolean;
44666
+
44667
+ @Field(() => Int, { nullable: true })
44668
+ MaxOutputLogSize?: number | null;
44605
44669
 
44606
44670
  @Field({ nullable: true })
44607
- ValidationFilters?: string | null;
44671
+ LastConnectedAt?: Date | null;
44608
44672
 
44609
44673
  @Field({ nullable: true })
44610
- DetectionMethod?: string;
44674
+ LastErrorMessage?: string | null;
44611
44675
 
44612
- @Field(() => Float, { nullable: true })
44613
- AutoDetectConfidenceScore?: number | null;
44676
+ @Field({ nullable: true })
44677
+ EnvironmentVars?: string | null;
44614
44678
 
44615
44679
  @Field(() => [KeyValuePairInput], { nullable: true })
44616
44680
  OldValues___?: KeyValuePairInput[];
44617
44681
  }
44618
44682
 
44619
44683
  //****************************************************************************
44620
- // RESOLVER for MJ: Query Parameters
44684
+ // RESOLVER for MJ: MCP Server Connections
44621
44685
  //****************************************************************************
44622
44686
  @ObjectType()
44623
- export class RunMJQueryParameterViewResult {
44624
- @Field(() => [MJQueryParameter_])
44625
- Results: MJQueryParameter_[];
44687
+ export class RunMJMCPServerConnectionViewResult {
44688
+ @Field(() => [MJMCPServerConnection_])
44689
+ Results: MJMCPServerConnection_[];
44626
44690
 
44627
44691
  @Field(() => String, {nullable: true})
44628
44692
  UserViewRunID?: string;
@@ -44643,100 +44707,151 @@ export class RunMJQueryParameterViewResult {
44643
44707
  Success: boolean;
44644
44708
  }
44645
44709
 
44646
- @Resolver(MJQueryParameter_)
44647
- export class MJQueryParameterResolver extends ResolverBase {
44648
- @Query(() => RunMJQueryParameterViewResult)
44649
- async RunMJQueryParameterViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44710
+ @Resolver(MJMCPServerConnection_)
44711
+ export class MJMCPServerConnectionResolver extends ResolverBase {
44712
+ @Query(() => RunMJMCPServerConnectionViewResult)
44713
+ async RunMJMCPServerConnectionViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44650
44714
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44651
44715
  return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
44652
44716
  }
44653
44717
 
44654
- @Query(() => RunMJQueryParameterViewResult)
44655
- async RunMJQueryParameterViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44718
+ @Query(() => RunMJMCPServerConnectionViewResult)
44719
+ async RunMJMCPServerConnectionViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44656
44720
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44657
44721
  return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
44658
44722
  }
44659
44723
 
44660
- @Query(() => RunMJQueryParameterViewResult)
44661
- async RunMJQueryParameterDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44724
+ @Query(() => RunMJMCPServerConnectionViewResult)
44725
+ async RunMJMCPServerConnectionDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44662
44726
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44663
- input.EntityName = 'MJ: Query Parameters';
44727
+ input.EntityName = 'MJ: MCP Server Connections';
44664
44728
  return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
44665
44729
  }
44666
- @Query(() => MJQueryParameter_, { nullable: true })
44667
- async MJQueryParameter(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJQueryParameter_ | null> {
44668
- this.CheckUserReadPermissions('MJ: Query Parameters', userPayload);
44730
+ @Query(() => MJMCPServerConnection_, { nullable: true })
44731
+ async MJMCPServerConnection(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJMCPServerConnection_ | null> {
44732
+ this.CheckUserReadPermissions('MJ: MCP Server Connections', userPayload);
44669
44733
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44670
44734
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
44671
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwQueryParameters] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Query Parameters', userPayload, EntityPermissionType.Read, 'AND');
44735
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPServerConnections] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Server Connections', userPayload, EntityPermissionType.Read, 'AND');
44672
44736
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
44673
- const result = await this.MapFieldNamesToCodeNames('MJ: Query Parameters', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
44737
+ const result = await this.MapFieldNamesToCodeNames('MJ: MCP Server Connections', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
44674
44738
  return result;
44675
44739
  }
44676
44740
 
44677
- @Mutation(() => MJQueryParameter_)
44678
- async CreateMJQueryParameter(
44679
- @Arg('input', () => CreateMJQueryParameterInput) input: CreateMJQueryParameterInput,
44741
+ @FieldResolver(() => [MJMCPServerConnectionTool_])
44742
+ async MJ_MCPServerConnectionTools_MCPServerConnectionIDArray(@Root() mjmcpserverconnection_: MJMCPServerConnection_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
44743
+ this.CheckUserReadPermissions('MJ: MCP Server Connection Tools', userPayload);
44744
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44745
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
44746
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPServerConnectionTools] WHERE [MCPServerConnectionID]='${mjmcpserverconnection_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Server Connection Tools', userPayload, EntityPermissionType.Read, 'AND');
44747
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
44748
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: MCP Server Connection Tools', rows, this.GetUserFromPayload(userPayload));
44749
+ return result;
44750
+ }
44751
+
44752
+ @FieldResolver(() => [MJMCPToolExecutionLog_])
44753
+ async MJ_MCPToolExecutionLogs_MCPServerConnectionIDArray(@Root() mjmcpserverconnection_: MJMCPServerConnection_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
44754
+ this.CheckUserReadPermissions('MJ: MCP Tool Execution Logs', userPayload);
44755
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44756
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
44757
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPToolExecutionLogs] WHERE [MCPServerConnectionID]='${mjmcpserverconnection_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Tool Execution Logs', userPayload, EntityPermissionType.Read, 'AND');
44758
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
44759
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: MCP Tool Execution Logs', rows, this.GetUserFromPayload(userPayload));
44760
+ return result;
44761
+ }
44762
+
44763
+ @FieldResolver(() => [MJMCPServerConnectionPermission_])
44764
+ async MJ_MCPServerConnectionPermissions_MCPServerConnectionIDArray(@Root() mjmcpserverconnection_: MJMCPServerConnection_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
44765
+ this.CheckUserReadPermissions('MJ: MCP Server Connection Permissions', userPayload);
44766
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44767
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
44768
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPServerConnectionPermissions] WHERE [MCPServerConnectionID]='${mjmcpserverconnection_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Server Connection Permissions', userPayload, EntityPermissionType.Read, 'AND');
44769
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
44770
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: MCP Server Connection Permissions', rows, this.GetUserFromPayload(userPayload));
44771
+ return result;
44772
+ }
44773
+
44774
+ @Mutation(() => MJMCPServerConnection_)
44775
+ async CreateMJMCPServerConnection(
44776
+ @Arg('input', () => CreateMJMCPServerConnectionInput) input: CreateMJMCPServerConnectionInput,
44680
44777
  @Ctx() { providers, userPayload }: AppContext,
44681
44778
  @PubSub() pubSub: PubSubEngine
44682
44779
  ) {
44683
44780
  const provider = GetReadWriteProvider(providers);
44684
- return this.CreateRecord('MJ: Query Parameters', input, provider, userPayload, pubSub)
44781
+ return this.CreateRecord('MJ: MCP Server Connections', input, provider, userPayload, pubSub)
44685
44782
  }
44686
44783
 
44687
- @Mutation(() => MJQueryParameter_)
44688
- async UpdateMJQueryParameter(
44689
- @Arg('input', () => UpdateMJQueryParameterInput) input: UpdateMJQueryParameterInput,
44784
+ @Mutation(() => MJMCPServerConnection_)
44785
+ async UpdateMJMCPServerConnection(
44786
+ @Arg('input', () => UpdateMJMCPServerConnectionInput) input: UpdateMJMCPServerConnectionInput,
44690
44787
  @Ctx() { providers, userPayload }: AppContext,
44691
44788
  @PubSub() pubSub: PubSubEngine
44692
44789
  ) {
44693
44790
  const provider = GetReadWriteProvider(providers);
44694
- return this.UpdateRecord('MJ: Query Parameters', input, provider, userPayload, pubSub);
44791
+ return this.UpdateRecord('MJ: MCP Server Connections', input, provider, userPayload, pubSub);
44695
44792
  }
44696
44793
 
44697
- @Mutation(() => MJQueryParameter_)
44698
- async DeleteMJQueryParameter(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44794
+ @Mutation(() => MJMCPServerConnection_)
44795
+ async DeleteMJMCPServerConnection(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44699
44796
  const provider = GetReadWriteProvider(providers);
44700
44797
  const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
44701
- return this.DeleteRecord('MJ: Query Parameters', key, options, provider, userPayload, pubSub);
44798
+ return this.DeleteRecord('MJ: MCP Server Connections', key, options, provider, userPayload, pubSub);
44702
44799
  }
44703
44800
 
44704
44801
  }
44705
44802
 
44706
44803
  //****************************************************************************
44707
- // ENTITY CLASS for MJ: Record Links
44804
+ // ENTITY CLASS for MJ: MCP Server Tools
44708
44805
  //****************************************************************************
44709
- @ObjectType({ description: `Generic linking table that can connect any two records in the system, providing a flexible relationship management system.` })
44710
- export class MJRecordLink_ {
44806
+ @ObjectType()
44807
+ export class MJMCPServerTool_ {
44711
44808
  @Field()
44712
44809
  @MaxLength(16)
44713
44810
  ID: string;
44714
44811
 
44715
44812
  @Field()
44716
44813
  @MaxLength(16)
44717
- SourceEntityID: string;
44814
+ MCPServerID: string;
44718
44815
 
44719
- @Field({description: `Primary key value(s) of the source record - scalar for simple PKs or JSON KeyValuePair array for composite PKs`})
44720
- @MaxLength(1000)
44721
- SourceRecordID: string;
44816
+ @Field({description: `Tool identifier from the MCP server`})
44817
+ @MaxLength(510)
44818
+ ToolName: string;
44722
44819
 
44723
- @Field()
44724
- @MaxLength(16)
44725
- TargetEntityID: string;
44820
+ @Field({nullable: true, description: `Human-readable title for the tool`})
44821
+ @MaxLength(510)
44822
+ ToolTitle?: string;
44726
44823
 
44727
- @Field({description: `Primary key value(s) of the target record - scalar for simple PKs or JSON KeyValuePair array for composite PKs`})
44728
- @MaxLength(1000)
44729
- TargetRecordID: string;
44824
+ @Field({nullable: true})
44825
+ ToolDescription?: string;
44730
44826
 
44731
- @Field({nullable: true, description: `Application-specific relationship type describing how the records are related`})
44827
+ @Field({description: `JSON Schema for tool input parameters`})
44828
+ InputSchema: string;
44829
+
44830
+ @Field({nullable: true, description: `JSON Schema for tool output (if provided)`})
44831
+ OutputSchema?: string;
44832
+
44833
+ @Field({nullable: true, description: `JSON with tool hints (readOnlyHint, destructiveHint, etc.)`})
44834
+ Annotations?: string;
44835
+
44836
+ @Field({description: `Tool status: Active, Inactive, or Deprecated`})
44732
44837
  @MaxLength(100)
44733
- LinkType?: string;
44838
+ Status: string;
44734
44839
 
44735
- @Field(() => Int, {nullable: true, description: `Display sequence for ordering linked records in UI`})
44736
- Sequence?: number;
44840
+ @Field()
44841
+ @MaxLength(10)
44842
+ DiscoveredAt: Date;
44737
44843
 
44738
- @Field({nullable: true, description: `JSON field for storing additional link-specific metadata`})
44739
- Metadata?: string;
44844
+ @Field()
44845
+ @MaxLength(10)
44846
+ LastSeenAt: Date;
44847
+
44848
+ @Field({nullable: true, description: `FK to auto-generated Action (if promoted)`})
44849
+ @MaxLength(16)
44850
+ GeneratedActionID?: string;
44851
+
44852
+ @Field({nullable: true})
44853
+ @MaxLength(16)
44854
+ GeneratedActionCategoryID?: string;
44740
44855
 
44741
44856
  @Field()
44742
44857
  @MaxLength(10)
@@ -44748,7 +44863,1536 @@ export class MJRecordLink_ {
44748
44863
 
44749
44864
  @Field()
44750
44865
  @MaxLength(510)
44751
- SourceEntity: string;
44866
+ MCPServer: string;
44867
+
44868
+ @Field({nullable: true})
44869
+ @MaxLength(850)
44870
+ GeneratedAction?: string;
44871
+
44872
+ @Field({nullable: true})
44873
+ @MaxLength(510)
44874
+ GeneratedActionCategory?: string;
44875
+
44876
+ @Field(() => [MJMCPServerConnectionTool_])
44877
+ MJ_MCPServerConnectionTools_MCPServerToolIDArray: MJMCPServerConnectionTool_[]; // Link to MJ_MCPServerConnectionTools
44878
+
44879
+ @Field(() => [MJMCPToolExecutionLog_])
44880
+ MJ_MCPToolExecutionLogs_MCPServerToolIDArray: MJMCPToolExecutionLog_[]; // Link to MJ_MCPToolExecutionLogs
44881
+
44882
+ }
44883
+
44884
+ //****************************************************************************
44885
+ // INPUT TYPE for MJ: MCP Server Tools
44886
+ //****************************************************************************
44887
+ @InputType()
44888
+ export class CreateMJMCPServerToolInput {
44889
+ @Field({ nullable: true })
44890
+ ID?: string;
44891
+
44892
+ @Field({ nullable: true })
44893
+ MCPServerID?: string;
44894
+
44895
+ @Field({ nullable: true })
44896
+ ToolName?: string;
44897
+
44898
+ @Field({ nullable: true })
44899
+ ToolTitle: string | null;
44900
+
44901
+ @Field({ nullable: true })
44902
+ ToolDescription: string | null;
44903
+
44904
+ @Field({ nullable: true })
44905
+ InputSchema?: string;
44906
+
44907
+ @Field({ nullable: true })
44908
+ OutputSchema: string | null;
44909
+
44910
+ @Field({ nullable: true })
44911
+ Annotations: string | null;
44912
+
44913
+ @Field({ nullable: true })
44914
+ Status?: string;
44915
+
44916
+ @Field({ nullable: true })
44917
+ DiscoveredAt?: Date;
44918
+
44919
+ @Field({ nullable: true })
44920
+ LastSeenAt?: Date;
44921
+
44922
+ @Field({ nullable: true })
44923
+ GeneratedActionID: string | null;
44924
+
44925
+ @Field({ nullable: true })
44926
+ GeneratedActionCategoryID: string | null;
44927
+ }
44928
+
44929
+
44930
+ //****************************************************************************
44931
+ // INPUT TYPE for MJ: MCP Server Tools
44932
+ //****************************************************************************
44933
+ @InputType()
44934
+ export class UpdateMJMCPServerToolInput {
44935
+ @Field()
44936
+ ID: string;
44937
+
44938
+ @Field({ nullable: true })
44939
+ MCPServerID?: string;
44940
+
44941
+ @Field({ nullable: true })
44942
+ ToolName?: string;
44943
+
44944
+ @Field({ nullable: true })
44945
+ ToolTitle?: string | null;
44946
+
44947
+ @Field({ nullable: true })
44948
+ ToolDescription?: string | null;
44949
+
44950
+ @Field({ nullable: true })
44951
+ InputSchema?: string;
44952
+
44953
+ @Field({ nullable: true })
44954
+ OutputSchema?: string | null;
44955
+
44956
+ @Field({ nullable: true })
44957
+ Annotations?: string | null;
44958
+
44959
+ @Field({ nullable: true })
44960
+ Status?: string;
44961
+
44962
+ @Field({ nullable: true })
44963
+ DiscoveredAt?: Date;
44964
+
44965
+ @Field({ nullable: true })
44966
+ LastSeenAt?: Date;
44967
+
44968
+ @Field({ nullable: true })
44969
+ GeneratedActionID?: string | null;
44970
+
44971
+ @Field({ nullable: true })
44972
+ GeneratedActionCategoryID?: string | null;
44973
+
44974
+ @Field(() => [KeyValuePairInput], { nullable: true })
44975
+ OldValues___?: KeyValuePairInput[];
44976
+ }
44977
+
44978
+ //****************************************************************************
44979
+ // RESOLVER for MJ: MCP Server Tools
44980
+ //****************************************************************************
44981
+ @ObjectType()
44982
+ export class RunMJMCPServerToolViewResult {
44983
+ @Field(() => [MJMCPServerTool_])
44984
+ Results: MJMCPServerTool_[];
44985
+
44986
+ @Field(() => String, {nullable: true})
44987
+ UserViewRunID?: string;
44988
+
44989
+ @Field(() => Int, {nullable: true})
44990
+ RowCount: number;
44991
+
44992
+ @Field(() => Int, {nullable: true})
44993
+ TotalRowCount: number;
44994
+
44995
+ @Field(() => Int, {nullable: true})
44996
+ ExecutionTime: number;
44997
+
44998
+ @Field({nullable: true})
44999
+ ErrorMessage?: string;
45000
+
45001
+ @Field(() => Boolean, {nullable: false})
45002
+ Success: boolean;
45003
+ }
45004
+
45005
+ @Resolver(MJMCPServerTool_)
45006
+ export class MJMCPServerToolResolver extends ResolverBase {
45007
+ @Query(() => RunMJMCPServerToolViewResult)
45008
+ async RunMJMCPServerToolViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45009
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45010
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
45011
+ }
45012
+
45013
+ @Query(() => RunMJMCPServerToolViewResult)
45014
+ async RunMJMCPServerToolViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45015
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45016
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
45017
+ }
45018
+
45019
+ @Query(() => RunMJMCPServerToolViewResult)
45020
+ async RunMJMCPServerToolDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45021
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45022
+ input.EntityName = 'MJ: MCP Server Tools';
45023
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
45024
+ }
45025
+ @Query(() => MJMCPServerTool_, { nullable: true })
45026
+ async MJMCPServerTool(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJMCPServerTool_ | null> {
45027
+ this.CheckUserReadPermissions('MJ: MCP Server Tools', userPayload);
45028
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45029
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
45030
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPServerTools] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Server Tools', userPayload, EntityPermissionType.Read, 'AND');
45031
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
45032
+ const result = await this.MapFieldNamesToCodeNames('MJ: MCP Server Tools', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
45033
+ return result;
45034
+ }
45035
+
45036
+ @FieldResolver(() => [MJMCPServerConnectionTool_])
45037
+ async MJ_MCPServerConnectionTools_MCPServerToolIDArray(@Root() mjmcpservertool_: MJMCPServerTool_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
45038
+ this.CheckUserReadPermissions('MJ: MCP Server Connection Tools', userPayload);
45039
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45040
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
45041
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPServerConnectionTools] WHERE [MCPServerToolID]='${mjmcpservertool_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Server Connection Tools', userPayload, EntityPermissionType.Read, 'AND');
45042
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
45043
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: MCP Server Connection Tools', rows, this.GetUserFromPayload(userPayload));
45044
+ return result;
45045
+ }
45046
+
45047
+ @FieldResolver(() => [MJMCPToolExecutionLog_])
45048
+ async MJ_MCPToolExecutionLogs_MCPServerToolIDArray(@Root() mjmcpservertool_: MJMCPServerTool_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
45049
+ this.CheckUserReadPermissions('MJ: MCP Tool Execution Logs', userPayload);
45050
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45051
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
45052
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPToolExecutionLogs] WHERE [MCPServerToolID]='${mjmcpservertool_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Tool Execution Logs', userPayload, EntityPermissionType.Read, 'AND');
45053
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
45054
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: MCP Tool Execution Logs', rows, this.GetUserFromPayload(userPayload));
45055
+ return result;
45056
+ }
45057
+
45058
+ @Mutation(() => MJMCPServerTool_)
45059
+ async CreateMJMCPServerTool(
45060
+ @Arg('input', () => CreateMJMCPServerToolInput) input: CreateMJMCPServerToolInput,
45061
+ @Ctx() { providers, userPayload }: AppContext,
45062
+ @PubSub() pubSub: PubSubEngine
45063
+ ) {
45064
+ const provider = GetReadWriteProvider(providers);
45065
+ return this.CreateRecord('MJ: MCP Server Tools', input, provider, userPayload, pubSub)
45066
+ }
45067
+
45068
+ @Mutation(() => MJMCPServerTool_)
45069
+ async UpdateMJMCPServerTool(
45070
+ @Arg('input', () => UpdateMJMCPServerToolInput) input: UpdateMJMCPServerToolInput,
45071
+ @Ctx() { providers, userPayload }: AppContext,
45072
+ @PubSub() pubSub: PubSubEngine
45073
+ ) {
45074
+ const provider = GetReadWriteProvider(providers);
45075
+ return this.UpdateRecord('MJ: MCP Server Tools', input, provider, userPayload, pubSub);
45076
+ }
45077
+
45078
+ @Mutation(() => MJMCPServerTool_)
45079
+ async DeleteMJMCPServerTool(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45080
+ const provider = GetReadWriteProvider(providers);
45081
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
45082
+ return this.DeleteRecord('MJ: MCP Server Tools', key, options, provider, userPayload, pubSub);
45083
+ }
45084
+
45085
+ }
45086
+
45087
+ //****************************************************************************
45088
+ // ENTITY CLASS for MJ: MCP Servers
45089
+ //****************************************************************************
45090
+ @ObjectType()
45091
+ export class MJMCPServer_ {
45092
+ @Field()
45093
+ @MaxLength(16)
45094
+ ID: string;
45095
+
45096
+ @Field({description: `Unique display name for the MCP server`})
45097
+ @MaxLength(510)
45098
+ Name: string;
45099
+
45100
+ @Field({nullable: true})
45101
+ Description?: string;
45102
+
45103
+ @Field({nullable: true, description: `Server endpoint URL for HTTP/SSE/WebSocket transports`})
45104
+ @MaxLength(2000)
45105
+ ServerURL?: string;
45106
+
45107
+ @Field({nullable: true, description: `Executable path for Stdio transport`})
45108
+ @MaxLength(1000)
45109
+ Command?: string;
45110
+
45111
+ @Field({nullable: true, description: `JSON array of command arguments for Stdio transport`})
45112
+ CommandArgs?: string;
45113
+
45114
+ @Field({description: `Transport type: StreamableHTTP, SSE, Stdio, or WebSocket`})
45115
+ @MaxLength(100)
45116
+ TransportType: string;
45117
+
45118
+ @Field({description: `Default auth type: None, Bearer, APIKey, OAuth2, Basic, or Custom`})
45119
+ @MaxLength(100)
45120
+ DefaultAuthType: string;
45121
+
45122
+ @Field({nullable: true, description: `Expected credential type for this server`})
45123
+ @MaxLength(16)
45124
+ CredentialTypeID?: string;
45125
+
45126
+ @Field({description: `Server status: Active, Inactive, or Deprecated`})
45127
+ @MaxLength(100)
45128
+ Status: string;
45129
+
45130
+ @Field({nullable: true})
45131
+ @MaxLength(10)
45132
+ LastSyncAt?: Date;
45133
+
45134
+ @Field(() => Int, {nullable: true})
45135
+ RateLimitPerMinute?: number;
45136
+
45137
+ @Field(() => Int, {nullable: true})
45138
+ RateLimitPerHour?: number;
45139
+
45140
+ @Field(() => Int, {nullable: true})
45141
+ ConnectionTimeoutMs?: number;
45142
+
45143
+ @Field(() => Int, {nullable: true})
45144
+ RequestTimeoutMs?: number;
45145
+
45146
+ @Field({nullable: true})
45147
+ @MaxLength(2000)
45148
+ DocumentationURL?: string;
45149
+
45150
+ @Field({nullable: true})
45151
+ @MaxLength(200)
45152
+ IconClass?: string;
45153
+
45154
+ @Field()
45155
+ @MaxLength(10)
45156
+ _mj__CreatedAt: Date;
45157
+
45158
+ @Field()
45159
+ @MaxLength(10)
45160
+ _mj__UpdatedAt: Date;
45161
+
45162
+ @Field({nullable: true})
45163
+ @MaxLength(200)
45164
+ CredentialType?: string;
45165
+
45166
+ @Field(() => [MJMCPServerConnection_])
45167
+ MJ_MCPServerConnections_MCPServerIDArray: MJMCPServerConnection_[]; // Link to MJ_MCPServerConnections
45168
+
45169
+ @Field(() => [MJMCPServerTool_])
45170
+ MJ_MCPServerTools_MCPServerIDArray: MJMCPServerTool_[]; // Link to MJ_MCPServerTools
45171
+
45172
+ }
45173
+
45174
+ //****************************************************************************
45175
+ // INPUT TYPE for MJ: MCP Servers
45176
+ //****************************************************************************
45177
+ @InputType()
45178
+ export class CreateMJMCPServerInput {
45179
+ @Field({ nullable: true })
45180
+ ID?: string;
45181
+
45182
+ @Field({ nullable: true })
45183
+ Name?: string;
45184
+
45185
+ @Field({ nullable: true })
45186
+ Description: string | null;
45187
+
45188
+ @Field({ nullable: true })
45189
+ ServerURL: string | null;
45190
+
45191
+ @Field({ nullable: true })
45192
+ Command: string | null;
45193
+
45194
+ @Field({ nullable: true })
45195
+ CommandArgs: string | null;
45196
+
45197
+ @Field({ nullable: true })
45198
+ TransportType?: string;
45199
+
45200
+ @Field({ nullable: true })
45201
+ DefaultAuthType?: string;
45202
+
45203
+ @Field({ nullable: true })
45204
+ CredentialTypeID: string | null;
45205
+
45206
+ @Field({ nullable: true })
45207
+ Status?: string;
45208
+
45209
+ @Field({ nullable: true })
45210
+ LastSyncAt: Date | null;
45211
+
45212
+ @Field(() => Int, { nullable: true })
45213
+ RateLimitPerMinute: number | null;
45214
+
45215
+ @Field(() => Int, { nullable: true })
45216
+ RateLimitPerHour: number | null;
45217
+
45218
+ @Field(() => Int, { nullable: true })
45219
+ ConnectionTimeoutMs?: number | null;
45220
+
45221
+ @Field(() => Int, { nullable: true })
45222
+ RequestTimeoutMs?: number | null;
45223
+
45224
+ @Field({ nullable: true })
45225
+ DocumentationURL: string | null;
45226
+
45227
+ @Field({ nullable: true })
45228
+ IconClass: string | null;
45229
+ }
45230
+
45231
+
45232
+ //****************************************************************************
45233
+ // INPUT TYPE for MJ: MCP Servers
45234
+ //****************************************************************************
45235
+ @InputType()
45236
+ export class UpdateMJMCPServerInput {
45237
+ @Field()
45238
+ ID: string;
45239
+
45240
+ @Field({ nullable: true })
45241
+ Name?: string;
45242
+
45243
+ @Field({ nullable: true })
45244
+ Description?: string | null;
45245
+
45246
+ @Field({ nullable: true })
45247
+ ServerURL?: string | null;
45248
+
45249
+ @Field({ nullable: true })
45250
+ Command?: string | null;
45251
+
45252
+ @Field({ nullable: true })
45253
+ CommandArgs?: string | null;
45254
+
45255
+ @Field({ nullable: true })
45256
+ TransportType?: string;
45257
+
45258
+ @Field({ nullable: true })
45259
+ DefaultAuthType?: string;
45260
+
45261
+ @Field({ nullable: true })
45262
+ CredentialTypeID?: string | null;
45263
+
45264
+ @Field({ nullable: true })
45265
+ Status?: string;
45266
+
45267
+ @Field({ nullable: true })
45268
+ LastSyncAt?: Date | null;
45269
+
45270
+ @Field(() => Int, { nullable: true })
45271
+ RateLimitPerMinute?: number | null;
45272
+
45273
+ @Field(() => Int, { nullable: true })
45274
+ RateLimitPerHour?: number | null;
45275
+
45276
+ @Field(() => Int, { nullable: true })
45277
+ ConnectionTimeoutMs?: number | null;
45278
+
45279
+ @Field(() => Int, { nullable: true })
45280
+ RequestTimeoutMs?: number | null;
45281
+
45282
+ @Field({ nullable: true })
45283
+ DocumentationURL?: string | null;
45284
+
45285
+ @Field({ nullable: true })
45286
+ IconClass?: string | null;
45287
+
45288
+ @Field(() => [KeyValuePairInput], { nullable: true })
45289
+ OldValues___?: KeyValuePairInput[];
45290
+ }
45291
+
45292
+ //****************************************************************************
45293
+ // RESOLVER for MJ: MCP Servers
45294
+ //****************************************************************************
45295
+ @ObjectType()
45296
+ export class RunMJMCPServerViewResult {
45297
+ @Field(() => [MJMCPServer_])
45298
+ Results: MJMCPServer_[];
45299
+
45300
+ @Field(() => String, {nullable: true})
45301
+ UserViewRunID?: string;
45302
+
45303
+ @Field(() => Int, {nullable: true})
45304
+ RowCount: number;
45305
+
45306
+ @Field(() => Int, {nullable: true})
45307
+ TotalRowCount: number;
45308
+
45309
+ @Field(() => Int, {nullable: true})
45310
+ ExecutionTime: number;
45311
+
45312
+ @Field({nullable: true})
45313
+ ErrorMessage?: string;
45314
+
45315
+ @Field(() => Boolean, {nullable: false})
45316
+ Success: boolean;
45317
+ }
45318
+
45319
+ @Resolver(MJMCPServer_)
45320
+ export class MJMCPServerResolver extends ResolverBase {
45321
+ @Query(() => RunMJMCPServerViewResult)
45322
+ async RunMJMCPServerViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45323
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45324
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
45325
+ }
45326
+
45327
+ @Query(() => RunMJMCPServerViewResult)
45328
+ async RunMJMCPServerViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45329
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45330
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
45331
+ }
45332
+
45333
+ @Query(() => RunMJMCPServerViewResult)
45334
+ async RunMJMCPServerDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45335
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45336
+ input.EntityName = 'MJ: MCP Servers';
45337
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
45338
+ }
45339
+ @Query(() => MJMCPServer_, { nullable: true })
45340
+ async MJMCPServer(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJMCPServer_ | null> {
45341
+ this.CheckUserReadPermissions('MJ: MCP Servers', userPayload);
45342
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45343
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
45344
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPServers] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Servers', userPayload, EntityPermissionType.Read, 'AND');
45345
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
45346
+ const result = await this.MapFieldNamesToCodeNames('MJ: MCP Servers', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
45347
+ return result;
45348
+ }
45349
+
45350
+ @FieldResolver(() => [MJMCPServerConnection_])
45351
+ async MJ_MCPServerConnections_MCPServerIDArray(@Root() mjmcpserver_: MJMCPServer_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
45352
+ this.CheckUserReadPermissions('MJ: MCP Server Connections', userPayload);
45353
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45354
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
45355
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPServerConnections] WHERE [MCPServerID]='${mjmcpserver_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Server Connections', userPayload, EntityPermissionType.Read, 'AND');
45356
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
45357
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: MCP Server Connections', rows, this.GetUserFromPayload(userPayload));
45358
+ return result;
45359
+ }
45360
+
45361
+ @FieldResolver(() => [MJMCPServerTool_])
45362
+ async MJ_MCPServerTools_MCPServerIDArray(@Root() mjmcpserver_: MJMCPServer_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
45363
+ this.CheckUserReadPermissions('MJ: MCP Server Tools', userPayload);
45364
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45365
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
45366
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPServerTools] WHERE [MCPServerID]='${mjmcpserver_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Server Tools', userPayload, EntityPermissionType.Read, 'AND');
45367
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
45368
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: MCP Server Tools', rows, this.GetUserFromPayload(userPayload));
45369
+ return result;
45370
+ }
45371
+
45372
+ @Mutation(() => MJMCPServer_)
45373
+ async CreateMJMCPServer(
45374
+ @Arg('input', () => CreateMJMCPServerInput) input: CreateMJMCPServerInput,
45375
+ @Ctx() { providers, userPayload }: AppContext,
45376
+ @PubSub() pubSub: PubSubEngine
45377
+ ) {
45378
+ const provider = GetReadWriteProvider(providers);
45379
+ return this.CreateRecord('MJ: MCP Servers', input, provider, userPayload, pubSub)
45380
+ }
45381
+
45382
+ @Mutation(() => MJMCPServer_)
45383
+ async UpdateMJMCPServer(
45384
+ @Arg('input', () => UpdateMJMCPServerInput) input: UpdateMJMCPServerInput,
45385
+ @Ctx() { providers, userPayload }: AppContext,
45386
+ @PubSub() pubSub: PubSubEngine
45387
+ ) {
45388
+ const provider = GetReadWriteProvider(providers);
45389
+ return this.UpdateRecord('MJ: MCP Servers', input, provider, userPayload, pubSub);
45390
+ }
45391
+
45392
+ @Mutation(() => MJMCPServer_)
45393
+ async DeleteMJMCPServer(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45394
+ const provider = GetReadWriteProvider(providers);
45395
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
45396
+ return this.DeleteRecord('MJ: MCP Servers', key, options, provider, userPayload, pubSub);
45397
+ }
45398
+
45399
+ }
45400
+
45401
+ //****************************************************************************
45402
+ // ENTITY CLASS for MJ: MCP Tool Execution Logs
45403
+ //****************************************************************************
45404
+ @ObjectType()
45405
+ export class MJMCPToolExecutionLog_ {
45406
+ @Field()
45407
+ @MaxLength(16)
45408
+ ID: string;
45409
+
45410
+ @Field()
45411
+ @MaxLength(16)
45412
+ MCPServerConnectionID: string;
45413
+
45414
+ @Field({nullable: true, description: `FK to MCP Server Tool (null if tool not cached)`})
45415
+ @MaxLength(16)
45416
+ MCPServerToolID?: string;
45417
+
45418
+ @Field({description: `Tool name (stored directly for resilience)`})
45419
+ @MaxLength(510)
45420
+ ToolName: string;
45421
+
45422
+ @Field({description: `FK to User who initiated the call`})
45423
+ @MaxLength(16)
45424
+ UserID: string;
45425
+
45426
+ @Field()
45427
+ @MaxLength(10)
45428
+ StartedAt: Date;
45429
+
45430
+ @Field({nullable: true})
45431
+ @MaxLength(10)
45432
+ EndedAt?: Date;
45433
+
45434
+ @Field(() => Int, {nullable: true, description: `Execution duration in milliseconds`})
45435
+ DurationMs?: number;
45436
+
45437
+ @Field(() => Boolean)
45438
+ Success: boolean;
45439
+
45440
+ @Field({nullable: true})
45441
+ ErrorMessage?: string;
45442
+
45443
+ @Field({nullable: true, description: `JSON of input parameters (if logging enabled)`})
45444
+ InputParameters?: string;
45445
+
45446
+ @Field({nullable: true, description: `JSON of output content (if logging enabled)`})
45447
+ OutputContent?: string;
45448
+
45449
+ @Field(() => Boolean, {description: `Whether output was truncated due to size`})
45450
+ OutputTruncated: boolean;
45451
+
45452
+ @Field()
45453
+ @MaxLength(10)
45454
+ _mj__CreatedAt: Date;
45455
+
45456
+ @Field()
45457
+ @MaxLength(10)
45458
+ _mj__UpdatedAt: Date;
45459
+
45460
+ @Field()
45461
+ @MaxLength(510)
45462
+ MCPServerConnection: string;
45463
+
45464
+ @Field({nullable: true})
45465
+ @MaxLength(510)
45466
+ MCPServerTool?: string;
45467
+
45468
+ @Field()
45469
+ @MaxLength(200)
45470
+ User: string;
45471
+
45472
+ }
45473
+
45474
+ //****************************************************************************
45475
+ // INPUT TYPE for MJ: MCP Tool Execution Logs
45476
+ //****************************************************************************
45477
+ @InputType()
45478
+ export class CreateMJMCPToolExecutionLogInput {
45479
+ @Field({ nullable: true })
45480
+ ID?: string;
45481
+
45482
+ @Field({ nullable: true })
45483
+ MCPServerConnectionID?: string;
45484
+
45485
+ @Field({ nullable: true })
45486
+ MCPServerToolID: string | null;
45487
+
45488
+ @Field({ nullable: true })
45489
+ ToolName?: string;
45490
+
45491
+ @Field({ nullable: true })
45492
+ UserID?: string;
45493
+
45494
+ @Field({ nullable: true })
45495
+ StartedAt?: Date;
45496
+
45497
+ @Field({ nullable: true })
45498
+ EndedAt: Date | null;
45499
+
45500
+ @Field(() => Int, { nullable: true })
45501
+ DurationMs: number | null;
45502
+
45503
+ @Field(() => Boolean, { nullable: true })
45504
+ Success?: boolean;
45505
+
45506
+ @Field({ nullable: true })
45507
+ ErrorMessage: string | null;
45508
+
45509
+ @Field({ nullable: true })
45510
+ InputParameters: string | null;
45511
+
45512
+ @Field({ nullable: true })
45513
+ OutputContent: string | null;
45514
+
45515
+ @Field(() => Boolean, { nullable: true })
45516
+ OutputTruncated?: boolean;
45517
+ }
45518
+
45519
+
45520
+ //****************************************************************************
45521
+ // INPUT TYPE for MJ: MCP Tool Execution Logs
45522
+ //****************************************************************************
45523
+ @InputType()
45524
+ export class UpdateMJMCPToolExecutionLogInput {
45525
+ @Field()
45526
+ ID: string;
45527
+
45528
+ @Field({ nullable: true })
45529
+ MCPServerConnectionID?: string;
45530
+
45531
+ @Field({ nullable: true })
45532
+ MCPServerToolID?: string | null;
45533
+
45534
+ @Field({ nullable: true })
45535
+ ToolName?: string;
45536
+
45537
+ @Field({ nullable: true })
45538
+ UserID?: string;
45539
+
45540
+ @Field({ nullable: true })
45541
+ StartedAt?: Date;
45542
+
45543
+ @Field({ nullable: true })
45544
+ EndedAt?: Date | null;
45545
+
45546
+ @Field(() => Int, { nullable: true })
45547
+ DurationMs?: number | null;
45548
+
45549
+ @Field(() => Boolean, { nullable: true })
45550
+ Success?: boolean;
45551
+
45552
+ @Field({ nullable: true })
45553
+ ErrorMessage?: string | null;
45554
+
45555
+ @Field({ nullable: true })
45556
+ InputParameters?: string | null;
45557
+
45558
+ @Field({ nullable: true })
45559
+ OutputContent?: string | null;
45560
+
45561
+ @Field(() => Boolean, { nullable: true })
45562
+ OutputTruncated?: boolean;
45563
+
45564
+ @Field(() => [KeyValuePairInput], { nullable: true })
45565
+ OldValues___?: KeyValuePairInput[];
45566
+ }
45567
+
45568
+ //****************************************************************************
45569
+ // RESOLVER for MJ: MCP Tool Execution Logs
45570
+ //****************************************************************************
45571
+ @ObjectType()
45572
+ export class RunMJMCPToolExecutionLogViewResult {
45573
+ @Field(() => [MJMCPToolExecutionLog_])
45574
+ Results: MJMCPToolExecutionLog_[];
45575
+
45576
+ @Field(() => String, {nullable: true})
45577
+ UserViewRunID?: string;
45578
+
45579
+ @Field(() => Int, {nullable: true})
45580
+ RowCount: number;
45581
+
45582
+ @Field(() => Int, {nullable: true})
45583
+ TotalRowCount: number;
45584
+
45585
+ @Field(() => Int, {nullable: true})
45586
+ ExecutionTime: number;
45587
+
45588
+ @Field({nullable: true})
45589
+ ErrorMessage?: string;
45590
+
45591
+ @Field(() => Boolean, {nullable: false})
45592
+ Success: boolean;
45593
+ }
45594
+
45595
+ @Resolver(MJMCPToolExecutionLog_)
45596
+ export class MJMCPToolExecutionLogResolver extends ResolverBase {
45597
+ @Query(() => RunMJMCPToolExecutionLogViewResult)
45598
+ async RunMJMCPToolExecutionLogViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45599
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45600
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
45601
+ }
45602
+
45603
+ @Query(() => RunMJMCPToolExecutionLogViewResult)
45604
+ async RunMJMCPToolExecutionLogViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45605
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45606
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
45607
+ }
45608
+
45609
+ @Query(() => RunMJMCPToolExecutionLogViewResult)
45610
+ async RunMJMCPToolExecutionLogDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45611
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45612
+ input.EntityName = 'MJ: MCP Tool Execution Logs';
45613
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
45614
+ }
45615
+ @Query(() => MJMCPToolExecutionLog_, { nullable: true })
45616
+ async MJMCPToolExecutionLog(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJMCPToolExecutionLog_ | null> {
45617
+ this.CheckUserReadPermissions('MJ: MCP Tool Execution Logs', userPayload);
45618
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45619
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
45620
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPToolExecutionLogs] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Tool Execution Logs', userPayload, EntityPermissionType.Read, 'AND');
45621
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
45622
+ const result = await this.MapFieldNamesToCodeNames('MJ: MCP Tool Execution Logs', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
45623
+ return result;
45624
+ }
45625
+
45626
+ @Mutation(() => MJMCPToolExecutionLog_)
45627
+ async CreateMJMCPToolExecutionLog(
45628
+ @Arg('input', () => CreateMJMCPToolExecutionLogInput) input: CreateMJMCPToolExecutionLogInput,
45629
+ @Ctx() { providers, userPayload }: AppContext,
45630
+ @PubSub() pubSub: PubSubEngine
45631
+ ) {
45632
+ const provider = GetReadWriteProvider(providers);
45633
+ return this.CreateRecord('MJ: MCP Tool Execution Logs', input, provider, userPayload, pubSub)
45634
+ }
45635
+
45636
+ @Mutation(() => MJMCPToolExecutionLog_)
45637
+ async UpdateMJMCPToolExecutionLog(
45638
+ @Arg('input', () => UpdateMJMCPToolExecutionLogInput) input: UpdateMJMCPToolExecutionLogInput,
45639
+ @Ctx() { providers, userPayload }: AppContext,
45640
+ @PubSub() pubSub: PubSubEngine
45641
+ ) {
45642
+ const provider = GetReadWriteProvider(providers);
45643
+ return this.UpdateRecord('MJ: MCP Tool Execution Logs', input, provider, userPayload, pubSub);
45644
+ }
45645
+
45646
+ @Mutation(() => MJMCPToolExecutionLog_)
45647
+ async DeleteMJMCPToolExecutionLog(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45648
+ const provider = GetReadWriteProvider(providers);
45649
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
45650
+ return this.DeleteRecord('MJ: MCP Tool Execution Logs', key, options, provider, userPayload, pubSub);
45651
+ }
45652
+
45653
+ }
45654
+
45655
+ //****************************************************************************
45656
+ // ENTITY CLASS for MJ: Projects
45657
+ //****************************************************************************
45658
+ @ObjectType({ description: `Container for grouping related conversations around a common topic, client, or initiative. Supports nesting for sub-projects.` })
45659
+ export class MJProject_ {
45660
+ @Field()
45661
+ @MaxLength(16)
45662
+ ID: string;
45663
+
45664
+ @Field()
45665
+ @MaxLength(16)
45666
+ EnvironmentID: string;
45667
+
45668
+ @Field({nullable: true})
45669
+ @MaxLength(16)
45670
+ ParentID?: string;
45671
+
45672
+ @Field({description: `Display name for the project`})
45673
+ @MaxLength(510)
45674
+ Name: string;
45675
+
45676
+ @Field({nullable: true, description: `Detailed description of the project goals and scope`})
45677
+ Description?: string;
45678
+
45679
+ @Field({nullable: true, description: `Hex color code for project badges in UI (#RRGGBB format)`})
45680
+ @MaxLength(14)
45681
+ Color?: string;
45682
+
45683
+ @Field({nullable: true, description: `Font Awesome icon class for UI display`})
45684
+ @MaxLength(100)
45685
+ Icon?: string;
45686
+
45687
+ @Field(() => Boolean, {description: `Indicates if this project is archived and should be hidden from active lists`})
45688
+ IsArchived: boolean;
45689
+
45690
+ @Field()
45691
+ @MaxLength(10)
45692
+ _mj__CreatedAt: Date;
45693
+
45694
+ @Field()
45695
+ @MaxLength(10)
45696
+ _mj__UpdatedAt: Date;
45697
+
45698
+ @Field()
45699
+ @MaxLength(510)
45700
+ Environment: string;
45701
+
45702
+ @Field({nullable: true})
45703
+ @MaxLength(510)
45704
+ Parent?: string;
45705
+
45706
+ @Field({nullable: true})
45707
+ @MaxLength(16)
45708
+ RootParentID?: string;
45709
+
45710
+ @Field(() => [MJProject_])
45711
+ MJ_Projects_ParentIDArray: MJProject_[]; // Link to MJ_Projects
45712
+
45713
+ @Field(() => [MJConversation_])
45714
+ Conversations_ProjectIDArray: MJConversation_[]; // Link to Conversations
45715
+
45716
+ @Field(() => [MJTask_])
45717
+ MJ_Tasks_ProjectIDArray: MJTask_[]; // Link to MJ_Tasks
45718
+
45719
+ }
45720
+
45721
+ //****************************************************************************
45722
+ // INPUT TYPE for MJ: Projects
45723
+ //****************************************************************************
45724
+ @InputType()
45725
+ export class CreateMJProjectInput {
45726
+ @Field({ nullable: true })
45727
+ ID?: string;
45728
+
45729
+ @Field({ nullable: true })
45730
+ EnvironmentID?: string;
45731
+
45732
+ @Field({ nullable: true })
45733
+ ParentID: string | null;
45734
+
45735
+ @Field({ nullable: true })
45736
+ Name?: string;
45737
+
45738
+ @Field({ nullable: true })
45739
+ Description: string | null;
45740
+
45741
+ @Field({ nullable: true })
45742
+ Color: string | null;
45743
+
45744
+ @Field({ nullable: true })
45745
+ Icon: string | null;
45746
+
45747
+ @Field(() => Boolean, { nullable: true })
45748
+ IsArchived?: boolean;
45749
+ }
45750
+
45751
+
45752
+ //****************************************************************************
45753
+ // INPUT TYPE for MJ: Projects
45754
+ //****************************************************************************
45755
+ @InputType()
45756
+ export class UpdateMJProjectInput {
45757
+ @Field()
45758
+ ID: string;
45759
+
45760
+ @Field({ nullable: true })
45761
+ EnvironmentID?: string;
45762
+
45763
+ @Field({ nullable: true })
45764
+ ParentID?: string | null;
45765
+
45766
+ @Field({ nullable: true })
45767
+ Name?: string;
45768
+
45769
+ @Field({ nullable: true })
45770
+ Description?: string | null;
45771
+
45772
+ @Field({ nullable: true })
45773
+ Color?: string | null;
45774
+
45775
+ @Field({ nullable: true })
45776
+ Icon?: string | null;
45777
+
45778
+ @Field(() => Boolean, { nullable: true })
45779
+ IsArchived?: boolean;
45780
+
45781
+ @Field(() => [KeyValuePairInput], { nullable: true })
45782
+ OldValues___?: KeyValuePairInput[];
45783
+ }
45784
+
45785
+ //****************************************************************************
45786
+ // RESOLVER for MJ: Projects
45787
+ //****************************************************************************
45788
+ @ObjectType()
45789
+ export class RunMJProjectViewResult {
45790
+ @Field(() => [MJProject_])
45791
+ Results: MJProject_[];
45792
+
45793
+ @Field(() => String, {nullable: true})
45794
+ UserViewRunID?: string;
45795
+
45796
+ @Field(() => Int, {nullable: true})
45797
+ RowCount: number;
45798
+
45799
+ @Field(() => Int, {nullable: true})
45800
+ TotalRowCount: number;
45801
+
45802
+ @Field(() => Int, {nullable: true})
45803
+ ExecutionTime: number;
45804
+
45805
+ @Field({nullable: true})
45806
+ ErrorMessage?: string;
45807
+
45808
+ @Field(() => Boolean, {nullable: false})
45809
+ Success: boolean;
45810
+ }
45811
+
45812
+ @Resolver(MJProject_)
45813
+ export class MJProjectResolver extends ResolverBase {
45814
+ @Query(() => RunMJProjectViewResult)
45815
+ async RunMJProjectViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45816
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45817
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
45818
+ }
45819
+
45820
+ @Query(() => RunMJProjectViewResult)
45821
+ async RunMJProjectViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45822
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45823
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
45824
+ }
45825
+
45826
+ @Query(() => RunMJProjectViewResult)
45827
+ async RunMJProjectDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45828
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45829
+ input.EntityName = 'MJ: Projects';
45830
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
45831
+ }
45832
+ @Query(() => MJProject_, { nullable: true })
45833
+ async MJProject(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJProject_ | null> {
45834
+ this.CheckUserReadPermissions('MJ: Projects', userPayload);
45835
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45836
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
45837
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwProjects] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Projects', userPayload, EntityPermissionType.Read, 'AND');
45838
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
45839
+ const result = await this.MapFieldNamesToCodeNames('MJ: Projects', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
45840
+ return result;
45841
+ }
45842
+
45843
+ @FieldResolver(() => [MJProject_])
45844
+ async MJ_Projects_ParentIDArray(@Root() mjproject_: MJProject_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
45845
+ this.CheckUserReadPermissions('MJ: Projects', userPayload);
45846
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45847
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
45848
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwProjects] WHERE [ParentID]='${mjproject_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Projects', userPayload, EntityPermissionType.Read, 'AND');
45849
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
45850
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Projects', rows, this.GetUserFromPayload(userPayload));
45851
+ return result;
45852
+ }
45853
+
45854
+ @FieldResolver(() => [MJConversation_])
45855
+ async Conversations_ProjectIDArray(@Root() mjproject_: MJProject_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
45856
+ this.CheckUserReadPermissions('Conversations', userPayload);
45857
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45858
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
45859
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwConversations] WHERE [ProjectID]='${mjproject_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'Conversations', userPayload, EntityPermissionType.Read, 'AND');
45860
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
45861
+ const result = await this.ArrayMapFieldNamesToCodeNames('Conversations', rows, this.GetUserFromPayload(userPayload));
45862
+ return result;
45863
+ }
45864
+
45865
+ @FieldResolver(() => [MJTask_])
45866
+ async MJ_Tasks_ProjectIDArray(@Root() mjproject_: MJProject_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
45867
+ this.CheckUserReadPermissions('MJ: Tasks', userPayload);
45868
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45869
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
45870
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwTasks] WHERE [ProjectID]='${mjproject_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Tasks', userPayload, EntityPermissionType.Read, 'AND');
45871
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
45872
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Tasks', rows, this.GetUserFromPayload(userPayload));
45873
+ return result;
45874
+ }
45875
+
45876
+ @Mutation(() => MJProject_)
45877
+ async CreateMJProject(
45878
+ @Arg('input', () => CreateMJProjectInput) input: CreateMJProjectInput,
45879
+ @Ctx() { providers, userPayload }: AppContext,
45880
+ @PubSub() pubSub: PubSubEngine
45881
+ ) {
45882
+ const provider = GetReadWriteProvider(providers);
45883
+ return this.CreateRecord('MJ: Projects', input, provider, userPayload, pubSub)
45884
+ }
45885
+
45886
+ @Mutation(() => MJProject_)
45887
+ async UpdateMJProject(
45888
+ @Arg('input', () => UpdateMJProjectInput) input: UpdateMJProjectInput,
45889
+ @Ctx() { providers, userPayload }: AppContext,
45890
+ @PubSub() pubSub: PubSubEngine
45891
+ ) {
45892
+ const provider = GetReadWriteProvider(providers);
45893
+ return this.UpdateRecord('MJ: Projects', input, provider, userPayload, pubSub);
45894
+ }
45895
+
45896
+ @Mutation(() => MJProject_)
45897
+ async DeleteMJProject(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45898
+ const provider = GetReadWriteProvider(providers);
45899
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
45900
+ return this.DeleteRecord('MJ: Projects', key, options, provider, userPayload, pubSub);
45901
+ }
45902
+
45903
+ }
45904
+
45905
+ //****************************************************************************
45906
+ // ENTITY CLASS for MJ: Public Links
45907
+ //****************************************************************************
45908
+ @ObjectType({ description: `Shareable links for external access to artifacts and other resources. Supports password protection and expiration.` })
45909
+ export class MJPublicLink_ {
45910
+ @Field()
45911
+ @MaxLength(16)
45912
+ ID: string;
45913
+
45914
+ @Field({description: `Type of resource being shared (Artifact, Conversation, Collection)`})
45915
+ @MaxLength(100)
45916
+ ResourceType: string;
45917
+
45918
+ @Field()
45919
+ @MaxLength(16)
45920
+ ResourceID: string;
45921
+
45922
+ @Field({description: `Unique token for accessing the shared resource via URL`})
45923
+ @MaxLength(510)
45924
+ Token: string;
45925
+
45926
+ @Field({nullable: true, description: `SHA256 hash of optional password for additional security`})
45927
+ @MaxLength(510)
45928
+ PasswordHash?: string;
45929
+
45930
+ @Field({nullable: true, description: `Optional expiration date/time for this public link`})
45931
+ @MaxLength(10)
45932
+ ExpiresAt?: Date;
45933
+
45934
+ @Field(() => Int, {nullable: true, description: `Maximum number of times this link can be viewed`})
45935
+ MaxViews?: number;
45936
+
45937
+ @Field(() => Int, {description: `Current count of how many times this link has been viewed`})
45938
+ CurrentViews: number;
45939
+
45940
+ @Field()
45941
+ @MaxLength(16)
45942
+ UserID: string;
45943
+
45944
+ @Field(() => Boolean, {description: `Indicates if this link is currently active and accessible`})
45945
+ IsActive: boolean;
45946
+
45947
+ @Field()
45948
+ @MaxLength(10)
45949
+ _mj__CreatedAt: Date;
45950
+
45951
+ @Field()
45952
+ @MaxLength(10)
45953
+ _mj__UpdatedAt: Date;
45954
+
45955
+ @Field()
45956
+ @MaxLength(200)
45957
+ User: string;
45958
+
45959
+ }
45960
+
45961
+ //****************************************************************************
45962
+ // INPUT TYPE for MJ: Public Links
45963
+ //****************************************************************************
45964
+ @InputType()
45965
+ export class CreateMJPublicLinkInput {
45966
+ @Field({ nullable: true })
45967
+ ID?: string;
45968
+
45969
+ @Field({ nullable: true })
45970
+ ResourceType?: string;
45971
+
45972
+ @Field({ nullable: true })
45973
+ ResourceID?: string;
45974
+
45975
+ @Field({ nullable: true })
45976
+ Token?: string;
45977
+
45978
+ @Field({ nullable: true })
45979
+ PasswordHash: string | null;
45980
+
45981
+ @Field({ nullable: true })
45982
+ ExpiresAt: Date | null;
45983
+
45984
+ @Field(() => Int, { nullable: true })
45985
+ MaxViews: number | null;
45986
+
45987
+ @Field(() => Int, { nullable: true })
45988
+ CurrentViews?: number;
45989
+
45990
+ @Field({ nullable: true })
45991
+ UserID?: string;
45992
+
45993
+ @Field(() => Boolean, { nullable: true })
45994
+ IsActive?: boolean;
45995
+ }
45996
+
45997
+
45998
+ //****************************************************************************
45999
+ // INPUT TYPE for MJ: Public Links
46000
+ //****************************************************************************
46001
+ @InputType()
46002
+ export class UpdateMJPublicLinkInput {
46003
+ @Field()
46004
+ ID: string;
46005
+
46006
+ @Field({ nullable: true })
46007
+ ResourceType?: string;
46008
+
46009
+ @Field({ nullable: true })
46010
+ ResourceID?: string;
46011
+
46012
+ @Field({ nullable: true })
46013
+ Token?: string;
46014
+
46015
+ @Field({ nullable: true })
46016
+ PasswordHash?: string | null;
46017
+
46018
+ @Field({ nullable: true })
46019
+ ExpiresAt?: Date | null;
46020
+
46021
+ @Field(() => Int, { nullable: true })
46022
+ MaxViews?: number | null;
46023
+
46024
+ @Field(() => Int, { nullable: true })
46025
+ CurrentViews?: number;
46026
+
46027
+ @Field({ nullable: true })
46028
+ UserID?: string;
46029
+
46030
+ @Field(() => Boolean, { nullable: true })
46031
+ IsActive?: boolean;
46032
+
46033
+ @Field(() => [KeyValuePairInput], { nullable: true })
46034
+ OldValues___?: KeyValuePairInput[];
46035
+ }
46036
+
46037
+ //****************************************************************************
46038
+ // RESOLVER for MJ: Public Links
46039
+ //****************************************************************************
46040
+ @ObjectType()
46041
+ export class RunMJPublicLinkViewResult {
46042
+ @Field(() => [MJPublicLink_])
46043
+ Results: MJPublicLink_[];
46044
+
46045
+ @Field(() => String, {nullable: true})
46046
+ UserViewRunID?: string;
46047
+
46048
+ @Field(() => Int, {nullable: true})
46049
+ RowCount: number;
46050
+
46051
+ @Field(() => Int, {nullable: true})
46052
+ TotalRowCount: number;
46053
+
46054
+ @Field(() => Int, {nullable: true})
46055
+ ExecutionTime: number;
46056
+
46057
+ @Field({nullable: true})
46058
+ ErrorMessage?: string;
46059
+
46060
+ @Field(() => Boolean, {nullable: false})
46061
+ Success: boolean;
46062
+ }
46063
+
46064
+ @Resolver(MJPublicLink_)
46065
+ export class MJPublicLinkResolver extends ResolverBase {
46066
+ @Query(() => RunMJPublicLinkViewResult)
46067
+ async RunMJPublicLinkViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
46068
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
46069
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
46070
+ }
46071
+
46072
+ @Query(() => RunMJPublicLinkViewResult)
46073
+ async RunMJPublicLinkViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
46074
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
46075
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
46076
+ }
46077
+
46078
+ @Query(() => RunMJPublicLinkViewResult)
46079
+ async RunMJPublicLinkDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
46080
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
46081
+ input.EntityName = 'MJ: Public Links';
46082
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
46083
+ }
46084
+ @Query(() => MJPublicLink_, { nullable: true })
46085
+ async MJPublicLink(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJPublicLink_ | null> {
46086
+ this.CheckUserReadPermissions('MJ: Public Links', userPayload);
46087
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
46088
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
46089
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwPublicLinks] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Public Links', userPayload, EntityPermissionType.Read, 'AND');
46090
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
46091
+ const result = await this.MapFieldNamesToCodeNames('MJ: Public Links', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
46092
+ return result;
46093
+ }
46094
+
46095
+ @Mutation(() => MJPublicLink_)
46096
+ async CreateMJPublicLink(
46097
+ @Arg('input', () => CreateMJPublicLinkInput) input: CreateMJPublicLinkInput,
46098
+ @Ctx() { providers, userPayload }: AppContext,
46099
+ @PubSub() pubSub: PubSubEngine
46100
+ ) {
46101
+ const provider = GetReadWriteProvider(providers);
46102
+ return this.CreateRecord('MJ: Public Links', input, provider, userPayload, pubSub)
46103
+ }
46104
+
46105
+ @Mutation(() => MJPublicLink_)
46106
+ async UpdateMJPublicLink(
46107
+ @Arg('input', () => UpdateMJPublicLinkInput) input: UpdateMJPublicLinkInput,
46108
+ @Ctx() { providers, userPayload }: AppContext,
46109
+ @PubSub() pubSub: PubSubEngine
46110
+ ) {
46111
+ const provider = GetReadWriteProvider(providers);
46112
+ return this.UpdateRecord('MJ: Public Links', input, provider, userPayload, pubSub);
46113
+ }
46114
+
46115
+ @Mutation(() => MJPublicLink_)
46116
+ async DeleteMJPublicLink(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
46117
+ const provider = GetReadWriteProvider(providers);
46118
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
46119
+ return this.DeleteRecord('MJ: Public Links', key, options, provider, userPayload, pubSub);
46120
+ }
46121
+
46122
+ }
46123
+
46124
+ //****************************************************************************
46125
+ // ENTITY CLASS for MJ: Query Parameters
46126
+ //****************************************************************************
46127
+ @ObjectType({ description: `Stores parameter definitions for parameterized queries that use Nunjucks templates. Each parameter represents a dynamic value that can be passed when executing the query. Parameters are automatically extracted from the query template by the QueryEntityServer using LLM analysis, or can be manually defined. The combination of parameter metadata and validation filters creates a self-documenting, type-safe query execution system.` })
46128
+ export class MJQueryParameter_ {
46129
+ @Field()
46130
+ @MaxLength(16)
46131
+ ID: string;
46132
+
46133
+ @Field()
46134
+ @MaxLength(16)
46135
+ QueryID: string;
46136
+
46137
+ @Field({description: `The name of the parameter as it appears in the Nunjucks template. This must match exactly with the parameter reference in the SQL template. For example, if the template contains {{ userEmail | required | email }}, the Name would be "userEmail". Parameter names should follow JavaScript identifier rules: start with a letter, and contain only letters, numbers, and underscores.`})
46138
+ @MaxLength(510)
46139
+ Name: string;
46140
+
46141
+ @Field({description: `The data type of the parameter used for validation and type conversion. Valid values are: "string" for text values, "number" for integers or decimals, "date" for date/datetime values (ISO 8601 format expected), "boolean" for true/false values, and "array" for multiple values (typically used with IN clauses). The type determines which validation filters can be applied and how the parameter is processed.`})
46142
+ @MaxLength(100)
46143
+ Type: string;
46144
+
46145
+ @Field(() => Boolean, {nullable: true, description: `Indicates whether this parameter must be provided when executing the query. When true, the query execution will fail if the parameter is not supplied and no DefaultValue is set. This is automatically determined by the presence of the "required" filter in the template, but can be manually overridden. Required parameters ensure data integrity and prevent unintended query behavior.`})
46146
+ IsRequired?: boolean;
46147
+
46148
+ @Field({nullable: true, description: `The default value to use when the parameter is not provided during query execution. This value must be compatible with the parameter Type. For arrays, use JSON format like ["value1","value2"]. Default values allow queries to have sensible fallbacks while still accepting custom inputs. If a parameter is required (IsRequired=true), the default value is ignored.`})
46149
+ DefaultValue?: string;
46150
+
46151
+ @Field({nullable: true, description: `Human-readable description explaining the purpose and usage of this parameter. This is typically generated by LLM analysis of the query context but can be manually edited. Good descriptions include: what the parameter filters or controls, valid value ranges or formats, business meaning, and any special considerations. This text is shown in UI to help users understand what value to provide.`})
46152
+ Description?: string;
46153
+
46154
+ @Field({nullable: true, description: `A concrete example value demonstrating the proper format for this parameter. Generated by LLM based on the query context and validation filters. For example: "john@example.com" for an email parameter, "2024-01-15" for a date, or "["active","pending"]" for a status array. Sample values help users understand the expected format and can be used in API documentation.`})
46155
+ SampleValue?: string;
46156
+
46157
+ @Field({nullable: true, description: `JSON array of Nunjucks filter definitions that validate and transform the parameter value. Each filter is an object with "name" and optional "args" properties. Filters are applied in order and can include: validation (required, email, min, max), transformation (trim, upper, lower), SQL safety (sqlsafe, sqljoin), and type conversion (number, date). Example: [{"name":"required"},{"name":"email"},{"name":"sqlsafe"}]. The filter chain ensures type safety and prevents SQL injection.`})
46158
+ ValidationFilters?: string;
46159
+
46160
+ @Field({description: `Indicates how this parameter was identified and added to the system. "AI" means it was automatically detected by LLM analysis of the query template, including extraction of parameter name, type inference from filters, and generation of description. "Manual" means it was explicitly defined by a user. This helps track which parameters might need human review and provides transparency about the source of metadata.`})
46161
+ @MaxLength(100)
46162
+ DetectionMethod: string;
46163
+
46164
+ @Field(() => Float, {nullable: true, description: `Confidence score (0.00-1.00) indicating how certain the AI was about this parameter detection. Only populated when DetectionMethod="AI". Higher scores indicate the LLM was more confident about the parameter name, type, and usage. Scores above 0.80 are generally reliable, 0.60-0.80 may benefit from human review, and below 0.60 should be manually verified. This helps prioritize which auto-detected parameters need human attention.`})
46165
+ AutoDetectConfidenceScore?: number;
46166
+
46167
+ @Field()
46168
+ @MaxLength(10)
46169
+ _mj__CreatedAt: Date;
46170
+
46171
+ @Field()
46172
+ @MaxLength(10)
46173
+ _mj__UpdatedAt: Date;
46174
+
46175
+ @Field()
46176
+ @MaxLength(510)
46177
+ Query: string;
46178
+
46179
+ }
46180
+
46181
+ //****************************************************************************
46182
+ // INPUT TYPE for MJ: Query Parameters
46183
+ //****************************************************************************
46184
+ @InputType()
46185
+ export class CreateMJQueryParameterInput {
46186
+ @Field({ nullable: true })
46187
+ ID?: string;
46188
+
46189
+ @Field({ nullable: true })
46190
+ QueryID?: string;
46191
+
46192
+ @Field({ nullable: true })
46193
+ Name?: string;
46194
+
46195
+ @Field({ nullable: true })
46196
+ Type?: string;
46197
+
46198
+ @Field(() => Boolean, { nullable: true })
46199
+ IsRequired?: boolean | null;
46200
+
46201
+ @Field({ nullable: true })
46202
+ DefaultValue: string | null;
46203
+
46204
+ @Field({ nullable: true })
46205
+ Description: string | null;
46206
+
46207
+ @Field({ nullable: true })
46208
+ SampleValue: string | null;
46209
+
46210
+ @Field({ nullable: true })
46211
+ ValidationFilters: string | null;
46212
+
46213
+ @Field({ nullable: true })
46214
+ DetectionMethod?: string;
46215
+
46216
+ @Field(() => Float, { nullable: true })
46217
+ AutoDetectConfidenceScore: number | null;
46218
+ }
46219
+
46220
+
46221
+ //****************************************************************************
46222
+ // INPUT TYPE for MJ: Query Parameters
46223
+ //****************************************************************************
46224
+ @InputType()
46225
+ export class UpdateMJQueryParameterInput {
46226
+ @Field()
46227
+ ID: string;
46228
+
46229
+ @Field({ nullable: true })
46230
+ QueryID?: string;
46231
+
46232
+ @Field({ nullable: true })
46233
+ Name?: string;
46234
+
46235
+ @Field({ nullable: true })
46236
+ Type?: string;
46237
+
46238
+ @Field(() => Boolean, { nullable: true })
46239
+ IsRequired?: boolean | null;
46240
+
46241
+ @Field({ nullable: true })
46242
+ DefaultValue?: string | null;
46243
+
46244
+ @Field({ nullable: true })
46245
+ Description?: string | null;
46246
+
46247
+ @Field({ nullable: true })
46248
+ SampleValue?: string | null;
46249
+
46250
+ @Field({ nullable: true })
46251
+ ValidationFilters?: string | null;
46252
+
46253
+ @Field({ nullable: true })
46254
+ DetectionMethod?: string;
46255
+
46256
+ @Field(() => Float, { nullable: true })
46257
+ AutoDetectConfidenceScore?: number | null;
46258
+
46259
+ @Field(() => [KeyValuePairInput], { nullable: true })
46260
+ OldValues___?: KeyValuePairInput[];
46261
+ }
46262
+
46263
+ //****************************************************************************
46264
+ // RESOLVER for MJ: Query Parameters
46265
+ //****************************************************************************
46266
+ @ObjectType()
46267
+ export class RunMJQueryParameterViewResult {
46268
+ @Field(() => [MJQueryParameter_])
46269
+ Results: MJQueryParameter_[];
46270
+
46271
+ @Field(() => String, {nullable: true})
46272
+ UserViewRunID?: string;
46273
+
46274
+ @Field(() => Int, {nullable: true})
46275
+ RowCount: number;
46276
+
46277
+ @Field(() => Int, {nullable: true})
46278
+ TotalRowCount: number;
46279
+
46280
+ @Field(() => Int, {nullable: true})
46281
+ ExecutionTime: number;
46282
+
46283
+ @Field({nullable: true})
46284
+ ErrorMessage?: string;
46285
+
46286
+ @Field(() => Boolean, {nullable: false})
46287
+ Success: boolean;
46288
+ }
46289
+
46290
+ @Resolver(MJQueryParameter_)
46291
+ export class MJQueryParameterResolver extends ResolverBase {
46292
+ @Query(() => RunMJQueryParameterViewResult)
46293
+ async RunMJQueryParameterViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
46294
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
46295
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
46296
+ }
46297
+
46298
+ @Query(() => RunMJQueryParameterViewResult)
46299
+ async RunMJQueryParameterViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
46300
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
46301
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
46302
+ }
46303
+
46304
+ @Query(() => RunMJQueryParameterViewResult)
46305
+ async RunMJQueryParameterDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
46306
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
46307
+ input.EntityName = 'MJ: Query Parameters';
46308
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
46309
+ }
46310
+ @Query(() => MJQueryParameter_, { nullable: true })
46311
+ async MJQueryParameter(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJQueryParameter_ | null> {
46312
+ this.CheckUserReadPermissions('MJ: Query Parameters', userPayload);
46313
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
46314
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
46315
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwQueryParameters] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Query Parameters', userPayload, EntityPermissionType.Read, 'AND');
46316
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
46317
+ const result = await this.MapFieldNamesToCodeNames('MJ: Query Parameters', rows && rows.length > 0 ? rows[0] : {}, this.GetUserFromPayload(userPayload));
46318
+ return result;
46319
+ }
46320
+
46321
+ @Mutation(() => MJQueryParameter_)
46322
+ async CreateMJQueryParameter(
46323
+ @Arg('input', () => CreateMJQueryParameterInput) input: CreateMJQueryParameterInput,
46324
+ @Ctx() { providers, userPayload }: AppContext,
46325
+ @PubSub() pubSub: PubSubEngine
46326
+ ) {
46327
+ const provider = GetReadWriteProvider(providers);
46328
+ return this.CreateRecord('MJ: Query Parameters', input, provider, userPayload, pubSub)
46329
+ }
46330
+
46331
+ @Mutation(() => MJQueryParameter_)
46332
+ async UpdateMJQueryParameter(
46333
+ @Arg('input', () => UpdateMJQueryParameterInput) input: UpdateMJQueryParameterInput,
46334
+ @Ctx() { providers, userPayload }: AppContext,
46335
+ @PubSub() pubSub: PubSubEngine
46336
+ ) {
46337
+ const provider = GetReadWriteProvider(providers);
46338
+ return this.UpdateRecord('MJ: Query Parameters', input, provider, userPayload, pubSub);
46339
+ }
46340
+
46341
+ @Mutation(() => MJQueryParameter_)
46342
+ async DeleteMJQueryParameter(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
46343
+ const provider = GetReadWriteProvider(providers);
46344
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
46345
+ return this.DeleteRecord('MJ: Query Parameters', key, options, provider, userPayload, pubSub);
46346
+ }
46347
+
46348
+ }
46349
+
46350
+ //****************************************************************************
46351
+ // ENTITY CLASS for MJ: Record Links
46352
+ //****************************************************************************
46353
+ @ObjectType({ description: `Generic linking table that can connect any two records in the system, providing a flexible relationship management system.` })
46354
+ export class MJRecordLink_ {
46355
+ @Field()
46356
+ @MaxLength(16)
46357
+ ID: string;
46358
+
46359
+ @Field()
46360
+ @MaxLength(16)
46361
+ SourceEntityID: string;
46362
+
46363
+ @Field({description: `Primary key value(s) of the source record - scalar for simple PKs or JSON KeyValuePair array for composite PKs`})
46364
+ @MaxLength(1000)
46365
+ SourceRecordID: string;
46366
+
46367
+ @Field()
46368
+ @MaxLength(16)
46369
+ TargetEntityID: string;
46370
+
46371
+ @Field({description: `Primary key value(s) of the target record - scalar for simple PKs or JSON KeyValuePair array for composite PKs`})
46372
+ @MaxLength(1000)
46373
+ TargetRecordID: string;
46374
+
46375
+ @Field({nullable: true, description: `Application-specific relationship type describing how the records are related`})
46376
+ @MaxLength(100)
46377
+ LinkType?: string;
46378
+
46379
+ @Field(() => Int, {nullable: true, description: `Display sequence for ordering linked records in UI`})
46380
+ Sequence?: number;
46381
+
46382
+ @Field({nullable: true, description: `JSON field for storing additional link-specific metadata`})
46383
+ Metadata?: string;
46384
+
46385
+ @Field()
46386
+ @MaxLength(10)
46387
+ _mj__CreatedAt: Date;
46388
+
46389
+ @Field()
46390
+ @MaxLength(10)
46391
+ _mj__UpdatedAt: Date;
46392
+
46393
+ @Field()
46394
+ @MaxLength(510)
46395
+ SourceEntity: string;
44752
46396
 
44753
46397
  @Field()
44754
46398
  @MaxLength(510)
@@ -55121,6 +56765,9 @@ export class MJRole_ {
55121
56765
  @Field(() => [MJResourcePermission_])
55122
56766
  ResourcePermissions_RoleIDArray: MJResourcePermission_[]; // Link to ResourcePermissions
55123
56767
 
56768
+ @Field(() => [MJMCPServerConnectionPermission_])
56769
+ MJ_MCPServerConnectionPermissions_RoleIDArray: MJMCPServerConnectionPermission_[]; // Link to MJ_MCPServerConnectionPermissions
56770
+
55124
56771
  @Field(() => [MJAIAgentPermission_])
55125
56772
  MJ_AIAgentPermissions_RoleIDArray: MJAIAgentPermission_[]; // Link to MJ_AIAgentPermissions
55126
56773
 
@@ -55307,6 +56954,17 @@ export class MJRoleResolver extends ResolverBase {
55307
56954
  return result;
55308
56955
  }
55309
56956
 
56957
+ @FieldResolver(() => [MJMCPServerConnectionPermission_])
56958
+ async MJ_MCPServerConnectionPermissions_RoleIDArray(@Root() mjrole_: MJRole_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
56959
+ this.CheckUserReadPermissions('MJ: MCP Server Connection Permissions', userPayload);
56960
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
56961
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
56962
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPServerConnectionPermissions] WHERE [RoleID]='${mjrole_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Server Connection Permissions', userPayload, EntityPermissionType.Read, 'AND');
56963
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
56964
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: MCP Server Connection Permissions', rows, this.GetUserFromPayload(userPayload));
56965
+ return result;
56966
+ }
56967
+
55310
56968
  @FieldResolver(() => [MJAIAgentPermission_])
55311
56969
  async MJ_AIAgentPermissions_RoleIDArray(@Root() mjrole_: MJRole_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
55312
56970
  this.CheckUserReadPermissions('MJ: AI Agent Permissions', userPayload);
@@ -60198,6 +61856,9 @@ export class MJUser_ {
60198
61856
  @Field(() => [MJUserNotificationPreference_])
60199
61857
  MJ_UserNotificationPreferences_UserIDArray: MJUserNotificationPreference_[]; // Link to MJ_UserNotificationPreferences
60200
61858
 
61859
+ @Field(() => [MJMCPToolExecutionLog_])
61860
+ MJ_MCPToolExecutionLogs_UserIDArray: MJMCPToolExecutionLog_[]; // Link to MJ_MCPToolExecutionLogs
61861
+
60201
61862
  @Field(() => [MJResourcePermission_])
60202
61863
  ResourcePermissions_UserIDArray: MJResourcePermission_[]; // Link to ResourcePermissions
60203
61864
 
@@ -60234,6 +61895,9 @@ export class MJUser_ {
60234
61895
  @Field(() => [MJAPIKey_])
60235
61896
  MJ_APIKeys_CreatedByUserIDArray: MJAPIKey_[]; // Link to MJ_APIKeys
60236
61897
 
61898
+ @Field(() => [MJMCPServerConnectionPermission_])
61899
+ MJ_MCPServerConnectionPermissions_UserIDArray: MJMCPServerConnectionPermission_[]; // Link to MJ_MCPServerConnectionPermissions
61900
+
60237
61901
  @Field(() => [MJAIAgentRun_])
60238
61902
  MJ_AIAgentRuns_UserIDArray: MJAIAgentRun_[]; // Link to MJ_AIAgentRuns
60239
61903
 
@@ -61031,6 +62695,17 @@ export class MJUserResolverBase extends ResolverBase {
61031
62695
  return result;
61032
62696
  }
61033
62697
 
62698
+ @FieldResolver(() => [MJMCPToolExecutionLog_])
62699
+ async MJ_MCPToolExecutionLogs_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
62700
+ this.CheckUserReadPermissions('MJ: MCP Tool Execution Logs', userPayload);
62701
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
62702
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
62703
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPToolExecutionLogs] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Tool Execution Logs', userPayload, EntityPermissionType.Read, 'AND');
62704
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
62705
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: MCP Tool Execution Logs', rows, this.GetUserFromPayload(userPayload));
62706
+ return result;
62707
+ }
62708
+
61034
62709
  @FieldResolver(() => [MJResourcePermission_])
61035
62710
  async ResourcePermissions_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
61036
62711
  this.CheckUserReadPermissions('Resource Permissions', userPayload);
@@ -61163,6 +62838,17 @@ export class MJUserResolverBase extends ResolverBase {
61163
62838
  return result;
61164
62839
  }
61165
62840
 
62841
+ @FieldResolver(() => [MJMCPServerConnectionPermission_])
62842
+ async MJ_MCPServerConnectionPermissions_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
62843
+ this.CheckUserReadPermissions('MJ: MCP Server Connection Permissions', userPayload);
62844
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
62845
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
62846
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwMCPServerConnectionPermissions] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Server Connection Permissions', userPayload, EntityPermissionType.Read, 'AND');
62847
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
62848
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: MCP Server Connection Permissions', rows, this.GetUserFromPayload(userPayload));
62849
+ return result;
62850
+ }
62851
+
61166
62852
  @FieldResolver(() => [MJAIAgentRun_])
61167
62853
  async MJ_AIAgentRuns_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
61168
62854
  this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);