Home Manual Reference Source Test Repository
public class | source

BaseSearch

This is a abstract class, it must be extended to another class that defined the specific search. This class is responsible to manage execute request to OpenGate North API

Constructor Summary

Public Constructor
public

constructor(ogapi: InternalOpenGateAPI, resource: string, timeout: number, serviceBaseURL: string)

Constructor

Member Summary

Public Members
public

cancel: *

Method Summary

Public Methods
public

cancelAsyncPaging(message: *)

public

This invoke a request to OpenGate North API and the callback is managed by promises

public

This invoke a request to OpenGate North API and the callback is managed by promises

public

This invokes a request for asynchronous paging to the OpenGate North API and the return of the pages is managed by promises and its notify object To cancel the process in the notify method return false or string with custom message for response In case of canceling the process, the response will be 403: Forbidden -> {data: 'Cancel process'|| custom_message, statusCode: 403}

Public Constructors

public constructor(ogapi: InternalOpenGateAPI, resource: string, timeout: number, serviceBaseURL: string) source

Constructor

Params:

NameTypeAttributeDescription
ogapi InternalOpenGateAPI
  • nullable: false

this is ogapi instance

resource string
  • nullable: false

this is a base url resource

timeout number
  • optional
  • nullable: false

timeout on request

serviceBaseURL string

base of the uri petition

Public Members

public cancel: * source

Public Methods

public cancelAsyncPaging(message: *) source

Params:

NameTypeAttributeDescription
message *

public downloadCsv(): Promise source

This invoke a request to OpenGate North API and the callback is managed by promises

Return:

Promise

Promise with data with format csv

Return Properties:

NameTypeAttributeDescription
then function(result: object, statusCode: number)

When request it is OK

catch function(error: string)

When request it is NOK

public execute(): Promise source

This invoke a request to OpenGate North API and the callback is managed by promises

Return:

Promise

Return Properties:

NameTypeAttributeDescription
then function(result: object, statusCode: number)

When request it is OK

catch function(error: string)

When request it is NOK

public executeWithAsyncPaging(resource: string): Promise source

This invokes a request for asynchronous paging to the OpenGate North API and the return of the pages is managed by promises and its notify object To cancel the process in the notify method return false or string with custom message for response In case of canceling the process, the response will be 403: Forbidden -> {data: 'Cancel process'|| custom_message, statusCode: 403}

Params:

NameTypeAttributeDescription
resource string

resource to find.

Return:

Promise

Return Properties:

NameTypeAttributeDescription
then function()

When request it is OK

catch function(error: string)

When request it is NOK