@memberjunction/server 5.28.0 → 5.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/auth/newUsers.d.ts.map +1 -1
  2. package/dist/auth/newUsers.js +63 -70
  3. package/dist/auth/newUsers.js.map +1 -1
  4. package/dist/config.d.ts +151 -0
  5. package/dist/config.d.ts.map +1 -1
  6. package/dist/config.js +15 -0
  7. package/dist/config.js.map +1 -1
  8. package/dist/generated/generated.d.ts +452 -6
  9. package/dist/generated/generated.d.ts.map +1 -1
  10. package/dist/generated/generated.js +2788 -303
  11. package/dist/generated/generated.js.map +1 -1
  12. package/dist/index.d.ts +1 -0
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +1 -0
  15. package/dist/index.js.map +1 -1
  16. package/dist/resolvers/FeedbackResolver.d.ts +150 -0
  17. package/dist/resolvers/FeedbackResolver.d.ts.map +1 -0
  18. package/dist/resolvers/FeedbackResolver.js +876 -0
  19. package/dist/resolvers/FeedbackResolver.js.map +1 -0
  20. package/dist/resolvers/FileResolver.d.ts +27 -0
  21. package/dist/resolvers/FileResolver.d.ts.map +1 -1
  22. package/dist/resolvers/FileResolver.js +32 -3
  23. package/dist/resolvers/FileResolver.js.map +1 -1
  24. package/dist/resolvers/IntegrationDiscoveryResolver.d.ts +100 -1
  25. package/dist/resolvers/IntegrationDiscoveryResolver.d.ts.map +1 -1
  26. package/dist/resolvers/IntegrationDiscoveryResolver.js +532 -41
  27. package/dist/resolvers/IntegrationDiscoveryResolver.js.map +1 -1
  28. package/dist/resolvers/MCPResolver.d.ts +77 -0
  29. package/dist/resolvers/MCPResolver.d.ts.map +1 -1
  30. package/dist/resolvers/MCPResolver.js +300 -1
  31. package/dist/resolvers/MCPResolver.js.map +1 -1
  32. package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
  33. package/dist/resolvers/RunAIAgentResolver.js +87 -32
  34. package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
  35. package/dist/resolvers/SyncDataResolver.d.ts.map +1 -1
  36. package/dist/resolvers/SyncDataResolver.js +20 -12
  37. package/dist/resolvers/SyncDataResolver.js.map +1 -1
  38. package/dist/resolvers/SyncRolesUsersResolver.d.ts +20 -9
  39. package/dist/resolvers/SyncRolesUsersResolver.d.ts.map +1 -1
  40. package/dist/resolvers/SyncRolesUsersResolver.js +153 -116
  41. package/dist/resolvers/SyncRolesUsersResolver.js.map +1 -1
  42. package/dist/services/TaskOrchestrator.d.ts.map +1 -1
  43. package/dist/services/TaskOrchestrator.js +78 -79
  44. package/dist/services/TaskOrchestrator.js.map +1 -1
  45. package/package.json +68 -66
  46. package/src/auth/newUsers.ts +65 -74
  47. package/src/config.ts +19 -0
  48. package/src/generated/generated.ts +1753 -40
  49. package/src/index.ts +1 -0
  50. package/src/resolvers/FeedbackResolver.ts +940 -0
  51. package/src/resolvers/FileResolver.ts +33 -4
  52. package/src/resolvers/IntegrationDiscoveryResolver.ts +543 -43
  53. package/src/resolvers/MCPResolver.ts +297 -1
  54. package/src/resolvers/RunAIAgentResolver.ts +89 -32
  55. package/src/resolvers/SyncDataResolver.ts +24 -14
  56. package/src/resolvers/SyncRolesUsersResolver.ts +177 -141
  57. package/src/services/TaskOrchestrator.ts +86 -93
@@ -18,7 +18,7 @@ import { mj_core_schema } from '../config.js';
18
18
 
19
19
 
20
20
 
21
- import { MJAccessControlRuleEntity, MJActionAuthorizationEntity, MJActionCategoryEntity, MJActionContextTypeEntity, MJActionContextEntity, MJActionExecutionLogEntity, MJActionFilterEntity, MJActionLibraryEntity, MJActionParamEntity, MJActionResultCodeEntity, MJActionEntity, MJAIActionEntity, MJAIAgentActionEntity, MJAIAgentArtifactTypeEntity, MJAIAgentCategoryEntity, MJAIAgentClientToolEntity, MJAIAgentConfigurationEntity, MJAIAgentDataSourceEntity, MJAIAgentExampleEntity, MJAIAgentLearningCycleEntity, MJAIAgentModalityEntity, MJAIAgentModelEntity, MJAIAgentNoteTypeEntity, MJAIAgentNoteEntity, MJAIAgentPermissionEntity, MJAIAgentPromptEntity, MJAIAgentRelationshipEntity, MJAIAgentRequestTypeEntity, MJAIAgentRequestEntity, MJAIAgentRunMediaEntity, MJAIAgentRunStepEntity, MJAIAgentRunEntity, MJAIAgentStepPathEntity, MJAIAgentStepEntity, MJAIAgentTypeEntity, MJAIAgentEntity, MJAIArchitectureEntity, MJAIClientToolDefinitionEntity, MJAIConfigurationParamEntity, MJAIConfigurationEntity, MJAICredentialBindingEntity, MJAIModalityEntity, MJAIModelActionEntity, MJAIModelArchitectureEntity, MJAIModelCostEntity, MJAIModelModalityEntity, MJAIModelPriceTypeEntity, MJAIModelPriceUnitTypeEntity, MJAIModelTypeEntity, MJAIModelVendorEntity, MJAIModelEntity, MJAIPromptCategoryEntity, MJAIPromptModelEntity, MJAIPromptRunMediaEntity, MJAIPromptRunEntity, MJAIPromptTypeEntity, MJAIPromptEntity, MJAIResultCacheEntity, MJAIVendorTypeDefinitionEntity, MJAIVendorTypeEntity, MJAIVendorEntity, MJAPIApplicationScopeEntity, MJAPIApplicationEntity, MJAPIKeyApplicationEntity, MJAPIKeyScopeEntity, MJAPIKeyUsageLogEntity, MJAPIKeyEntity, MJAPIScopeEntity, MJApplicationEntityEntity, MJApplicationRoleEntity, MJApplicationSettingEntity, MJApplicationEntity, MJArtifactPermissionEntity, MJArtifactTypeEntity, MJArtifactUseEntity, MJArtifactVersionAttributeEntity, MJArtifactVersionEntity, MJArtifactEntity, MJAuditLogTypeEntity, MJAuditLogEntity, MJAuthorizationRoleEntity, MJAuthorizationEntity, MJCollectionArtifactEntity, MJCollectionPermissionEntity, MJCollectionEntity, MJCommunicationBaseMessageTypeEntity, MJCommunicationLogEntity, MJCommunicationProviderMessageTypeEntity, MJCommunicationProviderEntity, MJCommunicationRunEntity, MJCompanyEntity, MJCompanyIntegrationEntityMapEntity, MJCompanyIntegrationFieldMapEntity, MJCompanyIntegrationRecordMapEntity, MJCompanyIntegrationRunAPILogEntity, MJCompanyIntegrationRunDetailEntity, MJCompanyIntegrationRunEntity, MJCompanyIntegrationSyncWatermarkEntity, MJCompanyIntegrationEntity, MJComponentDependencyEntity, MJComponentLibraryEntity, MJComponentLibraryLinkEntity, MJComponentRegistryEntity, MJComponentEntity, MJContentFileTypeEntity, MJContentItemAttributeEntity, MJContentItemDuplicateEntity, MJContentItemTagEntity, MJContentItemEntity, MJContentProcessRunDetailEntity, MJContentProcessRunPromptRunEntity, MJContentProcessRunEntity, MJContentSourceParamEntity, MJContentSourceTypeParamEntity, MJContentSourceTypeEntity, MJContentSourceEntity, MJContentTypeAttributeEntity, MJContentTypeEntity, MJConversationArtifactPermissionEntity, MJConversationArtifactVersionEntity, MJConversationArtifactEntity, MJConversationDetailArtifactEntity, MJConversationDetailAttachmentEntity, MJConversationDetailRatingEntity, MJConversationDetailEntity, MJConversationEntity, MJCountryEntity, MJCredentialCategoryEntity, MJCredentialTypeEntity, MJCredentialEntity, MJDashboardCategoryEntity, MJDashboardCategoryLinkEntity, MJDashboardCategoryPermissionEntity, MJDashboardPartTypeEntity, MJDashboardPermissionEntity, MJDashboardUserPreferenceEntity, MJDashboardUserStateEntity, MJDashboardEntity, MJDataContextItemEntity, MJDataContextEntity, MJDatasetItemEntity, MJDatasetEntity, MJDuplicateRunDetailMatchEntity, MJDuplicateRunDetailEntity, MJDuplicateRunEntity, MJEmployeeCompanyIntegrationEntity, MJEmployeeRoleEntity, MJEmployeeSkillEntity, MJEmployeeEntity, MJEncryptionAlgorithmEntity, MJEncryptionKeySourceEntity, MJEncryptionKeyEntity, MJEntityEntity, MJEntityActionFilterEntity, MJEntityActionInvocationTypeEntity, MJEntityActionInvocationEntity, MJEntityActionParamEntity, MJEntityActionEntity, MJEntityAIActionEntity, MJEntityCommunicationFieldEntity, MJEntityCommunicationMessageTypeEntity, MJEntityDocumentRunEntity, MJEntityDocumentSettingEntity, MJEntityDocumentTypeEntity, MJEntityDocumentEntity, MJEntityFieldValueEntity, MJEntityFieldEntity, MJEntityOrganicKeyRelatedEntityEntity, MJEntityOrganicKeyEntity, MJEntityPermissionEntity, MJEntityRecordDocumentEntity, MJEntityRelationshipDisplayComponentEntity, MJEntityRelationshipEntity, MJEntitySettingEntity, MJEnvironmentEntity, MJErrorLogEntity, MJExplorerNavigationItemEntity, MJFileCategoryEntity, MJFileEntityRecordLinkEntity, MJFileStorageAccountPermissionEntity, MJFileStorageAccountEntity, MJFileStorageProviderEntity, MJFileEntity, MJGeneratedCodeCategoryEntity, MJGeneratedCodeEntity, MJInstanceConfigurationEntity, MJIntegrationObjectFieldEntity, MJIntegrationObjectEntity, MJIntegrationSourceTypeEntity, MJIntegrationURLFormatEntity, MJIntegrationEntity, MJKnowledgeHubSavedSearchEntity, MJLibraryEntity, MJLibraryItemEntity, MJListCategoryEntity, MJListDetailEntity, MJListInvitationEntity, MJListShareEntity, MJListEntity, MJMCPServerConnectionPermissionEntity, MJMCPServerConnectionToolEntity, MJMCPServerConnectionEntity, MJMCPServerToolEntity, MJMCPServerEntity, MJMCPToolExecutionLogEntity, MJOAuthAuthServerMetadataCacheEntity, MJOAuthAuthorizationStateEntity, MJOAuthClientRegistrationEntity, MJOAuthTokenEntity, MJOpenAppDependencyEntity, MJOpenAppInstallHistoryEntity, MJOpenAppEntity, MJOutputDeliveryTypeEntity, MJOutputFormatTypeEntity, MJOutputTriggerTypeEntity, MJProjectEntity, MJPublicLinkEntity, MJQueryEntity, MJQueryCategoryEntity, MJQueryDependencyEntity, MJQueryEntityEntity, MJQueryFieldEntity, MJQueryParameterEntity, MJQueryPermissionEntity, MJQuerySQLEntity, MJQueueTaskEntity, MJQueueTypeEntity, MJQueueEntity, MJRecommendationItemEntity, MJRecommendationProviderEntity, MJRecommendationRunEntity, MJRecommendationEntity, MJRecordChangeReplayRunEntity, MJRecordChangeEntity, MJRecordGeoCodeEntity, MJRecordLinkEntity, MJRecordMergeDeletionLogEntity, MJRecordMergeLogEntity, MJReportCategoryEntity, MJReportSnapshotEntity, MJReportUserStateEntity, MJReportVersionEntity, MJReportEntity, MJResourceLinkEntity, MJResourcePermissionEntity, MJResourceTypeEntity, MJRoleEntity, MJRowLevelSecurityFilterEntity, MJScheduledActionParamEntity, MJScheduledActionEntity, MJScheduledJobRunEntity, MJScheduledJobTypeEntity, MJScheduledJobEntity, MJSchemaInfoEntity, MJSearchProviderEntity, MJSkillEntity, MJSQLDialectEntity, MJStateProvinceEntity, MJTagAuditLogEntity, MJTagCoOccurrenceEntity, MJTaggedItemEntity, MJTagEntity, MJTaskDependencyEntity, MJTaskTypeEntity, MJTaskEntity, MJTemplateCategoryEntity, MJTemplateContentTypeEntity, MJTemplateContentEntity, MJTemplateParamEntity, MJTemplateEntity, MJTestRubricEntity, MJTestRunFeedbackEntity, MJTestRunOutputTypeEntity, MJTestRunOutputEntity, MJTestRunEntity, MJTestSuiteRunEntity, MJTestSuiteTestEntity, MJTestSuiteEntity, MJTestTypeEntity, MJTestEntity, MJUserApplicationEntityEntity, MJUserApplicationEntity, MJUserFavoriteEntity, MJUserNotificationPreferenceEntity, MJUserNotificationTypeEntity, MJUserNotificationEntity, MJUserRecordLogEntity, MJUserRoleEntity, MJUserSettingEntity, MJUserViewCategoryEntity, MJUserViewRunDetailEntity, MJUserViewRunEntity, MJUserViewEntity, MJUserEntity, MJVectorDatabaseEntity, MJVectorIndexEntity, MJVersionInstallationEntity, MJVersionLabelItemEntity, MJVersionLabelRestoreEntity, MJVersionLabelEntity, MJWorkflowEngineEntity, MJWorkflowRunEntity, MJWorkflowEntity, MJWorkspaceItemEntity, MJWorkspaceEntity } from '@memberjunction/core-entities';
21
+ import { MJAccessControlRuleEntity, MJActionAuthorizationEntity, MJActionCategoryEntity, MJActionContextTypeEntity, MJActionContextEntity, MJActionExecutionLogEntity, MJActionFilterEntity, MJActionLibraryEntity, MJActionParamEntity, MJActionResultCodeEntity, MJActionEntity, MJAIActionEntity, MJAIAgentActionEntity, MJAIAgentArtifactTypeEntity, MJAIAgentCategoryEntity, MJAIAgentClientToolEntity, MJAIAgentConfigurationEntity, MJAIAgentDataSourceEntity, MJAIAgentExampleEntity, MJAIAgentLearningCycleEntity, MJAIAgentModalityEntity, MJAIAgentModelEntity, MJAIAgentNoteTypeEntity, MJAIAgentNoteEntity, MJAIAgentPermissionEntity, MJAIAgentPromptEntity, MJAIAgentRelationshipEntity, MJAIAgentRequestTypeEntity, MJAIAgentRequestEntity, MJAIAgentRunMediaEntity, MJAIAgentRunStepEntity, MJAIAgentRunEntity, MJAIAgentStepPathEntity, MJAIAgentStepEntity, MJAIAgentTypeEntity, MJAIAgentEntity, MJAIArchitectureEntity, MJAIClientToolDefinitionEntity, MJAIConfigurationParamEntity, MJAIConfigurationEntity, MJAICredentialBindingEntity, MJAIModalityEntity, MJAIModelActionEntity, MJAIModelArchitectureEntity, MJAIModelCostEntity, MJAIModelModalityEntity, MJAIModelPriceTypeEntity, MJAIModelPriceUnitTypeEntity, MJAIModelTypeEntity, MJAIModelVendorEntity, MJAIModelEntity, MJAIPromptCategoryEntity, MJAIPromptModelEntity, MJAIPromptRunMediaEntity, MJAIPromptRunEntity, MJAIPromptTypeEntity, MJAIPromptEntity, MJAIResultCacheEntity, MJAIVendorTypeDefinitionEntity, MJAIVendorTypeEntity, MJAIVendorEntity, MJAPIApplicationScopeEntity, MJAPIApplicationEntity, MJAPIKeyApplicationEntity, MJAPIKeyScopeEntity, MJAPIKeyUsageLogEntity, MJAPIKeyEntity, MJAPIScopeEntity, MJApplicationEntityEntity, MJApplicationRoleEntity, MJApplicationSettingEntity, MJApplicationEntity, MJArchiveConfigurationEntityEntity, MJArchiveConfigurationEntity, MJArchiveRunDetailEntity, MJArchiveRunEntity, MJArtifactPermissionEntity, MJArtifactTypeEntity, MJArtifactUseEntity, MJArtifactVersionAttributeEntity, MJArtifactVersionEntity, MJArtifactEntity, MJAuditLogTypeEntity, MJAuditLogEntity, MJAuthorizationRoleEntity, MJAuthorizationEntity, MJCollectionArtifactEntity, MJCollectionPermissionEntity, MJCollectionEntity, MJCommunicationBaseMessageTypeEntity, MJCommunicationLogEntity, MJCommunicationProviderMessageTypeEntity, MJCommunicationProviderEntity, MJCommunicationRunEntity, MJCompanyEntity, MJCompanyIntegrationEntityMapEntity, MJCompanyIntegrationFieldMapEntity, MJCompanyIntegrationRecordMapEntity, MJCompanyIntegrationRunAPILogEntity, MJCompanyIntegrationRunDetailEntity, MJCompanyIntegrationRunEntity, MJCompanyIntegrationSyncWatermarkEntity, MJCompanyIntegrationEntity, MJComponentDependencyEntity, MJComponentLibraryEntity, MJComponentLibraryLinkEntity, MJComponentRegistryEntity, MJComponentEntity, MJContentFileTypeEntity, MJContentItemAttributeEntity, MJContentItemDuplicateEntity, MJContentItemTagEntity, MJContentItemEntity, MJContentProcessRunDetailEntity, MJContentProcessRunPromptRunEntity, MJContentProcessRunEntity, MJContentSourceParamEntity, MJContentSourceTypeParamEntity, MJContentSourceTypeEntity, MJContentSourceEntity, MJContentTypeAttributeEntity, MJContentTypeEntity, MJConversationArtifactPermissionEntity, MJConversationArtifactVersionEntity, MJConversationArtifactEntity, MJConversationDetailArtifactEntity, MJConversationDetailAttachmentEntity, MJConversationDetailRatingEntity, MJConversationDetailEntity, MJConversationEntity, MJCountryEntity, MJCredentialCategoryEntity, MJCredentialTypeEntity, MJCredentialEntity, MJDashboardCategoryEntity, MJDashboardCategoryLinkEntity, MJDashboardCategoryPermissionEntity, MJDashboardPartTypeEntity, MJDashboardPermissionEntity, MJDashboardUserPreferenceEntity, MJDashboardUserStateEntity, MJDashboardEntity, MJDataContextItemEntity, MJDataContextEntity, MJDatasetItemEntity, MJDatasetEntity, MJDuplicateRunDetailMatchEntity, MJDuplicateRunDetailEntity, MJDuplicateRunEntity, MJEmployeeCompanyIntegrationEntity, MJEmployeeRoleEntity, MJEmployeeSkillEntity, MJEmployeeEntity, MJEncryptionAlgorithmEntity, MJEncryptionKeySourceEntity, MJEncryptionKeyEntity, MJEntityEntity, MJEntityActionFilterEntity, MJEntityActionInvocationTypeEntity, MJEntityActionInvocationEntity, MJEntityActionParamEntity, MJEntityActionEntity, MJEntityAIActionEntity, MJEntityCommunicationFieldEntity, MJEntityCommunicationMessageTypeEntity, MJEntityDocumentRunEntity, MJEntityDocumentSettingEntity, MJEntityDocumentTypeEntity, MJEntityDocumentEntity, MJEntityFieldValueEntity, MJEntityFieldEntity, MJEntityOrganicKeyRelatedEntityEntity, MJEntityOrganicKeyEntity, MJEntityPermissionEntity, MJEntityRecordDocumentEntity, MJEntityRelationshipDisplayComponentEntity, MJEntityRelationshipEntity, MJEntitySettingEntity, MJEnvironmentEntity, MJErrorLogEntity, MJExplorerNavigationItemEntity, MJFileCategoryEntity, MJFileEntityRecordLinkEntity, MJFileStorageAccountPermissionEntity, MJFileStorageAccountEntity, MJFileStorageProviderEntity, MJFileEntity, MJGeneratedCodeCategoryEntity, MJGeneratedCodeEntity, MJInstanceConfigurationEntity, MJIntegrationObjectFieldEntity, MJIntegrationObjectEntity, MJIntegrationSourceTypeEntity, MJIntegrationURLFormatEntity, MJIntegrationEntity, MJKnowledgeHubSavedSearchEntity, MJLibraryEntity, MJLibraryItemEntity, MJListCategoryEntity, MJListDetailEntity, MJListInvitationEntity, MJListShareEntity, MJListEntity, MJMCPServerConnectionPermissionEntity, MJMCPServerConnectionToolEntity, MJMCPServerConnectionEntity, MJMCPServerToolEntity, MJMCPServerEntity, MJMCPToolExecutionLogEntity, MJMCPToolFavoriteEntity, MJOAuthAuthServerMetadataCacheEntity, MJOAuthAuthorizationStateEntity, MJOAuthClientRegistrationEntity, MJOAuthTokenEntity, MJOpenAppDependencyEntity, MJOpenAppInstallHistoryEntity, MJOpenAppEntity, MJOutputDeliveryTypeEntity, MJOutputFormatTypeEntity, MJOutputTriggerTypeEntity, MJPermissionDomainEntity, MJProjectEntity, MJPublicLinkEntity, MJQueryEntity, MJQueryCategoryEntity, MJQueryDependencyEntity, MJQueryEntityEntity, MJQueryFieldEntity, MJQueryParameterEntity, MJQueryPermissionEntity, MJQuerySQLEntity, MJQueueTaskEntity, MJQueueTypeEntity, MJQueueEntity, MJRecommendationItemEntity, MJRecommendationProviderEntity, MJRecommendationRunEntity, MJRecommendationEntity, MJRecordChangeReplayRunEntity, MJRecordChangeEntity, MJRecordGeoCodeEntity, MJRecordLinkEntity, MJRecordMergeDeletionLogEntity, MJRecordMergeLogEntity, MJReportCategoryEntity, MJReportSnapshotEntity, MJReportUserStateEntity, MJReportVersionEntity, MJReportEntity, MJResourceLinkEntity, MJResourcePermissionEntity, MJResourceTypeEntity, MJRoleEntity, MJRowLevelSecurityFilterEntity, MJScheduledActionParamEntity, MJScheduledActionEntity, MJScheduledJobRunEntity, MJScheduledJobTypeEntity, MJScheduledJobEntity, MJSchemaInfoEntity, MJSearchProviderEntity, MJSkillEntity, MJSQLDialectEntity, MJStateProvinceEntity, MJTagAuditLogEntity, MJTagCoOccurrenceEntity, MJTaggedItemEntity, MJTagEntity, MJTaskDependencyEntity, MJTaskTypeEntity, MJTaskEntity, MJTemplateCategoryEntity, MJTemplateContentTypeEntity, MJTemplateContentEntity, MJTemplateParamEntity, MJTemplateEntity, MJTestRubricEntity, MJTestRunFeedbackEntity, MJTestRunOutputTypeEntity, MJTestRunOutputEntity, MJTestRunEntity, MJTestSuiteRunEntity, MJTestSuiteTestEntity, MJTestSuiteEntity, MJTestTypeEntity, MJTestEntity, MJUserApplicationEntityEntity, MJUserApplicationEntity, MJUserFavoriteEntity, MJUserNotificationPreferenceEntity, MJUserNotificationTypeEntity, MJUserNotificationEntity, MJUserRecordLogEntity, MJUserRoleEntity, MJUserSettingEntity, MJUserViewCategoryEntity, MJUserViewRunDetailEntity, MJUserViewRunEntity, MJUserViewEntity, MJUserEntity, MJVectorDatabaseEntity, MJVectorIndexEntity, MJVersionInstallationEntity, MJVersionLabelItemEntity, MJVersionLabelRestoreEntity, MJVersionLabelEntity, MJWorkflowEngineEntity, MJWorkflowRunEntity, MJWorkflowEntity, MJWorkspaceItemEntity, MJWorkspaceEntity } from '@memberjunction/core-entities';
22
22
 
23
23
 
24
24
  //****************************************************************************
@@ -2051,6 +2051,16 @@ export class MJAction_ {
2051
2051
  @Field({nullable: true, description: `Optional JSON configuration for the action. For integration actions, contains routing info: integrationName, objectName, verb, and optional connectorConfig. Non-integration actions leave this NULL.`})
2052
2052
  Config?: string;
2053
2053
 
2054
+ @Field({nullable: true, description: `JSON blob holding configuration specific to Type='Runtime' actions: declarative permission scopes (allowedEntities, allowedActions, allowedAgents with id+name pairs), resource limits (maxMemoryMB, maxBridgeCalls), and sandbox options (additionalLibraries, debugMode). Evolvable — new keys can be introduced without schema changes. NULL for non-Runtime actions.`})
2055
+ RuntimeActionConfiguration?: string;
2056
+
2057
+ @Field(() => Int, {nullable: true, description: `Universal maximum execution time in milliseconds for a single action invocation. Enforced by ActionEngine across ALL action types (Custom, Generated, Runtime) via AbortSignal passed through RunActionParams. NULL means use the engine default.`})
2058
+ MaxExecutionTimeMS?: number;
2059
+
2060
+ @Field({nullable: true, description: `Optional reference to the AI Agent that authored this action — populated when an agent (e.g. ActionSmith) dynamically generates a Runtime action. NULL for human-authored Custom/Generated actions. Provides an audit trail linking agent-generated capabilities back to their creator.`})
2061
+ @MaxLength(36)
2062
+ CreatedByAgentID?: string;
2063
+
2054
2064
  @Field({nullable: true})
2055
2065
  @MaxLength(255)
2056
2066
  Category?: string;
@@ -2067,6 +2077,10 @@ export class MJAction_ {
2067
2077
  @MaxLength(255)
2068
2078
  DefaultCompactPrompt?: string;
2069
2079
 
2080
+ @Field({nullable: true})
2081
+ @MaxLength(255)
2082
+ CreatedByAgent?: string;
2083
+
2070
2084
  @Field({nullable: true})
2071
2085
  @MaxLength(36)
2072
2086
  RootParentID?: string;
@@ -2180,6 +2194,15 @@ export class CreateMJActionInput {
2180
2194
  @Field({ nullable: true })
2181
2195
  Config: string | null;
2182
2196
 
2197
+ @Field({ nullable: true })
2198
+ RuntimeActionConfiguration: string | null;
2199
+
2200
+ @Field(() => Int, { nullable: true })
2201
+ MaxExecutionTimeMS: number | null;
2202
+
2203
+ @Field({ nullable: true })
2204
+ CreatedByAgentID: string | null;
2205
+
2183
2206
  @Field(() => RestoreContextInput, { nullable: true })
2184
2207
  RestoreContext___?: RestoreContextInput;
2185
2208
  }
@@ -2256,6 +2279,15 @@ export class UpdateMJActionInput {
2256
2279
  @Field({ nullable: true })
2257
2280
  Config?: string | null;
2258
2281
 
2282
+ @Field({ nullable: true })
2283
+ RuntimeActionConfiguration?: string | null;
2284
+
2285
+ @Field(() => Int, { nullable: true })
2286
+ MaxExecutionTimeMS?: number | null;
2287
+
2288
+ @Field({ nullable: true })
2289
+ CreatedByAgentID?: string | null;
2290
+
2259
2291
  @Field(() => [KeyValuePairInput], { nullable: true })
2260
2292
  OldValues___?: KeyValuePairInput[];
2261
2293
 
@@ -5218,6 +5250,23 @@ export class MJAIAgentNote_ {
5218
5250
  @Field({nullable: true, description: `Optional expiration timestamp. Notes past this date are candidates for archival. NULL means no expiration.`})
5219
5251
  ExpiresAt?: Date;
5220
5252
 
5253
+ @Field({nullable: true, description: `Self-referential FK. Points to the consolidated note that replaced this one when revoked during consolidation or contradiction resolution.`})
5254
+ @MaxLength(36)
5255
+ ConsolidatedIntoNoteID?: string;
5256
+
5257
+ @Field(() => Int, {description: `Tracks re-summarization depth. 0=raw extraction, 1=first consolidation, etc. Capped at 3 to prevent semantic drift.`})
5258
+ ConsolidationCount: number;
5259
+
5260
+ @Field({nullable: true, description: `JSON array of source note IDs that were consolidated into this note. Enables provenance chain resolution and rollback.`})
5261
+ DerivedFromNoteIDs?: string;
5262
+
5263
+ @Field({description: `Protection level: Immutable (never consolidated/archived), Protected (no consolidation, extended 365-day retention), Standard (default), Ephemeral (aggressive consolidation, 2x decay rate).`})
5264
+ @MaxLength(20)
5265
+ ProtectionTier: string;
5266
+
5267
+ @Field(() => Float, {nullable: true, description: `Composite importance score (0-10) computed from 7 signals: recency, LLM-importance, relevance, uniqueness, correction boost, goal alignment, user mark. Replaces raw AccessCount for authority and retention decisions.`})
5268
+ ImportanceScore?: number;
5269
+
5221
5270
  @Field({nullable: true})
5222
5271
  @MaxLength(255)
5223
5272
  Agent?: string;
@@ -5253,6 +5302,16 @@ export class MJAIAgentNote_ {
5253
5302
  @MaxLength(255)
5254
5303
  PrimaryScopeEntity?: string;
5255
5304
 
5305
+ @Field({nullable: true})
5306
+ ConsolidatedIntoNote?: string;
5307
+
5308
+ @Field({nullable: true})
5309
+ @MaxLength(36)
5310
+ RootConsolidatedIntoNoteID?: string;
5311
+
5312
+ @Field(() => [MJAIAgentNote_])
5313
+ MJAIAgentNotes_ConsolidatedIntoNoteIDArray: MJAIAgentNote_[]; // Link to MJAIAgentNotes
5314
+
5256
5315
  }
5257
5316
 
5258
5317
  //****************************************************************************
@@ -5323,6 +5382,21 @@ export class CreateMJAIAgentNoteInput {
5323
5382
  @Field({ nullable: true })
5324
5383
  ExpiresAt: Date | null;
5325
5384
 
5385
+ @Field({ nullable: true })
5386
+ ConsolidatedIntoNoteID: string | null;
5387
+
5388
+ @Field(() => Int, { nullable: true })
5389
+ ConsolidationCount?: number;
5390
+
5391
+ @Field({ nullable: true })
5392
+ DerivedFromNoteIDs: string | null;
5393
+
5394
+ @Field({ nullable: true })
5395
+ ProtectionTier?: string;
5396
+
5397
+ @Field(() => Float, { nullable: true })
5398
+ ImportanceScore: number | null;
5399
+
5326
5400
  @Field(() => RestoreContextInput, { nullable: true })
5327
5401
  RestoreContext___?: RestoreContextInput;
5328
5402
  }
@@ -5396,6 +5470,21 @@ export class UpdateMJAIAgentNoteInput {
5396
5470
  @Field({ nullable: true })
5397
5471
  ExpiresAt?: Date | null;
5398
5472
 
5473
+ @Field({ nullable: true })
5474
+ ConsolidatedIntoNoteID?: string | null;
5475
+
5476
+ @Field(() => Int, { nullable: true })
5477
+ ConsolidationCount?: number;
5478
+
5479
+ @Field({ nullable: true })
5480
+ DerivedFromNoteIDs?: string | null;
5481
+
5482
+ @Field({ nullable: true })
5483
+ ProtectionTier?: string;
5484
+
5485
+ @Field(() => Float, { nullable: true })
5486
+ ImportanceScore?: number | null;
5487
+
5399
5488
  @Field(() => [KeyValuePairInput], { nullable: true })
5400
5489
  OldValues___?: KeyValuePairInput[];
5401
5490
 
@@ -5460,6 +5549,16 @@ export class MJAIAgentNoteResolver extends ResolverBase {
5460
5549
  return result;
5461
5550
  }
5462
5551
 
5552
+ @FieldResolver(() => [MJAIAgentNote_])
5553
+ async MJAIAgentNotes_ConsolidatedIntoNoteIDArray(@Root() mjaiagentnote_: MJAIAgentNote_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
5554
+ this.CheckUserReadPermissions('MJ: AI Agent Notes', userPayload);
5555
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5556
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentNotes')} WHERE ${provider.QuoteIdentifier('ConsolidatedIntoNoteID')}='${mjaiagentnote_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Notes', userPayload, EntityPermissionType.Read, 'AND');
5557
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
5558
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Notes', rows, this.GetUserFromPayload(userPayload));
5559
+ return result;
5560
+ }
5561
+
5463
5562
  @Mutation(() => MJAIAgentNote_)
5464
5563
  async CreateMJAIAgentNote(
5465
5564
  @Arg('input', () => CreateMJAIAgentNoteInput) input: CreateMJAIAgentNoteInput,
@@ -7490,6 +7589,10 @@ each time the agent processes a prompt step.`})
7490
7589
  @MaxLength(200)
7491
7590
  ExternalReferenceID?: string;
7492
7591
 
7592
+ @Field({nullable: true, description: `Optional company scope for multi-tenant memory. When populated, Memory Manager uses this to scope extracted notes to the company. Flows from ExecuteAgentParams.companyId at agent invocation time.`})
7593
+ @MaxLength(36)
7594
+ CompanyID?: string;
7595
+
7493
7596
  @Field({nullable: true})
7494
7597
  @MaxLength(255)
7495
7598
  Agent?: string;
@@ -7708,6 +7811,9 @@ export class CreateMJAIAgentRunInput {
7708
7811
  @Field({ nullable: true })
7709
7812
  ExternalReferenceID: string | null;
7710
7813
 
7814
+ @Field({ nullable: true })
7815
+ CompanyID: string | null;
7816
+
7711
7817
  @Field(() => RestoreContextInput, { nullable: true })
7712
7818
  RestoreContext___?: RestoreContextInput;
7713
7819
  }
@@ -7847,6 +7953,9 @@ export class UpdateMJAIAgentRunInput {
7847
7953
  @Field({ nullable: true })
7848
7954
  ExternalReferenceID?: string | null;
7849
7955
 
7956
+ @Field({ nullable: true })
7957
+ CompanyID?: string | null;
7958
+
7850
7959
  @Field(() => [KeyValuePairInput], { nullable: true })
7851
7960
  OldValues___?: KeyValuePairInput[];
7852
7961
 
@@ -9189,6 +9298,9 @@ if this limit is exceeded.`})
9189
9298
  @Field(() => [MJAIAgent_])
9190
9299
  MJAIAgents_ParentIDArray: MJAIAgent_[]; // Link to MJAIAgents
9191
9300
 
9301
+ @Field(() => [MJAction_])
9302
+ MJActions_CreatedByAgentIDArray: MJAction_[]; // Link to MJActions
9303
+
9192
9304
  }
9193
9305
 
9194
9306
  //****************************************************************************
@@ -9872,6 +9984,16 @@ export class MJAIAgentResolver extends ResolverBase {
9872
9984
  return result;
9873
9985
  }
9874
9986
 
9987
+ @FieldResolver(() => [MJAction_])
9988
+ async MJActions_CreatedByAgentIDArray(@Root() mjaiagent_: MJAIAgent_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
9989
+ this.CheckUserReadPermissions('MJ: Actions', userPayload);
9990
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
9991
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwActions')} WHERE ${provider.QuoteIdentifier('CreatedByAgentID')}='${mjaiagent_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Actions', userPayload, EntityPermissionType.Read, 'AND');
9992
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
9993
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Actions', rows, this.GetUserFromPayload(userPayload));
9994
+ return result;
9995
+ }
9996
+
9875
9997
  @Mutation(() => MJAIAgent_)
9876
9998
  async CreateMJAIAgent(
9877
9999
  @Arg('input', () => CreateMJAIAgentInput) input: CreateMJAIAgentInput,
@@ -19822,6 +19944,1065 @@ export class MJApplicationResolver extends ResolverBase {
19822
19944
 
19823
19945
  }
19824
19946
 
19947
+ //****************************************************************************
19948
+ // ENTITY CLASS for MJ: Archive Configuration Entities
19949
+ //****************************************************************************
19950
+ @ObjectType({ description: `Per-entity configuration within an archive pipeline. Allows overriding the parent configuration\'s defaults for mode, retention, batch size, and filtering on a per-entity basis.` })
19951
+ export class MJArchiveConfigurationEntity_ {
19952
+ @Field()
19953
+ @MaxLength(36)
19954
+ ID: string;
19955
+
19956
+ @Field({description: `Foreign key to the parent ArchiveConfiguration.`})
19957
+ @MaxLength(36)
19958
+ ArchiveConfigurationID: string;
19959
+
19960
+ @Field({description: `Foreign key to the Entity being archived.`})
19961
+ @MaxLength(36)
19962
+ EntityID: string;
19963
+
19964
+ @Field({nullable: true, description: `Archive mode override for this entity. NULL inherits from the parent configuration's DefaultMode.`})
19965
+ @MaxLength(20)
19966
+ Mode?: string;
19967
+
19968
+ @Field(() => Int, {nullable: true, description: `Retention period override in days. NULL inherits from the parent configuration's DefaultRetentionDays.`})
19969
+ RetentionDays?: number;
19970
+
19971
+ @Field({description: `The date field on the entity used to determine record age for retention policy evaluation. Defaults to __mj_CreatedAt.`})
19972
+ @MaxLength(100)
19973
+ DateField: string;
19974
+
19975
+ @Field({nullable: true, description: `Optional SQL WHERE clause fragment to further filter which records are eligible for archiving (e.g., "Status = 'Closed'").`})
19976
+ FilterExpression?: string;
19977
+
19978
+ @Field(() => Int, {nullable: true, description: `Batch size override for this entity. NULL inherits from the parent configuration's DefaultBatchSize.`})
19979
+ BatchSize?: number;
19980
+
19981
+ @Field(() => Int, {description: `Processing priority — lower numbers are archived first. Default is 100.`})
19982
+ Priority: number;
19983
+
19984
+ @Field({description: `JSON configuration specifying which fields to include/exclude in the archive output. Required for all modes.`})
19985
+ FieldConfiguration: string;
19986
+
19987
+ @Field({nullable: true, description: `Optional fully-qualified class name of a custom archive driver to use for this entity, overriding the default archiver.`})
19988
+ @MaxLength(500)
19989
+ DriverClass?: string;
19990
+
19991
+ @Field(() => Boolean, {nullable: true, description: `Override for archiving related Record Changes. NULL inherits from the parent configuration.`})
19992
+ ArchiveRelatedRecordChanges?: boolean;
19993
+
19994
+ @Field(() => Boolean, {description: `Whether this entity is active within the archive configuration.`})
19995
+ IsActive: boolean;
19996
+
19997
+ @Field()
19998
+ _mj__CreatedAt: Date;
19999
+
20000
+ @Field()
20001
+ _mj__UpdatedAt: Date;
20002
+
20003
+ @Field()
20004
+ @MaxLength(255)
20005
+ ArchiveConfiguration: string;
20006
+
20007
+ @Field()
20008
+ @MaxLength(255)
20009
+ Entity: string;
20010
+
20011
+ }
20012
+
20013
+ //****************************************************************************
20014
+ // INPUT TYPE for MJ: Archive Configuration Entities
20015
+ //****************************************************************************
20016
+ @InputType()
20017
+ export class CreateMJArchiveConfigurationEntityInput {
20018
+ @Field({ nullable: true })
20019
+ ID?: string;
20020
+
20021
+ @Field({ nullable: true })
20022
+ ArchiveConfigurationID?: string;
20023
+
20024
+ @Field({ nullable: true })
20025
+ EntityID?: string;
20026
+
20027
+ @Field({ nullable: true })
20028
+ Mode: string | null;
20029
+
20030
+ @Field(() => Int, { nullable: true })
20031
+ RetentionDays: number | null;
20032
+
20033
+ @Field({ nullable: true })
20034
+ DateField?: string;
20035
+
20036
+ @Field({ nullable: true })
20037
+ FilterExpression: string | null;
20038
+
20039
+ @Field(() => Int, { nullable: true })
20040
+ BatchSize: number | null;
20041
+
20042
+ @Field(() => Int, { nullable: true })
20043
+ Priority?: number;
20044
+
20045
+ @Field({ nullable: true })
20046
+ FieldConfiguration?: string;
20047
+
20048
+ @Field({ nullable: true })
20049
+ DriverClass: string | null;
20050
+
20051
+ @Field(() => Boolean, { nullable: true })
20052
+ ArchiveRelatedRecordChanges: boolean | null;
20053
+
20054
+ @Field(() => Boolean, { nullable: true })
20055
+ IsActive?: boolean;
20056
+
20057
+ @Field(() => RestoreContextInput, { nullable: true })
20058
+ RestoreContext___?: RestoreContextInput;
20059
+ }
20060
+
20061
+
20062
+ //****************************************************************************
20063
+ // INPUT TYPE for MJ: Archive Configuration Entities
20064
+ //****************************************************************************
20065
+ @InputType()
20066
+ export class UpdateMJArchiveConfigurationEntityInput {
20067
+ @Field()
20068
+ ID: string;
20069
+
20070
+ @Field({ nullable: true })
20071
+ ArchiveConfigurationID?: string;
20072
+
20073
+ @Field({ nullable: true })
20074
+ EntityID?: string;
20075
+
20076
+ @Field({ nullable: true })
20077
+ Mode?: string | null;
20078
+
20079
+ @Field(() => Int, { nullable: true })
20080
+ RetentionDays?: number | null;
20081
+
20082
+ @Field({ nullable: true })
20083
+ DateField?: string;
20084
+
20085
+ @Field({ nullable: true })
20086
+ FilterExpression?: string | null;
20087
+
20088
+ @Field(() => Int, { nullable: true })
20089
+ BatchSize?: number | null;
20090
+
20091
+ @Field(() => Int, { nullable: true })
20092
+ Priority?: number;
20093
+
20094
+ @Field({ nullable: true })
20095
+ FieldConfiguration?: string;
20096
+
20097
+ @Field({ nullable: true })
20098
+ DriverClass?: string | null;
20099
+
20100
+ @Field(() => Boolean, { nullable: true })
20101
+ ArchiveRelatedRecordChanges?: boolean | null;
20102
+
20103
+ @Field(() => Boolean, { nullable: true })
20104
+ IsActive?: boolean;
20105
+
20106
+ @Field(() => [KeyValuePairInput], { nullable: true })
20107
+ OldValues___?: KeyValuePairInput[];
20108
+
20109
+ @Field(() => RestoreContextInput, { nullable: true })
20110
+ RestoreContext___?: RestoreContextInput;
20111
+ }
20112
+
20113
+ //****************************************************************************
20114
+ // RESOLVER for MJ: Archive Configuration Entities
20115
+ //****************************************************************************
20116
+ @ObjectType()
20117
+ export class RunMJArchiveConfigurationEntityViewResult {
20118
+ @Field(() => [MJArchiveConfigurationEntity_])
20119
+ Results: MJArchiveConfigurationEntity_[];
20120
+
20121
+ @Field(() => String, {nullable: true})
20122
+ UserViewRunID?: string;
20123
+
20124
+ @Field(() => Int, {nullable: true})
20125
+ RowCount: number;
20126
+
20127
+ @Field(() => Int, {nullable: true})
20128
+ TotalRowCount: number;
20129
+
20130
+ @Field(() => Int, {nullable: true})
20131
+ ExecutionTime: number;
20132
+
20133
+ @Field({nullable: true})
20134
+ ErrorMessage?: string;
20135
+
20136
+ @Field(() => Boolean, {nullable: false})
20137
+ Success: boolean;
20138
+ }
20139
+
20140
+ @Resolver(MJArchiveConfigurationEntity_)
20141
+ export class MJArchiveConfigurationEntityResolver extends ResolverBase {
20142
+ @Query(() => RunMJArchiveConfigurationEntityViewResult)
20143
+ async RunMJArchiveConfigurationEntityViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
20144
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20145
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
20146
+ }
20147
+
20148
+ @Query(() => RunMJArchiveConfigurationEntityViewResult)
20149
+ async RunMJArchiveConfigurationEntityViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
20150
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20151
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
20152
+ }
20153
+
20154
+ @Query(() => RunMJArchiveConfigurationEntityViewResult)
20155
+ async RunMJArchiveConfigurationEntityDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
20156
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20157
+ input.EntityName = 'MJ: Archive Configuration Entities';
20158
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
20159
+ }
20160
+ @Query(() => MJArchiveConfigurationEntity_, { nullable: true })
20161
+ async MJArchiveConfigurationEntity(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJArchiveConfigurationEntity_ | null> {
20162
+ this.CheckUserReadPermissions('MJ: Archive Configuration Entities', userPayload);
20163
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20164
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwArchiveConfigurationEntities')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Archive Configuration Entities', userPayload, EntityPermissionType.Read, 'AND');
20165
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
20166
+ const result = await this.MapFieldNamesToCodeNames('MJ: Archive Configuration Entities', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
20167
+ return result;
20168
+ }
20169
+
20170
+ @Query(() => [MJArchiveConfigurationEntity_])
20171
+ async AllMJArchiveConfigurationEntities(@Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
20172
+ this.CheckUserReadPermissions('MJ: Archive Configuration Entities', userPayload);
20173
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20174
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwArchiveConfigurationEntities')}` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Archive Configuration Entities', userPayload, EntityPermissionType.Read, ' WHERE');
20175
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
20176
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Archive Configuration Entities', rows, this.GetUserFromPayload(userPayload));
20177
+ return result;
20178
+ }
20179
+
20180
+ @Mutation(() => MJArchiveConfigurationEntity_)
20181
+ async CreateMJArchiveConfigurationEntity(
20182
+ @Arg('input', () => CreateMJArchiveConfigurationEntityInput) input: CreateMJArchiveConfigurationEntityInput,
20183
+ @Ctx() { providers, userPayload }: AppContext,
20184
+ @PubSub() pubSub: PubSubEngine
20185
+ ) {
20186
+ const provider = GetReadWriteProvider(providers);
20187
+ return this.CreateRecord('MJ: Archive Configuration Entities', input, provider, userPayload, pubSub)
20188
+ }
20189
+
20190
+ @Mutation(() => MJArchiveConfigurationEntity_)
20191
+ async UpdateMJArchiveConfigurationEntity(
20192
+ @Arg('input', () => UpdateMJArchiveConfigurationEntityInput) input: UpdateMJArchiveConfigurationEntityInput,
20193
+ @Ctx() { providers, userPayload }: AppContext,
20194
+ @PubSub() pubSub: PubSubEngine
20195
+ ) {
20196
+ const provider = GetReadWriteProvider(providers);
20197
+ return this.UpdateRecord('MJ: Archive Configuration Entities', input, provider, userPayload, pubSub);
20198
+ }
20199
+
20200
+ @Mutation(() => MJArchiveConfigurationEntity_)
20201
+ async DeleteMJArchiveConfigurationEntity(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
20202
+ const provider = GetReadWriteProvider(providers);
20203
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
20204
+ return this.DeleteRecord('MJ: Archive Configuration Entities', key, options, provider, userPayload, pubSub);
20205
+ }
20206
+
20207
+ }
20208
+
20209
+ //****************************************************************************
20210
+ // ENTITY CLASS for MJ: Archive Configurations
20211
+ //****************************************************************************
20212
+ @ObjectType({ description: `Top-level configuration for an archive pipeline. Defines the storage target, default retention policy, archive format, and operational mode for archiving entity records.` })
20213
+ export class MJArchiveConfiguration_ {
20214
+ @Field()
20215
+ @MaxLength(36)
20216
+ ID: string;
20217
+
20218
+ @Field({description: `Human-readable name for this archive configuration.`})
20219
+ @MaxLength(255)
20220
+ Name: string;
20221
+
20222
+ @Field({nullable: true})
20223
+ Description?: string;
20224
+
20225
+ @Field({nullable: true, description: `Foreign key to FileStorageAccount — the blob/file storage target for archived data.`})
20226
+ @MaxLength(36)
20227
+ StorageAccountID?: string;
20228
+
20229
+ @Field({description: `Root path within the storage account where archive files are written (e.g., "archives/production/").`})
20230
+ @MaxLength(500)
20231
+ RootPath: string;
20232
+
20233
+ @Field({description: `Output format for archived records: JSON, Parquet, or CSV.`})
20234
+ @MaxLength(20)
20235
+ ArchiveFormat: string;
20236
+
20237
+ @Field(() => Boolean, {description: `Whether this configuration is active and eligible for scheduled archive runs.`})
20238
+ IsActive: boolean;
20239
+
20240
+ @Field(() => Int, {description: `Default number of days after which records become eligible for archiving. Can be overridden per entity.`})
20241
+ DefaultRetentionDays: number;
20242
+
20243
+ @Field({description: `Default archive mode: StripFields (null out specified fields), HardDelete (delete from source after archiving), ArchiveOnly (copy to storage without modifying source).`})
20244
+ @MaxLength(20)
20245
+ DefaultMode: string;
20246
+
20247
+ @Field(() => Int, {description: `Default number of records to process per batch during archive runs.`})
20248
+ DefaultBatchSize: number;
20249
+
20250
+ @Field(() => Boolean, {description: `When enabled, related Record Changes entries are also archived alongside the source records.`})
20251
+ ArchiveRelatedRecordChanges: boolean;
20252
+
20253
+ @Field({description: `Current operational status of this configuration: Idle, Running, Error, or Disabled.`})
20254
+ @MaxLength(20)
20255
+ Status: string;
20256
+
20257
+ @Field({description: `The user who created this archive configuration.`})
20258
+ @MaxLength(36)
20259
+ CreatedByUserID: string;
20260
+
20261
+ @Field()
20262
+ _mj__CreatedAt: Date;
20263
+
20264
+ @Field()
20265
+ _mj__UpdatedAt: Date;
20266
+
20267
+ @Field({nullable: true})
20268
+ @MaxLength(200)
20269
+ StorageAccount?: string;
20270
+
20271
+ @Field()
20272
+ @MaxLength(100)
20273
+ CreatedByUser: string;
20274
+
20275
+ @Field(() => [MJArchiveConfigurationEntity_])
20276
+ MJArchiveConfigurationEntities_ArchiveConfigurationIDArray: MJArchiveConfigurationEntity_[]; // Link to MJArchiveConfigurationEntities
20277
+
20278
+ @Field(() => [MJArchiveRun_])
20279
+ MJArchiveRuns_ArchiveConfigurationIDArray: MJArchiveRun_[]; // Link to MJArchiveRuns
20280
+
20281
+ }
20282
+
20283
+ //****************************************************************************
20284
+ // INPUT TYPE for MJ: Archive Configurations
20285
+ //****************************************************************************
20286
+ @InputType()
20287
+ export class CreateMJArchiveConfigurationInput {
20288
+ @Field({ nullable: true })
20289
+ ID?: string;
20290
+
20291
+ @Field({ nullable: true })
20292
+ Name?: string;
20293
+
20294
+ @Field({ nullable: true })
20295
+ Description: string | null;
20296
+
20297
+ @Field({ nullable: true })
20298
+ StorageAccountID: string | null;
20299
+
20300
+ @Field({ nullable: true })
20301
+ RootPath?: string;
20302
+
20303
+ @Field({ nullable: true })
20304
+ ArchiveFormat?: string;
20305
+
20306
+ @Field(() => Boolean, { nullable: true })
20307
+ IsActive?: boolean;
20308
+
20309
+ @Field(() => Int, { nullable: true })
20310
+ DefaultRetentionDays?: number;
20311
+
20312
+ @Field({ nullable: true })
20313
+ DefaultMode?: string;
20314
+
20315
+ @Field(() => Int, { nullable: true })
20316
+ DefaultBatchSize?: number;
20317
+
20318
+ @Field(() => Boolean, { nullable: true })
20319
+ ArchiveRelatedRecordChanges?: boolean;
20320
+
20321
+ @Field({ nullable: true })
20322
+ Status?: string;
20323
+
20324
+ @Field({ nullable: true })
20325
+ CreatedByUserID?: string;
20326
+
20327
+ @Field(() => RestoreContextInput, { nullable: true })
20328
+ RestoreContext___?: RestoreContextInput;
20329
+ }
20330
+
20331
+
20332
+ //****************************************************************************
20333
+ // INPUT TYPE for MJ: Archive Configurations
20334
+ //****************************************************************************
20335
+ @InputType()
20336
+ export class UpdateMJArchiveConfigurationInput {
20337
+ @Field()
20338
+ ID: string;
20339
+
20340
+ @Field({ nullable: true })
20341
+ Name?: string;
20342
+
20343
+ @Field({ nullable: true })
20344
+ Description?: string | null;
20345
+
20346
+ @Field({ nullable: true })
20347
+ StorageAccountID?: string | null;
20348
+
20349
+ @Field({ nullable: true })
20350
+ RootPath?: string;
20351
+
20352
+ @Field({ nullable: true })
20353
+ ArchiveFormat?: string;
20354
+
20355
+ @Field(() => Boolean, { nullable: true })
20356
+ IsActive?: boolean;
20357
+
20358
+ @Field(() => Int, { nullable: true })
20359
+ DefaultRetentionDays?: number;
20360
+
20361
+ @Field({ nullable: true })
20362
+ DefaultMode?: string;
20363
+
20364
+ @Field(() => Int, { nullable: true })
20365
+ DefaultBatchSize?: number;
20366
+
20367
+ @Field(() => Boolean, { nullable: true })
20368
+ ArchiveRelatedRecordChanges?: boolean;
20369
+
20370
+ @Field({ nullable: true })
20371
+ Status?: string;
20372
+
20373
+ @Field({ nullable: true })
20374
+ CreatedByUserID?: string;
20375
+
20376
+ @Field(() => [KeyValuePairInput], { nullable: true })
20377
+ OldValues___?: KeyValuePairInput[];
20378
+
20379
+ @Field(() => RestoreContextInput, { nullable: true })
20380
+ RestoreContext___?: RestoreContextInput;
20381
+ }
20382
+
20383
+ //****************************************************************************
20384
+ // RESOLVER for MJ: Archive Configurations
20385
+ //****************************************************************************
20386
+ @ObjectType()
20387
+ export class RunMJArchiveConfigurationViewResult {
20388
+ @Field(() => [MJArchiveConfiguration_])
20389
+ Results: MJArchiveConfiguration_[];
20390
+
20391
+ @Field(() => String, {nullable: true})
20392
+ UserViewRunID?: string;
20393
+
20394
+ @Field(() => Int, {nullable: true})
20395
+ RowCount: number;
20396
+
20397
+ @Field(() => Int, {nullable: true})
20398
+ TotalRowCount: number;
20399
+
20400
+ @Field(() => Int, {nullable: true})
20401
+ ExecutionTime: number;
20402
+
20403
+ @Field({nullable: true})
20404
+ ErrorMessage?: string;
20405
+
20406
+ @Field(() => Boolean, {nullable: false})
20407
+ Success: boolean;
20408
+ }
20409
+
20410
+ @Resolver(MJArchiveConfiguration_)
20411
+ export class MJArchiveConfigurationResolver extends ResolverBase {
20412
+ @Query(() => RunMJArchiveConfigurationViewResult)
20413
+ async RunMJArchiveConfigurationViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
20414
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20415
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
20416
+ }
20417
+
20418
+ @Query(() => RunMJArchiveConfigurationViewResult)
20419
+ async RunMJArchiveConfigurationViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
20420
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20421
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
20422
+ }
20423
+
20424
+ @Query(() => RunMJArchiveConfigurationViewResult)
20425
+ async RunMJArchiveConfigurationDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
20426
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20427
+ input.EntityName = 'MJ: Archive Configurations';
20428
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
20429
+ }
20430
+ @Query(() => MJArchiveConfiguration_, { nullable: true })
20431
+ async MJArchiveConfiguration(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJArchiveConfiguration_ | null> {
20432
+ this.CheckUserReadPermissions('MJ: Archive Configurations', userPayload);
20433
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20434
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwArchiveConfigurations')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Archive Configurations', userPayload, EntityPermissionType.Read, 'AND');
20435
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
20436
+ const result = await this.MapFieldNamesToCodeNames('MJ: Archive Configurations', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
20437
+ return result;
20438
+ }
20439
+
20440
+ @Query(() => [MJArchiveConfiguration_])
20441
+ async AllMJArchiveConfigurations(@Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
20442
+ this.CheckUserReadPermissions('MJ: Archive Configurations', userPayload);
20443
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20444
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwArchiveConfigurations')}` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Archive Configurations', userPayload, EntityPermissionType.Read, ' WHERE');
20445
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
20446
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Archive Configurations', rows, this.GetUserFromPayload(userPayload));
20447
+ return result;
20448
+ }
20449
+
20450
+ @FieldResolver(() => [MJArchiveConfigurationEntity_])
20451
+ async MJArchiveConfigurationEntities_ArchiveConfigurationIDArray(@Root() mjarchiveconfiguration_: MJArchiveConfiguration_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
20452
+ this.CheckUserReadPermissions('MJ: Archive Configuration Entities', userPayload);
20453
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20454
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwArchiveConfigurationEntities')} WHERE ${provider.QuoteIdentifier('ArchiveConfigurationID')}='${mjarchiveconfiguration_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Archive Configuration Entities', userPayload, EntityPermissionType.Read, 'AND');
20455
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
20456
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Archive Configuration Entities', rows, this.GetUserFromPayload(userPayload));
20457
+ return result;
20458
+ }
20459
+
20460
+ @FieldResolver(() => [MJArchiveRun_])
20461
+ async MJArchiveRuns_ArchiveConfigurationIDArray(@Root() mjarchiveconfiguration_: MJArchiveConfiguration_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
20462
+ this.CheckUserReadPermissions('MJ: Archive Runs', userPayload);
20463
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20464
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwArchiveRuns')} WHERE ${provider.QuoteIdentifier('ArchiveConfigurationID')}='${mjarchiveconfiguration_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Archive Runs', userPayload, EntityPermissionType.Read, 'AND');
20465
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
20466
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Archive Runs', rows, this.GetUserFromPayload(userPayload));
20467
+ return result;
20468
+ }
20469
+
20470
+ @Mutation(() => MJArchiveConfiguration_)
20471
+ async CreateMJArchiveConfiguration(
20472
+ @Arg('input', () => CreateMJArchiveConfigurationInput) input: CreateMJArchiveConfigurationInput,
20473
+ @Ctx() { providers, userPayload }: AppContext,
20474
+ @PubSub() pubSub: PubSubEngine
20475
+ ) {
20476
+ const provider = GetReadWriteProvider(providers);
20477
+ return this.CreateRecord('MJ: Archive Configurations', input, provider, userPayload, pubSub)
20478
+ }
20479
+
20480
+ @Mutation(() => MJArchiveConfiguration_)
20481
+ async UpdateMJArchiveConfiguration(
20482
+ @Arg('input', () => UpdateMJArchiveConfigurationInput) input: UpdateMJArchiveConfigurationInput,
20483
+ @Ctx() { providers, userPayload }: AppContext,
20484
+ @PubSub() pubSub: PubSubEngine
20485
+ ) {
20486
+ const provider = GetReadWriteProvider(providers);
20487
+ return this.UpdateRecord('MJ: Archive Configurations', input, provider, userPayload, pubSub);
20488
+ }
20489
+
20490
+ @Mutation(() => MJArchiveConfiguration_)
20491
+ async DeleteMJArchiveConfiguration(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
20492
+ const provider = GetReadWriteProvider(providers);
20493
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
20494
+ return this.DeleteRecord('MJ: Archive Configurations', key, options, provider, userPayload, pubSub);
20495
+ }
20496
+
20497
+ }
20498
+
20499
+ //****************************************************************************
20500
+ // ENTITY CLASS for MJ: Archive Run Details
20501
+ //****************************************************************************
20502
+ @ObjectType({ description: `Per-record detail for each archive run. Tracks the outcome, storage location, and error information for each individual record processed.` })
20503
+ export class MJArchiveRunDetail_ {
20504
+ @Field()
20505
+ @MaxLength(36)
20506
+ ID: string;
20507
+
20508
+ @Field({description: `Foreign key to the parent ArchiveRun.`})
20509
+ @MaxLength(36)
20510
+ ArchiveRunID: string;
20511
+
20512
+ @Field({description: `Foreign key to the Entity this record belongs to.`})
20513
+ @MaxLength(36)
20514
+ EntityID: string;
20515
+
20516
+ @Field({description: `The primary key value of the archived record (string representation to support all key types).`})
20517
+ @MaxLength(750)
20518
+ RecordID: string;
20519
+
20520
+ @Field({description: `Outcome for this record: Success, Failed, or Skipped.`})
20521
+ @MaxLength(50)
20522
+ Status: string;
20523
+
20524
+ @Field({nullable: true, description: `Full path to the archived file in storage (e.g., "archives/production/Users/2026/04/record-id.json").`})
20525
+ @MaxLength(1000)
20526
+ StoragePath?: string;
20527
+
20528
+ @Field(() => Int, {description: `Number of bytes written to storage for this record.`})
20529
+ BytesArchived: number;
20530
+
20531
+ @Field({nullable: true, description: `Error details when Status is Failed.`})
20532
+ ErrorMessage?: string;
20533
+
20534
+ @Field({nullable: true, description: `Timestamp when this record was successfully archived.`})
20535
+ ArchivedAt?: Date;
20536
+
20537
+ @Field({nullable: true, description: `The __mj_UpdatedAt timestamp of the record at the time of archiving, used for conflict detection during restore.`})
20538
+ VersionStamp?: Date;
20539
+
20540
+ @Field(() => Boolean, {description: `When true, this detail row represents an archived Record Change entry rather than a primary entity record.`})
20541
+ IsRecordChangeArchive: boolean;
20542
+
20543
+ @Field()
20544
+ _mj__CreatedAt: Date;
20545
+
20546
+ @Field()
20547
+ _mj__UpdatedAt: Date;
20548
+
20549
+ @Field()
20550
+ ArchiveRun: Date;
20551
+
20552
+ @Field()
20553
+ @MaxLength(255)
20554
+ Entity: string;
20555
+
20556
+ }
20557
+
20558
+ //****************************************************************************
20559
+ // INPUT TYPE for MJ: Archive Run Details
20560
+ //****************************************************************************
20561
+ @InputType()
20562
+ export class CreateMJArchiveRunDetailInput {
20563
+ @Field({ nullable: true })
20564
+ ID?: string;
20565
+
20566
+ @Field({ nullable: true })
20567
+ ArchiveRunID?: string;
20568
+
20569
+ @Field({ nullable: true })
20570
+ EntityID?: string;
20571
+
20572
+ @Field({ nullable: true })
20573
+ RecordID?: string;
20574
+
20575
+ @Field({ nullable: true })
20576
+ Status?: string;
20577
+
20578
+ @Field({ nullable: true })
20579
+ StoragePath: string | null;
20580
+
20581
+ @Field(() => Int, { nullable: true })
20582
+ BytesArchived?: number;
20583
+
20584
+ @Field({ nullable: true })
20585
+ ErrorMessage: string | null;
20586
+
20587
+ @Field({ nullable: true })
20588
+ ArchivedAt: Date | null;
20589
+
20590
+ @Field({ nullable: true })
20591
+ VersionStamp: Date | null;
20592
+
20593
+ @Field(() => Boolean, { nullable: true })
20594
+ IsRecordChangeArchive?: boolean;
20595
+
20596
+ @Field(() => RestoreContextInput, { nullable: true })
20597
+ RestoreContext___?: RestoreContextInput;
20598
+ }
20599
+
20600
+
20601
+ //****************************************************************************
20602
+ // INPUT TYPE for MJ: Archive Run Details
20603
+ //****************************************************************************
20604
+ @InputType()
20605
+ export class UpdateMJArchiveRunDetailInput {
20606
+ @Field()
20607
+ ID: string;
20608
+
20609
+ @Field({ nullable: true })
20610
+ ArchiveRunID?: string;
20611
+
20612
+ @Field({ nullable: true })
20613
+ EntityID?: string;
20614
+
20615
+ @Field({ nullable: true })
20616
+ RecordID?: string;
20617
+
20618
+ @Field({ nullable: true })
20619
+ Status?: string;
20620
+
20621
+ @Field({ nullable: true })
20622
+ StoragePath?: string | null;
20623
+
20624
+ @Field(() => Int, { nullable: true })
20625
+ BytesArchived?: number;
20626
+
20627
+ @Field({ nullable: true })
20628
+ ErrorMessage?: string | null;
20629
+
20630
+ @Field({ nullable: true })
20631
+ ArchivedAt?: Date | null;
20632
+
20633
+ @Field({ nullable: true })
20634
+ VersionStamp?: Date | null;
20635
+
20636
+ @Field(() => Boolean, { nullable: true })
20637
+ IsRecordChangeArchive?: boolean;
20638
+
20639
+ @Field(() => [KeyValuePairInput], { nullable: true })
20640
+ OldValues___?: KeyValuePairInput[];
20641
+
20642
+ @Field(() => RestoreContextInput, { nullable: true })
20643
+ RestoreContext___?: RestoreContextInput;
20644
+ }
20645
+
20646
+ //****************************************************************************
20647
+ // RESOLVER for MJ: Archive Run Details
20648
+ //****************************************************************************
20649
+ @ObjectType()
20650
+ export class RunMJArchiveRunDetailViewResult {
20651
+ @Field(() => [MJArchiveRunDetail_])
20652
+ Results: MJArchiveRunDetail_[];
20653
+
20654
+ @Field(() => String, {nullable: true})
20655
+ UserViewRunID?: string;
20656
+
20657
+ @Field(() => Int, {nullable: true})
20658
+ RowCount: number;
20659
+
20660
+ @Field(() => Int, {nullable: true})
20661
+ TotalRowCount: number;
20662
+
20663
+ @Field(() => Int, {nullable: true})
20664
+ ExecutionTime: number;
20665
+
20666
+ @Field({nullable: true})
20667
+ ErrorMessage?: string;
20668
+
20669
+ @Field(() => Boolean, {nullable: false})
20670
+ Success: boolean;
20671
+ }
20672
+
20673
+ @Resolver(MJArchiveRunDetail_)
20674
+ export class MJArchiveRunDetailResolver extends ResolverBase {
20675
+ @Query(() => RunMJArchiveRunDetailViewResult)
20676
+ async RunMJArchiveRunDetailViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
20677
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20678
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
20679
+ }
20680
+
20681
+ @Query(() => RunMJArchiveRunDetailViewResult)
20682
+ async RunMJArchiveRunDetailViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
20683
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20684
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
20685
+ }
20686
+
20687
+ @Query(() => RunMJArchiveRunDetailViewResult)
20688
+ async RunMJArchiveRunDetailDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
20689
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20690
+ input.EntityName = 'MJ: Archive Run Details';
20691
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
20692
+ }
20693
+ @Query(() => MJArchiveRunDetail_, { nullable: true })
20694
+ async MJArchiveRunDetail(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJArchiveRunDetail_ | null> {
20695
+ this.CheckUserReadPermissions('MJ: Archive Run Details', userPayload);
20696
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20697
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwArchiveRunDetails')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Archive Run Details', userPayload, EntityPermissionType.Read, 'AND');
20698
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
20699
+ const result = await this.MapFieldNamesToCodeNames('MJ: Archive Run Details', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
20700
+ return result;
20701
+ }
20702
+
20703
+ @Query(() => [MJArchiveRunDetail_])
20704
+ async AllMJArchiveRunDetails(@Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
20705
+ this.CheckUserReadPermissions('MJ: Archive Run Details', userPayload);
20706
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20707
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwArchiveRunDetails')}` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Archive Run Details', userPayload, EntityPermissionType.Read, ' WHERE');
20708
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
20709
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Archive Run Details', rows, this.GetUserFromPayload(userPayload));
20710
+ return result;
20711
+ }
20712
+
20713
+ @Mutation(() => MJArchiveRunDetail_)
20714
+ async CreateMJArchiveRunDetail(
20715
+ @Arg('input', () => CreateMJArchiveRunDetailInput) input: CreateMJArchiveRunDetailInput,
20716
+ @Ctx() { providers, userPayload }: AppContext,
20717
+ @PubSub() pubSub: PubSubEngine
20718
+ ) {
20719
+ const provider = GetReadWriteProvider(providers);
20720
+ return this.CreateRecord('MJ: Archive Run Details', input, provider, userPayload, pubSub)
20721
+ }
20722
+
20723
+ @Mutation(() => MJArchiveRunDetail_)
20724
+ async UpdateMJArchiveRunDetail(
20725
+ @Arg('input', () => UpdateMJArchiveRunDetailInput) input: UpdateMJArchiveRunDetailInput,
20726
+ @Ctx() { providers, userPayload }: AppContext,
20727
+ @PubSub() pubSub: PubSubEngine
20728
+ ) {
20729
+ const provider = GetReadWriteProvider(providers);
20730
+ return this.UpdateRecord('MJ: Archive Run Details', input, provider, userPayload, pubSub);
20731
+ }
20732
+
20733
+ @Mutation(() => MJArchiveRunDetail_)
20734
+ async DeleteMJArchiveRunDetail(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
20735
+ const provider = GetReadWriteProvider(providers);
20736
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
20737
+ return this.DeleteRecord('MJ: Archive Run Details', key, options, provider, userPayload, pubSub);
20738
+ }
20739
+
20740
+ }
20741
+
20742
+ //****************************************************************************
20743
+ // ENTITY CLASS for MJ: Archive Runs
20744
+ //****************************************************************************
20745
+ @ObjectType({ description: `Tracks each execution of an archive configuration, including timing, aggregate statistics, and overall status.` })
20746
+ export class MJArchiveRun_ {
20747
+ @Field()
20748
+ @MaxLength(36)
20749
+ ID: string;
20750
+
20751
+ @Field({description: `Foreign key to the ArchiveConfiguration that was executed.`})
20752
+ @MaxLength(36)
20753
+ ArchiveConfigurationID: string;
20754
+
20755
+ @Field({description: `Timestamp when the archive run started.`})
20756
+ StartedAt: Date;
20757
+
20758
+ @Field({nullable: true, description: `Timestamp when the archive run completed (NULL while still running).`})
20759
+ CompletedAt?: Date;
20760
+
20761
+ @Field({description: `Current status: Running, Complete, Failed, Cancelled, or PartialSuccess.`})
20762
+ @MaxLength(50)
20763
+ Status: string;
20764
+
20765
+ @Field(() => Int, {description: `Total number of records identified for archiving in this run.`})
20766
+ TotalRecords: number;
20767
+
20768
+ @Field(() => Int, {description: `Number of records successfully archived.`})
20769
+ ArchivedRecords: number;
20770
+
20771
+ @Field(() => Int, {description: `Number of records that failed to archive.`})
20772
+ FailedRecords: number;
20773
+
20774
+ @Field(() => Int, {description: `Number of records skipped (e.g., already archived or filtered out).`})
20775
+ SkippedRecords: number;
20776
+
20777
+ @Field(() => Int, {description: `Total bytes written to archive storage during this run.`})
20778
+ TotalBytesArchived: number;
20779
+
20780
+ @Field({nullable: true, description: `Aggregated error log for the run. Contains error details when Status is Failed or PartialSuccess.`})
20781
+ ErrorLog?: string;
20782
+
20783
+ @Field({description: `The user who initiated this archive run.`})
20784
+ @MaxLength(36)
20785
+ UserID: string;
20786
+
20787
+ @Field()
20788
+ _mj__CreatedAt: Date;
20789
+
20790
+ @Field()
20791
+ _mj__UpdatedAt: Date;
20792
+
20793
+ @Field()
20794
+ @MaxLength(255)
20795
+ ArchiveConfiguration: string;
20796
+
20797
+ @Field()
20798
+ @MaxLength(100)
20799
+ User: string;
20800
+
20801
+ @Field(() => [MJArchiveRunDetail_])
20802
+ MJArchiveRunDetails_ArchiveRunIDArray: MJArchiveRunDetail_[]; // Link to MJArchiveRunDetails
20803
+
20804
+ }
20805
+
20806
+ //****************************************************************************
20807
+ // INPUT TYPE for MJ: Archive Runs
20808
+ //****************************************************************************
20809
+ @InputType()
20810
+ export class CreateMJArchiveRunInput {
20811
+ @Field({ nullable: true })
20812
+ ID?: string;
20813
+
20814
+ @Field({ nullable: true })
20815
+ ArchiveConfigurationID?: string;
20816
+
20817
+ @Field({ nullable: true })
20818
+ StartedAt?: Date;
20819
+
20820
+ @Field({ nullable: true })
20821
+ CompletedAt: Date | null;
20822
+
20823
+ @Field({ nullable: true })
20824
+ Status?: string;
20825
+
20826
+ @Field(() => Int, { nullable: true })
20827
+ TotalRecords?: number;
20828
+
20829
+ @Field(() => Int, { nullable: true })
20830
+ ArchivedRecords?: number;
20831
+
20832
+ @Field(() => Int, { nullable: true })
20833
+ FailedRecords?: number;
20834
+
20835
+ @Field(() => Int, { nullable: true })
20836
+ SkippedRecords?: number;
20837
+
20838
+ @Field(() => Int, { nullable: true })
20839
+ TotalBytesArchived?: number;
20840
+
20841
+ @Field({ nullable: true })
20842
+ ErrorLog: string | null;
20843
+
20844
+ @Field({ nullable: true })
20845
+ UserID?: string;
20846
+
20847
+ @Field(() => RestoreContextInput, { nullable: true })
20848
+ RestoreContext___?: RestoreContextInput;
20849
+ }
20850
+
20851
+
20852
+ //****************************************************************************
20853
+ // INPUT TYPE for MJ: Archive Runs
20854
+ //****************************************************************************
20855
+ @InputType()
20856
+ export class UpdateMJArchiveRunInput {
20857
+ @Field()
20858
+ ID: string;
20859
+
20860
+ @Field({ nullable: true })
20861
+ ArchiveConfigurationID?: string;
20862
+
20863
+ @Field({ nullable: true })
20864
+ StartedAt?: Date;
20865
+
20866
+ @Field({ nullable: true })
20867
+ CompletedAt?: Date | null;
20868
+
20869
+ @Field({ nullable: true })
20870
+ Status?: string;
20871
+
20872
+ @Field(() => Int, { nullable: true })
20873
+ TotalRecords?: number;
20874
+
20875
+ @Field(() => Int, { nullable: true })
20876
+ ArchivedRecords?: number;
20877
+
20878
+ @Field(() => Int, { nullable: true })
20879
+ FailedRecords?: number;
20880
+
20881
+ @Field(() => Int, { nullable: true })
20882
+ SkippedRecords?: number;
20883
+
20884
+ @Field(() => Int, { nullable: true })
20885
+ TotalBytesArchived?: number;
20886
+
20887
+ @Field({ nullable: true })
20888
+ ErrorLog?: string | null;
20889
+
20890
+ @Field({ nullable: true })
20891
+ UserID?: string;
20892
+
20893
+ @Field(() => [KeyValuePairInput], { nullable: true })
20894
+ OldValues___?: KeyValuePairInput[];
20895
+
20896
+ @Field(() => RestoreContextInput, { nullable: true })
20897
+ RestoreContext___?: RestoreContextInput;
20898
+ }
20899
+
20900
+ //****************************************************************************
20901
+ // RESOLVER for MJ: Archive Runs
20902
+ //****************************************************************************
20903
+ @ObjectType()
20904
+ export class RunMJArchiveRunViewResult {
20905
+ @Field(() => [MJArchiveRun_])
20906
+ Results: MJArchiveRun_[];
20907
+
20908
+ @Field(() => String, {nullable: true})
20909
+ UserViewRunID?: string;
20910
+
20911
+ @Field(() => Int, {nullable: true})
20912
+ RowCount: number;
20913
+
20914
+ @Field(() => Int, {nullable: true})
20915
+ TotalRowCount: number;
20916
+
20917
+ @Field(() => Int, {nullable: true})
20918
+ ExecutionTime: number;
20919
+
20920
+ @Field({nullable: true})
20921
+ ErrorMessage?: string;
20922
+
20923
+ @Field(() => Boolean, {nullable: false})
20924
+ Success: boolean;
20925
+ }
20926
+
20927
+ @Resolver(MJArchiveRun_)
20928
+ export class MJArchiveRunResolver extends ResolverBase {
20929
+ @Query(() => RunMJArchiveRunViewResult)
20930
+ async RunMJArchiveRunViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
20931
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20932
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
20933
+ }
20934
+
20935
+ @Query(() => RunMJArchiveRunViewResult)
20936
+ async RunMJArchiveRunViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
20937
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20938
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
20939
+ }
20940
+
20941
+ @Query(() => RunMJArchiveRunViewResult)
20942
+ async RunMJArchiveRunDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
20943
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20944
+ input.EntityName = 'MJ: Archive Runs';
20945
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
20946
+ }
20947
+ @Query(() => MJArchiveRun_, { nullable: true })
20948
+ async MJArchiveRun(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJArchiveRun_ | null> {
20949
+ this.CheckUserReadPermissions('MJ: Archive Runs', userPayload);
20950
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20951
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwArchiveRuns')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Archive Runs', userPayload, EntityPermissionType.Read, 'AND');
20952
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
20953
+ const result = await this.MapFieldNamesToCodeNames('MJ: Archive Runs', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
20954
+ return result;
20955
+ }
20956
+
20957
+ @Query(() => [MJArchiveRun_])
20958
+ async AllMJArchiveRuns(@Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
20959
+ this.CheckUserReadPermissions('MJ: Archive Runs', userPayload);
20960
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20961
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwArchiveRuns')}` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Archive Runs', userPayload, EntityPermissionType.Read, ' WHERE');
20962
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
20963
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Archive Runs', rows, this.GetUserFromPayload(userPayload));
20964
+ return result;
20965
+ }
20966
+
20967
+ @FieldResolver(() => [MJArchiveRunDetail_])
20968
+ async MJArchiveRunDetails_ArchiveRunIDArray(@Root() mjarchiverun_: MJArchiveRun_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
20969
+ this.CheckUserReadPermissions('MJ: Archive Run Details', userPayload);
20970
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20971
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwArchiveRunDetails')} WHERE ${provider.QuoteIdentifier('ArchiveRunID')}='${mjarchiverun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Archive Run Details', userPayload, EntityPermissionType.Read, 'AND');
20972
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
20973
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Archive Run Details', rows, this.GetUserFromPayload(userPayload));
20974
+ return result;
20975
+ }
20976
+
20977
+ @Mutation(() => MJArchiveRun_)
20978
+ async CreateMJArchiveRun(
20979
+ @Arg('input', () => CreateMJArchiveRunInput) input: CreateMJArchiveRunInput,
20980
+ @Ctx() { providers, userPayload }: AppContext,
20981
+ @PubSub() pubSub: PubSubEngine
20982
+ ) {
20983
+ const provider = GetReadWriteProvider(providers);
20984
+ return this.CreateRecord('MJ: Archive Runs', input, provider, userPayload, pubSub)
20985
+ }
20986
+
20987
+ @Mutation(() => MJArchiveRun_)
20988
+ async UpdateMJArchiveRun(
20989
+ @Arg('input', () => UpdateMJArchiveRunInput) input: UpdateMJArchiveRunInput,
20990
+ @Ctx() { providers, userPayload }: AppContext,
20991
+ @PubSub() pubSub: PubSubEngine
20992
+ ) {
20993
+ const provider = GetReadWriteProvider(providers);
20994
+ return this.UpdateRecord('MJ: Archive Runs', input, provider, userPayload, pubSub);
20995
+ }
20996
+
20997
+ @Mutation(() => MJArchiveRun_)
20998
+ async DeleteMJArchiveRun(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
20999
+ const provider = GetReadWriteProvider(providers);
21000
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
21001
+ return this.DeleteRecord('MJ: Archive Runs', key, options, provider, userPayload, pubSub);
21002
+ }
21003
+
21004
+ }
21005
+
19825
21006
  //****************************************************************************
19826
21007
  // ENTITY CLASS for MJ: Artifact Permissions
19827
21008
  //****************************************************************************
@@ -20079,6 +21260,10 @@ export class MJArtifactType_ {
20079
21260
  @MaxLength(10)
20080
21261
  ContentCategory: string;
20081
21262
 
21263
+ @Field({nullable: true, description: `Class name for the BaseArtifactToolLibrary subclass that provides type-specific artifact exploration tools for agents. Resolved via ClassFactory. When NULL, ArtifactToolManager uses name-based fallback resolution.`})
21264
+ @MaxLength(100)
21265
+ ToolLibraryClass?: string;
21266
+
20082
21267
  @Field({nullable: true})
20083
21268
  @MaxLength(100)
20084
21269
  Parent?: string;
@@ -20139,6 +21324,9 @@ export class CreateMJArtifactTypeInput {
20139
21324
  @Field({ nullable: true })
20140
21325
  ContentCategory?: string;
20141
21326
 
21327
+ @Field({ nullable: true })
21328
+ ToolLibraryClass: string | null;
21329
+
20142
21330
  @Field(() => RestoreContextInput, { nullable: true })
20143
21331
  RestoreContext___?: RestoreContextInput;
20144
21332
  }
@@ -20179,6 +21367,9 @@ export class UpdateMJArtifactTypeInput {
20179
21367
  @Field({ nullable: true })
20180
21368
  ContentCategory?: string;
20181
21369
 
21370
+ @Field({ nullable: true })
21371
+ ToolLibraryClass?: string | null;
21372
+
20182
21373
  @Field(() => [KeyValuePairInput], { nullable: true })
20183
21374
  OldValues___?: KeyValuePairInput[];
20184
21375
 
@@ -38803,6 +39994,12 @@ export class MJEntity_ {
38803
39994
  @Field(() => [MJEntityField_])
38804
39995
  MJEntityFields_RelatedEntityIDArray: MJEntityField_[]; // Link to MJEntityFields
38805
39996
 
39997
+ @Field(() => [MJArchiveConfigurationEntity_])
39998
+ MJArchiveConfigurationEntities_EntityIDArray: MJArchiveConfigurationEntity_[]; // Link to MJArchiveConfigurationEntities
39999
+
40000
+ @Field(() => [MJArchiveRunDetail_])
40001
+ MJArchiveRunDetails_EntityIDArray: MJArchiveRunDetail_[]; // Link to MJArchiveRunDetails
40002
+
38806
40003
  @Field(() => [MJResourceType_])
38807
40004
  MJResourceTypes_CategoryEntityIDArray: MJResourceType_[]; // Link to MJResourceTypes
38808
40005
 
@@ -39782,6 +40979,26 @@ export class MJEntityResolverBase extends ResolverBase {
39782
40979
  return result;
39783
40980
  }
39784
40981
 
40982
+ @FieldResolver(() => [MJArchiveConfigurationEntity_])
40983
+ async MJArchiveConfigurationEntities_EntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
40984
+ this.CheckUserReadPermissions('MJ: Archive Configuration Entities', userPayload);
40985
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
40986
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwArchiveConfigurationEntities')} WHERE ${provider.QuoteIdentifier('EntityID')}='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Archive Configuration Entities', userPayload, EntityPermissionType.Read, 'AND');
40987
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
40988
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Archive Configuration Entities', rows, this.GetUserFromPayload(userPayload));
40989
+ return result;
40990
+ }
40991
+
40992
+ @FieldResolver(() => [MJArchiveRunDetail_])
40993
+ async MJArchiveRunDetails_EntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
40994
+ this.CheckUserReadPermissions('MJ: Archive Run Details', userPayload);
40995
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
40996
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwArchiveRunDetails')} WHERE ${provider.QuoteIdentifier('EntityID')}='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Archive Run Details', userPayload, EntityPermissionType.Read, 'AND');
40997
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
40998
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Archive Run Details', rows, this.GetUserFromPayload(userPayload));
40999
+ return result;
41000
+ }
41001
+
39785
41002
  @FieldResolver(() => [MJResourceType_])
39786
41003
  async MJResourceTypes_CategoryEntityIDArray(@Root() mjentity_: MJEntity_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
39787
41004
  this.CheckUserReadPermissions('MJ: Resource Types', userPayload);
@@ -43645,6 +44862,10 @@ export class MJEntityPermission_ {
43645
44862
  @Field()
43646
44863
  _mj__UpdatedAt: Date;
43647
44864
 
44865
+ @Field({description: `Allow or Deny. Deny rows override any Allow grants on the same (EntityID, RoleID, action) at evaluation time, letting administrators exclude a role from an action another role grants.`})
44866
+ @MaxLength(10)
44867
+ Type: string;
44868
+
43648
44869
  @Field()
43649
44870
  @MaxLength(255)
43650
44871
  Entity: string;
@@ -43713,6 +44934,9 @@ export class CreateMJEntityPermissionInput {
43713
44934
  @Field({ nullable: true })
43714
44935
  DeleteRLSFilterID: string | null;
43715
44936
 
44937
+ @Field({ nullable: true })
44938
+ Type?: string;
44939
+
43716
44940
  @Field(() => RestoreContextInput, { nullable: true })
43717
44941
  RestoreContext___?: RestoreContextInput;
43718
44942
  }
@@ -43756,6 +44980,9 @@ export class UpdateMJEntityPermissionInput {
43756
44980
  @Field({ nullable: true })
43757
44981
  DeleteRLSFilterID?: string | null;
43758
44982
 
44983
+ @Field({ nullable: true })
44984
+ Type?: string;
44985
+
43759
44986
  @Field(() => [KeyValuePairInput], { nullable: true })
43760
44987
  OldValues___?: KeyValuePairInput[];
43761
44988
 
@@ -46121,6 +47348,9 @@ export class MJFileStorageAccount_ {
46121
47348
  @Field(() => [MJAIAgentType_])
46122
47349
  MJAIAgentTypes_DefaultStorageAccountIDArray: MJAIAgentType_[]; // Link to MJAIAgentTypes
46123
47350
 
47351
+ @Field(() => [MJArchiveConfiguration_])
47352
+ MJArchiveConfigurations_StorageAccountIDArray: MJArchiveConfiguration_[]; // Link to MJArchiveConfigurations
47353
+
46124
47354
  @Field(() => [MJFileStorageAccountPermission_])
46125
47355
  MJFileStorageAccountPermissions_FileStorageAccountIDArray: MJFileStorageAccountPermission_[]; // Link to MJFileStorageAccountPermissions
46126
47356
 
@@ -46257,6 +47487,16 @@ export class MJFileStorageAccountResolver extends ResolverBase {
46257
47487
  return result;
46258
47488
  }
46259
47489
 
47490
+ @FieldResolver(() => [MJArchiveConfiguration_])
47491
+ async MJArchiveConfigurations_StorageAccountIDArray(@Root() mjfilestorageaccount_: MJFileStorageAccount_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
47492
+ this.CheckUserReadPermissions('MJ: Archive Configurations', userPayload);
47493
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
47494
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwArchiveConfigurations')} WHERE ${provider.QuoteIdentifier('StorageAccountID')}='${mjfilestorageaccount_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Archive Configurations', userPayload, EntityPermissionType.Read, 'AND');
47495
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
47496
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Archive Configurations', rows, this.GetUserFromPayload(userPayload));
47497
+ return result;
47498
+ }
47499
+
46260
47500
  @FieldResolver(() => [MJFileStorageAccountPermission_])
46261
47501
  async MJFileStorageAccountPermissions_FileStorageAccountIDArray(@Root() mjfilestorageaccount_: MJFileStorageAccount_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
46262
47502
  this.CheckUserReadPermissions('MJ: File Storage Account Permissions', userPayload);
@@ -51299,6 +52539,9 @@ export class MJMCPServerTool_ {
51299
52539
  @Field(() => [MJMCPServerConnectionTool_])
51300
52540
  MJMCPServerConnectionTools_MCPServerToolIDArray: MJMCPServerConnectionTool_[]; // Link to MJMCPServerConnectionTools
51301
52541
 
52542
+ @Field(() => [MJMCPToolFavorite_])
52543
+ MJMCPToolFavorites_MCPServerToolIDArray: MJMCPToolFavorite_[]; // Link to MJMCPToolFavorites
52544
+
51302
52545
  @Field(() => [MJMCPToolExecutionLog_])
51303
52546
  MJMCPToolExecutionLogs_MCPServerToolIDArray: MJMCPToolExecutionLog_[]; // Link to MJMCPToolExecutionLogs
51304
52547
 
@@ -51471,6 +52714,16 @@ export class MJMCPServerToolResolver extends ResolverBase {
51471
52714
  return result;
51472
52715
  }
51473
52716
 
52717
+ @FieldResolver(() => [MJMCPToolFavorite_])
52718
+ async MJMCPToolFavorites_MCPServerToolIDArray(@Root() mjmcpservertool_: MJMCPServerTool_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
52719
+ this.CheckUserReadPermissions('MJ: MCP Tool Favorites', userPayload);
52720
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
52721
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwMCPToolFavorites')} WHERE ${provider.QuoteIdentifier('MCPServerToolID')}='${mjmcpservertool_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Tool Favorites', userPayload, EntityPermissionType.Read, 'AND');
52722
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
52723
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: MCP Tool Favorites', rows, this.GetUserFromPayload(userPayload));
52724
+ return result;
52725
+ }
52726
+
51474
52727
  @FieldResolver(() => [MJMCPToolExecutionLog_])
51475
52728
  async MJMCPToolExecutionLogs_MCPServerToolIDArray(@Root() mjmcpservertool_: MJMCPServerTool_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
51476
52729
  this.CheckUserReadPermissions('MJ: MCP Tool Execution Logs', userPayload);
@@ -52149,6 +53402,165 @@ export class MJMCPToolExecutionLogResolver extends ResolverBase {
52149
53402
 
52150
53403
  }
52151
53404
 
53405
+ //****************************************************************************
53406
+ // ENTITY CLASS for MJ: MCP Tool Favorites
53407
+ //****************************************************************************
53408
+ @ObjectType({ description: `Per-user favorite marker for an MCP Server Tool. Each row indicates the user has starred the referenced tool for quick access in the MCP Dashboard Tools tab and in the Test Tool dialog picker. Combined with UserID forms a unique pair so a user cannot favorite the same tool twice.` })
53409
+ export class MJMCPToolFavorite_ {
53410
+ @Field()
53411
+ @MaxLength(36)
53412
+ ID: string;
53413
+
53414
+ @Field({description: `The user who starred this tool. Favorites are per-user; multiple users can favorite the same tool independently. References the MJ User table.`})
53415
+ @MaxLength(36)
53416
+ UserID: string;
53417
+
53418
+ @Field({description: `The MCP Server Tool that has been favorited. Combined with UserID this forms a unique constraint so a user cannot favorite the same tool twice.`})
53419
+ @MaxLength(36)
53420
+ MCPServerToolID: string;
53421
+
53422
+ @Field()
53423
+ _mj__CreatedAt: Date;
53424
+
53425
+ @Field()
53426
+ _mj__UpdatedAt: Date;
53427
+
53428
+ @Field()
53429
+ @MaxLength(100)
53430
+ User: string;
53431
+
53432
+ @Field({nullable: true})
53433
+ @MaxLength(255)
53434
+ MCPServerTool?: string;
53435
+
53436
+ }
53437
+
53438
+ //****************************************************************************
53439
+ // INPUT TYPE for MJ: MCP Tool Favorites
53440
+ //****************************************************************************
53441
+ @InputType()
53442
+ export class CreateMJMCPToolFavoriteInput {
53443
+ @Field({ nullable: true })
53444
+ ID?: string;
53445
+
53446
+ @Field({ nullable: true })
53447
+ UserID?: string;
53448
+
53449
+ @Field({ nullable: true })
53450
+ MCPServerToolID?: string;
53451
+
53452
+ @Field(() => RestoreContextInput, { nullable: true })
53453
+ RestoreContext___?: RestoreContextInput;
53454
+ }
53455
+
53456
+
53457
+ //****************************************************************************
53458
+ // INPUT TYPE for MJ: MCP Tool Favorites
53459
+ //****************************************************************************
53460
+ @InputType()
53461
+ export class UpdateMJMCPToolFavoriteInput {
53462
+ @Field()
53463
+ ID: string;
53464
+
53465
+ @Field({ nullable: true })
53466
+ UserID?: string;
53467
+
53468
+ @Field({ nullable: true })
53469
+ MCPServerToolID?: string;
53470
+
53471
+ @Field(() => [KeyValuePairInput], { nullable: true })
53472
+ OldValues___?: KeyValuePairInput[];
53473
+
53474
+ @Field(() => RestoreContextInput, { nullable: true })
53475
+ RestoreContext___?: RestoreContextInput;
53476
+ }
53477
+
53478
+ //****************************************************************************
53479
+ // RESOLVER for MJ: MCP Tool Favorites
53480
+ //****************************************************************************
53481
+ @ObjectType()
53482
+ export class RunMJMCPToolFavoriteViewResult {
53483
+ @Field(() => [MJMCPToolFavorite_])
53484
+ Results: MJMCPToolFavorite_[];
53485
+
53486
+ @Field(() => String, {nullable: true})
53487
+ UserViewRunID?: string;
53488
+
53489
+ @Field(() => Int, {nullable: true})
53490
+ RowCount: number;
53491
+
53492
+ @Field(() => Int, {nullable: true})
53493
+ TotalRowCount: number;
53494
+
53495
+ @Field(() => Int, {nullable: true})
53496
+ ExecutionTime: number;
53497
+
53498
+ @Field({nullable: true})
53499
+ ErrorMessage?: string;
53500
+
53501
+ @Field(() => Boolean, {nullable: false})
53502
+ Success: boolean;
53503
+ }
53504
+
53505
+ @Resolver(MJMCPToolFavorite_)
53506
+ export class MJMCPToolFavoriteResolver extends ResolverBase {
53507
+ @Query(() => RunMJMCPToolFavoriteViewResult)
53508
+ async RunMJMCPToolFavoriteViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
53509
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
53510
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
53511
+ }
53512
+
53513
+ @Query(() => RunMJMCPToolFavoriteViewResult)
53514
+ async RunMJMCPToolFavoriteViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
53515
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
53516
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
53517
+ }
53518
+
53519
+ @Query(() => RunMJMCPToolFavoriteViewResult)
53520
+ async RunMJMCPToolFavoriteDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
53521
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
53522
+ input.EntityName = 'MJ: MCP Tool Favorites';
53523
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
53524
+ }
53525
+ @Query(() => MJMCPToolFavorite_, { nullable: true })
53526
+ async MJMCPToolFavorite(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJMCPToolFavorite_ | null> {
53527
+ this.CheckUserReadPermissions('MJ: MCP Tool Favorites', userPayload);
53528
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
53529
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwMCPToolFavorites')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Tool Favorites', userPayload, EntityPermissionType.Read, 'AND');
53530
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
53531
+ const result = await this.MapFieldNamesToCodeNames('MJ: MCP Tool Favorites', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
53532
+ return result;
53533
+ }
53534
+
53535
+ @Mutation(() => MJMCPToolFavorite_)
53536
+ async CreateMJMCPToolFavorite(
53537
+ @Arg('input', () => CreateMJMCPToolFavoriteInput) input: CreateMJMCPToolFavoriteInput,
53538
+ @Ctx() { providers, userPayload }: AppContext,
53539
+ @PubSub() pubSub: PubSubEngine
53540
+ ) {
53541
+ const provider = GetReadWriteProvider(providers);
53542
+ return this.CreateRecord('MJ: MCP Tool Favorites', input, provider, userPayload, pubSub)
53543
+ }
53544
+
53545
+ @Mutation(() => MJMCPToolFavorite_)
53546
+ async UpdateMJMCPToolFavorite(
53547
+ @Arg('input', () => UpdateMJMCPToolFavoriteInput) input: UpdateMJMCPToolFavoriteInput,
53548
+ @Ctx() { providers, userPayload }: AppContext,
53549
+ @PubSub() pubSub: PubSubEngine
53550
+ ) {
53551
+ const provider = GetReadWriteProvider(providers);
53552
+ return this.UpdateRecord('MJ: MCP Tool Favorites', input, provider, userPayload, pubSub);
53553
+ }
53554
+
53555
+ @Mutation(() => MJMCPToolFavorite_)
53556
+ async DeleteMJMCPToolFavorite(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
53557
+ const provider = GetReadWriteProvider(providers);
53558
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
53559
+ return this.DeleteRecord('MJ: MCP Tool Favorites', key, options, provider, userPayload, pubSub);
53560
+ }
53561
+
53562
+ }
53563
+
52152
53564
  //****************************************************************************
52153
53565
  // ENTITY CLASS for MJ: O Auth Auth Server Metadata Caches
52154
53566
  //****************************************************************************
@@ -54493,6 +55905,241 @@ export class MJOutputTriggerTypeResolver extends ResolverBase {
54493
55905
 
54494
55906
  }
54495
55907
 
55908
+ //****************************************************************************
55909
+ // ENTITY CLASS for MJ: Permission Domains
55910
+ //****************************************************************************
55911
+ @ObjectType({ description: `Catalog of registered permission subsystems. Each row describes one permission provider; the PermissionEngine uses ProviderClassName as the ClassFactory key to instantiate providers at startup. Enables unified permission queries across all subsystems.` })
55912
+ export class MJPermissionDomain_ {
55913
+ @Field()
55914
+ @MaxLength(36)
55915
+ ID: string;
55916
+
55917
+ @Field({description: `Human-readable unique name for the permission domain (e.g., "Entity Permissions", "Dashboard Permissions"). Used in admin UI and as the domain identifier in PermissionEngine API calls.`})
55918
+ @MaxLength(200)
55919
+ Name: string;
55920
+
55921
+ @Field({nullable: true, description: `Detailed description of what this permission domain covers and how permissions are enforced.`})
55922
+ Description?: string;
55923
+
55924
+ @Field({description: `ClassFactory key used to instantiate this provider. Must match the key passed to @RegisterClass(PermissionProviderBase, 'ClassName'). Convention: prefix with MJ for built-in providers (e.g., MJEntityPermissionProvider).`})
55925
+ @MaxLength(500)
55926
+ ProviderClassName: string;
55927
+
55928
+ @Field({description: `Comma-delimited list of grantee types this provider supports. Valid tokens: User, Role, Everyone, Public. Example: "User,Role".`})
55929
+ @MaxLength(200)
55930
+ SupportedGranteeTypes: string;
55931
+
55932
+ @Field({description: `Comma-delimited list of permission actions this provider can evaluate. Valid tokens: Read, Create, Update, Delete, Share, Execute, Admin. Example: "Read,Create,Update,Delete".`})
55933
+ @MaxLength(500)
55934
+ SupportedActions: string;
55935
+
55936
+ @Field(() => Boolean, {description: `When true, this provider supports explicit Deny records that override Allow grants at the same scope.`})
55937
+ SupportsDeny: boolean;
55938
+
55939
+ @Field(() => Boolean, {description: `When true, this provider supports time-bound permissions with an expiration timestamp.`})
55940
+ SupportsExpiration: boolean;
55941
+
55942
+ @Field(() => Boolean, {description: `When true, this provider resolves permissions hierarchically (e.g., category-level grants cascade to items within the category).`})
55943
+ SupportsHierarchyInheritance: boolean;
55944
+
55945
+ @Field(() => Boolean, {description: `When false, the PermissionEngine skips loading this provider at startup. Use to temporarily disable a provider without removing its record.`})
55946
+ IsActive: boolean;
55947
+
55948
+ @Field(() => Int, {description: `Sort order for displaying domains in the Sharing Center admin UI. Lower numbers appear first.`})
55949
+ DisplayOrder: number;
55950
+
55951
+ @Field({nullable: true, description: `Optional Font Awesome icon class for display in admin UI (e.g., "fa-solid fa-shield").`})
55952
+ @MaxLength(100)
55953
+ Icon?: string;
55954
+
55955
+ @Field()
55956
+ _mj__CreatedAt: Date;
55957
+
55958
+ @Field()
55959
+ _mj__UpdatedAt: Date;
55960
+
55961
+ }
55962
+
55963
+ //****************************************************************************
55964
+ // INPUT TYPE for MJ: Permission Domains
55965
+ //****************************************************************************
55966
+ @InputType()
55967
+ export class CreateMJPermissionDomainInput {
55968
+ @Field({ nullable: true })
55969
+ ID?: string;
55970
+
55971
+ @Field({ nullable: true })
55972
+ Name?: string;
55973
+
55974
+ @Field({ nullable: true })
55975
+ Description: string | null;
55976
+
55977
+ @Field({ nullable: true })
55978
+ ProviderClassName?: string;
55979
+
55980
+ @Field({ nullable: true })
55981
+ SupportedGranteeTypes?: string;
55982
+
55983
+ @Field({ nullable: true })
55984
+ SupportedActions?: string;
55985
+
55986
+ @Field(() => Boolean, { nullable: true })
55987
+ SupportsDeny?: boolean;
55988
+
55989
+ @Field(() => Boolean, { nullable: true })
55990
+ SupportsExpiration?: boolean;
55991
+
55992
+ @Field(() => Boolean, { nullable: true })
55993
+ SupportsHierarchyInheritance?: boolean;
55994
+
55995
+ @Field(() => Boolean, { nullable: true })
55996
+ IsActive?: boolean;
55997
+
55998
+ @Field(() => Int, { nullable: true })
55999
+ DisplayOrder?: number;
56000
+
56001
+ @Field({ nullable: true })
56002
+ Icon: string | null;
56003
+
56004
+ @Field(() => RestoreContextInput, { nullable: true })
56005
+ RestoreContext___?: RestoreContextInput;
56006
+ }
56007
+
56008
+
56009
+ //****************************************************************************
56010
+ // INPUT TYPE for MJ: Permission Domains
56011
+ //****************************************************************************
56012
+ @InputType()
56013
+ export class UpdateMJPermissionDomainInput {
56014
+ @Field()
56015
+ ID: string;
56016
+
56017
+ @Field({ nullable: true })
56018
+ Name?: string;
56019
+
56020
+ @Field({ nullable: true })
56021
+ Description?: string | null;
56022
+
56023
+ @Field({ nullable: true })
56024
+ ProviderClassName?: string;
56025
+
56026
+ @Field({ nullable: true })
56027
+ SupportedGranteeTypes?: string;
56028
+
56029
+ @Field({ nullable: true })
56030
+ SupportedActions?: string;
56031
+
56032
+ @Field(() => Boolean, { nullable: true })
56033
+ SupportsDeny?: boolean;
56034
+
56035
+ @Field(() => Boolean, { nullable: true })
56036
+ SupportsExpiration?: boolean;
56037
+
56038
+ @Field(() => Boolean, { nullable: true })
56039
+ SupportsHierarchyInheritance?: boolean;
56040
+
56041
+ @Field(() => Boolean, { nullable: true })
56042
+ IsActive?: boolean;
56043
+
56044
+ @Field(() => Int, { nullable: true })
56045
+ DisplayOrder?: number;
56046
+
56047
+ @Field({ nullable: true })
56048
+ Icon?: string | null;
56049
+
56050
+ @Field(() => [KeyValuePairInput], { nullable: true })
56051
+ OldValues___?: KeyValuePairInput[];
56052
+
56053
+ @Field(() => RestoreContextInput, { nullable: true })
56054
+ RestoreContext___?: RestoreContextInput;
56055
+ }
56056
+
56057
+ //****************************************************************************
56058
+ // RESOLVER for MJ: Permission Domains
56059
+ //****************************************************************************
56060
+ @ObjectType()
56061
+ export class RunMJPermissionDomainViewResult {
56062
+ @Field(() => [MJPermissionDomain_])
56063
+ Results: MJPermissionDomain_[];
56064
+
56065
+ @Field(() => String, {nullable: true})
56066
+ UserViewRunID?: string;
56067
+
56068
+ @Field(() => Int, {nullable: true})
56069
+ RowCount: number;
56070
+
56071
+ @Field(() => Int, {nullable: true})
56072
+ TotalRowCount: number;
56073
+
56074
+ @Field(() => Int, {nullable: true})
56075
+ ExecutionTime: number;
56076
+
56077
+ @Field({nullable: true})
56078
+ ErrorMessage?: string;
56079
+
56080
+ @Field(() => Boolean, {nullable: false})
56081
+ Success: boolean;
56082
+ }
56083
+
56084
+ @Resolver(MJPermissionDomain_)
56085
+ export class MJPermissionDomainResolver extends ResolverBase {
56086
+ @Query(() => RunMJPermissionDomainViewResult)
56087
+ async RunMJPermissionDomainViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
56088
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
56089
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
56090
+ }
56091
+
56092
+ @Query(() => RunMJPermissionDomainViewResult)
56093
+ async RunMJPermissionDomainViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
56094
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
56095
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
56096
+ }
56097
+
56098
+ @Query(() => RunMJPermissionDomainViewResult)
56099
+ async RunMJPermissionDomainDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
56100
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
56101
+ input.EntityName = 'MJ: Permission Domains';
56102
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
56103
+ }
56104
+ @Query(() => MJPermissionDomain_, { nullable: true })
56105
+ async MJPermissionDomain(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJPermissionDomain_ | null> {
56106
+ this.CheckUserReadPermissions('MJ: Permission Domains', userPayload);
56107
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
56108
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwPermissionDomains')} WHERE ${provider.QuoteIdentifier('ID')}='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Permission Domains', userPayload, EntityPermissionType.Read, 'AND');
56109
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
56110
+ const result = await this.MapFieldNamesToCodeNames('MJ: Permission Domains', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
56111
+ return result;
56112
+ }
56113
+
56114
+ @Mutation(() => MJPermissionDomain_)
56115
+ async CreateMJPermissionDomain(
56116
+ @Arg('input', () => CreateMJPermissionDomainInput) input: CreateMJPermissionDomainInput,
56117
+ @Ctx() { providers, userPayload }: AppContext,
56118
+ @PubSub() pubSub: PubSubEngine
56119
+ ) {
56120
+ const provider = GetReadWriteProvider(providers);
56121
+ return this.CreateRecord('MJ: Permission Domains', input, provider, userPayload, pubSub)
56122
+ }
56123
+
56124
+ @Mutation(() => MJPermissionDomain_)
56125
+ async UpdateMJPermissionDomain(
56126
+ @Arg('input', () => UpdateMJPermissionDomainInput) input: UpdateMJPermissionDomainInput,
56127
+ @Ctx() { providers, userPayload }: AppContext,
56128
+ @PubSub() pubSub: PubSubEngine
56129
+ ) {
56130
+ const provider = GetReadWriteProvider(providers);
56131
+ return this.UpdateRecord('MJ: Permission Domains', input, provider, userPayload, pubSub);
56132
+ }
56133
+
56134
+ @Mutation(() => MJPermissionDomain_)
56135
+ async DeleteMJPermissionDomain(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
56136
+ const provider = GetReadWriteProvider(providers);
56137
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
56138
+ return this.DeleteRecord('MJ: Permission Domains', key, options, provider, userPayload, pubSub);
56139
+ }
56140
+
56141
+ }
56142
+
54496
56143
  //****************************************************************************
54497
56144
  // ENTITY CLASS for MJ: Projects
54498
56145
  //****************************************************************************
@@ -61080,6 +62727,10 @@ export class MJResourcePermission_ {
61080
62727
  @MaxLength(20)
61081
62728
  Status: string;
61082
62729
 
62730
+ @Field({nullable: true, description: `The user who granted this permission. NULL when the share pre-dates this column or when the grantor is unknown (e.g., a system-seeded permission).`})
62731
+ @MaxLength(36)
62732
+ SharedByUserID?: string;
62733
+
61083
62734
  @Field()
61084
62735
  @MaxLength(255)
61085
62736
  ResourceType: string;
@@ -61092,6 +62743,10 @@ export class MJResourcePermission_ {
61092
62743
  @MaxLength(100)
61093
62744
  User?: string;
61094
62745
 
62746
+ @Field({nullable: true})
62747
+ @MaxLength(100)
62748
+ SharedByUser?: string;
62749
+
61095
62750
  }
61096
62751
 
61097
62752
  //****************************************************************************
@@ -61129,6 +62784,9 @@ export class CreateMJResourcePermissionInput {
61129
62784
  @Field({ nullable: true })
61130
62785
  Status?: string;
61131
62786
 
62787
+ @Field({ nullable: true })
62788
+ SharedByUserID: string | null;
62789
+
61132
62790
  @Field(() => RestoreContextInput, { nullable: true })
61133
62791
  RestoreContext___?: RestoreContextInput;
61134
62792
  }
@@ -61169,6 +62827,9 @@ export class UpdateMJResourcePermissionInput {
61169
62827
  @Field({ nullable: true })
61170
62828
  Status?: string;
61171
62829
 
62830
+ @Field({ nullable: true })
62831
+ SharedByUserID?: string | null;
62832
+
61172
62833
  @Field(() => [KeyValuePairInput], { nullable: true })
61173
62834
  OldValues___?: KeyValuePairInput[];
61174
62835
 
@@ -65095,24 +66756,24 @@ export class MJTag_ {
65095
66756
  @Field(() => [MJTaggedItem_])
65096
66757
  MJTaggedItems_TagIDArray: MJTaggedItem_[]; // Link to MJTaggedItems
65097
66758
 
65098
- @Field(() => [MJContentItemTag_])
65099
- MJContentItemTags_TagIDArray: MJContentItemTag_[]; // Link to MJContentItemTags
65100
-
65101
66759
  @Field(() => [MJTagCoOccurrence_])
65102
66760
  MJTagCoOccurrences_TagBIDArray: MJTagCoOccurrence_[]; // Link to MJTagCoOccurrences
65103
66761
 
66762
+ @Field(() => [MJContentItemTag_])
66763
+ MJContentItemTags_TagIDArray: MJContentItemTag_[]; // Link to MJContentItemTags
66764
+
65104
66765
  @Field(() => [MJTagAuditLog_])
65105
66766
  MJTagAuditLogs_RelatedTagIDArray: MJTagAuditLog_[]; // Link to MJTagAuditLogs
65106
66767
 
65107
66768
  @Field(() => [MJTagCoOccurrence_])
65108
66769
  MJTagCoOccurrences_TagAIDArray: MJTagCoOccurrence_[]; // Link to MJTagCoOccurrences
65109
66770
 
65110
- @Field(() => [MJTagAuditLog_])
65111
- MJTagAuditLogs_TagIDArray: MJTagAuditLog_[]; // Link to MJTagAuditLogs
65112
-
65113
66771
  @Field(() => [MJTag_])
65114
66772
  MJTags_MergedIntoTagIDArray: MJTag_[]; // Link to MJTags
65115
66773
 
66774
+ @Field(() => [MJTagAuditLog_])
66775
+ MJTagAuditLogs_TagIDArray: MJTagAuditLog_[]; // Link to MJTagAuditLogs
66776
+
65116
66777
  }
65117
66778
 
65118
66779
  //****************************************************************************
@@ -65256,16 +66917,6 @@ export class MJTagResolver extends ResolverBase {
65256
66917
  return result;
65257
66918
  }
65258
66919
 
65259
- @FieldResolver(() => [MJContentItemTag_])
65260
- async MJContentItemTags_TagIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
65261
- this.CheckUserReadPermissions('MJ: Content Item Tags', userPayload);
65262
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
65263
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentItemTags')} WHERE ${provider.QuoteIdentifier('TagID')}='${mjtag_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Item Tags', userPayload, EntityPermissionType.Read, 'AND');
65264
- const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
65265
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Item Tags', rows, this.GetUserFromPayload(userPayload));
65266
- return result;
65267
- }
65268
-
65269
66920
  @FieldResolver(() => [MJTagCoOccurrence_])
65270
66921
  async MJTagCoOccurrences_TagBIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
65271
66922
  this.CheckUserReadPermissions('MJ: Tag Co Occurrences', userPayload);
@@ -65276,6 +66927,16 @@ export class MJTagResolver extends ResolverBase {
65276
66927
  return result;
65277
66928
  }
65278
66929
 
66930
+ @FieldResolver(() => [MJContentItemTag_])
66931
+ async MJContentItemTags_TagIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
66932
+ this.CheckUserReadPermissions('MJ: Content Item Tags', userPayload);
66933
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
66934
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentItemTags')} WHERE ${provider.QuoteIdentifier('TagID')}='${mjtag_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Item Tags', userPayload, EntityPermissionType.Read, 'AND');
66935
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
66936
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Item Tags', rows, this.GetUserFromPayload(userPayload));
66937
+ return result;
66938
+ }
66939
+
65279
66940
  @FieldResolver(() => [MJTagAuditLog_])
65280
66941
  async MJTagAuditLogs_RelatedTagIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
65281
66942
  this.CheckUserReadPermissions('MJ: Tag Audit Logs', userPayload);
@@ -65296,16 +66957,6 @@ export class MJTagResolver extends ResolverBase {
65296
66957
  return result;
65297
66958
  }
65298
66959
 
65299
- @FieldResolver(() => [MJTagAuditLog_])
65300
- async MJTagAuditLogs_TagIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
65301
- this.CheckUserReadPermissions('MJ: Tag Audit Logs', userPayload);
65302
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
65303
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwTagAuditLogs')} WHERE ${provider.QuoteIdentifier('TagID')}='${mjtag_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Tag Audit Logs', userPayload, EntityPermissionType.Read, 'AND');
65304
- const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
65305
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Tag Audit Logs', rows, this.GetUserFromPayload(userPayload));
65306
- return result;
65307
- }
65308
-
65309
66960
  @FieldResolver(() => [MJTag_])
65310
66961
  async MJTags_MergedIntoTagIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
65311
66962
  this.CheckUserReadPermissions('MJ: Tags', userPayload);
@@ -65316,6 +66967,16 @@ export class MJTagResolver extends ResolverBase {
65316
66967
  return result;
65317
66968
  }
65318
66969
 
66970
+ @FieldResolver(() => [MJTagAuditLog_])
66971
+ async MJTagAuditLogs_TagIDArray(@Root() mjtag_: MJTag_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
66972
+ this.CheckUserReadPermissions('MJ: Tag Audit Logs', userPayload);
66973
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
66974
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwTagAuditLogs')} WHERE ${provider.QuoteIdentifier('TagID')}='${mjtag_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Tag Audit Logs', userPayload, EntityPermissionType.Read, 'AND');
66975
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
66976
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Tag Audit Logs', rows, this.GetUserFromPayload(userPayload));
66977
+ return result;
66978
+ }
66979
+
65319
66980
  @Mutation(() => MJTag_)
65320
66981
  async CreateMJTag(
65321
66982
  @Arg('input', () => CreateMJTagInput) input: CreateMJTagInput,
@@ -72807,12 +74468,12 @@ export class MJUser_ {
72807
74468
  @Field(() => [MJOAuthAuthorizationState_])
72808
74469
  MJOAuthAuthorizationStates_UserIDArray: MJOAuthAuthorizationState_[]; // Link to MJOAuthAuthorizationStates
72809
74470
 
72810
- @Field(() => [MJOpenAppInstallHistory_])
72811
- MJOpenAppInstallHistories_ExecutedByUserIDArray: MJOpenAppInstallHistory_[]; // Link to MJOpenAppInstallHistories
72812
-
72813
74471
  @Field(() => [MJOpenApp_])
72814
74472
  MJOpenApps_InstalledByUserIDArray: MJOpenApp_[]; // Link to MJOpenApps
72815
74473
 
74474
+ @Field(() => [MJOpenAppInstallHistory_])
74475
+ MJOpenAppInstallHistories_ExecutedByUserIDArray: MJOpenAppInstallHistory_[]; // Link to MJOpenAppInstallHistories
74476
+
72816
74477
  @Field(() => [MJContentItemDuplicate_])
72817
74478
  MJContentItemDuplicates_ResolvedByUserIDArray: MJContentItemDuplicate_[]; // Link to MJContentItemDuplicates
72818
74479
 
@@ -72825,6 +74486,15 @@ export class MJUser_ {
72825
74486
  @Field(() => [MJTagAuditLog_])
72826
74487
  MJTagAuditLogs_PerformedByUserIDArray: MJTagAuditLog_[]; // Link to MJTagAuditLogs
72827
74488
 
74489
+ @Field(() => [MJArchiveConfiguration_])
74490
+ MJArchiveConfigurations_CreatedByUserIDArray: MJArchiveConfiguration_[]; // Link to MJArchiveConfigurations
74491
+
74492
+ @Field(() => [MJMCPToolFavorite_])
74493
+ MJMCPToolFavorites_UserIDArray: MJMCPToolFavorite_[]; // Link to MJMCPToolFavorites
74494
+
74495
+ @Field(() => [MJResourcePermission_])
74496
+ MJResourcePermissions_SharedByUserIDArray: MJResourcePermission_[]; // Link to MJResourcePermissions
74497
+
72828
74498
  @Field(() => [MJResourcePermission_])
72829
74499
  MJResourcePermissions_UserIDArray: MJResourcePermission_[]; // Link to MJResourcePermissions
72830
74500
 
@@ -72873,6 +74543,9 @@ export class MJUser_ {
72873
74543
  @Field(() => [MJFileStorageAccountPermission_])
72874
74544
  MJFileStorageAccountPermissions_UserIDArray: MJFileStorageAccountPermission_[]; // Link to MJFileStorageAccountPermissions
72875
74545
 
74546
+ @Field(() => [MJArchiveRun_])
74547
+ MJArchiveRuns_UserIDArray: MJArchiveRun_[]; // Link to MJArchiveRuns
74548
+
72876
74549
  @Field(() => [MJAIAgentRun_])
72877
74550
  MJAIAgentRuns_UserIDArray: MJAIAgentRun_[]; // Link to MJAIAgentRuns
72878
74551
 
@@ -73652,16 +75325,6 @@ export class MJUserResolverBase extends ResolverBase {
73652
75325
  return result;
73653
75326
  }
73654
75327
 
73655
- @FieldResolver(() => [MJOpenAppInstallHistory_])
73656
- async MJOpenAppInstallHistories_ExecutedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
73657
- this.CheckUserReadPermissions('MJ: Open App Install Histories', userPayload);
73658
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
73659
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwOpenAppInstallHistories')} WHERE ${provider.QuoteIdentifier('ExecutedByUserID')}='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Open App Install Histories', userPayload, EntityPermissionType.Read, 'AND');
73660
- const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
73661
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Open App Install Histories', rows, this.GetUserFromPayload(userPayload));
73662
- return result;
73663
- }
73664
-
73665
75328
  @FieldResolver(() => [MJOpenApp_])
73666
75329
  async MJOpenApps_InstalledByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
73667
75330
  this.CheckUserReadPermissions('MJ: Open Apps', userPayload);
@@ -73672,6 +75335,16 @@ export class MJUserResolverBase extends ResolverBase {
73672
75335
  return result;
73673
75336
  }
73674
75337
 
75338
+ @FieldResolver(() => [MJOpenAppInstallHistory_])
75339
+ async MJOpenAppInstallHistories_ExecutedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
75340
+ this.CheckUserReadPermissions('MJ: Open App Install Histories', userPayload);
75341
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75342
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwOpenAppInstallHistories')} WHERE ${provider.QuoteIdentifier('ExecutedByUserID')}='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Open App Install Histories', userPayload, EntityPermissionType.Read, 'AND');
75343
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
75344
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Open App Install Histories', rows, this.GetUserFromPayload(userPayload));
75345
+ return result;
75346
+ }
75347
+
73675
75348
  @FieldResolver(() => [MJContentItemDuplicate_])
73676
75349
  async MJContentItemDuplicates_ResolvedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
73677
75350
  this.CheckUserReadPermissions('MJ: Content Item Duplicates', userPayload);
@@ -73712,6 +75385,36 @@ export class MJUserResolverBase extends ResolverBase {
73712
75385
  return result;
73713
75386
  }
73714
75387
 
75388
+ @FieldResolver(() => [MJArchiveConfiguration_])
75389
+ async MJArchiveConfigurations_CreatedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
75390
+ this.CheckUserReadPermissions('MJ: Archive Configurations', userPayload);
75391
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75392
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwArchiveConfigurations')} WHERE ${provider.QuoteIdentifier('CreatedByUserID')}='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Archive Configurations', userPayload, EntityPermissionType.Read, 'AND');
75393
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
75394
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Archive Configurations', rows, this.GetUserFromPayload(userPayload));
75395
+ return result;
75396
+ }
75397
+
75398
+ @FieldResolver(() => [MJMCPToolFavorite_])
75399
+ async MJMCPToolFavorites_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
75400
+ this.CheckUserReadPermissions('MJ: MCP Tool Favorites', userPayload);
75401
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75402
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwMCPToolFavorites')} WHERE ${provider.QuoteIdentifier('UserID')}='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: MCP Tool Favorites', userPayload, EntityPermissionType.Read, 'AND');
75403
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
75404
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: MCP Tool Favorites', rows, this.GetUserFromPayload(userPayload));
75405
+ return result;
75406
+ }
75407
+
75408
+ @FieldResolver(() => [MJResourcePermission_])
75409
+ async MJResourcePermissions_SharedByUserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
75410
+ this.CheckUserReadPermissions('MJ: Resource Permissions', userPayload);
75411
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75412
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwResourcePermissions')} WHERE ${provider.QuoteIdentifier('SharedByUserID')}='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Resource Permissions', userPayload, EntityPermissionType.Read, 'AND');
75413
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
75414
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Resource Permissions', rows, this.GetUserFromPayload(userPayload));
75415
+ return result;
75416
+ }
75417
+
73715
75418
  @FieldResolver(() => [MJResourcePermission_])
73716
75419
  async MJResourcePermissions_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
73717
75420
  this.CheckUserReadPermissions('MJ: Resource Permissions', userPayload);
@@ -73872,6 +75575,16 @@ export class MJUserResolverBase extends ResolverBase {
73872
75575
  return result;
73873
75576
  }
73874
75577
 
75578
+ @FieldResolver(() => [MJArchiveRun_])
75579
+ async MJArchiveRuns_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
75580
+ this.CheckUserReadPermissions('MJ: Archive Runs', userPayload);
75581
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
75582
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwArchiveRuns')} WHERE ${provider.QuoteIdentifier('UserID')}='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Archive Runs', userPayload, EntityPermissionType.Read, 'AND');
75583
+ const rows = await provider.ExecuteSQL(sSQL, undefined, undefined, this.GetUserFromPayload(userPayload));
75584
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Archive Runs', rows, this.GetUserFromPayload(userPayload));
75585
+ return result;
75586
+ }
75587
+
73875
75588
  @FieldResolver(() => [MJAIAgentRun_])
73876
75589
  async MJAIAgentRuns_UserIDArray(@Root() mjuser_: MJUser_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
73877
75590
  this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);