@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/task/task.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,21 +23,23 @@ 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
|
DmError,
|
|
34
31
|
GetTaskParams,
|
|
35
32
|
GetTasksParams,
|
|
36
33
|
TaskGetResponse,
|
|
37
|
-
TasksGetResponse
|
|
38
|
-
} from
|
|
39
|
-
import { customInstance } from '.././custom-instance';
|
|
40
|
-
import type { ErrorType } from '.././custom-instance';
|
|
41
|
-
|
|
34
|
+
TasksGetResponse,
|
|
35
|
+
} from "../data-manager-api.schemas";
|
|
42
36
|
|
|
43
|
-
|
|
37
|
+
import { customInstance } from ".././custom-instance";
|
|
38
|
+
import type { ErrorType } from ".././custom-instance";
|
|
39
|
+
import { queryMutator } from ".././options-mutator";
|
|
40
|
+
import { mutationMutator } from ".././options-mutator";
|
|
44
41
|
|
|
42
|
+
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
45
43
|
|
|
46
44
|
/**
|
|
47
45
|
* Returns a list of Tasks that you have access to.
|
|
@@ -49,144 +47,208 @@ type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
|
|
|
49
47
|
* @summary Returns a list of Tasks
|
|
50
48
|
*/
|
|
51
49
|
export const getTasks = (
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
params?: GetTasksParams,
|
|
51
|
+
options?: SecondParameter<typeof customInstance>,
|
|
52
|
+
signal?: AbortSignal,
|
|
54
53
|
) => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
54
|
+
return customInstance<TasksGetResponse>({ url: `/task`, method: "GET", params, signal }, options);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const getGetTasksQueryKey = (params?: GetTasksParams) => {
|
|
58
|
+
return [`/task`, ...(params ? [params] : [])] as const;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const useGetTasksQueryOptions = <
|
|
62
|
+
TData = Awaited<ReturnType<typeof getTasks>>,
|
|
63
|
+
TError = ErrorType<void | DmError>,
|
|
64
|
+
>(
|
|
65
|
+
params?: GetTasksParams,
|
|
66
|
+
options?: {
|
|
67
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>;
|
|
68
|
+
request?: SecondParameter<typeof customInstance>;
|
|
69
|
+
},
|
|
71
70
|
) => {
|
|
71
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
72
72
|
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);
|
|
73
|
+
const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);
|
|
76
74
|
|
|
77
|
-
|
|
75
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) =>
|
|
76
|
+
getTasks(params, requestOptions, signal);
|
|
78
77
|
|
|
79
|
-
|
|
78
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
80
79
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
86
|
-
}
|
|
80
|
+
return customOptions as UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData> & {
|
|
81
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
87
84
|
|
|
88
|
-
export type GetTasksQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks
|
|
89
|
-
export type GetTasksQueryError = ErrorType<void | DmError
|
|
85
|
+
export type GetTasksQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>;
|
|
86
|
+
export type GetTasksQueryError = ErrorType<void | DmError>;
|
|
90
87
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
export function useGetTasks<
|
|
89
|
+
TData = Awaited<ReturnType<typeof getTasks>>,
|
|
90
|
+
TError = ErrorType<void | DmError>,
|
|
91
|
+
>(
|
|
92
|
+
params: undefined | GetTasksParams,
|
|
93
|
+
options: {
|
|
94
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>> &
|
|
95
|
+
Pick<
|
|
94
96
|
DefinedInitialDataOptions<
|
|
95
97
|
Awaited<ReturnType<typeof getTasks>>,
|
|
96
98
|
TError,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
99
|
+
Awaited<ReturnType<typeof getTasks>>
|
|
100
|
+
>,
|
|
101
|
+
"initialData"
|
|
102
|
+
>;
|
|
103
|
+
request?: SecondParameter<typeof customInstance>;
|
|
104
|
+
},
|
|
105
|
+
queryClient?: QueryClient,
|
|
106
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
107
|
+
export function useGetTasks<
|
|
108
|
+
TData = Awaited<ReturnType<typeof getTasks>>,
|
|
109
|
+
TError = ErrorType<void | DmError>,
|
|
110
|
+
>(
|
|
111
|
+
params?: GetTasksParams,
|
|
112
|
+
options?: {
|
|
113
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>> &
|
|
114
|
+
Pick<
|
|
104
115
|
UndefinedInitialDataOptions<
|
|
105
116
|
Awaited<ReturnType<typeof getTasks>>,
|
|
106
117
|
TError,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
118
|
+
Awaited<ReturnType<typeof getTasks>>
|
|
119
|
+
>,
|
|
120
|
+
"initialData"
|
|
121
|
+
>;
|
|
122
|
+
request?: SecondParameter<typeof customInstance>;
|
|
123
|
+
},
|
|
124
|
+
queryClient?: QueryClient,
|
|
125
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
126
|
+
export function useGetTasks<
|
|
127
|
+
TData = Awaited<ReturnType<typeof getTasks>>,
|
|
128
|
+
TError = ErrorType<void | DmError>,
|
|
129
|
+
>(
|
|
130
|
+
params?: GetTasksParams,
|
|
131
|
+
options?: {
|
|
132
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>;
|
|
133
|
+
request?: SecondParameter<typeof customInstance>;
|
|
134
|
+
},
|
|
135
|
+
queryClient?: QueryClient,
|
|
136
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
116
137
|
/**
|
|
117
138
|
* @summary Returns a list of Tasks
|
|
118
139
|
*/
|
|
119
140
|
|
|
120
|
-
export function useGetTasks<
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
141
|
+
export function useGetTasks<
|
|
142
|
+
TData = Awaited<ReturnType<typeof getTasks>>,
|
|
143
|
+
TError = ErrorType<void | DmError>,
|
|
144
|
+
>(
|
|
145
|
+
params?: GetTasksParams,
|
|
146
|
+
options?: {
|
|
147
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>;
|
|
148
|
+
request?: SecondParameter<typeof customInstance>;
|
|
149
|
+
},
|
|
150
|
+
queryClient?: QueryClient,
|
|
151
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
152
|
+
const queryOptions = useGetTasksQueryOptions(params, options);
|
|
153
|
+
|
|
154
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
155
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
query.queryKey = queryOptions.queryKey;
|
|
130
159
|
|
|
131
160
|
return query;
|
|
132
161
|
}
|
|
133
162
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
163
|
+
export const useGetTasksSuspenseQueryOptions = <
|
|
164
|
+
TData = Awaited<ReturnType<typeof getTasks>>,
|
|
165
|
+
TError = ErrorType<void | DmError>,
|
|
166
|
+
>(
|
|
167
|
+
params?: GetTasksParams,
|
|
168
|
+
options?: {
|
|
169
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>;
|
|
170
|
+
request?: SecondParameter<typeof customInstance>;
|
|
171
|
+
},
|
|
137
172
|
) => {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export type GetTasksSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks
|
|
155
|
-
export type GetTasksSuspenseQueryError = ErrorType<void | DmError
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
173
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
174
|
+
|
|
175
|
+
const queryKey = queryOptions?.queryKey ?? getGetTasksQueryKey(params);
|
|
176
|
+
|
|
177
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getTasks>>> = ({ signal }) =>
|
|
178
|
+
getTasks(params, requestOptions, signal);
|
|
179
|
+
|
|
180
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
181
|
+
|
|
182
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
183
|
+
Awaited<ReturnType<typeof getTasks>>,
|
|
184
|
+
TError,
|
|
185
|
+
TData
|
|
186
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export type GetTasksSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTasks>>>;
|
|
190
|
+
export type GetTasksSuspenseQueryError = ErrorType<void | DmError>;
|
|
191
|
+
|
|
192
|
+
export function useGetTasksSuspense<
|
|
193
|
+
TData = Awaited<ReturnType<typeof getTasks>>,
|
|
194
|
+
TError = ErrorType<void | DmError>,
|
|
195
|
+
>(
|
|
196
|
+
params: undefined | GetTasksParams,
|
|
197
|
+
options: {
|
|
198
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>;
|
|
199
|
+
request?: SecondParameter<typeof customInstance>;
|
|
200
|
+
},
|
|
201
|
+
queryClient?: QueryClient,
|
|
202
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
203
|
+
export function useGetTasksSuspense<
|
|
204
|
+
TData = Awaited<ReturnType<typeof getTasks>>,
|
|
205
|
+
TError = ErrorType<void | DmError>,
|
|
206
|
+
>(
|
|
207
|
+
params?: GetTasksParams,
|
|
208
|
+
options?: {
|
|
209
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>;
|
|
210
|
+
request?: SecondParameter<typeof customInstance>;
|
|
211
|
+
},
|
|
212
|
+
queryClient?: QueryClient,
|
|
213
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
214
|
+
export function useGetTasksSuspense<
|
|
215
|
+
TData = Awaited<ReturnType<typeof getTasks>>,
|
|
216
|
+
TError = ErrorType<void | DmError>,
|
|
217
|
+
>(
|
|
218
|
+
params?: GetTasksParams,
|
|
219
|
+
options?: {
|
|
220
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>;
|
|
221
|
+
request?: SecondParameter<typeof customInstance>;
|
|
222
|
+
},
|
|
223
|
+
queryClient?: QueryClient,
|
|
224
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
170
225
|
/**
|
|
171
226
|
* @summary Returns a list of Tasks
|
|
172
227
|
*/
|
|
173
228
|
|
|
174
|
-
export function useGetTasksSuspense<
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
229
|
+
export function useGetTasksSuspense<
|
|
230
|
+
TData = Awaited<ReturnType<typeof getTasks>>,
|
|
231
|
+
TError = ErrorType<void | DmError>,
|
|
232
|
+
>(
|
|
233
|
+
params?: GetTasksParams,
|
|
234
|
+
options?: {
|
|
235
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTasks>>, TError, TData>>;
|
|
236
|
+
request?: SecondParameter<typeof customInstance>;
|
|
237
|
+
},
|
|
238
|
+
queryClient?: QueryClient,
|
|
239
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
240
|
+
const queryOptions = useGetTasksSuspenseQueryOptions(params, options);
|
|
241
|
+
|
|
242
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
243
|
+
TData,
|
|
244
|
+
TError
|
|
245
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
246
|
+
|
|
247
|
+
query.queryKey = queryOptions.queryKey;
|
|
184
248
|
|
|
185
249
|
return query;
|
|
186
250
|
}
|
|
187
251
|
|
|
188
|
-
|
|
189
|
-
|
|
190
252
|
/**
|
|
191
253
|
* Returns Task information including its states and events.
|
|
192
254
|
|
|
@@ -209,156 +271,222 @@ For Application **Instance** Tasks, where the Task `purpose` is `INSTANCE`, you
|
|
|
209
271
|
* @summary Returns Task information
|
|
210
272
|
*/
|
|
211
273
|
export const getTask = (
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
274
|
+
taskId: string,
|
|
275
|
+
params?: GetTaskParams,
|
|
276
|
+
options?: SecondParameter<typeof customInstance>,
|
|
277
|
+
signal?: AbortSignal,
|
|
215
278
|
) => {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
export const
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
279
|
+
return customInstance<TaskGetResponse>(
|
|
280
|
+
{ url: `/task/${taskId}`, method: "GET", params, signal },
|
|
281
|
+
options,
|
|
282
|
+
);
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
export const getGetTaskQueryKey = (taskId: string, params?: GetTaskParams) => {
|
|
286
|
+
return [`/task/${taskId}`, ...(params ? [params] : [])] as const;
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
export const useGetTaskQueryOptions = <
|
|
290
|
+
TData = Awaited<ReturnType<typeof getTask>>,
|
|
291
|
+
TError = ErrorType<void | DmError>,
|
|
292
|
+
>(
|
|
293
|
+
taskId: string,
|
|
294
|
+
params?: GetTaskParams,
|
|
295
|
+
options?: {
|
|
296
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>;
|
|
297
|
+
request?: SecondParameter<typeof customInstance>;
|
|
298
|
+
},
|
|
234
299
|
) => {
|
|
300
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
235
301
|
|
|
236
|
-
const
|
|
302
|
+
const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId, params);
|
|
237
303
|
|
|
238
|
-
const
|
|
304
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) =>
|
|
305
|
+
getTask(taskId, params, requestOptions, signal);
|
|
239
306
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) => getTask(taskId,params, requestOptions, signal);
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
return { queryKey, queryFn, enabled: !!(taskId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
249
|
-
}
|
|
307
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
250
308
|
|
|
251
|
-
|
|
252
|
-
|
|
309
|
+
return customOptions as UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData> & {
|
|
310
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
253
313
|
|
|
314
|
+
export type GetTaskQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>;
|
|
315
|
+
export type GetTaskQueryError = ErrorType<void | DmError>;
|
|
254
316
|
|
|
255
|
-
export function useGetTask<
|
|
256
|
-
|
|
257
|
-
|
|
317
|
+
export function useGetTask<
|
|
318
|
+
TData = Awaited<ReturnType<typeof getTask>>,
|
|
319
|
+
TError = ErrorType<void | DmError>,
|
|
320
|
+
>(
|
|
321
|
+
taskId: string,
|
|
322
|
+
params: undefined | GetTaskParams,
|
|
323
|
+
options: {
|
|
324
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>> &
|
|
325
|
+
Pick<
|
|
258
326
|
DefinedInitialDataOptions<
|
|
259
327
|
Awaited<ReturnType<typeof getTask>>,
|
|
260
328
|
TError,
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
329
|
+
Awaited<ReturnType<typeof getTask>>
|
|
330
|
+
>,
|
|
331
|
+
"initialData"
|
|
332
|
+
>;
|
|
333
|
+
request?: SecondParameter<typeof customInstance>;
|
|
334
|
+
},
|
|
335
|
+
queryClient?: QueryClient,
|
|
336
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
337
|
+
export function useGetTask<
|
|
338
|
+
TData = Awaited<ReturnType<typeof getTask>>,
|
|
339
|
+
TError = ErrorType<void | DmError>,
|
|
340
|
+
>(
|
|
341
|
+
taskId: string,
|
|
342
|
+
params?: GetTaskParams,
|
|
343
|
+
options?: {
|
|
344
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>> &
|
|
345
|
+
Pick<
|
|
269
346
|
UndefinedInitialDataOptions<
|
|
270
347
|
Awaited<ReturnType<typeof getTask>>,
|
|
271
348
|
TError,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
349
|
+
Awaited<ReturnType<typeof getTask>>
|
|
350
|
+
>,
|
|
351
|
+
"initialData"
|
|
352
|
+
>;
|
|
353
|
+
request?: SecondParameter<typeof customInstance>;
|
|
354
|
+
},
|
|
355
|
+
queryClient?: QueryClient,
|
|
356
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
357
|
+
export function useGetTask<
|
|
358
|
+
TData = Awaited<ReturnType<typeof getTask>>,
|
|
359
|
+
TError = ErrorType<void | DmError>,
|
|
360
|
+
>(
|
|
361
|
+
taskId: string,
|
|
362
|
+
params?: GetTaskParams,
|
|
363
|
+
options?: {
|
|
364
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>;
|
|
365
|
+
request?: SecondParameter<typeof customInstance>;
|
|
366
|
+
},
|
|
367
|
+
queryClient?: QueryClient,
|
|
368
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
282
369
|
/**
|
|
283
370
|
* @summary Returns Task information
|
|
284
371
|
*/
|
|
285
372
|
|
|
286
|
-
export function useGetTask<
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
373
|
+
export function useGetTask<
|
|
374
|
+
TData = Awaited<ReturnType<typeof getTask>>,
|
|
375
|
+
TError = ErrorType<void | DmError>,
|
|
376
|
+
>(
|
|
377
|
+
taskId: string,
|
|
378
|
+
params?: GetTaskParams,
|
|
379
|
+
options?: {
|
|
380
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>;
|
|
381
|
+
request?: SecondParameter<typeof customInstance>;
|
|
382
|
+
},
|
|
383
|
+
queryClient?: QueryClient,
|
|
384
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
385
|
+
const queryOptions = useGetTaskQueryOptions(taskId, params, options);
|
|
386
|
+
|
|
387
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
388
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
query.queryKey = queryOptions.queryKey;
|
|
297
392
|
|
|
298
393
|
return query;
|
|
299
394
|
}
|
|
300
395
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
396
|
+
export const useGetTaskSuspenseQueryOptions = <
|
|
397
|
+
TData = Awaited<ReturnType<typeof getTask>>,
|
|
398
|
+
TError = ErrorType<void | DmError>,
|
|
399
|
+
>(
|
|
400
|
+
taskId: string,
|
|
401
|
+
params?: GetTaskParams,
|
|
402
|
+
options?: {
|
|
403
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>;
|
|
404
|
+
request?: SecondParameter<typeof customInstance>;
|
|
405
|
+
},
|
|
305
406
|
) => {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
export type GetTaskSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTask
|
|
323
|
-
export type GetTaskSuspenseQueryError = ErrorType<void | DmError
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
407
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
408
|
+
|
|
409
|
+
const queryKey = queryOptions?.queryKey ?? getGetTaskQueryKey(taskId, params);
|
|
410
|
+
|
|
411
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getTask>>> = ({ signal }) =>
|
|
412
|
+
getTask(taskId, params, requestOptions, signal);
|
|
413
|
+
|
|
414
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
415
|
+
|
|
416
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
417
|
+
Awaited<ReturnType<typeof getTask>>,
|
|
418
|
+
TError,
|
|
419
|
+
TData
|
|
420
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
export type GetTaskSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getTask>>>;
|
|
424
|
+
export type GetTaskSuspenseQueryError = ErrorType<void | DmError>;
|
|
425
|
+
|
|
426
|
+
export function useGetTaskSuspense<
|
|
427
|
+
TData = Awaited<ReturnType<typeof getTask>>,
|
|
428
|
+
TError = ErrorType<void | DmError>,
|
|
429
|
+
>(
|
|
430
|
+
taskId: string,
|
|
431
|
+
params: undefined | GetTaskParams,
|
|
432
|
+
options: {
|
|
433
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>;
|
|
434
|
+
request?: SecondParameter<typeof customInstance>;
|
|
435
|
+
},
|
|
436
|
+
queryClient?: QueryClient,
|
|
437
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
438
|
+
export function useGetTaskSuspense<
|
|
439
|
+
TData = Awaited<ReturnType<typeof getTask>>,
|
|
440
|
+
TError = ErrorType<void | DmError>,
|
|
441
|
+
>(
|
|
442
|
+
taskId: string,
|
|
443
|
+
params?: GetTaskParams,
|
|
444
|
+
options?: {
|
|
445
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>;
|
|
446
|
+
request?: SecondParameter<typeof customInstance>;
|
|
447
|
+
},
|
|
448
|
+
queryClient?: QueryClient,
|
|
449
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
450
|
+
export function useGetTaskSuspense<
|
|
451
|
+
TData = Awaited<ReturnType<typeof getTask>>,
|
|
452
|
+
TError = ErrorType<void | DmError>,
|
|
453
|
+
>(
|
|
454
|
+
taskId: string,
|
|
455
|
+
params?: GetTaskParams,
|
|
456
|
+
options?: {
|
|
457
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>;
|
|
458
|
+
request?: SecondParameter<typeof customInstance>;
|
|
459
|
+
},
|
|
460
|
+
queryClient?: QueryClient,
|
|
461
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
341
462
|
/**
|
|
342
463
|
* @summary Returns Task information
|
|
343
464
|
*/
|
|
344
465
|
|
|
345
|
-
export function useGetTaskSuspense<
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
466
|
+
export function useGetTaskSuspense<
|
|
467
|
+
TData = Awaited<ReturnType<typeof getTask>>,
|
|
468
|
+
TError = ErrorType<void | DmError>,
|
|
469
|
+
>(
|
|
470
|
+
taskId: string,
|
|
471
|
+
params?: GetTaskParams,
|
|
472
|
+
options?: {
|
|
473
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getTask>>, TError, TData>>;
|
|
474
|
+
request?: SecondParameter<typeof customInstance>;
|
|
475
|
+
},
|
|
476
|
+
queryClient?: QueryClient,
|
|
477
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
478
|
+
const queryOptions = useGetTaskSuspenseQueryOptions(taskId, params, options);
|
|
479
|
+
|
|
480
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
481
|
+
TData,
|
|
482
|
+
TError
|
|
483
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
484
|
+
|
|
485
|
+
query.queryKey = queryOptions.queryKey;
|
|
356
486
|
|
|
357
487
|
return query;
|
|
358
488
|
}
|
|
359
489
|
|
|
360
|
-
|
|
361
|
-
|
|
362
490
|
/**
|
|
363
491
|
* Given a `task_id` the Task will be removed.
|
|
364
492
|
|
|
@@ -368,61 +496,72 @@ You must be an `owner` of the Task to delete it. For example you must be the `ow
|
|
|
368
496
|
|
|
369
497
|
* @summary Delete a Task entry
|
|
370
498
|
*/
|
|
371
|
-
export const deleteTask = (
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
)
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
499
|
+
export const deleteTask = (taskId: string, options?: SecondParameter<typeof customInstance>) => {
|
|
500
|
+
return customInstance<void>({ url: `/task/${taskId}`, method: "DELETE" }, options);
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
export const useDeleteTaskMutationOptions = <
|
|
504
|
+
TError = ErrorType<void | DmError>,
|
|
505
|
+
TContext = unknown,
|
|
506
|
+
>(options?: {
|
|
507
|
+
mutation?: UseMutationOptions<
|
|
508
|
+
Awaited<ReturnType<typeof deleteTask>>,
|
|
509
|
+
TError,
|
|
510
|
+
{ taskId: string },
|
|
511
|
+
TContext
|
|
512
|
+
>;
|
|
513
|
+
request?: SecondParameter<typeof customInstance>;
|
|
514
|
+
}): UseMutationOptions<
|
|
515
|
+
Awaited<ReturnType<typeof deleteTask>>,
|
|
516
|
+
TError,
|
|
517
|
+
{ taskId: string },
|
|
518
|
+
TContext
|
|
519
|
+
> => {
|
|
520
|
+
const mutationKey = ["deleteTask"];
|
|
521
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
522
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
523
|
+
? options
|
|
524
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
525
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
526
|
+
|
|
527
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteTask>>, { taskId: string }> = (
|
|
528
|
+
props,
|
|
529
|
+
) => {
|
|
530
|
+
const { taskId } = props ?? {};
|
|
531
|
+
|
|
532
|
+
return deleteTask(taskId, requestOptions);
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
536
|
+
|
|
537
|
+
return customOptions;
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
export type DeleteTaskMutationResult = NonNullable<Awaited<ReturnType<typeof deleteTask>>>;
|
|
541
|
+
|
|
542
|
+
export type DeleteTaskMutationError = ErrorType<void | DmError>;
|
|
395
543
|
|
|
396
|
-
|
|
397
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteTask>>, {taskId: string}> = (props) => {
|
|
398
|
-
const {taskId} = props ?? {};
|
|
399
|
-
|
|
400
|
-
return deleteTask(taskId,requestOptions)
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{taskId: string}, TContext>}
|
|
407
|
-
|
|
408
|
-
export type DeleteTaskMutationResult = NonNullable<Awaited<ReturnType<typeof deleteTask>>>
|
|
409
|
-
|
|
410
|
-
export type DeleteTaskMutationError = ErrorType<void | DmError>
|
|
411
|
-
|
|
412
|
-
/**
|
|
544
|
+
/**
|
|
413
545
|
* @summary Delete a Task entry
|
|
414
546
|
*/
|
|
415
|
-
export const useDeleteTask = <
|
|
416
|
-
|
|
547
|
+
export const useDeleteTask = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
548
|
+
options?: {
|
|
549
|
+
mutation?: UseMutationOptions<
|
|
550
|
+
Awaited<ReturnType<typeof deleteTask>>,
|
|
551
|
+
TError,
|
|
552
|
+
{ taskId: string },
|
|
553
|
+
TContext
|
|
554
|
+
>;
|
|
555
|
+
request?: SecondParameter<typeof customInstance>;
|
|
556
|
+
},
|
|
557
|
+
queryClient?: QueryClient,
|
|
417
558
|
): UseMutationResult<
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
}
|
|
428
|
-
|
|
559
|
+
Awaited<ReturnType<typeof deleteTask>>,
|
|
560
|
+
TError,
|
|
561
|
+
{ taskId: string },
|
|
562
|
+
TContext
|
|
563
|
+
> => {
|
|
564
|
+
const mutationOptions = useDeleteTaskMutationOptions(options);
|
|
565
|
+
|
|
566
|
+
return useMutation(mutationOptions, queryClient);
|
|
567
|
+
};
|