@squonk/data-manager-client 1.2.8 → 1.2.9
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/README.md +1 -1
- package/accounting/accounting.cjs +51 -8
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.cts +61 -10
- package/accounting/accounting.d.ts +61 -10
- package/accounting/accounting.js +49 -6
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +67 -24
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.cts +75 -24
- package/admin/admin.d.ts +75 -24
- package/admin/admin.js +56 -13
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +35 -6
- package/application/application.cjs.map +1 -1
- package/application/application.d.cts +42 -8
- package/application/application.d.ts +42 -8
- package/application/application.js +34 -5
- package/application/application.js.map +1 -1
- package/{chunk-UKA7G3OB.js → chunk-EBOQPVLG.js} +2 -2
- package/{chunk-UKA7G3OB.js.map → chunk-EBOQPVLG.js.map} +1 -1
- package/{chunk-J22A7LHX.cjs → chunk-TKLTUR4R.cjs} +2 -2
- package/chunk-TKLTUR4R.cjs.map +1 -0
- package/configuration/configuration.cjs +19 -4
- package/configuration/configuration.cjs.map +1 -1
- package/configuration/configuration.d.cts +23 -6
- package/configuration/configuration.d.ts +23 -6
- package/configuration/configuration.js +19 -4
- package/configuration/configuration.js.map +1 -1
- package/dataset/dataset.cjs +93 -22
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.cts +105 -20
- package/dataset/dataset.d.ts +105 -20
- package/dataset/dataset.js +83 -12
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs +71 -14
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.cts +83 -15
- package/exchange-rate/exchange-rate.d.ts +83 -15
- package/exchange-rate/exchange-rate.js +65 -8
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file-and-path/file-and-path.cjs +45 -16
- package/file-and-path/file-and-path.cjs.map +1 -1
- package/file-and-path/file-and-path.d.cts +48 -14
- package/file-and-path/file-and-path.d.ts +48 -14
- package/file-and-path/file-and-path.js +39 -10
- package/file-and-path/file-and-path.js.map +1 -1
- package/index.cjs +9 -2
- package/index.cjs.map +1 -1
- package/index.d.cts +2033 -2
- package/index.d.ts +2033 -2
- package/index.js +8 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs +45 -16
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.cts +48 -14
- package/instance/instance.d.ts +48 -14
- package/instance/instance.js +38 -9
- package/instance/instance.js.map +1 -1
- package/job/job.cjs +51 -8
- package/job/job.cjs.map +1 -1
- package/job/job.d.cts +61 -10
- package/job/job.d.ts +61 -10
- package/job/job.js +49 -6
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +39 -10
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.cts +45 -11
- package/metadata/metadata.d.ts +45 -11
- package/metadata/metadata.js +36 -7
- package/metadata/metadata.js.map +1 -1
- package/package.json +11 -11
- package/project/project.cjs +83 -26
- package/project/project.cjs.map +1 -1
- package/project/project.d.cts +89 -21
- package/project/project.d.ts +89 -21
- package/project/project.js +71 -14
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +136 -22
- package/src/admin/admin.ts +148 -50
- package/src/application/application.ts +93 -18
- package/src/configuration/configuration.ts +50 -14
- package/src/custom-instance.ts +3 -4
- package/src/data-manager-api.schemas.ts +59 -33
- package/src/dataset/dataset.ts +233 -45
- package/src/exchange-rate/exchange-rate.ts +185 -32
- package/src/file-and-path/file-and-path.ts +98 -33
- package/src/instance/instance.ts +98 -33
- package/src/job/job.ts +138 -22
- package/src/metadata/metadata.ts +97 -24
- package/src/project/project.ts +191 -50
- package/src/task/task.ts +96 -21
- package/src/type/type.ts +50 -14
- package/src/user/user.ts +137 -25
- package/task/task.cjs +37 -8
- package/task/task.cjs.map +1 -1
- package/task/task.d.cts +44 -10
- package/task/task.d.ts +44 -10
- package/task/task.js +35 -6
- package/task/task.js.map +1 -1
- package/type/type.cjs +19 -4
- package/type/type.cjs.map +1 -1
- package/type/type.d.cts +23 -6
- package/type/type.d.ts +23 -6
- package/type/type.js +19 -4
- package/type/type.js.map +1 -1
- package/user/user.cjs +53 -10
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +63 -12
- package/user/user.d.ts +63 -12
- package/user/user.js +49 -6
- package/user/user.js.map +1 -1
- package/chunk-J22A7LHX.cjs.map +0 -1
- package/custom-instance-37ed2460.d.ts +0 -2014
package/src/dataset/dataset.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
2
|
+
* Generated by orval v6.25.0 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Dataset Manager API
|
|
5
5
|
* The Dataset Manager API service.
|
|
@@ -10,7 +10,8 @@ A service that allows *registered* users to make **Datasets** and associated **M
|
|
|
10
10
|
*/
|
|
11
11
|
import {
|
|
12
12
|
useMutation,
|
|
13
|
-
useQuery
|
|
13
|
+
useQuery,
|
|
14
|
+
useSuspenseQuery
|
|
14
15
|
} from '@tanstack/react-query'
|
|
15
16
|
import type {
|
|
16
17
|
MutationFunction,
|
|
@@ -18,7 +19,9 @@ import type {
|
|
|
18
19
|
QueryKey,
|
|
19
20
|
UseMutationOptions,
|
|
20
21
|
UseQueryOptions,
|
|
21
|
-
UseQueryResult
|
|
22
|
+
UseQueryResult,
|
|
23
|
+
UseSuspenseQueryOptions,
|
|
24
|
+
UseSuspenseQueryResult
|
|
22
25
|
} from '@tanstack/react-query'
|
|
23
26
|
import type {
|
|
24
27
|
DatasetDetail,
|
|
@@ -38,13 +41,7 @@ import { customInstance } from '.././custom-instance';
|
|
|
38
41
|
import type { ErrorType } from '.././custom-instance';
|
|
39
42
|
|
|
40
43
|
|
|
41
|
-
|
|
42
|
-
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
43
|
-
config: any,
|
|
44
|
-
args: infer P,
|
|
45
|
-
) => any
|
|
46
|
-
? P
|
|
47
|
-
: never;
|
|
44
|
+
type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
|
|
48
45
|
|
|
49
46
|
|
|
50
47
|
/**
|
|
@@ -79,7 +76,7 @@ if(datasetPutBodyBody.unit_id !== undefined) {
|
|
|
79
76
|
}
|
|
80
77
|
|
|
81
78
|
return customInstance<DatasetPutPostResponse>(
|
|
82
|
-
{url: `/dataset`, method: '
|
|
79
|
+
{url: `/dataset`, method: 'PUT',
|
|
83
80
|
headers: {'Content-Type': 'multipart/form-data', },
|
|
84
81
|
data: formData
|
|
85
82
|
},
|
|
@@ -89,7 +86,6 @@ if(datasetPutBodyBody.unit_id !== undefined) {
|
|
|
89
86
|
|
|
90
87
|
|
|
91
88
|
export const getCreateDatasetFromFileMutationOptions = <TError = ErrorType<void | DmError>,
|
|
92
|
-
|
|
93
89
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDatasetFromFile>>, TError,{data: DatasetPutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
94
90
|
): UseMutationOptions<Awaited<ReturnType<typeof createDatasetFromFile>>, TError,{data: DatasetPutBodyBody}, TContext> => {
|
|
95
91
|
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
@@ -116,7 +112,6 @@ export const getCreateDatasetFromFileMutationOptions = <TError = ErrorType<void
|
|
|
116
112
|
* @summary Create a Dataset from a file in a Project
|
|
117
113
|
*/
|
|
118
114
|
export const useCreateDatasetFromFile = <TError = ErrorType<void | DmError>,
|
|
119
|
-
|
|
120
115
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDatasetFromFile>>, TError,{data: DatasetPutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
121
116
|
) => {
|
|
122
117
|
|
|
@@ -159,7 +154,7 @@ if(datasetPostBodyBody.dataset_id !== undefined) {
|
|
|
159
154
|
formData.append('unit_id', datasetPostBodyBody.unit_id)
|
|
160
155
|
|
|
161
156
|
return customInstance<DatasetPutPostResponse>(
|
|
162
|
-
{url: `/dataset`, method: '
|
|
157
|
+
{url: `/dataset`, method: 'POST',
|
|
163
158
|
headers: {'Content-Type': 'multipart/form-data', },
|
|
164
159
|
data: formData
|
|
165
160
|
},
|
|
@@ -169,7 +164,6 @@ formData.append('unit_id', datasetPostBodyBody.unit_id)
|
|
|
169
164
|
|
|
170
165
|
|
|
171
166
|
export const getUploadDatasetMutationOptions = <TError = ErrorType<void | DmError>,
|
|
172
|
-
|
|
173
167
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof uploadDataset>>, TError,{data: DatasetPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
174
168
|
): UseMutationOptions<Awaited<ReturnType<typeof uploadDataset>>, TError,{data: DatasetPostBodyBody}, TContext> => {
|
|
175
169
|
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
@@ -196,7 +190,6 @@ export const getUploadDatasetMutationOptions = <TError = ErrorType<void | DmErro
|
|
|
196
190
|
* @summary Upload an external file as a Dataset
|
|
197
191
|
*/
|
|
198
192
|
export const useUploadDataset = <TError = ErrorType<void | DmError>,
|
|
199
|
-
|
|
200
193
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof uploadDataset>>, TError,{data: DatasetPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
201
194
|
) => {
|
|
202
195
|
|
|
@@ -222,7 +215,7 @@ export const getDatasets = (
|
|
|
222
215
|
|
|
223
216
|
|
|
224
217
|
return customInstance<DatasetsGetResponse>(
|
|
225
|
-
{url: `/dataset`, method: '
|
|
218
|
+
{url: `/dataset`, method: 'GET',
|
|
226
219
|
params, signal
|
|
227
220
|
},
|
|
228
221
|
options);
|
|
@@ -230,12 +223,11 @@ export const getDatasets = (
|
|
|
230
223
|
|
|
231
224
|
|
|
232
225
|
export const getGetDatasetsQueryKey = (params?: GetDatasetsParams,) => {
|
|
233
|
-
|
|
234
226
|
return ["data-manager-api", `/dataset`, ...(params ? [params]: [])] as const;
|
|
235
227
|
}
|
|
236
228
|
|
|
237
229
|
|
|
238
|
-
export const getGetDatasetsQueryOptions = <TData = Awaited<ReturnType<typeof getDatasets>>, TError = ErrorType<void | DmError>>(params?: GetDatasetsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getDatasets>>, TError, TData
|
|
230
|
+
export const getGetDatasetsQueryOptions = <TData = Awaited<ReturnType<typeof getDatasets>>, TError = ErrorType<void | DmError>>(params?: GetDatasetsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getDatasets>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
239
231
|
) => {
|
|
240
232
|
|
|
241
233
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
@@ -260,7 +252,7 @@ export type GetDatasetsQueryError = ErrorType<void | DmError>
|
|
|
260
252
|
* @summary Get Datasets that are available to you
|
|
261
253
|
*/
|
|
262
254
|
export const useGetDatasets = <TData = Awaited<ReturnType<typeof getDatasets>>, TError = ErrorType<void | DmError>>(
|
|
263
|
-
params?: GetDatasetsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getDatasets>>, TError, TData
|
|
255
|
+
params?: GetDatasetsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getDatasets>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
264
256
|
|
|
265
257
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
266
258
|
|
|
@@ -275,6 +267,46 @@ export const useGetDatasets = <TData = Awaited<ReturnType<typeof getDatasets>>,
|
|
|
275
267
|
|
|
276
268
|
|
|
277
269
|
|
|
270
|
+
export const getGetDatasetsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getDatasets>>, TError = ErrorType<void | DmError>>(params?: GetDatasetsParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDatasets>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
271
|
+
) => {
|
|
272
|
+
|
|
273
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
274
|
+
|
|
275
|
+
const queryKey = queryOptions?.queryKey ?? getGetDatasetsQueryKey(params);
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getDatasets>>> = ({ signal }) => getDatasets(params, requestOptions, signal);
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDatasets>>, TError, TData> & { queryKey: QueryKey }
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
export type GetDatasetsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getDatasets>>>
|
|
289
|
+
export type GetDatasetsSuspenseQueryError = ErrorType<void | DmError>
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* @summary Get Datasets that are available to you
|
|
293
|
+
*/
|
|
294
|
+
export const useGetDatasetsSuspense = <TData = Awaited<ReturnType<typeof getDatasets>>, TError = ErrorType<void | DmError>>(
|
|
295
|
+
params?: GetDatasetsParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDatasets>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
296
|
+
|
|
297
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
298
|
+
|
|
299
|
+
const queryOptions = getGetDatasetsSuspenseQueryOptions(params,options)
|
|
300
|
+
|
|
301
|
+
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
302
|
+
|
|
303
|
+
query.queryKey = queryOptions.queryKey ;
|
|
304
|
+
|
|
305
|
+
return query;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
278
310
|
/**
|
|
279
311
|
* Returns a list of Dataset Versions.
|
|
280
312
|
|
|
@@ -290,7 +322,7 @@ export const getVersions = (
|
|
|
290
322
|
|
|
291
323
|
|
|
292
324
|
return customInstance<DatasetDetail>(
|
|
293
|
-
{url: `/dataset/${datasetId}/versions`, method: '
|
|
325
|
+
{url: `/dataset/${datasetId}/versions`, method: 'GET',
|
|
294
326
|
params, signal
|
|
295
327
|
},
|
|
296
328
|
options);
|
|
@@ -299,13 +331,12 @@ export const getVersions = (
|
|
|
299
331
|
|
|
300
332
|
export const getGetVersionsQueryKey = (datasetId: string,
|
|
301
333
|
params?: GetVersionsParams,) => {
|
|
302
|
-
|
|
303
334
|
return ["data-manager-api", `/dataset/${datasetId}/versions`, ...(params ? [params]: [])] as const;
|
|
304
335
|
}
|
|
305
336
|
|
|
306
337
|
|
|
307
338
|
export const getGetVersionsQueryOptions = <TData = Awaited<ReturnType<typeof getVersions>>, TError = ErrorType<void | DmError>>(datasetId: string,
|
|
308
|
-
params?: GetVersionsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getVersions>>, TError, TData
|
|
339
|
+
params?: GetVersionsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getVersions>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
309
340
|
) => {
|
|
310
341
|
|
|
311
342
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
@@ -331,7 +362,7 @@ export type GetVersionsQueryError = ErrorType<void | DmError>
|
|
|
331
362
|
*/
|
|
332
363
|
export const useGetVersions = <TData = Awaited<ReturnType<typeof getVersions>>, TError = ErrorType<void | DmError>>(
|
|
333
364
|
datasetId: string,
|
|
334
|
-
params?: GetVersionsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getVersions>>, TError, TData
|
|
365
|
+
params?: GetVersionsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getVersions>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
335
366
|
|
|
336
367
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
337
368
|
|
|
@@ -346,6 +377,48 @@ export const useGetVersions = <TData = Awaited<ReturnType<typeof getVersions>>,
|
|
|
346
377
|
|
|
347
378
|
|
|
348
379
|
|
|
380
|
+
export const getGetVersionsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getVersions>>, TError = ErrorType<void | DmError>>(datasetId: string,
|
|
381
|
+
params?: GetVersionsParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersions>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
382
|
+
) => {
|
|
383
|
+
|
|
384
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
385
|
+
|
|
386
|
+
const queryKey = queryOptions?.queryKey ?? getGetVersionsQueryKey(datasetId,params);
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getVersions>>> = ({ signal }) => getVersions(datasetId,params, requestOptions, signal);
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
return { queryKey, queryFn, enabled: !!(datasetId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersions>>, TError, TData> & { queryKey: QueryKey }
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export type GetVersionsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getVersions>>>
|
|
400
|
+
export type GetVersionsSuspenseQueryError = ErrorType<void | DmError>
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* @summary Gets all the Versions of a specific Dataset
|
|
404
|
+
*/
|
|
405
|
+
export const useGetVersionsSuspense = <TData = Awaited<ReturnType<typeof getVersions>>, TError = ErrorType<void | DmError>>(
|
|
406
|
+
datasetId: string,
|
|
407
|
+
params?: GetVersionsParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersions>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
408
|
+
|
|
409
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
410
|
+
|
|
411
|
+
const queryOptions = getGetVersionsSuspenseQueryOptions(datasetId,params,options)
|
|
412
|
+
|
|
413
|
+
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
414
|
+
|
|
415
|
+
query.queryKey = queryOptions.queryKey ;
|
|
416
|
+
|
|
417
|
+
return query;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
349
422
|
/**
|
|
350
423
|
* Given the Dataset `id` and `version` the Dataset will be removed. The API does not prevent you removing a Dataset that's been used in a **Project**. When removed using this endpoint the Dataset is automatically detached from any and all Projects that it was attached to and any corresponding Project Files relating to the Dataset are also removed.
|
|
351
424
|
|
|
@@ -363,7 +436,7 @@ export const deleteDataset = (
|
|
|
363
436
|
|
|
364
437
|
|
|
365
438
|
return customInstance<TaskIdentity>(
|
|
366
|
-
{url: `/dataset/${datasetId}/${datasetVersion}`, method: '
|
|
439
|
+
{url: `/dataset/${datasetId}/${datasetVersion}`, method: 'DELETE',
|
|
367
440
|
params
|
|
368
441
|
},
|
|
369
442
|
options);
|
|
@@ -372,7 +445,6 @@ export const deleteDataset = (
|
|
|
372
445
|
|
|
373
446
|
|
|
374
447
|
export const getDeleteDatasetMutationOptions = <TError = ErrorType<void | DmError>,
|
|
375
|
-
|
|
376
448
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteDataset>>, TError,{datasetId: string;datasetVersion: number;params?: DeleteDatasetParams}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
377
449
|
): UseMutationOptions<Awaited<ReturnType<typeof deleteDataset>>, TError,{datasetId: string;datasetVersion: number;params?: DeleteDatasetParams}, TContext> => {
|
|
378
450
|
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
@@ -399,7 +471,6 @@ export const getDeleteDatasetMutationOptions = <TError = ErrorType<void | DmErro
|
|
|
399
471
|
* @summary Delete a Dataset
|
|
400
472
|
*/
|
|
401
473
|
export const useDeleteDataset = <TError = ErrorType<void | DmError>,
|
|
402
|
-
|
|
403
474
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteDataset>>, TError,{datasetId: string;datasetVersion: number;params?: DeleteDatasetParams}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
404
475
|
) => {
|
|
405
476
|
|
|
@@ -422,7 +493,7 @@ export const downloadDataset = (
|
|
|
422
493
|
|
|
423
494
|
|
|
424
495
|
return customInstance<void>(
|
|
425
|
-
{url: `/dataset/${datasetId}/${datasetVersion}`, method: '
|
|
496
|
+
{url: `/dataset/${datasetId}/${datasetVersion}`, method: 'GET', signal
|
|
426
497
|
},
|
|
427
498
|
options);
|
|
428
499
|
}
|
|
@@ -430,13 +501,12 @@ export const downloadDataset = (
|
|
|
430
501
|
|
|
431
502
|
export const getDownloadDatasetQueryKey = (datasetId: string,
|
|
432
503
|
datasetVersion: number,) => {
|
|
433
|
-
|
|
434
504
|
return ["data-manager-api", `/dataset/${datasetId}/${datasetVersion}`] as const;
|
|
435
505
|
}
|
|
436
506
|
|
|
437
507
|
|
|
438
508
|
export const getDownloadDatasetQueryOptions = <TData = Awaited<ReturnType<typeof downloadDataset>>, TError = ErrorType<DmError>>(datasetId: string,
|
|
439
|
-
datasetVersion: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof downloadDataset>>, TError, TData
|
|
509
|
+
datasetVersion: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof downloadDataset>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
440
510
|
) => {
|
|
441
511
|
|
|
442
512
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
@@ -462,7 +532,7 @@ export type DownloadDatasetQueryError = ErrorType<DmError>
|
|
|
462
532
|
*/
|
|
463
533
|
export const useDownloadDataset = <TData = Awaited<ReturnType<typeof downloadDataset>>, TError = ErrorType<DmError>>(
|
|
464
534
|
datasetId: string,
|
|
465
|
-
datasetVersion: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof downloadDataset>>, TError, TData
|
|
535
|
+
datasetVersion: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof downloadDataset>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
466
536
|
|
|
467
537
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
468
538
|
|
|
@@ -477,6 +547,48 @@ export const useDownloadDataset = <TData = Awaited<ReturnType<typeof downloadDat
|
|
|
477
547
|
|
|
478
548
|
|
|
479
549
|
|
|
550
|
+
export const getDownloadDatasetSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof downloadDataset>>, TError = ErrorType<DmError>>(datasetId: string,
|
|
551
|
+
datasetVersion: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof downloadDataset>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
552
|
+
) => {
|
|
553
|
+
|
|
554
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
555
|
+
|
|
556
|
+
const queryKey = queryOptions?.queryKey ?? getDownloadDatasetQueryKey(datasetId,datasetVersion);
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadDataset>>> = ({ signal }) => downloadDataset(datasetId,datasetVersion, requestOptions, signal);
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
return { queryKey, queryFn, enabled: !!(datasetId && datasetVersion), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof downloadDataset>>, TError, TData> & { queryKey: QueryKey }
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
export type DownloadDatasetSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof downloadDataset>>>
|
|
570
|
+
export type DownloadDatasetSuspenseQueryError = ErrorType<DmError>
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* @summary Download a Dataset
|
|
574
|
+
*/
|
|
575
|
+
export const useDownloadDatasetSuspense = <TData = Awaited<ReturnType<typeof downloadDataset>>, TError = ErrorType<DmError>>(
|
|
576
|
+
datasetId: string,
|
|
577
|
+
datasetVersion: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof downloadDataset>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
578
|
+
|
|
579
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
580
|
+
|
|
581
|
+
const queryOptions = getDownloadDatasetSuspenseQueryOptions(datasetId,datasetVersion,options)
|
|
582
|
+
|
|
583
|
+
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
584
|
+
|
|
585
|
+
query.queryKey = queryOptions.queryKey ;
|
|
586
|
+
|
|
587
|
+
return query;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
|
|
591
|
+
|
|
480
592
|
/**
|
|
481
593
|
* The user is removed from the Dataset's `editor` list. The user is removed from all versions of a dataset. You can remove yourself but an `owner` (creator) will always have access to the dataset.
|
|
482
594
|
|
|
@@ -493,7 +605,7 @@ export const removeEditorFromDataset = (
|
|
|
493
605
|
|
|
494
606
|
|
|
495
607
|
return customInstance<void>(
|
|
496
|
-
{url: `/dataset/${datasetId}/editor/${userId}`, method: '
|
|
608
|
+
{url: `/dataset/${datasetId}/editor/${userId}`, method: 'DELETE'
|
|
497
609
|
},
|
|
498
610
|
options);
|
|
499
611
|
}
|
|
@@ -501,7 +613,6 @@ export const removeEditorFromDataset = (
|
|
|
501
613
|
|
|
502
614
|
|
|
503
615
|
export const getRemoveEditorFromDatasetMutationOptions = <TError = ErrorType<DmError>,
|
|
504
|
-
|
|
505
616
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof removeEditorFromDataset>>, TError,{datasetId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
506
617
|
): UseMutationOptions<Awaited<ReturnType<typeof removeEditorFromDataset>>, TError,{datasetId: string;userId: string}, TContext> => {
|
|
507
618
|
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
@@ -528,7 +639,6 @@ export const getRemoveEditorFromDatasetMutationOptions = <TError = ErrorType<DmE
|
|
|
528
639
|
* @summary Remove a user's edit permission for a Dataset
|
|
529
640
|
*/
|
|
530
641
|
export const useRemoveEditorFromDataset = <TError = ErrorType<DmError>,
|
|
531
|
-
|
|
532
642
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof removeEditorFromDataset>>, TError,{datasetId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
533
643
|
) => {
|
|
534
644
|
|
|
@@ -552,7 +662,7 @@ export const addEditorToDataset = (
|
|
|
552
662
|
|
|
553
663
|
|
|
554
664
|
return customInstance<void>(
|
|
555
|
-
{url: `/dataset/${datasetId}/editor/${userId}`, method: '
|
|
665
|
+
{url: `/dataset/${datasetId}/editor/${userId}`, method: 'PUT'
|
|
556
666
|
},
|
|
557
667
|
options);
|
|
558
668
|
}
|
|
@@ -560,7 +670,6 @@ export const addEditorToDataset = (
|
|
|
560
670
|
|
|
561
671
|
|
|
562
672
|
export const getAddEditorToDatasetMutationOptions = <TError = ErrorType<DmError>,
|
|
563
|
-
|
|
564
673
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addEditorToDataset>>, TError,{datasetId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
565
674
|
): UseMutationOptions<Awaited<ReturnType<typeof addEditorToDataset>>, TError,{datasetId: string;userId: string}, TContext> => {
|
|
566
675
|
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
@@ -587,7 +696,6 @@ export const getAddEditorToDatasetMutationOptions = <TError = ErrorType<DmError>
|
|
|
587
696
|
* @summary Give a user edit permission for a Dataset
|
|
588
697
|
*/
|
|
589
698
|
export const useAddEditorToDataset = <TError = ErrorType<DmError>,
|
|
590
|
-
|
|
591
699
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addEditorToDataset>>, TError,{datasetId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
592
700
|
) => {
|
|
593
701
|
|
|
@@ -607,19 +715,18 @@ export const getDatasetDigest = (
|
|
|
607
715
|
|
|
608
716
|
|
|
609
717
|
return customInstance<DatasetDigestGetResponse>(
|
|
610
|
-
{url: `/dataset/digest/${datasetDigest}`, method: '
|
|
718
|
+
{url: `/dataset/digest/${datasetDigest}`, method: 'GET', signal
|
|
611
719
|
},
|
|
612
720
|
options);
|
|
613
721
|
}
|
|
614
722
|
|
|
615
723
|
|
|
616
724
|
export const getGetDatasetDigestQueryKey = (datasetDigest: string,) => {
|
|
617
|
-
|
|
618
725
|
return ["data-manager-api", `/dataset/digest/${datasetDigest}`] as const;
|
|
619
726
|
}
|
|
620
727
|
|
|
621
728
|
|
|
622
|
-
export const getGetDatasetDigestQueryOptions = <TData = Awaited<ReturnType<typeof getDatasetDigest>>, TError = ErrorType<void | DmError>>(datasetDigest: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getDatasetDigest>>, TError, TData
|
|
729
|
+
export const getGetDatasetDigestQueryOptions = <TData = Awaited<ReturnType<typeof getDatasetDigest>>, TError = ErrorType<void | DmError>>(datasetDigest: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getDatasetDigest>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
623
730
|
) => {
|
|
624
731
|
|
|
625
732
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
@@ -644,7 +751,7 @@ export type GetDatasetDigestQueryError = ErrorType<void | DmError>
|
|
|
644
751
|
* @summary Gets the first Dataset that matches the provided digest
|
|
645
752
|
*/
|
|
646
753
|
export const useGetDatasetDigest = <TData = Awaited<ReturnType<typeof getDatasetDigest>>, TError = ErrorType<void | DmError>>(
|
|
647
|
-
datasetDigest: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getDatasetDigest>>, TError, TData
|
|
754
|
+
datasetDigest: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getDatasetDigest>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
648
755
|
|
|
649
756
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
650
757
|
|
|
@@ -659,6 +766,46 @@ export const useGetDatasetDigest = <TData = Awaited<ReturnType<typeof getDataset
|
|
|
659
766
|
|
|
660
767
|
|
|
661
768
|
|
|
769
|
+
export const getGetDatasetDigestSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getDatasetDigest>>, TError = ErrorType<void | DmError>>(datasetDigest: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDatasetDigest>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
770
|
+
) => {
|
|
771
|
+
|
|
772
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
773
|
+
|
|
774
|
+
const queryKey = queryOptions?.queryKey ?? getGetDatasetDigestQueryKey(datasetDigest);
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getDatasetDigest>>> = ({ signal }) => getDatasetDigest(datasetDigest, requestOptions, signal);
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
return { queryKey, queryFn, enabled: !!(datasetDigest), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDatasetDigest>>, TError, TData> & { queryKey: QueryKey }
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
export type GetDatasetDigestSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getDatasetDigest>>>
|
|
788
|
+
export type GetDatasetDigestSuspenseQueryError = ErrorType<void | DmError>
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* @summary Gets the first Dataset that matches the provided digest
|
|
792
|
+
*/
|
|
793
|
+
export const useGetDatasetDigestSuspense = <TData = Awaited<ReturnType<typeof getDatasetDigest>>, TError = ErrorType<void | DmError>>(
|
|
794
|
+
datasetDigest: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDatasetDigest>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
795
|
+
|
|
796
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
797
|
+
|
|
798
|
+
const queryOptions = getGetDatasetDigestSuspenseQueryOptions(datasetDigest,options)
|
|
799
|
+
|
|
800
|
+
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
801
|
+
|
|
802
|
+
query.queryKey = queryOptions.queryKey ;
|
|
803
|
+
|
|
804
|
+
return query;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
|
|
662
809
|
/**
|
|
663
810
|
* Returns the property schema for a Dataset versions in JSON format (if available).
|
|
664
811
|
|
|
@@ -672,7 +819,7 @@ export const getSchema = (
|
|
|
672
819
|
|
|
673
820
|
|
|
674
821
|
return customInstance<DatasetSchemaGetResponse>(
|
|
675
|
-
{url: `/dataset/${datasetId}/schema/${datasetVersion}`, method: '
|
|
822
|
+
{url: `/dataset/${datasetId}/schema/${datasetVersion}`, method: 'GET', signal
|
|
676
823
|
},
|
|
677
824
|
options);
|
|
678
825
|
}
|
|
@@ -680,13 +827,12 @@ export const getSchema = (
|
|
|
680
827
|
|
|
681
828
|
export const getGetSchemaQueryKey = (datasetId: string,
|
|
682
829
|
datasetVersion: number,) => {
|
|
683
|
-
|
|
684
830
|
return ["data-manager-api", `/dataset/${datasetId}/schema/${datasetVersion}`] as const;
|
|
685
831
|
}
|
|
686
832
|
|
|
687
833
|
|
|
688
834
|
export const getGetSchemaQueryOptions = <TData = Awaited<ReturnType<typeof getSchema>>, TError = ErrorType<void | DmError>>(datasetId: string,
|
|
689
|
-
datasetVersion: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getSchema>>, TError, TData
|
|
835
|
+
datasetVersion: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSchema>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
690
836
|
) => {
|
|
691
837
|
|
|
692
838
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
@@ -712,7 +858,7 @@ export type GetSchemaQueryError = ErrorType<void | DmError>
|
|
|
712
858
|
*/
|
|
713
859
|
export const useGetSchema = <TData = Awaited<ReturnType<typeof getSchema>>, TError = ErrorType<void | DmError>>(
|
|
714
860
|
datasetId: string,
|
|
715
|
-
datasetVersion: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getSchema>>, TError, TData
|
|
861
|
+
datasetVersion: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSchema>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
716
862
|
|
|
717
863
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
718
864
|
|
|
@@ -727,3 +873,45 @@ export const useGetSchema = <TData = Awaited<ReturnType<typeof getSchema>>, TErr
|
|
|
727
873
|
|
|
728
874
|
|
|
729
875
|
|
|
876
|
+
export const getGetSchemaSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getSchema>>, TError = ErrorType<void | DmError>>(datasetId: string,
|
|
877
|
+
datasetVersion: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSchema>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
878
|
+
) => {
|
|
879
|
+
|
|
880
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
881
|
+
|
|
882
|
+
const queryKey = queryOptions?.queryKey ?? getGetSchemaQueryKey(datasetId,datasetVersion);
|
|
883
|
+
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getSchema>>> = ({ signal }) => getSchema(datasetId,datasetVersion, requestOptions, signal);
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
|
|
892
|
+
return { queryKey, queryFn, enabled: !!(datasetId && datasetVersion), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSchema>>, TError, TData> & { queryKey: QueryKey }
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
export type GetSchemaSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getSchema>>>
|
|
896
|
+
export type GetSchemaSuspenseQueryError = ErrorType<void | DmError>
|
|
897
|
+
|
|
898
|
+
/**
|
|
899
|
+
* @summary Gets the property schema for a specific Dataset
|
|
900
|
+
*/
|
|
901
|
+
export const useGetSchemaSuspense = <TData = Awaited<ReturnType<typeof getSchema>>, TError = ErrorType<void | DmError>>(
|
|
902
|
+
datasetId: string,
|
|
903
|
+
datasetVersion: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSchema>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
904
|
+
|
|
905
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
906
|
+
|
|
907
|
+
const queryOptions = getGetSchemaSuspenseQueryOptions(datasetId,datasetVersion,options)
|
|
908
|
+
|
|
909
|
+
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
910
|
+
|
|
911
|
+
query.queryKey = queryOptions.queryKey ;
|
|
912
|
+
|
|
913
|
+
return query;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
|