@inweb/client 26.5.4 → 26.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +82 -20
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +24 -8
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Assembly.d.ts +16 -2
- package/lib/Api/Client.d.ts +4 -4
- package/lib/Api/File.d.ts +30 -8
- package/package.json +2 -2
- package/src/Api/Assembly.ts +28 -4
- package/src/Api/Client.ts +4 -4
- package/src/Api/File.ts +43 -11
package/dist/client.js
CHANGED
|
@@ -1056,17 +1056,44 @@
|
|
|
1056
1056
|
*
|
|
1057
1057
|
* @typedef {any} Properties
|
|
1058
1058
|
* @property {string} handle - Object original handle.
|
|
1059
|
-
* @property {string | any} * - Object property. Can be `any` for nested properties.
|
|
1059
|
+
* @property {string | any} * - Object property. Can be `any` for nested group properties.
|
|
1060
1060
|
*/
|
|
1061
1061
|
/**
|
|
1062
1062
|
* Returns the properties for an objects in the assembly.
|
|
1063
1063
|
*
|
|
1064
1064
|
* @param handles - Object original handle or handles array. Specify `undefined` to get properties for
|
|
1065
1065
|
* all objects in the assembly.
|
|
1066
|
+
* @param group - If the `group` parameter is `true`, properties are returned grouped by category. By
|
|
1067
|
+
* default, or if `group` is set to `false`, properties are returned ungrouped.
|
|
1068
|
+
*
|
|
1069
|
+
* To get grouped properties, the `--properties_group` command line argument must be specified for the
|
|
1070
|
+
* `properties` File Converter job when {@link Client.createAssembly | creating the assembly}.
|
|
1071
|
+
*
|
|
1072
|
+
* ```javascript
|
|
1073
|
+
* await client.createAssembly([file1.id, file2.id], "AssemblyName", {
|
|
1074
|
+
* jobParameters: { properties: "--properties_group" },
|
|
1075
|
+
* waitForDone: true,
|
|
1076
|
+
* });
|
|
1077
|
+
* ```
|
|
1078
|
+
*
|
|
1079
|
+
* Otherwise, the properties will be returned ungrouped, even if the `group` is `true`.
|
|
1066
1080
|
*/
|
|
1067
|
-
getProperties(handles) {
|
|
1068
|
-
const
|
|
1069
|
-
|
|
1081
|
+
getProperties(handles, group = false) {
|
|
1082
|
+
const searchParams = new URLSearchParams();
|
|
1083
|
+
if (handles) {
|
|
1084
|
+
if (Array.isArray(handles))
|
|
1085
|
+
handles = handles.join(",");
|
|
1086
|
+
if (typeof handles === "string")
|
|
1087
|
+
handles = handles.trim();
|
|
1088
|
+
if (handles)
|
|
1089
|
+
searchParams.set("handles", handles);
|
|
1090
|
+
}
|
|
1091
|
+
if (group)
|
|
1092
|
+
searchParams.set("group", "true");
|
|
1093
|
+
let queryString = searchParams.toString();
|
|
1094
|
+
if (queryString)
|
|
1095
|
+
queryString = "?" + queryString;
|
|
1096
|
+
return this.get(`/properties${queryString}`).then((response) => response.json());
|
|
1070
1097
|
}
|
|
1071
1098
|
/**
|
|
1072
1099
|
* Returns the list of original handles for an objects in the file that match the specified patterns.
|
|
@@ -2563,17 +2590,52 @@
|
|
|
2563
2590
|
*
|
|
2564
2591
|
* @typedef {any} Properties
|
|
2565
2592
|
* @property {string} handle - Object original handle.
|
|
2566
|
-
* @property {string | any} - Object property. Can be `any` for nested properties.
|
|
2593
|
+
* @property {string | any} * - Object property. Can be `any` for nested group properties.
|
|
2567
2594
|
*/
|
|
2568
2595
|
/**
|
|
2569
2596
|
* Returns the properties for an objects in the active version of the file.
|
|
2570
2597
|
*
|
|
2571
2598
|
* @param handles - Object original handle or handles array. Specify `undefined` to get properties for
|
|
2572
2599
|
* all objects in the file.
|
|
2600
|
+
* @param group - If the `group` parameter is `true`, properties are returned grouped by category. By
|
|
2601
|
+
* default, or if `group` is set to `false`, properties are returned ungrouped.
|
|
2602
|
+
*
|
|
2603
|
+
* To get grouped properties, the `--properties_group` command line argument must be specified for the
|
|
2604
|
+
* `properties` File Converter job when {@link Client.uploadFile | uploading the file}:
|
|
2605
|
+
*
|
|
2606
|
+
* ```javascript
|
|
2607
|
+
* await client.uploadFile(file, {
|
|
2608
|
+
* geometry: true,
|
|
2609
|
+
* properties: true,
|
|
2610
|
+
* jobParameters: { properties: "--properties_group" },
|
|
2611
|
+
* waitForDone: true,
|
|
2612
|
+
* });
|
|
2613
|
+
* ```
|
|
2614
|
+
*
|
|
2615
|
+
* or when running the {@link extractProperties | extract file properties} job:
|
|
2616
|
+
*
|
|
2617
|
+
* ```javascript
|
|
2618
|
+
* await file.extractProperties("--properties_group");
|
|
2619
|
+
* ```
|
|
2620
|
+
*
|
|
2621
|
+
* Otherwise, the properties will be returned ungrouped, even if the `group` is `true`.
|
|
2573
2622
|
*/
|
|
2574
|
-
getProperties(handles) {
|
|
2575
|
-
const
|
|
2576
|
-
|
|
2623
|
+
getProperties(handles, group = false) {
|
|
2624
|
+
const searchParams = new URLSearchParams();
|
|
2625
|
+
if (handles) {
|
|
2626
|
+
if (Array.isArray(handles))
|
|
2627
|
+
handles = handles.join(",");
|
|
2628
|
+
if (typeof handles === "string")
|
|
2629
|
+
handles = handles.trim();
|
|
2630
|
+
if (handles)
|
|
2631
|
+
searchParams.set("handles", handles);
|
|
2632
|
+
}
|
|
2633
|
+
if (group)
|
|
2634
|
+
searchParams.set("group", "true");
|
|
2635
|
+
let queryString = searchParams.toString();
|
|
2636
|
+
if (queryString)
|
|
2637
|
+
queryString = "?" + queryString;
|
|
2638
|
+
return this.get(`/properties${queryString}`).then((response) => response.json());
|
|
2577
2639
|
}
|
|
2578
2640
|
/**
|
|
2579
2641
|
* Search pattern.
|
|
@@ -2788,8 +2850,8 @@
|
|
|
2788
2850
|
* {@link downloadResource | downloadResource()} to download the exported file.
|
|
2789
2851
|
* - Other custom job name. Custom job must be registered in the job templates before running.
|
|
2790
2852
|
*
|
|
2791
|
-
* @param parameters - Parameters for the File Converter
|
|
2792
|
-
*
|
|
2853
|
+
* @param parameters - Parameters for the File Converter jobs or custom job. Can be given as command
|
|
2854
|
+
* line arguments in form `--arg=value`.
|
|
2793
2855
|
*/
|
|
2794
2856
|
createJob(outputFormat, parameters) {
|
|
2795
2857
|
const jobs = new Endpoint("/jobs", this.httpClient, this.headers);
|
|
@@ -2811,8 +2873,8 @@
|
|
|
2811
2873
|
* - `vsfx` - `VSFX` format (default), for opening a file in `VisualizeJS` 3D viewer.
|
|
2812
2874
|
* - `gltf` - `glTF` format, for opening a file in `Three.js` 3D viewer.
|
|
2813
2875
|
*
|
|
2814
|
-
* @param parameters - Parameters for the File Converter
|
|
2815
|
-
*
|
|
2876
|
+
* @param parameters - Parameters for the File Converter job. Can be given as command line arguments in
|
|
2877
|
+
* form `--arg=value`.
|
|
2816
2878
|
*/
|
|
2817
2879
|
extractGeometry(type, parameters) {
|
|
2818
2880
|
return this.createJob(type === "gltf" ? "geometryGltf" : "geometry", parameters);
|
|
@@ -2821,8 +2883,8 @@
|
|
|
2821
2883
|
* Runs a File Converter job to extract properties of the active version of the file. This is alias to
|
|
2822
2884
|
* {@link createJob | createJob("properties")}.
|
|
2823
2885
|
*
|
|
2824
|
-
* @param parameters - Parameters for the File Converter
|
|
2825
|
-
*
|
|
2886
|
+
* @param parameters - Parameters for the File Converter job. Can be given as command line arguments in
|
|
2887
|
+
* form `--arg=value`.
|
|
2826
2888
|
*/
|
|
2827
2889
|
extractProperties(parameters) {
|
|
2828
2890
|
return this.createJob("properties", parameters);
|
|
@@ -4569,7 +4631,7 @@
|
|
|
4569
4631
|
.then((data) => ({
|
|
4570
4632
|
...data,
|
|
4571
4633
|
server: data.version,
|
|
4572
|
-
client: "26.
|
|
4634
|
+
client: "26.6.0",
|
|
4573
4635
|
}));
|
|
4574
4636
|
}
|
|
4575
4637
|
/**
|
|
@@ -4986,7 +5048,7 @@
|
|
|
4986
5048
|
* - `gltf` - Convert file geometry data to `glTF` format for opening in `Three.js` 3D viewer.
|
|
4987
5049
|
*
|
|
4988
5050
|
* @param params.properties - Run File Converter job to extract properties after uploading the file.
|
|
4989
|
-
* @param params.jobParameters - Parameters for the File Converter
|
|
5051
|
+
* @param params.jobParameters - Parameters for the File Converter jobs. Use this to specify aditional
|
|
4990
5052
|
* parameters for retrieving the geometry and properties of uploaded file. Can be given as command
|
|
4991
5053
|
* line arguments in form `--arg=value`.
|
|
4992
5054
|
* @param params.waitForDone - Wait for geometry and properties jobs to complete.
|
|
@@ -5126,8 +5188,8 @@
|
|
|
5126
5188
|
* - `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` - Export file to the specified format.
|
|
5127
5189
|
* - Other custom job name. Custom job must be registered in the job templates before running.
|
|
5128
5190
|
*
|
|
5129
|
-
* @param parameters - Parameters for the File Converter
|
|
5130
|
-
*
|
|
5191
|
+
* @param parameters - Parameters for the File Converter jobs or custom job. Can be given as command
|
|
5192
|
+
* line arguments in form `--arg=value`.
|
|
5131
5193
|
*/
|
|
5132
5194
|
createJob(fileId, outputFormat, parameters) {
|
|
5133
5195
|
return this.httpClient
|
|
@@ -5222,7 +5284,7 @@
|
|
|
5222
5284
|
* @param files - List of file IDs.
|
|
5223
5285
|
* @param name - Assembly name.
|
|
5224
5286
|
* @param params - Additional assembly creating parameters.
|
|
5225
|
-
* @param params.jobParameters - Parameters for the File Converter
|
|
5287
|
+
* @param params.jobParameters - Parameters for the File Converter jobs. Use this to specify aditional
|
|
5226
5288
|
* parameters for generating the geometry and properties of the new assembly. Can be given as command
|
|
5227
5289
|
* line arguments in form `--arg=value`.
|
|
5228
5290
|
* @param params.waitForDone - Wait for assembly to be created.
|
|
@@ -5468,7 +5530,7 @@
|
|
|
5468
5530
|
// By use of this software, its documentation or related materials, you
|
|
5469
5531
|
// acknowledge and accept the above terms.
|
|
5470
5532
|
///////////////////////////////////////////////////////////////////////////////
|
|
5471
|
-
const version = "26.
|
|
5533
|
+
const version = "26.6.0";
|
|
5472
5534
|
|
|
5473
5535
|
exports.Assembly = Assembly;
|
|
5474
5536
|
exports.ClashTest = ClashTest;
|