Home Manual Reference Source Test Repository
import NorthAmpliaREST from 'opengate-js/src/util/NorthAmpliaREST.js'
public class | source

NorthAmpliaREST

Direct Subclass:

SouthAmpliaREST

This is a wrapper of a Rest api javascript

Constructor Summary

Public Constructor
public

constructor(_options: {url: string, port: string, version: string, apiKey: string, JTW: string}, backend: function)

This is a constructor of a Rest api javascript

Method Summary

Public Methods
public

This return a default configuration object

public

delete(url: string, timeout: number, headers: object, parameters: object, body: object, serviceBaseURL: string): Promise

Invoke DELETE action to url specified

public

get(url: string, timeout: number, headers: object, parameters: object, asBlob: boolean, serviceBaseURL: string): Promise

Invoke GET action to url specified

public

patch(url: string, data: object, timeout: number, headers: object, parameters: object, serviceBaseURL: string): Promise

Invoke PATCH action to url and data specified

public

post(url: string, data: object, timeout: number, headers: object, parameters: object, serviceBaseURL: string): Promise

Invoke POST action to url and data specified

public

post_multipart(url: string, formData: FormData, events: object, timeout: number, headers: object, parameters: object, serviceBaseURL: string): Promise

Invoke POST multipart action to url and data specified

public

put(url: string, data: object, timeout: number, headers: object, parameters: object, serviceBaseURL: string): Promise

Invoke PUT action to url and data specified

public

put_multipart(url: string, formData: FormData, events: object, timeout: number, headers: object, parameters: object, serviceBaseURL: string): Promise

Invoke put multipart action to url and data specified

Public Constructors

public constructor(_options: {url: string, port: string, version: string, apiKey: string, JTW: string}, backend: function) source

This is a constructor of a Rest api javascript

Params:

NameTypeAttributeDescription
_options {url: string, port: string, version: string, apiKey: string, JTW: string}

this is configuration about Opengate North API.

backend function

this is a backend selected to manage a request to Opengate North API.

Public Methods

public default(): object source

This return a default configuration object

Return:

object

public delete(url: string, timeout: number, headers: object, parameters: object, body: object, serviceBaseURL: string): Promise source

Invoke DELETE action to url specified

Params:

NameTypeAttributeDescription
url string
  • nullable: false

url to execute DELETE

timeout number

timeout in milliseconds

headers object

headers of request

parameters object

parameters of request

body object

body of request

serviceBaseURL string

base of the uri petition

Return:

Promise

public get(url: string, timeout: number, headers: object, parameters: object, asBlob: boolean, serviceBaseURL: string): Promise source

Invoke GET action to url specified

Params:

NameTypeAttributeDescription
url string
  • nullable: false

url to execute GET

timeout number

timeout in milliseconds

headers object

headers of request

parameters object

parameters of request

asBlob boolean

response body as Blob

serviceBaseURL string

base of the uri petition

Return:

Promise

public patch(url: string, data: object, timeout: number, headers: object, parameters: object, serviceBaseURL: string): Promise source

Invoke PATCH action to url and data specified

Params:

NameTypeAttributeDescription
url string
  • nullable: false

url to execute PATCH

data object

attach data to request PATCH

timeout number

timeout in milliseconds

headers object

headers of request

parameters object

parameters of request

serviceBaseURL string

base of the uri petition

Return:

Promise

public post(url: string, data: object, timeout: number, headers: object, parameters: object, serviceBaseURL: string): Promise source

Invoke POST action to url and data specified

Params:

NameTypeAttributeDescription
url string
  • nullable: false

url to execute POST

data object

attach data to request POST

timeout number

timeout in milliseconds

headers object

headers of request

parameters object

parameters of request

serviceBaseURL string

base of the uri petition

Return:

Promise

public post_multipart(url: string, formData: FormData, events: object, timeout: number, headers: object, parameters: object, serviceBaseURL: string): Promise source

Invoke POST multipart action to url and data specified

Params:

NameTypeAttributeDescription
url string
  • nullable: false

url to execute POST

formData FormData

attach data to request POST

events object

events allowed, xhr.process

timeout number

timeout in milliseconds

headers object

headers of request

parameters object

parameters of request

serviceBaseURL string

base of the uri petition

Return:

Promise

public put(url: string, data: object, timeout: number, headers: object, parameters: object, serviceBaseURL: string): Promise source

Invoke PUT action to url and data specified

Params:

NameTypeAttributeDescription
url string
  • nullable: false

url to execute PUT

data object

attach data to request PUT

timeout number

timeout in milliseconds

headers object

headers of request

parameters object

parameters of request

serviceBaseURL string

base of the uri petition

Return:

Promise

public put_multipart(url: string, formData: FormData, events: object, timeout: number, headers: object, parameters: object, serviceBaseURL: string): Promise source

Invoke put multipart action to url and data specified

Params:

NameTypeAttributeDescription
url string
  • nullable: false

url to execute POST

formData FormData

attach data to request POST

events object

events allowed, xhr.process

timeout number

timeout in milliseconds

headers object

headers of request

parameters object

parameters of request

serviceBaseURL string

base of the uri petition

Return:

Promise