@memberjunction/server 2.107.0 → 2.108.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.
@@ -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, 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, 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';
23
23
 
24
24
 
25
25
  //****************************************************************************
@@ -2963,6 +2963,10 @@ if this limit is exceeded.`})
2963
2963
  @MaxLength(16)
2964
2964
  OwnerUserID: string;
2965
2965
 
2966
+ @Field({description: `Controls how the agent can be invoked: Any (default - can be top-level or sub-agent), Top-Level (only callable as primary agent), Sub-Agent (only callable as sub-agent). Used to filter available agents in tools like Sage.`})
2967
+ @MaxLength(40)
2968
+ InvocationMode: string;
2969
+
2966
2970
  @Field({nullable: true})
2967
2971
  @MaxLength(510)
2968
2972
  Parent?: string;
@@ -3158,6 +3162,9 @@ export class CreateMJAIAgentInput {
3158
3162
 
3159
3163
  @Field({ nullable: true })
3160
3164
  OwnerUserID?: string;
3165
+
3166
+ @Field({ nullable: true })
3167
+ InvocationMode?: string;
3161
3168
  }
3162
3169
 
3163
3170
 
@@ -3277,6 +3284,9 @@ export class UpdateMJAIAgentInput {
3277
3284
  @Field({ nullable: true })
3278
3285
  OwnerUserID?: string;
3279
3286
 
3287
+ @Field({ nullable: true })
3288
+ InvocationMode?: string;
3289
+
3280
3290
  @Field(() => [KeyValuePairInput], { nullable: true })
3281
3291
  OldValues___?: KeyValuePairInput[];
3282
3292
  }
@@ -5139,6 +5149,24 @@ export class MJAIAgentAction_ {
5139
5149
  @Field(() => Int, {nullable: true, description: `Maximum number of times this action can be executed per agent run`})
5140
5150
  MaxExecutionsPerRun?: number;
5141
5151
 
5152
+ @Field(() => Int, {nullable: true, description: `Number of conversation turns before action results expire from conversation context. NULL = never expire (default). 0 = expire immediately after next turn.`})
5153
+ ResultExpirationTurns?: number;
5154
+
5155
+ @Field({description: `How to handle expired action results: None (no expiration, default), Remove (delete message entirely), Compact (reduce size via CompactMode while preserving key information).`})
5156
+ @MaxLength(40)
5157
+ ResultExpirationMode: string;
5158
+
5159
+ @Field({nullable: true, description: `How to compact results when ResultExpirationMode=Compact: FirstNChars (truncate to CompactLength characters, fast and free), AISummary (use LLM to intelligently summarize with CompactPromptID or Action.DefaultCompactPromptID).`})
5160
+ @MaxLength(40)
5161
+ CompactMode?: string;
5162
+
5163
+ @Field(() => Int, {nullable: true, description: `Number of characters to keep when CompactMode=FirstNChars. Required when CompactMode is FirstNChars, ignored otherwise.`})
5164
+ CompactLength?: number;
5165
+
5166
+ @Field({nullable: true, description: `Optional override for AI summarization prompt when CompactMode=AISummary. Lookup hierarchy: this field -> Action.DefaultCompactPromptID -> system default. Allows agent-specific summarization focus (e.g., technical vs. marketing perspective).`})
5167
+ @MaxLength(16)
5168
+ CompactPromptID?: string;
5169
+
5142
5170
  @Field({nullable: true})
5143
5171
  @MaxLength(510)
5144
5172
  Agent?: string;
@@ -5147,6 +5175,10 @@ export class MJAIAgentAction_ {
5147
5175
  @MaxLength(850)
5148
5176
  Action?: string;
5149
5177
 
5178
+ @Field({nullable: true})
5179
+ @MaxLength(510)
5180
+ CompactPrompt?: string;
5181
+
5150
5182
  }
5151
5183
 
5152
5184
  //****************************************************************************
@@ -5171,6 +5203,21 @@ export class CreateMJAIAgentActionInput {
5171
5203
 
5172
5204
  @Field(() => Int, { nullable: true })
5173
5205
  MaxExecutionsPerRun: number | null;
5206
+
5207
+ @Field(() => Int, { nullable: true })
5208
+ ResultExpirationTurns: number | null;
5209
+
5210
+ @Field({ nullable: true })
5211
+ ResultExpirationMode?: string;
5212
+
5213
+ @Field({ nullable: true })
5214
+ CompactMode: string | null;
5215
+
5216
+ @Field(() => Int, { nullable: true })
5217
+ CompactLength: number | null;
5218
+
5219
+ @Field({ nullable: true })
5220
+ CompactPromptID: string | null;
5174
5221
  }
5175
5222
 
5176
5223
 
@@ -5197,6 +5244,21 @@ export class UpdateMJAIAgentActionInput {
5197
5244
  @Field(() => Int, { nullable: true })
5198
5245
  MaxExecutionsPerRun?: number | null;
5199
5246
 
5247
+ @Field(() => Int, { nullable: true })
5248
+ ResultExpirationTurns?: number | null;
5249
+
5250
+ @Field({ nullable: true })
5251
+ ResultExpirationMode?: string;
5252
+
5253
+ @Field({ nullable: true })
5254
+ CompactMode?: string | null;
5255
+
5256
+ @Field(() => Int, { nullable: true })
5257
+ CompactLength?: number | null;
5258
+
5259
+ @Field({ nullable: true })
5260
+ CompactPromptID?: string | null;
5261
+
5200
5262
  @Field(() => [KeyValuePairInput], { nullable: true })
5201
5263
  OldValues___?: KeyValuePairInput[];
5202
5264
  }
@@ -5823,6 +5885,10 @@ export class MJCollection_ {
5823
5885
  @MaxLength(10)
5824
5886
  _mj__UpdatedAt: Date;
5825
5887
 
5888
+ @Field({nullable: true, description: `The user who owns this collection and has full permissions`})
5889
+ @MaxLength(16)
5890
+ OwnerID?: string;
5891
+
5826
5892
  @Field()
5827
5893
  @MaxLength(510)
5828
5894
  Environment: string;
@@ -5831,6 +5897,10 @@ export class MJCollection_ {
5831
5897
  @MaxLength(510)
5832
5898
  Parent?: string;
5833
5899
 
5900
+ @Field({nullable: true})
5901
+ @MaxLength(200)
5902
+ Owner?: string;
5903
+
5834
5904
  @Field({nullable: true})
5835
5905
  @MaxLength(16)
5836
5906
  RootParentID?: string;
@@ -5838,6 +5908,9 @@ export class MJCollection_ {
5838
5908
  @Field(() => [MJCollectionArtifact_])
5839
5909
  MJ_CollectionArtifacts_CollectionIDArray: MJCollectionArtifact_[]; // Link to MJ_CollectionArtifacts
5840
5910
 
5911
+ @Field(() => [MJCollectionPermission_])
5912
+ MJ_CollectionPermissions_CollectionIDArray: MJCollectionPermission_[]; // Link to MJ_CollectionPermissions
5913
+
5841
5914
  @Field(() => [MJCollection_])
5842
5915
  MJ_Collections_ParentIDArray: MJCollection_[]; // Link to MJ_Collections
5843
5916
 
@@ -5871,6 +5944,9 @@ export class CreateMJCollectionInput {
5871
5944
 
5872
5945
  @Field(() => Int, { nullable: true })
5873
5946
  Sequence: number | null;
5947
+
5948
+ @Field({ nullable: true })
5949
+ OwnerID: string | null;
5874
5950
  }
5875
5951
 
5876
5952
 
@@ -5903,6 +5979,9 @@ export class UpdateMJCollectionInput {
5903
5979
  @Field(() => Int, { nullable: true })
5904
5980
  Sequence?: number | null;
5905
5981
 
5982
+ @Field({ nullable: true })
5983
+ OwnerID?: string | null;
5984
+
5906
5985
  @Field(() => [KeyValuePairInput], { nullable: true })
5907
5986
  OldValues___?: KeyValuePairInput[];
5908
5987
  }
@@ -5976,6 +6055,17 @@ export class MJCollectionResolver extends ResolverBase {
5976
6055
  return result;
5977
6056
  }
5978
6057
 
6058
+ @FieldResolver(() => [MJCollectionPermission_])
6059
+ async MJ_CollectionPermissions_CollectionIDArray(@Root() mjcollection_: MJCollection_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
6060
+ this.CheckUserReadPermissions('MJ: Collection Permissions', userPayload);
6061
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
6062
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
6063
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollectionPermissions] WHERE [CollectionID]='${mjcollection_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collection Permissions', userPayload, EntityPermissionType.Read, 'AND');
6064
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
6065
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collection Permissions', rows);
6066
+ return result;
6067
+ }
6068
+
5979
6069
  @FieldResolver(() => [MJCollection_])
5980
6070
  async MJ_Collections_ParentIDArray(@Root() mjcollection_: MJCollection_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
5981
6071
  this.CheckUserReadPermissions('MJ: Collections', userPayload);
@@ -6436,6 +6526,9 @@ export class MJAIPrompt_ {
6436
6526
  @Field(() => [MJAIAgentType_])
6437
6527
  MJ_AIAgentTypes_SystemPromptIDArray: MJAIAgentType_[]; // Link to MJ_AIAgentTypes
6438
6528
 
6529
+ @Field(() => [MJAIAgentAction_])
6530
+ AIAgentActions_CompactPromptIDArray: MJAIAgentAction_[]; // Link to AIAgentActions
6531
+
6439
6532
  @Field(() => [MJAIConfiguration_])
6440
6533
  MJ_AIConfigurations_DefaultPromptForContextSummarizationIDArray: MJAIConfiguration_[]; // Link to MJ_AIConfigurations
6441
6534
 
@@ -6457,6 +6550,9 @@ export class MJAIPrompt_ {
6457
6550
  @Field(() => [MJAIAgent_])
6458
6551
  AIAgents_ContextCompressionPromptIDArray: MJAIAgent_[]; // Link to AIAgents
6459
6552
 
6553
+ @Field(() => [MJAction_])
6554
+ Actions_DefaultCompactPromptIDArray: MJAction_[]; // Link to Actions
6555
+
6460
6556
  }
6461
6557
 
6462
6558
  //****************************************************************************
@@ -6860,6 +6956,17 @@ export class MJAIPromptResolver extends ResolverBase {
6860
6956
  return result;
6861
6957
  }
6862
6958
 
6959
+ @FieldResolver(() => [MJAIAgentAction_])
6960
+ async AIAgentActions_CompactPromptIDArray(@Root() mjaiprompt_: MJAIPrompt_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
6961
+ this.CheckUserReadPermissions('AI Agent Actions', userPayload);
6962
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
6963
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
6964
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentActions] WHERE [CompactPromptID]='${mjaiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'AI Agent Actions', userPayload, EntityPermissionType.Read, 'AND');
6965
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
6966
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Actions', rows);
6967
+ return result;
6968
+ }
6969
+
6863
6970
  @FieldResolver(() => [MJAIConfiguration_])
6864
6971
  async MJ_AIConfigurations_DefaultPromptForContextSummarizationIDArray(@Root() mjaiprompt_: MJAIPrompt_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
6865
6972
  this.CheckUserReadPermissions('MJ: AI Configurations', userPayload);
@@ -6937,6 +7044,17 @@ export class MJAIPromptResolver extends ResolverBase {
6937
7044
  return result;
6938
7045
  }
6939
7046
 
7047
+ @FieldResolver(() => [MJAction_])
7048
+ async Actions_DefaultCompactPromptIDArray(@Root() mjaiprompt_: MJAIPrompt_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
7049
+ this.CheckUserReadPermissions('Actions', userPayload);
7050
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
7051
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
7052
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwActions] WHERE [DefaultCompactPromptID]='${mjaiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'Actions', userPayload, EntityPermissionType.Read, 'AND');
7053
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
7054
+ const result = this.ArrayMapFieldNamesToCodeNames('Actions', rows);
7055
+ return result;
7056
+ }
7057
+
6940
7058
  @Mutation(() => MJAIPrompt_)
6941
7059
  async CreateMJAIPrompt(
6942
7060
  @Arg('input', () => CreateMJAIPromptInput) input: CreateMJAIPromptInput,
@@ -10878,12 +10996,12 @@ export class MJEntity_ {
10878
10996
  @Field(() => [MJQueryEntity_])
10879
10997
  QueryEntities_EntityIDArray: MJQueryEntity_[]; // Link to QueryEntities
10880
10998
 
10881
- @Field(() => [MJAccessControlRule_])
10882
- MJ_AccessControlRules_EntityIDArray: MJAccessControlRule_[]; // Link to MJ_AccessControlRules
10883
-
10884
10999
  @Field(() => [MJRecordLink_])
10885
11000
  MJ_RecordLinks_SourceEntityIDArray: MJRecordLink_[]; // Link to MJ_RecordLinks
10886
11001
 
11002
+ @Field(() => [MJAccessControlRule_])
11003
+ MJ_AccessControlRules_EntityIDArray: MJAccessControlRule_[]; // Link to MJ_AccessControlRules
11004
+
10887
11005
  @Field(() => [MJGeneratedCode_])
10888
11006
  GeneratedCodes_LinkedEntityIDArray: MJGeneratedCode_[]; // Link to GeneratedCodes
10889
11007
 
@@ -11691,25 +11809,25 @@ export class MJEntityResolverBase extends ResolverBase {
11691
11809
  return result;
11692
11810
  }
11693
11811
 
11694
- @FieldResolver(() => [MJAccessControlRule_])
11695
- async MJ_AccessControlRules_EntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
11696
- this.CheckUserReadPermissions('MJ: Access Control Rules', userPayload);
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);
11697
11815
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
11698
11816
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
11699
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAccessControlRules] WHERE [EntityID]='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Access Control Rules', userPayload, EntityPermissionType.Read, 'AND');
11817
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwRecordLinks] WHERE [SourceEntityID]='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Record Links', userPayload, EntityPermissionType.Read, 'AND');
11700
11818
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
11701
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Access Control Rules', rows);
11819
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Record Links', rows);
11702
11820
  return result;
11703
11821
  }
11704
11822
 
11705
- @FieldResolver(() => [MJRecordLink_])
11706
- async MJ_RecordLinks_SourceEntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
11707
- this.CheckUserReadPermissions('MJ: Record Links', userPayload);
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);
11708
11826
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
11709
11827
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
11710
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwRecordLinks] WHERE [SourceEntityID]='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Record Links', userPayload, EntityPermissionType.Read, 'AND');
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');
11711
11829
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
11712
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Record Links', rows);
11830
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Access Control Rules', rows);
11713
11831
  return result;
11714
11832
  }
11715
11833
 
@@ -11968,12 +12086,12 @@ export class MJUser_ {
11968
12086
  @Field(() => [MJPublicLink_])
11969
12087
  MJ_PublicLinks_UserIDArray: MJPublicLink_[]; // Link to MJ_PublicLinks
11970
12088
 
11971
- @Field(() => [MJScheduledJob_])
11972
- MJ_ScheduledJobs_NotifyUserIDArray: MJScheduledJob_[]; // Link to MJ_ScheduledJobs
11973
-
11974
12089
  @Field(() => [MJScheduledJobRun_])
11975
12090
  MJ_ScheduledJobRuns_ExecutedByUserIDArray: MJScheduledJobRun_[]; // Link to MJ_ScheduledJobRuns
11976
12091
 
12092
+ @Field(() => [MJScheduledJob_])
12093
+ MJ_ScheduledJobs_NotifyUserIDArray: MJScheduledJob_[]; // Link to MJ_ScheduledJobs
12094
+
11977
12095
  @Field(() => [MJResourcePermission_])
11978
12096
  ResourcePermissions_UserIDArray: MJResourcePermission_[]; // Link to ResourcePermissions
11979
12097
 
@@ -11992,12 +12110,21 @@ export class MJUser_ {
11992
12110
  @Field(() => [MJScheduledJob_])
11993
12111
  MJ_ScheduledJobs_OwnerUserIDArray: MJScheduledJob_[]; // Link to MJ_ScheduledJobs
11994
12112
 
12113
+ @Field(() => [MJCollectionPermission_])
12114
+ MJ_CollectionPermissions_SharedByUserIDArray: MJCollectionPermission_[]; // Link to MJ_CollectionPermissions
12115
+
11995
12116
  @Field(() => [MJAIAgentRun_])
11996
12117
  MJ_AIAgentRuns_UserIDArray: MJAIAgentRun_[]; // Link to MJ_AIAgentRuns
11997
12118
 
11998
12119
  @Field(() => [MJAIAgentPermission_])
11999
12120
  MJ_AIAgentPermissions_UserIDArray: MJAIAgentPermission_[]; // Link to MJ_AIAgentPermissions
12000
12121
 
12122
+ @Field(() => [MJCollectionPermission_])
12123
+ MJ_CollectionPermissions_UserIDArray: MJCollectionPermission_[]; // Link to MJ_CollectionPermissions
12124
+
12125
+ @Field(() => [MJCollection_])
12126
+ MJ_Collections_OwnerIDArray: MJCollection_[]; // Link to MJ_Collections
12127
+
12001
12128
  @Field(() => [MJTask_])
12002
12129
  MJ_Tasks_UserIDArray: MJTask_[]; // Link to MJ_Tasks
12003
12130
 
@@ -12603,25 +12730,25 @@ export class MJUserResolverBase extends ResolverBase {
12603
12730
  return result;
12604
12731
  }
12605
12732
 
12606
- @FieldResolver(() => [MJScheduledJob_])
12607
- async MJ_ScheduledJobs_NotifyUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
12608
- this.CheckUserReadPermissions('MJ: Scheduled Jobs', userPayload);
12733
+ @FieldResolver(() => [MJScheduledJobRun_])
12734
+ async MJ_ScheduledJobRuns_ExecutedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
12735
+ this.CheckUserReadPermissions('MJ: Scheduled Job Runs', userPayload);
12609
12736
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
12610
12737
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
12611
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobs] WHERE [NotifyUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Jobs', userPayload, EntityPermissionType.Read, 'AND');
12738
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobRuns] WHERE [ExecutedByUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Job Runs', userPayload, EntityPermissionType.Read, 'AND');
12612
12739
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
12613
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Jobs', rows);
12740
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Job Runs', rows);
12614
12741
  return result;
12615
12742
  }
12616
12743
 
12617
- @FieldResolver(() => [MJScheduledJobRun_])
12618
- async MJ_ScheduledJobRuns_ExecutedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
12619
- this.CheckUserReadPermissions('MJ: Scheduled Job Runs', userPayload);
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);
12620
12747
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
12621
12748
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
12622
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobRuns] WHERE [ExecutedByUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Job Runs', userPayload, EntityPermissionType.Read, 'AND');
12749
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobs] WHERE [NotifyUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Jobs', userPayload, EntityPermissionType.Read, 'AND');
12623
12750
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
12624
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Job Runs', rows);
12751
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Jobs', rows);
12625
12752
  return result;
12626
12753
  }
12627
12754
 
@@ -12691,6 +12818,17 @@ export class MJUserResolverBase extends ResolverBase {
12691
12818
  return result;
12692
12819
  }
12693
12820
 
12821
+ @FieldResolver(() => [MJCollectionPermission_])
12822
+ async MJ_CollectionPermissions_SharedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
12823
+ this.CheckUserReadPermissions('MJ: Collection Permissions', userPayload);
12824
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
12825
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
12826
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollectionPermissions] WHERE [SharedByUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collection Permissions', userPayload, EntityPermissionType.Read, 'AND');
12827
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
12828
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collection Permissions', rows);
12829
+ return result;
12830
+ }
12831
+
12694
12832
  @FieldResolver(() => [MJAIAgentRun_])
12695
12833
  async MJ_AIAgentRuns_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
12696
12834
  this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
@@ -12713,6 +12851,28 @@ export class MJUserResolverBase extends ResolverBase {
12713
12851
  return result;
12714
12852
  }
12715
12853
 
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);
12857
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
12858
+ 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');
12860
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
12861
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collection Permissions', rows);
12862
+ return result;
12863
+ }
12864
+
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);
12868
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
12869
+ 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');
12871
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
12872
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collections', rows);
12873
+ return result;
12874
+ }
12875
+
12716
12876
  @FieldResolver(() => [MJTask_])
12717
12877
  async MJ_Tasks_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
12718
12878
  this.CheckUserReadPermissions('MJ: Tasks', userPayload);
@@ -23501,6 +23661,9 @@ export class MJConversationDetail_ {
23501
23661
  @MaxLength(40)
23502
23662
  Status: string;
23503
23663
 
23664
+ @Field({nullable: true, description: `JSON array of suggested responses that can be displayed to the user for quick replies. Each response object contains: text (display text), allowInput (boolean), iconClass (optional Font Awesome class), and data (optional payload).`})
23665
+ SuggestedResponses?: string;
23666
+
23504
23667
  @Field({nullable: true})
23505
23668
  @MaxLength(510)
23506
23669
  Conversation?: string;
@@ -23599,6 +23762,9 @@ export class CreateMJConversationDetailInput {
23599
23762
 
23600
23763
  @Field({ nullable: true })
23601
23764
  Status?: string;
23765
+
23766
+ @Field({ nullable: true })
23767
+ SuggestedResponses: string | null;
23602
23768
  }
23603
23769
 
23604
23770
 
@@ -23664,6 +23830,9 @@ export class UpdateMJConversationDetailInput {
23664
23830
  @Field({ nullable: true })
23665
23831
  Status?: string;
23666
23832
 
23833
+ @Field({ nullable: true })
23834
+ SuggestedResponses?: string | null;
23835
+
23667
23836
  @Field(() => [KeyValuePairInput], { nullable: true })
23668
23837
  OldValues___?: KeyValuePairInput[];
23669
23838
  }
@@ -31658,6 +31827,10 @@ export class MJAction_ {
31658
31827
  @MaxLength(200)
31659
31828
  IconClass?: string;
31660
31829
 
31830
+ @Field({nullable: true, description: `Default prompt for compacting/summarizing this action's results when used by agents with CompactMode=AISummary. Action designers define how their specific results should be summarized. Can be overridden per agent in AIAgentAction.CompactPromptID.`})
31831
+ @MaxLength(16)
31832
+ DefaultCompactPromptID?: string;
31833
+
31661
31834
  @Field({nullable: true})
31662
31835
  @MaxLength(510)
31663
31836
  Category?: string;
@@ -31670,6 +31843,10 @@ export class MJAction_ {
31670
31843
  @MaxLength(850)
31671
31844
  Parent?: string;
31672
31845
 
31846
+ @Field({nullable: true})
31847
+ @MaxLength(510)
31848
+ DefaultCompactPrompt?: string;
31849
+
31673
31850
  @Field({nullable: true})
31674
31851
  @MaxLength(16)
31675
31852
  RootParentID?: string;
@@ -31773,6 +31950,9 @@ export class CreateMJActionInput {
31773
31950
 
31774
31951
  @Field({ nullable: true })
31775
31952
  IconClass: string | null;
31953
+
31954
+ @Field({ nullable: true })
31955
+ DefaultCompactPromptID: string | null;
31776
31956
  }
31777
31957
 
31778
31958
 
@@ -31841,6 +32021,9 @@ export class UpdateMJActionInput {
31841
32021
  @Field({ nullable: true })
31842
32022
  IconClass?: string | null;
31843
32023
 
32024
+ @Field({ nullable: true })
32025
+ DefaultCompactPromptID?: string | null;
32026
+
31844
32027
  @Field(() => [KeyValuePairInput], { nullable: true })
31845
32028
  OldValues___?: KeyValuePairInput[];
31846
32029
  }
@@ -41795,6 +41978,212 @@ export class MJConversationArtifactResolver extends ResolverBase {
41795
41978
 
41796
41979
  }
41797
41980
 
41981
+ //****************************************************************************
41982
+ // ENTITY CLASS for MJ: Collection Permissions
41983
+ //****************************************************************************
41984
+ @ObjectType({ description: `Manages sharing permissions for collections, allowing granular access control` })
41985
+ export class MJCollectionPermission_ {
41986
+ @Field()
41987
+ @MaxLength(16)
41988
+ ID: string;
41989
+
41990
+ @Field()
41991
+ @MaxLength(16)
41992
+ CollectionID: string;
41993
+
41994
+ @Field()
41995
+ @MaxLength(16)
41996
+ UserID: string;
41997
+
41998
+ @Field(() => Boolean, {description: `Always 1 - users must have read permission to access a shared collection`})
41999
+ CanRead: boolean;
42000
+
42001
+ @Field(() => Boolean, {description: `Can share this collection with others (but cannot grant more permissions than they have)`})
42002
+ CanShare: boolean;
42003
+
42004
+ @Field(() => Boolean, {description: `Can add/remove artifacts to/from this collection`})
42005
+ CanEdit: boolean;
42006
+
42007
+ @Field(() => Boolean, {description: `Can delete the collection, child collections, and artifacts`})
42008
+ CanDelete: boolean;
42009
+
42010
+ @Field({nullable: true, description: `The user who shared this collection (NULL if shared by owner)`})
42011
+ @MaxLength(16)
42012
+ SharedByUserID?: string;
42013
+
42014
+ @Field()
42015
+ @MaxLength(10)
42016
+ _mj__CreatedAt: Date;
42017
+
42018
+ @Field()
42019
+ @MaxLength(10)
42020
+ _mj__UpdatedAt: Date;
42021
+
42022
+ @Field()
42023
+ @MaxLength(510)
42024
+ Collection: string;
42025
+
42026
+ @Field()
42027
+ @MaxLength(200)
42028
+ User: string;
42029
+
42030
+ @Field({nullable: true})
42031
+ @MaxLength(200)
42032
+ SharedByUser?: string;
42033
+
42034
+ }
42035
+
42036
+ //****************************************************************************
42037
+ // INPUT TYPE for MJ: Collection Permissions
42038
+ //****************************************************************************
42039
+ @InputType()
42040
+ export class CreateMJCollectionPermissionInput {
42041
+ @Field({ nullable: true })
42042
+ ID?: string;
42043
+
42044
+ @Field({ nullable: true })
42045
+ CollectionID?: string;
42046
+
42047
+ @Field({ nullable: true })
42048
+ UserID?: string;
42049
+
42050
+ @Field(() => Boolean, { nullable: true })
42051
+ CanRead?: boolean;
42052
+
42053
+ @Field(() => Boolean, { nullable: true })
42054
+ CanShare?: boolean;
42055
+
42056
+ @Field(() => Boolean, { nullable: true })
42057
+ CanEdit?: boolean;
42058
+
42059
+ @Field(() => Boolean, { nullable: true })
42060
+ CanDelete?: boolean;
42061
+
42062
+ @Field({ nullable: true })
42063
+ SharedByUserID: string | null;
42064
+ }
42065
+
42066
+
42067
+ //****************************************************************************
42068
+ // INPUT TYPE for MJ: Collection Permissions
42069
+ //****************************************************************************
42070
+ @InputType()
42071
+ export class UpdateMJCollectionPermissionInput {
42072
+ @Field()
42073
+ ID: string;
42074
+
42075
+ @Field({ nullable: true })
42076
+ CollectionID?: string;
42077
+
42078
+ @Field({ nullable: true })
42079
+ UserID?: string;
42080
+
42081
+ @Field(() => Boolean, { nullable: true })
42082
+ CanRead?: boolean;
42083
+
42084
+ @Field(() => Boolean, { nullable: true })
42085
+ CanShare?: boolean;
42086
+
42087
+ @Field(() => Boolean, { nullable: true })
42088
+ CanEdit?: boolean;
42089
+
42090
+ @Field(() => Boolean, { nullable: true })
42091
+ CanDelete?: boolean;
42092
+
42093
+ @Field({ nullable: true })
42094
+ SharedByUserID?: string | null;
42095
+
42096
+ @Field(() => [KeyValuePairInput], { nullable: true })
42097
+ OldValues___?: KeyValuePairInput[];
42098
+ }
42099
+
42100
+ //****************************************************************************
42101
+ // RESOLVER for MJ: Collection Permissions
42102
+ //****************************************************************************
42103
+ @ObjectType()
42104
+ export class RunMJCollectionPermissionViewResult {
42105
+ @Field(() => [MJCollectionPermission_])
42106
+ Results: MJCollectionPermission_[];
42107
+
42108
+ @Field(() => String, {nullable: true})
42109
+ UserViewRunID?: string;
42110
+
42111
+ @Field(() => Int, {nullable: true})
42112
+ RowCount: number;
42113
+
42114
+ @Field(() => Int, {nullable: true})
42115
+ TotalRowCount: number;
42116
+
42117
+ @Field(() => Int, {nullable: true})
42118
+ ExecutionTime: number;
42119
+
42120
+ @Field({nullable: true})
42121
+ ErrorMessage?: string;
42122
+
42123
+ @Field(() => Boolean, {nullable: false})
42124
+ Success: boolean;
42125
+ }
42126
+
42127
+ @Resolver(MJCollectionPermission_)
42128
+ export class MJCollectionPermissionResolver extends ResolverBase {
42129
+ @Query(() => RunMJCollectionPermissionViewResult)
42130
+ async RunMJCollectionPermissionViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
42131
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
42132
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
42133
+ }
42134
+
42135
+ @Query(() => RunMJCollectionPermissionViewResult)
42136
+ async RunMJCollectionPermissionViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
42137
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
42138
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
42139
+ }
42140
+
42141
+ @Query(() => RunMJCollectionPermissionViewResult)
42142
+ async RunMJCollectionPermissionDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
42143
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
42144
+ input.EntityName = 'MJ: Collection Permissions';
42145
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
42146
+ }
42147
+ @Query(() => MJCollectionPermission_, { nullable: true })
42148
+ async MJCollectionPermission(@Arg('ID', () => String) ID: string, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJCollectionPermission_ | null> {
42149
+ this.CheckUserReadPermissions('MJ: Collection Permissions', userPayload);
42150
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
42151
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
42152
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollectionPermissions] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collection Permissions', userPayload, EntityPermissionType.Read, 'AND');
42153
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
42154
+ const result = this.MapFieldNamesToCodeNames('MJ: Collection Permissions', rows && rows.length > 0 ? rows[0] : {})
42155
+ return result;
42156
+ }
42157
+
42158
+ @Mutation(() => MJCollectionPermission_)
42159
+ async CreateMJCollectionPermission(
42160
+ @Arg('input', () => CreateMJCollectionPermissionInput) input: CreateMJCollectionPermissionInput,
42161
+ @Ctx() { providers, userPayload }: AppContext,
42162
+ @PubSub() pubSub: PubSubEngine
42163
+ ) {
42164
+ const provider = GetReadWriteProvider(providers);
42165
+ return this.CreateRecord('MJ: Collection Permissions', input, provider, userPayload, pubSub)
42166
+ }
42167
+
42168
+ @Mutation(() => MJCollectionPermission_)
42169
+ async UpdateMJCollectionPermission(
42170
+ @Arg('input', () => UpdateMJCollectionPermissionInput) input: UpdateMJCollectionPermissionInput,
42171
+ @Ctx() { providers, userPayload }: AppContext,
42172
+ @PubSub() pubSub: PubSubEngine
42173
+ ) {
42174
+ const provider = GetReadWriteProvider(providers);
42175
+ return this.UpdateRecord('MJ: Collection Permissions', input, provider, userPayload, pubSub);
42176
+ }
42177
+
42178
+ @Mutation(() => MJCollectionPermission_)
42179
+ async DeleteMJCollectionPermission(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
42180
+ const provider = GetReadWriteProvider(providers);
42181
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
42182
+ return this.DeleteRecord('MJ: Collection Permissions', key, options, provider, userPayload, pubSub);
42183
+ }
42184
+
42185
+ }
42186
+
41798
42187
  //****************************************************************************
41799
42188
  // ENTITY CLASS for MJ: AI Agent Prompts
41800
42189
  //****************************************************************************
@@ -43133,6 +43522,12 @@ export class MJAIAgentRelationship_ {
43133
43522
  @Field({nullable: true, description: `JSON configuration mapping sub-agent result payload paths to parent agent payload paths. Enables controlled merging of sub-agent results. Format: {"subAgentPath": "parentPath", "*": "captureAllPath"}. If null, sub-agent results are not automatically merged into parent payload.`})
43134
43523
  SubAgentOutputMapping?: string;
43135
43524
 
43525
+ @Field({nullable: true, description: `JSON mapping of parent payload paths to sub-agent initial payload paths. Enables structural data transfer from parent to related sub-agent. Format: {"parentPath": "subAgentPath", "parent.nested": "subAgent.field"}. Example: {"searchQuery": "query", "maxResults": "limit"}. If null, sub-agent starts with empty payload (default behavior).`})
43526
+ SubAgentInputMapping?: string;
43527
+
43528
+ @Field({nullable: true, description: `JSON array of parent payload paths to send as LLM context to related sub-agent. Sub-agent receives this data in a formatted context message before its task message. Format: ["path1", "path2.nested", "path3.*", "*"]. Use "*" to send entire parent payload. Example: ["userPreferences", "priorFindings.summary", "sources[*]"]. If null, no parent context is sent (default behavior).`})
43529
+ SubAgentContextPaths?: string;
43530
+
43136
43531
  @Field({nullable: true})
43137
43532
  @MaxLength(510)
43138
43533
  Agent?: string;
@@ -43162,6 +43557,12 @@ export class CreateMJAIAgentRelationshipInput {
43162
43557
 
43163
43558
  @Field({ nullable: true })
43164
43559
  SubAgentOutputMapping: string | null;
43560
+
43561
+ @Field({ nullable: true })
43562
+ SubAgentInputMapping: string | null;
43563
+
43564
+ @Field({ nullable: true })
43565
+ SubAgentContextPaths: string | null;
43165
43566
  }
43166
43567
 
43167
43568
 
@@ -43185,6 +43586,12 @@ export class UpdateMJAIAgentRelationshipInput {
43185
43586
  @Field({ nullable: true })
43186
43587
  SubAgentOutputMapping?: string | null;
43187
43588
 
43589
+ @Field({ nullable: true })
43590
+ SubAgentInputMapping?: string | null;
43591
+
43592
+ @Field({ nullable: true })
43593
+ SubAgentContextPaths?: string | null;
43594
+
43188
43595
  @Field(() => [KeyValuePairInput], { nullable: true })
43189
43596
  OldValues___?: KeyValuePairInput[];
43190
43597
  }