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

Commit 296f3e7

Browse files
committed
PATCH: delete all document version on delete (#525)
* delete all document version on delete * versioning: add delete history route
1 parent 025b32e commit 296f3e7

4 files changed

Lines changed: 139 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ Class | Method | HTTP request | Description
244244
*bimdata.CollaborationApi* | [**createValidation**](docs/CollaborationApi.md#createValidation) | **POST** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/visa/{visa_pk}/validation | Add a validation to a visa
245245
*bimdata.CollaborationApi* | [**createVisa**](docs/CollaborationApi.md#createVisa) | **POST** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/visa | Create a visa
246246
*bimdata.CollaborationApi* | [**createVisaComment**](docs/CollaborationApi.md#createVisaComment) | **POST** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/visa/{visa_pk}/comment | Add a comment
247+
*bimdata.CollaborationApi* | [**deleteAllHistory**](docs/CollaborationApi.md#deleteAllHistory) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/history/delete | Delete all document history
247248
*bimdata.CollaborationApi* | [**deleteClassification**](docs/CollaborationApi.md#deleteClassification) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/classification/{id} | Delete a classification
248249
*bimdata.CollaborationApi* | [**deleteCloud**](docs/CollaborationApi.md#deleteCloud) | **DELETE** /cloud/{id} | Delete a cloud
249250
*bimdata.CollaborationApi* | [**deleteCloudUser**](docs/CollaborationApi.md#deleteCloudUser) | **DELETE** /cloud/{cloud_pk}/user/{id} | Remove a user from a cloud

docs/CollaborationApi.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Method | HTTP request | Description
2424
[**createValidation**](CollaborationApi.md#createValidation) | **POST** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/visa/{visa_pk}/validation | Add a validation to a visa
2525
[**createVisa**](CollaborationApi.md#createVisa) | **POST** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/visa | Create a visa
2626
[**createVisaComment**](CollaborationApi.md#createVisaComment) | **POST** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/visa/{visa_pk}/comment | Add a comment
27+
[**deleteAllHistory**](CollaborationApi.md#deleteAllHistory) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/history/delete | Delete all document history
2728
[**deleteClassification**](CollaborationApi.md#deleteClassification) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/classification/{id} | Delete a classification
2829
[**deleteCloud**](CollaborationApi.md#deleteCloud) | **DELETE** /cloud/{id} | Delete a cloud
2930
[**deleteCloudUser**](CollaborationApi.md#deleteCloudUser) | **DELETE** /cloud/{cloud_pk}/user/{id} | Remove a user from a cloud
@@ -1433,6 +1434,71 @@ Name | Type | Description | Notes
14331434
- **Accept**: application/json
14341435

14351436

1437+
## deleteAllHistory
1438+
1439+
> deleteAllHistory(cloudPk, documentPk, projectPk)
1440+
1441+
Delete all document history
1442+
1443+
Delete all document history Required scopes: document:write
1444+
1445+
### Example
1446+
1447+
```javascript
1448+
import bimdata from '@bimdata/bimdata-api-client';
1449+
let defaultClient = bimdata.ApiClient.instance;
1450+
// Configure API key authorization: ApiKey
1451+
let ApiKey = defaultClient.authentications['ApiKey'];
1452+
ApiKey.apiKey = 'YOUR API KEY';
1453+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
1454+
//ApiKey.apiKeyPrefix = 'Token';
1455+
// Configure OAuth2 access token for authorization: BIMData_Connect
1456+
let BIMData_Connect = defaultClient.authentications['BIMData_Connect'];
1457+
BIMData_Connect.accessToken = 'YOUR ACCESS TOKEN';
1458+
// Configure OAuth2 access token for authorization: BIMData_Connect
1459+
let BIMData_Connect = defaultClient.authentications['BIMData_Connect'];
1460+
BIMData_Connect.accessToken = 'YOUR ACCESS TOKEN';
1461+
// Configure API key authorization: Bearer
1462+
let Bearer = defaultClient.authentications['Bearer'];
1463+
Bearer.apiKey = 'YOUR API KEY';
1464+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
1465+
//Bearer.apiKeyPrefix = 'Token';
1466+
1467+
let apiInstance = new bimdata.CollaborationApi();
1468+
let cloudPk = 56; // Number | A unique integer value identifying this cloud.
1469+
let documentPk = 56; // Number | A unique integer value identifying this document.
1470+
let projectPk = 56; // Number | A unique integer value identifying this project.
1471+
apiInstance.deleteAllHistory(cloudPk, documentPk, projectPk).then(() => {
1472+
console.log('API called successfully.');
1473+
}, (error) => {
1474+
console.error(error);
1475+
});
1476+
1477+
```
1478+
1479+
### Parameters
1480+
1481+
1482+
Name | Type | Description | Notes
1483+
------------- | ------------- | ------------- | -------------
1484+
**cloudPk** | **Number**| A unique integer value identifying this cloud. |
1485+
**documentPk** | **Number**| A unique integer value identifying this document. |
1486+
**projectPk** | **Number**| A unique integer value identifying this project. |
1487+
1488+
### Return type
1489+
1490+
null (empty response body)
1491+
1492+
### Authorization
1493+
1494+
[ApiKey](../README.md#ApiKey), [BIMData_Connect](../README.md#BIMData_Connect), [BIMData_Connect](../README.md#BIMData_Connect), [Bearer](../README.md#Bearer)
1495+
1496+
### HTTP request headers
1497+
1498+
- **Content-Type**: Not defined
1499+
- **Accept**: Not defined
1500+
1501+
14361502
## deleteClassification
14371503

14381504
> deleteClassification(cloudPk, id, projectPk)

src/api/CollaborationApi.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,68 @@ export default class CollaborationApi {
13551355
}
13561356

13571357

1358+
/**
1359+
* Delete all document history
1360+
* Delete all document history Required scopes: document:write
1361+
* @param {Number} cloudPk A unique integer value identifying this cloud.
1362+
* @param {Number} documentPk A unique integer value identifying this document.
1363+
* @param {Number} projectPk A unique integer value identifying this project.
1364+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
1365+
*/
1366+
deleteAllHistoryWithHttpInfo(cloudPk, documentPk, projectPk) {
1367+
let postBody = null;
1368+
// verify the required parameter 'cloudPk' is set
1369+
if (cloudPk === undefined || cloudPk === null) {
1370+
throw new Error("Missing the required parameter 'cloudPk' when calling deleteAllHistory");
1371+
}
1372+
// verify the required parameter 'documentPk' is set
1373+
if (documentPk === undefined || documentPk === null) {
1374+
throw new Error("Missing the required parameter 'documentPk' when calling deleteAllHistory");
1375+
}
1376+
// verify the required parameter 'projectPk' is set
1377+
if (projectPk === undefined || projectPk === null) {
1378+
throw new Error("Missing the required parameter 'projectPk' when calling deleteAllHistory");
1379+
}
1380+
1381+
let pathParams = {
1382+
'cloud_pk': cloudPk,
1383+
'document_pk': documentPk,
1384+
'project_pk': projectPk
1385+
};
1386+
let queryParams = {
1387+
};
1388+
let headerParams = {
1389+
};
1390+
let formParams = {
1391+
};
1392+
1393+
let authNames = ['ApiKey', 'BIMData_Connect', 'BIMData_Connect', 'Bearer'];
1394+
let contentTypes = [];
1395+
let accepts = [];
1396+
let returnType = null;
1397+
return this.apiClient.callApi(
1398+
'/cloud/{cloud_pk}/project/{project_pk}/document/{document_pk}/history/delete', 'DELETE',
1399+
pathParams, queryParams, headerParams, formParams, postBody,
1400+
authNames, contentTypes, accepts, returnType, null
1401+
);
1402+
}
1403+
1404+
/**
1405+
* Delete all document history
1406+
* Delete all document history Required scopes: document:write
1407+
* @param {Number} cloudPk A unique integer value identifying this cloud.
1408+
* @param {Number} documentPk A unique integer value identifying this document.
1409+
* @param {Number} projectPk A unique integer value identifying this project.
1410+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
1411+
*/
1412+
deleteAllHistory(cloudPk, documentPk, projectPk) {
1413+
return this.deleteAllHistoryWithHttpInfo(cloudPk, documentPk, projectPk)
1414+
.then(function(response_and_data) {
1415+
return response_and_data.data;
1416+
});
1417+
}
1418+
1419+
13581420
/**
13591421
* Delete a classification
13601422
* All elements having this classification will lose it Required scopes: ifc:write, model:write

test/api/CollaborationApi.spec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,16 @@
248248
done();
249249
});
250250
});
251+
describe('deleteAllHistory', function() {
252+
it('should call deleteAllHistory successfully', function(done) {
253+
//uncomment below and update the code to test deleteAllHistory
254+
//instance.deleteAllHistory(function(error) {
255+
// if (error) throw error;
256+
//expect().to.be();
257+
//});
258+
done();
259+
});
260+
});
251261
describe('deleteClassification', function() {
252262
it('should call deleteClassification successfully', function(done) {
253263
//uncomment below and update the code to test deleteClassification

0 commit comments

Comments
 (0)