@overmap-ai/core 1.0.46-project-attachments.7 → 1.0.46-project-attachments.9

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.
@@ -3816,6 +3816,20 @@ var __publicField = (obj, key, value) => {
3816
3816
  (mapping, documentId) => mapping[documentId]
3817
3817
  )
3818
3818
  );
3819
+ const selectAncestorIdsOfDocument = restructureCreateSelectorWithArgs(
3820
+ toolkit.createSelector([selectDocumentsMapping, (_state, documentId) => documentId], (mapping, documentId) => {
3821
+ const listOfAncestors = [];
3822
+ const document2 = mapping[documentId];
3823
+ if (!document2 || !document2.parent_document)
3824
+ return listOfAncestors;
3825
+ let currentAncestor = mapping[document2.parent_document];
3826
+ while (currentAncestor && currentAncestor.parent_document) {
3827
+ listOfAncestors.push(currentAncestor.offline_id);
3828
+ currentAncestor = mapping[currentAncestor.parent_document];
3829
+ }
3830
+ return listOfAncestors;
3831
+ })
3832
+ );
3819
3833
  const selectRootDocuments = toolkit.createSelector(
3820
3834
  [selectDocuments],
3821
3835
  (documents) => documents.filter((document2) => !document2.parent_document)
@@ -7370,9 +7384,9 @@ var __publicField = (obj, key, value) => {
7370
7384
  }
7371
7385
  store.dispatch(updateDocuments([document2]));
7372
7386
  const promise = this.enqueueRequest({
7373
- description: "Delete Document",
7387
+ description: "Update Document",
7374
7388
  method: HttpMethod.PATCH,
7375
- url: `/documents/${document2.offline_id}`,
7389
+ url: `/documents/${document2.offline_id}/`,
7376
7390
  payload: document2,
7377
7391
  blockers: [document2.offline_id],
7378
7392
  blocks: [document2.offline_id]
@@ -7411,7 +7425,7 @@ var __publicField = (obj, key, value) => {
7411
7425
  }
7412
7426
  store.dispatch(moveDocument({ documentId, targetDocumentId, position }));
7413
7427
  const promise = this.enqueueRequest({
7414
- description: "Delete Document",
7428
+ description: "Move Document",
7415
7429
  method: HttpMethod.PATCH,
7416
7430
  url: `/documents/${documentId}/move/`,
7417
7431
  queryParams: {
@@ -7442,7 +7456,7 @@ var __publicField = (obj, key, value) => {
7442
7456
  const promise = this.enqueueRequest({
7443
7457
  description: "Delete Document",
7444
7458
  method: HttpMethod.DELETE,
7445
- url: `/documents/${documentId}`,
7459
+ url: `/documents/${documentId}/`,
7446
7460
  blockers: [documentId],
7447
7461
  blocks: []
7448
7462
  });
@@ -7462,7 +7476,7 @@ var __publicField = (obj, key, value) => {
7462
7476
  const result = await this.enqueueRequest({
7463
7477
  description: "Get project documents",
7464
7478
  method: HttpMethod.GET,
7465
- url: `/documents/projects/${activeProjectId}`,
7479
+ url: `/documents/projects/${activeProjectId}/`,
7466
7480
  blockers: [],
7467
7481
  blocks: []
7468
7482
  });
@@ -15774,6 +15788,7 @@ var __publicField = (obj, key, value) => {
15774
15788
  exports2.selectAllComponentAttachments = selectAllComponentAttachments;
15775
15789
  exports2.selectAllComponentTypeAttachments = selectAllComponentTypeAttachments;
15776
15790
  exports2.selectAllProjectAttachments = selectAllProjectAttachments;
15791
+ exports2.selectAncestorIdsOfDocument = selectAncestorIdsOfDocument;
15777
15792
  exports2.selectAppearance = selectAppearance;
15778
15793
  exports2.selectAttachmentsOfComponent = selectAttachmentsOfComponent;
15779
15794
  exports2.selectAttachmentsOfComponentByType = selectAttachmentsOfComponentByType;