@smarterplan/ngx-smarterplan-core 1.4.28 → 1.4.30

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.
Files changed (125) hide show
  1. package/README.md +24 -24
  2. package/esm2022/lib/components/checkbox-slider/checkbox-slider.component.mjs +3 -3
  3. package/esm2022/lib/components/csv-export/csv-export.component.mjs +3 -3
  4. package/esm2022/lib/components/inventory-runs/inventory-files.component.mjs +168 -81
  5. package/esm2022/lib/components/inventory-runs/inventory-launch.component.mjs +301 -25
  6. package/esm2022/lib/components/inventory-runs/inventory-runs.component.mjs +14 -3
  7. package/esm2022/lib/components/loader/loader.component.mjs +3 -3
  8. package/esm2022/lib/components/menu-bar/avatar/avatar.component.mjs +1 -1
  9. package/esm2022/lib/components/menu-bar/menu-bar.component.mjs +3 -3
  10. package/esm2022/lib/components/menu-bar/navigation-bar/navigation-bar.component.mjs +3 -3
  11. package/esm2022/lib/components/modal-switch-visit/modal-switch-visit.component.mjs +3 -3
  12. package/esm2022/lib/components/search-bar/search-bar.component.mjs +3 -3
  13. package/esm2022/lib/components/splat-viewer/splat-viewer.component.mjs +1 -1
  14. package/esm2022/lib/components/support-modal/support-modal.component.mjs +3 -3
  15. package/esm2022/lib/config.mjs +1 -1
  16. package/esm2022/lib/helpers.service.mjs +1 -1
  17. package/esm2022/lib/matterport-extensions/nest-thermostat/CanvasImage.mjs +1 -1
  18. package/esm2022/lib/matterport-extensions/nest-thermostat/CanvasRenderer.mjs +1 -1
  19. package/esm2022/lib/matterport-extensions/nest-thermostat/NestThermostat.mjs +1 -1
  20. package/esm2022/lib/matterport-extensions/nest-thermostat/PlaneRenderer.mjs +1 -1
  21. package/esm2022/lib/matterport-extensions/scene-component/SceneComponent.mjs +1 -1
  22. package/esm2022/lib/matterport-extensions/security-camera/SecurityCamera.mjs +22 -22
  23. package/esm2022/lib/matterport-extensions/tv-player/TvPlayer.mjs +1 -1
  24. package/esm2022/lib/matterport-extensions/view-frustum-mesh/ViewFrustumMesh.mjs +22 -22
  25. package/esm2022/lib/mattertagData.mjs +1 -1
  26. package/esm2022/lib/ngx-smarterplan-core.module.mjs +1 -1
  27. package/esm2022/lib/ngx-smarterplan-core.service.mjs +1 -1
  28. package/esm2022/lib/pipes/duration-to-string.pipe.mjs +1 -1
  29. package/esm2022/lib/pipes/format-date-number-to-digits.pipe.mjs +1 -1
  30. package/esm2022/lib/pipes/hashtag-from-id.pipe.mjs +1 -1
  31. package/esm2022/lib/pipes/safe-url.pipe.mjs +1 -1
  32. package/esm2022/lib/pipes/time-date-to-local-string.pipe.mjs +1 -1
  33. package/esm2022/lib/pipes/username-from-id.pipe.mjs +1 -1
  34. package/esm2022/lib/services/amplify-cache.service.mjs +1 -1
  35. package/esm2022/lib/services/base-tab.service.mjs +1 -1
  36. package/esm2022/lib/services/baseVisibility.service.mjs +1 -1
  37. package/esm2022/lib/services/content.service.mjs +1 -1
  38. package/esm2022/lib/services/filter.service.mjs +1 -1
  39. package/esm2022/lib/services/intervention.service.mjs +1 -1
  40. package/esm2022/lib/services/locale.service.mjs +1 -1
  41. package/esm2022/lib/services/matterport-import.service.mjs +1 -1
  42. package/esm2022/lib/services/matterport-measurement.service.mjs +1 -1
  43. package/esm2022/lib/services/matterport-navigation.service.mjs +1 -1
  44. package/esm2022/lib/services/matterport-object3d.service.mjs +1 -1
  45. package/esm2022/lib/services/matterport-pointer.service.mjs +6 -6
  46. package/esm2022/lib/services/matterport-tag-copy.service.mjs +930 -138
  47. package/esm2022/lib/services/matterport-tag.service.mjs +1 -1
  48. package/esm2022/lib/services/matterport.service.mjs +17 -17
  49. package/esm2022/lib/services/models/affectation.service.mjs +1 -1
  50. package/esm2022/lib/services/models/base-object.service.mjs +1 -1
  51. package/esm2022/lib/services/models/capture.service.mjs +1 -1
  52. package/esm2022/lib/services/models/comment.service.mjs +1 -1
  53. package/esm2022/lib/services/models/domain.service.mjs +1 -1
  54. package/esm2022/lib/services/models/equipment.service.mjs +30 -23
  55. package/esm2022/lib/services/models/event.service.mjs +1 -1
  56. package/esm2022/lib/services/models/feature.service.mjs +1 -1
  57. package/esm2022/lib/services/models/hashtag.service.mjs +1 -1
  58. package/esm2022/lib/services/models/inventory-storage.mjs +21 -0
  59. package/esm2022/lib/services/models/inventory.service.mjs +52 -5
  60. package/esm2022/lib/services/models/layer.service.mjs +1 -1
  61. package/esm2022/lib/services/models/measurement.service.mjs +1 -1
  62. package/esm2022/lib/services/models/mission.service.mjs +1 -1
  63. package/esm2022/lib/services/models/navigation.service.mjs +1 -1
  64. package/esm2022/lib/services/models/node.service.mjs +1 -1
  65. package/esm2022/lib/services/models/object3D.service.mjs +1 -1
  66. package/esm2022/lib/services/models/operation.service.mjs +19 -5
  67. package/esm2022/lib/services/models/organisation.service.mjs +1 -1
  68. package/esm2022/lib/services/models/plan.service.mjs +1 -1
  69. package/esm2022/lib/services/models/poi.service.mjs +27 -27
  70. package/esm2022/lib/services/models/profile.service.mjs +1 -1
  71. package/esm2022/lib/services/models/property.service.mjs +1 -1
  72. package/esm2022/lib/services/models/space.service.mjs +1 -1
  73. package/esm2022/lib/services/models/template.service.mjs +1 -1
  74. package/esm2022/lib/services/models/ticket.service.mjs +1 -1
  75. package/esm2022/lib/services/models/visit.service.mjs +1 -1
  76. package/esm2022/lib/services/models/zone.service.mjs +1 -1
  77. package/esm2022/lib/services/navigator.service.mjs +1 -1
  78. package/esm2022/lib/services/obj-to-glb.mjs +1 -1
  79. package/esm2022/lib/services/retry-when-throttled.mjs +31 -0
  80. package/esm2022/lib/services/s3.service.mjs +22 -5
  81. package/esm2022/lib/services/search.service.mjs +1 -1
  82. package/esm2022/lib/services/support.service.mjs +1 -1
  83. package/esm2022/lib/services/sweep-locator.service.mjs +1 -1
  84. package/esm2022/lib/services/tag.service.mjs +16 -16
  85. package/esm2022/lib/services/threejs-import.service.mjs +1 -1
  86. package/esm2022/lib/services/threejs.service.mjs +1 -1
  87. package/esm2022/lib/services/user.service.mjs +1 -1
  88. package/esm2022/lib/services/utils/matterport-framing.util.mjs +1 -1
  89. package/esm2022/lib/services/utils/matterport-transform.util.mjs +26 -1
  90. package/esm2022/lib/services/utils/object3d-model.util.mjs +155 -0
  91. package/esm2022/lib/services/utils/tag-archive.util.mjs +89 -0
  92. package/esm2022/lib/services/validators.service.mjs +1 -1
  93. package/esm2022/lib/services/viewer.service.mjs +1 -1
  94. package/esm2022/lib/services/zone-drawer.service.mjs +1 -1
  95. package/esm2022/lib/services/zoneChange.service.mjs +1 -1
  96. package/esm2022/lib/tokens/matterport-sdk-key.token.mjs +1 -1
  97. package/esm2022/lib/tokens/object3d-model-upload.token.mjs +14 -0
  98. package/esm2022/lib/types.service.mjs +1 -1
  99. package/esm2022/lib/validators/email.directive.mjs +1 -1
  100. package/esm2022/lib/validators/no-empty.directive.mjs +1 -1
  101. package/esm2022/lib/validators/number.directive.mjs +1 -1
  102. package/esm2022/lib/validators/text.directive.mjs +1 -1
  103. package/esm2022/public-api.mjs +4 -1
  104. package/fesm2022/smarterplan-ngx-smarterplan-core.mjs +1965 -390
  105. package/fesm2022/smarterplan-ngx-smarterplan-core.mjs.map +1 -1
  106. package/lib/components/inventory-runs/inventory-files.component.d.ts +37 -8
  107. package/lib/components/inventory-runs/inventory-launch.component.d.ts +69 -2
  108. package/lib/components/inventory-runs/inventory-runs.component.d.ts +7 -0
  109. package/lib/services/matterport-tag-copy.service.d.ts +233 -13
  110. package/lib/services/models/equipment.service.d.ts +9 -1
  111. package/lib/services/models/inventory-storage.d.ts +9 -0
  112. package/lib/services/models/inventory.service.d.ts +14 -2
  113. package/lib/services/models/operation.service.d.ts +10 -0
  114. package/lib/services/retry-when-throttled.d.ts +5 -0
  115. package/lib/services/s3.service.d.ts +15 -0
  116. package/lib/services/utils/matterport-transform.util.d.ts +14 -0
  117. package/lib/services/utils/object3d-model.util.d.ts +58 -0
  118. package/lib/services/utils/tag-archive.util.d.ts +97 -0
  119. package/lib/tokens/object3d-model-upload.token.d.ts +10 -0
  120. package/package.json +2 -1
  121. package/public-api.d.ts +3 -0
  122. package/src/assets/viewers/splat/convert.html +11 -11
  123. package/src/assets/viewers/splat/index.html +90 -90
  124. package/src/assets/viewers/splat/webp.wasm +0 -0
  125. package/src/assets/vs-app.json +67 -67
@@ -1,23 +1,52 @@
1
1
  import { EventEmitter } from "@angular/core";
2
2
  import { InventoryFiles } from "../../services/models/inventory.service";
3
3
  import * as i0 from "@angular/core";
4
+ /** A file of the visit's inventory folder that can be sent, replaced or deleted from here. */
5
+ export interface InventoryEditableFile {
6
+ /** Where the inventory's task looks for it, whatever the file sent was called. */
7
+ name: "model.obj" | "data.json";
8
+ field: "modelObj" | "dataJson";
9
+ accept: string;
10
+ extension: RegExp;
11
+ type: string;
12
+ /** The button when the visit does not have it, as a key to translate. */
13
+ send: string;
14
+ /** Why a file chosen was refused, as a key to translate. */
15
+ wrongFile: string;
16
+ }
17
+ export declare const INVENTORY_MESH_FILE: InventoryEditableFile;
18
+ export declare const INVENTORY_POSITIONS_FILE: InventoryEditableFile;
4
19
  /**
5
20
  * What a visit has of what its AI inventory needs (InventoryService.checkFiles), and where what is
6
- * missing comes from, for the screens to show before launching one. The mesh, which nothing else
7
- * puts in the bucket, can be sent from here: the .obj of the visit's MatterPak, as it is.
21
+ * missing comes from, for the screens to show before launching one. The mesh and the panoramas'
22
+ * positions can be sent, replaced or deleted from here; the panoramas come from the visit's import.
8
23
  */
9
24
  export declare class InventoryFilesComponent {
10
25
  files: InventoryFiles;
11
- /** Said when the visit gets a file from here: [(files)]. */
26
+ /** Said when a file of the visit is sent, replaced or deleted from here: [(files)]. */
12
27
  filesChange: EventEmitter<InventoryFiles>;
13
28
  /** The visit's Matterport model, the folder of its files. */
14
29
  model3D: string;
15
- /** How much of the .obj is sent, from 0 to 100, while it is. */
30
+ /** While an inventory runs or is launched: it reads these files, which must not change. */
31
+ disabled: boolean;
32
+ meshFile: InventoryEditableFile;
33
+ positionsFile: InventoryEditableFile;
34
+ /** The file being sent. */
35
+ sending: InventoryEditableFile;
36
+ /** How much of it is sent, from 0 to 100. */
16
37
  uploadPercent: number;
17
38
  uploadName: string;
18
- /** Why the .obj was not sent, as a key to translate. */
19
- uploadError: string;
20
- onModelObjSelected(event: Event): Promise<void>;
39
+ /** The file whose deletion is waiting to be confirmed. */
40
+ confirmingDelete: InventoryEditableFile;
41
+ deletingFile: InventoryEditableFile;
42
+ /** What went wrong, as a key to translate, and with which file. */
43
+ error: string;
44
+ errorFile: InventoryEditableFile;
45
+ /** Whether the files cannot be changed for now. */
46
+ get locked(): boolean;
47
+ private fail;
48
+ onFileSelected(target: InventoryEditableFile, event: Event): Promise<void>;
49
+ onDeleteConfirmed(target: InventoryEditableFile): Promise<void>;
21
50
  static ɵfac: i0.ɵɵFactoryDeclaration<InventoryFilesComponent, never>;
22
- static ɵcmp: i0.ɵɵComponentDeclaration<InventoryFilesComponent, "lib-inventory-files", never, { "files": { "alias": "files"; "required": false; }; "model3D": { "alias": "model3D"; "required": false; }; }, { "filesChange": "filesChange"; }, never, never, false, never>;
51
+ static ɵcmp: i0.ɵɵComponentDeclaration<InventoryFilesComponent, "lib-inventory-files", never, { "files": { "alias": "files"; "required": false; }; "model3D": { "alias": "model3D"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "filesChange": "filesChange"; }, never, never, false, never>;
23
52
  }
@@ -1,7 +1,14 @@
1
1
  import { EventEmitter, OnChanges, OnInit, SimpleChanges } from "@angular/core";
2
2
  import { EquipmentService } from "../../services/models/equipment.service";
3
- import { InventoryFiles, InventoryModel, InventoryService } from "../../services/models/inventory.service";
3
+ import { NavigationService } from "../../services/models/navigation.service";
4
+ import { InventoryFiles, InventoryModel, InventoryRun, InventoryService } from "../../services/models/inventory.service";
4
5
  import * as i0 from "@angular/core";
6
+ /**
7
+ * How many equipment of the previous inventory are deleted at a time. All at once, hundreds of them
8
+ * at three or more requests each, the API refused part of them and the launch stopped half way; a
9
+ * request it refuses for coming too fast is now sent again (EquipmentService.deleteEquipment).
10
+ */
11
+ export declare const INVENTORY_DELETE_AT_ONCE = 15;
5
12
  /** A visit the AI inventory can look at: its node, its Matterport model (the folder of its files) and its name. */
6
13
  export interface InventoryVisit {
7
14
  nodeID: string;
@@ -17,6 +24,7 @@ export interface InventoryVisit {
17
24
  export declare class InventoryLaunchComponent implements OnInit, OnChanges {
18
25
  private inventoryService;
19
26
  private equipmentService;
27
+ private navigationService;
20
28
  spaceID: string;
21
29
  visits: InventoryVisit[];
22
30
  /** Only this panorama of the visit, as it is named: 110ee452_sweep.jpeg. */
@@ -34,21 +42,80 @@ export declare class InventoryLaunchComponent implements OnInit, OnChanges {
34
42
  deletePrevious: boolean;
35
43
  /** How many of the location's equipment the AI added, which deletePrevious deletes. */
36
44
  aiEquipmentCount: number;
45
+ /** While the previous inventory is deleted: how many of its equipment are done, of how many. */
46
+ deleting: {
47
+ done: number;
48
+ total: number;
49
+ };
50
+ /** How many equipment of the previous inventory could not be deleted, for the message. */
51
+ notDeleted: number;
52
+ /** Each visit's latest inventory when it is done and all its detections are still kept. */
53
+ reusable: Record<string, InventoryRun>;
54
+ /**
55
+ * The visits with detections kept that nothing is waiting for: their latest inventory is done.
56
+ * A stopped one needs them to resume.
57
+ */
58
+ discardable: InventoryVisit[];
59
+ confirmingDiscard: boolean;
60
+ discarding: boolean;
61
+ /** Whether the saved detections were just discarded, for the panel to say so. */
62
+ discarded: boolean;
63
+ /** The latest reading of the kept detections: an older one answering late is ignored. */
64
+ private keptCheck;
65
+ /** The latest count of the previous inventory, for the same reason. */
66
+ private countCheck;
67
+ /**
68
+ * Whether the launch places the latest inventories' detections again, with the cutoff chosen,
69
+ * instead of analysing the panoramas: minutes instead of hours.
70
+ */
71
+ reuseDetections: boolean;
37
72
  /** What each visit has of what the inventory needs, by its node; null when the bucket could not be read. */
38
73
  visitFiles: Record<string, InventoryFiles>;
39
74
  checkingFiles: boolean;
40
75
  launching: boolean;
41
76
  /** What went wrong, or why nothing was launched, as a key to translate. */
42
77
  message: string;
43
- constructor(inventoryService: InventoryService, equipmentService: EquipmentService);
78
+ constructor(inventoryService: InventoryService, equipmentService: EquipmentService, navigationService: NavigationService);
44
79
  ngOnInit(): Promise<void>;
80
+ /** The model and the cutoff score last launched with, from either screen; null when unknown. */
81
+ private lastSettings;
82
+ private keepSettings;
45
83
  ngOnChanges(changes: SimpleChanges): void;
84
+ /** Whether the inventory's detections of all its panoramas are among those kept. */
85
+ private keptAll;
86
+ /** What the bucket has of the visits' detections, for their latest inventories that are done. */
87
+ private readKept;
88
+ private findReusable;
89
+ /**
90
+ * Every visit to analyse has a finished inventory of all its panoramas, with all its detections
91
+ * kept: placing them again takes minutes, and analyses nothing. They are placed again under one
92
+ * model, so all must come from the same.
93
+ */
94
+ get canReuse(): boolean;
95
+ /** The model of the detections placed again: the one the launch uses when it reuses them. */
96
+ get reusedModelName(): string;
97
+ onFilesChange(visit: InventoryVisit, files: InventoryFiles): void;
98
+ /** Deletes the detections kept for the visits whose inventory is done. The equipment stays. */
99
+ onConfirmDiscard(): Promise<void>;
100
+ onReuseChange(reuse: boolean): void;
46
101
  private checkFiles;
47
102
  /** The visits that will be analysed: those with nothing known to be missing. */
48
103
  get launchableVisits(): InventoryVisit[];
49
104
  get canLaunch(): boolean;
50
105
  onDeletePreviousChange(deletePrevious: boolean): Promise<void>;
106
+ /** Counts what the launch would delete: it depends on the visits analysed. */
107
+ private countPrevious;
108
+ /**
109
+ * The equipment the AI added to the visits analysed, known by the panoramas their tags are at:
110
+ * a visit left out, for a missing file, keeps its own. One whose tag has no panorama cannot be
111
+ * told apart, and is deleted only when every visit is analysed again.
112
+ */
51
113
  private aiEquipments;
114
+ /**
115
+ * Deletes the equipment a few at a time, going on past one that fails (its error logged), and
116
+ * says how many could not be deleted.
117
+ */
118
+ private deleteFewAtATime;
52
119
  onLaunchClick(): Promise<void>;
53
120
  static ɵfac: i0.ɵɵFactoryDeclaration<InventoryLaunchComponent, never>;
54
121
  static ɵcmp: i0.ɵɵComponentDeclaration<InventoryLaunchComponent, "lib-inventory-launch", never, { "spaceID": { "alias": "spaceID"; "required": false; }; "visits": { "alias": "visits"; "required": false; }; "panorama": { "alias": "panorama"; "required": false; }; "running": { "alias": "running"; "required": false; }; }, { "cancelled": "cancelled"; "launched": "launched"; }, never, never, false, never>;
@@ -19,6 +19,8 @@ export declare class InventoryRunsComponent implements OnChanges, OnDestroy {
19
19
  /** Whether one of the inventories shown is running: said when it changes. */
20
20
  runningChange: EventEmitter<boolean>;
21
21
  runs: InventoryRun[];
22
+ /** Every inventory of the space by its id, for where one that places detections again took them. */
23
+ private byId;
22
24
  /** The inventory whose cancelling waits for its confirmation. */
23
25
  confirmingCancel: string;
24
26
  /** The inventory being cancelled or resumed, its buttons disabled meanwhile. */
@@ -36,6 +38,11 @@ export declare class InventoryRunsComponent implements OnChanges, OnDestroy {
36
38
  ngOnChanges(): void;
37
39
  ngOnDestroy(): void;
38
40
  refresh(): Promise<void>;
41
+ /**
42
+ * The finished inventory whose detections this one places again with its own cutoff, analysing
43
+ * no panorama; null when it analyses them, resuming a stopped one included.
44
+ */
45
+ reusedFrom(run: InventoryRun): InventoryRun;
39
46
  /**
40
47
  * About how many minutes the panoramas left will take, at the pace seen since the inventory
41
48
  * was first seen analysing them; null until a panorama has been done meanwhile.
@@ -16,10 +16,11 @@ import { DomainService } from './models/domain.service';
16
16
  import { ZoneService } from './models/zone.service';
17
17
  import { BaseUserService } from './user.service';
18
18
  import { Vec3 } from './utils/matterport-transform.util';
19
+ import { TagArchive, TagArchiveOrigin, TagArchiveVisit } from './utils/tag-archive.util';
19
20
  import * as i0 from "@angular/core";
20
21
  /** Progress snapshot emitted during copyTagsFromVisit(), so the UI can show a live status. */
21
22
  export interface CopyProgress {
22
- phase: 'collecting' | 'tickets' | 'equipments' | 'pois' | 'objects3d' | 'features' | 'measurements' | 'recalibrating' | 'done';
23
+ phase: 'collecting' | 'tickets' | 'equipments' | 'pois' | 'objects3d' | 'features' | 'measurements' | 'recalibrating' | 'files' | 'done';
23
24
  processedInPhase: number;
24
25
  totalInPhase: number;
25
26
  processedOverall: number;
@@ -35,9 +36,32 @@ export interface CopyProgress {
35
36
  * item notice (appended once, permanent). */
36
37
  export interface CopyLogEntry {
37
38
  id: string;
38
- type: 'step' | 'error' | 'healed';
39
+ type: 'step' | 'error' | 'healed' | 'info';
39
40
  text: string;
40
41
  }
42
+ /**
43
+ * How an import places the archived tags in the target visit.
44
+ * - SAME_MODEL: the target visit is the very Matterport model the tags were exported from
45
+ * (typically the same location on another environment): positions and sweeps are kept.
46
+ * - LANDMARKS: another model, aligned with two pairs of landmarks, exactly like a copy.
47
+ */
48
+ export type TagImportCalibration = {
49
+ mode: 'SAME_MODEL';
50
+ } | {
51
+ mode: 'LANDMARKS';
52
+ landmarkSourceA: Vec3;
53
+ landmarkTargetA: Vec3;
54
+ landmarkSourceB: Vec3;
55
+ landmarkTargetB: Vec3;
56
+ };
57
+ /** A 3D model an import cannot restore by itself, see getMissingObject3DModels(). */
58
+ export interface MissingObject3DModel {
59
+ /** reference of the model in the archive: pass it as key of `replacementModels` */
60
+ key: string;
61
+ fileName: string;
62
+ /** names of the archived 3D objects using it */
63
+ objectNames: string[];
64
+ }
41
65
  /** A tag listed for recalibration, with what the UI needs to identify it. */
42
66
  export type RecalibrationTag = POI & {
43
67
  elementName: string;
@@ -92,6 +116,7 @@ export declare class MatterportTagCopyService {
92
116
  private domainService;
93
117
  private translate;
94
118
  private zoneService;
119
+ private readonly modelUploadEnabled;
95
120
  copyProgress$: BehaviorSubject<CopyProgress | null>;
96
121
  copyLog$: BehaviorSubject<CopyLogEntry[]>;
97
122
  private spModule;
@@ -132,8 +157,47 @@ export declare class MatterportTagCopyService {
132
157
  private targetDomainIdsByTypeAndName;
133
158
  /** Target space id of the run in progress — used to re-home copied tag icons. */
134
159
  private targetSpaceId;
135
- constructor(navigationService: NavigationService, userService: BaseUserService, poiService: PoiService, ticketService: TicketsService, equipmentService: EquipmentService, object3DService: Object3DService, featureService: FeatureService, measurementService: MeasurementService, commentService: CommentService, hashtagService: HashtagService, missionService: MissionService, operationService: OperationService, domainService: DomainService, translate: TranslateService, zoneService: ZoneService);
160
+ /** archive being imported; null for a copy between two locations */
161
+ private archive;
162
+ /** an imported comment is credited to the operator running the import (their mission
163
+ * on the target space): the original author's mission belongs to another environment */
164
+ private importOwnerMissionId;
165
+ /** organisation in which the categories missing from the target are created on import */
166
+ private importDomainOrganisationId;
167
+ /** same Matterport model on both sides: a source sweep id is kept when the target has it */
168
+ private keepSweepIds;
169
+ /** library model file -> whether this application ships it (import only) */
170
+ private libraryModelAvailability;
171
+ /** model reference (see object3DModelKeyOf()) -> .glb chosen by the operator to replace it */
172
+ private replacementModels;
173
+ /** model reference -> S3 key its replacement was uploaded to: a model shared by several
174
+ * objects is uploaded once */
175
+ private uploadedReplacementKeys;
176
+ constructor(navigationService: NavigationService, userService: BaseUserService, poiService: PoiService, ticketService: TicketsService, equipmentService: EquipmentService, object3DService: Object3DService, featureService: FeatureService, measurementService: MeasurementService, commentService: CommentService, hashtagService: HashtagService, missionService: MissionService, operationService: OperationService, domainService: DomainService, translate: TranslateService, zoneService: ZoneService, modelUploadEnabled: boolean);
177
+ /** Whether this application may write 3D model files (see OBJECT3D_MODEL_UPLOAD_ENABLED). */
178
+ get object3DModelUploadEnabled(): boolean;
136
179
  copyTagsFromVisit(sourceSpaceId: string, targetSpaceId: string, landmarkSourceA: Vec3, landmarkTargetA: Vec3, landmarkSourceB: Vec3, landmarkTargetB: Vec3): Promise<boolean>;
180
+ /**
181
+ * Imports into a location the tags of an archive produced by exportTagsToArchive(),
182
+ * possibly on another environment (dev, demo, staging, production).
183
+ *
184
+ * Runs the very same phases as copyTagsFromVisit(), the source being the archive instead
185
+ * of a location: same deduplication (re-importing the same archive creates nothing twice),
186
+ * same healing, same keyword handling. What differs is how references are re-pointed,
187
+ * since the archive's ids designate nothing on this environment:
188
+ * - files are re-uploaded from the archive instead of being copied inside the bucket;
189
+ * - comments are credited to the operator running the import (see importOwnerMissionId);
190
+ * - categories are matched by name, and created in the operator's organisation when the
191
+ * target has none of that name (see resolveImportedDomainID()).
192
+ */
193
+ importTagsFromArchive(archive: TagArchive, targetSpaceId: string, calibration: TagImportCalibration, replacementModels?: Record<string, Blob & {
194
+ name?: string;
195
+ }>): Promise<boolean>;
196
+ /**
197
+ * Body shared by a copy and an import: reads the source through `collect`, then creates
198
+ * the records in the target space.
199
+ */
200
+ private runCopy;
137
201
  /**
138
202
  * Serialises the current copy log (step lines as last emitted, plus every error and
139
203
  * healed-item notice) to a plain-text file and triggers a browser download — wired to a
@@ -141,6 +205,144 @@ export declare class MatterportTagCopyService {
141
205
  * of a run rather than only the ~200px scrollable panel showing it.
142
206
  */
143
207
  downloadLog(filename?: string): void;
208
+ /**
209
+ * Exports every tag of a location — and everything the tags point at: tickets, equipments
210
+ * with their notes and links, 3D objects, POIs with their media, measurements, keywords,
211
+ * categories — into a ZIP archive downloaded by the browser, together with the S3 files
212
+ * they reference. The archive can then be imported in any location of any environment
213
+ * (see importTagsFromArchive()): it records where it comes from (see TagArchiveOrigin).
214
+ *
215
+ * The location is read exactly as a copy reads its source (collectLiveSnapshot()), so an
216
+ * export carries what a copy would. A file that cannot be downloaded is reported in the
217
+ * log and left out; the import then treats it like a copy treats a missing file.
218
+ *
219
+ * Progress and log go through copyProgress$ / copyLog$ (phases 'collecting', 'files').
220
+ */
221
+ exportTagsToArchive(spaceId: string, spaceName: string, visits?: TagArchiveVisit[]): Promise<boolean>;
222
+ /**
223
+ * Reads an archive chosen by the user (see exportTagsToArchive()). Throws a TagArchiveError
224
+ * when it is not a tag archive, was made by a newer version, or by the application of
225
+ * another module (MUSEUM vs IMMO): their models differ (Object3D, tickets...), the records
226
+ * could not be created here.
227
+ */
228
+ readTagArchive(file: Blob): Promise<TagArchive>;
229
+ /** Placeholders of the matterportCopy.importOrigin / exportOrigin translations. */
230
+ describeOrigin(origin: TagArchiveOrigin): Record<string, string>;
231
+ /**
232
+ * Reads a location of the current environment as the source of a copy or an export.
233
+ *
234
+ * Features archived by the operator are skipped (historical rule) — null-safe:
235
+ * FeatureService.isArchived() dereferences currentMission(spaceID).id and threw a
236
+ * TypeError when the operator had no mission on the source space (the common case for an
237
+ * archived v1 space), aborting the whole copy. Features are paginated: a space routinely
238
+ * holds more than the 100 features a single AppSync page returns, and the tail was
239
+ * silently dropped.
240
+ *
241
+ * The attachments of tickets and features are read on demand, through their own
242
+ * paginated query: the `comments` connection embedded in TicketsBySpace / FeaturesBySpace
243
+ * is capped at 100 items and its nextToken was never followed, so rich POIs lost
244
+ * attachments silently. The embedded list is only the fallback when that query fails.
245
+ */
246
+ private collectLiveSnapshot;
247
+ /** Source of an import: the records of the archive, as the exporting environment read them. */
248
+ private snapshotFromArchive;
249
+ /**
250
+ * READ-ONLY indexing of what the source references and the target already has: keywords,
251
+ * comment authors and categories.
252
+ * - copy: authors are matched by user (resolveCommentOwnerID()), categories by the
253
+ * operator's missions on both spaces (loadDomainIndex());
254
+ * - import: the archive's users belong to another environment, comments are credited to
255
+ * the operator; categories are matched by name (loadImportedDomainIndex()).
256
+ */
257
+ private loadReferenceIndexes;
258
+ /**
259
+ * READ-ONLY indexing for an import: the archived categories by their (foreign) id, and the
260
+ * categories the operator's mission on the target space can see, by (type, name).
261
+ * Missing categories are created in the mission's organisation, on demand — see
262
+ * resolveImportedDomainID(). When the target categories cannot be read, none is created:
263
+ * doing it blindly could duplicate existing ones.
264
+ */
265
+ private loadImportedDomainIndex;
266
+ /**
267
+ * Resolves an archived category for the target space: the category of the same type and
268
+ * name the operator can see there, else a new one created in the organisation of their
269
+ * mission on the target space (parents first, so the tree is kept). Dropped when it cannot
270
+ * be created (no mission there, creation refused...).
271
+ */
272
+ private resolveImportedDomainID;
273
+ /**
274
+ * Import counterpart of an S3 copy: uploads the archived bytes of `sourceKey` under
275
+ * `destKey`. A file the export could not include is a MissingS3FileError, handled exactly
276
+ * like an orphaned reference during a copy.
277
+ */
278
+ private restoreArchivedFile;
279
+ /** Runs `task` over `items`, a few at a time (keeps the API and S3 from throttling). */
280
+ private forEachInBatches;
281
+ /** Every POI of a snapshot: those on the sweeps and those embedded in the elements. */
282
+ private allSnapshotPois;
283
+ /**
284
+ * Raw S3 keys of every file the copy duplicates (see the copy phases): equipment photos and
285
+ * notes, attachments and media, measurement screenshots, uploaded 3D models, tag icons.
286
+ */
287
+ private collectArchiveFileKeys;
288
+ /**
289
+ * Categories referenced by the exported records, with their ancestors: an import matches
290
+ * them by name, and recreates the missing ones at the same place of the tree.
291
+ */
292
+ private collectExportDomains;
293
+ /** Where an export comes from: environment (application origin), location, date, operator. */
294
+ private buildExportOrigin;
295
+ /** File-name-safe version of a label. */
296
+ private toFileName;
297
+ /**
298
+ * Reference of the model of a 3D object, as the archive indexes its files: the raw S3 key
299
+ * of an uploaded model, `assets/3Dobjects/objects/<file>` for a library model, null for a
300
+ * model hosted at an absolute url (nothing to carry over).
301
+ */
302
+ private object3DModelKeyOf;
303
+ /**
304
+ * 3D models of an archive that an import could not give to their objects: neither in the
305
+ * archive (missing on the source, or not exportable — a library model of another format
306
+ * than .glb) nor shipped by this application. The operator can provide a .glb for each
307
+ * before importing (see importTagsFromArchive(), `replacementModels`); otherwise the
308
+ * object is created without a displayable model and the log says so.
309
+ */
310
+ getMissingObject3DModels(archive: TagArchive): Promise<MissingObject3DModel[]>;
311
+ /**
312
+ * Model path of a copied / imported 3D object when this application may not write model
313
+ * files (see OBJECT3D_MODEL_UPLOAD_ENABLED):
314
+ * - copy between two locations: the same path, an S3 model included — both objects then
315
+ * share the file, which nothing deletes with an object;
316
+ * - import: a library model is referenced as is (reported when this application does not
317
+ * ship it); an S3 model of the other environment cannot be referenced at all, the object
318
+ * is skipped (Object3DModelUploadDisabledError).
319
+ */
320
+ private modelPathWithoutUpload;
321
+ /** Replacement model the operator chose for this object's model, if any. */
322
+ private replacementModelOf;
323
+ /** Uploads a replacement model once, whatever the number of objects using it. */
324
+ private uploadReplacementModel;
325
+ /** File names of the library .glb models the snapshot's 3D objects use (see object3d-model.util.ts). */
326
+ private collectLibraryModelFiles;
327
+ /** Url this application serves a library model from. */
328
+ private libraryModelUrl;
329
+ /**
330
+ * Bytes of a library model as this application serves it; null when it does not ship it.
331
+ * A single-page host answers an unknown path with the index page (200, text/html): that is
332
+ * a missing file too.
333
+ */
334
+ private fetchLibraryModel;
335
+ /** Whether this application ships a library model (checked once per file and per run). */
336
+ private isLibraryModelAvailable;
337
+ /** Asks this application whether it serves a library model (an index page is a no). */
338
+ private isLibraryModelServed;
339
+ /**
340
+ * Import of a 3D object whose model comes from the application's library: when the target
341
+ * application does not ship that model, the copy exported in the archive is uploaded to S3
342
+ * and the object switched to it. Returns the S3 key, or null to keep the library path
343
+ * (model available, or impossible to restore — reported in the log).
344
+ */
345
+ private restoreMissingLibraryModel;
144
346
  /** Adds or updates a step line (identified by stepId) with new text, then republishes the log. */
145
347
  private setStepLog;
146
348
  /** Appends a new, permanent log line (never overwritten), then republishes the log. */
@@ -148,6 +350,8 @@ export declare class MatterportTagCopyService {
148
350
  /** Appends a permanent log line for an item that was repaired rather than newly
149
351
  * created — see healEquipmentIdentity() and its ticket/feature equivalents. */
150
352
  private appendHealedLog;
353
+ /** Appends a permanent, neutral log line (origin of an import, category created...). */
354
+ private appendInfoLog;
151
355
  /** Resets the log for a new run. */
152
356
  private resetLog;
153
357
  /** Clears every id map carried over from a previous run. The service is a root-level
@@ -212,14 +416,21 @@ export declare class MatterportTagCopyService {
212
416
  /** Normalised lookup key for a hashtag name, so "Moyen Âge" and "moyen âge " match. */
213
417
  private hashtagKey;
214
418
  /**
215
- * READ-ONLY indexing of both spaces' hashtags. Creates nothing.
419
+ * READ-ONLY: hashtag id -> name of a space's hashtags. Creates nothing.
216
420
  *
217
421
  * `Feature.hashtags` stores Hashtag *ids*, and a Hashtag is a per-space record, so the
218
- * ids have to be translated by name. The translation table is built here; the missing
219
- * keywords are created later, one at a time, only when a POI that actually uses them is
220
- * about to be written (see resolveHashtagIds()).
422
+ * ids have to be translated by name. The translation table is built from this and
423
+ * loadTargetHashtagIndex(); the missing keywords are created later, one at a time, only
424
+ * when a POI that actually uses them is about to be written (see resolveHashtagIds()).
425
+ * A failed read answers an empty map: the keywords are then dropped.
426
+ */
427
+ private loadHashtagNames;
428
+ /**
429
+ * READ-ONLY indexing of the target space's hashtags, by name. When they cannot be read,
430
+ * the source keywords are dropped too: creating them blindly could duplicate keywords the
431
+ * target already has.
221
432
  */
222
- private loadHashtagIndex;
433
+ private loadTargetHashtagIndex;
223
434
  /**
224
435
  * Translates one feature's hashtag ids into target-space ids, creating on the fly the
225
436
  * keywords the target space does not have yet.
@@ -238,15 +449,18 @@ export declare class MatterportTagCopyService {
238
449
  */
239
450
  private resolveHashtagIds;
240
451
  /**
241
- * READ-ONLY indexing of both spaces' missions.
452
+ * READ-ONLY: mission id -> user id of a space's missions.
242
453
  *
243
454
  * A Mission is scoped to one space (it pairs a userID with a spaceID), so the id a
244
455
  * source comment's `ownerID` points at never designates anyone in the target space.
245
- * This builds the two lookup tables resolveCommentOwnerID() needs to translate it:
246
- * which user a source Mission id belongs to, and which Mission (if any) that same
247
- * user already holds in the target space.
456
+ * This and loadTargetMissionIndex() build the two lookup tables resolveCommentOwnerID()
457
+ * needs to translate it: which user a source Mission id belongs to, and which Mission (if
458
+ * any) that same user already holds in the target space.
459
+ * A failed read answers an empty map: comment authorship is then dropped.
248
460
  */
249
- private loadMissionIndex;
461
+ private loadMissionUserIds;
462
+ /** READ-ONLY indexing of the target space's missions, by user. */
463
+ private loadTargetMissionIndex;
250
464
  /**
251
465
  * Translates a source comment's `ownerID` (a per-space Mission id) into the Mission of
252
466
  * the SAME user in the target space, so the copy keeps crediting its real author.
@@ -403,6 +617,12 @@ export declare class MatterportTagCopyService {
403
617
  private buildNavigationPositionMap;
404
618
  /** Applies the rigid transform to a POI coordinate (position + orientation). */
405
619
  private getAdjustedCoordinates;
620
+ /**
621
+ * Moves a 3D object of the scene with the rigid transform: its position like a tag's, its
622
+ * orientation turned by the same angle around the vertical axis (applyRigidTransformToEulerXYZ).
623
+ * Its scale does not change: both models are in meters.
624
+ */
625
+ private getAdjustedObject3DPlacement;
406
626
  /**
407
627
  * Reads a stored coordinate (JSON string or object, whatever its spacing) as a position.
408
628
  * Null for a virtual POI or an unreadable value.
@@ -85,7 +85,15 @@ export declare class EquipmentService extends BaseObjectService {
85
85
  getPrefixDoc(type: TypeNote): any;
86
86
  uploadDocForAllEquipments(equipments: Equipment[], documentFile: File, type: TypeNote): Promise<any[]>;
87
87
  uploadDoc(equipment: Equipment, documentFile: File, type: TypeNote): Promise<Note>;
88
- deleteEquipment(equip: Equipment): Promise<Equipment>;
88
+ /**
89
+ * Deletes an equipment with what hangs on it: every one of its POIs (its tags in the visits), its
90
+ * notes and their files, its operations. Those go first: when one of them fails, the equipment is
91
+ * still there to be deleted again, instead of tags left pointing at an equipment that is gone.
92
+ * A request the API refuses for coming too fast is sent again a little later. justLoaded: the
93
+ * equipment comes from a list loaded just before, whose operations can be trusted, so none there
94
+ * means no request for them.
95
+ */
96
+ deleteEquipment(equip: Equipment, justLoaded?: boolean): Promise<Equipment>;
89
97
  updateEquipmentLocation(equip: Equipment, tagData: MattertagData): Promise<POI>;
90
98
  removeTicketFromEquipment(ticket: Ticket, equip: Equipment): Promise<Operation>;
91
99
  initEquips(): Promise<void>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Deletes one file of a visit's AI inventory, and nothing outside it.
3
+ *
4
+ * The inventory's only S3 delete. It lives here, out of the library's public API, rather than as a
5
+ * generic helper beside the other S3 functions, so that no other code picks it up for something
6
+ * else: it refuses any key outside `visits/<model3D>/inventory/`, and logs every deletion with the
7
+ * reason its caller gives. Rejects when the key is refused or the file could not be deleted.
8
+ */
9
+ export declare function removeInventoryFile(model3D: string, key: string, reason: string): Promise<void>;
@@ -70,6 +70,16 @@ export declare class InventoryService {
70
70
  checkFiles(model3D: string): Promise<InventoryFiles>;
71
71
  /** Whether the visit has all its inventory needs. */
72
72
  isComplete(files: InventoryFiles): boolean;
73
+ /**
74
+ * How many panoramas' detections each inventory of the visit kept in the bucket, by inventory
75
+ * (machine-learning: inventory_job.py); null when the bucket could not be read.
76
+ */
77
+ keptDetections(model3D: string): Promise<Record<string, number>>;
78
+ /**
79
+ * Deletes all the detections kept for the visit, going on past a file that fails, and says how
80
+ * many could not be deleted. The equipment placed from them stays.
81
+ */
82
+ discardDetections(model3D: string): Promise<number>;
73
83
  /** The latest inventory of each visit, the latest first. */
74
84
  latestOfEachVisit(runs: InventoryRun[]): InventoryRun[];
75
85
  isToRun(run: InventoryRun): boolean;
@@ -104,9 +114,11 @@ export declare class InventoryService {
104
114
  /**
105
115
  * Launches an inventory of each of the visits, unless one is already running in the space:
106
116
  * of all their panoramas, or of the one of `sweep` (the first 8 characters of its sweep, as
107
- * the panoramas are named) when it is given.
117
+ * the panoramas are named) when it is given. A visit given an inventory in `resumeFrom` starts
118
+ * from that one's detections: with all its panoramas analysed, only the placing is done again,
119
+ * with this cutoff.
108
120
  */
109
- launch(spaceID: string, nodeIDs: string[], model: InventoryModel, cutoffScore: number, sweep?: string): Promise<"LAUNCHED" | "ALREADY_RUNNING">;
121
+ launch(spaceID: string, nodeIDs: string[], model: InventoryModel, cutoffScore: number, sweep?: string, resumeFrom?: Record<string, string>): Promise<"LAUNCHED" | "ALREADY_RUNNING">;
110
122
  static ɵfac: i0.ɵɵFactoryDeclaration<InventoryService, never>;
111
123
  static ɵprov: i0.ɵɵInjectableDeclaration<InventoryService>;
112
124
  }
@@ -8,11 +8,21 @@ export declare class OperationService {
8
8
  getOperationsByTicketID(id: string): Promise<Operation[]>;
9
9
  getOperationsByEquipmentID(id: string): Promise<Operation[]>;
10
10
  getTicketsByEquipmentID(id: string): Promise<Ticket[]>;
11
+ /** Whether a loaded equipment's list query shows it has no operation, none linked since. */
12
+ private loadedWithoutOperations;
11
13
  /** Tickets of a loaded equipment, without a request when its list query shows it has no operation. */
12
14
  getTicketsForEquipment(equip: {
13
15
  id?: string;
14
16
  operations?: any;
15
17
  }): Promise<Ticket[]>;
18
+ /**
19
+ * Deletes a loaded equipment's operations, without a request when its list query shows it has
20
+ * none: for an equipment loaded just before, as one loaded long ago may have some since.
21
+ */
22
+ deleteOperationsForLoadedEquipment(equip: {
23
+ id?: string;
24
+ operations?: any;
25
+ }): Promise<Operation[]>;
16
26
  deleteOperationsForEquipment(equipID: string): Promise<Operation[]>;
17
27
  deleteOperationsForTicket(ticketID: string): Promise<void>;
18
28
  deleteOperation(operationID: string): Promise<Operation>;
@@ -0,0 +1,5 @@
1
+ export declare function isThrottled(error: any): boolean;
2
+ /** How long to wait before each new try, give or take half, so that requests do not come back together. */
3
+ export declare const THROTTLED_WAITS_MS: number[];
4
+ /** Sends the request again, a little later each time, while the API refuses it for coming too fast. */
5
+ export declare function retryWhenThrottled<T>(request: () => Promise<T>, waitsMs?: number[]): Promise<T>;
@@ -49,3 +49,18 @@ export declare const copyFileInS3: (sourceKey: string, destKey: string) => Promi
49
49
  * IMPORTANT: like copyFileInS3, this must NOT swallow errors.
50
50
  */
51
51
  export declare const copyFileInS3ViaDownload: (sourceKey: string, destKey: string) => Promise<string>;
52
+ /**
53
+ * Downloads an S3 object (public level) as a Blob, with its content type.
54
+ * Used by the tag export, which packs the files into an archive so they can be re-uploaded
55
+ * on another environment (another bucket).
56
+ * IMPORTANT: does NOT swallow errors — callers need NoSuchKey to tell a missing file apart.
57
+ */
58
+ export declare const downloadS3Object: (key: string) => Promise<{
59
+ body: Blob;
60
+ contentType: string | null;
61
+ }>;
62
+ /**
63
+ * Uploads raw content (Blob or bytes) under an exact S3 key (public level) and returns that key.
64
+ * IMPORTANT: does NOT swallow errors.
65
+ */
66
+ export declare const uploadS3Object: (key: string, body: Blob | Uint8Array, contentType?: string | null) => Promise<string>;
@@ -34,3 +34,17 @@ export declare function distance(a: Vec3, b: Vec3): number;
34
34
  * rotated relative to the source ends up pointing into the wall it is stuck on.
35
35
  */
36
36
  export declare function applyRigidTransformToDirection(v: Vec3, t: RigidTransform): Vec3;
37
+ /**
38
+ * Applies the rotation part of the transform to an object's orientation: the Euler angles
39
+ * (radians, three.js "XYZ" order, the one Object3D.rotation is stored and loaded in).
40
+ *
41
+ * A 3D object placed in the scene keeps its full orientation, so adding the angle to the Y
42
+ * component only — as applyRigidTransformToYRotationDeg() does for a tag's heading — would be
43
+ * wrong as soon as the object is tilted on X or Z. The rotation is composed instead: the
44
+ * object's own rotation first, then the turn around the vertical axis of the whole model.
45
+ *
46
+ * The turn is the one applyRigidTransformToPoint() applies to positions, written for (x, z) as
47
+ * x' = x cos(a) - z sin(a), z' = x sin(a) + z cos(a): in three.js terms a rotation of -a
48
+ * around +Y. So an object keeps pointing at the same thing in both models.
49
+ */
50
+ export declare function applyRigidTransformToEulerXYZ(rotation: Vec3, t: RigidTransform): Vec3;