util
Helper classes for building query expressions, selecting datastream fields, and issuing REST calls to the North and South Amplia APIs.
Helper classes for building query expressions, selecting datastream fields, and issuing REST calls to the North and South Amplia APIs.
Tipo: object
This returns a json with the query of the logical operator "and" built.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| key | String |
❌ | This is the name of the field |
| value | String |
❌ | This is the value of the field |
Tipo: object
This returns a json with the query of the operator "eq" built.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| key | String |
❌ | This is the name of the field |
| value | String |
❌ | This is the value of the field |
Tipo: object
This returns a json with the query of the operator "gt" built.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| key | String |
❌ | This is the name of the field |
| value | String |
❌ | This is the value of the field |
Tipo: object
This returns a json with the query of the operator "gte" built.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| key | String |
❌ | This is the name of the field |
| value | String |
❌ | This is the value of the field |
Tipo: object
This returns a json with the query of the operator "in" built.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| key | String |
❌ | This is the name of the field |
| value | String |
❌ | This is the value of the field |
Tipo: object
This returns a json with the query of the operator "like" built.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| key | String |
❌ | This is the name of the field |
| value | String |
❌ | This is the value of the field |
Tipo: object
This returns a json with the query of the operator "lt" built.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| key | String |
❌ | This is the name of the field |
| value | String |
❌ | This is the value of the field |
Tipo: object
This returns a json with the query of the operator "lte" built.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| key | String |
❌ | This is the name of the field |
| value | String |
❌ | This is the value of the field |
Tipo: object
This returns a json with the query of the operator "neq" built.
Tipo: object
This returns a json with the query of the logical operator "or" built.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| method | string |
❌ | the HTTP verb. |
| url | string |
❌ | the whole URL, query string included. |
Cancels the request. Works before `end()` too, in which case it never leaves.
Tipo: RequestSpec
Sets Accept, accepting the same shorthands.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| type | string |
❌ |
Tipo: RequestSpec
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.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| event | string |
❌ | |
| callback | function |
❌ |
Tipo: RequestSpec
superagent's alias for `on` in Node, where the request is an EventEmitter.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| event | string |
❌ | |
| callback | function |
❌ |
Tipo: RequestSpec
Inert: there is no Node HTTP agent to configure.
Adds a multipart file. A string is a path, as it was under superagent.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| name | string |
❌ | |
| file | * |
❌ | |
| options | `(string | object)=` | ❌ |
Tipo: RequestSpec
Sets an Authorization header. Basic by default, as in a browser; `{ type: 'bearer' }` sends the first argument as a token.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| user | string |
❌ | |
| pass | `(string | object)=` | ❌ |
| options | object= |
❌ |
Tipo: RequestSpec
Inert: buffering was a Node response concern.
Inert: TLS material belonged to the Node agent.
Inert: TLS material belonged to the Node agent.
Cancels the timers without cancelling the request.
Tipo: RequestSpec
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| event | string |
❌ | |
| args | ...* |
❌ |
Tipo: boolean
whether anything was listening.
Sends the request.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| callback | function |
❌ | `(error, response)`, superagent's signature. |
Tipo: RequestSpec
Tipo: Array<string>
the events with at least one listener.
Adds a plain multipart field.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| name | string |
❌ | |
| value | * |
❌ |
Tipo: RequestSpec
Reads a header back, case-insensitively.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| field | string |
❌ |
Tipo: *
superagent's alias for `get`.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| field | string |
❌ |
Tipo: *
Inert, for symmetry with setMaxListeners.
Tipo: number
component-emitter's own predicate.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| event | string |
❌ |
Tipo: boolean
whether anything is listening.
Inert: TLS material belonged to the Node agent.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| event | string |
❌ |
Tipo: number
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| event | string |
❌ |
Tipo: Array<function>
Inert: the response is read whole, as it was in a browser.
Removes one listener, or every listener for the event when no function is given – which is what component-emitter's `off(event)` did.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| event | string |
❌ | |
| callback | function= |
❌ |
Tipo: RequestSpec
Overrides what counts as a successful response.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| fn | function |
❌ | receives the response, returns whether to resolve. |
Tipo: RequestSpec
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| event | string |
❌ | |
| callback | function |
❌ |
Tipo: RequestSpec
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| event | string |
❌ | |
| callback | function |
❌ |
Tipo: RequestSpec
Replaces the parser used on the response body.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| fn | function |
❌ | receives the response text, returns the body. |
Tipo: RequestSpec
Inert: TLS material belonged to the Node agent.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| event | string |
❌ | |
| callback | function |
❌ |
Tipo: RequestSpec
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| event | string |
❌ | |
| callback | function |
❌ |
Tipo: RequestSpec
Appends to the query string. Takes an object or an already-encoded string.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| value | `(string | object)` | ❌ |
Tipo: RequestSpec
superagent's alias for `listeners`.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| event | string |
❌ |
Tipo: Array<function>
Inert: XHR and fetch always follow redirects; superagent could not disable that in a browser.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| event | string= |
❌ | every event when omitted. |
Tipo: RequestSpec
component-emitter's alias for `off`.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| event | string |
❌ | |
| callback | function= |
❌ |
Tipo: RequestSpec
superagent's alias for `off`.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| event | string |
❌ | |
| callback | function= |
❌ |
Tipo: RequestSpec
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| type | string |
❌ | `blob` is the only value the library uses. |
Tipo: RequestSpec
Inert: retrying is not reproduced, because half a retry policy is worse than none.
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.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| data | * |
❌ |
Tipo: RequestSpec
Replaces the serializer used for an object body.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| fn | function |
❌ | receives the body, returns a string. |
Tipo: RequestSpec
Sets one header, or every header in an object.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| field | `(string | object)` | ❌ |
| value | * |
❌ |
Tipo: RequestSpec
itself, for chaining.
Inert: there is no listener ceiling to raise.
Tipo: RequestSpec
Inert: the query string is built by the caller, in order.
Sets the deadline for the whole request, or `{ deadline, response }` for both that and the time allowed before a response starts arriving.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| options | `(number | object)` | ❌ |
Tipo: RequestSpec
Tipo: object
the request as data, as superagent's `toJSON` did.
Sets Content-Type, accepting superagent's shorthands (`json`, `form`, …).
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| type | string |
❌ |
Tipo: RequestSpec
Removes a header, whatever case it was set in.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| field | string |
❌ |
Tipo: RequestSpec
Applies a plugin, superagent's extension point.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| fn | function |
❌ | receives this request. |
Tipo: RequestSpec
Sends cookies and HTTP auth on cross-origin requests.
| Nombre | Tipo | Opcional | Descripción |
|---|---|---|---|
| on | boolean= |
❌ | defaults to true, as superagent's did. |
Tipo: RequestSpec
This is a JavaScript wrapper around a REST API client.
Constructor of the REST API client.
| 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. |
This return a default configuration object
Tipo: object
Invoke DELETE action to url specified
| 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 |
Tipo: Promise
Invoke GET action to url specified
| 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 |
Tipo: Promise
Invoke PATCH action to url and data specified
| 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 |
Tipo: Promise
Invoke POST action to url and data specified
| 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 |
Tipo: Promise
Invoke POST multipart action to url and data specified
| 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 |
Tipo: Promise
Invoke PUT action to url and data specified
| 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 |
Tipo: Promise
Invoke put multipart action to url and data specified
| 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 |
Tipo: Promise
| 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 |
Tipo: Object
This returns a json with the object element built.