@inweb/client 25.7.0 → 25.7.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/dist/client.js +185 -348
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +6 -6
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Assembly.d.ts +19 -42
- package/lib/Api/ClashTest.d.ts +7 -16
- package/lib/Api/Client.d.ts +25 -58
- package/lib/Api/ClientEvents.d.ts +4 -2
- package/lib/Api/FetchError.d.ts +3 -5
- package/lib/Api/File.d.ts +67 -105
- package/lib/Api/Job.d.ts +11 -16
- package/lib/Api/Member.d.ts +1 -7
- package/lib/Api/Model.d.ts +19 -26
- package/lib/Api/Permission.d.ts +0 -6
- package/lib/Api/Project.d.ts +13 -34
- package/lib/Api/Role.d.ts +0 -6
- package/lib/Api/User.d.ts +3 -10
- package/package.json +3 -3
- package/src/Api/Assembly.ts +21 -44
- package/src/Api/ClashTest.ts +9 -18
- package/src/Api/Client.ts +27 -60
- package/src/Api/ClientEvents.ts +4 -2
- package/src/Api/Fetch.ts +2 -2
- package/src/Api/FetchError.ts +5 -7
- package/src/Api/File.ts +69 -107
- package/src/Api/HttpClient.ts +2 -2
- package/src/Api/IAssembly.ts +2 -2
- package/src/Api/IFile.ts +2 -2
- package/src/Api/IHttpClient.ts +2 -2
- package/src/Api/IUser.ts +2 -2
- package/src/Api/Job.ts +14 -19
- package/src/Api/Member.ts +3 -9
- package/src/Api/Model.ts +21 -28
- package/src/Api/Permission.ts +2 -8
- package/src/Api/Project.ts +15 -36
- package/src/Api/Role.ts +2 -8
- package/src/Api/User.ts +5 -12
- package/src/Api/Utils.ts +2 -2
- package/src/Api/XMLHttp.ts +2 -2
- package/src/index.ts +2 -2
package/src/Api/Assembly.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
-
// Copyright (C) 2002-
|
|
2
|
+
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3
3
|
// All rights reserved.
|
|
4
4
|
//
|
|
5
5
|
// This software and its documentation and related materials are owned by
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
//
|
|
15
15
|
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
16
|
// license agreement with Open Design Alliance.
|
|
17
|
-
// Open Design Alliance Copyright (C) 2002-
|
|
17
|
+
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
18
18
|
// All rights reserved.
|
|
19
19
|
//
|
|
20
20
|
// By use of this software, its documentation or related materials, you
|
|
@@ -90,8 +90,8 @@ export class Assembly {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
|
-
* Assembly creation time (UTC) in the format specified in
|
|
94
|
-
*
|
|
93
|
+
* Assembly creation time (UTC) in the format specified in
|
|
94
|
+
* {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.
|
|
95
95
|
*
|
|
96
96
|
* @readonly
|
|
97
97
|
*/
|
|
@@ -228,8 +228,6 @@ export class Assembly {
|
|
|
228
228
|
|
|
229
229
|
/**
|
|
230
230
|
* Refresh assembly data.
|
|
231
|
-
*
|
|
232
|
-
* @async
|
|
233
231
|
*/
|
|
234
232
|
async checkout(): Promise<this> {
|
|
235
233
|
const response = await this.internalGet("");
|
|
@@ -240,7 +238,6 @@ export class Assembly {
|
|
|
240
238
|
/**
|
|
241
239
|
* Updates assembly data on the server.
|
|
242
240
|
*
|
|
243
|
-
* @async
|
|
244
241
|
* @param data - Raw assembly data.
|
|
245
242
|
*/
|
|
246
243
|
async update(data: any): Promise<this> {
|
|
@@ -252,7 +249,6 @@ export class Assembly {
|
|
|
252
249
|
/**
|
|
253
250
|
* Delete the assembly from the server.
|
|
254
251
|
*
|
|
255
|
-
* @async
|
|
256
252
|
* @returns Returns the raw data of a deleted assembly.
|
|
257
253
|
*/
|
|
258
254
|
delete(): Promise<any> {
|
|
@@ -262,8 +258,6 @@ export class Assembly {
|
|
|
262
258
|
/**
|
|
263
259
|
* Save assembly data changes to the server. Call this method to update assembly data on the
|
|
264
260
|
* server after any changes.
|
|
265
|
-
*
|
|
266
|
-
* @async
|
|
267
261
|
*/
|
|
268
262
|
save(): Promise<this> {
|
|
269
263
|
return this.update(this.data);
|
|
@@ -283,8 +277,6 @@ export class Assembly {
|
|
|
283
277
|
|
|
284
278
|
/**
|
|
285
279
|
* Returns list of assembly models.
|
|
286
|
-
*
|
|
287
|
-
* @async
|
|
288
280
|
*/
|
|
289
281
|
getModels(): Promise<Model[]> {
|
|
290
282
|
return this.internalGet("/geometry")
|
|
@@ -321,7 +313,6 @@ export class Assembly {
|
|
|
321
313
|
/**
|
|
322
314
|
* Set or delete a model transformation.
|
|
323
315
|
*
|
|
324
|
-
* @async
|
|
325
316
|
* @param handle - Model handle.
|
|
326
317
|
* @param transform - Transformation matrix. To delete transformation provide this to `undefined`.
|
|
327
318
|
*/
|
|
@@ -334,7 +325,6 @@ export class Assembly {
|
|
|
334
325
|
/**
|
|
335
326
|
* Returns the properties for an objects in the assembly.
|
|
336
327
|
*
|
|
337
|
-
* @async
|
|
338
328
|
* @param handles - Object original handle or handles array. Leave this parameter undefined
|
|
339
329
|
* to get properties for all objects in the assembly.
|
|
340
330
|
* @returns {Promise<any>}
|
|
@@ -348,7 +338,6 @@ export class Assembly {
|
|
|
348
338
|
* Returns the list of original handles for an objects in the file that match the specified
|
|
349
339
|
* patterns. Search patterns may be combined using query operators.
|
|
350
340
|
*
|
|
351
|
-
* @async
|
|
352
341
|
* @example <caption>Simple search pattern.</caption>
|
|
353
342
|
* searchPattern = {
|
|
354
343
|
* key: "Category",
|
|
@@ -376,8 +365,6 @@ export class Assembly {
|
|
|
376
365
|
|
|
377
366
|
/**
|
|
378
367
|
* Returns the cda.json for an assembly.
|
|
379
|
-
*
|
|
380
|
-
* @async
|
|
381
368
|
*/
|
|
382
369
|
getCdaTree(): Promise<any[]> {
|
|
383
370
|
return this.internalGet(`/properties/tree`).then((response) => response.json());
|
|
@@ -385,8 +372,6 @@ export class Assembly {
|
|
|
385
372
|
|
|
386
373
|
/**
|
|
387
374
|
* Returns a list of assembly viewpoints.
|
|
388
|
-
*
|
|
389
|
-
* @async
|
|
390
375
|
*/
|
|
391
376
|
getViewpoints(): Promise<any[]> {
|
|
392
377
|
return this.internalGet("/viewpoints")
|
|
@@ -395,9 +380,8 @@ export class Assembly {
|
|
|
395
380
|
}
|
|
396
381
|
|
|
397
382
|
/**
|
|
398
|
-
* Add new assembly viewpoint. To create a
|
|
383
|
+
* Add new assembly viewpoint. To create a viewpoint use `Viewer.createViewpoint()`.
|
|
399
384
|
*
|
|
400
|
-
* @async
|
|
401
385
|
* @param viewpoint - Viewpoint.
|
|
402
386
|
*/
|
|
403
387
|
saveViewpoint(viewpoint: any): Promise<any> {
|
|
@@ -407,7 +391,6 @@ export class Assembly {
|
|
|
407
391
|
/**
|
|
408
392
|
* Delete assembly viewpoint.
|
|
409
393
|
*
|
|
410
|
-
* @async
|
|
411
394
|
* @param guid - Viewpoint GUID.
|
|
412
395
|
* @returns Returns the raw data of a deleted viewpoint.
|
|
413
396
|
*/
|
|
@@ -419,7 +402,6 @@ export class Assembly {
|
|
|
419
402
|
* Returns viewpoint preview image as
|
|
420
403
|
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
|
|
421
404
|
*
|
|
422
|
-
* @async
|
|
423
405
|
* @param guid - Viewpoint GUID.
|
|
424
406
|
*/
|
|
425
407
|
getSnapshot(guid: any): Promise<any> {
|
|
@@ -429,7 +411,6 @@ export class Assembly {
|
|
|
429
411
|
/**
|
|
430
412
|
* Returns viewpoint preview data.
|
|
431
413
|
*
|
|
432
|
-
* @async
|
|
433
414
|
* @param guid - Viewpoint GUID.
|
|
434
415
|
* @param bitmapGuid - Bitmap GUID.
|
|
435
416
|
*/
|
|
@@ -441,12 +422,11 @@ export class Assembly {
|
|
|
441
422
|
* Download assembly resource file. Resource files are files that contain model scene
|
|
442
423
|
* descriptions, or geometry data.
|
|
443
424
|
*
|
|
444
|
-
* @async
|
|
445
425
|
* @param dataId - Resource file name.
|
|
446
426
|
* @param onProgress - Download progress callback.
|
|
447
|
-
* @param signal - An
|
|
448
|
-
*
|
|
449
|
-
* and abort it if desired.
|
|
427
|
+
* @param signal - An
|
|
428
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
429
|
+
* signal. Allows to communicate with a fetch request and abort it if desired.
|
|
450
430
|
*/
|
|
451
431
|
downloadResource(
|
|
452
432
|
dataId: string,
|
|
@@ -467,9 +447,9 @@ export class Assembly {
|
|
|
467
447
|
* @param ranges - A range of resource file contents to download.
|
|
468
448
|
* @param requestId - Request ID for download progress callback.
|
|
469
449
|
* @param onProgress - Download progress callback.
|
|
470
|
-
* @param signal - An
|
|
471
|
-
*
|
|
472
|
-
* and abort it if desired.
|
|
450
|
+
* @param signal - An
|
|
451
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
452
|
+
* signal. Allows to communicate with a fetch request and abort it if desired.
|
|
473
453
|
*/
|
|
474
454
|
downloadResourceRange(
|
|
475
455
|
dataId: string,
|
|
@@ -485,7 +465,9 @@ export class Assembly {
|
|
|
485
465
|
}
|
|
486
466
|
|
|
487
467
|
/**
|
|
488
|
-
* Deprecated since `25.3`. Use {@link
|
|
468
|
+
* Deprecated since `25.3`. Use {@link downloadResource | downloadResource()} instead.
|
|
469
|
+
*
|
|
470
|
+
* @deprecated
|
|
489
471
|
*/
|
|
490
472
|
partialDownloadResource(
|
|
491
473
|
dataId: string,
|
|
@@ -499,7 +481,7 @@ export class Assembly {
|
|
|
499
481
|
}
|
|
500
482
|
|
|
501
483
|
/**
|
|
502
|
-
* Deprecated since `25.3`. Use {@link
|
|
484
|
+
* Deprecated since `25.3`. Use {@link downloadResourceRange | downloadResourceRange()} instead.
|
|
503
485
|
*/
|
|
504
486
|
async downloadFileRange(
|
|
505
487
|
requestId: number,
|
|
@@ -520,15 +502,14 @@ export class Assembly {
|
|
|
520
502
|
/**
|
|
521
503
|
* Wait for assembly to be created. Assembly is created when it changes to `done` or `failed` status.
|
|
522
504
|
*
|
|
523
|
-
* @async
|
|
524
505
|
* @param params - An object containing waiting parameters.
|
|
525
506
|
* @param params.timeout - The time, in milliseconds that the function should wait assembly.
|
|
526
507
|
* If assembly is not created during this time, the `TimeoutError` exception will be thrown.
|
|
527
508
|
* @param params.interval - The time, in milliseconds, the function should delay in between
|
|
528
509
|
* checking assembly status.
|
|
529
|
-
* @param params.signal- An
|
|
530
|
-
*
|
|
531
|
-
* signal
|
|
510
|
+
* @param params.signal - An
|
|
511
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
512
|
+
* signal, which can be used to abort waiting as desired.
|
|
532
513
|
* @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.
|
|
533
514
|
*/
|
|
534
515
|
waitForDone(params?: {
|
|
@@ -550,7 +531,6 @@ export class Assembly {
|
|
|
550
531
|
/**
|
|
551
532
|
* Returns a list of assembly clash tests.
|
|
552
533
|
*
|
|
553
|
-
* @async
|
|
554
534
|
* @param {number} start - The starting index in the test list. Used for paging.
|
|
555
535
|
* @param {number} limit - The maximum number of tests that should be returned per request.
|
|
556
536
|
* Used for paging.
|
|
@@ -597,7 +577,6 @@ export class Assembly {
|
|
|
597
577
|
/**
|
|
598
578
|
* Returns the assembly clash test information.
|
|
599
579
|
*
|
|
600
|
-
* @async
|
|
601
580
|
* @param testId - Test ID.
|
|
602
581
|
*/
|
|
603
582
|
getClashTest(testId: string): Promise<ClashTest> {
|
|
@@ -609,7 +588,6 @@ export class Assembly {
|
|
|
609
588
|
/**
|
|
610
589
|
* Create assembly clash test. Assembly must be in a `done` state, otherwise the test will fail.
|
|
611
590
|
*
|
|
612
|
-
* @async
|
|
613
591
|
* @param name - Test name.
|
|
614
592
|
* @param selectionTypeA - The type of first selection set for clash detection. Can be `all`,
|
|
615
593
|
* `handles`, `models` or `searchquery`.
|
|
@@ -627,9 +605,9 @@ export class Assembly {
|
|
|
627
605
|
* test is not complete during this time, the `TimeoutError` exception will be thrown.
|
|
628
606
|
* @param params.interval - The time, in milliseconds, the function should delay in between
|
|
629
607
|
* checking test status.
|
|
630
|
-
* @param params.signal- An
|
|
631
|
-
*
|
|
632
|
-
* signal
|
|
608
|
+
* @param params.signal - An
|
|
609
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
610
|
+
* signal, which can be used to abort waiting as desired.
|
|
633
611
|
*/
|
|
634
612
|
createClashTest(
|
|
635
613
|
name: string,
|
|
@@ -667,7 +645,6 @@ export class Assembly {
|
|
|
667
645
|
/**
|
|
668
646
|
* Delete assembly clash test.
|
|
669
647
|
*
|
|
670
|
-
* @async
|
|
671
648
|
* @param testId - Test ID.
|
|
672
649
|
* @returns Returns the raw data of a deleted test.
|
|
673
650
|
*/
|
package/src/Api/ClashTest.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
-
// Copyright (C) 2002-
|
|
2
|
+
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3
3
|
// All rights reserved.
|
|
4
4
|
//
|
|
5
5
|
// This software and its documentation and related materials are owned by
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
//
|
|
15
15
|
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
16
|
// license agreement with Open Design Alliance.
|
|
17
|
-
// Open Design Alliance Copyright (C) 2002-
|
|
17
|
+
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
18
18
|
// All rights reserved.
|
|
19
19
|
//
|
|
20
20
|
// By use of this software, its documentation or related materials, you
|
|
@@ -71,8 +71,8 @@ export class ClashTest {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
|
-
* Test creation time (UTC) in the format specified in
|
|
75
|
-
*
|
|
74
|
+
* Test creation time (UTC) in the format specified in
|
|
75
|
+
* {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.
|
|
76
76
|
*
|
|
77
77
|
* @readonly
|
|
78
78
|
*/
|
|
@@ -106,8 +106,8 @@ export class ClashTest {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
|
-
* Test last update (UTC) time in the format specified in
|
|
110
|
-
*
|
|
109
|
+
* Test last update (UTC) time in the format specified in
|
|
110
|
+
* {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.
|
|
111
111
|
*
|
|
112
112
|
* @readonly
|
|
113
113
|
*/
|
|
@@ -211,8 +211,6 @@ export class ClashTest {
|
|
|
211
211
|
|
|
212
212
|
/**
|
|
213
213
|
* Refresh test data.
|
|
214
|
-
*
|
|
215
|
-
* @async
|
|
216
214
|
*/
|
|
217
215
|
async checkout(): Promise<this> {
|
|
218
216
|
const response = await this.internalGet("");
|
|
@@ -223,7 +221,6 @@ export class ClashTest {
|
|
|
223
221
|
/**
|
|
224
222
|
* Update test data on the server.
|
|
225
223
|
*
|
|
226
|
-
* @async
|
|
227
224
|
* @param data - Raw test data.
|
|
228
225
|
*/
|
|
229
226
|
async update(data: any): Promise<this> {
|
|
@@ -235,7 +232,6 @@ export class ClashTest {
|
|
|
235
232
|
/**
|
|
236
233
|
* Remove a test from a file.
|
|
237
234
|
*
|
|
238
|
-
* @async
|
|
239
235
|
* @returns Returns the raw data of a deleted test.
|
|
240
236
|
*/
|
|
241
237
|
delete(): Promise<any> {
|
|
@@ -245,8 +241,6 @@ export class ClashTest {
|
|
|
245
241
|
/**
|
|
246
242
|
* Save test data changes to the server. Call this method to update test data on the server
|
|
247
243
|
* after any changes.
|
|
248
|
-
*
|
|
249
|
-
* @async
|
|
250
244
|
*/
|
|
251
245
|
save(): Promise<this> {
|
|
252
246
|
return this.update(this.data);
|
|
@@ -255,15 +249,14 @@ export class ClashTest {
|
|
|
255
249
|
/**
|
|
256
250
|
* Wait for test to complete. Test is done when it changes to `done` or `failed` status.
|
|
257
251
|
*
|
|
258
|
-
* @async
|
|
259
252
|
* @param params - An object containing waiting parameters.
|
|
260
253
|
* @param params.timeout - The time, in milliseconds that the function should wait test. If
|
|
261
254
|
* test is not complete during this time, the `TimeoutError` exception will be thrown.
|
|
262
255
|
* @param params.interval - The time, in milliseconds, the function should delay in between
|
|
263
256
|
* checking test status.
|
|
264
|
-
* @param params.signal- An
|
|
265
|
-
*
|
|
266
|
-
* signal
|
|
257
|
+
* @param params.signal - An
|
|
258
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
259
|
+
* signal, which can be used to abort waiting as desired.
|
|
267
260
|
*/
|
|
268
261
|
waitForDone(params?: { timeout?: number; interval?: number; signal?: AbortSignal }): Promise<this> {
|
|
269
262
|
const checkDone = () => this.checkout().then((test) => ["done", "failed"].includes(test.status));
|
|
@@ -272,8 +265,6 @@ export class ClashTest {
|
|
|
272
265
|
|
|
273
266
|
/**
|
|
274
267
|
* Returns a report with the clash detection results for this test.
|
|
275
|
-
*
|
|
276
|
-
* @async
|
|
277
268
|
*/
|
|
278
269
|
getReport(): Promise<any> {
|
|
279
270
|
return this.internalGet("/report").then((response) => response.json());
|