@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/metadata/metadata.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,32 +8,37 @@ 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
24
|
DatasetMetaGetResponse,
|
|
22
|
-
DmError,
|
|
23
|
-
DatasetVersionMetaPostBodyBody,
|
|
24
25
|
DatasetMetaPostBodyBody,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
DatasetVersionMetaPostBodyBody,
|
|
27
|
+
DmError
|
|
28
|
+
} from '../data-manager-api.schemas'
|
|
29
|
+
import { customInstance } from '.././custom-instance';
|
|
30
|
+
import type { ErrorType } from '.././custom-instance';
|
|
31
|
+
|
|
28
32
|
|
|
29
33
|
// eslint-disable-next-line
|
|
30
|
-
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
34
|
+
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
31
35
|
config: any,
|
|
32
|
-
args: infer P
|
|
36
|
+
args: infer P,
|
|
33
37
|
) => any
|
|
34
38
|
? P
|
|
35
39
|
: never;
|
|
36
40
|
|
|
41
|
+
|
|
37
42
|
/**
|
|
38
43
|
* Update parameters or add new annotations of the specified type(s) and to the Metadata for a **Dataset Version**.
|
|
39
44
|
|
|
@@ -44,200 +49,132 @@ The annotations are provided in a list in JSON format. For details of the annota
|
|
|
44
49
|
* @summary Update Metadata for the Dataset version
|
|
45
50
|
*/
|
|
46
51
|
export const addMetadataVersion = (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
{
|
|
65
|
-
url: `/dataset/${datasetId}/meta/${datasetVersion}`,
|
|
66
|
-
method: "post",
|
|
67
|
-
headers: { "Content-Type": "multipart/form-data" },
|
|
68
|
-
data: formData,
|
|
69
|
-
},
|
|
70
|
-
options
|
|
71
|
-
);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
export const getAddMetadataVersionMutationOptions = <
|
|
75
|
-
TError = ErrorType<DmError | void>,
|
|
76
|
-
TContext = unknown
|
|
77
|
-
>(options?: {
|
|
78
|
-
mutation?: UseMutationOptions<
|
|
79
|
-
Awaited<ReturnType<typeof addMetadataVersion>>,
|
|
80
|
-
TError,
|
|
81
|
-
{
|
|
82
|
-
datasetId: string;
|
|
83
|
-
datasetVersion: number;
|
|
84
|
-
data: DatasetVersionMetaPostBodyBody;
|
|
52
|
+
datasetId: string,
|
|
53
|
+
datasetVersion: number,
|
|
54
|
+
datasetVersionMetaPostBodyBody: DatasetVersionMetaPostBodyBody,
|
|
55
|
+
options?: SecondParameter<typeof customInstance>,) => {
|
|
56
|
+
|
|
57
|
+
const formData = new FormData();
|
|
58
|
+
if(datasetVersionMetaPostBodyBody.meta_properties !== undefined) {
|
|
59
|
+
formData.append('meta_properties', datasetVersionMetaPostBodyBody.meta_properties)
|
|
60
|
+
}
|
|
61
|
+
if(datasetVersionMetaPostBodyBody.annotations !== undefined) {
|
|
62
|
+
formData.append('annotations', datasetVersionMetaPostBodyBody.annotations)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return customInstance<DatasetMetaGetResponse>(
|
|
66
|
+
{url: `/dataset/${datasetId}/meta/${datasetVersion}`, method: 'post',
|
|
67
|
+
headers: {'Content-Type': 'multipart/form-data', },
|
|
68
|
+
data: formData
|
|
85
69
|
},
|
|
86
|
-
|
|
87
|
-
>;
|
|
88
|
-
request?: SecondParameter<typeof customInstance>;
|
|
89
|
-
}): UseMutationOptions<
|
|
90
|
-
Awaited<ReturnType<typeof addMetadataVersion>>,
|
|
91
|
-
TError,
|
|
92
|
-
{
|
|
93
|
-
datasetId: string;
|
|
94
|
-
datasetVersion: number;
|
|
95
|
-
data: DatasetVersionMetaPostBodyBody;
|
|
96
|
-
},
|
|
97
|
-
TContext
|
|
98
|
-
> => {
|
|
99
|
-
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
100
|
-
|
|
101
|
-
const mutationFn: MutationFunction<
|
|
102
|
-
Awaited<ReturnType<typeof addMetadataVersion>>,
|
|
103
|
-
{
|
|
104
|
-
datasetId: string;
|
|
105
|
-
datasetVersion: number;
|
|
106
|
-
data: DatasetVersionMetaPostBodyBody;
|
|
70
|
+
options);
|
|
107
71
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
export const getAddMetadataVersionMutationOptions = <TError = ErrorType<DmError | void>,
|
|
76
|
+
|
|
77
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addMetadataVersion>>, TError,{datasetId: string;datasetVersion: number;data: DatasetVersionMetaPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
78
|
+
): UseMutationOptions<Awaited<ReturnType<typeof addMetadataVersion>>, TError,{datasetId: string;datasetVersion: number;data: DatasetVersionMetaPostBodyBody}, TContext> => {
|
|
79
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof addMetadataVersion>>, {datasetId: string;datasetVersion: number;data: DatasetVersionMetaPostBodyBody}> = (props) => {
|
|
85
|
+
const {datasetId,datasetVersion,data} = props ?? {};
|
|
86
|
+
|
|
87
|
+
return addMetadataVersion(datasetId,datasetVersion,data,requestOptions)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
return { mutationFn, ...mutationOptions }}
|
|
94
|
+
|
|
95
|
+
export type AddMetadataVersionMutationResult = NonNullable<Awaited<ReturnType<typeof addMetadataVersion>>>
|
|
96
|
+
export type AddMetadataVersionMutationBody = DatasetVersionMetaPostBodyBody
|
|
97
|
+
export type AddMetadataVersionMutationError = ErrorType<DmError | void>
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @summary Update Metadata for the Dataset version
|
|
101
|
+
*/
|
|
102
|
+
export const useAddMetadataVersion = <TError = ErrorType<DmError | void>,
|
|
103
|
+
|
|
104
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addMetadataVersion>>, TError,{datasetId: string;datasetVersion: number;data: DatasetVersionMetaPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
105
|
+
) => {
|
|
106
|
+
|
|
107
|
+
const mutationOptions = getAddMetadataVersionMutationOptions(options);
|
|
108
|
+
|
|
109
|
+
return useMutation(mutationOptions);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
144
112
|
* Returns the Metadata for a **Dataset Version** in JSON format.
|
|
145
113
|
|
|
146
114
|
* @summary Gets the Metadata for a specific Dataset Version
|
|
147
115
|
*/
|
|
148
116
|
export const getMetadataVersion = (
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
signal?: AbortSignal
|
|
117
|
+
datasetId: string,
|
|
118
|
+
datasetVersion: number,
|
|
119
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
153
120
|
) => {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
method:
|
|
158
|
-
signal,
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
return customInstance<DatasetMetaGetResponse>(
|
|
124
|
+
{url: `/dataset/${datasetId}/meta/${datasetVersion}`, method: 'get', signal
|
|
159
125
|
},
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
export const getGetMetadataVersionQueryKey = (
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
>
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
> & { queryKey: QueryKey }
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
export type GetMetadataVersionQueryResult = NonNullable<
|
|
208
|
-
Awaited<ReturnType<typeof getMetadataVersion>>
|
|
209
|
-
>;
|
|
210
|
-
export type GetMetadataVersionQueryError = ErrorType<void | DmError>;
|
|
211
|
-
|
|
212
|
-
export const useGetMetadataVersion = <
|
|
213
|
-
TData = Awaited<ReturnType<typeof getMetadataVersion>>,
|
|
214
|
-
TError = ErrorType<void | DmError>
|
|
215
|
-
>(
|
|
216
|
-
datasetId: string,
|
|
217
|
-
datasetVersion: number,
|
|
218
|
-
options?: {
|
|
219
|
-
query?: UseQueryOptions<
|
|
220
|
-
Awaited<ReturnType<typeof getMetadataVersion>>,
|
|
221
|
-
TError,
|
|
222
|
-
TData
|
|
223
|
-
>;
|
|
224
|
-
request?: SecondParameter<typeof customInstance>;
|
|
225
|
-
}
|
|
226
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
227
|
-
const queryOptions = getGetMetadataVersionQueryOptions(
|
|
228
|
-
datasetId,
|
|
229
|
-
datasetVersion,
|
|
230
|
-
options
|
|
231
|
-
);
|
|
232
|
-
|
|
233
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
234
|
-
queryKey: QueryKey;
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
query.queryKey = queryOptions.queryKey;
|
|
126
|
+
options);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
export const getGetMetadataVersionQueryKey = (datasetId: string,
|
|
131
|
+
datasetVersion: number,) => {
|
|
132
|
+
|
|
133
|
+
return ["data-manager-api", `/dataset/${datasetId}/meta/${datasetVersion}`] as const;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
export const getGetMetadataVersionQueryOptions = <TData = Awaited<ReturnType<typeof getMetadataVersion>>, TError = ErrorType<void | DmError>>(datasetId: string,
|
|
138
|
+
datasetVersion: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getMetadataVersion>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
139
|
+
) => {
|
|
140
|
+
|
|
141
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
142
|
+
|
|
143
|
+
const queryKey = queryOptions?.queryKey ?? getGetMetadataVersionQueryKey(datasetId,datasetVersion);
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadataVersion>>> = ({ signal }) => getMetadataVersion(datasetId,datasetVersion, requestOptions, signal);
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
return { queryKey, queryFn, enabled: !!(datasetId && datasetVersion), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getMetadataVersion>>, TError, TData> & { queryKey: QueryKey }
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export type GetMetadataVersionQueryResult = NonNullable<Awaited<ReturnType<typeof getMetadataVersion>>>
|
|
157
|
+
export type GetMetadataVersionQueryError = ErrorType<void | DmError>
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* @summary Gets the Metadata for a specific Dataset Version
|
|
161
|
+
*/
|
|
162
|
+
export const useGetMetadataVersion = <TData = Awaited<ReturnType<typeof getMetadataVersion>>, TError = ErrorType<void | DmError>>(
|
|
163
|
+
datasetId: string,
|
|
164
|
+
datasetVersion: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getMetadataVersion>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
165
|
+
|
|
166
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
167
|
+
|
|
168
|
+
const queryOptions = getGetMetadataVersionQueryOptions(datasetId,datasetVersion,options)
|
|
169
|
+
|
|
170
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
171
|
+
|
|
172
|
+
query.queryKey = queryOptions.queryKey ;
|
|
238
173
|
|
|
239
174
|
return query;
|
|
240
|
-
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
|
|
241
178
|
|
|
242
179
|
/**
|
|
243
180
|
* Update default parameters or add new labels to the Metadata for the Dataset.
|
|
@@ -249,154 +186,125 @@ The labels are provided in a list in JSON format. For details of the label forma
|
|
|
249
186
|
* @summary Update Metadata for the Dataset
|
|
250
187
|
*/
|
|
251
188
|
export const addMetadata = (
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
headers: { "Content-Type": "multipart/form-data" },
|
|
269
|
-
data: formData,
|
|
189
|
+
datasetId: string,
|
|
190
|
+
datasetMetaPostBodyBody: DatasetMetaPostBodyBody,
|
|
191
|
+
options?: SecondParameter<typeof customInstance>,) => {
|
|
192
|
+
|
|
193
|
+
const formData = new FormData();
|
|
194
|
+
if(datasetMetaPostBodyBody.meta_properties !== undefined) {
|
|
195
|
+
formData.append('meta_properties', datasetMetaPostBodyBody.meta_properties)
|
|
196
|
+
}
|
|
197
|
+
if(datasetMetaPostBodyBody.labels !== undefined) {
|
|
198
|
+
formData.append('labels', datasetMetaPostBodyBody.labels)
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return customInstance<DatasetMetaGetResponse>(
|
|
202
|
+
{url: `/dataset/${datasetId}/meta`, method: 'post',
|
|
203
|
+
headers: {'Content-Type': 'multipart/form-data', },
|
|
204
|
+
data: formData
|
|
270
205
|
},
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
>(options?: {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
TError = ErrorType<DmError | void>,
|
|
314
|
-
TContext = unknown
|
|
315
|
-
>(options?: {
|
|
316
|
-
mutation?: UseMutationOptions<
|
|
317
|
-
Awaited<ReturnType<typeof addMetadata>>,
|
|
318
|
-
TError,
|
|
319
|
-
{ datasetId: string; data: DatasetMetaPostBodyBody },
|
|
320
|
-
TContext
|
|
321
|
-
>;
|
|
322
|
-
request?: SecondParameter<typeof customInstance>;
|
|
323
|
-
}) => {
|
|
324
|
-
const mutationOptions = getAddMetadataMutationOptions(options);
|
|
325
|
-
|
|
326
|
-
return useMutation(mutationOptions);
|
|
327
|
-
};
|
|
328
|
-
/**
|
|
206
|
+
options);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
export const getAddMetadataMutationOptions = <TError = ErrorType<DmError | void>,
|
|
212
|
+
|
|
213
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addMetadata>>, TError,{datasetId: string;data: DatasetMetaPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
214
|
+
): UseMutationOptions<Awaited<ReturnType<typeof addMetadata>>, TError,{datasetId: string;data: DatasetMetaPostBodyBody}, TContext> => {
|
|
215
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof addMetadata>>, {datasetId: string;data: DatasetMetaPostBodyBody}> = (props) => {
|
|
221
|
+
const {datasetId,data} = props ?? {};
|
|
222
|
+
|
|
223
|
+
return addMetadata(datasetId,data,requestOptions)
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
return { mutationFn, ...mutationOptions }}
|
|
230
|
+
|
|
231
|
+
export type AddMetadataMutationResult = NonNullable<Awaited<ReturnType<typeof addMetadata>>>
|
|
232
|
+
export type AddMetadataMutationBody = DatasetMetaPostBodyBody
|
|
233
|
+
export type AddMetadataMutationError = ErrorType<DmError | void>
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* @summary Update Metadata for the Dataset
|
|
237
|
+
*/
|
|
238
|
+
export const useAddMetadata = <TError = ErrorType<DmError | void>,
|
|
239
|
+
|
|
240
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addMetadata>>, TError,{datasetId: string;data: DatasetMetaPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
241
|
+
) => {
|
|
242
|
+
|
|
243
|
+
const mutationOptions = getAddMetadataMutationOptions(options);
|
|
244
|
+
|
|
245
|
+
return useMutation(mutationOptions);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
329
248
|
* Returns the Metadata for a Dataset in JSON format.
|
|
330
249
|
|
|
331
250
|
* @summary Gets the Metadata for a specific Dataset
|
|
332
251
|
*/
|
|
333
252
|
export const getMetadata = (
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
signal?: AbortSignal
|
|
253
|
+
datasetId: string,
|
|
254
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
337
255
|
) => {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
export const
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
} =>
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
export
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
TData
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
TError,
|
|
388
|
-
TData
|
|
389
|
-
>;
|
|
390
|
-
request?: SecondParameter<typeof customInstance>;
|
|
391
|
-
}
|
|
392
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
393
|
-
const queryOptions = getGetMetadataQueryOptions(datasetId, options);
|
|
394
|
-
|
|
395
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
396
|
-
queryKey: QueryKey;
|
|
397
|
-
};
|
|
398
|
-
|
|
399
|
-
query.queryKey = queryOptions.queryKey;
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
return customInstance<DatasetMetaGetResponse>(
|
|
259
|
+
{url: `/dataset/${datasetId}/meta`, method: 'get', signal
|
|
260
|
+
},
|
|
261
|
+
options);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
export const getGetMetadataQueryKey = (datasetId: string,) => {
|
|
266
|
+
|
|
267
|
+
return ["data-manager-api", `/dataset/${datasetId}/meta`] as const;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
export const getGetMetadataQueryOptions = <TData = Awaited<ReturnType<typeof getMetadata>>, TError = ErrorType<void | DmError>>(datasetId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
272
|
+
) => {
|
|
273
|
+
|
|
274
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
275
|
+
|
|
276
|
+
const queryKey = queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetId);
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadata>>> = ({ signal }) => getMetadata(datasetId, requestOptions, signal);
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
return { queryKey, queryFn, enabled: !!(datasetId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData> & { queryKey: QueryKey }
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export type GetMetadataQueryResult = NonNullable<Awaited<ReturnType<typeof getMetadata>>>
|
|
290
|
+
export type GetMetadataQueryError = ErrorType<void | DmError>
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* @summary Gets the Metadata for a specific Dataset
|
|
294
|
+
*/
|
|
295
|
+
export const useGetMetadata = <TData = Awaited<ReturnType<typeof getMetadata>>, TError = ErrorType<void | DmError>>(
|
|
296
|
+
datasetId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
297
|
+
|
|
298
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
299
|
+
|
|
300
|
+
const queryOptions = getGetMetadataQueryOptions(datasetId,options)
|
|
301
|
+
|
|
302
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
303
|
+
|
|
304
|
+
query.queryKey = queryOptions.queryKey ;
|
|
400
305
|
|
|
401
306
|
return query;
|
|
402
|
-
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|