@squonk/data-manager-client 0.7.3-rc.4 → 0.7.7
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 +5 -5
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.ts +8 -3
- package/accounting/accounting.js +1 -1
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +35 -25
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +36 -17
- package/admin/admin.js +32 -22
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +12 -12
- package/application/application.cjs.map +1 -1
- package/application/application.d.ts +11 -6
- package/application/application.js +9 -9
- package/application/application.js.map +1 -1
- package/{chunk-JR7F532L.js → chunk-6EEIAH4R.js} +1 -1
- package/{chunk-JR7F532L.js.map → chunk-6EEIAH4R.js.map} +1 -1
- package/{chunk-3DXYUDZH.cjs → chunk-NGBTCJWS.cjs} +1 -1
- package/chunk-NGBTCJWS.cjs.map +1 -0
- package/{custom-instance-32850190.d.ts → custom-instance-42e56f26.d.ts} +10 -3
- package/dataset/dataset.cjs +62 -52
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +52 -29
- package/dataset/dataset.js +54 -44
- package/dataset/dataset.js.map +1 -1
- package/file/file.cjs +22 -17
- package/file/file.cjs.map +1 -1
- package/file/file.d.ts +20 -8
- package/file/file.js +18 -13
- package/file/file.js.map +1 -1
- package/index.cjs +2 -2
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs +26 -21
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.ts +23 -11
- package/instance/instance.js +23 -18
- package/instance/instance.js.map +1 -1
- package/job/job.cjs +11 -11
- package/job/job.cjs.map +1 -1
- package/job/job.d.ts +11 -6
- package/job/job.js +8 -8
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +34 -28
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.ts +27 -16
- package/metadata/metadata.js +30 -24
- package/metadata/metadata.js.map +1 -1
- package/package.json +14 -14
- package/project/project.cjs +56 -41
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +49 -27
- package/project/project.js +52 -37
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +11 -1
- package/src/admin/admin.ts +94 -37
- package/src/application/application.ts +19 -9
- package/src/data-manager-api.schemas.ts +6 -3
- package/src/dataset/dataset.ts +130 -65
- package/src/file/file.ts +47 -16
- package/src/instance/instance.ts +57 -24
- package/src/job/job.ts +14 -8
- package/src/metadata/metadata.ts +66 -38
- package/src/project/project.ts +121 -55
- package/src/task/task.ts +28 -16
- package/src/type/type.ts +6 -1
- package/src/user/user.ts +26 -2
- package/task/task.cjs +16 -16
- package/task/task.cjs.map +1 -1
- package/task/task.d.ts +15 -8
- package/task/task.js +13 -13
- package/task/task.js.map +1 -1
- package/type/type.cjs +3 -3
- package/type/type.cjs.map +1 -1
- package/type/type.d.ts +6 -3
- package/type/type.js +1 -1
- package/type/type.js.map +1 -1
- package/user/user.cjs +13 -8
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +12 -2
- package/user/user.js +7 -2
- package/user/user.js.map +1 -1
- package/chunk-3DXYUDZH.cjs.map +0 -1
package/src/dataset/dataset.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
2
|
+
* Generated by orval v6.7.1 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Dataset Manager API
|
|
5
5
|
* The Dataset Manager API service.
|
|
@@ -90,11 +90,22 @@ export const createDatasetFromFile = (
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
return customInstance<DatasetPutPostResponse>(
|
|
93
|
-
{
|
|
93
|
+
{
|
|
94
|
+
url: `/dataset`,
|
|
95
|
+
method: "put",
|
|
96
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
97
|
+
data: formData,
|
|
98
|
+
},
|
|
94
99
|
options
|
|
95
100
|
);
|
|
96
101
|
};
|
|
97
102
|
|
|
103
|
+
export type CreateDatasetFromFileMutationResult = NonNullable<
|
|
104
|
+
AsyncReturnType<typeof createDatasetFromFile>
|
|
105
|
+
>;
|
|
106
|
+
export type CreateDatasetFromFileMutationBody = DatasetPutBodyBody;
|
|
107
|
+
export type CreateDatasetFromFileMutationError = ErrorType<void | DmError>;
|
|
108
|
+
|
|
98
109
|
export const useCreateDatasetFromFile = <
|
|
99
110
|
TError = ErrorType<void | DmError>,
|
|
100
111
|
TContext = unknown
|
|
@@ -167,11 +178,22 @@ export const uploadDataset = (
|
|
|
167
178
|
formData.append("unit_id", datasetPostBodyBody.unit_id);
|
|
168
179
|
|
|
169
180
|
return customInstance<DatasetPutPostResponse>(
|
|
170
|
-
{
|
|
181
|
+
{
|
|
182
|
+
url: `/dataset`,
|
|
183
|
+
method: "post",
|
|
184
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
185
|
+
data: formData,
|
|
186
|
+
},
|
|
171
187
|
options
|
|
172
188
|
);
|
|
173
189
|
};
|
|
174
190
|
|
|
191
|
+
export type UploadDatasetMutationResult = NonNullable<
|
|
192
|
+
AsyncReturnType<typeof uploadDataset>
|
|
193
|
+
>;
|
|
194
|
+
export type UploadDatasetMutationBody = DatasetPostBodyBody;
|
|
195
|
+
export type UploadDatasetMutationError = ErrorType<void | DmError>;
|
|
196
|
+
|
|
175
197
|
export const useUploadDataset = <
|
|
176
198
|
TError = ErrorType<void | DmError>,
|
|
177
199
|
TContext = unknown
|
|
@@ -228,6 +250,11 @@ export const getGetDatasetsQueryKey = (params?: GetDatasetsParams) => [
|
|
|
228
250
|
...(params ? [params] : []),
|
|
229
251
|
];
|
|
230
252
|
|
|
253
|
+
export type GetDatasetsQueryResult = NonNullable<
|
|
254
|
+
AsyncReturnType<typeof getDatasets>
|
|
255
|
+
>;
|
|
256
|
+
export type GetDatasetsQueryError = ErrorType<void | DmError>;
|
|
257
|
+
|
|
231
258
|
export const useGetDatasets = <
|
|
232
259
|
TData = AsyncReturnType<typeof getDatasets>,
|
|
233
260
|
TError = ErrorType<void | DmError>
|
|
@@ -265,26 +292,31 @@ You will not see Datasets while their upload is still in progress.
|
|
|
265
292
|
* @summary Gets all the versions of a specific Dataset
|
|
266
293
|
*/
|
|
267
294
|
export const getVersions = (
|
|
268
|
-
|
|
295
|
+
datasetId: string,
|
|
269
296
|
params?: GetVersionsParams,
|
|
270
297
|
options?: SecondParameter<typeof customInstance>
|
|
271
298
|
) => {
|
|
272
299
|
return customInstance<DatasetVersionsGetResponse>(
|
|
273
|
-
{ url: `/dataset/${
|
|
300
|
+
{ url: `/dataset/${datasetId}/versions`, method: "get", params },
|
|
274
301
|
options
|
|
275
302
|
);
|
|
276
303
|
};
|
|
277
304
|
|
|
278
305
|
export const getGetVersionsQueryKey = (
|
|
279
|
-
|
|
306
|
+
datasetId: string,
|
|
280
307
|
params?: GetVersionsParams
|
|
281
|
-
) => [`/dataset/${
|
|
308
|
+
) => [`/dataset/${datasetId}/versions`, ...(params ? [params] : [])];
|
|
309
|
+
|
|
310
|
+
export type GetVersionsQueryResult = NonNullable<
|
|
311
|
+
AsyncReturnType<typeof getVersions>
|
|
312
|
+
>;
|
|
313
|
+
export type GetVersionsQueryError = ErrorType<void | DmError>;
|
|
282
314
|
|
|
283
315
|
export const useGetVersions = <
|
|
284
316
|
TData = AsyncReturnType<typeof getVersions>,
|
|
285
317
|
TError = ErrorType<void | DmError>
|
|
286
318
|
>(
|
|
287
|
-
|
|
319
|
+
datasetId: string,
|
|
288
320
|
params?: GetVersionsParams,
|
|
289
321
|
options?: {
|
|
290
322
|
query?: UseQueryOptions<AsyncReturnType<typeof getVersions>, TError, TData>;
|
|
@@ -294,15 +326,15 @@ export const useGetVersions = <
|
|
|
294
326
|
const { query: queryOptions, request: requestOptions } = options || {};
|
|
295
327
|
|
|
296
328
|
const queryKey =
|
|
297
|
-
queryOptions?.queryKey ?? getGetVersionsQueryKey(
|
|
329
|
+
queryOptions?.queryKey ?? getGetVersionsQueryKey(datasetId, params);
|
|
298
330
|
|
|
299
331
|
const queryFn: QueryFunction<AsyncReturnType<typeof getVersions>> = () =>
|
|
300
|
-
getVersions(
|
|
332
|
+
getVersions(datasetId, params, requestOptions);
|
|
301
333
|
|
|
302
334
|
const query = useQuery<AsyncReturnType<typeof getVersions>, TError, TData>(
|
|
303
335
|
queryKey,
|
|
304
336
|
queryFn,
|
|
305
|
-
{ enabled: !!
|
|
337
|
+
{ enabled: !!datasetId, ...queryOptions }
|
|
306
338
|
);
|
|
307
339
|
|
|
308
340
|
return {
|
|
@@ -321,14 +353,14 @@ You cannot delete a Dataset until its upload is complete.
|
|
|
321
353
|
* @summary Delete a dataset
|
|
322
354
|
*/
|
|
323
355
|
export const deleteDataset = (
|
|
324
|
-
|
|
325
|
-
|
|
356
|
+
datasetId: string,
|
|
357
|
+
datasetVersion: number,
|
|
326
358
|
params?: DeleteDatasetParams,
|
|
327
359
|
options?: SecondParameter<typeof customInstance>
|
|
328
360
|
) => {
|
|
329
361
|
return customInstance<DatasetVersionDeleteResponse>(
|
|
330
362
|
{
|
|
331
|
-
url: `/dataset/${
|
|
363
|
+
url: `/dataset/${datasetId}/${datasetVersion}`,
|
|
332
364
|
method: "delete",
|
|
333
365
|
params,
|
|
334
366
|
},
|
|
@@ -336,6 +368,12 @@ export const deleteDataset = (
|
|
|
336
368
|
);
|
|
337
369
|
};
|
|
338
370
|
|
|
371
|
+
export type DeleteDatasetMutationResult = NonNullable<
|
|
372
|
+
AsyncReturnType<typeof deleteDataset>
|
|
373
|
+
>;
|
|
374
|
+
|
|
375
|
+
export type DeleteDatasetMutationError = ErrorType<void | DmError>;
|
|
376
|
+
|
|
339
377
|
export const useDeleteDataset = <
|
|
340
378
|
TError = ErrorType<void | DmError>,
|
|
341
379
|
TContext = unknown
|
|
@@ -343,7 +381,7 @@ export const useDeleteDataset = <
|
|
|
343
381
|
mutation?: UseMutationOptions<
|
|
344
382
|
AsyncReturnType<typeof deleteDataset>,
|
|
345
383
|
TError,
|
|
346
|
-
{
|
|
384
|
+
{ datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },
|
|
347
385
|
TContext
|
|
348
386
|
>;
|
|
349
387
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -352,17 +390,17 @@ export const useDeleteDataset = <
|
|
|
352
390
|
|
|
353
391
|
const mutationFn: MutationFunction<
|
|
354
392
|
AsyncReturnType<typeof deleteDataset>,
|
|
355
|
-
{
|
|
393
|
+
{ datasetId: string; datasetVersion: number; params?: DeleteDatasetParams }
|
|
356
394
|
> = (props) => {
|
|
357
|
-
const {
|
|
395
|
+
const { datasetId, datasetVersion, params } = props || {};
|
|
358
396
|
|
|
359
|
-
return deleteDataset(
|
|
397
|
+
return deleteDataset(datasetId, datasetVersion, params, requestOptions);
|
|
360
398
|
};
|
|
361
399
|
|
|
362
400
|
return useMutation<
|
|
363
401
|
AsyncReturnType<typeof deleteDataset>,
|
|
364
402
|
TError,
|
|
365
|
-
{
|
|
403
|
+
{ datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },
|
|
366
404
|
TContext
|
|
367
405
|
>(mutationFn, mutationOptions);
|
|
368
406
|
};
|
|
@@ -374,27 +412,32 @@ You cannot get a Dataset until its upload is complete.
|
|
|
374
412
|
* @summary Download a dataset
|
|
375
413
|
*/
|
|
376
414
|
export const downloadDataset = (
|
|
377
|
-
|
|
378
|
-
|
|
415
|
+
datasetId: string,
|
|
416
|
+
datasetVersion: number,
|
|
379
417
|
options?: SecondParameter<typeof customInstance>
|
|
380
418
|
) => {
|
|
381
419
|
return customInstance<void>(
|
|
382
|
-
{ url: `/dataset/${
|
|
420
|
+
{ url: `/dataset/${datasetId}/${datasetVersion}`, method: "get" },
|
|
383
421
|
options
|
|
384
422
|
);
|
|
385
423
|
};
|
|
386
424
|
|
|
387
425
|
export const getDownloadDatasetQueryKey = (
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
) => [`/dataset/${
|
|
426
|
+
datasetId: string,
|
|
427
|
+
datasetVersion: number
|
|
428
|
+
) => [`/dataset/${datasetId}/${datasetVersion}`];
|
|
429
|
+
|
|
430
|
+
export type DownloadDatasetQueryResult = NonNullable<
|
|
431
|
+
AsyncReturnType<typeof downloadDataset>
|
|
432
|
+
>;
|
|
433
|
+
export type DownloadDatasetQueryError = ErrorType<DmError>;
|
|
391
434
|
|
|
392
435
|
export const useDownloadDataset = <
|
|
393
436
|
TData = AsyncReturnType<typeof downloadDataset>,
|
|
394
437
|
TError = ErrorType<DmError>
|
|
395
438
|
>(
|
|
396
|
-
|
|
397
|
-
|
|
439
|
+
datasetId: string,
|
|
440
|
+
datasetVersion: number,
|
|
398
441
|
options?: {
|
|
399
442
|
query?: UseQueryOptions<
|
|
400
443
|
AsyncReturnType<typeof downloadDataset>,
|
|
@@ -408,17 +451,17 @@ export const useDownloadDataset = <
|
|
|
408
451
|
|
|
409
452
|
const queryKey =
|
|
410
453
|
queryOptions?.queryKey ??
|
|
411
|
-
getDownloadDatasetQueryKey(
|
|
454
|
+
getDownloadDatasetQueryKey(datasetId, datasetVersion);
|
|
412
455
|
|
|
413
456
|
const queryFn: QueryFunction<AsyncReturnType<typeof downloadDataset>> = () =>
|
|
414
|
-
downloadDataset(
|
|
457
|
+
downloadDataset(datasetId, datasetVersion, requestOptions);
|
|
415
458
|
|
|
416
459
|
const query = useQuery<
|
|
417
460
|
AsyncReturnType<typeof downloadDataset>,
|
|
418
461
|
TError,
|
|
419
462
|
TData
|
|
420
463
|
>(queryKey, queryFn, {
|
|
421
|
-
enabled: !!(
|
|
464
|
+
enabled: !!(datasetId && datasetVersion),
|
|
422
465
|
...queryOptions,
|
|
423
466
|
});
|
|
424
467
|
|
|
@@ -438,16 +481,22 @@ You cannot modify Dataset editors until its upload is complete.
|
|
|
438
481
|
* @summary Remove a user's edit permission for a Dataset
|
|
439
482
|
*/
|
|
440
483
|
export const removeEditorFromDataset = (
|
|
441
|
-
|
|
442
|
-
|
|
484
|
+
datasetId: string,
|
|
485
|
+
userId: string,
|
|
443
486
|
options?: SecondParameter<typeof customInstance>
|
|
444
487
|
) => {
|
|
445
488
|
return customInstance<void>(
|
|
446
|
-
{ url: `/dataset/${
|
|
489
|
+
{ url: `/dataset/${datasetId}/editor/${userId}`, method: "delete" },
|
|
447
490
|
options
|
|
448
491
|
);
|
|
449
492
|
};
|
|
450
493
|
|
|
494
|
+
export type RemoveEditorFromDatasetMutationResult = NonNullable<
|
|
495
|
+
AsyncReturnType<typeof removeEditorFromDataset>
|
|
496
|
+
>;
|
|
497
|
+
|
|
498
|
+
export type RemoveEditorFromDatasetMutationError = ErrorType<DmError>;
|
|
499
|
+
|
|
451
500
|
export const useRemoveEditorFromDataset = <
|
|
452
501
|
TError = ErrorType<DmError>,
|
|
453
502
|
TContext = unknown
|
|
@@ -455,7 +504,7 @@ export const useRemoveEditorFromDataset = <
|
|
|
455
504
|
mutation?: UseMutationOptions<
|
|
456
505
|
AsyncReturnType<typeof removeEditorFromDataset>,
|
|
457
506
|
TError,
|
|
458
|
-
{
|
|
507
|
+
{ datasetId: string; userId: string },
|
|
459
508
|
TContext
|
|
460
509
|
>;
|
|
461
510
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -464,17 +513,17 @@ export const useRemoveEditorFromDataset = <
|
|
|
464
513
|
|
|
465
514
|
const mutationFn: MutationFunction<
|
|
466
515
|
AsyncReturnType<typeof removeEditorFromDataset>,
|
|
467
|
-
{
|
|
516
|
+
{ datasetId: string; userId: string }
|
|
468
517
|
> = (props) => {
|
|
469
|
-
const {
|
|
518
|
+
const { datasetId, userId } = props || {};
|
|
470
519
|
|
|
471
|
-
return removeEditorFromDataset(
|
|
520
|
+
return removeEditorFromDataset(datasetId, userId, requestOptions);
|
|
472
521
|
};
|
|
473
522
|
|
|
474
523
|
return useMutation<
|
|
475
524
|
AsyncReturnType<typeof removeEditorFromDataset>,
|
|
476
525
|
TError,
|
|
477
|
-
{
|
|
526
|
+
{ datasetId: string; userId: string },
|
|
478
527
|
TContext
|
|
479
528
|
>(mutationFn, mutationOptions);
|
|
480
529
|
};
|
|
@@ -488,16 +537,22 @@ You cannot modify Dataset editors until its upload is complete.
|
|
|
488
537
|
* @summary Give a user edit permission for a dataset
|
|
489
538
|
*/
|
|
490
539
|
export const addEditorToDataset = (
|
|
491
|
-
|
|
492
|
-
|
|
540
|
+
datasetId: string,
|
|
541
|
+
userId: string,
|
|
493
542
|
options?: SecondParameter<typeof customInstance>
|
|
494
543
|
) => {
|
|
495
544
|
return customInstance<void>(
|
|
496
|
-
{ url: `/dataset/${
|
|
545
|
+
{ url: `/dataset/${datasetId}/editor/${userId}`, method: "put" },
|
|
497
546
|
options
|
|
498
547
|
);
|
|
499
548
|
};
|
|
500
549
|
|
|
550
|
+
export type AddEditorToDatasetMutationResult = NonNullable<
|
|
551
|
+
AsyncReturnType<typeof addEditorToDataset>
|
|
552
|
+
>;
|
|
553
|
+
|
|
554
|
+
export type AddEditorToDatasetMutationError = ErrorType<DmError>;
|
|
555
|
+
|
|
501
556
|
export const useAddEditorToDataset = <
|
|
502
557
|
TError = ErrorType<DmError>,
|
|
503
558
|
TContext = unknown
|
|
@@ -505,7 +560,7 @@ export const useAddEditorToDataset = <
|
|
|
505
560
|
mutation?: UseMutationOptions<
|
|
506
561
|
AsyncReturnType<typeof addEditorToDataset>,
|
|
507
562
|
TError,
|
|
508
|
-
{
|
|
563
|
+
{ datasetId: string; userId: string },
|
|
509
564
|
TContext
|
|
510
565
|
>;
|
|
511
566
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -514,17 +569,17 @@ export const useAddEditorToDataset = <
|
|
|
514
569
|
|
|
515
570
|
const mutationFn: MutationFunction<
|
|
516
571
|
AsyncReturnType<typeof addEditorToDataset>,
|
|
517
|
-
{
|
|
572
|
+
{ datasetId: string; userId: string }
|
|
518
573
|
> = (props) => {
|
|
519
|
-
const {
|
|
574
|
+
const { datasetId, userId } = props || {};
|
|
520
575
|
|
|
521
|
-
return addEditorToDataset(
|
|
576
|
+
return addEditorToDataset(datasetId, userId, requestOptions);
|
|
522
577
|
};
|
|
523
578
|
|
|
524
579
|
return useMutation<
|
|
525
580
|
AsyncReturnType<typeof addEditorToDataset>,
|
|
526
581
|
TError,
|
|
527
|
-
{
|
|
582
|
+
{ datasetId: string; userId: string },
|
|
528
583
|
TContext
|
|
529
584
|
>(mutationFn, mutationOptions);
|
|
530
585
|
};
|
|
@@ -534,24 +589,29 @@ export const useAddEditorToDataset = <
|
|
|
534
589
|
* @summary Gets the first Dataset that matches the provided digest
|
|
535
590
|
*/
|
|
536
591
|
export const getDatasetDigest = (
|
|
537
|
-
|
|
592
|
+
datasetDigest: string,
|
|
538
593
|
options?: SecondParameter<typeof customInstance>
|
|
539
594
|
) => {
|
|
540
595
|
return customInstance<DatasetDigestGetResponse>(
|
|
541
|
-
{ url: `/dataset/digest/${
|
|
596
|
+
{ url: `/dataset/digest/${datasetDigest}`, method: "get" },
|
|
542
597
|
options
|
|
543
598
|
);
|
|
544
599
|
};
|
|
545
600
|
|
|
546
|
-
export const getGetDatasetDigestQueryKey = (
|
|
547
|
-
`/dataset/digest/${
|
|
601
|
+
export const getGetDatasetDigestQueryKey = (datasetDigest: string) => [
|
|
602
|
+
`/dataset/digest/${datasetDigest}`,
|
|
548
603
|
];
|
|
549
604
|
|
|
605
|
+
export type GetDatasetDigestQueryResult = NonNullable<
|
|
606
|
+
AsyncReturnType<typeof getDatasetDigest>
|
|
607
|
+
>;
|
|
608
|
+
export type GetDatasetDigestQueryError = ErrorType<void | DmError>;
|
|
609
|
+
|
|
550
610
|
export const useGetDatasetDigest = <
|
|
551
611
|
TData = AsyncReturnType<typeof getDatasetDigest>,
|
|
552
612
|
TError = ErrorType<void | DmError>
|
|
553
613
|
>(
|
|
554
|
-
|
|
614
|
+
datasetDigest: string,
|
|
555
615
|
options?: {
|
|
556
616
|
query?: UseQueryOptions<
|
|
557
617
|
AsyncReturnType<typeof getDatasetDigest>,
|
|
@@ -564,16 +624,16 @@ export const useGetDatasetDigest = <
|
|
|
564
624
|
const { query: queryOptions, request: requestOptions } = options || {};
|
|
565
625
|
|
|
566
626
|
const queryKey =
|
|
567
|
-
queryOptions?.queryKey ?? getGetDatasetDigestQueryKey(
|
|
627
|
+
queryOptions?.queryKey ?? getGetDatasetDigestQueryKey(datasetDigest);
|
|
568
628
|
|
|
569
629
|
const queryFn: QueryFunction<AsyncReturnType<typeof getDatasetDigest>> = () =>
|
|
570
|
-
getDatasetDigest(
|
|
630
|
+
getDatasetDigest(datasetDigest, requestOptions);
|
|
571
631
|
|
|
572
632
|
const query = useQuery<
|
|
573
633
|
AsyncReturnType<typeof getDatasetDigest>,
|
|
574
634
|
TError,
|
|
575
635
|
TData
|
|
576
|
-
>(queryKey, queryFn, { enabled: !!
|
|
636
|
+
>(queryKey, queryFn, { enabled: !!datasetDigest, ...queryOptions });
|
|
577
637
|
|
|
578
638
|
return {
|
|
579
639
|
queryKey,
|
|
@@ -587,27 +647,32 @@ export const useGetDatasetDigest = <
|
|
|
587
647
|
* @summary Gets the property schema for a specific Dataset
|
|
588
648
|
*/
|
|
589
649
|
export const getSchema = (
|
|
590
|
-
|
|
591
|
-
|
|
650
|
+
datasetId: string,
|
|
651
|
+
datasetVersion: number,
|
|
592
652
|
options?: SecondParameter<typeof customInstance>
|
|
593
653
|
) => {
|
|
594
654
|
return customInstance<DatasetSchemaGetResponse>(
|
|
595
|
-
{ url: `/dataset/${
|
|
655
|
+
{ url: `/dataset/${datasetId}/schema/${datasetVersion}`, method: "get" },
|
|
596
656
|
options
|
|
597
657
|
);
|
|
598
658
|
};
|
|
599
659
|
|
|
600
660
|
export const getGetSchemaQueryKey = (
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
) => [`/dataset/${
|
|
661
|
+
datasetId: string,
|
|
662
|
+
datasetVersion: number
|
|
663
|
+
) => [`/dataset/${datasetId}/schema/${datasetVersion}`];
|
|
664
|
+
|
|
665
|
+
export type GetSchemaQueryResult = NonNullable<
|
|
666
|
+
AsyncReturnType<typeof getSchema>
|
|
667
|
+
>;
|
|
668
|
+
export type GetSchemaQueryError = ErrorType<void | DmError>;
|
|
604
669
|
|
|
605
670
|
export const useGetSchema = <
|
|
606
671
|
TData = AsyncReturnType<typeof getSchema>,
|
|
607
672
|
TError = ErrorType<void | DmError>
|
|
608
673
|
>(
|
|
609
|
-
|
|
610
|
-
|
|
674
|
+
datasetId: string,
|
|
675
|
+
datasetVersion: number,
|
|
611
676
|
options?: {
|
|
612
677
|
query?: UseQueryOptions<AsyncReturnType<typeof getSchema>, TError, TData>;
|
|
613
678
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -616,15 +681,15 @@ export const useGetSchema = <
|
|
|
616
681
|
const { query: queryOptions, request: requestOptions } = options || {};
|
|
617
682
|
|
|
618
683
|
const queryKey =
|
|
619
|
-
queryOptions?.queryKey ?? getGetSchemaQueryKey(
|
|
684
|
+
queryOptions?.queryKey ?? getGetSchemaQueryKey(datasetId, datasetVersion);
|
|
620
685
|
|
|
621
686
|
const queryFn: QueryFunction<AsyncReturnType<typeof getSchema>> = () =>
|
|
622
|
-
getSchema(
|
|
687
|
+
getSchema(datasetId, datasetVersion, requestOptions);
|
|
623
688
|
|
|
624
689
|
const query = useQuery<AsyncReturnType<typeof getSchema>, TError, TData>(
|
|
625
690
|
queryKey,
|
|
626
691
|
queryFn,
|
|
627
|
-
{ enabled: !!(
|
|
692
|
+
{ enabled: !!(datasetId && datasetVersion), ...queryOptions }
|
|
628
693
|
);
|
|
629
694
|
|
|
630
695
|
return {
|
package/src/file/file.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
2
|
+
* Generated by orval v6.7.1 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Dataset Manager API
|
|
5
5
|
* The Dataset Manager API service.
|
|
@@ -63,6 +63,9 @@ export const getGetFilesQueryKey = (params?: GetFilesParams) => [
|
|
|
63
63
|
...(params ? [params] : []),
|
|
64
64
|
];
|
|
65
65
|
|
|
66
|
+
export type GetFilesQueryResult = NonNullable<AsyncReturnType<typeof getFiles>>;
|
|
67
|
+
export type GetFilesQueryError = ErrorType<void | DmError>;
|
|
68
|
+
|
|
66
69
|
export const useGetFiles = <
|
|
67
70
|
TData = AsyncReturnType<typeof getFiles>,
|
|
68
71
|
TError = ErrorType<void | DmError>
|
|
@@ -128,11 +131,22 @@ export const attachFile = (
|
|
|
128
131
|
}
|
|
129
132
|
|
|
130
133
|
return customInstance<FilePostResponse>(
|
|
131
|
-
{
|
|
134
|
+
{
|
|
135
|
+
url: `/file`,
|
|
136
|
+
method: "post",
|
|
137
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
138
|
+
data: formData,
|
|
139
|
+
},
|
|
132
140
|
options
|
|
133
141
|
);
|
|
134
142
|
};
|
|
135
143
|
|
|
144
|
+
export type AttachFileMutationResult = NonNullable<
|
|
145
|
+
AsyncReturnType<typeof attachFile>
|
|
146
|
+
>;
|
|
147
|
+
export type AttachFileMutationBody = FilePostBodyBody;
|
|
148
|
+
export type AttachFileMutationError = ErrorType<void | DmError>;
|
|
149
|
+
|
|
136
150
|
export const useAttachFile = <
|
|
137
151
|
TError = ErrorType<void | DmError>,
|
|
138
152
|
TContext = unknown
|
|
@@ -180,6 +194,12 @@ export const deleteUnmanagedFile = (
|
|
|
180
194
|
);
|
|
181
195
|
};
|
|
182
196
|
|
|
197
|
+
export type DeleteUnmanagedFileMutationResult = NonNullable<
|
|
198
|
+
AsyncReturnType<typeof deleteUnmanagedFile>
|
|
199
|
+
>;
|
|
200
|
+
|
|
201
|
+
export type DeleteUnmanagedFileMutationError = ErrorType<DmError>;
|
|
202
|
+
|
|
183
203
|
export const useDeleteUnmanagedFile = <
|
|
184
204
|
TError = ErrorType<DmError>,
|
|
185
205
|
TContext = unknown
|
|
@@ -220,15 +240,21 @@ You cannot delete a Project File until the attach is complete.
|
|
|
220
240
|
* @summary Delete/detach a File (from a project)
|
|
221
241
|
*/
|
|
222
242
|
export const deleteFile = (
|
|
223
|
-
|
|
243
|
+
fileId: string,
|
|
224
244
|
options?: SecondParameter<typeof customInstance>
|
|
225
245
|
) => {
|
|
226
246
|
return customInstance<void>(
|
|
227
|
-
{ url: `/file/${
|
|
247
|
+
{ url: `/file/${fileId}`, method: "delete" },
|
|
228
248
|
options
|
|
229
249
|
);
|
|
230
250
|
};
|
|
231
251
|
|
|
252
|
+
export type DeleteFileMutationResult = NonNullable<
|
|
253
|
+
AsyncReturnType<typeof deleteFile>
|
|
254
|
+
>;
|
|
255
|
+
|
|
256
|
+
export type DeleteFileMutationError = ErrorType<DmError>;
|
|
257
|
+
|
|
232
258
|
export const useDeleteFile = <
|
|
233
259
|
TError = ErrorType<DmError>,
|
|
234
260
|
TContext = unknown
|
|
@@ -236,7 +262,7 @@ export const useDeleteFile = <
|
|
|
236
262
|
mutation?: UseMutationOptions<
|
|
237
263
|
AsyncReturnType<typeof deleteFile>,
|
|
238
264
|
TError,
|
|
239
|
-
{
|
|
265
|
+
{ fileId: string },
|
|
240
266
|
TContext
|
|
241
267
|
>;
|
|
242
268
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -245,17 +271,17 @@ export const useDeleteFile = <
|
|
|
245
271
|
|
|
246
272
|
const mutationFn: MutationFunction<
|
|
247
273
|
AsyncReturnType<typeof deleteFile>,
|
|
248
|
-
{
|
|
274
|
+
{ fileId: string }
|
|
249
275
|
> = (props) => {
|
|
250
|
-
const {
|
|
276
|
+
const { fileId } = props || {};
|
|
251
277
|
|
|
252
|
-
return deleteFile(
|
|
278
|
+
return deleteFile(fileId, requestOptions);
|
|
253
279
|
};
|
|
254
280
|
|
|
255
281
|
return useMutation<
|
|
256
282
|
AsyncReturnType<typeof deleteFile>,
|
|
257
283
|
TError,
|
|
258
|
-
{
|
|
284
|
+
{ fileId: string },
|
|
259
285
|
TContext
|
|
260
286
|
>(mutationFn, mutationOptions);
|
|
261
287
|
};
|
|
@@ -267,22 +293,27 @@ You cannot get a Project File until the attach is complete.
|
|
|
267
293
|
* @summary Download a File (from a project)
|
|
268
294
|
*/
|
|
269
295
|
export const downloadFile = (
|
|
270
|
-
|
|
296
|
+
fileId: string,
|
|
271
297
|
options?: SecondParameter<typeof customInstance>
|
|
272
298
|
) => {
|
|
273
299
|
return customInstance<void>(
|
|
274
|
-
{ url: `/file/${
|
|
300
|
+
{ url: `/file/${fileId}`, method: "get" },
|
|
275
301
|
options
|
|
276
302
|
);
|
|
277
303
|
};
|
|
278
304
|
|
|
279
|
-
export const getDownloadFileQueryKey = (
|
|
305
|
+
export const getDownloadFileQueryKey = (fileId: string) => [`/file/${fileId}`];
|
|
306
|
+
|
|
307
|
+
export type DownloadFileQueryResult = NonNullable<
|
|
308
|
+
AsyncReturnType<typeof downloadFile>
|
|
309
|
+
>;
|
|
310
|
+
export type DownloadFileQueryError = ErrorType<DmError>;
|
|
280
311
|
|
|
281
312
|
export const useDownloadFile = <
|
|
282
313
|
TData = AsyncReturnType<typeof downloadFile>,
|
|
283
314
|
TError = ErrorType<DmError>
|
|
284
315
|
>(
|
|
285
|
-
|
|
316
|
+
fileId: string,
|
|
286
317
|
options?: {
|
|
287
318
|
query?: UseQueryOptions<
|
|
288
319
|
AsyncReturnType<typeof downloadFile>,
|
|
@@ -294,15 +325,15 @@ export const useDownloadFile = <
|
|
|
294
325
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
295
326
|
const { query: queryOptions, request: requestOptions } = options || {};
|
|
296
327
|
|
|
297
|
-
const queryKey = queryOptions?.queryKey ?? getDownloadFileQueryKey(
|
|
328
|
+
const queryKey = queryOptions?.queryKey ?? getDownloadFileQueryKey(fileId);
|
|
298
329
|
|
|
299
330
|
const queryFn: QueryFunction<AsyncReturnType<typeof downloadFile>> = () =>
|
|
300
|
-
downloadFile(
|
|
331
|
+
downloadFile(fileId, requestOptions);
|
|
301
332
|
|
|
302
333
|
const query = useQuery<AsyncReturnType<typeof downloadFile>, TError, TData>(
|
|
303
334
|
queryKey,
|
|
304
335
|
queryFn,
|
|
305
|
-
{ enabled: !!
|
|
336
|
+
{ enabled: !!fileId, ...queryOptions }
|
|
306
337
|
);
|
|
307
338
|
|
|
308
339
|
return {
|