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

Commit b3120c1

Browse files
committed
MINOR: add document-preview (#642)
* add document-preview * add admin reprocess * rename field
1 parent 9c9f2a5 commit b3120c1

21 files changed

+342
-98
lines changed

.openapi-generator/FILES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ docs/DetailedExtensions.md
3939
docs/Direction.md
4040
docs/DirectionRequest.md
4141
docs/Document.md
42+
docs/DocumentPreviewFile.md
4243
docs/DocumentWithElementList.md
4344
docs/Element.md
4445
docs/ElementClassificationRelation.md
@@ -302,6 +303,7 @@ src/model/DetailedExtensions.js
302303
src/model/Direction.js
303304
src/model/DirectionRequest.js
304305
src/model/Document.js
306+
src/model/DocumentPreviewFile.js
305307
src/model/DocumentWithElementList.js
306308
src/model/Element.js
307309
src/model/ElementClassificationRelation.js
@@ -557,6 +559,7 @@ test/model/DetailedExtensions.spec.js
557559
test/model/Direction.spec.js
558560
test/model/DirectionRequest.spec.js
559561
test/model/Document.spec.js
562+
test/model/DocumentPreviewFile.spec.js
560563
test/model/DocumentWithElementList.spec.js
561564
test/model/Element.spec.js
562565
test/model/ElementClassificationRelation.spec.js

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ Class | Method | HTTP request | Description
327327
*bimdata.CollaborationApi* | [**updateFolder**](docs/CollaborationApi.md#updateFolder) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/folder/{id} | Update some fields of a folder
328328
*bimdata.CollaborationApi* | [**updateGroupFolder**](docs/CollaborationApi.md#updateGroupFolder) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/folder/{folder_pk}/group/{id} | Update the permission of a group on a folder. When propagate is set to True, the permission of all children in the folder will be updated.
329329
*bimdata.CollaborationApi* | [**updateManageGroup**](docs/CollaborationApi.md#updateManageGroup) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/group/{id} | Update some fields of a group
330+
*bimdata.CollaborationApi* | [**updatePreviewFile**](docs/CollaborationApi.md#updatePreviewFile) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/document/{id}/preview-file | Update preview of the document
330331
*bimdata.CollaborationApi* | [**updateProject**](docs/CollaborationApi.md#updateProject) | **PATCH** /cloud/{cloud_pk}/project/{id} | Update some fields of a project
331332
*bimdata.CollaborationApi* | [**updateProjectAccessToken**](docs/CollaborationApi.md#updateProjectAccessToken) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/access-token/{token} | Update some fields of a token
332333
*bimdata.CollaborationApi* | [**updateProjectUser**](docs/CollaborationApi.md#updateProjectUser) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/user/{id} | Change the user role in the cloud
@@ -686,6 +687,7 @@ Class | Method | HTTP request | Description
686687
- [bimdata.Direction](docs/Direction.md)
687688
- [bimdata.DirectionRequest](docs/DirectionRequest.md)
688689
- [bimdata.Document](docs/Document.md)
690+
- [bimdata.DocumentPreviewFile](docs/DocumentPreviewFile.md)
689691
- [bimdata.DocumentWithElementList](docs/DocumentWithElementList.md)
690692
- [bimdata.Element](docs/Element.md)
691693
- [bimdata.ElementClassificationRelation](docs/ElementClassificationRelation.md)

docs/CollaborationApi.md

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ Method | HTTP request | Description
103103
[**updateFolder**](CollaborationApi.md#updateFolder) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/folder/{id} | Update some fields of a folder
104104
[**updateGroupFolder**](CollaborationApi.md#updateGroupFolder) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/folder/{folder_pk}/group/{id} | Update the permission of a group on a folder. When propagate is set to True, the permission of all children in the folder will be updated.
105105
[**updateManageGroup**](CollaborationApi.md#updateManageGroup) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/group/{id} | Update some fields of a group
106+
[**updatePreviewFile**](CollaborationApi.md#updatePreviewFile) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/document/{id}/preview-file | Update preview of the document
106107
[**updateProject**](CollaborationApi.md#updateProject) | **PATCH** /cloud/{cloud_pk}/project/{id} | Update some fields of a project
107108
[**updateProjectAccessToken**](CollaborationApi.md#updateProjectAccessToken) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/access-token/{token} | Update some fields of a token
108109
[**updateProjectUser**](CollaborationApi.md#updateProjectUser) | **PATCH** /cloud/{cloud_pk}/project/{project_pk}/user/{id} | Change the user role in the cloud
@@ -954,7 +955,7 @@ Name | Type | Description | Notes
954955
955956
Create a document
956957

957-
Create a document. If the document is one of {'POINT_CLOUD', 'DAE', 'GLTF', 'IFC', 'OBJ', 'DWG', 'BFX', 'DXF'}, a model will be created and attached to this document Required scopes: document:write
958+
Create a document. If the document is one of {'OBJ', 'IFC', 'DWG', 'POINT_CLOUD', 'GLTF', 'DXF'}, a model will be created and attached to this document Required scopes: document:write
958959

959960
### Example
960961

@@ -987,7 +988,6 @@ let opts = {
987988
'parentId': 56, // Number |
988989
'fileName': "fileName_example", // String | Full name of the file
989990
'description': "description_example", // String | Description of the file
990-
'size': 789, // Number | Size of the file.
991991
'modelSource': "modelSource_example", // String | Define the model.source field if the upload is a Model (IFC, PDF, DWG...)
992992
'ifcSource': "ifcSource_example", // String | DEPRECATED: Use 'model_source' instead. Define the model.source field if the upload is a Model (IFC, PDF, DWG...)
993993
'successorOf': 56 // Number | Old document version to replace. Only for create
@@ -1012,7 +1012,6 @@ Name | Type | Description | Notes
10121012
**parentId** | **Number**| | [optional]
10131013
**fileName** | **String**| Full name of the file | [optional]
10141014
**description** | **String**| Description of the file | [optional]
1015-
**size** | **Number**| Size of the file. | [optional]
10161015
**modelSource** | **String**| Define the model.source field if the upload is a Model (IFC, PDF, DWG...) | [optional]
10171016
**ifcSource** | **String**| DEPRECATED: Use 'model_source' instead. Define the model.source field if the upload is a Model (IFC, PDF, DWG...) | [optional]
10181017
**successorOf** | **Number**| Old document version to replace. Only for create | [optional]
@@ -6544,6 +6543,75 @@ Name | Type | Description | Notes
65446543
- **Accept**: application/json
65456544

65466545

6546+
## updatePreviewFile
6547+
6548+
> DocumentPreviewFile updatePreviewFile(cloudPk, id, projectPk, opts)
6549+
6550+
Update preview of the document
6551+
6552+
Update preview of the document Required scopes: document:write
6553+
6554+
### Example
6555+
6556+
```javascript
6557+
import bimdata from '@bimdata/bimdata-api-client';
6558+
let defaultClient = bimdata.ApiClient.instance;
6559+
// Configure API key authorization: ApiKey
6560+
let ApiKey = defaultClient.authentications['ApiKey'];
6561+
ApiKey.apiKey = 'YOUR API KEY';
6562+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
6563+
//ApiKey.apiKeyPrefix = 'Token';
6564+
// Configure OAuth2 access token for authorization: BIMData_Connect
6565+
let BIMData_Connect = defaultClient.authentications['BIMData_Connect'];
6566+
BIMData_Connect.accessToken = 'YOUR ACCESS TOKEN';
6567+
// Configure OAuth2 access token for authorization: BIMData_Connect
6568+
let BIMData_Connect = defaultClient.authentications['BIMData_Connect'];
6569+
BIMData_Connect.accessToken = 'YOUR ACCESS TOKEN';
6570+
// Configure API key authorization: Bearer
6571+
let Bearer = defaultClient.authentications['Bearer'];
6572+
Bearer.apiKey = 'YOUR API KEY';
6573+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
6574+
//Bearer.apiKeyPrefix = 'Token';
6575+
6576+
let apiInstance = new bimdata.CollaborationApi();
6577+
let cloudPk = 56; // Number | A unique integer value identifying this cloud.
6578+
let id = 56; // Number | A unique integer value identifying this document.
6579+
let projectPk = 56; // Number | A unique integer value identifying this project.
6580+
let opts = {
6581+
'officePreview': "/path/to/file" // File | Office files will be converted as pdf to provide a web preview. Supported extensions are .ppt, .pptx, .odp, .xls, .xlsx, .ods, .doc, .docx, .odt
6582+
};
6583+
apiInstance.updatePreviewFile(cloudPk, id, projectPk, opts).then((data) => {
6584+
console.log('API called successfully. Returned data: ' + data);
6585+
}, (error) => {
6586+
console.error(error);
6587+
});
6588+
6589+
```
6590+
6591+
### Parameters
6592+
6593+
6594+
Name | Type | Description | Notes
6595+
------------- | ------------- | ------------- | -------------
6596+
**cloudPk** | **Number**| A unique integer value identifying this cloud. |
6597+
**id** | **Number**| A unique integer value identifying this document. |
6598+
**projectPk** | **Number**| A unique integer value identifying this project. |
6599+
**officePreview** | **File**| Office files will be converted as pdf to provide a web preview. Supported extensions are .ppt, .pptx, .odp, .xls, .xlsx, .ods, .doc, .docx, .odt | [optional]
6600+
6601+
### Return type
6602+
6603+
[**DocumentPreviewFile**](DocumentPreviewFile.md)
6604+
6605+
### Authorization
6606+
6607+
[ApiKey](../README.md#ApiKey), [BIMData_Connect](../README.md#BIMData_Connect), [BIMData_Connect](../README.md#BIMData_Connect), [Bearer](../README.md#Bearer)
6608+
6609+
### HTTP request headers
6610+
6611+
- **Content-Type**: multipart/form-data, application/x-www-form-urlencoded
6612+
- **Accept**: application/json
6613+
6614+
65476615
## updateProject
65486616

65496617
> Project updateProject(cloudPk, id, opts)

docs/Document.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@ Name | Type | Description | Notes
1212
**fileName** | **String** | Full name of the file | [optional]
1313
**description** | **String** | Description of the file | [optional]
1414
**file** | **String** | |
15-
**size** | **Number** | Size of the file. | [optional]
15+
**size** | **Number** | Size of the file. | [readonly]
1616
**tags** | [**[Tag]**](Tag.md) | | [readonly]
1717
**visas** | [**[Visa]**](Visa.md) | | [readonly]
1818
**createdAt** | **Date** | Creation date | [readonly]
1919
**updatedAt** | **Date** | Date of the last update | [readonly]
2020
**modelId** | **Number** | | [readonly]
21-
**modelType** | **String** | Model's type. Values can be IFC, DWG, DXF, GLTF, PDF, JPEG, PNG, OBJ, DAE, BFX, POINT_CLOUD | [readonly]
21+
**modelType** | **String** | Model's type. Values can be IFC, DWG, DXF, GLTF, PDF, JPEG, PNG, OBJ, POINT_CLOUD | [readonly]
2222
**ifcId** | **Number** | DEPRECATED: Use 'model_id' instead. | [readonly]
2323
**userPermission** | **Number** | Aggregate of group user permissions and folder default permission | [readonly]
2424
**isHeadVersion** | **Boolean** | Document is a head of version or is owned by another document | [readonly]
25+
**officePreview** | **String** | Office files will be converted as pdf to provide a web preview. Supported extensions are .ppt, .pptx, .odp, .xls, .xlsx, .ods, .doc, .docx, .odt | [readonly]
2526

2627

2728

@@ -44,10 +45,6 @@ Name | Type | Description | Notes
4445

4546
* `OBJ` (value: `"OBJ"`)
4647

47-
* `DAE` (value: `"DAE"`)
48-
49-
* `BFX` (value: `"BFX"`)
50-
5148
* `POINT_CLOUD` (value: `"POINT_CLOUD"`)
5249

5350
* `null` (value: `"null"`)

docs/DocumentPreviewFile.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# bimdata.DocumentPreviewFile
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**officePreview** | **String** | Office files will be converted as pdf to provide a web preview. Supported extensions are .ppt, .pptx, .odp, .xls, .xlsx, .ods, .doc, .docx, .odt |
8+
9+

docs/Model.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ Name | Type | Description | Notes
5555

5656
* `OBJ` (value: `"OBJ"`)
5757

58-
* `DAE` (value: `"DAE"`)
59-
60-
* `BFX` (value: `"BFX"`)
61-
6258
* `POINT_CLOUD` (value: `"POINT_CLOUD"`)
6359

6460
* `METABUILDING` (value: `"METABUILDING"`)

docs/ModelSerializerWithoutChildren.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ Name | Type | Description | Notes
5454

5555
* `OBJ` (value: `"OBJ"`)
5656

57-
* `DAE` (value: `"DAE"`)
58-
59-
* `BFX` (value: `"BFX"`)
60-
6157
* `POINT_CLOUD` (value: `"POINT_CLOUD"`)
6258

6359
* `METABUILDING` (value: `"METABUILDING"`)

docs/PatchedDocumentRequest.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ Name | Type | Description | Notes
99
**fileName** | **String** | Full name of the file | [optional]
1010
**description** | **String** | Description of the file | [optional]
1111
**file** | **File** | | [optional]
12-
**size** | **Number** | Size of the file. | [optional]
1312
**modelSource** | **String** | Define the model.source field if the upload is a Model (IFC, PDF, DWG...) | [optional]
1413
**ifcSource** | **String** | DEPRECATED: Use 'model_source' instead. Define the model.source field if the upload is a Model (IFC, PDF, DWG...) | [optional]
1514
**successorOf** | **Number** | Old document version to replace. Only for create | [optional]

docs/RecursiveFolderChildren.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Name | Type | Description | Notes
99
**createdBy** | [**ShortUser**](ShortUser.md) | | [optional]
1010
**type** | **String** | DEPRECATED: Use 'nature' instead. Values can be 'Folder', 'Document' or 'Ifc'. It is usefull to parse the tree and discriminate folders and files | [readonly]
1111
**nature** | **String** | Values can be 'Folder', 'Document' or 'Model'. It is usefull to parse the tree and discriminate folders and files | [readonly]
12-
**modelType** | **String** | Model's type. Values can be IFC, DWG, DXF, GLTF, PDF, JPEG, PNG, OBJ, DAE, BFX, POINT_CLOUD | [readonly]
12+
**modelType** | **String** | Model's type. Values can be IFC, DWG, DXF, GLTF, PDF, JPEG, PNG, OBJ, POINT_CLOUD | [readonly]
1313
**name** | **String** | |
1414
**createdAt** | **Date** | |
1515
**updatedAt** | **Date** | |
@@ -73,10 +73,6 @@ Name | Type | Description | Notes
7373

7474
* `OBJ` (value: `"OBJ"`)
7575

76-
* `DAE` (value: `"DAE"`)
77-
78-
* `BFX` (value: `"BFX"`)
79-
8076
* `POINT_CLOUD` (value: `"POINT_CLOUD"`)
8177

8278
* `null` (value: `"null"`)

src/api/CollaborationApi.js

Lines changed: 71 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import CloudInvitation from '../model/CloudInvitation';
2121
import CloudInvitationRequest from '../model/CloudInvitationRequest';
2222
import CloudRequest from '../model/CloudRequest';
2323
import Document from '../model/Document';
24+
import DocumentPreviewFile from '../model/DocumentPreviewFile';
2425
import Folder from '../model/Folder';
2526
import FolderUserProject from '../model/FolderUserProject';
2627
import FolderWithoutChildren from '../model/FolderWithoutChildren';
@@ -857,7 +858,7 @@ export default class CollaborationApi {
857858

858859
/**
859860
* Create a document
860-
* Create a document. If the document is one of {'POINT_CLOUD', 'DAE', 'GLTF', 'IFC', 'OBJ', 'DWG', 'BFX', 'DXF'}, a model will be created and attached to this document Required scopes: document:write
861+
* Create a document. If the document is one of {'OBJ', 'IFC', 'DWG', 'POINT_CLOUD', 'GLTF', 'DXF'}, a model will be created and attached to this document Required scopes: document:write
861862
* @param {Number} cloudPk A unique integer value identifying this cloud.
862863
* @param {Number} projectPk A unique integer value identifying this project.
863864
* @param {String} name Shown name of the file
@@ -866,7 +867,6 @@ export default class CollaborationApi {
866867
* @param {Number} opts.parentId
867868
* @param {String} opts.fileName Full name of the file
868869
* @param {String} opts.description Description of the file
869-
* @param {Number} opts.size Size of the file.
870870
* @param {module:model/String} opts.modelSource Define the model.source field if the upload is a Model (IFC, PDF, DWG...)
871871
* @param {module:model/String} opts.ifcSource DEPRECATED: Use 'model_source' instead. Define the model.source field if the upload is a Model (IFC, PDF, DWG...)
872872
* @param {Number} opts.successorOf Old document version to replace. Only for create
@@ -906,7 +906,6 @@ export default class CollaborationApi {
906906
'file_name': opts['fileName'],
907907
'description': opts['description'],
908908
'file': file,
909-
'size': opts['size'],
910909
'model_source': opts['modelSource'],
911910
'ifc_source': opts['ifcSource'],
912911
'successor_of': opts['successorOf']
@@ -925,7 +924,7 @@ export default class CollaborationApi {
925924

926925
/**
927926
* Create a document
928-
* Create a document. If the document is one of {'POINT_CLOUD', 'DAE', 'GLTF', 'IFC', 'OBJ', 'DWG', 'BFX', 'DXF'}, a model will be created and attached to this document Required scopes: document:write
927+
* Create a document. If the document is one of {'OBJ', 'IFC', 'DWG', 'POINT_CLOUD', 'GLTF', 'DXF'}, a model will be created and attached to this document Required scopes: document:write
929928
* @param {Number} cloudPk A unique integer value identifying this cloud.
930929
* @param {Number} projectPk A unique integer value identifying this project.
931930
* @param {String} name Shown name of the file
@@ -934,7 +933,6 @@ export default class CollaborationApi {
934933
* @param {Number} opts.parentId
935934
* @param {String} opts.fileName Full name of the file
936935
* @param {String} opts.description Description of the file
937-
* @param {Number} opts.size Size of the file.
938936
* @param {module:model/String} opts.modelSource Define the model.source field if the upload is a Model (IFC, PDF, DWG...)
939937
* @param {module:model/String} opts.ifcSource DEPRECATED: Use 'model_source' instead. Define the model.source field if the upload is a Model (IFC, PDF, DWG...)
940938
* @param {Number} opts.successorOf Old document version to replace. Only for create
@@ -6074,6 +6072,74 @@ export default class CollaborationApi {
60746072
}
60756073

60766074

6075+
/**
6076+
* Update preview of the document
6077+
* Update preview of the document Required scopes: document:write
6078+
* @param {Number} cloudPk A unique integer value identifying this cloud.
6079+
* @param {Number} id A unique integer value identifying this document.
6080+
* @param {Number} projectPk A unique integer value identifying this project.
6081+
* @param {Object} opts Optional parameters
6082+
* @param {File} opts.officePreview Office files will be converted as pdf to provide a web preview. Supported extensions are .ppt, .pptx, .odp, .xls, .xlsx, .ods, .doc, .docx, .odt
6083+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DocumentPreviewFile} and HTTP response
6084+
*/
6085+
updatePreviewFileWithHttpInfo(cloudPk, id, projectPk, opts) {
6086+
opts = opts || {};
6087+
let postBody = null;
6088+
// verify the required parameter 'cloudPk' is set
6089+
if (cloudPk === undefined || cloudPk === null) {
6090+
throw new Error("Missing the required parameter 'cloudPk' when calling updatePreviewFile");
6091+
}
6092+
// verify the required parameter 'id' is set
6093+
if (id === undefined || id === null) {
6094+
throw new Error("Missing the required parameter 'id' when calling updatePreviewFile");
6095+
}
6096+
// verify the required parameter 'projectPk' is set
6097+
if (projectPk === undefined || projectPk === null) {
6098+
throw new Error("Missing the required parameter 'projectPk' when calling updatePreviewFile");
6099+
}
6100+
6101+
let pathParams = {
6102+
'cloud_pk': cloudPk,
6103+
'id': id,
6104+
'project_pk': projectPk
6105+
};
6106+
let queryParams = {
6107+
};
6108+
let headerParams = {
6109+
};
6110+
let formParams = {
6111+
'office_preview': opts['officePreview']
6112+
};
6113+
6114+
let authNames = ['ApiKey', 'BIMData_Connect', 'BIMData_Connect', 'Bearer'];
6115+
let contentTypes = ['multipart/form-data', 'application/x-www-form-urlencoded'];
6116+
let accepts = ['application/json'];
6117+
let returnType = DocumentPreviewFile;
6118+
return this.apiClient.callApi(
6119+
'/cloud/{cloud_pk}/project/{project_pk}/document/{id}/preview-file', 'PATCH',
6120+
pathParams, queryParams, headerParams, formParams, postBody,
6121+
authNames, contentTypes, accepts, returnType, null
6122+
);
6123+
}
6124+
6125+
/**
6126+
* Update preview of the document
6127+
* Update preview of the document Required scopes: document:write
6128+
* @param {Number} cloudPk A unique integer value identifying this cloud.
6129+
* @param {Number} id A unique integer value identifying this document.
6130+
* @param {Number} projectPk A unique integer value identifying this project.
6131+
* @param {Object} opts Optional parameters
6132+
* @param {File} opts.officePreview Office files will be converted as pdf to provide a web preview. Supported extensions are .ppt, .pptx, .odp, .xls, .xlsx, .ods, .doc, .docx, .odt
6133+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DocumentPreviewFile}
6134+
*/
6135+
updatePreviewFile(cloudPk, id, projectPk, opts) {
6136+
return this.updatePreviewFileWithHttpInfo(cloudPk, id, projectPk, opts)
6137+
.then(function(response_and_data) {
6138+
return response_and_data.data;
6139+
});
6140+
}
6141+
6142+
60776143
/**
60786144
* Update some fields of a project
60796145
* Update some fields of a project Required scopes: org:manage

0 commit comments

Comments
 (0)