@memberjunction/server 2.108.0 → 2.110.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 (39) hide show
  1. package/dist/agents/skip-agent.d.ts +1 -0
  2. package/dist/agents/skip-agent.d.ts.map +1 -1
  3. package/dist/agents/skip-agent.js +71 -20
  4. package/dist/agents/skip-agent.js.map +1 -1
  5. package/dist/agents/skip-sdk.d.ts.map +1 -1
  6. package/dist/agents/skip-sdk.js +29 -14
  7. package/dist/agents/skip-sdk.js.map +1 -1
  8. package/dist/generated/generated.d.ts +186 -15
  9. package/dist/generated/generated.d.ts.map +1 -1
  10. package/dist/generated/generated.js +1118 -95
  11. package/dist/generated/generated.js.map +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +2 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/resolvers/CreateQueryResolver.d.ts +1 -0
  16. package/dist/resolvers/CreateQueryResolver.d.ts.map +1 -1
  17. package/dist/resolvers/CreateQueryResolver.js +73 -11
  18. package/dist/resolvers/CreateQueryResolver.js.map +1 -1
  19. package/dist/resolvers/RunAIAgentResolver.d.ts +6 -2
  20. package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
  21. package/dist/resolvers/RunAIAgentResolver.js +234 -8
  22. package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
  23. package/dist/resolvers/TaskResolver.d.ts +1 -1
  24. package/dist/resolvers/TaskResolver.d.ts.map +1 -1
  25. package/dist/resolvers/TaskResolver.js +4 -3
  26. package/dist/resolvers/TaskResolver.js.map +1 -1
  27. package/dist/services/TaskOrchestrator.d.ts +3 -1
  28. package/dist/services/TaskOrchestrator.d.ts.map +1 -1
  29. package/dist/services/TaskOrchestrator.js +77 -2
  30. package/dist/services/TaskOrchestrator.js.map +1 -1
  31. package/package.json +35 -34
  32. package/src/agents/skip-agent.ts +130 -56
  33. package/src/agents/skip-sdk.ts +45 -16
  34. package/src/generated/generated.ts +720 -77
  35. package/src/index.ts +4 -0
  36. package/src/resolvers/CreateQueryResolver.ts +125 -28
  37. package/src/resolvers/RunAIAgentResolver.ts +397 -9
  38. package/src/resolvers/TaskResolver.ts +3 -2
  39. package/src/services/TaskOrchestrator.ts +118 -3
@@ -19,7 +19,7 @@ import { mj_core_schema } from '../config.js';
19
19
 
20
20
 
21
21
 
22
- import { ScheduledActionEntity, ScheduledActionParamEntity, ExplorerNavigationItemEntity, GeneratedCodeCategoryEntity, AIAgentModelEntity, ComponentRegistryEntity, AIAgentNoteTypeEntity, ComponentDependencyEntity, AIAgentRunEntity, AIVendorEntity, TaskTypeEntity, AIConfigurationEntity, AIAgentEntity, AIAgentStepEntity, AIModelCostEntity, AIPromptModelEntity, AIAgentTypeEntity, AIAgentNoteEntity, EnvironmentEntity, AIAgentActionEntity, TaskDependencyEntity, CollectionArtifactEntity, AIModelPriceTypeEntity, CollectionEntity, RecordLinkEntity, 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, AIAgentArtifactTypeEntity, ConversationArtifactVersionEntity, AIAgentRequestEntity, AIModelVendorEntity, AIVendorTypeDefinitionEntity, ReportUserStateEntity, QueryEntityEntity, ScheduledJobRunEntity, DashboardUserStateEntity, ComponentEntity, AccessControlRuleEntity, PublicLinkEntity, ArtifactTypeEntity, AIVendorTypeEntity, ArtifactEntity, ConversationArtifactEntity, CollectionPermissionEntity, AIAgentPromptEntity, ComponentLibraryEntity, ScheduledJobTypeEntity, DashboardUserPreferenceEntity, QueryParameterEntity, AIAgentPermissionEntity, AIAgentRelationshipEntity, ComponentLibraryLinkEntity, ContentProcessRunEntity, ContentSourceEntity, ContentSourceParamEntity, ContentSourceTypeEntity, ContentSourceTypeParamEntity, ContentTypeEntity, ContentTypeAttributeEntity, ContentFileTypeEntity, ContentItemEntity, ContentItemAttributeEntity, ContentItemTagEntity, GeneratedCodeEntity, ScheduledJobEntity, AIPromptRunEntity, AIAgentRunStepEntity, ConversationDetailArtifactEntity, TaskEntity, ProjectEntity, ConversationArtifactPermissionEntity, AIModelPriceUnitTypeEntity, ArtifactVersionEntity, AIAgentStepPathEntity, AIAgentLearningCycleEntity, ReportVersionEntity, AIConfigurationParamEntity, ArtifactVersionAttributeEntity } from '@memberjunction/core-entities';
22
+ import { ScheduledActionEntity, ScheduledActionParamEntity, ExplorerNavigationItemEntity, GeneratedCodeCategoryEntity, AIAgentModelEntity, ComponentRegistryEntity, AIAgentNoteTypeEntity, ComponentDependencyEntity, AIAgentRunEntity, AIVendorEntity, TaskTypeEntity, AIConfigurationEntity, AIAgentEntity, AIAgentStepEntity, AIModelCostEntity, AIPromptModelEntity, AIAgentTypeEntity, AIAgentNoteEntity, EnvironmentEntity, ArtifactPermissionEntity, AIAgentActionEntity, TaskDependencyEntity, CollectionArtifactEntity, AIModelPriceTypeEntity, CollectionEntity, RecordLinkEntity, 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, AIAgentArtifactTypeEntity, ConversationArtifactVersionEntity, AIAgentRequestEntity, AIModelVendorEntity, AIVendorTypeDefinitionEntity, ReportUserStateEntity, QueryEntityEntity, ScheduledJobRunEntity, DashboardUserStateEntity, ComponentEntity, AccessControlRuleEntity, PublicLinkEntity, ArtifactTypeEntity, AIVendorTypeEntity, ArtifactEntity, ConversationArtifactEntity, CollectionPermissionEntity, AIAgentPromptEntity, ComponentLibraryEntity, ScheduledJobTypeEntity, DashboardUserPreferenceEntity, QueryParameterEntity, AIAgentPermissionEntity, AIAgentRelationshipEntity, ComponentLibraryLinkEntity, ContentProcessRunEntity, ContentSourceEntity, ContentSourceParamEntity, ContentSourceTypeEntity, ContentSourceTypeParamEntity, ContentTypeEntity, ContentTypeAttributeEntity, ContentFileTypeEntity, ContentItemEntity, ContentItemAttributeEntity, ContentItemTagEntity, GeneratedCodeEntity, ScheduledJobEntity, AIPromptRunEntity, AIAgentRunStepEntity, ConversationDetailArtifactEntity, TaskEntity, ProjectEntity, ConversationArtifactPermissionEntity, AIModelPriceUnitTypeEntity, ArtifactVersionEntity, AIAgentStepPathEntity, AIAgentLearningCycleEntity, ReportVersionEntity, AIConfigurationParamEntity, ArtifactVersionAttributeEntity, AIAgentDataSourceEntity } from '@memberjunction/core-entities';
23
23
 
24
24
 
25
25
  //****************************************************************************
@@ -1757,12 +1757,12 @@ each time the agent processes a prompt step.`})
1757
1757
  @MaxLength(16)
1758
1758
  RootLastRunID?: string;
1759
1759
 
1760
- @Field(() => [MJAIAgentRunStep_])
1761
- MJ_AIAgentRunSteps_AgentRunIDArray: MJAIAgentRunStep_[]; // Link to MJ_AIAgentRunSteps
1762
-
1763
1760
  @Field(() => [MJAIAgentRun_])
1764
1761
  MJ_AIAgentRuns_ParentRunIDArray: MJAIAgentRun_[]; // Link to MJ_AIAgentRuns
1765
1762
 
1763
+ @Field(() => [MJAIAgentRunStep_])
1764
+ MJ_AIAgentRunSteps_AgentRunIDArray: MJAIAgentRunStep_[]; // Link to MJ_AIAgentRunSteps
1765
+
1766
1766
  @Field(() => [MJAIPromptRun_])
1767
1767
  MJ_AIPromptRuns_AgentRunIDArray: MJAIPromptRun_[]; // Link to MJ_AIPromptRuns
1768
1768
 
@@ -2070,25 +2070,25 @@ export class MJAIAgentRunResolver extends ResolverBase {
2070
2070
  return result;
2071
2071
  }
2072
2072
 
2073
- @FieldResolver(() => [MJAIAgentRunStep_])
2074
- async MJ_AIAgentRunSteps_AgentRunIDArray(@Root() mjaiagentrun_: MJAIAgentRun_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2075
- this.CheckUserReadPermissions('MJ: AI Agent Run Steps', userPayload);
2073
+ @FieldResolver(() => [MJAIAgentRun_])
2074
+ async MJ_AIAgentRuns_ParentRunIDArray(@Root() mjaiagentrun_: MJAIAgentRun_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2075
+ this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
2076
2076
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2077
2077
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2078
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRunSteps] WHERE [AgentRunID]='${mjaiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Run Steps', userPayload, EntityPermissionType.Read, 'AND');
2078
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRuns] WHERE [ParentRunID]='${mjaiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Runs', userPayload, EntityPermissionType.Read, 'AND');
2079
2079
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2080
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Run Steps', rows);
2080
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Runs', rows);
2081
2081
  return result;
2082
2082
  }
2083
2083
 
2084
- @FieldResolver(() => [MJAIAgentRun_])
2085
- async MJ_AIAgentRuns_ParentRunIDArray(@Root() mjaiagentrun_: MJAIAgentRun_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2086
- this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
2084
+ @FieldResolver(() => [MJAIAgentRunStep_])
2085
+ async MJ_AIAgentRunSteps_AgentRunIDArray(@Root() mjaiagentrun_: MJAIAgentRun_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2086
+ this.CheckUserReadPermissions('MJ: AI Agent Run Steps', userPayload);
2087
2087
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2088
2088
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2089
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRuns] WHERE [ParentRunID]='${mjaiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Runs', userPayload, EntityPermissionType.Read, 'AND');
2089
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRunSteps] WHERE [AgentRunID]='${mjaiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Run Steps', userPayload, EntityPermissionType.Read, 'AND');
2090
2090
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2091
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Runs', rows);
2091
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Run Steps', rows);
2092
2092
  return result;
2093
2093
  }
2094
2094
 
@@ -2875,9 +2875,9 @@ export class MJAIAgent_ {
2875
2875
  @MaxLength(16)
2876
2876
  TypeID?: string;
2877
2877
 
2878
- @Field({nullable: true, description: `Current status of the AI agent. Active agents can be executed, Disabled agents are inactive, and Pending agents are awaiting configuration or approval. Allowed values: Active, Disabled, Pending.`})
2878
+ @Field({description: `Current status of the AI agent. Active agents can be executed, Disabled agents are inactive, and Pending agents are awaiting configuration or approval. Allowed values: Active, Disabled, Pending.`})
2879
2879
  @MaxLength(40)
2880
- Status?: string;
2880
+ Status: string;
2881
2881
 
2882
2882
  @Field({nullable: true, description: `Optional override for the class name used by the MemberJunction class factory to instantiate this specific agent. If specified, this overrides the agent type's DriverClass. Useful for specialized agent implementations.`})
2883
2883
  @MaxLength(510)
@@ -2967,6 +2967,16 @@ if this limit is exceeded.`})
2967
2967
  @MaxLength(40)
2968
2968
  InvocationMode: string;
2969
2969
 
2970
+ @Field({description: `Controls how artifacts are created from this agent's payloads. "Always" creates visible artifacts, "Never" skips artifact creation, "System Only" creates hidden system artifacts.`})
2971
+ @MaxLength(40)
2972
+ ArtifactCreationMode: string;
2973
+
2974
+ @Field({nullable: true, description: `Detailed markdown formatted requirements that explain the business goals of the agent without specific technical implementation details.`})
2975
+ FunctionalRequirements?: string;
2976
+
2977
+ @Field({nullable: true, description: `Detailed markdown that explains the structure of the agent including agent architecture, actions, sub-agents, prompts, and payload structure.`})
2978
+ TechnicalDesign?: string;
2979
+
2970
2980
  @Field({nullable: true})
2971
2981
  @MaxLength(510)
2972
2982
  Parent?: string;
@@ -3015,6 +3025,9 @@ if this limit is exceeded.`})
3015
3025
  @Field(() => [MJAIAgentPermission_])
3016
3026
  MJ_AIAgentPermissions_AgentIDArray: MJAIAgentPermission_[]; // Link to MJ_AIAgentPermissions
3017
3027
 
3028
+ @Field(() => [MJAIAgentDataSource_])
3029
+ MJ_AIAgentDataSources_AgentIDArray: MJAIAgentDataSource_[]; // Link to MJ_AIAgentDataSources
3030
+
3018
3031
  @Field(() => [MJAIAgentNote_])
3019
3032
  AIAgentNotes_AgentIDArray: MJAIAgentNote_[]; // Link to AIAgentNotes
3020
3033
 
@@ -3092,7 +3105,7 @@ export class CreateMJAIAgentInput {
3092
3105
  TypeID: string | null;
3093
3106
 
3094
3107
  @Field({ nullable: true })
3095
- Status: string | null;
3108
+ Status?: string;
3096
3109
 
3097
3110
  @Field({ nullable: true })
3098
3111
  DriverClass: string | null;
@@ -3165,6 +3178,15 @@ export class CreateMJAIAgentInput {
3165
3178
 
3166
3179
  @Field({ nullable: true })
3167
3180
  InvocationMode?: string;
3181
+
3182
+ @Field({ nullable: true })
3183
+ ArtifactCreationMode?: string;
3184
+
3185
+ @Field({ nullable: true })
3186
+ FunctionalRequirements: string | null;
3187
+
3188
+ @Field({ nullable: true })
3189
+ TechnicalDesign: string | null;
3168
3190
  }
3169
3191
 
3170
3192
 
@@ -3213,7 +3235,7 @@ export class UpdateMJAIAgentInput {
3213
3235
  TypeID?: string | null;
3214
3236
 
3215
3237
  @Field({ nullable: true })
3216
- Status?: string | null;
3238
+ Status?: string;
3217
3239
 
3218
3240
  @Field({ nullable: true })
3219
3241
  DriverClass?: string | null;
@@ -3287,6 +3309,15 @@ export class UpdateMJAIAgentInput {
3287
3309
  @Field({ nullable: true })
3288
3310
  InvocationMode?: string;
3289
3311
 
3312
+ @Field({ nullable: true })
3313
+ ArtifactCreationMode?: string;
3314
+
3315
+ @Field({ nullable: true })
3316
+ FunctionalRequirements?: string | null;
3317
+
3318
+ @Field({ nullable: true })
3319
+ TechnicalDesign?: string | null;
3320
+
3290
3321
  @Field(() => [KeyValuePairInput], { nullable: true })
3291
3322
  OldValues___?: KeyValuePairInput[];
3292
3323
  }
@@ -3437,6 +3468,17 @@ export class MJAIAgentResolver extends ResolverBase {
3437
3468
  return result;
3438
3469
  }
3439
3470
 
3471
+ @FieldResolver(() => [MJAIAgentDataSource_])
3472
+ async MJ_AIAgentDataSources_AgentIDArray(@Root() mjaiagent_: MJAIAgent_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
3473
+ this.CheckUserReadPermissions('MJ: AI Agent Data Sources', userPayload);
3474
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3475
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
3476
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentDataSources] WHERE [AgentID]='${mjaiagent_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Data Sources', userPayload, EntityPermissionType.Read, 'AND');
3477
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
3478
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Data Sources', rows);
3479
+ return result;
3480
+ }
3481
+
3440
3482
  @FieldResolver(() => [MJAIAgentNote_])
3441
3483
  async AIAgentNotes_AgentIDArray(@Root() mjaiagent_: MJAIAgent_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
3442
3484
  this.CheckUserReadPermissions('AI Agent Notes', userPayload);
@@ -5114,6 +5156,212 @@ export class MJEnvironmentResolver extends ResolverBase {
5114
5156
 
5115
5157
  }
5116
5158
 
5159
+ //****************************************************************************
5160
+ // ENTITY CLASS for MJ: Artifact Permissions
5161
+ //****************************************************************************
5162
+ @ObjectType({ description: `Manages user permissions for artifacts with granular access control (Read, Edit, Delete, Share)` })
5163
+ export class MJArtifactPermission_ {
5164
+ @Field()
5165
+ @MaxLength(16)
5166
+ ID: string;
5167
+
5168
+ @Field()
5169
+ @MaxLength(16)
5170
+ ArtifactID: string;
5171
+
5172
+ @Field()
5173
+ @MaxLength(16)
5174
+ UserID: string;
5175
+
5176
+ @Field(() => Boolean, {description: `Whether the user can view/read the artifact`})
5177
+ CanRead: boolean;
5178
+
5179
+ @Field(() => Boolean, {description: `Whether the user can modify the artifact or create new versions`})
5180
+ CanEdit: boolean;
5181
+
5182
+ @Field(() => Boolean, {description: `Whether the user can delete the artifact`})
5183
+ CanDelete: boolean;
5184
+
5185
+ @Field(() => Boolean, {description: `Whether the user can share the artifact with other users`})
5186
+ CanShare: boolean;
5187
+
5188
+ @Field({nullable: true, description: `Foreign key to the User who shared this artifact (if shared)`})
5189
+ @MaxLength(16)
5190
+ SharedByUserID?: string;
5191
+
5192
+ @Field()
5193
+ @MaxLength(10)
5194
+ _mj__CreatedAt: Date;
5195
+
5196
+ @Field()
5197
+ @MaxLength(10)
5198
+ _mj__UpdatedAt: Date;
5199
+
5200
+ @Field()
5201
+ @MaxLength(510)
5202
+ Artifact: string;
5203
+
5204
+ @Field()
5205
+ @MaxLength(200)
5206
+ User: string;
5207
+
5208
+ @Field({nullable: true})
5209
+ @MaxLength(200)
5210
+ SharedByUser?: string;
5211
+
5212
+ }
5213
+
5214
+ //****************************************************************************
5215
+ // INPUT TYPE for MJ: Artifact Permissions
5216
+ //****************************************************************************
5217
+ @InputType()
5218
+ export class CreateMJArtifactPermissionInput {
5219
+ @Field({ nullable: true })
5220
+ ID?: string;
5221
+
5222
+ @Field({ nullable: true })
5223
+ ArtifactID?: string;
5224
+
5225
+ @Field({ nullable: true })
5226
+ UserID?: string;
5227
+
5228
+ @Field(() => Boolean, { nullable: true })
5229
+ CanRead?: boolean;
5230
+
5231
+ @Field(() => Boolean, { nullable: true })
5232
+ CanEdit?: boolean;
5233
+
5234
+ @Field(() => Boolean, { nullable: true })
5235
+ CanDelete?: boolean;
5236
+
5237
+ @Field(() => Boolean, { nullable: true })
5238
+ CanShare?: boolean;
5239
+
5240
+ @Field({ nullable: true })
5241
+ SharedByUserID: string | null;
5242
+ }
5243
+
5244
+
5245
+ //****************************************************************************
5246
+ // INPUT TYPE for MJ: Artifact Permissions
5247
+ //****************************************************************************
5248
+ @InputType()
5249
+ export class UpdateMJArtifactPermissionInput {
5250
+ @Field()
5251
+ ID: string;
5252
+
5253
+ @Field({ nullable: true })
5254
+ ArtifactID?: string;
5255
+
5256
+ @Field({ nullable: true })
5257
+ UserID?: string;
5258
+
5259
+ @Field(() => Boolean, { nullable: true })
5260
+ CanRead?: boolean;
5261
+
5262
+ @Field(() => Boolean, { nullable: true })
5263
+ CanEdit?: boolean;
5264
+
5265
+ @Field(() => Boolean, { nullable: true })
5266
+ CanDelete?: boolean;
5267
+
5268
+ @Field(() => Boolean, { nullable: true })
5269
+ CanShare?: boolean;
5270
+
5271
+ @Field({ nullable: true })
5272
+ SharedByUserID?: string | null;
5273
+
5274
+ @Field(() => [KeyValuePairInput], { nullable: true })
5275
+ OldValues___?: KeyValuePairInput[];
5276
+ }
5277
+
5278
+ //****************************************************************************
5279
+ // RESOLVER for MJ: Artifact Permissions
5280
+ //****************************************************************************
5281
+ @ObjectType()
5282
+ export class RunMJArtifactPermissionViewResult {
5283
+ @Field(() => [MJArtifactPermission_])
5284
+ Results: MJArtifactPermission_[];
5285
+
5286
+ @Field(() => String, {nullable: true})
5287
+ UserViewRunID?: string;
5288
+
5289
+ @Field(() => Int, {nullable: true})
5290
+ RowCount: number;
5291
+
5292
+ @Field(() => Int, {nullable: true})
5293
+ TotalRowCount: number;
5294
+
5295
+ @Field(() => Int, {nullable: true})
5296
+ ExecutionTime: number;
5297
+
5298
+ @Field({nullable: true})
5299
+ ErrorMessage?: string;
5300
+
5301
+ @Field(() => Boolean, {nullable: false})
5302
+ Success: boolean;
5303
+ }
5304
+
5305
+ @Resolver(MJArtifactPermission_)
5306
+ export class MJArtifactPermissionResolver extends ResolverBase {
5307
+ @Query(() => RunMJArtifactPermissionViewResult)
5308
+ async RunMJArtifactPermissionViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
5309
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5310
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
5311
+ }
5312
+
5313
+ @Query(() => RunMJArtifactPermissionViewResult)
5314
+ async RunMJArtifactPermissionViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
5315
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5316
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
5317
+ }
5318
+
5319
+ @Query(() => RunMJArtifactPermissionViewResult)
5320
+ async RunMJArtifactPermissionDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
5321
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5322
+ input.EntityName = 'MJ: Artifact Permissions';
5323
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
5324
+ }
5325
+ @Query(() => MJArtifactPermission_, { nullable: true })
5326
+ async MJArtifactPermission(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJArtifactPermission_ | null> {
5327
+ this.CheckUserReadPermissions('MJ: Artifact Permissions', userPayload);
5328
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5329
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
5330
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwArtifactPermissions] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
5331
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
5332
+ const result = this.MapFieldNamesToCodeNames('MJ: Artifact Permissions', rows && rows.length > 0 ? rows[0] : {})
5333
+ return result;
5334
+ }
5335
+
5336
+ @Mutation(() => MJArtifactPermission_)
5337
+ async CreateMJArtifactPermission(
5338
+ @Arg('input', () => CreateMJArtifactPermissionInput) input: CreateMJArtifactPermissionInput,
5339
+ @Ctx() { providers, userPayload }: AppContext,
5340
+ @PubSub() pubSub: PubSubEngine
5341
+ ) {
5342
+ const provider = GetReadWriteProvider(providers);
5343
+ return this.CreateRecord('MJ: Artifact Permissions', input, provider, userPayload, pubSub)
5344
+ }
5345
+
5346
+ @Mutation(() => MJArtifactPermission_)
5347
+ async UpdateMJArtifactPermission(
5348
+ @Arg('input', () => UpdateMJArtifactPermissionInput) input: UpdateMJArtifactPermissionInput,
5349
+ @Ctx() { providers, userPayload }: AppContext,
5350
+ @PubSub() pubSub: PubSubEngine
5351
+ ) {
5352
+ const provider = GetReadWriteProvider(providers);
5353
+ return this.UpdateRecord('MJ: Artifact Permissions', input, provider, userPayload, pubSub);
5354
+ }
5355
+
5356
+ @Mutation(() => MJArtifactPermission_)
5357
+ async DeleteMJArtifactPermission(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
5358
+ const provider = GetReadWriteProvider(providers);
5359
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
5360
+ return this.DeleteRecord('MJ: Artifact Permissions', key, options, provider, userPayload, pubSub);
5361
+ }
5362
+
5363
+ }
5364
+
5117
5365
  //****************************************************************************
5118
5366
  // ENTITY CLASS for AI Agent Actions
5119
5367
  //****************************************************************************
@@ -6535,12 +6783,12 @@ export class MJAIPrompt_ {
6535
6783
  @Field(() => [MJAIPrompt_])
6536
6784
  AIPrompts_ResultSelectorPromptIDArray: MJAIPrompt_[]; // Link to AIPrompts
6537
6785
 
6538
- @Field(() => [MJAIPromptModel_])
6539
- MJ_AIPromptModels_PromptIDArray: MJAIPromptModel_[]; // Link to MJ_AIPromptModels
6540
-
6541
6786
  @Field(() => [MJAIAgentPrompt_])
6542
6787
  MJ_AIAgentPrompts_PromptIDArray: MJAIAgentPrompt_[]; // Link to MJ_AIAgentPrompts
6543
6788
 
6789
+ @Field(() => [MJAIPromptModel_])
6790
+ MJ_AIPromptModels_PromptIDArray: MJAIPromptModel_[]; // Link to MJ_AIPromptModels
6791
+
6544
6792
  @Field(() => [MJAIAgentStep_])
6545
6793
  MJ_AIAgentSteps_PromptIDArray: MJAIAgentStep_[]; // Link to MJ_AIAgentSteps
6546
6794
 
@@ -6989,25 +7237,25 @@ export class MJAIPromptResolver extends ResolverBase {
6989
7237
  return result;
6990
7238
  }
6991
7239
 
6992
- @FieldResolver(() => [MJAIPromptModel_])
6993
- async MJ_AIPromptModels_PromptIDArray(@Root() mjaiprompt_: MJAIPrompt_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
6994
- this.CheckUserReadPermissions('MJ: AI Prompt Models', userPayload);
7240
+ @FieldResolver(() => [MJAIAgentPrompt_])
7241
+ async MJ_AIAgentPrompts_PromptIDArray(@Root() mjaiprompt_: MJAIPrompt_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
7242
+ this.CheckUserReadPermissions('MJ: AI Agent Prompts', userPayload);
6995
7243
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
6996
7244
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
6997
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptModels] WHERE [PromptID]='${mjaiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Models', userPayload, EntityPermissionType.Read, 'AND');
7245
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentPrompts] WHERE [PromptID]='${mjaiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Prompts', userPayload, EntityPermissionType.Read, 'AND');
6998
7246
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
6999
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Models', rows);
7247
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Prompts', rows);
7000
7248
  return result;
7001
7249
  }
7002
7250
 
7003
- @FieldResolver(() => [MJAIAgentPrompt_])
7004
- async MJ_AIAgentPrompts_PromptIDArray(@Root() mjaiprompt_: MJAIPrompt_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
7005
- this.CheckUserReadPermissions('MJ: AI Agent Prompts', userPayload);
7251
+ @FieldResolver(() => [MJAIPromptModel_])
7252
+ async MJ_AIPromptModels_PromptIDArray(@Root() mjaiprompt_: MJAIPrompt_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
7253
+ this.CheckUserReadPermissions('MJ: AI Prompt Models', userPayload);
7006
7254
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
7007
7255
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
7008
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentPrompts] WHERE [PromptID]='${mjaiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Prompts', userPayload, EntityPermissionType.Read, 'AND');
7256
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptModels] WHERE [PromptID]='${mjaiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Models', userPayload, EntityPermissionType.Read, 'AND');
7009
7257
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
7010
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Prompts', rows);
7258
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Models', rows);
7011
7259
  return result;
7012
7260
  }
7013
7261
 
@@ -10996,12 +11244,12 @@ export class MJEntity_ {
10996
11244
  @Field(() => [MJQueryEntity_])
10997
11245
  QueryEntities_EntityIDArray: MJQueryEntity_[]; // Link to QueryEntities
10998
11246
 
10999
- @Field(() => [MJRecordLink_])
11000
- MJ_RecordLinks_SourceEntityIDArray: MJRecordLink_[]; // Link to MJ_RecordLinks
11001
-
11002
11247
  @Field(() => [MJAccessControlRule_])
11003
11248
  MJ_AccessControlRules_EntityIDArray: MJAccessControlRule_[]; // Link to MJ_AccessControlRules
11004
11249
 
11250
+ @Field(() => [MJRecordLink_])
11251
+ MJ_RecordLinks_SourceEntityIDArray: MJRecordLink_[]; // Link to MJ_RecordLinks
11252
+
11005
11253
  @Field(() => [MJGeneratedCode_])
11006
11254
  GeneratedCodes_LinkedEntityIDArray: MJGeneratedCode_[]; // Link to GeneratedCodes
11007
11255
 
@@ -11809,25 +12057,25 @@ export class MJEntityResolverBase extends ResolverBase {
11809
12057
  return result;
11810
12058
  }
11811
12059
 
11812
- @FieldResolver(() => [MJRecordLink_])
11813
- async MJ_RecordLinks_SourceEntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
11814
- this.CheckUserReadPermissions('MJ: Record Links', userPayload);
12060
+ @FieldResolver(() => [MJAccessControlRule_])
12061
+ async MJ_AccessControlRules_EntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
12062
+ this.CheckUserReadPermissions('MJ: Access Control Rules', userPayload);
11815
12063
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
11816
12064
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
11817
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwRecordLinks] WHERE [SourceEntityID]='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Record Links', userPayload, EntityPermissionType.Read, 'AND');
12065
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAccessControlRules] WHERE [EntityID]='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Access Control Rules', userPayload, EntityPermissionType.Read, 'AND');
11818
12066
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
11819
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Record Links', rows);
12067
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Access Control Rules', rows);
11820
12068
  return result;
11821
12069
  }
11822
12070
 
11823
- @FieldResolver(() => [MJAccessControlRule_])
11824
- async MJ_AccessControlRules_EntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
11825
- this.CheckUserReadPermissions('MJ: Access Control Rules', userPayload);
12071
+ @FieldResolver(() => [MJRecordLink_])
12072
+ async MJ_RecordLinks_SourceEntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
12073
+ this.CheckUserReadPermissions('MJ: Record Links', userPayload);
11826
12074
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
11827
12075
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
11828
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAccessControlRules] WHERE [EntityID]='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Access Control Rules', userPayload, EntityPermissionType.Read, 'AND');
12076
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwRecordLinks] WHERE [SourceEntityID]='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Record Links', userPayload, EntityPermissionType.Read, 'AND');
11829
12077
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
11830
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Access Control Rules', rows);
12078
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Record Links', rows);
11831
12079
  return result;
11832
12080
  }
11833
12081
 
@@ -11942,6 +12190,13 @@ export class MJUser_ {
11942
12190
  @MaxLength(10)
11943
12191
  _mj__UpdatedAt: Date;
11944
12192
 
12193
+ @Field({nullable: true, description: `User avatar image. Can be a Base64 encoded data URI (e.g., "data:image/png;base64,...") or a URL to an image file. Preferred over UserImageIconClass when present. Recommended for small thumbnail images only to maintain performance.`})
12194
+ UserImageURL?: string;
12195
+
12196
+ @Field({nullable: true, description: `Font Awesome icon class for user avatar (e.g., "fa-solid fa-user-astronaut"). Used as fallback when UserImageURL is not provided. Example classes: "fa-solid fa-user", "fa-regular fa-circle-user", "fa-solid fa-user-tie".`})
12197
+ @MaxLength(200)
12198
+ UserImageIconClass?: string;
12199
+
11945
12200
  @Field({nullable: true})
11946
12201
  @MaxLength(202)
11947
12202
  FirstLast?: string;
@@ -12074,23 +12329,26 @@ export class MJUser_ {
12074
12329
  @Field(() => [MJReportUserState_])
12075
12330
  MJ_ReportUserStates_UserIDArray: MJReportUserState_[]; // Link to MJ_ReportUserStates
12076
12331
 
12077
- @Field(() => [MJDashboardUserPreference_])
12078
- MJ_DashboardUserPreferences_UserIDArray: MJDashboardUserPreference_[]; // Link to MJ_DashboardUserPreferences
12079
-
12080
12332
  @Field(() => [MJDashboardUserState_])
12081
12333
  MJ_DashboardUserStates_UserIDArray: MJDashboardUserState_[]; // Link to MJ_DashboardUserStates
12082
12334
 
12335
+ @Field(() => [MJDashboardUserPreference_])
12336
+ MJ_DashboardUserPreferences_UserIDArray: MJDashboardUserPreference_[]; // Link to MJ_DashboardUserPreferences
12337
+
12083
12338
  @Field(() => [MJArtifactVersion_])
12084
12339
  MJ_ArtifactVersions_UserIDArray: MJArtifactVersion_[]; // Link to MJ_ArtifactVersions
12085
12340
 
12086
12341
  @Field(() => [MJPublicLink_])
12087
12342
  MJ_PublicLinks_UserIDArray: MJPublicLink_[]; // Link to MJ_PublicLinks
12088
12343
 
12344
+ @Field(() => [MJScheduledJob_])
12345
+ MJ_ScheduledJobs_NotifyUserIDArray: MJScheduledJob_[]; // Link to MJ_ScheduledJobs
12346
+
12089
12347
  @Field(() => [MJScheduledJobRun_])
12090
12348
  MJ_ScheduledJobRuns_ExecutedByUserIDArray: MJScheduledJobRun_[]; // Link to MJ_ScheduledJobRuns
12091
12349
 
12092
- @Field(() => [MJScheduledJob_])
12093
- MJ_ScheduledJobs_NotifyUserIDArray: MJScheduledJob_[]; // Link to MJ_ScheduledJobs
12350
+ @Field(() => [MJArtifactPermission_])
12351
+ MJ_ArtifactPermissions_UserIDArray: MJArtifactPermission_[]; // Link to MJ_ArtifactPermissions
12094
12352
 
12095
12353
  @Field(() => [MJResourcePermission_])
12096
12354
  ResourcePermissions_UserIDArray: MJResourcePermission_[]; // Link to ResourcePermissions
@@ -12113,18 +12371,21 @@ export class MJUser_ {
12113
12371
  @Field(() => [MJCollectionPermission_])
12114
12372
  MJ_CollectionPermissions_SharedByUserIDArray: MJCollectionPermission_[]; // Link to MJ_CollectionPermissions
12115
12373
 
12374
+ @Field(() => [MJArtifactPermission_])
12375
+ MJ_ArtifactPermissions_SharedByUserIDArray: MJArtifactPermission_[]; // Link to MJ_ArtifactPermissions
12376
+
12116
12377
  @Field(() => [MJAIAgentRun_])
12117
12378
  MJ_AIAgentRuns_UserIDArray: MJAIAgentRun_[]; // Link to MJ_AIAgentRuns
12118
12379
 
12119
12380
  @Field(() => [MJAIAgentPermission_])
12120
12381
  MJ_AIAgentPermissions_UserIDArray: MJAIAgentPermission_[]; // Link to MJ_AIAgentPermissions
12121
12382
 
12122
- @Field(() => [MJCollectionPermission_])
12123
- MJ_CollectionPermissions_UserIDArray: MJCollectionPermission_[]; // Link to MJ_CollectionPermissions
12124
-
12125
12383
  @Field(() => [MJCollection_])
12126
12384
  MJ_Collections_OwnerIDArray: MJCollection_[]; // Link to MJ_Collections
12127
12385
 
12386
+ @Field(() => [MJCollectionPermission_])
12387
+ MJ_CollectionPermissions_UserIDArray: MJCollectionPermission_[]; // Link to MJ_CollectionPermissions
12388
+
12128
12389
  @Field(() => [MJTask_])
12129
12390
  MJ_Tasks_UserIDArray: MJTask_[]; // Link to MJ_Tasks
12130
12391
 
@@ -12173,6 +12434,12 @@ export class CreateMJUserInput {
12173
12434
 
12174
12435
  @Field({ nullable: true })
12175
12436
  EmployeeID: string | null;
12437
+
12438
+ @Field({ nullable: true })
12439
+ UserImageURL: string | null;
12440
+
12441
+ @Field({ nullable: true })
12442
+ UserImageIconClass: string | null;
12176
12443
  }
12177
12444
 
12178
12445
 
@@ -12217,6 +12484,12 @@ export class UpdateMJUserInput {
12217
12484
  @Field({ nullable: true })
12218
12485
  EmployeeID?: string | null;
12219
12486
 
12487
+ @Field({ nullable: true })
12488
+ UserImageURL?: string | null;
12489
+
12490
+ @Field({ nullable: true })
12491
+ UserImageIconClass?: string | null;
12492
+
12220
12493
  @Field(() => [KeyValuePairInput], { nullable: true })
12221
12494
  OldValues___?: KeyValuePairInput[];
12222
12495
  }
@@ -12686,25 +12959,25 @@ export class MJUserResolverBase extends ResolverBase {
12686
12959
  return result;
12687
12960
  }
12688
12961
 
12689
- @FieldResolver(() => [MJDashboardUserPreference_])
12690
- async MJ_DashboardUserPreferences_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
12691
- this.CheckUserReadPermissions('MJ: Dashboard User Preferences', userPayload);
12962
+ @FieldResolver(() => [MJDashboardUserState_])
12963
+ async MJ_DashboardUserStates_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
12964
+ this.CheckUserReadPermissions('MJ: Dashboard User States', userPayload);
12692
12965
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
12693
12966
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
12694
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwDashboardUserPreferences] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Dashboard User Preferences', userPayload, EntityPermissionType.Read, 'AND');
12967
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwDashboardUserStates] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Dashboard User States', userPayload, EntityPermissionType.Read, 'AND');
12695
12968
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
12696
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Dashboard User Preferences', rows);
12969
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Dashboard User States', rows);
12697
12970
  return result;
12698
12971
  }
12699
12972
 
12700
- @FieldResolver(() => [MJDashboardUserState_])
12701
- async MJ_DashboardUserStates_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
12702
- this.CheckUserReadPermissions('MJ: Dashboard User States', userPayload);
12973
+ @FieldResolver(() => [MJDashboardUserPreference_])
12974
+ async MJ_DashboardUserPreferences_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
12975
+ this.CheckUserReadPermissions('MJ: Dashboard User Preferences', userPayload);
12703
12976
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
12704
12977
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
12705
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwDashboardUserStates] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Dashboard User States', userPayload, EntityPermissionType.Read, 'AND');
12978
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwDashboardUserPreferences] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Dashboard User Preferences', userPayload, EntityPermissionType.Read, 'AND');
12706
12979
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
12707
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Dashboard User States', rows);
12980
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Dashboard User Preferences', rows);
12708
12981
  return result;
12709
12982
  }
12710
12983
 
@@ -12730,6 +13003,17 @@ export class MJUserResolverBase extends ResolverBase {
12730
13003
  return result;
12731
13004
  }
12732
13005
 
13006
+ @FieldResolver(() => [MJScheduledJob_])
13007
+ async MJ_ScheduledJobs_NotifyUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
13008
+ this.CheckUserReadPermissions('MJ: Scheduled Jobs', userPayload);
13009
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
13010
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
13011
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobs] WHERE [NotifyUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Jobs', userPayload, EntityPermissionType.Read, 'AND');
13012
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
13013
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Jobs', rows);
13014
+ return result;
13015
+ }
13016
+
12733
13017
  @FieldResolver(() => [MJScheduledJobRun_])
12734
13018
  async MJ_ScheduledJobRuns_ExecutedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
12735
13019
  this.CheckUserReadPermissions('MJ: Scheduled Job Runs', userPayload);
@@ -12741,14 +13025,14 @@ export class MJUserResolverBase extends ResolverBase {
12741
13025
  return result;
12742
13026
  }
12743
13027
 
12744
- @FieldResolver(() => [MJScheduledJob_])
12745
- async MJ_ScheduledJobs_NotifyUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
12746
- this.CheckUserReadPermissions('MJ: Scheduled Jobs', userPayload);
13028
+ @FieldResolver(() => [MJArtifactPermission_])
13029
+ async MJ_ArtifactPermissions_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
13030
+ this.CheckUserReadPermissions('MJ: Artifact Permissions', userPayload);
12747
13031
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
12748
13032
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
12749
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobs] WHERE [NotifyUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Jobs', userPayload, EntityPermissionType.Read, 'AND');
13033
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwArtifactPermissions] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
12750
13034
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
12751
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Jobs', rows);
13035
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Artifact Permissions', rows);
12752
13036
  return result;
12753
13037
  }
12754
13038
 
@@ -12829,6 +13113,17 @@ export class MJUserResolverBase extends ResolverBase {
12829
13113
  return result;
12830
13114
  }
12831
13115
 
13116
+ @FieldResolver(() => [MJArtifactPermission_])
13117
+ async MJ_ArtifactPermissions_SharedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
13118
+ this.CheckUserReadPermissions('MJ: Artifact Permissions', userPayload);
13119
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
13120
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
13121
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwArtifactPermissions] WHERE [SharedByUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
13122
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
13123
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Artifact Permissions', rows);
13124
+ return result;
13125
+ }
13126
+
12832
13127
  @FieldResolver(() => [MJAIAgentRun_])
12833
13128
  async MJ_AIAgentRuns_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
12834
13129
  this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
@@ -12851,25 +13146,25 @@ export class MJUserResolverBase extends ResolverBase {
12851
13146
  return result;
12852
13147
  }
12853
13148
 
12854
- @FieldResolver(() => [MJCollectionPermission_])
12855
- async MJ_CollectionPermissions_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
12856
- this.CheckUserReadPermissions('MJ: Collection Permissions', userPayload);
13149
+ @FieldResolver(() => [MJCollection_])
13150
+ async MJ_Collections_OwnerIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
13151
+ this.CheckUserReadPermissions('MJ: Collections', userPayload);
12857
13152
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
12858
13153
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
12859
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollectionPermissions] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collection Permissions', userPayload, EntityPermissionType.Read, 'AND');
13154
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollections] WHERE [OwnerID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collections', userPayload, EntityPermissionType.Read, 'AND');
12860
13155
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
12861
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collection Permissions', rows);
13156
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collections', rows);
12862
13157
  return result;
12863
13158
  }
12864
13159
 
12865
- @FieldResolver(() => [MJCollection_])
12866
- async MJ_Collections_OwnerIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
12867
- this.CheckUserReadPermissions('MJ: Collections', userPayload);
13160
+ @FieldResolver(() => [MJCollectionPermission_])
13161
+ async MJ_CollectionPermissions_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
13162
+ this.CheckUserReadPermissions('MJ: Collection Permissions', userPayload);
12868
13163
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
12869
13164
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
12870
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollections] WHERE [OwnerID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collections', userPayload, EntityPermissionType.Read, 'AND');
13165
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollectionPermissions] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collection Permissions', userPayload, EntityPermissionType.Read, 'AND');
12871
13166
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
12872
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collections', rows);
13167
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collection Permissions', rows);
12873
13168
  return result;
12874
13169
  }
12875
13170
 
@@ -34145,6 +34440,9 @@ export class MJCommunicationProvider_ {
34145
34440
  @Field(() => Boolean, {description: `Whether or not the provider supports replying to messages`})
34146
34441
  SupportsReplying: boolean;
34147
34442
 
34443
+ @Field(() => Boolean, {description: `Whether or not the provider supports creating draft messages`})
34444
+ SupportsDrafts: boolean;
34445
+
34148
34446
  @Field(() => [MJCommunicationProviderMessageType_])
34149
34447
  CommunicationProviderMessageTypes_CommunicationProviderIDArray: MJCommunicationProviderMessageType_[]; // Link to CommunicationProviderMessageTypes
34150
34448
 
@@ -34184,6 +34482,9 @@ export class CreateMJCommunicationProviderInput {
34184
34482
 
34185
34483
  @Field(() => Boolean, { nullable: true })
34186
34484
  SupportsReplying?: boolean;
34485
+
34486
+ @Field(() => Boolean, { nullable: true })
34487
+ SupportsDrafts?: boolean;
34187
34488
  }
34188
34489
 
34189
34490
 
@@ -34219,6 +34520,9 @@ export class UpdateMJCommunicationProviderInput {
34219
34520
  @Field(() => Boolean, { nullable: true })
34220
34521
  SupportsReplying?: boolean;
34221
34522
 
34523
+ @Field(() => Boolean, { nullable: true })
34524
+ SupportsDrafts?: boolean;
34525
+
34222
34526
  @Field(() => [KeyValuePairInput], { nullable: true })
34223
34527
  OldValues___?: KeyValuePairInput[];
34224
34528
  }
@@ -41555,6 +41859,10 @@ export class MJArtifact_ {
41555
41859
  @MaxLength(10)
41556
41860
  _mj__UpdatedAt: Date;
41557
41861
 
41862
+ @Field({description: `Controls artifact visibility in user-facing lists. "Always" shows in all lists, "System Only" hides from normal views (for system-generated artifacts like agent routing payloads).`})
41863
+ @MaxLength(40)
41864
+ Visibility: string;
41865
+
41558
41866
  @Field()
41559
41867
  @MaxLength(510)
41560
41868
  Environment: string;
@@ -41573,6 +41881,9 @@ export class MJArtifact_ {
41573
41881
  @Field(() => [MJCollectionArtifact_])
41574
41882
  MJ_CollectionArtifacts_ArtifactIDArray: MJCollectionArtifact_[]; // Link to MJ_CollectionArtifacts
41575
41883
 
41884
+ @Field(() => [MJArtifactPermission_])
41885
+ MJ_ArtifactPermissions_ArtifactIDArray: MJArtifactPermission_[]; // Link to MJ_ArtifactPermissions
41886
+
41576
41887
  }
41577
41888
 
41578
41889
  //****************************************************************************
@@ -41600,6 +41911,9 @@ export class CreateMJArtifactInput {
41600
41911
 
41601
41912
  @Field({ nullable: true })
41602
41913
  UserID?: string;
41914
+
41915
+ @Field({ nullable: true })
41916
+ Visibility?: string;
41603
41917
  }
41604
41918
 
41605
41919
 
@@ -41629,6 +41943,9 @@ export class UpdateMJArtifactInput {
41629
41943
  @Field({ nullable: true })
41630
41944
  UserID?: string;
41631
41945
 
41946
+ @Field({ nullable: true })
41947
+ Visibility?: string;
41948
+
41632
41949
  @Field(() => [KeyValuePairInput], { nullable: true })
41633
41950
  OldValues___?: KeyValuePairInput[];
41634
41951
  }
@@ -41713,6 +42030,17 @@ export class MJArtifactResolver extends ResolverBase {
41713
42030
  return result;
41714
42031
  }
41715
42032
 
42033
+ @FieldResolver(() => [MJArtifactPermission_])
42034
+ async MJ_ArtifactPermissions_ArtifactIDArray(@Root() mjartifact_: MJArtifact_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
42035
+ this.CheckUserReadPermissions('MJ: Artifact Permissions', userPayload);
42036
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
42037
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
42038
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwArtifactPermissions] WHERE [ArtifactID]='${mjartifact_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
42039
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
42040
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Artifact Permissions', rows);
42041
+ return result;
42042
+ }
42043
+
41716
42044
  @Mutation(() => MJArtifact_)
41717
42045
  async CreateMJArtifact(
41718
42046
  @Arg('input', () => CreateMJArtifactInput) input: CreateMJArtifactInput,
@@ -50061,4 +50389,319 @@ export class MJArtifactVersionAttributeResolver extends ResolverBase {
50061
50389
  return this.DeleteRecord('MJ: Artifact Version Attributes', key, options, provider, userPayload, pubSub);
50062
50390
  }
50063
50391
 
50392
+ }
50393
+
50394
+ //****************************************************************************
50395
+ // ENTITY CLASS for MJ: AI Agent Data Sources
50396
+ //****************************************************************************
50397
+ @ObjectType({ description: `Defines data sources that should be preloaded into the data parameter before agent execution. Supports both RunView and RunQuery sources with configurable caching.` })
50398
+ export class MJAIAgentDataSource_ {
50399
+ @Field()
50400
+ @MaxLength(16)
50401
+ ID: string;
50402
+
50403
+ @Field()
50404
+ @MaxLength(16)
50405
+ AgentID: string;
50406
+
50407
+ @Field({description: `Variable name for the data in the data parameter (e.g., "ALL_ENTITIES"). Must be unique within an agent.`})
50408
+ @MaxLength(510)
50409
+ Name: string;
50410
+
50411
+ @Field({nullable: true, description: `Description of what this data source provides`})
50412
+ Description?: string;
50413
+
50414
+ @Field({description: `Type of data source: RunView or RunQuery. Determines which parameters are used.`})
50415
+ @MaxLength(40)
50416
+ SourceType: string;
50417
+
50418
+ @Field({nullable: true, description: `Entity name for RunView data sources (e.g., "Entities", "AI Models")`})
50419
+ @MaxLength(510)
50420
+ EntityName?: string;
50421
+
50422
+ @Field({nullable: true, description: `SQL WHERE clause filter for RunView data sources`})
50423
+ ExtraFilter?: string;
50424
+
50425
+ @Field({nullable: true, description: `SQL ORDER BY clause for RunView data sources`})
50426
+ @MaxLength(1000)
50427
+ OrderBy?: string;
50428
+
50429
+ @Field({nullable: true, description: `JSON array of field names to return for RunView data sources (e.g., ["ID", "Name", "Description"])`})
50430
+ FieldsToRetrieve?: string;
50431
+
50432
+ @Field({nullable: true, description: `Result type for RunView: simple (default) or entity_object`})
50433
+ @MaxLength(40)
50434
+ ResultType?: string;
50435
+
50436
+ @Field({nullable: true, description: `Query name for RunQuery data sources`})
50437
+ @MaxLength(510)
50438
+ QueryName?: string;
50439
+
50440
+ @Field({nullable: true, description: `Category path for RunQuery data sources (e.g., "/MJ/AI/Agents/")`})
50441
+ @MaxLength(1000)
50442
+ CategoryPath?: string;
50443
+
50444
+ @Field({nullable: true, description: `JSON object of parameters for RunQuery data sources (e.g., {"organizationId": "123"})`})
50445
+ Parameters?: string;
50446
+
50447
+ @Field(() => Int, {nullable: true, description: `Maximum number of rows to return. Applies to both RunView and RunQuery.`})
50448
+ MaxRows?: number;
50449
+
50450
+ @Field(() => Int, {description: `Execution order when multiple data sources are defined for an agent (lower numbers execute first)`})
50451
+ ExecutionOrder: number;
50452
+
50453
+ @Field({description: `Status of the data source: Active or Disabled`})
50454
+ @MaxLength(40)
50455
+ Status: string;
50456
+
50457
+ @Field({description: `Cache policy: None (no caching), PerRun (cache for duration of agent run), PerAgent (cache across runs with timeout)`})
50458
+ @MaxLength(40)
50459
+ CachePolicy: string;
50460
+
50461
+ @Field(() => Int, {nullable: true, description: `Time-to-live in seconds for PerAgent cache policy. Ignored for other cache policies.`})
50462
+ CacheTimeoutSeconds?: number;
50463
+
50464
+ @Field({description: `Destination for the preloaded data: Data (for Nunjucks templates in prompts), Context (for actions only), or Payload (for agent state)`})
50465
+ @MaxLength(40)
50466
+ DestinationType: string;
50467
+
50468
+ @Field({nullable: true, description: `Path within the destination where data should be injected. Supports nested paths using dot notation (e.g., "config.api.endpoints", "analysis.orders.recent"). If null, uses Name as root-level key.`})
50469
+ @MaxLength(1000)
50470
+ DestinationPath?: string;
50471
+
50472
+ @Field()
50473
+ @MaxLength(10)
50474
+ _mj__CreatedAt: Date;
50475
+
50476
+ @Field()
50477
+ @MaxLength(10)
50478
+ _mj__UpdatedAt: Date;
50479
+
50480
+ @Field({nullable: true})
50481
+ @MaxLength(510)
50482
+ Agent?: string;
50483
+
50484
+ }
50485
+
50486
+ //****************************************************************************
50487
+ // INPUT TYPE for MJ: AI Agent Data Sources
50488
+ //****************************************************************************
50489
+ @InputType()
50490
+ export class CreateMJAIAgentDataSourceInput {
50491
+ @Field({ nullable: true })
50492
+ ID?: string;
50493
+
50494
+ @Field({ nullable: true })
50495
+ AgentID?: string;
50496
+
50497
+ @Field({ nullable: true })
50498
+ Name?: string;
50499
+
50500
+ @Field({ nullable: true })
50501
+ Description: string | null;
50502
+
50503
+ @Field({ nullable: true })
50504
+ SourceType?: string;
50505
+
50506
+ @Field({ nullable: true })
50507
+ EntityName: string | null;
50508
+
50509
+ @Field({ nullable: true })
50510
+ ExtraFilter: string | null;
50511
+
50512
+ @Field({ nullable: true })
50513
+ OrderBy: string | null;
50514
+
50515
+ @Field({ nullable: true })
50516
+ FieldsToRetrieve: string | null;
50517
+
50518
+ @Field({ nullable: true })
50519
+ ResultType?: string | null;
50520
+
50521
+ @Field({ nullable: true })
50522
+ QueryName: string | null;
50523
+
50524
+ @Field({ nullable: true })
50525
+ CategoryPath: string | null;
50526
+
50527
+ @Field({ nullable: true })
50528
+ Parameters: string | null;
50529
+
50530
+ @Field(() => Int, { nullable: true })
50531
+ MaxRows: number | null;
50532
+
50533
+ @Field(() => Int, { nullable: true })
50534
+ ExecutionOrder?: number;
50535
+
50536
+ @Field({ nullable: true })
50537
+ Status?: string;
50538
+
50539
+ @Field({ nullable: true })
50540
+ CachePolicy?: string;
50541
+
50542
+ @Field(() => Int, { nullable: true })
50543
+ CacheTimeoutSeconds: number | null;
50544
+
50545
+ @Field({ nullable: true })
50546
+ DestinationType?: string;
50547
+
50548
+ @Field({ nullable: true })
50549
+ DestinationPath: string | null;
50550
+ }
50551
+
50552
+
50553
+ //****************************************************************************
50554
+ // INPUT TYPE for MJ: AI Agent Data Sources
50555
+ //****************************************************************************
50556
+ @InputType()
50557
+ export class UpdateMJAIAgentDataSourceInput {
50558
+ @Field()
50559
+ ID: string;
50560
+
50561
+ @Field({ nullable: true })
50562
+ AgentID?: string;
50563
+
50564
+ @Field({ nullable: true })
50565
+ Name?: string;
50566
+
50567
+ @Field({ nullable: true })
50568
+ Description?: string | null;
50569
+
50570
+ @Field({ nullable: true })
50571
+ SourceType?: string;
50572
+
50573
+ @Field({ nullable: true })
50574
+ EntityName?: string | null;
50575
+
50576
+ @Field({ nullable: true })
50577
+ ExtraFilter?: string | null;
50578
+
50579
+ @Field({ nullable: true })
50580
+ OrderBy?: string | null;
50581
+
50582
+ @Field({ nullable: true })
50583
+ FieldsToRetrieve?: string | null;
50584
+
50585
+ @Field({ nullable: true })
50586
+ ResultType?: string | null;
50587
+
50588
+ @Field({ nullable: true })
50589
+ QueryName?: string | null;
50590
+
50591
+ @Field({ nullable: true })
50592
+ CategoryPath?: string | null;
50593
+
50594
+ @Field({ nullable: true })
50595
+ Parameters?: string | null;
50596
+
50597
+ @Field(() => Int, { nullable: true })
50598
+ MaxRows?: number | null;
50599
+
50600
+ @Field(() => Int, { nullable: true })
50601
+ ExecutionOrder?: number;
50602
+
50603
+ @Field({ nullable: true })
50604
+ Status?: string;
50605
+
50606
+ @Field({ nullable: true })
50607
+ CachePolicy?: string;
50608
+
50609
+ @Field(() => Int, { nullable: true })
50610
+ CacheTimeoutSeconds?: number | null;
50611
+
50612
+ @Field({ nullable: true })
50613
+ DestinationType?: string;
50614
+
50615
+ @Field({ nullable: true })
50616
+ DestinationPath?: string | null;
50617
+
50618
+ @Field(() => [KeyValuePairInput], { nullable: true })
50619
+ OldValues___?: KeyValuePairInput[];
50620
+ }
50621
+
50622
+ //****************************************************************************
50623
+ // RESOLVER for MJ: AI Agent Data Sources
50624
+ //****************************************************************************
50625
+ @ObjectType()
50626
+ export class RunMJAIAgentDataSourceViewResult {
50627
+ @Field(() => [MJAIAgentDataSource_])
50628
+ Results: MJAIAgentDataSource_[];
50629
+
50630
+ @Field(() => String, {nullable: true})
50631
+ UserViewRunID?: string;
50632
+
50633
+ @Field(() => Int, {nullable: true})
50634
+ RowCount: number;
50635
+
50636
+ @Field(() => Int, {nullable: true})
50637
+ TotalRowCount: number;
50638
+
50639
+ @Field(() => Int, {nullable: true})
50640
+ ExecutionTime: number;
50641
+
50642
+ @Field({nullable: true})
50643
+ ErrorMessage?: string;
50644
+
50645
+ @Field(() => Boolean, {nullable: false})
50646
+ Success: boolean;
50647
+ }
50648
+
50649
+ @Resolver(MJAIAgentDataSource_)
50650
+ export class MJAIAgentDataSourceResolver extends ResolverBase {
50651
+ @Query(() => RunMJAIAgentDataSourceViewResult)
50652
+ async RunMJAIAgentDataSourceViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
50653
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
50654
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
50655
+ }
50656
+
50657
+ @Query(() => RunMJAIAgentDataSourceViewResult)
50658
+ async RunMJAIAgentDataSourceViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
50659
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
50660
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
50661
+ }
50662
+
50663
+ @Query(() => RunMJAIAgentDataSourceViewResult)
50664
+ async RunMJAIAgentDataSourceDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
50665
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
50666
+ input.EntityName = 'MJ: AI Agent Data Sources';
50667
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
50668
+ }
50669
+ @Query(() => MJAIAgentDataSource_, { nullable: true })
50670
+ async MJAIAgentDataSource(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJAIAgentDataSource_ | null> {
50671
+ this.CheckUserReadPermissions('MJ: AI Agent Data Sources', userPayload);
50672
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
50673
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
50674
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentDataSources] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Data Sources', userPayload, EntityPermissionType.Read, 'AND');
50675
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
50676
+ const result = this.MapFieldNamesToCodeNames('MJ: AI Agent Data Sources', rows && rows.length > 0 ? rows[0] : {})
50677
+ return result;
50678
+ }
50679
+
50680
+ @Mutation(() => MJAIAgentDataSource_)
50681
+ async CreateMJAIAgentDataSource(
50682
+ @Arg('input', () => CreateMJAIAgentDataSourceInput) input: CreateMJAIAgentDataSourceInput,
50683
+ @Ctx() { providers, userPayload }: AppContext,
50684
+ @PubSub() pubSub: PubSubEngine
50685
+ ) {
50686
+ const provider = GetReadWriteProvider(providers);
50687
+ return this.CreateRecord('MJ: AI Agent Data Sources', input, provider, userPayload, pubSub)
50688
+ }
50689
+
50690
+ @Mutation(() => MJAIAgentDataSource_)
50691
+ async UpdateMJAIAgentDataSource(
50692
+ @Arg('input', () => UpdateMJAIAgentDataSourceInput) input: UpdateMJAIAgentDataSourceInput,
50693
+ @Ctx() { providers, userPayload }: AppContext,
50694
+ @PubSub() pubSub: PubSubEngine
50695
+ ) {
50696
+ const provider = GetReadWriteProvider(providers);
50697
+ return this.UpdateRecord('MJ: AI Agent Data Sources', input, provider, userPayload, pubSub);
50698
+ }
50699
+
50700
+ @Mutation(() => MJAIAgentDataSource_)
50701
+ async DeleteMJAIAgentDataSource(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
50702
+ const provider = GetReadWriteProvider(providers);
50703
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
50704
+ return this.DeleteRecord('MJ: AI Agent Data Sources', key, options, provider, userPayload, pubSub);
50705
+ }
50706
+
50064
50707
  }