@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
package/src/user/user.ts
CHANGED
|
@@ -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,334 +8,296 @@ 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
|
+
useMutation,
|
|
13
|
+
useQuery
|
|
14
|
+
} from '@tanstack/react-query'
|
|
12
15
|
import type {
|
|
13
|
-
UseQueryOptions,
|
|
14
|
-
UseMutationOptions,
|
|
15
|
-
QueryFunction,
|
|
16
16
|
MutationFunction,
|
|
17
|
-
|
|
17
|
+
QueryFunction,
|
|
18
18
|
QueryKey,
|
|
19
|
-
|
|
19
|
+
UseMutationOptions,
|
|
20
|
+
UseQueryOptions,
|
|
21
|
+
UseQueryResult
|
|
22
|
+
} from '@tanstack/react-query'
|
|
20
23
|
import type {
|
|
21
|
-
UsersGetResponse,
|
|
22
24
|
DmError,
|
|
23
|
-
UserAccountGetResponse,
|
|
24
25
|
GetUserAccountParams,
|
|
26
|
+
GetUserApiLogParams,
|
|
27
|
+
UserAccountDetail,
|
|
25
28
|
UserAccountPatchBodyBody,
|
|
26
29
|
UserApiLogGetResponse,
|
|
27
|
-
|
|
28
|
-
} from
|
|
29
|
-
import { customInstance } from
|
|
30
|
-
import type { ErrorType } from
|
|
30
|
+
UsersGetResponse
|
|
31
|
+
} from '../data-manager-api.schemas'
|
|
32
|
+
import { customInstance } from '.././custom-instance';
|
|
33
|
+
import type { ErrorType } from '.././custom-instance';
|
|
34
|
+
|
|
31
35
|
|
|
32
36
|
// eslint-disable-next-line
|
|
33
|
-
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
37
|
+
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
34
38
|
config: any,
|
|
35
|
-
args: infer P
|
|
39
|
+
args: infer P,
|
|
36
40
|
) => any
|
|
37
41
|
? P
|
|
38
42
|
: never;
|
|
39
43
|
|
|
44
|
+
|
|
40
45
|
/**
|
|
41
46
|
* Returns a summary of all users that have accessed the Data Manager API and where the account is not `private`. Users can set their accounts to be private and therefore will not show up in methods like this
|
|
42
47
|
|
|
43
48
|
* @summary Get information about all known Users
|
|
44
49
|
*/
|
|
45
50
|
export const getUsers = (
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
|
|
52
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
53
|
+
) => {
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
return customInstance<UsersGetResponse>(
|
|
57
|
+
{url: `/user`, method: 'get', signal
|
|
58
|
+
},
|
|
59
|
+
options);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
export const getGetUsersQueryKey = () => {
|
|
64
|
+
|
|
65
|
+
return ["data-manager-api", `/user`] as const;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
export const getGetUsersQueryOptions = <TData = Awaited<ReturnType<typeof getUsers>>, TError = ErrorType<void | DmError>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
48
70
|
) => {
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
export const useGetUsers = <
|
|
83
|
-
TData = Awaited<ReturnType<typeof getUsers>>,
|
|
84
|
-
TError = ErrorType<void | DmError>
|
|
85
|
-
>(options?: {
|
|
86
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>;
|
|
87
|
-
request?: SecondParameter<typeof customInstance>;
|
|
88
|
-
}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
89
|
-
const queryOptions = getGetUsersQueryOptions(options);
|
|
90
|
-
|
|
91
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
92
|
-
queryKey: QueryKey;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
query.queryKey = queryOptions.queryKey;
|
|
71
|
+
|
|
72
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
73
|
+
|
|
74
|
+
const queryKey = queryOptions?.queryKey ?? getGetUsersQueryKey();
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUsers>>> = ({ signal }) => getUsers(requestOptions, signal);
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData> & { queryKey: QueryKey }
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export type GetUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getUsers>>>
|
|
88
|
+
export type GetUsersQueryError = ErrorType<void | DmError>
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @summary Get information about all known Users
|
|
92
|
+
*/
|
|
93
|
+
export const useGetUsers = <TData = Awaited<ReturnType<typeof getUsers>>, TError = ErrorType<void | DmError>>(
|
|
94
|
+
options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
95
|
+
|
|
96
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
97
|
+
|
|
98
|
+
const queryOptions = getGetUsersQueryOptions(options)
|
|
99
|
+
|
|
100
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
101
|
+
|
|
102
|
+
query.queryKey = queryOptions.queryKey ;
|
|
96
103
|
|
|
97
104
|
return query;
|
|
98
|
-
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
99
108
|
|
|
100
109
|
/**
|
|
101
110
|
* @summary Get information about your account
|
|
102
111
|
*/
|
|
103
112
|
export const getUserAccount = (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
113
|
+
params?: GetUserAccountParams,
|
|
114
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
115
|
+
) => {
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
return customInstance<UserAccountDetail>(
|
|
119
|
+
{url: `/user/account`, method: 'get',
|
|
120
|
+
params, signal
|
|
121
|
+
},
|
|
122
|
+
options);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
export const getGetUserAccountQueryKey = (params?: GetUserAccountParams,) => {
|
|
127
|
+
|
|
128
|
+
return ["data-manager-api", `/user/account`, ...(params ? [params]: [])] as const;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
export const getGetUserAccountQueryOptions = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | DmError>>(params?: GetUserAccountParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
107
133
|
) => {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
TData
|
|
134
|
-
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
signal,
|
|
141
|
-
}) => getUserAccount(params, requestOptions, signal);
|
|
142
|
-
|
|
143
|
-
return { queryKey, queryFn, ...queryOptions };
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
export type GetUserAccountQueryResult = NonNullable<
|
|
147
|
-
Awaited<ReturnType<typeof getUserAccount>>
|
|
148
|
-
>;
|
|
149
|
-
export type GetUserAccountQueryError = ErrorType<void | DmError>;
|
|
150
|
-
|
|
151
|
-
export const useGetUserAccount = <
|
|
152
|
-
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
153
|
-
TError = ErrorType<void | DmError>
|
|
154
|
-
>(
|
|
155
|
-
params?: GetUserAccountParams,
|
|
156
|
-
options?: {
|
|
157
|
-
query?: UseQueryOptions<
|
|
158
|
-
Awaited<ReturnType<typeof getUserAccount>>,
|
|
159
|
-
TError,
|
|
160
|
-
TData
|
|
161
|
-
>;
|
|
162
|
-
request?: SecondParameter<typeof customInstance>;
|
|
163
|
-
}
|
|
164
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
165
|
-
const queryOptions = getGetUserAccountQueryOptions(params, options);
|
|
166
|
-
|
|
167
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
168
|
-
queryKey: QueryKey;
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
query.queryKey = queryOptions.queryKey;
|
|
134
|
+
|
|
135
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
136
|
+
|
|
137
|
+
const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey(params);
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({ signal }) => getUserAccount(params, requestOptions, signal);
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData> & { queryKey: QueryKey }
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>
|
|
151
|
+
export type GetUserAccountQueryError = ErrorType<void | DmError>
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @summary Get information about your account
|
|
155
|
+
*/
|
|
156
|
+
export const useGetUserAccount = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | DmError>>(
|
|
157
|
+
params?: GetUserAccountParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
158
|
+
|
|
159
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
160
|
+
|
|
161
|
+
const queryOptions = getGetUserAccountQueryOptions(params,options)
|
|
162
|
+
|
|
163
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
164
|
+
|
|
165
|
+
query.queryKey = queryOptions.queryKey ;
|
|
172
166
|
|
|
173
167
|
return query;
|
|
174
|
-
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
|
|
175
171
|
|
|
176
172
|
/**
|
|
177
173
|
* @summary Patch your account
|
|
178
174
|
*/
|
|
179
175
|
export const patchUserAccount = (
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
return customInstance<void>(
|
|
204
|
-
{
|
|
205
|
-
url: `/user/account`,
|
|
206
|
-
method: "patch",
|
|
207
|
-
headers: { "Content-Type": "multipart/form-data" },
|
|
208
|
-
data: formData,
|
|
176
|
+
userAccountPatchBodyBody: UserAccountPatchBodyBody,
|
|
177
|
+
options?: SecondParameter<typeof customInstance>,) => {
|
|
178
|
+
|
|
179
|
+
const formData = new FormData();
|
|
180
|
+
if(userAccountPatchBodyBody.private !== undefined) {
|
|
181
|
+
formData.append('private', userAccountPatchBodyBody.private.toString())
|
|
182
|
+
}
|
|
183
|
+
if(userAccountPatchBodyBody.become_admin !== undefined) {
|
|
184
|
+
formData.append('become_admin', userAccountPatchBodyBody.become_admin.toString())
|
|
185
|
+
}
|
|
186
|
+
if(userAccountPatchBodyBody.impersonate !== undefined) {
|
|
187
|
+
formData.append('impersonate', userAccountPatchBodyBody.impersonate)
|
|
188
|
+
}
|
|
189
|
+
if(userAccountPatchBodyBody.use_impersonation !== undefined) {
|
|
190
|
+
formData.append('use_impersonation', userAccountPatchBodyBody.use_impersonation.toString())
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return customInstance<void>(
|
|
194
|
+
{url: `/user/account`, method: 'patch',
|
|
195
|
+
headers: {'Content-Type': 'multipart/form-data', },
|
|
196
|
+
data: formData
|
|
209
197
|
},
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
>(options?: {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
TError = ErrorType<DmError>,
|
|
253
|
-
TContext = unknown
|
|
254
|
-
>(options?: {
|
|
255
|
-
mutation?: UseMutationOptions<
|
|
256
|
-
Awaited<ReturnType<typeof patchUserAccount>>,
|
|
257
|
-
TError,
|
|
258
|
-
{ data: UserAccountPatchBodyBody },
|
|
259
|
-
TContext
|
|
260
|
-
>;
|
|
261
|
-
request?: SecondParameter<typeof customInstance>;
|
|
262
|
-
}) => {
|
|
263
|
-
const mutationOptions = getPatchUserAccountMutationOptions(options);
|
|
264
|
-
|
|
265
|
-
return useMutation(mutationOptions);
|
|
266
|
-
};
|
|
267
|
-
/**
|
|
198
|
+
options);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
export const getPatchUserAccountMutationOptions = <TError = ErrorType<DmError>,
|
|
204
|
+
|
|
205
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchUserAccount>>, TError,{data: UserAccountPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
206
|
+
): UseMutationOptions<Awaited<ReturnType<typeof patchUserAccount>>, TError,{data: UserAccountPatchBodyBody}, TContext> => {
|
|
207
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchUserAccount>>, {data: UserAccountPatchBodyBody}> = (props) => {
|
|
213
|
+
const {data} = props ?? {};
|
|
214
|
+
|
|
215
|
+
return patchUserAccount(data,requestOptions)
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
return { mutationFn, ...mutationOptions }}
|
|
222
|
+
|
|
223
|
+
export type PatchUserAccountMutationResult = NonNullable<Awaited<ReturnType<typeof patchUserAccount>>>
|
|
224
|
+
export type PatchUserAccountMutationBody = UserAccountPatchBodyBody
|
|
225
|
+
export type PatchUserAccountMutationError = ErrorType<DmError>
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* @summary Patch your account
|
|
229
|
+
*/
|
|
230
|
+
export const usePatchUserAccount = <TError = ErrorType<DmError>,
|
|
231
|
+
|
|
232
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchUserAccount>>, TError,{data: UserAccountPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
233
|
+
) => {
|
|
234
|
+
|
|
235
|
+
const mutationOptions = getPatchUserAccountMutationOptions(options);
|
|
236
|
+
|
|
237
|
+
return useMutation(mutationOptions);
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
268
240
|
* Returns a summary of your API activity optionally filtered by date. The API log does not include the use of GET methods, and only contains records of potential state-changing calls made against the Data Manager using your account
|
|
269
241
|
|
|
270
242
|
* @summary Get the API call log recorded against your account
|
|
271
243
|
*/
|
|
272
244
|
export const getUserApiLog = (
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
signal?: AbortSignal
|
|
245
|
+
params?: GetUserApiLogParams,
|
|
246
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
276
247
|
) => {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
TError
|
|
321
|
-
|
|
322
|
-
params
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
TData
|
|
328
|
-
>;
|
|
329
|
-
request?: SecondParameter<typeof customInstance>;
|
|
330
|
-
}
|
|
331
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
332
|
-
const queryOptions = getGetUserApiLogQueryOptions(params, options);
|
|
333
|
-
|
|
334
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
335
|
-
queryKey: QueryKey;
|
|
336
|
-
};
|
|
337
|
-
|
|
338
|
-
query.queryKey = queryOptions.queryKey;
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
return customInstance<UserApiLogGetResponse>(
|
|
251
|
+
{url: `/user/api-log`, method: 'get',
|
|
252
|
+
params, signal
|
|
253
|
+
},
|
|
254
|
+
options);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
export const getGetUserApiLogQueryKey = (params?: GetUserApiLogParams,) => {
|
|
259
|
+
|
|
260
|
+
return ["data-manager-api", `/user/api-log`, ...(params ? [params]: [])] as const;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
export const getGetUserApiLogQueryOptions = <TData = Awaited<ReturnType<typeof getUserApiLog>>, TError = ErrorType<void>>(params?: GetUserApiLogParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
265
|
+
) => {
|
|
266
|
+
|
|
267
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
268
|
+
|
|
269
|
+
const queryKey = queryOptions?.queryKey ?? getGetUserApiLogQueryKey(params);
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserApiLog>>> = ({ signal }) => getUserApiLog(params, requestOptions, signal);
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData> & { queryKey: QueryKey }
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export type GetUserApiLogQueryResult = NonNullable<Awaited<ReturnType<typeof getUserApiLog>>>
|
|
283
|
+
export type GetUserApiLogQueryError = ErrorType<void>
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* @summary Get the API call log recorded against your account
|
|
287
|
+
*/
|
|
288
|
+
export const useGetUserApiLog = <TData = Awaited<ReturnType<typeof getUserApiLog>>, TError = ErrorType<void>>(
|
|
289
|
+
params?: GetUserApiLogParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
290
|
+
|
|
291
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
292
|
+
|
|
293
|
+
const queryOptions = getGetUserApiLogQueryOptions(params,options)
|
|
294
|
+
|
|
295
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
296
|
+
|
|
297
|
+
query.queryKey = queryOptions.queryKey ;
|
|
339
298
|
|
|
340
299
|
return query;
|
|
341
|
-
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
package/task/task.cjs
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkJ22A7LHXcjs = require('../chunk-J22A7LHX.cjs');
|
|
4
4
|
|
|
5
5
|
// src/task/task.ts
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
var _reactquery = require('@tanstack/react-query');
|
|
7
10
|
var getTasks = (params, options, signal) => {
|
|
8
|
-
return
|
|
9
|
-
{
|
|
11
|
+
return _chunkJ22A7LHXcjs.customInstance.call(void 0,
|
|
12
|
+
{
|
|
13
|
+
url: `/task`,
|
|
14
|
+
method: "get",
|
|
15
|
+
params,
|
|
16
|
+
signal
|
|
17
|
+
},
|
|
10
18
|
options
|
|
11
19
|
);
|
|
12
20
|
};
|
|
13
|
-
var getGetTasksQueryKey = (params) =>
|
|
21
|
+
var getGetTasksQueryKey = (params) => {
|
|
22
|
+
return ["data-manager-api", `/task`, ...params ? [params] : []];
|
|
23
|
+
};
|
|
14
24
|
var getGetTasksQueryOptions = (params, options) => {
|
|
15
25
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
16
26
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetTasksQueryKey(params)));
|
|
17
|
-
const queryFn = ({
|
|
18
|
-
signal
|
|
19
|
-
}) => getTasks(params, requestOptions, signal);
|
|
27
|
+
const queryFn = ({ signal }) => getTasks(params, requestOptions, signal);
|
|
20
28
|
return { queryKey, queryFn, ...queryOptions };
|
|
21
29
|
};
|
|
22
30
|
var useGetTasks = (params, options) => {
|
|
@@ -26,18 +34,23 @@ var useGetTasks = (params, options) => {
|
|
|
26
34
|
return query;
|
|
27
35
|
};
|
|
28
36
|
var getTask = (taskId, params, options, signal) => {
|
|
29
|
-
return
|
|
30
|
-
{
|
|
37
|
+
return _chunkJ22A7LHXcjs.customInstance.call(void 0,
|
|
38
|
+
{
|
|
39
|
+
url: `/task/${taskId}`,
|
|
40
|
+
method: "get",
|
|
41
|
+
params,
|
|
42
|
+
signal
|
|
43
|
+
},
|
|
31
44
|
options
|
|
32
45
|
);
|
|
33
46
|
};
|
|
34
|
-
var getGetTaskQueryKey = (taskId, params) =>
|
|
47
|
+
var getGetTaskQueryKey = (taskId, params) => {
|
|
48
|
+
return ["data-manager-api", `/task/${taskId}`, ...params ? [params] : []];
|
|
49
|
+
};
|
|
35
50
|
var getGetTaskQueryOptions = (taskId, params, options) => {
|
|
36
51
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
37
52
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetTaskQueryKey(taskId, params)));
|
|
38
|
-
const queryFn = ({
|
|
39
|
-
signal
|
|
40
|
-
}) => getTask(taskId, params, requestOptions, signal);
|
|
53
|
+
const queryFn = ({ signal }) => getTask(taskId, params, requestOptions, signal);
|
|
41
54
|
return { queryKey, queryFn, enabled: !!taskId, ...queryOptions };
|
|
42
55
|
};
|
|
43
56
|
var useGetTask = (taskId, params, options) => {
|
|
@@ -47,8 +60,11 @@ var useGetTask = (taskId, params, options) => {
|
|
|
47
60
|
return query;
|
|
48
61
|
};
|
|
49
62
|
var deleteTask = (taskId, options) => {
|
|
50
|
-
return
|
|
51
|
-
{
|
|
63
|
+
return _chunkJ22A7LHXcjs.customInstance.call(void 0,
|
|
64
|
+
{
|
|
65
|
+
url: `/task/${taskId}`,
|
|
66
|
+
method: "delete"
|
|
67
|
+
},
|
|
52
68
|
options
|
|
53
69
|
);
|
|
54
70
|
};
|