@memberjunction/server 6.1.4 → 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/exampleNewUserSubClass.js +2 -1
- package/dist/auth/exampleNewUserSubClass.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 +293 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +11 -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 +266 -4
- package/dist/generated/graphql-schemas/__mj.d.ts.map +1 -1
- package/dist/generated/graphql-schemas/__mj.js +1304 -0
- package/dist/generated/graphql-schemas/__mj.js.map +1 -1
- package/dist/generic/CacheInvalidationResolver.d.ts +8 -2
- package/dist/generic/CacheInvalidationResolver.d.ts.map +1 -1
- package/dist/generic/CacheInvalidationResolver.js +7 -3
- package/dist/generic/CacheInvalidationResolver.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 +27 -1
- package/dist/generic/ResolverBase.d.ts.map +1 -1
- package/dist/generic/ResolverBase.js +64 -6
- 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 +29 -6
- 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/FetchEntityVectorsResolver.js +2 -2
- package/dist/resolvers/FetchEntityVectorsResolver.js.map +1 -1
- 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/QuerySystemUserResolver.d.ts.map +1 -1
- package/dist/resolvers/QuerySystemUserResolver.js +2 -1
- package/dist/resolvers/QuerySystemUserResolver.js.map +1 -1
- package/dist/resolvers/RealtimeBridgeResolver.js +3 -3
- package/dist/resolvers/RealtimeClientSessionResolver.d.ts +37 -0
- package/dist/resolvers/RealtimeClientSessionResolver.d.ts.map +1 -1
- package/dist/resolvers/RealtimeClientSessionResolver.js +101 -11
- package/dist/resolvers/RealtimeClientSessionResolver.js.map +1 -1
- 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 +74 -42
- 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/SearchEntitiesResolver.d.ts.map +1 -1
- package/dist/resolvers/SearchEntitiesResolver.js +3 -1
- package/dist/resolvers/SearchEntitiesResolver.js.map +1 -1
- package/dist/resolvers/SearchKnowledgeResolver.d.ts +1 -0
- package/dist/resolvers/SearchKnowledgeResolver.d.ts.map +1 -1
- package/dist/resolvers/SearchKnowledgeResolver.js +5 -0
- package/dist/resolvers/SearchKnowledgeResolver.js.map +1 -1
- package/dist/resolvers/SearchKnowledgeSystemUserResolver.d.ts.map +1 -1
- package/dist/resolvers/SearchKnowledgeSystemUserResolver.js +1 -0
- package/dist/resolvers/SearchKnowledgeSystemUserResolver.js.map +1 -1
- 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/TransactionGroupResolver.d.ts.map +1 -1
- package/dist/resolvers/TransactionGroupResolver.js +53 -4
- package/dist/resolvers/TransactionGroupResolver.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/MJStorageBlobStore.d.ts +41 -0
- package/dist/services/MJStorageBlobStore.d.ts.map +1 -0
- package/dist/services/MJStorageBlobStore.js +160 -0
- package/dist/services/MJStorageBlobStore.js.map +1 -0
- 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 +12 -3
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +19 -8
- package/dist/util.js.map +1 -1
- package/package.json +92 -92
- 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__/RealtimeClientSessionResolver.test.ts +229 -0
- 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__/ResolverBase.isaPromotionCreate.test.ts +412 -0
- package/src/__tests__/RunAIAgentResolver.historyFrom.test.ts +228 -0
- package/src/__tests__/SearchEntitiesResolver.readOnlyFallback.test.ts +78 -0
- package/src/__tests__/TaskGraphActionRunner.durablePayload.test.ts +129 -0
- package/src/__tests__/TaskGraphFrameResolver.test.ts +2 -2
- package/src/__tests__/TransactionGroupResolver.refusals.test.ts +290 -0
- 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__/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/exampleNewUserSubClass.ts +2 -2
- 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 +14 -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 +933 -5
- package/src/generic/CacheInvalidationResolver.ts +12 -4
- package/src/generic/FireAndForgetHeartbeat.ts +19 -14
- package/src/generic/PushStatusResolver.ts +21 -7
- package/src/generic/ResolverBase.ts +66 -5
- package/src/generic/RunViewResolver.ts +22 -22
- package/src/generic/__tests__/FireAndForgetHeartbeat.test.ts +7 -7
- package/src/index.ts +34 -7
- 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/FetchEntityVectorsResolver.ts +2 -2
- 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/QuerySystemUserResolver.ts +2 -1
- package/src/resolvers/RealtimeBridgeResolver.ts +3 -3
- package/src/resolvers/RealtimeClientSessionResolver.ts +126 -13
- package/src/resolvers/RemoteBrowserActionResolver.ts +5 -5
- package/src/resolvers/RunAIAgentResolver.ts +118 -76
- package/src/resolvers/RunAIPromptResolver.ts +22 -22
- package/src/resolvers/RunTemplateResolver.ts +4 -4
- package/src/resolvers/RunTestResolver.ts +25 -25
- package/src/resolvers/SearchEntitiesResolver.ts +3 -1
- package/src/resolvers/SearchKnowledgeResolver.ts +4 -0
- package/src/resolvers/SearchKnowledgeSystemUserResolver.ts +1 -0
- package/src/resolvers/SqlLoggingConfigResolver.ts +56 -56
- package/src/resolvers/TaskGraphFrameResolver.ts +37 -28
- package/src/resolvers/TelemetryResolver.ts +79 -79
- package/src/resolvers/TransactionGroupResolver.ts +57 -4
- 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/MJStorageBlobStore.ts +209 -0
- package/src/services/TaskGraphActionRunner.ts +16 -15
- package/src/types.ts +21 -16
- package/src/util.ts +22 -9
|
@@ -3,7 +3,10 @@ import BodyParser from 'body-parser';
|
|
|
3
3
|
import { LogStatusEx } from '@memberjunction/core';
|
|
4
4
|
import { RESTEndpointHandler } from './RESTEndpointHandler.js';
|
|
5
5
|
|
|
6
|
-
export const
|
|
6
|
+
export const REST_API_BASE_PATH = '/api/v1';
|
|
7
|
+
|
|
8
|
+
/** @deprecated Use {@link REST_API_BASE_PATH}. */
|
|
9
|
+
export const ___REST_API_BASE_PATH = REST_API_BASE_PATH;
|
|
7
10
|
|
|
8
11
|
/**
|
|
9
12
|
* Configuration options for REST API endpoints
|
|
@@ -12,14 +15,14 @@ export interface RESTApiOptions {
|
|
|
12
15
|
/**
|
|
13
16
|
* Whether to enable REST API endpoints (default: false)
|
|
14
17
|
*/
|
|
15
|
-
enabled: boolean;
|
|
18
|
+
enabled: boolean; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub
|
|
16
19
|
|
|
17
20
|
/**
|
|
18
21
|
* Array of entity names to include in the API (case-insensitive)
|
|
19
22
|
* If provided, only these entities will be accessible through the REST API
|
|
20
23
|
* Supports wildcards using '*' (e.g., 'User*' matches 'User', 'UserRole', etc.)
|
|
21
24
|
*/
|
|
22
|
-
includeEntities?: string[];
|
|
25
|
+
includeEntities?: string[]; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub
|
|
23
26
|
|
|
24
27
|
/**
|
|
25
28
|
* Array of entity names to exclude from the API (case-insensitive)
|
|
@@ -27,20 +30,20 @@ export interface RESTApiOptions {
|
|
|
27
30
|
* Supports wildcards using '*' (e.g., 'Secret*' matches 'Secret', 'SecretKey', etc.)
|
|
28
31
|
* Note: Exclude patterns always override include patterns
|
|
29
32
|
*/
|
|
30
|
-
excludeEntities?: string[];
|
|
33
|
+
excludeEntities?: string[]; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub
|
|
31
34
|
|
|
32
35
|
/**
|
|
33
36
|
* Array of schema names to include in the API (case-insensitive)
|
|
34
37
|
* If provided, only entities in these schemas will be accessible through the REST API
|
|
35
38
|
*/
|
|
36
|
-
includeSchemas?: string[];
|
|
39
|
+
includeSchemas?: string[]; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub
|
|
37
40
|
|
|
38
41
|
/**
|
|
39
42
|
* Array of schema names to exclude from the API (case-insensitive)
|
|
40
43
|
* Entities in these schemas will not be accessible through the REST API
|
|
41
44
|
* Note: Exclude patterns always override include patterns
|
|
42
45
|
*/
|
|
43
|
-
excludeSchemas?: string[];
|
|
46
|
+
excludeSchemas?: string[]; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
/**
|
|
@@ -56,7 +59,7 @@ export const DEFAULT_REST_API_OPTIONS: RESTApiOptions = {
|
|
|
56
59
|
* @param options Configuration options for REST API
|
|
57
60
|
* @param authMiddleware Optional authentication middleware to use
|
|
58
61
|
*/
|
|
59
|
-
export function
|
|
62
|
+
export function SetupRESTEndpoints(
|
|
60
63
|
app: express.Application,
|
|
61
64
|
options?: Partial<RESTApiOptions>,
|
|
62
65
|
authMiddleware?: express.RequestHandler
|
|
@@ -71,14 +74,14 @@ export function setupRESTEndpoints(
|
|
|
71
74
|
return;
|
|
72
75
|
}
|
|
73
76
|
|
|
74
|
-
const basePath =
|
|
77
|
+
const basePath = REST_API_BASE_PATH;
|
|
75
78
|
|
|
76
79
|
// Create REST endpoint handler with entity and schema filters
|
|
77
80
|
const restHandler = new RESTEndpointHandler({
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
IncludeEntities: config.includeEntities ? config.includeEntities.map(e => e.toLowerCase()) : undefined,
|
|
82
|
+
ExcludeEntities: config.excludeEntities ? config.excludeEntities.map(e => e.toLowerCase()) : undefined,
|
|
83
|
+
IncludeSchemas: config.includeSchemas ? config.includeSchemas.map(s => s.toLowerCase()) : undefined,
|
|
84
|
+
ExcludeSchemas: config.excludeSchemas ? config.excludeSchemas.map(s => s.toLowerCase()) : undefined
|
|
82
85
|
});
|
|
83
86
|
|
|
84
87
|
// Mount REST API at the specified base path with authentication
|
|
@@ -90,4 +93,13 @@ export function setupRESTEndpoints(
|
|
|
90
93
|
}
|
|
91
94
|
|
|
92
95
|
LogStatusEx({ message: `REST API endpoints have been set up at ${basePath}`, verboseOnly: true });
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** @deprecated Use {@link SetupRESTEndpoints}. */
|
|
99
|
+
export function setupRESTEndpoints(
|
|
100
|
+
app: express.Application,
|
|
101
|
+
options?: Partial<RESTApiOptions>,
|
|
102
|
+
authMiddleware?: express.RequestHandler
|
|
103
|
+
): void {
|
|
104
|
+
return SetupRESTEndpoints(app, options, authMiddleware);
|
|
93
105
|
}
|
|
@@ -40,7 +40,7 @@ export const CORE_CONSTANT_RESERVED_SERVER_EXTENSION_ROOTS: readonly string[] =
|
|
|
40
40
|
* static `/graphql` baseline) is still protected. `/` as graphqlRootPath is
|
|
41
41
|
* already reserved as the server root and does not prefix-match every path.
|
|
42
42
|
*/
|
|
43
|
-
export function
|
|
43
|
+
export function CoreReservedServerExtensionRoots(graphqlRootPath: string): string[] {
|
|
44
44
|
const graphql = typeof graphqlRootPath === 'string' ? graphqlRootPath.trim() : '';
|
|
45
45
|
return [
|
|
46
46
|
...(graphql ? [graphql] : []),
|
|
@@ -48,3 +48,8 @@ export function coreReservedServerExtensionRoots(graphqlRootPath: string): strin
|
|
|
48
48
|
...CORE_STATIC_RESERVED_SERVER_EXTENSION_ROOTS,
|
|
49
49
|
];
|
|
50
50
|
}
|
|
51
|
+
|
|
52
|
+
/** @deprecated Use {@link CoreReservedServerExtensionRoots}. */
|
|
53
|
+
export function coreReservedServerExtensionRoots(graphqlRootPath: string): string[] {
|
|
54
|
+
return CoreReservedServerExtensionRoots(graphqlRootPath);
|
|
55
|
+
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { LogError, UserInfo, IMetadataProvider, Metadata } from '@memberjunction/core';
|
|
2
|
+
import { MJGlobal } from '@memberjunction/global';
|
|
3
|
+
import type { MJFileEntity, MJFileStorageProviderEntity } from '@memberjunction/core-entities';
|
|
4
|
+
import { FileStorageBase, FileStorageEngine } from '@memberjunction/storage';
|
|
5
|
+
import type {
|
|
6
|
+
AttachmentBlobUploadInput,
|
|
7
|
+
AttachmentBlobUploadResult,
|
|
8
|
+
IAttachmentBlobStore,
|
|
9
|
+
} from '@memberjunction/aiengine';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @fileoverview MJStorage-backed implementation of the conversation-attachment blob seam.
|
|
13
|
+
*
|
|
14
|
+
* This is where `@memberjunction/storage` — and with it the AWS, Azure and Dropbox SDKs — now
|
|
15
|
+
* lives, instead of inside `@memberjunction/aiengine`. That single import previously made the
|
|
16
|
+
* whole attachment service server-only: no browser or React Native client could consume it, which
|
|
17
|
+
* is why the same attachment rules ended up reimplemented three times across the estate.
|
|
18
|
+
*
|
|
19
|
+
* The bodies here are the ones lifted out of `ConversationAttachmentService`, unchanged in
|
|
20
|
+
* behaviour. Only two things differ, both forced by the seam being runtime-neutral:
|
|
21
|
+
*
|
|
22
|
+
* - content crosses as **base64**, not `Buffer`;
|
|
23
|
+
* - account-versus-provider resolution is this implementation's business, because only it knows
|
|
24
|
+
* how its credentials work.
|
|
25
|
+
*/
|
|
26
|
+
export class MJStorageBlobStore implements IAttachmentBlobStore {
|
|
27
|
+
/**
|
|
28
|
+
* Uploads bytes and creates the `MJ: Files` record.
|
|
29
|
+
*
|
|
30
|
+
* Prefers account-scoped upload through `FileStorageEngine` when an account id is supplied —
|
|
31
|
+
* that path handles OAuth credentials properly. Falls back to provider-only resolution, which
|
|
32
|
+
* relies on environment configuration and has no account credentials.
|
|
33
|
+
*/
|
|
34
|
+
public async Upload(
|
|
35
|
+
input: AttachmentBlobUploadInput,
|
|
36
|
+
contextUser: UserInfo,
|
|
37
|
+
provider?: IMetadataProvider
|
|
38
|
+
): Promise<AttachmentBlobUploadResult> {
|
|
39
|
+
const md = provider ?? Metadata.Provider;
|
|
40
|
+
|
|
41
|
+
if (input.StorageAccountID) {
|
|
42
|
+
try {
|
|
43
|
+
await FileStorageEngine.Instance.Config(false, contextUser);
|
|
44
|
+
const result = await FileStorageEngine.Instance.UploadFile({
|
|
45
|
+
content: Buffer.from(input.Base64Data, 'base64'),
|
|
46
|
+
fileName: input.FileName,
|
|
47
|
+
mimeType: input.MimeType,
|
|
48
|
+
contextUser,
|
|
49
|
+
storageAccountId: input.StorageAccountID,
|
|
50
|
+
provider: md,
|
|
51
|
+
pathPrefix: input.PathPrefix ?? undefined,
|
|
52
|
+
});
|
|
53
|
+
return { Success: true, FileID: result.FileID };
|
|
54
|
+
} catch (err) {
|
|
55
|
+
return { Success: false, Error: (err as Error).message };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (!input.StorageProviderID) {
|
|
60
|
+
return { Success: false, Error: 'No storage provider configured for attachments' };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const storageProviderEntity = await md.GetEntityObject<MJFileStorageProviderEntity>(
|
|
64
|
+
'MJ: File Storage Providers',
|
|
65
|
+
contextUser
|
|
66
|
+
);
|
|
67
|
+
if (!(await storageProviderEntity.Load(input.StorageProviderID))) {
|
|
68
|
+
return { Success: false, Error: 'Failed to load storage provider' };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const driver = MJGlobal.Instance.ClassFactory.CreateInstance<FileStorageBase>(
|
|
72
|
+
FileStorageBase,
|
|
73
|
+
storageProviderEntity.ServerDriverKey
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const objectName = `${input.PathPrefix ?? 'conversation-attachments'}/${input.FileName}`;
|
|
77
|
+
const uploaded = await driver.PutObject(objectName, Buffer.from(input.Base64Data, 'base64'), input.MimeType);
|
|
78
|
+
if (!uploaded) {
|
|
79
|
+
return { Success: false, Error: 'Failed to upload file to storage' };
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const file = await md.GetEntityObject<MJFileEntity>('MJ: Files', contextUser);
|
|
83
|
+
file.NewRecord();
|
|
84
|
+
file.Name = input.FileName;
|
|
85
|
+
file.ProviderID = input.StorageProviderID;
|
|
86
|
+
file.ContentType = input.MimeType;
|
|
87
|
+
file.ProviderKey = objectName;
|
|
88
|
+
file.Status = 'Uploaded';
|
|
89
|
+
if (!(await file.Save())) {
|
|
90
|
+
// The bytes are already in the bucket and nothing will ever point at them, so remove
|
|
91
|
+
// them before reporting the failure. Without this compensation an RLS rejection or a
|
|
92
|
+
// transient SQL error leaves a permanently orphaned object with no catalog row — the
|
|
93
|
+
// failure mode this seam's contract calls out by name.
|
|
94
|
+
const compensated = await driver.DeleteObject(objectName);
|
|
95
|
+
if (!compensated) {
|
|
96
|
+
LogError(
|
|
97
|
+
`[MJStorageBlobStore] Orphaned object '${objectName}': the MJ: Files row failed to save ` +
|
|
98
|
+
`and the compensating delete also failed.`
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
Success: false,
|
|
103
|
+
Error: file.LatestResult?.CompleteMessage ?? 'Failed to create the file record',
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return { Success: true, FileID: file.ID };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** @inheritdoc */
|
|
110
|
+
public async Download(
|
|
111
|
+
fileId: string,
|
|
112
|
+
contextUser: UserInfo,
|
|
113
|
+
provider?: IMetadataProvider
|
|
114
|
+
): Promise<string | null> {
|
|
115
|
+
try {
|
|
116
|
+
const resolved = await this.resolveFileAndDriver(fileId, contextUser, provider);
|
|
117
|
+
if (!resolved) return null;
|
|
118
|
+
|
|
119
|
+
const content = await resolved.driver.GetObject({ fullPath: resolved.objectKey });
|
|
120
|
+
// The seam is base64 so it stays runtime-neutral; the Buffer never leaves this file.
|
|
121
|
+
return content ? content.toString('base64') : null;
|
|
122
|
+
} catch (err) {
|
|
123
|
+
LogError(`[MJStorageBlobStore] Failed to download file ${fileId}: ${err}`);
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** @inheritdoc */
|
|
129
|
+
public async GetDownloadUrl(
|
|
130
|
+
fileId: string,
|
|
131
|
+
contextUser: UserInfo,
|
|
132
|
+
provider?: IMetadataProvider
|
|
133
|
+
): Promise<string | null> {
|
|
134
|
+
try {
|
|
135
|
+
const resolved = await this.resolveFileAndDriver(fileId, contextUser, provider);
|
|
136
|
+
if (!resolved) return null;
|
|
137
|
+
return resolved.driver.CreatePreAuthDownloadUrl(resolved.objectKey);
|
|
138
|
+
} catch (err) {
|
|
139
|
+
LogError(`[MJStorageBlobStore] Failed to create download URL for ${fileId}: ${err}`);
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** @inheritdoc */
|
|
145
|
+
public async Delete(
|
|
146
|
+
fileId: string,
|
|
147
|
+
contextUser: UserInfo,
|
|
148
|
+
provider?: IMetadataProvider
|
|
149
|
+
): Promise<boolean> {
|
|
150
|
+
try {
|
|
151
|
+
const resolved = await this.resolveFileAndDriver(fileId, contextUser, provider);
|
|
152
|
+
if (!resolved) return false;
|
|
153
|
+
|
|
154
|
+
const deleted = await resolved.driver.DeleteObject(resolved.objectKey);
|
|
155
|
+
// Only remove the catalog row once the bytes are gone — a row without content is
|
|
156
|
+
// recoverable, content without a row is orphaned storage nobody will find again.
|
|
157
|
+
if (deleted) {
|
|
158
|
+
await resolved.file.Delete();
|
|
159
|
+
}
|
|
160
|
+
return deleted;
|
|
161
|
+
} catch (err) {
|
|
162
|
+
LogError(`[MJStorageBlobStore] Failed to delete file ${fileId}: ${err}`);
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Loads a file, its storage provider, and a driver able to act on it.
|
|
169
|
+
*
|
|
170
|
+
* Shared by download, URL and delete, which previously repeated this block three times with
|
|
171
|
+
* subtly different fallbacks — the account-credential path existed in only one of them.
|
|
172
|
+
*/
|
|
173
|
+
private async resolveFileAndDriver(
|
|
174
|
+
fileId: string,
|
|
175
|
+
contextUser: UserInfo,
|
|
176
|
+
provider?: IMetadataProvider
|
|
177
|
+
): Promise<{ file: MJFileEntity; driver: FileStorageBase; objectKey: string } | null> {
|
|
178
|
+
const md = provider ?? Metadata.Provider;
|
|
179
|
+
|
|
180
|
+
// Load the engine before asking it anything. `Accounts` returns an empty array when it has
|
|
181
|
+
// not been configured, so on a cold process the account-credential branch below would be
|
|
182
|
+
// skipped silently and the driver would fall back to environment-only credentials — which
|
|
183
|
+
// then fails to read a file that is perfectly readable. Every other MJServer call site
|
|
184
|
+
// configures immediately before use for the same reason.
|
|
185
|
+
await FileStorageEngine.Instance.Config(false, contextUser);
|
|
186
|
+
|
|
187
|
+
const file = await md.GetEntityObject<MJFileEntity>('MJ: Files', contextUser);
|
|
188
|
+
if (!(await file.Load(fileId))) return null;
|
|
189
|
+
|
|
190
|
+
const storageProvider = await md.GetEntityObject<MJFileStorageProviderEntity>(
|
|
191
|
+
'MJ: File Storage Providers',
|
|
192
|
+
contextUser
|
|
193
|
+
);
|
|
194
|
+
if (!(await storageProvider.Load(file.ProviderID))) return null;
|
|
195
|
+
|
|
196
|
+
// Prefer account-scoped credentials when an account links to this provider; fall back to
|
|
197
|
+
// environment-configured credentials otherwise.
|
|
198
|
+
const matchingAccounts = FileStorageEngine.Instance.GetAccountsByProviderID(file.ProviderID);
|
|
199
|
+
const driver =
|
|
200
|
+
matchingAccounts.length > 0
|
|
201
|
+
? await FileStorageEngine.Instance.GetDriver(matchingAccounts[0].ID, contextUser)
|
|
202
|
+
: MJGlobal.Instance.ClassFactory.CreateInstance<FileStorageBase>(
|
|
203
|
+
FileStorageBase,
|
|
204
|
+
storageProvider.ServerDriverKey
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
return { file, driver, objectKey: file.ProviderKey || file.Name };
|
|
208
|
+
}
|
|
209
|
+
}
|
|
@@ -75,25 +75,26 @@ export class TaskGraphActionRunner implements TaskActionRunner {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
* Rebuilds the action's parameters from the task's
|
|
78
|
+
* Rebuilds the action's parameters from the task's input, one parameter per key.
|
|
79
79
|
*
|
|
80
|
-
* **
|
|
81
|
-
*
|
|
82
|
-
* marked as not-logged
|
|
83
|
-
* value, which is the honest consequence of choosing not to persist it, and the
|
|
84
|
-
* dispatch is opt-in per binding rather than the default.
|
|
80
|
+
* For a **durable entity-action** graph the input was written by `RedactParamsToRecord`
|
|
81
|
+
* (`@memberjunction/actions-base`) at deferral time, so its values have been through redaction:
|
|
82
|
+
* a parameter the binding marked as not-logged arrives absent rather than secret — the action
|
|
83
|
+
* sees a missing value, which is the honest consequence of choosing not to persist it, and the
|
|
84
|
+
* reason durable dispatch is opt-in per binding rather than the default. Every other graph's
|
|
85
|
+
* input is whatever its spec authored. This method re-applies no redaction rule in either case.
|
|
85
86
|
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
87
|
+
* `InputPayload` already carries the dependency outputs: the dispatcher merges them underneath
|
|
88
|
+
* the task's own input (`mergedPayload`) before calling this runner, so a node's explicit
|
|
89
|
+
* parameters win and a step with an input mapping gets exactly the parameters it declared.
|
|
90
|
+
* `DependencyOutputs` is keyed by upstream task ID, not by parameter name, so it is deliberately
|
|
91
|
+
* not read here — spreading it would hand the action one extra parameter per dependency, named
|
|
92
|
+
* by a GUID and holding that task's whole output.
|
|
88
93
|
*/
|
|
89
94
|
private buildParams(params: TaskActionRunParams): ActionParam[] {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
merged[name] = value;
|
|
95
|
+
if (!params.InputPayload || typeof params.InputPayload !== 'object') {
|
|
96
|
+
return [];
|
|
93
97
|
}
|
|
94
|
-
|
|
95
|
-
Object.assign(merged, params.InputPayload as Record<string, unknown>);
|
|
96
|
-
}
|
|
97
|
-
return Object.entries(merged).map(([Name, Value]) => ({ Name, Value, Type: 'Input' }));
|
|
98
|
+
return Object.entries(params.InputPayload as Record<string, unknown>).map(([Name, Value]) => ({ Name, Value, Type: 'Input' }));
|
|
98
99
|
}
|
|
99
100
|
}
|
package/src/types.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { AggregateExpression, CompositeKey, DatabaseProviderBase, UserInfo } fro
|
|
|
2
2
|
import { MJUserViewEntityExtended } from '@memberjunction/core-entities';
|
|
3
3
|
import { GraphQLSchema } from 'graphql';
|
|
4
4
|
import sql from 'mssql';
|
|
5
|
-
import {
|
|
5
|
+
import { GetSystemUser } from './auth/index.js';
|
|
6
6
|
import { MJEvent, MJEventType, MJGlobal } from '@memberjunction/global';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -57,18 +57,18 @@ export type AppContext = {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
export class ProviderInfo {
|
|
60
|
-
provider: DatabaseProviderBase;
|
|
61
|
-
type: 'Admin' | 'Read-Write' | 'Read-Only' | 'Other';
|
|
60
|
+
provider: DatabaseProviderBase; // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply
|
|
61
|
+
type: 'Admin' | 'Read-Write' | 'Read-Only' | 'Other'; // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
export class DataSourceInfo {
|
|
65
|
-
dataSource: sql.ConnectionPool;
|
|
66
|
-
host: string;
|
|
67
|
-
port: number;
|
|
68
|
-
instance?: string;
|
|
69
|
-
database: string;
|
|
70
|
-
userName: string;
|
|
71
|
-
type: "Admin" | "Read-Write" | "Read-Only" | "Other";
|
|
65
|
+
dataSource: sql.ConnectionPool; // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply
|
|
66
|
+
host: string; // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply
|
|
67
|
+
port: number; // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply
|
|
68
|
+
instance?: string; // case-violation-ok-legacy-back-compat: an accessor cannot be optional, so a stub would turn this into a required member
|
|
69
|
+
database: string; // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply
|
|
70
|
+
userName: string; // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply
|
|
71
|
+
type: "Admin" | "Read-Write" | "Read-Only" | "Other"; // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply
|
|
72
72
|
|
|
73
73
|
constructor(init: {dataSource: sql.ConnectionPool, type: "Admin" | "Read-Write" | "Read-Only" | "Other", host: string, port: number, database: string, userName: string} ) {
|
|
74
74
|
this.dataSource = init.dataSource;
|
|
@@ -125,20 +125,20 @@ export type RunViewGenericParams = {
|
|
|
125
125
|
|
|
126
126
|
|
|
127
127
|
export class MJServerEvent {
|
|
128
|
-
type: 'setupComplete' | 'requestReceived' | 'requestCompleted' | 'requestFailed';
|
|
129
|
-
dataSources: DataSourceInfo[];
|
|
130
|
-
userPayload: UserPayload;
|
|
131
|
-
systemUser: UserInfo;
|
|
128
|
+
type: 'setupComplete' | 'requestReceived' | 'requestCompleted' | 'requestFailed'; // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply
|
|
129
|
+
dataSources: DataSourceInfo[]; // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply
|
|
130
|
+
userPayload: UserPayload; // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply
|
|
131
|
+
systemUser: UserInfo; // case-violation-ok-legacy-back-compat: object literals are assigned to this class, so an accessor stub changes what they must supply
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
export const MJ_SERVER_EVENT_CODE = 'MJ_SERVER_EVENT';
|
|
135
135
|
|
|
136
|
-
export async function
|
|
136
|
+
export async function RaiseEvent(type: MJServerEvent['type'], dataSources: DataSourceInfo[], userPayload: UserPayload, component?: any) {
|
|
137
137
|
const event = new MJServerEvent();
|
|
138
138
|
event.type = type;
|
|
139
139
|
event.dataSources = dataSources;
|
|
140
140
|
event.userPayload = userPayload;
|
|
141
|
-
event.systemUser = await
|
|
141
|
+
event.systemUser = await GetSystemUser();
|
|
142
142
|
|
|
143
143
|
const mje = new MJEvent();
|
|
144
144
|
mje.args = event;
|
|
@@ -146,4 +146,9 @@ export async function raiseEvent(type: MJServerEvent['type'], dataSources: DataS
|
|
|
146
146
|
mje.event = MJEventType.ComponentEvent;
|
|
147
147
|
mje.eventCode = MJ_SERVER_EVENT_CODE;
|
|
148
148
|
MJGlobal.Instance.RaiseEvent(mje);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/** @deprecated Use {@link RaiseEvent}. */
|
|
152
|
+
export async function raiseEvent(type: MJServerEvent['type'], dataSources: DataSourceInfo[], userPayload: UserPayload, component?: any) {
|
|
153
|
+
return RaiseEvent(type, dataSources, userPayload, component);
|
|
149
154
|
}
|
package/src/util.ts
CHANGED
|
@@ -23,7 +23,7 @@ type StreamCallback = (jsonObject: any) => void;
|
|
|
23
23
|
* @param {StreamCallback} [streamCallback] - Optional callback for handling streaming JSON objects.
|
|
24
24
|
* @returns {Promise<any[]>} - A promise that resolves to an array of all JSON objects received during the streaming process.
|
|
25
25
|
*/
|
|
26
|
-
export async function
|
|
26
|
+
export async function SendPostRequest(url: string, payload: any, useCompression: boolean, headers: Record<string, string> | null, streamCallback?: StreamCallback): Promise<any[]> {
|
|
27
27
|
return new Promise(async (resolve, reject) => {
|
|
28
28
|
try {
|
|
29
29
|
const { protocol, hostname, port, pathname } = new URL(url);
|
|
@@ -144,6 +144,11 @@ export async function sendPostRequest(url: string, payload: any, useCompression:
|
|
|
144
144
|
);
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
+
/** @deprecated Use {@link SendPostRequest}. */
|
|
148
|
+
export async function sendPostRequest(url: string, payload: any, useCompression: boolean, headers: Record<string, string> | null, streamCallback?: StreamCallback): Promise<any[]> {
|
|
149
|
+
return SendPostRequest(url, payload, useCompression, headers, streamCallback);
|
|
150
|
+
}
|
|
151
|
+
|
|
147
152
|
|
|
148
153
|
/**
|
|
149
154
|
* Returns the read-only data source if it exists, otherwise returns the read-write data source if options is not provided or if options.allowFallbackToReadWrite is true.
|
|
@@ -154,23 +159,26 @@ export async function sendPostRequest(url: string, payload: any, useCompression:
|
|
|
154
159
|
export function GetReadOnlyDataSource(dataSources: DataSourceInfo[], options?: {allowFallbackToReadWrite: boolean}): sql.ConnectionPool & { query: (sql: string, params?: any) => Promise<any[]> } {
|
|
155
160
|
const readOnlyDataSource = dataSources.find((ds) => ds.type === 'Read-Only');
|
|
156
161
|
if (readOnlyDataSource) {
|
|
157
|
-
return
|
|
162
|
+
return ExtendConnectionPoolWithQuery(readOnlyDataSource.dataSource);
|
|
158
163
|
}
|
|
159
164
|
else if (!options || options.allowFallbackToReadWrite) {
|
|
160
165
|
// default behavior for backward compatibility prior to MJ 2.22.3 where we introduced this functionality was to have a single
|
|
161
166
|
// connection, so for back-compatability, if we don't have a read-only data source, we'll fall back to the read-write data source
|
|
162
167
|
const readWriteDataSource = dataSources.find((ds) => ds.type === 'Read-Write');
|
|
163
168
|
if (readWriteDataSource) {
|
|
164
|
-
return
|
|
169
|
+
return ExtendConnectionPoolWithQuery(readWriteDataSource.dataSource);
|
|
165
170
|
}
|
|
166
171
|
}
|
|
167
172
|
throw new Error('No suitable data source found');
|
|
168
173
|
}
|
|
169
174
|
|
|
170
175
|
/**
|
|
171
|
-
* Returns the read-only provider if
|
|
172
|
-
*
|
|
173
|
-
*
|
|
176
|
+
* Returns the read-only provider if one is configured. Otherwise returns the first (read-write)
|
|
177
|
+
* provider ONLY when `options.allowFallbackToReadWrite` is true, and `null` when it is omitted.
|
|
178
|
+
*
|
|
179
|
+
* The read-only pool exists only when `dbReadOnlyUsername`/`dbReadOnlyPassword` are set, which
|
|
180
|
+
* most deployments leave unset — so a caller that omits the flag gets `null` on those servers.
|
|
181
|
+
* Pass it for any pure read.
|
|
174
182
|
*/
|
|
175
183
|
export function GetReadOnlyProvider(providers: Array<ProviderInfo>, options?: {allowFallbackToReadWrite: boolean}): DatabaseProviderBase {
|
|
176
184
|
if (!providers || providers.length === 0)
|
|
@@ -217,7 +225,7 @@ export async function sendPostRequest(url: string, payload: any, useCompression:
|
|
|
217
225
|
export function GetReadWriteDataSource(dataSources: DataSourceInfo[]): sql.ConnectionPool & { query: (sql: string, params?: any) => Promise<any[]> } {
|
|
218
226
|
const readWriteDataSource = dataSources.find((ds) => ds.type === 'Read-Write');
|
|
219
227
|
if (readWriteDataSource) {
|
|
220
|
-
return
|
|
228
|
+
return ExtendConnectionPoolWithQuery(readWriteDataSource.dataSource);
|
|
221
229
|
}
|
|
222
230
|
throw new Error('No suitable read-write data source found');
|
|
223
231
|
}
|
|
@@ -226,7 +234,7 @@ export async function sendPostRequest(url: string, payload: any, useCompression:
|
|
|
226
234
|
* Extends a ConnectionPool with a query method that returns results in the format expected by generated code
|
|
227
235
|
* This provides backwards compatibility with code that expects TypeORM-style query results
|
|
228
236
|
*/
|
|
229
|
-
export function
|
|
237
|
+
export function ExtendConnectionPoolWithQuery(pool: sql.ConnectionPool): sql.ConnectionPool & { query: (sql: string, params?: any) => Promise<any[]> } {
|
|
230
238
|
const extendedPool = pool as any;
|
|
231
239
|
extendedPool.query = async (sqlQuery: string, parameters?: any): Promise<any[]> => {
|
|
232
240
|
const request = new sql.Request(pool);
|
|
@@ -245,4 +253,9 @@ export async function sendPostRequest(url: string, payload: any, useCompression:
|
|
|
245
253
|
return result.recordset || [];
|
|
246
254
|
};
|
|
247
255
|
return extendedPool;
|
|
248
|
-
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/** @deprecated Use {@link ExtendConnectionPoolWithQuery}. */
|
|
259
|
+
export function extendConnectionPoolWithQuery(pool: sql.ConnectionPool): sql.ConnectionPool & { query: (sql: string, params?: any) => Promise<any[]> } {
|
|
260
|
+
return ExtendConnectionPoolWithQuery(pool);
|
|
261
|
+
}
|