@squonk/data-manager-client 1.1.3 → 1.1.4-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accounting/accounting.cjs +28 -25
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.ts +23 -5
- package/accounting/accounting.js +27 -24
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +68 -28
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +74 -4
- package/admin/admin.js +67 -27
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +19 -16
- package/application/application.cjs.map +1 -1
- package/application/application.d.ts +16 -4
- package/application/application.js +18 -15
- package/application/application.js.map +1 -1
- package/{custom-instance-d49ce6d9.d.ts → custom-instance-e49ba702.d.ts} +1 -1
- package/dataset/dataset.cjs +98 -45
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +85 -7
- package/dataset/dataset.js +97 -44
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs +62 -27
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.ts +50 -6
- package/exchange-rate/exchange-rate.js +61 -26
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file/file.cjs +40 -25
- package/file/file.cjs.map +1 -1
- package/file/file.d.ts +40 -4
- package/file/file.js +39 -24
- package/file/file.js.map +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs +54 -29
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.ts +60 -4
- package/instance/instance.js +53 -28
- package/instance/instance.js.map +1 -1
- package/job/job.cjs +28 -32
- package/job/job.cjs.map +1 -1
- package/job/job.d.ts +23 -5
- package/job/job.js +27 -31
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +42 -20
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.ts +38 -4
- package/metadata/metadata.js +41 -19
- package/metadata/metadata.js.map +1 -1
- package/package.json +10 -9
- package/project/project.cjs +105 -47
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +106 -6
- package/project/project.js +104 -46
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +88 -43
- package/src/admin/admin.ts +253 -99
- package/src/application/application.ts +64 -31
- package/src/data-manager-api.schemas.ts +1 -1
- package/src/dataset/dataset.ts +323 -130
- package/src/exchange-rate/exchange-rate.ts +211 -87
- package/src/file/file.ts +148 -63
- package/src/instance/instance.ts +202 -87
- package/src/job/job.ts +93 -50
- package/src/metadata/metadata.ts +136 -54
- package/src/project/project.ts +367 -146
- package/src/task/task.ts +91 -44
- package/src/type/type.ts +27 -14
- package/src/user/user.ts +121 -61
- package/task/task.cjs +26 -26
- package/task/task.cjs.map +1 -1
- package/task/task.d.ts +24 -4
- package/task/task.js +25 -25
- package/task/task.js.map +1 -1
- package/type/type.cjs +10 -9
- package/type/type.cjs.map +1 -1
- package/type/type.d.ts +9 -3
- package/type/type.js +9 -8
- package/type/type.js.map +1 -1
- package/user/user.cjs +35 -29
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +31 -5
- package/user/user.js +34 -28
- package/user/user.js.map +1 -1
- package/chunk-LNYWU37B.cjs +0 -13
- package/chunk-LNYWU37B.cjs.map +0 -1
- package/chunk-LT4O36DN.js +0 -13
- package/chunk-LT4O36DN.js.map +0 -1
- package/src/queryMutator.ts +0 -12
package/src/file/file.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
2
|
+
* Generated by orval v6.15.0 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Dataset Manager API
|
|
5
5
|
* The Dataset Manager API service.
|
|
@@ -27,7 +27,6 @@ import type {
|
|
|
27
27
|
} from "../data-manager-api.schemas";
|
|
28
28
|
import { customInstance } from ".././custom-instance";
|
|
29
29
|
import type { ErrorType } from ".././custom-instance";
|
|
30
|
-
import { queryMutator } from ".././queryMutator";
|
|
31
30
|
|
|
32
31
|
// eslint-disable-next-line
|
|
33
32
|
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
@@ -53,17 +52,10 @@ export const getFiles = (
|
|
|
53
52
|
);
|
|
54
53
|
};
|
|
55
54
|
|
|
56
|
-
export const getGetFilesQueryKey = (params: GetFilesParams) =>
|
|
57
|
-
`/file`,
|
|
58
|
-
...(params ? [params] : []),
|
|
59
|
-
];
|
|
55
|
+
export const getGetFilesQueryKey = (params: GetFilesParams) =>
|
|
56
|
+
["data-manager-api", `/file`, ...(params ? [params] : [])] as const;
|
|
60
57
|
|
|
61
|
-
export
|
|
62
|
-
Awaited<ReturnType<typeof getFiles>>
|
|
63
|
-
>;
|
|
64
|
-
export type GetFilesQueryError = ErrorType<void | DmError>;
|
|
65
|
-
|
|
66
|
-
export const useGetFiles = <
|
|
58
|
+
export const getGetFilesQueryOptions = <
|
|
67
59
|
TData = Awaited<ReturnType<typeof getFiles>>,
|
|
68
60
|
TError = ErrorType<void | DmError>
|
|
69
61
|
>(
|
|
@@ -76,7 +68,9 @@ export const useGetFiles = <
|
|
|
76
68
|
>;
|
|
77
69
|
request?: SecondParameter<typeof customInstance>;
|
|
78
70
|
}
|
|
79
|
-
):
|
|
71
|
+
): UseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData> & {
|
|
72
|
+
queryKey: QueryKey;
|
|
73
|
+
} => {
|
|
80
74
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
81
75
|
|
|
82
76
|
const queryKey = queryOptions?.queryKey ?? getGetFilesQueryKey(params);
|
|
@@ -85,13 +79,35 @@ export const useGetFiles = <
|
|
|
85
79
|
signal,
|
|
86
80
|
}) => getFiles(params, requestOptions, signal);
|
|
87
81
|
|
|
88
|
-
|
|
82
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export type GetFilesQueryResult = NonNullable<
|
|
86
|
+
Awaited<ReturnType<typeof getFiles>>
|
|
87
|
+
>;
|
|
88
|
+
export type GetFilesQueryError = ErrorType<void | DmError>;
|
|
89
|
+
|
|
90
|
+
export const useGetFiles = <
|
|
91
|
+
TData = Awaited<ReturnType<typeof getFiles>>,
|
|
92
|
+
TError = ErrorType<void | DmError>
|
|
93
|
+
>(
|
|
94
|
+
params: GetFilesParams,
|
|
95
|
+
options?: {
|
|
96
|
+
query?: UseQueryOptions<
|
|
97
|
+
Awaited<ReturnType<typeof getFiles>>,
|
|
98
|
+
TError,
|
|
99
|
+
TData
|
|
100
|
+
>;
|
|
101
|
+
request?: SecondParameter<typeof customInstance>;
|
|
102
|
+
}
|
|
103
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
104
|
+
const queryOptions = getGetFilesQueryOptions(params, options);
|
|
89
105
|
|
|
90
|
-
const query = useQuery
|
|
91
|
-
|
|
92
|
-
|
|
106
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
107
|
+
queryKey: QueryKey;
|
|
108
|
+
};
|
|
93
109
|
|
|
94
|
-
query.queryKey =
|
|
110
|
+
query.queryKey = queryOptions.queryKey;
|
|
95
111
|
|
|
96
112
|
return query;
|
|
97
113
|
};
|
|
@@ -142,13 +158,7 @@ export const attachFile = (
|
|
|
142
158
|
);
|
|
143
159
|
};
|
|
144
160
|
|
|
145
|
-
export
|
|
146
|
-
Awaited<ReturnType<typeof attachFile>>
|
|
147
|
-
>;
|
|
148
|
-
export type AttachFileMutationBody = FilePostBodyBody;
|
|
149
|
-
export type AttachFileMutationError = ErrorType<void | DmError>;
|
|
150
|
-
|
|
151
|
-
export const useAttachFile = <
|
|
161
|
+
export const getAttachFileMutationOptions = <
|
|
152
162
|
TError = ErrorType<void | DmError>,
|
|
153
163
|
TContext = unknown
|
|
154
164
|
>(options?: {
|
|
@@ -159,7 +169,12 @@ export const useAttachFile = <
|
|
|
159
169
|
TContext
|
|
160
170
|
>;
|
|
161
171
|
request?: SecondParameter<typeof customInstance>;
|
|
162
|
-
})
|
|
172
|
+
}): UseMutationOptions<
|
|
173
|
+
Awaited<ReturnType<typeof attachFile>>,
|
|
174
|
+
TError,
|
|
175
|
+
{ data: FilePostBodyBody },
|
|
176
|
+
TContext
|
|
177
|
+
> => {
|
|
163
178
|
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
164
179
|
|
|
165
180
|
const mutationFn: MutationFunction<
|
|
@@ -171,12 +186,30 @@ export const useAttachFile = <
|
|
|
171
186
|
return attachFile(data, requestOptions);
|
|
172
187
|
};
|
|
173
188
|
|
|
174
|
-
return
|
|
189
|
+
return { mutationFn, ...mutationOptions };
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
export type AttachFileMutationResult = NonNullable<
|
|
193
|
+
Awaited<ReturnType<typeof attachFile>>
|
|
194
|
+
>;
|
|
195
|
+
export type AttachFileMutationBody = FilePostBodyBody;
|
|
196
|
+
export type AttachFileMutationError = ErrorType<void | DmError>;
|
|
197
|
+
|
|
198
|
+
export const useAttachFile = <
|
|
199
|
+
TError = ErrorType<void | DmError>,
|
|
200
|
+
TContext = unknown
|
|
201
|
+
>(options?: {
|
|
202
|
+
mutation?: UseMutationOptions<
|
|
175
203
|
Awaited<ReturnType<typeof attachFile>>,
|
|
176
204
|
TError,
|
|
177
205
|
{ data: FilePostBodyBody },
|
|
178
206
|
TContext
|
|
179
|
-
|
|
207
|
+
>;
|
|
208
|
+
request?: SecondParameter<typeof customInstance>;
|
|
209
|
+
}) => {
|
|
210
|
+
const mutationOptions = getAttachFileMutationOptions(options);
|
|
211
|
+
|
|
212
|
+
return useMutation(mutationOptions);
|
|
180
213
|
};
|
|
181
214
|
/**
|
|
182
215
|
* Removes an unmanaged file from a Project. You cannot use this endpoint to delete managed project files.
|
|
@@ -195,13 +228,7 @@ export const deleteUnmanagedFile = (
|
|
|
195
228
|
);
|
|
196
229
|
};
|
|
197
230
|
|
|
198
|
-
export
|
|
199
|
-
Awaited<ReturnType<typeof deleteUnmanagedFile>>
|
|
200
|
-
>;
|
|
201
|
-
|
|
202
|
-
export type DeleteUnmanagedFileMutationError = ErrorType<DmError>;
|
|
203
|
-
|
|
204
|
-
export const useDeleteUnmanagedFile = <
|
|
231
|
+
export const getDeleteUnmanagedFileMutationOptions = <
|
|
205
232
|
TError = ErrorType<DmError>,
|
|
206
233
|
TContext = unknown
|
|
207
234
|
>(options?: {
|
|
@@ -212,7 +239,12 @@ export const useDeleteUnmanagedFile = <
|
|
|
212
239
|
TContext
|
|
213
240
|
>;
|
|
214
241
|
request?: SecondParameter<typeof customInstance>;
|
|
215
|
-
})
|
|
242
|
+
}): UseMutationOptions<
|
|
243
|
+
Awaited<ReturnType<typeof deleteUnmanagedFile>>,
|
|
244
|
+
TError,
|
|
245
|
+
{ params: DeleteUnmanagedFileParams },
|
|
246
|
+
TContext
|
|
247
|
+
> => {
|
|
216
248
|
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
217
249
|
|
|
218
250
|
const mutationFn: MutationFunction<
|
|
@@ -224,12 +256,30 @@ export const useDeleteUnmanagedFile = <
|
|
|
224
256
|
return deleteUnmanagedFile(params, requestOptions);
|
|
225
257
|
};
|
|
226
258
|
|
|
227
|
-
return
|
|
259
|
+
return { mutationFn, ...mutationOptions };
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
export type DeleteUnmanagedFileMutationResult = NonNullable<
|
|
263
|
+
Awaited<ReturnType<typeof deleteUnmanagedFile>>
|
|
264
|
+
>;
|
|
265
|
+
|
|
266
|
+
export type DeleteUnmanagedFileMutationError = ErrorType<DmError>;
|
|
267
|
+
|
|
268
|
+
export const useDeleteUnmanagedFile = <
|
|
269
|
+
TError = ErrorType<DmError>,
|
|
270
|
+
TContext = unknown
|
|
271
|
+
>(options?: {
|
|
272
|
+
mutation?: UseMutationOptions<
|
|
228
273
|
Awaited<ReturnType<typeof deleteUnmanagedFile>>,
|
|
229
274
|
TError,
|
|
230
275
|
{ params: DeleteUnmanagedFileParams },
|
|
231
276
|
TContext
|
|
232
|
-
|
|
277
|
+
>;
|
|
278
|
+
request?: SecondParameter<typeof customInstance>;
|
|
279
|
+
}) => {
|
|
280
|
+
const mutationOptions = getDeleteUnmanagedFileMutationOptions(options);
|
|
281
|
+
|
|
282
|
+
return useMutation(mutationOptions);
|
|
233
283
|
};
|
|
234
284
|
/**
|
|
235
285
|
* Given a `file_id` the file will be removed from the project it's attached to.
|
|
@@ -250,13 +300,7 @@ export const deleteFile = (
|
|
|
250
300
|
);
|
|
251
301
|
};
|
|
252
302
|
|
|
253
|
-
export
|
|
254
|
-
Awaited<ReturnType<typeof deleteFile>>
|
|
255
|
-
>;
|
|
256
|
-
|
|
257
|
-
export type DeleteFileMutationError = ErrorType<DmError>;
|
|
258
|
-
|
|
259
|
-
export const useDeleteFile = <
|
|
303
|
+
export const getDeleteFileMutationOptions = <
|
|
260
304
|
TError = ErrorType<DmError>,
|
|
261
305
|
TContext = unknown
|
|
262
306
|
>(options?: {
|
|
@@ -267,7 +311,12 @@ export const useDeleteFile = <
|
|
|
267
311
|
TContext
|
|
268
312
|
>;
|
|
269
313
|
request?: SecondParameter<typeof customInstance>;
|
|
270
|
-
})
|
|
314
|
+
}): UseMutationOptions<
|
|
315
|
+
Awaited<ReturnType<typeof deleteFile>>,
|
|
316
|
+
TError,
|
|
317
|
+
{ fileId: string },
|
|
318
|
+
TContext
|
|
319
|
+
> => {
|
|
271
320
|
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
272
321
|
|
|
273
322
|
const mutationFn: MutationFunction<
|
|
@@ -279,12 +328,30 @@ export const useDeleteFile = <
|
|
|
279
328
|
return deleteFile(fileId, requestOptions);
|
|
280
329
|
};
|
|
281
330
|
|
|
282
|
-
return
|
|
331
|
+
return { mutationFn, ...mutationOptions };
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
export type DeleteFileMutationResult = NonNullable<
|
|
335
|
+
Awaited<ReturnType<typeof deleteFile>>
|
|
336
|
+
>;
|
|
337
|
+
|
|
338
|
+
export type DeleteFileMutationError = ErrorType<DmError>;
|
|
339
|
+
|
|
340
|
+
export const useDeleteFile = <
|
|
341
|
+
TError = ErrorType<DmError>,
|
|
342
|
+
TContext = unknown
|
|
343
|
+
>(options?: {
|
|
344
|
+
mutation?: UseMutationOptions<
|
|
283
345
|
Awaited<ReturnType<typeof deleteFile>>,
|
|
284
346
|
TError,
|
|
285
347
|
{ fileId: string },
|
|
286
348
|
TContext
|
|
287
|
-
|
|
349
|
+
>;
|
|
350
|
+
request?: SecondParameter<typeof customInstance>;
|
|
351
|
+
}) => {
|
|
352
|
+
const mutationOptions = getDeleteFileMutationOptions(options);
|
|
353
|
+
|
|
354
|
+
return useMutation(mutationOptions);
|
|
288
355
|
};
|
|
289
356
|
/**
|
|
290
357
|
* Given a `file_id` the file will be returned if available.
|
|
@@ -304,14 +371,10 @@ export const downloadFile = (
|
|
|
304
371
|
);
|
|
305
372
|
};
|
|
306
373
|
|
|
307
|
-
export const getDownloadFileQueryKey = (fileId: string) =>
|
|
374
|
+
export const getDownloadFileQueryKey = (fileId: string) =>
|
|
375
|
+
["data-manager-api", `/file/${fileId}`] as const;
|
|
308
376
|
|
|
309
|
-
export
|
|
310
|
-
Awaited<ReturnType<typeof downloadFile>>
|
|
311
|
-
>;
|
|
312
|
-
export type DownloadFileQueryError = ErrorType<DmError>;
|
|
313
|
-
|
|
314
|
-
export const useDownloadFile = <
|
|
377
|
+
export const getDownloadFileQueryOptions = <
|
|
315
378
|
TData = Awaited<ReturnType<typeof downloadFile>>,
|
|
316
379
|
TError = ErrorType<DmError>
|
|
317
380
|
>(
|
|
@@ -324,7 +387,9 @@ export const useDownloadFile = <
|
|
|
324
387
|
>;
|
|
325
388
|
request?: SecondParameter<typeof customInstance>;
|
|
326
389
|
}
|
|
327
|
-
):
|
|
390
|
+
): UseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData> & {
|
|
391
|
+
queryKey: QueryKey;
|
|
392
|
+
} => {
|
|
328
393
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
329
394
|
|
|
330
395
|
const queryKey = queryOptions?.queryKey ?? getDownloadFileQueryKey(fileId);
|
|
@@ -333,15 +398,35 @@ export const useDownloadFile = <
|
|
|
333
398
|
signal,
|
|
334
399
|
}) => downloadFile(fileId, requestOptions, signal);
|
|
335
400
|
|
|
336
|
-
|
|
401
|
+
return { queryKey, queryFn, enabled: !!fileId, ...queryOptions };
|
|
402
|
+
};
|
|
337
403
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
404
|
+
export type DownloadFileQueryResult = NonNullable<
|
|
405
|
+
Awaited<ReturnType<typeof downloadFile>>
|
|
406
|
+
>;
|
|
407
|
+
export type DownloadFileQueryError = ErrorType<DmError>;
|
|
408
|
+
|
|
409
|
+
export const useDownloadFile = <
|
|
410
|
+
TData = Awaited<ReturnType<typeof downloadFile>>,
|
|
411
|
+
TError = ErrorType<DmError>
|
|
412
|
+
>(
|
|
413
|
+
fileId: string,
|
|
414
|
+
options?: {
|
|
415
|
+
query?: UseQueryOptions<
|
|
416
|
+
Awaited<ReturnType<typeof downloadFile>>,
|
|
417
|
+
TError,
|
|
418
|
+
TData
|
|
419
|
+
>;
|
|
420
|
+
request?: SecondParameter<typeof customInstance>;
|
|
421
|
+
}
|
|
422
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
423
|
+
const queryOptions = getDownloadFileQueryOptions(fileId, options);
|
|
424
|
+
|
|
425
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
426
|
+
queryKey: QueryKey;
|
|
427
|
+
};
|
|
343
428
|
|
|
344
|
-
query.queryKey =
|
|
429
|
+
query.queryKey = queryOptions.queryKey;
|
|
345
430
|
|
|
346
431
|
return query;
|
|
347
432
|
};
|