Represents a WebSocket route that can be used for routing and handling WebSocket requests.

Hierarchy

Constructors

  • Creates an instance of WebsocketRoute.

    Parameters

    • method: string

      The method name for the route.

    • objConfig: {
          propertyKey: string;
          target: any;
      }

      The configuration object for the object method.

      • propertyKey: string

        The property key of the target object.

      • target: any

        The target object.

    • Optional modifiesAuthentication: boolean

      Indicates whether the route modifies authentication.

    Returns WebsocketRoute

Properties

authenticator: WebsocketAuthenticator = null
children: WebsocketRoute[] = []
decoratorConfigReference: WebsocketRouteDecoratorConfig
isOutbound: boolean = false
method: string
modifiesAuthentication?: boolean

Indicates whether the route modifies authentication.

modifiesOutbounds: {
    filter: MessageFilter;
    outboundRoutes: string[];
}[] = []

Type declaration

objConfig: {
    propertyKey: string;
    target: any;
}

The configuration object for the object method.

Type declaration

  • propertyKey: string
  • target: any

Accessors

  • get Func(): ((...data) => any)
  • Returns the decorated function with added authentication checks.

    Returns ((...data) => any)

    • The decorated function.
      • (...data): any
      • Returns the decorated function with added authentication checks.

        Parameters

        • Rest ...data: any[]

        Returns any

        • The decorated function.
  • get hasAuthenticator(): boolean
  • Checks if the decorated function has an authenticator.

    Returns boolean

    • Indicates whether the decorated function has an authenticator.

Methods

  • Protected

    Calls the object method associated with the route and handles the response.

    Parameters

    Returns Promise<any>

    • The response of the object method.

    Throws

    • If the object method is not defined for the route.
  • Checks for duplicate routes with the same method.

    Parameters

    • Optional method: string

      The method name to check.

    Returns void

  • Loads the decorator configuration from the bound reference. Recursively initializes loading for all child routes.

    Returns void

  • Registers the outbound methods whose data is potentially modified during the execution of this route.

    Parameters

    • outboundRoutes: string[]

      The outbound routes that are potentially modified.

    • Optional filter: MessageFilter

      The message filter.

    Returns void

  • Private

    Triggers the execution of resending processes of updated data.

    Parameters

    • responseData: any

      The response data from the original call. It can be used within filter methods.

    • requestConn: WebsocketConnection

      The WebSocket connection.

    Returns Promise<void>

  • Routes the WebSocket request based on the provided path. Sends error message to the connection if the route call fails.

    Parameters

    • request: WebsocketRequest

      The WebSocket request.

    • path: string[]

      The path to route.

    Returns Promise<boolean>

    • Indicates whether the routing was successful.
  • Protected

    Routes the WebSocket request to the children routes.

    Parameters

    • request: WebsocketRequest

      The WebSocket request.

    • path: string[]

      The path to route.

    Returns Promise<boolean>

    • Indicates whether the routing was successful.

Generated using TypeDoc