Subsections of util

Expression

and(args)

Parámetros

Nombre Tipo Opcional Descripción
args ...*

Retorna

Tip

Tipo: object
This returns a json with the query of the logical operator "and" built.

Ejemplos

Ex.and(Ex.like("collected.serialNumber", "SN"), Ex.eq("entityId", "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"))


returns:

{
  and : [
    {
      like: {
        "collected.serialNumber": "SN"
      }
    },  
    {
      eq: {
        "entityId": "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"
      }
    }
  ]
}

eq(key, value)

Parámetros

Nombre Tipo Opcional Descripción
key String This is the name of the field
value String This is the value of the field

Retorna

Tip

Tipo: object
This returns a json with the query of the operator "eq" built.

Ejemplos

Ex.eq("entityId", "e64ccd08-e302-4b65-b19d-e38eeb7b2d25")


returns:

{
  eq : {
    "entityId": "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"
  }
}

gt(key, value)

Parámetros

Nombre Tipo Opcional Descripción
key String This is the name of the field
value String This is the value of the field

Retorna

Tip

Tipo: object
This returns a json with the query of the operator "gt" built.

Ejemplos

Ex.gt("collected.imei", "123456786543210")


returns:

{
  gt : {
    "collected.imei": "123456786543210"
  }
}

gte(key, value)

Parámetros

Nombre Tipo Opcional Descripción
key String This is the name of the field
value String This is the value of the field

Retorna

Tip

Tipo: object
This returns a json with the query of the operator "gte" built.

Ejemplos

Ex.gte("collected.imei", "123456786543210")


{
  gte : {
    "collected.imei": "123456786543210"
  }
}

in(key, value)

Parámetros

Nombre Tipo Opcional Descripción
key String This is the name of the field
value String This is the value of the field

Retorna

Tip

Tipo: object
This returns a json with the query of the operator "in" built.

Ejemplos

Ex.in("entityId", ["e64ccd08-e302-4b65-b19d-e38eeb7b2d24","e64ccd08-e302-4b65-b19d-e38eeb7b2d25"])


{
  in : {
    "entityId": ["e64ccd08-e302-4b65-b19d-e38eeb7b2d24","e64ccd08-e302-4b65-b19d-e38eeb7b2d25"]
  }
}

like(key, value)

Parámetros

Nombre Tipo Opcional Descripción
key String This is the name of the field
value String This is the value of the field

Retorna

Tip

Tipo: object
This returns a json with the query of the operator "like" built.

Ejemplos

Ex.like("collected.serialNumber", "SN")


returns:

{
  like : {
    "collected.serialNumber": "SN"
  }
}

lt(key, value)

Parámetros

Nombre Tipo Opcional Descripción
key String This is the name of the field
value String This is the value of the field

Retorna

Tip

Tipo: object
This returns a json with the query of the operator "lt" built.

Ejemplos

Ex.lt("collected.imei", "123456786543210")


returns:

{
  lt : {
    "collected.imei": "123456786543210"
  }
}

lte(key, value)

Parámetros

Nombre Tipo Opcional Descripción
key String This is the name of the field
value String This is the value of the field

Retorna

Tip

Tipo: object
This returns a json with the query of the operator "lte" built.

Ejemplos

Ex.lte("collected.imei", "123456786543210")


{
  lte : {
    "collected.imei": "123456786543210"
  }
}

neq(key, value)

Parámetros

Nombre Tipo Opcional Descripción
key String This is the name of the field
value String This is the value of the field

Retorna

Tip

Tipo: object
This returns a json with the query of the operator "neq" built.

Ejemplos

Ex.neq("entityId", "e64ccd08-e302-4b65-b19d-e38eeb7b2d25")


returns:

{
  neq : {
    "entityId": "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"
  }
}

or(args)

Parámetros

Nombre Tipo Opcional Descripción
args ...*

Retorna

Tip

Tipo: object
This returns a json with the query of the logical operator "or" built.

Ejemplos

Ex.or(Ex.like("collected.serialNumber", "SN"), Ex.eq("entityId", "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"))


returns:

{
  or : [
    {
      like: {
        "collected.serialNumber": "SN"
      }
    },  
    {
      eq: {
        "entityId": "e64ccd08-e302-4b65-b19d-e38eeb7b2d25"
      }
    }
  ]
}

North Amplia REST

This is a wrapper of a Rest api javascript

constructor

This is a constructor of a Rest api javascript

Parámetros

Nombre Tipo Opcional Descripción
_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.

default()

This return a default configuration object

Retorna

Tip

Tipo: object


delete(url, timeout, headers, parameters, body, serviceBaseURL)

Invoke DELETE action to url specified

Parámetros

Nombre Tipo Opcional Descripción
url string 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

Retorna

Tip

Tipo: Promise


get(url, timeout, headers, parameters, asBlob, serviceBaseURL)

Invoke GET action to url specified

Parámetros

Nombre Tipo Opcional Descripción
url string 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

Retorna

Tip

Tipo: Promise


patch(url, data, timeout, headers, parameters, serviceBaseURL)

Invoke PATCH action to url and data specified

Parámetros

Nombre Tipo Opcional Descripción
url string 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

Retorna

Tip

Tipo: Promise


post(url, data, timeout, headers, parameters, serviceBaseURL)

Invoke POST action to url and data specified

Parámetros

Nombre Tipo Opcional Descripción
url string 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

Retorna

Tip

Tipo: Promise


post_multipart(url, formData, events, timeout, headers, parameters, serviceBaseURL)

Invoke POST multipart action to url and data specified

Parámetros

Nombre Tipo Opcional Descripción
url string 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

Retorna

Tip

Tipo: Promise


put(url, data, timeout, headers, parameters, serviceBaseURL)

Invoke PUT action to url and data specified

Parámetros

Nombre Tipo Opcional Descripción
url string 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

Retorna

Tip

Tipo: Promise


put_multipart(url, formData, events, timeout, headers, parameters, serviceBaseURL)

Invoke put multipart action to url and data specified

Parámetros

Nombre Tipo Opcional Descripción
url string 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

Retorna

Tip

Tipo: Promise


Select Element

element(name, fields)

Parámetros

Nombre Tipo Opcional Descripción
name String Indicates the datastream to show
fields [{field: field, alias:alias}] The fields that you want to show from that datastream

Retorna

Tip

Tipo: Object
This returns a json with the object element built.

Ejemplos

 SE.element('provision.device.identifier', ['value'], 'identifier')
 returns:
 {
     name : 'provision.device.identifier',
     fields: ['value'],
     alias: 'identifier
 }

 SE.element('provision.device.identifier', ['value'])
 returns:
 {
     name : 'provision.device.identifier',
     fields: ['value']
 }

South Amplia REST