@squonk/data-manager-client 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accounting/accounting.cjs +16 -12
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.ts +8 -8
- package/accounting/accounting.js +13 -9
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +19 -14
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +23 -23
- package/admin/admin.js +10 -5
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +12 -10
- package/application/application.cjs.map +1 -1
- package/application/application.d.ts +6 -6
- package/application/application.js +10 -8
- package/application/application.js.map +1 -1
- package/{chunk-3O5KIRV4.js → chunk-3RNIDX7T.js} +1 -1
- package/{chunk-3O5KIRV4.js.map → chunk-3RNIDX7T.js.map} +1 -1
- package/chunk-LNYWU37B.cjs +13 -0
- package/chunk-LNYWU37B.cjs.map +1 -0
- package/chunk-LT4O36DN.js +13 -0
- package/chunk-LT4O36DN.js.map +1 -0
- package/{chunk-IUEU2LYC.cjs → chunk-UZTHSGDT.cjs} +1 -1
- package/chunk-UZTHSGDT.cjs.map +1 -0
- package/{custom-instance-5c7b6971.d.ts → custom-instance-b5dd9223.d.ts} +259 -98
- package/dataset/dataset.cjs +29 -32
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +24 -24
- package/dataset/dataset.js +19 -22
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs +22 -18
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.ts +16 -16
- package/exchange-rate/exchange-rate.js +16 -12
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file/file.cjs +15 -15
- package/file/file.cjs.map +1 -1
- package/file/file.d.ts +13 -13
- package/file/file.js +10 -10
- package/file/file.js.map +1 -1
- package/index.cjs +2 -2
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs +17 -15
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.ts +18 -18
- package/instance/instance.js +10 -8
- package/instance/instance.js.map +1 -1
- package/job/job.cjs +16 -14
- package/job/job.cjs.map +1 -1
- package/job/job.d.ts +8 -8
- package/job/job.js +13 -11
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +14 -15
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.ts +12 -12
- package/metadata/metadata.js +10 -11
- package/metadata/metadata.js.map +1 -1
- package/package.json +12 -12
- package/project/project.cjs +28 -29
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +29 -29
- package/project/project.js +16 -17
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +14 -13
- package/src/admin/admin.ts +10 -9
- package/src/application/application.ts +10 -10
- package/src/data-manager-api.schemas.ts +206 -27
- package/src/dataset/dataset.ts +22 -24
- package/src/exchange-rate/exchange-rate.ts +18 -19
- package/src/file/file.ts +10 -10
- package/src/instance/instance.ts +10 -10
- package/src/job/job.ts +14 -13
- package/src/metadata/metadata.ts +10 -11
- package/src/project/project.ts +18 -19
- package/src/queryMutator.ts +12 -0
- package/src/task/task.ts +10 -9
- package/src/type/type.ts +6 -5
- package/src/user/user.ts +14 -13
- package/task/task.cjs +13 -12
- package/task/task.cjs.map +1 -1
- package/task/task.d.ts +8 -8
- package/task/task.js +10 -9
- package/task/task.js.map +1 -1
- package/type/type.cjs +8 -4
- package/type/type.cjs.map +1 -1
- package/type/type.d.ts +4 -4
- package/type/type.js +7 -3
- package/type/type.js.map +1 -1
- package/user/user.cjs +17 -13
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +11 -11
- package/user/user.js +13 -9
- package/user/user.js.map +1 -1
- package/chunk-IUEU2LYC.cjs.map +0 -1
package/dataset/dataset.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/dataset/dataset.ts"],"sourcesContent":["/**\n * Generated by orval v6.10.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n DatasetPutPostResponse,\n DmError,\n DatasetPutBodyBody,\n DatasetPostBodyBody,\n DatasetsGetResponse,\n GetDatasetsParams,\n DatasetVersionsGetResponse,\n GetVersionsParams,\n DatasetVersionDeleteResponse,\n DeleteDatasetParams,\n DatasetDigestGetResponse,\n DatasetSchemaGetResponse,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Using an unmanaged file in a Project as a source a Dataset (or new Dataset version) is created.\n\nThe dataset is assigned a unique identity if it has no **Parent**. If a Parent dataset is named during the upload the uploaded file inherits the Parent's identity and is issued with a new unique version number within the Dataset.\n\nBehaves like the corresponding **POST** method except the file is expected to exist on a Project path.\n\n * @summary Create a Dataset from a file in a Project\n */\nexport const createDatasetFromFile = (\n datasetPutBodyBody: DatasetPutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_type\", datasetPutBodyBody.dataset_type);\n if (datasetPutBodyBody.format_extra_variables !== undefined) {\n formData.append(\n \"format_extra_variables\",\n datasetPutBodyBody.format_extra_variables\n );\n }\n if (datasetPutBodyBody.skip_molecule_load !== undefined) {\n formData.append(\n \"skip_molecule_load\",\n datasetPutBodyBody.skip_molecule_load.toString()\n );\n }\n formData.append(\"project_id\", datasetPutBodyBody.project_id);\n formData.append(\"path\", datasetPutBodyBody.path);\n formData.append(\"file_name\", datasetPutBodyBody.file_name);\n if (datasetPutBodyBody.dataset_id !== undefined) {\n formData.append(\"dataset_id\", datasetPutBodyBody.dataset_id);\n }\n if (datasetPutBodyBody.unit_id !== undefined) {\n formData.append(\"unit_id\", datasetPutBodyBody.unit_id);\n }\n\n return customInstance<DatasetPutPostResponse>(\n {\n url: `/dataset`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateDatasetFromFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof createDatasetFromFile>>\n>;\nexport type CreateDatasetFromFileMutationBody = DatasetPutBodyBody;\nexport type CreateDatasetFromFileMutationError = ErrorType<void | DmError>;\n\nexport const useCreateDatasetFromFile = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n TError,\n { data: DatasetPutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n { data: DatasetPutBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createDatasetFromFile(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n TError,\n { data: DatasetPutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Uploads a dataset.\n\nDataset file-naming is strictly limited to a fixed set of extensions based on the Dataset **Type**. You can obtain the supported types (and their extensions) via the **\\/type** endpoint. Filenames that do not comply with the supported filename extensions will be rejected.\n\nDatasets can be uploaded in an uncompressed form, or uploaded pre-compressed using the `.gz` extension.\n\nThe dataset is assigned a unique identity if it has no **Parent**. If a Parent dataset is named during the upload the uploaded file inherits the Parent's identity and is issued with a new unique version number within the Dataset.\n\nDatasets undergo some processing in an asynchronous `task` after control returns to you. The unique identity of the assigned task (the `task id`) is presented to you in this endpoint's response. Before you can use an uploaded dataset, and before the dataset can be added to any pre-assigned projects, you must wait until the task is complete by making regular calls to the **\\/task/{task-id}** endpoint. A Dataset upload is complete when the corresponding `task.done` is **true** along with a `task.exit_code` of **0**. If the Dataset upload fails `task.done` will be **true** but the `task.exit_code` will be non-zero.\n\n * @summary Upload an external file as a Dataset\n */\nexport const uploadDataset = (\n datasetPostBodyBody: DatasetPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_file\", datasetPostBodyBody.dataset_file);\n formData.append(\"dataset_type\", datasetPostBodyBody.dataset_type);\n if (datasetPostBodyBody.format_extra_variables !== undefined) {\n formData.append(\n \"format_extra_variables\",\n datasetPostBodyBody.format_extra_variables\n );\n }\n if (datasetPostBodyBody.skip_molecule_load !== undefined) {\n formData.append(\n \"skip_molecule_load\",\n datasetPostBodyBody.skip_molecule_load.toString()\n );\n }\n if (datasetPostBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", datasetPostBodyBody.as_filename);\n }\n if (datasetPostBodyBody.dataset_id !== undefined) {\n formData.append(\"dataset_id\", datasetPostBodyBody.dataset_id);\n }\n formData.append(\"unit_id\", datasetPostBodyBody.unit_id);\n\n return customInstance<DatasetPutPostResponse>(\n {\n url: `/dataset`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type UploadDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof uploadDataset>>\n>;\nexport type UploadDatasetMutationBody = DatasetPostBodyBody;\nexport type UploadDatasetMutationError = ErrorType<void | DmError>;\n\nexport const useUploadDataset = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof uploadDataset>>,\n TError,\n { data: DatasetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof uploadDataset>>,\n { data: DatasetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return uploadDataset(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof uploadDataset>>,\n TError,\n { data: DatasetPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns datasets that you have access to, whether attached to a project or not.\n\nYou will not see Datasets while their upload is still in progress.\n\nDatasets can be filtered by: 1. `owner username`, 2. `mime_type`, 3. a list of `owners` (a subset of the above) 4. a list of `editors` (a subset of the above) 5. `Labels` or `Label/Value` pairs (a subset of the above)\n\nNote that if `editors` are combined with `owner username`, then the datasets will be filtered by owner username first followed by editors (so it's an AND). If `editors` are combined with `owners`, then the result will be datasets filtered by a combination of owners OR editors.\n\n * @summary Get Datasets that are available to you\n */\nexport const getDatasets = (\n params?: GetDatasetsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetsGetResponse>(\n { url: `/dataset`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetDatasetsQueryKey = (params?: GetDatasetsParams) => [\n `/dataset`,\n ...(params ? [params] : []),\n];\n\nexport type GetDatasetsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDatasets>>\n>;\nexport type GetDatasetsQueryError = ErrorType<void | DmError>;\n\nexport const useGetDatasets = <\n TData = Awaited<ReturnType<typeof getDatasets>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetDatasetsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getDatasets>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetDatasetsQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getDatasets>>> = ({\n signal,\n }) => getDatasets(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getDatasets>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Returns a list of Dataset versions.\n\nYou will not see Datasets while their upload is still in progress.\n\n * @summary Gets all the versions of a specific Dataset\n */\nexport const getVersions = (\n datasetId: string,\n params?: GetVersionsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetVersionsGetResponse>(\n { url: `/dataset/${datasetId}/versions`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetVersionsQueryKey = (\n datasetId: string,\n params?: GetVersionsParams\n) => [`/dataset/${datasetId}/versions`, ...(params ? [params] : [])];\n\nexport type GetVersionsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getVersions>>\n>;\nexport type GetVersionsQueryError = ErrorType<void | DmError>;\n\nexport const useGetVersions = <\n TData = Awaited<ReturnType<typeof getVersions>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n params?: GetVersionsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getVersions>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetVersionsQueryKey(datasetId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getVersions>>> = ({\n signal,\n }) => getVersions(datasetId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getVersions>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!datasetId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Given the Dataset `id` and `version` the Dataset will be removed. The API does not prevent you removing a Dataset that's been used in a **Project**. When removed using this endpoint the Dataset is automatically detached from any and all Projects that it was attached to and any corresponding Project Files relating to the Dataset are also removed.\n\nYou must be an `editor` or `owner` of the Dataset.\n\nYou cannot delete a Dataset until its upload is complete.\n\n * @summary Delete a Dataset\n */\nexport const deleteDataset = (\n datasetId: string,\n datasetVersion: number,\n params?: DeleteDatasetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<DatasetVersionDeleteResponse>(\n {\n url: `/dataset/${datasetId}/${datasetVersion}`,\n method: \"delete\",\n params,\n },\n options\n );\n};\n\nexport type DeleteDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteDataset>>\n>;\n\nexport type DeleteDatasetMutationError = ErrorType<void | DmError>;\n\nexport const useDeleteDataset = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteDataset>>,\n TError,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteDataset>>,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams }\n > = (props) => {\n const { datasetId, datasetVersion, params } = props ?? {};\n\n return deleteDataset(datasetId, datasetVersion, params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteDataset>>,\n TError,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Given a `dataset_id` the dataset will be returned if available.\n\nYou cannot get a Dataset until its upload is complete.\n\n * @summary Download a Dataset\n */\nexport const downloadDataset = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/${datasetVersion}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getDownloadDatasetQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/${datasetVersion}`];\n\nexport type DownloadDatasetQueryResult = NonNullable<\n Awaited<ReturnType<typeof downloadDataset>>\n>;\nexport type DownloadDatasetQueryError = ErrorType<DmError>;\n\nexport const useDownloadDataset = <\n TData = Awaited<ReturnType<typeof downloadDataset>>,\n TError = ErrorType<DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadDataset>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getDownloadDatasetQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadDataset>>> = ({\n signal,\n }) => downloadDataset(datasetId, datasetVersion, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof downloadDataset>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!(datasetId && datasetVersion),\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * The user is removed from the Dataset's `editor` list. The user is removed from all versions of a dataset. You can remove yourself but an `owner` (creator) will always have access to the dataset.\n\nYou must be an `editor` or `owner` of the dataset.\n\nYou cannot modify Dataset editors until its upload is complete.\n\n * @summary Remove a user's edit permission for a Dataset\n */\nexport const removeEditorFromDataset = (\n datasetId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/editor/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type RemoveEditorFromDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeEditorFromDataset>>\n>;\n\nexport type RemoveEditorFromDatasetMutationError = ErrorType<DmError>;\n\nexport const useRemoveEditorFromDataset = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n { datasetId: string; userId: string }\n > = (props) => {\n const { datasetId, userId } = props ?? {};\n\n return removeEditorFromDataset(datasetId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * The user is added to the dataset's editor list. The dataset `owner` is automatically an editor and so does not need to be added as an `editor`.\n\nYou must be an `editor` or `owner` of the dataset.\n\nYou cannot modify Dataset editors until its upload is complete.\n\n * @summary Give a user edit permission for a Dataset\n */\nexport const addEditorToDataset = (\n datasetId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/editor/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddEditorToDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof addEditorToDataset>>\n>;\n\nexport type AddEditorToDatasetMutationError = ErrorType<DmError>;\n\nexport const useAddEditorToDataset = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n { datasetId: string; userId: string }\n > = (props) => {\n const { datasetId, userId } = props ?? {};\n\n return addEditorToDataset(datasetId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns a dataset ID and version of a dataset that matches the provided SHA256 digest, a 64-character hex string.\n\n * @summary Gets the first Dataset that matches the provided digest\n */\nexport const getDatasetDigest = (\n datasetDigest: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetDigestGetResponse>(\n { url: `/dataset/digest/${datasetDigest}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetDatasetDigestQueryKey = (datasetDigest: string) => [\n `/dataset/digest/${datasetDigest}`,\n];\n\nexport type GetDatasetDigestQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDatasetDigest>>\n>;\nexport type GetDatasetDigestQueryError = ErrorType<void | DmError>;\n\nexport const useGetDatasetDigest = <\n TData = Awaited<ReturnType<typeof getDatasetDigest>>,\n TError = ErrorType<void | DmError>\n>(\n datasetDigest: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getDatasetDigest>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetDatasetDigestQueryKey(datasetDigest);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getDatasetDigest>>\n > = ({ signal }) => getDatasetDigest(datasetDigest, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getDatasetDigest>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!datasetDigest,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Returns the property schema for a Dataset versions in JSON format (if available).\n\n * @summary Gets the property schema for a specific Dataset\n */\nexport const getSchema = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetSchemaGetResponse>(\n {\n url: `/dataset/${datasetId}/schema/${datasetVersion}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetSchemaQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/schema/${datasetVersion}`];\n\nexport type GetSchemaQueryResult = NonNullable<\n Awaited<ReturnType<typeof getSchema>>\n>;\nexport type GetSchemaQueryError = ErrorType<void | DmError>;\n\nexport const useGetSchema = <\n TData = Awaited<ReturnType<typeof getSchema>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getSchema>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetSchemaQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getSchema>>> = ({\n signal,\n }) => getSchema(datasetId, datasetVersion, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getSchema>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(datasetId && datasetVersion), ...queryOptions }\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AA2C/B,IAAM,wBAAwB,CACnC,oBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,gBAAgB,mBAAmB,YAAY;AAC/D,MAAI,mBAAmB,2BAA2B,QAAW;AAC3D,aAAS;AAAA,MACP;AAAA,MACA,mBAAmB;AAAA,IACrB;AAAA,EACF;AACA,MAAI,mBAAmB,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ACF;AAEO,IAAM,8BAA8B,CAAC,kBAA0B;AAAA,EACpE,mBAAmB;AACrB;AAOO,IAAM,sBAAsB,CAIjC,eACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,4BAA4B,aAAa;AAErE,QAAM,UAEF,CAAC,EAAE,OAAO,MAAM,iBAAiB,eAAe,gBAAgB,MAAM;AAE1E,QAAM,QAAQ,SAIZ,UAAU,SAAS;AAAA,IACnB,SAAS,CAAC,CAAC;AAAA,IACX,GAAG;AAAA,EACL,CAAC;AAED,QAAM,WAAW;AAEjB,SAAO;AACT;AAOO,IAAM,YAAY,CACvB,WACA,gBACA,SACA,WACG;AACH,SAAO;AAAA,IACL;AAAA,MACE,KAAK,YAAY,oBAAoB;AAAA,MACrC,QAAQ;AAAA,MACR;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;AAEO,IAAM,uBAAuB,CAClC,WACA,mBACG,CAAC,YAAY,oBAAoB,gBAAgB;AAO/C,IAAM,eAAe,CAI1B,WACA,gBACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,qBAAqB,WAAW,cAAc;AAE1E,QAAM,UAAgE,CAAC;AAAA,IACrE;AAAA,EACF,MAAM,UAAU,WAAW,gBAAgB,gBAAgB,MAAM;AAEjE,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA;AAAA,IACA,EAAE,SAAS,CAAC,EAAE,aAAa,iBAAiB,GAAG,aAAa;AAAA,EAC9D;AAEA,QAAM,WAAW;AAEjB,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/dataset/dataset.ts"],"sourcesContent":["/**\n * Generated by orval v6.12.1 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n DatasetPutPostResponse,\n DmError,\n DatasetPutBodyBody,\n DatasetPostBodyBody,\n DatasetsGetResponse,\n GetDatasetsParams,\n DatasetVersionsGetResponse,\n GetVersionsParams,\n DatasetVersionDeleteResponse,\n DeleteDatasetParams,\n DatasetDigestGetResponse,\n DatasetSchemaGetResponse,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././queryMutator\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Using an unmanaged file in a Project as a source a Dataset (or new Dataset version) is created.\n\nThe dataset is assigned a unique identity if it has no **Parent**. If a Parent dataset is named during the upload the uploaded file inherits the Parent's identity and is issued with a new unique version number within the Dataset.\n\nBehaves like the corresponding **POST** method except the file is expected to exist on a Project path.\n\n * @summary Create a Dataset from a file in a Project\n */\nexport const createDatasetFromFile = (\n datasetPutBodyBody: DatasetPutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_type\", datasetPutBodyBody.dataset_type);\n if (datasetPutBodyBody.format_extra_variables !== undefined) {\n formData.append(\n \"format_extra_variables\",\n datasetPutBodyBody.format_extra_variables\n );\n }\n if (datasetPutBodyBody.skip_molecule_load !== undefined) {\n formData.append(\n \"skip_molecule_load\",\n datasetPutBodyBody.skip_molecule_load.toString()\n );\n }\n formData.append(\"project_id\", datasetPutBodyBody.project_id);\n formData.append(\"path\", datasetPutBodyBody.path);\n formData.append(\"file_name\", datasetPutBodyBody.file_name);\n if (datasetPutBodyBody.dataset_id !== undefined) {\n formData.append(\"dataset_id\", datasetPutBodyBody.dataset_id);\n }\n if (datasetPutBodyBody.unit_id !== undefined) {\n formData.append(\"unit_id\", datasetPutBodyBody.unit_id);\n }\n\n return customInstance<DatasetPutPostResponse>(\n {\n url: `/dataset`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateDatasetFromFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof createDatasetFromFile>>\n>;\nexport type CreateDatasetFromFileMutationBody = DatasetPutBodyBody;\nexport type CreateDatasetFromFileMutationError = ErrorType<void | DmError>;\n\nexport const useCreateDatasetFromFile = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n TError,\n { data: DatasetPutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n { data: DatasetPutBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createDatasetFromFile(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n TError,\n { data: DatasetPutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Uploads a dataset.\n\nDataset file-naming is strictly limited to a fixed set of extensions based on the Dataset **Type**. You can obtain the supported types (and their extensions) via the **\\/type** endpoint. Filenames that do not comply with the supported filename extensions will be rejected.\n\nDatasets can be uploaded in an uncompressed form, or uploaded pre-compressed using the `.gz` extension.\n\nThe dataset is assigned a unique identity if it has no **Parent**. If a Parent dataset is named during the upload the uploaded file inherits the Parent's identity and is issued with a new unique version number within the Dataset.\n\nDatasets undergo some processing in an asynchronous `task` after control returns to you. The unique identity of the assigned task (the `task id`) is presented to you in this endpoint's response. Before you can use an uploaded dataset, and before the dataset can be added to any pre-assigned projects, you must wait until the task is complete by making regular calls to the **\\/task/{task-id}** endpoint. A Dataset upload is complete when the corresponding `task.done` is **true** along with a `task.exit_code` of **0**. If the Dataset upload fails `task.done` will be **true** but the `task.exit_code` will be non-zero.\n\n * @summary Upload an external file as a Dataset\n */\nexport const uploadDataset = (\n datasetPostBodyBody: DatasetPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_file\", datasetPostBodyBody.dataset_file);\n formData.append(\"dataset_type\", datasetPostBodyBody.dataset_type);\n if (datasetPostBodyBody.format_extra_variables !== undefined) {\n formData.append(\n \"format_extra_variables\",\n datasetPostBodyBody.format_extra_variables\n );\n }\n if (datasetPostBodyBody.skip_molecule_load !== undefined) {\n formData.append(\n \"skip_molecule_load\",\n datasetPostBodyBody.skip_molecule_load.toString()\n );\n }\n if (datasetPostBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", datasetPostBodyBody.as_filename);\n }\n if (datasetPostBodyBody.dataset_id !== undefined) {\n formData.append(\"dataset_id\", datasetPostBodyBody.dataset_id);\n }\n formData.append(\"unit_id\", datasetPostBodyBody.unit_id);\n\n return customInstance<DatasetPutPostResponse>(\n {\n url: `/dataset`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type UploadDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof uploadDataset>>\n>;\nexport type UploadDatasetMutationBody = DatasetPostBodyBody;\nexport type UploadDatasetMutationError = ErrorType<void | DmError>;\n\nexport const useUploadDataset = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof uploadDataset>>,\n TError,\n { data: DatasetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof uploadDataset>>,\n { data: DatasetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return uploadDataset(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof uploadDataset>>,\n TError,\n { data: DatasetPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns datasets that you have access to, whether attached to a project or not.\n\nYou will not see Datasets while their upload is still in progress.\n\nDatasets can be filtered by: 1. `owner username`, 2. `mime_type`, 3. a list of `owners` (a subset of the above) 4. a list of `editors` (a subset of the above) 5. `Labels` or `Label/Value` pairs (a subset of the above)\n\nNote that if `editors` are combined with `owner username`, then the datasets will be filtered by owner username first followed by editors (so it's an AND). If `editors` are combined with `owners`, then the result will be datasets filtered by a combination of owners OR editors.\n\n * @summary Get Datasets that are available to you\n */\nexport const getDatasets = (\n params?: GetDatasetsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetsGetResponse>(\n { url: `/dataset`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetDatasetsQueryKey = (params?: GetDatasetsParams) => [\n `/dataset`,\n ...(params ? [params] : []),\n];\n\nexport type GetDatasetsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDatasets>>\n>;\nexport type GetDatasetsQueryError = ErrorType<void | DmError>;\n\nexport const useGetDatasets = <\n TData = Awaited<ReturnType<typeof getDatasets>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetDatasetsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getDatasets>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetDatasetsQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getDatasets>>> = ({\n signal,\n }) => getDatasets(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getDatasets>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Returns a list of Dataset versions.\n\nYou will not see Datasets while their upload is still in progress.\n\n * @summary Gets all the versions of a specific Dataset\n */\nexport const getVersions = (\n datasetId: string,\n params?: GetVersionsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetVersionsGetResponse>(\n { url: `/dataset/${datasetId}/versions`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetVersionsQueryKey = (\n datasetId: string,\n params?: GetVersionsParams\n) => [`/dataset/${datasetId}/versions`, ...(params ? [params] : [])];\n\nexport type GetVersionsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getVersions>>\n>;\nexport type GetVersionsQueryError = ErrorType<void | DmError>;\n\nexport const useGetVersions = <\n TData = Awaited<ReturnType<typeof getVersions>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n params?: GetVersionsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getVersions>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetVersionsQueryKey(datasetId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getVersions>>> = ({\n signal,\n }) => getVersions(datasetId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getVersions>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Given the Dataset `id` and `version` the Dataset will be removed. The API does not prevent you removing a Dataset that's been used in a **Project**. When removed using this endpoint the Dataset is automatically detached from any and all Projects that it was attached to and any corresponding Project Files relating to the Dataset are also removed.\n\nYou must be an `editor` or `owner` of the Dataset.\n\nYou cannot delete a Dataset until its upload is complete.\n\n * @summary Delete a Dataset\n */\nexport const deleteDataset = (\n datasetId: string,\n datasetVersion: number,\n params?: DeleteDatasetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<DatasetVersionDeleteResponse>(\n {\n url: `/dataset/${datasetId}/${datasetVersion}`,\n method: \"delete\",\n params,\n },\n options\n );\n};\n\nexport type DeleteDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteDataset>>\n>;\n\nexport type DeleteDatasetMutationError = ErrorType<void | DmError>;\n\nexport const useDeleteDataset = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteDataset>>,\n TError,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteDataset>>,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams }\n > = (props) => {\n const { datasetId, datasetVersion, params } = props ?? {};\n\n return deleteDataset(datasetId, datasetVersion, params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteDataset>>,\n TError,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Given a `dataset_id` the dataset will be returned if available.\n\nYou cannot get a Dataset until its upload is complete.\n\n * @summary Download a Dataset\n */\nexport const downloadDataset = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/${datasetVersion}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getDownloadDatasetQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/${datasetVersion}`];\n\nexport type DownloadDatasetQueryResult = NonNullable<\n Awaited<ReturnType<typeof downloadDataset>>\n>;\nexport type DownloadDatasetQueryError = ErrorType<DmError>;\n\nexport const useDownloadDataset = <\n TData = Awaited<ReturnType<typeof downloadDataset>>,\n TError = ErrorType<DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadDataset>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getDownloadDatasetQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadDataset>>> = ({\n signal,\n }) => downloadDataset(datasetId, datasetVersion, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof downloadDataset>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * The user is removed from the Dataset's `editor` list. The user is removed from all versions of a dataset. You can remove yourself but an `owner` (creator) will always have access to the dataset.\n\nYou must be an `editor` or `owner` of the dataset.\n\nYou cannot modify Dataset editors until its upload is complete.\n\n * @summary Remove a user's edit permission for a Dataset\n */\nexport const removeEditorFromDataset = (\n datasetId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/editor/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type RemoveEditorFromDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeEditorFromDataset>>\n>;\n\nexport type RemoveEditorFromDatasetMutationError = ErrorType<DmError>;\n\nexport const useRemoveEditorFromDataset = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n { datasetId: string; userId: string }\n > = (props) => {\n const { datasetId, userId } = props ?? {};\n\n return removeEditorFromDataset(datasetId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * The user is added to the dataset's editor list. The dataset `owner` is automatically an editor and so does not need to be added as an `editor`.\n\nYou must be an `editor` or `owner` of the dataset.\n\nYou cannot modify Dataset editors until its upload is complete.\n\n * @summary Give a user edit permission for a Dataset\n */\nexport const addEditorToDataset = (\n datasetId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/editor/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddEditorToDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof addEditorToDataset>>\n>;\n\nexport type AddEditorToDatasetMutationError = ErrorType<DmError>;\n\nexport const useAddEditorToDataset = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n { datasetId: string; userId: string }\n > = (props) => {\n const { datasetId, userId } = props ?? {};\n\n return addEditorToDataset(datasetId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns a dataset ID and version of a dataset that matches the provided SHA256 digest, a 64-character hex string.\n\n * @summary Gets the first Dataset that matches the provided digest\n */\nexport const getDatasetDigest = (\n datasetDigest: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetDigestGetResponse>(\n { url: `/dataset/digest/${datasetDigest}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetDatasetDigestQueryKey = (datasetDigest: string) => [\n `/dataset/digest/${datasetDigest}`,\n];\n\nexport type GetDatasetDigestQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDatasetDigest>>\n>;\nexport type GetDatasetDigestQueryError = ErrorType<void | DmError>;\n\nexport const useGetDatasetDigest = <\n TData = Awaited<ReturnType<typeof getDatasetDigest>>,\n TError = ErrorType<void | DmError>\n>(\n datasetDigest: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getDatasetDigest>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetDatasetDigestQueryKey(datasetDigest);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getDatasetDigest>>\n > = ({ signal }) => getDatasetDigest(datasetDigest, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getDatasetDigest>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Returns the property schema for a Dataset versions in JSON format (if available).\n\n * @summary Gets the property schema for a specific Dataset\n */\nexport const getSchema = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetSchemaGetResponse>(\n {\n url: `/dataset/${datasetId}/schema/${datasetVersion}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetSchemaQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/schema/${datasetVersion}`];\n\nexport type GetSchemaQueryResult = NonNullable<\n Awaited<ReturnType<typeof getSchema>>\n>;\nexport type GetSchemaQueryError = ErrorType<void | DmError>;\n\nexport const useGetSchema = <\n TData = Awaited<ReturnType<typeof getSchema>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getSchema>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetSchemaQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getSchema>>> = ({\n signal,\n }) => getSchema(datasetId, datasetVersion, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<Awaited<ReturnType<typeof getSchema>>, TError, TData>(\n customOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;;;;AAUA,SAAS,UAAU,mBAAmB;AA4C/B,IAAM,wBAAwB,CACnC,oBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,gBAAgB,mBAAmB,YAAY;AAC/D,MAAI,mBAAmB,2BAA2B,QAAW;AAC3D,aAAS;AAAA,MACP;AAAA,MACA,mBAAmB;AAAA,IACrB;AAAA,EACF;AACA,MAAI,mBAAmB,uBAAuB,QAAW;AACvD,aAAS;AAAA,MACP;AAAA,MACA,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,EACF;AACF;AAEO,IAAM,8BAA8B,CAAC,kBAA0B;AAAA,EACpE,mBAAmB;AACrB;AAOO,IAAM,sBAAsB,CAIjC,eACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,4BAA4B,aAAa;AAErE,QAAM,UAEF,CAAC,EAAE,OAAO,MAAM,iBAAiB,eAAe,gBAAgB,MAAM;AAE1E,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ,SAIZ,aAAa;AAEf,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;AAOO,IAAM,YAAY,CACvB,WACA,gBACA,SACA,WACG;AACH,SAAO;AAAA,IACL;AAAA,MACE,KAAK,YAAY,oBAAoB;AAAA,MACrC,QAAQ;AAAA,MACR;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;AAEO,IAAM,uBAAuB,CAClC,WACA,mBACG,CAAC,YAAY,oBAAoB,gBAAgB;AAO/C,IAAM,eAAe,CAI1B,WACA,gBACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,qBAAqB,WAAW,cAAc;AAE1E,QAAM,UAAgE,CAAC;AAAA,IACrE;AAAA,EACF,MAAM,UAAU,WAAW,gBAAgB,gBAAgB,MAAM;AAEjE,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ;AAAA,IACZ;AAAA,EACF;AAEA,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;","names":[]}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkLNYWU37Bcjs = require('../chunk-LNYWU37B.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkUZTHSGDTcjs = require('../chunk-UZTHSGDT.cjs');
|
|
4
7
|
|
|
5
8
|
// src/exchange-rate/exchange-rate.ts
|
|
6
9
|
var _reactquery = require('@tanstack/react-query');
|
|
7
10
|
var getAllApplicationExchangeRates = (params, options, signal) => {
|
|
8
|
-
return
|
|
11
|
+
return _chunkUZTHSGDTcjs.customInstance.call(void 0,
|
|
9
12
|
{ url: `/application/exchange-rate`, method: "get", params, signal },
|
|
10
13
|
options
|
|
11
14
|
);
|
|
@@ -15,8 +18,9 @@ var useGetAllApplicationExchangeRates = (params, options) => {
|
|
|
15
18
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
16
19
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetAllApplicationExchangeRatesQueryKey(params)));
|
|
17
20
|
const queryFn = ({ signal }) => getAllApplicationExchangeRates(params, requestOptions, signal);
|
|
18
|
-
const
|
|
19
|
-
query
|
|
21
|
+
const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
|
|
22
|
+
const query = _reactquery.useQuery.call(void 0, customOptions);
|
|
23
|
+
query.queryKey = customOptions.queryKey;
|
|
20
24
|
return query;
|
|
21
25
|
};
|
|
22
26
|
var setApplicationExchangeRate = (applicationId, exchangeRatePutBodyBody, options) => {
|
|
@@ -25,7 +29,7 @@ var setApplicationExchangeRate = (applicationId, exchangeRatePutBodyBody, option
|
|
|
25
29
|
if (exchangeRatePutBodyBody.comment !== void 0) {
|
|
26
30
|
formData.append("comment", exchangeRatePutBodyBody.comment);
|
|
27
31
|
}
|
|
28
|
-
return
|
|
32
|
+
return _chunkUZTHSGDTcjs.customInstance.call(void 0,
|
|
29
33
|
{
|
|
30
34
|
url: `/application/${applicationId}/exchange-rate`,
|
|
31
35
|
method: "put",
|
|
@@ -44,7 +48,7 @@ var useSetApplicationExchangeRate = (options) => {
|
|
|
44
48
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
45
49
|
};
|
|
46
50
|
var getApplicationExchangeRates = (applicationId, params, options, signal) => {
|
|
47
|
-
return
|
|
51
|
+
return _chunkUZTHSGDTcjs.customInstance.call(void 0,
|
|
48
52
|
{
|
|
49
53
|
url: `/application/${applicationId}/exchange-rate`,
|
|
50
54
|
method: "get",
|
|
@@ -62,15 +66,13 @@ var useGetApplicationExchangeRates = (applicationId, params, options) => {
|
|
|
62
66
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
63
67
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetApplicationExchangeRatesQueryKey(applicationId, params)));
|
|
64
68
|
const queryFn = ({ signal }) => getApplicationExchangeRates(applicationId, params, requestOptions, signal);
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
});
|
|
69
|
-
query.queryKey = queryKey;
|
|
69
|
+
const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
|
|
70
|
+
const query = _reactquery.useQuery.call(void 0, customOptions);
|
|
71
|
+
query.queryKey = customOptions.queryKey;
|
|
70
72
|
return query;
|
|
71
73
|
};
|
|
72
74
|
var getAllJobExchangeRates = (params, options, signal) => {
|
|
73
|
-
return
|
|
75
|
+
return _chunkUZTHSGDTcjs.customInstance.call(void 0,
|
|
74
76
|
{ url: `/job/exchange-rate`, method: "get", params, signal },
|
|
75
77
|
options
|
|
76
78
|
);
|
|
@@ -80,8 +82,9 @@ var useGetAllJobExchangeRates = (params, options) => {
|
|
|
80
82
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
81
83
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetAllJobExchangeRatesQueryKey(params)));
|
|
82
84
|
const queryFn = ({ signal }) => getAllJobExchangeRates(params, requestOptions, signal);
|
|
83
|
-
const
|
|
84
|
-
query
|
|
85
|
+
const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
|
|
86
|
+
const query = _reactquery.useQuery.call(void 0, customOptions);
|
|
87
|
+
query.queryKey = customOptions.queryKey;
|
|
85
88
|
return query;
|
|
86
89
|
};
|
|
87
90
|
var setJobPricing = (jobId, exchangeRatePutBodyBody, options) => {
|
|
@@ -90,7 +93,7 @@ var setJobPricing = (jobId, exchangeRatePutBodyBody, options) => {
|
|
|
90
93
|
if (exchangeRatePutBodyBody.comment !== void 0) {
|
|
91
94
|
formData.append("comment", exchangeRatePutBodyBody.comment);
|
|
92
95
|
}
|
|
93
|
-
return
|
|
96
|
+
return _chunkUZTHSGDTcjs.customInstance.call(void 0,
|
|
94
97
|
{
|
|
95
98
|
url: `/job/${jobId}/exchange-rate`,
|
|
96
99
|
method: "put",
|
|
@@ -109,7 +112,7 @@ var useSetJobPricing = (options) => {
|
|
|
109
112
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
110
113
|
};
|
|
111
114
|
var getJobExchangeRates = (jobId, params, options, signal) => {
|
|
112
|
-
return
|
|
115
|
+
return _chunkUZTHSGDTcjs.customInstance.call(void 0,
|
|
113
116
|
{ url: `/job/${jobId}/exchange-rate`, method: "get", params, signal },
|
|
114
117
|
options
|
|
115
118
|
);
|
|
@@ -119,8 +122,9 @@ var useGetJobExchangeRates = (jobId, params, options) => {
|
|
|
119
122
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
120
123
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetJobExchangeRatesQueryKey(jobId, params)));
|
|
121
124
|
const queryFn = ({ signal }) => getJobExchangeRates(jobId, params, requestOptions, signal);
|
|
122
|
-
const
|
|
123
|
-
query
|
|
125
|
+
const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
|
|
126
|
+
const query = _reactquery.useQuery.call(void 0, customOptions);
|
|
127
|
+
query.queryKey = customOptions.queryKey;
|
|
124
128
|
return query;
|
|
125
129
|
};
|
|
126
130
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exchange-rate/exchange-rate.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAqC/B,IAAM,iCAAiC,CAC5C,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,8BAA8B,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACnE;AAAA,EACF;AACF;AAEO,IAAM,4CAA4C,CACvD,WACG,CAAC,8BAA8B,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAQxD,IAAM,oCAAoC,CAI/C,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,0CAA0C,MAAM;AAE5E,QAAM,UAEF,CAAC,EAAE,OAAO,MACZ,+BAA+B,QAAQ,gBAAgB,MAAM;AAE/D,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAIjC,QAAM,WAAW;AAEjB,SAAO;AACT;AAWO,IAAM,6BAA6B,CACxC,eACA,yBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,QAAQ,wBAAwB,IAAI;AACpD,MAAI,wBAAwB,YAAY,QAAW;AACjD,aAAS,OAAO,WAAW,wBAAwB,OAAO;AAAA,EAC5D;AAEA,SAAO;AAAA,IACL;AAAA,MACE,KAAK,gBAAgB;AAAA,MACrB,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,MACjD,MAAM;AAAA,IACR;AAAA,IACA;AAAA,EACF;AACF;AAQO,IAAM,gCAAgC,CA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QAAM,UAEF,CAAC,EAAE,OAAO,MACZ,oBAAoB,OAAO,QAAQ,gBAAgB,MAAM;AAE3D,QAAM,QAAQ,SAIZ,UAAU,SAAS,EAAE,SAAS,CAAC,CAAC,OAAO,GAAG,aAAa,CAAC;AAK1D,QAAM,WAAW;AAEjB,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.10.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n GetAllExchangeRatesResponse,\n DmError,\n GetAllApplicationExchangeRatesParams,\n ExchangeRatePutBodyBody,\n GetExchangeRatesResponse,\n GetApplicationExchangeRatesParams,\n GetAllJobExchangeRatesParams,\n GetJobExchangeRatesParams,\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 * For every Application that has an exchange rate the current rate is returned. If you want a list of all Applications that have no exchange rate, set the `only_undefined` query option.\n\nIf an Application has no specific rate it adopts the current value of the default Application Exchange Rate.\n\n * @summary Gets Exchange Rates for all Applications\n */\nexport const getAllApplicationExchangeRates = (\n params?: GetAllApplicationExchangeRatesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<GetAllExchangeRatesResponse>(\n { url: `/application/exchange-rate`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetAllApplicationExchangeRatesQueryKey = (\n params?: GetAllApplicationExchangeRatesParams\n) => [`/application/exchange-rate`, ...(params ? [params] : [])];\n\nexport type GetAllApplicationExchangeRatesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>\n>;\nexport type GetAllApplicationExchangeRatesQueryError =\n ErrorType<void | DmError>;\n\nexport const useGetAllApplicationExchangeRates = <\n TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetAllApplicationExchangeRatesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,\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 ?? getGetAllApplicationExchangeRatesQueryKey(params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>\n > = ({ signal }) =>\n getAllApplicationExchangeRates(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,\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 * Sets the Exchange Rate for a specific Application. The rate replaces any exising rate for the application and applies to all future executions of the Application.\n\nIf an Application has no specific rate it adopts the current value of the default Application Exchange Rate.\n\nYou need admin privilege to use this method.\n\n * @summary Sets the Exchange Rate for a specific Application\n */\nexport const setApplicationExchangeRate = (\n applicationId: string,\n exchangeRatePutBodyBody: ExchangeRatePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"rate\", exchangeRatePutBodyBody.rate);\n if (exchangeRatePutBodyBody.comment !== undefined) {\n formData.append(\"comment\", exchangeRatePutBodyBody.comment);\n }\n\n return customInstance<void>(\n {\n url: `/application/${applicationId}/exchange-rate`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type SetApplicationExchangeRateMutationResult = NonNullable<\n Awaited<ReturnType<typeof setApplicationExchangeRate>>\n>;\nexport type SetApplicationExchangeRateMutationBody = ExchangeRatePutBodyBody;\nexport type SetApplicationExchangeRateMutationError = ErrorType<DmError>;\n\nexport const useSetApplicationExchangeRate = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof setApplicationExchangeRate>>,\n TError,\n { applicationId: string; data: ExchangeRatePutBodyBody },\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 setApplicationExchangeRate>>,\n { applicationId: string; data: ExchangeRatePutBodyBody }\n > = (props) => {\n const { applicationId, data } = props ?? {};\n\n return setApplicationExchangeRate(applicationId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof setApplicationExchangeRate>>,\n TError,\n { applicationId: string; data: ExchangeRatePutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the exchange rate history for a specific Application. Rates are returned in reverse chronological order, with the most recent rate, the current rate, as the first entry in the list.\n\n * @summary Gets the Application's Exchange Rate history\n */\nexport const getApplicationExchangeRates = (\n applicationId: string,\n params?: GetApplicationExchangeRatesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<GetExchangeRatesResponse>(\n {\n url: `/application/${applicationId}/exchange-rate`,\n method: \"get\",\n params,\n signal,\n },\n options\n );\n};\n\nexport const getGetApplicationExchangeRatesQueryKey = (\n applicationId: string,\n params?: GetApplicationExchangeRatesParams\n) => [\n `/application/${applicationId}/exchange-rate`,\n ...(params ? [params] : []),\n];\n\nexport type GetApplicationExchangeRatesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>\n>;\nexport type GetApplicationExchangeRatesQueryError = ErrorType<void | DmError>;\n\nexport const useGetApplicationExchangeRates = <\n TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>,\n TError = ErrorType<void | DmError>\n>(\n applicationId: string,\n params?: GetApplicationExchangeRatesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>,\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 getGetApplicationExchangeRatesQueryKey(applicationId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>\n > = ({ signal }) =>\n getApplicationExchangeRates(applicationId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!applicationId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * For every Job that has an exchange rate the current rate is returned. If you want a list of all Jobs that have no exchange rate, set the `only_undefined` query option.\n\n * @summary Gets Exchange Rates for all Jobs\n */\nexport const getAllJobExchangeRates = (\n params?: GetAllJobExchangeRatesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<GetAllExchangeRatesResponse>(\n { url: `/job/exchange-rate`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetAllJobExchangeRatesQueryKey = (\n params?: GetAllJobExchangeRatesParams\n) => [`/job/exchange-rate`, ...(params ? [params] : [])];\n\nexport type GetAllJobExchangeRatesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>\n>;\nexport type GetAllJobExchangeRatesQueryError = ErrorType<void | DmError>;\n\nexport const useGetAllJobExchangeRates = <\n TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetAllJobExchangeRatesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>,\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 ?? getGetAllJobExchangeRatesQueryKey(params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>\n > = ({ signal }) => getAllJobExchangeRates(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>,\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 * Sets the Exchange Rate for a specific job. The rate replaces any existing rate for the Job and applies immediately and future job executions for this jon will inherit this rate.\n\nIf a Job has no specific rate it adopts the current value of the default Job Exchange Rate.\n\nYou need admin privilege to use this method.\n\n * @summary Sets the Exchange Rate for a specific Job\n */\nexport const setJobPricing = (\n jobId: number,\n exchangeRatePutBodyBody: ExchangeRatePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"rate\", exchangeRatePutBodyBody.rate);\n if (exchangeRatePutBodyBody.comment !== undefined) {\n formData.append(\"comment\", exchangeRatePutBodyBody.comment);\n }\n\n return customInstance<void>(\n {\n url: `/job/${jobId}/exchange-rate`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type SetJobPricingMutationResult = NonNullable<\n Awaited<ReturnType<typeof setJobPricing>>\n>;\nexport type SetJobPricingMutationBody = ExchangeRatePutBodyBody;\nexport type SetJobPricingMutationError = ErrorType<DmError>;\n\nexport const useSetJobPricing = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof setJobPricing>>,\n TError,\n { jobId: number; data: ExchangeRatePutBodyBody },\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 setJobPricing>>,\n { jobId: number; data: ExchangeRatePutBodyBody }\n > = (props) => {\n const { jobId, data } = props ?? {};\n\n return setJobPricing(jobId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof setJobPricing>>,\n TError,\n { jobId: number; data: ExchangeRatePutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets all the exchange rate history for a specific Job. Rates are returned in reverse chronological order, with the most recent rate, the current rate, as the first entry in the list.\n\n * @summary Gets Job Exchange Rates\n */\nexport const getJobExchangeRates = (\n jobId: number,\n params?: GetJobExchangeRatesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<GetExchangeRatesResponse>(\n { url: `/job/${jobId}/exchange-rate`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetJobExchangeRatesQueryKey = (\n jobId: number,\n params?: GetJobExchangeRatesParams\n) => [`/job/${jobId}/exchange-rate`, ...(params ? [params] : [])];\n\nexport type GetJobExchangeRatesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getJobExchangeRates>>\n>;\nexport type GetJobExchangeRatesQueryError = ErrorType<void | DmError>;\n\nexport const useGetJobExchangeRates = <\n TData = Awaited<ReturnType<typeof getJobExchangeRates>>,\n TError = ErrorType<void | DmError>\n>(\n jobId: number,\n params?: GetJobExchangeRatesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getJobExchangeRates>>,\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 ?? getGetJobExchangeRatesQueryKey(jobId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getJobExchangeRates>>\n > = ({ signal }) =>\n getJobExchangeRates(jobId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getJobExchangeRates>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!jobId, ...queryOptions }) as UseQueryResult<\n TData,\n TError\n > & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/exchange-rate/exchange-rate.ts"],"names":[],"mappings":";;;;;;;;AAUA,SAAS,UAAU,mBAAmB;AAsC/B,IAAM,iCAAiC,CAC5C,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,8BAA8B,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACnE;AAAA,EACF;AACF;AAEO,IAAM,4CAA4C,CACvD,WACG,CAAC,8BAA8B,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAQxD,IAAM,oCAAoC,CAI/C,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,0CAA0C,MAAM;AAE5E,QAAM,UAEF,CAAC,EAAE,OAAO,MACZ,+BAA+B,QAAQ,gBAAgB,MAAM;AAE/D,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ,SAIZ,aAAa;AAEf,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;AAWO,IAAM,6BAA6B,CACxC,eACA,yBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,QAAQ,wBAAwB,IAAI;AACpD,MAAI,wBAAwB,YAAY,QAAW;AACjD,aAAS,OAAO,WAAW,wBAAwB,OAAO;AAAA,EAC5D;AAEA,SAAO;AAAA,IAC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,QAAQ,uBAAuB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAOzD,IAAM,yBAAyB,CAIpC,OACA,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,+BAA+B,OAAO,MAAM;AAExE,QAAM,UAEF,CAAC,EAAE,OAAO,MACZ,oBAAoB,OAAO,QAAQ,gBAAgB,MAAM;AAE3D,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ,SAIZ,aAAa;AAEf,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.12.1 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n GetAllExchangeRatesResponse,\n DmError,\n GetAllApplicationExchangeRatesParams,\n ExchangeRatePutBodyBody,\n GetExchangeRatesResponse,\n GetApplicationExchangeRatesParams,\n GetAllJobExchangeRatesParams,\n GetJobExchangeRatesParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././queryMutator\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * For every Application that has an exchange rate the current rate is returned. If you want a list of all Applications that have no exchange rate, set the `only_undefined` query option.\n\nIf an Application has no specific rate it adopts the current value of the default Application Exchange Rate.\n\n * @summary Gets Exchange Rates for all Applications\n */\nexport const getAllApplicationExchangeRates = (\n params?: GetAllApplicationExchangeRatesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<GetAllExchangeRatesResponse>(\n { url: `/application/exchange-rate`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetAllApplicationExchangeRatesQueryKey = (\n params?: GetAllApplicationExchangeRatesParams\n) => [`/application/exchange-rate`, ...(params ? [params] : [])];\n\nexport type GetAllApplicationExchangeRatesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>\n>;\nexport type GetAllApplicationExchangeRatesQueryError =\n ErrorType<void | DmError>;\n\nexport const useGetAllApplicationExchangeRates = <\n TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetAllApplicationExchangeRatesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,\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 ?? getGetAllApplicationExchangeRatesQueryKey(params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>\n > = ({ signal }) =>\n getAllApplicationExchangeRates(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Sets the Exchange Rate for a specific Application. The rate replaces any exising rate for the application and applies to all future executions of the Application.\n\nIf an Application has no specific rate it adopts the current value of the default Application Exchange Rate.\n\nYou need admin privilege to use this method.\n\n * @summary Sets the Exchange Rate for a specific Application\n */\nexport const setApplicationExchangeRate = (\n applicationId: string,\n exchangeRatePutBodyBody: ExchangeRatePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"rate\", exchangeRatePutBodyBody.rate);\n if (exchangeRatePutBodyBody.comment !== undefined) {\n formData.append(\"comment\", exchangeRatePutBodyBody.comment);\n }\n\n return customInstance<void>(\n {\n url: `/application/${applicationId}/exchange-rate`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type SetApplicationExchangeRateMutationResult = NonNullable<\n Awaited<ReturnType<typeof setApplicationExchangeRate>>\n>;\nexport type SetApplicationExchangeRateMutationBody = ExchangeRatePutBodyBody;\nexport type SetApplicationExchangeRateMutationError = ErrorType<DmError>;\n\nexport const useSetApplicationExchangeRate = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof setApplicationExchangeRate>>,\n TError,\n { applicationId: string; data: ExchangeRatePutBodyBody },\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 setApplicationExchangeRate>>,\n { applicationId: string; data: ExchangeRatePutBodyBody }\n > = (props) => {\n const { applicationId, data } = props ?? {};\n\n return setApplicationExchangeRate(applicationId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof setApplicationExchangeRate>>,\n TError,\n { applicationId: string; data: ExchangeRatePutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the exchange rate history for a specific Application. Rates are returned in reverse chronological order, with the most recent rate, the current rate, as the first entry in the list.\n\n * @summary Gets the Application's Exchange Rate history\n */\nexport const getApplicationExchangeRates = (\n applicationId: string,\n params?: GetApplicationExchangeRatesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<GetExchangeRatesResponse>(\n {\n url: `/application/${applicationId}/exchange-rate`,\n method: \"get\",\n params,\n signal,\n },\n options\n );\n};\n\nexport const getGetApplicationExchangeRatesQueryKey = (\n applicationId: string,\n params?: GetApplicationExchangeRatesParams\n) => [\n `/application/${applicationId}/exchange-rate`,\n ...(params ? [params] : []),\n];\n\nexport type GetApplicationExchangeRatesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>\n>;\nexport type GetApplicationExchangeRatesQueryError = ErrorType<void | DmError>;\n\nexport const useGetApplicationExchangeRates = <\n TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>,\n TError = ErrorType<void | DmError>\n>(\n applicationId: string,\n params?: GetApplicationExchangeRatesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>,\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 getGetApplicationExchangeRatesQueryKey(applicationId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>\n > = ({ signal }) =>\n getApplicationExchangeRates(applicationId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * For every Job that has an exchange rate the current rate is returned. If you want a list of all Jobs that have no exchange rate, set the `only_undefined` query option.\n\n * @summary Gets Exchange Rates for all Jobs\n */\nexport const getAllJobExchangeRates = (\n params?: GetAllJobExchangeRatesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<GetAllExchangeRatesResponse>(\n { url: `/job/exchange-rate`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetAllJobExchangeRatesQueryKey = (\n params?: GetAllJobExchangeRatesParams\n) => [`/job/exchange-rate`, ...(params ? [params] : [])];\n\nexport type GetAllJobExchangeRatesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>\n>;\nexport type GetAllJobExchangeRatesQueryError = ErrorType<void | DmError>;\n\nexport const useGetAllJobExchangeRates = <\n TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetAllJobExchangeRatesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>,\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 ?? getGetAllJobExchangeRatesQueryKey(params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>\n > = ({ signal }) => getAllJobExchangeRates(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Sets the Exchange Rate for a specific job. The rate replaces any existing rate for the Job and applies immediately and future job executions for this jon will inherit this rate.\n\nIf a Job has no specific rate it adopts the current value of the default Job Exchange Rate.\n\nYou need admin privilege to use this method.\n\n * @summary Sets the Exchange Rate for a specific Job\n */\nexport const setJobPricing = (\n jobId: number,\n exchangeRatePutBodyBody: ExchangeRatePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"rate\", exchangeRatePutBodyBody.rate);\n if (exchangeRatePutBodyBody.comment !== undefined) {\n formData.append(\"comment\", exchangeRatePutBodyBody.comment);\n }\n\n return customInstance<void>(\n {\n url: `/job/${jobId}/exchange-rate`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type SetJobPricingMutationResult = NonNullable<\n Awaited<ReturnType<typeof setJobPricing>>\n>;\nexport type SetJobPricingMutationBody = ExchangeRatePutBodyBody;\nexport type SetJobPricingMutationError = ErrorType<DmError>;\n\nexport const useSetJobPricing = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof setJobPricing>>,\n TError,\n { jobId: number; data: ExchangeRatePutBodyBody },\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 setJobPricing>>,\n { jobId: number; data: ExchangeRatePutBodyBody }\n > = (props) => {\n const { jobId, data } = props ?? {};\n\n return setJobPricing(jobId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof setJobPricing>>,\n TError,\n { jobId: number; data: ExchangeRatePutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets all the exchange rate history for a specific Job. Rates are returned in reverse chronological order, with the most recent rate, the current rate, as the first entry in the list.\n\n * @summary Gets Job Exchange Rates\n */\nexport const getJobExchangeRates = (\n jobId: number,\n params?: GetJobExchangeRatesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<GetExchangeRatesResponse>(\n { url: `/job/${jobId}/exchange-rate`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetJobExchangeRatesQueryKey = (\n jobId: number,\n params?: GetJobExchangeRatesParams\n) => [`/job/${jobId}/exchange-rate`, ...(params ? [params] : [])];\n\nexport type GetJobExchangeRatesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getJobExchangeRates>>\n>;\nexport type GetJobExchangeRatesQueryError = ErrorType<void | DmError>;\n\nexport const useGetJobExchangeRates = <\n TData = Awaited<ReturnType<typeof getJobExchangeRates>>,\n TError = ErrorType<void | DmError>\n>(\n jobId: number,\n params?: GetJobExchangeRatesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getJobExchangeRates>>,\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 ?? getGetJobExchangeRatesQueryKey(jobId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getJobExchangeRates>>\n > = ({ signal }) =>\n getJobExchangeRates(jobId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getJobExchangeRates>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
3
|
-
import { i as GetAllApplicationExchangeRatesParams,
|
|
3
|
+
import { i as GetAllApplicationExchangeRatesParams, bK as customInstance, bl as GetAllExchangeRatesResponse, bL as ErrorType, bG as DmError, a1 as ExchangeRatePutBodyBody, h as GetApplicationExchangeRatesParams, bj as GetExchangeRatesResponse, d as GetAllJobExchangeRatesParams, c as GetJobExchangeRatesParams } from '../custom-instance-b5dd9223.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
|
7
7
|
/**
|
|
8
8
|
* For every Application that has an exchange rate the current rate is returned. If you want a list of all Applications that have no exchange rate, set the `only_undefined` query option.
|
|
9
9
|
|
|
@@ -13,8 +13,8 @@ If an Application has no specific rate it adopts the current value of the defaul
|
|
|
13
13
|
*/
|
|
14
14
|
declare const getAllApplicationExchangeRates: (params?: GetAllApplicationExchangeRatesParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<GetAllExchangeRatesResponse>;
|
|
15
15
|
declare const getGetAllApplicationExchangeRatesQueryKey: (params?: GetAllApplicationExchangeRatesParams) => (string | GetAllApplicationExchangeRatesParams)[];
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
type GetAllApplicationExchangeRatesQueryResult = NonNullable<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>>;
|
|
17
|
+
type GetAllApplicationExchangeRatesQueryError = ErrorType<void | DmError>;
|
|
18
18
|
declare const useGetAllApplicationExchangeRates: <TData = GetAllExchangeRatesResponse, TError = ErrorType<void | DmError>>(params?: GetAllApplicationExchangeRatesParams, options?: {
|
|
19
19
|
query?: UseQueryOptions<GetAllExchangeRatesResponse, TError, TData, QueryKey> | undefined;
|
|
20
20
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -31,9 +31,9 @@ You need admin privilege to use this method.
|
|
|
31
31
|
* @summary Sets the Exchange Rate for a specific Application
|
|
32
32
|
*/
|
|
33
33
|
declare const setApplicationExchangeRate: (applicationId: string, exchangeRatePutBodyBody: ExchangeRatePutBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
type SetApplicationExchangeRateMutationResult = NonNullable<Awaited<ReturnType<typeof setApplicationExchangeRate>>>;
|
|
35
|
+
type SetApplicationExchangeRateMutationBody = ExchangeRatePutBodyBody;
|
|
36
|
+
type SetApplicationExchangeRateMutationError = ErrorType<DmError>;
|
|
37
37
|
declare const useSetApplicationExchangeRate: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
38
38
|
mutation?: UseMutationOptions<void, TError, {
|
|
39
39
|
applicationId: string;
|
|
@@ -51,8 +51,8 @@ declare const useSetApplicationExchangeRate: <TError = ErrorType<DmError>, TCont
|
|
|
51
51
|
*/
|
|
52
52
|
declare const getApplicationExchangeRates: (applicationId: string, params?: GetApplicationExchangeRatesParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<GetExchangeRatesResponse>;
|
|
53
53
|
declare const getGetApplicationExchangeRatesQueryKey: (applicationId: string, params?: GetApplicationExchangeRatesParams) => (string | GetApplicationExchangeRatesParams)[];
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
type GetApplicationExchangeRatesQueryResult = NonNullable<Awaited<ReturnType<typeof getApplicationExchangeRates>>>;
|
|
55
|
+
type GetApplicationExchangeRatesQueryError = ErrorType<void | DmError>;
|
|
56
56
|
declare const useGetApplicationExchangeRates: <TData = GetExchangeRatesResponse, TError = ErrorType<void | DmError>>(applicationId: string, params?: GetApplicationExchangeRatesParams, options?: {
|
|
57
57
|
query?: UseQueryOptions<GetExchangeRatesResponse, TError, TData, QueryKey> | undefined;
|
|
58
58
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -66,8 +66,8 @@ declare const useGetApplicationExchangeRates: <TData = GetExchangeRatesResponse,
|
|
|
66
66
|
*/
|
|
67
67
|
declare const getAllJobExchangeRates: (params?: GetAllJobExchangeRatesParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<GetAllExchangeRatesResponse>;
|
|
68
68
|
declare const getGetAllJobExchangeRatesQueryKey: (params?: GetAllJobExchangeRatesParams) => (string | GetAllJobExchangeRatesParams)[];
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
type GetAllJobExchangeRatesQueryResult = NonNullable<Awaited<ReturnType<typeof getAllJobExchangeRates>>>;
|
|
70
|
+
type GetAllJobExchangeRatesQueryError = ErrorType<void | DmError>;
|
|
71
71
|
declare const useGetAllJobExchangeRates: <TData = GetAllExchangeRatesResponse, TError = ErrorType<void | DmError>>(params?: GetAllJobExchangeRatesParams, options?: {
|
|
72
72
|
query?: UseQueryOptions<GetAllExchangeRatesResponse, TError, TData, QueryKey> | undefined;
|
|
73
73
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -84,9 +84,9 @@ You need admin privilege to use this method.
|
|
|
84
84
|
* @summary Sets the Exchange Rate for a specific Job
|
|
85
85
|
*/
|
|
86
86
|
declare const setJobPricing: (jobId: number, exchangeRatePutBodyBody: ExchangeRatePutBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
type SetJobPricingMutationResult = NonNullable<Awaited<ReturnType<typeof setJobPricing>>>;
|
|
88
|
+
type SetJobPricingMutationBody = ExchangeRatePutBodyBody;
|
|
89
|
+
type SetJobPricingMutationError = ErrorType<DmError>;
|
|
90
90
|
declare const useSetJobPricing: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
91
91
|
mutation?: UseMutationOptions<void, TError, {
|
|
92
92
|
jobId: number;
|
|
@@ -104,8 +104,8 @@ declare const useSetJobPricing: <TError = ErrorType<DmError>, TContext = unknown
|
|
|
104
104
|
*/
|
|
105
105
|
declare const getJobExchangeRates: (jobId: number, params?: GetJobExchangeRatesParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<GetExchangeRatesResponse>;
|
|
106
106
|
declare const getGetJobExchangeRatesQueryKey: (jobId: number, params?: GetJobExchangeRatesParams) => (string | GetJobExchangeRatesParams)[];
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
type GetJobExchangeRatesQueryResult = NonNullable<Awaited<ReturnType<typeof getJobExchangeRates>>>;
|
|
108
|
+
type GetJobExchangeRatesQueryError = ErrorType<void | DmError>;
|
|
109
109
|
declare const useGetJobExchangeRates: <TData = GetExchangeRatesResponse, TError = ErrorType<void | DmError>>(jobId: number, params?: GetJobExchangeRatesParams, options?: {
|
|
110
110
|
query?: UseQueryOptions<GetExchangeRatesResponse, TError, TData, QueryKey> | undefined;
|
|
111
111
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
queryMutator
|
|
3
|
+
} from "../chunk-LT4O36DN.js";
|
|
1
4
|
import {
|
|
2
5
|
customInstance
|
|
3
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-3RNIDX7T.js";
|
|
4
7
|
|
|
5
8
|
// src/exchange-rate/exchange-rate.ts
|
|
6
9
|
import { useQuery, useMutation } from "@tanstack/react-query";
|
|
@@ -15,8 +18,9 @@ var useGetAllApplicationExchangeRates = (params, options) => {
|
|
|
15
18
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
16
19
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetAllApplicationExchangeRatesQueryKey(params);
|
|
17
20
|
const queryFn = ({ signal }) => getAllApplicationExchangeRates(params, requestOptions, signal);
|
|
18
|
-
const
|
|
19
|
-
query
|
|
21
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
22
|
+
const query = useQuery(customOptions);
|
|
23
|
+
query.queryKey = customOptions.queryKey;
|
|
20
24
|
return query;
|
|
21
25
|
};
|
|
22
26
|
var setApplicationExchangeRate = (applicationId, exchangeRatePutBodyBody, options) => {
|
|
@@ -62,11 +66,9 @@ var useGetApplicationExchangeRates = (applicationId, params, options) => {
|
|
|
62
66
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
63
67
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetApplicationExchangeRatesQueryKey(applicationId, params);
|
|
64
68
|
const queryFn = ({ signal }) => getApplicationExchangeRates(applicationId, params, requestOptions, signal);
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
});
|
|
69
|
-
query.queryKey = queryKey;
|
|
69
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
70
|
+
const query = useQuery(customOptions);
|
|
71
|
+
query.queryKey = customOptions.queryKey;
|
|
70
72
|
return query;
|
|
71
73
|
};
|
|
72
74
|
var getAllJobExchangeRates = (params, options, signal) => {
|
|
@@ -80,8 +82,9 @@ var useGetAllJobExchangeRates = (params, options) => {
|
|
|
80
82
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
81
83
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetAllJobExchangeRatesQueryKey(params);
|
|
82
84
|
const queryFn = ({ signal }) => getAllJobExchangeRates(params, requestOptions, signal);
|
|
83
|
-
const
|
|
84
|
-
query
|
|
85
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
86
|
+
const query = useQuery(customOptions);
|
|
87
|
+
query.queryKey = customOptions.queryKey;
|
|
85
88
|
return query;
|
|
86
89
|
};
|
|
87
90
|
var setJobPricing = (jobId, exchangeRatePutBodyBody, options) => {
|
|
@@ -119,8 +122,9 @@ var useGetJobExchangeRates = (jobId, params, options) => {
|
|
|
119
122
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
120
123
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetJobExchangeRatesQueryKey(jobId, params);
|
|
121
124
|
const queryFn = ({ signal }) => getJobExchangeRates(jobId, params, requestOptions, signal);
|
|
122
|
-
const
|
|
123
|
-
query
|
|
125
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
126
|
+
const query = useQuery(customOptions);
|
|
127
|
+
query.queryKey = customOptions.queryKey;
|
|
124
128
|
return query;
|
|
125
129
|
};
|
|
126
130
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exchange-rate/exchange-rate.ts"],"sourcesContent":["/**\n * Generated by orval v6.10.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n GetAllExchangeRatesResponse,\n DmError,\n GetAllApplicationExchangeRatesParams,\n ExchangeRatePutBodyBody,\n GetExchangeRatesResponse,\n GetApplicationExchangeRatesParams,\n GetAllJobExchangeRatesParams,\n GetJobExchangeRatesParams,\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 * For every Application that has an exchange rate the current rate is returned. If you want a list of all Applications that have no exchange rate, set the `only_undefined` query option.\n\nIf an Application has no specific rate it adopts the current value of the default Application Exchange Rate.\n\n * @summary Gets Exchange Rates for all Applications\n */\nexport const getAllApplicationExchangeRates = (\n params?: GetAllApplicationExchangeRatesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<GetAllExchangeRatesResponse>(\n { url: `/application/exchange-rate`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetAllApplicationExchangeRatesQueryKey = (\n params?: GetAllApplicationExchangeRatesParams\n) => [`/application/exchange-rate`, ...(params ? [params] : [])];\n\nexport type GetAllApplicationExchangeRatesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>\n>;\nexport type GetAllApplicationExchangeRatesQueryError =\n ErrorType<void | DmError>;\n\nexport const useGetAllApplicationExchangeRates = <\n TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetAllApplicationExchangeRatesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,\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 ?? getGetAllApplicationExchangeRatesQueryKey(params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>\n > = ({ signal }) =>\n getAllApplicationExchangeRates(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,\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 * Sets the Exchange Rate for a specific Application. The rate replaces any exising rate for the application and applies to all future executions of the Application.\n\nIf an Application has no specific rate it adopts the current value of the default Application Exchange Rate.\n\nYou need admin privilege to use this method.\n\n * @summary Sets the Exchange Rate for a specific Application\n */\nexport const setApplicationExchangeRate = (\n applicationId: string,\n exchangeRatePutBodyBody: ExchangeRatePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"rate\", exchangeRatePutBodyBody.rate);\n if (exchangeRatePutBodyBody.comment !== undefined) {\n formData.append(\"comment\", exchangeRatePutBodyBody.comment);\n }\n\n return customInstance<void>(\n {\n url: `/application/${applicationId}/exchange-rate`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type SetApplicationExchangeRateMutationResult = NonNullable<\n Awaited<ReturnType<typeof setApplicationExchangeRate>>\n>;\nexport type SetApplicationExchangeRateMutationBody = ExchangeRatePutBodyBody;\nexport type SetApplicationExchangeRateMutationError = ErrorType<DmError>;\n\nexport const useSetApplicationExchangeRate = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof setApplicationExchangeRate>>,\n TError,\n { applicationId: string; data: ExchangeRatePutBodyBody },\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 setApplicationExchangeRate>>,\n { applicationId: string; data: ExchangeRatePutBodyBody }\n > = (props) => {\n const { applicationId, data } = props ?? {};\n\n return setApplicationExchangeRate(applicationId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof setApplicationExchangeRate>>,\n TError,\n { applicationId: string; data: ExchangeRatePutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the exchange rate history for a specific Application. Rates are returned in reverse chronological order, with the most recent rate, the current rate, as the first entry in the list.\n\n * @summary Gets the Application's Exchange Rate history\n */\nexport const getApplicationExchangeRates = (\n applicationId: string,\n params?: GetApplicationExchangeRatesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<GetExchangeRatesResponse>(\n {\n url: `/application/${applicationId}/exchange-rate`,\n method: \"get\",\n params,\n signal,\n },\n options\n );\n};\n\nexport const getGetApplicationExchangeRatesQueryKey = (\n applicationId: string,\n params?: GetApplicationExchangeRatesParams\n) => [\n `/application/${applicationId}/exchange-rate`,\n ...(params ? [params] : []),\n];\n\nexport type GetApplicationExchangeRatesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>\n>;\nexport type GetApplicationExchangeRatesQueryError = ErrorType<void | DmError>;\n\nexport const useGetApplicationExchangeRates = <\n TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>,\n TError = ErrorType<void | DmError>\n>(\n applicationId: string,\n params?: GetApplicationExchangeRatesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>,\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 getGetApplicationExchangeRatesQueryKey(applicationId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>\n > = ({ signal }) =>\n getApplicationExchangeRates(applicationId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!applicationId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * For every Job that has an exchange rate the current rate is returned. If you want a list of all Jobs that have no exchange rate, set the `only_undefined` query option.\n\n * @summary Gets Exchange Rates for all Jobs\n */\nexport const getAllJobExchangeRates = (\n params?: GetAllJobExchangeRatesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<GetAllExchangeRatesResponse>(\n { url: `/job/exchange-rate`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetAllJobExchangeRatesQueryKey = (\n params?: GetAllJobExchangeRatesParams\n) => [`/job/exchange-rate`, ...(params ? [params] : [])];\n\nexport type GetAllJobExchangeRatesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>\n>;\nexport type GetAllJobExchangeRatesQueryError = ErrorType<void | DmError>;\n\nexport const useGetAllJobExchangeRates = <\n TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetAllJobExchangeRatesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>,\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 ?? getGetAllJobExchangeRatesQueryKey(params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>\n > = ({ signal }) => getAllJobExchangeRates(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>,\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 * Sets the Exchange Rate for a specific job. The rate replaces any existing rate for the Job and applies immediately and future job executions for this jon will inherit this rate.\n\nIf a Job has no specific rate it adopts the current value of the default Job Exchange Rate.\n\nYou need admin privilege to use this method.\n\n * @summary Sets the Exchange Rate for a specific Job\n */\nexport const setJobPricing = (\n jobId: number,\n exchangeRatePutBodyBody: ExchangeRatePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"rate\", exchangeRatePutBodyBody.rate);\n if (exchangeRatePutBodyBody.comment !== undefined) {\n formData.append(\"comment\", exchangeRatePutBodyBody.comment);\n }\n\n return customInstance<void>(\n {\n url: `/job/${jobId}/exchange-rate`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type SetJobPricingMutationResult = NonNullable<\n Awaited<ReturnType<typeof setJobPricing>>\n>;\nexport type SetJobPricingMutationBody = ExchangeRatePutBodyBody;\nexport type SetJobPricingMutationError = ErrorType<DmError>;\n\nexport const useSetJobPricing = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof setJobPricing>>,\n TError,\n { jobId: number; data: ExchangeRatePutBodyBody },\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 setJobPricing>>,\n { jobId: number; data: ExchangeRatePutBodyBody }\n > = (props) => {\n const { jobId, data } = props ?? {};\n\n return setJobPricing(jobId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof setJobPricing>>,\n TError,\n { jobId: number; data: ExchangeRatePutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets all the exchange rate history for a specific Job. Rates are returned in reverse chronological order, with the most recent rate, the current rate, as the first entry in the list.\n\n * @summary Gets Job Exchange Rates\n */\nexport const getJobExchangeRates = (\n jobId: number,\n params?: GetJobExchangeRatesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<GetExchangeRatesResponse>(\n { url: `/job/${jobId}/exchange-rate`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetJobExchangeRatesQueryKey = (\n jobId: number,\n params?: GetJobExchangeRatesParams\n) => [`/job/${jobId}/exchange-rate`, ...(params ? [params] : [])];\n\nexport type GetJobExchangeRatesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getJobExchangeRates>>\n>;\nexport type GetJobExchangeRatesQueryError = ErrorType<void | DmError>;\n\nexport const useGetJobExchangeRates = <\n TData = Awaited<ReturnType<typeof getJobExchangeRates>>,\n TError = ErrorType<void | DmError>\n>(\n jobId: number,\n params?: GetJobExchangeRatesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getJobExchangeRates>>,\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 ?? getGetJobExchangeRatesQueryKey(jobId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getJobExchangeRates>>\n > = ({ signal }) =>\n getJobExchangeRates(jobId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getJobExchangeRates>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!jobId, ...queryOptions }) as UseQueryResult<\n TData,\n TError\n > & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAqC/B,IAAM,iCA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AY,QAAW;AACjD,aAAS,OAAO,WAAW,wBAAwB,OAAO;AAAA,EAC5D;AAEA,SAAO;AAAA,IACL;AAAA,MACE,KAAK,QAAQ;AAAA,MACb,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,OAAO,KAAK,IAAI,SAAS,CAAC;AAElC,WAAO,cAAc,OAAO,MAAM,cAAc;AAAA,EAClD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,sBAAsB,CACjC,OACA,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,QAAQ,uBAAuB,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACpE;AAAA,EACF;AACF;AAEO,IAAM,iCAAiC,CAC5C,OACA,WACG,CAAC,QAAQ,uBAAuB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAOzD,IAAM,yBAAyB,CAIpC,OACA,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,+BAA+B,OAAO,MAAM;AAExE,QAAM,UAEF,CAAC,EAAE,OAAO,MACZ,oBAAoB,OAAO,QAAQ,gBAAgB,MAAM;AAE3D,QAAM,QAAQ,SAIZ,UAAU,SAAS,EAAE,SAAS,CAAC,CAAC,OAAO,GAAG,aAAa,CAAC;AAK1D,QAAM,WAAW;AAEjB,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/exchange-rate/exchange-rate.ts"],"sourcesContent":["/**\n * Generated by orval v6.12.1 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n GetAllExchangeRatesResponse,\n DmError,\n GetAllApplicationExchangeRatesParams,\n ExchangeRatePutBodyBody,\n GetExchangeRatesResponse,\n GetApplicationExchangeRatesParams,\n GetAllJobExchangeRatesParams,\n GetJobExchangeRatesParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././queryMutator\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * For every Application that has an exchange rate the current rate is returned. If you want a list of all Applications that have no exchange rate, set the `only_undefined` query option.\n\nIf an Application has no specific rate it adopts the current value of the default Application Exchange Rate.\n\n * @summary Gets Exchange Rates for all Applications\n */\nexport const getAllApplicationExchangeRates = (\n params?: GetAllApplicationExchangeRatesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<GetAllExchangeRatesResponse>(\n { url: `/application/exchange-rate`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetAllApplicationExchangeRatesQueryKey = (\n params?: GetAllApplicationExchangeRatesParams\n) => [`/application/exchange-rate`, ...(params ? [params] : [])];\n\nexport type GetAllApplicationExchangeRatesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>\n>;\nexport type GetAllApplicationExchangeRatesQueryError =\n ErrorType<void | DmError>;\n\nexport const useGetAllApplicationExchangeRates = <\n TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetAllApplicationExchangeRatesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,\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 ?? getGetAllApplicationExchangeRatesQueryKey(params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>\n > = ({ signal }) =>\n getAllApplicationExchangeRates(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Sets the Exchange Rate for a specific Application. The rate replaces any exising rate for the application and applies to all future executions of the Application.\n\nIf an Application has no specific rate it adopts the current value of the default Application Exchange Rate.\n\nYou need admin privilege to use this method.\n\n * @summary Sets the Exchange Rate for a specific Application\n */\nexport const setApplicationExchangeRate = (\n applicationId: string,\n exchangeRatePutBodyBody: ExchangeRatePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"rate\", exchangeRatePutBodyBody.rate);\n if (exchangeRatePutBodyBody.comment !== undefined) {\n formData.append(\"comment\", exchangeRatePutBodyBody.comment);\n }\n\n return customInstance<void>(\n {\n url: `/application/${applicationId}/exchange-rate`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type SetApplicationExchangeRateMutationResult = NonNullable<\n Awaited<ReturnType<typeof setApplicationExchangeRate>>\n>;\nexport type SetApplicationExchangeRateMutationBody = ExchangeRatePutBodyBody;\nexport type SetApplicationExchangeRateMutationError = ErrorType<DmError>;\n\nexport const useSetApplicationExchangeRate = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof setApplicationExchangeRate>>,\n TError,\n { applicationId: string; data: ExchangeRatePutBodyBody },\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 setApplicationExchangeRate>>,\n { applicationId: string; data: ExchangeRatePutBodyBody }\n > = (props) => {\n const { applicationId, data } = props ?? {};\n\n return setApplicationExchangeRate(applicationId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof setApplicationExchangeRate>>,\n TError,\n { applicationId: string; data: ExchangeRatePutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the exchange rate history for a specific Application. Rates are returned in reverse chronological order, with the most recent rate, the current rate, as the first entry in the list.\n\n * @summary Gets the Application's Exchange Rate history\n */\nexport const getApplicationExchangeRates = (\n applicationId: string,\n params?: GetApplicationExchangeRatesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<GetExchangeRatesResponse>(\n {\n url: `/application/${applicationId}/exchange-rate`,\n method: \"get\",\n params,\n signal,\n },\n options\n );\n};\n\nexport const getGetApplicationExchangeRatesQueryKey = (\n applicationId: string,\n params?: GetApplicationExchangeRatesParams\n) => [\n `/application/${applicationId}/exchange-rate`,\n ...(params ? [params] : []),\n];\n\nexport type GetApplicationExchangeRatesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>\n>;\nexport type GetApplicationExchangeRatesQueryError = ErrorType<void | DmError>;\n\nexport const useGetApplicationExchangeRates = <\n TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>,\n TError = ErrorType<void | DmError>\n>(\n applicationId: string,\n params?: GetApplicationExchangeRatesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>,\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 getGetApplicationExchangeRatesQueryKey(applicationId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>\n > = ({ signal }) =>\n getApplicationExchangeRates(applicationId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * For every Job that has an exchange rate the current rate is returned. If you want a list of all Jobs that have no exchange rate, set the `only_undefined` query option.\n\n * @summary Gets Exchange Rates for all Jobs\n */\nexport const getAllJobExchangeRates = (\n params?: GetAllJobExchangeRatesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<GetAllExchangeRatesResponse>(\n { url: `/job/exchange-rate`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetAllJobExchangeRatesQueryKey = (\n params?: GetAllJobExchangeRatesParams\n) => [`/job/exchange-rate`, ...(params ? [params] : [])];\n\nexport type GetAllJobExchangeRatesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>\n>;\nexport type GetAllJobExchangeRatesQueryError = ErrorType<void | DmError>;\n\nexport const useGetAllJobExchangeRates = <\n TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetAllJobExchangeRatesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>,\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 ?? getGetAllJobExchangeRatesQueryKey(params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>\n > = ({ signal }) => getAllJobExchangeRates(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Sets the Exchange Rate for a specific job. The rate replaces any existing rate for the Job and applies immediately and future job executions for this jon will inherit this rate.\n\nIf a Job has no specific rate it adopts the current value of the default Job Exchange Rate.\n\nYou need admin privilege to use this method.\n\n * @summary Sets the Exchange Rate for a specific Job\n */\nexport const setJobPricing = (\n jobId: number,\n exchangeRatePutBodyBody: ExchangeRatePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"rate\", exchangeRatePutBodyBody.rate);\n if (exchangeRatePutBodyBody.comment !== undefined) {\n formData.append(\"comment\", exchangeRatePutBodyBody.comment);\n }\n\n return customInstance<void>(\n {\n url: `/job/${jobId}/exchange-rate`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type SetJobPricingMutationResult = NonNullable<\n Awaited<ReturnType<typeof setJobPricing>>\n>;\nexport type SetJobPricingMutationBody = ExchangeRatePutBodyBody;\nexport type SetJobPricingMutationError = ErrorType<DmError>;\n\nexport const useSetJobPricing = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof setJobPricing>>,\n TError,\n { jobId: number; data: ExchangeRatePutBodyBody },\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 setJobPricing>>,\n { jobId: number; data: ExchangeRatePutBodyBody }\n > = (props) => {\n const { jobId, data } = props ?? {};\n\n return setJobPricing(jobId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof setJobPricing>>,\n TError,\n { jobId: number; data: ExchangeRatePutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets all the exchange rate history for a specific Job. Rates are returned in reverse chronological order, with the most recent rate, the current rate, as the first entry in the list.\n\n * @summary Gets Job Exchange Rates\n */\nexport const getJobExchangeRates = (\n jobId: number,\n params?: GetJobExchangeRatesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<GetExchangeRatesResponse>(\n { url: `/job/${jobId}/exchange-rate`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetJobExchangeRatesQueryKey = (\n jobId: number,\n params?: GetJobExchangeRatesParams\n) => [`/job/${jobId}/exchange-rate`, ...(params ? [params] : [])];\n\nexport type GetJobExchangeRatesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getJobExchangeRates>>\n>;\nexport type GetJobExchangeRatesQueryError = ErrorType<void | DmError>;\n\nexport const useGetJobExchangeRates = <\n TData = Awaited<ReturnType<typeof getJobExchangeRates>>,\n TError = ErrorType<void | DmError>\n>(\n jobId: number,\n params?: GetJobExchangeRatesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getJobExchangeRates>>,\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 ?? getGetJobExchangeRatesQueryKey(jobId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getJobExchangeRates>>\n > = ({ signal }) =>\n getJobExchangeRates(jobId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getJobExchangeRates>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;;;;AAUA,SAAS,UAAU,mBAAmB;AAsC/B,IAAM,iCAAiC,CAC5C,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,8BAA8B,QAAQ,OAAO,QAAQ,OAAO;AAAA,IACnE;AAAA,EACF;AACF;AAEO,IAAM,4CAA4C,CACvD,WACG,CAAC,8BAA8B,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAQxD,IAAM,oCAAoC,CAI/C,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,0CAA0C,MAAM;AAE5E,QAAM,UAEF,CAAC,EAAE,OAAO,MACZ,+BAA+B,QAAQ,gBAAgB,MAAM;AAE/D,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ,SAIZ,aAAa;AAEf,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;AAWO,IAAM,6BAA6B,CACxC,eACA,yBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,QAAQ,wBAAwB,IAAI;AACpD,MAAI,wBAAwB,YAAY,QAAW;AACjD,aAAS,OAAO,WAAW,wBAAwB,OAAO;AAAA,EAC5D;AAEA,SAAO;AAAA,IACL;AAAA,MACE,KAAK,gBAAgB;AAAA,MACrB,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,MACjD,MAAM;AAAA,IACR;AAAA,IACA;AAAA,EACF;AACF;AAQO,IAAM,gCAAgC,CAG3C,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAA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