@squonk/data-manager-client 1.2.9 → 2.0.0-alpha.2
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.map +1 -1
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.js.map +1 -1
- package/application/application.cjs.map +1 -1
- package/application/application.js.map +1 -1
- package/configuration/configuration.cjs.map +1 -1
- package/configuration/configuration.js.map +1 -1
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file-and-path/file-and-path.cjs.map +1 -1
- package/file-and-path/file-and-path.d.cts +5 -5
- package/file-and-path/file-and-path.d.ts +5 -5
- package/file-and-path/file-and-path.js.map +1 -1
- package/index.cjs.map +1 -1
- package/index.d.cts +118 -37
- package/index.d.ts +118 -37
- package/index.js.map +1 -1
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.js.map +1 -1
- package/inventory/inventory.cjs +56 -0
- package/inventory/inventory.cjs.map +1 -0
- package/inventory/inventory.d.cts +50 -0
- package/inventory/inventory.d.ts +50 -0
- package/inventory/inventory.js +56 -0
- package/inventory/inventory.js.map +1 -0
- package/inventory/package.json +7 -0
- package/job/job.cjs.map +1 -1
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.js.map +1 -1
- package/package.json +1 -1
- package/project/project.cjs +49 -1
- package/project/project.cjs.map +1 -1
- package/project/project.d.cts +78 -10
- package/project/project.d.ts +78 -10
- package/project/project.js +48 -0
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +1 -1
- package/src/admin/admin.ts +1 -1
- package/src/application/application.ts +1 -1
- package/src/configuration/configuration.ts +1 -1
- package/src/data-manager-api.schemas.ts +133 -41
- package/src/dataset/dataset.ts +1 -1
- package/src/exchange-rate/exchange-rate.ts +1 -1
- package/src/file-and-path/file-and-path.ts +6 -6
- package/src/instance/instance.ts +1 -1
- package/src/inventory/inventory.ts +140 -0
- package/src/job/job.ts +1 -1
- package/src/metadata/metadata.ts +1 -1
- package/src/project/project.ts +122 -10
- package/src/task/task.ts +1 -1
- package/src/type/type.ts +1 -1
- package/src/user/user.ts +1 -1
- package/task/task.cjs.map +1 -1
- package/task/task.js.map +1 -1
- package/type/type.cjs.map +1 -1
- package/type/type.js.map +1 -1
- package/user/user.cjs.map +1 -1
- package/user/user.js.map +1 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version:
|
|
9
|
+
* OpenAPI spec version: 2.0
|
|
10
10
|
*/
|
|
11
11
|
import {
|
|
12
12
|
useMutation,
|
|
@@ -43,7 +43,7 @@ type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
|
|
|
43
43
|
/**
|
|
44
44
|
* Creates a new Path within a Project. Every directory in the Path will be created. The path will belong to the User and Project.
|
|
45
45
|
|
|
46
|
-
Only Project
|
|
46
|
+
Only Project editors can create Paths.
|
|
47
47
|
|
|
48
48
|
* @summary Create a new Project Path
|
|
49
49
|
*/
|
|
@@ -98,7 +98,7 @@ export const useCreatePath = <TError = ErrorType<DmError>,
|
|
|
98
98
|
/**
|
|
99
99
|
* Deletes a Path within the Project. Be aware that the deletion of a Path will result in te contents of the Path also being deleted. If There are files in Path or sub-directories, they will all be deleted.
|
|
100
100
|
|
|
101
|
-
Only Project
|
|
101
|
+
Only Project editors can delete Paths.
|
|
102
102
|
|
|
103
103
|
* @summary Delete a Project Path
|
|
104
104
|
*/
|
|
@@ -261,7 +261,7 @@ Only Datasets attached to projects are available through the Project API. A Data
|
|
|
261
261
|
|
|
262
262
|
An `editor` of a **dataset** is not automatically and `editor` of the **project** it's attached to.
|
|
263
263
|
|
|
264
|
-
You must be an `editor`
|
|
264
|
+
You must be an `editor` of the Project to attach a Dataset to a project. Being an `editor` of the Dataset you are attaching does not give you the ability to detach it from the Project.
|
|
265
265
|
|
|
266
266
|
You cannot add a Dataset to a Project until its upload is complete.
|
|
267
267
|
|
|
@@ -333,7 +333,7 @@ export const useAttachFile = <TError = ErrorType<void | DmError>,
|
|
|
333
333
|
/**
|
|
334
334
|
* Removes an unmanaged file from a Project. You cannot use this endpoint to delete managed project files.
|
|
335
335
|
|
|
336
|
-
You must be an `editor`
|
|
336
|
+
You must be an `editor` of the Project to delete a file from a Project.
|
|
337
337
|
|
|
338
338
|
* @summary Delete an unmanaged Project File
|
|
339
339
|
*/
|
|
@@ -388,7 +388,7 @@ export const useDeleteUnmanagedFile = <TError = ErrorType<DmError>,
|
|
|
388
388
|
/**
|
|
389
389
|
* Given a `file_id` the file will be removed from the Project it's attached to.
|
|
390
390
|
|
|
391
|
-
You must be an `editor`
|
|
391
|
+
You must be an `editor` of the project to delete a file from a Project. Being an `editor` of the original Dataset does not give you the ability to detach it from the Project.
|
|
392
392
|
|
|
393
393
|
You cannot delete a Project File until the attach is complete.
|
|
394
394
|
|
package/src/instance/instance.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** and **Jobs** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version:
|
|
9
|
+
* OpenAPI spec version: 2.0
|
|
10
10
|
*/
|
|
11
11
|
import {
|
|
12
12
|
useMutation,
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v6.25.0 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Dataset Manager API
|
|
5
|
+
* The Dataset Manager API service.
|
|
6
|
+
|
|
7
|
+
A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.
|
|
8
|
+
|
|
9
|
+
* OpenAPI spec version: 2.0
|
|
10
|
+
*/
|
|
11
|
+
import {
|
|
12
|
+
useQuery,
|
|
13
|
+
useSuspenseQuery
|
|
14
|
+
} from '@tanstack/react-query'
|
|
15
|
+
import type {
|
|
16
|
+
QueryFunction,
|
|
17
|
+
QueryKey,
|
|
18
|
+
UseQueryOptions,
|
|
19
|
+
UseQueryResult,
|
|
20
|
+
UseSuspenseQueryOptions,
|
|
21
|
+
UseSuspenseQueryResult
|
|
22
|
+
} from '@tanstack/react-query'
|
|
23
|
+
import type {
|
|
24
|
+
DmError,
|
|
25
|
+
GetUserInventoryParams,
|
|
26
|
+
InventoryUserGetResponse
|
|
27
|
+
} from '../data-manager-api.schemas'
|
|
28
|
+
import { customInstance } from '.././custom-instance';
|
|
29
|
+
import type { ErrorType } from '.././custom-instance';
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Returns an inventory of users, which includes Projects membership and Datasets they own. An Account Server **Unit** or **Organisation** must be provided (but not both).
|
|
37
|
+
|
|
38
|
+
The caller must also be a member of the provided Unit or Organisation, i.e. you can only query User inventory if you are a member of the corresponding Account Server Unit or Organisation.
|
|
39
|
+
|
|
40
|
+
* @summary Get User Inventory
|
|
41
|
+
*/
|
|
42
|
+
export const getUserInventory = (
|
|
43
|
+
params?: GetUserInventoryParams,
|
|
44
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
45
|
+
) => {
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
return customInstance<InventoryUserGetResponse>(
|
|
49
|
+
{url: `/inventory/user`, method: 'GET',
|
|
50
|
+
params, signal
|
|
51
|
+
},
|
|
52
|
+
options);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
export const getGetUserInventoryQueryKey = (params?: GetUserInventoryParams,) => {
|
|
57
|
+
return ["data-manager-api", `/inventory/user`, ...(params ? [params]: [])] as const;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
export const getGetUserInventoryQueryOptions = <TData = Awaited<ReturnType<typeof getUserInventory>>, TError = ErrorType<void | DmError>>(params?: GetUserInventoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserInventory>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
62
|
+
) => {
|
|
63
|
+
|
|
64
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
65
|
+
|
|
66
|
+
const queryKey = queryOptions?.queryKey ?? getGetUserInventoryQueryKey(params);
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserInventory>>> = ({ signal }) => getUserInventory(params, requestOptions, signal);
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUserInventory>>, TError, TData> & { queryKey: QueryKey }
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type GetUserInventoryQueryResult = NonNullable<Awaited<ReturnType<typeof getUserInventory>>>
|
|
80
|
+
export type GetUserInventoryQueryError = ErrorType<void | DmError>
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @summary Get User Inventory
|
|
84
|
+
*/
|
|
85
|
+
export const useGetUserInventory = <TData = Awaited<ReturnType<typeof getUserInventory>>, TError = ErrorType<void | DmError>>(
|
|
86
|
+
params?: GetUserInventoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserInventory>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
87
|
+
|
|
88
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
89
|
+
|
|
90
|
+
const queryOptions = getGetUserInventoryQueryOptions(params,options)
|
|
91
|
+
|
|
92
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
93
|
+
|
|
94
|
+
query.queryKey = queryOptions.queryKey ;
|
|
95
|
+
|
|
96
|
+
return query;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
export const getGetUserInventorySuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getUserInventory>>, TError = ErrorType<void | DmError>>(params?: GetUserInventoryParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserInventory>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
102
|
+
) => {
|
|
103
|
+
|
|
104
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
105
|
+
|
|
106
|
+
const queryKey = queryOptions?.queryKey ?? getGetUserInventoryQueryKey(params);
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserInventory>>> = ({ signal }) => getUserInventory(params, requestOptions, signal);
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserInventory>>, TError, TData> & { queryKey: QueryKey }
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export type GetUserInventorySuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUserInventory>>>
|
|
120
|
+
export type GetUserInventorySuspenseQueryError = ErrorType<void | DmError>
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @summary Get User Inventory
|
|
124
|
+
*/
|
|
125
|
+
export const useGetUserInventorySuspense = <TData = Awaited<ReturnType<typeof getUserInventory>>, TError = ErrorType<void | DmError>>(
|
|
126
|
+
params?: GetUserInventoryParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserInventory>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
127
|
+
|
|
128
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
129
|
+
|
|
130
|
+
const queryOptions = getGetUserInventorySuspenseQueryOptions(params,options)
|
|
131
|
+
|
|
132
|
+
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
133
|
+
|
|
134
|
+
query.queryKey = queryOptions.queryKey ;
|
|
135
|
+
|
|
136
|
+
return query;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
package/src/job/job.ts
CHANGED
package/src/metadata/metadata.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** and **Jobs** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version:
|
|
9
|
+
* OpenAPI spec version: 2.0
|
|
10
10
|
*/
|
|
11
11
|
import {
|
|
12
12
|
useMutation,
|
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** and **Jobs** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version:
|
|
9
|
+
* OpenAPI spec version: 2.0
|
|
10
10
|
*/
|
|
11
11
|
import {
|
|
12
12
|
useMutation,
|
|
@@ -150,9 +150,9 @@ export const useGetProjectsSuspense = <TData = Awaited<ReturnType<typeof getProj
|
|
|
150
150
|
|
|
151
151
|
To create a Project when an **Account Server** is configured you will need a **Product**.
|
|
152
152
|
|
|
153
|
-
As the Project
|
|
153
|
+
As the Project creator you are also automatically an `administrator` of the Project and can add other users so that they can also see or manipulate data in the Project.
|
|
154
154
|
|
|
155
|
-
The name you give the Project is free-form text (can contain spaces etc.) but the name you use must be unique amongst all the Projects
|
|
155
|
+
The name you give the Project is free-form text (can contain spaces etc.) but the name you use must be unique amongst all the Projects within the same Organisational Unit.
|
|
156
156
|
|
|
157
157
|
* @summary Create a new Project
|
|
158
158
|
*/
|
|
@@ -379,7 +379,7 @@ export const usePatchProject = <TError = ErrorType<DmError>,
|
|
|
379
379
|
/**
|
|
380
380
|
* Deletes an existing Project.
|
|
381
381
|
|
|
382
|
-
You must be an `
|
|
382
|
+
You must be an `administrator` of the project.
|
|
383
383
|
|
|
384
384
|
Once deleted all **Files**, working directories and material in the Project will also be removed
|
|
385
385
|
|
|
@@ -433,11 +433,123 @@ export const useDeleteProject = <TError = ErrorType<void | DmError>,
|
|
|
433
433
|
return useMutation(mutationOptions);
|
|
434
434
|
}
|
|
435
435
|
/**
|
|
436
|
+
* Adds a user to a Project as an `administrator`. As well as the ability to edit the project administrators can add and remove other users.
|
|
437
|
+
|
|
438
|
+
You must be an `administrator` of the project
|
|
439
|
+
|
|
440
|
+
* @summary Add a Project Administrator
|
|
441
|
+
*/
|
|
442
|
+
export const addAdministratorToProject = (
|
|
443
|
+
projectId: string,
|
|
444
|
+
userId: string,
|
|
445
|
+
options?: SecondParameter<typeof customInstance>,) => {
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
return customInstance<void>(
|
|
449
|
+
{url: `/project/${projectId}/administrator/${userId}`, method: 'PUT'
|
|
450
|
+
},
|
|
451
|
+
options);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
export const getAddAdministratorToProjectMutationOptions = <TError = ErrorType<DmError>,
|
|
457
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addAdministratorToProject>>, TError,{projectId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
458
|
+
): UseMutationOptions<Awaited<ReturnType<typeof addAdministratorToProject>>, TError,{projectId: string;userId: string}, TContext> => {
|
|
459
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof addAdministratorToProject>>, {projectId: string;userId: string}> = (props) => {
|
|
465
|
+
const {projectId,userId} = props ?? {};
|
|
466
|
+
|
|
467
|
+
return addAdministratorToProject(projectId,userId,requestOptions)
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
return { mutationFn, ...mutationOptions }}
|
|
474
|
+
|
|
475
|
+
export type AddAdministratorToProjectMutationResult = NonNullable<Awaited<ReturnType<typeof addAdministratorToProject>>>
|
|
476
|
+
|
|
477
|
+
export type AddAdministratorToProjectMutationError = ErrorType<DmError>
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* @summary Add a Project Administrator
|
|
481
|
+
*/
|
|
482
|
+
export const useAddAdministratorToProject = <TError = ErrorType<DmError>,
|
|
483
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addAdministratorToProject>>, TError,{projectId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
484
|
+
) => {
|
|
485
|
+
|
|
486
|
+
const mutationOptions = getAddAdministratorToProjectMutationOptions(options);
|
|
487
|
+
|
|
488
|
+
return useMutation(mutationOptions);
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Deletes a project `administrator`. The administrator can be you.
|
|
492
|
+
|
|
493
|
+
A project must always have one `administrator` so you will not be able to delete the last administrator of a project.
|
|
494
|
+
|
|
495
|
+
You must be an `administrator` of the project
|
|
496
|
+
|
|
497
|
+
* @summary Delete a Project Administrator
|
|
498
|
+
*/
|
|
499
|
+
export const removeAdministratorFromProject = (
|
|
500
|
+
projectId: string,
|
|
501
|
+
userId: string,
|
|
502
|
+
options?: SecondParameter<typeof customInstance>,) => {
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
return customInstance<void>(
|
|
506
|
+
{url: `/project/${projectId}/administrator/${userId}`, method: 'DELETE'
|
|
507
|
+
},
|
|
508
|
+
options);
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
export const getRemoveAdministratorFromProjectMutationOptions = <TError = ErrorType<DmError>,
|
|
514
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof removeAdministratorFromProject>>, TError,{projectId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
515
|
+
): UseMutationOptions<Awaited<ReturnType<typeof removeAdministratorFromProject>>, TError,{projectId: string;userId: string}, TContext> => {
|
|
516
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof removeAdministratorFromProject>>, {projectId: string;userId: string}> = (props) => {
|
|
522
|
+
const {projectId,userId} = props ?? {};
|
|
523
|
+
|
|
524
|
+
return removeAdministratorFromProject(projectId,userId,requestOptions)
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
return { mutationFn, ...mutationOptions }}
|
|
531
|
+
|
|
532
|
+
export type RemoveAdministratorFromProjectMutationResult = NonNullable<Awaited<ReturnType<typeof removeAdministratorFromProject>>>
|
|
533
|
+
|
|
534
|
+
export type RemoveAdministratorFromProjectMutationError = ErrorType<DmError>
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* @summary Delete a Project Administrator
|
|
538
|
+
*/
|
|
539
|
+
export const useRemoveAdministratorFromProject = <TError = ErrorType<DmError>,
|
|
540
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof removeAdministratorFromProject>>, TError,{projectId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
541
|
+
) => {
|
|
542
|
+
|
|
543
|
+
const mutationOptions = getRemoveAdministratorFromProjectMutationOptions(options);
|
|
544
|
+
|
|
545
|
+
return useMutation(mutationOptions);
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
436
548
|
* Adds a user to a Project as an `editor`. Editors can add and remove datasets in a project and delete the project.
|
|
437
549
|
|
|
438
550
|
An `editor` of a project is not automatically an `editor` of any datasets the project contains.
|
|
439
551
|
|
|
440
|
-
You must be an `
|
|
552
|
+
You must be an `administrator` of the project
|
|
441
553
|
|
|
442
554
|
* @summary Add a Project Editor
|
|
443
555
|
*/
|
|
@@ -494,7 +606,7 @@ export const useAddEditorToProject = <TError = ErrorType<DmError>,
|
|
|
494
606
|
|
|
495
607
|
A project must always have one `editor` so you will not be able to delete the last editor of a project.
|
|
496
608
|
|
|
497
|
-
You must be an `
|
|
609
|
+
You must be an `administrator` of the project
|
|
498
610
|
|
|
499
611
|
* @summary Delete a Project Editor
|
|
500
612
|
*/
|
|
@@ -549,7 +661,7 @@ export const useRemoveEditorFromProject = <TError = ErrorType<DmError>,
|
|
|
549
661
|
/**
|
|
550
662
|
* Adds a user to a project as an `observer`. Observers can view Projects and download files but they cannot modify Project data or run **Applications** or **Jobs**.
|
|
551
663
|
|
|
552
|
-
You must be an `
|
|
664
|
+
You must be an `administrator` of the Project to add Observers
|
|
553
665
|
|
|
554
666
|
* @summary Add a Project Observer
|
|
555
667
|
*/
|
|
@@ -604,7 +716,7 @@ export const useAddObserverToProject = <TError = ErrorType<DmError>,
|
|
|
604
716
|
/**
|
|
605
717
|
* Deletes a project `observer`.
|
|
606
718
|
|
|
607
|
-
You must be an `
|
|
719
|
+
You must be an `administrator` of the Project to remove Observers
|
|
608
720
|
|
|
609
721
|
* @summary Delete a Project Observer
|
|
610
722
|
*/
|
|
@@ -661,7 +773,7 @@ export const useRemoveObserverFromProject = <TError = ErrorType<DmError>,
|
|
|
661
773
|
|
|
662
774
|
For **managed** files you should consider using the `/file/{file_id}` endpoint.
|
|
663
775
|
|
|
664
|
-
You must be an `editor`
|
|
776
|
+
You must be an `editor` of the Project if the Project is `private`
|
|
665
777
|
|
|
666
778
|
* @summary Download a Project file
|
|
667
779
|
*/
|
|
@@ -773,7 +885,7 @@ export const useGetProjectFileSuspense = <TData = Awaited<ReturnType<typeof getP
|
|
|
773
885
|
/**
|
|
774
886
|
* The user provides an external file for upload to the Project using an optional Path. The path is created if it does not exist.
|
|
775
887
|
|
|
776
|
-
You must be an `editor`
|
|
888
|
+
You must be an `editor` of the project
|
|
777
889
|
|
|
778
890
|
* @summary Upload a file into a Project
|
|
779
891
|
*/
|
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** and **Jobs** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version:
|
|
9
|
+
* OpenAPI spec version: 2.0
|
|
10
10
|
*/
|
|
11
11
|
import {
|
|
12
12
|
useMutation,
|
package/src/type/type.ts
CHANGED
package/src/user/user.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** and **Jobs** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version:
|
|
9
|
+
* OpenAPI spec version: 2.0
|
|
10
10
|
*/
|
|
11
11
|
import {
|
|
12
12
|
useMutation,
|
package/task/task.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/task/task.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA8BA,IAAM,WAAW,CACpB,QACH,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAS,QAAQ;AAAA,MACrB;AAAA,MAAQ;AAAA,IACZ;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,sBAAsB,CAAC,WAA6B;AAC7D,SAAO,CAAC,oBAAoB,SAAS,GAAI,SAAS,CAAC,MAAM,IAAG,CAAC,CAAE;AA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,CAAC;AAE3B,WAAQ,WAAW,QAAO,cAAc;AAAA,EAC1C;AAKL,SAAQ,EAAE,YAAY,GAAG,gBAAgB;AAAC;AAStC,IAAM,gBAAgB,CACL,YACnB;AAEC,QAAM,kBAAkB,6BAA6B,OAAO;AAE5D,SAAO,YAAY,eAAe;AACpC","sourcesContent":["/**\n * Generated by orval v6.25.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.2\n */\nimport {\n useMutation,\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n DmError,\n GetTaskParams,\n GetTasksParams,\n TaskGetResponse,\n TasksGetResponse\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Returns a list of Tasks that you have access to.\n\n * @summary Returns a list of Tasks\n */\nexport const getTasks = (\n params?: GetTasksParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TasksGetResponse>(\n {url: `/task`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTasksQueryKey = (params?: GetTasksParams,) => {\n return [\"data-manager-api\", `/task`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetTasksQueryOptions = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) => getTasks(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTasksQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>\nexport type GetTasksQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns a list of Tasks\n */\nexport const useGetTasks = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(\n params?: GetTasksParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTasksQueryOptions(params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetTasksSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) => getTasks(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTasksSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>\nexport type GetTasksSuspenseQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns a list of Tasks\n */\nexport const useGetTasksSuspense = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(\n params?: GetTasksParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTasksSuspenseQueryOptions(params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Returns Task information including its states and events.\n\nYou can only retrieve a Task if you have access to it. For example, you can get a Task relating to an Application **Instance** if you created the **Instance**.\n\nTasks are created in response to creating Datasets and launching **Applications** and **Jobs**.\n\nTasks contain of a list of `states` and `events`. A Task will always have `states` but may not have `events`.\n\nStates and events are listed with the oldest occupying the first entry in the list. As the number of events a task accumulates is uncontrolled, by default, only the first 500 events are returned.\n\nYou can control the number of events returned by using the `event_limit` query parameter. You can also retrieve the next set of events by combining it with the `event_prior_ordinal`, setting it to the ordinal of the oldest event you've already received.\n\n**Dataset** tasks must be allowed to complete successfully before you can expect it to be available through the dataset API endpoints. Application **Instances** are not available until their task state is _STARTED_.\n\nFor **Dataset** Tasks, where the task `purpose` is `DATASET`, you must wait until `done` is **true**. The Dataset is available when the Task object's `done` field is **true** and the `exit_code` field is zero (**0**). If you discover the Task is `done` but you have a non-zero `exit_code`, the Dataset upload will have failed, and you may need need to inspect the final `state` and any related `events` to understand why.\n\nFor Application **Instance** Tasks, where the Task `purpose` is `INSTANCE`, you must wait until you find the _STARTED_ state in the `states` list. An Application Instance is only `done` when the Application Instance has been deleted.\n\n * @summary Returns Task information\n */\nexport const getTask = (\n taskId: string,\n params?: GetTaskParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TaskGetResponse>(\n {url: `/task/${taskId}`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTaskQueryKey = (taskId: string,\n params?: GetTaskParams,) => {\n return [\"data-manager-api\", `/task/${taskId}`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetTaskQueryOptions = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) => getTask(taskId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTaskQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>\nexport type GetTaskQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns Task information\n */\nexport const useGetTask = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(\n taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTaskQueryOptions(taskId,params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetTaskSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) => getTask(taskId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTaskSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>\nexport type GetTaskSuspenseQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns Task information\n */\nexport const useGetTaskSuspense = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(\n taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTaskSuspenseQueryOptions(taskId,params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Given a `task_id` the Task will be removed.\n\nYou cannot delete a Task until it is `done`.\n\nYou must be an `owner` of the Task to delete it. For example you must be the `owner` of the Dataset to delete **DATASET** Tasks and an `owner` of the ProjectFile to delete **FILE** Tasks.\n\n * @summary Delete a Task entry\n */\nexport const deleteTask = (\n taskId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/task/${taskId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteTaskMutationOptions = <TError = ErrorType<DmError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteTask>>, {taskId: string}> = (props) => {\n const {taskId} = props ?? {};\n\n return deleteTask(taskId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteTaskMutationResult = NonNullable<Awaited<ReturnType<typeof deleteTask>>>\n \n export type DeleteTaskMutationError = ErrorType<DmError>\n\n /**\n * @summary Delete a Task entry\n */\nexport const useDeleteTask = <TError = ErrorType<DmError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteTaskMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n "]}
|
|
1
|
+
{"version":3,"sources":["../../src/task/task.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA8BA,IAAM,WAAW,CACpB,QACH,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAS,QAAQ;AAAA,MACrB;AAAA,MAAQ;AAAA,IACZ;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,sBAAsB,CAAC,WAA6B;AAC7D,SAAO,CAAC,oBAAoB,SAAS,GAAI,SAAS,CAAC,MAAM,IAAG,CAAC,CAAE;AAC/D;AAGG,IAAM,0BAA0B,CAAmF,QAAyB,YAC9I;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,oBAAoB,MAAM;AAIpE,QAAM,UAA+D,CAAC,EAAE,OAAO,MAAM,SAAS,QAAQ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* Generated by orval v6.25.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 2.0\n */\nimport {\n useMutation,\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n DmError,\n GetTaskParams,\n GetTasksParams,\n TaskGetResponse,\n TasksGetResponse\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Returns a list of Tasks that you have access to.\n\n * @summary Returns a list of Tasks\n */\nexport const getTasks = (\n params?: GetTasksParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TasksGetResponse>(\n {url: `/task`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTasksQueryKey = (params?: GetTasksParams,) => {\n return [\"data-manager-api\", `/task`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetTasksQueryOptions = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) => getTasks(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTasksQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>\nexport type GetTasksQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns a list of Tasks\n */\nexport const useGetTasks = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(\n params?: GetTasksParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTasksQueryOptions(params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetTasksSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) => getTasks(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTasksSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>\nexport type GetTasksSuspenseQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns a list of Tasks\n */\nexport const useGetTasksSuspense = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(\n params?: GetTasksParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTasksSuspenseQueryOptions(params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Returns Task information including its states and events.\n\nYou can only retrieve a Task if you have access to it. For example, you can get a Task relating to an Application **Instance** if you created the **Instance**.\n\nTasks are created in response to creating Datasets and launching **Applications** and **Jobs**.\n\nTasks contain of a list of `states` and `events`. A Task will always have `states` but may not have `events`.\n\nStates and events are listed with the oldest occupying the first entry in the list. As the number of events a task accumulates is uncontrolled, by default, only the first 500 events are returned.\n\nYou can control the number of events returned by using the `event_limit` query parameter. You can also retrieve the next set of events by combining it with the `event_prior_ordinal`, setting it to the ordinal of the oldest event you've already received.\n\n**Dataset** tasks must be allowed to complete successfully before you can expect it to be available through the dataset API endpoints. Application **Instances** are not available until their task state is _STARTED_.\n\nFor **Dataset** Tasks, where the task `purpose` is `DATASET`, you must wait until `done` is **true**. The Dataset is available when the Task object's `done` field is **true** and the `exit_code` field is zero (**0**). If you discover the Task is `done` but you have a non-zero `exit_code`, the Dataset upload will have failed, and you may need need to inspect the final `state` and any related `events` to understand why.\n\nFor Application **Instance** Tasks, where the Task `purpose` is `INSTANCE`, you must wait until you find the _STARTED_ state in the `states` list. An Application Instance is only `done` when the Application Instance has been deleted.\n\n * @summary Returns Task information\n */\nexport const getTask = (\n taskId: string,\n params?: GetTaskParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TaskGetResponse>(\n {url: `/task/${taskId}`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTaskQueryKey = (taskId: string,\n params?: GetTaskParams,) => {\n return [\"data-manager-api\", `/task/${taskId}`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetTaskQueryOptions = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) => getTask(taskId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTaskQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>\nexport type GetTaskQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns Task information\n */\nexport const useGetTask = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(\n taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTaskQueryOptions(taskId,params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetTaskSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) => getTask(taskId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTaskSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>\nexport type GetTaskSuspenseQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns Task information\n */\nexport const useGetTaskSuspense = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(\n taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTaskSuspenseQueryOptions(taskId,params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Given a `task_id` the Task will be removed.\n\nYou cannot delete a Task until it is `done`.\n\nYou must be an `owner` of the Task to delete it. For example you must be the `owner` of the Dataset to delete **DATASET** Tasks and an `owner` of the ProjectFile to delete **FILE** Tasks.\n\n * @summary Delete a Task entry\n */\nexport const deleteTask = (\n taskId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/task/${taskId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteTaskMutationOptions = <TError = ErrorType<DmError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteTask>>, {taskId: string}> = (props) => {\n const {taskId} = props ?? {};\n\n return deleteTask(taskId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteTaskMutationResult = NonNullable<Awaited<ReturnType<typeof deleteTask>>>\n \n export type DeleteTaskMutationError = ErrorType<DmError>\n\n /**\n * @summary Delete a Task entry\n */\nexport const useDeleteTask = <TError = ErrorType<DmError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteTaskMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n "]}
|
package/task/task.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/task/task.ts"],"sourcesContent":["/**\n * Generated by orval v6.25.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.2\n */\nimport {\n useMutation,\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n DmError,\n GetTaskParams,\n GetTasksParams,\n TaskGetResponse,\n TasksGetResponse\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Returns a list of Tasks that you have access to.\n\n * @summary Returns a list of Tasks\n */\nexport const getTasks = (\n params?: GetTasksParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TasksGetResponse>(\n {url: `/task`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTasksQueryKey = (params?: GetTasksParams,) => {\n return [\"data-manager-api\", `/task`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetTasksQueryOptions = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) => getTasks(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTasksQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>\nexport type GetTasksQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns a list of Tasks\n */\nexport const useGetTasks = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(\n params?: GetTasksParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTasksQueryOptions(params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetTasksSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) => getTasks(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTasksSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>\nexport type GetTasksSuspenseQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns a list of Tasks\n */\nexport const useGetTasksSuspense = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(\n params?: GetTasksParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTasksSuspenseQueryOptions(params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Returns Task information including its states and events.\n\nYou can only retrieve a Task if you have access to it. For example, you can get a Task relating to an Application **Instance** if you created the **Instance**.\n\nTasks are created in response to creating Datasets and launching **Applications** and **Jobs**.\n\nTasks contain of a list of `states` and `events`. A Task will always have `states` but may not have `events`.\n\nStates and events are listed with the oldest occupying the first entry in the list. As the number of events a task accumulates is uncontrolled, by default, only the first 500 events are returned.\n\nYou can control the number of events returned by using the `event_limit` query parameter. You can also retrieve the next set of events by combining it with the `event_prior_ordinal`, setting it to the ordinal of the oldest event you've already received.\n\n**Dataset** tasks must be allowed to complete successfully before you can expect it to be available through the dataset API endpoints. Application **Instances** are not available until their task state is _STARTED_.\n\nFor **Dataset** Tasks, where the task `purpose` is `DATASET`, you must wait until `done` is **true**. The Dataset is available when the Task object's `done` field is **true** and the `exit_code` field is zero (**0**). If you discover the Task is `done` but you have a non-zero `exit_code`, the Dataset upload will have failed, and you may need need to inspect the final `state` and any related `events` to understand why.\n\nFor Application **Instance** Tasks, where the Task `purpose` is `INSTANCE`, you must wait until you find the _STARTED_ state in the `states` list. An Application Instance is only `done` when the Application Instance has been deleted.\n\n * @summary Returns Task information\n */\nexport const getTask = (\n taskId: string,\n params?: GetTaskParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TaskGetResponse>(\n {url: `/task/${taskId}`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTaskQueryKey = (taskId: string,\n params?: GetTaskParams,) => {\n return [\"data-manager-api\", `/task/${taskId}`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetTaskQueryOptions = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) => getTask(taskId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTaskQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>\nexport type GetTaskQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns Task information\n */\nexport const useGetTask = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(\n taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTaskQueryOptions(taskId,params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetTaskSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) => getTask(taskId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTaskSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>\nexport type GetTaskSuspenseQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns Task information\n */\nexport const useGetTaskSuspense = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(\n taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTaskSuspenseQueryOptions(taskId,params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Given a `task_id` the Task will be removed.\n\nYou cannot delete a Task until it is `done`.\n\nYou must be an `owner` of the Task to delete it. For example you must be the `owner` of the Dataset to delete **DATASET** Tasks and an `owner` of the ProjectFile to delete **FILE** Tasks.\n\n * @summary Delete a Task entry\n */\nexport const deleteTask = (\n taskId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/task/${taskId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteTaskMutationOptions = <TError = ErrorType<DmError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteTask>>, {taskId: string}> = (props) => {\n const {taskId} = props ?? {};\n\n return deleteTask(taskId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteTaskMutationResult = NonNullable<Awaited<ReturnType<typeof deleteTask>>>\n \n export type DeleteTaskMutationError = ErrorType<DmError>\n\n /**\n * @summary Delete a Task entry\n */\nexport const useDeleteTask = <TError = ErrorType<DmError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteTaskMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n "],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA8BA,IAAM,WAAW,CACpB,QACH,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAS,QAAQ;AAAA,MACrB;AAAA,MAAQ;AAAA,IACZ;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,sBAAsB,CAAC,WAA6B;AAC7D,SAAO,CAAC,oBAAoB,S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F,CAAC,UAAU;AACtG,UAAM,EAAC,OAAM,IAAI,SAAS,CAAC;AAE3B,WAAQ,WAAW,QAAO,cAAc;AAAA,EAC1C;AAKL,SAAQ,EAAE,YAAY,GAAG,gBAAgB;AAAC;AAStC,IAAM,gBAAgB,CACL,YACnB;AAEC,QAAM,kBAAkB,6BAA6B,OAAO;AAE5D,SAAO,YAAY,eAAe;AACpC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/task/task.ts"],"sourcesContent":["/**\n * Generated by orval v6.25.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 2.0\n */\nimport {\n useMutation,\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n DmError,\n GetTaskParams,\n GetTasksParams,\n TaskGetResponse,\n TasksGetResponse\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Returns a list of Tasks that you have access to.\n\n * @summary Returns a list of Tasks\n */\nexport const getTasks = (\n params?: GetTasksParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TasksGetResponse>(\n {url: `/task`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTasksQueryKey = (params?: GetTasksParams,) => {\n return [\"data-manager-api\", `/task`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetTasksQueryOptions = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) => getTasks(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTasksQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>\nexport type GetTasksQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns a list of Tasks\n */\nexport const useGetTasks = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(\n params?: GetTasksParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTasksQueryOptions(params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetTasksSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(params?: GetTasksParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) => getTasks(params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTasksSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>\nexport type GetTasksSuspenseQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns a list of Tasks\n */\nexport const useGetTasksSuspense = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(\n params?: GetTasksParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTasksSuspenseQueryOptions(params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Returns Task information including its states and events.\n\nYou can only retrieve a Task if you have access to it. For example, you can get a Task relating to an Application **Instance** if you created the **Instance**.\n\nTasks are created in response to creating Datasets and launching **Applications** and **Jobs**.\n\nTasks contain of a list of `states` and `events`. A Task will always have `states` but may not have `events`.\n\nStates and events are listed with the oldest occupying the first entry in the list. As the number of events a task accumulates is uncontrolled, by default, only the first 500 events are returned.\n\nYou can control the number of events returned by using the `event_limit` query parameter. You can also retrieve the next set of events by combining it with the `event_prior_ordinal`, setting it to the ordinal of the oldest event you've already received.\n\n**Dataset** tasks must be allowed to complete successfully before you can expect it to be available through the dataset API endpoints. Application **Instances** are not available until their task state is _STARTED_.\n\nFor **Dataset** Tasks, where the task `purpose` is `DATASET`, you must wait until `done` is **true**. The Dataset is available when the Task object's `done` field is **true** and the `exit_code` field is zero (**0**). If you discover the Task is `done` but you have a non-zero `exit_code`, the Dataset upload will have failed, and you may need need to inspect the final `state` and any related `events` to understand why.\n\nFor Application **Instance** Tasks, where the Task `purpose` is `INSTANCE`, you must wait until you find the _STARTED_ state in the `states` list. An Application Instance is only `done` when the Application Instance has been deleted.\n\n * @summary Returns Task information\n */\nexport const getTask = (\n taskId: string,\n params?: GetTaskParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TaskGetResponse>(\n {url: `/task/${taskId}`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTaskQueryKey = (taskId: string,\n params?: GetTaskParams,) => {\n return [\"data-manager-api\", `/task/${taskId}`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetTaskQueryOptions = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) => getTask(taskId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTaskQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>\nexport type GetTaskQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns Task information\n */\nexport const useGetTask = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(\n taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTaskQueryOptions(taskId,params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetTaskSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) => getTask(taskId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetTaskSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>\nexport type GetTaskSuspenseQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Returns Task information\n */\nexport const useGetTaskSuspense = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(\n taskId: string,\n params?: GetTaskParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetTaskSuspenseQueryOptions(taskId,params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Given a `task_id` the Task will be removed.\n\nYou cannot delete a Task until it is `done`.\n\nYou must be an `owner` of the Task to delete it. For example you must be the `owner` of the Dataset to delete **DATASET** Tasks and an `owner` of the ProjectFile to delete **FILE** Tasks.\n\n * @summary Delete a Task entry\n */\nexport const deleteTask = (\n taskId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/task/${taskId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteTaskMutationOptions = <TError = ErrorType<DmError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteTask>>, {taskId: string}> = (props) => {\n const {taskId} = props ?? {};\n\n return deleteTask(taskId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteTaskMutationResult = NonNullable<Awaited<ReturnType<typeof deleteTask>>>\n \n export type DeleteTaskMutationError = ErrorType<DmError>\n\n /**\n * @summary Delete a Task entry\n */\nexport const useDeleteTask = <TError = ErrorType<DmError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteTaskMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n "],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA8BA,IAAM,WAAW,CACpB,QACH,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAS,QAAQ;AAAA,MACrB;AAAA,MAAQ;AAAA,IACZ;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,sBAAsB,CAAC,WAA6B;AAC7D,SAAO,CAAC,oBAAoB,SAAS,GAAI,SAAS,CAAC,MAAM,IAAG,CAAC,CAAE;AAC/D;AAGG,IAAM,0BAA0B,CAAmF,QAAyB,YAC9I;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,oBAAoB,MAAM;AAIpE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AAO;AAE5D,SAAO,YAAY,eAAe;AACpC;","names":[]}
|
package/type/type.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/type/type.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAyBA,IAAM,eAAe,CAE3B,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAS,QAAQ;AAAA,MAAO;AAAA,IAChC;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,0BAA0B,MAAM;AACzC,SAAO,CAAC,oBAAoB,OAAO;AACnC;AAGG,IAAM,8BAA8B,CAAwF,YAC9H;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,wBAAwB;AAIlE,QAAM,UAAmE,CAAC,EAAE,OAAO,MAAM,aAAa,gBAAgB,MAAM;AAM7H,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAQO,IAAM,kBAAkB,CAC7B,YAE8D;AAE9D,QAAM,eAAe,4BAA4B,OAAO;AAExD,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAIO,IAAM,sCAAsC,CAAwF,YACtI;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,wBAAwB;AAIlE,QAAM,UAAmE,CAAC,EAAE,OAAO,MAAM,aAAa,gBAAgB,MAAM;AAM7H,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAQO,IAAM,0BAA0B,CACrC,YAEsE;AAEtE,QAAM,eAAe,oCAAoC,OAAO;AAEhE,QAAM,QAAQ,iBAAiB,YAAY;AAE3C,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.25.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version:
|
|
1
|
+
{"version":3,"sources":["../../src/type/type.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAyBA,IAAM,eAAe,CAE3B,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAS,QAAQ;AAAA,MAAO;AAAA,IAChC;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,0BAA0B,MAAM;AACzC,SAAO,CAAC,oBAAoB,OAAO;AACnC;AAGG,IAAM,8BAA8B,CAAwF,YAC9H;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,wBAAwB;AAIlE,QAAM,UAAmE,CAAC,EAAE,OAAO,MAAM,aAAa,gBAAgB,MAAM;AAM7H,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAQO,IAAM,kBAAkB,CAC7B,YAE8D;AAE9D,QAAM,eAAe,4BAA4B,OAAO;AAExD,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAIO,IAAM,sCAAsC,CAAwF,YACtI;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,wBAAwB;AAIlE,QAAM,UAAmE,CAAC,EAAE,OAAO,MAAM,aAAa,gBAAgB,MAAM;AAM7H,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAQO,IAAM,0BAA0B,CACrC,YAEsE;AAEtE,QAAM,eAAe,oCAAoC,OAAO;AAEhE,QAAM,QAAQ,iBAAiB,YAAY;AAE3C,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.25.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 2.0\n */\nimport {\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n QueryFunction,\n QueryKey,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n DmError,\n TypesGetResponse\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Returns the supported Dataset and File (MIME) Types\n\n * @summary Get the supported File Types\n */\nexport const getFileTypes = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<TypesGetResponse>(\n {url: `/type`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetFileTypesQueryKey = () => {\n return [\"data-manager-api\", `/type`] as const;\n }\n\n \nexport const getGetFileTypesQueryOptions = <TData = Awaited<ReturnType<typeof getFileTypes>>, TError = ErrorType<void | DmError>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getFileTypes>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetFileTypesQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getFileTypes>>> = ({ signal }) => getFileTypes(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getFileTypes>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetFileTypesQueryResult = NonNullable<Awaited<ReturnType<typeof getFileTypes>>>\nexport type GetFileTypesQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Get the supported File Types\n */\nexport const useGetFileTypes = <TData = Awaited<ReturnType<typeof getFileTypes>>, TError = ErrorType<void | DmError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getFileTypes>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetFileTypesQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetFileTypesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getFileTypes>>, TError = ErrorType<void | DmError>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getFileTypes>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetFileTypesQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getFileTypes>>> = ({ signal }) => getFileTypes(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getFileTypes>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetFileTypesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getFileTypes>>>\nexport type GetFileTypesSuspenseQueryError = ErrorType<void | DmError>\n\n/**\n * @summary Get the supported File Types\n */\nexport const useGetFileTypesSuspense = <TData = Awaited<ReturnType<typeof getFileTypes>>, TError = ErrorType<void | DmError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getFileTypes>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetFileTypesSuspenseQueryOptions(options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n"]}
|