@memberjunction/server 5.23.0 → 5.25.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 (63) hide show
  1. package/dist/agents/skip-sdk.d.ts +12 -0
  2. package/dist/agents/skip-sdk.d.ts.map +1 -1
  3. package/dist/agents/skip-sdk.js +70 -1
  4. package/dist/agents/skip-sdk.js.map +1 -1
  5. package/dist/config.d.ts.map +1 -1
  6. package/dist/config.js +11 -0
  7. package/dist/config.js.map +1 -1
  8. package/dist/generated/generated.d.ts +954 -0
  9. package/dist/generated/generated.d.ts.map +1 -1
  10. package/dist/generated/generated.js +26108 -20749
  11. package/dist/generated/generated.js.map +1 -1
  12. package/dist/generic/RunViewResolver.d.ts.map +1 -1
  13. package/dist/generic/RunViewResolver.js.map +1 -1
  14. package/dist/index.d.ts +2 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +2 -0
  17. package/dist/index.js.map +1 -1
  18. package/dist/resolvers/ArtifactFileResolver.d.ts +15 -0
  19. package/dist/resolvers/ArtifactFileResolver.d.ts.map +1 -0
  20. package/dist/resolvers/ArtifactFileResolver.js +74 -0
  21. package/dist/resolvers/ArtifactFileResolver.js.map +1 -0
  22. package/dist/resolvers/AutotagPipelineResolver.d.ts +23 -1
  23. package/dist/resolvers/AutotagPipelineResolver.d.ts.map +1 -1
  24. package/dist/resolvers/AutotagPipelineResolver.js +197 -13
  25. package/dist/resolvers/AutotagPipelineResolver.js.map +1 -1
  26. package/dist/resolvers/FetchEntityVectorsResolver.d.ts.map +1 -1
  27. package/dist/resolvers/FetchEntityVectorsResolver.js +6 -2
  28. package/dist/resolvers/FetchEntityVectorsResolver.js.map +1 -1
  29. package/dist/resolvers/FileResolver.d.ts.map +1 -1
  30. package/dist/resolvers/FileResolver.js +12 -32
  31. package/dist/resolvers/FileResolver.js.map +1 -1
  32. package/dist/resolvers/GeoResolver.d.ts +58 -0
  33. package/dist/resolvers/GeoResolver.d.ts.map +1 -0
  34. package/dist/resolvers/GeoResolver.js +302 -0
  35. package/dist/resolvers/GeoResolver.js.map +1 -0
  36. package/dist/resolvers/RunAIAgentResolver.d.ts +34 -1
  37. package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
  38. package/dist/resolvers/RunAIAgentResolver.js +183 -48
  39. package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
  40. package/dist/resolvers/SearchKnowledgeResolver.d.ts +23 -41
  41. package/dist/resolvers/SearchKnowledgeResolver.d.ts.map +1 -1
  42. package/dist/resolvers/SearchKnowledgeResolver.js +133 -382
  43. package/dist/resolvers/SearchKnowledgeResolver.js.map +1 -1
  44. package/dist/resolvers/SearchKnowledgeSystemUserResolver.d.ts +19 -0
  45. package/dist/resolvers/SearchKnowledgeSystemUserResolver.d.ts.map +1 -0
  46. package/dist/resolvers/SearchKnowledgeSystemUserResolver.js +149 -0
  47. package/dist/resolvers/SearchKnowledgeSystemUserResolver.js.map +1 -0
  48. package/package.json +63 -63
  49. package/src/__tests__/search-knowledge-tags.test.ts +255 -0
  50. package/src/__tests__/skip-sdk-organic-keys.test.ts +274 -0
  51. package/src/agents/skip-sdk.ts +83 -2
  52. package/src/config.ts +11 -0
  53. package/src/generated/generated.ts +3690 -1
  54. package/src/generic/RunViewResolver.ts +1 -0
  55. package/src/index.ts +2 -0
  56. package/src/resolvers/ArtifactFileResolver.ts +71 -0
  57. package/src/resolvers/AutotagPipelineResolver.ts +213 -10
  58. package/src/resolvers/FetchEntityVectorsResolver.ts +6 -2
  59. package/src/resolvers/FileResolver.ts +12 -41
  60. package/src/resolvers/GeoResolver.ts +258 -0
  61. package/src/resolvers/RunAIAgentResolver.ts +229 -76
  62. package/src/resolvers/SearchKnowledgeResolver.ts +118 -462
  63. package/src/resolvers/SearchKnowledgeSystemUserResolver.ts +138 -0
@@ -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, MJApplicationRoleEntity, 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, MJCountryEntity, 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, MJFileStorageAccountPermissionEntity, MJFileStorageAccountEntity, MJFileStorageProviderEntity, MJFileEntity, MJGeneratedCodeCategoryEntity, MJGeneratedCodeEntity, MJInstanceConfigurationEntity, 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, MJRecordGeoCodeEntity, MJRecordLinkEntity, MJRecordMergeDeletionLogEntity, MJRecordMergeLogEntity, MJReportCategoryEntity, MJReportSnapshotEntity, MJReportUserStateEntity, MJReportVersionEntity, MJReportEntity, MJResourceLinkEntity, MJResourcePermissionEntity, MJResourceTypeEntity, MJRoleEntity, MJRowLevelSecurityFilterEntity, MJScheduledActionParamEntity, MJScheduledActionEntity, MJScheduledJobRunEntity, MJScheduledJobTypeEntity, MJScheduledJobEntity, MJSchemaInfoEntity, MJSearchProviderEntity, MJSkillEntity, MJSQLDialectEntity, MJStateProvinceEntity, 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
  //****************************************************************************
@@ -3043,10 +3043,18 @@ export class MJAIAgentCategory_ {
3043
3043
  @Field()
3044
3044
  _mj__UpdatedAt: Date;
3045
3045
 
3046
+ @Field({nullable: true, description: `Default file storage account for agents in this category. Inherited by child categories that do not define their own value — resolution walks up the ParentID tree until a non-null value is found. Overrides the Type-level default. FK to FileStorageAccount.`})
3047
+ @MaxLength(36)
3048
+ DefaultStorageAccountID?: string;
3049
+
3046
3050
  @Field({nullable: true})
3047
3051
  @MaxLength(200)
3048
3052
  Parent?: string;
3049
3053
 
3054
+ @Field({nullable: true})
3055
+ @MaxLength(200)
3056
+ DefaultStorageAccount?: string;
3057
+
3050
3058
  @Field({nullable: true})
3051
3059
  @MaxLength(36)
3052
3060
  RootParentID?: string;
@@ -3081,6 +3089,9 @@ export class CreateMJAIAgentCategoryInput {
3081
3089
 
3082
3090
  @Field({ nullable: true })
3083
3091
  Status?: string;
3092
+
3093
+ @Field({ nullable: true })
3094
+ DefaultStorageAccountID: string | null;
3084
3095
  }
3085
3096
 
3086
3097
 
@@ -3107,6 +3118,9 @@ export class UpdateMJAIAgentCategoryInput {
3107
3118
  @Field({ nullable: true })
3108
3119
  Status?: string;
3109
3120
 
3121
+ @Field({ nullable: true })
3122
+ DefaultStorageAccountID?: string | null;
3123
+
3110
3124
  @Field(() => [KeyValuePairInput], { nullable: true })
3111
3125
  OldValues___?: KeyValuePairInput[];
3112
3126
  }
@@ -8424,10 +8438,18 @@ export class MJAIAgentType_ {
8424
8438
  @Field({nullable: true, description: `JSON-serialized AgentRequestAssignmentStrategy defining the default assignment strategy for all agents of this type. Overridden by per-invocation or category-level strategies in the resolution chain.`})
8425
8439
  AssignmentStrategy?: string;
8426
8440
 
8441
+ @Field({nullable: true, description: `Default file storage account for agents of this type. Lowest priority in the resolution chain (Type → Category tree → Agent → Runtime override). When set, all agents of this type use this storage account unless overridden at a more specific level. FK to FileStorageAccount.`})
8442
+ @MaxLength(36)
8443
+ DefaultStorageAccountID?: string;
8444
+
8427
8445
  @Field({nullable: true})
8428
8446
  @MaxLength(255)
8429
8447
  SystemPrompt?: string;
8430
8448
 
8449
+ @Field({nullable: true})
8450
+ @MaxLength(200)
8451
+ DefaultStorageAccount?: string;
8452
+
8431
8453
  @Field(() => [MJAIAgent_])
8432
8454
  MJAIAgents_TypeIDArray: MJAIAgent_[]; // Link to MJAIAgents
8433
8455
 
@@ -8473,6 +8495,9 @@ export class CreateMJAIAgentTypeInput {
8473
8495
 
8474
8496
  @Field({ nullable: true })
8475
8497
  AssignmentStrategy: string | null;
8498
+
8499
+ @Field({ nullable: true })
8500
+ DefaultStorageAccountID: string | null;
8476
8501
  }
8477
8502
 
8478
8503
 
@@ -8517,6 +8542,9 @@ export class UpdateMJAIAgentTypeInput {
8517
8542
  @Field({ nullable: true })
8518
8543
  AssignmentStrategy?: string | null;
8519
8544
 
8545
+ @Field({ nullable: true })
8546
+ DefaultStorageAccountID?: string | null;
8547
+
8520
8548
  @Field(() => [KeyValuePairInput], { nullable: true })
8521
8549
  OldValues___?: KeyValuePairInput[];
8522
8550
  }
@@ -8842,6 +8870,10 @@ if this limit is exceeded.`})
8842
8870
  @Field(() => Boolean, {description: `When true (default), this agent accepts runtime-registered ephemeral client tools that are not defined in metadata. Set to false for agents that require strict tool governance.`})
8843
8871
  AllowEphemeralClientTools: boolean;
8844
8872
 
8873
+ @Field({nullable: true, description: `Default file storage account for this specific agent. Overrides both Type-level and Category-level defaults. Can be further overridden at runtime via ExecuteAgentParams.override.storageAccountId. FK to FileStorageAccount.`})
8874
+ @MaxLength(36)
8875
+ DefaultStorageAccountID?: string;
8876
+
8845
8877
  @Field({nullable: true})
8846
8878
  @MaxLength(255)
8847
8879
  Parent?: string;
@@ -8870,6 +8902,10 @@ if this limit is exceeded.`})
8870
8902
  @MaxLength(200)
8871
8903
  Category?: string;
8872
8904
 
8905
+ @Field({nullable: true})
8906
+ @MaxLength(200)
8907
+ DefaultStorageAccount?: string;
8908
+
8873
8909
  @Field({nullable: true})
8874
8910
  @MaxLength(36)
8875
8911
  RootParentID?: string;
@@ -9132,6 +9168,9 @@ export class CreateMJAIAgentInput {
9132
9168
 
9133
9169
  @Field(() => Boolean, { nullable: true })
9134
9170
  AllowEphemeralClientTools?: boolean;
9171
+
9172
+ @Field({ nullable: true })
9173
+ DefaultStorageAccountID: string | null;
9135
9174
  }
9136
9175
 
9137
9176
 
@@ -9323,6 +9362,9 @@ export class UpdateMJAIAgentInput {
9323
9362
  @Field(() => Boolean, { nullable: true })
9324
9363
  AllowEphemeralClientTools?: boolean;
9325
9364
 
9365
+ @Field({ nullable: true })
9366
+ DefaultStorageAccountID?: string | null;
9367
+
9326
9368
  @Field(() => [KeyValuePairInput], { nullable: true })
9327
9369
  OldValues___?: KeyValuePairInput[];
9328
9370
  }
@@ -12901,6 +12943,9 @@ export class MJAIModel_ {
12901
12943
  @Field(() => [MJContentType_])
12902
12944
  MJContentTypes_EmbeddingModelIDArray: MJContentType_[]; // Link to MJContentTypes
12903
12945
 
12946
+ @Field(() => [MJContentItem_])
12947
+ MJContentItems_EmbeddingModelIDArray: MJContentItem_[]; // Link to MJContentItems
12948
+
12904
12949
  @Field(() => [MJAIPromptModel_])
12905
12950
  MJAIPromptModels_ModelIDArray: MJAIPromptModel_[]; // Link to MJAIPromptModels
12906
12951
 
@@ -13287,6 +13332,16 @@ export class MJAIModelResolver extends ResolverBase {
13287
13332
  return result;
13288
13333
  }
13289
13334
 
13335
+ @FieldResolver(() => [MJContentItem_])
13336
+ async MJContentItems_EmbeddingModelIDArray(@Root() mjaimodel_: MJAIModel_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
13337
+ this.CheckUserReadPermissions('MJ: Content Items', userPayload);
13338
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
13339
+ 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');
13340
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
13341
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Items', rows, this.GetUserFromPayload(userPayload));
13342
+ return result;
13343
+ }
13344
+
13290
13345
  @FieldResolver(() => [MJAIPromptModel_])
13291
13346
  async MJAIPromptModels_ModelIDArray(@Root() mjaimodel_: MJAIModel_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
13292
13347
  this.CheckUserReadPermissions('MJ: AI Prompt Models', userPayload);
@@ -14464,6 +14519,9 @@ export class MJAIPromptRun_ {
14464
14519
  @MaxLength(36)
14465
14520
  RootRerunFromPromptRunID?: string;
14466
14521
 
14522
+ @Field(() => [MJContentProcessRunPromptRun_])
14523
+ MJContentProcessRunPromptRuns_AIPromptRunIDArray: MJContentProcessRunPromptRun_[]; // Link to MJContentProcessRunPromptRuns
14524
+
14467
14525
  @Field(() => [MJAIPromptRun_])
14468
14526
  MJAIPromptRuns_RerunFromPromptRunIDArray: MJAIPromptRun_[]; // Link to MJAIPromptRuns
14469
14527
 
@@ -15049,6 +15107,16 @@ export class MJAIPromptRunResolver extends ResolverBase {
15049
15107
  return result;
15050
15108
  }
15051
15109
 
15110
+ @FieldResolver(() => [MJContentProcessRunPromptRun_])
15111
+ async MJContentProcessRunPromptRuns_AIPromptRunIDArray(@Root() mjaipromptrun_: MJAIPromptRun_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
15112
+ this.CheckUserReadPermissions('MJ: Content Process Run Prompt Runs', userPayload);
15113
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
15114
+ 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');
15115
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
15116
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Process Run Prompt Runs', rows, this.GetUserFromPayload(userPayload));
15117
+ return result;
15118
+ }
15119
+
15052
15120
  @FieldResolver(() => [MJAIPromptRun_])
15053
15121
  async MJAIPromptRuns_RerunFromPromptRunIDArray(@Root() mjaipromptrun_: MJAIPromptRun_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
15054
15122
  this.CheckUserReadPermissions('MJ: AI Prompt Runs', userPayload);
@@ -18628,6 +18696,177 @@ export class MJApplicationEntityResolver extends ResolverBase {
18628
18696
 
18629
18697
  }
18630
18698
 
18699
+ //****************************************************************************
18700
+ // ENTITY CLASS for MJ: Application Roles
18701
+ //****************************************************************************
18702
+ @ObjectType({ description: `Controls which roles can access and administer specific applications. When no ApplicationRole records exist for an application, all roles can access it (open access). When at least one record exists, only roles with CanAccess=1 are permitted.` })
18703
+ export class MJApplicationRole_ {
18704
+ @Field()
18705
+ @MaxLength(36)
18706
+ ID: string;
18707
+
18708
+ @Field({description: `Foreign key to the Application this role grant applies to`})
18709
+ @MaxLength(36)
18710
+ ApplicationID: string;
18711
+
18712
+ @Field({description: `Foreign key to the Role being granted or denied access`})
18713
+ @MaxLength(36)
18714
+ RoleID: string;
18715
+
18716
+ @Field(() => Boolean, {description: `When true, users in this role can access the application. When false, this record acts as an explicit deny for the role.`})
18717
+ CanAccess: boolean;
18718
+
18719
+ @Field(() => Boolean, {description: `When true, users in this role can modify application settings, manage nav items, and configure the application.`})
18720
+ CanAdmin: boolean;
18721
+
18722
+ @Field()
18723
+ _mj__CreatedAt: Date;
18724
+
18725
+ @Field()
18726
+ _mj__UpdatedAt: Date;
18727
+
18728
+ @Field()
18729
+ @MaxLength(100)
18730
+ Application: string;
18731
+
18732
+ @Field()
18733
+ @MaxLength(50)
18734
+ Role: string;
18735
+
18736
+ }
18737
+
18738
+ //****************************************************************************
18739
+ // INPUT TYPE for MJ: Application Roles
18740
+ //****************************************************************************
18741
+ @InputType()
18742
+ export class CreateMJApplicationRoleInput {
18743
+ @Field({ nullable: true })
18744
+ ID?: string;
18745
+
18746
+ @Field({ nullable: true })
18747
+ ApplicationID?: string;
18748
+
18749
+ @Field({ nullable: true })
18750
+ RoleID?: string;
18751
+
18752
+ @Field(() => Boolean, { nullable: true })
18753
+ CanAccess?: boolean;
18754
+
18755
+ @Field(() => Boolean, { nullable: true })
18756
+ CanAdmin?: boolean;
18757
+ }
18758
+
18759
+
18760
+ //****************************************************************************
18761
+ // INPUT TYPE for MJ: Application Roles
18762
+ //****************************************************************************
18763
+ @InputType()
18764
+ export class UpdateMJApplicationRoleInput {
18765
+ @Field()
18766
+ ID: string;
18767
+
18768
+ @Field({ nullable: true })
18769
+ ApplicationID?: string;
18770
+
18771
+ @Field({ nullable: true })
18772
+ RoleID?: string;
18773
+
18774
+ @Field(() => Boolean, { nullable: true })
18775
+ CanAccess?: boolean;
18776
+
18777
+ @Field(() => Boolean, { nullable: true })
18778
+ CanAdmin?: boolean;
18779
+
18780
+ @Field(() => [KeyValuePairInput], { nullable: true })
18781
+ OldValues___?: KeyValuePairInput[];
18782
+ }
18783
+
18784
+ //****************************************************************************
18785
+ // RESOLVER for MJ: Application Roles
18786
+ //****************************************************************************
18787
+ @ObjectType()
18788
+ export class RunMJApplicationRoleViewResult {
18789
+ @Field(() => [MJApplicationRole_])
18790
+ Results: MJApplicationRole_[];
18791
+
18792
+ @Field(() => String, {nullable: true})
18793
+ UserViewRunID?: string;
18794
+
18795
+ @Field(() => Int, {nullable: true})
18796
+ RowCount: number;
18797
+
18798
+ @Field(() => Int, {nullable: true})
18799
+ TotalRowCount: number;
18800
+
18801
+ @Field(() => Int, {nullable: true})
18802
+ ExecutionTime: number;
18803
+
18804
+ @Field({nullable: true})
18805
+ ErrorMessage?: string;
18806
+
18807
+ @Field(() => Boolean, {nullable: false})
18808
+ Success: boolean;
18809
+ }
18810
+
18811
+ @Resolver(MJApplicationRole_)
18812
+ export class MJApplicationRoleResolver extends ResolverBase {
18813
+ @Query(() => RunMJApplicationRoleViewResult)
18814
+ async RunMJApplicationRoleViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
18815
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
18816
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
18817
+ }
18818
+
18819
+ @Query(() => RunMJApplicationRoleViewResult)
18820
+ async RunMJApplicationRoleViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
18821
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
18822
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
18823
+ }
18824
+
18825
+ @Query(() => RunMJApplicationRoleViewResult)
18826
+ async RunMJApplicationRoleDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
18827
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
18828
+ input.EntityName = 'MJ: Application Roles';
18829
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
18830
+ }
18831
+ @Query(() => MJApplicationRole_, { nullable: true })
18832
+ async MJApplicationRole(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJApplicationRole_ | null> {
18833
+ this.CheckUserReadPermissions('MJ: Application Roles', userPayload);
18834
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
18835
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwApplicationRoles')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Application Roles', userPayload, EntityPermissionType.Read, 'AND');
18836
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
18837
+ const result = await this.MapFieldNamesToCodeNames('MJ: Application Roles', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
18838
+ return result;
18839
+ }
18840
+
18841
+ @Mutation(() => MJApplicationRole_)
18842
+ async CreateMJApplicationRole(
18843
+ @Arg('input', () => CreateMJApplicationRoleInput) input: CreateMJApplicationRoleInput,
18844
+ @Ctx() { providers, userPayload }: AppContext,
18845
+ @PubSub() pubSub: PubSubEngine
18846
+ ) {
18847
+ const provider = GetReadWriteProvider(providers);
18848
+ return this.CreateRecord('MJ: Application Roles', input, provider, userPayload, pubSub)
18849
+ }
18850
+
18851
+ @Mutation(() => MJApplicationRole_)
18852
+ async UpdateMJApplicationRole(
18853
+ @Arg('input', () => UpdateMJApplicationRoleInput) input: UpdateMJApplicationRoleInput,
18854
+ @Ctx() { providers, userPayload }: AppContext,
18855
+ @PubSub() pubSub: PubSubEngine
18856
+ ) {
18857
+ const provider = GetReadWriteProvider(providers);
18858
+ return this.UpdateRecord('MJ: Application Roles', input, provider, userPayload, pubSub);
18859
+ }
18860
+
18861
+ @Mutation(() => MJApplicationRole_)
18862
+ async DeleteMJApplicationRole(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
18863
+ const provider = GetReadWriteProvider(providers);
18864
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
18865
+ return this.DeleteRecord('MJ: Application Roles', key, options, provider, userPayload, pubSub);
18866
+ }
18867
+
18868
+ }
18869
+
18631
18870
  //****************************************************************************
18632
18871
  // ENTITY CLASS for MJ: Application Settings
18633
18872
  //****************************************************************************
@@ -18878,6 +19117,9 @@ export class MJApplication_ {
18878
19117
  @Field(() => [MJDashboardUserPreference_])
18879
19118
  MJDashboardUserPreferences_ApplicationIDArray: MJDashboardUserPreference_[]; // Link to MJDashboardUserPreferences
18880
19119
 
19120
+ @Field(() => [MJApplicationRole_])
19121
+ MJApplicationRoles_ApplicationIDArray: MJApplicationRole_[]; // Link to MJApplicationRoles
19122
+
18881
19123
  }
18882
19124
 
18883
19125
  //****************************************************************************
@@ -19109,6 +19351,16 @@ export class MJApplicationResolver extends ResolverBase {
19109
19351
  return result;
19110
19352
  }
19111
19353
 
19354
+ @FieldResolver(() => [MJApplicationRole_])
19355
+ async MJApplicationRoles_ApplicationIDArray(@Root() mjapplication_: MJApplication_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
19356
+ this.CheckUserReadPermissions('MJ: Application Roles', userPayload);
19357
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
19358
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwApplicationRoles')} WHERE ${provider.QuoteIdentifier('ApplicationID')}='${mjapplication_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Application Roles', userPayload, EntityPermissionType.Read, 'AND');
19359
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
19360
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Application Roles', rows, this.GetUserFromPayload(userPayload));
19361
+ return result;
19362
+ }
19363
+
19112
19364
  @Mutation(() => MJApplication_)
19113
19365
  async CreateMJApplication(
19114
19366
  @Arg('input', () => CreateMJApplicationInput) input: CreateMJApplicationInput,
@@ -19385,6 +19637,10 @@ export class MJArtifactType_ {
19385
19637
  @MaxLength(255)
19386
19638
  Icon?: string;
19387
19639
 
19640
+ @Field({description: `Classifies whether this artifact type stores text content ('Text', the default for all existing types) or a binary file in MJStorage ('File'). Used by AgentRunner and viewer components to route file-based artifacts correctly.`})
19641
+ @MaxLength(10)
19642
+ ContentCategory: string;
19643
+
19388
19644
  @Field({nullable: true})
19389
19645
  @MaxLength(100)
19390
19646
  Parent?: string;
@@ -19441,6 +19697,9 @@ export class CreateMJArtifactTypeInput {
19441
19697
 
19442
19698
  @Field({ nullable: true })
19443
19699
  Icon: string | null;
19700
+
19701
+ @Field({ nullable: true })
19702
+ ContentCategory?: string;
19444
19703
  }
19445
19704
 
19446
19705
 
@@ -19476,6 +19735,9 @@ export class UpdateMJArtifactTypeInput {
19476
19735
  @Field({ nullable: true })
19477
19736
  Icon?: string | null;
19478
19737
 
19738
+ @Field({ nullable: true })
19739
+ ContentCategory?: string;
19740
+
19479
19741
  @Field(() => [KeyValuePairInput], { nullable: true })
19480
19742
  OldValues___?: KeyValuePairInput[];
19481
19743
  }
@@ -20012,6 +20274,25 @@ export class MJArtifactVersion_ {
20012
20274
  @Field({nullable: true, description: `Description of this artifact version. Can differ from Artifact.Description as it may evolve with versions.`})
20013
20275
  Description?: string;
20014
20276
 
20277
+ @Field({nullable: true, description: `Foreign key to the MJ: Files entity. When ContentMode is 'File', this references the binary file stored in MJStorage. NULL when ContentMode is 'Text'.`})
20278
+ @MaxLength(36)
20279
+ FileID?: string;
20280
+
20281
+ @Field({description: `Determines how artifact content is stored. 'Text' (default) means the Content column holds the data. 'File' means FileID references a binary file in MJStorage and Content is unused.`})
20282
+ @MaxLength(10)
20283
+ ContentMode: string;
20284
+
20285
+ @Field({nullable: true, description: `MIME type of the stored file (e.g. application/pdf). Denormalized from the File entity for display without joins. Only populated when ContentMode is 'File'.`})
20286
+ @MaxLength(200)
20287
+ MimeType?: string;
20288
+
20289
+ @Field({nullable: true, description: `Original filename of the stored file (e.g. report.pdf). Denormalized from the File entity for display without joins. Only populated when ContentMode is 'File'.`})
20290
+ @MaxLength(500)
20291
+ FileName?: string;
20292
+
20293
+ @Field(() => Int, {nullable: true, description: `Size of the stored file in bytes. Denormalized for display without loading the file. Only populated when ContentMode is 'File'.`})
20294
+ ContentSizeBytes?: number;
20295
+
20015
20296
  @Field()
20016
20297
  @MaxLength(255)
20017
20298
  Artifact: string;
@@ -20020,6 +20301,10 @@ export class MJArtifactVersion_ {
20020
20301
  @MaxLength(100)
20021
20302
  User: string;
20022
20303
 
20304
+ @Field({nullable: true})
20305
+ @MaxLength(500)
20306
+ File?: string;
20307
+
20023
20308
  @Field(() => [MJArtifactVersionAttribute_])
20024
20309
  MJArtifactVersionAttributes_ArtifactVersionIDArray: MJArtifactVersionAttribute_[]; // Link to MJArtifactVersionAttributes
20025
20310
 
@@ -20068,6 +20353,21 @@ export class CreateMJArtifactVersionInput {
20068
20353
 
20069
20354
  @Field({ nullable: true })
20070
20355
  Description: string | null;
20356
+
20357
+ @Field({ nullable: true })
20358
+ FileID: string | null;
20359
+
20360
+ @Field({ nullable: true })
20361
+ ContentMode?: string;
20362
+
20363
+ @Field({ nullable: true })
20364
+ MimeType: string | null;
20365
+
20366
+ @Field({ nullable: true })
20367
+ FileName: string | null;
20368
+
20369
+ @Field(() => Int, { nullable: true })
20370
+ ContentSizeBytes: number | null;
20071
20371
  }
20072
20372
 
20073
20373
 
@@ -20106,6 +20406,21 @@ export class UpdateMJArtifactVersionInput {
20106
20406
  @Field({ nullable: true })
20107
20407
  Description?: string | null;
20108
20408
 
20409
+ @Field({ nullable: true })
20410
+ FileID?: string | null;
20411
+
20412
+ @Field({ nullable: true })
20413
+ ContentMode?: string;
20414
+
20415
+ @Field({ nullable: true })
20416
+ MimeType?: string | null;
20417
+
20418
+ @Field({ nullable: true })
20419
+ FileName?: string | null;
20420
+
20421
+ @Field(() => Int, { nullable: true })
20422
+ ContentSizeBytes?: number | null;
20423
+
20109
20424
  @Field(() => [KeyValuePairInput], { nullable: true })
20110
20425
  OldValues___?: KeyValuePairInput[];
20111
20426
  }
@@ -26769,6 +27084,221 @@ export class MJContentItemAttributeResolver extends ResolverBase {
26769
27084
 
26770
27085
  }
26771
27086
 
27087
+ //****************************************************************************
27088
+ // ENTITY CLASS for MJ: Content Item Duplicates
27089
+ //****************************************************************************
27090
+ @ObjectType({ description: `Detected duplicate or near-duplicate content items across sources. Each row represents a pair of items with similarity scoring and resolution tracking.` })
27091
+ export class MJContentItemDuplicate_ {
27092
+ @Field()
27093
+ @MaxLength(36)
27094
+ ID: string;
27095
+
27096
+ @Field()
27097
+ @MaxLength(36)
27098
+ ContentItemAID: string;
27099
+
27100
+ @Field()
27101
+ @MaxLength(36)
27102
+ ContentItemBID: string;
27103
+
27104
+ @Field(() => Float, {description: `Cosine similarity (for Vector) or exact match score (1.0 for Checksum/URL). Range 0.0-1.0.`})
27105
+ SimilarityScore: number;
27106
+
27107
+ @Field({description: `How the duplicate was detected: Checksum (identical text hash), Vector (embedding similarity), Title (same title text), URL (same source URL).`})
27108
+ @MaxLength(30)
27109
+ DetectionMethod: string;
27110
+
27111
+ @Field({description: `Current status: Pending (awaiting review), Confirmed (verified duplicate), Dismissed (not a duplicate), Merged (one item was removed).`})
27112
+ @MaxLength(20)
27113
+ Status: string;
27114
+
27115
+ @Field({nullable: true})
27116
+ @MaxLength(36)
27117
+ ResolvedByUserID?: string;
27118
+
27119
+ @Field({nullable: true})
27120
+ ResolvedAt?: Date;
27121
+
27122
+ @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).`})
27123
+ @MaxLength(20)
27124
+ Resolution?: string;
27125
+
27126
+ @Field()
27127
+ _mj__CreatedAt: Date;
27128
+
27129
+ @Field()
27130
+ _mj__UpdatedAt: Date;
27131
+
27132
+ @Field({nullable: true})
27133
+ @MaxLength(250)
27134
+ ContentItemA?: string;
27135
+
27136
+ @Field({nullable: true})
27137
+ @MaxLength(250)
27138
+ ContentItemB?: string;
27139
+
27140
+ @Field({nullable: true})
27141
+ @MaxLength(100)
27142
+ ResolvedByUser?: string;
27143
+
27144
+ }
27145
+
27146
+ //****************************************************************************
27147
+ // INPUT TYPE for MJ: Content Item Duplicates
27148
+ //****************************************************************************
27149
+ @InputType()
27150
+ export class CreateMJContentItemDuplicateInput {
27151
+ @Field({ nullable: true })
27152
+ ID?: string;
27153
+
27154
+ @Field({ nullable: true })
27155
+ ContentItemAID?: string;
27156
+
27157
+ @Field({ nullable: true })
27158
+ ContentItemBID?: string;
27159
+
27160
+ @Field(() => Float, { nullable: true })
27161
+ SimilarityScore?: number;
27162
+
27163
+ @Field({ nullable: true })
27164
+ DetectionMethod?: string;
27165
+
27166
+ @Field({ nullable: true })
27167
+ Status?: string;
27168
+
27169
+ @Field({ nullable: true })
27170
+ ResolvedByUserID: string | null;
27171
+
27172
+ @Field({ nullable: true })
27173
+ ResolvedAt: Date | null;
27174
+
27175
+ @Field({ nullable: true })
27176
+ Resolution: string | null;
27177
+ }
27178
+
27179
+
27180
+ //****************************************************************************
27181
+ // INPUT TYPE for MJ: Content Item Duplicates
27182
+ //****************************************************************************
27183
+ @InputType()
27184
+ export class UpdateMJContentItemDuplicateInput {
27185
+ @Field()
27186
+ ID: string;
27187
+
27188
+ @Field({ nullable: true })
27189
+ ContentItemAID?: string;
27190
+
27191
+ @Field({ nullable: true })
27192
+ ContentItemBID?: string;
27193
+
27194
+ @Field(() => Float, { nullable: true })
27195
+ SimilarityScore?: number;
27196
+
27197
+ @Field({ nullable: true })
27198
+ DetectionMethod?: string;
27199
+
27200
+ @Field({ nullable: true })
27201
+ Status?: string;
27202
+
27203
+ @Field({ nullable: true })
27204
+ ResolvedByUserID?: string | null;
27205
+
27206
+ @Field({ nullable: true })
27207
+ ResolvedAt?: Date | null;
27208
+
27209
+ @Field({ nullable: true })
27210
+ Resolution?: string | null;
27211
+
27212
+ @Field(() => [KeyValuePairInput], { nullable: true })
27213
+ OldValues___?: KeyValuePairInput[];
27214
+ }
27215
+
27216
+ //****************************************************************************
27217
+ // RESOLVER for MJ: Content Item Duplicates
27218
+ //****************************************************************************
27219
+ @ObjectType()
27220
+ export class RunMJContentItemDuplicateViewResult {
27221
+ @Field(() => [MJContentItemDuplicate_])
27222
+ Results: MJContentItemDuplicate_[];
27223
+
27224
+ @Field(() => String, {nullable: true})
27225
+ UserViewRunID?: string;
27226
+
27227
+ @Field(() => Int, {nullable: true})
27228
+ RowCount: number;
27229
+
27230
+ @Field(() => Int, {nullable: true})
27231
+ TotalRowCount: number;
27232
+
27233
+ @Field(() => Int, {nullable: true})
27234
+ ExecutionTime: number;
27235
+
27236
+ @Field({nullable: true})
27237
+ ErrorMessage?: string;
27238
+
27239
+ @Field(() => Boolean, {nullable: false})
27240
+ Success: boolean;
27241
+ }
27242
+
27243
+ @Resolver(MJContentItemDuplicate_)
27244
+ export class MJContentItemDuplicateResolver extends ResolverBase {
27245
+ @Query(() => RunMJContentItemDuplicateViewResult)
27246
+ async RunMJContentItemDuplicateViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27247
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27248
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
27249
+ }
27250
+
27251
+ @Query(() => RunMJContentItemDuplicateViewResult)
27252
+ async RunMJContentItemDuplicateViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27253
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27254
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
27255
+ }
27256
+
27257
+ @Query(() => RunMJContentItemDuplicateViewResult)
27258
+ async RunMJContentItemDuplicateDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27259
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27260
+ input.EntityName = 'MJ: Content Item Duplicates';
27261
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
27262
+ }
27263
+ @Query(() => MJContentItemDuplicate_, { nullable: true })
27264
+ async MJContentItemDuplicate(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJContentItemDuplicate_ | null> {
27265
+ this.CheckUserReadPermissions('MJ: Content Item Duplicates', userPayload);
27266
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27267
+ 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');
27268
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
27269
+ const result = await this.MapFieldNamesToCodeNames('MJ: Content Item Duplicates', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
27270
+ return result;
27271
+ }
27272
+
27273
+ @Mutation(() => MJContentItemDuplicate_)
27274
+ async CreateMJContentItemDuplicate(
27275
+ @Arg('input', () => CreateMJContentItemDuplicateInput) input: CreateMJContentItemDuplicateInput,
27276
+ @Ctx() { providers, userPayload }: AppContext,
27277
+ @PubSub() pubSub: PubSubEngine
27278
+ ) {
27279
+ const provider = GetReadWriteProvider(providers);
27280
+ return this.CreateRecord('MJ: Content Item Duplicates', input, provider, userPayload, pubSub)
27281
+ }
27282
+
27283
+ @Mutation(() => MJContentItemDuplicate_)
27284
+ async UpdateMJContentItemDuplicate(
27285
+ @Arg('input', () => UpdateMJContentItemDuplicateInput) input: UpdateMJContentItemDuplicateInput,
27286
+ @Ctx() { providers, userPayload }: AppContext,
27287
+ @PubSub() pubSub: PubSubEngine
27288
+ ) {
27289
+ const provider = GetReadWriteProvider(providers);
27290
+ return this.UpdateRecord('MJ: Content Item Duplicates', input, provider, userPayload, pubSub);
27291
+ }
27292
+
27293
+ @Mutation(() => MJContentItemDuplicate_)
27294
+ async DeleteMJContentItemDuplicate(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
27295
+ const provider = GetReadWriteProvider(providers);
27296
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
27297
+ return this.DeleteRecord('MJ: Content Item Duplicates', key, options, provider, userPayload, pubSub);
27298
+ }
27299
+
27300
+ }
27301
+
26772
27302
  //****************************************************************************
26773
27303
  // ENTITY CLASS for MJ: Content Item Tags
26774
27304
  //****************************************************************************
@@ -26795,10 +27325,18 @@ export class MJContentItemTag_ {
26795
27325
  @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
27326
  Weight: number;
26797
27327
 
27328
+ @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.`})
27329
+ @MaxLength(36)
27330
+ TagID?: string;
27331
+
26798
27332
  @Field({nullable: true})
26799
27333
  @MaxLength(250)
26800
27334
  Item?: string;
26801
27335
 
27336
+ @Field({nullable: true})
27337
+ @MaxLength(255)
27338
+ Tag_Virtual?: string;
27339
+
26802
27340
  }
26803
27341
 
26804
27342
  //****************************************************************************
@@ -26817,6 +27355,9 @@ export class CreateMJContentItemTagInput {
26817
27355
 
26818
27356
  @Field(() => Float, { nullable: true })
26819
27357
  Weight?: number;
27358
+
27359
+ @Field({ nullable: true })
27360
+ TagID: string | null;
26820
27361
  }
26821
27362
 
26822
27363
 
@@ -26837,6 +27378,9 @@ export class UpdateMJContentItemTagInput {
26837
27378
  @Field(() => Float, { nullable: true })
26838
27379
  Weight?: number;
26839
27380
 
27381
+ @Field({ nullable: true })
27382
+ TagID?: string | null;
27383
+
26840
27384
  @Field(() => [KeyValuePairInput], { nullable: true })
26841
27385
  OldValues___?: KeyValuePairInput[];
26842
27386
  }
@@ -26976,6 +27520,28 @@ export class MJContentItem_ {
26976
27520
  @Field()
26977
27521
  _mj__UpdatedAt: Date;
26978
27522
 
27523
+ @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.`})
27524
+ @MaxLength(36)
27525
+ EntityRecordDocumentID?: string;
27526
+
27527
+ @Field({description: `Vectorization status: Pending (not yet embedded), Processing (currently being embedded), Complete (vector stored), Failed (embedding error), Skipped (excluded from vectorization).`})
27528
+ @MaxLength(20)
27529
+ EmbeddingStatus: string;
27530
+
27531
+ @Field({nullable: true, description: `Timestamp of the most recent successful embedding for this content item.`})
27532
+ LastEmbeddedAt?: Date;
27533
+
27534
+ @Field({nullable: true, description: `The AI model used to generate the most recent embedding for this content item.`})
27535
+ @MaxLength(36)
27536
+ EmbeddingModelID?: string;
27537
+
27538
+ @Field({description: `Autotagging status: Pending (not yet tagged), Processing (LLM is generating tags), Complete (tags assigned), Failed (LLM error), Skipped (excluded from tagging).`})
27539
+ @MaxLength(20)
27540
+ TaggingStatus: string;
27541
+
27542
+ @Field({nullable: true, description: `Timestamp of the most recent successful autotagging run for this content item.`})
27543
+ LastTaggedAt?: Date;
27544
+
26979
27545
  @Field({nullable: true})
26980
27546
  @MaxLength(255)
26981
27547
  ContentSource?: string;
@@ -26992,12 +27558,26 @@ export class MJContentItem_ {
26992
27558
  @MaxLength(255)
26993
27559
  ContentFileType: string;
26994
27560
 
27561
+ @Field({nullable: true})
27562
+ @MaxLength(450)
27563
+ EntityRecordDocument?: string;
27564
+
27565
+ @Field({nullable: true})
27566
+ @MaxLength(50)
27567
+ EmbeddingModel?: string;
27568
+
26995
27569
  @Field(() => [MJContentItemAttribute_])
26996
27570
  MJContentItemAttributes_ContentItemIDArray: MJContentItemAttribute_[]; // Link to MJContentItemAttributes
26997
27571
 
26998
27572
  @Field(() => [MJContentItemTag_])
26999
27573
  MJContentItemTags_ItemIDArray: MJContentItemTag_[]; // Link to MJContentItemTags
27000
27574
 
27575
+ @Field(() => [MJContentItemDuplicate_])
27576
+ MJContentItemDuplicates_ContentItemAIDArray: MJContentItemDuplicate_[]; // Link to MJContentItemDuplicates
27577
+
27578
+ @Field(() => [MJContentItemDuplicate_])
27579
+ MJContentItemDuplicates_ContentItemBIDArray: MJContentItemDuplicate_[]; // Link to MJContentItemDuplicates
27580
+
27001
27581
  }
27002
27582
 
27003
27583
  //****************************************************************************
@@ -27034,6 +27614,24 @@ export class CreateMJContentItemInput {
27034
27614
 
27035
27615
  @Field({ nullable: true })
27036
27616
  Text: string | null;
27617
+
27618
+ @Field({ nullable: true })
27619
+ EntityRecordDocumentID: string | null;
27620
+
27621
+ @Field({ nullable: true })
27622
+ EmbeddingStatus?: string;
27623
+
27624
+ @Field({ nullable: true })
27625
+ LastEmbeddedAt: Date | null;
27626
+
27627
+ @Field({ nullable: true })
27628
+ EmbeddingModelID: string | null;
27629
+
27630
+ @Field({ nullable: true })
27631
+ TaggingStatus?: string;
27632
+
27633
+ @Field({ nullable: true })
27634
+ LastTaggedAt: Date | null;
27037
27635
  }
27038
27636
 
27039
27637
 
@@ -27072,6 +27670,24 @@ export class UpdateMJContentItemInput {
27072
27670
  @Field({ nullable: true })
27073
27671
  Text?: string | null;
27074
27672
 
27673
+ @Field({ nullable: true })
27674
+ EntityRecordDocumentID?: string | null;
27675
+
27676
+ @Field({ nullable: true })
27677
+ EmbeddingStatus?: string;
27678
+
27679
+ @Field({ nullable: true })
27680
+ LastEmbeddedAt?: Date | null;
27681
+
27682
+ @Field({ nullable: true })
27683
+ EmbeddingModelID?: string | null;
27684
+
27685
+ @Field({ nullable: true })
27686
+ TaggingStatus?: string;
27687
+
27688
+ @Field({ nullable: true })
27689
+ LastTaggedAt?: Date | null;
27690
+
27075
27691
  @Field(() => [KeyValuePairInput], { nullable: true })
27076
27692
  OldValues___?: KeyValuePairInput[];
27077
27693
  }
@@ -27153,6 +27769,26 @@ export class MJContentItemResolver extends ResolverBase {
27153
27769
  return result;
27154
27770
  }
27155
27771
 
27772
+ @FieldResolver(() => [MJContentItemDuplicate_])
27773
+ async MJContentItemDuplicates_ContentItemAIDArray(@Root() mjcontentitem_: MJContentItem_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
27774
+ this.CheckUserReadPermissions('MJ: Content Item Duplicates', userPayload);
27775
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27776
+ 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');
27777
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
27778
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Item Duplicates', rows, this.GetUserFromPayload(userPayload));
27779
+ return result;
27780
+ }
27781
+
27782
+ @FieldResolver(() => [MJContentItemDuplicate_])
27783
+ async MJContentItemDuplicates_ContentItemBIDArray(@Root() mjcontentitem_: MJContentItem_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
27784
+ this.CheckUserReadPermissions('MJ: Content Item Duplicates', userPayload);
27785
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27786
+ 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');
27787
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
27788
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Item Duplicates', rows, this.GetUserFromPayload(userPayload));
27789
+ return result;
27790
+ }
27791
+
27156
27792
  @Mutation(() => MJContentItem_)
27157
27793
  async CreateMJContentItem(
27158
27794
  @Arg('input', () => CreateMJContentItemInput) input: CreateMJContentItemInput,
@@ -27182,6 +27818,436 @@ export class MJContentItemResolver extends ResolverBase {
27182
27818
 
27183
27819
  }
27184
27820
 
27821
+ //****************************************************************************
27822
+ // ENTITY CLASS for MJ: Content Process Run Details
27823
+ //****************************************************************************
27824
+ @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.` })
27825
+ export class MJContentProcessRunDetail_ {
27826
+ @Field()
27827
+ @MaxLength(36)
27828
+ ID: string;
27829
+
27830
+ @Field({description: `The parent pipeline run this detail belongs to.`})
27831
+ @MaxLength(36)
27832
+ ContentProcessRunID: string;
27833
+
27834
+ @Field({description: `The content source being processed in this detail record.`})
27835
+ @MaxLength(36)
27836
+ ContentSourceID: string;
27837
+
27838
+ @Field({description: `The type of content source (RSS Feed, Entity, Website, Cloud Storage, etc.).`})
27839
+ @MaxLength(36)
27840
+ ContentSourceTypeID: string;
27841
+
27842
+ @Field({description: `Processing status: Pending, Running, Completed, Failed, or Skipped.`})
27843
+ @MaxLength(20)
27844
+ Status: string;
27845
+
27846
+ @Field(() => Int, {description: `Total content items processed for this source during the run.`})
27847
+ ItemsProcessed: number;
27848
+
27849
+ @Field(() => Int, {description: `Number of content items successfully tagged by the LLM.`})
27850
+ ItemsTagged: number;
27851
+
27852
+ @Field(() => Int, {description: `Number of content items successfully embedded and upserted to the vector database.`})
27853
+ ItemsVectorized: number;
27854
+
27855
+ @Field(() => Int, {description: `Number of new ContentItemTag records created during LLM tagging.`})
27856
+ TagsCreated: number;
27857
+
27858
+ @Field(() => Int, {description: `Number of errors encountered while processing this source.`})
27859
+ ErrorCount: number;
27860
+
27861
+ @Field({nullable: true, description: `When processing started for this source within the pipeline run.`})
27862
+ StartTime?: Date;
27863
+
27864
+ @Field({nullable: true, description: `When processing completed for this source within the pipeline run.`})
27865
+ EndTime?: Date;
27866
+
27867
+ @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.`})
27868
+ TotalTokensUsed: number;
27869
+
27870
+ @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.`})
27871
+ TotalCost: number;
27872
+
27873
+ @Field()
27874
+ _mj__CreatedAt: Date;
27875
+
27876
+ @Field()
27877
+ _mj__UpdatedAt: Date;
27878
+
27879
+ @Field({nullable: true})
27880
+ @MaxLength(255)
27881
+ ContentProcessRun?: string;
27882
+
27883
+ @Field({nullable: true})
27884
+ @MaxLength(255)
27885
+ ContentSource?: string;
27886
+
27887
+ @Field()
27888
+ @MaxLength(255)
27889
+ ContentSourceType: string;
27890
+
27891
+ @Field(() => [MJContentProcessRunPromptRun_])
27892
+ MJContentProcessRunPromptRuns_ContentProcessRunDetailIDArray: MJContentProcessRunPromptRun_[]; // Link to MJContentProcessRunPromptRuns
27893
+
27894
+ }
27895
+
27896
+ //****************************************************************************
27897
+ // INPUT TYPE for MJ: Content Process Run Details
27898
+ //****************************************************************************
27899
+ @InputType()
27900
+ export class CreateMJContentProcessRunDetailInput {
27901
+ @Field({ nullable: true })
27902
+ ID?: string;
27903
+
27904
+ @Field({ nullable: true })
27905
+ ContentProcessRunID?: string;
27906
+
27907
+ @Field({ nullable: true })
27908
+ ContentSourceID?: string;
27909
+
27910
+ @Field({ nullable: true })
27911
+ ContentSourceTypeID?: string;
27912
+
27913
+ @Field({ nullable: true })
27914
+ Status?: string;
27915
+
27916
+ @Field(() => Int, { nullable: true })
27917
+ ItemsProcessed?: number;
27918
+
27919
+ @Field(() => Int, { nullable: true })
27920
+ ItemsTagged?: number;
27921
+
27922
+ @Field(() => Int, { nullable: true })
27923
+ ItemsVectorized?: number;
27924
+
27925
+ @Field(() => Int, { nullable: true })
27926
+ TagsCreated?: number;
27927
+
27928
+ @Field(() => Int, { nullable: true })
27929
+ ErrorCount?: number;
27930
+
27931
+ @Field({ nullable: true })
27932
+ StartTime: Date | null;
27933
+
27934
+ @Field({ nullable: true })
27935
+ EndTime: Date | null;
27936
+
27937
+ @Field(() => Int, { nullable: true })
27938
+ TotalTokensUsed?: number;
27939
+
27940
+ @Field(() => Float, { nullable: true })
27941
+ TotalCost?: number;
27942
+ }
27943
+
27944
+
27945
+ //****************************************************************************
27946
+ // INPUT TYPE for MJ: Content Process Run Details
27947
+ //****************************************************************************
27948
+ @InputType()
27949
+ export class UpdateMJContentProcessRunDetailInput {
27950
+ @Field()
27951
+ ID: string;
27952
+
27953
+ @Field({ nullable: true })
27954
+ ContentProcessRunID?: string;
27955
+
27956
+ @Field({ nullable: true })
27957
+ ContentSourceID?: string;
27958
+
27959
+ @Field({ nullable: true })
27960
+ ContentSourceTypeID?: string;
27961
+
27962
+ @Field({ nullable: true })
27963
+ Status?: string;
27964
+
27965
+ @Field(() => Int, { nullable: true })
27966
+ ItemsProcessed?: number;
27967
+
27968
+ @Field(() => Int, { nullable: true })
27969
+ ItemsTagged?: number;
27970
+
27971
+ @Field(() => Int, { nullable: true })
27972
+ ItemsVectorized?: number;
27973
+
27974
+ @Field(() => Int, { nullable: true })
27975
+ TagsCreated?: number;
27976
+
27977
+ @Field(() => Int, { nullable: true })
27978
+ ErrorCount?: number;
27979
+
27980
+ @Field({ nullable: true })
27981
+ StartTime?: Date | null;
27982
+
27983
+ @Field({ nullable: true })
27984
+ EndTime?: Date | null;
27985
+
27986
+ @Field(() => Int, { nullable: true })
27987
+ TotalTokensUsed?: number;
27988
+
27989
+ @Field(() => Float, { nullable: true })
27990
+ TotalCost?: number;
27991
+
27992
+ @Field(() => [KeyValuePairInput], { nullable: true })
27993
+ OldValues___?: KeyValuePairInput[];
27994
+ }
27995
+
27996
+ //****************************************************************************
27997
+ // RESOLVER for MJ: Content Process Run Details
27998
+ //****************************************************************************
27999
+ @ObjectType()
28000
+ export class RunMJContentProcessRunDetailViewResult {
28001
+ @Field(() => [MJContentProcessRunDetail_])
28002
+ Results: MJContentProcessRunDetail_[];
28003
+
28004
+ @Field(() => String, {nullable: true})
28005
+ UserViewRunID?: string;
28006
+
28007
+ @Field(() => Int, {nullable: true})
28008
+ RowCount: number;
28009
+
28010
+ @Field(() => Int, {nullable: true})
28011
+ TotalRowCount: number;
28012
+
28013
+ @Field(() => Int, {nullable: true})
28014
+ ExecutionTime: number;
28015
+
28016
+ @Field({nullable: true})
28017
+ ErrorMessage?: string;
28018
+
28019
+ @Field(() => Boolean, {nullable: false})
28020
+ Success: boolean;
28021
+ }
28022
+
28023
+ @Resolver(MJContentProcessRunDetail_)
28024
+ export class MJContentProcessRunDetailResolver extends ResolverBase {
28025
+ @Query(() => RunMJContentProcessRunDetailViewResult)
28026
+ async RunMJContentProcessRunDetailViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28027
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
28028
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
28029
+ }
28030
+
28031
+ @Query(() => RunMJContentProcessRunDetailViewResult)
28032
+ async RunMJContentProcessRunDetailViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28033
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
28034
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
28035
+ }
28036
+
28037
+ @Query(() => RunMJContentProcessRunDetailViewResult)
28038
+ async RunMJContentProcessRunDetailDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28039
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
28040
+ input.EntityName = 'MJ: Content Process Run Details';
28041
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
28042
+ }
28043
+ @Query(() => MJContentProcessRunDetail_, { nullable: true })
28044
+ async MJContentProcessRunDetail(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJContentProcessRunDetail_ | null> {
28045
+ this.CheckUserReadPermissions('MJ: Content Process Run Details', userPayload);
28046
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
28047
+ 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');
28048
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
28049
+ const result = await this.MapFieldNamesToCodeNames('MJ: Content Process Run Details', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
28050
+ return result;
28051
+ }
28052
+
28053
+ @FieldResolver(() => [MJContentProcessRunPromptRun_])
28054
+ async MJContentProcessRunPromptRuns_ContentProcessRunDetailIDArray(@Root() mjcontentprocessrundetail_: MJContentProcessRunDetail_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
28055
+ this.CheckUserReadPermissions('MJ: Content Process Run Prompt Runs', userPayload);
28056
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
28057
+ 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');
28058
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
28059
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Process Run Prompt Runs', rows, this.GetUserFromPayload(userPayload));
28060
+ return result;
28061
+ }
28062
+
28063
+ @Mutation(() => MJContentProcessRunDetail_)
28064
+ async CreateMJContentProcessRunDetail(
28065
+ @Arg('input', () => CreateMJContentProcessRunDetailInput) input: CreateMJContentProcessRunDetailInput,
28066
+ @Ctx() { providers, userPayload }: AppContext,
28067
+ @PubSub() pubSub: PubSubEngine
28068
+ ) {
28069
+ const provider = GetReadWriteProvider(providers);
28070
+ return this.CreateRecord('MJ: Content Process Run Details', input, provider, userPayload, pubSub)
28071
+ }
28072
+
28073
+ @Mutation(() => MJContentProcessRunDetail_)
28074
+ async UpdateMJContentProcessRunDetail(
28075
+ @Arg('input', () => UpdateMJContentProcessRunDetailInput) input: UpdateMJContentProcessRunDetailInput,
28076
+ @Ctx() { providers, userPayload }: AppContext,
28077
+ @PubSub() pubSub: PubSubEngine
28078
+ ) {
28079
+ const provider = GetReadWriteProvider(providers);
28080
+ return this.UpdateRecord('MJ: Content Process Run Details', input, provider, userPayload, pubSub);
28081
+ }
28082
+
28083
+ @Mutation(() => MJContentProcessRunDetail_)
28084
+ async DeleteMJContentProcessRunDetail(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28085
+ const provider = GetReadWriteProvider(providers);
28086
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
28087
+ return this.DeleteRecord('MJ: Content Process Run Details', key, options, provider, userPayload, pubSub);
28088
+ }
28089
+
28090
+ }
28091
+
28092
+ //****************************************************************************
28093
+ // ENTITY CLASS for MJ: Content Process Run Prompt Runs
28094
+ //****************************************************************************
28095
+ @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.` })
28096
+ export class MJContentProcessRunPromptRun_ {
28097
+ @Field()
28098
+ @MaxLength(36)
28099
+ ID: string;
28100
+
28101
+ @Field({description: `The content process run detail record this prompt run is associated with.`})
28102
+ @MaxLength(36)
28103
+ ContentProcessRunDetailID: string;
28104
+
28105
+ @Field({description: `The AI prompt run record containing token usage, cost, model, vendor, and execution details for this call.`})
28106
+ @MaxLength(36)
28107
+ AIPromptRunID: string;
28108
+
28109
+ @Field({description: `Whether this AIPromptRun was for LLM tagging (Tag) or text embedding (Embed).`})
28110
+ @MaxLength(20)
28111
+ RunType: string;
28112
+
28113
+ @Field()
28114
+ _mj__CreatedAt: Date;
28115
+
28116
+ @Field()
28117
+ _mj__UpdatedAt: Date;
28118
+
28119
+ @Field({nullable: true})
28120
+ @MaxLength(255)
28121
+ AIPromptRun?: string;
28122
+
28123
+ }
28124
+
28125
+ //****************************************************************************
28126
+ // INPUT TYPE for MJ: Content Process Run Prompt Runs
28127
+ //****************************************************************************
28128
+ @InputType()
28129
+ export class CreateMJContentProcessRunPromptRunInput {
28130
+ @Field({ nullable: true })
28131
+ ID?: string;
28132
+
28133
+ @Field({ nullable: true })
28134
+ ContentProcessRunDetailID?: string;
28135
+
28136
+ @Field({ nullable: true })
28137
+ AIPromptRunID?: string;
28138
+
28139
+ @Field({ nullable: true })
28140
+ RunType?: string;
28141
+ }
28142
+
28143
+
28144
+ //****************************************************************************
28145
+ // INPUT TYPE for MJ: Content Process Run Prompt Runs
28146
+ //****************************************************************************
28147
+ @InputType()
28148
+ export class UpdateMJContentProcessRunPromptRunInput {
28149
+ @Field()
28150
+ ID: string;
28151
+
28152
+ @Field({ nullable: true })
28153
+ ContentProcessRunDetailID?: string;
28154
+
28155
+ @Field({ nullable: true })
28156
+ AIPromptRunID?: string;
28157
+
28158
+ @Field({ nullable: true })
28159
+ RunType?: string;
28160
+
28161
+ @Field(() => [KeyValuePairInput], { nullable: true })
28162
+ OldValues___?: KeyValuePairInput[];
28163
+ }
28164
+
28165
+ //****************************************************************************
28166
+ // RESOLVER for MJ: Content Process Run Prompt Runs
28167
+ //****************************************************************************
28168
+ @ObjectType()
28169
+ export class RunMJContentProcessRunPromptRunViewResult {
28170
+ @Field(() => [MJContentProcessRunPromptRun_])
28171
+ Results: MJContentProcessRunPromptRun_[];
28172
+
28173
+ @Field(() => String, {nullable: true})
28174
+ UserViewRunID?: string;
28175
+
28176
+ @Field(() => Int, {nullable: true})
28177
+ RowCount: number;
28178
+
28179
+ @Field(() => Int, {nullable: true})
28180
+ TotalRowCount: number;
28181
+
28182
+ @Field(() => Int, {nullable: true})
28183
+ ExecutionTime: number;
28184
+
28185
+ @Field({nullable: true})
28186
+ ErrorMessage?: string;
28187
+
28188
+ @Field(() => Boolean, {nullable: false})
28189
+ Success: boolean;
28190
+ }
28191
+
28192
+ @Resolver(MJContentProcessRunPromptRun_)
28193
+ export class MJContentProcessRunPromptRunResolver extends ResolverBase {
28194
+ @Query(() => RunMJContentProcessRunPromptRunViewResult)
28195
+ async RunMJContentProcessRunPromptRunViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28196
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
28197
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
28198
+ }
28199
+
28200
+ @Query(() => RunMJContentProcessRunPromptRunViewResult)
28201
+ async RunMJContentProcessRunPromptRunViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28202
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
28203
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
28204
+ }
28205
+
28206
+ @Query(() => RunMJContentProcessRunPromptRunViewResult)
28207
+ async RunMJContentProcessRunPromptRunDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28208
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
28209
+ input.EntityName = 'MJ: Content Process Run Prompt Runs';
28210
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
28211
+ }
28212
+ @Query(() => MJContentProcessRunPromptRun_, { nullable: true })
28213
+ async MJContentProcessRunPromptRun(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJContentProcessRunPromptRun_ | null> {
28214
+ this.CheckUserReadPermissions('MJ: Content Process Run Prompt Runs', userPayload);
28215
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
28216
+ 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');
28217
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
28218
+ const result = await this.MapFieldNamesToCodeNames('MJ: Content Process Run Prompt Runs', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
28219
+ return result;
28220
+ }
28221
+
28222
+ @Mutation(() => MJContentProcessRunPromptRun_)
28223
+ async CreateMJContentProcessRunPromptRun(
28224
+ @Arg('input', () => CreateMJContentProcessRunPromptRunInput) input: CreateMJContentProcessRunPromptRunInput,
28225
+ @Ctx() { providers, userPayload }: AppContext,
28226
+ @PubSub() pubSub: PubSubEngine
28227
+ ) {
28228
+ const provider = GetReadWriteProvider(providers);
28229
+ return this.CreateRecord('MJ: Content Process Run Prompt Runs', input, provider, userPayload, pubSub)
28230
+ }
28231
+
28232
+ @Mutation(() => MJContentProcessRunPromptRun_)
28233
+ async UpdateMJContentProcessRunPromptRun(
28234
+ @Arg('input', () => UpdateMJContentProcessRunPromptRunInput) input: UpdateMJContentProcessRunPromptRunInput,
28235
+ @Ctx() { providers, userPayload }: AppContext,
28236
+ @PubSub() pubSub: PubSubEngine
28237
+ ) {
28238
+ const provider = GetReadWriteProvider(providers);
28239
+ return this.UpdateRecord('MJ: Content Process Run Prompt Runs', input, provider, userPayload, pubSub);
28240
+ }
28241
+
28242
+ @Mutation(() => MJContentProcessRunPromptRun_)
28243
+ async DeleteMJContentProcessRunPromptRun(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
28244
+ const provider = GetReadWriteProvider(providers);
28245
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
28246
+ return this.DeleteRecord('MJ: Content Process Run Prompt Runs', key, options, provider, userPayload, pubSub);
28247
+ }
28248
+
28249
+ }
28250
+
27185
28251
  //****************************************************************************
27186
28252
  // ENTITY CLASS for MJ: Content Process Runs
27187
28253
  //****************************************************************************
@@ -27214,10 +28280,42 @@ export class MJContentProcessRun_ {
27214
28280
  @Field()
27215
28281
  _mj__UpdatedAt: Date;
27216
28282
 
28283
+ @Field({nullable: true, description: `The user who triggered this pipeline run. NULL for system-initiated runs.`})
28284
+ @MaxLength(36)
28285
+ StartedByUserID?: string;
28286
+
28287
+ @Field(() => Int, {nullable: true, description: `Total number of content items to process in this run. Used for progress percentage calculation.`})
28288
+ TotalItemCount?: number;
28289
+
28290
+ @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.`})
28291
+ LastProcessedOffset?: number;
28292
+
28293
+ @Field(() => Int, {nullable: true, description: `Number of content items processed per batch. Configurable per run, default 100.`})
28294
+ BatchSize?: number;
28295
+
28296
+ @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.`})
28297
+ ErrorCount?: number;
28298
+
28299
+ @Field({nullable: true, description: `Error details if the run failed. Includes error messages, stack traces, or circuit breaker trigger reason.`})
28300
+ ErrorMessage?: string;
28301
+
28302
+ @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).`})
28303
+ CancellationRequested: boolean;
28304
+
28305
+ @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.`})
28306
+ Configuration?: string;
28307
+
27217
28308
  @Field({nullable: true})
27218
28309
  @MaxLength(255)
27219
28310
  Source?: string;
27220
28311
 
28312
+ @Field({nullable: true})
28313
+ @MaxLength(100)
28314
+ StartedByUser?: string;
28315
+
28316
+ @Field(() => [MJContentProcessRunDetail_])
28317
+ MJContentProcessRunDetails_ContentProcessRunIDArray: MJContentProcessRunDetail_[]; // Link to MJContentProcessRunDetails
28318
+
27221
28319
  }
27222
28320
 
27223
28321
  //****************************************************************************
@@ -27242,6 +28340,30 @@ export class CreateMJContentProcessRunInput {
27242
28340
 
27243
28341
  @Field(() => Int, { nullable: true })
27244
28342
  ProcessedItems: number | null;
28343
+
28344
+ @Field({ nullable: true })
28345
+ StartedByUserID: string | null;
28346
+
28347
+ @Field(() => Int, { nullable: true })
28348
+ TotalItemCount: number | null;
28349
+
28350
+ @Field(() => Int, { nullable: true })
28351
+ LastProcessedOffset?: number | null;
28352
+
28353
+ @Field(() => Int, { nullable: true })
28354
+ BatchSize?: number | null;
28355
+
28356
+ @Field(() => Int, { nullable: true })
28357
+ ErrorCount?: number | null;
28358
+
28359
+ @Field({ nullable: true })
28360
+ ErrorMessage: string | null;
28361
+
28362
+ @Field(() => Boolean, { nullable: true })
28363
+ CancellationRequested?: boolean;
28364
+
28365
+ @Field({ nullable: true })
28366
+ Configuration: string | null;
27245
28367
  }
27246
28368
 
27247
28369
 
@@ -27268,6 +28390,30 @@ export class UpdateMJContentProcessRunInput {
27268
28390
  @Field(() => Int, { nullable: true })
27269
28391
  ProcessedItems?: number | null;
27270
28392
 
28393
+ @Field({ nullable: true })
28394
+ StartedByUserID?: string | null;
28395
+
28396
+ @Field(() => Int, { nullable: true })
28397
+ TotalItemCount?: number | null;
28398
+
28399
+ @Field(() => Int, { nullable: true })
28400
+ LastProcessedOffset?: number | null;
28401
+
28402
+ @Field(() => Int, { nullable: true })
28403
+ BatchSize?: number | null;
28404
+
28405
+ @Field(() => Int, { nullable: true })
28406
+ ErrorCount?: number | null;
28407
+
28408
+ @Field({ nullable: true })
28409
+ ErrorMessage?: string | null;
28410
+
28411
+ @Field(() => Boolean, { nullable: true })
28412
+ CancellationRequested?: boolean;
28413
+
28414
+ @Field({ nullable: true })
28415
+ Configuration?: string | null;
28416
+
27271
28417
  @Field(() => [KeyValuePairInput], { nullable: true })
27272
28418
  OldValues___?: KeyValuePairInput[];
27273
28419
  }
@@ -27329,6 +28475,16 @@ export class MJContentProcessRunResolver extends ResolverBase {
27329
28475
  return result;
27330
28476
  }
27331
28477
 
28478
+ @FieldResolver(() => [MJContentProcessRunDetail_])
28479
+ async MJContentProcessRunDetails_ContentProcessRunIDArray(@Root() mjcontentprocessrun_: MJContentProcessRun_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
28480
+ this.CheckUserReadPermissions('MJ: Content Process Run Details', userPayload);
28481
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
28482
+ 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');
28483
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
28484
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Process Run Details', rows, this.GetUserFromPayload(userPayload));
28485
+ return result;
28486
+ }
28487
+
27332
28488
  @Mutation(() => MJContentProcessRun_)
27333
28489
  async CreateMJContentProcessRun(
27334
28490
  @Arg('input', () => CreateMJContentProcessRunInput) input: CreateMJContentProcessRunInput,
@@ -27711,12 +28867,22 @@ export class MJContentSourceType_ {
27711
28867
  @Field()
27712
28868
  _mj__UpdatedAt: Date;
27713
28869
 
28870
+ @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.`})
28871
+ @MaxLength(255)
28872
+ DriverClass?: string;
28873
+
28874
+ @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.`})
28875
+ Configuration?: string;
28876
+
27714
28877
  @Field(() => [MJContentSource_])
27715
28878
  MJContentSources_ContentSourceTypeIDArray: MJContentSource_[]; // Link to MJContentSources
27716
28879
 
27717
28880
  @Field(() => [MJContentItem_])
27718
28881
  MJContentItems_ContentSourceTypeIDArray: MJContentItem_[]; // Link to MJContentItems
27719
28882
 
28883
+ @Field(() => [MJContentProcessRunDetail_])
28884
+ MJContentProcessRunDetails_ContentSourceTypeIDArray: MJContentProcessRunDetail_[]; // Link to MJContentProcessRunDetails
28885
+
27720
28886
  }
27721
28887
 
27722
28888
  //****************************************************************************
@@ -27732,6 +28898,12 @@ export class CreateMJContentSourceTypeInput {
27732
28898
 
27733
28899
  @Field({ nullable: true })
27734
28900
  Description: string | null;
28901
+
28902
+ @Field({ nullable: true })
28903
+ DriverClass: string | null;
28904
+
28905
+ @Field({ nullable: true })
28906
+ Configuration: string | null;
27735
28907
  }
27736
28908
 
27737
28909
 
@@ -27749,6 +28921,12 @@ export class UpdateMJContentSourceTypeInput {
27749
28921
  @Field({ nullable: true })
27750
28922
  Description?: string | null;
27751
28923
 
28924
+ @Field({ nullable: true })
28925
+ DriverClass?: string | null;
28926
+
28927
+ @Field({ nullable: true })
28928
+ Configuration?: string | null;
28929
+
27752
28930
  @Field(() => [KeyValuePairInput], { nullable: true })
27753
28931
  OldValues___?: KeyValuePairInput[];
27754
28932
  }
@@ -27830,6 +29008,16 @@ export class MJContentSourceTypeResolver extends ResolverBase {
27830
29008
  return result;
27831
29009
  }
27832
29010
 
29011
+ @FieldResolver(() => [MJContentProcessRunDetail_])
29012
+ async MJContentProcessRunDetails_ContentSourceTypeIDArray(@Root() mjcontentsourcetype_: MJContentSourceType_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
29013
+ this.CheckUserReadPermissions('MJ: Content Process Run Details', userPayload);
29014
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
29015
+ 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');
29016
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
29017
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Process Run Details', rows, this.GetUserFromPayload(userPayload));
29018
+ return result;
29019
+ }
29020
+
27833
29021
  @Mutation(() => MJContentSourceType_)
27834
29022
  async CreateMJContentSourceType(
27835
29023
  @Arg('input', () => CreateMJContentSourceTypeInput) input: CreateMJContentSourceTypeInput,
@@ -27902,6 +29090,21 @@ export class MJContentSource_ {
27902
29090
  @MaxLength(36)
27903
29091
  VectorIndexID?: string;
27904
29092
 
29093
+ @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.`})
29094
+ Configuration?: string;
29095
+
29096
+ @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.).`})
29097
+ @MaxLength(36)
29098
+ EntityID?: string;
29099
+
29100
+ @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.`})
29101
+ @MaxLength(36)
29102
+ EntityDocumentID?: string;
29103
+
29104
+ @Field({nullable: true, description: `Optional link to a MJ Scheduled Action that automatically runs the classification pipeline for this source on a cron schedule.`})
29105
+ @MaxLength(36)
29106
+ ScheduledActionID?: string;
29107
+
27905
29108
  @Field()
27906
29109
  @MaxLength(255)
27907
29110
  ContentType: string;
@@ -27922,6 +29125,18 @@ export class MJContentSource_ {
27922
29125
  @MaxLength(255)
27923
29126
  VectorIndex?: string;
27924
29127
 
29128
+ @Field({nullable: true})
29129
+ @MaxLength(255)
29130
+ Entity?: string;
29131
+
29132
+ @Field({nullable: true})
29133
+ @MaxLength(250)
29134
+ EntityDocument?: string;
29135
+
29136
+ @Field({nullable: true})
29137
+ @MaxLength(255)
29138
+ ScheduledAction?: string;
29139
+
27925
29140
  @Field(() => [MJContentItem_])
27926
29141
  MJContentItems_ContentSourceIDArray: MJContentItem_[]; // Link to MJContentItems
27927
29142
 
@@ -27931,6 +29146,9 @@ export class MJContentSource_ {
27931
29146
  @Field(() => [MJContentSourceParam_])
27932
29147
  MJContentSourceParams_ContentSourceIDArray: MJContentSourceParam_[]; // Link to MJContentSourceParams
27933
29148
 
29149
+ @Field(() => [MJContentProcessRunDetail_])
29150
+ MJContentProcessRunDetails_ContentSourceIDArray: MJContentProcessRunDetail_[]; // Link to MJContentProcessRunDetails
29151
+
27934
29152
  }
27935
29153
 
27936
29154
  //****************************************************************************
@@ -27961,6 +29179,18 @@ export class CreateMJContentSourceInput {
27961
29179
 
27962
29180
  @Field({ nullable: true })
27963
29181
  VectorIndexID: string | null;
29182
+
29183
+ @Field({ nullable: true })
29184
+ Configuration: string | null;
29185
+
29186
+ @Field({ nullable: true })
29187
+ EntityID: string | null;
29188
+
29189
+ @Field({ nullable: true })
29190
+ EntityDocumentID: string | null;
29191
+
29192
+ @Field({ nullable: true })
29193
+ ScheduledActionID: string | null;
27964
29194
  }
27965
29195
 
27966
29196
 
@@ -27993,6 +29223,18 @@ export class UpdateMJContentSourceInput {
27993
29223
  @Field({ nullable: true })
27994
29224
  VectorIndexID?: string | null;
27995
29225
 
29226
+ @Field({ nullable: true })
29227
+ Configuration?: string | null;
29228
+
29229
+ @Field({ nullable: true })
29230
+ EntityID?: string | null;
29231
+
29232
+ @Field({ nullable: true })
29233
+ EntityDocumentID?: string | null;
29234
+
29235
+ @Field({ nullable: true })
29236
+ ScheduledActionID?: string | null;
29237
+
27996
29238
  @Field(() => [KeyValuePairInput], { nullable: true })
27997
29239
  OldValues___?: KeyValuePairInput[];
27998
29240
  }
@@ -28084,6 +29326,16 @@ export class MJContentSourceResolver extends ResolverBase {
28084
29326
  return result;
28085
29327
  }
28086
29328
 
29329
+ @FieldResolver(() => [MJContentProcessRunDetail_])
29330
+ async MJContentProcessRunDetails_ContentSourceIDArray(@Root() mjcontentsource_: MJContentSource_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
29331
+ this.CheckUserReadPermissions('MJ: Content Process Run Details', userPayload);
29332
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
29333
+ 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');
29334
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
29335
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Process Run Details', rows, this.GetUserFromPayload(userPayload));
29336
+ return result;
29337
+ }
29338
+
28087
29339
  @Mutation(() => MJContentSource_)
28088
29340
  async CreateMJContentSource(
28089
29341
  @Arg('input', () => CreateMJContentSourceInput) input: CreateMJContentSourceInput,
@@ -28316,6 +29568,9 @@ export class MJContentType_ {
28316
29568
  @MaxLength(36)
28317
29569
  VectorIndexID?: string;
28318
29570
 
29571
+ @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.`})
29572
+ Configuration?: string;
29573
+
28319
29574
  @Field()
28320
29575
  @MaxLength(50)
28321
29576
  AIModel: string;
@@ -28364,6 +29619,9 @@ export class CreateMJContentTypeInput {
28364
29619
 
28365
29620
  @Field({ nullable: true })
28366
29621
  VectorIndexID: string | null;
29622
+
29623
+ @Field({ nullable: true })
29624
+ Configuration: string | null;
28367
29625
  }
28368
29626
 
28369
29627
 
@@ -28396,6 +29654,9 @@ export class UpdateMJContentTypeInput {
28396
29654
  @Field({ nullable: true })
28397
29655
  VectorIndexID?: string | null;
28398
29656
 
29657
+ @Field({ nullable: true })
29658
+ Configuration?: string | null;
29659
+
28399
29660
  @Field(() => [KeyValuePairInput], { nullable: true })
28400
29661
  OldValues___?: KeyValuePairInput[];
28401
29662
  }
@@ -30536,6 +31797,232 @@ export class MJConversationResolver extends ResolverBase {
30536
31797
 
30537
31798
  }
30538
31799
 
31800
+ //****************************************************************************
31801
+ // ENTITY CLASS for MJ: Countries
31802
+ //****************************************************************************
31803
+ @ObjectType({ description: `Reference table for countries with ISO 3166-1 codes, geographic centroids, and optional medium-resolution boundary GeoJSON for choropleth rendering. Seeded with ~250 countries.` })
31804
+ export class MJCountry_ {
31805
+ @Field()
31806
+ @MaxLength(36)
31807
+ ID: string;
31808
+
31809
+ @Field({description: `Full country name (e.g., "United States", "Canada").`})
31810
+ @MaxLength(200)
31811
+ Name: string;
31812
+
31813
+ @Field({description: `ISO 3166-1 alpha-2 code (e.g., "US", "CA"). Unique business key for lookups.`})
31814
+ @MaxLength(2)
31815
+ ISO2: string;
31816
+
31817
+ @Field({description: `ISO 3166-1 alpha-3 code (e.g., "USA", "CAN"). Unique business key for lookups.`})
31818
+ @MaxLength(3)
31819
+ ISO3: string;
31820
+
31821
+ @Field(() => Int, {nullable: true, description: `ISO 3166-1 numeric code (e.g., 840 for US, 124 for Canada).`})
31822
+ NumericCode?: number;
31823
+
31824
+ @Field(() => Float, {nullable: true, description: `Geographic centroid latitude. Used as fallback point for country-level geocoding.`})
31825
+ Latitude?: number;
31826
+
31827
+ @Field(() => Float, {nullable: true, description: `Geographic centroid longitude. Used as fallback point for country-level geocoding.`})
31828
+ Longitude?: number;
31829
+
31830
+ @Field({nullable: true, description: `Medium-resolution (~50m) GeoJSON boundary polygon for choropleth map rendering. Nullable — point map falls back to centroid if absent. Total ~3MB for all countries.`})
31831
+ BoundaryGeoJSON?: string;
31832
+
31833
+ @Field({nullable: true, description: `JSON array of common aliases and alternate names (e.g., ["United States","USA","U.S.","America"]). Used by GeoResolver for fuzzy text-to-country matching.`})
31834
+ CommonAliases?: string;
31835
+
31836
+ @Field()
31837
+ _mj__CreatedAt: Date;
31838
+
31839
+ @Field()
31840
+ _mj__UpdatedAt: Date;
31841
+
31842
+ @Field(() => [MJStateProvince_])
31843
+ MJStateProvinces_CountryIDArray: MJStateProvince_[]; // Link to MJStateProvinces
31844
+
31845
+ @Field(() => [MJRecordGeoCode_])
31846
+ MJRecordGeoCodes_CountryIDArray: MJRecordGeoCode_[]; // Link to MJRecordGeoCodes
31847
+
31848
+ }
31849
+
31850
+ //****************************************************************************
31851
+ // INPUT TYPE for MJ: Countries
31852
+ //****************************************************************************
31853
+ @InputType()
31854
+ export class CreateMJCountryInput {
31855
+ @Field({ nullable: true })
31856
+ ID?: string;
31857
+
31858
+ @Field({ nullable: true })
31859
+ Name?: string;
31860
+
31861
+ @Field({ nullable: true })
31862
+ ISO2?: string;
31863
+
31864
+ @Field({ nullable: true })
31865
+ ISO3?: string;
31866
+
31867
+ @Field(() => Int, { nullable: true })
31868
+ NumericCode: number | null;
31869
+
31870
+ @Field(() => Float, { nullable: true })
31871
+ Latitude: number | null;
31872
+
31873
+ @Field(() => Float, { nullable: true })
31874
+ Longitude: number | null;
31875
+
31876
+ @Field({ nullable: true })
31877
+ BoundaryGeoJSON: string | null;
31878
+
31879
+ @Field({ nullable: true })
31880
+ CommonAliases: string | null;
31881
+ }
31882
+
31883
+
31884
+ //****************************************************************************
31885
+ // INPUT TYPE for MJ: Countries
31886
+ //****************************************************************************
31887
+ @InputType()
31888
+ export class UpdateMJCountryInput {
31889
+ @Field()
31890
+ ID: string;
31891
+
31892
+ @Field({ nullable: true })
31893
+ Name?: string;
31894
+
31895
+ @Field({ nullable: true })
31896
+ ISO2?: string;
31897
+
31898
+ @Field({ nullable: true })
31899
+ ISO3?: string;
31900
+
31901
+ @Field(() => Int, { nullable: true })
31902
+ NumericCode?: number | null;
31903
+
31904
+ @Field(() => Float, { nullable: true })
31905
+ Latitude?: number | null;
31906
+
31907
+ @Field(() => Float, { nullable: true })
31908
+ Longitude?: number | null;
31909
+
31910
+ @Field({ nullable: true })
31911
+ BoundaryGeoJSON?: string | null;
31912
+
31913
+ @Field({ nullable: true })
31914
+ CommonAliases?: string | null;
31915
+
31916
+ @Field(() => [KeyValuePairInput], { nullable: true })
31917
+ OldValues___?: KeyValuePairInput[];
31918
+ }
31919
+
31920
+ //****************************************************************************
31921
+ // RESOLVER for MJ: Countries
31922
+ //****************************************************************************
31923
+ @ObjectType()
31924
+ export class RunMJCountryViewResult {
31925
+ @Field(() => [MJCountry_])
31926
+ Results: MJCountry_[];
31927
+
31928
+ @Field(() => String, {nullable: true})
31929
+ UserViewRunID?: string;
31930
+
31931
+ @Field(() => Int, {nullable: true})
31932
+ RowCount: number;
31933
+
31934
+ @Field(() => Int, {nullable: true})
31935
+ TotalRowCount: number;
31936
+
31937
+ @Field(() => Int, {nullable: true})
31938
+ ExecutionTime: number;
31939
+
31940
+ @Field({nullable: true})
31941
+ ErrorMessage?: string;
31942
+
31943
+ @Field(() => Boolean, {nullable: false})
31944
+ Success: boolean;
31945
+ }
31946
+
31947
+ @Resolver(MJCountry_)
31948
+ export class MJCountryResolver extends ResolverBase {
31949
+ @Query(() => RunMJCountryViewResult)
31950
+ async RunMJCountryViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
31951
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
31952
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
31953
+ }
31954
+
31955
+ @Query(() => RunMJCountryViewResult)
31956
+ async RunMJCountryViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
31957
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
31958
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
31959
+ }
31960
+
31961
+ @Query(() => RunMJCountryViewResult)
31962
+ async RunMJCountryDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
31963
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
31964
+ input.EntityName = 'MJ: Countries';
31965
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
31966
+ }
31967
+ @Query(() => MJCountry_, { nullable: true })
31968
+ async MJCountry(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJCountry_ | null> {
31969
+ this.CheckUserReadPermissions('MJ: Countries', userPayload);
31970
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
31971
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwCountries')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Countries', userPayload, EntityPermissionType.Read, 'AND');
31972
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
31973
+ const result = await this.MapFieldNamesToCodeNames('MJ: Countries', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
31974
+ return result;
31975
+ }
31976
+
31977
+ @FieldResolver(() => [MJStateProvince_])
31978
+ async MJStateProvinces_CountryIDArray(@Root() mjcountry_: MJCountry_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
31979
+ this.CheckUserReadPermissions('MJ: State Provinces', userPayload);
31980
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
31981
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwStateProvinces')} WHERE ${provider.QuoteIdentifier('CountryID')}='${mjcountry_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: State Provinces', userPayload, EntityPermissionType.Read, 'AND');
31982
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
31983
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: State Provinces', rows, this.GetUserFromPayload(userPayload));
31984
+ return result;
31985
+ }
31986
+
31987
+ @FieldResolver(() => [MJRecordGeoCode_])
31988
+ async MJRecordGeoCodes_CountryIDArray(@Root() mjcountry_: MJCountry_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
31989
+ this.CheckUserReadPermissions('MJ: Record Geo Codes', userPayload);
31990
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
31991
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwRecordGeoCodes')} WHERE ${provider.QuoteIdentifier('CountryID')}='${mjcountry_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Record Geo Codes', userPayload, EntityPermissionType.Read, 'AND');
31992
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
31993
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Record Geo Codes', rows, this.GetUserFromPayload(userPayload));
31994
+ return result;
31995
+ }
31996
+
31997
+ @Mutation(() => MJCountry_)
31998
+ async CreateMJCountry(
31999
+ @Arg('input', () => CreateMJCountryInput) input: CreateMJCountryInput,
32000
+ @Ctx() { providers, userPayload }: AppContext,
32001
+ @PubSub() pubSub: PubSubEngine
32002
+ ) {
32003
+ const provider = GetReadWriteProvider(providers);
32004
+ return this.CreateRecord('MJ: Countries', input, provider, userPayload, pubSub)
32005
+ }
32006
+
32007
+ @Mutation(() => MJCountry_)
32008
+ async UpdateMJCountry(
32009
+ @Arg('input', () => UpdateMJCountryInput) input: UpdateMJCountryInput,
32010
+ @Ctx() { providers, userPayload }: AppContext,
32011
+ @PubSub() pubSub: PubSubEngine
32012
+ ) {
32013
+ const provider = GetReadWriteProvider(providers);
32014
+ return this.UpdateRecord('MJ: Countries', input, provider, userPayload, pubSub);
32015
+ }
32016
+
32017
+ @Mutation(() => MJCountry_)
32018
+ async DeleteMJCountry(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
32019
+ const provider = GetReadWriteProvider(providers);
32020
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
32021
+ return this.DeleteRecord('MJ: Countries', key, options, provider, userPayload, pubSub);
32022
+ }
32023
+
32024
+ }
32025
+
30539
32026
  //****************************************************************************
30540
32027
  // ENTITY CLASS for MJ: Credential Categories
30541
32028
  //****************************************************************************
@@ -31032,12 +32519,18 @@ export class MJCredential_ {
31032
32519
  @Field(() => [MJOAuthToken_])
31033
32520
  MJOAuthTokens_CredentialIDArray: MJOAuthToken_[]; // Link to MJOAuthTokens
31034
32521
 
32522
+ @Field(() => [MJSearchProvider_])
32523
+ MJSearchProviders_CredentialIDArray: MJSearchProvider_[]; // Link to MJSearchProviders
32524
+
31035
32525
  @Field(() => [MJFileStorageAccount_])
31036
32526
  MJFileStorageAccounts_CredentialIDArray: MJFileStorageAccount_[]; // Link to MJFileStorageAccounts
31037
32527
 
31038
32528
  @Field(() => [MJMCPServerConnection_])
31039
32529
  MJMCPServerConnections_CredentialIDArray: MJMCPServerConnection_[]; // Link to MJMCPServerConnections
31040
32530
 
32531
+ @Field(() => [MJVectorDatabase_])
32532
+ MJVectorDatabases_CredentialIDArray: MJVectorDatabase_[]; // Link to MJVectorDatabases
32533
+
31041
32534
  @Field(() => [MJAICredentialBinding_])
31042
32535
  MJAICredentialBindings_CredentialIDArray: MJAICredentialBinding_[]; // Link to MJAICredentialBindings
31043
32536
 
@@ -31201,6 +32694,16 @@ export class MJCredentialResolver extends ResolverBase {
31201
32694
  return result;
31202
32695
  }
31203
32696
 
32697
+ @FieldResolver(() => [MJSearchProvider_])
32698
+ async MJSearchProviders_CredentialIDArray(@Root() mjcredential_: MJCredential_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
32699
+ this.CheckUserReadPermissions('MJ: Search Providers', userPayload);
32700
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
32701
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwSearchProviders')} WHERE ${provider.QuoteIdentifier('CredentialID')}='${mjcredential_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Search Providers', userPayload, EntityPermissionType.Read, 'AND');
32702
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
32703
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Search Providers', rows, this.GetUserFromPayload(userPayload));
32704
+ return result;
32705
+ }
32706
+
31204
32707
  @FieldResolver(() => [MJFileStorageAccount_])
31205
32708
  async MJFileStorageAccounts_CredentialIDArray(@Root() mjcredential_: MJCredential_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
31206
32709
  this.CheckUserReadPermissions('MJ: File Storage Accounts', userPayload);
@@ -31221,6 +32724,16 @@ export class MJCredentialResolver extends ResolverBase {
31221
32724
  return result;
31222
32725
  }
31223
32726
 
32727
+ @FieldResolver(() => [MJVectorDatabase_])
32728
+ async MJVectorDatabases_CredentialIDArray(@Root() mjcredential_: MJCredential_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
32729
+ this.CheckUserReadPermissions('MJ: Vector Databases', userPayload);
32730
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
32731
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwVectorDatabases')} WHERE ${provider.QuoteIdentifier('CredentialID')}='${mjcredential_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Vector Databases', userPayload, EntityPermissionType.Read, 'AND');
32732
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
32733
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Vector Databases', rows, this.GetUserFromPayload(userPayload));
32734
+ return result;
32735
+ }
32736
+
31224
32737
  @FieldResolver(() => [MJAICredentialBinding_])
31225
32738
  async MJAICredentialBindings_CredentialIDArray(@Root() mjcredential_: MJCredential_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
31226
32739
  this.CheckUserReadPermissions('MJ: AI Credential Bindings', userPayload);
@@ -34050,6 +35563,12 @@ export class MJDuplicateRunDetail_ {
34050
35563
  @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
35564
  RecordMetadata?: string;
34052
35565
 
35566
+ @Field({nullable: true, description: `When processing started for this specific record during duplicate detection.`})
35567
+ StartedAt?: Date;
35568
+
35569
+ @Field({nullable: true, description: `When processing completed for this specific record during duplicate detection.`})
35570
+ EndedAt?: Date;
35571
+
34053
35572
  @Field()
34054
35573
  @MaxLength(255)
34055
35574
  DuplicateRun: string;
@@ -34090,6 +35609,12 @@ export class CreateMJDuplicateRunDetailInput {
34090
35609
 
34091
35610
  @Field({ nullable: true })
34092
35611
  RecordMetadata: string | null;
35612
+
35613
+ @Field({ nullable: true })
35614
+ StartedAt: Date | null;
35615
+
35616
+ @Field({ nullable: true })
35617
+ EndedAt: Date | null;
34093
35618
  }
34094
35619
 
34095
35620
 
@@ -34125,6 +35650,12 @@ export class UpdateMJDuplicateRunDetailInput {
34125
35650
  @Field({ nullable: true })
34126
35651
  RecordMetadata?: string | null;
34127
35652
 
35653
+ @Field({ nullable: true })
35654
+ StartedAt?: Date | null;
35655
+
35656
+ @Field({ nullable: true })
35657
+ EndedAt?: Date | null;
35658
+
34128
35659
  @Field(() => [KeyValuePairInput], { nullable: true })
34129
35660
  OldValues___?: KeyValuePairInput[];
34130
35661
  }
@@ -34276,6 +35807,21 @@ export class MJDuplicateRun_ {
34276
35807
  @Field()
34277
35808
  _mj__UpdatedAt: Date;
34278
35809
 
35810
+ @Field(() => Int, {nullable: true, description: `Total entity records to check for duplicates in this run.`})
35811
+ TotalItemCount?: number;
35812
+
35813
+ @Field(() => Int, {nullable: true, description: `Number of records checked so far. Used for progress percentage.`})
35814
+ ProcessedItemCount?: number;
35815
+
35816
+ @Field(() => Int, {nullable: true, description: `Resume cursor for large-scale duplicate detection. Stores the offset of the last completed batch.`})
35817
+ LastProcessedOffset?: number;
35818
+
35819
+ @Field(() => Int, {nullable: true, description: `Number of records processed per batch during duplicate detection.`})
35820
+ BatchSize?: number;
35821
+
35822
+ @Field(() => Boolean, {description: `When set to 1, duplicate detection stops after the current batch. Used for pause/cancel.`})
35823
+ CancellationRequested: boolean;
35824
+
34279
35825
  @Field()
34280
35826
  @MaxLength(255)
34281
35827
  Entity: string;
@@ -34334,6 +35880,21 @@ export class CreateMJDuplicateRunInput {
34334
35880
 
34335
35881
  @Field({ nullable: true })
34336
35882
  ProcessingErrorMessage: string | null;
35883
+
35884
+ @Field(() => Int, { nullable: true })
35885
+ TotalItemCount: number | null;
35886
+
35887
+ @Field(() => Int, { nullable: true })
35888
+ ProcessedItemCount?: number | null;
35889
+
35890
+ @Field(() => Int, { nullable: true })
35891
+ LastProcessedOffset?: number | null;
35892
+
35893
+ @Field(() => Int, { nullable: true })
35894
+ BatchSize?: number | null;
35895
+
35896
+ @Field(() => Boolean, { nullable: true })
35897
+ CancellationRequested?: boolean;
34337
35898
  }
34338
35899
 
34339
35900
 
@@ -34375,6 +35936,21 @@ export class UpdateMJDuplicateRunInput {
34375
35936
  @Field({ nullable: true })
34376
35937
  ProcessingErrorMessage?: string | null;
34377
35938
 
35939
+ @Field(() => Int, { nullable: true })
35940
+ TotalItemCount?: number | null;
35941
+
35942
+ @Field(() => Int, { nullable: true })
35943
+ ProcessedItemCount?: number | null;
35944
+
35945
+ @Field(() => Int, { nullable: true })
35946
+ LastProcessedOffset?: number | null;
35947
+
35948
+ @Field(() => Int, { nullable: true })
35949
+ BatchSize?: number | null;
35950
+
35951
+ @Field(() => Boolean, { nullable: true })
35952
+ CancellationRequested?: boolean;
35953
+
34378
35954
  @Field(() => [KeyValuePairInput], { nullable: true })
34379
35955
  OldValues___?: KeyValuePairInput[];
34380
35956
  }
@@ -36120,6 +37696,21 @@ export class MJEntity_ {
36120
37696
  @Field(() => Boolean, {description: `When false (default), child types are disjoint - a record can only be one child type at a time. When true, a record can simultaneously exist as multiple child types (e.g., a Person can be both a Member and a Volunteer).`})
36121
37697
  AllowMultipleSubtypes: boolean;
36122
37698
 
37699
+ @Field(() => Boolean, {description: `When true, CodeGen LLM can auto-configure full-text search settings (FullTextSearchEnabled, catalog, index, function) during code generation runs.`})
37700
+ AutoUpdateFullTextSearch: boolean;
37701
+
37702
+ @Field(() => Boolean, {description: `When true, CodeGen LLM can auto-set AllowUserSearchAPI during code generation runs.`})
37703
+ AutoUpdateAllowUserSearchAPI: boolean;
37704
+
37705
+ @Field(() => Boolean, {description: `When true (default), the server-side RunView cache will store and return cached results for this entity, trusting that all mutations flow through BaseEntity.Save() which fires cache invalidation events. Set to false for entities whose rows are created as side-effects of other operations via raw SQL (e.g., Record Changes created by spCreateRecordChange_Internal), since those inserts bypass BaseEntity and never trigger cache invalidation.`})
37706
+ TrustServerCacheCompletely: boolean;
37707
+
37708
+ @Field(() => Boolean, {description: `When true, CodeGen generates geo-aware subclass code, adds __mj_Latitude/__mj_Longitude virtual fields to the base view, and the UI shows a map view toggle. Auto-set by CodeGen when LLM detects geo-capable fields (address, lat/lng, etc.).`})
37709
+ SupportsGeoCoding: boolean;
37710
+
37711
+ @Field(() => Boolean, {description: `When true (default), CodeGen can automatically set SupportsGeoCoding based on LLM analysis of entity fields. Set to 0 to lock the value and prevent CodeGen from changing it.`})
37712
+ AutoUpdateSupportsGeoCoding: boolean;
37713
+
36123
37714
  @Field({nullable: true, description: `Schema-based programmatic code name derived from the entity Name. Uses GetClassNameSchemaPrefix(SchemaName) as the prefix, then strips EntityNamePrefix from the Name and removes spaces. For "__mj" schema with entity "MJ: AI Models", this produces "MJAIModels". For entities in other schemas, the sanitized schema name is prepended. Used in GraphQL type generation and internal code references.`})
36124
37715
  CodeName?: string;
36125
37716
 
@@ -36279,6 +37870,9 @@ export class MJEntity_ {
36279
37870
  @Field(() => [MJEntityOrganicKey_])
36280
37871
  MJEntityOrganicKeys_EntityIDArray: MJEntityOrganicKey_[]; // Link to MJEntityOrganicKeys
36281
37872
 
37873
+ @Field(() => [MJRecordGeoCode_])
37874
+ MJRecordGeoCodes_EntityIDArray: MJRecordGeoCode_[]; // Link to MJRecordGeoCodes
37875
+
36282
37876
  @Field(() => [MJGeneratedCode_])
36283
37877
  MJGeneratedCodes_LinkedEntityIDArray: MJGeneratedCode_[]; // Link to MJGeneratedCodes
36284
37878
 
@@ -36294,6 +37888,9 @@ export class MJEntity_ {
36294
37888
  @Field(() => [MJResourceType_])
36295
37889
  MJResourceTypes_CategoryEntityIDArray: MJResourceType_[]; // Link to MJResourceTypes
36296
37890
 
37891
+ @Field(() => [MJContentSource_])
37892
+ MJContentSources_EntityIDArray: MJContentSource_[]; // Link to MJContentSources
37893
+
36297
37894
  @Field(() => [MJTestRun_])
36298
37895
  MJTestRuns_TargetLogEntityIDArray: MJTestRun_[]; // Link to MJTestRuns
36299
37896
 
@@ -36468,6 +38065,21 @@ export class CreateMJEntityInput {
36468
38065
 
36469
38066
  @Field(() => Boolean, { nullable: true })
36470
38067
  AllowMultipleSubtypes?: boolean;
38068
+
38069
+ @Field(() => Boolean, { nullable: true })
38070
+ AutoUpdateFullTextSearch?: boolean;
38071
+
38072
+ @Field(() => Boolean, { nullable: true })
38073
+ AutoUpdateAllowUserSearchAPI?: boolean;
38074
+
38075
+ @Field(() => Boolean, { nullable: true })
38076
+ TrustServerCacheCompletely?: boolean;
38077
+
38078
+ @Field(() => Boolean, { nullable: true })
38079
+ SupportsGeoCoding?: boolean;
38080
+
38081
+ @Field(() => Boolean, { nullable: true })
38082
+ AutoUpdateSupportsGeoCoding?: boolean;
36471
38083
  }
36472
38084
 
36473
38085
 
@@ -36638,6 +38250,21 @@ export class UpdateMJEntityInput {
36638
38250
  @Field(() => Boolean, { nullable: true })
36639
38251
  AllowMultipleSubtypes?: boolean;
36640
38252
 
38253
+ @Field(() => Boolean, { nullable: true })
38254
+ AutoUpdateFullTextSearch?: boolean;
38255
+
38256
+ @Field(() => Boolean, { nullable: true })
38257
+ AutoUpdateAllowUserSearchAPI?: boolean;
38258
+
38259
+ @Field(() => Boolean, { nullable: true })
38260
+ TrustServerCacheCompletely?: boolean;
38261
+
38262
+ @Field(() => Boolean, { nullable: true })
38263
+ SupportsGeoCoding?: boolean;
38264
+
38265
+ @Field(() => Boolean, { nullable: true })
38266
+ AutoUpdateSupportsGeoCoding?: boolean;
38267
+
36641
38268
  @Field(() => [KeyValuePairInput], { nullable: true })
36642
38269
  OldValues___?: KeyValuePairInput[];
36643
38270
  }
@@ -37169,6 +38796,16 @@ export class MJEntityResolverBase extends ResolverBase {
37169
38796
  return result;
37170
38797
  }
37171
38798
 
38799
+ @FieldResolver(() => [MJRecordGeoCode_])
38800
+ async MJRecordGeoCodes_EntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
38801
+ this.CheckUserReadPermissions('MJ: Record Geo Codes', userPayload);
38802
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
38803
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwRecordGeoCodes')} WHERE ${provider.QuoteIdentifier('EntityID')}='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Record Geo Codes', userPayload, EntityPermissionType.Read, 'AND');
38804
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
38805
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Record Geo Codes', rows, this.GetUserFromPayload(userPayload));
38806
+ return result;
38807
+ }
38808
+
37172
38809
  @FieldResolver(() => [MJGeneratedCode_])
37173
38810
  async MJGeneratedCodes_LinkedEntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
37174
38811
  this.CheckUserReadPermissions('MJ: Generated Codes', userPayload);
@@ -37219,6 +38856,16 @@ export class MJEntityResolverBase extends ResolverBase {
37219
38856
  return result;
37220
38857
  }
37221
38858
 
38859
+ @FieldResolver(() => [MJContentSource_])
38860
+ async MJContentSources_EntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
38861
+ this.CheckUserReadPermissions('MJ: Content Sources', userPayload);
38862
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
38863
+ 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');
38864
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
38865
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Sources', rows, this.GetUserFromPayload(userPayload));
38866
+ return result;
38867
+ }
38868
+
37222
38869
  @FieldResolver(() => [MJTestRun_])
37223
38870
  async MJTestRuns_TargetLogEntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
37224
38871
  this.CheckUserReadPermissions('MJ: Test Runs', userPayload);
@@ -39331,6 +40978,9 @@ export class MJEntityDocument_ {
39331
40978
  @Field(() => [MJEntityRecordDocument_])
39332
40979
  MJEntityRecordDocuments_EntityDocumentIDArray: MJEntityRecordDocument_[]; // Link to MJEntityRecordDocuments
39333
40980
 
40981
+ @Field(() => [MJContentSource_])
40982
+ MJContentSources_EntityDocumentIDArray: MJContentSource_[]; // Link to MJContentSources
40983
+
39334
40984
  }
39335
40985
 
39336
40986
  //****************************************************************************
@@ -39508,6 +41158,16 @@ export class MJEntityDocumentResolver extends ResolverBase {
39508
41158
  return result;
39509
41159
  }
39510
41160
 
41161
+ @FieldResolver(() => [MJContentSource_])
41162
+ async MJContentSources_EntityDocumentIDArray(@Root() mjentitydocument_: MJEntityDocument_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
41163
+ this.CheckUserReadPermissions('MJ: Content Sources', userPayload);
41164
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
41165
+ 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');
41166
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
41167
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Sources', rows, this.GetUserFromPayload(userPayload));
41168
+ return result;
41169
+ }
41170
+
39511
41171
  @Mutation(() => MJEntityDocument_)
39512
41172
  async CreateMJEntityDocument(
39513
41173
  @Arg('input', () => CreateMJEntityDocumentInput) input: CreateMJEntityDocumentInput,
@@ -39936,6 +41596,19 @@ export class MJEntityField_ {
39936
41596
  @Field({nullable: true, description: `Raw TypeScript code emitted by CodeGen above the entity class definition. Typically contains the interface/type definition referenced by JSONType. Can include imports, multiple types, or any valid TypeScript.`})
39937
41597
  JSONTypeDefinition?: string;
39938
41598
 
41599
+ @Field({description: `Search predicate controlling how user search queries match against this field. Valid values: BeginsWith, Contains, EndsWith, Exact.`})
41600
+ @MaxLength(20)
41601
+ UserSearchPredicateAPI: string;
41602
+
41603
+ @Field(() => Boolean, {description: `When true, CodeGen LLM can auto-set the UserSearchPredicateAPI value during code generation runs.`})
41604
+ AutoUpdateUserSearchPredicate: boolean;
41605
+
41606
+ @Field(() => Boolean, {description: `When true, CodeGen LLM can auto-set the FullTextSearchEnabled value during code generation runs.`})
41607
+ AutoUpdateFullTextSearch: boolean;
41608
+
41609
+ @Field(() => Boolean, {description: `When true (default), CodeGen can automatically suggest and apply ExtendedType values (GeoLatitude, GeoLongitude, GeoAddress, etc.) during LLM field categorization. Set to 0 to lock admin-specified ExtendedType.`})
41610
+ AutoUpdateExtendedType: boolean;
41611
+
39939
41612
  @Field({nullable: true})
39940
41613
  FieldCodeName?: string;
39941
41614
 
@@ -40130,6 +41803,18 @@ export class CreateMJEntityFieldInput {
40130
41803
 
40131
41804
  @Field({ nullable: true })
40132
41805
  JSONTypeDefinition: string | null;
41806
+
41807
+ @Field({ nullable: true })
41808
+ UserSearchPredicateAPI?: string;
41809
+
41810
+ @Field(() => Boolean, { nullable: true })
41811
+ AutoUpdateUserSearchPredicate?: boolean;
41812
+
41813
+ @Field(() => Boolean, { nullable: true })
41814
+ AutoUpdateFullTextSearch?: boolean;
41815
+
41816
+ @Field(() => Boolean, { nullable: true })
41817
+ AutoUpdateExtendedType?: boolean;
40133
41818
  }
40134
41819
 
40135
41820
 
@@ -40276,6 +41961,18 @@ export class UpdateMJEntityFieldInput {
40276
41961
  @Field({ nullable: true })
40277
41962
  JSONTypeDefinition?: string | null;
40278
41963
 
41964
+ @Field({ nullable: true })
41965
+ UserSearchPredicateAPI?: string;
41966
+
41967
+ @Field(() => Boolean, { nullable: true })
41968
+ AutoUpdateUserSearchPredicate?: boolean;
41969
+
41970
+ @Field(() => Boolean, { nullable: true })
41971
+ AutoUpdateFullTextSearch?: boolean;
41972
+
41973
+ @Field(() => Boolean, { nullable: true })
41974
+ AutoUpdateExtendedType?: boolean;
41975
+
40279
41976
  @Field(() => [KeyValuePairInput], { nullable: true })
40280
41977
  OldValues___?: KeyValuePairInput[];
40281
41978
  }
@@ -41180,6 +42877,9 @@ export class MJEntityRecordDocument_ {
41180
42877
  @MaxLength(255)
41181
42878
  VectorIndex: string;
41182
42879
 
42880
+ @Field(() => [MJContentItem_])
42881
+ MJContentItems_EntityRecordDocumentIDArray: MJContentItem_[]; // Link to MJContentItems
42882
+
41183
42883
  }
41184
42884
 
41185
42885
  //****************************************************************************
@@ -41309,6 +43009,16 @@ export class MJEntityRecordDocumentResolver extends ResolverBase {
41309
43009
  return result;
41310
43010
  }
41311
43011
 
43012
+ @FieldResolver(() => [MJContentItem_])
43013
+ async MJContentItems_EntityRecordDocumentIDArray(@Root() mjentityrecorddocument_: MJEntityRecordDocument_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
43014
+ this.CheckUserReadPermissions('MJ: Content Items', userPayload);
43015
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
43016
+ 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');
43017
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
43018
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Items', rows, this.GetUserFromPayload(userPayload));
43019
+ return result;
43020
+ }
43021
+
41312
43022
  @Mutation(() => MJEntityRecordDocument_)
41313
43023
  async CreateMJEntityRecordDocument(
41314
43024
  @Arg('input', () => CreateMJEntityRecordDocumentInput) input: CreateMJEntityRecordDocumentInput,
@@ -43074,6 +44784,201 @@ export class MJFileEntityRecordLinkResolver extends ResolverBase {
43074
44784
 
43075
44785
  }
43076
44786
 
44787
+ //****************************************************************************
44788
+ // ENTITY CLASS for MJ: File Storage Account Permissions
44789
+ //****************************************************************************
44790
+ @ObjectType({ description: `Controls which users and roles can access specific file storage accounts. If no permission records exist for an account, it is accessible to everyone (backwards compatible).` })
44791
+ export class MJFileStorageAccountPermission_ {
44792
+ @Field()
44793
+ @MaxLength(36)
44794
+ ID: string;
44795
+
44796
+ @Field({description: `The storage account this permission applies to.`})
44797
+ @MaxLength(36)
44798
+ FileStorageAccountID: string;
44799
+
44800
+ @Field({description: `Permission type: User (requires UserID), Role (requires RoleID), or Everyone (both NULL).`})
44801
+ @MaxLength(20)
44802
+ Type: string;
44803
+
44804
+ @Field({nullable: true, description: `Required when Type is User. The specific user granted access to this storage account.`})
44805
+ @MaxLength(36)
44806
+ UserID?: string;
44807
+
44808
+ @Field({nullable: true, description: `Required when Type is Role. The role granted access to this storage account.`})
44809
+ @MaxLength(36)
44810
+ RoleID?: string;
44811
+
44812
+ @Field(() => Boolean, {description: `Whether the grantee can read/search files in this storage account.`})
44813
+ CanRead: boolean;
44814
+
44815
+ @Field(() => Boolean, {description: `Whether the grantee can upload/modify files in this storage account.`})
44816
+ CanWrite: boolean;
44817
+
44818
+ @Field()
44819
+ _mj__CreatedAt: Date;
44820
+
44821
+ @Field()
44822
+ _mj__UpdatedAt: Date;
44823
+
44824
+ @Field()
44825
+ @MaxLength(200)
44826
+ FileStorageAccount: string;
44827
+
44828
+ @Field({nullable: true})
44829
+ @MaxLength(100)
44830
+ User?: string;
44831
+
44832
+ @Field({nullable: true})
44833
+ @MaxLength(50)
44834
+ Role?: string;
44835
+
44836
+ }
44837
+
44838
+ //****************************************************************************
44839
+ // INPUT TYPE for MJ: File Storage Account Permissions
44840
+ //****************************************************************************
44841
+ @InputType()
44842
+ export class CreateMJFileStorageAccountPermissionInput {
44843
+ @Field({ nullable: true })
44844
+ ID?: string;
44845
+
44846
+ @Field({ nullable: true })
44847
+ FileStorageAccountID?: string;
44848
+
44849
+ @Field({ nullable: true })
44850
+ Type?: string;
44851
+
44852
+ @Field({ nullable: true })
44853
+ UserID: string | null;
44854
+
44855
+ @Field({ nullable: true })
44856
+ RoleID: string | null;
44857
+
44858
+ @Field(() => Boolean, { nullable: true })
44859
+ CanRead?: boolean;
44860
+
44861
+ @Field(() => Boolean, { nullable: true })
44862
+ CanWrite?: boolean;
44863
+ }
44864
+
44865
+
44866
+ //****************************************************************************
44867
+ // INPUT TYPE for MJ: File Storage Account Permissions
44868
+ //****************************************************************************
44869
+ @InputType()
44870
+ export class UpdateMJFileStorageAccountPermissionInput {
44871
+ @Field()
44872
+ ID: string;
44873
+
44874
+ @Field({ nullable: true })
44875
+ FileStorageAccountID?: string;
44876
+
44877
+ @Field({ nullable: true })
44878
+ Type?: string;
44879
+
44880
+ @Field({ nullable: true })
44881
+ UserID?: string | null;
44882
+
44883
+ @Field({ nullable: true })
44884
+ RoleID?: string | null;
44885
+
44886
+ @Field(() => Boolean, { nullable: true })
44887
+ CanRead?: boolean;
44888
+
44889
+ @Field(() => Boolean, { nullable: true })
44890
+ CanWrite?: boolean;
44891
+
44892
+ @Field(() => [KeyValuePairInput], { nullable: true })
44893
+ OldValues___?: KeyValuePairInput[];
44894
+ }
44895
+
44896
+ //****************************************************************************
44897
+ // RESOLVER for MJ: File Storage Account Permissions
44898
+ //****************************************************************************
44899
+ @ObjectType()
44900
+ export class RunMJFileStorageAccountPermissionViewResult {
44901
+ @Field(() => [MJFileStorageAccountPermission_])
44902
+ Results: MJFileStorageAccountPermission_[];
44903
+
44904
+ @Field(() => String, {nullable: true})
44905
+ UserViewRunID?: string;
44906
+
44907
+ @Field(() => Int, {nullable: true})
44908
+ RowCount: number;
44909
+
44910
+ @Field(() => Int, {nullable: true})
44911
+ TotalRowCount: number;
44912
+
44913
+ @Field(() => Int, {nullable: true})
44914
+ ExecutionTime: number;
44915
+
44916
+ @Field({nullable: true})
44917
+ ErrorMessage?: string;
44918
+
44919
+ @Field(() => Boolean, {nullable: false})
44920
+ Success: boolean;
44921
+ }
44922
+
44923
+ @Resolver(MJFileStorageAccountPermission_)
44924
+ export class MJFileStorageAccountPermissionResolver extends ResolverBase {
44925
+ @Query(() => RunMJFileStorageAccountPermissionViewResult)
44926
+ async RunMJFileStorageAccountPermissionViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44927
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44928
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
44929
+ }
44930
+
44931
+ @Query(() => RunMJFileStorageAccountPermissionViewResult)
44932
+ async RunMJFileStorageAccountPermissionViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44933
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44934
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
44935
+ }
44936
+
44937
+ @Query(() => RunMJFileStorageAccountPermissionViewResult)
44938
+ async RunMJFileStorageAccountPermissionDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44939
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44940
+ input.EntityName = 'MJ: File Storage Account Permissions';
44941
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
44942
+ }
44943
+ @Query(() => MJFileStorageAccountPermission_, { nullable: true })
44944
+ async MJFileStorageAccountPermission(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJFileStorageAccountPermission_ | null> {
44945
+ this.CheckUserReadPermissions('MJ: File Storage Account Permissions', userPayload);
44946
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
44947
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwFileStorageAccountPermissions')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: File Storage Account Permissions', userPayload, EntityPermissionType.Read, 'AND');
44948
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
44949
+ const result = await this.MapFieldNamesToCodeNames('MJ: File Storage Account Permissions', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
44950
+ return result;
44951
+ }
44952
+
44953
+ @Mutation(() => MJFileStorageAccountPermission_)
44954
+ async CreateMJFileStorageAccountPermission(
44955
+ @Arg('input', () => CreateMJFileStorageAccountPermissionInput) input: CreateMJFileStorageAccountPermissionInput,
44956
+ @Ctx() { providers, userPayload }: AppContext,
44957
+ @PubSub() pubSub: PubSubEngine
44958
+ ) {
44959
+ const provider = GetReadWriteProvider(providers);
44960
+ return this.CreateRecord('MJ: File Storage Account Permissions', input, provider, userPayload, pubSub)
44961
+ }
44962
+
44963
+ @Mutation(() => MJFileStorageAccountPermission_)
44964
+ async UpdateMJFileStorageAccountPermission(
44965
+ @Arg('input', () => UpdateMJFileStorageAccountPermissionInput) input: UpdateMJFileStorageAccountPermissionInput,
44966
+ @Ctx() { providers, userPayload }: AppContext,
44967
+ @PubSub() pubSub: PubSubEngine
44968
+ ) {
44969
+ const provider = GetReadWriteProvider(providers);
44970
+ return this.UpdateRecord('MJ: File Storage Account Permissions', input, provider, userPayload, pubSub);
44971
+ }
44972
+
44973
+ @Mutation(() => MJFileStorageAccountPermission_)
44974
+ async DeleteMJFileStorageAccountPermission(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
44975
+ const provider = GetReadWriteProvider(providers);
44976
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
44977
+ return this.DeleteRecord('MJ: File Storage Account Permissions', key, options, provider, userPayload, pubSub);
44978
+ }
44979
+
44980
+ }
44981
+
43077
44982
  //****************************************************************************
43078
44983
  // ENTITY CLASS for MJ: File Storage Accounts
43079
44984
  //****************************************************************************
@@ -43104,6 +45009,9 @@ export class MJFileStorageAccount_ {
43104
45009
  @Field()
43105
45010
  _mj__UpdatedAt: Date;
43106
45011
 
45012
+ @Field(() => Boolean, {description: `When true, this storage account is included in universal/global search results. Only effective if the associated provider supports search (SupportsSearch = 1).`})
45013
+ IncludeInGlobalSearch: boolean;
45014
+
43107
45015
  @Field()
43108
45016
  @MaxLength(50)
43109
45017
  Provider: string;
@@ -43112,6 +45020,18 @@ export class MJFileStorageAccount_ {
43112
45020
  @MaxLength(200)
43113
45021
  Credential: string;
43114
45022
 
45023
+ @Field(() => [MJAIAgentType_])
45024
+ MJAIAgentTypes_DefaultStorageAccountIDArray: MJAIAgentType_[]; // Link to MJAIAgentTypes
45025
+
45026
+ @Field(() => [MJFileStorageAccountPermission_])
45027
+ MJFileStorageAccountPermissions_FileStorageAccountIDArray: MJFileStorageAccountPermission_[]; // Link to MJFileStorageAccountPermissions
45028
+
45029
+ @Field(() => [MJAIAgentCategory_])
45030
+ MJAIAgentCategories_DefaultStorageAccountIDArray: MJAIAgentCategory_[]; // Link to MJAIAgentCategories
45031
+
45032
+ @Field(() => [MJAIAgent_])
45033
+ MJAIAgents_DefaultStorageAccountIDArray: MJAIAgent_[]; // Link to MJAIAgents
45034
+
43115
45035
  }
43116
45036
 
43117
45037
  //****************************************************************************
@@ -43133,6 +45053,9 @@ export class CreateMJFileStorageAccountInput {
43133
45053
 
43134
45054
  @Field({ nullable: true })
43135
45055
  CredentialID?: string;
45056
+
45057
+ @Field(() => Boolean, { nullable: true })
45058
+ IncludeInGlobalSearch?: boolean;
43136
45059
  }
43137
45060
 
43138
45061
 
@@ -43156,6 +45079,9 @@ export class UpdateMJFileStorageAccountInput {
43156
45079
  @Field({ nullable: true })
43157
45080
  CredentialID?: string;
43158
45081
 
45082
+ @Field(() => Boolean, { nullable: true })
45083
+ IncludeInGlobalSearch?: boolean;
45084
+
43159
45085
  @Field(() => [KeyValuePairInput], { nullable: true })
43160
45086
  OldValues___?: KeyValuePairInput[];
43161
45087
  }
@@ -43217,6 +45143,46 @@ export class MJFileStorageAccountResolver extends ResolverBase {
43217
45143
  return result;
43218
45144
  }
43219
45145
 
45146
+ @FieldResolver(() => [MJAIAgentType_])
45147
+ async MJAIAgentTypes_DefaultStorageAccountIDArray(@Root() mjfilestorageaccount_: MJFileStorageAccount_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
45148
+ this.CheckUserReadPermissions('MJ: AI Agent Types', userPayload);
45149
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45150
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentTypes')} WHERE ${provider.QuoteIdentifier('DefaultStorageAccountID')}='${mjfilestorageaccount_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Types', userPayload, EntityPermissionType.Read, 'AND');
45151
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
45152
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Types', rows, this.GetUserFromPayload(userPayload));
45153
+ return result;
45154
+ }
45155
+
45156
+ @FieldResolver(() => [MJFileStorageAccountPermission_])
45157
+ async MJFileStorageAccountPermissions_FileStorageAccountIDArray(@Root() mjfilestorageaccount_: MJFileStorageAccount_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
45158
+ this.CheckUserReadPermissions('MJ: File Storage Account Permissions', userPayload);
45159
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45160
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwFileStorageAccountPermissions')} WHERE ${provider.QuoteIdentifier('FileStorageAccountID')}='${mjfilestorageaccount_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: File Storage Account Permissions', userPayload, EntityPermissionType.Read, 'AND');
45161
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
45162
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: File Storage Account Permissions', rows, this.GetUserFromPayload(userPayload));
45163
+ return result;
45164
+ }
45165
+
45166
+ @FieldResolver(() => [MJAIAgentCategory_])
45167
+ async MJAIAgentCategories_DefaultStorageAccountIDArray(@Root() mjfilestorageaccount_: MJFileStorageAccount_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
45168
+ this.CheckUserReadPermissions('MJ: AI Agent Categories', userPayload);
45169
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45170
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentCategories')} WHERE ${provider.QuoteIdentifier('DefaultStorageAccountID')}='${mjfilestorageaccount_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Categories', userPayload, EntityPermissionType.Read, 'AND');
45171
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
45172
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Categories', rows, this.GetUserFromPayload(userPayload));
45173
+ return result;
45174
+ }
45175
+
45176
+ @FieldResolver(() => [MJAIAgent_])
45177
+ async MJAIAgents_DefaultStorageAccountIDArray(@Root() mjfilestorageaccount_: MJFileStorageAccount_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
45178
+ this.CheckUserReadPermissions('MJ: AI Agents', userPayload);
45179
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45180
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgents')} WHERE ${provider.QuoteIdentifier('DefaultStorageAccountID')}='${mjfilestorageaccount_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agents', userPayload, EntityPermissionType.Read, 'AND');
45181
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
45182
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agents', rows, this.GetUserFromPayload(userPayload));
45183
+ return result;
45184
+ }
45185
+
43220
45186
  @Mutation(() => MJFileStorageAccount_)
43221
45187
  async CreateMJFileStorageAccount(
43222
45188
  @Arg('input', () => CreateMJFileStorageAccountInput) input: CreateMJFileStorageAccountInput,
@@ -43569,6 +45535,9 @@ export class MJFile_ {
43569
45535
  @Field(() => [MJAIAgentRunMedia_])
43570
45536
  MJAIAgentRunMedias_FileIDArray: MJAIAgentRunMedia_[]; // Link to MJAIAgentRunMedias
43571
45537
 
45538
+ @Field(() => [MJArtifactVersion_])
45539
+ MJArtifactVersions_FileIDArray: MJArtifactVersion_[]; // Link to MJArtifactVersions
45540
+
43572
45541
  }
43573
45542
 
43574
45543
  //****************************************************************************
@@ -43732,6 +45701,16 @@ export class MJFileResolver extends ResolverBase {
43732
45701
  return result;
43733
45702
  }
43734
45703
 
45704
+ @FieldResolver(() => [MJArtifactVersion_])
45705
+ async MJArtifactVersions_FileIDArray(@Root() mjfile_: MJFile_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
45706
+ this.CheckUserReadPermissions('MJ: Artifact Versions', userPayload);
45707
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
45708
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwArtifactVersions')} WHERE ${provider.QuoteIdentifier('FileID')}='${mjfile_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Artifact Versions', userPayload, EntityPermissionType.Read, 'AND');
45709
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
45710
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Artifact Versions', rows, this.GetUserFromPayload(userPayload));
45711
+ return result;
45712
+ }
45713
+
43735
45714
  @Mutation(() => MJFile_)
43736
45715
  async CreateMJFile(
43737
45716
  @Arg('input', () => CreateMJFileInput) input: CreateMJFileInput,
@@ -44191,6 +46170,198 @@ export class MJGeneratedCodeResolver extends ResolverBase {
44191
46170
 
44192
46171
  }
44193
46172
 
46173
+ //****************************************************************************
46174
+ // ENTITY CLASS for MJ: Instance Configurations
46175
+ //****************************************************************************
46176
+ @ObjectType({ description: `Instance-level feature toggles and configuration. Controls which features are enabled per MJ Explorer deployment.` })
46177
+ export class MJInstanceConfiguration_ {
46178
+ @Field()
46179
+ @MaxLength(36)
46180
+ ID: string;
46181
+
46182
+ @Field({description: `Unique dot-notation key identifying the feature, e.g. Shell.SearchBar.Enabled.`})
46183
+ @MaxLength(200)
46184
+ FeatureKey: string;
46185
+
46186
+ @Field({description: `Current value for this feature setting.`})
46187
+ Value: string;
46188
+
46189
+ @Field({description: `Data type of the value: boolean, string, number, or json.`})
46190
+ @MaxLength(20)
46191
+ ValueType: string;
46192
+
46193
+ @Field({description: `Grouping category for admin UI display.`})
46194
+ @MaxLength(100)
46195
+ Category: string;
46196
+
46197
+ @Field({description: `Human-readable display name for the setting.`})
46198
+ @MaxLength(200)
46199
+ DisplayName: string;
46200
+
46201
+ @Field({nullable: true, description: `Optional extended description or help text for the setting.`})
46202
+ Description?: string;
46203
+
46204
+ @Field({description: `Factory default value. Used when resetting to defaults.`})
46205
+ DefaultValue: string;
46206
+
46207
+ @Field()
46208
+ _mj__CreatedAt: Date;
46209
+
46210
+ @Field()
46211
+ _mj__UpdatedAt: Date;
46212
+
46213
+ }
46214
+
46215
+ //****************************************************************************
46216
+ // INPUT TYPE for MJ: Instance Configurations
46217
+ //****************************************************************************
46218
+ @InputType()
46219
+ export class CreateMJInstanceConfigurationInput {
46220
+ @Field({ nullable: true })
46221
+ ID?: string;
46222
+
46223
+ @Field({ nullable: true })
46224
+ FeatureKey?: string;
46225
+
46226
+ @Field({ nullable: true })
46227
+ Value?: string;
46228
+
46229
+ @Field({ nullable: true })
46230
+ ValueType?: string;
46231
+
46232
+ @Field({ nullable: true })
46233
+ Category?: string;
46234
+
46235
+ @Field({ nullable: true })
46236
+ DisplayName?: string;
46237
+
46238
+ @Field({ nullable: true })
46239
+ Description: string | null;
46240
+
46241
+ @Field({ nullable: true })
46242
+ DefaultValue?: string;
46243
+ }
46244
+
46245
+
46246
+ //****************************************************************************
46247
+ // INPUT TYPE for MJ: Instance Configurations
46248
+ //****************************************************************************
46249
+ @InputType()
46250
+ export class UpdateMJInstanceConfigurationInput {
46251
+ @Field()
46252
+ ID: string;
46253
+
46254
+ @Field({ nullable: true })
46255
+ FeatureKey?: string;
46256
+
46257
+ @Field({ nullable: true })
46258
+ Value?: string;
46259
+
46260
+ @Field({ nullable: true })
46261
+ ValueType?: string;
46262
+
46263
+ @Field({ nullable: true })
46264
+ Category?: string;
46265
+
46266
+ @Field({ nullable: true })
46267
+ DisplayName?: string;
46268
+
46269
+ @Field({ nullable: true })
46270
+ Description?: string | null;
46271
+
46272
+ @Field({ nullable: true })
46273
+ DefaultValue?: string;
46274
+
46275
+ @Field(() => [KeyValuePairInput], { nullable: true })
46276
+ OldValues___?: KeyValuePairInput[];
46277
+ }
46278
+
46279
+ //****************************************************************************
46280
+ // RESOLVER for MJ: Instance Configurations
46281
+ //****************************************************************************
46282
+ @ObjectType()
46283
+ export class RunMJInstanceConfigurationViewResult {
46284
+ @Field(() => [MJInstanceConfiguration_])
46285
+ Results: MJInstanceConfiguration_[];
46286
+
46287
+ @Field(() => String, {nullable: true})
46288
+ UserViewRunID?: string;
46289
+
46290
+ @Field(() => Int, {nullable: true})
46291
+ RowCount: number;
46292
+
46293
+ @Field(() => Int, {nullable: true})
46294
+ TotalRowCount: number;
46295
+
46296
+ @Field(() => Int, {nullable: true})
46297
+ ExecutionTime: number;
46298
+
46299
+ @Field({nullable: true})
46300
+ ErrorMessage?: string;
46301
+
46302
+ @Field(() => Boolean, {nullable: false})
46303
+ Success: boolean;
46304
+ }
46305
+
46306
+ @Resolver(MJInstanceConfiguration_)
46307
+ export class MJInstanceConfigurationResolver extends ResolverBase {
46308
+ @Query(() => RunMJInstanceConfigurationViewResult)
46309
+ async RunMJInstanceConfigurationViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
46310
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
46311
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
46312
+ }
46313
+
46314
+ @Query(() => RunMJInstanceConfigurationViewResult)
46315
+ async RunMJInstanceConfigurationViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
46316
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
46317
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
46318
+ }
46319
+
46320
+ @Query(() => RunMJInstanceConfigurationViewResult)
46321
+ async RunMJInstanceConfigurationDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
46322
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
46323
+ input.EntityName = 'MJ: Instance Configurations';
46324
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
46325
+ }
46326
+ @Query(() => MJInstanceConfiguration_, { nullable: true })
46327
+ async MJInstanceConfiguration(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJInstanceConfiguration_ | null> {
46328
+ this.CheckUserReadPermissions('MJ: Instance Configurations', userPayload);
46329
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
46330
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwInstanceConfigurations')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Instance Configurations', userPayload, EntityPermissionType.Read, 'AND');
46331
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
46332
+ const result = await this.MapFieldNamesToCodeNames('MJ: Instance Configurations', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
46333
+ return result;
46334
+ }
46335
+
46336
+ @Mutation(() => MJInstanceConfiguration_)
46337
+ async CreateMJInstanceConfiguration(
46338
+ @Arg('input', () => CreateMJInstanceConfigurationInput) input: CreateMJInstanceConfigurationInput,
46339
+ @Ctx() { providers, userPayload }: AppContext,
46340
+ @PubSub() pubSub: PubSubEngine
46341
+ ) {
46342
+ const provider = GetReadWriteProvider(providers);
46343
+ return this.CreateRecord('MJ: Instance Configurations', input, provider, userPayload, pubSub)
46344
+ }
46345
+
46346
+ @Mutation(() => MJInstanceConfiguration_)
46347
+ async UpdateMJInstanceConfiguration(
46348
+ @Arg('input', () => UpdateMJInstanceConfigurationInput) input: UpdateMJInstanceConfigurationInput,
46349
+ @Ctx() { providers, userPayload }: AppContext,
46350
+ @PubSub() pubSub: PubSubEngine
46351
+ ) {
46352
+ const provider = GetReadWriteProvider(providers);
46353
+ return this.UpdateRecord('MJ: Instance Configurations', input, provider, userPayload, pubSub);
46354
+ }
46355
+
46356
+ @Mutation(() => MJInstanceConfiguration_)
46357
+ async DeleteMJInstanceConfiguration(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
46358
+ const provider = GetReadWriteProvider(providers);
46359
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
46360
+ return this.DeleteRecord('MJ: Instance Configurations', key, options, provider, userPayload, pubSub);
46361
+ }
46362
+
46363
+ }
46364
+
44194
46365
  //****************************************************************************
44195
46366
  // ENTITY CLASS for MJ: Integration Object Fields
44196
46367
  //****************************************************************************
@@ -45501,6 +47672,201 @@ export class MJIntegrationResolver extends ResolverBase {
45501
47672
 
45502
47673
  }
45503
47674
 
47675
+ //****************************************************************************
47676
+ // ENTITY CLASS for MJ: Knowledge Hub Saved Searches
47677
+ //****************************************************************************
47678
+ @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.` })
47679
+ export class MJKnowledgeHubSavedSearch_ {
47680
+ @Field()
47681
+ @MaxLength(36)
47682
+ ID: string;
47683
+
47684
+ @Field()
47685
+ @MaxLength(36)
47686
+ UserID: string;
47687
+
47688
+ @Field()
47689
+ @MaxLength(255)
47690
+ Name: string;
47691
+
47692
+ @Field()
47693
+ @MaxLength(1000)
47694
+ Query: string;
47695
+
47696
+ @Field({nullable: true, description: `JSON object with active filter selections. Keys are filter categories (Entity, Tags), values are arrays of selected option values.`})
47697
+ Filters?: string;
47698
+
47699
+ @Field(() => Float, {nullable: true})
47700
+ MinScore?: number;
47701
+
47702
+ @Field(() => Int, {nullable: true})
47703
+ MaxResults?: number;
47704
+
47705
+ @Field(() => Boolean, {description: `When enabled, the system will notify the user when new results match this saved search (future capability).`})
47706
+ NotifyOnNewResults: boolean;
47707
+
47708
+ @Field()
47709
+ _mj__CreatedAt: Date;
47710
+
47711
+ @Field()
47712
+ _mj__UpdatedAt: Date;
47713
+
47714
+ @Field()
47715
+ @MaxLength(100)
47716
+ User: string;
47717
+
47718
+ }
47719
+
47720
+ //****************************************************************************
47721
+ // INPUT TYPE for MJ: Knowledge Hub Saved Searches
47722
+ //****************************************************************************
47723
+ @InputType()
47724
+ export class CreateMJKnowledgeHubSavedSearchInput {
47725
+ @Field({ nullable: true })
47726
+ ID?: string;
47727
+
47728
+ @Field({ nullable: true })
47729
+ UserID?: string;
47730
+
47731
+ @Field({ nullable: true })
47732
+ Name?: string;
47733
+
47734
+ @Field({ nullable: true })
47735
+ Query?: string;
47736
+
47737
+ @Field({ nullable: true })
47738
+ Filters: string | null;
47739
+
47740
+ @Field(() => Float, { nullable: true })
47741
+ MinScore: number | null;
47742
+
47743
+ @Field(() => Int, { nullable: true })
47744
+ MaxResults?: number | null;
47745
+
47746
+ @Field(() => Boolean, { nullable: true })
47747
+ NotifyOnNewResults?: boolean;
47748
+ }
47749
+
47750
+
47751
+ //****************************************************************************
47752
+ // INPUT TYPE for MJ: Knowledge Hub Saved Searches
47753
+ //****************************************************************************
47754
+ @InputType()
47755
+ export class UpdateMJKnowledgeHubSavedSearchInput {
47756
+ @Field()
47757
+ ID: string;
47758
+
47759
+ @Field({ nullable: true })
47760
+ UserID?: string;
47761
+
47762
+ @Field({ nullable: true })
47763
+ Name?: string;
47764
+
47765
+ @Field({ nullable: true })
47766
+ Query?: string;
47767
+
47768
+ @Field({ nullable: true })
47769
+ Filters?: string | null;
47770
+
47771
+ @Field(() => Float, { nullable: true })
47772
+ MinScore?: number | null;
47773
+
47774
+ @Field(() => Int, { nullable: true })
47775
+ MaxResults?: number | null;
47776
+
47777
+ @Field(() => Boolean, { nullable: true })
47778
+ NotifyOnNewResults?: boolean;
47779
+
47780
+ @Field(() => [KeyValuePairInput], { nullable: true })
47781
+ OldValues___?: KeyValuePairInput[];
47782
+ }
47783
+
47784
+ //****************************************************************************
47785
+ // RESOLVER for MJ: Knowledge Hub Saved Searches
47786
+ //****************************************************************************
47787
+ @ObjectType()
47788
+ export class RunMJKnowledgeHubSavedSearchViewResult {
47789
+ @Field(() => [MJKnowledgeHubSavedSearch_])
47790
+ Results: MJKnowledgeHubSavedSearch_[];
47791
+
47792
+ @Field(() => String, {nullable: true})
47793
+ UserViewRunID?: string;
47794
+
47795
+ @Field(() => Int, {nullable: true})
47796
+ RowCount: number;
47797
+
47798
+ @Field(() => Int, {nullable: true})
47799
+ TotalRowCount: number;
47800
+
47801
+ @Field(() => Int, {nullable: true})
47802
+ ExecutionTime: number;
47803
+
47804
+ @Field({nullable: true})
47805
+ ErrorMessage?: string;
47806
+
47807
+ @Field(() => Boolean, {nullable: false})
47808
+ Success: boolean;
47809
+ }
47810
+
47811
+ @Resolver(MJKnowledgeHubSavedSearch_)
47812
+ export class MJKnowledgeHubSavedSearchResolver extends ResolverBase {
47813
+ @Query(() => RunMJKnowledgeHubSavedSearchViewResult)
47814
+ async RunMJKnowledgeHubSavedSearchViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
47815
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
47816
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
47817
+ }
47818
+
47819
+ @Query(() => RunMJKnowledgeHubSavedSearchViewResult)
47820
+ async RunMJKnowledgeHubSavedSearchViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
47821
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
47822
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
47823
+ }
47824
+
47825
+ @Query(() => RunMJKnowledgeHubSavedSearchViewResult)
47826
+ async RunMJKnowledgeHubSavedSearchDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
47827
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
47828
+ input.EntityName = 'MJ: Knowledge Hub Saved Searches';
47829
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
47830
+ }
47831
+ @Query(() => MJKnowledgeHubSavedSearch_, { nullable: true })
47832
+ async MJKnowledgeHubSavedSearch(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJKnowledgeHubSavedSearch_ | null> {
47833
+ this.CheckUserReadPermissions('MJ: Knowledge Hub Saved Searches', userPayload);
47834
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
47835
+ 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');
47836
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
47837
+ const result = await this.MapFieldNamesToCodeNames('MJ: Knowledge Hub Saved Searches', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
47838
+ return result;
47839
+ }
47840
+
47841
+ @Mutation(() => MJKnowledgeHubSavedSearch_)
47842
+ async CreateMJKnowledgeHubSavedSearch(
47843
+ @Arg('input', () => CreateMJKnowledgeHubSavedSearchInput) input: CreateMJKnowledgeHubSavedSearchInput,
47844
+ @Ctx() { providers, userPayload }: AppContext,
47845
+ @PubSub() pubSub: PubSubEngine
47846
+ ) {
47847
+ const provider = GetReadWriteProvider(providers);
47848
+ return this.CreateRecord('MJ: Knowledge Hub Saved Searches', input, provider, userPayload, pubSub)
47849
+ }
47850
+
47851
+ @Mutation(() => MJKnowledgeHubSavedSearch_)
47852
+ async UpdateMJKnowledgeHubSavedSearch(
47853
+ @Arg('input', () => UpdateMJKnowledgeHubSavedSearchInput) input: UpdateMJKnowledgeHubSavedSearchInput,
47854
+ @Ctx() { providers, userPayload }: AppContext,
47855
+ @PubSub() pubSub: PubSubEngine
47856
+ ) {
47857
+ const provider = GetReadWriteProvider(providers);
47858
+ return this.UpdateRecord('MJ: Knowledge Hub Saved Searches', input, provider, userPayload, pubSub);
47859
+ }
47860
+
47861
+ @Mutation(() => MJKnowledgeHubSavedSearch_)
47862
+ async DeleteMJKnowledgeHubSavedSearch(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
47863
+ const provider = GetReadWriteProvider(providers);
47864
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
47865
+ return this.DeleteRecord('MJ: Knowledge Hub Saved Searches', key, options, provider, userPayload, pubSub);
47866
+ }
47867
+
47868
+ }
47869
+
45504
47870
  //****************************************************************************
45505
47871
  // ENTITY CLASS for MJ: Libraries
45506
47872
  //****************************************************************************
@@ -54971,6 +57337,278 @@ export class MJRecordChangeResolver extends ResolverBase {
54971
57337
 
54972
57338
  }
54973
57339
 
57340
+ //****************************************************************************
57341
+ // ENTITY CLASS for MJ: Record Geo Codes
57342
+ //****************************************************************************
57343
+ @ObjectType({ description: `Polymorphic table storing persisted geocoding results for any MJ entity record. Each row maps an entity record + location type to a lat/lng coordinate, with optional country/state references for choropleth grouping. Supports multi-location entities via LocationType discriminator.` })
57344
+ export class MJRecordGeoCode_ {
57345
+ @Field()
57346
+ @MaxLength(36)
57347
+ ID: string;
57348
+
57349
+ @Field({description: `Foreign key to Entity. Identifies which entity this geocode belongs to.`})
57350
+ @MaxLength(36)
57351
+ EntityID: string;
57352
+
57353
+ @Field({description: `MJ composite primary key format string identifying the source record (e.g., "ID|<uuid>"). Max 450 chars for SQL Server index support.`})
57354
+ @MaxLength(450)
57355
+ RecordID: string;
57356
+
57357
+ @Field({description: `Discriminator for multi-location entities. Default "Primary" for single-address entities. Multi-address examples: "Home", "Business", "Mailing", "PO Box".`})
57358
+ @MaxLength(50)
57359
+ LocationType: string;
57360
+
57361
+ @Field(() => Float, {nullable: true, description: `Geocoded latitude coordinate. NULL when Status is "pending" or "failed".`})
57362
+ Latitude?: number;
57363
+
57364
+ @Field(() => Float, {nullable: true, description: `Geocoded longitude coordinate. NULL when Status is "pending" or "failed".`})
57365
+ Longitude?: number;
57366
+
57367
+ @Field({nullable: true, description: `Precision level of the geocoded result: exact (street address), postal_code, city, county, state_province, or country.`})
57368
+ @MaxLength(20)
57369
+ Precision?: string;
57370
+
57371
+ @Field({nullable: true, description: `Optional FK to Country reference table. Populated alongside lat/lng to enable choropleth grouping without reverse-geocoding at render time.`})
57372
+ @MaxLength(36)
57373
+ CountryID?: string;
57374
+
57375
+ @Field({nullable: true, description: `Optional FK to StateProvince reference table. Populated alongside lat/lng to enable state-level choropleth grouping.`})
57376
+ @MaxLength(36)
57377
+ StateProvinceID?: string;
57378
+
57379
+ @Field({description: `Current geocoding status: "pending" (awaiting geocode), "success" (geocoded), or "failed" (geocoding error). Used by scheduled job for retry logic.`})
57380
+ @MaxLength(20)
57381
+ Status: string;
57382
+
57383
+ @Field({nullable: true, description: `Error details when Status is "failed". Captures API error messages, rate limit info, etc. for debugging.`})
57384
+ ErrorMessage?: string;
57385
+
57386
+ @Field(() => Int, {description: `Number of geocoding attempts. Used for exponential backoff in the scheduled retry job. Stops retrying at configurable maxRetries (default 3).`})
57387
+ RetryCount: number;
57388
+
57389
+ @Field({nullable: true, description: `SHA-256 hash of the source field values that produced this geocode. When source fields change on save, the hash won't match and re-geocoding is triggered. Format: SHA-256(concat(field1, "|", field2, ...)).`})
57390
+ @MaxLength(64)
57391
+ SourceFieldHash?: string;
57392
+
57393
+ @Field({nullable: true, description: `Timestamp of when geocoding was last attempted (success or failure).`})
57394
+ GeocodedAt?: Date;
57395
+
57396
+ @Field({nullable: true, description: `How this geocode was produced: google (Google Geocoding API), reference_data (resolved via Country/StateProvince tables), manual (user-entered), ip_geolocation (IP lookup), native (copied from entity lat/lng fields), reverse (reverse geocode from coordinates).`})
57397
+ @MaxLength(30)
57398
+ GeocodingSource?: string;
57399
+
57400
+ @Field()
57401
+ _mj__CreatedAt: Date;
57402
+
57403
+ @Field()
57404
+ _mj__UpdatedAt: Date;
57405
+
57406
+ @Field()
57407
+ @MaxLength(255)
57408
+ Entity: string;
57409
+
57410
+ @Field({nullable: true})
57411
+ @MaxLength(200)
57412
+ Country?: string;
57413
+
57414
+ @Field({nullable: true})
57415
+ @MaxLength(200)
57416
+ StateProvince?: string;
57417
+
57418
+ }
57419
+
57420
+ //****************************************************************************
57421
+ // INPUT TYPE for MJ: Record Geo Codes
57422
+ //****************************************************************************
57423
+ @InputType()
57424
+ export class CreateMJRecordGeoCodeInput {
57425
+ @Field({ nullable: true })
57426
+ ID?: string;
57427
+
57428
+ @Field({ nullable: true })
57429
+ EntityID?: string;
57430
+
57431
+ @Field({ nullable: true })
57432
+ RecordID?: string;
57433
+
57434
+ @Field({ nullable: true })
57435
+ LocationType?: string;
57436
+
57437
+ @Field(() => Float, { nullable: true })
57438
+ Latitude: number | null;
57439
+
57440
+ @Field(() => Float, { nullable: true })
57441
+ Longitude: number | null;
57442
+
57443
+ @Field({ nullable: true })
57444
+ Precision: string | null;
57445
+
57446
+ @Field({ nullable: true })
57447
+ CountryID: string | null;
57448
+
57449
+ @Field({ nullable: true })
57450
+ StateProvinceID: string | null;
57451
+
57452
+ @Field({ nullable: true })
57453
+ Status?: string;
57454
+
57455
+ @Field({ nullable: true })
57456
+ ErrorMessage: string | null;
57457
+
57458
+ @Field(() => Int, { nullable: true })
57459
+ RetryCount?: number;
57460
+
57461
+ @Field({ nullable: true })
57462
+ SourceFieldHash: string | null;
57463
+
57464
+ @Field({ nullable: true })
57465
+ GeocodedAt: Date | null;
57466
+
57467
+ @Field({ nullable: true })
57468
+ GeocodingSource: string | null;
57469
+ }
57470
+
57471
+
57472
+ //****************************************************************************
57473
+ // INPUT TYPE for MJ: Record Geo Codes
57474
+ //****************************************************************************
57475
+ @InputType()
57476
+ export class UpdateMJRecordGeoCodeInput {
57477
+ @Field()
57478
+ ID: string;
57479
+
57480
+ @Field({ nullable: true })
57481
+ EntityID?: string;
57482
+
57483
+ @Field({ nullable: true })
57484
+ RecordID?: string;
57485
+
57486
+ @Field({ nullable: true })
57487
+ LocationType?: string;
57488
+
57489
+ @Field(() => Float, { nullable: true })
57490
+ Latitude?: number | null;
57491
+
57492
+ @Field(() => Float, { nullable: true })
57493
+ Longitude?: number | null;
57494
+
57495
+ @Field({ nullable: true })
57496
+ Precision?: string | null;
57497
+
57498
+ @Field({ nullable: true })
57499
+ CountryID?: string | null;
57500
+
57501
+ @Field({ nullable: true })
57502
+ StateProvinceID?: string | null;
57503
+
57504
+ @Field({ nullable: true })
57505
+ Status?: string;
57506
+
57507
+ @Field({ nullable: true })
57508
+ ErrorMessage?: string | null;
57509
+
57510
+ @Field(() => Int, { nullable: true })
57511
+ RetryCount?: number;
57512
+
57513
+ @Field({ nullable: true })
57514
+ SourceFieldHash?: string | null;
57515
+
57516
+ @Field({ nullable: true })
57517
+ GeocodedAt?: Date | null;
57518
+
57519
+ @Field({ nullable: true })
57520
+ GeocodingSource?: string | null;
57521
+
57522
+ @Field(() => [KeyValuePairInput], { nullable: true })
57523
+ OldValues___?: KeyValuePairInput[];
57524
+ }
57525
+
57526
+ //****************************************************************************
57527
+ // RESOLVER for MJ: Record Geo Codes
57528
+ //****************************************************************************
57529
+ @ObjectType()
57530
+ export class RunMJRecordGeoCodeViewResult {
57531
+ @Field(() => [MJRecordGeoCode_])
57532
+ Results: MJRecordGeoCode_[];
57533
+
57534
+ @Field(() => String, {nullable: true})
57535
+ UserViewRunID?: string;
57536
+
57537
+ @Field(() => Int, {nullable: true})
57538
+ RowCount: number;
57539
+
57540
+ @Field(() => Int, {nullable: true})
57541
+ TotalRowCount: number;
57542
+
57543
+ @Field(() => Int, {nullable: true})
57544
+ ExecutionTime: number;
57545
+
57546
+ @Field({nullable: true})
57547
+ ErrorMessage?: string;
57548
+
57549
+ @Field(() => Boolean, {nullable: false})
57550
+ Success: boolean;
57551
+ }
57552
+
57553
+ @Resolver(MJRecordGeoCode_)
57554
+ export class MJRecordGeoCodeResolver extends ResolverBase {
57555
+ @Query(() => RunMJRecordGeoCodeViewResult)
57556
+ async RunMJRecordGeoCodeViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
57557
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
57558
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
57559
+ }
57560
+
57561
+ @Query(() => RunMJRecordGeoCodeViewResult)
57562
+ async RunMJRecordGeoCodeViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
57563
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
57564
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
57565
+ }
57566
+
57567
+ @Query(() => RunMJRecordGeoCodeViewResult)
57568
+ async RunMJRecordGeoCodeDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
57569
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
57570
+ input.EntityName = 'MJ: Record Geo Codes';
57571
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
57572
+ }
57573
+ @Query(() => MJRecordGeoCode_, { nullable: true })
57574
+ async MJRecordGeoCode(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJRecordGeoCode_ | null> {
57575
+ this.CheckUserReadPermissions('MJ: Record Geo Codes', userPayload);
57576
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
57577
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwRecordGeoCodes')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Record Geo Codes', userPayload, EntityPermissionType.Read, 'AND');
57578
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
57579
+ const result = await this.MapFieldNamesToCodeNames('MJ: Record Geo Codes', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
57580
+ return result;
57581
+ }
57582
+
57583
+ @Mutation(() => MJRecordGeoCode_)
57584
+ async CreateMJRecordGeoCode(
57585
+ @Arg('input', () => CreateMJRecordGeoCodeInput) input: CreateMJRecordGeoCodeInput,
57586
+ @Ctx() { providers, userPayload }: AppContext,
57587
+ @PubSub() pubSub: PubSubEngine
57588
+ ) {
57589
+ const provider = GetReadWriteProvider(providers);
57590
+ return this.CreateRecord('MJ: Record Geo Codes', input, provider, userPayload, pubSub)
57591
+ }
57592
+
57593
+ @Mutation(() => MJRecordGeoCode_)
57594
+ async UpdateMJRecordGeoCode(
57595
+ @Arg('input', () => UpdateMJRecordGeoCodeInput) input: UpdateMJRecordGeoCodeInput,
57596
+ @Ctx() { providers, userPayload }: AppContext,
57597
+ @PubSub() pubSub: PubSubEngine
57598
+ ) {
57599
+ const provider = GetReadWriteProvider(providers);
57600
+ return this.UpdateRecord('MJ: Record Geo Codes', input, provider, userPayload, pubSub);
57601
+ }
57602
+
57603
+ @Mutation(() => MJRecordGeoCode_)
57604
+ async DeleteMJRecordGeoCode(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
57605
+ const provider = GetReadWriteProvider(providers);
57606
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
57607
+ return this.DeleteRecord('MJ: Record Geo Codes', key, options, provider, userPayload, pubSub);
57608
+ }
57609
+
57610
+ }
57611
+
54974
57612
  //****************************************************************************
54975
57613
  // ENTITY CLASS for MJ: Record Links
54976
57614
  //****************************************************************************
@@ -57383,6 +60021,12 @@ export class MJRole_ {
57383
60021
  @Field(() => [MJMCPServerConnectionPermission_])
57384
60022
  MJMCPServerConnectionPermissions_RoleIDArray: MJMCPServerConnectionPermission_[]; // Link to MJMCPServerConnectionPermissions
57385
60023
 
60024
+ @Field(() => [MJFileStorageAccountPermission_])
60025
+ MJFileStorageAccountPermissions_RoleIDArray: MJFileStorageAccountPermission_[]; // Link to MJFileStorageAccountPermissions
60026
+
60027
+ @Field(() => [MJApplicationRole_])
60028
+ MJApplicationRoles_RoleIDArray: MJApplicationRole_[]; // Link to MJApplicationRoles
60029
+
57386
60030
  @Field(() => [MJAIAgentPermission_])
57387
60031
  MJAIAgentPermissions_RoleIDArray: MJAIAgentPermission_[]; // Link to MJAIAgentPermissions
57388
60032
 
@@ -57571,6 +60215,26 @@ export class MJRoleResolver extends ResolverBase {
57571
60215
  return result;
57572
60216
  }
57573
60217
 
60218
+ @FieldResolver(() => [MJFileStorageAccountPermission_])
60219
+ async MJFileStorageAccountPermissions_RoleIDArray(@Root() mjrole_: MJRole_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
60220
+ this.CheckUserReadPermissions('MJ: File Storage Account Permissions', userPayload);
60221
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
60222
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwFileStorageAccountPermissions')} WHERE ${provider.QuoteIdentifier('RoleID')}='${mjrole_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: File Storage Account Permissions', userPayload, EntityPermissionType.Read, 'AND');
60223
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
60224
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: File Storage Account Permissions', rows, this.GetUserFromPayload(userPayload));
60225
+ return result;
60226
+ }
60227
+
60228
+ @FieldResolver(() => [MJApplicationRole_])
60229
+ async MJApplicationRoles_RoleIDArray(@Root() mjrole_: MJRole_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
60230
+ this.CheckUserReadPermissions('MJ: Application Roles', userPayload);
60231
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
60232
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwApplicationRoles')} WHERE ${provider.QuoteIdentifier('RoleID')}='${mjrole_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Application Roles', userPayload, EntityPermissionType.Read, 'AND');
60233
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
60234
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Application Roles', rows, this.GetUserFromPayload(userPayload));
60235
+ return result;
60236
+ }
60237
+
57574
60238
  @FieldResolver(() => [MJAIAgentPermission_])
57575
60239
  async MJAIAgentPermissions_RoleIDArray(@Root() mjrole_: MJRole_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
57576
60240
  this.CheckUserReadPermissions('MJ: AI Agent Permissions', userPayload);
@@ -58081,6 +60745,9 @@ export class MJScheduledAction_ {
58081
60745
  @Field(() => [MJScheduledActionParam_])
58082
60746
  MJScheduledActionParams_ScheduledActionIDArray: MJScheduledActionParam_[]; // Link to MJScheduledActionParams
58083
60747
 
60748
+ @Field(() => [MJContentSource_])
60749
+ MJContentSources_ScheduledActionIDArray: MJContentSource_[]; // Link to MJContentSources
60750
+
58084
60751
  }
58085
60752
 
58086
60753
  //****************************************************************************
@@ -58250,6 +60917,16 @@ export class MJScheduledActionResolver extends ResolverBase {
58250
60917
  return result;
58251
60918
  }
58252
60919
 
60920
+ @FieldResolver(() => [MJContentSource_])
60921
+ async MJContentSources_ScheduledActionIDArray(@Root() mjscheduledaction_: MJScheduledAction_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
60922
+ this.CheckUserReadPermissions('MJ: Content Sources', userPayload);
60923
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
60924
+ 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');
60925
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
60926
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Sources', rows, this.GetUserFromPayload(userPayload));
60927
+ return result;
60928
+ }
60929
+
58253
60930
  @Mutation(() => MJScheduledAction_)
58254
60931
  async CreateMJScheduledAction(
58255
60932
  @Arg('input', () => CreateMJScheduledActionInput) input: CreateMJScheduledActionInput,
@@ -59307,6 +61984,249 @@ export class MJSchemaInfoResolver extends ResolverBase {
59307
61984
 
59308
61985
  }
59309
61986
 
61987
+ //****************************************************************************
61988
+ // ENTITY CLASS for MJ: Search Providers
61989
+ //****************************************************************************
61990
+ @ObjectType()
61991
+ export class MJSearchProvider_ {
61992
+ @Field()
61993
+ @MaxLength(36)
61994
+ ID: string;
61995
+
61996
+ @Field({description: `Display name for this search provider (e.g., "Vector Search", "Algolia")`})
61997
+ @MaxLength(200)
61998
+ Name: string;
61999
+
62000
+ @Field({nullable: true, description: `Human-readable description of what this provider searches and how it works`})
62001
+ Description?: string;
62002
+
62003
+ @Field({description: `ClassFactory key used with @RegisterClass(ISearchProvider, DriverClass) to instantiate the provider at runtime`})
62004
+ @MaxLength(500)
62005
+ DriverClass: string;
62006
+
62007
+ @Field({description: `Provider lifecycle status: Pending (not yet activated), Active (in use), Terminated (disabled)`})
62008
+ @MaxLength(20)
62009
+ Status: string;
62010
+
62011
+ @Field(() => Int, {description: `Execution priority (lower = higher priority). Controls provider ordering and can influence RRF weighting. Must be >= 0.`})
62012
+ Priority: number;
62013
+
62014
+ @Field(() => Boolean, {description: `Whether this provider should run during fast preview/autocomplete searches. Expensive providers (external APIs) may set this to 0.`})
62015
+ SupportsPreview: boolean;
62016
+
62017
+ @Field(() => Int, {nullable: true, description: `Optional per-provider cap on the number of results to return. Useful for rate-limited or pay-per-query external APIs. When NULL, uses the SearchEngine default.`})
62018
+ MaxResultsOverride?: number;
62019
+
62020
+ @Field({nullable: true, description: `Optional JSON configuration blob for provider-specific settings (e.g., API endpoints, index names, tuning parameters). Schema is provider-defined.`})
62021
+ ProviderConfig?: string;
62022
+
62023
+ @Field({nullable: true, description: `Optional FK to the Credential entity for providers that require authentication (e.g., Algolia API key, external service credentials)`})
62024
+ @MaxLength(36)
62025
+ CredentialID?: string;
62026
+
62027
+ @Field({nullable: true, description: `UI display name for this provider shown in filter facets and result grouping (e.g., "Database", "Semantic Search"). When NULL, falls back to the Name column.`})
62028
+ @MaxLength(200)
62029
+ DisplayName?: string;
62030
+
62031
+ @Field({nullable: true, description: `CSS icon class for UI display in filter facets and result badges (e.g., "fa-solid fa-database", "fa-solid fa-brain"). Supports any CSS-based icon library. When NULL, a default icon is used.`})
62032
+ @MaxLength(200)
62033
+ Icon?: string;
62034
+
62035
+ @Field({nullable: true, description: `Free-form notes about this provider configuration`})
62036
+ Comments?: string;
62037
+
62038
+ @Field()
62039
+ _mj__CreatedAt: Date;
62040
+
62041
+ @Field()
62042
+ _mj__UpdatedAt: Date;
62043
+
62044
+ @Field({nullable: true})
62045
+ @MaxLength(200)
62046
+ Credential?: string;
62047
+
62048
+ }
62049
+
62050
+ //****************************************************************************
62051
+ // INPUT TYPE for MJ: Search Providers
62052
+ //****************************************************************************
62053
+ @InputType()
62054
+ export class CreateMJSearchProviderInput {
62055
+ @Field({ nullable: true })
62056
+ ID?: string;
62057
+
62058
+ @Field({ nullable: true })
62059
+ Name?: string;
62060
+
62061
+ @Field({ nullable: true })
62062
+ Description: string | null;
62063
+
62064
+ @Field({ nullable: true })
62065
+ DriverClass?: string;
62066
+
62067
+ @Field({ nullable: true })
62068
+ Status?: string;
62069
+
62070
+ @Field(() => Int, { nullable: true })
62071
+ Priority?: number;
62072
+
62073
+ @Field(() => Boolean, { nullable: true })
62074
+ SupportsPreview?: boolean;
62075
+
62076
+ @Field(() => Int, { nullable: true })
62077
+ MaxResultsOverride: number | null;
62078
+
62079
+ @Field({ nullable: true })
62080
+ ProviderConfig: string | null;
62081
+
62082
+ @Field({ nullable: true })
62083
+ CredentialID: string | null;
62084
+
62085
+ @Field({ nullable: true })
62086
+ DisplayName: string | null;
62087
+
62088
+ @Field({ nullable: true })
62089
+ Icon: string | null;
62090
+
62091
+ @Field({ nullable: true })
62092
+ Comments: string | null;
62093
+ }
62094
+
62095
+
62096
+ //****************************************************************************
62097
+ // INPUT TYPE for MJ: Search Providers
62098
+ //****************************************************************************
62099
+ @InputType()
62100
+ export class UpdateMJSearchProviderInput {
62101
+ @Field()
62102
+ ID: string;
62103
+
62104
+ @Field({ nullable: true })
62105
+ Name?: string;
62106
+
62107
+ @Field({ nullable: true })
62108
+ Description?: string | null;
62109
+
62110
+ @Field({ nullable: true })
62111
+ DriverClass?: string;
62112
+
62113
+ @Field({ nullable: true })
62114
+ Status?: string;
62115
+
62116
+ @Field(() => Int, { nullable: true })
62117
+ Priority?: number;
62118
+
62119
+ @Field(() => Boolean, { nullable: true })
62120
+ SupportsPreview?: boolean;
62121
+
62122
+ @Field(() => Int, { nullable: true })
62123
+ MaxResultsOverride?: number | null;
62124
+
62125
+ @Field({ nullable: true })
62126
+ ProviderConfig?: string | null;
62127
+
62128
+ @Field({ nullable: true })
62129
+ CredentialID?: string | null;
62130
+
62131
+ @Field({ nullable: true })
62132
+ DisplayName?: string | null;
62133
+
62134
+ @Field({ nullable: true })
62135
+ Icon?: string | null;
62136
+
62137
+ @Field({ nullable: true })
62138
+ Comments?: string | null;
62139
+
62140
+ @Field(() => [KeyValuePairInput], { nullable: true })
62141
+ OldValues___?: KeyValuePairInput[];
62142
+ }
62143
+
62144
+ //****************************************************************************
62145
+ // RESOLVER for MJ: Search Providers
62146
+ //****************************************************************************
62147
+ @ObjectType()
62148
+ export class RunMJSearchProviderViewResult {
62149
+ @Field(() => [MJSearchProvider_])
62150
+ Results: MJSearchProvider_[];
62151
+
62152
+ @Field(() => String, {nullable: true})
62153
+ UserViewRunID?: string;
62154
+
62155
+ @Field(() => Int, {nullable: true})
62156
+ RowCount: number;
62157
+
62158
+ @Field(() => Int, {nullable: true})
62159
+ TotalRowCount: number;
62160
+
62161
+ @Field(() => Int, {nullable: true})
62162
+ ExecutionTime: number;
62163
+
62164
+ @Field({nullable: true})
62165
+ ErrorMessage?: string;
62166
+
62167
+ @Field(() => Boolean, {nullable: false})
62168
+ Success: boolean;
62169
+ }
62170
+
62171
+ @Resolver(MJSearchProvider_)
62172
+ export class MJSearchProviderResolver extends ResolverBase {
62173
+ @Query(() => RunMJSearchProviderViewResult)
62174
+ async RunMJSearchProviderViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
62175
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
62176
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
62177
+ }
62178
+
62179
+ @Query(() => RunMJSearchProviderViewResult)
62180
+ async RunMJSearchProviderViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
62181
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
62182
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
62183
+ }
62184
+
62185
+ @Query(() => RunMJSearchProviderViewResult)
62186
+ async RunMJSearchProviderDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
62187
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
62188
+ input.EntityName = 'MJ: Search Providers';
62189
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
62190
+ }
62191
+ @Query(() => MJSearchProvider_, { nullable: true })
62192
+ async MJSearchProvider(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJSearchProvider_ | null> {
62193
+ this.CheckUserReadPermissions('MJ: Search Providers', userPayload);
62194
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
62195
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwSearchProviders')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Search Providers', userPayload, EntityPermissionType.Read, 'AND');
62196
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
62197
+ const result = await this.MapFieldNamesToCodeNames('MJ: Search Providers', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
62198
+ return result;
62199
+ }
62200
+
62201
+ @Mutation(() => MJSearchProvider_)
62202
+ async CreateMJSearchProvider(
62203
+ @Arg('input', () => CreateMJSearchProviderInput) input: CreateMJSearchProviderInput,
62204
+ @Ctx() { providers, userPayload }: AppContext,
62205
+ @PubSub() pubSub: PubSubEngine
62206
+ ) {
62207
+ const provider = GetReadWriteProvider(providers);
62208
+ return this.CreateRecord('MJ: Search Providers', input, provider, userPayload, pubSub)
62209
+ }
62210
+
62211
+ @Mutation(() => MJSearchProvider_)
62212
+ async UpdateMJSearchProvider(
62213
+ @Arg('input', () => UpdateMJSearchProviderInput) input: UpdateMJSearchProviderInput,
62214
+ @Ctx() { providers, userPayload }: AppContext,
62215
+ @PubSub() pubSub: PubSubEngine
62216
+ ) {
62217
+ const provider = GetReadWriteProvider(providers);
62218
+ return this.UpdateRecord('MJ: Search Providers', input, provider, userPayload, pubSub);
62219
+ }
62220
+
62221
+ @Mutation(() => MJSearchProvider_)
62222
+ async DeleteMJSearchProvider(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
62223
+ const provider = GetReadWriteProvider(providers);
62224
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
62225
+ return this.DeleteRecord('MJ: Search Providers', key, options, provider, userPayload, pubSub);
62226
+ }
62227
+
62228
+ }
62229
+
59310
62230
  //****************************************************************************
59311
62231
  // ENTITY CLASS for MJ: Skills
59312
62232
  //****************************************************************************
@@ -59726,6 +62646,581 @@ export class MJSQLDialectResolver extends ResolverBase {
59726
62646
 
59727
62647
  }
59728
62648
 
62649
+ //****************************************************************************
62650
+ // ENTITY CLASS for MJ: State Provinces
62651
+ //****************************************************************************
62652
+ @ObjectType({ description: `Reference table for states, provinces, and first-level administrative divisions. Linked to Country via FK. Seeded with ~5,000 records with ISO 3166-2 codes, centroids, and optional boundary GeoJSON.` })
62653
+ export class MJStateProvince_ {
62654
+ @Field()
62655
+ @MaxLength(36)
62656
+ ID: string;
62657
+
62658
+ @Field({description: `Foreign key to Country. Establishes the parent country for this state/province.`})
62659
+ @MaxLength(36)
62660
+ CountryID: string;
62661
+
62662
+ @Field({description: `Full state/province name (e.g., "California", "Ontario").`})
62663
+ @MaxLength(200)
62664
+ Name: string;
62665
+
62666
+ @Field({description: `Short code within the country (e.g., "CA", "ON"). Unique per country via compound constraint.`})
62667
+ @MaxLength(10)
62668
+ Code: string;
62669
+
62670
+ @Field({description: `ISO 3166-2 subdivision code (e.g., "US-CA", "CA-ON"). Globally unique.`})
62671
+ @MaxLength(10)
62672
+ ISO3166_2: string;
62673
+
62674
+ @Field(() => Float, {nullable: true, description: `Geographic centroid latitude. Used as fallback point for state-level geocoding.`})
62675
+ Latitude?: number;
62676
+
62677
+ @Field(() => Float, {nullable: true, description: `Geographic centroid longitude. Used as fallback point for state-level geocoding.`})
62678
+ Longitude?: number;
62679
+
62680
+ @Field({nullable: true, description: `Medium-resolution (~50m) GeoJSON boundary polygon for choropleth map rendering. Nullable. Total ~15-20MB for all states/provinces worldwide.`})
62681
+ BoundaryGeoJSON?: string;
62682
+
62683
+ @Field({nullable: true, description: `JSON array of common aliases (e.g., ["Calif.","California","Cal"]). Used by GeoResolver for fuzzy text-to-state matching.`})
62684
+ CommonAliases?: string;
62685
+
62686
+ @Field()
62687
+ _mj__CreatedAt: Date;
62688
+
62689
+ @Field()
62690
+ _mj__UpdatedAt: Date;
62691
+
62692
+ @Field()
62693
+ @MaxLength(200)
62694
+ Country: string;
62695
+
62696
+ @Field(() => [MJRecordGeoCode_])
62697
+ MJRecordGeoCodes_StateProvinceIDArray: MJRecordGeoCode_[]; // Link to MJRecordGeoCodes
62698
+
62699
+ }
62700
+
62701
+ //****************************************************************************
62702
+ // INPUT TYPE for MJ: State Provinces
62703
+ //****************************************************************************
62704
+ @InputType()
62705
+ export class CreateMJStateProvinceInput {
62706
+ @Field({ nullable: true })
62707
+ ID?: string;
62708
+
62709
+ @Field({ nullable: true })
62710
+ CountryID?: string;
62711
+
62712
+ @Field({ nullable: true })
62713
+ Name?: string;
62714
+
62715
+ @Field({ nullable: true })
62716
+ Code?: string;
62717
+
62718
+ @Field({ nullable: true })
62719
+ ISO3166_2?: string;
62720
+
62721
+ @Field(() => Float, { nullable: true })
62722
+ Latitude: number | null;
62723
+
62724
+ @Field(() => Float, { nullable: true })
62725
+ Longitude: number | null;
62726
+
62727
+ @Field({ nullable: true })
62728
+ BoundaryGeoJSON: string | null;
62729
+
62730
+ @Field({ nullable: true })
62731
+ CommonAliases: string | null;
62732
+ }
62733
+
62734
+
62735
+ //****************************************************************************
62736
+ // INPUT TYPE for MJ: State Provinces
62737
+ //****************************************************************************
62738
+ @InputType()
62739
+ export class UpdateMJStateProvinceInput {
62740
+ @Field()
62741
+ ID: string;
62742
+
62743
+ @Field({ nullable: true })
62744
+ CountryID?: string;
62745
+
62746
+ @Field({ nullable: true })
62747
+ Name?: string;
62748
+
62749
+ @Field({ nullable: true })
62750
+ Code?: string;
62751
+
62752
+ @Field({ nullable: true })
62753
+ ISO3166_2?: string;
62754
+
62755
+ @Field(() => Float, { nullable: true })
62756
+ Latitude?: number | null;
62757
+
62758
+ @Field(() => Float, { nullable: true })
62759
+ Longitude?: number | null;
62760
+
62761
+ @Field({ nullable: true })
62762
+ BoundaryGeoJSON?: string | null;
62763
+
62764
+ @Field({ nullable: true })
62765
+ CommonAliases?: string | null;
62766
+
62767
+ @Field(() => [KeyValuePairInput], { nullable: true })
62768
+ OldValues___?: KeyValuePairInput[];
62769
+ }
62770
+
62771
+ //****************************************************************************
62772
+ // RESOLVER for MJ: State Provinces
62773
+ //****************************************************************************
62774
+ @ObjectType()
62775
+ export class RunMJStateProvinceViewResult {
62776
+ @Field(() => [MJStateProvince_])
62777
+ Results: MJStateProvince_[];
62778
+
62779
+ @Field(() => String, {nullable: true})
62780
+ UserViewRunID?: string;
62781
+
62782
+ @Field(() => Int, {nullable: true})
62783
+ RowCount: number;
62784
+
62785
+ @Field(() => Int, {nullable: true})
62786
+ TotalRowCount: number;
62787
+
62788
+ @Field(() => Int, {nullable: true})
62789
+ ExecutionTime: number;
62790
+
62791
+ @Field({nullable: true})
62792
+ ErrorMessage?: string;
62793
+
62794
+ @Field(() => Boolean, {nullable: false})
62795
+ Success: boolean;
62796
+ }
62797
+
62798
+ @Resolver(MJStateProvince_)
62799
+ export class MJStateProvinceResolver extends ResolverBase {
62800
+ @Query(() => RunMJStateProvinceViewResult)
62801
+ async RunMJStateProvinceViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
62802
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
62803
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
62804
+ }
62805
+
62806
+ @Query(() => RunMJStateProvinceViewResult)
62807
+ async RunMJStateProvinceViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
62808
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
62809
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
62810
+ }
62811
+
62812
+ @Query(() => RunMJStateProvinceViewResult)
62813
+ async RunMJStateProvinceDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
62814
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
62815
+ input.EntityName = 'MJ: State Provinces';
62816
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
62817
+ }
62818
+ @Query(() => MJStateProvince_, { nullable: true })
62819
+ async MJStateProvince(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJStateProvince_ | null> {
62820
+ this.CheckUserReadPermissions('MJ: State Provinces', userPayload);
62821
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
62822
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwStateProvinces')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: State Provinces', userPayload, EntityPermissionType.Read, 'AND');
62823
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
62824
+ const result = await this.MapFieldNamesToCodeNames('MJ: State Provinces', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
62825
+ return result;
62826
+ }
62827
+
62828
+ @FieldResolver(() => [MJRecordGeoCode_])
62829
+ async MJRecordGeoCodes_StateProvinceIDArray(@Root() mjstateprovince_: MJStateProvince_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
62830
+ this.CheckUserReadPermissions('MJ: Record Geo Codes', userPayload);
62831
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
62832
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwRecordGeoCodes')} WHERE ${provider.QuoteIdentifier('StateProvinceID')}='${mjstateprovince_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Record Geo Codes', userPayload, EntityPermissionType.Read, 'AND');
62833
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
62834
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Record Geo Codes', rows, this.GetUserFromPayload(userPayload));
62835
+ return result;
62836
+ }
62837
+
62838
+ @Mutation(() => MJStateProvince_)
62839
+ async CreateMJStateProvince(
62840
+ @Arg('input', () => CreateMJStateProvinceInput) input: CreateMJStateProvinceInput,
62841
+ @Ctx() { providers, userPayload }: AppContext,
62842
+ @PubSub() pubSub: PubSubEngine
62843
+ ) {
62844
+ const provider = GetReadWriteProvider(providers);
62845
+ return this.CreateRecord('MJ: State Provinces', input, provider, userPayload, pubSub)
62846
+ }
62847
+
62848
+ @Mutation(() => MJStateProvince_)
62849
+ async UpdateMJStateProvince(
62850
+ @Arg('input', () => UpdateMJStateProvinceInput) input: UpdateMJStateProvinceInput,
62851
+ @Ctx() { providers, userPayload }: AppContext,
62852
+ @PubSub() pubSub: PubSubEngine
62853
+ ) {
62854
+ const provider = GetReadWriteProvider(providers);
62855
+ return this.UpdateRecord('MJ: State Provinces', input, provider, userPayload, pubSub);
62856
+ }
62857
+
62858
+ @Mutation(() => MJStateProvince_)
62859
+ async DeleteMJStateProvince(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
62860
+ const provider = GetReadWriteProvider(providers);
62861
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
62862
+ return this.DeleteRecord('MJ: State Provinces', key, options, provider, userPayload, pubSub);
62863
+ }
62864
+
62865
+ }
62866
+
62867
+ //****************************************************************************
62868
+ // ENTITY CLASS for MJ: Tag Audit Logs
62869
+ //****************************************************************************
62870
+ @ObjectType({ description: `Immutable audit trail for all tag taxonomy changes. Each row records a single action with before/after details in JSON.` })
62871
+ export class MJTagAuditLog_ {
62872
+ @Field()
62873
+ @MaxLength(36)
62874
+ ID: string;
62875
+
62876
+ @Field({description: `The tag that was acted upon.`})
62877
+ @MaxLength(36)
62878
+ TagID: string;
62879
+
62880
+ @Field({description: `The type of action performed: Created, Renamed, Moved (parent changed), Merged (into RelatedTagID), Split (from RelatedTagID), Deprecated, Reactivated, Deleted, DescriptionChanged.`})
62881
+ @MaxLength(30)
62882
+ Action: string;
62883
+
62884
+ @Field({nullable: true, description: `JSON object with action-specific details. For Renamed: {"OldName":"...","NewName":"..."}. For Moved: {"OldParentID":"...","NewParentID":"..."}. For Merged: {"ItemsMoved":42}.`})
62885
+ Details?: string;
62886
+
62887
+ @Field({description: `User who performed the action.`})
62888
+ @MaxLength(36)
62889
+ PerformedByUserID: string;
62890
+
62891
+ @Field({nullable: true, description: `For Merged actions: the surviving tag. For Split actions: the source tag. NULL for other actions.`})
62892
+ @MaxLength(36)
62893
+ RelatedTagID?: string;
62894
+
62895
+ @Field()
62896
+ _mj__CreatedAt: Date;
62897
+
62898
+ @Field()
62899
+ _mj__UpdatedAt: Date;
62900
+
62901
+ @Field()
62902
+ @MaxLength(255)
62903
+ Tag: string;
62904
+
62905
+ @Field()
62906
+ @MaxLength(100)
62907
+ PerformedByUser: string;
62908
+
62909
+ @Field({nullable: true})
62910
+ @MaxLength(255)
62911
+ RelatedTag?: string;
62912
+
62913
+ }
62914
+
62915
+ //****************************************************************************
62916
+ // INPUT TYPE for MJ: Tag Audit Logs
62917
+ //****************************************************************************
62918
+ @InputType()
62919
+ export class CreateMJTagAuditLogInput {
62920
+ @Field({ nullable: true })
62921
+ ID?: string;
62922
+
62923
+ @Field({ nullable: true })
62924
+ TagID?: string;
62925
+
62926
+ @Field({ nullable: true })
62927
+ Action?: string;
62928
+
62929
+ @Field({ nullable: true })
62930
+ Details: string | null;
62931
+
62932
+ @Field({ nullable: true })
62933
+ PerformedByUserID?: string;
62934
+
62935
+ @Field({ nullable: true })
62936
+ RelatedTagID: string | null;
62937
+ }
62938
+
62939
+
62940
+ //****************************************************************************
62941
+ // INPUT TYPE for MJ: Tag Audit Logs
62942
+ //****************************************************************************
62943
+ @InputType()
62944
+ export class UpdateMJTagAuditLogInput {
62945
+ @Field()
62946
+ ID: string;
62947
+
62948
+ @Field({ nullable: true })
62949
+ TagID?: string;
62950
+
62951
+ @Field({ nullable: true })
62952
+ Action?: string;
62953
+
62954
+ @Field({ nullable: true })
62955
+ Details?: string | null;
62956
+
62957
+ @Field({ nullable: true })
62958
+ PerformedByUserID?: string;
62959
+
62960
+ @Field({ nullable: true })
62961
+ RelatedTagID?: string | null;
62962
+
62963
+ @Field(() => [KeyValuePairInput], { nullable: true })
62964
+ OldValues___?: KeyValuePairInput[];
62965
+ }
62966
+
62967
+ //****************************************************************************
62968
+ // RESOLVER for MJ: Tag Audit Logs
62969
+ //****************************************************************************
62970
+ @ObjectType()
62971
+ export class RunMJTagAuditLogViewResult {
62972
+ @Field(() => [MJTagAuditLog_])
62973
+ Results: MJTagAuditLog_[];
62974
+
62975
+ @Field(() => String, {nullable: true})
62976
+ UserViewRunID?: string;
62977
+
62978
+ @Field(() => Int, {nullable: true})
62979
+ RowCount: number;
62980
+
62981
+ @Field(() => Int, {nullable: true})
62982
+ TotalRowCount: number;
62983
+
62984
+ @Field(() => Int, {nullable: true})
62985
+ ExecutionTime: number;
62986
+
62987
+ @Field({nullable: true})
62988
+ ErrorMessage?: string;
62989
+
62990
+ @Field(() => Boolean, {nullable: false})
62991
+ Success: boolean;
62992
+ }
62993
+
62994
+ @Resolver(MJTagAuditLog_)
62995
+ export class MJTagAuditLogResolver extends ResolverBase {
62996
+ @Query(() => RunMJTagAuditLogViewResult)
62997
+ async RunMJTagAuditLogViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
62998
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
62999
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
63000
+ }
63001
+
63002
+ @Query(() => RunMJTagAuditLogViewResult)
63003
+ async RunMJTagAuditLogViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
63004
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
63005
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
63006
+ }
63007
+
63008
+ @Query(() => RunMJTagAuditLogViewResult)
63009
+ async RunMJTagAuditLogDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
63010
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
63011
+ input.EntityName = 'MJ: Tag Audit Logs';
63012
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
63013
+ }
63014
+ @Query(() => MJTagAuditLog_, { nullable: true })
63015
+ async MJTagAuditLog(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJTagAuditLog_ | null> {
63016
+ this.CheckUserReadPermissions('MJ: Tag Audit Logs', userPayload);
63017
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
63018
+ 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');
63019
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
63020
+ const result = await this.MapFieldNamesToCodeNames('MJ: Tag Audit Logs', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
63021
+ return result;
63022
+ }
63023
+
63024
+ @Mutation(() => MJTagAuditLog_)
63025
+ async CreateMJTagAuditLog(
63026
+ @Arg('input', () => CreateMJTagAuditLogInput) input: CreateMJTagAuditLogInput,
63027
+ @Ctx() { providers, userPayload }: AppContext,
63028
+ @PubSub() pubSub: PubSubEngine
63029
+ ) {
63030
+ const provider = GetReadWriteProvider(providers);
63031
+ return this.CreateRecord('MJ: Tag Audit Logs', input, provider, userPayload, pubSub)
63032
+ }
63033
+
63034
+ @Mutation(() => MJTagAuditLog_)
63035
+ async UpdateMJTagAuditLog(
63036
+ @Arg('input', () => UpdateMJTagAuditLogInput) input: UpdateMJTagAuditLogInput,
63037
+ @Ctx() { providers, userPayload }: AppContext,
63038
+ @PubSub() pubSub: PubSubEngine
63039
+ ) {
63040
+ const provider = GetReadWriteProvider(providers);
63041
+ return this.UpdateRecord('MJ: Tag Audit Logs', input, provider, userPayload, pubSub);
63042
+ }
63043
+
63044
+ @Mutation(() => MJTagAuditLog_)
63045
+ async DeleteMJTagAuditLog(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
63046
+ const provider = GetReadWriteProvider(providers);
63047
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
63048
+ return this.DeleteRecord('MJ: Tag Audit Logs', key, options, provider, userPayload, pubSub);
63049
+ }
63050
+
63051
+ }
63052
+
63053
+ //****************************************************************************
63054
+ // ENTITY CLASS for MJ: Tag Co Occurrences
63055
+ //****************************************************************************
63056
+ @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.` })
63057
+ export class MJTagCoOccurrence_ {
63058
+ @Field()
63059
+ @MaxLength(36)
63060
+ ID: string;
63061
+
63062
+ @Field({description: `First tag in the canonical pair (TagAID < TagBID ensures each pair is stored exactly once).`})
63063
+ @MaxLength(36)
63064
+ TagAID: string;
63065
+
63066
+ @Field()
63067
+ @MaxLength(36)
63068
+ TagBID: string;
63069
+
63070
+ @Field(() => Int, {description: `Number of content items (or entity records via TaggedItem) that are tagged with both TagA and TagB.`})
63071
+ CoOccurrenceCount: number;
63072
+
63073
+ @Field()
63074
+ LastComputedAt: Date;
63075
+
63076
+ @Field()
63077
+ _mj__CreatedAt: Date;
63078
+
63079
+ @Field()
63080
+ _mj__UpdatedAt: Date;
63081
+
63082
+ @Field()
63083
+ @MaxLength(255)
63084
+ TagA: string;
63085
+
63086
+ @Field()
63087
+ @MaxLength(255)
63088
+ TagB: string;
63089
+
63090
+ }
63091
+
63092
+ //****************************************************************************
63093
+ // INPUT TYPE for MJ: Tag Co Occurrences
63094
+ //****************************************************************************
63095
+ @InputType()
63096
+ export class CreateMJTagCoOccurrenceInput {
63097
+ @Field({ nullable: true })
63098
+ ID?: string;
63099
+
63100
+ @Field({ nullable: true })
63101
+ TagAID?: string;
63102
+
63103
+ @Field({ nullable: true })
63104
+ TagBID?: string;
63105
+
63106
+ @Field(() => Int, { nullable: true })
63107
+ CoOccurrenceCount?: number;
63108
+
63109
+ @Field({ nullable: true })
63110
+ LastComputedAt?: Date;
63111
+ }
63112
+
63113
+
63114
+ //****************************************************************************
63115
+ // INPUT TYPE for MJ: Tag Co Occurrences
63116
+ //****************************************************************************
63117
+ @InputType()
63118
+ export class UpdateMJTagCoOccurrenceInput {
63119
+ @Field()
63120
+ ID: string;
63121
+
63122
+ @Field({ nullable: true })
63123
+ TagAID?: string;
63124
+
63125
+ @Field({ nullable: true })
63126
+ TagBID?: string;
63127
+
63128
+ @Field(() => Int, { nullable: true })
63129
+ CoOccurrenceCount?: number;
63130
+
63131
+ @Field({ nullable: true })
63132
+ LastComputedAt?: Date;
63133
+
63134
+ @Field(() => [KeyValuePairInput], { nullable: true })
63135
+ OldValues___?: KeyValuePairInput[];
63136
+ }
63137
+
63138
+ //****************************************************************************
63139
+ // RESOLVER for MJ: Tag Co Occurrences
63140
+ //****************************************************************************
63141
+ @ObjectType()
63142
+ export class RunMJTagCoOccurrenceViewResult {
63143
+ @Field(() => [MJTagCoOccurrence_])
63144
+ Results: MJTagCoOccurrence_[];
63145
+
63146
+ @Field(() => String, {nullable: true})
63147
+ UserViewRunID?: string;
63148
+
63149
+ @Field(() => Int, {nullable: true})
63150
+ RowCount: number;
63151
+
63152
+ @Field(() => Int, {nullable: true})
63153
+ TotalRowCount: number;
63154
+
63155
+ @Field(() => Int, {nullable: true})
63156
+ ExecutionTime: number;
63157
+
63158
+ @Field({nullable: true})
63159
+ ErrorMessage?: string;
63160
+
63161
+ @Field(() => Boolean, {nullable: false})
63162
+ Success: boolean;
63163
+ }
63164
+
63165
+ @Resolver(MJTagCoOccurrence_)
63166
+ export class MJTagCoOccurrenceResolver extends ResolverBase {
63167
+ @Query(() => RunMJTagCoOccurrenceViewResult)
63168
+ async RunMJTagCoOccurrenceViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
63169
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
63170
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
63171
+ }
63172
+
63173
+ @Query(() => RunMJTagCoOccurrenceViewResult)
63174
+ async RunMJTagCoOccurrenceViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
63175
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
63176
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
63177
+ }
63178
+
63179
+ @Query(() => RunMJTagCoOccurrenceViewResult)
63180
+ async RunMJTagCoOccurrenceDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
63181
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
63182
+ input.EntityName = 'MJ: Tag Co Occurrences';
63183
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
63184
+ }
63185
+ @Query(() => MJTagCoOccurrence_, { nullable: true })
63186
+ async MJTagCoOccurrence(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJTagCoOccurrence_ | null> {
63187
+ this.CheckUserReadPermissions('MJ: Tag Co Occurrences', userPayload);
63188
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
63189
+ 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');
63190
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
63191
+ const result = await this.MapFieldNamesToCodeNames('MJ: Tag Co Occurrences', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
63192
+ return result;
63193
+ }
63194
+
63195
+ @Mutation(() => MJTagCoOccurrence_)
63196
+ async CreateMJTagCoOccurrence(
63197
+ @Arg('input', () => CreateMJTagCoOccurrenceInput) input: CreateMJTagCoOccurrenceInput,
63198
+ @Ctx() { providers, userPayload }: AppContext,
63199
+ @PubSub() pubSub: PubSubEngine
63200
+ ) {
63201
+ const provider = GetReadWriteProvider(providers);
63202
+ return this.CreateRecord('MJ: Tag Co Occurrences', input, provider, userPayload, pubSub)
63203
+ }
63204
+
63205
+ @Mutation(() => MJTagCoOccurrence_)
63206
+ async UpdateMJTagCoOccurrence(
63207
+ @Arg('input', () => UpdateMJTagCoOccurrenceInput) input: UpdateMJTagCoOccurrenceInput,
63208
+ @Ctx() { providers, userPayload }: AppContext,
63209
+ @PubSub() pubSub: PubSubEngine
63210
+ ) {
63211
+ const provider = GetReadWriteProvider(providers);
63212
+ return this.UpdateRecord('MJ: Tag Co Occurrences', input, provider, userPayload, pubSub);
63213
+ }
63214
+
63215
+ @Mutation(() => MJTagCoOccurrence_)
63216
+ async DeleteMJTagCoOccurrence(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
63217
+ const provider = GetReadWriteProvider(providers);
63218
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
63219
+ return this.DeleteRecord('MJ: Tag Co Occurrences', key, options, provider, userPayload, pubSub);
63220
+ }
63221
+
63222
+ }
63223
+
59729
63224
  //****************************************************************************
59730
63225
  // ENTITY CLASS for MJ: Tagged Items
59731
63226
  //****************************************************************************
@@ -59753,6 +63248,9 @@ export class MJTaggedItem_ {
59753
63248
  @Field()
59754
63249
  _mj__UpdatedAt: Date;
59755
63250
 
63251
+ @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.`})
63252
+ Weight: number;
63253
+
59756
63254
  @Field()
59757
63255
  @MaxLength(255)
59758
63256
  Tag: string;
@@ -59779,6 +63277,9 @@ export class CreateMJTaggedItemInput {
59779
63277
 
59780
63278
  @Field({ nullable: true })
59781
63279
  RecordID?: string;
63280
+
63281
+ @Field(() => Float, { nullable: true })
63282
+ Weight?: number;
59782
63283
  }
59783
63284
 
59784
63285
 
@@ -59799,6 +63300,9 @@ export class UpdateMJTaggedItemInput {
59799
63300
  @Field({ nullable: true })
59800
63301
  RecordID?: string;
59801
63302
 
63303
+ @Field(() => Float, { nullable: true })
63304
+ Weight?: number;
63305
+
59802
63306
  @Field(() => [KeyValuePairInput], { nullable: true })
59803
63307
  OldValues___?: KeyValuePairInput[];
59804
63308
  }
@@ -59919,20 +63423,54 @@ export class MJTag_ {
59919
63423
  @Field()
59920
63424
  _mj__UpdatedAt: Date;
59921
63425
 
63426
+ @Field({description: `Lifecycle status of the tag: Active (in use), Merged (consolidated into another tag), Deprecated (no longer assigned but preserved), Deleted (soft-deleted).`})
63427
+ @MaxLength(20)
63428
+ Status: string;
63429
+
63430
+ @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.`})
63431
+ @MaxLength(36)
63432
+ MergedIntoTagID?: string;
63433
+
59922
63434
  @Field({nullable: true})
59923
63435
  @MaxLength(255)
59924
63436
  Parent?: string;
59925
63437
 
63438
+ @Field({nullable: true})
63439
+ @MaxLength(255)
63440
+ MergedIntoTag?: string;
63441
+
59926
63442
  @Field({nullable: true})
59927
63443
  @MaxLength(36)
59928
63444
  RootParentID?: string;
59929
63445
 
63446
+ @Field({nullable: true})
63447
+ @MaxLength(36)
63448
+ RootMergedIntoTagID?: string;
63449
+
59930
63450
  @Field(() => [MJTag_])
59931
63451
  MJTags_ParentIDArray: MJTag_[]; // Link to MJTags
59932
63452
 
59933
63453
  @Field(() => [MJTaggedItem_])
59934
63454
  MJTaggedItems_TagIDArray: MJTaggedItem_[]; // Link to MJTaggedItems
59935
63455
 
63456
+ @Field(() => [MJContentItemTag_])
63457
+ MJContentItemTags_TagIDArray: MJContentItemTag_[]; // Link to MJContentItemTags
63458
+
63459
+ @Field(() => [MJTagCoOccurrence_])
63460
+ MJTagCoOccurrences_TagBIDArray: MJTagCoOccurrence_[]; // Link to MJTagCoOccurrences
63461
+
63462
+ @Field(() => [MJTagAuditLog_])
63463
+ MJTagAuditLogs_RelatedTagIDArray: MJTagAuditLog_[]; // Link to MJTagAuditLogs
63464
+
63465
+ @Field(() => [MJTagCoOccurrence_])
63466
+ MJTagCoOccurrences_TagAIDArray: MJTagCoOccurrence_[]; // Link to MJTagCoOccurrences
63467
+
63468
+ @Field(() => [MJTagAuditLog_])
63469
+ MJTagAuditLogs_TagIDArray: MJTagAuditLog_[]; // Link to MJTagAuditLogs
63470
+
63471
+ @Field(() => [MJTag_])
63472
+ MJTags_MergedIntoTagIDArray: MJTag_[]; // Link to MJTags
63473
+
59936
63474
  }
59937
63475
 
59938
63476
  //****************************************************************************
@@ -59954,6 +63492,12 @@ export class CreateMJTagInput {
59954
63492
 
59955
63493
  @Field({ nullable: true })
59956
63494
  Description: string | null;
63495
+
63496
+ @Field({ nullable: true })
63497
+ Status?: string;
63498
+
63499
+ @Field({ nullable: true })
63500
+ MergedIntoTagID: string | null;
59957
63501
  }
59958
63502
 
59959
63503
 
@@ -59977,6 +63521,12 @@ export class UpdateMJTagInput {
59977
63521
  @Field({ nullable: true })
59978
63522
  Description?: string | null;
59979
63523
 
63524
+ @Field({ nullable: true })
63525
+ Status?: string;
63526
+
63527
+ @Field({ nullable: true })
63528
+ MergedIntoTagID?: string | null;
63529
+
59980
63530
  @Field(() => [KeyValuePairInput], { nullable: true })
59981
63531
  OldValues___?: KeyValuePairInput[];
59982
63532
  }
@@ -60058,6 +63608,66 @@ export class MJTagResolver extends ResolverBase {
60058
63608
  return result;
60059
63609
  }
60060
63610
 
63611
+ @FieldResolver(() => [MJContentItemTag_])
63612
+ async MJContentItemTags_TagIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
63613
+ this.CheckUserReadPermissions('MJ: Content Item Tags', userPayload);
63614
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
63615
+ 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');
63616
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
63617
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Item Tags', rows, this.GetUserFromPayload(userPayload));
63618
+ return result;
63619
+ }
63620
+
63621
+ @FieldResolver(() => [MJTagCoOccurrence_])
63622
+ async MJTagCoOccurrences_TagBIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
63623
+ this.CheckUserReadPermissions('MJ: Tag Co Occurrences', userPayload);
63624
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
63625
+ 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');
63626
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
63627
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Tag Co Occurrences', rows, this.GetUserFromPayload(userPayload));
63628
+ return result;
63629
+ }
63630
+
63631
+ @FieldResolver(() => [MJTagAuditLog_])
63632
+ async MJTagAuditLogs_RelatedTagIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
63633
+ this.CheckUserReadPermissions('MJ: Tag Audit Logs', userPayload);
63634
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
63635
+ 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');
63636
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
63637
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Tag Audit Logs', rows, this.GetUserFromPayload(userPayload));
63638
+ return result;
63639
+ }
63640
+
63641
+ @FieldResolver(() => [MJTagCoOccurrence_])
63642
+ async MJTagCoOccurrences_TagAIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
63643
+ this.CheckUserReadPermissions('MJ: Tag Co Occurrences', userPayload);
63644
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
63645
+ 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');
63646
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
63647
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Tag Co Occurrences', rows, this.GetUserFromPayload(userPayload));
63648
+ return result;
63649
+ }
63650
+
63651
+ @FieldResolver(() => [MJTagAuditLog_])
63652
+ async MJTagAuditLogs_TagIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
63653
+ this.CheckUserReadPermissions('MJ: Tag Audit Logs', userPayload);
63654
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
63655
+ 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');
63656
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
63657
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Tag Audit Logs', rows, this.GetUserFromPayload(userPayload));
63658
+ return result;
63659
+ }
63660
+
63661
+ @FieldResolver(() => [MJTag_])
63662
+ async MJTags_MergedIntoTagIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
63663
+ this.CheckUserReadPermissions('MJ: Tags', userPayload);
63664
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
63665
+ 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');
63666
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
63667
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Tags', rows, this.GetUserFromPayload(userPayload));
63668
+ return result;
63669
+ }
63670
+
60061
63671
  @Mutation(() => MJTag_)
60062
63672
  async CreateMJTag(
60063
63673
  @Arg('input', () => CreateMJTagInput) input: CreateMJTagInput,
@@ -67369,6 +70979,18 @@ export class MJUser_ {
67369
70979
  @Field(() => [MJOpenApp_])
67370
70980
  MJOpenApps_InstalledByUserIDArray: MJOpenApp_[]; // Link to MJOpenApps
67371
70981
 
70982
+ @Field(() => [MJContentItemDuplicate_])
70983
+ MJContentItemDuplicates_ResolvedByUserIDArray: MJContentItemDuplicate_[]; // Link to MJContentItemDuplicates
70984
+
70985
+ @Field(() => [MJContentProcessRun_])
70986
+ MJContentProcessRuns_StartedByUserIDArray: MJContentProcessRun_[]; // Link to MJContentProcessRuns
70987
+
70988
+ @Field(() => [MJKnowledgeHubSavedSearch_])
70989
+ MJKnowledgeHubSavedSearches_UserIDArray: MJKnowledgeHubSavedSearch_[]; // Link to MJKnowledgeHubSavedSearches
70990
+
70991
+ @Field(() => [MJTagAuditLog_])
70992
+ MJTagAuditLogs_PerformedByUserIDArray: MJTagAuditLog_[]; // Link to MJTagAuditLogs
70993
+
67372
70994
  @Field(() => [MJResourcePermission_])
67373
70995
  MJResourcePermissions_UserIDArray: MJResourcePermission_[]; // Link to MJResourcePermissions
67374
70996
 
@@ -67414,6 +71036,9 @@ export class MJUser_ {
67414
71036
  @Field(() => [MJDuplicateRun_])
67415
71037
  MJDuplicateRuns_ApprovedByUserIDArray: MJDuplicateRun_[]; // Link to MJDuplicateRuns
67416
71038
 
71039
+ @Field(() => [MJFileStorageAccountPermission_])
71040
+ MJFileStorageAccountPermissions_UserIDArray: MJFileStorageAccountPermission_[]; // Link to MJFileStorageAccountPermissions
71041
+
67417
71042
  @Field(() => [MJAIAgentRun_])
67418
71043
  MJAIAgentRuns_UserIDArray: MJAIAgentRun_[]; // Link to MJAIAgentRuns
67419
71044
 
@@ -68207,6 +71832,46 @@ export class MJUserResolverBase extends ResolverBase {
68207
71832
  return result;
68208
71833
  }
68209
71834
 
71835
+ @FieldResolver(() => [MJContentItemDuplicate_])
71836
+ async MJContentItemDuplicates_ResolvedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
71837
+ this.CheckUserReadPermissions('MJ: Content Item Duplicates', userPayload);
71838
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
71839
+ 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');
71840
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
71841
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Item Duplicates', rows, this.GetUserFromPayload(userPayload));
71842
+ return result;
71843
+ }
71844
+
71845
+ @FieldResolver(() => [MJContentProcessRun_])
71846
+ async MJContentProcessRuns_StartedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
71847
+ this.CheckUserReadPermissions('MJ: Content Process Runs', userPayload);
71848
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
71849
+ 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');
71850
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
71851
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Process Runs', rows, this.GetUserFromPayload(userPayload));
71852
+ return result;
71853
+ }
71854
+
71855
+ @FieldResolver(() => [MJKnowledgeHubSavedSearch_])
71856
+ async MJKnowledgeHubSavedSearches_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
71857
+ this.CheckUserReadPermissions('MJ: Knowledge Hub Saved Searches', userPayload);
71858
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
71859
+ 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');
71860
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
71861
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Knowledge Hub Saved Searches', rows, this.GetUserFromPayload(userPayload));
71862
+ return result;
71863
+ }
71864
+
71865
+ @FieldResolver(() => [MJTagAuditLog_])
71866
+ async MJTagAuditLogs_PerformedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
71867
+ this.CheckUserReadPermissions('MJ: Tag Audit Logs', userPayload);
71868
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
71869
+ 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');
71870
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
71871
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Tag Audit Logs', rows, this.GetUserFromPayload(userPayload));
71872
+ return result;
71873
+ }
71874
+
68210
71875
  @FieldResolver(() => [MJResourcePermission_])
68211
71876
  async MJResourcePermissions_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
68212
71877
  this.CheckUserReadPermissions('MJ: Resource Permissions', userPayload);
@@ -68357,6 +72022,16 @@ export class MJUserResolverBase extends ResolverBase {
68357
72022
  return result;
68358
72023
  }
68359
72024
 
72025
+ @FieldResolver(() => [MJFileStorageAccountPermission_])
72026
+ async MJFileStorageAccountPermissions_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
72027
+ this.CheckUserReadPermissions('MJ: File Storage Account Permissions', userPayload);
72028
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
72029
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwFileStorageAccountPermissions')} WHERE ${provider.QuoteIdentifier('UserID')}='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: File Storage Account Permissions', userPayload, EntityPermissionType.Read, 'AND');
72030
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
72031
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: File Storage Account Permissions', rows, this.GetUserFromPayload(userPayload));
72032
+ return result;
72033
+ }
72034
+
68360
72035
  @FieldResolver(() => [MJAIAgentRun_])
68361
72036
  async MJAIAgentRuns_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
68362
72037
  this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
@@ -68499,6 +72174,14 @@ export class MJVectorDatabase_ {
68499
72174
  @Field({nullable: true, description: `JSON configuration settings for this vector database provider. Stores provider-specific connection settings like custom host URLs, authentication configuration, timeouts, retry policies, and batch size limits. NULL means use defaults from environment variables or provider defaults.`})
68500
72175
  Configuration?: string;
68501
72176
 
72177
+ @Field({nullable: true, description: `Optional link to a stored credential containing the API key and any other authentication details for this vector database provider. When set, the Credential Engine decrypts and supplies the key at runtime. When NULL, the system falls back to the environment variable AI_VENDOR_API_KEY__<ClassKey>.`})
72178
+ @MaxLength(36)
72179
+ CredentialID?: string;
72180
+
72181
+ @Field({nullable: true})
72182
+ @MaxLength(200)
72183
+ Credential?: string;
72184
+
68502
72185
  @Field(() => [MJVectorIndex_])
68503
72186
  MJVectorIndexes_VectorDatabaseIDArray: MJVectorIndex_[]; // Link to MJVectorIndexes
68504
72187
 
@@ -68529,6 +72212,9 @@ export class CreateMJVectorDatabaseInput {
68529
72212
 
68530
72213
  @Field({ nullable: true })
68531
72214
  Configuration: string | null;
72215
+
72216
+ @Field({ nullable: true })
72217
+ CredentialID: string | null;
68532
72218
  }
68533
72219
 
68534
72220
 
@@ -68555,6 +72241,9 @@ export class UpdateMJVectorDatabaseInput {
68555
72241
  @Field({ nullable: true })
68556
72242
  Configuration?: string | null;
68557
72243
 
72244
+ @Field({ nullable: true })
72245
+ CredentialID?: string | null;
72246
+
68558
72247
  @Field(() => [KeyValuePairInput], { nullable: true })
68559
72248
  OldValues___?: KeyValuePairInput[];
68560
72249
  }