@squonk/data-manager-client 1.0.6-rc.2 → 1.0.6
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 +21 -17
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.ts +1 -1
- package/accounting/accounting.js +22 -18
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +30 -6
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +19 -19
- package/admin/admin.js +31 -7
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +16 -15
- package/application/application.cjs.map +1 -1
- package/application/application.d.ts +1 -1
- package/application/application.js +17 -16
- package/application/application.js.map +1 -1
- package/{custom-instance-c4af1ee9.d.ts → custom-instance-9e5c9e19.d.ts} +299 -299
- package/dataset/dataset.cjs +47 -58
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +16 -16
- package/dataset/dataset.js +48 -59
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs +23 -11
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.ts +7 -7
- package/exchange-rate/exchange-rate.js +24 -12
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file/file.cjs +29 -27
- package/file/file.cjs.map +1 -1
- package/file/file.d.ts +10 -10
- package/file/file.js +30 -28
- package/file/file.js.map +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs +34 -30
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.ts +10 -10
- package/instance/instance.js +35 -31
- package/instance/instance.js.map +1 -1
- package/job/job.cjs +24 -26
- package/job/job.cjs.map +1 -1
- package/job/job.d.ts +1 -1
- package/job/job.js +25 -27
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +13 -19
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.ts +7 -7
- package/metadata/metadata.js +14 -20
- package/metadata/metadata.js.map +1 -1
- package/package.json +1 -1
- package/project/project.cjs +38 -31
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +19 -19
- package/project/project.js +39 -32
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +96 -132
- package/src/admin/admin.ts +307 -442
- package/src/application/application.ts +66 -94
- package/src/data-manager-api.schemas.ts +425 -470
- package/src/dataset/dataset.ts +367 -554
- package/src/exchange-rate/exchange-rate.ts +221 -339
- package/src/file/file.ts +177 -253
- package/src/instance/instance.ts +217 -314
- package/src/job/job.ts +88 -116
- package/src/metadata/metadata.ts +154 -245
- package/src/project/project.ts +347 -511
- package/src/task/task.ts +105 -141
- package/src/type/type.ts +38 -43
- package/src/user/user.ts +136 -197
- package/task/task.cjs +25 -27
- package/task/task.cjs.map +1 -1
- package/task/task.d.ts +1 -1
- package/task/task.js +26 -28
- package/task/task.js.map +1 -1
- package/type/type.cjs +8 -4
- package/type/type.cjs.map +1 -1
- package/type/type.d.ts +1 -1
- package/type/type.js +9 -5
- package/type/type.js.map +1 -1
- package/user/user.cjs +28 -33
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +4 -4
- package/user/user.js +29 -34
- package/user/user.js.map +1 -1
package/src/admin/admin.ts
CHANGED
|
@@ -8,15 +8,18 @@ A service that allows *registered* users to make **Datasets** and associated **M
|
|
|
8
8
|
|
|
9
9
|
* OpenAPI spec version: 1.0
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
useQuery,
|
|
13
|
+
useMutation
|
|
14
|
+
} from 'react-query'
|
|
12
15
|
import type {
|
|
13
16
|
UseQueryOptions,
|
|
14
17
|
UseMutationOptions,
|
|
15
18
|
QueryFunction,
|
|
16
19
|
MutationFunction,
|
|
17
20
|
UseQueryResult,
|
|
18
|
-
QueryKey
|
|
19
|
-
} from
|
|
21
|
+
QueryKey
|
|
22
|
+
} from 'react-query'
|
|
20
23
|
import type {
|
|
21
24
|
ServiceErrorsGetResponse,
|
|
22
25
|
DmError,
|
|
@@ -26,15 +29,16 @@ import type {
|
|
|
26
29
|
AdminJobManifestGetResponse,
|
|
27
30
|
AdminJobManifestLoadPutResponse,
|
|
28
31
|
JobManifestPutBodyBody,
|
|
29
|
-
JobManifestLoadPutBodyBody
|
|
30
|
-
} from
|
|
31
|
-
import { customInstance } from
|
|
32
|
-
import type { ErrorType } from
|
|
32
|
+
JobManifestLoadPutBodyBody
|
|
33
|
+
} from '../data-manager-api.schemas'
|
|
34
|
+
import { customInstance } from '.././custom-instance'
|
|
35
|
+
import type { ErrorType } from '.././custom-instance'
|
|
36
|
+
|
|
33
37
|
|
|
34
38
|
// eslint-disable-next-line
|
|
35
|
-
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
39
|
+
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
36
40
|
config: any,
|
|
37
|
-
args: infer P
|
|
41
|
+
args: infer P,
|
|
38
42
|
) => any
|
|
39
43
|
? P
|
|
40
44
|
: never;
|
|
@@ -47,60 +51,42 @@ You will need **admin** rights to use this endpoint
|
|
|
47
51
|
* @summary Gets Service Errors
|
|
48
52
|
*/
|
|
49
53
|
export const adminGetServiceErrors = (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
signal?: AbortSignal
|
|
54
|
+
params?: AdminGetServiceErrorsParams,
|
|
55
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
53
56
|
) => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
) => [`/admin/service-error`, ...(params ? [params]
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
TError
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
83
|
-
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
84
|
-
|
|
85
|
-
const queryKey =
|
|
86
|
-
queryOptions?.queryKey ?? getAdminGetServiceErrorsQueryKey(params);
|
|
87
|
-
|
|
88
|
-
const queryFn: QueryFunction<
|
|
89
|
-
Awaited<ReturnType<typeof adminGetServiceErrors>>
|
|
90
|
-
> = ({ signal }) => adminGetServiceErrors(params, requestOptions, signal);
|
|
91
|
-
|
|
92
|
-
const query = useQuery<
|
|
93
|
-
Awaited<ReturnType<typeof adminGetServiceErrors>>,
|
|
94
|
-
TError,
|
|
95
|
-
TData
|
|
96
|
-
>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {
|
|
97
|
-
queryKey: QueryKey;
|
|
98
|
-
};
|
|
57
|
+
return customInstance<ServiceErrorsGetResponse>(
|
|
58
|
+
{url: `/admin/service-error`, method: 'get',
|
|
59
|
+
params, signal
|
|
60
|
+
},
|
|
61
|
+
options);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
export const getAdminGetServiceErrorsQueryKey = (params?: AdminGetServiceErrorsParams,) => [`/admin/service-error`, ...(params ? [params]: [])];
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
export type AdminGetServiceErrorsQueryResult = NonNullable<Awaited<ReturnType<typeof adminGetServiceErrors>>>
|
|
69
|
+
export type AdminGetServiceErrorsQueryError = ErrorType<void | DmError>
|
|
70
|
+
|
|
71
|
+
export const useAdminGetServiceErrors = <TData = Awaited<ReturnType<typeof adminGetServiceErrors>>, TError = ErrorType<void | DmError>>(
|
|
72
|
+
params?: AdminGetServiceErrorsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof adminGetServiceErrors>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
73
|
+
|
|
74
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
75
|
+
|
|
76
|
+
const {query: queryOptions, request: requestOptions} = options ?? {}
|
|
77
|
+
|
|
78
|
+
const queryKey = queryOptions?.queryKey ?? getAdminGetServiceErrorsQueryKey(params);
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof adminGetServiceErrors>>> = ({ signal }) => adminGetServiceErrors(params, requestOptions, signal);
|
|
83
|
+
|
|
84
|
+
const query = useQuery<Awaited<ReturnType<typeof adminGetServiceErrors>>, TError, TData>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
99
85
|
|
|
100
86
|
query.queryKey = queryKey;
|
|
101
87
|
|
|
102
88
|
return query;
|
|
103
|
-
}
|
|
89
|
+
}
|
|
104
90
|
|
|
105
91
|
/**
|
|
106
92
|
* Used primarily to 'Acknowledge' but not delete a Service Error.
|
|
@@ -110,52 +96,38 @@ You will need **admin** rights to use this endpoint
|
|
|
110
96
|
* @summary Patches a Service Error
|
|
111
97
|
*/
|
|
112
98
|
export const adminPatchServiceError = (
|
|
113
|
-
|
|
114
|
-
|
|
99
|
+
errorId: number,
|
|
100
|
+
options?: SecondParameter<typeof customInstance>,) => {
|
|
101
|
+
return customInstance<void>(
|
|
102
|
+
{url: `/admin/service-error/${errorId}`, method: 'patch'
|
|
103
|
+
},
|
|
104
|
+
options);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
export type AdminPatchServiceErrorMutationResult = NonNullable<Awaited<ReturnType<typeof adminPatchServiceError>>>
|
|
110
|
+
|
|
111
|
+
export type AdminPatchServiceErrorMutationError = ErrorType<DmError>
|
|
112
|
+
|
|
113
|
+
export const useAdminPatchServiceError = <TError = ErrorType<DmError>,
|
|
114
|
+
|
|
115
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof adminPatchServiceError>>, TError,{errorId: number}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
115
116
|
) => {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
TContext = unknown
|
|
131
|
-
>(options?: {
|
|
132
|
-
mutation?: UseMutationOptions<
|
|
133
|
-
Awaited<ReturnType<typeof adminPatchServiceError>>,
|
|
134
|
-
TError,
|
|
135
|
-
{ errorId: number },
|
|
136
|
-
TContext
|
|
137
|
-
>;
|
|
138
|
-
request?: SecondParameter<typeof customInstance>;
|
|
139
|
-
}) => {
|
|
140
|
-
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
141
|
-
|
|
142
|
-
const mutationFn: MutationFunction<
|
|
143
|
-
Awaited<ReturnType<typeof adminPatchServiceError>>,
|
|
144
|
-
{ errorId: number }
|
|
145
|
-
> = (props) => {
|
|
146
|
-
const { errorId } = props ?? {};
|
|
147
|
-
|
|
148
|
-
return adminPatchServiceError(errorId, requestOptions);
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
return useMutation<
|
|
152
|
-
Awaited<ReturnType<typeof adminPatchServiceError>>,
|
|
153
|
-
TError,
|
|
154
|
-
{ errorId: number },
|
|
155
|
-
TContext
|
|
156
|
-
>(mutationFn, mutationOptions);
|
|
157
|
-
};
|
|
158
|
-
/**
|
|
117
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof adminPatchServiceError>>, {errorId: number}> = (props) => {
|
|
123
|
+
const {errorId} = props ?? {};
|
|
124
|
+
|
|
125
|
+
return adminPatchServiceError(errorId,requestOptions)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return useMutation<Awaited<ReturnType<typeof adminPatchServiceError>>, TError, {errorId: number}, TContext>(mutationFn, mutationOptions)
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
159
131
|
* Deletes an existing Service Error.
|
|
160
132
|
|
|
161
133
|
You will need **admin** rights to use this endpoint
|
|
@@ -163,52 +135,38 @@ You will need **admin** rights to use this endpoint
|
|
|
163
135
|
* @summary Deletes a Service Error
|
|
164
136
|
*/
|
|
165
137
|
export const adminDeleteServiceError = (
|
|
166
|
-
|
|
167
|
-
|
|
138
|
+
errorId: number,
|
|
139
|
+
options?: SecondParameter<typeof customInstance>,) => {
|
|
140
|
+
return customInstance<void>(
|
|
141
|
+
{url: `/admin/service-error/${errorId}`, method: 'delete'
|
|
142
|
+
},
|
|
143
|
+
options);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
export type AdminDeleteServiceErrorMutationResult = NonNullable<Awaited<ReturnType<typeof adminDeleteServiceError>>>
|
|
149
|
+
|
|
150
|
+
export type AdminDeleteServiceErrorMutationError = ErrorType<DmError>
|
|
151
|
+
|
|
152
|
+
export const useAdminDeleteServiceError = <TError = ErrorType<DmError>,
|
|
153
|
+
|
|
154
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof adminDeleteServiceError>>, TError,{errorId: number}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
168
155
|
) => {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
TContext = unknown
|
|
184
|
-
>(options?: {
|
|
185
|
-
mutation?: UseMutationOptions<
|
|
186
|
-
Awaited<ReturnType<typeof adminDeleteServiceError>>,
|
|
187
|
-
TError,
|
|
188
|
-
{ errorId: number },
|
|
189
|
-
TContext
|
|
190
|
-
>;
|
|
191
|
-
request?: SecondParameter<typeof customInstance>;
|
|
192
|
-
}) => {
|
|
193
|
-
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
194
|
-
|
|
195
|
-
const mutationFn: MutationFunction<
|
|
196
|
-
Awaited<ReturnType<typeof adminDeleteServiceError>>,
|
|
197
|
-
{ errorId: number }
|
|
198
|
-
> = (props) => {
|
|
199
|
-
const { errorId } = props ?? {};
|
|
200
|
-
|
|
201
|
-
return adminDeleteServiceError(errorId, requestOptions);
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
return useMutation<
|
|
205
|
-
Awaited<ReturnType<typeof adminDeleteServiceError>>,
|
|
206
|
-
TError,
|
|
207
|
-
{ errorId: number },
|
|
208
|
-
TContext
|
|
209
|
-
>(mutationFn, mutationOptions);
|
|
210
|
-
};
|
|
211
|
-
/**
|
|
156
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {}
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof adminDeleteServiceError>>, {errorId: number}> = (props) => {
|
|
162
|
+
const {errorId} = props ?? {};
|
|
163
|
+
|
|
164
|
+
return adminDeleteServiceError(errorId,requestOptions)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return useMutation<Awaited<ReturnType<typeof adminDeleteServiceError>>, TError, {errorId: number}, TContext>(mutationFn, mutationOptions)
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
212
170
|
* This method adds a user to the Data Manager service. The user is authenticated via a keycloak server but will need an initialised account before they can create Datasets or Projects.
|
|
213
171
|
|
|
214
172
|
You will need **admin** rights to use this endpoint
|
|
@@ -216,52 +174,38 @@ You will need **admin** rights to use this endpoint
|
|
|
216
174
|
* @summary Prepares a user account in the Data Manager service
|
|
217
175
|
*/
|
|
218
176
|
export const adminPutUser = (
|
|
219
|
-
|
|
220
|
-
|
|
177
|
+
userId: string,
|
|
178
|
+
options?: SecondParameter<typeof customInstance>,) => {
|
|
179
|
+
return customInstance<AdminUserPutResponse>(
|
|
180
|
+
{url: `/admin/user/${userId}`, method: 'put'
|
|
181
|
+
},
|
|
182
|
+
options);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
export type AdminPutUserMutationResult = NonNullable<Awaited<ReturnType<typeof adminPutUser>>>
|
|
188
|
+
|
|
189
|
+
export type AdminPutUserMutationError = ErrorType<void | DmError>
|
|
190
|
+
|
|
191
|
+
export const useAdminPutUser = <TError = ErrorType<void | DmError>,
|
|
192
|
+
|
|
193
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof adminPutUser>>, TError,{userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
221
194
|
) => {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
TContext = unknown
|
|
237
|
-
>(options?: {
|
|
238
|
-
mutation?: UseMutationOptions<
|
|
239
|
-
Awaited<ReturnType<typeof adminPutUser>>,
|
|
240
|
-
TError,
|
|
241
|
-
{ userId: string },
|
|
242
|
-
TContext
|
|
243
|
-
>;
|
|
244
|
-
request?: SecondParameter<typeof customInstance>;
|
|
245
|
-
}) => {
|
|
246
|
-
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
247
|
-
|
|
248
|
-
const mutationFn: MutationFunction<
|
|
249
|
-
Awaited<ReturnType<typeof adminPutUser>>,
|
|
250
|
-
{ userId: string }
|
|
251
|
-
> = (props) => {
|
|
252
|
-
const { userId } = props ?? {};
|
|
253
|
-
|
|
254
|
-
return adminPutUser(userId, requestOptions);
|
|
255
|
-
};
|
|
256
|
-
|
|
257
|
-
return useMutation<
|
|
258
|
-
Awaited<ReturnType<typeof adminPutUser>>,
|
|
259
|
-
TError,
|
|
260
|
-
{ userId: string },
|
|
261
|
-
TContext
|
|
262
|
-
>(mutationFn, mutationOptions);
|
|
263
|
-
};
|
|
264
|
-
/**
|
|
195
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {}
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof adminPutUser>>, {userId: string}> = (props) => {
|
|
201
|
+
const {userId} = props ?? {};
|
|
202
|
+
|
|
203
|
+
return adminPutUser(userId,requestOptions)
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return useMutation<Awaited<ReturnType<typeof adminPutUser>>, TError, {userId: string}, TContext>(mutationFn, mutationOptions)
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
265
209
|
* Deletes a user account, along with all the user's Datasets
|
|
266
210
|
|
|
267
211
|
You will need **admin** rights to use this endpoint
|
|
@@ -269,52 +213,38 @@ You will need **admin** rights to use this endpoint
|
|
|
269
213
|
* @summary Deletes a user account
|
|
270
214
|
*/
|
|
271
215
|
export const adminDeleteUser = (
|
|
272
|
-
|
|
273
|
-
|
|
216
|
+
userId: string,
|
|
217
|
+
options?: SecondParameter<typeof customInstance>,) => {
|
|
218
|
+
return customInstance<void>(
|
|
219
|
+
{url: `/admin/user/${userId}`, method: 'delete'
|
|
220
|
+
},
|
|
221
|
+
options);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
export type AdminDeleteUserMutationResult = NonNullable<Awaited<ReturnType<typeof adminDeleteUser>>>
|
|
227
|
+
|
|
228
|
+
export type AdminDeleteUserMutationError = ErrorType<DmError>
|
|
229
|
+
|
|
230
|
+
export const useAdminDeleteUser = <TError = ErrorType<DmError>,
|
|
231
|
+
|
|
232
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof adminDeleteUser>>, TError,{userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
274
233
|
) => {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
TContext = unknown
|
|
290
|
-
>(options?: {
|
|
291
|
-
mutation?: UseMutationOptions<
|
|
292
|
-
Awaited<ReturnType<typeof adminDeleteUser>>,
|
|
293
|
-
TError,
|
|
294
|
-
{ userId: string },
|
|
295
|
-
TContext
|
|
296
|
-
>;
|
|
297
|
-
request?: SecondParameter<typeof customInstance>;
|
|
298
|
-
}) => {
|
|
299
|
-
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
300
|
-
|
|
301
|
-
const mutationFn: MutationFunction<
|
|
302
|
-
Awaited<ReturnType<typeof adminDeleteUser>>,
|
|
303
|
-
{ userId: string }
|
|
304
|
-
> = (props) => {
|
|
305
|
-
const { userId } = props ?? {};
|
|
306
|
-
|
|
307
|
-
return adminDeleteUser(userId, requestOptions);
|
|
308
|
-
};
|
|
309
|
-
|
|
310
|
-
return useMutation<
|
|
311
|
-
Awaited<ReturnType<typeof adminDeleteUser>>,
|
|
312
|
-
TError,
|
|
313
|
-
{ userId: string },
|
|
314
|
-
TContext
|
|
315
|
-
>(mutationFn, mutationOptions);
|
|
316
|
-
};
|
|
317
|
-
/**
|
|
234
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {}
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof adminDeleteUser>>, {userId: string}> = (props) => {
|
|
240
|
+
const {userId} = props ?? {};
|
|
241
|
+
|
|
242
|
+
return adminDeleteUser(userId,requestOptions)
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
return useMutation<Awaited<ReturnType<typeof adminDeleteUser>>, TError, {userId: string}, TContext>(mutationFn, mutationOptions)
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
318
248
|
* Patches a user record, typically to suspend or re-enable a user account
|
|
319
249
|
|
|
320
250
|
You will need **admin** rights to use this endpoint
|
|
@@ -322,63 +252,45 @@ You will need **admin** rights to use this endpoint
|
|
|
322
252
|
* @summary Patch a given user
|
|
323
253
|
*/
|
|
324
254
|
export const adminPatchUser = (
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
)
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
url: `/admin/user/${userId}`,
|
|
337
|
-
method: "patch",
|
|
338
|
-
headers: { "Content-Type": "multipart/form-data" },
|
|
339
|
-
data: formData,
|
|
255
|
+
userId: string,
|
|
256
|
+
userPatchBodyBody: UserPatchBodyBody,
|
|
257
|
+
options?: SecondParameter<typeof customInstance>,) => {const formData = new FormData();
|
|
258
|
+
if(userPatchBodyBody.suspend_message !== undefined) {
|
|
259
|
+
formData.append('suspend_message', userPatchBodyBody.suspend_message)
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return customInstance<void>(
|
|
263
|
+
{url: `/admin/user/${userId}`, method: 'patch',
|
|
264
|
+
headers: {'Content-Type': 'multipart/form-data', },
|
|
265
|
+
data: formData
|
|
340
266
|
},
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
export type
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
> = (props) => {
|
|
369
|
-
const { userId, data } = props ?? {};
|
|
370
|
-
|
|
371
|
-
return adminPatchUser(userId, data, requestOptions);
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
return useMutation<
|
|
375
|
-
Awaited<ReturnType<typeof adminPatchUser>>,
|
|
376
|
-
TError,
|
|
377
|
-
{ userId: string; data: UserPatchBodyBody },
|
|
378
|
-
TContext
|
|
379
|
-
>(mutationFn, mutationOptions);
|
|
380
|
-
};
|
|
381
|
-
/**
|
|
267
|
+
options);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
export type AdminPatchUserMutationResult = NonNullable<Awaited<ReturnType<typeof adminPatchUser>>>
|
|
273
|
+
export type AdminPatchUserMutationBody = UserPatchBodyBody
|
|
274
|
+
export type AdminPatchUserMutationError = ErrorType<DmError>
|
|
275
|
+
|
|
276
|
+
export const useAdminPatchUser = <TError = ErrorType<DmError>,
|
|
277
|
+
|
|
278
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof adminPatchUser>>, TError,{userId: string;data: UserPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
279
|
+
) => {
|
|
280
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {}
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof adminPatchUser>>, {userId: string;data: UserPatchBodyBody}> = (props) => {
|
|
286
|
+
const {userId,data} = props ?? {};
|
|
287
|
+
|
|
288
|
+
return adminPatchUser(userId,data,requestOptions)
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return useMutation<Awaited<ReturnType<typeof adminPatchUser>>, TError, {userId: string;data: UserPatchBodyBody}, TContext>(mutationFn, mutationOptions)
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
382
294
|
* Returns the list of known **Job Manifests** including the time the manifest was last loaded and its load status, a message indicating success or failure.
|
|
383
295
|
|
|
384
296
|
You will need **admin** rights to use this endpoint
|
|
@@ -386,53 +298,41 @@ You will need **admin** rights to use this endpoint
|
|
|
386
298
|
* @summary Get Job Manifests
|
|
387
299
|
*/
|
|
388
300
|
export const adminGetJobManifests = (
|
|
389
|
-
|
|
390
|
-
|
|
301
|
+
|
|
302
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
391
303
|
) => {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
}
|
|
304
|
+
return customInstance<AdminJobManifestGetResponse>(
|
|
305
|
+
{url: `/admin/job-manifest`, method: 'get', signal
|
|
306
|
+
},
|
|
307
|
+
options);
|
|
308
|
+
}
|
|
309
|
+
|
|
397
310
|
|
|
398
311
|
export const getAdminGetJobManifestsQueryKey = () => [`/admin/job-manifest`];
|
|
399
312
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
TError
|
|
408
|
-
|
|
409
|
-
query
|
|
410
|
-
Awaited<ReturnType<typeof adminGetJobManifests>>,
|
|
411
|
-
TError,
|
|
412
|
-
TData
|
|
413
|
-
>;
|
|
414
|
-
request?: SecondParameter<typeof customInstance>;
|
|
415
|
-
}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
416
|
-
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
313
|
+
|
|
314
|
+
export type AdminGetJobManifestsQueryResult = NonNullable<Awaited<ReturnType<typeof adminGetJobManifests>>>
|
|
315
|
+
export type AdminGetJobManifestsQueryError = ErrorType<void | DmError>
|
|
316
|
+
|
|
317
|
+
export const useAdminGetJobManifests = <TData = Awaited<ReturnType<typeof adminGetJobManifests>>, TError = ErrorType<void | DmError>>(
|
|
318
|
+
options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof adminGetJobManifests>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
319
|
+
|
|
320
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
321
|
+
|
|
322
|
+
const {query: queryOptions, request: requestOptions} = options ?? {}
|
|
417
323
|
|
|
418
324
|
const queryKey = queryOptions?.queryKey ?? getAdminGetJobManifestsQueryKey();
|
|
419
325
|
|
|
420
|
-
|
|
421
|
-
Awaited<ReturnType<typeof adminGetJobManifests>>
|
|
422
|
-
> = ({ signal }) => adminGetJobManifests(requestOptions, signal);
|
|
326
|
+
|
|
423
327
|
|
|
424
|
-
const
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
TData
|
|
428
|
-
>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {
|
|
429
|
-
queryKey: QueryKey;
|
|
430
|
-
};
|
|
328
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof adminGetJobManifests>>> = ({ signal }) => adminGetJobManifests(requestOptions, signal);
|
|
329
|
+
|
|
330
|
+
const query = useQuery<Awaited<ReturnType<typeof adminGetJobManifests>>, TError, TData>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
431
331
|
|
|
432
332
|
query.queryKey = queryKey;
|
|
433
333
|
|
|
434
334
|
return query;
|
|
435
|
-
}
|
|
335
|
+
}
|
|
436
336
|
|
|
437
337
|
/**
|
|
438
338
|
* This endpoint is used to add (or update an existing **Job Manifest**). Manifests are the source of Job definitions. Once added the manifest is inspected and any Jobs it refers to are loaded.
|
|
@@ -444,66 +344,48 @@ You will need **admin** rights to use this endpoint
|
|
|
444
344
|
* @summary Adds a Job Manifest and triggers the download of its Job Definitions
|
|
445
345
|
*/
|
|
446
346
|
export const adminJobManifestPut = (
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
)
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
url: `/admin/job-manifest`,
|
|
462
|
-
method: "put",
|
|
463
|
-
headers: { "Content-Type": "multipart/form-data" },
|
|
464
|
-
data: formData,
|
|
347
|
+
jobManifestPutBodyBody: JobManifestPutBodyBody,
|
|
348
|
+
options?: SecondParameter<typeof customInstance>,) => {const formData = new FormData();
|
|
349
|
+
formData.append('url', jobManifestPutBodyBody.url)
|
|
350
|
+
if(jobManifestPutBodyBody.header !== undefined) {
|
|
351
|
+
formData.append('header', jobManifestPutBodyBody.header)
|
|
352
|
+
}
|
|
353
|
+
if(jobManifestPutBodyBody.params !== undefined) {
|
|
354
|
+
formData.append('params', jobManifestPutBodyBody.params)
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
return customInstance<AdminJobManifestLoadPutResponse>(
|
|
358
|
+
{url: `/admin/job-manifest`, method: 'put',
|
|
359
|
+
headers: {'Content-Type': 'multipart/form-data', },
|
|
360
|
+
data: formData
|
|
465
361
|
},
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
export type
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
> = (props) => {
|
|
494
|
-
const { data } = props ?? {};
|
|
495
|
-
|
|
496
|
-
return adminJobManifestPut(data, requestOptions);
|
|
497
|
-
};
|
|
498
|
-
|
|
499
|
-
return useMutation<
|
|
500
|
-
Awaited<ReturnType<typeof adminJobManifestPut>>,
|
|
501
|
-
TError,
|
|
502
|
-
{ data: JobManifestPutBodyBody },
|
|
503
|
-
TContext
|
|
504
|
-
>(mutationFn, mutationOptions);
|
|
505
|
-
};
|
|
506
|
-
/**
|
|
362
|
+
options);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
export type AdminJobManifestPutMutationResult = NonNullable<Awaited<ReturnType<typeof adminJobManifestPut>>>
|
|
368
|
+
export type AdminJobManifestPutMutationBody = JobManifestPutBodyBody
|
|
369
|
+
export type AdminJobManifestPutMutationError = ErrorType<void | DmError>
|
|
370
|
+
|
|
371
|
+
export const useAdminJobManifestPut = <TError = ErrorType<void | DmError>,
|
|
372
|
+
|
|
373
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof adminJobManifestPut>>, TError,{data: JobManifestPutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
374
|
+
) => {
|
|
375
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {}
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof adminJobManifestPut>>, {data: JobManifestPutBodyBody}> = (props) => {
|
|
381
|
+
const {data} = props ?? {};
|
|
382
|
+
|
|
383
|
+
return adminJobManifestPut(data,requestOptions)
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
return useMutation<Awaited<ReturnType<typeof adminJobManifestPut>>, TError, {data: JobManifestPutBodyBody}, TContext>(mutationFn, mutationOptions)
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
507
389
|
* This endpoint is used to trigger the Data Manager to re-inspect the internal **Job Manifest** table and download the manifests and reprocess the related job definitions. This is normally done by an administrator when the Manifest table has been modified or if external job definitions are known to have changed in the referenced repositories.
|
|
508
390
|
|
|
509
391
|
You will need **admin** rights to use this endpoint
|
|
@@ -511,58 +393,41 @@ You will need **admin** rights to use this endpoint
|
|
|
511
393
|
* @summary Trigger a download of Job Definitions using existing Job Manifests
|
|
512
394
|
*/
|
|
513
395
|
export const adminJobManifestLoad = (
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
)
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
url: `/admin/job-manifest/load`,
|
|
525
|
-
method: "put",
|
|
526
|
-
headers: { "Content-Type": "multipart/form-data" },
|
|
527
|
-
data: formData,
|
|
396
|
+
jobManifestLoadPutBodyBody: JobManifestLoadPutBodyBody,
|
|
397
|
+
options?: SecondParameter<typeof customInstance>,) => {const formData = new FormData();
|
|
398
|
+
if(jobManifestLoadPutBodyBody.purge !== undefined) {
|
|
399
|
+
formData.append('purge', jobManifestLoadPutBodyBody.purge.toString())
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
return customInstance<AdminJobManifestLoadPutResponse>(
|
|
403
|
+
{url: `/admin/job-manifest/load`, method: 'put',
|
|
404
|
+
headers: {'Content-Type': 'multipart/form-data', },
|
|
405
|
+
data: formData
|
|
528
406
|
},
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
export type
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
> = (props) => {
|
|
557
|
-
const { data } = props ?? {};
|
|
558
|
-
|
|
559
|
-
return adminJobManifestLoad(data, requestOptions);
|
|
560
|
-
};
|
|
561
|
-
|
|
562
|
-
return useMutation<
|
|
563
|
-
Awaited<ReturnType<typeof adminJobManifestLoad>>,
|
|
564
|
-
TError,
|
|
565
|
-
{ data: JobManifestLoadPutBodyBody },
|
|
566
|
-
TContext
|
|
567
|
-
>(mutationFn, mutationOptions);
|
|
568
|
-
};
|
|
407
|
+
options);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
export type AdminJobManifestLoadMutationResult = NonNullable<Awaited<ReturnType<typeof adminJobManifestLoad>>>
|
|
413
|
+
export type AdminJobManifestLoadMutationBody = JobManifestLoadPutBodyBody
|
|
414
|
+
export type AdminJobManifestLoadMutationError = ErrorType<void | DmError>
|
|
415
|
+
|
|
416
|
+
export const useAdminJobManifestLoad = <TError = ErrorType<void | DmError>,
|
|
417
|
+
|
|
418
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof adminJobManifestLoad>>, TError,{data: JobManifestLoadPutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
419
|
+
) => {
|
|
420
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {}
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof adminJobManifestLoad>>, {data: JobManifestLoadPutBodyBody}> = (props) => {
|
|
426
|
+
const {data} = props ?? {};
|
|
427
|
+
|
|
428
|
+
return adminJobManifestLoad(data,requestOptions)
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
return useMutation<Awaited<ReturnType<typeof adminJobManifestLoad>>, TError, {data: JobManifestLoadPutBodyBody}, TContext>(mutationFn, mutationOptions)
|
|
432
|
+
}
|
|
433
|
+
|