@squonk/data-manager-client 4.2.0 → 4.3.0
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 +96 -95
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.cts +47 -47
- package/accounting/accounting.d.ts +47 -47
- package/accounting/accounting.js +102 -101
- 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 +121 -121
- package/admin/admin.d.ts +121 -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-OYRETEBZ.js +25 -0
- package/chunk-OYRETEBZ.js.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/chunk-ZLY5XEOQ.cjs +25 -0
- package/chunk-ZLY5XEOQ.cjs.map +1 -0
- package/configuration/configuration.cjs +38 -45
- package/configuration/configuration.cjs.map +1 -1
- package/configuration/configuration.d.cts +25 -25
- package/configuration/configuration.d.ts +25 -25
- 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/exchange-rate/exchange-rate.cjs +111 -109
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.cts +69 -69
- package/exchange-rate/exchange-rate.d.ts +69 -69
- package/exchange-rate/exchange-rate.js +117 -115
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file-and-path/file-and-path.cjs +93 -138
- package/file-and-path/file-and-path.cjs.map +1 -1
- package/file-and-path/file-and-path.d.cts +102 -102
- package/file-and-path/file-and-path.d.ts +102 -102
- package/file-and-path/file-and-path.js +105 -150
- package/file-and-path/file-and-path.js.map +1 -1
- package/index.cjs +80 -102
- package/index.cjs.map +1 -1
- package/index.d.cts +2401 -2326
- package/index.d.ts +2401 -2326
- package/index.js +79 -101
- 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 +55 -67
- package/job/job.cjs.map +1 -1
- package/job/job.d.cts +36 -36
- package/job/job.d.ts +36 -36
- package/job/job.js +60 -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 +165 -186
- package/project/project.cjs.map +1 -1
- package/project/project.d.cts +157 -157
- package/project/project.d.ts +157 -157
- package/project/project.js +172 -193
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +767 -461
- package/src/admin/admin.ts +1187 -787
- package/src/application/application.ts +377 -231
- package/src/configuration/configuration.ts +348 -237
- package/src/custom-instance.ts +3 -3
- package/src/data-manager-api.schemas.ts +2538 -2492
- package/src/dataset/dataset.ts +1199 -792
- package/src/digest/digest.ts +198 -122
- package/src/exchange-rate/exchange-rate.ts +1088 -612
- package/src/file-and-path/file-and-path.ts +869 -616
- package/src/index.ts +2 -2
- package/src/instance/instance.ts +804 -539
- package/src/inventory/inventory.ts +200 -122
- package/src/job/job.ts +556 -348
- package/src/metadata/metadata.ts +587 -371
- package/src/options-mutator.ts +27 -0
- package/src/project/project.ts +1576 -1034
- package/src/task/task.ts +434 -295
- package/src/type/type.ts +180 -126
- package/src/user/user.ts +846 -398
- package/src/workflow/workflow.ts +1750 -1089
- 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 +146 -146
- package/workflow/workflow.d.ts +146 -146
- 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/src/metadata/metadata.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
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.
|
|
@@ -9,16 +8,13 @@ A service that allows *registered* users to make **Datasets** and associated **M
|
|
|
9
8
|
|
|
10
9
|
* OpenAPI spec version: 4.1
|
|
11
10
|
*/
|
|
12
|
-
import {
|
|
13
|
-
useMutation,
|
|
14
|
-
useQuery,
|
|
15
|
-
useSuspenseQuery
|
|
16
|
-
} from '@tanstack/react-query'
|
|
11
|
+
import { useMutation, useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
17
12
|
import type {
|
|
18
13
|
DataTag,
|
|
19
14
|
DefinedInitialDataOptions,
|
|
20
15
|
DefinedUseQueryResult,
|
|
21
16
|
MutationFunction,
|
|
17
|
+
QueryClient,
|
|
22
18
|
QueryFunction,
|
|
23
19
|
QueryKey,
|
|
24
20
|
UndefinedInitialDataOptions,
|
|
@@ -27,20 +23,22 @@ import type {
|
|
|
27
23
|
UseQueryOptions,
|
|
28
24
|
UseQueryResult,
|
|
29
25
|
UseSuspenseQueryOptions,
|
|
30
|
-
UseSuspenseQueryResult
|
|
31
|
-
} from
|
|
26
|
+
UseSuspenseQueryResult,
|
|
27
|
+
} from "@tanstack/react-query";
|
|
28
|
+
|
|
32
29
|
import type {
|
|
33
30
|
DatasetMetaGetResponse,
|
|
34
31
|
DatasetMetaPostBodyBody,
|
|
35
32
|
DatasetVersionMetaPostBodyBody,
|
|
36
|
-
DmError
|
|
37
|
-
} from
|
|
38
|
-
import { customInstance } from '.././custom-instance';
|
|
39
|
-
import type { ErrorType } from '.././custom-instance';
|
|
40
|
-
|
|
33
|
+
DmError,
|
|
34
|
+
} from "../data-manager-api.schemas";
|
|
41
35
|
|
|
42
|
-
|
|
36
|
+
import { customInstance } from ".././custom-instance";
|
|
37
|
+
import type { ErrorType } from ".././custom-instance";
|
|
38
|
+
import { mutationMutator } from ".././options-mutator";
|
|
39
|
+
import { queryMutator } from ".././options-mutator";
|
|
43
40
|
|
|
41
|
+
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
44
42
|
|
|
45
43
|
/**
|
|
46
44
|
* Update parameters or add new annotations of the specified type(s) and to the Metadata for a **Dataset Version**.
|
|
@@ -52,229 +50,346 @@ The annotations are provided in a list in JSON format. For details of the annota
|
|
|
52
50
|
* @summary Update Metadata for the Dataset version
|
|
53
51
|
*/
|
|
54
52
|
export const addMetadataVersion = (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
datasetId: string,
|
|
54
|
+
datasetVersion: number,
|
|
55
|
+
datasetVersionMetaPostBodyBody: DatasetVersionMetaPostBodyBody,
|
|
56
|
+
options?: SecondParameter<typeof customInstance>,
|
|
57
|
+
signal?: AbortSignal,
|
|
59
58
|
) => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
59
|
+
const formUrlEncoded = new URLSearchParams();
|
|
60
|
+
if (datasetVersionMetaPostBodyBody.meta_properties !== undefined) {
|
|
61
|
+
formUrlEncoded.append(`meta_properties`, datasetVersionMetaPostBodyBody.meta_properties);
|
|
62
|
+
}
|
|
63
|
+
if (datasetVersionMetaPostBodyBody.annotations !== undefined) {
|
|
64
|
+
formUrlEncoded.append(`annotations`, datasetVersionMetaPostBodyBody.annotations);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return customInstance<DatasetMetaGetResponse>(
|
|
68
|
+
{
|
|
69
|
+
url: `/dataset/${datasetId}/meta/${datasetVersion}`,
|
|
70
|
+
method: "POST",
|
|
71
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
72
|
+
data: formUrlEncoded,
|
|
73
|
+
signal,
|
|
73
74
|
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
75
|
+
options,
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const useAddMetadataVersionMutationOptions = <
|
|
80
|
+
TError = ErrorType<DmError | void>,
|
|
81
|
+
TContext = unknown,
|
|
82
|
+
>(options?: {
|
|
83
|
+
mutation?: UseMutationOptions<
|
|
84
|
+
Awaited<ReturnType<typeof addMetadataVersion>>,
|
|
85
|
+
TError,
|
|
86
|
+
{ datasetId: string; datasetVersion: number; data: DatasetVersionMetaPostBodyBody },
|
|
87
|
+
TContext
|
|
88
|
+
>;
|
|
89
|
+
request?: SecondParameter<typeof customInstance>;
|
|
90
|
+
}): UseMutationOptions<
|
|
91
|
+
Awaited<ReturnType<typeof addMetadataVersion>>,
|
|
92
|
+
TError,
|
|
93
|
+
{ datasetId: string; datasetVersion: number; data: DatasetVersionMetaPostBodyBody },
|
|
94
|
+
TContext
|
|
95
|
+
> => {
|
|
96
|
+
const mutationKey = ["addMetadataVersion"];
|
|
97
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
98
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
99
|
+
? options
|
|
100
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
101
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
102
|
+
|
|
103
|
+
const mutationFn: MutationFunction<
|
|
104
|
+
Awaited<ReturnType<typeof addMetadataVersion>>,
|
|
105
|
+
{ datasetId: string; datasetVersion: number; data: DatasetVersionMetaPostBodyBody }
|
|
106
|
+
> = (props) => {
|
|
107
|
+
const { datasetId, datasetVersion, data } = props ?? {};
|
|
108
|
+
|
|
109
|
+
return addMetadataVersion(datasetId, datasetVersion, data, requestOptions);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
113
|
+
|
|
114
|
+
return customOptions;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export type AddMetadataVersionMutationResult = NonNullable<
|
|
118
|
+
Awaited<ReturnType<typeof addMetadataVersion>>
|
|
119
|
+
>;
|
|
120
|
+
export type AddMetadataVersionMutationBody = DatasetVersionMetaPostBodyBody;
|
|
121
|
+
export type AddMetadataVersionMutationError = ErrorType<DmError | void>;
|
|
91
122
|
|
|
92
|
-
|
|
93
|
-
const {datasetId,datasetVersion,data} = props ?? {};
|
|
94
|
-
|
|
95
|
-
return addMetadataVersion(datasetId,datasetVersion,data,requestOptions)
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{datasetId: string;datasetVersion: number;data: DatasetVersionMetaPostBodyBody}, TContext>}
|
|
102
|
-
|
|
103
|
-
export type AddMetadataVersionMutationResult = NonNullable<Awaited<ReturnType<typeof addMetadataVersion>>>
|
|
104
|
-
export type AddMetadataVersionMutationBody = DatasetVersionMetaPostBodyBody
|
|
105
|
-
export type AddMetadataVersionMutationError = ErrorType<DmError | void>
|
|
106
|
-
|
|
107
|
-
/**
|
|
123
|
+
/**
|
|
108
124
|
* @summary Update Metadata for the Dataset version
|
|
109
125
|
*/
|
|
110
|
-
export const useAddMetadataVersion = <
|
|
111
|
-
|
|
126
|
+
export const useAddMetadataVersion = <TError = ErrorType<DmError | void>, TContext = unknown>(
|
|
127
|
+
options?: {
|
|
128
|
+
mutation?: UseMutationOptions<
|
|
129
|
+
Awaited<ReturnType<typeof addMetadataVersion>>,
|
|
130
|
+
TError,
|
|
131
|
+
{ datasetId: string; datasetVersion: number; data: DatasetVersionMetaPostBodyBody },
|
|
132
|
+
TContext
|
|
133
|
+
>;
|
|
134
|
+
request?: SecondParameter<typeof customInstance>;
|
|
135
|
+
},
|
|
136
|
+
queryClient?: QueryClient,
|
|
112
137
|
): UseMutationResult<
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
/**
|
|
138
|
+
Awaited<ReturnType<typeof addMetadataVersion>>,
|
|
139
|
+
TError,
|
|
140
|
+
{ datasetId: string; datasetVersion: number; data: DatasetVersionMetaPostBodyBody },
|
|
141
|
+
TContext
|
|
142
|
+
> => {
|
|
143
|
+
const mutationOptions = useAddMetadataVersionMutationOptions(options);
|
|
144
|
+
|
|
145
|
+
return useMutation(mutationOptions, queryClient);
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
124
148
|
* Returns the Metadata for a **Dataset Version** in JSON format.
|
|
125
149
|
|
|
126
150
|
* @summary Gets the Metadata for a specific Dataset Version
|
|
127
151
|
*/
|
|
128
152
|
export const getMetadataVersion = (
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
153
|
+
datasetId: string,
|
|
154
|
+
datasetVersion: number,
|
|
155
|
+
options?: SecondParameter<typeof customInstance>,
|
|
156
|
+
signal?: AbortSignal,
|
|
132
157
|
) => {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
158
|
+
return customInstance<DatasetMetaGetResponse>(
|
|
159
|
+
{ url: `/dataset/${datasetId}/meta/${datasetVersion}`, method: "GET", signal },
|
|
160
|
+
options,
|
|
161
|
+
);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export const getGetMetadataVersionQueryKey = (datasetId: string, datasetVersion: number) => {
|
|
165
|
+
return [`/dataset/${datasetId}/meta/${datasetVersion}`] as const;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export const useGetMetadataVersionQueryOptions = <
|
|
169
|
+
TData = Awaited<ReturnType<typeof getMetadataVersion>>,
|
|
170
|
+
TError = ErrorType<void | DmError>,
|
|
171
|
+
>(
|
|
172
|
+
datasetId: string,
|
|
173
|
+
datasetVersion: number,
|
|
174
|
+
options?: {
|
|
175
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMetadataVersion>>, TError, TData>>;
|
|
176
|
+
request?: SecondParameter<typeof customInstance>;
|
|
177
|
+
},
|
|
150
178
|
) => {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
export type
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
export
|
|
172
|
-
|
|
173
|
-
|
|
179
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
180
|
+
|
|
181
|
+
const queryKey =
|
|
182
|
+
queryOptions?.queryKey ?? getGetMetadataVersionQueryKey(datasetId, datasetVersion);
|
|
183
|
+
|
|
184
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadataVersion>>> = ({ signal }) =>
|
|
185
|
+
getMetadataVersion(datasetId, datasetVersion, requestOptions, signal);
|
|
186
|
+
|
|
187
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
188
|
+
|
|
189
|
+
return customOptions as UseQueryOptions<
|
|
190
|
+
Awaited<ReturnType<typeof getMetadataVersion>>,
|
|
191
|
+
TError,
|
|
192
|
+
TData
|
|
193
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
export type GetMetadataVersionQueryResult = NonNullable<
|
|
197
|
+
Awaited<ReturnType<typeof getMetadataVersion>>
|
|
198
|
+
>;
|
|
199
|
+
export type GetMetadataVersionQueryError = ErrorType<void | DmError>;
|
|
200
|
+
|
|
201
|
+
export function useGetMetadataVersion<
|
|
202
|
+
TData = Awaited<ReturnType<typeof getMetadataVersion>>,
|
|
203
|
+
TError = ErrorType<void | DmError>,
|
|
204
|
+
>(
|
|
205
|
+
datasetId: string,
|
|
206
|
+
datasetVersion: number,
|
|
207
|
+
options: {
|
|
208
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMetadataVersion>>, TError, TData>> &
|
|
209
|
+
Pick<
|
|
174
210
|
DefinedInitialDataOptions<
|
|
175
211
|
Awaited<ReturnType<typeof getMetadataVersion>>,
|
|
176
212
|
TError,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
213
|
+
Awaited<ReturnType<typeof getMetadataVersion>>
|
|
214
|
+
>,
|
|
215
|
+
"initialData"
|
|
216
|
+
>;
|
|
217
|
+
request?: SecondParameter<typeof customInstance>;
|
|
218
|
+
},
|
|
219
|
+
queryClient?: QueryClient,
|
|
220
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
221
|
+
export function useGetMetadataVersion<
|
|
222
|
+
TData = Awaited<ReturnType<typeof getMetadataVersion>>,
|
|
223
|
+
TError = ErrorType<void | DmError>,
|
|
224
|
+
>(
|
|
225
|
+
datasetId: string,
|
|
226
|
+
datasetVersion: number,
|
|
227
|
+
options?: {
|
|
228
|
+
query?: Partial<
|
|
229
|
+
UseQueryOptions<Awaited<ReturnType<typeof getMetadataVersion>>, TError, TData>
|
|
230
|
+
> &
|
|
231
|
+
Pick<
|
|
185
232
|
UndefinedInitialDataOptions<
|
|
186
233
|
Awaited<ReturnType<typeof getMetadataVersion>>,
|
|
187
234
|
TError,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
235
|
+
Awaited<ReturnType<typeof getMetadataVersion>>
|
|
236
|
+
>,
|
|
237
|
+
"initialData"
|
|
238
|
+
>;
|
|
239
|
+
request?: SecondParameter<typeof customInstance>;
|
|
240
|
+
},
|
|
241
|
+
queryClient?: QueryClient,
|
|
242
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
243
|
+
export function useGetMetadataVersion<
|
|
244
|
+
TData = Awaited<ReturnType<typeof getMetadataVersion>>,
|
|
245
|
+
TError = ErrorType<void | DmError>,
|
|
246
|
+
>(
|
|
247
|
+
datasetId: string,
|
|
248
|
+
datasetVersion: number,
|
|
249
|
+
options?: {
|
|
250
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMetadataVersion>>, TError, TData>>;
|
|
251
|
+
request?: SecondParameter<typeof customInstance>;
|
|
252
|
+
},
|
|
253
|
+
queryClient?: QueryClient,
|
|
254
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
198
255
|
/**
|
|
199
256
|
* @summary Gets the Metadata for a specific Dataset Version
|
|
200
257
|
*/
|
|
201
258
|
|
|
202
|
-
export function useGetMetadataVersion<
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
259
|
+
export function useGetMetadataVersion<
|
|
260
|
+
TData = Awaited<ReturnType<typeof getMetadataVersion>>,
|
|
261
|
+
TError = ErrorType<void | DmError>,
|
|
262
|
+
>(
|
|
263
|
+
datasetId: string,
|
|
264
|
+
datasetVersion: number,
|
|
265
|
+
options?: {
|
|
266
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMetadataVersion>>, TError, TData>>;
|
|
267
|
+
request?: SecondParameter<typeof customInstance>;
|
|
268
|
+
},
|
|
269
|
+
queryClient?: QueryClient,
|
|
270
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
271
|
+
const queryOptions = useGetMetadataVersionQueryOptions(datasetId, datasetVersion, options);
|
|
272
|
+
|
|
273
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
274
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
query.queryKey = queryOptions.queryKey;
|
|
213
278
|
|
|
214
279
|
return query;
|
|
215
280
|
}
|
|
216
281
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
282
|
+
export const useGetMetadataVersionSuspenseQueryOptions = <
|
|
283
|
+
TData = Awaited<ReturnType<typeof getMetadataVersion>>,
|
|
284
|
+
TError = ErrorType<void | DmError>,
|
|
285
|
+
>(
|
|
286
|
+
datasetId: string,
|
|
287
|
+
datasetVersion: number,
|
|
288
|
+
options?: {
|
|
289
|
+
query?: Partial<
|
|
290
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMetadataVersion>>, TError, TData>
|
|
291
|
+
>;
|
|
292
|
+
request?: SecondParameter<typeof customInstance>;
|
|
293
|
+
},
|
|
221
294
|
) => {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
export type
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
export
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
295
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
296
|
+
|
|
297
|
+
const queryKey =
|
|
298
|
+
queryOptions?.queryKey ?? getGetMetadataVersionQueryKey(datasetId, datasetVersion);
|
|
299
|
+
|
|
300
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadataVersion>>> = ({ signal }) =>
|
|
301
|
+
getMetadataVersion(datasetId, datasetVersion, requestOptions, signal);
|
|
302
|
+
|
|
303
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
304
|
+
|
|
305
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
306
|
+
Awaited<ReturnType<typeof getMetadataVersion>>,
|
|
307
|
+
TError,
|
|
308
|
+
TData
|
|
309
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
export type GetMetadataVersionSuspenseQueryResult = NonNullable<
|
|
313
|
+
Awaited<ReturnType<typeof getMetadataVersion>>
|
|
314
|
+
>;
|
|
315
|
+
export type GetMetadataVersionSuspenseQueryError = ErrorType<void | DmError>;
|
|
316
|
+
|
|
317
|
+
export function useGetMetadataVersionSuspense<
|
|
318
|
+
TData = Awaited<ReturnType<typeof getMetadataVersion>>,
|
|
319
|
+
TError = ErrorType<void | DmError>,
|
|
320
|
+
>(
|
|
321
|
+
datasetId: string,
|
|
322
|
+
datasetVersion: number,
|
|
323
|
+
options: {
|
|
324
|
+
query: Partial<
|
|
325
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMetadataVersion>>, TError, TData>
|
|
326
|
+
>;
|
|
327
|
+
request?: SecondParameter<typeof customInstance>;
|
|
328
|
+
},
|
|
329
|
+
queryClient?: QueryClient,
|
|
330
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
331
|
+
export function useGetMetadataVersionSuspense<
|
|
332
|
+
TData = Awaited<ReturnType<typeof getMetadataVersion>>,
|
|
333
|
+
TError = ErrorType<void | DmError>,
|
|
334
|
+
>(
|
|
335
|
+
datasetId: string,
|
|
336
|
+
datasetVersion: number,
|
|
337
|
+
options?: {
|
|
338
|
+
query?: Partial<
|
|
339
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMetadataVersion>>, TError, TData>
|
|
340
|
+
>;
|
|
341
|
+
request?: SecondParameter<typeof customInstance>;
|
|
342
|
+
},
|
|
343
|
+
queryClient?: QueryClient,
|
|
344
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
345
|
+
export function useGetMetadataVersionSuspense<
|
|
346
|
+
TData = Awaited<ReturnType<typeof getMetadataVersion>>,
|
|
347
|
+
TError = ErrorType<void | DmError>,
|
|
348
|
+
>(
|
|
349
|
+
datasetId: string,
|
|
350
|
+
datasetVersion: number,
|
|
351
|
+
options?: {
|
|
352
|
+
query?: Partial<
|
|
353
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMetadataVersion>>, TError, TData>
|
|
354
|
+
>;
|
|
355
|
+
request?: SecondParameter<typeof customInstance>;
|
|
356
|
+
},
|
|
357
|
+
queryClient?: QueryClient,
|
|
358
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
257
359
|
/**
|
|
258
360
|
* @summary Gets the Metadata for a specific Dataset Version
|
|
259
361
|
*/
|
|
260
362
|
|
|
261
|
-
export function useGetMetadataVersionSuspense<
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
363
|
+
export function useGetMetadataVersionSuspense<
|
|
364
|
+
TData = Awaited<ReturnType<typeof getMetadataVersion>>,
|
|
365
|
+
TError = ErrorType<void | DmError>,
|
|
366
|
+
>(
|
|
367
|
+
datasetId: string,
|
|
368
|
+
datasetVersion: number,
|
|
369
|
+
options?: {
|
|
370
|
+
query?: Partial<
|
|
371
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMetadataVersion>>, TError, TData>
|
|
372
|
+
>;
|
|
373
|
+
request?: SecondParameter<typeof customInstance>;
|
|
374
|
+
},
|
|
375
|
+
queryClient?: QueryClient,
|
|
376
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
377
|
+
const queryOptions = useGetMetadataVersionSuspenseQueryOptions(
|
|
378
|
+
datasetId,
|
|
379
|
+
datasetVersion,
|
|
380
|
+
options,
|
|
381
|
+
);
|
|
382
|
+
|
|
383
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
384
|
+
TData,
|
|
385
|
+
TError
|
|
386
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
387
|
+
|
|
388
|
+
query.queryKey = queryOptions.queryKey;
|
|
272
389
|
|
|
273
390
|
return query;
|
|
274
391
|
}
|
|
275
392
|
|
|
276
|
-
|
|
277
|
-
|
|
278
393
|
/**
|
|
279
394
|
* Update default parameters or add new labels to the Metadata for the Dataset.
|
|
280
395
|
|
|
@@ -285,213 +400,314 @@ The labels are provided in a list in JSON format. For details of the label forma
|
|
|
285
400
|
* @summary Update Metadata for the Dataset
|
|
286
401
|
*/
|
|
287
402
|
export const addMetadata = (
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
403
|
+
datasetId: string,
|
|
404
|
+
datasetMetaPostBodyBody: DatasetMetaPostBodyBody,
|
|
405
|
+
options?: SecondParameter<typeof customInstance>,
|
|
406
|
+
signal?: AbortSignal,
|
|
291
407
|
) => {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
408
|
+
const formUrlEncoded = new URLSearchParams();
|
|
409
|
+
if (datasetMetaPostBodyBody.meta_properties !== undefined) {
|
|
410
|
+
formUrlEncoded.append(`meta_properties`, datasetMetaPostBodyBody.meta_properties);
|
|
411
|
+
}
|
|
412
|
+
if (datasetMetaPostBodyBody.labels !== undefined) {
|
|
413
|
+
formUrlEncoded.append(`labels`, datasetMetaPostBodyBody.labels);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
return customInstance<DatasetMetaGetResponse>(
|
|
417
|
+
{
|
|
418
|
+
url: `/dataset/${datasetId}/meta`,
|
|
419
|
+
method: "POST",
|
|
420
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
421
|
+
data: formUrlEncoded,
|
|
422
|
+
signal,
|
|
305
423
|
},
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
424
|
+
options,
|
|
425
|
+
);
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
export const useAddMetadataMutationOptions = <
|
|
429
|
+
TError = ErrorType<DmError | void>,
|
|
430
|
+
TContext = unknown,
|
|
431
|
+
>(options?: {
|
|
432
|
+
mutation?: UseMutationOptions<
|
|
433
|
+
Awaited<ReturnType<typeof addMetadata>>,
|
|
434
|
+
TError,
|
|
435
|
+
{ datasetId: string; data: DatasetMetaPostBodyBody },
|
|
436
|
+
TContext
|
|
437
|
+
>;
|
|
438
|
+
request?: SecondParameter<typeof customInstance>;
|
|
439
|
+
}): UseMutationOptions<
|
|
440
|
+
Awaited<ReturnType<typeof addMetadata>>,
|
|
441
|
+
TError,
|
|
442
|
+
{ datasetId: string; data: DatasetMetaPostBodyBody },
|
|
443
|
+
TContext
|
|
444
|
+
> => {
|
|
445
|
+
const mutationKey = ["addMetadata"];
|
|
446
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
447
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
448
|
+
? options
|
|
449
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
450
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
451
|
+
|
|
452
|
+
const mutationFn: MutationFunction<
|
|
453
|
+
Awaited<ReturnType<typeof addMetadata>>,
|
|
454
|
+
{ datasetId: string; data: DatasetMetaPostBodyBody }
|
|
455
|
+
> = (props) => {
|
|
456
|
+
const { datasetId, data } = props ?? {};
|
|
457
|
+
|
|
458
|
+
return addMetadata(datasetId, data, requestOptions);
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
462
|
+
|
|
463
|
+
return customOptions;
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
export type AddMetadataMutationResult = NonNullable<Awaited<ReturnType<typeof addMetadata>>>;
|
|
467
|
+
export type AddMetadataMutationBody = DatasetMetaPostBodyBody;
|
|
468
|
+
export type AddMetadataMutationError = ErrorType<DmError | void>;
|
|
323
469
|
|
|
324
|
-
|
|
325
|
-
const {datasetId,data} = props ?? {};
|
|
326
|
-
|
|
327
|
-
return addMetadata(datasetId,data,requestOptions)
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{datasetId: string;data: DatasetMetaPostBodyBody}, TContext>}
|
|
334
|
-
|
|
335
|
-
export type AddMetadataMutationResult = NonNullable<Awaited<ReturnType<typeof addMetadata>>>
|
|
336
|
-
export type AddMetadataMutationBody = DatasetMetaPostBodyBody
|
|
337
|
-
export type AddMetadataMutationError = ErrorType<DmError | void>
|
|
338
|
-
|
|
339
|
-
/**
|
|
470
|
+
/**
|
|
340
471
|
* @summary Update Metadata for the Dataset
|
|
341
472
|
*/
|
|
342
|
-
export const useAddMetadata = <
|
|
343
|
-
|
|
473
|
+
export const useAddMetadata = <TError = ErrorType<DmError | void>, TContext = unknown>(
|
|
474
|
+
options?: {
|
|
475
|
+
mutation?: UseMutationOptions<
|
|
476
|
+
Awaited<ReturnType<typeof addMetadata>>,
|
|
477
|
+
TError,
|
|
478
|
+
{ datasetId: string; data: DatasetMetaPostBodyBody },
|
|
479
|
+
TContext
|
|
480
|
+
>;
|
|
481
|
+
request?: SecondParameter<typeof customInstance>;
|
|
482
|
+
},
|
|
483
|
+
queryClient?: QueryClient,
|
|
344
484
|
): UseMutationResult<
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
/**
|
|
485
|
+
Awaited<ReturnType<typeof addMetadata>>,
|
|
486
|
+
TError,
|
|
487
|
+
{ datasetId: string; data: DatasetMetaPostBodyBody },
|
|
488
|
+
TContext
|
|
489
|
+
> => {
|
|
490
|
+
const mutationOptions = useAddMetadataMutationOptions(options);
|
|
491
|
+
|
|
492
|
+
return useMutation(mutationOptions, queryClient);
|
|
493
|
+
};
|
|
494
|
+
/**
|
|
356
495
|
* Returns the Metadata for a Dataset in JSON format.
|
|
357
496
|
|
|
358
497
|
* @summary Gets the Metadata for a specific Dataset
|
|
359
498
|
*/
|
|
360
499
|
export const getMetadata = (
|
|
361
|
-
|
|
362
|
-
|
|
500
|
+
datasetId: string,
|
|
501
|
+
options?: SecondParameter<typeof customInstance>,
|
|
502
|
+
signal?: AbortSignal,
|
|
363
503
|
) => {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
504
|
+
return customInstance<DatasetMetaGetResponse>(
|
|
505
|
+
{ url: `/dataset/${datasetId}/meta`, method: "GET", signal },
|
|
506
|
+
options,
|
|
507
|
+
);
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
export const getGetMetadataQueryKey = (datasetId: string) => {
|
|
511
|
+
return [`/dataset/${datasetId}/meta`] as const;
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
export const useGetMetadataQueryOptions = <
|
|
515
|
+
TData = Awaited<ReturnType<typeof getMetadata>>,
|
|
516
|
+
TError = ErrorType<void | DmError>,
|
|
517
|
+
>(
|
|
518
|
+
datasetId: string,
|
|
519
|
+
options?: {
|
|
520
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData>>;
|
|
521
|
+
request?: SecondParameter<typeof customInstance>;
|
|
522
|
+
},
|
|
379
523
|
) => {
|
|
524
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
380
525
|
|
|
381
|
-
const
|
|
382
|
-
|
|
383
|
-
const queryKey = queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetId);
|
|
526
|
+
const queryKey = queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetId);
|
|
384
527
|
|
|
385
|
-
|
|
528
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadata>>> = ({ signal }) =>
|
|
529
|
+
getMetadata(datasetId, requestOptions, signal);
|
|
386
530
|
|
|
387
|
-
|
|
531
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
388
532
|
|
|
389
|
-
|
|
533
|
+
return customOptions as UseQueryOptions<
|
|
534
|
+
Awaited<ReturnType<typeof getMetadata>>,
|
|
535
|
+
TError,
|
|
536
|
+
TData
|
|
537
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
538
|
+
};
|
|
390
539
|
|
|
391
|
-
|
|
540
|
+
export type GetMetadataQueryResult = NonNullable<Awaited<ReturnType<typeof getMetadata>>>;
|
|
541
|
+
export type GetMetadataQueryError = ErrorType<void | DmError>;
|
|
392
542
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
datasetId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData>> & Pick<
|
|
543
|
+
export function useGetMetadata<
|
|
544
|
+
TData = Awaited<ReturnType<typeof getMetadata>>,
|
|
545
|
+
TError = ErrorType<void | DmError>,
|
|
546
|
+
>(
|
|
547
|
+
datasetId: string,
|
|
548
|
+
options: {
|
|
549
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData>> &
|
|
550
|
+
Pick<
|
|
402
551
|
DefinedInitialDataOptions<
|
|
403
552
|
Awaited<ReturnType<typeof getMetadata>>,
|
|
404
553
|
TError,
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
554
|
+
Awaited<ReturnType<typeof getMetadata>>
|
|
555
|
+
>,
|
|
556
|
+
"initialData"
|
|
557
|
+
>;
|
|
558
|
+
request?: SecondParameter<typeof customInstance>;
|
|
559
|
+
},
|
|
560
|
+
queryClient?: QueryClient,
|
|
561
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
562
|
+
export function useGetMetadata<
|
|
563
|
+
TData = Awaited<ReturnType<typeof getMetadata>>,
|
|
564
|
+
TError = ErrorType<void | DmError>,
|
|
565
|
+
>(
|
|
566
|
+
datasetId: string,
|
|
567
|
+
options?: {
|
|
568
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData>> &
|
|
569
|
+
Pick<
|
|
412
570
|
UndefinedInitialDataOptions<
|
|
413
571
|
Awaited<ReturnType<typeof getMetadata>>,
|
|
414
572
|
TError,
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
573
|
+
Awaited<ReturnType<typeof getMetadata>>
|
|
574
|
+
>,
|
|
575
|
+
"initialData"
|
|
576
|
+
>;
|
|
577
|
+
request?: SecondParameter<typeof customInstance>;
|
|
578
|
+
},
|
|
579
|
+
queryClient?: QueryClient,
|
|
580
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
581
|
+
export function useGetMetadata<
|
|
582
|
+
TData = Awaited<ReturnType<typeof getMetadata>>,
|
|
583
|
+
TError = ErrorType<void | DmError>,
|
|
584
|
+
>(
|
|
585
|
+
datasetId: string,
|
|
586
|
+
options?: {
|
|
587
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData>>;
|
|
588
|
+
request?: SecondParameter<typeof customInstance>;
|
|
589
|
+
},
|
|
590
|
+
queryClient?: QueryClient,
|
|
591
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
424
592
|
/**
|
|
425
593
|
* @summary Gets the Metadata for a specific Dataset
|
|
426
594
|
*/
|
|
427
595
|
|
|
428
|
-
export function useGetMetadata<
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
596
|
+
export function useGetMetadata<
|
|
597
|
+
TData = Awaited<ReturnType<typeof getMetadata>>,
|
|
598
|
+
TError = ErrorType<void | DmError>,
|
|
599
|
+
>(
|
|
600
|
+
datasetId: string,
|
|
601
|
+
options?: {
|
|
602
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData>>;
|
|
603
|
+
request?: SecondParameter<typeof customInstance>;
|
|
604
|
+
},
|
|
605
|
+
queryClient?: QueryClient,
|
|
606
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
607
|
+
const queryOptions = useGetMetadataQueryOptions(datasetId, options);
|
|
608
|
+
|
|
609
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
610
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
query.queryKey = queryOptions.queryKey;
|
|
438
614
|
|
|
439
615
|
return query;
|
|
440
616
|
}
|
|
441
617
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
618
|
+
export const useGetMetadataSuspenseQueryOptions = <
|
|
619
|
+
TData = Awaited<ReturnType<typeof getMetadata>>,
|
|
620
|
+
TError = ErrorType<void | DmError>,
|
|
621
|
+
>(
|
|
622
|
+
datasetId: string,
|
|
623
|
+
options?: {
|
|
624
|
+
query?: Partial<
|
|
625
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData>
|
|
626
|
+
>;
|
|
627
|
+
request?: SecondParameter<typeof customInstance>;
|
|
628
|
+
},
|
|
445
629
|
) => {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
export type GetMetadataSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getMetadata
|
|
463
|
-
export type GetMetadataSuspenseQueryError = ErrorType<void | DmError
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
630
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
631
|
+
|
|
632
|
+
const queryKey = queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetId);
|
|
633
|
+
|
|
634
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadata>>> = ({ signal }) =>
|
|
635
|
+
getMetadata(datasetId, requestOptions, signal);
|
|
636
|
+
|
|
637
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
638
|
+
|
|
639
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
640
|
+
Awaited<ReturnType<typeof getMetadata>>,
|
|
641
|
+
TError,
|
|
642
|
+
TData
|
|
643
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
644
|
+
};
|
|
645
|
+
|
|
646
|
+
export type GetMetadataSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getMetadata>>>;
|
|
647
|
+
export type GetMetadataSuspenseQueryError = ErrorType<void | DmError>;
|
|
648
|
+
|
|
649
|
+
export function useGetMetadataSuspense<
|
|
650
|
+
TData = Awaited<ReturnType<typeof getMetadata>>,
|
|
651
|
+
TError = ErrorType<void | DmError>,
|
|
652
|
+
>(
|
|
653
|
+
datasetId: string,
|
|
654
|
+
options: {
|
|
655
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData>>;
|
|
656
|
+
request?: SecondParameter<typeof customInstance>;
|
|
657
|
+
},
|
|
658
|
+
queryClient?: QueryClient,
|
|
659
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
660
|
+
export function useGetMetadataSuspense<
|
|
661
|
+
TData = Awaited<ReturnType<typeof getMetadata>>,
|
|
662
|
+
TError = ErrorType<void | DmError>,
|
|
663
|
+
>(
|
|
664
|
+
datasetId: string,
|
|
665
|
+
options?: {
|
|
666
|
+
query?: Partial<
|
|
667
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData>
|
|
668
|
+
>;
|
|
669
|
+
request?: SecondParameter<typeof customInstance>;
|
|
670
|
+
},
|
|
671
|
+
queryClient?: QueryClient,
|
|
672
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
673
|
+
export function useGetMetadataSuspense<
|
|
674
|
+
TData = Awaited<ReturnType<typeof getMetadata>>,
|
|
675
|
+
TError = ErrorType<void | DmError>,
|
|
676
|
+
>(
|
|
677
|
+
datasetId: string,
|
|
678
|
+
options?: {
|
|
679
|
+
query?: Partial<
|
|
680
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData>
|
|
681
|
+
>;
|
|
682
|
+
request?: SecondParameter<typeof customInstance>;
|
|
683
|
+
},
|
|
684
|
+
queryClient?: QueryClient,
|
|
685
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
478
686
|
/**
|
|
479
687
|
* @summary Gets the Metadata for a specific Dataset
|
|
480
688
|
*/
|
|
481
689
|
|
|
482
|
-
export function useGetMetadataSuspense<
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
690
|
+
export function useGetMetadataSuspense<
|
|
691
|
+
TData = Awaited<ReturnType<typeof getMetadata>>,
|
|
692
|
+
TError = ErrorType<void | DmError>,
|
|
693
|
+
>(
|
|
694
|
+
datasetId: string,
|
|
695
|
+
options?: {
|
|
696
|
+
query?: Partial<
|
|
697
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMetadata>>, TError, TData>
|
|
698
|
+
>;
|
|
699
|
+
request?: SecondParameter<typeof customInstance>;
|
|
700
|
+
},
|
|
701
|
+
queryClient?: QueryClient,
|
|
702
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
703
|
+
const queryOptions = useGetMetadataSuspenseQueryOptions(datasetId, options);
|
|
704
|
+
|
|
705
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
706
|
+
TData,
|
|
707
|
+
TError
|
|
708
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
709
|
+
|
|
710
|
+
query.queryKey = queryOptions.queryKey;
|
|
492
711
|
|
|
493
712
|
return query;
|
|
494
713
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|