new Client(serverUrl)
EasyDoseQM client object. Creates a new object handling all the communication with the EasyDoseQM server. Member functions usually take a 'callback' parameter for asynchronous processing. If this parameter is omitted a promise object will be returned.
Parameters:
| Name | Type | Description |
|---|---|---|
serverUrl |
string | URL of the server to connect to |
Methods
-
login(options [, callback])
Authenticate on the server. Send credentials to the server and authenticate the user. The session token is returned in the response cookie. This cookie is used in all subsequent requests to the server.
-
Parameters:
Name Type Argument Description optionsObject Credentials fo the server connection Properties
Name Type Description usernamestring Name of the user passwordstring Password callbackcallback <optional>
The callback that handles the response (optional). Returns:
A Promise object is returned if the callback parameter is omitted.- Type
- Promise
-
logout( [callback])
Log out from the server. Removes any session information from the server.
-
Parameters:
Name Type Argument Description callbackClient~callback <optional>
The callback that handles the response (optional). Returns:
A Promise object is returned if the callback parameter is omitted.- Type
- Promise
-
query(options [, callback])
Query data from the server. Sends the query information to the server for processing. The result will be cached on the server for some amount of time (default 300 seconds).
-
Parameters:
Name Type Argument Description optionsObject Query options Properties
Name Type Description fieldsArray.<string> Query meta tags (will be in result set) filterObject Filter definition Properties
Name Type Description filtersArray.<Object> Array containing filters filters[].fieldstring Field to filter filters[].operatorstring Operator filters[].valuestring Filter value sortArray.<Object> Array containing filters sort[].fieldstring Sort field sort[].dirstring Sort direction takenumber Limit number of result rows (optional). skipnumber Skip rows from the beginning of the result (optional). forceboolean Skip the server cache callbackClient~callback <optional>
The callback that handles the response (optional). Returns:
A Promise object is returned if the callback parameter is omitted.- Type
- Promise
-
analysis(options [, callback])
Analyse data on the server. Sends the analysis information to the server for processing. An analysis is equivalent to a SQL query using aggregate functions. The "group by" clause is the "x" parameter. And the "y" parameter holds all aggregated fields. The result will be cached on the server for some amount of time (default 300 seconds).
-
Parameters:
Name Type Argument Description optionsObject Analysis options Properties
Name Type Description fieldsArray.<string> Query properties filterObject Filter definition Properties
Name Type Description filtersArray.<Object> Array containing filters filters[].fieldstring Field to filter filters[].operatorstring Operator filters[].valuestring Filter value sortArray.<Object> Array containing filters sort[].fieldstring Sort field sort[].dirstring Sort direction takenumber Limit number of result rows (optional). skipnumber Skip rows from the beginning of the result (optional). xstring Category of the analysis (X-Axis / Group - Field) yObject Analysis data definition Properties
Name Type Description fieldstring Aggregate of the field asObject Result fieldname mapping forceboolean Skip the server cache callbackClient~callback <optional>
The callback that handles the response (optional). Returns:
A Promise object is returned if the callback parameter is omitted.- Type
- Promise
-
sqlQuery(options [, callback])
Run a SQL query on the server. Sends a simple SQL query to the server for processing. SQL queries are only allowed for privileged users.
-
Parameters:
Name Type Argument Description optionsObject Query options Properties
Name Type Description fieldsArray.<string> Query properties (will be in result set) fromstring Query table filterObject Filter definition Properties
Name Type Description filtersArray.<Object> Array containing filters filters[].fieldstring Field to filter filters[].operatorstring Operator filters[].valuestring Filter value sortArray.<Object> Array containing filters sort[].fieldstring Sort field sort[].dirstring Sort direction takenumber Limit number of result rows (optional). skipnumber Skip rows from the beginning of the result (optional). callbackClient~callback <optional>
The callback that handles the response (optional). Returns:
A Promise object is returned if the callback parameter is omitted.- Type
- Promise