@squonk/data-manager-client 1.2.3 → 1.2.4-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 +31 -13
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.cts +77 -0
- package/accounting/accounting.d.ts +10 -1
- package/accounting/accounting.js +29 -11
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +67 -27
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.cts +324 -0
- package/admin/admin.d.ts +55 -22
- package/admin/admin.js +57 -17
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +23 -13
- package/application/application.cjs.map +1 -1
- package/application/application.d.cts +57 -0
- package/application/application.d.ts +7 -1
- package/application/application.js +22 -12
- package/application/application.js.map +1 -1
- package/{chunk-UZTHSGDT.cjs → chunk-J22A7LHX.cjs} +1 -1
- package/chunk-J22A7LHX.cjs.map +1 -0
- package/{chunk-3RNIDX7T.js → chunk-UKA7G3OB.js} +1 -1
- package/{chunk-3RNIDX7T.js.map → chunk-UKA7G3OB.js.map} +1 -1
- package/configuration/configuration.cjs +13 -7
- package/configuration/configuration.cjs.map +1 -1
- package/configuration/configuration.d.cts +29 -0
- package/configuration/configuration.d.ts +4 -1
- package/configuration/configuration.js +13 -7
- package/configuration/configuration.js.map +1 -1
- package/{custom-instance-50c9dd5d.d.ts → custom-instance-3d66fe97.d.ts} +826 -826
- package/dataset/dataset.cjs +71 -72
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.cts +315 -0
- package/dataset/dataset.d.ts +46 -16
- package/dataset/dataset.js +62 -63
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs +43 -32
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.cts +180 -0
- package/exchange-rate/exchange-rate.d.ts +25 -7
- package/exchange-rate/exchange-rate.js +38 -27
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file/file.cjs +38 -22
- package/file/file.cjs.map +1 -1
- package/file/file.d.cts +154 -0
- package/file/file.d.ts +25 -10
- package/file/file.js +34 -18
- package/file/file.js.map +1 -1
- package/index.cjs +10 -10
- package/index.cjs.map +1 -1
- package/index.d.cts +2 -0
- package/index.d.ts +1 -1
- package/index.js +9 -9
- package/index.js.map +1 -1
- package/instance/instance.cjs +47 -37
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.cts +215 -0
- package/instance/instance.d.ts +33 -12
- package/instance/instance.js +41 -31
- package/instance/instance.js.map +1 -1
- package/job/job.cjs +36 -19
- package/job/job.cjs.map +1 -1
- package/job/job.d.cts +85 -0
- package/job/job.d.ts +10 -1
- package/job/job.js +34 -17
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +23 -26
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.cts +132 -0
- package/metadata/metadata.d.ts +19 -7
- package/metadata/metadata.js +20 -23
- package/metadata/metadata.js.map +1 -1
- package/package.json +12 -12
- package/project/project.cjs +70 -48
- package/project/project.cjs.map +1 -1
- package/project/project.d.cts +377 -0
- package/project/project.d.ts +61 -25
- package/project/project.js +59 -37
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +179 -194
- package/src/admin/admin.ts +590 -735
- package/src/application/application.ts +125 -141
- package/src/configuration/configuration.ts +72 -60
- package/src/data-manager-api.schemas.ts +941 -942
- package/src/dataset/dataset.ts +591 -770
- package/src/exchange-rate/exchange-rate.ts +362 -478
- package/src/file/file.ts +292 -357
- package/src/instance/instance.ts +427 -533
- package/src/job/job.ts +187 -198
- package/src/metadata/metadata.ts +247 -339
- package/src/project/project.ts +669 -860
- package/src/task/task.ts +181 -202
- package/src/type/type.ts +72 -68
- package/src/user/user.ts +248 -286
- package/task/task.cjs +31 -15
- package/task/task.cjs.map +1 -1
- package/task/task.d.cts +103 -0
- package/task/task.d.ts +10 -1
- package/task/task.js +29 -13
- package/task/task.js.map +1 -1
- package/type/type.cjs +13 -7
- package/type/type.cjs.map +1 -1
- package/type/type.d.cts +31 -0
- package/type/type.d.ts +4 -1
- package/type/type.js +13 -7
- package/type/type.js.map +1 -1
- package/user/user.cjs +39 -28
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +104 -0
- package/user/user.d.ts +16 -4
- package/user/user.js +36 -25
- package/user/user.js.map +1 -1
- package/chunk-UZTHSGDT.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
2
|
+
* Generated by orval v6.20.0 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Dataset Manager API
|
|
5
5
|
* The Dataset Manager API service.
|
|
@@ -8,29 +8,33 @@ A service that allows *registered* users to make **Datasets** and associated **M
|
|
|
8
8
|
|
|
9
9
|
* OpenAPI spec version: 1.2
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
useQuery
|
|
13
|
+
} from '@tanstack/react-query'
|
|
12
14
|
import type {
|
|
13
|
-
UseQueryOptions,
|
|
14
15
|
QueryFunction,
|
|
15
|
-
UseQueryResult,
|
|
16
16
|
QueryKey,
|
|
17
|
-
|
|
17
|
+
UseQueryOptions,
|
|
18
|
+
UseQueryResult
|
|
19
|
+
} from '@tanstack/react-query'
|
|
18
20
|
import type {
|
|
19
|
-
ApplicationsGetResponse,
|
|
20
|
-
DmError,
|
|
21
21
|
ApplicationGetResponse,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
ApplicationsGetResponse,
|
|
23
|
+
DmError
|
|
24
|
+
} from '../data-manager-api.schemas'
|
|
25
|
+
import { customInstance } from '.././custom-instance';
|
|
26
|
+
import type { ErrorType } from '.././custom-instance';
|
|
27
|
+
|
|
25
28
|
|
|
26
29
|
// eslint-disable-next-line
|
|
27
|
-
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
30
|
+
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
28
31
|
config: any,
|
|
29
|
-
args: infer P
|
|
32
|
+
args: infer P,
|
|
30
33
|
) => any
|
|
31
34
|
? P
|
|
32
35
|
: never;
|
|
33
36
|
|
|
37
|
+
|
|
34
38
|
/**
|
|
35
39
|
* Get a list of all Applications available to you that can be instantiated via the `/instance` endpoint.
|
|
36
40
|
|
|
@@ -39,69 +43,63 @@ Application availability will vary as applications are added to the service.
|
|
|
39
43
|
* @summary Get all Applications available to you
|
|
40
44
|
*/
|
|
41
45
|
export const getApplications = (
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
|
|
47
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
44
48
|
) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
export type
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
export const useGetApplications = <
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
95
|
-
const queryOptions = getGetApplicationsQueryOptions(options);
|
|
96
|
-
|
|
97
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
98
|
-
queryKey: QueryKey;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
query.queryKey = queryOptions.queryKey;
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
return customInstance<ApplicationsGetResponse>(
|
|
52
|
+
{url: `/application`, method: 'get', signal
|
|
53
|
+
},
|
|
54
|
+
options);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
export const getGetApplicationsQueryKey = () => {
|
|
59
|
+
|
|
60
|
+
return ["data-manager-api", `/application`] as const;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
export const getGetApplicationsQueryOptions = <TData = Awaited<ReturnType<typeof getApplications>>, TError = ErrorType<DmError>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getApplications>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
65
|
+
) => {
|
|
66
|
+
|
|
67
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
68
|
+
|
|
69
|
+
const queryKey = queryOptions?.queryKey ?? getGetApplicationsQueryKey();
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApplications>>> = ({ signal }) => getApplications(requestOptions, signal);
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApplications>>, TError, TData> & { queryKey: QueryKey }
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export type GetApplicationsQueryResult = NonNullable<Awaited<ReturnType<typeof getApplications>>>
|
|
83
|
+
export type GetApplicationsQueryError = ErrorType<DmError>
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @summary Get all Applications available to you
|
|
87
|
+
*/
|
|
88
|
+
export const useGetApplications = <TData = Awaited<ReturnType<typeof getApplications>>, TError = ErrorType<DmError>>(
|
|
89
|
+
options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getApplications>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
90
|
+
|
|
91
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
92
|
+
|
|
93
|
+
const queryOptions = getGetApplicationsQueryOptions(options)
|
|
94
|
+
|
|
95
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
96
|
+
|
|
97
|
+
query.queryKey = queryOptions.queryKey ;
|
|
102
98
|
|
|
103
99
|
return query;
|
|
104
|
-
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
105
103
|
|
|
106
104
|
/**
|
|
107
105
|
* Get details of a specific Application available to you that can be instantiated.
|
|
@@ -109,75 +107,61 @@ export const useGetApplications = <
|
|
|
109
107
|
* @summary Get details of a specific Application
|
|
110
108
|
*/
|
|
111
109
|
export const getApplication = (
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
applicationId: string,
|
|
111
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
112
|
+
) => {
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
return customInstance<ApplicationGetResponse>(
|
|
116
|
+
{url: `/application/${applicationId}`, method: 'get', signal
|
|
117
|
+
},
|
|
118
|
+
options);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
export const getGetApplicationQueryKey = (applicationId: string,) => {
|
|
123
|
+
|
|
124
|
+
return ["data-manager-api", `/application/${applicationId}`] as const;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
export const getGetApplicationQueryOptions = <TData = Awaited<ReturnType<typeof getApplication>>, TError = ErrorType<void | DmError>>(applicationId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getApplication>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
115
129
|
) => {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
applicationId:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
TData
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
const queryKey
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApplication>>> = ({
|
|
149
|
-
signal,
|
|
150
|
-
}) => getApplication(applicationId, requestOptions, signal);
|
|
151
|
-
|
|
152
|
-
return { queryKey, queryFn, enabled: !!applicationId, ...queryOptions };
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
export type GetApplicationQueryResult = NonNullable<
|
|
156
|
-
Awaited<ReturnType<typeof getApplication>>
|
|
157
|
-
>;
|
|
158
|
-
export type GetApplicationQueryError = ErrorType<void | DmError>;
|
|
159
|
-
|
|
160
|
-
export const useGetApplication = <
|
|
161
|
-
TData = Awaited<ReturnType<typeof getApplication>>,
|
|
162
|
-
TError = ErrorType<void | DmError>
|
|
163
|
-
>(
|
|
164
|
-
applicationId: string,
|
|
165
|
-
options?: {
|
|
166
|
-
query?: UseQueryOptions<
|
|
167
|
-
Awaited<ReturnType<typeof getApplication>>,
|
|
168
|
-
TError,
|
|
169
|
-
TData
|
|
170
|
-
>;
|
|
171
|
-
request?: SecondParameter<typeof customInstance>;
|
|
172
|
-
}
|
|
173
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
174
|
-
const queryOptions = getGetApplicationQueryOptions(applicationId, options);
|
|
175
|
-
|
|
176
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
177
|
-
queryKey: QueryKey;
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
query.queryKey = queryOptions.queryKey;
|
|
130
|
+
|
|
131
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
132
|
+
|
|
133
|
+
const queryKey = queryOptions?.queryKey ?? getGetApplicationQueryKey(applicationId);
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApplication>>> = ({ signal }) => getApplication(applicationId, requestOptions, signal);
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
return { queryKey, queryFn, enabled: !!(applicationId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApplication>>, TError, TData> & { queryKey: QueryKey }
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export type GetApplicationQueryResult = NonNullable<Awaited<ReturnType<typeof getApplication>>>
|
|
147
|
+
export type GetApplicationQueryError = ErrorType<void | DmError>
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* @summary Get details of a specific Application
|
|
151
|
+
*/
|
|
152
|
+
export const useGetApplication = <TData = Awaited<ReturnType<typeof getApplication>>, TError = ErrorType<void | DmError>>(
|
|
153
|
+
applicationId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getApplication>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
154
|
+
|
|
155
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
156
|
+
|
|
157
|
+
const queryOptions = getGetApplicationQueryOptions(applicationId,options)
|
|
158
|
+
|
|
159
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
160
|
+
|
|
161
|
+
query.queryKey = queryOptions.queryKey ;
|
|
181
162
|
|
|
182
163
|
return query;
|
|
183
|
-
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
2
|
+
* Generated by orval v6.20.0 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Dataset Manager API
|
|
5
5
|
* The Dataset Manager API service.
|
|
@@ -8,79 +8,91 @@ A service that allows *registered* users to make **Datasets** and associated **M
|
|
|
8
8
|
|
|
9
9
|
* OpenAPI spec version: 1.2
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
useQuery
|
|
13
|
+
} from '@tanstack/react-query'
|
|
12
14
|
import type {
|
|
13
|
-
UseQueryOptions,
|
|
14
15
|
QueryFunction,
|
|
15
|
-
UseQueryResult,
|
|
16
16
|
QueryKey,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import type {
|
|
17
|
+
UseQueryOptions,
|
|
18
|
+
UseQueryResult
|
|
19
|
+
} from '@tanstack/react-query'
|
|
20
|
+
import type {
|
|
21
|
+
DmError,
|
|
22
|
+
ModeGetResponse
|
|
23
|
+
} from '../data-manager-api.schemas'
|
|
24
|
+
import { customInstance } from '.././custom-instance';
|
|
25
|
+
import type { ErrorType } from '.././custom-instance';
|
|
26
|
+
|
|
21
27
|
|
|
22
28
|
// eslint-disable-next-line
|
|
23
|
-
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
29
|
+
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
24
30
|
config: any,
|
|
25
|
-
args: infer P
|
|
31
|
+
args: infer P,
|
|
26
32
|
) => any
|
|
27
33
|
? P
|
|
28
34
|
: never;
|
|
29
35
|
|
|
36
|
+
|
|
30
37
|
/**
|
|
31
38
|
* @summary Gets the Data Manager mode that's running behind the API
|
|
32
39
|
*/
|
|
33
40
|
export const getMode = (
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
|
|
42
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
43
|
+
) => {
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
return customInstance<ModeGetResponse>(
|
|
47
|
+
{url: `/mode`, method: 'get', signal
|
|
48
|
+
},
|
|
49
|
+
options);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
export const getGetModeQueryKey = () => {
|
|
54
|
+
|
|
55
|
+
return ["data-manager-api", `/mode`] as const;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
export const getGetModeQueryOptions = <TData = Awaited<ReturnType<typeof getMode>>, TError = ErrorType<void | DmError>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getMode>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
36
60
|
) => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
export const useGetMode = <
|
|
71
|
-
TData = Awaited<ReturnType<typeof getMode>>,
|
|
72
|
-
TError = ErrorType<void | DmError>
|
|
73
|
-
>(options?: {
|
|
74
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getMode>>, TError, TData>;
|
|
75
|
-
request?: SecondParameter<typeof customInstance>;
|
|
76
|
-
}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
77
|
-
const queryOptions = getGetModeQueryOptions(options);
|
|
78
|
-
|
|
79
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
80
|
-
queryKey: QueryKey;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
query.queryKey = queryOptions.queryKey;
|
|
61
|
+
|
|
62
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
63
|
+
|
|
64
|
+
const queryKey = queryOptions?.queryKey ?? getGetModeQueryKey();
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getMode>>> = ({ signal }) => getMode(requestOptions, signal);
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getMode>>, TError, TData> & { queryKey: QueryKey }
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type GetModeQueryResult = NonNullable<Awaited<ReturnType<typeof getMode>>>
|
|
78
|
+
export type GetModeQueryError = ErrorType<void | DmError>
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @summary Gets the Data Manager mode that's running behind the API
|
|
82
|
+
*/
|
|
83
|
+
export const useGetMode = <TData = Awaited<ReturnType<typeof getMode>>, TError = ErrorType<void | DmError>>(
|
|
84
|
+
options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getMode>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
85
|
+
|
|
86
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
87
|
+
|
|
88
|
+
const queryOptions = getGetModeQueryOptions(options)
|
|
89
|
+
|
|
90
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
91
|
+
|
|
92
|
+
query.queryKey = queryOptions.queryKey ;
|
|
84
93
|
|
|
85
94
|
return query;
|
|
86
|
-
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|