@squonk/data-manager-client 4.2.0 → 4.3.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/accounting/accounting.cjs +96 -95
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.cts +47 -47
- package/accounting/accounting.d.ts +47 -47
- package/accounting/accounting.js +102 -101
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +120 -145
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.cts +121 -121
- package/admin/admin.d.ts +121 -121
- package/admin/admin.js +127 -152
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +39 -43
- package/application/application.cjs.map +1 -1
- package/application/application.d.cts +25 -25
- package/application/application.d.ts +25 -25
- package/application/application.js +42 -46
- package/application/application.js.map +1 -1
- package/chunk-OYRETEBZ.js +25 -0
- package/chunk-OYRETEBZ.js.map +1 -0
- package/{chunk-TKLTUR4R.cjs → chunk-RB2KVIEK.cjs} +1 -1
- package/chunk-RB2KVIEK.cjs.map +1 -0
- package/{chunk-EBOQPVLG.js → chunk-XYDLYMQ2.js} +1 -1
- package/chunk-XYDLYMQ2.js.map +1 -0
- package/chunk-ZLY5XEOQ.cjs +25 -0
- package/chunk-ZLY5XEOQ.cjs.map +1 -0
- package/configuration/configuration.cjs +38 -45
- package/configuration/configuration.cjs.map +1 -1
- package/configuration/configuration.d.cts +25 -25
- package/configuration/configuration.d.ts +25 -25
- package/configuration/configuration.js +42 -49
- package/configuration/configuration.js.map +1 -1
- package/dataset/dataset.cjs +126 -141
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.cts +102 -102
- package/dataset/dataset.d.ts +102 -102
- package/dataset/dataset.js +132 -147
- package/dataset/dataset.js.map +1 -1
- package/digest/digest.cjs +22 -24
- package/digest/digest.cjs.map +1 -1
- package/digest/digest.d.cts +14 -14
- package/digest/digest.d.ts +14 -14
- package/digest/digest.js +24 -26
- package/digest/digest.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs +111 -109
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.cts +69 -69
- package/exchange-rate/exchange-rate.d.ts +69 -69
- package/exchange-rate/exchange-rate.js +117 -115
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file-and-path/file-and-path.cjs +93 -138
- package/file-and-path/file-and-path.cjs.map +1 -1
- package/file-and-path/file-and-path.d.cts +102 -102
- package/file-and-path/file-and-path.d.ts +102 -102
- package/file-and-path/file-and-path.js +105 -150
- package/file-and-path/file-and-path.js.map +1 -1
- package/index.cjs +80 -102
- package/index.cjs.map +1 -1
- package/index.d.cts +2401 -2326
- package/index.d.ts +2401 -2326
- package/index.js +79 -101
- package/index.js.map +1 -1
- package/instance/instance.cjs +100 -107
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.cts +76 -76
- package/instance/instance.d.ts +76 -76
- package/instance/instance.js +105 -112
- package/instance/instance.js.map +1 -1
- package/inventory/inventory.cjs +22 -25
- package/inventory/inventory.cjs.map +1 -1
- package/inventory/inventory.d.cts +14 -14
- package/inventory/inventory.d.ts +14 -14
- package/inventory/inventory.js +24 -27
- package/inventory/inventory.js.map +1 -1
- package/job/job.cjs +55 -67
- package/job/job.cjs.map +1 -1
- package/job/job.d.cts +36 -36
- package/job/job.d.ts +36 -36
- package/job/job.js +60 -72
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +61 -59
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.cts +47 -47
- package/metadata/metadata.d.ts +47 -47
- package/metadata/metadata.js +65 -63
- package/metadata/metadata.js.map +1 -1
- package/package.json +13 -16
- package/project/project.cjs +165 -186
- package/project/project.cjs.map +1 -1
- package/project/project.d.cts +157 -157
- package/project/project.d.ts +157 -157
- package/project/project.js +172 -193
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +767 -461
- package/src/admin/admin.ts +1187 -787
- package/src/application/application.ts +377 -231
- package/src/configuration/configuration.ts +348 -237
- package/src/custom-instance.ts +3 -3
- package/src/data-manager-api.schemas.ts +2538 -2492
- package/src/dataset/dataset.ts +1199 -792
- package/src/digest/digest.ts +198 -122
- package/src/exchange-rate/exchange-rate.ts +1088 -612
- package/src/file-and-path/file-and-path.ts +869 -616
- package/src/index.ts +2 -2
- package/src/instance/instance.ts +804 -539
- package/src/inventory/inventory.ts +200 -122
- package/src/job/job.ts +556 -348
- package/src/metadata/metadata.ts +587 -371
- package/src/options-mutator.ts +27 -0
- package/src/project/project.ts +1576 -1034
- package/src/task/task.ts +434 -295
- package/src/type/type.ts +180 -126
- package/src/user/user.ts +846 -398
- package/src/workflow/workflow.ts +1750 -1089
- package/task/task.cjs +45 -59
- package/task/task.cjs.map +1 -1
- package/task/task.d.cts +33 -33
- package/task/task.d.ts +33 -33
- package/task/task.js +51 -65
- package/task/task.js.map +1 -1
- package/type/type.cjs +21 -26
- package/type/type.cjs.map +1 -1
- package/type/type.d.cts +14 -14
- package/type/type.d.ts +14 -14
- package/type/type.js +24 -29
- package/type/type.js.map +1 -1
- package/user/user.cjs +114 -80
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +107 -48
- package/user/user.d.ts +107 -48
- package/user/user.js +120 -86
- package/user/user.js.map +1 -1
- package/workflow/workflow.cjs +179 -193
- package/workflow/workflow.cjs.map +1 -1
- package/workflow/workflow.d.cts +146 -146
- package/workflow/workflow.d.ts +146 -146
- package/workflow/workflow.js +187 -201
- package/workflow/workflow.js.map +1 -1
- package/chunk-EBOQPVLG.js.map +0 -1
- package/chunk-TKLTUR4R.cjs.map +0 -1
package/src/project/project.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
/**
|
|
3
|
-
* Generated by orval v7.
|
|
2
|
+
* Generated by orval v7.10.0 🍺
|
|
4
3
|
* Do not edit manually.
|
|
5
4
|
* Dataset Manager API
|
|
6
5
|
* The Dataset Manager API service.
|
|
@@ -9,16 +8,13 @@ A service that allows *registered* users to make **Datasets** and associated **M
|
|
|
9
8
|
|
|
10
9
|
* OpenAPI spec version: 4.1
|
|
11
10
|
*/
|
|
12
|
-
import {
|
|
13
|
-
useMutation,
|
|
14
|
-
useQuery,
|
|
15
|
-
useSuspenseQuery
|
|
16
|
-
} from '@tanstack/react-query'
|
|
11
|
+
import { useMutation, useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
17
12
|
import type {
|
|
18
13
|
DataTag,
|
|
19
14
|
DefinedInitialDataOptions,
|
|
20
15
|
DefinedUseQueryResult,
|
|
21
16
|
MutationFunction,
|
|
17
|
+
QueryClient,
|
|
22
18
|
QueryFunction,
|
|
23
19
|
QueryKey,
|
|
24
20
|
UndefinedInitialDataOptions,
|
|
@@ -27,8 +23,9 @@ import type {
|
|
|
27
23
|
UseQueryOptions,
|
|
28
24
|
UseQueryResult,
|
|
29
25
|
UseSuspenseQueryOptions,
|
|
30
|
-
UseSuspenseQueryResult
|
|
31
|
-
} from
|
|
26
|
+
UseSuspenseQueryResult,
|
|
27
|
+
} from "@tanstack/react-query";
|
|
28
|
+
|
|
32
29
|
import type {
|
|
33
30
|
DmError,
|
|
34
31
|
GetProjectFileParams,
|
|
@@ -40,157 +37,235 @@ import type {
|
|
|
40
37
|
ProjectPostBodyBody,
|
|
41
38
|
ProjectPostResponse,
|
|
42
39
|
ProjectsGetResponse,
|
|
43
|
-
TaskIdentity
|
|
44
|
-
} from
|
|
45
|
-
import { customInstance } from '.././custom-instance';
|
|
46
|
-
import type { ErrorType } from '.././custom-instance';
|
|
47
|
-
|
|
40
|
+
TaskIdentity,
|
|
41
|
+
} from "../data-manager-api.schemas";
|
|
48
42
|
|
|
49
|
-
|
|
43
|
+
import { customInstance } from ".././custom-instance";
|
|
44
|
+
import type { ErrorType } from ".././custom-instance";
|
|
45
|
+
import { queryMutator } from ".././options-mutator";
|
|
46
|
+
import { mutationMutator } from ".././options-mutator";
|
|
50
47
|
|
|
48
|
+
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
51
49
|
|
|
52
50
|
/**
|
|
53
51
|
* @summary Get all Projects available to you
|
|
54
52
|
*/
|
|
55
53
|
export const getProjects = (
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
params?: GetProjectsParams,
|
|
55
|
+
options?: SecondParameter<typeof customInstance>,
|
|
56
|
+
signal?: AbortSignal,
|
|
58
57
|
) => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
export const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
58
|
+
return customInstance<ProjectsGetResponse>(
|
|
59
|
+
{ url: `/project`, method: "GET", params, signal },
|
|
60
|
+
options,
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const getGetProjectsQueryKey = (params?: GetProjectsParams) => {
|
|
65
|
+
return [`/project`, ...(params ? [params] : [])] as const;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const useGetProjectsQueryOptions = <
|
|
69
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
70
|
+
TError = ErrorType<void | DmError>,
|
|
71
|
+
>(
|
|
72
|
+
params?: GetProjectsParams,
|
|
73
|
+
options?: {
|
|
74
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>>;
|
|
75
|
+
request?: SecondParameter<typeof customInstance>;
|
|
76
|
+
},
|
|
75
77
|
) => {
|
|
78
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
76
79
|
|
|
77
|
-
const
|
|
80
|
+
const queryKey = queryOptions?.queryKey ?? getGetProjectsQueryKey(params);
|
|
78
81
|
|
|
79
|
-
const
|
|
82
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjects>>> = ({ signal }) =>
|
|
83
|
+
getProjects(params, requestOptions, signal);
|
|
80
84
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjects>>> = ({ signal }) => getProjects(params, requestOptions, signal);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
90
|
-
}
|
|
85
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
91
86
|
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
return customOptions as UseQueryOptions<
|
|
88
|
+
Awaited<ReturnType<typeof getProjects>>,
|
|
89
|
+
TError,
|
|
90
|
+
TData
|
|
91
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
92
|
+
};
|
|
94
93
|
|
|
94
|
+
export type GetProjectsQueryResult = NonNullable<Awaited<ReturnType<typeof getProjects>>>;
|
|
95
|
+
export type GetProjectsQueryError = ErrorType<void | DmError>;
|
|
95
96
|
|
|
96
|
-
export function useGetProjects<
|
|
97
|
-
|
|
97
|
+
export function useGetProjects<
|
|
98
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
99
|
+
TError = ErrorType<void | DmError>,
|
|
100
|
+
>(
|
|
101
|
+
params: undefined | GetProjectsParams,
|
|
102
|
+
options: {
|
|
103
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>> &
|
|
104
|
+
Pick<
|
|
98
105
|
DefinedInitialDataOptions<
|
|
99
106
|
Awaited<ReturnType<typeof getProjects>>,
|
|
100
107
|
TError,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
Awaited<ReturnType<typeof getProjects>>
|
|
109
|
+
>,
|
|
110
|
+
"initialData"
|
|
111
|
+
>;
|
|
112
|
+
request?: SecondParameter<typeof customInstance>;
|
|
113
|
+
},
|
|
114
|
+
queryClient?: QueryClient,
|
|
115
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
116
|
+
export function useGetProjects<
|
|
117
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
118
|
+
TError = ErrorType<void | DmError>,
|
|
119
|
+
>(
|
|
120
|
+
params?: GetProjectsParams,
|
|
121
|
+
options?: {
|
|
122
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>> &
|
|
123
|
+
Pick<
|
|
108
124
|
UndefinedInitialDataOptions<
|
|
109
125
|
Awaited<ReturnType<typeof getProjects>>,
|
|
110
126
|
TError,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
127
|
+
Awaited<ReturnType<typeof getProjects>>
|
|
128
|
+
>,
|
|
129
|
+
"initialData"
|
|
130
|
+
>;
|
|
131
|
+
request?: SecondParameter<typeof customInstance>;
|
|
132
|
+
},
|
|
133
|
+
queryClient?: QueryClient,
|
|
134
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
135
|
+
export function useGetProjects<
|
|
136
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
137
|
+
TError = ErrorType<void | DmError>,
|
|
138
|
+
>(
|
|
139
|
+
params?: GetProjectsParams,
|
|
140
|
+
options?: {
|
|
141
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>>;
|
|
142
|
+
request?: SecondParameter<typeof customInstance>;
|
|
143
|
+
},
|
|
144
|
+
queryClient?: QueryClient,
|
|
145
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
120
146
|
/**
|
|
121
147
|
* @summary Get all Projects available to you
|
|
122
148
|
*/
|
|
123
149
|
|
|
124
|
-
export function useGetProjects<
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
150
|
+
export function useGetProjects<
|
|
151
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
152
|
+
TError = ErrorType<void | DmError>,
|
|
153
|
+
>(
|
|
154
|
+
params?: GetProjectsParams,
|
|
155
|
+
options?: {
|
|
156
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>>;
|
|
157
|
+
request?: SecondParameter<typeof customInstance>;
|
|
158
|
+
},
|
|
159
|
+
queryClient?: QueryClient,
|
|
160
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
161
|
+
const queryOptions = useGetProjectsQueryOptions(params, options);
|
|
162
|
+
|
|
163
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
164
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
query.queryKey = queryOptions.queryKey;
|
|
134
168
|
|
|
135
169
|
return query;
|
|
136
170
|
}
|
|
137
171
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
172
|
+
export const useGetProjectsSuspenseQueryOptions = <
|
|
173
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
174
|
+
TError = ErrorType<void | DmError>,
|
|
175
|
+
>(
|
|
176
|
+
params?: GetProjectsParams,
|
|
177
|
+
options?: {
|
|
178
|
+
query?: Partial<
|
|
179
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>
|
|
180
|
+
>;
|
|
181
|
+
request?: SecondParameter<typeof customInstance>;
|
|
182
|
+
},
|
|
141
183
|
) => {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
export type GetProjectsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProjects
|
|
159
|
-
export type GetProjectsSuspenseQueryError = ErrorType<void | DmError
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
184
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
185
|
+
|
|
186
|
+
const queryKey = queryOptions?.queryKey ?? getGetProjectsQueryKey(params);
|
|
187
|
+
|
|
188
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjects>>> = ({ signal }) =>
|
|
189
|
+
getProjects(params, requestOptions, signal);
|
|
190
|
+
|
|
191
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
192
|
+
|
|
193
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
194
|
+
Awaited<ReturnType<typeof getProjects>>,
|
|
195
|
+
TError,
|
|
196
|
+
TData
|
|
197
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
export type GetProjectsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProjects>>>;
|
|
201
|
+
export type GetProjectsSuspenseQueryError = ErrorType<void | DmError>;
|
|
202
|
+
|
|
203
|
+
export function useGetProjectsSuspense<
|
|
204
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
205
|
+
TError = ErrorType<void | DmError>,
|
|
206
|
+
>(
|
|
207
|
+
params: undefined | GetProjectsParams,
|
|
208
|
+
options: {
|
|
209
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>>;
|
|
210
|
+
request?: SecondParameter<typeof customInstance>;
|
|
211
|
+
},
|
|
212
|
+
queryClient?: QueryClient,
|
|
213
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
214
|
+
export function useGetProjectsSuspense<
|
|
215
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
216
|
+
TError = ErrorType<void | DmError>,
|
|
217
|
+
>(
|
|
218
|
+
params?: GetProjectsParams,
|
|
219
|
+
options?: {
|
|
220
|
+
query?: Partial<
|
|
221
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>
|
|
222
|
+
>;
|
|
223
|
+
request?: SecondParameter<typeof customInstance>;
|
|
224
|
+
},
|
|
225
|
+
queryClient?: QueryClient,
|
|
226
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
227
|
+
export function useGetProjectsSuspense<
|
|
228
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
229
|
+
TError = ErrorType<void | DmError>,
|
|
230
|
+
>(
|
|
231
|
+
params?: GetProjectsParams,
|
|
232
|
+
options?: {
|
|
233
|
+
query?: Partial<
|
|
234
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>
|
|
235
|
+
>;
|
|
236
|
+
request?: SecondParameter<typeof customInstance>;
|
|
237
|
+
},
|
|
238
|
+
queryClient?: QueryClient,
|
|
239
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
174
240
|
/**
|
|
175
241
|
* @summary Get all Projects available to you
|
|
176
242
|
*/
|
|
177
243
|
|
|
178
|
-
export function useGetProjectsSuspense<
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
244
|
+
export function useGetProjectsSuspense<
|
|
245
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
246
|
+
TError = ErrorType<void | DmError>,
|
|
247
|
+
>(
|
|
248
|
+
params?: GetProjectsParams,
|
|
249
|
+
options?: {
|
|
250
|
+
query?: Partial<
|
|
251
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>
|
|
252
|
+
>;
|
|
253
|
+
request?: SecondParameter<typeof customInstance>;
|
|
254
|
+
},
|
|
255
|
+
queryClient?: QueryClient,
|
|
256
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
257
|
+
const queryOptions = useGetProjectsSuspenseQueryOptions(params, options);
|
|
258
|
+
|
|
259
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
260
|
+
TData,
|
|
261
|
+
TError
|
|
262
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
263
|
+
|
|
264
|
+
query.queryKey = queryOptions.queryKey;
|
|
188
265
|
|
|
189
266
|
return query;
|
|
190
267
|
}
|
|
191
268
|
|
|
192
|
-
|
|
193
|
-
|
|
194
269
|
/**
|
|
195
270
|
* Creates a new Project, assigning and returning a unique **ID**. A persistent volume is created in the cluster and assigned to your Project. It's here you can add **Datasets** as **Files** and run **Applications** and **Jobs**.
|
|
196
271
|
|
|
@@ -203,287 +278,402 @@ The name you give the Project is free-form text (can contain spaces etc.) but th
|
|
|
203
278
|
* @summary Create a new Project
|
|
204
279
|
*/
|
|
205
280
|
export const createProject = (
|
|
206
|
-
|
|
207
|
-
|
|
281
|
+
projectPostBodyBody: ProjectPostBodyBody,
|
|
282
|
+
options?: SecondParameter<typeof customInstance>,
|
|
283
|
+
signal?: AbortSignal,
|
|
208
284
|
) => {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
285
|
+
const formUrlEncoded = new URLSearchParams();
|
|
286
|
+
formUrlEncoded.append(`name`, projectPostBodyBody.name);
|
|
287
|
+
if (projectPostBodyBody.private !== undefined) {
|
|
288
|
+
formUrlEncoded.append(`private`, projectPostBodyBody.private.toString());
|
|
289
|
+
}
|
|
290
|
+
formUrlEncoded.append(`tier_product_id`, projectPostBodyBody.tier_product_id);
|
|
291
|
+
|
|
292
|
+
return customInstance<ProjectPostResponse>(
|
|
293
|
+
{
|
|
294
|
+
url: `/project`,
|
|
295
|
+
method: "POST",
|
|
296
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
297
|
+
data: formUrlEncoded,
|
|
298
|
+
signal,
|
|
221
299
|
},
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
300
|
+
options,
|
|
301
|
+
);
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
export const useCreateProjectMutationOptions = <
|
|
305
|
+
TError = ErrorType<DmError | void>,
|
|
306
|
+
TContext = unknown,
|
|
307
|
+
>(options?: {
|
|
308
|
+
mutation?: UseMutationOptions<
|
|
309
|
+
Awaited<ReturnType<typeof createProject>>,
|
|
310
|
+
TError,
|
|
311
|
+
{ data: ProjectPostBodyBody },
|
|
312
|
+
TContext
|
|
313
|
+
>;
|
|
314
|
+
request?: SecondParameter<typeof customInstance>;
|
|
315
|
+
}): UseMutationOptions<
|
|
316
|
+
Awaited<ReturnType<typeof createProject>>,
|
|
317
|
+
TError,
|
|
318
|
+
{ data: ProjectPostBodyBody },
|
|
319
|
+
TContext
|
|
320
|
+
> => {
|
|
321
|
+
const mutationKey = ["createProject"];
|
|
322
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
323
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
324
|
+
? options
|
|
325
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
326
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
327
|
+
|
|
328
|
+
const mutationFn: MutationFunction<
|
|
329
|
+
Awaited<ReturnType<typeof createProject>>,
|
|
330
|
+
{ data: ProjectPostBodyBody }
|
|
331
|
+
> = (props) => {
|
|
332
|
+
const { data } = props ?? {};
|
|
333
|
+
|
|
334
|
+
return createProject(data, requestOptions);
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
338
|
+
|
|
339
|
+
return customOptions;
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
export type CreateProjectMutationResult = NonNullable<Awaited<ReturnType<typeof createProject>>>;
|
|
343
|
+
export type CreateProjectMutationBody = ProjectPostBodyBody;
|
|
344
|
+
export type CreateProjectMutationError = ErrorType<DmError | void>;
|
|
225
345
|
|
|
226
|
-
|
|
227
|
-
export const getCreateProjectMutationOptions = <TData = Awaited<ReturnType<typeof createProject>>, TError = ErrorType<DmError | void>,
|
|
228
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{data: ProjectPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
229
|
-
) => {
|
|
230
|
-
const mutationKey = ['createProject'];
|
|
231
|
-
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
232
|
-
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
233
|
-
options
|
|
234
|
-
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
235
|
-
: {mutation: { mutationKey, }, request: undefined};
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof createProject>>, {data: ProjectPostBodyBody}> = (props) => {
|
|
241
|
-
const {data} = props ?? {};
|
|
242
|
-
|
|
243
|
-
return createProject(data,requestOptions)
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{data: ProjectPostBodyBody}, TContext>}
|
|
250
|
-
|
|
251
|
-
export type CreateProjectMutationResult = NonNullable<Awaited<ReturnType<typeof createProject>>>
|
|
252
|
-
export type CreateProjectMutationBody = ProjectPostBodyBody
|
|
253
|
-
export type CreateProjectMutationError = ErrorType<DmError | void>
|
|
254
|
-
|
|
255
|
-
/**
|
|
346
|
+
/**
|
|
256
347
|
* @summary Create a new Project
|
|
257
348
|
*/
|
|
258
|
-
export const useCreateProject = <
|
|
259
|
-
|
|
349
|
+
export const useCreateProject = <TError = ErrorType<DmError | void>, TContext = unknown>(
|
|
350
|
+
options?: {
|
|
351
|
+
mutation?: UseMutationOptions<
|
|
352
|
+
Awaited<ReturnType<typeof createProject>>,
|
|
353
|
+
TError,
|
|
354
|
+
{ data: ProjectPostBodyBody },
|
|
355
|
+
TContext
|
|
356
|
+
>;
|
|
357
|
+
request?: SecondParameter<typeof customInstance>;
|
|
358
|
+
},
|
|
359
|
+
queryClient?: QueryClient,
|
|
260
360
|
): UseMutationResult<
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
/**
|
|
361
|
+
Awaited<ReturnType<typeof createProject>>,
|
|
362
|
+
TError,
|
|
363
|
+
{ data: ProjectPostBodyBody },
|
|
364
|
+
TContext
|
|
365
|
+
> => {
|
|
366
|
+
const mutationOptions = useCreateProjectMutationOptions(options);
|
|
367
|
+
|
|
368
|
+
return useMutation(mutationOptions, queryClient);
|
|
369
|
+
};
|
|
370
|
+
/**
|
|
272
371
|
* Gets the details of a Project that is available to you.
|
|
273
372
|
|
|
274
373
|
* @summary Get a Project
|
|
275
374
|
*/
|
|
276
375
|
export const getProject = (
|
|
277
|
-
|
|
278
|
-
|
|
376
|
+
projectId: string,
|
|
377
|
+
options?: SecondParameter<typeof customInstance>,
|
|
378
|
+
signal?: AbortSignal,
|
|
279
379
|
) => {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
380
|
+
return customInstance<ProjectDetail>(
|
|
381
|
+
{ url: `/project/${projectId}`, method: "GET", signal },
|
|
382
|
+
options,
|
|
383
|
+
);
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
export const getGetProjectQueryKey = (projectId: string) => {
|
|
387
|
+
return [`/project/${projectId}`] as const;
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
export const useGetProjectQueryOptions = <
|
|
391
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
392
|
+
TError = ErrorType<void | DmError>,
|
|
393
|
+
>(
|
|
394
|
+
projectId: string,
|
|
395
|
+
options?: {
|
|
396
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>>;
|
|
397
|
+
request?: SecondParameter<typeof customInstance>;
|
|
398
|
+
},
|
|
295
399
|
) => {
|
|
400
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
296
401
|
|
|
297
|
-
const
|
|
402
|
+
const queryKey = queryOptions?.queryKey ?? getGetProjectQueryKey(projectId);
|
|
298
403
|
|
|
299
|
-
const
|
|
404
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProject>>> = ({ signal }) =>
|
|
405
|
+
getProject(projectId, requestOptions, signal);
|
|
300
406
|
|
|
301
|
-
|
|
407
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
302
408
|
|
|
303
|
-
|
|
409
|
+
return customOptions as UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData> & {
|
|
410
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
411
|
+
};
|
|
412
|
+
};
|
|
304
413
|
|
|
305
|
-
|
|
414
|
+
export type GetProjectQueryResult = NonNullable<Awaited<ReturnType<typeof getProject>>>;
|
|
415
|
+
export type GetProjectQueryError = ErrorType<void | DmError>;
|
|
306
416
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
export function useGetProject<TData = Awaited<ReturnType<typeof getProject>>, TError = ErrorType<void | DmError>>(
|
|
317
|
-
projectId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>> & Pick<
|
|
417
|
+
export function useGetProject<
|
|
418
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
419
|
+
TError = ErrorType<void | DmError>,
|
|
420
|
+
>(
|
|
421
|
+
projectId: string,
|
|
422
|
+
options: {
|
|
423
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>> &
|
|
424
|
+
Pick<
|
|
318
425
|
DefinedInitialDataOptions<
|
|
319
426
|
Awaited<ReturnType<typeof getProject>>,
|
|
320
427
|
TError,
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
428
|
+
Awaited<ReturnType<typeof getProject>>
|
|
429
|
+
>,
|
|
430
|
+
"initialData"
|
|
431
|
+
>;
|
|
432
|
+
request?: SecondParameter<typeof customInstance>;
|
|
433
|
+
},
|
|
434
|
+
queryClient?: QueryClient,
|
|
435
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
436
|
+
export function useGetProject<
|
|
437
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
438
|
+
TError = ErrorType<void | DmError>,
|
|
439
|
+
>(
|
|
440
|
+
projectId: string,
|
|
441
|
+
options?: {
|
|
442
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>> &
|
|
443
|
+
Pick<
|
|
328
444
|
UndefinedInitialDataOptions<
|
|
329
445
|
Awaited<ReturnType<typeof getProject>>,
|
|
330
446
|
TError,
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
447
|
+
Awaited<ReturnType<typeof getProject>>
|
|
448
|
+
>,
|
|
449
|
+
"initialData"
|
|
450
|
+
>;
|
|
451
|
+
request?: SecondParameter<typeof customInstance>;
|
|
452
|
+
},
|
|
453
|
+
queryClient?: QueryClient,
|
|
454
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
455
|
+
export function useGetProject<
|
|
456
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
457
|
+
TError = ErrorType<void | DmError>,
|
|
458
|
+
>(
|
|
459
|
+
projectId: string,
|
|
460
|
+
options?: {
|
|
461
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>>;
|
|
462
|
+
request?: SecondParameter<typeof customInstance>;
|
|
463
|
+
},
|
|
464
|
+
queryClient?: QueryClient,
|
|
465
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
340
466
|
/**
|
|
341
467
|
* @summary Get a Project
|
|
342
468
|
*/
|
|
343
469
|
|
|
344
|
-
export function useGetProject<
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
470
|
+
export function useGetProject<
|
|
471
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
472
|
+
TError = ErrorType<void | DmError>,
|
|
473
|
+
>(
|
|
474
|
+
projectId: string,
|
|
475
|
+
options?: {
|
|
476
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>>;
|
|
477
|
+
request?: SecondParameter<typeof customInstance>;
|
|
478
|
+
},
|
|
479
|
+
queryClient?: QueryClient,
|
|
480
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
481
|
+
const queryOptions = useGetProjectQueryOptions(projectId, options);
|
|
482
|
+
|
|
483
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
484
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
query.queryKey = queryOptions.queryKey;
|
|
354
488
|
|
|
355
489
|
return query;
|
|
356
490
|
}
|
|
357
491
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
492
|
+
export const useGetProjectSuspenseQueryOptions = <
|
|
493
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
494
|
+
TError = ErrorType<void | DmError>,
|
|
495
|
+
>(
|
|
496
|
+
projectId: string,
|
|
497
|
+
options?: {
|
|
498
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>>;
|
|
499
|
+
request?: SecondParameter<typeof customInstance>;
|
|
500
|
+
},
|
|
361
501
|
) => {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
export type GetProjectSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProject
|
|
379
|
-
export type GetProjectSuspenseQueryError = ErrorType<void | DmError
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
502
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
503
|
+
|
|
504
|
+
const queryKey = queryOptions?.queryKey ?? getGetProjectQueryKey(projectId);
|
|
505
|
+
|
|
506
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProject>>> = ({ signal }) =>
|
|
507
|
+
getProject(projectId, requestOptions, signal);
|
|
508
|
+
|
|
509
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
510
|
+
|
|
511
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
512
|
+
Awaited<ReturnType<typeof getProject>>,
|
|
513
|
+
TError,
|
|
514
|
+
TData
|
|
515
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
export type GetProjectSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProject>>>;
|
|
519
|
+
export type GetProjectSuspenseQueryError = ErrorType<void | DmError>;
|
|
520
|
+
|
|
521
|
+
export function useGetProjectSuspense<
|
|
522
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
523
|
+
TError = ErrorType<void | DmError>,
|
|
524
|
+
>(
|
|
525
|
+
projectId: string,
|
|
526
|
+
options: {
|
|
527
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>>;
|
|
528
|
+
request?: SecondParameter<typeof customInstance>;
|
|
529
|
+
},
|
|
530
|
+
queryClient?: QueryClient,
|
|
531
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
532
|
+
export function useGetProjectSuspense<
|
|
533
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
534
|
+
TError = ErrorType<void | DmError>,
|
|
535
|
+
>(
|
|
536
|
+
projectId: string,
|
|
537
|
+
options?: {
|
|
538
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>>;
|
|
539
|
+
request?: SecondParameter<typeof customInstance>;
|
|
540
|
+
},
|
|
541
|
+
queryClient?: QueryClient,
|
|
542
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
543
|
+
export function useGetProjectSuspense<
|
|
544
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
545
|
+
TError = ErrorType<void | DmError>,
|
|
546
|
+
>(
|
|
547
|
+
projectId: string,
|
|
548
|
+
options?: {
|
|
549
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>>;
|
|
550
|
+
request?: SecondParameter<typeof customInstance>;
|
|
551
|
+
},
|
|
552
|
+
queryClient?: QueryClient,
|
|
553
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
394
554
|
/**
|
|
395
555
|
* @summary Get a Project
|
|
396
556
|
*/
|
|
397
557
|
|
|
398
|
-
export function useGetProjectSuspense<
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
558
|
+
export function useGetProjectSuspense<
|
|
559
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
560
|
+
TError = ErrorType<void | DmError>,
|
|
561
|
+
>(
|
|
562
|
+
projectId: string,
|
|
563
|
+
options?: {
|
|
564
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>>;
|
|
565
|
+
request?: SecondParameter<typeof customInstance>;
|
|
566
|
+
},
|
|
567
|
+
queryClient?: QueryClient,
|
|
568
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
569
|
+
const queryOptions = useGetProjectSuspenseQueryOptions(projectId, options);
|
|
570
|
+
|
|
571
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
572
|
+
TData,
|
|
573
|
+
TError
|
|
574
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
575
|
+
|
|
576
|
+
query.queryKey = queryOptions.queryKey;
|
|
408
577
|
|
|
409
578
|
return query;
|
|
410
579
|
}
|
|
411
580
|
|
|
412
|
-
|
|
413
|
-
|
|
414
581
|
/**
|
|
415
582
|
* Used to update some adjustable parameters of a Project, i.e. to make it `private` or make it `public``. What can be adjusted will depend on the purchased **Product**
|
|
416
583
|
|
|
417
584
|
* @summary Adjust an existing Project
|
|
418
585
|
*/
|
|
419
586
|
export const patchProject = (
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
const formUrlEncoded = new URLSearchParams();
|
|
425
|
-
if(projectPatchBodyBody.private !== undefined) {
|
|
426
|
-
formUrlEncoded.append('private', projectPatchBodyBody.private.toString())
|
|
427
|
-
}
|
|
428
|
-
if(projectPatchBodyBody.name !== undefined) {
|
|
429
|
-
formUrlEncoded.append('name', projectPatchBodyBody.name)
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
return customInstance<void>(
|
|
433
|
-
{url: `/project/${projectId}`, method: 'PATCH',
|
|
434
|
-
headers: {'Content-Type': 'application/x-www-form-urlencoded', },
|
|
435
|
-
data: formUrlEncoded
|
|
436
|
-
},
|
|
437
|
-
options);
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
export const getPatchProjectMutationOptions = <TData = Awaited<ReturnType<typeof patchProject>>, TError = ErrorType<void | DmError>,
|
|
443
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{projectId: string;data: ProjectPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
587
|
+
projectId: string,
|
|
588
|
+
projectPatchBodyBody: ProjectPatchBodyBody,
|
|
589
|
+
options?: SecondParameter<typeof customInstance>,
|
|
444
590
|
) => {
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
591
|
+
const formUrlEncoded = new URLSearchParams();
|
|
592
|
+
if (projectPatchBodyBody.private !== undefined) {
|
|
593
|
+
formUrlEncoded.append(`private`, projectPatchBodyBody.private.toString());
|
|
594
|
+
}
|
|
595
|
+
if (projectPatchBodyBody.name !== undefined) {
|
|
596
|
+
formUrlEncoded.append(`name`, projectPatchBodyBody.name);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
return customInstance<void>(
|
|
600
|
+
{
|
|
601
|
+
url: `/project/${projectId}`,
|
|
602
|
+
method: "PATCH",
|
|
603
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
604
|
+
data: formUrlEncoded,
|
|
605
|
+
},
|
|
606
|
+
options,
|
|
607
|
+
);
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
export const usePatchProjectMutationOptions = <
|
|
611
|
+
TError = ErrorType<void | DmError>,
|
|
612
|
+
TContext = unknown,
|
|
613
|
+
>(options?: {
|
|
614
|
+
mutation?: UseMutationOptions<
|
|
615
|
+
Awaited<ReturnType<typeof patchProject>>,
|
|
616
|
+
TError,
|
|
617
|
+
{ projectId: string; data: ProjectPatchBodyBody },
|
|
618
|
+
TContext
|
|
619
|
+
>;
|
|
620
|
+
request?: SecondParameter<typeof customInstance>;
|
|
621
|
+
}): UseMutationOptions<
|
|
622
|
+
Awaited<ReturnType<typeof patchProject>>,
|
|
623
|
+
TError,
|
|
624
|
+
{ projectId: string; data: ProjectPatchBodyBody },
|
|
625
|
+
TContext
|
|
626
|
+
> => {
|
|
627
|
+
const mutationKey = ["patchProject"];
|
|
628
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
629
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
630
|
+
? options
|
|
631
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
632
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
633
|
+
|
|
634
|
+
const mutationFn: MutationFunction<
|
|
635
|
+
Awaited<ReturnType<typeof patchProject>>,
|
|
636
|
+
{ projectId: string; data: ProjectPatchBodyBody }
|
|
637
|
+
> = (props) => {
|
|
638
|
+
const { projectId, data } = props ?? {};
|
|
639
|
+
|
|
640
|
+
return patchProject(projectId, data, requestOptions);
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
644
|
+
|
|
645
|
+
return customOptions;
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
export type PatchProjectMutationResult = NonNullable<Awaited<ReturnType<typeof patchProject>>>;
|
|
649
|
+
export type PatchProjectMutationBody = ProjectPatchBodyBody;
|
|
650
|
+
export type PatchProjectMutationError = ErrorType<void | DmError>;
|
|
469
651
|
|
|
470
|
-
|
|
652
|
+
/**
|
|
471
653
|
* @summary Adjust an existing Project
|
|
472
654
|
*/
|
|
473
|
-
export const usePatchProject = <
|
|
474
|
-
|
|
655
|
+
export const usePatchProject = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
656
|
+
options?: {
|
|
657
|
+
mutation?: UseMutationOptions<
|
|
658
|
+
Awaited<ReturnType<typeof patchProject>>,
|
|
659
|
+
TError,
|
|
660
|
+
{ projectId: string; data: ProjectPatchBodyBody },
|
|
661
|
+
TContext
|
|
662
|
+
>;
|
|
663
|
+
request?: SecondParameter<typeof customInstance>;
|
|
664
|
+
},
|
|
665
|
+
queryClient?: QueryClient,
|
|
475
666
|
): UseMutationResult<
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
/**
|
|
667
|
+
Awaited<ReturnType<typeof patchProject>>,
|
|
668
|
+
TError,
|
|
669
|
+
{ projectId: string; data: ProjectPatchBodyBody },
|
|
670
|
+
TContext
|
|
671
|
+
> => {
|
|
672
|
+
const mutationOptions = usePatchProjectMutationOptions(options);
|
|
673
|
+
|
|
674
|
+
return useMutation(mutationOptions, queryClient);
|
|
675
|
+
};
|
|
676
|
+
/**
|
|
487
677
|
* Deletes an existing Project.
|
|
488
678
|
|
|
489
679
|
You must be an `administrator` of the project.
|
|
@@ -493,63 +683,79 @@ Once deleted all **Files**, working directories and material in the Project will
|
|
|
493
683
|
* @summary Delete a Project
|
|
494
684
|
*/
|
|
495
685
|
export const deleteProject = (
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
return customInstance<TaskIdentity>(
|
|
501
|
-
{url: `/project/${projectId}`, method: 'DELETE'
|
|
502
|
-
},
|
|
503
|
-
options);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
export const getDeleteProjectMutationOptions = <TData = Awaited<ReturnType<typeof deleteProject>>, TError = ErrorType<void | DmError>,
|
|
509
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{projectId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
686
|
+
projectId: string,
|
|
687
|
+
options?: SecondParameter<typeof customInstance>,
|
|
510
688
|
) => {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
689
|
+
return customInstance<TaskIdentity>({ url: `/project/${projectId}`, method: "DELETE" }, options);
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
export const useDeleteProjectMutationOptions = <
|
|
693
|
+
TError = ErrorType<void | DmError>,
|
|
694
|
+
TContext = unknown,
|
|
695
|
+
>(options?: {
|
|
696
|
+
mutation?: UseMutationOptions<
|
|
697
|
+
Awaited<ReturnType<typeof deleteProject>>,
|
|
698
|
+
TError,
|
|
699
|
+
{ projectId: string },
|
|
700
|
+
TContext
|
|
701
|
+
>;
|
|
702
|
+
request?: SecondParameter<typeof customInstance>;
|
|
703
|
+
}): UseMutationOptions<
|
|
704
|
+
Awaited<ReturnType<typeof deleteProject>>,
|
|
705
|
+
TError,
|
|
706
|
+
{ projectId: string },
|
|
707
|
+
TContext
|
|
708
|
+
> => {
|
|
709
|
+
const mutationKey = ["deleteProject"];
|
|
710
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
711
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
712
|
+
? options
|
|
713
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
714
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
715
|
+
|
|
716
|
+
const mutationFn: MutationFunction<
|
|
717
|
+
Awaited<ReturnType<typeof deleteProject>>,
|
|
718
|
+
{ projectId: string }
|
|
719
|
+
> = (props) => {
|
|
720
|
+
const { projectId } = props ?? {};
|
|
721
|
+
|
|
722
|
+
return deleteProject(projectId, requestOptions);
|
|
723
|
+
};
|
|
724
|
+
|
|
725
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
726
|
+
|
|
727
|
+
return customOptions;
|
|
728
|
+
};
|
|
729
|
+
|
|
730
|
+
export type DeleteProjectMutationResult = NonNullable<Awaited<ReturnType<typeof deleteProject>>>;
|
|
731
|
+
|
|
732
|
+
export type DeleteProjectMutationError = ErrorType<void | DmError>;
|
|
531
733
|
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
export type DeleteProjectMutationError = ErrorType<void | DmError>
|
|
535
|
-
|
|
536
|
-
/**
|
|
734
|
+
/**
|
|
537
735
|
* @summary Delete a Project
|
|
538
736
|
*/
|
|
539
|
-
export const useDeleteProject = <
|
|
540
|
-
|
|
737
|
+
export const useDeleteProject = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
738
|
+
options?: {
|
|
739
|
+
mutation?: UseMutationOptions<
|
|
740
|
+
Awaited<ReturnType<typeof deleteProject>>,
|
|
741
|
+
TError,
|
|
742
|
+
{ projectId: string },
|
|
743
|
+
TContext
|
|
744
|
+
>;
|
|
745
|
+
request?: SecondParameter<typeof customInstance>;
|
|
746
|
+
},
|
|
747
|
+
queryClient?: QueryClient,
|
|
541
748
|
): UseMutationResult<
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
/**
|
|
749
|
+
Awaited<ReturnType<typeof deleteProject>>,
|
|
750
|
+
TError,
|
|
751
|
+
{ projectId: string },
|
|
752
|
+
TContext
|
|
753
|
+
> => {
|
|
754
|
+
const mutationOptions = useDeleteProjectMutationOptions(options);
|
|
755
|
+
|
|
756
|
+
return useMutation(mutationOptions, queryClient);
|
|
757
|
+
};
|
|
758
|
+
/**
|
|
553
759
|
* Adds a user to a Project as an `administrator`. As well as the ability to edit the project administrators can add and remove other users.
|
|
554
760
|
|
|
555
761
|
You must be an `administrator` of the project
|
|
@@ -557,64 +763,88 @@ You must be an `administrator` of the project
|
|
|
557
763
|
* @summary Add a Project Administrator
|
|
558
764
|
*/
|
|
559
765
|
export const addAdministratorToProject = (
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
return customInstance<void>(
|
|
566
|
-
{url: `/project/${projectId}/administrator/${userId}`, method: 'PUT'
|
|
567
|
-
},
|
|
568
|
-
options);
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
export const getAddAdministratorToProjectMutationOptions = <TData = Awaited<ReturnType<typeof addAdministratorToProject>>, TError = ErrorType<void | DmError>,
|
|
574
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{projectId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
766
|
+
projectId: string,
|
|
767
|
+
userId: string,
|
|
768
|
+
options?: SecondParameter<typeof customInstance>,
|
|
575
769
|
) => {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
770
|
+
return customInstance<void>(
|
|
771
|
+
{ url: `/project/${projectId}/administrator/${userId}`, method: "PUT" },
|
|
772
|
+
options,
|
|
773
|
+
);
|
|
774
|
+
};
|
|
775
|
+
|
|
776
|
+
export const useAddAdministratorToProjectMutationOptions = <
|
|
777
|
+
TError = ErrorType<void | DmError>,
|
|
778
|
+
TContext = unknown,
|
|
779
|
+
>(options?: {
|
|
780
|
+
mutation?: UseMutationOptions<
|
|
781
|
+
Awaited<ReturnType<typeof addAdministratorToProject>>,
|
|
782
|
+
TError,
|
|
783
|
+
{ projectId: string; userId: string },
|
|
784
|
+
TContext
|
|
785
|
+
>;
|
|
786
|
+
request?: SecondParameter<typeof customInstance>;
|
|
787
|
+
}): UseMutationOptions<
|
|
788
|
+
Awaited<ReturnType<typeof addAdministratorToProject>>,
|
|
789
|
+
TError,
|
|
790
|
+
{ projectId: string; userId: string },
|
|
791
|
+
TContext
|
|
792
|
+
> => {
|
|
793
|
+
const mutationKey = ["addAdministratorToProject"];
|
|
794
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
795
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
796
|
+
? options
|
|
797
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
798
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
799
|
+
|
|
800
|
+
const mutationFn: MutationFunction<
|
|
801
|
+
Awaited<ReturnType<typeof addAdministratorToProject>>,
|
|
802
|
+
{ projectId: string; userId: string }
|
|
803
|
+
> = (props) => {
|
|
804
|
+
const { projectId, userId } = props ?? {};
|
|
805
|
+
|
|
806
|
+
return addAdministratorToProject(projectId, userId, requestOptions);
|
|
807
|
+
};
|
|
808
|
+
|
|
809
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
810
|
+
|
|
811
|
+
return customOptions;
|
|
812
|
+
};
|
|
813
|
+
|
|
814
|
+
export type AddAdministratorToProjectMutationResult = NonNullable<
|
|
815
|
+
Awaited<ReturnType<typeof addAdministratorToProject>>
|
|
816
|
+
>;
|
|
817
|
+
|
|
818
|
+
export type AddAdministratorToProjectMutationError = ErrorType<void | DmError>;
|
|
585
819
|
|
|
586
|
-
|
|
587
|
-
const {projectId,userId} = props ?? {};
|
|
588
|
-
|
|
589
|
-
return addAdministratorToProject(projectId,userId,requestOptions)
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{projectId: string;userId: string}, TContext>}
|
|
596
|
-
|
|
597
|
-
export type AddAdministratorToProjectMutationResult = NonNullable<Awaited<ReturnType<typeof addAdministratorToProject>>>
|
|
598
|
-
|
|
599
|
-
export type AddAdministratorToProjectMutationError = ErrorType<void | DmError>
|
|
600
|
-
|
|
601
|
-
/**
|
|
820
|
+
/**
|
|
602
821
|
* @summary Add a Project Administrator
|
|
603
822
|
*/
|
|
604
|
-
export const useAddAdministratorToProject = <
|
|
605
|
-
|
|
823
|
+
export const useAddAdministratorToProject = <
|
|
824
|
+
TError = ErrorType<void | DmError>,
|
|
825
|
+
TContext = unknown,
|
|
826
|
+
>(
|
|
827
|
+
options?: {
|
|
828
|
+
mutation?: UseMutationOptions<
|
|
829
|
+
Awaited<ReturnType<typeof addAdministratorToProject>>,
|
|
830
|
+
TError,
|
|
831
|
+
{ projectId: string; userId: string },
|
|
832
|
+
TContext
|
|
833
|
+
>;
|
|
834
|
+
request?: SecondParameter<typeof customInstance>;
|
|
835
|
+
},
|
|
836
|
+
queryClient?: QueryClient,
|
|
606
837
|
): UseMutationResult<
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
/**
|
|
838
|
+
Awaited<ReturnType<typeof addAdministratorToProject>>,
|
|
839
|
+
TError,
|
|
840
|
+
{ projectId: string; userId: string },
|
|
841
|
+
TContext
|
|
842
|
+
> => {
|
|
843
|
+
const mutationOptions = useAddAdministratorToProjectMutationOptions(options);
|
|
844
|
+
|
|
845
|
+
return useMutation(mutationOptions, queryClient);
|
|
846
|
+
};
|
|
847
|
+
/**
|
|
618
848
|
* Deletes a project `administrator`. The administrator can be you.
|
|
619
849
|
|
|
620
850
|
A project must always have one `administrator` so you will not be able to delete the last administrator of a project.
|
|
@@ -624,64 +854,88 @@ You must be an `administrator` of the project
|
|
|
624
854
|
* @summary Delete a Project Administrator
|
|
625
855
|
*/
|
|
626
856
|
export const removeAdministratorFromProject = (
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
return customInstance<void>(
|
|
633
|
-
{url: `/project/${projectId}/administrator/${userId}`, method: 'DELETE'
|
|
634
|
-
},
|
|
635
|
-
options);
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
export const getRemoveAdministratorFromProjectMutationOptions = <TData = Awaited<ReturnType<typeof removeAdministratorFromProject>>, TError = ErrorType<DmError | void>,
|
|
641
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{projectId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
857
|
+
projectId: string,
|
|
858
|
+
userId: string,
|
|
859
|
+
options?: SecondParameter<typeof customInstance>,
|
|
642
860
|
) => {
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
861
|
+
return customInstance<void>(
|
|
862
|
+
{ url: `/project/${projectId}/administrator/${userId}`, method: "DELETE" },
|
|
863
|
+
options,
|
|
864
|
+
);
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
export const useRemoveAdministratorFromProjectMutationOptions = <
|
|
868
|
+
TError = ErrorType<DmError | void>,
|
|
869
|
+
TContext = unknown,
|
|
870
|
+
>(options?: {
|
|
871
|
+
mutation?: UseMutationOptions<
|
|
872
|
+
Awaited<ReturnType<typeof removeAdministratorFromProject>>,
|
|
873
|
+
TError,
|
|
874
|
+
{ projectId: string; userId: string },
|
|
875
|
+
TContext
|
|
876
|
+
>;
|
|
877
|
+
request?: SecondParameter<typeof customInstance>;
|
|
878
|
+
}): UseMutationOptions<
|
|
879
|
+
Awaited<ReturnType<typeof removeAdministratorFromProject>>,
|
|
880
|
+
TError,
|
|
881
|
+
{ projectId: string; userId: string },
|
|
882
|
+
TContext
|
|
883
|
+
> => {
|
|
884
|
+
const mutationKey = ["removeAdministratorFromProject"];
|
|
885
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
886
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
887
|
+
? options
|
|
888
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
889
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
890
|
+
|
|
891
|
+
const mutationFn: MutationFunction<
|
|
892
|
+
Awaited<ReturnType<typeof removeAdministratorFromProject>>,
|
|
893
|
+
{ projectId: string; userId: string }
|
|
894
|
+
> = (props) => {
|
|
895
|
+
const { projectId, userId } = props ?? {};
|
|
896
|
+
|
|
897
|
+
return removeAdministratorFromProject(projectId, userId, requestOptions);
|
|
898
|
+
};
|
|
899
|
+
|
|
900
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
901
|
+
|
|
902
|
+
return customOptions;
|
|
903
|
+
};
|
|
904
|
+
|
|
905
|
+
export type RemoveAdministratorFromProjectMutationResult = NonNullable<
|
|
906
|
+
Awaited<ReturnType<typeof removeAdministratorFromProject>>
|
|
907
|
+
>;
|
|
908
|
+
|
|
909
|
+
export type RemoveAdministratorFromProjectMutationError = ErrorType<DmError | void>;
|
|
661
910
|
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
export type RemoveAdministratorFromProjectMutationResult = NonNullable<Awaited<ReturnType<typeof removeAdministratorFromProject>>>
|
|
665
|
-
|
|
666
|
-
export type RemoveAdministratorFromProjectMutationError = ErrorType<DmError | void>
|
|
667
|
-
|
|
668
|
-
/**
|
|
911
|
+
/**
|
|
669
912
|
* @summary Delete a Project Administrator
|
|
670
913
|
*/
|
|
671
|
-
export const useRemoveAdministratorFromProject = <
|
|
672
|
-
|
|
914
|
+
export const useRemoveAdministratorFromProject = <
|
|
915
|
+
TError = ErrorType<DmError | void>,
|
|
916
|
+
TContext = unknown,
|
|
917
|
+
>(
|
|
918
|
+
options?: {
|
|
919
|
+
mutation?: UseMutationOptions<
|
|
920
|
+
Awaited<ReturnType<typeof removeAdministratorFromProject>>,
|
|
921
|
+
TError,
|
|
922
|
+
{ projectId: string; userId: string },
|
|
923
|
+
TContext
|
|
924
|
+
>;
|
|
925
|
+
request?: SecondParameter<typeof customInstance>;
|
|
926
|
+
},
|
|
927
|
+
queryClient?: QueryClient,
|
|
673
928
|
): UseMutationResult<
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
/**
|
|
929
|
+
Awaited<ReturnType<typeof removeAdministratorFromProject>>,
|
|
930
|
+
TError,
|
|
931
|
+
{ projectId: string; userId: string },
|
|
932
|
+
TContext
|
|
933
|
+
> => {
|
|
934
|
+
const mutationOptions = useRemoveAdministratorFromProjectMutationOptions(options);
|
|
935
|
+
|
|
936
|
+
return useMutation(mutationOptions, queryClient);
|
|
937
|
+
};
|
|
938
|
+
/**
|
|
685
939
|
* Adds a user to a Project as an `editor`. Editors can add and remove datasets in a project and delete the project.
|
|
686
940
|
|
|
687
941
|
An `editor` of a project is not automatically an `editor` of any datasets the project contains.
|
|
@@ -691,64 +945,85 @@ You must be an `administrator` of the project
|
|
|
691
945
|
* @summary Add a Project Editor
|
|
692
946
|
*/
|
|
693
947
|
export const addEditorToProject = (
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
return customInstance<void>(
|
|
700
|
-
{url: `/project/${projectId}/editor/${userId}`, method: 'PUT'
|
|
701
|
-
},
|
|
702
|
-
options);
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
export const getAddEditorToProjectMutationOptions = <TData = Awaited<ReturnType<typeof addEditorToProject>>, TError = ErrorType<void | DmError>,
|
|
708
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{projectId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
948
|
+
projectId: string,
|
|
949
|
+
userId: string,
|
|
950
|
+
options?: SecondParameter<typeof customInstance>,
|
|
709
951
|
) => {
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
952
|
+
return customInstance<void>(
|
|
953
|
+
{ url: `/project/${projectId}/editor/${userId}`, method: "PUT" },
|
|
954
|
+
options,
|
|
955
|
+
);
|
|
956
|
+
};
|
|
957
|
+
|
|
958
|
+
export const useAddEditorToProjectMutationOptions = <
|
|
959
|
+
TError = ErrorType<void | DmError>,
|
|
960
|
+
TContext = unknown,
|
|
961
|
+
>(options?: {
|
|
962
|
+
mutation?: UseMutationOptions<
|
|
963
|
+
Awaited<ReturnType<typeof addEditorToProject>>,
|
|
964
|
+
TError,
|
|
965
|
+
{ projectId: string; userId: string },
|
|
966
|
+
TContext
|
|
967
|
+
>;
|
|
968
|
+
request?: SecondParameter<typeof customInstance>;
|
|
969
|
+
}): UseMutationOptions<
|
|
970
|
+
Awaited<ReturnType<typeof addEditorToProject>>,
|
|
971
|
+
TError,
|
|
972
|
+
{ projectId: string; userId: string },
|
|
973
|
+
TContext
|
|
974
|
+
> => {
|
|
975
|
+
const mutationKey = ["addEditorToProject"];
|
|
976
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
977
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
978
|
+
? options
|
|
979
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
980
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
981
|
+
|
|
982
|
+
const mutationFn: MutationFunction<
|
|
983
|
+
Awaited<ReturnType<typeof addEditorToProject>>,
|
|
984
|
+
{ projectId: string; userId: string }
|
|
985
|
+
> = (props) => {
|
|
986
|
+
const { projectId, userId } = props ?? {};
|
|
987
|
+
|
|
988
|
+
return addEditorToProject(projectId, userId, requestOptions);
|
|
989
|
+
};
|
|
990
|
+
|
|
991
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
992
|
+
|
|
993
|
+
return customOptions;
|
|
994
|
+
};
|
|
995
|
+
|
|
996
|
+
export type AddEditorToProjectMutationResult = NonNullable<
|
|
997
|
+
Awaited<ReturnType<typeof addEditorToProject>>
|
|
998
|
+
>;
|
|
999
|
+
|
|
1000
|
+
export type AddEditorToProjectMutationError = ErrorType<void | DmError>;
|
|
716
1001
|
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof addEditorToProject>>, {projectId: string;userId: string}> = (props) => {
|
|
721
|
-
const {projectId,userId} = props ?? {};
|
|
722
|
-
|
|
723
|
-
return addEditorToProject(projectId,userId,requestOptions)
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{projectId: string;userId: string}, TContext>}
|
|
730
|
-
|
|
731
|
-
export type AddEditorToProjectMutationResult = NonNullable<Awaited<ReturnType<typeof addEditorToProject>>>
|
|
732
|
-
|
|
733
|
-
export type AddEditorToProjectMutationError = ErrorType<void | DmError>
|
|
734
|
-
|
|
735
|
-
/**
|
|
1002
|
+
/**
|
|
736
1003
|
* @summary Add a Project Editor
|
|
737
1004
|
*/
|
|
738
|
-
export const useAddEditorToProject = <
|
|
739
|
-
|
|
1005
|
+
export const useAddEditorToProject = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
1006
|
+
options?: {
|
|
1007
|
+
mutation?: UseMutationOptions<
|
|
1008
|
+
Awaited<ReturnType<typeof addEditorToProject>>,
|
|
1009
|
+
TError,
|
|
1010
|
+
{ projectId: string; userId: string },
|
|
1011
|
+
TContext
|
|
1012
|
+
>;
|
|
1013
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1014
|
+
},
|
|
1015
|
+
queryClient?: QueryClient,
|
|
740
1016
|
): UseMutationResult<
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
/**
|
|
1017
|
+
Awaited<ReturnType<typeof addEditorToProject>>,
|
|
1018
|
+
TError,
|
|
1019
|
+
{ projectId: string; userId: string },
|
|
1020
|
+
TContext
|
|
1021
|
+
> => {
|
|
1022
|
+
const mutationOptions = useAddEditorToProjectMutationOptions(options);
|
|
1023
|
+
|
|
1024
|
+
return useMutation(mutationOptions, queryClient);
|
|
1025
|
+
};
|
|
1026
|
+
/**
|
|
752
1027
|
* Deletes a project `editor`. The editor can be you.
|
|
753
1028
|
|
|
754
1029
|
A project must always have one `editor` so you will not be able to delete the last editor of a project.
|
|
@@ -758,64 +1033,85 @@ You must be an `administrator` of the project
|
|
|
758
1033
|
* @summary Delete a Project Editor
|
|
759
1034
|
*/
|
|
760
1035
|
export const removeEditorFromProject = (
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
return customInstance<void>(
|
|
767
|
-
{url: `/project/${projectId}/editor/${userId}`, method: 'DELETE'
|
|
768
|
-
},
|
|
769
|
-
options);
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
export const getRemoveEditorFromProjectMutationOptions = <TData = Awaited<ReturnType<typeof removeEditorFromProject>>, TError = ErrorType<DmError | void>,
|
|
775
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{projectId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
1036
|
+
projectId: string,
|
|
1037
|
+
userId: string,
|
|
1038
|
+
options?: SecondParameter<typeof customInstance>,
|
|
776
1039
|
) => {
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
1040
|
+
return customInstance<void>(
|
|
1041
|
+
{ url: `/project/${projectId}/editor/${userId}`, method: "DELETE" },
|
|
1042
|
+
options,
|
|
1043
|
+
);
|
|
1044
|
+
};
|
|
1045
|
+
|
|
1046
|
+
export const useRemoveEditorFromProjectMutationOptions = <
|
|
1047
|
+
TError = ErrorType<DmError | void>,
|
|
1048
|
+
TContext = unknown,
|
|
1049
|
+
>(options?: {
|
|
1050
|
+
mutation?: UseMutationOptions<
|
|
1051
|
+
Awaited<ReturnType<typeof removeEditorFromProject>>,
|
|
1052
|
+
TError,
|
|
1053
|
+
{ projectId: string; userId: string },
|
|
1054
|
+
TContext
|
|
1055
|
+
>;
|
|
1056
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1057
|
+
}): UseMutationOptions<
|
|
1058
|
+
Awaited<ReturnType<typeof removeEditorFromProject>>,
|
|
1059
|
+
TError,
|
|
1060
|
+
{ projectId: string; userId: string },
|
|
1061
|
+
TContext
|
|
1062
|
+
> => {
|
|
1063
|
+
const mutationKey = ["removeEditorFromProject"];
|
|
1064
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
1065
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
1066
|
+
? options
|
|
1067
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1068
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
1069
|
+
|
|
1070
|
+
const mutationFn: MutationFunction<
|
|
1071
|
+
Awaited<ReturnType<typeof removeEditorFromProject>>,
|
|
1072
|
+
{ projectId: string; userId: string }
|
|
1073
|
+
> = (props) => {
|
|
1074
|
+
const { projectId, userId } = props ?? {};
|
|
1075
|
+
|
|
1076
|
+
return removeEditorFromProject(projectId, userId, requestOptions);
|
|
1077
|
+
};
|
|
1078
|
+
|
|
1079
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
1080
|
+
|
|
1081
|
+
return customOptions;
|
|
1082
|
+
};
|
|
1083
|
+
|
|
1084
|
+
export type RemoveEditorFromProjectMutationResult = NonNullable<
|
|
1085
|
+
Awaited<ReturnType<typeof removeEditorFromProject>>
|
|
1086
|
+
>;
|
|
1087
|
+
|
|
1088
|
+
export type RemoveEditorFromProjectMutationError = ErrorType<DmError | void>;
|
|
794
1089
|
|
|
795
|
-
|
|
796
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{projectId: string;userId: string}, TContext>}
|
|
797
|
-
|
|
798
|
-
export type RemoveEditorFromProjectMutationResult = NonNullable<Awaited<ReturnType<typeof removeEditorFromProject>>>
|
|
799
|
-
|
|
800
|
-
export type RemoveEditorFromProjectMutationError = ErrorType<DmError | void>
|
|
801
|
-
|
|
802
|
-
/**
|
|
1090
|
+
/**
|
|
803
1091
|
* @summary Delete a Project Editor
|
|
804
1092
|
*/
|
|
805
|
-
export const useRemoveEditorFromProject = <
|
|
806
|
-
|
|
1093
|
+
export const useRemoveEditorFromProject = <TError = ErrorType<DmError | void>, TContext = unknown>(
|
|
1094
|
+
options?: {
|
|
1095
|
+
mutation?: UseMutationOptions<
|
|
1096
|
+
Awaited<ReturnType<typeof removeEditorFromProject>>,
|
|
1097
|
+
TError,
|
|
1098
|
+
{ projectId: string; userId: string },
|
|
1099
|
+
TContext
|
|
1100
|
+
>;
|
|
1101
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1102
|
+
},
|
|
1103
|
+
queryClient?: QueryClient,
|
|
807
1104
|
): UseMutationResult<
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
/**
|
|
1105
|
+
Awaited<ReturnType<typeof removeEditorFromProject>>,
|
|
1106
|
+
TError,
|
|
1107
|
+
{ projectId: string; userId: string },
|
|
1108
|
+
TContext
|
|
1109
|
+
> => {
|
|
1110
|
+
const mutationOptions = useRemoveEditorFromProjectMutationOptions(options);
|
|
1111
|
+
|
|
1112
|
+
return useMutation(mutationOptions, queryClient);
|
|
1113
|
+
};
|
|
1114
|
+
/**
|
|
819
1115
|
* Adds a user to a project as an `observer`. Observers can view Projects and download files but they cannot modify Project data or run **Applications** or **Jobs**.
|
|
820
1116
|
|
|
821
1117
|
You must be an `administrator` of the Project to add Observers
|
|
@@ -823,64 +1119,85 @@ You must be an `administrator` of the Project to add Observers
|
|
|
823
1119
|
* @summary Add a Project Observer
|
|
824
1120
|
*/
|
|
825
1121
|
export const addObserverToProject = (
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
return customInstance<void>(
|
|
832
|
-
{url: `/project/${projectId}/observer/${userId}`, method: 'PUT'
|
|
833
|
-
},
|
|
834
|
-
options);
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
export const getAddObserverToProjectMutationOptions = <TData = Awaited<ReturnType<typeof addObserverToProject>>, TError = ErrorType<void | DmError>,
|
|
840
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{projectId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
1122
|
+
projectId: string,
|
|
1123
|
+
userId: string,
|
|
1124
|
+
options?: SecondParameter<typeof customInstance>,
|
|
841
1125
|
) => {
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
1126
|
+
return customInstance<void>(
|
|
1127
|
+
{ url: `/project/${projectId}/observer/${userId}`, method: "PUT" },
|
|
1128
|
+
options,
|
|
1129
|
+
);
|
|
1130
|
+
};
|
|
1131
|
+
|
|
1132
|
+
export const useAddObserverToProjectMutationOptions = <
|
|
1133
|
+
TError = ErrorType<void | DmError>,
|
|
1134
|
+
TContext = unknown,
|
|
1135
|
+
>(options?: {
|
|
1136
|
+
mutation?: UseMutationOptions<
|
|
1137
|
+
Awaited<ReturnType<typeof addObserverToProject>>,
|
|
1138
|
+
TError,
|
|
1139
|
+
{ projectId: string; userId: string },
|
|
1140
|
+
TContext
|
|
1141
|
+
>;
|
|
1142
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1143
|
+
}): UseMutationOptions<
|
|
1144
|
+
Awaited<ReturnType<typeof addObserverToProject>>,
|
|
1145
|
+
TError,
|
|
1146
|
+
{ projectId: string; userId: string },
|
|
1147
|
+
TContext
|
|
1148
|
+
> => {
|
|
1149
|
+
const mutationKey = ["addObserverToProject"];
|
|
1150
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
1151
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
1152
|
+
? options
|
|
1153
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1154
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
1155
|
+
|
|
1156
|
+
const mutationFn: MutationFunction<
|
|
1157
|
+
Awaited<ReturnType<typeof addObserverToProject>>,
|
|
1158
|
+
{ projectId: string; userId: string }
|
|
1159
|
+
> = (props) => {
|
|
1160
|
+
const { projectId, userId } = props ?? {};
|
|
1161
|
+
|
|
1162
|
+
return addObserverToProject(projectId, userId, requestOptions);
|
|
1163
|
+
};
|
|
1164
|
+
|
|
1165
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
1166
|
+
|
|
1167
|
+
return customOptions;
|
|
1168
|
+
};
|
|
1169
|
+
|
|
1170
|
+
export type AddObserverToProjectMutationResult = NonNullable<
|
|
1171
|
+
Awaited<ReturnType<typeof addObserverToProject>>
|
|
1172
|
+
>;
|
|
1173
|
+
|
|
1174
|
+
export type AddObserverToProjectMutationError = ErrorType<void | DmError>;
|
|
848
1175
|
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof addObserverToProject>>, {projectId: string;userId: string}> = (props) => {
|
|
853
|
-
const {projectId,userId} = props ?? {};
|
|
854
|
-
|
|
855
|
-
return addObserverToProject(projectId,userId,requestOptions)
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{projectId: string;userId: string}, TContext>}
|
|
862
|
-
|
|
863
|
-
export type AddObserverToProjectMutationResult = NonNullable<Awaited<ReturnType<typeof addObserverToProject>>>
|
|
864
|
-
|
|
865
|
-
export type AddObserverToProjectMutationError = ErrorType<void | DmError>
|
|
866
|
-
|
|
867
|
-
/**
|
|
1176
|
+
/**
|
|
868
1177
|
* @summary Add a Project Observer
|
|
869
1178
|
*/
|
|
870
|
-
export const useAddObserverToProject = <
|
|
871
|
-
|
|
1179
|
+
export const useAddObserverToProject = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
1180
|
+
options?: {
|
|
1181
|
+
mutation?: UseMutationOptions<
|
|
1182
|
+
Awaited<ReturnType<typeof addObserverToProject>>,
|
|
1183
|
+
TError,
|
|
1184
|
+
{ projectId: string; userId: string },
|
|
1185
|
+
TContext
|
|
1186
|
+
>;
|
|
1187
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1188
|
+
},
|
|
1189
|
+
queryClient?: QueryClient,
|
|
872
1190
|
): UseMutationResult<
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
/**
|
|
1191
|
+
Awaited<ReturnType<typeof addObserverToProject>>,
|
|
1192
|
+
TError,
|
|
1193
|
+
{ projectId: string; userId: string },
|
|
1194
|
+
TContext
|
|
1195
|
+
> => {
|
|
1196
|
+
const mutationOptions = useAddObserverToProjectMutationOptions(options);
|
|
1197
|
+
|
|
1198
|
+
return useMutation(mutationOptions, queryClient);
|
|
1199
|
+
};
|
|
1200
|
+
/**
|
|
884
1201
|
* Deletes a project `observer`.
|
|
885
1202
|
|
|
886
1203
|
You must be an `administrator` of the Project to remove Observers
|
|
@@ -888,64 +1205,88 @@ You must be an `administrator` of the Project to remove Observers
|
|
|
888
1205
|
* @summary Delete a Project Observer
|
|
889
1206
|
*/
|
|
890
1207
|
export const removeObserverFromProject = (
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
return customInstance<void>(
|
|
897
|
-
{url: `/project/${projectId}/observer/${userId}`, method: 'DELETE'
|
|
898
|
-
},
|
|
899
|
-
options);
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
export const getRemoveObserverFromProjectMutationOptions = <TData = Awaited<ReturnType<typeof removeObserverFromProject>>, TError = ErrorType<DmError | void>,
|
|
905
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{projectId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
1208
|
+
projectId: string,
|
|
1209
|
+
userId: string,
|
|
1210
|
+
options?: SecondParameter<typeof customInstance>,
|
|
906
1211
|
) => {
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
1212
|
+
return customInstance<void>(
|
|
1213
|
+
{ url: `/project/${projectId}/observer/${userId}`, method: "DELETE" },
|
|
1214
|
+
options,
|
|
1215
|
+
);
|
|
1216
|
+
};
|
|
1217
|
+
|
|
1218
|
+
export const useRemoveObserverFromProjectMutationOptions = <
|
|
1219
|
+
TError = ErrorType<DmError | void>,
|
|
1220
|
+
TContext = unknown,
|
|
1221
|
+
>(options?: {
|
|
1222
|
+
mutation?: UseMutationOptions<
|
|
1223
|
+
Awaited<ReturnType<typeof removeObserverFromProject>>,
|
|
1224
|
+
TError,
|
|
1225
|
+
{ projectId: string; userId: string },
|
|
1226
|
+
TContext
|
|
1227
|
+
>;
|
|
1228
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1229
|
+
}): UseMutationOptions<
|
|
1230
|
+
Awaited<ReturnType<typeof removeObserverFromProject>>,
|
|
1231
|
+
TError,
|
|
1232
|
+
{ projectId: string; userId: string },
|
|
1233
|
+
TContext
|
|
1234
|
+
> => {
|
|
1235
|
+
const mutationKey = ["removeObserverFromProject"];
|
|
1236
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
1237
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
1238
|
+
? options
|
|
1239
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1240
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
1241
|
+
|
|
1242
|
+
const mutationFn: MutationFunction<
|
|
1243
|
+
Awaited<ReturnType<typeof removeObserverFromProject>>,
|
|
1244
|
+
{ projectId: string; userId: string }
|
|
1245
|
+
> = (props) => {
|
|
1246
|
+
const { projectId, userId } = props ?? {};
|
|
1247
|
+
|
|
1248
|
+
return removeObserverFromProject(projectId, userId, requestOptions);
|
|
1249
|
+
};
|
|
1250
|
+
|
|
1251
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
1252
|
+
|
|
1253
|
+
return customOptions;
|
|
1254
|
+
};
|
|
1255
|
+
|
|
1256
|
+
export type RemoveObserverFromProjectMutationResult = NonNullable<
|
|
1257
|
+
Awaited<ReturnType<typeof removeObserverFromProject>>
|
|
1258
|
+
>;
|
|
1259
|
+
|
|
1260
|
+
export type RemoveObserverFromProjectMutationError = ErrorType<DmError | void>;
|
|
922
1261
|
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{projectId: string;userId: string}, TContext>}
|
|
927
|
-
|
|
928
|
-
export type RemoveObserverFromProjectMutationResult = NonNullable<Awaited<ReturnType<typeof removeObserverFromProject>>>
|
|
929
|
-
|
|
930
|
-
export type RemoveObserverFromProjectMutationError = ErrorType<DmError | void>
|
|
931
|
-
|
|
932
|
-
/**
|
|
1262
|
+
/**
|
|
933
1263
|
* @summary Delete a Project Observer
|
|
934
1264
|
*/
|
|
935
|
-
export const useRemoveObserverFromProject = <
|
|
936
|
-
|
|
1265
|
+
export const useRemoveObserverFromProject = <
|
|
1266
|
+
TError = ErrorType<DmError | void>,
|
|
1267
|
+
TContext = unknown,
|
|
1268
|
+
>(
|
|
1269
|
+
options?: {
|
|
1270
|
+
mutation?: UseMutationOptions<
|
|
1271
|
+
Awaited<ReturnType<typeof removeObserverFromProject>>,
|
|
1272
|
+
TError,
|
|
1273
|
+
{ projectId: string; userId: string },
|
|
1274
|
+
TContext
|
|
1275
|
+
>;
|
|
1276
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1277
|
+
},
|
|
1278
|
+
queryClient?: QueryClient,
|
|
937
1279
|
): UseMutationResult<
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
/**
|
|
1280
|
+
Awaited<ReturnType<typeof removeObserverFromProject>>,
|
|
1281
|
+
TError,
|
|
1282
|
+
{ projectId: string; userId: string },
|
|
1283
|
+
TContext
|
|
1284
|
+
> => {
|
|
1285
|
+
const mutationOptions = useRemoveObserverFromProjectMutationOptions(options);
|
|
1286
|
+
|
|
1287
|
+
return useMutation(mutationOptions, queryClient);
|
|
1288
|
+
};
|
|
1289
|
+
/**
|
|
949
1290
|
* Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).
|
|
950
1291
|
|
|
951
1292
|
For **managed** files you should consider using the `/file/{file_id}` endpoint.
|
|
@@ -955,156 +1296,236 @@ You must be an `editor` of the Project if the Project is `private`
|
|
|
955
1296
|
* @summary Download a Project file
|
|
956
1297
|
*/
|
|
957
1298
|
export const getProjectFile = (
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
1299
|
+
projectId: string,
|
|
1300
|
+
params: GetProjectFileParams,
|
|
1301
|
+
options?: SecondParameter<typeof customInstance>,
|
|
1302
|
+
signal?: AbortSignal,
|
|
961
1303
|
) => {
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
export const
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
1304
|
+
return customInstance<void>(
|
|
1305
|
+
{ url: `/project/${projectId}/file`, method: "GET", params, signal },
|
|
1306
|
+
options,
|
|
1307
|
+
);
|
|
1308
|
+
};
|
|
1309
|
+
|
|
1310
|
+
export const getGetProjectFileQueryKey = (projectId: string, params: GetProjectFileParams) => {
|
|
1311
|
+
return [`/project/${projectId}/file`, ...(params ? [params] : [])] as const;
|
|
1312
|
+
};
|
|
1313
|
+
|
|
1314
|
+
export const useGetProjectFileQueryOptions = <
|
|
1315
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1316
|
+
TError = ErrorType<void | DmError>,
|
|
1317
|
+
>(
|
|
1318
|
+
projectId: string,
|
|
1319
|
+
params: GetProjectFileParams,
|
|
1320
|
+
options?: {
|
|
1321
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>>;
|
|
1322
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1323
|
+
},
|
|
980
1324
|
) => {
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
}
|
|
996
|
-
|
|
997
|
-
export type GetProjectFileQueryResult = NonNullable<Awaited<ReturnType<typeof getProjectFile
|
|
998
|
-
export type GetProjectFileQueryError = ErrorType<void | DmError
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1325
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
1326
|
+
|
|
1327
|
+
const queryKey = queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectId, params);
|
|
1328
|
+
|
|
1329
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFile>>> = ({ signal }) =>
|
|
1330
|
+
getProjectFile(projectId, params, requestOptions, signal);
|
|
1331
|
+
|
|
1332
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
1333
|
+
|
|
1334
|
+
return customOptions as UseQueryOptions<
|
|
1335
|
+
Awaited<ReturnType<typeof getProjectFile>>,
|
|
1336
|
+
TError,
|
|
1337
|
+
TData
|
|
1338
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1339
|
+
};
|
|
1340
|
+
|
|
1341
|
+
export type GetProjectFileQueryResult = NonNullable<Awaited<ReturnType<typeof getProjectFile>>>;
|
|
1342
|
+
export type GetProjectFileQueryError = ErrorType<void | DmError>;
|
|
1343
|
+
|
|
1344
|
+
export function useGetProjectFile<
|
|
1345
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1346
|
+
TError = ErrorType<void | DmError>,
|
|
1347
|
+
>(
|
|
1348
|
+
projectId: string,
|
|
1349
|
+
params: GetProjectFileParams,
|
|
1350
|
+
options: {
|
|
1351
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>> &
|
|
1352
|
+
Pick<
|
|
1004
1353
|
DefinedInitialDataOptions<
|
|
1005
1354
|
Awaited<ReturnType<typeof getProjectFile>>,
|
|
1006
1355
|
TError,
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1356
|
+
Awaited<ReturnType<typeof getProjectFile>>
|
|
1357
|
+
>,
|
|
1358
|
+
"initialData"
|
|
1359
|
+
>;
|
|
1360
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1361
|
+
},
|
|
1362
|
+
queryClient?: QueryClient,
|
|
1363
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1364
|
+
export function useGetProjectFile<
|
|
1365
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1366
|
+
TError = ErrorType<void | DmError>,
|
|
1367
|
+
>(
|
|
1368
|
+
projectId: string,
|
|
1369
|
+
params: GetProjectFileParams,
|
|
1370
|
+
options?: {
|
|
1371
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>> &
|
|
1372
|
+
Pick<
|
|
1015
1373
|
UndefinedInitialDataOptions<
|
|
1016
1374
|
Awaited<ReturnType<typeof getProjectFile>>,
|
|
1017
1375
|
TError,
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1376
|
+
Awaited<ReturnType<typeof getProjectFile>>
|
|
1377
|
+
>,
|
|
1378
|
+
"initialData"
|
|
1379
|
+
>;
|
|
1380
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1381
|
+
},
|
|
1382
|
+
queryClient?: QueryClient,
|
|
1383
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1384
|
+
export function useGetProjectFile<
|
|
1385
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1386
|
+
TError = ErrorType<void | DmError>,
|
|
1387
|
+
>(
|
|
1388
|
+
projectId: string,
|
|
1389
|
+
params: GetProjectFileParams,
|
|
1390
|
+
options?: {
|
|
1391
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>>;
|
|
1392
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1393
|
+
},
|
|
1394
|
+
queryClient?: QueryClient,
|
|
1395
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1028
1396
|
/**
|
|
1029
1397
|
* @summary Download a Project file
|
|
1030
1398
|
*/
|
|
1031
1399
|
|
|
1032
|
-
export function useGetProjectFile<
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1400
|
+
export function useGetProjectFile<
|
|
1401
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1402
|
+
TError = ErrorType<void | DmError>,
|
|
1403
|
+
>(
|
|
1404
|
+
projectId: string,
|
|
1405
|
+
params: GetProjectFileParams,
|
|
1406
|
+
options?: {
|
|
1407
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>>;
|
|
1408
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1409
|
+
},
|
|
1410
|
+
queryClient?: QueryClient,
|
|
1411
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
1412
|
+
const queryOptions = useGetProjectFileQueryOptions(projectId, params, options);
|
|
1413
|
+
|
|
1414
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
1415
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
1416
|
+
};
|
|
1417
|
+
|
|
1418
|
+
query.queryKey = queryOptions.queryKey;
|
|
1043
1419
|
|
|
1044
1420
|
return query;
|
|
1045
1421
|
}
|
|
1046
1422
|
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1423
|
+
export const useGetProjectFileSuspenseQueryOptions = <
|
|
1424
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1425
|
+
TError = ErrorType<void | DmError>,
|
|
1426
|
+
>(
|
|
1427
|
+
projectId: string,
|
|
1428
|
+
params: GetProjectFileParams,
|
|
1429
|
+
options?: {
|
|
1430
|
+
query?: Partial<
|
|
1431
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>
|
|
1432
|
+
>;
|
|
1433
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1434
|
+
},
|
|
1051
1435
|
) => {
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
export type GetProjectFileSuspenseQueryResult = NonNullable<
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1436
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
1437
|
+
|
|
1438
|
+
const queryKey = queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectId, params);
|
|
1439
|
+
|
|
1440
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFile>>> = ({ signal }) =>
|
|
1441
|
+
getProjectFile(projectId, params, requestOptions, signal);
|
|
1442
|
+
|
|
1443
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
1444
|
+
|
|
1445
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
1446
|
+
Awaited<ReturnType<typeof getProjectFile>>,
|
|
1447
|
+
TError,
|
|
1448
|
+
TData
|
|
1449
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1450
|
+
};
|
|
1451
|
+
|
|
1452
|
+
export type GetProjectFileSuspenseQueryResult = NonNullable<
|
|
1453
|
+
Awaited<ReturnType<typeof getProjectFile>>
|
|
1454
|
+
>;
|
|
1455
|
+
export type GetProjectFileSuspenseQueryError = ErrorType<void | DmError>;
|
|
1456
|
+
|
|
1457
|
+
export function useGetProjectFileSuspense<
|
|
1458
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1459
|
+
TError = ErrorType<void | DmError>,
|
|
1460
|
+
>(
|
|
1461
|
+
projectId: string,
|
|
1462
|
+
params: GetProjectFileParams,
|
|
1463
|
+
options: {
|
|
1464
|
+
query: Partial<
|
|
1465
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>
|
|
1466
|
+
>;
|
|
1467
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1468
|
+
},
|
|
1469
|
+
queryClient?: QueryClient,
|
|
1470
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1471
|
+
export function useGetProjectFileSuspense<
|
|
1472
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1473
|
+
TError = ErrorType<void | DmError>,
|
|
1474
|
+
>(
|
|
1475
|
+
projectId: string,
|
|
1476
|
+
params: GetProjectFileParams,
|
|
1477
|
+
options?: {
|
|
1478
|
+
query?: Partial<
|
|
1479
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>
|
|
1480
|
+
>;
|
|
1481
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1482
|
+
},
|
|
1483
|
+
queryClient?: QueryClient,
|
|
1484
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1485
|
+
export function useGetProjectFileSuspense<
|
|
1486
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1487
|
+
TError = ErrorType<void | DmError>,
|
|
1488
|
+
>(
|
|
1489
|
+
projectId: string,
|
|
1490
|
+
params: GetProjectFileParams,
|
|
1491
|
+
options?: {
|
|
1492
|
+
query?: Partial<
|
|
1493
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>
|
|
1494
|
+
>;
|
|
1495
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1496
|
+
},
|
|
1497
|
+
queryClient?: QueryClient,
|
|
1498
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1087
1499
|
/**
|
|
1088
1500
|
* @summary Download a Project file
|
|
1089
1501
|
*/
|
|
1090
1502
|
|
|
1091
|
-
export function useGetProjectFileSuspense<
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1503
|
+
export function useGetProjectFileSuspense<
|
|
1504
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1505
|
+
TError = ErrorType<void | DmError>,
|
|
1506
|
+
>(
|
|
1507
|
+
projectId: string,
|
|
1508
|
+
params: GetProjectFileParams,
|
|
1509
|
+
options?: {
|
|
1510
|
+
query?: Partial<
|
|
1511
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>
|
|
1512
|
+
>;
|
|
1513
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1514
|
+
},
|
|
1515
|
+
queryClient?: QueryClient,
|
|
1516
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
1517
|
+
const queryOptions = useGetProjectFileSuspenseQueryOptions(projectId, params, options);
|
|
1518
|
+
|
|
1519
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
1520
|
+
TData,
|
|
1521
|
+
TError
|
|
1522
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1523
|
+
|
|
1524
|
+
query.queryKey = queryOptions.queryKey;
|
|
1102
1525
|
|
|
1103
1526
|
return query;
|
|
1104
1527
|
}
|
|
1105
1528
|
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
1529
|
/**
|
|
1109
1530
|
* The user provides an external file for upload to the Project using an optional Path. The path is created if it does not exist.
|
|
1110
1531
|
|
|
@@ -1113,74 +1534,99 @@ You must be an `editor` of the project
|
|
|
1113
1534
|
* @summary Upload a file into a Project
|
|
1114
1535
|
*/
|
|
1115
1536
|
export const addFileToProject = (
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
const formData = new FormData();
|
|
1121
|
-
formData.append('file', projectFilePutBodyBody.file)
|
|
1122
|
-
if(projectFilePutBodyBody.as_filename !== undefined) {
|
|
1123
|
-
formData.append('as_filename', projectFilePutBodyBody.as_filename)
|
|
1124
|
-
}
|
|
1125
|
-
if(projectFilePutBodyBody.path !== undefined) {
|
|
1126
|
-
formData.append('path', projectFilePutBodyBody.path)
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
return customInstance<void>(
|
|
1130
|
-
{url: `/project/${projectId}/file`, method: 'PUT',
|
|
1131
|
-
headers: {'Content-Type': 'multipart/form-data', },
|
|
1132
|
-
data: formData
|
|
1133
|
-
},
|
|
1134
|
-
options);
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
export const getAddFileToProjectMutationOptions = <TData = Awaited<ReturnType<typeof addFileToProject>>, TError = ErrorType<void | DmError>,
|
|
1140
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{projectId: string;data: ProjectFilePutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
1537
|
+
projectId: string,
|
|
1538
|
+
projectFilePutBodyBody: ProjectFilePutBodyBody,
|
|
1539
|
+
options?: SecondParameter<typeof customInstance>,
|
|
1141
1540
|
) => {
|
|
1142
|
-
const
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1541
|
+
const formData = new FormData();
|
|
1542
|
+
formData.append(`file`, projectFilePutBodyBody.file);
|
|
1543
|
+
if (projectFilePutBodyBody.as_filename !== undefined) {
|
|
1544
|
+
formData.append(`as_filename`, projectFilePutBodyBody.as_filename);
|
|
1545
|
+
}
|
|
1546
|
+
if (projectFilePutBodyBody.path !== undefined) {
|
|
1547
|
+
formData.append(`path`, projectFilePutBodyBody.path);
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
return customInstance<void>(
|
|
1551
|
+
{
|
|
1552
|
+
url: `/project/${projectId}/file`,
|
|
1553
|
+
method: "PUT",
|
|
1554
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
1555
|
+
data: formData,
|
|
1556
|
+
},
|
|
1557
|
+
options,
|
|
1558
|
+
);
|
|
1559
|
+
};
|
|
1560
|
+
|
|
1561
|
+
export const useAddFileToProjectMutationOptions = <
|
|
1562
|
+
TError = ErrorType<void | DmError>,
|
|
1563
|
+
TContext = unknown,
|
|
1564
|
+
>(options?: {
|
|
1565
|
+
mutation?: UseMutationOptions<
|
|
1566
|
+
Awaited<ReturnType<typeof addFileToProject>>,
|
|
1567
|
+
TError,
|
|
1568
|
+
{ projectId: string; data: ProjectFilePutBodyBody },
|
|
1569
|
+
TContext
|
|
1570
|
+
>;
|
|
1571
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1572
|
+
}): UseMutationOptions<
|
|
1573
|
+
Awaited<ReturnType<typeof addFileToProject>>,
|
|
1574
|
+
TError,
|
|
1575
|
+
{ projectId: string; data: ProjectFilePutBodyBody },
|
|
1576
|
+
TContext
|
|
1577
|
+
> => {
|
|
1578
|
+
const mutationKey = ["addFileToProject"];
|
|
1579
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
1580
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
1581
|
+
? options
|
|
1582
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1583
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
1584
|
+
|
|
1585
|
+
const mutationFn: MutationFunction<
|
|
1586
|
+
Awaited<ReturnType<typeof addFileToProject>>,
|
|
1587
|
+
{ projectId: string; data: ProjectFilePutBodyBody }
|
|
1588
|
+
> = (props) => {
|
|
1589
|
+
const { projectId, data } = props ?? {};
|
|
1590
|
+
|
|
1591
|
+
return addFileToProject(projectId, data, requestOptions);
|
|
1592
|
+
};
|
|
1593
|
+
|
|
1594
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
1595
|
+
|
|
1596
|
+
return customOptions;
|
|
1597
|
+
};
|
|
1598
|
+
|
|
1599
|
+
export type AddFileToProjectMutationResult = NonNullable<
|
|
1600
|
+
Awaited<ReturnType<typeof addFileToProject>>
|
|
1601
|
+
>;
|
|
1602
|
+
export type AddFileToProjectMutationBody = ProjectFilePutBodyBody;
|
|
1603
|
+
export type AddFileToProjectMutationError = ErrorType<void | DmError>;
|
|
1166
1604
|
|
|
1167
|
-
|
|
1605
|
+
/**
|
|
1168
1606
|
* @summary Upload a file into a Project
|
|
1169
1607
|
*/
|
|
1170
|
-
export const useAddFileToProject = <
|
|
1171
|
-
|
|
1608
|
+
export const useAddFileToProject = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
1609
|
+
options?: {
|
|
1610
|
+
mutation?: UseMutationOptions<
|
|
1611
|
+
Awaited<ReturnType<typeof addFileToProject>>,
|
|
1612
|
+
TError,
|
|
1613
|
+
{ projectId: string; data: ProjectFilePutBodyBody },
|
|
1614
|
+
TContext
|
|
1615
|
+
>;
|
|
1616
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1617
|
+
},
|
|
1618
|
+
queryClient?: QueryClient,
|
|
1172
1619
|
): UseMutationResult<
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
/**
|
|
1620
|
+
Awaited<ReturnType<typeof addFileToProject>>,
|
|
1621
|
+
TError,
|
|
1622
|
+
{ projectId: string; data: ProjectFilePutBodyBody },
|
|
1623
|
+
TContext
|
|
1624
|
+
> => {
|
|
1625
|
+
const mutationOptions = useAddFileToProjectMutationOptions(options);
|
|
1626
|
+
|
|
1627
|
+
return useMutation(mutationOptions, queryClient);
|
|
1628
|
+
};
|
|
1629
|
+
/**
|
|
1184
1630
|
* Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).
|
|
1185
1631
|
|
|
1186
1632
|
For **managed** files you should consider using the `/file/{file_id}` endpoint.
|
|
@@ -1190,153 +1636,249 @@ As there is no authentication for this endpoint you must provide a valid token.
|
|
|
1190
1636
|
* @summary Download a Project file using a Token
|
|
1191
1637
|
*/
|
|
1192
1638
|
export const getProjectFileWithToken = (
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1639
|
+
projectId: string,
|
|
1640
|
+
params: GetProjectFileWithTokenParams,
|
|
1641
|
+
options?: SecondParameter<typeof customInstance>,
|
|
1642
|
+
signal?: AbortSignal,
|
|
1196
1643
|
) => {
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
export const getGetProjectFileWithTokenQueryKey = (projectId: string,
|
|
1208
|
-
params: GetProjectFileWithTokenParams,) => {
|
|
1209
|
-
return ["data-manager-api", `/project/${projectId}/file-with-token`, ...(params ? [params]: [])] as const;
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
export const getGetProjectFileWithTokenQueryOptions = <TData = Awaited<ReturnType<typeof getProjectFileWithToken>>, TError = ErrorType<DmError>>(projectId: string,
|
|
1214
|
-
params: GetProjectFileWithTokenParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
1644
|
+
return customInstance<void>(
|
|
1645
|
+
{ url: `/project/${projectId}/file-with-token`, method: "GET", params, signal },
|
|
1646
|
+
options,
|
|
1647
|
+
);
|
|
1648
|
+
};
|
|
1649
|
+
|
|
1650
|
+
export const getGetProjectFileWithTokenQueryKey = (
|
|
1651
|
+
projectId: string,
|
|
1652
|
+
params: GetProjectFileWithTokenParams,
|
|
1215
1653
|
) => {
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1654
|
+
return [`/project/${projectId}/file-with-token`, ...(params ? [params] : [])] as const;
|
|
1655
|
+
};
|
|
1656
|
+
|
|
1657
|
+
export const useGetProjectFileWithTokenQueryOptions = <
|
|
1658
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1659
|
+
TError = ErrorType<DmError>,
|
|
1660
|
+
>(
|
|
1661
|
+
projectId: string,
|
|
1662
|
+
params: GetProjectFileWithTokenParams,
|
|
1663
|
+
options?: {
|
|
1664
|
+
query?: Partial<
|
|
1665
|
+
UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1666
|
+
>;
|
|
1667
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1668
|
+
},
|
|
1669
|
+
) => {
|
|
1670
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
1671
|
+
|
|
1672
|
+
const queryKey = queryOptions?.queryKey ?? getGetProjectFileWithTokenQueryKey(projectId, params);
|
|
1673
|
+
|
|
1674
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFileWithToken>>> = ({
|
|
1675
|
+
signal,
|
|
1676
|
+
}) => getProjectFileWithToken(projectId, params, requestOptions, signal);
|
|
1677
|
+
|
|
1678
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
1679
|
+
|
|
1680
|
+
return customOptions as UseQueryOptions<
|
|
1681
|
+
Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1682
|
+
TError,
|
|
1683
|
+
TData
|
|
1684
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1685
|
+
};
|
|
1686
|
+
|
|
1687
|
+
export type GetProjectFileWithTokenQueryResult = NonNullable<
|
|
1688
|
+
Awaited<ReturnType<typeof getProjectFileWithToken>>
|
|
1689
|
+
>;
|
|
1690
|
+
export type GetProjectFileWithTokenQueryError = ErrorType<DmError>;
|
|
1691
|
+
|
|
1692
|
+
export function useGetProjectFileWithToken<
|
|
1693
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1694
|
+
TError = ErrorType<DmError>,
|
|
1695
|
+
>(
|
|
1696
|
+
projectId: string,
|
|
1697
|
+
params: GetProjectFileWithTokenParams,
|
|
1698
|
+
options: {
|
|
1699
|
+
query: Partial<
|
|
1700
|
+
UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1701
|
+
> &
|
|
1702
|
+
Pick<
|
|
1239
1703
|
DefinedInitialDataOptions<
|
|
1240
1704
|
Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1241
1705
|
TError,
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1706
|
+
Awaited<ReturnType<typeof getProjectFileWithToken>>
|
|
1707
|
+
>,
|
|
1708
|
+
"initialData"
|
|
1709
|
+
>;
|
|
1710
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1711
|
+
},
|
|
1712
|
+
queryClient?: QueryClient,
|
|
1713
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1714
|
+
export function useGetProjectFileWithToken<
|
|
1715
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1716
|
+
TError = ErrorType<DmError>,
|
|
1717
|
+
>(
|
|
1718
|
+
projectId: string,
|
|
1719
|
+
params: GetProjectFileWithTokenParams,
|
|
1720
|
+
options?: {
|
|
1721
|
+
query?: Partial<
|
|
1722
|
+
UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1723
|
+
> &
|
|
1724
|
+
Pick<
|
|
1250
1725
|
UndefinedInitialDataOptions<
|
|
1251
1726
|
Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1252
1727
|
TError,
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1728
|
+
Awaited<ReturnType<typeof getProjectFileWithToken>>
|
|
1729
|
+
>,
|
|
1730
|
+
"initialData"
|
|
1731
|
+
>;
|
|
1732
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1733
|
+
},
|
|
1734
|
+
queryClient?: QueryClient,
|
|
1735
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1736
|
+
export function useGetProjectFileWithToken<
|
|
1737
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1738
|
+
TError = ErrorType<DmError>,
|
|
1739
|
+
>(
|
|
1740
|
+
projectId: string,
|
|
1741
|
+
params: GetProjectFileWithTokenParams,
|
|
1742
|
+
options?: {
|
|
1743
|
+
query?: Partial<
|
|
1744
|
+
UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1745
|
+
>;
|
|
1746
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1747
|
+
},
|
|
1748
|
+
queryClient?: QueryClient,
|
|
1749
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1263
1750
|
/**
|
|
1264
1751
|
* @summary Download a Project file using a Token
|
|
1265
1752
|
*/
|
|
1266
1753
|
|
|
1267
|
-
export function useGetProjectFileWithToken<
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1754
|
+
export function useGetProjectFileWithToken<
|
|
1755
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1756
|
+
TError = ErrorType<DmError>,
|
|
1757
|
+
>(
|
|
1758
|
+
projectId: string,
|
|
1759
|
+
params: GetProjectFileWithTokenParams,
|
|
1760
|
+
options?: {
|
|
1761
|
+
query?: Partial<
|
|
1762
|
+
UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1763
|
+
>;
|
|
1764
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1765
|
+
},
|
|
1766
|
+
queryClient?: QueryClient,
|
|
1767
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
1768
|
+
const queryOptions = useGetProjectFileWithTokenQueryOptions(projectId, params, options);
|
|
1769
|
+
|
|
1770
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
1771
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
1772
|
+
};
|
|
1773
|
+
|
|
1774
|
+
query.queryKey = queryOptions.queryKey;
|
|
1278
1775
|
|
|
1279
1776
|
return query;
|
|
1280
1777
|
}
|
|
1281
1778
|
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1779
|
+
export const useGetProjectFileWithTokenSuspenseQueryOptions = <
|
|
1780
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1781
|
+
TError = ErrorType<DmError>,
|
|
1782
|
+
>(
|
|
1783
|
+
projectId: string,
|
|
1784
|
+
params: GetProjectFileWithTokenParams,
|
|
1785
|
+
options?: {
|
|
1786
|
+
query?: Partial<
|
|
1787
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1788
|
+
>;
|
|
1789
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1790
|
+
},
|
|
1286
1791
|
) => {
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
export type
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
export
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1792
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
1793
|
+
|
|
1794
|
+
const queryKey = queryOptions?.queryKey ?? getGetProjectFileWithTokenQueryKey(projectId, params);
|
|
1795
|
+
|
|
1796
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFileWithToken>>> = ({
|
|
1797
|
+
signal,
|
|
1798
|
+
}) => getProjectFileWithToken(projectId, params, requestOptions, signal);
|
|
1799
|
+
|
|
1800
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
1801
|
+
|
|
1802
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
1803
|
+
Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1804
|
+
TError,
|
|
1805
|
+
TData
|
|
1806
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1807
|
+
};
|
|
1808
|
+
|
|
1809
|
+
export type GetProjectFileWithTokenSuspenseQueryResult = NonNullable<
|
|
1810
|
+
Awaited<ReturnType<typeof getProjectFileWithToken>>
|
|
1811
|
+
>;
|
|
1812
|
+
export type GetProjectFileWithTokenSuspenseQueryError = ErrorType<DmError>;
|
|
1813
|
+
|
|
1814
|
+
export function useGetProjectFileWithTokenSuspense<
|
|
1815
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1816
|
+
TError = ErrorType<DmError>,
|
|
1817
|
+
>(
|
|
1818
|
+
projectId: string,
|
|
1819
|
+
params: GetProjectFileWithTokenParams,
|
|
1820
|
+
options: {
|
|
1821
|
+
query: Partial<
|
|
1822
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1823
|
+
>;
|
|
1824
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1825
|
+
},
|
|
1826
|
+
queryClient?: QueryClient,
|
|
1827
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1828
|
+
export function useGetProjectFileWithTokenSuspense<
|
|
1829
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1830
|
+
TError = ErrorType<DmError>,
|
|
1831
|
+
>(
|
|
1832
|
+
projectId: string,
|
|
1833
|
+
params: GetProjectFileWithTokenParams,
|
|
1834
|
+
options?: {
|
|
1835
|
+
query?: Partial<
|
|
1836
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1837
|
+
>;
|
|
1838
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1839
|
+
},
|
|
1840
|
+
queryClient?: QueryClient,
|
|
1841
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1842
|
+
export function useGetProjectFileWithTokenSuspense<
|
|
1843
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1844
|
+
TError = ErrorType<DmError>,
|
|
1845
|
+
>(
|
|
1846
|
+
projectId: string,
|
|
1847
|
+
params: GetProjectFileWithTokenParams,
|
|
1848
|
+
options?: {
|
|
1849
|
+
query?: Partial<
|
|
1850
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1851
|
+
>;
|
|
1852
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1853
|
+
},
|
|
1854
|
+
queryClient?: QueryClient,
|
|
1855
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1322
1856
|
/**
|
|
1323
1857
|
* @summary Download a Project file using a Token
|
|
1324
1858
|
*/
|
|
1325
1859
|
|
|
1326
|
-
export function useGetProjectFileWithTokenSuspense<
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1860
|
+
export function useGetProjectFileWithTokenSuspense<
|
|
1861
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1862
|
+
TError = ErrorType<DmError>,
|
|
1863
|
+
>(
|
|
1864
|
+
projectId: string,
|
|
1865
|
+
params: GetProjectFileWithTokenParams,
|
|
1866
|
+
options?: {
|
|
1867
|
+
query?: Partial<
|
|
1868
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1869
|
+
>;
|
|
1870
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1871
|
+
},
|
|
1872
|
+
queryClient?: QueryClient,
|
|
1873
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
1874
|
+
const queryOptions = useGetProjectFileWithTokenSuspenseQueryOptions(projectId, params, options);
|
|
1875
|
+
|
|
1876
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
1877
|
+
TData,
|
|
1878
|
+
TError
|
|
1879
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1880
|
+
|
|
1881
|
+
query.queryKey = queryOptions.queryKey;
|
|
1337
1882
|
|
|
1338
1883
|
return query;
|
|
1339
1884
|
}
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|