@comapeo/core-react 4.2.1 → 5.0.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.
- package/dist/commonjs/contexts/ClientApi.d.ts +3 -1
- package/dist/commonjs/hooks/client.d.ts +4 -2
- package/dist/commonjs/hooks/projects.d.ts +101 -21
- package/dist/commonjs/hooks/projects.js +26 -0
- package/dist/commonjs/index.d.ts +1 -1
- package/dist/commonjs/index.js +3 -1
- package/dist/commonjs/lib/react-query/client.d.ts +4 -4
- package/dist/commonjs/lib/react-query/documents.d.ts +60 -72
- package/dist/commonjs/lib/react-query/projects.d.ts +32 -83
- package/dist/commonjs/lib/react-query/projects.js +18 -0
- package/dist/esm/contexts/ClientApi.d.ts +3 -1
- package/dist/esm/hooks/client.d.ts +4 -2
- package/dist/esm/hooks/projects.d.ts +101 -21
- package/dist/esm/hooks/projects.js +25 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/lib/react-query/client.d.ts +4 -4
- package/dist/esm/lib/react-query/documents.d.ts +60 -72
- package/dist/esm/lib/react-query/projects.d.ts +32 -83
- package/dist/esm/lib/react-query/projects.js +16 -0
- package/docs/API.md +28 -0
- package/package.json +23 -23
|
@@ -46,6 +46,10 @@ export declare function documentsQueryOptions<D extends WriteableDocumentType>({
|
|
|
46
46
|
tags: {
|
|
47
47
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
48
48
|
};
|
|
49
|
+
presetRef?: {
|
|
50
|
+
docId: string;
|
|
51
|
+
versionId: string;
|
|
52
|
+
} | undefined;
|
|
49
53
|
docId: string;
|
|
50
54
|
versionId: string;
|
|
51
55
|
originalVersionId: string;
|
|
@@ -59,12 +63,7 @@ export declare function documentsQueryOptions<D extends WriteableDocumentType>({
|
|
|
59
63
|
schemaName: "observation";
|
|
60
64
|
lat?: number | undefined;
|
|
61
65
|
lon?: number | undefined;
|
|
62
|
-
attachments:
|
|
63
|
-
driveDiscoveryId: string;
|
|
64
|
-
name: string;
|
|
65
|
-
type: "attachment_type_unspecified" | "photo" | "video" | "audio" | "UNRECOGNIZED";
|
|
66
|
-
hash: string;
|
|
67
|
-
}[];
|
|
66
|
+
attachments: import("@comapeo/schema/dist/schema/observation.js").Attachment[];
|
|
68
67
|
tags: {
|
|
69
68
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
70
69
|
};
|
|
@@ -169,6 +168,10 @@ export declare function documentsQueryOptions<D extends WriteableDocumentType>({
|
|
|
169
168
|
tags: {
|
|
170
169
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
171
170
|
};
|
|
171
|
+
presetRef?: {
|
|
172
|
+
docId: string;
|
|
173
|
+
versionId: string;
|
|
174
|
+
} | undefined;
|
|
172
175
|
docId: string;
|
|
173
176
|
versionId: string;
|
|
174
177
|
originalVersionId: string;
|
|
@@ -182,12 +185,7 @@ export declare function documentsQueryOptions<D extends WriteableDocumentType>({
|
|
|
182
185
|
schemaName: "observation";
|
|
183
186
|
lat?: number | undefined;
|
|
184
187
|
lon?: number | undefined;
|
|
185
|
-
attachments:
|
|
186
|
-
driveDiscoveryId: string;
|
|
187
|
-
name: string;
|
|
188
|
-
type: "attachment_type_unspecified" | "photo" | "video" | "audio" | "UNRECOGNIZED";
|
|
189
|
-
hash: string;
|
|
190
|
-
}[];
|
|
188
|
+
attachments: import("@comapeo/schema/dist/schema/observation.js").Attachment[];
|
|
191
189
|
tags: {
|
|
192
190
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
193
191
|
};
|
|
@@ -296,6 +294,10 @@ export declare function documentsQueryOptions<D extends WriteableDocumentType>({
|
|
|
296
294
|
tags: {
|
|
297
295
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
298
296
|
};
|
|
297
|
+
presetRef?: {
|
|
298
|
+
docId: string;
|
|
299
|
+
versionId: string;
|
|
300
|
+
} | undefined;
|
|
299
301
|
docId: string;
|
|
300
302
|
versionId: string;
|
|
301
303
|
originalVersionId: string;
|
|
@@ -309,12 +311,7 @@ export declare function documentsQueryOptions<D extends WriteableDocumentType>({
|
|
|
309
311
|
schemaName: "observation";
|
|
310
312
|
lat?: number | undefined;
|
|
311
313
|
lon?: number | undefined;
|
|
312
|
-
attachments:
|
|
313
|
-
driveDiscoveryId: string;
|
|
314
|
-
name: string;
|
|
315
|
-
type: "attachment_type_unspecified" | "photo" | "video" | "audio" | "UNRECOGNIZED";
|
|
316
|
-
hash: string;
|
|
317
|
-
}[];
|
|
314
|
+
attachments: import("@comapeo/schema/dist/schema/observation.js").Attachment[];
|
|
318
315
|
tags: {
|
|
319
316
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
320
317
|
};
|
|
@@ -428,6 +425,10 @@ export declare function documentsQueryOptions<D extends WriteableDocumentType>({
|
|
|
428
425
|
tags: {
|
|
429
426
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
430
427
|
};
|
|
428
|
+
presetRef?: {
|
|
429
|
+
docId: string;
|
|
430
|
+
versionId: string;
|
|
431
|
+
} | undefined;
|
|
431
432
|
docId: string;
|
|
432
433
|
versionId: string;
|
|
433
434
|
originalVersionId: string;
|
|
@@ -441,12 +442,7 @@ export declare function documentsQueryOptions<D extends WriteableDocumentType>({
|
|
|
441
442
|
schemaName: "observation";
|
|
442
443
|
lat?: number | undefined;
|
|
443
444
|
lon?: number | undefined;
|
|
444
|
-
attachments:
|
|
445
|
-
driveDiscoveryId: string;
|
|
446
|
-
name: string;
|
|
447
|
-
type: "attachment_type_unspecified" | "photo" | "video" | "audio" | "UNRECOGNIZED";
|
|
448
|
-
hash: string;
|
|
449
|
-
}[];
|
|
445
|
+
attachments: import("@comapeo/schema/dist/schema/observation.js").Attachment[];
|
|
450
446
|
tags: {
|
|
451
447
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
452
448
|
};
|
|
@@ -561,6 +557,10 @@ export declare function documentByDocumentIdQueryOptions<D extends WriteableDocu
|
|
|
561
557
|
tags: {
|
|
562
558
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
563
559
|
};
|
|
560
|
+
presetRef?: {
|
|
561
|
+
docId: string;
|
|
562
|
+
versionId: string;
|
|
563
|
+
} | undefined;
|
|
564
564
|
docId: string;
|
|
565
565
|
versionId: string;
|
|
566
566
|
originalVersionId: string;
|
|
@@ -574,12 +574,7 @@ export declare function documentByDocumentIdQueryOptions<D extends WriteableDocu
|
|
|
574
574
|
schemaName: "observation";
|
|
575
575
|
lat?: number | undefined;
|
|
576
576
|
lon?: number | undefined;
|
|
577
|
-
attachments:
|
|
578
|
-
driveDiscoveryId: string;
|
|
579
|
-
name: string;
|
|
580
|
-
type: "attachment_type_unspecified" | "photo" | "video" | "audio" | "UNRECOGNIZED";
|
|
581
|
-
hash: string;
|
|
582
|
-
}[];
|
|
577
|
+
attachments: import("@comapeo/schema/dist/schema/observation.js").Attachment[];
|
|
583
578
|
tags: {
|
|
584
579
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
585
580
|
};
|
|
@@ -684,6 +679,10 @@ export declare function documentByDocumentIdQueryOptions<D extends WriteableDocu
|
|
|
684
679
|
tags: {
|
|
685
680
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
686
681
|
};
|
|
682
|
+
presetRef?: {
|
|
683
|
+
docId: string;
|
|
684
|
+
versionId: string;
|
|
685
|
+
} | undefined;
|
|
687
686
|
docId: string;
|
|
688
687
|
versionId: string;
|
|
689
688
|
originalVersionId: string;
|
|
@@ -697,12 +696,7 @@ export declare function documentByDocumentIdQueryOptions<D extends WriteableDocu
|
|
|
697
696
|
schemaName: "observation";
|
|
698
697
|
lat?: number | undefined;
|
|
699
698
|
lon?: number | undefined;
|
|
700
|
-
attachments:
|
|
701
|
-
driveDiscoveryId: string;
|
|
702
|
-
name: string;
|
|
703
|
-
type: "attachment_type_unspecified" | "photo" | "video" | "audio" | "UNRECOGNIZED";
|
|
704
|
-
hash: string;
|
|
705
|
-
}[];
|
|
699
|
+
attachments: import("@comapeo/schema/dist/schema/observation.js").Attachment[];
|
|
706
700
|
tags: {
|
|
707
701
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
708
702
|
};
|
|
@@ -810,6 +804,10 @@ export declare function documentByDocumentIdQueryOptions<D extends WriteableDocu
|
|
|
810
804
|
tags: {
|
|
811
805
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
812
806
|
};
|
|
807
|
+
presetRef?: {
|
|
808
|
+
docId: string;
|
|
809
|
+
versionId: string;
|
|
810
|
+
} | undefined;
|
|
813
811
|
docId: string;
|
|
814
812
|
versionId: string;
|
|
815
813
|
originalVersionId: string;
|
|
@@ -823,12 +821,7 @@ export declare function documentByDocumentIdQueryOptions<D extends WriteableDocu
|
|
|
823
821
|
schemaName: "observation";
|
|
824
822
|
lat?: number | undefined;
|
|
825
823
|
lon?: number | undefined;
|
|
826
|
-
attachments:
|
|
827
|
-
driveDiscoveryId: string;
|
|
828
|
-
name: string;
|
|
829
|
-
type: "attachment_type_unspecified" | "photo" | "video" | "audio" | "UNRECOGNIZED";
|
|
830
|
-
hash: string;
|
|
831
|
-
}[];
|
|
824
|
+
attachments: import("@comapeo/schema/dist/schema/observation.js").Attachment[];
|
|
832
825
|
tags: {
|
|
833
826
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
834
827
|
};
|
|
@@ -940,6 +933,10 @@ export declare function documentByDocumentIdQueryOptions<D extends WriteableDocu
|
|
|
940
933
|
tags: {
|
|
941
934
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
942
935
|
};
|
|
936
|
+
presetRef?: {
|
|
937
|
+
docId: string;
|
|
938
|
+
versionId: string;
|
|
939
|
+
} | undefined;
|
|
943
940
|
docId: string;
|
|
944
941
|
versionId: string;
|
|
945
942
|
originalVersionId: string;
|
|
@@ -953,12 +950,7 @@ export declare function documentByDocumentIdQueryOptions<D extends WriteableDocu
|
|
|
953
950
|
schemaName: "observation";
|
|
954
951
|
lat?: number | undefined;
|
|
955
952
|
lon?: number | undefined;
|
|
956
|
-
attachments:
|
|
957
|
-
driveDiscoveryId: string;
|
|
958
|
-
name: string;
|
|
959
|
-
type: "attachment_type_unspecified" | "photo" | "video" | "audio" | "UNRECOGNIZED";
|
|
960
|
-
hash: string;
|
|
961
|
-
}[];
|
|
953
|
+
attachments: import("@comapeo/schema/dist/schema/observation.js").Attachment[];
|
|
962
954
|
tags: {
|
|
963
955
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
964
956
|
};
|
|
@@ -1073,6 +1065,10 @@ export declare function documentByVersionIdQueryOptions<D extends WriteableDocum
|
|
|
1073
1065
|
tags: {
|
|
1074
1066
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
1075
1067
|
};
|
|
1068
|
+
presetRef?: {
|
|
1069
|
+
docId: string;
|
|
1070
|
+
versionId: string;
|
|
1071
|
+
} | undefined;
|
|
1076
1072
|
docId: string;
|
|
1077
1073
|
versionId: string;
|
|
1078
1074
|
originalVersionId: string;
|
|
@@ -1084,12 +1080,7 @@ export declare function documentByVersionIdQueryOptions<D extends WriteableDocum
|
|
|
1084
1080
|
schemaName: "observation";
|
|
1085
1081
|
lat?: number | undefined;
|
|
1086
1082
|
lon?: number | undefined;
|
|
1087
|
-
attachments:
|
|
1088
|
-
driveDiscoveryId: string;
|
|
1089
|
-
name: string;
|
|
1090
|
-
type: "attachment_type_unspecified" | "photo" | "video" | "audio" | "UNRECOGNIZED";
|
|
1091
|
-
hash: string;
|
|
1092
|
-
}[];
|
|
1083
|
+
attachments: import("@comapeo/schema/dist/schema/observation.js").Attachment[];
|
|
1093
1084
|
tags: {
|
|
1094
1085
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
1095
1086
|
};
|
|
@@ -1186,6 +1177,10 @@ export declare function documentByVersionIdQueryOptions<D extends WriteableDocum
|
|
|
1186
1177
|
tags: {
|
|
1187
1178
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
1188
1179
|
};
|
|
1180
|
+
presetRef?: {
|
|
1181
|
+
docId: string;
|
|
1182
|
+
versionId: string;
|
|
1183
|
+
} | undefined;
|
|
1189
1184
|
docId: string;
|
|
1190
1185
|
versionId: string;
|
|
1191
1186
|
originalVersionId: string;
|
|
@@ -1197,12 +1192,7 @@ export declare function documentByVersionIdQueryOptions<D extends WriteableDocum
|
|
|
1197
1192
|
schemaName: "observation";
|
|
1198
1193
|
lat?: number | undefined;
|
|
1199
1194
|
lon?: number | undefined;
|
|
1200
|
-
attachments:
|
|
1201
|
-
driveDiscoveryId: string;
|
|
1202
|
-
name: string;
|
|
1203
|
-
type: "attachment_type_unspecified" | "photo" | "video" | "audio" | "UNRECOGNIZED";
|
|
1204
|
-
hash: string;
|
|
1205
|
-
}[];
|
|
1195
|
+
attachments: import("@comapeo/schema/dist/schema/observation.js").Attachment[];
|
|
1206
1196
|
tags: {
|
|
1207
1197
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
1208
1198
|
};
|
|
@@ -1302,6 +1292,10 @@ export declare function documentByVersionIdQueryOptions<D extends WriteableDocum
|
|
|
1302
1292
|
tags: {
|
|
1303
1293
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
1304
1294
|
};
|
|
1295
|
+
presetRef?: {
|
|
1296
|
+
docId: string;
|
|
1297
|
+
versionId: string;
|
|
1298
|
+
} | undefined;
|
|
1305
1299
|
docId: string;
|
|
1306
1300
|
versionId: string;
|
|
1307
1301
|
originalVersionId: string;
|
|
@@ -1313,12 +1307,7 @@ export declare function documentByVersionIdQueryOptions<D extends WriteableDocum
|
|
|
1313
1307
|
schemaName: "observation";
|
|
1314
1308
|
lat?: number | undefined;
|
|
1315
1309
|
lon?: number | undefined;
|
|
1316
|
-
attachments:
|
|
1317
|
-
driveDiscoveryId: string;
|
|
1318
|
-
name: string;
|
|
1319
|
-
type: "attachment_type_unspecified" | "photo" | "video" | "audio" | "UNRECOGNIZED";
|
|
1320
|
-
hash: string;
|
|
1321
|
-
}[];
|
|
1310
|
+
attachments: import("@comapeo/schema/dist/schema/observation.js").Attachment[];
|
|
1322
1311
|
tags: {
|
|
1323
1312
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
1324
1313
|
};
|
|
@@ -1422,6 +1411,10 @@ export declare function documentByVersionIdQueryOptions<D extends WriteableDocum
|
|
|
1422
1411
|
tags: {
|
|
1423
1412
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
1424
1413
|
};
|
|
1414
|
+
presetRef?: {
|
|
1415
|
+
docId: string;
|
|
1416
|
+
versionId: string;
|
|
1417
|
+
} | undefined;
|
|
1425
1418
|
docId: string;
|
|
1426
1419
|
versionId: string;
|
|
1427
1420
|
originalVersionId: string;
|
|
@@ -1433,12 +1426,7 @@ export declare function documentByVersionIdQueryOptions<D extends WriteableDocum
|
|
|
1433
1426
|
schemaName: "observation";
|
|
1434
1427
|
lat?: number | undefined;
|
|
1435
1428
|
lon?: number | undefined;
|
|
1436
|
-
attachments:
|
|
1437
|
-
driveDiscoveryId: string;
|
|
1438
|
-
name: string;
|
|
1439
|
-
type: "attachment_type_unspecified" | "photo" | "video" | "audio" | "UNRECOGNIZED";
|
|
1440
|
-
hash: string;
|
|
1441
|
-
}[];
|
|
1429
|
+
attachments: import("@comapeo/schema/dist/schema/observation.js").Attachment[];
|
|
1442
1430
|
tags: {
|
|
1443
1431
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
1444
1432
|
};
|
|
@@ -45,91 +45,11 @@ export declare function getAttachmentUrlQueryKey({ projectId, blobId, }: {
|
|
|
45
45
|
}): readonly ["@comapeo/core-react", "projects", string, "attachments", BlobId];
|
|
46
46
|
export declare function projectsQueryOptions({ clientApi, }: {
|
|
47
47
|
clientApi: MapeoClientApi;
|
|
48
|
-
}): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<(
|
|
49
|
-
|
|
50
|
-
name?: string | undefined;
|
|
51
|
-
defaultPresets?: {
|
|
52
|
-
point: string[];
|
|
53
|
-
area: string[];
|
|
54
|
-
vertex: string[];
|
|
55
|
-
line: string[];
|
|
56
|
-
relation: string[];
|
|
57
|
-
} | undefined;
|
|
58
|
-
configMetadata?: {
|
|
59
|
-
name: string;
|
|
60
|
-
buildDate: string;
|
|
61
|
-
importDate: string;
|
|
62
|
-
fileVersion: string;
|
|
63
|
-
} | undefined;
|
|
64
|
-
}, "name"> & {
|
|
65
|
-
projectId: string;
|
|
66
|
-
createdAt?: string | undefined;
|
|
67
|
-
updatedAt?: string | undefined;
|
|
68
|
-
})[], Error, (Pick<{
|
|
69
|
-
schemaName: "projectSettings";
|
|
70
|
-
name?: string | undefined;
|
|
71
|
-
defaultPresets?: {
|
|
72
|
-
point: string[];
|
|
73
|
-
area: string[];
|
|
74
|
-
vertex: string[];
|
|
75
|
-
line: string[];
|
|
76
|
-
relation: string[];
|
|
77
|
-
} | undefined;
|
|
78
|
-
configMetadata?: {
|
|
79
|
-
name: string;
|
|
80
|
-
buildDate: string;
|
|
81
|
-
importDate: string;
|
|
82
|
-
fileVersion: string;
|
|
83
|
-
} | undefined;
|
|
84
|
-
}, "name"> & {
|
|
85
|
-
projectId: string;
|
|
86
|
-
createdAt?: string | undefined;
|
|
87
|
-
updatedAt?: string | undefined;
|
|
88
|
-
})[], readonly ["@comapeo/core-react", "projects"]>, "queryFn"> & {
|
|
89
|
-
queryFn?: import("@tanstack/react-query").QueryFunction<(Pick<{
|
|
90
|
-
schemaName: "projectSettings";
|
|
91
|
-
name?: string | undefined;
|
|
92
|
-
defaultPresets?: {
|
|
93
|
-
point: string[];
|
|
94
|
-
area: string[];
|
|
95
|
-
vertex: string[];
|
|
96
|
-
line: string[];
|
|
97
|
-
relation: string[];
|
|
98
|
-
} | undefined;
|
|
99
|
-
configMetadata?: {
|
|
100
|
-
name: string;
|
|
101
|
-
buildDate: string;
|
|
102
|
-
importDate: string;
|
|
103
|
-
fileVersion: string;
|
|
104
|
-
} | undefined;
|
|
105
|
-
}, "name"> & {
|
|
106
|
-
projectId: string;
|
|
107
|
-
createdAt?: string | undefined;
|
|
108
|
-
updatedAt?: string | undefined;
|
|
109
|
-
})[], readonly ["@comapeo/core-react", "projects"], never> | undefined;
|
|
48
|
+
}): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<import("@comapeo/core/dist/mapeo-manager.js").ListedProject[], Error, import("@comapeo/core/dist/mapeo-manager.js").ListedProject[], readonly ["@comapeo/core-react", "projects"]>, "queryFn"> & {
|
|
49
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<import("@comapeo/core/dist/mapeo-manager.js").ListedProject[], readonly ["@comapeo/core-react", "projects"], never> | undefined;
|
|
110
50
|
} & {
|
|
111
51
|
queryKey: readonly ["@comapeo/core-react", "projects"] & {
|
|
112
|
-
[dataTagSymbol]: (
|
|
113
|
-
schemaName: "projectSettings";
|
|
114
|
-
name?: string | undefined;
|
|
115
|
-
defaultPresets?: {
|
|
116
|
-
point: string[];
|
|
117
|
-
area: string[];
|
|
118
|
-
vertex: string[];
|
|
119
|
-
line: string[];
|
|
120
|
-
relation: string[];
|
|
121
|
-
} | undefined;
|
|
122
|
-
configMetadata?: {
|
|
123
|
-
name: string;
|
|
124
|
-
buildDate: string;
|
|
125
|
-
importDate: string;
|
|
126
|
-
fileVersion: string;
|
|
127
|
-
} | undefined;
|
|
128
|
-
}, "name"> & {
|
|
129
|
-
projectId: string;
|
|
130
|
-
createdAt?: string | undefined;
|
|
131
|
-
updatedAt?: string | undefined;
|
|
132
|
-
})[];
|
|
52
|
+
[dataTagSymbol]: import("@comapeo/core/dist/mapeo-manager.js").ListedProject[];
|
|
133
53
|
[dataTagErrorSymbol]: Error;
|
|
134
54
|
};
|
|
135
55
|
};
|
|
@@ -384,3 +304,32 @@ export declare function setAutostopDataSyncTimeoutMutationOptions({ projectApi,
|
|
|
384
304
|
networkMode: "always";
|
|
385
305
|
retry: false;
|
|
386
306
|
};
|
|
307
|
+
export declare function exportGeoJSONMutationOptions({ projectApi, }: {
|
|
308
|
+
projectApi: MapeoProjectApi;
|
|
309
|
+
}): {
|
|
310
|
+
mutationFn: (opts: {
|
|
311
|
+
path: string;
|
|
312
|
+
exportOptions: {
|
|
313
|
+
observations?: boolean;
|
|
314
|
+
tracks?: boolean;
|
|
315
|
+
lang?: string;
|
|
316
|
+
};
|
|
317
|
+
}) => Promise<string>;
|
|
318
|
+
networkMode: "always";
|
|
319
|
+
retry: false;
|
|
320
|
+
};
|
|
321
|
+
export declare function exportZipFileMutationOptions({ projectApi, }: {
|
|
322
|
+
projectApi: MapeoProjectApi;
|
|
323
|
+
}): {
|
|
324
|
+
mutationFn: (opts: {
|
|
325
|
+
path: string;
|
|
326
|
+
exportOptions: {
|
|
327
|
+
observations?: boolean;
|
|
328
|
+
tracks?: boolean;
|
|
329
|
+
lang?: string;
|
|
330
|
+
attachments?: boolean;
|
|
331
|
+
};
|
|
332
|
+
}) => Promise<string>;
|
|
333
|
+
networkMode: "always";
|
|
334
|
+
retry: false;
|
|
335
|
+
};
|
|
@@ -264,3 +264,19 @@ export function setAutostopDataSyncTimeoutMutationOptions({ projectApi, }) {
|
|
|
264
264
|
},
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
|
+
export function exportGeoJSONMutationOptions({ projectApi, }) {
|
|
268
|
+
return {
|
|
269
|
+
...baseMutationOptions(),
|
|
270
|
+
mutationFn: async (opts) => {
|
|
271
|
+
return projectApi.exportGeoJSONFile(opts.path, opts.exportOptions);
|
|
272
|
+
},
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
export function exportZipFileMutationOptions({ projectApi, }) {
|
|
276
|
+
return {
|
|
277
|
+
...baseMutationOptions(),
|
|
278
|
+
mutationFn: async (opts) => {
|
|
279
|
+
return projectApi.exportZipFile(opts.path, opts.exportOptions);
|
|
280
|
+
},
|
|
281
|
+
};
|
|
282
|
+
}
|
package/docs/API.md
CHANGED
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
- [useConnectSyncServers](#useconnectsyncservers)
|
|
30
30
|
- [useDisconnectSyncServers](#usedisconnectsyncservers)
|
|
31
31
|
- [useSetAutostopDataSyncTimeout](#usesetautostopdatasynctimeout)
|
|
32
|
+
- [useExportGeoJSON](#useexportgeojson)
|
|
33
|
+
- [useExportZipFile](#useexportzipfile)
|
|
32
34
|
- [useSingleDocByDocId](#usesingledocbydocid)
|
|
33
35
|
- [useSingleDocByVersionId](#usesingledocbyversionid)
|
|
34
36
|
- [useManyDocs](#usemanydocs)
|
|
@@ -547,6 +549,32 @@ Provides the progress of data sync for sync-enabled connected peers
|
|
|
547
549
|
| ---------- | ---------- |
|
|
548
550
|
| `useSetAutostopDataSyncTimeout` | `({ projectId, }: { projectId: string; }) => { error: Error; mutate: UseMutateFunction<void, Error, { after: number or null; }, unknown>; mutateAsync: UseMutateAsyncFunction<void, Error, { ...; }, unknown>; reset: () => void; status: "error"; } or { ...; }` |
|
|
549
551
|
|
|
552
|
+
### useExportGeoJSON
|
|
553
|
+
|
|
554
|
+
Creates a GeoJson file with all the observations and/or tracks in the project.
|
|
555
|
+
|
|
556
|
+
| Function | Type |
|
|
557
|
+
| ---------- | ---------- |
|
|
558
|
+
| `useExportGeoJSON` | `({ projectId }: { projectId: string; }) => { error: Error; mutate: UseMutateFunction<string, Error, { path: string; exportOptions: { observations?: boolean or undefined; tracks?: boolean or undefined; lang?: string or undefined; }; }, unknown>; mutateAsync: UseMutateAsyncFunction<...>; reset: () => void; status: "error...` |
|
|
559
|
+
|
|
560
|
+
Parameters:
|
|
561
|
+
|
|
562
|
+
* `opts.projectId`: Public ID of the project to apply changes to.
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
### useExportZipFile
|
|
566
|
+
|
|
567
|
+
Creates a zip file containing a GeoJson file with all the observations and/or tracks in the project and all associated attachments (photos and audio).
|
|
568
|
+
|
|
569
|
+
| Function | Type |
|
|
570
|
+
| ---------- | ---------- |
|
|
571
|
+
| `useExportZipFile` | `({ projectId }: { projectId: string; }) => { error: Error; mutate: UseMutateFunction<string, Error, { path: string; exportOptions: { observations?: boolean or undefined; tracks?: boolean or undefined; lang?: string or undefined; attachments?: boolean or undefined; }; }, unknown>; mutateAsync: UseMutateAsyncFunction<...>...` |
|
|
572
|
+
|
|
573
|
+
Parameters:
|
|
574
|
+
|
|
575
|
+
* `opts.projectId`: Public ID of the project to apply changes to.
|
|
576
|
+
|
|
577
|
+
|
|
550
578
|
### useSingleDocByDocId
|
|
551
579
|
|
|
552
580
|
Retrieve a single document from the database based on the document's document ID.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comapeo/core-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "React wrapper for working with @comapeo/core",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -57,44 +57,44 @@
|
|
|
57
57
|
"types": "tsc"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@comapeo/core": "^
|
|
61
|
-
"@comapeo/ipc": "^
|
|
60
|
+
"@comapeo/core": "^4.0.0",
|
|
61
|
+
"@comapeo/ipc": "^4.0.0",
|
|
62
62
|
"@comapeo/schema": "*",
|
|
63
63
|
"@tanstack/react-query": "^5",
|
|
64
64
|
"react": "^18 || ^19"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@comapeo/core": "
|
|
68
|
-
"@comapeo/ipc": "
|
|
69
|
-
"@comapeo/schema": "
|
|
70
|
-
"@eslint/compat": "1.
|
|
71
|
-
"@eslint/js": "9.
|
|
72
|
-
"@ianvs/prettier-plugin-sort-imports": "4.4.
|
|
67
|
+
"@comapeo/core": "4.0.0",
|
|
68
|
+
"@comapeo/ipc": "4.0.0",
|
|
69
|
+
"@comapeo/schema": "2.0.0",
|
|
70
|
+
"@eslint/compat": "1.3.0",
|
|
71
|
+
"@eslint/js": "9.29.0",
|
|
72
|
+
"@ianvs/prettier-plugin-sort-imports": "4.4.2",
|
|
73
73
|
"@mapeo/crypto": "1.0.0-alpha.10",
|
|
74
|
-
"@tanstack/eslint-plugin-query": "5.
|
|
75
|
-
"@tanstack/react-query": "5.
|
|
74
|
+
"@tanstack/eslint-plugin-query": "5.78.0",
|
|
75
|
+
"@tanstack/react-query": "5.80.7",
|
|
76
76
|
"@testing-library/dom": "10.4.0",
|
|
77
77
|
"@testing-library/react": "16.3.0",
|
|
78
|
-
"@types/node": "22.15.
|
|
79
|
-
"@types/react": "19.
|
|
80
|
-
"@types/react-dom": "19.
|
|
81
|
-
"@vitest/eslint-plugin": "1.
|
|
82
|
-
"eslint": "9.
|
|
78
|
+
"@types/node": "22.15.19",
|
|
79
|
+
"@types/react": "19.1.8",
|
|
80
|
+
"@types/react-dom": "19.1.6",
|
|
81
|
+
"@vitest/eslint-plugin": "1.2.7",
|
|
82
|
+
"eslint": "9.29.0",
|
|
83
83
|
"eslint-plugin-react-hooks": "5.2.0",
|
|
84
|
-
"eslint-plugin-testing-library": "7.
|
|
85
|
-
"fastify": "4.29.
|
|
86
|
-
"globals": "16.
|
|
84
|
+
"eslint-plugin-testing-library": "7.5.3",
|
|
85
|
+
"fastify": "4.29.1",
|
|
86
|
+
"globals": "16.2.0",
|
|
87
87
|
"husky": "9.1.7",
|
|
88
88
|
"lint-staged": "15.5.1",
|
|
89
89
|
"npm-run-all2": "7.0.2",
|
|
90
90
|
"prettier": "3.5.3",
|
|
91
91
|
"random-access-memory": "6.2.1",
|
|
92
|
-
"react": "19.
|
|
93
|
-
"react-dom": "19.
|
|
92
|
+
"react": "19.1.0",
|
|
93
|
+
"react-dom": "19.1.0",
|
|
94
94
|
"tsdoc-markdown": "1.2.0",
|
|
95
95
|
"tshy": "3.0.2",
|
|
96
96
|
"typescript": "5.8.3",
|
|
97
|
-
"typescript-eslint": "8.
|
|
98
|
-
"vitest": "3.
|
|
97
|
+
"typescript-eslint": "8.34.1",
|
|
98
|
+
"vitest": "3.2.3"
|
|
99
99
|
}
|
|
100
100
|
}
|