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

Commit 595fbeb

Browse files
committed
MINOR: Add IFC export route. Fix users deserialization when firstname and lastname are empty
1 parent dd0778e commit 595fbeb

12 files changed

Lines changed: 316 additions & 19 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Class | Method | HTTP request | Description
162162
*bimdata.BcfApi* | [**getViewpoint**](docs/BcfApi.md#getViewpoint) | **GET** /bcf/2.1/projects/{projects_pk}/topics/{topics_guid}/viewpoints/{guid} | Retrieve a Viewpoint
163163
*bimdata.BcfApi* | [**getViewpoints**](docs/BcfApi.md#getViewpoints) | **GET** /bcf/2.1/projects/{projects_pk}/topics/{topics_guid}/viewpoints | Retrieve all Viewpoints of a topic
164164
*bimdata.BcfApi* | [**getVisibilities**](docs/BcfApi.md#getVisibilities) | **GET** /bcf/2.1/projects/{projects_pk}/topics/{topics_guid}/viewpoints/{guid}/visibility | Retrieve all visibilities of a viewpoint
165-
*bimdata.BcfApi* | [**importBcf**](docs/BcfApi.md#importBcf) | **POST** /bcf/2.1/projects/{id}/import | Import bcf-xml format into this project. If there are guid conflict, an error will be raised. If there are index conflicts, indexes of the imported file will be overriden with a new index. Author and assigned_to fields will be linked to existing users in the project. If no matching user are found, fields will be emptied. Only BCF 2.1 is supported
165+
*bimdata.BcfApi* | [**importBcf**](docs/BcfApi.md#importBcf) | **POST** /bcf/2.1/projects/{id}/import | Import bcf-xml format into this project
166166
*bimdata.BcfApi* | [**updateBcfProject**](docs/BcfApi.md#updateBcfProject) | **PATCH** /bcf/2.1/projects/{id} | Update some fields of a BCF project
167167
*bimdata.BcfApi* | [**updateComment**](docs/BcfApi.md#updateComment) | **PATCH** /bcf/2.1/projects/{projects_pk}/topics/{topics_guid}/comments/{guid} | Update some fields of a comment
168168
*bimdata.BcfApi* | [**updateExtensions**](docs/BcfApi.md#updateExtensions) | **PATCH** /bcf/2.1/projects/{projects_pk}/extensions | Update project extensions
@@ -363,6 +363,7 @@ Class | Method | HTTP request | Description
363363
*bimdata.IfcApi* | [**getZoneSpaces**](docs/IfcApi.md#getZoneSpaces) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/zone/{zone_pk}/space | Retrieve all spaces of a zone
364364
*bimdata.IfcApi* | [**getZones**](docs/IfcApi.md#getZones) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/zone | Retrieve zones of a model
365365
*bimdata.IfcApi* | [**listClassificationElementRelations**](docs/IfcApi.md#listClassificationElementRelations) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/classification-element | List all associations between classifications and elements
366+
*bimdata.IfcApi* | [**mergeIfcs**](docs/IfcApi.md#mergeIfcs) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/merge | merge IFC files
366367
*bimdata.IfcApi* | [**removeClassificationOfElement**](docs/IfcApi.md#removeClassificationOfElement) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/classification/{id} | Remove a classification from an element
367368
*bimdata.IfcApi* | [**removeElementPropertySet**](docs/IfcApi.md#removeElementPropertySet) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{id} | Remove a PropertySet from an element
368369
*bimdata.IfcApi* | [**removeElementPropertySetProperty**](docs/IfcApi.md#removeElementPropertySetProperty) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{id} | Remove a property from a PropertySet
@@ -432,6 +433,7 @@ Class | Method | HTTP request | Description
432433
- [bimdata.IfcErrors](docs/IfcErrors.md)
433434
- [bimdata.IfcExport](docs/IfcExport.md)
434435
- [bimdata.IfcFiles](docs/IfcFiles.md)
436+
- [bimdata.IfcMerge](docs/IfcMerge.md)
435437
- [bimdata.Invitation](docs/Invitation.md)
436438
- [bimdata.Label](docs/Label.md)
437439
- [bimdata.Layer](docs/Layer.md)

docs/BcfApi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Method | HTTP request | Description
3434
[**getViewpoint**](BcfApi.md#getViewpoint) | **GET** /bcf/2.1/projects/{projects_pk}/topics/{topics_guid}/viewpoints/{guid} | Retrieve a Viewpoint
3535
[**getViewpoints**](BcfApi.md#getViewpoints) | **GET** /bcf/2.1/projects/{projects_pk}/topics/{topics_guid}/viewpoints | Retrieve all Viewpoints of a topic
3636
[**getVisibilities**](BcfApi.md#getVisibilities) | **GET** /bcf/2.1/projects/{projects_pk}/topics/{topics_guid}/viewpoints/{guid}/visibility | Retrieve all visibilities of a viewpoint
37-
[**importBcf**](BcfApi.md#importBcf) | **POST** /bcf/2.1/projects/{id}/import | Import bcf-xml format into this project. If there are guid conflict, an error will be raised. If there are index conflicts, indexes of the imported file will be overriden with a new index. Author and assigned_to fields will be linked to existing users in the project. If no matching user are found, fields will be emptied. Only BCF 2.1 is supported
37+
[**importBcf**](BcfApi.md#importBcf) | **POST** /bcf/2.1/projects/{id}/import | Import bcf-xml format into this project
3838
[**updateBcfProject**](BcfApi.md#updateBcfProject) | **PATCH** /bcf/2.1/projects/{id} | Update some fields of a BCF project
3939
[**updateComment**](BcfApi.md#updateComment) | **PATCH** /bcf/2.1/projects/{projects_pk}/topics/{topics_guid}/comments/{guid} | Update some fields of a comment
4040
[**updateExtensions**](BcfApi.md#updateExtensions) | **PATCH** /bcf/2.1/projects/{projects_pk}/extensions | Update project extensions
@@ -1816,9 +1816,9 @@ Name | Type | Description | Notes
18161816

18171817
> importBcf(id, name)
18181818
1819-
Import bcf-xml format into this project. If there are guid conflict, an error will be raised. If there are index conflicts, indexes of the imported file will be overriden with a new index. Author and assigned_to fields will be linked to existing users in the project. If no matching user are found, fields will be emptied. Only BCF 2.1 is supported
1819+
Import bcf-xml format into this project
18201820

1821-
Import bcf-xml format into this project Required scopes: bcf:write
1821+
Import bcf-xml format into this project. If there are guid conflict, an error will be raised. If there are index conflicts, indexes of the imported file will be overriden with a new index. Author and assigned_to fields will be linked to existing users in the project. If no matching user are found, fields will be emptied. Only BCF 2.1 is supported Required scopes: bcf:write
18221822

18231823
### Example
18241824

docs/IfcApi.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ Method | HTTP request | Description
107107
[**getZoneSpaces**](IfcApi.md#getZoneSpaces) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/zone/{zone_pk}/space | Retrieve all spaces of a zone
108108
[**getZones**](IfcApi.md#getZones) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/zone | Retrieve zones of a model
109109
[**listClassificationElementRelations**](IfcApi.md#listClassificationElementRelations) | **GET** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/classification-element | List all associations between classifications and elements
110+
[**mergeIfcs**](IfcApi.md#mergeIfcs) | **POST** /cloud/{cloud_pk}/project/{project_pk}/ifc/merge | merge IFC files
110111
[**removeClassificationOfElement**](IfcApi.md#removeClassificationOfElement) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/classification/{id} | Remove a classification from an element
111112
[**removeElementPropertySet**](IfcApi.md#removeElementPropertySet) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{id} | Remove a PropertySet from an element
112113
[**removeElementPropertySetProperty**](IfcApi.md#removeElementPropertySetProperty) | **DELETE** /cloud/{cloud_pk}/project/{project_pk}/ifc/{ifc_pk}/element/{element_uuid}/propertyset/{propertyset_pk}/property/{id} | Remove a property from a PropertySet
@@ -6586,6 +6587,66 @@ Name | Type | Description | Notes
65866587
- **Accept**: application/json
65876588

65886589

6590+
## mergeIfcs
6591+
6592+
> mergeIfcs(cloudPk, projectPk, data)
6593+
6594+
merge IFC files
6595+
6596+
Merge IFC files. The merged IFC file will be put in the same folder that the first IFC of the list. Required scopes: ifc:write
6597+
6598+
### Example
6599+
6600+
```javascript
6601+
import bimdata from '@bimdata/bimdata-api-client';
6602+
let defaultClient = bimdata.ApiClient.instance;
6603+
// Configure API key authorization: Bearer
6604+
let Bearer = defaultClient.authentications['Bearer'];
6605+
Bearer.apiKey = 'YOUR API KEY';
6606+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
6607+
//Bearer.apiKeyPrefix = 'Token';
6608+
// Configure OAuth2 access token for authorization: bimdata_connect
6609+
let bimdata_connect = defaultClient.authentications['bimdata_connect'];
6610+
bimdata_connect.accessToken = 'YOUR ACCESS TOKEN';
6611+
// Configure OAuth2 access token for authorization: client_credentials
6612+
let client_credentials = defaultClient.authentications['client_credentials'];
6613+
client_credentials.accessToken = 'YOUR ACCESS TOKEN';
6614+
6615+
let apiInstance = new bimdata.IfcApi();
6616+
let cloudPk = "cloudPk_example"; // String |
6617+
let projectPk = "projectPk_example"; // String |
6618+
let data = new bimdata.IfcMerge(); // IfcMerge |
6619+
apiInstance.mergeIfcs(cloudPk, projectPk, data).then(() => {
6620+
console.log('API called successfully.');
6621+
}, (error) => {
6622+
console.error(error);
6623+
});
6624+
6625+
```
6626+
6627+
### Parameters
6628+
6629+
6630+
Name | Type | Description | Notes
6631+
------------- | ------------- | ------------- | -------------
6632+
**cloudPk** | **String**| |
6633+
**projectPk** | **String**| |
6634+
**data** | [**IfcMerge**](IfcMerge.md)| |
6635+
6636+
### Return type
6637+
6638+
null (empty response body)
6639+
6640+
### Authorization
6641+
6642+
[Bearer](../README.md#Bearer), [bimdata_connect](../README.md#bimdata_connect), [client_credentials](../README.md#client_credentials)
6643+
6644+
### HTTP request headers
6645+
6646+
- **Content-Type**: application/json
6647+
- **Accept**: Not defined
6648+
6649+
65896650
## removeClassificationOfElement
65906651

65916652
> removeClassificationOfElement(cloudPk, elementUuid, id, ifcPk, projectPk)

docs/IfcMerge.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# bimdata.IfcMerge
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**ifcIds** | **[Number]** | |
8+
**floatingPointReduction** | **Number** | How many numbers after the decimal point are kept. | [optional]
9+
10+

docs/Invitation.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Name | Type | Description | Notes
1212
**projectName** | **String** | | [optional]
1313
**projectRole** | **Number** | Role the user will have when they accept the invitation | [optional]
1414
**email** | **String** | email of the user to invite |
15-
**status** | **String** | A: Accepted D: Denied P: Pending W: Accepted but waiting for user first login to finish the process | [optional]
15+
**status** | **String** | A: Accepted D: Denied P: Pending | [optional]
1616
**senderProviderSub** | **String** | OIDC sub of the sender. The original sub from the provider is used instead of the broker sub | [optional]
1717

1818

@@ -26,8 +26,6 @@ Name | Type | Description | Notes
2626

2727
* `P` (value: `"P"`)
2828

29-
* `W` (value: `"W"`)
30-
3129

3230

3331

src/api/BcfApi.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,8 +1762,8 @@ export default class BcfApi {
17621762

17631763

17641764
/**
1765-
* Import bcf-xml format into this project. If there are guid conflict, an error will be raised. If there are index conflicts, indexes of the imported file will be overriden with a new index. Author and assigned_to fields will be linked to existing users in the project. If no matching user are found, fields will be emptied. Only BCF 2.1 is supported
1766-
* Import bcf-xml format into this project Required scopes: bcf:write
1765+
* Import bcf-xml format into this project
1766+
* Import bcf-xml format into this project. If there are guid conflict, an error will be raised. If there are index conflicts, indexes of the imported file will be overriden with a new index. Author and assigned_to fields will be linked to existing users in the project. If no matching user are found, fields will be emptied. Only BCF 2.1 is supported Required scopes: bcf:write
17671767
* @param {Number} id A unique integer value identifying this project.
17681768
* @param {String} name Name of the project
17691769
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
@@ -1802,8 +1802,8 @@ export default class BcfApi {
18021802
}
18031803

18041804
/**
1805-
* Import bcf-xml format into this project. If there are guid conflict, an error will be raised. If there are index conflicts, indexes of the imported file will be overriden with a new index. Author and assigned_to fields will be linked to existing users in the project. If no matching user are found, fields will be emptied. Only BCF 2.1 is supported
1806-
* Import bcf-xml format into this project Required scopes: bcf:write
1805+
* Import bcf-xml format into this project
1806+
* Import bcf-xml format into this project. If there are guid conflict, an error will be raised. If there are index conflicts, indexes of the imported file will be overriden with a new index. Author and assigned_to fields will be linked to existing users in the project. If no matching user are found, fields will be emptied. Only BCF 2.1 is supported Required scopes: bcf:write
18071807
* @param {Number} id A unique integer value identifying this project.
18081808
* @param {String} name Name of the project
18091809
* @return {Promise} a {@link https://www.promisejs.org/|Promise}

src/api/IfcApi.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import IfcAccessToken from '../model/IfcAccessToken';
2222
import IfcErrors from '../model/IfcErrors';
2323
import IfcExport from '../model/IfcExport';
2424
import IfcFiles from '../model/IfcFiles';
25+
import IfcMerge from '../model/IfcMerge';
2526
import Layer from '../model/Layer';
2627
import ProcessorHandler from '../model/ProcessorHandler';
2728
import Property from '../model/Property';
@@ -7294,6 +7295,67 @@ export default class IfcApi {
72947295
}
72957296

72967297

7298+
/**
7299+
* merge IFC files
7300+
* Merge IFC files. The merged IFC file will be put in the same folder that the first IFC of the list. Required scopes: ifc:write
7301+
* @param {String} cloudPk
7302+
* @param {String} projectPk
7303+
* @param {module:model/IfcMerge} data
7304+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
7305+
*/
7306+
mergeIfcsWithHttpInfo(cloudPk, projectPk, data) {
7307+
let postBody = data;
7308+
// verify the required parameter 'cloudPk' is set
7309+
if (cloudPk === undefined || cloudPk === null) {
7310+
throw new Error("Missing the required parameter 'cloudPk' when calling mergeIfcs");
7311+
}
7312+
// verify the required parameter 'projectPk' is set
7313+
if (projectPk === undefined || projectPk === null) {
7314+
throw new Error("Missing the required parameter 'projectPk' when calling mergeIfcs");
7315+
}
7316+
// verify the required parameter 'data' is set
7317+
if (data === undefined || data === null) {
7318+
throw new Error("Missing the required parameter 'data' when calling mergeIfcs");
7319+
}
7320+
7321+
let pathParams = {
7322+
'cloud_pk': cloudPk,
7323+
'project_pk': projectPk
7324+
};
7325+
let queryParams = {
7326+
};
7327+
let headerParams = {
7328+
};
7329+
let formParams = {
7330+
};
7331+
7332+
let authNames = ['Bearer', 'bimdata_connect', 'client_credentials'];
7333+
let contentTypes = ['application/json'];
7334+
let accepts = [];
7335+
let returnType = null;
7336+
return this.apiClient.callApi(
7337+
'/cloud/{cloud_pk}/project/{project_pk}/ifc/merge', 'POST',
7338+
pathParams, queryParams, headerParams, formParams, postBody,
7339+
authNames, contentTypes, accepts, returnType, null
7340+
);
7341+
}
7342+
7343+
/**
7344+
* merge IFC files
7345+
* Merge IFC files. The merged IFC file will be put in the same folder that the first IFC of the list. Required scopes: ifc:write
7346+
* @param {String} cloudPk
7347+
* @param {String} projectPk
7348+
* @param {module:model/IfcMerge} data
7349+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
7350+
*/
7351+
mergeIfcs(cloudPk, projectPk, data) {
7352+
return this.mergeIfcsWithHttpInfo(cloudPk, projectPk, data)
7353+
.then(function(response_and_data) {
7354+
return response_and_data.data;
7355+
});
7356+
}
7357+
7358+
72977359
/**
72987360
* Remove a classification from an element
72997361
* The classification will not be deleted Required scopes: ifc:write

src/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import IfcCheckerResults from './model/IfcCheckerResults';
4444
import IfcErrors from './model/IfcErrors';
4545
import IfcExport from './model/IfcExport';
4646
import IfcFiles from './model/IfcFiles';
47+
import IfcMerge from './model/IfcMerge';
4748
import Invitation from './model/Invitation';
4849
import Label from './model/Label';
4950
import Layer from './model/Layer';
@@ -327,6 +328,12 @@ export {
327328
*/
328329
IfcFiles,
329330

331+
/**
332+
* The IfcMerge model constructor.
333+
* @property {module:model/IfcMerge}
334+
*/
335+
IfcMerge,
336+
330337
/**
331338
* The Invitation model constructor.
332339
* @property {module:model/Invitation}

src/model/IfcMerge.js

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/**
2+
* BIMData API
3+
* BIMData API is a tool to interact with your models stored on BIMData’s servers. Through the API, you can manage your projects, the clouds, upload your IFC files and manage them through endpoints.
4+
*
5+
* The version of the OpenAPI document: v1
6+
* Contact: contact@bimdata.io
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*
12+
*/
13+
14+
import ApiClient from '../ApiClient';
15+
16+
/**
17+
* The IfcMerge model module.
18+
* @module model/IfcMerge
19+
* @version 0.0.0
20+
*/
21+
class IfcMerge {
22+
/**
23+
* Constructs a new <code>IfcMerge</code>.
24+
* @alias module:model/IfcMerge
25+
* @param ifcIds {Array.<Number>}
26+
*/
27+
constructor(ifcIds) {
28+
29+
IfcMerge.initialize(this, ifcIds);
30+
}
31+
32+
/**
33+
* Initializes the fields of this object.
34+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
35+
* Only for internal use.
36+
*/
37+
static initialize(obj, ifcIds) {
38+
obj['ifc_ids'] = ifcIds;
39+
}
40+
41+
/**
42+
* Constructs a <code>IfcMerge</code> from a plain JavaScript object, optionally creating a new instance.
43+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
44+
* @param {Object} data The plain JavaScript object bearing properties of interest.
45+
* @param {module:model/IfcMerge} obj Optional instance to populate.
46+
* @return {module:model/IfcMerge} The populated <code>IfcMerge</code> instance.
47+
*/
48+
static constructFromObject(data, obj) {
49+
if (data) {
50+
obj = obj || new IfcMerge();
51+
52+
if (data.hasOwnProperty('ifc_ids')) {
53+
obj['ifc_ids'] = ApiClient.convertToType(data['ifc_ids'], ['Number']);
54+
}
55+
if (data.hasOwnProperty('floating_point_reduction')) {
56+
obj['floating_point_reduction'] = ApiClient.convertToType(data['floating_point_reduction'], 'Number');
57+
}
58+
}
59+
return obj;
60+
}
61+
62+
63+
}
64+
65+
/**
66+
* @member {Array.<Number>} ifc_ids
67+
*/
68+
IfcMerge.prototype['ifc_ids'] = undefined;
69+
70+
/**
71+
* How many numbers after the decimal point are kept.
72+
* @member {Number} floating_point_reduction
73+
*/
74+
IfcMerge.prototype['floating_point_reduction'] = undefined;
75+
76+
77+
78+
79+
80+
81+
export default IfcMerge;
82+

src/model/Invitation.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ Invitation.prototype['project_role'] = undefined;
137137
Invitation.prototype['email'] = undefined;
138138

139139
/**
140-
* A: Accepted D: Denied P: Pending W: Accepted but waiting for user first login to finish the process
140+
* A: Accepted D: Denied P: Pending
141141
* @member {module:model/Invitation.StatusEnum} status
142142
*/
143143
Invitation.prototype['status'] = undefined;
@@ -175,13 +175,7 @@ Invitation['StatusEnum'] = {
175175
* value: "P"
176176
* @const
177177
*/
178-
"P": "P",
179-
180-
/**
181-
* value: "W"
182-
* @const
183-
*/
184-
"W": "W"
178+
"P": "P"
185179
};
186180

187181

0 commit comments

Comments
 (0)