@memberjunction/server 6.2.0-edge.0 → 6.2.0-edge.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/agentSessions/ReturningVisitorRecap.d.ts +2 -0
- package/dist/agentSessions/ReturningVisitorRecap.d.ts.map +1 -1
- package/dist/agentSessions/ReturningVisitorRecap.js +5 -1
- package/dist/agentSessions/ReturningVisitorRecap.js.map +1 -1
- package/dist/agentSessions/SessionManager.js +2 -2
- package/dist/agentSessions/remoteBrowserGoalEngine.d.ts +8 -0
- package/dist/agentSessions/remoteBrowserGoalEngine.d.ts.map +1 -1
- package/dist/agentSessions/remoteBrowserGoalEngine.js +21 -5
- package/dist/agentSessions/remoteBrowserGoalEngine.js.map +1 -1
- package/dist/auth/AuthProviderCatalogRouter.d.ts +2 -0
- package/dist/auth/AuthProviderCatalogRouter.d.ts.map +1 -1
- package/dist/auth/AuthProviderCatalogRouter.js +5 -1
- package/dist/auth/AuthProviderCatalogRouter.js.map +1 -1
- package/dist/auth/index.d.ts +20 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +20 -10
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/initializeProviders.d.ts +8 -0
- package/dist/auth/initializeProviders.d.ts.map +1 -1
- package/dist/auth/initializeProviders.js +21 -5
- package/dist/auth/initializeProviders.js.map +1 -1
- package/dist/auth/magicLink/MagicLinkRouter.d.ts +9 -0
- package/dist/auth/magicLink/MagicLinkRouter.d.ts.map +1 -1
- package/dist/auth/magicLink/MagicLinkRouter.js +22 -10
- package/dist/auth/magicLink/MagicLinkRouter.js.map +1 -1
- package/dist/auth/magicLink/MagicLinkService.d.ts +17 -15
- package/dist/auth/magicLink/MagicLinkService.d.ts.map +1 -1
- package/dist/auth/magicLink/MagicLinkService.js +65 -51
- package/dist/auth/magicLink/MagicLinkService.js.map +1 -1
- package/dist/auth/magicLink/index.d.ts +2 -2
- package/dist/auth/magicLink/index.d.ts.map +1 -1
- package/dist/auth/magicLink/index.js +2 -2
- package/dist/auth/magicLink/index.js.map +1 -1
- package/dist/auth/magicLink/magicLinkCore.d.ts +54 -33
- package/dist/auth/magicLink/magicLinkCore.d.ts.map +1 -1
- package/dist/auth/magicLink/magicLinkCore.js +61 -61
- package/dist/auth/magicLink/magicLinkCore.js.map +1 -1
- package/dist/auth/magicLink/redeemLanding.d.ts +4 -0
- package/dist/auth/magicLink/redeemLanding.d.ts.map +1 -1
- package/dist/auth/magicLink/redeemLanding.js +12 -4
- package/dist/auth/magicLink/redeemLanding.js.map +1 -1
- package/dist/auth/magicLink/types.d.ts +4 -4
- package/dist/auth/principals.d.ts +2 -0
- package/dist/auth/principals.d.ts.map +1 -1
- package/dist/auth/principals.js +6 -2
- package/dist/auth/principals.js.map +1 -1
- package/dist/cache.d.ts +2 -0
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +3 -1
- package/dist/cache.js.map +1 -1
- package/dist/config.d.ts +346 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +34 -4
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts +20 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +27 -19
- package/dist/context.js.map +1 -1
- package/dist/directives/Public.d.ts +2 -0
- package/dist/directives/Public.d.ts.map +1 -1
- package/dist/directives/Public.js +3 -1
- package/dist/directives/Public.js.map +1 -1
- package/dist/directives/RequireSystemUser.d.ts +2 -0
- package/dist/directives/RequireSystemUser.d.ts.map +1 -1
- package/dist/directives/RequireSystemUser.js +3 -1
- package/dist/directives/RequireSystemUser.js.map +1 -1
- package/dist/generated/graphql-schemas/__mj.d.ts +11 -0
- package/dist/generated/graphql-schemas/__mj.d.ts.map +1 -1
- package/dist/generated/graphql-schemas/__mj.js +48 -0
- package/dist/generated/graphql-schemas/__mj.js.map +1 -1
- package/dist/generic/CacheInvalidationResolver.d.ts +94 -4
- package/dist/generic/CacheInvalidationResolver.d.ts.map +1 -1
- package/dist/generic/CacheInvalidationResolver.js +122 -3
- package/dist/generic/CacheInvalidationResolver.js.map +1 -1
- package/dist/generic/DeleteOptionsInput.d.ts +8 -1
- package/dist/generic/DeleteOptionsInput.d.ts.map +1 -1
- package/dist/generic/DeleteOptionsInput.js +1 -1
- package/dist/generic/DeleteOptionsInput.js.map +1 -1
- package/dist/generic/FireAndForgetHeartbeat.d.ts +3 -1
- package/dist/generic/FireAndForgetHeartbeat.d.ts.map +1 -1
- package/dist/generic/FireAndForgetHeartbeat.js +8 -4
- package/dist/generic/FireAndForgetHeartbeat.js.map +1 -1
- package/dist/generic/PushStatusResolver.d.ts +10 -1
- package/dist/generic/PushStatusResolver.d.ts.map +1 -1
- package/dist/generic/PushStatusResolver.js +11 -3
- package/dist/generic/PushStatusResolver.js.map +1 -1
- package/dist/generic/ResolverBase.d.ts +5 -1
- package/dist/generic/ResolverBase.d.ts.map +1 -1
- package/dist/generic/ResolverBase.js +15 -8
- package/dist/generic/ResolverBase.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -9
- package/dist/index.js.map +1 -1
- package/dist/integration/CustomColumnPromoter.d.ts +2 -0
- package/dist/integration/CustomColumnPromoter.d.ts.map +1 -1
- package/dist/integration/CustomColumnPromoter.js +5 -1
- package/dist/integration/CustomColumnPromoter.js.map +1 -1
- package/dist/integration/EntityMapLifecycle.d.ts +4 -0
- package/dist/integration/EntityMapLifecycle.d.ts.map +1 -1
- package/dist/integration/EntityMapLifecycle.js +10 -2
- package/dist/integration/EntityMapLifecycle.js.map +1 -1
- package/dist/logging/NoLog.d.ts +4 -0
- package/dist/logging/NoLog.d.ts.map +1 -1
- package/dist/logging/NoLog.js +10 -2
- package/dist/logging/NoLog.js.map +1 -1
- package/dist/logging/StartupLogger.d.ts +2 -0
- package/dist/logging/StartupLogger.d.ts.map +1 -1
- package/dist/logging/StartupLogger.js +5 -1
- package/dist/logging/StartupLogger.js.map +1 -1
- package/dist/logging/bootAudit.d.ts +11 -7
- package/dist/logging/bootAudit.d.ts.map +1 -1
- package/dist/logging/bootAudit.js +15 -7
- package/dist/logging/bootAudit.js.map +1 -1
- package/dist/logging/boundaryLogPayload.d.ts +4 -0
- package/dist/logging/boundaryLogPayload.d.ts.map +1 -1
- package/dist/logging/boundaryLogPayload.js +5 -1
- package/dist/logging/boundaryLogPayload.js.map +1 -1
- package/dist/logging/secretRedactor.d.ts +2 -0
- package/dist/logging/secretRedactor.d.ts.map +1 -1
- package/dist/logging/secretRedactor.js +8 -4
- package/dist/logging/secretRedactor.js.map +1 -1
- package/dist/logging/shortenForLog.d.ts +2 -0
- package/dist/logging/shortenForLog.d.ts.map +1 -1
- package/dist/logging/shortenForLog.js +7 -3
- package/dist/logging/shortenForLog.js.map +1 -1
- package/dist/logging/variablesLoggingMiddleware.d.ts +2 -0
- package/dist/logging/variablesLoggingMiddleware.d.ts.map +1 -1
- package/dist/logging/variablesLoggingMiddleware.js +8 -6
- package/dist/logging/variablesLoggingMiddleware.js.map +1 -1
- package/dist/metadataRefreshSignal.d.ts +19 -0
- package/dist/metadataRefreshSignal.d.ts.map +1 -0
- package/dist/metadataRefreshSignal.js +45 -0
- package/dist/metadataRefreshSignal.js.map +1 -0
- package/dist/middleware/MJTenantFilterMiddleware.js +4 -4
- package/dist/multiTenancy/index.d.ts +8 -0
- package/dist/multiTenancy/index.d.ts.map +1 -1
- package/dist/multiTenancy/index.js +21 -5
- package/dist/multiTenancy/index.js.map +1 -1
- package/dist/realtimeWidget/WidgetRouter.d.ts +5 -0
- package/dist/realtimeWidget/WidgetRouter.d.ts.map +1 -1
- package/dist/realtimeWidget/WidgetRouter.js +14 -10
- package/dist/realtimeWidget/WidgetRouter.js.map +1 -1
- package/dist/realtimeWidget/WidgetSessionService.d.ts +6 -6
- package/dist/realtimeWidget/WidgetSessionService.js +27 -27
- package/dist/realtimeWidget/host-identity.d.ts +5 -1
- package/dist/realtimeWidget/host-identity.d.ts.map +1 -1
- package/dist/realtimeWidget/host-identity.js +11 -3
- package/dist/realtimeWidget/host-identity.js.map +1 -1
- package/dist/realtimeWidget/index.d.ts +2 -2
- package/dist/realtimeWidget/index.d.ts.map +1 -1
- package/dist/realtimeWidget/index.js +2 -2
- package/dist/realtimeWidget/index.js.map +1 -1
- package/dist/realtimeWidget/visitorIdentity.d.ts +21 -1
- package/dist/realtimeWidget/visitorIdentity.d.ts.map +1 -1
- package/dist/realtimeWidget/visitorIdentity.js +16 -4
- package/dist/realtimeWidget/visitorIdentity.js.map +1 -1
- package/dist/realtimeWidget/widgetCore.d.ts +48 -0
- package/dist/realtimeWidget/widgetCore.d.ts.map +1 -1
- package/dist/realtimeWidget/widgetCore.js +38 -10
- package/dist/realtimeWidget/widgetCore.js.map +1 -1
- package/dist/realtimeWidget/widgetGuestElevation.d.ts +10 -6
- package/dist/realtimeWidget/widgetGuestElevation.d.ts.map +1 -1
- package/dist/realtimeWidget/widgetGuestElevation.js +14 -6
- package/dist/realtimeWidget/widgetGuestElevation.js.map +1 -1
- package/dist/resolvers/AdhocQueryResolver.js +3 -3
- package/dist/resolvers/FileResolver.js +3 -3
- package/dist/resolvers/GeoResolver.d.ts +2 -2
- package/dist/resolvers/GeoResolver.js +4 -4
- package/dist/resolvers/GetDataResolver.d.ts +14 -0
- package/dist/resolvers/GetDataResolver.d.ts.map +1 -1
- package/dist/resolvers/GetDataResolver.js +43 -15
- package/dist/resolvers/GetDataResolver.js.map +1 -1
- package/dist/resolvers/IntegrationDiscoveryResolver.js +2 -2
- package/dist/resolvers/ListOperationsResolver.d.ts +20 -0
- package/dist/resolvers/ListOperationsResolver.d.ts.map +1 -1
- package/dist/resolvers/ListOperationsResolver.js +68 -28
- package/dist/resolvers/ListOperationsResolver.js.map +1 -1
- package/dist/resolvers/MCPResolver.d.ts +11 -1
- package/dist/resolvers/MCPResolver.d.ts.map +1 -1
- package/dist/resolvers/MCPResolver.js +7 -3
- package/dist/resolvers/MCPResolver.js.map +1 -1
- package/dist/resolvers/RealtimeBridgeResolver.js +3 -3
- package/dist/resolvers/RealtimeClientSessionResolver.js +3 -3
- package/dist/resolvers/RemoteBrowserActionResolver.js +5 -5
- package/dist/resolvers/RunAIAgentResolver.d.ts +10 -4
- package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
- package/dist/resolvers/RunAIAgentResolver.js +69 -38
- package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
- package/dist/resolvers/RunAIPromptResolver.d.ts +1 -1
- package/dist/resolvers/RunAIPromptResolver.js +2 -2
- package/dist/resolvers/RunTestResolver.js +5 -5
- package/dist/resolvers/SqlLoggingConfigResolver.d.ts +8 -4
- package/dist/resolvers/SqlLoggingConfigResolver.d.ts.map +1 -1
- package/dist/resolvers/SqlLoggingConfigResolver.js +5 -5
- package/dist/resolvers/TaskGraphFrameResolver.d.ts +8 -1
- package/dist/resolvers/TaskGraphFrameResolver.d.ts.map +1 -1
- package/dist/resolvers/TaskGraphFrameResolver.js +6 -2
- package/dist/resolvers/TaskGraphFrameResolver.js.map +1 -1
- package/dist/resolvers/adhoc-query-helpers.d.ts +6 -0
- package/dist/resolvers/adhoc-query-helpers.d.ts.map +1 -1
- package/dist/resolvers/adhoc-query-helpers.js +10 -2
- package/dist/resolvers/adhoc-query-helpers.js.map +1 -1
- package/dist/resolvers/artifact-routing.d.ts +8 -8
- package/dist/resolvers/artifact-routing.js +2 -2
- package/dist/resolvers/artifact-routing.js.map +1 -1
- package/dist/resolvers/meetingRecordingRegistration.d.ts +10 -2
- package/dist/resolvers/meetingRecordingRegistration.d.ts.map +1 -1
- package/dist/resolvers/meetingRecordingRegistration.js +24 -8
- package/dist/resolvers/meetingRecordingRegistration.js.map +1 -1
- package/dist/resolvers/peaksSidecar.d.ts +4 -0
- package/dist/resolvers/peaksSidecar.d.ts.map +1 -1
- package/dist/resolvers/peaksSidecar.js +10 -2
- package/dist/resolvers/peaksSidecar.js.map +1 -1
- package/dist/rest/EntityCRUDHandler.d.ts +28 -0
- package/dist/rest/EntityCRUDHandler.d.ts.map +1 -1
- package/dist/rest/EntityCRUDHandler.js +20 -4
- package/dist/rest/EntityCRUDHandler.js.map +1 -1
- package/dist/rest/MediaStreamHandler.d.ts +2 -0
- package/dist/rest/MediaStreamHandler.d.ts.map +1 -1
- package/dist/rest/MediaStreamHandler.js +10 -6
- package/dist/rest/MediaStreamHandler.js.map +1 -1
- package/dist/rest/OAuthCallbackHandler.d.ts +9 -0
- package/dist/rest/OAuthCallbackHandler.d.ts.map +1 -1
- package/dist/rest/OAuthCallbackHandler.js +15 -3
- package/dist/rest/OAuthCallbackHandler.js.map +1 -1
- package/dist/rest/RESTEndpointHandler.d.ts +6 -4
- package/dist/rest/RESTEndpointHandler.d.ts.map +1 -1
- package/dist/rest/RESTEndpointHandler.js +15 -11
- package/dist/rest/RESTEndpointHandler.js.map +1 -1
- package/dist/rest/RealtimeSdpBrokerHandler.d.ts +5 -1
- package/dist/rest/RealtimeSdpBrokerHandler.d.ts.map +1 -1
- package/dist/rest/RealtimeSdpBrokerHandler.js +12 -4
- package/dist/rest/RealtimeSdpBrokerHandler.js.map +1 -1
- package/dist/rest/SignatureWebhookHandler.d.ts +2 -0
- package/dist/rest/SignatureWebhookHandler.d.ts.map +1 -1
- package/dist/rest/SignatureWebhookHandler.js +5 -1
- package/dist/rest/SignatureWebhookHandler.js.map +1 -1
- package/dist/rest/UploadTokenManager.d.ts +24 -8
- package/dist/rest/UploadTokenManager.d.ts.map +1 -1
- package/dist/rest/UploadTokenManager.js +53 -21
- package/dist/rest/UploadTokenManager.js.map +1 -1
- package/dist/rest/ViewOperationsHandler.d.ts +20 -0
- package/dist/rest/ViewOperationsHandler.d.ts.map +1 -1
- package/dist/rest/ViewOperationsHandler.js +20 -4
- package/dist/rest/ViewOperationsHandler.js.map +1 -1
- package/dist/rest/mediaRange.d.ts +4 -0
- package/dist/rest/mediaRange.d.ts.map +1 -1
- package/dist/rest/mediaRange.js +10 -2
- package/dist/rest/mediaRange.js.map +1 -1
- package/dist/rest/setupRESTEndpoints.d.ts +4 -0
- package/dist/rest/setupRESTEndpoints.d.ts.map +1 -1
- package/dist/rest/setupRESTEndpoints.js +13 -7
- package/dist/rest/setupRESTEndpoints.js.map +1 -1
- package/dist/serverExtensionReservedRoots.d.ts +2 -0
- package/dist/serverExtensionReservedRoots.d.ts.map +1 -1
- package/dist/serverExtensionReservedRoots.js +5 -1
- package/dist/serverExtensionReservedRoots.js.map +1 -1
- package/dist/services/TaskGraphActionRunner.d.ts +13 -8
- package/dist/services/TaskGraphActionRunner.d.ts.map +1 -1
- package/dist/services/TaskGraphActionRunner.js +16 -15
- package/dist/services/TaskGraphActionRunner.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +7 -3
- package/dist/types.js.map +1 -1
- package/dist/util.d.ts +6 -0
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +13 -5
- package/dist/util.js.map +1 -1
- package/package.json +92 -92
- package/src/__tests__/DeleteOptionsInput.wireShape.test.ts +62 -0
- package/src/__tests__/FileResolverPeaks.test.ts +13 -13
- package/src/__tests__/ListOperationsResolver.test.ts +17 -17
- package/src/__tests__/MediaStreamHandler.test.ts +28 -28
- package/src/__tests__/NoLog.test.ts +11 -11
- package/src/__tests__/PrimaryKeyAlwaysMapped.test.ts +10 -10
- package/src/__tests__/RESTEndpointHandler.test.ts +14 -14
- package/src/__tests__/RealtimeBridgeResolver.test.ts +4 -2
- package/src/__tests__/RealtimeSdpBrokerHandler.test.ts +6 -6
- package/src/__tests__/RefreshAdoptsNewColumns.test.ts +8 -8
- package/src/__tests__/RemoteBrowserGoalEngine.test.ts +18 -18
- package/src/__tests__/RunAIAgentResolver.historyFrom.test.ts +228 -0
- package/src/__tests__/TaskGraphActionRunner.durablePayload.test.ts +129 -0
- package/src/__tests__/TaskGraphFrameResolver.test.ts +2 -2
- package/src/__tests__/WidgetSessionService.test.ts +8 -4
- package/src/__tests__/adhoc-query-helpers.test.ts +21 -21
- package/src/__tests__/bootAudit.test.ts +11 -11
- package/src/__tests__/boundaryLogPayload.test.ts +6 -6
- package/src/__tests__/cacheInvalidationRecordData.test.ts +177 -0
- package/src/__tests__/databaseAbstraction.test.ts +12 -6
- package/src/__tests__/getDataTokenRedaction.test.ts +7 -7
- package/src/__tests__/initializeProviders.refresh.test.ts +4 -4
- package/src/__tests__/magicLink.test.ts +73 -134
- package/src/__tests__/magicLinkService.consume.test.ts +224 -0
- package/src/__tests__/meetingRecordingRegistration.test.ts +12 -12
- package/src/__tests__/metadataRefreshSignal.test.ts +78 -0
- package/src/__tests__/multiTenancy.security.test.ts +40 -40
- package/src/__tests__/multiTenancy.test.ts +18 -18
- package/src/__tests__/newUsers.test.ts +24 -23
- package/src/__tests__/principals.test.ts +22 -22
- package/src/__tests__/pushStatusResolver.filter.test.ts +8 -8
- package/src/__tests__/secretRedactor.failOpen.test.ts +12 -12
- package/src/__tests__/secretRedactor.test.ts +12 -12
- package/src/__tests__/serverExtensionReservedRoots.test.ts +7 -7
- package/src/__tests__/subscriptionRedaction.test.ts +5 -5
- package/src/__tests__/unifiedAuth.test.ts +15 -9
- package/src/__tests__/visitorIdentity.resolve.test.ts +6 -6
- package/src/__tests__/widget.test.ts +45 -45
- package/src/__tests__/widgetGuestElevation.test.ts +7 -7
- package/src/__tests__/widgetHostIdentity.test.ts +14 -14
- package/src/agentSessions/ReturningVisitorRecap.ts +12 -1
- package/src/agentSessions/SessionManager.ts +2 -2
- package/src/agentSessions/remoteBrowserGoalEngine.ts +30 -5
- package/src/auth/AuthProviderCatalogRouter.ts +6 -1
- package/src/auth/__tests__/backward-compatibility.test.ts +3 -3
- package/src/auth/index.ts +43 -28
- package/src/auth/initializeProviders.ts +25 -5
- package/src/auth/magicLink/MagicLinkRouter.ts +28 -10
- package/src/auth/magicLink/MagicLinkService.ts +71 -52
- package/src/auth/magicLink/index.ts +7 -7
- package/src/auth/magicLink/magicLinkCore.ts +96 -64
- package/src/auth/magicLink/redeemLanding.ts +14 -4
- package/src/auth/magicLink/types.ts +54 -54
- package/src/auth/newUsers.ts +1 -1
- package/src/auth/principals.ts +11 -2
- package/src/cache.ts +4 -1
- package/src/config.ts +37 -4
- package/src/context.ts +37 -24
- package/src/directives/Public.ts +4 -1
- package/src/directives/RequireSystemUser.ts +4 -1
- package/src/generated/graphql-schemas/__mj.ts +37 -0
- package/src/generic/CacheInvalidationResolver.ts +148 -4
- package/src/generic/DeleteOptionsInput.ts +9 -2
- package/src/generic/FireAndForgetHeartbeat.ts +19 -14
- package/src/generic/PushStatusResolver.ts +21 -7
- package/src/generic/ResolverBase.ts +16 -8
- package/src/generic/RunViewResolver.ts +22 -22
- package/src/generic/__tests__/FireAndForgetHeartbeat.test.ts +7 -7
- package/src/index.ts +35 -9
- package/src/integration/CustomColumnPromoter.ts +6 -1
- package/src/integration/EntityMapLifecycle.ts +20 -2
- package/src/logging/NoLog.ts +16 -2
- package/src/logging/StartupLogger.ts +6 -1
- package/src/logging/bootAudit.ts +26 -16
- package/src/logging/boundaryLogPayload.ts +8 -1
- package/src/logging/secretRedactor.ts +14 -9
- package/src/logging/shortenForLog.ts +8 -3
- package/src/logging/variablesLoggingMiddleware.ts +9 -6
- package/src/metadataRefreshSignal.ts +45 -0
- package/src/middleware/MJTenantFilterMiddleware.ts +4 -4
- package/src/multiTenancy/index.ts +29 -5
- package/src/realtimeWidget/WidgetRouter.ts +15 -10
- package/src/realtimeWidget/WidgetSessionService.ts +76 -76
- package/src/realtimeWidget/host-identity.ts +24 -10
- package/src/realtimeWidget/index.ts +3 -3
- package/src/realtimeWidget/visitorIdentity.ts +39 -8
- package/src/realtimeWidget/widgetCore.ts +75 -10
- package/src/realtimeWidget/widgetGuestElevation.ts +25 -12
- package/src/resolvers/AdhocQueryResolver.ts +3 -3
- package/src/resolvers/AgentSessionResolver.ts +3 -3
- package/src/resolvers/ColorResolver.ts +6 -6
- package/src/resolvers/ComponentRegistryResolver.ts +36 -36
- package/src/resolvers/EntityCommunicationsResolver.ts +4 -4
- package/src/resolvers/ExecuteRemoteOperationResolver.ts +9 -9
- package/src/resolvers/FileResolver.ts +42 -42
- package/src/resolvers/GeoResolver.ts +4 -4
- package/src/resolvers/GetDataResolver.ts +50 -15
- package/src/resolvers/IntegrationDiscoveryResolver.ts +2 -2
- package/src/resolvers/ListOperationsResolver.ts +78 -28
- package/src/resolvers/MCPResolver.ts +30 -15
- package/src/resolvers/QueryResolver.ts +13 -13
- package/src/resolvers/RealtimeBridgeResolver.ts +3 -3
- package/src/resolvers/RealtimeClientSessionResolver.ts +3 -3
- package/src/resolvers/RemoteBrowserActionResolver.ts +5 -5
- package/src/resolvers/RunAIAgentResolver.ts +113 -72
- package/src/resolvers/RunAIPromptResolver.ts +22 -22
- package/src/resolvers/RunTemplateResolver.ts +4 -4
- package/src/resolvers/RunTestResolver.ts +25 -25
- package/src/resolvers/SqlLoggingConfigResolver.ts +56 -56
- package/src/resolvers/TaskGraphFrameResolver.ts +37 -28
- package/src/resolvers/TelemetryResolver.ts +79 -79
- package/src/resolvers/__tests__/GetDataResolver.tokens.test.ts +40 -38
- package/src/resolvers/__tests__/artifact-routing.test.ts +23 -23
- package/src/resolvers/adhoc-query-helpers.ts +19 -2
- package/src/resolvers/artifact-routing.ts +19 -19
- package/src/resolvers/meetingRecordingRegistration.ts +44 -10
- package/src/resolvers/peaksSidecar.ts +12 -2
- package/src/rest/EntityCRUDHandler.ts +24 -4
- package/src/rest/MediaStreamHandler.ts +11 -6
- package/src/rest/OAuthCallbackHandler.ts +25 -7
- package/src/rest/RESTEndpointHandler.ts +20 -15
- package/src/rest/RealtimeSdpBrokerHandler.ts +14 -4
- package/src/rest/SignatureWebhookHandler.ts +6 -1
- package/src/rest/UploadTokenManager.ts +66 -30
- package/src/rest/ViewOperationsHandler.ts +24 -4
- package/src/rest/mediaRange.ts +16 -6
- package/src/rest/setupRESTEndpoints.ts +24 -12
- package/src/serverExtensionReservedRoots.ts +6 -1
- package/src/services/TaskGraphActionRunner.ts +16 -15
- package/src/types.ts +21 -16
- package/src/util.ts +16 -6
|
@@ -45,13 +45,13 @@ export class AggregateExpressionInput {
|
|
|
45
45
|
@Field(() => String, {
|
|
46
46
|
description: 'SQL expression for the aggregate (e.g., "SUM(OrderTotal)", "COUNT(*)", "AVG(Price)")'
|
|
47
47
|
})
|
|
48
|
-
expression: string;
|
|
48
|
+
expression: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
49
49
|
|
|
50
50
|
@Field(() => String, {
|
|
51
51
|
nullable: true,
|
|
52
52
|
description: 'Optional alias for the result (used in error messages and debugging)'
|
|
53
53
|
})
|
|
54
|
-
alias?: string;
|
|
54
|
+
alias?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
/**
|
|
@@ -60,22 +60,22 @@ export class AggregateExpressionInput {
|
|
|
60
60
|
@ObjectType()
|
|
61
61
|
export class AggregateResultOutput {
|
|
62
62
|
@Field(() => String, { description: 'The expression that was calculated' })
|
|
63
|
-
expression: string;
|
|
63
|
+
expression: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
64
64
|
|
|
65
65
|
@Field(() => String, { description: 'The alias (or expression if no alias provided)' })
|
|
66
|
-
alias: string;
|
|
66
|
+
alias: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
67
67
|
|
|
68
68
|
@Field(() => String, {
|
|
69
69
|
nullable: true,
|
|
70
70
|
description: 'The calculated value as a JSON string (preserves type information)'
|
|
71
71
|
})
|
|
72
|
-
value?: string;
|
|
72
|
+
value?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
73
73
|
|
|
74
74
|
@Field(() => String, {
|
|
75
75
|
nullable: true,
|
|
76
76
|
description: 'Error message if calculation failed'
|
|
77
77
|
})
|
|
78
|
-
error?: string;
|
|
78
|
+
error?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
//****************************************************************************
|
|
@@ -573,22 +573,22 @@ export class RunViewGenericInput {
|
|
|
573
573
|
@InputType()
|
|
574
574
|
export class RunViewCacheStatusInput {
|
|
575
575
|
@Field(() => String, { description: 'The maximum __mj_UpdatedAt value from cached results' })
|
|
576
|
-
maxUpdatedAt: string;
|
|
576
|
+
maxUpdatedAt: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
577
577
|
|
|
578
578
|
@Field(() => Int, { description: 'The number of rows in cached results' })
|
|
579
|
-
rowCount: number;
|
|
579
|
+
rowCount: number; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
580
580
|
}
|
|
581
581
|
|
|
582
582
|
@InputType()
|
|
583
583
|
export class RunViewWithCacheCheckInput {
|
|
584
584
|
@Field(() => RunDynamicViewInput, { description: 'The RunView parameters' })
|
|
585
|
-
params: RunDynamicViewInput;
|
|
585
|
+
params: RunDynamicViewInput; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
586
586
|
|
|
587
587
|
@Field(() => RunViewCacheStatusInput, {
|
|
588
588
|
nullable: true,
|
|
589
589
|
description: 'Optional cache status - if provided, server will check if cache is current'
|
|
590
590
|
})
|
|
591
|
-
cacheStatus?: RunViewCacheStatusInput;
|
|
591
|
+
cacheStatus?: RunViewCacheStatusInput; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
592
592
|
}
|
|
593
593
|
|
|
594
594
|
@ObjectType()
|
|
@@ -596,21 +596,21 @@ export class DifferentialDataOutput {
|
|
|
596
596
|
@Field(() => [RunViewGenericResultRow], {
|
|
597
597
|
description: 'Records that have been created or updated since the client\'s maxUpdatedAt'
|
|
598
598
|
})
|
|
599
|
-
updatedRows: RunViewGenericResultRow[];
|
|
599
|
+
updatedRows: RunViewGenericResultRow[]; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
600
600
|
|
|
601
601
|
@Field(() => [String], {
|
|
602
602
|
description: 'Primary key values (as concatenated strings) of records that have been deleted'
|
|
603
603
|
})
|
|
604
|
-
deletedRecordIDs: string[];
|
|
604
|
+
deletedRecordIDs: string[]; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
605
605
|
}
|
|
606
606
|
|
|
607
607
|
@ObjectType()
|
|
608
608
|
export class RunViewWithCacheCheckResultOutput {
|
|
609
609
|
@Field(() => Int, { description: 'The index of this view in the batch request' })
|
|
610
|
-
viewIndex: number;
|
|
610
|
+
viewIndex: number; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
611
611
|
|
|
612
612
|
@Field(() => String, { description: "'current', 'differential', 'stale', or 'error'" })
|
|
613
|
-
status: string;
|
|
613
|
+
status: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
614
614
|
|
|
615
615
|
@Field(() => [RunViewGenericResultRow], {
|
|
616
616
|
nullable: true,
|
|
@@ -622,34 +622,34 @@ export class RunViewWithCacheCheckResultOutput {
|
|
|
622
622
|
nullable: true,
|
|
623
623
|
description: 'Differential update data - only populated when status is differential'
|
|
624
624
|
})
|
|
625
|
-
differentialData?: DifferentialDataOutput;
|
|
625
|
+
differentialData?: DifferentialDataOutput; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
626
626
|
|
|
627
627
|
@Field(() => String, { nullable: true, description: 'Max __mj_UpdatedAt from results when stale or differential' })
|
|
628
|
-
maxUpdatedAt?: string;
|
|
628
|
+
maxUpdatedAt?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
629
629
|
|
|
630
630
|
@Field(() => Int, { nullable: true, description: 'Row count of results when stale or differential (total after applying delta)' })
|
|
631
|
-
rowCount?: number;
|
|
631
|
+
rowCount?: number; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
632
632
|
|
|
633
633
|
@Field(() => String, { nullable: true, description: 'Error message if status is error' })
|
|
634
|
-
errorMessage?: string;
|
|
634
|
+
errorMessage?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
635
635
|
|
|
636
636
|
@Field(() => [AggregateResultOutput], {
|
|
637
637
|
nullable: true,
|
|
638
638
|
description: 'Aggregate results when status is stale and aggregates were requested (B40 — previously never marshalled, so CacheLocal callers got no aggregates at all)'
|
|
639
639
|
})
|
|
640
|
-
aggregateResults?: AggregateResultOutput[];
|
|
640
|
+
aggregateResults?: AggregateResultOutput[]; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
641
641
|
}
|
|
642
642
|
|
|
643
643
|
@ObjectType()
|
|
644
644
|
export class RunViewsWithCacheCheckOutput {
|
|
645
645
|
@Field(() => Boolean, { description: 'Whether the overall operation succeeded' })
|
|
646
|
-
success: boolean;
|
|
646
|
+
success: boolean; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
647
647
|
|
|
648
648
|
@Field(() => [RunViewWithCacheCheckResultOutput], { description: 'Results for each view in the batch' })
|
|
649
|
-
results: RunViewWithCacheCheckResultOutput[];
|
|
649
|
+
results: RunViewWithCacheCheckResultOutput[]; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
650
650
|
|
|
651
651
|
@Field(() => String, { nullable: true, description: 'Overall error message if success is false' })
|
|
652
|
-
errorMessage?: string;
|
|
652
|
+
errorMessage?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
653
653
|
}
|
|
654
654
|
|
|
655
655
|
//****************************************************************************
|
|
@@ -2,7 +2,7 @@ import 'reflect-metadata';
|
|
|
2
2
|
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
3
3
|
import { PubSubEngine } from 'type-graphql';
|
|
4
4
|
import {
|
|
5
|
-
|
|
5
|
+
StartLivenessPulse,
|
|
6
6
|
DEFAULT_PULSE_INTERVAL_MS,
|
|
7
7
|
HEARTBEAT_MESSAGE_TYPE,
|
|
8
8
|
} from '../FireAndForgetHeartbeat';
|
|
@@ -31,14 +31,14 @@ describe('startLivenessPulse', () => {
|
|
|
31
31
|
|
|
32
32
|
it('does not publish before the first interval elapses', () => {
|
|
33
33
|
const pubSub = makePubSub();
|
|
34
|
-
|
|
34
|
+
StartLivenessPulse({ pubSub, sessionId: 's1', resolver: 'TestResolver' });
|
|
35
35
|
vi.advanceTimersByTime(DEFAULT_PULSE_INTERVAL_MS - 1);
|
|
36
36
|
expect(pubSub.publish).not.toHaveBeenCalled();
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
it('publishes a heartbeat on the push-status topic each interval', () => {
|
|
40
40
|
const pubSub = makePubSub();
|
|
41
|
-
|
|
41
|
+
StartLivenessPulse({ pubSub, sessionId: 's1', resolver: 'TestResolver', intervalMs: 1000 });
|
|
42
42
|
|
|
43
43
|
vi.advanceTimersByTime(3000);
|
|
44
44
|
|
|
@@ -52,7 +52,7 @@ describe('startLivenessPulse', () => {
|
|
|
52
52
|
|
|
53
53
|
it('includes the enriched status snapshot from readStatus', () => {
|
|
54
54
|
const pubSub = makePubSub();
|
|
55
|
-
|
|
55
|
+
StartLivenessPulse({
|
|
56
56
|
pubSub,
|
|
57
57
|
sessionId: 's1',
|
|
58
58
|
resolver: 'RunAIAgentResolver',
|
|
@@ -68,7 +68,7 @@ describe('startLivenessPulse', () => {
|
|
|
68
68
|
|
|
69
69
|
it('publishes an empty data object when readStatus throws (loop survives)', () => {
|
|
70
70
|
const pubSub = makePubSub();
|
|
71
|
-
|
|
71
|
+
StartLivenessPulse({
|
|
72
72
|
pubSub,
|
|
73
73
|
sessionId: 's1',
|
|
74
74
|
resolver: 'RunAIAgentResolver',
|
|
@@ -87,12 +87,12 @@ describe('startLivenessPulse', () => {
|
|
|
87
87
|
|
|
88
88
|
it('stops publishing after stop() is called', () => {
|
|
89
89
|
const pubSub = makePubSub();
|
|
90
|
-
const handle =
|
|
90
|
+
const handle = StartLivenessPulse({ pubSub, sessionId: 's1', resolver: 'TestResolver', intervalMs: 1000 });
|
|
91
91
|
|
|
92
92
|
vi.advanceTimersByTime(2000);
|
|
93
93
|
expect(pubSub.publish).toHaveBeenCalledTimes(2);
|
|
94
94
|
|
|
95
|
-
handle.
|
|
95
|
+
handle.Stop();
|
|
96
96
|
vi.advanceTimersByTime(5000);
|
|
97
97
|
expect(pubSub.publish).toHaveBeenCalledTimes(2);
|
|
98
98
|
});
|
package/src/index.ts
CHANGED
|
@@ -32,7 +32,7 @@ import { RealtimeProxyServer } from './realtimeProxy/RealtimeProxyServer.js';
|
|
|
32
32
|
import buildApolloServer from './apolloServer/index.js';
|
|
33
33
|
import { configInfo, configFilePath, dbDatabase, dbHost, dbPort, dbUsername, graphqlPort, graphqlRootPath, mj_core_schema, websiteRunFromPackage, RESTApiOptions } from './config.js';
|
|
34
34
|
import { default as jwt } from 'jsonwebtoken';
|
|
35
|
-
import { contextFunction,
|
|
35
|
+
import { contextFunction, CreateUnifiedAuthMiddleware, getUserPayload } from './context.js';
|
|
36
36
|
import { UserPayload } from './types.js';
|
|
37
37
|
import { requireSystemUserDirective, publicDirective } from './directives/index.js';
|
|
38
38
|
import { variablesLoggingMiddleware } from './logging/variablesLoggingMiddleware.js';
|
|
@@ -69,7 +69,7 @@ import { SessionJanitor } from './agentSessions/index.js';
|
|
|
69
69
|
import { StartTaskGraphDispatcher } from './services/StartTaskGraphDispatcher.js';
|
|
70
70
|
import { GetAttachmentService } from '@memberjunction/aiengine';
|
|
71
71
|
import { MJStorageBlobStore } from './services/MJStorageBlobStore.js';
|
|
72
|
-
import { CACHE_INVALIDATION_TOPIC } from './generic/CacheInvalidationResolver.js';
|
|
72
|
+
import { CACHE_INVALIDATION_TOPIC, MayBroadcastRecordData, ConfigureRecordDataBroadcast } from './generic/CacheInvalidationResolver.js';
|
|
73
73
|
import { ConnectorFactory, IntegrationEngine, IntegrationSyncOptions } from '@memberjunction/integration-engine';
|
|
74
74
|
import { CronExpressionHelper } from '@memberjunction/scheduling-engine';
|
|
75
75
|
import {
|
|
@@ -82,6 +82,7 @@ import {
|
|
|
82
82
|
import { ServerExtensionLoader, ServerExtensionConfig, mergeServerExtensionConfigs, prepareServerExtensionConfigs, describeServerExtensionMount, InstallMediaUpgradeDispatcher, IsGraphQLWsPath } from '@memberjunction/server-extensions-core';
|
|
83
83
|
import { coreReservedServerExtensionRoots } from './serverExtensionReservedRoots.js';
|
|
84
84
|
import { MetadataCacheRefreshIntervalSeconds } from './providerConfigUnits.js';
|
|
85
|
+
import { CreateMetadataRefreshSignalHandler, METADATA_REFRESH_SIGNAL } from './metadataRefreshSignal.js';
|
|
85
86
|
|
|
86
87
|
const cacheRefreshInterval = configInfo.databaseSettings.metadataCacheRefreshInterval;
|
|
87
88
|
|
|
@@ -99,10 +100,15 @@ export { MetadataCacheRefreshIntervalSeconds } from './providerConfigUnits.js';
|
|
|
99
100
|
* CodeGenLib). This wrapper keeps the public `getDbType()` symbol that
|
|
100
101
|
* MJServer consumers (and the broader stack) already import.
|
|
101
102
|
*/
|
|
102
|
-
export function
|
|
103
|
+
export function GetDbType(): DatabasePlatform {
|
|
103
104
|
return resolveDbPlatformFromEnv() ?? 'sqlserver';
|
|
104
105
|
}
|
|
105
106
|
|
|
107
|
+
/** @deprecated Use {@link GetDbType}. */
|
|
108
|
+
export function getDbType(): DatabasePlatform {
|
|
109
|
+
return GetDbType();
|
|
110
|
+
}
|
|
111
|
+
|
|
106
112
|
export { MaxLength } from 'class-validator';
|
|
107
113
|
export * from 'type-graphql';
|
|
108
114
|
// Named re-export so Open App generated resolvers get a live ESM binding for
|
|
@@ -263,7 +269,10 @@ const localPath = (p: string) => {
|
|
|
263
269
|
return resolvedPath;
|
|
264
270
|
};
|
|
265
271
|
|
|
266
|
-
export const
|
|
272
|
+
export const CreateApp = (): Application => express();
|
|
273
|
+
|
|
274
|
+
/** @deprecated Use {@link CreateApp}. */
|
|
275
|
+
export const createApp = CreateApp;
|
|
267
276
|
|
|
268
277
|
/**
|
|
269
278
|
* Resolves the MJServer package version for the startup summary header.
|
|
@@ -294,7 +303,7 @@ function resolveServerVersion(): string | undefined {
|
|
|
294
303
|
// there is no ordering hazard in binding this early.
|
|
295
304
|
GetAttachmentService().BlobStore = new MJStorageBlobStore();
|
|
296
305
|
|
|
297
|
-
export const
|
|
306
|
+
export const Serve = async (resolverPaths: Array<string>, app: Application = CreateApp(), options?: MJServerOptions): Promise<void> => {
|
|
298
307
|
const t0 = performance.now();
|
|
299
308
|
// Level-gated startup logger. Resolves verbosity from telemetry.level (single
|
|
300
309
|
// operator knob). At `standard` (default), per-phase timings are collapsed into
|
|
@@ -321,7 +330,7 @@ export const serve = async (resolverPaths: Array<string>, app: Application = cre
|
|
|
321
330
|
}
|
|
322
331
|
|
|
323
332
|
const setupComplete$ = new ReplaySubject(1);
|
|
324
|
-
const dbType =
|
|
333
|
+
const dbType = GetDbType();
|
|
325
334
|
const dataSources: DataSourceInfo[] = [];
|
|
326
335
|
|
|
327
336
|
if (dbType === 'postgresql') {
|
|
@@ -909,6 +918,11 @@ const setupComplete$ = new ReplaySubject(1);
|
|
|
909
918
|
// publish hook above so the first RSU event also reaches live subscribers.
|
|
910
919
|
RegisterRSUProgressBridge();
|
|
911
920
|
|
|
921
|
+
// Hand the resolver its allowlist before anything can publish. It cannot read configInfo itself:
|
|
922
|
+
// config.ts loads and validates at module scope, so importing it there would pull full config
|
|
923
|
+
// validation into every import chain that touches the resolver, unit tests included.
|
|
924
|
+
ConfigureRecordDataBroadcast(configInfo.cacheSettings?.recordDataBroadcastEntities);
|
|
925
|
+
|
|
912
926
|
// Global listener: broadcast CACHE_INVALIDATION to all browser clients whenever
|
|
913
927
|
// ANY BaseEntity save/delete occurs on this server — regardless of whether it
|
|
914
928
|
// originated from a GraphQL mutation or internal server-side code (agents, actions,
|
|
@@ -918,14 +932,21 @@ const setupComplete$ = new ReplaySubject(1);
|
|
|
918
932
|
if (event.event === MJEventType.ComponentEvent && event.eventCode === BaseEntity.BaseEventCode) {
|
|
919
933
|
const beEvent = event.args as BaseEntityEvent;
|
|
920
934
|
if (beEvent.type === 'save' || beEvent.type === 'delete') {
|
|
935
|
+
const entityName = beEvent.baseEntity.EntityInfo.Name;
|
|
921
936
|
PubSubManager.Instance.Publish(CACHE_INVALIDATION_TOPIC, {
|
|
922
|
-
entityName
|
|
937
|
+
entityName,
|
|
923
938
|
primaryKeyValues: JSON.stringify(beEvent.baseEntity.PrimaryKey.KeyValuePairs),
|
|
924
939
|
action: beEvent.type,
|
|
925
940
|
sourceServerId: MJGlobal.Instance.ProcessUUID,
|
|
926
941
|
timestamp: new Date(),
|
|
927
942
|
originSessionId: null,
|
|
928
|
-
|
|
943
|
+
// Opt-in only: this event reaches every connected client unfiltered, and this listener
|
|
944
|
+
// fires for server-internal saves too (agents, actions, orchestrator), which are exactly
|
|
945
|
+
// the ones no browser session asked for.
|
|
946
|
+
recordData:
|
|
947
|
+
beEvent.type === 'save' && MayBroadcastRecordData(entityName)
|
|
948
|
+
? JSON.stringify(beEvent.baseEntity.GetAll())
|
|
949
|
+
: undefined,
|
|
929
950
|
});
|
|
930
951
|
}
|
|
931
952
|
}
|
|
@@ -1378,7 +1399,7 @@ const setupComplete$ = new ReplaySubject(1);
|
|
|
1378
1399
|
startupLog.LogIf('verbose', `[Auth] Public provider catalog registered at ${AUTH_CATALOG_MOUNT_PATH}/providers`);
|
|
1379
1400
|
|
|
1380
1401
|
// ─── Unified auth middleware (replaces both REST authMiddleware and contextFunction auth) ─────
|
|
1381
|
-
app.use(
|
|
1402
|
+
app.use(CreateUnifiedAuthMiddleware(dataSources));
|
|
1382
1403
|
|
|
1383
1404
|
// ─── Post-auth middleware from BaseServerMiddleware plugins ─────
|
|
1384
1405
|
// Middleware here has access to the authenticated user via req.userPayload.
|
|
@@ -1667,6 +1688,8 @@ const setupComplete$ = new ReplaySubject(1);
|
|
|
1667
1688
|
|
|
1668
1689
|
process.on('SIGTERM', () => gracefulShutdown('SIGTERM'));
|
|
1669
1690
|
process.on('SIGINT', () => gracefulShutdown('SIGINT'));
|
|
1691
|
+
// Operator control: `kill -HUP <pid>` hard-reloads metadata from the DB — see metadataRefreshSignal.ts
|
|
1692
|
+
process.on(METADATA_REFRESH_SIGNAL, CreateMetadataRefreshSignalHandler(() => Metadata.Provider.Refresh())); // global-provider-ok: operator-triggered refresh of the global cache that per-request providers adopt from
|
|
1670
1693
|
|
|
1671
1694
|
// Handle unhandled promise rejections to prevent server crashes
|
|
1672
1695
|
process.on('unhandledRejection', (reason, promise) => {
|
|
@@ -1677,6 +1700,9 @@ const setupComplete$ = new ReplaySubject(1);
|
|
|
1677
1700
|
});
|
|
1678
1701
|
};
|
|
1679
1702
|
|
|
1703
|
+
/** @deprecated Use {@link Serve}. */
|
|
1704
|
+
export const serve = Serve;
|
|
1705
|
+
|
|
1680
1706
|
/**
|
|
1681
1707
|
* Age at which an unprocessed `MJ: RSU Pending Works` row is reported as stranded.
|
|
1682
1708
|
* A row older than this survived at least one full restart cycle without being completed.
|
|
@@ -133,7 +133,7 @@ interface WorkItem {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
/** Registers the post-sync custom-column promotion hook on the IntegrationEngine singleton. */
|
|
136
|
-
export function
|
|
136
|
+
export function RegisterIntegrationCustomColumnPromoter(): void {
|
|
137
137
|
IntegrationEngine.Instance.SetPostSyncSchemaPromotionCallback(async (ctx) => {
|
|
138
138
|
const user = ctx.ContextUser as UserInfo;
|
|
139
139
|
const provider = ctx.Provider as IMetadataProvider | undefined;
|
|
@@ -164,6 +164,11 @@ export function registerIntegrationCustomColumnPromoter(): void {
|
|
|
164
164
|
LogStatusEx({ message: '[CustomColumnPromoter] Registered post-sync custom-column promotion hook (auto-promote opt-in, default OFF).', verboseOnly: true });
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
+
/** @deprecated Use {@link RegisterIntegrationCustomColumnPromoter}. */
|
|
168
|
+
export function registerIntegrationCustomColumnPromoter(): void {
|
|
169
|
+
return RegisterIntegrationCustomColumnPromoter();
|
|
170
|
+
}
|
|
171
|
+
|
|
167
172
|
/** Reads the per-connection `autoPromoteCustomColumns` flag (default false = capture-only, on-demand promotion). */
|
|
168
173
|
async function readAutoPromoteFlag(companyIntegrationID: string, user: UserInfo, provider?: IMetadataProvider): Promise<boolean> {
|
|
169
174
|
try {
|
|
@@ -242,7 +242,7 @@ export interface SelectableSourceField {
|
|
|
242
242
|
* `null`/`undefined` selection means "all fields", which is not the same as an EMPTY selection —
|
|
243
243
|
* an empty array is a real (if unusual) choice, and still yields the keys.
|
|
244
244
|
*/
|
|
245
|
-
export function
|
|
245
|
+
export function SelectFieldsToMap<T extends SelectableSourceField>(
|
|
246
246
|
allFields: readonly T[],
|
|
247
247
|
selectedFieldNames: readonly string[] | null | undefined,
|
|
248
248
|
): T[] {
|
|
@@ -251,6 +251,14 @@ export function selectFieldsToMap<T extends SelectableSourceField>(
|
|
|
251
251
|
return allFields.filter(f => selected.has(f.Name.toLowerCase()) || f.IsPrimaryKey === true);
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
+
/** @deprecated Use {@link SelectFieldsToMap}. */
|
|
255
|
+
export function selectFieldsToMap<T extends SelectableSourceField>(
|
|
256
|
+
allFields: readonly T[],
|
|
257
|
+
selectedFieldNames: readonly string[] | null | undefined,
|
|
258
|
+
): T[] {
|
|
259
|
+
return SelectFieldsToMap(allFields, selectedFieldNames);
|
|
260
|
+
}
|
|
261
|
+
|
|
254
262
|
/** One existing field map, reduced to what the reconciliation decision needs. */
|
|
255
263
|
export interface ExistingFieldMapRead {
|
|
256
264
|
SourceFieldName: string | null;
|
|
@@ -289,7 +297,7 @@ export interface FieldMapReconcilePlan {
|
|
|
289
297
|
* stopped reporting the column, so it returns to the state it had.
|
|
290
298
|
* - **Vanished column → `Inactive`, never deleted.** Retiring is reversible by the branch above.
|
|
291
299
|
*/
|
|
292
|
-
export function
|
|
300
|
+
export function DecideFieldMapReconcile(
|
|
293
301
|
activeFieldNames: readonly string[],
|
|
294
302
|
existing: readonly ExistingFieldMapRead[],
|
|
295
303
|
mapEnabled: boolean,
|
|
@@ -320,3 +328,13 @@ export function decideFieldMapReconcile(
|
|
|
320
328
|
}
|
|
321
329
|
return plan;
|
|
322
330
|
}
|
|
331
|
+
|
|
332
|
+
/** @deprecated Use {@link DecideFieldMapReconcile}. */
|
|
333
|
+
export function decideFieldMapReconcile(
|
|
334
|
+
activeFieldNames: readonly string[],
|
|
335
|
+
existing: readonly ExistingFieldMapRead[],
|
|
336
|
+
mapEnabled: boolean,
|
|
337
|
+
autoEnableNewColumns = true,
|
|
338
|
+
): FieldMapReconcilePlan {
|
|
339
|
+
return DecideFieldMapReconcile(activeFieldNames, existing, mapEnabled, autoEnableNewColumns);
|
|
340
|
+
}
|
package/src/logging/NoLog.ts
CHANGED
|
@@ -64,7 +64,7 @@ export function NoLog(target: object, propertyKey?: string | symbol, parameterIn
|
|
|
64
64
|
* Pass the resolver class itself (e.g. `MyResolver`) — the function reads from the
|
|
65
65
|
* prototype internally to match how type-graphql stores resolver metadata.
|
|
66
66
|
*/
|
|
67
|
-
export function
|
|
67
|
+
export function HasNoLogParameter(
|
|
68
68
|
resolverClass: Function,
|
|
69
69
|
methodName: string,
|
|
70
70
|
parameterIndex: number,
|
|
@@ -74,6 +74,15 @@ export function hasNoLogParameter(
|
|
|
74
74
|
return marks !== undefined && marks.has(parameterIndex);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
/** @deprecated Use {@link HasNoLogParameter}. */
|
|
78
|
+
export function hasNoLogParameter(
|
|
79
|
+
resolverClass: Function,
|
|
80
|
+
methodName: string,
|
|
81
|
+
parameterIndex: number,
|
|
82
|
+
): boolean {
|
|
83
|
+
return HasNoLogParameter(resolverClass, methodName, parameterIndex);
|
|
84
|
+
}
|
|
85
|
+
|
|
77
86
|
/**
|
|
78
87
|
* Returns the set of field names decorated `@NoLog` on the given input class. Empty set
|
|
79
88
|
* if none were marked.
|
|
@@ -81,8 +90,13 @@ export function hasNoLogParameter(
|
|
|
81
90
|
* Pass the input class itself (e.g. `GetDataInputType`) — the function reads from the
|
|
82
91
|
* prototype internally.
|
|
83
92
|
*/
|
|
84
|
-
export function
|
|
93
|
+
export function GetNoLogFields(inputTypeClass: Function): ReadonlySet<string> {
|
|
85
94
|
const target = inputTypeClass.prototype as object;
|
|
86
95
|
const marks = Reflect.getMetadata(NO_LOG_FIELD_KEY, target) as Set<string> | undefined;
|
|
87
96
|
return marks ?? new Set<string>();
|
|
88
97
|
}
|
|
98
|
+
|
|
99
|
+
/** @deprecated Use {@link GetNoLogFields}. */
|
|
100
|
+
export function getNoLogFields(inputTypeClass: Function): ReadonlySet<string> {
|
|
101
|
+
return GetNoLogFields(inputTypeClass);
|
|
102
|
+
}
|
|
@@ -117,7 +117,7 @@ export class StartupLogger {
|
|
|
117
117
|
* operator knob governs both telemetry and server logging. Defaults to
|
|
118
118
|
* `standard` when unset or unrecognized.
|
|
119
119
|
*/
|
|
120
|
-
public static
|
|
120
|
+
public static ResolveLevelFromConfig(): ServerLogLevel {
|
|
121
121
|
const raw = configInfo.telemetry?.level;
|
|
122
122
|
if (raw === 'minimal' || raw === 'standard' || raw === 'verbose' || raw === 'debug') {
|
|
123
123
|
return raw;
|
|
@@ -125,6 +125,11 @@ export class StartupLogger {
|
|
|
125
125
|
return 'standard';
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
/** @deprecated Use {@link ResolveLevelFromConfig}. */
|
|
129
|
+
public static resolveLevelFromConfig(): ServerLogLevel {
|
|
130
|
+
return this.ResolveLevelFromConfig();
|
|
131
|
+
}
|
|
132
|
+
|
|
128
133
|
/**
|
|
129
134
|
* True when the active level is at least `minLevel` (using the ascending
|
|
130
135
|
* `minimal < standard < verbose < debug` ordering).
|
package/src/logging/bootAudit.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getMetadataStorage } from 'type-graphql';
|
|
2
2
|
import { configInfo } from '../config.js';
|
|
3
|
-
import {
|
|
3
|
+
import { HasNoLogParameter } from './NoLog.js';
|
|
4
4
|
|
|
5
5
|
// Delete is included alongside Create/Update so codegen DeleteMJ*Input resolvers count as
|
|
6
6
|
// metadata-bound and don't flood the audit with false positives (their args are PK + Options
|
|
@@ -13,12 +13,12 @@ const INPUT_TYPE_REGEX = /^(Create|Update|Delete).+Input$/;
|
|
|
13
13
|
* Used by the audit walker. Mirrors the subset of `ArgParamMetadata` we need.
|
|
14
14
|
*/
|
|
15
15
|
export type AuditArgParam = {
|
|
16
|
-
kind: 'arg';
|
|
17
|
-
|
|
18
|
-
name: string;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
kind: 'arg'; // case-violation-ok-legacy-back-compat: the old name is also read off a value typed `any`, where a rename would compile and silently return undefined
|
|
17
|
+
Index: number;
|
|
18
|
+
name: string; // case-violation-ok-legacy-back-compat: the old name is also read off a value typed `any`, where a rename would compile and silently return undefined
|
|
19
|
+
Target: Function;
|
|
20
|
+
MethodName: string;
|
|
21
|
+
GetType: () => unknown;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -26,9 +26,9 @@ export type AuditArgParam = {
|
|
|
26
26
|
* Includes `@Query`, `@Mutation`, `@Subscription` entries.
|
|
27
27
|
*/
|
|
28
28
|
export type AuditResolver = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
params?: ReadonlyArray<{ kind: string;
|
|
29
|
+
Target: Function;
|
|
30
|
+
MethodName: string;
|
|
31
|
+
params?: ReadonlyArray<{ kind: string; Index: number } & Partial<AuditArgParam>>; // case-violation-ok-legacy-back-compat: optional, and the old name is also read off a value the checker cannot type; renaming it stays assignable and silently yields undefined
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
/**
|
|
@@ -42,7 +42,7 @@ export type AuditResolver = {
|
|
|
42
42
|
*
|
|
43
43
|
* Never throws. Boot does not fail on a missed `@NoLog`.
|
|
44
44
|
*/
|
|
45
|
-
export function
|
|
45
|
+
export function AuditResolversForUndecoratedArgs(): void {
|
|
46
46
|
if (!configInfo.loggingSettings.graphql.logVariables) {
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
@@ -52,24 +52,34 @@ export function auditResolversForUndecoratedArgs(): void {
|
|
|
52
52
|
mutations: AuditResolver[];
|
|
53
53
|
subscriptions: AuditResolver[];
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
AuditResolverList([
|
|
56
56
|
...storage.queries,
|
|
57
57
|
...storage.mutations,
|
|
58
58
|
...storage.subscriptions,
|
|
59
59
|
]);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
/** @deprecated Use {@link AuditResolversForUndecoratedArgs}. */
|
|
63
|
+
export function auditResolversForUndecoratedArgs(): void {
|
|
64
|
+
return AuditResolversForUndecoratedArgs();
|
|
65
|
+
}
|
|
66
|
+
|
|
62
67
|
/**
|
|
63
68
|
* Internal helper exported for test injection. Takes a list of resolver metadata directly,
|
|
64
69
|
* skipping the global `getMetadataStorage()` lookup. The boot-time scan uses this after
|
|
65
70
|
* pulling from the global storage; tests pass in a synthetic fixture.
|
|
66
71
|
*/
|
|
67
|
-
export function
|
|
72
|
+
export function AuditResolverList(resolvers: ReadonlyArray<AuditResolver>): void {
|
|
68
73
|
for (const resolver of resolvers) {
|
|
69
74
|
auditResolver(resolver);
|
|
70
75
|
}
|
|
71
76
|
}
|
|
72
77
|
|
|
78
|
+
/** @deprecated Use {@link AuditResolverList}. */
|
|
79
|
+
export function auditResolverList(resolvers: ReadonlyArray<AuditResolver>): void {
|
|
80
|
+
return AuditResolverList(resolvers);
|
|
81
|
+
}
|
|
82
|
+
|
|
73
83
|
function auditResolver(resolver: AuditResolver): void {
|
|
74
84
|
for (const param of resolver.params ?? []) {
|
|
75
85
|
if (param.kind !== 'arg') {
|
|
@@ -84,10 +94,10 @@ function auditArg(resolver: AuditResolver, argParam: AuditArgParam): void {
|
|
|
84
94
|
if (typeName && INPUT_TYPE_REGEX.test(typeName)) {
|
|
85
95
|
return;
|
|
86
96
|
}
|
|
87
|
-
if (
|
|
97
|
+
if (HasNoLogParameter(resolver.Target, resolver.MethodName, argParam.Index)) {
|
|
88
98
|
return;
|
|
89
99
|
}
|
|
90
|
-
const resolverName = `${resolver.
|
|
100
|
+
const resolverName = `${resolver.Target.name}.${resolver.MethodName}`;
|
|
91
101
|
console.warn(
|
|
92
102
|
`[mj:NoLog audit] Custom resolver ${resolverName} takes argument '${argParam.name}' ` +
|
|
93
103
|
`(type ${typeName ?? 'unknown'}) which is not marked @NoLog. Verify this argument does ` +
|
|
@@ -103,7 +113,7 @@ function auditArg(resolver: AuditResolver, argParam: AuditArgParam): void {
|
|
|
103
113
|
*/
|
|
104
114
|
function readArgTypeName(argParam: AuditArgParam): string | undefined {
|
|
105
115
|
try {
|
|
106
|
-
const type = argParam.
|
|
116
|
+
const type = argParam.GetType();
|
|
107
117
|
if (typeof type === 'function') {
|
|
108
118
|
return (type as { name?: string }).name;
|
|
109
119
|
}
|
|
@@ -12,8 +12,15 @@
|
|
|
12
12
|
*
|
|
13
13
|
* See docs/adr/0001-graphql-variables-logging-tiered-by-verbose.md.
|
|
14
14
|
*/
|
|
15
|
-
export function
|
|
15
|
+
export function BuildBoundaryLogPayload(
|
|
16
16
|
operationName: string | undefined,
|
|
17
17
|
): { operationName: string | undefined } {
|
|
18
18
|
return { operationName };
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
/** @deprecated Use {@link BuildBoundaryLogPayload}. */
|
|
22
|
+
export function buildBoundaryLogPayload(
|
|
23
|
+
operationName: string | undefined,
|
|
24
|
+
): { operationName: string | undefined } {
|
|
25
|
+
return BuildBoundaryLogPayload(operationName);
|
|
26
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IMetadataProvider } from '@memberjunction/core';
|
|
2
|
-
import {
|
|
2
|
+
import { ShortenForLog } from './shortenForLog.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Input to the redactor. Built per `@Arg` per resolver call by the variables-logging middleware.
|
|
@@ -15,11 +15,11 @@ import { shortenForLog } from './shortenForLog.js';
|
|
|
15
15
|
* this set (decorator-driven) when walking top-level keys.
|
|
16
16
|
*/
|
|
17
17
|
export type RedactionContext = {
|
|
18
|
-
inputTypeName: string;
|
|
19
|
-
rawValue: unknown;
|
|
20
|
-
provider: IMetadataProvider;
|
|
21
|
-
noLogParameter: boolean;
|
|
22
|
-
noLogFields: ReadonlySet<string>;
|
|
18
|
+
inputTypeName: string; // case-violation-ok-legacy-back-compat: renaming it broke a use the checker could not see from the declaration — the compile proved it
|
|
19
|
+
rawValue: unknown; // case-violation-ok-legacy-back-compat: renaming it broke a use the checker could not see from the declaration — the compile proved it
|
|
20
|
+
provider: IMetadataProvider; // case-violation-ok-legacy-back-compat: the old name is also read off a value typed `any`, where a rename would compile and silently return undefined
|
|
21
|
+
noLogParameter: boolean; // case-violation-ok-legacy-back-compat: renaming it broke a use the checker could not see from the declaration — the compile proved it
|
|
22
|
+
noLogFields: ReadonlySet<string>; // case-violation-ok-legacy-back-compat: renaming it broke a use the checker could not see from the declaration — the compile proved it
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
// Delete is included so DeleteMJ*Input resolvers resolve to their entity (yielding an empty
|
|
@@ -33,7 +33,7 @@ const INPUT_TYPE_REGEX = /^(Create|Update|Delete)(?<name>.+)Input$/;
|
|
|
33
33
|
// type-graphql allows @Field({ name: 'overrideName' }) to rename fields at the
|
|
34
34
|
// GraphQL layer; MJ codegen does not use this. A future maintainer renaming an
|
|
35
35
|
// encrypted field at the GraphQL layer would silently miss redaction.
|
|
36
|
-
export function
|
|
36
|
+
export function RedactArg(ctx: RedactionContext): unknown {
|
|
37
37
|
if (ctx.noLogParameter) {
|
|
38
38
|
return '<redacted>';
|
|
39
39
|
}
|
|
@@ -79,7 +79,7 @@ export function redactArg(ctx: RedactionContext): unknown {
|
|
|
79
79
|
!Array.isArray(ctx.rawValue);
|
|
80
80
|
|
|
81
81
|
if (!canWalk) {
|
|
82
|
-
return
|
|
82
|
+
return ShortenForLog(ctx.rawValue);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
const result: Record<string, unknown> = {};
|
|
@@ -87,12 +87,17 @@ export function redactArg(ctx: RedactionContext): unknown {
|
|
|
87
87
|
if (encryptedFieldNames.has(key) || ctx.noLogFields.has(key)) {
|
|
88
88
|
result[key] = '<redacted>';
|
|
89
89
|
} else {
|
|
90
|
-
result[key] =
|
|
90
|
+
result[key] = ShortenForLog(value);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
return result;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
/** @deprecated Use {@link RedactArg}. */
|
|
97
|
+
export function redactArg(ctx: RedactionContext): unknown {
|
|
98
|
+
return RedactArg(ctx);
|
|
99
|
+
}
|
|
100
|
+
|
|
96
101
|
const EMPTY_SET: ReadonlySet<string> = new Set<string>();
|
|
97
102
|
|
|
98
103
|
/**
|