@inweb/client 26.5.2 → 26.5.4
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 +79 -58
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +13 -8
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Assembly.d.ts +1 -1
- package/lib/Api/Client.d.ts +28 -14
- package/lib/Api/File.d.ts +32 -32
- package/lib/Api/Job.d.ts +10 -3
- package/package.json +2 -2
- package/src/Api/Assembly.ts +1 -1
- package/src/Api/Client.ts +43 -21
- package/src/Api/File.ts +32 -32
- package/src/Api/Job.ts +10 -3
package/dist/client.js
CHANGED
|
@@ -907,7 +907,7 @@
|
|
|
907
907
|
/**
|
|
908
908
|
* Assembly geometry data type:
|
|
909
909
|
*
|
|
910
|
-
* - `vsfx` - `VSFX` format, assembly can be opened in `VisualizeJS` viewer.
|
|
910
|
+
* - `vsfx` - `VSFX` format, assembly can be opened in `VisualizeJS` 3D viewer.
|
|
911
911
|
*
|
|
912
912
|
* Returns an empty string if the geometry data is not yet ready.
|
|
913
913
|
*/
|
|
@@ -1977,8 +1977,15 @@
|
|
|
1977
1977
|
return this.data.lastUpdate;
|
|
1978
1978
|
}
|
|
1979
1979
|
/**
|
|
1980
|
-
* Job type. Can be
|
|
1981
|
-
*
|
|
1980
|
+
* Job type. Can be:
|
|
1981
|
+
*
|
|
1982
|
+
* - `geometry` - Convert file geometry data to `VSFX` format.
|
|
1983
|
+
* - `geometryGltf` - Convert file geometry data to `glTF` format.
|
|
1984
|
+
* - `properties` - Extract file properties.
|
|
1985
|
+
* - `validation` - Validate the IFC file.
|
|
1986
|
+
* - `clash` - Create the clash detection report.
|
|
1987
|
+
* - `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` - Export file to the specified format.
|
|
1988
|
+
* - Other custom job name.
|
|
1982
1989
|
*
|
|
1983
1990
|
* @readonly
|
|
1984
1991
|
*/
|
|
@@ -1986,7 +1993,7 @@
|
|
|
1986
1993
|
return this.data.outputFormat;
|
|
1987
1994
|
}
|
|
1988
1995
|
/**
|
|
1989
|
-
* Parameters with which the job
|
|
1996
|
+
* Parameters with which the job was started. For more information, see
|
|
1990
1997
|
* {@link https://cloud.opendesign.com/docs//pages/server/api.html#Jobs | Open Cloud Jobs API}.
|
|
1991
1998
|
*
|
|
1992
1999
|
* @readonly
|
|
@@ -2307,7 +2314,7 @@
|
|
|
2307
2314
|
/**
|
|
2308
2315
|
* Returns a list of file formats in which the active version of the file was exported.
|
|
2309
2316
|
*
|
|
2310
|
-
* To export file to one of the supported formats
|
|
2317
|
+
* To export file to one of the supported formats run the File Converter job using
|
|
2311
2318
|
* {@link createJob | createJob()}. To download exported file use
|
|
2312
2319
|
* {@link downloadResource | downloadResource()}.
|
|
2313
2320
|
*
|
|
@@ -2321,8 +2328,8 @@
|
|
|
2321
2328
|
/**
|
|
2322
2329
|
* Geometry data type of the active file version. Can be one of:
|
|
2323
2330
|
*
|
|
2324
|
-
* - `vsfx` - `VSFX` format, file can be opened in `VisualizeJS` viewer.
|
|
2325
|
-
* - `gltf` - `glTF` format, file can be opened in `Three.js` viewer.
|
|
2331
|
+
* - `vsfx` - `VSFX` format, file can be opened in `VisualizeJS` 3D viewer.
|
|
2332
|
+
* - `gltf` - `glTF` format, file can be opened in `Three.js` 3D viewer.
|
|
2326
2333
|
*
|
|
2327
2334
|
* Returns an empty string if geometry data has not yet been converted. A files without geometry data
|
|
2328
2335
|
* can be exported to other formas, but cannot be opened in viewer.
|
|
@@ -2687,15 +2694,15 @@
|
|
|
2687
2694
|
* Downloads a resource file of the active version of the file. Resource files are files that contain
|
|
2688
2695
|
* model scene descriptions, or geometry data, or exported files.
|
|
2689
2696
|
*
|
|
2690
|
-
* @example Export file to
|
|
2697
|
+
* @example Export file to PDF.
|
|
2691
2698
|
*
|
|
2692
2699
|
* ```javascript
|
|
2693
|
-
* const job = await file.
|
|
2700
|
+
* const job = await file.createJob("pdf");
|
|
2694
2701
|
* await job.waitForDone();
|
|
2695
|
-
* const
|
|
2696
|
-
* const arrayBuffer = await file.downloadResource(
|
|
2702
|
+
* const pdfResourceName = file.exports.find((x) => x.endsWith(".pdf"));
|
|
2703
|
+
* const arrayBuffer = await file.downloadResource(pdfResourceName);
|
|
2697
2704
|
* const blob = new Blob([arrayBuffer]);
|
|
2698
|
-
* const fileName = file.name + ".
|
|
2705
|
+
* const fileName = file.name + ".pdf";
|
|
2699
2706
|
* FileSaver.saveAs(blob, fileName);
|
|
2700
2707
|
* ```
|
|
2701
2708
|
*
|
|
@@ -2770,20 +2777,19 @@
|
|
|
2770
2777
|
/**
|
|
2771
2778
|
* Runs a new job on the server for the active version of the file.
|
|
2772
2779
|
*
|
|
2773
|
-
* @param outputFormat - The job type. Can be
|
|
2780
|
+
* @param outputFormat - The job type. Can be:
|
|
2774
2781
|
*
|
|
2775
|
-
* - `geometry` - Convert file geometry data to `VSFX` format
|
|
2776
|
-
* - `geometryGltf` - Convert file geometry data to `glTF` format
|
|
2782
|
+
* - `geometry` - Convert file geometry data to `VSFX` format for opening in `VisualizeJS` 3D viewer.
|
|
2783
|
+
* - `geometryGltf` - Convert file geometry data to `glTF` format for opening in `Three.js` 3D viewer.
|
|
2777
2784
|
* - `properties` - Extract file properties.
|
|
2778
|
-
* - `validation` - Validate the
|
|
2779
|
-
* - `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` - Export file to the
|
|
2780
|
-
*
|
|
2785
|
+
* - `validation` - Validate the IFC file.
|
|
2786
|
+
* - `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` - Export file to the specified format. Use
|
|
2787
|
+
* {@link exports} to get the list of completed file exports. Use
|
|
2781
2788
|
* {@link downloadResource | downloadResource()} to download the exported file.
|
|
2782
|
-
* - Other custom job name. Custom job
|
|
2783
|
-
* job.
|
|
2789
|
+
* - Other custom job name. Custom job must be registered in the job templates before running.
|
|
2784
2790
|
*
|
|
2785
|
-
* @param parameters - Parameters for the job
|
|
2786
|
-
*
|
|
2791
|
+
* @param parameters - Parameters for the File Converter tool or custom job application. Can be given
|
|
2792
|
+
* as command line arguments in form `--arg=value`.
|
|
2787
2793
|
*/
|
|
2788
2794
|
createJob(outputFormat, parameters) {
|
|
2789
2795
|
const jobs = new Endpoint("/jobs", this.httpClient, this.headers);
|
|
@@ -2797,38 +2803,38 @@
|
|
|
2797
2803
|
.then((data) => new Job(data, this.httpClient));
|
|
2798
2804
|
}
|
|
2799
2805
|
/**
|
|
2800
|
-
* Runs a job to convert geometry data of active version of the file
|
|
2801
|
-
* {@link createJob | createJob("geometry")}.
|
|
2806
|
+
* Runs a File Converter job to convert geometry data of active version of the file to the specified
|
|
2807
|
+
* format. This is alias to {@link createJob | createJob("geometry")}.
|
|
2802
2808
|
*
|
|
2803
2809
|
* @param type - Geometry data type. Can be one of:
|
|
2804
2810
|
*
|
|
2805
|
-
* - `vsfx` - `VSFX` format (default), for opening a file in `VisualizeJS` viewer.
|
|
2806
|
-
* - `gltf` - `glTF` format, for opening a file in `Three.js` viewer.
|
|
2811
|
+
* - `vsfx` - `VSFX` format (default), for opening a file in `VisualizeJS` 3D viewer.
|
|
2812
|
+
* - `gltf` - `glTF` format, for opening a file in `Three.js` 3D viewer.
|
|
2807
2813
|
*
|
|
2808
|
-
* @param parameters - Parameters for the
|
|
2809
|
-
*
|
|
2814
|
+
* @param parameters - Parameters for the File Converter tool. Can be given as command line arguments
|
|
2815
|
+
* in form `--arg=value`.
|
|
2810
2816
|
*/
|
|
2811
2817
|
extractGeometry(type, parameters) {
|
|
2812
2818
|
return this.createJob(type === "gltf" ? "geometryGltf" : "geometry", parameters);
|
|
2813
2819
|
}
|
|
2814
2820
|
/**
|
|
2815
|
-
* Runs a job to extract properties of the active version of the file. This is alias to
|
|
2821
|
+
* Runs a File Converter job to extract properties of the active version of the file. This is alias to
|
|
2816
2822
|
* {@link createJob | createJob("properties")}.
|
|
2817
2823
|
*
|
|
2818
|
-
* @param parameters - Parameters for the
|
|
2819
|
-
*
|
|
2824
|
+
* @param parameters - Parameters for the File Converter tool. Can be given as command line arguments
|
|
2825
|
+
* in form `--arg=value`.
|
|
2820
2826
|
*/
|
|
2821
2827
|
extractProperties(parameters) {
|
|
2822
2828
|
return this.createJob("properties", parameters);
|
|
2823
2829
|
}
|
|
2824
2830
|
/**
|
|
2825
|
-
* Runs
|
|
2831
|
+
* Runs an IFC validator job to validate the active version of the file. This is alias to
|
|
2826
2832
|
* {@link createJob | createJob("validation")}.
|
|
2827
2833
|
*
|
|
2828
2834
|
* To get validation report use {@link downloadResource | downloadResource("validation_report.json")}.
|
|
2829
2835
|
*
|
|
2830
|
-
* @param parameters - Parameters for the
|
|
2831
|
-
*
|
|
2836
|
+
* @param parameters - Parameters for the IFC validator tool. Can be given as command line arguments in
|
|
2837
|
+
* form `--arg=value`.
|
|
2832
2838
|
*/
|
|
2833
2839
|
validate(parameters) {
|
|
2834
2840
|
return this.createJob("validation", parameters);
|
|
@@ -2837,8 +2843,9 @@
|
|
|
2837
2843
|
* Waits for jobs of the active version of the file to be done. Job is done when it changes to `none`,
|
|
2838
2844
|
* `done` or `failed` status.
|
|
2839
2845
|
*
|
|
2840
|
-
* @param jobs - Job or job
|
|
2841
|
-
* `validation`, `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` or custom job
|
|
2846
|
+
* @param jobs - Job name or array of job names to wait on. Can be `geometry`, `geometryGltf`,
|
|
2847
|
+
* `properties`, `validation`, `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` or custom job
|
|
2848
|
+
* name.
|
|
2842
2849
|
* @param waitAll - If this parameter is `true`, the function returns when all the specified jobs have
|
|
2843
2850
|
* done. If `false`, the function returns when any one of the jobs are done.
|
|
2844
2851
|
* @param params - An object containing waiting parameters.
|
|
@@ -4562,7 +4569,7 @@
|
|
|
4562
4569
|
.then((data) => ({
|
|
4563
4570
|
...data,
|
|
4564
4571
|
server: data.version,
|
|
4565
|
-
client: "26.5.
|
|
4572
|
+
client: "26.5.4",
|
|
4566
4573
|
}));
|
|
4567
4574
|
}
|
|
4568
4575
|
/**
|
|
@@ -4971,13 +4978,17 @@
|
|
|
4971
4978
|
* generally retrieved from a {@link https://developer.mozilla.org/docs/Web/API/FileList | FileList}
|
|
4972
4979
|
* object returned as a result of a user selecting files using the HTML `<input>` element.
|
|
4973
4980
|
* @param params - An object containing upload parameters.
|
|
4974
|
-
* @param params.geometry -
|
|
4981
|
+
* @param params.geometry - Run File Converter job to convert geometry data after uploading the file.
|
|
4982
|
+
* Can be:
|
|
4975
4983
|
*
|
|
4976
|
-
* - `true` - Convert file geometry data to `VSFX` format
|
|
4977
|
-
* - `vsfx` - Convert file geometry data to `VSFX` format
|
|
4978
|
-
* - `gltf` - Convert file geometry data to `glTF` format
|
|
4984
|
+
* - `true` - Convert file geometry data to `VSFX` format for opening in `VisualizeJS` 3D viewer.
|
|
4985
|
+
* - `vsfx` - Convert file geometry data to `VSFX` format for opening in `VisualizeJS` 3D viewer.
|
|
4986
|
+
* - `gltf` - Convert file geometry data to `glTF` format for opening in `Three.js` 3D viewer.
|
|
4979
4987
|
*
|
|
4980
|
-
* @param params.properties -
|
|
4988
|
+
* @param params.properties - Run File Converter job to extract properties after uploading the file.
|
|
4989
|
+
* @param params.jobParameters - Parameters for the File Converter tool. Use this to specify aditional
|
|
4990
|
+
* parameters for retrieving the geometry and properties of uploaded file. Can be given as command
|
|
4991
|
+
* line arguments in form `--arg=value`.
|
|
4981
4992
|
* @param params.waitForDone - Wait for geometry and properties jobs to complete.
|
|
4982
4993
|
* @param params.timeout - The time, in milliseconds that the function should wait jobs. If no one jobs
|
|
4983
4994
|
* are done during this time, the `TimeoutError` exception will be thrown.
|
|
@@ -5002,11 +5013,12 @@
|
|
|
5002
5013
|
.then((xhr) => JSON.parse(xhr.responseText))
|
|
5003
5014
|
.then((data) => new File(data, this.httpClient));
|
|
5004
5015
|
const geometryType = typeof params.geometry === "string" ? params.geometry : "vsfx";
|
|
5016
|
+
const jobParameters = params.jobParameters || {};
|
|
5005
5017
|
const jobs = [];
|
|
5006
5018
|
if (params.geometry)
|
|
5007
|
-
jobs.push((await result.extractGeometry(geometryType)).outputFormat);
|
|
5019
|
+
jobs.push((await result.extractGeometry(geometryType, jobParameters.geometry)).outputFormat);
|
|
5008
5020
|
if (params.properties)
|
|
5009
|
-
jobs.push((await result.extractProperties()).outputFormat);
|
|
5021
|
+
jobs.push((await result.extractProperties(jobParameters.properties)).outputFormat);
|
|
5010
5022
|
if (jobs.length > 0)
|
|
5011
5023
|
if (params.waitForDone)
|
|
5012
5024
|
await result.waitForDone(jobs, true, params);
|
|
@@ -5105,18 +5117,17 @@
|
|
|
5105
5117
|
* Runs a new job on the server for the sepecified file.
|
|
5106
5118
|
*
|
|
5107
5119
|
* @param fileId - File ID.
|
|
5108
|
-
* @param outputFormat - The job type. Can be
|
|
5120
|
+
* @param outputFormat - The job type. Can be:
|
|
5109
5121
|
*
|
|
5110
|
-
* - `geometry` - Convert file geometry data to `VSFX` format
|
|
5111
|
-
* - `geometryGltf` - Convert file geometry data to `glTF` format
|
|
5122
|
+
* - `geometry` - Convert file geometry data to `VSFX` format for opening in `VisualizeJS` 3D viewer.
|
|
5123
|
+
* - `geometryGltf` - Convert file geometry data to `glTF` format for opening in `Three.js` 3D viewer.
|
|
5112
5124
|
* - `properties` - Extract file properties.
|
|
5113
|
-
* - `validation` - Validate the
|
|
5114
|
-
* - `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` - Export file to the
|
|
5115
|
-
* - Other custom job name. Custom job
|
|
5116
|
-
* creating a job.
|
|
5125
|
+
* - `validation` - Validate the IFC file.
|
|
5126
|
+
* - `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` - Export file to the specified format.
|
|
5127
|
+
* - Other custom job name. Custom job must be registered in the job templates before running.
|
|
5117
5128
|
*
|
|
5118
|
-
* @param parameters - Parameters for the job
|
|
5119
|
-
*
|
|
5129
|
+
* @param parameters - Parameters for the File Converter tool or custom job application. Can be given
|
|
5130
|
+
* as command line arguments in form `--arg=value`.
|
|
5120
5131
|
*/
|
|
5121
5132
|
createJob(fileId, outputFormat, parameters) {
|
|
5122
5133
|
return this.httpClient
|
|
@@ -5211,6 +5222,9 @@
|
|
|
5211
5222
|
* @param files - List of file IDs.
|
|
5212
5223
|
* @param name - Assembly name.
|
|
5213
5224
|
* @param params - Additional assembly creating parameters.
|
|
5225
|
+
* @param params.jobParameters - Parameters for the File Converter tool. Use this to specify aditional
|
|
5226
|
+
* parameters for generating the geometry and properties of the new assembly. Can be given as command
|
|
5227
|
+
* line arguments in form `--arg=value`.
|
|
5214
5228
|
* @param params.waitForDone - Wait for assembly to be created.
|
|
5215
5229
|
* @param params.timeout - The time, in milliseconds, that the function should wait for the assembly to
|
|
5216
5230
|
* be created. If the assembly is not created within this time, a TimeoutError exception will be
|
|
@@ -5222,13 +5236,20 @@
|
|
|
5222
5236
|
* can be used to abort waiting as desired.
|
|
5223
5237
|
* @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.
|
|
5224
5238
|
*/
|
|
5225
|
-
createAssembly(files, name, params) {
|
|
5226
|
-
const
|
|
5239
|
+
createAssembly(files, name, params = {}) {
|
|
5240
|
+
const jobParameters = params.jobParameters || {};
|
|
5227
5241
|
return this.httpClient
|
|
5228
|
-
.post("/assemblies", {
|
|
5242
|
+
.post("/assemblies", {
|
|
5243
|
+
name,
|
|
5244
|
+
files,
|
|
5245
|
+
jobParameters: {
|
|
5246
|
+
geometry: parseArgs(jobParameters.geometry),
|
|
5247
|
+
properties: parseArgs(jobParameters.properties),
|
|
5248
|
+
},
|
|
5249
|
+
})
|
|
5229
5250
|
.then((response) => response.json())
|
|
5230
5251
|
.then((data) => new Assembly(data, this.httpClient))
|
|
5231
|
-
.then((result) => (waitForDone ? result.waitForDone(params) : result));
|
|
5252
|
+
.then((result) => (params.waitForDone ? result.waitForDone(params) : result));
|
|
5232
5253
|
}
|
|
5233
5254
|
/**
|
|
5234
5255
|
* Deletes the specified assembly from the server.
|
|
@@ -5447,7 +5468,7 @@
|
|
|
5447
5468
|
// By use of this software, its documentation or related materials, you
|
|
5448
5469
|
// acknowledge and accept the above terms.
|
|
5449
5470
|
///////////////////////////////////////////////////////////////////////////////
|
|
5450
|
-
const version = "26.5.
|
|
5471
|
+
const version = "26.5.4";
|
|
5451
5472
|
|
|
5452
5473
|
exports.Assembly = Assembly;
|
|
5453
5474
|
exports.ClashTest = ClashTest;
|