@inweb/client 25.8.16 → 25.8.19
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/README.md +33 -12
- package/dist/client.js +378 -337
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +13 -5
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Assembly.d.ts +63 -61
- package/lib/Api/ClashTest.d.ts +29 -27
- package/lib/Api/Client.d.ts +85 -76
- package/lib/Api/ClientEvents.d.ts +1 -1
- package/lib/Api/File.d.ts +95 -73
- package/lib/Api/IAssembly.d.ts +26 -0
- package/lib/Api/Job.d.ts +7 -8
- package/lib/Api/Member.d.ts +9 -8
- package/lib/Api/Model.d.ts +19 -15
- package/lib/Api/Permission.d.ts +15 -15
- package/lib/Api/Project.d.ts +31 -23
- package/lib/Api/Role.d.ts +9 -8
- package/lib/Api/User.d.ts +21 -20
- package/lib/index.d.ts +1 -0
- package/package.json +2 -2
- package/src/Api/Assembly.ts +63 -62
- package/src/Api/ClashTest.ts +40 -29
- package/src/Api/Client.ts +89 -77
- package/src/Api/ClientEvents.ts +1 -1
- package/src/Api/File.ts +94 -72
- package/src/Api/IAssembly.ts +27 -0
- package/src/Api/Job.ts +9 -13
- package/src/Api/Member.ts +9 -8
- package/src/Api/Model.ts +19 -15
- package/src/Api/Permission.ts +15 -15
- package/src/Api/Project.ts +31 -23
- package/src/Api/Role.ts +9 -8
- package/src/Api/User.ts +21 -20
- package/src/index.ts +1 -0
package/dist/client.js
CHANGED
|
@@ -144,13 +144,13 @@
|
|
|
144
144
|
// acknowledge and accept the above terms.
|
|
145
145
|
///////////////////////////////////////////////////////////////////////////////
|
|
146
146
|
/**
|
|
147
|
-
*
|
|
147
|
+
* Provides properties and methods for working with view of the file or assembly. For example,
|
|
148
148
|
* for `dwg` it is a `Model` space or layout, and for `rvt` files it is a `3D` view.
|
|
149
149
|
*/
|
|
150
150
|
class Model {
|
|
151
151
|
/**
|
|
152
|
-
* @param data -
|
|
153
|
-
* @param file - The
|
|
152
|
+
* @param data - Raw model data received from the server.
|
|
153
|
+
* @param file - The file/assembly instance that owns the model.
|
|
154
154
|
*/
|
|
155
155
|
constructor(data, file) {
|
|
156
156
|
this.path = `${file.path}/downloads`;
|
|
@@ -263,16 +263,16 @@
|
|
|
263
263
|
return this.file.getModelTransformMatrix(handle);
|
|
264
264
|
}
|
|
265
265
|
/**
|
|
266
|
-
*
|
|
266
|
+
* Sets or removes a model transformation.
|
|
267
267
|
*
|
|
268
268
|
* @param handle - Model handle.
|
|
269
|
-
* @param transform - Transformation matrix.
|
|
269
|
+
* @param transform - Transformation matrix. Specify `undefined` to remove transformation.
|
|
270
270
|
*/
|
|
271
271
|
setModelTransformMatrix(handle, transform) {
|
|
272
272
|
return this.file.setModelTransformMatrix(handle, transform).then(() => this);
|
|
273
273
|
}
|
|
274
274
|
/**
|
|
275
|
-
* Returns
|
|
275
|
+
* Returns a list of viewpoints of the owner file/assembly.
|
|
276
276
|
*/
|
|
277
277
|
getViewpoints() {
|
|
278
278
|
return this._file
|
|
@@ -280,7 +280,8 @@
|
|
|
280
280
|
.then((array) => array.filter(({ custom_fields = {} }) => custom_fields.modelId === this.id || custom_fields.modelName === this.name));
|
|
281
281
|
}
|
|
282
282
|
/**
|
|
283
|
-
*
|
|
283
|
+
* Adds a new viewpoint to the owner file/assembly. To create a new viewpoint use
|
|
284
|
+
* `Viewer.createViewpoint()`.
|
|
284
285
|
*
|
|
285
286
|
* @param viewpoint - Viewpoint.
|
|
286
287
|
*/
|
|
@@ -291,7 +292,7 @@
|
|
|
291
292
|
});
|
|
292
293
|
}
|
|
293
294
|
/**
|
|
294
|
-
*
|
|
295
|
+
* Deletes the specified viewpoint from the owner file/assembly.
|
|
295
296
|
*
|
|
296
297
|
* @param guid - Viewpoint GUID.
|
|
297
298
|
* @returns Returns the raw data of a deleted viewpoint.
|
|
@@ -309,7 +310,7 @@
|
|
|
309
310
|
return this._file.getSnapshot(guid);
|
|
310
311
|
}
|
|
311
312
|
/**
|
|
312
|
-
* Returns snapshot data.
|
|
313
|
+
* Returns viewpoint snapshot data.
|
|
313
314
|
*
|
|
314
315
|
* @param guid - Viewpoint GUID.
|
|
315
316
|
* @param bitmapGuid - Bitmap GUID.
|
|
@@ -318,8 +319,8 @@
|
|
|
318
319
|
return this._file.getSnapshotData(guid, bitmapGuid);
|
|
319
320
|
}
|
|
320
321
|
/**
|
|
321
|
-
*
|
|
322
|
-
*
|
|
322
|
+
* Downloads a resource file. Resource files are files that contain model scene descriptions,
|
|
323
|
+
* or geometry data.
|
|
323
324
|
*
|
|
324
325
|
* @param dataId - Resource file name.
|
|
325
326
|
* @param onProgress - Download progress callback.
|
|
@@ -331,7 +332,7 @@
|
|
|
331
332
|
return this._file.downloadResource(dataId, onProgress, signal);
|
|
332
333
|
}
|
|
333
334
|
/**
|
|
334
|
-
*
|
|
335
|
+
* Downloads a part of resource file. Resource files are files that contain model scene
|
|
335
336
|
* descriptions, or geometry data.
|
|
336
337
|
*
|
|
337
338
|
* @param dataId - Resource file name.
|
|
@@ -380,7 +381,9 @@
|
|
|
380
381
|
await this.downloadResourceRange(dataId, requestId, ranges, onProgress, signal);
|
|
381
382
|
}
|
|
382
383
|
/**
|
|
383
|
-
* Returns a list of references
|
|
384
|
+
* Returns a list of references of the owner file/assembly.
|
|
385
|
+
*
|
|
386
|
+
* References are images, fonts, or any other files to correct rendering of the file.
|
|
384
387
|
*
|
|
385
388
|
* @param signal - An
|
|
386
389
|
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
@@ -481,13 +484,13 @@
|
|
|
481
484
|
|
|
482
485
|
///////////////////////////////////////////////////////////////////////////////
|
|
483
486
|
/**
|
|
484
|
-
*
|
|
487
|
+
* Provides properties and methods for obtaining information about a file/assembly clash detection test.
|
|
485
488
|
*/
|
|
486
489
|
class ClashTest {
|
|
487
490
|
/**
|
|
488
|
-
* @param data - Raw test data.
|
|
489
|
-
* @param basePath -
|
|
490
|
-
* @param httpClient -
|
|
491
|
+
* @param data - Raw test data received from the server.
|
|
492
|
+
* @param basePath - The clash test API base path of the file/assembly that owns the test.
|
|
493
|
+
* @param httpClient - HTTP client instance used to send REST API requests to the server.
|
|
491
494
|
*/
|
|
492
495
|
constructor(data, basePath, httpClient) {
|
|
493
496
|
this.httpClient = httpClient;
|
|
@@ -506,10 +509,10 @@
|
|
|
506
509
|
/**
|
|
507
510
|
* The type of the clashes that the test detects:
|
|
508
511
|
*
|
|
509
|
-
* -
|
|
510
|
-
*
|
|
511
|
-
* - `
|
|
512
|
-
*
|
|
512
|
+
* - `true` - Сlearance clash. A clash in which the object A may or may not intersect with
|
|
513
|
+
* object B, but comes within a distance of less than the {@link tolerance}.
|
|
514
|
+
* - `false` - Hard clash. A clash in which the object A intersects with object B by a distance
|
|
515
|
+
* of more than the {@link tolerance}.
|
|
513
516
|
*
|
|
514
517
|
* @readonly
|
|
515
518
|
*/
|
|
@@ -582,8 +585,8 @@
|
|
|
582
585
|
return this.data.owner;
|
|
583
586
|
}
|
|
584
587
|
/**
|
|
585
|
-
* First selection set for clash detection.
|
|
586
|
-
* against each others by
|
|
588
|
+
* First selection set for clash detection. Objects from `selectionSetA` will be tested
|
|
589
|
+
* against each others by objects from the `selectionSetB` during the test.
|
|
587
590
|
*
|
|
588
591
|
* @readonly
|
|
589
592
|
*/
|
|
@@ -593,10 +596,10 @@
|
|
|
593
596
|
/**
|
|
594
597
|
* The type of first selection set for clash detection. Can be one of:
|
|
595
598
|
*
|
|
596
|
-
* - `all` - All file/assembly
|
|
597
|
-
* - `handle` -
|
|
598
|
-
* - `models` -
|
|
599
|
-
* - `searchquery` -
|
|
599
|
+
* - `all` - All file/assembly objects.
|
|
600
|
+
* - `handle` - Objects with original handles specified in the `selectionSetA`.
|
|
601
|
+
* - `models` - All objects of the models with original handles specified in the `selectionSetA`.
|
|
602
|
+
* - `searchquery` - Objects retrieved by the search queries specified in `selectionSetA`.
|
|
600
603
|
*
|
|
601
604
|
* @readonly
|
|
602
605
|
*/
|
|
@@ -604,8 +607,8 @@
|
|
|
604
607
|
return this.data.selectionTypeA;
|
|
605
608
|
}
|
|
606
609
|
/**
|
|
607
|
-
* Second selection set for clash detection.
|
|
608
|
-
* against each others by
|
|
610
|
+
* Second selection set for clash detection. Objects from `selectionSetB` will be tested
|
|
611
|
+
* against each others by objects from the `selectionSetA` during the test.
|
|
609
612
|
*
|
|
610
613
|
* @readonly
|
|
611
614
|
*/
|
|
@@ -615,10 +618,10 @@
|
|
|
615
618
|
/**
|
|
616
619
|
* The type of second selection set for clash detection. Can be one of:
|
|
617
620
|
*
|
|
618
|
-
* - `all` - All file/assembly
|
|
619
|
-
* - `handle` -
|
|
620
|
-
* - `models` -
|
|
621
|
-
* - `searchquery` -
|
|
621
|
+
* - `all` - All file/assembly objects.
|
|
622
|
+
* - `handle` - Objects with original handles specified in the `selectionSetB`.
|
|
623
|
+
* - `models` - All objects of the models with original handles specified in the `selectionSetB`.
|
|
624
|
+
* - `searchquery` - Objects retrieved by the search queries specified in `selectionSetB`.
|
|
622
625
|
*
|
|
623
626
|
* @readonly
|
|
624
627
|
*/
|
|
@@ -634,7 +637,7 @@
|
|
|
634
637
|
return this.data.status;
|
|
635
638
|
}
|
|
636
639
|
/**
|
|
637
|
-
* The distance of separation between
|
|
640
|
+
* The distance of separation between objects at which test begins detecting clashes.
|
|
638
641
|
*
|
|
639
642
|
* @readonly
|
|
640
643
|
*/
|
|
@@ -642,7 +645,7 @@
|
|
|
642
645
|
return this.data.tolerance;
|
|
643
646
|
}
|
|
644
647
|
/**
|
|
645
|
-
*
|
|
648
|
+
* Reloads test data from the server.
|
|
646
649
|
*/
|
|
647
650
|
async checkout() {
|
|
648
651
|
const response = await this.internalGet("");
|
|
@@ -650,7 +653,7 @@
|
|
|
650
653
|
return this;
|
|
651
654
|
}
|
|
652
655
|
/**
|
|
653
|
-
*
|
|
656
|
+
* Updates test data on the server.
|
|
654
657
|
*
|
|
655
658
|
* @param data - Raw test data.
|
|
656
659
|
*/
|
|
@@ -660,7 +663,7 @@
|
|
|
660
663
|
return this;
|
|
661
664
|
}
|
|
662
665
|
/**
|
|
663
|
-
*
|
|
666
|
+
* Deletes a test and its results report from the server.
|
|
664
667
|
*
|
|
665
668
|
* @returns Returns the raw data of a deleted test.
|
|
666
669
|
*/
|
|
@@ -668,14 +671,14 @@
|
|
|
668
671
|
return this.internalDelete("").then((response) => response.json());
|
|
669
672
|
}
|
|
670
673
|
/**
|
|
671
|
-
*
|
|
672
|
-
* after any changes.
|
|
674
|
+
* Saves test properties changes to the server. Call this method to update test data on the
|
|
675
|
+
* server after any property changes.
|
|
673
676
|
*/
|
|
674
677
|
save() {
|
|
675
678
|
return this.update(this.data);
|
|
676
679
|
}
|
|
677
680
|
/**
|
|
678
|
-
*
|
|
681
|
+
* Waits for test to complete. Test is done when it changes to `done` or `failed` status.
|
|
679
682
|
*
|
|
680
683
|
* @param params - An object containing waiting parameters.
|
|
681
684
|
* @param params.timeout - The time, in milliseconds that the function should wait test. If
|
|
@@ -685,9 +688,15 @@
|
|
|
685
688
|
* @param params.signal - An
|
|
686
689
|
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
687
690
|
* signal, which can be used to abort waiting as desired.
|
|
691
|
+
* @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.
|
|
688
692
|
*/
|
|
689
693
|
waitForDone(params) {
|
|
690
|
-
const checkDone = () => this.checkout().then((test) =>
|
|
694
|
+
const checkDone = () => this.checkout().then((test) => {
|
|
695
|
+
var _a;
|
|
696
|
+
const ready = ["done", "failed"].includes(test.status);
|
|
697
|
+
const cancel = (_a = params === null || params === void 0 ? void 0 : params.onCheckout) === null || _a === void 0 ? void 0 : _a.call(params, test, ready);
|
|
698
|
+
return cancel || ready;
|
|
699
|
+
});
|
|
691
700
|
return waitFor(checkDone, params).then(() => this);
|
|
692
701
|
}
|
|
693
702
|
/**
|
|
@@ -700,12 +709,13 @@
|
|
|
700
709
|
|
|
701
710
|
///////////////////////////////////////////////////////////////////////////////
|
|
702
711
|
/**
|
|
703
|
-
*
|
|
712
|
+
* Provides properties and methods for obtaining information about an assembly on the server
|
|
713
|
+
* and managing its data.
|
|
704
714
|
*/
|
|
705
715
|
class Assembly {
|
|
706
716
|
/**
|
|
707
|
-
* @param data -
|
|
708
|
-
* @param httpClient -
|
|
717
|
+
* @param data - Raw assembly data received from the server.
|
|
718
|
+
* @param httpClient - HTTP client instance used to send REST API requests to the server.
|
|
709
719
|
*/
|
|
710
720
|
constructor(data, httpClient) {
|
|
711
721
|
this.path = `/assemblies/${data.id}`;
|
|
@@ -785,9 +795,9 @@
|
|
|
785
795
|
/**
|
|
786
796
|
* Assembly geometry data type:
|
|
787
797
|
*
|
|
788
|
-
* - `vsfx` - VSFX, assembly can be opened in `VisualizeJS` viewer.
|
|
798
|
+
* - `vsfx` - `VSFX` format, assembly can be opened in `VisualizeJS` viewer.
|
|
789
799
|
*
|
|
790
|
-
* Returns an empty string if geometry data
|
|
800
|
+
* Returns an empty string if the geometry data is not yet ready.
|
|
791
801
|
*/
|
|
792
802
|
get geometryType() {
|
|
793
803
|
return this.status === "done" ? "vsfx" : "";
|
|
@@ -867,7 +877,7 @@
|
|
|
867
877
|
return this.data.versions;
|
|
868
878
|
}
|
|
869
879
|
/**
|
|
870
|
-
*
|
|
880
|
+
* Reloads assembly data from the server.
|
|
871
881
|
*/
|
|
872
882
|
async checkout() {
|
|
873
883
|
const response = await this.internalGet("");
|
|
@@ -885,7 +895,7 @@
|
|
|
885
895
|
return this;
|
|
886
896
|
}
|
|
887
897
|
/**
|
|
888
|
-
*
|
|
898
|
+
* Deletes an assembly from the server.
|
|
889
899
|
*
|
|
890
900
|
* @returns Returns the raw data of a deleted assembly.
|
|
891
901
|
*/
|
|
@@ -893,8 +903,8 @@
|
|
|
893
903
|
return this.internalDelete("").then((response) => response.json());
|
|
894
904
|
}
|
|
895
905
|
/**
|
|
896
|
-
*
|
|
897
|
-
* server after any changes.
|
|
906
|
+
* Saves assembly properties changes to the server. Call this method to update assembly data
|
|
907
|
+
* on the server after any property changes.
|
|
898
908
|
*/
|
|
899
909
|
save() {
|
|
900
910
|
return this.update(this.data);
|
|
@@ -916,35 +926,19 @@
|
|
|
916
926
|
.then((response) => response.json())
|
|
917
927
|
.then((array) => array.map((data) => new Model(data, this)));
|
|
918
928
|
}
|
|
919
|
-
/**
|
|
920
|
-
* Transformation matrix.
|
|
921
|
-
*
|
|
922
|
-
* @typedef {any} Transform
|
|
923
|
-
* @property {any} translate - Translation part, move along the X, Y, Z axes.
|
|
924
|
-
* @property {number} translate.x - The value for substruct for X axes.
|
|
925
|
-
* @property {number} translate.y - The value for substruct for Y axes.
|
|
926
|
-
* @property {number} translate.z - The value for substruct for Z axes.
|
|
927
|
-
* @property {any} rotation - Rotation part, rotate by the specified angle, around the
|
|
928
|
-
* specified vector.
|
|
929
|
-
* @property {number} rotation.x - X coordinate of the rotation vector.
|
|
930
|
-
* @property {number} rotation.y - Y coordinate of the rotation vector.
|
|
931
|
-
* @property {number} rotation.z - Z coordinate of the rotation vector.
|
|
932
|
-
* @property {number} rotation.angle - The angle of rotation.
|
|
933
|
-
* @property {number} scale - Scaling part, scale with multiplier, from center of extends.
|
|
934
|
-
*/
|
|
935
929
|
/**
|
|
936
930
|
* Returns a model transformation.
|
|
937
931
|
*
|
|
938
|
-
* @param handle - Model handle.
|
|
932
|
+
* @param handle - Model original handle.
|
|
939
933
|
*/
|
|
940
934
|
getModelTransformMatrix(handle) {
|
|
941
935
|
return this.data.transform[handle];
|
|
942
936
|
}
|
|
943
937
|
/**
|
|
944
|
-
*
|
|
938
|
+
* Sets or removes a model transformation.
|
|
945
939
|
*
|
|
946
|
-
* @param handle - Model handle.
|
|
947
|
-
* @param transform - Transformation matrix.
|
|
940
|
+
* @param handle - Model original handle.
|
|
941
|
+
* @param transform - Transformation matrix. Specify `undefined` to remove transformation.
|
|
948
942
|
*/
|
|
949
943
|
setModelTransformMatrix(handle, transform) {
|
|
950
944
|
const obj = { ...this.data.transform };
|
|
@@ -954,8 +948,8 @@
|
|
|
954
948
|
/**
|
|
955
949
|
* Returns the properties for an objects in the assembly.
|
|
956
950
|
*
|
|
957
|
-
* @param handles - Object original handle or handles array.
|
|
958
|
-
*
|
|
951
|
+
* @param handles - Object original handle or handles array. Specify `undefined` to get
|
|
952
|
+
* properties for all objects in the assembly.
|
|
959
953
|
* @returns {Promise<any>}
|
|
960
954
|
*/
|
|
961
955
|
getProperties(handles) {
|
|
@@ -991,7 +985,7 @@
|
|
|
991
985
|
return this.internalPost("/properties/search", searchPattern).then((response) => response.json());
|
|
992
986
|
}
|
|
993
987
|
/**
|
|
994
|
-
* Returns the
|
|
988
|
+
* Returns the CDA tree for an assembly.
|
|
995
989
|
*/
|
|
996
990
|
getCdaTree() {
|
|
997
991
|
return this.internalGet(`/properties/tree`).then((response) => response.json());
|
|
@@ -1005,7 +999,7 @@
|
|
|
1005
999
|
.then((viewpoints) => viewpoints.result);
|
|
1006
1000
|
}
|
|
1007
1001
|
/**
|
|
1008
|
-
*
|
|
1002
|
+
* Adds a new viewpoint to the assembly. To create a viewpoint use `Viewer.createViewpoint()`.
|
|
1009
1003
|
*
|
|
1010
1004
|
* @param viewpoint - Viewpoint.
|
|
1011
1005
|
*/
|
|
@@ -1013,7 +1007,7 @@
|
|
|
1013
1007
|
return this.internalPost("/viewpoints", viewpoint).then((response) => response.json());
|
|
1014
1008
|
}
|
|
1015
1009
|
/**
|
|
1016
|
-
*
|
|
1010
|
+
* Deletes the specified assembly viewpoint.
|
|
1017
1011
|
*
|
|
1018
1012
|
* @param guid - Viewpoint GUID.
|
|
1019
1013
|
* @returns Returns the raw data of a deleted viewpoint.
|
|
@@ -1040,7 +1034,7 @@
|
|
|
1040
1034
|
return this.internalGet(`/viewpoints/${guid}/bitmaps/${bitmapGuid}`).then((response) => response.text());
|
|
1041
1035
|
}
|
|
1042
1036
|
/**
|
|
1043
|
-
*
|
|
1037
|
+
* Downloads an assembly resource file. Resource files are files that contain model scene
|
|
1044
1038
|
* descriptions, or geometry data.
|
|
1045
1039
|
*
|
|
1046
1040
|
* @param dataId - Resource file name.
|
|
@@ -1056,7 +1050,7 @@
|
|
|
1056
1050
|
.then((response) => response.arrayBuffer());
|
|
1057
1051
|
}
|
|
1058
1052
|
/**
|
|
1059
|
-
*
|
|
1053
|
+
* Downloads a part of assembly resource file. Resource files are files that contain model
|
|
1060
1054
|
* scene descriptions, or geometry data.
|
|
1061
1055
|
*
|
|
1062
1056
|
* @param dataId - Resource file name.
|
|
@@ -1093,7 +1087,7 @@
|
|
|
1093
1087
|
return Promise.resolve({ fileId: "", references: [] });
|
|
1094
1088
|
}
|
|
1095
1089
|
/**
|
|
1096
|
-
*
|
|
1090
|
+
* Waits for assembly to be created. Assembly is created when it changes to `done` or `failed` status.
|
|
1097
1091
|
*
|
|
1098
1092
|
* @param params - An object containing waiting parameters.
|
|
1099
1093
|
* @param params.timeout - The time, in milliseconds that the function should wait assembly.
|
|
@@ -1117,15 +1111,13 @@
|
|
|
1117
1111
|
/**
|
|
1118
1112
|
* Returns a list of assembly clash tests.
|
|
1119
1113
|
*
|
|
1120
|
-
* @param
|
|
1121
|
-
* @param
|
|
1122
|
-
*
|
|
1123
|
-
* @param
|
|
1124
|
-
* @param
|
|
1125
|
-
*
|
|
1126
|
-
* @param
|
|
1127
|
-
* default tests are sorted by name in ascending order.
|
|
1128
|
-
* @param {string} sortField - Allows to specify sort field.
|
|
1114
|
+
* @param start - The starting index in the test list. Used for paging.
|
|
1115
|
+
* @param limit - The maximum number of tests that should be returned per request. Used for paging.
|
|
1116
|
+
* @param name - Filter the tests by part of the name. Case sensitive.
|
|
1117
|
+
* @param ids - List of tests IDs to return.
|
|
1118
|
+
* @param sortByDesc - Allows to specify the descending order of the result. By default tests
|
|
1119
|
+
* are sorted by name in ascending order.
|
|
1120
|
+
* @param sortField - Allows to specify sort field.
|
|
1129
1121
|
*/
|
|
1130
1122
|
getClashTests(start, limit, name, ids, sortByDesc, sortField) {
|
|
1131
1123
|
const searchParams = new URLSearchParams();
|
|
@@ -1160,7 +1152,7 @@
|
|
|
1160
1152
|
});
|
|
1161
1153
|
}
|
|
1162
1154
|
/**
|
|
1163
|
-
* Returns the assembly clash test
|
|
1155
|
+
* Returns information about the specified assembly clash test.
|
|
1164
1156
|
*
|
|
1165
1157
|
* @param testId - Test ID.
|
|
1166
1158
|
*/
|
|
@@ -1170,20 +1162,39 @@
|
|
|
1170
1162
|
.then((data) => new ClashTest(data, this.path, this.httpClient));
|
|
1171
1163
|
}
|
|
1172
1164
|
/**
|
|
1173
|
-
*
|
|
1165
|
+
* Creates an assembly clash test. Assembly must be in a `done` state, otherwise the test will fail.
|
|
1174
1166
|
*
|
|
1175
1167
|
* @param name - Test name.
|
|
1176
|
-
* @param selectionTypeA - The type of first selection set for clash detection. Can be
|
|
1177
|
-
*
|
|
1178
|
-
*
|
|
1179
|
-
* `
|
|
1180
|
-
*
|
|
1181
|
-
*
|
|
1168
|
+
* @param selectionTypeA - The type of first selection set for clash detection. Can be one of:
|
|
1169
|
+
*
|
|
1170
|
+
* - `all` - All file/assembly objects.
|
|
1171
|
+
* - `handle` - Objects with original handles specified in the `selectionSetA`.
|
|
1172
|
+
* - `models` - All objects of the models with original handles specified in the `selectionSetA`.
|
|
1173
|
+
* - `searchquery` - Objects retrieved by the search queries specified in `selectionSetA`.
|
|
1174
|
+
*
|
|
1175
|
+
* @param selectionTypeB - The type of second selection set for clash detection. Can be one of:
|
|
1176
|
+
*
|
|
1177
|
+
* - `all` - All file/assembly objects.
|
|
1178
|
+
* - `handle` - Objects with original handles specified in the `selectionSetB`.
|
|
1179
|
+
* - `models` - All objects of the models with original handles specified in the `selectionSetB`.
|
|
1180
|
+
* - `searchquery` - Objects retrieved by the search queries specified in `selectionSetB`.
|
|
1181
|
+
*
|
|
1182
|
+
* @param selectionSetA - First selection set for clash detection. Objects from
|
|
1183
|
+
* `selectionSetA` will be tested against each others by objects from the `selectionSetB`
|
|
1184
|
+
* during the test.
|
|
1185
|
+
* @param selectionSetB - Second selection set for clash detection. Objects from
|
|
1186
|
+
* `selectionSetB` will be tested against each others by objects from the `selectionSetA`
|
|
1187
|
+
* during the test.
|
|
1182
1188
|
* @param params - An object containing test parameters.
|
|
1183
|
-
* @param params.tolerance - The distance of separation between
|
|
1189
|
+
* @param params.tolerance - The distance of separation between objects at which test begins
|
|
1184
1190
|
* detecting clashes.
|
|
1185
|
-
* @param params.clearance - The type of the clashes that the test detects:
|
|
1186
|
-
*
|
|
1191
|
+
* @param params.clearance - The type of the clashes that the test detects:
|
|
1192
|
+
*
|
|
1193
|
+
* - `true` - Сlearance clash. A clash in which the object A may or may not intersect with
|
|
1194
|
+
* object B, but comes within a distance of less than the `tolerance`.
|
|
1195
|
+
* - `false` - Hard clash. A clash in which the object A intersects with object B by a distance
|
|
1196
|
+
* of more than the `tolerance`.
|
|
1197
|
+
*
|
|
1187
1198
|
* @param params.waitForDone - Wait for test to complete.
|
|
1188
1199
|
* @param params.timeout - The time, in milliseconds that the function should wait test. If
|
|
1189
1200
|
* test is not complete during this time, the `TimeoutError` exception will be thrown.
|
|
@@ -1213,7 +1224,7 @@
|
|
|
1213
1224
|
.then((result) => (waitForDone ? result.waitForDone(params) : result));
|
|
1214
1225
|
}
|
|
1215
1226
|
/**
|
|
1216
|
-
*
|
|
1227
|
+
* Deletes the specified assembly clash test.
|
|
1217
1228
|
*
|
|
1218
1229
|
* @param testId - Test ID.
|
|
1219
1230
|
* @returns Returns the raw data of a deleted test.
|
|
@@ -1520,14 +1531,14 @@
|
|
|
1520
1531
|
// acknowledge and accept the above terms.
|
|
1521
1532
|
///////////////////////////////////////////////////////////////////////////////
|
|
1522
1533
|
/**
|
|
1523
|
-
*
|
|
1524
|
-
* {@link User | users},
|
|
1534
|
+
* Provides properties and methods for obtaining information about {@link File | file} actions
|
|
1535
|
+
* granted to a specific {@link User | users}, or project {@link Member | member}.
|
|
1525
1536
|
*/
|
|
1526
1537
|
class Permission {
|
|
1527
1538
|
/**
|
|
1528
|
-
* @param data -
|
|
1539
|
+
* @param data - Raw permission data received from the server.
|
|
1529
1540
|
* @param fileId - Owner file ID.
|
|
1530
|
-
* @param httpClient -
|
|
1541
|
+
* @param httpClient - HTTP client instance used to send REST API requests to the server.
|
|
1531
1542
|
*/
|
|
1532
1543
|
constructor(data, fileId, httpClient) {
|
|
1533
1544
|
this.httpClient = httpClient;
|
|
@@ -1546,11 +1557,11 @@
|
|
|
1546
1557
|
/**
|
|
1547
1558
|
* Defines what actions are allowed to be performed on a file with this permission:
|
|
1548
1559
|
*
|
|
1549
|
-
* - `read` - The ability to read file description, geometry data and properties
|
|
1550
|
-
* - `readSourceFile` - The ability to read source file
|
|
1551
|
-
* - `write` - The ability to modify file name, description and references
|
|
1552
|
-
* - `readViewpoint` - The ability to read file viewpoints
|
|
1553
|
-
* - `createViewpoint` - The ability to create file viewpoints
|
|
1560
|
+
* - `read` - The ability to read file description, geometry data and properties.
|
|
1561
|
+
* - `readSourceFile` - The ability to read source file.
|
|
1562
|
+
* - `write` - The ability to modify file name, description and references.
|
|
1563
|
+
* - `readViewpoint` - The ability to read file viewpoints.
|
|
1564
|
+
* - `createViewpoint` - The ability to create file viewpoints.
|
|
1554
1565
|
*/
|
|
1555
1566
|
get actions() {
|
|
1556
1567
|
return this.data.actions;
|
|
@@ -1590,7 +1601,7 @@
|
|
|
1590
1601
|
* @property {string} project.name - Project name.
|
|
1591
1602
|
*/
|
|
1592
1603
|
/**
|
|
1593
|
-
* A
|
|
1604
|
+
* A list of principials that will get access to the file.
|
|
1594
1605
|
*/
|
|
1595
1606
|
get grantedTo() {
|
|
1596
1607
|
return this.data.grantedTo;
|
|
@@ -1608,7 +1619,7 @@
|
|
|
1608
1619
|
this.data.public = value;
|
|
1609
1620
|
}
|
|
1610
1621
|
/**
|
|
1611
|
-
*
|
|
1622
|
+
* Reloads permission data from the server.
|
|
1612
1623
|
*/
|
|
1613
1624
|
async checkout() {
|
|
1614
1625
|
const response = await this.internalGet();
|
|
@@ -1616,7 +1627,7 @@
|
|
|
1616
1627
|
return this;
|
|
1617
1628
|
}
|
|
1618
1629
|
/**
|
|
1619
|
-
*
|
|
1630
|
+
* Updates permission data on the server.
|
|
1620
1631
|
*
|
|
1621
1632
|
* @param data - Raw permission data.
|
|
1622
1633
|
*/
|
|
@@ -1626,7 +1637,7 @@
|
|
|
1626
1637
|
return this;
|
|
1627
1638
|
}
|
|
1628
1639
|
/**
|
|
1629
|
-
*
|
|
1640
|
+
* Removes a permission from the file.
|
|
1630
1641
|
*
|
|
1631
1642
|
* @returns Returns the raw data of a deleted permission.
|
|
1632
1643
|
*/
|
|
@@ -1634,8 +1645,8 @@
|
|
|
1634
1645
|
return this.internalDelete().then((response) => response.json());
|
|
1635
1646
|
}
|
|
1636
1647
|
/**
|
|
1637
|
-
*
|
|
1638
|
-
* the server after any changes.
|
|
1648
|
+
* Saves permission properties changes to the server. Call this method to update permission
|
|
1649
|
+
* data on the server after any property changes.
|
|
1639
1650
|
*/
|
|
1640
1651
|
save() {
|
|
1641
1652
|
return this.update(this.data);
|
|
@@ -1644,13 +1655,12 @@
|
|
|
1644
1655
|
|
|
1645
1656
|
///////////////////////////////////////////////////////////////////////////////
|
|
1646
1657
|
/**
|
|
1647
|
-
*
|
|
1648
|
-
* format to another, to obtain geometric data, validate the file, or run a clash test.
|
|
1658
|
+
* Provides properties and methods for obtaining information about a job on the server.
|
|
1649
1659
|
*/
|
|
1650
1660
|
class Job {
|
|
1651
1661
|
/**
|
|
1652
|
-
* @param data -
|
|
1653
|
-
* @param httpClient -
|
|
1662
|
+
* @param data - Raw job data received from the server.
|
|
1663
|
+
* @param httpClient - HTTP client instance used to send REST API requests to the server.
|
|
1654
1664
|
*/
|
|
1655
1665
|
constructor(data, httpClient) {
|
|
1656
1666
|
this.httpClient = httpClient;
|
|
@@ -1777,7 +1787,7 @@
|
|
|
1777
1787
|
return this.data.startedAt;
|
|
1778
1788
|
}
|
|
1779
1789
|
/**
|
|
1780
|
-
*
|
|
1790
|
+
* Reloads job data from the server.
|
|
1781
1791
|
*/
|
|
1782
1792
|
async checkout() {
|
|
1783
1793
|
const response = await this.internalGet();
|
|
@@ -1785,7 +1795,7 @@
|
|
|
1785
1795
|
return this;
|
|
1786
1796
|
}
|
|
1787
1797
|
/**
|
|
1788
|
-
*
|
|
1798
|
+
* Updates job data on the server.
|
|
1789
1799
|
*
|
|
1790
1800
|
* Only administrators can update job data. If the current logged in user is not an
|
|
1791
1801
|
* administrator, an exception will be thrown.
|
|
@@ -1798,7 +1808,7 @@
|
|
|
1798
1808
|
return this;
|
|
1799
1809
|
}
|
|
1800
1810
|
/**
|
|
1801
|
-
*
|
|
1811
|
+
* Deletes a job from the server job list. Jobs that are in progress or have already been
|
|
1802
1812
|
* completed cannot be deleted.
|
|
1803
1813
|
*
|
|
1804
1814
|
* @returns Returns the raw data of a deleted job.
|
|
@@ -1807,17 +1817,14 @@
|
|
|
1807
1817
|
return this.internalDelete().then((response) => response.json());
|
|
1808
1818
|
}
|
|
1809
1819
|
// /**
|
|
1810
|
-
// * Save job
|
|
1811
|
-
// * after any changes.
|
|
1812
|
-
// *
|
|
1813
|
-
// *
|
|
1814
|
-
// * @returns {Promise<Job>}
|
|
1820
|
+
// * Save job properties changes to the server. Call this method to update job data on the server
|
|
1821
|
+
// * after any property changes.
|
|
1815
1822
|
// */
|
|
1816
1823
|
// save() {
|
|
1817
1824
|
// return this.update(this.data);
|
|
1818
1825
|
// }
|
|
1819
1826
|
/**
|
|
1820
|
-
*
|
|
1827
|
+
* Waits for job to be done. Job is done when it changes to `done` or `failed` status.
|
|
1821
1828
|
*
|
|
1822
1829
|
* @param params - An object containing waiting parameters.
|
|
1823
1830
|
* @param params.timeout - The time, in milliseconds that the function should wait job. If
|
|
@@ -1842,12 +1849,13 @@
|
|
|
1842
1849
|
|
|
1843
1850
|
///////////////////////////////////////////////////////////////////////////////
|
|
1844
1851
|
/**
|
|
1845
|
-
*
|
|
1852
|
+
* Provides properties and methods for obtaining information about a file on the server and
|
|
1853
|
+
* managing its data and versions.
|
|
1846
1854
|
*/
|
|
1847
1855
|
class File {
|
|
1848
1856
|
/**
|
|
1849
|
-
* @param data -
|
|
1850
|
-
* @param httpClient -
|
|
1857
|
+
* @param data - Raw file data received from the server.
|
|
1858
|
+
* @param httpClient - HTTP client instance used to send REST API requests to the server.
|
|
1851
1859
|
*/
|
|
1852
1860
|
constructor(data, httpClient) {
|
|
1853
1861
|
this.path = `/files/${data.id}`;
|
|
@@ -1944,8 +1952,9 @@
|
|
|
1944
1952
|
(_m = (_w = this._data).isFileDeleted) !== null && _m !== void 0 ? _m : (_w.isFileDeleted = false);
|
|
1945
1953
|
}
|
|
1946
1954
|
/**
|
|
1947
|
-
* Returns a list of
|
|
1948
|
-
*
|
|
1955
|
+
* Returns a list of file formats in which the active version of the file was exported.
|
|
1956
|
+
*
|
|
1957
|
+
* To export file to one of the supported formats create File Converter job using
|
|
1949
1958
|
* {@link createJob | createJob()}. To download exported file use
|
|
1950
1959
|
* {@link downloadResource | downloadResource()}.
|
|
1951
1960
|
*
|
|
@@ -1957,10 +1966,10 @@
|
|
|
1957
1966
|
/**
|
|
1958
1967
|
* Geometry data type of the active file version. Can be one of:
|
|
1959
1968
|
*
|
|
1960
|
-
* - `vsfx` - `VSFX
|
|
1961
|
-
* - `gltf` - `glTF
|
|
1969
|
+
* - `vsfx` - `VSFX` format, file can be opened in `VisualizeJS` viewer.
|
|
1970
|
+
* - `gltf` - `glTF` format, file can be opened in `Three.js` viewer.
|
|
1962
1971
|
*
|
|
1963
|
-
* Returns an empty string if geometry data has not yet been
|
|
1972
|
+
* Returns an empty string if geometry data has not yet been converted. A files without
|
|
1964
1973
|
* geometry data can be exported to other formas, but cannot be opened in viewer.
|
|
1965
1974
|
*/
|
|
1966
1975
|
get geometryType() {
|
|
@@ -1980,7 +1989,10 @@
|
|
|
1980
1989
|
return this.data.id;
|
|
1981
1990
|
}
|
|
1982
1991
|
/**
|
|
1983
|
-
* Returns `true` if source of the active file version has been deleted.
|
|
1992
|
+
* Returns `true` if the source file of the active file version has been deleted.
|
|
1993
|
+
*
|
|
1994
|
+
* A files with deleted source file can be opened in the viewer, but cannot be exported to
|
|
1995
|
+
* other formats.
|
|
1984
1996
|
*
|
|
1985
1997
|
* @readonly
|
|
1986
1998
|
*/
|
|
@@ -2038,7 +2050,7 @@
|
|
|
2038
2050
|
return this.data.size;
|
|
2039
2051
|
}
|
|
2040
2052
|
/**
|
|
2041
|
-
* Total size of all versions of the file in
|
|
2053
|
+
* Total size of all versions of the file in bytes.
|
|
2042
2054
|
*
|
|
2043
2055
|
* @readonly
|
|
2044
2056
|
*/
|
|
@@ -2048,8 +2060,8 @@
|
|
|
2048
2060
|
/**
|
|
2049
2061
|
* Data status of the active version of the file. Contains:
|
|
2050
2062
|
*
|
|
2051
|
-
* - `geometry` - status of geometry data of `
|
|
2052
|
-
* - `geometryGltf` - status of geometry data of `
|
|
2063
|
+
* - `geometry` - status of geometry data of `vsfx` type.
|
|
2064
|
+
* - `geometryGltf` - status of geometry data of `gltf` type.
|
|
2053
2065
|
* - `properties` - status of properties.
|
|
2054
2066
|
* - `validation` - status of validation.
|
|
2055
2067
|
*
|
|
@@ -2111,7 +2123,7 @@
|
|
|
2111
2123
|
return this.data.versions;
|
|
2112
2124
|
}
|
|
2113
2125
|
/**
|
|
2114
|
-
*
|
|
2126
|
+
* Reloads file data from the server.
|
|
2115
2127
|
*/
|
|
2116
2128
|
async checkout() {
|
|
2117
2129
|
const response = await this.internalGet("");
|
|
@@ -2119,7 +2131,7 @@
|
|
|
2119
2131
|
return this;
|
|
2120
2132
|
}
|
|
2121
2133
|
/**
|
|
2122
|
-
*
|
|
2134
|
+
* Updates file data on the server.
|
|
2123
2135
|
*
|
|
2124
2136
|
* @param data - Raw file data.
|
|
2125
2137
|
*/
|
|
@@ -2129,7 +2141,10 @@
|
|
|
2129
2141
|
return this;
|
|
2130
2142
|
}
|
|
2131
2143
|
/**
|
|
2132
|
-
*
|
|
2144
|
+
* Deletes a file and all its versions from the server.
|
|
2145
|
+
*
|
|
2146
|
+
* You cannot delete a version file using `delete()`, only the original file. To delete a
|
|
2147
|
+
* version file use {@link deleteVersion | deleteVersion()}.
|
|
2133
2148
|
*
|
|
2134
2149
|
* @returns Returns the raw data of a deleted file.
|
|
2135
2150
|
*/
|
|
@@ -2137,22 +2152,22 @@
|
|
|
2137
2152
|
return this.internalDelete("").then((response) => response.json());
|
|
2138
2153
|
}
|
|
2139
2154
|
/**
|
|
2140
|
-
*
|
|
2141
|
-
* after any changes.
|
|
2155
|
+
* Saves file properties changes to the server. Call this method to update file data on the
|
|
2156
|
+
* server after any property changes.
|
|
2142
2157
|
*/
|
|
2143
2158
|
save() {
|
|
2144
2159
|
return this.update(this.data);
|
|
2145
2160
|
}
|
|
2146
2161
|
/**
|
|
2147
|
-
*
|
|
2162
|
+
* Sets or removes the file preview.
|
|
2148
2163
|
*
|
|
2149
|
-
* @param image - Preview image.Can be a
|
|
2164
|
+
* @param image - Preview image. Can be a
|
|
2150
2165
|
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}
|
|
2151
2166
|
* string,
|
|
2152
2167
|
* {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},
|
|
2153
|
-
* {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or
|
|
2154
|
-
* {@link https://developer.mozilla.org/docs/Web/API/File | File} object. Setting
|
|
2155
|
-
* `image` to `null` will remove the preview.
|
|
2168
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or
|
|
2169
|
+
* {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting
|
|
2170
|
+
* the `image` to `null` will remove the preview.
|
|
2156
2171
|
*/
|
|
2157
2172
|
async setPreview(image) {
|
|
2158
2173
|
if (!image) {
|
|
@@ -2165,7 +2180,7 @@
|
|
|
2165
2180
|
return this;
|
|
2166
2181
|
}
|
|
2167
2182
|
/**
|
|
2168
|
-
*
|
|
2183
|
+
* Removes the file preview.
|
|
2169
2184
|
*/
|
|
2170
2185
|
async deletePreview() {
|
|
2171
2186
|
const response = await this.internalDelete("/preview");
|
|
@@ -2198,8 +2213,8 @@
|
|
|
2198
2213
|
/**
|
|
2199
2214
|
* Returns the properties for an objects in the active version of the file.
|
|
2200
2215
|
*
|
|
2201
|
-
* @param handles - Object original handle or handles array.
|
|
2202
|
-
*
|
|
2216
|
+
* @param handles - Object original handle or handles array. Specify `undefined` to get
|
|
2217
|
+
* properties for all objects in the file.
|
|
2203
2218
|
*/
|
|
2204
2219
|
getProperties(handles) {
|
|
2205
2220
|
const relativePath = handles !== undefined ? `/properties?handles=${handles}` : "/properties";
|
|
@@ -2242,7 +2257,7 @@
|
|
|
2242
2257
|
* ],
|
|
2243
2258
|
* };
|
|
2244
2259
|
*
|
|
2245
|
-
* @param {
|
|
2260
|
+
* @param {SeacrhPattern | QueryOperator} searchPattern - Search pattern or combination of
|
|
2246
2261
|
* the patterns, see example below.
|
|
2247
2262
|
* @returns {Promise<Properties[]>}
|
|
2248
2263
|
*/
|
|
@@ -2250,7 +2265,7 @@
|
|
|
2250
2265
|
return this.internalPost("/properties/search", searchPattern).then((response) => response.json());
|
|
2251
2266
|
}
|
|
2252
2267
|
/**
|
|
2253
|
-
* Returns the
|
|
2268
|
+
* Returns the CDA tree for an active version of the file.
|
|
2254
2269
|
*/
|
|
2255
2270
|
getCdaTree() {
|
|
2256
2271
|
return this.internalGet(`/properties/tree`).then((response) => response.json());
|
|
@@ -2264,7 +2279,7 @@
|
|
|
2264
2279
|
.then((viewpoints) => viewpoints.result);
|
|
2265
2280
|
}
|
|
2266
2281
|
/**
|
|
2267
|
-
*
|
|
2282
|
+
* Adds a new viewpoint to the file. To create a viewpoint use `Viewer.createViewpoint()`.
|
|
2268
2283
|
*
|
|
2269
2284
|
* @param viewpoint - Viewpoint.
|
|
2270
2285
|
*/
|
|
@@ -2272,7 +2287,7 @@
|
|
|
2272
2287
|
return this.internalPost("/viewpoints", viewpoint).then((response) => response.json());
|
|
2273
2288
|
}
|
|
2274
2289
|
/**
|
|
2275
|
-
*
|
|
2290
|
+
* Deletes the specified file viewpoint.
|
|
2276
2291
|
*
|
|
2277
2292
|
* @param guid - Viewpoint GUID.
|
|
2278
2293
|
* @returns Returns the raw data of a deleted viewpoint.
|
|
@@ -2299,7 +2314,7 @@
|
|
|
2299
2314
|
return this.internalGet(`/viewpoints/${guid}/bitmaps/${bitmapGuid}`).then((response) => response.text());
|
|
2300
2315
|
}
|
|
2301
2316
|
/**
|
|
2302
|
-
*
|
|
2317
|
+
* Downloads the source file of active version of the file from the server.
|
|
2303
2318
|
*
|
|
2304
2319
|
* @param onProgress - Download progress callback.
|
|
2305
2320
|
* @param signal - An
|
|
@@ -2313,7 +2328,7 @@
|
|
|
2313
2328
|
.then((response) => response.arrayBuffer());
|
|
2314
2329
|
}
|
|
2315
2330
|
/**
|
|
2316
|
-
*
|
|
2331
|
+
* Downloads a resource file of the active version of the file. Resource files are files that
|
|
2317
2332
|
* contain model scene descriptions, or geometry data, or exported files.
|
|
2318
2333
|
*
|
|
2319
2334
|
* @example <caption>Export file to DWG.</caption>
|
|
@@ -2338,7 +2353,7 @@
|
|
|
2338
2353
|
.then((response) => response.arrayBuffer());
|
|
2339
2354
|
}
|
|
2340
2355
|
/**
|
|
2341
|
-
*
|
|
2356
|
+
* Downloads a part of resource file of the active version of the file. Resource files are
|
|
2342
2357
|
* files that contain model scene descriptions, or geometry data, or exported files.
|
|
2343
2358
|
*
|
|
2344
2359
|
* @param dataId - Resource file name.
|
|
@@ -2373,7 +2388,9 @@
|
|
|
2373
2388
|
await this.downloadResourceRange(dataId, requestId, records, onProgress, signal);
|
|
2374
2389
|
}
|
|
2375
2390
|
/**
|
|
2376
|
-
* Returns a list of references
|
|
2391
|
+
* Returns a list of file references.
|
|
2392
|
+
*
|
|
2393
|
+
* References are images, fonts, or any other files to correct rendering of the file.
|
|
2377
2394
|
*
|
|
2378
2395
|
* @param signal - An
|
|
2379
2396
|
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
@@ -2383,7 +2400,10 @@
|
|
|
2383
2400
|
return this.internalGet("/references", signal).then((response) => response.json());
|
|
2384
2401
|
}
|
|
2385
2402
|
/**
|
|
2386
|
-
*
|
|
2403
|
+
* Sets the file references.
|
|
2404
|
+
*
|
|
2405
|
+
* References are images, fonts, or any other files to correct rendering of the file.
|
|
2406
|
+
* Reference files must be uploaded to the server before they can be assigned to the current file.
|
|
2387
2407
|
*
|
|
2388
2408
|
* @param references - File references.
|
|
2389
2409
|
*/
|
|
@@ -2391,14 +2411,14 @@
|
|
|
2391
2411
|
return this.internalPut("/references", references).then((response) => response.json());
|
|
2392
2412
|
}
|
|
2393
2413
|
/**
|
|
2394
|
-
*
|
|
2414
|
+
* Runs a new job on the server for the active version of the file.
|
|
2395
2415
|
*
|
|
2396
2416
|
* @param outputFormat - The job type. Can be one of:
|
|
2397
2417
|
*
|
|
2398
|
-
* - `geometry` -
|
|
2399
|
-
* - `geometryGltf` -
|
|
2418
|
+
* - `geometry` - Convert file geometry data to `VSFX` format suitable for `VisualizeJS` viewer.
|
|
2419
|
+
* - `geometryGltf` - Convert file geometry data to `glTF` format suitable for `Three.js` viewer.
|
|
2400
2420
|
* - `properties` - Extract file properties.
|
|
2401
|
-
* - `validation` - Validate the file. Only for `IFC
|
|
2421
|
+
* - `validation` - Validate the file. Only for `IFC` files.
|
|
2402
2422
|
* - `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` - Export file to the one of the
|
|
2403
2423
|
* supported format. Use {@link exports | exports()} to get the list of completed file
|
|
2404
2424
|
* exports. Use {@link downloadResource | downloadResource()} to download the exported file.
|
|
@@ -2420,13 +2440,13 @@
|
|
|
2420
2440
|
.then((data) => new Job(data, this.httpClient));
|
|
2421
2441
|
}
|
|
2422
2442
|
/**
|
|
2423
|
-
*
|
|
2443
|
+
* Runs a job to convert geometry data of active version of the file. This is alias to
|
|
2424
2444
|
* {@link createJob | createJob("geometry")}.
|
|
2425
2445
|
*
|
|
2426
2446
|
* @param type - Geometry data type. Can be one of:
|
|
2427
2447
|
*
|
|
2428
|
-
* - `vsfx` - `VSFX` (default), for opening a file in `VisualizeJS` viewer.
|
|
2429
|
-
* - `gltf` - `glTF
|
|
2448
|
+
* - `vsfx` - `VSFX` format (default), for opening a file in `VisualizeJS` viewer.
|
|
2449
|
+
* - `gltf` - `glTF` format, for opening a file in `Three.js` viewer.
|
|
2430
2450
|
*
|
|
2431
2451
|
* @param parameters - Parameters for the job runner. Can be given as command line arguments
|
|
2432
2452
|
* for the File Converter tool in form `--arg=value`.
|
|
@@ -2435,7 +2455,7 @@
|
|
|
2435
2455
|
return this.createJob(type === "gltf" ? "geometryGltf" : "geometry", parameters);
|
|
2436
2456
|
}
|
|
2437
2457
|
/**
|
|
2438
|
-
*
|
|
2458
|
+
* Runs a job to extract properties of the active version of the file. This is alias to
|
|
2439
2459
|
* {@link createJob | createJob("properties")}.
|
|
2440
2460
|
*
|
|
2441
2461
|
* @param parameters - Parameters for the job runner. Can be given as command line arguments
|
|
@@ -2445,7 +2465,7 @@
|
|
|
2445
2465
|
return this.createJob("properties", parameters);
|
|
2446
2466
|
}
|
|
2447
2467
|
/**
|
|
2448
|
-
*
|
|
2468
|
+
* Runs a job to validate the active version of the file. This is alias to
|
|
2449
2469
|
* {@link createJob | createJob("validation")}.
|
|
2450
2470
|
*
|
|
2451
2471
|
* To get validation report use {@link downloadResource | downloadResource("validation_report.json")}.
|
|
@@ -2457,8 +2477,8 @@
|
|
|
2457
2477
|
return this.createJob("validation", parameters);
|
|
2458
2478
|
}
|
|
2459
2479
|
/**
|
|
2460
|
-
*
|
|
2461
|
-
* `none`, `done` or `failed` status.
|
|
2480
|
+
* Waits for jobs of the active version of the file to be done. Job is done when it changes
|
|
2481
|
+
* to `none`, `done` or `failed` status.
|
|
2462
2482
|
*
|
|
2463
2483
|
* @param jobs - Job or job array to wait on. Can be `geometry`, `geometryGltf`,
|
|
2464
2484
|
* `properties`, `validation`, `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` or custom
|
|
@@ -2500,7 +2520,7 @@
|
|
|
2500
2520
|
.then((array) => array.map((data) => new Permission(data, this.id, this.httpClient)));
|
|
2501
2521
|
}
|
|
2502
2522
|
/**
|
|
2503
|
-
* Returns
|
|
2523
|
+
* Returns information about specified file permission.
|
|
2504
2524
|
*
|
|
2505
2525
|
* @param permissionId - Permission ID.
|
|
2506
2526
|
*/
|
|
@@ -2510,10 +2530,16 @@
|
|
|
2510
2530
|
.then((data) => new Permission(data, this.id, this.httpClient));
|
|
2511
2531
|
}
|
|
2512
2532
|
/**
|
|
2513
|
-
*
|
|
2533
|
+
* Creates a new file permission.
|
|
2534
|
+
*
|
|
2535
|
+
* @param actions - Actions are allowed to be performed on a file with this permission:
|
|
2536
|
+
*
|
|
2537
|
+
* - `read` - The ability to read file description, geometry data and properties.
|
|
2538
|
+
* - `readSourceFile` - The ability to read source file.
|
|
2539
|
+
* - `write` - The ability to modify file name, description and references.
|
|
2540
|
+
* - `readViewpoint` - The ability to read file viewpoints.
|
|
2541
|
+
* - `createViewpoint` - The ability to create file viewpoints.
|
|
2514
2542
|
*
|
|
2515
|
-
* @param actions - Actions are allowed to be performed on a file with this permission. See
|
|
2516
|
-
* {@link Permission.actions} for more details.
|
|
2517
2543
|
* @param grantedTo - A collection of principials that will get access to the file.
|
|
2518
2544
|
* @param _public - Specifies whether all users have access to the file or not.
|
|
2519
2545
|
*/
|
|
@@ -2527,7 +2553,7 @@
|
|
|
2527
2553
|
.then((data) => new Permission(data, this.id, this.httpClient));
|
|
2528
2554
|
}
|
|
2529
2555
|
/**
|
|
2530
|
-
*
|
|
2556
|
+
* Removes the specified permission from the file.
|
|
2531
2557
|
*
|
|
2532
2558
|
* @param permissionId - Permission ID.
|
|
2533
2559
|
* @returns Returns the raw data of a deleted permission.
|
|
@@ -2536,14 +2562,15 @@
|
|
|
2536
2562
|
return this.internalDelete(`/permissions/${permissionId}`).then((response) => response.json());
|
|
2537
2563
|
}
|
|
2538
2564
|
/**
|
|
2539
|
-
*
|
|
2565
|
+
* Uploads the new version of the file to the server, convert the geometry data and extract
|
|
2566
|
+
* properties as needed.
|
|
2540
2567
|
*
|
|
2541
|
-
* @param file -
|
|
2568
|
+
* @param file - {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object
|
|
2542
2569
|
* are generally retrieved from a
|
|
2543
2570
|
* {@link https://developer.mozilla.org/docs/Web/API/FileList | FileList} object returned as
|
|
2544
2571
|
* a result of a user selecting files using the HTML `<input>` element.
|
|
2545
2572
|
* @param params - An object containing upload parameters.
|
|
2546
|
-
* @param params.geometry - Create job to
|
|
2573
|
+
* @param params.geometry - Create job to convert file geometry data. The geometry data type
|
|
2547
2574
|
* is the same as the original file.
|
|
2548
2575
|
* @param params.properties - Create job to extract file properties.
|
|
2549
2576
|
* @param params.waitForDone - Wait for geometry and properties jobs to complete.
|
|
@@ -2596,7 +2623,7 @@
|
|
|
2596
2623
|
.then((files) => files.map((file) => (file.id == file.originalFileId ? file.useVersion(0) : file)));
|
|
2597
2624
|
}
|
|
2598
2625
|
/**
|
|
2599
|
-
* Returns the version file.
|
|
2626
|
+
* Returns information about the specified version file.
|
|
2600
2627
|
*
|
|
2601
2628
|
* @param version - Desired version.
|
|
2602
2629
|
*/
|
|
@@ -2607,7 +2634,7 @@
|
|
|
2607
2634
|
.then((file) => (file.id == file.originalFileId ? file.useVersion(0) : file));
|
|
2608
2635
|
}
|
|
2609
2636
|
/**
|
|
2610
|
-
*
|
|
2637
|
+
* Deletes the specified version file.
|
|
2611
2638
|
*
|
|
2612
2639
|
* @param version - Version to delete.
|
|
2613
2640
|
*/
|
|
@@ -2618,7 +2645,7 @@
|
|
|
2618
2645
|
return data;
|
|
2619
2646
|
}
|
|
2620
2647
|
/**
|
|
2621
|
-
*
|
|
2648
|
+
* Replaces the active version of the file with the selected version.
|
|
2622
2649
|
*
|
|
2623
2650
|
* @param version - Desired active version.
|
|
2624
2651
|
*/
|
|
@@ -2626,34 +2653,36 @@
|
|
|
2626
2653
|
return this.update({ activeVersion: version });
|
|
2627
2654
|
}
|
|
2628
2655
|
/**
|
|
2629
|
-
*
|
|
2630
|
-
*
|
|
2631
|
-
*
|
|
2632
|
-
*
|
|
2633
|
-
*
|
|
2634
|
-
* -
|
|
2635
|
-
* -
|
|
2636
|
-
* -
|
|
2637
|
-
* -
|
|
2638
|
-
* -
|
|
2639
|
-
* -
|
|
2640
|
-
* -
|
|
2641
|
-
* -
|
|
2642
|
-
* -
|
|
2656
|
+
* Makes the given version active on client side. Does not change the active file version on
|
|
2657
|
+
* the server.
|
|
2658
|
+
*
|
|
2659
|
+
* This version change will affect the result:
|
|
2660
|
+
*
|
|
2661
|
+
* - {@link getModels | getModels()}
|
|
2662
|
+
* - {@link getProperties | getProperties()}
|
|
2663
|
+
* - {@link searchProperties | searchProperties()}
|
|
2664
|
+
* - {@link getCdaTree | getCdaTree()}
|
|
2665
|
+
* - {@link download | download()}
|
|
2666
|
+
* - {@link downloadResource | downloadResource()}
|
|
2667
|
+
* - {@link createJob | createJob()}
|
|
2668
|
+
* - {@link extractGeometry | extractGeometry()}
|
|
2669
|
+
* - {@link extractProperties | extractProperties()}
|
|
2670
|
+
* - {@link validate | validate()}
|
|
2671
|
+
* - {@link waitForDone | waitForDone()}
|
|
2643
2672
|
* - Viewer.open()
|
|
2644
2673
|
*
|
|
2645
2674
|
* Other clients will still continue to use the current active version of the file. Use
|
|
2646
2675
|
* `undefined` to revert back to the active version.
|
|
2647
2676
|
*
|
|
2648
|
-
*
|
|
2649
|
-
*
|
|
2677
|
+
* You need to reload the file data using {@link checkout | checkout()} to match the size and
|
|
2678
|
+
* status fields to the version you selected.
|
|
2650
2679
|
*/
|
|
2651
2680
|
useVersion(version) {
|
|
2652
2681
|
this._useVersion = version;
|
|
2653
2682
|
return this;
|
|
2654
2683
|
}
|
|
2655
2684
|
/**
|
|
2656
|
-
*
|
|
2685
|
+
* Deletes the source file of the active file version from the server.
|
|
2657
2686
|
*/
|
|
2658
2687
|
async deleteSource() {
|
|
2659
2688
|
const response = await this.internalDelete("/source");
|
|
@@ -2685,13 +2714,14 @@
|
|
|
2685
2714
|
// acknowledge and accept the above terms.
|
|
2686
2715
|
///////////////////////////////////////////////////////////////////////////////
|
|
2687
2716
|
/**
|
|
2688
|
-
* A
|
|
2717
|
+
* A role determines what actions allowed to be performed by {@link User | users} on a
|
|
2718
|
+
* {@link Project | project}.
|
|
2689
2719
|
*/
|
|
2690
2720
|
class Role {
|
|
2691
2721
|
/**
|
|
2692
|
-
* @param data -
|
|
2722
|
+
* @param data - Raw role data received from the server.
|
|
2693
2723
|
* @param projectId - Owner project ID.
|
|
2694
|
-
* @param httpClient -
|
|
2724
|
+
* @param httpClient - HTTP client instance used to send REST API requests to the server.
|
|
2695
2725
|
*/
|
|
2696
2726
|
constructor(data, projectId, httpClient) {
|
|
2697
2727
|
this.httpClient = httpClient;
|
|
@@ -2760,7 +2790,7 @@
|
|
|
2760
2790
|
this.data.permissions = value || {};
|
|
2761
2791
|
}
|
|
2762
2792
|
/**
|
|
2763
|
-
*
|
|
2793
|
+
* Reloads role data from the server.
|
|
2764
2794
|
*/
|
|
2765
2795
|
async checkout() {
|
|
2766
2796
|
const response = await this.internalGet();
|
|
@@ -2768,7 +2798,7 @@
|
|
|
2768
2798
|
return this;
|
|
2769
2799
|
}
|
|
2770
2800
|
/**
|
|
2771
|
-
*
|
|
2801
|
+
* Updates role data on the server.
|
|
2772
2802
|
*
|
|
2773
2803
|
* @param data - Raw role data.
|
|
2774
2804
|
*/
|
|
@@ -2778,7 +2808,7 @@
|
|
|
2778
2808
|
return this;
|
|
2779
2809
|
}
|
|
2780
2810
|
/**
|
|
2781
|
-
*
|
|
2811
|
+
* Deletes a role from the project.
|
|
2782
2812
|
*
|
|
2783
2813
|
* @returns Returns the raw data of a deleted role.
|
|
2784
2814
|
*/
|
|
@@ -2786,8 +2816,8 @@
|
|
|
2786
2816
|
return this.internalDelete().then((response) => response.json());
|
|
2787
2817
|
}
|
|
2788
2818
|
/**
|
|
2789
|
-
*
|
|
2790
|
-
* after any changes.
|
|
2819
|
+
* Saves role properties changes to the server. Call this method to update role data on the
|
|
2820
|
+
* server after any property changes.
|
|
2791
2821
|
*/
|
|
2792
2822
|
save() {
|
|
2793
2823
|
return this.update(this.data);
|
|
@@ -2796,13 +2826,14 @@
|
|
|
2796
2826
|
|
|
2797
2827
|
///////////////////////////////////////////////////////////////////////////////
|
|
2798
2828
|
/**
|
|
2799
|
-
*
|
|
2829
|
+
* Provides properties and methods for obtaining information about a {@link User | user} who has
|
|
2830
|
+
* access to the {@link Project | project}.
|
|
2800
2831
|
*/
|
|
2801
2832
|
class Member {
|
|
2802
2833
|
/**
|
|
2803
|
-
* @param data -
|
|
2834
|
+
* @param data - Raw member data received from the server.
|
|
2804
2835
|
* @param projectId - Owner project ID.
|
|
2805
|
-
* @param httpClient -
|
|
2836
|
+
* @param httpClient - HTTP client instance used to send REST API requests to the server.
|
|
2806
2837
|
*/
|
|
2807
2838
|
constructor(data, projectId, httpClient) {
|
|
2808
2839
|
this.httpClient = httpClient;
|
|
@@ -2874,7 +2905,7 @@
|
|
|
2874
2905
|
return this.data.user;
|
|
2875
2906
|
}
|
|
2876
2907
|
/**
|
|
2877
|
-
*
|
|
2908
|
+
* Reloads member data from the server.
|
|
2878
2909
|
*/
|
|
2879
2910
|
async checkout() {
|
|
2880
2911
|
const response = await this.internalGet();
|
|
@@ -2882,7 +2913,7 @@
|
|
|
2882
2913
|
return this;
|
|
2883
2914
|
}
|
|
2884
2915
|
/**
|
|
2885
|
-
*
|
|
2916
|
+
* Updates member data on the server.
|
|
2886
2917
|
*
|
|
2887
2918
|
* @param data - Raw member data.
|
|
2888
2919
|
*/
|
|
@@ -2892,7 +2923,7 @@
|
|
|
2892
2923
|
return this;
|
|
2893
2924
|
}
|
|
2894
2925
|
/**
|
|
2895
|
-
*
|
|
2926
|
+
* Removes a member from the project.
|
|
2896
2927
|
*
|
|
2897
2928
|
* @returns Returns the raw data of a deleted member.
|
|
2898
2929
|
*/
|
|
@@ -2900,8 +2931,8 @@
|
|
|
2900
2931
|
return this.internalDelete().then((response) => response.json());
|
|
2901
2932
|
}
|
|
2902
2933
|
/**
|
|
2903
|
-
*
|
|
2904
|
-
* server after any changes.
|
|
2934
|
+
* Saves member properties changes to the server. Call this method to update member data on
|
|
2935
|
+
* the server after any property changes.
|
|
2905
2936
|
*/
|
|
2906
2937
|
save() {
|
|
2907
2938
|
return this.update(this.data);
|
|
@@ -2910,12 +2941,13 @@
|
|
|
2910
2941
|
|
|
2911
2942
|
///////////////////////////////////////////////////////////////////////////////
|
|
2912
2943
|
/**
|
|
2913
|
-
*
|
|
2944
|
+
* Provides properties and methods for obtaining information about a project on the server and
|
|
2945
|
+
* managing its {@link Role | roles}, {@link Member | members} and models.
|
|
2914
2946
|
*/
|
|
2915
2947
|
class Project {
|
|
2916
2948
|
/**
|
|
2917
|
-
* @param data -
|
|
2918
|
-
* @param httpClient -
|
|
2949
|
+
* @param data - Raw project data received from the server.
|
|
2950
|
+
* @param httpClient - HTTP client instance used to send REST API requests to the server.
|
|
2919
2951
|
*/
|
|
2920
2952
|
constructor(data, httpClient) {
|
|
2921
2953
|
this.httpClient = httpClient;
|
|
@@ -2936,8 +2968,6 @@
|
|
|
2936
2968
|
/**
|
|
2937
2969
|
* Project features the user has access to.
|
|
2938
2970
|
*
|
|
2939
|
-
* @property {string[]} project_actions - Actions are allowed to be performed: `update`,
|
|
2940
|
-
* `createTopic`, `createDocument`.
|
|
2941
2971
|
* @readonly
|
|
2942
2972
|
*/
|
|
2943
2973
|
get authorization() {
|
|
@@ -3056,7 +3086,7 @@
|
|
|
3056
3086
|
return this._data.previewUrl;
|
|
3057
3087
|
}
|
|
3058
3088
|
/**
|
|
3059
|
-
* `true` if project is
|
|
3089
|
+
* `true` if project is shared project.
|
|
3060
3090
|
*/
|
|
3061
3091
|
get public() {
|
|
3062
3092
|
return this.data.public;
|
|
@@ -3092,7 +3122,7 @@
|
|
|
3092
3122
|
return this.data.updatedAt;
|
|
3093
3123
|
}
|
|
3094
3124
|
/**
|
|
3095
|
-
*
|
|
3125
|
+
* Reloads project data from the server.
|
|
3096
3126
|
*/
|
|
3097
3127
|
async checkout() {
|
|
3098
3128
|
const response = await this.internalGet("");
|
|
@@ -3100,7 +3130,7 @@
|
|
|
3100
3130
|
return this;
|
|
3101
3131
|
}
|
|
3102
3132
|
/**
|
|
3103
|
-
*
|
|
3133
|
+
* Updates project data on the server.
|
|
3104
3134
|
*
|
|
3105
3135
|
* @param data - Raw project data.
|
|
3106
3136
|
*/
|
|
@@ -3110,7 +3140,7 @@
|
|
|
3110
3140
|
return this;
|
|
3111
3141
|
}
|
|
3112
3142
|
/**
|
|
3113
|
-
*
|
|
3143
|
+
* Deletes a project from the server.
|
|
3114
3144
|
*
|
|
3115
3145
|
* @returns Returns the raw data of a deleted project.
|
|
3116
3146
|
*/
|
|
@@ -3128,22 +3158,22 @@
|
|
|
3128
3158
|
});
|
|
3129
3159
|
}
|
|
3130
3160
|
/**
|
|
3131
|
-
*
|
|
3132
|
-
* server after any changes.
|
|
3161
|
+
* Saves project properties changes to the server. Call this method to update project data on
|
|
3162
|
+
* the server after any property changes.
|
|
3133
3163
|
*/
|
|
3134
3164
|
save() {
|
|
3135
3165
|
return this.update(this.data);
|
|
3136
3166
|
}
|
|
3137
3167
|
/**
|
|
3138
|
-
*
|
|
3168
|
+
* Sets or removes the project preview.
|
|
3139
3169
|
*
|
|
3140
3170
|
* @param image - Preview image. Can be a
|
|
3141
3171
|
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}
|
|
3142
3172
|
* string,
|
|
3143
3173
|
* {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},
|
|
3144
|
-
* {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or
|
|
3145
|
-
* {@link https://developer.mozilla.org/docs/Web/API/File | File} object. Setting
|
|
3146
|
-
* `image` to `null` will remove the preview.
|
|
3174
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or
|
|
3175
|
+
* {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting
|
|
3176
|
+
* the `image` to `null` will remove the preview.
|
|
3147
3177
|
*/
|
|
3148
3178
|
async setPreview(image) {
|
|
3149
3179
|
if (!image) {
|
|
@@ -3156,7 +3186,7 @@
|
|
|
3156
3186
|
return this;
|
|
3157
3187
|
}
|
|
3158
3188
|
/**
|
|
3159
|
-
*
|
|
3189
|
+
* Removes the project preview.
|
|
3160
3190
|
*/
|
|
3161
3191
|
async deletePreview() {
|
|
3162
3192
|
const response = await this.internalDelete("/preview");
|
|
@@ -3173,7 +3203,7 @@
|
|
|
3173
3203
|
.then((array) => array.map((data) => new Role(data, this.id, this.httpClient)));
|
|
3174
3204
|
}
|
|
3175
3205
|
/**
|
|
3176
|
-
* Returns the role
|
|
3206
|
+
* Returns information about the specified project role.
|
|
3177
3207
|
*
|
|
3178
3208
|
* @param name - Role name.
|
|
3179
3209
|
*/
|
|
@@ -3183,7 +3213,7 @@
|
|
|
3183
3213
|
.then((data) => new Role(data, this.id, this.httpClient));
|
|
3184
3214
|
}
|
|
3185
3215
|
/**
|
|
3186
|
-
*
|
|
3216
|
+
* Creates a new project role.
|
|
3187
3217
|
*
|
|
3188
3218
|
* @param name - Role name.
|
|
3189
3219
|
* @param description - Role description.
|
|
@@ -3200,7 +3230,7 @@
|
|
|
3200
3230
|
.then((data) => new Role(data, this.id, this.httpClient));
|
|
3201
3231
|
}
|
|
3202
3232
|
/**
|
|
3203
|
-
*
|
|
3233
|
+
* Deletes the specified project role.
|
|
3204
3234
|
*
|
|
3205
3235
|
* @param name - Role name.
|
|
3206
3236
|
* @returns Returns the raw data of a deleted role.
|
|
@@ -3217,7 +3247,7 @@
|
|
|
3217
3247
|
.then((array) => array.map((data) => new Member(data, this.id, this.httpClient)));
|
|
3218
3248
|
}
|
|
3219
3249
|
/**
|
|
3220
|
-
* Returns the member
|
|
3250
|
+
* Returns information about the specified project member.
|
|
3221
3251
|
*
|
|
3222
3252
|
* @param memberId - Member ID.
|
|
3223
3253
|
*/
|
|
@@ -3230,7 +3260,7 @@
|
|
|
3230
3260
|
* Add a user to the project to become a member and have permission to perform actions.
|
|
3231
3261
|
*
|
|
3232
3262
|
* @param userId - User ID.
|
|
3233
|
-
* @param role -
|
|
3263
|
+
* @param role - Role name from the list of project roles.
|
|
3234
3264
|
*/
|
|
3235
3265
|
addMember(userId, role) {
|
|
3236
3266
|
return this.internalPost("/members", { userId, role })
|
|
@@ -3238,7 +3268,7 @@
|
|
|
3238
3268
|
.then((data) => new Member(data, this.id, this.httpClient));
|
|
3239
3269
|
}
|
|
3240
3270
|
/**
|
|
3241
|
-
* Remove
|
|
3271
|
+
* Remove the specified member from a project.
|
|
3242
3272
|
*
|
|
3243
3273
|
* @param memberId - Member ID.
|
|
3244
3274
|
* @returns Returns the raw data of a deleted member.
|
|
@@ -3308,12 +3338,12 @@
|
|
|
3308
3338
|
|
|
3309
3339
|
///////////////////////////////////////////////////////////////////////////////
|
|
3310
3340
|
/**
|
|
3311
|
-
*
|
|
3341
|
+
* Provides properties and methods for obtaining information about a server user and manage its data.
|
|
3312
3342
|
*/
|
|
3313
3343
|
class User {
|
|
3314
3344
|
/**
|
|
3315
|
-
* @param data -
|
|
3316
|
-
* @param httpClient -
|
|
3345
|
+
* @param data - Raw user data received from the server.
|
|
3346
|
+
* @param httpClient - HTTP client instance used to send REST API requests to the server.
|
|
3317
3347
|
*/
|
|
3318
3348
|
constructor(data, httpClient) {
|
|
3319
3349
|
this.httpClient = httpClient;
|
|
@@ -3329,7 +3359,7 @@
|
|
|
3329
3359
|
return this._data.avatarUrl;
|
|
3330
3360
|
}
|
|
3331
3361
|
/**
|
|
3332
|
-
* `true` if user is allowed to create a
|
|
3362
|
+
* `true` if user is allowed to create a projects.
|
|
3333
3363
|
*
|
|
3334
3364
|
* Only administrators can change create project permission.
|
|
3335
3365
|
*/
|
|
@@ -3479,7 +3509,8 @@
|
|
|
3479
3509
|
this._data.projectsLimit = value;
|
|
3480
3510
|
}
|
|
3481
3511
|
/**
|
|
3482
|
-
* The identity provider used to create the account. Can be `ldap`, `oauth`, `saml` or empty
|
|
3512
|
+
* The identity provider used to create the account. Can be `ldap`, `oauth`, `saml` or empty
|
|
3513
|
+
* for local accounts.
|
|
3483
3514
|
*
|
|
3484
3515
|
* @readonly
|
|
3485
3516
|
*/
|
|
@@ -3506,8 +3537,8 @@
|
|
|
3506
3537
|
return this.data.storageUsed;
|
|
3507
3538
|
}
|
|
3508
3539
|
/**
|
|
3509
|
-
* The user's access token (API key). Use
|
|
3510
|
-
* to
|
|
3540
|
+
* The user's access token (API key). Use
|
|
3541
|
+
* {@link Client.signInWithToken | Client.signInWithToken()} to sign in to the server using this token.
|
|
3511
3542
|
*
|
|
3512
3543
|
* @readonly
|
|
3513
3544
|
*/
|
|
@@ -3524,7 +3555,7 @@
|
|
|
3524
3555
|
this._data.userName = value;
|
|
3525
3556
|
}
|
|
3526
3557
|
/**
|
|
3527
|
-
*
|
|
3558
|
+
* Reloads user data from the server.
|
|
3528
3559
|
*
|
|
3529
3560
|
* Only administrators can checkout other users. If the current logged in user is not an
|
|
3530
3561
|
* administrator, they can only checkout themselves, otherwise an exception will be thrown.
|
|
@@ -3546,7 +3577,7 @@
|
|
|
3546
3577
|
return this;
|
|
3547
3578
|
}
|
|
3548
3579
|
/**
|
|
3549
|
-
*
|
|
3580
|
+
* Updates user data on the server.
|
|
3550
3581
|
*
|
|
3551
3582
|
* Only administrators can update other users. If the current logged in user is not an
|
|
3552
3583
|
* administrator, they can only update themself, otherwise an exception will be thrown.
|
|
@@ -3570,7 +3601,7 @@
|
|
|
3570
3601
|
return this;
|
|
3571
3602
|
}
|
|
3572
3603
|
/**
|
|
3573
|
-
*
|
|
3604
|
+
* Deletes a user from the server.
|
|
3574
3605
|
*
|
|
3575
3606
|
* Only administrators can delete users. If the current logged in user is not an
|
|
3576
3607
|
* administrator, an exception will be thrown.
|
|
@@ -3578,7 +3609,7 @@
|
|
|
3578
3609
|
* Administrators can delete themselves or other administrators. An administrator can only
|
|
3579
3610
|
* delete themself if they is not the last administrator.
|
|
3580
3611
|
*
|
|
3581
|
-
* You need to re-login
|
|
3612
|
+
* You need to re-login after deleting the current logged in user.
|
|
3582
3613
|
*
|
|
3583
3614
|
* @returns Returns the raw data of a deleted user.
|
|
3584
3615
|
*/
|
|
@@ -3601,14 +3632,14 @@
|
|
|
3601
3632
|
}
|
|
3602
3633
|
}
|
|
3603
3634
|
/**
|
|
3604
|
-
*
|
|
3605
|
-
* after any changes.
|
|
3635
|
+
* Saves user properties changes to the server. Call this method to update user data on the
|
|
3636
|
+
* server after any property changes.
|
|
3606
3637
|
*/
|
|
3607
3638
|
save() {
|
|
3608
3639
|
return this.update(this.data);
|
|
3609
3640
|
}
|
|
3610
3641
|
/**
|
|
3611
|
-
*
|
|
3642
|
+
* Sets or removes the user avatar.
|
|
3612
3643
|
*
|
|
3613
3644
|
* Only administrators can set the avatar of other users. If the current logged in user is
|
|
3614
3645
|
* not an administrator, they can only set their avatar, otherwise an exception will be thrown.
|
|
@@ -3617,9 +3648,9 @@
|
|
|
3617
3648
|
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}
|
|
3618
3649
|
* string,
|
|
3619
3650
|
* {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},
|
|
3620
|
-
* {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or
|
|
3621
|
-
* {@link https://developer.mozilla.org/docs/Web/API/File | File} object. Setting
|
|
3622
|
-
* `image` to `null` will remove the avatar.
|
|
3651
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or
|
|
3652
|
+
* {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting
|
|
3653
|
+
* the `image` to `null` will remove the avatar.
|
|
3623
3654
|
*/
|
|
3624
3655
|
async setAvatar(image) {
|
|
3625
3656
|
if (!image) {
|
|
@@ -3641,7 +3672,7 @@
|
|
|
3641
3672
|
return this;
|
|
3642
3673
|
}
|
|
3643
3674
|
/**
|
|
3644
|
-
*
|
|
3675
|
+
* Removes the user avatar.
|
|
3645
3676
|
*
|
|
3646
3677
|
* Only administrators can remove the avatar of other users. If the current logged in user is
|
|
3647
3678
|
* not an administrator, they can only remove their avatar, otherwise an exception will be thrown.
|
|
@@ -3663,13 +3694,13 @@
|
|
|
3663
3694
|
return this;
|
|
3664
3695
|
}
|
|
3665
3696
|
/**
|
|
3666
|
-
*
|
|
3697
|
+
* Changes the user password.
|
|
3667
3698
|
*
|
|
3668
3699
|
* Only administrators can change the passwords of other users. If the current logged in user
|
|
3669
3700
|
* is not an administrator, they can only change their password, otherwise an exception will
|
|
3670
3701
|
* be thrown.
|
|
3671
3702
|
*
|
|
3672
|
-
* To change their password, non-administrator users must
|
|
3703
|
+
* To change their password, non-administrator users must specify their old password.
|
|
3673
3704
|
*
|
|
3674
3705
|
* @param newPassword - New user password.
|
|
3675
3706
|
* @param oldPassword - Old user password. Only required for non-administrator users to
|
|
@@ -3695,25 +3726,24 @@
|
|
|
3695
3726
|
|
|
3696
3727
|
///////////////////////////////////////////////////////////////////////////////
|
|
3697
3728
|
/**
|
|
3698
|
-
*
|
|
3699
|
-
* {@link https://cloud.opendesign.com/docs/index.html#/opencloud_server | Open Cloud Server}
|
|
3700
|
-
* resources like Projects, Files, Issues etc.
|
|
3729
|
+
* Provides methods for managing server resources such as users, files, assemblies, jobs, projects, etc.
|
|
3701
3730
|
*/
|
|
3702
3731
|
class Client extends EventEmitter2 {
|
|
3703
3732
|
/**
|
|
3704
3733
|
* @param params - An object containing client configuration parameters.
|
|
3705
|
-
* @param params.serverUrl - Open Cloud Server URL.
|
|
3734
|
+
* @param params.serverUrl - Open Cloud Server REST API base URL.
|
|
3735
|
+
* @param params.url - Deprecated since `25.8`. Use `serverUrl` instead.
|
|
3706
3736
|
*/
|
|
3707
3737
|
constructor(params = {}) {
|
|
3708
3738
|
super();
|
|
3709
3739
|
this._serverUrl = "";
|
|
3710
|
-
this.
|
|
3740
|
+
this._httpClient = new HttpClient("");
|
|
3711
3741
|
this._user = null;
|
|
3712
3742
|
this.eventEmitter = this;
|
|
3713
3743
|
this.configure(params);
|
|
3714
3744
|
}
|
|
3715
3745
|
/**
|
|
3716
|
-
* Open Cloud Server URL. Use {@link configure | configure()} to change server URL.
|
|
3746
|
+
* Open Cloud Server REST API base URL. Use {@link configure | configure()} to change server URL.
|
|
3717
3747
|
*
|
|
3718
3748
|
* @readonly
|
|
3719
3749
|
*/
|
|
@@ -3721,7 +3751,15 @@
|
|
|
3721
3751
|
return this._serverUrl;
|
|
3722
3752
|
}
|
|
3723
3753
|
/**
|
|
3724
|
-
*
|
|
3754
|
+
* HTTP client instance used to send REST API requests and receive responses from the server.
|
|
3755
|
+
*
|
|
3756
|
+
* @readonly
|
|
3757
|
+
*/
|
|
3758
|
+
get httpClient() {
|
|
3759
|
+
return this._httpClient;
|
|
3760
|
+
}
|
|
3761
|
+
/**
|
|
3762
|
+
* Deprecated since `25.3`. Use `Viewer.options()` instead to change `Viewer` parameters.
|
|
3725
3763
|
*
|
|
3726
3764
|
* @deprecated
|
|
3727
3765
|
*/
|
|
@@ -3763,15 +3801,16 @@
|
|
|
3763
3801
|
};
|
|
3764
3802
|
}
|
|
3765
3803
|
/**
|
|
3766
|
-
*
|
|
3804
|
+
* Changes the client parameters.
|
|
3767
3805
|
*
|
|
3768
|
-
*
|
|
3769
|
-
*
|
|
3770
|
-
* @
|
|
3806
|
+
* After changing the parameters, you must re-login.
|
|
3807
|
+
*
|
|
3808
|
+
* @param params - An object containing new parameters.
|
|
3809
|
+
* @param params.serverUrl - Open Cloud Server REST API base URL.
|
|
3771
3810
|
*/
|
|
3772
3811
|
configure(params) {
|
|
3773
3812
|
this._serverUrl = (params.serverUrl || "").replace(/\/+$/, "");
|
|
3774
|
-
this.
|
|
3813
|
+
this._httpClient = new HttpClient(this.serverUrl);
|
|
3775
3814
|
this._user = null;
|
|
3776
3815
|
return this;
|
|
3777
3816
|
}
|
|
@@ -3783,7 +3822,7 @@
|
|
|
3783
3822
|
* @property {string} hash - Build hash.
|
|
3784
3823
|
*/
|
|
3785
3824
|
/**
|
|
3786
|
-
* Returns server
|
|
3825
|
+
* Returns client and server versions.
|
|
3787
3826
|
*/
|
|
3788
3827
|
version() {
|
|
3789
3828
|
return this.httpClient
|
|
@@ -3792,17 +3831,17 @@
|
|
|
3792
3831
|
.then((data) => ({
|
|
3793
3832
|
...data,
|
|
3794
3833
|
server: data.version,
|
|
3795
|
-
client: "25.8.
|
|
3834
|
+
client: "25.8.19",
|
|
3796
3835
|
}));
|
|
3797
3836
|
}
|
|
3798
3837
|
/**
|
|
3799
|
-
*
|
|
3838
|
+
* Registers a new user on the server.
|
|
3800
3839
|
*
|
|
3801
|
-
* @param email - User email. Cannot be empty.
|
|
3840
|
+
* @param email - User email. Cannot be empty. Must be unique within the server.
|
|
3802
3841
|
* @param password - User password. Cannot be empty. Password can only contain letters (a-z,
|
|
3803
3842
|
* A-Z), numbers (0-9), and special characters (~!@#$%^&*()_-+={}[]<>|/'":;.,?).
|
|
3804
|
-
* @param userName - User name. Cannot be empty or blank if defined.
|
|
3805
|
-
* `username` from email.
|
|
3843
|
+
* @param userName - User name. Cannot be empty or blank if defined. this to `undefined` to
|
|
3844
|
+
* use `username` from email.
|
|
3806
3845
|
*/
|
|
3807
3846
|
registerUser(email, password, userName) {
|
|
3808
3847
|
return this.httpClient
|
|
@@ -3814,7 +3853,7 @@
|
|
|
3814
3853
|
.then((response) => response.json());
|
|
3815
3854
|
}
|
|
3816
3855
|
/**
|
|
3817
|
-
*
|
|
3856
|
+
* Resends a Confirmation Email to the new user. If the user's email is already confirmed, an
|
|
3818
3857
|
* exception will be thrown.
|
|
3819
3858
|
*
|
|
3820
3859
|
* @param email - User email.
|
|
@@ -3826,7 +3865,8 @@
|
|
|
3826
3865
|
.then((response) => response.json());
|
|
3827
3866
|
}
|
|
3828
3867
|
/**
|
|
3829
|
-
*
|
|
3868
|
+
* Marks the user's email address as confirmed. If the user's email is already confirmed, an
|
|
3869
|
+
* exception will be thrown.
|
|
3830
3870
|
*
|
|
3831
3871
|
* @param emailConfirmationId - Confirmation code from the Confirmation Email.
|
|
3832
3872
|
*/
|
|
@@ -3874,8 +3914,8 @@
|
|
|
3874
3914
|
this.httpClient.signInUserIsAdmin = false;
|
|
3875
3915
|
}
|
|
3876
3916
|
/**
|
|
3877
|
-
* Returns the current logged in user
|
|
3878
|
-
*
|
|
3917
|
+
* Returns the current logged in user. Returns `null` if the user is not logged in or the
|
|
3918
|
+
* logged in user has deleted themself.
|
|
3879
3919
|
*/
|
|
3880
3920
|
getCurrentUser() {
|
|
3881
3921
|
if (this._user && !this.httpClient.signInUserId)
|
|
@@ -3883,13 +3923,7 @@
|
|
|
3883
3923
|
return this._user;
|
|
3884
3924
|
}
|
|
3885
3925
|
/**
|
|
3886
|
-
*
|
|
3887
|
-
*
|
|
3888
|
-
* To sign in with the provider in your web application:
|
|
3889
|
-
*
|
|
3890
|
-
* - Open the `provider.url` link using `window.open()`.
|
|
3891
|
-
* - Add a `/oauth` path (server-defined) handler to the router. In this handler, show an error
|
|
3892
|
-
* message if the `error` search parameter is present, or log in with the `token` search parameter.
|
|
3926
|
+
* Returns the list of server enabled indentity providers.
|
|
3893
3927
|
*/
|
|
3894
3928
|
getIdentityProviders() {
|
|
3895
3929
|
return this.httpClient.get("/identity").then((response) => response.json());
|
|
@@ -3901,7 +3935,7 @@
|
|
|
3901
3935
|
return this.httpClient.get("/settings").then((response) => response.json());
|
|
3902
3936
|
}
|
|
3903
3937
|
/**
|
|
3904
|
-
*
|
|
3938
|
+
* Changes the server settings.
|
|
3905
3939
|
*
|
|
3906
3940
|
* Only administrators can change server settings. If the current logged in user is not an
|
|
3907
3941
|
* administrator, an exception will be thrown.
|
|
@@ -3910,7 +3944,7 @@
|
|
|
3910
3944
|
return this.httpClient.put("/settings", settings).then((response) => response.json());
|
|
3911
3945
|
}
|
|
3912
3946
|
/**
|
|
3913
|
-
* Returns
|
|
3947
|
+
* Returns the list of server users.
|
|
3914
3948
|
*
|
|
3915
3949
|
* Only administrators can get a list of users. If the current logged in user is not an
|
|
3916
3950
|
* administrator, an exception will be thrown.
|
|
@@ -3923,7 +3957,7 @@
|
|
|
3923
3957
|
.then((array) => array.map((data) => new User(data, this.httpClient)));
|
|
3924
3958
|
}
|
|
3925
3959
|
/**
|
|
3926
|
-
* Returns the user
|
|
3960
|
+
* Returns information about the specified user.
|
|
3927
3961
|
*
|
|
3928
3962
|
* Only administrators can get other users. If the current logged in user is not an
|
|
3929
3963
|
* administrator, they can only get themselves, otherwise an exception will be thrown.
|
|
@@ -3950,18 +3984,18 @@
|
|
|
3950
3984
|
}
|
|
3951
3985
|
}
|
|
3952
3986
|
/**
|
|
3953
|
-
*
|
|
3987
|
+
* Creates a new user on the server.
|
|
3954
3988
|
*
|
|
3955
3989
|
* Only administrators can create users. If the current logged in user is not an
|
|
3956
3990
|
* administrator, an exception will be thrown.
|
|
3957
3991
|
*
|
|
3958
|
-
* @param email - User email. Cannot be empty.
|
|
3992
|
+
* @param email - User email. Cannot be empty. Must be unique within the server.
|
|
3959
3993
|
* @param password - User password. Cannot be empty. Password can only contain latin letters
|
|
3960
3994
|
* (a-z, A-Z), numbers (0-9), and special characters (~!@#$%^&*()_-+={}[]<>|/'":;.,?).
|
|
3961
3995
|
* @param params - Additional user data.
|
|
3962
3996
|
* @param params.isAdmin - `true` if user is an administrator.
|
|
3963
|
-
* @param params.userName - User name. Cannot be empty or blank if defined.
|
|
3964
|
-
* to use `username` from email.
|
|
3997
|
+
* @param params.userName - User name. Cannot be empty or blank if defined. Specify
|
|
3998
|
+
* `undefined` to use `username` from email.
|
|
3965
3999
|
* @param params.firstName - First name.
|
|
3966
4000
|
* @param params.lastName - Last name.
|
|
3967
4001
|
* @param params.canCreateProject - `true` if user is allowed to create a project.
|
|
@@ -3985,7 +4019,7 @@
|
|
|
3985
4019
|
.then((data) => new User(data, this.httpClient));
|
|
3986
4020
|
}
|
|
3987
4021
|
/**
|
|
3988
|
-
*
|
|
4022
|
+
* Deletes the specified user from the server.
|
|
3989
4023
|
*
|
|
3990
4024
|
* Only administrators can delete users. If the current logged in user is not an
|
|
3991
4025
|
* administrator, an exception will be thrown.
|
|
@@ -3993,7 +4027,7 @@
|
|
|
3993
4027
|
* Administrators can delete themselves or other administrators. An administrator can only
|
|
3994
4028
|
* delete themself if they is not the last administrator.
|
|
3995
4029
|
*
|
|
3996
|
-
* You need to re-login
|
|
4030
|
+
* You need to re-login after deleting the current logged in user.
|
|
3997
4031
|
*
|
|
3998
4032
|
* @param userId - User ID.
|
|
3999
4033
|
* @returns Returns the raw data of a deleted user.
|
|
@@ -4025,17 +4059,15 @@
|
|
|
4025
4059
|
* @property {number} size - The number of files in the result list.
|
|
4026
4060
|
*/
|
|
4027
4061
|
/**
|
|
4028
|
-
* Returns a list of files the user has access to.
|
|
4062
|
+
* Returns a list of files that the current logged in user has uploaded to the server or has access to.
|
|
4029
4063
|
*
|
|
4030
4064
|
* @param start - The starting index in the file list. Used for paging.
|
|
4031
4065
|
* @param limit - The maximum number of files that should be returned per request. Used for paging.
|
|
4032
|
-
* @param name - Filter the files by part of the name.
|
|
4066
|
+
* @param name - Filter the files by part of the name. Case sensitive.
|
|
4033
4067
|
* @param ext - Filter the files by extension. Extension can be `dgn`, `dwf`, `dwg`, `dxf`,
|
|
4034
4068
|
* `ifc`, `ifczip`, `nwc`, `nwd`, `obj`, `rcs`, `rfa`, `rvt`, `step`, `stl`, `stp`, `vsf`,
|
|
4035
|
-
* or any other
|
|
4036
|
-
*
|
|
4037
|
-
* @param ids - List of file IDs to return. You can specify multiple IDs on one `string` by
|
|
4038
|
-
* separating them with a `|`.
|
|
4069
|
+
* or any other file type extension.
|
|
4070
|
+
* @param ids - List of file IDs to return.
|
|
4039
4071
|
* @param sortByDesc - Allows to specify the descending order of the result. By default,
|
|
4040
4072
|
* files are sorted by name in ascending order.
|
|
4041
4073
|
* @param {string} sortField - Allows to specify sort field.
|
|
@@ -4079,7 +4111,7 @@
|
|
|
4079
4111
|
});
|
|
4080
4112
|
}
|
|
4081
4113
|
/**
|
|
4082
|
-
* Returns the file
|
|
4114
|
+
* Returns information about the specified file.
|
|
4083
4115
|
*
|
|
4084
4116
|
* @param fileId - File ID.
|
|
4085
4117
|
*/
|
|
@@ -4096,16 +4128,16 @@
|
|
|
4096
4128
|
*
|
|
4097
4129
|
* - {@link UploadProgressEvent | uploadprogress}
|
|
4098
4130
|
*
|
|
4099
|
-
* @param file -
|
|
4131
|
+
* @param file - {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object
|
|
4100
4132
|
* are generally retrieved from a
|
|
4101
4133
|
* {@link https://developer.mozilla.org/docs/Web/API/FileList | FileList} object returned as
|
|
4102
4134
|
* a result of a user selecting files using the HTML `<input>` element.
|
|
4103
4135
|
* @param params - An object containing upload parameters.
|
|
4104
|
-
* @param params.geometry - Create job to
|
|
4136
|
+
* @param params.geometry - Create job to convert file geometry data. Can be:
|
|
4105
4137
|
*
|
|
4106
|
-
* - `true` -
|
|
4107
|
-
* - `vsfx` -
|
|
4108
|
-
* - `gltf` -
|
|
4138
|
+
* - `true` - Convert file geometry data to `VSFX` format to open the file in `VisualizeJS` viewer.
|
|
4139
|
+
* - `vsfx` - Convert file geometry data to `VSFX` format to open the file in `VisualizeJS` viewer.
|
|
4140
|
+
* - `gltf` - Convert file geometry data to `glTF` format to open the file in `Three.js` viewer.
|
|
4109
4141
|
*
|
|
4110
4142
|
* @param params.properties - Create job to extract file properties.
|
|
4111
4143
|
* @param params.waitForDone - Wait for geometry and properties jobs to complete.
|
|
@@ -4114,7 +4146,7 @@
|
|
|
4114
4146
|
* @param params.interval - The time, in milliseconds, the function should delay in between
|
|
4115
4147
|
* checking jobs status.
|
|
4116
4148
|
* @param params.signal - An
|
|
4117
|
-
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
4149
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
4118
4150
|
* signal, which can be used to abort waiting as desired.
|
|
4119
4151
|
* @param params.onProgress - Upload progress callback.
|
|
4120
4152
|
*/
|
|
@@ -4145,7 +4177,10 @@
|
|
|
4145
4177
|
return result;
|
|
4146
4178
|
}
|
|
4147
4179
|
/**
|
|
4148
|
-
*
|
|
4180
|
+
* Deletes the specified file and all its versions from the server.
|
|
4181
|
+
*
|
|
4182
|
+
* You cannot delete a version file using `deleteFile()`, only the original file. To delete a
|
|
4183
|
+
* version file use {@link File.deleteVersion | File.deleteVersion()}.
|
|
4149
4184
|
*
|
|
4150
4185
|
* @param fileId - File ID.
|
|
4151
4186
|
* @returns Returns the raw data of a deleted file.
|
|
@@ -4154,7 +4189,7 @@
|
|
|
4154
4189
|
return this.httpClient.delete(`/files/${fileId}`).then((response) => response.json());
|
|
4155
4190
|
}
|
|
4156
4191
|
/**
|
|
4157
|
-
*
|
|
4192
|
+
* Downloads the specified file from the server.
|
|
4158
4193
|
*
|
|
4159
4194
|
* @param fileId - File ID.
|
|
4160
4195
|
* @param onProgress - Download progress callback.
|
|
@@ -4178,10 +4213,9 @@
|
|
|
4178
4213
|
* @property {number} size - The number of jobs in the result list.
|
|
4179
4214
|
*/
|
|
4180
4215
|
/**
|
|
4181
|
-
* Returns a list of jobs
|
|
4216
|
+
* Returns a list of jobs started by the current logged in user.
|
|
4182
4217
|
*
|
|
4183
|
-
* @param status - Filter the jobs by status. Status can be `waiting`, `inpogress`, `done` or
|
|
4184
|
-
* `failed`. You can specify multiple statuses on one `string` by separating them with a "|".
|
|
4218
|
+
* @param status - Filter the jobs by status. Status can be `waiting`, `inpogress`, `done` or `failed`.
|
|
4185
4219
|
* @param limit - The maximum number of jobs that should be returned per request. Used for paging.
|
|
4186
4220
|
* @param start - The starting index in the job list. Used for paging.
|
|
4187
4221
|
* @param sortByDesc - Allows to specify the descending order of the result. By default, jobs
|
|
@@ -4218,7 +4252,7 @@
|
|
|
4218
4252
|
}));
|
|
4219
4253
|
}
|
|
4220
4254
|
/**
|
|
4221
|
-
* Returns the job
|
|
4255
|
+
* Returns information about the specified job.
|
|
4222
4256
|
*
|
|
4223
4257
|
* @param jobId - Job ID.
|
|
4224
4258
|
*/
|
|
@@ -4229,15 +4263,15 @@
|
|
|
4229
4263
|
.then((data) => new Job(data, this.httpClient));
|
|
4230
4264
|
}
|
|
4231
4265
|
/**
|
|
4232
|
-
*
|
|
4266
|
+
* Runs a new job on the server for the sepecified file.
|
|
4233
4267
|
*
|
|
4234
4268
|
* @param fileId - File ID.
|
|
4235
4269
|
* @param outputFormat - The job type. Can be one of:
|
|
4236
4270
|
*
|
|
4237
|
-
* - `geometry` -
|
|
4238
|
-
* - `geometryGltf` -
|
|
4271
|
+
* - `geometry` - Convert file geometry data to `VSFX` format suitable for `VisualizeJS` viewer.
|
|
4272
|
+
* - `geometryGltf` - Convert file geometry data to `glTF` format suitable for `Three.js` viewer.
|
|
4239
4273
|
* - `properties` - Extract file properties.
|
|
4240
|
-
* - `validation` - Validate the file. Only for `IFC
|
|
4274
|
+
* - `validation` - Validate the file. Only for `IFC` files.
|
|
4241
4275
|
* - `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` - Export file to the one of the supported format.
|
|
4242
4276
|
* - Other custom job name. Custom job runner must be registered in the job templates table
|
|
4243
4277
|
* before creating a job.
|
|
@@ -4256,8 +4290,8 @@
|
|
|
4256
4290
|
.then((data) => new Job(data, this.httpClient));
|
|
4257
4291
|
}
|
|
4258
4292
|
/**
|
|
4259
|
-
*
|
|
4260
|
-
* already
|
|
4293
|
+
* Deletes the specified job from the server job list. Jobs that are in progress or have
|
|
4294
|
+
* already been completed cannot be deleted.
|
|
4261
4295
|
*
|
|
4262
4296
|
* @param jobId - Job ID.
|
|
4263
4297
|
* @returns Returns the raw data of a deleted job.
|
|
@@ -4276,14 +4310,13 @@
|
|
|
4276
4310
|
* @property {number} size - The number of assemblies in the result list.
|
|
4277
4311
|
*/
|
|
4278
4312
|
/**
|
|
4279
|
-
* Returns a list of assemblies the
|
|
4313
|
+
* Returns a list of assemblies created by the current logged in user.
|
|
4280
4314
|
*
|
|
4281
4315
|
* @param start - The starting index in the assembly list. Used for paging.
|
|
4282
4316
|
* @param limit - The maximum number of assemblies that should be returned per request. Used
|
|
4283
4317
|
* for paging.
|
|
4284
|
-
* @param name - Filter the assemblies by part of the name.
|
|
4285
|
-
* @param ids - List of assembly IDs to return.
|
|
4286
|
-
* by separating them with a "|".
|
|
4318
|
+
* @param name - Filter the assemblies by part of the name. Case sensitive.
|
|
4319
|
+
* @param ids - List of assembly IDs to return.
|
|
4287
4320
|
* @param sortByDesc - Allows to specify the descending order of the result. By default
|
|
4288
4321
|
* assemblies are sorted by name in ascending order.
|
|
4289
4322
|
* @param sortField - Allows to specify sort field.
|
|
@@ -4322,7 +4355,7 @@
|
|
|
4322
4355
|
});
|
|
4323
4356
|
}
|
|
4324
4357
|
/**
|
|
4325
|
-
*
|
|
4358
|
+
* Returns information about the specified assembly.
|
|
4326
4359
|
*
|
|
4327
4360
|
* @param assemblyId - Assembly ID.
|
|
4328
4361
|
*/
|
|
@@ -4333,12 +4366,21 @@
|
|
|
4333
4366
|
.then((data) => new Assembly(data, this.httpClient));
|
|
4334
4367
|
}
|
|
4335
4368
|
/**
|
|
4336
|
-
*
|
|
4369
|
+
* Creates a new assembly on the server.
|
|
4337
4370
|
*
|
|
4338
4371
|
* @param files - List of file IDs.
|
|
4339
4372
|
* @param name - Assembly name.
|
|
4340
|
-
* @param params -
|
|
4373
|
+
* @param params - Additional assembly creating parameters.
|
|
4341
4374
|
* @param params.waitForDone - Wait for assembly to be created.
|
|
4375
|
+
* @param params.timeout - The time, in milliseconds, that the function should wait for the
|
|
4376
|
+
* assembly to be created. If the assembly is not created within this time, a TimeoutError
|
|
4377
|
+
* exception will be thrown.
|
|
4378
|
+
* @param params.interval - The time, in milliseconds, the function should delay in between
|
|
4379
|
+
* checking assembly status.
|
|
4380
|
+
* @param params.signal - An
|
|
4381
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
4382
|
+
* signal, which can be used to abort waiting as desired.
|
|
4383
|
+
* @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.
|
|
4342
4384
|
*/
|
|
4343
4385
|
createAssembly(files, name, params) {
|
|
4344
4386
|
const { waitForDone } = params !== null && params !== void 0 ? params : {};
|
|
@@ -4349,7 +4391,7 @@
|
|
|
4349
4391
|
.then((result) => (waitForDone ? result.waitForDone(params) : result));
|
|
4350
4392
|
}
|
|
4351
4393
|
/**
|
|
4352
|
-
*
|
|
4394
|
+
* Deletes the specified assembly from the server.
|
|
4353
4395
|
*
|
|
4354
4396
|
* @param assemblyId - Assembly ID.
|
|
4355
4397
|
* @returns Returns the raw data of a deleted assembly.
|
|
@@ -4368,13 +4410,12 @@
|
|
|
4368
4410
|
* @property {number} size - The number of projects in the result list.
|
|
4369
4411
|
*/
|
|
4370
4412
|
/**
|
|
4371
|
-
* Returns a list of projects the user has access to.
|
|
4413
|
+
* Returns a list of projects that the currently logged in user has created or has access to.
|
|
4372
4414
|
*
|
|
4373
4415
|
* @param start - The starting index in the project list. Used for paging.
|
|
4374
4416
|
* @param limit - The maximum number of projects that should be returned per request. Used for paging.
|
|
4375
|
-
* @param name - Filter the projects by part of the name.
|
|
4376
|
-
* @param ids - List of project IDs to return.
|
|
4377
|
-
* by separating them with a "|".
|
|
4417
|
+
* @param name - Filter the projects by part of the name. Case sensitive.
|
|
4418
|
+
* @param ids - List of project IDs to return.
|
|
4378
4419
|
* @param sortByDesc - Allows to specify the descending order of the result. By default
|
|
4379
4420
|
* projects are sorted by name in ascending order.
|
|
4380
4421
|
*/
|
|
@@ -4432,7 +4473,7 @@
|
|
|
4432
4473
|
});
|
|
4433
4474
|
}
|
|
4434
4475
|
/**
|
|
4435
|
-
* Returns the project
|
|
4476
|
+
* Returns information about the specified project.
|
|
4436
4477
|
*
|
|
4437
4478
|
* @param projectId - Project ID.
|
|
4438
4479
|
*/
|
|
@@ -4443,7 +4484,7 @@
|
|
|
4443
4484
|
.then((data) => new Project(data, this.httpClient));
|
|
4444
4485
|
}
|
|
4445
4486
|
/**
|
|
4446
|
-
*
|
|
4487
|
+
* Creates a new project on the server.
|
|
4447
4488
|
*
|
|
4448
4489
|
* @param name - Project name.
|
|
4449
4490
|
* @param description - Project description.
|
|
@@ -4462,7 +4503,7 @@
|
|
|
4462
4503
|
.then((data) => new Project(data, this.httpClient));
|
|
4463
4504
|
}
|
|
4464
4505
|
/**
|
|
4465
|
-
*
|
|
4506
|
+
* Deletes the specified project from the server.
|
|
4466
4507
|
*
|
|
4467
4508
|
* @param projectId - Project ID.
|
|
4468
4509
|
* @returns Returns the raw data of a deleted project.
|
|
@@ -4484,7 +4525,7 @@
|
|
|
4484
4525
|
}
|
|
4485
4526
|
|
|
4486
4527
|
///////////////////////////////////////////////////////////////////////////////
|
|
4487
|
-
const version = "25.8.
|
|
4528
|
+
const version = "25.8.19";
|
|
4488
4529
|
|
|
4489
4530
|
exports.Assembly = Assembly;
|
|
4490
4531
|
exports.ClashTest = ClashTest;
|