@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/lib/Api/Assembly.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IHttpClient } from "./IHttpClient";
|
|
2
|
-
import { IAssociatedFileData, IAssemblyVersionInfo } from "./IAssembly";
|
|
2
|
+
import { IAssociatedFileData, IAssemblyVersionInfo, IModelTransformMatrix } from "./IAssembly";
|
|
3
3
|
import { IShortUserDescription } from "./IUser";
|
|
4
4
|
import { Model } from "./Model";
|
|
5
5
|
import { ClashTest } from "./ClashTest";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Provides properties and methods for obtaining information about an assembly on the server
|
|
8
|
+
* and managing its data.
|
|
8
9
|
*/
|
|
9
10
|
export declare class Assembly {
|
|
10
11
|
private _data;
|
|
@@ -12,8 +13,8 @@ export declare class Assembly {
|
|
|
12
13
|
httpClient: IHttpClient;
|
|
13
14
|
path: string;
|
|
14
15
|
/**
|
|
15
|
-
* @param data -
|
|
16
|
-
* @param httpClient -
|
|
16
|
+
* @param data - Raw assembly data received from the server.
|
|
17
|
+
* @param httpClient - HTTP client instance used to send REST API requests to the server.
|
|
17
18
|
*/
|
|
18
19
|
constructor(data: any, httpClient: IHttpClient);
|
|
19
20
|
appendVersionParam(relativePath: string): string;
|
|
@@ -51,9 +52,9 @@ export declare class Assembly {
|
|
|
51
52
|
/**
|
|
52
53
|
* Assembly geometry data type:
|
|
53
54
|
*
|
|
54
|
-
* - `vsfx` - VSFX, assembly can be opened in `VisualizeJS` viewer.
|
|
55
|
+
* - `vsfx` - `VSFX` format, assembly can be opened in `VisualizeJS` viewer.
|
|
55
56
|
*
|
|
56
|
-
* Returns an empty string if geometry data
|
|
57
|
+
* Returns an empty string if the geometry data is not yet ready.
|
|
57
58
|
*/
|
|
58
59
|
get geometryType(): string;
|
|
59
60
|
/**
|
|
@@ -106,7 +107,7 @@ export declare class Assembly {
|
|
|
106
107
|
get version(): number;
|
|
107
108
|
get versions(): IAssemblyVersionInfo[];
|
|
108
109
|
/**
|
|
109
|
-
*
|
|
110
|
+
* Reloads assembly data from the server.
|
|
110
111
|
*/
|
|
111
112
|
checkout(): Promise<this>;
|
|
112
113
|
/**
|
|
@@ -116,14 +117,14 @@ export declare class Assembly {
|
|
|
116
117
|
*/
|
|
117
118
|
update(data: any): Promise<this>;
|
|
118
119
|
/**
|
|
119
|
-
*
|
|
120
|
+
* Deletes an assembly from the server.
|
|
120
121
|
*
|
|
121
122
|
* @returns Returns the raw data of a deleted assembly.
|
|
122
123
|
*/
|
|
123
124
|
delete(): Promise<any>;
|
|
124
125
|
/**
|
|
125
|
-
*
|
|
126
|
-
* server after any changes.
|
|
126
|
+
* Saves assembly properties changes to the server. Call this method to update assembly data
|
|
127
|
+
* on the server after any property changes.
|
|
127
128
|
*/
|
|
128
129
|
save(): Promise<this>;
|
|
129
130
|
setPreview(image?: BodyInit | null): Promise<this>;
|
|
@@ -132,40 +133,24 @@ export declare class Assembly {
|
|
|
132
133
|
* Returns list of assembly models.
|
|
133
134
|
*/
|
|
134
135
|
getModels(): Promise<Model[]>;
|
|
135
|
-
/**
|
|
136
|
-
* Transformation matrix.
|
|
137
|
-
*
|
|
138
|
-
* @typedef {any} Transform
|
|
139
|
-
* @property {any} translate - Translation part, move along the X, Y, Z axes.
|
|
140
|
-
* @property {number} translate.x - The value for substruct for X axes.
|
|
141
|
-
* @property {number} translate.y - The value for substruct for Y axes.
|
|
142
|
-
* @property {number} translate.z - The value for substruct for Z axes.
|
|
143
|
-
* @property {any} rotation - Rotation part, rotate by the specified angle, around the
|
|
144
|
-
* specified vector.
|
|
145
|
-
* @property {number} rotation.x - X coordinate of the rotation vector.
|
|
146
|
-
* @property {number} rotation.y - Y coordinate of the rotation vector.
|
|
147
|
-
* @property {number} rotation.z - Z coordinate of the rotation vector.
|
|
148
|
-
* @property {number} rotation.angle - The angle of rotation.
|
|
149
|
-
* @property {number} scale - Scaling part, scale with multiplier, from center of extends.
|
|
150
|
-
*/
|
|
151
136
|
/**
|
|
152
137
|
* Returns a model transformation.
|
|
153
138
|
*
|
|
154
|
-
* @param handle - Model handle.
|
|
139
|
+
* @param handle - Model original handle.
|
|
155
140
|
*/
|
|
156
|
-
getModelTransformMatrix(handle: string):
|
|
141
|
+
getModelTransformMatrix(handle: string): IModelTransformMatrix;
|
|
157
142
|
/**
|
|
158
|
-
*
|
|
143
|
+
* Sets or removes a model transformation.
|
|
159
144
|
*
|
|
160
|
-
* @param handle - Model handle.
|
|
161
|
-
* @param transform - Transformation matrix.
|
|
145
|
+
* @param handle - Model original handle.
|
|
146
|
+
* @param transform - Transformation matrix. Specify `undefined` to remove transformation.
|
|
162
147
|
*/
|
|
163
|
-
setModelTransformMatrix(handle: string, transform:
|
|
148
|
+
setModelTransformMatrix(handle: string, transform: IModelTransformMatrix): Promise<this>;
|
|
164
149
|
/**
|
|
165
150
|
* Returns the properties for an objects in the assembly.
|
|
166
151
|
*
|
|
167
|
-
* @param handles - Object original handle or handles array.
|
|
168
|
-
*
|
|
152
|
+
* @param handles - Object original handle or handles array. Specify `undefined` to get
|
|
153
|
+
* properties for all objects in the assembly.
|
|
169
154
|
* @returns {Promise<any>}
|
|
170
155
|
*/
|
|
171
156
|
getProperties(handles?: string | string[]): Promise<any[]>;
|
|
@@ -196,7 +181,7 @@ export declare class Assembly {
|
|
|
196
181
|
*/
|
|
197
182
|
searchProperties(searchPattern: any): Promise<any[]>;
|
|
198
183
|
/**
|
|
199
|
-
* Returns the
|
|
184
|
+
* Returns the CDA tree for an assembly.
|
|
200
185
|
*/
|
|
201
186
|
getCdaTree(): Promise<any[]>;
|
|
202
187
|
/**
|
|
@@ -204,13 +189,13 @@ export declare class Assembly {
|
|
|
204
189
|
*/
|
|
205
190
|
getViewpoints(): Promise<any[]>;
|
|
206
191
|
/**
|
|
207
|
-
*
|
|
192
|
+
* Adds a new viewpoint to the assembly. To create a viewpoint use `Viewer.createViewpoint()`.
|
|
208
193
|
*
|
|
209
194
|
* @param viewpoint - Viewpoint.
|
|
210
195
|
*/
|
|
211
196
|
saveViewpoint(viewpoint: any): Promise<any>;
|
|
212
197
|
/**
|
|
213
|
-
*
|
|
198
|
+
* Deletes the specified assembly viewpoint.
|
|
214
199
|
*
|
|
215
200
|
* @param guid - Viewpoint GUID.
|
|
216
201
|
* @returns Returns the raw data of a deleted viewpoint.
|
|
@@ -231,7 +216,7 @@ export declare class Assembly {
|
|
|
231
216
|
*/
|
|
232
217
|
getSnapshotData(guid: any, bitmapGuid: any): Promise<string>;
|
|
233
218
|
/**
|
|
234
|
-
*
|
|
219
|
+
* Downloads an assembly resource file. Resource files are files that contain model scene
|
|
235
220
|
* descriptions, or geometry data.
|
|
236
221
|
*
|
|
237
222
|
* @param dataId - Resource file name.
|
|
@@ -242,7 +227,7 @@ export declare class Assembly {
|
|
|
242
227
|
*/
|
|
243
228
|
downloadResource(dataId: string, onProgress?: (progress: number, chunk: Uint8Array) => void, signal?: AbortSignal): Promise<ArrayBuffer>;
|
|
244
229
|
/**
|
|
245
|
-
*
|
|
230
|
+
* Downloads a part of assembly resource file. Resource files are files that contain model
|
|
246
231
|
* scene descriptions, or geometry data.
|
|
247
232
|
*
|
|
248
233
|
* @param dataId - Resource file name.
|
|
@@ -270,7 +255,7 @@ export declare class Assembly {
|
|
|
270
255
|
downloadFileRange(requestId: number, records: any | null, dataId: string, onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void, signal?: AbortSignal): Promise<void>;
|
|
271
256
|
getReferences(signal?: AbortSignal): Promise<any>;
|
|
272
257
|
/**
|
|
273
|
-
*
|
|
258
|
+
* Waits for assembly to be created. Assembly is created when it changes to `done` or `failed` status.
|
|
274
259
|
*
|
|
275
260
|
* @param params - An object containing waiting parameters.
|
|
276
261
|
* @param params.timeout - The time, in milliseconds that the function should wait assembly.
|
|
@@ -291,15 +276,13 @@ export declare class Assembly {
|
|
|
291
276
|
/**
|
|
292
277
|
* Returns a list of assembly clash tests.
|
|
293
278
|
*
|
|
294
|
-
* @param
|
|
295
|
-
* @param
|
|
296
|
-
*
|
|
297
|
-
* @param
|
|
298
|
-
* @param
|
|
299
|
-
*
|
|
300
|
-
* @param
|
|
301
|
-
* default tests are sorted by name in ascending order.
|
|
302
|
-
* @param {string} sortField - Allows to specify sort field.
|
|
279
|
+
* @param start - The starting index in the test list. Used for paging.
|
|
280
|
+
* @param limit - The maximum number of tests that should be returned per request. Used for paging.
|
|
281
|
+
* @param name - Filter the tests by part of the name. Case sensitive.
|
|
282
|
+
* @param ids - List of tests IDs to return.
|
|
283
|
+
* @param sortByDesc - Allows to specify the descending order of the result. By default tests
|
|
284
|
+
* are sorted by name in ascending order.
|
|
285
|
+
* @param sortField - Allows to specify sort field.
|
|
303
286
|
*/
|
|
304
287
|
getClashTests(start?: number, limit?: number, name?: string, ids?: string | string[], sortByDesc?: boolean, sortField?: string): Promise<{
|
|
305
288
|
allSize: number;
|
|
@@ -309,26 +292,45 @@ export declare class Assembly {
|
|
|
309
292
|
size: number;
|
|
310
293
|
}>;
|
|
311
294
|
/**
|
|
312
|
-
* Returns the assembly clash test
|
|
295
|
+
* Returns information about the specified assembly clash test.
|
|
313
296
|
*
|
|
314
297
|
* @param testId - Test ID.
|
|
315
298
|
*/
|
|
316
299
|
getClashTest(testId: string): Promise<ClashTest>;
|
|
317
300
|
/**
|
|
318
|
-
*
|
|
301
|
+
* Creates an assembly clash test. Assembly must be in a `done` state, otherwise the test will fail.
|
|
319
302
|
*
|
|
320
303
|
* @param name - Test name.
|
|
321
|
-
* @param selectionTypeA - The type of first selection set for clash detection. Can be
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
* `
|
|
325
|
-
*
|
|
326
|
-
*
|
|
304
|
+
* @param selectionTypeA - The type of first selection set for clash detection. Can be one of:
|
|
305
|
+
*
|
|
306
|
+
* - `all` - All file/assembly objects.
|
|
307
|
+
* - `handle` - Objects with original handles specified in the `selectionSetA`.
|
|
308
|
+
* - `models` - All objects of the models with original handles specified in the `selectionSetA`.
|
|
309
|
+
* - `searchquery` - Objects retrieved by the search queries specified in `selectionSetA`.
|
|
310
|
+
*
|
|
311
|
+
* @param selectionTypeB - The type of second selection set for clash detection. Can be one of:
|
|
312
|
+
*
|
|
313
|
+
* - `all` - All file/assembly objects.
|
|
314
|
+
* - `handle` - Objects with original handles specified in the `selectionSetB`.
|
|
315
|
+
* - `models` - All objects of the models with original handles specified in the `selectionSetB`.
|
|
316
|
+
* - `searchquery` - Objects retrieved by the search queries specified in `selectionSetB`.
|
|
317
|
+
*
|
|
318
|
+
* @param selectionSetA - First selection set for clash detection. Objects from
|
|
319
|
+
* `selectionSetA` will be tested against each others by objects from the `selectionSetB`
|
|
320
|
+
* during the test.
|
|
321
|
+
* @param selectionSetB - Second selection set for clash detection. Objects from
|
|
322
|
+
* `selectionSetB` will be tested against each others by objects from the `selectionSetA`
|
|
323
|
+
* during the test.
|
|
327
324
|
* @param params - An object containing test parameters.
|
|
328
|
-
* @param params.tolerance - The distance of separation between
|
|
325
|
+
* @param params.tolerance - The distance of separation between objects at which test begins
|
|
329
326
|
* detecting clashes.
|
|
330
|
-
* @param params.clearance - The type of the clashes that the test detects:
|
|
331
|
-
*
|
|
327
|
+
* @param params.clearance - The type of the clashes that the test detects:
|
|
328
|
+
*
|
|
329
|
+
* - `true` - Сlearance clash. A clash in which the object A may or may not intersect with
|
|
330
|
+
* object B, but comes within a distance of less than the `tolerance`.
|
|
331
|
+
* - `false` - Hard clash. A clash in which the object A intersects with object B by a distance
|
|
332
|
+
* of more than the `tolerance`.
|
|
333
|
+
*
|
|
332
334
|
* @param params.waitForDone - Wait for test to complete.
|
|
333
335
|
* @param params.timeout - The time, in milliseconds that the function should wait test. If
|
|
334
336
|
* test is not complete during this time, the `TimeoutError` exception will be thrown.
|
|
@@ -347,7 +349,7 @@ export declare class Assembly {
|
|
|
347
349
|
signal?: AbortSignal;
|
|
348
350
|
}): Promise<ClashTest>;
|
|
349
351
|
/**
|
|
350
|
-
*
|
|
352
|
+
* Deletes the specified assembly clash test.
|
|
351
353
|
*
|
|
352
354
|
* @param testId - Test ID.
|
|
353
355
|
* @returns Returns the raw data of a deleted test.
|
package/lib/Api/ClashTest.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { IHttpClient } from "./IHttpClient";
|
|
2
2
|
import { IShortUserDescription } from "./IUser";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Provides properties and methods for obtaining information about a file/assembly clash detection test.
|
|
5
5
|
*/
|
|
6
6
|
export declare class ClashTest {
|
|
7
7
|
private _data;
|
|
8
8
|
basePath: string;
|
|
9
9
|
httpClient: IHttpClient;
|
|
10
10
|
/**
|
|
11
|
-
* @param data - Raw test data.
|
|
12
|
-
* @param basePath -
|
|
13
|
-
* @param httpClient -
|
|
11
|
+
* @param data - Raw test data received from the server.
|
|
12
|
+
* @param basePath - The clash test API base path of the file/assembly that owns the test.
|
|
13
|
+
* @param httpClient - HTTP client instance used to send REST API requests to the server.
|
|
14
14
|
*/
|
|
15
15
|
constructor(data: any, basePath: string, httpClient: IHttpClient);
|
|
16
16
|
protected internalGet(relativePath: string): Promise<Response>;
|
|
@@ -19,10 +19,10 @@ export declare class ClashTest {
|
|
|
19
19
|
/**
|
|
20
20
|
* The type of the clashes that the test detects:
|
|
21
21
|
*
|
|
22
|
-
* -
|
|
23
|
-
*
|
|
24
|
-
* - `
|
|
25
|
-
*
|
|
22
|
+
* - `true` - Сlearance clash. A clash in which the object A may or may not intersect with
|
|
23
|
+
* object B, but comes within a distance of less than the {@link tolerance}.
|
|
24
|
+
* - `false` - Hard clash. A clash in which the object A intersects with object B by a distance
|
|
25
|
+
* of more than the {@link tolerance}.
|
|
26
26
|
*
|
|
27
27
|
* @readonly
|
|
28
28
|
*/
|
|
@@ -74,8 +74,8 @@ export declare class ClashTest {
|
|
|
74
74
|
*/
|
|
75
75
|
get owner(): IShortUserDescription;
|
|
76
76
|
/**
|
|
77
|
-
* First selection set for clash detection.
|
|
78
|
-
* against each others by
|
|
77
|
+
* First selection set for clash detection. Objects from `selectionSetA` will be tested
|
|
78
|
+
* against each others by objects from the `selectionSetB` during the test.
|
|
79
79
|
*
|
|
80
80
|
* @readonly
|
|
81
81
|
*/
|
|
@@ -83,17 +83,17 @@ export declare class ClashTest {
|
|
|
83
83
|
/**
|
|
84
84
|
* The type of first selection set for clash detection. Can be one of:
|
|
85
85
|
*
|
|
86
|
-
* - `all` - All file/assembly
|
|
87
|
-
* - `handle` -
|
|
88
|
-
* - `models` -
|
|
89
|
-
* - `searchquery` -
|
|
86
|
+
* - `all` - All file/assembly objects.
|
|
87
|
+
* - `handle` - Objects with original handles specified in the `selectionSetA`.
|
|
88
|
+
* - `models` - All objects of the models with original handles specified in the `selectionSetA`.
|
|
89
|
+
* - `searchquery` - Objects retrieved by the search queries specified in `selectionSetA`.
|
|
90
90
|
*
|
|
91
91
|
* @readonly
|
|
92
92
|
*/
|
|
93
93
|
get selectionTypeA(): string;
|
|
94
94
|
/**
|
|
95
|
-
* Second selection set for clash detection.
|
|
96
|
-
* against each others by
|
|
95
|
+
* Second selection set for clash detection. Objects from `selectionSetB` will be tested
|
|
96
|
+
* against each others by objects from the `selectionSetA` during the test.
|
|
97
97
|
*
|
|
98
98
|
* @readonly
|
|
99
99
|
*/
|
|
@@ -101,10 +101,10 @@ export declare class ClashTest {
|
|
|
101
101
|
/**
|
|
102
102
|
* The type of second selection set for clash detection. Can be one of:
|
|
103
103
|
*
|
|
104
|
-
* - `all` - All file/assembly
|
|
105
|
-
* - `handle` -
|
|
106
|
-
* - `models` -
|
|
107
|
-
* - `searchquery` -
|
|
104
|
+
* - `all` - All file/assembly objects.
|
|
105
|
+
* - `handle` - Objects with original handles specified in the `selectionSetB`.
|
|
106
|
+
* - `models` - All objects of the models with original handles specified in the `selectionSetB`.
|
|
107
|
+
* - `searchquery` - Objects retrieved by the search queries specified in `selectionSetB`.
|
|
108
108
|
*
|
|
109
109
|
* @readonly
|
|
110
110
|
*/
|
|
@@ -116,34 +116,34 @@ export declare class ClashTest {
|
|
|
116
116
|
*/
|
|
117
117
|
get status(): string;
|
|
118
118
|
/**
|
|
119
|
-
* The distance of separation between
|
|
119
|
+
* The distance of separation between objects at which test begins detecting clashes.
|
|
120
120
|
*
|
|
121
121
|
* @readonly
|
|
122
122
|
*/
|
|
123
123
|
get tolerance(): number;
|
|
124
124
|
/**
|
|
125
|
-
*
|
|
125
|
+
* Reloads test data from the server.
|
|
126
126
|
*/
|
|
127
127
|
checkout(): Promise<this>;
|
|
128
128
|
/**
|
|
129
|
-
*
|
|
129
|
+
* Updates test data on the server.
|
|
130
130
|
*
|
|
131
131
|
* @param data - Raw test data.
|
|
132
132
|
*/
|
|
133
133
|
update(data: any): Promise<this>;
|
|
134
134
|
/**
|
|
135
|
-
*
|
|
135
|
+
* Deletes a test and its results report from the server.
|
|
136
136
|
*
|
|
137
137
|
* @returns Returns the raw data of a deleted test.
|
|
138
138
|
*/
|
|
139
139
|
delete(): Promise<any>;
|
|
140
140
|
/**
|
|
141
|
-
*
|
|
142
|
-
* after any changes.
|
|
141
|
+
* Saves test properties changes to the server. Call this method to update test data on the
|
|
142
|
+
* server after any property changes.
|
|
143
143
|
*/
|
|
144
144
|
save(): Promise<this>;
|
|
145
145
|
/**
|
|
146
|
-
*
|
|
146
|
+
* Waits for test to complete. Test is done when it changes to `done` or `failed` status.
|
|
147
147
|
*
|
|
148
148
|
* @param params - An object containing waiting parameters.
|
|
149
149
|
* @param params.timeout - The time, in milliseconds that the function should wait test. If
|
|
@@ -153,11 +153,13 @@ export declare class ClashTest {
|
|
|
153
153
|
* @param params.signal - An
|
|
154
154
|
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
155
155
|
* signal, which can be used to abort waiting as desired.
|
|
156
|
+
* @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.
|
|
156
157
|
*/
|
|
157
158
|
waitForDone(params?: {
|
|
158
159
|
timeout?: number;
|
|
159
160
|
interval?: number;
|
|
160
161
|
signal?: AbortSignal;
|
|
162
|
+
onCheckout?: (test: ClashTest, ready: boolean) => boolean;
|
|
161
163
|
}): Promise<this>;
|
|
162
164
|
/**
|
|
163
165
|
* Returns a report with the clash detection results for this test.
|