@squonk/data-manager-client 1.0.0-rc.4 → 1.0.2-rc.2
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.d.ts +1 -1
- package/admin/admin.cjs +19 -1
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +23 -6
- package/admin/admin.js +18 -0
- package/admin/admin.js.map +1 -1
- package/application/application.cjs.map +1 -1
- package/application/application.d.ts +3 -3
- package/application/application.js.map +1 -1
- package/{custom-instance-f73fb7dc.d.ts → custom-instance-3a73945d.d.ts} +49 -12
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +5 -5
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.d.ts +1 -1
- package/file/file.d.ts +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.ts +5 -5
- package/instance/instance.js.map +1 -1
- package/job/job.cjs.map +1 -1
- package/job/job.d.ts +3 -3
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.ts +3 -3
- package/metadata/metadata.js.map +1 -1
- package/package.json +1 -1
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +13 -13
- package/project/project.js.map +1 -1
- package/src/admin/admin.ts +61 -4
- package/src/application/application.ts +2 -2
- package/src/data-manager-api.schemas.ts +52 -13
- package/src/dataset/dataset.ts +4 -4
- package/src/instance/instance.ts +4 -4
- package/src/job/job.ts +2 -2
- package/src/metadata/metadata.ts +2 -2
- package/src/project/project.ts +12 -12
- package/src/task/task.ts +2 -2
- package/task/task.cjs.map +1 -1
- package/task/task.d.ts +3 -3
- package/task/task.js.map +1 -1
- package/type/type.d.ts +1 -1
- package/user/user.d.ts +1 -1
package/job/job.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/job/job.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 } from \"react-query\";\nimport type {\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n JobsGetResponse,\n DmError,\n JobGetResponse,\n GetJobByVersionParams,\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 jobs available to you that can be instantiated via the `/instance` endpoint.\n\nJob availability will vary as Jobs are added to the cluster.\n\n * @summary Get all Jobs available to you\n */\nexport const getJobs = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<JobsGetResponse>(\n { url: `/job`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetJobsQueryKey = () => [`/job`];\n\nexport type GetJobsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getJobs>>\n>;\nexport type GetJobsQueryError = ErrorType<DmError>;\n\nexport const useGetJobs = <\n TData = Awaited<ReturnType<typeof getJobs>>,\n TError = ErrorType<DmError>\n>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getJobs>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetJobsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobs>>> = ({\n signal,\n }) => getJobs(requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getJobs>>, 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 * Gets a Job based on
|
|
1
|
+
{"version":3,"sources":["../../src/job/job.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 } from \"react-query\";\nimport type {\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n JobsGetResponse,\n DmError,\n JobGetResponse,\n GetJobByVersionParams,\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 jobs available to you that can be instantiated via the `/instance` endpoint.\n\nJob availability will vary as Jobs are added to the cluster.\n\n * @summary Get all Jobs available to you\n */\nexport const getJobs = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<JobsGetResponse>(\n { url: `/job`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetJobsQueryKey = () => [`/job`];\n\nexport type GetJobsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getJobs>>\n>;\nexport type GetJobsQueryError = ErrorType<DmError>;\n\nexport const useGetJobs = <\n TData = Awaited<ReturnType<typeof getJobs>>,\n TError = ErrorType<DmError>\n>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getJobs>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetJobsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobs>>> = ({\n signal,\n }) => getJobs(requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getJobs>>, 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 * Gets a Job based on its **collection**, **job** and **version**.\n\nJob availability will vary as Jobs are added to the cluster. Jobs that have been added are unlikely to be removed.\n\n * @summary Get a Job by its version\n */\nexport const getJobByVersion = (\n params: GetJobByVersionParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<JobGetResponse>(\n { url: `/job/get-by-version`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetJobByVersionQueryKey = (params: GetJobByVersionParams) => [\n `/job/get-by-version`,\n ...(params ? [params] : []),\n];\n\nexport type GetJobByVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getJobByVersion>>\n>;\nexport type GetJobByVersionQueryError = ErrorType<DmError>;\n\nexport const useGetJobByVersion = <\n TData = Awaited<ReturnType<typeof getJobByVersion>>,\n TError = ErrorType<DmError>\n>(\n params: GetJobByVersionParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getJobByVersion>>,\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 ?? getGetJobByVersionQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobByVersion>>> = ({\n signal,\n }) => getJobByVersion(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getJobByVersion>>,\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 * Get details of a specific job available to you that can be instantiated.\n\nTo run a job you need to use the `/instance` endpoint. The Job is controlled through the `specification` field, a JSON string. You will need to identify the Job using its `collection`, `job` and `version` as well as providing any variables in the specification required by the Job's command.\n\n * @summary Get details of a specific Job\n */\nexport const getJob = (\n jobId: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<JobGetResponse>(\n { url: `/job/${jobId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetJobQueryKey = (jobId: number) => [`/job/${jobId}`];\n\nexport type GetJobQueryResult = NonNullable<Awaited<ReturnType<typeof getJob>>>;\nexport type GetJobQueryError = ErrorType<void | DmError>;\n\nexport const useGetJob = <\n TData = Awaited<ReturnType<typeof getJob>>,\n TError = ErrorType<void | DmError>\n>(\n jobId: number,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getJob>>, TError, TData>;\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 ?? getGetJobQueryKey(jobId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getJob>>> = ({\n signal,\n }) => getJob(jobId, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getJob>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!jobId, ...queryOptions }\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,gBAAgB;AA+BlB,IAAM,UAAU,CACrB,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,QAAQ,QAAQ,OAAO,OAAO;AAAA,IACrC;AAAA,EACF;AACF;AAEO,IAAM,qBAAqB,MAAM,CAAC,MAAM;AAOxC,IAAM,aAAa,CAGxB,YAG4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,Q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O,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","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"]}
|
|
1
|
+
{"version":3,"sources":["../../src/metadata/metadata.ts"],"names":[],"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,EAAE,gBAAgB,sBAAsB;AAAA,MACjD,MAAM;AAAA,IACR;AAAA,IACA;AAAA,EACF;AACF;AAQO,IAAM,wBAAwB,CAGnC,YAYI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAOF,CAAC,UAAU;AACb,UAAM,EAAE,WAAW,gBAAgB,KAAK,IAAI,SAAS,CAAC;AAEtD,WAAO,mBAAmB,WAAW,gBAAgB,MAAM,cAAc;AAAA,EAC3E;AAEA,SAAO,YASL,YAAY,eAAe;AAC/B;A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AAA,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","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"]}
|
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,
|
|
3
|
+
import { a5 as DatasetVersionMetaPostBodyBody, bB as customInstance, bn as DatasetMetaGetResponse, bC as ErrorType, bx as DmError, a6 as DatasetMetaPostBodyBody } from '../custom-instance-3a73945d.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;
|
|
@@ -32,7 +32,7 @@ declare const useAddMetadataVersion: <TError = ErrorType<void | DmError>, TConte
|
|
|
32
32
|
/**
|
|
33
33
|
* Returns the metadata for a Dataset version in JSON format.
|
|
34
34
|
|
|
35
|
-
* @summary Gets the
|
|
35
|
+
* @summary Gets the Metadata for a specific Dataset version
|
|
36
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[];
|
|
@@ -68,7 +68,7 @@ declare const useAddMetadata: <TError = ErrorType<void | DmError>, TContext = un
|
|
|
68
68
|
/**
|
|
69
69
|
* Returns the metadata for a Dataset in JSON format.
|
|
70
70
|
|
|
71
|
-
* @summary Gets the
|
|
71
|
+
* @summary Gets the Metadata for a specific Dataset
|
|
72
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[];
|
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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AAM;AAAA,EAC1D;AAEA,SAAO;AAAA,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 { 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,qBA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,CAAC;AAAA,IACX,GAAG;AAAA,EACL,CAAC;AAED,QAAM,WAAW;AAEjB,SAAO;AACT;","names":[]}
|
package/package.json
CHANGED
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,MACjD,MAAM;AAAA,IACR;AAAA,IACA;AAAA,EACF;AACF;AAQO,IAAM,mBAAmB,CAG9B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,KAAK,I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,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 projects 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":["../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BAA0B,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"]}
|
package/project/project.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bB as customInstance, aZ as ProjectsGetResponse, bC as ErrorType, bx as DmError, Y as ProjectPostBodyBody, a_ as ProjectPostResponse, ao as ProjectDetail, Z as ProjectPatchBodyBody, ai as TaskIdentity, p as GetProjectFileParams, _ as ProjectFilePutBodyBody, o as GetProjectFileWithTokenParams } from '../custom-instance-3a73945d.js';
|
|
2
2
|
import * as react_query from 'react-query';
|
|
3
3
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
|
|
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;
|
|
7
7
|
/**
|
|
8
|
-
* Get a list of all
|
|
8
|
+
* Get a list of all Projects available to you.
|
|
9
9
|
|
|
10
|
-
* @summary Get all
|
|
10
|
+
* @summary Get all Pojects available to you
|
|
11
11
|
*/
|
|
12
12
|
declare const getProjects: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal | undefined) => Promise<ProjectsGetResponse>;
|
|
13
13
|
declare const getGetProjectsQueryKey: () => string[];
|
|
@@ -20,7 +20,7 @@ declare const useGetProjects: <TData = ProjectsGetResponse, TError = ErrorType<v
|
|
|
20
20
|
queryKey: QueryKey;
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
|
-
* Creates a new
|
|
23
|
+
* 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**.
|
|
24
24
|
|
|
25
25
|
To create a Project you will need an uncommitted Project product.
|
|
26
26
|
|
|
@@ -28,7 +28,7 @@ As the project `owner` (creator) you are also automatically an `editor` of the p
|
|
|
28
28
|
|
|
29
29
|
The 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.
|
|
30
30
|
|
|
31
|
-
* @summary Create a new
|
|
31
|
+
* @summary Create a new Project
|
|
32
32
|
*/
|
|
33
33
|
declare const createProject: (projectPostBodyBody: ProjectPostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<ProjectPostResponse>;
|
|
34
34
|
declare type CreateProjectMutationResult = NonNullable<Awaited<ReturnType<typeof createProject>>>;
|
|
@@ -45,7 +45,7 @@ declare const useCreateProject: <TError = ErrorType<void | DmError>, TContext =
|
|
|
45
45
|
/**
|
|
46
46
|
* Gets the details of a project that is available to you.
|
|
47
47
|
|
|
48
|
-
* @summary Get a
|
|
48
|
+
* @summary Get a Project
|
|
49
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[];
|
|
@@ -58,9 +58,9 @@ declare const useGetProject: <TData = ProjectDetail, TError = ErrorType<void | D
|
|
|
58
58
|
queryKey: QueryKey;
|
|
59
59
|
};
|
|
60
60
|
/**
|
|
61
|
-
* Used to update some adjustable parameters of a
|
|
61
|
+
* 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
|
|
62
62
|
|
|
63
|
-
* @summary Adjust an existing
|
|
63
|
+
* @summary Adjust an existing Project
|
|
64
64
|
*/
|
|
65
65
|
declare const patchProject: (projectId: string, projectPatchBodyBody: ProjectPatchBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
66
66
|
declare type PatchProjectMutationResult = NonNullable<Awaited<ReturnType<typeof patchProject>>>;
|
|
@@ -83,7 +83,7 @@ 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
|
-
* @summary Delete a
|
|
86
|
+
* @summary Delete a Project
|
|
87
87
|
*/
|
|
88
88
|
declare const deleteProject: (projectId: string, options?: SecondParameter<typeof customInstance>) => Promise<TaskIdentity>;
|
|
89
89
|
declare type DeleteProjectMutationResult = NonNullable<Awaited<ReturnType<typeof deleteProject>>>;
|
|
@@ -103,7 +103,7 @@ An `editor` of a project is not automatically an `editor` of any datasets the pr
|
|
|
103
103
|
|
|
104
104
|
You must be an `editor` or the `owner` of the project
|
|
105
105
|
|
|
106
|
-
* @summary Add a
|
|
106
|
+
* @summary Add a Project Editor
|
|
107
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>>>;
|
|
@@ -125,7 +125,7 @@ A project must always have one `editor` so you will not be able to delete the la
|
|
|
125
125
|
|
|
126
126
|
You must be an `editor` or the `owner` of the project
|
|
127
127
|
|
|
128
|
-
* @summary Delete a
|
|
128
|
+
* @summary Delete a Project Editor
|
|
129
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>>>;
|
|
@@ -147,7 +147,7 @@ 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
|
-
* @summary Download a
|
|
150
|
+
* @summary Download a Project file
|
|
151
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)[];
|
|
@@ -187,7 +187,7 @@ 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
|
-
* @summary Download a
|
|
190
|
+
* @summary Download a Project file using a Token
|
|
191
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)[];
|
package/project/project.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/project/project.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 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 projects 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"],"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;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version":3,"sources":["../../src/project/project.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 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"],"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;AA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