@comapeo/core-react 1.0.1 → 1.1.0

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 (57) hide show
  1. package/dist/commonjs/contexts/ClientApi.d.ts +14 -0
  2. package/dist/commonjs/contexts/ClientApi.js +16 -0
  3. package/dist/commonjs/hooks/client.d.ts +59 -0
  4. package/dist/commonjs/hooks/client.js +71 -0
  5. package/dist/{hooks → commonjs/hooks}/documents.d.ts +2 -2
  6. package/dist/commonjs/hooks/documents.js +138 -0
  7. package/dist/commonjs/hooks/maps.js +37 -0
  8. package/dist/commonjs/hooks/projects.d.ts +251 -0
  9. package/dist/commonjs/hooks/projects.js +258 -0
  10. package/dist/commonjs/index.d.ts +11 -0
  11. package/dist/commonjs/index.js +69 -0
  12. package/dist/commonjs/lib/react-query/client.d.ts +30 -0
  13. package/dist/commonjs/lib/react-query/client.js +36 -0
  14. package/dist/{lib → commonjs/lib}/react-query/documents.d.ts +101 -101
  15. package/dist/commonjs/lib/react-query/documents.js +92 -0
  16. package/dist/commonjs/lib/react-query/invites.d.ts +12 -0
  17. package/dist/commonjs/lib/react-query/invites.js +22 -0
  18. package/dist/commonjs/lib/react-query/maps.d.ts +15 -0
  19. package/dist/commonjs/lib/react-query/maps.js +23 -0
  20. package/dist/commonjs/lib/react-query/projects.d.ts +196 -0
  21. package/dist/commonjs/lib/react-query/projects.js +147 -0
  22. package/dist/commonjs/lib/react-query/shared.js +16 -0
  23. package/dist/commonjs/package.json +3 -0
  24. package/dist/{contexts → esm/contexts}/ClientApi.d.ts +3 -3
  25. package/dist/{hooks → esm/hooks}/client.d.ts +2 -2
  26. package/dist/{hooks → esm/hooks}/client.js +2 -2
  27. package/dist/esm/hooks/documents.d.ts +112 -0
  28. package/dist/{hooks → esm/hooks}/documents.js +2 -2
  29. package/dist/esm/hooks/maps.d.ts +33 -0
  30. package/dist/{hooks → esm/hooks}/maps.js +2 -2
  31. package/dist/{hooks → esm/hooks}/projects.d.ts +6 -6
  32. package/dist/{hooks → esm/hooks}/projects.js +2 -2
  33. package/dist/esm/index.d.ts +11 -0
  34. package/dist/esm/index.js +11 -0
  35. package/dist/esm/lib/react-query/client.d.ts +30 -0
  36. package/dist/{lib → esm/lib}/react-query/client.js +1 -1
  37. package/dist/esm/lib/react-query/documents.d.ts +1501 -0
  38. package/dist/{lib → esm/lib}/react-query/documents.js +1 -1
  39. package/dist/esm/lib/react-query/invites.d.ts +12 -0
  40. package/dist/{lib → esm/lib}/react-query/invites.js +1 -1
  41. package/dist/esm/lib/react-query/maps.d.ts +15 -0
  42. package/dist/{lib → esm/lib}/react-query/maps.js +1 -1
  43. package/dist/esm/lib/react-query/projects.d.ts +196 -0
  44. package/dist/{lib → esm/lib}/react-query/projects.js +1 -1
  45. package/dist/esm/lib/react-query/shared.d.ts +5 -0
  46. package/dist/esm/package.json +3 -0
  47. package/package.json +27 -12
  48. package/dist/index.d.ts +0 -11
  49. package/dist/index.js +0 -11
  50. package/dist/lib/react-query/client.d.ts +0 -30
  51. package/dist/lib/react-query/invites.d.ts +0 -12
  52. package/dist/lib/react-query/maps.d.ts +0 -15
  53. package/dist/lib/react-query/projects.d.ts +0 -196
  54. /package/dist/{hooks → commonjs/hooks}/maps.d.ts +0 -0
  55. /package/dist/{lib → commonjs/lib}/react-query/shared.d.ts +0 -0
  56. /package/dist/{contexts → esm/contexts}/ClientApi.js +0 -0
  57. /package/dist/{lib → esm/lib}/react-query/shared.js +0 -0
@@ -1,5 +1,5 @@
1
- import type { MapeoProjectApi } from '@comapeo/ipc';
2
- import type { MapeoDoc } from '@comapeo/schema';
1
+ import type { MapeoProjectApi } from '@comapeo/ipc' with { 'resolution-mode': 'import' };
2
+ import type { MapeoDoc } from '@comapeo/schema' with { 'resolution-mode': 'import' };
3
3
  export type DocumentType = Extract<MapeoDoc['schemaName'], 'field' | 'observation' | 'preset' | 'track' | 'remoteDetectionAlert'>;
4
4
  export declare function getDocumentsQueryKey<D extends DocumentType>({ projectId, docType, }: {
5
5
  projectId: string;
@@ -36,9 +36,9 @@ export declare function documentsQueryOptions<D extends DocumentType>({ projectA
36
36
  docType: D;
37
37
  includeDeleted?: boolean;
38
38
  lang?: string;
39
- }): import("@tanstack/query-core").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<({
39
+ }): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<({
40
40
  schemaName: "track";
41
- locations: import("@comapeo/schema/dist/schema/track").Position[];
41
+ locations: import("@comapeo/schema/dist/schema/track.js").Position[];
42
42
  observationRefs: {
43
43
  docId: string;
44
44
  versionId: string;
@@ -63,7 +63,7 @@ export declare function documentsQueryOptions<D extends DocumentType>({ projectA
63
63
  metadata: {
64
64
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
65
65
  };
66
- geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert").Geometry;
66
+ geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
67
67
  docId: string;
68
68
  versionId: string;
69
69
  originalVersionId: string;
@@ -77,9 +77,9 @@ export declare function documentsQueryOptions<D extends DocumentType>({ projectA
77
77
  schemaName: "preset";
78
78
  name: string;
79
79
  geometry: ("point" | "vertex" | "line" | "area" | "relation")[];
80
- tags: import("@comapeo/schema/dist/schema/preset").Tags;
81
- addTags: import("@comapeo/schema/dist/schema/preset").Tags1;
82
- removeTags: import("@comapeo/schema/dist/schema/preset").Tags2;
80
+ tags: import("@comapeo/schema/dist/schema/preset.js").Tags;
81
+ addTags: import("@comapeo/schema/dist/schema/preset.js").Tags1;
82
+ removeTags: import("@comapeo/schema/dist/schema/preset.js").Tags2;
83
83
  fieldRefs: {
84
84
  docId: string;
85
85
  versionId: string;
@@ -114,8 +114,8 @@ export declare function documentsQueryOptions<D extends DocumentType>({ projectA
114
114
  };
115
115
  metadata?: {
116
116
  manualLocation?: boolean;
117
- position?: import("@comapeo/schema/dist/schema/observation").Position;
118
- lastSavedPosition?: import("@comapeo/schema/dist/schema/observation").Position;
117
+ position?: import("@comapeo/schema/dist/schema/observation.js").Position;
118
+ lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
119
119
  positionProvider?: {
120
120
  gpsAvailable?: boolean;
121
121
  passiveAvailable?: boolean;
@@ -161,7 +161,7 @@ export declare function documentsQueryOptions<D extends DocumentType>({ projectA
161
161
  forks: string[];
162
162
  })[], Error, ({
163
163
  schemaName: "track";
164
- locations: import("@comapeo/schema/dist/schema/track").Position[];
164
+ locations: import("@comapeo/schema/dist/schema/track.js").Position[];
165
165
  observationRefs: {
166
166
  docId: string;
167
167
  versionId: string;
@@ -186,7 +186,7 @@ export declare function documentsQueryOptions<D extends DocumentType>({ projectA
186
186
  metadata: {
187
187
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
188
188
  };
189
- geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert").Geometry;
189
+ geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
190
190
  docId: string;
191
191
  versionId: string;
192
192
  originalVersionId: string;
@@ -200,9 +200,9 @@ export declare function documentsQueryOptions<D extends DocumentType>({ projectA
200
200
  schemaName: "preset";
201
201
  name: string;
202
202
  geometry: ("point" | "vertex" | "line" | "area" | "relation")[];
203
- tags: import("@comapeo/schema/dist/schema/preset").Tags;
204
- addTags: import("@comapeo/schema/dist/schema/preset").Tags1;
205
- removeTags: import("@comapeo/schema/dist/schema/preset").Tags2;
203
+ tags: import("@comapeo/schema/dist/schema/preset.js").Tags;
204
+ addTags: import("@comapeo/schema/dist/schema/preset.js").Tags1;
205
+ removeTags: import("@comapeo/schema/dist/schema/preset.js").Tags2;
206
206
  fieldRefs: {
207
207
  docId: string;
208
208
  versionId: string;
@@ -237,8 +237,8 @@ export declare function documentsQueryOptions<D extends DocumentType>({ projectA
237
237
  };
238
238
  metadata?: {
239
239
  manualLocation?: boolean;
240
- position?: import("@comapeo/schema/dist/schema/observation").Position;
241
- lastSavedPosition?: import("@comapeo/schema/dist/schema/observation").Position;
240
+ position?: import("@comapeo/schema/dist/schema/observation.js").Position;
241
+ lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
242
242
  positionProvider?: {
243
243
  gpsAvailable?: boolean;
244
244
  passiveAvailable?: boolean;
@@ -282,10 +282,10 @@ export declare function documentsQueryOptions<D extends DocumentType>({ projectA
282
282
  deleted: boolean;
283
283
  } & {
284
284
  forks: string[];
285
- })[], import("@tanstack/query-core").QueryKey>, "queryFn"> & {
286
- queryFn?: import("@tanstack/query-core").QueryFunction<({
285
+ })[], import("@tanstack/react-query").QueryKey>, "queryFn"> & {
286
+ queryFn?: import("@tanstack/react-query").QueryFunction<({
287
287
  schemaName: "track";
288
- locations: import("@comapeo/schema/dist/schema/track").Position[];
288
+ locations: import("@comapeo/schema/dist/schema/track.js").Position[];
289
289
  observationRefs: {
290
290
  docId: string;
291
291
  versionId: string;
@@ -310,7 +310,7 @@ export declare function documentsQueryOptions<D extends DocumentType>({ projectA
310
310
  metadata: {
311
311
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
312
312
  };
313
- geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert").Geometry;
313
+ geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
314
314
  docId: string;
315
315
  versionId: string;
316
316
  originalVersionId: string;
@@ -324,9 +324,9 @@ export declare function documentsQueryOptions<D extends DocumentType>({ projectA
324
324
  schemaName: "preset";
325
325
  name: string;
326
326
  geometry: ("point" | "vertex" | "line" | "area" | "relation")[];
327
- tags: import("@comapeo/schema/dist/schema/preset").Tags;
328
- addTags: import("@comapeo/schema/dist/schema/preset").Tags1;
329
- removeTags: import("@comapeo/schema/dist/schema/preset").Tags2;
327
+ tags: import("@comapeo/schema/dist/schema/preset.js").Tags;
328
+ addTags: import("@comapeo/schema/dist/schema/preset.js").Tags1;
329
+ removeTags: import("@comapeo/schema/dist/schema/preset.js").Tags2;
330
330
  fieldRefs: {
331
331
  docId: string;
332
332
  versionId: string;
@@ -361,8 +361,8 @@ export declare function documentsQueryOptions<D extends DocumentType>({ projectA
361
361
  };
362
362
  metadata?: {
363
363
  manualLocation?: boolean;
364
- position?: import("@comapeo/schema/dist/schema/observation").Position;
365
- lastSavedPosition?: import("@comapeo/schema/dist/schema/observation").Position;
364
+ position?: import("@comapeo/schema/dist/schema/observation.js").Position;
365
+ lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
366
366
  positionProvider?: {
367
367
  gpsAvailable?: boolean;
368
368
  passiveAvailable?: boolean;
@@ -406,11 +406,11 @@ export declare function documentsQueryOptions<D extends DocumentType>({ projectA
406
406
  deleted: boolean;
407
407
  } & {
408
408
  forks: string[];
409
- })[], import("@tanstack/query-core").QueryKey, never> | undefined;
409
+ })[], import("@tanstack/react-query").QueryKey, never> | undefined;
410
410
  } & {
411
- queryKey: import("@tanstack/query-core").DataTag<import("@tanstack/query-core").QueryKey, ({
411
+ queryKey: import("@tanstack/react-query").DataTag<import("@tanstack/react-query").QueryKey, ({
412
412
  schemaName: "track";
413
- locations: import("@comapeo/schema/dist/schema/track").Position[];
413
+ locations: import("@comapeo/schema/dist/schema/track.js").Position[];
414
414
  observationRefs: {
415
415
  docId: string;
416
416
  versionId: string;
@@ -435,7 +435,7 @@ export declare function documentsQueryOptions<D extends DocumentType>({ projectA
435
435
  metadata: {
436
436
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
437
437
  };
438
- geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert").Geometry;
438
+ geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
439
439
  docId: string;
440
440
  versionId: string;
441
441
  originalVersionId: string;
@@ -449,9 +449,9 @@ export declare function documentsQueryOptions<D extends DocumentType>({ projectA
449
449
  schemaName: "preset";
450
450
  name: string;
451
451
  geometry: ("point" | "vertex" | "line" | "area" | "relation")[];
452
- tags: import("@comapeo/schema/dist/schema/preset").Tags;
453
- addTags: import("@comapeo/schema/dist/schema/preset").Tags1;
454
- removeTags: import("@comapeo/schema/dist/schema/preset").Tags2;
452
+ tags: import("@comapeo/schema/dist/schema/preset.js").Tags;
453
+ addTags: import("@comapeo/schema/dist/schema/preset.js").Tags1;
454
+ removeTags: import("@comapeo/schema/dist/schema/preset.js").Tags2;
455
455
  fieldRefs: {
456
456
  docId: string;
457
457
  versionId: string;
@@ -486,8 +486,8 @@ export declare function documentsQueryOptions<D extends DocumentType>({ projectA
486
486
  };
487
487
  metadata?: {
488
488
  manualLocation?: boolean;
489
- position?: import("@comapeo/schema/dist/schema/observation").Position;
490
- lastSavedPosition?: import("@comapeo/schema/dist/schema/observation").Position;
489
+ position?: import("@comapeo/schema/dist/schema/observation.js").Position;
490
+ lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
491
491
  positionProvider?: {
492
492
  gpsAvailable?: boolean;
493
493
  passiveAvailable?: boolean;
@@ -539,9 +539,9 @@ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>
539
539
  docType: D;
540
540
  docId: string;
541
541
  lang?: string;
542
- }): import("@tanstack/query-core").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<({
542
+ }): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<({
543
543
  schemaName: "track";
544
- locations: import("@comapeo/schema/dist/schema/track").Position[];
544
+ locations: import("@comapeo/schema/dist/schema/track.js").Position[];
545
545
  observationRefs: {
546
546
  docId: string;
547
547
  versionId: string;
@@ -566,7 +566,7 @@ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>
566
566
  metadata: {
567
567
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
568
568
  };
569
- geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert").Geometry;
569
+ geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
570
570
  docId: string;
571
571
  versionId: string;
572
572
  originalVersionId: string;
@@ -580,9 +580,9 @@ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>
580
580
  schemaName: "preset";
581
581
  name: string;
582
582
  geometry: ("point" | "vertex" | "line" | "area" | "relation")[];
583
- tags: import("@comapeo/schema/dist/schema/preset").Tags;
584
- addTags: import("@comapeo/schema/dist/schema/preset").Tags1;
585
- removeTags: import("@comapeo/schema/dist/schema/preset").Tags2;
583
+ tags: import("@comapeo/schema/dist/schema/preset.js").Tags;
584
+ addTags: import("@comapeo/schema/dist/schema/preset.js").Tags1;
585
+ removeTags: import("@comapeo/schema/dist/schema/preset.js").Tags2;
586
586
  fieldRefs: {
587
587
  docId: string;
588
588
  versionId: string;
@@ -617,8 +617,8 @@ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>
617
617
  };
618
618
  metadata?: {
619
619
  manualLocation?: boolean;
620
- position?: import("@comapeo/schema/dist/schema/observation").Position;
621
- lastSavedPosition?: import("@comapeo/schema/dist/schema/observation").Position;
620
+ position?: import("@comapeo/schema/dist/schema/observation.js").Position;
621
+ lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
622
622
  positionProvider?: {
623
623
  gpsAvailable?: boolean;
624
624
  passiveAvailable?: boolean;
@@ -664,7 +664,7 @@ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>
664
664
  forks: string[];
665
665
  }), Error, ({
666
666
  schemaName: "track";
667
- locations: import("@comapeo/schema/dist/schema/track").Position[];
667
+ locations: import("@comapeo/schema/dist/schema/track.js").Position[];
668
668
  observationRefs: {
669
669
  docId: string;
670
670
  versionId: string;
@@ -689,7 +689,7 @@ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>
689
689
  metadata: {
690
690
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
691
691
  };
692
- geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert").Geometry;
692
+ geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
693
693
  docId: string;
694
694
  versionId: string;
695
695
  originalVersionId: string;
@@ -703,9 +703,9 @@ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>
703
703
  schemaName: "preset";
704
704
  name: string;
705
705
  geometry: ("point" | "vertex" | "line" | "area" | "relation")[];
706
- tags: import("@comapeo/schema/dist/schema/preset").Tags;
707
- addTags: import("@comapeo/schema/dist/schema/preset").Tags1;
708
- removeTags: import("@comapeo/schema/dist/schema/preset").Tags2;
706
+ tags: import("@comapeo/schema/dist/schema/preset.js").Tags;
707
+ addTags: import("@comapeo/schema/dist/schema/preset.js").Tags1;
708
+ removeTags: import("@comapeo/schema/dist/schema/preset.js").Tags2;
709
709
  fieldRefs: {
710
710
  docId: string;
711
711
  versionId: string;
@@ -740,8 +740,8 @@ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>
740
740
  };
741
741
  metadata?: {
742
742
  manualLocation?: boolean;
743
- position?: import("@comapeo/schema/dist/schema/observation").Position;
744
- lastSavedPosition?: import("@comapeo/schema/dist/schema/observation").Position;
743
+ position?: import("@comapeo/schema/dist/schema/observation.js").Position;
744
+ lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
745
745
  positionProvider?: {
746
746
  gpsAvailable?: boolean;
747
747
  passiveAvailable?: boolean;
@@ -785,10 +785,10 @@ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>
785
785
  deleted: boolean;
786
786
  } & {
787
787
  forks: string[];
788
- }), import("@tanstack/query-core").QueryKey>, "queryFn"> & {
789
- queryFn?: import("@tanstack/query-core").QueryFunction<({
788
+ }), import("@tanstack/react-query").QueryKey>, "queryFn"> & {
789
+ queryFn?: import("@tanstack/react-query").QueryFunction<({
790
790
  schemaName: "track";
791
- locations: import("@comapeo/schema/dist/schema/track").Position[];
791
+ locations: import("@comapeo/schema/dist/schema/track.js").Position[];
792
792
  observationRefs: {
793
793
  docId: string;
794
794
  versionId: string;
@@ -813,7 +813,7 @@ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>
813
813
  metadata: {
814
814
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
815
815
  };
816
- geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert").Geometry;
816
+ geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
817
817
  docId: string;
818
818
  versionId: string;
819
819
  originalVersionId: string;
@@ -827,9 +827,9 @@ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>
827
827
  schemaName: "preset";
828
828
  name: string;
829
829
  geometry: ("point" | "vertex" | "line" | "area" | "relation")[];
830
- tags: import("@comapeo/schema/dist/schema/preset").Tags;
831
- addTags: import("@comapeo/schema/dist/schema/preset").Tags1;
832
- removeTags: import("@comapeo/schema/dist/schema/preset").Tags2;
830
+ tags: import("@comapeo/schema/dist/schema/preset.js").Tags;
831
+ addTags: import("@comapeo/schema/dist/schema/preset.js").Tags1;
832
+ removeTags: import("@comapeo/schema/dist/schema/preset.js").Tags2;
833
833
  fieldRefs: {
834
834
  docId: string;
835
835
  versionId: string;
@@ -864,8 +864,8 @@ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>
864
864
  };
865
865
  metadata?: {
866
866
  manualLocation?: boolean;
867
- position?: import("@comapeo/schema/dist/schema/observation").Position;
868
- lastSavedPosition?: import("@comapeo/schema/dist/schema/observation").Position;
867
+ position?: import("@comapeo/schema/dist/schema/observation.js").Position;
868
+ lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
869
869
  positionProvider?: {
870
870
  gpsAvailable?: boolean;
871
871
  passiveAvailable?: boolean;
@@ -909,11 +909,11 @@ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>
909
909
  deleted: boolean;
910
910
  } & {
911
911
  forks: string[];
912
- }), import("@tanstack/query-core").QueryKey, never> | undefined;
912
+ }), import("@tanstack/react-query").QueryKey, never> | undefined;
913
913
  } & {
914
- queryKey: import("@tanstack/query-core").DataTag<import("@tanstack/query-core").QueryKey, ({
914
+ queryKey: import("@tanstack/react-query").DataTag<import("@tanstack/react-query").QueryKey, ({
915
915
  schemaName: "track";
916
- locations: import("@comapeo/schema/dist/schema/track").Position[];
916
+ locations: import("@comapeo/schema/dist/schema/track.js").Position[];
917
917
  observationRefs: {
918
918
  docId: string;
919
919
  versionId: string;
@@ -938,7 +938,7 @@ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>
938
938
  metadata: {
939
939
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
940
940
  };
941
- geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert").Geometry;
941
+ geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
942
942
  docId: string;
943
943
  versionId: string;
944
944
  originalVersionId: string;
@@ -952,9 +952,9 @@ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>
952
952
  schemaName: "preset";
953
953
  name: string;
954
954
  geometry: ("point" | "vertex" | "line" | "area" | "relation")[];
955
- tags: import("@comapeo/schema/dist/schema/preset").Tags;
956
- addTags: import("@comapeo/schema/dist/schema/preset").Tags1;
957
- removeTags: import("@comapeo/schema/dist/schema/preset").Tags2;
955
+ tags: import("@comapeo/schema/dist/schema/preset.js").Tags;
956
+ addTags: import("@comapeo/schema/dist/schema/preset.js").Tags1;
957
+ removeTags: import("@comapeo/schema/dist/schema/preset.js").Tags2;
958
958
  fieldRefs: {
959
959
  docId: string;
960
960
  versionId: string;
@@ -989,8 +989,8 @@ export declare function documentByDocumentIdQueryOptions<D extends DocumentType>
989
989
  };
990
990
  metadata?: {
991
991
  manualLocation?: boolean;
992
- position?: import("@comapeo/schema/dist/schema/observation").Position;
993
- lastSavedPosition?: import("@comapeo/schema/dist/schema/observation").Position;
992
+ position?: import("@comapeo/schema/dist/schema/observation.js").Position;
993
+ lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
994
994
  positionProvider?: {
995
995
  gpsAvailable?: boolean;
996
996
  passiveAvailable?: boolean;
@@ -1042,9 +1042,9 @@ export declare function documentByVersionIdQueryOptions<D extends DocumentType>(
1042
1042
  docType: D;
1043
1043
  versionId: string;
1044
1044
  lang?: string;
1045
- }): import("@tanstack/query-core").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
1045
+ }): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
1046
1046
  schemaName: "track";
1047
- locations: import("@comapeo/schema/dist/schema/track").Position[];
1047
+ locations: import("@comapeo/schema/dist/schema/track.js").Position[];
1048
1048
  observationRefs: {
1049
1049
  docId: string;
1050
1050
  versionId: string;
@@ -1067,7 +1067,7 @@ export declare function documentByVersionIdQueryOptions<D extends DocumentType>(
1067
1067
  metadata: {
1068
1068
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
1069
1069
  };
1070
- geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert").Geometry;
1070
+ geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
1071
1071
  docId: string;
1072
1072
  versionId: string;
1073
1073
  originalVersionId: string;
@@ -1079,9 +1079,9 @@ export declare function documentByVersionIdQueryOptions<D extends DocumentType>(
1079
1079
  schemaName: "preset";
1080
1080
  name: string;
1081
1081
  geometry: ("point" | "vertex" | "line" | "area" | "relation")[];
1082
- tags: import("@comapeo/schema/dist/schema/preset").Tags;
1083
- addTags: import("@comapeo/schema/dist/schema/preset").Tags1;
1084
- removeTags: import("@comapeo/schema/dist/schema/preset").Tags2;
1082
+ tags: import("@comapeo/schema/dist/schema/preset.js").Tags;
1083
+ addTags: import("@comapeo/schema/dist/schema/preset.js").Tags1;
1084
+ removeTags: import("@comapeo/schema/dist/schema/preset.js").Tags2;
1085
1085
  fieldRefs: {
1086
1086
  docId: string;
1087
1087
  versionId: string;
@@ -1114,8 +1114,8 @@ export declare function documentByVersionIdQueryOptions<D extends DocumentType>(
1114
1114
  };
1115
1115
  metadata?: {
1116
1116
  manualLocation?: boolean;
1117
- position?: import("@comapeo/schema/dist/schema/observation").Position;
1118
- lastSavedPosition?: import("@comapeo/schema/dist/schema/observation").Position;
1117
+ position?: import("@comapeo/schema/dist/schema/observation.js").Position;
1118
+ lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
1119
1119
  positionProvider?: {
1120
1120
  gpsAvailable?: boolean;
1121
1121
  passiveAvailable?: boolean;
@@ -1157,7 +1157,7 @@ export declare function documentByVersionIdQueryOptions<D extends DocumentType>(
1157
1157
  deleted: boolean;
1158
1158
  }, Error, {
1159
1159
  schemaName: "track";
1160
- locations: import("@comapeo/schema/dist/schema/track").Position[];
1160
+ locations: import("@comapeo/schema/dist/schema/track.js").Position[];
1161
1161
  observationRefs: {
1162
1162
  docId: string;
1163
1163
  versionId: string;
@@ -1180,7 +1180,7 @@ export declare function documentByVersionIdQueryOptions<D extends DocumentType>(
1180
1180
  metadata: {
1181
1181
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
1182
1182
  };
1183
- geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert").Geometry;
1183
+ geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
1184
1184
  docId: string;
1185
1185
  versionId: string;
1186
1186
  originalVersionId: string;
@@ -1192,9 +1192,9 @@ export declare function documentByVersionIdQueryOptions<D extends DocumentType>(
1192
1192
  schemaName: "preset";
1193
1193
  name: string;
1194
1194
  geometry: ("point" | "vertex" | "line" | "area" | "relation")[];
1195
- tags: import("@comapeo/schema/dist/schema/preset").Tags;
1196
- addTags: import("@comapeo/schema/dist/schema/preset").Tags1;
1197
- removeTags: import("@comapeo/schema/dist/schema/preset").Tags2;
1195
+ tags: import("@comapeo/schema/dist/schema/preset.js").Tags;
1196
+ addTags: import("@comapeo/schema/dist/schema/preset.js").Tags1;
1197
+ removeTags: import("@comapeo/schema/dist/schema/preset.js").Tags2;
1198
1198
  fieldRefs: {
1199
1199
  docId: string;
1200
1200
  versionId: string;
@@ -1227,8 +1227,8 @@ export declare function documentByVersionIdQueryOptions<D extends DocumentType>(
1227
1227
  };
1228
1228
  metadata?: {
1229
1229
  manualLocation?: boolean;
1230
- position?: import("@comapeo/schema/dist/schema/observation").Position;
1231
- lastSavedPosition?: import("@comapeo/schema/dist/schema/observation").Position;
1230
+ position?: import("@comapeo/schema/dist/schema/observation.js").Position;
1231
+ lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
1232
1232
  positionProvider?: {
1233
1233
  gpsAvailable?: boolean;
1234
1234
  passiveAvailable?: boolean;
@@ -1268,10 +1268,10 @@ export declare function documentByVersionIdQueryOptions<D extends DocumentType>(
1268
1268
  updatedAt: string;
1269
1269
  links: string[];
1270
1270
  deleted: boolean;
1271
- }, import("@tanstack/query-core").QueryKey>, "queryFn"> & {
1272
- queryFn?: import("@tanstack/query-core").QueryFunction<{
1271
+ }, import("@tanstack/react-query").QueryKey>, "queryFn"> & {
1272
+ queryFn?: import("@tanstack/react-query").QueryFunction<{
1273
1273
  schemaName: "track";
1274
- locations: import("@comapeo/schema/dist/schema/track").Position[];
1274
+ locations: import("@comapeo/schema/dist/schema/track.js").Position[];
1275
1275
  observationRefs: {
1276
1276
  docId: string;
1277
1277
  versionId: string;
@@ -1294,7 +1294,7 @@ export declare function documentByVersionIdQueryOptions<D extends DocumentType>(
1294
1294
  metadata: {
1295
1295
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
1296
1296
  };
1297
- geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert").Geometry;
1297
+ geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
1298
1298
  docId: string;
1299
1299
  versionId: string;
1300
1300
  originalVersionId: string;
@@ -1306,9 +1306,9 @@ export declare function documentByVersionIdQueryOptions<D extends DocumentType>(
1306
1306
  schemaName: "preset";
1307
1307
  name: string;
1308
1308
  geometry: ("point" | "vertex" | "line" | "area" | "relation")[];
1309
- tags: import("@comapeo/schema/dist/schema/preset").Tags;
1310
- addTags: import("@comapeo/schema/dist/schema/preset").Tags1;
1311
- removeTags: import("@comapeo/schema/dist/schema/preset").Tags2;
1309
+ tags: import("@comapeo/schema/dist/schema/preset.js").Tags;
1310
+ addTags: import("@comapeo/schema/dist/schema/preset.js").Tags1;
1311
+ removeTags: import("@comapeo/schema/dist/schema/preset.js").Tags2;
1312
1312
  fieldRefs: {
1313
1313
  docId: string;
1314
1314
  versionId: string;
@@ -1341,8 +1341,8 @@ export declare function documentByVersionIdQueryOptions<D extends DocumentType>(
1341
1341
  };
1342
1342
  metadata?: {
1343
1343
  manualLocation?: boolean;
1344
- position?: import("@comapeo/schema/dist/schema/observation").Position;
1345
- lastSavedPosition?: import("@comapeo/schema/dist/schema/observation").Position;
1344
+ position?: import("@comapeo/schema/dist/schema/observation.js").Position;
1345
+ lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
1346
1346
  positionProvider?: {
1347
1347
  gpsAvailable?: boolean;
1348
1348
  passiveAvailable?: boolean;
@@ -1382,11 +1382,11 @@ export declare function documentByVersionIdQueryOptions<D extends DocumentType>(
1382
1382
  updatedAt: string;
1383
1383
  links: string[];
1384
1384
  deleted: boolean;
1385
- }, import("@tanstack/query-core").QueryKey, never> | undefined;
1385
+ }, import("@tanstack/react-query").QueryKey, never> | undefined;
1386
1386
  } & {
1387
- queryKey: import("@tanstack/query-core").DataTag<import("@tanstack/query-core").QueryKey, {
1387
+ queryKey: import("@tanstack/react-query").DataTag<import("@tanstack/react-query").QueryKey, {
1388
1388
  schemaName: "track";
1389
- locations: import("@comapeo/schema/dist/schema/track").Position[];
1389
+ locations: import("@comapeo/schema/dist/schema/track.js").Position[];
1390
1390
  observationRefs: {
1391
1391
  docId: string;
1392
1392
  versionId: string;
@@ -1409,7 +1409,7 @@ export declare function documentByVersionIdQueryOptions<D extends DocumentType>(
1409
1409
  metadata: {
1410
1410
  [k: string]: boolean | number | string | null | (boolean | number | string | null)[];
1411
1411
  };
1412
- geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert").Geometry;
1412
+ geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
1413
1413
  docId: string;
1414
1414
  versionId: string;
1415
1415
  originalVersionId: string;
@@ -1421,9 +1421,9 @@ export declare function documentByVersionIdQueryOptions<D extends DocumentType>(
1421
1421
  schemaName: "preset";
1422
1422
  name: string;
1423
1423
  geometry: ("point" | "vertex" | "line" | "area" | "relation")[];
1424
- tags: import("@comapeo/schema/dist/schema/preset").Tags;
1425
- addTags: import("@comapeo/schema/dist/schema/preset").Tags1;
1426
- removeTags: import("@comapeo/schema/dist/schema/preset").Tags2;
1424
+ tags: import("@comapeo/schema/dist/schema/preset.js").Tags;
1425
+ addTags: import("@comapeo/schema/dist/schema/preset.js").Tags1;
1426
+ removeTags: import("@comapeo/schema/dist/schema/preset.js").Tags2;
1427
1427
  fieldRefs: {
1428
1428
  docId: string;
1429
1429
  versionId: string;
@@ -1456,8 +1456,8 @@ export declare function documentByVersionIdQueryOptions<D extends DocumentType>(
1456
1456
  };
1457
1457
  metadata?: {
1458
1458
  manualLocation?: boolean;
1459
- position?: import("@comapeo/schema/dist/schema/observation").Position;
1460
- lastSavedPosition?: import("@comapeo/schema/dist/schema/observation").Position;
1459
+ position?: import("@comapeo/schema/dist/schema/observation.js").Position;
1460
+ lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
1461
1461
  positionProvider?: {
1462
1462
  gpsAvailable?: boolean;
1463
1463
  passiveAvailable?: boolean;
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDocumentsQueryKey = getDocumentsQueryKey;
4
+ exports.getManyDocumentsQueryKey = getManyDocumentsQueryKey;
5
+ exports.getDocumentByDocIdQueryKey = getDocumentByDocIdQueryKey;
6
+ exports.getDocumentByVersionIdQueryKey = getDocumentByVersionIdQueryKey;
7
+ exports.documentsQueryOptions = documentsQueryOptions;
8
+ exports.documentByDocumentIdQueryOptions = documentByDocumentIdQueryOptions;
9
+ exports.documentByVersionIdQueryOptions = documentByVersionIdQueryOptions;
10
+ const react_query_1 = require("@tanstack/react-query");
11
+ const shared_js_1 = require("./shared.js");
12
+ function getDocumentsQueryKey({ projectId, docType, }) {
13
+ return [shared_js_1.ROOT_QUERY_KEY, 'projects', projectId, docType];
14
+ }
15
+ function getManyDocumentsQueryKey({ projectId, docType, includeDeleted, lang, }) {
16
+ return [
17
+ shared_js_1.ROOT_QUERY_KEY,
18
+ 'projects',
19
+ projectId,
20
+ docType,
21
+ { includeDeleted, lang },
22
+ ];
23
+ }
24
+ function getDocumentByDocIdQueryKey({ projectId, docType, docId, lang, }) {
25
+ return [
26
+ shared_js_1.ROOT_QUERY_KEY,
27
+ 'projects',
28
+ projectId,
29
+ docType,
30
+ docId,
31
+ { lang },
32
+ ];
33
+ }
34
+ function getDocumentByVersionIdQueryKey({ projectId, docType, versionId, lang, }) {
35
+ return [
36
+ shared_js_1.ROOT_QUERY_KEY,
37
+ 'projects',
38
+ projectId,
39
+ docType,
40
+ versionId,
41
+ { lang },
42
+ ];
43
+ }
44
+ function documentsQueryOptions({ projectApi, projectId, docType, includeDeleted, lang, }) {
45
+ return (0, react_query_1.queryOptions)({
46
+ ...(0, shared_js_1.baseQueryOptions)(),
47
+ queryKey: getManyDocumentsQueryKey({
48
+ projectId,
49
+ docType,
50
+ includeDeleted,
51
+ lang,
52
+ }),
53
+ queryFn: async () => {
54
+ return projectApi[docType].getMany({
55
+ includeDeleted,
56
+ lang,
57
+ });
58
+ },
59
+ });
60
+ }
61
+ function documentByDocumentIdQueryOptions({ projectApi, projectId, docType, docId, lang, }) {
62
+ return (0, react_query_1.queryOptions)({
63
+ ...(0, shared_js_1.baseQueryOptions)(),
64
+ queryKey: getDocumentByDocIdQueryKey({
65
+ projectId,
66
+ docType,
67
+ docId,
68
+ lang,
69
+ }),
70
+ queryFn: async () => {
71
+ return projectApi[docType].getByDocId(docId, {
72
+ lang,
73
+ // We want to make sure that this throws in the case that no match is found
74
+ mustBeFound: true,
75
+ });
76
+ },
77
+ });
78
+ }
79
+ function documentByVersionIdQueryOptions({ projectApi, projectId, docType, versionId, lang, }) {
80
+ return (0, react_query_1.queryOptions)({
81
+ ...(0, shared_js_1.baseQueryOptions)(),
82
+ queryKey: getDocumentByVersionIdQueryKey({
83
+ projectId,
84
+ docType,
85
+ versionId,
86
+ lang,
87
+ }),
88
+ queryFn: async () => {
89
+ return projectApi[docType].getByVersionId(versionId, { lang });
90
+ },
91
+ });
92
+ }
@@ -0,0 +1,12 @@
1
+ import type { MapeoClientApi } from '@comapeo/ipc' with { 'resolution-mode': 'import' };
2
+ export declare function getInvitesQueryKey(): readonly ["@comapeo/core-react", "invites"];
3
+ export declare function getPendingInvitesQueryKey(): readonly ["@comapeo/core-react", "invites", {
4
+ readonly status: "pending";
5
+ }];
6
+ export declare function pendingInvitesQueryOptions({ clientApi, }: {
7
+ clientApi: MapeoClientApi;
8
+ }): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("@comapeo/core/dist/types.js", { with: { "resolution-mode": "import" } }).MapBuffers<import("@comapeo/core/dist/invite-api.js", { with: { "resolution-mode": "import" } }).InviteInternal>[], Error, import("@comapeo/core/dist/types.js", { with: { "resolution-mode": "import" } }).MapBuffers<import("@comapeo/core/dist/invite-api.js", { with: { "resolution-mode": "import" } }).InviteInternal>[], import("@tanstack/react-query").QueryKey>, "queryFn"> & {
9
+ queryFn?: import("@tanstack/react-query").QueryFunction<import("@comapeo/core/dist/types.js", { with: { "resolution-mode": "import" } }).MapBuffers<import("@comapeo/core/dist/invite-api.js", { with: { "resolution-mode": "import" } }).InviteInternal>[], import("@tanstack/react-query").QueryKey, never> | undefined;
10
+ } & {
11
+ queryKey: import("@tanstack/react-query").DataTag<import("@tanstack/react-query").QueryKey, import("@comapeo/core/dist/types.js", { with: { "resolution-mode": "import" } }).MapBuffers<import("@comapeo/core/dist/invite-api.js", { with: { "resolution-mode": "import" } }).InviteInternal>[]>;
12
+ };