@squonk/data-manager-client 4.3.0 → 5.0.0-5-0.2173777171
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 +55 -10
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.cts +58 -1
- package/accounting/accounting.d.ts +58 -1
- package/accounting/accounting.js +46 -1
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +15 -15
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.cts +2 -0
- package/admin/admin.d.ts +2 -0
- package/admin/admin.js +1 -1
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +5 -5
- package/application/application.cjs.map +1 -1
- package/application/application.js +1 -1
- package/application/application.js.map +1 -1
- package/{chunk-OYRETEBZ.js → chunk-76ADQBHZ.js} +3 -3
- package/chunk-76ADQBHZ.js.map +1 -0
- package/{chunk-ZLY5XEOQ.cjs → chunk-KHB5TJT7.cjs} +3 -3
- package/chunk-KHB5TJT7.cjs.map +1 -0
- package/chunk-RB2KVIEK.cjs.map +1 -1
- package/configuration/configuration.cjs +5 -5
- package/configuration/configuration.cjs.map +1 -1
- package/configuration/configuration.d.cts +1 -1
- package/configuration/configuration.d.ts +1 -1
- package/configuration/configuration.js +1 -1
- package/configuration/configuration.js.map +1 -1
- package/dataset/dataset.cjs +14 -14
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.js +1 -1
- package/dataset/dataset.js.map +1 -1
- package/digest/digest.cjs +3 -3
- package/digest/digest.cjs.map +1 -1
- package/digest/digest.js +1 -1
- package/digest/digest.js.map +1 -1
- package/file-and-path/file-and-path.cjs +139 -17
- package/file-and-path/file-and-path.cjs.map +1 -1
- package/file-and-path/file-and-path.d.cts +162 -2
- package/file-and-path/file-and-path.d.ts +162 -2
- package/file-and-path/file-and-path.js +123 -1
- package/file-and-path/file-and-path.js.map +1 -1
- package/index.cjs +4 -2
- package/index.cjs.map +1 -1
- package/index.d.cts +53 -37
- package/index.d.ts +53 -37
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs +10 -10
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.js +1 -1
- package/instance/instance.js.map +1 -1
- package/inventory/inventory.cjs +3 -3
- package/inventory/inventory.cjs.map +1 -1
- package/inventory/inventory.js +1 -1
- package/inventory/inventory.js.map +1 -1
- package/job/job.cjs +124 -8
- package/job/job.cjs.map +1 -1
- package/job/job.d.cts +159 -3
- package/job/job.d.ts +159 -3
- package/job/job.js +119 -3
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +7 -7
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.js +1 -1
- package/metadata/metadata.js.map +1 -1
- package/package.json +1 -1
- package/project/project.cjs +15 -137
- package/project/project.cjs.map +1 -1
- package/project/project.d.cts +3 -163
- package/project/project.d.ts +3 -163
- package/project/project.js +1 -123
- package/project/project.js.map +1 -1
- package/src/{data-manager-api.schemas.ts → API_TARGET_NAME.schemas.ts} +52 -43
- package/src/accounting/accounting.ts +244 -2
- package/src/admin/admin.ts +4 -2
- package/src/application/application.ts +2 -2
- package/src/configuration/configuration.ts +5 -9
- package/src/dataset/dataset.ts +2 -2
- package/src/digest/digest.ts +2 -2
- package/src/file-and-path/file-and-path.ts +602 -2
- package/src/index.ts +2 -2
- package/src/instance/instance.ts +2 -2
- package/src/inventory/inventory.ts +2 -2
- package/src/job/job.ts +599 -3
- package/src/metadata/metadata.ts +2 -2
- package/src/options-mutator.ts +2 -2
- package/src/project/project.ts +5 -604
- package/src/task/task.ts +2 -2
- package/src/type/type.ts +2 -2
- package/src/user/user.ts +2 -2
- package/src/workflow/workflow.ts +5 -3
- package/task/task.cjs +6 -6
- package/task/task.cjs.map +1 -1
- package/task/task.js +1 -1
- package/task/task.js.map +1 -1
- package/type/type.cjs +3 -3
- package/type/type.cjs.map +1 -1
- package/type/type.js +1 -1
- package/type/type.js.map +1 -1
- package/user/user.cjs +10 -10
- package/user/user.cjs.map +1 -1
- package/user/user.js +1 -1
- package/user/user.js.map +1 -1
- package/workflow/workflow.cjs +20 -20
- package/workflow/workflow.cjs.map +1 -1
- package/workflow/workflow.d.cts +3 -1
- package/workflow/workflow.d.ts +3 -1
- package/workflow/workflow.js +1 -1
- package/workflow/workflow.js.map +1 -1
- package/chunk-OYRETEBZ.js.map +0 -1
- package/chunk-ZLY5XEOQ.cjs.map +0 -1
- package/exchange-rate/exchange-rate.cjs +0 -255
- package/exchange-rate/exchange-rate.cjs.map +0 -1
- package/exchange-rate/exchange-rate.d.cts +0 -319
- package/exchange-rate/exchange-rate.d.ts +0 -319
- package/exchange-rate/exchange-rate.js +0 -255
- package/exchange-rate/exchange-rate.js.map +0 -1
- package/exchange-rate/package.json +0 -7
- package/src/exchange-rate/exchange-rate.ts +0 -1276
package/src/project/project.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications**, **Jobs**, and **Workflows** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version:
|
|
9
|
+
* OpenAPI spec version: 5.0
|
|
10
10
|
*/
|
|
11
11
|
import { useMutation, useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
|
@@ -28,17 +28,14 @@ import type {
|
|
|
28
28
|
|
|
29
29
|
import type {
|
|
30
30
|
DmError,
|
|
31
|
-
GetProjectFileParams,
|
|
32
|
-
GetProjectFileWithTokenParams,
|
|
33
31
|
GetProjectsParams,
|
|
34
32
|
ProjectDetail,
|
|
35
|
-
ProjectFilePutBodyBody,
|
|
36
33
|
ProjectPatchBodyBody,
|
|
37
34
|
ProjectPostBodyBody,
|
|
38
35
|
ProjectPostResponse,
|
|
39
36
|
ProjectsGetResponse,
|
|
40
37
|
TaskIdentity,
|
|
41
|
-
} from "../
|
|
38
|
+
} from "../API_TARGET_NAME.schemas";
|
|
42
39
|
|
|
43
40
|
import { customInstance } from ".././custom-instance";
|
|
44
41
|
import type { ErrorType } from ".././custom-instance";
|
|
@@ -370,7 +367,7 @@ export const useCreateProject = <TError = ErrorType<DmError | void>, TContext =
|
|
|
370
367
|
/**
|
|
371
368
|
* Gets the details of a Project that is available to you.
|
|
372
369
|
|
|
373
|
-
* @summary Get a Project
|
|
370
|
+
* @summary Get a Project (by UUID)
|
|
374
371
|
*/
|
|
375
372
|
export const getProject = (
|
|
376
373
|
projectId: string,
|
|
@@ -464,7 +461,7 @@ export function useGetProject<
|
|
|
464
461
|
queryClient?: QueryClient,
|
|
465
462
|
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
466
463
|
/**
|
|
467
|
-
* @summary Get a Project
|
|
464
|
+
* @summary Get a Project (by UUID)
|
|
468
465
|
*/
|
|
469
466
|
|
|
470
467
|
export function useGetProject<
|
|
@@ -552,7 +549,7 @@ export function useGetProjectSuspense<
|
|
|
552
549
|
queryClient?: QueryClient,
|
|
553
550
|
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
554
551
|
/**
|
|
555
|
-
* @summary Get a Project
|
|
552
|
+
* @summary Get a Project (by UUID)
|
|
556
553
|
*/
|
|
557
554
|
|
|
558
555
|
export function useGetProjectSuspense<
|
|
@@ -1286,599 +1283,3 @@ export const useRemoveObserverFromProject = <
|
|
|
1286
1283
|
|
|
1287
1284
|
return useMutation(mutationOptions, queryClient);
|
|
1288
1285
|
};
|
|
1289
|
-
/**
|
|
1290
|
-
* Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).
|
|
1291
|
-
|
|
1292
|
-
For **managed** files you should consider using the `/file/{file_id}` endpoint.
|
|
1293
|
-
|
|
1294
|
-
You must be an `editor` of the Project if the Project is `private`
|
|
1295
|
-
|
|
1296
|
-
* @summary Download a Project file
|
|
1297
|
-
*/
|
|
1298
|
-
export const getProjectFile = (
|
|
1299
|
-
projectId: string,
|
|
1300
|
-
params: GetProjectFileParams,
|
|
1301
|
-
options?: SecondParameter<typeof customInstance>,
|
|
1302
|
-
signal?: AbortSignal,
|
|
1303
|
-
) => {
|
|
1304
|
-
return customInstance<void>(
|
|
1305
|
-
{ url: `/project/${projectId}/file`, method: "GET", params, signal },
|
|
1306
|
-
options,
|
|
1307
|
-
);
|
|
1308
|
-
};
|
|
1309
|
-
|
|
1310
|
-
export const getGetProjectFileQueryKey = (projectId: string, params: GetProjectFileParams) => {
|
|
1311
|
-
return [`/project/${projectId}/file`, ...(params ? [params] : [])] as const;
|
|
1312
|
-
};
|
|
1313
|
-
|
|
1314
|
-
export const useGetProjectFileQueryOptions = <
|
|
1315
|
-
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1316
|
-
TError = ErrorType<void | DmError>,
|
|
1317
|
-
>(
|
|
1318
|
-
projectId: string,
|
|
1319
|
-
params: GetProjectFileParams,
|
|
1320
|
-
options?: {
|
|
1321
|
-
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>>;
|
|
1322
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1323
|
-
},
|
|
1324
|
-
) => {
|
|
1325
|
-
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
1326
|
-
|
|
1327
|
-
const queryKey = queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectId, params);
|
|
1328
|
-
|
|
1329
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFile>>> = ({ signal }) =>
|
|
1330
|
-
getProjectFile(projectId, params, requestOptions, signal);
|
|
1331
|
-
|
|
1332
|
-
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
1333
|
-
|
|
1334
|
-
return customOptions as UseQueryOptions<
|
|
1335
|
-
Awaited<ReturnType<typeof getProjectFile>>,
|
|
1336
|
-
TError,
|
|
1337
|
-
TData
|
|
1338
|
-
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1339
|
-
};
|
|
1340
|
-
|
|
1341
|
-
export type GetProjectFileQueryResult = NonNullable<Awaited<ReturnType<typeof getProjectFile>>>;
|
|
1342
|
-
export type GetProjectFileQueryError = ErrorType<void | DmError>;
|
|
1343
|
-
|
|
1344
|
-
export function useGetProjectFile<
|
|
1345
|
-
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1346
|
-
TError = ErrorType<void | DmError>,
|
|
1347
|
-
>(
|
|
1348
|
-
projectId: string,
|
|
1349
|
-
params: GetProjectFileParams,
|
|
1350
|
-
options: {
|
|
1351
|
-
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>> &
|
|
1352
|
-
Pick<
|
|
1353
|
-
DefinedInitialDataOptions<
|
|
1354
|
-
Awaited<ReturnType<typeof getProjectFile>>,
|
|
1355
|
-
TError,
|
|
1356
|
-
Awaited<ReturnType<typeof getProjectFile>>
|
|
1357
|
-
>,
|
|
1358
|
-
"initialData"
|
|
1359
|
-
>;
|
|
1360
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1361
|
-
},
|
|
1362
|
-
queryClient?: QueryClient,
|
|
1363
|
-
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1364
|
-
export function useGetProjectFile<
|
|
1365
|
-
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1366
|
-
TError = ErrorType<void | DmError>,
|
|
1367
|
-
>(
|
|
1368
|
-
projectId: string,
|
|
1369
|
-
params: GetProjectFileParams,
|
|
1370
|
-
options?: {
|
|
1371
|
-
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>> &
|
|
1372
|
-
Pick<
|
|
1373
|
-
UndefinedInitialDataOptions<
|
|
1374
|
-
Awaited<ReturnType<typeof getProjectFile>>,
|
|
1375
|
-
TError,
|
|
1376
|
-
Awaited<ReturnType<typeof getProjectFile>>
|
|
1377
|
-
>,
|
|
1378
|
-
"initialData"
|
|
1379
|
-
>;
|
|
1380
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1381
|
-
},
|
|
1382
|
-
queryClient?: QueryClient,
|
|
1383
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1384
|
-
export function useGetProjectFile<
|
|
1385
|
-
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1386
|
-
TError = ErrorType<void | DmError>,
|
|
1387
|
-
>(
|
|
1388
|
-
projectId: string,
|
|
1389
|
-
params: GetProjectFileParams,
|
|
1390
|
-
options?: {
|
|
1391
|
-
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>>;
|
|
1392
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1393
|
-
},
|
|
1394
|
-
queryClient?: QueryClient,
|
|
1395
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1396
|
-
/**
|
|
1397
|
-
* @summary Download a Project file
|
|
1398
|
-
*/
|
|
1399
|
-
|
|
1400
|
-
export function useGetProjectFile<
|
|
1401
|
-
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1402
|
-
TError = ErrorType<void | DmError>,
|
|
1403
|
-
>(
|
|
1404
|
-
projectId: string,
|
|
1405
|
-
params: GetProjectFileParams,
|
|
1406
|
-
options?: {
|
|
1407
|
-
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>>;
|
|
1408
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1409
|
-
},
|
|
1410
|
-
queryClient?: QueryClient,
|
|
1411
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
1412
|
-
const queryOptions = useGetProjectFileQueryOptions(projectId, params, options);
|
|
1413
|
-
|
|
1414
|
-
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
1415
|
-
queryKey: DataTag<QueryKey, TData, TError>;
|
|
1416
|
-
};
|
|
1417
|
-
|
|
1418
|
-
query.queryKey = queryOptions.queryKey;
|
|
1419
|
-
|
|
1420
|
-
return query;
|
|
1421
|
-
}
|
|
1422
|
-
|
|
1423
|
-
export const useGetProjectFileSuspenseQueryOptions = <
|
|
1424
|
-
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1425
|
-
TError = ErrorType<void | DmError>,
|
|
1426
|
-
>(
|
|
1427
|
-
projectId: string,
|
|
1428
|
-
params: GetProjectFileParams,
|
|
1429
|
-
options?: {
|
|
1430
|
-
query?: Partial<
|
|
1431
|
-
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>
|
|
1432
|
-
>;
|
|
1433
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1434
|
-
},
|
|
1435
|
-
) => {
|
|
1436
|
-
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
1437
|
-
|
|
1438
|
-
const queryKey = queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectId, params);
|
|
1439
|
-
|
|
1440
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFile>>> = ({ signal }) =>
|
|
1441
|
-
getProjectFile(projectId, params, requestOptions, signal);
|
|
1442
|
-
|
|
1443
|
-
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
1444
|
-
|
|
1445
|
-
return customOptions as UseSuspenseQueryOptions<
|
|
1446
|
-
Awaited<ReturnType<typeof getProjectFile>>,
|
|
1447
|
-
TError,
|
|
1448
|
-
TData
|
|
1449
|
-
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1450
|
-
};
|
|
1451
|
-
|
|
1452
|
-
export type GetProjectFileSuspenseQueryResult = NonNullable<
|
|
1453
|
-
Awaited<ReturnType<typeof getProjectFile>>
|
|
1454
|
-
>;
|
|
1455
|
-
export type GetProjectFileSuspenseQueryError = ErrorType<void | DmError>;
|
|
1456
|
-
|
|
1457
|
-
export function useGetProjectFileSuspense<
|
|
1458
|
-
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1459
|
-
TError = ErrorType<void | DmError>,
|
|
1460
|
-
>(
|
|
1461
|
-
projectId: string,
|
|
1462
|
-
params: GetProjectFileParams,
|
|
1463
|
-
options: {
|
|
1464
|
-
query: Partial<
|
|
1465
|
-
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>
|
|
1466
|
-
>;
|
|
1467
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1468
|
-
},
|
|
1469
|
-
queryClient?: QueryClient,
|
|
1470
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1471
|
-
export function useGetProjectFileSuspense<
|
|
1472
|
-
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1473
|
-
TError = ErrorType<void | DmError>,
|
|
1474
|
-
>(
|
|
1475
|
-
projectId: string,
|
|
1476
|
-
params: GetProjectFileParams,
|
|
1477
|
-
options?: {
|
|
1478
|
-
query?: Partial<
|
|
1479
|
-
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>
|
|
1480
|
-
>;
|
|
1481
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1482
|
-
},
|
|
1483
|
-
queryClient?: QueryClient,
|
|
1484
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1485
|
-
export function useGetProjectFileSuspense<
|
|
1486
|
-
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1487
|
-
TError = ErrorType<void | DmError>,
|
|
1488
|
-
>(
|
|
1489
|
-
projectId: string,
|
|
1490
|
-
params: GetProjectFileParams,
|
|
1491
|
-
options?: {
|
|
1492
|
-
query?: Partial<
|
|
1493
|
-
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>
|
|
1494
|
-
>;
|
|
1495
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1496
|
-
},
|
|
1497
|
-
queryClient?: QueryClient,
|
|
1498
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1499
|
-
/**
|
|
1500
|
-
* @summary Download a Project file
|
|
1501
|
-
*/
|
|
1502
|
-
|
|
1503
|
-
export function useGetProjectFileSuspense<
|
|
1504
|
-
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
1505
|
-
TError = ErrorType<void | DmError>,
|
|
1506
|
-
>(
|
|
1507
|
-
projectId: string,
|
|
1508
|
-
params: GetProjectFileParams,
|
|
1509
|
-
options?: {
|
|
1510
|
-
query?: Partial<
|
|
1511
|
-
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>
|
|
1512
|
-
>;
|
|
1513
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1514
|
-
},
|
|
1515
|
-
queryClient?: QueryClient,
|
|
1516
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
1517
|
-
const queryOptions = useGetProjectFileSuspenseQueryOptions(projectId, params, options);
|
|
1518
|
-
|
|
1519
|
-
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
1520
|
-
TData,
|
|
1521
|
-
TError
|
|
1522
|
-
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1523
|
-
|
|
1524
|
-
query.queryKey = queryOptions.queryKey;
|
|
1525
|
-
|
|
1526
|
-
return query;
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
/**
|
|
1530
|
-
* The user provides an external file for upload to the Project using an optional Path. The path is created if it does not exist.
|
|
1531
|
-
|
|
1532
|
-
You must be an `editor` of the project
|
|
1533
|
-
|
|
1534
|
-
* @summary Upload a file into a Project
|
|
1535
|
-
*/
|
|
1536
|
-
export const addFileToProject = (
|
|
1537
|
-
projectId: string,
|
|
1538
|
-
projectFilePutBodyBody: ProjectFilePutBodyBody,
|
|
1539
|
-
options?: SecondParameter<typeof customInstance>,
|
|
1540
|
-
) => {
|
|
1541
|
-
const formData = new FormData();
|
|
1542
|
-
formData.append(`file`, projectFilePutBodyBody.file);
|
|
1543
|
-
if (projectFilePutBodyBody.as_filename !== undefined) {
|
|
1544
|
-
formData.append(`as_filename`, projectFilePutBodyBody.as_filename);
|
|
1545
|
-
}
|
|
1546
|
-
if (projectFilePutBodyBody.path !== undefined) {
|
|
1547
|
-
formData.append(`path`, projectFilePutBodyBody.path);
|
|
1548
|
-
}
|
|
1549
|
-
|
|
1550
|
-
return customInstance<void>(
|
|
1551
|
-
{
|
|
1552
|
-
url: `/project/${projectId}/file`,
|
|
1553
|
-
method: "PUT",
|
|
1554
|
-
headers: { "Content-Type": "multipart/form-data" },
|
|
1555
|
-
data: formData,
|
|
1556
|
-
},
|
|
1557
|
-
options,
|
|
1558
|
-
);
|
|
1559
|
-
};
|
|
1560
|
-
|
|
1561
|
-
export const useAddFileToProjectMutationOptions = <
|
|
1562
|
-
TError = ErrorType<void | DmError>,
|
|
1563
|
-
TContext = unknown,
|
|
1564
|
-
>(options?: {
|
|
1565
|
-
mutation?: UseMutationOptions<
|
|
1566
|
-
Awaited<ReturnType<typeof addFileToProject>>,
|
|
1567
|
-
TError,
|
|
1568
|
-
{ projectId: string; data: ProjectFilePutBodyBody },
|
|
1569
|
-
TContext
|
|
1570
|
-
>;
|
|
1571
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1572
|
-
}): UseMutationOptions<
|
|
1573
|
-
Awaited<ReturnType<typeof addFileToProject>>,
|
|
1574
|
-
TError,
|
|
1575
|
-
{ projectId: string; data: ProjectFilePutBodyBody },
|
|
1576
|
-
TContext
|
|
1577
|
-
> => {
|
|
1578
|
-
const mutationKey = ["addFileToProject"];
|
|
1579
|
-
const { mutation: mutationOptions, request: requestOptions } = options
|
|
1580
|
-
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
1581
|
-
? options
|
|
1582
|
-
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1583
|
-
: { mutation: { mutationKey }, request: undefined };
|
|
1584
|
-
|
|
1585
|
-
const mutationFn: MutationFunction<
|
|
1586
|
-
Awaited<ReturnType<typeof addFileToProject>>,
|
|
1587
|
-
{ projectId: string; data: ProjectFilePutBodyBody }
|
|
1588
|
-
> = (props) => {
|
|
1589
|
-
const { projectId, data } = props ?? {};
|
|
1590
|
-
|
|
1591
|
-
return addFileToProject(projectId, data, requestOptions);
|
|
1592
|
-
};
|
|
1593
|
-
|
|
1594
|
-
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
1595
|
-
|
|
1596
|
-
return customOptions;
|
|
1597
|
-
};
|
|
1598
|
-
|
|
1599
|
-
export type AddFileToProjectMutationResult = NonNullable<
|
|
1600
|
-
Awaited<ReturnType<typeof addFileToProject>>
|
|
1601
|
-
>;
|
|
1602
|
-
export type AddFileToProjectMutationBody = ProjectFilePutBodyBody;
|
|
1603
|
-
export type AddFileToProjectMutationError = ErrorType<void | DmError>;
|
|
1604
|
-
|
|
1605
|
-
/**
|
|
1606
|
-
* @summary Upload a file into a Project
|
|
1607
|
-
*/
|
|
1608
|
-
export const useAddFileToProject = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
1609
|
-
options?: {
|
|
1610
|
-
mutation?: UseMutationOptions<
|
|
1611
|
-
Awaited<ReturnType<typeof addFileToProject>>,
|
|
1612
|
-
TError,
|
|
1613
|
-
{ projectId: string; data: ProjectFilePutBodyBody },
|
|
1614
|
-
TContext
|
|
1615
|
-
>;
|
|
1616
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1617
|
-
},
|
|
1618
|
-
queryClient?: QueryClient,
|
|
1619
|
-
): UseMutationResult<
|
|
1620
|
-
Awaited<ReturnType<typeof addFileToProject>>,
|
|
1621
|
-
TError,
|
|
1622
|
-
{ projectId: string; data: ProjectFilePutBodyBody },
|
|
1623
|
-
TContext
|
|
1624
|
-
> => {
|
|
1625
|
-
const mutationOptions = useAddFileToProjectMutationOptions(options);
|
|
1626
|
-
|
|
1627
|
-
return useMutation(mutationOptions, queryClient);
|
|
1628
|
-
};
|
|
1629
|
-
/**
|
|
1630
|
-
* Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).
|
|
1631
|
-
|
|
1632
|
-
For **managed** files you should consider using the `/file/{file_id}` endpoint.
|
|
1633
|
-
|
|
1634
|
-
As there is no authentication for this endpoint you must provide a valid token. The token must be a token valid for the project, usually generated when an **Instance** has been launched in the Project.
|
|
1635
|
-
|
|
1636
|
-
* @summary Download a Project file using a Token
|
|
1637
|
-
*/
|
|
1638
|
-
export const getProjectFileWithToken = (
|
|
1639
|
-
projectId: string,
|
|
1640
|
-
params: GetProjectFileWithTokenParams,
|
|
1641
|
-
options?: SecondParameter<typeof customInstance>,
|
|
1642
|
-
signal?: AbortSignal,
|
|
1643
|
-
) => {
|
|
1644
|
-
return customInstance<void>(
|
|
1645
|
-
{ url: `/project/${projectId}/file-with-token`, method: "GET", params, signal },
|
|
1646
|
-
options,
|
|
1647
|
-
);
|
|
1648
|
-
};
|
|
1649
|
-
|
|
1650
|
-
export const getGetProjectFileWithTokenQueryKey = (
|
|
1651
|
-
projectId: string,
|
|
1652
|
-
params: GetProjectFileWithTokenParams,
|
|
1653
|
-
) => {
|
|
1654
|
-
return [`/project/${projectId}/file-with-token`, ...(params ? [params] : [])] as const;
|
|
1655
|
-
};
|
|
1656
|
-
|
|
1657
|
-
export const useGetProjectFileWithTokenQueryOptions = <
|
|
1658
|
-
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1659
|
-
TError = ErrorType<DmError>,
|
|
1660
|
-
>(
|
|
1661
|
-
projectId: string,
|
|
1662
|
-
params: GetProjectFileWithTokenParams,
|
|
1663
|
-
options?: {
|
|
1664
|
-
query?: Partial<
|
|
1665
|
-
UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1666
|
-
>;
|
|
1667
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1668
|
-
},
|
|
1669
|
-
) => {
|
|
1670
|
-
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
1671
|
-
|
|
1672
|
-
const queryKey = queryOptions?.queryKey ?? getGetProjectFileWithTokenQueryKey(projectId, params);
|
|
1673
|
-
|
|
1674
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFileWithToken>>> = ({
|
|
1675
|
-
signal,
|
|
1676
|
-
}) => getProjectFileWithToken(projectId, params, requestOptions, signal);
|
|
1677
|
-
|
|
1678
|
-
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
1679
|
-
|
|
1680
|
-
return customOptions as UseQueryOptions<
|
|
1681
|
-
Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1682
|
-
TError,
|
|
1683
|
-
TData
|
|
1684
|
-
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1685
|
-
};
|
|
1686
|
-
|
|
1687
|
-
export type GetProjectFileWithTokenQueryResult = NonNullable<
|
|
1688
|
-
Awaited<ReturnType<typeof getProjectFileWithToken>>
|
|
1689
|
-
>;
|
|
1690
|
-
export type GetProjectFileWithTokenQueryError = ErrorType<DmError>;
|
|
1691
|
-
|
|
1692
|
-
export function useGetProjectFileWithToken<
|
|
1693
|
-
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1694
|
-
TError = ErrorType<DmError>,
|
|
1695
|
-
>(
|
|
1696
|
-
projectId: string,
|
|
1697
|
-
params: GetProjectFileWithTokenParams,
|
|
1698
|
-
options: {
|
|
1699
|
-
query: Partial<
|
|
1700
|
-
UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1701
|
-
> &
|
|
1702
|
-
Pick<
|
|
1703
|
-
DefinedInitialDataOptions<
|
|
1704
|
-
Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1705
|
-
TError,
|
|
1706
|
-
Awaited<ReturnType<typeof getProjectFileWithToken>>
|
|
1707
|
-
>,
|
|
1708
|
-
"initialData"
|
|
1709
|
-
>;
|
|
1710
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1711
|
-
},
|
|
1712
|
-
queryClient?: QueryClient,
|
|
1713
|
-
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1714
|
-
export function useGetProjectFileWithToken<
|
|
1715
|
-
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1716
|
-
TError = ErrorType<DmError>,
|
|
1717
|
-
>(
|
|
1718
|
-
projectId: string,
|
|
1719
|
-
params: GetProjectFileWithTokenParams,
|
|
1720
|
-
options?: {
|
|
1721
|
-
query?: Partial<
|
|
1722
|
-
UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1723
|
-
> &
|
|
1724
|
-
Pick<
|
|
1725
|
-
UndefinedInitialDataOptions<
|
|
1726
|
-
Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1727
|
-
TError,
|
|
1728
|
-
Awaited<ReturnType<typeof getProjectFileWithToken>>
|
|
1729
|
-
>,
|
|
1730
|
-
"initialData"
|
|
1731
|
-
>;
|
|
1732
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1733
|
-
},
|
|
1734
|
-
queryClient?: QueryClient,
|
|
1735
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1736
|
-
export function useGetProjectFileWithToken<
|
|
1737
|
-
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1738
|
-
TError = ErrorType<DmError>,
|
|
1739
|
-
>(
|
|
1740
|
-
projectId: string,
|
|
1741
|
-
params: GetProjectFileWithTokenParams,
|
|
1742
|
-
options?: {
|
|
1743
|
-
query?: Partial<
|
|
1744
|
-
UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1745
|
-
>;
|
|
1746
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1747
|
-
},
|
|
1748
|
-
queryClient?: QueryClient,
|
|
1749
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1750
|
-
/**
|
|
1751
|
-
* @summary Download a Project file using a Token
|
|
1752
|
-
*/
|
|
1753
|
-
|
|
1754
|
-
export function useGetProjectFileWithToken<
|
|
1755
|
-
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1756
|
-
TError = ErrorType<DmError>,
|
|
1757
|
-
>(
|
|
1758
|
-
projectId: string,
|
|
1759
|
-
params: GetProjectFileWithTokenParams,
|
|
1760
|
-
options?: {
|
|
1761
|
-
query?: Partial<
|
|
1762
|
-
UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1763
|
-
>;
|
|
1764
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1765
|
-
},
|
|
1766
|
-
queryClient?: QueryClient,
|
|
1767
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
1768
|
-
const queryOptions = useGetProjectFileWithTokenQueryOptions(projectId, params, options);
|
|
1769
|
-
|
|
1770
|
-
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
1771
|
-
queryKey: DataTag<QueryKey, TData, TError>;
|
|
1772
|
-
};
|
|
1773
|
-
|
|
1774
|
-
query.queryKey = queryOptions.queryKey;
|
|
1775
|
-
|
|
1776
|
-
return query;
|
|
1777
|
-
}
|
|
1778
|
-
|
|
1779
|
-
export const useGetProjectFileWithTokenSuspenseQueryOptions = <
|
|
1780
|
-
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1781
|
-
TError = ErrorType<DmError>,
|
|
1782
|
-
>(
|
|
1783
|
-
projectId: string,
|
|
1784
|
-
params: GetProjectFileWithTokenParams,
|
|
1785
|
-
options?: {
|
|
1786
|
-
query?: Partial<
|
|
1787
|
-
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1788
|
-
>;
|
|
1789
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1790
|
-
},
|
|
1791
|
-
) => {
|
|
1792
|
-
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
1793
|
-
|
|
1794
|
-
const queryKey = queryOptions?.queryKey ?? getGetProjectFileWithTokenQueryKey(projectId, params);
|
|
1795
|
-
|
|
1796
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFileWithToken>>> = ({
|
|
1797
|
-
signal,
|
|
1798
|
-
}) => getProjectFileWithToken(projectId, params, requestOptions, signal);
|
|
1799
|
-
|
|
1800
|
-
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
1801
|
-
|
|
1802
|
-
return customOptions as UseSuspenseQueryOptions<
|
|
1803
|
-
Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1804
|
-
TError,
|
|
1805
|
-
TData
|
|
1806
|
-
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1807
|
-
};
|
|
1808
|
-
|
|
1809
|
-
export type GetProjectFileWithTokenSuspenseQueryResult = NonNullable<
|
|
1810
|
-
Awaited<ReturnType<typeof getProjectFileWithToken>>
|
|
1811
|
-
>;
|
|
1812
|
-
export type GetProjectFileWithTokenSuspenseQueryError = ErrorType<DmError>;
|
|
1813
|
-
|
|
1814
|
-
export function useGetProjectFileWithTokenSuspense<
|
|
1815
|
-
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1816
|
-
TError = ErrorType<DmError>,
|
|
1817
|
-
>(
|
|
1818
|
-
projectId: string,
|
|
1819
|
-
params: GetProjectFileWithTokenParams,
|
|
1820
|
-
options: {
|
|
1821
|
-
query: Partial<
|
|
1822
|
-
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1823
|
-
>;
|
|
1824
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1825
|
-
},
|
|
1826
|
-
queryClient?: QueryClient,
|
|
1827
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1828
|
-
export function useGetProjectFileWithTokenSuspense<
|
|
1829
|
-
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1830
|
-
TError = ErrorType<DmError>,
|
|
1831
|
-
>(
|
|
1832
|
-
projectId: string,
|
|
1833
|
-
params: GetProjectFileWithTokenParams,
|
|
1834
|
-
options?: {
|
|
1835
|
-
query?: Partial<
|
|
1836
|
-
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1837
|
-
>;
|
|
1838
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1839
|
-
},
|
|
1840
|
-
queryClient?: QueryClient,
|
|
1841
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1842
|
-
export function useGetProjectFileWithTokenSuspense<
|
|
1843
|
-
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1844
|
-
TError = ErrorType<DmError>,
|
|
1845
|
-
>(
|
|
1846
|
-
projectId: string,
|
|
1847
|
-
params: GetProjectFileWithTokenParams,
|
|
1848
|
-
options?: {
|
|
1849
|
-
query?: Partial<
|
|
1850
|
-
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1851
|
-
>;
|
|
1852
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1853
|
-
},
|
|
1854
|
-
queryClient?: QueryClient,
|
|
1855
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1856
|
-
/**
|
|
1857
|
-
* @summary Download a Project file using a Token
|
|
1858
|
-
*/
|
|
1859
|
-
|
|
1860
|
-
export function useGetProjectFileWithTokenSuspense<
|
|
1861
|
-
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
1862
|
-
TError = ErrorType<DmError>,
|
|
1863
|
-
>(
|
|
1864
|
-
projectId: string,
|
|
1865
|
-
params: GetProjectFileWithTokenParams,
|
|
1866
|
-
options?: {
|
|
1867
|
-
query?: Partial<
|
|
1868
|
-
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
1869
|
-
>;
|
|
1870
|
-
request?: SecondParameter<typeof customInstance>;
|
|
1871
|
-
},
|
|
1872
|
-
queryClient?: QueryClient,
|
|
1873
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
1874
|
-
const queryOptions = useGetProjectFileWithTokenSuspenseQueryOptions(projectId, params, options);
|
|
1875
|
-
|
|
1876
|
-
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
1877
|
-
TData,
|
|
1878
|
-
TError
|
|
1879
|
-
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1880
|
-
|
|
1881
|
-
query.queryKey = queryOptions.queryKey;
|
|
1882
|
-
|
|
1883
|
-
return query;
|
|
1884
|
-
}
|
package/src/task/task.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications**, **Jobs**, and **Workflows** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version:
|
|
9
|
+
* OpenAPI spec version: 5.0
|
|
10
10
|
*/
|
|
11
11
|
import { useMutation, useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
|
@@ -32,7 +32,7 @@ import type {
|
|
|
32
32
|
GetTasksParams,
|
|
33
33
|
TaskGetResponse,
|
|
34
34
|
TasksGetResponse,
|
|
35
|
-
} from "../
|
|
35
|
+
} from "../API_TARGET_NAME.schemas";
|
|
36
36
|
|
|
37
37
|
import { customInstance } from ".././custom-instance";
|
|
38
38
|
import type { ErrorType } from ".././custom-instance";
|
package/src/type/type.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications**, **Jobs**, and **Workflows** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version:
|
|
9
|
+
* OpenAPI spec version: 5.0
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
|
@@ -23,7 +23,7 @@ import type {
|
|
|
23
23
|
UseSuspenseQueryResult,
|
|
24
24
|
} from "@tanstack/react-query";
|
|
25
25
|
|
|
26
|
-
import type { DmError, TypesGetResponse } from "../
|
|
26
|
+
import type { DmError, TypesGetResponse } from "../API_TARGET_NAME.schemas";
|
|
27
27
|
|
|
28
28
|
import { customInstance } from ".././custom-instance";
|
|
29
29
|
import type { ErrorType } from ".././custom-instance";
|