Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Commit 4152c12

Browse files
[ACS-4331] Add deleteTag method to tags API (#1490)
* ACS-4331 - created new method for deleting a tag * ACS-4331 - added some documentation for deleteTag * ACS-4331 - added docs * ACS-4331 - README formating fix * [ACS-4331] changed Promise type to void * [ACS-4331] corrected link
1 parent 1d0d500 commit 4152c12

File tree

3 files changed

+74
-1
lines changed

3 files changed

+74
-1
lines changed

src/api/content-rest-api/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ TagsApi | [**getTag**](docs/TagsApi.md#getTag) | **GET** /tags/{tagId} | Get a t
136136
TagsApi | [**listTags**](docs/TagsApi.md#listTags) | **GET** /tags | List tags
137137
TagsApi | [**listTagsForNode**](docs/TagsApi.md#listTagsForNode) | **GET** /nodes/{nodeId}/tags | List tags for a node
138138
TagsApi | [**updateTag**](docs/TagsApi.md#updateTag) | **PUT** /tags/{tagId} | Update a tag
139+
TagsApi | [**deleteTag**](docs/TagsApi.md#deleteTag) | **DELETE** /tags/{tagId} | Delete a tag
139140
TagsApi | [**createTags**](docs/TagsApi.md#createTags) | **POST** /tags/ | Create specified by **tags** list of tags.
140141
TrashcanApi | [**deleteDeletedNode**](docs/TrashcanApi.md#deleteDeletedNode) | **DELETE** /deleted-nodes/{nodeId} | Permanently delete a deleted node
141142
TrashcanApi | [**getArchivedNodeRendition**](docs/TrashcanApi.md#getArchivedNodeRendition) | **GET** /deleted-nodes/{nodeId}/renditions/{renditionId} | Get rendition information for a deleted node
@@ -333,4 +334,4 @@ VersionsApi | [**revertVersion**](docs/VersionsApi.md#revertVersion) | **POST**
333334
- [VersionPagingList](docs/VersionPagingList.md)
334335
- [DeletedNode](docs/DeletedNode.md)
335336
- [NodeAssociation](docs/NodeAssociation.md)
336-
- [NodeChildAssociation](docs/NodeChildAssociation.md)
337+
- [NodeChildAssociation](docs/NodeChildAssociation.md)

src/api/content-rest-api/api/tags.api.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,41 @@ parameter are returned in addition to those specified in the **fields** paramete
386386
pathParams, queryParams, headerParams, formParams, postBody,
387387
contentTypes, accepts , TagEntry);
388388
}
389+
/**
390+
* Delete a tag
391+
*
392+
* Deletes a tag by **tagId**. This will cause the tag to be removed from all nodes.
393+
*
394+
* @param tagId The identifier of a tag.
395+
* @return Promise<{}>
396+
*/
397+
deleteTag(tagId: string): Promise<void> {
398+
399+
throwIfNotDefined(tagId, 'tagId');
400+
401+
const postBody: null = null;
402+
403+
const pathParams = {
404+
'tagId': tagId
405+
};
406+
407+
const queryParams = {
408+
};
409+
410+
const headerParams = {
411+
412+
};
413+
const formParams = {
414+
};
415+
416+
const contentTypes = ['application/json'];
417+
const accepts = ['application/json'];
418+
419+
return this.apiClient.callApi(
420+
'/tags/{tagId}', 'DELETE',
421+
pathParams, queryParams, headerParams, formParams, postBody,
422+
contentTypes, accepts);
423+
}
389424

390425
/**
391426
* Create tags

src/api/content-rest-api/docs/TagsApi.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Method | HTTP request | Description
1010
[**listTags**](TagsApi.md#listTags) | **GET** /tags | List tags
1111
[**listTagsForNode**](TagsApi.md#listTagsForNode) | **GET** /nodes/{nodeId}/tags | List tags for a node
1212
[**updateTag**](TagsApi.md#updateTag) | **PUT** /tags/{tagId} | Update a tag
13+
[**deleteTag**](TagsApi.md#deleteTag) | **DELETE** /tags/{tagId} | Completely deletes a tag
1314
[**createTags**](TagsApi.md#createTags) | **POST** /tags | Create list of tags
1415

1516

@@ -484,3 +485,39 @@ Name | Type | Description | Notes
484485

485486
[**TagEntry[]**](TagEntry.md)
486487

488+
<a name="deleteTag"></a>
489+
## deleteTag
490+
> deleteTag(tagId)
491+
492+
Deletes the tag with **tagId**. This will cause the tag to be removed from all nodes.
493+
494+
You must have admin rights to delete a tag.
495+
496+
### Example
497+
498+
```javascript
499+
import { AlfrescoApi, TagsApi} from '@alfresco/js-api';
500+
501+
const alfrescoApi = new AlfrescoApi({
502+
hostEcm: 'http://127.0.0.1:8080'
503+
});
504+
505+
const tagsApi = new TagsApi(alfrescoApi);
506+
507+
508+
tagsApi.deleteTag(tagId).then(() => {
509+
console.log('API called successfully.');
510+
}, function(error) {
511+
console.error(error);
512+
});
513+
```
514+
515+
### Parameters
516+
517+
Name | Type | Description | Notes
518+
------------- | ------------- | ------------- | -------------
519+
**tagId** | **string**| The identifier of a tag. |
520+
521+
### Return type
522+
523+
null (empty response body)

0 commit comments

Comments
 (0)