Class: Nuxeo

Nuxeo

The Nuxeo class allows using the REST API of a Nuxeo Platform instance.

Constructor

new Nuxeo(opts)

Creates a new Nuxeo instance.

Parameters:
Name Type Description
opts object

The configuration options.

Properties
Name Type Attributes Default Description
baseURL string <optional>
http://localhost:8080/nuxeo/

Base URL of the Nuxeo Platform.

apiPath string <optional>
api/v1

The API path.

Source:
Example
var Nuxeo = require('nuxeo')
var nuxeo = new Nuxeo({
 baseUrl: 'http://localhost:8080/nuxeo',
 auth: {
   username: 'Administrator',
   password: 'Administrator',
 }
});
nuxeo.request('path/').get().then((doc) => {
  // doc.uid !== null
});

Extends

Methods

auth() → {Base}

Sets the auth object to use to authenticate the user.

Inherited From:
Source:
Returns:

The object itself.

Type
Base

batchUpload(opts) → {BatchUpload}

Creates a new BatchUpload object.

Parameters:
Name Type Description
opts object

Options overriding the ones from the Nuxeo object.

Source:
Returns:
Type
BatchUpload

Adds a header.

Parameters:
Name Type Description
name string

the header name

value string

the header value

Inherited From:
Source:
Returns:

The object itself..

Type
Base

headers(headers) → {Base}

Adds headers. The given headers are merged with the existing ones if any.

Parameters:
Name Type Description
headers object

the headers to be merged with the existing ones.

Inherited From:
Source:
Returns:

The object itself.

Type
Base

httpTimeout() → {Base}

Sets a HTTP timeout.

Inherited From:
Source:
Returns:

The object itself.

Type
Base

operation(id, opts) → {Operation}

Creates a new Operation object.

Parameters:
Name Type Description
id string

The operation ID.

opts object

Options overriding the ones from the Nuxeo object.

Source:
Returns:

an Operation.

Type
Operation

repository(name, opts) → {Repository}

Creates a new Repository object.

Parameters:
Name Type Description
name string

The repository name. Default to the Nuxeo's repository name.

opts object

Options overriding the ones from the Nuxeo object.

Source:
Returns:
Type
Repository

repositoryName() → {Base}

Sets the repository name.

Inherited From:
Source:
Returns:

The object itself.

Type
Base

request(path, opts) → {Request}

Creates a new Request object.

Parameters:
Name Type Description
path string

The request default path.

opts object

Options overriding the ones from the Nuxeo object.

Source:
Returns:

an Request.

Type
Request

schemas() → {Base}

Sets the schemas.

Inherited From:
Source:
Returns:

The object itself.

Type
Base

timeout() → {Base}

Sets a global timeout, used as HTTP timeout and transaction timeout
by default.

Inherited From:
Source:
Returns:

The object itself.

Type
Base

transactionTimeout() → {Base}

Sets a transaction timeout.

Inherited From:
Source:
Returns:

The object itself.

Type
Base