Base Search
BaseSearch
BaseSearch Objects
class 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
function constructor()Constructor
Arguments:
ogapiInternalOpenGateAPI - this is ogapi instanceresourcestring - this is a base url resourcetimeoutnumber (optional) - timeout on requestserviceBaseURLstring - base of the uri petition
cancel
function cancel()cancel
function cancel()cancelAsyncPaging
function cancelAsyncPaging()Arguments:
message*
downloadCsv
function downloadCsv() -> 'Promise'This invoke a request to OpenGate North API and the callback is managed by promises
Returns:
Promise- Promise with data with format csv
execute
function execute() -> 'Promise'This invoke a request to OpenGate North API and the callback is managed by promises
Returns:
Promise
executeWithAsyncPaging
function executeWithAsyncPaging(resource: string) -> 'Promise'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}
Arguments:
resourcestring - resource to find.
Returns:
Promise