@squonk/data-manager-client 1.2.3-rc.2 → 1.2.4-rc.1
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 +31 -13
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.cts +77 -0
- package/accounting/accounting.d.ts +10 -1
- package/accounting/accounting.js +29 -11
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +67 -27
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.cts +324 -0
- package/admin/admin.d.ts +55 -22
- package/admin/admin.js +57 -17
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +23 -13
- package/application/application.cjs.map +1 -1
- package/application/application.d.cts +57 -0
- package/application/application.d.ts +7 -1
- package/application/application.js +22 -12
- package/application/application.js.map +1 -1
- package/{chunk-UZTHSGDT.cjs → chunk-J22A7LHX.cjs} +1 -1
- package/chunk-J22A7LHX.cjs.map +1 -0
- package/{chunk-3RNIDX7T.js → chunk-UKA7G3OB.js} +1 -1
- package/{chunk-3RNIDX7T.js.map → chunk-UKA7G3OB.js.map} +1 -1
- package/configuration/configuration.cjs +13 -7
- package/configuration/configuration.cjs.map +1 -1
- package/configuration/configuration.d.cts +29 -0
- package/configuration/configuration.d.ts +4 -1
- package/configuration/configuration.js +13 -7
- package/configuration/configuration.js.map +1 -1
- package/{custom-instance-50c9dd5d.d.ts → custom-instance-a2110e78.d.ts} +825 -825
- package/dataset/dataset.cjs +71 -72
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.cts +315 -0
- package/dataset/dataset.d.ts +46 -16
- package/dataset/dataset.js +62 -63
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs +43 -32
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.cts +180 -0
- package/exchange-rate/exchange-rate.d.ts +25 -7
- package/exchange-rate/exchange-rate.js +38 -27
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file/file.cjs +38 -22
- package/file/file.cjs.map +1 -1
- package/file/file.d.cts +154 -0
- package/file/file.d.ts +25 -10
- package/file/file.js +34 -18
- package/file/file.js.map +1 -1
- package/index.cjs +10 -10
- package/index.cjs.map +1 -1
- package/index.d.cts +2 -0
- package/index.d.ts +1 -1
- package/index.js +9 -9
- package/index.js.map +1 -1
- package/instance/instance.cjs +47 -37
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.cts +215 -0
- package/instance/instance.d.ts +33 -12
- package/instance/instance.js +41 -31
- package/instance/instance.js.map +1 -1
- package/job/job.cjs +36 -19
- package/job/job.cjs.map +1 -1
- package/job/job.d.cts +85 -0
- package/job/job.d.ts +10 -1
- package/job/job.js +34 -17
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +23 -26
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.cts +132 -0
- package/metadata/metadata.d.ts +19 -7
- package/metadata/metadata.js +20 -23
- package/metadata/metadata.js.map +1 -1
- package/package.json +12 -12
- package/project/project.cjs +70 -48
- package/project/project.cjs.map +1 -1
- package/project/project.d.cts +377 -0
- package/project/project.d.ts +61 -25
- package/project/project.js +59 -37
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +179 -194
- package/src/admin/admin.ts +590 -735
- package/src/application/application.ts +125 -141
- package/src/configuration/configuration.ts +72 -60
- package/src/data-manager-api.schemas.ts +940 -941
- package/src/dataset/dataset.ts +591 -770
- package/src/exchange-rate/exchange-rate.ts +362 -478
- package/src/file/file.ts +292 -357
- package/src/instance/instance.ts +427 -533
- package/src/job/job.ts +187 -198
- package/src/metadata/metadata.ts +247 -339
- package/src/project/project.ts +669 -860
- package/src/task/task.ts +181 -202
- package/src/type/type.ts +72 -68
- package/src/user/user.ts +248 -286
- package/task/task.cjs +31 -15
- package/task/task.cjs.map +1 -1
- package/task/task.d.cts +103 -0
- package/task/task.d.ts +10 -1
- package/task/task.js +29 -13
- package/task/task.js.map +1 -1
- package/type/type.cjs +13 -7
- package/type/type.cjs.map +1 -1
- package/type/type.d.cts +31 -0
- package/type/type.d.ts +4 -1
- package/type/type.js +13 -7
- package/type/type.js.map +1 -1
- package/user/user.cjs +39 -28
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +104 -0
- package/user/user.d.ts +16 -4
- package/user/user.js +36 -25
- package/user/user.js.map +1 -1
- package/chunk-UZTHSGDT.cjs.map +0 -1
package/src/task/task.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
2
|
+
* Generated by orval v6.20.0 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Dataset Manager API
|
|
5
5
|
* The Dataset Manager API service.
|
|
@@ -8,108 +8,102 @@ A service that allows *registered* users to make **Datasets** and associated **M
|
|
|
8
8
|
|
|
9
9
|
* OpenAPI spec version: 1.2
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
useMutation,
|
|
13
|
+
useQuery
|
|
14
|
+
} from '@tanstack/react-query'
|
|
12
15
|
import type {
|
|
13
|
-
UseQueryOptions,
|
|
14
|
-
UseMutationOptions,
|
|
15
|
-
QueryFunction,
|
|
16
16
|
MutationFunction,
|
|
17
|
-
|
|
17
|
+
QueryFunction,
|
|
18
18
|
QueryKey,
|
|
19
|
-
|
|
19
|
+
UseMutationOptions,
|
|
20
|
+
UseQueryOptions,
|
|
21
|
+
UseQueryResult
|
|
22
|
+
} from '@tanstack/react-query'
|
|
20
23
|
import type {
|
|
21
|
-
TasksGetResponse,
|
|
22
24
|
DmError,
|
|
25
|
+
GetTaskParams,
|
|
23
26
|
GetTasksParams,
|
|
24
27
|
TaskGetResponse,
|
|
25
|
-
|
|
26
|
-
} from
|
|
27
|
-
import { customInstance } from
|
|
28
|
-
import type { ErrorType } from
|
|
28
|
+
TasksGetResponse
|
|
29
|
+
} from '../data-manager-api.schemas'
|
|
30
|
+
import { customInstance } from '.././custom-instance';
|
|
31
|
+
import type { ErrorType } from '.././custom-instance';
|
|
32
|
+
|
|
29
33
|
|
|
30
34
|
// eslint-disable-next-line
|
|
31
|
-
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
35
|
+
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
32
36
|
config: any,
|
|
33
|
-
args: infer P
|
|
37
|
+
args: infer P,
|
|
34
38
|
) => any
|
|
35
39
|
? P
|
|
36
40
|
: never;
|
|
37
41
|
|
|
42
|
+
|
|
38
43
|
/**
|
|
39
44
|
* Returns a list of Tasks that you have access to.
|
|
40
45
|
|
|
41
46
|
* @summary Returns a list of Tasks
|
|
42
47
|
*/
|
|
43
48
|
export const getTasks = (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
signal?: AbortSignal
|
|
49
|
+
params?: GetTasksParams,
|
|
50
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
47
51
|
) => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
TError
|
|
92
|
-
|
|
93
|
-
params
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
TData
|
|
99
|
-
>;
|
|
100
|
-
request?: SecondParameter<typeof customInstance>;
|
|
101
|
-
}
|
|
102
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
103
|
-
const queryOptions = getGetTasksQueryOptions(params, options);
|
|
104
|
-
|
|
105
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
106
|
-
queryKey: QueryKey;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
query.queryKey = queryOptions.queryKey;
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
return customInstance<TasksGetResponse>(
|
|
55
|
+
{url: `/task`, method: 'get',
|
|
56
|
+
params, signal
|
|
57
|
+
},
|
|
58
|
+
options);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
export const getGetTasksQueryKey = (params?: GetTasksParams,) => {
|
|
63
|
+
|
|
64
|
+
return ["data-manager-api", `/task`, ...(params ? [params]: [])] as const;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
export const getGetTasksQueryOptions = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
69
|
+
) => {
|
|
70
|
+
|
|
71
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
72
|
+
|
|
73
|
+
const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) => getTasks(params, requestOptions, signal);
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & { queryKey: QueryKey }
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export type GetTasksQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>
|
|
87
|
+
export type GetTasksQueryError = ErrorType<void | DmError>
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @summary Returns a list of Tasks
|
|
91
|
+
*/
|
|
92
|
+
export const useGetTasks = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(
|
|
93
|
+
params?: GetTasksParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
94
|
+
|
|
95
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
96
|
+
|
|
97
|
+
const queryOptions = getGetTasksQueryOptions(params,options)
|
|
98
|
+
|
|
99
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
100
|
+
|
|
101
|
+
query.queryKey = queryOptions.queryKey ;
|
|
110
102
|
|
|
111
103
|
return query;
|
|
112
|
-
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
|
|
113
107
|
|
|
114
108
|
/**
|
|
115
109
|
* Returns Task information including its states and events.
|
|
@@ -133,70 +127,68 @@ For Application **Instance** Tasks, where the Task `purpose` is `INSTANCE`, you
|
|
|
133
127
|
* @summary Returns Task information
|
|
134
128
|
*/
|
|
135
129
|
export const getTask = (
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
130
|
+
taskId: string,
|
|
131
|
+
params?: GetTaskParams,
|
|
132
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
133
|
+
) => {
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
return customInstance<TaskGetResponse>(
|
|
137
|
+
{url: `/task/${taskId}`, method: 'get',
|
|
138
|
+
params, signal
|
|
139
|
+
},
|
|
140
|
+
options);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
export const getGetTaskQueryKey = (taskId: string,
|
|
145
|
+
params?: GetTaskParams,) => {
|
|
146
|
+
|
|
147
|
+
return ["data-manager-api", `/task/${taskId}`, ...(params ? [params]: [])] as const;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
export const getGetTaskQueryOptions = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(taskId: string,
|
|
152
|
+
params?: GetTaskParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
140
153
|
) => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
);
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
taskId:
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
export type GetTaskQueryResult = NonNullable<
|
|
175
|
-
Awaited<ReturnType<typeof getTask>>
|
|
176
|
-
>;
|
|
177
|
-
export type GetTaskQueryError = ErrorType<void | DmError>;
|
|
178
|
-
|
|
179
|
-
export const useGetTask = <
|
|
180
|
-
TData = Awaited<ReturnType<typeof getTask>>,
|
|
181
|
-
TError = ErrorType<void | DmError>
|
|
182
|
-
>(
|
|
183
|
-
taskId: string,
|
|
184
|
-
params?: GetTaskParams,
|
|
185
|
-
options?: {
|
|
186
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>;
|
|
187
|
-
request?: SecondParameter<typeof customInstance>;
|
|
188
|
-
}
|
|
189
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
190
|
-
const queryOptions = getGetTaskQueryOptions(taskId, params, options);
|
|
191
|
-
|
|
192
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
193
|
-
queryKey: QueryKey;
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
query.queryKey = queryOptions.queryKey;
|
|
154
|
+
|
|
155
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
156
|
+
|
|
157
|
+
const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId,params);
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) => getTask(taskId,params, requestOptions, signal);
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & { queryKey: QueryKey }
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export type GetTaskQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>
|
|
171
|
+
export type GetTaskQueryError = ErrorType<void | DmError>
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* @summary Returns Task information
|
|
175
|
+
*/
|
|
176
|
+
export const useGetTask = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(
|
|
177
|
+
taskId: string,
|
|
178
|
+
params?: GetTaskParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
179
|
+
|
|
180
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
181
|
+
|
|
182
|
+
const queryOptions = getGetTaskQueryOptions(taskId,params,options)
|
|
183
|
+
|
|
184
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
185
|
+
|
|
186
|
+
query.queryKey = queryOptions.queryKey ;
|
|
197
187
|
|
|
198
188
|
return query;
|
|
199
|
-
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
|
|
200
192
|
|
|
201
193
|
/**
|
|
202
194
|
* Given a `task_id` the Task will be removed.
|
|
@@ -208,65 +200,52 @@ You must be an `owner` of the Task to delete it. For example you must be the `ow
|
|
|
208
200
|
* @summary Delete a Task entry
|
|
209
201
|
*/
|
|
210
202
|
export const deleteTask = (
|
|
211
|
-
|
|
212
|
-
|
|
203
|
+
taskId: string,
|
|
204
|
+
options?: SecondParameter<typeof customInstance>,) => {
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
return customInstance<void>(
|
|
208
|
+
{url: `/task/${taskId}`, method: 'delete'
|
|
209
|
+
},
|
|
210
|
+
options);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
export const getDeleteTaskMutationOptions = <TError = ErrorType<DmError>,
|
|
216
|
+
|
|
217
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
218
|
+
): UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext> => {
|
|
219
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteTask>>, {taskId: string}> = (props) => {
|
|
225
|
+
const {taskId} = props ?? {};
|
|
226
|
+
|
|
227
|
+
return deleteTask(taskId,requestOptions)
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
return { mutationFn, ...mutationOptions }}
|
|
234
|
+
|
|
235
|
+
export type DeleteTaskMutationResult = NonNullable<Awaited<ReturnType<typeof deleteTask>>>
|
|
236
|
+
|
|
237
|
+
export type DeleteTaskMutationError = ErrorType<DmError>
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* @summary Delete a Task entry
|
|
241
|
+
*/
|
|
242
|
+
export const useDeleteTask = <TError = ErrorType<DmError>,
|
|
243
|
+
|
|
244
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
213
245
|
) => {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
export const getDeleteTaskMutationOptions = <
|
|
221
|
-
TError = ErrorType<DmError>,
|
|
222
|
-
TContext = unknown
|
|
223
|
-
>(options?: {
|
|
224
|
-
mutation?: UseMutationOptions<
|
|
225
|
-
Awaited<ReturnType<typeof deleteTask>>,
|
|
226
|
-
TError,
|
|
227
|
-
{ taskId: string },
|
|
228
|
-
TContext
|
|
229
|
-
>;
|
|
230
|
-
request?: SecondParameter<typeof customInstance>;
|
|
231
|
-
}): UseMutationOptions<
|
|
232
|
-
Awaited<ReturnType<typeof deleteTask>>,
|
|
233
|
-
TError,
|
|
234
|
-
{ taskId: string },
|
|
235
|
-
TContext
|
|
236
|
-
> => {
|
|
237
|
-
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
238
|
-
|
|
239
|
-
const mutationFn: MutationFunction<
|
|
240
|
-
Awaited<ReturnType<typeof deleteTask>>,
|
|
241
|
-
{ taskId: string }
|
|
242
|
-
> = (props) => {
|
|
243
|
-
const { taskId } = props ?? {};
|
|
244
|
-
|
|
245
|
-
return deleteTask(taskId, requestOptions);
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
return { mutationFn, ...mutationOptions };
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
export type DeleteTaskMutationResult = NonNullable<
|
|
252
|
-
Awaited<ReturnType<typeof deleteTask>>
|
|
253
|
-
>;
|
|
254
|
-
|
|
255
|
-
export type DeleteTaskMutationError = ErrorType<DmError>;
|
|
256
|
-
|
|
257
|
-
export const useDeleteTask = <
|
|
258
|
-
TError = ErrorType<DmError>,
|
|
259
|
-
TContext = unknown
|
|
260
|
-
>(options?: {
|
|
261
|
-
mutation?: UseMutationOptions<
|
|
262
|
-
Awaited<ReturnType<typeof deleteTask>>,
|
|
263
|
-
TError,
|
|
264
|
-
{ taskId: string },
|
|
265
|
-
TContext
|
|
266
|
-
>;
|
|
267
|
-
request?: SecondParameter<typeof customInstance>;
|
|
268
|
-
}) => {
|
|
269
|
-
const mutationOptions = getDeleteTaskMutationOptions(options);
|
|
270
|
-
|
|
271
|
-
return useMutation(mutationOptions);
|
|
272
|
-
};
|
|
246
|
+
|
|
247
|
+
const mutationOptions = getDeleteTaskMutationOptions(options);
|
|
248
|
+
|
|
249
|
+
return useMutation(mutationOptions);
|
|
250
|
+
}
|
|
251
|
+
|
package/src/type/type.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
2
|
+
* Generated by orval v6.20.0 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Dataset Manager API
|
|
5
5
|
* The Dataset Manager API service.
|
|
@@ -8,89 +8,93 @@ A service that allows *registered* users to make **Datasets** and associated **M
|
|
|
8
8
|
|
|
9
9
|
* OpenAPI spec version: 1.2
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
useQuery
|
|
13
|
+
} from '@tanstack/react-query'
|
|
12
14
|
import type {
|
|
13
|
-
UseQueryOptions,
|
|
14
15
|
QueryFunction,
|
|
15
|
-
UseQueryResult,
|
|
16
16
|
QueryKey,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import type {
|
|
17
|
+
UseQueryOptions,
|
|
18
|
+
UseQueryResult
|
|
19
|
+
} from '@tanstack/react-query'
|
|
20
|
+
import type {
|
|
21
|
+
DmError,
|
|
22
|
+
TypesGetResponse
|
|
23
|
+
} from '../data-manager-api.schemas'
|
|
24
|
+
import { customInstance } from '.././custom-instance';
|
|
25
|
+
import type { ErrorType } from '.././custom-instance';
|
|
26
|
+
|
|
21
27
|
|
|
22
28
|
// eslint-disable-next-line
|
|
23
|
-
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
29
|
+
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
24
30
|
config: any,
|
|
25
|
-
args: infer P
|
|
31
|
+
args: infer P,
|
|
26
32
|
) => any
|
|
27
33
|
? P
|
|
28
34
|
: never;
|
|
29
35
|
|
|
36
|
+
|
|
30
37
|
/**
|
|
31
38
|
* Returns the supported Dataset and File (MIME) Types
|
|
32
39
|
|
|
33
40
|
* @summary Get the supported File Types
|
|
34
41
|
*/
|
|
35
42
|
export const getFileTypes = (
|
|
36
|
-
|
|
37
|
-
|
|
43
|
+
|
|
44
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
45
|
+
) => {
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
return customInstance<TypesGetResponse>(
|
|
49
|
+
{url: `/type`, method: 'get', signal
|
|
50
|
+
},
|
|
51
|
+
options);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
export const getGetFileTypesQueryKey = () => {
|
|
56
|
+
|
|
57
|
+
return ["data-manager-api", `/type`] as const;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
export const getGetFileTypesQueryOptions = <TData = Awaited<ReturnType<typeof getFileTypes>>, TError = ErrorType<void | DmError>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getFileTypes>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
38
62
|
) => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
export type GetFileTypesQueryResult = NonNullable<
|
|
72
|
-
Awaited<ReturnType<typeof getFileTypes>>
|
|
73
|
-
>;
|
|
74
|
-
export type GetFileTypesQueryError = ErrorType<void | DmError>;
|
|
75
|
-
|
|
76
|
-
export const useGetFileTypes = <
|
|
77
|
-
TData = Awaited<ReturnType<typeof getFileTypes>>,
|
|
78
|
-
TError = ErrorType<void | DmError>
|
|
79
|
-
>(options?: {
|
|
80
|
-
query?: UseQueryOptions<
|
|
81
|
-
Awaited<ReturnType<typeof getFileTypes>>,
|
|
82
|
-
TError,
|
|
83
|
-
TData
|
|
84
|
-
>;
|
|
85
|
-
request?: SecondParameter<typeof customInstance>;
|
|
86
|
-
}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
87
|
-
const queryOptions = getGetFileTypesQueryOptions(options);
|
|
88
|
-
|
|
89
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
90
|
-
queryKey: QueryKey;
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
query.queryKey = queryOptions.queryKey;
|
|
63
|
+
|
|
64
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
65
|
+
|
|
66
|
+
const queryKey = queryOptions?.queryKey ?? getGetFileTypesQueryKey();
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getFileTypes>>> = ({ signal }) => getFileTypes(requestOptions, signal);
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getFileTypes>>, TError, TData> & { queryKey: QueryKey }
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type GetFileTypesQueryResult = NonNullable<Awaited<ReturnType<typeof getFileTypes>>>
|
|
80
|
+
export type GetFileTypesQueryError = ErrorType<void | DmError>
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @summary Get the supported File Types
|
|
84
|
+
*/
|
|
85
|
+
export const useGetFileTypes = <TData = Awaited<ReturnType<typeof getFileTypes>>, TError = ErrorType<void | DmError>>(
|
|
86
|
+
options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getFileTypes>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
87
|
+
|
|
88
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
89
|
+
|
|
90
|
+
const queryOptions = getGetFileTypesQueryOptions(options)
|
|
91
|
+
|
|
92
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
93
|
+
|
|
94
|
+
query.queryKey = queryOptions.queryKey ;
|
|
94
95
|
|
|
95
96
|
return query;
|
|
96
|
-
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|