@squonk/data-manager-client 1.0.6-rc.2 → 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.
- package/accounting/accounting.cjs +21 -17
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.ts +1 -1
- package/accounting/accounting.js +22 -18
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +30 -6
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +19 -19
- package/admin/admin.js +31 -7
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +16 -15
- package/application/application.cjs.map +1 -1
- package/application/application.d.ts +1 -1
- package/application/application.js +17 -16
- package/application/application.js.map +1 -1
- package/{custom-instance-c4af1ee9.d.ts → custom-instance-9e5c9e19.d.ts} +299 -299
- package/dataset/dataset.cjs +47 -58
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +16 -16
- package/dataset/dataset.js +48 -59
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs +23 -11
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.ts +7 -7
- package/exchange-rate/exchange-rate.js +24 -12
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file/file.cjs +29 -27
- package/file/file.cjs.map +1 -1
- package/file/file.d.ts +10 -10
- package/file/file.js +30 -28
- package/file/file.js.map +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs +34 -30
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.ts +10 -10
- package/instance/instance.js +35 -31
- package/instance/instance.js.map +1 -1
- package/job/job.cjs +24 -26
- package/job/job.cjs.map +1 -1
- package/job/job.d.ts +1 -1
- package/job/job.js +25 -27
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +13 -19
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.ts +7 -7
- package/metadata/metadata.js +14 -20
- package/metadata/metadata.js.map +1 -1
- package/package.json +1 -1
- package/project/project.cjs +38 -31
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +19 -19
- package/project/project.js +39 -32
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +96 -132
- package/src/admin/admin.ts +307 -442
- package/src/application/application.ts +66 -94
- package/src/data-manager-api.schemas.ts +425 -470
- package/src/dataset/dataset.ts +367 -554
- package/src/exchange-rate/exchange-rate.ts +221 -339
- package/src/file/file.ts +177 -253
- package/src/instance/instance.ts +217 -314
- package/src/job/job.ts +88 -116
- package/src/metadata/metadata.ts +154 -245
- package/src/project/project.ts +347 -511
- package/src/task/task.ts +105 -141
- package/src/type/type.ts +38 -43
- package/src/user/user.ts +136 -197
- package/task/task.cjs +25 -27
- package/task/task.cjs.map +1 -1
- package/task/task.d.ts +1 -1
- package/task/task.js +26 -28
- package/task/task.js.map +1 -1
- package/type/type.cjs +8 -4
- package/type/type.cjs.map +1 -1
- package/type/type.d.ts +1 -1
- package/type/type.js +9 -5
- package/type/type.js.map +1 -1
- package/user/user.cjs +28 -33
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +4 -4
- package/user/user.js +29 -34
- package/user/user.js.map +1 -1
package/src/user/user.ts
CHANGED
|
@@ -8,15 +8,18 @@ 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 {
|
|
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
|
|
21
|
+
QueryKey
|
|
22
|
+
} from 'react-query'
|
|
20
23
|
import type {
|
|
21
24
|
UsersGetResponse,
|
|
22
25
|
DmError,
|
|
@@ -24,15 +27,16 @@ import type {
|
|
|
24
27
|
GetUserAccountParams,
|
|
25
28
|
UserAccountPatchBodyBody,
|
|
26
29
|
UserApiLogGetResponse,
|
|
27
|
-
GetUserApiLogParams
|
|
28
|
-
} from
|
|
29
|
-
import { customInstance } from
|
|
30
|
-
import type { ErrorType } from
|
|
30
|
+
GetUserApiLogParams
|
|
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;
|
|
@@ -43,47 +47,41 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
|
43
47
|
* @summary Get information about all known users
|
|
44
48
|
*/
|
|
45
49
|
export const getUsers = (
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
|
|
51
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
48
52
|
) => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
53
|
+
return customInstance<UsersGetResponse>(
|
|
54
|
+
{url: `/user`, method: 'get', signal
|
|
55
|
+
},
|
|
56
|
+
options);
|
|
57
|
+
}
|
|
58
|
+
|
|
54
59
|
|
|
55
60
|
export const getGetUsersQueryKey = () => [`/user`];
|
|
56
61
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
|
|
63
|
+
export type GetUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getUsers>>>
|
|
64
|
+
export type GetUsersQueryError = ErrorType<void | DmError>
|
|
65
|
+
|
|
66
|
+
export const useGetUsers = <TData = Awaited<ReturnType<typeof getUsers>>, TError = ErrorType<void | DmError>>(
|
|
67
|
+
options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
68
|
+
|
|
69
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
61
70
|
|
|
62
|
-
|
|
63
|
-
TData = Awaited<ReturnType<typeof getUsers>>,
|
|
64
|
-
TError = ErrorType<void | DmError>
|
|
65
|
-
>(options?: {
|
|
66
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>;
|
|
67
|
-
request?: SecondParameter<typeof customInstance>;
|
|
68
|
-
}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
69
|
-
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
71
|
+
const {query: queryOptions, request: requestOptions} = options ?? {}
|
|
70
72
|
|
|
71
73
|
const queryKey = queryOptions?.queryKey ?? getGetUsersQueryKey();
|
|
72
74
|
|
|
73
|
-
|
|
74
|
-
signal,
|
|
75
|
-
}) => getUsers(requestOptions, signal);
|
|
75
|
+
|
|
76
76
|
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
queryOptions
|
|
81
|
-
) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
77
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUsers>>> = ({ signal }) => getUsers(requestOptions, signal);
|
|
78
|
+
|
|
79
|
+
const query = useQuery<Awaited<ReturnType<typeof getUsers>>, TError, TData>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
82
80
|
|
|
83
81
|
query.queryKey = queryKey;
|
|
84
82
|
|
|
85
83
|
return query;
|
|
86
|
-
}
|
|
84
|
+
}
|
|
87
85
|
|
|
88
86
|
/**
|
|
89
87
|
* Returns a summary of your account
|
|
@@ -91,60 +89,42 @@ export const useGetUsers = <
|
|
|
91
89
|
* @summary Get information about your account
|
|
92
90
|
*/
|
|
93
91
|
export const getUserAccount = (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
signal?: AbortSignal
|
|
92
|
+
params?: GetUserAccountParams,
|
|
93
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
97
94
|
) => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
export type GetUserAccountQueryResult = NonNullable<
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
export
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
TData
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
params?: GetUserAccountParams,
|
|
119
|
-
options?: {
|
|
120
|
-
query?: UseQueryOptions<
|
|
121
|
-
Awaited<ReturnType<typeof getUserAccount>>,
|
|
122
|
-
TError,
|
|
123
|
-
TData
|
|
124
|
-
>;
|
|
125
|
-
request?: SecondParameter<typeof customInstance>;
|
|
126
|
-
}
|
|
127
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
128
|
-
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
95
|
+
return customInstance<UserAccountGetResponse>(
|
|
96
|
+
{url: `/user/account`, method: 'get',
|
|
97
|
+
params, signal
|
|
98
|
+
},
|
|
99
|
+
options);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
export const getGetUserAccountQueryKey = (params?: GetUserAccountParams,) => [`/user/account`, ...(params ? [params]: [])];
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
export type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>
|
|
107
|
+
export type GetUserAccountQueryError = ErrorType<void | DmError>
|
|
108
|
+
|
|
109
|
+
export const useGetUserAccount = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | DmError>>(
|
|
110
|
+
params?: GetUserAccountParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
111
|
+
|
|
112
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
113
|
+
|
|
114
|
+
const {query: queryOptions, request: requestOptions} = options ?? {}
|
|
129
115
|
|
|
130
116
|
const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey(params);
|
|
131
117
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}) => getUserAccount(params, requestOptions, signal);
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({ signal }) => getUserAccount(params, requestOptions, signal);
|
|
135
121
|
|
|
136
|
-
const query = useQuery<
|
|
137
|
-
Awaited<ReturnType<typeof getUserAccount>>,
|
|
138
|
-
TError,
|
|
139
|
-
TData
|
|
140
|
-
>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {
|
|
141
|
-
queryKey: QueryKey;
|
|
142
|
-
};
|
|
122
|
+
const query = useQuery<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
143
123
|
|
|
144
124
|
query.queryKey = queryKey;
|
|
145
125
|
|
|
146
126
|
return query;
|
|
147
|
-
}
|
|
127
|
+
}
|
|
148
128
|
|
|
149
129
|
/**
|
|
150
130
|
* Make changes to your user account
|
|
@@ -152,133 +132,92 @@ export const useGetUserAccount = <
|
|
|
152
132
|
* @summary Patch your account
|
|
153
133
|
*/
|
|
154
134
|
export const patchUserAccount = (
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
)
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
userAccountPatchBodyBody.use_impersonation.toString()
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
return customInstance<void>(
|
|
179
|
-
{
|
|
180
|
-
url: `/user/account`,
|
|
181
|
-
method: "patch",
|
|
182
|
-
headers: { "Content-Type": "multipart/form-data" },
|
|
183
|
-
data: formData,
|
|
135
|
+
userAccountPatchBodyBody: UserAccountPatchBodyBody,
|
|
136
|
+
options?: SecondParameter<typeof customInstance>,) => {const formData = new FormData();
|
|
137
|
+
if(userAccountPatchBodyBody.private !== undefined) {
|
|
138
|
+
formData.append('private', userAccountPatchBodyBody.private.toString())
|
|
139
|
+
}
|
|
140
|
+
if(userAccountPatchBodyBody.become_admin !== undefined) {
|
|
141
|
+
formData.append('become_admin', userAccountPatchBodyBody.become_admin.toString())
|
|
142
|
+
}
|
|
143
|
+
if(userAccountPatchBodyBody.impersonate !== undefined) {
|
|
144
|
+
formData.append('impersonate', userAccountPatchBodyBody.impersonate)
|
|
145
|
+
}
|
|
146
|
+
if(userAccountPatchBodyBody.use_impersonation !== undefined) {
|
|
147
|
+
formData.append('use_impersonation', userAccountPatchBodyBody.use_impersonation.toString())
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return customInstance<void>(
|
|
151
|
+
{url: `/user/account`, method: 'patch',
|
|
152
|
+
headers: {'Content-Type': 'multipart/form-data', },
|
|
153
|
+
data: formData
|
|
184
154
|
},
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
export type
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
> = (props) => {
|
|
213
|
-
const { data } = props ?? {};
|
|
214
|
-
|
|
215
|
-
return patchUserAccount(data, requestOptions);
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
return useMutation<
|
|
219
|
-
Awaited<ReturnType<typeof patchUserAccount>>,
|
|
220
|
-
TError,
|
|
221
|
-
{ data: UserAccountPatchBodyBody },
|
|
222
|
-
TContext
|
|
223
|
-
>(mutationFn, mutationOptions);
|
|
224
|
-
};
|
|
225
|
-
/**
|
|
155
|
+
options);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
export type PatchUserAccountMutationResult = NonNullable<Awaited<ReturnType<typeof patchUserAccount>>>
|
|
161
|
+
export type PatchUserAccountMutationBody = UserAccountPatchBodyBody
|
|
162
|
+
export type PatchUserAccountMutationError = ErrorType<DmError>
|
|
163
|
+
|
|
164
|
+
export const usePatchUserAccount = <TError = ErrorType<DmError>,
|
|
165
|
+
|
|
166
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchUserAccount>>, TError,{data: UserAccountPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
167
|
+
) => {
|
|
168
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {}
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchUserAccount>>, {data: UserAccountPatchBodyBody}> = (props) => {
|
|
174
|
+
const {data} = props ?? {};
|
|
175
|
+
|
|
176
|
+
return patchUserAccount(data,requestOptions)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return useMutation<Awaited<ReturnType<typeof patchUserAccount>>, TError, {data: UserAccountPatchBodyBody}, TContext>(mutationFn, mutationOptions)
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
226
182
|
* 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
|
|
227
183
|
|
|
228
184
|
* @summary Get the API call log recorded against your account
|
|
229
185
|
*/
|
|
230
186
|
export const getUserApiLog = (
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
signal?: AbortSignal
|
|
187
|
+
params?: GetUserApiLogParams,
|
|
188
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
234
189
|
) => {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
export type GetUserApiLogQueryResult = NonNullable<
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
export
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
TData
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
params?: GetUserApiLogParams,
|
|
256
|
-
options?: {
|
|
257
|
-
query?: UseQueryOptions<
|
|
258
|
-
Awaited<ReturnType<typeof getUserApiLog>>,
|
|
259
|
-
TError,
|
|
260
|
-
TData
|
|
261
|
-
>;
|
|
262
|
-
request?: SecondParameter<typeof customInstance>;
|
|
263
|
-
}
|
|
264
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
265
|
-
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
190
|
+
return customInstance<UserApiLogGetResponse>(
|
|
191
|
+
{url: `/user/api-log`, method: 'get',
|
|
192
|
+
params, signal
|
|
193
|
+
},
|
|
194
|
+
options);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
export const getGetUserApiLogQueryKey = (params?: GetUserApiLogParams,) => [`/user/api-log`, ...(params ? [params]: [])];
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
export type GetUserApiLogQueryResult = NonNullable<Awaited<ReturnType<typeof getUserApiLog>>>
|
|
202
|
+
export type GetUserApiLogQueryError = ErrorType<void>
|
|
203
|
+
|
|
204
|
+
export const useGetUserApiLog = <TData = Awaited<ReturnType<typeof getUserApiLog>>, TError = ErrorType<void>>(
|
|
205
|
+
params?: GetUserApiLogParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
206
|
+
|
|
207
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
208
|
+
|
|
209
|
+
const {query: queryOptions, request: requestOptions} = options ?? {}
|
|
266
210
|
|
|
267
211
|
const queryKey = queryOptions?.queryKey ?? getGetUserApiLogQueryKey(params);
|
|
268
212
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}) => getUserApiLog(params, requestOptions, signal);
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserApiLog>>> = ({ signal }) => getUserApiLog(params, requestOptions, signal);
|
|
272
216
|
|
|
273
|
-
const query = useQuery<
|
|
274
|
-
Awaited<ReturnType<typeof getUserApiLog>>,
|
|
275
|
-
TError,
|
|
276
|
-
TData
|
|
277
|
-
>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {
|
|
278
|
-
queryKey: QueryKey;
|
|
279
|
-
};
|
|
217
|
+
const query = useQuery<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
280
218
|
|
|
281
219
|
query.queryKey = queryKey;
|
|
282
220
|
|
|
283
221
|
return query;
|
|
284
|
-
}
|
|
222
|
+
}
|
|
223
|
+
|
package/task/task.cjs
CHANGED
|
@@ -3,58 +3,56 @@
|
|
|
3
3
|
var _chunkIUEU2LYCcjs = require('../chunk-IUEU2LYC.cjs');
|
|
4
4
|
|
|
5
5
|
// src/task/task.ts
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
6
9
|
var _reactquery = require('react-query');
|
|
7
10
|
var getTasks = (params, options, signal) => {
|
|
8
11
|
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
9
|
-
{
|
|
12
|
+
{
|
|
13
|
+
url: `/task`,
|
|
14
|
+
method: "get",
|
|
15
|
+
params,
|
|
16
|
+
signal
|
|
17
|
+
},
|
|
10
18
|
options
|
|
11
19
|
);
|
|
12
20
|
};
|
|
13
|
-
var getGetTasksQueryKey = (params) => [
|
|
14
|
-
`/task`,
|
|
15
|
-
...params ? [params] : []
|
|
16
|
-
];
|
|
21
|
+
var getGetTasksQueryKey = (params) => [`/task`, ...params ? [params] : []];
|
|
17
22
|
var useGetTasks = (params, options) => {
|
|
18
23
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
19
24
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetTasksQueryKey(params)));
|
|
20
|
-
const queryFn = ({
|
|
21
|
-
|
|
22
|
-
}) => getTasks(params, requestOptions, signal);
|
|
23
|
-
const query = _reactquery.useQuery.call(void 0,
|
|
24
|
-
queryKey,
|
|
25
|
-
queryFn,
|
|
26
|
-
queryOptions
|
|
27
|
-
);
|
|
25
|
+
const queryFn = ({ signal }) => getTasks(params, requestOptions, signal);
|
|
26
|
+
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
|
|
28
27
|
query.queryKey = queryKey;
|
|
29
28
|
return query;
|
|
30
29
|
};
|
|
31
30
|
var getTask = (taskId, params, options, signal) => {
|
|
32
31
|
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
33
|
-
{
|
|
32
|
+
{
|
|
33
|
+
url: `/task/${taskId}`,
|
|
34
|
+
method: "get",
|
|
35
|
+
params,
|
|
36
|
+
signal
|
|
37
|
+
},
|
|
34
38
|
options
|
|
35
39
|
);
|
|
36
40
|
};
|
|
37
|
-
var getGetTaskQueryKey = (taskId, params) => [
|
|
38
|
-
`/task/${taskId}`,
|
|
39
|
-
...params ? [params] : []
|
|
40
|
-
];
|
|
41
|
+
var getGetTaskQueryKey = (taskId, params) => [`/task/${taskId}`, ...params ? [params] : []];
|
|
41
42
|
var useGetTask = (taskId, params, options) => {
|
|
42
43
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
43
44
|
const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetTaskQueryKey(taskId, params)));
|
|
44
|
-
const queryFn = ({
|
|
45
|
-
|
|
46
|
-
}) => getTask(taskId, params, requestOptions, signal);
|
|
47
|
-
const query = _reactquery.useQuery.call(void 0,
|
|
48
|
-
queryKey,
|
|
49
|
-
queryFn,
|
|
50
|
-
{ enabled: !!taskId, ...queryOptions }
|
|
51
|
-
);
|
|
45
|
+
const queryFn = ({ signal }) => getTask(taskId, params, requestOptions, signal);
|
|
46
|
+
const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, { enabled: !!taskId, ...queryOptions });
|
|
52
47
|
query.queryKey = queryKey;
|
|
53
48
|
return query;
|
|
54
49
|
};
|
|
55
50
|
var deleteTask = (taskId, options) => {
|
|
56
51
|
return _chunkIUEU2LYCcjs.customInstance.call(void 0,
|
|
57
|
-
{
|
|
52
|
+
{
|
|
53
|
+
url: `/task/${taskId}`,
|
|
54
|
+
method: "delete"
|
|
55
|
+
},
|
|
58
56
|
options
|
|
59
57
|
);
|
|
60
58
|
};
|
package/task/task.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/task/task.ts"],"names":[],"mappings":";;;;;AAUA,
|
|
1
|
+
{"version":3,"sources":["../../src/task/task.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAiCA,IAAM,WAAW,CACpB,QACH,SAAiD,WAC7C;AACC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAS,QAAQ;AAAA,MACrB;AAAA,MAAQ;AAAA,IACZ;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,sBAAsB,CAAC,WAA6B,CAAC,SAAS,GAAI,SAAS,CAAC,MAAM,IAAG,CAAC,CAAE;AAM9F,IAAM,cAAc,CAC1B,QAAyB,YAEsC;AAE9D,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEnE,QAAM,YAAW,6CAAc,aAAY,oBAAoB,MAAM;AAIrE,QAAM,UAA+D,CAAC,EAAE,OAAO,MAAM,SAAS,QAAQ,gBAAgB,MAAM;AAE5H,QAAM,QAAQ,SAA8D,UAAU,SAAS,YAAY;AAE3G,QAAM,WAAW;AAEjB,SAAO;AACT;AAuBO,IAAM,UAAU,CACnB,QACA,QACH,SAAiD,WAC7C;AACC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,SAAS;AAAA,MAAU,QAAQ;AAAA,MAC/B;AAAA,MAAQ;AAAA,IACZ;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,qBAAqB,CAAC,QAC/B,WAA4B,CAAC,SAAS,UAAU,GAAI,SAAS,CAAC,MAAM,IAAG,CAAC,CAAE;AAMvE,IAAM,aAAa,CACzB,QACG,QAAwB,YAEoC;AAE9D,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEnE,QAAM,YAAW,6CAAc,aAAY,mBAAmB,QAAO,MAAM;AAI3E,QAAM,UAA8D,CAAC,EAAE,OAAO,MAAM,QAAQ,QAAO,QAAQ,gBAAgB,MAAM;AAEjI,QAAM,QAAQ,SAA6D,UAAU,SAAS,EAAC,SAAS,CAAC,CAAE,QAAS,GAAG,aAAY,CAAC;AAEpI,QAAM,WAAW;AAEjB,SAAO;AACT;AAWO,IAAM,aAAa,CACtB,QACH,YAAsD;AACjD,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,SAAS;AAAA,MAAU,QAAQ;AAAA,IACnC;AAAA,IACE;AAAA,EAAO;AACT;AAQO,IAAM,gBAAgB,CAET,YACnB;AACC,QAAM,EAAC,UAAU,iBAAiB,SAAS,eAAc,IAAI,WAAW,CAAC;AAKzE,QAAM,aAAyF,CAAC,UAAU;AACtG,UAAM,EAAC,OAAM,IAAI,SAAS,CAAC;AAE3B,WAAQ,WAAW,QAAO,cAAc;AAAA,EAC1C;AAEF,SAAO,YAAwF,YAAY,eAAe;AAC5H","sourcesContent":["/**\n * Generated by orval v6.9.1 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport {\n useQuery,\n useMutation\n} from 'react-query'\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey\n} from 'react-query'\nimport type {\n TasksGetResponse,\n DmError,\n GetTasksParams,\n TaskGetResponse,\n GetTaskParams\n} from '../data-manager-api.schemas'\nimport { customInstance } from '.././custom-instance'\nimport type { ErrorType } from '.././custom-instance'\n\n\n// eslint-disable-next-line\n type SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P,\n) => any\n ? P\n : never;\n\n/**\n * Returns a list of tasks that you have access to. These will be Tasks that you **own**. Being an editor of the related object does not allow you to see its task.\n\n * @summary Returns a list of Tasks\n */\nexport const getTasks = (\n params?: GetTasksParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n return customInstance<TasksGetResponse>(\n {url: `/task`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTasksQueryKey = (params?: GetTasksParams,) => [`/task`, ...(params ? [params]: [])];\n\n \nexport type GetTasksQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>\nexport type GetTasksQueryError = ErrorType<void | DmError>\n\nexport const useGetTasks = <TData = Awaited<ReturnType<typeof getTasks>>, TError = ErrorType<void | DmError>>(\n params?: GetTasksParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const {query: queryOptions, request: requestOptions} = options ?? {}\n\n const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) => getTasks(params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getTasks>>, TError, TData>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n}\n\n/**\n * Returns Task information including its states and events.\n\nYou can only retrieve a Task if you are its **owner**. For example, you can get a Task relating to an Application **Instance** if you created the **Instance**.\n\nTasks are created in response to creating datasets and launching applications.\n\nTasks contain of a list of `states` and `events`. A task will always have states but may not have events.\n\nStates and events are listed with the oldest occupying the first entry in the list. As the number of events a task accumulates is uncontrolled, by default, only the first 100 events are returned.\n\nYou can control the number of events returned by using the `event_limit` query parameter. You can also retrieve the next set of events by combining it with the `event_prior_ordinal`, setting it to the ordinal of the oldest event you've already received.\n\n**Dataset** tasks must be allowed to complete successfully before you can expect a it to be available through the dataset API endpoints. Application **Instances** are not available until their task state is _STARTED_.\n\nFor **Dataset** tasks, where the task `purpose` is `DATASET`, you must wait until `done` is **true**. The dataset is available when the task object's `done` field is **true** and the `exit_code` field is zero (**0**). If you discover the task is `done` but you have a non-zero `exit_code`, the dataset upload will have failed, and you may need need to inspect the final `state` and any related `events` to understand why.\n\nFor Application **Instance** tasks, where the task `purpose` is `INSTANCE`, you must wait until you find the `STARTED` state in the `states` list. An Application Instance is only `done` when the Application Instance has been deleted.\n\n * @summary Returns Task information\n */\nexport const getTask = (\n taskId: string,\n params?: GetTaskParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n return customInstance<TaskGetResponse>(\n {url: `/task/${taskId}`, method: 'get',\n params, signal\n },\n options);\n }\n \n\nexport const getGetTaskQueryKey = (taskId: string,\n params?: GetTaskParams,) => [`/task/${taskId}`, ...(params ? [params]: [])];\n\n \nexport type GetTaskQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>\nexport type GetTaskQueryError = ErrorType<void | DmError>\n\nexport const useGetTask = <TData = Awaited<ReturnType<typeof getTask>>, TError = ErrorType<void | DmError>>(\n taskId: string,\n params?: GetTaskParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const {query: queryOptions, request: requestOptions} = options ?? {}\n\n const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) => getTask(taskId,params, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getTask>>, TError, TData>(queryKey, queryFn, {enabled: !!(taskId), ...queryOptions}) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n}\n\n/**\n * Given a `task_id` the Task will be removed.\n\nYou cannot delete a Task until it is `done`.\n\nYou must be an **owner** of the Task action to delete it. For example you must be the owner of the Dataset to delete **DATASET** tasks and an owner of the ProjectFile to delete **FILE** tasks.\n\n * @summary Delete a Task entry\n */\nexport const deleteTask = (\n taskId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n return customInstance<void>(\n {url: `/task/${taskId}`, method: 'delete'\n },\n options);\n }\n \n\n\n export type DeleteTaskMutationResult = NonNullable<Awaited<ReturnType<typeof deleteTask>>>\n \n export type DeleteTaskMutationError = ErrorType<DmError>\n\n export const useDeleteTask = <TError = ErrorType<DmError>,\n \n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteTask>>, TError,{taskId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {}\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteTask>>, {taskId: string}> = (props) => {\n const {taskId} = props ?? {};\n\n return deleteTask(taskId,requestOptions)\n }\n\n return useMutation<Awaited<ReturnType<typeof deleteTask>>, TError, {taskId: string}, TContext>(mutationFn, mutationOptions)\n }\n "]}
|
package/task/task.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_query from 'react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
|
|
3
|
-
import { i as GetTasksParams, bC as customInstance, aV as TasksGetResponse, bD as ErrorType, by as DmError, h as GetTaskParams, aX as TaskGetResponse } from '../custom-instance-
|
|
3
|
+
import { i as GetTasksParams, bC as customInstance, aV as TasksGetResponse, bD as ErrorType, by as DmError, h as GetTaskParams, aX as TaskGetResponse } from '../custom-instance-9e5c9e19.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
package/task/task.js
CHANGED
|
@@ -3,58 +3,56 @@ import {
|
|
|
3
3
|
} from "../chunk-3O5KIRV4.js";
|
|
4
4
|
|
|
5
5
|
// src/task/task.ts
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
useQuery,
|
|
8
|
+
useMutation
|
|
9
|
+
} from "react-query";
|
|
7
10
|
var getTasks = (params, options, signal) => {
|
|
8
11
|
return customInstance(
|
|
9
|
-
{
|
|
12
|
+
{
|
|
13
|
+
url: `/task`,
|
|
14
|
+
method: "get",
|
|
15
|
+
params,
|
|
16
|
+
signal
|
|
17
|
+
},
|
|
10
18
|
options
|
|
11
19
|
);
|
|
12
20
|
};
|
|
13
|
-
var getGetTasksQueryKey = (params) => [
|
|
14
|
-
`/task`,
|
|
15
|
-
...params ? [params] : []
|
|
16
|
-
];
|
|
21
|
+
var getGetTasksQueryKey = (params) => [`/task`, ...params ? [params] : []];
|
|
17
22
|
var useGetTasks = (params, options) => {
|
|
18
23
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
19
24
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetTasksQueryKey(params);
|
|
20
|
-
const queryFn = ({
|
|
21
|
-
|
|
22
|
-
}) => getTasks(params, requestOptions, signal);
|
|
23
|
-
const query = useQuery(
|
|
24
|
-
queryKey,
|
|
25
|
-
queryFn,
|
|
26
|
-
queryOptions
|
|
27
|
-
);
|
|
25
|
+
const queryFn = ({ signal }) => getTasks(params, requestOptions, signal);
|
|
26
|
+
const query = useQuery(queryKey, queryFn, queryOptions);
|
|
28
27
|
query.queryKey = queryKey;
|
|
29
28
|
return query;
|
|
30
29
|
};
|
|
31
30
|
var getTask = (taskId, params, options, signal) => {
|
|
32
31
|
return customInstance(
|
|
33
|
-
{
|
|
32
|
+
{
|
|
33
|
+
url: `/task/${taskId}`,
|
|
34
|
+
method: "get",
|
|
35
|
+
params,
|
|
36
|
+
signal
|
|
37
|
+
},
|
|
34
38
|
options
|
|
35
39
|
);
|
|
36
40
|
};
|
|
37
|
-
var getGetTaskQueryKey = (taskId, params) => [
|
|
38
|
-
`/task/${taskId}`,
|
|
39
|
-
...params ? [params] : []
|
|
40
|
-
];
|
|
41
|
+
var getGetTaskQueryKey = (taskId, params) => [`/task/${taskId}`, ...params ? [params] : []];
|
|
41
42
|
var useGetTask = (taskId, params, options) => {
|
|
42
43
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
43
44
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetTaskQueryKey(taskId, params);
|
|
44
|
-
const queryFn = ({
|
|
45
|
-
|
|
46
|
-
}) => getTask(taskId, params, requestOptions, signal);
|
|
47
|
-
const query = useQuery(
|
|
48
|
-
queryKey,
|
|
49
|
-
queryFn,
|
|
50
|
-
{ enabled: !!taskId, ...queryOptions }
|
|
51
|
-
);
|
|
45
|
+
const queryFn = ({ signal }) => getTask(taskId, params, requestOptions, signal);
|
|
46
|
+
const query = useQuery(queryKey, queryFn, { enabled: !!taskId, ...queryOptions });
|
|
52
47
|
query.queryKey = queryKey;
|
|
53
48
|
return query;
|
|
54
49
|
};
|
|
55
50
|
var deleteTask = (taskId, options) => {
|
|
56
51
|
return customInstance(
|
|
57
|
-
{
|
|
52
|
+
{
|
|
53
|
+
url: `/task/${taskId}`,
|
|
54
|
+
method: "delete"
|
|
55
|
+
},
|
|
58
56
|
options
|
|
59
57
|
);
|
|
60
58
|
};
|