new ChinoAPIDocuments(baseUrl, customerId, customerKey)
Create a caller for Documents Chino APIs
Parameters:
Name | Type | Default | Description |
---|---|---|---|
baseUrl |
string | The url endpoint for APIs |
|
customerId |
string | The Chino customer id or bearer token |
|
customerKey |
string | null | null | The Chino customer key or null (not provided) |
- Source:
Methods
create(schemaId, data) → {Promise.<objects.Document, objects.ChinoException>}
Create a new document inside schema selected by its id with data as document information
Parameters:
Name | Type | Description |
---|---|---|
schemaId |
string | |
data |
object |
- Source:
Returns:
A promise that return a Document object if resolved, otherwise throw an ChinoException object if rejected or was not retrieved a success status
- Type
- Promise.<objects.Document, objects.ChinoException>
delete(documentId, force) → {Promise.<objects.Success, objects.ChinoException>}
Deactivate (or delete) document selected by its id
Parameters:
Name | Type | Default | Description |
---|---|---|---|
documentId |
string | ||
force |
boolean | false | If true delete document information otherwise only deactivate it. Default value is false (deactivate) |
- Source:
Returns:
A promise that return a Success object if resolved, otherwise throw an ChinoException object if rejected or was not retrieved a success status
- Type
- Promise.<objects.Success, objects.ChinoException>
details(documentId) → {Promise.<objects.Document, objects.ChinoException>}
Return information about document selected by its id
Parameters:
Name | Type | Description |
---|---|---|
documentId |
string |
- Source:
Returns:
A promise that return a Document object if resolved, otherwise throw an ChinoException object if rejected or was not retrieved a success status
- Type
- Promise.<objects.Document, objects.ChinoException>
list(schemaId, offset, limit, fullDocument) → {Promise.<Array, objects.ChinoException>}
Return a list of current documents inside the schema selected by its id
Parameters:
Name | Type | Default | Description |
---|---|---|---|
schemaId |
string | ||
offset |
int | 0 | |
limit |
int | 10 | |
fullDocument |
boolean | false | It specify if the documents inside the list should show their content (true) or not (false). By default it show only documents information (false) |
- Source:
Returns:
A promise that return a list of Document object if resolved, otherwise throw an ChinoException object if rejected or was not retrieved a success status
- Type
- Promise.<Array, objects.ChinoException>
update(documentId, data) → {Promise.<objects.Document, objects.ChinoException>}
Update information about document selected by its id with data as new document information
Parameters:
Name | Type | Description |
---|---|---|
documentId |
string | |
data |
object |
- Source:
Returns:
A promise that return a Document object if resolved, otherwise throw an ChinoException object if rejected or was not retrieved a success status
- Type
- Promise.<objects.Document, objects.ChinoException>