Reference Source
public class | source

MiddlewaresSvcProvider

Extends:

devapt-core-common/dist/js/services/service_provider~ServiceProvider → MiddlewaresSvcProvider

Middlewares service provider class.

Constructor Summary

Public Constructor
public

constructor(arg_provider_name: string, arg_service_instance: Service, arg_context: string): nothing

Create a middleware service provider.

Member Summary

Public Members
public

exec: Executable

Service executable instance.

public

Class test flag.

Method Summary

Public Methods
public

fill_error(arg_response: ServiceResponse, arg_operands: array, arg_error: string, arg_target_route: string, arg_exception: Error): nothing

Populate a response with error message.

public abstract

Get provider operations names.

public

process_mw_file(arg_mw_file: string, arg_credentials: Credentials): object

Process a middleware file.

public

process_mw_view(arg_view_name: string | Component, arg_menubar_name: string, arg_credentials: Credentials): object

Process a middleware view.

public

produce(arg_request: ServiceRequest): Promise

Produce service datas on request.

Public Constructors

public constructor(arg_provider_name: string, arg_service_instance: Service, arg_context: string): nothing source

Create a middleware service provider.

Params:

NameTypeAttributeDescription
arg_provider_name string

consumer name.

arg_service_instance Service

service instance.

arg_context string

logging context label.

Return:

nothing

Public Members

public exec: Executable source

Service executable instance.

public is_middleware_svc_provider: boolean source

Class test flag.

Public Methods

public fill_error(arg_response: ServiceResponse, arg_operands: array, arg_error: string, arg_target_route: string, arg_exception: Error): nothing source

Populate a response with error message.

Params:

NameTypeAttributeDescription
arg_response ServiceResponse

response instance.

arg_operands array

request operands.

arg_error string

error text.

arg_target_route string

target route (optional).

arg_exception Error

exception (optional).

Return:

nothing

public abstract get_operations_names(): array source

Get provider operations names.

Return:

array

public process_mw_file(arg_mw_file: string, arg_credentials: Credentials): object source

Process a middleware file.

Params:

NameTypeAttributeDescription
arg_mw_file string

middleware file.

arg_credentials Credentials

request credentials.

Return:

object

JSON rendering result.

public process_mw_view(arg_view_name: string | Component, arg_menubar_name: string, arg_credentials: Credentials): object source

Process a middleware view.

Params:

NameTypeAttributeDescription
arg_view_name string | Component

middleware view name.

arg_menubar_name string

middleware menubar name.

arg_credentials Credentials

request credentials.

Return:

object

JSON rendering result.

public produce(arg_request: ServiceRequest): Promise source

Produce service datas on request.

Params:

NameTypeAttributeDescription
arg_request ServiceRequest

service request instance.

Return:

Promise

promise of ServiceResponse instance.