diff --git a/4.0.4/Base.html b/4.0.4/Base.html new file mode 100644 index 00000000..753babe1 --- /dev/null +++ b/4.0.4/Base.html @@ -0,0 +1,2480 @@ + + + + + JSDoc: Mixin: Base + + + + + + + + + + +
+ +

Mixin: Base

+ + + + + + +
+ +
+ +

Base

+ +

This provides methods to store and use global settings when interacting with Nuxeo Platform.

+

It's not meant to be used directly.

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

_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.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

depth() → {Base}

+ + + + + + +
+

Sets the depth.
+Possible values are: root, children and max.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

enricher(entity, name) → {Base}

+ + + + + + +
+

Adds an enricher for a given entity.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +string + + + +

The entity name.

name + + +string + + + +

The enricher name.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

enrichers(enrichers, override) → {Base}

+ + + + + + +
+

Sets the enrichers.

+

By default, the new enrichers override completely the existing ones. By setting override to false,
+enrichers are merged.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
enrichers + + +object + + + + + +

The new enrichers.

override + + +boolean + + + + + + true + +

If the new enrichers override the existing ones. Default to true.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + +
Example
+ +
{ document: ['acls', 'permissions'] }
+ + + + + + + + + +

fetchProperties(fetchProperties, override) → {Base}

+ + + + + + +
+

Sets the properties to fetch.

+

By default, the new properties override completely the existing ones. By setting override to false,
+the properties to fetch are merged.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
fetchProperties + + +object + + + + + +

The new properties to fetch.

override + + +boolean + + + + + + true + +

If the new fetchProperties override the existing ones. Default to true.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
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:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +string + + + +

The entity name.

name + + +string + + + +

The property name.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + + + + + + + + +
+

Adds a header.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +

the header name

value + + +string + + + +

the header value

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself..

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

headers(headers) → {Base}

+ + + + + + +
+

Sets the headers.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
headers + + +object + + + +

the new headers.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

httpTimeout() → {Base}

+ + + + + + +
+

Sets the HTTP timeout, in milliseconds.

+

The HTTP timeout works only in a Node.js environment.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

repositoryName(repositoryName) → {Base}

+ + + + + + +
+

Sets the repository name.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
repositoryName + + +string + + + +

The repository name.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

schemas(schemas) → {Base}

+ + + + + + +
+

Sets the schemas.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
schemas + + +Array + + + +

The schemas.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

timeout() → {Base}

+ + + + + + +
+

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

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
Deprecated:
  • since 3.6.0, use {#httpTiemout} or {#transactionTimeout} instead.
+ + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

transactionTimeout() → {Base}

+ + + + + + +
+

Sets the transaction timeout, in seconds.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

translateProperties(translateProperties, override) → {Base}

+ + + + + + +
+

Sets the properties to translate.

+

By default, the new properties override completely the existing ones. By setting override to false,
+the properties to translate are merged.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
translateProperties + + +object + + + + + +

The new properties to translate.

override + + +boolean + + + + + + true + +

If the new translateProperties override the existing ones. Default to true.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + +
Example
+ +
{ directoryEntry: ['label'] }
+ + + + + + + + + +

translateProperty(entity, name) → {Base}

+ + + + + + +
+

Adds a property to translate for a given entity.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +string + + + +

The entity name.

name + + +string + + + +

The property name.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/BatchBlob.html b/4.0.4/BatchBlob.html new file mode 100644 index 00000000..ebe432d7 --- /dev/null +++ b/4.0.4/BatchBlob.html @@ -0,0 +1,171 @@ + + + + + JSDoc: Class: BatchBlob + + + + + + + + + + +
+ +

Class: BatchBlob

+ + + + + + +
+ +
+ +

BatchBlob()

+ +

The BatchBlob class wraps a blob uploaded through a BatchUpload to be used
+in an Operation input or as a property value on a Document.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new BatchBlob()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/BatchUpload.html b/4.0.4/BatchUpload.html new file mode 100644 index 00000000..2642379e --- /dev/null +++ b/4.0.4/BatchUpload.html @@ -0,0 +1,1220 @@ + + + + + JSDoc: Class: BatchUpload + + + + + + + + + + +
+ +

Class: BatchUpload

+ + + + + + +
+ +
+ +

BatchUpload(opts)

+ +

The BatchUpload class allows to upload Blob objets to a Nuxeo Platform instance
+using the batch upload API.

+

It creates and maintains a batch id from the Nuxeo Platform instance.

+

Cannot directly be instantiated

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new BatchUpload(opts)

+ + + + + + +
+

Creates a BatchUpload.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +object + + + +

The configuration options.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
nuxeo + + +string + + + + + + + + + + + +

The Nuxeo object linked to this BatchUpload object.

concurrency + + +Number + + + + + + <optional>
+ + + + + +
+ + 5 + +

Number of concurrent uploads.

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Example
+ +
var Nuxeo = require('nuxeo')
+var nuxeo = new Nuxeo({
+ baseURL: 'http://localhost:8080/nuxeo',
+ auth: {
+   method: 'basic',
+   username: 'Administrator',
+   password: 'Administrator'
+ }
+});
+var batch = nuxeo.batchUpload();
+var nuxeoBlob = new Nuxeo.Blob(...);
+batch.upload(nuxeoBlob)
+  .then(function(res) {
+    // res.blob instanceof BatchBlob === true
+  })
+  .catch(function(error) {
+    throw new Error(error);
+  });
+ + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

cancel() → {Promise}

+ + + + + + +
+

Cancels a BatchUpload.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the BatchUpload itself.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

done() → {Promise}

+ + + + + + +
+

Wait for all the current uploads to be finished. Note that it won't wait for uploads added after done() being call.
+If an uploaded is added, you should call again done().
+The BatchUpload#isFinished method can be used to know if the batch is finished.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved when all the current uploads are finished.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + +
Example
+ +
...
+nuxeoBatch.upload(blob1, blob2, blob3);
+nuxeoBatch.done()
+  .then(function(res) {
+    // res.batch === nuxeoBatch
+    // res.blobs[0] is the BatchBlob object related to blob1
+    // res.blobs[1] is the BatchBlob object related to blob2
+    // res.blobs[2] is the BatchBlob object related to blob3
+  })
+  .catch(function(error) {
+    throw new Error(error);
+  });
+ + + + + + + + + +

fetchBlob() → {Promise}

+ + + + + + +
+

Fetches a blob at a given index from the batch.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the BatchUpload itself and the BatchBlob.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

fetchBlobs() → {Promise}

+ + + + + + +
+

Fetches the blobs from the batch.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the BatchUpload itself and the BatchBlobs.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

isFinished() → {Boolean}

+ + + + + + +
+

Returns whether the BatchUpload is finished, ie. has uploads running, or not.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

true if the BatchUpload is finished, false otherwise.

+
+ + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +

removeBlob() → {Promise}

+ + + + + + +
+

Removes a blob at a given index from the batch.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the result of the DELETE request.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

upload(…blobs) → {Promise}

+ + + + + + +
+

Upload one or more blobs.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
blobs + + +Blob + + + + + + + + + + <repeatable>
+ +

Blobs to be uploaded.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved when all blobs are uploaded.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + +
Example
+ +
...
+nuxeoBatch.upload(blob1, blob2, blob3)
+  .then(function(res) {
+    // res.batch === nuxeoBatch
+    // res.blobs[0] is the BatchBlob object related to blob1
+    // res.blobs[1] is the BatchBlob object related to blob2
+    // res.blobs[2] is the BatchBlob object related to blob3
+  })
+  .catch(function(error) {
+    throw new Error(error);
+  });
+ + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/Blob.html b/4.0.4/Blob.html new file mode 100644 index 00000000..b69ccc8e --- /dev/null +++ b/4.0.4/Blob.html @@ -0,0 +1,185 @@ + + + + + JSDoc: Class: Blob + + + + + + + + + + +
+ +

Class: Blob

+ + + + + + +
+ +
+ +

Blob()

+ +

The Blob class represents an abstraction over a blob to be used in the APIs.

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Blob()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Example
+ +
// in the browser, assuming you have a File object from an input for instance
+var blob = new Nuxeo.Blob({ content: file });
+// in node
+var file = fs.createReadStream(filePath);
+var stats = fs.statSync(filePath);
+var blob = new Nuxeo.Blob({
+   content: file,
+   name: path.basename(filePath1),
+   mimeType: 'text/plain',
+   size: stats.size,
+ });
+ + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/Directory.html b/4.0.4/Directory.html new file mode 100644 index 00000000..ce8398a7 --- /dev/null +++ b/4.0.4/Directory.html @@ -0,0 +1,1350 @@ + + + + + JSDoc: Class: Directory + + + + + + + + + + +
+ +

Class: Directory

+ + + + + + +
+ +
+ +

Directory(opts)

+ +

The Directory class allows to work with directories on a Nuxeo Platform instance.

+

Cannot directly be instantiated

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Directory(opts)

+ + + + + + +
+

Creates a Directory.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +object + + + +

The configuration options.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
nuxeo + + +string + + + +

The Nuxeo object linked to this directory.

directoryName + + +string + + + +

The name of this directory.

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Example
+ +
var Nuxeo = require('nuxeo')
+var nuxeo = new Nuxeo({
+ baseURL: 'http://localhost:8080/nuxeo',
+ auth: {
+   method: 'basic',
+   username: 'Administrator',
+   password: 'Administrator'
+ }
+});
+nuxeo.directory('nature')
+  .fetch('article')
+  .then(function(res) {
+    // res.properties.id === 'article'
+    // res.properties.label === 'article label.directories.nature.article'
+  })
+  .catch(function(error) {
+    throw new Error(error));
+  });
+ + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

create(entry, optsopt) → {Promise}

+ + + + + + +
+

Creates an entry.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
entry + + +object + + + + + + + + + +

The entry to be created.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the created DirectoryEntry.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

delete(id, optsopt) → {Promise}

+ + + + + + +
+

Deletes an entry given its id.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
id + + +string + + + + + + + + + +

The entry id.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the result of the DELETE request.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

fetch(id, optsopt) → {Promise}

+ + + + + + +
+

Fetches a directory entry given its id.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
id + + +string + + + + + + + + + +

The entry id.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the DirectoryEntry.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

fetchAll(optsopt) → {Promise}

+ + + + + + +
+

Fetches all directory entries.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the entries.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

update(entry, optsopt) → {Promise}

+ + + + + + +
+

Updates an entry. Assumes that the entry object has an id property.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
entry + + +object + + + + + + + + + +

The entry to be updated.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +object + + + +

The string id of the entry to be updated.

+ +
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the updated DirectoryEntry.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/DirectoryEntry.html b/4.0.4/DirectoryEntry.html new file mode 100644 index 00000000..37e44f6c --- /dev/null +++ b/4.0.4/DirectoryEntry.html @@ -0,0 +1,790 @@ + + + + + JSDoc: Class: DirectoryEntry + + + + + + + + + + +
+ +

Class: DirectoryEntry

+ + + + + + +
+ +
+ +

DirectoryEntry(entry, opts)

+ +

The DirectoryEntry class wraps a directory entry.

+

Cannot directly be instantiated

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new DirectoryEntry(entry, opts)

+ + + + + + +
+

Creates a DirectoryEntry.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entry + + +object + + + +

The initial entry object.
+This DirectoryEntry object will be extended with entry properties.

opts + + +object + + + +

The configuration options.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
directory + + +string + + + +

The Directory object linked to this entry.

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

get(propertyName) → {DirectoryEntry}

+ + + + + + +
+

Gets an entry property.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
propertyName + + +string + + + +

The property name, such as 'label', 'ordering', ...

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +DirectoryEntry + + +
+
+ + + + + + + + + + + + + +

save(optsopt) → {Promise}

+ + + + + + +
+

Saves the entry. It updates only the 'dirty properties' set through the DirectoryEntry#set method.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the updated entry.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

set(properties) → {DirectoryEntry}

+ + + + + + +
+

Sets entry properties.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
properties + + +object + + + +

The properties to set.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +DirectoryEntry + + +
+
+ + + + + + +
Example
+ +
entry.set({
+  'label': 'new label',
+  'ordering': 50,
+});
+ + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/Document.html b/4.0.4/Document.html new file mode 100644 index 00000000..38e7d3b2 --- /dev/null +++ b/4.0.4/Document.html @@ -0,0 +1,5743 @@ + + + + + JSDoc: Class: Document + + + + + + + + + + +
+ +

Class: Document

+ + + + + + +
+ +
+ +

Document(doc, opts)

+ +

The Document class wraps a document.

+

Cannot directly be instantiated

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Document(doc, opts)

+ + + + + + +
+

Creates a Document.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
doc + + +object + + + +

The initial document object. This Document object will be extended with doc properties.

opts + + +object + + + +

The configuration options.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
nuxeo + + +string + + + +

The Nuxeo object linked to this Document object.

repository + + +object + + + +

The Repository object linked to this Document object.

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

addPermission(params, optsopt) → {Promise}

+ + + + + + +
+

Adds a new permission.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
params + + +object + + + + + + + + + +

The params needed to add a new permission.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
permission + + +string + + + + + + + + + +

The permission string to set, such as 'Write', 'Read', ...

username + + +string + + + + + + + + + +

The target username. username or email must be set.

email + + +string + + + + + + + + + +

The target email. username or email must be set.

acl + + +string + + + + + + <optional>
+ + + + + +

The ACL name where to add the new permission.

begin + + +string + + + + + + <optional>
+ + + + + +

Optional begin date.

end + + +string + + + + + + <optional>
+ + + + + +

Optional end date.

blockInheritance + + +string + + + + + + <optional>
+ + + + + +

Whether to block the permissions inheritance or not
+before adding the new permission.

notify + + +string + + + + + + <optional>
+ + + + + +

Optional flag to notify the user of the new permission.

comment + + +string + + + + + + <optional>
+ + + + + +

Optional comment used for the user notification.

+ +
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the updated document.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

convert(convertOpts, optsopt) → {Promise}

+ + + + + + +
+

Converts a Blob from this document.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
convertOpts + + +object + + + + + + + + + +

Configuration options for the conversion.
+At least one of the 'converter', 'type' or 'format' option must be defined.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
xpath + + +string + + + + + + <optional>
+ + + + + +
+ + blobholder:0 + +

The Blob xpath. Default to the main blob 'blobholder:0'.

converter + + +string + + + + + + + + + + + +

Named converter to use.

type + + +string + + + + + + + + + + + +

The destination mime type, such as 'application/pdf'.

format + + +string + + + + + + + + + + + +

The destination format, such as 'pdf'.

+ +
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the response.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

fetchACLs(optsopt) → {Promise}

+ + + + + + +
+

Fetches the ACLs list of this document.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the ACLs.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

fetchAudit(queryOptsopt, optsopt) → {Promise}

+ + + + + + +
+

Fetches the audit of the document.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
queryOpts + + +object + + + + + + <optional>
+ + + + + +
+ +

Parameters for the audit query.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eventId + + +Array + + + + + + <optional>
+ + + + + +

List of event ids to filter.

category + + +Array + + + + + + <optional>
+ + + + + +

List of categories to filter

principalName + + +Array + + + + + + <optional>
+ + + + + +

List of principal names to filter.

startEventDate + + +object + + + + + + <optional>
+ + + + + +

Start date.

+ +
queryParams.endEventDate + + +object + + + + + + <optional>
+ + + + + +
+ +

End date

queryOpts.pageSize + + +number + + + + + + <optional>
+ + + + + +
+ + 0 + +

The number of results per page.

queryOpts.currentPageIndex + + +number + + + + + + <optional>
+ + + + + +
+ + 0 + +

The current page index.

queryOpts.maxResults + + +number + + + + + + <optional>
+ + + + + +
+ +

The expected max results.

queryOpts.sortBy + + +string + + + + + + <optional>
+ + + + + +
+ +

The sort by info.

queryOpts.sortOrder + + +string + + + + + + <optional>
+ + + + + +
+ +

The sort order info.

opts + + +object + + + + + + <optional>
+ + + + + +
+ +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with audit entries.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

fetchBlob(xpathopt, optsopt) → {Promise}

+ + + + + + +
+

Fetch a Blob from this document.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
xpath + + +string + + + + + + <optional>
+ + + + + +
+ + blobholder:0 + +

The Blob xpath. Default to the main blob 'blobholder:0'.

opts + + +object + + + + + + <optional>
+ + + + + +
+ +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the response.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

fetchLockStatus(optsopt) → {Promise}

+ + + + + + +
+

Fetches the lock status of the document.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with true or false.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + +
Examples
+ +
// if the doc is locked
+doc.fetchLockStatus()
+  .then(function(status) {
+    // status.lockOwner === 'Administrator'
+    // status.lockCreated === '2011-10-23T12:00:00.00Z'
+  });
+ +
// if the doc is not locked
+doc.fetchLockStatus()
+  .then(function(status) {
+    // status.lockOwner === undefined
+    // status.lockCreated === undefined
+  });
+ + + + + + + + + +

fetchRendition(name, optsopt) → {Promise}

+ + + + + + +
+

Fetch a rendition from this document.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The rendition name.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the response.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

fetchRenditions(optsopt) → {Promise}

+ + + + + + +
+

Fetches the renditions list of this document.

+

Only available on Nuxeo version LTS 2016 or later.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the rendition definitions.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

fetchWorkflows(optsopt) → {Promise}

+ + + + + + +
+

Fetches the started workflows on this document.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the started workflows.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

followTransition(transitionName, optsopt) → {Promise}

+ + + + + + +
+

Follows a given life cycle transition.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
transitionName + + +string + + + + + + + + + +

The life cycle transition to follow.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the updated document.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

get(propertyName) → {Document}

+ + + + + + +
+

Gets a document property.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
propertyName + + +string + + + +

The property name, such as 'dc:title', 'file:filename', ...

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Document + + +
+
+ + + + + + + + + + + + + +

hasFacet() → {Boolean}

+ + + + + + +
+

Returns whether this document has the input facet or not.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

true if this document has the facet, false otherwise.

+
+ + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +

hasPermission(optsopt) → {Promise}

+ + + + + + +
+

Checks if the user has a given permission. It only works for now for 'Write', 'Read' and 'Everything' permission.
+This method may call the server to compute the available permissions (using the 'permissions' enricher)
+if not already present.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with true or false.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

isCollectable() → {Boolean}

+ + + + + + +
+

Returns whether this document can be added to a collection or not.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

true if this document can be added to a collection, false otherwise.

+
+ + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +

isCollection() → {Boolean}

+ + + + + + +
+

Returns whether this document is a collection or not.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

true if this document is a collection, false otherwise.

+
+ + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +

isFolder() → {Boolean}

+ + + + + + +
+

Returns whether this document is folderish or not.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

true if this document is folderish, false otherwise.

+
+ + + +
+
+ Type +
+
+ +Boolean + + +
+
+ + + + + + + + + + + + + +

lock(optsopt) → {Promise}

+ + + + + + +
+

Locks the document.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the updated document.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

move(dst, nameopt, optsopt) → {Promise}

+ + + + + + +
+

Moves this document.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
dst + + +string + + + + + + + + + + + +

The destination folder.

name + + +string + + + + + + <optional>
+ + + + + +
+ + null + +

The destination name, can be null.

opts + + +object + + + + + + <optional>
+ + + + + +
+ +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the moved document.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

removePermission(params, optsopt) → {Promise}

+ + + + + + +
+

Removes a permission given its id, or all permissions for a given user.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
params + + +object + + + + + + + + + +

The params needed to remove a permission.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
id + + +string + + + + + + + + + +

The permission id. id or user must be set.

user + + +string + + + + + + + + + +

The user to rem. id or user must be set.

acl + + +string + + + + + + <optional>
+ + + + + +

The ACL name where to add the new permission.

+ +
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the updated document.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

save(optsopt) → {Promise}

+ + + + + + +
+

Saves the document. It updates only the 'dirty properties' set through the Document#set method.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the updated document.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

scheduleConversion(convertOpts, optsopt) → {Promise}

+ + + + + + +
+

Schedule a conversion of the Blob from this document.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
convertOpts + + +object + + + + + + + + + +

Configuration options for the conversion.
+At least one of the 'converter', 'type' or 'format' option must be defined.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
xpath + + +string + + + + + + <optional>
+ + + + + +
+ + blobholder:0 + +

The Blob xpath. Default to the main blob 'blobholder:0'.

converter + + +string + + + + + + + + + + + +

Named converter to use.

type + + +string + + + + + + + + + + + +

The destination mime type, such as 'application/pdf'.

format + + +string + + + + + + + + + + + +

The destination format, such as 'pdf'.

+ +
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the response.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

set(properties) → {Document}

+ + + + + + +
+

Sets document properties.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
properties + + +object + + + +

The properties to set.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Document + + +
+
+ + + + + + +
Example
+ +
doc.set({
+  'dc:title': 'new title',
+  'dc:description': 'new description',
+});
+ + + + + + + + + +

startWorkflow(workflowModelName, optsopt) → {Promise}

+ + + + + + +
+

Starts a workflow on this document given a workflow model name.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
workflowModelName + + +string + + + + + + + + + +

The workflow model name.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the started Workflow object.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

unlock(optsopt) → {Promise}

+ + + + + + +
+

Unlocks the document.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the updated document.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/Group.html b/4.0.4/Group.html new file mode 100644 index 00000000..f0307747 --- /dev/null +++ b/4.0.4/Group.html @@ -0,0 +1,471 @@ + + + + + JSDoc: Class: Group + + + + + + + + + + +
+ +

Class: Group

+ + + + + + +
+ +
+ +

Group(group, opts)

+ +

The Group class wraps a group.

+

Cannot directly be instantiated

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Group(group, opts)

+ + + + + + +
+

Creates a Group.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
group + + +object + + + +

The initial group object. This Group object will be extended with group properties.

opts + + +object + + + +

The configuration options.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
groups + + +string + + + +

The Groups object linked to this group.

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

save(optsopt) → {Promise}

+ + + + + + +
+

Saves the group.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the updated group.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/Groups.html b/4.0.4/Groups.html new file mode 100644 index 00000000..940bcaa5 --- /dev/null +++ b/4.0.4/Groups.html @@ -0,0 +1,1107 @@ + + + + + JSDoc: Class: Groups + + + + + + + + + + +
+ +

Class: Groups

+ + + + + + +
+ +
+ +

Groups(opts)

+ +

The Groups class allows to work with groups on a Nuxeo Platform instance.

+

Cannot directly be instantiated

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Groups(opts)

+ + + + + + +
+

Creates a Groups object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +object + + + +

The configuration options.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
nuxeo + + +string + + + +

The Nuxeo object linked to this Groups object.

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Example
+ +
var Nuxeo = require('nuxeo')
+var nuxeo = new Nuxeo({
+ baseURL: 'http://localhost:8080/nuxeo',
+ auth: {
+   method: 'basic',
+   username: 'Administrator',
+   password: 'Administrator'
+ }
+});
+nuxeo.groups()
+  .fetch('administrators')
+  .then(function(res) {
+    // res.groupname === 'administrators'
+    // res.grouplabel === 'Administrators group'
+  })
+  .catch(function(error) {
+    throw new Error(error));
+  });
+ + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

create(user, optsopt) → {Promise}

+ + + + + + +
+

Creates a group.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
user + + +object + + + + + + + + + +

The group to be created.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the created Group.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

delete(groupname, optsopt) → {Promise}

+ + + + + + +
+

Deletes a group given a groupname.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
groupname + + +string + + + + + + + + + +

The groupname.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the result of the DELETE request.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

fetch(groupname, optsopt) → {Promise}

+ + + + + + +
+

Fetches a group given a groupname.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
groupname + + +string + + + + + + + + + +

The groupname.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the Group.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

update(group, optsopt) → {Promise}

+ + + + + + +
+

Updates a group. Assumes that the group object has an groupname field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
group + + +object + + + + + + + + + +

The group to be updated.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the updated Group.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/Nuxeo.html b/4.0.4/Nuxeo.html new file mode 100644 index 00000000..9189330b --- /dev/null +++ b/4.0.4/Nuxeo.html @@ -0,0 +1,5124 @@ + + + + + JSDoc: Class: Nuxeo + + + + + + + + + + +
+ +

Class: Nuxeo

+ + + + + + +
+ +
+ +

Nuxeo(optsopt)

+ +

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

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Nuxeo(optsopt)

+ + + + + + +
+

Creates a new Nuxeo instance.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

The configuration options.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
baseURL + + +string + + + + + + <optional>
+ + + + + +
+ + http://localhost:8080/nuxeo/ + +

Base URL of the Nuxeo Platform.

apiPath + + +string + + + + + + <optional>
+ + + + + +
+ + api/v1 + +

The API path.

auth + + +object + + + + + + <optional>
+ + + + + +
+ +

The authentication configuration.

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
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

+ + + + + + + +

_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.

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

_http()

+ + + + + + +
+

Does a http request.

+

To be used when doing any call on Nuxeo Platform.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
Deprecated:
  • since version 3.3, use {#http} instead.
+ + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

batchUpload(optsopt) → {BatchUpload}

+ + + + + + +
+

Creates a new BatchUpload object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +BatchUpload + + +
+
+ + + + + + + + + + + + + +

connect(optsopt) → {Promise}

+ + + + + + +
+

Connects to the Nuxeo Platform instance using the configured authentication.

+

This method fills the user property with the current user
+and the serverVersion property with the Nuxeo Server version.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise resolved with the connected client.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

depth() → {Base}

+ + + + + + +
+

Sets the depth.
+Possible values are: root, children and max.

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

directory(name, optsopt) → {Directory}

+ + + + + + +
+

Creates a new Directory object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The directory name.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Directory + + +
+
+ + + + + + + + + + + + + +

enricher(entity, name) → {Base}

+ + + + + + +
+

Adds an enricher for a given entity.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +string + + + +

The entity name.

name + + +string + + + +

The enricher name.

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

enrichers(enrichers, override) → {Base}

+ + + + + + +
+

Sets the enrichers.

+

By default, the new enrichers override completely the existing ones. By setting override to false,
+enrichers are merged.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
enrichers + + +object + + + + + +

The new enrichers.

override + + +boolean + + + + + + true + +

If the new enrichers override the existing ones. Default to true.

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + +
Example
+ +
{ document: ['acls', 'permissions'] }
+ + + + + + + + + +

fetchProperties(fetchProperties, override) → {Base}

+ + + + + + +
+

Sets the properties to fetch.

+

By default, the new properties override completely the existing ones. By setting override to false,
+the properties to fetch are merged.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
fetchProperties + + +object + + + + + +

The new properties to fetch.

override + + +boolean + + + + + + true + +

If the new fetchProperties override the existing ones. Default to true.

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
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:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +string + + + +

The entity name.

name + + +string + + + +

The property name.

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

groups(optsopt) → {Groups}

+ + + + + + +
+

Creates a new Groups object to manage groups.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Groups + + +
+
+ + + + + + + + + + + + + + + + + + + + +
+

Adds a header.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +

the header name

value + + +string + + + +

the header value

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself..

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

headers(headers) → {Base}

+ + + + + + +
+

Sets the headers.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
headers + + +object + + + +

the new headers.

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

http()

+ + + + + + +
+

Does a http request.

+

To be used when doing any call on Nuxeo Platform.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

httpTimeout() → {Base}

+ + + + + + +
+

Sets the HTTP timeout, in milliseconds.

+

The HTTP timeout works only in a Node.js environment.

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

login(optsopt) → {Promise}

+ + + + + + +
+

Connects to the Nuxeo Platform instance using the configured authentication.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + +
Deprecated:
  • since version 3.0, use {#connect} instead.
+ + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise resolved with the logged in user.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

operation(id, optsopt) → {Operation}

+ + + + + + +
+

Creates a new Operation object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
id + + +string + + + + + + + + + +

The operation ID.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Operation + + +
+
+ + + + + + + + + + + + + +

repository(name, optsopt) → {Repository}

+ + + + + + +
+

Creates a new Repository object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
name + + +string + + + + + + + + + + + + null + +

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

opts + + +object + + + + + + <optional>
+ + + + + +
+ +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Repository + + +
+
+ + + + + + + + + + + + + +

repositoryName(repositoryName) → {Base}

+ + + + + + +
+

Sets the repository name.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
repositoryName + + +string + + + +

The repository name.

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

request(path, optsopt) → {Request}

+ + + + + + +
+

Creates a new Request object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
path + + +string + + + + + + + + + +

The request default path.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Request + + +
+
+ + + + + + + + + + + + + +

schemas(schemas) → {Base}

+ + + + + + +
+

Sets the schemas.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
schemas + + +Array + + + +

The schemas.

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

timeout() → {Base}

+ + + + + + +
+

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

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + +
Deprecated:
  • since 3.6.0, use {#httpTiemout} or {#transactionTimeout} instead.
+ + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

transactionTimeout() → {Base}

+ + + + + + +
+

Sets the transaction timeout, in seconds.

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

translateProperties(translateProperties, override) → {Base}

+ + + + + + +
+

Sets the properties to translate.

+

By default, the new properties override completely the existing ones. By setting override to false,
+the properties to translate are merged.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDefaultDescription
translateProperties + + +object + + + + + +

The new properties to translate.

override + + +boolean + + + + + + true + +

If the new translateProperties override the existing ones. Default to true.

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + +
Example
+ +
{ directoryEntry: ['label'] }
+ + + + + + + + + +

translateProperty(entity, name) → {Base}

+ + + + + + +
+

Adds a property to translate for a given entity.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +string + + + +

The entity name.

name + + +string + + + +

The property name.

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The object itself.

+
+ + + +
+
+ Type +
+
+ +Base + + +
+
+ + + + + + + + + + + + + +

users(optsopt) → {Users}

+ + + + + + +
+

Creates a new Users object to manage users.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Users + + +
+
+ + + + + + + + + + + + + +

workflows(name, optsopt) → {Workflows}

+ + + + + + +
+

Creates a new Workflows object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

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

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Workflows + + +
+
+ + + + + + + + + + + + + +

(static) promiseLibrary()

+ + + + + + +
+

Sets the Promise library class to use.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(static) registerAuthenticator()

+ + + + + + +
+

Registers an Authenticator for a given authentication method.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

(static) registerUnmarshaller()

+ + + + + + +
+

Registers an Unmarshaller for a given entity type.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/Operation.html b/4.0.4/Operation.html new file mode 100644 index 00000000..e584943b --- /dev/null +++ b/4.0.4/Operation.html @@ -0,0 +1,1191 @@ + + + + + JSDoc: Class: Operation + + + + + + + + + + +
+ +

Class: Operation

+ + + + + + +
+ +
+ +

Operation(opts)

+ +

The Operation class allows to execute an operation on a Nuxeo Platform instance.

+

Cannot directly be instantiated

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Operation(opts)

+ + + + + + +
+

Creates an Operation.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +string + + + +

The configuration options.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
nuxeo + + +string + + + +

The Nuxeo object linked to this Operation object.

id + + +string + + + +

The ID of the operation.

url + + +string + + + +

The automation URL.

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
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:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
context + + +object + + + +

The operation context.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The operation itself.

+
+ + + +
+
+ Type +
+
+ +Operation + + +
+
+ + + + + + + + + + + + + +

execute(optsopt) → {Promise}

+ + + + + + +
+

Executes this operation.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
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:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
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:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
params + + +object + + + +

The params to be merge with the existing ones.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The operation itself.

+
+ + + +
+
+ Type +
+
+ +Operation + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/Repository.html b/4.0.4/Repository.html new file mode 100644 index 00000000..2b991535 --- /dev/null +++ b/4.0.4/Repository.html @@ -0,0 +1,1669 @@ + + + + + JSDoc: Class: Repository + + + + + + + + + + +
+ +

Class: Repository

+ + + + + + +
+ +
+ +

Repository(opts)

+ +

The Repository class allows to work with documents on a Nuxeo Platform instance.

+

Cannot directly be instantiated

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Repository(opts)

+ + + + + + +
+

Creates a Repository.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +object + + + +

The configuration options.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
nuxeo + + +string + + + +

The Nuxeo object linked to this repository.

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Example
+ +
var Nuxeo = require('nuxeo')
+var nuxeo = new Nuxeo({
+ baseURL: 'http://localhost:8080/nuxeo',
+ auth: {
+   method: 'basic',
+   username: 'Administrator',
+   password: 'Administrator'
+ }
+});
+nuxeo.repository('default')
+  .fetch('/default-domain')
+  .then(function(res) {
+    // res.uid !== null
+    // res.type === 'Domain'
+  })
+  .catch(function(error) {
+    throw new Error(error);
+  });
+ + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

create(parentRef, doc, optsopt) → {Promise}

+ + + + + + +
+

Creates a document.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
parentRef + + +string + + + + + + + + + +

The parent document ref. A path if starting with '/', otherwise and id.

doc + + +object + + + + + + + + + +

The document to be created.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the created Document.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

delete(ref, optsopt) → {Promise}

+ + + + + + +
+

Deletes a document given a document ref.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
ref + + +string + + + + + + + + + +

The document ref. A path if starting with '/', otherwise and id.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the result of the DELETE request.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

fetch(ref, optsopt) → {Promise}

+ + + + + + +
+

Fetches a document given a document ref.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
ref + + +string + + + + + + + + + +

The document ref. A path if starting with '/', otherwise and id.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the Document.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

query(queryOpts, optsopt) → {Promise}

+ + + + + + +
+

Performs a query returning documents.
+Named parameters can be set in the queryOpts object, such as
+{ query: ..., customParam1: 'foo', anotherParam: 'bar'}

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
queryOpts + + +object + + + + + + + + + +

The query options.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
query + + +string + + + + + + + + + + + +

The query to execute. query or pageProvider must be set.

pageProvider + + +string + + + + + + + + + + + +

The page provider name to execute. query or pageProvider must be set.

queryParams + + +array + + + + + + <optional>
+ + + + + +
+ +

Ordered parameters for the query or page provider.

pageSize + + +number + + + + + + <optional>
+ + + + + +
+ + 0 + +

The number of results per page.

currentPageIndex + + +number + + + + + + <optional>
+ + + + + +
+ + 0 + +

The current page index.

maxResults + + +number + + + + + + <optional>
+ + + + + +
+ +

The expected max results.

sortBy + + +string + + + + + + <optional>
+ + + + + +
+ +

The sort by info.

sortOrder + + +string + + + + + + <optional>
+ + + + + +
+ +

The sort order info.

+ +
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the response where the entries are replaced
+with Document objetcs.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

update(doc, optsopt) → {Promise}

+ + + + + + +
+

Updates a document. Assumes that the doc object has an uid field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doc + + +object + + + + + + + + + +

The document to be updated.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the updated Document.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/Request.html b/4.0.4/Request.html new file mode 100644 index 00000000..310b67af --- /dev/null +++ b/4.0.4/Request.html @@ -0,0 +1,1566 @@ + + + + + JSDoc: Class: Request + + + + + + + + + + +
+ +

Class: Request

+ + + + + + +
+ +
+ +

Request(opts)

+ +

The Request class allows to execute REST request on a Nuxeo Platform instance.

+

Cannot directly be instantiated

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Request(opts)

+ + + + + + +
+

Creates a Request.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +object + + + +

The configuration options.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
nuxeo + + +string + + + +

The Nuxeo object linked to this groups object.

path + + +string + + + +

The initial path of the request.

queryParams + + +string + + + +

The initial query parameters of the request.

url + + +string + + + +

The REST API URL.

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Example
+ +
var Nuxeo = require('nuxeo')
+var nuxeo = new Nuxeo({
+ baseURL: 'http://localhost:8080/nuxeo',
+ auth: {
+   method: 'basic',
+   username: 'Administrator',
+   password: 'Administrator'
+ }
+});
+nuxeo.request('/path/default-domain')
+  .get()
+  .then(function(res) {
+    // res.uid !== null
+    // res.type === 'Domain'
+  })
+  .catch(function(error) {
+    throw new Error(error);
+  });
+ + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

delete(optsopt) → {Promise}

+ + + + + + +
+

Performs a DELETE request.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the result of the request.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

execute(opts) → {Promise}

+ + + + + + +
+

Performs a Request.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +object + + + +

Options overriding the ones from this object.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
method + + +string + + + +

The HTTP method.

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the result of the request.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

get(opts) → {Promise}

+ + + + + + +
+

Performs a GET request.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +object + + + +

Options overriding the ones from the Request object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the result of the request.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

path(path) → {Request}

+ + + + + + +
+

Adds path segment.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
path + + +string + + + +

The path segment.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The request itself.

+
+ + + +
+
+ Type +
+
+ +Request + + +
+
+ + + + + + + + + + + + + +

post(optsopt) → {Promise}

+ + + + + + +
+

Performs a POST request.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the result of the request.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

put(optsopt) → {Promise}

+ + + + + + +
+

Performs a PUT request.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the result of the request.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

queryParams(queryParams) → {Request}

+ + + + + + +
+

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

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
queryParams + + +object + + + +

The query params to be merged with the existing ones.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The request itself.

+
+ + + +
+
+ Type +
+
+ +Request + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/ServerVersion.html b/4.0.4/ServerVersion.html new file mode 100644 index 00000000..a4a159ec --- /dev/null +++ b/4.0.4/ServerVersion.html @@ -0,0 +1,881 @@ + + + + + JSDoc: Class: ServerVersion + + + + + + + + + + +
+ +

Class: ServerVersion

+ + + + + + +
+ +
+ +

ServerVersion()

+ +

The ServerVersion class represents a Nuxeo Server version.

+

It handles major, minor and hotfix version.

+

Limitations:

+
    +
  • Ignore the -SNAPSHOT and -IXXXXXXXX_XXXX suffixes when parsing the server version
  • +
  • '9.10-SNAPSHOT' is considered equals to '9.10'
  • +
  • '9.10-20180101_1212' is considered equals to '9.10'
  • +
+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new ServerVersion()

+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

eq(version)

+ + + + + + +
+

Returns whether this version is equal to the version param.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
version + + +string +| + +ServerVersion + + + +

The other version.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

gt(version)

+ + + + + + +
+

Returns whether this version is greater than the version param.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
version + + +string +| + +ServerVersion + + + +

The other version.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

gte(version)

+ + + + + + +
+

Returns whether this version is greater than or equal to the version param.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
version + + +string +| + +ServerVersion + + + +

The other version.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

lt(version)

+ + + + + + +
+

Returns whether this version is lesser than the version param.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
version + + +string +| + +ServerVersion + + + +

The other version.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +

lte(version)

+ + + + + + +
+

Returns whether this version is lesser than or equal to the version param.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
version + + +string +| + +ServerVersion + + + +

The other version.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/Task.html b/4.0.4/Task.html new file mode 100644 index 00000000..0aefb396 --- /dev/null +++ b/4.0.4/Task.html @@ -0,0 +1,1446 @@ + + + + + JSDoc: Class: Task + + + + + + + + + + +
+ +

Class: Task

+ + + + + + +
+ +
+ +

Task(task, opts)

+ +

The Task class wraps a task.

+

Cannot directly be instantiated

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Task(task, opts)

+ + + + + + +
+

Creates a Task.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
task + + +object + + + +

The initial task object. This Task object will be extended with task properties.

opts + + +object + + + +

The configuration options.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
nuxeo + + +string + + + + + + + + + +

The Nuxeo object linked to this task.

documentId + + +string + + + + + + <optional>
+ + + + + +

The attached document id of this workflow, if any.

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

complete(action, taskOptsopt, optsopt) → {Promise}

+ + + + + + +
+

Completes the task.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
action + + +string + + + + + + + + + +

The action name to complete the task.

taskOpts + + +object + + + + + + <optional>
+ + + + + +

Configuration options for the task completion.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
variables + + +string + + + + + + <optional>
+ + + + + +

Optional variables to override the existing ones.

comment + + +string + + + + + + <optional>
+ + + + + +

Optional comment.

+ +
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the completed task.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

delegate(actors, taskOptsopt, optsopt) → {Promise}

+ + + + + + +
+

Delegates the task to the given actors.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
actors + + +string + + + + + + + + + +

Actors to delegate the task.

taskOpts + + +object + + + + + + <optional>
+ + + + + +

Configuration options for the task delegation.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
comment + + +string + + + + + + <optional>
+ + + + + +

Optional comment.

+ +
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with nothing.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

reassign(actors, taskOptsopt, optsopt) → {Promise}

+ + + + + + +
+

Reassigns the task to the given actors.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
actors + + +string + + + + + + + + + +

Actors to reassign the task.

taskOpts + + +object + + + + + + <optional>
+ + + + + +

Configuration options for the task reassignment.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
comment + + +string + + + + + + <optional>
+ + + + + +

Optional comment.

+ +
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with nothing.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

variable(name, value) → {Task}

+ + + + + + +
+

Sets a task variable.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +

The name of the variable.

value + + +string + + + +

The value of the variable.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

The task itself.

+
+ + + +
+
+ Type +
+
+ +Task + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/User.html b/4.0.4/User.html new file mode 100644 index 00000000..2c438ae6 --- /dev/null +++ b/4.0.4/User.html @@ -0,0 +1,789 @@ + + + + + JSDoc: Class: User + + + + + + + + + + +
+ +

Class: User

+ + + + + + +
+ +
+ +

User(user, opts)

+ +

The User class wraps an user.

+

Cannot directly be instantiated

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new User(user, opts)

+ + + + + + +
+

Creates a User.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +object + + + +

The initial user object. This User object will be extended with user properties.

opts + + +object + + + +

The configuration options.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
users + + +string + + + +

The Users object linked to this user.

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

get(propertyName) → {User}

+ + + + + + +
+

Gets a user property.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
propertyName + + +string + + + +

The property name, such as 'fistName', 'email', ...

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +User + + +
+
+ + + + + + + + + + + + + +

save(optsopt) → {Promise}

+ + + + + + +
+

Saves the user. It updates only the 'dirty properties' set through the User#set method.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the updated user.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

set(properties) → {User}

+ + + + + + +
+

Sets user properties.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
properties + + +object + + + +

The properties to set.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +User + + +
+
+ + + + + + +
Example
+ +
user.set({
+  firstName: 'new first name',
+  company: 'new company',
+});
+ + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/Users.html b/4.0.4/Users.html new file mode 100644 index 00000000..2a9e7c42 --- /dev/null +++ b/4.0.4/Users.html @@ -0,0 +1,1107 @@ + + + + + JSDoc: Class: Users + + + + + + + + + + +
+ +

Class: Users

+ + + + + + +
+ +
+ +

Users(opts)

+ +

The Users class allows to work with users on a Nuxeo Platform instance.

+

Cannot directly be instantiated

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Users(opts)

+ + + + + + +
+

Creates a Users object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +object + + + +

The configuration options.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
nuxeo + + +string + + + +

The Nuxeo object linked to this Users object.

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Example
+ +
var Nuxeo = require('nuxeo')
+var nuxeo = new Nuxeo({
+ baseURL: 'http://localhost:8080/nuxeo',
+ auth: {
+   method: 'basic',
+   username: 'Administrator',
+   password: 'Administrator',
+ }
+});
+nuxeo.users()
+  .fetch('Administrator')
+  .then(function(res) => {
+    // res.id === 'Administrator'
+    // res.properties.username === 'Administrator'
+  })
+  .catch(function(error) {
+    throw new Error(error);
+  });
+ + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

create(user, optsopt) → {Promise}

+ + + + + + +
+

Creates an user.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
user + + +object + + + + + + + + + +

The user to be created.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the created User.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

delete(username, optsopt) → {Promise}

+ + + + + + +
+

Deletes an user given an username.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
username + + +string + + + + + + + + + +

The username.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the result of the DELETE request.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

fetch(username, optsopt) → {Promise}

+ + + + + + +
+

Fetches an user given an username.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
username + + +string + + + + + + + + + +

The username.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the User.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

update(user, optsopt) → {Promise}

+ + + + + + +
+

Updates an user. Assumes that the user object has an id field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
user + + +object + + + + + + + + + +

The user to be updated.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the updated User.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/Workflow.html b/4.0.4/Workflow.html new file mode 100644 index 00000000..dc1cff27 --- /dev/null +++ b/4.0.4/Workflow.html @@ -0,0 +1,795 @@ + + + + + JSDoc: Class: Workflow + + + + + + + + + + +
+ +

Class: Workflow

+ + + + + + +
+ +
+ +

Workflow(workflow, opts)

+ +

The Workflow class wraps a workflow.

+

Cannot directly be instantiated

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Workflow(workflow, opts)

+ + + + + + +
+

Creates a Workflow.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
workflow + + +object + + + +

The initial workflow object. This User object will be extended with workflow properties.

opts + + +object + + + +

The configuration options.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
nuxeo + + +string + + + + + + + + + +

The Nuxeo object linked to this workflow.

documentId + + +string + + + + + + <optional>
+ + + + + +

The attached document id of this workflow, if any.

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

_buildTasksRequest() → {Request}

+ + + + + + +
+

Builds the correct Request object depending of whether this workflow is attached to a document or not.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A request object.

+
+ + + +
+
+ Type +
+
+ +Request + + +
+
+ + + + + + + + + + + + + +

fetchGraph(optsopt) → {Promise}

+ + + + + + +
+

Fetches this workflow graph.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the workflow graph.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

fetchTasks(optsopt) → {Promise}

+ + + + + + +
+

Fetches the tasks of this workflow.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the tasks.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/Workflows.html b/4.0.4/Workflows.html new file mode 100644 index 00000000..62db277a --- /dev/null +++ b/4.0.4/Workflows.html @@ -0,0 +1,1565 @@ + + + + + JSDoc: Class: Workflows + + + + + + + + + + +
+ +

Class: Workflows

+ + + + + + +
+ +
+ +

Workflows(opts)

+ +

The Workflows class allows to work with workflows on a Nuxeo Platform instance.

+

Cannot directly be instantiated

+ + +
+ +
+
+ + + + +

Constructor

+ + + +

new Workflows(opts)

+ + + + + + +
+

Creates a Workflows object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
opts + + +object + + + +

The configuration options.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
nuxeo + + +string + + + +

The Nuxeo object linked to this Workflows object.

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Example
+ +
var Nuxeo = require('nuxeo')
+var nuxeo = new Nuxeo({
+ baseURL: 'http://localhost:8080/nuxeo',
+ auth: {
+   method: 'basic',
+   username: 'Administrator',
+   password: 'Administrator',
+ }
+});
+nuxeo.workflows()
+  .start('SerialDocumentReview')
+  .then(function(res) {
+    // res['entity-type'] === 'workflow'
+    // res.workflowModelName === 'SerialDocumentReview'
+  })
+  .catch(function(error) {
+    throw new Error(error);
+  });
+ + + + +
+ + + + + + + + + + + + + + + + +

Methods

+ + + + + + + +

delete(workflowInstanceId, optsopt) → {Promise}

+ + + + + + +
+

Deletes a workflow instance given a workflow instance id.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
workflowInstanceId + + +string + + + + + + + + + +

The workflow instance id.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise object resolved with the result of the DELETE request.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

fetch(workflowInstanceId, optsopt) → {Promise}

+ + + + + + +
+

Fetches a workflow given a workflow instance id.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
workflowInstanceId + + +string + + + + + + + + + +

The workflow instance id.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the Workflow object.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

fetchStartedWorkflows(workflowModelName, optsopt) → {Promise}

+ + + + + + +
+

Fetches the workflows started by the current user.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
workflowModelName + + +string + + + + + + + + + +

The workflow model name.

opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the started workflows.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

fetchTasks(tasksOptsopt, optsopt) → {Promise}

+ + + + + + +
+

Fetches the tasks for a given workflow id and/or workflow model name and/or actor id.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
tasksOpts + + +object + + + + + + <optional>
+ + + + + +

Configuration options for the tasks fetch.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
actorId + + +object + + + + + + <optional>
+ + + + + +

The actor id.

workflowInstanceId + + +object + + + + + + <optional>
+ + + + + +

The workflow id.

workflowModelName + + +object + + + + + + <optional>
+ + + + + +

The workflow model name.

+ +
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the tasks.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +

start(workflowModelName, workflowOptsopt, optsopt) → {Promise}

+ + + + + + +
+

Starts a workflow given a workflow model name.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
workflowModelName + + +string + + + + + + + + + +

The workflow model name.

workflowOpts + + +object + + + + + + <optional>
+ + + + + +

Configuration options for the start of the workflow.

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
attachedDocumentIds + + +Array + + + + + + <optional>
+ + + + + +

The attached documents id for the workflow.

variables + + +object + + + + + + <optional>
+ + + + + +

The initial variables of the workflow.

+ +
opts + + +object + + + + + + <optional>
+ + + + + +

Options overriding the ones from this object.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + +
Returns:
+ + +
+

A promise object resolved with the started Workflow object.

+
+ + + +
+
+ Type +
+
+ +Promise + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/auth_oauth2.js.html b/4.0.4/auth_oauth2.js.html new file mode 100644 index 00000000..defdb562 --- /dev/null +++ b/4.0.4/auth_oauth2.js.html @@ -0,0 +1,252 @@ + + + + + JSDoc: Source: auth/oauth2.js + + + + + + + + + + +
+ +

Source: auth/oauth2.js

+ + + + + + +
+
+
const extend = require('extend');
+const qs = require('querystring');
+
+const doFetch = require('../deps/fetch');
+const Promise = require('../deps/promise');
+
+const fetchAccessToken = (baseURL, body) => {
+  const url = baseURL.endsWith('/') ? baseURL : `${baseURL}/`;
+  return new Promise((resolve, reject) => (
+    doFetch(`${url}oauth2/token`, {
+      method: 'POST',
+      body: qs.stringify(body),
+      headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
+    })
+      .then((res) => res.json())
+      .then((token) => {
+        if (token.error) {
+          return reject(token.error);
+        }
+        return resolve(token);
+      })
+      .catch((e) => reject(e))
+  ));
+};
+
+// compatibility method to extract code and params arguments if any
+const extractCodeParams = (args) => {
+  switch (args.length) {
+    case 0:
+      // no code nor params
+      return { params: {} };
+    case 1:
+      // only params
+      return { params: args[0] };
+    case 2:
+    default:
+      // 2 or more arguments...
+      return { code: args[0], params: args[1] };
+  }
+};
+
+const validateOptions = (opts) => {
+  if (!opts.baseURL) {
+    throw new Error('Missing `baseURL` argument');
+  }
+  if (!opts.clientId) {
+    throw new Error('Missing `clientId` argument');
+  }
+};
+
+const computeClientParams = (opts) => {
+  const params = { client_id: opts.clientId };
+  if (opts.clientSecret) {
+    params.client_secret = opts.clientSecret;
+  }
+  return extend(true, params, opts.params);
+};
+
+const oauth2 = {
+
+  /**
+   * Returns the OAuth2 authorization URL.
+   * @param {string} opts - The configuration options.
+   * @param {string} opts.baseURL - Base URL of the Nuxeo Platform.
+   * @param {string} opts.clientId - The OAuth2 client id.
+   * @param {string} [opts.clientSecret] - Optional OAuth2 client secret.
+   * @param {object} [opts.params] - Optional query parameters such as `state`, `redirect_uri`.
+   * @returns {string}
+   */
+  getAuthorizationURL: (...args) => {
+    // handle compat with old args
+    const opts = args.length === 1 ? args[0] : {
+      baseURL: args[0],
+      clientId: args[1],
+      params: args[2],
+    };
+
+    validateOptions(opts);
+
+    const params = computeClientParams(opts);
+    const finalParams = extend(true, { response_type: 'code' }, params);
+    const url = opts.baseURL.endsWith('/') ? opts.baseURL : `${opts.baseURL}/`;
+    return `${url}oauth2/authorize?${qs.stringify(finalParams)}`;
+  },
+
+  /**
+   * Fetches an OAuth2 access token.
+   * @param {string} baseURL - Base URL of the Nuxeo Platform.
+   * @param {string} clientId - The OAuth2 client id.
+   * @param {string} [code] - An authorization code. Deprecated since 3.16.0, use other helper methods instead.
+   * @param {object} [params] - Optional parameters such as `redirect_uri`.
+   * @returns {string}
+   * @deprecated since 3.16.0, use other helper methods instead.
+   */
+  fetchAccessToken: (baseURL, clientId, ...args) => {
+    if (!baseURL) {
+      throw new Error('Missing `baseURL` argument');
+    }
+    if (!clientId) {
+      throw new Error('Missing `clientId` argument');
+    }
+
+    // for backward compatibility if `code` is still provided
+    const { code, params } = extractCodeParams(args);
+    const defaultParams = code ? { code, grant_type: 'authorization_code' } : {};
+
+    const body = extend(true, { client_id: clientId }, defaultParams, params);
+    return fetchAccessToken(baseURL, body);
+  },
+
+  /**
+   * Fetches an OAuth2 access token from an authorization code.
+   * @param {string} opts - The configuration options.
+   * @param {string} opts.baseURL - Base URL of the Nuxeo Platform.
+   * @param {string} opts.clientId - The OAuth2 client id.
+   * @param {string} [opts.clientSecret] - Optional OAuth2 client secret.
+   * @param {string} opts.code - An authorization code.
+   * @param {object} [opts.params] - Optional query parameters such as `state`, `redirect_uri`.
+   * @returns {string}
+   */
+  fetchAccessTokenFromAuthorizationCode: (...args) => {
+    // handle compat with old args
+    const opts = args.length === 1 ? args[0] : {
+      baseURL: args[0],
+      clientId: args[1],
+      code: args[2],
+      params: args[3],
+    };
+
+    validateOptions(opts);
+    if (!opts.code) {
+      throw new Error('Missing `code` argument');
+    }
+
+    const params = computeClientParams(opts);
+    const finalParams = extend(true, { code: opts.code, grant_type: 'authorization_code' }, params);
+    return fetchAccessToken(opts.baseURL, finalParams);
+  },
+
+  /**
+   * Fetches an OAuth2 access token from a JWT token.
+   * @param {string} opts - The configuration options.
+   * @param {string} opts.baseURL - Base URL of the Nuxeo Platform.
+   * @param {string} opts.clientId - The OAuth2 client id.
+   * @param {string} [opts.clientSecret] - Optional OAuth2 client secret.
+   * @param {string} opts.jwtToken - A JWT token.
+   * @param {object} [opts.params] - Optional query parameters such as `state`, `redirect_uri`.
+   * @returns {string}
+   */
+  fetchAccessTokenFromJWTToken: (...args) => {
+    // handle compat with old args
+    const opts = args.length === 1 ? args[0] : {
+      baseURL: args[0],
+      clientId: args[1],
+      jwtToken: args[2],
+      params: args[3],
+    };
+
+    validateOptions(opts);
+    if (!opts.jwtToken) {
+      throw new Error('Missing `jwtToken` argument');
+    }
+
+    const params = computeClientParams(opts);
+    const finalParams = extend(true,
+      { assertion: opts.jwtToken, grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer' }, params);
+    return fetchAccessToken(opts.baseURL, finalParams);
+  },
+
+  /**
+   * Refreshes an OAuth2 access token.
+   * @param {string} opts - The configuration options.
+   * @param {string} opts.baseURL - Base URL of the Nuxeo Platform.
+   * @param {string} opts.clientId - The OAuth2 client id.
+   * @param {string} [opts.clientSecret] - Optional OAuth2 client secret.
+   * @param {string} opts.refreshToken - A refresh token.
+   * @param {object} [opts.params] - Optional query parameters such as `state`, `redirect_uri`.
+   * @returns {string}
+   */
+  refreshAccessToken: (...args) => {
+    // handle compat with old args
+    const opts = args.length === 1 ? args[0] : {
+      baseURL: args[0],
+      clientId: args[1],
+      refreshToken: args[2],
+      params: args[3],
+    };
+
+    validateOptions(opts);
+    if (!opts.refreshToken) {
+      throw new Error('Missing `refreshToken` argument');
+    }
+
+    const params = computeClientParams(opts);
+    const finalParams = extend(true,
+      { refresh_token: opts.refreshToken, grant_type: 'refresh_token' }, params);
+    return fetchAccessToken(opts.baseURL, finalParams);
+  },
+};
+
+module.exports = oauth2;
+
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/4.0.4/base.js.html b/4.0.4/base.js.html new file mode 100644 index 00000000..071eff0a --- /dev/null +++ b/4.0.4/base.js.html @@ -0,0 +1,336 @@ + + + + + JSDoc: Source: base.js + + + + + + + + + + +
+ +

Source: base.js

+ + + + + + +
+
+
const extend = require('extend');
+
+const DEFAULT_OPTS = {
+  repositoryName: undefined,
+  schemas: [],
+  enrichers: {},
+  fetchProperties: {},
+  translateProperties: {},
+  headers: {},
+  httpTimeout: 30000,
+};
+
+/**
+ * This provides methods to store and use global settings when interacting with Nuxeo Platform.
+ *
+ * It's not meant to be used directly.
+ *
+ * @mixin
+ */
+class Base {
+  constructor(opts = {}) {
+    const options = extend(true, {}, DEFAULT_OPTS, opts);
+    this._baseOptions = {};
+    this._baseOptions.repositoryName = options.repositoryName;
+    this._baseOptions.schemas = options.schemas;
+    this._baseOptions.enrichers = options.enrichers;
+    this._baseOptions.fetchProperties = options.fetchProperties;
+    this._baseOptions.translateProperties = options.translateProperties;
+    this._baseOptions.depth = options.depth;
+    this._baseOptions.headers = options.headers;
+    this._baseOptions.timeout = options.timeout;
+    this._baseOptions.transactionTimeout = options.transationTimeout;
+    this._baseOptions.httpTimeout = options.httpTimeout;
+  }
+
+  /**
+   * Sets the repository name.
+   * @param {string} repositoryName - The repository name.
+   * @returns {Base} The object itself.
+   */
+  repositoryName(repositoryName) {
+    this._baseOptions.repositoryName = repositoryName;
+    return this;
+  }
+
+  /**
+   * Sets the schemas.
+   * @param {Array} schemas - The schemas.
+   * @returns {Base} The object itself.
+   */
+  schemas(schemas) {
+    this._baseOptions.schemas = [...schemas];
+    return this;
+  }
+
+  /**
+   * Sets the enrichers.
+   *
+   * By default, the new enrichers override completely the existing ones. By setting `override` to false,
+   * enrichers are merged.
+   *
+   * @example
+   * { document: ['acls', 'permissions'] }
+   * @param {object} enrichers - The new enrichers.
+   * @param {boolean} override - If the new `enrichers` override the existing ones. Default to true.
+   * @returns {Base} The object itself.
+   */
+  enrichers(enrichers, override = true) {
+    this._baseOptions.enrichers = override ? {} : this._baseOptions.enrichers;
+    for (const key of Object.keys(enrichers)) {
+      if (override) {
+        this._baseOptions.enrichers[key] = [...enrichers[key]];
+      } else {
+        this._baseOptions.enrichers[key] = this._baseOptions.enrichers[key] || [];
+        this._baseOptions.enrichers[key].push(...enrichers[key]);
+      }
+    }
+    return this;
+  }
+
+  /**
+   * Adds an enricher for a given entity.
+   * @param {string} entity - The entity name.
+   * @param {string} name - The enricher name.
+   * @returns {Base} The object itself.
+   */
+  enricher(entity, name) {
+    const enrichers = this._baseOptions.enrichers[entity] || [];
+    enrichers.push(name);
+    this._baseOptions.enrichers[entity] = enrichers;
+    return this;
+  }
+
+  /**
+   * Sets the properties to fetch.
+   *
+   * By default, the new properties override completely the existing ones. By setting `override` to false,
+   * the properties to fetch are merged.
+   *
+   * @example
+   * { document: ['dc:creator'] }
+   * @param {object} fetchProperties - The new properties to fetch.
+   * @param {boolean} override - If the new `fetchProperties` override the existing ones. Default to true.
+   * @returns {Base} The object itself.
+   */
+  fetchProperties(fetchProperties, override = true) {
+    this._baseOptions.fetchProperties = override ? {} : this._baseOptions.fetchProperties;
+    for (const key of Object.keys(fetchProperties)) {
+      if (override) {
+        this._baseOptions.fetchProperties[key] = [...fetchProperties[key]];
+      } else {
+        this._baseOptions.fetchProperties[key] = this._baseOptions.fetchProperties[key] || [];
+        this._baseOptions.fetchProperties[key].push(...fetchProperties[key]);
+      }
+    }
+    return this;
+  }
+
+  /**
+  * Adds a property to fetch for a given entity.
+  * @param {string} entity - The entity name.
+  * @param {string} name - The property name.
+  * @returns {Base} The object itself.
+  */
+  fetchProperty(entity, name) {
+    const fetchProperties = this._baseOptions.fetchProperties[entity] || [];
+    fetchProperties.push(name);
+    this._baseOptions.fetchProperties[entity] = fetchProperties;
+    return this;
+  }
+
+  /**
+   * Sets the properties to translate.
+   *
+   * By default, the new properties override completely the existing ones. By setting `override` to false,
+   * the properties to translate are merged.
+   *
+   * @example
+   * { directoryEntry: ['label'] }
+   * @param {object} translateProperties - The new properties to translate.
+   * @param {boolean} override - If the new `translateProperties` override the existing ones. Default to true.
+   * @returns {Base} The object itself.
+   */
+  translateProperties(translateProperties, override = true) {
+    this._baseOptions.translateProperties = override ? {} : this._baseOptions.translateProperties;
+    for (const key of Object.keys(translateProperties)) {
+      if (override) {
+        this._baseOptions.translateProperties[key] = [...translateProperties[key]];
+      } else {
+        this._baseOptions.translateProperties[key] = this._baseOptions.translateProperties[key] || [];
+        this._baseOptions.translateProperties[key].push(...translateProperties[key]);
+      }
+    }
+    return this;
+  }
+
+  /**
+  * Adds a property to translate for a given entity.
+  * @param {string} entity - The entity name.
+  * @param {string} name - The property name.
+  * @returns {Base} The object itself.
+  */
+  translateProperty(entity, name) {
+    const translateProperties = this._baseOptions.translateProperties[entity] || [];
+    translateProperties.push(name);
+    this._baseOptions.translateProperties[entity] = translateProperties;
+    return this;
+  }
+
+  /**
+   * Sets the depth.
+   * Possible values are: `root`, `children` and `max`.
+   * @returns {Base} The object itself.
+   */
+  depth(depth) {
+    this._baseOptions.depth = depth;
+    return this;
+  }
+
+  /**
+   * Sets the headers.
+   * @param {object} headers - the new headers.
+   * @returns {Base} The object itself.
+   */
+  headers(headers) {
+    this._baseOptions.headers = {};
+    for (const key of Object.keys(headers)) {
+      this._baseOptions.headers[key] = headers[key];
+    }
+    return this;
+  }
+
+  /**
+   * Adds a header.
+   * @param {string} name - the header name
+   * @param {string} value - the header value
+   * @returns {Base} The object itself..
+   */
+  header(name, value) {
+    this._baseOptions.headers[name] = value;
+    return this;
+  }
+
+  /**
+   * Sets the global timeout, used as HTTP timeout and transaction timeout
+   * by default.
+   * @returns {Base} The object itself.
+   * @deprecated since 3.6.0, use {#httpTiemout} or {#transactionTimeout} instead.
+   */
+  timeout(timeout) {
+    this._baseOptions.timeout = timeout;
+    return this;
+  }
+
+  /**
+   * Sets the transaction timeout, in seconds.
+   * @returns {Base} The object itself.
+   */
+  transactionTimeout(transactionTimeout) {
+    this._baseOptions.transactionTimeout = transactionTimeout;
+    return this;
+  }
+
+  /**
+   * Sets the HTTP timeout, in milliseconds.
+   *
+   * The HTTP timeout works only in a Node.js environment.
+   * @returns {Base} The object itself.
+   */
+  httpTimeout(httpTimeout) {
+    this._baseOptions.httpTimeout = httpTimeout;
+    return this;
+  }
+
+  /**
+  * 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.
+  */
+  _computeOptions(opts = {}) {
+    const options = extend(true, {}, this._baseOptions, opts);
+    // force some options that we don't merge
+    if (opts.schemas) {
+      options.schemas = [...opts.schemas];
+    }
+    if (opts.enrichers) {
+      options.enrichers = {};
+      Object.keys(opts.enrichers).forEach((key) => {
+        options.enrichers[key] = opts.enrichers[key];
+      });
+    }
+    if (opts.fetchProperties) {
+      options.fetchProperties = {};
+      Object.keys(opts.fetchProperties).forEach((key) => {
+        options.fetchProperties[key] = opts.fetchProperties[key];
+      });
+    }
+    if (opts.translateProperties) {
+      options.translateProperties = {};
+      Object.keys(opts.translateProperties).forEach((key) => {
+        options.translateProperties[key] = opts.translateProperties[key];
+      });
+    }
+    if (opts.headers) {
+      options.headers = {};
+      Object.keys(opts.headers).forEach((key) => {
+        options.headers[key] = opts.headers[key];
+      });
+    }
+    return options;
+  }
+
+  toJSON() {
+    const clone = { ...this };
+    // remove 'private' keys
+    for (const key of Object.keys(clone)) {
+      if (key.startsWith('_')) {
+        delete clone[key];
+      }
+    }
+    return clone;
+  }
+}
+
+module.exports = Base;
+
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/4.0.4/blob.js.html b/4.0.4/blob.js.html new file mode 100644 index 00000000..8853d340 --- /dev/null +++ b/4.0.4/blob.js.html @@ -0,0 +1,84 @@ + + + + + JSDoc: Source: blob.js + + + + + + + + + + +
+ +

Source: blob.js

+ + + + + + +
+
+
/**
+ * The `Blob` class represents an abstraction over a blob to be used in the APIs.
+ *
+ * @example
+ * // in the browser, assuming you have a File object from an input for instance
+ * var blob = new Nuxeo.Blob({ content: file });
+ * // in node
+ * var file = fs.createReadStream(filePath);
+ * var stats = fs.statSync(filePath);
+ * var blob = new Nuxeo.Blob({
+ *    content: file,
+ *    name: path.basename(filePath1),
+ *    mimeType: 'text/plain',
+ *    size: stats.size,
+ *  });
+ */
+class Blob {
+  /*
+   * Creates a Blob.
+   * @param {string} opts.content - The content of the Blob. Could be a File or Blob object in the browser.
+   * @param {string} [opts.name] - The name of the Blob. It overrides the one from content.name.
+   * @param {string} [opts.mimeType] - The mime-type of the Blob. It overrides the one from content.type.
+   * @param {string} [opts.size] - The size of the Blob. It overrides the one from content.size.
+   */
+  constructor(opts) {
+    this.content = opts.content;
+    this.name = opts.name || this.content.name;
+    this.mimeType = opts.mimeType || this.content.type;
+    this.size = opts.size || this.content.size;
+  }
+}
+
+module.exports = Blob;
+
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/4.0.4/directory_directory.js.html b/4.0.4/directory_directory.js.html new file mode 100644 index 00000000..9cfbcd29 --- /dev/null +++ b/4.0.4/directory_directory.js.html @@ -0,0 +1,178 @@ + + + + + JSDoc: Source: directory/directory.js + + + + + + + + + + +
+ +

Source: directory/directory.js

+ + + + + + +
+
+
const Base = require('../base');
+const join = require('../deps/utils/join');
+
+/**
+ * The `Directory` class allows to work with directories on a Nuxeo Platform instance.
+ *
+ * **Cannot directly be instantiated**
+ *
+ * @example
+ * var Nuxeo = require('nuxeo')
+ * var nuxeo = new Nuxeo({
+ *  baseURL: 'http://localhost:8080/nuxeo',
+ *  auth: {
+ *    method: 'basic',
+ *    username: 'Administrator',
+ *    password: 'Administrator'
+ *  }
+ * });
+ * nuxeo.directory('nature')
+ *   .fetch('article')
+ *   .then(function(res) {
+ *     // res.properties.id === 'article'
+ *     // res.properties.label === 'article label.directories.nature.article'
+ *   })
+ *   .catch(function(error) {
+ *     throw new Error(error));
+ *   });
+ */
+class Directory extends Base {
+  /**
+   * Creates a Directory.
+   * @param {object} opts - The configuration options.
+   * @param {string} opts.nuxeo - The {@link Nuxeo} object linked to this directory.
+   * @param {string} opts.directoryName - The name of this directory.
+   */
+  constructor(opts) {
+    super(opts);
+    this._nuxeo = opts.nuxeo;
+    this._directoryName = opts.directoryName;
+    this._path = join('directory', this._directoryName);
+  }
+
+  /**
+   * Fetches all directory entries.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the entries.
+   */
+  fetchAll(opts = {}) {
+    const options = this._computeOptions(opts);
+    const path = this._path;
+    options.directory = this;
+    return this._nuxeo.request(path)
+      .get(options);
+  }
+
+  /**
+   * Fetches a directory entry given its id.
+   * @param {string} id - The entry id.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the {@link DirectoryEntry}.
+   */
+  fetch(id, opts) {
+    const options = this._computeOptions(opts);
+    const path = join(this._path, id);
+    options.directory = this;
+    return this._nuxeo.request(path)
+      .get(options);
+  }
+
+  /**
+   * Creates an entry.
+   * @param {object} entry - The entry to be created.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the created {@link DirectoryEntry}.
+   */
+  create(entry, opts = {}) {
+    opts.body = {
+      'entity-type': 'directoryEntry',
+      directoryName: this._directoryName,
+      properties: entry.properties,
+    };
+    const options = this._computeOptions(opts);
+    const path = this._path;
+    options.directory = this;
+    return this._nuxeo.request(path)
+      .post(options);
+  }
+
+  /**
+   * Updates an entry. Assumes that the entry object has an `id` property.
+   * @param {object} entry - The entry to be updated.
+   * @param {object} entry.id - The string id of the entry to be updated.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the updated {@link DirectoryEntry}.
+   */
+  update(entry, opts = {}) {
+    // compatibility code for 8.10 where the `id` field is not set by the server
+    // works only if the `idField` of the directory is `id`
+    const id = entry.id || entry.properties.id;
+    opts.body = {
+      id,
+      'entity-type': 'directoryEntry',
+      directoryName: this._directoryName,
+      properties: entry.properties,
+    };
+    const options = this._computeOptions(opts);
+    const path = join(this._path, id);
+    options.directory = this;
+    return this._nuxeo.request(path)
+      .put(options);
+  }
+
+  /**
+   * Deletes an entry given its id.
+   * @param {string} id - The entry id.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the result of the DELETE request.
+   */
+  delete(id, opts) {
+    const options = this._computeOptions(opts);
+    const path = join(this._path, id);
+    return this._nuxeo.request(path)
+      .delete(options);
+  }
+}
+
+module.exports = Directory;
+
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/4.0.4/directory_entry.js.html b/4.0.4/directory_entry.js.html new file mode 100644 index 00000000..6782f04f --- /dev/null +++ b/4.0.4/directory_entry.js.html @@ -0,0 +1,125 @@ + + + + + JSDoc: Source: directory/entry.js + + + + + + + + + + +
+ +

Source: directory/entry.js

+ + + + + + +
+
+
const extend = require('extend');
+const Base = require('../base');
+
+const { LTS_2017 } = require('../server-version');
+
+/**
+ * The `DirectoryEntry` class wraps a directory entry.
+ *
+ * **Cannot directly be instantiated**
+ */
+class DirectoryEntry extends Base {
+  /**
+   * Creates a DirectoryEntry.
+   * @param {object} entry - The initial entry object.
+   *                         This DirectoryEntry object will be extended with entry properties.
+   * @param {object} opts - The configuration options.
+   * @param {string} opts.directory - The {@link Directory} object linked to this entry.
+   */
+  constructor(entry, opts) {
+    super(opts);
+    // make sure we have a Directory object for this entry
+    // opts.directory may be empty if the entry was not instantiated from a Directory object
+    this._directory = opts.directory || opts.nuxeo.directory(entry.directoryName);
+    this.properties = {};
+    this._dirtyProperties = {};
+    const { serverVersion } = this._directory._nuxeo;
+    // compatibility code for 8.10 (or unknown version) - make all properties dirty so that
+    // the `idField` will be passed when updating
+    if (!serverVersion || serverVersion.lt(LTS_2017)) {
+      this._dirtyProperties = extend({}, entry.properties);
+    }
+    extend(true, this, entry);
+  }
+
+  /**
+   * Sets entry properties.
+   * @param {object} properties - The properties to set.
+   * @returns {DirectoryEntry}
+   *
+   * @example
+   * entry.set({
+   *   'label': 'new label',
+   *   'ordering': 50,
+   * });
+   */
+  set(properties) {
+    this._dirtyProperties = extend(true, {}, this._dirtyProperties, properties);
+    return this;
+  }
+
+  /**
+   * Gets an entry property.
+   * @param {string} propertyName - The property name, such as 'label', 'ordering', ...
+   * @returns {DirectoryEntry}
+   */
+  get(propertyName) {
+    return this._dirtyProperties[propertyName] || this.properties[propertyName];
+  }
+
+  /**
+   * Saves the entry. It updates only the 'dirty properties' set through the {@link DirectoryEntry#set} method.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the updated entry.
+   */
+  save(opts = {}) {
+    const options = this._computeOptions(opts);
+    return this._directory.update({
+      id: this.id,
+      properties: this._dirtyProperties,
+    }, options);
+  }
+}
+
+module.exports = DirectoryEntry;
+
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/4.0.4/document.js.html b/4.0.4/document.js.html new file mode 100644 index 00000000..26f9d4a6 --- /dev/null +++ b/4.0.4/document.js.html @@ -0,0 +1,502 @@ + + + + + JSDoc: Source: document.js + + + + + + + + + + +
+ +

Source: document.js

+ + + + + + +
+
+
const extend = require('extend');
+const qs = require('querystring');
+const join = require('./deps/utils/join');
+const Base = require('./base');
+const constants = require('./deps/constants');
+
+/**
+ * The `Document` class wraps a document.
+ *
+ * **Cannot directly be instantiated**
+ */
+class Document extends Base {
+  /**
+   * Creates a Document.
+   * @param {object} doc - The initial document object. This Document object will be extended with doc properties.
+   * @param {object} opts - The configuration options.
+   * @param {string} opts.nuxeo - The {@link Nuxeo} object linked to this `Document` object.
+   * @param {object} opts.repository - The {@link Repository} object linked to this `Document` object.
+   */
+  constructor(doc, opts) {
+    super(opts);
+    this._nuxeo = opts.nuxeo;
+    this._repository = opts.repository || this._nuxeo.repository(doc.repository, opts);
+    this.properties = {};
+    this._dirtyProperties = {};
+    extend(true, this, doc);
+  }
+
+  /**
+   * Sets document properties.
+   * @param {object} properties - The properties to set.
+   * @returns {Document}
+   *
+   * @example
+   * doc.set({
+   *   'dc:title': 'new title',
+   *   'dc:description': 'new description',
+   * });
+   */
+  set(properties) {
+    this._dirtyProperties = extend(true, {}, this._dirtyProperties, properties);
+    return this;
+  }
+
+  /**
+   * Gets a document property.
+   * @param {string} propertyName - The property name, such as 'dc:title', 'file:filename', ...
+   * @returns {Document}
+   */
+  get(propertyName) {
+    return this._dirtyProperties[propertyName] || this.properties[propertyName];
+  }
+
+  /**
+   * Saves the document. It updates only the 'dirty properties' set through the {@link Document#set} method.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the updated document.
+   */
+  save(opts = {}) {
+    const options = this._computeOptions(opts);
+    return this._repository.update({
+      'entity-type': 'document',
+      uid: this.uid,
+      properties: this._dirtyProperties,
+    }, options);
+  }
+
+  /**
+   * Returns whether this document is folderish or not.
+   * @returns {Boolean} true if this document is folderish, false otherwise.
+   */
+  isFolder() {
+    return this.hasFacet('Folderish');
+  }
+
+  /**
+   * Returns whether this document has the input facet or not.
+   * @returns {Boolean} true if this document has the facet, false otherwise.
+   */
+  hasFacet(facet) {
+    return this.facets.indexOf(facet) !== -1;
+  }
+
+  /**
+   * Returns whether this document is a collection or not.
+   * @returns {Boolean} true if this document is a collection, false otherwise.
+   */
+  isCollection() {
+    return this.hasFacet('Collection');
+  }
+
+  /**
+   * Returns whether this document can be added to a collection or not.
+   * @returns {Boolean} true if this document can be added to a collection, false otherwise.
+   */
+  isCollectable() {
+    return !this.hasFacet('NotCollectionMember');
+  }
+
+  /**
+   * Fetch a Blob from this document.
+   * @param {string} [xpath=blobholder:0] - The Blob xpath. Default to the main blob 'blobholder:0'.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the response.
+   */
+  fetchBlob(xpath = 'blobholder:0', opts = {}) {
+    let options = opts;
+    let blobXPath = xpath;
+    if (typeof xpath === 'object') {
+      options = xpath;
+      blobXPath = 'blobholder:0';
+    }
+    options = this._computeOptions(options);
+    const path = join('id', this.uid, '@blob', blobXPath);
+    return this._nuxeo.request(path).get(options);
+  }
+
+  /**
+   * Moves this document.
+   * @param {string} dst - The destination folder.
+   * @param {string} [name] - The destination name, can be null.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the moved document.
+   */
+  move(dst, name = null, opts = {}) {
+    const options = this._computeOptions(opts);
+    options.repository = this._repository;
+    return this._nuxeo.operation('Document.Move')
+      .input(this.uid)
+      .params({
+        name,
+        target: dst,
+      })
+      .execute(options);
+  }
+
+  /**
+   * Follows a given life cycle transition.
+   * @param {string} transitionName - The life cycle transition to follow.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the updated document.
+   */
+  followTransition(transitionName, opts = {}) {
+    const options = this._computeOptions(opts);
+    options.repository = this._repository;
+    return this._nuxeo.operation('Document.FollowLifecycleTransition')
+      .input(this.uid)
+      .params({
+        value: transitionName,
+      })
+      .execute(options);
+  }
+
+  /**
+   * Converts a Blob from this document.
+   * @param {object} convertOpts - Configuration options for the conversion.
+                                   At least one of the 'converter', 'type' or 'format' option must be defined.
+   * @param {string} [convertOpts.xpath=blobholder:0] - The Blob xpath. Default to the main blob 'blobholder:0'.
+   * @param {string} convertOpts.converter - Named converter to use.
+   * @param {string} convertOpts.type - The destination mime type, such as 'application/pdf'.
+   * @param {string} convertOpts.format - The destination format, such as 'pdf'.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the response.
+   */
+  convert(convertOpts, opts = {}) {
+    const options = this._computeOptions(opts);
+    const xpath = convertOpts.xpath || 'blobholder:0';
+    const path = join('id', this.uid, '@blob', xpath, '@convert');
+    return this._nuxeo.request(path)
+      .queryParams({
+        converter: convertOpts.converter,
+        type: convertOpts.type,
+        format: convertOpts.format,
+      })
+      .get(options);
+  }
+
+  /**
+   * Schedule a conversion of the Blob from this document.
+   * @param {object} convertOpts - Configuration options for the conversion.
+                                   At least one of the 'converter', 'type' or 'format' option must be defined.
+   * @param {string} [convertOpts.xpath=blobholder:0] - The Blob xpath. Default to the main blob 'blobholder:0'.
+   * @param {string} convertOpts.converter - Named converter to use.
+   * @param {string} convertOpts.type - The destination mime type, such as 'application/pdf'.
+   * @param {string} convertOpts.format - The destination format, such as 'pdf'.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the response.
+   */
+  scheduleConversion(convertOpts, opts = {}) {
+    const params = {
+      async: true,
+      converter: convertOpts.converter,
+      type: convertOpts.type,
+      format: convertOpts.format,
+    };
+    opts.body = qs.stringify(params);
+    const options = this._computeOptions(opts);
+    options.headers['Content-Type'] = 'multipart/form-data';
+    const xpath = convertOpts.xpath || 'blobholder:0';
+    const path = join('id', this.uid, '@blob', xpath, '@convert');
+    return this._nuxeo.request(path)
+      .post(options);
+  }
+
+  /**
+   * Starts a workflow on this document given a workflow model name.
+   * @param {string} workflowModelName - The workflow model name.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the started `Workflow` object.
+   */
+  startWorkflow(workflowModelName, opts = {}) {
+    opts.body = {
+      workflowModelName,
+      'entity-type': 'workflow',
+    };
+    const options = this._computeOptions(opts);
+    const path = join('id', this.uid, '@workflow');
+    options.documentId = this.uid;
+    return this._nuxeo.request(path)
+      .post(options);
+  }
+
+  /**
+   * Fetches the started workflows on this document.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the started workflows.
+   */
+  fetchWorkflows(opts = {}) {
+    const options = this._computeOptions(opts);
+    const path = join('id', this.uid, '@workflow');
+    options.documentId = this.uid;
+    return this._nuxeo.request(path)
+      .get(options);
+  }
+
+  /**
+   * Fetches the renditions list of this document.
+   *
+   * Only available on Nuxeo version LTS 2016 or later.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the rendition definitions.
+   */
+  fetchRenditions(opts = {}) {
+    const { Promise } = this._nuxeo;
+    if (this.contextParameters && this.contextParameters.renditions) {
+      return Promise.resolve(this.contextParameters.renditions);
+    }
+
+    const options = this._computeOptions(opts);
+    options.enrichers = { document: ['renditions'] };
+    return this._repository
+      .fetch(this.uid, options)
+      .then((doc) => {
+        if (!this.contextParameters) {
+          this.contextParameters = {};
+        }
+        this.contextParameters.renditions = doc.contextParameters.renditions;
+        return this.contextParameters.renditions;
+      });
+  }
+
+  /**
+   * Fetch a rendition from this document.
+   * @param {string} name - The rendition name.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the response.
+   */
+  fetchRendition(name, opts = {}) {
+    const options = this._computeOptions(opts);
+    const path = join('id', this.uid, '@rendition', name);
+    return this._nuxeo.request(path)
+      .get(options);
+  }
+
+  /**
+   * Fetches the ACLs list of this document.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the ACLs.
+   */
+  fetchACLs(opts = {}) {
+    const { Promise } = this._nuxeo;
+    if (this.contextParameters && this.contextParameters.acls) {
+      return Promise.resolve(this.contextParameters.acls);
+    }
+
+    const options = this._computeOptions(opts);
+    options.enrichers = { document: [constants.enricher.document.ACLS] };
+    return this._repository
+      .fetch(this.uid, options)
+      .then((doc) => {
+        if (!this.contextParameters) {
+          this.contextParameters = {};
+        }
+        this.contextParameters.acls = doc.contextParameters.acls;
+        return this.contextParameters.acls;
+      });
+  }
+
+  /**
+   * Checks if the user has a given permission. It only works for now for 'Write', 'Read' and 'Everything' permission.
+   * This method may call the server to compute the available permissions (using the 'permissions' enricher)
+   * if not already present.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with true or false.
+   */
+  hasPermission(name, opts = {}) {
+    const { Promise } = this._nuxeo;
+    if (this.contextParameters && this.contextParameters.permissions) {
+      return Promise.resolve(this.contextParameters.permissions.indexOf(name) !== -1);
+    }
+
+    const options = this._computeOptions(opts);
+    options.enrichers = { document: [constants.enricher.document.PERMISSIONS] };
+    return this._repository
+      .fetch(this.uid, options)
+      .then((doc) => {
+        if (!this.contextParameters) {
+          this.contextParameters = {};
+        }
+        this.contextParameters.permissions = doc.contextParameters.permissions;
+        return this.contextParameters.permissions.indexOf(name) !== -1;
+      });
+  }
+
+  /**
+   * Adds a new permission.
+   * @param {object} params - The params needed to add a new permission.
+   * @param {string} params.permission - The permission string to set, such as 'Write', 'Read', ...
+   * @param {string} params.username - The target username. `username` or `email` must be set.
+   * @param {string} params.email - The target email. `username` or `email` must be set.
+   * @param {string} [params.acl] - The ACL name where to add the new permission.
+   * @param {string} [params.begin] - Optional begin date.
+   * @param {string} [params.end] - Optional end date.
+   * @param {string} [params.blockInheritance] - Whether to block the permissions inheritance or not
+   *                                             before adding the new permission.
+   * @param {string} [params.notify] - Optional flag to notify the user of the new permission.
+   * @param {string} [params.comment] - Optional comment used for the user notification.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the updated document.
+   */
+  addPermission(params, opts = {}) {
+    const options = this._computeOptions(opts);
+    options.repository = this._repository;
+    return this._nuxeo.operation('Document.AddPermission')
+      .input(this.uid)
+      .params(params)
+      .execute(options);
+  }
+
+  /**
+   * Removes a permission given its id, or all permissions for a given user.
+   * @param {object} params - The params needed to remove a permission.
+   * @param {string} params.id - The permission id. `id` or `user` must be set.
+   * @param {string} params.user - The user to rem. `id` or `user` must be set.
+   * @param {string} [params.acl] - The ACL name where to add the new permission.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the updated document.
+   */
+  removePermission(params, opts = {}) {
+    const options = this._computeOptions(opts);
+    options.repository = this._repository;
+    return this._nuxeo.operation('Document.RemovePermission')
+      .input(this.uid)
+      .params(params)
+      .execute(options);
+  }
+
+  /**
+   * Fetches the lock status of the document.
+   * @example
+   * // if the doc is locked
+   * doc.fetchLockStatus()
+   *   .then(function(status) {
+   *     // status.lockOwner === 'Administrator'
+   *     // status.lockCreated === '2011-10-23T12:00:00.00Z'
+   *   });
+   * @example
+   * // if the doc is not locked
+   * doc.fetchLockStatus()
+   *   .then(function(status) {
+   *     // status.lockOwner === undefined
+   *     // status.lockCreated === undefined
+   *   });
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with true or false.
+   */
+  fetchLockStatus(opts = {}) {
+    const options = this._computeOptions(opts);
+    options.fetchProperties = { document: ['lock'] };
+    return this._repository
+      .fetch(this.uid, options)
+      .then((doc) => {
+        return {
+          lockOwner: doc.lockOwner,
+          lockCreated: doc.lockCreated,
+        };
+      });
+  }
+
+  /**
+   * Locks the document.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the updated document.
+   */
+  lock(opts = {}) {
+    const options = this._computeOptions(opts);
+    options.repository = this._repository;
+    return this._nuxeo.operation('Document.Lock')
+      .input(this.uid)
+      .execute(options);
+  }
+
+  /**
+   * Unlocks the document.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the updated document.
+   */
+  unlock(opts = {}) {
+    const options = this._computeOptions(opts);
+    options.repository = this._repository;
+    return this._nuxeo.operation('Document.Unlock')
+      .input(this.uid)
+      .execute(options);
+  }
+
+  /**
+   * Fetches the audit of the document.
+   * @param {object} [queryOpts] - Parameters for the audit query.
+   * @param {Array} [queryOpts.eventId] - List of event ids to filter.
+   * @param {Array} [queryOpts.category] - List of categories to filter
+   * @param {Array} [queryOpts.principalName] - List of principal names to filter.
+   * @param {object} [queryOpts.startEventDate] - Start date.
+   * @param {object} [queryParams.endEventDate] - End date
+   * @param {number} [queryOpts.pageSize=0] - The number of results per page.
+   * @param {number} [queryOpts.currentPageIndex=0] - The current page index.
+   * @param {number} [queryOpts.maxResults] - The expected max results.
+   * @param {string} [queryOpts.sortBy] - The sort by info.
+   * @param {string} [queryOpts.sortOrder] - The sort order info.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with audit entries.
+   */
+  fetchAudit(queryOpts = {}, opts = {}) {
+    const options = this._computeOptions(opts);
+    const path = join('id', this.uid, '@audit');
+    return this._nuxeo.request(path)
+      .queryParams(queryOpts)
+      .get(options);
+  }
+}
+
+module.exports = Document;
+
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/4.0.4/fonts/OpenSans-Bold-webfont.eot b/4.0.4/fonts/OpenSans-Bold-webfont.eot new file mode 100644 index 00000000..5d20d916 Binary files /dev/null and b/4.0.4/fonts/OpenSans-Bold-webfont.eot differ diff --git a/4.0.4/fonts/OpenSans-Bold-webfont.svg b/4.0.4/fonts/OpenSans-Bold-webfont.svg new file mode 100644 index 00000000..3ed7be4b --- /dev/null +++ b/4.0.4/fonts/OpenSans-Bold-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/4.0.4/fonts/OpenSans-Bold-webfont.woff b/4.0.4/fonts/OpenSans-Bold-webfont.woff new file mode 100644 index 00000000..1205787b Binary files /dev/null and b/4.0.4/fonts/OpenSans-Bold-webfont.woff differ diff --git a/4.0.4/fonts/OpenSans-BoldItalic-webfont.eot b/4.0.4/fonts/OpenSans-BoldItalic-webfont.eot new file mode 100644 index 00000000..1f639a15 Binary files /dev/null and b/4.0.4/fonts/OpenSans-BoldItalic-webfont.eot differ diff --git a/4.0.4/fonts/OpenSans-BoldItalic-webfont.svg b/4.0.4/fonts/OpenSans-BoldItalic-webfont.svg new file mode 100644 index 00000000..6a2607b9 --- /dev/null +++ b/4.0.4/fonts/OpenSans-BoldItalic-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/4.0.4/fonts/OpenSans-BoldItalic-webfont.woff b/4.0.4/fonts/OpenSans-BoldItalic-webfont.woff new file mode 100644 index 00000000..ed760c06 Binary files /dev/null and b/4.0.4/fonts/OpenSans-BoldItalic-webfont.woff differ diff --git a/4.0.4/fonts/OpenSans-Italic-webfont.eot b/4.0.4/fonts/OpenSans-Italic-webfont.eot new file mode 100644 index 00000000..0c8a0ae0 Binary files /dev/null and b/4.0.4/fonts/OpenSans-Italic-webfont.eot differ diff --git a/4.0.4/fonts/OpenSans-Italic-webfont.svg b/4.0.4/fonts/OpenSans-Italic-webfont.svg new file mode 100644 index 00000000..e1075dcc --- /dev/null +++ b/4.0.4/fonts/OpenSans-Italic-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/4.0.4/fonts/OpenSans-Italic-webfont.woff b/4.0.4/fonts/OpenSans-Italic-webfont.woff new file mode 100644 index 00000000..ff652e64 Binary files /dev/null and b/4.0.4/fonts/OpenSans-Italic-webfont.woff differ diff --git a/4.0.4/fonts/OpenSans-Light-webfont.eot b/4.0.4/fonts/OpenSans-Light-webfont.eot new file mode 100644 index 00000000..14868406 Binary files /dev/null and b/4.0.4/fonts/OpenSans-Light-webfont.eot differ diff --git a/4.0.4/fonts/OpenSans-Light-webfont.svg b/4.0.4/fonts/OpenSans-Light-webfont.svg new file mode 100644 index 00000000..11a472ca --- /dev/null +++ b/4.0.4/fonts/OpenSans-Light-webfont.svg @@ -0,0 +1,1831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/4.0.4/fonts/OpenSans-Light-webfont.woff b/4.0.4/fonts/OpenSans-Light-webfont.woff new file mode 100644 index 00000000..e7860748 Binary files /dev/null and b/4.0.4/fonts/OpenSans-Light-webfont.woff differ diff --git a/4.0.4/fonts/OpenSans-LightItalic-webfont.eot b/4.0.4/fonts/OpenSans-LightItalic-webfont.eot new file mode 100644 index 00000000..8f445929 Binary files /dev/null and b/4.0.4/fonts/OpenSans-LightItalic-webfont.eot differ diff --git a/4.0.4/fonts/OpenSans-LightItalic-webfont.svg b/4.0.4/fonts/OpenSans-LightItalic-webfont.svg new file mode 100644 index 00000000..431d7e35 --- /dev/null +++ b/4.0.4/fonts/OpenSans-LightItalic-webfont.svg @@ -0,0 +1,1835 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/4.0.4/fonts/OpenSans-LightItalic-webfont.woff b/4.0.4/fonts/OpenSans-LightItalic-webfont.woff new file mode 100644 index 00000000..43e8b9e6 Binary files /dev/null and b/4.0.4/fonts/OpenSans-LightItalic-webfont.woff differ diff --git a/4.0.4/fonts/OpenSans-Regular-webfont.eot b/4.0.4/fonts/OpenSans-Regular-webfont.eot new file mode 100644 index 00000000..6bbc3cf5 Binary files /dev/null and b/4.0.4/fonts/OpenSans-Regular-webfont.eot differ diff --git a/4.0.4/fonts/OpenSans-Regular-webfont.svg b/4.0.4/fonts/OpenSans-Regular-webfont.svg new file mode 100644 index 00000000..25a39523 --- /dev/null +++ b/4.0.4/fonts/OpenSans-Regular-webfont.svg @@ -0,0 +1,1831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/4.0.4/fonts/OpenSans-Regular-webfont.woff b/4.0.4/fonts/OpenSans-Regular-webfont.woff new file mode 100644 index 00000000..e231183d Binary files /dev/null and b/4.0.4/fonts/OpenSans-Regular-webfont.woff differ diff --git a/4.0.4/group_group.js.html b/4.0.4/group_group.js.html new file mode 100644 index 00000000..f83c7c10 --- /dev/null +++ b/4.0.4/group_group.js.html @@ -0,0 +1,90 @@ + + + + + JSDoc: Source: group/group.js + + + + + + + + + + +
+ +

Source: group/group.js

+ + + + + + +
+
+
const extend = require('extend');
+const Base = require('../base');
+
+/**
+ * The `Group` class wraps a group.
+ *
+ * **Cannot directly be instantiated**
+ */
+class Group extends Base {
+  /**
+   * Creates a Group.
+   * @param {object} group - The initial group object. This Group object will be extended with group properties.
+   * @param {object} opts - The configuration options.
+   * @param {string} opts.groups - The {@link Groups} object linked to this group.
+   */
+  constructor(group, opts) {
+    super(opts);
+    this._groups = opts.groups;
+    extend(true, this, group);
+  }
+
+  /**
+   * Saves the group.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the updated group.
+   */
+  save(opts = {}) {
+    const options = this._computeOptions(opts);
+    return this._groups.update({
+      'entity-type': 'group',
+      groupname: this.groupname,
+      grouplabel: this.grouplabel,
+      memberUsers: this.memberUsers,
+      memberGroups: this.memberGroups,
+    }, options);
+  }
+}
+
+module.exports = Group;
+
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/4.0.4/group_groups.js.html b/4.0.4/group_groups.js.html new file mode 100644 index 00000000..83986ffd --- /dev/null +++ b/4.0.4/group_groups.js.html @@ -0,0 +1,165 @@ + + + + + JSDoc: Source: group/groups.js + + + + + + + + + + +
+ +

Source: group/groups.js

+ + + + + + +
+
+
const Base = require('../base');
+const join = require('../deps/utils/join');
+
+const GROUP_PATH = 'group';
+
+/**
+ * The `Groups` class allows to work with groups on a Nuxeo Platform instance.
+ *
+ * **Cannot directly be instantiated**
+ *
+ * @example
+ * var Nuxeo = require('nuxeo')
+ * var nuxeo = new Nuxeo({
+ *  baseURL: 'http://localhost:8080/nuxeo',
+ *  auth: {
+ *    method: 'basic',
+ *    username: 'Administrator',
+ *    password: 'Administrator'
+ *  }
+ * });
+ * nuxeo.groups()
+ *   .fetch('administrators')
+ *   .then(function(res) {
+ *     // res.groupname === 'administrators'
+ *     // res.grouplabel === 'Administrators group'
+ *   })
+ *   .catch(function(error) {
+ *     throw new Error(error));
+ *   });
+ */
+
+class Groups extends Base {
+  /**
+   * Creates a Groups object.
+   * @param {object} opts - The configuration options.
+   * @param {string} opts.nuxeo - The {@link Nuxeo} object linked to this Groups object.
+   */
+  constructor(opts) {
+    super(opts);
+    this._nuxeo = opts.nuxeo;
+  }
+
+  /**
+   * Fetches a group given a groupname.
+   * @param {string} groupname - The groupname.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the {@link Group}.
+   */
+  fetch(groupname, opts = {}) {
+    const options = this._computeOptions(opts);
+    const path = join(GROUP_PATH, groupname);
+    options.groups = this;
+    return this._nuxeo.request(path)
+      .get(options);
+  }
+
+  /**
+   * Creates a group.
+   * @param {object} user - The group to be created.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the created {@link Group}.
+   */
+  create(group, opts = {}) {
+    opts.body = {
+      'entity-type': 'group',
+      groupname: group.groupname,
+      grouplabel: group.grouplabel,
+      memberUsers: group.memberUsers,
+      memberGroups: group.memberGroups,
+    };
+    const options = this._computeOptions(opts);
+    options.groups = this;
+    return this._nuxeo.request(GROUP_PATH)
+      .post(options);
+  }
+
+  /**
+   * Updates a group. Assumes that the group object has an groupname field.
+   * @param {object} group - The group to be updated.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the updated {@link Group}.
+   */
+  update(group, opts = {}) {
+    const id = group.id || group.groupname;
+    opts.body = {
+      id,
+      'entity-type': 'group',
+      groupname: group.groupname,
+      grouplabel: group.grouplabel,
+      memberUsers: group.memberUsers,
+      memberGroups: group.memberGroups,
+    };
+    const options = this._computeOptions(opts);
+    const path = join(GROUP_PATH, group.groupname);
+    options.groups = this;
+    return this._nuxeo.request(path)
+      .put(options);
+  }
+
+  /**
+   * Deletes a group given a groupname.
+   * @param {string} groupname - The groupname.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the result of the DELETE request.
+   */
+  delete(groupname, opts = {}) {
+    const options = this._computeOptions(opts);
+    const path = join(GROUP_PATH, groupname);
+    return this._nuxeo.request(path)
+      .delete(options);
+  }
+}
+
+module.exports = Groups;
+
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/4.0.4/index.html b/4.0.4/index.html new file mode 100644 index 00000000..652cff43 --- /dev/null +++ b/4.0.4/index.html @@ -0,0 +1,798 @@ + + + + + JSDoc: Home + + + + + + + + + + +
+ +

Home

+ + + + + + + + +

+ + + + + + + + + + + + + + + +
+

Client Library for Nuxeo API

+

Jenkins
+npm version
+npm downloads
+Dependency Status devDependency Status

+Browser Support thanks to SauceLabs +

The Nuxeo JavaScript Client is a JavaScript client library for the Nuxeo Automation and REST API. The library can work in a browser, or in Node.js, using the same API.

+

This is an on-going project, supported by Nuxeo.

+

Nuxeo Platform Dependency

+

The JS Client is compliant with all Nuxeo versions as of LTS 2015.

+

Getting Started

+

Installation

+

Node.js Applications

+

After installing Node.js, use npm or yarn to install the nuxeo package:

+
npm install nuxeo
+
+

or

+
yarn add nuxeo
+
+
Node.js
+
var Nuxeo = require('nuxeo');
+var nuxeo = new Nuxeo({ ... });
+
+

Bower Powered Applications

+

The nuxeo client can be also installed through bower:

+
  bower install nuxeo --save
+
+

When added to your page, Nuxeo is available as a global variable.

+
var nuxeo = new Nuxeo({ ... });
+
+

Angular Applications

+

After adding nuxeo through Bower, you can easily create a service that will return a client:

+
...
+.service('nuxeo', function() {
+  return new Nuxeo({
+    baseURL: 'http://localhost:8080/nuxeo/',
+    auth: {
+      method: 'basic',
+      username: 'Administrator',
+      password: 'Administrator'
+    }
+  });
+})
+...
+
+

To notify Angular to update the UI when a Nuxeo promise has resolved, you can either wrap Nuxeo promises in $q.when()
+or, the preferred way, configure the Promise library class to be $q.

+
// wrap promises
+...
+$q.when(nuxeo.request('/path/').get()).then(function(res) {
+  $scope.res = res;
+});
+// use $q as the Promise library class
+...
+.service('nuxeo', function($q) {
+  Nuxeo.promiseLibrary($q);
+  return new Nuxeo({
+    baseURL: 'http://localhost:8080/nuxeo/',
+    auth: {
+      method: 'basic',
+      username: 'Administrator',
+      password: 'Administrator'
+    }
+  });
+})
+...
+
+

Angular v2 Applications

+

After adding nuxeo through npm or yarn to your application, you can use the Nuxeo client directly by requiring the nuxeo module:

+
const Nuxeo = require('nuxeo');
+...
+const nuxeo = new Nuxeo({...});
+...
+
+

Nuxeo works correctly with Angular v2 ZoneAwarePromise Promise library, so the component tree will be re-rendered when a Promise from Nuxeo will resolve.

+

React Applications

+

After adding nuxeo through npm or yarn to your application:

+
var Nuxeo = require('nuxeo');
+
+

Documentation

+

Check out the API documentation.

+

Examples

+

Some working examples using the Nuxeo JavaScript Client can be found here.

+

Deprecated APIs

+

Nuxeo.oauth2.getAuthorizationURL(baseURL, clientId[, params]) (since 4.0.0)

+

The getAuthorizationURL(baseURL, clientId[, params]) method is deprecated in favor of the getAuthorizationURL(opts) method. The old arguments are now passed in the opts object, such as:

+
Nuxeo.oauth2.getAuthorizationURL({ baseURL, clientId, params })
+
+

Nuxeo.oauth2.fetchAccessTokenFromAuthorizationCode(baseURL, clientId, code[, params]) (since 4.0.0)

+

The fetchAccessTokenFromAuthorizationCode(baseURL, clientId, code[, params]) method is deprecated in favor of the fetchAccessTokenFromAuthorizationCode(opts) method. The old arguments are now passed in the opts object, such as:

+
Nuxeo.oauth2.fetchAccessTokenFromAuthorizationCode({ baseURL, clientId, code, params })
+
+

Nuxeo.oauth2.fetchAccessTokenFromJWTToken(baseURL, clientId, jwtToken[, params]) (since 4.0.0)

+

The fetchAccessTokenFromJWTToken(baseURL, clientId, jwtToken[, params]) method is deprecated in favor of the fetchAccessTokenFromJWTToken(opts) method. The old arguments are now passed in the opts object, such as:

+
Nuxeo.oauth2.fetchAccessTokenFromJWTToken({ baseURL, clientId, jwtToken, params })
+
+

Nuxeo.oauth2.refreshAccessToken(baseURL, clientId, refreshToken[, params]) (since 4.0.0)

+

The refreshAccessToken(baseURL, clientId, refreshToken[, params]) method is deprecated in favor of the refreshAccessToken(opts) method. The old arguments are now passed in the opts object, such as:

+
Nuxeo.oauth2.refreshAccessToken({ baseURL, clientId, refreshToken, params })
+
+

Base#timeout (since 3.6.0)

+

The timeout method available on the Base class is deprecated in favor of using directly the httpTimeout or transactionTimeout methods depending of what needs to be configured.

+

Note that the httpTimeout is in milliseconds while the transactionTimeout is in seconds, so guessing the transactionTimeout from a timeout is a bad idea, you better need to be explicit.

+

Nuxeo#nuxeoVersion (since 3.5.0)

+

The nuxeoVersion property of a Nuxeo client instance is deprecated in favor of the serverVersion property that allows correct versions comparison.

+

The Nuxeo.VERSIONS object is also deprecated in favor of the Nuxeo.SERVER_VERSIONS object.

+

_Nuxeo#http (since 3.3.0)

+

The "private" _http method is deprecated in favor of the "public" http method.

+

Nuxeo#login (since 3.0.0)

+

The login method is deprecated in favor of the connect method.

+

Quick Start

+

This quick start guide will show how to do basics operations using the client.

+

Authentication

+

The authentication method to be used is defined when creating a client:

+
var nuxeo = new Nuxeo({
+  auth: {
+    method: ...,
+    ...
+  }
+});
+
+

The client supports different authentication methods matching the ones available on the Nuxeo Platform.

+

Basic Authentication

+

The simplest one allowing to authenticate with a username and password.

+
var nuxeo = new Nuxeo({
+  auth: {
+    method: 'basic',
+    username: 'Administrator',
+    password: 'Administrator'
+  }
+});
+
+

Portal Authenticaton

+

If the Portal Authentication is configured on the Nuxeo Platform,
+you can authenticate with the portal method.

+
var nuxeo = new Nuxeo({
+  auth: {
+    method: 'portal',
+    username: 'joe',
+    secret: 'shared-secret-from-server'
+  }
+});
+
+

Token Authentication

+

To authenticate through a token from the Nuxeo Server:

+
var nuxeo = new Nuxeo({
+  auth: {
+    method: 'token',
+    token: 'a-token'
+  }
+});
+
+

There is a utility method Nuxeo#requestAuthenticationToken to retrieve a token from a Nuxeo Server using the configured authentication method.
+For instance, a typical flow would be:

+
var nuxeo = new Nuxeo({
+  auth: {
+    method: 'basic',
+    username: 'Administrator',
+    password: 'Administrator'
+  }
+});
+
+nuxeo.requestAuthenticationToken('My App', deviceUID, deviceName, 'rw')
+  .then(function(token) {
+    nuxeo = new Nuxeo({
+      auth: {
+        method: 'token',
+        token: token
+      }
+    });
+
+    // do something with the new `nuxeo` client using token authentication
+    // store the token, and next time you need to create a client, use it
+  })
+  .catch(function(err) {
+    throw err;
+  });
+
+

OAuth2 Authorization and Bearer Token Authentication

+

Since Nuxeo Platform 9.2, you can use OAuth2 authorization through the JS client.

+

For more information on OAuth2 server side, see Using OAuth2.

+

Assuming you already have an access token, you can configure the client:

+
var nuxeo = new Nuxeo({
+  auth: {
+    method: 'bearerToken',
+    token: access_token,
+    clientId: 'my-app', // optional OAuth2 client ID to refresh the access token
+    clientSecret: 'my-secret', // required if the client defines a secret
+  }
+});
+
+

The bearertoken method supports the token being a simple string (an access token) or a full token object such as:

+
{
+  "access_token":"H8dXDdEW9U2jJnFDh6lJJ74AHRzCyG4D",
+  "token_type":"bearer",
+  "expires_in":3600,
+  "refresh_token":"Amz8JlyglhGWDmYHMYS5EnTTFUFAwZLiHG4aqQDfkwUNunSMpTTSFUmvprX3WdSF"
+}
+
+

If the token is a full token object (ie. with a refresh_token key) and a clientId is configured on the auth object, the client will try automatically to refresh the access token if it's expired.

+
OAuth2 Flow
+

A typical OAuth2 flow with the Nuxeo Platform would be:

+

Retrieving Authorization Code

+

Generate a "log in" link to be used in a browser, such as:

+

http://localhost:8080/nuxeo/oauth2/authorize?client_id=CLIENT_ID[&client_secret=CLIENT_SECRET]&response_type=code&redirect_uri=REDIRECT_URI

+

The user sees the login page then, after being logged in, the authorization prompt for the application.

+

If the user grants access, the Nuxeo Platform redirects the user back to the application:

+

http://localhost:8000/authorize?code=AUTH_CODE

+

Retrieving Access Token

+

The client exchanges the authorization code for an access token:

+
POST http://localhost:8080/nuxeo/oauth2/token
+  grant_type=authorization_code
+  code=AUTH_CODE
+  redirect_uri=REDIRECT_URI
+  client_id=CLIENT_ID
+  client_secret=CLIENT_SECRET
+
+

The Nuxeo Platform replies with an access token:

+
{
+  "access_token":"H8dXDdEW9U2jJnFDh6lJJ74AHRzCyG4D",
+  "token_type":"bearer",
+  "expires_in":3600,
+  "refresh_token":"Amz8JlyglhGWDmYHMYS5EnTTFUFAwZLiHG4aqQDfkwUNunSMpTTSFUmvprX3WdSF"
+}
+
+

There are some utility methods on the client to help you with this flow:

+

Nuxeo.oauth2.getAuthorizationURL(opts)

+

Returns the OAuth2 authorization URL for the given opts object, containing baseURL, clientId, optional clientSecret and optional params.

+
var authorizationURL = Nuxeo.oauth2.getAuthorizationURL({
+  baseURL: 'http://localhost:8080/nuxeo',
+  clientId: 'my-app',
+  clientSecret: 'my-secret', // required if the client defines a secret
+  params: {
+    state: 'xyz',
+    redirect_uri: 'http://localhost:8000/authorize',
+  }
+});
+console.log(authorizationURL); // http://localhost:8080/nuxeo/oauth2/authorize?client_id=my-app&response_type=code&state=xyz&redirect_uri=http://localhost:8000/authorize
+
+

Nuxeo.oauth2.fetchAccessTokenFromAuthorizationCode(opts)

+

Fetches an OAuth2 access token for the given opts object containing baseURL, clientId, code, optional clientSecret and optional params.

+
var code = ...
+Nuxeo.oauth2.fetchAccessTokenFromAuthorizationCode({
+  baseURL: 'http://localhost:8080/nuxeo',
+  clientId: 'my-app',
+  clientSecret: 'my-secret', // required if the client defines a secret
+  code: code,
+  params: {
+    redirect_uri: 'http://localhost:8000/authorize',
+  }
+}).then(function(token) {
+  // do something with the access token
+  var nuxeo = new Nuxeo({
+    auth: {
+      method: 'bearerToken',
+      token: token,
+      clientId: 'my-app', // optional OAuth2 client ID to refresh the access token
+      clientSecret: 'my-secret', // required if the client defines a secret
+    }
+  });
+});
+
+

Nuxeo.oauth2.fetchAccessTokenFromJWTToken(opts)

+

Fetches an OAuth2 access token for the given opts object containing baseURL, clientId, jwtToken, optional clientSecret and optional params.

+
var jwtToken = ...
+Nuxeo.oauth2.fetchAccessTokenFromJWTToken({
+  baseURL: 'http://localhost:8080/nuxeo',
+  clientId: 'my-app',
+  clientSecret: 'my-secret', // required if the client defines a secret
+  jwtToken: jwtToken,
+  params: {
+    redirect_uri: 'http://localhost:8000/authorize',
+  }
+}).then(function(token) {
+  // do something with the access token
+  var nuxeo = new Nuxeo({
+    auth: {
+      method: 'bearerToken',
+      token: token
+    }
+  });
+});
+
+

Nuxeo.oauth2.refreshAccessToken(optsbaseURL, clientId, refreshToken[, params])

+

Manually refresh an access token for the given opts object containing baseURL, clientId, refreshToken, optional clientSecret and optional params.

+
var refreshToken = ...
+Nuxeo.oauth2.refreshAccessToken({
+  baseURL: 'http://localhost:8080/nuxeo',
+  clientId: 'my-app',
+  clientSecret: 'my-secret', // required if the client defines a secret
+  refreshToken: refreshToken,
+}).then(function(token) {
+    console.log(token); // refreshed access token
+});
+
+

Creating a Client

+
var nuxeo = new Nuxeo({
+  auth: {
+    method: 'basic',
+    username: 'Administrator',
+    password: 'Administrator'
+  }
+});
+
+

To connect to a different Nuxeo Platform Instance, you can use the following:

+
var nuxeo = new Nuxeo({
+  baseURL: 'http://demo.nuxeo.com/nuxeo/',
+  auth: {
+    method: 'basic',
+    username: 'Administrator',
+    password: 'Administrator'
+  }
+});
+
+

Promise Based Calls

+

All API calls made on the server return a Promise object.

+
nuxeo.operation('Document.GetChildren')
+  .input('/')
+  .execute()
+  .then(function(docs) {
+    // work with docs
+  })
+  .catch(function(error) {
+    // something went wrong
+    throw error;
+  });
+
+

When something went wrong, the error is an Error object with a response field containing the whole response.

+

Connecting to a Nuxeo Server

+

After creating a Client, you can connect to a Nuxeo Server by using the connect method.
+This method returns a Promise which is resolved with the connected client.

+
var nuxeo = new Nuxeo({ ... });
+nuxeo.connect()
+  .then(function(client){
+    // client.connected === true
+    // client === nuxeo
+    console.log('Connected OK!');
+  })
+  .catch(function(error) {
+    // wrong credentials / auth method / ...
+    throw error;
+  });
+
+

Current User

+

The connect method fills the user property of the client. user is a full User object.

+
var nuxeo = new Nuxeo({ ... });
+nuxeo.connect()
+  .then(function(client){
+    // client.user.id === 'Administrator'
+    console.log(client.user);
+  })
+  .catch(function(error) {
+    // wrong credentials / auth method / ...
+    throw error;
+  });
+
+

Nuxeo Server version

+

The connect method fills the serverVersion property of the client.

+
var nuxeo = new Nuxeo({ ... });
+nuxeo.connect()
+  .then(function(client){
+    console.log(client.serverVersion); // '9.10'
+  })
+  .catch(function(error) {
+    // wrong credentials / auth method / ...
+    throw error;
+  });
+
+

Some constants are available in the Nuxeo object for supported LTS versions:

+
Nuxeo.SERVER_VERSIONS.LTS_2017; // for '9.10';
+Nuxeo.SERVER_VERSIONS.LTS_2019; // for '10.10';
+
+

You can use them to easily make different calls according to the target version:

+
...
+if (nuxeo.serverVersion.lt(Nuxeo.SERVER_VERSIONS.LTS_2017)) {
+  // do something on versions before LTS 2016
+} else {
+  // do something else
+}
+...
+
+

See the ServerVersion documentation.

+

Note that the nuxeoVersion property is deprecated but it is still filled with the Nuxeo Server version.

+

Operation

+

Operation object allows you to execute an operation
+(or operation chain).

+

See the Operation documentation.

+

Samples

+

Call an operation to create a new folder in the Root document

+
nuxeo.operation('Document.Create')
+  .params({
+    type: 'Folder',
+    name: 'My Folder',
+    properties: 'dc:title=My Folder \ndc:description=A Simple Folder'
+  })
+  .input('/')
+  .execute()
+  .then(function(doc) {
+    console.log('Created ' + doc.title + ' folder');
+  })
+  .catch(function(error) {
+    throw error;
+  });
+
+

Request

+

The Request object allows you to call the Nuxeo REST API.

+

See the Request documentation.

+

Samples

+

Fetch the Administrator user

+
nuxeo.request('user/Administrator')
+  .get()
+  .then(function(user) {
+    console.log(user);
+  })
+  .catch(function(error) {
+    throw error;
+  });
+
+

Fetch the whole list of Natures

+
nuxeo.request('directory/nature')
+  .get()
+  .then(function(data) {
+    console.log(JSON.stringify(data.entries, null, 2))
+  })
+  .catch(function(error) {
+    throw error
+  });
+
+

Repository

+

The Repository object allows you to work with document.

+

See the Repository documentation.

+

Samples

+

Create a Repository object

+
var defaultRepository = nuxeo.repository(); // 'default' repository
+...
+var testRepository = nuxeo.repository('test'); // 'test' repository
+...
+
+

Fetch the Root document

+
nuxeo.repository().fetch('/')
+  .then(function(doc) {
+    console.log(doc);
+  })
+  .catch(function(error) {
+    throw error;
+  });
+
+

Create a new folder

+
var newFolder = {
+  'entity-type': 'document',
+  name: 'a-folder',
+  type: 'Folder',
+  properties: {
+    'dc:title': 'foo'
+  }
+};
+nuxeo.repository()
+  .create('/', newFolder)
+  .then(function(doc) {
+    console.log(doc);
+  })
+  .catch(function(error) {
+    throw error;
+  });
+
+

Delete a document

+
nuxeo.repository()
+  .delete('/a-folder')
+  .then(function(res) {
+    // res.status === 204
+  });
+
+

Document

+

Repository object returns and works with Document objects. Document objects exposes a simpler API
+to work with a document.

+

See the Document documentation.

+

Samples

+

Retrieve a Document object

+
nuxeo.repository()
+  .fetch('/')
+  .then(function(doc) {
+    // doc instanceof Nuxeo.Document === true
+  })
+  .catch(function(error) {
+    throw error;
+  });
+
+

Set a document property

+
doc.set({ 'dc:title': 'foo' });
+
+

Get a document property

+
doc.get('dc:title');
+
+

Save an updated document

+
nuxeo.repository()
+  .fetch('/')
+  .then(function(doc) {
+    // doc.title !== 'foo'
+    doc.set({ 'dc:title': 'foo' });
+    return doc.save();
+  })
+  .then(function(doc) {
+    // doc.title === 'foo'
+  })
+  .catch(function(error) {
+    throw error;
+  });
+
+

Fetch the main Blob of a document

+
doc.fetchBlob()
+  .then(function(res) {
+    // in the browser, use res.blob() to work with the converted PDF
+    // in Node.js, use res.body
+  });
+
+

Convert a document main Blob to PDF

+
doc.convert({ format: 'pdf' })
+  .then(function(res) {
+    // in the browser, use res.blob() to work with the converted PDF
+    // in Node.js, use res.body
+  });
+
+

Fetch the 'thumbnail' rendition

+
doc.fetchRendition('thumbnail')
+  .then(function(res) {
+    // in the browser, use res.blob() to work with the rendition
+    // in Node.js, use res.body
+  });
+
+

Start a workflow

+
doc.startWorkflow('SerialDocumentReview')
+  .then(function(workflow) {
+    // workflow instance of Nuxeo.Workflow
+  });
+
+

Complete a workflow task

+
workflow.fetchTasks()
+  .then(function(tasks) {
+    return tasks[0];
+  })
+  .then(function(tasks) {
+    task.variable('participants', ['user:Administrator'])
+      .variable('assignees', ['user:Administrator'])
+      .variable('end_date', '2011-10-23T12:00:00.00Z');
+    return task.complete('start_review', { comment: 'a comment' });
+  })
+  .then(function(task) {
+    // task.state === 'ended'
+  })
+
+

BatchUpload

+

The BatchUpload object allows you to upload blobs to a Nuxeo Platform instance, and use them as operation input or
+as document property value.

+

See the BatchUpload documentation.

+

Samples

+

Create a Nuxeo.Blob to be uploaded

+
// on the browser, assuming you have a File object 'file'
+var blob = new Nuxeo.Blob({ content: file });
+// the name, mimeType and size will be extracted from the file object itself, you can still override them.
+...
+// on Node.js, assuming you have a Stream 'file'
+var blob = new Nuxeo.Blob({ content: file, name: 'foo.txt', mimeType: 'plain/text', size: 10 })
+
+

Upload a blob

+
nuxeo.batchUpload()
+  .upload(blob)
+  .then(function(res) {
+    // res.blob instanceof Nuxeo.BatchBlob
+    console.log(res.blob);
+  })
+  .catch(function(error) {
+    throw error;
+  });
+
+

Attach an uploaded blob to a document

+
nuxeo.batchUpload()
+  .upload(blob)
+  .then(function(res) {
+    return nuxeo.operation('Blob.AttachOnDocument')
+      .param('document', '/a-file')
+      .input(res.blob)
+      .execute();
+  })
+  .then(function() {
+    return nuxeo.repository().fetch('/a-file', { schemas: ['dublincore', 'file']});
+  })
+  .then(function(doc) {
+    console.log(doc.get('file:content'));
+  })
+  .catch(function(error) {
+    throw error;
+  });
+
+

Users

+

The Users object allows you to work with users.

+

See the Users and
+User documentation.

+

Samples

+

Fetch an user

+
nuxeo.users()
+  .fetch('Administrator')
+  .then(function(user) {
+    // user.id === 'Administrator'
+  });
+
+

Create a new user

+
var newUser = {
+  properties: {
+    username: 'leela',
+    firstName: 'Leela',
+    company: 'Futurama',
+    email: 'leela@futurama.com'
+  },
+};
+nuxeo.users()
+  .create(newUser)
+  .then(function(user) {
+    // user.id === 'leela'
+  });
+
+

Delete an user

+
nuxeo.users()
+  .delete('leela').then(function(res) {
+    // res.status === 204
+  });
+
+

Groups

+

The Groups object allows you to work with groups.

+

See the Groups and
+Group documentation.

+

Samples

+

Fetch a group

+
nuxeo.groups().fetch('administrators')
+  .then(function(group) {
+    // group.groupname === 'administrators'
+  });
+
+

Create a new group

+
var newGroup = {
+  groupname: 'foo',
+  grouplabel: 'Foo'
+};
+nuxeo.groups()
+  .create(newGroup)
+  .then(function(group) {
+    // group.groupname === 'foo';
+  });
+
+

Delete a group

+
nuxeo.groups()
+  .delete('foo').then(function(res) {
+    // res.status === 204
+  });
+
+

Directory

+

The Directory object allows you to work with directories.

+

See the Directory and
+DirectoryEntry documentation.

+

Samples

+

Fetch all entries of a directory

+
nuxeo.directory('nature')
+  .fetchAll()
+  .then(function(entries) {
+    // entries instance of Array
+  });
+
+

Fetch a given directory entry

+
nuxeo.directory('nature')
+  .fetch('article')
+  .then(function(entry) {
+    // entry.directoryName === 'nature'
+    // entry.properties.id === 'article'
+  });
+
+

Create a new directory entry

+
var newEntry = {
+  properties: {
+    id: 'foo',
+    label: 'Foo'
+  },
+};
+nuxeo.directory('nature')
+  .create(newEntry)
+  .then(function(entry) {
+    // entry.directoryName === 'nature'
+    // entry.properties.id === 'foo'
+  });
+
+

Delete a directory entry

+
nuxeo.directory('nature')
+ .delete('foo')
+ .then(function(res) {
+   // res.status === 204
+ });
+
+

Contributing

+

See our contribution documentation.

+

Requirements

+ +

Setup

+

Install Node.js and then use yarn to install all the required
+libraries:

+
$ git clone https://github.com/nuxeo/nuxeo-js-client
+$ cd nuxeo-js-client
+$ yarn
+
+

Test

+

A Nuxeo Platform instance needs to be running on http://localhost:8080/nuxeo for the tests to be run.

+

Tests can be launched on Node.js with:

+
$ yarn test:node
+
+

For testing the browser client (tests are run on Chrome by default):

+
$ yarn test:browser
+
+

To run both Node.js and browser tests:

+
$ yarn test
+
+

Reporting Issues

+

You can follow the developments in the Nuxeo JS Client project of our JIRA bug tracker: https://jira.nuxeo.com/browse/NXJS.

+

You can report issues on answers.nuxeo.com.

+

Big Thanks

+

Cross-browser Testing Platform and Open Source <3 Provided by Sauce Labs

+

License

+

Apache License 2.0 Copyright (c) Nuxeo SA

+

About Nuxeo

+

Nuxeo dramatically improves how content-based applications are built, managed and deployed, making customers more agile, innovative and successful. Nuxeo provides a next generation, enterprise ready platform for building traditional and cutting-edge content oriented applications. Combining a powerful application development environment with SaaS-based tools and a modular architecture, the Nuxeo Platform and Products provide clear business value to some of the most recognizable brands including Verizon, Electronic Arts, Sharp, FICO, the U.S. Navy, and Boeing. Nuxeo is headquartered in New York and Paris. More information is available at www.nuxeo.com.

+
+ + + + + + +
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/4.0.4/nuxeo-versions.js.html b/4.0.4/nuxeo-versions.js.html new file mode 100644 index 00000000..90ce4e8a --- /dev/null +++ b/4.0.4/nuxeo-versions.js.html @@ -0,0 +1,59 @@ + + + + + JSDoc: Source: nuxeo-versions.js + + + + + + + + + + +
+ +

Source: nuxeo-versions.js

+ + + + + + +
+
+
/**
+ * @deprecated since version 3.5.0.
+ */
+module.exports = {
+  LTS_2015: '7.10',
+  LTS_2016: '8.10',
+  LTS_2017: '9.10',
+};
+
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/4.0.4/nuxeo.js.html b/4.0.4/nuxeo.js.html new file mode 100644 index 00000000..3c9a836d --- /dev/null +++ b/4.0.4/nuxeo.js.html @@ -0,0 +1,508 @@ + + + + + JSDoc: Source: nuxeo.js + + + + + + + + + + +
+ +

Source: nuxeo.js

+ + + + + + +
+
+
const extend = require('extend');
+const qs = require('querystring');
+
+const Base = require('./base');
+const ServerVersion = require('./server-version');
+const Operation = require('./operation');
+const Request = require('./request');
+const Repository = require('./repository');
+const BatchUpload = require('./upload/batch');
+const Users = require('./user/users');
+const Groups = require('./group/groups');
+const Directory = require('./directory/directory');
+const Workflows = require('./workflow/workflows');
+const join = require('./deps/utils/join');
+const Promise = require('./deps/promise');
+const FormData = require('./deps/form-data');
+const Authentication = require('./auth/auth');
+const Unmarshallers = require('./unmarshallers/unmarshallers');
+const doFetch = require('./deps/fetch');
+
+const API_PATH_V1 = 'api/v1/';
+const AUTOMATION = 'automation/';
+
+const DEFAULT_OPTS = {
+  baseURL: 'http://localhost:8080/nuxeo/',
+  apiPath: API_PATH_V1,
+  promiseLibrary: null,
+  auth: null,
+};
+
+/**
+ * The `Nuxeo` class allows using the REST API of a Nuxeo Platform instance.
+ * @extends Base
+ *
+ * @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
+ *   });
+ */
+class Nuxeo extends Base {
+  /**
+   * Creates a new Nuxeo instance.
+   * @param {object} [opts] - The configuration options.
+   * @param {string} [opts.baseURL=http://localhost:8080/nuxeo/] - Base URL of the Nuxeo Platform.
+   * @param {string} [opts.apiPath=api/v1] - The API path.
+   * @param {object} [opts.auth] - The authentication configuration.
+   */
+  constructor(opts = {}) {
+    const options = extend(true, {}, DEFAULT_OPTS, opts);
+    super(options);
+    this._baseURL = options.baseURL;
+    this._restURL = join(this._baseURL, options.apiPath);
+    this._automationURL = join(this._restURL, AUTOMATION);
+    this._auth = options.auth;
+    this._authenticationRefreshedListeners = [];
+    this.connected = false;
+    this.Promise = Nuxeo.Promise || Promise;
+    this._activeRequests = 0;
+  }
+
+  /**
+   * Connects to the Nuxeo Platform instance using the configured authentication.
+   *
+   * This method fills the `user` property with the current user
+   * and the `serverVersion` property with the Nuxeo Server version.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise resolved with the connected client.
+   */
+  connect(opts = {}) {
+    let finalOptions = {
+      method: 'GET',
+      url: join(this._baseURL, 'json/cmis'),
+    };
+    finalOptions = extend(true, finalOptions, opts);
+    finalOptions = this._computeOptions(finalOptions);
+    return this.http(finalOptions)
+      .then((res) => {
+        if (res && res.default && res.default.productVersion) {
+          this.serverVersion = new ServerVersion(res.default.productVersion);
+          this.nuxeoVersion = res.default.productVersion;
+        }
+        // log the user
+        finalOptions.method = 'POST';
+        finalOptions.url = join(this._automationURL, 'login');
+        return this.http(finalOptions);
+      })
+      .then((res) => this.users({ enrichers: { user: ['userprofile'] } }).fetch(res.username))
+      .then((user) => {
+        this.user = user;
+        this.connected = true;
+        return this;
+      });
+  }
+
+  /**
+   * Connects to the Nuxeo Platform instance using the configured authentication.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise resolved with the logged in user.
+   * @deprecated since version 3.0, use {#connect} instead.
+   */
+  login(opts = {}) {
+    return this.connect(opts);
+  }
+
+  /**
+   * Does a http request.
+   *
+   * To be used when doing any call on Nuxeo Platform.
+   */
+  http(opts = {}) {
+    const options = this._computeFetchOptions(opts);
+    return new this.Promise((resolve, reject) => {
+      this._activeRequests += 1;
+
+      const fetchOptions = {
+        method: options.method,
+        headers: options.headers,
+        body: options.body,
+        signal: options.signal,
+      };
+      if (opts.credentials) {
+        fetchOptions.credentials = opts.credentials;
+      } else if (!this._auth) {
+        fetchOptions.credentials = 'include';
+      }
+
+      doFetch(options.url, fetchOptions)
+        .then((res) => {
+          this._activeRequests -= 1;
+          if (res.status === 401 && !opts.refreshedAuthentication
+            && Authentication.canRefreshAuthentication(this._auth)) {
+            // try re-authenticate
+            opts.refreshedAuthentication = true;
+            return Authentication.refreshAuthentication(this._baseURL, this._auth)
+              .then((refreshedAuth) => {
+                this._auth = refreshedAuth;
+                this._notifyAuthenticationRefreshed(refreshedAuth);
+                return resolve(this.http(opts));
+              })
+              .catch(() => {
+                const error = new Error(res.statusText);
+                error.response = res;
+                return reject(error);
+              });
+          }
+
+          if (!(/^2/.test(`${res.status}`))) {
+            const error = new Error(res.statusText);
+            error.response = res;
+            return reject(error);
+          }
+
+          if (options.resolveWithFullResponse || res.status === 204) {
+            return resolve(res);
+          }
+
+          const contentType = res.headers.get('content-type');
+          if (contentType && contentType.indexOf('application/json') === 0) {
+            options.nuxeo = this;
+            return resolve(res.json().then((json) => Unmarshallers.unmarshall(json, options, res)));
+          }
+          return resolve(res);
+        }).catch((error) => {
+          this._activeRequests -= 1;
+          return reject(error);
+        });
+    });
+  }
+
+  /**
+   * Does a http request.
+   *
+   * To be used when doing any call on Nuxeo Platform.
+   * @deprecated since version 3.3, use {#http} instead.
+   */
+  _http(opts = {}) {
+    return this.http(opts);
+  }
+
+  _computeFetchOptions(opts) {
+    let options = {
+      method: 'GET',
+      headers: {},
+      json: true,
+      cache: false,
+      resolveWithFullResponse: false,
+    };
+    options = extend(true, {}, options, opts);
+    const authenticationHeaders = Authentication.computeAuthenticationHeaders(this._auth);
+    options.headers = extend(options.headers, authenticationHeaders);
+
+    if (options.schemas && options.schemas.length > 0) {
+      options.headers.properties = options.schemas.join(',');
+    }
+    if (opts.repositoryName !== undefined) {
+      options.headers['X-NXRepository'] = options.repositoryName;
+    }
+
+    if (opts.enrichers) {
+      Object.keys(opts.enrichers).forEach((key) => {
+        options.headers[`enrichers-${key}`] = options.enrichers[key].join(',');
+      });
+    }
+
+    if (opts.fetchProperties) {
+      Object.keys(opts.fetchProperties).forEach((key) => {
+        options.headers[`fetch-${key}`] = options.fetchProperties[key].join(',');
+      });
+    }
+
+    if (opts.translateProperties) {
+      Object.keys(opts.translateProperties).forEach((key) => {
+        options.headers[`translate-${key}`] = options.translateProperties[key].join(',');
+      });
+    }
+
+    if (options.depth) {
+      options.headers.depth = options.depth;
+    }
+
+    const { httpTimeout, transactionTimeout } = this._computeTimeouts(options);
+    if (transactionTimeout) {
+      options.headers['Nuxeo-Transaction-Timeout'] = transactionTimeout;
+    }
+    options.timeout = httpTimeout;
+
+    if (options.json) {
+      options.headers.Accept = 'application/json';
+      options.headers['Content-Type'] = options.headers['Content-Type'] || 'application/json';
+      // do not stringify FormData
+      if (typeof options.body === 'object' && !(options.body instanceof FormData)) {
+        options.body = JSON.stringify(options.body);
+      }
+    }
+
+    if (options.method === 'GET') {
+      delete options.headers['Content-Type'];
+    }
+
+    if (options.queryParams && Object.keys(options.queryParams).length > 0) {
+      options.url += options.url.indexOf('?') === -1 ? '?' : '';
+      options.url += qs.stringify(options.queryParams);
+    }
+    return options;
+  }
+
+  _computeTimeouts(options) {
+    const transactionTimeout = options.transactionTimeout || options.timeout;
+    let { httpTimeout } = options;
+    if (!httpTimeout && transactionTimeout) {
+      // make the http timeout a bit longer than the transaction timeout
+      httpTimeout = 5 + transactionTimeout;
+    }
+    return { httpTimeout, transactionTimeout };
+  }
+
+  /**
+   * Creates a new {@link Operation} object.
+   * @param {string} id - The operation ID.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Operation}
+   */
+  operation(id, opts = {}) {
+    let finalOptions = {
+      id,
+      nuxeo: this,
+      url: this._automationURL,
+    };
+    finalOptions = extend(true, finalOptions, opts);
+    finalOptions = this._computeOptions(finalOptions);
+    return new Operation(finalOptions);
+  }
+
+  /**
+   * Creates a new {@link Request} object.
+   * @param {string} path - The request default path.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Request}
+   */
+  request(path, opts = {}) {
+    let finalOptions = {
+      path,
+      nuxeo: this,
+      url: this._restURL,
+    };
+    finalOptions = extend(true, finalOptions, opts);
+    finalOptions = this._computeOptions(finalOptions);
+    return new Request(finalOptions);
+  }
+
+  /**
+   * Creates a new {@link Repository} object.
+   * @param {string} name - The repository name. Default to the Nuxeo's repository name.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Repository}
+   */
+  repository(name = null, opts = {}) {
+    let repositoryName = name;
+    let options = opts;
+    if (typeof repositoryName === 'object') {
+      options = repositoryName;
+      repositoryName = null;
+    }
+
+    let finalOptions = {
+      nuxeo: this,
+    };
+    if (repositoryName) {
+      finalOptions.repositoryName = repositoryName;
+    }
+    finalOptions = extend(true, finalOptions, options);
+    finalOptions = this._computeOptions(finalOptions);
+    return new Repository(finalOptions);
+  }
+
+  /**
+   * Creates a new {@link BatchUpload} object.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {BatchUpload}
+   */
+  batchUpload(opts = {}) {
+    let finalOptions = {
+      nuxeo: this,
+      url: this._restURL,
+    };
+    finalOptions = extend(true, finalOptions, opts);
+    finalOptions = this._computeOptions(finalOptions);
+    return new BatchUpload(finalOptions);
+  }
+
+  /**
+   * Creates a new {@link Users} object to manage users.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Users}
+   */
+  users(opts = {}) {
+    let finalOptions = {
+      nuxeo: this,
+    };
+    finalOptions = extend(true, finalOptions, opts);
+    finalOptions = this._computeOptions(finalOptions);
+    return new Users(finalOptions);
+  }
+
+  /**
+   * Creates a new {@link Groups} object to manage groups.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Groups}
+   */
+  groups(opts = {}) {
+    let finalOptions = {
+      nuxeo: this,
+    };
+    finalOptions = extend(true, finalOptions, opts);
+    finalOptions = this._computeOptions(finalOptions);
+    return new Groups(finalOptions);
+  }
+
+  /**
+   * Creates a new {@link Directory} object.
+   * @param {string} name - The directory name.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Directory}
+   */
+  directory(name, opts = {}) {
+    let finalOptions = {
+      directoryName: name,
+      nuxeo: this,
+    };
+    finalOptions = extend(true, finalOptions, opts);
+    finalOptions = this._computeOptions(finalOptions);
+    return new Directory(finalOptions);
+  }
+
+  /**
+   * Creates a new {@link Workflows} object.
+   * @param {string} name - The repository name. Default to the Nuxeo's repository name.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Workflows}
+   */
+  workflows(repositoryName = this._repositoryName, opts = {}) {
+    let finalOptions = {
+      repositoryName,
+      nuxeo: this,
+    };
+    finalOptions = extend(true, finalOptions, opts);
+    finalOptions = this._computeOptions(finalOptions);
+    return new Workflows(finalOptions);
+  }
+
+  requestAuthenticationToken(applicationName, deviceId, deviceDescription, permission, opts = {}) {
+    let finalOptions = {
+      method: 'GET',
+      url: join(this._baseURL, 'authentication', 'token'),
+      queryParams: {
+        applicationName,
+        deviceId,
+        deviceDescription,
+        permission,
+      },
+    };
+    finalOptions = extend(true, finalOptions, opts);
+    finalOptions = this._computeOptions(finalOptions);
+    return this.http(finalOptions)
+      .then((res) => res.text());
+  }
+
+  computeAuthenticationHeaders() {
+    return Authentication.computeAuthenticationHeaders(this._auth);
+  }
+
+  authenticateURL(url) {
+    return Authentication.authenticateURL(url, this._auth);
+  }
+
+  onAuthenticationRefreshed(listener) {
+    this._authenticationRefreshedListeners.push(listener);
+  }
+
+  _notifyAuthenticationRefreshed(refreshedAuthentication) {
+    this._authenticationRefreshedListeners.forEach((listener) => listener.call(this, refreshedAuthentication));
+  }
+}
+
+/**
+ * Sets the Promise library class to use.
+ */
+Nuxeo.promiseLibrary = (promiseLibrary) => {
+  Nuxeo.Promise = promiseLibrary;
+};
+
+/**
+ * Registers an Authenticator for a given authentication method.
+ */
+Nuxeo.registerAuthenticator = (method, authenticator) => {
+  Authentication.registerAuthenticator(method, authenticator);
+};
+
+/**
+ * Registers an Unmarshaller for a given entity type.
+ */
+Nuxeo.registerUnmarshaller = (entityType, unmarshaller) => {
+  Unmarshallers.registerUnmarshaller(entityType, unmarshaller);
+};
+
+module.exports = Nuxeo;
+
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/4.0.4/operation.js.html b/4.0.4/operation.js.html new file mode 100644 index 00000000..d3443cb0 --- /dev/null +++ b/4.0.4/operation.js.html @@ -0,0 +1,266 @@ + + + + + JSDoc: Source: operation.js + + + + + + + + + + +
+ +

Source: operation.js

+ + + + + + +
+
+
const extend = require('extend');
+const Base = require('./base');
+const join = require('./deps/utils/join');
+const encodePath = require('./deps/utils/encodePath');
+const Blob = require('./blob');
+const BatchBlob = require('./upload/blob');
+const BatchUpload = require('./upload/batch');
+const Document = require('./document');
+const FormData = require('./deps/form-data');
+
+const isDocument = (obj) => (obj instanceof Document || (typeof obj === 'object' && obj['entity-type'] === 'document'));
+
+/**
+ * The `Operation` class allows to execute an operation on a Nuxeo Platform instance.
+ *
+ * **Cannot directly be instantiated**
+ *
+ * @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);
+ *   });
+ */
+class Operation extends Base {
+  /**
+   * Creates an Operation.
+   * @param {string} opts - The configuration options.
+   * @param {string} opts.nuxeo - The {@link Nuxeo} object linked to this `Operation` object.
+   * @param {string} opts.id - The ID of the operation.
+   * @param {string} opts.url - The automation URL.
+   */
+  constructor(opts) {
+    const options = extend(true, {}, opts);
+    super(options);
+    this._nuxeo = options.nuxeo;
+    this._id = options.id;
+    this._url = options.url;
+    this._automationParams = {
+      params: {},
+      context: {},
+      input: undefined,
+    };
+  }
+
+  /**
+   * Adds an operation param.
+   * @param {string} name - The param name.
+   * @param {string} value - The param value.
+   * @returns {Operation} The operation itself.
+   */
+  param(name, value) {
+    this._automationParams.params[name] = value;
+    return this;
+  }
+
+  /**
+   * Adds operation params. The given params are merged with the existing ones if any.
+   * @param {object} params - The params to be merge with the existing ones.
+   * @returns {Operation} The operation itself.
+   */
+  params(params) {
+    this._automationParams.params = extend(true, {}, this._automationParams.params, params);
+    return this;
+  }
+
+  /**
+   * Sets this operation context.
+   * @param {object} context - The operation context.
+   * @returns {Operation} The operation itself.
+   */
+  context(context) {
+    this._automationParams.context = context;
+    return this;
+  }
+
+  /**
+   * Sets this operation input.
+   * @param {string|Array|Blob|BatchBlob|BatchUpload} input - The operation input.
+   * @returns {Operation} The operation itself.
+   */
+  input(input) {
+    this._automationParams.input = input;
+    return this;
+  }
+
+  /**
+   * Executes this operation.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the result of the Operation.
+   */
+  execute(opts = {}) {
+    const options = this._computeOptions(opts);
+    options.headers = options.headers || {};
+    options.headers['Content-Type'] = this._computeContentTypeHeader(this._automationParams.input);
+    let finalOptions = {
+      method: 'POST',
+      url: this._computeRequestURL(),
+      body: this._computeRequestBody(),
+    };
+    finalOptions = extend(true, finalOptions, options);
+    return this._nuxeo.http(finalOptions);
+  }
+
+  _computeContentTypeHeader(input) {
+    return this._isMultipartInput(input) ? 'multipart/form-data' : 'application/json';
+  }
+
+  _computeRequestURL() {
+    const { input } = this._automationParams;
+    if (input instanceof BatchBlob) {
+      return join(this._nuxeo._restURL, 'upload', input['upload-batch'], input['upload-fileId'], 'execute', this._id);
+    }
+    if (input instanceof BatchUpload) {
+      return join(this._nuxeo._restURL, 'upload', input._batchId, 'execute', this._id);
+    }
+
+    return join(this._url, encodePath(this._id));
+  }
+
+  _computeRequestBody() {
+    const { input } = this._automationParams;
+    if (this._isBatchInput(input)) {
+      // no input needed
+      const body = extend(true, {}, this._automationParams);
+      body.input = undefined;
+      return body;
+    }
+
+    if (input instanceof Array) {
+      if (input.length > 0) {
+        const first = input[0];
+        if (isDocument(first)) {
+          // assume document list
+          const docs = input.map((doc) => doc.uid);
+          this._automationParams.input = `docs:${docs.join(',')}`;
+          return this._automationParams;
+        }
+
+        if (typeof first === 'string') {
+          // assume ref list
+          this._automationParams.input = `docs:${input.join(',')}`;
+          return this._automationParams;
+        }
+
+        if (first instanceof Blob) {
+          // blob list => multipart
+          const automationParams = {
+            params: this._automationParams.params,
+            context: this._automationParams.context,
+          };
+          const form = new FormData();
+          form.append('params', JSON.stringify(automationParams));
+
+          let inputIndex = 0;
+          for (const blob of input) {
+            form.append(`input#${inputIndex}`, blob.content, blob.name);
+            inputIndex += 1;
+          }
+          return form;
+        }
+      }
+    } else if (isDocument(input)) {
+      this._automationParams.input = input.uid || input;
+      return this._automationParams;
+    } else if (input instanceof Blob) {
+      const automationParams = {
+        params: this._automationParams.params,
+        context: this._automationParams.context,
+      };
+      const form = new FormData();
+      form.append('params', JSON.stringify(automationParams));
+      form.append('input', input.content, input.name);
+      return form;
+    }
+    return this._automationParams;
+  }
+
+  _isMultipartInput(input) {
+    if (input instanceof Array) {
+      if (input.length > 0) {
+        const first = input[0];
+        if (first instanceof Blob) {
+          return true;
+        }
+      }
+    } else if (input instanceof Blob) {
+      return true;
+    }
+    return false;
+  }
+
+  _isBatchInput(input) {
+    return input instanceof BatchUpload || input instanceof BatchBlob;
+  }
+}
+
+module.exports = Operation;
+
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/4.0.4/repository.js.html b/4.0.4/repository.js.html new file mode 100644 index 00000000..95e0ae06 --- /dev/null +++ b/4.0.4/repository.js.html @@ -0,0 +1,200 @@ + + + + + JSDoc: Source: repository.js + + + + + + + + + + +
+ +

Source: repository.js

+ + + + + + +
+
+
const Base = require('./base');
+const join = require('./deps/utils/join');
+
+function computePath(ref, options) {
+  let path = join(ref.indexOf('/') === 0 ? 'path' : 'id', ref);
+
+  const { repositoryName } = options;
+  if (repositoryName !== undefined) {
+    path = join('repo', repositoryName, path);
+  }
+
+  return path;
+}
+
+/**
+ * The `Repository` class allows to work with documents on a Nuxeo Platform instance.
+ *
+ * **Cannot directly be instantiated**
+ *
+ * @example
+ * var Nuxeo = require('nuxeo')
+ * var nuxeo = new Nuxeo({
+ *  baseURL: 'http://localhost:8080/nuxeo',
+ *  auth: {
+ *    method: 'basic',
+ *    username: 'Administrator',
+ *    password: 'Administrator'
+ *  }
+ * });
+ * nuxeo.repository('default')
+ *   .fetch('/default-domain')
+ *   .then(function(res) {
+ *     // res.uid !== null
+ *     // res.type === 'Domain'
+ *   })
+ *   .catch(function(error) {
+ *     throw new Error(error);
+ *   });
+ */
+class Repository extends Base {
+  /**
+   * Creates a Repository.
+   * @param {object} opts - The configuration options.
+   * @param {string} opts.nuxeo - The {@link Nuxeo} object linked to this repository.
+   */
+  constructor(opts = {}) {
+    super(opts);
+    this._nuxeo = opts.nuxeo;
+  }
+
+  /**
+   * Fetches a document given a document ref.
+   * @param {string} ref - The document ref. A path if starting with '/', otherwise and id.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the {@link Document}.
+   */
+  fetch(ref, opts = {}) {
+    const options = this._computeOptions(opts);
+    const path = computePath(ref, options);
+    options.repository = this;
+    return this._nuxeo.request(path)
+      .get(options);
+  }
+
+  /**
+   * Creates a document.
+   * @param {string} parentRef - The parent document ref. A path if starting with '/', otherwise and id.
+   * @param {object} doc - The document to be created.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the created {@link Document}.
+   */
+  create(parentRef, doc, opts = {}) {
+    opts.body = {
+      'entity-type': 'document',
+      type: doc.type,
+      name: doc.name,
+      properties: doc.properties,
+    };
+    const options = this._computeOptions(opts);
+    const path = computePath(parentRef, options);
+    options.repository = this;
+    return this._nuxeo.request(path)
+      .post(options);
+  }
+
+  /**
+   * Updates a document. Assumes that the doc object has an uid field.
+   * @param {object} doc - The document to be updated.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the updated {@link Document}.
+   */
+  update(doc, opts = {}) {
+    opts.body = {
+      'entity-type': 'document',
+      uid: doc.uid,
+      properties: doc.properties,
+    };
+    const options = this._computeOptions(opts);
+    const path = computePath(doc.uid, options);
+    options.repository = this;
+    return this._nuxeo.request(path)
+      .put(options);
+  }
+
+  /**
+   * Deletes a document given a document ref.
+   * @param {string} ref - The document ref. A path if starting with '/', otherwise and id.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the result of the DELETE request.
+   */
+  delete(ref, opts = {}) {
+    const options = this._computeOptions(opts);
+    const path = computePath(ref, options);
+    return this._nuxeo.request(path)
+      .delete(options);
+  }
+
+  /**
+   * Performs a query returning documents.
+   * Named parameters can be set in the `queryOpts` object, such as
+   * { query: ..., customParam1: 'foo', anotherParam: 'bar'}
+   * @param {object} queryOpts - The query options.
+   * @param {string} queryOpts.query - The query to execute. `query` or `pageProvider` must be set.
+   * @param {string} queryOpts.pageProvider - The page provider name to execute. `query` or `pageProvider` must be set.
+   * @param {array} [queryOpts.queryParams] - Ordered parameters for the query or page provider.
+   * @param {number} [queryOpts.pageSize=0] - The number of results per page.
+   * @param {number} [queryOpts.currentPageIndex=0] - The current page index.
+   * @param {number} [queryOpts.maxResults] - The expected max results.
+   * @param {string} [queryOpts.sortBy] - The sort by info.
+   * @param {string} [queryOpts.sortOrder] - The sort order info.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the response where the entries are replaced
+   *                    with Document objetcs.
+   */
+  query(queryOpts, opts = {}) {
+    const options = this._computeOptions(opts);
+    const path = this._computeQueryPath(queryOpts);
+    options.repository = this;
+    return this._nuxeo.request(path)
+      .queryParams(queryOpts)
+      .get(options);
+  }
+
+  _computeQueryPath(queryOpts) {
+    return join('search', queryOpts.pageProvider ? `pp/${queryOpts.pageProvider}` : '', 'execute');
+  }
+}
+
+module.exports = Repository;
+
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/4.0.4/request.js.html b/4.0.4/request.js.html new file mode 100644 index 00000000..45e77629 --- /dev/null +++ b/4.0.4/request.js.html @@ -0,0 +1,184 @@ + + + + + JSDoc: Source: request.js + + + + + + + + + + +
+ +

Source: request.js

+ + + + + + +
+
+
const extend = require('extend');
+const join = require('./deps/utils/join');
+const encodePath = require('./deps/utils/encodePath');
+const Base = require('./base');
+
+const defaultOptions = {
+  path: '',
+  queryParams: {},
+};
+
+/**
+ * The `Request` class allows to execute REST request on a Nuxeo Platform instance.
+ *
+ * **Cannot directly be instantiated**
+ *
+ * @example
+ * var Nuxeo = require('nuxeo')
+ * var nuxeo = new Nuxeo({
+ *  baseURL: 'http://localhost:8080/nuxeo',
+ *  auth: {
+ *    method: 'basic',
+ *    username: 'Administrator',
+ *    password: 'Administrator'
+ *  }
+ * });
+ * nuxeo.request('/path/default-domain')
+ *   .get()
+ *   .then(function(res) {
+ *     // res.uid !== null
+ *     // res.type === 'Domain'
+ *   })
+ *   .catch(function(error) {
+ *     throw new Error(error);
+ *   });
+ */
+class Request extends Base {
+  /**
+   * Creates a Request.
+   * @param {object} opts - The configuration options.
+   * @param {string} opts.nuxeo - The {@link Nuxeo} object linked to this groups object.
+   * @param {string} opts.path - The initial path of the request.
+   * @param {string} opts.queryParams - The initial query parameters of the request.
+   * @param {string} opts.url - The REST API URL.
+   */
+  constructor(opts = {}) {
+    const options = extend(true, {}, defaultOptions, opts);
+    super(options);
+    this._nuxeo = options.nuxeo;
+    this._path = options.path;
+    this._queryParams = options.queryParams;
+    this._url = options.url;
+  }
+
+  /**
+   * Adds path segment.
+   * @param {string} path - The path segment.
+   * @returns {Request} The request itself.
+   */
+  path(path) {
+    this._path = join(this._path, path);
+    return this;
+  }
+
+  /**
+   * Adds query params. The given query params are merged with the existing ones if any.
+   * @param {object} queryParams - The query params to be merged with the existing ones.
+   * @returns {Request} The request itself.
+   */
+  queryParams(queryParams) {
+    this._queryParams = extend(true, {}, this._queryParams, queryParams);
+    return this;
+  }
+
+  /**
+   * Performs a GET request.
+   * @param {object} opts - Options overriding the ones from the Request object.
+   * @returns {Promise} A Promise object resolved with the result of the request.
+   */
+  get(opts = {}) {
+    opts.method = 'GET';
+    return this.execute(opts);
+  }
+
+  /**
+   * Performs a POST request.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the result of the request.
+   */
+  post(opts = {}) {
+    opts.method = 'POST';
+    return this.execute(opts);
+  }
+
+  /**
+   * Performs a PUT request.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the result of the request.
+   */
+  put(opts = {}) {
+    opts.method = 'PUT';
+    return this.execute(opts);
+  }
+
+  /**
+   * Performs a DELETE request.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the result of the request.
+   */
+  delete(opts = {}) {
+    opts.method = 'DELETE';
+    return this.execute(opts);
+  }
+
+  /**
+   * Performs a Request.
+   * @param {object} opts - Options overriding the ones from this object.
+   * @param {string} opts.method - The HTTP method.
+   * @returns {Promise} A Promise object resolved with the result of the request.
+   */
+  execute(opts = {}) {
+    const options = this._computeOptions(opts);
+
+    const url = join(this._url, encodePath(this._path));
+    let finalOptions = {
+      url,
+      queryParams: this._queryParams,
+    };
+    finalOptions = extend(true, finalOptions, options);
+    return this._nuxeo.http(finalOptions);
+  }
+}
+
+module.exports = Request;
+
+
+
+ + + + +
+ + + +
+ + + + + + + diff --git a/4.0.4/scripts/linenumber.js b/4.0.4/scripts/linenumber.js new file mode 100644 index 00000000..4354785c --- /dev/null +++ b/4.0.4/scripts/linenumber.js @@ -0,0 +1,25 @@ +/*global document */ +(() => { + const source = document.getElementsByClassName('prettyprint source linenums'); + let i = 0; + let lineNumber = 0; + let lineId; + let lines; + let totalLines; + let anchorHash; + + if (source && source[0]) { + anchorHash = document.location.hash.substring(1); + lines = source[0].getElementsByTagName('li'); + totalLines = lines.length; + + for (; i < totalLines; i++) { + lineNumber++; + lineId = `line${lineNumber}`; + lines[i].id = lineId; + if (lineId === anchorHash) { + lines[i].className += ' selected'; + } + } + } +})(); diff --git a/4.0.4/scripts/prettify/Apache-License-2.0.txt b/4.0.4/scripts/prettify/Apache-License-2.0.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/4.0.4/scripts/prettify/Apache-License-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/4.0.4/scripts/prettify/lang-css.js b/4.0.4/scripts/prettify/lang-css.js new file mode 100644 index 00000000..041e1f59 --- /dev/null +++ b/4.0.4/scripts/prettify/lang-css.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", +/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); diff --git a/4.0.4/scripts/prettify/prettify.js b/4.0.4/scripts/prettify/prettify.js new file mode 100644 index 00000000..eef5ad7e --- /dev/null +++ b/4.0.4/scripts/prettify/prettify.js @@ -0,0 +1,28 @@ +var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; +(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= +[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), +l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, +q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, +q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, +"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), +a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} +for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], +H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ +I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), +["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", +/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), +["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", +hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= +!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p + + + + JSDoc: Source: server-version.js + + + + + + + + + + +
+ +

Source: server-version.js

+ + + + + + +
+
+
const SERVER_VERSION_PATTERN = /(\d+)\.(\d+)(?:-HF(\d+))?/;
+
+/**
+ * The `ServerVersion` class represents a Nuxeo Server version.
+ *
+ * It handles major, minor and hotfix version.
+ *
+ * Limitations:
+ *   - Ignore the `-SNAPSHOT` and `-IXXXXXXXX_XXXX` suffixes when parsing the server version
+ *   - '9.10-SNAPSHOT' is considered equals to '9.10'
+ *   - '9.10-20180101_1212' is considered equals to '9.10'
+ */
+class ServerVersion {
+  constructor(version) {
+    const match = version.match(SERVER_VERSION_PATTERN);
+    if (!match) {
+      throw new Error(`Unknown Nuxeo Server version: ${version}`);
+    }
+
+    this.major = parseInt(match[1], 10);
+    this.minor = parseInt(match[2], 10);
+    this.hotfix = parseInt(match[3], 10) || -1;
+    this.version = version;
+  }
+
+  static create(version) { return typeof version === 'string' ? new ServerVersion(version) : version; }
+
+  /**
+   * Returns whether this version is equal to the `version` param.
+   *
+   * @param {string|ServerVersion} version - The other version.
+   */
+  eq(version) {
+    const other = ServerVersion.create(version);
+    return this.major === other.major && this.minor === other.minor && this.hotfix === other.hotfix;
+  }
+
+  /**
+   * Returns whether this version is greater than the `version` param.
+   *
+   * @param {string|ServerVersion} version - The other version.
+   */
+  gt(version) {
+    const other = ServerVersion.create(version);
+    return this.major > other.major || (this.major === other.major && this.minor > other.minor)
+      || (this.major === other.major && this.minor === other.minor && this.hotfix > other.hotfix);
+  }
+
+  /**
+   * Returns whether this version is lesser than the `version` param.
+   *
+   * @param {string|ServerVersion} version - The other version.
+   */
+  lt(version) {
+    const other = ServerVersion.create(version);
+    return this.major < other.major || (this.major === other.major && this.minor < other.minor)
+      || (this.major === other.major && this.minor === other.minor && this.hotfix < other.hotfix);
+  }
+
+  /**
+   * Returns whether this version is greater than or equal to the `version` param.
+   *
+   * @param {string|ServerVersion} version - The other version.
+   */
+  gte(version) {
+    const other = ServerVersion.create(version);
+    return this.eq(other) || this.gt(other);
+  }
+
+  /**
+   * Returns whether this version is lesser than or equal to the `version` param.
+   *
+   * @param {string|ServerVersion} version - The other version.
+   */
+  lte(version) {
+    const other = ServerVersion.create(version);
+    return this.eq(other) || this.lt(other);
+  }
+
+  toString() {
+    return this.version;
+  }
+}
+
+const LTS_2016 = new ServerVersion('8.10');
+const LTS_2017 = new ServerVersion('9.10');
+const LTS_2019 = new ServerVersion('10.10');
+
+ServerVersion.LTS_2016 = LTS_2016;
+ServerVersion.LTS_2017 = LTS_2017;
+ServerVersion.LTS_2019 = LTS_2019;
+ServerVersion.SERVER_VERSIONS = { LTS_2016, LTS_2017, LTS_2019 };
+
+module.exports = ServerVersion;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.0 on Mon Dec 02 2024 10:14:28 GMT+0000 (Coordinated Universal Time) +
+ + + + + diff --git a/4.0.4/styles/jsdoc-default.css b/4.0.4/styles/jsdoc-default.css new file mode 100644 index 00000000..7d1729dc --- /dev/null +++ b/4.0.4/styles/jsdoc-default.css @@ -0,0 +1,358 @@ +@font-face { + font-family: 'Open Sans'; + font-weight: normal; + font-style: normal; + src: url('../fonts/OpenSans-Regular-webfont.eot'); + src: + local('Open Sans'), + local('OpenSans'), + url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-Regular-webfont.woff') format('woff'), + url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg'); +} + +@font-face { + font-family: 'Open Sans Light'; + font-weight: normal; + font-style: normal; + src: url('../fonts/OpenSans-Light-webfont.eot'); + src: + local('Open Sans Light'), + local('OpenSans Light'), + url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'), + url('../fonts/OpenSans-Light-webfont.woff') format('woff'), + url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg'); +} + +html +{ + overflow: auto; + background-color: #fff; + font-size: 14px; +} + +body +{ + font-family: 'Open Sans', sans-serif; + line-height: 1.5; + color: #4d4e53; + background-color: white; +} + +a, a:visited, a:active { + color: #0095dd; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +header +{ + display: block; + padding: 0px 4px; +} + +tt, code, kbd, samp { + font-family: Consolas, Monaco, 'Andale Mono', monospace; +} + +.class-description { + font-size: 130%; + line-height: 140%; + margin-bottom: 1em; + margin-top: 1em; +} + +.class-description:empty { + margin: 0; +} + +#main { + float: left; + width: 70%; +} + +article dl { + margin-bottom: 40px; +} + +article img { + max-width: 100%; +} + +section +{ + display: block; + background-color: #fff; + padding: 12px 24px; + border-bottom: 1px solid #ccc; + margin-right: 30px; +} + +.variation { + display: none; +} + +.signature-attributes { + font-size: 60%; + color: #aaa; + font-style: italic; + font-weight: lighter; +} + +nav +{ + display: block; + float: right; + margin-top: 28px; + width: 30%; + box-sizing: border-box; + border-left: 1px solid #ccc; + padding-left: 16px; +} + +nav ul { + font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif; + font-size: 100%; + line-height: 17px; + padding: 0; + margin: 0; + list-style-type: none; +} + +nav ul a, nav ul a:visited, nav ul a:active { + font-family: Consolas, Monaco, 'Andale Mono', monospace; + line-height: 18px; + color: #4D4E53; +} + +nav h3 { + margin-top: 12px; +} + +nav li { + margin-top: 6px; +} + +footer { + display: block; + padding: 6px; + margin-top: 12px; + font-style: italic; + font-size: 90%; +} + +h1, h2, h3, h4 { + font-weight: 200; + margin: 0; +} + +h1 +{ + font-family: 'Open Sans Light', sans-serif; + font-size: 48px; + letter-spacing: -2px; + margin: 12px 24px 20px; +} + +h2, h3.subsection-title +{ + font-size: 30px; + font-weight: 700; + letter-spacing: -1px; + margin-bottom: 12px; +} + +h3 +{ + font-size: 24px; + letter-spacing: -0.5px; + margin-bottom: 12px; +} + +h4 +{ + font-size: 18px; + letter-spacing: -0.33px; + margin-bottom: 12px; + color: #4d4e53; +} + +h5, .container-overview .subsection-title +{ + font-size: 120%; + font-weight: bold; + letter-spacing: -0.01em; + margin: 8px 0 3px 0; +} + +h6 +{ + font-size: 100%; + letter-spacing: -0.01em; + margin: 6px 0 3px 0; + font-style: italic; +} + +table +{ + border-spacing: 0; + border: 0; + border-collapse: collapse; +} + +td, th +{ + border: 1px solid #ddd; + margin: 0px; + text-align: left; + vertical-align: top; + padding: 4px 6px; + display: table-cell; +} + +thead tr +{ + background-color: #ddd; + font-weight: bold; +} + +th { border-right: 1px solid #aaa; } +tr > th:last-child { border-right: 1px solid #ddd; } + +.ancestors, .attribs { color: #999; } +.ancestors a, .attribs a +{ + color: #999 !important; + text-decoration: none; +} + +.clear +{ + clear: both; +} + +.important +{ + font-weight: bold; + color: #950B02; +} + +.yes-def { + text-indent: -1000px; +} + +.type-signature { + color: #aaa; +} + +.name, .signature { + font-family: Consolas, Monaco, 'Andale Mono', monospace; +} + +.details { margin-top: 14px; border-left: 2px solid #DDD; } +.details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; } +.details dd { margin-left: 70px; } +.details ul { margin: 0; } +.details ul { list-style-type: none; } +.details li { margin-left: 30px; padding-top: 6px; } +.details pre.prettyprint { margin: 0 } +.details .object-value { padding-top: 0; } + +.description { + margin-bottom: 1em; + margin-top: 1em; +} + +.code-caption +{ + font-style: italic; + font-size: 107%; + margin: 0; +} + +.source +{ + border: 1px solid #ddd; + width: 80%; + overflow: auto; +} + +.prettyprint.source { + width: inherit; +} + +.source code +{ + font-size: 100%; + line-height: 18px; + display: block; + padding: 4px 12px; + margin: 0; + background-color: #fff; + color: #4D4E53; +} + +.prettyprint code span.line +{ + display: inline-block; +} + +.prettyprint.linenums +{ + padding-left: 70px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.prettyprint.linenums ol +{ + padding-left: 0; +} + +.prettyprint.linenums li +{ + border-left: 3px #ddd solid; +} + +.prettyprint.linenums li.selected, +.prettyprint.linenums li.selected * +{ + background-color: lightyellow; +} + +.prettyprint.linenums li * +{ + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; +} + +.params .name, .props .name, .name code { + color: #4D4E53; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + font-size: 100%; +} + +.params td.description > p:first-child, +.props td.description > p:first-child +{ + margin-top: 0; + padding-top: 0; +} + +.params td.description > p:last-child, +.props td.description > p:last-child +{ + margin-bottom: 0; + padding-bottom: 0; +} + +.disabled { + color: #454545; +} diff --git a/4.0.4/styles/prettify-jsdoc.css b/4.0.4/styles/prettify-jsdoc.css new file mode 100644 index 00000000..5a2526e3 --- /dev/null +++ b/4.0.4/styles/prettify-jsdoc.css @@ -0,0 +1,111 @@ +/* JSDoc prettify.js theme */ + +/* plain text */ +.pln { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* string content */ +.str { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a keyword */ +.kwd { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a comment */ +.com { + font-weight: normal; + font-style: italic; +} + +/* a type name */ +.typ { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* a literal value */ +.lit { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* punctuation */ +.pun { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* lisp open bracket */ +.opn { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* lisp close bracket */ +.clo { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a markup tag name */ +.tag { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a markup attribute name */ +.atn { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a markup attribute value */ +.atv { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a declaration */ +.dec { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a variable name */ +.var { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* a function name */ +.fun { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; +} diff --git a/4.0.4/styles/prettify-tomorrow.css b/4.0.4/styles/prettify-tomorrow.css new file mode 100644 index 00000000..b6f92a78 --- /dev/null +++ b/4.0.4/styles/prettify-tomorrow.css @@ -0,0 +1,132 @@ +/* Tomorrow Theme */ +/* Original theme - https://github.com/chriskempson/tomorrow-theme */ +/* Pretty printing styles. Used with prettify.js. */ +/* SPAN elements with the classes below are added by prettyprint. */ +/* plain text */ +.pln { + color: #4d4d4c; } + +@media screen { + /* string content */ + .str { + color: #718c00; } + + /* a keyword */ + .kwd { + color: #8959a8; } + + /* a comment */ + .com { + color: #8e908c; } + + /* a type name */ + .typ { + color: #4271ae; } + + /* a literal value */ + .lit { + color: #f5871f; } + + /* punctuation */ + .pun { + color: #4d4d4c; } + + /* lisp open bracket */ + .opn { + color: #4d4d4c; } + + /* lisp close bracket */ + .clo { + color: #4d4d4c; } + + /* a markup tag name */ + .tag { + color: #c82829; } + + /* a markup attribute name */ + .atn { + color: #f5871f; } + + /* a markup attribute value */ + .atv { + color: #3e999f; } + + /* a declaration */ + .dec { + color: #f5871f; } + + /* a variable name */ + .var { + color: #c82829; } + + /* a function name */ + .fun { + color: #4271ae; } } +/* Use higher contrast and text-weight for printable form. */ +@media print, projection { + .str { + color: #060; } + + .kwd { + color: #006; + font-weight: bold; } + + .com { + color: #600; + font-style: italic; } + + .typ { + color: #404; + font-weight: bold; } + + .lit { + color: #044; } + + .pun, .opn, .clo { + color: #440; } + + .tag { + color: #006; + font-weight: bold; } + + .atn { + color: #404; } + + .atv { + color: #060; } } +/* Style */ +/* +pre.prettyprint { + background: white; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + font-size: 12px; + line-height: 1.5; + border: 1px solid #ccc; + padding: 10px; } +*/ + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; } + +/* IE indents via margin-left */ +li.L0, +li.L1, +li.L2, +li.L3, +li.L4, +li.L5, +li.L6, +li.L7, +li.L8, +li.L9 { + /* */ } + +/* Alternate shading for lines */ +li.L1, +li.L3, +li.L5, +li.L7, +li.L9 { + /* */ } diff --git a/4.0.4/upload_batch.js.html b/4.0.4/upload_batch.js.html new file mode 100644 index 00000000..e7b3c7b4 --- /dev/null +++ b/4.0.4/upload_batch.js.html @@ -0,0 +1,335 @@ + + + + + JSDoc: Source: upload/batch.js + + + + + + + + + + +
+ +

Source: upload/batch.js

+ + + + + + +
+
+
const extend = require('extend');
+const Queue = require('promise-queue');
+
+const Base = require('../base');
+const join = require('../deps/utils/join');
+const flatten = require('../deps/utils/flatten');
+const BatchBlob = require('./blob');
+
+const DEFAULT_OPTS = {
+  concurrency: 5,
+};
+
+/**
+ * The **BatchUpload** class allows to upload {@link Blob} objets to a Nuxeo Platform instance
+ * using the batch upload API.
+ *
+ * It creates and maintains a batch id from the Nuxeo Platform instance.
+ *
+ * **Cannot directly be instantiated**
+ *
+ * @example
+ * var Nuxeo = require('nuxeo')
+ * var nuxeo = new Nuxeo({
+ *  baseURL: 'http://localhost:8080/nuxeo',
+ *  auth: {
+ *    method: 'basic',
+ *    username: 'Administrator',
+ *    password: 'Administrator'
+ *  }
+ * });
+ * var batch = nuxeo.batchUpload();
+ * var nuxeoBlob = new Nuxeo.Blob(...);
+ * batch.upload(nuxeoBlob)
+ *   .then(function(res) {
+ *     // res.blob instanceof BatchBlob === true
+ *   })
+ *   .catch(function(error) {
+ *     throw new Error(error);
+ *   });
+ */
+class BatchUpload extends Base {
+  /**
+   * Creates a BatchUpload.
+   * @param {object} opts - The configuration options.
+   * @param {string} opts.nuxeo - The {@link Nuxeo} object linked to this BatchUpload object.
+   * @param {Number} [opts.concurrency=5] - Number of concurrent uploads.
+   */
+  constructor(opts = {}) {
+    const options = extend(true, {}, DEFAULT_OPTS, opts);
+    super(options);
+    this._url = join(options.url, 'upload/');
+    this._nuxeo = options.nuxeo;
+    this._uploadIndex = 0;
+    Queue.configure(this._nuxeo.Promise);
+    this._queue = new Queue(options.concurrency, Infinity);
+    this._batchIdPromise = null;
+    this._batchId = null;
+    this._promises = [];
+  }
+
+  /**
+   * Upload one or more blobs.
+   * @param {...Blob} blobs - Blobs to be uploaded.
+   * @returns {Promise} A Promise object resolved when all blobs are uploaded.
+   *
+   * @example
+   * ...
+   * nuxeoBatch.upload(blob1, blob2, blob3)
+   *   .then(function(res) {
+   *     // res.batch === nuxeoBatch
+   *     // res.blobs[0] is the BatchBlob object related to blob1
+   *     // res.blobs[1] is the BatchBlob object related to blob2
+   *     // res.blobs[2] is the BatchBlob object related to blob3
+   *   })
+   *   .catch(function(error) {
+   *     throw new Error(error);
+   *   });
+   */
+  upload(...blobs) {
+    const allBlobs = flatten(blobs);
+    const promises = allBlobs.map((blob) => {
+      const promise = this._queue.add(this._upload.bind(this, blob));
+      this._promises.push(promise);
+      return promise;
+    });
+    if (promises.length === 1) {
+      return promises[0];
+    }
+
+    const { Promise } = this._nuxeo;
+    return Promise.all(promises).then((batchBlobs) => {
+      return {
+        blobs: batchBlobs.map((batchBlob) => batchBlob.blob),
+        batch: this,
+      };
+    });
+  }
+
+  _upload(blob) {
+    if (!this._batchIdPromise) {
+      this._batchIdPromise = this._fetchBatchId();
+    }
+
+    const uploadIndex = this._uploadIndex;
+    this._uploadIndex += 1;
+    return this._batchIdPromise.then(() => {
+      const opts = {
+        json: false,
+        method: 'POST',
+        url: join(this._url, this._batchId, uploadIndex),
+        body: blob.content,
+        headers: {
+          'Cache-Control': 'no-cache',
+          'X-File-Name': encodeURIComponent(blob.name),
+          'X-File-Size': blob.size,
+          'X-File-Type': blob.mimeType,
+          'Content-Length': blob.size,
+        },
+      };
+      const options = this._computeOptions(opts);
+      return this._nuxeo.http(options);
+    }).then((res) => {
+      res.batchId = this._batchId;
+      res.index = uploadIndex;
+      return {
+        blob: new BatchBlob(res),
+        batch: this,
+      };
+    });
+  }
+
+  _fetchBatchId() {
+    const opts = {
+      method: 'POST',
+      url: this._url,
+    };
+
+    const { Promise } = this._nuxeo;
+    if (this._batchId) {
+      return Promise.resolve(this);
+    }
+    const options = this._computeOptions(opts);
+    return this._nuxeo.http(options).then((res) => {
+      this._batchId = res.batchId;
+      return this;
+    });
+  }
+
+  /**
+   * Wait for all the current uploads to be finished. Note that it won't wait for uploads added after done() being call.
+   * If an uploaded is added, you should call again done().
+   * The {@link BatchUpload#isFinished} method can be used to know if the batch is finished.
+   * @returns {Promise} A Promise object resolved when all the current uploads are finished.
+   *
+   * @example
+   * ...
+   * nuxeoBatch.upload(blob1, blob2, blob3);
+   * nuxeoBatch.done()
+   *   .then(function(res) {
+   *     // res.batch === nuxeoBatch
+   *     // res.blobs[0] is the BatchBlob object related to blob1
+   *     // res.blobs[1] is the BatchBlob object related to blob2
+   *     // res.blobs[2] is the BatchBlob object related to blob3
+   *   })
+   *   .catch(function(error) {
+   *     throw new Error(error);
+   *   });
+   */
+  done() {
+    const { Promise } = this._nuxeo;
+    return Promise.all(this._promises).then((batchBlobs) => {
+      return {
+        blobs: batchBlobs.map((batchBlob) => batchBlob.blob),
+        batch: this,
+      };
+    });
+  }
+
+  /**
+   * Returns whether the BatchUpload is finished, ie. has uploads running, or not.
+   * @returns {Boolean} true if the BatchUpload is finished, false otherwise.
+   */
+  isFinished() {
+    return this._queue.getQueueLength() === 0 && this._queue.getPendingLength() === 0;
+  }
+
+  /**
+   * Cancels a BatchUpload.
+   * @returns {Promise} A Promise object resolved with the BatchUpload itself.
+   */
+  cancel(opts) {
+    const { Promise } = this._nuxeo;
+    if (!this._batchIdPromise) {
+      return Promise.resolve(this);
+    }
+
+    const path = join('upload', this._batchId);
+    return this._batchIdPromise.then(() => {
+      const options = this._computeOptions(opts);
+      return this._nuxeo.request(path)
+        .delete(options);
+    }).then(() => {
+      this._batchIdPromise = null;
+      this._batchId = null;
+      return this;
+    });
+  }
+
+  /**
+   * Fetches a blob at a given index from the batch.
+   * @returns {Promise} A Promise object resolved with the BatchUpload itself and the BatchBlob.
+   */
+  fetchBlob(index, opts = {}) {
+    const { Promise } = this._nuxeo;
+    if (!this._batchId) {
+      return Promise.reject(new Error('No \'batchId\' set'));
+    }
+
+    let options = {
+      method: 'GET',
+      url: join(this._url, this._batchId, index),
+    };
+    options = extend(true, options, opts);
+    options = this._computeOptions(options);
+    return this._nuxeo.http(options).then((res) => {
+      res.batchId = this._batchId;
+      res.index = index;
+      return {
+        batch: this,
+        blob: new BatchBlob(res),
+      };
+    });
+  }
+
+  /**
+   * Removes a blob at a given index from the batch.
+   * @returns {Promise} A Promise object resolved with the result of the DELETE request.
+   */
+  removeBlob(index, opts = {}) {
+    const { Promise } = this._nuxeo;
+    if (!this._batchId) {
+      return Promise.reject(new Error('No \'batchId\' set'));
+    }
+
+    let options = {
+      method: 'DELETE',
+      url: join(this._url, this._batchId, index),
+    };
+    options = extend(true, options, opts);
+    options = this._computeOptions(options);
+    return this._nuxeo.http(options);
+  }
+
+  /**
+   * Fetches the blobs from the batch.
+   * @returns {Promise} A Promise object resolved with the BatchUpload itself and the BatchBlobs.
+   */
+  fetchBlobs(opts = {}) {
+    const { Promise } = this._nuxeo;
+    if (!this._batchId) {
+      return Promise.reject(new Error('No \'batchId\' set'));
+    }
+
+    let options = {
+      method: 'GET',
+      url: join(this._url, this._batchId),
+    };
+    options = extend(true, options, opts);
+    options = this._computeOptions(options);
+    return this._nuxeo.http(options).then((blobs) => {
+      const batchBlobs = blobs.map((blob, index) => {
+        blob.batchId = this._batchId;
+        blob.index = index;
+        return new BatchBlob(blob);
+      });
+      return {
+        batch: this,
+        blobs: batchBlobs,
+      };
+    });
+  }
+}
+
+module.exports = BatchUpload;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.0 on Mon Dec 02 2024 10:14:28 GMT+0000 (Coordinated Universal Time) +
+ + + + + diff --git a/4.0.4/upload_blob.js.html b/4.0.4/upload_blob.js.html new file mode 100644 index 00000000..69bd4396 --- /dev/null +++ b/4.0.4/upload_blob.js.html @@ -0,0 +1,68 @@ + + + + + JSDoc: Source: upload/blob.js + + + + + + + + + + +
+ +

Source: upload/blob.js

+ + + + + + +
+
+
const extend = require('extend');
+
+/**
+ * The `BatchBlob` class wraps a blob uploaded through a {@link BatchUpload} to be used
+ * in an {@link Operation} input or as a property value on a {@link Document}.
+ */
+class BatchBlob {
+  constructor(data = {}) {
+    this['upload-batch'] = data.batchId;
+    this['upload-fileId'] = `${data.index}`;
+    delete data.batchId;
+    delete data.index;
+    extend(this, data);
+  }
+}
+
+module.exports = BatchBlob;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.0 on Mon Dec 02 2024 10:14:28 GMT+0000 (Coordinated Universal Time) +
+ + + + + diff --git a/4.0.4/user_user.js.html b/4.0.4/user_user.js.html new file mode 100644 index 00000000..e4229eb2 --- /dev/null +++ b/4.0.4/user_user.js.html @@ -0,0 +1,114 @@ + + + + + JSDoc: Source: user/user.js + + + + + + + + + + +
+ +

Source: user/user.js

+ + + + + + +
+
+
const extend = require('extend');
+const Base = require('../base');
+
+/**
+ * The `User` class wraps an user.
+ *
+ * **Cannot directly be instantiated**
+ */
+class User extends Base {
+  /**
+   * Creates a User.
+   * @param {object} user - The initial user object. This User object will be extended with user properties.
+   * @param {object} opts - The configuration options.
+   * @param {string} opts.users - The {@link Users} object linked to this user.
+   */
+  constructor(user, opts) {
+    super(opts);
+    this._users = opts.users;
+    this.properties = {};
+    this._dirtyProperties = {};
+    extend(true, this, user);
+  }
+
+  /**
+   * Sets user properties.
+   * @param {object} properties - The properties to set.
+   * @returns {User}
+   *
+   * @example
+   * user.set({
+   *   firstName: 'new first name',
+   *   company: 'new company',
+   * });
+   */
+  set(properties) {
+    this._dirtyProperties = extend(true, {}, this._dirtyProperties, properties);
+    return this;
+  }
+
+  /**
+   * Gets a user property.
+   * @param {string} propertyName - The property name, such as 'fistName', 'email', ...
+   * @returns {User}
+   */
+  get(propertyName) {
+    return this._dirtyProperties[propertyName] || this.properties[propertyName];
+  }
+
+  /**
+   * Saves the user. It updates only the 'dirty properties' set through the {@link User#set} method.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the updated user.
+   */
+  save(opts = {}) {
+    const options = this._computeOptions(opts);
+    return this._users.update({
+      id: this.id,
+      properties: this._dirtyProperties,
+    }, options);
+  }
+}
+
+module.exports = User;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.0 on Mon Dec 02 2024 10:14:28 GMT+0000 (Coordinated Universal Time) +
+ + + + + diff --git a/4.0.4/user_users.js.html b/4.0.4/user_users.js.html new file mode 100644 index 00000000..20ab3ba3 --- /dev/null +++ b/4.0.4/user_users.js.html @@ -0,0 +1,157 @@ + + + + + JSDoc: Source: user/users.js + + + + + + + + + + +
+ +

Source: user/users.js

+ + + + + + +
+
+
const Base = require('../base');
+const join = require('../deps/utils/join');
+
+const USER_PATH = 'user';
+
+/**
+ * The `Users` class allows to work with users on a Nuxeo Platform instance.
+ *
+ * **Cannot directly be instantiated**
+ *
+ * @example
+ * var Nuxeo = require('nuxeo')
+ * var nuxeo = new Nuxeo({
+ *  baseURL: 'http://localhost:8080/nuxeo',
+ *  auth: {
+ *    method: 'basic',
+ *    username: 'Administrator',
+ *    password: 'Administrator',
+ *  }
+ * });
+ * nuxeo.users()
+ *   .fetch('Administrator')
+ *   .then(function(res) => {
+ *     // res.id === 'Administrator'
+ *     // res.properties.username === 'Administrator'
+ *   })
+ *   .catch(function(error) {
+ *     throw new Error(error);
+ *   });
+ */
+class Users extends Base {
+  /**
+   * Creates a Users object.
+   * @param {object} opts - The configuration options.
+   * @param {string} opts.nuxeo - The {@link Nuxeo} object linked to this Users object.
+   */
+  constructor(opts) {
+    super(opts);
+    this._nuxeo = opts.nuxeo;
+  }
+
+  /**
+   * Fetches an user given an username.
+   * @param {string} username - The username.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the {@link User}.
+   */
+  fetch(username, opts = {}) {
+    const options = this._computeOptions(opts);
+    const path = join(USER_PATH, username);
+    options.users = this;
+    return this._nuxeo.request(path)
+      .get(options);
+  }
+
+  /**
+   * Creates an user.
+   * @param {object} user - The user to be created.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the created {@link User}.
+   */
+  create(user, opts = {}) {
+    opts.body = {
+      'entity-type': 'user',
+      properties: user.properties,
+    };
+    const options = this._computeOptions(opts);
+    options.users = this;
+    return this._nuxeo.request(USER_PATH)
+      .post(options);
+  }
+
+  /**
+   * Updates an user. Assumes that the user object has an id field.
+   * @param {object} user - The user to be updated.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the updated {@link User}.
+   */
+  update(user, opts = {}) {
+    opts.body = {
+      'entity-type': 'user',
+      id: user.id,
+      properties: user.properties,
+    };
+    const options = this._computeOptions(opts);
+    const path = join(USER_PATH, user.id);
+    options.users = this;
+    return this._nuxeo.request(path)
+      .put(options);
+  }
+
+  /**
+   * Deletes an user given an username.
+   * @param {string} username - The username.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A Promise object resolved with the result of the DELETE request.
+   */
+  delete(username, opts = {}) {
+    const options = this._computeOptions(opts);
+    const path = join(USER_PATH, username);
+    return this._nuxeo.request(path)
+      .delete(options);
+  }
+}
+
+module.exports = Users;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.0 on Mon Dec 02 2024 10:14:28 GMT+0000 (Coordinated Universal Time) +
+ + + + + diff --git a/4.0.4/workflow_task.js.html b/4.0.4/workflow_task.js.html new file mode 100644 index 00000000..b0b71cc6 --- /dev/null +++ b/4.0.4/workflow_task.js.html @@ -0,0 +1,151 @@ + + + + + JSDoc: Source: workflow/task.js + + + + + + + + + + +
+ +

Source: workflow/task.js

+ + + + + + +
+
+
const extend = require('extend');
+const Base = require('../base');
+const join = require('../deps/utils/join');
+
+const TASK_PATH = 'task';
+
+/**
+ * The `Task` class wraps a task.
+ *
+ * **Cannot directly be instantiated**
+ */
+class Task extends Base {
+  /**
+   * Creates a `Task`.
+   * @param {object} task - The initial task object. This Task object will be extended with task properties.
+   * @param {object} opts - The configuration options.
+   * @param {string} opts.nuxeo - The {@link Nuxeo} object linked to this task.
+   * @param {string} [opts.documentId] - The attached document id of this workflow, if any.
+   */
+  constructor(task, opts) {
+    super(opts);
+    this._nuxeo = opts.nuxeo;
+    this._documentId = opts.documentId;
+    extend(true, this, task);
+  }
+
+  /**
+   * Sets a task variable.
+   * @param {string} name - The name of the variable.
+   * @param {string} value - The value of the variable.
+   * @returns {Task} The task itself.
+   */
+  variable(name, value) {
+    this.variables[name] = value;
+    return this;
+  }
+
+  /**
+   * Completes the task.
+   * @param {string} action - The action name to complete the task.
+   * @param {object} [taskOpts] - Configuration options for the task completion.
+   * @param {string} [taskOpts.variables] - Optional variables to override the existing ones.
+   * @param {string} [taskOpts.comment] - Optional comment.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the completed task.
+   */
+  complete(action, taskOpts = {}, opts = {}) {
+    const variables = taskOpts.variables || this.variables;
+    opts.body = {
+      variables,
+      'entity-type': 'task',
+      id: this.id,
+      comment: taskOpts.comment,
+    };
+    const options = this._computeOptions(opts);
+    const path = join(TASK_PATH, this.id, action);
+    return this._nuxeo.request(path)
+      .put(options);
+  }
+
+  /**
+   * Reassigns the task to the given actors.
+   * @param {string} actors - Actors to reassign the task.
+   * @param {object} [taskOpts] - Configuration options for the task reassignment.
+   * @param {string} [taskOpts.comment] - Optional comment.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with nothing.
+   */
+  reassign(actors, taskOpts = {}, opts = {}) {
+    const options = this._computeOptions(opts);
+    const path = join(TASK_PATH, this.id, 'reassign');
+    return this._nuxeo.request(path)
+      .queryParams({
+        actors,
+        comment: taskOpts.comment,
+      })
+      .put(options);
+  }
+
+  /**
+   * Delegates the task to the given actors.
+   * @param {string} actors - Actors to delegate the task.
+   * @param {object} [taskOpts] - Configuration options for the task delegation.
+   * @param {string} [taskOpts.comment] - Optional comment.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with nothing.
+   */
+  delegate(actors, taskOpts = {}, opts = {}) {
+    const options = this._computeOptions(opts);
+    const path = join(TASK_PATH, this.id, 'delegate');
+    return this._nuxeo.request(path)
+      .queryParams({
+        delegatedActors: actors,
+        comment: taskOpts.comment,
+      })
+      .put(options);
+  }
+}
+
+module.exports = Task;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.0 on Mon Dec 02 2024 10:14:28 GMT+0000 (Coordinated Universal Time) +
+ + + + + diff --git a/4.0.4/workflow_workflow.js.html b/4.0.4/workflow_workflow.js.html new file mode 100644 index 00000000..cf3c806a --- /dev/null +++ b/4.0.4/workflow_workflow.js.html @@ -0,0 +1,118 @@ + + + + + JSDoc: Source: workflow/workflow.js + + + + + + + + + + +
+ +

Source: workflow/workflow.js

+ + + + + + +
+
+
const extend = require('extend');
+const Base = require('../base');
+const join = require('../deps/utils/join');
+
+const WORKFLOW_PATH = 'workflow';
+
+/**
+ * The `Workflow` class wraps a workflow.
+ *
+ * **Cannot directly be instantiated**
+ */
+class Workflow extends Base {
+  /**
+   * Creates a `Workflow`.
+   * @param {object} workflow - The initial workflow object. This User object will be extended with workflow properties.
+   * @param {object} opts - The configuration options.
+   * @param {string} opts.nuxeo - The {@link Nuxeo} object linked to this workflow.
+   * @param {string} [opts.documentId] - The attached document id of this workflow, if any.
+   */
+  constructor(workflow, opts) {
+    super(opts);
+    this._nuxeo = opts.nuxeo;
+    this._documentId = opts.documentId;
+    extend(true, this, workflow);
+  }
+
+  /**
+   * Fetches the tasks of this workflow.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the tasks.
+   */
+  fetchTasks(opts = {}) {
+    const options = this._computeOptions(opts);
+    options.documentId = this.uid;
+    return this._buildTasksRequest()
+      .get(options);
+  }
+
+  /**
+   * Fetches this workflow graph.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the workflow graph.
+   */
+  fetchGraph(opts = {}) {
+    const options = this._computeOptions(opts);
+    const path = join(WORKFLOW_PATH, this.id, 'graph');
+    return this._nuxeo.request(path)
+      .get(options);
+  }
+
+  /**
+   * Builds the correct `Request` object depending of whether this workflow is attached to a document or not.
+   * @returns {Request} A request object.
+   */
+  _buildTasksRequest() {
+    if (this._documentId) {
+      const path = join('id', this._documentId, '@workflow', this.id, 'task');
+      return this._nuxeo.request(path);
+    }
+    return this._nuxeo.request('task')
+      .queryParams({
+        workflowInstanceId: this.id,
+      });
+  }
+}
+
+module.exports = Workflow;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.0 on Mon Dec 02 2024 10:14:28 GMT+0000 (Coordinated Universal Time) +
+ + + + + diff --git a/4.0.4/workflow_workflows.js.html b/4.0.4/workflow_workflows.js.html new file mode 100644 index 00000000..a0539347 --- /dev/null +++ b/4.0.4/workflow_workflows.js.html @@ -0,0 +1,175 @@ + + + + + JSDoc: Source: workflow/workflows.js + + + + + + + + + + +
+ +

Source: workflow/workflows.js

+ + + + + + +
+
+
const Base = require('../base');
+const join = require('../deps/utils/join');
+
+const WORKFLOW_PATH = 'workflow';
+const TASK_PATH = 'task';
+
+/**
+ * The `Workflows` class allows to work with workflows on a Nuxeo Platform instance.
+ *
+ * **Cannot directly be instantiated**
+ *
+ * @example
+ * var Nuxeo = require('nuxeo')
+ * var nuxeo = new Nuxeo({
+ *  baseURL: 'http://localhost:8080/nuxeo',
+ *  auth: {
+ *    method: 'basic',
+ *    username: 'Administrator',
+ *    password: 'Administrator',
+ *  }
+ * });
+ * nuxeo.workflows()
+ *   .start('SerialDocumentReview')
+ *   .then(function(res) {
+ *     // res['entity-type'] === 'workflow'
+ *     // res.workflowModelName === 'SerialDocumentReview'
+ *   })
+ *   .catch(function(error) {
+ *     throw new Error(error);
+ *   });
+ */
+class Workflows extends Base {
+  /**
+   * Creates a Workflows object.
+   * @param {object} opts - The configuration options.
+   * @param {string} opts.nuxeo - The {@link Nuxeo} object linked to this Workflows object.
+   */
+  constructor(opts = {}) {
+    super(opts);
+    this._nuxeo = opts.nuxeo;
+  }
+
+  /**
+   * Starts a workflow given a workflow model name.
+   * @param {string} workflowModelName - The workflow model name.
+   * @param {object} [workflowOpts] - Configuration options for the start of the workflow.
+   * @param {Array} [workflowOpts.attachedDocumentIds] - The attached documents id for the workflow.
+   * @param {object} [workflowOpts.variables] - The initial variables of the workflow.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the started `Workflow` object.
+   */
+  start(workflowModelName, workflowOpts = {}, opts = {}) {
+    opts.body = {
+      workflowModelName,
+      'entity-type': 'workflow',
+      attachedDocumentIds: workflowOpts.attachedDocumentIds,
+      variables: workflowOpts.variables,
+    };
+    const options = this._computeOptions(opts);
+    return this._nuxeo.request(WORKFLOW_PATH)
+      .post(options);
+  }
+
+  /**
+   * Fetches a workflow given a workflow instance id.
+   * @param {string} workflowInstanceId - The workflow instance id.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the `Workflow` object.
+   */
+  fetch(workflowInstanceId, opts = {}) {
+    const options = this._computeOptions(opts);
+    const path = join(WORKFLOW_PATH, workflowInstanceId);
+    return this._nuxeo.request(path)
+      .get(options);
+  }
+
+  /**
+  * Deletes a workflow instance given a workflow instance id.
+  * @param {string} workflowInstanceId - The workflow instance id.
+  * @param {object} [opts] - Options overriding the ones from this object.
+  * @returns {Promise} A Promise object resolved with the result of the DELETE request.
+  */
+  delete(workflowInstanceId, opts = {}) {
+    const options = this._computeOptions(opts);
+    const path = join(WORKFLOW_PATH, workflowInstanceId);
+    return this._nuxeo.request(path)
+      .delete(options);
+  }
+
+  /**
+   * Fetches the workflows started by the current user.
+   * @param {string} workflowModelName - The workflow model name.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the started workflows.
+   */
+  fetchStartedWorkflows(workflowModelName, opts = {}) {
+    const options = this._computeOptions(opts);
+    return this._nuxeo.request(WORKFLOW_PATH)
+      .queryParams({ workflowModelName })
+      .get(options);
+  }
+
+  /**
+   * Fetches the tasks for a given workflow id and/or workflow model name and/or actor id.
+   * @param {object} [tasksOpts] - Configuration options for the tasks fetch.
+   * @param {object} [tasksOpts.actorId] - The actor id.
+   * @param {object} [tasksOpts.workflowInstanceId] - The workflow id.
+   * @param {object} [tasksOpts.workflowModelName] - The workflow model name.
+   * @param {object} [opts] - Options overriding the ones from this object.
+   * @returns {Promise} A promise object resolved with the tasks.
+   */
+  fetchTasks(tasksOpts = {}, opts = {}) {
+    const options = this._computeOptions(opts);
+    return this._nuxeo.request(TASK_PATH)
+      .queryParams({
+        userId: tasksOpts.actorId,
+        workflowInstanceId: tasksOpts.workflowInstanceId,
+        workflowModelName: tasksOpts.workflowModelName,
+      })
+      .get(options);
+  }
+}
+
+module.exports = Workflows;
+
+
+
+ + + + +
+ + + +
+ +
+ Documentation generated by JSDoc 4.0.0 on Mon Dec 02 2024 10:14:28 GMT+0000 (Coordinated Universal Time) +
+ + + + + diff --git a/latest/Base.html b/latest/Base.html index 79b5e072..753babe1 100644 --- a/latest/Base.html +++ b/latest/Base.html @@ -2471,7 +2471,7 @@

Home

Classes

  • diff --git a/latest/BatchBlob.html b/latest/BatchBlob.html index b304f927..ebe432d7 100644 --- a/latest/BatchBlob.html +++ b/latest/BatchBlob.html @@ -162,7 +162,7 @@

    Home

    Classes

    • diff --git a/latest/BatchUpload.html b/latest/BatchUpload.html index 00709a92..2642379e 100644 --- a/latest/BatchUpload.html +++ b/latest/BatchUpload.html @@ -1211,7 +1211,7 @@

      Home

      Classes

      • diff --git a/latest/Blob.html b/latest/Blob.html index 28282a85..b69ccc8e 100644 --- a/latest/Blob.html +++ b/latest/Blob.html @@ -176,7 +176,7 @@

        Home

        Classes

        • diff --git a/latest/Directory.html b/latest/Directory.html index 52c88615..ce8398a7 100644 --- a/latest/Directory.html +++ b/latest/Directory.html @@ -1341,7 +1341,7 @@

          Home

          Classes

          • diff --git a/latest/DirectoryEntry.html b/latest/DirectoryEntry.html index 424850dd..37e44f6c 100644 --- a/latest/DirectoryEntry.html +++ b/latest/DirectoryEntry.html @@ -781,7 +781,7 @@

            Home

            Classes

            • diff --git a/latest/Document.html b/latest/Document.html index d6aed687..38e7d3b2 100644 --- a/latest/Document.html +++ b/latest/Document.html @@ -5734,7 +5734,7 @@

              Home

              Classes

              • diff --git a/latest/Group.html b/latest/Group.html index 808c90f1..f0307747 100644 --- a/latest/Group.html +++ b/latest/Group.html @@ -462,7 +462,7 @@

                Home

                Classes

                • diff --git a/latest/Groups.html b/latest/Groups.html index 8ee59315..940bcaa5 100644 --- a/latest/Groups.html +++ b/latest/Groups.html @@ -1098,7 +1098,7 @@

                  Home

                  Classes

                  • diff --git a/latest/Nuxeo.html b/latest/Nuxeo.html index e4a22fc1..9189330b 100644 --- a/latest/Nuxeo.html +++ b/latest/Nuxeo.html @@ -5115,7 +5115,7 @@

                    Home

                    Classes

                    • diff --git a/latest/Operation.html b/latest/Operation.html index 6c9fa7dd..e584943b 100644 --- a/latest/Operation.html +++ b/latest/Operation.html @@ -1182,7 +1182,7 @@

                      Home

                      Classes

                      • diff --git a/latest/Repository.html b/latest/Repository.html index 3e471a36..2b991535 100644 --- a/latest/Repository.html +++ b/latest/Repository.html @@ -1660,7 +1660,7 @@

                        Home

                        Classes

                        • diff --git a/latest/Request.html b/latest/Request.html index ef6b69e3..310b67af 100644 --- a/latest/Request.html +++ b/latest/Request.html @@ -1557,7 +1557,7 @@

                          Home

                          Classes

                          • diff --git a/latest/ServerVersion.html b/latest/ServerVersion.html index 6b449e8a..a4a159ec 100644 --- a/latest/ServerVersion.html +++ b/latest/ServerVersion.html @@ -872,7 +872,7 @@

                            Home

                            Classes

                            • diff --git a/latest/Task.html b/latest/Task.html index 94a424e7..0aefb396 100644 --- a/latest/Task.html +++ b/latest/Task.html @@ -1437,7 +1437,7 @@

                              Home

                              Classes

                              • diff --git a/latest/User.html b/latest/User.html index c083cbc1..2c438ae6 100644 --- a/latest/User.html +++ b/latest/User.html @@ -780,7 +780,7 @@

                                Home

                                Classes

                                • diff --git a/latest/Users.html b/latest/Users.html index eccba72c..2a9e7c42 100644 --- a/latest/Users.html +++ b/latest/Users.html @@ -1098,7 +1098,7 @@

                                  Home

                                  Classes

                                  • diff --git a/latest/Workflow.html b/latest/Workflow.html index 06e9af2a..dc1cff27 100644 --- a/latest/Workflow.html +++ b/latest/Workflow.html @@ -786,7 +786,7 @@

                                    Home

                                    Classes

                                    • diff --git a/latest/Workflows.html b/latest/Workflows.html index f4af2110..62db277a 100644 --- a/latest/Workflows.html +++ b/latest/Workflows.html @@ -1556,7 +1556,7 @@

                                      Home

                                      Classes

                                      • diff --git a/latest/auth_oauth2.js.html b/latest/auth_oauth2.js.html index c2e2a02c..defdb562 100644 --- a/latest/auth_oauth2.js.html +++ b/latest/auth_oauth2.js.html @@ -243,7 +243,7 @@

                                        Home

                                        Classes

                                        • diff --git a/latest/base.js.html b/latest/base.js.html index 43617722..071eff0a 100644 --- a/latest/base.js.html +++ b/latest/base.js.html @@ -327,7 +327,7 @@

                                          Home

                                          Classes

                                          • diff --git a/latest/blob.js.html b/latest/blob.js.html index 7e98c4d8..8853d340 100644 --- a/latest/blob.js.html +++ b/latest/blob.js.html @@ -75,7 +75,7 @@

                                            Home

                                            Classes

                                            • diff --git a/latest/directory_directory.js.html b/latest/directory_directory.js.html index 387bdb91..9cfbcd29 100644 --- a/latest/directory_directory.js.html +++ b/latest/directory_directory.js.html @@ -169,7 +169,7 @@

                                              Home

                                              Classes

                                              • diff --git a/latest/directory_entry.js.html b/latest/directory_entry.js.html index edd715fe..6782f04f 100644 --- a/latest/directory_entry.js.html +++ b/latest/directory_entry.js.html @@ -116,7 +116,7 @@

                                                Home

                                                Classes

                                                • diff --git a/latest/document.js.html b/latest/document.js.html index 676fa63d..26f9d4a6 100644 --- a/latest/document.js.html +++ b/latest/document.js.html @@ -493,7 +493,7 @@

                                                  Home

                                                  Classes

                                                  • diff --git a/latest/group_group.js.html b/latest/group_group.js.html index 88a99519..f83c7c10 100644 --- a/latest/group_group.js.html +++ b/latest/group_group.js.html @@ -81,7 +81,7 @@

                                                    Home

                                                    Classes

                                                    • diff --git a/latest/group_groups.js.html b/latest/group_groups.js.html index 076b5e07..83986ffd 100644 --- a/latest/group_groups.js.html +++ b/latest/group_groups.js.html @@ -156,7 +156,7 @@

                                                      Home

                                                      Classes

                                                      • diff --git a/latest/index.html b/latest/index.html index d6fedaef..652cff43 100644 --- a/latest/index.html +++ b/latest/index.html @@ -123,7 +123,7 @@

                                                        React Applications

                                                        var Nuxeo = require('nuxeo');
                                                         

                                                        Documentation

                                                        -

                                                        Check out the API documentation.

                                                        +

                                                        Check out the API documentation.

                                                        Examples

                                                        Some working examples using the Nuxeo JavaScript Client can be found here.

                                                        Deprecated APIs

                                                        @@ -424,12 +424,12 @@

                                                        Nuxeo Server version

                                                        } ... -

                                                        See the ServerVersion documentation.

                                                        +

                                                        See the ServerVersion documentation.

                                                        Note that the nuxeoVersion property is deprecated but it is still filled with the Nuxeo Server version.

                                                        Operation

                                                        Operation object allows you to execute an operation
                                                        (or operation chain).

                                                        -

                                                        See the Operation documentation.

                                                        +

                                                        See the Operation documentation.

                                                        Samples

                                                        Call an operation to create a new folder in the Root document

                                                        nuxeo.operation('Document.Create')
                                                        @@ -449,7 +449,7 @@ 

                                                        Samples

                                                        Request

                                                        The Request object allows you to call the Nuxeo REST API.

                                                        -

                                                        See the Request documentation.

                                                        +

                                                        See the Request documentation.

                                                        Samples

                                                        Fetch the Administrator user

                                                        nuxeo.request('user/Administrator')
                                                        @@ -473,7 +473,7 @@ 

                                                        Samples

                                                        Repository

                                                        The Repository object allows you to work with document.

                                                        -

                                                        See the Repository documentation.

                                                        +

                                                        See the Repository documentation.

                                                        Samples

                                                        Create a Repository object

                                                        var defaultRepository = nuxeo.repository(); // 'default' repository
                                                        @@ -518,7 +518,7 @@ 

                                                        Samples

                                                        Document

                                                        Repository object returns and works with Document objects. Document objects exposes a simpler API
                                                        to work with a document.

                                                        -

                                                        See the Document documentation.

                                                        +

                                                        See the Document documentation.

                                                        Samples

                                                        Retrieve a Document object

                                                        nuxeo.repository()
                                                        @@ -596,7 +596,7 @@ 

                                                        Samples

                                                        BatchUpload

                                                        The BatchUpload object allows you to upload blobs to a Nuxeo Platform instance, and use them as operation input or
                                                        as document property value.

                                                        -

                                                        See the BatchUpload documentation.

                                                        +

                                                        See the BatchUpload documentation.

                                                        Samples

                                                        Create a Nuxeo.Blob to be uploaded

                                                        // on the browser, assuming you have a File object 'file'
                                                        @@ -638,8 +638,8 @@ 

                                                        Samples

                                                        Users

                                                        The Users object allows you to work with users.

                                                        -

                                                        See the Users and
                                                        -User documentation.

                                                        +

                                                        See the Users and
                                                        +User documentation.

                                                        Samples

                                                        Fetch an user

                                                        nuxeo.users()
                                                        @@ -671,8 +671,8 @@ 

                                                        Samples

                                                        Groups

                                                        The Groups object allows you to work with groups.

                                                        -

                                                        See the Groups and
                                                        -Group documentation.

                                                        +

                                                        See the Groups and
                                                        +Group documentation.

                                                        Samples

                                                        Fetch a group

                                                        nuxeo.groups().fetch('administrators')
                                                        @@ -699,8 +699,8 @@ 

                                                        Samples

                                                        Directory

                                                        The Directory object allows you to work with directories.

                                                        -

                                                        See the Directory and
                                                        -DirectoryEntry documentation.

                                                        +

                                                        See the Directory and
                                                        +DirectoryEntry documentation.

                                                        Samples

                                                        Fetch all entries of a directory

                                                        nuxeo.directory('nature')
                                                        @@ -789,7 +789,7 @@ 

                                                        Home

                                                        Classes

                                                        • diff --git a/latest/nuxeo-versions.js.html b/latest/nuxeo-versions.js.html index 6e834622..90ce4e8a 100644 --- a/latest/nuxeo-versions.js.html +++ b/latest/nuxeo-versions.js.html @@ -50,7 +50,7 @@

                                                          Home

                                                          Classes

                                                          • diff --git a/latest/nuxeo.js.html b/latest/nuxeo.js.html index 9be7ae1d..3c9a836d 100644 --- a/latest/nuxeo.js.html +++ b/latest/nuxeo.js.html @@ -499,7 +499,7 @@

                                                            Home

                                                            Classes

                                                            • diff --git a/latest/operation.js.html b/latest/operation.js.html index 0c822eb7..d3443cb0 100644 --- a/latest/operation.js.html +++ b/latest/operation.js.html @@ -257,7 +257,7 @@

                                                              Home

                                                              Classes

                                                              • diff --git a/latest/repository.js.html b/latest/repository.js.html index 2ba5e662..95e0ae06 100644 --- a/latest/repository.js.html +++ b/latest/repository.js.html @@ -170,7 +170,7 @@

                                                                Source: repository.js

                                                                } _computeQueryPath(queryOpts) { - return join('search', queryOpts.query ? 'lang/NXQL' : `pp/${queryOpts.pageProvider}`, 'execute'); + return join('search', queryOpts.pageProvider ? `pp/${queryOpts.pageProvider}` : '', 'execute'); } } @@ -191,7 +191,7 @@

                                                                Home

                                                                Classes

                                                                • diff --git a/latest/request.js.html b/latest/request.js.html index 7ed1b063..45e77629 100644 --- a/latest/request.js.html +++ b/latest/request.js.html @@ -175,7 +175,7 @@

                                                                  Home

                                                                  Classes

                                                                  • diff --git a/latest/server-version.js.html b/latest/server-version.js.html index 96822294..d87f6482 100644 --- a/latest/server-version.js.html +++ b/latest/server-version.js.html @@ -136,7 +136,7 @@

                                                                    Home

                                                                    Classes

                                                                    • diff --git a/latest/upload_batch.js.html b/latest/upload_batch.js.html index cd15d8f0..e7b3c7b4 100644 --- a/latest/upload_batch.js.html +++ b/latest/upload_batch.js.html @@ -326,7 +326,7 @@

                                                                      Home

                                                                      Classes

                                                                      • diff --git a/latest/upload_blob.js.html b/latest/upload_blob.js.html index c4973638..69bd4396 100644 --- a/latest/upload_blob.js.html +++ b/latest/upload_blob.js.html @@ -59,7 +59,7 @@

                                                                        Home

                                                                        Classes

                                                                        • diff --git a/latest/user_user.js.html b/latest/user_user.js.html index 3e869659..e4229eb2 100644 --- a/latest/user_user.js.html +++ b/latest/user_user.js.html @@ -105,7 +105,7 @@

                                                                          Home

                                                                          Classes

                                                                          • diff --git a/latest/user_users.js.html b/latest/user_users.js.html index e89f2f01..20ab3ba3 100644 --- a/latest/user_users.js.html +++ b/latest/user_users.js.html @@ -148,7 +148,7 @@

                                                                            Home

                                                                            Classes

                                                                            • diff --git a/latest/workflow_task.js.html b/latest/workflow_task.js.html index 0938b5e9..b0b71cc6 100644 --- a/latest/workflow_task.js.html +++ b/latest/workflow_task.js.html @@ -142,7 +142,7 @@

                                                                              Home

                                                                              Classes

                                                                              • diff --git a/latest/workflow_workflow.js.html b/latest/workflow_workflow.js.html index a43f3e66..cf3c806a 100644 --- a/latest/workflow_workflow.js.html +++ b/latest/workflow_workflow.js.html @@ -109,7 +109,7 @@

                                                                                Home

                                                                                Classes

                                                                                • diff --git a/latest/workflow_workflows.js.html b/latest/workflow_workflows.js.html index 84f7f73b..a0539347 100644 --- a/latest/workflow_workflows.js.html +++ b/latest/workflow_workflows.js.html @@ -166,7 +166,7 @@

                                                                                  Home

                                                                                  Classes