@squonk/data-manager-client 1.1.7-rc.2 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.ts +1 -1
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +10 -10
- package/admin/admin.js.map +1 -1
- package/application/application.cjs.map +1 -1
- package/application/application.d.ts +3 -3
- package/application/application.js.map +1 -1
- package/{custom-instance-62ba8806.d.ts → custom-instance-f006607a.d.ts} +6 -6
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +10 -10
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.ts +5 -5
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file/file.cjs.map +1 -1
- package/file/file.d.ts +7 -7
- package/file/file.js.map +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.ts +12 -14
- package/instance/instance.js.map +1 -1
- package/job/job.cjs.map +1 -1
- package/job/job.d.ts +5 -5
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.ts +8 -6
- package/metadata/metadata.js.map +1 -1
- package/package.json +1 -1
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +14 -16
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +1 -1
- package/src/admin/admin.ts +10 -10
- package/src/application/application.ts +3 -3
- package/src/data-manager-api.schemas.ts +6 -6
- package/src/dataset/dataset.ts +10 -10
- package/src/exchange-rate/exchange-rate.ts +5 -5
- package/src/file/file.ts +7 -7
- package/src/instance/instance.ts +12 -14
- package/src/job/job.ts +5 -5
- package/src/metadata/metadata.ts +8 -6
- package/src/project/project.ts +14 -16
- package/src/task/task.ts +9 -9
- package/src/type/type.ts +1 -1
- package/src/user/user.ts +3 -7
- package/task/task.cjs.map +1 -1
- package/task/task.d.ts +9 -9
- package/task/task.js.map +1 -1
- package/type/type.cjs.map +1 -1
- package/type/type.d.ts +1 -1
- package/type/type.js.map +1 -1
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +3 -7
- 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: 1.
|
|
9
|
+
* OpenAPI spec version: 1.1
|
|
10
10
|
*/
|
|
11
11
|
export type AdminGetServiceErrorsParams = {
|
|
12
12
|
/**
|
|
@@ -469,13 +469,13 @@ export type UserAccountPatchBodyBody = {
|
|
|
469
469
|
/** If set the user account becomes private, if provided but false the user account becomes public. Public Users show up in user searches
|
|
470
470
|
*/
|
|
471
471
|
private?: boolean;
|
|
472
|
-
/** For
|
|
472
|
+
/** For `admin` accounts, if set the user account is able to read anything, i.e. `GET` API calls (i.e. endpoints that do not change the Data Manager state) behave as though the caller is acting as *everyone*. An `admin` user would set ths parameter in order to browse the system, and then switch to `impersonate` mode in order to change things as the chosen user
|
|
473
473
|
*/
|
|
474
474
|
become_admin?: boolean;
|
|
475
|
-
/** For
|
|
475
|
+
/** For `admin` accounts, if set API calls behave as though the caller is the user being impersonated. To stop impersonating set this to an empty string. To set impersonation to anything other than an empty string you must also set `become_admin`
|
|
476
476
|
*/
|
|
477
477
|
impersonate?: string;
|
|
478
|
-
/** For
|
|
478
|
+
/** For `admin` accounts, if this is set the account for the user being impersonated is patched, rather then the user's own account. To use this you must have a value for `impersonate`
|
|
479
479
|
*/
|
|
480
480
|
use_impersonation?: boolean;
|
|
481
481
|
};
|
|
@@ -1210,7 +1210,7 @@ The initial phase, indicating that the Instance is preparing to run, is `PENDING
|
|
|
1210
1210
|
/** The data and time (UTC) the instance stopped running
|
|
1211
1211
|
*/
|
|
1212
1212
|
stopped?: string;
|
|
1213
|
-
/** The time the instance has spent running in the cluster. It's a string representation of a Python timedelta object, e.g. `0:12:32` for a run-time of 12 minutes and 32 seconds. The run-time must be considered as an _estimate_ until the instance has stopped and the instance is only considered to be running once `started` has been set.
|
|
1213
|
+
/** The time the instance has spent running in the cluster. It's a string representation of a Python `timedelta`` object, e.g. `0:12:32` for a run-time of 12 minutes and 32 seconds. The run-time must be considered as an _estimate_ until the instance has stopped and the instance is only considered to be running once `started` has been set.
|
|
1214
1214
|
*/
|
|
1215
1215
|
run_time: string;
|
|
1216
1216
|
/** The application instance owner, the person who launched the application and is the only user than can stop it.
|
|
@@ -1222,7 +1222,7 @@ The initial phase, indicating that the Instance is preparing to run, is `PENDING
|
|
|
1222
1222
|
/** The Instance name
|
|
1223
1223
|
*/
|
|
1224
1224
|
name: string;
|
|
1225
|
-
/** For applications (not Jobs) this is the URL the application has exposed. It will
|
|
1225
|
+
/** For applications (not Jobs) this is the URL the application has exposed. It will only be available when the application has started.
|
|
1226
1226
|
*/
|
|
1227
1227
|
url?: string;
|
|
1228
1228
|
/** If the instance relates to a job, this will be the job collection, as defined in the original collection's job definition.
|
package/src/dataset/dataset.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: 1.
|
|
9
|
+
* OpenAPI spec version: 1.1
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery, useMutation } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
|
@@ -43,9 +43,9 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
|
43
43
|
: never;
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* Using an unmanaged file in a Project as a source a Dataset (or new Dataset
|
|
46
|
+
* Using an unmanaged file in a Project as a source a Dataset (or new Dataset Version) is created.
|
|
47
47
|
|
|
48
|
-
The
|
|
48
|
+
The Dataset is assigned a unique identity if it has no **Parent**. If a Parent Dataset is named during the upload the uploaded file inherits the Parent's identity and is issued with a new unique Version number within the Dataset.
|
|
49
49
|
|
|
50
50
|
Behaves like the corresponding **POST** method except the file is expected to exist on a Project path.
|
|
51
51
|
|
|
@@ -146,13 +146,13 @@ export const useCreateDatasetFromFile = <
|
|
|
146
146
|
/**
|
|
147
147
|
* Uploads a dataset.
|
|
148
148
|
|
|
149
|
-
Dataset file-naming is strictly limited to a fixed set of extensions based on the Dataset **Type**. You can obtain the supported types (and their extensions) via the
|
|
149
|
+
Dataset file-naming is strictly limited to a fixed set of extensions based on the Dataset **Type**. You can obtain the supported types (and their extensions) via the `/type` endpoint. Filenames that do not comply with the supported filename extensions will be rejected.
|
|
150
150
|
|
|
151
151
|
Datasets can be uploaded in an uncompressed form, or uploaded pre-compressed using the `.gz` extension.
|
|
152
152
|
|
|
153
|
-
The
|
|
153
|
+
The Dataset is assigned a unique identity if it has no **Parent**. If a Parent dataset is named during the upload the uploaded file inherits the Parent's identity and is issued with a new unique version number within the Dataset.
|
|
154
154
|
|
|
155
|
-
Datasets undergo some processing in an asynchronous
|
|
155
|
+
Datasets undergo some processing in an asynchronous **Task** after control returns to you. The unique identity of the assigned task (the `task id`) is presented to you in this endpoint's response. Before you can use an uploaded dataset, and before the dataset can be added to any pre-assigned projects, you must wait until the task is complete by making regular calls to the `/task/{task-id}` endpoint. A Dataset upload is complete when the corresponding `task.done` is **true** along with a `task.exit_code` of **0**. If the Dataset upload fails `task.done` will be **true** but the `task.exit_code` will be non-zero.
|
|
156
156
|
|
|
157
157
|
* @summary Upload an external file as a Dataset
|
|
158
158
|
*/
|
|
@@ -252,7 +252,7 @@ export const useUploadDataset = <
|
|
|
252
252
|
|
|
253
253
|
You will not see Datasets while their upload is still in progress.
|
|
254
254
|
|
|
255
|
-
Datasets can be filtered by
|
|
255
|
+
Datasets can be filtered by the `owner username`, `mime_type`, a list of `owners`, a list of `editors`, `Labels` or `Label/Value` pairs.
|
|
256
256
|
|
|
257
257
|
Note that if `editors` are combined with `owner username`, then the datasets will be filtered by owner username first followed by editors (so it's an AND). If `editors` are combined with `owners`, then the result will be datasets filtered by a combination of owners OR editors.
|
|
258
258
|
|
|
@@ -330,11 +330,11 @@ export const useGetDatasets = <
|
|
|
330
330
|
};
|
|
331
331
|
|
|
332
332
|
/**
|
|
333
|
-
* Returns a list of Dataset
|
|
333
|
+
* Returns a list of Dataset Versions.
|
|
334
334
|
|
|
335
335
|
You will not see Datasets while their upload is still in progress.
|
|
336
336
|
|
|
337
|
-
* @summary Gets all the
|
|
337
|
+
* @summary Gets all the Versions of a specific Dataset
|
|
338
338
|
*/
|
|
339
339
|
export const getVersions = (
|
|
340
340
|
datasetId: string,
|
|
@@ -661,7 +661,7 @@ export const useRemoveEditorFromDataset = <
|
|
|
661
661
|
return useMutation(mutationOptions);
|
|
662
662
|
};
|
|
663
663
|
/**
|
|
664
|
-
* The user is added to the dataset's editor list. The dataset `owner` is automatically an editor and so does not need to be added as an `editor`.
|
|
664
|
+
* The user is added to the dataset's `editor`` list. The dataset `owner` is automatically an editor and so does not need to be added as an `editor`.
|
|
665
665
|
|
|
666
666
|
You must be an `editor` or `owner` of the dataset.
|
|
667
667
|
|
|
@@ -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: 1.
|
|
9
|
+
* OpenAPI spec version: 1.1
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery, useMutation } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
|
@@ -126,11 +126,11 @@ export const useGetAllApplicationExchangeRates = <
|
|
|
126
126
|
};
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
|
-
* Sets the Exchange Rate for a specific Application. The rate replaces any
|
|
129
|
+
* Sets the Exchange Rate for a specific Application. The rate replaces any existing rate for the Application and applies to all future executions of the Application.
|
|
130
130
|
|
|
131
131
|
If an Application has no specific rate it adopts the current value of the default Application Exchange Rate.
|
|
132
132
|
|
|
133
|
-
You need admin privilege to use this method.
|
|
133
|
+
You need `admin` privilege to use this method.
|
|
134
134
|
|
|
135
135
|
* @summary Sets the Exchange Rate for a specific Application
|
|
136
136
|
*/
|
|
@@ -390,11 +390,11 @@ export const useGetAllJobExchangeRates = <
|
|
|
390
390
|
};
|
|
391
391
|
|
|
392
392
|
/**
|
|
393
|
-
* Sets the Exchange Rate for a specific job. The rate replaces any existing rate for the Job and applies immediately and future job executions for this
|
|
393
|
+
* Sets the Exchange Rate for a specific job. The rate replaces any existing rate for the Job and applies immediately and future job executions for this Job will inherit this rate.
|
|
394
394
|
|
|
395
395
|
If a Job has no specific rate it adopts the current value of the default Job Exchange Rate.
|
|
396
396
|
|
|
397
|
-
You need admin privilege to use this method.
|
|
397
|
+
You need `admin` privilege to use this method.
|
|
398
398
|
|
|
399
399
|
* @summary Sets the Exchange Rate for a specific Job
|
|
400
400
|
*/
|
package/src/file/file.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: 1.
|
|
9
|
+
* OpenAPI spec version: 1.1
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery, useMutation } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
|
@@ -113,13 +113,13 @@ export const useGetFiles = <
|
|
|
113
113
|
};
|
|
114
114
|
|
|
115
115
|
/**
|
|
116
|
-
* Given a Project and a Dataset the Dataset will be attached (added) to the project as a File using the format provided. When attached the Dataset is referred to as a Project **
|
|
116
|
+
* Given a Project and a Dataset the Dataset will be attached (added) to the project as a File using the format provided. When attached the Dataset is referred to as a Project **File**. As format conversion may take some time the file may not be immediately available. You should use the `task_id` you're presented with on the `/task` endpoint to determine when the file is available to the project.
|
|
117
117
|
|
|
118
|
-
Only
|
|
118
|
+
Only Datasets attached to projects are available through the Project API. A Dataset that you upload is only available to others (who are not already `editors` of the data) when the Dataset is attached to a project.
|
|
119
119
|
|
|
120
120
|
An `editor` of a **dataset** is not automatically and `editor` of the **project** it's attached to.
|
|
121
121
|
|
|
122
|
-
You must be an `editor` or the `owner` of the project to attach a
|
|
122
|
+
You must be an `editor` or the `owner` 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.
|
|
123
123
|
|
|
124
124
|
You cannot add a Dataset to a Project until its upload is complete.
|
|
125
125
|
|
|
@@ -282,13 +282,13 @@ export const useDeleteUnmanagedFile = <
|
|
|
282
282
|
return useMutation(mutationOptions);
|
|
283
283
|
};
|
|
284
284
|
/**
|
|
285
|
-
* Given a `file_id` the file will be removed from the
|
|
285
|
+
* Given a `file_id` the file will be removed from the Project it's attached to.
|
|
286
286
|
|
|
287
|
-
You must be an `editor` or the `owner` of the project to delete a file from a
|
|
287
|
+
You must be an `editor` or the `owner` 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.
|
|
288
288
|
|
|
289
289
|
You cannot delete a Project File until the attach is complete.
|
|
290
290
|
|
|
291
|
-
* @summary Delete/detach a File (from a
|
|
291
|
+
* @summary Delete/detach a File (from a Project)
|
|
292
292
|
*/
|
|
293
293
|
export const deleteFile = (
|
|
294
294
|
fileId: string,
|
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: 1.
|
|
9
|
+
* OpenAPI spec version: 1.1
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery, useMutation } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
|
@@ -44,9 +44,9 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
|
44
44
|
|
|
45
45
|
Instance behaviour is controlled using the `specification`. You will need to consult individual applications to determine what can be placed in the specification. Applications typically provide a `template` describing its **options**.
|
|
46
46
|
|
|
47
|
-
An Application instance is not Ready for use until the corresponding **TaskState** is
|
|
47
|
+
An Application instance is not Ready for use until the corresponding **TaskState** is _STARTED_.
|
|
48
48
|
|
|
49
|
-
A Job instance typically runs to completion, reaching the **TaskState**
|
|
49
|
+
A Job instance typically runs to completion, reaching the **TaskState** _SUCCESS_ when successful and _FAILURE_ is unsuccessful.
|
|
50
50
|
|
|
51
51
|
* @summary Creates a new Job or Application instance
|
|
52
52
|
*/
|
|
@@ -231,7 +231,7 @@ export const useGetInstances = <
|
|
|
231
231
|
|
|
232
232
|
The test result is only valid at the time of the call, whether an actual instance would start or not will require an identical call to `/instance POST`.
|
|
233
233
|
|
|
234
|
-
* @summary Used to
|
|
234
|
+
* @summary Used to check the execution of new Job or Application instance
|
|
235
235
|
*/
|
|
236
236
|
export const dryRunInstance = (
|
|
237
237
|
instancePostBodyBody: InstancePostBodyBody,
|
|
@@ -334,9 +334,7 @@ export const useDryRunInstance = <
|
|
|
334
334
|
return useMutation(mutationOptions);
|
|
335
335
|
};
|
|
336
336
|
/**
|
|
337
|
-
*
|
|
338
|
-
|
|
339
|
-
* @summary Get detailed information about a specific instance
|
|
337
|
+
* @summary Get detailed information about an Instance
|
|
340
338
|
*/
|
|
341
339
|
export const getInstance = (
|
|
342
340
|
instanceId: string,
|
|
@@ -410,11 +408,11 @@ export const useGetInstance = <
|
|
|
410
408
|
};
|
|
411
409
|
|
|
412
410
|
/**
|
|
413
|
-
* The Application or Job
|
|
411
|
+
* The Application or Job Instance is terminated.
|
|
414
412
|
|
|
415
|
-
You must be the `owner` or an `editor` of the
|
|
413
|
+
You must be the `owner` or an `editor` of the Instance to delete it
|
|
416
414
|
|
|
417
|
-
* @summary Delete a Job or Application
|
|
415
|
+
* @summary Delete a Job or Application Instance
|
|
418
416
|
*/
|
|
419
417
|
export const terminateInstance = (
|
|
420
418
|
instanceId: string,
|
|
@@ -480,11 +478,11 @@ export const useTerminateInstance = <
|
|
|
480
478
|
return useMutation(mutationOptions);
|
|
481
479
|
};
|
|
482
480
|
/**
|
|
483
|
-
* The Application or Job
|
|
481
|
+
* The Application or Job Instance is updated according to the patch parameters.
|
|
484
482
|
|
|
485
|
-
You must be the `owner` or an `editor` of the
|
|
483
|
+
You must be the `owner` or an `editor` of the Instance to patch it
|
|
486
484
|
|
|
487
|
-
* @summary Update a Job or Application
|
|
485
|
+
* @summary Update a Job or Application Instance
|
|
488
486
|
*/
|
|
489
487
|
export const patchInstance = (
|
|
490
488
|
instanceId: string,
|
|
@@ -557,7 +555,7 @@ Tokens automatically expire after a period of time but can be revoked instantly
|
|
|
557
555
|
|
|
558
556
|
The remote system will revoke the token when it's finished with it
|
|
559
557
|
|
|
560
|
-
* @summary Delete (revoke) the
|
|
558
|
+
* @summary Delete (revoke) the Instance Token
|
|
561
559
|
*/
|
|
562
560
|
export const deleteInstanceToken = (
|
|
563
561
|
instanceId: string,
|
package/src/job/job.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: 1.
|
|
9
|
+
* OpenAPI spec version: 1.1
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
|
@@ -35,9 +35,9 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
|
35
35
|
: never;
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* Get a list of all
|
|
38
|
+
* Get a list of all Jobs available to you that can be instantiated via the `/instance` endpoint.
|
|
39
39
|
|
|
40
|
-
Job availability will vary as Jobs are added to the
|
|
40
|
+
Job availability will vary as Jobs are added to the service.
|
|
41
41
|
|
|
42
42
|
* @summary Get all Jobs available to you
|
|
43
43
|
*/
|
|
@@ -107,7 +107,7 @@ export const useGetJobs = <
|
|
|
107
107
|
/**
|
|
108
108
|
* Gets a Job based on its **collection**, **job** and **version**.
|
|
109
109
|
|
|
110
|
-
Job availability will vary as Jobs are added to the
|
|
110
|
+
Job availability will vary as Jobs are added to the service. Jobs that have been added are unlikely to be removed.
|
|
111
111
|
|
|
112
112
|
* @summary Get a Job by its version
|
|
113
113
|
*/
|
|
@@ -185,7 +185,7 @@ export const useGetJobByVersion = <
|
|
|
185
185
|
};
|
|
186
186
|
|
|
187
187
|
/**
|
|
188
|
-
* Get details of a specific
|
|
188
|
+
* Get details of a specific Job available to you that can be instantiated.
|
|
189
189
|
|
|
190
190
|
To run a job you need to use the `/instance` endpoint. The Job is controlled through the `specification` field, a JSON string. You will need to identify the Job using its `collection`, `job` and `version` as well as providing any variables in the specification required by the Job's command.
|
|
191
191
|
|
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: 1.
|
|
9
|
+
* OpenAPI spec version: 1.1
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery, useMutation } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
|
@@ -35,7 +35,7 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
|
35
35
|
: never;
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* Update parameters or add new annotations of the specified type(s) and to the
|
|
38
|
+
* Update parameters or add new annotations of the specified type(s) and to the Metadata for a **Dataset Version**.
|
|
39
39
|
|
|
40
40
|
The parameters are provided in a list in keyword/arguments
|
|
41
41
|
|
|
@@ -141,9 +141,9 @@ export const useAddMetadataVersion = <
|
|
|
141
141
|
return useMutation(mutationOptions);
|
|
142
142
|
};
|
|
143
143
|
/**
|
|
144
|
-
* Returns the
|
|
144
|
+
* Returns the Metadata for a **Dataset Version** in JSON format.
|
|
145
145
|
|
|
146
|
-
* @summary Gets the Metadata for a specific Dataset
|
|
146
|
+
* @summary Gets the Metadata for a specific Dataset Version
|
|
147
147
|
*/
|
|
148
148
|
export const getMetadataVersion = (
|
|
149
149
|
datasetId: string,
|
|
@@ -240,8 +240,10 @@ export const useGetMetadataVersion = <
|
|
|
240
240
|
};
|
|
241
241
|
|
|
242
242
|
/**
|
|
243
|
-
* Update default parameters or add new labels to the
|
|
243
|
+
* Update default parameters or add new labels to the Metadata for the Dataset.
|
|
244
|
+
|
|
244
245
|
The parameters are provided in a list in keyword/arguments
|
|
246
|
+
|
|
245
247
|
The labels are provided in a list in JSON format. For details of the label format, see the data-manager-metadata library,
|
|
246
248
|
|
|
247
249
|
* @summary Update Metadata for the Dataset
|
|
@@ -324,7 +326,7 @@ export const useAddMetadata = <
|
|
|
324
326
|
return useMutation(mutationOptions);
|
|
325
327
|
};
|
|
326
328
|
/**
|
|
327
|
-
* Returns the
|
|
329
|
+
* Returns the Metadata for a Dataset in JSON format.
|
|
328
330
|
|
|
329
331
|
* @summary Gets the Metadata for a specific Dataset
|
|
330
332
|
*/
|
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: 1.
|
|
9
|
+
* OpenAPI spec version: 1.1
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery, useMutation } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
|
@@ -42,9 +42,7 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
|
42
42
|
: never;
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
* Get
|
|
46
|
-
|
|
47
|
-
* @summary Get all Pojects available to you
|
|
45
|
+
* @summary Get all Projects available to you
|
|
48
46
|
*/
|
|
49
47
|
export const getProjects = (
|
|
50
48
|
params?: GetProjectsParams,
|
|
@@ -120,11 +118,11 @@ export const useGetProjects = <
|
|
|
120
118
|
/**
|
|
121
119
|
* Creates a new Project, assigning and returning a unique **ID**. A persistent volume is created in the cluster and assigned to your Project. It's here you can add **Datasets** as **Files** and run **Applications** and **Jobs**.
|
|
122
120
|
|
|
123
|
-
To create a Project you will need
|
|
121
|
+
To create a Project when an **Account Server** is configured you will need a **Product**.
|
|
124
122
|
|
|
125
|
-
As the
|
|
123
|
+
As the Project `owner` (creator) you are also automatically an `editor` of the Project and can add other users as **Editors** so that they can also manipulate the project. An **Editor** of a project can also delete it.
|
|
126
124
|
|
|
127
|
-
The name you give the
|
|
125
|
+
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 you create.
|
|
128
126
|
|
|
129
127
|
* @summary Create a new Project
|
|
130
128
|
*/
|
|
@@ -204,7 +202,7 @@ export const useCreateProject = <
|
|
|
204
202
|
return useMutation(mutationOptions);
|
|
205
203
|
};
|
|
206
204
|
/**
|
|
207
|
-
* Gets the details of a
|
|
205
|
+
* Gets the details of a Project that is available to you.
|
|
208
206
|
|
|
209
207
|
* @summary Get a Project
|
|
210
208
|
*/
|
|
@@ -280,7 +278,7 @@ export const useGetProject = <
|
|
|
280
278
|
};
|
|
281
279
|
|
|
282
280
|
/**
|
|
283
|
-
* Used to update some adjustable parameters of a Project, i.e. to make it
|
|
281
|
+
* Used to update some adjustable parameters of a Project, i.e. to make it `private` or make it `public``. What can be adjusted will depend on the purchased **Product**
|
|
284
282
|
|
|
285
283
|
* @summary Adjust an existing Project
|
|
286
284
|
*/
|
|
@@ -362,11 +360,11 @@ export const usePatchProject = <
|
|
|
362
360
|
return useMutation(mutationOptions);
|
|
363
361
|
};
|
|
364
362
|
/**
|
|
365
|
-
* Deletes an existing
|
|
363
|
+
* Deletes an existing Project.
|
|
366
364
|
|
|
367
365
|
You must be an `editor` or the `owner` of the project.
|
|
368
366
|
|
|
369
|
-
Once deleted all **Files**, working directories and material in the
|
|
367
|
+
Once deleted all **Files**, working directories and material in the Project will also be removed
|
|
370
368
|
|
|
371
369
|
* @summary Delete a Project
|
|
372
370
|
*/
|
|
@@ -434,7 +432,7 @@ export const useDeleteProject = <
|
|
|
434
432
|
return useMutation(mutationOptions);
|
|
435
433
|
};
|
|
436
434
|
/**
|
|
437
|
-
* Adds a user to a
|
|
435
|
+
* Adds a user to a Project as an `editor`. Editors can add and remove datasets in a project and delete the project.
|
|
438
436
|
|
|
439
437
|
An `editor` of a project is not automatically an `editor` of any datasets the project contains.
|
|
440
438
|
|
|
@@ -507,7 +505,7 @@ export const useAddEditorToProject = <
|
|
|
507
505
|
return useMutation(mutationOptions);
|
|
508
506
|
};
|
|
509
507
|
/**
|
|
510
|
-
* Deletes a project `editor`. The editor can be you
|
|
508
|
+
* Deletes a project `editor`. The editor can be you.
|
|
511
509
|
|
|
512
510
|
A project must always have one `editor` so you will not be able to delete the last editor of a project.
|
|
513
511
|
|
|
@@ -580,7 +578,7 @@ export const useRemoveEditorFromProject = <
|
|
|
580
578
|
return useMutation(mutationOptions);
|
|
581
579
|
};
|
|
582
580
|
/**
|
|
583
|
-
* 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
|
|
581
|
+
* 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**.
|
|
584
582
|
|
|
585
583
|
You must be an `editor` or the `owner` of the Project to add Observers
|
|
586
584
|
|
|
@@ -726,7 +724,7 @@ export const useRemoveObserverFromProject = <
|
|
|
726
724
|
|
|
727
725
|
For **managed** files you should consider using the `/file/{file_id}` endpoint.
|
|
728
726
|
|
|
729
|
-
You must be an `editor` or the `owner` of the
|
|
727
|
+
You must be an `editor` or the `owner` of the Project if the Project is `private`
|
|
730
728
|
|
|
731
729
|
* @summary Download a Project file
|
|
732
730
|
*/
|
|
@@ -903,7 +901,7 @@ export const useAddFileToProject = <
|
|
|
903
901
|
|
|
904
902
|
For **managed** files you should consider using the `/file/{file_id}` endpoint.
|
|
905
903
|
|
|
906
|
-
As there is no
|
|
904
|
+
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.
|
|
907
905
|
|
|
908
906
|
* @summary Download a Project file using a Token
|
|
909
907
|
*/
|
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: 1.
|
|
9
|
+
* OpenAPI spec version: 1.1
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery, useMutation } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
|
@@ -36,7 +36,7 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
|
36
36
|
: never;
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
* Returns a list of
|
|
39
|
+
* Returns a list of Tasks that you have access to.
|
|
40
40
|
|
|
41
41
|
* @summary Returns a list of Tasks
|
|
42
42
|
*/
|
|
@@ -116,19 +116,19 @@ export const useGetTasks = <
|
|
|
116
116
|
|
|
117
117
|
You 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**.
|
|
118
118
|
|
|
119
|
-
Tasks are created in response to creating
|
|
119
|
+
Tasks are created in response to creating Datasets and launching **Applications** and **Jobs**.
|
|
120
120
|
|
|
121
|
-
Tasks contain of a list of `states` and `events`. A
|
|
121
|
+
Tasks contain of a list of `states` and `events`. A Task will always have `states` but may not have `events`.
|
|
122
122
|
|
|
123
|
-
States 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
|
|
123
|
+
States 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.
|
|
124
124
|
|
|
125
125
|
You 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.
|
|
126
126
|
|
|
127
|
-
**Dataset** tasks must be allowed to complete successfully before you can expect
|
|
127
|
+
**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_.
|
|
128
128
|
|
|
129
|
-
For **Dataset**
|
|
129
|
+
For **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.
|
|
130
130
|
|
|
131
|
-
For Application **Instance**
|
|
131
|
+
For 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.
|
|
132
132
|
|
|
133
133
|
* @summary Returns Task information
|
|
134
134
|
*/
|
|
@@ -203,7 +203,7 @@ export const useGetTask = <
|
|
|
203
203
|
|
|
204
204
|
You cannot delete a Task until it is `done`.
|
|
205
205
|
|
|
206
|
-
You must be an
|
|
206
|
+
You 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.
|
|
207
207
|
|
|
208
208
|
* @summary Delete a Task entry
|
|
209
209
|
*/
|
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** and **Jobs** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version: 1.
|
|
9
|
+
* OpenAPI spec version: 1.1
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
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: 1.
|
|
9
|
+
* OpenAPI spec version: 1.1
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery, useMutation } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
|
@@ -38,9 +38,9 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
|
38
38
|
: never;
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
* Returns a summary of all users that have accessed the Data Manager API and where the account is not
|
|
41
|
+
* Returns a summary of all users that have accessed the Data Manager API and where the account is not `private`. Users can set their accounts to be private and therefore will not show up in methods like this
|
|
42
42
|
|
|
43
|
-
* @summary Get information about all known
|
|
43
|
+
* @summary Get information about all known Users
|
|
44
44
|
*/
|
|
45
45
|
export const getUsers = (
|
|
46
46
|
options?: SecondParameter<typeof customInstance>,
|
|
@@ -98,8 +98,6 @@ export const useGetUsers = <
|
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
|
-
* Returns a summary of your account
|
|
102
|
-
|
|
103
101
|
* @summary Get information about your account
|
|
104
102
|
*/
|
|
105
103
|
export const getUserAccount = (
|
|
@@ -176,8 +174,6 @@ export const useGetUserAccount = <
|
|
|
176
174
|
};
|
|
177
175
|
|
|
178
176
|
/**
|
|
179
|
-
* Make changes to your user account
|
|
180
|
-
|
|
181
177
|
* @summary Patch your account
|
|
182
178
|
*/
|
|
183
179
|
export const patchUserAccount = (
|
package/task/task.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/task/task.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAgC/B,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,sBAAsB,CAAC,WAClC,CAAC,oBAAoB,SAAS,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAEpD,IAAM,0BAA0B,CAIrC,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,oBAAoB,MAAM;AAErE,QAAM,UAA+D,CAAC;AAAA,IACpE;AAAA,EACF,MAAM,SAAS,QAAQ,gBAAgB,MAAM;AAE7C,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,cAAc,CAIzB,QACA,YAQ2D;AAC3D,QAAM,eAAe,wBAAwB,QAAQ,OAAO;AAE5D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAuBO,IAAM,UAAU,CACrB,QACA,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,UAAU,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACxD;AAAA,EACF;AACF;AAEO,IAAM,qBAAqB,CAAC,QAAgB,WACjD,CAAC,oBAAoB,SAAS,UAAU,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAE9D,IAAM,yBAAyB,CAIpC,QACA,QACA,YAMG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,mBAAmB,QAAQ,MAAM;AAE5E,QAAM,UAA8D,CAAC;AAAA,IACnE;AAAA,EACF,MAAM,QAAQ,QAAQ,QAAQ,gBAAgB,MAAM;AAEpD,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,QAAQ,GAAG,aAAa;AACjE;AAOO,IAAM,aAAa,CAIxB,QACA,QACA,YAI2D;AAC3D,QAAM,eAAe,uBAAuB,QAAQ,QAAQ,OAAO;AAEnE,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAWO,IAAM,aAAa,CACxB,QACA,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,UAAU,QAAQ,SAAS;AAAA,IAC3C;AAAA,EACF;AACF;AAEO,IAAM,+BAA+B,CAG1C,YAaG;AACH,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,IAAI,SAAS,CAAC;AAE7B,WAAO,WAAW,QAAQ,cAAc;AAAA,EAC1C;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,gBAAgB,CAG3B,YAQI;AACJ,QAAM,kBAAkB,6BAA6B,OAAO;AAE5D,SAAO,YAAY,eAAe;AACpC","sourcesContent":["/**\n * Generated by orval v6.15.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.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n TasksGetResponse,\n DmError,\n GetTasksParams,\n TaskGetResponse,\n GetTaskParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\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>,\n signal?: AbortSignal\n) => {\n return customInstance<TasksGetResponse>(\n { url: `/task`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetTasksQueryKey = (params?: GetTasksParams) =>\n [\"data-manager-api\", `/task`, ...(params ? [params] : [])] as const;\n\nexport const getGetTasksQueryOptions = <\n TData = Awaited<ReturnType<typeof getTasks>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetTasksParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getTasks>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({\n signal,\n }) => getTasks(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetTasksQueryResult = NonNullable<\n Awaited<ReturnType<typeof getTasks>>\n>;\nexport type GetTasksQueryError = ErrorType<void | DmError>;\n\nexport const useGetTasks = <\n TData = Awaited<ReturnType<typeof getTasks>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetTasksParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getTasks>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetTasksQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\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.\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 100 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 a 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>,\n signal?: AbortSignal\n) => {\n return customInstance<TaskGetResponse>(\n { url: `/task/${taskId}`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetTaskQueryKey = (taskId: string, params?: GetTaskParams) =>\n [\"data-manager-api\", `/task/${taskId}`, ...(params ? [params] : [])] as const;\n\nexport const getGetTaskQueryOptions = <\n TData = Awaited<ReturnType<typeof getTask>>,\n TError = ErrorType<void | DmError>\n>(\n taskId: string,\n params?: GetTaskParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({\n signal,\n }) => getTask(taskId, params, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!taskId, ...queryOptions };\n};\n\nexport type GetTaskQueryResult = NonNullable<\n Awaited<ReturnType<typeof getTask>>\n>;\nexport type GetTaskQueryError = ErrorType<void | DmError>;\n\nexport const useGetTask = <\n TData = Awaited<ReturnType<typeof getTask>>,\n TError = ErrorType<void | DmError>\n>(\n taskId: string,\n params?: GetTaskParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetTaskQueryOptions(taskId, params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\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 action 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 return customInstance<void>(\n { url: `/task/${taskId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteTaskMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteTask>>,\n TError,\n { taskId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteTask>>,\n TError,\n { taskId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteTask>>,\n { taskId: string }\n > = (props) => {\n const { taskId } = props ?? {};\n\n return deleteTask(taskId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteTaskMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteTask>>\n>;\n\nexport type DeleteTaskMutationError = ErrorType<DmError>;\n\nexport const useDeleteTask = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteTask>>,\n TError,\n { taskId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteTaskMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/task/task.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAgC/B,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,sBAAsB,CAAC,WAClC,CAAC,oBAAoB,SAAS,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAEpD,IAAM,0BAA0B,CAIrC,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,oBAAoB,MAAM;AAErE,QAAM,UAA+D,CAAC;AAAA,IACpE;AAAA,EACF,MAAM,SAAS,QAAQ,gBAAgB,MAAM;AAE7C,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,cAAc,CAIzB,QACA,YAQ2D;AAC3D,QAAM,eAAe,wBAAwB,QAAQ,OAAO;AAE5D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAuBO,IAAM,UAAU,CACrB,QACA,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,UAAU,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACxD;AAAA,EACF;AACF;AAEO,IAAM,qBAAqB,CAAC,QAAgB,WACjD,CAAC,oBAAoB,SAAS,UAAU,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAE9D,IAAM,yBAAyB,CAIpC,QACA,QACA,YAMG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,mBAAmB,QAAQ,MAAM;AAE5E,QAAM,UAA8D,CAAC;AAAA,IACnE;AAAA,EACF,MAAM,QAAQ,QAAQ,QAAQ,gBAAgB,MAAM;AAEpD,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,QAAQ,GAAG,aAAa;AACjE;AAOO,IAAM,aAAa,CAIxB,QACA,QACA,YAI2D;AAC3D,QAAM,eAAe,uBAAuB,QAAQ,QAAQ,OAAO;AAEnE,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAWO,IAAM,aAAa,CACxB,QACA,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,UAAU,QAAQ,SAAS;AAAA,IAC3C;AAAA,EACF;AACF;AAEO,IAAM,+BAA+B,CAG1C,YAaG;AACH,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,IAAI,SAAS,CAAC;AAE7B,WAAO,WAAW,QAAQ,cAAc;AAAA,EAC1C;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,gBAAgB,CAG3B,YAQI;AACJ,QAAM,kBAAkB,6BAA6B,OAAO;AAE5D,SAAO,YAAY,eAAe;AACpC","sourcesContent":["/**\n * Generated by orval v6.15.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.1\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n TasksGetResponse,\n DmError,\n GetTasksParams,\n TaskGetResponse,\n GetTaskParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\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>,\n signal?: AbortSignal\n) => {\n return customInstance<TasksGetResponse>(\n { url: `/task`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetTasksQueryKey = (params?: GetTasksParams) =>\n [\"data-manager-api\", `/task`, ...(params ? [params] : [])] as const;\n\nexport const getGetTasksQueryOptions = <\n TData = Awaited<ReturnType<typeof getTasks>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetTasksParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getTasks>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({\n signal,\n }) => getTasks(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetTasksQueryResult = NonNullable<\n Awaited<ReturnType<typeof getTasks>>\n>;\nexport type GetTasksQueryError = ErrorType<void | DmError>;\n\nexport const useGetTasks = <\n TData = Awaited<ReturnType<typeof getTasks>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetTasksParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getTasks>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetTasksQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\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>,\n signal?: AbortSignal\n) => {\n return customInstance<TaskGetResponse>(\n { url: `/task/${taskId}`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetTaskQueryKey = (taskId: string, params?: GetTaskParams) =>\n [\"data-manager-api\", `/task/${taskId}`, ...(params ? [params] : [])] as const;\n\nexport const getGetTaskQueryOptions = <\n TData = Awaited<ReturnType<typeof getTask>>,\n TError = ErrorType<void | DmError>\n>(\n taskId: string,\n params?: GetTaskParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({\n signal,\n }) => getTask(taskId, params, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!taskId, ...queryOptions };\n};\n\nexport type GetTaskQueryResult = NonNullable<\n Awaited<ReturnType<typeof getTask>>\n>;\nexport type GetTaskQueryError = ErrorType<void | DmError>;\n\nexport const useGetTask = <\n TData = Awaited<ReturnType<typeof getTask>>,\n TError = ErrorType<void | DmError>\n>(\n taskId: string,\n params?: GetTaskParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetTaskQueryOptions(taskId, params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\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 return customInstance<void>(\n { url: `/task/${taskId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteTaskMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteTask>>,\n TError,\n { taskId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteTask>>,\n TError,\n { taskId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteTask>>,\n { taskId: string }\n > = (props) => {\n const { taskId } = props ?? {};\n\n return deleteTask(taskId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteTaskMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteTask>>\n>;\n\nexport type DeleteTaskMutationError = ErrorType<DmError>;\n\nexport const useDeleteTask = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteTask>>,\n TError,\n { taskId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteTaskMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n"]}
|