Constructor
new Nuxeo(optsopt)
Creates a new Nuxeo instance.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
object |
<optional> |
The configuration options. Properties
|
Example
var Nuxeo = require('nuxeo')
var nuxeo = new Nuxeo({
baseUrl: 'http://localhost:8080/nuxeo',
auth: {
method: 'basic',
username: 'Administrator',
password: 'Administrator'
}
});
nuxeo.request('path/')
.get()
.then(function(doc) {
// doc.uid !== null
});
Extends
Methods
(static) promiseLibrary()
Sets the Promise library class to use.
(static) registerAuthenticator()
Registers an Authenticator for a given authentication method.
(static) registerUnmarshaller()
Registers an Unmarshaller for a given entity type.
_computeOptions()
Computes a full options object from an optional opts object and the ones from this object.schemas, enrichers, fetchProperties and headers are not merged but the ones from the opts object
override the ones from this object.
- Inherited From:
- Source:
_http()
Does a http request.
To be used when doing any call on Nuxeo Platform.
batchUpload(optsopt) → {BatchUpload}
Creates a new BatchUpload object.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
opts |
object |
<optional> |
Options overriding the ones from this object. |
Returns:
- Type
- BatchUpload
depth() → {Base}
Sets the depth.
Possible values are: root, children and max.
- Inherited From:
- Source:
Returns:
The object itself.
- Type
- Base
directory(name, optsopt) → {Directory}
Creates a new Directory object.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
name |
string | The directory name. |
|
opts |
object |
<optional> |
Options overriding the ones from this object. |
Returns:
- Type
- Directory
enricher(entity, name) → {Base}
Adds an enricher for a given entity.
Parameters:
| Name | Type | Description |
|---|---|---|
entity |
string | The entity name. |
name |
string | The enricher name. |
- Inherited From:
- Source:
Returns:
The object itself.
- Type
- Base
enrichers(enrichers) → {Base}
Sets the enrichers.
Parameters:
| Name | Type | Description |
|---|---|---|
enrichers |
object | The new enrichers. |
- Inherited From:
- Source:
Returns:
The object itself.
- Type
- Base
Example
{ document: ['acls', 'permissions'] }
fetchProperties(fetchProperties) → {Base}
Sets the properties to fetch.
Parameters:
| Name | Type | Description |
|---|---|---|
fetchProperties |
object | The new properties to fetch. |
- Inherited From:
- Source:
Returns:
The object itself.
- Type
- Base
Example
{ document: ['dc:creator'] }
fetchProperty(entity, name) → {Base}
Adds a property to fetch for a given entity.
Parameters:
| Name | Type | Description |
|---|---|---|
entity |
string | The entity name. |
name |
string | The property name. |
- Inherited From:
- Source:
Returns:
The object itself.
- Type
- Base
groups(optsopt) → {Groups}
Creates a new Groups object to manage groups.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
opts |
object |
<optional> |
Options overriding the ones from this object. |
Returns:
- Type
- Groups
header(name, value) → {Base}
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}
Sets the headers.
Parameters:
| Name | Type | Description |
|---|---|---|
headers |
object | the new headers. |
- Inherited From:
- Source:
Returns:
The object itself.
- Type
- Base
httpTimeout() → {Base}
Sets the HTTP timeout.
- Inherited From:
- Source:
Returns:
The object itself.
- Type
- Base
login(optsopt) → {Promise}
Connects to the Nuxeo Platform instance using the configured authentication.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
opts |
object |
<optional> |
Options overriding the ones from this object. |
Returns:
A promise resolved with the logged in user.
- Type
- Promise
operation(id, optsopt) → {Operation}
Creates a new Operation object.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
id |
string | The operation ID. |
|
opts |
object |
<optional> |
Options overriding the ones from this object. |
Returns:
- Type
- Operation
repository(name, optsopt) → {Repository}
Creates a new Repository object.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
name |
string | The repository name. Default to the Nuxeo's repository name. |
|
opts |
object |
<optional> |
Options overriding the ones from this object. |
Returns:
- Type
- Repository
repositoryName(repositoryName) → {Base}
Sets the repository name.
Parameters:
| Name | Type | Description |
|---|---|---|
repositoryName |
string | The repository name. |
- Inherited From:
- Source:
Returns:
The object itself.
- Type
- Base
request(path, optsopt) → {Request}
Creates a new Request object.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
path |
string | The request default path. |
|
opts |
object |
<optional> |
Options overriding the ones from this object. |
Returns:
- Type
- Request
schemas(schemas) → {Base}
Sets the schemas.
Parameters:
| Name | Type | Description |
|---|---|---|
schemas |
Array | The schemas. |
- Inherited From:
- Source:
Returns:
The object itself.
- Type
- Base
timeout() → {Base}
Sets the global timeout, used as HTTP timeout and transaction timeout
by default.
- Inherited From:
- Source:
Returns:
The object itself.
- Type
- Base
transactionTimeout() → {Base}
Sets the transaction timeout.
- Inherited From:
- Source:
Returns:
The object itself.
- Type
- Base
users(optsopt) → {Users}
Creates a new Users object to manage users.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
opts |
object |
<optional> |
Options overriding the ones from this object. |
Returns:
- Type
- Users
workflows(name, optsopt) → {Workflows}
Creates a new Workflows object.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
name |
string | The repository name. Default to the Nuxeo's repository name. |
|
opts |
object |
<optional> |
Options overriding the ones from this object. |
Returns:
- Type
- Workflows