@squonk/data-manager-client 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accounting/accounting.cjs +16 -12
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.ts +8 -8
- package/accounting/accounting.js +13 -9
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +19 -14
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +23 -23
- package/admin/admin.js +10 -5
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +12 -10
- package/application/application.cjs.map +1 -1
- package/application/application.d.ts +6 -6
- package/application/application.js +10 -8
- package/application/application.js.map +1 -1
- package/{chunk-3O5KIRV4.js → chunk-3RNIDX7T.js} +1 -1
- package/{chunk-3O5KIRV4.js.map → chunk-3RNIDX7T.js.map} +1 -1
- package/chunk-LNYWU37B.cjs +13 -0
- package/chunk-LNYWU37B.cjs.map +1 -0
- package/chunk-LT4O36DN.js +13 -0
- package/chunk-LT4O36DN.js.map +1 -0
- package/{chunk-IUEU2LYC.cjs → chunk-UZTHSGDT.cjs} +1 -1
- package/chunk-UZTHSGDT.cjs.map +1 -0
- package/{custom-instance-5c7b6971.d.ts → custom-instance-b5dd9223.d.ts} +259 -98
- package/dataset/dataset.cjs +29 -32
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +24 -24
- package/dataset/dataset.js +19 -22
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs +22 -18
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.ts +16 -16
- package/exchange-rate/exchange-rate.js +16 -12
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file/file.cjs +15 -15
- package/file/file.cjs.map +1 -1
- package/file/file.d.ts +13 -13
- package/file/file.js +10 -10
- package/file/file.js.map +1 -1
- package/index.cjs +2 -2
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs +17 -15
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.ts +18 -18
- package/instance/instance.js +10 -8
- package/instance/instance.js.map +1 -1
- package/job/job.cjs +16 -14
- package/job/job.cjs.map +1 -1
- package/job/job.d.ts +8 -8
- package/job/job.js +13 -11
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +14 -15
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.ts +12 -12
- package/metadata/metadata.js +10 -11
- package/metadata/metadata.js.map +1 -1
- package/package.json +12 -12
- package/project/project.cjs +28 -29
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +29 -29
- package/project/project.js +16 -17
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +14 -13
- package/src/admin/admin.ts +10 -9
- package/src/application/application.ts +10 -10
- package/src/data-manager-api.schemas.ts +206 -27
- package/src/dataset/dataset.ts +22 -24
- package/src/exchange-rate/exchange-rate.ts +18 -19
- package/src/file/file.ts +10 -10
- package/src/instance/instance.ts +10 -10
- package/src/job/job.ts +14 -13
- package/src/metadata/metadata.ts +10 -11
- package/src/project/project.ts +18 -19
- package/src/queryMutator.ts +12 -0
- package/src/task/task.ts +10 -9
- package/src/type/type.ts +6 -5
- package/src/user/user.ts +14 -13
- package/task/task.cjs +13 -12
- package/task/task.cjs.map +1 -1
- package/task/task.d.ts +8 -8
- package/task/task.js +10 -9
- package/task/task.js.map +1 -1
- package/type/type.cjs +8 -4
- package/type/type.cjs.map +1 -1
- package/type/type.d.ts +4 -4
- package/type/type.js +7 -3
- package/type/type.js.map +1 -1
- package/user/user.cjs +17 -13
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +11 -11
- package/user/user.js +13 -9
- package/user/user.js.map +1 -1
- package/chunk-IUEU2LYC.cjs.map +0 -1
package/file/file.cjs
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkLNYWU37Bcjs = require('../chunk-LNYWU37B.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkUZTHSGDTcjs = require('../chunk-UZTHSGDT.cjs');
|
|
4
7
|
|
|
5
8
|
// src/file/file.ts
|
|
6
9
|
var _reactquery = require('@tanstack/react-query');
|
|
7
10
|
var getFiles = (params, options, signal) => {
|
|
8
|
-
return
|
|
11
|
+
return _chunkUZTHSGDTcjs.customInstance.call(void 0,
|
|
9
12
|
{ url: `/file`, method: "get", params, signal },
|
|
10
13
|
options
|
|
11
14
|
);
|
|
@@ -20,12 +23,11 @@ var useGetFiles = (params, options) => {
|
|
|
20
23
|
const queryFn = ({
|
|
21
24
|
signal
|
|
22
25
|
}) => getFiles(params, requestOptions, signal);
|
|
26
|
+
const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
|
|
23
27
|
const query = _reactquery.useQuery.call(void 0,
|
|
24
|
-
|
|
25
|
-
queryFn,
|
|
26
|
-
queryOptions
|
|
28
|
+
customOptions
|
|
27
29
|
);
|
|
28
|
-
query.queryKey = queryKey;
|
|
30
|
+
query.queryKey = customOptions.queryKey;
|
|
29
31
|
return query;
|
|
30
32
|
};
|
|
31
33
|
var attachFile = (filePostBodyBody, options) => {
|
|
@@ -46,7 +48,7 @@ var attachFile = (filePostBodyBody, options) => {
|
|
|
46
48
|
if (filePostBodyBody.immutable !== void 0) {
|
|
47
49
|
formData.append("immutable", filePostBodyBody.immutable.toString());
|
|
48
50
|
}
|
|
49
|
-
return
|
|
51
|
+
return _chunkUZTHSGDTcjs.customInstance.call(void 0,
|
|
50
52
|
{
|
|
51
53
|
url: `/file`,
|
|
52
54
|
method: "post",
|
|
@@ -65,7 +67,7 @@ var useAttachFile = (options) => {
|
|
|
65
67
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
66
68
|
};
|
|
67
69
|
var deleteUnmanagedFile = (params, options) => {
|
|
68
|
-
return
|
|
70
|
+
return _chunkUZTHSGDTcjs.customInstance.call(void 0,
|
|
69
71
|
{ url: `/file`, method: "delete", params },
|
|
70
72
|
options
|
|
71
73
|
);
|
|
@@ -79,7 +81,7 @@ var useDeleteUnmanagedFile = (options) => {
|
|
|
79
81
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
80
82
|
};
|
|
81
83
|
var deleteFile = (fileId, options) => {
|
|
82
|
-
return
|
|
84
|
+
return _chunkUZTHSGDTcjs.customInstance.call(void 0,
|
|
83
85
|
{ url: `/file/${fileId}`, method: "delete" },
|
|
84
86
|
options
|
|
85
87
|
);
|
|
@@ -93,7 +95,7 @@ var useDeleteFile = (options) => {
|
|
|
93
95
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
94
96
|
};
|
|
95
97
|
var downloadFile = (fileId, options, signal) => {
|
|
96
|
-
return
|
|
98
|
+
return _chunkUZTHSGDTcjs.customInstance.call(void 0,
|
|
97
99
|
{ url: `/file/${fileId}`, method: "get", signal },
|
|
98
100
|
options
|
|
99
101
|
);
|
|
@@ -105,11 +107,9 @@ var useDownloadFile = (fileId, options) => {
|
|
|
105
107
|
const queryFn = ({
|
|
106
108
|
signal
|
|
107
109
|
}) => downloadFile(fileId, requestOptions, signal);
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
});
|
|
112
|
-
query.queryKey = queryKey;
|
|
110
|
+
const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
|
|
111
|
+
const query = _reactquery.useQuery.call(void 0, customOptions);
|
|
112
|
+
query.queryKey = customOptions.queryKey;
|
|
113
113
|
return query;
|
|
114
114
|
};
|
|
115
115
|
|
package/file/file.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,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WAAmB,CAAC,SAAS,QAAQ;AAOtE,IAAM,kBAAkB,CAI7B,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,wBAAwB,MAAM;AAEzE,QAAM,UAAmE,CAAC;AAAA,IACxE;AAAA,EACF,MAAM,aAAa,QAAQ,gBAAgB,MAAM;AAEjD,QAAM,QAAQ,SAIZ,UAAU,SAAS;AAAA,IACnB,SAAS,CAAC,CAAC;AAAA,IACX,GAAG;AAAA,EACL,CAAC;AAED,QAAM,WAAW;AAEjB,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.10.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n FilesGetResponse,\n DmError,\n GetFilesParams,\n FilePostResponse,\n FilePostBodyBody,\n DeleteUnmanagedFileParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Given a Project and Path the files available to you on that path will be returned along with any additional paths (sub-directories).\n\n * @summary Gets the Files on a Project Path\n */\nexport const getFiles = (\n params: GetFilesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<FilesGetResponse>(\n { url: `/file`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetFilesQueryKey = (params: GetFilesParams) => [\n `/file`,\n ...(params ? [params] : []),\n];\n\nexport type GetFilesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getFiles>>\n>;\nexport type GetFilesQueryError = ErrorType<void | DmError>;\n\nexport const useGetFiles = <\n TData = Awaited<ReturnType<typeof getFiles>>,\n TError = ErrorType<void | DmError>\n>(\n params: GetFilesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getFiles>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetFilesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getFiles>>> = ({\n signal,\n }) => getFiles(params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getFiles>>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Given a Project and a Dataset the Dataset will be attached (added) to the project as a File using the format provided. When attached the Dataset is referred to as a Project **file**. As format conversion may take some time the file may not be immediately available. You should use the `task_id` you're presented with on the **\\/task** endpoint to determine when the file is available to the project.\n\nOnly datasets attached to projects are available through the Project API. A dataset that you upload to the **Data Manager** is only available to others (who are not already `editors` of the data) when the dataset is attached to a project.\n\nAn `editor` of a **dataset** is not automatically and `editor` of the **project** it's attached to.\n\nYou must be an `editor` or the `owner` of the project to attach a dataset to a project. Being an `editor` of the dataset you are attaching does not give you the ability to detach it from the project.\n\nYou cannot add a Dataset to a Project until its upload is complete.\n\n * @summary Attach a Dataset, as a File, to a Project\n */\nexport const attachFile = (\n filePostBodyBody: FilePostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_id\", filePostBodyBody.dataset_id);\n formData.append(\n \"dataset_version\",\n filePostBodyBody.dataset_version.toString()\n );\n formData.append(\"project_id\", filePostBodyBody.project_id);\n formData.append(\"as_type\", filePostBodyBody.as_type);\n if (filePostBodyBody.path !== undefined) {\n formData.append(\"path\", filePostBodyBody.path);\n }\n if (filePostBodyBody.compress !== undefined) {\n formData.append(\"compress\", filePostBodyBody.compress.toString());\n }\n if (filePostBodyBody.immutable !== undefined) {\n formData.append(\"immutable\", filePostBodyBody.immutable.toString());\n }\n\n return customInstance<FilePostResponse>(\n {\n url: `/file`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AttachFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof attachFile>>\n>;\nexport type AttachFileMutationBody = FilePostBodyBody;\nexport type AttachFileMutationError = ErrorType<void | DmError>;\n\nexport const useAttachFile = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachFile>>,\n { data: FilePostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return attachFile(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes an unmanaged file from a Project. You cannot use this endpoint to delete managed project files.\n\nYou must be an `editor` or the `owner` of the project to delete a file from a project.\n\n * @summary Delete an unmanaged Project File\n */\nexport const deleteUnmanagedFile = (\n params: DeleteUnmanagedFileParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/file`, method: \"delete\", params },\n options\n );\n};\n\nexport type DeleteUnmanagedFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>\n>;\n\nexport type DeleteUnmanagedFileMutationError = ErrorType<DmError>;\n\nexport const useDeleteUnmanagedFile = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n { params: DeleteUnmanagedFileParams }\n > = (props) => {\n const { params } = props ?? {};\n\n return deleteUnmanagedFile(params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Given a `file_id` the file will be removed from the project it's attached to.\n\nYou must be an `editor` or the `owner` of the project to delete a file from a project. Being an `editor` of the original dataset does not give you the ability to detach it from the project.\n\nYou cannot delete a Project File until the attach is complete.\n\n * @summary Delete/detach a File (from a project)\n */\nexport const deleteFile = (\n fileId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/file/${fileId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteFile>>\n>;\n\nexport type DeleteFileMutationError = ErrorType<DmError>;\n\nexport const useDeleteFile = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteFile>>,\n { fileId: string }\n > = (props) => {\n const { fileId } = props ?? {};\n\n return deleteFile(fileId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Given a `file_id` the file will be returned if available.\n\nYou cannot get a Project File until the attach is complete.\n\n * @summary Download a File (from a project)\n */\nexport const downloadFile = (\n fileId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/file/${fileId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getDownloadFileQueryKey = (fileId: string) => [`/file/${fileId}`];\n\nexport type DownloadFileQueryResult = NonNullable<\n Awaited<ReturnType<typeof downloadFile>>\n>;\nexport type DownloadFileQueryError = ErrorType<DmError>;\n\nexport const useDownloadFile = <\n TData = Awaited<ReturnType<typeof downloadFile>>,\n TError = ErrorType<DmError>\n>(\n fileId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getDownloadFileQueryKey(fileId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadFile>>> = ({\n signal,\n }) => downloadFile(fileId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof downloadFile>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!fileId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/file/file.ts"],"names":[],"mappings":";;;;;;;;AAUA,SAAS,UAAU,mBAAmB;AAkC/B,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,sBAAsB,CAAC,WAA2B;AAAA,EAC7D;AAAA,EACA,GAAI,SAA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,EACF,MAAM,aAAa,QAAQ,gBAAgB,MAAM;AAEjD,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ,SAIZ,aAAa;AAEf,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.12.1 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n FilesGetResponse,\n DmError,\n GetFilesParams,\n FilePostResponse,\n FilePostBodyBody,\n DeleteUnmanagedFileParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././queryMutator\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Given a Project and Path the files available to you on that path will be returned along with any additional paths (sub-directories).\n\n * @summary Gets the Files on a Project Path\n */\nexport const getFiles = (\n params: GetFilesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<FilesGetResponse>(\n { url: `/file`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetFilesQueryKey = (params: GetFilesParams) => [\n `/file`,\n ...(params ? [params] : []),\n];\n\nexport type GetFilesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getFiles>>\n>;\nexport type GetFilesQueryError = ErrorType<void | DmError>;\n\nexport const useGetFiles = <\n TData = Awaited<ReturnType<typeof getFiles>>,\n TError = ErrorType<void | DmError>\n>(\n params: GetFilesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getFiles>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetFilesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getFiles>>> = ({\n signal,\n }) => getFiles(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<Awaited<ReturnType<typeof getFiles>>, TError, TData>(\n customOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Given a Project and a Dataset the Dataset will be attached (added) to the project as a File using the format provided. When attached the Dataset is referred to as a Project **file**. As format conversion may take some time the file may not be immediately available. You should use the `task_id` you're presented with on the **\\/task** endpoint to determine when the file is available to the project.\n\nOnly datasets attached to projects are available through the Project API. A dataset that you upload to the **Data Manager** is only available to others (who are not already `editors` of the data) when the dataset is attached to a project.\n\nAn `editor` of a **dataset** is not automatically and `editor` of the **project** it's attached to.\n\nYou must be an `editor` or the `owner` of the project to attach a dataset to a project. Being an `editor` of the dataset you are attaching does not give you the ability to detach it from the project.\n\nYou cannot add a Dataset to a Project until its upload is complete.\n\n * @summary Attach a Dataset, as a File, to a Project\n */\nexport const attachFile = (\n filePostBodyBody: FilePostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_id\", filePostBodyBody.dataset_id);\n formData.append(\n \"dataset_version\",\n filePostBodyBody.dataset_version.toString()\n );\n formData.append(\"project_id\", filePostBodyBody.project_id);\n formData.append(\"as_type\", filePostBodyBody.as_type);\n if (filePostBodyBody.path !== undefined) {\n formData.append(\"path\", filePostBodyBody.path);\n }\n if (filePostBodyBody.compress !== undefined) {\n formData.append(\"compress\", filePostBodyBody.compress.toString());\n }\n if (filePostBodyBody.immutable !== undefined) {\n formData.append(\"immutable\", filePostBodyBody.immutable.toString());\n }\n\n return customInstance<FilePostResponse>(\n {\n url: `/file`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AttachFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof attachFile>>\n>;\nexport type AttachFileMutationBody = FilePostBodyBody;\nexport type AttachFileMutationError = ErrorType<void | DmError>;\n\nexport const useAttachFile = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachFile>>,\n { data: FilePostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return attachFile(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes an unmanaged file from a Project. You cannot use this endpoint to delete managed project files.\n\nYou must be an `editor` or the `owner` of the project to delete a file from a project.\n\n * @summary Delete an unmanaged Project File\n */\nexport const deleteUnmanagedFile = (\n params: DeleteUnmanagedFileParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/file`, method: \"delete\", params },\n options\n );\n};\n\nexport type DeleteUnmanagedFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>\n>;\n\nexport type DeleteUnmanagedFileMutationError = ErrorType<DmError>;\n\nexport const useDeleteUnmanagedFile = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n { params: DeleteUnmanagedFileParams }\n > = (props) => {\n const { params } = props ?? {};\n\n return deleteUnmanagedFile(params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Given a `file_id` the file will be removed from the project it's attached to.\n\nYou must be an `editor` or the `owner` of the project to delete a file from a project. Being an `editor` of the original dataset does not give you the ability to detach it from the project.\n\nYou cannot delete a Project File until the attach is complete.\n\n * @summary Delete/detach a File (from a project)\n */\nexport const deleteFile = (\n fileId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/file/${fileId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteFile>>\n>;\n\nexport type DeleteFileMutationError = ErrorType<DmError>;\n\nexport const useDeleteFile = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteFile>>,\n { fileId: string }\n > = (props) => {\n const { fileId } = props ?? {};\n\n return deleteFile(fileId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Given a `file_id` the file will be returned if available.\n\nYou cannot get a Project File until the attach is complete.\n\n * @summary Download a File (from a project)\n */\nexport const downloadFile = (\n fileId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/file/${fileId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getDownloadFileQueryKey = (fileId: string) => [`/file/${fileId}`];\n\nexport type DownloadFileQueryResult = NonNullable<\n Awaited<ReturnType<typeof downloadFile>>\n>;\nexport type DownloadFileQueryError = ErrorType<DmError>;\n\nexport const useDownloadFile = <\n TData = Awaited<ReturnType<typeof downloadFile>>,\n TError = ErrorType<DmError>\n>(\n fileId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getDownloadFileQueryKey(fileId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadFile>>> = ({\n signal,\n }) => downloadFile(fileId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof downloadFile>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n"]}
|
package/file/file.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
3
|
-
import { l as GetFilesParams,
|
|
3
|
+
import { l as GetFilesParams, bK as customInstance, bm as FilesGetResponse, bL as ErrorType, bG as DmError, a5 as FilePostBodyBody, bn as FilePostResponse, D as DeleteUnmanagedFileParams } from '../custom-instance-b5dd9223.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
|
7
7
|
/**
|
|
8
8
|
* Given a Project and Path the files available to you on that path will be returned along with any additional paths (sub-directories).
|
|
9
9
|
|
|
@@ -11,8 +11,8 @@ declare type SecondParameter<T extends (...args: any) => any> = T extends (confi
|
|
|
11
11
|
*/
|
|
12
12
|
declare const getFiles: (params: GetFilesParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<FilesGetResponse>;
|
|
13
13
|
declare const getGetFilesQueryKey: (params: GetFilesParams) => (string | GetFilesParams)[];
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
type GetFilesQueryResult = NonNullable<Awaited<ReturnType<typeof getFiles>>>;
|
|
15
|
+
type GetFilesQueryError = ErrorType<void | DmError>;
|
|
16
16
|
declare const useGetFiles: <TData = FilesGetResponse, TError = ErrorType<void | DmError>>(params: GetFilesParams, options?: {
|
|
17
17
|
query?: UseQueryOptions<FilesGetResponse, TError, TData, QueryKey> | undefined;
|
|
18
18
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -33,9 +33,9 @@ You cannot add a Dataset to a Project until its upload is complete.
|
|
|
33
33
|
* @summary Attach a Dataset, as a File, to a Project
|
|
34
34
|
*/
|
|
35
35
|
declare const attachFile: (filePostBodyBody: FilePostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<FilePostResponse>;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
type AttachFileMutationResult = NonNullable<Awaited<ReturnType<typeof attachFile>>>;
|
|
37
|
+
type AttachFileMutationBody = FilePostBodyBody;
|
|
38
|
+
type AttachFileMutationError = ErrorType<void | DmError>;
|
|
39
39
|
declare const useAttachFile: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
40
40
|
mutation?: UseMutationOptions<FilePostResponse, TError, {
|
|
41
41
|
data: FilePostBodyBody;
|
|
@@ -52,8 +52,8 @@ You must be an `editor` or the `owner` of the project to delete a file from a pr
|
|
|
52
52
|
* @summary Delete an unmanaged Project File
|
|
53
53
|
*/
|
|
54
54
|
declare const deleteUnmanagedFile: (params: DeleteUnmanagedFileParams, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
type DeleteUnmanagedFileMutationResult = NonNullable<Awaited<ReturnType<typeof deleteUnmanagedFile>>>;
|
|
56
|
+
type DeleteUnmanagedFileMutationError = ErrorType<DmError>;
|
|
57
57
|
declare const useDeleteUnmanagedFile: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
58
58
|
mutation?: UseMutationOptions<void, TError, {
|
|
59
59
|
params: DeleteUnmanagedFileParams;
|
|
@@ -72,8 +72,8 @@ You cannot delete a Project File until the attach is complete.
|
|
|
72
72
|
* @summary Delete/detach a File (from a project)
|
|
73
73
|
*/
|
|
74
74
|
declare const deleteFile: (fileId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
type DeleteFileMutationResult = NonNullable<Awaited<ReturnType<typeof deleteFile>>>;
|
|
76
|
+
type DeleteFileMutationError = ErrorType<DmError>;
|
|
77
77
|
declare const useDeleteFile: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
78
78
|
mutation?: UseMutationOptions<void, TError, {
|
|
79
79
|
fileId: string;
|
|
@@ -91,8 +91,8 @@ You cannot get a Project File until the attach is complete.
|
|
|
91
91
|
*/
|
|
92
92
|
declare const downloadFile: (fileId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<void>;
|
|
93
93
|
declare const getDownloadFileQueryKey: (fileId: string) => string[];
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
type DownloadFileQueryResult = NonNullable<Awaited<ReturnType<typeof downloadFile>>>;
|
|
95
|
+
type DownloadFileQueryError = ErrorType<DmError>;
|
|
96
96
|
declare const useDownloadFile: <TData = void, TError = ErrorType<DmError>>(fileId: string, options?: {
|
|
97
97
|
query?: UseQueryOptions<void, TError, TData, QueryKey> | undefined;
|
|
98
98
|
request?: SecondParameter<typeof customInstance>;
|
package/file/file.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
queryMutator
|
|
3
|
+
} from "../chunk-LT4O36DN.js";
|
|
1
4
|
import {
|
|
2
5
|
customInstance
|
|
3
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-3RNIDX7T.js";
|
|
4
7
|
|
|
5
8
|
// src/file/file.ts
|
|
6
9
|
import { useQuery, useMutation } from "@tanstack/react-query";
|
|
@@ -20,12 +23,11 @@ var useGetFiles = (params, options) => {
|
|
|
20
23
|
const queryFn = ({
|
|
21
24
|
signal
|
|
22
25
|
}) => getFiles(params, requestOptions, signal);
|
|
26
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
23
27
|
const query = useQuery(
|
|
24
|
-
|
|
25
|
-
queryFn,
|
|
26
|
-
queryOptions
|
|
28
|
+
customOptions
|
|
27
29
|
);
|
|
28
|
-
query.queryKey = queryKey;
|
|
30
|
+
query.queryKey = customOptions.queryKey;
|
|
29
31
|
return query;
|
|
30
32
|
};
|
|
31
33
|
var attachFile = (filePostBodyBody, options) => {
|
|
@@ -105,11 +107,9 @@ var useDownloadFile = (fileId, options) => {
|
|
|
105
107
|
const queryFn = ({
|
|
106
108
|
signal
|
|
107
109
|
}) => downloadFile(fileId, requestOptions, signal);
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
});
|
|
112
|
-
query.queryKey = queryKey;
|
|
110
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
111
|
+
const query = useQuery(customOptions);
|
|
112
|
+
query.queryKey = customOptions.queryKey;
|
|
113
113
|
return query;
|
|
114
114
|
};
|
|
115
115
|
export {
|
package/file/file.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/file/file.ts"],"sourcesContent":["/**\n * Generated by orval v6.10.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n FilesGetResponse,\n DmError,\n GetFilesParams,\n FilePostResponse,\n FilePostBodyBody,\n DeleteUnmanagedFileParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Given a Project and Path the files available to you on that path will be returned along with any additional paths (sub-directories).\n\n * @summary Gets the Files on a Project Path\n */\nexport const getFiles = (\n params: GetFilesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<FilesGetResponse>(\n { url: `/file`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetFilesQueryKey = (params: GetFilesParams) => [\n `/file`,\n ...(params ? [params] : []),\n];\n\nexport type GetFilesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getFiles>>\n>;\nexport type GetFilesQueryError = ErrorType<void | DmError>;\n\nexport const useGetFiles = <\n TData = Awaited<ReturnType<typeof getFiles>>,\n TError = ErrorType<void | DmError>\n>(\n params: GetFilesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getFiles>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetFilesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getFiles>>> = ({\n signal,\n }) => getFiles(params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getFiles>>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Given a Project and a Dataset the Dataset will be attached (added) to the project as a File using the format provided. When attached the Dataset is referred to as a Project **file**. As format conversion may take some time the file may not be immediately available. You should use the `task_id` you're presented with on the **\\/task** endpoint to determine when the file is available to the project.\n\nOnly datasets attached to projects are available through the Project API. A dataset that you upload to the **Data Manager** is only available to others (who are not already `editors` of the data) when the dataset is attached to a project.\n\nAn `editor` of a **dataset** is not automatically and `editor` of the **project** it's attached to.\n\nYou must be an `editor` or the `owner` of the project to attach a dataset to a project. Being an `editor` of the dataset you are attaching does not give you the ability to detach it from the project.\n\nYou cannot add a Dataset to a Project until its upload is complete.\n\n * @summary Attach a Dataset, as a File, to a Project\n */\nexport const attachFile = (\n filePostBodyBody: FilePostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_id\", filePostBodyBody.dataset_id);\n formData.append(\n \"dataset_version\",\n filePostBodyBody.dataset_version.toString()\n );\n formData.append(\"project_id\", filePostBodyBody.project_id);\n formData.append(\"as_type\", filePostBodyBody.as_type);\n if (filePostBodyBody.path !== undefined) {\n formData.append(\"path\", filePostBodyBody.path);\n }\n if (filePostBodyBody.compress !== undefined) {\n formData.append(\"compress\", filePostBodyBody.compress.toString());\n }\n if (filePostBodyBody.immutable !== undefined) {\n formData.append(\"immutable\", filePostBodyBody.immutable.toString());\n }\n\n return customInstance<FilePostResponse>(\n {\n url: `/file`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AttachFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof attachFile>>\n>;\nexport type AttachFileMutationBody = FilePostBodyBody;\nexport type AttachFileMutationError = ErrorType<void | DmError>;\n\nexport const useAttachFile = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachFile>>,\n { data: FilePostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return attachFile(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes an unmanaged file from a Project. You cannot use this endpoint to delete managed project files.\n\nYou must be an `editor` or the `owner` of the project to delete a file from a project.\n\n * @summary Delete an unmanaged Project File\n */\nexport const deleteUnmanagedFile = (\n params: DeleteUnmanagedFileParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/file`, method: \"delete\", params },\n options\n );\n};\n\nexport type DeleteUnmanagedFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>\n>;\n\nexport type DeleteUnmanagedFileMutationError = ErrorType<DmError>;\n\nexport const useDeleteUnmanagedFile = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n { params: DeleteUnmanagedFileParams }\n > = (props) => {\n const { params } = props ?? {};\n\n return deleteUnmanagedFile(params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Given a `file_id` the file will be removed from the project it's attached to.\n\nYou must be an `editor` or the `owner` of the project to delete a file from a project. Being an `editor` of the original dataset does not give you the ability to detach it from the project.\n\nYou cannot delete a Project File until the attach is complete.\n\n * @summary Delete/detach a File (from a project)\n */\nexport const deleteFile = (\n fileId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/file/${fileId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteFile>>\n>;\n\nexport type DeleteFileMutationError = ErrorType<DmError>;\n\nexport const useDeleteFile = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteFile>>,\n { fileId: string }\n > = (props) => {\n const { fileId } = props ?? {};\n\n return deleteFile(fileId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Given a `file_id` the file will be returned if available.\n\nYou cannot get a Project File until the attach is complete.\n\n * @summary Download a File (from a project)\n */\nexport const downloadFile = (\n fileId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/file/${fileId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getDownloadFileQueryKey = (fileId: string) => [`/file/${fileId}`];\n\nexport type DownloadFileQueryResult = NonNullable<\n Awaited<ReturnType<typeof downloadFile>>\n>;\nexport type DownloadFileQueryError = ErrorType<DmError>;\n\nexport const useDownloadFile = <\n TData = Awaited<ReturnType<typeof downloadFile>>,\n TError = ErrorType<DmError>\n>(\n fileId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getDownloadFileQueryKey(fileId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadFile>>> = ({\n signal,\n }) => downloadFile(fileId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof downloadFile>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!fileId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAiC/B,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,sBAAsB,CAAC,WAA2B;AAAA,EAC7D;AAAA,EACA,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAOO,IAAM,cAAc,CAIzB,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,oBAAoB,MAAM;AAErE,QAAM,UAA+D,CAAC;AAAA,IACpE;AAAA,EACF,MAAM,SAAS,QAAQ,gBAAgB,MAAM;AAE7C,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,WAAW;AAEjB,SAAO;AACT;AAeO,IAAM,aAAa,CACxB,kBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,cAAc,iBAAiB,UAAU;AACzD,WAAS;AAAA,IACP;AAAA,IACA,iBAAiB,gBAAgB,SAAS;AAAA,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A,IAC3C;AAAA,EACF;AACF;AAQO,IAAM,gBAAgB,CAG3B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,IAAI,SAAS,CAAC;AAE7B,WAAO,WAAW,QAAQ,cAAc;AAAA,EAC1C;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAQO,IAAM,eAAe,CAC1B,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,UAAU,QAAQ,OAAO,OAAO;AAAA,IAChD;AAAA,EACF;AACF;AAEO,IAAM,0BAA0B,CAAC,WAAmB,CAAC,SAAS,QAAQ;AAOtE,IAAM,kBAAkB,CAI7B,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,wBAAwB,MAAM;AAEzE,QAAM,UAAmE,CAAC;AAAA,IACxE;AAAA,EACF,MAAM,aAAa,QAAQ,gBAAgB,MAAM;AAEjD,QAAM,QAAQ,SAIZ,UAAU,SAAS;AAAA,IACnB,SAAS,CAAC,CAAC;AAAA,IACX,GAAG;AAAA,EACL,CAAC;AAED,QAAM,WAAW;AAEjB,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/file/file.ts"],"sourcesContent":["/**\n * Generated by orval v6.12.1 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n FilesGetResponse,\n DmError,\n GetFilesParams,\n FilePostResponse,\n FilePostBodyBody,\n DeleteUnmanagedFileParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././queryMutator\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Given a Project and Path the files available to you on that path will be returned along with any additional paths (sub-directories).\n\n * @summary Gets the Files on a Project Path\n */\nexport const getFiles = (\n params: GetFilesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<FilesGetResponse>(\n { url: `/file`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetFilesQueryKey = (params: GetFilesParams) => [\n `/file`,\n ...(params ? [params] : []),\n];\n\nexport type GetFilesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getFiles>>\n>;\nexport type GetFilesQueryError = ErrorType<void | DmError>;\n\nexport const useGetFiles = <\n TData = Awaited<ReturnType<typeof getFiles>>,\n TError = ErrorType<void | DmError>\n>(\n params: GetFilesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getFiles>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetFilesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getFiles>>> = ({\n signal,\n }) => getFiles(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<Awaited<ReturnType<typeof getFiles>>, TError, TData>(\n customOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Given a Project and a Dataset the Dataset will be attached (added) to the project as a File using the format provided. When attached the Dataset is referred to as a Project **file**. As format conversion may take some time the file may not be immediately available. You should use the `task_id` you're presented with on the **\\/task** endpoint to determine when the file is available to the project.\n\nOnly datasets attached to projects are available through the Project API. A dataset that you upload to the **Data Manager** is only available to others (who are not already `editors` of the data) when the dataset is attached to a project.\n\nAn `editor` of a **dataset** is not automatically and `editor` of the **project** it's attached to.\n\nYou must be an `editor` or the `owner` of the project to attach a dataset to a project. Being an `editor` of the dataset you are attaching does not give you the ability to detach it from the project.\n\nYou cannot add a Dataset to a Project until its upload is complete.\n\n * @summary Attach a Dataset, as a File, to a Project\n */\nexport const attachFile = (\n filePostBodyBody: FilePostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_id\", filePostBodyBody.dataset_id);\n formData.append(\n \"dataset_version\",\n filePostBodyBody.dataset_version.toString()\n );\n formData.append(\"project_id\", filePostBodyBody.project_id);\n formData.append(\"as_type\", filePostBodyBody.as_type);\n if (filePostBodyBody.path !== undefined) {\n formData.append(\"path\", filePostBodyBody.path);\n }\n if (filePostBodyBody.compress !== undefined) {\n formData.append(\"compress\", filePostBodyBody.compress.toString());\n }\n if (filePostBodyBody.immutable !== undefined) {\n formData.append(\"immutable\", filePostBodyBody.immutable.toString());\n }\n\n return customInstance<FilePostResponse>(\n {\n url: `/file`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AttachFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof attachFile>>\n>;\nexport type AttachFileMutationBody = FilePostBodyBody;\nexport type AttachFileMutationError = ErrorType<void | DmError>;\n\nexport const useAttachFile = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachFile>>,\n { data: FilePostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return attachFile(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Removes an unmanaged file from a Project. You cannot use this endpoint to delete managed project files.\n\nYou must be an `editor` or the `owner` of the project to delete a file from a project.\n\n * @summary Delete an unmanaged Project File\n */\nexport const deleteUnmanagedFile = (\n params: DeleteUnmanagedFileParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/file`, method: \"delete\", params },\n options\n );\n};\n\nexport type DeleteUnmanagedFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>\n>;\n\nexport type DeleteUnmanagedFileMutationError = ErrorType<DmError>;\n\nexport const useDeleteUnmanagedFile = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n { params: DeleteUnmanagedFileParams }\n > = (props) => {\n const { params } = props ?? {};\n\n return deleteUnmanagedFile(params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Given a `file_id` the file will be removed from the project it's attached to.\n\nYou must be an `editor` or the `owner` of the project to delete a file from a project. Being an `editor` of the original dataset does not give you the ability to detach it from the project.\n\nYou cannot delete a Project File until the attach is complete.\n\n * @summary Delete/detach a File (from a project)\n */\nexport const deleteFile = (\n fileId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/file/${fileId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteFile>>\n>;\n\nexport type DeleteFileMutationError = ErrorType<DmError>;\n\nexport const useDeleteFile = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteFile>>,\n { fileId: string }\n > = (props) => {\n const { fileId } = props ?? {};\n\n return deleteFile(fileId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Given a `file_id` the file will be returned if available.\n\nYou cannot get a Project File until the attach is complete.\n\n * @summary Download a File (from a project)\n */\nexport const downloadFile = (\n fileId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/file/${fileId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getDownloadFileQueryKey = (fileId: string) => [`/file/${fileId}`];\n\nexport type DownloadFileQueryResult = NonNullable<\n Awaited<ReturnType<typeof downloadFile>>\n>;\nexport type DownloadFileQueryError = ErrorType<DmError>;\n\nexport const useDownloadFile = <\n TData = Awaited<ReturnType<typeof downloadFile>>,\n TError = ErrorType<DmError>\n>(\n fileId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getDownloadFileQueryKey(fileId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadFile>>> = ({\n signal,\n }) => downloadFile(fileId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof downloadFile>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;;;;AAUA,SAAS,UAAU,mBAAmB;AAkC/B,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,sBAAsB,CAAC,WAA2B;AAAA,EAC7D;AAAA,EACA,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC;AAC3B;AAOO,IAAM,cAAc,CAIzB,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,oBAAoB,MAAM;AAErE,QAAM,UAA+D,CAAC;AAAA,IACpE;AAAA,EACF,MAAM,SAAS,QAAQ,gBAAgB,MAAM;AAE7C,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ;AAAA,IACZ;AAAA,EACF;AAEA,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;AAeO,IAAM,aAAa,CACxB,kBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,cAAc,iBAAiB,UAAU;AACzD,WAAS;AAAA,IACP;AAAA,IACA,iBAAiB,gBAAgB,SAAS;AAAA,EAC5C;AACA,WAAS,OAAO,cAAc,iBAAiB,UAAU;AACzD,WAAS,OAAO,WAAW,iBAAiB,OAAO;AACnD,MAAI,iBAAiB,SAAS,QAAW;AACvC,aAAS,OAAO,QAAQ,iBAAiB,IA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;AACb,UAAM,EAAE,OAAO,IAAI,SAAS,CAAC;AAE7B,WAAO,WAAW,QAAQ,cAAc;AAAA,EAC1C;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAQO,IAAM,eAAe,CAC1B,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,UAAU,QAAQ,OAAO,OAAO;AAAA,IAChD;AAAA,EACF;AACF;AAEO,IAAM,0BAA0B,CAAC,WAAmB,CAAC,SAAS,QAAQ;AAOtE,IAAM,kBAAkB,CAI7B,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,wBAAwB,MAAM;AAEzE,QAAM,UAAmE,CAAC;AAAA,IACxE;AAAA,EACF,MAAM,aAAa,QAAQ,gBAAgB,MAAM;AAEjD,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ,SAIZ,aAAa;AAEf,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;","names":[]}
|
package/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkUZTHSGDTcjs = require('./chunk-UZTHSGDT.cjs');
|
|
7
7
|
|
|
8
8
|
// src/data-manager-api.schemas.ts
|
|
9
9
|
var TypeSummaryFormatterOptionsType = {
|
|
@@ -139,5 +139,5 @@ var DatasetSchemaGetResponseType = {
|
|
|
139
139
|
|
|
140
140
|
|
|
141
141
|
|
|
142
|
-
exports.AXIOS_INSTANCE =
|
|
142
|
+
exports.AXIOS_INSTANCE = _chunkUZTHSGDTcjs.AXIOS_INSTANCE; exports.ApiLogDetailMethod = ApiLogDetailMethod; exports.DatasetSchemaGetResponseType = DatasetSchemaGetResponseType; exports.DatasetVersionDetailProcessingStage = DatasetVersionDetailProcessingStage; exports.DatasetVersionSummaryProcessingStage = DatasetVersionSummaryProcessingStage; exports.InstanceGetResponseApplicationType = InstanceGetResponseApplicationType; exports.InstanceGetResponseJobImageType = InstanceGetResponseJobImageType; exports.InstanceGetResponsePhase = InstanceGetResponsePhase; exports.InstanceSummaryApplicationType = InstanceSummaryApplicationType; exports.InstanceSummaryJobImageType = InstanceSummaryJobImageType; exports.InstanceSummaryPhase = InstanceSummaryPhase; exports.InstanceTaskPurpose = InstanceTaskPurpose; exports.JobGetResponseImageType = JobGetResponseImageType; exports.JobSummaryImageType = JobSummaryImageType; exports.ServiceErrorSummarySeverity = ServiceErrorSummarySeverity; exports.TaskEventLevel = TaskEventLevel; exports.TaskGetResponsePurpose = TaskGetResponsePurpose; exports.TaskStateState = TaskStateState; exports.TaskSummaryProcessingStage = TaskSummaryProcessingStage; exports.TypeSummaryFormatterOptionsType = TypeSummaryFormatterOptionsType; exports.customInstance = _chunkUZTHSGDTcjs.customInstance; exports.setAuthToken = _chunkUZTHSGDTcjs.setAuthToken; exports.setBaseUrl = _chunkUZTHSGDTcjs.setBaseUrl;
|
|
143
143
|
//# sourceMappingURL=index.cjs.map
|