Interface: ContentStoreAPI

ContentStoreAPI

API class that is used to communicate with the content store.

Example

appFactory.getFeature('ContentStore')

Methods

delete(id) → {Promise}

Deletes content a content.

Parameters:
Name Type Description
id id

ID of the content

Returns:

Promise resolved on success; rejected with status code on error.

Type
Promise

get(id) → {Promise.<Array.<Object>>}

Returns the content from a specified location.

Parameters:
Name Type Description
id id

ID of the location, defaults to 'My content'.

Returns:

Promise resolved with an array of store content {id, type, defaultName, modificationTime, owner}; rejected with status code on error.

Type
Promise.<Array.<Object>>

post(id, content) → {Promise}

Posts content to a location.

Parameters:
Name Type Description
id id

ID of the location

content Object

Content to post

Returns:

Promise resolved on success; rejected with status code on error.

Type
Promise
Example
contentStore.post('i641E742AA0784BEF87829388BB7FCE2E', { type: 'folder', defaultName: 'myFolder' })

put(id, content) → {Promise}

Puts content at a location.

Parameters:
Name Type Description
id id

ID of the location

content Object

Content to put

Returns:

Promise resolved on success, rejected with status code on error.

Type
Promise
Examples
contentStore.put('i641E742AA0784BEF87829388BB7FCE2E', {parent: [{id: "i4BFD414719954E348FA4582E750450FE"}]}) // moves the asset
contentStore.put('i641E742AA0784BEF87829388BB7FCE2E', {type: 'exploration', defaultName: 'myNewName'}) // renames the asset