@squonk/data-manager-client 1.0.6-rc.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/accounting/accounting.cjs +21 -17
  2. package/accounting/accounting.cjs.map +1 -1
  3. package/accounting/accounting.d.ts +1 -1
  4. package/accounting/accounting.js +22 -18
  5. package/accounting/accounting.js.map +1 -1
  6. package/admin/admin.cjs +30 -6
  7. package/admin/admin.cjs.map +1 -1
  8. package/admin/admin.d.ts +19 -19
  9. package/admin/admin.js +31 -7
  10. package/admin/admin.js.map +1 -1
  11. package/application/application.cjs +16 -15
  12. package/application/application.cjs.map +1 -1
  13. package/application/application.d.ts +1 -1
  14. package/application/application.js +17 -16
  15. package/application/application.js.map +1 -1
  16. package/{custom-instance-c4af1ee9.d.ts → custom-instance-9e5c9e19.d.ts} +299 -299
  17. package/dataset/dataset.cjs +47 -58
  18. package/dataset/dataset.cjs.map +1 -1
  19. package/dataset/dataset.d.ts +16 -16
  20. package/dataset/dataset.js +48 -59
  21. package/dataset/dataset.js.map +1 -1
  22. package/exchange-rate/exchange-rate.cjs +23 -11
  23. package/exchange-rate/exchange-rate.cjs.map +1 -1
  24. package/exchange-rate/exchange-rate.d.ts +7 -7
  25. package/exchange-rate/exchange-rate.js +24 -12
  26. package/exchange-rate/exchange-rate.js.map +1 -1
  27. package/file/file.cjs +29 -27
  28. package/file/file.cjs.map +1 -1
  29. package/file/file.d.ts +10 -10
  30. package/file/file.js +30 -28
  31. package/file/file.js.map +1 -1
  32. package/index.cjs.map +1 -1
  33. package/index.d.ts +1 -1
  34. package/index.js.map +1 -1
  35. package/instance/instance.cjs +34 -30
  36. package/instance/instance.cjs.map +1 -1
  37. package/instance/instance.d.ts +10 -10
  38. package/instance/instance.js +35 -31
  39. package/instance/instance.js.map +1 -1
  40. package/job/job.cjs +24 -26
  41. package/job/job.cjs.map +1 -1
  42. package/job/job.d.ts +1 -1
  43. package/job/job.js +25 -27
  44. package/job/job.js.map +1 -1
  45. package/metadata/metadata.cjs +13 -19
  46. package/metadata/metadata.cjs.map +1 -1
  47. package/metadata/metadata.d.ts +7 -7
  48. package/metadata/metadata.js +14 -20
  49. package/metadata/metadata.js.map +1 -1
  50. package/package.json +1 -1
  51. package/project/project.cjs +38 -31
  52. package/project/project.cjs.map +1 -1
  53. package/project/project.d.ts +19 -19
  54. package/project/project.js +39 -32
  55. package/project/project.js.map +1 -1
  56. package/src/accounting/accounting.ts +96 -132
  57. package/src/admin/admin.ts +307 -442
  58. package/src/application/application.ts +66 -94
  59. package/src/data-manager-api.schemas.ts +425 -470
  60. package/src/dataset/dataset.ts +367 -554
  61. package/src/exchange-rate/exchange-rate.ts +221 -339
  62. package/src/file/file.ts +177 -253
  63. package/src/instance/instance.ts +217 -314
  64. package/src/job/job.ts +88 -116
  65. package/src/metadata/metadata.ts +154 -245
  66. package/src/project/project.ts +347 -511
  67. package/src/task/task.ts +105 -141
  68. package/src/type/type.ts +38 -43
  69. package/src/user/user.ts +136 -197
  70. package/task/task.cjs +25 -27
  71. package/task/task.cjs.map +1 -1
  72. package/task/task.d.ts +1 -1
  73. package/task/task.js +26 -28
  74. package/task/task.js.map +1 -1
  75. package/type/type.cjs +8 -4
  76. package/type/type.cjs.map +1 -1
  77. package/type/type.d.ts +1 -1
  78. package/type/type.js +9 -5
  79. package/type/type.js.map +1 -1
  80. package/user/user.cjs +28 -33
  81. package/user/user.cjs.map +1 -1
  82. package/user/user.d.ts +4 -4
  83. package/user/user.js +29 -34
  84. package/user/user.js.map +1 -1
@@ -8,28 +8,32 @@ A service that allows *registered* users to make **Datasets** and associated **M
8
8
 
9
9
  * OpenAPI spec version: 1.0
10
10
  */
11
- import { useQuery, useMutation } from "react-query";
11
+ import {
12
+ useQuery,
13
+ useMutation
14
+ } from 'react-query'
12
15
  import type {
13
16
  UseQueryOptions,
14
17
  UseMutationOptions,
15
18
  QueryFunction,
16
19
  MutationFunction,
17
20
  UseQueryResult,
18
- QueryKey,
19
- } from "react-query";
21
+ QueryKey
22
+ } from 'react-query'
20
23
  import type {
21
24
  DatasetMetaGetResponse,
22
25
  DmError,
23
26
  DatasetVersionMetaPostBodyBody,
24
- DatasetMetaPostBodyBody,
25
- } from "../data-manager-api.schemas";
26
- import { customInstance } from ".././custom-instance";
27
- import type { ErrorType } from ".././custom-instance";
27
+ DatasetMetaPostBodyBody
28
+ } from '../data-manager-api.schemas'
29
+ import { customInstance } from '.././custom-instance'
30
+ import type { ErrorType } from '.././custom-instance'
31
+
28
32
 
29
33
  // eslint-disable-next-line
30
- type SecondParameter<T extends (...args: any) => any> = T extends (
34
+ type SecondParameter<T extends (...args: any) => any> = T extends (
31
35
  config: any,
32
- args: infer P
36
+ args: infer P,
33
37
  ) => any
34
38
  ? P
35
39
  : never;
@@ -44,151 +48,92 @@ The annotations are provided in a list in JSON format. For details of the annota
44
48
  * @summary Update Metadata for the Dataset version
45
49
  */
46
50
  export const addMetadataVersion = (
47
- datasetId: string,
48
- datasetVersion: number,
49
- datasetVersionMetaPostBodyBody: DatasetVersionMetaPostBodyBody,
50
- options?: SecondParameter<typeof customInstance>
51
- ) => {
52
- const formData = new FormData();
53
- if (datasetVersionMetaPostBodyBody.meta_properties !== undefined) {
54
- formData.append(
55
- "meta_properties",
56
- datasetVersionMetaPostBodyBody.meta_properties
57
- );
58
- }
59
- if (datasetVersionMetaPostBodyBody.annotations !== undefined) {
60
- formData.append("annotations", datasetVersionMetaPostBodyBody.annotations);
61
- }
62
-
63
- return customInstance<DatasetMetaGetResponse>(
64
- {
65
- url: `/dataset/${datasetId}/meta/${datasetVersion}`,
66
- method: "post",
67
- headers: { "Content-Type": "multipart/form-data" },
68
- data: formData,
69
- },
70
- options
71
- );
72
- };
73
-
74
- export type AddMetadataVersionMutationResult = NonNullable<
75
- Awaited<ReturnType<typeof addMetadataVersion>>
76
- >;
77
- export type AddMetadataVersionMutationBody = DatasetVersionMetaPostBodyBody;
78
- export type AddMetadataVersionMutationError = ErrorType<DmError | void>;
79
-
80
- export const useAddMetadataVersion = <
81
- TError = ErrorType<DmError | void>,
82
- TContext = unknown
83
- >(options?: {
84
- mutation?: UseMutationOptions<
85
- Awaited<ReturnType<typeof addMetadataVersion>>,
86
- TError,
87
- {
88
- datasetId: string;
89
- datasetVersion: number;
90
- data: DatasetVersionMetaPostBodyBody;
51
+ datasetId: string,
52
+ datasetVersion: number,
53
+ datasetVersionMetaPostBodyBody: DatasetVersionMetaPostBodyBody,
54
+ options?: SecondParameter<typeof customInstance>,) => {const formData = new FormData();
55
+ if(datasetVersionMetaPostBodyBody.meta_properties !== undefined) {
56
+ formData.append('meta_properties', datasetVersionMetaPostBodyBody.meta_properties)
57
+ }
58
+ if(datasetVersionMetaPostBodyBody.annotations !== undefined) {
59
+ formData.append('annotations', datasetVersionMetaPostBodyBody.annotations)
60
+ }
61
+
62
+ return customInstance<DatasetMetaGetResponse>(
63
+ {url: `/dataset/${datasetId}/meta/${datasetVersion}`, method: 'post',
64
+ headers: {'Content-Type': 'multipart/form-data', },
65
+ data: formData
91
66
  },
92
- TContext
93
- >;
94
- request?: SecondParameter<typeof customInstance>;
95
- }) => {
96
- const { mutation: mutationOptions, request: requestOptions } = options ?? {};
97
-
98
- const mutationFn: MutationFunction<
99
- Awaited<ReturnType<typeof addMetadataVersion>>,
100
- {
101
- datasetId: string;
102
- datasetVersion: number;
103
- data: DatasetVersionMetaPostBodyBody;
67
+ options);
104
68
  }
105
- > = (props) => {
106
- const { datasetId, datasetVersion, data } = props ?? {};
107
-
108
- return addMetadataVersion(datasetId, datasetVersion, data, requestOptions);
109
- };
110
-
111
- return useMutation<
112
- Awaited<ReturnType<typeof addMetadataVersion>>,
113
- TError,
114
- {
115
- datasetId: string;
116
- datasetVersion: number;
117
- data: DatasetVersionMetaPostBodyBody;
118
- },
119
- TContext
120
- >(mutationFn, mutationOptions);
121
- };
122
- /**
69
+
70
+
71
+
72
+ export type AddMetadataVersionMutationResult = NonNullable<Awaited<ReturnType<typeof addMetadataVersion>>>
73
+ export type AddMetadataVersionMutationBody = DatasetVersionMetaPostBodyBody
74
+ export type AddMetadataVersionMutationError = ErrorType<DmError | void>
75
+
76
+ export const useAddMetadataVersion = <TError = ErrorType<DmError | void>,
77
+
78
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addMetadataVersion>>, TError,{datasetId: string;datasetVersion: number;data: DatasetVersionMetaPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
79
+ ) => {
80
+ const {mutation: mutationOptions, request: requestOptions} = options ?? {}
81
+
82
+
83
+
84
+
85
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof addMetadataVersion>>, {datasetId: string;datasetVersion: number;data: DatasetVersionMetaPostBodyBody}> = (props) => {
86
+ const {datasetId,datasetVersion,data} = props ?? {};
87
+
88
+ return addMetadataVersion(datasetId,datasetVersion,data,requestOptions)
89
+ }
90
+
91
+ return useMutation<Awaited<ReturnType<typeof addMetadataVersion>>, TError, {datasetId: string;datasetVersion: number;data: DatasetVersionMetaPostBodyBody}, TContext>(mutationFn, mutationOptions)
92
+ }
93
+ /**
123
94
  * Returns the metadata for a Dataset version in JSON format.
124
95
 
125
96
  * @summary Gets the Metadata for a specific Dataset version
126
97
  */
127
98
  export const getMetadataVersion = (
128
- datasetId: string,
129
- datasetVersion: number,
130
- options?: SecondParameter<typeof customInstance>,
131
- signal?: AbortSignal
99
+ datasetId: string,
100
+ datasetVersion: number,
101
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
132
102
  ) => {
133
- return customInstance<DatasetMetaGetResponse>(
134
- {
135
- url: `/dataset/${datasetId}/meta/${datasetVersion}`,
136
- method: "get",
137
- signal,
103
+ return customInstance<DatasetMetaGetResponse>(
104
+ {url: `/dataset/${datasetId}/meta/${datasetVersion}`, method: 'get', signal
138
105
  },
139
- options
140
- );
141
- };
142
-
143
- export const getGetMetadataVersionQueryKey = (
144
- datasetId: string,
145
- datasetVersion: number
146
- ) => [`/dataset/${datasetId}/meta/${datasetVersion}`];
147
-
148
- export type GetMetadataVersionQueryResult = NonNullable<
149
- Awaited<ReturnType<typeof getMetadataVersion>>
150
- >;
151
- export type GetMetadataVersionQueryError = ErrorType<void | DmError>;
152
-
153
- export const useGetMetadataVersion = <
154
- TData = Awaited<ReturnType<typeof getMetadataVersion>>,
155
- TError = ErrorType<void | DmError>
156
- >(
157
- datasetId: string,
158
- datasetVersion: number,
159
- options?: {
160
- query?: UseQueryOptions<
161
- Awaited<ReturnType<typeof getMetadataVersion>>,
162
- TError,
163
- TData
164
- >;
165
- request?: SecondParameter<typeof customInstance>;
166
- }
167
- ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
168
- const { query: queryOptions, request: requestOptions } = options ?? {};
169
-
170
- const queryKey =
171
- queryOptions?.queryKey ??
172
- getGetMetadataVersionQueryKey(datasetId, datasetVersion);
173
-
174
- const queryFn: QueryFunction<
175
- Awaited<ReturnType<typeof getMetadataVersion>>
176
- > = ({ signal }) =>
177
- getMetadataVersion(datasetId, datasetVersion, requestOptions, signal);
178
-
179
- const query = useQuery<
180
- Awaited<ReturnType<typeof getMetadataVersion>>,
181
- TError,
182
- TData
183
- >(queryKey, queryFn, {
184
- enabled: !!(datasetId && datasetVersion),
185
- ...queryOptions,
186
- }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
106
+ options);
107
+ }
108
+
109
+
110
+ export const getGetMetadataVersionQueryKey = (datasetId: string,
111
+ datasetVersion: number,) => [`/dataset/${datasetId}/meta/${datasetVersion}`];
112
+
113
+
114
+ export type GetMetadataVersionQueryResult = NonNullable<Awaited<ReturnType<typeof getMetadataVersion>>>
115
+ export type GetMetadataVersionQueryError = ErrorType<void | DmError>
116
+
117
+ export const useGetMetadataVersion = <TData = Awaited<ReturnType<typeof getMetadataVersion>>, TError = ErrorType<void | DmError>>(
118
+ datasetId: string,
119
+ datasetVersion: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getMetadataVersion>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
120
+
121
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
122
+
123
+ const {query: queryOptions, request: requestOptions} = options ?? {}
124
+
125
+ const queryKey = queryOptions?.queryKey ?? getGetMetadataVersionQueryKey(datasetId,datasetVersion);
126
+
127
+
128
+
129
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadataVersion>>> = ({ signal }) => getMetadataVersion(datasetId,datasetVersion, requestOptions, signal);
130
+
131
+ const query = useQuery<Awaited<ReturnType<typeof getMetadataVersion>>, TError, TData>(queryKey, queryFn, {enabled: !!(datasetId && datasetVersion), ...queryOptions}) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
187
132
 
188
133
  query.queryKey = queryKey;
189
134
 
190
135
  return query;
191
- };
136
+ }
192
137
 
193
138
  /**
194
139
  * Update default parameters or add new labels to the metadata for the dataset.
@@ -198,122 +143,86 @@ The labels are provided in a list in JSON format. For details of the label forma
198
143
  * @summary Update Metadata for the Dataset
199
144
  */
200
145
  export const addMetadata = (
201
- datasetId: string,
202
- datasetMetaPostBodyBody: DatasetMetaPostBodyBody,
203
- options?: SecondParameter<typeof customInstance>
204
- ) => {
205
- const formData = new FormData();
206
- if (datasetMetaPostBodyBody.meta_properties !== undefined) {
207
- formData.append("meta_properties", datasetMetaPostBodyBody.meta_properties);
208
- }
209
- if (datasetMetaPostBodyBody.labels !== undefined) {
210
- formData.append("labels", datasetMetaPostBodyBody.labels);
211
- }
212
-
213
- return customInstance<DatasetMetaGetResponse>(
214
- {
215
- url: `/dataset/${datasetId}/meta`,
216
- method: "post",
217
- headers: { "Content-Type": "multipart/form-data" },
218
- data: formData,
146
+ datasetId: string,
147
+ datasetMetaPostBodyBody: DatasetMetaPostBodyBody,
148
+ options?: SecondParameter<typeof customInstance>,) => {const formData = new FormData();
149
+ if(datasetMetaPostBodyBody.meta_properties !== undefined) {
150
+ formData.append('meta_properties', datasetMetaPostBodyBody.meta_properties)
151
+ }
152
+ if(datasetMetaPostBodyBody.labels !== undefined) {
153
+ formData.append('labels', datasetMetaPostBodyBody.labels)
154
+ }
155
+
156
+ return customInstance<DatasetMetaGetResponse>(
157
+ {url: `/dataset/${datasetId}/meta`, method: 'post',
158
+ headers: {'Content-Type': 'multipart/form-data', },
159
+ data: formData
219
160
  },
220
- options
221
- );
222
- };
223
-
224
- export type AddMetadataMutationResult = NonNullable<
225
- Awaited<ReturnType<typeof addMetadata>>
226
- >;
227
- export type AddMetadataMutationBody = DatasetMetaPostBodyBody;
228
- export type AddMetadataMutationError = ErrorType<DmError | void>;
229
-
230
- export const useAddMetadata = <
231
- TError = ErrorType<DmError | void>,
232
- TContext = unknown
233
- >(options?: {
234
- mutation?: UseMutationOptions<
235
- Awaited<ReturnType<typeof addMetadata>>,
236
- TError,
237
- { datasetId: string; data: DatasetMetaPostBodyBody },
238
- TContext
239
- >;
240
- request?: SecondParameter<typeof customInstance>;
241
- }) => {
242
- const { mutation: mutationOptions, request: requestOptions } = options ?? {};
243
-
244
- const mutationFn: MutationFunction<
245
- Awaited<ReturnType<typeof addMetadata>>,
246
- { datasetId: string; data: DatasetMetaPostBodyBody }
247
- > = (props) => {
248
- const { datasetId, data } = props ?? {};
249
-
250
- return addMetadata(datasetId, data, requestOptions);
251
- };
252
-
253
- return useMutation<
254
- Awaited<ReturnType<typeof addMetadata>>,
255
- TError,
256
- { datasetId: string; data: DatasetMetaPostBodyBody },
257
- TContext
258
- >(mutationFn, mutationOptions);
259
- };
260
- /**
161
+ options);
162
+ }
163
+
164
+
165
+
166
+ export type AddMetadataMutationResult = NonNullable<Awaited<ReturnType<typeof addMetadata>>>
167
+ export type AddMetadataMutationBody = DatasetMetaPostBodyBody
168
+ export type AddMetadataMutationError = ErrorType<DmError | void>
169
+
170
+ export const useAddMetadata = <TError = ErrorType<DmError | void>,
171
+
172
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addMetadata>>, TError,{datasetId: string;data: DatasetMetaPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
173
+ ) => {
174
+ const {mutation: mutationOptions, request: requestOptions} = options ?? {}
175
+
176
+
177
+
178
+
179
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof addMetadata>>, {datasetId: string;data: DatasetMetaPostBodyBody}> = (props) => {
180
+ const {datasetId,data} = props ?? {};
181
+
182
+ return addMetadata(datasetId,data,requestOptions)
183
+ }
184
+
185
+ return useMutation<Awaited<ReturnType<typeof addMetadata>>, TError, {datasetId: string;data: DatasetMetaPostBodyBody}, TContext>(mutationFn, mutationOptions)
186
+ }
187
+ /**
261
188
  * Returns the metadata for a Dataset in JSON format.
262
189
 
263
190
  * @summary Gets the Metadata for a specific Dataset
264
191
  */
265
192
  export const getMetadata = (
266
- datasetId: string,
267
- options?: SecondParameter<typeof customInstance>,
268
- signal?: AbortSignal
193
+ datasetId: string,
194
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
269
195
  ) => {
270
- return customInstance<DatasetMetaGetResponse>(
271
- { url: `/dataset/${datasetId}/meta`, method: "get", signal },
272
- options
273
- );
274
- };
275
-
276
- export const getGetMetadataQueryKey = (datasetId: string) => [
277
- `/dataset/${datasetId}/meta`,
278
- ];
279
-
280
- export type GetMetadataQueryResult = NonNullable<
281
- Awaited<ReturnType<typeof getMetadata>>
282
- >;
283
- export type GetMetadataQueryError = ErrorType<void | DmError>;
284
-
285
- export const useGetMetadata = <
286
- TData = Awaited<ReturnType<typeof getMetadata>>,
287
- TError = ErrorType<void | DmError>
288
- >(
289
- datasetId: string,
290
- options?: {
291
- query?: UseQueryOptions<
292
- Awaited<ReturnType<typeof getMetadata>>,
293
- TError,
294
- TData
295
- >;
296
- request?: SecondParameter<typeof customInstance>;
297
- }
298
- ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
299
- const { query: queryOptions, request: requestOptions } = options ?? {};
196
+ return customInstance<DatasetMetaGetResponse>(
197
+ {url: `/dataset/${datasetId}/meta`, method: 'get', signal
198
+ },
199
+ options);
200
+ }
201
+
202
+
203
+ export const getGetMetadataQueryKey = (datasetId: string,) => [`/dataset/${datasetId}/meta`];
204
+
205
+
206
+ export type GetMetadataQueryResult = NonNullable<Awaited<ReturnType<typeof getMetadata>>>
207
+ export type GetMetadataQueryError = ErrorType<void | DmError>
208
+
209
+ export const useGetMetadata = <TData = Awaited<ReturnType<typeof getMetadata>>, TError = ErrorType<void | DmError>>(
210
+ datasetId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
211
+
212
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
213
+
214
+ const {query: queryOptions, request: requestOptions} = options ?? {}
300
215
 
301
216
  const queryKey = queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetId);
302
217
 
303
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadata>>> = ({
304
- signal,
305
- }) => getMetadata(datasetId, requestOptions, signal);
218
+
306
219
 
307
- const query = useQuery<
308
- Awaited<ReturnType<typeof getMetadata>>,
309
- TError,
310
- TData
311
- >(queryKey, queryFn, {
312
- enabled: !!datasetId,
313
- ...queryOptions,
314
- }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
220
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadata>>> = ({ signal }) => getMetadata(datasetId, requestOptions, signal);
221
+
222
+ const query = useQuery<Awaited<ReturnType<typeof getMetadata>>, TError, TData>(queryKey, queryFn, {enabled: !!(datasetId), ...queryOptions}) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
315
223
 
316
224
  query.queryKey = queryKey;
317
225
 
318
226
  return query;
319
- };
227
+ }
228
+