@memberjunction/server 5.51.0 → 6.1.0-edge.1

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 (147) hide show
  1. package/LICENSE +7 -0
  2. package/dist/agentSessions/SessionManager.d.ts +22 -1
  3. package/dist/agentSessions/SessionManager.d.ts.map +1 -1
  4. package/dist/agentSessions/SessionManager.js +13 -3
  5. package/dist/agentSessions/SessionManager.js.map +1 -1
  6. package/dist/auth/actingContextResolver.d.ts +44 -0
  7. package/dist/auth/actingContextResolver.d.ts.map +1 -0
  8. package/dist/auth/actingContextResolver.js +18 -0
  9. package/dist/auth/actingContextResolver.js.map +1 -0
  10. package/dist/auth/index.d.ts +1 -0
  11. package/dist/auth/index.d.ts.map +1 -1
  12. package/dist/auth/index.js +1 -0
  13. package/dist/auth/index.js.map +1 -1
  14. package/dist/auth/sessionUserClone.d.ts +32 -0
  15. package/dist/auth/sessionUserClone.d.ts.map +1 -0
  16. package/dist/auth/sessionUserClone.js +50 -0
  17. package/dist/auth/sessionUserClone.js.map +1 -0
  18. package/dist/context.d.ts +1 -1
  19. package/dist/context.d.ts.map +1 -1
  20. package/dist/context.js +43 -6
  21. package/dist/context.js.map +1 -1
  22. package/dist/generated/generated.d.ts +234 -642
  23. package/dist/generated/generated.d.ts.map +1 -1
  24. package/dist/generated/generated.js +1277 -3755
  25. package/dist/generated/generated.js.map +1 -1
  26. package/dist/generic/FireAndForgetHeartbeat.d.ts +5 -0
  27. package/dist/generic/FireAndForgetHeartbeat.d.ts.map +1 -1
  28. package/dist/generic/FireAndForgetHeartbeat.js +5 -4
  29. package/dist/generic/FireAndForgetHeartbeat.js.map +1 -1
  30. package/dist/generic/PushStatusResolver.d.ts +58 -0
  31. package/dist/generic/PushStatusResolver.d.ts.map +1 -1
  32. package/dist/generic/PushStatusResolver.js +42 -3
  33. package/dist/generic/PushStatusResolver.js.map +1 -1
  34. package/dist/generic/ResolverBase.d.ts +9 -0
  35. package/dist/generic/ResolverBase.d.ts.map +1 -1
  36. package/dist/generic/ResolverBase.js +31 -13
  37. package/dist/generic/ResolverBase.js.map +1 -1
  38. package/dist/index.d.ts +7 -2
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +20 -4
  41. package/dist/index.js.map +1 -1
  42. package/dist/multiTenancy/index.d.ts +19 -0
  43. package/dist/multiTenancy/index.d.ts.map +1 -1
  44. package/dist/multiTenancy/index.js +82 -5
  45. package/dist/multiTenancy/index.js.map +1 -1
  46. package/dist/resolvers/ActionResolver.d.ts.map +1 -1
  47. package/dist/resolvers/ActionResolver.js +12 -5
  48. package/dist/resolvers/ActionResolver.js.map +1 -1
  49. package/dist/resolvers/MCPResolver.d.ts.map +1 -1
  50. package/dist/resolvers/MCPResolver.js +13 -16
  51. package/dist/resolvers/MCPResolver.js.map +1 -1
  52. package/dist/resolvers/RealtimeClientSessionResolver.d.ts +1 -1
  53. package/dist/resolvers/RealtimeClientSessionResolver.d.ts.map +1 -1
  54. package/dist/resolvers/RealtimeClientSessionResolver.js +15 -14
  55. package/dist/resolvers/RealtimeClientSessionResolver.js.map +1 -1
  56. package/dist/resolvers/RemoteBrowserActionResolver.d.ts.map +1 -1
  57. package/dist/resolvers/RemoteBrowserActionResolver.js +19 -26
  58. package/dist/resolvers/RemoteBrowserActionResolver.js.map +1 -1
  59. package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
  60. package/dist/resolvers/RunAIAgentResolver.js +30 -40
  61. package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
  62. package/dist/resolvers/RunTestResolver.d.ts.map +1 -1
  63. package/dist/resolvers/RunTestResolver.js +90 -112
  64. package/dist/resolvers/RunTestResolver.js.map +1 -1
  65. package/dist/resolvers/SearchKnowledgeResolver.js +3 -3
  66. package/dist/resolvers/SearchKnowledgeResolver.js.map +1 -1
  67. package/dist/resolvers/SearchKnowledgeStreamResolver.js +2 -2
  68. package/dist/resolvers/SearchKnowledgeStreamResolver.js.map +1 -1
  69. package/dist/resolvers/TaskGraphFrameResolver.d.ts +85 -0
  70. package/dist/resolvers/TaskGraphFrameResolver.d.ts.map +1 -0
  71. package/dist/resolvers/TaskGraphFrameResolver.js +163 -0
  72. package/dist/resolvers/TaskGraphFrameResolver.js.map +1 -0
  73. package/dist/resolvers/VersionHistoryResolver.d.ts.map +1 -1
  74. package/dist/resolvers/VersionHistoryResolver.js +8 -12
  75. package/dist/resolvers/VersionHistoryResolver.js.map +1 -1
  76. package/dist/rest/RESTEndpointHandler.d.ts +0 -4
  77. package/dist/rest/RESTEndpointHandler.d.ts.map +1 -1
  78. package/dist/rest/RESTEndpointHandler.js +1 -15
  79. package/dist/rest/RESTEndpointHandler.js.map +1 -1
  80. package/dist/services/StartTaskGraphDispatcher.d.ts +33 -0
  81. package/dist/services/StartTaskGraphDispatcher.d.ts.map +1 -0
  82. package/dist/services/StartTaskGraphDispatcher.js +31 -0
  83. package/dist/services/StartTaskGraphDispatcher.js.map +1 -0
  84. package/dist/services/TaskGraphAgentRunner.d.ts +15 -0
  85. package/dist/services/TaskGraphAgentRunner.d.ts.map +1 -0
  86. package/dist/services/TaskGraphAgentRunner.js +74 -0
  87. package/dist/services/TaskGraphAgentRunner.js.map +1 -0
  88. package/dist/services/TaskGraphContinuationDeliverer.d.ts +70 -0
  89. package/dist/services/TaskGraphContinuationDeliverer.d.ts.map +1 -0
  90. package/dist/services/TaskGraphContinuationDeliverer.js +162 -0
  91. package/dist/services/TaskGraphContinuationDeliverer.js.map +1 -0
  92. package/dist/services/TaskGraphProviderFactory.d.ts +39 -0
  93. package/dist/services/TaskGraphProviderFactory.d.ts.map +1 -0
  94. package/dist/services/TaskGraphProviderFactory.js +28 -0
  95. package/dist/services/TaskGraphProviderFactory.js.map +1 -0
  96. package/package.json +103 -100
  97. package/src/__tests__/RealtimeBridgeResolver.test.ts +6 -0
  98. package/src/__tests__/SessionManager.test.ts +44 -0
  99. package/src/__tests__/TaskGraphContinuationDeliverer.test.ts +249 -0
  100. package/src/__tests__/TaskGraphFrameResolver.test.ts +136 -0
  101. package/src/__tests__/multiTenancy.security.test.ts +254 -22
  102. package/src/__tests__/multiTenancy.test.ts +22 -0
  103. package/src/__tests__/pushStatusResolver.filter.test.ts +56 -0
  104. package/src/__tests__/resolverBase.rls.test.ts +4 -0
  105. package/src/__tests__/search-knowledge-tags.test.ts +74 -6
  106. package/src/__tests__/sessionUserClone.test.ts +161 -0
  107. package/src/agentSessions/SessionManager.ts +26 -2
  108. package/src/auth/actingContextResolver.ts +56 -0
  109. package/src/auth/index.ts +1 -0
  110. package/src/auth/sessionUserClone.ts +50 -0
  111. package/src/context.ts +48 -6
  112. package/src/generated/generated.ts +899 -2555
  113. package/src/generic/FireAndForgetHeartbeat.ts +10 -4
  114. package/src/generic/PushStatusResolver.ts +79 -4
  115. package/src/generic/ResolverBase.ts +33 -13
  116. package/src/index.ts +21 -4
  117. package/src/multiTenancy/index.ts +92 -5
  118. package/src/resolvers/ActionResolver.ts +15 -7
  119. package/src/resolvers/MCPResolver.ts +13 -15
  120. package/src/resolvers/RealtimeClientSessionResolver.ts +15 -13
  121. package/src/resolvers/RemoteBrowserActionResolver.ts +19 -25
  122. package/src/resolvers/RunAIAgentResolver.ts +30 -40
  123. package/src/resolvers/RunTestResolver.ts +90 -112
  124. package/src/resolvers/SearchKnowledgeResolver.ts +3 -3
  125. package/src/resolvers/SearchKnowledgeStreamResolver.ts +2 -2
  126. package/src/resolvers/TaskGraphFrameResolver.ts +160 -0
  127. package/src/resolvers/VersionHistoryResolver.ts +10 -13
  128. package/src/rest/RESTEndpointHandler.ts +1 -15
  129. package/src/services/StartTaskGraphDispatcher.ts +61 -0
  130. package/src/services/TaskGraphAgentRunner.ts +81 -0
  131. package/src/services/TaskGraphContinuationDeliverer.ts +181 -0
  132. package/src/services/TaskGraphProviderFactory.ts +53 -0
  133. package/dist/resolvers/ReportResolver.d.ts +0 -24
  134. package/dist/resolvers/ReportResolver.d.ts.map +0 -1
  135. package/dist/resolvers/ReportResolver.js +0 -190
  136. package/dist/resolvers/ReportResolver.js.map +0 -1
  137. package/dist/resolvers/TaskResolver.d.ts +0 -31
  138. package/dist/resolvers/TaskResolver.d.ts.map +0 -1
  139. package/dist/resolvers/TaskResolver.js +0 -157
  140. package/dist/resolvers/TaskResolver.js.map +0 -1
  141. package/dist/services/TaskOrchestrator.d.ts +0 -130
  142. package/dist/services/TaskOrchestrator.d.ts.map +0 -1
  143. package/dist/services/TaskOrchestrator.js +0 -690
  144. package/dist/services/TaskOrchestrator.js.map +0 -1
  145. package/src/resolvers/ReportResolver.ts +0 -157
  146. package/src/resolvers/TaskResolver.ts +0 -148
  147. package/src/services/TaskOrchestrator.ts +0 -873
@@ -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, MJAIAgentChannelEntity, MJAIAgentClientToolEntity, MJAIAgentCoAgentEntity, MJAIAgentConfigurationEntity, MJAIAgentDataSourceEntity, MJAIAgentExampleEntity, MJAIAgentLearningCycleEntity, MJAIAgentModalityEntity, MJAIAgentModelEntity, MJAIAgentNoteTypeEntity, MJAIAgentNoteEntity, MJAIAgentPermissionEntity, MJAIAgentPromptEntity, MJAIAgentRelationshipEntity, MJAIAgentRequestTypeEntity, MJAIAgentRequestEntity, MJAIAgentRunMediaEntity, MJAIAgentRunStepEntity, MJAIAgentRunEntity, MJAIAgentSearchScopeEntity, MJAIAgentSessionBridgeParticipantEntity, MJAIAgentSessionBridgeEntity, MJAIAgentSessionChannelEntity, MJAIAgentSessionEntity, MJAIAgentSkillEntity, MJAIAgentStepPathEntity, MJAIAgentStepEntity, MJAIAgentTypeEntity, MJAIAgentEntity, MJAIArchitectureEntity, MJAIBridgeAgentIdentityEntity, MJAIBridgeProviderChannelEntity, MJAIBridgeProviderEntity, MJAIClientToolDefinitionEntity, MJAIConfigurationParamEntity, MJAIConfigurationEntity, MJAICredentialBindingEntity, MJAIModalityEntity, MJAIModelActionEntity, MJAIModelArchitectureEntity, MJAIModelCostEntity, MJAIModelModalityEntity, MJAIModelPriceTypeEntity, MJAIModelPriceUnitTypeEntity, MJAIModelTypeEntity, MJAIModelVendorEntity, MJAIModelEntity, MJAIPromptCategoryEntity, MJAIPromptModelEntity, MJAIPromptRunMediaEntity, MJAIPromptRunEntity, MJAIPromptTypeEntity, MJAIPromptEntity, MJAIRemoteBrowserProviderEntity, MJAIResultCacheEntity, MJAISkillActionEntity, MJAISkillPermissionEntity, MJAISkillSearchScopeEntity, MJAISkillSubAgentEntity, MJAISkillEntity, MJAIVendorTypeDefinitionEntity, MJAIVendorTypeEntity, MJAIVendorEntity, MJAPIApplicationScopeEntity, MJAPIApplicationEntity, MJAPIKeyApplicationEntity, MJAPIKeyScopeEntity, MJAPIKeyUsageLogEntity, MJAPIKeyEntity, MJAPIScopeEntity, MJApplicationEntityEntity, MJApplicationRoleEntity, MJApplicationSettingEntity, MJApplicationEntity, MJArchiveConfigurationEntityEntity, MJArchiveConfigurationEntity, MJArchiveRunDetailEntity, MJArchiveRunEntity, MJArtifactPermissionEntity, MJArtifactTypeEntity, MJArtifactUseEntity, MJArtifactVersionAttributeEntity, MJArtifactVersionEntity, MJArtifactEntity, MJAuditLogTypeEntity, MJAuditLogEntity, MJAuthorizationRoleEntity, MJAuthorizationEntity, MJClusterAnalysisEntity, MJClusterAnalysisClusterEntity, MJCollectionArtifactEntity, MJCollectionPermissionEntity, MJCollectionEntity, MJCommunicationBaseMessageTypeEntity, MJCommunicationLogEntity, MJCommunicationProviderMessageTypeEntity, MJCommunicationProviderEntity, MJCommunicationRunEntity, MJCompanyEntity, MJCompanyIntegrationEntityMapEntity, MJCompanyIntegrationFieldMapEntity, MJCompanyIntegrationRecordMapEntity, MJCompanyIntegrationRunAPILogEntity, MJCompanyIntegrationRunDetailEntity, MJCompanyIntegrationRunEntity, MJCompanyIntegrationSyncWatermarkEntity, MJCompanyIntegrationEntity, MJComponentDependencyEntity, MJComponentLibraryEntity, MJComponentLibraryLinkEntity, MJComponentRegistryEntity, MJComponentEntity, MJContentFileTypeEntity, MJContentItemAttributeEntity, MJContentItemChunkEntity, MJContentItemDuplicateEntity, MJContentItemTagEntity, MJContentItemEntity, MJContentProcessRunDetailEntity, MJContentProcessRunPromptRunEntity, MJContentProcessRunEntity, MJContentSourceParamEntity, MJContentSourceTypeParamEntity, MJContentSourceTypeEntity, MJContentSourceEntity, MJContentTypeAttributeEntity, MJContentTypeEntity, MJConversationArtifactPermissionEntity, MJConversationArtifactVersionEntity, MJConversationArtifactEntity, MJConversationCompactionRunEntity, MJConversationDetailArtifactEntity, MJConversationDetailAttachmentEntity, MJConversationDetailRatingEntity, MJConversationDetailEntity, MJConversationWidgetInstanceEntity, 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, MJEntityFormOverrideEntity, MJEntityOrganicKeyRelatedEntityEntity, MJEntityOrganicKeyEntity, MJEntityPermissionEntity, MJEntityRecordDocumentEntity, MJEntityRelationshipDisplayComponentEntity, MJEntityRelationshipEntity, MJEntitySettingEntity, MJEnvironmentEntity, MJErrorLogEntity, MJExperimentSessionIterationEntity, MJExperimentSessionEntity, MJExperimentEntity, MJExplorerNavigationItemEntity, MJExternalDataSourceTypeEntity, MJExternalDataSourceEntity, MJFileCategoryEntity, MJFileEntityRecordLinkEntity, MJFileStorageAccountPermissionEntity, MJFileStorageAccountEntity, MJFileStorageProviderEntity, MJFileEntity, MJGeneratedCodeCategoryEntity, MJGeneratedCodeEntity, MJInstanceConfigurationEntity, MJIntegrationObjectFieldEntity, MJIntegrationObjectEntity, MJIntegrationSourceTypeEntity, MJIntegrationURLFormatEntity, MJIntegrationEntity, MJKnowledgeHubSavedSearchEntity, MJLibraryEntity, MJLibraryItemEntity, MJListCategoryEntity, MJListDetailEntity, MJListInvitationEntity, MJListShareEntity, MJListEntity, MJMagicLinkInviteAllowedDomainEntity, MJMagicLinkInviteAllowedPathEntity, MJMagicLinkInviteApplicationEntity, MJMagicLinkInviteRoleEntity, MJMagicLinkInviteEntity, MJMagicLinkRedemptionEntity, MJMCPServerConnectionPermissionEntity, MJMCPServerConnectionToolEntity, MJMCPServerConnectionEntity, MJMCPServerToolEntity, MJMCPServerEntity, MJMCPToolExecutionLogEntity, MJMCPToolFavoriteEntity, MJMLAlgorithmUseCaseRankingEntity, MJMLAlgorithmUseCaseEntity, MJMLAlgorithmEntity, MJMLModelScoringBindingEntity, MJMLModelEntity, MJMLTrainingPipelineEntity, MJMLTrainingRunEntity, MJOAuthAuthServerMetadataCacheEntity, MJOAuthAuthorizationStateEntity, MJOAuthClientRegistrationEntity, MJOAuthTokenEntity, MJOpenAppDependencyEntity, MJOpenAppInstallHistoryEntity, MJOpenAppEntity, MJOutputDeliveryTypeEntity, MJOutputFormatTypeEntity, MJOutputTriggerTypeEntity, MJPermissionDomainEntity, MJProcessRunDetailEntity, MJProcessRunEntity, MJProjectEntity, MJPublicLinkEntity, MJQueryEntity, MJQueryCategoryEntity, MJQueryDependencyEntity, MJQueryEntityEntity, MJQueryFieldEntity, MJQueryParameterEntity, MJQueryPermissionEntity, MJQuerySQLEntity, MJQueueTaskEntity, MJQueueTypeEntity, MJQueueEntity, MJRecommendationItemEntity, MJRecommendationProviderEntity, MJRecommendationRunEntity, MJRecommendationEntity, MJRecordChangeReplayRunEntity, MJRecordChangeEntity, MJRecordGeoCodeEntity, MJRecordLinkEntity, MJRecordMergeDeletionLogEntity, MJRecordMergeLogEntity, MJRecordProcessCategoryEntity, MJRecordProcessWatermarkEntity, MJRecordProcessEntity, MJRemoteOperationCategoryEntity, MJRemoteOperationEntity, MJReportCategoryEntity, MJReportSnapshotEntity, MJReportUserStateEntity, MJReportVersionEntity, MJReportEntity, MJResourceLinkEntity, MJResourcePermissionEntity, MJResourceTypeEntity, MJRoleEntity, MJRowLevelSecurityFilterEntity, MJScheduledActionParamEntity, MJScheduledActionEntity, MJScheduledJobRunEntity, MJScheduledJobTypeEntity, MJScheduledJobEntity, MJSchemaInfoEntity, MJScopedPromptConfigEntity, MJScopedPromptPartEntity, MJSearchExecutionLogEntity, MJSearchProviderEntity, MJSearchScopeEntityEntity, MJSearchScopeExternalIndexEntity, MJSearchScopePermissionEntity, MJSearchScopeProviderEntity, MJSearchScopeStorageAccountEntity, MJSearchScopeTestQueryEntity, MJSearchScopeEntity, MJSignatureAccountEntity, MJSignatureProviderEntity, MJSignatureRequestDocumentEntity, MJSignatureRequestLogEntity, MJSignatureRequestRecipientEntity, MJSignatureRequestEntity, MJSkillEntity, MJSQLDialectEntity, MJStateProvinceEntity, MJTagAuditLogEntity, MJTagCoOccurrenceEntity, MJTagScopeEntity, MJTagSuggestionEntity, MJTagSynonymEntity, MJTaggedItemEntity, MJTagEntity, MJTaskDependencyEntity, MJTaskTypeEntity, MJTaskEntity, MJTemplateCategoryEntity, MJTemplateContentTypeEntity, MJTemplateContentEntity, MJTemplateParamEntity, MJTemplateEntity, MJTestRubricEntity, MJTestRunFeedbackEntity, MJTestRunOutputTypeEntity, MJTestRunOutputEntity, MJTestRunEntity, MJTestSuiteRunEntity, MJTestSuiteTestEntity, MJTestSuiteEntity, MJTestTypeEntity, MJTestEntity, MJThemeEntity, MJUserApplicationEntityEntity, MJUserApplicationEntity, MJUserFavoriteEntity, MJUserNotificationPreferenceEntity, MJUserNotificationTypeEntity, MJUserNotificationEntity, MJUserRecordLogEntity, MJUserRoleEntity, MJUserRoutineRecipientEntity, MJUserRoutineRunEntity, MJUserRoutineEntity, MJUserSettingEntity, MJUserViewCategoryEntity, MJUserViewRunDetailEntity, MJUserViewRunEntity, MJUserViewEntity, MJUserEntity, MJVectorDatabaseEntity, MJVectorIndexEntity, MJVersionInstallationEntity, MJVersionLabelItemEntity, MJVersionLabelRestoreEntity, MJVersionLabelEntity, MJViewTypeEntity, 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, MJAIAgentChannelEntity, MJAIAgentClientToolEntity, MJAIAgentCoAgentEntity, MJAIAgentConfigurationEntity, MJAIAgentCredentialEntity, MJAIAgentDataSourceEntity, MJAIAgentExampleEntity, MJAIAgentHarnessEntity, MJAIAgentLearningCycleEntity, MJAIAgentModalityEntity, MJAIAgentModelEntity, MJAIAgentNoteTypeEntity, MJAIAgentNoteEntity, MJAIAgentPermissionEntity, MJAIAgentPromptEntity, MJAIAgentRelationshipEntity, MJAIAgentRequestTypeEntity, MJAIAgentRequestEntity, MJAIAgentRunMediaEntity, MJAIAgentRunStepEntity, MJAIAgentRunEntity, MJAIAgentSearchScopeEntity, MJAIAgentSessionBridgeParticipantEntity, MJAIAgentSessionBridgeEntity, MJAIAgentSessionChannelEntity, MJAIAgentSessionEntity, MJAIAgentSkillEntity, MJAIAgentStepPathEntity, MJAIAgentStepEntity, MJAIAgentTypeEntity, MJAIAgentEntity, MJAIArchitectureEntity, MJAIBridgeAgentIdentityEntity, MJAIBridgeProviderChannelEntity, MJAIBridgeProviderEntity, MJAIClientToolDefinitionEntity, MJAIConfigurationParamEntity, MJAIConfigurationEntity, MJAICredentialBindingEntity, MJAIModalityEntity, MJAIModelActionEntity, MJAIModelArchitectureEntity, MJAIModelCostEntity, MJAIModelModalityEntity, MJAIModelPriceTypeEntity, MJAIModelPriceUnitTypeEntity, MJAIModelTypeEntity, MJAIModelVendorEntity, MJAIModelEntity, MJAIPromptCategoryEntity, MJAIPromptModelEntity, MJAIPromptRunMediaEntity, MJAIPromptRunEntity, MJAIPromptTypeEntity, MJAIPromptEntity, MJAIRemoteBrowserProviderEntity, MJAIResultCacheEntity, MJAISkillActionEntity, MJAISkillPermissionEntity, MJAISkillSearchScopeEntity, MJAISkillSubAgentEntity, MJAISkillEntity, MJAIVendorTypeDefinitionEntity, MJAIVendorTypeEntity, MJAIVendorEntity, MJAPIApplicationScopeEntity, MJAPIApplicationEntity, MJAPIKeyApplicationEntity, MJAPIKeyScopeEntity, MJAPIKeyUsageLogEntity, MJAPIKeyEntity, MJAPIScopeEntity, MJApplicationEntityEntity, MJApplicationRoleEntity, MJApplicationSettingEntity, MJApplicationEntity, MJArchiveConfigurationEntityEntity, MJArchiveConfigurationEntity, MJArchiveRunDetailEntity, MJArchiveRunEntity, MJArtifactPermissionEntity, MJArtifactTypeEntity, MJArtifactUseEntity, MJArtifactVersionAttributeEntity, MJArtifactVersionEntity, MJArtifactEntity, MJAuditLogTypeEntity, MJAuditLogEntity, MJAuthorizationRoleEntity, MJAuthorizationEntity, MJClusterAnalysisEntity, MJClusterAnalysisClusterEntity, MJCollectionArtifactEntity, MJCollectionPermissionEntity, MJCollectionEntity, MJCommunicationBaseMessageTypeEntity, MJCommunicationLogEntity, MJCommunicationProviderMessageTypeEntity, MJCommunicationProviderEntity, MJCommunicationRunEntity, MJCompanyEntity, MJCompanyIntegrationEntityMapEntity, MJCompanyIntegrationFieldMapEntity, MJCompanyIntegrationRecordMapEntity, MJCompanyIntegrationRunAPILogEntity, MJCompanyIntegrationRunDetailEntity, MJCompanyIntegrationRunEntity, MJCompanyIntegrationSyncWatermarkEntity, MJCompanyIntegrationEntity, MJComponentDependencyEntity, MJComponentLibraryEntity, MJComponentLibraryLinkEntity, MJComponentRegistryEntity, MJComponentEntity, MJContentFileTypeEntity, MJContentItemAttributeEntity, MJContentItemChunkEntity, MJContentItemDuplicateEntity, MJContentItemTagEntity, MJContentItemEntity, MJContentProcessRunDetailEntity, MJContentProcessRunPromptRunEntity, MJContentProcessRunEntity, MJContentSourceParamEntity, MJContentSourceTypeParamEntity, MJContentSourceTypeEntity, MJContentSourceEntity, MJContentTypeAttributeEntity, MJContentTypeEntity, MJConversationArtifactPermissionEntity, MJConversationArtifactVersionEntity, MJConversationArtifactEntity, MJConversationCompactionRunEntity, MJConversationDetailArtifactEntity, MJConversationDetailAttachmentEntity, MJConversationDetailRatingEntity, MJConversationDetailEntity, MJConversationWidgetInstanceEntity, 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, MJEntityFormOverrideEntity, MJEntityOrganicKeyRelatedEntityEntity, MJEntityOrganicKeyEntity, MJEntityPermissionEntity, MJEntityRecordDocumentEntity, MJEntityRelationshipDisplayComponentEntity, MJEntityRelationshipEntity, MJEntitySettingEntity, MJEnvironmentEntity, MJErrorLogEntity, MJExperimentSessionIterationEntity, MJExperimentSessionEntity, MJExperimentEntity, MJExplorerNavigationItemEntity, MJExternalDataSourceTypeEntity, MJExternalDataSourceEntity, MJFileCategoryEntity, MJFileEntityRecordLinkEntity, MJFileStorageAccountPermissionEntity, MJFileStorageAccountEntity, MJFileStorageProviderEntity, MJFileEntity, MJGeneratedCodeCategoryEntity, MJGeneratedCodeEntity, MJInstanceConfigurationEntity, MJIntegrationObjectFieldEntity, MJIntegrationObjectEntity, MJIntegrationSourceTypeEntity, MJIntegrationURLFormatEntity, MJIntegrationEntity, MJKnowledgeHubSavedSearchEntity, MJLibraryEntity, MJLibraryItemEntity, MJListCategoryEntity, MJListDetailEntity, MJListInvitationEntity, MJListShareEntity, MJListEntity, MJMagicLinkInviteAllowedDomainEntity, MJMagicLinkInviteAllowedPathEntity, MJMagicLinkInviteApplicationEntity, MJMagicLinkInviteRoleEntity, MJMagicLinkInviteEntity, MJMagicLinkRedemptionEntity, MJMCPServerConnectionPermissionEntity, MJMCPServerConnectionToolEntity, MJMCPServerConnectionEntity, MJMCPServerToolEntity, MJMCPServerEntity, MJMCPToolExecutionLogEntity, MJMCPToolFavoriteEntity, MJMLAlgorithmUseCaseRankingEntity, MJMLAlgorithmUseCaseEntity, MJMLAlgorithmEntity, MJMLModelScoringBindingEntity, MJMLModelEntity, MJMLTrainingPipelineEntity, MJMLTrainingRunEntity, MJOAuthAuthServerMetadataCacheEntity, MJOAuthAuthorizationStateEntity, MJOAuthClientRegistrationEntity, MJOAuthTokenEntity, MJOpenAppDependencyEntity, MJOpenAppInstallHistoryEntity, MJOpenAppEntity, MJOutputDeliveryTypeEntity, MJOutputFormatTypeEntity, MJPermissionDomainEntity, MJProcessRunDetailEntity, MJProcessRunEntity, MJProjectEntity, MJPublicLinkEntity, MJQueryEntity, MJQueryCategoryEntity, MJQueryDependencyEntity, MJQueryEntityEntity, MJQueryFieldEntity, MJQueryParameterEntity, MJQueryPermissionEntity, MJQuerySQLEntity, MJQueueTaskEntity, MJQueueTypeEntity, MJQueueEntity, MJRecommendationItemEntity, MJRecommendationProviderEntity, MJRecommendationRunEntity, MJRecommendationEntity, MJRecordChangeReplayRunEntity, MJRecordChangeEntity, MJRecordGeoCodeEntity, MJRecordLinkEntity, MJRecordMergeDeletionLogEntity, MJRecordMergeLogEntity, MJRecordProcessCategoryEntity, MJRecordProcessWatermarkEntity, MJRecordProcessEntity, MJRemoteOperationCategoryEntity, MJRemoteOperationEntity, MJResourceLinkEntity, MJResourcePermissionEntity, MJResourceTypeEntity, MJRoleEntity, MJRowLevelSecurityFilterEntity, MJScheduledJobRunEntity, MJScheduledJobTypeEntity, MJScheduledJobEntity, MJSchemaInfoEntity, MJScopedPromptConfigEntity, MJScopedPromptPartEntity, MJSearchExecutionLogEntity, MJSearchProviderEntity, MJSearchScopeEntityEntity, MJSearchScopeExternalIndexEntity, MJSearchScopePermissionEntity, MJSearchScopeProviderEntity, MJSearchScopeStorageAccountEntity, MJSearchScopeTestQueryEntity, MJSearchScopeEntity, MJSignatureAccountEntity, MJSignatureProviderEntity, MJSignatureRequestDocumentEntity, MJSignatureRequestLogEntity, MJSignatureRequestRecipientEntity, MJSignatureRequestEntity, MJSkillEntity, MJSQLDialectEntity, MJStateProvinceEntity, MJTagAuditLogEntity, MJTagCoOccurrenceEntity, MJTagScopeEntity, MJTagSuggestionEntity, MJTagSynonymEntity, MJTaggedItemEntity, MJTagEntity, MJTaskDependencyEntity, MJTaskTypeEntity, MJTaskEntity, MJTemplateCategoryEntity, MJTemplateContentTypeEntity, MJTemplateContentEntity, MJTemplateParamEntity, MJTemplateEntity, MJTestRubricEntity, MJTestRunFeedbackEntity, MJTestRunOutputTypeEntity, MJTestRunOutputEntity, MJTestRunEntity, MJTestSuiteRunEntity, MJTestSuiteTestEntity, MJTestSuiteEntity, MJTestTypeEntity, MJTestEntity, MJThemeEntity, MJUserApplicationEntityEntity, MJUserApplicationEntity, MJUserFavoriteEntity, MJUserNotificationPreferenceEntity, MJUserNotificationTypeEntity, MJUserNotificationEntity, MJUserRecordLogEntity, MJUserRoleEntity, MJUserRoutineRecipientEntity, MJUserRoutineRunEntity, MJUserRoutineEntity, MJUserSettingEntity, MJUserViewCategoryEntity, MJUserViewRunDetailEntity, MJUserViewRunEntity, MJUserViewEntity, MJUserEntity, MJVectorDatabaseEntity, MJVectorIndexEntity, MJVersionInstallationEntity, MJVersionLabelItemEntity, MJVersionLabelRestoreEntity, MJVersionLabelEntity, MJViewTypeEntity, MJWorkspaceItemEntity, MJWorkspaceEntity } from '@memberjunction/core-entities';
22
22
 
23
23
 
24
24
  //****************************************************************************
@@ -1000,7 +1000,7 @@ export class MJActionExecutionLog_ {
1000
1000
  @Field({nullable: true, description: `Timestamp when the action execution ended (timezone-aware)`})
1001
1001
  EndedAt?: Date;
1002
1002
 
1003
- @Field({nullable: true, description: `JSON-formatted input parameters passed to the action during execution, storing the exact values used for this specific run.`})
1003
+ @Field({nullable: true, description: `JSON-formatted input parameters AS THE ACTION WAS CALLED, captured once when execution starts and never overwritten. Custom and Generated actions mutate their parameter array in place, so this is the only durable record of the values actually passed in; the final state lives in ResultParams. Parameter values may be redacted per ActionParam.LogValue / EntityActionParam.LogValue, and whole-record value types are never written - see the parameter's own documentation.`})
1004
1004
  Params?: string;
1005
1005
 
1006
1006
  @Field({nullable: true, description: `The outcome code returned by the action execution, indicating success, failure, or specific error conditions as defined in Action Result Codes.`})
@@ -1020,9 +1020,28 @@ export class MJActionExecutionLog_ {
1020
1020
  @Field()
1021
1021
  _mj__UpdatedAt: Date;
1022
1022
 
1023
- @Field({nullable: true, description: `JSON-formatted output data or response from the action execution`})
1023
+ @Field({nullable: true, description: `Human-readable summary message returned by the action - the reason for a refusal, or a short description of what was done. Not the action's output data: parameter values live in Params and ResultParams, and the outcome code in ResultCode.`})
1024
1024
  Message?: string;
1025
1025
 
1026
+ @Field({nullable: true, description: `Optional. The Entity Action binding that caused this run. NULL when the action was invoked directly - from a resolver, a script, an agent step or a scheduled action.`})
1027
+ @MaxLength(36)
1028
+ EntityActionID?: string;
1029
+
1030
+ @Field({nullable: true, description: `Optional. Which lifecycle event fired the binding - AfterUpdate, Validate, List and so on. Recorded separately from EntityActionID because one binding may be attached to several invocation types, and telling a Validate refusal apart from an AfterUpdate side effect is the first question anyone asks of this log.`})
1031
+ @MaxLength(36)
1032
+ EntityActionInvocationTypeID?: string;
1033
+
1034
+ @Field({nullable: true, description: `Optional. The entity of the record this run operated on. Deliberately denormalized rather than joined through EntityActionID: it survives the binding being deleted or retargeted, and it lets the log be queried by record with no join. Kept generic because every invoker has a subject - not only Entity Actions.`})
1035
+ @MaxLength(36)
1036
+ TargetEntityID?: string;
1037
+
1038
+ @Field({nullable: true, description: `Optional. The primary key of the record this run operated on, as text, paired with TargetEntityID. For multi-record invocation types (List, View) one log row is written per record, so this is always a single record.`})
1039
+ @MaxLength(450)
1040
+ TargetRecordID?: string;
1041
+
1042
+ @Field({nullable: true, description: `JSON-formatted FINAL parameter set captured when the action finished - the inputs as the action left them, plus any output parameters it produced. Written on FAILURE exactly as on success, under the same redaction rules: a failed run's partially-mutated inputs are usually the most diagnostic thing available, and an audit trail that records only successes is not an audit trail. Distinct from Params, which holds the values the action was called with and is never overwritten. NULL means one thing only - the run never finished (process died, host killed) - so it is a signal rather than an absence, and must not be backfilled.`})
1043
+ ResultParams?: string;
1044
+
1026
1045
  @Field()
1027
1046
  @MaxLength(425)
1028
1047
  Action: string;
@@ -1031,6 +1050,18 @@ export class MJActionExecutionLog_ {
1031
1050
  @MaxLength(100)
1032
1051
  User: string;
1033
1052
 
1053
+ @Field({nullable: true})
1054
+ @MaxLength(425)
1055
+ EntityAction?: string;
1056
+
1057
+ @Field({nullable: true})
1058
+ @MaxLength(255)
1059
+ EntityActionInvocationType?: string;
1060
+
1061
+ @Field({nullable: true})
1062
+ @MaxLength(255)
1063
+ TargetEntity?: string;
1064
+
1034
1065
  @Field(() => [MJProcessRunDetail_])
1035
1066
  MJProcessRunDetails_ActionExecutionLogIDArray: MJProcessRunDetail_[]; // Link to MJProcessRunDetails
1036
1067
 
@@ -1071,6 +1102,21 @@ export class CreateMJActionExecutionLogInput {
1071
1102
  @Field({ nullable: true })
1072
1103
  Message: string | null;
1073
1104
 
1105
+ @Field({ nullable: true })
1106
+ EntityActionID: string | null;
1107
+
1108
+ @Field({ nullable: true })
1109
+ EntityActionInvocationTypeID: string | null;
1110
+
1111
+ @Field({ nullable: true })
1112
+ TargetEntityID: string | null;
1113
+
1114
+ @Field({ nullable: true })
1115
+ TargetRecordID: string | null;
1116
+
1117
+ @Field({ nullable: true })
1118
+ ResultParams: string | null;
1119
+
1074
1120
  @Field(() => RestoreContextInput, { nullable: true })
1075
1121
  RestoreContext___?: RestoreContextInput;
1076
1122
  }
@@ -1108,6 +1154,21 @@ export class UpdateMJActionExecutionLogInput {
1108
1154
  @Field({ nullable: true })
1109
1155
  Message?: string | null;
1110
1156
 
1157
+ @Field({ nullable: true })
1158
+ EntityActionID?: string | null;
1159
+
1160
+ @Field({ nullable: true })
1161
+ EntityActionInvocationTypeID?: string | null;
1162
+
1163
+ @Field({ nullable: true })
1164
+ TargetEntityID?: string | null;
1165
+
1166
+ @Field({ nullable: true })
1167
+ TargetRecordID?: string | null;
1168
+
1169
+ @Field({ nullable: true })
1170
+ ResultParams?: string | null;
1171
+
1111
1172
  @Field(() => [KeyValuePairInput], { nullable: true })
1112
1173
  OldValues___?: KeyValuePairInput[];
1113
1174
 
@@ -1616,6 +1677,9 @@ export class MJActionParam_ {
1616
1677
  @MaxLength(20)
1617
1678
  MediaModality?: string;
1618
1679
 
1680
+ @Field(() => Boolean, {description: `Whether this parameter's VALUE may be written to ActionExecutionLog.Params. Default 1. Set to 0 for parameters that carry records, credentials or personal data - for example the Data payload of Execute Agent. Independent of the hard rule that Entity Action params of ValueType 'Entity Object' or 'Entity Object Data' are never logged regardless of this flag. When logging is suppressed the log records the parameter name, its type and a redaction marker, never the value.`})
1681
+ LogValue: boolean;
1682
+
1619
1683
  @Field()
1620
1684
  @MaxLength(425)
1621
1685
  Action: string;
@@ -1623,9 +1687,6 @@ export class MJActionParam_ {
1623
1687
  @Field(() => [MJEntityActionParam_])
1624
1688
  MJEntityActionParams_ActionParamIDArray: MJEntityActionParam_[]; // Link to MJEntityActionParams
1625
1689
 
1626
- @Field(() => [MJScheduledActionParam_])
1627
- MJScheduledActionParams_ActionParamIDArray: MJScheduledActionParam_[]; // Link to MJScheduledActionParams
1628
-
1629
1690
  }
1630
1691
 
1631
1692
  //****************************************************************************
@@ -1663,6 +1724,9 @@ export class CreateMJActionParamInput {
1663
1724
  @Field({ nullable: true })
1664
1725
  MediaModality: string | null;
1665
1726
 
1727
+ @Field(() => Boolean, { nullable: true })
1728
+ LogValue?: boolean;
1729
+
1666
1730
  @Field(() => RestoreContextInput, { nullable: true })
1667
1731
  RestoreContext___?: RestoreContextInput;
1668
1732
  }
@@ -1703,6 +1767,9 @@ export class UpdateMJActionParamInput {
1703
1767
  @Field({ nullable: true })
1704
1768
  MediaModality?: string | null;
1705
1769
 
1770
+ @Field(() => Boolean, { nullable: true })
1771
+ LogValue?: boolean;
1772
+
1706
1773
  @Field(() => [KeyValuePairInput], { nullable: true })
1707
1774
  OldValues___?: KeyValuePairInput[];
1708
1775
 
@@ -1777,16 +1844,6 @@ export class MJActionParamResolver extends ResolverBase {
1777
1844
  return result;
1778
1845
  }
1779
1846
 
1780
- @FieldResolver(() => [MJScheduledActionParam_])
1781
- async MJScheduledActionParams_ActionParamIDArray(@Root() mjactionparam_: MJActionParam_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
1782
- this.CheckUserReadPermissions('MJ: Scheduled Action Params', userPayload);
1783
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
1784
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwScheduledActionParams')} WHERE ${provider.QuoteIdentifier('ActionParamID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Action Params', userPayload, EntityPermissionType.Read, 'AND');
1785
- const rows = await provider.ExecuteSQL(sSQL, [mjactionparam_.ID], undefined, this.GetUserFromPayload(userPayload));
1786
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Action Params', rows, this.GetUserFromPayload(userPayload));
1787
- return result;
1788
- }
1789
-
1790
1847
  @Mutation(() => MJActionParam_)
1791
1848
  async CreateMJActionParam(
1792
1849
  @Arg('input', () => CreateMJActionParamInput) input: CreateMJActionParamInput,
@@ -2126,9 +2183,6 @@ export class MJAction_ {
2126
2183
  @Field(() => [MJMCPServerTool_])
2127
2184
  MJMCPServerTools_GeneratedActionIDArray: MJMCPServerTool_[]; // Link to MJMCPServerTools
2128
2185
 
2129
- @Field(() => [MJScheduledAction_])
2130
- MJScheduledActions_ActionIDArray: MJScheduledAction_[]; // Link to MJScheduledActions
2131
-
2132
2186
  @Field(() => [MJActionContext_])
2133
2187
  MJActionContexts_ActionIDArray: MJActionContext_[]; // Link to MJActionContexts
2134
2188
 
@@ -2434,16 +2488,6 @@ export class MJActionResolver extends ResolverBase {
2434
2488
  return result;
2435
2489
  }
2436
2490
 
2437
- @FieldResolver(() => [MJScheduledAction_])
2438
- async MJScheduledActions_ActionIDArray(@Root() mjaction_: MJAction_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2439
- this.CheckUserReadPermissions('MJ: Scheduled Actions', userPayload);
2440
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
2441
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwScheduledActions')} WHERE ${provider.QuoteIdentifier('ActionID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Actions', userPayload, EntityPermissionType.Read, 'AND');
2442
- const rows = await provider.ExecuteSQL(sSQL, [mjaction_.ID], undefined, this.GetUserFromPayload(userPayload));
2443
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Actions', rows, this.GetUserFromPayload(userPayload));
2444
- return result;
2445
- }
2446
-
2447
2491
  @FieldResolver(() => [MJActionContext_])
2448
2492
  async MJActionContexts_ActionIDArray(@Root() mjaction_: MJAction_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
2449
2493
  this.CheckUserReadPermissions('MJ: Action Contexts', userPayload);
@@ -4261,6 +4305,204 @@ export class MJAIAgentConfigurationResolver extends ResolverBase {
4261
4305
 
4262
4306
  }
4263
4307
 
4308
+ //****************************************************************************
4309
+ // ENTITY CLASS for MJ: AI Agent Credentials
4310
+ //****************************************************************************
4311
+ @ObjectType({ description: `Credentials an agent carries into its harness sandbox, injected as environment variables at session creation. Custody of the secret itself stays in Credential/CredentialEngine - this table records only the GRANT EDGE, in the same reviewable style as AIAgentAction. Distinct from AICredentialBinding, which is inference-selection plumbing for AIPromptRunner failover when MJ itself executes a prompt.` })
4312
+ export class MJAIAgentCredential_ {
4313
+ @Field()
4314
+ @MaxLength(36)
4315
+ ID: string;
4316
+
4317
+ @Field()
4318
+ @MaxLength(36)
4319
+ AgentID: string;
4320
+
4321
+ @Field()
4322
+ @MaxLength(36)
4323
+ CredentialID: string;
4324
+
4325
+ @Field({description: `What this credential is for. HarnessLLM is the API key the harness uses to reach its own model vendor; when absent, the runtime falls back to vendor-scoped AICredentialBinding rows for AIAgentHarness.AIVendorID. Integration is any other granted secret the agent needs inside the sandbox, such as a source-control or ticketing token.`})
4326
+ @MaxLength(50)
4327
+ Purpose: string;
4328
+
4329
+ @Field({nullable: true, description: `Environment variable the adapter sets inside the sandbox for this credential, e.g. ANTHROPIC_API_KEY or GITHUB_TOKEN. NULL lets the adapter choose, which is the normal case for HarnessLLM because the adapter knows its own vendor's variable name.`})
4330
+ @MaxLength(100)
4331
+ EnvVariableName?: string;
4332
+
4333
+ @Field(() => Int, {description: `Failover ordering within a Purpose - lower runs first. Lets an agent carry a primary and a standby key for the same purpose without a schema change.`})
4334
+ Priority: number;
4335
+
4336
+ @Field({description: `Whether this grant is live. Revoked withdraws the credential from future sessions while preserving the record that it was once granted, which is the point of auditing a credential grant at all. Pending stages a grant that is not yet in force.`})
4337
+ @MaxLength(20)
4338
+ Status: string;
4339
+
4340
+ @Field()
4341
+ _mj__CreatedAt: Date;
4342
+
4343
+ @Field()
4344
+ _mj__UpdatedAt: Date;
4345
+
4346
+ @Field({nullable: true})
4347
+ @MaxLength(255)
4348
+ Agent?: string;
4349
+
4350
+ @Field()
4351
+ @MaxLength(200)
4352
+ Credential: string;
4353
+
4354
+ }
4355
+
4356
+ //****************************************************************************
4357
+ // INPUT TYPE for MJ: AI Agent Credentials
4358
+ //****************************************************************************
4359
+ @InputType()
4360
+ export class CreateMJAIAgentCredentialInput {
4361
+ @Field({ nullable: true })
4362
+ ID?: string;
4363
+
4364
+ @Field({ nullable: true })
4365
+ AgentID?: string;
4366
+
4367
+ @Field({ nullable: true })
4368
+ CredentialID?: string;
4369
+
4370
+ @Field({ nullable: true })
4371
+ Purpose?: string;
4372
+
4373
+ @Field({ nullable: true })
4374
+ EnvVariableName: string | null;
4375
+
4376
+ @Field(() => Int, { nullable: true })
4377
+ Priority?: number;
4378
+
4379
+ @Field({ nullable: true })
4380
+ Status?: string;
4381
+
4382
+ @Field(() => RestoreContextInput, { nullable: true })
4383
+ RestoreContext___?: RestoreContextInput;
4384
+ }
4385
+
4386
+
4387
+ //****************************************************************************
4388
+ // INPUT TYPE for MJ: AI Agent Credentials
4389
+ //****************************************************************************
4390
+ @InputType()
4391
+ export class UpdateMJAIAgentCredentialInput {
4392
+ @Field()
4393
+ ID: string;
4394
+
4395
+ @Field({ nullable: true })
4396
+ AgentID?: string;
4397
+
4398
+ @Field({ nullable: true })
4399
+ CredentialID?: string;
4400
+
4401
+ @Field({ nullable: true })
4402
+ Purpose?: string;
4403
+
4404
+ @Field({ nullable: true })
4405
+ EnvVariableName?: string | null;
4406
+
4407
+ @Field(() => Int, { nullable: true })
4408
+ Priority?: number;
4409
+
4410
+ @Field({ nullable: true })
4411
+ Status?: string;
4412
+
4413
+ @Field(() => [KeyValuePairInput], { nullable: true })
4414
+ OldValues___?: KeyValuePairInput[];
4415
+
4416
+ @Field(() => RestoreContextInput, { nullable: true })
4417
+ RestoreContext___?: RestoreContextInput;
4418
+ }
4419
+
4420
+ //****************************************************************************
4421
+ // RESOLVER for MJ: AI Agent Credentials
4422
+ //****************************************************************************
4423
+ @ObjectType()
4424
+ export class RunMJAIAgentCredentialViewResult {
4425
+ @Field(() => [MJAIAgentCredential_])
4426
+ Results: MJAIAgentCredential_[];
4427
+
4428
+ @Field(() => String, {nullable: true})
4429
+ UserViewRunID?: string;
4430
+
4431
+ @Field(() => Int, {nullable: true})
4432
+ RowCount: number;
4433
+
4434
+ @Field(() => Int, {nullable: true})
4435
+ TotalRowCount: number;
4436
+
4437
+ @Field(() => Int, {nullable: true})
4438
+ ExecutionTime: number;
4439
+
4440
+ @Field({nullable: true})
4441
+ ErrorMessage?: string;
4442
+
4443
+ @Field(() => Boolean, {nullable: false})
4444
+ Success: boolean;
4445
+ }
4446
+
4447
+ @Resolver(MJAIAgentCredential_)
4448
+ export class MJAIAgentCredentialResolver extends ResolverBase {
4449
+ @Query(() => RunMJAIAgentCredentialViewResult)
4450
+ async RunMJAIAgentCredentialViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
4451
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
4452
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
4453
+ }
4454
+
4455
+ @Query(() => RunMJAIAgentCredentialViewResult)
4456
+ async RunMJAIAgentCredentialViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
4457
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
4458
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
4459
+ }
4460
+
4461
+ @Query(() => RunMJAIAgentCredentialViewResult)
4462
+ async RunMJAIAgentCredentialDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
4463
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
4464
+ input.EntityName = 'MJ: AI Agent Credentials';
4465
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
4466
+ }
4467
+ @Query(() => MJAIAgentCredential_, { nullable: true })
4468
+ async MJAIAgentCredential(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJAIAgentCredential_ | null> {
4469
+ this.CheckUserReadPermissions('MJ: AI Agent Credentials', userPayload);
4470
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
4471
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentCredentials')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Credentials', userPayload, EntityPermissionType.Read, 'AND');
4472
+ const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
4473
+ const result = await this.MapFieldNamesToCodeNames('MJ: AI Agent Credentials', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
4474
+ return result;
4475
+ }
4476
+
4477
+ @Mutation(() => MJAIAgentCredential_)
4478
+ async CreateMJAIAgentCredential(
4479
+ @Arg('input', () => CreateMJAIAgentCredentialInput) input: CreateMJAIAgentCredentialInput,
4480
+ @Ctx() { providers, userPayload }: AppContext,
4481
+ @PubSub() pubSub: PubSubEngine
4482
+ ) {
4483
+ const provider = GetReadWriteProvider(providers);
4484
+ return this.CreateRecord('MJ: AI Agent Credentials', input, provider, userPayload, pubSub)
4485
+ }
4486
+
4487
+ @Mutation(() => MJAIAgentCredential_)
4488
+ async UpdateMJAIAgentCredential(
4489
+ @Arg('input', () => UpdateMJAIAgentCredentialInput) input: UpdateMJAIAgentCredentialInput,
4490
+ @Ctx() { providers, userPayload }: AppContext,
4491
+ @PubSub() pubSub: PubSubEngine
4492
+ ) {
4493
+ const provider = GetReadWriteProvider(providers);
4494
+ return this.UpdateRecord('MJ: AI Agent Credentials', input, provider, userPayload, pubSub);
4495
+ }
4496
+
4497
+ @Mutation(() => MJAIAgentCredential_)
4498
+ async DeleteMJAIAgentCredential(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
4499
+ const provider = GetReadWriteProvider(providers);
4500
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
4501
+ return this.DeleteRecord('MJ: AI Agent Credentials', key, options, provider, userPayload, pubSub);
4502
+ }
4503
+
4504
+ }
4505
+
4264
4506
  //****************************************************************************
4265
4507
  // ENTITY CLASS for MJ: AI Agent Data Sources
4266
4508
  //****************************************************************************
@@ -4942,6 +5184,233 @@ export class MJAIAgentExampleResolver extends ResolverBase {
4942
5184
 
4943
5185
  }
4944
5186
 
5187
+ //****************************************************************************
5188
+ // ENTITY CLASS for MJ: AI Agent Harnesses
5189
+ //****************************************************************************
5190
+ @ObjectType({ description: `Registry of external agent harnesses this installation can launch as the reasoning substrate for an MJ agent (Claude Code, Codex CLI, OpenCode, Pi, Cline). A row makes a harness AVAILABLE; an agent opts in by naming it in AIAgent.TypeConfiguration. Empty table = no agent can run on a harness, which is the pre-migration behaviour.` })
5191
+ export class MJAIAgentHarness_ {
5192
+ @Field()
5193
+ @MaxLength(36)
5194
+ ID: string;
5195
+
5196
+ @Field({description: `Unique name of the harness, e.g. Claude Code, Codex CLI, OpenCode, Pi, Cline. This is a LOOKUP KEY, not a label: an agent selects its harness by this name in AIAgent.TypeConfiguration ("harnessName"), so duplicates would make selection ambiguous at run time.`})
5197
+ @MaxLength(100)
5198
+ Name: string;
5199
+
5200
+ @Field({nullable: true, description: `Human-readable description of the harness - what it is good at, what it requires to be installed, and any deployment caveats.`})
5201
+ Description?: string;
5202
+
5203
+ @Field({description: `ClassFactory registration key for the BaseHarnessAdapter subclass that drives this harness (e.g. ClaudeCodeAdapter, CodexAdapter, StdioJsonAdapter). Resolved at run time, so a customer can register a proprietary adapter without forking core - the same extension mechanism AI model vendor drivers use.`})
5204
+ @MaxLength(255)
5205
+ DriverClass: string;
5206
+
5207
+ @Field({nullable: true, description: `Path to the harness CLI binary or entry point when the adapter shells out. NULL when the adapter embeds a vendor SDK and therefore launches nothing.`})
5208
+ @MaxLength(500)
5209
+ ExecutablePath?: string;
5210
+
5211
+ @Field({nullable: true})
5212
+ @MaxLength(36)
5213
+ AIVendorID?: string;
5214
+
5215
+ @Field({nullable: true})
5216
+ @MaxLength(36)
5217
+ AIModelID?: string;
5218
+
5219
+ @Field({nullable: true, description: `Default model passed to the harness where the harness supports being told which model to use. NULL leaves the harness on its own default.`})
5220
+ @MaxLength(255)
5221
+ DefaultModel?: string;
5222
+
5223
+ @Field({nullable: true, description: `Strongly-typed JSON of what this harness can do (the IHarnessCapabilitySettings interface, bound via JSONType metadata): session continuity (SessionResume), turn-protocol support (StructuredOutput), in-sandbox permission interception (PermissionHooks), and whether the harness can act as an MCP client for the read-only loopback (McpClient). The runtime gates behaviour on these - when SessionResume is false the adapter must replay prior context into a fresh invocation each turn, which costs extra tokens and has to be budgeted for. Held as JSON so a new capability needs no schema migration, just an added property on the interface. NULL/omitted = not supported.`})
5224
+ CapabilitySettings?: string;
5225
+
5226
+ @Field({description: `Whether this harness may be launched. Inactive keeps the row and its history for auditing while taking the harness out of service - preferable to deleting it, which would orphan agents configured to use it.`})
5227
+ @MaxLength(20)
5228
+ Status: string;
5229
+
5230
+ @Field()
5231
+ _mj__CreatedAt: Date;
5232
+
5233
+ @Field()
5234
+ _mj__UpdatedAt: Date;
5235
+
5236
+ @Field({nullable: true})
5237
+ @MaxLength(50)
5238
+ AIVendor?: string;
5239
+
5240
+ @Field({nullable: true})
5241
+ @MaxLength(50)
5242
+ AIModel?: string;
5243
+
5244
+ }
5245
+
5246
+ //****************************************************************************
5247
+ // INPUT TYPE for MJ: AI Agent Harnesses
5248
+ //****************************************************************************
5249
+ @InputType()
5250
+ export class CreateMJAIAgentHarnessInput {
5251
+ @Field({ nullable: true })
5252
+ ID?: string;
5253
+
5254
+ @Field({ nullable: true })
5255
+ Name?: string;
5256
+
5257
+ @Field({ nullable: true })
5258
+ Description: string | null;
5259
+
5260
+ @Field({ nullable: true })
5261
+ DriverClass?: string;
5262
+
5263
+ @Field({ nullable: true })
5264
+ ExecutablePath: string | null;
5265
+
5266
+ @Field({ nullable: true })
5267
+ AIVendorID: string | null;
5268
+
5269
+ @Field({ nullable: true })
5270
+ AIModelID: string | null;
5271
+
5272
+ @Field({ nullable: true })
5273
+ DefaultModel: string | null;
5274
+
5275
+ @Field({ nullable: true })
5276
+ CapabilitySettings: string | null;
5277
+
5278
+ @Field({ nullable: true })
5279
+ Status?: string;
5280
+
5281
+ @Field(() => RestoreContextInput, { nullable: true })
5282
+ RestoreContext___?: RestoreContextInput;
5283
+ }
5284
+
5285
+
5286
+ //****************************************************************************
5287
+ // INPUT TYPE for MJ: AI Agent Harnesses
5288
+ //****************************************************************************
5289
+ @InputType()
5290
+ export class UpdateMJAIAgentHarnessInput {
5291
+ @Field()
5292
+ ID: string;
5293
+
5294
+ @Field({ nullable: true })
5295
+ Name?: string;
5296
+
5297
+ @Field({ nullable: true })
5298
+ Description?: string | null;
5299
+
5300
+ @Field({ nullable: true })
5301
+ DriverClass?: string;
5302
+
5303
+ @Field({ nullable: true })
5304
+ ExecutablePath?: string | null;
5305
+
5306
+ @Field({ nullable: true })
5307
+ AIVendorID?: string | null;
5308
+
5309
+ @Field({ nullable: true })
5310
+ AIModelID?: string | null;
5311
+
5312
+ @Field({ nullable: true })
5313
+ DefaultModel?: string | null;
5314
+
5315
+ @Field({ nullable: true })
5316
+ CapabilitySettings?: string | null;
5317
+
5318
+ @Field({ nullable: true })
5319
+ Status?: string;
5320
+
5321
+ @Field(() => [KeyValuePairInput], { nullable: true })
5322
+ OldValues___?: KeyValuePairInput[];
5323
+
5324
+ @Field(() => RestoreContextInput, { nullable: true })
5325
+ RestoreContext___?: RestoreContextInput;
5326
+ }
5327
+
5328
+ //****************************************************************************
5329
+ // RESOLVER for MJ: AI Agent Harnesses
5330
+ //****************************************************************************
5331
+ @ObjectType()
5332
+ export class RunMJAIAgentHarnessViewResult {
5333
+ @Field(() => [MJAIAgentHarness_])
5334
+ Results: MJAIAgentHarness_[];
5335
+
5336
+ @Field(() => String, {nullable: true})
5337
+ UserViewRunID?: string;
5338
+
5339
+ @Field(() => Int, {nullable: true})
5340
+ RowCount: number;
5341
+
5342
+ @Field(() => Int, {nullable: true})
5343
+ TotalRowCount: number;
5344
+
5345
+ @Field(() => Int, {nullable: true})
5346
+ ExecutionTime: number;
5347
+
5348
+ @Field({nullable: true})
5349
+ ErrorMessage?: string;
5350
+
5351
+ @Field(() => Boolean, {nullable: false})
5352
+ Success: boolean;
5353
+ }
5354
+
5355
+ @Resolver(MJAIAgentHarness_)
5356
+ export class MJAIAgentHarnessResolver extends ResolverBase {
5357
+ @Query(() => RunMJAIAgentHarnessViewResult)
5358
+ async RunMJAIAgentHarnessViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
5359
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5360
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
5361
+ }
5362
+
5363
+ @Query(() => RunMJAIAgentHarnessViewResult)
5364
+ async RunMJAIAgentHarnessViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
5365
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5366
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
5367
+ }
5368
+
5369
+ @Query(() => RunMJAIAgentHarnessViewResult)
5370
+ async RunMJAIAgentHarnessDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
5371
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5372
+ input.EntityName = 'MJ: AI Agent Harnesses';
5373
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
5374
+ }
5375
+ @Query(() => MJAIAgentHarness_, { nullable: true })
5376
+ async MJAIAgentHarness(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJAIAgentHarness_ | null> {
5377
+ this.CheckUserReadPermissions('MJ: AI Agent Harnesses', userPayload);
5378
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5379
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentHarnesses')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Harnesses', userPayload, EntityPermissionType.Read, 'AND');
5380
+ const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
5381
+ const result = await this.MapFieldNamesToCodeNames('MJ: AI Agent Harnesses', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
5382
+ return result;
5383
+ }
5384
+
5385
+ @Mutation(() => MJAIAgentHarness_)
5386
+ async CreateMJAIAgentHarness(
5387
+ @Arg('input', () => CreateMJAIAgentHarnessInput) input: CreateMJAIAgentHarnessInput,
5388
+ @Ctx() { providers, userPayload }: AppContext,
5389
+ @PubSub() pubSub: PubSubEngine
5390
+ ) {
5391
+ const provider = GetReadWriteProvider(providers);
5392
+ return this.CreateRecord('MJ: AI Agent Harnesses', input, provider, userPayload, pubSub)
5393
+ }
5394
+
5395
+ @Mutation(() => MJAIAgentHarness_)
5396
+ async UpdateMJAIAgentHarness(
5397
+ @Arg('input', () => UpdateMJAIAgentHarnessInput) input: UpdateMJAIAgentHarnessInput,
5398
+ @Ctx() { providers, userPayload }: AppContext,
5399
+ @PubSub() pubSub: PubSubEngine
5400
+ ) {
5401
+ const provider = GetReadWriteProvider(providers);
5402
+ return this.UpdateRecord('MJ: AI Agent Harnesses', input, provider, userPayload, pubSub);
5403
+ }
5404
+
5405
+ @Mutation(() => MJAIAgentHarness_)
5406
+ async DeleteMJAIAgentHarness(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
5407
+ const provider = GetReadWriteProvider(providers);
5408
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
5409
+ return this.DeleteRecord('MJ: AI Agent Harnesses', key, options, provider, userPayload, pubSub);
5410
+ }
5411
+
5412
+ }
5413
+
4945
5414
  //****************************************************************************
4946
5415
  // ENTITY CLASS for MJ: AI Agent Learning Cycles
4947
5416
  //****************************************************************************
@@ -8146,6 +8615,13 @@ each time the agent processes a prompt step.`})
8146
8615
  @Field(() => Boolean, {description: `1 when this run executed under plan mode (whether via the per-request planMode flag or the agent's RequirePlanMode setting). Drives plan-mode indicators in the run UX and supports plan-drift auditing (comparing the approved plan against the steps that actually executed).`})
8147
8616
  PlanMode: boolean;
8148
8617
 
8618
+ @Field({nullable: true, description: `Session identifier reported by the external harness backing this run. Kept for two reasons that outlive the run: resuming the session across turns, and correlating this run with the vendor's own session logs when diagnosing behaviour INSIDE the sandbox, where MJ's audit trail necessarily stops at the turn boundary. NULL for every run not backed by a harness.`})
8619
+ @MaxLength(255)
8620
+ ExternalSessionID?: string;
8621
+
8622
+ @Field(() => Int, {description: `How many task-graph continuations led to this run. 0 (the default, and the value every ordinary run carries) means the run was not started by a finished graph. A run started because a graph declared continuation='reinvoke' records its source graph's depth plus one, and any graph that run subsequently submits inherits that value — which is what allows MAX_REINVOKE_DEPTH to bound a chain of graph-reinvokes-agent-emits-graph. Without a durable value here the cap could never fire, because a reinvoked agent has no other way to learn it was a continuation. Distinct from ParentRunID, which tracks sub-agent lineage within a single turn; a continuation is a NEW top-level turn caused by work that already completed.`})
8623
+ ContinuationDepth: number;
8624
+
8149
8625
  @Field({nullable: true})
8150
8626
  @MaxLength(255)
8151
8627
  Agent?: string;
@@ -8238,6 +8714,9 @@ each time the agent processes a prompt step.`})
8238
8714
  @Field(() => [MJExperimentSession_])
8239
8715
  MJExperimentSessions_AgentRunIDArray: MJExperimentSession_[]; // Link to MJExperimentSessions
8240
8716
 
8717
+ @Field(() => [MJTask_])
8718
+ MJTasks_AgentRunIDArray: MJTask_[]; // Link to MJTasks
8719
+
8241
8720
  @Field(() => [MJUserRoutineRun_])
8242
8721
  MJUserRoutineRuns_AgentRunIDArray: MJUserRoutineRun_[]; // Link to MJUserRoutineRuns
8243
8722
 
@@ -8395,6 +8874,12 @@ export class CreateMJAIAgentRunInput {
8395
8874
  @Field(() => Boolean, { nullable: true })
8396
8875
  PlanMode?: boolean;
8397
8876
 
8877
+ @Field({ nullable: true })
8878
+ ExternalSessionID: string | null;
8879
+
8880
+ @Field(() => Int, { nullable: true })
8881
+ ContinuationDepth?: number;
8882
+
8398
8883
  @Field(() => RestoreContextInput, { nullable: true })
8399
8884
  RestoreContext___?: RestoreContextInput;
8400
8885
  }
@@ -8552,6 +9037,12 @@ export class UpdateMJAIAgentRunInput {
8552
9037
  @Field(() => Boolean, { nullable: true })
8553
9038
  PlanMode?: boolean;
8554
9039
 
9040
+ @Field({ nullable: true })
9041
+ ExternalSessionID?: string | null;
9042
+
9043
+ @Field(() => Int, { nullable: true })
9044
+ ContinuationDepth?: number;
9045
+
8555
9046
  @Field(() => [KeyValuePairInput], { nullable: true })
8556
9047
  OldValues___?: KeyValuePairInput[];
8557
9048
 
@@ -8736,6 +9227,16 @@ export class MJAIAgentRunResolver extends ResolverBase {
8736
9227
  return result;
8737
9228
  }
8738
9229
 
9230
+ @FieldResolver(() => [MJTask_])
9231
+ async MJTasks_AgentRunIDArray(@Root() mjaiagentrun_: MJAIAgentRun_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
9232
+ this.CheckUserReadPermissions('MJ: Tasks', userPayload);
9233
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
9234
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwTasks')} WHERE ${provider.QuoteIdentifier('AgentRunID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Tasks', userPayload, EntityPermissionType.Read, 'AND');
9235
+ const rows = await provider.ExecuteSQL(sSQL, [mjaiagentrun_.ID], undefined, this.GetUserFromPayload(userPayload));
9236
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Tasks', rows, this.GetUserFromPayload(userPayload));
9237
+ return result;
9238
+ }
9239
+
8739
9240
  @FieldResolver(() => [MJUserRoutineRun_])
8740
9241
  async MJUserRoutineRuns_AgentRunIDArray(@Root() mjaiagentrun_: MJAIAgentRun_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
8741
9242
  this.CheckUserReadPermissions('MJ: User Routine Runs', userPayload);
@@ -11659,6 +12160,9 @@ if this limit is exceeded.`})
11659
12160
  @Field(() => [MJAISkillSubAgent_])
11660
12161
  MJAISkillSubAgents_SubAgentIDArray: MJAISkillSubAgent_[]; // Link to MJAISkillSubAgents
11661
12162
 
12163
+ @Field(() => [MJAIAgentCredential_])
12164
+ MJAIAgentCredentials_AgentIDArray: MJAIAgentCredential_[]; // Link to MJAIAgentCredentials
12165
+
11662
12166
  }
11663
12167
 
11664
12168
  //****************************************************************************
@@ -12578,6 +13082,16 @@ export class MJAIAgentResolver extends ResolverBase {
12578
13082
  return result;
12579
13083
  }
12580
13084
 
13085
+ @FieldResolver(() => [MJAIAgentCredential_])
13086
+ async MJAIAgentCredentials_AgentIDArray(@Root() mjaiagent_: MJAIAgent_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
13087
+ this.CheckUserReadPermissions('MJ: AI Agent Credentials', userPayload);
13088
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
13089
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentCredentials')} WHERE ${provider.QuoteIdentifier('AgentID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Credentials', userPayload, EntityPermissionType.Read, 'AND');
13090
+ const rows = await provider.ExecuteSQL(sSQL, [mjaiagent_.ID], undefined, this.GetUserFromPayload(userPayload));
13091
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Credentials', rows, this.GetUserFromPayload(userPayload));
13092
+ return result;
13093
+ }
13094
+
12581
13095
  @Mutation(() => MJAIAgent_)
12582
13096
  async CreateMJAIAgent(
12583
13097
  @Arg('input', () => CreateMJAIAgentInput) input: CreateMJAIAgentInput,
@@ -16650,6 +17164,9 @@ export class MJAIModel_ {
16650
17164
  @Field(() => [MJScopedPromptConfig_])
16651
17165
  MJScopedPromptConfigs_ModelIDArray: MJScopedPromptConfig_[]; // Link to MJScopedPromptConfigs
16652
17166
 
17167
+ @Field(() => [MJAIAgentHarness_])
17168
+ MJAIAgentHarnesses_AIModelIDArray: MJAIAgentHarness_[]; // Link to MJAIAgentHarnesses
17169
+
16653
17170
  }
16654
17171
 
16655
17172
  //****************************************************************************
@@ -17121,6 +17638,16 @@ export class MJAIModelResolver extends ResolverBase {
17121
17638
  return result;
17122
17639
  }
17123
17640
 
17641
+ @FieldResolver(() => [MJAIAgentHarness_])
17642
+ async MJAIAgentHarnesses_AIModelIDArray(@Root() mjaimodel_: MJAIModel_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
17643
+ this.CheckUserReadPermissions('MJ: AI Agent Harnesses', userPayload);
17644
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
17645
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentHarnesses')} WHERE ${provider.QuoteIdentifier('AIModelID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Harnesses', userPayload, EntityPermissionType.Read, 'AND');
17646
+ const rows = await provider.ExecuteSQL(sSQL, [mjaimodel_.ID], undefined, this.GetUserFromPayload(userPayload));
17647
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Harnesses', rows, this.GetUserFromPayload(userPayload));
17648
+ return result;
17649
+ }
17650
+
17124
17651
  @Mutation(() => MJAIModel_)
17125
17652
  async CreateMJAIModel(
17126
17653
  @Arg('input', () => CreateMJAIModelInput) input: CreateMJAIModelInput,
@@ -22017,6 +22544,9 @@ export class MJAIVendor_ {
22017
22544
  @Field(() => [MJScopedPromptConfig_])
22018
22545
  MJScopedPromptConfigs_VendorIDArray: MJScopedPromptConfig_[]; // Link to MJScopedPromptConfigs
22019
22546
 
22547
+ @Field(() => [MJAIAgentHarness_])
22548
+ MJAIAgentHarnesses_AIVendorIDArray: MJAIAgentHarness_[]; // Link to MJAIAgentHarnesses
22549
+
22020
22550
  }
22021
22551
 
22022
22552
  //****************************************************************************
@@ -22212,6 +22742,16 @@ export class MJAIVendorResolver extends ResolverBase {
22212
22742
  return result;
22213
22743
  }
22214
22744
 
22745
+ @FieldResolver(() => [MJAIAgentHarness_])
22746
+ async MJAIAgentHarnesses_AIVendorIDArray(@Root() mjaivendor_: MJAIVendor_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
22747
+ this.CheckUserReadPermissions('MJ: AI Agent Harnesses', userPayload);
22748
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
22749
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentHarnesses')} WHERE ${provider.QuoteIdentifier('AIVendorID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Harnesses', userPayload, EntityPermissionType.Read, 'AND');
22750
+ const rows = await provider.ExecuteSQL(sSQL, [mjaivendor_.ID], undefined, this.GetUserFromPayload(userPayload));
22751
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Harnesses', rows, this.GetUserFromPayload(userPayload));
22752
+ return result;
22753
+ }
22754
+
22215
22755
  @Mutation(() => MJAIVendor_)
22216
22756
  async CreateMJAIVendor(
22217
22757
  @Arg('input', () => CreateMJAIVendorInput) input: CreateMJAIVendorInput,
@@ -22278,6 +22818,10 @@ export class MJAPIApplicationScope_ {
22278
22818
  @Field()
22279
22819
  _mj__UpdatedAt: Date;
22280
22820
 
22821
+ @Field({nullable: true, description: `Optional row-level filter acting as a CEILING for every API key operating under this application — a restriction keys inherit and cannot widen. Composes with the per-key filter (APIKeyScope.RowFilterID) and with role-based RLS using AND, never OR, so no layer can broaden another. References the same RowLevelSecurityFilter catalog used by role-based RLS. NULL (the default) means the application imposes no row ceiling. The same authoring constraints as APIKeyScope.RowFilterID apply: exact single-entity resource pattern, all referenced columns must exist on that entity, and all referrers of the filter record must resolve to the same entity.`})
22822
+ @MaxLength(36)
22823
+ RowFilterID?: string;
22824
+
22281
22825
  @Field()
22282
22826
  @MaxLength(100)
22283
22827
  Application: string;
@@ -22286,6 +22830,10 @@ export class MJAPIApplicationScope_ {
22286
22830
  @MaxLength(100)
22287
22831
  Scope: string;
22288
22832
 
22833
+ @Field({nullable: true})
22834
+ @MaxLength(100)
22835
+ RowFilter?: string;
22836
+
22289
22837
  }
22290
22838
 
22291
22839
  //****************************************************************************
@@ -22314,6 +22862,9 @@ export class CreateMJAPIApplicationScopeInput {
22314
22862
  @Field(() => Int, { nullable: true })
22315
22863
  Priority?: number;
22316
22864
 
22865
+ @Field({ nullable: true })
22866
+ RowFilterID: string | null;
22867
+
22317
22868
  @Field(() => RestoreContextInput, { nullable: true })
22318
22869
  RestoreContext___?: RestoreContextInput;
22319
22870
  }
@@ -22345,6 +22896,9 @@ export class UpdateMJAPIApplicationScopeInput {
22345
22896
  @Field(() => Int, { nullable: true })
22346
22897
  Priority?: number;
22347
22898
 
22899
+ @Field({ nullable: true })
22900
+ RowFilterID?: string | null;
22901
+
22348
22902
  @Field(() => [KeyValuePairInput], { nullable: true })
22349
22903
  OldValues___?: KeyValuePairInput[];
22350
22904
 
@@ -22833,6 +23387,10 @@ export class MJAPIKeyScope_ {
22833
23387
  @Field(() => Int, {description: `Rule evaluation order. Higher priority rules are evaluated first. Within same priority, deny rules are evaluated before allow rules.`})
22834
23388
  Priority: number;
22835
23389
 
23390
+ @Field({nullable: true, description: `Optional row-level filter narrowing WHICH RECORDS this scope grant applies to, in addition to the resource pattern that governs which entities. References the same RowLevelSecurityFilter catalog used by role-based RLS, so the filter text flows through the standard {{Token}} substitution engine and every existing RLS enforcement point (RunView, Load by primary key, save, delete, search). NULL (the default) means no row restriction — behavior identical to before this column existed. When set, the rule's ResourcePattern must name a single exact entity (no wildcards, no comma-separated lists), every column the filter references must resolve to a real non-virtual field on that entity, and every other referrer of the same filter record must resolve to that same entity. Critically, this filter is evaluated INDEPENDENTLY of the role-RLS exemption: a user exempt from role RLS is still bound by their key's filter, because narrowing a principal below what their roles allow is the entire purpose of a key ceiling.`})
23391
+ @MaxLength(36)
23392
+ RowFilterID?: string;
23393
+
22836
23394
  @Field()
22837
23395
  @MaxLength(255)
22838
23396
  APIKey: string;
@@ -22841,6 +23399,10 @@ export class MJAPIKeyScope_ {
22841
23399
  @MaxLength(100)
22842
23400
  Scope: string;
22843
23401
 
23402
+ @Field({nullable: true})
23403
+ @MaxLength(100)
23404
+ RowFilter?: string;
23405
+
22844
23406
  }
22845
23407
 
22846
23408
  //****************************************************************************
@@ -22869,6 +23431,9 @@ export class CreateMJAPIKeyScopeInput {
22869
23431
  @Field(() => Int, { nullable: true })
22870
23432
  Priority?: number;
22871
23433
 
23434
+ @Field({ nullable: true })
23435
+ RowFilterID: string | null;
23436
+
22872
23437
  @Field(() => RestoreContextInput, { nullable: true })
22873
23438
  RestoreContext___?: RestoreContextInput;
22874
23439
  }
@@ -22900,6 +23465,9 @@ export class UpdateMJAPIKeyScopeInput {
22900
23465
  @Field(() => Int, { nullable: true })
22901
23466
  Priority?: number;
22902
23467
 
23468
+ @Field({ nullable: true })
23469
+ RowFilterID?: string | null;
23470
+
22903
23471
  @Field(() => [KeyValuePairInput], { nullable: true })
22904
23472
  OldValues___?: KeyValuePairInput[];
22905
23473
 
@@ -34383,6 +34951,10 @@ export class MJContentItemChunk_ {
34383
34951
  @MaxLength(250)
34384
34952
  ContentItem?: string;
34385
34953
 
34954
+ @Field({nullable: true})
34955
+ @MaxLength(500)
34956
+ ParentChunk?: string;
34957
+
34386
34958
  @Field({nullable: true})
34387
34959
  @MaxLength(36)
34388
34960
  RootParentChunkID?: string;
@@ -36813,10 +37385,6 @@ export class MJContentSource_ {
36813
37385
  @MaxLength(36)
36814
37386
  EntityDocumentID?: string;
36815
37387
 
36816
- @Field({nullable: true, description: `Optional link to a MJ Scheduled Action that automatically runs the classification pipeline for this source on a cron schedule.`})
36817
- @MaxLength(36)
36818
- ScheduledActionID?: string;
36819
-
36820
37388
  @Field({nullable: true, description: `Registration key of the segmentation strategy used to split this source's content into embeddable chunks — for example StructuralText (document headings), AdaptiveBoundary (target size closing on the nearest natural break), SemanticText (LLM-detected topic boundaries), Transcript (audio/video chapters), PagedContent (one segment per page), or FixedWindow (uniform windows). NULL falls back to the Content Type's value, then to a built-in default.`})
36821
37389
  @MaxLength(100)
36822
37390
  SegmenterKey?: string;
@@ -36825,6 +37393,10 @@ export class MJContentSource_ {
36825
37393
  @MaxLength(100)
36826
37394
  CleanerKey?: string;
36827
37395
 
37396
+ @Field({nullable: true, description: `Optional link to the Scheduled Job that runs this content source on a recurring basis. Replaces the retired ScheduledActionID link; the job is of type Action and carries its action + parameters in ScheduledJob.Configuration.`})
37397
+ @MaxLength(36)
37398
+ ScheduledJobID?: string;
37399
+
36828
37400
  @Field()
36829
37401
  @MaxLength(255)
36830
37402
  ContentType: string;
@@ -36854,8 +37426,8 @@ export class MJContentSource_ {
36854
37426
  EntityDocument?: string;
36855
37427
 
36856
37428
  @Field({nullable: true})
36857
- @MaxLength(255)
36858
- ScheduledAction?: string;
37429
+ @MaxLength(200)
37430
+ ScheduledJob?: string;
36859
37431
 
36860
37432
  @Field(() => [MJContentItem_])
36861
37433
  MJContentItems_ContentSourceIDArray: MJContentItem_[]; // Link to MJContentItems
@@ -36912,15 +37484,15 @@ export class CreateMJContentSourceInput {
36912
37484
  @Field({ nullable: true })
36913
37485
  EntityDocumentID: string | null;
36914
37486
 
36915
- @Field({ nullable: true })
36916
- ScheduledActionID: string | null;
36917
-
36918
37487
  @Field({ nullable: true })
36919
37488
  SegmenterKey: string | null;
36920
37489
 
36921
37490
  @Field({ nullable: true })
36922
37491
  CleanerKey: string | null;
36923
37492
 
37493
+ @Field({ nullable: true })
37494
+ ScheduledJobID: string | null;
37495
+
36924
37496
  @Field(() => RestoreContextInput, { nullable: true })
36925
37497
  RestoreContext___?: RestoreContextInput;
36926
37498
  }
@@ -36964,15 +37536,15 @@ export class UpdateMJContentSourceInput {
36964
37536
  @Field({ nullable: true })
36965
37537
  EntityDocumentID?: string | null;
36966
37538
 
36967
- @Field({ nullable: true })
36968
- ScheduledActionID?: string | null;
36969
-
36970
37539
  @Field({ nullable: true })
36971
37540
  SegmenterKey?: string | null;
36972
37541
 
36973
37542
  @Field({ nullable: true })
36974
37543
  CleanerKey?: string | null;
36975
37544
 
37545
+ @Field({ nullable: true })
37546
+ ScheduledJobID?: string | null;
37547
+
36976
37548
  @Field(() => [KeyValuePairInput], { nullable: true })
36977
37549
  OldValues___?: KeyValuePairInput[];
36978
37550
 
@@ -39078,9 +39650,6 @@ export class MJConversationDetail_ {
39078
39650
  @MaxLength(36)
39079
39651
  RootParentID?: string;
39080
39652
 
39081
- @Field(() => [MJReport_])
39082
- MJReports_ConversationDetailIDArray: MJReport_[]; // Link to MJReports
39083
-
39084
39653
  @Field(() => [MJConversationDetailArtifact_])
39085
39654
  MJConversationDetailArtifacts_ConversationDetailIDArray: MJConversationDetailArtifact_[]; // Link to MJConversationDetailArtifacts
39086
39655
 
@@ -39369,16 +39938,6 @@ export class MJConversationDetailResolver extends ResolverBase {
39369
39938
  return result;
39370
39939
  }
39371
39940
 
39372
- @FieldResolver(() => [MJReport_])
39373
- async MJReports_ConversationDetailIDArray(@Root() mjconversationdetail_: MJConversationDetail_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
39374
- this.CheckUserReadPermissions('MJ: Reports', userPayload);
39375
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
39376
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReports')} WHERE ${provider.QuoteIdentifier('ConversationDetailID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Reports', userPayload, EntityPermissionType.Read, 'AND');
39377
- const rows = await provider.ExecuteSQL(sSQL, [mjconversationdetail_.ID], undefined, this.GetUserFromPayload(userPayload));
39378
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Reports', rows, this.GetUserFromPayload(userPayload));
39379
- return result;
39380
- }
39381
-
39382
39941
  @FieldResolver(() => [MJConversationDetailArtifact_])
39383
39942
  async MJConversationDetailArtifacts_ConversationDetailIDArray(@Root() mjconversationdetail_: MJConversationDetail_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
39384
39943
  this.CheckUserReadPermissions('MJ: Conversation Detail Artifacts', userPayload);
@@ -39939,9 +40498,6 @@ export class MJConversation_ {
39939
40498
  @Field(() => [MJConversationDetail_])
39940
40499
  MJConversationDetails_ConversationIDArray: MJConversationDetail_[]; // Link to MJConversationDetails
39941
40500
 
39942
- @Field(() => [MJReport_])
39943
- MJReports_ConversationIDArray: MJReport_[]; // Link to MJReports
39944
-
39945
40501
  @Field(() => [MJConversationArtifact_])
39946
40502
  MJConversationArtifacts_ConversationIDArray: MJConversationArtifact_[]; // Link to MJConversationArtifacts
39947
40503
 
@@ -40192,16 +40748,6 @@ export class MJConversationResolver extends ResolverBase {
40192
40748
  return result;
40193
40749
  }
40194
40750
 
40195
- @FieldResolver(() => [MJReport_])
40196
- async MJReports_ConversationIDArray(@Root() mjconversation_: MJConversation_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
40197
- this.CheckUserReadPermissions('MJ: Reports', userPayload);
40198
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
40199
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReports')} WHERE ${provider.QuoteIdentifier('ConversationID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Reports', userPayload, EntityPermissionType.Read, 'AND');
40200
- const rows = await provider.ExecuteSQL(sSQL, [mjconversation_.ID], undefined, this.GetUserFromPayload(userPayload));
40201
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Reports', rows, this.GetUserFromPayload(userPayload));
40202
- return result;
40203
- }
40204
-
40205
40751
  @FieldResolver(() => [MJConversationArtifact_])
40206
40752
  async MJConversationArtifacts_ConversationIDArray(@Root() mjconversation_: MJConversation_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
40207
40753
  this.CheckUserReadPermissions('MJ: Conversation Artifacts', userPayload);
@@ -41078,6 +41624,9 @@ export class MJCredential_ {
41078
41624
  @Field(() => [MJExternalDataSource_])
41079
41625
  MJExternalDataSources_CredentialIDArray: MJExternalDataSource_[]; // Link to MJExternalDataSources
41080
41626
 
41627
+ @Field(() => [MJAIAgentCredential_])
41628
+ MJAIAgentCredentials_CredentialIDArray: MJAIAgentCredential_[]; // Link to MJAIAgentCredentials
41629
+
41081
41630
  }
41082
41631
 
41083
41632
  //****************************************************************************
@@ -41321,6 +41870,16 @@ export class MJCredentialResolver extends ResolverBase {
41321
41870
  return result;
41322
41871
  }
41323
41872
 
41873
+ @FieldResolver(() => [MJAIAgentCredential_])
41874
+ async MJAIAgentCredentials_CredentialIDArray(@Root() mjcredential_: MJCredential_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
41875
+ this.CheckUserReadPermissions('MJ: AI Agent Credentials', userPayload);
41876
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
41877
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentCredentials')} WHERE ${provider.QuoteIdentifier('CredentialID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Credentials', userPayload, EntityPermissionType.Read, 'AND');
41878
+ const rows = await provider.ExecuteSQL(sSQL, [mjcredential_.ID], undefined, this.GetUserFromPayload(userPayload));
41879
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Credentials', rows, this.GetUserFromPayload(userPayload));
41880
+ return result;
41881
+ }
41882
+
41324
41883
  @Mutation(() => MJCredential_)
41325
41884
  async CreateMJCredential(
41326
41885
  @Arg('input', () => CreateMJCredentialInput) input: CreateMJCredentialInput,
@@ -43366,9 +43925,6 @@ export class MJDataContext_ {
43366
43925
  @Field(() => [MJDataContextItem_])
43367
43926
  MJDataContextItems_DataContextIDArray: MJDataContextItem_[]; // Link to MJDataContextItems
43368
43927
 
43369
- @Field(() => [MJReport_])
43370
- MJReports_DataContextIDArray: MJReport_[]; // Link to MJReports
43371
-
43372
43928
  @Field(() => [MJConversation_])
43373
43929
  MJConversations_DataContextIDArray: MJConversation_[]; // Link to MJConversations
43374
43930
 
@@ -43493,16 +44049,6 @@ export class MJDataContextResolver extends ResolverBase {
43493
44049
  return result;
43494
44050
  }
43495
44051
 
43496
- @FieldResolver(() => [MJReport_])
43497
- async MJReports_DataContextIDArray(@Root() mjdatacontext_: MJDataContext_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
43498
- this.CheckUserReadPermissions('MJ: Reports', userPayload);
43499
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
43500
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReports')} WHERE ${provider.QuoteIdentifier('DataContextID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Reports', userPayload, EntityPermissionType.Read, 'AND');
43501
- const rows = await provider.ExecuteSQL(sSQL, [mjdatacontext_.ID], undefined, this.GetUserFromPayload(userPayload));
43502
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Reports', rows, this.GetUserFromPayload(userPayload));
43503
- return result;
43504
- }
43505
-
43506
44052
  @FieldResolver(() => [MJConversation_])
43507
44053
  async MJConversations_DataContextIDArray(@Root() mjdatacontext_: MJDataContext_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
43508
44054
  this.CheckUserReadPermissions('MJ: Conversations', userPayload);
@@ -46499,6 +47045,19 @@ export class MJEntity_ {
46499
47045
  @MaxLength(255)
46500
47046
  ExternalObjectName?: string;
46501
47047
 
47048
+ @Field({nullable: true, description: `When set, CodeGen generates the entity's full base view under THIS name instead of BaseView, and the application owns BaseView — which is expected to wrap it (SELECT g.*, <extras> FROM <GeneratedBaseViewName> g). This gives an entity a custom base view WITHOUT inheriting the generated SQL: related-entity display joins, geo columns and recursive root-ID columns keep regenerating underneath, so a foreign key added later still appears. NULL (the default, and every pre-existing row) means the previous all-or-nothing behaviour: BaseViewGenerated alone decides whether CodeGen writes BaseView, and there is no second view. BaseView remains the public surface — entity field discovery, permissions and the generated CRUD procedures all target it. SQL SERVER ONLY: layering relies on sp_refreshview to re-resolve the application-owned outer view's SELECT * against a regenerated inner view. PostgreSQL freezes a view's column list at creation and has no refresh equivalent, so CodeGen rejects this column on PostgreSQL rather than let the outer view go silently stale.`})
47049
+ @MaxLength(255)
47050
+ GeneratedBaseViewName?: string;
47051
+
47052
+ @Field(() => Boolean, {description: `When 1, this entity may be populated by INSERT statements that do not go through BaseEntity.Save() — bulk loads, ETL/integration sync, or rows created as a side effect of a stored procedure. Default 0, meaning every insert is expected to flow through BaseEntity so that record-change tracking, entity actions, validation and cache invalidation all run. This column DECLARES intent for the code paths and tooling that consult it; it does not and cannot prevent anyone from executing SQL. Requires TrackRecordChanges = 0 and TrustServerCacheCompletely = 0, because a direct insert produces neither an audit row nor a cache-invalidation event.`})
47053
+ AllowDirectSQLInsert: boolean;
47054
+
47055
+ @Field(() => Boolean, {description: `When 1, this entity may be modified by UPDATE statements that do not go through BaseEntity.Save() — bulk backfills, integration sync, or maintenance routines. Default 0, meaning every update is expected to flow through BaseEntity so that record-change tracking, entity actions, validation and cache invalidation all run. This column DECLARES intent for the code paths and tooling that consult it; it does not and cannot prevent anyone from executing SQL. Requires TrackRecordChanges = 0 and TrustServerCacheCompletely = 0, because a direct update produces neither an audit row nor a cache-invalidation event.`})
47056
+ AllowDirectSQLUpdate: boolean;
47057
+
47058
+ @Field(() => Boolean, {description: `When 1, this entity may have rows removed by DELETE statements that do not go through BaseEntity.Delete() — purge and retention routines, or integration sync reconciling a remote source. Default 0, meaning every delete is expected to flow through BaseEntity so that record-change tracking, entity actions, cascade handling and cache invalidation all run. This column DECLARES intent for the code paths and tooling that consult it; it does not and cannot prevent anyone from executing SQL. Requires TrackRecordChanges = 0 and TrustServerCacheCompletely = 0, and additionally requires DeleteType = 'Hard' — a direct DELETE removes the row outright rather than setting DeletedAt, which would defeat soft delete.`})
47059
+ AllowDirectSQLDelete: boolean;
47060
+
46502
47061
  @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.`})
46503
47062
  CodeName?: string;
46504
47063
 
@@ -46737,6 +47296,12 @@ export class MJEntity_ {
46737
47296
  @Field(() => [MJScopedPromptConfig_])
46738
47297
  MJScopedPromptConfigs_PrimaryScopeEntityIDArray: MJScopedPromptConfig_[]; // Link to MJScopedPromptConfigs
46739
47298
 
47299
+ @Field(() => [MJActionExecutionLog_])
47300
+ MJActionExecutionLogs_TargetEntityIDArray: MJActionExecutionLog_[]; // Link to MJActionExecutionLogs
47301
+
47302
+ @Field(() => [MJEntityAction_])
47303
+ MJEntityActions_ScopeEntityIDArray: MJEntityAction_[]; // Link to MJEntityActions
47304
+
46740
47305
  }
46741
47306
 
46742
47307
  //****************************************************************************
@@ -46933,6 +47498,18 @@ export class CreateMJEntityInput {
46933
47498
  @Field({ nullable: true })
46934
47499
  ExternalObjectName: string | null;
46935
47500
 
47501
+ @Field({ nullable: true })
47502
+ GeneratedBaseViewName: string | null;
47503
+
47504
+ @Field(() => Boolean, { nullable: true })
47505
+ AllowDirectSQLInsert?: boolean;
47506
+
47507
+ @Field(() => Boolean, { nullable: true })
47508
+ AllowDirectSQLUpdate?: boolean;
47509
+
47510
+ @Field(() => Boolean, { nullable: true })
47511
+ AllowDirectSQLDelete?: boolean;
47512
+
46936
47513
  @Field(() => RestoreContextInput, { nullable: true })
46937
47514
  RestoreContext___?: RestoreContextInput;
46938
47515
  }
@@ -47132,6 +47709,18 @@ export class UpdateMJEntityInput {
47132
47709
  @Field({ nullable: true })
47133
47710
  ExternalObjectName?: string | null;
47134
47711
 
47712
+ @Field({ nullable: true })
47713
+ GeneratedBaseViewName?: string | null;
47714
+
47715
+ @Field(() => Boolean, { nullable: true })
47716
+ AllowDirectSQLInsert?: boolean;
47717
+
47718
+ @Field(() => Boolean, { nullable: true })
47719
+ AllowDirectSQLUpdate?: boolean;
47720
+
47721
+ @Field(() => Boolean, { nullable: true })
47722
+ AllowDirectSQLDelete?: boolean;
47723
+
47135
47724
  @Field(() => [KeyValuePairInput], { nullable: true })
47136
47725
  OldValues___?: KeyValuePairInput[];
47137
47726
 
@@ -47916,6 +48505,26 @@ export class MJEntityResolverBase extends ResolverBase {
47916
48505
  return result;
47917
48506
  }
47918
48507
 
48508
+ @FieldResolver(() => [MJActionExecutionLog_])
48509
+ async MJActionExecutionLogs_TargetEntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
48510
+ this.CheckUserReadPermissions('MJ: Action Execution Logs', userPayload);
48511
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
48512
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwActionExecutionLogs')} WHERE ${provider.QuoteIdentifier('TargetEntityID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Action Execution Logs', userPayload, EntityPermissionType.Read, 'AND');
48513
+ const rows = await provider.ExecuteSQL(sSQL, [mjentity_.ID], undefined, this.GetUserFromPayload(userPayload));
48514
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Action Execution Logs', rows, this.GetUserFromPayload(userPayload));
48515
+ return result;
48516
+ }
48517
+
48518
+ @FieldResolver(() => [MJEntityAction_])
48519
+ async MJEntityActions_ScopeEntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
48520
+ this.CheckUserReadPermissions('MJ: Entity Actions', userPayload);
48521
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
48522
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwEntityActions')} WHERE ${provider.QuoteIdentifier('ScopeEntityID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Entity Actions', userPayload, EntityPermissionType.Read, 'AND');
48523
+ const rows = await provider.ExecuteSQL(sSQL, [mjentity_.ID], undefined, this.GetUserFromPayload(userPayload));
48524
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Entity Actions', rows, this.GetUserFromPayload(userPayload));
48525
+ return result;
48526
+ }
48527
+
47919
48528
  @Mutation(() => MJEntity_)
47920
48529
  async CreateMJEntity(
47921
48530
  @Arg('input', () => CreateMJEntityInput) input: CreateMJEntityInput,
@@ -48150,6 +48759,9 @@ export class MJEntityActionInvocationType_ {
48150
48759
  @Field(() => [MJEntityActionInvocation_])
48151
48760
  MJEntityActionInvocations_InvocationTypeIDArray: MJEntityActionInvocation_[]; // Link to MJEntityActionInvocations
48152
48761
 
48762
+ @Field(() => [MJActionExecutionLog_])
48763
+ MJActionExecutionLogs_EntityActionInvocationTypeIDArray: MJActionExecutionLog_[]; // Link to MJActionExecutionLogs
48764
+
48153
48765
  }
48154
48766
 
48155
48767
  //****************************************************************************
@@ -48265,6 +48877,16 @@ export class MJEntityActionInvocationTypeResolver extends ResolverBase {
48265
48877
  return result;
48266
48878
  }
48267
48879
 
48880
+ @FieldResolver(() => [MJActionExecutionLog_])
48881
+ async MJActionExecutionLogs_EntityActionInvocationTypeIDArray(@Root() mjentityactioninvocationtype_: MJEntityActionInvocationType_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
48882
+ this.CheckUserReadPermissions('MJ: Action Execution Logs', userPayload);
48883
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
48884
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwActionExecutionLogs')} WHERE ${provider.QuoteIdentifier('EntityActionInvocationTypeID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Action Execution Logs', userPayload, EntityPermissionType.Read, 'AND');
48885
+ const rows = await provider.ExecuteSQL(sSQL, [mjentityactioninvocationtype_.ID], undefined, this.GetUserFromPayload(userPayload));
48886
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Action Execution Logs', rows, this.GetUserFromPayload(userPayload));
48887
+ return result;
48888
+ }
48889
+
48268
48890
  @Mutation(() => MJEntityActionInvocationType_)
48269
48891
  async CreateMJEntityActionInvocationType(
48270
48892
  @Arg('input', () => CreateMJEntityActionInvocationTypeInput) input: CreateMJEntityActionInvocationTypeInput,
@@ -48490,7 +49112,7 @@ export class MJEntityActionParam_ {
48490
49112
  @MaxLength(36)
48491
49113
  ActionParamID: string;
48492
49114
 
48493
- @Field({description: `Type of the value, which can be Static, Entity Object, or Script.`})
49115
+ @Field({description: `How the parameter value is produced at invocation time. Static = the literal Value (parsed as JSON when it parses). Entity Object = the live BaseEntity instance, for actions that call entity methods. Entity Object Data = entity.GetAll(), a plain object - use this for any action that SERIALIZES the value, such as the Data payload of Execute Agent, because a BaseEntity serializes to {} (its fields are getters, not enumerable own properties). Entity Field = the named field's value. Script = evaluated expression with the entity in scope.`})
48494
49116
  @MaxLength(20)
48495
49117
  ValueType: string;
48496
49118
 
@@ -48506,6 +49128,9 @@ export class MJEntityActionParam_ {
48506
49128
  @Field()
48507
49129
  _mj__UpdatedAt: Date;
48508
49130
 
49131
+ @Field(() => Boolean, {nullable: true, description: `Optional per-binding override of ActionParam.LogValue. NULL (the default) inherits the parameter definition. Set to 0 when this particular binding passes something sensitive through a parameter that is ordinarily safe to log - a message body through a generic Text parameter, for instance. Cannot re-enable logging for a value type the hard rule suppresses.`})
49132
+ LogValue?: boolean;
49133
+
48509
49134
  @Field()
48510
49135
  @MaxLength(425)
48511
49136
  EntityAction: string;
@@ -48539,6 +49164,9 @@ export class CreateMJEntityActionParamInput {
48539
49164
  @Field({ nullable: true })
48540
49165
  Comments: string | null;
48541
49166
 
49167
+ @Field(() => Boolean, { nullable: true })
49168
+ LogValue: boolean | null;
49169
+
48542
49170
  @Field(() => RestoreContextInput, { nullable: true })
48543
49171
  RestoreContext___?: RestoreContextInput;
48544
49172
  }
@@ -48567,6 +49195,9 @@ export class UpdateMJEntityActionParamInput {
48567
49195
  @Field({ nullable: true })
48568
49196
  Comments?: string | null;
48569
49197
 
49198
+ @Field(() => Boolean, { nullable: true })
49199
+ LogValue?: boolean | null;
49200
+
48570
49201
  @Field(() => [KeyValuePairInput], { nullable: true })
48571
49202
  OldValues___?: KeyValuePairInput[];
48572
49203
 
@@ -48687,6 +49318,21 @@ export class MJEntityAction_ {
48687
49318
  @MaxLength(36)
48688
49319
  ID: string;
48689
49320
 
49321
+ @Field(() => Int, {description: `Execution order when multiple Entity Actions are bound to the same entity and invocation type. Lower runs first; ties fall back to creation order. Defaults to 0 so existing rows are unaffected.`})
49322
+ Sequence: number;
49323
+
49324
+ @Field({nullable: true, description: `Optional. Together with ScopeRecordID, narrows this Entity Action to records related to ONE specific record - for example a single Deal Type, Contract Type, Pipeline or Company - rather than every record of EntityID. NULL (the default) means the action applies to all records, which is the pre-existing behaviour. How a scope record relates to the subject record is resolved by the app that owns the scope entity; the framework only stores and filters on the pair.`})
49325
+ @MaxLength(36)
49326
+ ScopeEntityID?: string;
49327
+
49328
+ @Field({nullable: true, description: `Optional. The primary key of the scope record, as text, paired with ScopeEntityID. Both columns are NULL or both are set (CK_EntityAction_Scope). Lets a configuration record such as a Deal Type surface "the workflows bound to me" as a real relationship rather than something buried in filter code.`})
49329
+ @MaxLength(450)
49330
+ ScopeRecordID?: string;
49331
+
49332
+ @Field({description: `How much of this binding's activity reaches ActionExecutionLog. All (default) writes a row per invocation. FailuresOnly writes only runs that did not succeed - the right setting for a high-frequency binding on a busy entity, where the successful runs are noise. None disables logging for the binding entirely and should be rare, because it also removes the failure record.`})
49333
+ @MaxLength(20)
49334
+ LoggingMode: string;
49335
+
48690
49336
  @Field()
48691
49337
  @MaxLength(255)
48692
49338
  Entity: string;
@@ -48695,6 +49341,10 @@ export class MJEntityAction_ {
48695
49341
  @MaxLength(425)
48696
49342
  Action: string;
48697
49343
 
49344
+ @Field({nullable: true})
49345
+ @MaxLength(255)
49346
+ ScopeEntity?: string;
49347
+
48698
49348
  @Field(() => [MJEntityActionFilter_])
48699
49349
  MJEntityActionFilters_EntityActionIDArray: MJEntityActionFilter_[]; // Link to MJEntityActionFilters
48700
49350
 
@@ -48704,6 +49354,9 @@ export class MJEntityAction_ {
48704
49354
  @Field(() => [MJEntityActionParam_])
48705
49355
  MJEntityActionParams_EntityActionIDArray: MJEntityActionParam_[]; // Link to MJEntityActionParams
48706
49356
 
49357
+ @Field(() => [MJActionExecutionLog_])
49358
+ MJActionExecutionLogs_EntityActionIDArray: MJActionExecutionLog_[]; // Link to MJActionExecutionLogs
49359
+
48707
49360
  }
48708
49361
 
48709
49362
  //****************************************************************************
@@ -48723,6 +49376,18 @@ export class CreateMJEntityActionInput {
48723
49376
  @Field({ nullable: true })
48724
49377
  ID?: string;
48725
49378
 
49379
+ @Field(() => Int, { nullable: true })
49380
+ Sequence?: number;
49381
+
49382
+ @Field({ nullable: true })
49383
+ ScopeEntityID: string | null;
49384
+
49385
+ @Field({ nullable: true })
49386
+ ScopeRecordID: string | null;
49387
+
49388
+ @Field({ nullable: true })
49389
+ LoggingMode?: string;
49390
+
48726
49391
  @Field(() => RestoreContextInput, { nullable: true })
48727
49392
  RestoreContext___?: RestoreContextInput;
48728
49393
  }
@@ -48745,6 +49410,18 @@ export class UpdateMJEntityActionInput {
48745
49410
  @Field()
48746
49411
  ID: string;
48747
49412
 
49413
+ @Field(() => Int, { nullable: true })
49414
+ Sequence?: number;
49415
+
49416
+ @Field({ nullable: true })
49417
+ ScopeEntityID?: string | null;
49418
+
49419
+ @Field({ nullable: true })
49420
+ ScopeRecordID?: string | null;
49421
+
49422
+ @Field({ nullable: true })
49423
+ LoggingMode?: string;
49424
+
48748
49425
  @Field(() => [KeyValuePairInput], { nullable: true })
48749
49426
  OldValues___?: KeyValuePairInput[];
48750
49427
 
@@ -48839,6 +49516,16 @@ export class MJEntityActionResolver extends ResolverBase {
48839
49516
  return result;
48840
49517
  }
48841
49518
 
49519
+ @FieldResolver(() => [MJActionExecutionLog_])
49520
+ async MJActionExecutionLogs_EntityActionIDArray(@Root() mjentityaction_: MJEntityAction_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
49521
+ this.CheckUserReadPermissions('MJ: Action Execution Logs', userPayload);
49522
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
49523
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwActionExecutionLogs')} WHERE ${provider.QuoteIdentifier('EntityActionID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Action Execution Logs', userPayload, EntityPermissionType.Read, 'AND');
49524
+ const rows = await provider.ExecuteSQL(sSQL, [mjentityaction_.ID], undefined, this.GetUserFromPayload(userPayload));
49525
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Action Execution Logs', rows, this.GetUserFromPayload(userPayload));
49526
+ return result;
49527
+ }
49528
+
48842
49529
  @Mutation(() => MJEntityAction_)
48843
49530
  async CreateMJEntityAction(
48844
49531
  @Arg('input', () => CreateMJEntityActionInput) input: CreateMJEntityActionInput,
@@ -52793,6 +53480,9 @@ export class MJEntityRelationship_ {
52793
53480
  @Field(() => Boolean, {description: `When 1, allows system/LLM to auto-update AdditionalFieldsToInclude; when 0, user has locked this field`})
52794
53481
  AutoUpdateAdditionalFieldsToInclude: boolean;
52795
53482
 
53483
+ @Field({nullable: true, description: `Optional JSON policy object that declares this relationship as a first-class related-record collection, so CodeGen can emit a typed DeclareRelatedRecords(...) declaration on the entity subclass. Shape is IRelatedRecordCollectionConfig: Name (the generated property name, e.g. "Lines"), Load ('explicit' | 'immediate' | 'lazy' | 'never'), Source ('database' | 'cache'), ReadOnly, OnRemove ('delete' | 'orphan' | 'refuse'), OrderBy, Sequence ({ Field, From }), and ClearAfterSave. Source 'cache' reads the related records from whichever loaded BaseEngine already holds that entity, costing no query, and defaults ReadOnly to true because those are the engine's own instances; 'lazy' fills on first access and requires both. RelatedEntity and RelatedEntityJoinField are NOT repeated here — they are read from this row's own columns. NULL means the relationship is not a declared collection, which is the default and reproduces pre-6.2 behaviour exactly.`})
53484
+ RelatedRecordCollection?: string;
53485
+
52796
53486
  @Field()
52797
53487
  @MaxLength(255)
52798
53488
  Entity: string;
@@ -52903,6 +53593,9 @@ export class CreateMJEntityRelationshipInput {
52903
53593
  @Field(() => Boolean, { nullable: true })
52904
53594
  AutoUpdateAdditionalFieldsToInclude?: boolean;
52905
53595
 
53596
+ @Field({ nullable: true })
53597
+ RelatedRecordCollection: string | null;
53598
+
52906
53599
  @Field(() => RestoreContextInput, { nullable: true })
52907
53600
  RestoreContext___?: RestoreContextInput;
52908
53601
  }
@@ -52979,6 +53672,9 @@ export class UpdateMJEntityRelationshipInput {
52979
53672
  @Field(() => Boolean, { nullable: true })
52980
53673
  AutoUpdateAdditionalFieldsToInclude?: boolean;
52981
53674
 
53675
+ @Field({ nullable: true })
53676
+ RelatedRecordCollection?: string | null;
53677
+
52982
53678
  @Field(() => [KeyValuePairInput], { nullable: true })
52983
53679
  OldValues___?: KeyValuePairInput[];
52984
53680
 
@@ -53298,9 +53994,6 @@ export class MJEnvironment_ {
53298
53994
  @Field(() => [MJTask_])
53299
53995
  MJTasks_EnvironmentIDArray: MJTask_[]; // Link to MJTasks
53300
53996
 
53301
- @Field(() => [MJReport_])
53302
- MJReports_EnvironmentIDArray: MJReport_[]; // Link to MJReports
53303
-
53304
53997
  @Field(() => [MJConversation_])
53305
53998
  MJConversations_EnvironmentIDArray: MJConversation_[]; // Link to MJConversations
53306
53999
 
@@ -53468,16 +54161,6 @@ export class MJEnvironmentResolver extends ResolverBase {
53468
54161
  return result;
53469
54162
  }
53470
54163
 
53471
- @FieldResolver(() => [MJReport_])
53472
- async MJReports_EnvironmentIDArray(@Root() mjenvironment_: MJEnvironment_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
53473
- this.CheckUserReadPermissions('MJ: Reports', userPayload);
53474
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
53475
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReports')} WHERE ${provider.QuoteIdentifier('EnvironmentID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Reports', userPayload, EntityPermissionType.Read, 'AND');
53476
- const rows = await provider.ExecuteSQL(sSQL, [mjenvironment_.ID], undefined, this.GetUserFromPayload(userPayload));
53477
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Reports', rows, this.GetUserFromPayload(userPayload));
53478
- return result;
53479
- }
53480
-
53481
54164
  @FieldResolver(() => [MJConversation_])
53482
54165
  async MJConversations_EnvironmentIDArray(@Root() mjenvironment_: MJEnvironment_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
53483
54166
  this.CheckUserReadPermissions('MJ: Conversations', userPayload);
@@ -67132,9 +67815,6 @@ export class MJOutputDeliveryType_ {
67132
67815
  @Field()
67133
67816
  _mj__UpdatedAt: Date;
67134
67817
 
67135
- @Field(() => [MJReport_])
67136
- MJReports_OutputDeliveryTypeIDArray: MJReport_[]; // Link to MJReports
67137
-
67138
67818
  }
67139
67819
 
67140
67820
  //****************************************************************************
@@ -67234,16 +67914,6 @@ export class MJOutputDeliveryTypeResolver extends ResolverBase {
67234
67914
  return result;
67235
67915
  }
67236
67916
 
67237
- @FieldResolver(() => [MJReport_])
67238
- async MJReports_OutputDeliveryTypeIDArray(@Root() mjoutputdeliverytype_: MJOutputDeliveryType_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
67239
- this.CheckUserReadPermissions('MJ: Reports', userPayload);
67240
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
67241
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReports')} WHERE ${provider.QuoteIdentifier('OutputDeliveryTypeID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Reports', userPayload, EntityPermissionType.Read, 'AND');
67242
- const rows = await provider.ExecuteSQL(sSQL, [mjoutputdeliverytype_.ID], undefined, this.GetUserFromPayload(userPayload));
67243
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Reports', rows, this.GetUserFromPayload(userPayload));
67244
- return result;
67245
- }
67246
-
67247
67917
  @Mutation(() => MJOutputDeliveryType_)
67248
67918
  async CreateMJOutputDeliveryType(
67249
67919
  @Arg('input', () => CreateMJOutputDeliveryTypeInput) input: CreateMJOutputDeliveryTypeInput,
@@ -67298,9 +67968,6 @@ export class MJOutputFormatType_ {
67298
67968
  @Field()
67299
67969
  _mj__UpdatedAt: Date;
67300
67970
 
67301
- @Field(() => [MJReport_])
67302
- MJReports_OutputFormatTypeIDArray: MJReport_[]; // Link to MJReports
67303
-
67304
67971
  }
67305
67972
 
67306
67973
  //****************************************************************************
@@ -67406,16 +68073,6 @@ export class MJOutputFormatTypeResolver extends ResolverBase {
67406
68073
  return result;
67407
68074
  }
67408
68075
 
67409
- @FieldResolver(() => [MJReport_])
67410
- async MJReports_OutputFormatTypeIDArray(@Root() mjoutputformattype_: MJOutputFormatType_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
67411
- this.CheckUserReadPermissions('MJ: Reports', userPayload);
67412
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
67413
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReports')} WHERE ${provider.QuoteIdentifier('OutputFormatTypeID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Reports', userPayload, EntityPermissionType.Read, 'AND');
67414
- const rows = await provider.ExecuteSQL(sSQL, [mjoutputformattype_.ID], undefined, this.GetUserFromPayload(userPayload));
67415
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Reports', rows, this.GetUserFromPayload(userPayload));
67416
- return result;
67417
- }
67418
-
67419
68076
  @Mutation(() => MJOutputFormatType_)
67420
68077
  async CreateMJOutputFormatType(
67421
68078
  @Arg('input', () => CreateMJOutputFormatTypeInput) input: CreateMJOutputFormatTypeInput,
@@ -67445,169 +68102,6 @@ export class MJOutputFormatTypeResolver extends ResolverBase {
67445
68102
 
67446
68103
  }
67447
68104
 
67448
- //****************************************************************************
67449
- // ENTITY CLASS for MJ: Output Trigger Types
67450
- //****************************************************************************
67451
- @ObjectType({ description: `Defines events that can trigger output generation such as schedules, data changes, or manual requests.` })
67452
- export class MJOutputTriggerType_ {
67453
- @Field()
67454
- @MaxLength(36)
67455
- ID: string;
67456
-
67457
- @Field()
67458
- @MaxLength(255)
67459
- Name: string;
67460
-
67461
- @Field({nullable: true})
67462
- Description?: string;
67463
-
67464
- @Field()
67465
- _mj__CreatedAt: Date;
67466
-
67467
- @Field()
67468
- _mj__UpdatedAt: Date;
67469
-
67470
- @Field(() => [MJReport_])
67471
- MJReports_OutputTriggerTypeIDArray: MJReport_[]; // Link to MJReports
67472
-
67473
- }
67474
-
67475
- //****************************************************************************
67476
- // INPUT TYPE for MJ: Output Trigger Types
67477
- //****************************************************************************
67478
- @InputType()
67479
- export class CreateMJOutputTriggerTypeInput {
67480
- @Field({ nullable: true })
67481
- ID?: string;
67482
-
67483
- @Field({ nullable: true })
67484
- Name?: string;
67485
-
67486
- @Field({ nullable: true })
67487
- Description: string | null;
67488
-
67489
- @Field(() => RestoreContextInput, { nullable: true })
67490
- RestoreContext___?: RestoreContextInput;
67491
- }
67492
-
67493
-
67494
- //****************************************************************************
67495
- // INPUT TYPE for MJ: Output Trigger Types
67496
- //****************************************************************************
67497
- @InputType()
67498
- export class UpdateMJOutputTriggerTypeInput {
67499
- @Field()
67500
- ID: string;
67501
-
67502
- @Field({ nullable: true })
67503
- Name?: string;
67504
-
67505
- @Field({ nullable: true })
67506
- Description?: string | null;
67507
-
67508
- @Field(() => [KeyValuePairInput], { nullable: true })
67509
- OldValues___?: KeyValuePairInput[];
67510
-
67511
- @Field(() => RestoreContextInput, { nullable: true })
67512
- RestoreContext___?: RestoreContextInput;
67513
- }
67514
-
67515
- //****************************************************************************
67516
- // RESOLVER for MJ: Output Trigger Types
67517
- //****************************************************************************
67518
- @ObjectType()
67519
- export class RunMJOutputTriggerTypeViewResult {
67520
- @Field(() => [MJOutputTriggerType_])
67521
- Results: MJOutputTriggerType_[];
67522
-
67523
- @Field(() => String, {nullable: true})
67524
- UserViewRunID?: string;
67525
-
67526
- @Field(() => Int, {nullable: true})
67527
- RowCount: number;
67528
-
67529
- @Field(() => Int, {nullable: true})
67530
- TotalRowCount: number;
67531
-
67532
- @Field(() => Int, {nullable: true})
67533
- ExecutionTime: number;
67534
-
67535
- @Field({nullable: true})
67536
- ErrorMessage?: string;
67537
-
67538
- @Field(() => Boolean, {nullable: false})
67539
- Success: boolean;
67540
- }
67541
-
67542
- @Resolver(MJOutputTriggerType_)
67543
- export class MJOutputTriggerTypeResolver extends ResolverBase {
67544
- @Query(() => RunMJOutputTriggerTypeViewResult)
67545
- async RunMJOutputTriggerTypeViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
67546
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
67547
- return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
67548
- }
67549
-
67550
- @Query(() => RunMJOutputTriggerTypeViewResult)
67551
- async RunMJOutputTriggerTypeViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
67552
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
67553
- return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
67554
- }
67555
-
67556
- @Query(() => RunMJOutputTriggerTypeViewResult)
67557
- async RunMJOutputTriggerTypeDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
67558
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
67559
- input.EntityName = 'MJ: Output Trigger Types';
67560
- return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
67561
- }
67562
- @Query(() => MJOutputTriggerType_, { nullable: true })
67563
- async MJOutputTriggerType(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJOutputTriggerType_ | null> {
67564
- this.CheckUserReadPermissions('MJ: Output Trigger Types', userPayload);
67565
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
67566
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwOutputTriggerTypes')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Output Trigger Types', userPayload, EntityPermissionType.Read, 'AND');
67567
- const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
67568
- const result = await this.MapFieldNamesToCodeNames('MJ: Output Trigger Types', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
67569
- return result;
67570
- }
67571
-
67572
- @FieldResolver(() => [MJReport_])
67573
- async MJReports_OutputTriggerTypeIDArray(@Root() mjoutputtriggertype_: MJOutputTriggerType_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
67574
- this.CheckUserReadPermissions('MJ: Reports', userPayload);
67575
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
67576
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReports')} WHERE ${provider.QuoteIdentifier('OutputTriggerTypeID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Reports', userPayload, EntityPermissionType.Read, 'AND');
67577
- const rows = await provider.ExecuteSQL(sSQL, [mjoutputtriggertype_.ID], undefined, this.GetUserFromPayload(userPayload));
67578
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Reports', rows, this.GetUserFromPayload(userPayload));
67579
- return result;
67580
- }
67581
-
67582
- @Mutation(() => MJOutputTriggerType_)
67583
- async CreateMJOutputTriggerType(
67584
- @Arg('input', () => CreateMJOutputTriggerTypeInput) input: CreateMJOutputTriggerTypeInput,
67585
- @Ctx() { providers, userPayload }: AppContext,
67586
- @PubSub() pubSub: PubSubEngine
67587
- ) {
67588
- const provider = GetReadWriteProvider(providers);
67589
- return this.CreateRecord('MJ: Output Trigger Types', input, provider, userPayload, pubSub)
67590
- }
67591
-
67592
- @Mutation(() => MJOutputTriggerType_)
67593
- async UpdateMJOutputTriggerType(
67594
- @Arg('input', () => UpdateMJOutputTriggerTypeInput) input: UpdateMJOutputTriggerTypeInput,
67595
- @Ctx() { providers, userPayload }: AppContext,
67596
- @PubSub() pubSub: PubSubEngine
67597
- ) {
67598
- const provider = GetReadWriteProvider(providers);
67599
- return this.UpdateRecord('MJ: Output Trigger Types', input, provider, userPayload, pubSub);
67600
- }
67601
-
67602
- @Mutation(() => MJOutputTriggerType_)
67603
- async DeleteMJOutputTriggerType(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
67604
- const provider = GetReadWriteProvider(providers);
67605
- const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
67606
- return this.DeleteRecord('MJ: Output Trigger Types', key, options, provider, userPayload, pubSub);
67607
- }
67608
-
67609
- }
67610
-
67611
68105
  //****************************************************************************
67612
68106
  // ENTITY CLASS for MJ: Permission Domains
67613
68107
  //****************************************************************************
@@ -75155,1118 +75649,6 @@ export class MJRemoteOperationResolver extends ResolverBase {
75155
75649
 
75156
75650
  }
75157
75651
 
75158
- //****************************************************************************
75159
- // ENTITY CLASS for MJ: Report Categories
75160
- //****************************************************************************
75161
- @ObjectType({ description: `Organizes reports into logical groupings for navigation, access control, and discovery within the reporting system.` })
75162
- export class MJReportCategory_ {
75163
- @Field()
75164
- @MaxLength(36)
75165
- ID: string;
75166
-
75167
- @Field()
75168
- @MaxLength(100)
75169
- Name: string;
75170
-
75171
- @Field({nullable: true})
75172
- Description?: string;
75173
-
75174
- @Field({nullable: true})
75175
- @MaxLength(36)
75176
- ParentID?: string;
75177
-
75178
- @Field()
75179
- @MaxLength(36)
75180
- UserID: string;
75181
-
75182
- @Field()
75183
- _mj__CreatedAt: Date;
75184
-
75185
- @Field()
75186
- _mj__UpdatedAt: Date;
75187
-
75188
- @Field({nullable: true})
75189
- @MaxLength(100)
75190
- Parent?: string;
75191
-
75192
- @Field()
75193
- @MaxLength(100)
75194
- User: string;
75195
-
75196
- @Field({nullable: true})
75197
- @MaxLength(36)
75198
- RootParentID?: string;
75199
-
75200
- @Field(() => [MJReportCategory_])
75201
- MJReportCategories_ParentIDArray: MJReportCategory_[]; // Link to MJReportCategories
75202
-
75203
- @Field(() => [MJReport_])
75204
- MJReports_CategoryIDArray: MJReport_[]; // Link to MJReports
75205
-
75206
- }
75207
-
75208
- //****************************************************************************
75209
- // INPUT TYPE for MJ: Report Categories
75210
- //****************************************************************************
75211
- @InputType()
75212
- export class CreateMJReportCategoryInput {
75213
- @Field({ nullable: true })
75214
- ID?: string;
75215
-
75216
- @Field({ nullable: true })
75217
- Name?: string;
75218
-
75219
- @Field({ nullable: true })
75220
- Description: string | null;
75221
-
75222
- @Field({ nullable: true })
75223
- ParentID: string | null;
75224
-
75225
- @Field({ nullable: true })
75226
- UserID?: string;
75227
-
75228
- @Field(() => RestoreContextInput, { nullable: true })
75229
- RestoreContext___?: RestoreContextInput;
75230
- }
75231
-
75232
-
75233
- //****************************************************************************
75234
- // INPUT TYPE for MJ: Report Categories
75235
- //****************************************************************************
75236
- @InputType()
75237
- export class UpdateMJReportCategoryInput {
75238
- @Field()
75239
- ID: string;
75240
-
75241
- @Field({ nullable: true })
75242
- Name?: string;
75243
-
75244
- @Field({ nullable: true })
75245
- Description?: string | null;
75246
-
75247
- @Field({ nullable: true })
75248
- ParentID?: string | null;
75249
-
75250
- @Field({ nullable: true })
75251
- UserID?: string;
75252
-
75253
- @Field(() => [KeyValuePairInput], { nullable: true })
75254
- OldValues___?: KeyValuePairInput[];
75255
-
75256
- @Field(() => RestoreContextInput, { nullable: true })
75257
- RestoreContext___?: RestoreContextInput;
75258
- }
75259
-
75260
- //****************************************************************************
75261
- // RESOLVER for MJ: Report Categories
75262
- //****************************************************************************
75263
- @ObjectType()
75264
- export class RunMJReportCategoryViewResult {
75265
- @Field(() => [MJReportCategory_])
75266
- Results: MJReportCategory_[];
75267
-
75268
- @Field(() => String, {nullable: true})
75269
- UserViewRunID?: string;
75270
-
75271
- @Field(() => Int, {nullable: true})
75272
- RowCount: number;
75273
-
75274
- @Field(() => Int, {nullable: true})
75275
- TotalRowCount: number;
75276
-
75277
- @Field(() => Int, {nullable: true})
75278
- ExecutionTime: number;
75279
-
75280
- @Field({nullable: true})
75281
- ErrorMessage?: string;
75282
-
75283
- @Field(() => Boolean, {nullable: false})
75284
- Success: boolean;
75285
- }
75286
-
75287
- @Resolver(MJReportCategory_)
75288
- export class MJReportCategoryResolver extends ResolverBase {
75289
- @Query(() => RunMJReportCategoryViewResult)
75290
- async RunMJReportCategoryViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
75291
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75292
- return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
75293
- }
75294
-
75295
- @Query(() => RunMJReportCategoryViewResult)
75296
- async RunMJReportCategoryViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
75297
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75298
- return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
75299
- }
75300
-
75301
- @Query(() => RunMJReportCategoryViewResult)
75302
- async RunMJReportCategoryDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
75303
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75304
- input.EntityName = 'MJ: Report Categories';
75305
- return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
75306
- }
75307
- @Query(() => MJReportCategory_, { nullable: true })
75308
- async MJReportCategory(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJReportCategory_ | null> {
75309
- this.CheckUserReadPermissions('MJ: Report Categories', userPayload);
75310
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75311
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReportCategories')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Report Categories', userPayload, EntityPermissionType.Read, 'AND');
75312
- const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
75313
- const result = await this.MapFieldNamesToCodeNames('MJ: Report Categories', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
75314
- return result;
75315
- }
75316
-
75317
- @FieldResolver(() => [MJReportCategory_])
75318
- async MJReportCategories_ParentIDArray(@Root() mjreportcategory_: MJReportCategory_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
75319
- this.CheckUserReadPermissions('MJ: Report Categories', userPayload);
75320
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75321
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReportCategories')} WHERE ${provider.QuoteIdentifier('ParentID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Report Categories', userPayload, EntityPermissionType.Read, 'AND');
75322
- const rows = await provider.ExecuteSQL(sSQL, [mjreportcategory_.ID], undefined, this.GetUserFromPayload(userPayload));
75323
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Report Categories', rows, this.GetUserFromPayload(userPayload));
75324
- return result;
75325
- }
75326
-
75327
- @FieldResolver(() => [MJReport_])
75328
- async MJReports_CategoryIDArray(@Root() mjreportcategory_: MJReportCategory_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
75329
- this.CheckUserReadPermissions('MJ: Reports', userPayload);
75330
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75331
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReports')} WHERE ${provider.QuoteIdentifier('CategoryID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Reports', userPayload, EntityPermissionType.Read, 'AND');
75332
- const rows = await provider.ExecuteSQL(sSQL, [mjreportcategory_.ID], undefined, this.GetUserFromPayload(userPayload));
75333
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Reports', rows, this.GetUserFromPayload(userPayload));
75334
- return result;
75335
- }
75336
-
75337
- @Mutation(() => MJReportCategory_)
75338
- async CreateMJReportCategory(
75339
- @Arg('input', () => CreateMJReportCategoryInput) input: CreateMJReportCategoryInput,
75340
- @Ctx() { providers, userPayload }: AppContext,
75341
- @PubSub() pubSub: PubSubEngine
75342
- ) {
75343
- const provider = GetReadWriteProvider(providers);
75344
- return this.CreateRecord('MJ: Report Categories', input, provider, userPayload, pubSub)
75345
- }
75346
-
75347
- @Mutation(() => MJReportCategory_)
75348
- async UpdateMJReportCategory(
75349
- @Arg('input', () => UpdateMJReportCategoryInput) input: UpdateMJReportCategoryInput,
75350
- @Ctx() { providers, userPayload }: AppContext,
75351
- @PubSub() pubSub: PubSubEngine
75352
- ) {
75353
- const provider = GetReadWriteProvider(providers);
75354
- return this.UpdateRecord('MJ: Report Categories', input, provider, userPayload, pubSub);
75355
- }
75356
-
75357
- @Mutation(() => MJReportCategory_)
75358
- async DeleteMJReportCategory(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
75359
- const provider = GetReadWriteProvider(providers);
75360
- const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
75361
- return this.DeleteRecord('MJ: Report Categories', key, options, provider, userPayload, pubSub);
75362
- }
75363
-
75364
- }
75365
-
75366
- //****************************************************************************
75367
- // ENTITY CLASS for MJ: Report Snapshots
75368
- //****************************************************************************
75369
- @ObjectType({ description: `Stores point-in-time captures of report outputs, preserving historical data and enabling comparison over time.` })
75370
- export class MJReportSnapshot_ {
75371
- @Field()
75372
- @MaxLength(36)
75373
- ID: string;
75374
-
75375
- @Field()
75376
- @MaxLength(36)
75377
- ReportID: string;
75378
-
75379
- @Field({description: `Field ResultSet for entity Report Snapshots.`})
75380
- ResultSet: string;
75381
-
75382
- @Field()
75383
- @MaxLength(36)
75384
- UserID: string;
75385
-
75386
- @Field()
75387
- _mj__CreatedAt: Date;
75388
-
75389
- @Field()
75390
- _mj__UpdatedAt: Date;
75391
-
75392
- @Field()
75393
- @MaxLength(255)
75394
- Report: string;
75395
-
75396
- @Field()
75397
- @MaxLength(100)
75398
- User: string;
75399
-
75400
- }
75401
-
75402
- //****************************************************************************
75403
- // INPUT TYPE for MJ: Report Snapshots
75404
- //****************************************************************************
75405
- @InputType()
75406
- export class CreateMJReportSnapshotInput {
75407
- @Field({ nullable: true })
75408
- ID?: string;
75409
-
75410
- @Field({ nullable: true })
75411
- ReportID?: string;
75412
-
75413
- @Field({ nullable: true })
75414
- ResultSet?: string;
75415
-
75416
- @Field({ nullable: true })
75417
- UserID?: string;
75418
-
75419
- @Field(() => RestoreContextInput, { nullable: true })
75420
- RestoreContext___?: RestoreContextInput;
75421
- }
75422
-
75423
-
75424
- //****************************************************************************
75425
- // INPUT TYPE for MJ: Report Snapshots
75426
- //****************************************************************************
75427
- @InputType()
75428
- export class UpdateMJReportSnapshotInput {
75429
- @Field()
75430
- ID: string;
75431
-
75432
- @Field({ nullable: true })
75433
- ReportID?: string;
75434
-
75435
- @Field({ nullable: true })
75436
- ResultSet?: string;
75437
-
75438
- @Field({ nullable: true })
75439
- UserID?: string;
75440
-
75441
- @Field(() => [KeyValuePairInput], { nullable: true })
75442
- OldValues___?: KeyValuePairInput[];
75443
-
75444
- @Field(() => RestoreContextInput, { nullable: true })
75445
- RestoreContext___?: RestoreContextInput;
75446
- }
75447
-
75448
- //****************************************************************************
75449
- // RESOLVER for MJ: Report Snapshots
75450
- //****************************************************************************
75451
- @ObjectType()
75452
- export class RunMJReportSnapshotViewResult {
75453
- @Field(() => [MJReportSnapshot_])
75454
- Results: MJReportSnapshot_[];
75455
-
75456
- @Field(() => String, {nullable: true})
75457
- UserViewRunID?: string;
75458
-
75459
- @Field(() => Int, {nullable: true})
75460
- RowCount: number;
75461
-
75462
- @Field(() => Int, {nullable: true})
75463
- TotalRowCount: number;
75464
-
75465
- @Field(() => Int, {nullable: true})
75466
- ExecutionTime: number;
75467
-
75468
- @Field({nullable: true})
75469
- ErrorMessage?: string;
75470
-
75471
- @Field(() => Boolean, {nullable: false})
75472
- Success: boolean;
75473
- }
75474
-
75475
- @Resolver(MJReportSnapshot_)
75476
- export class MJReportSnapshotResolver extends ResolverBase {
75477
- @Query(() => RunMJReportSnapshotViewResult)
75478
- async RunMJReportSnapshotViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
75479
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75480
- return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
75481
- }
75482
-
75483
- @Query(() => RunMJReportSnapshotViewResult)
75484
- async RunMJReportSnapshotViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
75485
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75486
- return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
75487
- }
75488
-
75489
- @Query(() => RunMJReportSnapshotViewResult)
75490
- async RunMJReportSnapshotDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
75491
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75492
- input.EntityName = 'MJ: Report Snapshots';
75493
- return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
75494
- }
75495
- @Query(() => MJReportSnapshot_, { nullable: true })
75496
- async MJReportSnapshot(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJReportSnapshot_ | null> {
75497
- this.CheckUserReadPermissions('MJ: Report Snapshots', userPayload);
75498
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75499
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReportSnapshots')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Report Snapshots', userPayload, EntityPermissionType.Read, 'AND');
75500
- const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
75501
- const result = await this.MapFieldNamesToCodeNames('MJ: Report Snapshots', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
75502
- return result;
75503
- }
75504
-
75505
- @Mutation(() => MJReportSnapshot_)
75506
- async CreateMJReportSnapshot(
75507
- @Arg('input', () => CreateMJReportSnapshotInput) input: CreateMJReportSnapshotInput,
75508
- @Ctx() { providers, userPayload }: AppContext,
75509
- @PubSub() pubSub: PubSubEngine
75510
- ) {
75511
- const provider = GetReadWriteProvider(providers);
75512
- return this.CreateRecord('MJ: Report Snapshots', input, provider, userPayload, pubSub)
75513
- }
75514
-
75515
- @Mutation(() => MJReportSnapshot_)
75516
- async UpdateMJReportSnapshot(
75517
- @Arg('input', () => UpdateMJReportSnapshotInput) input: UpdateMJReportSnapshotInput,
75518
- @Ctx() { providers, userPayload }: AppContext,
75519
- @PubSub() pubSub: PubSubEngine
75520
- ) {
75521
- const provider = GetReadWriteProvider(providers);
75522
- return this.UpdateRecord('MJ: Report Snapshots', input, provider, userPayload, pubSub);
75523
- }
75524
-
75525
- @Mutation(() => MJReportSnapshot_)
75526
- async DeleteMJReportSnapshot(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
75527
- const provider = GetReadWriteProvider(providers);
75528
- const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
75529
- return this.DeleteRecord('MJ: Report Snapshots', key, options, provider, userPayload, pubSub);
75530
- }
75531
-
75532
- }
75533
-
75534
- //****************************************************************************
75535
- // ENTITY CLASS for MJ: Report User States
75536
- //****************************************************************************
75537
- @ObjectType({ description: `Tracks individual user state within interactive reports` })
75538
- export class MJReportUserState_ {
75539
- @Field()
75540
- @MaxLength(36)
75541
- ID: string;
75542
-
75543
- @Field()
75544
- @MaxLength(36)
75545
- ReportID: string;
75546
-
75547
- @Field()
75548
- @MaxLength(36)
75549
- UserID: string;
75550
-
75551
- @Field({nullable: true, description: `JSON serialized state of user interaction with the report`})
75552
- ReportState?: string;
75553
-
75554
- @Field()
75555
- _mj__CreatedAt: Date;
75556
-
75557
- @Field()
75558
- _mj__UpdatedAt: Date;
75559
-
75560
- @Field()
75561
- @MaxLength(255)
75562
- Report: string;
75563
-
75564
- @Field()
75565
- @MaxLength(100)
75566
- User: string;
75567
-
75568
- }
75569
-
75570
- //****************************************************************************
75571
- // INPUT TYPE for MJ: Report User States
75572
- //****************************************************************************
75573
- @InputType()
75574
- export class CreateMJReportUserStateInput {
75575
- @Field({ nullable: true })
75576
- ID?: string;
75577
-
75578
- @Field({ nullable: true })
75579
- ReportID?: string;
75580
-
75581
- @Field({ nullable: true })
75582
- UserID?: string;
75583
-
75584
- @Field({ nullable: true })
75585
- ReportState: string | null;
75586
-
75587
- @Field(() => RestoreContextInput, { nullable: true })
75588
- RestoreContext___?: RestoreContextInput;
75589
- }
75590
-
75591
-
75592
- //****************************************************************************
75593
- // INPUT TYPE for MJ: Report User States
75594
- //****************************************************************************
75595
- @InputType()
75596
- export class UpdateMJReportUserStateInput {
75597
- @Field()
75598
- ID: string;
75599
-
75600
- @Field({ nullable: true })
75601
- ReportID?: string;
75602
-
75603
- @Field({ nullable: true })
75604
- UserID?: string;
75605
-
75606
- @Field({ nullable: true })
75607
- ReportState?: string | null;
75608
-
75609
- @Field(() => [KeyValuePairInput], { nullable: true })
75610
- OldValues___?: KeyValuePairInput[];
75611
-
75612
- @Field(() => RestoreContextInput, { nullable: true })
75613
- RestoreContext___?: RestoreContextInput;
75614
- }
75615
-
75616
- //****************************************************************************
75617
- // RESOLVER for MJ: Report User States
75618
- //****************************************************************************
75619
- @ObjectType()
75620
- export class RunMJReportUserStateViewResult {
75621
- @Field(() => [MJReportUserState_])
75622
- Results: MJReportUserState_[];
75623
-
75624
- @Field(() => String, {nullable: true})
75625
- UserViewRunID?: string;
75626
-
75627
- @Field(() => Int, {nullable: true})
75628
- RowCount: number;
75629
-
75630
- @Field(() => Int, {nullable: true})
75631
- TotalRowCount: number;
75632
-
75633
- @Field(() => Int, {nullable: true})
75634
- ExecutionTime: number;
75635
-
75636
- @Field({nullable: true})
75637
- ErrorMessage?: string;
75638
-
75639
- @Field(() => Boolean, {nullable: false})
75640
- Success: boolean;
75641
- }
75642
-
75643
- @Resolver(MJReportUserState_)
75644
- export class MJReportUserStateResolver extends ResolverBase {
75645
- @Query(() => RunMJReportUserStateViewResult)
75646
- async RunMJReportUserStateViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
75647
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75648
- return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
75649
- }
75650
-
75651
- @Query(() => RunMJReportUserStateViewResult)
75652
- async RunMJReportUserStateViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
75653
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75654
- return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
75655
- }
75656
-
75657
- @Query(() => RunMJReportUserStateViewResult)
75658
- async RunMJReportUserStateDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
75659
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75660
- input.EntityName = 'MJ: Report User States';
75661
- return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
75662
- }
75663
- @Query(() => MJReportUserState_, { nullable: true })
75664
- async MJReportUserState(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJReportUserState_ | null> {
75665
- this.CheckUserReadPermissions('MJ: Report User States', userPayload);
75666
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75667
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReportUserStates')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Report User States', userPayload, EntityPermissionType.Read, 'AND');
75668
- const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
75669
- const result = await this.MapFieldNamesToCodeNames('MJ: Report User States', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
75670
- return result;
75671
- }
75672
-
75673
- @Mutation(() => MJReportUserState_)
75674
- async CreateMJReportUserState(
75675
- @Arg('input', () => CreateMJReportUserStateInput) input: CreateMJReportUserStateInput,
75676
- @Ctx() { providers, userPayload }: AppContext,
75677
- @PubSub() pubSub: PubSubEngine
75678
- ) {
75679
- const provider = GetReadWriteProvider(providers);
75680
- return this.CreateRecord('MJ: Report User States', input, provider, userPayload, pubSub)
75681
- }
75682
-
75683
- @Mutation(() => MJReportUserState_)
75684
- async UpdateMJReportUserState(
75685
- @Arg('input', () => UpdateMJReportUserStateInput) input: UpdateMJReportUserStateInput,
75686
- @Ctx() { providers, userPayload }: AppContext,
75687
- @PubSub() pubSub: PubSubEngine
75688
- ) {
75689
- const provider = GetReadWriteProvider(providers);
75690
- return this.UpdateRecord('MJ: Report User States', input, provider, userPayload, pubSub);
75691
- }
75692
-
75693
- @Mutation(() => MJReportUserState_)
75694
- async DeleteMJReportUserState(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
75695
- const provider = GetReadWriteProvider(providers);
75696
- const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
75697
- return this.DeleteRecord('MJ: Report User States', key, options, provider, userPayload, pubSub);
75698
- }
75699
-
75700
- }
75701
-
75702
- //****************************************************************************
75703
- // ENTITY CLASS for MJ: Report Versions
75704
- //****************************************************************************
75705
- @ObjectType({ description: `Stores iterations of report logic, structure, and layout changes` })
75706
- export class MJReportVersion_ {
75707
- @Field()
75708
- @MaxLength(36)
75709
- ID: string;
75710
-
75711
- @Field()
75712
- @MaxLength(36)
75713
- ReportID: string;
75714
-
75715
- @Field(() => Int, {description: `Report version number, sequential per report starting at 1`})
75716
- VersionNumber: number;
75717
-
75718
- @Field({description: `Name of this report version`})
75719
- @MaxLength(255)
75720
- Name: string;
75721
-
75722
- @Field({nullable: true, description: `Description of this report version`})
75723
- Description?: string;
75724
-
75725
- @Field({nullable: true, description: `JSON configuration of report structure, layout and logic`})
75726
- Configuration?: string;
75727
-
75728
- @Field(() => Boolean, {description: `Indicates if the data context was updated in this version`})
75729
- DataContextUpdated: boolean;
75730
-
75731
- @Field()
75732
- _mj__CreatedAt: Date;
75733
-
75734
- @Field()
75735
- _mj__UpdatedAt: Date;
75736
-
75737
- @Field()
75738
- @MaxLength(255)
75739
- Report: string;
75740
-
75741
- }
75742
-
75743
- //****************************************************************************
75744
- // INPUT TYPE for MJ: Report Versions
75745
- //****************************************************************************
75746
- @InputType()
75747
- export class CreateMJReportVersionInput {
75748
- @Field({ nullable: true })
75749
- ID?: string;
75750
-
75751
- @Field({ nullable: true })
75752
- ReportID?: string;
75753
-
75754
- @Field(() => Int, { nullable: true })
75755
- VersionNumber?: number;
75756
-
75757
- @Field({ nullable: true })
75758
- Name?: string;
75759
-
75760
- @Field({ nullable: true })
75761
- Description: string | null;
75762
-
75763
- @Field({ nullable: true })
75764
- Configuration: string | null;
75765
-
75766
- @Field(() => Boolean, { nullable: true })
75767
- DataContextUpdated?: boolean;
75768
-
75769
- @Field(() => RestoreContextInput, { nullable: true })
75770
- RestoreContext___?: RestoreContextInput;
75771
- }
75772
-
75773
-
75774
- //****************************************************************************
75775
- // INPUT TYPE for MJ: Report Versions
75776
- //****************************************************************************
75777
- @InputType()
75778
- export class UpdateMJReportVersionInput {
75779
- @Field()
75780
- ID: string;
75781
-
75782
- @Field({ nullable: true })
75783
- ReportID?: string;
75784
-
75785
- @Field(() => Int, { nullable: true })
75786
- VersionNumber?: number;
75787
-
75788
- @Field({ nullable: true })
75789
- Name?: string;
75790
-
75791
- @Field({ nullable: true })
75792
- Description?: string | null;
75793
-
75794
- @Field({ nullable: true })
75795
- Configuration?: string | null;
75796
-
75797
- @Field(() => Boolean, { nullable: true })
75798
- DataContextUpdated?: boolean;
75799
-
75800
- @Field(() => [KeyValuePairInput], { nullable: true })
75801
- OldValues___?: KeyValuePairInput[];
75802
-
75803
- @Field(() => RestoreContextInput, { nullable: true })
75804
- RestoreContext___?: RestoreContextInput;
75805
- }
75806
-
75807
- //****************************************************************************
75808
- // RESOLVER for MJ: Report Versions
75809
- //****************************************************************************
75810
- @ObjectType()
75811
- export class RunMJReportVersionViewResult {
75812
- @Field(() => [MJReportVersion_])
75813
- Results: MJReportVersion_[];
75814
-
75815
- @Field(() => String, {nullable: true})
75816
- UserViewRunID?: string;
75817
-
75818
- @Field(() => Int, {nullable: true})
75819
- RowCount: number;
75820
-
75821
- @Field(() => Int, {nullable: true})
75822
- TotalRowCount: number;
75823
-
75824
- @Field(() => Int, {nullable: true})
75825
- ExecutionTime: number;
75826
-
75827
- @Field({nullable: true})
75828
- ErrorMessage?: string;
75829
-
75830
- @Field(() => Boolean, {nullable: false})
75831
- Success: boolean;
75832
- }
75833
-
75834
- @Resolver(MJReportVersion_)
75835
- export class MJReportVersionResolver extends ResolverBase {
75836
- @Query(() => RunMJReportVersionViewResult)
75837
- async RunMJReportVersionViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
75838
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75839
- return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
75840
- }
75841
-
75842
- @Query(() => RunMJReportVersionViewResult)
75843
- async RunMJReportVersionViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
75844
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75845
- return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
75846
- }
75847
-
75848
- @Query(() => RunMJReportVersionViewResult)
75849
- async RunMJReportVersionDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
75850
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75851
- input.EntityName = 'MJ: Report Versions';
75852
- return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
75853
- }
75854
- @Query(() => MJReportVersion_, { nullable: true })
75855
- async MJReportVersion(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJReportVersion_ | null> {
75856
- this.CheckUserReadPermissions('MJ: Report Versions', userPayload);
75857
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75858
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReportVersions')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Report Versions', userPayload, EntityPermissionType.Read, 'AND');
75859
- const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
75860
- const result = await this.MapFieldNamesToCodeNames('MJ: Report Versions', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
75861
- return result;
75862
- }
75863
-
75864
- @Mutation(() => MJReportVersion_)
75865
- async CreateMJReportVersion(
75866
- @Arg('input', () => CreateMJReportVersionInput) input: CreateMJReportVersionInput,
75867
- @Ctx() { providers, userPayload }: AppContext,
75868
- @PubSub() pubSub: PubSubEngine
75869
- ) {
75870
- const provider = GetReadWriteProvider(providers);
75871
- return this.CreateRecord('MJ: Report Versions', input, provider, userPayload, pubSub)
75872
- }
75873
-
75874
- @Mutation(() => MJReportVersion_)
75875
- async UpdateMJReportVersion(
75876
- @Arg('input', () => UpdateMJReportVersionInput) input: UpdateMJReportVersionInput,
75877
- @Ctx() { providers, userPayload }: AppContext,
75878
- @PubSub() pubSub: PubSubEngine
75879
- ) {
75880
- const provider = GetReadWriteProvider(providers);
75881
- return this.UpdateRecord('MJ: Report Versions', input, provider, userPayload, pubSub);
75882
- }
75883
-
75884
- @Mutation(() => MJReportVersion_)
75885
- async DeleteMJReportVersion(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
75886
- const provider = GetReadWriteProvider(providers);
75887
- const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
75888
- return this.DeleteRecord('MJ: Report Versions', key, options, provider, userPayload, pubSub);
75889
- }
75890
-
75891
- }
75892
-
75893
- //****************************************************************************
75894
- // ENTITY CLASS for MJ: Reports
75895
- //****************************************************************************
75896
- @ObjectType({ description: `Defines report configurations including data sources, layouts, filters, and scheduling for automated report generation.` })
75897
- export class MJReport_ {
75898
- @Field()
75899
- @MaxLength(36)
75900
- ID: string;
75901
-
75902
- @Field()
75903
- @MaxLength(255)
75904
- Name: string;
75905
-
75906
- @Field({nullable: true})
75907
- Description?: string;
75908
-
75909
- @Field({nullable: true})
75910
- @MaxLength(36)
75911
- CategoryID?: string;
75912
-
75913
- @Field()
75914
- @MaxLength(36)
75915
- UserID: string;
75916
-
75917
- @Field({description: `Field SharingScope for entity Reports.`})
75918
- @MaxLength(20)
75919
- SharingScope: string;
75920
-
75921
- @Field({nullable: true})
75922
- @MaxLength(36)
75923
- ConversationID?: string;
75924
-
75925
- @Field({nullable: true})
75926
- @MaxLength(36)
75927
- ConversationDetailID?: string;
75928
-
75929
- @Field({nullable: true})
75930
- @MaxLength(36)
75931
- DataContextID?: string;
75932
-
75933
- @Field({nullable: true, description: `Field Configuration for entity Reports.`})
75934
- Configuration?: string;
75935
-
75936
- @Field({nullable: true})
75937
- @MaxLength(36)
75938
- OutputTriggerTypeID?: string;
75939
-
75940
- @Field({nullable: true})
75941
- @MaxLength(36)
75942
- OutputFormatTypeID?: string;
75943
-
75944
- @Field({nullable: true})
75945
- @MaxLength(36)
75946
- OutputDeliveryTypeID?: string;
75947
-
75948
- @Field({nullable: true, description: `For scheduled reports, the frequency of generation (Daily, Weekly, Monthly, etc.).`})
75949
- @MaxLength(50)
75950
- OutputFrequency?: string;
75951
-
75952
- @Field({nullable: true, description: `Email address(es) to send the report to when using email delivery.`})
75953
- @MaxLength(255)
75954
- OutputTargetEmail?: string;
75955
-
75956
- @Field({nullable: true})
75957
- @MaxLength(36)
75958
- OutputWorkflowID?: string;
75959
-
75960
- @Field()
75961
- _mj__CreatedAt: Date;
75962
-
75963
- @Field()
75964
- _mj__UpdatedAt: Date;
75965
-
75966
- @Field({nullable: true, description: `Thumbnail image for the report that can be displayed in gallery views. Can contain either a URL to an image file or a Base64-encoded image string.`})
75967
- Thumbnail?: string;
75968
-
75969
- @Field()
75970
- @MaxLength(36)
75971
- EnvironmentID: string;
75972
-
75973
- @Field({nullable: true})
75974
- @MaxLength(100)
75975
- Category?: string;
75976
-
75977
- @Field()
75978
- @MaxLength(100)
75979
- User: string;
75980
-
75981
- @Field({nullable: true})
75982
- @MaxLength(255)
75983
- Conversation?: string;
75984
-
75985
- @Field({nullable: true})
75986
- @MaxLength(100)
75987
- ConversationDetail?: string;
75988
-
75989
- @Field({nullable: true})
75990
- @MaxLength(255)
75991
- DataContext?: string;
75992
-
75993
- @Field({nullable: true})
75994
- @MaxLength(255)
75995
- OutputTriggerType?: string;
75996
-
75997
- @Field({nullable: true})
75998
- @MaxLength(255)
75999
- OutputFormatType?: string;
76000
-
76001
- @Field({nullable: true})
76002
- @MaxLength(255)
76003
- OutputDeliveryType?: string;
76004
-
76005
- @Field({nullable: true})
76006
- @MaxLength(100)
76007
- OutputWorkflow?: string;
76008
-
76009
- @Field()
76010
- @MaxLength(255)
76011
- Environment: string;
76012
-
76013
- @Field(() => [MJReportSnapshot_])
76014
- MJReportSnapshots_ReportIDArray: MJReportSnapshot_[]; // Link to MJReportSnapshots
76015
-
76016
- @Field(() => [MJReportVersion_])
76017
- MJReportVersions_ReportIDArray: MJReportVersion_[]; // Link to MJReportVersions
76018
-
76019
- @Field(() => [MJReportUserState_])
76020
- MJReportUserStates_ReportIDArray: MJReportUserState_[]; // Link to MJReportUserStates
76021
-
76022
- }
76023
-
76024
- //****************************************************************************
76025
- // INPUT TYPE for MJ: Reports
76026
- //****************************************************************************
76027
- @InputType()
76028
- export class CreateMJReportInput {
76029
- @Field({ nullable: true })
76030
- ID?: string;
76031
-
76032
- @Field({ nullable: true })
76033
- Name?: string;
76034
-
76035
- @Field({ nullable: true })
76036
- Description: string | null;
76037
-
76038
- @Field({ nullable: true })
76039
- CategoryID: string | null;
76040
-
76041
- @Field({ nullable: true })
76042
- UserID?: string;
76043
-
76044
- @Field({ nullable: true })
76045
- SharingScope?: string;
76046
-
76047
- @Field({ nullable: true })
76048
- ConversationID: string | null;
76049
-
76050
- @Field({ nullable: true })
76051
- ConversationDetailID: string | null;
76052
-
76053
- @Field({ nullable: true })
76054
- DataContextID: string | null;
76055
-
76056
- @Field({ nullable: true })
76057
- Configuration: string | null;
76058
-
76059
- @Field({ nullable: true })
76060
- OutputTriggerTypeID: string | null;
76061
-
76062
- @Field({ nullable: true })
76063
- OutputFormatTypeID: string | null;
76064
-
76065
- @Field({ nullable: true })
76066
- OutputDeliveryTypeID: string | null;
76067
-
76068
- @Field({ nullable: true })
76069
- OutputFrequency: string | null;
76070
-
76071
- @Field({ nullable: true })
76072
- OutputTargetEmail: string | null;
76073
-
76074
- @Field({ nullable: true })
76075
- OutputWorkflowID: string | null;
76076
-
76077
- @Field({ nullable: true })
76078
- Thumbnail: string | null;
76079
-
76080
- @Field({ nullable: true })
76081
- EnvironmentID?: string;
76082
-
76083
- @Field(() => RestoreContextInput, { nullable: true })
76084
- RestoreContext___?: RestoreContextInput;
76085
- }
76086
-
76087
-
76088
- //****************************************************************************
76089
- // INPUT TYPE for MJ: Reports
76090
- //****************************************************************************
76091
- @InputType()
76092
- export class UpdateMJReportInput {
76093
- @Field()
76094
- ID: string;
76095
-
76096
- @Field({ nullable: true })
76097
- Name?: string;
76098
-
76099
- @Field({ nullable: true })
76100
- Description?: string | null;
76101
-
76102
- @Field({ nullable: true })
76103
- CategoryID?: string | null;
76104
-
76105
- @Field({ nullable: true })
76106
- UserID?: string;
76107
-
76108
- @Field({ nullable: true })
76109
- SharingScope?: string;
76110
-
76111
- @Field({ nullable: true })
76112
- ConversationID?: string | null;
76113
-
76114
- @Field({ nullable: true })
76115
- ConversationDetailID?: string | null;
76116
-
76117
- @Field({ nullable: true })
76118
- DataContextID?: string | null;
76119
-
76120
- @Field({ nullable: true })
76121
- Configuration?: string | null;
76122
-
76123
- @Field({ nullable: true })
76124
- OutputTriggerTypeID?: string | null;
76125
-
76126
- @Field({ nullable: true })
76127
- OutputFormatTypeID?: string | null;
76128
-
76129
- @Field({ nullable: true })
76130
- OutputDeliveryTypeID?: string | null;
76131
-
76132
- @Field({ nullable: true })
76133
- OutputFrequency?: string | null;
76134
-
76135
- @Field({ nullable: true })
76136
- OutputTargetEmail?: string | null;
76137
-
76138
- @Field({ nullable: true })
76139
- OutputWorkflowID?: string | null;
76140
-
76141
- @Field({ nullable: true })
76142
- Thumbnail?: string | null;
76143
-
76144
- @Field({ nullable: true })
76145
- EnvironmentID?: string;
76146
-
76147
- @Field(() => [KeyValuePairInput], { nullable: true })
76148
- OldValues___?: KeyValuePairInput[];
76149
-
76150
- @Field(() => RestoreContextInput, { nullable: true })
76151
- RestoreContext___?: RestoreContextInput;
76152
- }
76153
-
76154
- //****************************************************************************
76155
- // RESOLVER for MJ: Reports
76156
- //****************************************************************************
76157
- @ObjectType()
76158
- export class RunMJReportViewResult {
76159
- @Field(() => [MJReport_])
76160
- Results: MJReport_[];
76161
-
76162
- @Field(() => String, {nullable: true})
76163
- UserViewRunID?: string;
76164
-
76165
- @Field(() => Int, {nullable: true})
76166
- RowCount: number;
76167
-
76168
- @Field(() => Int, {nullable: true})
76169
- TotalRowCount: number;
76170
-
76171
- @Field(() => Int, {nullable: true})
76172
- ExecutionTime: number;
76173
-
76174
- @Field({nullable: true})
76175
- ErrorMessage?: string;
76176
-
76177
- @Field(() => Boolean, {nullable: false})
76178
- Success: boolean;
76179
- }
76180
-
76181
- @Resolver(MJReport_)
76182
- export class MJReportResolver extends ResolverBase {
76183
- @Query(() => RunMJReportViewResult)
76184
- async RunMJReportViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
76185
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
76186
- return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
76187
- }
76188
-
76189
- @Query(() => RunMJReportViewResult)
76190
- async RunMJReportViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
76191
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
76192
- return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
76193
- }
76194
-
76195
- @Query(() => RunMJReportViewResult)
76196
- async RunMJReportDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
76197
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
76198
- input.EntityName = 'MJ: Reports';
76199
- return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
76200
- }
76201
- @Query(() => MJReport_, { nullable: true })
76202
- async MJReport(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJReport_ | null> {
76203
- this.CheckUserReadPermissions('MJ: Reports', userPayload);
76204
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
76205
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReports')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Reports', userPayload, EntityPermissionType.Read, 'AND');
76206
- const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
76207
- const result = await this.MapFieldNamesToCodeNames('MJ: Reports', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
76208
- return result;
76209
- }
76210
-
76211
- @FieldResolver(() => [MJReportSnapshot_])
76212
- async MJReportSnapshots_ReportIDArray(@Root() mjreport_: MJReport_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
76213
- this.CheckUserReadPermissions('MJ: Report Snapshots', userPayload);
76214
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
76215
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReportSnapshots')} WHERE ${provider.QuoteIdentifier('ReportID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Report Snapshots', userPayload, EntityPermissionType.Read, 'AND');
76216
- const rows = await provider.ExecuteSQL(sSQL, [mjreport_.ID], undefined, this.GetUserFromPayload(userPayload));
76217
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Report Snapshots', rows, this.GetUserFromPayload(userPayload));
76218
- return result;
76219
- }
76220
-
76221
- @FieldResolver(() => [MJReportVersion_])
76222
- async MJReportVersions_ReportIDArray(@Root() mjreport_: MJReport_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
76223
- this.CheckUserReadPermissions('MJ: Report Versions', userPayload);
76224
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
76225
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReportVersions')} WHERE ${provider.QuoteIdentifier('ReportID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Report Versions', userPayload, EntityPermissionType.Read, 'AND');
76226
- const rows = await provider.ExecuteSQL(sSQL, [mjreport_.ID], undefined, this.GetUserFromPayload(userPayload));
76227
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Report Versions', rows, this.GetUserFromPayload(userPayload));
76228
- return result;
76229
- }
76230
-
76231
- @FieldResolver(() => [MJReportUserState_])
76232
- async MJReportUserStates_ReportIDArray(@Root() mjreport_: MJReport_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
76233
- this.CheckUserReadPermissions('MJ: Report User States', userPayload);
76234
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
76235
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReportUserStates')} WHERE ${provider.QuoteIdentifier('ReportID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Report User States', userPayload, EntityPermissionType.Read, 'AND');
76236
- const rows = await provider.ExecuteSQL(sSQL, [mjreport_.ID], undefined, this.GetUserFromPayload(userPayload));
76237
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Report User States', rows, this.GetUserFromPayload(userPayload));
76238
- return result;
76239
- }
76240
-
76241
- @Mutation(() => MJReport_)
76242
- async CreateMJReport(
76243
- @Arg('input', () => CreateMJReportInput) input: CreateMJReportInput,
76244
- @Ctx() { providers, userPayload }: AppContext,
76245
- @PubSub() pubSub: PubSubEngine
76246
- ) {
76247
- const provider = GetReadWriteProvider(providers);
76248
- return this.CreateRecord('MJ: Reports', input, provider, userPayload, pubSub)
76249
- }
76250
-
76251
- @Mutation(() => MJReport_)
76252
- async UpdateMJReport(
76253
- @Arg('input', () => UpdateMJReportInput) input: UpdateMJReportInput,
76254
- @Ctx() { providers, userPayload }: AppContext,
76255
- @PubSub() pubSub: PubSubEngine
76256
- ) {
76257
- const provider = GetReadWriteProvider(providers);
76258
- return this.UpdateRecord('MJ: Reports', input, provider, userPayload, pubSub);
76259
- }
76260
-
76261
- @Mutation(() => MJReport_)
76262
- async DeleteMJReport(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
76263
- const provider = GetReadWriteProvider(providers);
76264
- const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
76265
- return this.DeleteRecord('MJ: Reports', key, options, provider, userPayload, pubSub);
76266
- }
76267
-
76268
- }
76269
-
76270
75652
  //****************************************************************************
76271
75653
  // ENTITY CLASS for MJ: Resource Links
76272
75654
  //****************************************************************************
@@ -77389,6 +76771,12 @@ export class MJRowLevelSecurityFilter_ {
77389
76771
  @Field(() => [MJEntityPermission_])
77390
76772
  MJEntityPermissions_UpdateRLSFilterIDArray: MJEntityPermission_[]; // Link to MJEntityPermissions
77391
76773
 
76774
+ @Field(() => [MJAPIKeyScope_])
76775
+ MJAPIKeyScopes_RowFilterIDArray: MJAPIKeyScope_[]; // Link to MJAPIKeyScopes
76776
+
76777
+ @Field(() => [MJAPIApplicationScope_])
76778
+ MJAPIApplicationScopes_RowFilterIDArray: MJAPIApplicationScope_[]; // Link to MJAPIApplicationScopes
76779
+
77392
76780
  }
77393
76781
 
77394
76782
  //****************************************************************************
@@ -77544,6 +76932,26 @@ export class MJRowLevelSecurityFilterResolver extends ResolverBase {
77544
76932
  return result;
77545
76933
  }
77546
76934
 
76935
+ @FieldResolver(() => [MJAPIKeyScope_])
76936
+ async MJAPIKeyScopes_RowFilterIDArray(@Root() mjrowlevelsecurityfilter_: MJRowLevelSecurityFilter_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
76937
+ this.CheckUserReadPermissions('MJ: API Key Scopes', userPayload);
76938
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
76939
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAPIKeyScopes')} WHERE ${provider.QuoteIdentifier('RowFilterID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: API Key Scopes', userPayload, EntityPermissionType.Read, 'AND');
76940
+ const rows = await provider.ExecuteSQL(sSQL, [mjrowlevelsecurityfilter_.ID], undefined, this.GetUserFromPayload(userPayload));
76941
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: API Key Scopes', rows, this.GetUserFromPayload(userPayload));
76942
+ return result;
76943
+ }
76944
+
76945
+ @FieldResolver(() => [MJAPIApplicationScope_])
76946
+ async MJAPIApplicationScopes_RowFilterIDArray(@Root() mjrowlevelsecurityfilter_: MJRowLevelSecurityFilter_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
76947
+ this.CheckUserReadPermissions('MJ: API Application Scopes', userPayload);
76948
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
76949
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAPIApplicationScopes')} WHERE ${provider.QuoteIdentifier('RowFilterID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: API Application Scopes', userPayload, EntityPermissionType.Read, 'AND');
76950
+ const rows = await provider.ExecuteSQL(sSQL, [mjrowlevelsecurityfilter_.ID], undefined, this.GetUserFromPayload(userPayload));
76951
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: API Application Scopes', rows, this.GetUserFromPayload(userPayload));
76952
+ return result;
76953
+ }
76954
+
77547
76955
  @Mutation(() => MJRowLevelSecurityFilter_)
77548
76956
  async CreateMJRowLevelSecurityFilter(
77549
76957
  @Arg('input', () => CreateMJRowLevelSecurityFilterInput) input: CreateMJRowLevelSecurityFilterInput,
@@ -77573,485 +76981,6 @@ export class MJRowLevelSecurityFilterResolver extends ResolverBase {
77573
76981
 
77574
76982
  }
77575
76983
 
77576
- //****************************************************************************
77577
- // ENTITY CLASS for MJ: Scheduled Action Params
77578
- //****************************************************************************
77579
- @ObjectType({ description: `Stores parameter values for scheduled action executions, configuring inputs for automated action runs.` })
77580
- export class MJScheduledActionParam_ {
77581
- @Field()
77582
- @MaxLength(36)
77583
- ID: string;
77584
-
77585
- @Field()
77586
- @MaxLength(36)
77587
- ScheduledActionID: string;
77588
-
77589
- @Field()
77590
- @MaxLength(36)
77591
- ActionParamID: string;
77592
-
77593
- @Field({description: `Field ValueType for entity Scheduled Action Params.`})
77594
- @MaxLength(20)
77595
- ValueType: string;
77596
-
77597
- @Field({nullable: true, description: `Field Value for entity Scheduled Action Params.`})
77598
- Value?: string;
77599
-
77600
- @Field({nullable: true})
77601
- Comments?: string;
77602
-
77603
- @Field()
77604
- _mj__CreatedAt: Date;
77605
-
77606
- @Field()
77607
- _mj__UpdatedAt: Date;
77608
-
77609
- @Field()
77610
- @MaxLength(255)
77611
- ScheduledAction: string;
77612
-
77613
- @Field()
77614
- @MaxLength(255)
77615
- ActionParam: string;
77616
-
77617
- }
77618
-
77619
- //****************************************************************************
77620
- // INPUT TYPE for MJ: Scheduled Action Params
77621
- //****************************************************************************
77622
- @InputType()
77623
- export class CreateMJScheduledActionParamInput {
77624
- @Field({ nullable: true })
77625
- ID?: string;
77626
-
77627
- @Field({ nullable: true })
77628
- ScheduledActionID?: string;
77629
-
77630
- @Field({ nullable: true })
77631
- ActionParamID?: string;
77632
-
77633
- @Field({ nullable: true })
77634
- ValueType?: string;
77635
-
77636
- @Field({ nullable: true })
77637
- Value: string | null;
77638
-
77639
- @Field({ nullable: true })
77640
- Comments: string | null;
77641
-
77642
- @Field(() => RestoreContextInput, { nullable: true })
77643
- RestoreContext___?: RestoreContextInput;
77644
- }
77645
-
77646
-
77647
- //****************************************************************************
77648
- // INPUT TYPE for MJ: Scheduled Action Params
77649
- //****************************************************************************
77650
- @InputType()
77651
- export class UpdateMJScheduledActionParamInput {
77652
- @Field()
77653
- ID: string;
77654
-
77655
- @Field({ nullable: true })
77656
- ScheduledActionID?: string;
77657
-
77658
- @Field({ nullable: true })
77659
- ActionParamID?: string;
77660
-
77661
- @Field({ nullable: true })
77662
- ValueType?: string;
77663
-
77664
- @Field({ nullable: true })
77665
- Value?: string | null;
77666
-
77667
- @Field({ nullable: true })
77668
- Comments?: string | null;
77669
-
77670
- @Field(() => [KeyValuePairInput], { nullable: true })
77671
- OldValues___?: KeyValuePairInput[];
77672
-
77673
- @Field(() => RestoreContextInput, { nullable: true })
77674
- RestoreContext___?: RestoreContextInput;
77675
- }
77676
-
77677
- //****************************************************************************
77678
- // RESOLVER for MJ: Scheduled Action Params
77679
- //****************************************************************************
77680
- @ObjectType()
77681
- export class RunMJScheduledActionParamViewResult {
77682
- @Field(() => [MJScheduledActionParam_])
77683
- Results: MJScheduledActionParam_[];
77684
-
77685
- @Field(() => String, {nullable: true})
77686
- UserViewRunID?: string;
77687
-
77688
- @Field(() => Int, {nullable: true})
77689
- RowCount: number;
77690
-
77691
- @Field(() => Int, {nullable: true})
77692
- TotalRowCount: number;
77693
-
77694
- @Field(() => Int, {nullable: true})
77695
- ExecutionTime: number;
77696
-
77697
- @Field({nullable: true})
77698
- ErrorMessage?: string;
77699
-
77700
- @Field(() => Boolean, {nullable: false})
77701
- Success: boolean;
77702
- }
77703
-
77704
- @Resolver(MJScheduledActionParam_)
77705
- export class MJScheduledActionParamResolver extends ResolverBase {
77706
- @Query(() => RunMJScheduledActionParamViewResult)
77707
- async RunMJScheduledActionParamViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
77708
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
77709
- return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
77710
- }
77711
-
77712
- @Query(() => RunMJScheduledActionParamViewResult)
77713
- async RunMJScheduledActionParamViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
77714
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
77715
- return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
77716
- }
77717
-
77718
- @Query(() => RunMJScheduledActionParamViewResult)
77719
- async RunMJScheduledActionParamDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
77720
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
77721
- input.EntityName = 'MJ: Scheduled Action Params';
77722
- return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
77723
- }
77724
- @Query(() => MJScheduledActionParam_, { nullable: true })
77725
- async MJScheduledActionParam(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJScheduledActionParam_ | null> {
77726
- this.CheckUserReadPermissions('MJ: Scheduled Action Params', userPayload);
77727
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
77728
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwScheduledActionParams')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Action Params', userPayload, EntityPermissionType.Read, 'AND');
77729
- const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
77730
- const result = await this.MapFieldNamesToCodeNames('MJ: Scheduled Action Params', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
77731
- return result;
77732
- }
77733
-
77734
- @Mutation(() => MJScheduledActionParam_)
77735
- async CreateMJScheduledActionParam(
77736
- @Arg('input', () => CreateMJScheduledActionParamInput) input: CreateMJScheduledActionParamInput,
77737
- @Ctx() { providers, userPayload }: AppContext,
77738
- @PubSub() pubSub: PubSubEngine
77739
- ) {
77740
- const provider = GetReadWriteProvider(providers);
77741
- return this.CreateRecord('MJ: Scheduled Action Params', input, provider, userPayload, pubSub)
77742
- }
77743
-
77744
- @Mutation(() => MJScheduledActionParam_)
77745
- async UpdateMJScheduledActionParam(
77746
- @Arg('input', () => UpdateMJScheduledActionParamInput) input: UpdateMJScheduledActionParamInput,
77747
- @Ctx() { providers, userPayload }: AppContext,
77748
- @PubSub() pubSub: PubSubEngine
77749
- ) {
77750
- const provider = GetReadWriteProvider(providers);
77751
- return this.UpdateRecord('MJ: Scheduled Action Params', input, provider, userPayload, pubSub);
77752
- }
77753
-
77754
- @Mutation(() => MJScheduledActionParam_)
77755
- async DeleteMJScheduledActionParam(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
77756
- const provider = GetReadWriteProvider(providers);
77757
- const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
77758
- return this.DeleteRecord('MJ: Scheduled Action Params', key, options, provider, userPayload, pubSub);
77759
- }
77760
-
77761
- }
77762
-
77763
- //****************************************************************************
77764
- // ENTITY CLASS for MJ: Scheduled Actions
77765
- //****************************************************************************
77766
- @ObjectType({ description: `Track scheduled actions and their details` })
77767
- export class MJScheduledAction_ {
77768
- @Field()
77769
- @MaxLength(36)
77770
- ID: string;
77771
-
77772
- @Field()
77773
- @MaxLength(255)
77774
- Name: string;
77775
-
77776
- @Field({nullable: true})
77777
- Description?: string;
77778
-
77779
- @Field()
77780
- @MaxLength(36)
77781
- CreatedByUserID: string;
77782
-
77783
- @Field()
77784
- @MaxLength(36)
77785
- ActionID: string;
77786
-
77787
- @Field({description: `Type of the scheduled action (Daily, Weekly, Monthly, Yearly, Custom)`})
77788
- @MaxLength(20)
77789
- Type: string;
77790
-
77791
- @Field({nullable: true, description: `Cron expression defining the schedule, automatically maintained by the system unless Type is Custom, in which case the user directly sets this`})
77792
- @MaxLength(100)
77793
- CronExpression?: string;
77794
-
77795
- @Field({description: `Timezone for the scheduled action, if not specified defaults to UTC/Z`})
77796
- @MaxLength(100)
77797
- Timezone: string;
77798
-
77799
- @Field({description: `Status of the scheduled action (Pending, Active, Disabled, Expired)`})
77800
- @MaxLength(20)
77801
- Status: string;
77802
-
77803
- @Field(() => Int, {nullable: true, description: `Interval in days for the scheduled action`})
77804
- IntervalDays?: number;
77805
-
77806
- @Field({nullable: true, description: `Day of the week for the scheduled action`})
77807
- @MaxLength(20)
77808
- DayOfWeek?: string;
77809
-
77810
- @Field(() => Int, {nullable: true, description: `Day of the month for the scheduled action`})
77811
- DayOfMonth?: number;
77812
-
77813
- @Field({nullable: true, description: `Month for the scheduled action`})
77814
- @MaxLength(20)
77815
- Month?: string;
77816
-
77817
- @Field({nullable: true, description: `Field CustomCronExpression for entity Scheduled Actions.`})
77818
- @MaxLength(255)
77819
- CustomCronExpression?: string;
77820
-
77821
- @Field()
77822
- _mj__CreatedAt: Date;
77823
-
77824
- @Field()
77825
- _mj__UpdatedAt: Date;
77826
-
77827
- @Field()
77828
- @MaxLength(100)
77829
- CreatedByUser: string;
77830
-
77831
- @Field()
77832
- @MaxLength(425)
77833
- Action: string;
77834
-
77835
- @Field(() => [MJScheduledActionParam_])
77836
- MJScheduledActionParams_ScheduledActionIDArray: MJScheduledActionParam_[]; // Link to MJScheduledActionParams
77837
-
77838
- @Field(() => [MJContentSource_])
77839
- MJContentSources_ScheduledActionIDArray: MJContentSource_[]; // Link to MJContentSources
77840
-
77841
- }
77842
-
77843
- //****************************************************************************
77844
- // INPUT TYPE for MJ: Scheduled Actions
77845
- //****************************************************************************
77846
- @InputType()
77847
- export class CreateMJScheduledActionInput {
77848
- @Field({ nullable: true })
77849
- ID?: string;
77850
-
77851
- @Field({ nullable: true })
77852
- Name?: string;
77853
-
77854
- @Field({ nullable: true })
77855
- Description: string | null;
77856
-
77857
- @Field({ nullable: true })
77858
- CreatedByUserID?: string;
77859
-
77860
- @Field({ nullable: true })
77861
- ActionID?: string;
77862
-
77863
- @Field({ nullable: true })
77864
- Type?: string;
77865
-
77866
- @Field({ nullable: true })
77867
- CronExpression: string | null;
77868
-
77869
- @Field({ nullable: true })
77870
- Timezone?: string;
77871
-
77872
- @Field({ nullable: true })
77873
- Status?: string;
77874
-
77875
- @Field(() => Int, { nullable: true })
77876
- IntervalDays: number | null;
77877
-
77878
- @Field({ nullable: true })
77879
- DayOfWeek: string | null;
77880
-
77881
- @Field(() => Int, { nullable: true })
77882
- DayOfMonth: number | null;
77883
-
77884
- @Field({ nullable: true })
77885
- Month: string | null;
77886
-
77887
- @Field({ nullable: true })
77888
- CustomCronExpression: string | null;
77889
-
77890
- @Field(() => RestoreContextInput, { nullable: true })
77891
- RestoreContext___?: RestoreContextInput;
77892
- }
77893
-
77894
-
77895
- //****************************************************************************
77896
- // INPUT TYPE for MJ: Scheduled Actions
77897
- //****************************************************************************
77898
- @InputType()
77899
- export class UpdateMJScheduledActionInput {
77900
- @Field()
77901
- ID: string;
77902
-
77903
- @Field({ nullable: true })
77904
- Name?: string;
77905
-
77906
- @Field({ nullable: true })
77907
- Description?: string | null;
77908
-
77909
- @Field({ nullable: true })
77910
- CreatedByUserID?: string;
77911
-
77912
- @Field({ nullable: true })
77913
- ActionID?: string;
77914
-
77915
- @Field({ nullable: true })
77916
- Type?: string;
77917
-
77918
- @Field({ nullable: true })
77919
- CronExpression?: string | null;
77920
-
77921
- @Field({ nullable: true })
77922
- Timezone?: string;
77923
-
77924
- @Field({ nullable: true })
77925
- Status?: string;
77926
-
77927
- @Field(() => Int, { nullable: true })
77928
- IntervalDays?: number | null;
77929
-
77930
- @Field({ nullable: true })
77931
- DayOfWeek?: string | null;
77932
-
77933
- @Field(() => Int, { nullable: true })
77934
- DayOfMonth?: number | null;
77935
-
77936
- @Field({ nullable: true })
77937
- Month?: string | null;
77938
-
77939
- @Field({ nullable: true })
77940
- CustomCronExpression?: string | null;
77941
-
77942
- @Field(() => [KeyValuePairInput], { nullable: true })
77943
- OldValues___?: KeyValuePairInput[];
77944
-
77945
- @Field(() => RestoreContextInput, { nullable: true })
77946
- RestoreContext___?: RestoreContextInput;
77947
- }
77948
-
77949
- //****************************************************************************
77950
- // RESOLVER for MJ: Scheduled Actions
77951
- //****************************************************************************
77952
- @ObjectType()
77953
- export class RunMJScheduledActionViewResult {
77954
- @Field(() => [MJScheduledAction_])
77955
- Results: MJScheduledAction_[];
77956
-
77957
- @Field(() => String, {nullable: true})
77958
- UserViewRunID?: string;
77959
-
77960
- @Field(() => Int, {nullable: true})
77961
- RowCount: number;
77962
-
77963
- @Field(() => Int, {nullable: true})
77964
- TotalRowCount: number;
77965
-
77966
- @Field(() => Int, {nullable: true})
77967
- ExecutionTime: number;
77968
-
77969
- @Field({nullable: true})
77970
- ErrorMessage?: string;
77971
-
77972
- @Field(() => Boolean, {nullable: false})
77973
- Success: boolean;
77974
- }
77975
-
77976
- @Resolver(MJScheduledAction_)
77977
- export class MJScheduledActionResolver extends ResolverBase {
77978
- @Query(() => RunMJScheduledActionViewResult)
77979
- async RunMJScheduledActionViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
77980
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
77981
- return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
77982
- }
77983
-
77984
- @Query(() => RunMJScheduledActionViewResult)
77985
- async RunMJScheduledActionViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
77986
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
77987
- return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
77988
- }
77989
-
77990
- @Query(() => RunMJScheduledActionViewResult)
77991
- async RunMJScheduledActionDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
77992
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
77993
- input.EntityName = 'MJ: Scheduled Actions';
77994
- return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
77995
- }
77996
- @Query(() => MJScheduledAction_, { nullable: true })
77997
- async MJScheduledAction(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJScheduledAction_ | null> {
77998
- this.CheckUserReadPermissions('MJ: Scheduled Actions', userPayload);
77999
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
78000
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwScheduledActions')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Actions', userPayload, EntityPermissionType.Read, 'AND');
78001
- const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
78002
- const result = await this.MapFieldNamesToCodeNames('MJ: Scheduled Actions', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
78003
- return result;
78004
- }
78005
-
78006
- @FieldResolver(() => [MJScheduledActionParam_])
78007
- async MJScheduledActionParams_ScheduledActionIDArray(@Root() mjscheduledaction_: MJScheduledAction_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
78008
- this.CheckUserReadPermissions('MJ: Scheduled Action Params', userPayload);
78009
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
78010
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwScheduledActionParams')} WHERE ${provider.QuoteIdentifier('ScheduledActionID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Action Params', userPayload, EntityPermissionType.Read, 'AND');
78011
- const rows = await provider.ExecuteSQL(sSQL, [mjscheduledaction_.ID], undefined, this.GetUserFromPayload(userPayload));
78012
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Action Params', rows, this.GetUserFromPayload(userPayload));
78013
- return result;
78014
- }
78015
-
78016
- @FieldResolver(() => [MJContentSource_])
78017
- async MJContentSources_ScheduledActionIDArray(@Root() mjscheduledaction_: MJScheduledAction_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
78018
- this.CheckUserReadPermissions('MJ: Content Sources', userPayload);
78019
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
78020
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentSources')} WHERE ${provider.QuoteIdentifier('ScheduledActionID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Sources', userPayload, EntityPermissionType.Read, 'AND');
78021
- const rows = await provider.ExecuteSQL(sSQL, [mjscheduledaction_.ID], undefined, this.GetUserFromPayload(userPayload));
78022
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Sources', rows, this.GetUserFromPayload(userPayload));
78023
- return result;
78024
- }
78025
-
78026
- @Mutation(() => MJScheduledAction_)
78027
- async CreateMJScheduledAction(
78028
- @Arg('input', () => CreateMJScheduledActionInput) input: CreateMJScheduledActionInput,
78029
- @Ctx() { providers, userPayload }: AppContext,
78030
- @PubSub() pubSub: PubSubEngine
78031
- ) {
78032
- const provider = GetReadWriteProvider(providers);
78033
- return this.CreateRecord('MJ: Scheduled Actions', input, provider, userPayload, pubSub)
78034
- }
78035
-
78036
- @Mutation(() => MJScheduledAction_)
78037
- async UpdateMJScheduledAction(
78038
- @Arg('input', () => UpdateMJScheduledActionInput) input: UpdateMJScheduledActionInput,
78039
- @Ctx() { providers, userPayload }: AppContext,
78040
- @PubSub() pubSub: PubSubEngine
78041
- ) {
78042
- const provider = GetReadWriteProvider(providers);
78043
- return this.UpdateRecord('MJ: Scheduled Actions', input, provider, userPayload, pubSub);
78044
- }
78045
-
78046
- @Mutation(() => MJScheduledAction_)
78047
- async DeleteMJScheduledAction(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
78048
- const provider = GetReadWriteProvider(providers);
78049
- const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
78050
- return this.DeleteRecord('MJ: Scheduled Actions', key, options, provider, userPayload, pubSub);
78051
- }
78052
-
78053
- }
78054
-
78055
76984
  //****************************************************************************
78056
76985
  // ENTITY CLASS for MJ: Scheduled Job Runs
78057
76986
  //****************************************************************************
@@ -78622,6 +77551,10 @@ export class MJScheduledJob_ {
78622
77551
  @Field(() => Int, {nullable: true, description: `Optional per-job override for the acquire-time lock lease length, in minutes. When set and positive, the engine uses max(default lease, MaxRuntimeMinutes) as the initial ExpectedCompletionAt — so it only ever EXTENDS the default lease, never shrinks it. Intended for jobs whose work is a single long-running call that cannot heartbeat mid-flight (e.g. one slow synchronous action). Jobs that heartbeat via the plugin opt-in pattern do not need this. NULL = use the engine default lease (LeaseTimeoutMinutes). See plans/scheduled-job-engine-heartbeat-lease.md (GH #2749).`})
78623
77552
  MaxRuntimeMinutes?: number;
78624
77553
 
77554
+ @Field({description: `What this job does about fire times that passed while the scheduler was not running (a deploy, a crash, a sleeping machine). RunOnce (the default) performs a single catch-up run and then resumes the normal schedule — correct for digests, syncs and anything where only the latest state matters, and identical to the behavior every job had before this column existed. RunAll replays each missed occurrence, one per poll tick so a long outage drains gradually rather than dispatching at once — correct for per-period work such as billing or metric snapshots, where skipping a period loses data nothing else recreates. Skip performs no catch-up at all and simply advances to the next future occurrence — correct for work whose value expires, such as a cache warm. A run is only treated as missed when a LATER occurrence has also come due, so a job that merely became due seconds ago is never misclassified; this is evaluated cron-relatively rather than against a fixed grace window, which would misjudge both a per-minute job after a short pause and a monthly job that is a week late.`})
77555
+ @MaxLength(20)
77556
+ MissedRunPolicy: string;
77557
+
78625
77558
  @Field()
78626
77559
  @MaxLength(100)
78627
77560
  JobType: string;
@@ -78637,6 +77570,9 @@ export class MJScheduledJob_ {
78637
77570
  @Field(() => [MJScheduledJobRun_])
78638
77571
  MJScheduledJobRuns_ScheduledJobIDArray: MJScheduledJobRun_[]; // Link to MJScheduledJobRuns
78639
77572
 
77573
+ @Field(() => [MJContentSource_])
77574
+ MJContentSources_ScheduledJobIDArray: MJContentSource_[]; // Link to MJContentSources
77575
+
78640
77576
  @Field(() => [MJCompanyIntegration_])
78641
77577
  MJCompanyIntegrations_ScheduledJobIDArray: MJCompanyIntegration_[]; // Link to MJCompanyIntegrations
78642
77578
 
@@ -78731,6 +77667,9 @@ export class CreateMJScheduledJobInput {
78731
77667
  @Field(() => Int, { nullable: true })
78732
77668
  MaxRuntimeMinutes: number | null;
78733
77669
 
77670
+ @Field({ nullable: true })
77671
+ MissedRunPolicy?: string;
77672
+
78734
77673
  @Field(() => RestoreContextInput, { nullable: true })
78735
77674
  RestoreContext___?: RestoreContextInput;
78736
77675
  }
@@ -78825,6 +77764,9 @@ export class UpdateMJScheduledJobInput {
78825
77764
  @Field(() => Int, { nullable: true })
78826
77765
  MaxRuntimeMinutes?: number | null;
78827
77766
 
77767
+ @Field({ nullable: true })
77768
+ MissedRunPolicy?: string;
77769
+
78828
77770
  @Field(() => [KeyValuePairInput], { nullable: true })
78829
77771
  OldValues___?: KeyValuePairInput[];
78830
77772
 
@@ -78899,6 +77841,16 @@ export class MJScheduledJobResolver extends ResolverBase {
78899
77841
  return result;
78900
77842
  }
78901
77843
 
77844
+ @FieldResolver(() => [MJContentSource_])
77845
+ async MJContentSources_ScheduledJobIDArray(@Root() mjscheduledjob_: MJScheduledJob_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
77846
+ this.CheckUserReadPermissions('MJ: Content Sources', userPayload);
77847
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
77848
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentSources')} WHERE ${provider.QuoteIdentifier('ScheduledJobID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Sources', userPayload, EntityPermissionType.Read, 'AND');
77849
+ const rows = await provider.ExecuteSQL(sSQL, [mjscheduledjob_.ID], undefined, this.GetUserFromPayload(userPayload));
77850
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Sources', rows, this.GetUserFromPayload(userPayload));
77851
+ return result;
77852
+ }
77853
+
78902
77854
  @FieldResolver(() => [MJCompanyIntegration_])
78903
77855
  async MJCompanyIntegrations_ScheduledJobIDArray(@Root() mjscheduledjob_: MJScheduledJob_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
78904
77856
  this.CheckUserReadPermissions('MJ: Company Integrations', userPayload);
@@ -85470,6 +84422,9 @@ export class MJTaskDependency_ {
85470
84422
  @Field()
85471
84423
  _mj__UpdatedAt: Date;
85472
84424
 
84425
+ @Field({nullable: true, description: `Optional boolean expression gating this dependency edge. NULL (the default, and the value every pre-existing row carries) means the edge is unconditional, so adding this column changes the meaning of no existing graph. When present it is evaluated by the shared GraphTraversalEngine against the same context a design-time AIAgentStepPath.Condition sees, which is what lets a runtime task graph and a flow-editor graph be the same graph. A condition that evaluates false skips the edge; one that fails to evaluate ALSO skips it, but is reported distinctly so a graph stalled by a malformed expression cannot be mistaken for one that finished normally.`})
84426
+ Condition?: string;
84427
+
85473
84428
  @Field()
85474
84429
  @MaxLength(255)
85475
84430
  Task: string;
@@ -85497,6 +84452,9 @@ export class CreateMJTaskDependencyInput {
85497
84452
  @Field({ nullable: true })
85498
84453
  DependencyType?: string;
85499
84454
 
84455
+ @Field({ nullable: true })
84456
+ Condition: string | null;
84457
+
85500
84458
  @Field(() => RestoreContextInput, { nullable: true })
85501
84459
  RestoreContext___?: RestoreContextInput;
85502
84460
  }
@@ -85519,6 +84477,9 @@ export class UpdateMJTaskDependencyInput {
85519
84477
  @Field({ nullable: true })
85520
84478
  DependencyType?: string;
85521
84479
 
84480
+ @Field({ nullable: true })
84481
+ Condition?: string | null;
84482
+
85522
84483
  @Field(() => [KeyValuePairInput], { nullable: true })
85523
84484
  OldValues___?: KeyValuePairInput[];
85524
84485
 
@@ -85841,6 +84802,26 @@ export class MJTask_ {
85841
84802
  @Field()
85842
84803
  _mj__UpdatedAt: Date;
85843
84804
 
84805
+ @Field({nullable: true, description: `Structured input for this task, stored as JSON. Replaces the legacy __TASK_METADATA__ marker that was embedded in Description.`})
84806
+ InputPayload?: string;
84807
+
84808
+ @Field({nullable: true, description: `Structured output produced by this task, stored as JSON. Downstream tasks read their dependencies' outputs from here. Replaces the legacy __TASK_OUTPUT__ marker that was embedded in Description.`})
84809
+ OutputPayload?: string;
84810
+
84811
+ @Field({nullable: true, description: `Failure detail when Status is Failed. Null for tasks that have not failed.`})
84812
+ ErrorMessage?: string;
84813
+
84814
+ @Field({nullable: true, description: `The specific AI Agent Run that executed this task. Distinct from the conversation-level link: sibling tasks in one graph each get their own run, so this is what run-history and Gantt views should follow.`})
84815
+ @MaxLength(36)
84816
+ AgentRunID?: string;
84817
+
84818
+ @Field({nullable: true, description: `Identifier of the dispatcher instance currently executing this task. Part of the compare-and-swap claim protocol; set only by the dispatcher, never by user-facing writes. Null when unclaimed. Human-assigned tasks never carry a claim.`})
84819
+ @MaxLength(100)
84820
+ ClaimedBy?: string;
84821
+
84822
+ @Field({nullable: true, description: `When the current dispatcher claim lapses. Long-running tasks extend it by heartbeat; reconciliation treats an expired claim as an orphaned task and returns it to Pending.`})
84823
+ ClaimExpiresAt?: Date;
84824
+
85844
84825
  @Field({nullable: true})
85845
84826
  @MaxLength(255)
85846
84827
  Parent?: string;
@@ -85869,6 +84850,10 @@ export class MJTask_ {
85869
84850
  @MaxLength(255)
85870
84851
  Agent?: string;
85871
84852
 
84853
+ @Field({nullable: true})
84854
+ @MaxLength(255)
84855
+ AgentRun?: string;
84856
+
85872
84857
  @Field({nullable: true})
85873
84858
  @MaxLength(36)
85874
84859
  RootParentID?: string;
@@ -85934,6 +84919,24 @@ export class CreateMJTaskInput {
85934
84919
  @Field({ nullable: true })
85935
84920
  CompletedAt: Date | null;
85936
84921
 
84922
+ @Field({ nullable: true })
84923
+ InputPayload: string | null;
84924
+
84925
+ @Field({ nullable: true })
84926
+ OutputPayload: string | null;
84927
+
84928
+ @Field({ nullable: true })
84929
+ ErrorMessage: string | null;
84930
+
84931
+ @Field({ nullable: true })
84932
+ AgentRunID: string | null;
84933
+
84934
+ @Field({ nullable: true })
84935
+ ClaimedBy: string | null;
84936
+
84937
+ @Field({ nullable: true })
84938
+ ClaimExpiresAt: Date | null;
84939
+
85937
84940
  @Field(() => RestoreContextInput, { nullable: true })
85938
84941
  RestoreContext___?: RestoreContextInput;
85939
84942
  }
@@ -85989,6 +84992,24 @@ export class UpdateMJTaskInput {
85989
84992
  @Field({ nullable: true })
85990
84993
  CompletedAt?: Date | null;
85991
84994
 
84995
+ @Field({ nullable: true })
84996
+ InputPayload?: string | null;
84997
+
84998
+ @Field({ nullable: true })
84999
+ OutputPayload?: string | null;
85000
+
85001
+ @Field({ nullable: true })
85002
+ ErrorMessage?: string | null;
85003
+
85004
+ @Field({ nullable: true })
85005
+ AgentRunID?: string | null;
85006
+
85007
+ @Field({ nullable: true })
85008
+ ClaimedBy?: string | null;
85009
+
85010
+ @Field({ nullable: true })
85011
+ ClaimExpiresAt?: Date | null;
85012
+
85992
85013
  @Field(() => [KeyValuePairInput], { nullable: true })
85993
85014
  OldValues___?: KeyValuePairInput[];
85994
85015
 
@@ -93056,6 +92077,10 @@ export class MJUserViewRunDetail_ {
93056
92077
  @Field()
93057
92078
  _mj__UpdatedAt: Date;
93058
92079
 
92080
+ @Field()
92081
+ @MaxLength(100)
92082
+ UserViewRun: string;
92083
+
93059
92084
  @Field()
93060
92085
  @MaxLength(36)
93061
92086
  UserViewID: string;
@@ -93934,15 +92959,6 @@ export class MJUser_ {
93934
92959
  @Field(() => [MJRecordMergeLog_])
93935
92960
  MJRecordMergeLogs_ApprovedByUserIDArray: MJRecordMergeLog_[]; // Link to MJRecordMergeLogs
93936
92961
 
93937
- @Field(() => [MJReportCategory_])
93938
- MJReportCategories_UserIDArray: MJReportCategory_[]; // Link to MJReportCategories
93939
-
93940
- @Field(() => [MJReportSnapshot_])
93941
- MJReportSnapshots_UserIDArray: MJReportSnapshot_[]; // Link to MJReportSnapshots
93942
-
93943
- @Field(() => [MJReport_])
93944
- MJReports_UserIDArray: MJReport_[]; // Link to MJReports
93945
-
93946
92962
  @Field(() => [MJTemplateCategory_])
93947
92963
  MJTemplateCategories_UserIDArray: MJTemplateCategory_[]; // Link to MJTemplateCategories
93948
92964
 
@@ -94051,18 +93067,12 @@ export class MJUser_ {
94051
93067
  @Field(() => [MJPublicLink_])
94052
93068
  MJPublicLinks_UserIDArray: MJPublicLink_[]; // Link to MJPublicLinks
94053
93069
 
94054
- @Field(() => [MJReportUserState_])
94055
- MJReportUserStates_UserIDArray: MJReportUserState_[]; // Link to MJReportUserStates
94056
-
94057
93070
  @Field(() => [MJResourceLink_])
94058
93071
  MJResourceLinks_UserIDArray: MJResourceLink_[]; // Link to MJResourceLinks
94059
93072
 
94060
93073
  @Field(() => [MJResourcePermission_])
94061
93074
  MJResourcePermissions_SharedByUserIDArray: MJResourcePermission_[]; // Link to MJResourcePermissions
94062
93075
 
94063
- @Field(() => [MJScheduledAction_])
94064
- MJScheduledActions_CreatedByUserIDArray: MJScheduledAction_[]; // Link to MJScheduledActions
94065
-
94066
93076
  @Field(() => [MJScheduledJobRun_])
94067
93077
  MJScheduledJobRuns_ExecutedByUserIDArray: MJScheduledJobRun_[]; // Link to MJScheduledJobRuns
94068
93078
 
@@ -94548,36 +93558,6 @@ export class MJUserResolverBase extends ResolverBase {
94548
93558
  return result;
94549
93559
  }
94550
93560
 
94551
- @FieldResolver(() => [MJReportCategory_])
94552
- async MJReportCategories_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
94553
- this.CheckUserReadPermissions('MJ: Report Categories', userPayload);
94554
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
94555
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReportCategories')} WHERE ${provider.QuoteIdentifier('UserID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Report Categories', userPayload, EntityPermissionType.Read, 'AND');
94556
- const rows = await provider.ExecuteSQL(sSQL, [mjuser_.ID], undefined, this.GetUserFromPayload(userPayload));
94557
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Report Categories', rows, this.GetUserFromPayload(userPayload));
94558
- return result;
94559
- }
94560
-
94561
- @FieldResolver(() => [MJReportSnapshot_])
94562
- async MJReportSnapshots_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
94563
- this.CheckUserReadPermissions('MJ: Report Snapshots', userPayload);
94564
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
94565
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReportSnapshots')} WHERE ${provider.QuoteIdentifier('UserID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Report Snapshots', userPayload, EntityPermissionType.Read, 'AND');
94566
- const rows = await provider.ExecuteSQL(sSQL, [mjuser_.ID], undefined, this.GetUserFromPayload(userPayload));
94567
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Report Snapshots', rows, this.GetUserFromPayload(userPayload));
94568
- return result;
94569
- }
94570
-
94571
- @FieldResolver(() => [MJReport_])
94572
- async MJReports_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
94573
- this.CheckUserReadPermissions('MJ: Reports', userPayload);
94574
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
94575
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReports')} WHERE ${provider.QuoteIdentifier('UserID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Reports', userPayload, EntityPermissionType.Read, 'AND');
94576
- const rows = await provider.ExecuteSQL(sSQL, [mjuser_.ID], undefined, this.GetUserFromPayload(userPayload));
94577
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Reports', rows, this.GetUserFromPayload(userPayload));
94578
- return result;
94579
- }
94580
-
94581
93561
  @FieldResolver(() => [MJTemplateCategory_])
94582
93562
  async MJTemplateCategories_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
94583
93563
  this.CheckUserReadPermissions('MJ: Template Categories', userPayload);
@@ -94938,16 +93918,6 @@ export class MJUserResolverBase extends ResolverBase {
94938
93918
  return result;
94939
93919
  }
94940
93920
 
94941
- @FieldResolver(() => [MJReportUserState_])
94942
- async MJReportUserStates_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
94943
- this.CheckUserReadPermissions('MJ: Report User States', userPayload);
94944
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
94945
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReportUserStates')} WHERE ${provider.QuoteIdentifier('UserID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Report User States', userPayload, EntityPermissionType.Read, 'AND');
94946
- const rows = await provider.ExecuteSQL(sSQL, [mjuser_.ID], undefined, this.GetUserFromPayload(userPayload));
94947
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Report User States', rows, this.GetUserFromPayload(userPayload));
94948
- return result;
94949
- }
94950
-
94951
93921
  @FieldResolver(() => [MJResourceLink_])
94952
93922
  async MJResourceLinks_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
94953
93923
  this.CheckUserReadPermissions('MJ: Resource Links', userPayload);
@@ -94968,16 +93938,6 @@ export class MJUserResolverBase extends ResolverBase {
94968
93938
  return result;
94969
93939
  }
94970
93940
 
94971
- @FieldResolver(() => [MJScheduledAction_])
94972
- async MJScheduledActions_CreatedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
94973
- this.CheckUserReadPermissions('MJ: Scheduled Actions', userPayload);
94974
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
94975
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwScheduledActions')} WHERE ${provider.QuoteIdentifier('CreatedByUserID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Actions', userPayload, EntityPermissionType.Read, 'AND');
94976
- const rows = await provider.ExecuteSQL(sSQL, [mjuser_.ID], undefined, this.GetUserFromPayload(userPayload));
94977
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Actions', rows, this.GetUserFromPayload(userPayload));
94978
- return result;
94979
- }
94980
-
94981
93941
  @FieldResolver(() => [MJScheduledJobRun_])
94982
93942
  async MJScheduledJobRuns_ExecutedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
94983
93943
  this.CheckUserReadPermissions('MJ: Scheduled Job Runs', userPayload);
@@ -97172,622 +96132,6 @@ export class MJViewTypeResolver extends ResolverBase {
97172
96132
 
97173
96133
  }
97174
96134
 
97175
- //****************************************************************************
97176
- // ENTITY CLASS for MJ: Workflow Engines
97177
- //****************************************************************************
97178
- @ObjectType({ description: `Registers available workflow execution engines with their capabilities, configuration, and supported workflow types.` })
97179
- export class MJWorkflowEngine_ {
97180
- @Field()
97181
- @MaxLength(36)
97182
- ID: string;
97183
-
97184
- @Field()
97185
- @MaxLength(100)
97186
- Name: string;
97187
-
97188
- @Field({nullable: true})
97189
- Description?: string;
97190
-
97191
- @Field({description: `Import path for the workflow engine driver.`})
97192
- @MaxLength(500)
97193
- DriverPath: string;
97194
-
97195
- @Field({description: `Class name implementing the workflow engine interface.`})
97196
- @MaxLength(100)
97197
- DriverClass: string;
97198
-
97199
- @Field()
97200
- _mj__CreatedAt: Date;
97201
-
97202
- @Field()
97203
- _mj__UpdatedAt: Date;
97204
-
97205
- @Field(() => [MJWorkflow_])
97206
- MJWorkflows_WorkflowEngineIDArray: MJWorkflow_[]; // Link to MJWorkflows
97207
-
97208
- }
97209
-
97210
- //****************************************************************************
97211
- // INPUT TYPE for MJ: Workflow Engines
97212
- //****************************************************************************
97213
- @InputType()
97214
- export class CreateMJWorkflowEngineInput {
97215
- @Field({ nullable: true })
97216
- ID?: string;
97217
-
97218
- @Field({ nullable: true })
97219
- Name?: string;
97220
-
97221
- @Field({ nullable: true })
97222
- Description: string | null;
97223
-
97224
- @Field({ nullable: true })
97225
- DriverPath?: string;
97226
-
97227
- @Field({ nullable: true })
97228
- DriverClass?: string;
97229
-
97230
- @Field(() => RestoreContextInput, { nullable: true })
97231
- RestoreContext___?: RestoreContextInput;
97232
- }
97233
-
97234
-
97235
- //****************************************************************************
97236
- // INPUT TYPE for MJ: Workflow Engines
97237
- //****************************************************************************
97238
- @InputType()
97239
- export class UpdateMJWorkflowEngineInput {
97240
- @Field()
97241
- ID: string;
97242
-
97243
- @Field({ nullable: true })
97244
- Name?: string;
97245
-
97246
- @Field({ nullable: true })
97247
- Description?: string | null;
97248
-
97249
- @Field({ nullable: true })
97250
- DriverPath?: string;
97251
-
97252
- @Field({ nullable: true })
97253
- DriverClass?: string;
97254
-
97255
- @Field(() => [KeyValuePairInput], { nullable: true })
97256
- OldValues___?: KeyValuePairInput[];
97257
-
97258
- @Field(() => RestoreContextInput, { nullable: true })
97259
- RestoreContext___?: RestoreContextInput;
97260
- }
97261
-
97262
- //****************************************************************************
97263
- // RESOLVER for MJ: Workflow Engines
97264
- //****************************************************************************
97265
- @ObjectType()
97266
- export class RunMJWorkflowEngineViewResult {
97267
- @Field(() => [MJWorkflowEngine_])
97268
- Results: MJWorkflowEngine_[];
97269
-
97270
- @Field(() => String, {nullable: true})
97271
- UserViewRunID?: string;
97272
-
97273
- @Field(() => Int, {nullable: true})
97274
- RowCount: number;
97275
-
97276
- @Field(() => Int, {nullable: true})
97277
- TotalRowCount: number;
97278
-
97279
- @Field(() => Int, {nullable: true})
97280
- ExecutionTime: number;
97281
-
97282
- @Field({nullable: true})
97283
- ErrorMessage?: string;
97284
-
97285
- @Field(() => Boolean, {nullable: false})
97286
- Success: boolean;
97287
- }
97288
-
97289
- @Resolver(MJWorkflowEngine_)
97290
- export class MJWorkflowEngineResolver extends ResolverBase {
97291
- @Query(() => RunMJWorkflowEngineViewResult)
97292
- async RunMJWorkflowEngineViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
97293
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
97294
- return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
97295
- }
97296
-
97297
- @Query(() => RunMJWorkflowEngineViewResult)
97298
- async RunMJWorkflowEngineViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
97299
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
97300
- return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
97301
- }
97302
-
97303
- @Query(() => RunMJWorkflowEngineViewResult)
97304
- async RunMJWorkflowEngineDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
97305
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
97306
- input.EntityName = 'MJ: Workflow Engines';
97307
- return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
97308
- }
97309
- @Query(() => MJWorkflowEngine_, { nullable: true })
97310
- async MJWorkflowEngine(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJWorkflowEngine_ | null> {
97311
- this.CheckUserReadPermissions('MJ: Workflow Engines', userPayload);
97312
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
97313
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwWorkflowEngines')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Workflow Engines', userPayload, EntityPermissionType.Read, 'AND');
97314
- const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
97315
- const result = await this.MapFieldNamesToCodeNames('MJ: Workflow Engines', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
97316
- return result;
97317
- }
97318
-
97319
- @FieldResolver(() => [MJWorkflow_])
97320
- async MJWorkflows_WorkflowEngineIDArray(@Root() mjworkflowengine_: MJWorkflowEngine_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
97321
- this.CheckUserReadPermissions('MJ: Workflows', userPayload);
97322
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
97323
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwWorkflows')} WHERE ${provider.QuoteIdentifier('WorkflowEngineID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Workflows', userPayload, EntityPermissionType.Read, 'AND');
97324
- const rows = await provider.ExecuteSQL(sSQL, [mjworkflowengine_.ID], undefined, this.GetUserFromPayload(userPayload));
97325
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Workflows', rows, this.GetUserFromPayload(userPayload));
97326
- return result;
97327
- }
97328
-
97329
- @Mutation(() => MJWorkflowEngine_)
97330
- async CreateMJWorkflowEngine(
97331
- @Arg('input', () => CreateMJWorkflowEngineInput) input: CreateMJWorkflowEngineInput,
97332
- @Ctx() { providers, userPayload }: AppContext,
97333
- @PubSub() pubSub: PubSubEngine
97334
- ) {
97335
- const provider = GetReadWriteProvider(providers);
97336
- return this.CreateRecord('MJ: Workflow Engines', input, provider, userPayload, pubSub)
97337
- }
97338
-
97339
- @Mutation(() => MJWorkflowEngine_)
97340
- async UpdateMJWorkflowEngine(
97341
- @Arg('input', () => UpdateMJWorkflowEngineInput) input: UpdateMJWorkflowEngineInput,
97342
- @Ctx() { providers, userPayload }: AppContext,
97343
- @PubSub() pubSub: PubSubEngine
97344
- ) {
97345
- const provider = GetReadWriteProvider(providers);
97346
- return this.UpdateRecord('MJ: Workflow Engines', input, provider, userPayload, pubSub);
97347
- }
97348
-
97349
- @Mutation(() => MJWorkflowEngine_)
97350
- async DeleteMJWorkflowEngine(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
97351
- const provider = GetReadWriteProvider(providers);
97352
- const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
97353
- return this.DeleteRecord('MJ: Workflow Engines', key, options, provider, userPayload, pubSub);
97354
- }
97355
-
97356
- }
97357
-
97358
- //****************************************************************************
97359
- // ENTITY CLASS for MJ: Workflow Runs
97360
- //****************************************************************************
97361
- @ObjectType({ description: `Tracks execution instances of workflows including status, timing, context data, and detailed step-by-step results.` })
97362
- export class MJWorkflowRun_ {
97363
- @Field()
97364
- @MaxLength(36)
97365
- ID: string;
97366
-
97367
- @Field()
97368
- @MaxLength(36)
97369
- WorkflowID: string;
97370
-
97371
- @Field({description: `Field ExternalSystemRecordID for entity Workflow Runs.`})
97372
- @MaxLength(500)
97373
- ExternalSystemRecordID: string;
97374
-
97375
- @Field()
97376
- StartedAt: Date;
97377
-
97378
- @Field({nullable: true})
97379
- EndedAt?: Date;
97380
-
97381
- @Field()
97382
- @MaxLength(10)
97383
- Status: string;
97384
-
97385
- @Field({nullable: true, description: `JSON-formatted detailed results from the workflow execution, including outputs from each step and any error information.`})
97386
- Results?: string;
97387
-
97388
- @Field()
97389
- _mj__CreatedAt: Date;
97390
-
97391
- @Field()
97392
- _mj__UpdatedAt: Date;
97393
-
97394
- @Field()
97395
- @MaxLength(100)
97396
- Workflow: string;
97397
-
97398
- @Field()
97399
- @MaxLength(100)
97400
- WorkflowEngineName: string;
97401
-
97402
- }
97403
-
97404
- //****************************************************************************
97405
- // INPUT TYPE for MJ: Workflow Runs
97406
- //****************************************************************************
97407
- @InputType()
97408
- export class CreateMJWorkflowRunInput {
97409
- @Field({ nullable: true })
97410
- ID?: string;
97411
-
97412
- @Field({ nullable: true })
97413
- WorkflowID?: string;
97414
-
97415
- @Field({ nullable: true })
97416
- ExternalSystemRecordID?: string;
97417
-
97418
- @Field({ nullable: true })
97419
- StartedAt?: Date;
97420
-
97421
- @Field({ nullable: true })
97422
- EndedAt: Date | null;
97423
-
97424
- @Field({ nullable: true })
97425
- Status?: string;
97426
-
97427
- @Field({ nullable: true })
97428
- Results: string | null;
97429
-
97430
- @Field(() => RestoreContextInput, { nullable: true })
97431
- RestoreContext___?: RestoreContextInput;
97432
- }
97433
-
97434
-
97435
- //****************************************************************************
97436
- // INPUT TYPE for MJ: Workflow Runs
97437
- //****************************************************************************
97438
- @InputType()
97439
- export class UpdateMJWorkflowRunInput {
97440
- @Field()
97441
- ID: string;
97442
-
97443
- @Field({ nullable: true })
97444
- WorkflowID?: string;
97445
-
97446
- @Field({ nullable: true })
97447
- ExternalSystemRecordID?: string;
97448
-
97449
- @Field({ nullable: true })
97450
- StartedAt?: Date;
97451
-
97452
- @Field({ nullable: true })
97453
- EndedAt?: Date | null;
97454
-
97455
- @Field({ nullable: true })
97456
- Status?: string;
97457
-
97458
- @Field({ nullable: true })
97459
- Results?: string | null;
97460
-
97461
- @Field(() => [KeyValuePairInput], { nullable: true })
97462
- OldValues___?: KeyValuePairInput[];
97463
-
97464
- @Field(() => RestoreContextInput, { nullable: true })
97465
- RestoreContext___?: RestoreContextInput;
97466
- }
97467
-
97468
- //****************************************************************************
97469
- // RESOLVER for MJ: Workflow Runs
97470
- //****************************************************************************
97471
- @ObjectType()
97472
- export class RunMJWorkflowRunViewResult {
97473
- @Field(() => [MJWorkflowRun_])
97474
- Results: MJWorkflowRun_[];
97475
-
97476
- @Field(() => String, {nullable: true})
97477
- UserViewRunID?: string;
97478
-
97479
- @Field(() => Int, {nullable: true})
97480
- RowCount: number;
97481
-
97482
- @Field(() => Int, {nullable: true})
97483
- TotalRowCount: number;
97484
-
97485
- @Field(() => Int, {nullable: true})
97486
- ExecutionTime: number;
97487
-
97488
- @Field({nullable: true})
97489
- ErrorMessage?: string;
97490
-
97491
- @Field(() => Boolean, {nullable: false})
97492
- Success: boolean;
97493
- }
97494
-
97495
- @Resolver(MJWorkflowRun_)
97496
- export class MJWorkflowRunResolver extends ResolverBase {
97497
- @Query(() => RunMJWorkflowRunViewResult)
97498
- async RunMJWorkflowRunViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
97499
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
97500
- return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
97501
- }
97502
-
97503
- @Query(() => RunMJWorkflowRunViewResult)
97504
- async RunMJWorkflowRunViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
97505
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
97506
- return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
97507
- }
97508
-
97509
- @Query(() => RunMJWorkflowRunViewResult)
97510
- async RunMJWorkflowRunDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
97511
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
97512
- input.EntityName = 'MJ: Workflow Runs';
97513
- return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
97514
- }
97515
- @Query(() => MJWorkflowRun_, { nullable: true })
97516
- async MJWorkflowRun(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJWorkflowRun_ | null> {
97517
- this.CheckUserReadPermissions('MJ: Workflow Runs', userPayload);
97518
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
97519
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwWorkflowRuns')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Workflow Runs', userPayload, EntityPermissionType.Read, 'AND');
97520
- const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
97521
- const result = await this.MapFieldNamesToCodeNames('MJ: Workflow Runs', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
97522
- return result;
97523
- }
97524
-
97525
- @Mutation(() => MJWorkflowRun_)
97526
- async CreateMJWorkflowRun(
97527
- @Arg('input', () => CreateMJWorkflowRunInput) input: CreateMJWorkflowRunInput,
97528
- @Ctx() { providers, userPayload }: AppContext,
97529
- @PubSub() pubSub: PubSubEngine
97530
- ) {
97531
- const provider = GetReadWriteProvider(providers);
97532
- return this.CreateRecord('MJ: Workflow Runs', input, provider, userPayload, pubSub)
97533
- }
97534
-
97535
- @Mutation(() => MJWorkflowRun_)
97536
- async UpdateMJWorkflowRun(
97537
- @Arg('input', () => UpdateMJWorkflowRunInput) input: UpdateMJWorkflowRunInput,
97538
- @Ctx() { providers, userPayload }: AppContext,
97539
- @PubSub() pubSub: PubSubEngine
97540
- ) {
97541
- const provider = GetReadWriteProvider(providers);
97542
- return this.UpdateRecord('MJ: Workflow Runs', input, provider, userPayload, pubSub);
97543
- }
97544
-
97545
- @Mutation(() => MJWorkflowRun_)
97546
- async DeleteMJWorkflowRun(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
97547
- const provider = GetReadWriteProvider(providers);
97548
- const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
97549
- return this.DeleteRecord('MJ: Workflow Runs', key, options, provider, userPayload, pubSub);
97550
- }
97551
-
97552
- }
97553
-
97554
- //****************************************************************************
97555
- // ENTITY CLASS for MJ: Workflows
97556
- //****************************************************************************
97557
- @ObjectType({ description: `Defines automated workflows with steps, conditions, and actions for orchestrating complex business processes.` })
97558
- export class MJWorkflow_ {
97559
- @Field()
97560
- @MaxLength(36)
97561
- ID: string;
97562
-
97563
- @Field()
97564
- @MaxLength(100)
97565
- Name: string;
97566
-
97567
- @Field({nullable: true})
97568
- Description?: string;
97569
-
97570
- @Field()
97571
- @MaxLength(36)
97572
- WorkflowEngineID: string;
97573
-
97574
- @Field({description: `The unique identifier of this workflow in an external system, used for synchronization with external workflow engines.`})
97575
- @MaxLength(100)
97576
- ExternalSystemRecordID: string;
97577
-
97578
- @Field(() => Boolean, {description: `If set to 1, the workflow will be run automatically on the interval specified by the AutoRunIntervalType and AutoRunInterval fields`})
97579
- AutoRunEnabled: boolean;
97580
-
97581
- @Field({nullable: true, description: `Minutes, Hours, Days, Weeks, Months, Years`})
97582
- @MaxLength(20)
97583
- AutoRunIntervalUnits?: string;
97584
-
97585
- @Field(() => Int, {nullable: true, description: `The interval, denominated in the units specified in the AutoRunIntervalUnits column, between auto runs of this workflow.`})
97586
- AutoRunInterval?: number;
97587
-
97588
- @Field({nullable: true, description: `If specified, this subclass key, via the ClassFactory, will be instantiated, to execute this workflow. If not specified the WorkflowBase class will be used by default.`})
97589
- @MaxLength(200)
97590
- SubclassName?: string;
97591
-
97592
- @Field()
97593
- _mj__CreatedAt: Date;
97594
-
97595
- @Field()
97596
- _mj__UpdatedAt: Date;
97597
-
97598
- @Field(() => Int, {nullable: true})
97599
- AutoRunIntervalMinutes?: number;
97600
-
97601
- @Field(() => [MJReport_])
97602
- MJReports_OutputWorkflowIDArray: MJReport_[]; // Link to MJReports
97603
-
97604
- @Field(() => [MJWorkflowRun_])
97605
- MJWorkflowRuns_WorkflowIDArray: MJWorkflowRun_[]; // Link to MJWorkflowRuns
97606
-
97607
- }
97608
-
97609
- //****************************************************************************
97610
- // INPUT TYPE for MJ: Workflows
97611
- //****************************************************************************
97612
- @InputType()
97613
- export class CreateMJWorkflowInput {
97614
- @Field({ nullable: true })
97615
- ID?: string;
97616
-
97617
- @Field({ nullable: true })
97618
- Name?: string;
97619
-
97620
- @Field({ nullable: true })
97621
- Description: string | null;
97622
-
97623
- @Field({ nullable: true })
97624
- WorkflowEngineID?: string;
97625
-
97626
- @Field({ nullable: true })
97627
- ExternalSystemRecordID?: string;
97628
-
97629
- @Field(() => Boolean, { nullable: true })
97630
- AutoRunEnabled?: boolean;
97631
-
97632
- @Field({ nullable: true })
97633
- AutoRunIntervalUnits: string | null;
97634
-
97635
- @Field(() => Int, { nullable: true })
97636
- AutoRunInterval: number | null;
97637
-
97638
- @Field({ nullable: true })
97639
- SubclassName: string | null;
97640
-
97641
- @Field(() => RestoreContextInput, { nullable: true })
97642
- RestoreContext___?: RestoreContextInput;
97643
- }
97644
-
97645
-
97646
- //****************************************************************************
97647
- // INPUT TYPE for MJ: Workflows
97648
- //****************************************************************************
97649
- @InputType()
97650
- export class UpdateMJWorkflowInput {
97651
- @Field()
97652
- ID: string;
97653
-
97654
- @Field({ nullable: true })
97655
- Name?: string;
97656
-
97657
- @Field({ nullable: true })
97658
- Description?: string | null;
97659
-
97660
- @Field({ nullable: true })
97661
- WorkflowEngineID?: string;
97662
-
97663
- @Field({ nullable: true })
97664
- ExternalSystemRecordID?: string;
97665
-
97666
- @Field(() => Boolean, { nullable: true })
97667
- AutoRunEnabled?: boolean;
97668
-
97669
- @Field({ nullable: true })
97670
- AutoRunIntervalUnits?: string | null;
97671
-
97672
- @Field(() => Int, { nullable: true })
97673
- AutoRunInterval?: number | null;
97674
-
97675
- @Field({ nullable: true })
97676
- SubclassName?: string | null;
97677
-
97678
- @Field(() => [KeyValuePairInput], { nullable: true })
97679
- OldValues___?: KeyValuePairInput[];
97680
-
97681
- @Field(() => RestoreContextInput, { nullable: true })
97682
- RestoreContext___?: RestoreContextInput;
97683
- }
97684
-
97685
- //****************************************************************************
97686
- // RESOLVER for MJ: Workflows
97687
- //****************************************************************************
97688
- @ObjectType()
97689
- export class RunMJWorkflowViewResult {
97690
- @Field(() => [MJWorkflow_])
97691
- Results: MJWorkflow_[];
97692
-
97693
- @Field(() => String, {nullable: true})
97694
- UserViewRunID?: string;
97695
-
97696
- @Field(() => Int, {nullable: true})
97697
- RowCount: number;
97698
-
97699
- @Field(() => Int, {nullable: true})
97700
- TotalRowCount: number;
97701
-
97702
- @Field(() => Int, {nullable: true})
97703
- ExecutionTime: number;
97704
-
97705
- @Field({nullable: true})
97706
- ErrorMessage?: string;
97707
-
97708
- @Field(() => Boolean, {nullable: false})
97709
- Success: boolean;
97710
- }
97711
-
97712
- @Resolver(MJWorkflow_)
97713
- export class MJWorkflowResolver extends ResolverBase {
97714
- @Query(() => RunMJWorkflowViewResult)
97715
- async RunMJWorkflowViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
97716
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
97717
- return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
97718
- }
97719
-
97720
- @Query(() => RunMJWorkflowViewResult)
97721
- async RunMJWorkflowViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
97722
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
97723
- return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
97724
- }
97725
-
97726
- @Query(() => RunMJWorkflowViewResult)
97727
- async RunMJWorkflowDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
97728
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
97729
- input.EntityName = 'MJ: Workflows';
97730
- return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
97731
- }
97732
- @Query(() => MJWorkflow_, { nullable: true })
97733
- async MJWorkflow(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJWorkflow_ | null> {
97734
- this.CheckUserReadPermissions('MJ: Workflows', userPayload);
97735
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
97736
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwWorkflows')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Workflows', userPayload, EntityPermissionType.Read, 'AND');
97737
- const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
97738
- const result = await this.MapFieldNamesToCodeNames('MJ: Workflows', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
97739
- return result;
97740
- }
97741
-
97742
- @FieldResolver(() => [MJReport_])
97743
- async MJReports_OutputWorkflowIDArray(@Root() mjworkflow_: MJWorkflow_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
97744
- this.CheckUserReadPermissions('MJ: Reports', userPayload);
97745
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
97746
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwReports')} WHERE ${provider.QuoteIdentifier('OutputWorkflowID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Reports', userPayload, EntityPermissionType.Read, 'AND');
97747
- const rows = await provider.ExecuteSQL(sSQL, [mjworkflow_.ID], undefined, this.GetUserFromPayload(userPayload));
97748
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Reports', rows, this.GetUserFromPayload(userPayload));
97749
- return result;
97750
- }
97751
-
97752
- @FieldResolver(() => [MJWorkflowRun_])
97753
- async MJWorkflowRuns_WorkflowIDArray(@Root() mjworkflow_: MJWorkflow_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
97754
- this.CheckUserReadPermissions('MJ: Workflow Runs', userPayload);
97755
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
97756
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwWorkflowRuns')} WHERE ${provider.QuoteIdentifier('WorkflowID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Workflow Runs', userPayload, EntityPermissionType.Read, 'AND');
97757
- const rows = await provider.ExecuteSQL(sSQL, [mjworkflow_.ID], undefined, this.GetUserFromPayload(userPayload));
97758
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Workflow Runs', rows, this.GetUserFromPayload(userPayload));
97759
- return result;
97760
- }
97761
-
97762
- @Mutation(() => MJWorkflow_)
97763
- async CreateMJWorkflow(
97764
- @Arg('input', () => CreateMJWorkflowInput) input: CreateMJWorkflowInput,
97765
- @Ctx() { providers, userPayload }: AppContext,
97766
- @PubSub() pubSub: PubSubEngine
97767
- ) {
97768
- const provider = GetReadWriteProvider(providers);
97769
- return this.CreateRecord('MJ: Workflows', input, provider, userPayload, pubSub)
97770
- }
97771
-
97772
- @Mutation(() => MJWorkflow_)
97773
- async UpdateMJWorkflow(
97774
- @Arg('input', () => UpdateMJWorkflowInput) input: UpdateMJWorkflowInput,
97775
- @Ctx() { providers, userPayload }: AppContext,
97776
- @PubSub() pubSub: PubSubEngine
97777
- ) {
97778
- const provider = GetReadWriteProvider(providers);
97779
- return this.UpdateRecord('MJ: Workflows', input, provider, userPayload, pubSub);
97780
- }
97781
-
97782
- @Mutation(() => MJWorkflow_)
97783
- async DeleteMJWorkflow(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
97784
- const provider = GetReadWriteProvider(providers);
97785
- const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
97786
- return this.DeleteRecord('MJ: Workflows', key, options, provider, userPayload, pubSub);
97787
- }
97788
-
97789
- }
97790
-
97791
96135
  //****************************************************************************
97792
96136
  // ENTITY CLASS for MJ: Workspace Items
97793
96137
  //****************************************************************************