type representing a raw request.
type representing a raw response.
drives an HTTP request against the Relution server.
Behavior of this method is simplified from most HTTP/AJAX implementations:
requestUrl
but neither statusCode
nor statusMessage
.requestUrl
, statusCode
and statusMessage
.message
of an HttpError object created. Again, the properties
above are provided.message
is set to the statusMessage
.Thus, to differentiate network failures from server-side failures the statusCode
of the
HttpError rejection is to being used. For deeper inspection provide an
[[options.responseCallback]].
Relution.init({
serverUrl: 'http://localhost:8080',
organization: 'myOrga'
});
let httpOptions: HttpOptions = {method: 'GET', url: 'api/v1/posts'};
//usage as Promise
Relution.web.ajax(httpOptions)
.then((resp) => console.log('posts', resp);)
.catch((e:Relution.web.HttpError) => console.error(e.message, e))
.finally(() => console.log('loading complete!'));
// as Observable
Observable.fromPromise(Relution.web.ajax(httpOptions)).subscribe(
(resp: any) => console.log('posts', resp),
(e:Relution.web.HttpError) => console.error(e.message, e);,
() => console.log('loading complete!')
)
of request, including target url
.
of response body, in case of failure rejects to an HttpError object
including requestUrl
, statusCode
and statusMessage
.
deletes stored login response of some server.
allowing to differentiate when multiple logins are used simultaneously, may be null to forget just anything.
identifying the server.
indicating success or failure.
issues an http/ajax DELETE request against the Relution server.
Please consider this export as an implementation detail of the library and use delete instead.
of request, including target url
, or url.
request body to submit in case optionsOrUrl is a url.
of response body, in case of failure rejects to an Error object including
requestUrl
, statusCode
and statusMessage
.
reads response data from persistent storage.
When there is no data in persitent store, the operation does NOT fail. In this case the resulting promise resolves to nil instead.
required for decryption.
identifying the server.
read from store, resolves to nil when there is no data, gets rejected when decryption fails.
issues an http/ajax GET request against the Relution server.
of request, including target url
, or url.
of response body, in case of failure rejects to an Error object including
requestUrl
, statusCode
and statusMessage
.
issues an http/ajax HEAD request against the Relution server.
of request, including target url
, or url.
of response body, in case of failure rejects to an Error object including
requestUrl
, statusCode
and statusMessage
.
localStorage of browser or via require node-localstorage.
logs into a Relution server.
Notice, specifying offlineCapable=true
in the options will store the login response locally on
the device when online and the login succeeded. When offline, the option will reuse the stored
response. Data encryption is used guaranteeing both secrecy of login data and verification of
the credentials provided.
to use.
overwriting init defaults.
of login response.
logs out of a Relution server.
For explicit logouts (trigger by app user pressing a logout button, for example) specifying
offlineCapable = true
will drop any persisted offline login data for the server logging out
of.
overwriting init defaults.
of logout response.
issues an http/ajax PATCH request against the Relution server.
of request, including target url
, or url.
request body to submit in case optionsOrUrl is a url.
of response body, in case of failure rejects to an Error object including
requestUrl
, statusCode
and statusMessage
.
issues an http/ajax POST request against the Relution server.
of request, including target url
, or url.
request body to submit in case optionsOrUrl is a url.
of response body, in case of failure rejects to an Error object including
requestUrl
, statusCode
and statusMessage
.
issues an http/ajax PUT request against the Relution server.
of request, including target url
, or url.
request body to submit in case optionsOrUrl is a url.
of response body, in case of failure rejects to an Error object including
requestUrl
, statusCode
and statusMessage
.
computes the basepath of a BaaS application.
baseAlias of application, may be name when baseAlias is not changed by developer or application metadata object of Relution server.
of server in effect.
absolute URL of application alias on current server.
computes a server url from a given path.
path to resolve, relative or absolute.
of server in effect.
absolute URL of server.
computes a url from a given path.
http://192.168.0.10:8080/mway/myapp/api/v1/some_endpoint
stays as is,/
are resolved against the Relution server logged
into, so that /gofer/.../rest/...
-style URLs work as expected, for example
/mway/myapp/api/v1/some_endpoint
resolves as above when logged into
http://192.168.0.10:8080
,api/v1/...
are resolved using the Relution server logged in,
the uniqueName
of the currentOrganization
and the application name, for example
api/v1/some_endpoint
resolves as above when application myapp logged into
http://192.168.0.10:8080
using a user of organization mway provided currentOrganization
was not changed explicitly to something else.path to resolve.
of server in effect.
absolute URL of path on current server.
writes response data to persistent storage for offline login purposes.
required for encryption.
identifying the server.
permitted to durable storage.
indicating success or failure.
Generated using TypeDoc