Constructor
new Operation(opts)
Creates an Operation.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
string | The configuration options. Properties
|
- Source:
Example
var Nuxeo = require('nuxeo')
var nuxeo = new Nuxeo({
baseURL: 'http://localhost:8080/nuxeo',
auth: {
method: 'basic',
username: 'Administrator',
password: 'Administrator'
}
});
nuxeo.operation('Document.GetChild')
.input('/default-domain')
.params({
name: 'workspaces',
})
.execute()
.then(function(res) {
// res.uid !== null
// res.title === 'Workspaces'
})
.catch(function(error) {
throw new Error(error);
});
Methods
context(context) → {Operation}
Sets this operation context.
Parameters:
Name | Type | Description |
---|---|---|
context |
object | The operation context. |
- Source:
Returns:
The operation itself.
- Type
- Operation
execute(optsopt) → {Promise}
Executes this operation.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
opts |
object |
<optional> |
Options overriding the ones from this object. |
- Source:
Returns:
A Promise object resolved with the result of the Operation.
- Type
- Promise
input(input) → {Operation}
Sets this operation input.
Parameters:
Name | Type | Description |
---|---|---|
input |
string | Array | Blob | BatchBlob | BatchUpload | The operation input. |
- Source:
Returns:
The operation itself.
- Type
- Operation
param(name, value) → {Operation}
Adds an operation param.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The param name. |
value |
string | The param value. |
- Source:
Returns:
The operation itself.
- Type
- Operation
params(params) → {Operation}
Adds operation params. The given params are merged with the existing ones if any.
Parameters:
Name | Type | Description |
---|---|---|
params |
object | The params to be merge with the existing ones. |
- Source:
Returns:
The operation itself.
- Type
- Operation