@squonk/data-manager-client 4.2.0 → 5.0.0-5-0.2173777171
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 +140 -94
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.cts +104 -47
- package/accounting/accounting.d.ts +104 -47
- package/accounting/accounting.js +146 -100
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +120 -145
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.cts +123 -121
- package/admin/admin.d.ts +123 -121
- package/admin/admin.js +127 -152
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +39 -43
- package/application/application.cjs.map +1 -1
- package/application/application.d.cts +25 -25
- package/application/application.d.ts +25 -25
- package/application/application.js +42 -46
- package/application/application.js.map +1 -1
- package/chunk-76ADQBHZ.js +25 -0
- package/chunk-76ADQBHZ.js.map +1 -0
- package/chunk-KHB5TJT7.cjs +25 -0
- package/chunk-KHB5TJT7.cjs.map +1 -0
- package/{chunk-TKLTUR4R.cjs → chunk-RB2KVIEK.cjs} +1 -1
- package/chunk-RB2KVIEK.cjs.map +1 -0
- package/{chunk-EBOQPVLG.js → chunk-XYDLYMQ2.js} +1 -1
- package/chunk-XYDLYMQ2.js.map +1 -0
- package/configuration/configuration.cjs +38 -45
- package/configuration/configuration.cjs.map +1 -1
- package/configuration/configuration.d.cts +26 -26
- package/configuration/configuration.d.ts +26 -26
- package/configuration/configuration.js +42 -49
- package/configuration/configuration.js.map +1 -1
- package/dataset/dataset.cjs +126 -141
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.cts +102 -102
- package/dataset/dataset.d.ts +102 -102
- package/dataset/dataset.js +132 -147
- package/dataset/dataset.js.map +1 -1
- package/digest/digest.cjs +22 -24
- package/digest/digest.cjs.map +1 -1
- package/digest/digest.d.cts +14 -14
- package/digest/digest.d.ts +14 -14
- package/digest/digest.js +24 -26
- package/digest/digest.js.map +1 -1
- package/file-and-path/file-and-path.cjs +212 -135
- package/file-and-path/file-and-path.cjs.map +1 -1
- package/file-and-path/file-and-path.d.cts +263 -103
- package/file-and-path/file-and-path.d.ts +263 -103
- package/file-and-path/file-and-path.js +222 -145
- package/file-and-path/file-and-path.js.map +1 -1
- package/index.cjs +83 -103
- package/index.cjs.map +1 -1
- package/index.d.cts +2434 -2343
- package/index.d.ts +2434 -2343
- package/index.js +82 -102
- package/index.js.map +1 -1
- package/instance/instance.cjs +100 -107
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.cts +76 -76
- package/instance/instance.d.ts +76 -76
- package/instance/instance.js +105 -112
- package/instance/instance.js.map +1 -1
- package/inventory/inventory.cjs +22 -25
- package/inventory/inventory.cjs.map +1 -1
- package/inventory/inventory.d.cts +14 -14
- package/inventory/inventory.d.ts +14 -14
- package/inventory/inventory.js +24 -27
- package/inventory/inventory.js.map +1 -1
- package/job/job.cjs +170 -66
- package/job/job.cjs.map +1 -1
- package/job/job.d.cts +193 -37
- package/job/job.d.ts +193 -37
- package/job/job.js +176 -72
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +61 -59
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.cts +47 -47
- package/metadata/metadata.d.ts +47 -47
- package/metadata/metadata.js +65 -63
- package/metadata/metadata.js.map +1 -1
- package/package.json +13 -16
- package/project/project.cjs +113 -256
- package/project/project.cjs.map +1 -1
- package/project/project.d.cts +122 -282
- package/project/project.d.ts +122 -282
- package/project/project.js +118 -261
- package/project/project.js.map +1 -1
- package/src/{data-manager-api.schemas.ts → API_TARGET_NAME.schemas.ts} +2538 -2483
- package/src/accounting/accounting.ts +1003 -455
- package/src/admin/admin.ts +1190 -788
- package/src/application/application.ts +378 -232
- package/src/configuration/configuration.ts +350 -243
- package/src/custom-instance.ts +3 -3
- package/src/dataset/dataset.ts +1200 -793
- package/src/digest/digest.ts +199 -123
- package/src/file-and-path/file-and-path.ts +1456 -603
- package/src/index.ts +3 -3
- package/src/instance/instance.ts +805 -540
- package/src/inventory/inventory.ts +201 -123
- package/src/job/job.ts +1134 -330
- package/src/metadata/metadata.ts +588 -372
- package/src/options-mutator.ts +27 -0
- package/src/project/project.ts +1064 -1121
- package/src/task/task.ts +435 -296
- package/src/type/type.ts +181 -127
- package/src/user/user.ts +847 -399
- package/src/workflow/workflow.ts +1754 -1091
- package/task/task.cjs +45 -59
- package/task/task.cjs.map +1 -1
- package/task/task.d.cts +33 -33
- package/task/task.d.ts +33 -33
- package/task/task.js +51 -65
- package/task/task.js.map +1 -1
- package/type/type.cjs +21 -26
- package/type/type.cjs.map +1 -1
- package/type/type.d.cts +14 -14
- package/type/type.d.ts +14 -14
- package/type/type.js +24 -29
- package/type/type.js.map +1 -1
- package/user/user.cjs +114 -80
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +107 -48
- package/user/user.d.ts +107 -48
- package/user/user.js +120 -86
- package/user/user.js.map +1 -1
- package/workflow/workflow.cjs +179 -193
- package/workflow/workflow.cjs.map +1 -1
- package/workflow/workflow.d.cts +149 -147
- package/workflow/workflow.d.ts +149 -147
- package/workflow/workflow.js +187 -201
- package/workflow/workflow.js.map +1 -1
- package/chunk-EBOQPVLG.js.map +0 -1
- package/chunk-TKLTUR4R.cjs.map +0 -1
- package/exchange-rate/exchange-rate.cjs +0 -253
- package/exchange-rate/exchange-rate.cjs.map +0 -1
- package/exchange-rate/exchange-rate.d.cts +0 -319
- package/exchange-rate/exchange-rate.d.ts +0 -319
- package/exchange-rate/exchange-rate.js +0 -253
- package/exchange-rate/exchange-rate.js.map +0 -1
- package/exchange-rate/package.json +0 -7
- package/src/exchange-rate/exchange-rate.ts +0 -800
|
@@ -1,800 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
/**
|
|
3
|
-
* Generated by orval v7.4.1 🍺
|
|
4
|
-
* Do not edit manually.
|
|
5
|
-
* Dataset Manager API
|
|
6
|
-
* The Dataset Manager API service.
|
|
7
|
-
|
|
8
|
-
A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications**, **Jobs**, and **Workflows** using **Projects** and **Files**.
|
|
9
|
-
|
|
10
|
-
* OpenAPI spec version: 4.1
|
|
11
|
-
*/
|
|
12
|
-
import {
|
|
13
|
-
useMutation,
|
|
14
|
-
useQuery,
|
|
15
|
-
useSuspenseQuery
|
|
16
|
-
} from '@tanstack/react-query'
|
|
17
|
-
import type {
|
|
18
|
-
DataTag,
|
|
19
|
-
DefinedInitialDataOptions,
|
|
20
|
-
DefinedUseQueryResult,
|
|
21
|
-
MutationFunction,
|
|
22
|
-
QueryFunction,
|
|
23
|
-
QueryKey,
|
|
24
|
-
UndefinedInitialDataOptions,
|
|
25
|
-
UseMutationOptions,
|
|
26
|
-
UseMutationResult,
|
|
27
|
-
UseQueryOptions,
|
|
28
|
-
UseQueryResult,
|
|
29
|
-
UseSuspenseQueryOptions,
|
|
30
|
-
UseSuspenseQueryResult
|
|
31
|
-
} from '@tanstack/react-query'
|
|
32
|
-
import type {
|
|
33
|
-
DmError,
|
|
34
|
-
ExchangeRatePutBodyBody,
|
|
35
|
-
GetAllApplicationExchangeRatesParams,
|
|
36
|
-
GetAllExchangeRatesResponse,
|
|
37
|
-
GetAllJobExchangeRatesParams,
|
|
38
|
-
GetApplicationExchangeRatesParams,
|
|
39
|
-
GetExchangeRatesResponse,
|
|
40
|
-
GetJobExchangeRatesParams
|
|
41
|
-
} from '../data-manager-api.schemas'
|
|
42
|
-
import { customInstance } from '.././custom-instance';
|
|
43
|
-
import type { ErrorType } from '.././custom-instance';
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* 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.
|
|
51
|
-
|
|
52
|
-
If an Application has no specific rate it adopts the current value of the default Application Exchange Rate.
|
|
53
|
-
|
|
54
|
-
* @summary Gets Exchange Rates for all Applications
|
|
55
|
-
*/
|
|
56
|
-
export const getAllApplicationExchangeRates = (
|
|
57
|
-
params?: GetAllApplicationExchangeRatesParams,
|
|
58
|
-
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
59
|
-
) => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return customInstance<GetAllExchangeRatesResponse>(
|
|
63
|
-
{url: `/application/exchange-rate`, method: 'GET',
|
|
64
|
-
params, signal
|
|
65
|
-
},
|
|
66
|
-
options);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
export const getGetAllApplicationExchangeRatesQueryKey = (params?: GetAllApplicationExchangeRatesParams,) => {
|
|
71
|
-
return ["data-manager-api", `/application/exchange-rate`, ...(params ? [params]: [])] as const;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
export const getGetAllApplicationExchangeRatesQueryOptions = <TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(params?: GetAllApplicationExchangeRatesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
76
|
-
) => {
|
|
77
|
-
|
|
78
|
-
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
79
|
-
|
|
80
|
-
const queryKey = queryOptions?.queryKey ?? getGetAllApplicationExchangeRatesQueryKey(params);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>> = ({ signal }) => getAllApplicationExchangeRates(params, requestOptions, signal);
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export type GetAllApplicationExchangeRatesQueryResult = NonNullable<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>>
|
|
94
|
-
export type GetAllApplicationExchangeRatesQueryError = ErrorType<void | DmError>
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
export function useGetAllApplicationExchangeRates<TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
98
|
-
params: undefined | GetAllApplicationExchangeRatesParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError, TData>> & Pick<
|
|
99
|
-
DefinedInitialDataOptions<
|
|
100
|
-
Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
|
|
101
|
-
TError,
|
|
102
|
-
TData
|
|
103
|
-
> , 'initialData'
|
|
104
|
-
>, request?: SecondParameter<typeof customInstance>}
|
|
105
|
-
|
|
106
|
-
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
107
|
-
export function useGetAllApplicationExchangeRates<TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
108
|
-
params?: GetAllApplicationExchangeRatesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError, TData>> & Pick<
|
|
109
|
-
UndefinedInitialDataOptions<
|
|
110
|
-
Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
|
|
111
|
-
TError,
|
|
112
|
-
TData
|
|
113
|
-
> , 'initialData'
|
|
114
|
-
>, request?: SecondParameter<typeof customInstance>}
|
|
115
|
-
|
|
116
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
117
|
-
export function useGetAllApplicationExchangeRates<TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
118
|
-
params?: GetAllApplicationExchangeRatesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
119
|
-
|
|
120
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
121
|
-
/**
|
|
122
|
-
* @summary Gets Exchange Rates for all Applications
|
|
123
|
-
*/
|
|
124
|
-
|
|
125
|
-
export function useGetAllApplicationExchangeRates<TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
126
|
-
params?: GetAllApplicationExchangeRatesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
127
|
-
|
|
128
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
129
|
-
|
|
130
|
-
const queryOptions = getGetAllApplicationExchangeRatesQueryOptions(params,options)
|
|
131
|
-
|
|
132
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
133
|
-
|
|
134
|
-
query.queryKey = queryOptions.queryKey ;
|
|
135
|
-
|
|
136
|
-
return query;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
export const getGetAllApplicationExchangeRatesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(params?: GetAllApplicationExchangeRatesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
142
|
-
) => {
|
|
143
|
-
|
|
144
|
-
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
145
|
-
|
|
146
|
-
const queryKey = queryOptions?.queryKey ?? getGetAllApplicationExchangeRatesQueryKey(params);
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>> = ({ signal }) => getAllApplicationExchangeRates(params, requestOptions, signal);
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export type GetAllApplicationExchangeRatesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>>
|
|
160
|
-
export type GetAllApplicationExchangeRatesSuspenseQueryError = ErrorType<void | DmError>
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
export function useGetAllApplicationExchangeRatesSuspense<TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
164
|
-
params: undefined | GetAllApplicationExchangeRatesParams, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
165
|
-
|
|
166
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
167
|
-
export function useGetAllApplicationExchangeRatesSuspense<TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
168
|
-
params?: GetAllApplicationExchangeRatesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
169
|
-
|
|
170
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
171
|
-
export function useGetAllApplicationExchangeRatesSuspense<TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
172
|
-
params?: GetAllApplicationExchangeRatesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
173
|
-
|
|
174
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
175
|
-
/**
|
|
176
|
-
* @summary Gets Exchange Rates for all Applications
|
|
177
|
-
*/
|
|
178
|
-
|
|
179
|
-
export function useGetAllApplicationExchangeRatesSuspense<TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
180
|
-
params?: GetAllApplicationExchangeRatesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
181
|
-
|
|
182
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
183
|
-
|
|
184
|
-
const queryOptions = getGetAllApplicationExchangeRatesSuspenseQueryOptions(params,options)
|
|
185
|
-
|
|
186
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
187
|
-
|
|
188
|
-
query.queryKey = queryOptions.queryKey ;
|
|
189
|
-
|
|
190
|
-
return query;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* 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.
|
|
197
|
-
|
|
198
|
-
If an Application has no specific rate it adopts the current value of the default Application Exchange Rate.
|
|
199
|
-
|
|
200
|
-
You need `admin` privilege to use this method.
|
|
201
|
-
|
|
202
|
-
* @summary Sets the Exchange Rate for a specific Application
|
|
203
|
-
*/
|
|
204
|
-
export const setApplicationExchangeRate = (
|
|
205
|
-
applicationId: string,
|
|
206
|
-
exchangeRatePutBodyBody: ExchangeRatePutBodyBody,
|
|
207
|
-
options?: SecondParameter<typeof customInstance>,) => {
|
|
208
|
-
|
|
209
|
-
const formUrlEncoded = new URLSearchParams();
|
|
210
|
-
formUrlEncoded.append('rate', exchangeRatePutBodyBody.rate)
|
|
211
|
-
if(exchangeRatePutBodyBody.comment !== undefined) {
|
|
212
|
-
formUrlEncoded.append('comment', exchangeRatePutBodyBody.comment)
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
return customInstance<void>(
|
|
216
|
-
{url: `/application/${applicationId}/exchange-rate`, method: 'PUT',
|
|
217
|
-
headers: {'Content-Type': 'application/x-www-form-urlencoded', },
|
|
218
|
-
data: formUrlEncoded
|
|
219
|
-
},
|
|
220
|
-
options);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
export const getSetApplicationExchangeRateMutationOptions = <TData = Awaited<ReturnType<typeof setApplicationExchangeRate>>, TError = ErrorType<void | DmError>,
|
|
226
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{applicationId: string;data: ExchangeRatePutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
227
|
-
) => {
|
|
228
|
-
const mutationKey = ['setApplicationExchangeRate'];
|
|
229
|
-
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
230
|
-
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
231
|
-
options
|
|
232
|
-
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
233
|
-
: {mutation: { mutationKey, }, request: undefined};
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof setApplicationExchangeRate>>, {applicationId: string;data: ExchangeRatePutBodyBody}> = (props) => {
|
|
239
|
-
const {applicationId,data} = props ?? {};
|
|
240
|
-
|
|
241
|
-
return setApplicationExchangeRate(applicationId,data,requestOptions)
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{applicationId: string;data: ExchangeRatePutBodyBody}, TContext>}
|
|
248
|
-
|
|
249
|
-
export type SetApplicationExchangeRateMutationResult = NonNullable<Awaited<ReturnType<typeof setApplicationExchangeRate>>>
|
|
250
|
-
export type SetApplicationExchangeRateMutationBody = ExchangeRatePutBodyBody
|
|
251
|
-
export type SetApplicationExchangeRateMutationError = ErrorType<void | DmError>
|
|
252
|
-
|
|
253
|
-
/**
|
|
254
|
-
* @summary Sets the Exchange Rate for a specific Application
|
|
255
|
-
*/
|
|
256
|
-
export const useSetApplicationExchangeRate = <TData = Awaited<ReturnType<typeof setApplicationExchangeRate>>, TError = ErrorType<void | DmError>,
|
|
257
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{applicationId: string;data: ExchangeRatePutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
258
|
-
): UseMutationResult<
|
|
259
|
-
TData,
|
|
260
|
-
TError,
|
|
261
|
-
{applicationId: string;data: ExchangeRatePutBodyBody},
|
|
262
|
-
TContext
|
|
263
|
-
> => {
|
|
264
|
-
|
|
265
|
-
const mutationOptions = getSetApplicationExchangeRateMutationOptions(options);
|
|
266
|
-
|
|
267
|
-
return useMutation(mutationOptions);
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* 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.
|
|
271
|
-
|
|
272
|
-
* @summary Gets the Application's Exchange Rate history
|
|
273
|
-
*/
|
|
274
|
-
export const getApplicationExchangeRates = (
|
|
275
|
-
applicationId: string,
|
|
276
|
-
params?: GetApplicationExchangeRatesParams,
|
|
277
|
-
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
278
|
-
) => {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
return customInstance<GetExchangeRatesResponse>(
|
|
282
|
-
{url: `/application/${applicationId}/exchange-rate`, method: 'GET',
|
|
283
|
-
params, signal
|
|
284
|
-
},
|
|
285
|
-
options);
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
export const getGetApplicationExchangeRatesQueryKey = (applicationId: string,
|
|
290
|
-
params?: GetApplicationExchangeRatesParams,) => {
|
|
291
|
-
return ["data-manager-api", `/application/${applicationId}/exchange-rate`, ...(params ? [params]: [])] as const;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
export const getGetApplicationExchangeRatesQueryOptions = <TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(applicationId: string,
|
|
296
|
-
params?: GetApplicationExchangeRatesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
297
|
-
) => {
|
|
298
|
-
|
|
299
|
-
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
300
|
-
|
|
301
|
-
const queryKey = queryOptions?.queryKey ?? getGetApplicationExchangeRatesQueryKey(applicationId,params);
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApplicationExchangeRates>>> = ({ signal }) => getApplicationExchangeRates(applicationId,params, requestOptions, signal);
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
return { queryKey, queryFn, enabled: !!(applicationId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
export type GetApplicationExchangeRatesQueryResult = NonNullable<Awaited<ReturnType<typeof getApplicationExchangeRates>>>
|
|
315
|
-
export type GetApplicationExchangeRatesQueryError = ErrorType<void | DmError>
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
export function useGetApplicationExchangeRates<TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
319
|
-
applicationId: string,
|
|
320
|
-
params: undefined | GetApplicationExchangeRatesParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError, TData>> & Pick<
|
|
321
|
-
DefinedInitialDataOptions<
|
|
322
|
-
Awaited<ReturnType<typeof getApplicationExchangeRates>>,
|
|
323
|
-
TError,
|
|
324
|
-
TData
|
|
325
|
-
> , 'initialData'
|
|
326
|
-
>, request?: SecondParameter<typeof customInstance>}
|
|
327
|
-
|
|
328
|
-
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
329
|
-
export function useGetApplicationExchangeRates<TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
330
|
-
applicationId: string,
|
|
331
|
-
params?: GetApplicationExchangeRatesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError, TData>> & Pick<
|
|
332
|
-
UndefinedInitialDataOptions<
|
|
333
|
-
Awaited<ReturnType<typeof getApplicationExchangeRates>>,
|
|
334
|
-
TError,
|
|
335
|
-
TData
|
|
336
|
-
> , 'initialData'
|
|
337
|
-
>, request?: SecondParameter<typeof customInstance>}
|
|
338
|
-
|
|
339
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
340
|
-
export function useGetApplicationExchangeRates<TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
341
|
-
applicationId: string,
|
|
342
|
-
params?: GetApplicationExchangeRatesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
343
|
-
|
|
344
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
345
|
-
/**
|
|
346
|
-
* @summary Gets the Application's Exchange Rate history
|
|
347
|
-
*/
|
|
348
|
-
|
|
349
|
-
export function useGetApplicationExchangeRates<TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
350
|
-
applicationId: string,
|
|
351
|
-
params?: GetApplicationExchangeRatesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
352
|
-
|
|
353
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
354
|
-
|
|
355
|
-
const queryOptions = getGetApplicationExchangeRatesQueryOptions(applicationId,params,options)
|
|
356
|
-
|
|
357
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
358
|
-
|
|
359
|
-
query.queryKey = queryOptions.queryKey ;
|
|
360
|
-
|
|
361
|
-
return query;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
export const getGetApplicationExchangeRatesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(applicationId: string,
|
|
367
|
-
params?: GetApplicationExchangeRatesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
368
|
-
) => {
|
|
369
|
-
|
|
370
|
-
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
371
|
-
|
|
372
|
-
const queryKey = queryOptions?.queryKey ?? getGetApplicationExchangeRatesQueryKey(applicationId,params);
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApplicationExchangeRates>>> = ({ signal }) => getApplicationExchangeRates(applicationId,params, requestOptions, signal);
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
export type GetApplicationExchangeRatesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getApplicationExchangeRates>>>
|
|
386
|
-
export type GetApplicationExchangeRatesSuspenseQueryError = ErrorType<void | DmError>
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
export function useGetApplicationExchangeRatesSuspense<TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
390
|
-
applicationId: string,
|
|
391
|
-
params: undefined | GetApplicationExchangeRatesParams, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
392
|
-
|
|
393
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
394
|
-
export function useGetApplicationExchangeRatesSuspense<TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
395
|
-
applicationId: string,
|
|
396
|
-
params?: GetApplicationExchangeRatesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
397
|
-
|
|
398
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
399
|
-
export function useGetApplicationExchangeRatesSuspense<TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
400
|
-
applicationId: string,
|
|
401
|
-
params?: GetApplicationExchangeRatesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
402
|
-
|
|
403
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
404
|
-
/**
|
|
405
|
-
* @summary Gets the Application's Exchange Rate history
|
|
406
|
-
*/
|
|
407
|
-
|
|
408
|
-
export function useGetApplicationExchangeRatesSuspense<TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
409
|
-
applicationId: string,
|
|
410
|
-
params?: GetApplicationExchangeRatesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
411
|
-
|
|
412
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
413
|
-
|
|
414
|
-
const queryOptions = getGetApplicationExchangeRatesSuspenseQueryOptions(applicationId,params,options)
|
|
415
|
-
|
|
416
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
417
|
-
|
|
418
|
-
query.queryKey = queryOptions.queryKey ;
|
|
419
|
-
|
|
420
|
-
return query;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* 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.
|
|
427
|
-
|
|
428
|
-
* @summary Gets Exchange Rates for all Jobs
|
|
429
|
-
*/
|
|
430
|
-
export const getAllJobExchangeRates = (
|
|
431
|
-
params?: GetAllJobExchangeRatesParams,
|
|
432
|
-
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
433
|
-
) => {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
return customInstance<GetAllExchangeRatesResponse>(
|
|
437
|
-
{url: `/job/exchange-rate`, method: 'GET',
|
|
438
|
-
params, signal
|
|
439
|
-
},
|
|
440
|
-
options);
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
export const getGetAllJobExchangeRatesQueryKey = (params?: GetAllJobExchangeRatesParams,) => {
|
|
445
|
-
return ["data-manager-api", `/job/exchange-rate`, ...(params ? [params]: [])] as const;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
export const getGetAllJobExchangeRatesQueryOptions = <TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError = ErrorType<void | DmError>>(params?: GetAllJobExchangeRatesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
450
|
-
) => {
|
|
451
|
-
|
|
452
|
-
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
453
|
-
|
|
454
|
-
const queryKey = queryOptions?.queryKey ?? getGetAllJobExchangeRatesQueryKey(params);
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllJobExchangeRates>>> = ({ signal }) => getAllJobExchangeRates(params, requestOptions, signal);
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
export type GetAllJobExchangeRatesQueryResult = NonNullable<Awaited<ReturnType<typeof getAllJobExchangeRates>>>
|
|
468
|
-
export type GetAllJobExchangeRatesQueryError = ErrorType<void | DmError>
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
export function useGetAllJobExchangeRates<TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
472
|
-
params: undefined | GetAllJobExchangeRatesParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>> & Pick<
|
|
473
|
-
DefinedInitialDataOptions<
|
|
474
|
-
Awaited<ReturnType<typeof getAllJobExchangeRates>>,
|
|
475
|
-
TError,
|
|
476
|
-
TData
|
|
477
|
-
> , 'initialData'
|
|
478
|
-
>, request?: SecondParameter<typeof customInstance>}
|
|
479
|
-
|
|
480
|
-
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
481
|
-
export function useGetAllJobExchangeRates<TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
482
|
-
params?: GetAllJobExchangeRatesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>> & Pick<
|
|
483
|
-
UndefinedInitialDataOptions<
|
|
484
|
-
Awaited<ReturnType<typeof getAllJobExchangeRates>>,
|
|
485
|
-
TError,
|
|
486
|
-
TData
|
|
487
|
-
> , 'initialData'
|
|
488
|
-
>, request?: SecondParameter<typeof customInstance>}
|
|
489
|
-
|
|
490
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
491
|
-
export function useGetAllJobExchangeRates<TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
492
|
-
params?: GetAllJobExchangeRatesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
493
|
-
|
|
494
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
495
|
-
/**
|
|
496
|
-
* @summary Gets Exchange Rates for all Jobs
|
|
497
|
-
*/
|
|
498
|
-
|
|
499
|
-
export function useGetAllJobExchangeRates<TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
500
|
-
params?: GetAllJobExchangeRatesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
501
|
-
|
|
502
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
503
|
-
|
|
504
|
-
const queryOptions = getGetAllJobExchangeRatesQueryOptions(params,options)
|
|
505
|
-
|
|
506
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
507
|
-
|
|
508
|
-
query.queryKey = queryOptions.queryKey ;
|
|
509
|
-
|
|
510
|
-
return query;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
export const getGetAllJobExchangeRatesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError = ErrorType<void | DmError>>(params?: GetAllJobExchangeRatesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
516
|
-
) => {
|
|
517
|
-
|
|
518
|
-
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
519
|
-
|
|
520
|
-
const queryKey = queryOptions?.queryKey ?? getGetAllJobExchangeRatesQueryKey(params);
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllJobExchangeRates>>> = ({ signal }) => getAllJobExchangeRates(params, requestOptions, signal);
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
export type GetAllJobExchangeRatesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getAllJobExchangeRates>>>
|
|
534
|
-
export type GetAllJobExchangeRatesSuspenseQueryError = ErrorType<void | DmError>
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
export function useGetAllJobExchangeRatesSuspense<TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
538
|
-
params: undefined | GetAllJobExchangeRatesParams, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
539
|
-
|
|
540
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
541
|
-
export function useGetAllJobExchangeRatesSuspense<TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
542
|
-
params?: GetAllJobExchangeRatesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
543
|
-
|
|
544
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
545
|
-
export function useGetAllJobExchangeRatesSuspense<TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
546
|
-
params?: GetAllJobExchangeRatesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
547
|
-
|
|
548
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
549
|
-
/**
|
|
550
|
-
* @summary Gets Exchange Rates for all Jobs
|
|
551
|
-
*/
|
|
552
|
-
|
|
553
|
-
export function useGetAllJobExchangeRatesSuspense<TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
554
|
-
params?: GetAllJobExchangeRatesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
555
|
-
|
|
556
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
557
|
-
|
|
558
|
-
const queryOptions = getGetAllJobExchangeRatesSuspenseQueryOptions(params,options)
|
|
559
|
-
|
|
560
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
561
|
-
|
|
562
|
-
query.queryKey = queryOptions.queryKey ;
|
|
563
|
-
|
|
564
|
-
return query;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
* 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.
|
|
571
|
-
|
|
572
|
-
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'.
|
|
573
|
-
|
|
574
|
-
If a Job has no specific rate it adopts the current value of the default Job Exchange Rate.
|
|
575
|
-
|
|
576
|
-
You need `admin` privilege to use this method.
|
|
577
|
-
|
|
578
|
-
* @summary Sets the Exchange Rate for a specific Job
|
|
579
|
-
*/
|
|
580
|
-
export const setJobPricing = (
|
|
581
|
-
jobId: number,
|
|
582
|
-
exchangeRatePutBodyBody: ExchangeRatePutBodyBody,
|
|
583
|
-
options?: SecondParameter<typeof customInstance>,) => {
|
|
584
|
-
|
|
585
|
-
const formUrlEncoded = new URLSearchParams();
|
|
586
|
-
formUrlEncoded.append('rate', exchangeRatePutBodyBody.rate)
|
|
587
|
-
if(exchangeRatePutBodyBody.comment !== undefined) {
|
|
588
|
-
formUrlEncoded.append('comment', exchangeRatePutBodyBody.comment)
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
return customInstance<void>(
|
|
592
|
-
{url: `/job/${jobId}/exchange-rate`, method: 'PUT',
|
|
593
|
-
headers: {'Content-Type': 'application/x-www-form-urlencoded', },
|
|
594
|
-
data: formUrlEncoded
|
|
595
|
-
},
|
|
596
|
-
options);
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
export const getSetJobPricingMutationOptions = <TData = Awaited<ReturnType<typeof setJobPricing>>, TError = ErrorType<void | DmError>,
|
|
602
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{jobId: number;data: ExchangeRatePutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
603
|
-
) => {
|
|
604
|
-
const mutationKey = ['setJobPricing'];
|
|
605
|
-
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
606
|
-
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
607
|
-
options
|
|
608
|
-
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
609
|
-
: {mutation: { mutationKey, }, request: undefined};
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof setJobPricing>>, {jobId: number;data: ExchangeRatePutBodyBody}> = (props) => {
|
|
615
|
-
const {jobId,data} = props ?? {};
|
|
616
|
-
|
|
617
|
-
return setJobPricing(jobId,data,requestOptions)
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{jobId: number;data: ExchangeRatePutBodyBody}, TContext>}
|
|
624
|
-
|
|
625
|
-
export type SetJobPricingMutationResult = NonNullable<Awaited<ReturnType<typeof setJobPricing>>>
|
|
626
|
-
export type SetJobPricingMutationBody = ExchangeRatePutBodyBody
|
|
627
|
-
export type SetJobPricingMutationError = ErrorType<void | DmError>
|
|
628
|
-
|
|
629
|
-
/**
|
|
630
|
-
* @summary Sets the Exchange Rate for a specific Job
|
|
631
|
-
*/
|
|
632
|
-
export const useSetJobPricing = <TData = Awaited<ReturnType<typeof setJobPricing>>, TError = ErrorType<void | DmError>,
|
|
633
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{jobId: number;data: ExchangeRatePutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
634
|
-
): UseMutationResult<
|
|
635
|
-
TData,
|
|
636
|
-
TError,
|
|
637
|
-
{jobId: number;data: ExchangeRatePutBodyBody},
|
|
638
|
-
TContext
|
|
639
|
-
> => {
|
|
640
|
-
|
|
641
|
-
const mutationOptions = getSetJobPricingMutationOptions(options);
|
|
642
|
-
|
|
643
|
-
return useMutation(mutationOptions);
|
|
644
|
-
}
|
|
645
|
-
/**
|
|
646
|
-
* 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.
|
|
647
|
-
|
|
648
|
-
* @summary Gets Job Exchange Rates
|
|
649
|
-
*/
|
|
650
|
-
export const getJobExchangeRates = (
|
|
651
|
-
jobId: number,
|
|
652
|
-
params?: GetJobExchangeRatesParams,
|
|
653
|
-
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
654
|
-
) => {
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
return customInstance<GetExchangeRatesResponse>(
|
|
658
|
-
{url: `/job/${jobId}/exchange-rate`, method: 'GET',
|
|
659
|
-
params, signal
|
|
660
|
-
},
|
|
661
|
-
options);
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
export const getGetJobExchangeRatesQueryKey = (jobId: number,
|
|
666
|
-
params?: GetJobExchangeRatesParams,) => {
|
|
667
|
-
return ["data-manager-api", `/job/${jobId}/exchange-rate`, ...(params ? [params]: [])] as const;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
export const getGetJobExchangeRatesQueryOptions = <TData = Awaited<ReturnType<typeof getJobExchangeRates>>, TError = ErrorType<void | DmError>>(jobId: number,
|
|
672
|
-
params?: GetJobExchangeRatesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
673
|
-
) => {
|
|
674
|
-
|
|
675
|
-
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
676
|
-
|
|
677
|
-
const queryKey = queryOptions?.queryKey ?? getGetJobExchangeRatesQueryKey(jobId,params);
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobExchangeRates>>> = ({ signal }) => getJobExchangeRates(jobId,params, requestOptions, signal);
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
return { queryKey, queryFn, enabled: !!(jobId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
export type GetJobExchangeRatesQueryResult = NonNullable<Awaited<ReturnType<typeof getJobExchangeRates>>>
|
|
691
|
-
export type GetJobExchangeRatesQueryError = ErrorType<void | DmError>
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
export function useGetJobExchangeRates<TData = Awaited<ReturnType<typeof getJobExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
695
|
-
jobId: number,
|
|
696
|
-
params: undefined | GetJobExchangeRatesParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>> & Pick<
|
|
697
|
-
DefinedInitialDataOptions<
|
|
698
|
-
Awaited<ReturnType<typeof getJobExchangeRates>>,
|
|
699
|
-
TError,
|
|
700
|
-
TData
|
|
701
|
-
> , 'initialData'
|
|
702
|
-
>, request?: SecondParameter<typeof customInstance>}
|
|
703
|
-
|
|
704
|
-
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
705
|
-
export function useGetJobExchangeRates<TData = Awaited<ReturnType<typeof getJobExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
706
|
-
jobId: number,
|
|
707
|
-
params?: GetJobExchangeRatesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>> & Pick<
|
|
708
|
-
UndefinedInitialDataOptions<
|
|
709
|
-
Awaited<ReturnType<typeof getJobExchangeRates>>,
|
|
710
|
-
TError,
|
|
711
|
-
TData
|
|
712
|
-
> , 'initialData'
|
|
713
|
-
>, request?: SecondParameter<typeof customInstance>}
|
|
714
|
-
|
|
715
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
716
|
-
export function useGetJobExchangeRates<TData = Awaited<ReturnType<typeof getJobExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
717
|
-
jobId: number,
|
|
718
|
-
params?: GetJobExchangeRatesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
719
|
-
|
|
720
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
721
|
-
/**
|
|
722
|
-
* @summary Gets Job Exchange Rates
|
|
723
|
-
*/
|
|
724
|
-
|
|
725
|
-
export function useGetJobExchangeRates<TData = Awaited<ReturnType<typeof getJobExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
726
|
-
jobId: number,
|
|
727
|
-
params?: GetJobExchangeRatesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
728
|
-
|
|
729
|
-
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
730
|
-
|
|
731
|
-
const queryOptions = getGetJobExchangeRatesQueryOptions(jobId,params,options)
|
|
732
|
-
|
|
733
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
734
|
-
|
|
735
|
-
query.queryKey = queryOptions.queryKey ;
|
|
736
|
-
|
|
737
|
-
return query;
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
export const getGetJobExchangeRatesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getJobExchangeRates>>, TError = ErrorType<void | DmError>>(jobId: number,
|
|
743
|
-
params?: GetJobExchangeRatesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
744
|
-
) => {
|
|
745
|
-
|
|
746
|
-
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
747
|
-
|
|
748
|
-
const queryKey = queryOptions?.queryKey ?? getGetJobExchangeRatesQueryKey(jobId,params);
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobExchangeRates>>> = ({ signal }) => getJobExchangeRates(jobId,params, requestOptions, signal);
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
export type GetJobExchangeRatesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getJobExchangeRates>>>
|
|
762
|
-
export type GetJobExchangeRatesSuspenseQueryError = ErrorType<void | DmError>
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
export function useGetJobExchangeRatesSuspense<TData = Awaited<ReturnType<typeof getJobExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
766
|
-
jobId: number,
|
|
767
|
-
params: undefined | GetJobExchangeRatesParams, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
768
|
-
|
|
769
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
770
|
-
export function useGetJobExchangeRatesSuspense<TData = Awaited<ReturnType<typeof getJobExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
771
|
-
jobId: number,
|
|
772
|
-
params?: GetJobExchangeRatesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
773
|
-
|
|
774
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
775
|
-
export function useGetJobExchangeRatesSuspense<TData = Awaited<ReturnType<typeof getJobExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
776
|
-
jobId: number,
|
|
777
|
-
params?: GetJobExchangeRatesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
778
|
-
|
|
779
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
780
|
-
/**
|
|
781
|
-
* @summary Gets Job Exchange Rates
|
|
782
|
-
*/
|
|
783
|
-
|
|
784
|
-
export function useGetJobExchangeRatesSuspense<TData = Awaited<ReturnType<typeof getJobExchangeRates>>, TError = ErrorType<void | DmError>>(
|
|
785
|
-
jobId: number,
|
|
786
|
-
params?: GetJobExchangeRatesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
787
|
-
|
|
788
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
789
|
-
|
|
790
|
-
const queryOptions = getGetJobExchangeRatesSuspenseQueryOptions(jobId,params,options)
|
|
791
|
-
|
|
792
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
793
|
-
|
|
794
|
-
query.queryKey = queryOptions.queryKey ;
|
|
795
|
-
|
|
796
|
-
return query;
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|