Member Junction
    Preparing search index...

    Interface RealtimeRecordingRouterDeps

    Dependencies of CreateRealtimeRecordingRouter; injectable so the routes can be tested without a database.

    interface RealtimeRecordingRouterDeps {
        GraceMs: () => number;
        LoadConversationExternalID: (
            session: MJAIAgentSessionEntity,
            contextUser: UserInfo,
            provider: IMetadataProvider,
        ) => Promise<string>;
        LoadOwnedSession: (
            agentSessionId: string,
            contextUser: UserInfo,
            provider: IMetadataProvider,
        ) => Promise<MJAIAgentSessionEntity>;
        Scheduler: IRecordingAssemblyScheduler;
        SystemUser: () => UserInfo;
        CreateLedger(
            provider: DatabaseProviderBase,
            contextUser: UserInfo,
        ): IRealtimeRecordingLedger;
        ResolveCaller(req: Request): RealtimeRecordingCaller;
    }
    Index

    Properties

    GraceMs: () => number

    Grace before an incomplete recording is assembled as Partial.

    LoadConversationExternalID: (
        session: MJAIAgentSessionEntity,
        contextUser: UserInfo,
        provider: IMetadataProvider,
    ) => Promise<string>

    The session conversation's per-session scope id, for the anonymous-guest half of the access decision.

    Type Declaration

    LoadOwnedSession: (
        agentSessionId: string,
        contextUser: UserInfo,
        provider: IMetadataProvider,
    ) => Promise<MJAIAgentSessionEntity>

    Type Declaration

      • (
            agentSessionId: string,
            contextUser: UserInfo,
            provider: IMetadataProvider,
        ): Promise<MJAIAgentSessionEntity>
      • Loads a session under the caller's identity and enforces ownership (UserID === contextUser.ID). It deliberately does NOT reject Closed sessions: the final channel-state flush and the recording terminal signal legitimately arrive after the session closed. A scoped-anonymous widget guest owns the session it minted, so the same check covers it; loading as the caller also applies the entity's row-level security.

        Parameters

        Returns Promise<MJAIAgentSessionEntity>

        RealtimeSessionNotFoundError when the row does not load

        RealtimeSessionOwnershipError when the caller is not the owner (logged with both user ids)

    SystemUser: () => UserInfo

    The server's system user, or null when it is not available. Deciding whether a recording is ready reads the shard entity, which callers (UI users, widget guests) deliberately cannot read; that read is the server's own scheduling decision, made after the caller was authorized, so it runs as this user. With none, nothing is scheduled and the session janitor assembles the recording.

    Methods