@inweb/client 25.2.2
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/LICENSE +20 -0
- package/README.md +70 -0
- package/dist/client.js +21126 -0
- package/dist/client.js.map +1 -0
- package/dist/client.min.js +1 -0
- package/dist/client.module.js +7151 -0
- package/dist/client.module.js.map +1 -0
- package/lib/Api/Assembly.d.ts +339 -0
- package/lib/Api/ClashTest.d.ts +176 -0
- package/lib/Api/Client.d.ts +452 -0
- package/lib/Api/ClientEvents.d.ts +29 -0
- package/lib/Api/File.d.ts +568 -0
- package/lib/Api/HttpClient.d.ts +13 -0
- package/lib/Api/IAssembly.d.ts +14 -0
- package/lib/Api/IFile.d.ts +46 -0
- package/lib/Api/IHttpClient.d.ts +11 -0
- package/lib/Api/IUser.d.ts +11 -0
- package/lib/Api/Job.d.ts +142 -0
- package/lib/Api/Member.d.ts +85 -0
- package/lib/Api/Model.d.ts +147 -0
- package/lib/Api/Permission.d.ts +93 -0
- package/lib/Api/Project.d.ts +247 -0
- package/lib/Api/Role.d.ts +82 -0
- package/lib/Api/User.d.ts +197 -0
- package/lib/Api/impl/FetchError.d.ts +18 -0
- package/lib/Api/impl/Utils.d.ts +33 -0
- package/lib/Api/impl/http.d.ts +67 -0
- package/lib/ConvetMath.d.ts +29 -0
- package/lib/Viewer/CanvasEvents.d.ts +2 -0
- package/lib/Viewer/Commands/ApplyModelTransform.d.ts +2 -0
- package/lib/Viewer/Commands/ClearMarkup.d.ts +2 -0
- package/lib/Viewer/Commands/ClearSlices.d.ts +2 -0
- package/lib/Viewer/Commands/CreatePreview.d.ts +2 -0
- package/lib/Viewer/Commands/Explode.d.ts +2 -0
- package/lib/Viewer/Commands/GetDefaultViewPositions.d.ts +2 -0
- package/lib/Viewer/Commands/GetModels.d.ts +2 -0
- package/lib/Viewer/Commands/GetSelected.d.ts +2 -0
- package/lib/Viewer/Commands/HideSelected.d.ts +2 -0
- package/lib/Viewer/Commands/IsolateSelected.d.ts +2 -0
- package/lib/Viewer/Commands/RegenerateAll.d.ts +2 -0
- package/lib/Viewer/Commands/ResetView.d.ts +2 -0
- package/lib/Viewer/Commands/SelectModel.d.ts +2 -0
- package/lib/Viewer/Commands/SetActiveDragger.d.ts +2 -0
- package/lib/Viewer/Commands/SetDefaultViewPosition.d.ts +2 -0
- package/lib/Viewer/Commands/SetMarkupColor.d.ts +2 -0
- package/lib/Viewer/Commands/SetSelected.d.ts +2 -0
- package/lib/Viewer/Commands/ShowAll.d.ts +2 -0
- package/lib/Viewer/Commands/Unselect.d.ts +2 -0
- package/lib/Viewer/Commands/ZoomToExtents.d.ts +2 -0
- package/lib/Viewer/Commands/ZoomToObjects.d.ts +2 -0
- package/lib/Viewer/Commands/ZoomToSelected.d.ts +2 -0
- package/lib/Viewer/Commands.d.ts +3 -0
- package/lib/Viewer/Draggers/Actions/OrbitAction.d.ts +22 -0
- package/lib/Viewer/Draggers/Actions/PanAction.d.ts +18 -0
- package/lib/Viewer/Draggers/Actions/ZoomAction.d.ts +8 -0
- package/lib/Viewer/Draggers/Common/Geometry.d.ts +115 -0
- package/lib/Viewer/Draggers/Common/GestureManager.d.ts +41 -0
- package/lib/Viewer/Draggers/Common/OdBaseDragger.d.ts +54 -0
- package/lib/Viewer/Draggers/Common/OdaGeAction.d.ts +30 -0
- package/lib/Viewer/Draggers/MeasureLineDragger/MeasureLineItem.d.ts +31 -0
- package/lib/Viewer/Draggers/MeasureLineDragger/MeasureUtils.d.ts +20 -0
- package/lib/Viewer/Draggers/MeasureLineDragger/index.d.ts +24 -0
- package/lib/Viewer/Draggers/OdBaseCuttingPlaneDragger.d.ts +27 -0
- package/lib/Viewer/Draggers/OdCuttingPlaneXAxisDragger.d.ts +8 -0
- package/lib/Viewer/Draggers/OdCuttingPlaneYAxisDragger.d.ts +8 -0
- package/lib/Viewer/Draggers/OdCuttingPlaneZAxisDragger.d.ts +8 -0
- package/lib/Viewer/Draggers/OdOrbitDragger.d.ts +15 -0
- package/lib/Viewer/Draggers/OdPanDragger.d.ts +12 -0
- package/lib/Viewer/Draggers/OdZoomDragger.d.ts +12 -0
- package/lib/Viewer/Draggers/OdZoomWheelDragger.d.ts +11 -0
- package/lib/Viewer/Draggers/OdZoomWindowDragger/OdSelectionFrame.d.ts +19 -0
- package/lib/Viewer/Draggers/OdZoomWindowDragger/index.d.ts +14 -0
- package/lib/Viewer/Draggers/OdaLineDragger.d.ts +15 -0
- package/lib/Viewer/Draggers/OdaTextDragger.d.ts +16 -0
- package/lib/Viewer/Draggers/OdaWalkDragger.d.ts +30 -0
- package/lib/Viewer/Draggers/OrbitAroundBuildingDragger.d.ts +19 -0
- package/lib/Viewer/EventEmitter2.d.ts +54 -0
- package/lib/Viewer/ICommands.d.ts +25 -0
- package/lib/Viewer/IEventEmitter2.d.ts +13 -0
- package/lib/Viewer/IViewer.d.ts +27 -0
- package/lib/Viewer/Loaders/BaseLoader.d.ts +11 -0
- package/lib/Viewer/Loaders/LoaderFactory.d.ts +10 -0
- package/lib/Viewer/Loaders/TCSLoader.d.ts +5 -0
- package/lib/Viewer/Loaders/UpdaterController.d.ts +15 -0
- package/lib/Viewer/Loaders/VsfXLoader.d.ts +5 -0
- package/lib/Viewer/Loaders/VsfXPartialLoader.d.ts +5 -0
- package/lib/Viewer/Markup/Api/IMarkupArrow.d.ts +12 -0
- package/lib/Viewer/Markup/Api/IMarkupColorable.d.ts +5 -0
- package/lib/Viewer/Markup/Api/IMarkupEllipse.d.ts +15 -0
- package/lib/Viewer/Markup/Api/IMarkupImage.d.ts +15 -0
- package/lib/Viewer/Markup/Api/IMarkupLine.d.ts +11 -0
- package/lib/Viewer/Markup/Api/IMarkupObject.d.ts +12 -0
- package/lib/Viewer/Markup/Api/IMarkupRectangle.d.ts +15 -0
- package/lib/Viewer/Markup/Api/IMarkupText.d.ts +13 -0
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaArrow.d.ts +32 -0
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaEllipse.d.ts +40 -0
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaImage.d.ts +36 -0
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaLine.d.ts +32 -0
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaRectangle.d.ts +38 -0
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaText.d.ts +37 -0
- package/lib/Viewer/Markup/IMarkup.d.ts +38 -0
- package/lib/Viewer/Markup/Impl/Konva/KonvaMarkup.d.ts +63 -0
- package/lib/Viewer/Markup/Impl/Konva/MarkupColor.d.ts +19 -0
- package/lib/Viewer/Markup/Impl/Visualize/VisualizeMarkup.d.ts +33 -0
- package/lib/Viewer/Markup/MarkupFactory.d.ts +7 -0
- package/lib/Viewer/Options.d.ts +228 -0
- package/lib/Viewer/OptionsEvents.d.ts +26 -0
- package/lib/Viewer/Viewer.d.ts +353 -0
- package/lib/Viewer/ViewerCommands.d.ts +23 -0
- package/lib/Viewer/ViewerEvents.d.ts +601 -0
- package/lib/Viewer/utils.d.ts +4 -0
- package/lib/index.d.ts +24 -0
- package/package.json +32 -0
- package/src/Api/Assembly.ts +678 -0
- package/src/Api/ClashTest.ts +290 -0
- package/src/Api/Client.ts +816 -0
- package/src/Api/ClientEvents.ts +31 -0
- package/src/Api/File.ts +962 -0
- package/src/Api/HttpClient.ts +73 -0
- package/src/Api/IAssembly.ts +37 -0
- package/src/Api/IFile.ts +74 -0
- package/src/Api/IHttpClient.ts +50 -0
- package/src/Api/IUser.ts +33 -0
- package/src/Api/Job.ts +253 -0
- package/src/Api/Member.ts +161 -0
- package/src/Api/Model.ts +259 -0
- package/src/Api/Permission.ts +173 -0
- package/src/Api/Project.ts +479 -0
- package/src/Api/Role.ts +158 -0
- package/src/Api/User.ts +357 -0
- package/src/Api/impl/FetchError.ts +48 -0
- package/src/Api/impl/Utils.ts +367 -0
- package/src/Api/impl/http.ts +92 -0
- package/src/ConvetMath.ts +372 -0
- package/src/Viewer/CanvasEvents.ts +41 -0
- package/src/Viewer/Commands/ApplyModelTransform.ts +70 -0
- package/src/Viewer/Commands/ClearMarkup.ts +28 -0
- package/src/Viewer/Commands/ClearSlices.ts +27 -0
- package/src/Viewer/Commands/CreatePreview.ts +33 -0
- package/src/Viewer/Commands/Explode.ts +38 -0
- package/src/Viewer/Commands/GetDefaultViewPositions.ts +36 -0
- package/src/Viewer/Commands/GetModels.ts +43 -0
- package/src/Viewer/Commands/GetSelected.ts +58 -0
- package/src/Viewer/Commands/HideSelected.ts +37 -0
- package/src/Viewer/Commands/IsolateSelected.ts +37 -0
- package/src/Viewer/Commands/RegenerateAll.ts +37 -0
- package/src/Viewer/Commands/ResetView.ts +43 -0
- package/src/Viewer/Commands/SelectModel.ts +52 -0
- package/src/Viewer/Commands/SetActiveDragger.ts +29 -0
- package/src/Viewer/Commands/SetDefaultViewPosition.ts +50 -0
- package/src/Viewer/Commands/SetMarkupColor.ts +29 -0
- package/src/Viewer/Commands/SetSelected.ts +47 -0
- package/src/Viewer/Commands/ShowAll.ts +37 -0
- package/src/Viewer/Commands/Unselect.ts +37 -0
- package/src/Viewer/Commands/ZoomToExtents.ts +43 -0
- package/src/Viewer/Commands/ZoomToObjects.ts +47 -0
- package/src/Viewer/Commands/ZoomToSelected.ts +39 -0
- package/src/Viewer/Commands.ts +81 -0
- package/src/Viewer/Draggers/Actions/OrbitAction.ts +250 -0
- package/src/Viewer/Draggers/Actions/PanAction.ts +102 -0
- package/src/Viewer/Draggers/Actions/ZoomAction.ts +45 -0
- package/src/Viewer/Draggers/Common/Geometry.ts +152 -0
- package/src/Viewer/Draggers/Common/GestureManager.ts +263 -0
- package/src/Viewer/Draggers/Common/OdBaseDragger.ts +270 -0
- package/src/Viewer/Draggers/Common/OdaGeAction.ts +146 -0
- package/src/Viewer/Draggers/MeasureLineDragger/MeasureLineItem.ts +248 -0
- package/src/Viewer/Draggers/MeasureLineDragger/MeasureUtils.ts +182 -0
- package/src/Viewer/Draggers/MeasureLineDragger/index.ts +166 -0
- package/src/Viewer/Draggers/OdBaseCuttingPlaneDragger.ts +182 -0
- package/src/Viewer/Draggers/OdCuttingPlaneXAxisDragger.ts +53 -0
- package/src/Viewer/Draggers/OdCuttingPlaneYAxisDragger.ts +53 -0
- package/src/Viewer/Draggers/OdCuttingPlaneZAxisDragger.ts +53 -0
- package/src/Viewer/Draggers/OdOrbitDragger.ts +70 -0
- package/src/Viewer/Draggers/OdPanDragger.ts +62 -0
- package/src/Viewer/Draggers/OdZoomDragger.ts +59 -0
- package/src/Viewer/Draggers/OdZoomWheelDragger.ts +103 -0
- package/src/Viewer/Draggers/OdZoomWindowDragger/OdSelectionFrame.ts +123 -0
- package/src/Viewer/Draggers/OdZoomWindowDragger/index.ts +75 -0
- package/src/Viewer/Draggers/OdaLineDragger.ts +80 -0
- package/src/Viewer/Draggers/OdaTextDragger.ts +118 -0
- package/src/Viewer/Draggers/OdaWalkDragger.ts +278 -0
- package/src/Viewer/Draggers/OrbitAroundBuildingDragger.ts +184 -0
- package/src/Viewer/EventEmitter2.ts +116 -0
- package/src/Viewer/ICommands.ts +53 -0
- package/src/Viewer/IEventEmitter2.ts +36 -0
- package/src/Viewer/IViewer.ts +55 -0
- package/src/Viewer/Loaders/BaseLoader.ts +40 -0
- package/src/Viewer/Loaders/LoaderFactory.ts +44 -0
- package/src/Viewer/Loaders/TCSLoader.ts +82 -0
- package/src/Viewer/Loaders/UpdaterController.ts +36 -0
- package/src/Viewer/Loaders/VsfXLoader.ts +87 -0
- package/src/Viewer/Loaders/VsfXPartialLoader.ts +208 -0
- package/src/Viewer/Markup/Api/IMarkupArrow.ts +15 -0
- package/src/Viewer/Markup/Api/IMarkupColorable.ts +4 -0
- package/src/Viewer/Markup/Api/IMarkupEllipse.ts +15 -0
- package/src/Viewer/Markup/Api/IMarkupImage.ts +15 -0
- package/src/Viewer/Markup/Api/IMarkupLine.ts +10 -0
- package/src/Viewer/Markup/Api/IMarkupObject.ts +15 -0
- package/src/Viewer/Markup/Api/IMarkupRectangle.ts +15 -0
- package/src/Viewer/Markup/Api/IMarkupText.ts +12 -0
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaArrow.ts +119 -0
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaEllipse.ts +113 -0
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaImage.ts +121 -0
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaLine.ts +99 -0
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaRectangle.ts +113 -0
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaText.ts +104 -0
- package/src/Viewer/Markup/IMarkup.ts +39 -0
- package/src/Viewer/Markup/Impl/Konva/KonvaMarkup.ts +872 -0
- package/src/Viewer/Markup/Impl/Konva/MarkupColor.ts +39 -0
- package/src/Viewer/Markup/Impl/Visualize/VisualizeMarkup.ts +273 -0
- package/src/Viewer/Markup/MarkupFactory.ts +32 -0
- package/src/Viewer/Options.ts +502 -0
- package/src/Viewer/OptionsEvents.ts +28 -0
- package/src/Viewer/Viewer.ts +1109 -0
- package/src/Viewer/ViewerCommands.ts +45 -0
- package/src/Viewer/ViewerEvents.ts +700 -0
- package/src/Viewer/utils.ts +74 -0
- package/src/index.ts +48 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
+
// Copyright (C) 2002-2021, Open Design Alliance (the "Alliance").
|
|
3
|
+
// All rights reserved.
|
|
4
|
+
//
|
|
5
|
+
// This software and its documentation and related materials are owned by
|
|
6
|
+
// the Alliance. The software may only be incorporated into application
|
|
7
|
+
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
+
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
+
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
+
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
+
// protected by copyright law and international treaty provisions. Application
|
|
12
|
+
// programs incorporating this software must include the following statement
|
|
13
|
+
// with their copyright notices:
|
|
14
|
+
//
|
|
15
|
+
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
+
// license agreement with Open Design Alliance.
|
|
17
|
+
// Open Design Alliance Copyright (C) 2002-2021 by Open Design Alliance.
|
|
18
|
+
// All rights reserved.
|
|
19
|
+
//
|
|
20
|
+
// By use of this software, its documentation or related materials, you
|
|
21
|
+
// acknowledge and accept the above terms.
|
|
22
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
+
|
|
24
|
+
import { IHttpClient } from "./IHttpClient";
|
|
25
|
+
import { IShortUserDescription } from "./IUser";
|
|
26
|
+
import { waitFor, userFullName, userInitials } from "./impl/Utils";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The base class provides information about the file/assembly clash detection test and test results.
|
|
30
|
+
*/
|
|
31
|
+
export class ClashTest {
|
|
32
|
+
private _data: any;
|
|
33
|
+
private basePath: string;
|
|
34
|
+
private httpClient: IHttpClient;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @param data - Raw test data.
|
|
38
|
+
* @param basePath - Clash tests API base path for the owner file/assembly.
|
|
39
|
+
* @param httpClient - Http client.
|
|
40
|
+
*/
|
|
41
|
+
constructor(data: any, basePath: string, httpClient: IHttpClient) {
|
|
42
|
+
this.httpClient = httpClient;
|
|
43
|
+
this.basePath = basePath;
|
|
44
|
+
this.data = data;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
protected internalGet(relativePath: string): Promise<any> {
|
|
48
|
+
return this.httpClient.get(`${this.basePath}/clashes/${this.id}${relativePath}`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
protected internalPut(
|
|
52
|
+
relativePath: string,
|
|
53
|
+
body?: ArrayBuffer | Blob | globalThis.File | FormData | object | string | null
|
|
54
|
+
): Promise<any> {
|
|
55
|
+
return this.httpClient.put(`${this.basePath}/clashes/${this.id}${relativePath}`, body);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
protected internalDelete(relativePath: string): Promise<any> {
|
|
59
|
+
return this.httpClient.delete(`${this.basePath}/clashes/${this.id}${relativePath}`);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The type of the clashes that the test detects:
|
|
64
|
+
*
|
|
65
|
+
* - `Сlearance clash` (true) - a clash in which the entity A may or may not intersect with
|
|
66
|
+
* entity B, but comes within a distance of less than the `tolerance`.
|
|
67
|
+
* - `Hard clash` (false) - a clash in which the entity A intersects with entity B by a
|
|
68
|
+
* distance of more than the `tolerance`.
|
|
69
|
+
*
|
|
70
|
+
* @readonly
|
|
71
|
+
*/
|
|
72
|
+
get clearance(): boolean {
|
|
73
|
+
return this.data.clearance;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Test creation time (UTC) in the format specified in <a
|
|
78
|
+
* href="https://www.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601</a>.
|
|
79
|
+
*
|
|
80
|
+
* @readonly
|
|
81
|
+
*/
|
|
82
|
+
get createdAt(): string {
|
|
83
|
+
return this.data.createdAt;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Raw test data received from the server.
|
|
88
|
+
*
|
|
89
|
+
* @readonly
|
|
90
|
+
*/
|
|
91
|
+
get data(): any {
|
|
92
|
+
return this._data;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
private set data(value: any) {
|
|
96
|
+
this._data = value;
|
|
97
|
+
this._data.owner.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.owner.userId}/avatar`;
|
|
98
|
+
this._data.owner.fullName = userFullName(this._data.owner);
|
|
99
|
+
this._data.owner.initials = userInitials(this._data.owner.fullName);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Unique test ID.
|
|
104
|
+
*
|
|
105
|
+
* @readonly
|
|
106
|
+
*/
|
|
107
|
+
get id(): string {
|
|
108
|
+
return this.data.id;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Test last update (UTC) time in the format specified in <a
|
|
113
|
+
* href="https://www.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601</a>.
|
|
114
|
+
*
|
|
115
|
+
* @readonly
|
|
116
|
+
*/
|
|
117
|
+
get lastModifiedAt(): string {
|
|
118
|
+
return this.data.lastModifiedAt;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Test name.
|
|
123
|
+
*/
|
|
124
|
+
get name(): string {
|
|
125
|
+
return this.data.name;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
set name(value: string) {
|
|
129
|
+
this.data.name = value;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Test owner information.
|
|
134
|
+
*
|
|
135
|
+
* @property {string} userId - User ID.
|
|
136
|
+
* @property {string} userName - User name.
|
|
137
|
+
* @property {string} name - First name.
|
|
138
|
+
* @property {string} lastName - Last name.
|
|
139
|
+
* @property {string} fullName - Full name.
|
|
140
|
+
* @property {string} initials - Initials.
|
|
141
|
+
* @property {string} email - User email.
|
|
142
|
+
* @property {string} avatarUrl - User avatar image URL.
|
|
143
|
+
* @readonly
|
|
144
|
+
*/
|
|
145
|
+
get owner(): IShortUserDescription {
|
|
146
|
+
return this.data.owner;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* First selection set for clash detection. Entities from `selectionSetA` will be tested
|
|
151
|
+
* against each others by entities from the `selectionSetB` during the test.
|
|
152
|
+
*
|
|
153
|
+
* @readonly
|
|
154
|
+
*/
|
|
155
|
+
get selectionSetA(): string[] {
|
|
156
|
+
return this.data.selectionSetA;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The type of first selection set for clash detection. Can be one of:
|
|
161
|
+
*
|
|
162
|
+
* - `all` - All file/assembly entities.
|
|
163
|
+
* - `handle` - Entities with handles specified in the `selectionSetA`.
|
|
164
|
+
* - `models` - Entities of file/assembly models specified in `selectionSetA`.
|
|
165
|
+
* - `searchquery` - Entities retrieved by the search queries specified in `selectionSetA`.
|
|
166
|
+
*
|
|
167
|
+
* @readonly
|
|
168
|
+
*/
|
|
169
|
+
get selectionTypeA(): string {
|
|
170
|
+
return this.data.selectionTypeA;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Second selection set for clash detection. Entities from `selectionSetB` will be tested
|
|
175
|
+
* against each others by entities from the `selectionSetA` during the test.
|
|
176
|
+
*
|
|
177
|
+
* @readonly
|
|
178
|
+
*/
|
|
179
|
+
get selectionSetB(): string[] {
|
|
180
|
+
return this.data.selectionSetB;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* The type of second selection set for clash detection. Can be one of:
|
|
185
|
+
*
|
|
186
|
+
* - `all` - All file/assembly entities.
|
|
187
|
+
* - `handle` - Entities with handles specified in the `selectionSetB`.
|
|
188
|
+
* - `models` - Entities of file/assembly models specified in `selectionSetB`.
|
|
189
|
+
* - `searchquery` - Entities retrieved by the search queries specified in `selectionSetB`.
|
|
190
|
+
*
|
|
191
|
+
* @readonly
|
|
192
|
+
*/
|
|
193
|
+
get selectionTypeB(): string {
|
|
194
|
+
return this.data.selectionTypeB;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Test status. Can be `none`, `waiting`, `inprogress`, `done` or `failed`.
|
|
199
|
+
*
|
|
200
|
+
* @readonly
|
|
201
|
+
*/
|
|
202
|
+
get status(): string {
|
|
203
|
+
return this.data.status;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* The distance of separation between entities at which test begins detecting clashes.
|
|
208
|
+
*
|
|
209
|
+
* @readonly
|
|
210
|
+
*/
|
|
211
|
+
get tolerance(): number {
|
|
212
|
+
return this.data.tolerance;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Refresh test data.
|
|
217
|
+
*
|
|
218
|
+
* @async
|
|
219
|
+
*/
|
|
220
|
+
checkout(): Promise<this> {
|
|
221
|
+
return this.internalGet("")
|
|
222
|
+
.then((response) => response.json())
|
|
223
|
+
.then((data) => {
|
|
224
|
+
this.data = data;
|
|
225
|
+
return this;
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Update test data on the server.
|
|
231
|
+
*
|
|
232
|
+
* @async
|
|
233
|
+
* @param data - Raw test data.
|
|
234
|
+
*/
|
|
235
|
+
update(data: any): Promise<this> {
|
|
236
|
+
return this.internalPut("", data)
|
|
237
|
+
.then((response) => response.json())
|
|
238
|
+
.then((data) => {
|
|
239
|
+
this.data = data;
|
|
240
|
+
return this;
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Remove a test from a file.
|
|
246
|
+
*
|
|
247
|
+
* @async
|
|
248
|
+
* @returns Returns the raw data of a deleted test.
|
|
249
|
+
*/
|
|
250
|
+
delete(): Promise<any> {
|
|
251
|
+
return this.internalDelete("").then((response) => response.json());
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Save test data changes to the server. Call this method to update test data on the server
|
|
256
|
+
* after any changes.
|
|
257
|
+
*
|
|
258
|
+
* @async
|
|
259
|
+
*/
|
|
260
|
+
save(): Promise<this> {
|
|
261
|
+
return this.update(this.data);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Wait for test to complete. Test is done when it changes to `done` or `failed` status.
|
|
266
|
+
*
|
|
267
|
+
* @async
|
|
268
|
+
* @param params - An object containing waiting parameters.
|
|
269
|
+
* @param params.timeout - The time, in milliseconds that the function should wait test. If
|
|
270
|
+
* test is not complete during this time, the `TimeoutError` exception will be thrown.
|
|
271
|
+
* @param params.interval - The time, in milliseconds, the function should delay in between
|
|
272
|
+
* checking test status.
|
|
273
|
+
* @param params.signal- An <a
|
|
274
|
+
* href="https://developer.mozilla.org/docs/Web/API/AbortController">AbortController</a>
|
|
275
|
+
* signal object instance, which can be used to abort waiting as desired.
|
|
276
|
+
*/
|
|
277
|
+
waitForDone(params?: { timeout?: number; interval?: number; signal?: AbortSignal }) {
|
|
278
|
+
const checkDone = () => this.checkout().then((test) => ["done", "failed"].includes(test.status));
|
|
279
|
+
return waitFor(checkDone, params).then(() => this);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Returns a report with the clash detection results for this test.
|
|
284
|
+
*
|
|
285
|
+
* @async
|
|
286
|
+
*/
|
|
287
|
+
getReport(): Promise<any> {
|
|
288
|
+
return this.internalGet("/report").then((response) => response.json());
|
|
289
|
+
}
|
|
290
|
+
}
|