Class: Connection

Connection(baseUrl)

A connection to a back-end.

Constructor

new Connection(baseUrl)

Creates a new Connection.

Parameters:
Name Type Description
baseUrl string

URL to the back-end

Source:

Methods

(async) buildProcess(id) → {Builder}

Returns an object to simply build user-defined processes.

Parameters:
Name Type Description
id string

A name for the process.

Source:
See:
  • listProcesses()
Throws:
Error
Returns:
Type
Builder

capabilities() → {Capabilities}

Returns the capabilities of the back-end.

Source:
Returns:

Capabilities

Type
Capabilities

(async) computeResult(process, planopt, budgetopt) → {SyncResult}

Executes a process synchronously and returns the result as the response.

Please note that requests can take a very long time of several minutes or even hours.

Parameters:
Name Type Attributes Default Description
process object

A user-defined process.

plan string <optional>
null

The billing plan to use for this computation.

budget number <optional>
null

The maximum budget allowed to spend for this computation.

Source:
Returns:
  • An object with the data and some metadata.
Type
SyncResult

(async) createJob(process, titleopt, descriptionopt, planopt, budgetopt, additionalopt) → {Job}

Creates a new batch job at the back-end.

Parameters:
Name Type Attributes Default Description
process object

A user-define process to execute.

title string <optional>
null

A title for the batch job.

description string <optional>
null

A description for the batch job.

plan string <optional>
null

The billing plan to use for this batch job.

budget number <optional>
null

The maximum budget allowed to spend for this batch job.

additional object <optional>
{}

Proprietary parameters to pass for the batch job.

Source:
Throws:
Error
Returns:

The stored batch job.

Type
Job

(async) createService(process, type, titleopt, descriptionopt, enabledopt, configurationopt, planopt, budgetopt, additionalopt) → {Service}

Creates a new secondary web service at the back-end.

Parameters:
Name Type Attributes Default Description
process object

A user-defined process.

type string

The type of service to be created (see Connection.listServiceTypes()).

title string <optional>
null

A title for the service.

description string <optional>
null

A description for the service.

enabled boolean <optional>
true

Enable the service (true, default) or not (false).

configuration object <optional>
{}

Configuration parameters to pass to the service.

plan string <optional>
null

The billing plan to use for this service.

budget number <optional>
null

The maximum budget allowed to spend for this service.

additional object <optional>
{}

Proprietary parameters to pass for the batch job.

Source:
Throws:
Error
Returns:

The stored service.

Type
Service

(async) describeAccount() → {object}

Get information about the authenticated user.

Updates the User ID if available.

Source:
Throws:
Error
Returns:

A response compatible to the API specification.

Type
object

(async) describeCollection(collectionId) → {object}

Get further information about a single collection.

Parameters:
Name Type Description
collectionId string

Collection ID to request further metadata for.

Source:
Throws:
Error
Returns:
  • A response compatible to the API specification.
Type
object

(async) describeProcess(processId) → {object|null}

Get information about a single process.

Parameters:
Name Type Description
processId string

Collection ID to request further metadata for.

Source:
See:
  • listProcesses()
Throws:
Error
Returns:
  • A single process as object, or null if none is found.
Type
object | null

(async) download(url, authorize) → {Stream|Blob}

Downloads data from a URL.

May include authorization details where required.

Parameters:
Name Type Description
url string

An absolute or relative URL to download data from.

authorize boolean

Send authorization details (true) or not (false).

Source:
Returns:
  • Returns the data as Stream in NodeJS environments or as Blob in browsers
Type
Stream | Blob

(async) downloadResult(process, target, planopt, budgetopt)

Executes a process synchronously and downloads to result the given path.

Please note that requests can take a very long time of several minutes or even hours.

This method has different behaviour depending on the environment. If a NodeJs environment, writes the downloaded file to the target location on the file system. In a browser environment, offers the file for downloading using the specified name (folders are not supported).

Parameters:
Name Type Attributes Default Description
process object

A user-defined process.

target string

The target, see method description for details.

plan string <optional>
null

The billing plan to use for this computation.

budget number <optional>
null

The maximum budget allowed to spend for this computation.

Source:
Throws:
Error

getBaseUrl() → {string}

Returns the URL of the back-end currently connected to.

Source:
Returns:

The URL or the back-end.

Type
string

(async) getFile(path) → {File}

Opens a (existing or non-existing) file without reading any information or creating a new file at the back-end.

Parameters:
Name Type Description
path string

Path to the file, relative to the user workspace.

Source:
Throws:
Error
Returns:

A file.

Type
File

(async) getJob(id) → {Job}

Get all information about a batch job.

Parameters:
Name Type Description
id string

Batch Job ID.

Source:
Throws:
Error
Returns:

The batch job.

Type
Job

(async) getService(id) → {Job}

Get all information about a secondary web service.

Parameters:
Name Type Description
id string

Service ID.

Source:
Throws:
Error
Returns:

The service.

Type
Job

(async) getUserProcess(id) → {UserProcess}

Get all information about a user-defined process.

Parameters:
Name Type Description
id string

Identifier of the user-defined process.

Source:
Throws:
Error
Returns:

The user-defined process.

Type
UserProcess

(async) init() → {Capabilities}

Initializes the connection by requesting the capabilities.

Source:
Returns:

Capabilities

Type
Capabilities

isAuthenticated() → {boolean}

Returns whether the user is authenticated (logged in) at the back-end or not.

Source:
Returns:

true if authenticated, false if not.

Type
boolean

(async) listAuthProviders() → {array}

List all authentication methods supported by the back-end.

Source:
Throws:
Error
Returns:

An array containing all supported AuthProviders (including all OIDC providers and HTTP Basic).

Type
array

(async) listCollections() → {object}

List all collections available on the back-end.

Source:
Throws:
Error
Returns:

A response compatible to the API specification.

Type
object

(async) listFiles() → {Array.<File>}

Lists all files from the user workspace.

Source:
Throws:
Error
Returns:

A list of files.

Type
Array.<File>

(async) listFileTypes() → {object}

List the supported output file formats.

Source:
Throws:
Error
Returns:

A response compatible to the API specification.

Type
object

(async) listJobs() → {Array.<Job>}

Lists all batch jobs of the authenticated user.

Source:
Throws:
Error
Returns:

A list of jobs.

Type
Array.<Job>

(async) listProcesses() → {object}

List all processes available on the back-end.

Data is cached in memory.

Source:
Throws:
Error
Returns:
  • A response compatible to the API specification.
Type
object

(async) listServices() → {Array.<Job>}

Lists all secondary web services of the authenticated user.

Source:
Throws:
Error
Returns:

A list of services.

Type
Array.<Job>

(async) listServiceTypes() → {object}

List the supported secondary service types.

Source:
Throws:
Error
Returns:

A response compatible to the API specification.

Type
object

(async) listUdfRuntimes() → {object}

List the supported UDF runtimes.

Source:
Throws:
Error
Returns:

A response compatible to the API specification.

Type
object

(async) listUserProcesses() → {Array.<UserProcess>}

Lists all user-defined processes of the authenticated user.

Source:
Throws:
Error
Returns:

A list of user-defined processes.

Type
Array.<UserProcess>

(async) setUserProcess(id, process) → {UserProcess}

Creates a new stored user-defined process at the back-end.

Parameters:
Name Type Description
id string

Unique identifier for the process.

process object

A user-defined process.

Source:
Throws:
Error
Returns:

The new user-defined process.

Type
UserProcess

(async) uploadFile(source, targetPathopt, statusCallbackopt) → {File}

Uploads a file to the user workspace. If a file with the name exists, overwrites it.

This method has different behaviour depending on the environment. In a nodeJS environment the source must be a path to a file as string. In a browser environment the source must be an object from a file upload form.

Parameters:
Name Type Attributes Default Description
source string | object

The source, see method description for details.

targetPath string | null <optional>
null

The target path on the server, relative to the user workspace. Defaults to the file name of the source file.

statusCallback uploadStatusCallback | null <optional>
null

Optionally, a callback that is executed on upload progress updates.

Source:
Throws:
Error
Returns:
Type
File

(async) validateProcess(process) → {Array.<Object>}

Validates a user-defined process at the back-end.

Parameters:
Name Type Description
process object

User-defined process to validate.

Source:
Throws:
Error
Returns:

errors - A list of API compatible error objects. A valid process returns an empty list.

Type
Array.<Object>