@memberjunction/server 5.23.0 → 5.24.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 (33) hide show
  1. package/dist/config.d.ts.map +1 -1
  2. package/dist/config.js +11 -0
  3. package/dist/config.js.map +1 -1
  4. package/dist/generated/generated.d.ts +462 -0
  5. package/dist/generated/generated.d.ts.map +1 -1
  6. package/dist/generated/generated.js +16584 -13956
  7. package/dist/generated/generated.js.map +1 -1
  8. package/dist/generic/RunViewResolver.d.ts.map +1 -1
  9. package/dist/generic/RunViewResolver.js.map +1 -1
  10. package/dist/resolvers/AutotagPipelineResolver.d.ts +10 -1
  11. package/dist/resolvers/AutotagPipelineResolver.d.ts.map +1 -1
  12. package/dist/resolvers/AutotagPipelineResolver.js +97 -13
  13. package/dist/resolvers/AutotagPipelineResolver.js.map +1 -1
  14. package/dist/resolvers/FetchEntityVectorsResolver.d.ts.map +1 -1
  15. package/dist/resolvers/FetchEntityVectorsResolver.js +6 -2
  16. package/dist/resolvers/FetchEntityVectorsResolver.js.map +1 -1
  17. package/dist/resolvers/RunAIAgentResolver.d.ts +21 -0
  18. package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
  19. package/dist/resolvers/RunAIAgentResolver.js +73 -33
  20. package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
  21. package/dist/resolvers/SearchKnowledgeResolver.d.ts +42 -1
  22. package/dist/resolvers/SearchKnowledgeResolver.d.ts.map +1 -1
  23. package/dist/resolvers/SearchKnowledgeResolver.js +239 -13
  24. package/dist/resolvers/SearchKnowledgeResolver.js.map +1 -1
  25. package/package.json +63 -63
  26. package/src/__tests__/search-knowledge-tags.test.ts +415 -0
  27. package/src/config.ts +11 -0
  28. package/src/generated/generated.ts +1807 -1
  29. package/src/generic/RunViewResolver.ts +1 -0
  30. package/src/resolvers/AutotagPipelineResolver.ts +99 -10
  31. package/src/resolvers/FetchEntityVectorsResolver.ts +6 -2
  32. package/src/resolvers/RunAIAgentResolver.ts +95 -56
  33. package/src/resolvers/SearchKnowledgeResolver.ts +270 -13
@@ -18,7 +18,7 @@ import { mj_core_schema } from '../config.js';
18
18
 
19
19
 
20
20
 
21
- import { MJAccessControlRuleEntity, MJActionAuthorizationEntity, MJActionCategoryEntity, MJActionContextTypeEntity, MJActionContextEntity, MJActionExecutionLogEntity, MJActionFilterEntity, MJActionLibraryEntity, MJActionParamEntity, MJActionResultCodeEntity, MJActionEntity, MJAIActionEntity, MJAIAgentActionEntity, MJAIAgentArtifactTypeEntity, MJAIAgentCategoryEntity, MJAIAgentClientToolEntity, MJAIAgentConfigurationEntity, MJAIAgentDataSourceEntity, MJAIAgentExampleEntity, MJAIAgentLearningCycleEntity, MJAIAgentModalityEntity, MJAIAgentModelEntity, MJAIAgentNoteTypeEntity, MJAIAgentNoteEntity, MJAIAgentPermissionEntity, MJAIAgentPromptEntity, MJAIAgentRelationshipEntity, MJAIAgentRequestTypeEntity, MJAIAgentRequestEntity, MJAIAgentRunMediaEntity, MJAIAgentRunStepEntity, MJAIAgentRunEntity, MJAIAgentStepPathEntity, MJAIAgentStepEntity, MJAIAgentTypeEntity, MJAIAgentEntity, MJAIArchitectureEntity, MJAIClientToolDefinitionEntity, MJAIConfigurationParamEntity, MJAIConfigurationEntity, MJAICredentialBindingEntity, MJAIModalityEntity, MJAIModelActionEntity, MJAIModelArchitectureEntity, MJAIModelCostEntity, MJAIModelModalityEntity, MJAIModelPriceTypeEntity, MJAIModelPriceUnitTypeEntity, MJAIModelTypeEntity, MJAIModelVendorEntity, MJAIModelEntity, MJAIPromptCategoryEntity, MJAIPromptModelEntity, MJAIPromptRunMediaEntity, MJAIPromptRunEntity, MJAIPromptTypeEntity, MJAIPromptEntity, MJAIResultCacheEntity, MJAIVendorTypeDefinitionEntity, MJAIVendorTypeEntity, MJAIVendorEntity, MJAPIApplicationScopeEntity, MJAPIApplicationEntity, MJAPIKeyApplicationEntity, MJAPIKeyScopeEntity, MJAPIKeyUsageLogEntity, MJAPIKeyEntity, MJAPIScopeEntity, MJApplicationEntityEntity, MJApplicationSettingEntity, MJApplicationEntity, MJArtifactPermissionEntity, MJArtifactTypeEntity, MJArtifactUseEntity, MJArtifactVersionAttributeEntity, MJArtifactVersionEntity, MJArtifactEntity, MJAuditLogTypeEntity, MJAuditLogEntity, MJAuthorizationRoleEntity, MJAuthorizationEntity, MJCollectionArtifactEntity, MJCollectionPermissionEntity, MJCollectionEntity, MJCommunicationBaseMessageTypeEntity, MJCommunicationLogEntity, MJCommunicationProviderMessageTypeEntity, MJCommunicationProviderEntity, MJCommunicationRunEntity, MJCompanyEntity, MJCompanyIntegrationEntityMapEntity, MJCompanyIntegrationFieldMapEntity, MJCompanyIntegrationRecordMapEntity, MJCompanyIntegrationRunAPILogEntity, MJCompanyIntegrationRunDetailEntity, MJCompanyIntegrationRunEntity, MJCompanyIntegrationSyncWatermarkEntity, MJCompanyIntegrationEntity, MJComponentDependencyEntity, MJComponentLibraryEntity, MJComponentLibraryLinkEntity, MJComponentRegistryEntity, MJComponentEntity, MJContentFileTypeEntity, MJContentItemAttributeEntity, MJContentItemTagEntity, MJContentItemEntity, MJContentProcessRunEntity, MJContentSourceParamEntity, MJContentSourceTypeParamEntity, MJContentSourceTypeEntity, MJContentSourceEntity, MJContentTypeAttributeEntity, MJContentTypeEntity, MJConversationArtifactPermissionEntity, MJConversationArtifactVersionEntity, MJConversationArtifactEntity, MJConversationDetailArtifactEntity, MJConversationDetailAttachmentEntity, MJConversationDetailRatingEntity, MJConversationDetailEntity, MJConversationEntity, MJCredentialCategoryEntity, MJCredentialTypeEntity, MJCredentialEntity, MJDashboardCategoryEntity, MJDashboardCategoryLinkEntity, MJDashboardCategoryPermissionEntity, MJDashboardPartTypeEntity, MJDashboardPermissionEntity, MJDashboardUserPreferenceEntity, MJDashboardUserStateEntity, MJDashboardEntity, MJDataContextItemEntity, MJDataContextEntity, MJDatasetItemEntity, MJDatasetEntity, MJDuplicateRunDetailMatchEntity, MJDuplicateRunDetailEntity, MJDuplicateRunEntity, MJEmployeeCompanyIntegrationEntity, MJEmployeeRoleEntity, MJEmployeeSkillEntity, MJEmployeeEntity, MJEncryptionAlgorithmEntity, MJEncryptionKeySourceEntity, MJEncryptionKeyEntity, MJEntityEntity, MJEntityActionFilterEntity, MJEntityActionInvocationTypeEntity, MJEntityActionInvocationEntity, MJEntityActionParamEntity, MJEntityActionEntity, MJEntityAIActionEntity, MJEntityCommunicationFieldEntity, MJEntityCommunicationMessageTypeEntity, MJEntityDocumentRunEntity, MJEntityDocumentSettingEntity, MJEntityDocumentTypeEntity, MJEntityDocumentEntity, MJEntityFieldValueEntity, MJEntityFieldEntity, MJEntityOrganicKeyRelatedEntityEntity, MJEntityOrganicKeyEntity, MJEntityPermissionEntity, MJEntityRecordDocumentEntity, MJEntityRelationshipDisplayComponentEntity, MJEntityRelationshipEntity, MJEntitySettingEntity, MJEnvironmentEntity, MJErrorLogEntity, MJExplorerNavigationItemEntity, MJFileCategoryEntity, MJFileEntityRecordLinkEntity, MJFileStorageAccountEntity, MJFileStorageProviderEntity, MJFileEntity, MJGeneratedCodeCategoryEntity, MJGeneratedCodeEntity, MJIntegrationObjectFieldEntity, MJIntegrationObjectEntity, MJIntegrationSourceTypeEntity, MJIntegrationURLFormatEntity, MJIntegrationEntity, MJLibraryEntity, MJLibraryItemEntity, MJListCategoryEntity, MJListDetailEntity, MJListInvitationEntity, MJListShareEntity, MJListEntity, MJMCPServerConnectionPermissionEntity, MJMCPServerConnectionToolEntity, MJMCPServerConnectionEntity, MJMCPServerToolEntity, MJMCPServerEntity, MJMCPToolExecutionLogEntity, MJOAuthAuthServerMetadataCacheEntity, MJOAuthAuthorizationStateEntity, MJOAuthClientRegistrationEntity, MJOAuthTokenEntity, MJOpenAppDependencyEntity, MJOpenAppInstallHistoryEntity, MJOpenAppEntity, MJOutputDeliveryTypeEntity, MJOutputFormatTypeEntity, MJOutputTriggerTypeEntity, MJProjectEntity, MJPublicLinkEntity, MJQueryEntity, MJQueryCategoryEntity, MJQueryDependencyEntity, MJQueryEntityEntity, MJQueryFieldEntity, MJQueryParameterEntity, MJQueryPermissionEntity, MJQuerySQLEntity, MJQueueTaskEntity, MJQueueTypeEntity, MJQueueEntity, MJRecommendationItemEntity, MJRecommendationProviderEntity, MJRecommendationRunEntity, MJRecommendationEntity, MJRecordChangeReplayRunEntity, MJRecordChangeEntity, MJRecordLinkEntity, MJRecordMergeDeletionLogEntity, MJRecordMergeLogEntity, MJReportCategoryEntity, MJReportSnapshotEntity, MJReportUserStateEntity, MJReportVersionEntity, MJReportEntity, MJResourceLinkEntity, MJResourcePermissionEntity, MJResourceTypeEntity, MJRoleEntity, MJRowLevelSecurityFilterEntity, MJScheduledActionParamEntity, MJScheduledActionEntity, MJScheduledJobRunEntity, MJScheduledJobTypeEntity, MJScheduledJobEntity, MJSchemaInfoEntity, MJSkillEntity, MJSQLDialectEntity, MJTaggedItemEntity, MJTagEntity, MJTaskDependencyEntity, MJTaskTypeEntity, MJTaskEntity, MJTemplateCategoryEntity, MJTemplateContentTypeEntity, MJTemplateContentEntity, MJTemplateParamEntity, MJTemplateEntity, MJTestRubricEntity, MJTestRunFeedbackEntity, MJTestRunOutputTypeEntity, MJTestRunOutputEntity, MJTestRunEntity, MJTestSuiteRunEntity, MJTestSuiteTestEntity, MJTestSuiteEntity, MJTestTypeEntity, MJTestEntity, MJUserApplicationEntityEntity, MJUserApplicationEntity, MJUserFavoriteEntity, MJUserNotificationPreferenceEntity, MJUserNotificationTypeEntity, MJUserNotificationEntity, MJUserRecordLogEntity, MJUserRoleEntity, MJUserSettingEntity, MJUserViewCategoryEntity, MJUserViewRunDetailEntity, MJUserViewRunEntity, MJUserViewEntity, MJUserEntity, MJVectorDatabaseEntity, MJVectorIndexEntity, MJVersionInstallationEntity, MJVersionLabelItemEntity, MJVersionLabelRestoreEntity, MJVersionLabelEntity, MJWorkflowEngineEntity, MJWorkflowRunEntity, MJWorkflowEntity, MJWorkspaceItemEntity, MJWorkspaceEntity } from '@memberjunction/core-entities';
21
+ import { MJAccessControlRuleEntity, MJActionAuthorizationEntity, MJActionCategoryEntity, MJActionContextTypeEntity, MJActionContextEntity, MJActionExecutionLogEntity, MJActionFilterEntity, MJActionLibraryEntity, MJActionParamEntity, MJActionResultCodeEntity, MJActionEntity, MJAIActionEntity, MJAIAgentActionEntity, MJAIAgentArtifactTypeEntity, MJAIAgentCategoryEntity, MJAIAgentClientToolEntity, MJAIAgentConfigurationEntity, MJAIAgentDataSourceEntity, MJAIAgentExampleEntity, MJAIAgentLearningCycleEntity, MJAIAgentModalityEntity, MJAIAgentModelEntity, MJAIAgentNoteTypeEntity, MJAIAgentNoteEntity, MJAIAgentPermissionEntity, MJAIAgentPromptEntity, MJAIAgentRelationshipEntity, MJAIAgentRequestTypeEntity, MJAIAgentRequestEntity, MJAIAgentRunMediaEntity, MJAIAgentRunStepEntity, MJAIAgentRunEntity, MJAIAgentStepPathEntity, MJAIAgentStepEntity, MJAIAgentTypeEntity, MJAIAgentEntity, MJAIArchitectureEntity, MJAIClientToolDefinitionEntity, MJAIConfigurationParamEntity, MJAIConfigurationEntity, MJAICredentialBindingEntity, MJAIModalityEntity, MJAIModelActionEntity, MJAIModelArchitectureEntity, MJAIModelCostEntity, MJAIModelModalityEntity, MJAIModelPriceTypeEntity, MJAIModelPriceUnitTypeEntity, MJAIModelTypeEntity, MJAIModelVendorEntity, MJAIModelEntity, MJAIPromptCategoryEntity, MJAIPromptModelEntity, MJAIPromptRunMediaEntity, MJAIPromptRunEntity, MJAIPromptTypeEntity, MJAIPromptEntity, MJAIResultCacheEntity, MJAIVendorTypeDefinitionEntity, MJAIVendorTypeEntity, MJAIVendorEntity, MJAPIApplicationScopeEntity, MJAPIApplicationEntity, MJAPIKeyApplicationEntity, MJAPIKeyScopeEntity, MJAPIKeyUsageLogEntity, MJAPIKeyEntity, MJAPIScopeEntity, MJApplicationEntityEntity, MJApplicationSettingEntity, MJApplicationEntity, MJArtifactPermissionEntity, MJArtifactTypeEntity, MJArtifactUseEntity, MJArtifactVersionAttributeEntity, MJArtifactVersionEntity, MJArtifactEntity, MJAuditLogTypeEntity, MJAuditLogEntity, MJAuthorizationRoleEntity, MJAuthorizationEntity, MJCollectionArtifactEntity, MJCollectionPermissionEntity, MJCollectionEntity, MJCommunicationBaseMessageTypeEntity, MJCommunicationLogEntity, MJCommunicationProviderMessageTypeEntity, MJCommunicationProviderEntity, MJCommunicationRunEntity, MJCompanyEntity, MJCompanyIntegrationEntityMapEntity, MJCompanyIntegrationFieldMapEntity, MJCompanyIntegrationRecordMapEntity, MJCompanyIntegrationRunAPILogEntity, MJCompanyIntegrationRunDetailEntity, MJCompanyIntegrationRunEntity, MJCompanyIntegrationSyncWatermarkEntity, MJCompanyIntegrationEntity, MJComponentDependencyEntity, MJComponentLibraryEntity, MJComponentLibraryLinkEntity, MJComponentRegistryEntity, MJComponentEntity, MJContentFileTypeEntity, MJContentItemAttributeEntity, MJContentItemDuplicateEntity, MJContentItemTagEntity, MJContentItemEntity, MJContentProcessRunDetailEntity, MJContentProcessRunPromptRunEntity, MJContentProcessRunEntity, MJContentSourceParamEntity, MJContentSourceTypeParamEntity, MJContentSourceTypeEntity, MJContentSourceEntity, MJContentTypeAttributeEntity, MJContentTypeEntity, MJConversationArtifactPermissionEntity, MJConversationArtifactVersionEntity, MJConversationArtifactEntity, MJConversationDetailArtifactEntity, MJConversationDetailAttachmentEntity, MJConversationDetailRatingEntity, MJConversationDetailEntity, MJConversationEntity, MJCredentialCategoryEntity, MJCredentialTypeEntity, MJCredentialEntity, MJDashboardCategoryEntity, MJDashboardCategoryLinkEntity, MJDashboardCategoryPermissionEntity, MJDashboardPartTypeEntity, MJDashboardPermissionEntity, MJDashboardUserPreferenceEntity, MJDashboardUserStateEntity, MJDashboardEntity, MJDataContextItemEntity, MJDataContextEntity, MJDatasetItemEntity, MJDatasetEntity, MJDuplicateRunDetailMatchEntity, MJDuplicateRunDetailEntity, MJDuplicateRunEntity, MJEmployeeCompanyIntegrationEntity, MJEmployeeRoleEntity, MJEmployeeSkillEntity, MJEmployeeEntity, MJEncryptionAlgorithmEntity, MJEncryptionKeySourceEntity, MJEncryptionKeyEntity, MJEntityEntity, MJEntityActionFilterEntity, MJEntityActionInvocationTypeEntity, MJEntityActionInvocationEntity, MJEntityActionParamEntity, MJEntityActionEntity, MJEntityAIActionEntity, MJEntityCommunicationFieldEntity, MJEntityCommunicationMessageTypeEntity, MJEntityDocumentRunEntity, MJEntityDocumentSettingEntity, MJEntityDocumentTypeEntity, MJEntityDocumentEntity, MJEntityFieldValueEntity, MJEntityFieldEntity, MJEntityOrganicKeyRelatedEntityEntity, MJEntityOrganicKeyEntity, MJEntityPermissionEntity, MJEntityRecordDocumentEntity, MJEntityRelationshipDisplayComponentEntity, MJEntityRelationshipEntity, MJEntitySettingEntity, MJEnvironmentEntity, MJErrorLogEntity, MJExplorerNavigationItemEntity, MJFileCategoryEntity, MJFileEntityRecordLinkEntity, MJFileStorageAccountEntity, MJFileStorageProviderEntity, MJFileEntity, MJGeneratedCodeCategoryEntity, MJGeneratedCodeEntity, MJIntegrationObjectFieldEntity, MJIntegrationObjectEntity, MJIntegrationSourceTypeEntity, MJIntegrationURLFormatEntity, MJIntegrationEntity, MJKnowledgeHubSavedSearchEntity, MJLibraryEntity, MJLibraryItemEntity, MJListCategoryEntity, MJListDetailEntity, MJListInvitationEntity, MJListShareEntity, MJListEntity, MJMCPServerConnectionPermissionEntity, MJMCPServerConnectionToolEntity, MJMCPServerConnectionEntity, MJMCPServerToolEntity, MJMCPServerEntity, MJMCPToolExecutionLogEntity, MJOAuthAuthServerMetadataCacheEntity, MJOAuthAuthorizationStateEntity, MJOAuthClientRegistrationEntity, MJOAuthTokenEntity, MJOpenAppDependencyEntity, MJOpenAppInstallHistoryEntity, MJOpenAppEntity, MJOutputDeliveryTypeEntity, MJOutputFormatTypeEntity, MJOutputTriggerTypeEntity, MJProjectEntity, MJPublicLinkEntity, MJQueryEntity, MJQueryCategoryEntity, MJQueryDependencyEntity, MJQueryEntityEntity, MJQueryFieldEntity, MJQueryParameterEntity, MJQueryPermissionEntity, MJQuerySQLEntity, MJQueueTaskEntity, MJQueueTypeEntity, MJQueueEntity, MJRecommendationItemEntity, MJRecommendationProviderEntity, MJRecommendationRunEntity, MJRecommendationEntity, MJRecordChangeReplayRunEntity, MJRecordChangeEntity, MJRecordLinkEntity, MJRecordMergeDeletionLogEntity, MJRecordMergeLogEntity, MJReportCategoryEntity, MJReportSnapshotEntity, MJReportUserStateEntity, MJReportVersionEntity, MJReportEntity, MJResourceLinkEntity, MJResourcePermissionEntity, MJResourceTypeEntity, MJRoleEntity, MJRowLevelSecurityFilterEntity, MJScheduledActionParamEntity, MJScheduledActionEntity, MJScheduledJobRunEntity, MJScheduledJobTypeEntity, MJScheduledJobEntity, MJSchemaInfoEntity, MJSkillEntity, MJSQLDialectEntity, MJTagAuditLogEntity, MJTagCoOccurrenceEntity, MJTaggedItemEntity, MJTagEntity, MJTaskDependencyEntity, MJTaskTypeEntity, MJTaskEntity, MJTemplateCategoryEntity, MJTemplateContentTypeEntity, MJTemplateContentEntity, MJTemplateParamEntity, MJTemplateEntity, MJTestRubricEntity, MJTestRunFeedbackEntity, MJTestRunOutputTypeEntity, MJTestRunOutputEntity, MJTestRunEntity, MJTestSuiteRunEntity, MJTestSuiteTestEntity, MJTestSuiteEntity, MJTestTypeEntity, MJTestEntity, MJUserApplicationEntityEntity, MJUserApplicationEntity, MJUserFavoriteEntity, MJUserNotificationPreferenceEntity, MJUserNotificationTypeEntity, MJUserNotificationEntity, MJUserRecordLogEntity, MJUserRoleEntity, MJUserSettingEntity, MJUserViewCategoryEntity, MJUserViewRunDetailEntity, MJUserViewRunEntity, MJUserViewEntity, MJUserEntity, MJVectorDatabaseEntity, MJVectorIndexEntity, MJVersionInstallationEntity, MJVersionLabelItemEntity, MJVersionLabelRestoreEntity, MJVersionLabelEntity, MJWorkflowEngineEntity, MJWorkflowRunEntity, MJWorkflowEntity, MJWorkspaceItemEntity, MJWorkspaceEntity } from '@memberjunction/core-entities';
22
22
 
23
23
 
24
24
  //****************************************************************************
@@ -12901,6 +12901,9 @@ export class MJAIModel_ {
12901
12901
  @Field(() => [MJContentType_])
12902
12902
  MJContentTypes_EmbeddingModelIDArray: MJContentType_[]; // Link to MJContentTypes
12903
12903
 
12904
+ @Field(() => [MJContentItem_])
12905
+ MJContentItems_EmbeddingModelIDArray: MJContentItem_[]; // Link to MJContentItems
12906
+
12904
12907
  @Field(() => [MJAIPromptModel_])
12905
12908
  MJAIPromptModels_ModelIDArray: MJAIPromptModel_[]; // Link to MJAIPromptModels
12906
12909
 
@@ -13287,6 +13290,16 @@ export class MJAIModelResolver extends ResolverBase {
13287
13290
  return result;
13288
13291
  }
13289
13292
 
13293
+ @FieldResolver(() => [MJContentItem_])
13294
+ async MJContentItems_EmbeddingModelIDArray(@Root() mjaimodel_: MJAIModel_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
13295
+ this.CheckUserReadPermissions('MJ: Content Items', userPayload);
13296
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
13297
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentItems')} WHERE ${provider.QuoteIdentifier('EmbeddingModelID')}='${mjaimodel_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Items', userPayload, EntityPermissionType.Read, 'AND');
13298
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
13299
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Items', rows, this.GetUserFromPayload(userPayload));
13300
+ return result;
13301
+ }
13302
+
13290
13303
  @FieldResolver(() => [MJAIPromptModel_])
13291
13304
  async MJAIPromptModels_ModelIDArray(@Root() mjaimodel_: MJAIModel_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
13292
13305
  this.CheckUserReadPermissions('MJ: AI Prompt Models', userPayload);
@@ -14464,6 +14477,9 @@ export class MJAIPromptRun_ {
14464
14477
  @MaxLength(36)
14465
14478
  RootRerunFromPromptRunID?: string;
14466
14479
 
14480
+ @Field(() => [MJContentProcessRunPromptRun_])
14481
+ MJContentProcessRunPromptRuns_AIPromptRunIDArray: MJContentProcessRunPromptRun_[]; // Link to MJContentProcessRunPromptRuns
14482
+
14467
14483
  @Field(() => [MJAIPromptRun_])
14468
14484
  MJAIPromptRuns_RerunFromPromptRunIDArray: MJAIPromptRun_[]; // Link to MJAIPromptRuns
14469
14485
 
@@ -15049,6 +15065,16 @@ export class MJAIPromptRunResolver extends ResolverBase {
15049
15065
  return result;
15050
15066
  }
15051
15067
 
15068
+ @FieldResolver(() => [MJContentProcessRunPromptRun_])
15069
+ async MJContentProcessRunPromptRuns_AIPromptRunIDArray(@Root() mjaipromptrun_: MJAIPromptRun_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
15070
+ this.CheckUserReadPermissions('MJ: Content Process Run Prompt Runs', userPayload);
15071
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
15072
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentProcessRunPromptRuns')} WHERE ${provider.QuoteIdentifier('AIPromptRunID')}='${mjaipromptrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Process Run Prompt Runs', userPayload, EntityPermissionType.Read, 'AND');
15073
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
15074
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Process Run Prompt Runs', rows, this.GetUserFromPayload(userPayload));
15075
+ return result;
15076
+ }
15077
+
15052
15078
  @FieldResolver(() => [MJAIPromptRun_])
15053
15079
  async MJAIPromptRuns_RerunFromPromptRunIDArray(@Root() mjaipromptrun_: MJAIPromptRun_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
15054
15080
  this.CheckUserReadPermissions('MJ: AI Prompt Runs', userPayload);
@@ -26769,6 +26795,221 @@ export class MJContentItemAttributeResolver extends ResolverBase {
26769
26795
 
26770
26796
  }
26771
26797
 
26798
+ //****************************************************************************
26799
+ // ENTITY CLASS for MJ: Content Item Duplicates
26800
+ //****************************************************************************
26801
+ @ObjectType({ description: `Detected duplicate or near-duplicate content items across sources. Each row represents a pair of items with similarity scoring and resolution tracking.` })
26802
+ export class MJContentItemDuplicate_ {
26803
+ @Field()
26804
+ @MaxLength(36)
26805
+ ID: string;
26806
+
26807
+ @Field()
26808
+ @MaxLength(36)
26809
+ ContentItemAID: string;
26810
+
26811
+ @Field()
26812
+ @MaxLength(36)
26813
+ ContentItemBID: string;
26814
+
26815
+ @Field(() => Float, {description: `Cosine similarity (for Vector) or exact match score (1.0 for Checksum/URL). Range 0.0-1.0.`})
26816
+ SimilarityScore: number;
26817
+
26818
+ @Field({description: `How the duplicate was detected: Checksum (identical text hash), Vector (embedding similarity), Title (same title text), URL (same source URL).`})
26819
+ @MaxLength(30)
26820
+ DetectionMethod: string;
26821
+
26822
+ @Field({description: `Current status: Pending (awaiting review), Confirmed (verified duplicate), Dismissed (not a duplicate), Merged (one item was removed).`})
26823
+ @MaxLength(20)
26824
+ Status: string;
26825
+
26826
+ @Field({nullable: true})
26827
+ @MaxLength(36)
26828
+ ResolvedByUserID?: string;
26829
+
26830
+ @Field({nullable: true})
26831
+ ResolvedAt?: Date;
26832
+
26833
+ @Field({nullable: true, description: `How the duplicate was resolved: KeepA (keep first, remove second), KeepB (keep second, remove first), MergeBoth (combine into one), NotDuplicate (false positive).`})
26834
+ @MaxLength(20)
26835
+ Resolution?: string;
26836
+
26837
+ @Field()
26838
+ _mj__CreatedAt: Date;
26839
+
26840
+ @Field()
26841
+ _mj__UpdatedAt: Date;
26842
+
26843
+ @Field({nullable: true})
26844
+ @MaxLength(250)
26845
+ ContentItemA?: string;
26846
+
26847
+ @Field({nullable: true})
26848
+ @MaxLength(250)
26849
+ ContentItemB?: string;
26850
+
26851
+ @Field({nullable: true})
26852
+ @MaxLength(100)
26853
+ ResolvedByUser?: string;
26854
+
26855
+ }
26856
+
26857
+ //****************************************************************************
26858
+ // INPUT TYPE for MJ: Content Item Duplicates
26859
+ //****************************************************************************
26860
+ @InputType()
26861
+ export class CreateMJContentItemDuplicateInput {
26862
+ @Field({ nullable: true })
26863
+ ID?: string;
26864
+
26865
+ @Field({ nullable: true })
26866
+ ContentItemAID?: string;
26867
+
26868
+ @Field({ nullable: true })
26869
+ ContentItemBID?: string;
26870
+
26871
+ @Field(() => Float, { nullable: true })
26872
+ SimilarityScore?: number;
26873
+
26874
+ @Field({ nullable: true })
26875
+ DetectionMethod?: string;
26876
+
26877
+ @Field({ nullable: true })
26878
+ Status?: string;
26879
+
26880
+ @Field({ nullable: true })
26881
+ ResolvedByUserID: string | null;
26882
+
26883
+ @Field({ nullable: true })
26884
+ ResolvedAt: Date | null;
26885
+
26886
+ @Field({ nullable: true })
26887
+ Resolution: string | null;
26888
+ }
26889
+
26890
+
26891
+ //****************************************************************************
26892
+ // INPUT TYPE for MJ: Content Item Duplicates
26893
+ //****************************************************************************
26894
+ @InputType()
26895
+ export class UpdateMJContentItemDuplicateInput {
26896
+ @Field()
26897
+ ID: string;
26898
+
26899
+ @Field({ nullable: true })
26900
+ ContentItemAID?: string;
26901
+
26902
+ @Field({ nullable: true })
26903
+ ContentItemBID?: string;
26904
+
26905
+ @Field(() => Float, { nullable: true })
26906
+ SimilarityScore?: number;
26907
+
26908
+ @Field({ nullable: true })
26909
+ DetectionMethod?: string;
26910
+
26911
+ @Field({ nullable: true })
26912
+ Status?: string;
26913
+
26914
+ @Field({ nullable: true })
26915
+ ResolvedByUserID?: string | null;
26916
+
26917
+ @Field({ nullable: true })
26918
+ ResolvedAt?: Date | null;
26919
+
26920
+ @Field({ nullable: true })
26921
+ Resolution?: string | null;
26922
+
26923
+ @Field(() => [KeyValuePairInput], { nullable: true })
26924
+ OldValues___?: KeyValuePairInput[];
26925
+ }
26926
+
26927
+ //****************************************************************************
26928
+ // RESOLVER for MJ: Content Item Duplicates
26929
+ //****************************************************************************
26930
+ @ObjectType()
26931
+ export class RunMJContentItemDuplicateViewResult {
26932
+ @Field(() => [MJContentItemDuplicate_])
26933
+ Results: MJContentItemDuplicate_[];
26934
+
26935
+ @Field(() => String, {nullable: true})
26936
+ UserViewRunID?: string;
26937
+
26938
+ @Field(() => Int, {nullable: true})
26939
+ RowCount: number;
26940
+
26941
+ @Field(() => Int, {nullable: true})
26942
+ TotalRowCount: number;
26943
+
26944
+ @Field(() => Int, {nullable: true})
26945
+ ExecutionTime: number;
26946
+
26947
+ @Field({nullable: true})
26948
+ ErrorMessage?: string;
26949
+
26950
+ @Field(() => Boolean, {nullable: false})
26951
+ Success: boolean;
26952
+ }
26953
+
26954
+ @Resolver(MJContentItemDuplicate_)
26955
+ export class MJContentItemDuplicateResolver extends ResolverBase {
26956
+ @Query(() => RunMJContentItemDuplicateViewResult)
26957
+ async RunMJContentItemDuplicateViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26958
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
26959
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
26960
+ }
26961
+
26962
+ @Query(() => RunMJContentItemDuplicateViewResult)
26963
+ async RunMJContentItemDuplicateViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26964
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
26965
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
26966
+ }
26967
+
26968
+ @Query(() => RunMJContentItemDuplicateViewResult)
26969
+ async RunMJContentItemDuplicateDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
26970
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
26971
+ input.EntityName = 'MJ: Content Item Duplicates';
26972
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
26973
+ }
26974
+ @Query(() => MJContentItemDuplicate_, { nullable: true })
26975
+ async MJContentItemDuplicate(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJContentItemDuplicate_ | null> {
26976
+ this.CheckUserReadPermissions('MJ: Content Item Duplicates', userPayload);
26977
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
26978
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentItemDuplicates')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Item Duplicates', userPayload, EntityPermissionType.Read, 'AND');
26979
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
26980
+ const result = await this.MapFieldNamesToCodeNames('MJ: Content Item Duplicates', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
26981
+ return result;
26982
+ }
26983
+
26984
+ @Mutation(() => MJContentItemDuplicate_)
26985
+ async CreateMJContentItemDuplicate(
26986
+ @Arg('input', () => CreateMJContentItemDuplicateInput) input: CreateMJContentItemDuplicateInput,
26987
+ @Ctx() { providers, userPayload }: AppContext,
26988
+ @PubSub() pubSub: PubSubEngine
26989
+ ) {
26990
+ const provider = GetReadWriteProvider(providers);
26991
+ return this.CreateRecord('MJ: Content Item Duplicates', input, provider, userPayload, pubSub)
26992
+ }
26993
+
26994
+ @Mutation(() => MJContentItemDuplicate_)
26995
+ async UpdateMJContentItemDuplicate(
26996
+ @Arg('input', () => UpdateMJContentItemDuplicateInput) input: UpdateMJContentItemDuplicateInput,
26997
+ @Ctx() { providers, userPayload }: AppContext,
26998
+ @PubSub() pubSub: PubSubEngine
26999
+ ) {
27000
+ const provider = GetReadWriteProvider(providers);
27001
+ return this.UpdateRecord('MJ: Content Item Duplicates', input, provider, userPayload, pubSub);
27002
+ }
27003
+
27004
+ @Mutation(() => MJContentItemDuplicate_)
27005
+ async DeleteMJContentItemDuplicate(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27006
+ const provider = GetReadWriteProvider(providers);
27007
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
27008
+ return this.DeleteRecord('MJ: Content Item Duplicates', key, options, provider, userPayload, pubSub);
27009
+ }
27010
+
27011
+ }
27012
+
26772
27013
  //****************************************************************************
26773
27014
  // ENTITY CLASS for MJ: Content Item Tags
26774
27015
  //****************************************************************************
@@ -26795,10 +27036,18 @@ export class MJContentItemTag_ {
26795
27036
  @Field(() => Float, {description: `Relevance weight for this tag (0.0-1.0). 1.0 = highly relevant central topic, 0.5 = moderately relevant, 0.1 = tangentially related. Assigned by the LLM during autotagging.`})
26796
27037
  Weight: number;
26797
27038
 
27039
+ @Field({nullable: true, description: `Optional link to the formal MJ Tag taxonomy. When set, this free-text tag has been matched (via semantic similarity or exact match) to a curated Tag record. NULL means the tag is unmatched free text only.`})
27040
+ @MaxLength(36)
27041
+ TagID?: string;
27042
+
26798
27043
  @Field({nullable: true})
26799
27044
  @MaxLength(250)
26800
27045
  Item?: string;
26801
27046
 
27047
+ @Field({nullable: true})
27048
+ @MaxLength(255)
27049
+ Tag_Virtual?: string;
27050
+
26802
27051
  }
26803
27052
 
26804
27053
  //****************************************************************************
@@ -26817,6 +27066,9 @@ export class CreateMJContentItemTagInput {
26817
27066
 
26818
27067
  @Field(() => Float, { nullable: true })
26819
27068
  Weight?: number;
27069
+
27070
+ @Field({ nullable: true })
27071
+ TagID: string | null;
26820
27072
  }
26821
27073
 
26822
27074
 
@@ -26837,6 +27089,9 @@ export class UpdateMJContentItemTagInput {
26837
27089
  @Field(() => Float, { nullable: true })
26838
27090
  Weight?: number;
26839
27091
 
27092
+ @Field({ nullable: true })
27093
+ TagID?: string | null;
27094
+
26840
27095
  @Field(() => [KeyValuePairInput], { nullable: true })
26841
27096
  OldValues___?: KeyValuePairInput[];
26842
27097
  }
@@ -26976,6 +27231,28 @@ export class MJContentItem_ {
26976
27231
  @Field()
26977
27232
  _mj__UpdatedAt: Date;
26978
27233
 
27234
+ @Field({nullable: true, description: `For entity-sourced content items, links to the Entity Record Document snapshot that was rendered for this item. Provides traceability back to the source entity record via ERD.EntityID + ERD.RecordID. NULL for non-entity sources.`})
27235
+ @MaxLength(36)
27236
+ EntityRecordDocumentID?: string;
27237
+
27238
+ @Field({description: `Vectorization status: Pending (not yet embedded), Processing (currently being embedded), Complete (vector stored), Failed (embedding error), Skipped (excluded from vectorization).`})
27239
+ @MaxLength(20)
27240
+ EmbeddingStatus: string;
27241
+
27242
+ @Field({nullable: true, description: `Timestamp of the most recent successful embedding for this content item.`})
27243
+ LastEmbeddedAt?: Date;
27244
+
27245
+ @Field({nullable: true, description: `The AI model used to generate the most recent embedding for this content item.`})
27246
+ @MaxLength(36)
27247
+ EmbeddingModelID?: string;
27248
+
27249
+ @Field({description: `Autotagging status: Pending (not yet tagged), Processing (LLM is generating tags), Complete (tags assigned), Failed (LLM error), Skipped (excluded from tagging).`})
27250
+ @MaxLength(20)
27251
+ TaggingStatus: string;
27252
+
27253
+ @Field({nullable: true, description: `Timestamp of the most recent successful autotagging run for this content item.`})
27254
+ LastTaggedAt?: Date;
27255
+
26979
27256
  @Field({nullable: true})
26980
27257
  @MaxLength(255)
26981
27258
  ContentSource?: string;
@@ -26992,12 +27269,26 @@ export class MJContentItem_ {
26992
27269
  @MaxLength(255)
26993
27270
  ContentFileType: string;
26994
27271
 
27272
+ @Field({nullable: true})
27273
+ @MaxLength(450)
27274
+ EntityRecordDocument?: string;
27275
+
27276
+ @Field({nullable: true})
27277
+ @MaxLength(50)
27278
+ EmbeddingModel?: string;
27279
+
26995
27280
  @Field(() => [MJContentItemAttribute_])
26996
27281
  MJContentItemAttributes_ContentItemIDArray: MJContentItemAttribute_[]; // Link to MJContentItemAttributes
26997
27282
 
26998
27283
  @Field(() => [MJContentItemTag_])
26999
27284
  MJContentItemTags_ItemIDArray: MJContentItemTag_[]; // Link to MJContentItemTags
27000
27285
 
27286
+ @Field(() => [MJContentItemDuplicate_])
27287
+ MJContentItemDuplicates_ContentItemAIDArray: MJContentItemDuplicate_[]; // Link to MJContentItemDuplicates
27288
+
27289
+ @Field(() => [MJContentItemDuplicate_])
27290
+ MJContentItemDuplicates_ContentItemBIDArray: MJContentItemDuplicate_[]; // Link to MJContentItemDuplicates
27291
+
27001
27292
  }
27002
27293
 
27003
27294
  //****************************************************************************
@@ -27034,6 +27325,24 @@ export class CreateMJContentItemInput {
27034
27325
 
27035
27326
  @Field({ nullable: true })
27036
27327
  Text: string | null;
27328
+
27329
+ @Field({ nullable: true })
27330
+ EntityRecordDocumentID: string | null;
27331
+
27332
+ @Field({ nullable: true })
27333
+ EmbeddingStatus?: string;
27334
+
27335
+ @Field({ nullable: true })
27336
+ LastEmbeddedAt: Date | null;
27337
+
27338
+ @Field({ nullable: true })
27339
+ EmbeddingModelID: string | null;
27340
+
27341
+ @Field({ nullable: true })
27342
+ TaggingStatus?: string;
27343
+
27344
+ @Field({ nullable: true })
27345
+ LastTaggedAt: Date | null;
27037
27346
  }
27038
27347
 
27039
27348
 
@@ -27072,6 +27381,24 @@ export class UpdateMJContentItemInput {
27072
27381
  @Field({ nullable: true })
27073
27382
  Text?: string | null;
27074
27383
 
27384
+ @Field({ nullable: true })
27385
+ EntityRecordDocumentID?: string | null;
27386
+
27387
+ @Field({ nullable: true })
27388
+ EmbeddingStatus?: string;
27389
+
27390
+ @Field({ nullable: true })
27391
+ LastEmbeddedAt?: Date | null;
27392
+
27393
+ @Field({ nullable: true })
27394
+ EmbeddingModelID?: string | null;
27395
+
27396
+ @Field({ nullable: true })
27397
+ TaggingStatus?: string;
27398
+
27399
+ @Field({ nullable: true })
27400
+ LastTaggedAt?: Date | null;
27401
+
27075
27402
  @Field(() => [KeyValuePairInput], { nullable: true })
27076
27403
  OldValues___?: KeyValuePairInput[];
27077
27404
  }
@@ -27153,6 +27480,26 @@ export class MJContentItemResolver extends ResolverBase {
27153
27480
  return result;
27154
27481
  }
27155
27482
 
27483
+ @FieldResolver(() => [MJContentItemDuplicate_])
27484
+ async MJContentItemDuplicates_ContentItemAIDArray(@Root() mjcontentitem_: MJContentItem_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
27485
+ this.CheckUserReadPermissions('MJ: Content Item Duplicates', userPayload);
27486
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27487
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentItemDuplicates')} WHERE ${provider.QuoteIdentifier('ContentItemAID')}='${mjcontentitem_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Item Duplicates', userPayload, EntityPermissionType.Read, 'AND');
27488
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
27489
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Item Duplicates', rows, this.GetUserFromPayload(userPayload));
27490
+ return result;
27491
+ }
27492
+
27493
+ @FieldResolver(() => [MJContentItemDuplicate_])
27494
+ async MJContentItemDuplicates_ContentItemBIDArray(@Root() mjcontentitem_: MJContentItem_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
27495
+ this.CheckUserReadPermissions('MJ: Content Item Duplicates', userPayload);
27496
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27497
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentItemDuplicates')} WHERE ${provider.QuoteIdentifier('ContentItemBID')}='${mjcontentitem_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Item Duplicates', userPayload, EntityPermissionType.Read, 'AND');
27498
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
27499
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Item Duplicates', rows, this.GetUserFromPayload(userPayload));
27500
+ return result;
27501
+ }
27502
+
27156
27503
  @Mutation(() => MJContentItem_)
27157
27504
  async CreateMJContentItem(
27158
27505
  @Arg('input', () => CreateMJContentItemInput) input: CreateMJContentItemInput,
@@ -27182,6 +27529,436 @@ export class MJContentItemResolver extends ResolverBase {
27182
27529
 
27183
27530
  }
27184
27531
 
27532
+ //****************************************************************************
27533
+ // ENTITY CLASS for MJ: Content Process Run Details
27534
+ //****************************************************************************
27535
+ @ObjectType({ description: `Per-content-source tracking within a pipeline run. Each source processed during a ContentProcessRun gets one detail record with item counts, timing, token usage, and cost rollups.` })
27536
+ export class MJContentProcessRunDetail_ {
27537
+ @Field()
27538
+ @MaxLength(36)
27539
+ ID: string;
27540
+
27541
+ @Field({description: `The parent pipeline run this detail belongs to.`})
27542
+ @MaxLength(36)
27543
+ ContentProcessRunID: string;
27544
+
27545
+ @Field({description: `The content source being processed in this detail record.`})
27546
+ @MaxLength(36)
27547
+ ContentSourceID: string;
27548
+
27549
+ @Field({description: `The type of content source (RSS Feed, Entity, Website, Cloud Storage, etc.).`})
27550
+ @MaxLength(36)
27551
+ ContentSourceTypeID: string;
27552
+
27553
+ @Field({description: `Processing status: Pending, Running, Completed, Failed, or Skipped.`})
27554
+ @MaxLength(20)
27555
+ Status: string;
27556
+
27557
+ @Field(() => Int, {description: `Total content items processed for this source during the run.`})
27558
+ ItemsProcessed: number;
27559
+
27560
+ @Field(() => Int, {description: `Number of content items successfully tagged by the LLM.`})
27561
+ ItemsTagged: number;
27562
+
27563
+ @Field(() => Int, {description: `Number of content items successfully embedded and upserted to the vector database.`})
27564
+ ItemsVectorized: number;
27565
+
27566
+ @Field(() => Int, {description: `Number of new ContentItemTag records created during LLM tagging.`})
27567
+ TagsCreated: number;
27568
+
27569
+ @Field(() => Int, {description: `Number of errors encountered while processing this source.`})
27570
+ ErrorCount: number;
27571
+
27572
+ @Field({nullable: true, description: `When processing started for this source within the pipeline run.`})
27573
+ StartTime?: Date;
27574
+
27575
+ @Field({nullable: true, description: `When processing completed for this source within the pipeline run.`})
27576
+ EndTime?: Date;
27577
+
27578
+ @Field(() => Int, {description: `Rollup of all tokens used across LLM tagging and embedding calls for this source. Computed from linked AIPromptRun records via the ContentProcessRunPromptRun junction table.`})
27579
+ TotalTokensUsed: number;
27580
+
27581
+ @Field(() => Float, {description: `Rollup of all costs across LLM tagging and embedding calls for this source. Computed from linked AIPromptRun records via the ContentProcessRunPromptRun junction table.`})
27582
+ TotalCost: number;
27583
+
27584
+ @Field()
27585
+ _mj__CreatedAt: Date;
27586
+
27587
+ @Field()
27588
+ _mj__UpdatedAt: Date;
27589
+
27590
+ @Field({nullable: true})
27591
+ @MaxLength(255)
27592
+ ContentProcessRun?: string;
27593
+
27594
+ @Field({nullable: true})
27595
+ @MaxLength(255)
27596
+ ContentSource?: string;
27597
+
27598
+ @Field()
27599
+ @MaxLength(255)
27600
+ ContentSourceType: string;
27601
+
27602
+ @Field(() => [MJContentProcessRunPromptRun_])
27603
+ MJContentProcessRunPromptRuns_ContentProcessRunDetailIDArray: MJContentProcessRunPromptRun_[]; // Link to MJContentProcessRunPromptRuns
27604
+
27605
+ }
27606
+
27607
+ //****************************************************************************
27608
+ // INPUT TYPE for MJ: Content Process Run Details
27609
+ //****************************************************************************
27610
+ @InputType()
27611
+ export class CreateMJContentProcessRunDetailInput {
27612
+ @Field({ nullable: true })
27613
+ ID?: string;
27614
+
27615
+ @Field({ nullable: true })
27616
+ ContentProcessRunID?: string;
27617
+
27618
+ @Field({ nullable: true })
27619
+ ContentSourceID?: string;
27620
+
27621
+ @Field({ nullable: true })
27622
+ ContentSourceTypeID?: string;
27623
+
27624
+ @Field({ nullable: true })
27625
+ Status?: string;
27626
+
27627
+ @Field(() => Int, { nullable: true })
27628
+ ItemsProcessed?: number;
27629
+
27630
+ @Field(() => Int, { nullable: true })
27631
+ ItemsTagged?: number;
27632
+
27633
+ @Field(() => Int, { nullable: true })
27634
+ ItemsVectorized?: number;
27635
+
27636
+ @Field(() => Int, { nullable: true })
27637
+ TagsCreated?: number;
27638
+
27639
+ @Field(() => Int, { nullable: true })
27640
+ ErrorCount?: number;
27641
+
27642
+ @Field({ nullable: true })
27643
+ StartTime: Date | null;
27644
+
27645
+ @Field({ nullable: true })
27646
+ EndTime: Date | null;
27647
+
27648
+ @Field(() => Int, { nullable: true })
27649
+ TotalTokensUsed?: number;
27650
+
27651
+ @Field(() => Float, { nullable: true })
27652
+ TotalCost?: number;
27653
+ }
27654
+
27655
+
27656
+ //****************************************************************************
27657
+ // INPUT TYPE for MJ: Content Process Run Details
27658
+ //****************************************************************************
27659
+ @InputType()
27660
+ export class UpdateMJContentProcessRunDetailInput {
27661
+ @Field()
27662
+ ID: string;
27663
+
27664
+ @Field({ nullable: true })
27665
+ ContentProcessRunID?: string;
27666
+
27667
+ @Field({ nullable: true })
27668
+ ContentSourceID?: string;
27669
+
27670
+ @Field({ nullable: true })
27671
+ ContentSourceTypeID?: string;
27672
+
27673
+ @Field({ nullable: true })
27674
+ Status?: string;
27675
+
27676
+ @Field(() => Int, { nullable: true })
27677
+ ItemsProcessed?: number;
27678
+
27679
+ @Field(() => Int, { nullable: true })
27680
+ ItemsTagged?: number;
27681
+
27682
+ @Field(() => Int, { nullable: true })
27683
+ ItemsVectorized?: number;
27684
+
27685
+ @Field(() => Int, { nullable: true })
27686
+ TagsCreated?: number;
27687
+
27688
+ @Field(() => Int, { nullable: true })
27689
+ ErrorCount?: number;
27690
+
27691
+ @Field({ nullable: true })
27692
+ StartTime?: Date | null;
27693
+
27694
+ @Field({ nullable: true })
27695
+ EndTime?: Date | null;
27696
+
27697
+ @Field(() => Int, { nullable: true })
27698
+ TotalTokensUsed?: number;
27699
+
27700
+ @Field(() => Float, { nullable: true })
27701
+ TotalCost?: number;
27702
+
27703
+ @Field(() => [KeyValuePairInput], { nullable: true })
27704
+ OldValues___?: KeyValuePairInput[];
27705
+ }
27706
+
27707
+ //****************************************************************************
27708
+ // RESOLVER for MJ: Content Process Run Details
27709
+ //****************************************************************************
27710
+ @ObjectType()
27711
+ export class RunMJContentProcessRunDetailViewResult {
27712
+ @Field(() => [MJContentProcessRunDetail_])
27713
+ Results: MJContentProcessRunDetail_[];
27714
+
27715
+ @Field(() => String, {nullable: true})
27716
+ UserViewRunID?: string;
27717
+
27718
+ @Field(() => Int, {nullable: true})
27719
+ RowCount: number;
27720
+
27721
+ @Field(() => Int, {nullable: true})
27722
+ TotalRowCount: number;
27723
+
27724
+ @Field(() => Int, {nullable: true})
27725
+ ExecutionTime: number;
27726
+
27727
+ @Field({nullable: true})
27728
+ ErrorMessage?: string;
27729
+
27730
+ @Field(() => Boolean, {nullable: false})
27731
+ Success: boolean;
27732
+ }
27733
+
27734
+ @Resolver(MJContentProcessRunDetail_)
27735
+ export class MJContentProcessRunDetailResolver extends ResolverBase {
27736
+ @Query(() => RunMJContentProcessRunDetailViewResult)
27737
+ async RunMJContentProcessRunDetailViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27738
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27739
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
27740
+ }
27741
+
27742
+ @Query(() => RunMJContentProcessRunDetailViewResult)
27743
+ async RunMJContentProcessRunDetailViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27744
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27745
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
27746
+ }
27747
+
27748
+ @Query(() => RunMJContentProcessRunDetailViewResult)
27749
+ async RunMJContentProcessRunDetailDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27750
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27751
+ input.EntityName = 'MJ: Content Process Run Details';
27752
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
27753
+ }
27754
+ @Query(() => MJContentProcessRunDetail_, { nullable: true })
27755
+ async MJContentProcessRunDetail(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJContentProcessRunDetail_ | null> {
27756
+ this.CheckUserReadPermissions('MJ: Content Process Run Details', userPayload);
27757
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27758
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentProcessRunDetails')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Process Run Details', userPayload, EntityPermissionType.Read, 'AND');
27759
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
27760
+ const result = await this.MapFieldNamesToCodeNames('MJ: Content Process Run Details', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
27761
+ return result;
27762
+ }
27763
+
27764
+ @FieldResolver(() => [MJContentProcessRunPromptRun_])
27765
+ async MJContentProcessRunPromptRuns_ContentProcessRunDetailIDArray(@Root() mjcontentprocessrundetail_: MJContentProcessRunDetail_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
27766
+ this.CheckUserReadPermissions('MJ: Content Process Run Prompt Runs', userPayload);
27767
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27768
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentProcessRunPromptRuns')} WHERE ${provider.QuoteIdentifier('ContentProcessRunDetailID')}='${mjcontentprocessrundetail_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Process Run Prompt Runs', userPayload, EntityPermissionType.Read, 'AND');
27769
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
27770
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Process Run Prompt Runs', rows, this.GetUserFromPayload(userPayload));
27771
+ return result;
27772
+ }
27773
+
27774
+ @Mutation(() => MJContentProcessRunDetail_)
27775
+ async CreateMJContentProcessRunDetail(
27776
+ @Arg('input', () => CreateMJContentProcessRunDetailInput) input: CreateMJContentProcessRunDetailInput,
27777
+ @Ctx() { providers, userPayload }: AppContext,
27778
+ @PubSub() pubSub: PubSubEngine
27779
+ ) {
27780
+ const provider = GetReadWriteProvider(providers);
27781
+ return this.CreateRecord('MJ: Content Process Run Details', input, provider, userPayload, pubSub)
27782
+ }
27783
+
27784
+ @Mutation(() => MJContentProcessRunDetail_)
27785
+ async UpdateMJContentProcessRunDetail(
27786
+ @Arg('input', () => UpdateMJContentProcessRunDetailInput) input: UpdateMJContentProcessRunDetailInput,
27787
+ @Ctx() { providers, userPayload }: AppContext,
27788
+ @PubSub() pubSub: PubSubEngine
27789
+ ) {
27790
+ const provider = GetReadWriteProvider(providers);
27791
+ return this.UpdateRecord('MJ: Content Process Run Details', input, provider, userPayload, pubSub);
27792
+ }
27793
+
27794
+ @Mutation(() => MJContentProcessRunDetail_)
27795
+ async DeleteMJContentProcessRunDetail(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27796
+ const provider = GetReadWriteProvider(providers);
27797
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
27798
+ return this.DeleteRecord('MJ: Content Process Run Details', key, options, provider, userPayload, pubSub);
27799
+ }
27800
+
27801
+ }
27802
+
27803
+ //****************************************************************************
27804
+ // ENTITY CLASS for MJ: Content Process Run Prompt Runs
27805
+ //****************************************************************************
27806
+ @ObjectType({ description: `Links ContentProcessRunDetail records to their associated AIPromptRun records. Each LLM tagging call and embedding call creates an AIPromptRun, and this junction table provides the FK relationship for cost/token analytics.` })
27807
+ export class MJContentProcessRunPromptRun_ {
27808
+ @Field()
27809
+ @MaxLength(36)
27810
+ ID: string;
27811
+
27812
+ @Field({description: `The content process run detail record this prompt run is associated with.`})
27813
+ @MaxLength(36)
27814
+ ContentProcessRunDetailID: string;
27815
+
27816
+ @Field({description: `The AI prompt run record containing token usage, cost, model, vendor, and execution details for this call.`})
27817
+ @MaxLength(36)
27818
+ AIPromptRunID: string;
27819
+
27820
+ @Field({description: `Whether this AIPromptRun was for LLM tagging (Tag) or text embedding (Embed).`})
27821
+ @MaxLength(20)
27822
+ RunType: string;
27823
+
27824
+ @Field()
27825
+ _mj__CreatedAt: Date;
27826
+
27827
+ @Field()
27828
+ _mj__UpdatedAt: Date;
27829
+
27830
+ @Field({nullable: true})
27831
+ @MaxLength(255)
27832
+ AIPromptRun?: string;
27833
+
27834
+ }
27835
+
27836
+ //****************************************************************************
27837
+ // INPUT TYPE for MJ: Content Process Run Prompt Runs
27838
+ //****************************************************************************
27839
+ @InputType()
27840
+ export class CreateMJContentProcessRunPromptRunInput {
27841
+ @Field({ nullable: true })
27842
+ ID?: string;
27843
+
27844
+ @Field({ nullable: true })
27845
+ ContentProcessRunDetailID?: string;
27846
+
27847
+ @Field({ nullable: true })
27848
+ AIPromptRunID?: string;
27849
+
27850
+ @Field({ nullable: true })
27851
+ RunType?: string;
27852
+ }
27853
+
27854
+
27855
+ //****************************************************************************
27856
+ // INPUT TYPE for MJ: Content Process Run Prompt Runs
27857
+ //****************************************************************************
27858
+ @InputType()
27859
+ export class UpdateMJContentProcessRunPromptRunInput {
27860
+ @Field()
27861
+ ID: string;
27862
+
27863
+ @Field({ nullable: true })
27864
+ ContentProcessRunDetailID?: string;
27865
+
27866
+ @Field({ nullable: true })
27867
+ AIPromptRunID?: string;
27868
+
27869
+ @Field({ nullable: true })
27870
+ RunType?: string;
27871
+
27872
+ @Field(() => [KeyValuePairInput], { nullable: true })
27873
+ OldValues___?: KeyValuePairInput[];
27874
+ }
27875
+
27876
+ //****************************************************************************
27877
+ // RESOLVER for MJ: Content Process Run Prompt Runs
27878
+ //****************************************************************************
27879
+ @ObjectType()
27880
+ export class RunMJContentProcessRunPromptRunViewResult {
27881
+ @Field(() => [MJContentProcessRunPromptRun_])
27882
+ Results: MJContentProcessRunPromptRun_[];
27883
+
27884
+ @Field(() => String, {nullable: true})
27885
+ UserViewRunID?: string;
27886
+
27887
+ @Field(() => Int, {nullable: true})
27888
+ RowCount: number;
27889
+
27890
+ @Field(() => Int, {nullable: true})
27891
+ TotalRowCount: number;
27892
+
27893
+ @Field(() => Int, {nullable: true})
27894
+ ExecutionTime: number;
27895
+
27896
+ @Field({nullable: true})
27897
+ ErrorMessage?: string;
27898
+
27899
+ @Field(() => Boolean, {nullable: false})
27900
+ Success: boolean;
27901
+ }
27902
+
27903
+ @Resolver(MJContentProcessRunPromptRun_)
27904
+ export class MJContentProcessRunPromptRunResolver extends ResolverBase {
27905
+ @Query(() => RunMJContentProcessRunPromptRunViewResult)
27906
+ async RunMJContentProcessRunPromptRunViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27907
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27908
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
27909
+ }
27910
+
27911
+ @Query(() => RunMJContentProcessRunPromptRunViewResult)
27912
+ async RunMJContentProcessRunPromptRunViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27913
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27914
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
27915
+ }
27916
+
27917
+ @Query(() => RunMJContentProcessRunPromptRunViewResult)
27918
+ async RunMJContentProcessRunPromptRunDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27919
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27920
+ input.EntityName = 'MJ: Content Process Run Prompt Runs';
27921
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
27922
+ }
27923
+ @Query(() => MJContentProcessRunPromptRun_, { nullable: true })
27924
+ async MJContentProcessRunPromptRun(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJContentProcessRunPromptRun_ | null> {
27925
+ this.CheckUserReadPermissions('MJ: Content Process Run Prompt Runs', userPayload);
27926
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27927
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentProcessRunPromptRuns')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Process Run Prompt Runs', userPayload, EntityPermissionType.Read, 'AND');
27928
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
27929
+ const result = await this.MapFieldNamesToCodeNames('MJ: Content Process Run Prompt Runs', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
27930
+ return result;
27931
+ }
27932
+
27933
+ @Mutation(() => MJContentProcessRunPromptRun_)
27934
+ async CreateMJContentProcessRunPromptRun(
27935
+ @Arg('input', () => CreateMJContentProcessRunPromptRunInput) input: CreateMJContentProcessRunPromptRunInput,
27936
+ @Ctx() { providers, userPayload }: AppContext,
27937
+ @PubSub() pubSub: PubSubEngine
27938
+ ) {
27939
+ const provider = GetReadWriteProvider(providers);
27940
+ return this.CreateRecord('MJ: Content Process Run Prompt Runs', input, provider, userPayload, pubSub)
27941
+ }
27942
+
27943
+ @Mutation(() => MJContentProcessRunPromptRun_)
27944
+ async UpdateMJContentProcessRunPromptRun(
27945
+ @Arg('input', () => UpdateMJContentProcessRunPromptRunInput) input: UpdateMJContentProcessRunPromptRunInput,
27946
+ @Ctx() { providers, userPayload }: AppContext,
27947
+ @PubSub() pubSub: PubSubEngine
27948
+ ) {
27949
+ const provider = GetReadWriteProvider(providers);
27950
+ return this.UpdateRecord('MJ: Content Process Run Prompt Runs', input, provider, userPayload, pubSub);
27951
+ }
27952
+
27953
+ @Mutation(() => MJContentProcessRunPromptRun_)
27954
+ async DeleteMJContentProcessRunPromptRun(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27955
+ const provider = GetReadWriteProvider(providers);
27956
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
27957
+ return this.DeleteRecord('MJ: Content Process Run Prompt Runs', key, options, provider, userPayload, pubSub);
27958
+ }
27959
+
27960
+ }
27961
+
27185
27962
  //****************************************************************************
27186
27963
  // ENTITY CLASS for MJ: Content Process Runs
27187
27964
  //****************************************************************************
@@ -27214,10 +27991,42 @@ export class MJContentProcessRun_ {
27214
27991
  @Field()
27215
27992
  _mj__UpdatedAt: Date;
27216
27993
 
27994
+ @Field({nullable: true, description: `The user who triggered this pipeline run. NULL for system-initiated runs.`})
27995
+ @MaxLength(36)
27996
+ StartedByUserID?: string;
27997
+
27998
+ @Field(() => Int, {nullable: true, description: `Total number of content items to process in this run. Used for progress percentage calculation.`})
27999
+ TotalItemCount?: number;
28000
+
28001
+ @Field(() => Int, {nullable: true, description: `StartRow offset of the last successfully completed batch. Used for resume-from-crash: next batch starts at this offset. Reset to 0 on new runs.`})
28002
+ LastProcessedOffset?: number;
28003
+
28004
+ @Field(() => Int, {nullable: true, description: `Number of content items processed per batch. Configurable per run, default 100.`})
28005
+ BatchSize?: number;
28006
+
28007
+ @Field(() => Int, {nullable: true, description: `Running count of errors encountered during processing. Used by the circuit breaker to halt the pipeline if error rate exceeds the configured threshold.`})
28008
+ ErrorCount?: number;
28009
+
28010
+ @Field({nullable: true, description: `Error details if the run failed. Includes error messages, stack traces, or circuit breaker trigger reason.`})
28011
+ ErrorMessage?: string;
28012
+
28013
+ @Field(() => Boolean, {description: `When set to 1, the pipeline stops after completing the current batch. Used for pause and cancel operations. The Status column reflects the final state (Paused or Cancelled).`})
28014
+ CancellationRequested: boolean;
28015
+
28016
+ @Field({nullable: true, description: `JSON snapshot of the pipeline configuration used for this run. Conforms to the IContentProcessRunConfiguration interface. Includes batch size, rate limits, error thresholds, and duplicate detection settings.`})
28017
+ Configuration?: string;
28018
+
27217
28019
  @Field({nullable: true})
27218
28020
  @MaxLength(255)
27219
28021
  Source?: string;
27220
28022
 
28023
+ @Field({nullable: true})
28024
+ @MaxLength(100)
28025
+ StartedByUser?: string;
28026
+
28027
+ @Field(() => [MJContentProcessRunDetail_])
28028
+ MJContentProcessRunDetails_ContentProcessRunIDArray: MJContentProcessRunDetail_[]; // Link to MJContentProcessRunDetails
28029
+
27221
28030
  }
27222
28031
 
27223
28032
  //****************************************************************************
@@ -27242,6 +28051,30 @@ export class CreateMJContentProcessRunInput {
27242
28051
 
27243
28052
  @Field(() => Int, { nullable: true })
27244
28053
  ProcessedItems: number | null;
28054
+
28055
+ @Field({ nullable: true })
28056
+ StartedByUserID: string | null;
28057
+
28058
+ @Field(() => Int, { nullable: true })
28059
+ TotalItemCount: number | null;
28060
+
28061
+ @Field(() => Int, { nullable: true })
28062
+ LastProcessedOffset?: number | null;
28063
+
28064
+ @Field(() => Int, { nullable: true })
28065
+ BatchSize?: number | null;
28066
+
28067
+ @Field(() => Int, { nullable: true })
28068
+ ErrorCount?: number | null;
28069
+
28070
+ @Field({ nullable: true })
28071
+ ErrorMessage: string | null;
28072
+
28073
+ @Field(() => Boolean, { nullable: true })
28074
+ CancellationRequested?: boolean;
28075
+
28076
+ @Field({ nullable: true })
28077
+ Configuration: string | null;
27245
28078
  }
27246
28079
 
27247
28080
 
@@ -27268,6 +28101,30 @@ export class UpdateMJContentProcessRunInput {
27268
28101
  @Field(() => Int, { nullable: true })
27269
28102
  ProcessedItems?: number | null;
27270
28103
 
28104
+ @Field({ nullable: true })
28105
+ StartedByUserID?: string | null;
28106
+
28107
+ @Field(() => Int, { nullable: true })
28108
+ TotalItemCount?: number | null;
28109
+
28110
+ @Field(() => Int, { nullable: true })
28111
+ LastProcessedOffset?: number | null;
28112
+
28113
+ @Field(() => Int, { nullable: true })
28114
+ BatchSize?: number | null;
28115
+
28116
+ @Field(() => Int, { nullable: true })
28117
+ ErrorCount?: number | null;
28118
+
28119
+ @Field({ nullable: true })
28120
+ ErrorMessage?: string | null;
28121
+
28122
+ @Field(() => Boolean, { nullable: true })
28123
+ CancellationRequested?: boolean;
28124
+
28125
+ @Field({ nullable: true })
28126
+ Configuration?: string | null;
28127
+
27271
28128
  @Field(() => [KeyValuePairInput], { nullable: true })
27272
28129
  OldValues___?: KeyValuePairInput[];
27273
28130
  }
@@ -27329,6 +28186,16 @@ export class MJContentProcessRunResolver extends ResolverBase {
27329
28186
  return result;
27330
28187
  }
27331
28188
 
28189
+ @FieldResolver(() => [MJContentProcessRunDetail_])
28190
+ async MJContentProcessRunDetails_ContentProcessRunIDArray(@Root() mjcontentprocessrun_: MJContentProcessRun_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
28191
+ this.CheckUserReadPermissions('MJ: Content Process Run Details', userPayload);
28192
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
28193
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentProcessRunDetails')} WHERE ${provider.QuoteIdentifier('ContentProcessRunID')}='${mjcontentprocessrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Process Run Details', userPayload, EntityPermissionType.Read, 'AND');
28194
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
28195
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Process Run Details', rows, this.GetUserFromPayload(userPayload));
28196
+ return result;
28197
+ }
28198
+
27332
28199
  @Mutation(() => MJContentProcessRun_)
27333
28200
  async CreateMJContentProcessRun(
27334
28201
  @Arg('input', () => CreateMJContentProcessRunInput) input: CreateMJContentProcessRunInput,
@@ -27711,12 +28578,22 @@ export class MJContentSourceType_ {
27711
28578
  @Field()
27712
28579
  _mj__UpdatedAt: Date;
27713
28580
 
28581
+ @Field({nullable: true, description: `The registered class name used by ClassFactory to instantiate the provider for this source type (e.g., AutotagLocalFileSystem, AutotagEntity). Must match a @RegisterClass key on a class extending AutotagBase.`})
28582
+ @MaxLength(255)
28583
+ DriverClass?: string;
28584
+
28585
+ @Field({nullable: true, description: `JSON configuration blob for type-level settings. Conforms to the IContentSourceTypeConfiguration interface. Reserved for future type-wide settings shared by all sources of this type.`})
28586
+ Configuration?: string;
28587
+
27714
28588
  @Field(() => [MJContentSource_])
27715
28589
  MJContentSources_ContentSourceTypeIDArray: MJContentSource_[]; // Link to MJContentSources
27716
28590
 
27717
28591
  @Field(() => [MJContentItem_])
27718
28592
  MJContentItems_ContentSourceTypeIDArray: MJContentItem_[]; // Link to MJContentItems
27719
28593
 
28594
+ @Field(() => [MJContentProcessRunDetail_])
28595
+ MJContentProcessRunDetails_ContentSourceTypeIDArray: MJContentProcessRunDetail_[]; // Link to MJContentProcessRunDetails
28596
+
27720
28597
  }
27721
28598
 
27722
28599
  //****************************************************************************
@@ -27732,6 +28609,12 @@ export class CreateMJContentSourceTypeInput {
27732
28609
 
27733
28610
  @Field({ nullable: true })
27734
28611
  Description: string | null;
28612
+
28613
+ @Field({ nullable: true })
28614
+ DriverClass: string | null;
28615
+
28616
+ @Field({ nullable: true })
28617
+ Configuration: string | null;
27735
28618
  }
27736
28619
 
27737
28620
 
@@ -27749,6 +28632,12 @@ export class UpdateMJContentSourceTypeInput {
27749
28632
  @Field({ nullable: true })
27750
28633
  Description?: string | null;
27751
28634
 
28635
+ @Field({ nullable: true })
28636
+ DriverClass?: string | null;
28637
+
28638
+ @Field({ nullable: true })
28639
+ Configuration?: string | null;
28640
+
27752
28641
  @Field(() => [KeyValuePairInput], { nullable: true })
27753
28642
  OldValues___?: KeyValuePairInput[];
27754
28643
  }
@@ -27830,6 +28719,16 @@ export class MJContentSourceTypeResolver extends ResolverBase {
27830
28719
  return result;
27831
28720
  }
27832
28721
 
28722
+ @FieldResolver(() => [MJContentProcessRunDetail_])
28723
+ async MJContentProcessRunDetails_ContentSourceTypeIDArray(@Root() mjcontentsourcetype_: MJContentSourceType_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
28724
+ this.CheckUserReadPermissions('MJ: Content Process Run Details', userPayload);
28725
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
28726
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentProcessRunDetails')} WHERE ${provider.QuoteIdentifier('ContentSourceTypeID')}='${mjcontentsourcetype_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Process Run Details', userPayload, EntityPermissionType.Read, 'AND');
28727
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
28728
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Process Run Details', rows, this.GetUserFromPayload(userPayload));
28729
+ return result;
28730
+ }
28731
+
27833
28732
  @Mutation(() => MJContentSourceType_)
27834
28733
  async CreateMJContentSourceType(
27835
28734
  @Arg('input', () => CreateMJContentSourceTypeInput) input: CreateMJContentSourceTypeInput,
@@ -27902,6 +28801,21 @@ export class MJContentSource_ {
27902
28801
  @MaxLength(36)
27903
28802
  VectorIndexID?: string;
27904
28803
 
28804
+ @Field({nullable: true, description: `JSON configuration blob for source-instance settings. Conforms to the IContentSourceConfiguration interface. Includes tag taxonomy mode (constrained/auto-grow/free-flow), tag root ID, match threshold, LLM taxonomy sharing, and vectorization toggle.`})
28805
+ Configuration?: string;
28806
+
28807
+ @Field({nullable: true, description: `For Entity-type content sources, the MJ Entity to pull records from. NULL for non-entity sources (files, RSS, websites, etc.).`})
28808
+ @MaxLength(36)
28809
+ EntityID?: string;
28810
+
28811
+ @Field({nullable: true, description: `For Entity-type content sources, the Entity Document template used to render entity records into text for autotagging. The template defines which fields to include, how to format them, and related record inclusion. NULL for non-entity sources.`})
28812
+ @MaxLength(36)
28813
+ EntityDocumentID?: string;
28814
+
28815
+ @Field({nullable: true, description: `Optional link to a MJ Scheduled Action that automatically runs the classification pipeline for this source on a cron schedule.`})
28816
+ @MaxLength(36)
28817
+ ScheduledActionID?: string;
28818
+
27905
28819
  @Field()
27906
28820
  @MaxLength(255)
27907
28821
  ContentType: string;
@@ -27922,6 +28836,18 @@ export class MJContentSource_ {
27922
28836
  @MaxLength(255)
27923
28837
  VectorIndex?: string;
27924
28838
 
28839
+ @Field({nullable: true})
28840
+ @MaxLength(255)
28841
+ Entity?: string;
28842
+
28843
+ @Field({nullable: true})
28844
+ @MaxLength(250)
28845
+ EntityDocument?: string;
28846
+
28847
+ @Field({nullable: true})
28848
+ @MaxLength(255)
28849
+ ScheduledAction?: string;
28850
+
27925
28851
  @Field(() => [MJContentItem_])
27926
28852
  MJContentItems_ContentSourceIDArray: MJContentItem_[]; // Link to MJContentItems
27927
28853
 
@@ -27931,6 +28857,9 @@ export class MJContentSource_ {
27931
28857
  @Field(() => [MJContentSourceParam_])
27932
28858
  MJContentSourceParams_ContentSourceIDArray: MJContentSourceParam_[]; // Link to MJContentSourceParams
27933
28859
 
28860
+ @Field(() => [MJContentProcessRunDetail_])
28861
+ MJContentProcessRunDetails_ContentSourceIDArray: MJContentProcessRunDetail_[]; // Link to MJContentProcessRunDetails
28862
+
27934
28863
  }
27935
28864
 
27936
28865
  //****************************************************************************
@@ -27961,6 +28890,18 @@ export class CreateMJContentSourceInput {
27961
28890
 
27962
28891
  @Field({ nullable: true })
27963
28892
  VectorIndexID: string | null;
28893
+
28894
+ @Field({ nullable: true })
28895
+ Configuration: string | null;
28896
+
28897
+ @Field({ nullable: true })
28898
+ EntityID: string | null;
28899
+
28900
+ @Field({ nullable: true })
28901
+ EntityDocumentID: string | null;
28902
+
28903
+ @Field({ nullable: true })
28904
+ ScheduledActionID: string | null;
27964
28905
  }
27965
28906
 
27966
28907
 
@@ -27993,6 +28934,18 @@ export class UpdateMJContentSourceInput {
27993
28934
  @Field({ nullable: true })
27994
28935
  VectorIndexID?: string | null;
27995
28936
 
28937
+ @Field({ nullable: true })
28938
+ Configuration?: string | null;
28939
+
28940
+ @Field({ nullable: true })
28941
+ EntityID?: string | null;
28942
+
28943
+ @Field({ nullable: true })
28944
+ EntityDocumentID?: string | null;
28945
+
28946
+ @Field({ nullable: true })
28947
+ ScheduledActionID?: string | null;
28948
+
27996
28949
  @Field(() => [KeyValuePairInput], { nullable: true })
27997
28950
  OldValues___?: KeyValuePairInput[];
27998
28951
  }
@@ -28084,6 +29037,16 @@ export class MJContentSourceResolver extends ResolverBase {
28084
29037
  return result;
28085
29038
  }
28086
29039
 
29040
+ @FieldResolver(() => [MJContentProcessRunDetail_])
29041
+ async MJContentProcessRunDetails_ContentSourceIDArray(@Root() mjcontentsource_: MJContentSource_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
29042
+ this.CheckUserReadPermissions('MJ: Content Process Run Details', userPayload);
29043
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
29044
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentProcessRunDetails')} WHERE ${provider.QuoteIdentifier('ContentSourceID')}='${mjcontentsource_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Process Run Details', userPayload, EntityPermissionType.Read, 'AND');
29045
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
29046
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Process Run Details', rows, this.GetUserFromPayload(userPayload));
29047
+ return result;
29048
+ }
29049
+
28087
29050
  @Mutation(() => MJContentSource_)
28088
29051
  async CreateMJContentSource(
28089
29052
  @Arg('input', () => CreateMJContentSourceInput) input: CreateMJContentSourceInput,
@@ -28316,6 +29279,9 @@ export class MJContentType_ {
28316
29279
  @MaxLength(36)
28317
29280
  VectorIndexID?: string;
28318
29281
 
29282
+ @Field({nullable: true, description: `JSON configuration blob for content-type-level settings. Conforms to the IContentTypeConfiguration interface. Reserved for future type-wide settings such as default tag taxonomy rules and processing options.`})
29283
+ Configuration?: string;
29284
+
28319
29285
  @Field()
28320
29286
  @MaxLength(50)
28321
29287
  AIModel: string;
@@ -28364,6 +29330,9 @@ export class CreateMJContentTypeInput {
28364
29330
 
28365
29331
  @Field({ nullable: true })
28366
29332
  VectorIndexID: string | null;
29333
+
29334
+ @Field({ nullable: true })
29335
+ Configuration: string | null;
28367
29336
  }
28368
29337
 
28369
29338
 
@@ -28396,6 +29365,9 @@ export class UpdateMJContentTypeInput {
28396
29365
  @Field({ nullable: true })
28397
29366
  VectorIndexID?: string | null;
28398
29367
 
29368
+ @Field({ nullable: true })
29369
+ Configuration?: string | null;
29370
+
28399
29371
  @Field(() => [KeyValuePairInput], { nullable: true })
28400
29372
  OldValues___?: KeyValuePairInput[];
28401
29373
  }
@@ -34050,6 +35022,12 @@ export class MJDuplicateRunDetail_ {
34050
35022
  @Field({nullable: true, description: `JSON metadata snapshot of the source record from the vector database at detection time. Contains display fields (Name, Description, EntityIcon, etc.) for rich UI rendering without additional lookups.`})
34051
35023
  RecordMetadata?: string;
34052
35024
 
35025
+ @Field({nullable: true, description: `When processing started for this specific record during duplicate detection.`})
35026
+ StartedAt?: Date;
35027
+
35028
+ @Field({nullable: true, description: `When processing completed for this specific record during duplicate detection.`})
35029
+ EndedAt?: Date;
35030
+
34053
35031
  @Field()
34054
35032
  @MaxLength(255)
34055
35033
  DuplicateRun: string;
@@ -34090,6 +35068,12 @@ export class CreateMJDuplicateRunDetailInput {
34090
35068
 
34091
35069
  @Field({ nullable: true })
34092
35070
  RecordMetadata: string | null;
35071
+
35072
+ @Field({ nullable: true })
35073
+ StartedAt: Date | null;
35074
+
35075
+ @Field({ nullable: true })
35076
+ EndedAt: Date | null;
34093
35077
  }
34094
35078
 
34095
35079
 
@@ -34125,6 +35109,12 @@ export class UpdateMJDuplicateRunDetailInput {
34125
35109
  @Field({ nullable: true })
34126
35110
  RecordMetadata?: string | null;
34127
35111
 
35112
+ @Field({ nullable: true })
35113
+ StartedAt?: Date | null;
35114
+
35115
+ @Field({ nullable: true })
35116
+ EndedAt?: Date | null;
35117
+
34128
35118
  @Field(() => [KeyValuePairInput], { nullable: true })
34129
35119
  OldValues___?: KeyValuePairInput[];
34130
35120
  }
@@ -34276,6 +35266,21 @@ export class MJDuplicateRun_ {
34276
35266
  @Field()
34277
35267
  _mj__UpdatedAt: Date;
34278
35268
 
35269
+ @Field(() => Int, {nullable: true, description: `Total entity records to check for duplicates in this run.`})
35270
+ TotalItemCount?: number;
35271
+
35272
+ @Field(() => Int, {nullable: true, description: `Number of records checked so far. Used for progress percentage.`})
35273
+ ProcessedItemCount?: number;
35274
+
35275
+ @Field(() => Int, {nullable: true, description: `Resume cursor for large-scale duplicate detection. Stores the offset of the last completed batch.`})
35276
+ LastProcessedOffset?: number;
35277
+
35278
+ @Field(() => Int, {nullable: true, description: `Number of records processed per batch during duplicate detection.`})
35279
+ BatchSize?: number;
35280
+
35281
+ @Field(() => Boolean, {description: `When set to 1, duplicate detection stops after the current batch. Used for pause/cancel.`})
35282
+ CancellationRequested: boolean;
35283
+
34279
35284
  @Field()
34280
35285
  @MaxLength(255)
34281
35286
  Entity: string;
@@ -34334,6 +35339,21 @@ export class CreateMJDuplicateRunInput {
34334
35339
 
34335
35340
  @Field({ nullable: true })
34336
35341
  ProcessingErrorMessage: string | null;
35342
+
35343
+ @Field(() => Int, { nullable: true })
35344
+ TotalItemCount: number | null;
35345
+
35346
+ @Field(() => Int, { nullable: true })
35347
+ ProcessedItemCount?: number | null;
35348
+
35349
+ @Field(() => Int, { nullable: true })
35350
+ LastProcessedOffset?: number | null;
35351
+
35352
+ @Field(() => Int, { nullable: true })
35353
+ BatchSize?: number | null;
35354
+
35355
+ @Field(() => Boolean, { nullable: true })
35356
+ CancellationRequested?: boolean;
34337
35357
  }
34338
35358
 
34339
35359
 
@@ -34375,6 +35395,21 @@ export class UpdateMJDuplicateRunInput {
34375
35395
  @Field({ nullable: true })
34376
35396
  ProcessingErrorMessage?: string | null;
34377
35397
 
35398
+ @Field(() => Int, { nullable: true })
35399
+ TotalItemCount?: number | null;
35400
+
35401
+ @Field(() => Int, { nullable: true })
35402
+ ProcessedItemCount?: number | null;
35403
+
35404
+ @Field(() => Int, { nullable: true })
35405
+ LastProcessedOffset?: number | null;
35406
+
35407
+ @Field(() => Int, { nullable: true })
35408
+ BatchSize?: number | null;
35409
+
35410
+ @Field(() => Boolean, { nullable: true })
35411
+ CancellationRequested?: boolean;
35412
+
34378
35413
  @Field(() => [KeyValuePairInput], { nullable: true })
34379
35414
  OldValues___?: KeyValuePairInput[];
34380
35415
  }
@@ -36294,6 +37329,9 @@ export class MJEntity_ {
36294
37329
  @Field(() => [MJResourceType_])
36295
37330
  MJResourceTypes_CategoryEntityIDArray: MJResourceType_[]; // Link to MJResourceTypes
36296
37331
 
37332
+ @Field(() => [MJContentSource_])
37333
+ MJContentSources_EntityIDArray: MJContentSource_[]; // Link to MJContentSources
37334
+
36297
37335
  @Field(() => [MJTestRun_])
36298
37336
  MJTestRuns_TargetLogEntityIDArray: MJTestRun_[]; // Link to MJTestRuns
36299
37337
 
@@ -37219,6 +38257,16 @@ export class MJEntityResolverBase extends ResolverBase {
37219
38257
  return result;
37220
38258
  }
37221
38259
 
38260
+ @FieldResolver(() => [MJContentSource_])
38261
+ async MJContentSources_EntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
38262
+ this.CheckUserReadPermissions('MJ: Content Sources', userPayload);
38263
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
38264
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentSources')} WHERE ${provider.QuoteIdentifier('EntityID')}='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Sources', userPayload, EntityPermissionType.Read, 'AND');
38265
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
38266
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Sources', rows, this.GetUserFromPayload(userPayload));
38267
+ return result;
38268
+ }
38269
+
37222
38270
  @FieldResolver(() => [MJTestRun_])
37223
38271
  async MJTestRuns_TargetLogEntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
37224
38272
  this.CheckUserReadPermissions('MJ: Test Runs', userPayload);
@@ -39331,6 +40379,9 @@ export class MJEntityDocument_ {
39331
40379
  @Field(() => [MJEntityRecordDocument_])
39332
40380
  MJEntityRecordDocuments_EntityDocumentIDArray: MJEntityRecordDocument_[]; // Link to MJEntityRecordDocuments
39333
40381
 
40382
+ @Field(() => [MJContentSource_])
40383
+ MJContentSources_EntityDocumentIDArray: MJContentSource_[]; // Link to MJContentSources
40384
+
39334
40385
  }
39335
40386
 
39336
40387
  //****************************************************************************
@@ -39508,6 +40559,16 @@ export class MJEntityDocumentResolver extends ResolverBase {
39508
40559
  return result;
39509
40560
  }
39510
40561
 
40562
+ @FieldResolver(() => [MJContentSource_])
40563
+ async MJContentSources_EntityDocumentIDArray(@Root() mjentitydocument_: MJEntityDocument_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
40564
+ this.CheckUserReadPermissions('MJ: Content Sources', userPayload);
40565
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
40566
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentSources')} WHERE ${provider.QuoteIdentifier('EntityDocumentID')}='${mjentitydocument_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Sources', userPayload, EntityPermissionType.Read, 'AND');
40567
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
40568
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Sources', rows, this.GetUserFromPayload(userPayload));
40569
+ return result;
40570
+ }
40571
+
39511
40572
  @Mutation(() => MJEntityDocument_)
39512
40573
  async CreateMJEntityDocument(
39513
40574
  @Arg('input', () => CreateMJEntityDocumentInput) input: CreateMJEntityDocumentInput,
@@ -41180,6 +42241,9 @@ export class MJEntityRecordDocument_ {
41180
42241
  @MaxLength(255)
41181
42242
  VectorIndex: string;
41182
42243
 
42244
+ @Field(() => [MJContentItem_])
42245
+ MJContentItems_EntityRecordDocumentIDArray: MJContentItem_[]; // Link to MJContentItems
42246
+
41183
42247
  }
41184
42248
 
41185
42249
  //****************************************************************************
@@ -41309,6 +42373,16 @@ export class MJEntityRecordDocumentResolver extends ResolverBase {
41309
42373
  return result;
41310
42374
  }
41311
42375
 
42376
+ @FieldResolver(() => [MJContentItem_])
42377
+ async MJContentItems_EntityRecordDocumentIDArray(@Root() mjentityrecorddocument_: MJEntityRecordDocument_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
42378
+ this.CheckUserReadPermissions('MJ: Content Items', userPayload);
42379
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
42380
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentItems')} WHERE ${provider.QuoteIdentifier('EntityRecordDocumentID')}='${mjentityrecorddocument_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Items', userPayload, EntityPermissionType.Read, 'AND');
42381
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
42382
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Items', rows, this.GetUserFromPayload(userPayload));
42383
+ return result;
42384
+ }
42385
+
41312
42386
  @Mutation(() => MJEntityRecordDocument_)
41313
42387
  async CreateMJEntityRecordDocument(
41314
42388
  @Arg('input', () => CreateMJEntityRecordDocumentInput) input: CreateMJEntityRecordDocumentInput,
@@ -45501,6 +46575,201 @@ export class MJIntegrationResolver extends ResolverBase {
45501
46575
 
45502
46576
  }
45503
46577
 
46578
+ //****************************************************************************
46579
+ // ENTITY CLASS for MJ: Knowledge Hub Saved Searches
46580
+ //****************************************************************************
46581
+ @ObjectType({ description: `User-saved search queries for the Knowledge Hub. Stores query text, active filters (JSON), and score thresholds so searches can be recalled or run on a schedule.` })
46582
+ export class MJKnowledgeHubSavedSearch_ {
46583
+ @Field()
46584
+ @MaxLength(36)
46585
+ ID: string;
46586
+
46587
+ @Field()
46588
+ @MaxLength(36)
46589
+ UserID: string;
46590
+
46591
+ @Field()
46592
+ @MaxLength(255)
46593
+ Name: string;
46594
+
46595
+ @Field()
46596
+ @MaxLength(1000)
46597
+ Query: string;
46598
+
46599
+ @Field({nullable: true, description: `JSON object with active filter selections. Keys are filter categories (Entity, Tags), values are arrays of selected option values.`})
46600
+ Filters?: string;
46601
+
46602
+ @Field(() => Float, {nullable: true})
46603
+ MinScore?: number;
46604
+
46605
+ @Field(() => Int, {nullable: true})
46606
+ MaxResults?: number;
46607
+
46608
+ @Field(() => Boolean, {description: `When enabled, the system will notify the user when new results match this saved search (future capability).`})
46609
+ NotifyOnNewResults: boolean;
46610
+
46611
+ @Field()
46612
+ _mj__CreatedAt: Date;
46613
+
46614
+ @Field()
46615
+ _mj__UpdatedAt: Date;
46616
+
46617
+ @Field()
46618
+ @MaxLength(100)
46619
+ User: string;
46620
+
46621
+ }
46622
+
46623
+ //****************************************************************************
46624
+ // INPUT TYPE for MJ: Knowledge Hub Saved Searches
46625
+ //****************************************************************************
46626
+ @InputType()
46627
+ export class CreateMJKnowledgeHubSavedSearchInput {
46628
+ @Field({ nullable: true })
46629
+ ID?: string;
46630
+
46631
+ @Field({ nullable: true })
46632
+ UserID?: string;
46633
+
46634
+ @Field({ nullable: true })
46635
+ Name?: string;
46636
+
46637
+ @Field({ nullable: true })
46638
+ Query?: string;
46639
+
46640
+ @Field({ nullable: true })
46641
+ Filters: string | null;
46642
+
46643
+ @Field(() => Float, { nullable: true })
46644
+ MinScore: number | null;
46645
+
46646
+ @Field(() => Int, { nullable: true })
46647
+ MaxResults?: number | null;
46648
+
46649
+ @Field(() => Boolean, { nullable: true })
46650
+ NotifyOnNewResults?: boolean;
46651
+ }
46652
+
46653
+
46654
+ //****************************************************************************
46655
+ // INPUT TYPE for MJ: Knowledge Hub Saved Searches
46656
+ //****************************************************************************
46657
+ @InputType()
46658
+ export class UpdateMJKnowledgeHubSavedSearchInput {
46659
+ @Field()
46660
+ ID: string;
46661
+
46662
+ @Field({ nullable: true })
46663
+ UserID?: string;
46664
+
46665
+ @Field({ nullable: true })
46666
+ Name?: string;
46667
+
46668
+ @Field({ nullable: true })
46669
+ Query?: string;
46670
+
46671
+ @Field({ nullable: true })
46672
+ Filters?: string | null;
46673
+
46674
+ @Field(() => Float, { nullable: true })
46675
+ MinScore?: number | null;
46676
+
46677
+ @Field(() => Int, { nullable: true })
46678
+ MaxResults?: number | null;
46679
+
46680
+ @Field(() => Boolean, { nullable: true })
46681
+ NotifyOnNewResults?: boolean;
46682
+
46683
+ @Field(() => [KeyValuePairInput], { nullable: true })
46684
+ OldValues___?: KeyValuePairInput[];
46685
+ }
46686
+
46687
+ //****************************************************************************
46688
+ // RESOLVER for MJ: Knowledge Hub Saved Searches
46689
+ //****************************************************************************
46690
+ @ObjectType()
46691
+ export class RunMJKnowledgeHubSavedSearchViewResult {
46692
+ @Field(() => [MJKnowledgeHubSavedSearch_])
46693
+ Results: MJKnowledgeHubSavedSearch_[];
46694
+
46695
+ @Field(() => String, {nullable: true})
46696
+ UserViewRunID?: string;
46697
+
46698
+ @Field(() => Int, {nullable: true})
46699
+ RowCount: number;
46700
+
46701
+ @Field(() => Int, {nullable: true})
46702
+ TotalRowCount: number;
46703
+
46704
+ @Field(() => Int, {nullable: true})
46705
+ ExecutionTime: number;
46706
+
46707
+ @Field({nullable: true})
46708
+ ErrorMessage?: string;
46709
+
46710
+ @Field(() => Boolean, {nullable: false})
46711
+ Success: boolean;
46712
+ }
46713
+
46714
+ @Resolver(MJKnowledgeHubSavedSearch_)
46715
+ export class MJKnowledgeHubSavedSearchResolver extends ResolverBase {
46716
+ @Query(() => RunMJKnowledgeHubSavedSearchViewResult)
46717
+ async RunMJKnowledgeHubSavedSearchViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
46718
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
46719
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
46720
+ }
46721
+
46722
+ @Query(() => RunMJKnowledgeHubSavedSearchViewResult)
46723
+ async RunMJKnowledgeHubSavedSearchViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
46724
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
46725
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
46726
+ }
46727
+
46728
+ @Query(() => RunMJKnowledgeHubSavedSearchViewResult)
46729
+ async RunMJKnowledgeHubSavedSearchDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
46730
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
46731
+ input.EntityName = 'MJ: Knowledge Hub Saved Searches';
46732
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
46733
+ }
46734
+ @Query(() => MJKnowledgeHubSavedSearch_, { nullable: true })
46735
+ async MJKnowledgeHubSavedSearch(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJKnowledgeHubSavedSearch_ | null> {
46736
+ this.CheckUserReadPermissions('MJ: Knowledge Hub Saved Searches', userPayload);
46737
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
46738
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwKnowledgeHubSavedSearches')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Knowledge Hub Saved Searches', userPayload, EntityPermissionType.Read, 'AND');
46739
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
46740
+ const result = await this.MapFieldNamesToCodeNames('MJ: Knowledge Hub Saved Searches', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
46741
+ return result;
46742
+ }
46743
+
46744
+ @Mutation(() => MJKnowledgeHubSavedSearch_)
46745
+ async CreateMJKnowledgeHubSavedSearch(
46746
+ @Arg('input', () => CreateMJKnowledgeHubSavedSearchInput) input: CreateMJKnowledgeHubSavedSearchInput,
46747
+ @Ctx() { providers, userPayload }: AppContext,
46748
+ @PubSub() pubSub: PubSubEngine
46749
+ ) {
46750
+ const provider = GetReadWriteProvider(providers);
46751
+ return this.CreateRecord('MJ: Knowledge Hub Saved Searches', input, provider, userPayload, pubSub)
46752
+ }
46753
+
46754
+ @Mutation(() => MJKnowledgeHubSavedSearch_)
46755
+ async UpdateMJKnowledgeHubSavedSearch(
46756
+ @Arg('input', () => UpdateMJKnowledgeHubSavedSearchInput) input: UpdateMJKnowledgeHubSavedSearchInput,
46757
+ @Ctx() { providers, userPayload }: AppContext,
46758
+ @PubSub() pubSub: PubSubEngine
46759
+ ) {
46760
+ const provider = GetReadWriteProvider(providers);
46761
+ return this.UpdateRecord('MJ: Knowledge Hub Saved Searches', input, provider, userPayload, pubSub);
46762
+ }
46763
+
46764
+ @Mutation(() => MJKnowledgeHubSavedSearch_)
46765
+ async DeleteMJKnowledgeHubSavedSearch(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
46766
+ const provider = GetReadWriteProvider(providers);
46767
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
46768
+ return this.DeleteRecord('MJ: Knowledge Hub Saved Searches', key, options, provider, userPayload, pubSub);
46769
+ }
46770
+
46771
+ }
46772
+
45504
46773
  //****************************************************************************
45505
46774
  // ENTITY CLASS for MJ: Libraries
45506
46775
  //****************************************************************************
@@ -58081,6 +59350,9 @@ export class MJScheduledAction_ {
58081
59350
  @Field(() => [MJScheduledActionParam_])
58082
59351
  MJScheduledActionParams_ScheduledActionIDArray: MJScheduledActionParam_[]; // Link to MJScheduledActionParams
58083
59352
 
59353
+ @Field(() => [MJContentSource_])
59354
+ MJContentSources_ScheduledActionIDArray: MJContentSource_[]; // Link to MJContentSources
59355
+
58084
59356
  }
58085
59357
 
58086
59358
  //****************************************************************************
@@ -58250,6 +59522,16 @@ export class MJScheduledActionResolver extends ResolverBase {
58250
59522
  return result;
58251
59523
  }
58252
59524
 
59525
+ @FieldResolver(() => [MJContentSource_])
59526
+ async MJContentSources_ScheduledActionIDArray(@Root() mjscheduledaction_: MJScheduledAction_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
59527
+ this.CheckUserReadPermissions('MJ: Content Sources', userPayload);
59528
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
59529
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentSources')} WHERE ${provider.QuoteIdentifier('ScheduledActionID')}='${mjscheduledaction_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Sources', userPayload, EntityPermissionType.Read, 'AND');
59530
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
59531
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Sources', rows, this.GetUserFromPayload(userPayload));
59532
+ return result;
59533
+ }
59534
+
58253
59535
  @Mutation(() => MJScheduledAction_)
58254
59536
  async CreateMJScheduledAction(
58255
59537
  @Arg('input', () => CreateMJScheduledActionInput) input: CreateMJScheduledActionInput,
@@ -59726,6 +61008,363 @@ export class MJSQLDialectResolver extends ResolverBase {
59726
61008
 
59727
61009
  }
59728
61010
 
61011
+ //****************************************************************************
61012
+ // ENTITY CLASS for MJ: Tag Audit Logs
61013
+ //****************************************************************************
61014
+ @ObjectType({ description: `Immutable audit trail for all tag taxonomy changes. Each row records a single action with before/after details in JSON.` })
61015
+ export class MJTagAuditLog_ {
61016
+ @Field()
61017
+ @MaxLength(36)
61018
+ ID: string;
61019
+
61020
+ @Field({description: `The tag that was acted upon.`})
61021
+ @MaxLength(36)
61022
+ TagID: string;
61023
+
61024
+ @Field({description: `The type of action performed: Created, Renamed, Moved (parent changed), Merged (into RelatedTagID), Split (from RelatedTagID), Deprecated, Reactivated, Deleted, DescriptionChanged.`})
61025
+ @MaxLength(30)
61026
+ Action: string;
61027
+
61028
+ @Field({nullable: true, description: `JSON object with action-specific details. For Renamed: {"OldName":"...","NewName":"..."}. For Moved: {"OldParentID":"...","NewParentID":"..."}. For Merged: {"ItemsMoved":42}.`})
61029
+ Details?: string;
61030
+
61031
+ @Field({description: `User who performed the action.`})
61032
+ @MaxLength(36)
61033
+ PerformedByUserID: string;
61034
+
61035
+ @Field({nullable: true, description: `For Merged actions: the surviving tag. For Split actions: the source tag. NULL for other actions.`})
61036
+ @MaxLength(36)
61037
+ RelatedTagID?: string;
61038
+
61039
+ @Field()
61040
+ _mj__CreatedAt: Date;
61041
+
61042
+ @Field()
61043
+ _mj__UpdatedAt: Date;
61044
+
61045
+ @Field()
61046
+ @MaxLength(255)
61047
+ Tag: string;
61048
+
61049
+ @Field()
61050
+ @MaxLength(100)
61051
+ PerformedByUser: string;
61052
+
61053
+ @Field({nullable: true})
61054
+ @MaxLength(255)
61055
+ RelatedTag?: string;
61056
+
61057
+ }
61058
+
61059
+ //****************************************************************************
61060
+ // INPUT TYPE for MJ: Tag Audit Logs
61061
+ //****************************************************************************
61062
+ @InputType()
61063
+ export class CreateMJTagAuditLogInput {
61064
+ @Field({ nullable: true })
61065
+ ID?: string;
61066
+
61067
+ @Field({ nullable: true })
61068
+ TagID?: string;
61069
+
61070
+ @Field({ nullable: true })
61071
+ Action?: string;
61072
+
61073
+ @Field({ nullable: true })
61074
+ Details: string | null;
61075
+
61076
+ @Field({ nullable: true })
61077
+ PerformedByUserID?: string;
61078
+
61079
+ @Field({ nullable: true })
61080
+ RelatedTagID: string | null;
61081
+ }
61082
+
61083
+
61084
+ //****************************************************************************
61085
+ // INPUT TYPE for MJ: Tag Audit Logs
61086
+ //****************************************************************************
61087
+ @InputType()
61088
+ export class UpdateMJTagAuditLogInput {
61089
+ @Field()
61090
+ ID: string;
61091
+
61092
+ @Field({ nullable: true })
61093
+ TagID?: string;
61094
+
61095
+ @Field({ nullable: true })
61096
+ Action?: string;
61097
+
61098
+ @Field({ nullable: true })
61099
+ Details?: string | null;
61100
+
61101
+ @Field({ nullable: true })
61102
+ PerformedByUserID?: string;
61103
+
61104
+ @Field({ nullable: true })
61105
+ RelatedTagID?: string | null;
61106
+
61107
+ @Field(() => [KeyValuePairInput], { nullable: true })
61108
+ OldValues___?: KeyValuePairInput[];
61109
+ }
61110
+
61111
+ //****************************************************************************
61112
+ // RESOLVER for MJ: Tag Audit Logs
61113
+ //****************************************************************************
61114
+ @ObjectType()
61115
+ export class RunMJTagAuditLogViewResult {
61116
+ @Field(() => [MJTagAuditLog_])
61117
+ Results: MJTagAuditLog_[];
61118
+
61119
+ @Field(() => String, {nullable: true})
61120
+ UserViewRunID?: string;
61121
+
61122
+ @Field(() => Int, {nullable: true})
61123
+ RowCount: number;
61124
+
61125
+ @Field(() => Int, {nullable: true})
61126
+ TotalRowCount: number;
61127
+
61128
+ @Field(() => Int, {nullable: true})
61129
+ ExecutionTime: number;
61130
+
61131
+ @Field({nullable: true})
61132
+ ErrorMessage?: string;
61133
+
61134
+ @Field(() => Boolean, {nullable: false})
61135
+ Success: boolean;
61136
+ }
61137
+
61138
+ @Resolver(MJTagAuditLog_)
61139
+ export class MJTagAuditLogResolver extends ResolverBase {
61140
+ @Query(() => RunMJTagAuditLogViewResult)
61141
+ async RunMJTagAuditLogViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
61142
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
61143
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
61144
+ }
61145
+
61146
+ @Query(() => RunMJTagAuditLogViewResult)
61147
+ async RunMJTagAuditLogViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
61148
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
61149
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
61150
+ }
61151
+
61152
+ @Query(() => RunMJTagAuditLogViewResult)
61153
+ async RunMJTagAuditLogDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
61154
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
61155
+ input.EntityName = 'MJ: Tag Audit Logs';
61156
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
61157
+ }
61158
+ @Query(() => MJTagAuditLog_, { nullable: true })
61159
+ async MJTagAuditLog(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJTagAuditLog_ | null> {
61160
+ this.CheckUserReadPermissions('MJ: Tag Audit Logs', userPayload);
61161
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
61162
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwTagAuditLogs')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Tag Audit Logs', userPayload, EntityPermissionType.Read, 'AND');
61163
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
61164
+ const result = await this.MapFieldNamesToCodeNames('MJ: Tag Audit Logs', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
61165
+ return result;
61166
+ }
61167
+
61168
+ @Mutation(() => MJTagAuditLog_)
61169
+ async CreateMJTagAuditLog(
61170
+ @Arg('input', () => CreateMJTagAuditLogInput) input: CreateMJTagAuditLogInput,
61171
+ @Ctx() { providers, userPayload }: AppContext,
61172
+ @PubSub() pubSub: PubSubEngine
61173
+ ) {
61174
+ const provider = GetReadWriteProvider(providers);
61175
+ return this.CreateRecord('MJ: Tag Audit Logs', input, provider, userPayload, pubSub)
61176
+ }
61177
+
61178
+ @Mutation(() => MJTagAuditLog_)
61179
+ async UpdateMJTagAuditLog(
61180
+ @Arg('input', () => UpdateMJTagAuditLogInput) input: UpdateMJTagAuditLogInput,
61181
+ @Ctx() { providers, userPayload }: AppContext,
61182
+ @PubSub() pubSub: PubSubEngine
61183
+ ) {
61184
+ const provider = GetReadWriteProvider(providers);
61185
+ return this.UpdateRecord('MJ: Tag Audit Logs', input, provider, userPayload, pubSub);
61186
+ }
61187
+
61188
+ @Mutation(() => MJTagAuditLog_)
61189
+ async DeleteMJTagAuditLog(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
61190
+ const provider = GetReadWriteProvider(providers);
61191
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
61192
+ return this.DeleteRecord('MJ: Tag Audit Logs', key, options, provider, userPayload, pubSub);
61193
+ }
61194
+
61195
+ }
61196
+
61197
+ //****************************************************************************
61198
+ // ENTITY CLASS for MJ: Tag Co Occurrences
61199
+ //****************************************************************************
61200
+ @ObjectType({ description: `Materialized co-occurrence counts for tag pairs. Records how many content items share both tags. Used for taxonomy health analysis, merge suggestions, and cross-entity intelligence. Recomputed periodically by the pipeline.` })
61201
+ export class MJTagCoOccurrence_ {
61202
+ @Field()
61203
+ @MaxLength(36)
61204
+ ID: string;
61205
+
61206
+ @Field({description: `First tag in the canonical pair (TagAID < TagBID ensures each pair is stored exactly once).`})
61207
+ @MaxLength(36)
61208
+ TagAID: string;
61209
+
61210
+ @Field()
61211
+ @MaxLength(36)
61212
+ TagBID: string;
61213
+
61214
+ @Field(() => Int, {description: `Number of content items (or entity records via TaggedItem) that are tagged with both TagA and TagB.`})
61215
+ CoOccurrenceCount: number;
61216
+
61217
+ @Field()
61218
+ LastComputedAt: Date;
61219
+
61220
+ @Field()
61221
+ _mj__CreatedAt: Date;
61222
+
61223
+ @Field()
61224
+ _mj__UpdatedAt: Date;
61225
+
61226
+ @Field()
61227
+ @MaxLength(255)
61228
+ TagA: string;
61229
+
61230
+ @Field()
61231
+ @MaxLength(255)
61232
+ TagB: string;
61233
+
61234
+ }
61235
+
61236
+ //****************************************************************************
61237
+ // INPUT TYPE for MJ: Tag Co Occurrences
61238
+ //****************************************************************************
61239
+ @InputType()
61240
+ export class CreateMJTagCoOccurrenceInput {
61241
+ @Field({ nullable: true })
61242
+ ID?: string;
61243
+
61244
+ @Field({ nullable: true })
61245
+ TagAID?: string;
61246
+
61247
+ @Field({ nullable: true })
61248
+ TagBID?: string;
61249
+
61250
+ @Field(() => Int, { nullable: true })
61251
+ CoOccurrenceCount?: number;
61252
+
61253
+ @Field({ nullable: true })
61254
+ LastComputedAt?: Date;
61255
+ }
61256
+
61257
+
61258
+ //****************************************************************************
61259
+ // INPUT TYPE for MJ: Tag Co Occurrences
61260
+ //****************************************************************************
61261
+ @InputType()
61262
+ export class UpdateMJTagCoOccurrenceInput {
61263
+ @Field()
61264
+ ID: string;
61265
+
61266
+ @Field({ nullable: true })
61267
+ TagAID?: string;
61268
+
61269
+ @Field({ nullable: true })
61270
+ TagBID?: string;
61271
+
61272
+ @Field(() => Int, { nullable: true })
61273
+ CoOccurrenceCount?: number;
61274
+
61275
+ @Field({ nullable: true })
61276
+ LastComputedAt?: Date;
61277
+
61278
+ @Field(() => [KeyValuePairInput], { nullable: true })
61279
+ OldValues___?: KeyValuePairInput[];
61280
+ }
61281
+
61282
+ //****************************************************************************
61283
+ // RESOLVER for MJ: Tag Co Occurrences
61284
+ //****************************************************************************
61285
+ @ObjectType()
61286
+ export class RunMJTagCoOccurrenceViewResult {
61287
+ @Field(() => [MJTagCoOccurrence_])
61288
+ Results: MJTagCoOccurrence_[];
61289
+
61290
+ @Field(() => String, {nullable: true})
61291
+ UserViewRunID?: string;
61292
+
61293
+ @Field(() => Int, {nullable: true})
61294
+ RowCount: number;
61295
+
61296
+ @Field(() => Int, {nullable: true})
61297
+ TotalRowCount: number;
61298
+
61299
+ @Field(() => Int, {nullable: true})
61300
+ ExecutionTime: number;
61301
+
61302
+ @Field({nullable: true})
61303
+ ErrorMessage?: string;
61304
+
61305
+ @Field(() => Boolean, {nullable: false})
61306
+ Success: boolean;
61307
+ }
61308
+
61309
+ @Resolver(MJTagCoOccurrence_)
61310
+ export class MJTagCoOccurrenceResolver extends ResolverBase {
61311
+ @Query(() => RunMJTagCoOccurrenceViewResult)
61312
+ async RunMJTagCoOccurrenceViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
61313
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
61314
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
61315
+ }
61316
+
61317
+ @Query(() => RunMJTagCoOccurrenceViewResult)
61318
+ async RunMJTagCoOccurrenceViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
61319
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
61320
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
61321
+ }
61322
+
61323
+ @Query(() => RunMJTagCoOccurrenceViewResult)
61324
+ async RunMJTagCoOccurrenceDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
61325
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
61326
+ input.EntityName = 'MJ: Tag Co Occurrences';
61327
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
61328
+ }
61329
+ @Query(() => MJTagCoOccurrence_, { nullable: true })
61330
+ async MJTagCoOccurrence(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJTagCoOccurrence_ | null> {
61331
+ this.CheckUserReadPermissions('MJ: Tag Co Occurrences', userPayload);
61332
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
61333
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwTagCoOccurrences')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Tag Co Occurrences', userPayload, EntityPermissionType.Read, 'AND');
61334
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
61335
+ const result = await this.MapFieldNamesToCodeNames('MJ: Tag Co Occurrences', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
61336
+ return result;
61337
+ }
61338
+
61339
+ @Mutation(() => MJTagCoOccurrence_)
61340
+ async CreateMJTagCoOccurrence(
61341
+ @Arg('input', () => CreateMJTagCoOccurrenceInput) input: CreateMJTagCoOccurrenceInput,
61342
+ @Ctx() { providers, userPayload }: AppContext,
61343
+ @PubSub() pubSub: PubSubEngine
61344
+ ) {
61345
+ const provider = GetReadWriteProvider(providers);
61346
+ return this.CreateRecord('MJ: Tag Co Occurrences', input, provider, userPayload, pubSub)
61347
+ }
61348
+
61349
+ @Mutation(() => MJTagCoOccurrence_)
61350
+ async UpdateMJTagCoOccurrence(
61351
+ @Arg('input', () => UpdateMJTagCoOccurrenceInput) input: UpdateMJTagCoOccurrenceInput,
61352
+ @Ctx() { providers, userPayload }: AppContext,
61353
+ @PubSub() pubSub: PubSubEngine
61354
+ ) {
61355
+ const provider = GetReadWriteProvider(providers);
61356
+ return this.UpdateRecord('MJ: Tag Co Occurrences', input, provider, userPayload, pubSub);
61357
+ }
61358
+
61359
+ @Mutation(() => MJTagCoOccurrence_)
61360
+ async DeleteMJTagCoOccurrence(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
61361
+ const provider = GetReadWriteProvider(providers);
61362
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
61363
+ return this.DeleteRecord('MJ: Tag Co Occurrences', key, options, provider, userPayload, pubSub);
61364
+ }
61365
+
61366
+ }
61367
+
59729
61368
  //****************************************************************************
59730
61369
  // ENTITY CLASS for MJ: Tagged Items
59731
61370
  //****************************************************************************
@@ -59753,6 +61392,9 @@ export class MJTaggedItem_ {
59753
61392
  @Field()
59754
61393
  _mj__UpdatedAt: Date;
59755
61394
 
61395
+ @Field(() => Float, {description: `Relevance weight of this tag association (0.0 to 1.0). 1.0 indicates the tag is highly relevant or was manually applied. Lower values indicate decreasing relevance as determined by LLM autotagging. Default 1.0 for manually applied tags.`})
61396
+ Weight: number;
61397
+
59756
61398
  @Field()
59757
61399
  @MaxLength(255)
59758
61400
  Tag: string;
@@ -59779,6 +61421,9 @@ export class CreateMJTaggedItemInput {
59779
61421
 
59780
61422
  @Field({ nullable: true })
59781
61423
  RecordID?: string;
61424
+
61425
+ @Field(() => Float, { nullable: true })
61426
+ Weight?: number;
59782
61427
  }
59783
61428
 
59784
61429
 
@@ -59799,6 +61444,9 @@ export class UpdateMJTaggedItemInput {
59799
61444
  @Field({ nullable: true })
59800
61445
  RecordID?: string;
59801
61446
 
61447
+ @Field(() => Float, { nullable: true })
61448
+ Weight?: number;
61449
+
59802
61450
  @Field(() => [KeyValuePairInput], { nullable: true })
59803
61451
  OldValues___?: KeyValuePairInput[];
59804
61452
  }
@@ -59919,20 +61567,54 @@ export class MJTag_ {
59919
61567
  @Field()
59920
61568
  _mj__UpdatedAt: Date;
59921
61569
 
61570
+ @Field({description: `Lifecycle status of the tag: Active (in use), Merged (consolidated into another tag), Deprecated (no longer assigned but preserved), Deleted (soft-deleted).`})
61571
+ @MaxLength(20)
61572
+ Status: string;
61573
+
61574
+ @Field({nullable: true, description: `When Status is Merged, points to the surviving tag this tag was merged into. All TaggedItem and ContentItemTag references are re-pointed during merge.`})
61575
+ @MaxLength(36)
61576
+ MergedIntoTagID?: string;
61577
+
59922
61578
  @Field({nullable: true})
59923
61579
  @MaxLength(255)
59924
61580
  Parent?: string;
59925
61581
 
61582
+ @Field({nullable: true})
61583
+ @MaxLength(255)
61584
+ MergedIntoTag?: string;
61585
+
59926
61586
  @Field({nullable: true})
59927
61587
  @MaxLength(36)
59928
61588
  RootParentID?: string;
59929
61589
 
61590
+ @Field({nullable: true})
61591
+ @MaxLength(36)
61592
+ RootMergedIntoTagID?: string;
61593
+
59930
61594
  @Field(() => [MJTag_])
59931
61595
  MJTags_ParentIDArray: MJTag_[]; // Link to MJTags
59932
61596
 
59933
61597
  @Field(() => [MJTaggedItem_])
59934
61598
  MJTaggedItems_TagIDArray: MJTaggedItem_[]; // Link to MJTaggedItems
59935
61599
 
61600
+ @Field(() => [MJContentItemTag_])
61601
+ MJContentItemTags_TagIDArray: MJContentItemTag_[]; // Link to MJContentItemTags
61602
+
61603
+ @Field(() => [MJTagCoOccurrence_])
61604
+ MJTagCoOccurrences_TagBIDArray: MJTagCoOccurrence_[]; // Link to MJTagCoOccurrences
61605
+
61606
+ @Field(() => [MJTagAuditLog_])
61607
+ MJTagAuditLogs_RelatedTagIDArray: MJTagAuditLog_[]; // Link to MJTagAuditLogs
61608
+
61609
+ @Field(() => [MJTagCoOccurrence_])
61610
+ MJTagCoOccurrences_TagAIDArray: MJTagCoOccurrence_[]; // Link to MJTagCoOccurrences
61611
+
61612
+ @Field(() => [MJTagAuditLog_])
61613
+ MJTagAuditLogs_TagIDArray: MJTagAuditLog_[]; // Link to MJTagAuditLogs
61614
+
61615
+ @Field(() => [MJTag_])
61616
+ MJTags_MergedIntoTagIDArray: MJTag_[]; // Link to MJTags
61617
+
59936
61618
  }
59937
61619
 
59938
61620
  //****************************************************************************
@@ -59954,6 +61636,12 @@ export class CreateMJTagInput {
59954
61636
 
59955
61637
  @Field({ nullable: true })
59956
61638
  Description: string | null;
61639
+
61640
+ @Field({ nullable: true })
61641
+ Status?: string;
61642
+
61643
+ @Field({ nullable: true })
61644
+ MergedIntoTagID: string | null;
59957
61645
  }
59958
61646
 
59959
61647
 
@@ -59977,6 +61665,12 @@ export class UpdateMJTagInput {
59977
61665
  @Field({ nullable: true })
59978
61666
  Description?: string | null;
59979
61667
 
61668
+ @Field({ nullable: true })
61669
+ Status?: string;
61670
+
61671
+ @Field({ nullable: true })
61672
+ MergedIntoTagID?: string | null;
61673
+
59980
61674
  @Field(() => [KeyValuePairInput], { nullable: true })
59981
61675
  OldValues___?: KeyValuePairInput[];
59982
61676
  }
@@ -60058,6 +61752,66 @@ export class MJTagResolver extends ResolverBase {
60058
61752
  return result;
60059
61753
  }
60060
61754
 
61755
+ @FieldResolver(() => [MJContentItemTag_])
61756
+ async MJContentItemTags_TagIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
61757
+ this.CheckUserReadPermissions('MJ: Content Item Tags', userPayload);
61758
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
61759
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentItemTags')} WHERE ${provider.QuoteIdentifier('TagID')}='${mjtag_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Item Tags', userPayload, EntityPermissionType.Read, 'AND');
61760
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
61761
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Item Tags', rows, this.GetUserFromPayload(userPayload));
61762
+ return result;
61763
+ }
61764
+
61765
+ @FieldResolver(() => [MJTagCoOccurrence_])
61766
+ async MJTagCoOccurrences_TagBIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
61767
+ this.CheckUserReadPermissions('MJ: Tag Co Occurrences', userPayload);
61768
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
61769
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwTagCoOccurrences')} WHERE ${provider.QuoteIdentifier('TagBID')}='${mjtag_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Tag Co Occurrences', userPayload, EntityPermissionType.Read, 'AND');
61770
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
61771
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Tag Co Occurrences', rows, this.GetUserFromPayload(userPayload));
61772
+ return result;
61773
+ }
61774
+
61775
+ @FieldResolver(() => [MJTagAuditLog_])
61776
+ async MJTagAuditLogs_RelatedTagIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
61777
+ this.CheckUserReadPermissions('MJ: Tag Audit Logs', userPayload);
61778
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
61779
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwTagAuditLogs')} WHERE ${provider.QuoteIdentifier('RelatedTagID')}='${mjtag_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Tag Audit Logs', userPayload, EntityPermissionType.Read, 'AND');
61780
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
61781
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Tag Audit Logs', rows, this.GetUserFromPayload(userPayload));
61782
+ return result;
61783
+ }
61784
+
61785
+ @FieldResolver(() => [MJTagCoOccurrence_])
61786
+ async MJTagCoOccurrences_TagAIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
61787
+ this.CheckUserReadPermissions('MJ: Tag Co Occurrences', userPayload);
61788
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
61789
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwTagCoOccurrences')} WHERE ${provider.QuoteIdentifier('TagAID')}='${mjtag_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Tag Co Occurrences', userPayload, EntityPermissionType.Read, 'AND');
61790
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
61791
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Tag Co Occurrences', rows, this.GetUserFromPayload(userPayload));
61792
+ return result;
61793
+ }
61794
+
61795
+ @FieldResolver(() => [MJTagAuditLog_])
61796
+ async MJTagAuditLogs_TagIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
61797
+ this.CheckUserReadPermissions('MJ: Tag Audit Logs', userPayload);
61798
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
61799
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwTagAuditLogs')} WHERE ${provider.QuoteIdentifier('TagID')}='${mjtag_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Tag Audit Logs', userPayload, EntityPermissionType.Read, 'AND');
61800
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
61801
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Tag Audit Logs', rows, this.GetUserFromPayload(userPayload));
61802
+ return result;
61803
+ }
61804
+
61805
+ @FieldResolver(() => [MJTag_])
61806
+ async MJTags_MergedIntoTagIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
61807
+ this.CheckUserReadPermissions('MJ: Tags', userPayload);
61808
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
61809
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwTags')} WHERE ${provider.QuoteIdentifier('MergedIntoTagID')}='${mjtag_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Tags', userPayload, EntityPermissionType.Read, 'AND');
61810
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
61811
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Tags', rows, this.GetUserFromPayload(userPayload));
61812
+ return result;
61813
+ }
61814
+
60061
61815
  @Mutation(() => MJTag_)
60062
61816
  async CreateMJTag(
60063
61817
  @Arg('input', () => CreateMJTagInput) input: CreateMJTagInput,
@@ -67369,6 +69123,18 @@ export class MJUser_ {
67369
69123
  @Field(() => [MJOpenApp_])
67370
69124
  MJOpenApps_InstalledByUserIDArray: MJOpenApp_[]; // Link to MJOpenApps
67371
69125
 
69126
+ @Field(() => [MJContentItemDuplicate_])
69127
+ MJContentItemDuplicates_ResolvedByUserIDArray: MJContentItemDuplicate_[]; // Link to MJContentItemDuplicates
69128
+
69129
+ @Field(() => [MJContentProcessRun_])
69130
+ MJContentProcessRuns_StartedByUserIDArray: MJContentProcessRun_[]; // Link to MJContentProcessRuns
69131
+
69132
+ @Field(() => [MJKnowledgeHubSavedSearch_])
69133
+ MJKnowledgeHubSavedSearches_UserIDArray: MJKnowledgeHubSavedSearch_[]; // Link to MJKnowledgeHubSavedSearches
69134
+
69135
+ @Field(() => [MJTagAuditLog_])
69136
+ MJTagAuditLogs_PerformedByUserIDArray: MJTagAuditLog_[]; // Link to MJTagAuditLogs
69137
+
67372
69138
  @Field(() => [MJResourcePermission_])
67373
69139
  MJResourcePermissions_UserIDArray: MJResourcePermission_[]; // Link to MJResourcePermissions
67374
69140
 
@@ -68207,6 +69973,46 @@ export class MJUserResolverBase extends ResolverBase {
68207
69973
  return result;
68208
69974
  }
68209
69975
 
69976
+ @FieldResolver(() => [MJContentItemDuplicate_])
69977
+ async MJContentItemDuplicates_ResolvedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
69978
+ this.CheckUserReadPermissions('MJ: Content Item Duplicates', userPayload);
69979
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
69980
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentItemDuplicates')} WHERE ${provider.QuoteIdentifier('ResolvedByUserID')}='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Item Duplicates', userPayload, EntityPermissionType.Read, 'AND');
69981
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
69982
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Item Duplicates', rows, this.GetUserFromPayload(userPayload));
69983
+ return result;
69984
+ }
69985
+
69986
+ @FieldResolver(() => [MJContentProcessRun_])
69987
+ async MJContentProcessRuns_StartedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
69988
+ this.CheckUserReadPermissions('MJ: Content Process Runs', userPayload);
69989
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
69990
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentProcessRuns')} WHERE ${provider.QuoteIdentifier('StartedByUserID')}='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Process Runs', userPayload, EntityPermissionType.Read, 'AND');
69991
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
69992
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Process Runs', rows, this.GetUserFromPayload(userPayload));
69993
+ return result;
69994
+ }
69995
+
69996
+ @FieldResolver(() => [MJKnowledgeHubSavedSearch_])
69997
+ async MJKnowledgeHubSavedSearches_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
69998
+ this.CheckUserReadPermissions('MJ: Knowledge Hub Saved Searches', userPayload);
69999
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
70000
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwKnowledgeHubSavedSearches')} WHERE ${provider.QuoteIdentifier('UserID')}='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Knowledge Hub Saved Searches', userPayload, EntityPermissionType.Read, 'AND');
70001
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
70002
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Knowledge Hub Saved Searches', rows, this.GetUserFromPayload(userPayload));
70003
+ return result;
70004
+ }
70005
+
70006
+ @FieldResolver(() => [MJTagAuditLog_])
70007
+ async MJTagAuditLogs_PerformedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
70008
+ this.CheckUserReadPermissions('MJ: Tag Audit Logs', userPayload);
70009
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
70010
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwTagAuditLogs')} WHERE ${provider.QuoteIdentifier('PerformedByUserID')}='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Tag Audit Logs', userPayload, EntityPermissionType.Read, 'AND');
70011
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
70012
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Tag Audit Logs', rows, this.GetUserFromPayload(userPayload));
70013
+ return result;
70014
+ }
70015
+
68210
70016
  @FieldResolver(() => [MJResourcePermission_])
68211
70017
  async MJResourcePermissions_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
68212
70018
  this.CheckUserReadPermissions('MJ: Resource Permissions', userPayload);