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

Commit c97c61e

Browse files
committed
PATCH: add history_count to document serialization and prefetch stuff
1 parent e173e6d commit c97c61e

File tree

5 files changed

+24
-6
lines changed

5 files changed

+24
-6
lines changed

docs/CollaborationApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ Name | Type | Description | Notes
955955
956956
Create a document
957957

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

960960
### Example
961961

docs/Document.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Name | Type | Description | Notes
2222
**ifcId** | **Number** | DEPRECATED: Use 'model_id' instead. | [readonly]
2323
**headId** | **Number** | Document id of head version | [readonly]
2424
**isHeadVersion** | **Boolean** | Document is a head of version or is owned by another document | [readonly]
25+
**historyCount** | **Number** | Number of previous versions | [readonly]
2526
**userPermission** | **Number** | Aggregate of group user permissions and folder default permission | [readonly]
2627
**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]
2728

src/api/CollaborationApi.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ export default class CollaborationApi {
858858

859859
/**
860860
* Create a document
861-
* Create a document. If the document is one of {'OBJ', 'DWG', 'IFC', 'GLTF', 'DXF', 'POINT_CLOUD'}, a model will be created and attached to this document Required scopes: document:write
861+
* Create a document. If the document is one of {'POINT_CLOUD', 'GLTF', 'DXF', 'IFC', 'OBJ', 'DWG'}, a model will be created and attached to this document Required scopes: document:write
862862
* @param {Number} cloudPk A unique integer value identifying this cloud.
863863
* @param {Number} projectPk A unique integer value identifying this project.
864864
* @param {String} name Shown name of the file
@@ -924,7 +924,7 @@ export default class CollaborationApi {
924924

925925
/**
926926
* Create a document
927-
* Create a document. If the document is one of {'OBJ', 'DWG', 'IFC', 'GLTF', 'DXF', 'POINT_CLOUD'}, a model will be created and attached to this document Required scopes: document:write
927+
* Create a document. If the document is one of {'POINT_CLOUD', 'GLTF', 'DXF', 'IFC', 'OBJ', 'DWG'}, a model will be created and attached to this document Required scopes: document:write
928928
* @param {Number} cloudPk A unique integer value identifying this cloud.
929929
* @param {Number} projectPk A unique integer value identifying this project.
930930
* @param {String} name Shown name of the file

src/model/Document.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,21 @@ class Document {
4040
* @param ifcId {Number} DEPRECATED: Use 'model_id' instead.
4141
* @param headId {Number} Document id of head version
4242
* @param isHeadVersion {Boolean} Document is a head of version or is owned by another document
43+
* @param historyCount {Number} Number of previous versions
4344
* @param userPermission {module:model/Document.UserPermissionEnum} Aggregate of group user permissions and folder default permission
4445
* @param 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
4546
*/
46-
constructor(id, createdBy, project, name, file, size, tags, visas, createdAt, updatedAt, modelId, modelType, ifcId, headId, isHeadVersion, userPermission, officePreview) {
47+
constructor(id, createdBy, project, name, file, size, tags, visas, createdAt, updatedAt, modelId, modelType, ifcId, headId, isHeadVersion, historyCount, userPermission, officePreview) {
4748

48-
Document.initialize(this, id, createdBy, project, name, file, size, tags, visas, createdAt, updatedAt, modelId, modelType, ifcId, headId, isHeadVersion, userPermission, officePreview);
49+
Document.initialize(this, id, createdBy, project, name, file, size, tags, visas, createdAt, updatedAt, modelId, modelType, ifcId, headId, isHeadVersion, historyCount, userPermission, officePreview);
4950
}
5051

5152
/**
5253
* Initializes the fields of this object.
5354
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
5455
* Only for internal use.
5556
*/
56-
static initialize(obj, id, createdBy, project, name, file, size, tags, visas, createdAt, updatedAt, modelId, modelType, ifcId, headId, isHeadVersion, userPermission, officePreview) {
57+
static initialize(obj, id, createdBy, project, name, file, size, tags, visas, createdAt, updatedAt, modelId, modelType, ifcId, headId, isHeadVersion, historyCount, userPermission, officePreview) {
5758
obj['id'] = id;
5859
obj['created_by'] = createdBy;
5960
obj['project'] = project;
@@ -69,6 +70,7 @@ class Document {
6970
obj['ifc_id'] = ifcId;
7071
obj['head_id'] = headId;
7172
obj['is_head_version'] = isHeadVersion;
73+
obj['history_count'] = historyCount;
7274
obj['user_permission'] = userPermission;
7375
obj['office_preview'] = officePreview;
7476
}
@@ -138,6 +140,9 @@ class Document {
138140
if (data.hasOwnProperty('is_head_version')) {
139141
obj['is_head_version'] = ApiClient.convertToType(data['is_head_version'], 'Boolean');
140142
}
143+
if (data.hasOwnProperty('history_count')) {
144+
obj['history_count'] = ApiClient.convertToType(data['history_count'], 'Number');
145+
}
141146
if (data.hasOwnProperty('user_permission')) {
142147
obj['user_permission'] = ApiClient.convertToType(data['user_permission'], 'Number');
143148
}
@@ -251,6 +256,12 @@ Document.prototype['head_id'] = undefined;
251256
*/
252257
Document.prototype['is_head_version'] = undefined;
253258

259+
/**
260+
* Number of previous versions
261+
* @member {Number} history_count
262+
*/
263+
Document.prototype['history_count'] = undefined;
264+
254265
/**
255266
* Aggregate of group user permissions and folder default permission
256267
* @member {module:model/Document.UserPermissionEnum} user_permission

test/model/Document.spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,12 @@
162162
//expect(instance).to.be();
163163
});
164164

165+
it('should have the property historyCount (base name: "history_count")', function() {
166+
// uncomment below and update the code to test the property historyCount
167+
//var instance = new bimdata.Document();
168+
//expect(instance).to.be();
169+
});
170+
165171
it('should have the property userPermission (base name: "user_permission")', function() {
166172
// uncomment below and update the code to test the property userPermission
167173
//var instance = new bimdata.Document();

0 commit comments

Comments
 (0)