@memberjunction/server 6.1.0-edge.3 → 6.1.0-edge.4

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 (83) hide show
  1. package/dist/agentSessions/SessionManager.d.ts +19 -5
  2. package/dist/agentSessions/SessionManager.d.ts.map +1 -1
  3. package/dist/agentSessions/SessionManager.js +27 -9
  4. package/dist/agentSessions/SessionManager.js.map +1 -1
  5. package/dist/auth/index.d.ts +1 -0
  6. package/dist/auth/index.d.ts.map +1 -1
  7. package/dist/auth/index.js +1 -0
  8. package/dist/auth/index.js.map +1 -1
  9. package/dist/auth/scopeLimitedPrincipal.d.ts +39 -0
  10. package/dist/auth/scopeLimitedPrincipal.d.ts.map +1 -0
  11. package/dist/auth/scopeLimitedPrincipal.js +49 -0
  12. package/dist/auth/scopeLimitedPrincipal.js.map +1 -0
  13. package/dist/context.d.ts.map +1 -1
  14. package/dist/context.js +21 -1
  15. package/dist/context.js.map +1 -1
  16. package/dist/entitySubclasses/MJEntityPermissionEntityServer.server.d.ts.map +1 -1
  17. package/dist/entitySubclasses/MJEntityPermissionEntityServer.server.js +8 -7
  18. package/dist/entitySubclasses/MJEntityPermissionEntityServer.server.js.map +1 -1
  19. package/dist/generated/generated.d.ts +118 -0
  20. package/dist/generated/generated.d.ts.map +1 -1
  21. package/dist/generated/generated.js +630 -0
  22. package/dist/generated/generated.js.map +1 -1
  23. package/dist/generic/ResolverBase.d.ts +27 -0
  24. package/dist/generic/ResolverBase.d.ts.map +1 -1
  25. package/dist/generic/ResolverBase.js +50 -4
  26. package/dist/generic/ResolverBase.js.map +1 -1
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +49 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/integration/CustomColumnPromoter.d.ts +79 -15
  32. package/dist/integration/CustomColumnPromoter.d.ts.map +1 -1
  33. package/dist/integration/CustomColumnPromoter.js +472 -97
  34. package/dist/integration/CustomColumnPromoter.js.map +1 -1
  35. package/dist/integration/InactiveRowWarnings.d.ts +48 -0
  36. package/dist/integration/InactiveRowWarnings.d.ts.map +1 -0
  37. package/dist/integration/InactiveRowWarnings.js +57 -0
  38. package/dist/integration/InactiveRowWarnings.js.map +1 -0
  39. package/dist/integration/SchemaRefreshLaunch.d.ts +10 -0
  40. package/dist/integration/SchemaRefreshLaunch.d.ts.map +1 -1
  41. package/dist/integration/SchemaRefreshLaunch.js +17 -0
  42. package/dist/integration/SchemaRefreshLaunch.js.map +1 -1
  43. package/dist/resolvers/AdhocQueryResolver.d.ts +4 -0
  44. package/dist/resolvers/AdhocQueryResolver.d.ts.map +1 -1
  45. package/dist/resolvers/AdhocQueryResolver.js +20 -6
  46. package/dist/resolvers/AdhocQueryResolver.js.map +1 -1
  47. package/dist/resolvers/IdentityClaimRedemptionResolver.d.ts +37 -0
  48. package/dist/resolvers/IdentityClaimRedemptionResolver.d.ts.map +1 -0
  49. package/dist/resolvers/IdentityClaimRedemptionResolver.js +220 -0
  50. package/dist/resolvers/IdentityClaimRedemptionResolver.js.map +1 -0
  51. package/dist/resolvers/IntegrationDiscoveryResolver.d.ts +35 -3
  52. package/dist/resolvers/IntegrationDiscoveryResolver.d.ts.map +1 -1
  53. package/dist/resolvers/IntegrationDiscoveryResolver.js +86 -17
  54. package/dist/resolvers/IntegrationDiscoveryResolver.js.map +1 -1
  55. package/dist/resolvers/meetingRecordingRegistration.d.ts.map +1 -1
  56. package/dist/resolvers/meetingRecordingRegistration.js +3 -6
  57. package/dist/resolvers/meetingRecordingRegistration.js.map +1 -1
  58. package/dist/types.d.ts +8 -0
  59. package/dist/types.d.ts.map +1 -1
  60. package/dist/types.js.map +1 -1
  61. package/package.json +91 -91
  62. package/src/__tests__/AdhocQueryResolver.scopeGuard.test.ts +84 -0
  63. package/src/__tests__/CustomColumnPromoterOnePass.test.ts +387 -0
  64. package/src/__tests__/InactiveRowWarnings.test.ts +87 -0
  65. package/src/__tests__/ReactivateRefreshMessage.test.ts +85 -0
  66. package/src/__tests__/ResolverBase.filterEscaping.test.ts +147 -0
  67. package/src/__tests__/SessionManager.test.ts +55 -0
  68. package/src/agentSessions/SessionManager.ts +27 -9
  69. package/src/auth/index.ts +1 -0
  70. package/src/auth/scopeLimitedPrincipal.ts +50 -0
  71. package/src/context.ts +26 -2
  72. package/src/entitySubclasses/MJEntityPermissionEntityServer.server.ts +8 -7
  73. package/src/generated/generated.ts +437 -1
  74. package/src/generic/ResolverBase.ts +56 -4
  75. package/src/index.ts +57 -1
  76. package/src/integration/CustomColumnPromoter.ts +520 -98
  77. package/src/integration/InactiveRowWarnings.ts +85 -0
  78. package/src/integration/SchemaRefreshLaunch.ts +16 -0
  79. package/src/resolvers/AdhocQueryResolver.ts +21 -6
  80. package/src/resolvers/IdentityClaimRedemptionResolver.ts +184 -0
  81. package/src/resolvers/IntegrationDiscoveryResolver.ts +82 -11
  82. package/src/resolvers/meetingRecordingRegistration.ts +3 -7
  83. package/src/types.ts +8 -0
@@ -18,7 +18,7 @@ import { mj_core_schema } from '../config.js';
18
18
 
19
19
 
20
20
 
21
- import { MJAccessControlRuleEntity, MJActionAuthorizationEntity, MJActionCategoryEntity, MJActionContextTypeEntity, MJActionContextEntity, MJActionExecutionLogEntity, MJActionFilterEntity, MJActionLibraryEntity, MJActionParamEntity, MJActionResultCodeEntity, MJActionEntity, MJAIActionEntity, MJAIAgentActionEntity, MJAIAgentArtifactTypeEntity, MJAIAgentCategoryEntity, MJAIAgentChannelEntity, MJAIAgentClientToolEntity, MJAIAgentCoAgentEntity, MJAIAgentConfigurationEntity, MJAIAgentCredentialEntity, MJAIAgentDataSourceEntity, MJAIAgentExampleEntity, MJAIAgentHarnessEntity, MJAIAgentLearningCycleEntity, MJAIAgentModalityEntity, MJAIAgentModelEntity, MJAIAgentNoteTypeEntity, MJAIAgentNoteEntity, MJAIAgentPermissionEntity, MJAIAgentPromptEntity, MJAIAgentRelationshipEntity, MJAIAgentRequestTypeEntity, MJAIAgentRequestEntity, MJAIAgentRunMediaEntity, MJAIAgentRunStepEntity, MJAIAgentRunEntity, MJAIAgentSearchScopeEntity, MJAIAgentSessionBridgeParticipantEntity, MJAIAgentSessionBridgeEntity, MJAIAgentSessionChannelEntity, MJAIAgentSessionEntity, MJAIAgentSkillEntity, MJAIAgentStepPathEntity, MJAIAgentStepEntity, MJAIAgentTypeEntity, MJAIAgentEntity, MJAIArchitectureEntity, MJAIBridgeAgentIdentityEntity, MJAIBridgeProviderChannelEntity, MJAIBridgeProviderEntity, MJAIClientToolDefinitionEntity, MJAIConfigurationParamEntity, MJAIConfigurationEntity, MJAICredentialBindingEntity, MJAIModalityEntity, MJAIModelActionEntity, MJAIModelArchitectureEntity, MJAIModelCostEntity, MJAIModelModalityEntity, MJAIModelPriceTypeEntity, MJAIModelPriceUnitTypeEntity, MJAIModelTypeEntity, MJAIModelVendorEntity, MJAIModelEntity, MJAIPromptCategoryEntity, MJAIPromptModelEntity, MJAIPromptRunMediaEntity, MJAIPromptRunEntity, MJAIPromptTypeEntity, MJAIPromptEntity, MJAIRemoteBrowserProviderEntity, MJAIResultCacheEntity, MJAISkillActionEntity, MJAISkillPermissionEntity, MJAISkillSearchScopeEntity, MJAISkillSubAgentEntity, MJAISkillEntity, MJAIVendorTypeDefinitionEntity, MJAIVendorTypeEntity, MJAIVendorEntity, MJAPIApplicationScopeEntity, MJAPIApplicationEntity, MJAPIKeyApplicationEntity, MJAPIKeyScopeEntity, MJAPIKeyUsageLogEntity, MJAPIKeyEntity, MJAPIScopeEntity, MJApplicationEntityEntity, MJApplicationRoleEntity, MJApplicationSettingEntity, MJApplicationEntity, MJArchiveConfigurationEntityEntity, MJArchiveConfigurationEntity, MJArchiveRunDetailEntity, MJArchiveRunEntity, MJArtifactPermissionEntity, MJArtifactTypeEntity, MJArtifactUseEntity, MJArtifactVersionAttributeEntity, MJArtifactVersionEntity, MJArtifactEntity, MJAuditLogTypeEntity, MJAuditLogEntity, MJAuthenticationProviderEntity, MJAuthorizationRoleEntity, MJAuthorizationEntity, MJClusterAnalysisEntity, MJClusterAnalysisClusterEntity, MJCollectionArtifactEntity, MJCollectionPermissionEntity, MJCollectionEntity, MJCommunicationBaseMessageTypeEntity, MJCommunicationLogEntity, MJCommunicationProviderMessageTypeEntity, MJCommunicationProviderEntity, MJCommunicationRunEntity, MJCompanyEntity, MJCompanyIntegrationEntityMapEntity, MJCompanyIntegrationFieldMapEntity, MJCompanyIntegrationRecordMapEntity, MJCompanyIntegrationRunAPILogEntity, MJCompanyIntegrationRunDetailEntity, MJCompanyIntegrationRunEntity, MJCompanyIntegrationSyncWatermarkEntity, MJCompanyIntegrationEntity, MJComponentDependencyEntity, MJComponentLibraryEntity, MJComponentLibraryLinkEntity, MJComponentRegistryEntity, MJComponentEntity, MJContentFileTypeEntity, MJContentItemAttributeEntity, MJContentItemChunkEntity, MJContentItemDuplicateEntity, MJContentItemTagEntity, MJContentItemEntity, MJContentProcessRunDetailEntity, MJContentProcessRunPromptRunEntity, MJContentProcessRunEntity, MJContentSourceParamEntity, MJContentSourceTypeParamEntity, MJContentSourceTypeEntity, MJContentSourceEntity, MJContentTypeAttributeEntity, MJContentTypeEntity, MJConversationArtifactPermissionEntity, MJConversationArtifactVersionEntity, MJConversationArtifactEntity, MJConversationCompactionRunEntity, MJConversationDetailArtifactEntity, MJConversationDetailAttachmentEntity, MJConversationDetailRatingEntity, MJConversationDetailEntity, MJConversationWidgetInstanceEntity, MJConversationEntity, MJCountryEntity, MJCredentialCategoryEntity, MJCredentialTypeEntity, MJCredentialEntity, MJDashboardCategoryEntity, MJDashboardCategoryLinkEntity, MJDashboardCategoryPermissionEntity, MJDashboardPartTypeEntity, MJDashboardPermissionEntity, MJDashboardUserPreferenceEntity, MJDashboardUserStateEntity, MJDashboardEntity, MJDataContextItemEntity, MJDataContextEntity, MJDatasetItemEntity, MJDatasetEntity, MJDuplicateRunDetailMatchEntity, MJDuplicateRunDetailEntity, MJDuplicateRunEntity, MJEmployeeCompanyIntegrationEntity, MJEmployeeRoleEntity, MJEmployeeSkillEntity, MJEmployeeEntity, MJEncryptionAlgorithmEntity, MJEncryptionKeySourceEntity, MJEncryptionKeyEntity, MJEntityEntity, MJEntityActionFilterEntity, MJEntityActionInvocationTypeEntity, MJEntityActionInvocationEntity, MJEntityActionParamEntity, MJEntityActionEntity, MJEntityAIActionEntity, MJEntityCommunicationFieldEntity, MJEntityCommunicationMessageTypeEntity, MJEntityDocumentRunEntity, MJEntityDocumentSettingEntity, MJEntityDocumentTypeEntity, MJEntityDocumentEntity, MJEntityFieldValueEntity, MJEntityFieldEntity, MJEntityFormOverrideEntity, MJEntityOrganicKeyRelatedEntityEntity, MJEntityOrganicKeyEntity, MJEntityPermissionEntity, MJEntityRecordDocumentEntity, MJEntityRelationshipDisplayComponentEntity, MJEntityRelationshipEntity, MJEntitySettingEntity, MJEnvironmentEntity, MJErrorLogEntity, MJExperimentSessionIterationEntity, MJExperimentSessionEntity, MJExperimentEntity, MJExplorerNavigationItemEntity, MJExternalDataSourceTypeEntity, MJExternalDataSourceEntity, MJFileCategoryEntity, MJFileEntityRecordLinkEntity, MJFileStorageAccountPermissionEntity, MJFileStorageAccountEntity, MJFileStorageProviderEntity, MJFileEntity, MJFormChromeRuleEntity, MJGeneratedCodeCategoryEntity, MJGeneratedCodeEntity, MJInstanceConfigurationEntity, MJIntegrationObjectFieldEntity, MJIntegrationObjectEntity, MJIntegrationSourceTypeEntity, MJIntegrationURLFormatEntity, MJIntegrationEntity, MJKnowledgeHubSavedSearchEntity, MJLibraryEntity, MJLibraryItemEntity, MJListCategoryEntity, MJListDetailEntity, MJListInvitationEntity, MJListShareEntity, MJListEntity, MJMagicLinkInviteAllowedDomainEntity, MJMagicLinkInviteAllowedPathEntity, MJMagicLinkInviteApplicationEntity, MJMagicLinkInviteRoleEntity, MJMagicLinkInviteEntity, MJMagicLinkRedemptionEntity, MJMaterializedResultQueryEntity, MJMaterializedResultEntity, MJMCPServerConnectionPermissionEntity, MJMCPServerConnectionToolEntity, MJMCPServerConnectionEntity, MJMCPServerToolEntity, MJMCPServerEntity, MJMCPToolExecutionLogEntity, MJMCPToolFavoriteEntity, MJMLAlgorithmUseCaseRankingEntity, MJMLAlgorithmUseCaseEntity, MJMLAlgorithmEntity, MJMLModelScoringBindingEntity, MJMLModelEntity, MJMLTrainingPipelineEntity, MJMLTrainingRunEntity, MJOAuthAuthServerMetadataCacheEntity, MJOAuthAuthorizationStateEntity, MJOAuthClientRegistrationEntity, MJOAuthTokenEntity, MJOpenAppDependencyEntity, MJOpenAppInstallHistoryEntity, MJOpenAppEntity, MJOutputDeliveryTypeEntity, MJOutputFormatTypeEntity, MJPermissionDomainEntity, MJProcessRunDetailEntity, MJProcessRunEntity, MJProjectEntity, MJPublicLinkEntity, MJQueryEntity, MJQueryCategoryEntity, MJQueryDependencyEntity, MJQueryEntityEntity, MJQueryFieldEntity, MJQueryParameterEntity, MJQueryPermissionEntity, MJQuerySQLEntity, MJQueueTaskEntity, MJQueueTypeEntity, MJQueueEntity, MJRecommendationItemEntity, MJRecommendationProviderEntity, MJRecommendationRunEntity, MJRecommendationEntity, MJRecordChangeReplayRunEntity, MJRecordChangeEntity, MJRecordGeoCodeEntity, MJRecordLinkEntity, MJRecordMergeDeletionLogEntity, MJRecordMergeLogEntity, MJRecordProcessCategoryEntity, MJRecordProcessWatermarkEntity, MJRecordProcessEntity, MJRemoteOperationCategoryEntity, MJRemoteOperationEntity, MJResourceLinkEntity, MJResourcePermissionEntity, MJResourceTypeEntity, MJRoleEntity, MJRowLevelSecurityFilterEntity, MJRSUPendingWorkEntity, MJScheduledJobRunEntity, MJScheduledJobTypeEntity, MJScheduledJobEntity, MJSchemaInfoEntity, MJScopedPromptConfigEntity, MJScopedPromptPartEntity, MJSearchExecutionLogEntity, MJSearchProviderEntity, MJSearchScopeEntityEntity, MJSearchScopeExternalIndexEntity, MJSearchScopePermissionEntity, MJSearchScopeProviderEntity, MJSearchScopeStorageAccountEntity, MJSearchScopeTestQueryEntity, MJSearchScopeEntity, MJSignatureAccountEntity, MJSignatureProviderEntity, MJSignatureRequestDocumentEntity, MJSignatureRequestLogEntity, MJSignatureRequestRecipientEntity, MJSignatureRequestEntity, MJSkillEntity, MJSQLDialectEntity, MJStateProvinceEntity, MJTagAuditLogEntity, MJTagCoOccurrenceEntity, MJTagScopeEntity, MJTagSuggestionEntity, MJTagSynonymEntity, MJTaggedItemEntity, MJTagEntity, MJTaskDependencyEntity, MJTaskTypeEntity, MJTaskEntity, MJTemplateCategoryEntity, MJTemplateContentTypeEntity, MJTemplateContentEntity, MJTemplateParamEntity, MJTemplateEntity, MJTestRubricEntity, MJTestRunFeedbackEntity, MJTestRunOutputTypeEntity, MJTestRunOutputEntity, MJTestRunEntity, MJTestSuiteRunEntity, MJTestSuiteTestEntity, MJTestSuiteEntity, MJTestTypeEntity, MJTestEntity, MJThemeEntity, MJUserApplicationEntityEntity, MJUserApplicationEntity, MJUserFavoriteEntity, MJUserNotificationPreferenceEntity, MJUserNotificationTypeEntity, MJUserNotificationEntity, MJUserRecordLogEntity, MJUserRoleEntity, MJUserRoutineRecipientEntity, MJUserRoutineRunEntity, MJUserRoutineEntity, MJUserSettingEntity, MJUserViewCategoryEntity, MJUserViewRunDetailEntity, MJUserViewRunEntity, MJUserViewEntity, MJUserEntity, MJVectorDatabaseEntity, MJVectorIndexEntity, MJVersionInstallationEntity, MJVersionLabelItemEntity, MJVersionLabelRestoreEntity, MJVersionLabelEntity, MJViewTypeEntity, MJWorkspaceItemEntity, MJWorkspaceEntity } from '@memberjunction/core-entities';
21
+ import { MJAccessControlRuleEntity, MJActionAuthorizationEntity, MJActionCategoryEntity, MJActionContextTypeEntity, MJActionContextEntity, MJActionExecutionLogEntity, MJActionFilterEntity, MJActionLibraryEntity, MJActionParamEntity, MJActionResultCodeEntity, MJActionEntity, MJAIActionEntity, MJAIAgentActionEntity, MJAIAgentArtifactTypeEntity, MJAIAgentCategoryEntity, MJAIAgentChannelEntity, MJAIAgentClientToolEntity, MJAIAgentCoAgentEntity, MJAIAgentConfigurationEntity, MJAIAgentCredentialEntity, MJAIAgentDataSourceEntity, MJAIAgentExampleEntity, MJAIAgentHarnessEntity, MJAIAgentLearningCycleEntity, MJAIAgentModalityEntity, MJAIAgentModelEntity, MJAIAgentNoteTypeEntity, MJAIAgentNoteEntity, MJAIAgentPermissionEntity, MJAIAgentPromptEntity, MJAIAgentRelationshipEntity, MJAIAgentRequestTypeEntity, MJAIAgentRequestEntity, MJAIAgentRunMediaEntity, MJAIAgentRunStepEntity, MJAIAgentRunEntity, MJAIAgentSearchScopeEntity, MJAIAgentSessionBridgeParticipantEntity, MJAIAgentSessionBridgeEntity, MJAIAgentSessionChannelEntity, MJAIAgentSessionEntity, MJAIAgentSkillEntity, MJAIAgentStepPathEntity, MJAIAgentStepEntity, MJAIAgentTypeEntity, MJAIAgentEntity, MJAIArchitectureEntity, MJAIBridgeAgentIdentityEntity, MJAIBridgeProviderChannelEntity, MJAIBridgeProviderEntity, MJAIClientToolDefinitionEntity, MJAIConfigurationParamEntity, MJAIConfigurationEntity, MJAICredentialBindingEntity, MJAIModalityEntity, MJAIModelActionEntity, MJAIModelArchitectureEntity, MJAIModelCostEntity, MJAIModelModalityEntity, MJAIModelPriceTypeEntity, MJAIModelPriceUnitTypeEntity, MJAIModelTypeEntity, MJAIModelVendorEntity, MJAIModelEntity, MJAIPromptCategoryEntity, MJAIPromptModelEntity, MJAIPromptRunMediaEntity, MJAIPromptRunEntity, MJAIPromptTypeEntity, MJAIPromptEntity, MJAIRemoteBrowserProviderEntity, MJAIResultCacheEntity, MJAISkillActionEntity, MJAISkillPermissionEntity, MJAISkillSearchScopeEntity, MJAISkillSubAgentEntity, MJAISkillEntity, MJAIVendorTypeDefinitionEntity, MJAIVendorTypeEntity, MJAIVendorEntity, MJAPIApplicationScopeEntity, MJAPIApplicationEntity, MJAPIKeyApplicationEntity, MJAPIKeyScopeEntity, MJAPIKeyUsageLogEntity, MJAPIKeyEntity, MJAPIScopeEntity, MJApplicationEntityEntity, MJApplicationRoleEntity, MJApplicationSettingEntity, MJApplicationEntity, MJArchiveConfigurationEntityEntity, MJArchiveConfigurationEntity, MJArchiveRunDetailEntity, MJArchiveRunEntity, MJArtifactPermissionEntity, MJArtifactTypeEntity, MJArtifactUseEntity, MJArtifactVersionAttributeEntity, MJArtifactVersionEntity, MJArtifactEntity, MJAuditLogTypeEntity, MJAuditLogEntity, MJAuthenticationProviderEntity, MJAuthorizationRoleEntity, MJAuthorizationEntity, MJClusterAnalysisEntity, MJClusterAnalysisClusterEntity, MJCollectionArtifactEntity, MJCollectionPermissionEntity, MJCollectionEntity, MJCommunicationBaseMessageTypeEntity, MJCommunicationLogEntity, MJCommunicationProviderMessageTypeEntity, MJCommunicationProviderEntity, MJCommunicationRunEntity, MJCompanyEntity, MJCompanyIntegrationEntityMapEntity, MJCompanyIntegrationFieldMapEntity, MJCompanyIntegrationRecordMapEntity, MJCompanyIntegrationRunAPILogEntity, MJCompanyIntegrationRunDetailEntity, MJCompanyIntegrationRunEntity, MJCompanyIntegrationSyncWatermarkEntity, MJCompanyIntegrationEntity, MJComponentDependencyEntity, MJComponentLibraryEntity, MJComponentLibraryLinkEntity, MJComponentRegistryEntity, MJComponentEntity, MJContentFileTypeEntity, MJContentItemAttributeEntity, MJContentItemChunkEntity, MJContentItemDuplicateEntity, MJContentItemTagEntity, MJContentItemEntity, MJContentProcessRunDetailEntity, MJContentProcessRunPromptRunEntity, MJContentProcessRunEntity, MJContentSourceParamEntity, MJContentSourceTypeParamEntity, MJContentSourceTypeEntity, MJContentSourceEntity, MJContentTypeAttributeEntity, MJContentTypeEntity, MJConversationArtifactPermissionEntity, MJConversationArtifactVersionEntity, MJConversationArtifactEntity, MJConversationCompactionRunEntity, MJConversationDetailArtifactEntity, MJConversationDetailAttachmentEntity, MJConversationDetailRatingEntity, MJConversationDetailEntity, MJConversationWidgetInstanceEntity, MJConversationEntity, MJCountryEntity, MJCredentialCategoryEntity, MJCredentialTypeEntity, MJCredentialEntity, MJDashboardCategoryEntity, MJDashboardCategoryLinkEntity, MJDashboardCategoryPermissionEntity, MJDashboardPartTypeEntity, MJDashboardPermissionEntity, MJDashboardUserPreferenceEntity, MJDashboardUserStateEntity, MJDashboardEntity, MJDataContextItemEntity, MJDataContextEntity, MJDatasetItemEntity, MJDatasetEntity, MJDuplicateRunDetailMatchEntity, MJDuplicateRunDetailEntity, MJDuplicateRunEntity, MJEmployeeCompanyIntegrationEntity, MJEmployeeRoleEntity, MJEmployeeSkillEntity, MJEmployeeEntity, MJEncryptionAlgorithmEntity, MJEncryptionKeySourceEntity, MJEncryptionKeyEntity, MJEntityEntity, MJEntityActionFilterEntity, MJEntityActionInvocationTypeEntity, MJEntityActionInvocationEntity, MJEntityActionParamEntity, MJEntityActionEntity, MJEntityAIActionEntity, MJEntityCommunicationFieldEntity, MJEntityCommunicationMessageTypeEntity, MJEntityDocumentRunEntity, MJEntityDocumentSettingEntity, MJEntityDocumentTypeEntity, MJEntityDocumentEntity, MJEntityFieldValueEntity, MJEntityFieldEntity, MJEntityFormOverrideEntity, MJEntityOrganicKeyRelatedEntityEntity, MJEntityOrganicKeyEntity, MJEntityPermissionEntity, MJEntityRecordDocumentEntity, MJEntityRelationshipDisplayComponentEntity, MJEntityRelationshipEntity, MJEntitySettingEntity, MJEnvironmentEntity, MJErrorLogEntity, MJExperimentSessionIterationEntity, MJExperimentSessionEntity, MJExperimentEntity, MJExplorerNavigationItemEntity, MJExternalDataSourceTypeEntity, MJExternalDataSourceEntity, MJFileCategoryEntity, MJFileEntityRecordLinkEntity, MJFileStorageAccountPermissionEntity, MJFileStorageAccountEntity, MJFileStorageProviderEntity, MJFileEntity, MJFormChromeRuleEntity, MJGeneratedCodeCategoryEntity, MJGeneratedCodeEntity, MJIdentityClaimTypeEntity, MJIdentityClaimEntity, MJInstanceConfigurationEntity, MJIntegrationObjectFieldEntity, MJIntegrationObjectEntity, MJIntegrationSourceTypeEntity, MJIntegrationURLFormatEntity, MJIntegrationEntity, MJKnowledgeHubSavedSearchEntity, MJLibraryEntity, MJLibraryItemEntity, MJListCategoryEntity, MJListDetailEntity, MJListInvitationEntity, MJListShareEntity, MJListEntity, MJMagicLinkInviteAllowedDomainEntity, MJMagicLinkInviteAllowedPathEntity, MJMagicLinkInviteApplicationEntity, MJMagicLinkInviteRoleEntity, MJMagicLinkInviteEntity, MJMagicLinkRedemptionEntity, MJMaterializedResultQueryEntity, MJMaterializedResultEntity, MJMCPServerConnectionPermissionEntity, MJMCPServerConnectionToolEntity, MJMCPServerConnectionEntity, MJMCPServerToolEntity, MJMCPServerEntity, MJMCPToolExecutionLogEntity, MJMCPToolFavoriteEntity, MJMLAlgorithmUseCaseRankingEntity, MJMLAlgorithmUseCaseEntity, MJMLAlgorithmEntity, MJMLModelScoringBindingEntity, MJMLModelEntity, MJMLTrainingPipelineEntity, MJMLTrainingRunEntity, MJOAuthAuthServerMetadataCacheEntity, MJOAuthAuthorizationStateEntity, MJOAuthClientRegistrationEntity, MJOAuthTokenEntity, MJOpenAppDependencyEntity, MJOpenAppInstallHistoryEntity, MJOpenAppEntity, MJOutputDeliveryTypeEntity, MJOutputFormatTypeEntity, MJPermissionDomainEntity, MJProcessRunDetailEntity, MJProcessRunEntity, MJProjectEntity, MJPublicLinkEntity, MJQueryEntity, MJQueryCategoryEntity, MJQueryDependencyEntity, MJQueryEntityEntity, MJQueryFieldEntity, MJQueryParameterEntity, MJQueryPermissionEntity, MJQuerySQLEntity, MJQueueTaskEntity, MJQueueTypeEntity, MJQueueEntity, MJRecommendationItemEntity, MJRecommendationProviderEntity, MJRecommendationRunEntity, MJRecommendationEntity, MJRecordChangeReplayRunEntity, MJRecordChangeEntity, MJRecordGeoCodeEntity, MJRecordLinkEntity, MJRecordMergeDeletionLogEntity, MJRecordMergeLogEntity, MJRecordProcessCategoryEntity, MJRecordProcessWatermarkEntity, MJRecordProcessEntity, MJRemoteOperationCategoryEntity, MJRemoteOperationEntity, MJResourceLinkEntity, MJResourcePermissionEntity, MJResourceTypeEntity, MJRoleEntity, MJRowLevelSecurityFilterEntity, MJRSUPendingWorkEntity, MJScheduledJobRunEntity, MJScheduledJobTypeEntity, MJScheduledJobEntity, MJSchemaInfoEntity, MJScopedPromptConfigEntity, MJScopedPromptPartEntity, MJSearchExecutionLogEntity, MJSearchProviderEntity, MJSearchScopeEntityEntity, MJSearchScopeExternalIndexEntity, MJSearchScopePermissionEntity, MJSearchScopeProviderEntity, MJSearchScopeStorageAccountEntity, MJSearchScopeTestQueryEntity, MJSearchScopeEntity, MJSignatureAccountEntity, MJSignatureProviderEntity, MJSignatureRequestDocumentEntity, MJSignatureRequestLogEntity, MJSignatureRequestRecipientEntity, MJSignatureRequestEntity, MJSkillEntity, MJSQLDialectEntity, MJStateProvinceEntity, MJTagAuditLogEntity, MJTagCoOccurrenceEntity, MJTagScopeEntity, MJTagSuggestionEntity, MJTagSynonymEntity, MJTaggedItemEntity, MJTagEntity, MJTaskDependencyEntity, MJTaskTypeEntity, MJTaskEntity, MJTemplateCategoryEntity, MJTemplateContentTypeEntity, MJTemplateContentEntity, MJTemplateParamEntity, MJTemplateEntity, MJTestRubricEntity, MJTestRunFeedbackEntity, MJTestRunOutputTypeEntity, MJTestRunOutputEntity, MJTestRunEntity, MJTestSuiteRunEntity, MJTestSuiteTestEntity, MJTestSuiteEntity, MJTestTypeEntity, MJTestEntity, MJThemeEntity, MJUserApplicationEntityEntity, MJUserApplicationEntity, MJUserFavoriteEntity, MJUserNotificationPreferenceEntity, MJUserNotificationTypeEntity, MJUserNotificationEntity, MJUserRecordLogEntity, MJUserRoleEntity, MJUserRoutineRecipientEntity, MJUserRoutineRunEntity, MJUserRoutineEntity, MJUserSettingEntity, MJUserViewCategoryEntity, MJUserViewRunDetailEntity, MJUserViewRunEntity, MJUserViewEntity, MJUserEntity, MJVectorDatabaseEntity, MJVectorIndexEntity, MJVersionInstallationEntity, MJVersionLabelItemEntity, MJVersionLabelRestoreEntity, MJVersionLabelEntity, MJViewTypeEntity, MJWorkspaceItemEntity, MJWorkspaceEntity } from '@memberjunction/core-entities';
22
22
 
23
23
 
24
24
  //****************************************************************************
@@ -52275,6 +52275,442 @@ export class MJGeneratedCodeResolver extends ResolverBase {
52275
52275
 
52276
52276
  }
52277
52277
 
52278
+ //****************************************************************************
52279
+ // ENTITY CLASS for MJ: Identity Claim Types
52280
+ //****************************************************************************
52281
+ @ObjectType({ description: `Metadata catalog of identity claim types. Each row defines a claim kind whose lifecycle (create, claim, revoke, expire) is executed by a BaseIdentityClaimDriver plugin resolved at runtime from DriverClass via ClassFactory.` })
52282
+ export class MJIdentityClaimType_ {
52283
+ @Field()
52284
+ @MaxLength(36)
52285
+ ID: string;
52286
+
52287
+ @Field({description: `Unique name identifying this claim type (e.g., "EntitlementGrant", "PersonAccountLink", "OrgInvite").`})
52288
+ @MaxLength(100)
52289
+ Name: string;
52290
+
52291
+ @Field({nullable: true, description: `Optional description explaining the intent and behavior of this claim type.`})
52292
+ Description?: string;
52293
+
52294
+ @Field({description: `Plugin class name implementing BaseIdentityClaimDriver, registered via @RegisterClass(BaseIdentityClaimDriver, DriverClass) and resolved at runtime.`})
52295
+ @MaxLength(255)
52296
+ DriverClass: string;
52297
+
52298
+ @Field({nullable: true, description: `JSON configuration specific to this claim type driver.`})
52299
+ Configuration?: string;
52300
+
52301
+ @Field(() => Int, {description: `Default lifespan in days for claims of this type before they expire automatically.`})
52302
+ DefaultExpirationDays: number;
52303
+
52304
+ @Field(() => Boolean, {description: `Whether this claim type is active and available for issuing new claims.`})
52305
+ IsActive: boolean;
52306
+
52307
+ @Field()
52308
+ _mj__CreatedAt: Date;
52309
+
52310
+ @Field()
52311
+ _mj__UpdatedAt: Date;
52312
+
52313
+ }
52314
+
52315
+ //****************************************************************************
52316
+ // INPUT TYPE for MJ: Identity Claim Types
52317
+ //****************************************************************************
52318
+ @InputType()
52319
+ export class CreateMJIdentityClaimTypeInput {
52320
+ @Field({ nullable: true })
52321
+ ID?: string;
52322
+
52323
+ @Field({ nullable: true })
52324
+ Name?: string;
52325
+
52326
+ @Field({ nullable: true })
52327
+ Description: string | null;
52328
+
52329
+ @Field({ nullable: true })
52330
+ DriverClass?: string;
52331
+
52332
+ @Field({ nullable: true })
52333
+ Configuration: string | null;
52334
+
52335
+ @Field(() => Int, { nullable: true })
52336
+ DefaultExpirationDays?: number;
52337
+
52338
+ @Field(() => Boolean, { nullable: true })
52339
+ IsActive?: boolean;
52340
+
52341
+ @Field(() => RestoreContextInput, { nullable: true })
52342
+ RestoreContext___?: RestoreContextInput;
52343
+ }
52344
+
52345
+
52346
+ //****************************************************************************
52347
+ // INPUT TYPE for MJ: Identity Claim Types
52348
+ //****************************************************************************
52349
+ @InputType()
52350
+ export class UpdateMJIdentityClaimTypeInput {
52351
+ @Field()
52352
+ ID: string;
52353
+
52354
+ @Field({ nullable: true })
52355
+ Name?: string;
52356
+
52357
+ @Field({ nullable: true })
52358
+ Description?: string | null;
52359
+
52360
+ @Field({ nullable: true })
52361
+ DriverClass?: string;
52362
+
52363
+ @Field({ nullable: true })
52364
+ Configuration?: string | null;
52365
+
52366
+ @Field(() => Int, { nullable: true })
52367
+ DefaultExpirationDays?: number;
52368
+
52369
+ @Field(() => Boolean, { nullable: true })
52370
+ IsActive?: boolean;
52371
+
52372
+ @Field(() => [KeyValuePairInput], { nullable: true })
52373
+ OldValues___?: KeyValuePairInput[];
52374
+
52375
+ @Field(() => RestoreContextInput, { nullable: true })
52376
+ RestoreContext___?: RestoreContextInput;
52377
+ }
52378
+
52379
+ //****************************************************************************
52380
+ // RESOLVER for MJ: Identity Claim Types
52381
+ //****************************************************************************
52382
+ @ObjectType()
52383
+ export class RunMJIdentityClaimTypeViewResult {
52384
+ @Field(() => [MJIdentityClaimType_])
52385
+ Results: MJIdentityClaimType_[];
52386
+
52387
+ @Field(() => String, {nullable: true})
52388
+ UserViewRunID?: string;
52389
+
52390
+ @Field(() => Int, {nullable: true})
52391
+ RowCount: number;
52392
+
52393
+ @Field(() => Int, {nullable: true})
52394
+ TotalRowCount: number;
52395
+
52396
+ @Field(() => Int, {nullable: true})
52397
+ ExecutionTime: number;
52398
+
52399
+ @Field({nullable: true})
52400
+ ErrorMessage?: string;
52401
+
52402
+ @Field(() => Boolean, {nullable: false})
52403
+ Success: boolean;
52404
+ }
52405
+
52406
+ @Resolver(MJIdentityClaimType_)
52407
+ export class MJIdentityClaimTypeResolver extends ResolverBase {
52408
+ @Query(() => RunMJIdentityClaimTypeViewResult)
52409
+ async RunMJIdentityClaimTypeViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
52410
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
52411
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
52412
+ }
52413
+
52414
+ @Query(() => RunMJIdentityClaimTypeViewResult)
52415
+ async RunMJIdentityClaimTypeViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
52416
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
52417
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
52418
+ }
52419
+
52420
+ @Query(() => RunMJIdentityClaimTypeViewResult)
52421
+ async RunMJIdentityClaimTypeDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
52422
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
52423
+ input.EntityName = 'MJ: Identity Claim Types';
52424
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
52425
+ }
52426
+ @Query(() => MJIdentityClaimType_, { nullable: true })
52427
+ async MJIdentityClaimType(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJIdentityClaimType_ | null> {
52428
+ this.CheckUserReadPermissions('MJ: Identity Claim Types', userPayload);
52429
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
52430
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwIdentityClaimTypes')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Identity Claim Types', userPayload, EntityPermissionType.Read, 'AND');
52431
+ const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
52432
+ const result = await this.MapFieldNamesToCodeNames('MJ: Identity Claim Types', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
52433
+ return result;
52434
+ }
52435
+
52436
+ @Mutation(() => MJIdentityClaimType_)
52437
+ async CreateMJIdentityClaimType(
52438
+ @Arg('input', () => CreateMJIdentityClaimTypeInput) input: CreateMJIdentityClaimTypeInput,
52439
+ @Ctx() { providers, userPayload }: AppContext,
52440
+ @PubSub() pubSub: PubSubEngine
52441
+ ) {
52442
+ const provider = GetReadWriteProvider(providers);
52443
+ return this.CreateRecord('MJ: Identity Claim Types', input, provider, userPayload, pubSub)
52444
+ }
52445
+
52446
+ @Mutation(() => MJIdentityClaimType_)
52447
+ async UpdateMJIdentityClaimType(
52448
+ @Arg('input', () => UpdateMJIdentityClaimTypeInput) input: UpdateMJIdentityClaimTypeInput,
52449
+ @Ctx() { providers, userPayload }: AppContext,
52450
+ @PubSub() pubSub: PubSubEngine
52451
+ ) {
52452
+ const provider = GetReadWriteProvider(providers);
52453
+ return this.UpdateRecord('MJ: Identity Claim Types', input, provider, userPayload, pubSub);
52454
+ }
52455
+
52456
+ @Mutation(() => MJIdentityClaimType_)
52457
+ async DeleteMJIdentityClaimType(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
52458
+ const provider = GetReadWriteProvider(providers);
52459
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
52460
+ return this.DeleteRecord('MJ: Identity Claim Types', key, options, provider, userPayload, pubSub);
52461
+ }
52462
+
52463
+ }
52464
+
52465
+ //****************************************************************************
52466
+ // ENTITY CLASS for MJ: Identity Claims
52467
+ //****************************************************************************
52468
+ @ObjectType({ description: `Records of pending, claimed, or expired identity claims addressed to an email address. Facilitates cross-system entitlement claiming, account linking, and invite verification.` })
52469
+ export class MJIdentityClaim_ {
52470
+ @Field()
52471
+ @MaxLength(36)
52472
+ ID: string;
52473
+
52474
+ @Field({description: `Foreign key linking this claim to its IdentityClaimType definition.`})
52475
+ @MaxLength(36)
52476
+ ClaimTypeID: string;
52477
+
52478
+ @Field({description: `Normalized lowercase email address of the intended claimant.`})
52479
+ @MaxLength(255)
52480
+ NormalizedEmail: string;
52481
+
52482
+ @Field({nullable: true, description: `Optional polymorphic foreign key to the Entity representing the resource being claimed.`})
52483
+ @MaxLength(36)
52484
+ EntityID?: string;
52485
+
52486
+ @Field({nullable: true, description: `Optional primary key / record ID of the specific entity record being claimed.`})
52487
+ @MaxLength(255)
52488
+ RecordID?: string;
52489
+
52490
+ @Field({nullable: true, description: `Optional payload JSON containing custom data or parameters consumed by the claim type driver during redemption.`})
52491
+ PayloadJSON?: string;
52492
+
52493
+ @Field({description: `Current lifecycle state of the claim: Pending, Claimed, Expired, or Revoked.`})
52494
+ @MaxLength(20)
52495
+ Status: string;
52496
+
52497
+ @Field({description: `Timestamp after which this claim can no longer be redeemed.`})
52498
+ ExpiresAt: Date;
52499
+
52500
+ @Field({nullable: true, description: `Timestamp when the claim was successfully redeemed.`})
52501
+ ClaimedAt?: Date;
52502
+
52503
+ @Field({nullable: true, description: `User ID of the authenticated user who successfully claimed this record.`})
52504
+ @MaxLength(36)
52505
+ ClaimedByUserID?: string;
52506
+
52507
+ @Field({nullable: true, description: `Optional link to a MagicLinkInvite record for email ownership verification links.`})
52508
+ @MaxLength(36)
52509
+ MagicLinkInviteID?: string;
52510
+
52511
+ @Field({nullable: true, description: `Optional metadata JSON for auditing or tracking client provenance.`})
52512
+ MetadataJSON?: string;
52513
+
52514
+ @Field()
52515
+ _mj__CreatedAt: Date;
52516
+
52517
+ @Field()
52518
+ _mj__UpdatedAt: Date;
52519
+
52520
+ @Field()
52521
+ @MaxLength(100)
52522
+ ClaimType: string;
52523
+
52524
+ @Field({nullable: true})
52525
+ @MaxLength(255)
52526
+ Entity?: string;
52527
+
52528
+ @Field({nullable: true})
52529
+ @MaxLength(100)
52530
+ ClaimedByUser?: string;
52531
+
52532
+ }
52533
+
52534
+ //****************************************************************************
52535
+ // INPUT TYPE for MJ: Identity Claims
52536
+ //****************************************************************************
52537
+ @InputType()
52538
+ export class CreateMJIdentityClaimInput {
52539
+ @Field({ nullable: true })
52540
+ ID?: string;
52541
+
52542
+ @Field({ nullable: true })
52543
+ ClaimTypeID?: string;
52544
+
52545
+ @Field({ nullable: true })
52546
+ NormalizedEmail?: string;
52547
+
52548
+ @Field({ nullable: true })
52549
+ EntityID: string | null;
52550
+
52551
+ @Field({ nullable: true })
52552
+ RecordID: string | null;
52553
+
52554
+ @Field({ nullable: true })
52555
+ PayloadJSON: string | null;
52556
+
52557
+ @Field({ nullable: true })
52558
+ Status?: string;
52559
+
52560
+ @Field({ nullable: true })
52561
+ ExpiresAt?: Date;
52562
+
52563
+ @Field({ nullable: true })
52564
+ ClaimedAt: Date | null;
52565
+
52566
+ @Field({ nullable: true })
52567
+ ClaimedByUserID: string | null;
52568
+
52569
+ @Field({ nullable: true })
52570
+ MagicLinkInviteID: string | null;
52571
+
52572
+ @Field({ nullable: true })
52573
+ MetadataJSON: string | null;
52574
+
52575
+ @Field(() => RestoreContextInput, { nullable: true })
52576
+ RestoreContext___?: RestoreContextInput;
52577
+ }
52578
+
52579
+
52580
+ //****************************************************************************
52581
+ // INPUT TYPE for MJ: Identity Claims
52582
+ //****************************************************************************
52583
+ @InputType()
52584
+ export class UpdateMJIdentityClaimInput {
52585
+ @Field()
52586
+ ID: string;
52587
+
52588
+ @Field({ nullable: true })
52589
+ ClaimTypeID?: string;
52590
+
52591
+ @Field({ nullable: true })
52592
+ NormalizedEmail?: string;
52593
+
52594
+ @Field({ nullable: true })
52595
+ EntityID?: string | null;
52596
+
52597
+ @Field({ nullable: true })
52598
+ RecordID?: string | null;
52599
+
52600
+ @Field({ nullable: true })
52601
+ PayloadJSON?: string | null;
52602
+
52603
+ @Field({ nullable: true })
52604
+ Status?: string;
52605
+
52606
+ @Field({ nullable: true })
52607
+ ExpiresAt?: Date;
52608
+
52609
+ @Field({ nullable: true })
52610
+ ClaimedAt?: Date | null;
52611
+
52612
+ @Field({ nullable: true })
52613
+ ClaimedByUserID?: string | null;
52614
+
52615
+ @Field({ nullable: true })
52616
+ MagicLinkInviteID?: string | null;
52617
+
52618
+ @Field({ nullable: true })
52619
+ MetadataJSON?: string | null;
52620
+
52621
+ @Field(() => [KeyValuePairInput], { nullable: true })
52622
+ OldValues___?: KeyValuePairInput[];
52623
+
52624
+ @Field(() => RestoreContextInput, { nullable: true })
52625
+ RestoreContext___?: RestoreContextInput;
52626
+ }
52627
+
52628
+ //****************************************************************************
52629
+ // RESOLVER for MJ: Identity Claims
52630
+ //****************************************************************************
52631
+ @ObjectType()
52632
+ export class RunMJIdentityClaimViewResult {
52633
+ @Field(() => [MJIdentityClaim_])
52634
+ Results: MJIdentityClaim_[];
52635
+
52636
+ @Field(() => String, {nullable: true})
52637
+ UserViewRunID?: string;
52638
+
52639
+ @Field(() => Int, {nullable: true})
52640
+ RowCount: number;
52641
+
52642
+ @Field(() => Int, {nullable: true})
52643
+ TotalRowCount: number;
52644
+
52645
+ @Field(() => Int, {nullable: true})
52646
+ ExecutionTime: number;
52647
+
52648
+ @Field({nullable: true})
52649
+ ErrorMessage?: string;
52650
+
52651
+ @Field(() => Boolean, {nullable: false})
52652
+ Success: boolean;
52653
+ }
52654
+
52655
+ @Resolver(MJIdentityClaim_)
52656
+ export class MJIdentityClaimResolver extends ResolverBase {
52657
+ @Query(() => RunMJIdentityClaimViewResult)
52658
+ async RunMJIdentityClaimViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
52659
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
52660
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
52661
+ }
52662
+
52663
+ @Query(() => RunMJIdentityClaimViewResult)
52664
+ async RunMJIdentityClaimViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
52665
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
52666
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
52667
+ }
52668
+
52669
+ @Query(() => RunMJIdentityClaimViewResult)
52670
+ async RunMJIdentityClaimDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
52671
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
52672
+ input.EntityName = 'MJ: Identity Claims';
52673
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
52674
+ }
52675
+ @Query(() => MJIdentityClaim_, { nullable: true })
52676
+ async MJIdentityClaim(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJIdentityClaim_ | null> {
52677
+ this.CheckUserReadPermissions('MJ: Identity Claims', userPayload);
52678
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
52679
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwIdentityClaims')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Identity Claims', userPayload, EntityPermissionType.Read, 'AND');
52680
+ const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
52681
+ const result = await this.MapFieldNamesToCodeNames('MJ: Identity Claims', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
52682
+ return result;
52683
+ }
52684
+
52685
+ @Mutation(() => MJIdentityClaim_)
52686
+ async CreateMJIdentityClaim(
52687
+ @Arg('input', () => CreateMJIdentityClaimInput) input: CreateMJIdentityClaimInput,
52688
+ @Ctx() { providers, userPayload }: AppContext,
52689
+ @PubSub() pubSub: PubSubEngine
52690
+ ) {
52691
+ const provider = GetReadWriteProvider(providers);
52692
+ return this.CreateRecord('MJ: Identity Claims', input, provider, userPayload, pubSub)
52693
+ }
52694
+
52695
+ @Mutation(() => MJIdentityClaim_)
52696
+ async UpdateMJIdentityClaim(
52697
+ @Arg('input', () => UpdateMJIdentityClaimInput) input: UpdateMJIdentityClaimInput,
52698
+ @Ctx() { providers, userPayload }: AppContext,
52699
+ @PubSub() pubSub: PubSubEngine
52700
+ ) {
52701
+ const provider = GetReadWriteProvider(providers);
52702
+ return this.UpdateRecord('MJ: Identity Claims', input, provider, userPayload, pubSub);
52703
+ }
52704
+
52705
+ @Mutation(() => MJIdentityClaim_)
52706
+ async DeleteMJIdentityClaim(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
52707
+ const provider = GetReadWriteProvider(providers);
52708
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
52709
+ return this.DeleteRecord('MJ: Identity Claims', key, options, provider, userPayload, pubSub);
52710
+ }
52711
+
52712
+ }
52713
+
52278
52714
  //****************************************************************************
52279
52715
  // ENTITY CLASS for MJ: Instance Configurations
52280
52716
  //****************************************************************************
@@ -31,7 +31,7 @@ import { httpTransport, CloudEvent, emitterFor } from 'cloudevents';
31
31
  import { RunViewGenericParams, UserPayload } from '../types.js';
32
32
  import { RunDynamicViewInput, RunViewByIDInput, RunViewByNameInput } from './RunViewResolver.js';
33
33
  import { DeleteOptionsInput } from './DeleteOptionsInput.js';
34
- import { MJEvent, MJEventType, MJGlobal, ENCRYPTED_SENTINEL, IsValueEncrypted, IsOnlyTimezoneShift } from '@memberjunction/global';
34
+ import { MJEvent, MJEventType, MJGlobal, ENCRYPTED_SENTINEL, EscapeSQLString, IsValueEncrypted, IsOnlyTimezoneShift } from '@memberjunction/global';
35
35
  import { EncryptionEngine } from '@memberjunction/encryption';
36
36
  import { PUSH_STATUS_UPDATES_TOPIC, publishStatusUpdate } from './PushStatusResolver.js';
37
37
  import { CACHE_INVALIDATION_TOPIC } from './CacheInvalidationResolver.js';
@@ -341,6 +341,58 @@ export class ResolverBase {
341
341
  return dataObjectArray;
342
342
  }
343
343
 
344
+ /**
345
+ * Renders one `findBy` predicate value as the SQL literal text it will become inside the
346
+ * `ExtraFilter` that method builds.
347
+ *
348
+ * The two slots have different exposure, so they are handled differently:
349
+ *
350
+ * - **Quoted slot** (`NeedsQuotes` — every type except Number and Boolean). The value sits
351
+ * inside a single-quoted literal, so it is escaped with `EscapeSQLString`: quotes are
352
+ * doubled and null bytes stripped, leaving the payload inert *inside* the literal.
353
+ * - **Unquoted slot** (Number and Boolean fields). There is no literal to break out of
354
+ * here — the value lands in the clause bare, so a string value simply *is* SQL and no
355
+ * amount of quote escaping helps. Only a genuine number or boolean is accepted; anything
356
+ * else is refused rather than interpolated. Numeric and boolean strings are accepted too
357
+ * (a client may legitimately send `"42"`), since neither can carry SQL.
358
+ *
359
+ * A `null`/`undefined` value is refused in either slot. `EscapeSQLString` maps both to `''`
360
+ * by design, which would silently turn a by-value lookup into `Field = ''` — for this
361
+ * caller a missing value is a bug, not a query.
362
+ *
363
+ * @param value the raw value supplied for the field
364
+ * @param fieldName field name, for the error message
365
+ * @param entity entity name, for the error message
366
+ * @param needsQuotes whether the field's type requires a quoted literal
367
+ * @returns the literal text (including quotes when the slot is quoted)
368
+ * @throws when the value cannot be rendered safely for the slot it is destined for
369
+ */
370
+ private formatFilterValue(value: unknown, fieldName: string, entity: string, needsQuotes: boolean): string {
371
+ if (value === null || value === undefined) {
372
+ throw new Error(
373
+ `Field ${fieldName} in entity ${entity} was given a ${value === null ? 'null' : 'undefined'} value. findBy builds an equality predicate, which needs a value to compare against.`
374
+ );
375
+ }
376
+
377
+ if (needsQuotes) {
378
+ return `'${EscapeSQLString(String(value))}'`;
379
+ }
380
+
381
+ // Unquoted slot — accept only what cannot carry SQL, and render it exactly as before.
382
+ if (typeof value === 'boolean' || (typeof value === 'number' && Number.isFinite(value))) {
383
+ return String(value);
384
+ }
385
+ if (typeof value === 'string') {
386
+ const trimmed = value.trim();
387
+ if (/^-?\d+(\.\d+)?$/.test(trimmed)) return trimmed;
388
+ if (/^(true|false)$/i.test(trimmed)) return trimmed.toLowerCase();
389
+ }
390
+
391
+ throw new Error(
392
+ `Field ${fieldName} in entity ${entity} is a numeric or boolean field, so its value is not quoted in the filter — only a number or boolean can be used. Received: ${typeof value}.`
393
+ );
394
+ }
395
+
344
396
  protected async findBy<T = any>(provider: DatabaseProviderBase, entity: string, params: any, contextUser: UserInfo): Promise<Array<T>> {
345
397
  // build the SQL query based on the params passed in
346
398
  const rv = provider as any as IRunViewProvider;
@@ -354,8 +406,7 @@ export class ResolverBase {
354
406
  // look up the field in the entityInfo to see if it needs quotes
355
407
  const field = e.Fields.find((f) => f.Name === k);
356
408
  if (!field) throw new Error(`Field ${k} not found in entity ${entity}`);
357
- const quotes = field.NeedsQuotes ? "'" : '';
358
- extraFilter += `${k} = ${quotes}${params[k]}${quotes}`;
409
+ extraFilter += `${k} = ${this.formatFilterValue(params[k], k, entity, field.NeedsQuotes)}`;
359
410
  });
360
411
 
361
412
  // ok, now we have a SQL string, run it and return the results
@@ -382,7 +433,8 @@ export class ResolverBase {
382
433
  const rv = provider as any as IRunViewProvider;
383
434
  const result = await rv.RunView<MJUserViewEntityExtended>({
384
435
  EntityName: 'MJ: User Views',
385
- ExtraFilter: "Name='" + viewInput.ViewName + "'",
436
+ // SECURITY: the view name is client-supplied and lands inside a SQL literal.
437
+ ExtraFilter: "Name='" + EscapeSQLString(viewInput.ViewName) + "'",
386
438
  }, userPayload.userRecord);
387
439
  if (result && result.Success && result.Results.length > 0) {
388
440
  const viewInfo = result.Results[0];
package/src/index.ts CHANGED
@@ -9,7 +9,7 @@ import { UserCache, resolveDbPlatformFromEnv } from '@memberjunction/generic-dat
9
9
  import { MJGlobal, MJEventType, UUIDsEqual, ShutdownRegistry } from '@memberjunction/global';
10
10
  import { setupSQLServerClient, SQLServerDataProvider, SQLServerProviderConfigData } from '@memberjunction/sqlserver-dataprovider';
11
11
  import { extendConnectionPoolWithQuery } from './util.js';
12
- import { registerIntegrationCustomColumnPromoter } from './integration/CustomColumnPromoter.js';
12
+ import { registerIntegrationCustomColumnPromoter, IntegrationCustomColumnPromoter } from './integration/CustomColumnPromoter.js';
13
13
  import { DisableUnselectedEntityMaps, ReenableFieldMapsForEntityMap } from './integration/EntityMapLifecycle.js';
14
14
  import { default as BodyParser } from 'body-parser';
15
15
  import compression from 'compression'; // Add compression middleware
@@ -145,6 +145,7 @@ export * from './resolvers/RunClusterAnalysisResolver.js';
145
145
  export * from './resolvers/GenerateSeedTaxonomyResolver.js';
146
146
  export * from './resolvers/PipelineProgressResolver.js';
147
147
  export * from './resolvers/IntegrationProgressResolver.js';
148
+ export * from './resolvers/IdentityClaimRedemptionResolver.js';
148
149
  export * from './resolvers/ClientToolRequestResolver.js';
149
150
  export * from './resolvers/AutotagPipelineResolver.js';
150
151
  export * from './resolvers/TagGovernanceResolver.js';
@@ -1594,6 +1595,49 @@ const RSU_PENDING_WORK_STALE_MINUTES = 30;
1594
1595
  * starts sync, and marks each row Completed only AFTER its work actually succeeded —
1595
1596
  * so a crash mid-processing leaves the row Pending and re-processable on the next boot.
1596
1597
  */
1598
+ /**
1599
+ * Complete a custom-column promotion whose DDL landed before the restart.
1600
+ *
1601
+ * Promotion registers this rather than finishing inline, because the restart is what loads the
1602
+ * regenerated entity classes — so the IntegrationObjectField rows, the field maps and the
1603
+ * overflow→column spread all belong on this side of it, where the columns are real typed
1604
+ * properties rather than dynamic .Get/.Set.
1605
+ *
1606
+ * The work itself lives on the promoter, so promotion logic stays in one class.
1607
+ */
1608
+ async function ProcessPromoteColumnsPendingWork(
1609
+ // Typed structurally rather than by name: schema-engine is only reachable here through a dynamic
1610
+ // import (it is a workspace package, not published), so a static type import is not available.
1611
+ // Deriving the payload from CompletePromotion's own signature keeps the two in step regardless.
1612
+ item: { PromotedColumns?: Parameters<IntegrationCustomColumnPromoter['CompletePromotion']>[0] },
1613
+ pendingWorkID: string,
1614
+ rsm: {
1615
+ CompletePendingWork(id: string, user: unknown): Promise<unknown>;
1616
+ FailPendingWork(id: string, message: string, user: unknown): Promise<unknown>;
1617
+ },
1618
+ systemUser: ConstructorParameters<typeof IntegrationCustomColumnPromoter>[0],
1619
+ ): Promise<void> {
1620
+ const promoted = item.PromotedColumns ?? [];
1621
+ if (promoted.length === 0) {
1622
+ // Nothing to do, but the row must not linger and be retried forever.
1623
+ await rsm.CompletePendingWork(pendingWorkID, systemUser);
1624
+ console.warn('[RSU] promote-columns pending work carried no PromotedColumns — nothing to complete.');
1625
+ return;
1626
+ }
1627
+ try {
1628
+ const promoter = new IntegrationCustomColumnPromoter(systemUser);
1629
+ const columns = await promoter.CompletePromotion(promoted);
1630
+ // Completed only after the work actually succeeded: a crash before this leaves the row
1631
+ // visible and re-processable, which is the whole point of the durable queue.
1632
+ await rsm.CompletePendingWork(pendingWorkID, systemUser);
1633
+ console.log(`[RSU] promote-columns: completed ${columns.length} column(s) across ${promoted.length} entity(ies).`);
1634
+ } catch (e) {
1635
+ const msg = e instanceof Error ? e.message : String(e);
1636
+ await rsm.FailPendingWork(pendingWorkID, `promote-columns completion failed: ${msg}`, systemUser);
1637
+ console.error(`[RSU] promote-columns completion failed: ${msg}`);
1638
+ }
1639
+ }
1640
+
1597
1641
  async function processRSUPendingWork(): Promise<void> {
1598
1642
  // Dynamic import — schema-engine is not yet published to npm, only exists as a workspace package
1599
1643
  const { RuntimeSchemaManager } = await import('@memberjunction/schema-engine');
@@ -1623,6 +1667,18 @@ async function processRSUPendingWork(): Promise<void> {
1623
1667
 
1624
1668
  await Metadata.Provider.Refresh(); // global-provider-ok: server startup recovery — one-shot global cache refresh
1625
1669
 
1670
+ // Custom-column promotion registers its follow-up here rather than finishing inline, because
1671
+ // the restart is what loads the regenerated entity classes. Everything downstream of the
1672
+ // ADD COLUMN — the IntegrationObjectField rows, the field maps, the overflow spread — runs
1673
+ // now, with typed access to the columns that did not exist in the previous process.
1674
+ //
1675
+ // Absent WorkType means apply-objects: every row written before that field existed is one,
1676
+ // and the branch below must keep treating it that way.
1677
+ if (item.WorkType === 'promote-columns') {
1678
+ await ProcessPromoteColumnsPendingWork(item, pendingWorkID, rsm, systemUser);
1679
+ continue;
1680
+ }
1681
+
1626
1682
  // Resolve connector
1627
1683
  const rv = new RunView();
1628
1684
  const ciResult = await rv.RunView<MJCompanyIntegrationEntity>({