@memberjunction/server 2.17.0 → 2.18.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.
@@ -18,7 +18,7 @@ import { mj_core_schema } from '../config.js';
18
18
 
19
19
 
20
20
 
21
- import { ScheduledActionEntity, ScheduledActionParamEntity, ExplorerNavigationItemEntity, AIAgentModelEntity, AIAgentNoteTypeEntity, AIAgentEntity, AIAgentNoteEntity, AIAgentActionEntity, AIPromptEntity, AIResultCacheEntity, AIPromptCategoryEntity, AIPromptTypeEntity, CompanyEntity, EmployeeEntity, UserFavoriteEntity, EmployeeCompanyIntegrationEntity, EmployeeRoleEntity, EmployeeSkillEntity, RoleEntity, SkillEntity, IntegrationURLFormatEntity, IntegrationEntity, CompanyIntegrationEntity, EntityFieldEntity, EntityEntity, UserEntity, EntityRelationshipEntity, UserRecordLogEntity, UserViewEntity, CompanyIntegrationRunEntity, CompanyIntegrationRunDetailEntity, ErrorLogEntity, ApplicationEntity, ApplicationEntityEntity, EntityPermissionEntity, UserApplicationEntityEntity, UserApplicationEntity, CompanyIntegrationRunAPILogEntity, ListEntity, ListDetailEntity, UserViewRunEntity, UserViewRunDetailEntity, WorkflowRunEntity, WorkflowEntity, WorkflowEngineEntity, RecordChangeEntity, UserRoleEntity, RowLevelSecurityFilterEntity, AuditLogEntity, AuthorizationEntity, AuthorizationRoleEntity, AuditLogTypeEntity, EntityFieldValueEntity, AIModelEntity, AIActionEntity, AIModelActionEntity, EntityAIActionEntity, AIModelTypeEntity, QueueTypeEntity, QueueEntity, QueueTaskEntity, DashboardEntity, OutputTriggerTypeEntity, OutputFormatTypeEntity, OutputDeliveryTypeEntity, ReportEntity, ReportSnapshotEntity, ResourceTypeEntity, TagEntity, TaggedItemEntity, WorkspaceEntity, WorkspaceItemEntity, DatasetEntity, DatasetItemEntity, ConversationDetailEntity, ConversationEntity, UserNotificationEntity, SchemaInfoEntity, CompanyIntegrationRecordMapEntity, RecordMergeLogEntity, RecordMergeDeletionLogEntity, QueryFieldEntity, QueryCategoryEntity, QueryEntity, QueryPermissionEntity, VectorIndexEntity, EntityDocumentTypeEntity, EntityDocumentRunEntity, VectorDatabaseEntity, EntityRecordDocumentEntity, EntityDocumentEntity, DataContextItemEntity, DataContextEntity, UserViewCategoryEntity, DashboardCategoryEntity, ReportCategoryEntity, FileStorageProviderEntity, FileEntity, FileCategoryEntity, FileEntityRecordLinkEntity, VersionInstallationEntity, DuplicateRunDetailMatchEntity, EntityDocumentSettingEntity, EntitySettingEntity, DuplicateRunEntity, DuplicateRunDetailEntity, ApplicationSettingEntity, ActionCategoryEntity, EntityActionEntity, EntityActionInvocationEntity, ActionAuthorizationEntity, EntityActionInvocationTypeEntity, ActionEntity, EntityActionFilterEntity, ActionFilterEntity, ActionContextTypeEntity, ActionResultCodeEntity, ActionContextEntity, ActionExecutionLogEntity, ActionParamEntity, ActionLibraryEntity, LibraryEntity, ListCategoryEntity, CommunicationProviderEntity, CommunicationRunEntity, CommunicationProviderMessageTypeEntity, CommunicationLogEntity, CommunicationBaseMessageTypeEntity, TemplateEntity, TemplateCategoryEntity, TemplateContentEntity, TemplateParamEntity, TemplateContentTypeEntity, RecommendationEntity, RecommendationProviderEntity, RecommendationRunEntity, RecommendationItemEntity, EntityCommunicationMessageTypeEntity, EntityCommunicationFieldEntity, RecordChangeReplayRunEntity, LibraryItemEntity, EntityRelationshipDisplayComponentEntity, EntityActionParamEntity, ResourcePermissionEntity, ResourceLinkEntity, flyway_schema_historyEntity, QueryEntityEntity, ContentProcessRunEntity, ContentSourceEntity, ContentSourceParamEntity, ContentSourceTypeEntity, ContentSourceTypeParamEntity, ContentTypeEntity, ContentTypeAttributeEntity, ContentFileTypeEntity, ContentItemEntity, ContentItemAttributeEntity, ContentItemTagEntity, AIAgentLearningCycleEntity } from '@memberjunction/core-entities';
21
+ import { ScheduledActionEntity, ScheduledActionParamEntity, ExplorerNavigationItemEntity, AIAgentModelEntity, AIAgentNoteTypeEntity, AIAgentEntity, AIAgentNoteEntity, AIAgentActionEntity, AIPromptEntity, AIResultCacheEntity, AIPromptCategoryEntity, AIPromptTypeEntity, CompanyEntity, EmployeeEntity, UserFavoriteEntity, EmployeeCompanyIntegrationEntity, EmployeeRoleEntity, EmployeeSkillEntity, RoleEntity, SkillEntity, IntegrationURLFormatEntity, IntegrationEntity, CompanyIntegrationEntity, EntityFieldEntity, EntityEntity, UserEntity, EntityRelationshipEntity, UserRecordLogEntity, UserViewEntity, CompanyIntegrationRunEntity, CompanyIntegrationRunDetailEntity, ErrorLogEntity, ApplicationEntity, ApplicationEntityEntity, EntityPermissionEntity, UserApplicationEntityEntity, UserApplicationEntity, CompanyIntegrationRunAPILogEntity, ListEntity, ListDetailEntity, UserViewRunEntity, UserViewRunDetailEntity, WorkflowRunEntity, WorkflowEntity, WorkflowEngineEntity, RecordChangeEntity, UserRoleEntity, RowLevelSecurityFilterEntity, AuditLogEntity, AuthorizationEntity, AuthorizationRoleEntity, AuditLogTypeEntity, EntityFieldValueEntity, AIModelEntity, AIActionEntity, AIModelActionEntity, EntityAIActionEntity, AIModelTypeEntity, QueueTypeEntity, QueueEntity, QueueTaskEntity, DashboardEntity, OutputTriggerTypeEntity, OutputFormatTypeEntity, OutputDeliveryTypeEntity, ReportEntity, ReportSnapshotEntity, ResourceTypeEntity, TagEntity, TaggedItemEntity, WorkspaceEntity, WorkspaceItemEntity, DatasetEntity, DatasetItemEntity, ConversationDetailEntity, ConversationEntity, UserNotificationEntity, SchemaInfoEntity, CompanyIntegrationRecordMapEntity, RecordMergeLogEntity, RecordMergeDeletionLogEntity, QueryFieldEntity, QueryCategoryEntity, QueryEntity, QueryPermissionEntity, VectorIndexEntity, EntityDocumentTypeEntity, EntityDocumentRunEntity, VectorDatabaseEntity, EntityRecordDocumentEntity, EntityDocumentEntity, DataContextItemEntity, DataContextEntity, UserViewCategoryEntity, DashboardCategoryEntity, ReportCategoryEntity, FileStorageProviderEntity, FileEntity, FileCategoryEntity, FileEntityRecordLinkEntity, VersionInstallationEntity, DuplicateRunDetailMatchEntity, EntityDocumentSettingEntity, EntitySettingEntity, DuplicateRunEntity, DuplicateRunDetailEntity, ApplicationSettingEntity, ActionCategoryEntity, EntityActionEntity, EntityActionInvocationEntity, ActionAuthorizationEntity, EntityActionInvocationTypeEntity, ActionEntity, EntityActionFilterEntity, ActionFilterEntity, ActionContextTypeEntity, ActionResultCodeEntity, ActionContextEntity, ActionExecutionLogEntity, ActionParamEntity, ActionLibraryEntity, LibraryEntity, ListCategoryEntity, CommunicationProviderEntity, CommunicationRunEntity, CommunicationProviderMessageTypeEntity, CommunicationLogEntity, CommunicationBaseMessageTypeEntity, TemplateEntity, TemplateCategoryEntity, TemplateContentEntity, TemplateParamEntity, TemplateContentTypeEntity, RecommendationEntity, RecommendationProviderEntity, RecommendationRunEntity, RecommendationItemEntity, EntityCommunicationMessageTypeEntity, EntityCommunicationFieldEntity, RecordChangeReplayRunEntity, LibraryItemEntity, EntityRelationshipDisplayComponentEntity, EntityActionParamEntity, ResourcePermissionEntity, ResourceLinkEntity, flyway_schema_historyEntity, AIAgentRequestEntity, QueryEntityEntity, ContentProcessRunEntity, ContentSourceEntity, ContentSourceParamEntity, ContentSourceTypeEntity, ContentSourceTypeParamEntity, ContentTypeEntity, ContentTypeAttributeEntity, ContentFileTypeEntity, ContentItemEntity, ContentItemAttributeEntity, ContentItemTagEntity, AIAgentLearningCycleEntity } from '@memberjunction/core-entities';
22
22
 
23
23
 
24
24
  //****************************************************************************
@@ -656,7 +656,7 @@ export class ExplorerNavigationItemResolver extends ResolverBase {
656
656
  }
657
657
 
658
658
  //****************************************************************************
659
- // ENTITY CLASS for AIAgent Models
659
+ // ENTITY CLASS for AI Agent Models
660
660
  //****************************************************************************
661
661
  @ObjectType({ description: 'Table to store the relationship between AI agents and AI models.' })
662
662
  export class AIAgentModel_ {
@@ -697,7 +697,7 @@ export class AIAgentModel_ {
697
697
  }
698
698
 
699
699
  //****************************************************************************
700
- // INPUT TYPE for AIAgent Models
700
+ // INPUT TYPE for AI Agent Models
701
701
  //****************************************************************************
702
702
  @InputType()
703
703
  export class CreateAIAgentModelInput {
@@ -716,7 +716,7 @@ export class CreateAIAgentModelInput {
716
716
 
717
717
 
718
718
  //****************************************************************************
719
- // INPUT TYPE for AIAgent Models
719
+ // INPUT TYPE for AI Agent Models
720
720
  //****************************************************************************
721
721
  @InputType()
722
722
  export class UpdateAIAgentModelInput {
@@ -740,7 +740,7 @@ export class UpdateAIAgentModelInput {
740
740
  }
741
741
 
742
742
  //****************************************************************************
743
- // RESOLVER for AIAgent Models
743
+ // RESOLVER for AI Agent Models
744
744
  //****************************************************************************
745
745
  @ObjectType()
746
746
  export class RunAIAgentModelViewResult {
@@ -780,14 +780,14 @@ export class AIAgentModelResolver extends ResolverBase {
780
780
 
781
781
  @Query(() => RunAIAgentModelViewResult)
782
782
  async RunAIAgentModelDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
783
- input.EntityName = 'AIAgent Models';
783
+ input.EntityName = 'AI Agent Models';
784
784
  return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
785
785
  }
786
786
  @Query(() => AIAgentModel_, { nullable: true })
787
787
  async AIAgentModel(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<AIAgentModel_ | null> {
788
- this.CheckUserReadPermissions('AIAgent Models', userPayload);
789
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentModels] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('AIAgent Models', userPayload, EntityPermissionType.Read, 'AND');
790
- const result = this.MapFieldNamesToCodeNames('AIAgent Models', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
788
+ this.CheckUserReadPermissions('AI Agent Models', userPayload);
789
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentModels] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('AI Agent Models', userPayload, EntityPermissionType.Read, 'AND');
790
+ const result = this.MapFieldNamesToCodeNames('AI Agent Models', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
791
791
  return result;
792
792
  }
793
793
 
@@ -797,7 +797,7 @@ export class AIAgentModelResolver extends ResolverBase {
797
797
  @Ctx() { dataSource, userPayload }: AppContext,
798
798
  @PubSub() pubSub: PubSubEngine
799
799
  ) {
800
- return this.CreateRecord('AIAgent Models', input, dataSource, userPayload, pubSub)
800
+ return this.CreateRecord('AI Agent Models', input, dataSource, userPayload, pubSub)
801
801
  }
802
802
 
803
803
  @Mutation(() => AIAgentModel_)
@@ -806,19 +806,19 @@ export class AIAgentModelResolver extends ResolverBase {
806
806
  @Ctx() { dataSource, userPayload }: AppContext,
807
807
  @PubSub() pubSub: PubSubEngine
808
808
  ) {
809
- return this.UpdateRecord('AIAgent Models', input, dataSource, userPayload, pubSub);
809
+ return this.UpdateRecord('AI Agent Models', input, dataSource, userPayload, pubSub);
810
810
  }
811
811
 
812
812
  @Mutation(() => AIAgentModel_)
813
813
  async DeleteAIAgentModel(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
814
814
  const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
815
- return this.DeleteRecord('AIAgent Models', key, options, dataSource, userPayload, pubSub);
815
+ return this.DeleteRecord('AI Agent Models', key, options, dataSource, userPayload, pubSub);
816
816
  }
817
817
 
818
818
  }
819
819
 
820
820
  //****************************************************************************
821
- // ENTITY CLASS for AIAgent Note Types
821
+ // ENTITY CLASS for AI Agent Note Types
822
822
  //****************************************************************************
823
823
  @ObjectType()
824
824
  export class AIAgentNoteType_ {
@@ -847,7 +847,7 @@ export class AIAgentNoteType_ {
847
847
  }
848
848
 
849
849
  //****************************************************************************
850
- // INPUT TYPE for AIAgent Note Types
850
+ // INPUT TYPE for AI Agent Note Types
851
851
  //****************************************************************************
852
852
  @InputType()
853
853
  export class CreateAIAgentNoteTypeInput {
@@ -860,7 +860,7 @@ export class CreateAIAgentNoteTypeInput {
860
860
 
861
861
 
862
862
  //****************************************************************************
863
- // INPUT TYPE for AIAgent Note Types
863
+ // INPUT TYPE for AI Agent Note Types
864
864
  //****************************************************************************
865
865
  @InputType()
866
866
  export class UpdateAIAgentNoteTypeInput {
@@ -878,7 +878,7 @@ export class UpdateAIAgentNoteTypeInput {
878
878
  }
879
879
 
880
880
  //****************************************************************************
881
- // RESOLVER for AIAgent Note Types
881
+ // RESOLVER for AI Agent Note Types
882
882
  //****************************************************************************
883
883
  @ObjectType()
884
884
  export class RunAIAgentNoteTypeViewResult {
@@ -918,22 +918,22 @@ export class AIAgentNoteTypeResolver extends ResolverBase {
918
918
 
919
919
  @Query(() => RunAIAgentNoteTypeViewResult)
920
920
  async RunAIAgentNoteTypeDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
921
- input.EntityName = 'AIAgent Note Types';
921
+ input.EntityName = 'AI Agent Note Types';
922
922
  return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
923
923
  }
924
924
  @Query(() => AIAgentNoteType_, { nullable: true })
925
925
  async AIAgentNoteType(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<AIAgentNoteType_ | null> {
926
- this.CheckUserReadPermissions('AIAgent Note Types', userPayload);
927
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentNoteTypes] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('AIAgent Note Types', userPayload, EntityPermissionType.Read, 'AND');
928
- const result = this.MapFieldNamesToCodeNames('AIAgent Note Types', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
926
+ this.CheckUserReadPermissions('AI Agent Note Types', userPayload);
927
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentNoteTypes] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('AI Agent Note Types', userPayload, EntityPermissionType.Read, 'AND');
928
+ const result = this.MapFieldNamesToCodeNames('AI Agent Note Types', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
929
929
  return result;
930
930
  }
931
931
 
932
932
  @FieldResolver(() => [AIAgentNote_])
933
933
  async AIAgentNotes_AgentNoteTypeIDArray(@Root() aiagentnotetype_: AIAgentNoteType_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
934
- this.CheckUserReadPermissions('AIAgent Notes', userPayload);
935
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentNotes] WHERE [AgentNoteTypeID]='${aiagentnotetype_.ID}' ` + this.getRowLevelSecurityWhereClause('AIAgent Notes', userPayload, EntityPermissionType.Read, 'AND');
936
- const result = this.ArrayMapFieldNamesToCodeNames('AIAgent Notes', await dataSource.query(sSQL));
934
+ this.CheckUserReadPermissions('AI Agent Notes', userPayload);
935
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentNotes] WHERE [AgentNoteTypeID]='${aiagentnotetype_.ID}' ` + this.getRowLevelSecurityWhereClause('AI Agent Notes', userPayload, EntityPermissionType.Read, 'AND');
936
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Notes', await dataSource.query(sSQL));
937
937
  return result;
938
938
  }
939
939
 
@@ -943,7 +943,7 @@ export class AIAgentNoteTypeResolver extends ResolverBase {
943
943
  @Ctx() { dataSource, userPayload }: AppContext,
944
944
  @PubSub() pubSub: PubSubEngine
945
945
  ) {
946
- return this.CreateRecord('AIAgent Note Types', input, dataSource, userPayload, pubSub)
946
+ return this.CreateRecord('AI Agent Note Types', input, dataSource, userPayload, pubSub)
947
947
  }
948
948
 
949
949
  @Mutation(() => AIAgentNoteType_)
@@ -952,19 +952,19 @@ export class AIAgentNoteTypeResolver extends ResolverBase {
952
952
  @Ctx() { dataSource, userPayload }: AppContext,
953
953
  @PubSub() pubSub: PubSubEngine
954
954
  ) {
955
- return this.UpdateRecord('AIAgent Note Types', input, dataSource, userPayload, pubSub);
955
+ return this.UpdateRecord('AI Agent Note Types', input, dataSource, userPayload, pubSub);
956
956
  }
957
957
 
958
958
  @Mutation(() => AIAgentNoteType_)
959
959
  async DeleteAIAgentNoteType(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
960
960
  const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
961
- return this.DeleteRecord('AIAgent Note Types', key, options, dataSource, userPayload, pubSub);
961
+ return this.DeleteRecord('AI Agent Note Types', key, options, dataSource, userPayload, pubSub);
962
962
  }
963
963
 
964
964
  }
965
965
 
966
966
  //****************************************************************************
967
- // ENTITY CLASS for AIAgents
967
+ // ENTITY CLASS for AI Agents
968
968
  //****************************************************************************
969
969
  @ObjectType({ description: 'Table to store information about AI agents.' })
970
970
  export class AIAgent_ {
@@ -991,6 +991,9 @@ export class AIAgent_ {
991
991
  @MaxLength(10)
992
992
  _mj__UpdatedAt: Date;
993
993
 
994
+ @Field(() => [AIAgentRequest_])
995
+ AIAgentRequests_AgentIDArray: AIAgentRequest_[]; // Link to AIAgentRequests
996
+
994
997
  @Field(() => [AIAgentLearningCycle_])
995
998
  AIAgentLearningCycles_AgentIDArray: AIAgentLearningCycle_[]; // Link to AIAgentLearningCycles
996
999
 
@@ -1006,7 +1009,7 @@ export class AIAgent_ {
1006
1009
  }
1007
1010
 
1008
1011
  //****************************************************************************
1009
- // INPUT TYPE for AIAgents
1012
+ // INPUT TYPE for AI Agents
1010
1013
  //****************************************************************************
1011
1014
  @InputType()
1012
1015
  export class CreateAIAgentInput {
@@ -1022,7 +1025,7 @@ export class CreateAIAgentInput {
1022
1025
 
1023
1026
 
1024
1027
  //****************************************************************************
1025
- // INPUT TYPE for AIAgents
1028
+ // INPUT TYPE for AI Agents
1026
1029
  //****************************************************************************
1027
1030
  @InputType()
1028
1031
  export class UpdateAIAgentInput {
@@ -1043,7 +1046,7 @@ export class UpdateAIAgentInput {
1043
1046
  }
1044
1047
 
1045
1048
  //****************************************************************************
1046
- // RESOLVER for AIAgents
1049
+ // RESOLVER for AI Agents
1047
1050
  //****************************************************************************
1048
1051
  @ObjectType()
1049
1052
  export class RunAIAgentViewResult {
@@ -1083,46 +1086,54 @@ export class AIAgentResolver extends ResolverBase {
1083
1086
 
1084
1087
  @Query(() => RunAIAgentViewResult)
1085
1088
  async RunAIAgentDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
1086
- input.EntityName = 'AIAgents';
1089
+ input.EntityName = 'AI Agents';
1087
1090
  return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
1088
1091
  }
1089
1092
  @Query(() => AIAgent_, { nullable: true })
1090
1093
  async AIAgent(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<AIAgent_ | null> {
1091
- this.CheckUserReadPermissions('AIAgents', userPayload);
1092
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgents] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('AIAgents', userPayload, EntityPermissionType.Read, 'AND');
1093
- const result = this.MapFieldNamesToCodeNames('AIAgents', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
1094
+ this.CheckUserReadPermissions('AI Agents', userPayload);
1095
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgents] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('AI Agents', userPayload, EntityPermissionType.Read, 'AND');
1096
+ const result = this.MapFieldNamesToCodeNames('AI Agents', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
1094
1097
  return result;
1095
1098
  }
1096
1099
 
1100
+ @FieldResolver(() => [AIAgentRequest_])
1101
+ async AIAgentRequests_AgentIDArray(@Root() aiagent_: AIAgent_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
1102
+ this.CheckUserReadPermissions('AI Agent Requests', userPayload);
1103
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRequests] WHERE [AgentID]='${aiagent_.ID}' ` + this.getRowLevelSecurityWhereClause('AI Agent Requests', userPayload, EntityPermissionType.Read, 'AND');
1104
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Requests', await dataSource.query(sSQL));
1105
+ return result;
1106
+ }
1107
+
1097
1108
  @FieldResolver(() => [AIAgentLearningCycle_])
1098
1109
  async AIAgentLearningCycles_AgentIDArray(@Root() aiagent_: AIAgent_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
1099
- this.CheckUserReadPermissions('AIAgent Learning Cycles', userPayload);
1100
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentLearningCycles] WHERE [AgentID]='${aiagent_.ID}' ` + this.getRowLevelSecurityWhereClause('AIAgent Learning Cycles', userPayload, EntityPermissionType.Read, 'AND');
1101
- const result = this.ArrayMapFieldNamesToCodeNames('AIAgent Learning Cycles', await dataSource.query(sSQL));
1110
+ this.CheckUserReadPermissions('AI Agent Learning Cycles', userPayload);
1111
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentLearningCycles] WHERE [AgentID]='${aiagent_.ID}' ` + this.getRowLevelSecurityWhereClause('AI Agent Learning Cycles', userPayload, EntityPermissionType.Read, 'AND');
1112
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Learning Cycles', await dataSource.query(sSQL));
1102
1113
  return result;
1103
1114
  }
1104
1115
 
1105
1116
  @FieldResolver(() => [AIAgentModel_])
1106
1117
  async AIAgentModels_AgentIDArray(@Root() aiagent_: AIAgent_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
1107
- this.CheckUserReadPermissions('AIAgent Models', userPayload);
1108
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentModels] WHERE [AgentID]='${aiagent_.ID}' ` + this.getRowLevelSecurityWhereClause('AIAgent Models', userPayload, EntityPermissionType.Read, 'AND');
1109
- const result = this.ArrayMapFieldNamesToCodeNames('AIAgent Models', await dataSource.query(sSQL));
1118
+ this.CheckUserReadPermissions('AI Agent Models', userPayload);
1119
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentModels] WHERE [AgentID]='${aiagent_.ID}' ` + this.getRowLevelSecurityWhereClause('AI Agent Models', userPayload, EntityPermissionType.Read, 'AND');
1120
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Models', await dataSource.query(sSQL));
1110
1121
  return result;
1111
1122
  }
1112
1123
 
1113
1124
  @FieldResolver(() => [AIAgentAction_])
1114
1125
  async AIAgentActions_AgentIDArray(@Root() aiagent_: AIAgent_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
1115
- this.CheckUserReadPermissions('AIAgent Actions', userPayload);
1116
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentActions] WHERE [AgentID]='${aiagent_.ID}' ` + this.getRowLevelSecurityWhereClause('AIAgent Actions', userPayload, EntityPermissionType.Read, 'AND');
1117
- const result = this.ArrayMapFieldNamesToCodeNames('AIAgent Actions', await dataSource.query(sSQL));
1126
+ this.CheckUserReadPermissions('AI Agent Actions', userPayload);
1127
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentActions] WHERE [AgentID]='${aiagent_.ID}' ` + this.getRowLevelSecurityWhereClause('AI Agent Actions', userPayload, EntityPermissionType.Read, 'AND');
1128
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Actions', await dataSource.query(sSQL));
1118
1129
  return result;
1119
1130
  }
1120
1131
 
1121
1132
  @FieldResolver(() => [AIAgentNote_])
1122
1133
  async AIAgentNotes_AgentIDArray(@Root() aiagent_: AIAgent_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
1123
- this.CheckUserReadPermissions('AIAgent Notes', userPayload);
1124
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentNotes] WHERE [AgentID]='${aiagent_.ID}' ` + this.getRowLevelSecurityWhereClause('AIAgent Notes', userPayload, EntityPermissionType.Read, 'AND');
1125
- const result = this.ArrayMapFieldNamesToCodeNames('AIAgent Notes', await dataSource.query(sSQL));
1134
+ this.CheckUserReadPermissions('AI Agent Notes', userPayload);
1135
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentNotes] WHERE [AgentID]='${aiagent_.ID}' ` + this.getRowLevelSecurityWhereClause('AI Agent Notes', userPayload, EntityPermissionType.Read, 'AND');
1136
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Notes', await dataSource.query(sSQL));
1126
1137
  return result;
1127
1138
  }
1128
1139
 
@@ -1132,7 +1143,7 @@ export class AIAgentResolver extends ResolverBase {
1132
1143
  @Ctx() { dataSource, userPayload }: AppContext,
1133
1144
  @PubSub() pubSub: PubSubEngine
1134
1145
  ) {
1135
- return this.CreateRecord('AIAgents', input, dataSource, userPayload, pubSub)
1146
+ return this.CreateRecord('AI Agents', input, dataSource, userPayload, pubSub)
1136
1147
  }
1137
1148
 
1138
1149
  @Mutation(() => AIAgent_)
@@ -1141,19 +1152,19 @@ export class AIAgentResolver extends ResolverBase {
1141
1152
  @Ctx() { dataSource, userPayload }: AppContext,
1142
1153
  @PubSub() pubSub: PubSubEngine
1143
1154
  ) {
1144
- return this.UpdateRecord('AIAgents', input, dataSource, userPayload, pubSub);
1155
+ return this.UpdateRecord('AI Agents', input, dataSource, userPayload, pubSub);
1145
1156
  }
1146
1157
 
1147
1158
  @Mutation(() => AIAgent_)
1148
1159
  async DeleteAIAgent(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
1149
1160
  const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
1150
- return this.DeleteRecord('AIAgents', key, options, dataSource, userPayload, pubSub);
1161
+ return this.DeleteRecord('AI Agents', key, options, dataSource, userPayload, pubSub);
1151
1162
  }
1152
1163
 
1153
1164
  }
1154
1165
 
1155
1166
  //****************************************************************************
1156
- // ENTITY CLASS for AIAgent Notes
1167
+ // ENTITY CLASS for AI Agent Notes
1157
1168
  //****************************************************************************
1158
1169
  @ObjectType()
1159
1170
  export class AIAgentNote_ {
@@ -1180,6 +1191,14 @@ export class AIAgentNote_ {
1180
1191
  @MaxLength(10)
1181
1192
  _mj__UpdatedAt: Date;
1182
1193
 
1194
+ @Field({description: 'Indicates the type of note, either User-specific or Global.'})
1195
+ @MaxLength(40)
1196
+ Type: string;
1197
+
1198
+ @Field({nullable: true, description: 'Foreign key referencing the ID column in the User table, indicating the user associated with the note. Used when Type=User'})
1199
+ @MaxLength(16)
1200
+ UserID?: string;
1201
+
1183
1202
  @Field({nullable: true})
1184
1203
  @MaxLength(510)
1185
1204
  Agent?: string;
@@ -1188,10 +1207,14 @@ export class AIAgentNote_ {
1188
1207
  @MaxLength(510)
1189
1208
  AgentNoteType?: string;
1190
1209
 
1210
+ @Field({nullable: true})
1211
+ @MaxLength(200)
1212
+ User?: string;
1213
+
1191
1214
  }
1192
1215
 
1193
1216
  //****************************************************************************
1194
- // INPUT TYPE for AIAgent Notes
1217
+ // INPUT TYPE for AI Agent Notes
1195
1218
  //****************************************************************************
1196
1219
  @InputType()
1197
1220
  export class CreateAIAgentNoteInput {
@@ -1203,11 +1226,17 @@ export class CreateAIAgentNoteInput {
1203
1226
 
1204
1227
  @Field({ nullable: true })
1205
1228
  Note?: string;
1229
+
1230
+ @Field()
1231
+ Type: string;
1232
+
1233
+ @Field({ nullable: true })
1234
+ UserID?: string;
1206
1235
  }
1207
1236
 
1208
1237
 
1209
1238
  //****************************************************************************
1210
- // INPUT TYPE for AIAgent Notes
1239
+ // INPUT TYPE for AI Agent Notes
1211
1240
  //****************************************************************************
1212
1241
  @InputType()
1213
1242
  export class UpdateAIAgentNoteInput {
@@ -1223,12 +1252,18 @@ export class UpdateAIAgentNoteInput {
1223
1252
  @Field({ nullable: true })
1224
1253
  Note?: string;
1225
1254
 
1255
+ @Field()
1256
+ Type: string;
1257
+
1258
+ @Field({ nullable: true })
1259
+ UserID?: string;
1260
+
1226
1261
  @Field(() => [KeyValuePairInput], { nullable: true })
1227
1262
  OldValues___?: KeyValuePairInput[];
1228
1263
  }
1229
1264
 
1230
1265
  //****************************************************************************
1231
- // RESOLVER for AIAgent Notes
1266
+ // RESOLVER for AI Agent Notes
1232
1267
  //****************************************************************************
1233
1268
  @ObjectType()
1234
1269
  export class RunAIAgentNoteViewResult {
@@ -1268,14 +1303,14 @@ export class AIAgentNoteResolver extends ResolverBase {
1268
1303
 
1269
1304
  @Query(() => RunAIAgentNoteViewResult)
1270
1305
  async RunAIAgentNoteDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
1271
- input.EntityName = 'AIAgent Notes';
1306
+ input.EntityName = 'AI Agent Notes';
1272
1307
  return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
1273
1308
  }
1274
1309
  @Query(() => AIAgentNote_, { nullable: true })
1275
1310
  async AIAgentNote(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<AIAgentNote_ | null> {
1276
- this.CheckUserReadPermissions('AIAgent Notes', userPayload);
1277
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentNotes] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('AIAgent Notes', userPayload, EntityPermissionType.Read, 'AND');
1278
- const result = this.MapFieldNamesToCodeNames('AIAgent Notes', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
1311
+ this.CheckUserReadPermissions('AI Agent Notes', userPayload);
1312
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentNotes] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('AI Agent Notes', userPayload, EntityPermissionType.Read, 'AND');
1313
+ const result = this.MapFieldNamesToCodeNames('AI Agent Notes', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
1279
1314
  return result;
1280
1315
  }
1281
1316
 
@@ -1285,7 +1320,7 @@ export class AIAgentNoteResolver extends ResolverBase {
1285
1320
  @Ctx() { dataSource, userPayload }: AppContext,
1286
1321
  @PubSub() pubSub: PubSubEngine
1287
1322
  ) {
1288
- return this.CreateRecord('AIAgent Notes', input, dataSource, userPayload, pubSub)
1323
+ return this.CreateRecord('AI Agent Notes', input, dataSource, userPayload, pubSub)
1289
1324
  }
1290
1325
 
1291
1326
  @Mutation(() => AIAgentNote_)
@@ -1294,19 +1329,19 @@ export class AIAgentNoteResolver extends ResolverBase {
1294
1329
  @Ctx() { dataSource, userPayload }: AppContext,
1295
1330
  @PubSub() pubSub: PubSubEngine
1296
1331
  ) {
1297
- return this.UpdateRecord('AIAgent Notes', input, dataSource, userPayload, pubSub);
1332
+ return this.UpdateRecord('AI Agent Notes', input, dataSource, userPayload, pubSub);
1298
1333
  }
1299
1334
 
1300
1335
  @Mutation(() => AIAgentNote_)
1301
1336
  async DeleteAIAgentNote(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
1302
1337
  const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
1303
- return this.DeleteRecord('AIAgent Notes', key, options, dataSource, userPayload, pubSub);
1338
+ return this.DeleteRecord('AI Agent Notes', key, options, dataSource, userPayload, pubSub);
1304
1339
  }
1305
1340
 
1306
1341
  }
1307
1342
 
1308
1343
  //****************************************************************************
1309
- // ENTITY CLASS for AIAgent Actions
1344
+ // ENTITY CLASS for AI Agent Actions
1310
1345
  //****************************************************************************
1311
1346
  @ObjectType({ description: 'Table to store the relationship between AI agents and actions.' })
1312
1347
  export class AIAgentAction_ {
@@ -1345,7 +1380,7 @@ export class AIAgentAction_ {
1345
1380
  }
1346
1381
 
1347
1382
  //****************************************************************************
1348
- // INPUT TYPE for AIAgent Actions
1383
+ // INPUT TYPE for AI Agent Actions
1349
1384
  //****************************************************************************
1350
1385
  @InputType()
1351
1386
  export class CreateAIAgentActionInput {
@@ -1361,7 +1396,7 @@ export class CreateAIAgentActionInput {
1361
1396
 
1362
1397
 
1363
1398
  //****************************************************************************
1364
- // INPUT TYPE for AIAgent Actions
1399
+ // INPUT TYPE for AI Agent Actions
1365
1400
  //****************************************************************************
1366
1401
  @InputType()
1367
1402
  export class UpdateAIAgentActionInput {
@@ -1382,7 +1417,7 @@ export class UpdateAIAgentActionInput {
1382
1417
  }
1383
1418
 
1384
1419
  //****************************************************************************
1385
- // RESOLVER for AIAgent Actions
1420
+ // RESOLVER for AI Agent Actions
1386
1421
  //****************************************************************************
1387
1422
  @ObjectType()
1388
1423
  export class RunAIAgentActionViewResult {
@@ -1422,14 +1457,14 @@ export class AIAgentActionResolver extends ResolverBase {
1422
1457
 
1423
1458
  @Query(() => RunAIAgentActionViewResult)
1424
1459
  async RunAIAgentActionDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
1425
- input.EntityName = 'AIAgent Actions';
1460
+ input.EntityName = 'AI Agent Actions';
1426
1461
  return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
1427
1462
  }
1428
1463
  @Query(() => AIAgentAction_, { nullable: true })
1429
1464
  async AIAgentAction(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<AIAgentAction_ | null> {
1430
- this.CheckUserReadPermissions('AIAgent Actions', userPayload);
1431
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentActions] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('AIAgent Actions', userPayload, EntityPermissionType.Read, 'AND');
1432
- const result = this.MapFieldNamesToCodeNames('AIAgent Actions', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
1465
+ this.CheckUserReadPermissions('AI Agent Actions', userPayload);
1466
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentActions] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('AI Agent Actions', userPayload, EntityPermissionType.Read, 'AND');
1467
+ const result = this.MapFieldNamesToCodeNames('AI Agent Actions', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
1433
1468
  return result;
1434
1469
  }
1435
1470
 
@@ -1439,7 +1474,7 @@ export class AIAgentActionResolver extends ResolverBase {
1439
1474
  @Ctx() { dataSource, userPayload }: AppContext,
1440
1475
  @PubSub() pubSub: PubSubEngine
1441
1476
  ) {
1442
- return this.CreateRecord('AIAgent Actions', input, dataSource, userPayload, pubSub)
1477
+ return this.CreateRecord('AI Agent Actions', input, dataSource, userPayload, pubSub)
1443
1478
  }
1444
1479
 
1445
1480
  @Mutation(() => AIAgentAction_)
@@ -1448,13 +1483,13 @@ export class AIAgentActionResolver extends ResolverBase {
1448
1483
  @Ctx() { dataSource, userPayload }: AppContext,
1449
1484
  @PubSub() pubSub: PubSubEngine
1450
1485
  ) {
1451
- return this.UpdateRecord('AIAgent Actions', input, dataSource, userPayload, pubSub);
1486
+ return this.UpdateRecord('AI Agent Actions', input, dataSource, userPayload, pubSub);
1452
1487
  }
1453
1488
 
1454
1489
  @Mutation(() => AIAgentAction_)
1455
1490
  async DeleteAIAgentAction(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
1456
1491
  const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
1457
- return this.DeleteRecord('AIAgent Actions', key, options, dataSource, userPayload, pubSub);
1492
+ return this.DeleteRecord('AI Agent Actions', key, options, dataSource, userPayload, pubSub);
1458
1493
  }
1459
1494
 
1460
1495
  }
@@ -5679,9 +5714,18 @@ export class User_ {
5679
5714
  @Field(() => [ResourceLink_])
5680
5715
  ResourceLinks_UserIDArray: ResourceLink_[]; // Link to ResourceLinks
5681
5716
 
5717
+ @Field(() => [AIAgentRequest_])
5718
+ AIAgentRequests_ResponseByUserIDArray: AIAgentRequest_[]; // Link to AIAgentRequests
5719
+
5720
+ @Field(() => [AIAgentNote_])
5721
+ AIAgentNotes_UserIDArray: AIAgentNote_[]; // Link to AIAgentNotes
5722
+
5682
5723
  @Field(() => [ResourcePermission_])
5683
5724
  ResourcePermissions_UserIDArray: ResourcePermission_[]; // Link to ResourcePermissions
5684
5725
 
5726
+ @Field(() => [AIAgentRequest_])
5727
+ AIAgentRequests_RequestForUserIDArray: AIAgentRequest_[]; // Link to AIAgentRequests
5728
+
5685
5729
  }
5686
5730
 
5687
5731
  //****************************************************************************
@@ -6093,6 +6137,22 @@ export class UserResolverBase extends ResolverBase {
6093
6137
  return result;
6094
6138
  }
6095
6139
 
6140
+ @FieldResolver(() => [AIAgentRequest_])
6141
+ async AIAgentRequests_ResponseByUserIDArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
6142
+ this.CheckUserReadPermissions('AI Agent Requests', userPayload);
6143
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRequests] WHERE [ResponseByUserID]='${user_.ID}' ` + this.getRowLevelSecurityWhereClause('AI Agent Requests', userPayload, EntityPermissionType.Read, 'AND');
6144
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Requests', await dataSource.query(sSQL));
6145
+ return result;
6146
+ }
6147
+
6148
+ @FieldResolver(() => [AIAgentNote_])
6149
+ async AIAgentNotes_UserIDArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
6150
+ this.CheckUserReadPermissions('AI Agent Notes', userPayload);
6151
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentNotes] WHERE [UserID]='${user_.ID}' ` + this.getRowLevelSecurityWhereClause('AI Agent Notes', userPayload, EntityPermissionType.Read, 'AND');
6152
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Notes', await dataSource.query(sSQL));
6153
+ return result;
6154
+ }
6155
+
6096
6156
  @FieldResolver(() => [ResourcePermission_])
6097
6157
  async ResourcePermissions_UserIDArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
6098
6158
  this.CheckUserReadPermissions('Resource Permissions', userPayload);
@@ -6101,6 +6161,14 @@ export class UserResolverBase extends ResolverBase {
6101
6161
  return result;
6102
6162
  }
6103
6163
 
6164
+ @FieldResolver(() => [AIAgentRequest_])
6165
+ async AIAgentRequests_RequestForUserIDArray(@Root() user_: User_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
6166
+ this.CheckUserReadPermissions('AI Agent Requests', userPayload);
6167
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRequests] WHERE [RequestForUserID]='${user_.ID}' ` + this.getRowLevelSecurityWhereClause('AI Agent Requests', userPayload, EntityPermissionType.Read, 'AND');
6168
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Requests', await dataSource.query(sSQL));
6169
+ return result;
6170
+ }
6171
+
6104
6172
  @Mutation(() => User_)
6105
6173
  async CreateUser(
6106
6174
  @Arg('input', () => CreateUserInput) input: CreateUserInput,
@@ -11352,9 +11420,9 @@ export class AIModelResolver extends ResolverBase {
11352
11420
 
11353
11421
  @FieldResolver(() => [AIAgentModel_])
11354
11422
  async AIAgentModels_ModelIDArray(@Root() aimodel_: AIModel_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
11355
- this.CheckUserReadPermissions('AIAgent Models', userPayload);
11356
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentModels] WHERE [ModelID]='${aimodel_.ID}' ` + this.getRowLevelSecurityWhereClause('AIAgent Models', userPayload, EntityPermissionType.Read, 'AND');
11357
- const result = this.ArrayMapFieldNamesToCodeNames('AIAgent Models', await dataSource.query(sSQL));
11423
+ this.CheckUserReadPermissions('AI Agent Models', userPayload);
11424
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentModels] WHERE [ModelID]='${aimodel_.ID}' ` + this.getRowLevelSecurityWhereClause('AI Agent Models', userPayload, EntityPermissionType.Read, 'AND');
11425
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Models', await dataSource.query(sSQL));
11358
11426
  return result;
11359
11427
  }
11360
11428
 
@@ -21895,9 +21963,9 @@ export class ActionResolver extends ResolverBase {
21895
21963
 
21896
21964
  @FieldResolver(() => [AIAgentAction_])
21897
21965
  async AIAgentActions_ActionIDArray(@Root() action_: Action_, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
21898
- this.CheckUserReadPermissions('AIAgent Actions', userPayload);
21899
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentActions] WHERE [ActionID]='${action_.ID}' ` + this.getRowLevelSecurityWhereClause('AIAgent Actions', userPayload, EntityPermissionType.Read, 'AND');
21900
- const result = this.ArrayMapFieldNamesToCodeNames('AIAgent Actions', await dataSource.query(sSQL));
21966
+ this.CheckUserReadPermissions('AI Agent Actions', userPayload);
21967
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentActions] WHERE [ActionID]='${action_.ID}' ` + this.getRowLevelSecurityWhereClause('AI Agent Actions', userPayload, EntityPermissionType.Read, 'AND');
21968
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Actions', await dataSource.query(sSQL));
21901
21969
  return result;
21902
21970
  }
21903
21971
 
@@ -27707,6 +27775,221 @@ export class flyway_schema_historyResolver extends ResolverBase {
27707
27775
 
27708
27776
  }
27709
27777
 
27778
+ //****************************************************************************
27779
+ // ENTITY CLASS for AI Agent Requests
27780
+ //****************************************************************************
27781
+ @ObjectType()
27782
+ export class AIAgentRequest_ {
27783
+ @Field({description: 'Primary key for the AIAgentRequest table, uniquely identifies each record.'})
27784
+ @MaxLength(16)
27785
+ ID: string;
27786
+
27787
+ @Field({description: 'Foreign key referencing the ID column in the AIAgent table.'})
27788
+ @MaxLength(16)
27789
+ AgentID: string;
27790
+
27791
+ @Field({description: 'Timestamp when the request was made by the agent.'})
27792
+ @MaxLength(8)
27793
+ RequestedAt: Date;
27794
+
27795
+ @Field({nullable: true, description: 'Optional, a user that the AI specifically is directing the request to, if null intended for general system owner.'})
27796
+ @MaxLength(16)
27797
+ RequestForUserID?: string;
27798
+
27799
+ @Field({description: 'Current status of the request (Requested, Approved, Rejected, Canceled).'})
27800
+ @MaxLength(40)
27801
+ Status: string;
27802
+
27803
+ @Field({description: 'Details of what the AI Agent is requesting.'})
27804
+ Request: string;
27805
+
27806
+ @Field({nullable: true, description: 'Response provided by the human to the agent request.'})
27807
+ Response?: string;
27808
+
27809
+ @Field({nullable: true, description: 'Populated when a user responds indicating which user responded to the request.'})
27810
+ @MaxLength(16)
27811
+ ResponseByUserID?: string;
27812
+
27813
+ @Field({nullable: true, description: 'Timestamp when the response was provided by the human.'})
27814
+ @MaxLength(8)
27815
+ RespondedAt?: Date;
27816
+
27817
+ @Field({nullable: true, description: 'Additional comments about the request. Not shared with the agent, purely record keeping.'})
27818
+ Comments?: string;
27819
+
27820
+ @Field()
27821
+ @MaxLength(10)
27822
+ _mj__CreatedAt: Date;
27823
+
27824
+ @Field()
27825
+ @MaxLength(10)
27826
+ _mj__UpdatedAt: Date;
27827
+
27828
+ @Field({nullable: true})
27829
+ @MaxLength(510)
27830
+ Agent?: string;
27831
+
27832
+ @Field({nullable: true})
27833
+ @MaxLength(200)
27834
+ RequestForUser?: string;
27835
+
27836
+ @Field({nullable: true})
27837
+ @MaxLength(200)
27838
+ ResponseByUser?: string;
27839
+
27840
+ }
27841
+
27842
+ //****************************************************************************
27843
+ // INPUT TYPE for AI Agent Requests
27844
+ //****************************************************************************
27845
+ @InputType()
27846
+ export class CreateAIAgentRequestInput {
27847
+ @Field()
27848
+ AgentID: string;
27849
+
27850
+ @Field()
27851
+ RequestedAt: Date;
27852
+
27853
+ @Field({ nullable: true })
27854
+ RequestForUserID?: string;
27855
+
27856
+ @Field()
27857
+ Status: string;
27858
+
27859
+ @Field()
27860
+ Request: string;
27861
+
27862
+ @Field({ nullable: true })
27863
+ Response?: string;
27864
+
27865
+ @Field({ nullable: true })
27866
+ ResponseByUserID?: string;
27867
+
27868
+ @Field({ nullable: true })
27869
+ RespondedAt?: Date;
27870
+
27871
+ @Field({ nullable: true })
27872
+ Comments?: string;
27873
+ }
27874
+
27875
+
27876
+ //****************************************************************************
27877
+ // INPUT TYPE for AI Agent Requests
27878
+ //****************************************************************************
27879
+ @InputType()
27880
+ export class UpdateAIAgentRequestInput {
27881
+ @Field()
27882
+ ID: string;
27883
+
27884
+ @Field()
27885
+ AgentID: string;
27886
+
27887
+ @Field()
27888
+ RequestedAt: Date;
27889
+
27890
+ @Field({ nullable: true })
27891
+ RequestForUserID?: string;
27892
+
27893
+ @Field()
27894
+ Status: string;
27895
+
27896
+ @Field()
27897
+ Request: string;
27898
+
27899
+ @Field({ nullable: true })
27900
+ Response?: string;
27901
+
27902
+ @Field({ nullable: true })
27903
+ ResponseByUserID?: string;
27904
+
27905
+ @Field({ nullable: true })
27906
+ RespondedAt?: Date;
27907
+
27908
+ @Field({ nullable: true })
27909
+ Comments?: string;
27910
+
27911
+ @Field(() => [KeyValuePairInput], { nullable: true })
27912
+ OldValues___?: KeyValuePairInput[];
27913
+ }
27914
+
27915
+ //****************************************************************************
27916
+ // RESOLVER for AI Agent Requests
27917
+ //****************************************************************************
27918
+ @ObjectType()
27919
+ export class RunAIAgentRequestViewResult {
27920
+ @Field(() => [AIAgentRequest_])
27921
+ Results: AIAgentRequest_[];
27922
+
27923
+ @Field(() => String, {nullable: true})
27924
+ UserViewRunID?: string;
27925
+
27926
+ @Field(() => Int, {nullable: true})
27927
+ RowCount: number;
27928
+
27929
+ @Field(() => Int, {nullable: true})
27930
+ TotalRowCount: number;
27931
+
27932
+ @Field(() => Int, {nullable: true})
27933
+ ExecutionTime: number;
27934
+
27935
+ @Field({nullable: true})
27936
+ ErrorMessage?: string;
27937
+
27938
+ @Field(() => Boolean, {nullable: false})
27939
+ Success: boolean;
27940
+ }
27941
+
27942
+ @Resolver(AIAgentRequest_)
27943
+ export class AIAgentRequestResolver extends ResolverBase {
27944
+ @Query(() => RunAIAgentRequestViewResult)
27945
+ async RunAIAgentRequestViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27946
+ return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
27947
+ }
27948
+
27949
+ @Query(() => RunAIAgentRequestViewResult)
27950
+ async RunAIAgentRequestViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27951
+ return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
27952
+ }
27953
+
27954
+ @Query(() => RunAIAgentRequestViewResult)
27955
+ async RunAIAgentRequestDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27956
+ input.EntityName = 'AI Agent Requests';
27957
+ return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
27958
+ }
27959
+ @Query(() => AIAgentRequest_, { nullable: true })
27960
+ async AIAgentRequest(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<AIAgentRequest_ | null> {
27961
+ this.CheckUserReadPermissions('AI Agent Requests', userPayload);
27962
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRequests] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('AI Agent Requests', userPayload, EntityPermissionType.Read, 'AND');
27963
+ const result = this.MapFieldNamesToCodeNames('AI Agent Requests', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
27964
+ return result;
27965
+ }
27966
+
27967
+ @Mutation(() => AIAgentRequest_)
27968
+ async CreateAIAgentRequest(
27969
+ @Arg('input', () => CreateAIAgentRequestInput) input: CreateAIAgentRequestInput,
27970
+ @Ctx() { dataSource, userPayload }: AppContext,
27971
+ @PubSub() pubSub: PubSubEngine
27972
+ ) {
27973
+ return this.CreateRecord('AI Agent Requests', input, dataSource, userPayload, pubSub)
27974
+ }
27975
+
27976
+ @Mutation(() => AIAgentRequest_)
27977
+ async UpdateAIAgentRequest(
27978
+ @Arg('input', () => UpdateAIAgentRequestInput) input: UpdateAIAgentRequestInput,
27979
+ @Ctx() { dataSource, userPayload }: AppContext,
27980
+ @PubSub() pubSub: PubSubEngine
27981
+ ) {
27982
+ return this.UpdateRecord('AI Agent Requests', input, dataSource, userPayload, pubSub);
27983
+ }
27984
+
27985
+ @Mutation(() => AIAgentRequest_)
27986
+ async DeleteAIAgentRequest(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27987
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
27988
+ return this.DeleteRecord('AI Agent Requests', key, options, dataSource, userPayload, pubSub);
27989
+ }
27990
+
27991
+ }
27992
+
27710
27993
  //****************************************************************************
27711
27994
  // ENTITY CLASS for Query Entities
27712
27995
  //****************************************************************************
@@ -29734,7 +30017,7 @@ export class ContentItemTagResolver extends ResolverBase {
29734
30017
  }
29735
30018
 
29736
30019
  //****************************************************************************
29737
- // ENTITY CLASS for AIAgent Learning Cycles
30020
+ // ENTITY CLASS for AI Agent Learning Cycles
29738
30021
  //****************************************************************************
29739
30022
  @ObjectType({ description: 'Tracks the learning cycles for AI Agents where the Agent does offline reasoning, reflection, learning, and updates metadata.' })
29740
30023
  export class AIAgentLearningCycle_ {
@@ -29776,7 +30059,7 @@ export class AIAgentLearningCycle_ {
29776
30059
  }
29777
30060
 
29778
30061
  //****************************************************************************
29779
- // INPUT TYPE for AIAgent Learning Cycles
30062
+ // INPUT TYPE for AI Agent Learning Cycles
29780
30063
  //****************************************************************************
29781
30064
  @InputType()
29782
30065
  export class CreateAIAgentLearningCycleInput {
@@ -29798,7 +30081,7 @@ export class CreateAIAgentLearningCycleInput {
29798
30081
 
29799
30082
 
29800
30083
  //****************************************************************************
29801
- // INPUT TYPE for AIAgent Learning Cycles
30084
+ // INPUT TYPE for AI Agent Learning Cycles
29802
30085
  //****************************************************************************
29803
30086
  @InputType()
29804
30087
  export class UpdateAIAgentLearningCycleInput {
@@ -29825,7 +30108,7 @@ export class UpdateAIAgentLearningCycleInput {
29825
30108
  }
29826
30109
 
29827
30110
  //****************************************************************************
29828
- // RESOLVER for AIAgent Learning Cycles
30111
+ // RESOLVER for AI Agent Learning Cycles
29829
30112
  //****************************************************************************
29830
30113
  @ObjectType()
29831
30114
  export class RunAIAgentLearningCycleViewResult {
@@ -29865,14 +30148,14 @@ export class AIAgentLearningCycleResolver extends ResolverBase {
29865
30148
 
29866
30149
  @Query(() => RunAIAgentLearningCycleViewResult)
29867
30150
  async RunAIAgentLearningCycleDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
29868
- input.EntityName = 'AIAgent Learning Cycles';
30151
+ input.EntityName = 'AI Agent Learning Cycles';
29869
30152
  return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
29870
30153
  }
29871
30154
  @Query(() => AIAgentLearningCycle_, { nullable: true })
29872
30155
  async AIAgentLearningCycle(@Arg('ID', () => String) ID: string, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<AIAgentLearningCycle_ | null> {
29873
- this.CheckUserReadPermissions('AIAgent Learning Cycles', userPayload);
29874
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentLearningCycles] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('AIAgent Learning Cycles', userPayload, EntityPermissionType.Read, 'AND');
29875
- const result = this.MapFieldNamesToCodeNames('AIAgent Learning Cycles', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
30156
+ this.CheckUserReadPermissions('AI Agent Learning Cycles', userPayload);
30157
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentLearningCycles] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('AI Agent Learning Cycles', userPayload, EntityPermissionType.Read, 'AND');
30158
+ const result = this.MapFieldNamesToCodeNames('AI Agent Learning Cycles', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
29876
30159
  return result;
29877
30160
  }
29878
30161
 
@@ -29882,7 +30165,7 @@ export class AIAgentLearningCycleResolver extends ResolverBase {
29882
30165
  @Ctx() { dataSource, userPayload }: AppContext,
29883
30166
  @PubSub() pubSub: PubSubEngine
29884
30167
  ) {
29885
- return this.CreateRecord('AIAgent Learning Cycles', input, dataSource, userPayload, pubSub)
30168
+ return this.CreateRecord('AI Agent Learning Cycles', input, dataSource, userPayload, pubSub)
29886
30169
  }
29887
30170
 
29888
30171
  @Mutation(() => AIAgentLearningCycle_)
@@ -29891,13 +30174,13 @@ export class AIAgentLearningCycleResolver extends ResolverBase {
29891
30174
  @Ctx() { dataSource, userPayload }: AppContext,
29892
30175
  @PubSub() pubSub: PubSubEngine
29893
30176
  ) {
29894
- return this.UpdateRecord('AIAgent Learning Cycles', input, dataSource, userPayload, pubSub);
30177
+ return this.UpdateRecord('AI Agent Learning Cycles', input, dataSource, userPayload, pubSub);
29895
30178
  }
29896
30179
 
29897
30180
  @Mutation(() => AIAgentLearningCycle_)
29898
30181
  async DeleteAIAgentLearningCycle(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
29899
30182
  const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
29900
- return this.DeleteRecord('AIAgent Learning Cycles', key, options, dataSource, userPayload, pubSub);
30183
+ return this.DeleteRecord('AI Agent Learning Cycles', key, options, dataSource, userPayload, pubSub);
29901
30184
  }
29902
30185
 
29903
30186
  }