@squonk/data-manager-client 0.6.10-rc.1 → 0.6.14-rc.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/admin/admin.d.ts +1 -1
- package/application/application.d.ts +1 -1
- package/{custom-instance-538e33c9.d.ts → custom-instance-82d281a3.d.ts} +19 -40
- package/dataset/dataset.cjs +1 -1
- package/dataset/dataset.cjs.map +2 -2
- package/dataset/dataset.d.ts +4 -4
- package/dataset/dataset.js +1 -1
- package/dataset/dataset.js.map +2 -2
- package/file/file.cjs +1 -1
- package/file/file.cjs.map +2 -2
- package/file/file.d.ts +4 -4
- package/file/file.js +1 -1
- package/file/file.js.map +2 -2
- package/index.cjs +1 -1
- package/index.cjs.map +2 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.js.map +2 -2
- package/instance/instance.d.ts +1 -1
- package/job/job.d.ts +1 -1
- package/package.json +1 -1
- package/project/project.cjs +1 -1
- package/project/project.cjs.map +2 -2
- package/project/project.d.ts +4 -4
- package/project/project.js +1 -1
- package/project/project.js.map +2 -2
- package/task/task.d.ts +1 -1
- package/type/type.d.ts +1 -1
- package/user/user.d.ts +1 -1
package/admin/admin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b1 as AdminGetServiceErrorsParams, b5 as customInstance, S as ServiceErrorsGetResponse, E as Error, aj as UserAccountDetail, av as UserPatchBodyBody } from '../custom-instance-82d281a3';
|
|
2
2
|
import * as react_query from 'react-query';
|
|
3
3
|
import { UseQueryOptions, UseMutationOptions } from 'react-query';
|
|
4
4
|
import 'axios';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_query from 'react-query';
|
|
2
2
|
import { UseQueryOptions } from 'react-query';
|
|
3
|
-
import {
|
|
3
|
+
import { b5 as customInstance, b as ApplicationsGetResponse, E as Error, a as ApplicationGetResponse } from '../custom-instance-82d281a3';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
|
@@ -16,11 +16,6 @@ interface Error {
|
|
|
16
16
|
*/
|
|
17
17
|
error: string;
|
|
18
18
|
}
|
|
19
|
-
interface AdminUserSubscriptionPostResponse {
|
|
20
|
-
/** A unique ID for the subscription
|
|
21
|
-
*/
|
|
22
|
-
subscription_id: string;
|
|
23
|
-
}
|
|
24
19
|
declare type AdminUserPutResponse = UserAccountDetail;
|
|
25
20
|
interface ApplicationGetResponse {
|
|
26
21
|
/** The Application's unique ID
|
|
@@ -190,6 +185,9 @@ interface InstanceGetResponse {
|
|
|
190
185
|
/** The optional application specification. For **Applications** this is returned verbatim. For **Jobs** additional material will be found.
|
|
191
186
|
*/
|
|
192
187
|
application_specification?: string;
|
|
188
|
+
/** The code obtained from the Account Server
|
|
189
|
+
*/
|
|
190
|
+
authorisation_code?: number;
|
|
193
191
|
/** The application owner, the person who launched tha apllication and is the only user than can stop it.
|
|
194
192
|
*/
|
|
195
193
|
owner: string;
|
|
@@ -342,11 +340,6 @@ interface TaskGetResponse {
|
|
|
342
340
|
*/
|
|
343
341
|
events?: TaskEvent[];
|
|
344
342
|
}
|
|
345
|
-
interface ProjectTierTemplateGetResponse {
|
|
346
|
-
/** A list of available Project Tier templates
|
|
347
|
-
*/
|
|
348
|
-
project_tier_templates: ProjectTierTemplateDetail[];
|
|
349
|
-
}
|
|
350
343
|
interface TasksGetResponse {
|
|
351
344
|
/** A list of Tasks
|
|
352
345
|
*/
|
|
@@ -505,6 +498,9 @@ interface DatasetVersionDetail {
|
|
|
505
498
|
/** The size, in bytes, of the formatted Dataset
|
|
506
499
|
*/
|
|
507
500
|
size?: number;
|
|
501
|
+
/** The code obtained from the Account Server
|
|
502
|
+
*/
|
|
503
|
+
authorisation_code?: number;
|
|
508
504
|
}
|
|
509
505
|
interface DatasetVersionProjectFile {
|
|
510
506
|
project_name: string;
|
|
@@ -569,6 +565,9 @@ interface DatasetVersionSummary {
|
|
|
569
565
|
/** The size, in bytes, of the formatted Dataset
|
|
570
566
|
*/
|
|
571
567
|
size?: number;
|
|
568
|
+
/** The code obtained from the Account Server
|
|
569
|
+
*/
|
|
570
|
+
authorisation_code?: number;
|
|
572
571
|
}
|
|
573
572
|
interface FilePathFile {
|
|
574
573
|
/** The file's Dataset ID (if the file belongs to a Dataset)
|
|
@@ -592,6 +591,9 @@ interface FilePathFile {
|
|
|
592
591
|
/** The file's owner
|
|
593
592
|
*/
|
|
594
593
|
owner: string;
|
|
594
|
+
/** The code obtained from the Account Server
|
|
595
|
+
*/
|
|
596
|
+
authorisation_code?: number;
|
|
595
597
|
stat: FileStat;
|
|
596
598
|
}
|
|
597
599
|
interface FileStat {
|
|
@@ -648,6 +650,9 @@ interface InstanceSummary {
|
|
|
648
650
|
/** The type of Application, which can be a `job` or an `application`
|
|
649
651
|
*/
|
|
650
652
|
application_type: InstanceSummaryApplicationType;
|
|
653
|
+
/** The code obtained from the Account Server
|
|
654
|
+
*/
|
|
655
|
+
authorisation_code?: number;
|
|
651
656
|
/** The state of the application. This is a string, one of a limited number of values that are defined internally within the Data Manager. Key states are `PENDING` for an instance that is starting (but has not started), `STARTED` for an instance that has started, `SUCCESS` for an instance that has finished (and started and finished successfully) and `FAILURE` for an instance that has finished but failed in some way
|
|
652
657
|
*/
|
|
653
658
|
state: InstanceSummaryState;
|
|
@@ -774,6 +779,9 @@ interface ProjectDetail {
|
|
|
774
779
|
files?: ProjectFileDetail[];
|
|
775
780
|
}
|
|
776
781
|
interface ProjectFileDetail {
|
|
782
|
+
/** The code obtained from the Account Server
|
|
783
|
+
*/
|
|
784
|
+
authorisation_code?: number;
|
|
777
785
|
/** The ProjectFile's Dataset origin
|
|
778
786
|
*/
|
|
779
787
|
dataset_id?: string;
|
|
@@ -802,35 +810,6 @@ interface ProjectFileDetail {
|
|
|
802
810
|
*/
|
|
803
811
|
mime_type: string;
|
|
804
812
|
}
|
|
805
|
-
declare type ProjectTierTemplateDetailTier = "EVALUATION" | "BRONZE" | "SILVER" | "GOLD";
|
|
806
|
-
declare const ProjectTierTemplateDetailTier: {
|
|
807
|
-
EVALUATION: ProjectTierTemplateDetailTier;
|
|
808
|
-
BRONZE: ProjectTierTemplateDetailTier;
|
|
809
|
-
SILVER: ProjectTierTemplateDetailTier;
|
|
810
|
-
GOLD: ProjectTierTemplateDetailTier;
|
|
811
|
-
};
|
|
812
|
-
interface ProjectTierTemplateDetail {
|
|
813
|
-
tier: ProjectTierTemplateDetailTier;
|
|
814
|
-
can_be_private: boolean;
|
|
815
|
-
cpu_cap: number;
|
|
816
|
-
gpu_cap: number;
|
|
817
|
-
memory_cap: string;
|
|
818
|
-
concurrent_app_instance_cap: number;
|
|
819
|
-
concurrent_job_instance_cap: number;
|
|
820
|
-
storage: string;
|
|
821
|
-
can_change_cpu_cap: boolean;
|
|
822
|
-
can_change_gpu_cap: boolean;
|
|
823
|
-
can_change_memory_cap: boolean;
|
|
824
|
-
can_change_concurrent_app_instance_cap: boolean;
|
|
825
|
-
can_change_concurrent_job_instance_cap: boolean;
|
|
826
|
-
can_change_storage: boolean;
|
|
827
|
-
max_cpu?: number;
|
|
828
|
-
max_gpu?: number;
|
|
829
|
-
max_memory?: string;
|
|
830
|
-
max_concurrent_app_instance?: number;
|
|
831
|
-
max_concurrent_job_instance?: number;
|
|
832
|
-
max_storage?: string;
|
|
833
|
-
}
|
|
834
813
|
declare type ServiceErrorSummarySeverity = "CRITICAL" | "ERROR" | "WARNING";
|
|
835
814
|
declare const ServiceErrorSummarySeverity: {
|
|
836
815
|
CRITICAL: ServiceErrorSummarySeverity;
|
|
@@ -1349,4 +1328,4 @@ declare const setAuthToken: (token: string) => void;
|
|
|
1349
1328
|
declare const setBaseUrl: (baseUrl: string) => void;
|
|
1350
1329
|
declare const customInstance: <TReturn>(config: AxiosRequestConfig, options?: AxiosRequestConfig<any> | undefined) => Promise<TReturn>;
|
|
1351
1330
|
|
|
1352
|
-
export {
|
|
1331
|
+
export { InstanceSummary as $, AdminUserPutResponse as A, ApiLogDetailMethod as B, ApiLogDetail as C, DatasetAnnotationsPostResponse as D, Error as E, FilePostResponse as F, ApplicationSummary as G, DatasetDetail as H, InstanceDeleteResponse as I, JobGetResponseImageType as J, DatasetSummary as K, DatasetVersionDetailProcessingStage as L, DatasetVersionDetailLabels as M, DatasetVersionDetail as N, DatasetVersionProjectFile as O, ProjectDeleteResponse as P, DatasetVersionSummaryProcessingStage as Q, DatasetVersionSummaryLabels as R, ServiceErrorsGetResponse as S, TaskGetResponsePurpose as T, UserAccountGetResponse as U, DatasetVersionSummary as V, FilePathFile as W, FileStat as X, InstanceSummaryApplicationType as Y, InstanceSummaryState as Z, InstanceSummaryJobImageType as _, ApplicationGetResponse as a, GetUserAccountParams as a$, JobApplication as a0, JobSummaryImageType as a1, JobSummary as a2, JobVariables as a3, JobOrderDetail as a4, ProjectDetail as a5, ProjectFileDetail as a6, ServiceErrorSummarySeverity as a7, ServiceErrorSummary as a8, TaskEventLevel as a9, QExcludeDoneParameter as aA, QExcludePurposeParameter as aB, QFileParameter as aC, QFilePathParameter as aD, QFileProjectIdParameter as aE, QFromParameter as aF, QIncludeAcknowlegedParameter as aG, QIncludeDeletedParameter as aH, QInstanceArchiveParameter as aI, QKeepProjectFilesParameter as aJ, QLabelsParameter as aK, QProjectIdParameter as aL, QUntilParameter as aM, QUsernameParameter as aN, QOwnersParameter as aO, QEditorsParameter as aP, GetProjectFileParams as aQ, GetDatasetsParams as aR, GetVersionsParams as aS, DeleteDatasetParams as aT, GetFilesParams as aU, DeleteUnmanagedFileParams as aV, GetTasksParams as aW, GetTaskParams as aX, GetInstancesParams as aY, GetInstanceParams as aZ, PatchInstanceParams as a_, TaskEvent as aa, TaskIdentity as ab, TaskStateState as ac, TaskState as ad, TaskSummaryProcessingStage as ae, TaskSummary as af, TypeSummaryFormatterOptionsType as ag, TypeSummaryFormatterOptions as ah, TypeSummary as ai, UserAccountDetail as aj, UserDetail as ak, UserSummary as al, DatasetPostBodyBody as am, DatasetAnnotationsPostBodyBody as an, DatasetPutBodyBody as ao, FilePostBodyBody as ap, InstancePostBodyBody as aq, JobPutBodyBody as ar, ProjectPatchBodyBody as as, ProjectPostBodyBody as at, UserAccountPatchBodyBody as au, UserPatchBodyBody as av, QDoNotImpersonateParameter as aw, QDatasetMimeTypeParameter as ax, QEventLimitParameter as ay, QEventPriorOrdinalParameter as az, ApplicationsGetResponse as b, GetUserApiLogParams as b0, AdminGetServiceErrorsParams as b1, AXIOS_INSTANCE as b2, setAuthToken as b3, setBaseUrl as b4, customInstance as b5, DatasetPutPostResponse as c, DatasetDigestGetResponse as d, DatasetMetaGetResponse as e, DatasetSchemaGetResponseType as f, DatasetSchemaGetResponse as g, DatasetVersionDeleteResponse as h, DatasetVersionsGetResponse as i, DatasetsGetResponse as j, InstancePostResponse as k, FilesGetResponse as l, InstanceGetResponseApplicationType as m, InstanceGetResponse as n, InstancesGetResponse as o, JobGetResponse as p, JobsGetResponse as q, JobPutResponse as r, ProjectGetResponse as s, ProjectPostResponse as t, ProjectsGetResponse as u, TaskGetResponse as v, TasksGetResponse as w, TypesGetResponse as x, UserApiLogGetResponse as y, UsersGetResponse as z };
|
package/dataset/dataset.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOULWOQLWcjs = require('../chunk-OULWOQLW.cjs');var _reactquery = require('react-query');var m=(t,n)=>{let e=new FormData;return e.append("dataset_type",t.dataset_type),t.format_extra_variables!==void 0&&e.append("format_extra_variables",t.format_extra_variables),t.skip_molecule_load!==void 0&&e.append("skip_molecule_load",t.skip_molecule_load.toString()),e.append("project_id",t.project_id),e.append("path",t.path),e.append("file_name",t.file_name),t.parent_id!==void 0&&e.append("parent_id",t.parent_id),t.parent_version!==void 0&&e.append("parent_version",t.parent_version.toString()),t.organisation_id!==void 0&&e.append("organisation_id",t.organisation_id),t.unit_id!==void 0&&e.append("unit_id",t.unit_id),_chunkOULWOQLWcjs.e.call(void 0, {url:"/dataset",method:"put",data:e},n)},w= exports.useCreateDatasetFromFile =t=>{let{mutation:n,request:e}=t||{};return _reactquery.useMutation.call(void 0, a=>{let{data:s}=a||{};return m(s,e)},n)},T= exports.uploadDataset =(t,n)=>{let e=new FormData;return e.append("dataset_file",t.dataset_file),e.append("dataset_type",t.dataset_type),t.format_extra_variables!==void 0&&e.append("format_extra_variables",t.format_extra_variables),t.skip_molecule_load!==void 0&&e.append("skip_molecule_load",t.skip_molecule_load.toString()),e.append("as_filename",t.as_filename),t.parent_id!==void 0&&e.append("parent_id",t.parent_id),t.parent_version!==void 0&&e.append("parent_version",t.parent_version.toString()),e.append("organisation_id",t.organisation_id),e.append("unit_id",t.unit_id),_chunkOULWOQLWcjs.e.call(void 0, {url:"/dataset",method:"post",data:e},n)},U= exports.useUploadDataset =t=>{let{mutation:n,request:e}=t||{};return _reactquery.useMutation.call(void 0, a=>{let{data:s}=a||{};return T(s,e)},n)},D= exports.getDatasets =(t,n)=>_chunkOULWOQLWcjs.e.call(void 0, {url:"/dataset",method:"get",params:t},n),f= exports.getGetDatasetsQueryKey =t=>["/dataset",...t?[t]:[]],V= exports.useGetDatasets =(t,n)=>{var o;let{query:e,request:r}=n||{},a=(o=e==null?void 0:e.queryKey)!=null?o:f(t),u=_reactquery.useQuery.call(void 0, a,()=>D(t,r),e);return _chunkOULWOQLWcjs.a.call(void 0, {queryKey:a},u)},g= exports.getVersions =(t,n,e)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/dataset/${t}/versions`,method:"get",params:n},e),l= exports.getGetVersionsQueryKey =(t,n)=>[`/dataset/${t}/versions`,...n?[n]:[]],k= exports.useGetVersions =(t,n,e)=>{var c;let{query:r,request:a}=e||{},s=(c=r==null?void 0:r.queryKey)!=null?c:l(t,n),o=_reactquery.useQuery.call(void 0, s,()=>g(t,n,a),_chunkOULWOQLWcjs.a.call(void 0, {enabled:!!t},r));return _chunkOULWOQLWcjs.a.call(void 0, {queryKey:s},o)},q= exports.deleteDataset =(t,n,e,r)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/dataset/${t}/${n}`,method:"delete",params:e},r),j= exports.useDeleteDataset =t=>{let{mutation:n,request:e}=t||{};return _reactquery.useMutation.call(void 0, a=>{let{datasetid:s,datasetversion:u,params:o}=a||{};return q(s,u,o,e)},n)},R= exports.downloadDataset =(t,n,e)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/dataset/${t}/${n}`,method:"get"
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOULWOQLWcjs = require('../chunk-OULWOQLW.cjs');var _reactquery = require('react-query');var m=(t,n)=>{let e=new FormData;return e.append("dataset_type",t.dataset_type),t.format_extra_variables!==void 0&&e.append("format_extra_variables",t.format_extra_variables),t.skip_molecule_load!==void 0&&e.append("skip_molecule_load",t.skip_molecule_load.toString()),e.append("project_id",t.project_id),e.append("path",t.path),e.append("file_name",t.file_name),t.parent_id!==void 0&&e.append("parent_id",t.parent_id),t.parent_version!==void 0&&e.append("parent_version",t.parent_version.toString()),t.organisation_id!==void 0&&e.append("organisation_id",t.organisation_id),t.unit_id!==void 0&&e.append("unit_id",t.unit_id),_chunkOULWOQLWcjs.e.call(void 0, {url:"/dataset",method:"put",data:e},n)},w= exports.useCreateDatasetFromFile =t=>{let{mutation:n,request:e}=t||{};return _reactquery.useMutation.call(void 0, a=>{let{data:s}=a||{};return m(s,e)},n)},T= exports.uploadDataset =(t,n)=>{let e=new FormData;return e.append("dataset_file",t.dataset_file),e.append("dataset_type",t.dataset_type),t.format_extra_variables!==void 0&&e.append("format_extra_variables",t.format_extra_variables),t.skip_molecule_load!==void 0&&e.append("skip_molecule_load",t.skip_molecule_load.toString()),e.append("as_filename",t.as_filename),t.parent_id!==void 0&&e.append("parent_id",t.parent_id),t.parent_version!==void 0&&e.append("parent_version",t.parent_version.toString()),e.append("organisation_id",t.organisation_id),e.append("unit_id",t.unit_id),_chunkOULWOQLWcjs.e.call(void 0, {url:"/dataset",method:"post",data:e},n)},U= exports.useUploadDataset =t=>{let{mutation:n,request:e}=t||{};return _reactquery.useMutation.call(void 0, a=>{let{data:s}=a||{};return T(s,e)},n)},D= exports.getDatasets =(t,n)=>_chunkOULWOQLWcjs.e.call(void 0, {url:"/dataset",method:"get",params:t},n),f= exports.getGetDatasetsQueryKey =t=>["/dataset",...t?[t]:[]],V= exports.useGetDatasets =(t,n)=>{var o;let{query:e,request:r}=n||{},a=(o=e==null?void 0:e.queryKey)!=null?o:f(t),u=_reactquery.useQuery.call(void 0, a,()=>D(t,r),e);return _chunkOULWOQLWcjs.a.call(void 0, {queryKey:a},u)},g= exports.getVersions =(t,n,e)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/dataset/${t}/versions`,method:"get",params:n},e),l= exports.getGetVersionsQueryKey =(t,n)=>[`/dataset/${t}/versions`,...n?[n]:[]],k= exports.useGetVersions =(t,n,e)=>{var c;let{query:r,request:a}=e||{},s=(c=r==null?void 0:r.queryKey)!=null?c:l(t,n),o=_reactquery.useQuery.call(void 0, s,()=>g(t,n,a),_chunkOULWOQLWcjs.a.call(void 0, {enabled:!!t},r));return _chunkOULWOQLWcjs.a.call(void 0, {queryKey:s},o)},q= exports.deleteDataset =(t,n,e,r)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/dataset/${t}/${n}`,method:"delete",params:e},r),j= exports.useDeleteDataset =t=>{let{mutation:n,request:e}=t||{};return _reactquery.useMutation.call(void 0, a=>{let{datasetid:s,datasetversion:u,params:o}=a||{};return q(s,u,o,e)},n)},R= exports.downloadDataset =(t,n,e)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/dataset/${t}/${n}`,method:"get"},e),x= exports.getDownloadDatasetQueryKey =(t,n)=>[`/dataset/${t}/${n}`],z= exports.useDownloadDataset =(t,n,e)=>{var c;let{query:r,request:a}=e||{},s=(c=r==null?void 0:r.queryKey)!=null?c:x(t,n),o=_reactquery.useQuery.call(void 0, s,()=>R(t,n,a),_chunkOULWOQLWcjs.a.call(void 0, {enabled:!!(t&&n)},r));return _chunkOULWOQLWcjs.a.call(void 0, {queryKey:s},o)},E= exports.removeEditorFromDataset =(t,n,e)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/dataset/${t}/editor/${n}`,method:"delete"},e),H= exports.useRemoveEditorFromDataset =t=>{let{mutation:n,request:e}=t||{};return _reactquery.useMutation.call(void 0, a=>{let{datasetid:s,userid:u}=a||{};return E(s,u,e)},n)},A= exports.addEditorToDataset =(t,n,e)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/dataset/${t}/editor/${n}`,method:"put",data:void 0},e),J= exports.useAddEditorToDataset =t=>{let{mutation:n,request:e}=t||{};return _reactquery.useMutation.call(void 0, a=>{let{datasetid:s,userid:u}=a||{};return A(s,u,e)},n)},F= exports.getDatasetDigest =(t,n)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/dataset/digest/${t}`,method:"get"},n),_= exports.getGetDatasetDigestQueryKey =t=>[`/dataset/digest/${t}`],L= exports.useGetDatasetDigest =(t,n)=>{var o;let{query:e,request:r}=n||{},a=(o=e==null?void 0:e.queryKey)!=null?o:_(t),u=_reactquery.useQuery.call(void 0, a,()=>F(t,r),_chunkOULWOQLWcjs.a.call(void 0, {enabled:!!t},e));return _chunkOULWOQLWcjs.a.call(void 0, {queryKey:a},u)},P= exports.getMetadata =(t,n,e)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/dataset/${t}/meta/${n}`,method:"get"},e),S= exports.getGetMetadataQueryKey =(t,n)=>[`/dataset/${t}/meta/${n}`],N= exports.useGetMetadata =(t,n,e)=>{var c;let{query:r,request:a}=e||{},s=(c=r==null?void 0:r.queryKey)!=null?c:S(t,n),o=_reactquery.useQuery.call(void 0, s,()=>P(t,n,a),_chunkOULWOQLWcjs.a.call(void 0, {enabled:!!(t&&n)},r));return _chunkOULWOQLWcjs.a.call(void 0, {queryKey:s},o)},v= exports.updateMetadata =(t,n,e,r)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/dataset/${t}/meta/${n}/${e}`,method:"patch",data:void 0},r),W= exports.useUpdateMetadata =t=>{let{mutation:n,request:e}=t||{};return _reactquery.useMutation.call(void 0, a=>{let{datasetid:s,datasetversion:u,metaparameters:o}=a||{};return v(s,u,o,e)},n)},b= exports.addAnnotations =(t,n,e,r)=>{let a=new FormData;return a.append("annotations",e.annotations),_chunkOULWOQLWcjs.e.call(void 0, {url:`/dataset/${t}/annotations/${n}`,method:"post",data:a},r)},X= exports.useAddAnnotations =t=>{let{mutation:n,request:e}=t||{};return _reactquery.useMutation.call(void 0, a=>{let{datasetid:s,datasetversion:u,data:o}=a||{};return b(s,u,o,e)},n)},M= exports.getSchema =(t,n,e)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/dataset/${t}/schema/${n}`,method:"get"},e),O= exports.getGetSchemaQueryKey =(t,n)=>[`/dataset/${t}/schema/${n}`],Y= exports.useGetSchema =(t,n,e)=>{var c;let{query:r,request:a}=e||{},s=(c=r==null?void 0:r.queryKey)!=null?c:O(t,n),o=_reactquery.useQuery.call(void 0, s,()=>M(t,n,a),_chunkOULWOQLWcjs.a.call(void 0, {enabled:!!(t&&n)},r));return _chunkOULWOQLWcjs.a.call(void 0, {queryKey:s},o)};exports.addAnnotations = b; exports.addEditorToDataset = A; exports.createDatasetFromFile = m; exports.deleteDataset = q; exports.downloadDataset = R; exports.getDatasetDigest = F; exports.getDatasets = D; exports.getDownloadDatasetQueryKey = x; exports.getGetDatasetDigestQueryKey = _; exports.getGetDatasetsQueryKey = f; exports.getGetMetadataQueryKey = S; exports.getGetSchemaQueryKey = O; exports.getGetVersionsQueryKey = l; exports.getMetadata = P; exports.getSchema = M; exports.getVersions = g; exports.removeEditorFromDataset = E; exports.updateMetadata = v; exports.uploadDataset = T; exports.useAddAnnotations = X; exports.useAddEditorToDataset = J; exports.useCreateDatasetFromFile = w; exports.useDeleteDataset = j; exports.useDownloadDataset = z; exports.useGetDatasetDigest = L; exports.useGetDatasets = V; exports.useGetMetadata = N; exports.useGetSchema = Y; exports.useGetVersions = k; exports.useRemoveEditorFromDataset = H; exports.useUpdateMetadata = W; exports.useUploadDataset = U;
|
|
2
2
|
//# sourceMappingURL=dataset.cjs.map
|
package/dataset/dataset.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/dataset/dataset.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Generated by orval v6.3.0 \uD83C\uDF7A\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: 0.6\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n} from \"react-query\";\nimport type {\n DatasetPutPostResponse,\n Error,\n DatasetPutBodyBody,\n DatasetPostBodyBody,\n DatasetsGetResponse,\n GetDatasetsParams,\n DatasetVersionsGetResponse,\n GetVersionsParams,\n DatasetVersionDeleteResponse,\n DeleteDatasetParams,\n DatasetDigestGetResponse,\n DatasetMetaGetResponse,\n DatasetAnnotationsPostResponse,\n DatasetAnnotationsPostBodyBody,\n DatasetSchemaGetResponse,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\n\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\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 a 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 Add a File from a Project as a Dataset\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.parent_id !== undefined) {\n formData.append(\"parent_id\", datasetPutBodyBody.parent_id);\n }\n if (datasetPutBodyBody.parent_version !== undefined) {\n formData.append(\n \"parent_version\",\n datasetPutBodyBody.parent_version.toString()\n );\n }\n if (datasetPutBodyBody.organisation_id !== undefined) {\n formData.append(\"organisation_id\", datasetPutBodyBody.organisation_id);\n }\n if (datasetPutBodyBody.unit_id !== undefined) {\n formData.append(\"unit_id\", datasetPutBodyBody.unit_id);\n }\n\n return customInstance<DatasetPutPostResponse>(\n { url: `/dataset`, method: \"put\", data: formData },\n options\n );\n};\n\nexport const useCreateDatasetFromFile = <\n TError = void | Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<typeof createDatasetFromFile>,\n { data: DatasetPutBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return createDatasetFromFile(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<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 formData.append(\"as_filename\", datasetPostBodyBody.as_filename);\n if (datasetPostBodyBody.parent_id !== undefined) {\n formData.append(\"parent_id\", datasetPostBodyBody.parent_id);\n }\n if (datasetPostBodyBody.parent_version !== undefined) {\n formData.append(\n \"parent_version\",\n datasetPostBodyBody.parent_version.toString()\n );\n }\n formData.append(\"organisation_id\", datasetPostBodyBody.organisation_id);\n formData.append(\"unit_id\", datasetPostBodyBody.unit_id);\n\n return customInstance<DatasetPutPostResponse>(\n { url: `/dataset`, method: \"post\", data: formData },\n options\n );\n};\n\nexport const useUploadDataset = <\n TError = void | Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<typeof uploadDataset>,\n { data: DatasetPostBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return uploadDataset(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<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) => {\n return customInstance<DatasetsGetResponse>(\n { url: `/dataset`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetDatasetsQueryKey = (params?: GetDatasetsParams) => [\n `/dataset`,\n ...(params ? [params] : []),\n];\n\nexport const useGetDatasets = <\n TData = AsyncReturnType<typeof getDatasets>,\n TError = void | Error\n>(\n params?: GetDatasetsParams,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getDatasets>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetDatasetsQueryKey(params);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getDatasets>> = () =>\n getDatasets(params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getDatasets>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\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) => {\n return customInstance<DatasetVersionsGetResponse>(\n { url: `/dataset/${datasetid}/versions`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetVersionsQueryKey = (\n datasetid: string,\n params?: GetVersionsParams\n) => [`/dataset/${datasetid}/versions`, ...(params ? [params] : [])];\n\nexport const useGetVersions = <\n TData = AsyncReturnType<typeof getVersions>,\n TError = void | Error\n>(\n datasetid: string,\n params?: GetVersionsParams,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getVersions>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetVersionsQueryKey(datasetid, params);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getVersions>> = () =>\n getVersions(datasetid, params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getVersions>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!datasetid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\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 const useDeleteDataset = <\n TError = void | Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<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 AsyncReturnType<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) => {\n return customInstance<Blob>(\n {\n url: `/dataset/${datasetid}/${datasetversion}`,\n method: \"get\",\n responseType: \"blob\",\n },\n options\n );\n};\n\nexport const getDownloadDatasetQueryKey = (\n datasetid: string,\n datasetversion: number\n) => [`/dataset/${datasetid}/${datasetversion}`];\n\nexport const useDownloadDataset = <\n TData = AsyncReturnType<typeof downloadDataset>,\n TError = void | Error\n>(\n datasetid: string,\n datasetversion: number,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof downloadDataset>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getDownloadDatasetQueryKey(datasetid, datasetversion);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof downloadDataset>> = () =>\n downloadDataset(datasetid, datasetversion, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof downloadDataset>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!(datasetid && datasetversion),\n ...queryOptions,\n });\n\n return {\n queryKey,\n ...query,\n };\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 const useRemoveEditorFromDataset = <\n TError = Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<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 AsyncReturnType<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 {\n url: `/dataset/${datasetid}/editor/${userid}`,\n method: \"put\",\n data: undefined,\n },\n options\n );\n};\n\nexport const useAddEditorToDataset = <\n TError = Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<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 AsyncReturnType<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-charcater hexstring.\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) => {\n return customInstance<DatasetDigestGetResponse>(\n { url: `/dataset/digest/${datasetdigest}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetDatasetDigestQueryKey = (datasetdigest: string) => [\n `/dataset/digest/${datasetdigest}`,\n];\n\nexport const useGetDatasetDigest = <\n TData = AsyncReturnType<typeof getDatasetDigest>,\n TError = void | Error\n>(\n datasetdigest: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getDatasetDigest>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetDatasetDigestQueryKey(datasetdigest);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getDatasetDigest>> = () =>\n getDatasetDigest(datasetdigest, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getDatasetDigest>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!datasetdigest, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Returns the metadata for a Dataset versions in JSON format.\n\n * @summary Gets the metadata for a specific Dataset\n */\nexport const getMetadata = (\n datasetid: string,\n datasetversion: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<DatasetMetaGetResponse>(\n { url: `/dataset/${datasetid}/meta/${datasetversion}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetMetadataQueryKey = (\n datasetid: string,\n datasetversion: number\n) => [`/dataset/${datasetid}/meta/${datasetversion}`];\n\nexport const useGetMetadata = <\n TData = AsyncReturnType<typeof getMetadata>,\n TError = void | Error\n>(\n datasetid: string,\n datasetversion: number,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getMetadata>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetid, datasetversion);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getMetadata>> = () =>\n getMetadata(datasetid, datasetversion, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getMetadata>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(datasetid && datasetversion), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Updates the metadata for a Dataset based on the given parameter array.\n\n * @summary Update the metadata for a specific Dataset\n */\nexport const updateMetadata = (\n datasetid: string,\n datasetversion: number,\n metaparameters: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/dataset/${datasetid}/meta/${datasetversion}/${metaparameters}`,\n method: \"patch\",\n data: undefined,\n },\n options\n );\n};\n\nexport const useUpdateMetadata = <\n TError = Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof updateMetadata>,\n TError,\n { datasetid: string; datasetversion: number; metaparameters: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof updateMetadata>,\n { datasetid: string; datasetversion: number; metaparameters: string }\n > = (props) => {\n const { datasetid, datasetversion, metaparameters } = props || {};\n\n return updateMetadata(\n datasetid,\n datasetversion,\n metaparameters,\n requestOptions\n );\n };\n\n return useMutation<\n AsyncReturnType<typeof updateMetadata>,\n TError,\n { datasetid: string; datasetversion: number; metaparameters: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Creates new annotations of the specified type(s) and add to the metadata for the dataset.\nThe annotations are provided in a list in JSON format. For details of the annotations that can be created, see the data-manager-metadata library,\n\n * @summary Add new annotations to the Metadata for the Dataset\n */\nexport const addAnnotations = (\n datasetid: string,\n datasetversion: number,\n datasetAnnotationsPostBodyBody: DatasetAnnotationsPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"annotations\", datasetAnnotationsPostBodyBody.annotations);\n\n return customInstance<DatasetAnnotationsPostResponse>(\n {\n url: `/dataset/${datasetid}/annotations/${datasetversion}`,\n method: \"post\",\n data: formData,\n },\n options\n );\n};\n\nexport const useAddAnnotations = <\n TError = Error | void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addAnnotations>,\n TError,\n {\n datasetid: string;\n datasetversion: number;\n data: DatasetAnnotationsPostBodyBody;\n },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addAnnotations>,\n {\n datasetid: string;\n datasetversion: number;\n data: DatasetAnnotationsPostBodyBody;\n }\n > = (props) => {\n const { datasetid, datasetversion, data } = props || {};\n\n return addAnnotations(datasetid, datasetversion, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addAnnotations>,\n TError,\n {\n datasetid: string;\n datasetversion: number;\n data: DatasetAnnotationsPostBodyBody;\n },\n TContext\n >(mutationFn, mutationOptions);\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) => {\n return customInstance<DatasetSchemaGetResponse>(\n { url: `/dataset/${datasetid}/schema/${datasetversion}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetSchemaQueryKey = (\n datasetid: string,\n datasetversion: number\n) => [`/dataset/${datasetid}/schema/${datasetversion}`];\n\nexport const useGetSchema = <\n TData = AsyncReturnType<typeof getSchema>,\n TError = void | Error\n>(\n datasetid: string,\n datasetversion: number,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getSchema>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetSchemaQueryKey(datasetid, datasetversion);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getSchema>> = () =>\n getSchema(datasetid, datasetversion, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getSchema>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(datasetid && datasetversion), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n"],
|
|
5
|
-
"mappings": "iDAUA,wDAiDO,GAAM,GAAwB,CACnC,EACA,IACG,CACH,GAAM,GAAW,GAAI,UACrB,SAAS,OAAO,eAAgB,EAAmB,cAC/C,EAAmB,yBAA2B,QAChD,EAAS,OACP,yBACA,EAAmB,wBAGnB,EAAmB,qBAAuB,QAC5C,EAAS,OACP,qBACA,EAAmB,mBAAmB,YAG1C,EAAS,OAAO,aAAc,EAAmB,YACjD,EAAS,OAAO,OAAQ,EAAmB,MAC3C,EAAS,OAAO,YAAa,EAAmB,WAC5C,EAAmB,YAAc,QACnC,EAAS,OAAO,YAAa,EAAmB,WAE9C,EAAmB,iBAAmB,QACxC,EAAS,OACP,iBACA,EAAmB,e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D,EAAW,oBAAc,WAAd,OAA0B,EAAuB,GAK5D,EAAQ,EACZ,EAJkE,IAClE,EAAY,EAAQ,GAKpB,GAGF,MAAO,IACL,YACG,IAWM,EAAc,CACzB,EACA,EACA,IAEO,EACL,CAAE,IAAK,YAAY,aAAsB,OAAQ,MAAO,UACxD,GAIS,EAAyB,CACpC,EACA,IACG,CAAC,YAAY,aAAsB,GAAI,EAAS,CAAC,GAAU,IAEnD,EAAiB,CAI5B,EACA,EACA,IAIG,CA7SL,MA8SE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EACJ,oBAAc,WAAd,OAA0B,EAAuB,EAAW,GAKxD,EAAQ,EACZ,EAJkE,IAClE,EAAY,EAAW,EAAQ,GAK/B,GAAE,QAAS,CAAC,CAAC,GAAc,IAG7B,MAAO,IACL,YACG,IAaM,EAAgB,CAC3B,EACA,EACA,EACA,IAEO,EACL,CACE,IAAK,YAAY,KAAa,IAC9B,OAAQ,SACR,UAEF,GAIS,EAAmB,AAG9B,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,YAAW,iBAAgB,UAAW,GAAS,GAEvD,MAAO,GAAc,EAAW,EAAgB,EAAQ,IAQ5C,IASH,EAAkB,CAC7B,EACA,EACA,IAEO,EACL,
|
|
4
|
+
"sourcesContent": ["/**\n * Generated by orval v6.3.0 \uD83C\uDF7A\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: 0.6\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n} from \"react-query\";\nimport type {\n DatasetPutPostResponse,\n Error,\n DatasetPutBodyBody,\n DatasetPostBodyBody,\n DatasetsGetResponse,\n GetDatasetsParams,\n DatasetVersionsGetResponse,\n GetVersionsParams,\n DatasetVersionDeleteResponse,\n DeleteDatasetParams,\n DatasetDigestGetResponse,\n DatasetMetaGetResponse,\n DatasetAnnotationsPostResponse,\n DatasetAnnotationsPostBodyBody,\n DatasetSchemaGetResponse,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\n\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\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 a 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 Add a File from a Project as a Dataset\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.parent_id !== undefined) {\n formData.append(\"parent_id\", datasetPutBodyBody.parent_id);\n }\n if (datasetPutBodyBody.parent_version !== undefined) {\n formData.append(\n \"parent_version\",\n datasetPutBodyBody.parent_version.toString()\n );\n }\n if (datasetPutBodyBody.organisation_id !== undefined) {\n formData.append(\"organisation_id\", datasetPutBodyBody.organisation_id);\n }\n if (datasetPutBodyBody.unit_id !== undefined) {\n formData.append(\"unit_id\", datasetPutBodyBody.unit_id);\n }\n\n return customInstance<DatasetPutPostResponse>(\n { url: `/dataset`, method: \"put\", data: formData },\n options\n );\n};\n\nexport const useCreateDatasetFromFile = <\n TError = void | Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<typeof createDatasetFromFile>,\n { data: DatasetPutBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return createDatasetFromFile(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<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 formData.append(\"as_filename\", datasetPostBodyBody.as_filename);\n if (datasetPostBodyBody.parent_id !== undefined) {\n formData.append(\"parent_id\", datasetPostBodyBody.parent_id);\n }\n if (datasetPostBodyBody.parent_version !== undefined) {\n formData.append(\n \"parent_version\",\n datasetPostBodyBody.parent_version.toString()\n );\n }\n formData.append(\"organisation_id\", datasetPostBodyBody.organisation_id);\n formData.append(\"unit_id\", datasetPostBodyBody.unit_id);\n\n return customInstance<DatasetPutPostResponse>(\n { url: `/dataset`, method: \"post\", data: formData },\n options\n );\n};\n\nexport const useUploadDataset = <\n TError = void | Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<typeof uploadDataset>,\n { data: DatasetPostBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return uploadDataset(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<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) => {\n return customInstance<DatasetsGetResponse>(\n { url: `/dataset`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetDatasetsQueryKey = (params?: GetDatasetsParams) => [\n `/dataset`,\n ...(params ? [params] : []),\n];\n\nexport const useGetDatasets = <\n TData = AsyncReturnType<typeof getDatasets>,\n TError = void | Error\n>(\n params?: GetDatasetsParams,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getDatasets>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetDatasetsQueryKey(params);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getDatasets>> = () =>\n getDatasets(params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getDatasets>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\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) => {\n return customInstance<DatasetVersionsGetResponse>(\n { url: `/dataset/${datasetid}/versions`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetVersionsQueryKey = (\n datasetid: string,\n params?: GetVersionsParams\n) => [`/dataset/${datasetid}/versions`, ...(params ? [params] : [])];\n\nexport const useGetVersions = <\n TData = AsyncReturnType<typeof getVersions>,\n TError = void | Error\n>(\n datasetid: string,\n params?: GetVersionsParams,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getVersions>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetVersionsQueryKey(datasetid, params);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getVersions>> = () =>\n getVersions(datasetid, params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getVersions>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!datasetid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\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 const useDeleteDataset = <\n TError = void | Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<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 AsyncReturnType<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) => {\n return customInstance<void>(\n { url: `/dataset/${datasetid}/${datasetversion}`, method: \"get\" },\n options\n );\n};\n\nexport const getDownloadDatasetQueryKey = (\n datasetid: string,\n datasetversion: number\n) => [`/dataset/${datasetid}/${datasetversion}`];\n\nexport const useDownloadDataset = <\n TData = AsyncReturnType<typeof downloadDataset>,\n TError = Error\n>(\n datasetid: string,\n datasetversion: number,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof downloadDataset>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getDownloadDatasetQueryKey(datasetid, datasetversion);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof downloadDataset>> = () =>\n downloadDataset(datasetid, datasetversion, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof downloadDataset>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!(datasetid && datasetversion),\n ...queryOptions,\n });\n\n return {\n queryKey,\n ...query,\n };\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 const useRemoveEditorFromDataset = <\n TError = Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<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 AsyncReturnType<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 {\n url: `/dataset/${datasetid}/editor/${userid}`,\n method: \"put\",\n data: undefined,\n },\n options\n );\n};\n\nexport const useAddEditorToDataset = <\n TError = Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<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 AsyncReturnType<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-charcater hexstring.\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) => {\n return customInstance<DatasetDigestGetResponse>(\n { url: `/dataset/digest/${datasetdigest}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetDatasetDigestQueryKey = (datasetdigest: string) => [\n `/dataset/digest/${datasetdigest}`,\n];\n\nexport const useGetDatasetDigest = <\n TData = AsyncReturnType<typeof getDatasetDigest>,\n TError = void | Error\n>(\n datasetdigest: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getDatasetDigest>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetDatasetDigestQueryKey(datasetdigest);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getDatasetDigest>> = () =>\n getDatasetDigest(datasetdigest, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getDatasetDigest>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!datasetdigest, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Returns the metadata for a Dataset versions in JSON format.\n\n * @summary Gets the metadata for a specific Dataset\n */\nexport const getMetadata = (\n datasetid: string,\n datasetversion: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<DatasetMetaGetResponse>(\n { url: `/dataset/${datasetid}/meta/${datasetversion}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetMetadataQueryKey = (\n datasetid: string,\n datasetversion: number\n) => [`/dataset/${datasetid}/meta/${datasetversion}`];\n\nexport const useGetMetadata = <\n TData = AsyncReturnType<typeof getMetadata>,\n TError = void | Error\n>(\n datasetid: string,\n datasetversion: number,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getMetadata>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetid, datasetversion);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getMetadata>> = () =>\n getMetadata(datasetid, datasetversion, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getMetadata>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(datasetid && datasetversion), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Updates the metadata for a Dataset based on the given parameter array.\n\n * @summary Update the metadata for a specific Dataset\n */\nexport const updateMetadata = (\n datasetid: string,\n datasetversion: number,\n metaparameters: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/dataset/${datasetid}/meta/${datasetversion}/${metaparameters}`,\n method: \"patch\",\n data: undefined,\n },\n options\n );\n};\n\nexport const useUpdateMetadata = <\n TError = Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof updateMetadata>,\n TError,\n { datasetid: string; datasetversion: number; metaparameters: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof updateMetadata>,\n { datasetid: string; datasetversion: number; metaparameters: string }\n > = (props) => {\n const { datasetid, datasetversion, metaparameters } = props || {};\n\n return updateMetadata(\n datasetid,\n datasetversion,\n metaparameters,\n requestOptions\n );\n };\n\n return useMutation<\n AsyncReturnType<typeof updateMetadata>,\n TError,\n { datasetid: string; datasetversion: number; metaparameters: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Creates new annotations of the specified type(s) and add to the metadata for the dataset.\nThe annotations are provided in a list in JSON format. For details of the annotations that can be created, see the data-manager-metadata library,\n\n * @summary Add new annotations to the Metadata for the Dataset\n */\nexport const addAnnotations = (\n datasetid: string,\n datasetversion: number,\n datasetAnnotationsPostBodyBody: DatasetAnnotationsPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"annotations\", datasetAnnotationsPostBodyBody.annotations);\n\n return customInstance<DatasetAnnotationsPostResponse>(\n {\n url: `/dataset/${datasetid}/annotations/${datasetversion}`,\n method: \"post\",\n data: formData,\n },\n options\n );\n};\n\nexport const useAddAnnotations = <\n TError = Error | void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addAnnotations>,\n TError,\n {\n datasetid: string;\n datasetversion: number;\n data: DatasetAnnotationsPostBodyBody;\n },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addAnnotations>,\n {\n datasetid: string;\n datasetversion: number;\n data: DatasetAnnotationsPostBodyBody;\n }\n > = (props) => {\n const { datasetid, datasetversion, data } = props || {};\n\n return addAnnotations(datasetid, datasetversion, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addAnnotations>,\n TError,\n {\n datasetid: string;\n datasetversion: number;\n data: DatasetAnnotationsPostBodyBody;\n },\n TContext\n >(mutationFn, mutationOptions);\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) => {\n return customInstance<DatasetSchemaGetResponse>(\n { url: `/dataset/${datasetid}/schema/${datasetversion}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetSchemaQueryKey = (\n datasetid: string,\n datasetversion: number\n) => [`/dataset/${datasetid}/schema/${datasetversion}`];\n\nexport const useGetSchema = <\n TData = AsyncReturnType<typeof getSchema>,\n TError = void | Error\n>(\n datasetid: string,\n datasetversion: number,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getSchema>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetSchemaQueryKey(datasetid, datasetversion);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getSchema>> = () =>\n getSchema(datasetid, datasetversion, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getSchema>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(datasetid && datasetversion), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n"],
|
|
5
|
+
"mappings": "iDAUA,wDAiDO,GAAM,GAAwB,CACnC,EACA,IACG,CACH,GAAM,GAAW,GAAI,UACrB,SAAS,OAAO,eAAgB,EAAmB,cAC/C,EAAmB,yBAA2B,QAChD,EAAS,OACP,yBACA,EAAmB,wBAGnB,EAAmB,qBAAuB,QAC5C,EAAS,OACP,qBACA,EAAmB,mBAAmB,YAG1C,EAAS,OAAO,aAAc,EAAmB,YACjD,EAAS,OAAO,OAAQ,EAAmB,MAC3C,EAAS,OAAO,YAAa,EAAmB,WAC5C,EAAmB,YAAc,QACnC,EAAS,OAAO,YAAa,EAAmB,WAE9C,EAAmB,iBAAmB,QACxC,EAAS,OACP,iBACA,EAAmB,eAAe,YAGlC,EAAmB,kBAAoB,QACzC,EAAS,OAAO,kBAAmB,EAAmB,iBAEpD,EAAmB,UAAY,QACjC,EAAS,OAAO,UAAW,EAAmB,SAGzC,EACL,CAAE,IAAK,WAAY,OAAQ,MAAO,KAAM,GACxC,IAIS,EAA2B,AAGtC,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,QAAS,GAAS,GAE1B,MAAO,GAAsB,EAAM,IAQvB,IAeH,EAAgB,CAC3B,EACA,IACG,CACH,GAAM,GAAW,GAAI,UACrB,SAAS,OAAO,eAAgB,EAAoB,cACpD,EAAS,OAAO,eAAgB,EAAoB,cAChD,EAAoB,yBAA2B,QACjD,EAAS,OACP,yBACA,EAAoB,wBAGpB,EAAoB,qBAAuB,QAC7C,EAAS,OACP,qBACA,EAAoB,mBAAmB,YAG3C,EAAS,OAAO,cAAe,EAAoB,aAC/C,EAAoB,YAAc,QACpC,EAAS,OAAO,YAAa,EAAoB,WAE/C,EAAoB,iBAAmB,QACzC,EAAS,OACP,iBACA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AAY,CACvB,EACA,EACA,IAEO,EACL,CAAE,IAAK,YAAY,YAAoB,IAAkB,OAAQ,OACjE,GAIS,EAAuB,CAClC,EACA,IACG,CAAC,YAAY,YAAoB,KAEzB,EAAe,CAI1B,EACA,EACA,IAIG,CAlyBL,MAmyBE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EACJ,oBAAc,WAAd,OAA0B,EAAqB,EAAW,GAKtD,EAAQ,EACZ,EAJgE,IAChE,EAAU,EAAW,EAAgB,GAKrC,GAAE,QAAS,CAAC,CAAE,IAAa,IAAoB,IAGjD,MAAO,IACL,YACG",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dataset/dataset.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ao as DatasetPutBodyBody, b5 as customInstance, c as DatasetPutPostResponse, E as Error, am as DatasetPostBodyBody, aR as GetDatasetsParams, j as DatasetsGetResponse, aS as GetVersionsParams, H as DatasetDetail, aT as DeleteDatasetParams, ab as TaskIdentity, d as DatasetDigestGetResponse, e as DatasetMetaGetResponse, an as DatasetAnnotationsPostBodyBody, D as DatasetAnnotationsPostResponse, g as DatasetSchemaGetResponse } from '../custom-instance-82d281a3';
|
|
2
2
|
import * as react_query from 'react-query';
|
|
3
3
|
import { UseMutationOptions, UseQueryOptions } from 'react-query';
|
|
4
4
|
import 'axios';
|
|
@@ -333,10 +333,10 @@ You cannot get a Dataset until its upload is complete.
|
|
|
333
333
|
|
|
334
334
|
* @summary Download a dataset
|
|
335
335
|
*/
|
|
336
|
-
declare const downloadDataset: (datasetid: string, datasetversion: number, options?: SecondParameter<typeof customInstance>) => Promise<
|
|
336
|
+
declare const downloadDataset: (datasetid: string, datasetversion: number, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
337
337
|
declare const getDownloadDatasetQueryKey: (datasetid: string, datasetversion: number) => string[];
|
|
338
|
-
declare const useDownloadDataset: <TData =
|
|
339
|
-
query?: UseQueryOptions<
|
|
338
|
+
declare const useDownloadDataset: <TData = void, TError = Error>(datasetid: string, datasetversion: number, options?: {
|
|
339
|
+
query?: UseQueryOptions<void, TError, TData, react_query.QueryKey> | undefined;
|
|
340
340
|
request?: SecondParameter<typeof customInstance>;
|
|
341
341
|
} | undefined) => {
|
|
342
342
|
data: undefined;
|
package/dataset/dataset.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as p,e as i}from"../chunk-WMX3LCLR.js";import{useQuery as
|
|
1
|
+
import{a as p,e as i}from"../chunk-WMX3LCLR.js";import{useQuery as y,useMutation as d}from"react-query";var m=(t,n)=>{let e=new FormData;return e.append("dataset_type",t.dataset_type),t.format_extra_variables!==void 0&&e.append("format_extra_variables",t.format_extra_variables),t.skip_molecule_load!==void 0&&e.append("skip_molecule_load",t.skip_molecule_load.toString()),e.append("project_id",t.project_id),e.append("path",t.path),e.append("file_name",t.file_name),t.parent_id!==void 0&&e.append("parent_id",t.parent_id),t.parent_version!==void 0&&e.append("parent_version",t.parent_version.toString()),t.organisation_id!==void 0&&e.append("organisation_id",t.organisation_id),t.unit_id!==void 0&&e.append("unit_id",t.unit_id),i({url:"/dataset",method:"put",data:e},n)},K=t=>{let{mutation:n,request:e}=t||{};return d(a=>{let{data:s}=a||{};return m(s,e)},n)},T=(t,n)=>{let e=new FormData;return e.append("dataset_file",t.dataset_file),e.append("dataset_type",t.dataset_type),t.format_extra_variables!==void 0&&e.append("format_extra_variables",t.format_extra_variables),t.skip_molecule_load!==void 0&&e.append("skip_molecule_load",t.skip_molecule_load.toString()),e.append("as_filename",t.as_filename),t.parent_id!==void 0&&e.append("parent_id",t.parent_id),t.parent_version!==void 0&&e.append("parent_version",t.parent_version.toString()),e.append("organisation_id",t.organisation_id),e.append("unit_id",t.unit_id),i({url:"/dataset",method:"post",data:e},n)},w=t=>{let{mutation:n,request:e}=t||{};return d(a=>{let{data:s}=a||{};return T(s,e)},n)},D=(t,n)=>i({url:"/dataset",method:"get",params:t},n),f=t=>["/dataset",...t?[t]:[]],U=(t,n)=>{var o;let{query:e,request:r}=n||{},a=(o=e==null?void 0:e.queryKey)!=null?o:f(t),u=y(a,()=>D(t,r),e);return p({queryKey:a},u)},g=(t,n,e)=>i({url:`/dataset/${t}/versions`,method:"get",params:n},e),l=(t,n)=>[`/dataset/${t}/versions`,...n?[n]:[]],V=(t,n,e)=>{var c;let{query:r,request:a}=e||{},s=(c=r==null?void 0:r.queryKey)!=null?c:l(t,n),o=y(s,()=>g(t,n,a),p({enabled:!!t},r));return p({queryKey:s},o)},q=(t,n,e,r)=>i({url:`/dataset/${t}/${n}`,method:"delete",params:e},r),k=t=>{let{mutation:n,request:e}=t||{};return d(a=>{let{datasetid:s,datasetversion:u,params:o}=a||{};return q(s,u,o,e)},n)},R=(t,n,e)=>i({url:`/dataset/${t}/${n}`,method:"get"},e),x=(t,n)=>[`/dataset/${t}/${n}`],j=(t,n,e)=>{var c;let{query:r,request:a}=e||{},s=(c=r==null?void 0:r.queryKey)!=null?c:x(t,n),o=y(s,()=>R(t,n,a),p({enabled:!!(t&&n)},r));return p({queryKey:s},o)},E=(t,n,e)=>i({url:`/dataset/${t}/editor/${n}`,method:"delete"},e),z=t=>{let{mutation:n,request:e}=t||{};return d(a=>{let{datasetid:s,userid:u}=a||{};return E(s,u,e)},n)},A=(t,n,e)=>i({url:`/dataset/${t}/editor/${n}`,method:"put",data:void 0},e),H=t=>{let{mutation:n,request:e}=t||{};return d(a=>{let{datasetid:s,userid:u}=a||{};return A(s,u,e)},n)},F=(t,n)=>i({url:`/dataset/digest/${t}`,method:"get"},n),_=t=>[`/dataset/digest/${t}`],J=(t,n)=>{var o;let{query:e,request:r}=n||{},a=(o=e==null?void 0:e.queryKey)!=null?o:_(t),u=y(a,()=>F(t,r),p({enabled:!!t},e));return p({queryKey:a},u)},P=(t,n,e)=>i({url:`/dataset/${t}/meta/${n}`,method:"get"},e),S=(t,n)=>[`/dataset/${t}/meta/${n}`],L=(t,n,e)=>{var c;let{query:r,request:a}=e||{},s=(c=r==null?void 0:r.queryKey)!=null?c:S(t,n),o=y(s,()=>P(t,n,a),p({enabled:!!(t&&n)},r));return p({queryKey:s},o)},v=(t,n,e,r)=>i({url:`/dataset/${t}/meta/${n}/${e}`,method:"patch",data:void 0},r),N=t=>{let{mutation:n,request:e}=t||{};return d(a=>{let{datasetid:s,datasetversion:u,metaparameters:o}=a||{};return v(s,u,o,e)},n)},b=(t,n,e,r)=>{let a=new FormData;return a.append("annotations",e.annotations),i({url:`/dataset/${t}/annotations/${n}`,method:"post",data:a},r)},W=t=>{let{mutation:n,request:e}=t||{};return d(a=>{let{datasetid:s,datasetversion:u,data:o}=a||{};return b(s,u,o,e)},n)},M=(t,n,e)=>i({url:`/dataset/${t}/schema/${n}`,method:"get"},e),O=(t,n)=>[`/dataset/${t}/schema/${n}`],X=(t,n,e)=>{var c;let{query:r,request:a}=e||{},s=(c=r==null?void 0:r.queryKey)!=null?c:O(t,n),o=y(s,()=>M(t,n,a),p({enabled:!!(t&&n)},r));return p({queryKey:s},o)};export{b as addAnnotations,A as addEditorToDataset,m as createDatasetFromFile,q as deleteDataset,R as downloadDataset,F as getDatasetDigest,D as getDatasets,x as getDownloadDatasetQueryKey,_ as getGetDatasetDigestQueryKey,f as getGetDatasetsQueryKey,S as getGetMetadataQueryKey,O as getGetSchemaQueryKey,l as getGetVersionsQueryKey,P as getMetadata,M as getSchema,g as getVersions,E as removeEditorFromDataset,v as updateMetadata,T as uploadDataset,W as useAddAnnotations,H as useAddEditorToDataset,K as useCreateDatasetFromFile,k as useDeleteDataset,j as useDownloadDataset,J as useGetDatasetDigest,U as useGetDatasets,L as useGetMetadata,X as useGetSchema,V as useGetVersions,z as useRemoveEditorFromDataset,N as useUpdateMetadata,w as useUploadDataset};
|
|
2
2
|
//# sourceMappingURL=dataset.js.map
|
package/dataset/dataset.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/dataset/dataset.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Generated by orval v6.3.0 \uD83C\uDF7A\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: 0.6\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n} from \"react-query\";\nimport type {\n DatasetPutPostResponse,\n Error,\n DatasetPutBodyBody,\n DatasetPostBodyBody,\n DatasetsGetResponse,\n GetDatasetsParams,\n DatasetVersionsGetResponse,\n GetVersionsParams,\n DatasetVersionDeleteResponse,\n DeleteDatasetParams,\n DatasetDigestGetResponse,\n DatasetMetaGetResponse,\n DatasetAnnotationsPostResponse,\n DatasetAnnotationsPostBodyBody,\n DatasetSchemaGetResponse,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\n\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\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 a 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 Add a File from a Project as a Dataset\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.parent_id !== undefined) {\n formData.append(\"parent_id\", datasetPutBodyBody.parent_id);\n }\n if (datasetPutBodyBody.parent_version !== undefined) {\n formData.append(\n \"parent_version\",\n datasetPutBodyBody.parent_version.toString()\n );\n }\n if (datasetPutBodyBody.organisation_id !== undefined) {\n formData.append(\"organisation_id\", datasetPutBodyBody.organisation_id);\n }\n if (datasetPutBodyBody.unit_id !== undefined) {\n formData.append(\"unit_id\", datasetPutBodyBody.unit_id);\n }\n\n return customInstance<DatasetPutPostResponse>(\n { url: `/dataset`, method: \"put\", data: formData },\n options\n );\n};\n\nexport const useCreateDatasetFromFile = <\n TError = void | Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<typeof createDatasetFromFile>,\n { data: DatasetPutBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return createDatasetFromFile(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<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 formData.append(\"as_filename\", datasetPostBodyBody.as_filename);\n if (datasetPostBodyBody.parent_id !== undefined) {\n formData.append(\"parent_id\", datasetPostBodyBody.parent_id);\n }\n if (datasetPostBodyBody.parent_version !== undefined) {\n formData.append(\n \"parent_version\",\n datasetPostBodyBody.parent_version.toString()\n );\n }\n formData.append(\"organisation_id\", datasetPostBodyBody.organisation_id);\n formData.append(\"unit_id\", datasetPostBodyBody.unit_id);\n\n return customInstance<DatasetPutPostResponse>(\n { url: `/dataset`, method: \"post\", data: formData },\n options\n );\n};\n\nexport const useUploadDataset = <\n TError = void | Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<typeof uploadDataset>,\n { data: DatasetPostBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return uploadDataset(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<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) => {\n return customInstance<DatasetsGetResponse>(\n { url: `/dataset`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetDatasetsQueryKey = (params?: GetDatasetsParams) => [\n `/dataset`,\n ...(params ? [params] : []),\n];\n\nexport const useGetDatasets = <\n TData = AsyncReturnType<typeof getDatasets>,\n TError = void | Error\n>(\n params?: GetDatasetsParams,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getDatasets>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetDatasetsQueryKey(params);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getDatasets>> = () =>\n getDatasets(params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getDatasets>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\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) => {\n return customInstance<DatasetVersionsGetResponse>(\n { url: `/dataset/${datasetid}/versions`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetVersionsQueryKey = (\n datasetid: string,\n params?: GetVersionsParams\n) => [`/dataset/${datasetid}/versions`, ...(params ? [params] : [])];\n\nexport const useGetVersions = <\n TData = AsyncReturnType<typeof getVersions>,\n TError = void | Error\n>(\n datasetid: string,\n params?: GetVersionsParams,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getVersions>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetVersionsQueryKey(datasetid, params);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getVersions>> = () =>\n getVersions(datasetid, params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getVersions>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!datasetid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\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 const useDeleteDataset = <\n TError = void | Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<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 AsyncReturnType<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) => {\n return customInstance<Blob>(\n {\n url: `/dataset/${datasetid}/${datasetversion}`,\n method: \"get\",\n responseType: \"blob\",\n },\n options\n );\n};\n\nexport const getDownloadDatasetQueryKey = (\n datasetid: string,\n datasetversion: number\n) => [`/dataset/${datasetid}/${datasetversion}`];\n\nexport const useDownloadDataset = <\n TData = AsyncReturnType<typeof downloadDataset>,\n TError = void | Error\n>(\n datasetid: string,\n datasetversion: number,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof downloadDataset>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getDownloadDatasetQueryKey(datasetid, datasetversion);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof downloadDataset>> = () =>\n downloadDataset(datasetid, datasetversion, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof downloadDataset>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!(datasetid && datasetversion),\n ...queryOptions,\n });\n\n return {\n queryKey,\n ...query,\n };\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 const useRemoveEditorFromDataset = <\n TError = Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<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 AsyncReturnType<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 {\n url: `/dataset/${datasetid}/editor/${userid}`,\n method: \"put\",\n data: undefined,\n },\n options\n );\n};\n\nexport const useAddEditorToDataset = <\n TError = Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<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 AsyncReturnType<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-charcater hexstring.\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) => {\n return customInstance<DatasetDigestGetResponse>(\n { url: `/dataset/digest/${datasetdigest}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetDatasetDigestQueryKey = (datasetdigest: string) => [\n `/dataset/digest/${datasetdigest}`,\n];\n\nexport const useGetDatasetDigest = <\n TData = AsyncReturnType<typeof getDatasetDigest>,\n TError = void | Error\n>(\n datasetdigest: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getDatasetDigest>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetDatasetDigestQueryKey(datasetdigest);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getDatasetDigest>> = () =>\n getDatasetDigest(datasetdigest, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getDatasetDigest>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!datasetdigest, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Returns the metadata for a Dataset versions in JSON format.\n\n * @summary Gets the metadata for a specific Dataset\n */\nexport const getMetadata = (\n datasetid: string,\n datasetversion: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<DatasetMetaGetResponse>(\n { url: `/dataset/${datasetid}/meta/${datasetversion}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetMetadataQueryKey = (\n datasetid: string,\n datasetversion: number\n) => [`/dataset/${datasetid}/meta/${datasetversion}`];\n\nexport const useGetMetadata = <\n TData = AsyncReturnType<typeof getMetadata>,\n TError = void | Error\n>(\n datasetid: string,\n datasetversion: number,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getMetadata>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetid, datasetversion);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getMetadata>> = () =>\n getMetadata(datasetid, datasetversion, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getMetadata>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(datasetid && datasetversion), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Updates the metadata for a Dataset based on the given parameter array.\n\n * @summary Update the metadata for a specific Dataset\n */\nexport const updateMetadata = (\n datasetid: string,\n datasetversion: number,\n metaparameters: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/dataset/${datasetid}/meta/${datasetversion}/${metaparameters}`,\n method: \"patch\",\n data: undefined,\n },\n options\n );\n};\n\nexport const useUpdateMetadata = <\n TError = Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof updateMetadata>,\n TError,\n { datasetid: string; datasetversion: number; metaparameters: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof updateMetadata>,\n { datasetid: string; datasetversion: number; metaparameters: string }\n > = (props) => {\n const { datasetid, datasetversion, metaparameters } = props || {};\n\n return updateMetadata(\n datasetid,\n datasetversion,\n metaparameters,\n requestOptions\n );\n };\n\n return useMutation<\n AsyncReturnType<typeof updateMetadata>,\n TError,\n { datasetid: string; datasetversion: number; metaparameters: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Creates new annotations of the specified type(s) and add to the metadata for the dataset.\nThe annotations are provided in a list in JSON format. For details of the annotations that can be created, see the data-manager-metadata library,\n\n * @summary Add new annotations to the Metadata for the Dataset\n */\nexport const addAnnotations = (\n datasetid: string,\n datasetversion: number,\n datasetAnnotationsPostBodyBody: DatasetAnnotationsPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"annotations\", datasetAnnotationsPostBodyBody.annotations);\n\n return customInstance<DatasetAnnotationsPostResponse>(\n {\n url: `/dataset/${datasetid}/annotations/${datasetversion}`,\n method: \"post\",\n data: formData,\n },\n options\n );\n};\n\nexport const useAddAnnotations = <\n TError = Error | void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addAnnotations>,\n TError,\n {\n datasetid: string;\n datasetversion: number;\n data: DatasetAnnotationsPostBodyBody;\n },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addAnnotations>,\n {\n datasetid: string;\n datasetversion: number;\n data: DatasetAnnotationsPostBodyBody;\n }\n > = (props) => {\n const { datasetid, datasetversion, data } = props || {};\n\n return addAnnotations(datasetid, datasetversion, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addAnnotations>,\n TError,\n {\n datasetid: string;\n datasetversion: number;\n data: DatasetAnnotationsPostBodyBody;\n },\n TContext\n >(mutationFn, mutationOptions);\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) => {\n return customInstance<DatasetSchemaGetResponse>(\n { url: `/dataset/${datasetid}/schema/${datasetversion}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetSchemaQueryKey = (\n datasetid: string,\n datasetversion: number\n) => [`/dataset/${datasetid}/schema/${datasetversion}`];\n\nexport const useGetSchema = <\n TData = AsyncReturnType<typeof getSchema>,\n TError = void | Error\n>(\n datasetid: string,\n datasetversion: number,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getSchema>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetSchemaQueryKey(datasetid, datasetversion);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getSchema>> = () =>\n getSchema(datasetid, datasetversion, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getSchema>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(datasetid && datasetversion), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n"],
|
|
5
|
-
"mappings": "gDAUA,wDAiDO,GAAM,GAAwB,CACnC,EACA,IACG,CACH,GAAM,GAAW,GAAI,UACrB,SAAS,OAAO,eAAgB,EAAmB,cAC/C,EAAmB,yBAA2B,QAChD,EAAS,OACP,yBACA,EAAmB,wBAGnB,EAAmB,qBAAuB,QAC5C,EAAS,OACP,qBACA,EAAmB,mBAAmB,YAG1C,EAAS,OAAO,aAAc,EAAmB,YACjD,EAAS,OAAO,OAAQ,EAAmB,MAC3C,EAAS,OAAO,YAAa,EAAmB,WAC5C,EAAmB,YAAc,QACnC,EAAS,OAAO,YAAa,EAAmB,WAE9C,EAAmB,iBAAmB,QACxC,EAAS,OACP,iBACA,EAAmB,eAAe,YAGlC,EAAmB,kBAAoB,QACzC,EAAS,OAAO,kBAAmB,EAAmB,iBAEpD,EAAmB,UAAY,QACjC,EAAS,OAAO,UAAW,EAAmB,SAGzC,EACL,CAAE,IAAK,WAAY,OAAQ,MAAO,KAAM,GACxC,IAIS,EAA2B,AAGtC,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MA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AAC,GAAU,IAEnD,EAAiB,CAI5B,EACA,EACA,IAIG,CA7SL,MA8SE,GAAM,CAAE,MAAO,EAAc,QAAS,GAAmB,GAAW,GAE9D,EACJ,oBAAc,WAAd,OAA0B,EAAuB,EAAW,GAKxD,EAAQ,EACZ,EAJkE,IAClE,EAAY,EAAW,EAAQ,GAK/B,GAAE,QAAS,CAAC,CAAC,GAAc,IAG7B,MAAO,IACL,YACG,IAaM,EAAgB,CAC3B,EACA,EACA,EACA,IAEO,EACL,CACE,IAAK,YAAY,KAAa,IAC9B,OAAQ,SACR,UAEF,GAIS,EAAmB,AAG9B,GAQI,CACJ,GAAM,CAAE,SAAU,EAAiB,QAAS,GAAmB,GAAW,GAW1E,MAAO,GANH,AAAC,GAAU,CACb,GAAM,CAAE,YAAW,iBAAgB,UAAW,GAAS,GAEvD,MAAO,GAAc,EAAW,EAAgB,EAAQ,IAQ5C,IASH,EAAkB,CAC7B,EACA,EACA,IAEO,EACL,
|
|
4
|
+
"sourcesContent": ["/**\n * Generated by orval v6.3.0 \uD83C\uDF7A\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: 0.6\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n} from \"react-query\";\nimport type {\n DatasetPutPostResponse,\n Error,\n DatasetPutBodyBody,\n DatasetPostBodyBody,\n DatasetsGetResponse,\n GetDatasetsParams,\n DatasetVersionsGetResponse,\n GetVersionsParams,\n DatasetVersionDeleteResponse,\n DeleteDatasetParams,\n DatasetDigestGetResponse,\n DatasetMetaGetResponse,\n DatasetAnnotationsPostResponse,\n DatasetAnnotationsPostBodyBody,\n DatasetSchemaGetResponse,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\n\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\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 a 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 Add a File from a Project as a Dataset\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.parent_id !== undefined) {\n formData.append(\"parent_id\", datasetPutBodyBody.parent_id);\n }\n if (datasetPutBodyBody.parent_version !== undefined) {\n formData.append(\n \"parent_version\",\n datasetPutBodyBody.parent_version.toString()\n );\n }\n if (datasetPutBodyBody.organisation_id !== undefined) {\n formData.append(\"organisation_id\", datasetPutBodyBody.organisation_id);\n }\n if (datasetPutBodyBody.unit_id !== undefined) {\n formData.append(\"unit_id\", datasetPutBodyBody.unit_id);\n }\n\n return customInstance<DatasetPutPostResponse>(\n { url: `/dataset`, method: \"put\", data: formData },\n options\n );\n};\n\nexport const useCreateDatasetFromFile = <\n TError = void | Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<typeof createDatasetFromFile>,\n { data: DatasetPutBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return createDatasetFromFile(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<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 formData.append(\"as_filename\", datasetPostBodyBody.as_filename);\n if (datasetPostBodyBody.parent_id !== undefined) {\n formData.append(\"parent_id\", datasetPostBodyBody.parent_id);\n }\n if (datasetPostBodyBody.parent_version !== undefined) {\n formData.append(\n \"parent_version\",\n datasetPostBodyBody.parent_version.toString()\n );\n }\n formData.append(\"organisation_id\", datasetPostBodyBody.organisation_id);\n formData.append(\"unit_id\", datasetPostBodyBody.unit_id);\n\n return customInstance<DatasetPutPostResponse>(\n { url: `/dataset`, method: \"post\", data: formData },\n options\n );\n};\n\nexport const useUploadDataset = <\n TError = void | Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<typeof uploadDataset>,\n { data: DatasetPostBodyBody }\n > = (props) => {\n const { data } = props || {};\n\n return uploadDataset(data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<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) => {\n return customInstance<DatasetsGetResponse>(\n { url: `/dataset`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetDatasetsQueryKey = (params?: GetDatasetsParams) => [\n `/dataset`,\n ...(params ? [params] : []),\n];\n\nexport const useGetDatasets = <\n TData = AsyncReturnType<typeof getDatasets>,\n TError = void | Error\n>(\n params?: GetDatasetsParams,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getDatasets>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetDatasetsQueryKey(params);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getDatasets>> = () =>\n getDatasets(params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getDatasets>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\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) => {\n return customInstance<DatasetVersionsGetResponse>(\n { url: `/dataset/${datasetid}/versions`, method: \"get\", params },\n options\n );\n};\n\nexport const getGetVersionsQueryKey = (\n datasetid: string,\n params?: GetVersionsParams\n) => [`/dataset/${datasetid}/versions`, ...(params ? [params] : [])];\n\nexport const useGetVersions = <\n TData = AsyncReturnType<typeof getVersions>,\n TError = void | Error\n>(\n datasetid: string,\n params?: GetVersionsParams,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getVersions>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetVersionsQueryKey(datasetid, params);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getVersions>> = () =>\n getVersions(datasetid, params, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getVersions>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!datasetid, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\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 const useDeleteDataset = <\n TError = void | Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<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 AsyncReturnType<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) => {\n return customInstance<void>(\n { url: `/dataset/${datasetid}/${datasetversion}`, method: \"get\" },\n options\n );\n};\n\nexport const getDownloadDatasetQueryKey = (\n datasetid: string,\n datasetversion: number\n) => [`/dataset/${datasetid}/${datasetversion}`];\n\nexport const useDownloadDataset = <\n TData = AsyncReturnType<typeof downloadDataset>,\n TError = Error\n>(\n datasetid: string,\n datasetversion: number,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof downloadDataset>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getDownloadDatasetQueryKey(datasetid, datasetversion);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof downloadDataset>> = () =>\n downloadDataset(datasetid, datasetversion, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof downloadDataset>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!(datasetid && datasetversion),\n ...queryOptions,\n });\n\n return {\n queryKey,\n ...query,\n };\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 const useRemoveEditorFromDataset = <\n TError = Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<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 AsyncReturnType<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 {\n url: `/dataset/${datasetid}/editor/${userid}`,\n method: \"put\",\n data: undefined,\n },\n options\n );\n};\n\nexport const useAddEditorToDataset = <\n TError = Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<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 AsyncReturnType<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 AsyncReturnType<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-charcater hexstring.\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) => {\n return customInstance<DatasetDigestGetResponse>(\n { url: `/dataset/digest/${datasetdigest}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetDatasetDigestQueryKey = (datasetdigest: string) => [\n `/dataset/digest/${datasetdigest}`,\n];\n\nexport const useGetDatasetDigest = <\n TData = AsyncReturnType<typeof getDatasetDigest>,\n TError = void | Error\n>(\n datasetdigest: string,\n options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof getDatasetDigest>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetDatasetDigestQueryKey(datasetdigest);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getDatasetDigest>> = () =>\n getDatasetDigest(datasetdigest, requestOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof getDatasetDigest>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!datasetdigest, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Returns the metadata for a Dataset versions in JSON format.\n\n * @summary Gets the metadata for a specific Dataset\n */\nexport const getMetadata = (\n datasetid: string,\n datasetversion: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<DatasetMetaGetResponse>(\n { url: `/dataset/${datasetid}/meta/${datasetversion}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetMetadataQueryKey = (\n datasetid: string,\n datasetversion: number\n) => [`/dataset/${datasetid}/meta/${datasetversion}`];\n\nexport const useGetMetadata = <\n TData = AsyncReturnType<typeof getMetadata>,\n TError = void | Error\n>(\n datasetid: string,\n datasetversion: number,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getMetadata>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetid, datasetversion);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getMetadata>> = () =>\n getMetadata(datasetid, datasetversion, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getMetadata>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(datasetid && datasetversion), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Updates the metadata for a Dataset based on the given parameter array.\n\n * @summary Update the metadata for a specific Dataset\n */\nexport const updateMetadata = (\n datasetid: string,\n datasetversion: number,\n metaparameters: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n {\n url: `/dataset/${datasetid}/meta/${datasetversion}/${metaparameters}`,\n method: \"patch\",\n data: undefined,\n },\n options\n );\n};\n\nexport const useUpdateMetadata = <\n TError = Error,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof updateMetadata>,\n TError,\n { datasetid: string; datasetversion: number; metaparameters: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof updateMetadata>,\n { datasetid: string; datasetversion: number; metaparameters: string }\n > = (props) => {\n const { datasetid, datasetversion, metaparameters } = props || {};\n\n return updateMetadata(\n datasetid,\n datasetversion,\n metaparameters,\n requestOptions\n );\n };\n\n return useMutation<\n AsyncReturnType<typeof updateMetadata>,\n TError,\n { datasetid: string; datasetversion: number; metaparameters: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Creates new annotations of the specified type(s) and add to the metadata for the dataset.\nThe annotations are provided in a list in JSON format. For details of the annotations that can be created, see the data-manager-metadata library,\n\n * @summary Add new annotations to the Metadata for the Dataset\n */\nexport const addAnnotations = (\n datasetid: string,\n datasetversion: number,\n datasetAnnotationsPostBodyBody: DatasetAnnotationsPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"annotations\", datasetAnnotationsPostBodyBody.annotations);\n\n return customInstance<DatasetAnnotationsPostResponse>(\n {\n url: `/dataset/${datasetid}/annotations/${datasetversion}`,\n method: \"post\",\n data: formData,\n },\n options\n );\n};\n\nexport const useAddAnnotations = <\n TError = Error | void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n AsyncReturnType<typeof addAnnotations>,\n TError,\n {\n datasetid: string;\n datasetversion: number;\n data: DatasetAnnotationsPostBodyBody;\n },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options || {};\n\n const mutationFn: MutationFunction<\n AsyncReturnType<typeof addAnnotations>,\n {\n datasetid: string;\n datasetversion: number;\n data: DatasetAnnotationsPostBodyBody;\n }\n > = (props) => {\n const { datasetid, datasetversion, data } = props || {};\n\n return addAnnotations(datasetid, datasetversion, data, requestOptions);\n };\n\n return useMutation<\n AsyncReturnType<typeof addAnnotations>,\n TError,\n {\n datasetid: string;\n datasetversion: number;\n data: DatasetAnnotationsPostBodyBody;\n },\n TContext\n >(mutationFn, mutationOptions);\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) => {\n return customInstance<DatasetSchemaGetResponse>(\n { url: `/dataset/${datasetid}/schema/${datasetversion}`, method: \"get\" },\n options\n );\n};\n\nexport const getGetSchemaQueryKey = (\n datasetid: string,\n datasetversion: number\n) => [`/dataset/${datasetid}/schema/${datasetversion}`];\n\nexport const useGetSchema = <\n TData = AsyncReturnType<typeof getSchema>,\n TError = void | Error\n>(\n datasetid: string,\n datasetversion: number,\n options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getSchema>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n) => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetSchemaQueryKey(datasetid, datasetversion);\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getSchema>> = () =>\n getSchema(datasetid, datasetversion, requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getSchema>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(datasetid && datasetversion), ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n"],
|
|
5
|
+
"mappings": "gDAUA,wDAiDO,GAAM,GAAwB,CACnC,EACA,IACG,CACH,GAAM,GAAW,GAAI,UACrB,SAAS,OAAO,eAAgB,EAAmB,cAC/C,EAAmB,yBAA2B,QAChD,EAAS,OACP,yBACA,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AAqB,EAAW,GAKtD,EAAQ,EACZ,EAJgE,IAChE,EAAU,EAAW,EAAgB,GAKrC,GAAE,QAAS,CAAC,CAAE,IAAa,IAAoB,IAGjD,MAAO,IACL,YACG",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/file/file.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOULWOQLWcjs = require('../chunk-OULWOQLW.cjs');var _reactquery = require('react-query');var m=(e,n)=>_chunkOULWOQLWcjs.e.call(void 0, {url:"/file",method:"get",params:e},n),l= exports.getGetFilesQueryKey =e=>["/file",...e?[e]:[]],U= exports.useGetFiles =(e,n)=>{var i;let{query:t,request:a}=n||{},r=(i=t==null?void 0:t.queryKey)!=null?i:l(e),p=_reactquery.useQuery.call(void 0, r,()=>m(e,a),t);return _chunkOULWOQLWcjs.a.call(void 0, {queryKey:r},p)},d= exports.attachFile =(e,n)=>{let t=new FormData;return t.append("dataset_id",e.dataset_id),t.append("dataset_version",e.dataset_version.toString()),t.append("project_id",e.project_id),t.append("as_type",e.as_type),e.path!==void 0&&t.append("path",e.path),e.compress!==void 0&&t.append("compress",e.compress.toString()),e.immutable!==void 0&&t.append("immutable",e.immutable.toString()),_chunkOULWOQLWcjs.e.call(void 0, {url:"/file",method:"post",data:t},n)},h= exports.useAttachFile =e=>{let{mutation:n,request:t}=e||{};return _reactquery.useMutation.call(void 0, r=>{let{data:o}=r||{};return d(o,t)},n)},F= exports.deleteUnmanagedFile =(e,n)=>_chunkOULWOQLWcjs.e.call(void 0, {url:"/file",method:"delete",params:e},n),S= exports.useDeleteUnmanagedFile =e=>{let{mutation:n,request:t}=e||{};return _reactquery.useMutation.call(void 0, r=>{let{params:o}=r||{};return F(o,t)},n)},T= exports.deleteFile =(e,n)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/file/${e}`,method:"delete"},n),O= exports.useDeleteFile =e=>{let{mutation:n,request:t}=e||{};return _reactquery.useMutation.call(void 0, r=>{let{fileid:o}=r||{};return T(o,t)},n)},f= exports.downloadFile =(e,n)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/file/${e}`,method:"get"
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOULWOQLWcjs = require('../chunk-OULWOQLW.cjs');var _reactquery = require('react-query');var m=(e,n)=>_chunkOULWOQLWcjs.e.call(void 0, {url:"/file",method:"get",params:e},n),l= exports.getGetFilesQueryKey =e=>["/file",...e?[e]:[]],U= exports.useGetFiles =(e,n)=>{var i;let{query:t,request:a}=n||{},r=(i=t==null?void 0:t.queryKey)!=null?i:l(e),p=_reactquery.useQuery.call(void 0, r,()=>m(e,a),t);return _chunkOULWOQLWcjs.a.call(void 0, {queryKey:r},p)},d= exports.attachFile =(e,n)=>{let t=new FormData;return t.append("dataset_id",e.dataset_id),t.append("dataset_version",e.dataset_version.toString()),t.append("project_id",e.project_id),t.append("as_type",e.as_type),e.path!==void 0&&t.append("path",e.path),e.compress!==void 0&&t.append("compress",e.compress.toString()),e.immutable!==void 0&&t.append("immutable",e.immutable.toString()),_chunkOULWOQLWcjs.e.call(void 0, {url:"/file",method:"post",data:t},n)},h= exports.useAttachFile =e=>{let{mutation:n,request:t}=e||{};return _reactquery.useMutation.call(void 0, r=>{let{data:o}=r||{};return d(o,t)},n)},F= exports.deleteUnmanagedFile =(e,n)=>_chunkOULWOQLWcjs.e.call(void 0, {url:"/file",method:"delete",params:e},n),S= exports.useDeleteUnmanagedFile =e=>{let{mutation:n,request:t}=e||{};return _reactquery.useMutation.call(void 0, r=>{let{params:o}=r||{};return F(o,t)},n)},T= exports.deleteFile =(e,n)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/file/${e}`,method:"delete"},n),O= exports.useDeleteFile =e=>{let{mutation:n,request:t}=e||{};return _reactquery.useMutation.call(void 0, r=>{let{fileid:o}=r||{};return T(o,t)},n)},f= exports.downloadFile =(e,n)=>_chunkOULWOQLWcjs.e.call(void 0, {url:`/file/${e}`,method:"get"},n),g= exports.getDownloadFileQueryKey =e=>[`/file/${e}`],w= exports.useDownloadFile =(e,n)=>{var i;let{query:t,request:a}=n||{},r=(i=t==null?void 0:t.queryKey)!=null?i:g(e),p=_reactquery.useQuery.call(void 0, r,()=>f(e,a),_chunkOULWOQLWcjs.a.call(void 0, {enabled:!!e},t));return _chunkOULWOQLWcjs.a.call(void 0, {queryKey:r},p)};exports.attachFile = d; exports.deleteFile = T; exports.deleteUnmanagedFile = F; exports.downloadFile = f; exports.getDownloadFileQueryKey = g; exports.getFiles = m; exports.getGetFilesQueryKey = l; exports.useAttachFile = h; exports.useDeleteFile = O; exports.useDeleteUnmanagedFile = S; exports.useDownloadFile = w; exports.useGetFiles = U;
|
|
2
2
|
//# sourceMappingURL=file.cjs.map
|