@squonk/data-manager-client 1.0.6-rc.2 → 1.0.6
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 +21 -17
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.ts +1 -1
- package/accounting/accounting.js +22 -18
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +30 -6
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +19 -19
- package/admin/admin.js +31 -7
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +16 -15
- package/application/application.cjs.map +1 -1
- package/application/application.d.ts +1 -1
- package/application/application.js +17 -16
- package/application/application.js.map +1 -1
- package/{custom-instance-c4af1ee9.d.ts → custom-instance-9e5c9e19.d.ts} +299 -299
- package/dataset/dataset.cjs +47 -58
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +16 -16
- package/dataset/dataset.js +48 -59
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs +23 -11
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.ts +7 -7
- package/exchange-rate/exchange-rate.js +24 -12
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file/file.cjs +29 -27
- package/file/file.cjs.map +1 -1
- package/file/file.d.ts +10 -10
- package/file/file.js +30 -28
- package/file/file.js.map +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs +34 -30
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.ts +10 -10
- package/instance/instance.js +35 -31
- package/instance/instance.js.map +1 -1
- package/job/job.cjs +24 -26
- package/job/job.cjs.map +1 -1
- package/job/job.d.ts +1 -1
- package/job/job.js +25 -27
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +13 -19
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.ts +7 -7
- package/metadata/metadata.js +14 -20
- package/metadata/metadata.js.map +1 -1
- package/package.json +1 -1
- package/project/project.cjs +38 -31
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +19 -19
- package/project/project.js +39 -32
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +96 -132
- package/src/admin/admin.ts +307 -442
- package/src/application/application.ts +66 -94
- package/src/data-manager-api.schemas.ts +425 -470
- package/src/dataset/dataset.ts +367 -554
- package/src/exchange-rate/exchange-rate.ts +221 -339
- package/src/file/file.ts +177 -253
- package/src/instance/instance.ts +217 -314
- package/src/job/job.ts +88 -116
- package/src/metadata/metadata.ts +154 -245
- package/src/project/project.ts +347 -511
- package/src/task/task.ts +105 -141
- package/src/type/type.ts +38 -43
- package/src/user/user.ts +136 -197
- package/task/task.cjs +25 -27
- package/task/task.cjs.map +1 -1
- package/task/task.d.ts +1 -1
- package/task/task.js +26 -28
- 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 +1 -1
- package/type/type.js +9 -5
- package/type/type.js.map +1 -1
- package/user/user.cjs +28 -33
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +4 -4
- package/user/user.js +29 -34
- package/user/user.js.map +1 -1
package/metadata/metadata.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_query from 'react-query';
|
|
2
2
|
import { UseMutationOptions, UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
|
|
3
|
-
import { a5 as DatasetVersionMetaPostBodyBody, bC as customInstance, bo as DatasetMetaGetResponse, bD as ErrorType, by as DmError, a6 as DatasetMetaPostBodyBody } from '../custom-instance-
|
|
3
|
+
import { a5 as DatasetVersionMetaPostBodyBody, bC as customInstance, bo as DatasetMetaGetResponse, bD as ErrorType, by as DmError, a6 as DatasetMetaPostBodyBody } from '../custom-instance-9e5c9e19.js';
|
|
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;
|
|
@@ -30,10 +30,10 @@ declare const useAddMetadataVersion: <TError = ErrorType<void | DmError>, TConte
|
|
|
30
30
|
data: DatasetVersionMetaPostBodyBody;
|
|
31
31
|
}, TContext>;
|
|
32
32
|
/**
|
|
33
|
-
|
|
33
|
+
* Returns the metadata for a Dataset version in JSON format.
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
* @summary Gets the Metadata for a specific Dataset version
|
|
36
|
+
*/
|
|
37
37
|
declare const getMetadataVersion: (datasetId: string, datasetVersion: number, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<DatasetMetaGetResponse>;
|
|
38
38
|
declare const getGetMetadataVersionQueryKey: (datasetId: string, datasetVersion: number) => string[];
|
|
39
39
|
declare type GetMetadataVersionQueryResult = NonNullable<Awaited<ReturnType<typeof getMetadataVersion>>>;
|
|
@@ -66,10 +66,10 @@ declare const useAddMetadata: <TError = ErrorType<void | DmError>, TContext = un
|
|
|
66
66
|
data: DatasetMetaPostBodyBody;
|
|
67
67
|
}, TContext>;
|
|
68
68
|
/**
|
|
69
|
-
|
|
69
|
+
* Returns the metadata for a Dataset in JSON format.
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
* @summary Gets the Metadata for a specific Dataset
|
|
72
|
+
*/
|
|
73
73
|
declare const getMetadata: (datasetId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<DatasetMetaGetResponse>;
|
|
74
74
|
declare const getGetMetadataQueryKey: (datasetId: string) => string[];
|
|
75
75
|
declare type GetMetadataQueryResult = NonNullable<Awaited<ReturnType<typeof getMetadata>>>;
|
package/metadata/metadata.js
CHANGED
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
} from "../chunk-3O5KIRV4.js";
|
|
4
4
|
|
|
5
5
|
// src/metadata/metadata.ts
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
useQuery,
|
|
8
|
+
useMutation
|
|
9
|
+
} from "react-query";
|
|
7
10
|
var addMetadataVersion = (datasetId, datasetVersion, datasetVersionMetaPostBodyBody, options) => {
|
|
8
11
|
const formData = new FormData();
|
|
9
12
|
if (datasetVersionMetaPostBodyBody.meta_properties !== void 0) {
|
|
10
|
-
formData.append(
|
|
11
|
-
"meta_properties",
|
|
12
|
-
datasetVersionMetaPostBodyBody.meta_properties
|
|
13
|
-
);
|
|
13
|
+
formData.append("meta_properties", datasetVersionMetaPostBodyBody.meta_properties);
|
|
14
14
|
}
|
|
15
15
|
if (datasetVersionMetaPostBodyBody.annotations !== void 0) {
|
|
16
16
|
formData.append("annotations", datasetVersionMetaPostBodyBody.annotations);
|
|
@@ -48,10 +48,7 @@ var useGetMetadataVersion = (datasetId, datasetVersion, options) => {
|
|
|
48
48
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
49
49
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetMetadataVersionQueryKey(datasetId, datasetVersion);
|
|
50
50
|
const queryFn = ({ signal }) => getMetadataVersion(datasetId, datasetVersion, requestOptions, signal);
|
|
51
|
-
const query = useQuery(queryKey, queryFn, {
|
|
52
|
-
enabled: !!(datasetId && datasetVersion),
|
|
53
|
-
...queryOptions
|
|
54
|
-
});
|
|
51
|
+
const query = useQuery(queryKey, queryFn, { enabled: !!(datasetId && datasetVersion), ...queryOptions });
|
|
55
52
|
query.queryKey = queryKey;
|
|
56
53
|
return query;
|
|
57
54
|
};
|
|
@@ -83,23 +80,20 @@ var useAddMetadata = (options) => {
|
|
|
83
80
|
};
|
|
84
81
|
var getMetadata = (datasetId, options, signal) => {
|
|
85
82
|
return customInstance(
|
|
86
|
-
{
|
|
83
|
+
{
|
|
84
|
+
url: `/dataset/${datasetId}/meta`,
|
|
85
|
+
method: "get",
|
|
86
|
+
signal
|
|
87
|
+
},
|
|
87
88
|
options
|
|
88
89
|
);
|
|
89
90
|
};
|
|
90
|
-
var getGetMetadataQueryKey = (datasetId) => [
|
|
91
|
-
`/dataset/${datasetId}/meta`
|
|
92
|
-
];
|
|
91
|
+
var getGetMetadataQueryKey = (datasetId) => [`/dataset/${datasetId}/meta`];
|
|
93
92
|
var useGetMetadata = (datasetId, options) => {
|
|
94
93
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
95
94
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetMetadataQueryKey(datasetId);
|
|
96
|
-
const queryFn = ({
|
|
97
|
-
|
|
98
|
-
}) => getMetadata(datasetId, requestOptions, signal);
|
|
99
|
-
const query = useQuery(queryKey, queryFn, {
|
|
100
|
-
enabled: !!datasetId,
|
|
101
|
-
...queryOptions
|
|
102
|
-
});
|
|
95
|
+
const queryFn = ({ signal }) => getMetadata(datasetId, requestOptions, signal);
|
|
96
|
+
const query = useQuery(queryKey, queryFn, { enabled: !!datasetId, ...queryOptions });
|
|
103
97
|
query.queryKey = queryKey;
|
|
104
98
|
return query;
|
|
105
99
|
};
|
package/metadata/metadata.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/metadata/metadata.ts"],"sourcesContent":["/**\n * Generated by orval v6.9.1 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n DatasetMetaGetResponse,\n DmError,\n DatasetVersionMetaPostBodyBody,\n DatasetMetaPostBodyBody,\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 * Update parameters or add new annotations of the specified type(s) and to the metadata for the version of the dataset.\n\nThe parameters are provided in a list in keyword/arguments\n\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 Update Metadata for the Dataset version\n */\nexport const addMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n datasetVersionMetaPostBodyBody: DatasetVersionMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetVersionMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\n \"meta_properties\",\n datasetVersionMetaPostBodyBody.meta_properties\n );\n }\n if (datasetVersionMetaPostBodyBody.annotations !== undefined) {\n formData.append(\"annotations\", datasetVersionMetaPostBodyBody.annotations);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AddMetadataVersionMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadataVersion>>\n>;\nexport type AddMetadataVersionMutationBody = DatasetVersionMetaPostBodyBody;\nexport type AddMetadataVersionMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadataVersion = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\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 addMetadataVersion>>,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n }\n > = (props) => {\n const { datasetId, datasetVersion, data } = props ?? {};\n\n return addMetadataVersion(datasetId, datasetVersion, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns the metadata for a Dataset version in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset version\n */\nexport const getMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetMetadataVersionQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/meta/${datasetVersion}`];\n\nexport type GetMetadataVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadataVersion>>\n>;\nexport type GetMetadataVersionQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadataVersion = <\n TData = Awaited<ReturnType<typeof getMetadataVersion>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getGetMetadataVersionQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getMetadataVersion>>\n > = ({ signal }) =>\n getMetadataVersion(datasetId, datasetVersion, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!(datasetId && datasetVersion),\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Update default parameters or add new labels to the metadata for the dataset.\nThe parameters are provided in a list in keyword/arguments\nThe labels are provided in a list in JSON format. For details of the label format, see the data-manager-metadata library,\n\n * @summary Update Metadata for the Dataset\n */\nexport const addMetadata = (\n datasetId: string,\n datasetMetaPostBodyBody: DatasetMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\"meta_properties\", datasetMetaPostBodyBody.meta_properties);\n }\n if (datasetMetaPostBodyBody.labels !== undefined) {\n formData.append(\"labels\", datasetMetaPostBodyBody.labels);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AddMetadataMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadata>>\n>;\nexport type AddMetadataMutationBody = DatasetMetaPostBodyBody;\nexport type AddMetadataMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadata = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\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 addMetadata>>,\n { datasetId: string; data: DatasetMetaPostBodyBody }\n > = (props) => {\n const { datasetId, data } = props ?? {};\n\n return addMetadata(datasetId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns the metadata for a Dataset in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset\n */\nexport const getMetadata = (\n datasetId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n { url: `/dataset/${datasetId}/meta`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetMetadataQueryKey = (datasetId: string) => [\n `/dataset/${datasetId}/meta`,\n];\n\nexport type GetMetadataQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadata>>\n>;\nexport type GetMetadataQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadata = <\n TData = Awaited<ReturnType<typeof getMetadata>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadata>>,\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 ?? getGetMetadataQueryKey(datasetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadata>>> = ({\n signal,\n }) => getMetadata(datasetId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getMetadata>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!datasetId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAmC/B,IAAM,qBAAqB,CAChC,WACA,gBACA,gCACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,MAAI,+BAA+B,oBAAoB,QAAW;AAChE,aAAS;AAAA,MACP;AAAA,MACA,+BAA+B;AAAA,IACjC;AAAA,EACF;AACA,MAAI,+BAA+B,gBAAgB,QAAW;AAC5D,aAAS,OAAO,eAAe,+BAA+B,WAAW;AAAA,EAC3E;AAEA,SAAO;AAAA,IACL;AAAA,MACE,KAAK,YAAY,kBAAkB;AAAA,MACnC,QAAQ;AAAA,MACR,SAAS,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AAA,IACL;AAAA,MACE,KAAK,YAAY;AAAA,MACjB,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,MACjD,MAAM;AAAA,IACR;AAAA,IACA;AAAA,EACF;AACF;AAQO,IAAM,iBAAiB,CAG5B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,WAAW,KAAK,IAAI,SAAS,CAAC;AAEtC,WAAO,YAAY,WAAW,MAAM,cAAc;AAAA,EACpD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,cAAc,CACzB,WACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,YAAY,kBAAkB,QAAQ,OAAO,OAAO;AAAA,IAC3D;AAAA,EACF;AACF;AAEO,IAAM,yBAAyB,CAAC,cAAsB;AAAA,EAC3D,YAAY;AACd;AAOO,IAAM,iBAAiB,CAI5B,WACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,uBAAuB,SAAS;AAE3E,QAAM,UAAkE,CAAC;AAAA,IACvE;AAAA,EACF,MAAM,YAAY,WAAW,gBAAgB,MAAM;AAEnD,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/metadata/metadata.ts"],"sourcesContent":["/**\n * Generated by orval v6.9.1 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport {\n useQuery,\n useMutation\n} from 'react-query'\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey\n} from 'react-query'\nimport type {\n DatasetMetaGetResponse,\n DmError,\n DatasetVersionMetaPostBodyBody,\n DatasetMetaPostBodyBody\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance'\nimport type { ErrorType } from '.././custom-instance'\n\n\n// eslint-disable-next-line\n type SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P,\n) => any\n ? P\n : never;\n\n/**\n * Update parameters or add new annotations of the specified type(s) and to the metadata for the version of the dataset.\n\nThe parameters are provided in a list in keyword/arguments\n\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 Update Metadata for the Dataset version\n */\nexport const addMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n datasetVersionMetaPostBodyBody: DatasetVersionMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {const formData = new FormData();\nif(datasetVersionMetaPostBodyBody.meta_properties !== undefined) {\n formData.append('meta_properties', datasetVersionMetaPostBodyBody.meta_properties)\n }\nif(datasetVersionMetaPostBodyBody.annotations !== undefined) {\n formData.append('annotations', datasetVersionMetaPostBodyBody.annotations)\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {url: `/dataset/${datasetId}/meta/${datasetVersion}`, method: 'post',\n headers: {'Content-Type': 'multipart/form-data', },\n data: formData\n },\n options);\n }\n \n\n\n export type AddMetadataVersionMutationResult = NonNullable<Awaited<ReturnType<typeof addMetadataVersion>>>\n export type AddMetadataVersionMutationBody = DatasetVersionMetaPostBodyBody\n export type AddMetadataVersionMutationError = ErrorType<DmError | void>\n\n export const useAddMetadataVersion = <TError = ErrorType<DmError | void>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addMetadataVersion>>, TError,{datasetId: string;datasetVersion: number;data: DatasetVersionMetaPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof addMetadataVersion>>, {datasetId: string;datasetVersion: number;data: DatasetVersionMetaPostBodyBody}> = (props) => {\n const {datasetId,datasetVersion,data} = props ?? {};\n\n return addMetadataVersion(datasetId,datasetVersion,data,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof addMetadataVersion>>, TError, {datasetId: string;datasetVersion: number;data: DatasetVersionMetaPostBodyBody}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Returns the metadata for a Dataset version in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset version\n */\nexport const getMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n {url: `/dataset/${datasetId}/meta/${datasetVersion}`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetMetadataVersionQueryKey = (datasetId: string,\n datasetVersion: number,) => [`/dataset/${datasetId}/meta/${datasetVersion}`];\n\n \nexport type GetMetadataVersionQueryResult = NonNullable<Awaited<ReturnType<typeof getMetadataVersion>>>\nexport type GetMetadataVersionQueryError = ErrorType<void | DmError>\n\nexport const useGetMetadataVersion = <TData = Awaited<ReturnType<typeof getMetadataVersion>>, TError = ErrorType<void | DmError>>(\n datasetId: string,\n datasetVersion: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getMetadataVersion>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const {query: queryOptions, request: requestOptions} = options ?? {}\n\n const queryKey = queryOptions?.queryKey ?? getGetMetadataVersionQueryKey(datasetId,datasetVersion);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadataVersion>>> = ({ signal }) => getMetadataVersion(datasetId,datasetVersion, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getMetadataVersion>>, TError, TData>(queryKey, queryFn, {enabled: !!(datasetId && datasetVersion), ...queryOptions}) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n}\n\n/**\n * Update default parameters or add new labels to the metadata for the dataset.\nThe parameters are provided in a list in keyword/arguments\nThe labels are provided in a list in JSON format. For details of the label format, see the data-manager-metadata library,\n\n * @summary Update Metadata for the Dataset\n */\nexport const addMetadata = (\n datasetId: string,\n datasetMetaPostBodyBody: DatasetMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {const formData = new FormData();\nif(datasetMetaPostBodyBody.meta_properties !== undefined) {\n formData.append('meta_properties', datasetMetaPostBodyBody.meta_properties)\n }\nif(datasetMetaPostBodyBody.labels !== undefined) {\n formData.append('labels', datasetMetaPostBodyBody.labels)\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {url: `/dataset/${datasetId}/meta`, method: 'post',\n headers: {'Content-Type': 'multipart/form-data', },\n data: formData\n },\n options);\n }\n \n\n\n export type AddMetadataMutationResult = NonNullable<Awaited<ReturnType<typeof addMetadata>>>\n export type AddMetadataMutationBody = DatasetMetaPostBodyBody\n export type AddMetadataMutationError = ErrorType<DmError | void>\n\n export const useAddMetadata = <TError = ErrorType<DmError | void>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addMetadata>>, TError,{datasetId: string;data: DatasetMetaPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof addMetadata>>, {datasetId: string;data: DatasetMetaPostBodyBody}> = (props) => {\n const {datasetId,data} = props ?? {};\n\n return addMetadata(datasetId,data,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof addMetadata>>, TError, {datasetId: string;data: DatasetMetaPostBodyBody}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Returns the metadata for a Dataset in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset\n */\nexport const getMetadata = (\n datasetId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n {url: `/dataset/${datasetId}/meta`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetMetadataQueryKey = (datasetId: string,) => [`/dataset/${datasetId}/meta`];\n\n \nexport type GetMetadataQueryResult = NonNullable<Awaited<ReturnType<typeof getMetadata>>>\nexport type GetMetadataQueryError = ErrorType<void | DmError>\n\nexport const useGetMetadata = <TData = Awaited<ReturnType<typeof getMetadata>>, TError = ErrorType<void | DmError>>(\n datasetId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const {query: queryOptions, request: requestOptions} = options ?? {}\n\n const queryKey = queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadata>>> = ({ signal }) => getMetadata(datasetId, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getMetadata>>, TError, TData>(queryKey, queryFn, {enabled: !!(datasetId), ...queryOptions}) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n}\n\n"],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAoCA,IAAM,qBAAqB,CAC9B,WACA,gBACA,gCACH,YAAsD;AAAC,QAAM,WAAW,IAAI,SAAS;AACtF,MAAG,+BAA+B,oBAAoB,QAAW;AAChE,aAAS,OAAO,mBAAmB,+BAA+B,eAAe;AAAA,EACjF;AACD,MAAG,+BAA+B,gBAAgB,QAAW;AAC5D,aAAS,OAAO,eAAe,+BAA+B,WAAW;AAAA,EACzE;AAEK,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,YAAY,kBAAkB;AAAA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
var _reactquery = require('react-query');
|
|
7
10
|
var getProjects = (options, signal) => {
|
|
8
11
|
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
9
|
-
{
|
|
12
|
+
{
|
|
13
|
+
url: `/project`,
|
|
14
|
+
method: "get",
|
|
15
|
+
signal
|
|
16
|
+
},
|
|
10
17
|
options
|
|
11
18
|
);
|
|
12
19
|
};
|
|
@@ -14,9 +21,7 @@ var getGetProjectsQueryKey = () => [`/project`];
|
|
|
14
21
|
var useGetProjects = (options) => {
|
|
15
22
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
16
23
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProjectsQueryKey()));
|
|
17
|
-
const queryFn = ({
|
|
18
|
-
signal
|
|
19
|
-
}) => getProjects(requestOptions, signal);
|
|
24
|
+
const queryFn = ({ signal }) => getProjects(requestOptions, signal);
|
|
20
25
|
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
|
|
21
26
|
query.queryKey = queryKey;
|
|
22
27
|
return query;
|
|
@@ -48,24 +53,20 @@ var useCreateProject = (options) => {
|
|
|
48
53
|
};
|
|
49
54
|
var getProject = (projectId, options, signal) => {
|
|
50
55
|
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
51
|
-
{
|
|
56
|
+
{
|
|
57
|
+
url: `/project/${projectId}`,
|
|
58
|
+
method: "get",
|
|
59
|
+
signal
|
|
60
|
+
},
|
|
52
61
|
options
|
|
53
62
|
);
|
|
54
63
|
};
|
|
55
|
-
var getGetProjectQueryKey = (projectId) => [
|
|
56
|
-
`/project/${projectId}`
|
|
57
|
-
];
|
|
64
|
+
var getGetProjectQueryKey = (projectId) => [`/project/${projectId}`];
|
|
58
65
|
var useGetProject = (projectId, options) => {
|
|
59
66
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
60
67
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProjectQueryKey(projectId)));
|
|
61
|
-
const queryFn = ({
|
|
62
|
-
|
|
63
|
-
}) => getProject(projectId, requestOptions, signal);
|
|
64
|
-
const query = _reactquery.useQuery.call(void 0,
|
|
65
|
-
queryKey,
|
|
66
|
-
queryFn,
|
|
67
|
-
{ enabled: !!projectId, ...queryOptions }
|
|
68
|
-
);
|
|
68
|
+
const queryFn = ({ signal }) => getProject(projectId, requestOptions, signal);
|
|
69
|
+
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, { enabled: !!projectId, ...queryOptions });
|
|
69
70
|
query.queryKey = queryKey;
|
|
70
71
|
return query;
|
|
71
72
|
};
|
|
@@ -97,7 +98,10 @@ var usePatchProject = (options) => {
|
|
|
97
98
|
};
|
|
98
99
|
var deleteProject = (projectId, options) => {
|
|
99
100
|
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
100
|
-
{
|
|
101
|
+
{
|
|
102
|
+
url: `/project/${projectId}`,
|
|
103
|
+
method: "delete"
|
|
104
|
+
},
|
|
101
105
|
options
|
|
102
106
|
);
|
|
103
107
|
};
|
|
@@ -111,7 +115,10 @@ var useDeleteProject = (options) => {
|
|
|
111
115
|
};
|
|
112
116
|
var addEditorToProject = (projectId, userId, options) => {
|
|
113
117
|
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
114
|
-
{
|
|
118
|
+
{
|
|
119
|
+
url: `/project/${projectId}/editor/${userId}`,
|
|
120
|
+
method: "put"
|
|
121
|
+
},
|
|
115
122
|
options
|
|
116
123
|
);
|
|
117
124
|
};
|
|
@@ -125,7 +132,10 @@ var useAddEditorToProject = (options) => {
|
|
|
125
132
|
};
|
|
126
133
|
var removeEditorFromProject = (projectId, userId, options) => {
|
|
127
134
|
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
128
|
-
{
|
|
135
|
+
{
|
|
136
|
+
url: `/project/${projectId}/editor/${userId}`,
|
|
137
|
+
method: "delete"
|
|
138
|
+
},
|
|
129
139
|
options
|
|
130
140
|
);
|
|
131
141
|
};
|
|
@@ -139,7 +149,12 @@ var useRemoveEditorFromProject = (options) => {
|
|
|
139
149
|
};
|
|
140
150
|
var getProjectFile = (projectId, params, options, signal) => {
|
|
141
151
|
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
142
|
-
{
|
|
152
|
+
{
|
|
153
|
+
url: `/project/${projectId}/file`,
|
|
154
|
+
method: "get",
|
|
155
|
+
params,
|
|
156
|
+
signal
|
|
157
|
+
},
|
|
143
158
|
options
|
|
144
159
|
);
|
|
145
160
|
};
|
|
@@ -147,13 +162,8 @@ var getGetProjectFileQueryKey = (projectId, params) => [`/project/${projectId}/f
|
|
|
147
162
|
var useGetProjectFile = (projectId, params, options) => {
|
|
148
163
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
149
164
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProjectFileQueryKey(projectId, params)));
|
|
150
|
-
const queryFn = ({
|
|
151
|
-
|
|
152
|
-
}) => getProjectFile(projectId, params, requestOptions, signal);
|
|
153
|
-
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, {
|
|
154
|
-
enabled: !!projectId,
|
|
155
|
-
...queryOptions
|
|
156
|
-
});
|
|
165
|
+
const queryFn = ({ signal }) => getProjectFile(projectId, params, requestOptions, signal);
|
|
166
|
+
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, { enabled: !!projectId, ...queryOptions });
|
|
157
167
|
query.queryKey = queryKey;
|
|
158
168
|
return query;
|
|
159
169
|
};
|
|
@@ -200,10 +210,7 @@ var useGetProjectFileWithToken = (projectId, params, options) => {
|
|
|
200
210
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
201
211
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProjectFileWithTokenQueryKey(projectId, params)));
|
|
202
212
|
const queryFn = ({ signal }) => getProjectFileWithToken(projectId, params, requestOptions, signal);
|
|
203
|
-
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, {
|
|
204
|
-
enabled: !!projectId,
|
|
205
|
-
...queryOptions
|
|
206
|
-
});
|
|
213
|
+
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, { enabled: !!projectId, ...queryOptions });
|
|
207
214
|
query.queryKey = queryKey;
|
|
208
215
|
return query;
|
|
209
216
|
};
|
package/project/project.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/project/project.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAqC/B,IAAM,cAAc,CACzB,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,YAAY,QAAQ,OAAO,OAAO;AAAA,IACzC;AAAA,EACF;AACF;AAEO,IAAM,yBAAyB,MAAM,CAAC,UAAU;AAOhD,IAAM,iBAAiB,CAG5B,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,uBAAuB;AAElE,QAAM,UAAkE,CAAC;AAAA,IACvE;AAAA,EACF,MAAM,YAAY,gBAAgB,MAAM;AAExC,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAIjC,QAAM,WAAW;AAEjB,SAAO;AACT;AAaO,IAAM,gBAAgB,CAC3B,qBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,QAAQ,oBAAoB,IAAI;AAChD,MAAI,oBAAoB,YAAY,QAAW;AAC7C,aAAS,OAAO,WAAW,oBAAoB,QAAQ,SAAS,CAAC;AAAA,EACnE;AACA,WAAS,OAAO,mBAAmB,oBAAoB,eAAe;AAEtE,SAAO;AAAA,IACL;AAAA,MACE,KAAK;AAAA,MACL,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,MAC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,MACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,MACjD,MAAM;AAAA,IACR;AAAA,IACA;AAAA,EACF;AACF;AAQO,IAAM,sBAAsB,CAGjC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,WAAW,KAAK,IAAI,SAAS,CAAC;AAEtC,WAAO,iBAAiB,WAAW,MAAM,cAAc;AAAA,EACzD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAUO,IAAM,0BAA0B,CACrC,WACA,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL;AAAA,MACE,KAAK,YAAY;AAAA,MACjB,QAAQ;AAAA,MACR;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;AAEO,IAAM,qCAAqC,CAChD,WACA,WACG,CAAC,YAAY,6BAA6B,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAOnE,IAAM,6BAA6B,CAIxC,WACA,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aACd,mCAAmC,WAAW,MAAM;AAEtD,QAAM,UAEF,CAAC,EAAE,OAAO,MACZ,wBAAwB,WAAW,QAAQ,gBAAgB,MAAM;AAEnE,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.9.1 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n ProjectsGetResponse,\n DmError,\n ProjectPostResponse,\n ProjectPostBodyBody,\n ProjectGetResponse,\n ProjectPatchBodyBody,\n ProjectDeleteResponse,\n GetProjectFileParams,\n ProjectFilePutBodyBody,\n GetProjectFileWithTokenParams,\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 * Get a list of all Projects available to you.\n\n * @summary Get all Pojects available to you\n */\nexport const getProjects = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProjectsGetResponse>(\n { url: `/project`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProjectsQueryKey = () => [`/project`];\n\nexport type GetProjectsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjects>>\n>;\nexport type GetProjectsQueryError = ErrorType<void | DmError>;\n\nexport const useGetProjects = <\n TData = Awaited<ReturnType<typeof getProjects>>,\n TError = ErrorType<void | DmError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjects>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjects>>> = ({\n signal,\n }) => getProjects(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProjects>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Creates a new Project, assigning and returning a unique **ID**. A persistent volume is created in the cluster and assigned to your Project. It's here you can add **Datasets** as **Files** and run **Applications** and **Jobs**.\n\nTo create a Project you will need an uncommitted Project product.\n\nAs the project `owner` (creator) you are also automatically an `editor` of the project and can add other users as editors so that they can also manipulate the project. An `editor` of a project can also delete it.\n\nThe name you give the project is free-form text (can contain spaces etc.). The name you use must be unique amongst all the projects you create.\n\n * @summary Create a new Project\n */\nexport const createProject = (\n projectPostBodyBody: ProjectPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"name\", projectPostBodyBody.name);\n if (projectPostBodyBody.private !== undefined) {\n formData.append(\"private\", projectPostBodyBody.private.toString());\n }\n formData.append(\"tier_product_id\", projectPostBodyBody.tier_product_id);\n\n return customInstance<ProjectPostResponse>(\n {\n url: `/project`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof createProject>>\n>;\nexport type CreateProjectMutationBody = ProjectPostBodyBody;\nexport type CreateProjectMutationError = ErrorType<DmError | void>;\n\nexport const useCreateProject = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createProject>>,\n TError,\n { data: ProjectPostBodyBody },\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 createProject>>,\n { data: ProjectPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createProject(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createProject>>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the details of a project that is available to you.\n\n * @summary Get a Project\n */\nexport const getProject = (\n projectId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProjectGetResponse>(\n { url: `/project/${projectId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProjectQueryKey = (projectId: string) => [\n `/project/${projectId}`,\n];\n\nexport type GetProjectQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProject>>\n>;\nexport type GetProjectQueryError = ErrorType<void | DmError>;\n\nexport const useGetProject = <\n TData = Awaited<ReturnType<typeof getProject>>,\n TError = ErrorType<void | DmError>\n>(\n projectId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProject>>,\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 ?? getGetProjectQueryKey(projectId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProject>>> = ({\n signal,\n }) => getProject(projectId, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getProject>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!projectId, ...queryOptions }\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Used to update some adjustable parameters of a Project, i.e. to make it Private or make it Public. What can be adjusted will depend on the purchased product\n\n * @summary Adjust an existing Project\n */\nexport const patchProject = (\n projectId: string,\n projectPatchBodyBody: ProjectPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (projectPatchBodyBody.private !== undefined) {\n formData.append(\"private\", projectPatchBodyBody.private.toString());\n }\n if (projectPatchBodyBody.name !== undefined) {\n formData.append(\"name\", projectPatchBodyBody.name);\n }\n\n return customInstance<void>(\n {\n url: `/project/${projectId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type PatchProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchProject>>\n>;\nexport type PatchProjectMutationBody = ProjectPatchBodyBody;\nexport type PatchProjectMutationError = ErrorType<DmError>;\n\nexport const usePatchProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProject>>,\n TError,\n { projectId: string; data: ProjectPatchBodyBody },\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 patchProject>>,\n { projectId: string; data: ProjectPatchBodyBody }\n > = (props) => {\n const { projectId, data } = props ?? {};\n\n return patchProject(projectId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof patchProject>>,\n TError,\n { projectId: string; data: ProjectPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes an existing project.\n\nYou must be an `editor` or the `owner` of the project.\n\nOnce deleted all **Files**, working directories and material in the project will also be removed\n\n * @summary Delete a Project\n */\nexport const deleteProject = (\n projectId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectDeleteResponse>(\n { url: `/project/${projectId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteProject>>\n>;\n\nexport type DeleteProjectMutationError = ErrorType<void | DmError>;\n\nexport const useDeleteProject = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProject>>,\n TError,\n { projectId: 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 deleteProject>>,\n { projectId: string }\n > = (props) => {\n const { projectId } = props ?? {};\n\n return deleteProject(projectId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteProject>>,\n TError,\n { projectId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Adds a user to a project as an `editor`. Editors can add and remove datasets in a project and delete the project.\n\nAn `editor` of a project is not automatically an `editor` of any datasets the project contains.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Add a Project Editor\n */\nexport const addEditorToProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/editor/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddEditorToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addEditorToProject>>\n>;\n\nexport type AddEditorToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddEditorToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addEditorToProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return addEditorToProject(projectId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addEditorToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a project `editor`. The editor can be you but you cannot delete the last `editor`\n\nA project must always have one `editor` so you will not be able to delete the last editor of a project.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Delete a Project Editor\n */\nexport const removeEditorFromProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/editor/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type RemoveEditorFromProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeEditorFromProject>>\n>;\n\nexport type RemoveEditorFromProjectMutationError = ErrorType<DmError>;\n\nexport const useRemoveEditorFromProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return removeEditorFromProject(projectId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nYou must be an `editor` or the `owner` of the project if the project is private\n\n * @summary Download a Project file\n */\nexport const getProjectFile = (\n projectId: string,\n params: GetProjectFileParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/file`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetProjectFileQueryKey = (\n projectId: string,\n params: GetProjectFileParams\n) => [`/project/${projectId}/file`, ...(params ? [params] : [])];\n\nexport type GetProjectFileQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjectFile>>\n>;\nexport type GetProjectFileQueryError = ErrorType<DmError>;\n\nexport const useGetProjectFile = <\n TData = Awaited<ReturnType<typeof getProjectFile>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params: GetProjectFileParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFile>>> = ({\n signal,\n }) => getProjectFile(projectId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProjectFile>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!projectId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * The user provides an external file for upload to the Project using an optional Path. The path is created if it does not exist.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Upload a file into a Project\n */\nexport const addFileToProject = (\n projectId: string,\n projectFilePutBodyBody: ProjectFilePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"file\", projectFilePutBodyBody.file);\n if (projectFilePutBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", projectFilePutBodyBody.as_filename);\n }\n if (projectFilePutBodyBody.path !== undefined) {\n formData.append(\"path\", projectFilePutBodyBody.path);\n }\n\n return customInstance<void>(\n {\n url: `/project/${projectId}/file`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AddFileToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addFileToProject>>\n>;\nexport type AddFileToProjectMutationBody = ProjectFilePutBodyBody;\nexport type AddFileToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddFileToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addFileToProject>>,\n TError,\n { projectId: string; data: ProjectFilePutBodyBody },\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 addFileToProject>>,\n { projectId: string; data: ProjectFilePutBodyBody }\n > = (props) => {\n const { projectId, data } = props ?? {};\n\n return addFileToProject(projectId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addFileToProject>>,\n TError,\n { projectId: string; data: ProjectFilePutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nAs there is no security You must provide a valid token. The token must be a token valid for the project, usually generated when an Instance has been launched in the Project. If the token is not valid ou will receive a `403` error\n\n * @summary Download a Project file using a Token\n */\nexport const getProjectFileWithToken = (\n projectId: string,\n params: GetProjectFileWithTokenParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n {\n url: `/project/${projectId}/file-with-token`,\n method: \"get\",\n params,\n signal,\n },\n options\n );\n};\n\nexport const getGetProjectFileWithTokenQueryKey = (\n projectId: string,\n params: GetProjectFileWithTokenParams\n) => [`/project/${projectId}/file-with-token`, ...(params ? [params] : [])];\n\nexport type GetProjectFileWithTokenQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjectFileWithToken>>\n>;\nexport type GetProjectFileWithTokenQueryError = ErrorType<DmError>;\n\nexport const useGetProjectFileWithToken = <\n TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params: GetProjectFileWithTokenParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getGetProjectFileWithTokenQueryKey(projectId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProjectFileWithToken>>\n > = ({ signal }) =>\n getProjectFileWithToken(projectId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!projectId,\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/project/project.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAsCA,IAAM,cAAc,CAE1B,SAAiD,WAC7C;AACC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAY,QAAQ;AAAA,MAAO;AAAA,IACnC;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,yBAAyB,MAAM,CAAC,UAAU;AAMhD,IAAM,iBAAiB,CAC5B,YAE8D;AAE9D,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEnE,QAAM,YAAW,6CAAc,aAAY,uBAAuB;AAIlE,QAAM,UAAkE,CAAC,EAAE,OAAO,MAAM,YAAY,gBAAgB,MAAM;AAE1H,QAAM,QAAQ,SAAiE,UAAU,SAAS,YAAY;AAE9G,QAAM,WAAW;AAEjB,SAAO;AACT;AAaO,IAAM,gBAAgB,CACzB,qBACH,YAAsD;AAAC,QAAM,WAAW,IAAI,SAAS;AACtF,WAAS,OAAO,QAAQ,oBAAoB,IAAI;AAChD,MAAG,oBAAoB,YAAY,QAAW;AAC7C,aAAS,OAAO,WAAW,oBAAoB,QAAQ,SAAS,CAAC;AAAA,EACjE;AACD,WAAS,OAAO,mBAAmB,oBAAoB,eAAe;AAEhE,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAY,QAAQ;AAAA,MAC1B,SAAS,EAAC,gBAAgB,sBAAuB;AAAA,MAChD,MAAM;AAAA,IACT;AAAA,IACE;AAAA,EAAO;AACT;AAQO,IAAM,mBAAmB,CAEZ,YACnB;AACC,QAAM,EAAC,UAAU,iBAA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,SAAS,EAAC,gBAAgB,sBAAuB;AAAA,MAChD,MAAM;AAAA,IACT;AAAA,IACE;AAAA,EAAO;AACT;AAQO,IAAM,sBAAsB,CAEf,YACnB;AACC,QAAM,EAAC,UAAU,iBAAiB,SAAS,eAAc,IAAI,WAAW,CAAC;AAKzE,QAAM,aAA+H,CAAC,UAAU;AAC5I,UAAM,EAAC,WAAU,KAAI,IAAI,SAAS,CAAC;AAEnC,WAAQ,iBAAiB,WAAU,MAAK,cAAc;AAAA,EACxD;AAEF,SAAO,YAA8H,YAAY,eAAe;AAClK;AAUG,IAAM,0BAA0B,CACnC,WACA,QACH,SAAiD,WAC7C;AACC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,YAAY;AAAA,MAA6B,QAAQ;AAAA,MACrD;AAAA,MAAQ;AAAA,IACZ;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,qCAAqC,CAAC,WAC/C,WAA2C,CAAC,YAAY,6BAA6B,GAAI,SAAS,CAAC,MAAM,IAAG,CAAC,CAAE;AAM5G,IAAM,6BAA6B,CACzC,WACG,QAAuC,YAEqB;AAE9D,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEnE,QAAM,YAAW,6CAAc,aAAY,mCAAmC,WAAU,MAAM;AAI9F,QAAM,UAA8E,CAAC,EAAE,OAAO,MAAM,wBAAwB,WAAU,QAAQ,gBAAgB,MAAM;AAEpK,QAAM,QAAQ,SAA6E,UAAU,SAAS,EAAC,SAAS,CAAC,CAAE,WAAY,GAAG,aAAY,CAAC;AAEvJ,QAAM,WAAW;AAEjB,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.9.1 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport {\n useQuery,\n useMutation\n} from 'react-query'\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey\n} from 'react-query'\nimport type {\n ProjectsGetResponse,\n DmError,\n ProjectPostResponse,\n ProjectPostBodyBody,\n ProjectGetResponse,\n ProjectPatchBodyBody,\n ProjectDeleteResponse,\n GetProjectFileParams,\n ProjectFilePutBodyBody,\n GetProjectFileWithTokenParams\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance'\nimport type { ErrorType } from '.././custom-instance'\n\n\n// eslint-disable-next-line\n type SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P,\n) => any\n ? P\n : never;\n\n/**\n * Get a list of all Projects available to you.\n\n * @summary Get all Pojects available to you\n */\nexport const getProjects = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n return customInstance<ProjectsGetResponse>(\n {url: `/project`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetProjectsQueryKey = () => [`/project`];\n\n \nexport type GetProjectsQueryResult = NonNullable<Awaited<ReturnType<typeof getProjects>>>\nexport type GetProjectsQueryError = ErrorType<void | DmError>\n\nexport const useGetProjects = <TData = Awaited<ReturnType<typeof getProjects>>, TError = ErrorType<void | DmError>>(\n options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProjects>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const {query: queryOptions, request: requestOptions} = options ?? {}\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectsQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjects>>> = ({ signal }) => getProjects(requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getProjects>>, TError, TData>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n}\n\n/**\n * Creates a new Project, assigning and returning a unique **ID**. A persistent volume is created in the cluster and assigned to your Project. It's here you can add **Datasets** as **Files** and run **Applications** and **Jobs**.\n\nTo create a Project you will need an uncommitted Project product.\n\nAs the project `owner` (creator) you are also automatically an `editor` of the project and can add other users as editors so that they can also manipulate the project. An `editor` of a project can also delete it.\n\nThe name you give the project is free-form text (can contain spaces etc.). The name you use must be unique amongst all the projects you create.\n\n * @summary Create a new Project\n */\nexport const createProject = (\n projectPostBodyBody: ProjectPostBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {const formData = new FormData();\nformData.append('name', projectPostBodyBody.name)\nif(projectPostBodyBody.private !== undefined) {\n formData.append('private', projectPostBodyBody.private.toString())\n }\nformData.append('tier_product_id', projectPostBodyBody.tier_product_id)\n\n return customInstance<ProjectPostResponse>(\n {url: `/project`, method: 'post',\n headers: {'Content-Type': 'multipart/form-data', },\n data: formData\n },\n options);\n }\n \n\n\n export type CreateProjectMutationResult = NonNullable<Awaited<ReturnType<typeof createProject>>>\n export type CreateProjectMutationBody = ProjectPostBodyBody\n export type CreateProjectMutationError = ErrorType<DmError | void>\n\n export const useCreateProject = <TError = ErrorType<DmError | void>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createProject>>, TError,{data: ProjectPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createProject>>, {data: ProjectPostBodyBody}> = (props) => {\n const {data} = props ?? {};\n\n return createProject(data,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof createProject>>, TError, {data: ProjectPostBodyBody}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Gets the details of a project that is available to you.\n\n * @summary Get a Project\n */\nexport const getProject = (\n projectId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n return customInstance<ProjectGetResponse>(\n {url: `/project/${projectId}`, method: 'get', signal\n },\n options);\n }\n \n\nexport const getGetProjectQueryKey = (projectId: string,) => [`/project/${projectId}`];\n\n \nexport type GetProjectQueryResult = NonNullable<Awaited<ReturnType<typeof getProject>>>\nexport type GetProjectQueryError = ErrorType<void | DmError>\n\nexport const useGetProject = <TData = Awaited<ReturnType<typeof getProject>>, TError = ErrorType<void | DmError>>(\n projectId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProject>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const {query: queryOptions, request: requestOptions} = options ?? {}\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectQueryKey(projectId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProject>>> = ({ signal }) => getProject(projectId, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getProject>>, TError, TData>(queryKey, queryFn, {enabled: !!(projectId), ...queryOptions}) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n}\n\n/**\n * Used to update some adjustable parameters of a Project, i.e. to make it Private or make it Public. What can be adjusted will depend on the purchased product\n\n * @summary Adjust an existing Project\n */\nexport const patchProject = (\n projectId: string,\n projectPatchBodyBody: ProjectPatchBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {const formData = new FormData();\nif(projectPatchBodyBody.private !== undefined) {\n formData.append('private', projectPatchBodyBody.private.toString())\n }\nif(projectPatchBodyBody.name !== undefined) {\n formData.append('name', projectPatchBodyBody.name)\n }\n\n return customInstance<void>(\n {url: `/project/${projectId}`, method: 'patch',\n headers: {'Content-Type': 'multipart/form-data', },\n data: formData\n },\n options);\n }\n \n\n\n export type PatchProjectMutationResult = NonNullable<Awaited<ReturnType<typeof patchProject>>>\n export type PatchProjectMutationBody = ProjectPatchBodyBody\n export type PatchProjectMutationError = ErrorType<DmError>\n\n export const usePatchProject = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchProject>>, TError,{projectId: string;data: ProjectPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchProject>>, {projectId: string;data: ProjectPatchBodyBody}> = (props) => {\n const {projectId,data} = props ?? {};\n\n return patchProject(projectId,data,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof patchProject>>, TError, {projectId: string;data: ProjectPatchBodyBody}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Deletes an existing project.\n\nYou must be an `editor` or the `owner` of the project.\n\nOnce deleted all **Files**, working directories and material in the project will also be removed\n\n * @summary Delete a Project\n */\nexport const deleteProject = (\n projectId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n return customInstance<ProjectDeleteResponse>(\n {url: `/project/${projectId}`, method: 'delete'\n },\n options);\n }\n \n\n\n export type DeleteProjectMutationResult = NonNullable<Awaited<ReturnType<typeof deleteProject>>>\n \n export type DeleteProjectMutationError = ErrorType<void | DmError>\n\n export const useDeleteProject = <TError = ErrorType<void | DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteProject>>, TError,{projectId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteProject>>, {projectId: string}> = (props) => {\n const {projectId} = props ?? {};\n\n return deleteProject(projectId,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof deleteProject>>, TError, {projectId: string}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Adds a user to a project as an `editor`. Editors can add and remove datasets in a project and delete the project.\n\nAn `editor` of a project is not automatically an `editor` of any datasets the project contains.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Add a Project Editor\n */\nexport const addEditorToProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n return customInstance<void>(\n {url: `/project/${projectId}/editor/${userId}`, method: 'put'\n },\n options);\n }\n \n\n\n export type AddEditorToProjectMutationResult = NonNullable<Awaited<ReturnType<typeof addEditorToProject>>>\n \n export type AddEditorToProjectMutationError = ErrorType<DmError>\n\n export const useAddEditorToProject = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addEditorToProject>>, TError,{projectId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof addEditorToProject>>, {projectId: string;userId: string}> = (props) => {\n const {projectId,userId} = props ?? {};\n\n return addEditorToProject(projectId,userId,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof addEditorToProject>>, TError, {projectId: string;userId: string}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Deletes a project `editor`. The editor can be you but you cannot delete the last `editor`\n\nA project must always have one `editor` so you will not be able to delete the last editor of a project.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Delete a Project Editor\n */\nexport const removeEditorFromProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n return customInstance<void>(\n {url: `/project/${projectId}/editor/${userId}`, method: 'delete'\n },\n options);\n }\n \n\n\n export type RemoveEditorFromProjectMutationResult = NonNullable<Awaited<ReturnType<typeof removeEditorFromProject>>>\n \n export type RemoveEditorFromProjectMutationError = ErrorType<DmError>\n\n export const useRemoveEditorFromProject = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof removeEditorFromProject>>, TError,{projectId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof removeEditorFromProject>>, {projectId: string;userId: string}> = (props) => {\n const {projectId,userId} = props ?? {};\n\n return removeEditorFromProject(projectId,userId,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof removeEditorFromProject>>, TError, {projectId: string;userId: string}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nYou must be an `editor` or the `owner` of the project if the project is private\n\n * @summary Download a Project file\n */\nexport const getProjectFile = (\n projectId: string,\n params: GetProjectFileParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n return customInstance<void>(\n {url: `/project/${projectId}/file`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetProjectFileQueryKey = (projectId: string,\n params: GetProjectFileParams,) => [`/project/${projectId}/file`, ...(params ? [params]: [])];\n\n \nexport type GetProjectFileQueryResult = NonNullable<Awaited<ReturnType<typeof getProjectFile>>>\nexport type GetProjectFileQueryError = ErrorType<DmError>\n\nexport const useGetProjectFile = <TData = Awaited<ReturnType<typeof getProjectFile>>, TError = ErrorType<DmError>>(\n projectId: string,\n params: GetProjectFileParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const {query: queryOptions, request: requestOptions} = options ?? {}\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFile>>> = ({ signal }) => getProjectFile(projectId,params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>(queryKey, queryFn, {enabled: !!(projectId), ...queryOptions}) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n}\n\n/**\n * The user provides an external file for upload to the Project using an optional Path. The path is created if it does not exist.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Upload a file into a Project\n */\nexport const addFileToProject = (\n projectId: string,\n projectFilePutBodyBody: ProjectFilePutBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {const formData = new FormData();\nformData.append('file', projectFilePutBodyBody.file)\nif(projectFilePutBodyBody.as_filename !== undefined) {\n formData.append('as_filename', projectFilePutBodyBody.as_filename)\n }\nif(projectFilePutBodyBody.path !== undefined) {\n formData.append('path', projectFilePutBodyBody.path)\n }\n\n return customInstance<void>(\n {url: `/project/${projectId}/file`, method: 'put',\n headers: {'Content-Type': 'multipart/form-data', },\n data: formData\n },\n options);\n }\n \n\n\n export type AddFileToProjectMutationResult = NonNullable<Awaited<ReturnType<typeof addFileToProject>>>\n export type AddFileToProjectMutationBody = ProjectFilePutBodyBody\n export type AddFileToProjectMutationError = ErrorType<DmError>\n\n export const useAddFileToProject = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addFileToProject>>, TError,{projectId: string;data: ProjectFilePutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof addFileToProject>>, {projectId: string;data: ProjectFilePutBodyBody}> = (props) => {\n const {projectId,data} = props ?? {};\n\n return addFileToProject(projectId,data,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof addFileToProject>>, TError, {projectId: string;data: ProjectFilePutBodyBody}, TContext>(mutationFn, mutationOptions)\n }\n /**\n * Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nAs there is no security You must provide a valid token. The token must be a token valid for the project, usually generated when an Instance has been launched in the Project. If the token is not valid ou will receive a `403` error\n\n * @summary Download a Project file using a Token\n */\nexport const getProjectFileWithToken = (\n projectId: string,\n params: GetProjectFileWithTokenParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n return customInstance<void>(\n {url: `/project/${projectId}/file-with-token`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetProjectFileWithTokenQueryKey = (projectId: string,\n params: GetProjectFileWithTokenParams,) => [`/project/${projectId}/file-with-token`, ...(params ? [params]: [])];\n\n \nexport type GetProjectFileWithTokenQueryResult = NonNullable<Awaited<ReturnType<typeof getProjectFileWithToken>>>\nexport type GetProjectFileWithTokenQueryError = ErrorType<DmError>\n\nexport const useGetProjectFileWithToken = <TData = Awaited<ReturnType<typeof getProjectFileWithToken>>, TError = ErrorType<DmError>>(\n projectId: string,\n params: GetProjectFileWithTokenParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const {query: queryOptions, request: requestOptions} = options ?? {}\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectFileWithTokenQueryKey(projectId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFileWithToken>>> = ({ signal }) => getProjectFileWithToken(projectId,params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>(queryKey, queryFn, {enabled: !!(projectId), ...queryOptions}) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n}\n\n"]}
|
package/project/project.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bC as customInstance, aZ as ProjectsGetResponse, bD as ErrorType, by as DmError, Y as ProjectPostBodyBody, a_ as ProjectPostResponse, ao as ProjectDetail, Z as ProjectPatchBodyBody, ai as TaskIdentity, o as GetProjectFileParams, _ as ProjectFilePutBodyBody, n as GetProjectFileWithTokenParams } from '../custom-instance-
|
|
1
|
+
import { bC as customInstance, aZ as ProjectsGetResponse, bD as ErrorType, by as DmError, Y as ProjectPostBodyBody, a_ as ProjectPostResponse, ao as ProjectDetail, Z as ProjectPatchBodyBody, ai as TaskIdentity, o as GetProjectFileParams, _ as ProjectFilePutBodyBody, n as GetProjectFileWithTokenParams } from '../custom-instance-9e5c9e19.js';
|
|
2
2
|
import * as react_query from 'react-query';
|
|
3
3
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
|
|
4
4
|
import 'axios';
|
|
@@ -43,10 +43,10 @@ declare const useCreateProject: <TError = ErrorType<void | DmError>, TContext =
|
|
|
43
43
|
data: ProjectPostBodyBody;
|
|
44
44
|
}, TContext>;
|
|
45
45
|
/**
|
|
46
|
-
|
|
46
|
+
* Gets the details of a project that is available to you.
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
* @summary Get a Project
|
|
49
|
+
*/
|
|
50
50
|
declare const getProject: (projectId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<ProjectDetail>;
|
|
51
51
|
declare const getGetProjectQueryKey: (projectId: string) => string[];
|
|
52
52
|
declare type GetProjectQueryResult = NonNullable<Awaited<ReturnType<typeof getProject>>>;
|
|
@@ -77,14 +77,14 @@ declare const usePatchProject: <TError = ErrorType<DmError>, TContext = unknown>
|
|
|
77
77
|
data: ProjectPatchBodyBody;
|
|
78
78
|
}, TContext>;
|
|
79
79
|
/**
|
|
80
|
-
|
|
80
|
+
* Deletes an existing project.
|
|
81
81
|
|
|
82
82
|
You must be an `editor` or the `owner` of the project.
|
|
83
83
|
|
|
84
84
|
Once deleted all **Files**, working directories and material in the project will also be removed
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
* @summary Delete a Project
|
|
87
|
+
*/
|
|
88
88
|
declare const deleteProject: (projectId: string, options?: SecondParameter<typeof customInstance>) => Promise<TaskIdentity>;
|
|
89
89
|
declare type DeleteProjectMutationResult = NonNullable<Awaited<ReturnType<typeof deleteProject>>>;
|
|
90
90
|
declare type DeleteProjectMutationError = ErrorType<void | DmError>;
|
|
@@ -97,14 +97,14 @@ declare const useDeleteProject: <TError = ErrorType<void | DmError>, TContext =
|
|
|
97
97
|
projectId: string;
|
|
98
98
|
}, TContext>;
|
|
99
99
|
/**
|
|
100
|
-
|
|
100
|
+
* Adds a user to a project as an `editor`. Editors can add and remove datasets in a project and delete the project.
|
|
101
101
|
|
|
102
102
|
An `editor` of a project is not automatically an `editor` of any datasets the project contains.
|
|
103
103
|
|
|
104
104
|
You must be an `editor` or the `owner` of the project
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
* @summary Add a Project Editor
|
|
107
|
+
*/
|
|
108
108
|
declare const addEditorToProject: (projectId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
109
109
|
declare type AddEditorToProjectMutationResult = NonNullable<Awaited<ReturnType<typeof addEditorToProject>>>;
|
|
110
110
|
declare type AddEditorToProjectMutationError = ErrorType<DmError>;
|
|
@@ -119,14 +119,14 @@ declare const useAddEditorToProject: <TError = ErrorType<DmError>, TContext = un
|
|
|
119
119
|
userId: string;
|
|
120
120
|
}, TContext>;
|
|
121
121
|
/**
|
|
122
|
-
|
|
122
|
+
* Deletes a project `editor`. The editor can be you but you cannot delete the last `editor`
|
|
123
123
|
|
|
124
124
|
A project must always have one `editor` so you will not be able to delete the last editor of a project.
|
|
125
125
|
|
|
126
126
|
You must be an `editor` or the `owner` of the project
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
* @summary Delete a Project Editor
|
|
129
|
+
*/
|
|
130
130
|
declare const removeEditorFromProject: (projectId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
131
131
|
declare type RemoveEditorFromProjectMutationResult = NonNullable<Awaited<ReturnType<typeof removeEditorFromProject>>>;
|
|
132
132
|
declare type RemoveEditorFromProjectMutationError = ErrorType<DmError>;
|
|
@@ -141,14 +141,14 @@ declare const useRemoveEditorFromProject: <TError = ErrorType<DmError>, TContext
|
|
|
141
141
|
userId: string;
|
|
142
142
|
}, TContext>;
|
|
143
143
|
/**
|
|
144
|
-
|
|
144
|
+
* Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).
|
|
145
145
|
|
|
146
146
|
For **managed** files you should consider using the `/file/{file_id}` endpoint.
|
|
147
147
|
|
|
148
148
|
You must be an `editor` or the `owner` of the project if the project is private
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
* @summary Download a Project file
|
|
151
|
+
*/
|
|
152
152
|
declare const getProjectFile: (projectId: string, params: GetProjectFileParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<void>;
|
|
153
153
|
declare const getGetProjectFileQueryKey: (projectId: string, params: GetProjectFileParams) => (string | GetProjectFileParams)[];
|
|
154
154
|
declare type GetProjectFileQueryResult = NonNullable<Awaited<ReturnType<typeof getProjectFile>>>;
|
|
@@ -181,14 +181,14 @@ declare const useAddFileToProject: <TError = ErrorType<DmError>, TContext = unkn
|
|
|
181
181
|
data: ProjectFilePutBodyBody;
|
|
182
182
|
}, TContext>;
|
|
183
183
|
/**
|
|
184
|
-
|
|
184
|
+
* Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).
|
|
185
185
|
|
|
186
186
|
For **managed** files you should consider using the `/file/{file_id}` endpoint.
|
|
187
187
|
|
|
188
188
|
As there is no security You must provide a valid token. The token must be a token valid for the project, usually generated when an Instance has been launched in the Project. If the token is not valid ou will receive a `403` error
|
|
189
189
|
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
* @summary Download a Project file using a Token
|
|
191
|
+
*/
|
|
192
192
|
declare const getProjectFileWithToken: (projectId: string, params: GetProjectFileWithTokenParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<void>;
|
|
193
193
|
declare const getGetProjectFileWithTokenQueryKey: (projectId: string, params: GetProjectFileWithTokenParams) => (string | GetProjectFileWithTokenParams)[];
|
|
194
194
|
declare type GetProjectFileWithTokenQueryResult = NonNullable<Awaited<ReturnType<typeof getProjectFileWithToken>>>;
|