@squonk/data-manager-client 4.3.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.
Files changed (119) hide show
  1. package/accounting/accounting.cjs +55 -10
  2. package/accounting/accounting.cjs.map +1 -1
  3. package/accounting/accounting.d.cts +58 -1
  4. package/accounting/accounting.d.ts +58 -1
  5. package/accounting/accounting.js +46 -1
  6. package/accounting/accounting.js.map +1 -1
  7. package/admin/admin.cjs +15 -15
  8. package/admin/admin.cjs.map +1 -1
  9. package/admin/admin.d.cts +2 -0
  10. package/admin/admin.d.ts +2 -0
  11. package/admin/admin.js +1 -1
  12. package/admin/admin.js.map +1 -1
  13. package/application/application.cjs +5 -5
  14. package/application/application.cjs.map +1 -1
  15. package/application/application.js +1 -1
  16. package/application/application.js.map +1 -1
  17. package/{chunk-OYRETEBZ.js → chunk-76ADQBHZ.js} +3 -3
  18. package/chunk-76ADQBHZ.js.map +1 -0
  19. package/{chunk-ZLY5XEOQ.cjs → chunk-KHB5TJT7.cjs} +3 -3
  20. package/chunk-KHB5TJT7.cjs.map +1 -0
  21. package/chunk-RB2KVIEK.cjs.map +1 -1
  22. package/configuration/configuration.cjs +5 -5
  23. package/configuration/configuration.cjs.map +1 -1
  24. package/configuration/configuration.d.cts +1 -1
  25. package/configuration/configuration.d.ts +1 -1
  26. package/configuration/configuration.js +1 -1
  27. package/configuration/configuration.js.map +1 -1
  28. package/dataset/dataset.cjs +14 -14
  29. package/dataset/dataset.cjs.map +1 -1
  30. package/dataset/dataset.js +1 -1
  31. package/dataset/dataset.js.map +1 -1
  32. package/digest/digest.cjs +3 -3
  33. package/digest/digest.cjs.map +1 -1
  34. package/digest/digest.js +1 -1
  35. package/digest/digest.js.map +1 -1
  36. package/file-and-path/file-and-path.cjs +139 -17
  37. package/file-and-path/file-and-path.cjs.map +1 -1
  38. package/file-and-path/file-and-path.d.cts +162 -2
  39. package/file-and-path/file-and-path.d.ts +162 -2
  40. package/file-and-path/file-and-path.js +123 -1
  41. package/file-and-path/file-and-path.js.map +1 -1
  42. package/index.cjs +4 -2
  43. package/index.cjs.map +1 -1
  44. package/index.d.cts +53 -37
  45. package/index.d.ts +53 -37
  46. package/index.js +3 -1
  47. package/index.js.map +1 -1
  48. package/instance/instance.cjs +10 -10
  49. package/instance/instance.cjs.map +1 -1
  50. package/instance/instance.js +1 -1
  51. package/instance/instance.js.map +1 -1
  52. package/inventory/inventory.cjs +3 -3
  53. package/inventory/inventory.cjs.map +1 -1
  54. package/inventory/inventory.js +1 -1
  55. package/inventory/inventory.js.map +1 -1
  56. package/job/job.cjs +124 -8
  57. package/job/job.cjs.map +1 -1
  58. package/job/job.d.cts +159 -3
  59. package/job/job.d.ts +159 -3
  60. package/job/job.js +119 -3
  61. package/job/job.js.map +1 -1
  62. package/metadata/metadata.cjs +7 -7
  63. package/metadata/metadata.cjs.map +1 -1
  64. package/metadata/metadata.js +1 -1
  65. package/metadata/metadata.js.map +1 -1
  66. package/package.json +1 -1
  67. package/project/project.cjs +15 -137
  68. package/project/project.cjs.map +1 -1
  69. package/project/project.d.cts +3 -163
  70. package/project/project.d.ts +3 -163
  71. package/project/project.js +1 -123
  72. package/project/project.js.map +1 -1
  73. package/src/{data-manager-api.schemas.ts → API_TARGET_NAME.schemas.ts} +52 -43
  74. package/src/accounting/accounting.ts +244 -2
  75. package/src/admin/admin.ts +4 -2
  76. package/src/application/application.ts +2 -2
  77. package/src/configuration/configuration.ts +5 -9
  78. package/src/dataset/dataset.ts +2 -2
  79. package/src/digest/digest.ts +2 -2
  80. package/src/file-and-path/file-and-path.ts +602 -2
  81. package/src/index.ts +2 -2
  82. package/src/instance/instance.ts +2 -2
  83. package/src/inventory/inventory.ts +2 -2
  84. package/src/job/job.ts +599 -3
  85. package/src/metadata/metadata.ts +2 -2
  86. package/src/options-mutator.ts +2 -2
  87. package/src/project/project.ts +5 -604
  88. package/src/task/task.ts +2 -2
  89. package/src/type/type.ts +2 -2
  90. package/src/user/user.ts +2 -2
  91. package/src/workflow/workflow.ts +5 -3
  92. package/task/task.cjs +6 -6
  93. package/task/task.cjs.map +1 -1
  94. package/task/task.js +1 -1
  95. package/task/task.js.map +1 -1
  96. package/type/type.cjs +3 -3
  97. package/type/type.cjs.map +1 -1
  98. package/type/type.js +1 -1
  99. package/type/type.js.map +1 -1
  100. package/user/user.cjs +10 -10
  101. package/user/user.cjs.map +1 -1
  102. package/user/user.js +1 -1
  103. package/user/user.js.map +1 -1
  104. package/workflow/workflow.cjs +20 -20
  105. package/workflow/workflow.cjs.map +1 -1
  106. package/workflow/workflow.d.cts +3 -1
  107. package/workflow/workflow.d.ts +3 -1
  108. package/workflow/workflow.js +1 -1
  109. package/workflow/workflow.js.map +1 -1
  110. package/chunk-OYRETEBZ.js.map +0 -1
  111. package/chunk-ZLY5XEOQ.cjs.map +0 -1
  112. package/exchange-rate/exchange-rate.cjs +0 -255
  113. package/exchange-rate/exchange-rate.cjs.map +0 -1
  114. package/exchange-rate/exchange-rate.d.cts +0 -319
  115. package/exchange-rate/exchange-rate.d.ts +0 -319
  116. package/exchange-rate/exchange-rate.js +0 -255
  117. package/exchange-rate/exchange-rate.js.map +0 -1
  118. package/exchange-rate/package.json +0 -7
  119. package/src/exchange-rate/exchange-rate.ts +0 -1276
@@ -1,1276 +0,0 @@
1
- /**
2
- * Generated by orval v7.10.0 🍺
3
- * Do not edit manually.
4
- * Dataset Manager API
5
- * The Dataset Manager API service.
6
-
7
- A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications**, **Jobs**, and **Workflows** using **Projects** and **Files**.
8
-
9
- * OpenAPI spec version: 4.1
10
- */
11
- import { useMutation, useQuery, useSuspenseQuery } from "@tanstack/react-query";
12
- import type {
13
- DataTag,
14
- DefinedInitialDataOptions,
15
- DefinedUseQueryResult,
16
- MutationFunction,
17
- QueryClient,
18
- QueryFunction,
19
- QueryKey,
20
- UndefinedInitialDataOptions,
21
- UseMutationOptions,
22
- UseMutationResult,
23
- UseQueryOptions,
24
- UseQueryResult,
25
- UseSuspenseQueryOptions,
26
- UseSuspenseQueryResult,
27
- } from "@tanstack/react-query";
28
-
29
- import type {
30
- DmError,
31
- ExchangeRatePutBodyBody,
32
- GetAllApplicationExchangeRatesParams,
33
- GetAllExchangeRatesResponse,
34
- GetAllJobExchangeRatesParams,
35
- GetApplicationExchangeRatesParams,
36
- GetExchangeRatesResponse,
37
- GetJobExchangeRatesParams,
38
- } from "../data-manager-api.schemas";
39
-
40
- import { customInstance } from ".././custom-instance";
41
- import type { ErrorType } from ".././custom-instance";
42
- import { queryMutator } from ".././options-mutator";
43
- import { mutationMutator } from ".././options-mutator";
44
-
45
- type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
46
-
47
- /**
48
- * 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.
49
-
50
- If an Application has no specific rate it adopts the current value of the default Application Exchange Rate.
51
-
52
- * @summary Gets Exchange Rates for all Applications
53
- */
54
- export const getAllApplicationExchangeRates = (
55
- params?: GetAllApplicationExchangeRatesParams,
56
- options?: SecondParameter<typeof customInstance>,
57
- signal?: AbortSignal,
58
- ) => {
59
- return customInstance<GetAllExchangeRatesResponse>(
60
- { url: `/application/exchange-rate`, method: "GET", params, signal },
61
- options,
62
- );
63
- };
64
-
65
- export const getGetAllApplicationExchangeRatesQueryKey = (
66
- params?: GetAllApplicationExchangeRatesParams,
67
- ) => {
68
- return [`/application/exchange-rate`, ...(params ? [params] : [])] as const;
69
- };
70
-
71
- export const useGetAllApplicationExchangeRatesQueryOptions = <
72
- TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
73
- TError = ErrorType<void | DmError>,
74
- >(
75
- params?: GetAllApplicationExchangeRatesParams,
76
- options?: {
77
- query?: Partial<
78
- UseQueryOptions<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError, TData>
79
- >;
80
- request?: SecondParameter<typeof customInstance>;
81
- },
82
- ) => {
83
- const { query: queryOptions, request: requestOptions } = options ?? {};
84
-
85
- const queryKey = queryOptions?.queryKey ?? getGetAllApplicationExchangeRatesQueryKey(params);
86
-
87
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>> = ({
88
- signal,
89
- }) => getAllApplicationExchangeRates(params, requestOptions, signal);
90
-
91
- const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
92
-
93
- return customOptions as UseQueryOptions<
94
- Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
95
- TError,
96
- TData
97
- > & { queryKey: DataTag<QueryKey, TData, TError> };
98
- };
99
-
100
- export type GetAllApplicationExchangeRatesQueryResult = NonNullable<
101
- Awaited<ReturnType<typeof getAllApplicationExchangeRates>>
102
- >;
103
- export type GetAllApplicationExchangeRatesQueryError = ErrorType<void | DmError>;
104
-
105
- export function useGetAllApplicationExchangeRates<
106
- TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
107
- TError = ErrorType<void | DmError>,
108
- >(
109
- params: undefined | GetAllApplicationExchangeRatesParams,
110
- options: {
111
- query: Partial<
112
- UseQueryOptions<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError, TData>
113
- > &
114
- Pick<
115
- DefinedInitialDataOptions<
116
- Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
117
- TError,
118
- Awaited<ReturnType<typeof getAllApplicationExchangeRates>>
119
- >,
120
- "initialData"
121
- >;
122
- request?: SecondParameter<typeof customInstance>;
123
- },
124
- queryClient?: QueryClient,
125
- ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
126
- export function useGetAllApplicationExchangeRates<
127
- TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
128
- TError = ErrorType<void | DmError>,
129
- >(
130
- params?: GetAllApplicationExchangeRatesParams,
131
- options?: {
132
- query?: Partial<
133
- UseQueryOptions<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError, TData>
134
- > &
135
- Pick<
136
- UndefinedInitialDataOptions<
137
- Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
138
- TError,
139
- Awaited<ReturnType<typeof getAllApplicationExchangeRates>>
140
- >,
141
- "initialData"
142
- >;
143
- request?: SecondParameter<typeof customInstance>;
144
- },
145
- queryClient?: QueryClient,
146
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
147
- export function useGetAllApplicationExchangeRates<
148
- TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
149
- TError = ErrorType<void | DmError>,
150
- >(
151
- params?: GetAllApplicationExchangeRatesParams,
152
- options?: {
153
- query?: Partial<
154
- UseQueryOptions<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError, TData>
155
- >;
156
- request?: SecondParameter<typeof customInstance>;
157
- },
158
- queryClient?: QueryClient,
159
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
160
- /**
161
- * @summary Gets Exchange Rates for all Applications
162
- */
163
-
164
- export function useGetAllApplicationExchangeRates<
165
- TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
166
- TError = ErrorType<void | DmError>,
167
- >(
168
- params?: GetAllApplicationExchangeRatesParams,
169
- options?: {
170
- query?: Partial<
171
- UseQueryOptions<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>, TError, TData>
172
- >;
173
- request?: SecondParameter<typeof customInstance>;
174
- },
175
- queryClient?: QueryClient,
176
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
177
- const queryOptions = useGetAllApplicationExchangeRatesQueryOptions(params, options);
178
-
179
- const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
180
- queryKey: DataTag<QueryKey, TData, TError>;
181
- };
182
-
183
- query.queryKey = queryOptions.queryKey;
184
-
185
- return query;
186
- }
187
-
188
- export const useGetAllApplicationExchangeRatesSuspenseQueryOptions = <
189
- TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
190
- TError = ErrorType<void | DmError>,
191
- >(
192
- params?: GetAllApplicationExchangeRatesParams,
193
- options?: {
194
- query?: Partial<
195
- UseSuspenseQueryOptions<
196
- Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
197
- TError,
198
- TData
199
- >
200
- >;
201
- request?: SecondParameter<typeof customInstance>;
202
- },
203
- ) => {
204
- const { query: queryOptions, request: requestOptions } = options ?? {};
205
-
206
- const queryKey = queryOptions?.queryKey ?? getGetAllApplicationExchangeRatesQueryKey(params);
207
-
208
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllApplicationExchangeRates>>> = ({
209
- signal,
210
- }) => getAllApplicationExchangeRates(params, requestOptions, signal);
211
-
212
- const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
213
-
214
- return customOptions as UseSuspenseQueryOptions<
215
- Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
216
- TError,
217
- TData
218
- > & { queryKey: DataTag<QueryKey, TData, TError> };
219
- };
220
-
221
- export type GetAllApplicationExchangeRatesSuspenseQueryResult = NonNullable<
222
- Awaited<ReturnType<typeof getAllApplicationExchangeRates>>
223
- >;
224
- export type GetAllApplicationExchangeRatesSuspenseQueryError = ErrorType<void | DmError>;
225
-
226
- export function useGetAllApplicationExchangeRatesSuspense<
227
- TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
228
- TError = ErrorType<void | DmError>,
229
- >(
230
- params: undefined | GetAllApplicationExchangeRatesParams,
231
- options: {
232
- query: Partial<
233
- UseSuspenseQueryOptions<
234
- Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
235
- TError,
236
- TData
237
- >
238
- >;
239
- request?: SecondParameter<typeof customInstance>;
240
- },
241
- queryClient?: QueryClient,
242
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
243
- export function useGetAllApplicationExchangeRatesSuspense<
244
- TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
245
- TError = ErrorType<void | DmError>,
246
- >(
247
- params?: GetAllApplicationExchangeRatesParams,
248
- options?: {
249
- query?: Partial<
250
- UseSuspenseQueryOptions<
251
- Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
252
- TError,
253
- TData
254
- >
255
- >;
256
- request?: SecondParameter<typeof customInstance>;
257
- },
258
- queryClient?: QueryClient,
259
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
260
- export function useGetAllApplicationExchangeRatesSuspense<
261
- TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
262
- TError = ErrorType<void | DmError>,
263
- >(
264
- params?: GetAllApplicationExchangeRatesParams,
265
- options?: {
266
- query?: Partial<
267
- UseSuspenseQueryOptions<
268
- Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
269
- TError,
270
- TData
271
- >
272
- >;
273
- request?: SecondParameter<typeof customInstance>;
274
- },
275
- queryClient?: QueryClient,
276
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
277
- /**
278
- * @summary Gets Exchange Rates for all Applications
279
- */
280
-
281
- export function useGetAllApplicationExchangeRatesSuspense<
282
- TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
283
- TError = ErrorType<void | DmError>,
284
- >(
285
- params?: GetAllApplicationExchangeRatesParams,
286
- options?: {
287
- query?: Partial<
288
- UseSuspenseQueryOptions<
289
- Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
290
- TError,
291
- TData
292
- >
293
- >;
294
- request?: SecondParameter<typeof customInstance>;
295
- },
296
- queryClient?: QueryClient,
297
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
298
- const queryOptions = useGetAllApplicationExchangeRatesSuspenseQueryOptions(params, options);
299
-
300
- const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
301
- TData,
302
- TError
303
- > & { queryKey: DataTag<QueryKey, TData, TError> };
304
-
305
- query.queryKey = queryOptions.queryKey;
306
-
307
- return query;
308
- }
309
-
310
- /**
311
- * 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.
312
-
313
- If an Application has no specific rate it adopts the current value of the default Application Exchange Rate.
314
-
315
- You need `admin` privilege to use this method.
316
-
317
- * @summary Sets the Exchange Rate for a specific Application
318
- */
319
- export const setApplicationExchangeRate = (
320
- applicationId: string,
321
- exchangeRatePutBodyBody: ExchangeRatePutBodyBody,
322
- options?: SecondParameter<typeof customInstance>,
323
- ) => {
324
- const formUrlEncoded = new URLSearchParams();
325
- formUrlEncoded.append(`rate`, exchangeRatePutBodyBody.rate);
326
- if (exchangeRatePutBodyBody.comment !== undefined) {
327
- formUrlEncoded.append(`comment`, exchangeRatePutBodyBody.comment);
328
- }
329
-
330
- return customInstance<void>(
331
- {
332
- url: `/application/${applicationId}/exchange-rate`,
333
- method: "PUT",
334
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
335
- data: formUrlEncoded,
336
- },
337
- options,
338
- );
339
- };
340
-
341
- export const useSetApplicationExchangeRateMutationOptions = <
342
- TError = ErrorType<void | DmError>,
343
- TContext = unknown,
344
- >(options?: {
345
- mutation?: UseMutationOptions<
346
- Awaited<ReturnType<typeof setApplicationExchangeRate>>,
347
- TError,
348
- { applicationId: string; data: ExchangeRatePutBodyBody },
349
- TContext
350
- >;
351
- request?: SecondParameter<typeof customInstance>;
352
- }): UseMutationOptions<
353
- Awaited<ReturnType<typeof setApplicationExchangeRate>>,
354
- TError,
355
- { applicationId: string; data: ExchangeRatePutBodyBody },
356
- TContext
357
- > => {
358
- const mutationKey = ["setApplicationExchangeRate"];
359
- const { mutation: mutationOptions, request: requestOptions } = options
360
- ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
361
- ? options
362
- : { ...options, mutation: { ...options.mutation, mutationKey } }
363
- : { mutation: { mutationKey }, request: undefined };
364
-
365
- const mutationFn: MutationFunction<
366
- Awaited<ReturnType<typeof setApplicationExchangeRate>>,
367
- { applicationId: string; data: ExchangeRatePutBodyBody }
368
- > = (props) => {
369
- const { applicationId, data } = props ?? {};
370
-
371
- return setApplicationExchangeRate(applicationId, data, requestOptions);
372
- };
373
-
374
- const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
375
-
376
- return customOptions;
377
- };
378
-
379
- export type SetApplicationExchangeRateMutationResult = NonNullable<
380
- Awaited<ReturnType<typeof setApplicationExchangeRate>>
381
- >;
382
- export type SetApplicationExchangeRateMutationBody = ExchangeRatePutBodyBody;
383
- export type SetApplicationExchangeRateMutationError = ErrorType<void | DmError>;
384
-
385
- /**
386
- * @summary Sets the Exchange Rate for a specific Application
387
- */
388
- export const useSetApplicationExchangeRate = <
389
- TError = ErrorType<void | DmError>,
390
- TContext = unknown,
391
- >(
392
- options?: {
393
- mutation?: UseMutationOptions<
394
- Awaited<ReturnType<typeof setApplicationExchangeRate>>,
395
- TError,
396
- { applicationId: string; data: ExchangeRatePutBodyBody },
397
- TContext
398
- >;
399
- request?: SecondParameter<typeof customInstance>;
400
- },
401
- queryClient?: QueryClient,
402
- ): UseMutationResult<
403
- Awaited<ReturnType<typeof setApplicationExchangeRate>>,
404
- TError,
405
- { applicationId: string; data: ExchangeRatePutBodyBody },
406
- TContext
407
- > => {
408
- const mutationOptions = useSetApplicationExchangeRateMutationOptions(options);
409
-
410
- return useMutation(mutationOptions, queryClient);
411
- };
412
- /**
413
- * 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.
414
-
415
- * @summary Gets the Application's Exchange Rate history
416
- */
417
- export const getApplicationExchangeRates = (
418
- applicationId: string,
419
- params?: GetApplicationExchangeRatesParams,
420
- options?: SecondParameter<typeof customInstance>,
421
- signal?: AbortSignal,
422
- ) => {
423
- return customInstance<GetExchangeRatesResponse>(
424
- { url: `/application/${applicationId}/exchange-rate`, method: "GET", params, signal },
425
- options,
426
- );
427
- };
428
-
429
- export const getGetApplicationExchangeRatesQueryKey = (
430
- applicationId: string,
431
- params?: GetApplicationExchangeRatesParams,
432
- ) => {
433
- return [`/application/${applicationId}/exchange-rate`, ...(params ? [params] : [])] as const;
434
- };
435
-
436
- export const useGetApplicationExchangeRatesQueryOptions = <
437
- TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>,
438
- TError = ErrorType<void | DmError>,
439
- >(
440
- applicationId: string,
441
- params?: GetApplicationExchangeRatesParams,
442
- options?: {
443
- query?: Partial<
444
- UseQueryOptions<Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError, TData>
445
- >;
446
- request?: SecondParameter<typeof customInstance>;
447
- },
448
- ) => {
449
- const { query: queryOptions, request: requestOptions } = options ?? {};
450
-
451
- const queryKey =
452
- queryOptions?.queryKey ?? getGetApplicationExchangeRatesQueryKey(applicationId, params);
453
-
454
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getApplicationExchangeRates>>> = ({
455
- signal,
456
- }) => getApplicationExchangeRates(applicationId, params, requestOptions, signal);
457
-
458
- const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
459
-
460
- return customOptions as UseQueryOptions<
461
- Awaited<ReturnType<typeof getApplicationExchangeRates>>,
462
- TError,
463
- TData
464
- > & { queryKey: DataTag<QueryKey, TData, TError> };
465
- };
466
-
467
- export type GetApplicationExchangeRatesQueryResult = NonNullable<
468
- Awaited<ReturnType<typeof getApplicationExchangeRates>>
469
- >;
470
- export type GetApplicationExchangeRatesQueryError = ErrorType<void | DmError>;
471
-
472
- export function useGetApplicationExchangeRates<
473
- TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>,
474
- TError = ErrorType<void | DmError>,
475
- >(
476
- applicationId: string,
477
- params: undefined | GetApplicationExchangeRatesParams,
478
- options: {
479
- query: Partial<
480
- UseQueryOptions<Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError, TData>
481
- > &
482
- Pick<
483
- DefinedInitialDataOptions<
484
- Awaited<ReturnType<typeof getApplicationExchangeRates>>,
485
- TError,
486
- Awaited<ReturnType<typeof getApplicationExchangeRates>>
487
- >,
488
- "initialData"
489
- >;
490
- request?: SecondParameter<typeof customInstance>;
491
- },
492
- queryClient?: QueryClient,
493
- ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
494
- export function useGetApplicationExchangeRates<
495
- TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>,
496
- TError = ErrorType<void | DmError>,
497
- >(
498
- applicationId: string,
499
- params?: GetApplicationExchangeRatesParams,
500
- options?: {
501
- query?: Partial<
502
- UseQueryOptions<Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError, TData>
503
- > &
504
- Pick<
505
- UndefinedInitialDataOptions<
506
- Awaited<ReturnType<typeof getApplicationExchangeRates>>,
507
- TError,
508
- Awaited<ReturnType<typeof getApplicationExchangeRates>>
509
- >,
510
- "initialData"
511
- >;
512
- request?: SecondParameter<typeof customInstance>;
513
- },
514
- queryClient?: QueryClient,
515
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
516
- export function useGetApplicationExchangeRates<
517
- TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>,
518
- TError = ErrorType<void | DmError>,
519
- >(
520
- applicationId: string,
521
- params?: GetApplicationExchangeRatesParams,
522
- options?: {
523
- query?: Partial<
524
- UseQueryOptions<Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError, TData>
525
- >;
526
- request?: SecondParameter<typeof customInstance>;
527
- },
528
- queryClient?: QueryClient,
529
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
530
- /**
531
- * @summary Gets the Application's Exchange Rate history
532
- */
533
-
534
- export function useGetApplicationExchangeRates<
535
- TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>,
536
- TError = ErrorType<void | DmError>,
537
- >(
538
- applicationId: string,
539
- params?: GetApplicationExchangeRatesParams,
540
- options?: {
541
- query?: Partial<
542
- UseQueryOptions<Awaited<ReturnType<typeof getApplicationExchangeRates>>, TError, TData>
543
- >;
544
- request?: SecondParameter<typeof customInstance>;
545
- },
546
- queryClient?: QueryClient,
547
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
548
- const queryOptions = useGetApplicationExchangeRatesQueryOptions(applicationId, params, options);
549
-
550
- const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
551
- queryKey: DataTag<QueryKey, TData, TError>;
552
- };
553
-
554
- query.queryKey = queryOptions.queryKey;
555
-
556
- return query;
557
- }
558
-
559
- export const useGetApplicationExchangeRatesSuspenseQueryOptions = <
560
- TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>,
561
- TError = ErrorType<void | DmError>,
562
- >(
563
- applicationId: string,
564
- params?: GetApplicationExchangeRatesParams,
565
- options?: {
566
- query?: Partial<
567
- UseSuspenseQueryOptions<
568
- Awaited<ReturnType<typeof getApplicationExchangeRates>>,
569
- TError,
570
- TData
571
- >
572
- >;
573
- request?: SecondParameter<typeof customInstance>;
574
- },
575
- ) => {
576
- const { query: queryOptions, request: requestOptions } = options ?? {};
577
-
578
- const queryKey =
579
- queryOptions?.queryKey ?? getGetApplicationExchangeRatesQueryKey(applicationId, params);
580
-
581
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getApplicationExchangeRates>>> = ({
582
- signal,
583
- }) => getApplicationExchangeRates(applicationId, params, requestOptions, signal);
584
-
585
- const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
586
-
587
- return customOptions as UseSuspenseQueryOptions<
588
- Awaited<ReturnType<typeof getApplicationExchangeRates>>,
589
- TError,
590
- TData
591
- > & { queryKey: DataTag<QueryKey, TData, TError> };
592
- };
593
-
594
- export type GetApplicationExchangeRatesSuspenseQueryResult = NonNullable<
595
- Awaited<ReturnType<typeof getApplicationExchangeRates>>
596
- >;
597
- export type GetApplicationExchangeRatesSuspenseQueryError = ErrorType<void | DmError>;
598
-
599
- export function useGetApplicationExchangeRatesSuspense<
600
- TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>,
601
- TError = ErrorType<void | DmError>,
602
- >(
603
- applicationId: string,
604
- params: undefined | GetApplicationExchangeRatesParams,
605
- options: {
606
- query: Partial<
607
- UseSuspenseQueryOptions<
608
- Awaited<ReturnType<typeof getApplicationExchangeRates>>,
609
- TError,
610
- TData
611
- >
612
- >;
613
- request?: SecondParameter<typeof customInstance>;
614
- },
615
- queryClient?: QueryClient,
616
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
617
- export function useGetApplicationExchangeRatesSuspense<
618
- TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>,
619
- TError = ErrorType<void | DmError>,
620
- >(
621
- applicationId: string,
622
- params?: GetApplicationExchangeRatesParams,
623
- options?: {
624
- query?: Partial<
625
- UseSuspenseQueryOptions<
626
- Awaited<ReturnType<typeof getApplicationExchangeRates>>,
627
- TError,
628
- TData
629
- >
630
- >;
631
- request?: SecondParameter<typeof customInstance>;
632
- },
633
- queryClient?: QueryClient,
634
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
635
- export function useGetApplicationExchangeRatesSuspense<
636
- TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>,
637
- TError = ErrorType<void | DmError>,
638
- >(
639
- applicationId: string,
640
- params?: GetApplicationExchangeRatesParams,
641
- options?: {
642
- query?: Partial<
643
- UseSuspenseQueryOptions<
644
- Awaited<ReturnType<typeof getApplicationExchangeRates>>,
645
- TError,
646
- TData
647
- >
648
- >;
649
- request?: SecondParameter<typeof customInstance>;
650
- },
651
- queryClient?: QueryClient,
652
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
653
- /**
654
- * @summary Gets the Application's Exchange Rate history
655
- */
656
-
657
- export function useGetApplicationExchangeRatesSuspense<
658
- TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>,
659
- TError = ErrorType<void | DmError>,
660
- >(
661
- applicationId: string,
662
- params?: GetApplicationExchangeRatesParams,
663
- options?: {
664
- query?: Partial<
665
- UseSuspenseQueryOptions<
666
- Awaited<ReturnType<typeof getApplicationExchangeRates>>,
667
- TError,
668
- TData
669
- >
670
- >;
671
- request?: SecondParameter<typeof customInstance>;
672
- },
673
- queryClient?: QueryClient,
674
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
675
- const queryOptions = useGetApplicationExchangeRatesSuspenseQueryOptions(
676
- applicationId,
677
- params,
678
- options,
679
- );
680
-
681
- const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
682
- TData,
683
- TError
684
- > & { queryKey: DataTag<QueryKey, TData, TError> };
685
-
686
- query.queryKey = queryOptions.queryKey;
687
-
688
- return query;
689
- }
690
-
691
- /**
692
- * 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.
693
-
694
- * @summary Gets Exchange Rates for all Jobs
695
- */
696
- export const getAllJobExchangeRates = (
697
- params?: GetAllJobExchangeRatesParams,
698
- options?: SecondParameter<typeof customInstance>,
699
- signal?: AbortSignal,
700
- ) => {
701
- return customInstance<GetAllExchangeRatesResponse>(
702
- { url: `/job/exchange-rate`, method: "GET", params, signal },
703
- options,
704
- );
705
- };
706
-
707
- export const getGetAllJobExchangeRatesQueryKey = (params?: GetAllJobExchangeRatesParams) => {
708
- return [`/job/exchange-rate`, ...(params ? [params] : [])] as const;
709
- };
710
-
711
- export const useGetAllJobExchangeRatesQueryOptions = <
712
- TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>,
713
- TError = ErrorType<void | DmError>,
714
- >(
715
- params?: GetAllJobExchangeRatesParams,
716
- options?: {
717
- query?: Partial<
718
- UseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>
719
- >;
720
- request?: SecondParameter<typeof customInstance>;
721
- },
722
- ) => {
723
- const { query: queryOptions, request: requestOptions } = options ?? {};
724
-
725
- const queryKey = queryOptions?.queryKey ?? getGetAllJobExchangeRatesQueryKey(params);
726
-
727
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllJobExchangeRates>>> = ({ signal }) =>
728
- getAllJobExchangeRates(params, requestOptions, signal);
729
-
730
- const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
731
-
732
- return customOptions as UseQueryOptions<
733
- Awaited<ReturnType<typeof getAllJobExchangeRates>>,
734
- TError,
735
- TData
736
- > & { queryKey: DataTag<QueryKey, TData, TError> };
737
- };
738
-
739
- export type GetAllJobExchangeRatesQueryResult = NonNullable<
740
- Awaited<ReturnType<typeof getAllJobExchangeRates>>
741
- >;
742
- export type GetAllJobExchangeRatesQueryError = ErrorType<void | DmError>;
743
-
744
- export function useGetAllJobExchangeRates<
745
- TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>,
746
- TError = ErrorType<void | DmError>,
747
- >(
748
- params: undefined | GetAllJobExchangeRatesParams,
749
- options: {
750
- query: Partial<
751
- UseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>
752
- > &
753
- Pick<
754
- DefinedInitialDataOptions<
755
- Awaited<ReturnType<typeof getAllJobExchangeRates>>,
756
- TError,
757
- Awaited<ReturnType<typeof getAllJobExchangeRates>>
758
- >,
759
- "initialData"
760
- >;
761
- request?: SecondParameter<typeof customInstance>;
762
- },
763
- queryClient?: QueryClient,
764
- ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
765
- export function useGetAllJobExchangeRates<
766
- TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>,
767
- TError = ErrorType<void | DmError>,
768
- >(
769
- params?: GetAllJobExchangeRatesParams,
770
- options?: {
771
- query?: Partial<
772
- UseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>
773
- > &
774
- Pick<
775
- UndefinedInitialDataOptions<
776
- Awaited<ReturnType<typeof getAllJobExchangeRates>>,
777
- TError,
778
- Awaited<ReturnType<typeof getAllJobExchangeRates>>
779
- >,
780
- "initialData"
781
- >;
782
- request?: SecondParameter<typeof customInstance>;
783
- },
784
- queryClient?: QueryClient,
785
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
786
- export function useGetAllJobExchangeRates<
787
- TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>,
788
- TError = ErrorType<void | DmError>,
789
- >(
790
- params?: GetAllJobExchangeRatesParams,
791
- options?: {
792
- query?: Partial<
793
- UseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>
794
- >;
795
- request?: SecondParameter<typeof customInstance>;
796
- },
797
- queryClient?: QueryClient,
798
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
799
- /**
800
- * @summary Gets Exchange Rates for all Jobs
801
- */
802
-
803
- export function useGetAllJobExchangeRates<
804
- TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>,
805
- TError = ErrorType<void | DmError>,
806
- >(
807
- params?: GetAllJobExchangeRatesParams,
808
- options?: {
809
- query?: Partial<
810
- UseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>
811
- >;
812
- request?: SecondParameter<typeof customInstance>;
813
- },
814
- queryClient?: QueryClient,
815
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
816
- const queryOptions = useGetAllJobExchangeRatesQueryOptions(params, options);
817
-
818
- const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
819
- queryKey: DataTag<QueryKey, TData, TError>;
820
- };
821
-
822
- query.queryKey = queryOptions.queryKey;
823
-
824
- return query;
825
- }
826
-
827
- export const useGetAllJobExchangeRatesSuspenseQueryOptions = <
828
- TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>,
829
- TError = ErrorType<void | DmError>,
830
- >(
831
- params?: GetAllJobExchangeRatesParams,
832
- options?: {
833
- query?: Partial<
834
- UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>
835
- >;
836
- request?: SecondParameter<typeof customInstance>;
837
- },
838
- ) => {
839
- const { query: queryOptions, request: requestOptions } = options ?? {};
840
-
841
- const queryKey = queryOptions?.queryKey ?? getGetAllJobExchangeRatesQueryKey(params);
842
-
843
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllJobExchangeRates>>> = ({ signal }) =>
844
- getAllJobExchangeRates(params, requestOptions, signal);
845
-
846
- const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
847
-
848
- return customOptions as UseSuspenseQueryOptions<
849
- Awaited<ReturnType<typeof getAllJobExchangeRates>>,
850
- TError,
851
- TData
852
- > & { queryKey: DataTag<QueryKey, TData, TError> };
853
- };
854
-
855
- export type GetAllJobExchangeRatesSuspenseQueryResult = NonNullable<
856
- Awaited<ReturnType<typeof getAllJobExchangeRates>>
857
- >;
858
- export type GetAllJobExchangeRatesSuspenseQueryError = ErrorType<void | DmError>;
859
-
860
- export function useGetAllJobExchangeRatesSuspense<
861
- TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>,
862
- TError = ErrorType<void | DmError>,
863
- >(
864
- params: undefined | GetAllJobExchangeRatesParams,
865
- options: {
866
- query: Partial<
867
- UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>
868
- >;
869
- request?: SecondParameter<typeof customInstance>;
870
- },
871
- queryClient?: QueryClient,
872
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
873
- export function useGetAllJobExchangeRatesSuspense<
874
- TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>,
875
- TError = ErrorType<void | DmError>,
876
- >(
877
- params?: GetAllJobExchangeRatesParams,
878
- options?: {
879
- query?: Partial<
880
- UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>
881
- >;
882
- request?: SecondParameter<typeof customInstance>;
883
- },
884
- queryClient?: QueryClient,
885
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
886
- export function useGetAllJobExchangeRatesSuspense<
887
- TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>,
888
- TError = ErrorType<void | DmError>,
889
- >(
890
- params?: GetAllJobExchangeRatesParams,
891
- options?: {
892
- query?: Partial<
893
- UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>
894
- >;
895
- request?: SecondParameter<typeof customInstance>;
896
- },
897
- queryClient?: QueryClient,
898
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
899
- /**
900
- * @summary Gets Exchange Rates for all Jobs
901
- */
902
-
903
- export function useGetAllJobExchangeRatesSuspense<
904
- TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>,
905
- TError = ErrorType<void | DmError>,
906
- >(
907
- params?: GetAllJobExchangeRatesParams,
908
- options?: {
909
- query?: Partial<
910
- UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllJobExchangeRates>>, TError, TData>
911
- >;
912
- request?: SecondParameter<typeof customInstance>;
913
- },
914
- queryClient?: QueryClient,
915
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
916
- const queryOptions = useGetAllJobExchangeRatesSuspenseQueryOptions(params, options);
917
-
918
- const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
919
- TData,
920
- TError
921
- > & { queryKey: DataTag<QueryKey, TData, TError> };
922
-
923
- query.queryKey = queryOptions.queryKey;
924
-
925
- return query;
926
- }
927
-
928
- /**
929
- * 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.
930
-
931
- 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'.
932
-
933
- If a Job has no specific rate it adopts the current value of the default Job Exchange Rate.
934
-
935
- You need `admin` privilege to use this method.
936
-
937
- * @summary Sets the Exchange Rate for a specific Job
938
- */
939
- export const setJobPricing = (
940
- jobId: number,
941
- exchangeRatePutBodyBody: ExchangeRatePutBodyBody,
942
- options?: SecondParameter<typeof customInstance>,
943
- ) => {
944
- const formUrlEncoded = new URLSearchParams();
945
- formUrlEncoded.append(`rate`, exchangeRatePutBodyBody.rate);
946
- if (exchangeRatePutBodyBody.comment !== undefined) {
947
- formUrlEncoded.append(`comment`, exchangeRatePutBodyBody.comment);
948
- }
949
-
950
- return customInstance<void>(
951
- {
952
- url: `/job/${jobId}/exchange-rate`,
953
- method: "PUT",
954
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
955
- data: formUrlEncoded,
956
- },
957
- options,
958
- );
959
- };
960
-
961
- export const useSetJobPricingMutationOptions = <
962
- TError = ErrorType<void | DmError>,
963
- TContext = unknown,
964
- >(options?: {
965
- mutation?: UseMutationOptions<
966
- Awaited<ReturnType<typeof setJobPricing>>,
967
- TError,
968
- { jobId: number; data: ExchangeRatePutBodyBody },
969
- TContext
970
- >;
971
- request?: SecondParameter<typeof customInstance>;
972
- }): UseMutationOptions<
973
- Awaited<ReturnType<typeof setJobPricing>>,
974
- TError,
975
- { jobId: number; data: ExchangeRatePutBodyBody },
976
- TContext
977
- > => {
978
- const mutationKey = ["setJobPricing"];
979
- const { mutation: mutationOptions, request: requestOptions } = options
980
- ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
981
- ? options
982
- : { ...options, mutation: { ...options.mutation, mutationKey } }
983
- : { mutation: { mutationKey }, request: undefined };
984
-
985
- const mutationFn: MutationFunction<
986
- Awaited<ReturnType<typeof setJobPricing>>,
987
- { jobId: number; data: ExchangeRatePutBodyBody }
988
- > = (props) => {
989
- const { jobId, data } = props ?? {};
990
-
991
- return setJobPricing(jobId, data, requestOptions);
992
- };
993
-
994
- const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
995
-
996
- return customOptions;
997
- };
998
-
999
- export type SetJobPricingMutationResult = NonNullable<Awaited<ReturnType<typeof setJobPricing>>>;
1000
- export type SetJobPricingMutationBody = ExchangeRatePutBodyBody;
1001
- export type SetJobPricingMutationError = ErrorType<void | DmError>;
1002
-
1003
- /**
1004
- * @summary Sets the Exchange Rate for a specific Job
1005
- */
1006
- export const useSetJobPricing = <TError = ErrorType<void | DmError>, TContext = unknown>(
1007
- options?: {
1008
- mutation?: UseMutationOptions<
1009
- Awaited<ReturnType<typeof setJobPricing>>,
1010
- TError,
1011
- { jobId: number; data: ExchangeRatePutBodyBody },
1012
- TContext
1013
- >;
1014
- request?: SecondParameter<typeof customInstance>;
1015
- },
1016
- queryClient?: QueryClient,
1017
- ): UseMutationResult<
1018
- Awaited<ReturnType<typeof setJobPricing>>,
1019
- TError,
1020
- { jobId: number; data: ExchangeRatePutBodyBody },
1021
- TContext
1022
- > => {
1023
- const mutationOptions = useSetJobPricingMutationOptions(options);
1024
-
1025
- return useMutation(mutationOptions, queryClient);
1026
- };
1027
- /**
1028
- * 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.
1029
-
1030
- * @summary Gets Job Exchange Rates
1031
- */
1032
- export const getJobExchangeRates = (
1033
- jobId: number,
1034
- params?: GetJobExchangeRatesParams,
1035
- options?: SecondParameter<typeof customInstance>,
1036
- signal?: AbortSignal,
1037
- ) => {
1038
- return customInstance<GetExchangeRatesResponse>(
1039
- { url: `/job/${jobId}/exchange-rate`, method: "GET", params, signal },
1040
- options,
1041
- );
1042
- };
1043
-
1044
- export const getGetJobExchangeRatesQueryKey = (
1045
- jobId: number,
1046
- params?: GetJobExchangeRatesParams,
1047
- ) => {
1048
- return [`/job/${jobId}/exchange-rate`, ...(params ? [params] : [])] as const;
1049
- };
1050
-
1051
- export const useGetJobExchangeRatesQueryOptions = <
1052
- TData = Awaited<ReturnType<typeof getJobExchangeRates>>,
1053
- TError = ErrorType<void | DmError>,
1054
- >(
1055
- jobId: number,
1056
- params?: GetJobExchangeRatesParams,
1057
- options?: {
1058
- query?: Partial<
1059
- UseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>
1060
- >;
1061
- request?: SecondParameter<typeof customInstance>;
1062
- },
1063
- ) => {
1064
- const { query: queryOptions, request: requestOptions } = options ?? {};
1065
-
1066
- const queryKey = queryOptions?.queryKey ?? getGetJobExchangeRatesQueryKey(jobId, params);
1067
-
1068
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobExchangeRates>>> = ({ signal }) =>
1069
- getJobExchangeRates(jobId, params, requestOptions, signal);
1070
-
1071
- const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
1072
-
1073
- return customOptions as UseQueryOptions<
1074
- Awaited<ReturnType<typeof getJobExchangeRates>>,
1075
- TError,
1076
- TData
1077
- > & { queryKey: DataTag<QueryKey, TData, TError> };
1078
- };
1079
-
1080
- export type GetJobExchangeRatesQueryResult = NonNullable<
1081
- Awaited<ReturnType<typeof getJobExchangeRates>>
1082
- >;
1083
- export type GetJobExchangeRatesQueryError = ErrorType<void | DmError>;
1084
-
1085
- export function useGetJobExchangeRates<
1086
- TData = Awaited<ReturnType<typeof getJobExchangeRates>>,
1087
- TError = ErrorType<void | DmError>,
1088
- >(
1089
- jobId: number,
1090
- params: undefined | GetJobExchangeRatesParams,
1091
- options: {
1092
- query: Partial<
1093
- UseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>
1094
- > &
1095
- Pick<
1096
- DefinedInitialDataOptions<
1097
- Awaited<ReturnType<typeof getJobExchangeRates>>,
1098
- TError,
1099
- Awaited<ReturnType<typeof getJobExchangeRates>>
1100
- >,
1101
- "initialData"
1102
- >;
1103
- request?: SecondParameter<typeof customInstance>;
1104
- },
1105
- queryClient?: QueryClient,
1106
- ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
1107
- export function useGetJobExchangeRates<
1108
- TData = Awaited<ReturnType<typeof getJobExchangeRates>>,
1109
- TError = ErrorType<void | DmError>,
1110
- >(
1111
- jobId: number,
1112
- params?: GetJobExchangeRatesParams,
1113
- options?: {
1114
- query?: Partial<
1115
- UseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>
1116
- > &
1117
- Pick<
1118
- UndefinedInitialDataOptions<
1119
- Awaited<ReturnType<typeof getJobExchangeRates>>,
1120
- TError,
1121
- Awaited<ReturnType<typeof getJobExchangeRates>>
1122
- >,
1123
- "initialData"
1124
- >;
1125
- request?: SecondParameter<typeof customInstance>;
1126
- },
1127
- queryClient?: QueryClient,
1128
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
1129
- export function useGetJobExchangeRates<
1130
- TData = Awaited<ReturnType<typeof getJobExchangeRates>>,
1131
- TError = ErrorType<void | DmError>,
1132
- >(
1133
- jobId: number,
1134
- params?: GetJobExchangeRatesParams,
1135
- options?: {
1136
- query?: Partial<
1137
- UseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>
1138
- >;
1139
- request?: SecondParameter<typeof customInstance>;
1140
- },
1141
- queryClient?: QueryClient,
1142
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
1143
- /**
1144
- * @summary Gets Job Exchange Rates
1145
- */
1146
-
1147
- export function useGetJobExchangeRates<
1148
- TData = Awaited<ReturnType<typeof getJobExchangeRates>>,
1149
- TError = ErrorType<void | DmError>,
1150
- >(
1151
- jobId: number,
1152
- params?: GetJobExchangeRatesParams,
1153
- options?: {
1154
- query?: Partial<
1155
- UseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>
1156
- >;
1157
- request?: SecondParameter<typeof customInstance>;
1158
- },
1159
- queryClient?: QueryClient,
1160
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
1161
- const queryOptions = useGetJobExchangeRatesQueryOptions(jobId, params, options);
1162
-
1163
- const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
1164
- queryKey: DataTag<QueryKey, TData, TError>;
1165
- };
1166
-
1167
- query.queryKey = queryOptions.queryKey;
1168
-
1169
- return query;
1170
- }
1171
-
1172
- export const useGetJobExchangeRatesSuspenseQueryOptions = <
1173
- TData = Awaited<ReturnType<typeof getJobExchangeRates>>,
1174
- TError = ErrorType<void | DmError>,
1175
- >(
1176
- jobId: number,
1177
- params?: GetJobExchangeRatesParams,
1178
- options?: {
1179
- query?: Partial<
1180
- UseSuspenseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>
1181
- >;
1182
- request?: SecondParameter<typeof customInstance>;
1183
- },
1184
- ) => {
1185
- const { query: queryOptions, request: requestOptions } = options ?? {};
1186
-
1187
- const queryKey = queryOptions?.queryKey ?? getGetJobExchangeRatesQueryKey(jobId, params);
1188
-
1189
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobExchangeRates>>> = ({ signal }) =>
1190
- getJobExchangeRates(jobId, params, requestOptions, signal);
1191
-
1192
- const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
1193
-
1194
- return customOptions as UseSuspenseQueryOptions<
1195
- Awaited<ReturnType<typeof getJobExchangeRates>>,
1196
- TError,
1197
- TData
1198
- > & { queryKey: DataTag<QueryKey, TData, TError> };
1199
- };
1200
-
1201
- export type GetJobExchangeRatesSuspenseQueryResult = NonNullable<
1202
- Awaited<ReturnType<typeof getJobExchangeRates>>
1203
- >;
1204
- export type GetJobExchangeRatesSuspenseQueryError = ErrorType<void | DmError>;
1205
-
1206
- export function useGetJobExchangeRatesSuspense<
1207
- TData = Awaited<ReturnType<typeof getJobExchangeRates>>,
1208
- TError = ErrorType<void | DmError>,
1209
- >(
1210
- jobId: number,
1211
- params: undefined | GetJobExchangeRatesParams,
1212
- options: {
1213
- query: Partial<
1214
- UseSuspenseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>
1215
- >;
1216
- request?: SecondParameter<typeof customInstance>;
1217
- },
1218
- queryClient?: QueryClient,
1219
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
1220
- export function useGetJobExchangeRatesSuspense<
1221
- TData = Awaited<ReturnType<typeof getJobExchangeRates>>,
1222
- TError = ErrorType<void | DmError>,
1223
- >(
1224
- jobId: number,
1225
- params?: GetJobExchangeRatesParams,
1226
- options?: {
1227
- query?: Partial<
1228
- UseSuspenseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>
1229
- >;
1230
- request?: SecondParameter<typeof customInstance>;
1231
- },
1232
- queryClient?: QueryClient,
1233
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
1234
- export function useGetJobExchangeRatesSuspense<
1235
- TData = Awaited<ReturnType<typeof getJobExchangeRates>>,
1236
- TError = ErrorType<void | DmError>,
1237
- >(
1238
- jobId: number,
1239
- params?: GetJobExchangeRatesParams,
1240
- options?: {
1241
- query?: Partial<
1242
- UseSuspenseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>
1243
- >;
1244
- request?: SecondParameter<typeof customInstance>;
1245
- },
1246
- queryClient?: QueryClient,
1247
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
1248
- /**
1249
- * @summary Gets Job Exchange Rates
1250
- */
1251
-
1252
- export function useGetJobExchangeRatesSuspense<
1253
- TData = Awaited<ReturnType<typeof getJobExchangeRates>>,
1254
- TError = ErrorType<void | DmError>,
1255
- >(
1256
- jobId: number,
1257
- params?: GetJobExchangeRatesParams,
1258
- options?: {
1259
- query?: Partial<
1260
- UseSuspenseQueryOptions<Awaited<ReturnType<typeof getJobExchangeRates>>, TError, TData>
1261
- >;
1262
- request?: SecondParameter<typeof customInstance>;
1263
- },
1264
- queryClient?: QueryClient,
1265
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
1266
- const queryOptions = useGetJobExchangeRatesSuspenseQueryOptions(jobId, params, options);
1267
-
1268
- const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
1269
- TData,
1270
- TError
1271
- > & { queryKey: DataTag<QueryKey, TData, TError> };
1272
-
1273
- query.queryKey = queryOptions.queryKey;
1274
-
1275
- return query;
1276
- }