@squonk/data-manager-client 4.2.0 → 5.0.0-5-0.2173777171
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 +140 -94
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.cts +104 -47
- package/accounting/accounting.d.ts +104 -47
- package/accounting/accounting.js +146 -100
- 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 +123 -121
- package/admin/admin.d.ts +123 -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-76ADQBHZ.js +25 -0
- package/chunk-76ADQBHZ.js.map +1 -0
- package/chunk-KHB5TJT7.cjs +25 -0
- package/chunk-KHB5TJT7.cjs.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/configuration/configuration.cjs +38 -45
- package/configuration/configuration.cjs.map +1 -1
- package/configuration/configuration.d.cts +26 -26
- package/configuration/configuration.d.ts +26 -26
- 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/file-and-path/file-and-path.cjs +212 -135
- package/file-and-path/file-and-path.cjs.map +1 -1
- package/file-and-path/file-and-path.d.cts +263 -103
- package/file-and-path/file-and-path.d.ts +263 -103
- package/file-and-path/file-and-path.js +222 -145
- package/file-and-path/file-and-path.js.map +1 -1
- package/index.cjs +83 -103
- package/index.cjs.map +1 -1
- package/index.d.cts +2434 -2343
- package/index.d.ts +2434 -2343
- package/index.js +82 -102
- 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 +170 -66
- package/job/job.cjs.map +1 -1
- package/job/job.d.cts +193 -37
- package/job/job.d.ts +193 -37
- package/job/job.js +176 -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 +113 -256
- package/project/project.cjs.map +1 -1
- package/project/project.d.cts +122 -282
- package/project/project.d.ts +122 -282
- package/project/project.js +118 -261
- package/project/project.js.map +1 -1
- package/src/{data-manager-api.schemas.ts → API_TARGET_NAME.schemas.ts} +2538 -2483
- package/src/accounting/accounting.ts +1003 -455
- package/src/admin/admin.ts +1190 -788
- package/src/application/application.ts +378 -232
- package/src/configuration/configuration.ts +350 -243
- package/src/custom-instance.ts +3 -3
- package/src/dataset/dataset.ts +1200 -793
- package/src/digest/digest.ts +199 -123
- package/src/file-and-path/file-and-path.ts +1456 -603
- package/src/index.ts +3 -3
- package/src/instance/instance.ts +805 -540
- package/src/inventory/inventory.ts +201 -123
- package/src/job/job.ts +1134 -330
- package/src/metadata/metadata.ts +588 -372
- package/src/options-mutator.ts +27 -0
- package/src/project/project.ts +1064 -1121
- package/src/task/task.ts +435 -296
- package/src/type/type.ts +181 -127
- package/src/user/user.ts +847 -399
- package/src/workflow/workflow.ts +1754 -1091
- 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 +149 -147
- package/workflow/workflow.d.ts +149 -147
- 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/exchange-rate/exchange-rate.cjs +0 -253
- package/exchange-rate/exchange-rate.cjs.map +0 -1
- package/exchange-rate/exchange-rate.d.cts +0 -319
- package/exchange-rate/exchange-rate.d.ts +0 -319
- package/exchange-rate/exchange-rate.js +0 -253
- package/exchange-rate/exchange-rate.js.map +0 -1
- package/exchange-rate/package.json +0 -7
- package/src/exchange-rate/exchange-rate.ts +0 -800
package/src/project/project.ts
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
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.
|
|
7
6
|
|
|
8
7
|
A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications**, **Jobs**, and **Workflows** using **Projects** and **Files**.
|
|
9
8
|
|
|
10
|
-
* OpenAPI spec version:
|
|
9
|
+
* OpenAPI spec version: 5.0
|
|
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,170 +23,246 @@ 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
|
-
GetProjectFileParams,
|
|
35
|
-
GetProjectFileWithTokenParams,
|
|
36
31
|
GetProjectsParams,
|
|
37
32
|
ProjectDetail,
|
|
38
|
-
ProjectFilePutBodyBody,
|
|
39
33
|
ProjectPatchBodyBody,
|
|
40
34
|
ProjectPostBodyBody,
|
|
41
35
|
ProjectPostResponse,
|
|
42
36
|
ProjectsGetResponse,
|
|
43
|
-
TaskIdentity
|
|
44
|
-
} from
|
|
45
|
-
import { customInstance } from '.././custom-instance';
|
|
46
|
-
import type { ErrorType } from '.././custom-instance';
|
|
47
|
-
|
|
37
|
+
TaskIdentity,
|
|
38
|
+
} from "../API_TARGET_NAME.schemas";
|
|
48
39
|
|
|
49
|
-
|
|
40
|
+
import { customInstance } from ".././custom-instance";
|
|
41
|
+
import type { ErrorType } from ".././custom-instance";
|
|
42
|
+
import { queryMutator } from ".././options-mutator";
|
|
43
|
+
import { mutationMutator } from ".././options-mutator";
|
|
50
44
|
|
|
45
|
+
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
51
46
|
|
|
52
47
|
/**
|
|
53
48
|
* @summary Get all Projects available to you
|
|
54
49
|
*/
|
|
55
50
|
export const getProjects = (
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
params?: GetProjectsParams,
|
|
52
|
+
options?: SecondParameter<typeof customInstance>,
|
|
53
|
+
signal?: AbortSignal,
|
|
58
54
|
) => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
export const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
55
|
+
return customInstance<ProjectsGetResponse>(
|
|
56
|
+
{ url: `/project`, method: "GET", params, signal },
|
|
57
|
+
options,
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const getGetProjectsQueryKey = (params?: GetProjectsParams) => {
|
|
62
|
+
return [`/project`, ...(params ? [params] : [])] as const;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const useGetProjectsQueryOptions = <
|
|
66
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
67
|
+
TError = ErrorType<void | DmError>,
|
|
68
|
+
>(
|
|
69
|
+
params?: GetProjectsParams,
|
|
70
|
+
options?: {
|
|
71
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>>;
|
|
72
|
+
request?: SecondParameter<typeof customInstance>;
|
|
73
|
+
},
|
|
75
74
|
) => {
|
|
75
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
76
76
|
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
const queryKey = queryOptions?.queryKey ?? getGetProjectsQueryKey(params);
|
|
77
|
+
const queryKey = queryOptions?.queryKey ?? getGetProjectsQueryKey(params);
|
|
80
78
|
|
|
81
|
-
|
|
79
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjects>>> = ({ signal }) =>
|
|
80
|
+
getProjects(params, requestOptions, signal);
|
|
82
81
|
|
|
83
|
-
|
|
82
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
84
83
|
|
|
85
|
-
|
|
84
|
+
return customOptions as UseQueryOptions<
|
|
85
|
+
Awaited<ReturnType<typeof getProjects>>,
|
|
86
|
+
TError,
|
|
87
|
+
TData
|
|
88
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
89
|
+
};
|
|
86
90
|
|
|
87
|
-
|
|
91
|
+
export type GetProjectsQueryResult = NonNullable<Awaited<ReturnType<typeof getProjects>>>;
|
|
92
|
+
export type GetProjectsQueryError = ErrorType<void | DmError>;
|
|
88
93
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
params: undefined | GetProjectsParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>> & Pick<
|
|
94
|
+
export function useGetProjects<
|
|
95
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
96
|
+
TError = ErrorType<void | DmError>,
|
|
97
|
+
>(
|
|
98
|
+
params: undefined | GetProjectsParams,
|
|
99
|
+
options: {
|
|
100
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>> &
|
|
101
|
+
Pick<
|
|
98
102
|
DefinedInitialDataOptions<
|
|
99
103
|
Awaited<ReturnType<typeof getProjects>>,
|
|
100
104
|
TError,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
Awaited<ReturnType<typeof getProjects>>
|
|
106
|
+
>,
|
|
107
|
+
"initialData"
|
|
108
|
+
>;
|
|
109
|
+
request?: SecondParameter<typeof customInstance>;
|
|
110
|
+
},
|
|
111
|
+
queryClient?: QueryClient,
|
|
112
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
113
|
+
export function useGetProjects<
|
|
114
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
115
|
+
TError = ErrorType<void | DmError>,
|
|
116
|
+
>(
|
|
117
|
+
params?: GetProjectsParams,
|
|
118
|
+
options?: {
|
|
119
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>> &
|
|
120
|
+
Pick<
|
|
108
121
|
UndefinedInitialDataOptions<
|
|
109
122
|
Awaited<ReturnType<typeof getProjects>>,
|
|
110
123
|
TError,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
124
|
+
Awaited<ReturnType<typeof getProjects>>
|
|
125
|
+
>,
|
|
126
|
+
"initialData"
|
|
127
|
+
>;
|
|
128
|
+
request?: SecondParameter<typeof customInstance>;
|
|
129
|
+
},
|
|
130
|
+
queryClient?: QueryClient,
|
|
131
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
132
|
+
export function useGetProjects<
|
|
133
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
134
|
+
TError = ErrorType<void | DmError>,
|
|
135
|
+
>(
|
|
136
|
+
params?: GetProjectsParams,
|
|
137
|
+
options?: {
|
|
138
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>>;
|
|
139
|
+
request?: SecondParameter<typeof customInstance>;
|
|
140
|
+
},
|
|
141
|
+
queryClient?: QueryClient,
|
|
142
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
120
143
|
/**
|
|
121
144
|
* @summary Get all Projects available to you
|
|
122
145
|
*/
|
|
123
146
|
|
|
124
|
-
export function useGetProjects<
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
147
|
+
export function useGetProjects<
|
|
148
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
149
|
+
TError = ErrorType<void | DmError>,
|
|
150
|
+
>(
|
|
151
|
+
params?: GetProjectsParams,
|
|
152
|
+
options?: {
|
|
153
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>>;
|
|
154
|
+
request?: SecondParameter<typeof customInstance>;
|
|
155
|
+
},
|
|
156
|
+
queryClient?: QueryClient,
|
|
157
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
158
|
+
const queryOptions = useGetProjectsQueryOptions(params, options);
|
|
159
|
+
|
|
160
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
161
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
query.queryKey = queryOptions.queryKey;
|
|
134
165
|
|
|
135
166
|
return query;
|
|
136
167
|
}
|
|
137
168
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
169
|
+
export const useGetProjectsSuspenseQueryOptions = <
|
|
170
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
171
|
+
TError = ErrorType<void | DmError>,
|
|
172
|
+
>(
|
|
173
|
+
params?: GetProjectsParams,
|
|
174
|
+
options?: {
|
|
175
|
+
query?: Partial<
|
|
176
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>
|
|
177
|
+
>;
|
|
178
|
+
request?: SecondParameter<typeof customInstance>;
|
|
179
|
+
},
|
|
141
180
|
) => {
|
|
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
|
-
|
|
181
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
182
|
+
|
|
183
|
+
const queryKey = queryOptions?.queryKey ?? getGetProjectsQueryKey(params);
|
|
184
|
+
|
|
185
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjects>>> = ({ signal }) =>
|
|
186
|
+
getProjects(params, requestOptions, signal);
|
|
187
|
+
|
|
188
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
189
|
+
|
|
190
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
191
|
+
Awaited<ReturnType<typeof getProjects>>,
|
|
192
|
+
TError,
|
|
193
|
+
TData
|
|
194
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export type GetProjectsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProjects>>>;
|
|
198
|
+
export type GetProjectsSuspenseQueryError = ErrorType<void | DmError>;
|
|
199
|
+
|
|
200
|
+
export function useGetProjectsSuspense<
|
|
201
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
202
|
+
TError = ErrorType<void | DmError>,
|
|
203
|
+
>(
|
|
204
|
+
params: undefined | GetProjectsParams,
|
|
205
|
+
options: {
|
|
206
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>>;
|
|
207
|
+
request?: SecondParameter<typeof customInstance>;
|
|
208
|
+
},
|
|
209
|
+
queryClient?: QueryClient,
|
|
210
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
211
|
+
export function useGetProjectsSuspense<
|
|
212
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
213
|
+
TError = ErrorType<void | DmError>,
|
|
214
|
+
>(
|
|
215
|
+
params?: GetProjectsParams,
|
|
216
|
+
options?: {
|
|
217
|
+
query?: Partial<
|
|
218
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>
|
|
219
|
+
>;
|
|
220
|
+
request?: SecondParameter<typeof customInstance>;
|
|
221
|
+
},
|
|
222
|
+
queryClient?: QueryClient,
|
|
223
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
224
|
+
export function useGetProjectsSuspense<
|
|
225
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
226
|
+
TError = ErrorType<void | DmError>,
|
|
227
|
+
>(
|
|
228
|
+
params?: GetProjectsParams,
|
|
229
|
+
options?: {
|
|
230
|
+
query?: Partial<
|
|
231
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>
|
|
232
|
+
>;
|
|
233
|
+
request?: SecondParameter<typeof customInstance>;
|
|
234
|
+
},
|
|
235
|
+
queryClient?: QueryClient,
|
|
236
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
174
237
|
/**
|
|
175
238
|
* @summary Get all Projects available to you
|
|
176
239
|
*/
|
|
177
240
|
|
|
178
|
-
export function useGetProjectsSuspense<
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
241
|
+
export function useGetProjectsSuspense<
|
|
242
|
+
TData = Awaited<ReturnType<typeof getProjects>>,
|
|
243
|
+
TError = ErrorType<void | DmError>,
|
|
244
|
+
>(
|
|
245
|
+
params?: GetProjectsParams,
|
|
246
|
+
options?: {
|
|
247
|
+
query?: Partial<
|
|
248
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>
|
|
249
|
+
>;
|
|
250
|
+
request?: SecondParameter<typeof customInstance>;
|
|
251
|
+
},
|
|
252
|
+
queryClient?: QueryClient,
|
|
253
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
254
|
+
const queryOptions = useGetProjectsSuspenseQueryOptions(params, options);
|
|
255
|
+
|
|
256
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
257
|
+
TData,
|
|
258
|
+
TError
|
|
259
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
260
|
+
|
|
261
|
+
query.queryKey = queryOptions.queryKey;
|
|
188
262
|
|
|
189
263
|
return query;
|
|
190
264
|
}
|
|
191
265
|
|
|
192
|
-
|
|
193
|
-
|
|
194
266
|
/**
|
|
195
267
|
* 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
268
|
|
|
@@ -203,287 +275,402 @@ The name you give the Project is free-form text (can contain spaces etc.) but th
|
|
|
203
275
|
* @summary Create a new Project
|
|
204
276
|
*/
|
|
205
277
|
export const createProject = (
|
|
206
|
-
|
|
207
|
-
|
|
278
|
+
projectPostBodyBody: ProjectPostBodyBody,
|
|
279
|
+
options?: SecondParameter<typeof customInstance>,
|
|
280
|
+
signal?: AbortSignal,
|
|
208
281
|
) => {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
282
|
+
const formUrlEncoded = new URLSearchParams();
|
|
283
|
+
formUrlEncoded.append(`name`, projectPostBodyBody.name);
|
|
284
|
+
if (projectPostBodyBody.private !== undefined) {
|
|
285
|
+
formUrlEncoded.append(`private`, projectPostBodyBody.private.toString());
|
|
286
|
+
}
|
|
287
|
+
formUrlEncoded.append(`tier_product_id`, projectPostBodyBody.tier_product_id);
|
|
288
|
+
|
|
289
|
+
return customInstance<ProjectPostResponse>(
|
|
290
|
+
{
|
|
291
|
+
url: `/project`,
|
|
292
|
+
method: "POST",
|
|
293
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
294
|
+
data: formUrlEncoded,
|
|
295
|
+
signal,
|
|
221
296
|
},
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
297
|
+
options,
|
|
298
|
+
);
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
export const useCreateProjectMutationOptions = <
|
|
302
|
+
TError = ErrorType<DmError | void>,
|
|
303
|
+
TContext = unknown,
|
|
304
|
+
>(options?: {
|
|
305
|
+
mutation?: UseMutationOptions<
|
|
306
|
+
Awaited<ReturnType<typeof createProject>>,
|
|
307
|
+
TError,
|
|
308
|
+
{ data: ProjectPostBodyBody },
|
|
309
|
+
TContext
|
|
310
|
+
>;
|
|
311
|
+
request?: SecondParameter<typeof customInstance>;
|
|
312
|
+
}): UseMutationOptions<
|
|
313
|
+
Awaited<ReturnType<typeof createProject>>,
|
|
314
|
+
TError,
|
|
315
|
+
{ data: ProjectPostBodyBody },
|
|
316
|
+
TContext
|
|
317
|
+
> => {
|
|
318
|
+
const mutationKey = ["createProject"];
|
|
319
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
320
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
321
|
+
? options
|
|
322
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
323
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
324
|
+
|
|
325
|
+
const mutationFn: MutationFunction<
|
|
326
|
+
Awaited<ReturnType<typeof createProject>>,
|
|
327
|
+
{ data: ProjectPostBodyBody }
|
|
328
|
+
> = (props) => {
|
|
329
|
+
const { data } = props ?? {};
|
|
330
|
+
|
|
331
|
+
return createProject(data, requestOptions);
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
335
|
+
|
|
336
|
+
return customOptions;
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
export type CreateProjectMutationResult = NonNullable<Awaited<ReturnType<typeof createProject>>>;
|
|
340
|
+
export type CreateProjectMutationBody = ProjectPostBodyBody;
|
|
341
|
+
export type CreateProjectMutationError = ErrorType<DmError | void>;
|
|
245
342
|
|
|
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
|
-
/**
|
|
343
|
+
/**
|
|
256
344
|
* @summary Create a new Project
|
|
257
345
|
*/
|
|
258
|
-
export const useCreateProject = <
|
|
259
|
-
|
|
346
|
+
export const useCreateProject = <TError = ErrorType<DmError | void>, TContext = unknown>(
|
|
347
|
+
options?: {
|
|
348
|
+
mutation?: UseMutationOptions<
|
|
349
|
+
Awaited<ReturnType<typeof createProject>>,
|
|
350
|
+
TError,
|
|
351
|
+
{ data: ProjectPostBodyBody },
|
|
352
|
+
TContext
|
|
353
|
+
>;
|
|
354
|
+
request?: SecondParameter<typeof customInstance>;
|
|
355
|
+
},
|
|
356
|
+
queryClient?: QueryClient,
|
|
260
357
|
): UseMutationResult<
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
/**
|
|
358
|
+
Awaited<ReturnType<typeof createProject>>,
|
|
359
|
+
TError,
|
|
360
|
+
{ data: ProjectPostBodyBody },
|
|
361
|
+
TContext
|
|
362
|
+
> => {
|
|
363
|
+
const mutationOptions = useCreateProjectMutationOptions(options);
|
|
364
|
+
|
|
365
|
+
return useMutation(mutationOptions, queryClient);
|
|
366
|
+
};
|
|
367
|
+
/**
|
|
272
368
|
* Gets the details of a Project that is available to you.
|
|
273
369
|
|
|
274
|
-
* @summary Get a Project
|
|
370
|
+
* @summary Get a Project (by UUID)
|
|
275
371
|
*/
|
|
276
372
|
export const getProject = (
|
|
277
|
-
|
|
278
|
-
|
|
373
|
+
projectId: string,
|
|
374
|
+
options?: SecondParameter<typeof customInstance>,
|
|
375
|
+
signal?: AbortSignal,
|
|
279
376
|
) => {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
377
|
+
return customInstance<ProjectDetail>(
|
|
378
|
+
{ url: `/project/${projectId}`, method: "GET", signal },
|
|
379
|
+
options,
|
|
380
|
+
);
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
export const getGetProjectQueryKey = (projectId: string) => {
|
|
384
|
+
return [`/project/${projectId}`] as const;
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
export const useGetProjectQueryOptions = <
|
|
388
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
389
|
+
TError = ErrorType<void | DmError>,
|
|
390
|
+
>(
|
|
391
|
+
projectId: string,
|
|
392
|
+
options?: {
|
|
393
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>>;
|
|
394
|
+
request?: SecondParameter<typeof customInstance>;
|
|
395
|
+
},
|
|
295
396
|
) => {
|
|
397
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
296
398
|
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
const queryKey = queryOptions?.queryKey ?? getGetProjectQueryKey(projectId);
|
|
399
|
+
const queryKey = queryOptions?.queryKey ?? getGetProjectQueryKey(projectId);
|
|
300
400
|
|
|
301
|
-
|
|
401
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProject>>> = ({ signal }) =>
|
|
402
|
+
getProject(projectId, requestOptions, signal);
|
|
302
403
|
|
|
303
|
-
|
|
404
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
304
405
|
|
|
305
|
-
|
|
406
|
+
return customOptions as UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData> & {
|
|
407
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
408
|
+
};
|
|
409
|
+
};
|
|
306
410
|
|
|
307
|
-
|
|
411
|
+
export type GetProjectQueryResult = NonNullable<Awaited<ReturnType<typeof getProject>>>;
|
|
412
|
+
export type GetProjectQueryError = ErrorType<void | DmError>;
|
|
308
413
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
projectId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>> & Pick<
|
|
414
|
+
export function useGetProject<
|
|
415
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
416
|
+
TError = ErrorType<void | DmError>,
|
|
417
|
+
>(
|
|
418
|
+
projectId: string,
|
|
419
|
+
options: {
|
|
420
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>> &
|
|
421
|
+
Pick<
|
|
318
422
|
DefinedInitialDataOptions<
|
|
319
423
|
Awaited<ReturnType<typeof getProject>>,
|
|
320
424
|
TError,
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
425
|
+
Awaited<ReturnType<typeof getProject>>
|
|
426
|
+
>,
|
|
427
|
+
"initialData"
|
|
428
|
+
>;
|
|
429
|
+
request?: SecondParameter<typeof customInstance>;
|
|
430
|
+
},
|
|
431
|
+
queryClient?: QueryClient,
|
|
432
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
433
|
+
export function useGetProject<
|
|
434
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
435
|
+
TError = ErrorType<void | DmError>,
|
|
436
|
+
>(
|
|
437
|
+
projectId: string,
|
|
438
|
+
options?: {
|
|
439
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>> &
|
|
440
|
+
Pick<
|
|
328
441
|
UndefinedInitialDataOptions<
|
|
329
442
|
Awaited<ReturnType<typeof getProject>>,
|
|
330
443
|
TError,
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
444
|
+
Awaited<ReturnType<typeof getProject>>
|
|
445
|
+
>,
|
|
446
|
+
"initialData"
|
|
447
|
+
>;
|
|
448
|
+
request?: SecondParameter<typeof customInstance>;
|
|
449
|
+
},
|
|
450
|
+
queryClient?: QueryClient,
|
|
451
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
452
|
+
export function useGetProject<
|
|
453
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
454
|
+
TError = ErrorType<void | DmError>,
|
|
455
|
+
>(
|
|
456
|
+
projectId: string,
|
|
457
|
+
options?: {
|
|
458
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>>;
|
|
459
|
+
request?: SecondParameter<typeof customInstance>;
|
|
460
|
+
},
|
|
461
|
+
queryClient?: QueryClient,
|
|
462
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
340
463
|
/**
|
|
341
|
-
* @summary Get a Project
|
|
464
|
+
* @summary Get a Project (by UUID)
|
|
342
465
|
*/
|
|
343
466
|
|
|
344
|
-
export function useGetProject<
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
467
|
+
export function useGetProject<
|
|
468
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
469
|
+
TError = ErrorType<void | DmError>,
|
|
470
|
+
>(
|
|
471
|
+
projectId: string,
|
|
472
|
+
options?: {
|
|
473
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>>;
|
|
474
|
+
request?: SecondParameter<typeof customInstance>;
|
|
475
|
+
},
|
|
476
|
+
queryClient?: QueryClient,
|
|
477
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
478
|
+
const queryOptions = useGetProjectQueryOptions(projectId, options);
|
|
479
|
+
|
|
480
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
481
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
query.queryKey = queryOptions.queryKey;
|
|
354
485
|
|
|
355
486
|
return query;
|
|
356
487
|
}
|
|
357
488
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
489
|
+
export const useGetProjectSuspenseQueryOptions = <
|
|
490
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
491
|
+
TError = ErrorType<void | DmError>,
|
|
492
|
+
>(
|
|
493
|
+
projectId: string,
|
|
494
|
+
options?: {
|
|
495
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>>;
|
|
496
|
+
request?: SecondParameter<typeof customInstance>;
|
|
497
|
+
},
|
|
361
498
|
) => {
|
|
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
|
-
|
|
499
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
500
|
+
|
|
501
|
+
const queryKey = queryOptions?.queryKey ?? getGetProjectQueryKey(projectId);
|
|
502
|
+
|
|
503
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProject>>> = ({ signal }) =>
|
|
504
|
+
getProject(projectId, requestOptions, signal);
|
|
505
|
+
|
|
506
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
507
|
+
|
|
508
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
509
|
+
Awaited<ReturnType<typeof getProject>>,
|
|
510
|
+
TError,
|
|
511
|
+
TData
|
|
512
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
export type GetProjectSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProject>>>;
|
|
516
|
+
export type GetProjectSuspenseQueryError = ErrorType<void | DmError>;
|
|
517
|
+
|
|
518
|
+
export function useGetProjectSuspense<
|
|
519
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
520
|
+
TError = ErrorType<void | DmError>,
|
|
521
|
+
>(
|
|
522
|
+
projectId: string,
|
|
523
|
+
options: {
|
|
524
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>>;
|
|
525
|
+
request?: SecondParameter<typeof customInstance>;
|
|
526
|
+
},
|
|
527
|
+
queryClient?: QueryClient,
|
|
528
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
529
|
+
export function useGetProjectSuspense<
|
|
530
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
531
|
+
TError = ErrorType<void | DmError>,
|
|
532
|
+
>(
|
|
533
|
+
projectId: string,
|
|
534
|
+
options?: {
|
|
535
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>>;
|
|
536
|
+
request?: SecondParameter<typeof customInstance>;
|
|
537
|
+
},
|
|
538
|
+
queryClient?: QueryClient,
|
|
539
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
540
|
+
export function useGetProjectSuspense<
|
|
541
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
542
|
+
TError = ErrorType<void | DmError>,
|
|
543
|
+
>(
|
|
544
|
+
projectId: string,
|
|
545
|
+
options?: {
|
|
546
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>>;
|
|
547
|
+
request?: SecondParameter<typeof customInstance>;
|
|
548
|
+
},
|
|
549
|
+
queryClient?: QueryClient,
|
|
550
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
394
551
|
/**
|
|
395
|
-
* @summary Get a Project
|
|
552
|
+
* @summary Get a Project (by UUID)
|
|
396
553
|
*/
|
|
397
554
|
|
|
398
|
-
export function useGetProjectSuspense<
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
555
|
+
export function useGetProjectSuspense<
|
|
556
|
+
TData = Awaited<ReturnType<typeof getProject>>,
|
|
557
|
+
TError = ErrorType<void | DmError>,
|
|
558
|
+
>(
|
|
559
|
+
projectId: string,
|
|
560
|
+
options?: {
|
|
561
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>>;
|
|
562
|
+
request?: SecondParameter<typeof customInstance>;
|
|
563
|
+
},
|
|
564
|
+
queryClient?: QueryClient,
|
|
565
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
566
|
+
const queryOptions = useGetProjectSuspenseQueryOptions(projectId, options);
|
|
567
|
+
|
|
568
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
569
|
+
TData,
|
|
570
|
+
TError
|
|
571
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
572
|
+
|
|
573
|
+
query.queryKey = queryOptions.queryKey;
|
|
408
574
|
|
|
409
575
|
return query;
|
|
410
576
|
}
|
|
411
577
|
|
|
412
|
-
|
|
413
|
-
|
|
414
578
|
/**
|
|
415
579
|
* 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
580
|
|
|
417
581
|
* @summary Adjust an existing Project
|
|
418
582
|
*/
|
|
419
583
|
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>}
|
|
584
|
+
projectId: string,
|
|
585
|
+
projectPatchBodyBody: ProjectPatchBodyBody,
|
|
586
|
+
options?: SecondParameter<typeof customInstance>,
|
|
444
587
|
) => {
|
|
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
|
-
|
|
588
|
+
const formUrlEncoded = new URLSearchParams();
|
|
589
|
+
if (projectPatchBodyBody.private !== undefined) {
|
|
590
|
+
formUrlEncoded.append(`private`, projectPatchBodyBody.private.toString());
|
|
591
|
+
}
|
|
592
|
+
if (projectPatchBodyBody.name !== undefined) {
|
|
593
|
+
formUrlEncoded.append(`name`, projectPatchBodyBody.name);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
return customInstance<void>(
|
|
597
|
+
{
|
|
598
|
+
url: `/project/${projectId}`,
|
|
599
|
+
method: "PATCH",
|
|
600
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
601
|
+
data: formUrlEncoded,
|
|
602
|
+
},
|
|
603
|
+
options,
|
|
604
|
+
);
|
|
605
|
+
};
|
|
606
|
+
|
|
607
|
+
export const usePatchProjectMutationOptions = <
|
|
608
|
+
TError = ErrorType<void | DmError>,
|
|
609
|
+
TContext = unknown,
|
|
610
|
+
>(options?: {
|
|
611
|
+
mutation?: UseMutationOptions<
|
|
612
|
+
Awaited<ReturnType<typeof patchProject>>,
|
|
613
|
+
TError,
|
|
614
|
+
{ projectId: string; data: ProjectPatchBodyBody },
|
|
615
|
+
TContext
|
|
616
|
+
>;
|
|
617
|
+
request?: SecondParameter<typeof customInstance>;
|
|
618
|
+
}): UseMutationOptions<
|
|
619
|
+
Awaited<ReturnType<typeof patchProject>>,
|
|
620
|
+
TError,
|
|
621
|
+
{ projectId: string; data: ProjectPatchBodyBody },
|
|
622
|
+
TContext
|
|
623
|
+
> => {
|
|
624
|
+
const mutationKey = ["patchProject"];
|
|
625
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
626
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
627
|
+
? options
|
|
628
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
629
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
630
|
+
|
|
631
|
+
const mutationFn: MutationFunction<
|
|
632
|
+
Awaited<ReturnType<typeof patchProject>>,
|
|
633
|
+
{ projectId: string; data: ProjectPatchBodyBody }
|
|
634
|
+
> = (props) => {
|
|
635
|
+
const { projectId, data } = props ?? {};
|
|
636
|
+
|
|
637
|
+
return patchProject(projectId, data, requestOptions);
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
641
|
+
|
|
642
|
+
return customOptions;
|
|
643
|
+
};
|
|
644
|
+
|
|
645
|
+
export type PatchProjectMutationResult = NonNullable<Awaited<ReturnType<typeof patchProject>>>;
|
|
646
|
+
export type PatchProjectMutationBody = ProjectPatchBodyBody;
|
|
647
|
+
export type PatchProjectMutationError = ErrorType<void | DmError>;
|
|
469
648
|
|
|
470
|
-
|
|
649
|
+
/**
|
|
471
650
|
* @summary Adjust an existing Project
|
|
472
651
|
*/
|
|
473
|
-
export const usePatchProject = <
|
|
474
|
-
|
|
652
|
+
export const usePatchProject = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
653
|
+
options?: {
|
|
654
|
+
mutation?: UseMutationOptions<
|
|
655
|
+
Awaited<ReturnType<typeof patchProject>>,
|
|
656
|
+
TError,
|
|
657
|
+
{ projectId: string; data: ProjectPatchBodyBody },
|
|
658
|
+
TContext
|
|
659
|
+
>;
|
|
660
|
+
request?: SecondParameter<typeof customInstance>;
|
|
661
|
+
},
|
|
662
|
+
queryClient?: QueryClient,
|
|
475
663
|
): UseMutationResult<
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
/**
|
|
664
|
+
Awaited<ReturnType<typeof patchProject>>,
|
|
665
|
+
TError,
|
|
666
|
+
{ projectId: string; data: ProjectPatchBodyBody },
|
|
667
|
+
TContext
|
|
668
|
+
> => {
|
|
669
|
+
const mutationOptions = usePatchProjectMutationOptions(options);
|
|
670
|
+
|
|
671
|
+
return useMutation(mutationOptions, queryClient);
|
|
672
|
+
};
|
|
673
|
+
/**
|
|
487
674
|
* Deletes an existing Project.
|
|
488
675
|
|
|
489
676
|
You must be an `administrator` of the project.
|
|
@@ -493,63 +680,79 @@ Once deleted all **Files**, working directories and material in the Project will
|
|
|
493
680
|
* @summary Delete a Project
|
|
494
681
|
*/
|
|
495
682
|
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>}
|
|
683
|
+
projectId: string,
|
|
684
|
+
options?: SecondParameter<typeof customInstance>,
|
|
510
685
|
) => {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
686
|
+
return customInstance<TaskIdentity>({ url: `/project/${projectId}`, method: "DELETE" }, options);
|
|
687
|
+
};
|
|
688
|
+
|
|
689
|
+
export const useDeleteProjectMutationOptions = <
|
|
690
|
+
TError = ErrorType<void | DmError>,
|
|
691
|
+
TContext = unknown,
|
|
692
|
+
>(options?: {
|
|
693
|
+
mutation?: UseMutationOptions<
|
|
694
|
+
Awaited<ReturnType<typeof deleteProject>>,
|
|
695
|
+
TError,
|
|
696
|
+
{ projectId: string },
|
|
697
|
+
TContext
|
|
698
|
+
>;
|
|
699
|
+
request?: SecondParameter<typeof customInstance>;
|
|
700
|
+
}): UseMutationOptions<
|
|
701
|
+
Awaited<ReturnType<typeof deleteProject>>,
|
|
702
|
+
TError,
|
|
703
|
+
{ projectId: string },
|
|
704
|
+
TContext
|
|
705
|
+
> => {
|
|
706
|
+
const mutationKey = ["deleteProject"];
|
|
707
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
708
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
709
|
+
? options
|
|
710
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
711
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
712
|
+
|
|
713
|
+
const mutationFn: MutationFunction<
|
|
714
|
+
Awaited<ReturnType<typeof deleteProject>>,
|
|
715
|
+
{ projectId: string }
|
|
716
|
+
> = (props) => {
|
|
717
|
+
const { projectId } = props ?? {};
|
|
718
|
+
|
|
719
|
+
return deleteProject(projectId, requestOptions);
|
|
720
|
+
};
|
|
721
|
+
|
|
722
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
723
|
+
|
|
724
|
+
return customOptions;
|
|
725
|
+
};
|
|
726
|
+
|
|
727
|
+
export type DeleteProjectMutationResult = NonNullable<Awaited<ReturnType<typeof deleteProject>>>;
|
|
728
|
+
|
|
729
|
+
export type DeleteProjectMutationError = ErrorType<void | DmError>;
|
|
526
730
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{projectId: string}, TContext>}
|
|
531
|
-
|
|
532
|
-
export type DeleteProjectMutationResult = NonNullable<Awaited<ReturnType<typeof deleteProject>>>
|
|
533
|
-
|
|
534
|
-
export type DeleteProjectMutationError = ErrorType<void | DmError>
|
|
535
|
-
|
|
536
|
-
/**
|
|
731
|
+
/**
|
|
537
732
|
* @summary Delete a Project
|
|
538
733
|
*/
|
|
539
|
-
export const useDeleteProject = <
|
|
540
|
-
|
|
734
|
+
export const useDeleteProject = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
735
|
+
options?: {
|
|
736
|
+
mutation?: UseMutationOptions<
|
|
737
|
+
Awaited<ReturnType<typeof deleteProject>>,
|
|
738
|
+
TError,
|
|
739
|
+
{ projectId: string },
|
|
740
|
+
TContext
|
|
741
|
+
>;
|
|
742
|
+
request?: SecondParameter<typeof customInstance>;
|
|
743
|
+
},
|
|
744
|
+
queryClient?: QueryClient,
|
|
541
745
|
): UseMutationResult<
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
/**
|
|
746
|
+
Awaited<ReturnType<typeof deleteProject>>,
|
|
747
|
+
TError,
|
|
748
|
+
{ projectId: string },
|
|
749
|
+
TContext
|
|
750
|
+
> => {
|
|
751
|
+
const mutationOptions = useDeleteProjectMutationOptions(options);
|
|
752
|
+
|
|
753
|
+
return useMutation(mutationOptions, queryClient);
|
|
754
|
+
};
|
|
755
|
+
/**
|
|
553
756
|
* 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
757
|
|
|
555
758
|
You must be an `administrator` of the project
|
|
@@ -557,64 +760,88 @@ You must be an `administrator` of the project
|
|
|
557
760
|
* @summary Add a Project Administrator
|
|
558
761
|
*/
|
|
559
762
|
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>}
|
|
763
|
+
projectId: string,
|
|
764
|
+
userId: string,
|
|
765
|
+
options?: SecondParameter<typeof customInstance>,
|
|
575
766
|
) => {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
767
|
+
return customInstance<void>(
|
|
768
|
+
{ url: `/project/${projectId}/administrator/${userId}`, method: "PUT" },
|
|
769
|
+
options,
|
|
770
|
+
);
|
|
771
|
+
};
|
|
772
|
+
|
|
773
|
+
export const useAddAdministratorToProjectMutationOptions = <
|
|
774
|
+
TError = ErrorType<void | DmError>,
|
|
775
|
+
TContext = unknown,
|
|
776
|
+
>(options?: {
|
|
777
|
+
mutation?: UseMutationOptions<
|
|
778
|
+
Awaited<ReturnType<typeof addAdministratorToProject>>,
|
|
779
|
+
TError,
|
|
780
|
+
{ projectId: string; userId: string },
|
|
781
|
+
TContext
|
|
782
|
+
>;
|
|
783
|
+
request?: SecondParameter<typeof customInstance>;
|
|
784
|
+
}): UseMutationOptions<
|
|
785
|
+
Awaited<ReturnType<typeof addAdministratorToProject>>,
|
|
786
|
+
TError,
|
|
787
|
+
{ projectId: string; userId: string },
|
|
788
|
+
TContext
|
|
789
|
+
> => {
|
|
790
|
+
const mutationKey = ["addAdministratorToProject"];
|
|
791
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
792
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
793
|
+
? options
|
|
794
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
795
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
796
|
+
|
|
797
|
+
const mutationFn: MutationFunction<
|
|
798
|
+
Awaited<ReturnType<typeof addAdministratorToProject>>,
|
|
799
|
+
{ projectId: string; userId: string }
|
|
800
|
+
> = (props) => {
|
|
801
|
+
const { projectId, userId } = props ?? {};
|
|
802
|
+
|
|
803
|
+
return addAdministratorToProject(projectId, userId, requestOptions);
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
807
|
+
|
|
808
|
+
return customOptions;
|
|
809
|
+
};
|
|
810
|
+
|
|
811
|
+
export type AddAdministratorToProjectMutationResult = NonNullable<
|
|
812
|
+
Awaited<ReturnType<typeof addAdministratorToProject>>
|
|
813
|
+
>;
|
|
814
|
+
|
|
815
|
+
export type AddAdministratorToProjectMutationError = ErrorType<void | DmError>;
|
|
582
816
|
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof addAdministratorToProject>>, {projectId: string;userId: string}> = (props) => {
|
|
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
|
-
/**
|
|
817
|
+
/**
|
|
602
818
|
* @summary Add a Project Administrator
|
|
603
819
|
*/
|
|
604
|
-
export const useAddAdministratorToProject = <
|
|
605
|
-
|
|
820
|
+
export const useAddAdministratorToProject = <
|
|
821
|
+
TError = ErrorType<void | DmError>,
|
|
822
|
+
TContext = unknown,
|
|
823
|
+
>(
|
|
824
|
+
options?: {
|
|
825
|
+
mutation?: UseMutationOptions<
|
|
826
|
+
Awaited<ReturnType<typeof addAdministratorToProject>>,
|
|
827
|
+
TError,
|
|
828
|
+
{ projectId: string; userId: string },
|
|
829
|
+
TContext
|
|
830
|
+
>;
|
|
831
|
+
request?: SecondParameter<typeof customInstance>;
|
|
832
|
+
},
|
|
833
|
+
queryClient?: QueryClient,
|
|
606
834
|
): UseMutationResult<
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
/**
|
|
835
|
+
Awaited<ReturnType<typeof addAdministratorToProject>>,
|
|
836
|
+
TError,
|
|
837
|
+
{ projectId: string; userId: string },
|
|
838
|
+
TContext
|
|
839
|
+
> => {
|
|
840
|
+
const mutationOptions = useAddAdministratorToProjectMutationOptions(options);
|
|
841
|
+
|
|
842
|
+
return useMutation(mutationOptions, queryClient);
|
|
843
|
+
};
|
|
844
|
+
/**
|
|
618
845
|
* Deletes a project `administrator`. The administrator can be you.
|
|
619
846
|
|
|
620
847
|
A project must always have one `administrator` so you will not be able to delete the last administrator of a project.
|
|
@@ -624,64 +851,88 @@ You must be an `administrator` of the project
|
|
|
624
851
|
* @summary Delete a Project Administrator
|
|
625
852
|
*/
|
|
626
853
|
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>}
|
|
854
|
+
projectId: string,
|
|
855
|
+
userId: string,
|
|
856
|
+
options?: SecondParameter<typeof customInstance>,
|
|
642
857
|
) => {
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
858
|
+
return customInstance<void>(
|
|
859
|
+
{ url: `/project/${projectId}/administrator/${userId}`, method: "DELETE" },
|
|
860
|
+
options,
|
|
861
|
+
);
|
|
862
|
+
};
|
|
863
|
+
|
|
864
|
+
export const useRemoveAdministratorFromProjectMutationOptions = <
|
|
865
|
+
TError = ErrorType<DmError | void>,
|
|
866
|
+
TContext = unknown,
|
|
867
|
+
>(options?: {
|
|
868
|
+
mutation?: UseMutationOptions<
|
|
869
|
+
Awaited<ReturnType<typeof removeAdministratorFromProject>>,
|
|
870
|
+
TError,
|
|
871
|
+
{ projectId: string; userId: string },
|
|
872
|
+
TContext
|
|
873
|
+
>;
|
|
874
|
+
request?: SecondParameter<typeof customInstance>;
|
|
875
|
+
}): UseMutationOptions<
|
|
876
|
+
Awaited<ReturnType<typeof removeAdministratorFromProject>>,
|
|
877
|
+
TError,
|
|
878
|
+
{ projectId: string; userId: string },
|
|
879
|
+
TContext
|
|
880
|
+
> => {
|
|
881
|
+
const mutationKey = ["removeAdministratorFromProject"];
|
|
882
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
883
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
884
|
+
? options
|
|
885
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
886
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
887
|
+
|
|
888
|
+
const mutationFn: MutationFunction<
|
|
889
|
+
Awaited<ReturnType<typeof removeAdministratorFromProject>>,
|
|
890
|
+
{ projectId: string; userId: string }
|
|
891
|
+
> = (props) => {
|
|
892
|
+
const { projectId, userId } = props ?? {};
|
|
893
|
+
|
|
894
|
+
return removeAdministratorFromProject(projectId, userId, requestOptions);
|
|
895
|
+
};
|
|
896
|
+
|
|
897
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
898
|
+
|
|
899
|
+
return customOptions;
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
export type RemoveAdministratorFromProjectMutationResult = NonNullable<
|
|
903
|
+
Awaited<ReturnType<typeof removeAdministratorFromProject>>
|
|
904
|
+
>;
|
|
905
|
+
|
|
906
|
+
export type RemoveAdministratorFromProjectMutationError = ErrorType<DmError | void>;
|
|
667
907
|
|
|
668
|
-
|
|
908
|
+
/**
|
|
669
909
|
* @summary Delete a Project Administrator
|
|
670
910
|
*/
|
|
671
|
-
export const useRemoveAdministratorFromProject = <
|
|
672
|
-
|
|
911
|
+
export const useRemoveAdministratorFromProject = <
|
|
912
|
+
TError = ErrorType<DmError | void>,
|
|
913
|
+
TContext = unknown,
|
|
914
|
+
>(
|
|
915
|
+
options?: {
|
|
916
|
+
mutation?: UseMutationOptions<
|
|
917
|
+
Awaited<ReturnType<typeof removeAdministratorFromProject>>,
|
|
918
|
+
TError,
|
|
919
|
+
{ projectId: string; userId: string },
|
|
920
|
+
TContext
|
|
921
|
+
>;
|
|
922
|
+
request?: SecondParameter<typeof customInstance>;
|
|
923
|
+
},
|
|
924
|
+
queryClient?: QueryClient,
|
|
673
925
|
): UseMutationResult<
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
/**
|
|
926
|
+
Awaited<ReturnType<typeof removeAdministratorFromProject>>,
|
|
927
|
+
TError,
|
|
928
|
+
{ projectId: string; userId: string },
|
|
929
|
+
TContext
|
|
930
|
+
> => {
|
|
931
|
+
const mutationOptions = useRemoveAdministratorFromProjectMutationOptions(options);
|
|
932
|
+
|
|
933
|
+
return useMutation(mutationOptions, queryClient);
|
|
934
|
+
};
|
|
935
|
+
/**
|
|
685
936
|
* Adds a user to a Project as an `editor`. Editors can add and remove datasets in a project and delete the project.
|
|
686
937
|
|
|
687
938
|
An `editor` of a project is not automatically an `editor` of any datasets the project contains.
|
|
@@ -691,64 +942,85 @@ You must be an `administrator` of the project
|
|
|
691
942
|
* @summary Add a Project Editor
|
|
692
943
|
*/
|
|
693
944
|
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>}
|
|
945
|
+
projectId: string,
|
|
946
|
+
userId: string,
|
|
947
|
+
options?: SecondParameter<typeof customInstance>,
|
|
709
948
|
) => {
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
949
|
+
return customInstance<void>(
|
|
950
|
+
{ url: `/project/${projectId}/editor/${userId}`, method: "PUT" },
|
|
951
|
+
options,
|
|
952
|
+
);
|
|
953
|
+
};
|
|
954
|
+
|
|
955
|
+
export const useAddEditorToProjectMutationOptions = <
|
|
956
|
+
TError = ErrorType<void | DmError>,
|
|
957
|
+
TContext = unknown,
|
|
958
|
+
>(options?: {
|
|
959
|
+
mutation?: UseMutationOptions<
|
|
960
|
+
Awaited<ReturnType<typeof addEditorToProject>>,
|
|
961
|
+
TError,
|
|
962
|
+
{ projectId: string; userId: string },
|
|
963
|
+
TContext
|
|
964
|
+
>;
|
|
965
|
+
request?: SecondParameter<typeof customInstance>;
|
|
966
|
+
}): UseMutationOptions<
|
|
967
|
+
Awaited<ReturnType<typeof addEditorToProject>>,
|
|
968
|
+
TError,
|
|
969
|
+
{ projectId: string; userId: string },
|
|
970
|
+
TContext
|
|
971
|
+
> => {
|
|
972
|
+
const mutationKey = ["addEditorToProject"];
|
|
973
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
974
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
975
|
+
? options
|
|
976
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
977
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
978
|
+
|
|
979
|
+
const mutationFn: MutationFunction<
|
|
980
|
+
Awaited<ReturnType<typeof addEditorToProject>>,
|
|
981
|
+
{ projectId: string; userId: string }
|
|
982
|
+
> = (props) => {
|
|
983
|
+
const { projectId, userId } = props ?? {};
|
|
984
|
+
|
|
985
|
+
return addEditorToProject(projectId, userId, requestOptions);
|
|
986
|
+
};
|
|
987
|
+
|
|
988
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
989
|
+
|
|
990
|
+
return customOptions;
|
|
991
|
+
};
|
|
992
|
+
|
|
993
|
+
export type AddEditorToProjectMutationResult = NonNullable<
|
|
994
|
+
Awaited<ReturnType<typeof addEditorToProject>>
|
|
995
|
+
>;
|
|
996
|
+
|
|
997
|
+
export type AddEditorToProjectMutationError = ErrorType<void | DmError>;
|
|
725
998
|
|
|
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
|
-
/**
|
|
999
|
+
/**
|
|
736
1000
|
* @summary Add a Project Editor
|
|
737
1001
|
*/
|
|
738
|
-
export const useAddEditorToProject = <
|
|
739
|
-
|
|
1002
|
+
export const useAddEditorToProject = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
1003
|
+
options?: {
|
|
1004
|
+
mutation?: UseMutationOptions<
|
|
1005
|
+
Awaited<ReturnType<typeof addEditorToProject>>,
|
|
1006
|
+
TError,
|
|
1007
|
+
{ projectId: string; userId: string },
|
|
1008
|
+
TContext
|
|
1009
|
+
>;
|
|
1010
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1011
|
+
},
|
|
1012
|
+
queryClient?: QueryClient,
|
|
740
1013
|
): UseMutationResult<
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
/**
|
|
1014
|
+
Awaited<ReturnType<typeof addEditorToProject>>,
|
|
1015
|
+
TError,
|
|
1016
|
+
{ projectId: string; userId: string },
|
|
1017
|
+
TContext
|
|
1018
|
+
> => {
|
|
1019
|
+
const mutationOptions = useAddEditorToProjectMutationOptions(options);
|
|
1020
|
+
|
|
1021
|
+
return useMutation(mutationOptions, queryClient);
|
|
1022
|
+
};
|
|
1023
|
+
/**
|
|
752
1024
|
* Deletes a project `editor`. The editor can be you.
|
|
753
1025
|
|
|
754
1026
|
A project must always have one `editor` so you will not be able to delete the last editor of a project.
|
|
@@ -758,64 +1030,85 @@ You must be an `administrator` of the project
|
|
|
758
1030
|
* @summary Delete a Project Editor
|
|
759
1031
|
*/
|
|
760
1032
|
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>}
|
|
1033
|
+
projectId: string,
|
|
1034
|
+
userId: string,
|
|
1035
|
+
options?: SecondParameter<typeof customInstance>,
|
|
776
1036
|
) => {
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
1037
|
+
return customInstance<void>(
|
|
1038
|
+
{ url: `/project/${projectId}/editor/${userId}`, method: "DELETE" },
|
|
1039
|
+
options,
|
|
1040
|
+
);
|
|
1041
|
+
};
|
|
1042
|
+
|
|
1043
|
+
export const useRemoveEditorFromProjectMutationOptions = <
|
|
1044
|
+
TError = ErrorType<DmError | void>,
|
|
1045
|
+
TContext = unknown,
|
|
1046
|
+
>(options?: {
|
|
1047
|
+
mutation?: UseMutationOptions<
|
|
1048
|
+
Awaited<ReturnType<typeof removeEditorFromProject>>,
|
|
1049
|
+
TError,
|
|
1050
|
+
{ projectId: string; userId: string },
|
|
1051
|
+
TContext
|
|
1052
|
+
>;
|
|
1053
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1054
|
+
}): UseMutationOptions<
|
|
1055
|
+
Awaited<ReturnType<typeof removeEditorFromProject>>,
|
|
1056
|
+
TError,
|
|
1057
|
+
{ projectId: string; userId: string },
|
|
1058
|
+
TContext
|
|
1059
|
+
> => {
|
|
1060
|
+
const mutationKey = ["removeEditorFromProject"];
|
|
1061
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
1062
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
1063
|
+
? options
|
|
1064
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1065
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
1066
|
+
|
|
1067
|
+
const mutationFn: MutationFunction<
|
|
1068
|
+
Awaited<ReturnType<typeof removeEditorFromProject>>,
|
|
1069
|
+
{ projectId: string; userId: string }
|
|
1070
|
+
> = (props) => {
|
|
1071
|
+
const { projectId, userId } = props ?? {};
|
|
1072
|
+
|
|
1073
|
+
return removeEditorFromProject(projectId, userId, requestOptions);
|
|
1074
|
+
};
|
|
1075
|
+
|
|
1076
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
1077
|
+
|
|
1078
|
+
return customOptions;
|
|
1079
|
+
};
|
|
1080
|
+
|
|
1081
|
+
export type RemoveEditorFromProjectMutationResult = NonNullable<
|
|
1082
|
+
Awaited<ReturnType<typeof removeEditorFromProject>>
|
|
1083
|
+
>;
|
|
1084
|
+
|
|
1085
|
+
export type RemoveEditorFromProjectMutationError = ErrorType<DmError | void>;
|
|
783
1086
|
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof removeEditorFromProject>>, {projectId: string;userId: string}> = (props) => {
|
|
788
|
-
const {projectId,userId} = props ?? {};
|
|
789
|
-
|
|
790
|
-
return removeEditorFromProject(projectId,userId,requestOptions)
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
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
|
-
/**
|
|
1087
|
+
/**
|
|
803
1088
|
* @summary Delete a Project Editor
|
|
804
1089
|
*/
|
|
805
|
-
export const useRemoveEditorFromProject = <
|
|
806
|
-
|
|
1090
|
+
export const useRemoveEditorFromProject = <TError = ErrorType<DmError | void>, TContext = unknown>(
|
|
1091
|
+
options?: {
|
|
1092
|
+
mutation?: UseMutationOptions<
|
|
1093
|
+
Awaited<ReturnType<typeof removeEditorFromProject>>,
|
|
1094
|
+
TError,
|
|
1095
|
+
{ projectId: string; userId: string },
|
|
1096
|
+
TContext
|
|
1097
|
+
>;
|
|
1098
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1099
|
+
},
|
|
1100
|
+
queryClient?: QueryClient,
|
|
807
1101
|
): UseMutationResult<
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
/**
|
|
1102
|
+
Awaited<ReturnType<typeof removeEditorFromProject>>,
|
|
1103
|
+
TError,
|
|
1104
|
+
{ projectId: string; userId: string },
|
|
1105
|
+
TContext
|
|
1106
|
+
> => {
|
|
1107
|
+
const mutationOptions = useRemoveEditorFromProjectMutationOptions(options);
|
|
1108
|
+
|
|
1109
|
+
return useMutation(mutationOptions, queryClient);
|
|
1110
|
+
};
|
|
1111
|
+
/**
|
|
819
1112
|
* 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
1113
|
|
|
821
1114
|
You must be an `administrator` of the Project to add Observers
|
|
@@ -823,64 +1116,85 @@ You must be an `administrator` of the Project to add Observers
|
|
|
823
1116
|
* @summary Add a Project Observer
|
|
824
1117
|
*/
|
|
825
1118
|
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>}
|
|
1119
|
+
projectId: string,
|
|
1120
|
+
userId: string,
|
|
1121
|
+
options?: SecondParameter<typeof customInstance>,
|
|
841
1122
|
) => {
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
1123
|
+
return customInstance<void>(
|
|
1124
|
+
{ url: `/project/${projectId}/observer/${userId}`, method: "PUT" },
|
|
1125
|
+
options,
|
|
1126
|
+
);
|
|
1127
|
+
};
|
|
1128
|
+
|
|
1129
|
+
export const useAddObserverToProjectMutationOptions = <
|
|
1130
|
+
TError = ErrorType<void | DmError>,
|
|
1131
|
+
TContext = unknown,
|
|
1132
|
+
>(options?: {
|
|
1133
|
+
mutation?: UseMutationOptions<
|
|
1134
|
+
Awaited<ReturnType<typeof addObserverToProject>>,
|
|
1135
|
+
TError,
|
|
1136
|
+
{ projectId: string; userId: string },
|
|
1137
|
+
TContext
|
|
1138
|
+
>;
|
|
1139
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1140
|
+
}): UseMutationOptions<
|
|
1141
|
+
Awaited<ReturnType<typeof addObserverToProject>>,
|
|
1142
|
+
TError,
|
|
1143
|
+
{ projectId: string; userId: string },
|
|
1144
|
+
TContext
|
|
1145
|
+
> => {
|
|
1146
|
+
const mutationKey = ["addObserverToProject"];
|
|
1147
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
1148
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
1149
|
+
? options
|
|
1150
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1151
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
1152
|
+
|
|
1153
|
+
const mutationFn: MutationFunction<
|
|
1154
|
+
Awaited<ReturnType<typeof addObserverToProject>>,
|
|
1155
|
+
{ projectId: string; userId: string }
|
|
1156
|
+
> = (props) => {
|
|
1157
|
+
const { projectId, userId } = props ?? {};
|
|
1158
|
+
|
|
1159
|
+
return addObserverToProject(projectId, userId, requestOptions);
|
|
1160
|
+
};
|
|
1161
|
+
|
|
1162
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
1163
|
+
|
|
1164
|
+
return customOptions;
|
|
1165
|
+
};
|
|
1166
|
+
|
|
1167
|
+
export type AddObserverToProjectMutationResult = NonNullable<
|
|
1168
|
+
Awaited<ReturnType<typeof addObserverToProject>>
|
|
1169
|
+
>;
|
|
1170
|
+
|
|
1171
|
+
export type AddObserverToProjectMutationError = ErrorType<void | DmError>;
|
|
866
1172
|
|
|
867
|
-
|
|
1173
|
+
/**
|
|
868
1174
|
* @summary Add a Project Observer
|
|
869
1175
|
*/
|
|
870
|
-
export const useAddObserverToProject = <
|
|
871
|
-
|
|
1176
|
+
export const useAddObserverToProject = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
1177
|
+
options?: {
|
|
1178
|
+
mutation?: UseMutationOptions<
|
|
1179
|
+
Awaited<ReturnType<typeof addObserverToProject>>,
|
|
1180
|
+
TError,
|
|
1181
|
+
{ projectId: string; userId: string },
|
|
1182
|
+
TContext
|
|
1183
|
+
>;
|
|
1184
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1185
|
+
},
|
|
1186
|
+
queryClient?: QueryClient,
|
|
872
1187
|
): UseMutationResult<
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
/**
|
|
1188
|
+
Awaited<ReturnType<typeof addObserverToProject>>,
|
|
1189
|
+
TError,
|
|
1190
|
+
{ projectId: string; userId: string },
|
|
1191
|
+
TContext
|
|
1192
|
+
> => {
|
|
1193
|
+
const mutationOptions = useAddObserverToProjectMutationOptions(options);
|
|
1194
|
+
|
|
1195
|
+
return useMutation(mutationOptions, queryClient);
|
|
1196
|
+
};
|
|
1197
|
+
/**
|
|
884
1198
|
* Deletes a project `observer`.
|
|
885
1199
|
|
|
886
1200
|
You must be an `administrator` of the Project to remove Observers
|
|
@@ -888,455 +1202,84 @@ You must be an `administrator` of the Project to remove Observers
|
|
|
888
1202
|
* @summary Delete a Project Observer
|
|
889
1203
|
*/
|
|
890
1204
|
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>}
|
|
906
|
-
) => {
|
|
907
|
-
const mutationKey = ['removeObserverFromProject'];
|
|
908
|
-
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
909
|
-
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
910
|
-
options
|
|
911
|
-
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
912
|
-
: {mutation: { mutationKey, }, request: undefined};
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof removeObserverFromProject>>, {projectId: string;userId: string}> = (props) => {
|
|
918
|
-
const {projectId,userId} = props ?? {};
|
|
919
|
-
|
|
920
|
-
return removeObserverFromProject(projectId,userId,requestOptions)
|
|
921
|
-
}
|
|
922
|
-
|
|
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
|
-
/**
|
|
933
|
-
* @summary Delete a Project Observer
|
|
934
|
-
*/
|
|
935
|
-
export const useRemoveObserverFromProject = <TData = Awaited<ReturnType<typeof removeObserverFromProject>>, TError = ErrorType<DmError | void>,
|
|
936
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{projectId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
937
|
-
): UseMutationResult<
|
|
938
|
-
TData,
|
|
939
|
-
TError,
|
|
940
|
-
{projectId: string;userId: string},
|
|
941
|
-
TContext
|
|
942
|
-
> => {
|
|
943
|
-
|
|
944
|
-
const mutationOptions = getRemoveObserverFromProjectMutationOptions(options);
|
|
945
|
-
|
|
946
|
-
return useMutation(mutationOptions);
|
|
947
|
-
}
|
|
948
|
-
/**
|
|
949
|
-
* 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
|
-
|
|
951
|
-
For **managed** files you should consider using the `/file/{file_id}` endpoint.
|
|
952
|
-
|
|
953
|
-
You must be an `editor` of the Project if the Project is `private`
|
|
954
|
-
|
|
955
|
-
* @summary Download a Project file
|
|
956
|
-
*/
|
|
957
|
-
export const getProjectFile = (
|
|
958
|
-
projectId: string,
|
|
959
|
-
params: GetProjectFileParams,
|
|
960
|
-
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
1205
|
+
projectId: string,
|
|
1206
|
+
userId: string,
|
|
1207
|
+
options?: SecondParameter<typeof customInstance>,
|
|
961
1208
|
) => {
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
1209
|
+
return customInstance<void>(
|
|
1210
|
+
{ url: `/project/${projectId}/observer/${userId}`, method: "DELETE" },
|
|
1211
|
+
options,
|
|
1212
|
+
);
|
|
1213
|
+
};
|
|
1214
|
+
|
|
1215
|
+
export const useRemoveObserverFromProjectMutationOptions = <
|
|
1216
|
+
TError = ErrorType<DmError | void>,
|
|
1217
|
+
TContext = unknown,
|
|
1218
|
+
>(options?: {
|
|
1219
|
+
mutation?: UseMutationOptions<
|
|
1220
|
+
Awaited<ReturnType<typeof removeObserverFromProject>>,
|
|
1221
|
+
TError,
|
|
1222
|
+
{ projectId: string; userId: string },
|
|
1223
|
+
TContext
|
|
1224
|
+
>;
|
|
1225
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1226
|
+
}): UseMutationOptions<
|
|
1227
|
+
Awaited<ReturnType<typeof removeObserverFromProject>>,
|
|
1228
|
+
TError,
|
|
1229
|
+
{ projectId: string; userId: string },
|
|
1230
|
+
TContext
|
|
1231
|
+
> => {
|
|
1232
|
+
const mutationKey = ["removeObserverFromProject"];
|
|
1233
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
1234
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
1235
|
+
? options
|
|
1236
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1237
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
1238
|
+
|
|
1239
|
+
const mutationFn: MutationFunction<
|
|
1240
|
+
Awaited<ReturnType<typeof removeObserverFromProject>>,
|
|
1241
|
+
{ projectId: string; userId: string }
|
|
1242
|
+
> = (props) => {
|
|
1243
|
+
const { projectId, userId } = props ?? {};
|
|
1244
|
+
|
|
1245
|
+
return removeObserverFromProject(projectId, userId, requestOptions);
|
|
1246
|
+
};
|
|
1247
|
+
|
|
1248
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
1249
|
+
|
|
1250
|
+
return customOptions;
|
|
1251
|
+
};
|
|
1252
|
+
|
|
1253
|
+
export type RemoveObserverFromProjectMutationResult = NonNullable<
|
|
1254
|
+
Awaited<ReturnType<typeof removeObserverFromProject>>
|
|
1255
|
+
>;
|
|
1256
|
+
|
|
1257
|
+
export type RemoveObserverFromProjectMutationError = ErrorType<DmError | void>;
|
|
993
1258
|
|
|
994
|
-
return { queryKey, queryFn, enabled: !!(projectId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
995
|
-
}
|
|
996
|
-
|
|
997
|
-
export type GetProjectFileQueryResult = NonNullable<Awaited<ReturnType<typeof getProjectFile>>>
|
|
998
|
-
export type GetProjectFileQueryError = ErrorType<void | DmError>
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
export function useGetProjectFile<TData = Awaited<ReturnType<typeof getProjectFile>>, TError = ErrorType<void | DmError>>(
|
|
1002
|
-
projectId: string,
|
|
1003
|
-
params: GetProjectFileParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>> & Pick<
|
|
1004
|
-
DefinedInitialDataOptions<
|
|
1005
|
-
Awaited<ReturnType<typeof getProjectFile>>,
|
|
1006
|
-
TError,
|
|
1007
|
-
TData
|
|
1008
|
-
> , 'initialData'
|
|
1009
|
-
>, request?: SecondParameter<typeof customInstance>}
|
|
1010
|
-
|
|
1011
|
-
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
1012
|
-
export function useGetProjectFile<TData = Awaited<ReturnType<typeof getProjectFile>>, TError = ErrorType<void | DmError>>(
|
|
1013
|
-
projectId: string,
|
|
1014
|
-
params: GetProjectFileParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>> & Pick<
|
|
1015
|
-
UndefinedInitialDataOptions<
|
|
1016
|
-
Awaited<ReturnType<typeof getProjectFile>>,
|
|
1017
|
-
TError,
|
|
1018
|
-
TData
|
|
1019
|
-
> , 'initialData'
|
|
1020
|
-
>, request?: SecondParameter<typeof customInstance>}
|
|
1021
|
-
|
|
1022
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
1023
|
-
export function useGetProjectFile<TData = Awaited<ReturnType<typeof getProjectFile>>, TError = ErrorType<void | DmError>>(
|
|
1024
|
-
projectId: string,
|
|
1025
|
-
params: GetProjectFileParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
1026
|
-
|
|
1027
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
1028
1259
|
/**
|
|
1029
|
-
* @summary
|
|
1030
|
-
*/
|
|
1031
|
-
|
|
1032
|
-
export function useGetProjectFile<TData = Awaited<ReturnType<typeof getProjectFile>>, TError = ErrorType<void | DmError>>(
|
|
1033
|
-
projectId: string,
|
|
1034
|
-
params: GetProjectFileParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
1035
|
-
|
|
1036
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
1037
|
-
|
|
1038
|
-
const queryOptions = getGetProjectFileQueryOptions(projectId,params,options)
|
|
1039
|
-
|
|
1040
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1041
|
-
|
|
1042
|
-
query.queryKey = queryOptions.queryKey ;
|
|
1043
|
-
|
|
1044
|
-
return query;
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
export const getGetProjectFileSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getProjectFile>>, TError = ErrorType<void | DmError>>(projectId: string,
|
|
1050
|
-
params: GetProjectFileParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
1051
|
-
) => {
|
|
1052
|
-
|
|
1053
|
-
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
1054
|
-
|
|
1055
|
-
const queryKey = queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectId,params);
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFile>>> = ({ signal }) => getProjectFile(projectId,params, requestOptions, signal);
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
export type GetProjectFileSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProjectFile>>>
|
|
1069
|
-
export type GetProjectFileSuspenseQueryError = ErrorType<void | DmError>
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
export function useGetProjectFileSuspense<TData = Awaited<ReturnType<typeof getProjectFile>>, TError = ErrorType<void | DmError>>(
|
|
1073
|
-
projectId: string,
|
|
1074
|
-
params: GetProjectFileParams, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
1075
|
-
|
|
1076
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
1077
|
-
export function useGetProjectFileSuspense<TData = Awaited<ReturnType<typeof getProjectFile>>, TError = ErrorType<void | DmError>>(
|
|
1078
|
-
projectId: string,
|
|
1079
|
-
params: GetProjectFileParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
1080
|
-
|
|
1081
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
1082
|
-
export function useGetProjectFileSuspense<TData = Awaited<ReturnType<typeof getProjectFile>>, TError = ErrorType<void | DmError>>(
|
|
1083
|
-
projectId: string,
|
|
1084
|
-
params: GetProjectFileParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
1085
|
-
|
|
1086
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
1087
|
-
/**
|
|
1088
|
-
* @summary Download a Project file
|
|
1089
|
-
*/
|
|
1090
|
-
|
|
1091
|
-
export function useGetProjectFileSuspense<TData = Awaited<ReturnType<typeof getProjectFile>>, TError = ErrorType<void | DmError>>(
|
|
1092
|
-
projectId: string,
|
|
1093
|
-
params: GetProjectFileParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
1094
|
-
|
|
1095
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
1096
|
-
|
|
1097
|
-
const queryOptions = getGetProjectFileSuspenseQueryOptions(projectId,params,options)
|
|
1098
|
-
|
|
1099
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1100
|
-
|
|
1101
|
-
query.queryKey = queryOptions.queryKey ;
|
|
1102
|
-
|
|
1103
|
-
return query;
|
|
1104
|
-
}
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
/**
|
|
1109
|
-
* 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
|
-
|
|
1111
|
-
You must be an `editor` of the project
|
|
1112
|
-
|
|
1113
|
-
* @summary Upload a file into a Project
|
|
1114
|
-
*/
|
|
1115
|
-
export const addFileToProject = (
|
|
1116
|
-
projectId: string,
|
|
1117
|
-
projectFilePutBodyBody: ProjectFilePutBodyBody,
|
|
1118
|
-
options?: SecondParameter<typeof customInstance>,) => {
|
|
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>}
|
|
1141
|
-
) => {
|
|
1142
|
-
const mutationKey = ['addFileToProject'];
|
|
1143
|
-
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
1144
|
-
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1145
|
-
options
|
|
1146
|
-
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
1147
|
-
: {mutation: { mutationKey, }, request: undefined};
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof addFileToProject>>, {projectId: string;data: ProjectFilePutBodyBody}> = (props) => {
|
|
1153
|
-
const {projectId,data} = props ?? {};
|
|
1154
|
-
|
|
1155
|
-
return addFileToProject(projectId,data,requestOptions)
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{projectId: string;data: ProjectFilePutBodyBody}, TContext>}
|
|
1162
|
-
|
|
1163
|
-
export type AddFileToProjectMutationResult = NonNullable<Awaited<ReturnType<typeof addFileToProject>>>
|
|
1164
|
-
export type AddFileToProjectMutationBody = ProjectFilePutBodyBody
|
|
1165
|
-
export type AddFileToProjectMutationError = ErrorType<void | DmError>
|
|
1166
|
-
|
|
1167
|
-
/**
|
|
1168
|
-
* @summary Upload a file into a Project
|
|
1260
|
+
* @summary Delete a Project Observer
|
|
1169
1261
|
*/
|
|
1170
|
-
export const
|
|
1171
|
-
|
|
1262
|
+
export const useRemoveObserverFromProject = <
|
|
1263
|
+
TError = ErrorType<DmError | void>,
|
|
1264
|
+
TContext = unknown,
|
|
1265
|
+
>(
|
|
1266
|
+
options?: {
|
|
1267
|
+
mutation?: UseMutationOptions<
|
|
1268
|
+
Awaited<ReturnType<typeof removeObserverFromProject>>,
|
|
1269
|
+
TError,
|
|
1270
|
+
{ projectId: string; userId: string },
|
|
1271
|
+
TContext
|
|
1272
|
+
>;
|
|
1273
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1274
|
+
},
|
|
1275
|
+
queryClient?: QueryClient,
|
|
1172
1276
|
): UseMutationResult<
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
}
|
|
1183
|
-
/**
|
|
1184
|
-
* 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
|
-
|
|
1186
|
-
For **managed** files you should consider using the `/file/{file_id}` endpoint.
|
|
1187
|
-
|
|
1188
|
-
As there is no authentication for this endpoint you must provide a valid token. The token must be a token valid for the project, usually generated when an **Instance** has been launched in the Project.
|
|
1189
|
-
|
|
1190
|
-
* @summary Download a Project file using a Token
|
|
1191
|
-
*/
|
|
1192
|
-
export const getProjectFileWithToken = (
|
|
1193
|
-
projectId: string,
|
|
1194
|
-
params: GetProjectFileWithTokenParams,
|
|
1195
|
-
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
1196
|
-
) => {
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
return customInstance<void>(
|
|
1200
|
-
{url: `/project/${projectId}/file-with-token`, method: 'GET',
|
|
1201
|
-
params, signal
|
|
1202
|
-
},
|
|
1203
|
-
options);
|
|
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>}
|
|
1215
|
-
) => {
|
|
1216
|
-
|
|
1217
|
-
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
1218
|
-
|
|
1219
|
-
const queryKey = queryOptions?.queryKey ?? getGetProjectFileWithTokenQueryKey(projectId,params);
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFileWithToken>>> = ({ signal }) => getProjectFileWithToken(projectId,params, requestOptions, signal);
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
return { queryKey, queryFn, enabled: !!(projectId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
export type GetProjectFileWithTokenQueryResult = NonNullable<Awaited<ReturnType<typeof getProjectFileWithToken>>>
|
|
1233
|
-
export type GetProjectFileWithTokenQueryError = ErrorType<DmError>
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
export function useGetProjectFileWithToken<TData = Awaited<ReturnType<typeof getProjectFileWithToken>>, TError = ErrorType<DmError>>(
|
|
1237
|
-
projectId: string,
|
|
1238
|
-
params: GetProjectFileWithTokenParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>> & Pick<
|
|
1239
|
-
DefinedInitialDataOptions<
|
|
1240
|
-
Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1241
|
-
TError,
|
|
1242
|
-
TData
|
|
1243
|
-
> , 'initialData'
|
|
1244
|
-
>, request?: SecondParameter<typeof customInstance>}
|
|
1245
|
-
|
|
1246
|
-
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
1247
|
-
export function useGetProjectFileWithToken<TData = Awaited<ReturnType<typeof getProjectFileWithToken>>, TError = ErrorType<DmError>>(
|
|
1248
|
-
projectId: string,
|
|
1249
|
-
params: GetProjectFileWithTokenParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>> & Pick<
|
|
1250
|
-
UndefinedInitialDataOptions<
|
|
1251
|
-
Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1252
|
-
TError,
|
|
1253
|
-
TData
|
|
1254
|
-
> , 'initialData'
|
|
1255
|
-
>, request?: SecondParameter<typeof customInstance>}
|
|
1256
|
-
|
|
1257
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
1258
|
-
export function useGetProjectFileWithToken<TData = Awaited<ReturnType<typeof getProjectFileWithToken>>, TError = ErrorType<DmError>>(
|
|
1259
|
-
projectId: string,
|
|
1260
|
-
params: GetProjectFileWithTokenParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
1261
|
-
|
|
1262
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
1263
|
-
/**
|
|
1264
|
-
* @summary Download a Project file using a Token
|
|
1265
|
-
*/
|
|
1266
|
-
|
|
1267
|
-
export function useGetProjectFileWithToken<TData = Awaited<ReturnType<typeof getProjectFileWithToken>>, TError = ErrorType<DmError>>(
|
|
1268
|
-
projectId: string,
|
|
1269
|
-
params: GetProjectFileWithTokenParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
1270
|
-
|
|
1271
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
1272
|
-
|
|
1273
|
-
const queryOptions = getGetProjectFileWithTokenQueryOptions(projectId,params,options)
|
|
1274
|
-
|
|
1275
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1276
|
-
|
|
1277
|
-
query.queryKey = queryOptions.queryKey ;
|
|
1278
|
-
|
|
1279
|
-
return query;
|
|
1280
|
-
}
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
export const getGetProjectFileWithTokenSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getProjectFileWithToken>>, TError = ErrorType<DmError>>(projectId: string,
|
|
1285
|
-
params: GetProjectFileWithTokenParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
1286
|
-
) => {
|
|
1287
|
-
|
|
1288
|
-
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
1289
|
-
|
|
1290
|
-
const queryKey = queryOptions?.queryKey ?? getGetProjectFileWithTokenQueryKey(projectId,params);
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFileWithToken>>> = ({ signal }) => getProjectFileWithToken(projectId,params, requestOptions, signal);
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
export type GetProjectFileWithTokenSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getProjectFileWithToken>>>
|
|
1304
|
-
export type GetProjectFileWithTokenSuspenseQueryError = ErrorType<DmError>
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
export function useGetProjectFileWithTokenSuspense<TData = Awaited<ReturnType<typeof getProjectFileWithToken>>, TError = ErrorType<DmError>>(
|
|
1308
|
-
projectId: string,
|
|
1309
|
-
params: GetProjectFileWithTokenParams, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
1310
|
-
|
|
1311
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
1312
|
-
export function useGetProjectFileWithTokenSuspense<TData = Awaited<ReturnType<typeof getProjectFileWithToken>>, TError = ErrorType<DmError>>(
|
|
1313
|
-
projectId: string,
|
|
1314
|
-
params: GetProjectFileWithTokenParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
1315
|
-
|
|
1316
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
1317
|
-
export function useGetProjectFileWithTokenSuspense<TData = Awaited<ReturnType<typeof getProjectFileWithToken>>, TError = ErrorType<DmError>>(
|
|
1318
|
-
projectId: string,
|
|
1319
|
-
params: GetProjectFileWithTokenParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
1320
|
-
|
|
1321
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
1322
|
-
/**
|
|
1323
|
-
* @summary Download a Project file using a Token
|
|
1324
|
-
*/
|
|
1325
|
-
|
|
1326
|
-
export function useGetProjectFileWithTokenSuspense<TData = Awaited<ReturnType<typeof getProjectFileWithToken>>, TError = ErrorType<DmError>>(
|
|
1327
|
-
projectId: string,
|
|
1328
|
-
params: GetProjectFileWithTokenParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
1329
|
-
|
|
1330
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
1331
|
-
|
|
1332
|
-
const queryOptions = getGetProjectFileWithTokenSuspenseQueryOptions(projectId,params,options)
|
|
1333
|
-
|
|
1334
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1335
|
-
|
|
1336
|
-
query.queryKey = queryOptions.queryKey ;
|
|
1337
|
-
|
|
1338
|
-
return query;
|
|
1339
|
-
}
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1277
|
+
Awaited<ReturnType<typeof removeObserverFromProject>>,
|
|
1278
|
+
TError,
|
|
1279
|
+
{ projectId: string; userId: string },
|
|
1280
|
+
TContext
|
|
1281
|
+
> => {
|
|
1282
|
+
const mutationOptions = useRemoveObserverFromProjectMutationOptions(options);
|
|
1283
|
+
|
|
1284
|
+
return useMutation(mutationOptions, queryClient);
|
|
1285
|
+
};
|