@thatopen/services 0.3.7 → 0.3.8
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/built-in/index.d.ts +203 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +44 -43
- package/docs/builtin/paths.json +86 -78
- package/package.json +2 -2
- package/src/built-in/ClashesManager/example.ts +285 -0
- package/src/built-in/UIManager/src/clashes-panel/example.ts +164 -0
- package/src/built-in/index.ts +881 -678
package/src/built-in/index.ts
CHANGED
|
@@ -1,678 +1,881 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
|
|
2
|
-
/**
|
|
3
|
-
* Built-in component types and runtime stubs.
|
|
4
|
-
* Auto-generated by platform_builtin-components/scripts/distribute-types.mjs
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type * as OBC from '@thatopen/components';
|
|
8
|
-
import type
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
export type
|
|
67
|
-
export type
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
export type
|
|
82
|
-
export type
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
readonly
|
|
324
|
-
readonly
|
|
325
|
-
readonly
|
|
326
|
-
readonly
|
|
327
|
-
readonly
|
|
328
|
-
readonly
|
|
329
|
-
readonly
|
|
330
|
-
readonly
|
|
331
|
-
readonly
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
readonly
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
private
|
|
385
|
-
private
|
|
386
|
-
private
|
|
387
|
-
private
|
|
388
|
-
private
|
|
389
|
-
private
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
private
|
|
397
|
-
private
|
|
398
|
-
private
|
|
399
|
-
private
|
|
400
|
-
private
|
|
401
|
-
private
|
|
402
|
-
private
|
|
403
|
-
private
|
|
404
|
-
private
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
private
|
|
409
|
-
private
|
|
410
|
-
private
|
|
411
|
-
private
|
|
412
|
-
private
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
private
|
|
416
|
-
private
|
|
417
|
-
private
|
|
418
|
-
private
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
get
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
get
|
|
441
|
-
get
|
|
442
|
-
get
|
|
443
|
-
get
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
get
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
private
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
private
|
|
462
|
-
private
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
private
|
|
490
|
-
private
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
*
|
|
496
|
-
*
|
|
497
|
-
*
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
private
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
private
|
|
507
|
-
private
|
|
508
|
-
private
|
|
509
|
-
private
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
private
|
|
513
|
-
private
|
|
514
|
-
private
|
|
515
|
-
private
|
|
516
|
-
private
|
|
517
|
-
private
|
|
518
|
-
private
|
|
519
|
-
private
|
|
520
|
-
private
|
|
521
|
-
private
|
|
522
|
-
private
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
export
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
export interface
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
/**
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
*/
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
*/
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
readonly
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
|
|
2
|
+
/**
|
|
3
|
+
* Built-in component types and runtime stubs.
|
|
4
|
+
* Auto-generated by platform_builtin-components/scripts/distribute-types.mjs
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type * as OBC from '@thatopen/components';
|
|
8
|
+
import type * as THREE from 'three';
|
|
9
|
+
import type { EngineServicesClient, Item, ItemFolder, ItemVersion, PlatformClient } from '../';
|
|
10
|
+
|
|
11
|
+
export interface CDEContext {
|
|
12
|
+
client: PlatformClient;
|
|
13
|
+
projectId: string;
|
|
14
|
+
}
|
|
15
|
+
export interface CDEUserPermissions {
|
|
16
|
+
canRead: boolean;
|
|
17
|
+
canCreate: boolean;
|
|
18
|
+
canUpdate: boolean;
|
|
19
|
+
canDelete: boolean;
|
|
20
|
+
canManage: boolean;
|
|
21
|
+
}
|
|
22
|
+
export type CDEMetadataValue = string | number | boolean | null;
|
|
23
|
+
export interface CDENamingSegment {
|
|
24
|
+
key: string;
|
|
25
|
+
config?: {
|
|
26
|
+
transform: (value: CDEMetadataValue) => string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface CDENamingSchema {
|
|
30
|
+
separator: string;
|
|
31
|
+
segments: CDENamingSegment[];
|
|
32
|
+
}
|
|
33
|
+
export interface CDEFile extends Omit<Item, 'creatingUser'> {
|
|
34
|
+
createdBy: string;
|
|
35
|
+
metadata: Record<string, CDEMetadataValue>;
|
|
36
|
+
versions?: ItemVersion[];
|
|
37
|
+
/** Tag of the file's current version (set by CDEManager from the loaded version). */
|
|
38
|
+
versionTag?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface CDEMetadataField {
|
|
41
|
+
type: "string" | "number" | "boolean" | "list";
|
|
42
|
+
description?: string;
|
|
43
|
+
required?: boolean;
|
|
44
|
+
label: string;
|
|
45
|
+
icon?: string;
|
|
46
|
+
options?: {
|
|
47
|
+
value: string | number | boolean;
|
|
48
|
+
label: string;
|
|
49
|
+
}[];
|
|
50
|
+
}
|
|
51
|
+
export type CDEMetadataSchema = Record<string, CDEMetadataField>;
|
|
52
|
+
export interface CDEFileActivity {
|
|
53
|
+
user: string;
|
|
54
|
+
action: string;
|
|
55
|
+
timestamp: string;
|
|
56
|
+
}
|
|
57
|
+
export interface CDEFileHistoryEntry {
|
|
58
|
+
fileId: string;
|
|
59
|
+
activity: CDEFileActivity[];
|
|
60
|
+
}
|
|
61
|
+
export interface CDEMetadataView {
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
fields: string[];
|
|
65
|
+
}
|
|
66
|
+
export type CDEPendingMetadata = Record<string, CDEMetadataValue>;
|
|
67
|
+
export type CDEPendingMetadataSchemaEdits = Record<string, CDEMetadataField | null>;
|
|
68
|
+
export type FolderPendingChange = {
|
|
69
|
+
kind: "create";
|
|
70
|
+
tempId: string;
|
|
71
|
+
name: string;
|
|
72
|
+
parentId: string | null;
|
|
73
|
+
} | {
|
|
74
|
+
kind: "rename";
|
|
75
|
+
folderId: string;
|
|
76
|
+
name: string;
|
|
77
|
+
} | {
|
|
78
|
+
kind: "archive";
|
|
79
|
+
folderId: string;
|
|
80
|
+
};
|
|
81
|
+
export type FolderPendingChanges = FolderPendingChange[];
|
|
82
|
+
export type CDEViewFileStatus = "loading" | "ready" | "failed" | "cancelled";
|
|
83
|
+
export type CDEMachineState = {
|
|
84
|
+
kind: "idle";
|
|
85
|
+
} | {
|
|
86
|
+
kind: "loading";
|
|
87
|
+
} | {
|
|
88
|
+
kind: "preparing";
|
|
89
|
+
files: CDEFile[];
|
|
90
|
+
} | {
|
|
91
|
+
kind: "selected";
|
|
92
|
+
files: CDEFile[];
|
|
93
|
+
} | {
|
|
94
|
+
kind: "viewing";
|
|
95
|
+
files: CDEFile[];
|
|
96
|
+
fileStatus: Record<string, CDEViewFileStatus>;
|
|
97
|
+
selectedFiles?: CDEFile[];
|
|
98
|
+
} | {
|
|
99
|
+
kind: "editing";
|
|
100
|
+
files: CDEFile[];
|
|
101
|
+
pendingMetadata: CDEPendingMetadata;
|
|
102
|
+
} | {
|
|
103
|
+
kind: "saving";
|
|
104
|
+
files: CDEFile[];
|
|
105
|
+
pendingMetadata: CDEPendingMetadata;
|
|
106
|
+
} | {
|
|
107
|
+
kind: "deleting";
|
|
108
|
+
files: CDEFile[];
|
|
109
|
+
} | {
|
|
110
|
+
kind: "configuringMetadataSchema";
|
|
111
|
+
pendingEdits: CDEPendingMetadataSchemaEdits;
|
|
112
|
+
} | {
|
|
113
|
+
kind: "savingMetadataSchema";
|
|
114
|
+
pendingEdits: CDEPendingMetadataSchemaEdits;
|
|
115
|
+
} | {
|
|
116
|
+
kind: "configuringMetadataViews";
|
|
117
|
+
pendingViews: CDEMetadataView[];
|
|
118
|
+
} | {
|
|
119
|
+
kind: "savingMetadataViews";
|
|
120
|
+
pendingViews: CDEMetadataView[];
|
|
121
|
+
} | {
|
|
122
|
+
kind: "dragging";
|
|
123
|
+
files: CDEFile[];
|
|
124
|
+
sourceFolderId: string | null;
|
|
125
|
+
previousState: CDEMachineState;
|
|
126
|
+
} | {
|
|
127
|
+
kind: "movingFiles";
|
|
128
|
+
files: CDEFile[];
|
|
129
|
+
targetFolderId: string;
|
|
130
|
+
} | {
|
|
131
|
+
kind: "draggingFolder";
|
|
132
|
+
folderId: string;
|
|
133
|
+
parentFolderId: string | null;
|
|
134
|
+
previousState: CDEMachineState;
|
|
135
|
+
} | {
|
|
136
|
+
kind: "movingFolder";
|
|
137
|
+
folderId: string;
|
|
138
|
+
targetFolderId: string | null;
|
|
139
|
+
} | {
|
|
140
|
+
kind: "editingFolders";
|
|
141
|
+
pendingChanges: FolderPendingChanges;
|
|
142
|
+
} | {
|
|
143
|
+
kind: "savingFolderChanges";
|
|
144
|
+
pendingChanges: FolderPendingChanges;
|
|
145
|
+
} | {
|
|
146
|
+
kind: "editingFiles";
|
|
147
|
+
pendingEdits: Record<string, Record<string, CDEMetadataValue>>;
|
|
148
|
+
pendingArchives: string[];
|
|
149
|
+
pendingRenames: Record<string, string>;
|
|
150
|
+
previousState: {
|
|
151
|
+
kind: "idle";
|
|
152
|
+
} | {
|
|
153
|
+
kind: "selected";
|
|
154
|
+
files: CDEFile[];
|
|
155
|
+
};
|
|
156
|
+
} | {
|
|
157
|
+
kind: "savingFiles";
|
|
158
|
+
pendingEdits: Record<string, Record<string, CDEMetadataValue>>;
|
|
159
|
+
pendingArchives: string[];
|
|
160
|
+
pendingRenames: Record<string, string>;
|
|
161
|
+
previousState: {
|
|
162
|
+
kind: "idle";
|
|
163
|
+
} | {
|
|
164
|
+
kind: "selected";
|
|
165
|
+
files: CDEFile[];
|
|
166
|
+
};
|
|
167
|
+
} | {
|
|
168
|
+
kind: "error";
|
|
169
|
+
reason: string;
|
|
170
|
+
previous: CDEMachineState;
|
|
171
|
+
};
|
|
172
|
+
export type CDEMachineEvent = {
|
|
173
|
+
type: "LOAD";
|
|
174
|
+
} | {
|
|
175
|
+
type: "UPLOAD";
|
|
176
|
+
} | {
|
|
177
|
+
type: "DOWNLOAD";
|
|
178
|
+
} | {
|
|
179
|
+
type: "SELECT";
|
|
180
|
+
files: CDEFile[];
|
|
181
|
+
} | {
|
|
182
|
+
type: "DESELECT";
|
|
183
|
+
} | {
|
|
184
|
+
type: "VIEW";
|
|
185
|
+
} | {
|
|
186
|
+
type: "ADD_TO_VIEW";
|
|
187
|
+
file: CDEFile;
|
|
188
|
+
} | {
|
|
189
|
+
type: "REMOVE_FROM_VIEW";
|
|
190
|
+
fileId: string;
|
|
191
|
+
} | {
|
|
192
|
+
type: "CLOSE_VIEW";
|
|
193
|
+
} | {
|
|
194
|
+
type: "SET_VIEW_FILE_STATUS";
|
|
195
|
+
fileId: string;
|
|
196
|
+
status: CDEViewFileStatus;
|
|
197
|
+
} | {
|
|
198
|
+
type: "START_EDIT";
|
|
199
|
+
} | {
|
|
200
|
+
type: "UPDATE_METADATA";
|
|
201
|
+
key: string;
|
|
202
|
+
value: CDEMetadataValue;
|
|
203
|
+
} | {
|
|
204
|
+
type: "SAVE";
|
|
205
|
+
} | {
|
|
206
|
+
type: "CANCEL_EDIT";
|
|
207
|
+
} | {
|
|
208
|
+
type: "ARCHIVE_FILE";
|
|
209
|
+
} | {
|
|
210
|
+
type: "START_CONFIGURE_METADATA_SCHEMA";
|
|
211
|
+
} | {
|
|
212
|
+
type: "ADD_METADATA_FIELD";
|
|
213
|
+
} | {
|
|
214
|
+
type: "UPDATE_METADATA_FIELD";
|
|
215
|
+
key: string;
|
|
216
|
+
value: CDEMetadataField;
|
|
217
|
+
} | {
|
|
218
|
+
type: "DELETE_METADATA_FIELD";
|
|
219
|
+
key: string;
|
|
220
|
+
} | {
|
|
221
|
+
type: "RESTORE_METADATA_FIELD";
|
|
222
|
+
key: string;
|
|
223
|
+
} | {
|
|
224
|
+
type: "SAVE_METADATA_SCHEMA";
|
|
225
|
+
} | {
|
|
226
|
+
type: "CANCEL_CONFIGURE_METADATA_SCHEMA";
|
|
227
|
+
} | {
|
|
228
|
+
type: "START_DRAG";
|
|
229
|
+
files: CDEFile[];
|
|
230
|
+
sourceFolderId: string | null;
|
|
231
|
+
} | {
|
|
232
|
+
type: "END_DRAG";
|
|
233
|
+
} | {
|
|
234
|
+
type: "DROP_FILES";
|
|
235
|
+
targetFolderId: string | null;
|
|
236
|
+
} | {
|
|
237
|
+
type: "START_FOLDER_DRAG";
|
|
238
|
+
folderId: string;
|
|
239
|
+
parentFolderId: string | null;
|
|
240
|
+
} | {
|
|
241
|
+
type: "END_FOLDER_DRAG";
|
|
242
|
+
} | {
|
|
243
|
+
type: "DROP_FOLDER";
|
|
244
|
+
targetFolderId: string | null;
|
|
245
|
+
} | {
|
|
246
|
+
type: "START_EDIT_FILES";
|
|
247
|
+
} | {
|
|
248
|
+
type: "UPDATE_FILE_METADATA";
|
|
249
|
+
fileId: string;
|
|
250
|
+
key: string;
|
|
251
|
+
value: CDEMetadataValue;
|
|
252
|
+
} | {
|
|
253
|
+
type: "REVERT_FILE_METADATA";
|
|
254
|
+
fileId: string;
|
|
255
|
+
} | {
|
|
256
|
+
type: "ARCHIVE_FILE_EDIT";
|
|
257
|
+
fileId: string;
|
|
258
|
+
} | {
|
|
259
|
+
type: "UNARCHIVE_FILE_EDIT";
|
|
260
|
+
fileId: string;
|
|
261
|
+
} | {
|
|
262
|
+
type: "RENAME_FILE";
|
|
263
|
+
fileId: string;
|
|
264
|
+
name: string;
|
|
265
|
+
} | {
|
|
266
|
+
type: "RENAME_FILE_IMMEDIATE";
|
|
267
|
+
fileId: string;
|
|
268
|
+
name: string;
|
|
269
|
+
} | {
|
|
270
|
+
type: "SAVE_FILE_EDITS";
|
|
271
|
+
} | {
|
|
272
|
+
type: "CANCEL_EDIT_FILES";
|
|
273
|
+
} | {
|
|
274
|
+
type: "START_EDIT_FOLDERS";
|
|
275
|
+
} | {
|
|
276
|
+
type: "ADD_FOLDER";
|
|
277
|
+
tempId: string;
|
|
278
|
+
name: string;
|
|
279
|
+
parentId: string | null;
|
|
280
|
+
} | {
|
|
281
|
+
type: "RENAME_FOLDER";
|
|
282
|
+
folderId: string;
|
|
283
|
+
name: string;
|
|
284
|
+
} | {
|
|
285
|
+
type: "ARCHIVE_FOLDER";
|
|
286
|
+
folderId: string;
|
|
287
|
+
} | {
|
|
288
|
+
type: "SAVE_FOLDER_CHANGES";
|
|
289
|
+
} | {
|
|
290
|
+
type: "CANCEL_FOLDER_CHANGES";
|
|
291
|
+
} | {
|
|
292
|
+
type: "RESET_FOLDER";
|
|
293
|
+
folderId: string;
|
|
294
|
+
} | {
|
|
295
|
+
type: "START_CONFIGURE_METADATA_VIEWS";
|
|
296
|
+
} | {
|
|
297
|
+
type: "ADD_METADATA_VIEW";
|
|
298
|
+
} | {
|
|
299
|
+
type: "UPDATE_METADATA_VIEW";
|
|
300
|
+
id: string;
|
|
301
|
+
view: CDEMetadataView;
|
|
302
|
+
} | {
|
|
303
|
+
type: "DELETE_METADATA_VIEW";
|
|
304
|
+
id: string;
|
|
305
|
+
} | {
|
|
306
|
+
type: "SAVE_METADATA_VIEWS";
|
|
307
|
+
} | {
|
|
308
|
+
type: "CANCEL_CONFIGURE_METADATA_VIEWS";
|
|
309
|
+
} | {
|
|
310
|
+
type: "SET_ACTIVE_METADATA_VIEW";
|
|
311
|
+
id: string | null;
|
|
312
|
+
} | {
|
|
313
|
+
type: "SET_GROUPS_VIEW_MODE";
|
|
314
|
+
mode: "groups" | "metadata";
|
|
315
|
+
} | {
|
|
316
|
+
type: "FAIL";
|
|
317
|
+
reason: string;
|
|
318
|
+
} | {
|
|
319
|
+
type: "DISMISS";
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
declare class _CDEManager extends OBC.Component implements OBC.Transitionable<CDEMachineState, CDEMachineEvent> {
|
|
323
|
+
static readonly uuid: "a3f82c1d-5b74-4e9a-bc30-d7e12f894a61";
|
|
324
|
+
readonly onFilesChanged: OBC.Event<CDEFile[]>;
|
|
325
|
+
readonly onFoldersChanged: OBC.Event<ItemFolder[]>;
|
|
326
|
+
readonly onPermissionsChanged: OBC.Event<CDEUserPermissions>;
|
|
327
|
+
readonly onSelectedGroupChanged: OBC.Event<string | null>;
|
|
328
|
+
readonly onMachineStateChanged: OBC.Event<CDEMachineState>;
|
|
329
|
+
readonly onMetadataViewsChanged: OBC.Event<CDEMetadataView[]>;
|
|
330
|
+
readonly onGroupsViewModeChanged: OBC.Event<"groups" | "metadata">;
|
|
331
|
+
readonly onMetadataGroupChanged: OBC.Event<Record<string, string> | null>;
|
|
332
|
+
readonly onDownloadReady: OBC.Event<{
|
|
333
|
+
blob: Blob;
|
|
334
|
+
filename: string;
|
|
335
|
+
}>;
|
|
336
|
+
readonly onUploadCompleted: OBC.Event<{
|
|
337
|
+
created: CDEFile[];
|
|
338
|
+
versioned: CDEFile[];
|
|
339
|
+
}>;
|
|
340
|
+
readonly onFolderChangesCompleted: OBC.Event<{
|
|
341
|
+
created: number;
|
|
342
|
+
renamed: number;
|
|
343
|
+
archived: number;
|
|
344
|
+
}>;
|
|
345
|
+
readonly onFilesMovedCompleted: OBC.Event<{
|
|
346
|
+
files: CDEFile[];
|
|
347
|
+
targetFolderName: string | null;
|
|
348
|
+
}>;
|
|
349
|
+
readonly onRenameCompleted: OBC.Event<{
|
|
350
|
+
success: boolean;
|
|
351
|
+
error?: string;
|
|
352
|
+
}>;
|
|
353
|
+
readonly onFolderMovedCompleted: OBC.Event<{
|
|
354
|
+
folderName: string;
|
|
355
|
+
targetFolderName: string | null;
|
|
356
|
+
}>;
|
|
357
|
+
readonly onShowArchivedChanged: OBC.Event<boolean>;
|
|
358
|
+
readonly onRestoreCompleted: OBC.Event<{
|
|
359
|
+
files?: CDEFile[];
|
|
360
|
+
folder?: ItemFolder;
|
|
361
|
+
}>;
|
|
362
|
+
readonly onUploadStarted: OBC.Event<{
|
|
363
|
+
count: number;
|
|
364
|
+
}>;
|
|
365
|
+
readonly onIfcConversionStarted: OBC.Event<{
|
|
366
|
+
file: CDEFile;
|
|
367
|
+
}>;
|
|
368
|
+
readonly onIfcConversionProgress: OBC.Event<{
|
|
369
|
+
file: CDEFile;
|
|
370
|
+
progress: number;
|
|
371
|
+
}>;
|
|
372
|
+
readonly onIfcConversionCompleted: OBC.Event<{
|
|
373
|
+
file: CDEFile;
|
|
374
|
+
success: boolean;
|
|
375
|
+
error?: string;
|
|
376
|
+
}>;
|
|
377
|
+
readonly conversionProgress: Map<string, number>;
|
|
378
|
+
enabled: boolean;
|
|
379
|
+
projectName: string;
|
|
380
|
+
missingMetadataPlaceholder: string;
|
|
381
|
+
availableColumns: Set<string>;
|
|
382
|
+
visibleColumns: Set<string>;
|
|
383
|
+
ctx?: CDEContext;
|
|
384
|
+
private _machineState;
|
|
385
|
+
private _activeUploads;
|
|
386
|
+
private _showArchived;
|
|
387
|
+
private _preArchivedViewMode;
|
|
388
|
+
private _archivedFiles;
|
|
389
|
+
private _archivedFolders;
|
|
390
|
+
private _archivedLoaded;
|
|
391
|
+
viewerGroups: {
|
|
392
|
+
extensions: string[];
|
|
393
|
+
multiple?: boolean;
|
|
394
|
+
}[];
|
|
395
|
+
get viewableExtensions(): Set<string>;
|
|
396
|
+
private _files;
|
|
397
|
+
private _folders;
|
|
398
|
+
private _fileHistory;
|
|
399
|
+
private _metadataSchema;
|
|
400
|
+
private _metadataViews;
|
|
401
|
+
private _activeMetadataViewId;
|
|
402
|
+
private _groupsViewMode;
|
|
403
|
+
private _selectedGroup;
|
|
404
|
+
private _selectedMetadataGroup;
|
|
405
|
+
private _namingSchema;
|
|
406
|
+
cacheMaxBytes: number;
|
|
407
|
+
cacheExtensions: Set<string>;
|
|
408
|
+
private _fileCache;
|
|
409
|
+
private _fileCacheBytes;
|
|
410
|
+
private _dedup;
|
|
411
|
+
private _cacheKey;
|
|
412
|
+
private _isCacheable;
|
|
413
|
+
private _addToCache;
|
|
414
|
+
downloadFile(file: CDEFile): Promise<ArrayBuffer>;
|
|
415
|
+
private _permissions;
|
|
416
|
+
private _projectDataFolderId;
|
|
417
|
+
private _appFolderIds;
|
|
418
|
+
private _excludedFolderIds;
|
|
419
|
+
private _projectMembers;
|
|
420
|
+
get projectMembers(): {
|
|
421
|
+
fullName: string;
|
|
422
|
+
email: string;
|
|
423
|
+
role: string;
|
|
424
|
+
}[];
|
|
425
|
+
get userPermissions(): CDEUserPermissions;
|
|
426
|
+
query: string | null;
|
|
427
|
+
get machineState(): CDEMachineState;
|
|
428
|
+
get files(): CDEFile[];
|
|
429
|
+
set files(value: CDEFile[]);
|
|
430
|
+
get folders(): ItemFolder[];
|
|
431
|
+
set folders(value: ItemFolder[]);
|
|
432
|
+
get showArchived(): boolean;
|
|
433
|
+
set showArchived(value: boolean);
|
|
434
|
+
get fileHistory(): CDEFileHistoryEntry[];
|
|
435
|
+
set fileHistory(value: CDEFileHistoryEntry[]);
|
|
436
|
+
get metadataSchema(): CDEMetadataSchema;
|
|
437
|
+
set metadataSchema(value: CDEMetadataSchema);
|
|
438
|
+
get selectedGroup(): string | null;
|
|
439
|
+
set selectedGroup(value: string | null);
|
|
440
|
+
get metadataViews(): CDEMetadataView[];
|
|
441
|
+
get activeMetadataViewId(): string | null;
|
|
442
|
+
get activeMetadataView(): CDEMetadataView | null;
|
|
443
|
+
get groupsViewMode(): "groups" | "metadata";
|
|
444
|
+
get selectedMetadataGroup(): Record<string, string> | null;
|
|
445
|
+
set selectedMetadataGroup(value: Record<string, string> | null);
|
|
446
|
+
get visibleFiles(): CDEFile[];
|
|
447
|
+
get namingSchema(): CDENamingSchema | null;
|
|
448
|
+
constructor(components: OBC.Components);
|
|
449
|
+
hasViewer(extension: string): boolean;
|
|
450
|
+
private _groupOf;
|
|
451
|
+
private _sameGroup;
|
|
452
|
+
canView(files: CDEFile[]): boolean;
|
|
453
|
+
canAddToView(files: CDEFile[]): boolean;
|
|
454
|
+
setNamingSchema(schema: CDENamingSchema): void;
|
|
455
|
+
buildFileName(file: CDEFile): string;
|
|
456
|
+
getSelectedFiles(): CDEFile[];
|
|
457
|
+
getActivity(fileId: string): CDEFileActivity[];
|
|
458
|
+
updateFilesMetadata(fileIds: string[], updates: Record<string, string>): Promise<void>;
|
|
459
|
+
readProjectData(app: string, filename: string): Promise<any>;
|
|
460
|
+
writeProjectData(app: string, filename: string, data: unknown): Promise<string>;
|
|
461
|
+
private _ensureProjectDataFolder;
|
|
462
|
+
private _ensureAppFolder;
|
|
463
|
+
private _loadPermissions;
|
|
464
|
+
loadFolders(): Promise<void>;
|
|
465
|
+
createFolder(name: string, parentId?: string): Promise<ItemFolder>;
|
|
466
|
+
getUserId(): Promise<string | undefined>;
|
|
467
|
+
loadUserConfig(): Promise<{
|
|
468
|
+
visibleColumns?: string[];
|
|
469
|
+
metadataViews?: CDEMetadataView[];
|
|
470
|
+
} | null>;
|
|
471
|
+
saveUserConfig(config: {
|
|
472
|
+
visibleColumns?: string[];
|
|
473
|
+
metadataViews?: CDEMetadataView[];
|
|
474
|
+
}): Promise<string | undefined>;
|
|
475
|
+
loadMetadataSchema(): Promise<void>;
|
|
476
|
+
initMetadataViews(views: CDEMetadataView[], activeId: string | null): void;
|
|
477
|
+
loadArchivedItems(): Promise<void>;
|
|
478
|
+
restoreFiles(files: CDEFile[]): Promise<void>;
|
|
479
|
+
restoreFolder(folderId: string): Promise<void>;
|
|
480
|
+
detectConflicts(files: File[]): {
|
|
481
|
+
file: File;
|
|
482
|
+
existing: CDEFile;
|
|
483
|
+
}[];
|
|
484
|
+
checkMoveConflicts(files: CDEFile[], targetFolderId: string | null): {
|
|
485
|
+
file: CDEFile;
|
|
486
|
+
existing: CDEFile;
|
|
487
|
+
}[];
|
|
488
|
+
resolveViewFile(file: CDEFile): CDEFile;
|
|
489
|
+
private _saveConversionIndex;
|
|
490
|
+
private _loadConversionIndex;
|
|
491
|
+
private _resumePendingConversions;
|
|
492
|
+
/** Cached id of the IfcFragmenter component, resolved by name for this session. */
|
|
493
|
+
private _ifcFragmenterId?;
|
|
494
|
+
/**
|
|
495
|
+
* Resolves the platform IFC→FRAG cloud component's id by its stable name
|
|
496
|
+
* (`IfcFragmenter`) within the current project, so it works across dev/prod
|
|
497
|
+
* without a hardcoded id. Cached for the session. Returns `undefined` if no
|
|
498
|
+
* such component is available in the project.
|
|
499
|
+
*/
|
|
500
|
+
private _resolveIfcFragmenterId;
|
|
501
|
+
private _triggerIfcConversions;
|
|
502
|
+
uploadFiles(files: File[], folderId?: string | null, options?: {
|
|
503
|
+
forceNew?: boolean;
|
|
504
|
+
}): Promise<void>;
|
|
505
|
+
sendMachineEvent(event: CDEMachineEvent): void;
|
|
506
|
+
private _transition;
|
|
507
|
+
private _getAllArchivedIds;
|
|
508
|
+
private _collectTempDescendants;
|
|
509
|
+
private _saveFolderChanges;
|
|
510
|
+
private _moveFolder;
|
|
511
|
+
moveFiles(files: CDEFile[], targetFolderId: string | null): Promise<void>;
|
|
512
|
+
private _moveFiles;
|
|
513
|
+
private _resolveFullName;
|
|
514
|
+
private _prepareDownload;
|
|
515
|
+
private _saveMetadataSchema;
|
|
516
|
+
private _resolveKeys;
|
|
517
|
+
private _saveFileMetadata;
|
|
518
|
+
private _renameFileImmediate;
|
|
519
|
+
private _saveFileEdits;
|
|
520
|
+
private _applyMetadataEdits;
|
|
521
|
+
private _applyMetadataSchemaEdits;
|
|
522
|
+
private _saveMetadataViews;
|
|
523
|
+
private _archiveFiles;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
export type CDEManager = InstanceType<typeof _CDEManager>;
|
|
527
|
+
export const CDEManager = { uuid: 'a3f82c1d-5b74-4e9a-bc30-d7e12f894a61' } as typeof _CDEManager & { uuid: 'a3f82c1d-5b74-4e9a-bc30-d7e12f894a61' };
|
|
528
|
+
|
|
529
|
+
export type ClashStatus = "new" | "active" | "resolved" | "acknowledged";
|
|
530
|
+
export type ClashType = "hard" | "clearance";
|
|
531
|
+
export interface ClashElement {
|
|
532
|
+
guid: string;
|
|
533
|
+
name: string;
|
|
534
|
+
localId: number;
|
|
535
|
+
modelId: string;
|
|
536
|
+
}
|
|
537
|
+
export interface ClashQueryFilter {
|
|
538
|
+
categories?: string[];
|
|
539
|
+
attributes?: {
|
|
540
|
+
aggregation?: 'exclusive' | 'inclusive';
|
|
541
|
+
queries: Array<{
|
|
542
|
+
name: string;
|
|
543
|
+
value?: string | string[] | number | boolean;
|
|
544
|
+
type?: string;
|
|
545
|
+
negate?: boolean;
|
|
546
|
+
}>;
|
|
547
|
+
};
|
|
548
|
+
relation?: {
|
|
549
|
+
name: string;
|
|
550
|
+
query?: ClashQueryFilter;
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
export interface ClashQuery {
|
|
554
|
+
id: string;
|
|
555
|
+
name: string;
|
|
556
|
+
modelFileIds: string[];
|
|
557
|
+
/** Filter conditions. Omit or leave empty to match all elements with geometry. */
|
|
558
|
+
query?: ClashQueryFilter;
|
|
559
|
+
}
|
|
560
|
+
export interface ClashMatrix {
|
|
561
|
+
id: string;
|
|
562
|
+
name: string;
|
|
563
|
+
/** Ordered list of query IDs — index order = priority (0 = most constrained). */
|
|
564
|
+
queryIds: string[];
|
|
565
|
+
/** Active cell job IDs (subset of upper-triangle pairs). */
|
|
566
|
+
jobIds: string[];
|
|
567
|
+
/** Active upper-triangle pair keys in the form "queryAId:queryBId". */
|
|
568
|
+
activePairs: string[];
|
|
569
|
+
/** Clash type applied to all jobs generated by this matrix. Defaults to 'hard'. */
|
|
570
|
+
jobType?: ClashType;
|
|
571
|
+
/** Clearance tolerance in metres. Only used when jobType is 'clearance'. */
|
|
572
|
+
tolerance?: number;
|
|
573
|
+
}
|
|
574
|
+
export interface ClashJob {
|
|
575
|
+
id: string;
|
|
576
|
+
name: string;
|
|
577
|
+
type: ClashType;
|
|
578
|
+
queryAId: string;
|
|
579
|
+
queryBId: string;
|
|
580
|
+
matrixId?: string;
|
|
581
|
+
/** Clearance tolerance in metres. Only present when type is 'clearance'. */
|
|
582
|
+
tolerance?: number;
|
|
583
|
+
}
|
|
584
|
+
export interface ClashRun {
|
|
585
|
+
id: string;
|
|
586
|
+
jobId: string;
|
|
587
|
+
date: string;
|
|
588
|
+
clashCount: number;
|
|
589
|
+
}
|
|
590
|
+
interface ClashBase {
|
|
591
|
+
/** Deterministic FNV-1a hash of the normalized pair (elementA.guid, elementB.guid). Stable across runs. */
|
|
592
|
+
id: string;
|
|
593
|
+
jobId: string;
|
|
594
|
+
firstSeenRunId: string;
|
|
595
|
+
lastSeenRunId: string;
|
|
596
|
+
elementA: ClashElement;
|
|
597
|
+
elementB: ClashElement;
|
|
598
|
+
point: [number, number, number];
|
|
599
|
+
status: ClashStatus;
|
|
600
|
+
comments?: string;
|
|
601
|
+
}
|
|
602
|
+
export interface HardClash extends ClashBase {
|
|
603
|
+
type: "hard";
|
|
604
|
+
volume?: number;
|
|
605
|
+
}
|
|
606
|
+
export interface ClearanceClash extends ClashBase {
|
|
607
|
+
type: "clearance";
|
|
608
|
+
distance: number;
|
|
609
|
+
}
|
|
610
|
+
export type Clash = HardClash | ClearanceClash;
|
|
611
|
+
export interface MarkerGroup {
|
|
612
|
+
id?: string;
|
|
613
|
+
point: [number, number, number];
|
|
614
|
+
count: number;
|
|
615
|
+
status?: ClashStatus;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
declare class _ClashesManager extends OBC.Component {
|
|
619
|
+
static readonly uuid: "2c9f4e8d-3a1b-4c5e-9d7f-0a2b6c8e1d3f";
|
|
620
|
+
enabled: boolean;
|
|
621
|
+
readonly onQueriesChanged: OBC.Event<ClashQuery[]>;
|
|
622
|
+
readonly onMatricesChanged: OBC.Event<ClashMatrix[]>;
|
|
623
|
+
readonly onJobsChanged: OBC.Event<ClashJob[]>;
|
|
624
|
+
readonly onRunsChanged: OBC.Event<ClashRun[]>;
|
|
625
|
+
readonly onClashesChanged: OBC.Event<Clash[]>;
|
|
626
|
+
readonly onClashStatusChanged: OBC.Event<Clash[]>;
|
|
627
|
+
/** Dispara cuando empieza el debounce de guardado (pendiente de persistir). */
|
|
628
|
+
readonly onSaveStart: OBC.Event<void>;
|
|
629
|
+
/** Dispara al terminar el guardado. true = éxito, false = error. */
|
|
630
|
+
readonly onSaveComplete: OBC.Event<boolean>;
|
|
631
|
+
world?: OBC.World;
|
|
632
|
+
/** Suprimir auto-save durante carga de datos (usar loadingData = true antes, false después). */
|
|
633
|
+
loadingData: boolean;
|
|
634
|
+
/** Registrar desde la app host para recargar datos desde el storage al terminar una ejecución. */
|
|
635
|
+
reload?: () => Promise<void>;
|
|
636
|
+
/** Registrar desde la app host para consultar qué jobIds tienen ejecución activa en storage. */
|
|
637
|
+
checkExecutions?: () => Promise<Set<string>>;
|
|
638
|
+
/** Registrar desde la app host para persistir queries y matrices al storage del proyecto. */
|
|
639
|
+
save?: () => Promise<void>;
|
|
640
|
+
/** Jobs con una ejecución cloud activa. Poblado por la app host al arrancar. */
|
|
641
|
+
readonly runningJobIds: Set<string>;
|
|
642
|
+
/** Mapa jobId → executionId para reconectar al WebSocket. Poblado por la app host al arrancar. */
|
|
643
|
+
readonly activeExecutions: Map<string, string>;
|
|
644
|
+
readonly onRunningJobsChanged: OBC.Event<Set<string>>;
|
|
645
|
+
readonly onRunProgress: OBC.Event<{
|
|
646
|
+
message: string;
|
|
647
|
+
progress: number;
|
|
648
|
+
}>;
|
|
649
|
+
readonly onRunComplete: OBC.Event<{
|
|
650
|
+
runId: string;
|
|
651
|
+
clashCount: number;
|
|
652
|
+
}>;
|
|
653
|
+
readonly onRunError: OBC.Event<{
|
|
654
|
+
code?: string;
|
|
655
|
+
message: string;
|
|
656
|
+
}>;
|
|
657
|
+
readonly onReloadingChanged: OBC.Event<boolean>;
|
|
658
|
+
isReloading: boolean;
|
|
659
|
+
/** True once init(client) has been called — safe to call run(). */
|
|
660
|
+
get ready(): boolean;
|
|
661
|
+
private _client?;
|
|
662
|
+
private _projectId?;
|
|
663
|
+
private _reconnectingJobIds;
|
|
664
|
+
private _queries;
|
|
665
|
+
private _matrices;
|
|
666
|
+
private _saveTimer?;
|
|
667
|
+
private _savePromise?;
|
|
668
|
+
private _jobs;
|
|
669
|
+
private _runs;
|
|
670
|
+
private _clashes;
|
|
671
|
+
private _markers;
|
|
672
|
+
private static _geo;
|
|
673
|
+
get queries(): ClashQuery[];
|
|
674
|
+
set queries(value: ClashQuery[]);
|
|
675
|
+
get matrices(): ClashMatrix[];
|
|
676
|
+
set matrices(value: ClashMatrix[]);
|
|
677
|
+
private _scheduleSave;
|
|
678
|
+
private _doSave;
|
|
679
|
+
/** Cancela el debounce pendiente y ejecuta el save inmediatamente. Espera a que complete. */
|
|
680
|
+
flush(): Promise<void>;
|
|
681
|
+
get jobs(): ClashJob[];
|
|
682
|
+
set jobs(value: ClashJob[]);
|
|
683
|
+
get runs(): ClashRun[];
|
|
684
|
+
set runs(value: ClashRun[]);
|
|
685
|
+
get clashes(): Clash[];
|
|
686
|
+
set clashes(value: Clash[]);
|
|
687
|
+
queryById(id: string): ClashQuery | undefined;
|
|
688
|
+
private _clashStylesRegistered;
|
|
689
|
+
private readonly STYLE_A;
|
|
690
|
+
private readonly STYLE_B;
|
|
691
|
+
private _clashStyle;
|
|
692
|
+
highlightAllClashes(clashes: Clash[]): void;
|
|
693
|
+
ghostClashes(clashes: Clash[]): Promise<void>;
|
|
694
|
+
ghostClash(clash: Clash): Promise<void>;
|
|
695
|
+
clearGhostClash(): Promise<void>;
|
|
696
|
+
highlightClash(clash: Clash): void;
|
|
697
|
+
clearClashHighlight(): void;
|
|
698
|
+
showMarkers(groups: MarkerGroup[]): void;
|
|
699
|
+
hideMarkers(): void;
|
|
700
|
+
toViewerPoint(point: [number, number, number]): THREE.Vector3;
|
|
701
|
+
private _toViewer;
|
|
702
|
+
private _renderMarkers;
|
|
703
|
+
private _clearMarkers;
|
|
704
|
+
cluster(clashes: Clash[], threshold: number): Clash[][];
|
|
705
|
+
private _setHighlighterEnabled;
|
|
706
|
+
private _isolatedMaterials;
|
|
707
|
+
runsForJob(jobId: string): ClashRun[];
|
|
708
|
+
clashesForRun(runId: string): Clash[];
|
|
709
|
+
updateClash(id: string, changes: {
|
|
710
|
+
status?: ClashStatus;
|
|
711
|
+
comments?: string;
|
|
712
|
+
}): void;
|
|
713
|
+
/**
|
|
714
|
+
* Initializes the manager from cloud storage: loads clash data, wires save/reload,
|
|
715
|
+
* reads in-flight executions, and resolves the viewer world (non-blocking).
|
|
716
|
+
* Consumer apps call this once instead of wiring all the pieces manually.
|
|
717
|
+
*/
|
|
718
|
+
init(client: PlatformClient): Promise<void>;
|
|
719
|
+
/** Launches clash detection in a Web Worker. Fires onRunProgress/onRunComplete/onRunError. */
|
|
720
|
+
run(jobId: string): void;
|
|
721
|
+
private _handleWorkerComplete;
|
|
722
|
+
/** Reconnects to an in-flight execution when the user opens a job that was running before page load. */
|
|
723
|
+
reconnectIfRunning(jobId: string): void;
|
|
724
|
+
private _listenToExecution;
|
|
725
|
+
private _firstWorld;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
export type ClashesManager = InstanceType<typeof _ClashesManager>;
|
|
729
|
+
export const ClashesManager = { uuid: '2c9f4e8d-3a1b-4c5e-9d7f-0a2b6c8e1d3f' } as typeof _ClashesManager & { uuid: '2c9f4e8d-3a1b-4c5e-9d7f-0a2b6c8e1d3f' };
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Which action buttons to expose per file row. All default to `true`.
|
|
733
|
+
*/
|
|
734
|
+
export interface FileListActions {
|
|
735
|
+
download?: boolean;
|
|
736
|
+
rename?: boolean;
|
|
737
|
+
delete?: boolean;
|
|
738
|
+
}
|
|
739
|
+
/**
|
|
740
|
+
* Config passed to {@link FileList.create}.
|
|
741
|
+
*/
|
|
742
|
+
export interface FileListConfig {
|
|
743
|
+
/** Services client used to list and mutate files. */
|
|
744
|
+
client: EngineServicesClient;
|
|
745
|
+
/** Optional folder ID to scope the list. If omitted, lists root files. */
|
|
746
|
+
folderId?: string;
|
|
747
|
+
/** Which action buttons to show per row. Defaults to all enabled. */
|
|
748
|
+
actions?: FileListActions;
|
|
749
|
+
/** Called when a file row is clicked (not an action button). */
|
|
750
|
+
onFileClick?: (file: Item) => void;
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* The result returned by {@link FileList.create}.
|
|
754
|
+
*/
|
|
755
|
+
export interface FileListInstance {
|
|
756
|
+
/** The DOM element to mount somewhere in your layout. */
|
|
757
|
+
element: HTMLElement;
|
|
758
|
+
/** Reloads the list from the services client. */
|
|
759
|
+
refresh: () => Promise<void>;
|
|
760
|
+
/** Changes the folder scope and reloads. Pass `undefined` for the root. */
|
|
761
|
+
setFolder: (folderId?: string) => Promise<void>;
|
|
762
|
+
/** Removes the element and forgets the instance. */
|
|
763
|
+
dispose: () => void;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* Built-in component that renders a file list backed by the services client,
|
|
768
|
+
* with built-in download / rename / delete actions.
|
|
769
|
+
*
|
|
770
|
+
* The backing data comes from {@link EngineServicesClient.listFiles}, so the
|
|
771
|
+
* list stays in sync with the storage service. Each call to {@link create}
|
|
772
|
+
* returns an independent instance with its own DOM element.
|
|
773
|
+
*
|
|
774
|
+
* @example
|
|
775
|
+
* ```ts
|
|
776
|
+
* const fileList = components.get(FileList);
|
|
777
|
+
* const { element, refresh } = fileList.create({
|
|
778
|
+
* client: app.client,
|
|
779
|
+
* folderId: someFolderId,
|
|
780
|
+
* });
|
|
781
|
+
* container.appendChild(element);
|
|
782
|
+
* ```
|
|
783
|
+
*/
|
|
784
|
+
declare class _FileList extends OBC.Component {
|
|
785
|
+
static readonly uuid: "b0b5e2a2-0b3a-4a6b-8b1c-0b1c4a6b8b1c";
|
|
786
|
+
enabled: boolean;
|
|
787
|
+
readonly name = "FileList";
|
|
788
|
+
private _instances;
|
|
789
|
+
/**
|
|
790
|
+
* Creates a new file-list instance. Returns the DOM element to mount plus a
|
|
791
|
+
* `refresh` handle to reload the list, a `setFolder` to change scope, and a
|
|
792
|
+
* `dispose` to remove it.
|
|
793
|
+
*/
|
|
794
|
+
create(config: FileListConfig): FileListInstance;
|
|
795
|
+
/**
|
|
796
|
+
* Removes every instance this manager has created.
|
|
797
|
+
*/
|
|
798
|
+
dispose(): void;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
/**
|
|
802
|
+
* Built-in component that renders a file list backed by the services client,
|
|
803
|
+
* with built-in download / rename / delete actions.
|
|
804
|
+
*
|
|
805
|
+
* The backing data comes from {@link EngineServicesClient.listFiles}, so the
|
|
806
|
+
* list stays in sync with the storage service. Each call to {@link create}
|
|
807
|
+
* returns an independent instance with its own DOM element.
|
|
808
|
+
*
|
|
809
|
+
* @example
|
|
810
|
+
* ```ts
|
|
811
|
+
* const fileList = components.get(FileList);
|
|
812
|
+
* const { element, refresh } = fileList.create({
|
|
813
|
+
* client: app.client,
|
|
814
|
+
* folderId: someFolderId,
|
|
815
|
+
* });
|
|
816
|
+
* container.appendChild(element);
|
|
817
|
+
* ```
|
|
818
|
+
*/
|
|
819
|
+
export type FileList = InstanceType<typeof _FileList>;
|
|
820
|
+
/**
|
|
821
|
+
* Built-in component that renders a file list backed by the services client,
|
|
822
|
+
* with built-in download / rename / delete actions.
|
|
823
|
+
*
|
|
824
|
+
* The backing data comes from {@link EngineServicesClient.listFiles}, so the
|
|
825
|
+
* list stays in sync with the storage service. Each call to {@link create}
|
|
826
|
+
* returns an independent instance with its own DOM element.
|
|
827
|
+
*
|
|
828
|
+
* @example
|
|
829
|
+
* ```ts
|
|
830
|
+
* const fileList = components.get(FileList);
|
|
831
|
+
* const { element, refresh } = fileList.create({
|
|
832
|
+
* client: app.client,
|
|
833
|
+
* folderId: someFolderId,
|
|
834
|
+
* });
|
|
835
|
+
* container.appendChild(element);
|
|
836
|
+
* ```
|
|
837
|
+
*/
|
|
838
|
+
export const FileList = { uuid: 'b0b5e2a2-0b3a-4a6b-8b1c-0b1c4a6b8b1c' } as typeof _FileList & { uuid: 'b0b5e2a2-0b3a-4a6b-8b1c-0b1c4a6b8b1c' };
|
|
839
|
+
|
|
840
|
+
/**
|
|
841
|
+
* A simple test component to validate the built-in component pipeline.
|
|
842
|
+
* Replace this with real components once the infrastructure is verified.
|
|
843
|
+
*/
|
|
844
|
+
declare class _HelloWorld extends OBC.Component {
|
|
845
|
+
static readonly uuid: "2c4ae432-fc24-43e9-9783-0c960c674e96";
|
|
846
|
+
enabled: boolean;
|
|
847
|
+
readonly name = "HelloWorld";
|
|
848
|
+
constructor(components: OBC.Components);
|
|
849
|
+
/**
|
|
850
|
+
* Returns a greeting message and logs it to the console.
|
|
851
|
+
* @param who - The name to greet. Defaults to `"World"`.
|
|
852
|
+
*/
|
|
853
|
+
greet(who?: string): string;
|
|
854
|
+
}
|
|
855
|
+
/**
|
|
856
|
+
* PlatformComponents.import() expects a `main` variable in scope with
|
|
857
|
+
* a `componentDefinition` property pointing to the OBC.Component class.
|
|
858
|
+
* The IIFE build (name: 'main') assigns this to `var main = ...`.
|
|
859
|
+
*/
|
|
860
|
+
|
|
861
|
+
/**
|
|
862
|
+
* A simple test component to validate the built-in component pipeline.
|
|
863
|
+
* Replace this with real components once the infrastructure is verified.
|
|
864
|
+
*/
|
|
865
|
+
export type HelloWorld = InstanceType<typeof _HelloWorld>;
|
|
866
|
+
/**
|
|
867
|
+
* A simple test component to validate the built-in component pipeline.
|
|
868
|
+
* Replace this with real components once the infrastructure is verified.
|
|
869
|
+
*/
|
|
870
|
+
export const HelloWorld = { uuid: '2c4ae432-fc24-43e9-9783-0c960c674e96' } as typeof _HelloWorld & { uuid: '2c4ae432-fc24-43e9-9783-0c960c674e96' };
|
|
871
|
+
|
|
872
|
+
declare class _UIManager extends OBC.Component {
|
|
873
|
+
#private;
|
|
874
|
+
static readonly uuid: "234f1416-528d-452a-9cc9-a16c5239b2eb";
|
|
875
|
+
enabled: boolean;
|
|
876
|
+
readonly name = "UIManager";
|
|
877
|
+
init(): void;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
export type UIManager = InstanceType<typeof _UIManager>;
|
|
881
|
+
export const UIManager = { uuid: '234f1416-528d-452a-9cc9-a16c5239b2eb' } as typeof _UIManager & { uuid: '234f1416-528d-452a-9cc9-a16c5239b2eb' };
|