@squonk/data-manager-client 1.1.11 → 1.2.0
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.map +1 -1
- package/accounting/accounting.d.ts +1 -1
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +26 -1
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +23 -2
- package/admin/admin.js +25 -0
- package/admin/admin.js.map +1 -1
- package/application/application.cjs.map +1 -1
- package/application/application.d.ts +1 -1
- package/application/application.js.map +1 -1
- package/{custom-instance-f006607a.d.ts → custom-instance-e5540c3b.d.ts} +43 -10
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +1 -1
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.ts +1 -1
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file/file.cjs.map +1 -1
- package/file/file.d.ts +1 -1
- package/file/file.js.map +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.ts +1 -1
- package/instance/instance.js.map +1 -1
- package/job/job.cjs.map +1 -1
- package/job/job.d.ts +1 -1
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.ts +1 -1
- package/metadata/metadata.js.map +1 -1
- package/package.json +1 -1
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +1 -1
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +1 -1
- package/src/admin/admin.ts +79 -1
- package/src/application/application.ts +1 -1
- package/src/data-manager-api.schemas.ts +47 -10
- package/src/dataset/dataset.ts +1 -1
- package/src/exchange-rate/exchange-rate.ts +1 -1
- package/src/file/file.ts +1 -1
- package/src/instance/instance.ts +1 -1
- package/src/job/job.ts +1 -1
- package/src/metadata/metadata.ts +1 -1
- package/src/project/project.ts +1 -1
- package/src/task/task.ts +1 -1
- package/src/type/type.ts +1 -1
- package/src/user/user.ts +1 -1
- package/task/task.cjs.map +1 -1
- package/task/task.d.ts +1 -1
- package/task/task.js.map +1 -1
- package/type/type.cjs.map +1 -1
- package/type/type.d.ts +1 -1
- package/type/type.js.map +1 -1
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +1 -1
- package/user/user.js.map +1 -1
|
@@ -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,oBAAoB,8BAA8B,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAE5E,IAAM,gDAAgD,CAI3D,QACA,YAY4B;AAC5B,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,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAQO,IAAM,oCAAoC,CAI/C,QACA,YAQ2D;AAC3D,QAAM,eAAe;AAAA,IACnB;AAAA,IACA;AAAA,EACF;AAEA,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,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,O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,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,KAAK,IAAI,SAAS,CAAC;AAElC,WAAO,cAAc,OAAO,MAAM,cAAc;AAAA,EAClD;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,mBAAmB,CAG9B,YAQI;AACJ,QAAM,kBAAkB,gCAAgC,OAAO;AAE/D,SAAO,YAAY,eAAe;AACpC;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,oBAAoB,QAAQ,uBAAuB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAE7E,IAAM,qCAAqC,CAIhD,OACA,QACA,YAY4B;AAC5B,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,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,OAAO,GAAG,aAAa;AAChE;AAOO,IAAM,yBAAyB,CAIpC,OACA,QACA,YAQ2D;AAC3D,QAAM,eAAe;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.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.1\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) => [\"data-manager-api\", `/application/exchange-rate`, ...(params ? [params] : [])] as const;\n\nexport const getGetAllApplicationExchangeRatesQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, ...queryOptions };\n};\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 queryOptions = getGetAllApplicationExchangeRatesQueryOptions(\n params,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Sets the Exchange Rate for a specific Application. The rate replaces any existing 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 const getSetApplicationExchangeRateMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof setApplicationExchangeRate>>,\n TError,\n { applicationId: string; data: ExchangeRatePutBodyBody },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getSetApplicationExchangeRateMutationOptions(options);\n\n return useMutation(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 [\n \"data-manager-api\",\n `/application/${applicationId}/exchange-rate`,\n ...(params ? [params] : []),\n ] as const;\n\nexport const getGetApplicationExchangeRatesQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, enabled: !!applicationId, ...queryOptions };\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 queryOptions = getGetApplicationExchangeRatesQueryOptions(\n applicationId,\n params,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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) => [\"data-manager-api\", `/job/exchange-rate`, ...(params ? [params] : [])] as const;\n\nexport const getGetAllJobExchangeRatesQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, ...queryOptions };\n};\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 queryOptions = getGetAllJobExchangeRatesQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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 Job 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 const getSetJobPricingMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof setJobPricing>>,\n TError,\n { jobId: number; data: ExchangeRatePutBodyBody },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getSetJobPricingMutationOptions(options);\n\n return useMutation(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) => [\"data-manager-api\", `/job/${jobId}/exchange-rate`, ...(params ? [params] : [])] as const;\n\nexport const getGetJobExchangeRatesQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getJobExchangeRates>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, enabled: !!jobId, ...queryOptions };\n};\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 queryOptions = getGetJobExchangeRatesQueryOptions(\n jobId,\n params,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"]}
|
|
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,oBAAoB,8BAA8B,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAE5E,IAAM,gDAAgD,CAI3D,QACA,YAY4B;AAC5B,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,SAAO,EAAE,UAA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A,QACA,YAQ2D;AAC3D,QAAM,eAAe;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.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.2\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) => [\"data-manager-api\", `/application/exchange-rate`, ...(params ? [params] : [])] as const;\n\nexport const getGetAllApplicationExchangeRatesQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, ...queryOptions };\n};\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 queryOptions = getGetAllApplicationExchangeRatesQueryOptions(\n params,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Sets the Exchange Rate for a specific Application. The rate replaces any existing 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 const getSetApplicationExchangeRateMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof setApplicationExchangeRate>>,\n TError,\n { applicationId: string; data: ExchangeRatePutBodyBody },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getSetApplicationExchangeRateMutationOptions(options);\n\n return useMutation(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 [\n \"data-manager-api\",\n `/application/${applicationId}/exchange-rate`,\n ...(params ? [params] : []),\n ] as const;\n\nexport const getGetApplicationExchangeRatesQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, enabled: !!applicationId, ...queryOptions };\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 queryOptions = getGetApplicationExchangeRatesQueryOptions(\n applicationId,\n params,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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) => [\"data-manager-api\", `/job/exchange-rate`, ...(params ? [params] : [])] as const;\n\nexport const getGetAllJobExchangeRatesQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, ...queryOptions };\n};\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 queryOptions = getGetAllJobExchangeRatesQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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 Job 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 const getSetJobPricingMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof setJobPricing>>,\n TError,\n { jobId: number; data: ExchangeRatePutBodyBody },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getSetJobPricingMutationOptions(options);\n\n return useMutation(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) => [\"data-manager-api\", `/job/${jobId}/exchange-rate`, ...(params ? [params] : [])] as const;\n\nexport const getGetJobExchangeRatesQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getJobExchangeRates>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, enabled: !!jobId, ...queryOptions };\n};\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 queryOptions = getGetJobExchangeRatesQueryOptions(\n jobId,\n params,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
3
|
-
import {
|
|
3
|
+
import { j as GetAllApplicationExchangeRatesParams, bV as customInstance, bv as GetAllExchangeRatesResponse, bW as ErrorType, bR as DmError, a8 as ExchangeRatePutBodyBody, i as GetApplicationExchangeRatesParams, bt as GetExchangeRatesResponse, e as GetAllJobExchangeRatesParams, d as GetJobExchangeRatesParams } from '../custom-instance-e5540c3b.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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exchange-rate/exchange-rate.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.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.1\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) => [\"data-manager-api\", `/application/exchange-rate`, ...(params ? [params] : [])] as const;\n\nexport const getGetAllApplicationExchangeRatesQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, ...queryOptions };\n};\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 queryOptions = getGetAllApplicationExchangeRatesQueryOptions(\n params,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Sets the Exchange Rate for a specific Application. The rate replaces any existing 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 const getSetApplicationExchangeRateMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof setApplicationExchangeRate>>,\n TError,\n { applicationId: string; data: ExchangeRatePutBodyBody },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getSetApplicationExchangeRateMutationOptions(options);\n\n return useMutation(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 [\n \"data-manager-api\",\n `/application/${applicationId}/exchange-rate`,\n ...(params ? [params] : []),\n ] as const;\n\nexport const getGetApplicationExchangeRatesQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, enabled: !!applicationId, ...queryOptions };\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 queryOptions = getGetApplicationExchangeRatesQueryOptions(\n applicationId,\n params,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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) => [\"data-manager-api\", `/job/exchange-rate`, ...(params ? [params] : [])] as const;\n\nexport const getGetAllJobExchangeRatesQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, ...queryOptions };\n};\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 queryOptions = getGetAllJobExchangeRatesQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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 Job 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 const getSetJobPricingMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof setJobPricing>>,\n TError,\n { jobId: number; data: ExchangeRatePutBodyBody },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getSetJobPricingMutationOptions(options);\n\n return useMutation(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) => [\"data-manager-api\", `/job/${jobId}/exchange-rate`, ...(params ? [params] : [])] as const;\n\nexport const getGetJobExchangeRatesQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getJobExchangeRates>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, enabled: !!jobId, ...queryOptions };\n};\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 queryOptions = getGetJobExchangeRatesQueryOptions(\n jobId,\n params,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS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OAAO,QAAQ,OAAO;AAAA,IACpE;AAAA,EACF;AACF;AAEO,IAAM,iCAAiC,CAC5C,OACA,WACG,CAAC,oBAAoB,QAAQ,uBAAuB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAE7E,IAAM,qCAAqC,CAIhD,OACA,QACA,YAY4B;AAC5B,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,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,OAAO,GAAG,aAAa;AAChE;AAOO,IAAM,yBAAyB,CAIpC,OACA,QACA,YAQ2D;AAC3D,QAAM,eAAe;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/exchange-rate/exchange-rate.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.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.2\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) => [\"data-manager-api\", `/application/exchange-rate`, ...(params ? [params] : [])] as const;\n\nexport const getGetAllApplicationExchangeRatesQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, ...queryOptions };\n};\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 queryOptions = getGetAllApplicationExchangeRatesQueryOptions(\n params,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Sets the Exchange Rate for a specific Application. The rate replaces any existing 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 const getSetApplicationExchangeRateMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof setApplicationExchangeRate>>,\n TError,\n { applicationId: string; data: ExchangeRatePutBodyBody },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getSetApplicationExchangeRateMutationOptions(options);\n\n return useMutation(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 [\n \"data-manager-api\",\n `/application/${applicationId}/exchange-rate`,\n ...(params ? [params] : []),\n ] as const;\n\nexport const getGetApplicationExchangeRatesQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getApplicationExchangeRates>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, enabled: !!applicationId, ...queryOptions };\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 queryOptions = getGetApplicationExchangeRatesQueryOptions(\n applicationId,\n params,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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) => [\"data-manager-api\", `/job/exchange-rate`, ...(params ? [params] : [])] as const;\n\nexport const getGetAllJobExchangeRatesQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getAllJobExchangeRates>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, ...queryOptions };\n};\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 queryOptions = getGetAllJobExchangeRatesQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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 Job 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 const getSetJobPricingMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof setJobPricing>>,\n TError,\n { jobId: number; data: ExchangeRatePutBodyBody },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getSetJobPricingMutationOptions(options);\n\n return useMutation(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) => [\"data-manager-api\", `/job/${jobId}/exchange-rate`, ...(params ? [params] : [])] as const;\n\nexport const getGetJobExchangeRatesQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getJobExchangeRates>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, enabled: !!jobId, ...queryOptions };\n};\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 queryOptions = getGetJobExchangeRatesQueryOptions(\n jobId,\n params,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"],"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,oBAAoB,8BAA8B,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAE5E,IAAM,gDAAgD,CAI3D,QACA,YAY4B;AAC5B,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,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAQO,IAAM,oCAAoC,CAI/C,QACA,YAQ2D;AAC3D,QAAM,eAAe;AAAA,IACnB;AAAA,IACA;AAAA,EACF;AAEA,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,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,WAA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AAG,gBAAgB;AAC1C;AAQO,IAAM,gBAAgB,CAG3B,YAQI;AACJ,QAAM,kBAAkB,6BAA6B,OAAO;AAE5D,SAAO,YAAY,eAAe;AACpC;AAQO,IAAM,eAAe,CAC1B,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,UAAU,QAAQ,OAAO,OAAO;AAAA,IAChD;AAAA,EACF;AACF;AAEO,IAAM,0BAA0B,CAAC,WACtC,CAAC,oBAAoB,SAAS,QAAQ;AAEjC,IAAM,8BAA8B,CAIzC,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,wBAAwB,MAAM;AAEzE,QAAM,UAAmE,CAAC;AAAA,IACxE;AAAA,EACF,MAAM,aAAa,QAAQ,gBAAgB,MAAM;AAEjD,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,QAAQ,GAAG,aAAa;AACjE;AAOO,IAAM,kBAAkB,CAI7B,QACA,YAQ2D;AAC3D,QAAM,eAAe,4BAA4B,QAAQ,OAAO;AAEhE,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.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.1\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n FilesGetResponse,\n DmError,\n GetFilesParams,\n FilePostResponse,\n FilePostBodyBody,\n DeleteUnmanagedFileParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Given a Project and Path the files available to you on that path will be returned along with any additional paths (sub-directories).\n\n * @summary Gets the Files on a Project Path\n */\nexport const getFiles = (\n params: GetFilesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<FilesGetResponse>(\n { url: `/file`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetFilesQueryKey = (params: GetFilesParams) =>\n [\"data-manager-api\", `/file`, ...(params ? [params] : [])] as const;\n\nexport const getGetFilesQueryOptions = <\n TData = Awaited<ReturnType<typeof getFiles>>,\n TError = ErrorType<void | DmError>\n>(\n params: GetFilesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getFiles>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetFilesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getFiles>>> = ({\n signal,\n }) => getFiles(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetFilesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getFiles>>\n>;\nexport type GetFilesQueryError = ErrorType<void | DmError>;\n\nexport const useGetFiles = <\n TData = Awaited<ReturnType<typeof getFiles>>,\n TError = ErrorType<void | DmError>\n>(\n params: GetFilesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getFiles>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetFilesQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Given a Project and a Dataset the Dataset will be attached (added) to the project as a File using the format provided. When attached the Dataset is referred to as a Project **File**. As format conversion may take some time the file may not be immediately available. You should use the `task_id` you're presented with on the `/task` endpoint to determine when the file is available to the project.\n\nOnly Datasets attached to projects are available through the Project API. A Dataset that you upload is only available to others (who are not already `editors` of the data) when the Dataset is attached to a project.\n\nAn `editor` of a **dataset** is not automatically and `editor` of the **project** it's attached to.\n\nYou must be an `editor` or the `owner` of the project to attach a Dataset to a project. Being an `editor` of the Dataset you are attaching does not give you the ability to detach it from the Project.\n\nYou cannot add a Dataset to a Project until its upload is complete.\n\n * @summary Attach a Dataset, as a File, to a Project\n */\nexport const attachFile = (\n filePostBodyBody: FilePostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_id\", filePostBodyBody.dataset_id);\n formData.append(\n \"dataset_version\",\n filePostBodyBody.dataset_version.toString()\n );\n formData.append(\"project_id\", filePostBodyBody.project_id);\n formData.append(\"as_type\", filePostBodyBody.as_type);\n if (filePostBodyBody.path !== undefined) {\n formData.append(\"path\", filePostBodyBody.path);\n }\n if (filePostBodyBody.compress !== undefined) {\n formData.append(\"compress\", filePostBodyBody.compress.toString());\n }\n if (filePostBodyBody.immutable !== undefined) {\n formData.append(\"immutable\", filePostBodyBody.immutable.toString());\n }\n\n return customInstance<FilePostResponse>(\n {\n url: `/file`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getAttachFileMutationOptions = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachFile>>,\n { data: FilePostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return attachFile(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AttachFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof attachFile>>\n>;\nexport type AttachFileMutationBody = FilePostBodyBody;\nexport type AttachFileMutationError = ErrorType<void | DmError>;\n\nexport const useAttachFile = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAttachFileMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Removes an unmanaged file from a Project. You cannot use this endpoint to delete managed project files.\n\nYou must be an `editor` or the `owner` of the project to delete a file from a project.\n\n * @summary Delete an unmanaged Project File\n */\nexport const deleteUnmanagedFile = (\n params: DeleteUnmanagedFileParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/file`, method: \"delete\", params },\n options\n );\n};\n\nexport const getDeleteUnmanagedFileMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n { params: DeleteUnmanagedFileParams }\n > = (props) => {\n const { params } = props ?? {};\n\n return deleteUnmanagedFile(params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteUnmanagedFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>\n>;\n\nexport type DeleteUnmanagedFileMutationError = ErrorType<DmError>;\n\nexport const useDeleteUnmanagedFile = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteUnmanagedFileMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Given a `file_id` the file will be removed from the Project it's attached to.\n\nYou must be an `editor` or the `owner` of the project to delete a file from a Project. Being an `editor` of the original Dataset does not give you the ability to detach it from the Project.\n\nYou cannot delete a Project File until the attach is complete.\n\n * @summary Delete/detach a File (from a Project)\n */\nexport const deleteFile = (\n fileId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/file/${fileId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteFileMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteFile>>,\n { fileId: string }\n > = (props) => {\n const { fileId } = props ?? {};\n\n return deleteFile(fileId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteFile>>\n>;\n\nexport type DeleteFileMutationError = ErrorType<DmError>;\n\nexport const useDeleteFile = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteFileMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Given a `file_id` the file will be returned if available.\n\nYou cannot get a Project File until the attach is complete.\n\n * @summary Download a File (from a project)\n */\nexport const downloadFile = (\n fileId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/file/${fileId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getDownloadFileQueryKey = (fileId: string) =>\n [\"data-manager-api\", `/file/${fileId}`] as const;\n\nexport const getDownloadFileQueryOptions = <\n TData = Awaited<ReturnType<typeof downloadFile>>,\n TError = ErrorType<DmError>\n>(\n fileId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getDownloadFileQueryKey(fileId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadFile>>> = ({\n signal,\n }) => downloadFile(fileId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!fileId, ...queryOptions };\n};\n\nexport type DownloadFileQueryResult = NonNullable<\n Awaited<ReturnType<typeof downloadFile>>\n>;\nexport type DownloadFileQueryError = ErrorType<DmError>;\n\nexport const useDownloadFile = <\n TData = Awaited<ReturnType<typeof downloadFile>>,\n TError = ErrorType<DmError>\n>(\n fileId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getDownloadFileQueryOptions(fileId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/file/file.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAiC/B,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,sBAAsB,CAAC,WAClC,CAAC,oBAAoB,SAAS,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAEpD,IAAM,0BAA0B,CAIrC,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,oBAAoB,MAAM;AAErE,QAAM,UAA+D,CAAC;AAAA,IACpE;AAAA,EACF,MAAM,SAAS,QAAQ,gBAAgB,MAAM;AAE7C,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,cAAc,CAIzB,QACA,YAQ2D;AAC3D,QAAM,eAAe,wBAAwB,QAAQ,OAAO;AAE5D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAeO,IAAM,aAAa,CACxB,kBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,cAAc,iBAAiB,UAAU;AACzD,WAAS;AAAA,IACP;AAAA,IACA,iBAAiB,gBAAgB,SAAS;AAAA,EAC5C;AACA,WAAS,OAAO,cAAc,iBAAiB,UAAU;AACzD,WAAS,OAAO,WAAW,iBAAiB,OAAO;AACnD,MAAI,iBAAiB,SAAS,QAAW;AACvC,aAAS,OA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AAa,CACxB,QACA,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,UAAU,QAAQ,SAAS;AAAA,IAC3C;AAAA,EACF;AACF;AAEO,IAAM,+BAA+B,CAG1C,YAaG;AACH,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,OAAO,IAAI,SAAS,CAAC;AAE7B,WAAO,WAAW,QAAQ,cAAc;AAAA,EAC1C;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,gBAAgB,CAG3B,YAQI;AACJ,QAAM,kBAAkB,6BAA6B,OAAO;AAE5D,SAAO,YAAY,eAAe;AACpC;AAQO,IAAM,eAAe,CAC1B,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,UAAU,QAAQ,OAAO,OAAO;AAAA,IAChD;AAAA,EACF;AACF;AAEO,IAAM,0BAA0B,CAAC,WACtC,CAAC,oBAAoB,SAAS,QAAQ;AAEjC,IAAM,8BAA8B,CAIzC,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,wBAAwB,MAAM;AAEzE,QAAM,UAAmE,CAAC;AAAA,IACxE;AAAA,EACF,MAAM,aAAa,QAAQ,gBAAgB,MAAM;AAEjD,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,QAAQ,GAAG,aAAa;AACjE;AAOO,IAAM,kBAAkB,CAI7B,QACA,YAQ2D;AAC3D,QAAM,eAAe,4BAA4B,QAAQ,OAAO;AAEhE,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.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.2\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n FilesGetResponse,\n DmError,\n GetFilesParams,\n FilePostResponse,\n FilePostBodyBody,\n DeleteUnmanagedFileParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Given a Project and Path the files available to you on that path will be returned along with any additional paths (sub-directories).\n\n * @summary Gets the Files on a Project Path\n */\nexport const getFiles = (\n params: GetFilesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<FilesGetResponse>(\n { url: `/file`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetFilesQueryKey = (params: GetFilesParams) =>\n [\"data-manager-api\", `/file`, ...(params ? [params] : [])] as const;\n\nexport const getGetFilesQueryOptions = <\n TData = Awaited<ReturnType<typeof getFiles>>,\n TError = ErrorType<void | DmError>\n>(\n params: GetFilesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getFiles>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetFilesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getFiles>>> = ({\n signal,\n }) => getFiles(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetFilesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getFiles>>\n>;\nexport type GetFilesQueryError = ErrorType<void | DmError>;\n\nexport const useGetFiles = <\n TData = Awaited<ReturnType<typeof getFiles>>,\n TError = ErrorType<void | DmError>\n>(\n params: GetFilesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getFiles>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetFilesQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Given a Project and a Dataset the Dataset will be attached (added) to the project as a File using the format provided. When attached the Dataset is referred to as a Project **File**. As format conversion may take some time the file may not be immediately available. You should use the `task_id` you're presented with on the `/task` endpoint to determine when the file is available to the project.\n\nOnly Datasets attached to projects are available through the Project API. A Dataset that you upload is only available to others (who are not already `editors` of the data) when the Dataset is attached to a project.\n\nAn `editor` of a **dataset** is not automatically and `editor` of the **project** it's attached to.\n\nYou must be an `editor` or the `owner` of the project to attach a Dataset to a project. Being an `editor` of the Dataset you are attaching does not give you the ability to detach it from the Project.\n\nYou cannot add a Dataset to a Project until its upload is complete.\n\n * @summary Attach a Dataset, as a File, to a Project\n */\nexport const attachFile = (\n filePostBodyBody: FilePostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_id\", filePostBodyBody.dataset_id);\n formData.append(\n \"dataset_version\",\n filePostBodyBody.dataset_version.toString()\n );\n formData.append(\"project_id\", filePostBodyBody.project_id);\n formData.append(\"as_type\", filePostBodyBody.as_type);\n if (filePostBodyBody.path !== undefined) {\n formData.append(\"path\", filePostBodyBody.path);\n }\n if (filePostBodyBody.compress !== undefined) {\n formData.append(\"compress\", filePostBodyBody.compress.toString());\n }\n if (filePostBodyBody.immutable !== undefined) {\n formData.append(\"immutable\", filePostBodyBody.immutable.toString());\n }\n\n return customInstance<FilePostResponse>(\n {\n url: `/file`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getAttachFileMutationOptions = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachFile>>,\n { data: FilePostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return attachFile(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AttachFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof attachFile>>\n>;\nexport type AttachFileMutationBody = FilePostBodyBody;\nexport type AttachFileMutationError = ErrorType<void | DmError>;\n\nexport const useAttachFile = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAttachFileMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Removes an unmanaged file from a Project. You cannot use this endpoint to delete managed project files.\n\nYou must be an `editor` or the `owner` of the project to delete a file from a project.\n\n * @summary Delete an unmanaged Project File\n */\nexport const deleteUnmanagedFile = (\n params: DeleteUnmanagedFileParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/file`, method: \"delete\", params },\n options\n );\n};\n\nexport const getDeleteUnmanagedFileMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n { params: DeleteUnmanagedFileParams }\n > = (props) => {\n const { params } = props ?? {};\n\n return deleteUnmanagedFile(params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteUnmanagedFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>\n>;\n\nexport type DeleteUnmanagedFileMutationError = ErrorType<DmError>;\n\nexport const useDeleteUnmanagedFile = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteUnmanagedFileMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Given a `file_id` the file will be removed from the Project it's attached to.\n\nYou must be an `editor` or the `owner` of the project to delete a file from a Project. Being an `editor` of the original Dataset does not give you the ability to detach it from the Project.\n\nYou cannot delete a Project File until the attach is complete.\n\n * @summary Delete/detach a File (from a Project)\n */\nexport const deleteFile = (\n fileId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/file/${fileId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteFileMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteFile>>,\n { fileId: string }\n > = (props) => {\n const { fileId } = props ?? {};\n\n return deleteFile(fileId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteFile>>\n>;\n\nexport type DeleteFileMutationError = ErrorType<DmError>;\n\nexport const useDeleteFile = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteFileMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Given a `file_id` the file will be returned if available.\n\nYou cannot get a Project File until the attach is complete.\n\n * @summary Download a File (from a project)\n */\nexport const downloadFile = (\n fileId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/file/${fileId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getDownloadFileQueryKey = (fileId: string) =>\n [\"data-manager-api\", `/file/${fileId}`] as const;\n\nexport const getDownloadFileQueryOptions = <\n TData = Awaited<ReturnType<typeof downloadFile>>,\n TError = ErrorType<DmError>\n>(\n fileId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getDownloadFileQueryKey(fileId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadFile>>> = ({\n signal,\n }) => downloadFile(fileId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!fileId, ...queryOptions };\n};\n\nexport type DownloadFileQueryResult = NonNullable<\n Awaited<ReturnType<typeof downloadFile>>\n>;\nexport type DownloadFileQueryError = ErrorType<DmError>;\n\nexport const useDownloadFile = <\n TData = Awaited<ReturnType<typeof downloadFile>>,\n TError = ErrorType<DmError>\n>(\n fileId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getDownloadFileQueryOptions(fileId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"]}
|
package/file/file.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
3
|
-
import {
|
|
3
|
+
import { o as GetFilesParams, bV as customInstance, bw as FilesGetResponse, bW as ErrorType, bR as DmError, ac as FilePostBodyBody, bx as FilePostResponse, D as DeleteUnmanagedFileParams } from '../custom-instance-e5540c3b.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;
|
package/file/file.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/file/file.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.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.1\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n FilesGetResponse,\n DmError,\n GetFilesParams,\n FilePostResponse,\n FilePostBodyBody,\n DeleteUnmanagedFileParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Given a Project and Path the files available to you on that path will be returned along with any additional paths (sub-directories).\n\n * @summary Gets the Files on a Project Path\n */\nexport const getFiles = (\n params: GetFilesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<FilesGetResponse>(\n { url: `/file`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetFilesQueryKey = (params: GetFilesParams) =>\n [\"data-manager-api\", `/file`, ...(params ? [params] : [])] as const;\n\nexport const getGetFilesQueryOptions = <\n TData = Awaited<ReturnType<typeof getFiles>>,\n TError = ErrorType<void | DmError>\n>(\n params: GetFilesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getFiles>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetFilesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getFiles>>> = ({\n signal,\n }) => getFiles(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetFilesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getFiles>>\n>;\nexport type GetFilesQueryError = ErrorType<void | DmError>;\n\nexport const useGetFiles = <\n TData = Awaited<ReturnType<typeof getFiles>>,\n TError = ErrorType<void | DmError>\n>(\n params: GetFilesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getFiles>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetFilesQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Given a Project and a Dataset the Dataset will be attached (added) to the project as a File using the format provided. When attached the Dataset is referred to as a Project **File**. As format conversion may take some time the file may not be immediately available. You should use the `task_id` you're presented with on the `/task` endpoint to determine when the file is available to the project.\n\nOnly Datasets attached to projects are available through the Project API. A Dataset that you upload is only available to others (who are not already `editors` of the data) when the Dataset is attached to a project.\n\nAn `editor` of a **dataset** is not automatically and `editor` of the **project** it's attached to.\n\nYou must be an `editor` or the `owner` of the project to attach a Dataset to a project. Being an `editor` of the Dataset you are attaching does not give you the ability to detach it from the Project.\n\nYou cannot add a Dataset to a Project until its upload is complete.\n\n * @summary Attach a Dataset, as a File, to a Project\n */\nexport const attachFile = (\n filePostBodyBody: FilePostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_id\", filePostBodyBody.dataset_id);\n formData.append(\n \"dataset_version\",\n filePostBodyBody.dataset_version.toString()\n );\n formData.append(\"project_id\", filePostBodyBody.project_id);\n formData.append(\"as_type\", filePostBodyBody.as_type);\n if (filePostBodyBody.path !== undefined) {\n formData.append(\"path\", filePostBodyBody.path);\n }\n if (filePostBodyBody.compress !== undefined) {\n formData.append(\"compress\", filePostBodyBody.compress.toString());\n }\n if (filePostBodyBody.immutable !== undefined) {\n formData.append(\"immutable\", filePostBodyBody.immutable.toString());\n }\n\n return customInstance<FilePostResponse>(\n {\n url: `/file`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getAttachFileMutationOptions = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachFile>>,\n { data: FilePostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return attachFile(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AttachFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof attachFile>>\n>;\nexport type AttachFileMutationBody = FilePostBodyBody;\nexport type AttachFileMutationError = ErrorType<void | DmError>;\n\nexport const useAttachFile = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAttachFileMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Removes an unmanaged file from a Project. You cannot use this endpoint to delete managed project files.\n\nYou must be an `editor` or the `owner` of the project to delete a file from a project.\n\n * @summary Delete an unmanaged Project File\n */\nexport const deleteUnmanagedFile = (\n params: DeleteUnmanagedFileParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/file`, method: \"delete\", params },\n options\n );\n};\n\nexport const getDeleteUnmanagedFileMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n { params: DeleteUnmanagedFileParams }\n > = (props) => {\n const { params } = props ?? {};\n\n return deleteUnmanagedFile(params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteUnmanagedFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>\n>;\n\nexport type DeleteUnmanagedFileMutationError = ErrorType<DmError>;\n\nexport const useDeleteUnmanagedFile = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteUnmanagedFileMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Given a `file_id` the file will be removed from the Project it's attached to.\n\nYou must be an `editor` or the `owner` of the project to delete a file from a Project. Being an `editor` of the original Dataset does not give you the ability to detach it from the Project.\n\nYou cannot delete a Project File until the attach is complete.\n\n * @summary Delete/detach a File (from a Project)\n */\nexport const deleteFile = (\n fileId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/file/${fileId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteFileMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteFile>>,\n { fileId: string }\n > = (props) => {\n const { fileId } = props ?? {};\n\n return deleteFile(fileId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteFile>>\n>;\n\nexport type DeleteFileMutationError = ErrorType<DmError>;\n\nexport const useDeleteFile = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteFileMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Given a `file_id` the file will be returned if available.\n\nYou cannot get a Project File until the attach is complete.\n\n * @summary Download a File (from a project)\n */\nexport const downloadFile = (\n fileId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/file/${fileId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getDownloadFileQueryKey = (fileId: string) =>\n [\"data-manager-api\", `/file/${fileId}`] as const;\n\nexport const getDownloadFileQueryOptions = <\n TData = Awaited<ReturnType<typeof downloadFile>>,\n TError = ErrorType<DmError>\n>(\n fileId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getDownloadFileQueryKey(fileId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadFile>>> = ({\n signal,\n }) => downloadFile(fileId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!fileId, ...queryOptions };\n};\n\nexport type DownloadFileQueryResult = NonNullable<\n Awaited<ReturnType<typeof downloadFile>>\n>;\nexport type DownloadFileQueryError = ErrorType<DmError>;\n\nexport const useDownloadFile = <\n TData = Awaited<ReturnType<typeof downloadFile>>,\n TError = ErrorType<DmError>\n>(\n fileId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getDownloadFileQueryOptions(fileId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAiC/B,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,sBAAsB,CAAC,WAClC,CAAC,oBAAoB,SAAS,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAEpD,IAAM,0BAA0B,CAIrC,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,oBAAoB,MAAM;AAErE,QAAM,UAA+D,CAAC;AAAA,IACpE;AAAA,EACF,MAAM,SAAS,QAAQ,gBAAgB,MAAM;AAE7C,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,cAAc,CAIzB,QACA,YAQ2D;AAC3D,QAAM,eAAe,wBAAwB,QAAQ,OAAO;AAE5D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAeO,IAAM,aAAa,CACxB,kBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,c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,4BAA4B,QAAQ,OAAO;AAEhE,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/file/file.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.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.2\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n FilesGetResponse,\n DmError,\n GetFilesParams,\n FilePostResponse,\n FilePostBodyBody,\n DeleteUnmanagedFileParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Given a Project and Path the files available to you on that path will be returned along with any additional paths (sub-directories).\n\n * @summary Gets the Files on a Project Path\n */\nexport const getFiles = (\n params: GetFilesParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<FilesGetResponse>(\n { url: `/file`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetFilesQueryKey = (params: GetFilesParams) =>\n [\"data-manager-api\", `/file`, ...(params ? [params] : [])] as const;\n\nexport const getGetFilesQueryOptions = <\n TData = Awaited<ReturnType<typeof getFiles>>,\n TError = ErrorType<void | DmError>\n>(\n params: GetFilesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getFiles>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetFilesQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getFiles>>> = ({\n signal,\n }) => getFiles(params, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetFilesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getFiles>>\n>;\nexport type GetFilesQueryError = ErrorType<void | DmError>;\n\nexport const useGetFiles = <\n TData = Awaited<ReturnType<typeof getFiles>>,\n TError = ErrorType<void | DmError>\n>(\n params: GetFilesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getFiles>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetFilesQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Given a Project and a Dataset the Dataset will be attached (added) to the project as a File using the format provided. When attached the Dataset is referred to as a Project **File**. As format conversion may take some time the file may not be immediately available. You should use the `task_id` you're presented with on the `/task` endpoint to determine when the file is available to the project.\n\nOnly Datasets attached to projects are available through the Project API. A Dataset that you upload is only available to others (who are not already `editors` of the data) when the Dataset is attached to a project.\n\nAn `editor` of a **dataset** is not automatically and `editor` of the **project** it's attached to.\n\nYou must be an `editor` or the `owner` of the project to attach a Dataset to a project. Being an `editor` of the Dataset you are attaching does not give you the ability to detach it from the Project.\n\nYou cannot add a Dataset to a Project until its upload is complete.\n\n * @summary Attach a Dataset, as a File, to a Project\n */\nexport const attachFile = (\n filePostBodyBody: FilePostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_id\", filePostBodyBody.dataset_id);\n formData.append(\n \"dataset_version\",\n filePostBodyBody.dataset_version.toString()\n );\n formData.append(\"project_id\", filePostBodyBody.project_id);\n formData.append(\"as_type\", filePostBodyBody.as_type);\n if (filePostBodyBody.path !== undefined) {\n formData.append(\"path\", filePostBodyBody.path);\n }\n if (filePostBodyBody.compress !== undefined) {\n formData.append(\"compress\", filePostBodyBody.compress.toString());\n }\n if (filePostBodyBody.immutable !== undefined) {\n formData.append(\"immutable\", filePostBodyBody.immutable.toString());\n }\n\n return customInstance<FilePostResponse>(\n {\n url: `/file`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport const getAttachFileMutationOptions = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachFile>>,\n { data: FilePostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return attachFile(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AttachFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof attachFile>>\n>;\nexport type AttachFileMutationBody = FilePostBodyBody;\nexport type AttachFileMutationError = ErrorType<void | DmError>;\n\nexport const useAttachFile = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachFile>>,\n TError,\n { data: FilePostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAttachFileMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Removes an unmanaged file from a Project. You cannot use this endpoint to delete managed project files.\n\nYou must be an `editor` or the `owner` of the project to delete a file from a project.\n\n * @summary Delete an unmanaged Project File\n */\nexport const deleteUnmanagedFile = (\n params: DeleteUnmanagedFileParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/file`, method: \"delete\", params },\n options\n );\n};\n\nexport const getDeleteUnmanagedFileMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n { params: DeleteUnmanagedFileParams }\n > = (props) => {\n const { params } = props ?? {};\n\n return deleteUnmanagedFile(params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteUnmanagedFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>\n>;\n\nexport type DeleteUnmanagedFileMutationError = ErrorType<DmError>;\n\nexport const useDeleteUnmanagedFile = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteUnmanagedFile>>,\n TError,\n { params: DeleteUnmanagedFileParams },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteUnmanagedFileMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Given a `file_id` the file will be removed from the Project it's attached to.\n\nYou must be an `editor` or the `owner` of the project to delete a file from a Project. Being an `editor` of the original Dataset does not give you the ability to detach it from the Project.\n\nYou cannot delete a Project File until the attach is complete.\n\n * @summary Delete/detach a File (from a Project)\n */\nexport const deleteFile = (\n fileId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/file/${fileId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteFileMutationOptions = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteFile>>,\n { fileId: string }\n > = (props) => {\n const { fileId } = props ?? {};\n\n return deleteFile(fileId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteFile>>\n>;\n\nexport type DeleteFileMutationError = ErrorType<DmError>;\n\nexport const useDeleteFile = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteFile>>,\n TError,\n { fileId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteFileMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Given a `file_id` the file will be returned if available.\n\nYou cannot get a Project File until the attach is complete.\n\n * @summary Download a File (from a project)\n */\nexport const downloadFile = (\n fileId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/file/${fileId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getDownloadFileQueryKey = (fileId: string) =>\n [\"data-manager-api\", `/file/${fileId}`] as const;\n\nexport const getDownloadFileQueryOptions = <\n TData = Awaited<ReturnType<typeof downloadFile>>,\n TError = ErrorType<DmError>\n>(\n fileId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getDownloadFileQueryKey(fileId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadFile>>> = ({\n signal,\n }) => downloadFile(fileId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!fileId, ...queryOptions };\n};\n\nexport type DownloadFileQueryResult = NonNullable<\n Awaited<ReturnType<typeof downloadFile>>\n>;\nexport type DownloadFileQueryError = ErrorType<DmError>;\n\nexport const useDownloadFile = <\n TData = Awaited<ReturnType<typeof downloadFile>>,\n TError = ErrorType<DmError>\n>(\n fileId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getDownloadFileQueryOptions(fileId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAiC/B,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,sBAAsB,CAAC,WAClC,CAAC,oBAAoB,SAAS,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAEpD,IAAM,0BAA0B,CAIrC,QACA,YAUG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,oBAAoB,MAAM;AAErE,QAAM,UAA+D,CAA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