@squonk/data-manager-client 1.0.0-rc.3 → 1.0.1
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 +18 -5
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.ts +1 -1
- package/accounting/accounting.js +18 -5
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +67 -25
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +23 -6
- package/admin/admin.js +66 -24
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +13 -7
- package/application/application.cjs.map +1 -1
- package/application/application.d.ts +3 -3
- package/application/application.js +13 -7
- package/application/application.js.map +1 -1
- package/chunk-3O5KIRV4.js +27 -0
- package/{chunk-3TENYKS7.js.map → chunk-3O5KIRV4.js.map} +1 -1
- package/chunk-IUEU2LYC.cjs +27 -0
- package/chunk-IUEU2LYC.cjs.map +1 -0
- package/{custom-instance-b2f7dca1.d.ts → custom-instance-3a73945d.d.ts} +56 -19
- package/dataset/dataset.cjs +92 -44
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +5 -5
- package/dataset/dataset.js +92 -44
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs +45 -27
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.ts +3 -3
- package/exchange-rate/exchange-rate.js +45 -27
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file/file.cjs +39 -17
- package/file/file.cjs.map +1 -1
- package/file/file.d.ts +1 -1
- package/file/file.js +39 -17
- package/file/file.js.map +1 -1
- package/index.cjs +2 -2
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs +42 -18
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.ts +6 -6
- package/instance/instance.js +42 -18
- package/instance/instance.js.map +1 -1
- package/job/job.cjs +23 -7
- package/job/job.cjs.map +1 -1
- package/job/job.d.ts +3 -3
- package/job/job.js +23 -7
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +43 -27
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.ts +6 -4
- package/metadata/metadata.js +43 -27
- package/metadata/metadata.js.map +1 -1
- package/package.json +5 -5
- package/project/project.cjs +74 -39
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +13 -13
- package/project/project.js +74 -39
- package/project/project.js.map +1 -1
- package/src/admin/admin.ts +61 -4
- package/src/application/application.ts +2 -2
- package/src/data-manager-api.schemas.ts +59 -20
- package/src/dataset/dataset.ts +4 -4
- package/src/exchange-rate/exchange-rate.ts +2 -2
- package/src/instance/instance.ts +5 -5
- package/src/job/job.ts +2 -2
- package/src/metadata/metadata.ts +5 -3
- package/src/project/project.ts +12 -12
- package/src/task/task.ts +2 -2
- package/task/task.cjs +23 -7
- package/task/task.cjs.map +1 -1
- package/task/task.d.ts +3 -3
- package/task/task.js +23 -7
- package/task/task.js.map +1 -1
- package/type/type.cjs +5 -2
- package/type/type.cjs.map +1 -1
- package/type/type.d.ts +1 -1
- package/type/type.js +5 -2
- package/type/type.js.map +1 -1
- package/user/user.cjs +35 -13
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +1 -1
- package/user/user.js +35 -13
- package/user/user.js.map +1 -1
- package/chunk-3TENYKS7.js +0 -46
- package/chunk-RHHRF25R.cjs +0 -46
- package/chunk-RHHRF25R.cjs.map +0 -1
|
@@ -53,6 +53,16 @@ declare type GetTasksParams = {
|
|
|
53
53
|
exclude_purpose?: QExcludePurposeParameter;
|
|
54
54
|
project_id?: QProjectIdParameter;
|
|
55
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* A project path. If provided it must begin `/` and refers to a path where `/` represents the project's root directory
|
|
58
|
+
|
|
59
|
+
*/
|
|
60
|
+
declare type QFilePathParameter = string;
|
|
61
|
+
/**
|
|
62
|
+
* A project file.
|
|
63
|
+
|
|
64
|
+
*/
|
|
65
|
+
declare type QFileParameter = string;
|
|
56
66
|
declare type DeleteUnmanagedFileParams = {
|
|
57
67
|
file: QFileParameter;
|
|
58
68
|
path?: QFilePathParameter;
|
|
@@ -115,17 +125,17 @@ declare type QTokenParameter = string;
|
|
|
115
125
|
*/
|
|
116
126
|
declare type QProjectIdParameter = string;
|
|
117
127
|
/**
|
|
118
|
-
* JSON string containing a list of label/value pairs for the datasets to be filtered by. If the value is set to null, then only the label is matched. If both the label and value are set, then both are matched. e.g. '{"label1": null, "
|
|
128
|
+
* JSON string containing a list of label/value pairs for the datasets to be filtered by. If the value is set to null, then only the label is matched. If both the label and value are set, then both are matched. e.g. '{"label1": null, "label2": "value2"}'
|
|
119
129
|
|
|
120
130
|
*/
|
|
121
131
|
declare type QLabelsParameter = string;
|
|
122
132
|
/**
|
|
123
|
-
*
|
|
133
|
+
* Only return records where the exchange rate is undefined
|
|
124
134
|
|
|
125
135
|
*/
|
|
126
136
|
declare type QOnlyUndefinedParameter = boolean;
|
|
127
137
|
/**
|
|
128
|
-
* Whether to convert Project managed file instances to
|
|
138
|
+
* Whether to convert Project managed file instances to unmanaged files
|
|
129
139
|
|
|
130
140
|
*/
|
|
131
141
|
declare type QKeepProjectFilesParameter = boolean;
|
|
@@ -175,16 +185,6 @@ declare type QFromParameter = string;
|
|
|
175
185
|
* The Project identity
|
|
176
186
|
*/
|
|
177
187
|
declare type QFileProjectIdParameter = string;
|
|
178
|
-
/**
|
|
179
|
-
* A project path. If provided it must begin `/` and refers to a path where `/` represents the project's root directory
|
|
180
|
-
|
|
181
|
-
*/
|
|
182
|
-
declare type QFilePathParameter = string;
|
|
183
|
-
/**
|
|
184
|
-
* A project file.
|
|
185
|
-
|
|
186
|
-
*/
|
|
187
|
-
declare type QFileParameter = string;
|
|
188
188
|
/**
|
|
189
189
|
* Set to a dot-separated string of purpose enumerations, i.e. `INSTANCE`, `FILE` or `DATASET`. To exclude file and dataset tasks set to `FILE.DATASET`
|
|
190
190
|
|
|
@@ -226,7 +226,7 @@ declare type QCurrentParameter = boolean;
|
|
|
226
226
|
*/
|
|
227
227
|
declare type QApplicationIdParameter = string;
|
|
228
228
|
declare type UserPatchBodyBody = {
|
|
229
|
-
/** If set to a message the user account is suspended, with the user receiving this message when they try and use the API. A suspended user
|
|
229
|
+
/** If set to a message the user account is suspended, with the user receiving this message when they try and use the API. A suspended user account can be restored by setting the message to `/restore`
|
|
230
230
|
*/
|
|
231
231
|
suspend_message?: string;
|
|
232
232
|
};
|
|
@@ -292,7 +292,9 @@ declare type JobManifestLoadPutBodyBody = {
|
|
|
292
292
|
};
|
|
293
293
|
declare type InstancePostBodyBody = {
|
|
294
294
|
/** A supported application. Applications instances are managed using pre-deployed Kubernetes **Operators**. The application ID is a combination of the operator _plural_ and _group_.
|
|
295
|
-
|
|
295
|
+
|
|
296
|
+
Application IDs currently supported include ``datamanagerjobs.squonk.it`` and ``jupyternotebooks.squonk.it``
|
|
297
|
+
*/
|
|
296
298
|
application_id: string;
|
|
297
299
|
/** A supported application version to launch.
|
|
298
300
|
|
|
@@ -327,11 +329,13 @@ declare type InstancePostBodyBody = {
|
|
|
327
329
|
debug?: string;
|
|
328
330
|
/** The instance specification. A JSON string that's application-specific and controls the application's behaviour.
|
|
329
331
|
|
|
330
|
-
When
|
|
332
|
+
When launching a Data Manager **Job** Application you must identify the Job using the properties `collection`, `job` and `version`, e.g. `{"collection":"im-test","job":"nop","version":"1.0.0"}`
|
|
331
333
|
|
|
332
334
|
Jobs that offer commands will often advertise a series of **inputs** and **options** where the values can be provided using a **variables** map in the specification. Something like `"variables":{"x":7}`.
|
|
333
335
|
|
|
334
336
|
Jobs start in a Job-specific **working directory** but the starting directory for any Job can be adjusted by defining a `sub_path` to the root specification. For example, if you want the Job to start in the path `foo/bar` (inside the Job's built-in working directory) you can add `"sub_path":"foo/bar"` to the specification. You can only use a sub-path for a Job if the Job defines a working directory and `sub-path` cannot begin or end with a path separator (`/`).
|
|
337
|
+
|
|
338
|
+
Applications also support `variables`. The Jupyter notebook application supports the definition of the notebook image (i.e. `"image:":"tensorflow"`), `"cpu"` and `"memory"`. A full Jupyter notebook specification might look like `{"variables":{"image":"tensorflow","cpu":2,"memory":"4Gi"}}`. `memory` is limited to `Gi` as a suffix.
|
|
335
339
|
*/
|
|
336
340
|
specification?: string;
|
|
337
341
|
};
|
|
@@ -433,7 +437,7 @@ interface UserDetail {
|
|
|
433
437
|
/** The date and time the user was first seen (an ISO-8601 formatted string in UTC)
|
|
434
438
|
*/
|
|
435
439
|
first_seen?: string;
|
|
436
|
-
/** Set if the user's account is marked as private.
|
|
440
|
+
/** Set if the user's account is marked as private. Private accounts do not show up against general queries.
|
|
437
441
|
*/
|
|
438
442
|
private: boolean;
|
|
439
443
|
/** True if the account is suspended
|
|
@@ -728,6 +732,34 @@ interface JobSummary {
|
|
|
728
732
|
*/
|
|
729
733
|
doc_url?: string;
|
|
730
734
|
}
|
|
735
|
+
interface JobManifestDetail {
|
|
736
|
+
/** The Job Manifest record ID */
|
|
737
|
+
id: number;
|
|
738
|
+
url: string;
|
|
739
|
+
header?: string;
|
|
740
|
+
params?: string;
|
|
741
|
+
/** The Date (and time) the manifest was created
|
|
742
|
+
*/
|
|
743
|
+
created: string;
|
|
744
|
+
/** The (admin) user who created the manifest
|
|
745
|
+
*/
|
|
746
|
+
creator?: string;
|
|
747
|
+
/** The number of job definition files loaded during the most recent successful load
|
|
748
|
+
*/
|
|
749
|
+
job_definition_files_loaded?: number;
|
|
750
|
+
/** The number of job definitions loaded during the most recent successful load
|
|
751
|
+
*/
|
|
752
|
+
job_definitions_loaded?: number;
|
|
753
|
+
/** The Date (and time) the manifest was last loaded successfully
|
|
754
|
+
*/
|
|
755
|
+
last_successful_load_time?: string;
|
|
756
|
+
/** The Date (and time) the manifest was last loaded, successfully or otherwise. If the manifest (or any of the Job definition files it refers to) fails to load the `load_status` should provide some diagnostic feedback
|
|
757
|
+
*/
|
|
758
|
+
last_load_time?: string;
|
|
759
|
+
/** The status of the time the manifest was last loaded. If the load was successful this will be `SUCCESS` and `last_successful_load` will be the same as `last_load`
|
|
760
|
+
*/
|
|
761
|
+
last_load_status: string;
|
|
762
|
+
}
|
|
731
763
|
interface JobApplication {
|
|
732
764
|
/** The Job's operator ID */
|
|
733
765
|
id: string;
|
|
@@ -1119,7 +1151,7 @@ interface UserApiLogGetResponse {
|
|
|
1119
1151
|
}
|
|
1120
1152
|
declare type UserAccountGetResponse = UserAccountDetail;
|
|
1121
1153
|
interface TypesGetResponse {
|
|
1122
|
-
/** A list of
|
|
1154
|
+
/** A list of available MIME types
|
|
1123
1155
|
*/
|
|
1124
1156
|
types: TypeSummary[];
|
|
1125
1157
|
}
|
|
@@ -1533,6 +1565,11 @@ interface AdminJobManifestLoadPutResponse {
|
|
|
1533
1565
|
*/
|
|
1534
1566
|
jobs_purged?: number;
|
|
1535
1567
|
}
|
|
1568
|
+
interface AdminJobManifestGetResponse {
|
|
1569
|
+
/** The list of known Job manifests
|
|
1570
|
+
*/
|
|
1571
|
+
job_manifests: JobManifestDetail[];
|
|
1572
|
+
}
|
|
1536
1573
|
interface AccountServerGetNamespaceResponse {
|
|
1537
1574
|
/** The configured Account Server namespace, which will be an empty string if one is not configured. The AS API is expected as the service `as-api` in this namespace.
|
|
1538
1575
|
*/
|
|
@@ -1564,4 +1601,4 @@ declare const setBaseUrl: (baseUrl: string) => void;
|
|
|
1564
1601
|
declare const customInstance: <TReturn>(config: AxiosRequestConfig, options?: AxiosRequestConfig<any> | undefined) => Promise<TReturn>;
|
|
1565
1602
|
declare type ErrorType<TError> = AxiosError<TError>;
|
|
1566
1603
|
|
|
1567
|
-
export { ExchangeRatePutBodyBody as $, AdminGetServiceErrorsParams as A,
|
|
1604
|
+
export { ExchangeRatePutBodyBody as $, AdminGetServiceErrorsParams as A, QJobJobParameter as B, QJobIdParameter as C, DeleteUnmanagedFileParams as D, QJobCollectionParameter as E, QInstanceArchiveParameter as F, GetUserApiLogParams as G, QIncludeHiddenParameter as H, QIncludeDeletedParameter as I, QIncludeAcknowlegedParameter as J, QFromParameter as K, QFileProjectIdParameter as L, QExcludePurposeParameter as M, QExcludeDoneParameter as N, QEventPriorOrdinalParameter as O, PatchInstanceParams as P, QFilePathParameter as Q, QEventLimitParameter as R, QDatasetMimeTypeParameter as S, QDoNotImpersonateParameter as T, QCurrentParameter as U, QApplicationIdParameter as V, UserPatchBodyBody as W, UserAccountPatchBodyBody as X, ProjectPostBodyBody as Y, ProjectPatchBodyBody as Z, ProjectFilePutBodyBody as _, GetUserAccountParams as a, ProjectGetResponse as a$, JobManifestPutBodyBody as a0, JobManifestLoadPutBodyBody as a1, InstancePostBodyBody as a2, FilePostBodyBody as a3, DatasetPutBodyBody as a4, DatasetVersionMetaPostBodyBody as a5, DatasetMetaPostBodyBody as a6, DatasetPostBodyBody as a7, UserSummary as a8, UserDetail as a9, FilePathFile as aA, JobExchangeRateSummary as aB, ApplicationExchangeRateSummary as aC, ExchangeRateDetail as aD, DatasetVersionSummaryLabels as aE, DatasetVersionSummaryProcessingStage as aF, DatasetVersionSummary as aG, DatasetVersionProjectFile as aH, DatasetVersionDetailLabels as aI, DatasetVersionDetailProcessingStage as aJ, DatasetVersionDetail as aK, DatasetSummary as aL, DatasetDetail as aM, ApplicationSummary as aN, ApiLogDetailMethod as aO, ApiLogDetail as aP, VersionGetResponse as aQ, UsersGetResponse as aR, UserApiLogGetResponse as aS, UserAccountGetResponse as aT, TypesGetResponse as aU, TasksGetResponse as aV, TaskGetResponsePurpose as aW, TaskGetResponse as aX, ServiceErrorsGetResponse as aY, ProjectsGetResponse as aZ, ProjectPostResponse as a_, UserAccountDetail as aa, TypeSummaryFormatterOptionsType as ab, TypeSummaryFormatterOptions as ac, TypeSummary as ad, TaskSummaryProcessingStage as ae, TaskSummary as af, TaskStateState as ag, TaskState as ah, TaskIdentity as ai, TaskEventLevel as aj, TaskEvent as ak, ServiceErrorSummarySeverity as al, ServiceErrorSummary as am, ProjectFileDetail as an, ProjectDetail as ao, JobOrderDetail as ap, JobVariables as aq, JobSummaryImageType as ar, JobSummary as as, JobManifestDetail as at, JobApplication as au, InstanceSummaryJobImageType as av, InstanceSummaryPhase as aw, InstanceSummaryApplicationType as ax, InstanceSummary as ay, FileStat as az, GetInstancesParams as b, ProjectDeleteResponse as b0, JobsGetResponse as b1, JobGetResponseImageType as b2, JobGetResponse as b3, InstanceTaskPurpose as b4, InstanceTask as b5, InstancesGetResponse as b6, InstanceGetResponsePhase as b7, InstanceGetResponseApplicationType as b8, InstanceGetResponse as b9, setBaseUrl as bA, customInstance as bB, ErrorType as bC, GetExchangeRatesResponseId as ba, GetExchangeRatesResponse as bb, GetAllExchangeRatesResponseExchangeRatesItem as bc, GetAllExchangeRatesResponse as bd, FilesGetResponse as be, FilePostResponse as bf, InstancePostResponse as bg, InstanceDeleteResponse as bh, DatasetsGetResponse as bi, DatasetVersionsGetResponse as bj, DatasetVersionDeleteResponse as bk, DatasetSchemaGetResponseType as bl, DatasetSchemaGetResponse as bm, DatasetMetaGetResponse as bn, DatasetDigestGetResponse as bo, DatasetPutPostResponse as bp, ApplicationsGetResponse as bq, ApplicationGetResponse as br, AdminUserPutResponse as bs, AdminJobManifestLoadPutResponse as bt, AdminJobManifestGetResponse as bu, AccountServerGetNamespaceResponse as bv, AccountServerGetRegistrationResponse as bw, DmError as bx, AXIOS_INSTANCE as by, setAuthToken as bz, GetJobExchangeRatesParams as c, GetAllJobExchangeRatesParams as d, GetJobByVersionParams as e, GetApplicationExchangeRatesParams as f, GetAllApplicationExchangeRatesParams as g, GetTaskParams as h, GetTasksParams as i, QFileParameter as j, GetFilesParams as k, DeleteDatasetParams as l, GetVersionsParams as m, GetDatasetsParams as n, GetProjectFileWithTokenParams as o, GetProjectFileParams as p, QEditorsParameter as q, QOwnersParameter as r, QUsernameParameter as s, QUntilParameter as t, QTokenParameter as u, QProjectIdParameter as v, QLabelsParameter as w, QOnlyUndefinedParameter as x, QKeepProjectFilesParameter as y, QJobVersionParameter as z };
|
package/dataset/dataset.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
var _chunkRHHRF25Rcjs = require('../chunk-RHHRF25R.cjs');
|
|
3
|
+
var _chunkIUEU2LYCcjs = require('../chunk-IUEU2LYC.cjs');
|
|
5
4
|
|
|
6
5
|
// src/dataset/dataset.ts
|
|
7
6
|
var _reactquery = require('react-query');
|
|
@@ -9,10 +8,16 @@ var createDatasetFromFile = (datasetPutBodyBody, options) => {
|
|
|
9
8
|
const formData = new FormData();
|
|
10
9
|
formData.append("dataset_type", datasetPutBodyBody.dataset_type);
|
|
11
10
|
if (datasetPutBodyBody.format_extra_variables !== void 0) {
|
|
12
|
-
formData.append(
|
|
11
|
+
formData.append(
|
|
12
|
+
"format_extra_variables",
|
|
13
|
+
datasetPutBodyBody.format_extra_variables
|
|
14
|
+
);
|
|
13
15
|
}
|
|
14
16
|
if (datasetPutBodyBody.skip_molecule_load !== void 0) {
|
|
15
|
-
formData.append(
|
|
17
|
+
formData.append(
|
|
18
|
+
"skip_molecule_load",
|
|
19
|
+
datasetPutBodyBody.skip_molecule_load.toString()
|
|
20
|
+
);
|
|
16
21
|
}
|
|
17
22
|
formData.append("project_id", datasetPutBodyBody.project_id);
|
|
18
23
|
formData.append("path", datasetPutBodyBody.path);
|
|
@@ -23,12 +28,15 @@ var createDatasetFromFile = (datasetPutBodyBody, options) => {
|
|
|
23
28
|
if (datasetPutBodyBody.unit_id !== void 0) {
|
|
24
29
|
formData.append("unit_id", datasetPutBodyBody.unit_id);
|
|
25
30
|
}
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
32
|
+
{
|
|
33
|
+
url: `/dataset`,
|
|
34
|
+
method: "put",
|
|
35
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
36
|
+
data: formData
|
|
37
|
+
},
|
|
38
|
+
options
|
|
39
|
+
);
|
|
32
40
|
};
|
|
33
41
|
var useCreateDatasetFromFile = (options) => {
|
|
34
42
|
const { mutation: mutationOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
@@ -43,10 +51,16 @@ var uploadDataset = (datasetPostBodyBody, options) => {
|
|
|
43
51
|
formData.append("dataset_file", datasetPostBodyBody.dataset_file);
|
|
44
52
|
formData.append("dataset_type", datasetPostBodyBody.dataset_type);
|
|
45
53
|
if (datasetPostBodyBody.format_extra_variables !== void 0) {
|
|
46
|
-
formData.append(
|
|
54
|
+
formData.append(
|
|
55
|
+
"format_extra_variables",
|
|
56
|
+
datasetPostBodyBody.format_extra_variables
|
|
57
|
+
);
|
|
47
58
|
}
|
|
48
59
|
if (datasetPostBodyBody.skip_molecule_load !== void 0) {
|
|
49
|
-
formData.append(
|
|
60
|
+
formData.append(
|
|
61
|
+
"skip_molecule_load",
|
|
62
|
+
datasetPostBodyBody.skip_molecule_load.toString()
|
|
63
|
+
);
|
|
50
64
|
}
|
|
51
65
|
if (datasetPostBodyBody.as_filename !== void 0) {
|
|
52
66
|
formData.append("as_filename", datasetPostBodyBody.as_filename);
|
|
@@ -55,12 +69,15 @@ var uploadDataset = (datasetPostBodyBody, options) => {
|
|
|
55
69
|
formData.append("dataset_id", datasetPostBodyBody.dataset_id);
|
|
56
70
|
}
|
|
57
71
|
formData.append("unit_id", datasetPostBodyBody.unit_id);
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
72
|
+
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
73
|
+
{
|
|
74
|
+
url: `/dataset`,
|
|
75
|
+
method: "post",
|
|
76
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
77
|
+
data: formData
|
|
78
|
+
},
|
|
79
|
+
options
|
|
80
|
+
);
|
|
64
81
|
};
|
|
65
82
|
var useUploadDataset = (options) => {
|
|
66
83
|
const { mutation: mutationOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
@@ -71,7 +88,10 @@ var useUploadDataset = (options) => {
|
|
|
71
88
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
72
89
|
};
|
|
73
90
|
var getDatasets = (params, options, signal) => {
|
|
74
|
-
return
|
|
91
|
+
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
92
|
+
{ url: `/dataset`, method: "get", params, signal },
|
|
93
|
+
options
|
|
94
|
+
);
|
|
75
95
|
};
|
|
76
96
|
var getGetDatasetsQueryKey = (params) => [
|
|
77
97
|
`/dataset`,
|
|
@@ -88,7 +108,10 @@ var useGetDatasets = (params, options) => {
|
|
|
88
108
|
return query;
|
|
89
109
|
};
|
|
90
110
|
var getVersions = (datasetId, params, options, signal) => {
|
|
91
|
-
return
|
|
111
|
+
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
112
|
+
{ url: `/dataset/${datasetId}/versions`, method: "get", params, signal },
|
|
113
|
+
options
|
|
114
|
+
);
|
|
92
115
|
};
|
|
93
116
|
var getGetVersionsQueryKey = (datasetId, params) => [`/dataset/${datasetId}/versions`, ...params ? [params] : []];
|
|
94
117
|
var useGetVersions = (datasetId, params, options) => {
|
|
@@ -97,18 +120,22 @@ var useGetVersions = (datasetId, params, options) => {
|
|
|
97
120
|
const queryFn = ({
|
|
98
121
|
signal
|
|
99
122
|
}) => getVersions(datasetId, params, requestOptions, signal);
|
|
100
|
-
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn,
|
|
101
|
-
enabled: !!datasetId
|
|
102
|
-
|
|
123
|
+
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, {
|
|
124
|
+
enabled: !!datasetId,
|
|
125
|
+
...queryOptions
|
|
126
|
+
});
|
|
103
127
|
query.queryKey = queryKey;
|
|
104
128
|
return query;
|
|
105
129
|
};
|
|
106
130
|
var deleteDataset = (datasetId, datasetVersion, params, options) => {
|
|
107
|
-
return
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
131
|
+
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
132
|
+
{
|
|
133
|
+
url: `/dataset/${datasetId}/${datasetVersion}`,
|
|
134
|
+
method: "delete",
|
|
135
|
+
params
|
|
136
|
+
},
|
|
137
|
+
options
|
|
138
|
+
);
|
|
112
139
|
};
|
|
113
140
|
var useDeleteDataset = (options) => {
|
|
114
141
|
const { mutation: mutationOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
@@ -119,7 +146,10 @@ var useDeleteDataset = (options) => {
|
|
|
119
146
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
120
147
|
};
|
|
121
148
|
var downloadDataset = (datasetId, datasetVersion, options, signal) => {
|
|
122
|
-
return
|
|
149
|
+
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
150
|
+
{ url: `/dataset/${datasetId}/${datasetVersion}`, method: "get", signal },
|
|
151
|
+
options
|
|
152
|
+
);
|
|
123
153
|
};
|
|
124
154
|
var getDownloadDatasetQueryKey = (datasetId, datasetVersion) => [`/dataset/${datasetId}/${datasetVersion}`];
|
|
125
155
|
var useDownloadDataset = (datasetId, datasetVersion, options) => {
|
|
@@ -128,14 +158,18 @@ var useDownloadDataset = (datasetId, datasetVersion, options) => {
|
|
|
128
158
|
const queryFn = ({
|
|
129
159
|
signal
|
|
130
160
|
}) => downloadDataset(datasetId, datasetVersion, requestOptions, signal);
|
|
131
|
-
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn,
|
|
132
|
-
enabled: !!(datasetId && datasetVersion)
|
|
133
|
-
|
|
161
|
+
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, {
|
|
162
|
+
enabled: !!(datasetId && datasetVersion),
|
|
163
|
+
...queryOptions
|
|
164
|
+
});
|
|
134
165
|
query.queryKey = queryKey;
|
|
135
166
|
return query;
|
|
136
167
|
};
|
|
137
168
|
var removeEditorFromDataset = (datasetId, userId, options) => {
|
|
138
|
-
return
|
|
169
|
+
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
170
|
+
{ url: `/dataset/${datasetId}/editor/${userId}`, method: "delete" },
|
|
171
|
+
options
|
|
172
|
+
);
|
|
139
173
|
};
|
|
140
174
|
var useRemoveEditorFromDataset = (options) => {
|
|
141
175
|
const { mutation: mutationOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
@@ -146,7 +180,10 @@ var useRemoveEditorFromDataset = (options) => {
|
|
|
146
180
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
147
181
|
};
|
|
148
182
|
var addEditorToDataset = (datasetId, userId, options) => {
|
|
149
|
-
return
|
|
183
|
+
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
184
|
+
{ url: `/dataset/${datasetId}/editor/${userId}`, method: "put" },
|
|
185
|
+
options
|
|
186
|
+
);
|
|
150
187
|
};
|
|
151
188
|
var useAddEditorToDataset = (options) => {
|
|
152
189
|
const { mutation: mutationOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
@@ -157,7 +194,10 @@ var useAddEditorToDataset = (options) => {
|
|
|
157
194
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
158
195
|
};
|
|
159
196
|
var getDatasetDigest = (datasetDigest, options, signal) => {
|
|
160
|
-
return
|
|
197
|
+
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
198
|
+
{ url: `/dataset/digest/${datasetDigest}`, method: "get", signal },
|
|
199
|
+
options
|
|
200
|
+
);
|
|
161
201
|
};
|
|
162
202
|
var getGetDatasetDigestQueryKey = (datasetDigest) => [
|
|
163
203
|
`/dataset/digest/${datasetDigest}`
|
|
@@ -166,18 +206,22 @@ var useGetDatasetDigest = (datasetDigest, options) => {
|
|
|
166
206
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
167
207
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetDatasetDigestQueryKey(datasetDigest)));
|
|
168
208
|
const queryFn = ({ signal }) => getDatasetDigest(datasetDigest, requestOptions, signal);
|
|
169
|
-
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn,
|
|
170
|
-
enabled: !!datasetDigest
|
|
171
|
-
|
|
209
|
+
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, {
|
|
210
|
+
enabled: !!datasetDigest,
|
|
211
|
+
...queryOptions
|
|
212
|
+
});
|
|
172
213
|
query.queryKey = queryKey;
|
|
173
214
|
return query;
|
|
174
215
|
};
|
|
175
216
|
var getSchema = (datasetId, datasetVersion, options, signal) => {
|
|
176
|
-
return
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
217
|
+
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
218
|
+
{
|
|
219
|
+
url: `/dataset/${datasetId}/schema/${datasetVersion}`,
|
|
220
|
+
method: "get",
|
|
221
|
+
signal
|
|
222
|
+
},
|
|
223
|
+
options
|
|
224
|
+
);
|
|
181
225
|
};
|
|
182
226
|
var getGetSchemaQueryKey = (datasetId, datasetVersion) => [`/dataset/${datasetId}/schema/${datasetVersion}`];
|
|
183
227
|
var useGetSchema = (datasetId, datasetVersion, options) => {
|
|
@@ -186,7 +230,11 @@ var useGetSchema = (datasetId, datasetVersion, options) => {
|
|
|
186
230
|
const queryFn = ({
|
|
187
231
|
signal
|
|
188
232
|
}) => getSchema(datasetId, datasetVersion, requestOptions, signal);
|
|
189
|
-
const query = _reactquery.useQuery.call(void 0,
|
|
233
|
+
const query = _reactquery.useQuery.call(void 0,
|
|
234
|
+
queryKey,
|
|
235
|
+
queryFn,
|
|
236
|
+
{ enabled: !!(datasetId && datasetVersion), ...queryOptions }
|
|
237
|
+
);
|
|
190
238
|
query.queryKey = queryKey;
|
|
191
239
|
return query;
|
|
192
240
|
};
|
package/dataset/dataset.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/dataset/dataset.ts"],"names":[],"mappings":";;;;;;AAUA;AA2CO,IAAM,wBAAwB,CACnC,oBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,gBAAgB,mBAAmB,YAAY;AAC/D,MAAI,mBAAmB,2BAA2B,QAAW;AAC3D,aAAS,OACP,0BACA,mBAAmB,sBACrB;AAAA,EACF;AACA,MAAI,mBAAmB,uBAAuB,QAAW;AACvD,aAAS,OACP,sBACA,mBAAmB,mBAAmB,SAAS,CACjD;AAAA,EACF;AACA,WAAS,OAAO,cAAc,mBAAmB,UAAU;AAC3D,WAAS,OAAO,QAAQ,mBAAmB,IAAI;AAC/C,WAAS,OAAO,aAAa,mBAAmB,SAAS;AACzD,MAAI,mBAAmB,eAAe,QAAW;AAC/C,aAAS,OAAO,cAAc,mBAAmB,UAAU;AAAA,EAC7D;AACA,MAAI,mBAAmB,YAAY,QAAW;AAC5C,aAAS,OAAO,WAAW,mBAAmB,OAAO;AAAA,EACvD;AAEA,SAAO,eACL;AAAA,IACE,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,IACjD,MAAM;AAAA,EACR,GACA,OACF;AACF;AAQO,IAAM,2BAA2B,CAGtC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,SAAS,CAAC;AAE3B,WAAO,sBAAsB,MAAM,cAAc;AAAA,EACnD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAcO,IAAM,gBAAgB,CAC3B,qBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,gBAAgB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AACH,SAAO,eACL,EAAE,KAAK,mBAAmB,iBAAiB,QAAQ,OAAO,OAAO,GACjE,OACF;AACF;AAEO,IAAM,8BAA8B,CAAC,kBAA0B;AAAA,EACpE,mBAAmB;AACrB;AAOO,IAAM,sBAAsB,CAIjC,eACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WACJ,8CAAc,aAAY,4BAA4B,aAAa;AAErE,QAAM,UAEF,CAAC,EAAE,aAAa,iBAAiB,eAAe,gBAAgB,MAAM;AAE1E,QAAM,QAAQ,SAIZ,UAAU,SAAS;AAAA,IACnB,SAAS,CAAC,CAAC;AAAA,KACR,aACJ;AAED,QAAM,WAAW;AAEjB,SAAO;AACT;AAOO,IAAM,YAAY,CACvB,WACA,gBACA,SACA,WACG;AACH,SAAO,eACL;AAAA,IACE,KAAK,YAAY,oBAAoB;AAAA,IACrC,QAAQ;AAAA,IACR;AAAA,EACF,GACA,OACF;AACF;AAEO,IAAM,uBAAuB,CAClC,WACA,mBACG,CAAC,YAAY,oBAAoB,gBAAgB;AAO/C,IAAM,eAAe,CAI1B,WACA,gBACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WACJ,8CAAc,aAAY,qBAAqB,WAAW,cAAc;AAE1E,QAAM,UAAgE,CAAC;AAAA,IACrE;AAAA,QACI,UAAU,WAAW,gBAAgB,gBAAgB,MAAM;AAEjE,QAAM,QAAQ,SACZ,UACA,SACA,iBAAE,SAAS,CAAC,CAAE,cAAa,mBAAoB,aACjD;AAEA,QAAM,WAAW;AAEjB,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.9.1 🍺\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 \"react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n DatasetPutPostResponse,\n DmError,\n DatasetPutBodyBody,\n DatasetPostBodyBody,\n DatasetsGetResponse,\n GetDatasetsParams,\n DatasetVersionsGetResponse,\n GetVersionsParams,\n DatasetVersionDeleteResponse,\n DeleteDatasetParams,\n DatasetDigestGetResponse,\n DatasetSchemaGetResponse,\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 * Using an unmanaged file in a Project as a source a Dataset (or new Dataset version) is created.\n\nThe 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.\n\nBehaves like the corresponding **POST** method except the file is expected to exist on a Project path.\n\n * @summary Create a Dataset from a file in a Project\n */\nexport const createDatasetFromFile = (\n datasetPutBodyBody: DatasetPutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_type\", datasetPutBodyBody.dataset_type);\n if (datasetPutBodyBody.format_extra_variables !== undefined) {\n formData.append(\n \"format_extra_variables\",\n datasetPutBodyBody.format_extra_variables\n );\n }\n if (datasetPutBodyBody.skip_molecule_load !== undefined) {\n formData.append(\n \"skip_molecule_load\",\n datasetPutBodyBody.skip_molecule_load.toString()\n );\n }\n formData.append(\"project_id\", datasetPutBodyBody.project_id);\n formData.append(\"path\", datasetPutBodyBody.path);\n formData.append(\"file_name\", datasetPutBodyBody.file_name);\n if (datasetPutBodyBody.dataset_id !== undefined) {\n formData.append(\"dataset_id\", datasetPutBodyBody.dataset_id);\n }\n if (datasetPutBodyBody.unit_id !== undefined) {\n formData.append(\"unit_id\", datasetPutBodyBody.unit_id);\n }\n\n return customInstance<DatasetPutPostResponse>(\n {\n url: `/dataset`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateDatasetFromFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof createDatasetFromFile>>\n>;\nexport type CreateDatasetFromFileMutationBody = DatasetPutBodyBody;\nexport type CreateDatasetFromFileMutationError = ErrorType<void | DmError>;\n\nexport const useCreateDatasetFromFile = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n TError,\n { data: DatasetPutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n { data: DatasetPutBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createDatasetFromFile(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n TError,\n { data: DatasetPutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Uploads a dataset.\n\nDataset 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.\n\nDatasets can be uploaded in an uncompressed form, or uploaded pre-compressed using the `.gz` extension.\n\nThe 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.\n\nDatasets 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.\n\n * @summary Upload an external file as a Dataset\n */\nexport const uploadDataset = (\n datasetPostBodyBody: DatasetPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_file\", datasetPostBodyBody.dataset_file);\n formData.append(\"dataset_type\", datasetPostBodyBody.dataset_type);\n if (datasetPostBodyBody.format_extra_variables !== undefined) {\n formData.append(\n \"format_extra_variables\",\n datasetPostBodyBody.format_extra_variables\n );\n }\n if (datasetPostBodyBody.skip_molecule_load !== undefined) {\n formData.append(\n \"skip_molecule_load\",\n datasetPostBodyBody.skip_molecule_load.toString()\n );\n }\n if (datasetPostBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", datasetPostBodyBody.as_filename);\n }\n if (datasetPostBodyBody.dataset_id !== undefined) {\n formData.append(\"dataset_id\", datasetPostBodyBody.dataset_id);\n }\n formData.append(\"unit_id\", datasetPostBodyBody.unit_id);\n\n return customInstance<DatasetPutPostResponse>(\n {\n url: `/dataset`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type UploadDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof uploadDataset>>\n>;\nexport type UploadDatasetMutationBody = DatasetPostBodyBody;\nexport type UploadDatasetMutationError = ErrorType<void | DmError>;\n\nexport const useUploadDataset = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof uploadDataset>>,\n TError,\n { data: DatasetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof uploadDataset>>,\n { data: DatasetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return uploadDataset(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof uploadDataset>>,\n TError,\n { data: DatasetPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns datasets that you have access to, whether attached to a project or not.\n\nYou will not see Datasets while their upload is still in progress.\n\nDatasets can be filtered by: 1. `owner username`, 2. `mime_type`, 3. a list of `owners` (a subset of the above) 4. a list of `editors` (a subset of the above) 5. `Labels` or `Label/Value` pairs (a subset of the above)\n\nNote 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.\n\n * @summary Get datasets that are available to you\n */\nexport const getDatasets = (\n params?: GetDatasetsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetsGetResponse>(\n { url: `/dataset`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetDatasetsQueryKey = (params?: GetDatasetsParams) => [\n `/dataset`,\n ...(params ? [params] : []),\n];\n\nexport type GetDatasetsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDatasets>>\n>;\nexport type GetDatasetsQueryError = ErrorType<void | DmError>;\n\nexport const useGetDatasets = <\n TData = Awaited<ReturnType<typeof getDatasets>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetDatasetsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getDatasets>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetDatasetsQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getDatasets>>> = ({\n signal,\n }) => getDatasets(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getDatasets>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Returns a list of Dataset versions.\n\nYou will not see Datasets while their upload is still in progress.\n\n * @summary Gets all the versions of a specific Dataset\n */\nexport const getVersions = (\n datasetId: string,\n params?: GetVersionsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetVersionsGetResponse>(\n { url: `/dataset/${datasetId}/versions`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetVersionsQueryKey = (\n datasetId: string,\n params?: GetVersionsParams\n) => [`/dataset/${datasetId}/versions`, ...(params ? [params] : [])];\n\nexport type GetVersionsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getVersions>>\n>;\nexport type GetVersionsQueryError = ErrorType<void | DmError>;\n\nexport const useGetVersions = <\n TData = Awaited<ReturnType<typeof getVersions>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n params?: GetVersionsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getVersions>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetVersionsQueryKey(datasetId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getVersions>>> = ({\n signal,\n }) => getVersions(datasetId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getVersions>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!datasetId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Given the Dataset `id` and `version` the Dataset will be removed. The API does not prevent you removing a Dataset that's been used in a **Project**. When removed using this endpoint the Dataset is automatically detached from any and all Projects that it was attached to and any corresponding Project Files relating to the Dataset are also removed.\n\nYou must be an `editor` or `owner` of the Dataset.\n\nYou cannot delete a Dataset until its upload is complete.\n\n * @summary Delete a dataset\n */\nexport const deleteDataset = (\n datasetId: string,\n datasetVersion: number,\n params?: DeleteDatasetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<DatasetVersionDeleteResponse>(\n {\n url: `/dataset/${datasetId}/${datasetVersion}`,\n method: \"delete\",\n params,\n },\n options\n );\n};\n\nexport type DeleteDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteDataset>>\n>;\n\nexport type DeleteDatasetMutationError = ErrorType<void | DmError>;\n\nexport const useDeleteDataset = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteDataset>>,\n TError,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteDataset>>,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams }\n > = (props) => {\n const { datasetId, datasetVersion, params } = props ?? {};\n\n return deleteDataset(datasetId, datasetVersion, params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteDataset>>,\n TError,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Given a `dataset_id` the dataset will be returned if available.\n\nYou cannot get a Dataset until its upload is complete.\n\n * @summary Download a dataset\n */\nexport const downloadDataset = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/${datasetVersion}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getDownloadDatasetQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/${datasetVersion}`];\n\nexport type DownloadDatasetQueryResult = NonNullable<\n Awaited<ReturnType<typeof downloadDataset>>\n>;\nexport type DownloadDatasetQueryError = ErrorType<DmError>;\n\nexport const useDownloadDataset = <\n TData = Awaited<ReturnType<typeof downloadDataset>>,\n TError = ErrorType<DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadDataset>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getDownloadDatasetQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadDataset>>> = ({\n signal,\n }) => downloadDataset(datasetId, datasetVersion, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof downloadDataset>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!(datasetId && datasetVersion),\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * The user is removed from the Dataset's `editor` list. The user is removed from all versions of a dataset. You can remove yourself but an `owner` (creator) will always have access to the dataset.\n\nYou must be an `editor` or `owner` of the dataset.\n\nYou cannot modify Dataset editors until its upload is complete.\n\n * @summary Remove a user's edit permission for a Dataset\n */\nexport const removeEditorFromDataset = (\n datasetId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/editor/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type RemoveEditorFromDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeEditorFromDataset>>\n>;\n\nexport type RemoveEditorFromDatasetMutationError = ErrorType<DmError>;\n\nexport const useRemoveEditorFromDataset = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n { datasetId: string; userId: string }\n > = (props) => {\n const { datasetId, userId } = props ?? {};\n\n return removeEditorFromDataset(datasetId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * 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`.\n\nYou must be an `editor` or `owner` of the dataset.\n\nYou cannot modify Dataset editors until its upload is complete.\n\n * @summary Give a user edit permission for a dataset\n */\nexport const addEditorToDataset = (\n datasetId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/editor/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddEditorToDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof addEditorToDataset>>\n>;\n\nexport type AddEditorToDatasetMutationError = ErrorType<DmError>;\n\nexport const useAddEditorToDataset = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n { datasetId: string; userId: string }\n > = (props) => {\n const { datasetId, userId } = props ?? {};\n\n return addEditorToDataset(datasetId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns a dataset ID and version of a dataset that matches the provided SHA256 digest, a 64-character hex string.\n\n * @summary Gets the first Dataset that matches the provided digest\n */\nexport const getDatasetDigest = (\n datasetDigest: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetDigestGetResponse>(\n { url: `/dataset/digest/${datasetDigest}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetDatasetDigestQueryKey = (datasetDigest: string) => [\n `/dataset/digest/${datasetDigest}`,\n];\n\nexport type GetDatasetDigestQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDatasetDigest>>\n>;\nexport type GetDatasetDigestQueryError = ErrorType<void | DmError>;\n\nexport const useGetDatasetDigest = <\n TData = Awaited<ReturnType<typeof getDatasetDigest>>,\n TError = ErrorType<void | DmError>\n>(\n datasetDigest: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getDatasetDigest>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetDatasetDigestQueryKey(datasetDigest);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getDatasetDigest>>\n > = ({ signal }) => getDatasetDigest(datasetDigest, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getDatasetDigest>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!datasetDigest,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Returns the property schema for a Dataset versions in JSON format (if available).\n\n * @summary Gets the property schema for a specific Dataset\n */\nexport const getSchema = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetSchemaGetResponse>(\n {\n url: `/dataset/${datasetId}/schema/${datasetVersion}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetSchemaQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/schema/${datasetVersion}`];\n\nexport type GetSchemaQueryResult = NonNullable<\n Awaited<ReturnType<typeof getSchema>>\n>;\nexport type GetSchemaQueryError = ErrorType<void | DmError>;\n\nexport const useGetSchema = <\n TData = Awaited<ReturnType<typeof getSchema>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getSchema>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetSchemaQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getSchema>>> = ({\n signal,\n }) => getSchema(datasetId, datasetVersion, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getSchema>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(datasetId && datasetVersion), ...queryOptions }\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/dataset/dataset.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AA2C/B,IAAM,wBAAwB,CACnC,oBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,gBAAgB,mBAAmB,YAAY;AAC/D,MAAI,mBAAmB,2BAA2B,QAAW;AAC3D,aAAS;AAAA,MACP;AAAA,MACA,mBAAmB;AAAA,IACrB;AAAA,EACF;AACA,MAAI,mBAAmB,uBAAuB,QAAW;AACvD,aAAS;AAAA,MACP;AAAA,MACA,mBAAmB,mBAAmB,SAAS;AAAA,IACjD;AAAA,EACF;AACA,WAAS,OAAO,cAAc,mBAAmB,UAAU;AAC3D,WAAS,OAAO,QAAQ,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AW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,4BAA4B,aAAa;AAErE,QAAM,UAEF,CAAC,EAAE,OAAO,MAAM,iBAAiB,eAAe,gBAAgB,MAAM;AAE1E,QAAM,QAAQ,SAIZ,UAAU,SAAS;AAAA,IACnB,SAAS,CAAC,CAAC;AAAA,IACX,GAAG;AAAA,EACL,CAAC;AAED,QAAM,WAAW;AAEjB,SAAO;AACT;AAOO,IAAM,YAAY,CACvB,WACA,gBACA,SACA,WACG;AACH,SAAO;AAAA,IACL;AAAA,MACE,KAAK,YAAY,oBAAoB;AAAA,MACrC,QAAQ;AAAA,MACR;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;AAEO,IAAM,uBAAuB,CAClC,WACA,mBACG,CAAC,YAAY,oBAAoB,gBAAgB;AAO/C,IAAM,eAAe,CAI1B,WACA,gBACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,qBAAqB,WAAW,cAAc;AAE1E,QAAM,UAAgE,CAAC;AAAA,IACrE;AAAA,EACF,MAAM,UAAU,WAAW,gBAAgB,gBAAgB,MAAM;AAEjE,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,IACA,EAAE,SAAS,CAAC,EAAE,aAAa,iBAAiB,GAAG,aAAa;AAAA,EAC9D;AAEA,QAAM,WAAW;AAEjB,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.9.1 🍺\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 \"react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n DatasetPutPostResponse,\n DmError,\n DatasetPutBodyBody,\n DatasetPostBodyBody,\n DatasetsGetResponse,\n GetDatasetsParams,\n DatasetVersionsGetResponse,\n GetVersionsParams,\n DatasetVersionDeleteResponse,\n DeleteDatasetParams,\n DatasetDigestGetResponse,\n DatasetSchemaGetResponse,\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 * Using an unmanaged file in a Project as a source a Dataset (or new Dataset version) is created.\n\nThe 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.\n\nBehaves like the corresponding **POST** method except the file is expected to exist on a Project path.\n\n * @summary Create a Dataset from a file in a Project\n */\nexport const createDatasetFromFile = (\n datasetPutBodyBody: DatasetPutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_type\", datasetPutBodyBody.dataset_type);\n if (datasetPutBodyBody.format_extra_variables !== undefined) {\n formData.append(\n \"format_extra_variables\",\n datasetPutBodyBody.format_extra_variables\n );\n }\n if (datasetPutBodyBody.skip_molecule_load !== undefined) {\n formData.append(\n \"skip_molecule_load\",\n datasetPutBodyBody.skip_molecule_load.toString()\n );\n }\n formData.append(\"project_id\", datasetPutBodyBody.project_id);\n formData.append(\"path\", datasetPutBodyBody.path);\n formData.append(\"file_name\", datasetPutBodyBody.file_name);\n if (datasetPutBodyBody.dataset_id !== undefined) {\n formData.append(\"dataset_id\", datasetPutBodyBody.dataset_id);\n }\n if (datasetPutBodyBody.unit_id !== undefined) {\n formData.append(\"unit_id\", datasetPutBodyBody.unit_id);\n }\n\n return customInstance<DatasetPutPostResponse>(\n {\n url: `/dataset`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateDatasetFromFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof createDatasetFromFile>>\n>;\nexport type CreateDatasetFromFileMutationBody = DatasetPutBodyBody;\nexport type CreateDatasetFromFileMutationError = ErrorType<void | DmError>;\n\nexport const useCreateDatasetFromFile = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n TError,\n { data: DatasetPutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n { data: DatasetPutBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createDatasetFromFile(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n TError,\n { data: DatasetPutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Uploads a dataset.\n\nDataset 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.\n\nDatasets can be uploaded in an uncompressed form, or uploaded pre-compressed using the `.gz` extension.\n\nThe 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.\n\nDatasets 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.\n\n * @summary Upload an external file as a Dataset\n */\nexport const uploadDataset = (\n datasetPostBodyBody: DatasetPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_file\", datasetPostBodyBody.dataset_file);\n formData.append(\"dataset_type\", datasetPostBodyBody.dataset_type);\n if (datasetPostBodyBody.format_extra_variables !== undefined) {\n formData.append(\n \"format_extra_variables\",\n datasetPostBodyBody.format_extra_variables\n );\n }\n if (datasetPostBodyBody.skip_molecule_load !== undefined) {\n formData.append(\n \"skip_molecule_load\",\n datasetPostBodyBody.skip_molecule_load.toString()\n );\n }\n if (datasetPostBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", datasetPostBodyBody.as_filename);\n }\n if (datasetPostBodyBody.dataset_id !== undefined) {\n formData.append(\"dataset_id\", datasetPostBodyBody.dataset_id);\n }\n formData.append(\"unit_id\", datasetPostBodyBody.unit_id);\n\n return customInstance<DatasetPutPostResponse>(\n {\n url: `/dataset`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type UploadDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof uploadDataset>>\n>;\nexport type UploadDatasetMutationBody = DatasetPostBodyBody;\nexport type UploadDatasetMutationError = ErrorType<void | DmError>;\n\nexport const useUploadDataset = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof uploadDataset>>,\n TError,\n { data: DatasetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof uploadDataset>>,\n { data: DatasetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return uploadDataset(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof uploadDataset>>,\n TError,\n { data: DatasetPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns datasets that you have access to, whether attached to a project or not.\n\nYou will not see Datasets while their upload is still in progress.\n\nDatasets can be filtered by: 1. `owner username`, 2. `mime_type`, 3. a list of `owners` (a subset of the above) 4. a list of `editors` (a subset of the above) 5. `Labels` or `Label/Value` pairs (a subset of the above)\n\nNote 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.\n\n * @summary Get Datasets that are available to you\n */\nexport const getDatasets = (\n params?: GetDatasetsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetsGetResponse>(\n { url: `/dataset`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetDatasetsQueryKey = (params?: GetDatasetsParams) => [\n `/dataset`,\n ...(params ? [params] : []),\n];\n\nexport type GetDatasetsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDatasets>>\n>;\nexport type GetDatasetsQueryError = ErrorType<void | DmError>;\n\nexport const useGetDatasets = <\n TData = Awaited<ReturnType<typeof getDatasets>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetDatasetsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getDatasets>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetDatasetsQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getDatasets>>> = ({\n signal,\n }) => getDatasets(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getDatasets>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Returns a list of Dataset versions.\n\nYou will not see Datasets while their upload is still in progress.\n\n * @summary Gets all the versions of a specific Dataset\n */\nexport const getVersions = (\n datasetId: string,\n params?: GetVersionsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetVersionsGetResponse>(\n { url: `/dataset/${datasetId}/versions`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetVersionsQueryKey = (\n datasetId: string,\n params?: GetVersionsParams\n) => [`/dataset/${datasetId}/versions`, ...(params ? [params] : [])];\n\nexport type GetVersionsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getVersions>>\n>;\nexport type GetVersionsQueryError = ErrorType<void | DmError>;\n\nexport const useGetVersions = <\n TData = Awaited<ReturnType<typeof getVersions>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n params?: GetVersionsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getVersions>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetVersionsQueryKey(datasetId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getVersions>>> = ({\n signal,\n }) => getVersions(datasetId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getVersions>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!datasetId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Given the Dataset `id` and `version` the Dataset will be removed. The API does not prevent you removing a Dataset that's been used in a **Project**. When removed using this endpoint the Dataset is automatically detached from any and all Projects that it was attached to and any corresponding Project Files relating to the Dataset are also removed.\n\nYou must be an `editor` or `owner` of the Dataset.\n\nYou cannot delete a Dataset until its upload is complete.\n\n * @summary Delete a Dataset\n */\nexport const deleteDataset = (\n datasetId: string,\n datasetVersion: number,\n params?: DeleteDatasetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<DatasetVersionDeleteResponse>(\n {\n url: `/dataset/${datasetId}/${datasetVersion}`,\n method: \"delete\",\n params,\n },\n options\n );\n};\n\nexport type DeleteDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteDataset>>\n>;\n\nexport type DeleteDatasetMutationError = ErrorType<void | DmError>;\n\nexport const useDeleteDataset = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteDataset>>,\n TError,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteDataset>>,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams }\n > = (props) => {\n const { datasetId, datasetVersion, params } = props ?? {};\n\n return deleteDataset(datasetId, datasetVersion, params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteDataset>>,\n TError,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Given a `dataset_id` the dataset will be returned if available.\n\nYou cannot get a Dataset until its upload is complete.\n\n * @summary Download a Dataset\n */\nexport const downloadDataset = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/${datasetVersion}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getDownloadDatasetQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/${datasetVersion}`];\n\nexport type DownloadDatasetQueryResult = NonNullable<\n Awaited<ReturnType<typeof downloadDataset>>\n>;\nexport type DownloadDatasetQueryError = ErrorType<DmError>;\n\nexport const useDownloadDataset = <\n TData = Awaited<ReturnType<typeof downloadDataset>>,\n TError = ErrorType<DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadDataset>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getDownloadDatasetQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadDataset>>> = ({\n signal,\n }) => downloadDataset(datasetId, datasetVersion, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof downloadDataset>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!(datasetId && datasetVersion),\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * The user is removed from the Dataset's `editor` list. The user is removed from all versions of a dataset. You can remove yourself but an `owner` (creator) will always have access to the dataset.\n\nYou must be an `editor` or `owner` of the dataset.\n\nYou cannot modify Dataset editors until its upload is complete.\n\n * @summary Remove a user's edit permission for a Dataset\n */\nexport const removeEditorFromDataset = (\n datasetId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/editor/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type RemoveEditorFromDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeEditorFromDataset>>\n>;\n\nexport type RemoveEditorFromDatasetMutationError = ErrorType<DmError>;\n\nexport const useRemoveEditorFromDataset = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n { datasetId: string; userId: string }\n > = (props) => {\n const { datasetId, userId } = props ?? {};\n\n return removeEditorFromDataset(datasetId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * 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`.\n\nYou must be an `editor` or `owner` of the dataset.\n\nYou cannot modify Dataset editors until its upload is complete.\n\n * @summary Give a user edit permission for a Dataset\n */\nexport const addEditorToDataset = (\n datasetId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/editor/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddEditorToDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof addEditorToDataset>>\n>;\n\nexport type AddEditorToDatasetMutationError = ErrorType<DmError>;\n\nexport const useAddEditorToDataset = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n { datasetId: string; userId: string }\n > = (props) => {\n const { datasetId, userId } = props ?? {};\n\n return addEditorToDataset(datasetId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns a dataset ID and version of a dataset that matches the provided SHA256 digest, a 64-character hex string.\n\n * @summary Gets the first Dataset that matches the provided digest\n */\nexport const getDatasetDigest = (\n datasetDigest: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetDigestGetResponse>(\n { url: `/dataset/digest/${datasetDigest}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetDatasetDigestQueryKey = (datasetDigest: string) => [\n `/dataset/digest/${datasetDigest}`,\n];\n\nexport type GetDatasetDigestQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDatasetDigest>>\n>;\nexport type GetDatasetDigestQueryError = ErrorType<void | DmError>;\n\nexport const useGetDatasetDigest = <\n TData = Awaited<ReturnType<typeof getDatasetDigest>>,\n TError = ErrorType<void | DmError>\n>(\n datasetDigest: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getDatasetDigest>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetDatasetDigestQueryKey(datasetDigest);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getDatasetDigest>>\n > = ({ signal }) => getDatasetDigest(datasetDigest, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getDatasetDigest>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!datasetDigest,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Returns the property schema for a Dataset versions in JSON format (if available).\n\n * @summary Gets the property schema for a specific Dataset\n */\nexport const getSchema = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetSchemaGetResponse>(\n {\n url: `/dataset/${datasetId}/schema/${datasetVersion}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetSchemaQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/schema/${datasetVersion}`];\n\nexport type GetSchemaQueryResult = NonNullable<\n Awaited<ReturnType<typeof getSchema>>\n>;\nexport type GetSchemaQueryError = ErrorType<void | DmError>;\n\nexport const useGetSchema = <\n TData = Awaited<ReturnType<typeof getSchema>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getSchema>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetSchemaQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getSchema>>> = ({\n signal,\n }) => getSchema(datasetId, datasetVersion, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getSchema>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(datasetId && datasetVersion), ...queryOptions }\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"]}
|
package/dataset/dataset.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a4 as DatasetPutBodyBody,
|
|
1
|
+
import { a4 as DatasetPutBodyBody, bB as customInstance, bp as DatasetPutPostResponse, bC as ErrorType, bx as DmError, a7 as DatasetPostBodyBody, n as GetDatasetsParams, bi as DatasetsGetResponse, m as GetVersionsParams, aM as DatasetDetail, l as DeleteDatasetParams, ai as TaskIdentity, bo as DatasetDigestGetResponse, bm as DatasetSchemaGetResponse } from '../custom-instance-3a73945d.js';
|
|
2
2
|
import * as react_query from 'react-query';
|
|
3
3
|
import { UseMutationOptions, UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
|
|
4
4
|
import 'axios';
|
|
@@ -59,7 +59,7 @@ Datasets can be filtered by: 1. `owner username`, 2. `mime_type`, 3. a list of `
|
|
|
59
59
|
|
|
60
60
|
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.
|
|
61
61
|
|
|
62
|
-
* @summary Get
|
|
62
|
+
* @summary Get Datasets that are available to you
|
|
63
63
|
*/
|
|
64
64
|
declare const getDatasets: (params?: GetDatasetsParams | undefined, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<DatasetsGetResponse>;
|
|
65
65
|
declare const getGetDatasetsQueryKey: (params?: GetDatasetsParams | undefined) => (string | GetDatasetsParams)[];
|
|
@@ -95,7 +95,7 @@ You must be an `editor` or `owner` of the Dataset.
|
|
|
95
95
|
|
|
96
96
|
You cannot delete a Dataset until its upload is complete.
|
|
97
97
|
|
|
98
|
-
* @summary Delete a
|
|
98
|
+
* @summary Delete a Dataset
|
|
99
99
|
*/
|
|
100
100
|
declare const deleteDataset: (datasetId: string, datasetVersion: number, params?: DeleteDatasetParams | undefined, options?: SecondParameter<typeof customInstance>) => Promise<TaskIdentity>;
|
|
101
101
|
declare type DeleteDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof deleteDataset>>>;
|
|
@@ -117,7 +117,7 @@ declare const useDeleteDataset: <TError = ErrorType<void | DmError>, TContext =
|
|
|
117
117
|
|
|
118
118
|
You cannot get a Dataset until its upload is complete.
|
|
119
119
|
|
|
120
|
-
* @summary Download a
|
|
120
|
+
* @summary Download a Dataset
|
|
121
121
|
*/
|
|
122
122
|
declare const downloadDataset: (datasetId: string, datasetVersion: number, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<void>;
|
|
123
123
|
declare const getDownloadDatasetQueryKey: (datasetId: string, datasetVersion: number) => string[];
|
|
@@ -158,7 +158,7 @@ You must be an `editor` or `owner` of the dataset.
|
|
|
158
158
|
|
|
159
159
|
You cannot modify Dataset editors until its upload is complete.
|
|
160
160
|
|
|
161
|
-
* @summary Give a user edit permission for a
|
|
161
|
+
* @summary Give a user edit permission for a Dataset
|
|
162
162
|
*/
|
|
163
163
|
declare const addEditorToDataset: (datasetId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
164
164
|
declare type AddEditorToDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof addEditorToDataset>>>;
|