@smarterplan/ngx-smarterplan-core 1.4.29 → 1.4.31

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 (124) 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 +89 -89
  5. package/esm2022/lib/components/inventory-runs/inventory-launch.component.mjs +3 -3
  6. package/esm2022/lib/components/inventory-runs/inventory-runs.component.mjs +3 -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 +16 -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 +46 -3
  55. package/esm2022/lib/services/models/event.service.mjs +1 -1
  56. package/esm2022/lib/services/models/feature.service.mjs +47 -5
  57. package/esm2022/lib/services/models/hashtag.service.mjs +1 -1
  58. package/esm2022/lib/services/models/inventory-storage.mjs +1 -1
  59. package/esm2022/lib/services/models/inventory.service.mjs +3 -3
  60. package/esm2022/lib/services/models/layer.service.mjs +1 -1
  61. package/esm2022/lib/services/models/measurement.service.mjs +3 -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 +23 -6
  66. package/esm2022/lib/services/models/operation.service.mjs +1 -1
  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 +67 -30
  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 +43 -3
  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 +1 -1
  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 +18 -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 +1666 -368
  105. package/fesm2022/smarterplan-ngx-smarterplan-core.mjs.map +1 -1
  106. package/lib/services/filter.service.d.ts +9 -0
  107. package/lib/services/matterport-tag-copy.service.d.ts +233 -13
  108. package/lib/services/models/equipment.service.d.ts +4 -0
  109. package/lib/services/models/feature.service.d.ts +4 -0
  110. package/lib/services/models/object3D.service.d.ts +5 -1
  111. package/lib/services/models/poi.service.d.ts +23 -0
  112. package/lib/services/models/ticket.service.d.ts +4 -0
  113. package/lib/services/s3.service.d.ts +15 -0
  114. package/lib/services/user.service.d.ts +7 -0
  115. package/lib/services/utils/matterport-transform.util.d.ts +14 -0
  116. package/lib/services/utils/object3d-model.util.d.ts +58 -0
  117. package/lib/services/utils/tag-archive.util.d.ts +97 -0
  118. package/lib/tokens/object3d-model-upload.token.d.ts +10 -0
  119. package/package.json +2 -1
  120. package/public-api.d.ts +3 -0
  121. package/src/assets/viewers/splat/convert.html +11 -11
  122. package/src/assets/viewers/splat/index.html +90 -90
  123. package/src/assets/viewers/splat/webp.wasm +0 -0
  124. package/src/assets/vs-app.json +67 -67
@@ -31,6 +31,15 @@ export declare class FilterService {
31
31
  filterMeasurementsForDateRange(measurements: Measurement[], dateRange: Date[]): Measurement[];
32
32
  filterObjectsForZone(objects: any[], // TODO: remove any here..
33
33
  zoneID?: string, zone?: Zone): Promise<any[]>;
34
+ /** Whether an object belongs to the zone, by the same rule as filterObjectsForZone; true without a zone. */
35
+ isInZone(object: any, zoneID?: string, zone?: Zone): Promise<boolean>;
36
+ /**
37
+ * A zone's list once one object's POI has changed: the objects of the space that were in it, in
38
+ * the space's order, with that object in it or not as `inZone` says.
39
+ */
40
+ zoneListAfterMove<T extends {
41
+ id?: string;
42
+ }>(space: T[], zone: T[] | null, objectID: string, inZone: boolean): T[];
34
43
  filterEquipmentsByDomainList(equipments: Equipment[], domainIDList: string[]): Equipment[];
35
44
  filterEquipmentsForTerm(equips: Equipment[], term: string): Equipment[];
36
45
  filterTicketsForTerm(tickets: Ticket[], term: string): Ticket[];
@@ -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.
@@ -55,7 +55,11 @@ export declare class EquipmentService extends BaseObjectService {
55
55
  awsKinesisAnalytics: any;
56
56
  isMuseumUser: boolean;
57
57
  private destroy$;
58
+ /** Counts the calls to initEquips, so that only the latest one publishes its lists. */
59
+ private initEquipsRun;
58
60
  constructor(apiInjected: any, awsKinesisAnalyticsInjected: any, poiService: PoiService, navigationService: NavigationService, visitService: VisitService, operationService: OperationService, ticketsService: TicketsService, navigatorService: NavigatorService, filterService: FilterService, userService: BaseUserService, viewerService: ViewerService, modalService: NgbModal, zoneChangeService: ZoneChangeService);
61
+ /** Moves a loaded equipment into or out of the current zone's list, as its last written POI says. */
62
+ private sortAgainIntoZone;
59
63
  readEquipment(id: string): Promise<Equipment>;
60
64
  createEquipment(equip: Equipment, imageFile: File, documentFile: File): Promise<Equipment | void>;
61
65
  getSignedUrlsForEquipment(equip: Equipment): Promise<Equipment>;
@@ -46,7 +46,11 @@ export declare class FeatureService extends BaseObjectService {
46
46
  currentHashtags: Hashtag[];
47
47
  createObservable: Subject<Feature>;
48
48
  deleteObservable: Subject<Feature>;
49
+ /** Counts the calls to initFeatures, so that only the latest one publishes its lists. */
50
+ private initFeaturesRun;
49
51
  constructor(apiInjected: any, navigatorService: NavigatorService, filterService: FilterService, poiService: PoiService, commentService: CommentService, userService: BaseUserService, navigationService: NavigationService, visitService: VisitService, hashtagService: HashtagService, zoneChangeService: ZoneChangeService);
52
+ /** Moves a loaded info point or desk into or out of the current zone's list, as its last written POI says. */
53
+ private sortAgainIntoZone;
50
54
  createFeature(feature: Feature): Promise<Feature>;
51
55
  deleteFeature(feature: Feature): Promise<Feature>;
52
56
  updateFeature(feature: any): Promise<Feature>;
@@ -4,12 +4,14 @@ import { BaseUserService } from "../user.service";
4
4
  import { NavigatorService } from "../navigator.service";
5
5
  import { FilterService } from "../filter.service";
6
6
  import { ZoneChangeService } from "../zoneChange.service";
7
+ import { PoiService } from "./poi.service";
7
8
  import * as i0 from "@angular/core";
8
9
  export declare class Object3DService {
9
10
  private userService;
10
11
  private navigatorService;
11
12
  private zoneChangeService;
12
13
  private filterService;
14
+ private poiService;
13
15
  API: any;
14
16
  objects3DUpdated: Subject<{
15
17
  space: Object3D[];
@@ -33,8 +35,10 @@ export declare class Object3DService {
33
35
  isMuseumUser: boolean;
34
36
  isUpdating: boolean;
35
37
  private destroy$;
38
+ /** Counts the calls to initObjects3D, so that only the latest one publishes its lists. */
39
+ private initObjects3DRun;
36
40
  private selectedObject3D;
37
- constructor(apiInjected: any, userService: BaseUserService, navigatorService: NavigatorService, zoneChangeService: ZoneChangeService, filterService: FilterService);
41
+ constructor(apiInjected: any, userService: BaseUserService, navigatorService: NavigatorService, zoneChangeService: ZoneChangeService, filterService: FilterService, poiService: PoiService);
38
42
  getObjects3DBySpace(spaceID: string): Promise<Array<Object3D>>;
39
43
  initObjects3D(): Promise<void>;
40
44
  getSelectedObject3D(): any;
@@ -1,7 +1,13 @@
1
+ import { Subject } from 'rxjs';
1
2
  import { POI, PoiType, Zone } from '../../types.service';
2
3
  import { ZoneChangeService } from '../zoneChange.service';
3
4
  import { BaseUserService } from '../user.service';
4
5
  import * as i0 from "@angular/core";
6
+ /** A POI this service has just written, as the API returned it. */
7
+ export interface PoiWrite {
8
+ poi: POI;
9
+ deleted: boolean;
10
+ }
5
11
  export declare class PoiService {
6
12
  private userService;
7
13
  private zoneChangeService;
@@ -13,6 +19,13 @@ export declare class PoiService {
13
19
  private destroy$;
14
20
  /** Elements whose POI was written in this session: a copy loaded earlier with the element is outdated. */
15
21
  private changedElementIDs;
22
+ /**
23
+ * Every POI this service has just created, updated or deleted. The lists sorted by zone read the
24
+ * zone off the POI, so they have to be sorted again when it moves.
25
+ */
26
+ readonly poiWritten: Subject<PoiWrite>;
27
+ /** The last POI written for each element in this session, by element ID. */
28
+ private lastWrites;
16
29
  constructor(apiInjected: any, awsKinesisAnalyticsInjected: any, userService: BaseUserService, zoneChangeService: ZoneChangeService);
17
30
  getPoiByElementId(elementId: string): Promise<POI | null>;
18
31
  /**
@@ -29,6 +42,16 @@ export declare class PoiService {
29
42
  poiIsVirtual(poi: POI): boolean;
30
43
  updatePoi(poi: {}): Promise<POI>;
31
44
  deletePoi(poiID: string): Promise<POI>;
45
+ private written;
46
+ /**
47
+ * Puts in the objects the POI this session last wrote for them, where it is more recent than the
48
+ * one they were loaded with. The lists are read from indexes that may not show a write made a
49
+ * moment ago, and a zone read off the old POI would be the wrong one.
50
+ */
51
+ withLatestPois<T extends {
52
+ id?: string;
53
+ pois?: any;
54
+ }>(objects: T[]): T[];
32
55
  getPoisByMatterportSweepByType(sweep: string, type: PoiType): Promise<POI[]>;
33
56
  /**
34
57
  * Optimized version: fetches POIs for MANY sweeps in as few GraphQL calls as possible,
@@ -60,7 +60,11 @@ export declare class TicketsService extends BaseObjectService {
60
60
  floorsPerSpace: Zone[];
61
61
  selectedFloor: Zone;
62
62
  private destroy$;
63
+ /** Counts the calls to initTickets, so that only the latest one publishes its lists. */
64
+ private initTicketsRun;
63
65
  constructor(awsKinesisAnalyticsInjected: any, apiInjected: any, operationService: OperationService, eventService: EventService, affectationService: AffectationService, poiService: PoiService, userService: BaseUserService, navigatorService: NavigatorService, filterService: FilterService, interventionService: InterventionService, navigationService: NavigationService, visitService: VisitService, viewerService: ViewerService, zoneChangeService: ZoneChangeService, modalService: NgbModal);
66
+ /** Moves a loaded ticket into or out of the current zone's list, as its last written POI says. */
67
+ private sortAgainIntoZone;
64
68
  initTickets(): Promise<void>;
65
69
  adaptTicket(ticket: Ticket): Promise<Ticket>;
66
70
  getPriorityColor(ticket: Ticket): string;
@@ -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>;
@@ -94,6 +94,13 @@ export declare class BaseUserService {
94
94
  hardDeleteUser(userID: string): Promise<Profile>;
95
95
  getManagerMissions(): Mission[];
96
96
  getAvalableLevelsForCurrentUser(): LevelStatus[];
97
+ /**
98
+ * The access levels the user sees in every one of the spaces, by the rule the lists are
99
+ * filtered with: those of their highest mission in a space, and all of them where they have no
100
+ * mission, as nothing is filtered there. A form offering a level beyond these would make an
101
+ * object its own author cannot see.
102
+ */
103
+ getAvailableLevelsForSpaces(spaceIDs: string[]): LevelStatus[];
97
104
  getAvailableRolesForCurrentUser(): RoleStatus[];
98
105
  /** Test if the user have the role given in parameter : "roleStatus" */
99
106
  isRole(roleStatus: RoleStatus): boolean;
@@ -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;
@@ -0,0 +1,58 @@
1
+ /** Folder of the library models, as stored in Object3D.path. */
2
+ export declare const OBJECT3D_LIBRARY_FOLDER = "3DObjects/objects/";
3
+ /** Folder the application serves the library models from (see MatterportObject3DService). */
4
+ export declare const OBJECT3D_LIBRARY_ASSET_FOLDER = "assets/3Dobjects/objects/";
5
+ /** Largest model file a user may upload. */
6
+ export declare const OBJECT3D_UPLOAD_MAX_BYTES: number;
7
+ /** S3 folder of the uploaded models; one sub-folder per space. */
8
+ export declare const OBJECT3D_S3_FOLDER = "objects3D/";
9
+ /** Model formats the 3D loaders handle (an S3 model copied between locations keeps its own). */
10
+ export declare const OBJECT3D_MODEL_EXTENSIONS: string[];
11
+ /** Content type the uploaded models are stored with. */
12
+ export declare const GLB_CONTENT_TYPE = "model/gltf-binary";
13
+ /**
14
+ * Why a model file is refused. The values are translation keys of the application, written
15
+ * in English like its other keys.
16
+ */
17
+ export type Object3dUploadError = 'Only .glb files can be uploaded.' | 'The file is too large (50 MB maximum).' | 'The file is empty.' | 'This file is not a valid .glb model.' | 'This model refers to external files: export it as a single .glb file with embedded textures.';
18
+ /** Where the model of an Object3D is loaded from. */
19
+ export interface Object3DModelSource {
20
+ /** file name without extension */
21
+ object: string;
22
+ /** extension, lower case, without the dot */
23
+ format: string;
24
+ /** url to load; absent for a library model (the loader builds it from object + format) */
25
+ url?: string;
26
+ }
27
+ /**
28
+ * Checks that a file is a self-contained binary glTF 2.0 model, small enough to be uploaded:
29
+ * - name ending in .glb, size between 1 byte and OBJECT3D_UPLOAD_MAX_BYTES;
30
+ * - glb header: magic "glTF", version 2, declared length equal to the file size;
31
+ * - first chunk of type JSON, holding a parseable glTF document of version 2.x;
32
+ * - no buffer nor image pointing at another file or url (only embedded data): such a
33
+ * reference cannot be resolved next to a signed S3 url, and would make the viewer fetch
34
+ * an arbitrary address.
35
+ * The content is only read, never executed. Returns the error, or null when the file is valid.
36
+ */
37
+ export declare function validateGlbFile(file: Blob & {
38
+ name?: string;
39
+ }): Promise<Object3dUploadError | null>;
40
+ /**
41
+ * S3 key of an uploaded model: under the space's folder, with a file name reduced to safe
42
+ * characters, followed by the upload time (UTC, to the millisecond) and a short random suffix.
43
+ * S3 overwrites an existing key without warning, and a model may be used by several objects
44
+ * (duplicates, copies, imports): two uploads of the same file name must never share a key.
45
+ * The user's file name never decides the folder.
46
+ */
47
+ export declare function buildObject3DModelKey(spaceId: string, fileName: string, now?: Date): string;
48
+ /** File name of a library model ("3DObjects/objects/chair.glb" gives "chair.glb"), null otherwise. */
49
+ export declare function getObject3DLibraryFile(path: string | null | undefined): string | null;
50
+ /**
51
+ * Where to load the model of an Object3D from (see the header of this file). A model uploaded
52
+ * to S3 gets a signed url, valid for a limited time: resolve it when loading, never store it.
53
+ * Null when the path is unusable.
54
+ */
55
+ export declare function resolveObject3DModelSource(object3D: {
56
+ path?: string | null;
57
+ s3Bucket?: boolean | null;
58
+ }): Promise<Object3DModelSource | null>;