Defines the builder to execute alarm attend operation
constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
this is configuration about Opengate North API.
Alarm Close Builder
Defines the builder to execute alarm close operation
constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
this is configuration about Opengate North API.
Operation
This is an abstract class; it must be extended by another class that defines the specific request. This class is
responsible for executing operation requests to the OpenGate North API.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
this is ogapi instance
resource
string
❌
this is a base url resource
postObj
object
❌
it will be sent as a data on post action
execute()
This invokes a request to the OpenGate North API and the callback is managed by promises.
This is the base object for everything you can do with a deployment element.
createWithFile(rawFile)
This invokes a request to the OpenGate North API and the callback is managed by promises. This method creates a
deployment element.
Parámetros
Nombre
Tipo
Opcional
Descripción
rawFile
File
❌
this File is the deployment element
Retorna
Tip
Tipo:Promise
deploy()
This invokes a request to the OpenGate North API and the callback is managed by promises. This method creates a
deployment element with the previously assigned file.
Retorna
Tip
Tipo:Promise
update()
This method invalidates the update option
withDownloadUrl(downloadUrl)
Set the downloadUrl attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
downloadUrl
string
❌
Retorna
Tip
Tipo:DeploymentElement
withFile(rawFile)
Sets the file to upload
Parámetros
Nombre
Tipo
Opcional
Descripción
rawFile
object
❌
Retorna
Tip
Tipo:DeploymentElement
withFileName(fileName)
Set the fileName attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
fileName
string
❌
Retorna
Tip
Tipo:DeploymentElement
withName(name)
Set the name attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
name
string
❌
required field
Retorna
Tip
Tipo:DeploymentElement
withOldName(name)
Sets the old name attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
name
string
❌
Retorna
Tip
Tipo:DeploymentElement
withOldPath(path)
Sets the old path attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
path
string
❌
Retorna
Tip
Tipo:DeploymentElement
withOldVersion(version)
Sets the old version attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
version
string
❌
Retorna
Tip
Tipo:DeploymentElement
withOperation(operation)
Set the operation attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
operation
string
❌
required field
Retorna
Tip
Tipo:DeploymentElement
withOption(option)
Set the option attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
option
string
❌
Retorna
Tip
Tipo:DeploymentElement
withOrder(order)
Set the order attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
order
string
❌
required field
Retorna
Tip
Tipo:DeploymentElement
withPath(path)
Set the path attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
path
string
❌
required field
Retorna
Tip
Tipo:DeploymentElement
withTimeout(ms)
The request will have a specific time out if it will be exceeded then the promise throw an exception
This is a base object that contains everything you can do with a connector function catalog entry.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
identifier
String
❌
connectorFunction
Object
❌
addNorthCriteria(northCriteria)
Add northCriteria to parameter northCriterias. Each element is defined by path and value
Parámetros
Nombre
Tipo
Opcional
Descripción
northCriteria
Object
❌
Retorna
Tip
Tipo:ConnectorFunctionsCatalog
addSouthCriteria(southCriteria)
Add southCriteria to parameter southCriterias. Each string can represent an URI, topic, OID…
Parámetros
Nombre
Tipo
Opcional
Descripción
southCriteria
String
❌
Retorna
Tip
Tipo: ``
create()
Create a new connector function catalog
Retorna
Tip
Tipo:Promise
withCloneable(cloneable)
Indicates whether or not the Connector Function is cloneable.
Parámetros
Nombre
Tipo
Opcional
Descripción
cloneable
Boolean
❌
Retorna
Tip
Tipo:ConnectorFunctionsCatalog
withDescription(description)
Description of the connector function. This field is optional.
Parámetros
Nombre
Tipo
Opcional
Descripción
description
String
❌
Retorna
Tip
Tipo:ConnectorFunctionsCatalog
withIdentifier(identifier)
Set the identifier
Parámetros
Nombre
Tipo
Opcional
Descripción
identifier
String
❌
Retorna
Tip
Tipo:ConnectorFunctionsCatalog
withJavascript(javascript)
Connector function javascript code
Parámetros
Nombre
Tipo
Opcional
Descripción
javascript
String
❌
Retorna
Tip
Tipo:ConnectorFunctionsCatalog
withName(name)
Descriptive and unique name
Parámetros
Nombre
Tipo
Opcional
Descripción
name
String
❌
Retorna
Tip
Tipo:ConnectorFunctionsCatalog
withNorthCriterias(northCriterias)
Connector Function selection criteria for operation requests. This field is mandatory if Connector Function type is REQUEST. ⮕ [ each element is defined by path and value ]
Parámetros
Nombre
Tipo
Opcional
Descripción
northCriterias
Array
❌
Retorna
Tip
Tipo:ConnectorFunctionsCatalog
withOperationalStatus(operationalStatus)
Connector Function status
Allowed: DISABLED┃PRODUCTION┃TEST
Parámetros
Nombre
Tipo
Opcional
Descripción
operationalStatus
String
❌
Retorna
Tip
Tipo:ConnectorFunctionsCatalog
withOperationName(operationName)
Used to filter connector functions by operation name. If Connector Function type is REQUEST, this field is mandatory and defined name must be an operation name available for specified Api Key. If the type is COLLECTION or RESPONSE, this field must be null.
Parámetros
Nombre
Tipo
Opcional
Descripción
operationName
String
❌
Retorna
Tip
Tipo:ConnectorFunctionsCatalog
withPayloadType(payloadType)
Enum of allowed types for connector function's payload data. Request Connector Functions only accept JSON.
Allowed: TEXT┃JSON┃BINARY
Parámetros
Nombre
Tipo
Opcional
Descripción
payloadType
String
❌
Retorna
Tip
Tipo:ConnectorFunctionsCatalog
withSouthCriterias(southCriterias)
Connector Function selection criteria for operation responses and data collection. This field is mandatory if Connector Function type is COLLECTION or RESPONSE. ⮕ [ each string can represent an URI, topic, OID… ]. Each string can represent an URI, topic, OID…
Parámetros
Nombre
Tipo
Opcional
Descripción
southCriterias
Array
❌
Retorna
Tip
Tipo:ConnectorFunctionsCatalog
withType(type)
Type of connector function, this is mandatory. Keep in mind that you will be not allowed to modify it.
Allowed: COLLECTION┃REQUEST┃RESPONSE
Parámetros
Nombre
Tipo
Opcional
Descripción
type
String
❌
Retorna
Tip
Tipo:ConnectorFunctionsCatalog
Connector Functions Catalog
This class allows you to make GET requests to the connector functions catalog resource in the OpenGate North
API.
getConnectorFunctionsCatalog()
Get connector functions catalog
Retorna
Tip
Tipo:Promise
Connector Functions Catalog Finder
This class allows you to make GET requests to a connector functions catalog resource in the OpenGate North API.
This is a base object that contains everything you can do with geoclusters.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
Reference to the API object.
withIdentifier(identifier)
Set the identifier attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
identifier
string
❌
required field
Retorna
Tip
Tipo:Geocluster
Geocluster Finder
This class allows making GET requests to the geocluster resource in the OpenGate North API.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
Reference to the API object.
findAll()
Find all available geocluster. This execute a GET http method
Retorna
Tip
Tipo:Promise
findById(id)
Find a specify geocluster by an identifier. This execute a GET http method
Parámetros
Nombre
Tipo
Opcional
Descripción
id
string
❌
Identifier of the geocluster.
Retorna
Tip
Tipo:Promise
findFeatures(id, { zoom, topRight, bottomLeft })
Find features inside the coordinates. This execute a GET http method
Parámetros
Nombre
Tipo
Opcional
Descripción
id
string
❌
Identifier of the geocluster.
coordinates
Object
❌
square defined by the coordinates and the zoom used to find the inside features .
Retorna
Tip
Tipo:Promise
Internal Open Gate API
This is an abstract class. It must be extended by another class that defines the backend, and it is used to make
requests to the OpenGate North API from a browser or a Node.js server.
This is an abstract class; it must be extended by another class that defines the specific request. This class is
responsible for managing execute-operation requests to OpenGate North API.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
this is ogapi instance
resource
string
❌
this is a base url resource
postObj
object
❌
it will be sent as a data on post action
execute()
This invoke a request to OpenGate North API and the callback is managed by promises
Retorna
Tip
Tipo:Promise
updatePeriodicity()
This invoke a request to OpenGate North API and the callback is managed by promises
Defines the builder used to configure the periodicity of an operation. With this builder you can select how the
operation repeats: by days, hours, or minutes.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
parent
BaseOperationBuilder
❌
this is a operationBaseBuilder.
date
Date
❌
Date when operation will be executed
periodicityName
string
❌
Name associated to periodicity
or
number
❌
Date} end - When periodicity ends. By repetitions or by date
days(days)
Set a difference of days in each repetition
Parámetros
Nombre
Tipo
Opcional
Descripción
days
number
❌
Retorna
Tip
Tipo:BaseOperationBuilder
hours(hours)
Set a difference of hours in each repetition
Parámetros
Nombre
Tipo
Opcional
Descripción
hours
number
❌
Retorna
Tip
Tipo:BaseOperationBuilder
minutes(minutes)
Set a difference of minutes in each repetition
Parámetros
Nombre
Tipo
Opcional
Descripción
minutes
number
❌
Retorna
Tip
Tipo:BaseOperationBuilder
Execute Every Builder
Defines the builder used to configure the periodicity of an operation. With this builder you can select the
period by day, week, month, or year.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
parent
BaseOperationBuilder
❌
this is a operationBaseBuilder.
date
Date
❌
Date when operation will be executed
periodicityName
string
❌
Name associated to periodicity
day()
Every day at time defined will be the pattern
Retorna
Tip
Tipo:BaseOperationBuilder
month(months)
Each month at time and day defined will be the pattern
This invoke a request to OpenGate North API and the callback is managed by promises
This function pauses (if it was active), updates the callback and passes the operation to the initial state (if activated, activated again)
This invoke a request to OpenGate North API and the callback is managed by promises
This function pauses (if it was active), updates the delay and passes the operation to the initial state (if activated, activated again)
This invoke a request to OpenGate North API and the callback is managed by promises This function pauses the
operation, updates its delay to zero, and activates it so it executes immediately
Download a specific model by its id. This execute a GET http method
Parámetros
Nombre
Tipo
Opcional
Descripción
organization
string
❌
model organization .
manufacturer
string
❌
model manufacturer .
identifier
string
❌
model name .
Retorna
Tip
Tipo:Promise
Models
This is a base object that contains all you can do about Models.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
Reference to the API object.
withDescription(description)
Set the description attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
description
string
❌
required field
Retorna
Tip
Tipo:Models
withIdentifier(id)
Set the identifier attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
id
string
❌
required field
Retorna
Tip
Tipo:Models
withName(name)
Set the name attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
name
string
❌
required field
Retorna
Tip
Tipo:Models
withNotes(notes)
Set the notes attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
notes
string
❌
Retorna
Tip
Tipo:Models
withUrl(url)
Set the url attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
url
string
❌
Retorna
Tip
Tipo:Models
withVersion(version)
Set the version attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
version
string
❌
Retorna
Tip
Tipo:Models
organization_software
This section covers the Software model and the SoftwareFinder class used to create, configure and query hardware software resources associated with an organization.
This class allows making GET requests to the organization device plans resource in the OpenGate North API.
constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
Reference to the API object.
administrable()
Marks visibility administrable for organization device plans list retrieval.
ogapi.newDevicePlansFinder().administrable().findByOrganization('organization').then().catch();
Retorna
Tip
Tipo:this
assignable()
Marks visibility assignable for organization device plans list retrieval
ogapi.newDevicePlansFinder().assignable().findByOrganization('organization').then().catch();
Retorna
Tip
Tipo:this
default()
Marks visibility default for organization device plans list list retrieval.
ogapi.newDevicePlansFinder().default().findByOrganization('organization').then().catch();
Retorna
Tip
Tipo:this
findByOrganization(organization)
Retrieves all device plans from a organization
ogapi.newDevicePlansFinder().findByOrganization('organization').then().catch();
Parámetros
Nombre
Tipo
Opcional
Descripción
organization
string
❌
organization name .
Retorna
Tip
Tipo:Promise
findByOrganizationAndId(organization, identifier)
Retrieves a specific device plan from a organization
ogapi.newDevicePlansFinder().findByOrganizationAndId('organization',
'identifier').then().catch();
Parámetros
Nombre
Tipo
Opcional
Descripción
organization
string
❌
organization name .
identifier
string
❌
plan name.
Retorna
Tip
Tipo:Promise
Organization Plans
This is a base object that contains everything you can do with organization plans.
This class allows making GET requests to the organization plans resource in the OpenGate North API.
constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
Reference to the API object.
administrable()
Marks visibility administrable for organization plans list retrieval.
ogapi.newOrganizationPlansFinder().administrable().findByOrganization('organization').then().catch();
Retorna
Tip
Tipo:this
assignable()
Marks visibility assignable for organization plans list retrieval
ogapi.newOrganizationPlansFinder().assignable().findByOrganization('organization').then().catch();
Retorna
Tip
Tipo:this
default()
Marks visibility default for plans list list retrieval.
ogapi.newOrganizationPlansFinder().default().findByOrganization('organization').then().catch();
Retorna
Tip
Tipo:this
findByOrganization(organization)
Retrieves all plans from a organization
ogapi.newOrganizationPlansFinder().findByOrganization('organization').then().catch();
Parámetros
Nombre
Tipo
Opcional
Descripción
organization
string
❌
organization name .
Retorna
Tip
Tipo:Promise
findByOrganizationAndId(organization, identifier)
Retrieves a specific plan from a organization
ogapi.newOrganizationPlansFinder().findByOrganizationAndId('organization',
'identifier').then().catch();
This is an abstract class; it must be extended by another class that defines the specific actions of a given
provision. This class is responsible for managing requests to OpenGate North API.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
this is ogapi instance
resource
string
❌
this is a base url resource
timeout
number
✅
timeout on request
requiredParameters
array
❌
serviceBaseURL
string
❌
base of the uri petition
create()
This invoke a request to OpenGate North API and the callback is managed by promises This function creates a
provisioned entity
Retorna
Tip
Tipo:Promise
Ejemplos
ogapi.organizationsBuilder().create()
delete(body)
This invoke a request to OpenGate North API and the callback is managed by promises This function deletes a
provisioned entity
Instead of creating a bulk process, returns the provision process planning for the specified entries. This is a
synchronous process that does not cause changes in the database.
This class allows making GET requests to the countries catalog resource in OpenGate North API.
It needs the _internalCountriesFilter client option, and there is no default. It is built that way on purpose: the catalogue is not an endpoint but an asset entity with
entityType WIRE and an identifier of the form DOMAIN_<domain>, so the caller has to say which
entity to read, the same way it says which api key to use. There is an intention to
replace this with a real catalogue endpoint and drop the option again.
Without it, getCountries() used to die with
Cannot read properties of undefined (reading 'organization'), which said nothing about the
option that was missing.
This class extends SimpleBuilder to allow setting complex values. What is a complex value? It is simply a value
that needs a communications module identifier to be set into the box.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
this is ogapi instance
resource
string
❌
this is the resource url where can be create/delete/update/read the entity
allowedDatastreams
array
✅
Allowed datastreams to add into the new entity
definedSchemas
array
✅
Jsonschema about all OpenGate specific types
jsonSchemaValidator
Validator
✅
Json schema validator tool
withComplex(_id, idCommunicationModules, val)
Set a complex value to entity
Parámetros
Nombre
Tipo
Opcional
Descripción
_id
string
❌
Datastream identifier
idCommunicationModules
string
❌
Communications module identifier
val
object
❌
Value to set.
Csv Bulk Builder
CSV builder. This builder gives you the necessary tools to run a CSV bulk provisioning operation using the
OpenGate REST API.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
required field. This is ogapi instance
organization
string
❌
required field. This is the organization name where entities will be created, updated or deleted
resource
resource
❌
required field. This is the resource used for the bulk provision
timeout
number
✅
timeout in millisecons. The request will have a specific time out if it will be exceeded then the promise throw an exception
async
boolean
✅
forces async execution for the bulk operation
Device Builder
Device builder. This builder gives you the necessary tools to create a device using the OpenGate REST API.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
this is ogapi instance
organization
string
❌
this is the organization name where device will be created
allowedDatastreams
array
✅
Allowed datastreams to add into the new device
definedSchemas
array
✅
Jsonschema about all OpenGate specific types
jsonSchemaValidator
Validator
✅
Json schema validator tool
ms
number
❌
timeout in milliseconds
create()
This invoke a request to OpenGate North API and the callback is managed by promises This function creates a
provisioned entity
Retorna
Tip
Tipo:Promise
Ejemplos
ogapi.organizationsBuilder().create()
update()
This invoke a request to OpenGate North API and the callback is managed by promises This function updates a
provisioned entity and checks whether any subscriber/subscription already exists. If a subscriber/subscription
does not exist, it will be created and then added to the entity box.
Retorna
Tip
Tipo:Promise
Ejemplos
ogapi.entityBuilder.devicesBuilder().update()
Entity Builder
This is a base object that gives you access to everything you can do to provision entities.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
Reference to the API object.
assetsBuilder(organization, timeout)
Get an AssetBuilder to operate with entities of type asset
Get a DeviceBuilder to operate with entities of type device.
It resolves a builder rather than returning one, because the allowed datastreams and their
schemas are read from the platform first. Note that `with()` ignores a datastream the
organization does not allow, warning rather than throwing, so a typo in a datastream name
produces an entity missing that value rather than an error.
A device that the platform will accept needs more than an identifier. This is a create that
works, and every line of it was needed:
The platform rejects an omission one field at a time, so finding this set means a round trip
per missing field:
without `plan`: 400 `0x010E10`, "Device plan is mandatory…"
without `serviceGroup`: 400 `0x010000`, "Required field."
These are not validated here on purpose. The plan message ties the requirement to the
state of the organization, so a client-side rule would refuse calls that other organizations
accept. `provision.device.identifier` is different: it is the entity key, and its absence is
refused locally with `OGAPI_ENTITY_KEY_REQUIRED`.
List the plans an organization actually has with
`ogapi.newDevicePlansFinder().findByOrganization(organization)`.
JSON builder. This builder gives you the necessary tools to run a JSON bulk provisioning operation using the
OpenGate REST API.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
required field. This is ogapi instance
organization
string
❌
required field. This is the organization name where entities will be created, updated or deleted
resource
resource
❌
required field. This is the resource used for the bulk provision
timeout
number
✅
timeout in millisecons. The request will have a specific time out if it will be exceeded then the promise throw an exception
async
boolean
✅
forces async execution for the bulk operation
Json Flattened Bulk Builder
JSON flattened builder. This builder gives you the necessary tools to run a flattened-JSON bulk provisioning
operation using the OpenGate REST API.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
required field. This is ogapi instance
organization
string
❌
required field. This is the organization name where entities will be created, updated or deleted
resource
resource
❌
required field. This is the resource used for the bulk provision
timeout
number
✅
timeout in millisecons. The request will have a specific time out if it will be exceeded then the promise throw an exception
async
boolean
✅
forces async execution for the bulk operation
Simple Builder
This class allows setting simple values.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
this is ogapi instance
resource
string
❌
this is the resource url where can be create/delete/update/read the entity
allowedDatastreams
array
✅
Allowed datastreams to add into the new entity
definedSchemas
array
✅
Jsonschema about all OpenGate specific types
jsonSchemaValidator
Validator
✅
Json schema validator tool
deleteAll()
This invoke a request to OpenGate North API and the callback is managed by promises This function deletes a
provisioned entity
Retorna
Tip
Tipo:Promise
getAllowedDatastreams()
Retorna
Tip
Tipo:array
Allowed Datastream definition array
getEntityKey()
Retorna
Tip
Tipo:string
Entity identifier
patch()
This invoke a request to OpenGate North API and the callback is managed by promises This function patches a
provisioned entity
Retorna
Tip
Tipo:Promise
Ejemplos
ogapi.organizationsBuilder().update()
update()
This invoke a request to OpenGate North API and the callback is managed by promises This function updates a
provisioned entity
Retorna
Tip
Tipo:Promise
Ejemplos
ogapi.organizationsBuilder().update()
with(_id, val)
Set new datastream value
Parámetros
Nombre
Tipo
Opcional
Descripción
_id
string
❌
Datastream identifier
val
objecr
❌
Datastream value. If this value is null then datastream value will be removed.
Subscriber Builder
Subscriber builder. This builder give you the necessary tools to create a subscriber using our OpenGate REST.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
this is ogapi instance
organization
string
❌
this is the organization name where subscriber will be created
allowedDatastreams
array
✅
Allowed datastreams to add into the new subscriber
definedSchemas
array
✅
Jsonschema about all OpenGate specific types
jsonSchemaValidator
Validator
✅
Json schema validator tool
Subscription Builder
Subscription builder. This builder give you the necessary tools to create a subscription using our OpenGate REST.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
this is ogapi instance
organization
string
❌
this is the organization name where subscription will be created
allowedDatastreams
array
✅
Allowed datastreams to add into the new subscription
definedSchemas
array
✅
Jsonschema about all OpenGate specific types
jsonSchemaValidator
Validator
✅
Json schema validator tool
Ticket Builder
Ticket builder. This builder gives you the necessary tools to create a ticket using the OpenGate REST API.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
this is ogapi instance
organization
string
❌
this is the organization name where subscription will be created
allowedDatastreams
array
✅
Allowed datastreams to add into the new subscription
definedSchemas
array
✅
Jsonschema about all OpenGate specific types
jsonSchemaValidator
Validator
✅
Json schema validator tool
Provision Generic Finder
This class allows making GET requests to a resource in the OpenGate North API.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
Reference to the API object.
source
string
❌
Relative url where is located the resource.
reponseJsonData
string
❌
Relative url where is located the resource.
error_not_found
string
❌
String error which will be thrown on not_found error.
provisionProcessors
This section covers the Provision Processors class, for configuring a provision processor’s script and parameters, and the Provision Processors Finder class, for looking up provision processors by organization.
This class extends Search and allows requests to be made to any available resource in the OpenGate North API.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
this is configuration about Opengate North API.
url
string
❌
this define a specific resource to make the search
filter
object
❌
this is the filter
limit
object
❌
this is the pagination about the search
sort
object
❌
this defined parameters to order the result of search
group
object
❌
this defined the group by
execute()
This invokes a request to the OpenGate North API; the response is handled via promises.
Retorna
Tip
Tipo:Promise
Base Search
This is an abstract class that must be extended by another class defining the specific search. This class is
responsible for managing and executing requests to the OpenGate North API.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
this is ogapi instance
resource
string
❌
this is a base url resource
timeout
number
✅
timeout on request
serviceBaseURL
string
❌
base of the uri petition
downloadCsv()
Not implemented yet.
This invoke a request to OpenGate North API and the callback is managed by promises
This invoke a request to OpenGate North API and the callback is managed by promises
Retorna
Tip
Tipo:Promise
execute()
This invokes a request to the OpenGate North API; the response is handled via promises.
Retorna
Tip
Tipo:Promise
executeWithAsyncPaging(resource)
This invokes a request for asynchronous paging to the OpenGate North API; each page is returned via promises and
a notify callback. To cancel the process, return `false` or a string with a custom message from the notify
callback. When the process is canceled, the response will be 403: Forbidden -> {data: 'Cancel
process'|| custom_message, statusCode: 403}
This is an abstract class; it must be extended by another class that defines the specific search. This class is
responsible for managing and executing requests to the OpenGate North API.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
this is ogapi instance
timeout
number
✅
timeout on request
execute()
This invoke a request to OpenGate North API and the callback is managed by promises
This is an abstract class. It is the base class for making all kinds of search requests to the OpenGate North
API.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
parent
InternalOpenGateAPI
❌
this is ogapi instance
routes
object
❌
this defined the routes. One of those routes must be called on Builder before call build method.
addSortAscendingBy(filterField)
Add ascending param into the sort search object
Parámetros
Nombre
Tipo
Opcional
Descripción
filterField
string
❌
This field must be allowed into the specific resource
Retorna
Tip
Tipo:SearchBuilder
Ejemplos
ogapi.subscriptionsSearchBuilder().addSortAscendingBy('prov.customid') // Order by prov.customid Ascending
addSortBy(filterField, typeSort)
Add ascending/descending param into the sort search object
Parámetros
Nombre
Tipo
Opcional
Descripción
filterField
string
❌
This field must be allowed into the specific resource
typeSort
string
❌
Retorna
Tip
Tipo:SearchBuilder
Ejemplos
ogapi.subscriptionsSearchBuilder().addSortBy('prov.customid','ASCENDING') // Order by prov.customid Ascending
ogapi.devicesSearchBuilder().addSortBy('prov.customid','DESCENDING') // Order by prov.customid Descending
addSortDescendingBy(filterField)
Add descending param into the sort search object
Parámetros
Nombre
Tipo
Opcional
Descripción
filterField
string
❌
This field must be allowed into the specific resource
Retorna
Tip
Tipo:SearchBuilder
Ejemplos
ogapi.devicesSearchBuilder().addSortDescendingBy('prov.customid') // Order by prov.customid Descending
Return a promise which it will contains an array with fields recommended with complete structure
Retorna
Tip
Tipo:Promise
findFieldPath(field)
Return a promise which it will contains an string with the path of a field
Retorna
Tip
Tipo:Promise
findFields(input)
Return a promise which it will contains an array with fields recommended with only identifier
Retorna
Tip
Tipo:Promise
limit(size, start)
Set reponse pagination.
Parámetros
Nombre
Tipo
Opcional
Descripción
size
number
❌
Defined the number of elements on response
start
number
✅
Defined the offset on response
Retorna
Tip
Tipo:SearchBuilder
Ejemplos
ogapi.subscribersSearchBuilder().limit(10) // Without offset
ogapi.subscribersSearchBuilder().limit(25,50) //With offset value 50
removeSortBy(filterField)
Remove sort param from the search object
Parámetros
Nombre
Tipo
Opcional
Descripción
filterField
string
❌
This field must be allowed into the specific resource
Retorna
Tip
Tipo:SearchBuilder
Ejemplos
ogapi.subscriptionsSearchBuilder().removeSortBy('prov.customid') // Remove order by prov.customid
ogapi.subscriptionsSearchBuilder().removeSortBy() // Remove all order by parameters
withTimeout(ms)
The request will have a specific time out if it will be exceeded then the promise throw an exception
This class extends Search and allows requests to be made to any available static resource of the OpenGate North
API.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
this is configuration about Opengate North API.
url
string
❌
this define a specific resource to make the search
filter
object
❌
this is the filter
execute()
This invokes a dummy request to the OpenGate North API; the response is handled via promises.
Retorna
Tip
Tipo:Promise
WP Search
This class extends BaseSearch and allows requests to be made to any available resource in the OpenGate North
API. Use this class when the resource does not have the ‘search’ prefix; otherwise, use the Search class.
constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
this is configuration about Opengate North API.
url
string
❌
this define a specific resource to make the search
filter
object
❌
this is the filter
limit
object
❌
this is the pagination about the search
sort
object
❌
this defined parameters to order the result of search
group
object
❌
select
object
❌
timeout
nubmer
❌
security
This section covers the JS API classes for managing certificates (finding, creating, updating) and the base Security provision object.
This class allows making GET requests to the certificate resource in the OpenGate North API.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
Reference to the API object.
findById(id)
Download a specific certificate by id. This execute a GET http method
Parámetros
Nombre
Tipo
Opcional
Descripción
id
string
❌
Id of the certificate.
Retorna
Tip
Tipo:Promise
findByIdAndFormat(id, mimetype)
Download a certificate using id and in a specific format. This execute a GET http method
Parámetros
Nombre
Tipo
Opcional
Descripción
id
string
❌
Id of the certificate.
mimetype
string
❌
Certificate format mimetype.
Retorna
Tip
Tipo:Promise
Certificates
This is a base object that contains everything you can do with Certificates.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
Reference to the API object.
create(rawFile)
This invokes a request to the OpenGate North API, and the callback is managed via promises. This method creates
a certificate element.
Parámetros
Nombre
Tipo
Opcional
Descripción
rawFile
File
❌
this File is the certificate
Retorna
Tip
Tipo:Promise
update()
This invokes a request to the OpenGate North API, and the callback is managed via promises. This method updates
a certificate element.
Retorna
Tip
Tipo:Promise
withAdministrativeState(administrativeState)
Set the administrativeState attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
administrativeState
string
❌
Retorna
Tip
Tipo:Certificates
withDescription(description)
Set the description attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
description
string
❌
optional field
Retorna
Tip
Tipo:Certificates
withDomains(domains)
Set the domains attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
domains
Array
❌
Retorna
Tip
Tipo:Certificates
withId(id)
Set the id attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
id
string
❌
required field on delete
Retorna
Tip
Tipo:Certificates
withName(name)
Set the name attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
name
string
❌
required field
Retorna
Tip
Tipo:Certificates
withParameters(parameters)
Set the parameters attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
parameters
string
❌
optional field
Retorna
Tip
Tipo:Certificates
withTags(tags)
Set the tags attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
tags
Array
❌
Retorna
Tip
Tipo:Certificates
withUsages(usages)
Set the usages attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
usages
Array
❌
Retorna
Tip
Tipo:Certificates
Security
This extends BaseProvision and contains everything you can do with Security.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
this is configuration about Opengate North API.
url
string
❌
this define a specific resource to make the provision
timeseries
This section covers the Timeseries class, for defining and configuring timeseries, and the Timeseries Finder class, for looking up timeseries by organization.
This object represents a timeseries and exposes all the attributes you can configure for it.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
Reference to the API object.
onlyPlan()
Mark timeseries as plan only
Retorna
Tip
Tipo:Timeseries
optimizationPlan()
Request optimization plan
Retorna
Tip
Tipo:Promise
withBucketColumn(bucketColumn)
Name of generated column with bucket date.Required if timeBucket > 0.
Parámetros
Nombre
Tipo
Opcional
Descripción
bucketColumn
string
❌
pattern: ^[a-zA-Z0-9 _-]*$
Retorna
Tip
Tipo:Timeseries
withBucketInitColumn(bucketInitColumn)
Name of generated column with bucket init date.
Parámetros
Nombre
Tipo
Opcional
Descripción
bucketInitColumn
string
❌
pattern: ^[a-zA-Z0-9 _-]*$
Retorna
Tip
Tipo:Timeseries
withColumns(columns)
List of data that is needed for each entity.
Parámetros
Nombre
Tipo
Opcional
Descripción
columns
array
❌
required field
Retorna
Tip
Tipo:Timeseries
withContext(context)
List of data that is needed for each entity.
Parámetros
Nombre
Tipo
Opcional
Descripción
context
array
❌
Retorna
Tip
Tipo:Timeseries
withDescription(description)
Long text to explain timeserie definition
Parámetros
Nombre
Tipo
Opcional
Descripción
description
string
❌
Retorna
Tip
Tipo:Timeseries
withIdentifier(identifier)
Set the identifier attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
identifier
string
❌
required field
Retorna
Tip
Tipo:Timeseries
withIdentifierColumn(identifierColumn)
Set the identifierColumn attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
identifierColumn
string
❌
required field
Retorna
Tip
Tipo:Datasets
withName(name)
Name which will be unique in each organization
Parámetros
Nombre
Tipo
Opcional
Descripción
name
string
❌
required field
Retorna
Tip
Tipo:Timeseries
withOrganization(organization)
Set the organization attribute
Parámetros
Nombre
Tipo
Opcional
Descripción
organization
string
❌
required field
Retorna
Tip
Tipo:Timeseries
withOrigin(origin)
Initial date to first bucket with ISO date time format. Next bucket will be calcullated from this date. Default value is created date with time equals 00:00:00.000Z
Parámetros
Nombre
Tipo
Opcional
Descripción
origin
string
❌
Retorna
Tip
Tipo:Timeseries
withRetention(retention)
Time that a row is stored to be got in searching. Default value is 1 month
Parámetros
Nombre
Tipo
Opcional
Descripción
retention
number
❌
Retorna
Tip
Tipo:Timeseries
withSorts(sorts)
List of sorting fields
Parámetros
Nombre
Tipo
Opcional
Descripción
sorts
array
❌
required field
Retorna
Tip
Tipo:Timeseries
withTimeBucket(timeBucket)
Duration of buckets in seconds.
Parámetros
Nombre
Tipo
Opcional
Descripción
timeBucket
integer
❌
required field
Retorna
Tip
Tipo:Timeseries
Timeseries Finder
This class performs GET requests against the timeseries resource in the OpenGate North API.
Performs a get that returns a definition of timeserie
Parámetros
Nombre
Tipo
Opcional
Descripción
organization
string
❌
organization
timeserieId
string
❌
timeserie identifier
Retorna
Tip
Tipo:Promise
timeseriesFunctionsCatalog
This section covers the JS API classes for the timeseries functions catalog: finding timeseries functions, configuring the TimeseriesFunction object, and the TimeseriesFunctionsHelper utility.
Performs a get that returns a timeseries function metadata
Parámetros
Nombre
Tipo
Opcional
Descripción
organization
string
❌
organization
name
string
❌
Timeseries function Configuration name
script
boolean
❌
If true script content will be downloaded
Retorna
Tip
Tipo:Promise
Timeseries Functions Helper
This class allows making GET requests to the TimeseriesFunctionsHelper resource in the OpenGate North API.
constructor
Constructor
Parámetros
Nombre
Tipo
Opcional
Descripción
ogapi
InternalOpenGateAPI
❌
Reference to the API object.
getDocJavascriptFunctions()
Performs a GET that returns documentation of JavaScript functions from the rules service.
Retorna
Tip
Tipo:Promise
getDocPrivateJavascriptFunctions()
Performs a GET that returns documentation of private JavaScript functions from the rules service.
Retorna
Tip
Tipo:Promise
users
This section covers the User class, for managing account attributes and authentication actions, and the User Finder class, for looking up users by email.
This invoke a request to OpenGate North API and the callback is managed by promises
This function get a JWT for user with Two Factor Authorithation (optional)
This invoke a request to OpenGate North API and the callback is managed by promises
This function request for new password when the user forgets it.
Sends a password recovery email
Cancels the request. Works before `end()` too, in which case it never leaves.
Retorna
Tip
Tipo:RequestSpec
accept(type)
Sets Accept, accepting the same shorthands.
Parámetros
Nombre
Tipo
Opcional
Descripción
type
string
❌
Retorna
Tip
Tipo:RequestSpec
addEventListener(event, callback)
component-emitter's alias for `on`, which is what superagent's browser request carries.
Missed on the first pass because the surface was enumerated from client.js source text, and
component-emitter mixes its methods in at runtime rather than assigning them there. Caught in
review by Chema.
Parámetros
Nombre
Tipo
Opcional
Descripción
event
string
❌
callback
function
❌
Retorna
Tip
Tipo:RequestSpec
addListener(event, callback)
superagent's alias for `on` in Node, where the request is an EventEmitter.
Parámetros
Nombre
Tipo
Opcional
Descripción
event
string
❌
callback
function
❌
Retorna
Tip
Tipo:RequestSpec
agent()
Inert: there is no Node HTTP agent to configure.
attach(name, file, options)
Adds a multipart file. A string is a path, as it was under superagent.
Parámetros
Nombre
Tipo
Opcional
Descripción
name
string
❌
file
*
❌
options
`(string
object)=`
❌
Retorna
Tip
Tipo:RequestSpec
auth(user, pass, options)
Sets an Authorization header. Basic by default, as in a browser; `{ type: 'bearer' }` sends
the first argument as a token.
Parámetros
Nombre
Tipo
Opcional
Descripción
user
string
❌
pass
`(string
object)=`
❌
options
object=
❌
Retorna
Tip
Tipo:RequestSpec
buffer()
Inert: buffering was a Node response concern.
ca()
Inert: TLS material belonged to the Node agent.
cert()
Inert: TLS material belonged to the Node agent.
clearTimeout()
Cancels the timers without cancelling the request.
Retorna
Tip
Tipo:RequestSpec
emit(event)
Parámetros
Nombre
Tipo
Opcional
Descripción
event
string
❌
args
...*
❌
Retorna
Tip
Tipo:boolean
whether anything was listening.
end(callback)
Sends the request.
Parámetros
Nombre
Tipo
Opcional
Descripción
callback
function
❌
`(error, response)`, superagent's signature.
Retorna
Tip
Tipo:RequestSpec
eventNames()
Retorna
Tip
Tipo:Array<string>
the events with at least one listener.
field(name, value)
Adds a plain multipart field.
Parámetros
Nombre
Tipo
Opcional
Descripción
name
string
❌
value
*
❌
Retorna
Tip
Tipo:RequestSpec
get(field)
Reads a header back, case-insensitively.
Parámetros
Nombre
Tipo
Opcional
Descripción
field
string
❌
Retorna
Tip
Tipo:*
getHeader(field)
superagent's alias for `get`.
Parámetros
Nombre
Tipo
Opcional
Descripción
field
string
❌
Retorna
Tip
Tipo:*
getMaxListeners()
Inert, for symmetry with setMaxListeners.
Retorna
Tip
Tipo:number
hasListeners(event)
component-emitter's own predicate.
Parámetros
Nombre
Tipo
Opcional
Descripción
event
string
❌
Retorna
Tip
Tipo:boolean
whether anything is listening.
key()
Inert: TLS material belonged to the Node agent.
listenerCount(event)
Parámetros
Nombre
Tipo
Opcional
Descripción
event
string
❌
Retorna
Tip
Tipo:number
listeners(event)
Parámetros
Nombre
Tipo
Opcional
Descripción
event
string
❌
Retorna
Tip
Tipo:Array<function>
maxResponseSize()
Inert: the response is read whole, as it was in a browser.
off(event, callback)
Removes one listener, or every listener for the event when no function is given – which is
what component-emitter's `off(event)` did.
Parámetros
Nombre
Tipo
Opcional
Descripción
event
string
❌
callback
function=
❌
Retorna
Tip
Tipo:RequestSpec
ok(fn)
Overrides what counts as a successful response.
Parámetros
Nombre
Tipo
Opcional
Descripción
fn
function
❌
receives the response, returns whether to resolve.
Retorna
Tip
Tipo:RequestSpec
on(event, callback)
Parámetros
Nombre
Tipo
Opcional
Descripción
event
string
❌
callback
function
❌
Retorna
Tip
Tipo:RequestSpec
once(event, callback)
Parámetros
Nombre
Tipo
Opcional
Descripción
event
string
❌
callback
function
❌
Retorna
Tip
Tipo:RequestSpec
parse(fn)
Replaces the parser used on the response body.
Parámetros
Nombre
Tipo
Opcional
Descripción
fn
function
❌
receives the response text, returns the body.
Retorna
Tip
Tipo:RequestSpec
pfx()
Inert: TLS material belonged to the Node agent.
prependListener(event, callback)
Parámetros
Nombre
Tipo
Opcional
Descripción
event
string
❌
callback
function
❌
Retorna
Tip
Tipo:RequestSpec
prependOnceListener(event, callback)
Parámetros
Nombre
Tipo
Opcional
Descripción
event
string
❌
callback
function
❌
Retorna
Tip
Tipo:RequestSpec
query(value)
Appends to the query string. Takes an object or an already-encoded string.
Parámetros
Nombre
Tipo
Opcional
Descripción
value
`(string
object)`
❌
Retorna
Tip
Tipo:RequestSpec
rawListeners(event)
superagent's alias for `listeners`.
Parámetros
Nombre
Tipo
Opcional
Descripción
event
string
❌
Retorna
Tip
Tipo:Array<function>
redirects()
Inert: XHR and fetch always follow redirects; superagent could not disable that in a browser.
removeAllListeners(event)
Parámetros
Nombre
Tipo
Opcional
Descripción
event
string=
❌
every event when omitted.
Retorna
Tip
Tipo:RequestSpec
removeEventListener(event, callback)
component-emitter's alias for `off`.
Parámetros
Nombre
Tipo
Opcional
Descripción
event
string
❌
callback
function=
❌
Retorna
Tip
Tipo:RequestSpec
removeListener(event, callback)
superagent's alias for `off`.
Parámetros
Nombre
Tipo
Opcional
Descripción
event
string
❌
callback
function=
❌
Retorna
Tip
Tipo:RequestSpec
responseType(type)
Parámetros
Nombre
Tipo
Opcional
Descripción
type
string
❌
`blob` is the only value the library uses.
Retorna
Tip
Tipo:RequestSpec
retry()
Inert: retrying is not reproduced, because half a retry policy is worse than none.
send(data)
Attaches a body, and picks the Content-Type the way superagent did – at this point, not at
send time, so a `hooks.beforeStart` callback reading `get('Content-Type')` sees what it
always saw. Repeated calls merge.
Parámetros
Nombre
Tipo
Opcional
Descripción
data
*
❌
Retorna
Tip
Tipo:RequestSpec
serialize(fn)
Replaces the serializer used for an object body.
Parámetros
Nombre
Tipo
Opcional
Descripción
fn
function
❌
receives the body, returns a string.
Retorna
Tip
Tipo:RequestSpec
set(field, value)
Sets one header, or every header in an object.
Parámetros
Nombre
Tipo
Opcional
Descripción
field
`(string
object)`
❌
value
*
❌
Retorna
Tip
Tipo:RequestSpec
itself, for chaining.
setMaxListeners()
Inert: there is no listener ceiling to raise.
Retorna
Tip
Tipo:RequestSpec
sortQuery()
Inert: the query string is built by the caller, in order.
timeout(options)
Sets the deadline for the whole request, or `{ deadline, response }` for both that and the
time allowed before a response starts arriving.
Parámetros
Nombre
Tipo
Opcional
Descripción
options
`(number
object)`
❌
Retorna
Tip
Tipo:RequestSpec
toJSON()
Retorna
Tip
Tipo:object
the request as data, as superagent's `toJSON` did.