@comapeo/core-react 1.0.1 → 2.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 +14 -0
- package/dist/commonjs/contexts/ClientApi.js +16 -0
- package/dist/commonjs/hooks/client.d.ts +80 -0
- package/dist/commonjs/hooks/client.js +91 -0
- package/dist/{hooks → commonjs/hooks}/documents.d.ts +60 -5
- package/dist/commonjs/hooks/documents.js +192 -0
- package/dist/commonjs/hooks/invites.d.ts +51 -0
- package/dist/commonjs/hooks/invites.js +50 -0
- package/dist/commonjs/hooks/maps.js +37 -0
- package/dist/commonjs/hooks/projects.d.ts +334 -0
- package/dist/commonjs/hooks/projects.js +320 -0
- package/dist/commonjs/index.d.ts +12 -0
- package/dist/commonjs/index.js +69 -0
- package/dist/commonjs/lib/react-query/client.d.ts +61 -0
- package/dist/commonjs/lib/react-query/client.js +68 -0
- package/dist/{lib → commonjs/lib}/react-query/documents.d.ts +789 -706
- package/dist/commonjs/lib/react-query/documents.js +149 -0
- package/dist/commonjs/lib/react-query/invites.d.ts +71 -0
- package/dist/commonjs/lib/react-query/invites.js +85 -0
- package/dist/commonjs/lib/react-query/maps.d.ts +24 -0
- package/dist/commonjs/lib/react-query/maps.js +27 -0
- package/dist/commonjs/lib/react-query/projects.d.ts +332 -0
- package/dist/commonjs/lib/react-query/projects.js +235 -0
- package/dist/{lib → commonjs/lib}/react-query/shared.d.ts +5 -1
- package/dist/commonjs/lib/react-query/shared.js +23 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/{contexts → esm/contexts}/ClientApi.d.ts +3 -3
- package/dist/{hooks → esm/hooks}/client.d.ts +23 -2
- package/dist/{hooks → esm/hooks}/client.js +21 -3
- package/dist/esm/hooks/documents.d.ts +167 -0
- package/dist/{hooks → esm/hooks}/documents.js +54 -3
- package/dist/esm/hooks/invites.d.ts +51 -0
- package/dist/esm/hooks/invites.js +44 -0
- package/dist/esm/hooks/maps.d.ts +33 -0
- package/dist/{hooks → esm/hooks}/maps.js +2 -2
- package/dist/{hooks → esm/hooks}/projects.d.ts +89 -6
- package/dist/{hooks → esm/hooks}/projects.js +59 -3
- package/dist/esm/index.d.ts +12 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/lib/react-query/client.d.ts +61 -0
- package/dist/esm/lib/react-query/client.js +59 -0
- package/dist/esm/lib/react-query/documents.d.ts +1584 -0
- package/dist/{lib → esm/lib}/react-query/documents.js +56 -2
- package/dist/esm/lib/react-query/invites.d.ts +71 -0
- package/dist/esm/lib/react-query/invites.js +76 -0
- package/dist/esm/lib/react-query/maps.d.ts +24 -0
- package/dist/{lib → esm/lib}/react-query/maps.js +6 -2
- package/dist/esm/lib/react-query/projects.d.ts +332 -0
- package/dist/{lib → esm/lib}/react-query/projects.js +84 -2
- package/dist/esm/lib/react-query/shared.d.ts +9 -0
- package/dist/{lib → esm/lib}/react-query/shared.js +7 -1
- package/dist/esm/package.json +3 -0
- package/docs/API.md +157 -258
- package/package.json +51 -37
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -11
- package/dist/lib/react-query/client.d.ts +0 -30
- package/dist/lib/react-query/client.js +0 -29
- package/dist/lib/react-query/invites.d.ts +0 -12
- package/dist/lib/react-query/invites.js +0 -17
- package/dist/lib/react-query/maps.d.ts +0 -15
- package/dist/lib/react-query/projects.d.ts +0 -196
- /package/dist/{hooks → commonjs/hooks}/maps.d.ts +0 -0
- /package/dist/{contexts → esm/contexts}/ClientApi.js +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProjectRoleQueryKey = exports.getProjectByIdQueryKey = exports.getMembersQueryKey = exports.getMemberByIdQueryKey = exports.getIconUrlQueryKey = exports.getDocumentCreatedByQueryKey = exports.getAttachmentUrlQueryKey = exports.getStyleJsonUrlQueryKey = exports.getMapsQueryKey = exports.getPendingInvitesQueryKey = exports.getInvitesQueryKey = exports.getManyDocumentsQueryKey = exports.getDocumentsQueryKey = exports.getDocumentByVersionIdQueryKey = exports.getDocumentByDocIdQueryKey = exports.getIsArchiveDeviceQueryKey = exports.getDeviceInfoQueryKey = exports.getClientQueryKey = exports.useUpdateProjectSettings = exports.useSingleProject = exports.useSingleMember = exports.useProjectSettings = exports.useManyProjects = exports.useManyMembers = exports.useLeaveProject = exports.useImportProjectConfig = exports.useIconUrl = exports.useDocumentCreatedBy = exports.useCreateProject = exports.useCreateBlob = exports.useAttachmentUrl = exports.useAddServerPeer = exports.useMapStyleUrl = exports.useSendInvite = exports.useRequestCancelInvite = exports.useRejectInvite = exports.useAcceptInvite = exports.useUpdateDocument = exports.useSingleDocByVersionId = exports.useSingleDocByDocId = exports.useManyDocs = exports.useDeleteDocument = exports.useCreateDocument = exports.useSetOwnDeviceInfo = exports.useSetIsArchiveDevice = exports.useOwnDeviceInfo = exports.useIsArchiveDevice = exports.useClientApi = exports.ClientApiProvider = exports.ClientApiContext = void 0;
|
|
4
|
+
exports.ROOT_QUERY_KEY = exports.getProjectsQueryKey = exports.getProjectSettingsQueryKey = void 0;
|
|
5
|
+
var ClientApi_js_1 = require("./contexts/ClientApi.js");
|
|
6
|
+
Object.defineProperty(exports, "ClientApiContext", { enumerable: true, get: function () { return ClientApi_js_1.ClientApiContext; } });
|
|
7
|
+
Object.defineProperty(exports, "ClientApiProvider", { enumerable: true, get: function () { return ClientApi_js_1.ClientApiProvider; } });
|
|
8
|
+
var client_js_1 = require("./hooks/client.js");
|
|
9
|
+
Object.defineProperty(exports, "useClientApi", { enumerable: true, get: function () { return client_js_1.useClientApi; } });
|
|
10
|
+
Object.defineProperty(exports, "useIsArchiveDevice", { enumerable: true, get: function () { return client_js_1.useIsArchiveDevice; } });
|
|
11
|
+
Object.defineProperty(exports, "useOwnDeviceInfo", { enumerable: true, get: function () { return client_js_1.useOwnDeviceInfo; } });
|
|
12
|
+
Object.defineProperty(exports, "useSetIsArchiveDevice", { enumerable: true, get: function () { return client_js_1.useSetIsArchiveDevice; } });
|
|
13
|
+
Object.defineProperty(exports, "useSetOwnDeviceInfo", { enumerable: true, get: function () { return client_js_1.useSetOwnDeviceInfo; } });
|
|
14
|
+
var documents_js_1 = require("./hooks/documents.js");
|
|
15
|
+
Object.defineProperty(exports, "useCreateDocument", { enumerable: true, get: function () { return documents_js_1.useCreateDocument; } });
|
|
16
|
+
Object.defineProperty(exports, "useDeleteDocument", { enumerable: true, get: function () { return documents_js_1.useDeleteDocument; } });
|
|
17
|
+
Object.defineProperty(exports, "useManyDocs", { enumerable: true, get: function () { return documents_js_1.useManyDocs; } });
|
|
18
|
+
Object.defineProperty(exports, "useSingleDocByDocId", { enumerable: true, get: function () { return documents_js_1.useSingleDocByDocId; } });
|
|
19
|
+
Object.defineProperty(exports, "useSingleDocByVersionId", { enumerable: true, get: function () { return documents_js_1.useSingleDocByVersionId; } });
|
|
20
|
+
Object.defineProperty(exports, "useUpdateDocument", { enumerable: true, get: function () { return documents_js_1.useUpdateDocument; } });
|
|
21
|
+
var invites_js_1 = require("./hooks/invites.js");
|
|
22
|
+
Object.defineProperty(exports, "useAcceptInvite", { enumerable: true, get: function () { return invites_js_1.useAcceptInvite; } });
|
|
23
|
+
Object.defineProperty(exports, "useRejectInvite", { enumerable: true, get: function () { return invites_js_1.useRejectInvite; } });
|
|
24
|
+
Object.defineProperty(exports, "useRequestCancelInvite", { enumerable: true, get: function () { return invites_js_1.useRequestCancelInvite; } });
|
|
25
|
+
Object.defineProperty(exports, "useSendInvite", { enumerable: true, get: function () { return invites_js_1.useSendInvite; } });
|
|
26
|
+
var maps_js_1 = require("./hooks/maps.js");
|
|
27
|
+
Object.defineProperty(exports, "useMapStyleUrl", { enumerable: true, get: function () { return maps_js_1.useMapStyleUrl; } });
|
|
28
|
+
var projects_js_1 = require("./hooks/projects.js");
|
|
29
|
+
Object.defineProperty(exports, "useAddServerPeer", { enumerable: true, get: function () { return projects_js_1.useAddServerPeer; } });
|
|
30
|
+
Object.defineProperty(exports, "useAttachmentUrl", { enumerable: true, get: function () { return projects_js_1.useAttachmentUrl; } });
|
|
31
|
+
Object.defineProperty(exports, "useCreateBlob", { enumerable: true, get: function () { return projects_js_1.useCreateBlob; } });
|
|
32
|
+
Object.defineProperty(exports, "useCreateProject", { enumerable: true, get: function () { return projects_js_1.useCreateProject; } });
|
|
33
|
+
Object.defineProperty(exports, "useDocumentCreatedBy", { enumerable: true, get: function () { return projects_js_1.useDocumentCreatedBy; } });
|
|
34
|
+
Object.defineProperty(exports, "useIconUrl", { enumerable: true, get: function () { return projects_js_1.useIconUrl; } });
|
|
35
|
+
Object.defineProperty(exports, "useImportProjectConfig", { enumerable: true, get: function () { return projects_js_1.useImportProjectConfig; } });
|
|
36
|
+
Object.defineProperty(exports, "useLeaveProject", { enumerable: true, get: function () { return projects_js_1.useLeaveProject; } });
|
|
37
|
+
Object.defineProperty(exports, "useManyMembers", { enumerable: true, get: function () { return projects_js_1.useManyMembers; } });
|
|
38
|
+
Object.defineProperty(exports, "useManyProjects", { enumerable: true, get: function () { return projects_js_1.useManyProjects; } });
|
|
39
|
+
Object.defineProperty(exports, "useProjectSettings", { enumerable: true, get: function () { return projects_js_1.useProjectSettings; } });
|
|
40
|
+
Object.defineProperty(exports, "useSingleMember", { enumerable: true, get: function () { return projects_js_1.useSingleMember; } });
|
|
41
|
+
Object.defineProperty(exports, "useSingleProject", { enumerable: true, get: function () { return projects_js_1.useSingleProject; } });
|
|
42
|
+
Object.defineProperty(exports, "useUpdateProjectSettings", { enumerable: true, get: function () { return projects_js_1.useUpdateProjectSettings; } });
|
|
43
|
+
var client_js_2 = require("./lib/react-query/client.js");
|
|
44
|
+
Object.defineProperty(exports, "getClientQueryKey", { enumerable: true, get: function () { return client_js_2.getClientQueryKey; } });
|
|
45
|
+
Object.defineProperty(exports, "getDeviceInfoQueryKey", { enumerable: true, get: function () { return client_js_2.getDeviceInfoQueryKey; } });
|
|
46
|
+
Object.defineProperty(exports, "getIsArchiveDeviceQueryKey", { enumerable: true, get: function () { return client_js_2.getIsArchiveDeviceQueryKey; } });
|
|
47
|
+
var documents_js_2 = require("./lib/react-query/documents.js");
|
|
48
|
+
Object.defineProperty(exports, "getDocumentByDocIdQueryKey", { enumerable: true, get: function () { return documents_js_2.getDocumentByDocIdQueryKey; } });
|
|
49
|
+
Object.defineProperty(exports, "getDocumentByVersionIdQueryKey", { enumerable: true, get: function () { return documents_js_2.getDocumentByVersionIdQueryKey; } });
|
|
50
|
+
Object.defineProperty(exports, "getDocumentsQueryKey", { enumerable: true, get: function () { return documents_js_2.getDocumentsQueryKey; } });
|
|
51
|
+
Object.defineProperty(exports, "getManyDocumentsQueryKey", { enumerable: true, get: function () { return documents_js_2.getManyDocumentsQueryKey; } });
|
|
52
|
+
var invites_js_2 = require("./lib/react-query/invites.js");
|
|
53
|
+
Object.defineProperty(exports, "getInvitesQueryKey", { enumerable: true, get: function () { return invites_js_2.getInvitesQueryKey; } });
|
|
54
|
+
Object.defineProperty(exports, "getPendingInvitesQueryKey", { enumerable: true, get: function () { return invites_js_2.getPendingInvitesQueryKey; } });
|
|
55
|
+
var maps_js_2 = require("./lib/react-query/maps.js");
|
|
56
|
+
Object.defineProperty(exports, "getMapsQueryKey", { enumerable: true, get: function () { return maps_js_2.getMapsQueryKey; } });
|
|
57
|
+
Object.defineProperty(exports, "getStyleJsonUrlQueryKey", { enumerable: true, get: function () { return maps_js_2.getStyleJsonUrlQueryKey; } });
|
|
58
|
+
var projects_js_2 = require("./lib/react-query/projects.js");
|
|
59
|
+
Object.defineProperty(exports, "getAttachmentUrlQueryKey", { enumerable: true, get: function () { return projects_js_2.getAttachmentUrlQueryKey; } });
|
|
60
|
+
Object.defineProperty(exports, "getDocumentCreatedByQueryKey", { enumerable: true, get: function () { return projects_js_2.getDocumentCreatedByQueryKey; } });
|
|
61
|
+
Object.defineProperty(exports, "getIconUrlQueryKey", { enumerable: true, get: function () { return projects_js_2.getIconUrlQueryKey; } });
|
|
62
|
+
Object.defineProperty(exports, "getMemberByIdQueryKey", { enumerable: true, get: function () { return projects_js_2.getMemberByIdQueryKey; } });
|
|
63
|
+
Object.defineProperty(exports, "getMembersQueryKey", { enumerable: true, get: function () { return projects_js_2.getMembersQueryKey; } });
|
|
64
|
+
Object.defineProperty(exports, "getProjectByIdQueryKey", { enumerable: true, get: function () { return projects_js_2.getProjectByIdQueryKey; } });
|
|
65
|
+
Object.defineProperty(exports, "getProjectRoleQueryKey", { enumerable: true, get: function () { return projects_js_2.getProjectRoleQueryKey; } });
|
|
66
|
+
Object.defineProperty(exports, "getProjectSettingsQueryKey", { enumerable: true, get: function () { return projects_js_2.getProjectSettingsQueryKey; } });
|
|
67
|
+
Object.defineProperty(exports, "getProjectsQueryKey", { enumerable: true, get: function () { return projects_js_2.getProjectsQueryKey; } });
|
|
68
|
+
var shared_js_1 = require("./lib/react-query/shared.js");
|
|
69
|
+
Object.defineProperty(exports, "ROOT_QUERY_KEY", { enumerable: true, get: function () { return shared_js_1.ROOT_QUERY_KEY; } });
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { MapeoClientApi } from '@comapeo/ipc' with { 'resolution-mode': 'import' };
|
|
2
|
+
import type { DeviceInfo } from '@comapeo/schema' with { 'resolution-mode': 'import' };
|
|
3
|
+
import { type QueryClient } from '@tanstack/react-query';
|
|
4
|
+
export declare function getClientQueryKey(): readonly ["@comapeo/core-react", "client"];
|
|
5
|
+
export declare function getDeviceInfoQueryKey(): readonly ["@comapeo/core-react", "client", "device_info"];
|
|
6
|
+
export declare function getIsArchiveDeviceQueryKey(): readonly ["@comapeo/core-react", "client", "is_archive_device"];
|
|
7
|
+
export declare function deviceInfoQueryOptions({ clientApi, }: {
|
|
8
|
+
clientApi: MapeoClientApi;
|
|
9
|
+
}): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<{
|
|
10
|
+
deviceId: string;
|
|
11
|
+
deviceType: "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer" | "UNRECOGNIZED";
|
|
12
|
+
} & Partial<import("@comapeo/core/dist/schema/client.js", { with: { "resolution-mode": "import" } }).DeviceInfoParam>, Error, {
|
|
13
|
+
deviceId: string;
|
|
14
|
+
deviceType: "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer" | "UNRECOGNIZED";
|
|
15
|
+
} & Partial<import("@comapeo/core/dist/schema/client.js", { with: { "resolution-mode": "import" } }).DeviceInfoParam>, readonly ["@comapeo/core-react", "client", "device_info"]>, "queryFn"> & {
|
|
16
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<{
|
|
17
|
+
deviceId: string;
|
|
18
|
+
deviceType: "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer" | "UNRECOGNIZED";
|
|
19
|
+
} & Partial<import("@comapeo/core/dist/schema/client.js", { with: { "resolution-mode": "import" } }).DeviceInfoParam>, readonly ["@comapeo/core-react", "client", "device_info"], never> | undefined;
|
|
20
|
+
} & {
|
|
21
|
+
queryKey: readonly ["@comapeo/core-react", "client", "device_info"] & {
|
|
22
|
+
[dataTagSymbol]: {
|
|
23
|
+
deviceId: string;
|
|
24
|
+
deviceType: "device_type_unspecified" | "mobile" | "tablet" | "desktop" | "selfHostedServer" | "UNRECOGNIZED";
|
|
25
|
+
} & Partial<import("@comapeo/core/dist/schema/client.js", { with: { "resolution-mode": "import" } }).DeviceInfoParam>;
|
|
26
|
+
[dataTagErrorSymbol]: Error;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare function isArchiveDeviceQueryOptions({ clientApi, }: {
|
|
30
|
+
clientApi: MapeoClientApi;
|
|
31
|
+
}): import("@tanstack/react-query").OmitKeyof<import("@tanstack/react-query").UseQueryOptions<boolean, Error, boolean, readonly ["@comapeo/core-react", "client", "is_archive_device"]>, "queryFn"> & {
|
|
32
|
+
queryFn?: import("@tanstack/react-query").QueryFunction<boolean, readonly ["@comapeo/core-react", "client", "is_archive_device"], never> | undefined;
|
|
33
|
+
} & {
|
|
34
|
+
queryKey: readonly ["@comapeo/core-react", "client", "is_archive_device"] & {
|
|
35
|
+
[dataTagSymbol]: boolean;
|
|
36
|
+
[dataTagErrorSymbol]: Error;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export declare function setOwnDeviceInfoMutationOptions({ clientApi, queryClient, }: {
|
|
40
|
+
clientApi: MapeoClientApi;
|
|
41
|
+
queryClient: QueryClient;
|
|
42
|
+
}): {
|
|
43
|
+
mutationFn: ({ name, deviceType }: {
|
|
44
|
+
name: string;
|
|
45
|
+
deviceType: DeviceInfo["deviceType"];
|
|
46
|
+
}) => Promise<void>;
|
|
47
|
+
onSuccess: () => void;
|
|
48
|
+
networkMode: "always";
|
|
49
|
+
retry: false;
|
|
50
|
+
};
|
|
51
|
+
export declare function setIsArchiveDeviceMutationOptions({ clientApi, queryClient, }: {
|
|
52
|
+
clientApi: MapeoClientApi;
|
|
53
|
+
queryClient: QueryClient;
|
|
54
|
+
}): {
|
|
55
|
+
mutationFn: ({ isArchiveDevice }: {
|
|
56
|
+
isArchiveDevice: boolean;
|
|
57
|
+
}) => Promise<void>;
|
|
58
|
+
onSuccess: () => void;
|
|
59
|
+
networkMode: "always";
|
|
60
|
+
retry: false;
|
|
61
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getClientQueryKey = getClientQueryKey;
|
|
4
|
+
exports.getDeviceInfoQueryKey = getDeviceInfoQueryKey;
|
|
5
|
+
exports.getIsArchiveDeviceQueryKey = getIsArchiveDeviceQueryKey;
|
|
6
|
+
exports.deviceInfoQueryOptions = deviceInfoQueryOptions;
|
|
7
|
+
exports.isArchiveDeviceQueryOptions = isArchiveDeviceQueryOptions;
|
|
8
|
+
exports.setOwnDeviceInfoMutationOptions = setOwnDeviceInfoMutationOptions;
|
|
9
|
+
exports.setIsArchiveDeviceMutationOptions = setIsArchiveDeviceMutationOptions;
|
|
10
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
11
|
+
const projects_js_1 = require("./projects.js");
|
|
12
|
+
const shared_js_1 = require("./shared.js");
|
|
13
|
+
function getClientQueryKey() {
|
|
14
|
+
return [shared_js_1.ROOT_QUERY_KEY, 'client'];
|
|
15
|
+
}
|
|
16
|
+
function getDeviceInfoQueryKey() {
|
|
17
|
+
return [shared_js_1.ROOT_QUERY_KEY, 'client', 'device_info'];
|
|
18
|
+
}
|
|
19
|
+
function getIsArchiveDeviceQueryKey() {
|
|
20
|
+
return [shared_js_1.ROOT_QUERY_KEY, 'client', 'is_archive_device'];
|
|
21
|
+
}
|
|
22
|
+
function deviceInfoQueryOptions({ clientApi, }) {
|
|
23
|
+
return (0, react_query_1.queryOptions)({
|
|
24
|
+
...(0, shared_js_1.baseQueryOptions)(),
|
|
25
|
+
queryKey: getDeviceInfoQueryKey(),
|
|
26
|
+
queryFn: async () => {
|
|
27
|
+
return clientApi.getDeviceInfo();
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function isArchiveDeviceQueryOptions({ clientApi, }) {
|
|
32
|
+
return (0, react_query_1.queryOptions)({
|
|
33
|
+
...(0, shared_js_1.baseQueryOptions)(),
|
|
34
|
+
queryKey: getIsArchiveDeviceQueryKey(),
|
|
35
|
+
queryFn: async () => {
|
|
36
|
+
return clientApi.getIsArchiveDevice();
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function setOwnDeviceInfoMutationOptions({ clientApi, queryClient, }) {
|
|
41
|
+
return {
|
|
42
|
+
...(0, shared_js_1.baseMutationOptions)(),
|
|
43
|
+
mutationFn: async ({ name, deviceType }) => {
|
|
44
|
+
return clientApi.setDeviceInfo({ name, deviceType });
|
|
45
|
+
},
|
|
46
|
+
onSuccess: () => {
|
|
47
|
+
queryClient.invalidateQueries({
|
|
48
|
+
queryKey: getDeviceInfoQueryKey(),
|
|
49
|
+
});
|
|
50
|
+
queryClient.invalidateQueries({
|
|
51
|
+
queryKey: (0, projects_js_1.getProjectsQueryKey)(),
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function setIsArchiveDeviceMutationOptions({ clientApi, queryClient, }) {
|
|
57
|
+
return {
|
|
58
|
+
...(0, shared_js_1.baseMutationOptions)(),
|
|
59
|
+
mutationFn: async ({ isArchiveDevice }) => {
|
|
60
|
+
return clientApi.setIsArchiveDevice(isArchiveDevice);
|
|
61
|
+
},
|
|
62
|
+
onSuccess: () => {
|
|
63
|
+
queryClient.invalidateQueries({
|
|
64
|
+
queryKey: getIsArchiveDeviceQueryKey(),
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|