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