@ubstream/ubstream-node-client-sdk / Exports / MediasDocumentsArticlesClient
Class: MediasDocumentsArticlesClient
This class provides access to methods concerning articles of media documents.
Hierarchy
AbstractClient
↳ MediasDocumentsArticlesClient
Table of contents
Methods
Methods
addDocumentArticle
▸ addDocumentArticle(mediaId
, documentId
, formData
): Promise
<IPublicArticleUploadMediaData
>
Parameters
Name | Type | Description |
---|---|---|
mediaId | string | The uuid of the targeted media. |
documentId | string | The uuid of the targeted document. |
formData | IFormData | The form data containing a zip file contains article data definitions (html, xml and images). |
Returns
Promise
<IPublicArticleUploadMediaData
>
Promise object representing the requestId.
Summary
Add articles for the specified document.
Example
const file = typeof input === 'string' ? fs.createReadStream(input) : input;
const formData = new FormData(); // https://www.npmjs.com/package/form-data
formData.append('file', file);
await client.medias.documents.articles.addDocumentArticle("media_id", "document_id", formData);
deleteAllDocumentArticles
▸ deleteAllDocumentArticles(mediaId
, documentId
): Promise
<void
>
Parameters
Name | Type | Description |
---|---|---|
mediaId | string | The uuid of the targeted media. |
documentId | string | The uuid of the targeted document. |
Returns
Promise
<void
>
Summary
Delete all articles in a document.
Example
await client.medias.documents.articles.deleteAllDocumentArticles("media_id", "document_id");
deleteDocumentArticle
▸ deleteDocumentArticle(mediaId
, documentId
, articleId
): Promise
<void
>
Parameters
Name | Type | Description |
---|---|---|
mediaId | string | The uuid of the targeted media. |
documentId | string | The uuid of the targeted document. |
articleId | string | The uuid of the targeted article. |
Returns
Promise
<void
>
Summary
Delete specific article in document.
Example
await client.medias.documents.articles.deleteDocumentArticle("media_id", "document_id", "article_id");
overwriteDocumentArticle
▸ overwriteDocumentArticle(mediaId
, documentId
, formData
): Promise
<IPublicArticleUploadMediaData
>
Parameters
Name | Type | Description |
---|---|---|
mediaId | string | The uuid of the targeted media. |
documentId | string | The uuid of the targeted document. |
formData | IFormData | The form data containing a zip file contains article data definitions (html, xml and images). |
Returns
Promise
<IPublicArticleUploadMediaData
>
Promise object representing the requestId.
Summary
Delete all article and add new articles in document.
Example
const file = typeof input === 'string' ? fs.createReadStream(input) : input;
const formData = new FormData(); // https://www.npmjs.com/package/form-data
formData.append('file', file);
await client.medias.documents.articles.overwriteDocumentArticle("media_id", "document_id", formData);