@memberjunction/server 2.102.0 → 2.104.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 (35) hide show
  1. package/dist/agents/skip-agent.d.ts +29 -0
  2. package/dist/agents/skip-agent.d.ts.map +1 -0
  3. package/dist/agents/skip-agent.js +143 -0
  4. package/dist/agents/skip-agent.js.map +1 -0
  5. package/dist/agents/skip-sdk.d.ts +47 -0
  6. package/dist/agents/skip-sdk.d.ts.map +1 -0
  7. package/dist/agents/skip-sdk.js +270 -0
  8. package/dist/agents/skip-sdk.js.map +1 -0
  9. package/dist/config.d.ts +9 -0
  10. package/dist/config.d.ts.map +1 -1
  11. package/dist/config.js +1 -0
  12. package/dist/config.js.map +1 -1
  13. package/dist/generated/generated.d.ts +121 -16
  14. package/dist/generated/generated.d.ts.map +1 -1
  15. package/dist/generated/generated.js +829 -120
  16. package/dist/generated/generated.js.map +1 -1
  17. package/dist/resolvers/AskSkipResolver.d.ts.map +1 -1
  18. package/dist/resolvers/AskSkipResolver.js +24 -9
  19. package/dist/resolvers/AskSkipResolver.js.map +1 -1
  20. package/dist/resolvers/ComponentRegistryResolver.d.ts +19 -0
  21. package/dist/resolvers/ComponentRegistryResolver.d.ts.map +1 -1
  22. package/dist/resolvers/ComponentRegistryResolver.js +140 -2
  23. package/dist/resolvers/ComponentRegistryResolver.js.map +1 -1
  24. package/dist/resolvers/RunAIAgentResolver.d.ts +3 -3
  25. package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
  26. package/dist/resolvers/RunAIAgentResolver.js +16 -13
  27. package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
  28. package/package.json +40 -40
  29. package/src/agents/skip-agent.ts +285 -0
  30. package/src/agents/skip-sdk.ts +543 -0
  31. package/src/config.ts +3 -2
  32. package/src/generated/generated.ts +544 -93
  33. package/src/resolvers/AskSkipResolver.ts +32 -10
  34. package/src/resolvers/ComponentRegistryResolver.ts +133 -4
  35. package/src/resolvers/RunAIAgentResolver.ts +16 -10
@@ -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, 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, ConversationArtifactVersionEntity, AIAgentRequestEntity, AIModelVendorEntity, AIVendorTypeDefinitionEntity, ReportUserStateEntity, QueryEntityEntity, DashboardUserStateEntity, ComponentEntity, AccessControlRuleEntity, PublicLinkEntity, ArtifactTypeEntity, AIVendorTypeEntity, ArtifactEntity, ConversationArtifactEntity, AIAgentPromptEntity, ComponentLibraryEntity, DashboardUserPreferenceEntity, QueryParameterEntity, AIAgentRelationshipEntity, ComponentLibraryLinkEntity, ContentProcessRunEntity, ContentSourceEntity, ContentSourceParamEntity, ContentSourceTypeEntity, ContentSourceTypeParamEntity, ContentTypeEntity, ContentTypeAttributeEntity, ContentFileTypeEntity, ContentItemEntity, ContentItemAttributeEntity, ContentItemTagEntity, GeneratedCodeEntity, AIPromptRunEntity, AIAgentRunStepEntity, TaskEntity, ProjectEntity, ConversationArtifactPermissionEntity, AIModelPriceUnitTypeEntity, ArtifactVersionEntity, AIAgentStepPathEntity, AIAgentLearningCycleEntity, ReportVersionEntity, AIConfigurationParamEntity } 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, 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, ConversationArtifactVersionEntity, AIAgentRequestEntity, AIModelVendorEntity, AIVendorTypeDefinitionEntity, ReportUserStateEntity, QueryEntityEntity, DashboardUserStateEntity, ComponentEntity, AccessControlRuleEntity, PublicLinkEntity, ArtifactTypeEntity, AIVendorTypeEntity, ArtifactEntity, ConversationArtifactEntity, AIAgentPromptEntity, ComponentLibraryEntity, DashboardUserPreferenceEntity, QueryParameterEntity, AIAgentRelationshipEntity, ComponentLibraryLinkEntity, ContentProcessRunEntity, ContentSourceEntity, ContentSourceParamEntity, ContentSourceTypeEntity, ContentSourceTypeParamEntity, ContentTypeEntity, ContentTypeAttributeEntity, ContentFileTypeEntity, ContentItemEntity, ContentItemAttributeEntity, ContentItemTagEntity, GeneratedCodeEntity, AIPromptRunEntity, AIAgentRunStepEntity, ConversationDetailArtifactEntity, TaskEntity, ProjectEntity, ConversationArtifactPermissionEntity, AIModelPriceUnitTypeEntity, ArtifactVersionEntity, AIAgentStepPathEntity, AIAgentLearningCycleEntity, ReportVersionEntity, AIConfigurationParamEntity } from '@memberjunction/core-entities';
23
23
 
24
24
 
25
25
  //****************************************************************************
@@ -1741,12 +1741,12 @@ each time the agent processes a prompt step.`})
1741
1741
  @MaxLength(100)
1742
1742
  OverrideVendor?: string;
1743
1743
 
1744
- @Field(() => [AIAgentRunStep_])
1745
- MJ_AIAgentRunSteps_AgentRunIDArray: AIAgentRunStep_[]; // Link to MJ_AIAgentRunSteps
1746
-
1747
1744
  @Field(() => [AIAgentRun_])
1748
1745
  MJ_AIAgentRuns_ParentRunIDArray: AIAgentRun_[]; // Link to MJ_AIAgentRuns
1749
1746
 
1747
+ @Field(() => [AIAgentRunStep_])
1748
+ MJ_AIAgentRunSteps_AgentRunIDArray: AIAgentRunStep_[]; // Link to MJ_AIAgentRunSteps
1749
+
1750
1750
  @Field(() => [AIPromptRun_])
1751
1751
  MJ_AIPromptRuns_AgentRunIDArray: AIPromptRun_[]; // Link to MJ_AIPromptRuns
1752
1752
 
@@ -2048,25 +2048,25 @@ export class AIAgentRunResolver extends ResolverBase {
2048
2048
  return result;
2049
2049
  }
2050
2050
 
2051
- @FieldResolver(() => [AIAgentRunStep_])
2052
- async MJ_AIAgentRunSteps_AgentRunIDArray(@Root() aiagentrun_: AIAgentRun_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2053
- this.CheckUserReadPermissions('MJ: AI Agent Run Steps', userPayload);
2051
+ @FieldResolver(() => [AIAgentRun_])
2052
+ async MJ_AIAgentRuns_ParentRunIDArray(@Root() aiagentrun_: AIAgentRun_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2053
+ this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
2054
2054
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2055
2055
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2056
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRunSteps] WHERE [AgentRunID]='${aiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Run Steps', userPayload, EntityPermissionType.Read, 'AND');
2056
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRuns] WHERE [ParentRunID]='${aiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Runs', userPayload, EntityPermissionType.Read, 'AND');
2057
2057
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2058
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Run Steps', rows);
2058
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Runs', rows);
2059
2059
  return result;
2060
2060
  }
2061
2061
 
2062
- @FieldResolver(() => [AIAgentRun_])
2063
- async MJ_AIAgentRuns_ParentRunIDArray(@Root() aiagentrun_: AIAgentRun_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2064
- this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
2062
+ @FieldResolver(() => [AIAgentRunStep_])
2063
+ async MJ_AIAgentRunSteps_AgentRunIDArray(@Root() aiagentrun_: AIAgentRun_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2064
+ this.CheckUserReadPermissions('MJ: AI Agent Run Steps', userPayload);
2065
2065
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2066
2066
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2067
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRuns] WHERE [ParentRunID]='${aiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Runs', userPayload, EntityPermissionType.Read, 'AND');
2067
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRunSteps] WHERE [AgentRunID]='${aiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Run Steps', userPayload, EntityPermissionType.Read, 'AND');
2068
2068
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2069
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Runs', rows);
2069
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Run Steps', rows);
2070
2070
  return result;
2071
2071
  }
2072
2072
 
@@ -2140,12 +2140,12 @@ export class AIVendor_ {
2140
2140
  @Field(() => [AIResultCache_])
2141
2141
  AIResultCache_VendorIDArray: AIResultCache_[]; // Link to AIResultCache
2142
2142
 
2143
- @Field(() => [AIModelVendor_])
2144
- MJ_AIModelVendors_VendorIDArray: AIModelVendor_[]; // Link to MJ_AIModelVendors
2145
-
2146
2143
  @Field(() => [AIPromptRun_])
2147
2144
  MJ_AIPromptRuns_VendorIDArray: AIPromptRun_[]; // Link to MJ_AIPromptRuns
2148
2145
 
2146
+ @Field(() => [AIModelVendor_])
2147
+ MJ_AIModelVendors_VendorIDArray: AIModelVendor_[]; // Link to MJ_AIModelVendors
2148
+
2149
2149
  @Field(() => [AIVendorType_])
2150
2150
  MJ_AIVendorTypes_VendorIDArray: AIVendorType_[]; // Link to MJ_AIVendorTypes
2151
2151
 
@@ -2271,25 +2271,25 @@ export class AIVendorResolver extends ResolverBase {
2271
2271
  return result;
2272
2272
  }
2273
2273
 
2274
- @FieldResolver(() => [AIModelVendor_])
2275
- async MJ_AIModelVendors_VendorIDArray(@Root() aivendor_: AIVendor_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2276
- this.CheckUserReadPermissions('MJ: AI Model Vendors', userPayload);
2274
+ @FieldResolver(() => [AIPromptRun_])
2275
+ async MJ_AIPromptRuns_VendorIDArray(@Root() aivendor_: AIVendor_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2276
+ this.CheckUserReadPermissions('MJ: AI Prompt Runs', userPayload);
2277
2277
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2278
2278
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2279
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIModelVendors] WHERE [VendorID]='${aivendor_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Model Vendors', userPayload, EntityPermissionType.Read, 'AND');
2279
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptRuns] WHERE [VendorID]='${aivendor_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Runs', userPayload, EntityPermissionType.Read, 'AND');
2280
2280
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2281
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Model Vendors', rows);
2281
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Runs', rows);
2282
2282
  return result;
2283
2283
  }
2284
2284
 
2285
- @FieldResolver(() => [AIPromptRun_])
2286
- async MJ_AIPromptRuns_VendorIDArray(@Root() aivendor_: AIVendor_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2287
- this.CheckUserReadPermissions('MJ: AI Prompt Runs', userPayload);
2285
+ @FieldResolver(() => [AIModelVendor_])
2286
+ async MJ_AIModelVendors_VendorIDArray(@Root() aivendor_: AIVendor_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2287
+ this.CheckUserReadPermissions('MJ: AI Model Vendors', userPayload);
2288
2288
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2289
2289
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2290
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptRuns] WHERE [VendorID]='${aivendor_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Runs', userPayload, EntityPermissionType.Read, 'AND');
2290
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIModelVendors] WHERE [VendorID]='${aivendor_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Model Vendors', userPayload, EntityPermissionType.Read, 'AND');
2291
2291
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2292
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Runs', rows);
2292
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Model Vendors', rows);
2293
2293
  return result;
2294
2294
  }
2295
2295
 
@@ -2569,14 +2569,14 @@ export class AIConfiguration_ {
2569
2569
  @Field(() => [AIAgentPrompt_])
2570
2570
  MJ_AIAgentPrompts_ConfigurationIDArray: AIAgentPrompt_[]; // Link to MJ_AIAgentPrompts
2571
2571
 
2572
- @Field(() => [AIPromptModel_])
2573
- MJ_AIPromptModels_ConfigurationIDArray: AIPromptModel_[]; // Link to MJ_AIPromptModels
2572
+ @Field(() => [AIPromptRun_])
2573
+ MJ_AIPromptRuns_ConfigurationIDArray: AIPromptRun_[]; // Link to MJ_AIPromptRuns
2574
2574
 
2575
2575
  @Field(() => [AIResultCache_])
2576
2576
  AIResultCache_ConfigurationIDArray: AIResultCache_[]; // Link to AIResultCache
2577
2577
 
2578
- @Field(() => [AIPromptRun_])
2579
- MJ_AIPromptRuns_ConfigurationIDArray: AIPromptRun_[]; // Link to MJ_AIPromptRuns
2578
+ @Field(() => [AIPromptModel_])
2579
+ MJ_AIPromptModels_ConfigurationIDArray: AIPromptModel_[]; // Link to MJ_AIPromptModels
2580
2580
 
2581
2581
  @Field(() => [AIAgentRun_])
2582
2582
  MJ_AIAgentRuns_ConfigurationIDArray: AIAgentRun_[]; // Link to MJ_AIAgentRuns
@@ -2721,14 +2721,14 @@ export class AIConfigurationResolver extends ResolverBase {
2721
2721
  return result;
2722
2722
  }
2723
2723
 
2724
- @FieldResolver(() => [AIPromptModel_])
2725
- async MJ_AIPromptModels_ConfigurationIDArray(@Root() aiconfiguration_: AIConfiguration_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2726
- this.CheckUserReadPermissions('MJ: AI Prompt Models', userPayload);
2724
+ @FieldResolver(() => [AIPromptRun_])
2725
+ async MJ_AIPromptRuns_ConfigurationIDArray(@Root() aiconfiguration_: AIConfiguration_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2726
+ this.CheckUserReadPermissions('MJ: AI Prompt Runs', userPayload);
2727
2727
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2728
2728
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2729
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptModels] WHERE [ConfigurationID]='${aiconfiguration_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Models', userPayload, EntityPermissionType.Read, 'AND');
2729
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptRuns] WHERE [ConfigurationID]='${aiconfiguration_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Runs', userPayload, EntityPermissionType.Read, 'AND');
2730
2730
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2731
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Models', rows);
2731
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Runs', rows);
2732
2732
  return result;
2733
2733
  }
2734
2734
 
@@ -2743,14 +2743,14 @@ export class AIConfigurationResolver extends ResolverBase {
2743
2743
  return result;
2744
2744
  }
2745
2745
 
2746
- @FieldResolver(() => [AIPromptRun_])
2747
- async MJ_AIPromptRuns_ConfigurationIDArray(@Root() aiconfiguration_: AIConfiguration_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2748
- this.CheckUserReadPermissions('MJ: AI Prompt Runs', userPayload);
2746
+ @FieldResolver(() => [AIPromptModel_])
2747
+ async MJ_AIPromptModels_ConfigurationIDArray(@Root() aiconfiguration_: AIConfiguration_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2748
+ this.CheckUserReadPermissions('MJ: AI Prompt Models', userPayload);
2749
2749
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2750
2750
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
2751
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptRuns] WHERE [ConfigurationID]='${aiconfiguration_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Runs', userPayload, EntityPermissionType.Read, 'AND');
2751
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptModels] WHERE [ConfigurationID]='${aiconfiguration_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Models', userPayload, EntityPermissionType.Read, 'AND');
2752
2752
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
2753
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Runs', rows);
2753
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Models', rows);
2754
2754
  return result;
2755
2755
  }
2756
2756
 
@@ -2945,12 +2945,12 @@ if this limit is exceeded.`})
2945
2945
  @MaxLength(200)
2946
2946
  Type?: string;
2947
2947
 
2948
- @Field(() => [AIAgentAction_])
2949
- AIAgentActions_AgentIDArray: AIAgentAction_[]; // Link to AIAgentActions
2950
-
2951
2948
  @Field(() => [AIAgentModel_])
2952
2949
  AIAgentModels_AgentIDArray: AIAgentModel_[]; // Link to AIAgentModels
2953
2950
 
2951
+ @Field(() => [AIAgentAction_])
2952
+ AIAgentActions_AgentIDArray: AIAgentAction_[]; // Link to AIAgentActions
2953
+
2954
2954
  @Field(() => [AIAgentLearningCycle_])
2955
2955
  AIAgentLearningCycles_AgentIDArray: AIAgentLearningCycle_[]; // Link to AIAgentLearningCycles
2956
2956
 
@@ -2987,6 +2987,9 @@ if this limit is exceeded.`})
2987
2987
  @Field(() => [AIPromptRun_])
2988
2988
  MJ_AIPromptRuns_AgentIDArray: AIPromptRun_[]; // Link to MJ_AIPromptRuns
2989
2989
 
2990
+ @Field(() => [ConversationDetail_])
2991
+ ConversationDetails_AgentIDArray: ConversationDetail_[]; // Link to ConversationDetails
2992
+
2990
2993
  @Field(() => [AIAgent_])
2991
2994
  AIAgents_ParentIDArray: AIAgent_[]; // Link to AIAgents
2992
2995
 
@@ -3276,25 +3279,25 @@ export class AIAgentResolver extends ResolverBase {
3276
3279
  return result;
3277
3280
  }
3278
3281
 
3279
- @FieldResolver(() => [AIAgentAction_])
3280
- async AIAgentActions_AgentIDArray(@Root() aiagent_: AIAgent_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
3281
- this.CheckUserReadPermissions('AI Agent Actions', userPayload);
3282
+ @FieldResolver(() => [AIAgentModel_])
3283
+ async AIAgentModels_AgentIDArray(@Root() aiagent_: AIAgent_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
3284
+ this.CheckUserReadPermissions('AI Agent Models', userPayload);
3282
3285
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3283
3286
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
3284
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentActions] WHERE [AgentID]='${aiagent_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'AI Agent Actions', userPayload, EntityPermissionType.Read, 'AND');
3287
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentModels] WHERE [AgentID]='${aiagent_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'AI Agent Models', userPayload, EntityPermissionType.Read, 'AND');
3285
3288
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
3286
- const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Actions', rows);
3289
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Models', rows);
3287
3290
  return result;
3288
3291
  }
3289
3292
 
3290
- @FieldResolver(() => [AIAgentModel_])
3291
- async AIAgentModels_AgentIDArray(@Root() aiagent_: AIAgent_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
3292
- this.CheckUserReadPermissions('AI Agent Models', userPayload);
3293
+ @FieldResolver(() => [AIAgentAction_])
3294
+ async AIAgentActions_AgentIDArray(@Root() aiagent_: AIAgent_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
3295
+ this.CheckUserReadPermissions('AI Agent Actions', userPayload);
3293
3296
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3294
3297
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
3295
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentModels] WHERE [AgentID]='${aiagent_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'AI Agent Models', userPayload, EntityPermissionType.Read, 'AND');
3298
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentActions] WHERE [AgentID]='${aiagent_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'AI Agent Actions', userPayload, EntityPermissionType.Read, 'AND');
3296
3299
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
3297
- const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Models', rows);
3300
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Actions', rows);
3298
3301
  return result;
3299
3302
  }
3300
3303
 
@@ -3430,6 +3433,17 @@ export class AIAgentResolver extends ResolverBase {
3430
3433
  return result;
3431
3434
  }
3432
3435
 
3436
+ @FieldResolver(() => [ConversationDetail_])
3437
+ async ConversationDetails_AgentIDArray(@Root() aiagent_: AIAgent_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
3438
+ this.CheckUserReadPermissions('Conversation Details', userPayload);
3439
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3440
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
3441
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwConversationDetails] WHERE [AgentID]='${aiagent_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'Conversation Details', userPayload, EntityPermissionType.Read, 'AND');
3442
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
3443
+ const result = this.ArrayMapFieldNamesToCodeNames('Conversation Details', rows);
3444
+ return result;
3445
+ }
3446
+
3433
3447
  @FieldResolver(() => [AIAgent_])
3434
3448
  async AIAgents_ParentIDArray(@Root() aiagent_: AIAgent_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
3435
3449
  this.CheckUserReadPermissions('AI Agents', userPayload);
@@ -5358,6 +5372,171 @@ export class TaskDependencyResolver extends ResolverBase {
5358
5372
 
5359
5373
  }
5360
5374
 
5375
+ //****************************************************************************
5376
+ // ENTITY CLASS for MJ: Collection Artifacts
5377
+ //****************************************************************************
5378
+ @ObjectType({ description: `Join table that establishes many-to-many relationships between Collections and Artifacts, allowing artifacts to be organized within collections` })
5379
+ export class CollectionArtifact_ {
5380
+ @Field()
5381
+ @MaxLength(16)
5382
+ ID: string;
5383
+
5384
+ @Field()
5385
+ @MaxLength(16)
5386
+ CollectionID: string;
5387
+
5388
+ @Field()
5389
+ @MaxLength(16)
5390
+ ArtifactID: string;
5391
+
5392
+ @Field(() => Int, {description: `Sequence number for ordering artifacts within a collection`})
5393
+ Sequence: number;
5394
+
5395
+ @Field()
5396
+ @MaxLength(10)
5397
+ _mj__CreatedAt: Date;
5398
+
5399
+ @Field()
5400
+ @MaxLength(10)
5401
+ _mj__UpdatedAt: Date;
5402
+
5403
+ @Field()
5404
+ @MaxLength(510)
5405
+ Collection: string;
5406
+
5407
+ @Field()
5408
+ @MaxLength(510)
5409
+ Artifact: string;
5410
+
5411
+ }
5412
+
5413
+ //****************************************************************************
5414
+ // INPUT TYPE for MJ: Collection Artifacts
5415
+ //****************************************************************************
5416
+ @InputType()
5417
+ export class CreateCollectionArtifactInput {
5418
+ @Field({ nullable: true })
5419
+ ID?: string;
5420
+
5421
+ @Field({ nullable: true })
5422
+ CollectionID?: string;
5423
+
5424
+ @Field({ nullable: true })
5425
+ ArtifactID?: string;
5426
+
5427
+ @Field(() => Int, { nullable: true })
5428
+ Sequence?: number;
5429
+ }
5430
+
5431
+
5432
+ //****************************************************************************
5433
+ // INPUT TYPE for MJ: Collection Artifacts
5434
+ //****************************************************************************
5435
+ @InputType()
5436
+ export class UpdateCollectionArtifactInput {
5437
+ @Field()
5438
+ ID: string;
5439
+
5440
+ @Field({ nullable: true })
5441
+ CollectionID?: string;
5442
+
5443
+ @Field({ nullable: true })
5444
+ ArtifactID?: string;
5445
+
5446
+ @Field(() => Int, { nullable: true })
5447
+ Sequence?: number;
5448
+
5449
+ @Field(() => [KeyValuePairInput], { nullable: true })
5450
+ OldValues___?: KeyValuePairInput[];
5451
+ }
5452
+
5453
+ //****************************************************************************
5454
+ // RESOLVER for MJ: Collection Artifacts
5455
+ //****************************************************************************
5456
+ @ObjectType()
5457
+ export class RunCollectionArtifactViewResult {
5458
+ @Field(() => [CollectionArtifact_])
5459
+ Results: CollectionArtifact_[];
5460
+
5461
+ @Field(() => String, {nullable: true})
5462
+ UserViewRunID?: string;
5463
+
5464
+ @Field(() => Int, {nullable: true})
5465
+ RowCount: number;
5466
+
5467
+ @Field(() => Int, {nullable: true})
5468
+ TotalRowCount: number;
5469
+
5470
+ @Field(() => Int, {nullable: true})
5471
+ ExecutionTime: number;
5472
+
5473
+ @Field({nullable: true})
5474
+ ErrorMessage?: string;
5475
+
5476
+ @Field(() => Boolean, {nullable: false})
5477
+ Success: boolean;
5478
+ }
5479
+
5480
+ @Resolver(CollectionArtifact_)
5481
+ export class CollectionArtifactResolver extends ResolverBase {
5482
+ @Query(() => RunCollectionArtifactViewResult)
5483
+ async RunCollectionArtifactViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
5484
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5485
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
5486
+ }
5487
+
5488
+ @Query(() => RunCollectionArtifactViewResult)
5489
+ async RunCollectionArtifactViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
5490
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5491
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
5492
+ }
5493
+
5494
+ @Query(() => RunCollectionArtifactViewResult)
5495
+ async RunCollectionArtifactDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
5496
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5497
+ input.EntityName = 'MJ: Collection Artifacts';
5498
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
5499
+ }
5500
+ @Query(() => CollectionArtifact_, { nullable: true })
5501
+ async CollectionArtifact(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<CollectionArtifact_ | null> {
5502
+ this.CheckUserReadPermissions('MJ: Collection Artifacts', userPayload);
5503
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5504
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
5505
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollectionArtifacts] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collection Artifacts', userPayload, EntityPermissionType.Read, 'AND');
5506
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
5507
+ const result = this.MapFieldNamesToCodeNames('MJ: Collection Artifacts', rows && rows.length > 0 ? rows[0] : {})
5508
+ return result;
5509
+ }
5510
+
5511
+ @Mutation(() => CollectionArtifact_)
5512
+ async CreateCollectionArtifact(
5513
+ @Arg('input', () => CreateCollectionArtifactInput) input: CreateCollectionArtifactInput,
5514
+ @Ctx() { providers, userPayload }: AppContext,
5515
+ @PubSub() pubSub: PubSubEngine
5516
+ ) {
5517
+ const provider = GetReadWriteProvider(providers);
5518
+ return this.CreateRecord('MJ: Collection Artifacts', input, provider, userPayload, pubSub)
5519
+ }
5520
+
5521
+ @Mutation(() => CollectionArtifact_)
5522
+ async UpdateCollectionArtifact(
5523
+ @Arg('input', () => UpdateCollectionArtifactInput) input: UpdateCollectionArtifactInput,
5524
+ @Ctx() { providers, userPayload }: AppContext,
5525
+ @PubSub() pubSub: PubSubEngine
5526
+ ) {
5527
+ const provider = GetReadWriteProvider(providers);
5528
+ return this.UpdateRecord('MJ: Collection Artifacts', input, provider, userPayload, pubSub);
5529
+ }
5530
+
5531
+ @Mutation(() => CollectionArtifact_)
5532
+ async DeleteCollectionArtifact(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
5533
+ const provider = GetReadWriteProvider(providers);
5534
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
5535
+ return this.DeleteRecord('MJ: Collection Artifacts', key, options, provider, userPayload, pubSub);
5536
+ }
5537
+
5538
+ }
5539
+
5361
5540
  //****************************************************************************
5362
5541
  // ENTITY CLASS for MJ: AI Model Price Types
5363
5542
  //****************************************************************************
@@ -5570,6 +5749,9 @@ export class Collection_ {
5570
5749
  @MaxLength(510)
5571
5750
  Parent?: string;
5572
5751
 
5752
+ @Field(() => [CollectionArtifact_])
5753
+ MJ_CollectionArtifacts_CollectionIDArray: CollectionArtifact_[]; // Link to MJ_CollectionArtifacts
5754
+
5573
5755
  @Field(() => [Collection_])
5574
5756
  MJ_Collections_ParentIDArray: Collection_[]; // Link to MJ_Collections
5575
5757
 
@@ -5697,6 +5879,17 @@ export class CollectionResolver extends ResolverBase {
5697
5879
  return result;
5698
5880
  }
5699
5881
 
5882
+ @FieldResolver(() => [CollectionArtifact_])
5883
+ async MJ_CollectionArtifacts_CollectionIDArray(@Root() collection_: Collection_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
5884
+ this.CheckUserReadPermissions('MJ: Collection Artifacts', userPayload);
5885
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5886
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
5887
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollectionArtifacts] WHERE [CollectionID]='${collection_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collection Artifacts', userPayload, EntityPermissionType.Read, 'AND');
5888
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
5889
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collection Artifacts', rows);
5890
+ return result;
5891
+ }
5892
+
5700
5893
  @FieldResolver(() => [Collection_])
5701
5894
  async MJ_Collections_ParentIDArray(@Root() collection_: Collection_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
5702
5895
  this.CheckUserReadPermissions('MJ: Collections', userPayload);
@@ -6159,12 +6352,12 @@ export class AIPrompt_ {
6159
6352
  @Field(() => [AIPrompt_])
6160
6353
  AIPrompts_ResultSelectorPromptIDArray: AIPrompt_[]; // Link to AIPrompts
6161
6354
 
6162
- @Field(() => [AIPromptModel_])
6163
- MJ_AIPromptModels_PromptIDArray: AIPromptModel_[]; // Link to MJ_AIPromptModels
6164
-
6165
6355
  @Field(() => [AIAgentPrompt_])
6166
6356
  MJ_AIAgentPrompts_PromptIDArray: AIAgentPrompt_[]; // Link to MJ_AIAgentPrompts
6167
6357
 
6358
+ @Field(() => [AIPromptModel_])
6359
+ MJ_AIPromptModels_PromptIDArray: AIPromptModel_[]; // Link to MJ_AIPromptModels
6360
+
6168
6361
  @Field(() => [AIAgentStep_])
6169
6362
  MJ_AIAgentSteps_PromptIDArray: AIAgentStep_[]; // Link to MJ_AIAgentSteps
6170
6363
 
@@ -6599,25 +6792,25 @@ export class AIPromptResolver extends ResolverBase {
6599
6792
  return result;
6600
6793
  }
6601
6794
 
6602
- @FieldResolver(() => [AIPromptModel_])
6603
- async MJ_AIPromptModels_PromptIDArray(@Root() aiprompt_: AIPrompt_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
6604
- this.CheckUserReadPermissions('MJ: AI Prompt Models', userPayload);
6795
+ @FieldResolver(() => [AIAgentPrompt_])
6796
+ async MJ_AIAgentPrompts_PromptIDArray(@Root() aiprompt_: AIPrompt_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
6797
+ this.CheckUserReadPermissions('MJ: AI Agent Prompts', userPayload);
6605
6798
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
6606
6799
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
6607
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptModels] WHERE [PromptID]='${aiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Models', userPayload, EntityPermissionType.Read, 'AND');
6800
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentPrompts] WHERE [PromptID]='${aiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Prompts', userPayload, EntityPermissionType.Read, 'AND');
6608
6801
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
6609
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Models', rows);
6802
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Prompts', rows);
6610
6803
  return result;
6611
6804
  }
6612
6805
 
6613
- @FieldResolver(() => [AIAgentPrompt_])
6614
- async MJ_AIAgentPrompts_PromptIDArray(@Root() aiprompt_: AIPrompt_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
6615
- this.CheckUserReadPermissions('MJ: AI Agent Prompts', userPayload);
6806
+ @FieldResolver(() => [AIPromptModel_])
6807
+ async MJ_AIPromptModels_PromptIDArray(@Root() aiprompt_: AIPrompt_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
6808
+ this.CheckUserReadPermissions('MJ: AI Prompt Models', userPayload);
6616
6809
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
6617
6810
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
6618
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentPrompts] WHERE [PromptID]='${aiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Prompts', userPayload, EntityPermissionType.Read, 'AND');
6811
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptModels] WHERE [PromptID]='${aiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Models', userPayload, EntityPermissionType.Read, 'AND');
6619
6812
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
6620
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Prompts', rows);
6813
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Models', rows);
6621
6814
  return result;
6622
6815
  }
6623
6816
 
@@ -10573,12 +10766,12 @@ export class Entity_ {
10573
10766
  @Field(() => [QueryEntity_])
10574
10767
  QueryEntities_EntityIDArray: QueryEntity_[]; // Link to QueryEntities
10575
10768
 
10576
- @Field(() => [RecordLink_])
10577
- MJ_RecordLinks_SourceEntityIDArray: RecordLink_[]; // Link to MJ_RecordLinks
10578
-
10579
10769
  @Field(() => [AccessControlRule_])
10580
10770
  MJ_AccessControlRules_EntityIDArray: AccessControlRule_[]; // Link to MJ_AccessControlRules
10581
10771
 
10772
+ @Field(() => [RecordLink_])
10773
+ MJ_RecordLinks_SourceEntityIDArray: RecordLink_[]; // Link to MJ_RecordLinks
10774
+
10582
10775
  @Field(() => [GeneratedCode_])
10583
10776
  GeneratedCodes_LinkedEntityIDArray: GeneratedCode_[]; // Link to GeneratedCodes
10584
10777
 
@@ -11386,25 +11579,25 @@ export class EntityResolverBase extends ResolverBase {
11386
11579
  return result;
11387
11580
  }
11388
11581
 
11389
- @FieldResolver(() => [RecordLink_])
11390
- async MJ_RecordLinks_SourceEntityIDArray(@Root() entity_: Entity_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
11391
- this.CheckUserReadPermissions('MJ: Record Links', userPayload);
11582
+ @FieldResolver(() => [AccessControlRule_])
11583
+ async MJ_AccessControlRules_EntityIDArray(@Root() entity_: Entity_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
11584
+ this.CheckUserReadPermissions('MJ: Access Control Rules', userPayload);
11392
11585
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
11393
11586
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
11394
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwRecordLinks] WHERE [SourceEntityID]='${entity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Record Links', userPayload, EntityPermissionType.Read, 'AND');
11587
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAccessControlRules] WHERE [EntityID]='${entity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Access Control Rules', userPayload, EntityPermissionType.Read, 'AND');
11395
11588
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
11396
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Record Links', rows);
11589
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Access Control Rules', rows);
11397
11590
  return result;
11398
11591
  }
11399
11592
 
11400
- @FieldResolver(() => [AccessControlRule_])
11401
- async MJ_AccessControlRules_EntityIDArray(@Root() entity_: Entity_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
11402
- this.CheckUserReadPermissions('MJ: Access Control Rules', userPayload);
11593
+ @FieldResolver(() => [RecordLink_])
11594
+ async MJ_RecordLinks_SourceEntityIDArray(@Root() entity_: Entity_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
11595
+ this.CheckUserReadPermissions('MJ: Record Links', userPayload);
11403
11596
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
11404
11597
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
11405
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAccessControlRules] WHERE [EntityID]='${entity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Access Control Rules', userPayload, EntityPermissionType.Read, 'AND');
11598
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwRecordLinks] WHERE [SourceEntityID]='${entity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Record Links', userPayload, EntityPermissionType.Read, 'AND');
11406
11599
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
11407
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Access Control Rules', rows);
11600
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Record Links', rows);
11408
11601
  return result;
11409
11602
  }
11410
11603
 
@@ -23102,6 +23295,18 @@ export class ConversationDetail_ {
23102
23295
  @Field(() => Boolean, {description: `Indicates if this message is pinned within the conversation for easy reference`})
23103
23296
  IsPinned: boolean;
23104
23297
 
23298
+ @Field({nullable: true, description: `Optional reference to parent message for threaded conversations. NULL for top-level messages.`})
23299
+ @MaxLength(16)
23300
+ ParentID?: string;
23301
+
23302
+ @Field({nullable: true, description: `Denormalized agent ID for quick lookup of agent name and icon without joining through AgentRun`})
23303
+ @MaxLength(16)
23304
+ AgentID?: string;
23305
+
23306
+ @Field({description: `Status of the conversation message. Complete indicates finished processing, In-Progress indicates active agent work, Error indicates processing failed.`})
23307
+ @MaxLength(40)
23308
+ Status: string;
23309
+
23105
23310
  @Field({nullable: true})
23106
23311
  @MaxLength(510)
23107
23312
  Conversation?: string;
@@ -23114,12 +23319,22 @@ export class ConversationDetail_ {
23114
23319
  @MaxLength(510)
23115
23320
  Artifact?: string;
23116
23321
 
23322
+ @Field({nullable: true})
23323
+ @MaxLength(510)
23324
+ Agent?: string;
23325
+
23117
23326
  @Field(() => [Report_])
23118
23327
  Reports_ConversationDetailIDArray: Report_[]; // Link to Reports
23119
23328
 
23329
+ @Field(() => [ConversationDetailArtifact_])
23330
+ MJ_ConversationDetailArtifacts_ConversationDetailIDArray: ConversationDetailArtifact_[]; // Link to MJ_ConversationDetailArtifacts
23331
+
23120
23332
  @Field(() => [AIAgentRun_])
23121
23333
  MJ_AIAgentRuns_ConversationDetailIDArray: AIAgentRun_[]; // Link to MJ_AIAgentRuns
23122
23334
 
23335
+ @Field(() => [ConversationDetail_])
23336
+ ConversationDetails_ParentIDArray: ConversationDetail_[]; // Link to ConversationDetails
23337
+
23123
23338
  @Field(() => [Task_])
23124
23339
  MJ_Tasks_ConversationDetailIDArray: Task_[]; // Link to MJ_Tasks
23125
23340
 
@@ -23177,6 +23392,15 @@ export class CreateConversationDetailInput {
23177
23392
 
23178
23393
  @Field(() => Boolean, { nullable: true })
23179
23394
  IsPinned?: boolean;
23395
+
23396
+ @Field({ nullable: true })
23397
+ ParentID: string | null;
23398
+
23399
+ @Field({ nullable: true })
23400
+ AgentID: string | null;
23401
+
23402
+ @Field({ nullable: true })
23403
+ Status?: string;
23180
23404
  }
23181
23405
 
23182
23406
 
@@ -23233,6 +23457,15 @@ export class UpdateConversationDetailInput {
23233
23457
  @Field(() => Boolean, { nullable: true })
23234
23458
  IsPinned?: boolean;
23235
23459
 
23460
+ @Field({ nullable: true })
23461
+ ParentID?: string | null;
23462
+
23463
+ @Field({ nullable: true })
23464
+ AgentID?: string | null;
23465
+
23466
+ @Field({ nullable: true })
23467
+ Status?: string;
23468
+
23236
23469
  @Field(() => [KeyValuePairInput], { nullable: true })
23237
23470
  OldValues___?: KeyValuePairInput[];
23238
23471
  }
@@ -23306,6 +23539,17 @@ export class ConversationDetailResolver extends ResolverBase {
23306
23539
  return result;
23307
23540
  }
23308
23541
 
23542
+ @FieldResolver(() => [ConversationDetailArtifact_])
23543
+ async MJ_ConversationDetailArtifacts_ConversationDetailIDArray(@Root() conversationdetail_: ConversationDetail_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
23544
+ this.CheckUserReadPermissions('MJ: Conversation Detail Artifacts', userPayload);
23545
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
23546
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
23547
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwConversationDetailArtifacts] WHERE [ConversationDetailID]='${conversationdetail_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Conversation Detail Artifacts', userPayload, EntityPermissionType.Read, 'AND');
23548
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
23549
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Conversation Detail Artifacts', rows);
23550
+ return result;
23551
+ }
23552
+
23309
23553
  @FieldResolver(() => [AIAgentRun_])
23310
23554
  async MJ_AIAgentRuns_ConversationDetailIDArray(@Root() conversationdetail_: ConversationDetail_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
23311
23555
  this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
@@ -23317,6 +23561,17 @@ export class ConversationDetailResolver extends ResolverBase {
23317
23561
  return result;
23318
23562
  }
23319
23563
 
23564
+ @FieldResolver(() => [ConversationDetail_])
23565
+ async ConversationDetails_ParentIDArray(@Root() conversationdetail_: ConversationDetail_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
23566
+ this.CheckUserReadPermissions('Conversation Details', userPayload);
23567
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
23568
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
23569
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwConversationDetails] WHERE [ParentID]='${conversationdetail_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'Conversation Details', userPayload, EntityPermissionType.Read, 'AND');
23570
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
23571
+ const result = this.ArrayMapFieldNamesToCodeNames('Conversation Details', rows);
23572
+ return result;
23573
+ }
23574
+
23320
23575
  @FieldResolver(() => [Task_])
23321
23576
  async MJ_Tasks_ConversationDetailIDArray(@Root() conversationdetail_: ConversationDetail_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
23322
23577
  this.CheckUserReadPermissions('MJ: Tasks', userPayload);
@@ -40417,6 +40672,9 @@ export class Artifact_ {
40417
40672
  @Field(() => [ArtifactVersion_])
40418
40673
  MJ_ArtifactVersions_ArtifactIDArray: ArtifactVersion_[]; // Link to MJ_ArtifactVersions
40419
40674
 
40675
+ @Field(() => [CollectionArtifact_])
40676
+ MJ_CollectionArtifacts_ArtifactIDArray: CollectionArtifact_[]; // Link to MJ_CollectionArtifacts
40677
+
40420
40678
  }
40421
40679
 
40422
40680
  //****************************************************************************
@@ -40546,6 +40804,17 @@ export class ArtifactResolver extends ResolverBase {
40546
40804
  return result;
40547
40805
  }
40548
40806
 
40807
+ @FieldResolver(() => [CollectionArtifact_])
40808
+ async MJ_CollectionArtifacts_ArtifactIDArray(@Root() artifact_: Artifact_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
40809
+ this.CheckUserReadPermissions('MJ: Collection Artifacts', userPayload);
40810
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
40811
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
40812
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollectionArtifacts] WHERE [ArtifactID]='${artifact_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collection Artifacts', userPayload, EntityPermissionType.Read, 'AND');
40813
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
40814
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collection Artifacts', rows);
40815
+ return result;
40816
+ }
40817
+
40549
40818
  @Mutation(() => Artifact_)
40550
40819
  async CreateArtifact(
40551
40820
  @Arg('input', () => CreateArtifactInput) input: CreateArtifactInput,
@@ -40622,12 +40891,12 @@ export class ConversationArtifact_ {
40622
40891
  @MaxLength(200)
40623
40892
  ArtifactType: string;
40624
40893
 
40625
- @Field(() => [ConversationArtifactPermission_])
40626
- MJ_ConversationArtifactPermissions_ConversationArtifactIDArray: ConversationArtifactPermission_[]; // Link to MJ_ConversationArtifactPermissions
40627
-
40628
40894
  @Field(() => [ConversationArtifactVersion_])
40629
40895
  MJ_ConversationArtifactVersions_ConversationArtifactIDArray: ConversationArtifactVersion_[]; // Link to MJ_ConversationArtifactVersions
40630
40896
 
40897
+ @Field(() => [ConversationArtifactPermission_])
40898
+ MJ_ConversationArtifactPermissions_ConversationArtifactIDArray: ConversationArtifactPermission_[]; // Link to MJ_ConversationArtifactPermissions
40899
+
40631
40900
  @Field(() => [ConversationDetail_])
40632
40901
  ConversationDetails_ArtifactIDArray: ConversationDetail_[]; // Link to ConversationDetails
40633
40902
 
@@ -40749,25 +41018,25 @@ export class ConversationArtifactResolver extends ResolverBase {
40749
41018
  return result;
40750
41019
  }
40751
41020
 
40752
- @FieldResolver(() => [ConversationArtifactPermission_])
40753
- async MJ_ConversationArtifactPermissions_ConversationArtifactIDArray(@Root() conversationartifact_: ConversationArtifact_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
40754
- this.CheckUserReadPermissions('MJ: Conversation Artifact Permissions', userPayload);
41021
+ @FieldResolver(() => [ConversationArtifactVersion_])
41022
+ async MJ_ConversationArtifactVersions_ConversationArtifactIDArray(@Root() conversationartifact_: ConversationArtifact_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
41023
+ this.CheckUserReadPermissions('MJ: Conversation Artifact Versions', userPayload);
40755
41024
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
40756
41025
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
40757
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwConversationArtifactPermissions] WHERE [ConversationArtifactID]='${conversationartifact_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Conversation Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
41026
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwConversationArtifactVersions] WHERE [ConversationArtifactID]='${conversationartifact_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Conversation Artifact Versions', userPayload, EntityPermissionType.Read, 'AND');
40758
41027
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
40759
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Conversation Artifact Permissions', rows);
41028
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Conversation Artifact Versions', rows);
40760
41029
  return result;
40761
41030
  }
40762
41031
 
40763
- @FieldResolver(() => [ConversationArtifactVersion_])
40764
- async MJ_ConversationArtifactVersions_ConversationArtifactIDArray(@Root() conversationartifact_: ConversationArtifact_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
40765
- this.CheckUserReadPermissions('MJ: Conversation Artifact Versions', userPayload);
41032
+ @FieldResolver(() => [ConversationArtifactPermission_])
41033
+ async MJ_ConversationArtifactPermissions_ConversationArtifactIDArray(@Root() conversationartifact_: ConversationArtifact_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
41034
+ this.CheckUserReadPermissions('MJ: Conversation Artifact Permissions', userPayload);
40766
41035
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
40767
41036
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
40768
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwConversationArtifactVersions] WHERE [ConversationArtifactID]='${conversationartifact_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Conversation Artifact Versions', userPayload, EntityPermissionType.Read, 'AND');
41037
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwConversationArtifactPermissions] WHERE [ConversationArtifactID]='${conversationartifact_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Conversation Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
40769
41038
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
40770
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Conversation Artifact Versions', rows);
41039
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Conversation Artifact Permissions', rows);
40771
41040
  return result;
40772
41041
  }
40773
41042
 
@@ -45588,6 +45857,164 @@ export class AIAgentRunStepResolver extends ResolverBase {
45588
45857
 
45589
45858
  }
45590
45859
 
45860
+ //****************************************************************************
45861
+ // ENTITY CLASS for MJ: Conversation Detail Artifacts
45862
+ //****************************************************************************
45863
+ @ObjectType({ description: `Junction table tracking many-to-many relationship between conversation messages and artifact versions, with directionality tracking` })
45864
+ export class ConversationDetailArtifact_ {
45865
+ @Field()
45866
+ @MaxLength(16)
45867
+ ID: string;
45868
+
45869
+ @Field({description: `Foreign key to ConversationDetail - the conversation message associated with this artifact`})
45870
+ @MaxLength(16)
45871
+ ConversationDetailID: string;
45872
+
45873
+ @Field({description: `Foreign key to ArtifactVersion - the specific artifact version linked to this conversation message`})
45874
+ @MaxLength(16)
45875
+ ArtifactVersionID: string;
45876
+
45877
+ @Field({description: `Direction of artifact flow: Input (fed to agent) or Output (produced by agent)`})
45878
+ @MaxLength(40)
45879
+ Direction: string;
45880
+
45881
+ @Field()
45882
+ @MaxLength(10)
45883
+ _mj__CreatedAt: Date;
45884
+
45885
+ @Field()
45886
+ @MaxLength(10)
45887
+ _mj__UpdatedAt: Date;
45888
+
45889
+ }
45890
+
45891
+ //****************************************************************************
45892
+ // INPUT TYPE for MJ: Conversation Detail Artifacts
45893
+ //****************************************************************************
45894
+ @InputType()
45895
+ export class CreateConversationDetailArtifactInput {
45896
+ @Field({ nullable: true })
45897
+ ID?: string;
45898
+
45899
+ @Field({ nullable: true })
45900
+ ConversationDetailID?: string;
45901
+
45902
+ @Field({ nullable: true })
45903
+ ArtifactVersionID?: string;
45904
+
45905
+ @Field({ nullable: true })
45906
+ Direction?: string;
45907
+ }
45908
+
45909
+
45910
+ //****************************************************************************
45911
+ // INPUT TYPE for MJ: Conversation Detail Artifacts
45912
+ //****************************************************************************
45913
+ @InputType()
45914
+ export class UpdateConversationDetailArtifactInput {
45915
+ @Field()
45916
+ ID: string;
45917
+
45918
+ @Field({ nullable: true })
45919
+ ConversationDetailID?: string;
45920
+
45921
+ @Field({ nullable: true })
45922
+ ArtifactVersionID?: string;
45923
+
45924
+ @Field({ nullable: true })
45925
+ Direction?: string;
45926
+
45927
+ @Field(() => [KeyValuePairInput], { nullable: true })
45928
+ OldValues___?: KeyValuePairInput[];
45929
+ }
45930
+
45931
+ //****************************************************************************
45932
+ // RESOLVER for MJ: Conversation Detail Artifacts
45933
+ //****************************************************************************
45934
+ @ObjectType()
45935
+ export class RunConversationDetailArtifactViewResult {
45936
+ @Field(() => [ConversationDetailArtifact_])
45937
+ Results: ConversationDetailArtifact_[];
45938
+
45939
+ @Field(() => String, {nullable: true})
45940
+ UserViewRunID?: string;
45941
+
45942
+ @Field(() => Int, {nullable: true})
45943
+ RowCount: number;
45944
+
45945
+ @Field(() => Int, {nullable: true})
45946
+ TotalRowCount: number;
45947
+
45948
+ @Field(() => Int, {nullable: true})
45949
+ ExecutionTime: number;
45950
+
45951
+ @Field({nullable: true})
45952
+ ErrorMessage?: string;
45953
+
45954
+ @Field(() => Boolean, {nullable: false})
45955
+ Success: boolean;
45956
+ }
45957
+
45958
+ @Resolver(ConversationDetailArtifact_)
45959
+ export class ConversationDetailArtifactResolver extends ResolverBase {
45960
+ @Query(() => RunConversationDetailArtifactViewResult)
45961
+ async RunConversationDetailArtifactViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45962
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45963
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
45964
+ }
45965
+
45966
+ @Query(() => RunConversationDetailArtifactViewResult)
45967
+ async RunConversationDetailArtifactViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45968
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45969
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
45970
+ }
45971
+
45972
+ @Query(() => RunConversationDetailArtifactViewResult)
45973
+ async RunConversationDetailArtifactDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
45974
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45975
+ input.EntityName = 'MJ: Conversation Detail Artifacts';
45976
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
45977
+ }
45978
+ @Query(() => ConversationDetailArtifact_, { nullable: true })
45979
+ async ConversationDetailArtifact(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<ConversationDetailArtifact_ | null> {
45980
+ this.CheckUserReadPermissions('MJ: Conversation Detail Artifacts', userPayload);
45981
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45982
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
45983
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwConversationDetailArtifacts] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Conversation Detail Artifacts', userPayload, EntityPermissionType.Read, 'AND');
45984
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
45985
+ const result = this.MapFieldNamesToCodeNames('MJ: Conversation Detail Artifacts', rows && rows.length > 0 ? rows[0] : {})
45986
+ return result;
45987
+ }
45988
+
45989
+ @Mutation(() => ConversationDetailArtifact_)
45990
+ async CreateConversationDetailArtifact(
45991
+ @Arg('input', () => CreateConversationDetailArtifactInput) input: CreateConversationDetailArtifactInput,
45992
+ @Ctx() { providers, userPayload }: AppContext,
45993
+ @PubSub() pubSub: PubSubEngine
45994
+ ) {
45995
+ const provider = GetReadWriteProvider(providers);
45996
+ return this.CreateRecord('MJ: Conversation Detail Artifacts', input, provider, userPayload, pubSub)
45997
+ }
45998
+
45999
+ @Mutation(() => ConversationDetailArtifact_)
46000
+ async UpdateConversationDetailArtifact(
46001
+ @Arg('input', () => UpdateConversationDetailArtifactInput) input: UpdateConversationDetailArtifactInput,
46002
+ @Ctx() { providers, userPayload }: AppContext,
46003
+ @PubSub() pubSub: PubSubEngine
46004
+ ) {
46005
+ const provider = GetReadWriteProvider(providers);
46006
+ return this.UpdateRecord('MJ: Conversation Detail Artifacts', input, provider, userPayload, pubSub);
46007
+ }
46008
+
46009
+ @Mutation(() => ConversationDetailArtifact_)
46010
+ async DeleteConversationDetailArtifact(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
46011
+ const provider = GetReadWriteProvider(providers);
46012
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
46013
+ return this.DeleteRecord('MJ: Conversation Detail Artifacts', key, options, provider, userPayload, pubSub);
46014
+ }
46015
+
46016
+ }
46017
+
45591
46018
  //****************************************************************************
45592
46019
  // ENTITY CLASS for MJ: Tasks
45593
46020
  //****************************************************************************
@@ -46536,6 +46963,10 @@ export class ArtifactVersion_ {
46536
46963
  @MaxLength(10)
46537
46964
  _mj__UpdatedAt: Date;
46538
46965
 
46966
+ @Field({nullable: true, description: `SHA-256 hash of the Content field for duplicate detection and version comparison`})
46967
+ @MaxLength(1000)
46968
+ ContentHash?: string;
46969
+
46539
46970
  @Field()
46540
46971
  @MaxLength(510)
46541
46972
  Artifact: string;
@@ -46544,6 +46975,9 @@ export class ArtifactVersion_ {
46544
46975
  @MaxLength(200)
46545
46976
  User: string;
46546
46977
 
46978
+ @Field(() => [ConversationDetailArtifact_])
46979
+ MJ_ConversationDetailArtifacts_ArtifactVersionIDArray: ConversationDetailArtifact_[]; // Link to MJ_ConversationDetailArtifacts
46980
+
46547
46981
  }
46548
46982
 
46549
46983
  //****************************************************************************
@@ -46571,6 +47005,9 @@ export class CreateArtifactVersionInput {
46571
47005
 
46572
47006
  @Field({ nullable: true })
46573
47007
  UserID?: string;
47008
+
47009
+ @Field({ nullable: true })
47010
+ ContentHash: string | null;
46574
47011
  }
46575
47012
 
46576
47013
 
@@ -46600,6 +47037,9 @@ export class UpdateArtifactVersionInput {
46600
47037
  @Field({ nullable: true })
46601
47038
  UserID?: string;
46602
47039
 
47040
+ @Field({ nullable: true })
47041
+ ContentHash?: string | null;
47042
+
46603
47043
  @Field(() => [KeyValuePairInput], { nullable: true })
46604
47044
  OldValues___?: KeyValuePairInput[];
46605
47045
  }
@@ -46662,6 +47102,17 @@ export class ArtifactVersionResolver extends ResolverBase {
46662
47102
  return result;
46663
47103
  }
46664
47104
 
47105
+ @FieldResolver(() => [ConversationDetailArtifact_])
47106
+ async MJ_ConversationDetailArtifacts_ArtifactVersionIDArray(@Root() artifactversion_: ArtifactVersion_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
47107
+ this.CheckUserReadPermissions('MJ: Conversation Detail Artifacts', userPayload);
47108
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
47109
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
47110
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwConversationDetailArtifacts] WHERE [ArtifactVersionID]='${artifactversion_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Conversation Detail Artifacts', userPayload, EntityPermissionType.Read, 'AND');
47111
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
47112
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Conversation Detail Artifacts', rows);
47113
+ return result;
47114
+ }
47115
+
46665
47116
  @Mutation(() => ArtifactVersion_)
46666
47117
  async CreateArtifactVersion(
46667
47118
  @Arg('input', () => CreateArtifactVersionInput) input: CreateArtifactVersionInput,