@squonk/data-manager-client 1.2.3-rc.1 → 1.2.3
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.
|
@@ -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,OAAO;AAAA,EAC5D;AAEA,SAAO;AAAA,IACL;AAAA,MACE,KAAK,gBAAgB;AAAA,MACrB,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,MACjD,MAAM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G,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.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
|
+
{"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,S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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\nExchange rates are divided by an internal **scale factor** prior to being applied. The scale factor has a value of 1,000. The scale factor is used to make the exchange rates a little easier to digest, because without this on some jobs we would need to support values ike '0.00001'. With a scale factor of `1,000` the exchange rate is a much more humanly-digestible, e.g. '0.00001' becomes '0.01'.\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"]}
|
|
@@ -105,6 +105,8 @@ declare const useGetAllJobExchangeRates: <TData = GetAllExchangeRatesResponse, T
|
|
|
105
105
|
/**
|
|
106
106
|
* 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.
|
|
107
107
|
|
|
108
|
+
Exchange rates are divided by an internal **scale factor** prior to being applied. The scale factor has a value of 1,000. The scale factor is used to make the exchange rates a little easier to digest, because without this on some jobs we would need to support values ike '0.00001'. With a scale factor of `1,000` the exchange rate is a much more humanly-digestible, e.g. '0.00001' becomes '0.01'.
|
|
109
|
+
|
|
108
110
|
If a Job has no specific rate it adopts the current value of the default Job Exchange Rate.
|
|
109
111
|
|
|
110
112
|
You need `admin` privilege to use this method.
|
|
@@ -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.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":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,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;","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\nExchange rates are divided by an internal **scale factor** prior to being applied. The scale factor has a value of 1,000. The scale factor is used to make the exchange rates a little easier to digest, because without this on some jobs we would need to support values ike '0.00001'. With a scale factor of `1,000` the exchange rate is a much more humanly-digestible, e.g. '0.00001' becomes '0.01'.\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;A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|
@@ -392,6 +392,8 @@ export const useGetAllJobExchangeRates = <
|
|
|
392
392
|
/**
|
|
393
393
|
* 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.
|
|
394
394
|
|
|
395
|
+
Exchange rates are divided by an internal **scale factor** prior to being applied. The scale factor has a value of 1,000. The scale factor is used to make the exchange rates a little easier to digest, because without this on some jobs we would need to support values ike '0.00001'. With a scale factor of `1,000` the exchange rate is a much more humanly-digestible, e.g. '0.00001' becomes '0.01'.
|
|
396
|
+
|
|
395
397
|
If a Job has no specific rate it adopts the current value of the default Job Exchange Rate.
|
|
396
398
|
|
|
397
399
|
You need `admin` privilege to use this method.
|