Member Junction
    Preparing search index...

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get Enabled(): boolean

      Whether this middleware is active. Override to check config, env vars, etc. Disabled middleware classes are never instantiated or activated by serve(). Default: true.

      Returns boolean

    Methods

    • Express middleware that runs AFTER authentication has resolved UserInfo. The authenticated user payload is available at req.userPayload. Use for: tenant context resolution, org membership loading.

      Returns RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>[]

    • Express middleware/error handlers applied AFTER all routes. Use for: catch-all error handlers, response logging.

      Returns (
          | RequestHandler<
              ParamsDictionary,
              any,
              any,
              ParsedQs,
              Record<string, any>,
          >
          | ErrorRequestHandler<
              ParamsDictionary,
              any,
              any,
              ParsedQs,
              Record<string, any>,
          >
      )[]

    • Express middleware applied BEFORE authentication. Runs after compression but before OAuth/REST/GraphQL routes. Use for: rate limiting, request logging, custom headers.

      Returns RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>[]

    • Additional TypeGraphQL resolver glob paths to include in the Apollo schema. serve() collects these from all active middleware and adds them to the resolvers array passed to buildSchema().

      Return absolute glob paths (use path.join(__dirname, ...) or equivalent).

      Use for: Open App resolvers, domain-specific GraphQL queries/mutations that live outside MJServer's built-in resolver set.

      Returns string[]

      GetResolverPaths(): string[] {
      return [path.join(__dirname, 'resolvers', '*Resolver.{js,ts}')];
      }
    • Schema transformers applied after built-in directive transformers. Use for: custom directives, schema stitching, field-level auth.

      Returns ((schema: GraphQLSchema) => GraphQLSchema)[]

    • Starts the session manager, loads the Diagnostics.* settings, configures intake from them, saves sessions that expire in memory as Expired and loads the active sessions. The capture hooks are installed only while capture is enabled and a session is held. MJServer calls this after metadata and the user cache are loaded. When the settings fail to load, the error is logged and capture and intake stay off.

      Parameters

      Returns Promise<void>

    • Hook that runs after a RunView operation completes. Can modify the result (e.g., filtering or augmenting data) before it is returned to the caller.

      ⚠️ results.Results and its rows may be FROZEN shared cache state (LocalCacheManager freeze-on-write) — writing into a row throws TypeError. To modify, build copies and either reassign results.Results = results.Results.map(r => ({ ...r, ... })) or return a new result; never mutate rows in place.

      Parameters

      Returns RunViewResult | Promise<RunViewResult>

    • Hook that runs before a Save operation on a BaseEntity. Return true to allow, false to reject silently, or a string to reject with that error message.

      Parameters

      Returns string | boolean | Promise<string | boolean>