@squonk/data-manager-client 1.2.8 → 2.0.0-alpha.1

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.
Files changed (122) hide show
  1. package/README.md +1 -1
  2. package/accounting/accounting.cjs +51 -8
  3. package/accounting/accounting.cjs.map +1 -1
  4. package/accounting/accounting.d.cts +61 -10
  5. package/accounting/accounting.d.ts +61 -10
  6. package/accounting/accounting.js +49 -6
  7. package/accounting/accounting.js.map +1 -1
  8. package/admin/admin.cjs +67 -24
  9. package/admin/admin.cjs.map +1 -1
  10. package/admin/admin.d.cts +75 -24
  11. package/admin/admin.d.ts +75 -24
  12. package/admin/admin.js +56 -13
  13. package/admin/admin.js.map +1 -1
  14. package/application/application.cjs +35 -6
  15. package/application/application.cjs.map +1 -1
  16. package/application/application.d.cts +42 -8
  17. package/application/application.d.ts +42 -8
  18. package/application/application.js +34 -5
  19. package/application/application.js.map +1 -1
  20. package/{chunk-UKA7G3OB.js → chunk-EBOQPVLG.js} +2 -2
  21. package/{chunk-UKA7G3OB.js.map → chunk-EBOQPVLG.js.map} +1 -1
  22. package/{chunk-J22A7LHX.cjs → chunk-TKLTUR4R.cjs} +2 -2
  23. package/chunk-TKLTUR4R.cjs.map +1 -0
  24. package/configuration/configuration.cjs +19 -4
  25. package/configuration/configuration.cjs.map +1 -1
  26. package/configuration/configuration.d.cts +23 -6
  27. package/configuration/configuration.d.ts +23 -6
  28. package/configuration/configuration.js +19 -4
  29. package/configuration/configuration.js.map +1 -1
  30. package/dataset/dataset.cjs +93 -22
  31. package/dataset/dataset.cjs.map +1 -1
  32. package/dataset/dataset.d.cts +105 -20
  33. package/dataset/dataset.d.ts +105 -20
  34. package/dataset/dataset.js +83 -12
  35. package/dataset/dataset.js.map +1 -1
  36. package/exchange-rate/exchange-rate.cjs +71 -14
  37. package/exchange-rate/exchange-rate.cjs.map +1 -1
  38. package/exchange-rate/exchange-rate.d.cts +83 -15
  39. package/exchange-rate/exchange-rate.d.ts +83 -15
  40. package/exchange-rate/exchange-rate.js +65 -8
  41. package/exchange-rate/exchange-rate.js.map +1 -1
  42. package/file-and-path/file-and-path.cjs +45 -16
  43. package/file-and-path/file-and-path.cjs.map +1 -1
  44. package/file-and-path/file-and-path.d.cts +53 -19
  45. package/file-and-path/file-and-path.d.ts +53 -19
  46. package/file-and-path/file-and-path.js +39 -10
  47. package/file-and-path/file-and-path.js.map +1 -1
  48. package/index.cjs +2 -2
  49. package/index.cjs.map +1 -1
  50. package/index.d.cts +2102 -2
  51. package/index.d.ts +2102 -2
  52. package/index.js +1 -1
  53. package/index.js.map +1 -1
  54. package/instance/instance.cjs +45 -16
  55. package/instance/instance.cjs.map +1 -1
  56. package/instance/instance.d.cts +48 -14
  57. package/instance/instance.d.ts +48 -14
  58. package/instance/instance.js +38 -9
  59. package/instance/instance.js.map +1 -1
  60. package/inventory/inventory.cjs +56 -0
  61. package/inventory/inventory.cjs.map +1 -0
  62. package/inventory/inventory.d.cts +50 -0
  63. package/inventory/inventory.d.ts +50 -0
  64. package/inventory/inventory.js +56 -0
  65. package/inventory/inventory.js.map +1 -0
  66. package/inventory/package.json +7 -0
  67. package/job/job.cjs +51 -8
  68. package/job/job.cjs.map +1 -1
  69. package/job/job.d.cts +61 -10
  70. package/job/job.d.ts +61 -10
  71. package/job/job.js +49 -6
  72. package/job/job.js.map +1 -1
  73. package/metadata/metadata.cjs +39 -10
  74. package/metadata/metadata.cjs.map +1 -1
  75. package/metadata/metadata.d.cts +45 -11
  76. package/metadata/metadata.d.ts +45 -11
  77. package/metadata/metadata.js +36 -7
  78. package/metadata/metadata.js.map +1 -1
  79. package/package.json +11 -11
  80. package/project/project.cjs +131 -26
  81. package/project/project.cjs.map +1 -1
  82. package/project/project.d.cts +166 -30
  83. package/project/project.d.ts +166 -30
  84. package/project/project.js +119 -14
  85. package/project/project.js.map +1 -1
  86. package/src/accounting/accounting.ts +137 -23
  87. package/src/admin/admin.ts +149 -51
  88. package/src/application/application.ts +94 -19
  89. package/src/configuration/configuration.ts +51 -15
  90. package/src/custom-instance.ts +3 -4
  91. package/src/data-manager-api.schemas.ts +115 -13
  92. package/src/dataset/dataset.ts +234 -46
  93. package/src/exchange-rate/exchange-rate.ts +186 -33
  94. package/src/file-and-path/file-and-path.ts +104 -39
  95. package/src/instance/instance.ts +99 -34
  96. package/src/inventory/inventory.ts +140 -0
  97. package/src/job/job.ts +139 -23
  98. package/src/metadata/metadata.ts +98 -25
  99. package/src/project/project.ts +313 -60
  100. package/src/task/task.ts +97 -22
  101. package/src/type/type.ts +51 -15
  102. package/src/user/user.ts +138 -26
  103. package/task/task.cjs +37 -8
  104. package/task/task.cjs.map +1 -1
  105. package/task/task.d.cts +44 -10
  106. package/task/task.d.ts +44 -10
  107. package/task/task.js +35 -6
  108. package/task/task.js.map +1 -1
  109. package/type/type.cjs +19 -4
  110. package/type/type.cjs.map +1 -1
  111. package/type/type.d.cts +23 -6
  112. package/type/type.d.ts +23 -6
  113. package/type/type.js +19 -4
  114. package/type/type.js.map +1 -1
  115. package/user/user.cjs +53 -10
  116. package/user/user.cjs.map +1 -1
  117. package/user/user.d.cts +63 -12
  118. package/user/user.d.ts +63 -12
  119. package/user/user.js +49 -6
  120. package/user/user.js.map +1 -1
  121. package/chunk-J22A7LHX.cjs.map +0 -1
  122. package/custom-instance-37ed2460.d.ts +0 -2014
@@ -1,16 +1,17 @@
1
1
  /**
2
- * Generated by orval v6.20.0 🍺
2
+ * Generated by orval v6.25.0 🍺
3
3
  * Do not edit manually.
4
4
  * Dataset Manager API
5
5
  * The Dataset Manager API service.
6
6
 
7
7
  A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.
8
8
 
9
- * OpenAPI spec version: 1.2
9
+ * OpenAPI spec version: 2.0
10
10
  */
11
11
  import {
12
12
  useMutation,
13
- useQuery
13
+ useQuery,
14
+ useSuspenseQuery
14
15
  } from '@tanstack/react-query'
15
16
  import type {
16
17
  MutationFunction,
@@ -18,7 +19,9 @@ import type {
18
19
  QueryKey,
19
20
  UseMutationOptions,
20
21
  UseQueryOptions,
21
- UseQueryResult
22
+ UseQueryResult,
23
+ UseSuspenseQueryOptions,
24
+ UseSuspenseQueryResult
22
25
  } from '@tanstack/react-query'
23
26
  import type {
24
27
  CreatePathParams,
@@ -34,19 +37,13 @@ import { customInstance } from '.././custom-instance';
34
37
  import type { ErrorType } from '.././custom-instance';
35
38
 
36
39
 
37
- // eslint-disable-next-line
38
- type SecondParameter<T extends (...args: any) => any> = T extends (
39
- config: any,
40
- args: infer P,
41
- ) => any
42
- ? P
43
- : never;
40
+ type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
44
41
 
45
42
 
46
43
  /**
47
44
  * Creates a new Path within a Project. Every directory in the Path will be created. The path will belong to the User and Project.
48
45
 
49
- Only Project owners or editors can create Paths.
46
+ Only Project editors can create Paths.
50
47
 
51
48
  * @summary Create a new Project Path
52
49
  */
@@ -56,7 +53,7 @@ export const createPath = (
56
53
 
57
54
 
58
55
  return customInstance<void>(
59
- {url: `/path`, method: 'put',
56
+ {url: `/path`, method: 'PUT',
60
57
  params
61
58
  },
62
59
  options);
@@ -65,7 +62,6 @@ export const createPath = (
65
62
 
66
63
 
67
64
  export const getCreatePathMutationOptions = <TError = ErrorType<DmError>,
68
-
69
65
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createPath>>, TError,{params: CreatePathParams}, TContext>, request?: SecondParameter<typeof customInstance>}
70
66
  ): UseMutationOptions<Awaited<ReturnType<typeof createPath>>, TError,{params: CreatePathParams}, TContext> => {
71
67
  const {mutation: mutationOptions, request: requestOptions} = options ?? {};
@@ -92,7 +88,6 @@ export const getCreatePathMutationOptions = <TError = ErrorType<DmError>,
92
88
  * @summary Create a new Project Path
93
89
  */
94
90
  export const useCreatePath = <TError = ErrorType<DmError>,
95
-
96
91
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createPath>>, TError,{params: CreatePathParams}, TContext>, request?: SecondParameter<typeof customInstance>}
97
92
  ) => {
98
93
 
@@ -103,7 +98,7 @@ export const useCreatePath = <TError = ErrorType<DmError>,
103
98
  /**
104
99
  * Deletes a Path within the Project. Be aware that the deletion of a Path will result in te contents of the Path also being deleted. If There are files in Path or sub-directories, they will all be deleted.
105
100
 
106
- Only Project owners or editors can delete Paths.
101
+ Only Project editors can delete Paths.
107
102
 
108
103
  * @summary Delete a Project Path
109
104
  */
@@ -113,7 +108,7 @@ export const deletePath = (
113
108
 
114
109
 
115
110
  return customInstance<void>(
116
- {url: `/path`, method: 'delete',
111
+ {url: `/path`, method: 'DELETE',
117
112
  params
118
113
  },
119
114
  options);
@@ -122,7 +117,6 @@ export const deletePath = (
122
117
 
123
118
 
124
119
  export const getDeletePathMutationOptions = <TError = ErrorType<DmError>,
125
-
126
120
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deletePath>>, TError,{params: DeletePathParams}, TContext>, request?: SecondParameter<typeof customInstance>}
127
121
  ): UseMutationOptions<Awaited<ReturnType<typeof deletePath>>, TError,{params: DeletePathParams}, TContext> => {
128
122
  const {mutation: mutationOptions, request: requestOptions} = options ?? {};
@@ -149,7 +143,6 @@ export const getDeletePathMutationOptions = <TError = ErrorType<DmError>,
149
143
  * @summary Delete a Project Path
150
144
  */
151
145
  export const useDeletePath = <TError = ErrorType<DmError>,
152
-
153
146
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deletePath>>, TError,{params: DeletePathParams}, TContext>, request?: SecondParameter<typeof customInstance>}
154
147
  ) => {
155
148
 
@@ -169,7 +162,7 @@ export const getFiles = (
169
162
 
170
163
 
171
164
  return customInstance<FilesGetResponse>(
172
- {url: `/file`, method: 'get',
165
+ {url: `/file`, method: 'GET',
173
166
  params, signal
174
167
  },
175
168
  options);
@@ -177,12 +170,11 @@ export const getFiles = (
177
170
 
178
171
 
179
172
  export const getGetFilesQueryKey = (params: GetFilesParams,) => {
180
-
181
173
  return ["data-manager-api", `/file`, ...(params ? [params]: [])] as const;
182
174
  }
183
175
 
184
176
 
185
- export const getGetFilesQueryOptions = <TData = Awaited<ReturnType<typeof getFiles>>, TError = ErrorType<void | DmError>>(params: GetFilesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
177
+ export const getGetFilesQueryOptions = <TData = Awaited<ReturnType<typeof getFiles>>, TError = ErrorType<void | DmError>>(params: GetFilesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
186
178
  ) => {
187
179
 
188
180
  const {query: queryOptions, request: requestOptions} = options ?? {};
@@ -207,7 +199,7 @@ export type GetFilesQueryError = ErrorType<void | DmError>
207
199
  * @summary Gets the Files on a Project Path
208
200
  */
209
201
  export const useGetFiles = <TData = Awaited<ReturnType<typeof getFiles>>, TError = ErrorType<void | DmError>>(
210
- params: GetFilesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
202
+ params: GetFilesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
211
203
 
212
204
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
213
205
 
@@ -222,6 +214,46 @@ export const useGetFiles = <TData = Awaited<ReturnType<typeof getFiles>>, TError
222
214
 
223
215
 
224
216
 
217
+ export const getGetFilesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getFiles>>, TError = ErrorType<void | DmError>>(params: GetFilesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
218
+ ) => {
219
+
220
+ const {query: queryOptions, request: requestOptions} = options ?? {};
221
+
222
+ const queryKey = queryOptions?.queryKey ?? getGetFilesQueryKey(params);
223
+
224
+
225
+
226
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getFiles>>> = ({ signal }) => getFiles(params, requestOptions, signal);
227
+
228
+
229
+
230
+
231
+
232
+ return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData> & { queryKey: QueryKey }
233
+ }
234
+
235
+ export type GetFilesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getFiles>>>
236
+ export type GetFilesSuspenseQueryError = ErrorType<void | DmError>
237
+
238
+ /**
239
+ * @summary Gets the Files on a Project Path
240
+ */
241
+ export const useGetFilesSuspense = <TData = Awaited<ReturnType<typeof getFiles>>, TError = ErrorType<void | DmError>>(
242
+ params: GetFilesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getFiles>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
243
+
244
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
245
+
246
+ const queryOptions = getGetFilesSuspenseQueryOptions(params,options)
247
+
248
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
249
+
250
+ query.queryKey = queryOptions.queryKey ;
251
+
252
+ return query;
253
+ }
254
+
255
+
256
+
225
257
  /**
226
258
  * 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.
227
259
 
@@ -229,7 +261,7 @@ Only Datasets attached to projects are available through the Project API. A Data
229
261
 
230
262
  An `editor` of a **dataset** is not automatically and `editor` of the **project** it's attached to.
231
263
 
232
- You must be an `editor` or the `owner` of the project to attach a Dataset to a project. Being an `editor` of the Dataset you are attaching does not give you the ability to detach it from the Project.
264
+ You must be an `editor` of the Project to attach a Dataset to a project. Being an `editor` of the Dataset you are attaching does not give you the ability to detach it from the Project.
233
265
 
234
266
  You cannot add a Dataset to a Project until its upload is complete.
235
267
 
@@ -255,7 +287,7 @@ if(filePostBodyBody.immutable !== undefined) {
255
287
  }
256
288
 
257
289
  return customInstance<FilePostResponse>(
258
- {url: `/file`, method: 'post',
290
+ {url: `/file`, method: 'POST',
259
291
  headers: {'Content-Type': 'multipart/form-data', },
260
292
  data: formData
261
293
  },
@@ -265,7 +297,6 @@ if(filePostBodyBody.immutable !== undefined) {
265
297
 
266
298
 
267
299
  export const getAttachFileMutationOptions = <TError = ErrorType<void | DmError>,
268
-
269
300
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof attachFile>>, TError,{data: FilePostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
270
301
  ): UseMutationOptions<Awaited<ReturnType<typeof attachFile>>, TError,{data: FilePostBodyBody}, TContext> => {
271
302
  const {mutation: mutationOptions, request: requestOptions} = options ?? {};
@@ -292,7 +323,6 @@ export const getAttachFileMutationOptions = <TError = ErrorType<void | DmError>,
292
323
  * @summary Attach a Dataset, as a File, to a Project
293
324
  */
294
325
  export const useAttachFile = <TError = ErrorType<void | DmError>,
295
-
296
326
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof attachFile>>, TError,{data: FilePostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
297
327
  ) => {
298
328
 
@@ -303,7 +333,7 @@ export const useAttachFile = <TError = ErrorType<void | DmError>,
303
333
  /**
304
334
  * Removes an unmanaged file from a Project. You cannot use this endpoint to delete managed project files.
305
335
 
306
- You must be an `editor` or the `owner` of the project to delete a file from a project.
336
+ You must be an `editor` of the Project to delete a file from a Project.
307
337
 
308
338
  * @summary Delete an unmanaged Project File
309
339
  */
@@ -313,7 +343,7 @@ export const deleteUnmanagedFile = (
313
343
 
314
344
 
315
345
  return customInstance<void>(
316
- {url: `/file`, method: 'delete',
346
+ {url: `/file`, method: 'DELETE',
317
347
  params
318
348
  },
319
349
  options);
@@ -322,7 +352,6 @@ export const deleteUnmanagedFile = (
322
352
 
323
353
 
324
354
  export const getDeleteUnmanagedFileMutationOptions = <TError = ErrorType<DmError>,
325
-
326
355
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteUnmanagedFile>>, TError,{params: DeleteUnmanagedFileParams}, TContext>, request?: SecondParameter<typeof customInstance>}
327
356
  ): UseMutationOptions<Awaited<ReturnType<typeof deleteUnmanagedFile>>, TError,{params: DeleteUnmanagedFileParams}, TContext> => {
328
357
  const {mutation: mutationOptions, request: requestOptions} = options ?? {};
@@ -349,7 +378,6 @@ export const getDeleteUnmanagedFileMutationOptions = <TError = ErrorType<DmError
349
378
  * @summary Delete an unmanaged Project File
350
379
  */
351
380
  export const useDeleteUnmanagedFile = <TError = ErrorType<DmError>,
352
-
353
381
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteUnmanagedFile>>, TError,{params: DeleteUnmanagedFileParams}, TContext>, request?: SecondParameter<typeof customInstance>}
354
382
  ) => {
355
383
 
@@ -360,7 +388,7 @@ export const useDeleteUnmanagedFile = <TError = ErrorType<DmError>,
360
388
  /**
361
389
  * Given a `file_id` the file will be removed from the Project it's attached to.
362
390
 
363
- You must be an `editor` or the `owner` 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.
391
+ 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.
364
392
 
365
393
  You cannot delete a Project File until the attach is complete.
366
394
 
@@ -372,7 +400,7 @@ export const deleteFile = (
372
400
 
373
401
 
374
402
  return customInstance<void>(
375
- {url: `/file/${fileId}`, method: 'delete'
403
+ {url: `/file/${fileId}`, method: 'DELETE'
376
404
  },
377
405
  options);
378
406
  }
@@ -380,7 +408,6 @@ export const deleteFile = (
380
408
 
381
409
 
382
410
  export const getDeleteFileMutationOptions = <TError = ErrorType<DmError>,
383
-
384
411
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteFile>>, TError,{fileId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
385
412
  ): UseMutationOptions<Awaited<ReturnType<typeof deleteFile>>, TError,{fileId: string}, TContext> => {
386
413
  const {mutation: mutationOptions, request: requestOptions} = options ?? {};
@@ -407,7 +434,6 @@ export const getDeleteFileMutationOptions = <TError = ErrorType<DmError>,
407
434
  * @summary Delete/detach a File (from a Project)
408
435
  */
409
436
  export const useDeleteFile = <TError = ErrorType<DmError>,
410
-
411
437
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteFile>>, TError,{fileId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
412
438
  ) => {
413
439
 
@@ -429,19 +455,18 @@ export const downloadFile = (
429
455
 
430
456
 
431
457
  return customInstance<void>(
432
- {url: `/file/${fileId}`, method: 'get', signal
458
+ {url: `/file/${fileId}`, method: 'GET', signal
433
459
  },
434
460
  options);
435
461
  }
436
462
 
437
463
 
438
464
  export const getDownloadFileQueryKey = (fileId: string,) => {
439
-
440
465
  return ["data-manager-api", `/file/${fileId}`] as const;
441
466
  }
442
467
 
443
468
 
444
- export const getDownloadFileQueryOptions = <TData = Awaited<ReturnType<typeof downloadFile>>, TError = ErrorType<DmError>>(fileId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
469
+ export const getDownloadFileQueryOptions = <TData = Awaited<ReturnType<typeof downloadFile>>, TError = ErrorType<DmError>>(fileId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
445
470
  ) => {
446
471
 
447
472
  const {query: queryOptions, request: requestOptions} = options ?? {};
@@ -466,7 +491,7 @@ export type DownloadFileQueryError = ErrorType<DmError>
466
491
  * @summary Download a File (from a project)
467
492
  */
468
493
  export const useDownloadFile = <TData = Awaited<ReturnType<typeof downloadFile>>, TError = ErrorType<DmError>>(
469
- fileId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
494
+ fileId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
470
495
 
471
496
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
472
497
 
@@ -481,3 +506,43 @@ export const useDownloadFile = <TData = Awaited<ReturnType<typeof downloadFile>>
481
506
 
482
507
 
483
508
 
509
+ export const getDownloadFileSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof downloadFile>>, TError = ErrorType<DmError>>(fileId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
510
+ ) => {
511
+
512
+ const {query: queryOptions, request: requestOptions} = options ?? {};
513
+
514
+ const queryKey = queryOptions?.queryKey ?? getDownloadFileQueryKey(fileId);
515
+
516
+
517
+
518
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadFile>>> = ({ signal }) => downloadFile(fileId, requestOptions, signal);
519
+
520
+
521
+
522
+
523
+
524
+ return { queryKey, queryFn, enabled: !!(fileId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData> & { queryKey: QueryKey }
525
+ }
526
+
527
+ export type DownloadFileSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof downloadFile>>>
528
+ export type DownloadFileSuspenseQueryError = ErrorType<DmError>
529
+
530
+ /**
531
+ * @summary Download a File (from a project)
532
+ */
533
+ export const useDownloadFileSuspense = <TData = Awaited<ReturnType<typeof downloadFile>>, TError = ErrorType<DmError>>(
534
+ fileId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof downloadFile>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
535
+
536
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
537
+
538
+ const queryOptions = getDownloadFileSuspenseQueryOptions(fileId,options)
539
+
540
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
541
+
542
+ query.queryKey = queryOptions.queryKey ;
543
+
544
+ return query;
545
+ }
546
+
547
+
548
+