@squonk/data-manager-client 4.2.0 → 5.0.0-5-0.2173777171
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 +140 -94
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.cts +104 -47
- package/accounting/accounting.d.ts +104 -47
- package/accounting/accounting.js +146 -100
- 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 +123 -121
- package/admin/admin.d.ts +123 -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-76ADQBHZ.js +25 -0
- package/chunk-76ADQBHZ.js.map +1 -0
- package/chunk-KHB5TJT7.cjs +25 -0
- package/chunk-KHB5TJT7.cjs.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/configuration/configuration.cjs +38 -45
- package/configuration/configuration.cjs.map +1 -1
- package/configuration/configuration.d.cts +26 -26
- package/configuration/configuration.d.ts +26 -26
- 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/file-and-path/file-and-path.cjs +212 -135
- package/file-and-path/file-and-path.cjs.map +1 -1
- package/file-and-path/file-and-path.d.cts +263 -103
- package/file-and-path/file-and-path.d.ts +263 -103
- package/file-and-path/file-and-path.js +222 -145
- package/file-and-path/file-and-path.js.map +1 -1
- package/index.cjs +83 -103
- package/index.cjs.map +1 -1
- package/index.d.cts +2434 -2343
- package/index.d.ts +2434 -2343
- package/index.js +82 -102
- 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 +170 -66
- package/job/job.cjs.map +1 -1
- package/job/job.d.cts +193 -37
- package/job/job.d.ts +193 -37
- package/job/job.js +176 -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 +113 -256
- package/project/project.cjs.map +1 -1
- package/project/project.d.cts +122 -282
- package/project/project.d.ts +122 -282
- package/project/project.js +118 -261
- package/project/project.js.map +1 -1
- package/src/{data-manager-api.schemas.ts → API_TARGET_NAME.schemas.ts} +2538 -2483
- package/src/accounting/accounting.ts +1003 -455
- package/src/admin/admin.ts +1190 -788
- package/src/application/application.ts +378 -232
- package/src/configuration/configuration.ts +350 -243
- package/src/custom-instance.ts +3 -3
- package/src/dataset/dataset.ts +1200 -793
- package/src/digest/digest.ts +199 -123
- package/src/file-and-path/file-and-path.ts +1456 -603
- package/src/index.ts +3 -3
- package/src/instance/instance.ts +805 -540
- package/src/inventory/inventory.ts +201 -123
- package/src/job/job.ts +1134 -330
- package/src/metadata/metadata.ts +588 -372
- package/src/options-mutator.ts +27 -0
- package/src/project/project.ts +1064 -1121
- package/src/task/task.ts +435 -296
- package/src/type/type.ts +181 -127
- package/src/user/user.ts +847 -399
- package/src/workflow/workflow.ts +1754 -1091
- 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 +149 -147
- package/workflow/workflow.d.ts +149 -147
- 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/exchange-rate/exchange-rate.cjs +0 -253
- package/exchange-rate/exchange-rate.cjs.map +0 -1
- package/exchange-rate/exchange-rate.d.cts +0 -319
- package/exchange-rate/exchange-rate.d.ts +0 -319
- package/exchange-rate/exchange-rate.js +0 -253
- package/exchange-rate/exchange-rate.js.map +0 -1
- package/exchange-rate/package.json +0 -7
- package/src/exchange-rate/exchange-rate.ts +0 -800
|
@@ -1,24 +1,20 @@
|
|
|
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.
|
|
7
6
|
|
|
8
7
|
A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications**, **Jobs**, and **Workflows** using **Projects** and **Files**.
|
|
9
8
|
|
|
10
|
-
* OpenAPI spec version:
|
|
9
|
+
* OpenAPI spec version: 5.0
|
|
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,8 +23,9 @@ 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
|
CreatePathParams,
|
|
34
31
|
DeletePathParams,
|
|
@@ -38,15 +35,19 @@ import type {
|
|
|
38
35
|
FilePostResponse,
|
|
39
36
|
FilesGetResponse,
|
|
40
37
|
GetFilesParams,
|
|
38
|
+
GetProjectFileParams,
|
|
39
|
+
GetProjectFileWithTokenParams,
|
|
41
40
|
MoveFileInProjectParams,
|
|
42
|
-
MovePathParams
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
import type { ErrorType } from '.././custom-instance';
|
|
46
|
-
|
|
41
|
+
MovePathParams,
|
|
42
|
+
ProjectFilePutBodyBody,
|
|
43
|
+
} from "../API_TARGET_NAME.schemas";
|
|
47
44
|
|
|
48
|
-
|
|
45
|
+
import { customInstance } from ".././custom-instance";
|
|
46
|
+
import type { ErrorType } from ".././custom-instance";
|
|
47
|
+
import { mutationMutator } from ".././options-mutator";
|
|
48
|
+
import { queryMutator } from ".././options-mutator";
|
|
49
49
|
|
|
50
|
+
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
50
51
|
|
|
51
52
|
/**
|
|
52
53
|
* Creates a new Path within a Project. Every directory in the Path will be created. The path will belong to the User and Project.
|
|
@@ -56,64 +57,79 @@ Only Project editors can create Paths.
|
|
|
56
57
|
* @summary Create a new Project Path
|
|
57
58
|
*/
|
|
58
59
|
export const createPath = (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return customInstance<void>(
|
|
64
|
-
{url: `/path`, method: 'PUT',
|
|
65
|
-
params
|
|
66
|
-
},
|
|
67
|
-
options);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
export const getCreatePathMutationOptions = <TData = Awaited<ReturnType<typeof createPath>>, TError = ErrorType<void | DmError>,
|
|
73
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{params: CreatePathParams}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
60
|
+
params: CreatePathParams,
|
|
61
|
+
options?: SecondParameter<typeof customInstance>,
|
|
74
62
|
) => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
63
|
+
return customInstance<void>({ url: `/path`, method: "PUT", params }, options);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const useCreatePathMutationOptions = <
|
|
67
|
+
TError = ErrorType<void | DmError>,
|
|
68
|
+
TContext = unknown,
|
|
69
|
+
>(options?: {
|
|
70
|
+
mutation?: UseMutationOptions<
|
|
71
|
+
Awaited<ReturnType<typeof createPath>>,
|
|
72
|
+
TError,
|
|
73
|
+
{ params: CreatePathParams },
|
|
74
|
+
TContext
|
|
75
|
+
>;
|
|
76
|
+
request?: SecondParameter<typeof customInstance>;
|
|
77
|
+
}): UseMutationOptions<
|
|
78
|
+
Awaited<ReturnType<typeof createPath>>,
|
|
79
|
+
TError,
|
|
80
|
+
{ params: CreatePathParams },
|
|
81
|
+
TContext
|
|
82
|
+
> => {
|
|
83
|
+
const mutationKey = ["createPath"];
|
|
84
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
85
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
86
|
+
? options
|
|
87
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
88
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
89
|
+
|
|
90
|
+
const mutationFn: MutationFunction<
|
|
91
|
+
Awaited<ReturnType<typeof createPath>>,
|
|
92
|
+
{ params: CreatePathParams }
|
|
93
|
+
> = (props) => {
|
|
94
|
+
const { params } = props ?? {};
|
|
95
|
+
|
|
96
|
+
return createPath(params, requestOptions);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
100
|
+
|
|
101
|
+
return customOptions;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export type CreatePathMutationResult = NonNullable<Awaited<ReturnType<typeof createPath>>>;
|
|
105
|
+
|
|
106
|
+
export type CreatePathMutationError = ErrorType<void | DmError>;
|
|
84
107
|
|
|
85
|
-
|
|
86
|
-
const {params} = props ?? {};
|
|
87
|
-
|
|
88
|
-
return createPath(params,requestOptions)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{params: CreatePathParams}, TContext>}
|
|
95
|
-
|
|
96
|
-
export type CreatePathMutationResult = NonNullable<Awaited<ReturnType<typeof createPath>>>
|
|
97
|
-
|
|
98
|
-
export type CreatePathMutationError = ErrorType<void | DmError>
|
|
99
|
-
|
|
100
|
-
/**
|
|
108
|
+
/**
|
|
101
109
|
* @summary Create a new Project Path
|
|
102
110
|
*/
|
|
103
|
-
export const useCreatePath = <
|
|
104
|
-
|
|
111
|
+
export const useCreatePath = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
112
|
+
options?: {
|
|
113
|
+
mutation?: UseMutationOptions<
|
|
114
|
+
Awaited<ReturnType<typeof createPath>>,
|
|
115
|
+
TError,
|
|
116
|
+
{ params: CreatePathParams },
|
|
117
|
+
TContext
|
|
118
|
+
>;
|
|
119
|
+
request?: SecondParameter<typeof customInstance>;
|
|
120
|
+
},
|
|
121
|
+
queryClient?: QueryClient,
|
|
105
122
|
): UseMutationResult<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
/**
|
|
123
|
+
Awaited<ReturnType<typeof createPath>>,
|
|
124
|
+
TError,
|
|
125
|
+
{ params: CreatePathParams },
|
|
126
|
+
TContext
|
|
127
|
+
> => {
|
|
128
|
+
const mutationOptions = useCreatePathMutationOptions(options);
|
|
129
|
+
|
|
130
|
+
return useMutation(mutationOptions, queryClient);
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
117
133
|
* Deletes a Path within the Project. Be aware that the deletion of a Path will result in the contents of the Path also being deleted. If there are files in Path or sub-directories, they will all be deleted.
|
|
118
134
|
|
|
119
135
|
Only Project editors can delete Paths.
|
|
@@ -121,64 +137,79 @@ Only Project editors can delete Paths.
|
|
|
121
137
|
* @summary Delete a Project Path
|
|
122
138
|
*/
|
|
123
139
|
export const deletePath = (
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
return customInstance<void>(
|
|
129
|
-
{url: `/path`, method: 'DELETE',
|
|
130
|
-
params
|
|
131
|
-
},
|
|
132
|
-
options);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
export const getDeletePathMutationOptions = <TData = Awaited<ReturnType<typeof deletePath>>, TError = ErrorType<void | DmError>,
|
|
138
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{params: DeletePathParams}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
140
|
+
params: DeletePathParams,
|
|
141
|
+
options?: SecondParameter<typeof customInstance>,
|
|
139
142
|
) => {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
143
|
+
return customInstance<void>({ url: `/path`, method: "DELETE", params }, options);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export const useDeletePathMutationOptions = <
|
|
147
|
+
TError = ErrorType<void | DmError>,
|
|
148
|
+
TContext = unknown,
|
|
149
|
+
>(options?: {
|
|
150
|
+
mutation?: UseMutationOptions<
|
|
151
|
+
Awaited<ReturnType<typeof deletePath>>,
|
|
152
|
+
TError,
|
|
153
|
+
{ params: DeletePathParams },
|
|
154
|
+
TContext
|
|
155
|
+
>;
|
|
156
|
+
request?: SecondParameter<typeof customInstance>;
|
|
157
|
+
}): UseMutationOptions<
|
|
158
|
+
Awaited<ReturnType<typeof deletePath>>,
|
|
159
|
+
TError,
|
|
160
|
+
{ params: DeletePathParams },
|
|
161
|
+
TContext
|
|
162
|
+
> => {
|
|
163
|
+
const mutationKey = ["deletePath"];
|
|
164
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
165
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
166
|
+
? options
|
|
167
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
168
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
169
|
+
|
|
170
|
+
const mutationFn: MutationFunction<
|
|
171
|
+
Awaited<ReturnType<typeof deletePath>>,
|
|
172
|
+
{ params: DeletePathParams }
|
|
173
|
+
> = (props) => {
|
|
174
|
+
const { params } = props ?? {};
|
|
175
|
+
|
|
176
|
+
return deletePath(params, requestOptions);
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
180
|
+
|
|
181
|
+
return customOptions;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export type DeletePathMutationResult = NonNullable<Awaited<ReturnType<typeof deletePath>>>;
|
|
185
|
+
|
|
186
|
+
export type DeletePathMutationError = ErrorType<void | DmError>;
|
|
164
187
|
|
|
165
|
-
|
|
188
|
+
/**
|
|
166
189
|
* @summary Delete a Project Path
|
|
167
190
|
*/
|
|
168
|
-
export const useDeletePath = <
|
|
169
|
-
|
|
191
|
+
export const useDeletePath = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
192
|
+
options?: {
|
|
193
|
+
mutation?: UseMutationOptions<
|
|
194
|
+
Awaited<ReturnType<typeof deletePath>>,
|
|
195
|
+
TError,
|
|
196
|
+
{ params: DeletePathParams },
|
|
197
|
+
TContext
|
|
198
|
+
>;
|
|
199
|
+
request?: SecondParameter<typeof customInstance>;
|
|
200
|
+
},
|
|
201
|
+
queryClient?: QueryClient,
|
|
170
202
|
): UseMutationResult<
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
/**
|
|
203
|
+
Awaited<ReturnType<typeof deletePath>>,
|
|
204
|
+
TError,
|
|
205
|
+
{ params: DeletePathParams },
|
|
206
|
+
TContext
|
|
207
|
+
> => {
|
|
208
|
+
const mutationOptions = useDeletePathMutationOptions(options);
|
|
209
|
+
|
|
210
|
+
return useMutation(mutationOptions, queryClient);
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
182
213
|
* Moves and existing Path within a Project. The path will belong to the User and Project. Any ProjectFile instances on the path will be moved to the new path.
|
|
183
214
|
|
|
184
215
|
Only Project editors can move Paths.
|
|
@@ -186,207 +217,883 @@ Only Project editors can move Paths.
|
|
|
186
217
|
* @summary Move a Project Path
|
|
187
218
|
*/
|
|
188
219
|
export const movePath = (
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
return customInstance<void>(
|
|
194
|
-
{url: `/path/move`, method: 'PUT',
|
|
195
|
-
params
|
|
196
|
-
},
|
|
197
|
-
options);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
export const getMovePathMutationOptions = <TData = Awaited<ReturnType<typeof movePath>>, TError = ErrorType<void | DmError>,
|
|
203
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{params: MovePathParams}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
220
|
+
params: MovePathParams,
|
|
221
|
+
options?: SecondParameter<typeof customInstance>,
|
|
204
222
|
) => {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
return customInstance<void>({ url: `/path/move`, method: "PUT", params }, options);
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
export const useMovePathMutationOptions = <
|
|
227
|
+
TError = ErrorType<void | DmError>,
|
|
228
|
+
TContext = unknown,
|
|
229
|
+
>(options?: {
|
|
230
|
+
mutation?: UseMutationOptions<
|
|
231
|
+
Awaited<ReturnType<typeof movePath>>,
|
|
232
|
+
TError,
|
|
233
|
+
{ params: MovePathParams },
|
|
234
|
+
TContext
|
|
235
|
+
>;
|
|
236
|
+
request?: SecondParameter<typeof customInstance>;
|
|
237
|
+
}): UseMutationOptions<
|
|
238
|
+
Awaited<ReturnType<typeof movePath>>,
|
|
239
|
+
TError,
|
|
240
|
+
{ params: MovePathParams },
|
|
241
|
+
TContext
|
|
242
|
+
> => {
|
|
243
|
+
const mutationKey = ["movePath"];
|
|
244
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
245
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
246
|
+
? options
|
|
247
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
248
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
249
|
+
|
|
250
|
+
const mutationFn: MutationFunction<
|
|
251
|
+
Awaited<ReturnType<typeof movePath>>,
|
|
252
|
+
{ params: MovePathParams }
|
|
253
|
+
> = (props) => {
|
|
254
|
+
const { params } = props ?? {};
|
|
255
|
+
|
|
256
|
+
return movePath(params, requestOptions);
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
260
|
+
|
|
261
|
+
return customOptions;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
export type MovePathMutationResult = NonNullable<Awaited<ReturnType<typeof movePath>>>;
|
|
265
|
+
|
|
266
|
+
export type MovePathMutationError = ErrorType<void | DmError>;
|
|
225
267
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
export type MovePathMutationError = ErrorType<void | DmError>
|
|
229
|
-
|
|
230
|
-
/**
|
|
268
|
+
/**
|
|
231
269
|
* @summary Move a Project Path
|
|
232
270
|
*/
|
|
233
|
-
export const useMovePath = <
|
|
234
|
-
|
|
271
|
+
export const useMovePath = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
272
|
+
options?: {
|
|
273
|
+
mutation?: UseMutationOptions<
|
|
274
|
+
Awaited<ReturnType<typeof movePath>>,
|
|
275
|
+
TError,
|
|
276
|
+
{ params: MovePathParams },
|
|
277
|
+
TContext
|
|
278
|
+
>;
|
|
279
|
+
request?: SecondParameter<typeof customInstance>;
|
|
280
|
+
},
|
|
281
|
+
queryClient?: QueryClient,
|
|
235
282
|
): UseMutationResult<
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
283
|
+
Awaited<ReturnType<typeof movePath>>,
|
|
284
|
+
TError,
|
|
285
|
+
{ params: MovePathParams },
|
|
286
|
+
TContext
|
|
287
|
+
> => {
|
|
288
|
+
const mutationOptions = useMovePathMutationOptions(options);
|
|
289
|
+
|
|
290
|
+
return useMutation(mutationOptions, queryClient);
|
|
291
|
+
};
|
|
292
|
+
/**
|
|
293
|
+
* Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).
|
|
241
294
|
|
|
242
|
-
|
|
295
|
+
For **managed** files you should consider using the `/file/{file_id}` endpoint.
|
|
243
296
|
|
|
244
|
-
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Given a Project and Path the files available to you on that path will be returned along with any additional paths (sub-directories).
|
|
297
|
+
You must be an `editor` of the Project if the Project is `private`
|
|
248
298
|
|
|
249
|
-
* @summary
|
|
299
|
+
* @summary Download a Project file
|
|
250
300
|
*/
|
|
251
|
-
export const
|
|
252
|
-
|
|
253
|
-
|
|
301
|
+
export const getProjectFile = (
|
|
302
|
+
projectId: string,
|
|
303
|
+
params: GetProjectFileParams,
|
|
304
|
+
options?: SecondParameter<typeof customInstance>,
|
|
305
|
+
signal?: AbortSignal,
|
|
254
306
|
) => {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
307
|
+
return customInstance<void>(
|
|
308
|
+
{ url: `/project/${projectId}/file`, method: "GET", params, signal },
|
|
309
|
+
options,
|
|
310
|
+
);
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
export const getGetProjectFileQueryKey = (projectId: string, params: GetProjectFileParams) => {
|
|
314
|
+
return [`/project/${projectId}/file`, ...(params ? [params] : [])] as const;
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
export const useGetProjectFileQueryOptions = <
|
|
318
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
319
|
+
TError = ErrorType<void | DmError>,
|
|
320
|
+
>(
|
|
321
|
+
projectId: string,
|
|
322
|
+
params: GetProjectFileParams,
|
|
323
|
+
options?: {
|
|
324
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>>;
|
|
325
|
+
request?: SecondParameter<typeof customInstance>;
|
|
326
|
+
},
|
|
327
|
+
) => {
|
|
328
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
329
|
+
|
|
330
|
+
const queryKey = queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectId, params);
|
|
331
|
+
|
|
332
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFile>>> = ({ signal }) =>
|
|
333
|
+
getProjectFile(projectId, params, requestOptions, signal);
|
|
334
|
+
|
|
335
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
336
|
+
|
|
337
|
+
return customOptions as UseQueryOptions<
|
|
338
|
+
Awaited<ReturnType<typeof getProjectFile>>,
|
|
339
|
+
TError,
|
|
340
|
+
TData
|
|
341
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
export type GetProjectFileQueryResult = NonNullable<Awaited<ReturnType<typeof getProjectFile>>>;
|
|
345
|
+
export type GetProjectFileQueryError = ErrorType<void | DmError>;
|
|
346
|
+
|
|
347
|
+
export function useGetProjectFile<
|
|
348
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
349
|
+
TError = ErrorType<void | DmError>,
|
|
350
|
+
>(
|
|
351
|
+
projectId: string,
|
|
352
|
+
params: GetProjectFileParams,
|
|
353
|
+
options: {
|
|
354
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>> &
|
|
355
|
+
Pick<
|
|
356
|
+
DefinedInitialDataOptions<
|
|
357
|
+
Awaited<ReturnType<typeof getProjectFile>>,
|
|
358
|
+
TError,
|
|
359
|
+
Awaited<ReturnType<typeof getProjectFile>>
|
|
360
|
+
>,
|
|
361
|
+
"initialData"
|
|
362
|
+
>;
|
|
363
|
+
request?: SecondParameter<typeof customInstance>;
|
|
364
|
+
},
|
|
365
|
+
queryClient?: QueryClient,
|
|
366
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
367
|
+
export function useGetProjectFile<
|
|
368
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
369
|
+
TError = ErrorType<void | DmError>,
|
|
370
|
+
>(
|
|
371
|
+
projectId: string,
|
|
372
|
+
params: GetProjectFileParams,
|
|
373
|
+
options?: {
|
|
374
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>> &
|
|
375
|
+
Pick<
|
|
376
|
+
UndefinedInitialDataOptions<
|
|
377
|
+
Awaited<ReturnType<typeof getProjectFile>>,
|
|
378
|
+
TError,
|
|
379
|
+
Awaited<ReturnType<typeof getProjectFile>>
|
|
380
|
+
>,
|
|
381
|
+
"initialData"
|
|
382
|
+
>;
|
|
383
|
+
request?: SecondParameter<typeof customInstance>;
|
|
384
|
+
},
|
|
385
|
+
queryClient?: QueryClient,
|
|
386
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
387
|
+
export function useGetProjectFile<
|
|
388
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
389
|
+
TError = ErrorType<void | DmError>,
|
|
390
|
+
>(
|
|
391
|
+
projectId: string,
|
|
392
|
+
params: GetProjectFileParams,
|
|
393
|
+
options?: {
|
|
394
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>>;
|
|
395
|
+
request?: SecondParameter<typeof customInstance>;
|
|
396
|
+
},
|
|
397
|
+
queryClient?: QueryClient,
|
|
398
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
399
|
+
/**
|
|
400
|
+
* @summary Download a Project file
|
|
401
|
+
*/
|
|
264
402
|
|
|
265
|
-
export
|
|
266
|
-
|
|
267
|
-
|
|
403
|
+
export function useGetProjectFile<
|
|
404
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
405
|
+
TError = ErrorType<void | DmError>,
|
|
406
|
+
>(
|
|
407
|
+
projectId: string,
|
|
408
|
+
params: GetProjectFileParams,
|
|
409
|
+
options?: {
|
|
410
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>>;
|
|
411
|
+
request?: SecondParameter<typeof customInstance>;
|
|
412
|
+
},
|
|
413
|
+
queryClient?: QueryClient,
|
|
414
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
415
|
+
const queryOptions = useGetProjectFileQueryOptions(projectId, params, options);
|
|
416
|
+
|
|
417
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
418
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
query.queryKey = queryOptions.queryKey;
|
|
268
422
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
) => {
|
|
423
|
+
return query;
|
|
424
|
+
}
|
|
272
425
|
|
|
273
|
-
const
|
|
426
|
+
export const useGetProjectFileSuspenseQueryOptions = <
|
|
427
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
428
|
+
TError = ErrorType<void | DmError>,
|
|
429
|
+
>(
|
|
430
|
+
projectId: string,
|
|
431
|
+
params: GetProjectFileParams,
|
|
432
|
+
options?: {
|
|
433
|
+
query?: Partial<
|
|
434
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>
|
|
435
|
+
>;
|
|
436
|
+
request?: SecondParameter<typeof customInstance>;
|
|
437
|
+
},
|
|
438
|
+
) => {
|
|
439
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
440
|
+
|
|
441
|
+
const queryKey = queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectId, params);
|
|
442
|
+
|
|
443
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFile>>> = ({ signal }) =>
|
|
444
|
+
getProjectFile(projectId, params, requestOptions, signal);
|
|
445
|
+
|
|
446
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
447
|
+
|
|
448
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
449
|
+
Awaited<ReturnType<typeof getProjectFile>>,
|
|
450
|
+
TError,
|
|
451
|
+
TData
|
|
452
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
export type GetProjectFileSuspenseQueryResult = NonNullable<
|
|
456
|
+
Awaited<ReturnType<typeof getProjectFile>>
|
|
457
|
+
>;
|
|
458
|
+
export type GetProjectFileSuspenseQueryError = ErrorType<void | DmError>;
|
|
459
|
+
|
|
460
|
+
export function useGetProjectFileSuspense<
|
|
461
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
462
|
+
TError = ErrorType<void | DmError>,
|
|
463
|
+
>(
|
|
464
|
+
projectId: string,
|
|
465
|
+
params: GetProjectFileParams,
|
|
466
|
+
options: {
|
|
467
|
+
query: Partial<
|
|
468
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>
|
|
469
|
+
>;
|
|
470
|
+
request?: SecondParameter<typeof customInstance>;
|
|
471
|
+
},
|
|
472
|
+
queryClient?: QueryClient,
|
|
473
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
474
|
+
export function useGetProjectFileSuspense<
|
|
475
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
476
|
+
TError = ErrorType<void | DmError>,
|
|
477
|
+
>(
|
|
478
|
+
projectId: string,
|
|
479
|
+
params: GetProjectFileParams,
|
|
480
|
+
options?: {
|
|
481
|
+
query?: Partial<
|
|
482
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>
|
|
483
|
+
>;
|
|
484
|
+
request?: SecondParameter<typeof customInstance>;
|
|
485
|
+
},
|
|
486
|
+
queryClient?: QueryClient,
|
|
487
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
488
|
+
export function useGetProjectFileSuspense<
|
|
489
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
490
|
+
TError = ErrorType<void | DmError>,
|
|
491
|
+
>(
|
|
492
|
+
projectId: string,
|
|
493
|
+
params: GetProjectFileParams,
|
|
494
|
+
options?: {
|
|
495
|
+
query?: Partial<
|
|
496
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>
|
|
497
|
+
>;
|
|
498
|
+
request?: SecondParameter<typeof customInstance>;
|
|
499
|
+
},
|
|
500
|
+
queryClient?: QueryClient,
|
|
501
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
502
|
+
/**
|
|
503
|
+
* @summary Download a Project file
|
|
504
|
+
*/
|
|
274
505
|
|
|
275
|
-
|
|
506
|
+
export function useGetProjectFileSuspense<
|
|
507
|
+
TData = Awaited<ReturnType<typeof getProjectFile>>,
|
|
508
|
+
TError = ErrorType<void | DmError>,
|
|
509
|
+
>(
|
|
510
|
+
projectId: string,
|
|
511
|
+
params: GetProjectFileParams,
|
|
512
|
+
options?: {
|
|
513
|
+
query?: Partial<
|
|
514
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFile>>, TError, TData>
|
|
515
|
+
>;
|
|
516
|
+
request?: SecondParameter<typeof customInstance>;
|
|
517
|
+
},
|
|
518
|
+
queryClient?: QueryClient,
|
|
519
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
520
|
+
const queryOptions = useGetProjectFileSuspenseQueryOptions(projectId, params, options);
|
|
521
|
+
|
|
522
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
523
|
+
TData,
|
|
524
|
+
TError
|
|
525
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
526
|
+
|
|
527
|
+
query.queryKey = queryOptions.queryKey;
|
|
276
528
|
|
|
277
|
-
|
|
529
|
+
return query;
|
|
530
|
+
}
|
|
278
531
|
|
|
279
|
-
|
|
532
|
+
/**
|
|
533
|
+
* The user provides an external file for upload to the Project using an optional Path. The path is created if it does not exist.
|
|
280
534
|
|
|
281
|
-
|
|
535
|
+
You must be an `editor` of the project
|
|
282
536
|
|
|
283
|
-
|
|
537
|
+
* @summary Upload a file into a Project
|
|
538
|
+
*/
|
|
539
|
+
export const addFileToProject = (
|
|
540
|
+
projectId: string,
|
|
541
|
+
projectFilePutBodyBody: ProjectFilePutBodyBody,
|
|
542
|
+
options?: SecondParameter<typeof customInstance>,
|
|
543
|
+
) => {
|
|
544
|
+
const formData = new FormData();
|
|
545
|
+
formData.append(`file`, projectFilePutBodyBody.file);
|
|
546
|
+
if (projectFilePutBodyBody.as_filename !== undefined) {
|
|
547
|
+
formData.append(`as_filename`, projectFilePutBodyBody.as_filename);
|
|
548
|
+
}
|
|
549
|
+
if (projectFilePutBodyBody.path !== undefined) {
|
|
550
|
+
formData.append(`path`, projectFilePutBodyBody.path);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
return customInstance<void>(
|
|
554
|
+
{
|
|
555
|
+
url: `/project/${projectId}/file`,
|
|
556
|
+
method: "PUT",
|
|
557
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
558
|
+
data: formData,
|
|
559
|
+
},
|
|
560
|
+
options,
|
|
561
|
+
);
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
export const useAddFileToProjectMutationOptions = <
|
|
565
|
+
TError = ErrorType<void | DmError>,
|
|
566
|
+
TContext = unknown,
|
|
567
|
+
>(options?: {
|
|
568
|
+
mutation?: UseMutationOptions<
|
|
569
|
+
Awaited<ReturnType<typeof addFileToProject>>,
|
|
570
|
+
TError,
|
|
571
|
+
{ projectId: string; data: ProjectFilePutBodyBody },
|
|
572
|
+
TContext
|
|
573
|
+
>;
|
|
574
|
+
request?: SecondParameter<typeof customInstance>;
|
|
575
|
+
}): UseMutationOptions<
|
|
576
|
+
Awaited<ReturnType<typeof addFileToProject>>,
|
|
577
|
+
TError,
|
|
578
|
+
{ projectId: string; data: ProjectFilePutBodyBody },
|
|
579
|
+
TContext
|
|
580
|
+
> => {
|
|
581
|
+
const mutationKey = ["addFileToProject"];
|
|
582
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
583
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
584
|
+
? options
|
|
585
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
586
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
587
|
+
|
|
588
|
+
const mutationFn: MutationFunction<
|
|
589
|
+
Awaited<ReturnType<typeof addFileToProject>>,
|
|
590
|
+
{ projectId: string; data: ProjectFilePutBodyBody }
|
|
591
|
+
> = (props) => {
|
|
592
|
+
const { projectId, data } = props ?? {};
|
|
593
|
+
|
|
594
|
+
return addFileToProject(projectId, data, requestOptions);
|
|
595
|
+
};
|
|
596
|
+
|
|
597
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
598
|
+
|
|
599
|
+
return customOptions;
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
export type AddFileToProjectMutationResult = NonNullable<
|
|
603
|
+
Awaited<ReturnType<typeof addFileToProject>>
|
|
604
|
+
>;
|
|
605
|
+
export type AddFileToProjectMutationBody = ProjectFilePutBodyBody;
|
|
606
|
+
export type AddFileToProjectMutationError = ErrorType<void | DmError>;
|
|
284
607
|
|
|
285
|
-
|
|
286
|
-
|
|
608
|
+
/**
|
|
609
|
+
* @summary Upload a file into a Project
|
|
610
|
+
*/
|
|
611
|
+
export const useAddFileToProject = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
612
|
+
options?: {
|
|
613
|
+
mutation?: UseMutationOptions<
|
|
614
|
+
Awaited<ReturnType<typeof addFileToProject>>,
|
|
615
|
+
TError,
|
|
616
|
+
{ projectId: string; data: ProjectFilePutBodyBody },
|
|
617
|
+
TContext
|
|
618
|
+
>;
|
|
619
|
+
request?: SecondParameter<typeof customInstance>;
|
|
620
|
+
},
|
|
621
|
+
queryClient?: QueryClient,
|
|
622
|
+
): UseMutationResult<
|
|
623
|
+
Awaited<ReturnType<typeof addFileToProject>>,
|
|
624
|
+
TError,
|
|
625
|
+
{ projectId: string; data: ProjectFilePutBodyBody },
|
|
626
|
+
TContext
|
|
627
|
+
> => {
|
|
628
|
+
const mutationOptions = useAddFileToProjectMutationOptions(options);
|
|
629
|
+
|
|
630
|
+
return useMutation(mutationOptions, queryClient);
|
|
631
|
+
};
|
|
632
|
+
/**
|
|
633
|
+
* Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).
|
|
287
634
|
|
|
288
|
-
|
|
289
|
-
export type GetFilesQueryError = ErrorType<void | DmError>
|
|
635
|
+
For **managed** files you should consider using the `/file/{file_id}` endpoint.
|
|
290
636
|
|
|
637
|
+
As there is no authentication for this endpoint you must provide a valid token. The token must be a token valid for the project, usually generated when an **Instance** has been launched in the Project.
|
|
291
638
|
|
|
292
|
-
|
|
293
|
-
|
|
639
|
+
* @summary Download a Project file using a Token
|
|
640
|
+
*/
|
|
641
|
+
export const getProjectFileWithToken = (
|
|
642
|
+
projectId: string,
|
|
643
|
+
params: GetProjectFileWithTokenParams,
|
|
644
|
+
options?: SecondParameter<typeof customInstance>,
|
|
645
|
+
signal?: AbortSignal,
|
|
646
|
+
) => {
|
|
647
|
+
return customInstance<void>(
|
|
648
|
+
{ url: `/project/${projectId}/file-with-token`, method: "GET", params, signal },
|
|
649
|
+
options,
|
|
650
|
+
);
|
|
651
|
+
};
|
|
652
|
+
|
|
653
|
+
export const getGetProjectFileWithTokenQueryKey = (
|
|
654
|
+
projectId: string,
|
|
655
|
+
params: GetProjectFileWithTokenParams,
|
|
656
|
+
) => {
|
|
657
|
+
return [`/project/${projectId}/file-with-token`, ...(params ? [params] : [])] as const;
|
|
658
|
+
};
|
|
659
|
+
|
|
660
|
+
export const useGetProjectFileWithTokenQueryOptions = <
|
|
661
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
662
|
+
TError = ErrorType<DmError>,
|
|
663
|
+
>(
|
|
664
|
+
projectId: string,
|
|
665
|
+
params: GetProjectFileWithTokenParams,
|
|
666
|
+
options?: {
|
|
667
|
+
query?: Partial<
|
|
668
|
+
UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
669
|
+
>;
|
|
670
|
+
request?: SecondParameter<typeof customInstance>;
|
|
671
|
+
},
|
|
672
|
+
) => {
|
|
673
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
674
|
+
|
|
675
|
+
const queryKey = queryOptions?.queryKey ?? getGetProjectFileWithTokenQueryKey(projectId, params);
|
|
676
|
+
|
|
677
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFileWithToken>>> = ({
|
|
678
|
+
signal,
|
|
679
|
+
}) => getProjectFileWithToken(projectId, params, requestOptions, signal);
|
|
680
|
+
|
|
681
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
682
|
+
|
|
683
|
+
return customOptions as UseQueryOptions<
|
|
684
|
+
Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
685
|
+
TError,
|
|
686
|
+
TData
|
|
687
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
688
|
+
};
|
|
689
|
+
|
|
690
|
+
export type GetProjectFileWithTokenQueryResult = NonNullable<
|
|
691
|
+
Awaited<ReturnType<typeof getProjectFileWithToken>>
|
|
692
|
+
>;
|
|
693
|
+
export type GetProjectFileWithTokenQueryError = ErrorType<DmError>;
|
|
694
|
+
|
|
695
|
+
export function useGetProjectFileWithToken<
|
|
696
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
697
|
+
TError = ErrorType<DmError>,
|
|
698
|
+
>(
|
|
699
|
+
projectId: string,
|
|
700
|
+
params: GetProjectFileWithTokenParams,
|
|
701
|
+
options: {
|
|
702
|
+
query: Partial<
|
|
703
|
+
UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
704
|
+
> &
|
|
705
|
+
Pick<
|
|
294
706
|
DefinedInitialDataOptions<
|
|
295
|
-
Awaited<ReturnType<typeof
|
|
707
|
+
Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
296
708
|
TError,
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
709
|
+
Awaited<ReturnType<typeof getProjectFileWithToken>>
|
|
710
|
+
>,
|
|
711
|
+
"initialData"
|
|
712
|
+
>;
|
|
713
|
+
request?: SecondParameter<typeof customInstance>;
|
|
714
|
+
},
|
|
715
|
+
queryClient?: QueryClient,
|
|
716
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
717
|
+
export function useGetProjectFileWithToken<
|
|
718
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
719
|
+
TError = ErrorType<DmError>,
|
|
720
|
+
>(
|
|
721
|
+
projectId: string,
|
|
722
|
+
params: GetProjectFileWithTokenParams,
|
|
723
|
+
options?: {
|
|
724
|
+
query?: Partial<
|
|
725
|
+
UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
726
|
+
> &
|
|
727
|
+
Pick<
|
|
304
728
|
UndefinedInitialDataOptions<
|
|
305
|
-
Awaited<ReturnType<typeof
|
|
729
|
+
Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
306
730
|
TError,
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
731
|
+
Awaited<ReturnType<typeof getProjectFileWithToken>>
|
|
732
|
+
>,
|
|
733
|
+
"initialData"
|
|
734
|
+
>;
|
|
735
|
+
request?: SecondParameter<typeof customInstance>;
|
|
736
|
+
},
|
|
737
|
+
queryClient?: QueryClient,
|
|
738
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
739
|
+
export function useGetProjectFileWithToken<
|
|
740
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
741
|
+
TError = ErrorType<DmError>,
|
|
742
|
+
>(
|
|
743
|
+
projectId: string,
|
|
744
|
+
params: GetProjectFileWithTokenParams,
|
|
745
|
+
options?: {
|
|
746
|
+
query?: Partial<
|
|
747
|
+
UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
748
|
+
>;
|
|
749
|
+
request?: SecondParameter<typeof customInstance>;
|
|
750
|
+
},
|
|
751
|
+
queryClient?: QueryClient,
|
|
752
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
316
753
|
/**
|
|
317
|
-
* @summary
|
|
754
|
+
* @summary Download a Project file using a Token
|
|
318
755
|
*/
|
|
319
756
|
|
|
320
|
-
export function
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
757
|
+
export function useGetProjectFileWithToken<
|
|
758
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
759
|
+
TError = ErrorType<DmError>,
|
|
760
|
+
>(
|
|
761
|
+
projectId: string,
|
|
762
|
+
params: GetProjectFileWithTokenParams,
|
|
763
|
+
options?: {
|
|
764
|
+
query?: Partial<
|
|
765
|
+
UseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
766
|
+
>;
|
|
767
|
+
request?: SecondParameter<typeof customInstance>;
|
|
768
|
+
},
|
|
769
|
+
queryClient?: QueryClient,
|
|
770
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
771
|
+
const queryOptions = useGetProjectFileWithTokenQueryOptions(projectId, params, options);
|
|
772
|
+
|
|
773
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
774
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
query.queryKey = queryOptions.queryKey;
|
|
330
778
|
|
|
331
779
|
return query;
|
|
332
780
|
}
|
|
333
781
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
782
|
+
export const useGetProjectFileWithTokenSuspenseQueryOptions = <
|
|
783
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
784
|
+
TError = ErrorType<DmError>,
|
|
785
|
+
>(
|
|
786
|
+
projectId: string,
|
|
787
|
+
params: GetProjectFileWithTokenParams,
|
|
788
|
+
options?: {
|
|
789
|
+
query?: Partial<
|
|
790
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
791
|
+
>;
|
|
792
|
+
request?: SecondParameter<typeof customInstance>;
|
|
793
|
+
},
|
|
337
794
|
) => {
|
|
795
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
796
|
+
|
|
797
|
+
const queryKey = queryOptions?.queryKey ?? getGetProjectFileWithTokenQueryKey(projectId, params);
|
|
798
|
+
|
|
799
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFileWithToken>>> = ({
|
|
800
|
+
signal,
|
|
801
|
+
}) => getProjectFileWithToken(projectId, params, requestOptions, signal);
|
|
802
|
+
|
|
803
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
804
|
+
|
|
805
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
806
|
+
Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
807
|
+
TError,
|
|
808
|
+
TData
|
|
809
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
810
|
+
};
|
|
811
|
+
|
|
812
|
+
export type GetProjectFileWithTokenSuspenseQueryResult = NonNullable<
|
|
813
|
+
Awaited<ReturnType<typeof getProjectFileWithToken>>
|
|
814
|
+
>;
|
|
815
|
+
export type GetProjectFileWithTokenSuspenseQueryError = ErrorType<DmError>;
|
|
816
|
+
|
|
817
|
+
export function useGetProjectFileWithTokenSuspense<
|
|
818
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
819
|
+
TError = ErrorType<DmError>,
|
|
820
|
+
>(
|
|
821
|
+
projectId: string,
|
|
822
|
+
params: GetProjectFileWithTokenParams,
|
|
823
|
+
options: {
|
|
824
|
+
query: Partial<
|
|
825
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
826
|
+
>;
|
|
827
|
+
request?: SecondParameter<typeof customInstance>;
|
|
828
|
+
},
|
|
829
|
+
queryClient?: QueryClient,
|
|
830
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
831
|
+
export function useGetProjectFileWithTokenSuspense<
|
|
832
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
833
|
+
TError = ErrorType<DmError>,
|
|
834
|
+
>(
|
|
835
|
+
projectId: string,
|
|
836
|
+
params: GetProjectFileWithTokenParams,
|
|
837
|
+
options?: {
|
|
838
|
+
query?: Partial<
|
|
839
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
840
|
+
>;
|
|
841
|
+
request?: SecondParameter<typeof customInstance>;
|
|
842
|
+
},
|
|
843
|
+
queryClient?: QueryClient,
|
|
844
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
845
|
+
export function useGetProjectFileWithTokenSuspense<
|
|
846
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
847
|
+
TError = ErrorType<DmError>,
|
|
848
|
+
>(
|
|
849
|
+
projectId: string,
|
|
850
|
+
params: GetProjectFileWithTokenParams,
|
|
851
|
+
options?: {
|
|
852
|
+
query?: Partial<
|
|
853
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
854
|
+
>;
|
|
855
|
+
request?: SecondParameter<typeof customInstance>;
|
|
856
|
+
},
|
|
857
|
+
queryClient?: QueryClient,
|
|
858
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
859
|
+
/**
|
|
860
|
+
* @summary Download a Project file using a Token
|
|
861
|
+
*/
|
|
338
862
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
863
|
+
export function useGetProjectFileWithTokenSuspense<
|
|
864
|
+
TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,
|
|
865
|
+
TError = ErrorType<DmError>,
|
|
866
|
+
>(
|
|
867
|
+
projectId: string,
|
|
868
|
+
params: GetProjectFileWithTokenParams,
|
|
869
|
+
options?: {
|
|
870
|
+
query?: Partial<
|
|
871
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProjectFileWithToken>>, TError, TData>
|
|
872
|
+
>;
|
|
873
|
+
request?: SecondParameter<typeof customInstance>;
|
|
874
|
+
},
|
|
875
|
+
queryClient?: QueryClient,
|
|
876
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
877
|
+
const queryOptions = useGetProjectFileWithTokenSuspenseQueryOptions(projectId, params, options);
|
|
878
|
+
|
|
879
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
880
|
+
TData,
|
|
881
|
+
TError
|
|
882
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
883
|
+
|
|
884
|
+
query.queryKey = queryOptions.queryKey;
|
|
346
885
|
|
|
347
|
-
|
|
886
|
+
return query;
|
|
887
|
+
}
|
|
348
888
|
|
|
349
|
-
|
|
889
|
+
/**
|
|
890
|
+
* Given a Project and Path the files available to you on that path will be returned along with any additional paths (sub-directories).
|
|
350
891
|
|
|
351
|
-
|
|
352
|
-
|
|
892
|
+
* @summary Gets the Files on a Project Path
|
|
893
|
+
*/
|
|
894
|
+
export const getFiles = (
|
|
895
|
+
params: GetFilesParams,
|
|
896
|
+
options?: SecondParameter<typeof customInstance>,
|
|
897
|
+
signal?: AbortSignal,
|
|
898
|
+
) => {
|
|
899
|
+
return customInstance<FilesGetResponse>({ url: `/file`, method: "GET", params, signal }, options);
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
export const getGetFilesQueryKey = (params: GetFilesParams) => {
|
|
903
|
+
return [`/file`, ...(params ? [params] : [])] as const;
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
export const useGetFilesQueryOptions = <
|
|
907
|
+
TData = Awaited<ReturnType<typeof getFiles>>,
|
|
908
|
+
TError = ErrorType<void | DmError>,
|
|
909
|
+
>(
|
|
910
|
+
params: GetFilesParams,
|
|
911
|
+
options?: {
|
|
912
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>>;
|
|
913
|
+
request?: SecondParameter<typeof customInstance>;
|
|
914
|
+
},
|
|
915
|
+
) => {
|
|
916
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
353
917
|
|
|
354
|
-
|
|
355
|
-
export type GetFilesSuspenseQueryError = ErrorType<void | DmError>
|
|
918
|
+
const queryKey = queryOptions?.queryKey ?? getGetFilesQueryKey(params);
|
|
356
919
|
|
|
920
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getFiles>>> = ({ signal }) =>
|
|
921
|
+
getFiles(params, requestOptions, signal);
|
|
357
922
|
|
|
358
|
-
|
|
359
|
-
params: GetFilesParams, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
923
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
360
924
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
925
|
+
return customOptions as UseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData> & {
|
|
926
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
927
|
+
};
|
|
928
|
+
};
|
|
364
929
|
|
|
365
|
-
|
|
366
|
-
export
|
|
367
|
-
params: GetFilesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
930
|
+
export type GetFilesQueryResult = NonNullable<Awaited<ReturnType<typeof getFiles>>>;
|
|
931
|
+
export type GetFilesQueryError = ErrorType<void | DmError>;
|
|
368
932
|
|
|
369
|
-
|
|
933
|
+
export function useGetFiles<
|
|
934
|
+
TData = Awaited<ReturnType<typeof getFiles>>,
|
|
935
|
+
TError = ErrorType<void | DmError>,
|
|
936
|
+
>(
|
|
937
|
+
params: GetFilesParams,
|
|
938
|
+
options: {
|
|
939
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>> &
|
|
940
|
+
Pick<
|
|
941
|
+
DefinedInitialDataOptions<
|
|
942
|
+
Awaited<ReturnType<typeof getFiles>>,
|
|
943
|
+
TError,
|
|
944
|
+
Awaited<ReturnType<typeof getFiles>>
|
|
945
|
+
>,
|
|
946
|
+
"initialData"
|
|
947
|
+
>;
|
|
948
|
+
request?: SecondParameter<typeof customInstance>;
|
|
949
|
+
},
|
|
950
|
+
queryClient?: QueryClient,
|
|
951
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
952
|
+
export function useGetFiles<
|
|
953
|
+
TData = Awaited<ReturnType<typeof getFiles>>,
|
|
954
|
+
TError = ErrorType<void | DmError>,
|
|
955
|
+
>(
|
|
956
|
+
params: GetFilesParams,
|
|
957
|
+
options?: {
|
|
958
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>> &
|
|
959
|
+
Pick<
|
|
960
|
+
UndefinedInitialDataOptions<
|
|
961
|
+
Awaited<ReturnType<typeof getFiles>>,
|
|
962
|
+
TError,
|
|
963
|
+
Awaited<ReturnType<typeof getFiles>>
|
|
964
|
+
>,
|
|
965
|
+
"initialData"
|
|
966
|
+
>;
|
|
967
|
+
request?: SecondParameter<typeof customInstance>;
|
|
968
|
+
},
|
|
969
|
+
queryClient?: QueryClient,
|
|
970
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
971
|
+
export function useGetFiles<
|
|
972
|
+
TData = Awaited<ReturnType<typeof getFiles>>,
|
|
973
|
+
TError = ErrorType<void | DmError>,
|
|
974
|
+
>(
|
|
975
|
+
params: GetFilesParams,
|
|
976
|
+
options?: {
|
|
977
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>>;
|
|
978
|
+
request?: SecondParameter<typeof customInstance>;
|
|
979
|
+
},
|
|
980
|
+
queryClient?: QueryClient,
|
|
981
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
370
982
|
/**
|
|
371
983
|
* @summary Gets the Files on a Project Path
|
|
372
984
|
*/
|
|
373
985
|
|
|
374
|
-
export function
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
986
|
+
export function useGetFiles<
|
|
987
|
+
TData = Awaited<ReturnType<typeof getFiles>>,
|
|
988
|
+
TError = ErrorType<void | DmError>,
|
|
989
|
+
>(
|
|
990
|
+
params: GetFilesParams,
|
|
991
|
+
options?: {
|
|
992
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>>;
|
|
993
|
+
request?: SecondParameter<typeof customInstance>;
|
|
994
|
+
},
|
|
995
|
+
queryClient?: QueryClient,
|
|
996
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
997
|
+
const queryOptions = useGetFilesQueryOptions(params, options);
|
|
998
|
+
|
|
999
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
1000
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
1001
|
+
};
|
|
1002
|
+
|
|
1003
|
+
query.queryKey = queryOptions.queryKey;
|
|
378
1004
|
|
|
379
|
-
|
|
1005
|
+
return query;
|
|
1006
|
+
}
|
|
380
1007
|
|
|
381
|
-
|
|
1008
|
+
export const useGetFilesSuspenseQueryOptions = <
|
|
1009
|
+
TData = Awaited<ReturnType<typeof getFiles>>,
|
|
1010
|
+
TError = ErrorType<void | DmError>,
|
|
1011
|
+
>(
|
|
1012
|
+
params: GetFilesParams,
|
|
1013
|
+
options?: {
|
|
1014
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>>;
|
|
1015
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1016
|
+
},
|
|
1017
|
+
) => {
|
|
1018
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
1019
|
+
|
|
1020
|
+
const queryKey = queryOptions?.queryKey ?? getGetFilesQueryKey(params);
|
|
1021
|
+
|
|
1022
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getFiles>>> = ({ signal }) =>
|
|
1023
|
+
getFiles(params, requestOptions, signal);
|
|
1024
|
+
|
|
1025
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
1026
|
+
|
|
1027
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
1028
|
+
Awaited<ReturnType<typeof getFiles>>,
|
|
1029
|
+
TError,
|
|
1030
|
+
TData
|
|
1031
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1032
|
+
};
|
|
1033
|
+
|
|
1034
|
+
export type GetFilesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getFiles>>>;
|
|
1035
|
+
export type GetFilesSuspenseQueryError = ErrorType<void | DmError>;
|
|
1036
|
+
|
|
1037
|
+
export function useGetFilesSuspense<
|
|
1038
|
+
TData = Awaited<ReturnType<typeof getFiles>>,
|
|
1039
|
+
TError = ErrorType<void | DmError>,
|
|
1040
|
+
>(
|
|
1041
|
+
params: GetFilesParams,
|
|
1042
|
+
options: {
|
|
1043
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>>;
|
|
1044
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1045
|
+
},
|
|
1046
|
+
queryClient?: QueryClient,
|
|
1047
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1048
|
+
export function useGetFilesSuspense<
|
|
1049
|
+
TData = Awaited<ReturnType<typeof getFiles>>,
|
|
1050
|
+
TError = ErrorType<void | DmError>,
|
|
1051
|
+
>(
|
|
1052
|
+
params: GetFilesParams,
|
|
1053
|
+
options?: {
|
|
1054
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>>;
|
|
1055
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1056
|
+
},
|
|
1057
|
+
queryClient?: QueryClient,
|
|
1058
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1059
|
+
export function useGetFilesSuspense<
|
|
1060
|
+
TData = Awaited<ReturnType<typeof getFiles>>,
|
|
1061
|
+
TError = ErrorType<void | DmError>,
|
|
1062
|
+
>(
|
|
1063
|
+
params: GetFilesParams,
|
|
1064
|
+
options?: {
|
|
1065
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>>;
|
|
1066
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1067
|
+
},
|
|
1068
|
+
queryClient?: QueryClient,
|
|
1069
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1070
|
+
/**
|
|
1071
|
+
* @summary Gets the Files on a Project Path
|
|
1072
|
+
*/
|
|
382
1073
|
|
|
383
|
-
|
|
1074
|
+
export function useGetFilesSuspense<
|
|
1075
|
+
TData = Awaited<ReturnType<typeof getFiles>>,
|
|
1076
|
+
TError = ErrorType<void | DmError>,
|
|
1077
|
+
>(
|
|
1078
|
+
params: GetFilesParams,
|
|
1079
|
+
options?: {
|
|
1080
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>>;
|
|
1081
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1082
|
+
},
|
|
1083
|
+
queryClient?: QueryClient,
|
|
1084
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
1085
|
+
const queryOptions = useGetFilesSuspenseQueryOptions(params, options);
|
|
1086
|
+
|
|
1087
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
1088
|
+
TData,
|
|
1089
|
+
TError
|
|
1090
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1091
|
+
|
|
1092
|
+
query.queryKey = queryOptions.queryKey;
|
|
384
1093
|
|
|
385
1094
|
return query;
|
|
386
1095
|
}
|
|
387
1096
|
|
|
388
|
-
|
|
389
|
-
|
|
390
1097
|
/**
|
|
391
1098
|
* Given a Project and a Dataset the Dataset will be attached (added) to the project as a File using the format provided. When attached the Dataset is referred to as a Project **File**. As format conversion may take some time the file may not be immediately available. You should use the `task_id` you're presented with on the `/task` endpoint to determine when the file is available to the project.
|
|
392
1099
|
|
|
@@ -401,80 +1108,104 @@ You cannot add a Dataset to a Project until its upload is complete.
|
|
|
401
1108
|
* @summary Attach a Dataset, as a File, to a Project
|
|
402
1109
|
*/
|
|
403
1110
|
export const attachFile = (
|
|
404
|
-
|
|
405
|
-
|
|
1111
|
+
filePostBodyBody: FilePostBodyBody,
|
|
1112
|
+
options?: SecondParameter<typeof customInstance>,
|
|
1113
|
+
signal?: AbortSignal,
|
|
406
1114
|
) => {
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
formUrlEncoded.append(
|
|
410
|
-
formUrlEncoded.append(
|
|
411
|
-
formUrlEncoded.append(
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
1115
|
+
const formUrlEncoded = new URLSearchParams();
|
|
1116
|
+
formUrlEncoded.append(`dataset_id`, filePostBodyBody.dataset_id);
|
|
1117
|
+
formUrlEncoded.append(`dataset_version`, filePostBodyBody.dataset_version.toString());
|
|
1118
|
+
formUrlEncoded.append(`project_id`, filePostBodyBody.project_id);
|
|
1119
|
+
formUrlEncoded.append(`as_type`, filePostBodyBody.as_type);
|
|
1120
|
+
if (filePostBodyBody.path !== undefined) {
|
|
1121
|
+
formUrlEncoded.append(`path`, filePostBodyBody.path);
|
|
1122
|
+
}
|
|
1123
|
+
if (filePostBodyBody.compress !== undefined) {
|
|
1124
|
+
formUrlEncoded.append(`compress`, filePostBodyBody.compress.toString());
|
|
1125
|
+
}
|
|
1126
|
+
if (filePostBodyBody.immutable !== undefined) {
|
|
1127
|
+
formUrlEncoded.append(`immutable`, filePostBodyBody.immutable.toString());
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
return customInstance<FilePostResponse>(
|
|
1131
|
+
{
|
|
1132
|
+
url: `/file`,
|
|
1133
|
+
method: "POST",
|
|
1134
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
1135
|
+
data: formUrlEncoded,
|
|
1136
|
+
signal,
|
|
427
1137
|
},
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
1138
|
+
options,
|
|
1139
|
+
);
|
|
1140
|
+
};
|
|
1141
|
+
|
|
1142
|
+
export const useAttachFileMutationOptions = <
|
|
1143
|
+
TError = ErrorType<void | DmError>,
|
|
1144
|
+
TContext = unknown,
|
|
1145
|
+
>(options?: {
|
|
1146
|
+
mutation?: UseMutationOptions<
|
|
1147
|
+
Awaited<ReturnType<typeof attachFile>>,
|
|
1148
|
+
TError,
|
|
1149
|
+
{ data: FilePostBodyBody },
|
|
1150
|
+
TContext
|
|
1151
|
+
>;
|
|
1152
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1153
|
+
}): UseMutationOptions<
|
|
1154
|
+
Awaited<ReturnType<typeof attachFile>>,
|
|
1155
|
+
TError,
|
|
1156
|
+
{ data: FilePostBodyBody },
|
|
1157
|
+
TContext
|
|
1158
|
+
> => {
|
|
1159
|
+
const mutationKey = ["attachFile"];
|
|
1160
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
1161
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
1162
|
+
? options
|
|
1163
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1164
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
1165
|
+
|
|
1166
|
+
const mutationFn: MutationFunction<
|
|
1167
|
+
Awaited<ReturnType<typeof attachFile>>,
|
|
1168
|
+
{ data: FilePostBodyBody }
|
|
1169
|
+
> = (props) => {
|
|
1170
|
+
const { data } = props ?? {};
|
|
1171
|
+
|
|
1172
|
+
return attachFile(data, requestOptions);
|
|
1173
|
+
};
|
|
1174
|
+
|
|
1175
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
1176
|
+
|
|
1177
|
+
return customOptions;
|
|
1178
|
+
};
|
|
1179
|
+
|
|
1180
|
+
export type AttachFileMutationResult = NonNullable<Awaited<ReturnType<typeof attachFile>>>;
|
|
1181
|
+
export type AttachFileMutationBody = FilePostBodyBody;
|
|
1182
|
+
export type AttachFileMutationError = ErrorType<void | DmError>;
|
|
444
1183
|
|
|
445
|
-
|
|
446
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof attachFile>>, {data: FilePostBodyBody}> = (props) => {
|
|
447
|
-
const {data} = props ?? {};
|
|
448
|
-
|
|
449
|
-
return attachFile(data,requestOptions)
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{data: FilePostBodyBody}, TContext>}
|
|
456
|
-
|
|
457
|
-
export type AttachFileMutationResult = NonNullable<Awaited<ReturnType<typeof attachFile>>>
|
|
458
|
-
export type AttachFileMutationBody = FilePostBodyBody
|
|
459
|
-
export type AttachFileMutationError = ErrorType<void | DmError>
|
|
460
|
-
|
|
461
|
-
/**
|
|
1184
|
+
/**
|
|
462
1185
|
* @summary Attach a Dataset, as a File, to a Project
|
|
463
1186
|
*/
|
|
464
|
-
export const useAttachFile = <
|
|
465
|
-
|
|
1187
|
+
export const useAttachFile = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
1188
|
+
options?: {
|
|
1189
|
+
mutation?: UseMutationOptions<
|
|
1190
|
+
Awaited<ReturnType<typeof attachFile>>,
|
|
1191
|
+
TError,
|
|
1192
|
+
{ data: FilePostBodyBody },
|
|
1193
|
+
TContext
|
|
1194
|
+
>;
|
|
1195
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1196
|
+
},
|
|
1197
|
+
queryClient?: QueryClient,
|
|
466
1198
|
): UseMutationResult<
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
/**
|
|
1199
|
+
Awaited<ReturnType<typeof attachFile>>,
|
|
1200
|
+
TError,
|
|
1201
|
+
{ data: FilePostBodyBody },
|
|
1202
|
+
TContext
|
|
1203
|
+
> => {
|
|
1204
|
+
const mutationOptions = useAttachFileMutationOptions(options);
|
|
1205
|
+
|
|
1206
|
+
return useMutation(mutationOptions, queryClient);
|
|
1207
|
+
};
|
|
1208
|
+
/**
|
|
478
1209
|
* Removes an unmanaged file from a Project. You cannot use this endpoint to delete managed project files.
|
|
479
1210
|
|
|
480
1211
|
You must be an `editor` of the Project to delete a file from a Project.
|
|
@@ -482,64 +1213,81 @@ You must be an `editor` of the Project to delete a file from a Project.
|
|
|
482
1213
|
* @summary Delete an unmanaged Project File
|
|
483
1214
|
*/
|
|
484
1215
|
export const deleteUnmanagedFile = (
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
return customInstance<void>(
|
|
490
|
-
{url: `/file`, method: 'DELETE',
|
|
491
|
-
params
|
|
492
|
-
},
|
|
493
|
-
options);
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
export const getDeleteUnmanagedFileMutationOptions = <TData = Awaited<ReturnType<typeof deleteUnmanagedFile>>, TError = ErrorType<void | DmError>,
|
|
499
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{params: DeleteUnmanagedFileParams}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
1216
|
+
params: DeleteUnmanagedFileParams,
|
|
1217
|
+
options?: SecondParameter<typeof customInstance>,
|
|
500
1218
|
) => {
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
1219
|
+
return customInstance<void>({ url: `/file`, method: "DELETE", params }, options);
|
|
1220
|
+
};
|
|
1221
|
+
|
|
1222
|
+
export const useDeleteUnmanagedFileMutationOptions = <
|
|
1223
|
+
TError = ErrorType<void | DmError>,
|
|
1224
|
+
TContext = unknown,
|
|
1225
|
+
>(options?: {
|
|
1226
|
+
mutation?: UseMutationOptions<
|
|
1227
|
+
Awaited<ReturnType<typeof deleteUnmanagedFile>>,
|
|
1228
|
+
TError,
|
|
1229
|
+
{ params: DeleteUnmanagedFileParams },
|
|
1230
|
+
TContext
|
|
1231
|
+
>;
|
|
1232
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1233
|
+
}): UseMutationOptions<
|
|
1234
|
+
Awaited<ReturnType<typeof deleteUnmanagedFile>>,
|
|
1235
|
+
TError,
|
|
1236
|
+
{ params: DeleteUnmanagedFileParams },
|
|
1237
|
+
TContext
|
|
1238
|
+
> => {
|
|
1239
|
+
const mutationKey = ["deleteUnmanagedFile"];
|
|
1240
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
1241
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
1242
|
+
? options
|
|
1243
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1244
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
1245
|
+
|
|
1246
|
+
const mutationFn: MutationFunction<
|
|
1247
|
+
Awaited<ReturnType<typeof deleteUnmanagedFile>>,
|
|
1248
|
+
{ params: DeleteUnmanagedFileParams }
|
|
1249
|
+
> = (props) => {
|
|
1250
|
+
const { params } = props ?? {};
|
|
1251
|
+
|
|
1252
|
+
return deleteUnmanagedFile(params, requestOptions);
|
|
1253
|
+
};
|
|
1254
|
+
|
|
1255
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
1256
|
+
|
|
1257
|
+
return customOptions;
|
|
1258
|
+
};
|
|
1259
|
+
|
|
1260
|
+
export type DeleteUnmanagedFileMutationResult = NonNullable<
|
|
1261
|
+
Awaited<ReturnType<typeof deleteUnmanagedFile>>
|
|
1262
|
+
>;
|
|
1263
|
+
|
|
1264
|
+
export type DeleteUnmanagedFileMutationError = ErrorType<void | DmError>;
|
|
507
1265
|
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteUnmanagedFile>>, {params: DeleteUnmanagedFileParams}> = (props) => {
|
|
512
|
-
const {params} = props ?? {};
|
|
513
|
-
|
|
514
|
-
return deleteUnmanagedFile(params,requestOptions)
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{params: DeleteUnmanagedFileParams}, TContext>}
|
|
521
|
-
|
|
522
|
-
export type DeleteUnmanagedFileMutationResult = NonNullable<Awaited<ReturnType<typeof deleteUnmanagedFile>>>
|
|
523
|
-
|
|
524
|
-
export type DeleteUnmanagedFileMutationError = ErrorType<void | DmError>
|
|
525
|
-
|
|
526
|
-
/**
|
|
1266
|
+
/**
|
|
527
1267
|
* @summary Delete an unmanaged Project File
|
|
528
1268
|
*/
|
|
529
|
-
export const useDeleteUnmanagedFile = <
|
|
530
|
-
|
|
1269
|
+
export const useDeleteUnmanagedFile = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
1270
|
+
options?: {
|
|
1271
|
+
mutation?: UseMutationOptions<
|
|
1272
|
+
Awaited<ReturnType<typeof deleteUnmanagedFile>>,
|
|
1273
|
+
TError,
|
|
1274
|
+
{ params: DeleteUnmanagedFileParams },
|
|
1275
|
+
TContext
|
|
1276
|
+
>;
|
|
1277
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1278
|
+
},
|
|
1279
|
+
queryClient?: QueryClient,
|
|
531
1280
|
): UseMutationResult<
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
/**
|
|
1281
|
+
Awaited<ReturnType<typeof deleteUnmanagedFile>>,
|
|
1282
|
+
TError,
|
|
1283
|
+
{ params: DeleteUnmanagedFileParams },
|
|
1284
|
+
TContext
|
|
1285
|
+
> => {
|
|
1286
|
+
const mutationOptions = useDeleteUnmanagedFileMutationOptions(options);
|
|
1287
|
+
|
|
1288
|
+
return useMutation(mutationOptions, queryClient);
|
|
1289
|
+
};
|
|
1290
|
+
/**
|
|
543
1291
|
* Move an **Unmanaged** file, optionally renaming it, to a new path.
|
|
544
1292
|
|
|
545
1293
|
You must be an `editor` of the project
|
|
@@ -547,64 +1295,81 @@ You must be an `editor` of the project
|
|
|
547
1295
|
* @summary Move an unmanaged file in a Project
|
|
548
1296
|
*/
|
|
549
1297
|
export const moveFileInProject = (
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
return customInstance<void>(
|
|
555
|
-
{url: `/file/move`, method: 'PUT',
|
|
556
|
-
params
|
|
557
|
-
},
|
|
558
|
-
options);
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
export const getMoveFileInProjectMutationOptions = <TData = Awaited<ReturnType<typeof moveFileInProject>>, TError = ErrorType<void | DmError>,
|
|
564
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{params: MoveFileInProjectParams}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
1298
|
+
params: MoveFileInProjectParams,
|
|
1299
|
+
options?: SecondParameter<typeof customInstance>,
|
|
565
1300
|
) => {
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
1301
|
+
return customInstance<void>({ url: `/file/move`, method: "PUT", params }, options);
|
|
1302
|
+
};
|
|
1303
|
+
|
|
1304
|
+
export const useMoveFileInProjectMutationOptions = <
|
|
1305
|
+
TError = ErrorType<void | DmError>,
|
|
1306
|
+
TContext = unknown,
|
|
1307
|
+
>(options?: {
|
|
1308
|
+
mutation?: UseMutationOptions<
|
|
1309
|
+
Awaited<ReturnType<typeof moveFileInProject>>,
|
|
1310
|
+
TError,
|
|
1311
|
+
{ params: MoveFileInProjectParams },
|
|
1312
|
+
TContext
|
|
1313
|
+
>;
|
|
1314
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1315
|
+
}): UseMutationOptions<
|
|
1316
|
+
Awaited<ReturnType<typeof moveFileInProject>>,
|
|
1317
|
+
TError,
|
|
1318
|
+
{ params: MoveFileInProjectParams },
|
|
1319
|
+
TContext
|
|
1320
|
+
> => {
|
|
1321
|
+
const mutationKey = ["moveFileInProject"];
|
|
1322
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
1323
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
1324
|
+
? options
|
|
1325
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1326
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
1327
|
+
|
|
1328
|
+
const mutationFn: MutationFunction<
|
|
1329
|
+
Awaited<ReturnType<typeof moveFileInProject>>,
|
|
1330
|
+
{ params: MoveFileInProjectParams }
|
|
1331
|
+
> = (props) => {
|
|
1332
|
+
const { params } = props ?? {};
|
|
1333
|
+
|
|
1334
|
+
return moveFileInProject(params, requestOptions);
|
|
1335
|
+
};
|
|
1336
|
+
|
|
1337
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
1338
|
+
|
|
1339
|
+
return customOptions;
|
|
1340
|
+
};
|
|
1341
|
+
|
|
1342
|
+
export type MoveFileInProjectMutationResult = NonNullable<
|
|
1343
|
+
Awaited<ReturnType<typeof moveFileInProject>>
|
|
1344
|
+
>;
|
|
1345
|
+
|
|
1346
|
+
export type MoveFileInProjectMutationError = ErrorType<void | DmError>;
|
|
584
1347
|
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
export type MoveFileInProjectMutationResult = NonNullable<Awaited<ReturnType<typeof moveFileInProject>>>
|
|
588
|
-
|
|
589
|
-
export type MoveFileInProjectMutationError = ErrorType<void | DmError>
|
|
590
|
-
|
|
591
|
-
/**
|
|
1348
|
+
/**
|
|
592
1349
|
* @summary Move an unmanaged file in a Project
|
|
593
1350
|
*/
|
|
594
|
-
export const useMoveFileInProject = <
|
|
595
|
-
|
|
1351
|
+
export const useMoveFileInProject = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
1352
|
+
options?: {
|
|
1353
|
+
mutation?: UseMutationOptions<
|
|
1354
|
+
Awaited<ReturnType<typeof moveFileInProject>>,
|
|
1355
|
+
TError,
|
|
1356
|
+
{ params: MoveFileInProjectParams },
|
|
1357
|
+
TContext
|
|
1358
|
+
>;
|
|
1359
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1360
|
+
},
|
|
1361
|
+
queryClient?: QueryClient,
|
|
596
1362
|
): UseMutationResult<
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
/**
|
|
1363
|
+
Awaited<ReturnType<typeof moveFileInProject>>,
|
|
1364
|
+
TError,
|
|
1365
|
+
{ params: MoveFileInProjectParams },
|
|
1366
|
+
TContext
|
|
1367
|
+
> => {
|
|
1368
|
+
const mutationOptions = useMoveFileInProjectMutationOptions(options);
|
|
1369
|
+
|
|
1370
|
+
return useMutation(mutationOptions, queryClient);
|
|
1371
|
+
};
|
|
1372
|
+
/**
|
|
608
1373
|
* Given a `file_id` the file will be removed from the Project it's attached to.
|
|
609
1374
|
|
|
610
1375
|
You must be an `editor` of the project to delete a file from a Project. Being an `editor` of the original Dataset does not give you the ability to detach it from the Project.
|
|
@@ -613,64 +1378,76 @@ You cannot delete a Project File until the attach is complete.
|
|
|
613
1378
|
|
|
614
1379
|
* @summary Delete/detach a File (from a Project)
|
|
615
1380
|
*/
|
|
616
|
-
export const deleteFile = (
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
)
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
1381
|
+
export const deleteFile = (fileId: string, options?: SecondParameter<typeof customInstance>) => {
|
|
1382
|
+
return customInstance<void>({ url: `/file/${fileId}`, method: "DELETE" }, options);
|
|
1383
|
+
};
|
|
1384
|
+
|
|
1385
|
+
export const useDeleteFileMutationOptions = <
|
|
1386
|
+
TError = ErrorType<void | DmError>,
|
|
1387
|
+
TContext = unknown,
|
|
1388
|
+
>(options?: {
|
|
1389
|
+
mutation?: UseMutationOptions<
|
|
1390
|
+
Awaited<ReturnType<typeof deleteFile>>,
|
|
1391
|
+
TError,
|
|
1392
|
+
{ fileId: string },
|
|
1393
|
+
TContext
|
|
1394
|
+
>;
|
|
1395
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1396
|
+
}): UseMutationOptions<
|
|
1397
|
+
Awaited<ReturnType<typeof deleteFile>>,
|
|
1398
|
+
TError,
|
|
1399
|
+
{ fileId: string },
|
|
1400
|
+
TContext
|
|
1401
|
+
> => {
|
|
1402
|
+
const mutationKey = ["deleteFile"];
|
|
1403
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
1404
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
1405
|
+
? options
|
|
1406
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1407
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
1408
|
+
|
|
1409
|
+
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteFile>>, { fileId: string }> = (
|
|
1410
|
+
props,
|
|
1411
|
+
) => {
|
|
1412
|
+
const { fileId } = props ?? {};
|
|
1413
|
+
|
|
1414
|
+
return deleteFile(fileId, requestOptions);
|
|
1415
|
+
};
|
|
1416
|
+
|
|
1417
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
1418
|
+
|
|
1419
|
+
return customOptions;
|
|
1420
|
+
};
|
|
1421
|
+
|
|
1422
|
+
export type DeleteFileMutationResult = NonNullable<Awaited<ReturnType<typeof deleteFile>>>;
|
|
1423
|
+
|
|
1424
|
+
export type DeleteFileMutationError = ErrorType<void | DmError>;
|
|
644
1425
|
|
|
645
|
-
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{fileId: string}, TContext>}
|
|
652
|
-
|
|
653
|
-
export type DeleteFileMutationResult = NonNullable<Awaited<ReturnType<typeof deleteFile>>>
|
|
654
|
-
|
|
655
|
-
export type DeleteFileMutationError = ErrorType<void | DmError>
|
|
656
|
-
|
|
657
|
-
/**
|
|
1426
|
+
/**
|
|
658
1427
|
* @summary Delete/detach a File (from a Project)
|
|
659
1428
|
*/
|
|
660
|
-
export const useDeleteFile = <
|
|
661
|
-
|
|
1429
|
+
export const useDeleteFile = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
1430
|
+
options?: {
|
|
1431
|
+
mutation?: UseMutationOptions<
|
|
1432
|
+
Awaited<ReturnType<typeof deleteFile>>,
|
|
1433
|
+
TError,
|
|
1434
|
+
{ fileId: string },
|
|
1435
|
+
TContext
|
|
1436
|
+
>;
|
|
1437
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1438
|
+
},
|
|
1439
|
+
queryClient?: QueryClient,
|
|
662
1440
|
): UseMutationResult<
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
/**
|
|
1441
|
+
Awaited<ReturnType<typeof deleteFile>>,
|
|
1442
|
+
TError,
|
|
1443
|
+
{ fileId: string },
|
|
1444
|
+
TContext
|
|
1445
|
+
> => {
|
|
1446
|
+
const mutationOptions = useDeleteFileMutationOptions(options);
|
|
1447
|
+
|
|
1448
|
+
return useMutation(mutationOptions, queryClient);
|
|
1449
|
+
};
|
|
1450
|
+
/**
|
|
674
1451
|
* Given a `file_id` the file will be returned if available.
|
|
675
1452
|
|
|
676
1453
|
You cannot get a Project File until the attach is complete.
|
|
@@ -678,140 +1455,216 @@ You cannot get a Project File until the attach is complete.
|
|
|
678
1455
|
* @summary Download a File (from a project)
|
|
679
1456
|
*/
|
|
680
1457
|
export const downloadFile = (
|
|
681
|
-
|
|
682
|
-
|
|
1458
|
+
fileId: string,
|
|
1459
|
+
options?: SecondParameter<typeof customInstance>,
|
|
1460
|
+
signal?: AbortSignal,
|
|
683
1461
|
) => {
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
1462
|
+
return customInstance<void>({ url: `/file/${fileId}`, method: "GET", signal }, options);
|
|
1463
|
+
};
|
|
1464
|
+
|
|
1465
|
+
export const getDownloadFileQueryKey = (fileId: string) => {
|
|
1466
|
+
return [`/file/${fileId}`] as const;
|
|
1467
|
+
};
|
|
1468
|
+
|
|
1469
|
+
export const useDownloadFileQueryOptions = <
|
|
1470
|
+
TData = Awaited<ReturnType<typeof downloadFile>>,
|
|
1471
|
+
TError = ErrorType<void | DmError>,
|
|
1472
|
+
>(
|
|
1473
|
+
fileId: string,
|
|
1474
|
+
options?: {
|
|
1475
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData>>;
|
|
1476
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1477
|
+
},
|
|
699
1478
|
) => {
|
|
1479
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
700
1480
|
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
const queryKey = queryOptions?.queryKey ?? getDownloadFileQueryKey(fileId);
|
|
1481
|
+
const queryKey = queryOptions?.queryKey ?? getDownloadFileQueryKey(fileId);
|
|
704
1482
|
|
|
705
|
-
|
|
1483
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadFile>>> = ({ signal }) =>
|
|
1484
|
+
downloadFile(fileId, requestOptions, signal);
|
|
706
1485
|
|
|
707
|
-
|
|
1486
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
708
1487
|
|
|
709
|
-
|
|
1488
|
+
return customOptions as UseQueryOptions<
|
|
1489
|
+
Awaited<ReturnType<typeof downloadFile>>,
|
|
1490
|
+
TError,
|
|
1491
|
+
TData
|
|
1492
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1493
|
+
};
|
|
710
1494
|
|
|
711
|
-
|
|
1495
|
+
export type DownloadFileQueryResult = NonNullable<Awaited<ReturnType<typeof downloadFile>>>;
|
|
1496
|
+
export type DownloadFileQueryError = ErrorType<void | DmError>;
|
|
712
1497
|
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
fileId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData>> & Pick<
|
|
1498
|
+
export function useDownloadFile<
|
|
1499
|
+
TData = Awaited<ReturnType<typeof downloadFile>>,
|
|
1500
|
+
TError = ErrorType<void | DmError>,
|
|
1501
|
+
>(
|
|
1502
|
+
fileId: string,
|
|
1503
|
+
options: {
|
|
1504
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData>> &
|
|
1505
|
+
Pick<
|
|
722
1506
|
DefinedInitialDataOptions<
|
|
723
1507
|
Awaited<ReturnType<typeof downloadFile>>,
|
|
724
1508
|
TError,
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
1509
|
+
Awaited<ReturnType<typeof downloadFile>>
|
|
1510
|
+
>,
|
|
1511
|
+
"initialData"
|
|
1512
|
+
>;
|
|
1513
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1514
|
+
},
|
|
1515
|
+
queryClient?: QueryClient,
|
|
1516
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1517
|
+
export function useDownloadFile<
|
|
1518
|
+
TData = Awaited<ReturnType<typeof downloadFile>>,
|
|
1519
|
+
TError = ErrorType<void | DmError>,
|
|
1520
|
+
>(
|
|
1521
|
+
fileId: string,
|
|
1522
|
+
options?: {
|
|
1523
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData>> &
|
|
1524
|
+
Pick<
|
|
732
1525
|
UndefinedInitialDataOptions<
|
|
733
1526
|
Awaited<ReturnType<typeof downloadFile>>,
|
|
734
1527
|
TError,
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
1528
|
+
Awaited<ReturnType<typeof downloadFile>>
|
|
1529
|
+
>,
|
|
1530
|
+
"initialData"
|
|
1531
|
+
>;
|
|
1532
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1533
|
+
},
|
|
1534
|
+
queryClient?: QueryClient,
|
|
1535
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1536
|
+
export function useDownloadFile<
|
|
1537
|
+
TData = Awaited<ReturnType<typeof downloadFile>>,
|
|
1538
|
+
TError = ErrorType<void | DmError>,
|
|
1539
|
+
>(
|
|
1540
|
+
fileId: string,
|
|
1541
|
+
options?: {
|
|
1542
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData>>;
|
|
1543
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1544
|
+
},
|
|
1545
|
+
queryClient?: QueryClient,
|
|
1546
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
744
1547
|
/**
|
|
745
1548
|
* @summary Download a File (from a project)
|
|
746
1549
|
*/
|
|
747
1550
|
|
|
748
|
-
export function useDownloadFile<
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
1551
|
+
export function useDownloadFile<
|
|
1552
|
+
TData = Awaited<ReturnType<typeof downloadFile>>,
|
|
1553
|
+
TError = ErrorType<void | DmError>,
|
|
1554
|
+
>(
|
|
1555
|
+
fileId: string,
|
|
1556
|
+
options?: {
|
|
1557
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData>>;
|
|
1558
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1559
|
+
},
|
|
1560
|
+
queryClient?: QueryClient,
|
|
1561
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
1562
|
+
const queryOptions = useDownloadFileQueryOptions(fileId, options);
|
|
1563
|
+
|
|
1564
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
1565
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
1566
|
+
};
|
|
1567
|
+
|
|
1568
|
+
query.queryKey = queryOptions.queryKey;
|
|
758
1569
|
|
|
759
1570
|
return query;
|
|
760
1571
|
}
|
|
761
1572
|
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
1573
|
+
export const useDownloadFileSuspenseQueryOptions = <
|
|
1574
|
+
TData = Awaited<ReturnType<typeof downloadFile>>,
|
|
1575
|
+
TError = ErrorType<void | DmError>,
|
|
1576
|
+
>(
|
|
1577
|
+
fileId: string,
|
|
1578
|
+
options?: {
|
|
1579
|
+
query?: Partial<
|
|
1580
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData>
|
|
1581
|
+
>;
|
|
1582
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1583
|
+
},
|
|
765
1584
|
) => {
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
export type DownloadFileSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof downloadFile
|
|
783
|
-
export type DownloadFileSuspenseQueryError = ErrorType<void | DmError
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
1585
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
1586
|
+
|
|
1587
|
+
const queryKey = queryOptions?.queryKey ?? getDownloadFileQueryKey(fileId);
|
|
1588
|
+
|
|
1589
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadFile>>> = ({ signal }) =>
|
|
1590
|
+
downloadFile(fileId, requestOptions, signal);
|
|
1591
|
+
|
|
1592
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
1593
|
+
|
|
1594
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
1595
|
+
Awaited<ReturnType<typeof downloadFile>>,
|
|
1596
|
+
TError,
|
|
1597
|
+
TData
|
|
1598
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1599
|
+
};
|
|
1600
|
+
|
|
1601
|
+
export type DownloadFileSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof downloadFile>>>;
|
|
1602
|
+
export type DownloadFileSuspenseQueryError = ErrorType<void | DmError>;
|
|
1603
|
+
|
|
1604
|
+
export function useDownloadFileSuspense<
|
|
1605
|
+
TData = Awaited<ReturnType<typeof downloadFile>>,
|
|
1606
|
+
TError = ErrorType<void | DmError>,
|
|
1607
|
+
>(
|
|
1608
|
+
fileId: string,
|
|
1609
|
+
options: {
|
|
1610
|
+
query: Partial<
|
|
1611
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData>
|
|
1612
|
+
>;
|
|
1613
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1614
|
+
},
|
|
1615
|
+
queryClient?: QueryClient,
|
|
1616
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1617
|
+
export function useDownloadFileSuspense<
|
|
1618
|
+
TData = Awaited<ReturnType<typeof downloadFile>>,
|
|
1619
|
+
TError = ErrorType<void | DmError>,
|
|
1620
|
+
>(
|
|
1621
|
+
fileId: string,
|
|
1622
|
+
options?: {
|
|
1623
|
+
query?: Partial<
|
|
1624
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData>
|
|
1625
|
+
>;
|
|
1626
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1627
|
+
},
|
|
1628
|
+
queryClient?: QueryClient,
|
|
1629
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1630
|
+
export function useDownloadFileSuspense<
|
|
1631
|
+
TData = Awaited<ReturnType<typeof downloadFile>>,
|
|
1632
|
+
TError = ErrorType<void | DmError>,
|
|
1633
|
+
>(
|
|
1634
|
+
fileId: string,
|
|
1635
|
+
options?: {
|
|
1636
|
+
query?: Partial<
|
|
1637
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData>
|
|
1638
|
+
>;
|
|
1639
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1640
|
+
},
|
|
1641
|
+
queryClient?: QueryClient,
|
|
1642
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
798
1643
|
/**
|
|
799
1644
|
* @summary Download a File (from a project)
|
|
800
1645
|
*/
|
|
801
1646
|
|
|
802
|
-
export function useDownloadFileSuspense<
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
1647
|
+
export function useDownloadFileSuspense<
|
|
1648
|
+
TData = Awaited<ReturnType<typeof downloadFile>>,
|
|
1649
|
+
TError = ErrorType<void | DmError>,
|
|
1650
|
+
>(
|
|
1651
|
+
fileId: string,
|
|
1652
|
+
options?: {
|
|
1653
|
+
query?: Partial<
|
|
1654
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData>
|
|
1655
|
+
>;
|
|
1656
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1657
|
+
},
|
|
1658
|
+
queryClient?: QueryClient,
|
|
1659
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
1660
|
+
const queryOptions = useDownloadFileSuspenseQueryOptions(fileId, options);
|
|
1661
|
+
|
|
1662
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
1663
|
+
TData,
|
|
1664
|
+
TError
|
|
1665
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
1666
|
+
|
|
1667
|
+
query.queryKey = queryOptions.queryKey;
|
|
812
1668
|
|
|
813
1669
|
return query;
|
|
814
1670
|
}
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|