@squonk/data-manager-client 0.7.20 → 1.0.0-rc.2
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 +18 -5
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.ts +1 -1
- package/accounting/accounting.js +18 -5
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +48 -24
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +5 -5
- package/admin/admin.js +48 -24
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +13 -7
- package/application/application.cjs.map +1 -1
- package/application/application.d.ts +1 -1
- package/application/application.js +13 -7
- package/application/application.js.map +1 -1
- package/chunk-3O5KIRV4.js +27 -0
- package/{chunk-3TENYKS7.js.map → chunk-3O5KIRV4.js.map} +1 -1
- package/chunk-IUEU2LYC.cjs +27 -0
- package/chunk-IUEU2LYC.cjs.map +1 -0
- package/{custom-instance-cf29ab06.d.ts → custom-instance-b2f7dca1.d.ts} +132 -45
- package/dataset/dataset.cjs +92 -44
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +2 -2
- package/dataset/dataset.js +92 -44
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs +144 -0
- package/exchange-rate/exchange-rate.cjs.map +1 -0
- package/exchange-rate/exchange-rate.d.ts +116 -0
- package/exchange-rate/exchange-rate.js +144 -0
- package/exchange-rate/exchange-rate.js.map +1 -0
- package/exchange-rate/package.json +7 -0
- package/file/file.cjs +39 -17
- package/file/file.cjs.map +1 -1
- package/file/file.d.ts +2 -2
- package/file/file.js +39 -17
- package/file/file.js.map +1 -1
- package/index.cjs +2 -2
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs +44 -18
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.ts +5 -5
- package/instance/instance.js +44 -18
- package/instance/instance.js.map +1 -1
- package/job/job.cjs +30 -14
- package/job/job.cjs.map +1 -1
- package/job/job.d.ts +9 -9
- package/job/job.js +32 -16
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +43 -27
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.ts +1 -1
- package/metadata/metadata.js +43 -27
- package/metadata/metadata.js.map +1 -1
- package/package.json +1 -1
- package/project/project.cjs +74 -39
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +3 -3
- package/project/project.js +74 -39
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +1 -1
- package/src/admin/admin.ts +5 -5
- package/src/application/application.ts +1 -1
- package/src/data-manager-api.schemas.ts +145 -44
- package/src/dataset/dataset.ts +2 -2
- package/src/exchange-rate/exchange-rate.ts +440 -0
- package/src/file/file.ts +2 -2
- package/src/instance/instance.ts +11 -9
- package/src/job/job.ts +20 -20
- package/src/metadata/metadata.ts +1 -1
- package/src/project/project.ts +3 -3
- package/src/task/task.ts +1 -1
- package/src/type/type.ts +1 -1
- package/src/user/user.ts +1 -1
- package/task/task.cjs +23 -7
- package/task/task.cjs.map +1 -1
- package/task/task.d.ts +1 -1
- package/task/task.js +23 -7
- package/task/task.js.map +1 -1
- package/type/type.cjs +5 -2
- package/type/type.cjs.map +1 -1
- package/type/type.d.ts +1 -1
- package/type/type.js +5 -2
- package/type/type.js.map +1 -1
- package/user/user.cjs +35 -13
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +1 -1
- package/user/user.js +35 -13
- package/user/user.js.map +1 -1
- package/chunk-3TENYKS7.js +0 -46
- package/chunk-RHHRF25R.cjs +0 -46
- package/chunk-RHHRF25R.cjs.map +0 -1
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v6.9.1 🍺
|
|
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** and **Jobs** using **Projects** and **Files**.
|
|
8
|
+
|
|
9
|
+
* OpenAPI spec version: 1.0
|
|
10
|
+
*/
|
|
11
|
+
import { useQuery, useMutation } from "react-query";
|
|
12
|
+
import type {
|
|
13
|
+
UseQueryOptions,
|
|
14
|
+
UseMutationOptions,
|
|
15
|
+
QueryFunction,
|
|
16
|
+
MutationFunction,
|
|
17
|
+
UseQueryResult,
|
|
18
|
+
QueryKey,
|
|
19
|
+
} from "react-query";
|
|
20
|
+
import type {
|
|
21
|
+
GetAllExchangeRatesResponse,
|
|
22
|
+
DmError,
|
|
23
|
+
GetAllApplicationExchangeRatesParams,
|
|
24
|
+
ExchangeRatePutBodyBody,
|
|
25
|
+
GetExchangeRatesResponse,
|
|
26
|
+
GetApplicationExchangeRatesParams,
|
|
27
|
+
GetAllJobExchangeRatesParams,
|
|
28
|
+
GetJobExchangeRatesParams,
|
|
29
|
+
} from "../data-manager-api.schemas";
|
|
30
|
+
import { customInstance } from ".././custom-instance";
|
|
31
|
+
import type { ErrorType } from ".././custom-instance";
|
|
32
|
+
|
|
33
|
+
// eslint-disable-next-line
|
|
34
|
+
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
35
|
+
config: any,
|
|
36
|
+
args: infer P
|
|
37
|
+
) => any
|
|
38
|
+
? P
|
|
39
|
+
: never;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 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.
|
|
43
|
+
|
|
44
|
+
If an Application has no specific rate it adopts the current value of the default Application Exchange Rate.
|
|
45
|
+
|
|
46
|
+
* @summary Gets Exchange Rates for all Applications
|
|
47
|
+
*/
|
|
48
|
+
export const getAllApplicationExchangeRates = (
|
|
49
|
+
params?: GetAllApplicationExchangeRatesParams,
|
|
50
|
+
options?: SecondParameter<typeof customInstance>,
|
|
51
|
+
signal?: AbortSignal
|
|
52
|
+
) => {
|
|
53
|
+
return customInstance<GetAllExchangeRatesResponse>(
|
|
54
|
+
{ url: `/application/exchange-rate`, method: "get", params, signal },
|
|
55
|
+
options
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const getGetAllApplicationExchangeRatesQueryKey = (
|
|
60
|
+
params?: GetAllApplicationExchangeRatesParams
|
|
61
|
+
) => [`/application/exchange-rate`, ...(params ? [params] : [])];
|
|
62
|
+
|
|
63
|
+
export type GetAllApplicationExchangeRatesQueryResult = NonNullable<
|
|
64
|
+
Awaited<ReturnType<typeof getAllApplicationExchangeRates>>
|
|
65
|
+
>;
|
|
66
|
+
export type GetAllApplicationExchangeRatesQueryError =
|
|
67
|
+
ErrorType<void | DmError>;
|
|
68
|
+
|
|
69
|
+
export const useGetAllApplicationExchangeRates = <
|
|
70
|
+
TData = Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
|
|
71
|
+
TError = ErrorType<void | DmError>
|
|
72
|
+
>(
|
|
73
|
+
params?: GetAllApplicationExchangeRatesParams,
|
|
74
|
+
options?: {
|
|
75
|
+
query?: UseQueryOptions<
|
|
76
|
+
Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
|
|
77
|
+
TError,
|
|
78
|
+
TData
|
|
79
|
+
>;
|
|
80
|
+
request?: SecondParameter<typeof customInstance>;
|
|
81
|
+
}
|
|
82
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
83
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
84
|
+
|
|
85
|
+
const queryKey =
|
|
86
|
+
queryOptions?.queryKey ?? getGetAllApplicationExchangeRatesQueryKey(params);
|
|
87
|
+
|
|
88
|
+
const queryFn: QueryFunction<
|
|
89
|
+
Awaited<ReturnType<typeof getAllApplicationExchangeRates>>
|
|
90
|
+
> = ({ signal }) =>
|
|
91
|
+
getAllApplicationExchangeRates(params, requestOptions, signal);
|
|
92
|
+
|
|
93
|
+
const query = useQuery<
|
|
94
|
+
Awaited<ReturnType<typeof getAllApplicationExchangeRates>>,
|
|
95
|
+
TError,
|
|
96
|
+
TData
|
|
97
|
+
>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {
|
|
98
|
+
queryKey: QueryKey;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
query.queryKey = queryKey;
|
|
102
|
+
|
|
103
|
+
return query;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Sets the Exchange Rate for a specific Application. The rate replaces any exising rate for the application and applies immediately to all new costs of the Application.
|
|
108
|
+
|
|
109
|
+
If an Application has no specific rate it adopts the current value of the default Application Exchange Rate.
|
|
110
|
+
|
|
111
|
+
You need admin privilege to use this method.
|
|
112
|
+
|
|
113
|
+
* @summary Sets the Exchange Rate for a specific Application
|
|
114
|
+
*/
|
|
115
|
+
export const setApplicationExchangeRate = (
|
|
116
|
+
applicationId: string,
|
|
117
|
+
exchangeRatePutBodyBody: ExchangeRatePutBodyBody,
|
|
118
|
+
options?: SecondParameter<typeof customInstance>
|
|
119
|
+
) => {
|
|
120
|
+
const formData = new FormData();
|
|
121
|
+
formData.append("rate", exchangeRatePutBodyBody.rate);
|
|
122
|
+
if (exchangeRatePutBodyBody.comment !== undefined) {
|
|
123
|
+
formData.append("comment", exchangeRatePutBodyBody.comment);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return customInstance<void>(
|
|
127
|
+
{
|
|
128
|
+
url: `/application/${applicationId}/exchange-rate`,
|
|
129
|
+
method: "put",
|
|
130
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
131
|
+
data: formData,
|
|
132
|
+
},
|
|
133
|
+
options
|
|
134
|
+
);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export type SetApplicationExchangeRateMutationResult = NonNullable<
|
|
138
|
+
Awaited<ReturnType<typeof setApplicationExchangeRate>>
|
|
139
|
+
>;
|
|
140
|
+
export type SetApplicationExchangeRateMutationBody = ExchangeRatePutBodyBody;
|
|
141
|
+
export type SetApplicationExchangeRateMutationError = ErrorType<DmError>;
|
|
142
|
+
|
|
143
|
+
export const useSetApplicationExchangeRate = <
|
|
144
|
+
TError = ErrorType<DmError>,
|
|
145
|
+
TContext = unknown
|
|
146
|
+
>(options?: {
|
|
147
|
+
mutation?: UseMutationOptions<
|
|
148
|
+
Awaited<ReturnType<typeof setApplicationExchangeRate>>,
|
|
149
|
+
TError,
|
|
150
|
+
{ applicationId: string; data: ExchangeRatePutBodyBody },
|
|
151
|
+
TContext
|
|
152
|
+
>;
|
|
153
|
+
request?: SecondParameter<typeof customInstance>;
|
|
154
|
+
}) => {
|
|
155
|
+
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
156
|
+
|
|
157
|
+
const mutationFn: MutationFunction<
|
|
158
|
+
Awaited<ReturnType<typeof setApplicationExchangeRate>>,
|
|
159
|
+
{ applicationId: string; data: ExchangeRatePutBodyBody }
|
|
160
|
+
> = (props) => {
|
|
161
|
+
const { applicationId, data } = props ?? {};
|
|
162
|
+
|
|
163
|
+
return setApplicationExchangeRate(applicationId, data, requestOptions);
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
return useMutation<
|
|
167
|
+
Awaited<ReturnType<typeof setApplicationExchangeRate>>,
|
|
168
|
+
TError,
|
|
169
|
+
{ applicationId: string; data: ExchangeRatePutBodyBody },
|
|
170
|
+
TContext
|
|
171
|
+
>(mutationFn, mutationOptions);
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* 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.
|
|
175
|
+
|
|
176
|
+
* @summary Gets the Application's Exchange Rate history
|
|
177
|
+
*/
|
|
178
|
+
export const getApplicationExchangeRates = (
|
|
179
|
+
applicationId: string,
|
|
180
|
+
params?: GetApplicationExchangeRatesParams,
|
|
181
|
+
options?: SecondParameter<typeof customInstance>,
|
|
182
|
+
signal?: AbortSignal
|
|
183
|
+
) => {
|
|
184
|
+
return customInstance<GetExchangeRatesResponse>(
|
|
185
|
+
{
|
|
186
|
+
url: `/application/${applicationId}/exchange-rate`,
|
|
187
|
+
method: "get",
|
|
188
|
+
params,
|
|
189
|
+
signal,
|
|
190
|
+
},
|
|
191
|
+
options
|
|
192
|
+
);
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
export const getGetApplicationExchangeRatesQueryKey = (
|
|
196
|
+
applicationId: string,
|
|
197
|
+
params?: GetApplicationExchangeRatesParams
|
|
198
|
+
) => [
|
|
199
|
+
`/application/${applicationId}/exchange-rate`,
|
|
200
|
+
...(params ? [params] : []),
|
|
201
|
+
];
|
|
202
|
+
|
|
203
|
+
export type GetApplicationExchangeRatesQueryResult = NonNullable<
|
|
204
|
+
Awaited<ReturnType<typeof getApplicationExchangeRates>>
|
|
205
|
+
>;
|
|
206
|
+
export type GetApplicationExchangeRatesQueryError = ErrorType<void | DmError>;
|
|
207
|
+
|
|
208
|
+
export const useGetApplicationExchangeRates = <
|
|
209
|
+
TData = Awaited<ReturnType<typeof getApplicationExchangeRates>>,
|
|
210
|
+
TError = ErrorType<void | DmError>
|
|
211
|
+
>(
|
|
212
|
+
applicationId: string,
|
|
213
|
+
params?: GetApplicationExchangeRatesParams,
|
|
214
|
+
options?: {
|
|
215
|
+
query?: UseQueryOptions<
|
|
216
|
+
Awaited<ReturnType<typeof getApplicationExchangeRates>>,
|
|
217
|
+
TError,
|
|
218
|
+
TData
|
|
219
|
+
>;
|
|
220
|
+
request?: SecondParameter<typeof customInstance>;
|
|
221
|
+
}
|
|
222
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
223
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
224
|
+
|
|
225
|
+
const queryKey =
|
|
226
|
+
queryOptions?.queryKey ??
|
|
227
|
+
getGetApplicationExchangeRatesQueryKey(applicationId, params);
|
|
228
|
+
|
|
229
|
+
const queryFn: QueryFunction<
|
|
230
|
+
Awaited<ReturnType<typeof getApplicationExchangeRates>>
|
|
231
|
+
> = ({ signal }) =>
|
|
232
|
+
getApplicationExchangeRates(applicationId, params, requestOptions, signal);
|
|
233
|
+
|
|
234
|
+
const query = useQuery<
|
|
235
|
+
Awaited<ReturnType<typeof getApplicationExchangeRates>>,
|
|
236
|
+
TError,
|
|
237
|
+
TData
|
|
238
|
+
>(queryKey, queryFn, {
|
|
239
|
+
enabled: !!applicationId,
|
|
240
|
+
...queryOptions,
|
|
241
|
+
}) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
242
|
+
|
|
243
|
+
query.queryKey = queryKey;
|
|
244
|
+
|
|
245
|
+
return query;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* 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.
|
|
250
|
+
|
|
251
|
+
* @summary Gets Exchange Rates for all Jobs
|
|
252
|
+
*/
|
|
253
|
+
export const getAllJobExchangeRates = (
|
|
254
|
+
params?: GetAllJobExchangeRatesParams,
|
|
255
|
+
options?: SecondParameter<typeof customInstance>,
|
|
256
|
+
signal?: AbortSignal
|
|
257
|
+
) => {
|
|
258
|
+
return customInstance<GetAllExchangeRatesResponse>(
|
|
259
|
+
{ url: `/job/exchange-rate`, method: "get", params, signal },
|
|
260
|
+
options
|
|
261
|
+
);
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export const getGetAllJobExchangeRatesQueryKey = (
|
|
265
|
+
params?: GetAllJobExchangeRatesParams
|
|
266
|
+
) => [`/job/exchange-rate`, ...(params ? [params] : [])];
|
|
267
|
+
|
|
268
|
+
export type GetAllJobExchangeRatesQueryResult = NonNullable<
|
|
269
|
+
Awaited<ReturnType<typeof getAllJobExchangeRates>>
|
|
270
|
+
>;
|
|
271
|
+
export type GetAllJobExchangeRatesQueryError = ErrorType<void | DmError>;
|
|
272
|
+
|
|
273
|
+
export const useGetAllJobExchangeRates = <
|
|
274
|
+
TData = Awaited<ReturnType<typeof getAllJobExchangeRates>>,
|
|
275
|
+
TError = ErrorType<void | DmError>
|
|
276
|
+
>(
|
|
277
|
+
params?: GetAllJobExchangeRatesParams,
|
|
278
|
+
options?: {
|
|
279
|
+
query?: UseQueryOptions<
|
|
280
|
+
Awaited<ReturnType<typeof getAllJobExchangeRates>>,
|
|
281
|
+
TError,
|
|
282
|
+
TData
|
|
283
|
+
>;
|
|
284
|
+
request?: SecondParameter<typeof customInstance>;
|
|
285
|
+
}
|
|
286
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
287
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
288
|
+
|
|
289
|
+
const queryKey =
|
|
290
|
+
queryOptions?.queryKey ?? getGetAllJobExchangeRatesQueryKey(params);
|
|
291
|
+
|
|
292
|
+
const queryFn: QueryFunction<
|
|
293
|
+
Awaited<ReturnType<typeof getAllJobExchangeRates>>
|
|
294
|
+
> = ({ signal }) => getAllJobExchangeRates(params, requestOptions, signal);
|
|
295
|
+
|
|
296
|
+
const query = useQuery<
|
|
297
|
+
Awaited<ReturnType<typeof getAllJobExchangeRates>>,
|
|
298
|
+
TError,
|
|
299
|
+
TData
|
|
300
|
+
>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {
|
|
301
|
+
queryKey: QueryKey;
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
query.queryKey = queryKey;
|
|
305
|
+
|
|
306
|
+
return query;
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Sets the Exchange Rate for a specific job. The rate replaces any existing rate for the Job and applies immediately to all new costs fro this Job.
|
|
311
|
+
|
|
312
|
+
If a Job has no specific rate it adopts the current value of the default Job Exchange Rate.
|
|
313
|
+
|
|
314
|
+
You need admin privilege to use this method.
|
|
315
|
+
|
|
316
|
+
* @summary Sets the Exchange Rate for a specific Job
|
|
317
|
+
*/
|
|
318
|
+
export const setJobPricing = (
|
|
319
|
+
jobId: number,
|
|
320
|
+
exchangeRatePutBodyBody: ExchangeRatePutBodyBody,
|
|
321
|
+
options?: SecondParameter<typeof customInstance>
|
|
322
|
+
) => {
|
|
323
|
+
const formData = new FormData();
|
|
324
|
+
formData.append("rate", exchangeRatePutBodyBody.rate);
|
|
325
|
+
if (exchangeRatePutBodyBody.comment !== undefined) {
|
|
326
|
+
formData.append("comment", exchangeRatePutBodyBody.comment);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
return customInstance<void>(
|
|
330
|
+
{
|
|
331
|
+
url: `/job/${jobId}/exchange-rate`,
|
|
332
|
+
method: "put",
|
|
333
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
334
|
+
data: formData,
|
|
335
|
+
},
|
|
336
|
+
options
|
|
337
|
+
);
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
export type SetJobPricingMutationResult = NonNullable<
|
|
341
|
+
Awaited<ReturnType<typeof setJobPricing>>
|
|
342
|
+
>;
|
|
343
|
+
export type SetJobPricingMutationBody = ExchangeRatePutBodyBody;
|
|
344
|
+
export type SetJobPricingMutationError = ErrorType<DmError>;
|
|
345
|
+
|
|
346
|
+
export const useSetJobPricing = <
|
|
347
|
+
TError = ErrorType<DmError>,
|
|
348
|
+
TContext = unknown
|
|
349
|
+
>(options?: {
|
|
350
|
+
mutation?: UseMutationOptions<
|
|
351
|
+
Awaited<ReturnType<typeof setJobPricing>>,
|
|
352
|
+
TError,
|
|
353
|
+
{ jobId: number; data: ExchangeRatePutBodyBody },
|
|
354
|
+
TContext
|
|
355
|
+
>;
|
|
356
|
+
request?: SecondParameter<typeof customInstance>;
|
|
357
|
+
}) => {
|
|
358
|
+
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
359
|
+
|
|
360
|
+
const mutationFn: MutationFunction<
|
|
361
|
+
Awaited<ReturnType<typeof setJobPricing>>,
|
|
362
|
+
{ jobId: number; data: ExchangeRatePutBodyBody }
|
|
363
|
+
> = (props) => {
|
|
364
|
+
const { jobId, data } = props ?? {};
|
|
365
|
+
|
|
366
|
+
return setJobPricing(jobId, data, requestOptions);
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
return useMutation<
|
|
370
|
+
Awaited<ReturnType<typeof setJobPricing>>,
|
|
371
|
+
TError,
|
|
372
|
+
{ jobId: number; data: ExchangeRatePutBodyBody },
|
|
373
|
+
TContext
|
|
374
|
+
>(mutationFn, mutationOptions);
|
|
375
|
+
};
|
|
376
|
+
/**
|
|
377
|
+
* 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.
|
|
378
|
+
|
|
379
|
+
* @summary Gets Job Exchange Rates
|
|
380
|
+
*/
|
|
381
|
+
export const getJobExchangeRates = (
|
|
382
|
+
jobId: number,
|
|
383
|
+
params?: GetJobExchangeRatesParams,
|
|
384
|
+
options?: SecondParameter<typeof customInstance>,
|
|
385
|
+
signal?: AbortSignal
|
|
386
|
+
) => {
|
|
387
|
+
return customInstance<GetExchangeRatesResponse>(
|
|
388
|
+
{ url: `/job/${jobId}/exchange-rate`, method: "get", params, signal },
|
|
389
|
+
options
|
|
390
|
+
);
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
export const getGetJobExchangeRatesQueryKey = (
|
|
394
|
+
jobId: number,
|
|
395
|
+
params?: GetJobExchangeRatesParams
|
|
396
|
+
) => [`/job/${jobId}/exchange-rate`, ...(params ? [params] : [])];
|
|
397
|
+
|
|
398
|
+
export type GetJobExchangeRatesQueryResult = NonNullable<
|
|
399
|
+
Awaited<ReturnType<typeof getJobExchangeRates>>
|
|
400
|
+
>;
|
|
401
|
+
export type GetJobExchangeRatesQueryError = ErrorType<void | DmError>;
|
|
402
|
+
|
|
403
|
+
export const useGetJobExchangeRates = <
|
|
404
|
+
TData = Awaited<ReturnType<typeof getJobExchangeRates>>,
|
|
405
|
+
TError = ErrorType<void | DmError>
|
|
406
|
+
>(
|
|
407
|
+
jobId: number,
|
|
408
|
+
params?: GetJobExchangeRatesParams,
|
|
409
|
+
options?: {
|
|
410
|
+
query?: UseQueryOptions<
|
|
411
|
+
Awaited<ReturnType<typeof getJobExchangeRates>>,
|
|
412
|
+
TError,
|
|
413
|
+
TData
|
|
414
|
+
>;
|
|
415
|
+
request?: SecondParameter<typeof customInstance>;
|
|
416
|
+
}
|
|
417
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
418
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
419
|
+
|
|
420
|
+
const queryKey =
|
|
421
|
+
queryOptions?.queryKey ?? getGetJobExchangeRatesQueryKey(jobId, params);
|
|
422
|
+
|
|
423
|
+
const queryFn: QueryFunction<
|
|
424
|
+
Awaited<ReturnType<typeof getJobExchangeRates>>
|
|
425
|
+
> = ({ signal }) =>
|
|
426
|
+
getJobExchangeRates(jobId, params, requestOptions, signal);
|
|
427
|
+
|
|
428
|
+
const query = useQuery<
|
|
429
|
+
Awaited<ReturnType<typeof getJobExchangeRates>>,
|
|
430
|
+
TError,
|
|
431
|
+
TData
|
|
432
|
+
>(queryKey, queryFn, { enabled: !!jobId, ...queryOptions }) as UseQueryResult<
|
|
433
|
+
TData,
|
|
434
|
+
TError
|
|
435
|
+
> & { queryKey: QueryKey };
|
|
436
|
+
|
|
437
|
+
query.queryKey = queryKey;
|
|
438
|
+
|
|
439
|
+
return query;
|
|
440
|
+
};
|
package/src/file/file.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version: 0
|
|
9
|
+
* OpenAPI spec version: 1.0
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery, useMutation } from "react-query";
|
|
12
12
|
import type {
|
|
@@ -37,7 +37,7 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
|
37
37
|
: never;
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* Given a Project and Path the files available to you on that path
|
|
40
|
+
* Given a Project and Path the files available to you on that path will be returned along with any additional paths (sub-directories).
|
|
41
41
|
|
|
42
42
|
* @summary Gets the Files on a Project Path
|
|
43
43
|
*/
|
package/src/instance/instance.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version: 0
|
|
9
|
+
* OpenAPI spec version: 1.0
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery, useMutation } from "react-query";
|
|
12
12
|
import type {
|
|
@@ -45,7 +45,7 @@ Instance behaviour is controlled using the `specification`. You will need to con
|
|
|
45
45
|
|
|
46
46
|
An Application instance is not Ready for use until the corresponding **TaskState** is `STARTED`.
|
|
47
47
|
|
|
48
|
-
A Job instance typically runs to completion,
|
|
48
|
+
A Job instance typically runs to completion, reaching the **TaskState** `SUCCESS` when successful and `FAILURE` is unsuccessful.
|
|
49
49
|
|
|
50
50
|
* @summary Creates a new application instance
|
|
51
51
|
*/
|
|
@@ -55,10 +55,12 @@ export const createInstance = (
|
|
|
55
55
|
) => {
|
|
56
56
|
const formData = new FormData();
|
|
57
57
|
formData.append("application_id", instancePostBodyBody.application_id);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
if (instancePostBodyBody.application_version !== undefined) {
|
|
59
|
+
formData.append(
|
|
60
|
+
"application_version",
|
|
61
|
+
instancePostBodyBody.application_version
|
|
62
|
+
);
|
|
63
|
+
}
|
|
62
64
|
formData.append("project_id", instancePostBodyBody.project_id);
|
|
63
65
|
formData.append("as_name", instancePostBodyBody.as_name);
|
|
64
66
|
if (instancePostBodyBody.callback_url !== undefined) {
|
|
@@ -128,7 +130,7 @@ export const useCreateInstance = <
|
|
|
128
130
|
>(mutationFn, mutationOptions);
|
|
129
131
|
};
|
|
130
132
|
/**
|
|
131
|
-
* Returns a summary of all running instances.
|
|
133
|
+
* Returns a summary of all running instances. Instances can be running as an Application or as a Job. The response will contain an `application_type` field that is either `job` or `application`
|
|
132
134
|
|
|
133
135
|
* @summary Get summary information about all application instances
|
|
134
136
|
*/
|
|
@@ -357,9 +359,9 @@ export const usePatchInstance = <
|
|
|
357
359
|
>(mutationFn, mutationOptions);
|
|
358
360
|
};
|
|
359
361
|
/**
|
|
360
|
-
* This revokes the instance **Token**, which was optionally generated when the instance was
|
|
362
|
+
* This revokes the instance **Token**, which was optionally generated when the instance was launched. No authentication is required to use this endpoint, whcih is typcially used by a remote system driven by instance callbacks.
|
|
361
363
|
|
|
362
|
-
Tokens automatically
|
|
364
|
+
Tokens automatically expire after a period of time but can be revoked instantly with this endpoint.
|
|
363
365
|
|
|
364
366
|
The remote system will revoke the token when it's finished with it
|
|
365
367
|
|
package/src/job/job.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version: 0
|
|
9
|
+
* OpenAPI spec version: 1.0
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery } from "react-query";
|
|
12
12
|
import type {
|
|
@@ -19,7 +19,7 @@ import type {
|
|
|
19
19
|
JobsGetResponse,
|
|
20
20
|
DmError,
|
|
21
21
|
JobGetResponse,
|
|
22
|
-
|
|
22
|
+
GetJobByVersionParams,
|
|
23
23
|
} from "../data-manager-api.schemas";
|
|
24
24
|
import { customInstance } from ".././custom-instance";
|
|
25
25
|
import type { ErrorType } from ".././custom-instance";
|
|
@@ -83,41 +83,41 @@ export const useGetJobs = <
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
|
-
* Gets a Job based on the
|
|
86
|
+
* Gets a Job based on the its **collection**, **job** and **version**.
|
|
87
87
|
|
|
88
88
|
Job availability will vary as Jobs are added to the cluster.
|
|
89
89
|
|
|
90
|
-
* @summary Get a Job by
|
|
90
|
+
* @summary Get a Job by its version
|
|
91
91
|
*/
|
|
92
|
-
export const
|
|
93
|
-
params:
|
|
92
|
+
export const getJobByVersion = (
|
|
93
|
+
params: GetJobByVersionParams,
|
|
94
94
|
options?: SecondParameter<typeof customInstance>,
|
|
95
95
|
signal?: AbortSignal
|
|
96
96
|
) => {
|
|
97
97
|
return customInstance<JobGetResponse>(
|
|
98
|
-
{ url: `/job/get-by-
|
|
98
|
+
{ url: `/job/get-by-version`, method: "get", params, signal },
|
|
99
99
|
options
|
|
100
100
|
);
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
export const
|
|
104
|
-
`/job/get-by-
|
|
103
|
+
export const getGetJobByVersionQueryKey = (params: GetJobByVersionParams) => [
|
|
104
|
+
`/job/get-by-version`,
|
|
105
105
|
...(params ? [params] : []),
|
|
106
106
|
];
|
|
107
107
|
|
|
108
|
-
export type
|
|
109
|
-
Awaited<ReturnType<typeof
|
|
108
|
+
export type GetJobByVersionQueryResult = NonNullable<
|
|
109
|
+
Awaited<ReturnType<typeof getJobByVersion>>
|
|
110
110
|
>;
|
|
111
|
-
export type
|
|
111
|
+
export type GetJobByVersionQueryError = ErrorType<DmError>;
|
|
112
112
|
|
|
113
|
-
export const
|
|
114
|
-
TData = Awaited<ReturnType<typeof
|
|
113
|
+
export const useGetJobByVersion = <
|
|
114
|
+
TData = Awaited<ReturnType<typeof getJobByVersion>>,
|
|
115
115
|
TError = ErrorType<DmError>
|
|
116
116
|
>(
|
|
117
|
-
params:
|
|
117
|
+
params: GetJobByVersionParams,
|
|
118
118
|
options?: {
|
|
119
119
|
query?: UseQueryOptions<
|
|
120
|
-
Awaited<ReturnType<typeof
|
|
120
|
+
Awaited<ReturnType<typeof getJobByVersion>>,
|
|
121
121
|
TError,
|
|
122
122
|
TData
|
|
123
123
|
>;
|
|
@@ -126,14 +126,14 @@ export const useGetJobByName = <
|
|
|
126
126
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
127
127
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
128
128
|
|
|
129
|
-
const queryKey = queryOptions?.queryKey ??
|
|
129
|
+
const queryKey = queryOptions?.queryKey ?? getGetJobByVersionQueryKey(params);
|
|
130
130
|
|
|
131
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof
|
|
131
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getJobByVersion>>> = ({
|
|
132
132
|
signal,
|
|
133
|
-
}) =>
|
|
133
|
+
}) => getJobByVersion(params, requestOptions, signal);
|
|
134
134
|
|
|
135
135
|
const query = useQuery<
|
|
136
|
-
Awaited<ReturnType<typeof
|
|
136
|
+
Awaited<ReturnType<typeof getJobByVersion>>,
|
|
137
137
|
TError,
|
|
138
138
|
TData
|
|
139
139
|
>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {
|
package/src/metadata/metadata.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version: 0
|
|
9
|
+
* OpenAPI spec version: 1.0
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery, useMutation } from "react-query";
|
|
12
12
|
import type {
|
package/src/project/project.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version: 0
|
|
9
|
+
* OpenAPI spec version: 1.0
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery, useMutation } from "react-query";
|
|
12
12
|
import type {
|
|
@@ -95,7 +95,7 @@ export const useGetProjects = <
|
|
|
95
95
|
};
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
|
-
* Creates a new project, assigning and returning a unique **ID**. A
|
|
98
|
+
* Creates a new project, assigning and returning a unique **ID**. A persistent volume is created in the cluster and assigned to your Project. It's here you can add **Datasets** as **Files** and run **Applications** and **Jobs**.
|
|
99
99
|
|
|
100
100
|
To create a Project you will need an uncommitted Project product.
|
|
101
101
|
|
|
@@ -595,7 +595,7 @@ export const useAddFileToProject = <
|
|
|
595
595
|
|
|
596
596
|
For **managed** files you should consider using the `/file/{file_id}` endpoint.
|
|
597
597
|
|
|
598
|
-
As there is no security You must provide a valid token. The token must be a token valid for the project, usually
|
|
598
|
+
As there is no security You must provide a valid token. The token must be a token valid for the project, usually generated when an Instance has been launched in the Project. If the token is not valid ou will receive a `403` error
|
|
599
599
|
|
|
600
600
|
* @summary Download a project file using a token
|
|
601
601
|
*/
|
package/src/task/task.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version: 0
|
|
9
|
+
* OpenAPI spec version: 1.0
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery, useMutation } from "react-query";
|
|
12
12
|
import type {
|
package/src/type/type.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version: 0
|
|
9
|
+
* OpenAPI spec version: 1.0
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery } from "react-query";
|
|
12
12
|
import type {
|
package/src/user/user.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.
|
|
8
8
|
|
|
9
|
-
* OpenAPI spec version: 0
|
|
9
|
+
* OpenAPI spec version: 1.0
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery, useMutation } from "react-query";
|
|
12
12
|
import type {
|