@comapeo/core-react 6.4.0 → 7.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/hooks/documents.d.ts +108 -108
- package/dist/commonjs/hooks/projects.d.ts +29 -0
- package/dist/commonjs/hooks/projects.js +19 -0
- package/dist/commonjs/index.d.ts +1 -1
- package/dist/commonjs/index.js +2 -1
- package/dist/commonjs/lib/react-query/documents.d.ts +439 -439
- package/dist/commonjs/lib/react-query/projects.d.ts +12 -0
- package/dist/commonjs/lib/react-query/projects.js +14 -0
- package/dist/esm/hooks/documents.d.ts +108 -108
- package/dist/esm/hooks/projects.d.ts +29 -0
- package/dist/esm/hooks/projects.js +19 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/lib/react-query/documents.d.ts +439 -439
- package/dist/esm/lib/react-query/projects.d.ts +12 -0
- package/dist/esm/lib/react-query/projects.js +13 -0
- package/package.json +6 -6
|
@@ -158,6 +158,18 @@ export declare function leaveProjectMutationOptions({ clientApi, queryClient, }:
|
|
|
158
158
|
networkMode: "always";
|
|
159
159
|
retry: false;
|
|
160
160
|
};
|
|
161
|
+
export declare function importProjectCategoriesMutationOptions({ projectApi, projectId, queryClient, }: {
|
|
162
|
+
projectApi: MapeoProjectApi;
|
|
163
|
+
projectId: string;
|
|
164
|
+
queryClient: QueryClient;
|
|
165
|
+
}): {
|
|
166
|
+
mutationFn: ({ filePath }: {
|
|
167
|
+
filePath: string;
|
|
168
|
+
}) => Promise<void>;
|
|
169
|
+
onSuccess: () => void;
|
|
170
|
+
networkMode: "always";
|
|
171
|
+
retry: false;
|
|
172
|
+
};
|
|
161
173
|
export declare function importProjectConfigMutationOptions({ projectApi, projectId, queryClient, }: {
|
|
162
174
|
projectApi: MapeoProjectApi;
|
|
163
175
|
projectId: string;
|
|
@@ -20,6 +20,7 @@ exports.addServerPeerMutationOptions = addServerPeerMutationOptions;
|
|
|
20
20
|
exports.removeServerPeerMutationOptions = removeServerPeerMutationOptions;
|
|
21
21
|
exports.createProjectMutationOptions = createProjectMutationOptions;
|
|
22
22
|
exports.leaveProjectMutationOptions = leaveProjectMutationOptions;
|
|
23
|
+
exports.importProjectCategoriesMutationOptions = importProjectCategoriesMutationOptions;
|
|
23
24
|
exports.importProjectConfigMutationOptions = importProjectConfigMutationOptions;
|
|
24
25
|
exports.updateProjectSettingsMutationOptions = updateProjectSettingsMutationOptions;
|
|
25
26
|
exports.changeMemberRoleMutationOptions = changeMemberRoleMutationOptions;
|
|
@@ -222,6 +223,19 @@ function leaveProjectMutationOptions({ clientApi, queryClient, }) {
|
|
|
222
223
|
},
|
|
223
224
|
};
|
|
224
225
|
}
|
|
226
|
+
function importProjectCategoriesMutationOptions({ projectApi, projectId, queryClient, }) {
|
|
227
|
+
return {
|
|
228
|
+
...(0, shared_js_1.baseMutationOptions)(),
|
|
229
|
+
mutationFn: ({ filePath }) => {
|
|
230
|
+
return projectApi.$importCategories({ filePath });
|
|
231
|
+
},
|
|
232
|
+
onSuccess: () => {
|
|
233
|
+
queryClient.invalidateQueries({
|
|
234
|
+
queryKey: getProjectByIdQueryKey({ projectId }),
|
|
235
|
+
});
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
}
|
|
225
239
|
function importProjectConfigMutationOptions({ projectApi, projectId, queryClient, }) {
|
|
226
240
|
return {
|
|
227
241
|
...(0, shared_js_1.baseMutationOptions)(),
|
|
@@ -51,28 +51,14 @@ export declare function useSingleDocByDocId<D extends WriteableDocumentType>({ p
|
|
|
51
51
|
links: string[];
|
|
52
52
|
deleted: boolean;
|
|
53
53
|
} & import("@comapeo/core/dist/datatype/index.js").DerivedDocFields) | ({
|
|
54
|
-
schemaName: "
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
schemaName: "remoteDetectionAlert";
|
|
55
|
+
detectionDateStart: string;
|
|
56
|
+
detectionDateEnd: string;
|
|
57
|
+
sourceId: string;
|
|
58
|
+
metadata: {
|
|
59
59
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
60
60
|
};
|
|
61
|
-
|
|
62
|
-
manualLocation?: boolean;
|
|
63
|
-
position?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
64
|
-
lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
65
|
-
positionProvider?: {
|
|
66
|
-
gpsAvailable?: boolean;
|
|
67
|
-
passiveAvailable?: boolean;
|
|
68
|
-
locationServicesEnabled: boolean;
|
|
69
|
-
networkAvailable?: boolean;
|
|
70
|
-
};
|
|
71
|
-
} | undefined;
|
|
72
|
-
presetRef?: {
|
|
73
|
-
docId: string;
|
|
74
|
-
versionId: string;
|
|
75
|
-
} | undefined;
|
|
61
|
+
geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
|
|
76
62
|
docId: string;
|
|
77
63
|
versionId: string;
|
|
78
64
|
originalVersionId: string;
|
|
@@ -104,6 +90,36 @@ export declare function useSingleDocByDocId<D extends WriteableDocumentType>({ p
|
|
|
104
90
|
updatedAt: string;
|
|
105
91
|
links: string[];
|
|
106
92
|
deleted: boolean;
|
|
93
|
+
} & import("@comapeo/core/dist/datatype/index.js").DerivedDocFields) | ({
|
|
94
|
+
schemaName: "observation";
|
|
95
|
+
lat?: number | undefined;
|
|
96
|
+
lon?: number | undefined;
|
|
97
|
+
attachments: import("@comapeo/schema/dist/schema/observation.js").Attachment[];
|
|
98
|
+
tags: {
|
|
99
|
+
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
100
|
+
};
|
|
101
|
+
metadata?: {
|
|
102
|
+
manualLocation?: boolean;
|
|
103
|
+
position?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
104
|
+
lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
105
|
+
positionProvider?: {
|
|
106
|
+
gpsAvailable?: boolean;
|
|
107
|
+
passiveAvailable?: boolean;
|
|
108
|
+
locationServicesEnabled: boolean;
|
|
109
|
+
networkAvailable?: boolean;
|
|
110
|
+
};
|
|
111
|
+
} | undefined;
|
|
112
|
+
presetRef?: {
|
|
113
|
+
docId: string;
|
|
114
|
+
versionId: string;
|
|
115
|
+
} | undefined;
|
|
116
|
+
docId: string;
|
|
117
|
+
versionId: string;
|
|
118
|
+
originalVersionId: string;
|
|
119
|
+
createdAt: string;
|
|
120
|
+
updatedAt: string;
|
|
121
|
+
links: string[];
|
|
122
|
+
deleted: boolean;
|
|
107
123
|
} & import("@comapeo/core/dist/datatype/index.js").DerivedDocFields) | ({
|
|
108
124
|
schemaName: "field";
|
|
109
125
|
tagKey: string;
|
|
@@ -125,22 +141,6 @@ export declare function useSingleDocByDocId<D extends WriteableDocumentType>({ p
|
|
|
125
141
|
updatedAt: string;
|
|
126
142
|
links: string[];
|
|
127
143
|
deleted: boolean;
|
|
128
|
-
} & import("@comapeo/core/dist/datatype/index.js").DerivedDocFields) | ({
|
|
129
|
-
schemaName: "remoteDetectionAlert";
|
|
130
|
-
detectionDateStart: string;
|
|
131
|
-
detectionDateEnd: string;
|
|
132
|
-
sourceId: string;
|
|
133
|
-
metadata: {
|
|
134
|
-
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
135
|
-
};
|
|
136
|
-
geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
|
|
137
|
-
docId: string;
|
|
138
|
-
versionId: string;
|
|
139
|
-
originalVersionId: string;
|
|
140
|
-
createdAt: string;
|
|
141
|
-
updatedAt: string;
|
|
142
|
-
links: string[];
|
|
143
|
-
deleted: boolean;
|
|
144
144
|
} & import("@comapeo/core/dist/datatype/index.js").DerivedDocFields), {
|
|
145
145
|
schemaName: D;
|
|
146
146
|
}>;
|
|
@@ -198,28 +198,14 @@ export declare function useSingleDocByVersionId<D extends WriteableDocumentType>
|
|
|
198
198
|
links: string[];
|
|
199
199
|
deleted: boolean;
|
|
200
200
|
} & import("@comapeo/core/dist/datatype/index.js").DerivedDocFields) | ({
|
|
201
|
-
schemaName: "
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
201
|
+
schemaName: "remoteDetectionAlert";
|
|
202
|
+
detectionDateStart: string;
|
|
203
|
+
detectionDateEnd: string;
|
|
204
|
+
sourceId: string;
|
|
205
|
+
metadata: {
|
|
206
206
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
207
207
|
};
|
|
208
|
-
|
|
209
|
-
manualLocation?: boolean;
|
|
210
|
-
position?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
211
|
-
lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
212
|
-
positionProvider?: {
|
|
213
|
-
gpsAvailable?: boolean;
|
|
214
|
-
passiveAvailable?: boolean;
|
|
215
|
-
locationServicesEnabled: boolean;
|
|
216
|
-
networkAvailable?: boolean;
|
|
217
|
-
};
|
|
218
|
-
} | undefined;
|
|
219
|
-
presetRef?: {
|
|
220
|
-
docId: string;
|
|
221
|
-
versionId: string;
|
|
222
|
-
} | undefined;
|
|
208
|
+
geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
|
|
223
209
|
docId: string;
|
|
224
210
|
versionId: string;
|
|
225
211
|
originalVersionId: string;
|
|
@@ -251,6 +237,36 @@ export declare function useSingleDocByVersionId<D extends WriteableDocumentType>
|
|
|
251
237
|
updatedAt: string;
|
|
252
238
|
links: string[];
|
|
253
239
|
deleted: boolean;
|
|
240
|
+
} & import("@comapeo/core/dist/datatype/index.js").DerivedDocFields) | ({
|
|
241
|
+
schemaName: "observation";
|
|
242
|
+
lat?: number | undefined;
|
|
243
|
+
lon?: number | undefined;
|
|
244
|
+
attachments: import("@comapeo/schema/dist/schema/observation.js").Attachment[];
|
|
245
|
+
tags: {
|
|
246
|
+
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
247
|
+
};
|
|
248
|
+
metadata?: {
|
|
249
|
+
manualLocation?: boolean;
|
|
250
|
+
position?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
251
|
+
lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
252
|
+
positionProvider?: {
|
|
253
|
+
gpsAvailable?: boolean;
|
|
254
|
+
passiveAvailable?: boolean;
|
|
255
|
+
locationServicesEnabled: boolean;
|
|
256
|
+
networkAvailable?: boolean;
|
|
257
|
+
};
|
|
258
|
+
} | undefined;
|
|
259
|
+
presetRef?: {
|
|
260
|
+
docId: string;
|
|
261
|
+
versionId: string;
|
|
262
|
+
} | undefined;
|
|
263
|
+
docId: string;
|
|
264
|
+
versionId: string;
|
|
265
|
+
originalVersionId: string;
|
|
266
|
+
createdAt: string;
|
|
267
|
+
updatedAt: string;
|
|
268
|
+
links: string[];
|
|
269
|
+
deleted: boolean;
|
|
254
270
|
} & import("@comapeo/core/dist/datatype/index.js").DerivedDocFields) | ({
|
|
255
271
|
schemaName: "field";
|
|
256
272
|
tagKey: string;
|
|
@@ -272,22 +288,6 @@ export declare function useSingleDocByVersionId<D extends WriteableDocumentType>
|
|
|
272
288
|
updatedAt: string;
|
|
273
289
|
links: string[];
|
|
274
290
|
deleted: boolean;
|
|
275
|
-
} & import("@comapeo/core/dist/datatype/index.js").DerivedDocFields) | ({
|
|
276
|
-
schemaName: "remoteDetectionAlert";
|
|
277
|
-
detectionDateStart: string;
|
|
278
|
-
detectionDateEnd: string;
|
|
279
|
-
sourceId: string;
|
|
280
|
-
metadata: {
|
|
281
|
-
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
282
|
-
};
|
|
283
|
-
geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
|
|
284
|
-
docId: string;
|
|
285
|
-
versionId: string;
|
|
286
|
-
originalVersionId: string;
|
|
287
|
-
createdAt: string;
|
|
288
|
-
updatedAt: string;
|
|
289
|
-
links: string[];
|
|
290
|
-
deleted: boolean;
|
|
291
291
|
} & import("@comapeo/core/dist/datatype/index.js").DerivedDocFields), {
|
|
292
292
|
schemaName: D;
|
|
293
293
|
}>;
|
|
@@ -356,28 +356,14 @@ export declare function useManyDocs<D extends WriteableDocumentType>({ projectId
|
|
|
356
356
|
links: string[];
|
|
357
357
|
deleted: boolean;
|
|
358
358
|
} & import("@comapeo/core/dist/datatype/index.js").DerivedDocFields)[] | ({
|
|
359
|
-
schemaName: "
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
359
|
+
schemaName: "remoteDetectionAlert";
|
|
360
|
+
detectionDateStart: string;
|
|
361
|
+
detectionDateEnd: string;
|
|
362
|
+
sourceId: string;
|
|
363
|
+
metadata: {
|
|
364
364
|
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
365
365
|
};
|
|
366
|
-
|
|
367
|
-
manualLocation?: boolean;
|
|
368
|
-
position?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
369
|
-
lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
370
|
-
positionProvider?: {
|
|
371
|
-
gpsAvailable?: boolean;
|
|
372
|
-
passiveAvailable?: boolean;
|
|
373
|
-
locationServicesEnabled: boolean;
|
|
374
|
-
networkAvailable?: boolean;
|
|
375
|
-
};
|
|
376
|
-
} | undefined;
|
|
377
|
-
presetRef?: {
|
|
378
|
-
docId: string;
|
|
379
|
-
versionId: string;
|
|
380
|
-
} | undefined;
|
|
366
|
+
geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
|
|
381
367
|
docId: string;
|
|
382
368
|
versionId: string;
|
|
383
369
|
originalVersionId: string;
|
|
@@ -409,6 +395,36 @@ export declare function useManyDocs<D extends WriteableDocumentType>({ projectId
|
|
|
409
395
|
updatedAt: string;
|
|
410
396
|
links: string[];
|
|
411
397
|
deleted: boolean;
|
|
398
|
+
} & import("@comapeo/core/dist/datatype/index.js").DerivedDocFields)[] | ({
|
|
399
|
+
schemaName: "observation";
|
|
400
|
+
lat?: number | undefined;
|
|
401
|
+
lon?: number | undefined;
|
|
402
|
+
attachments: import("@comapeo/schema/dist/schema/observation.js").Attachment[];
|
|
403
|
+
tags: {
|
|
404
|
+
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
405
|
+
};
|
|
406
|
+
metadata?: {
|
|
407
|
+
manualLocation?: boolean;
|
|
408
|
+
position?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
409
|
+
lastSavedPosition?: import("@comapeo/schema/dist/schema/observation.js").Position;
|
|
410
|
+
positionProvider?: {
|
|
411
|
+
gpsAvailable?: boolean;
|
|
412
|
+
passiveAvailable?: boolean;
|
|
413
|
+
locationServicesEnabled: boolean;
|
|
414
|
+
networkAvailable?: boolean;
|
|
415
|
+
};
|
|
416
|
+
} | undefined;
|
|
417
|
+
presetRef?: {
|
|
418
|
+
docId: string;
|
|
419
|
+
versionId: string;
|
|
420
|
+
} | undefined;
|
|
421
|
+
docId: string;
|
|
422
|
+
versionId: string;
|
|
423
|
+
originalVersionId: string;
|
|
424
|
+
createdAt: string;
|
|
425
|
+
updatedAt: string;
|
|
426
|
+
links: string[];
|
|
427
|
+
deleted: boolean;
|
|
412
428
|
} & import("@comapeo/core/dist/datatype/index.js").DerivedDocFields)[] | ({
|
|
413
429
|
schemaName: "field";
|
|
414
430
|
tagKey: string;
|
|
@@ -430,22 +446,6 @@ export declare function useManyDocs<D extends WriteableDocumentType>({ projectId
|
|
|
430
446
|
updatedAt: string;
|
|
431
447
|
links: string[];
|
|
432
448
|
deleted: boolean;
|
|
433
|
-
} & import("@comapeo/core/dist/datatype/index.js").DerivedDocFields)[] | ({
|
|
434
|
-
schemaName: "remoteDetectionAlert";
|
|
435
|
-
detectionDateStart: string;
|
|
436
|
-
detectionDateEnd: string;
|
|
437
|
-
sourceId: string;
|
|
438
|
-
metadata: {
|
|
439
|
-
[k: string]: boolean | number | string | null | (boolean | number | string | null)[];
|
|
440
|
-
};
|
|
441
|
-
geometry: import("@comapeo/schema/dist/schema/remoteDetectionAlert.js").Geometry;
|
|
442
|
-
docId: string;
|
|
443
|
-
versionId: string;
|
|
444
|
-
originalVersionId: string;
|
|
445
|
-
createdAt: string;
|
|
446
|
-
updatedAt: string;
|
|
447
|
-
links: string[];
|
|
448
|
-
deleted: boolean;
|
|
449
449
|
} & import("@comapeo/core/dist/datatype/index.js").DerivedDocFields)[], Array<{
|
|
450
450
|
schemaName: D;
|
|
451
451
|
}>>;
|
|
@@ -360,9 +360,38 @@ export declare function useLeaveProject(): {
|
|
|
360
360
|
reset: () => void;
|
|
361
361
|
status: "pending" | "success" | "idle";
|
|
362
362
|
};
|
|
363
|
+
/**
|
|
364
|
+
* Update the categories of a project using an external file.
|
|
365
|
+
*
|
|
366
|
+
* @param opts.projectId Public ID of the project to apply changes to.
|
|
367
|
+
*/
|
|
368
|
+
export declare function useImportProjectCategories({ projectId, }: {
|
|
369
|
+
projectId: string;
|
|
370
|
+
}): {
|
|
371
|
+
error: Error;
|
|
372
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<void, Error, {
|
|
373
|
+
filePath: string;
|
|
374
|
+
}, unknown>;
|
|
375
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<void, Error, {
|
|
376
|
+
filePath: string;
|
|
377
|
+
}, unknown>;
|
|
378
|
+
reset: () => void;
|
|
379
|
+
status: "error";
|
|
380
|
+
} | {
|
|
381
|
+
error: null;
|
|
382
|
+
mutate: import("@tanstack/react-query").UseMutateFunction<void, Error, {
|
|
383
|
+
filePath: string;
|
|
384
|
+
}, unknown>;
|
|
385
|
+
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<void, Error, {
|
|
386
|
+
filePath: string;
|
|
387
|
+
}, unknown>;
|
|
388
|
+
reset: () => void;
|
|
389
|
+
status: "pending" | "success" | "idle";
|
|
390
|
+
};
|
|
363
391
|
/**
|
|
364
392
|
* Update the configuration of a project using an external file.
|
|
365
393
|
*
|
|
394
|
+
* @deprecated Use `useImportProjectCategories` instead.
|
|
366
395
|
* @param opts.projectId Public ID of the project to apply changes to.
|
|
367
396
|
*/
|
|
368
397
|
export declare function useImportProjectConfig({ projectId }: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMutation, useQueryClient, useSuspenseQuery, } from '@tanstack/react-query';
|
|
2
2
|
import { useSyncExternalStore } from 'react';
|
|
3
|
-
import { addServerPeerMutationOptions, changeMemberRoleMutationOptions, connectSyncServersMutationOptions, createBlobMutationOptions, createProjectMutationOptions, disconnectSyncServersMutationOptions, documentCreatedByQueryOptions, exportGeoJSONMutationOptions, exportZipFileMutationOptions, importProjectConfigMutationOptions, leaveProjectMutationOptions, mediaServerOriginQueryOptions, projectByIdQueryOptions, projectMemberByIdQueryOptions, projectMembersQueryOptions, projectOwnRoleQueryOptions, projectSettingsQueryOptions, projectsQueryOptions, removeServerPeerMutationOptions, setAutostopDataSyncTimeoutMutationOptions, startSyncMutationOptions, stopSyncMutationOptions, updateProjectSettingsMutationOptions, } from '../lib/react-query/projects.js';
|
|
3
|
+
import { addServerPeerMutationOptions, changeMemberRoleMutationOptions, connectSyncServersMutationOptions, createBlobMutationOptions, createProjectMutationOptions, disconnectSyncServersMutationOptions, documentCreatedByQueryOptions, exportGeoJSONMutationOptions, exportZipFileMutationOptions, importProjectCategoriesMutationOptions, importProjectConfigMutationOptions, leaveProjectMutationOptions, mediaServerOriginQueryOptions, projectByIdQueryOptions, projectMemberByIdQueryOptions, projectMembersQueryOptions, projectOwnRoleQueryOptions, projectSettingsQueryOptions, projectsQueryOptions, removeServerPeerMutationOptions, setAutostopDataSyncTimeoutMutationOptions, startSyncMutationOptions, stopSyncMutationOptions, updateProjectSettingsMutationOptions, } from '../lib/react-query/projects.js';
|
|
4
4
|
import { SyncStore } from '../lib/sync.js';
|
|
5
5
|
import { getBlobUrl, getIconUrl } from '../lib/urls.js';
|
|
6
6
|
import { useClientApi } from './client.js';
|
|
@@ -317,9 +317,27 @@ export function useLeaveProject() {
|
|
|
317
317
|
? { error, mutate, mutateAsync, reset, status }
|
|
318
318
|
: { error: null, mutate, mutateAsync, reset, status };
|
|
319
319
|
}
|
|
320
|
+
/**
|
|
321
|
+
* Update the categories of a project using an external file.
|
|
322
|
+
*
|
|
323
|
+
* @param opts.projectId Public ID of the project to apply changes to.
|
|
324
|
+
*/
|
|
325
|
+
export function useImportProjectCategories({ projectId, }) {
|
|
326
|
+
const queryClient = useQueryClient();
|
|
327
|
+
const { data: projectApi } = useSingleProject({ projectId });
|
|
328
|
+
const { error, mutate, mutateAsync, reset, status } = useMutation(importProjectCategoriesMutationOptions({
|
|
329
|
+
queryClient,
|
|
330
|
+
projectApi,
|
|
331
|
+
projectId,
|
|
332
|
+
}));
|
|
333
|
+
return status === 'error'
|
|
334
|
+
? { error, mutate, mutateAsync, reset, status }
|
|
335
|
+
: { error: null, mutate, mutateAsync, reset, status };
|
|
336
|
+
}
|
|
320
337
|
/**
|
|
321
338
|
* Update the configuration of a project using an external file.
|
|
322
339
|
*
|
|
340
|
+
* @deprecated Use `useImportProjectCategories` instead.
|
|
323
341
|
* @param opts.projectId Public ID of the project to apply changes to.
|
|
324
342
|
*/
|
|
325
343
|
export function useImportProjectConfig({ projectId }) {
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ export { useClientApi, useIsArchiveDevice, useOwnDeviceInfo, useSetIsArchiveDevi
|
|
|
3
3
|
export { useCreateDocument, useDeleteDocument, useManyDocs, usePresetsSelection, useSingleDocByDocId, useSingleDocByVersionId, useUpdateDocument, } from './hooks/documents.js';
|
|
4
4
|
export { useAcceptInvite, useManyInvites, useRejectInvite, useRequestCancelInvite, useSendInvite, useSetUpInvitesListeners, useSingleInvite, } from './hooks/invites.js';
|
|
5
5
|
export { useMapStyleUrl } from './hooks/maps.js';
|
|
6
|
-
export { useAddServerPeer, useAttachmentUrl, useConnectSyncServers, useCreateBlob, useCreateProject, useDataSyncProgress, useDisconnectSyncServers, useDocumentCreatedBy, useIconUrl, useImportProjectConfig, useLeaveProject, useManyMembers, useManyProjects, useOwnRoleInProject, useProjectSettings, useRemoveServerPeer, useSetAutostopDataSyncTimeout, useSingleMember, useSingleProject, useStartSync, useStopSync, useSyncState, useUpdateProjectSettings, useChangeMemberRole, useExportGeoJSON, useExportZipFile, } from './hooks/projects.js';
|
|
6
|
+
export { useAddServerPeer, useAttachmentUrl, useConnectSyncServers, useCreateBlob, useCreateProject, useDataSyncProgress, useDisconnectSyncServers, useDocumentCreatedBy, useIconUrl, useImportProjectCategories, useImportProjectConfig, useLeaveProject, useManyMembers, useManyProjects, useOwnRoleInProject, useProjectSettings, useRemoveServerPeer, useSetAutostopDataSyncTimeout, useSingleMember, useSingleProject, useStartSync, useStopSync, useSyncState, useUpdateProjectSettings, useChangeMemberRole, useExportGeoJSON, useExportZipFile, } from './hooks/projects.js';
|
|
7
7
|
export { type SyncState } from './lib/sync.js';
|
|
8
8
|
export { type WriteableDocument, type WriteableDocumentType, type WriteableValue, } from './lib/types.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -3,4 +3,4 @@ export { useClientApi, useIsArchiveDevice, useOwnDeviceInfo, useSetIsArchiveDevi
|
|
|
3
3
|
export { useCreateDocument, useDeleteDocument, useManyDocs, usePresetsSelection, useSingleDocByDocId, useSingleDocByVersionId, useUpdateDocument, } from './hooks/documents.js';
|
|
4
4
|
export { useAcceptInvite, useManyInvites, useRejectInvite, useRequestCancelInvite, useSendInvite, useSetUpInvitesListeners, useSingleInvite, } from './hooks/invites.js';
|
|
5
5
|
export { useMapStyleUrl } from './hooks/maps.js';
|
|
6
|
-
export { useAddServerPeer, useAttachmentUrl, useConnectSyncServers, useCreateBlob, useCreateProject, useDataSyncProgress, useDisconnectSyncServers, useDocumentCreatedBy, useIconUrl, useImportProjectConfig, useLeaveProject, useManyMembers, useManyProjects, useOwnRoleInProject, useProjectSettings, useRemoveServerPeer, useSetAutostopDataSyncTimeout, useSingleMember, useSingleProject, useStartSync, useStopSync, useSyncState, useUpdateProjectSettings, useChangeMemberRole, useExportGeoJSON, useExportZipFile, } from './hooks/projects.js';
|
|
6
|
+
export { useAddServerPeer, useAttachmentUrl, useConnectSyncServers, useCreateBlob, useCreateProject, useDataSyncProgress, useDisconnectSyncServers, useDocumentCreatedBy, useIconUrl, useImportProjectCategories, useImportProjectConfig, useLeaveProject, useManyMembers, useManyProjects, useOwnRoleInProject, useProjectSettings, useRemoveServerPeer, useSetAutostopDataSyncTimeout, useSingleMember, useSingleProject, useStartSync, useStopSync, useSyncState, useUpdateProjectSettings, useChangeMemberRole, useExportGeoJSON, useExportZipFile, } from './hooks/projects.js';
|