@squonk/data-manager-client 4.3.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.
Files changed (119) hide show
  1. package/accounting/accounting.cjs +55 -10
  2. package/accounting/accounting.cjs.map +1 -1
  3. package/accounting/accounting.d.cts +58 -1
  4. package/accounting/accounting.d.ts +58 -1
  5. package/accounting/accounting.js +46 -1
  6. package/accounting/accounting.js.map +1 -1
  7. package/admin/admin.cjs +15 -15
  8. package/admin/admin.cjs.map +1 -1
  9. package/admin/admin.d.cts +2 -0
  10. package/admin/admin.d.ts +2 -0
  11. package/admin/admin.js +1 -1
  12. package/admin/admin.js.map +1 -1
  13. package/application/application.cjs +5 -5
  14. package/application/application.cjs.map +1 -1
  15. package/application/application.js +1 -1
  16. package/application/application.js.map +1 -1
  17. package/{chunk-OYRETEBZ.js → chunk-76ADQBHZ.js} +3 -3
  18. package/chunk-76ADQBHZ.js.map +1 -0
  19. package/{chunk-ZLY5XEOQ.cjs → chunk-KHB5TJT7.cjs} +3 -3
  20. package/chunk-KHB5TJT7.cjs.map +1 -0
  21. package/chunk-RB2KVIEK.cjs.map +1 -1
  22. package/configuration/configuration.cjs +5 -5
  23. package/configuration/configuration.cjs.map +1 -1
  24. package/configuration/configuration.d.cts +1 -1
  25. package/configuration/configuration.d.ts +1 -1
  26. package/configuration/configuration.js +1 -1
  27. package/configuration/configuration.js.map +1 -1
  28. package/dataset/dataset.cjs +14 -14
  29. package/dataset/dataset.cjs.map +1 -1
  30. package/dataset/dataset.js +1 -1
  31. package/dataset/dataset.js.map +1 -1
  32. package/digest/digest.cjs +3 -3
  33. package/digest/digest.cjs.map +1 -1
  34. package/digest/digest.js +1 -1
  35. package/digest/digest.js.map +1 -1
  36. package/file-and-path/file-and-path.cjs +139 -17
  37. package/file-and-path/file-and-path.cjs.map +1 -1
  38. package/file-and-path/file-and-path.d.cts +162 -2
  39. package/file-and-path/file-and-path.d.ts +162 -2
  40. package/file-and-path/file-and-path.js +123 -1
  41. package/file-and-path/file-and-path.js.map +1 -1
  42. package/index.cjs +4 -2
  43. package/index.cjs.map +1 -1
  44. package/index.d.cts +53 -37
  45. package/index.d.ts +53 -37
  46. package/index.js +3 -1
  47. package/index.js.map +1 -1
  48. package/instance/instance.cjs +10 -10
  49. package/instance/instance.cjs.map +1 -1
  50. package/instance/instance.js +1 -1
  51. package/instance/instance.js.map +1 -1
  52. package/inventory/inventory.cjs +3 -3
  53. package/inventory/inventory.cjs.map +1 -1
  54. package/inventory/inventory.js +1 -1
  55. package/inventory/inventory.js.map +1 -1
  56. package/job/job.cjs +124 -8
  57. package/job/job.cjs.map +1 -1
  58. package/job/job.d.cts +159 -3
  59. package/job/job.d.ts +159 -3
  60. package/job/job.js +119 -3
  61. package/job/job.js.map +1 -1
  62. package/metadata/metadata.cjs +7 -7
  63. package/metadata/metadata.cjs.map +1 -1
  64. package/metadata/metadata.js +1 -1
  65. package/metadata/metadata.js.map +1 -1
  66. package/package.json +1 -1
  67. package/project/project.cjs +15 -137
  68. package/project/project.cjs.map +1 -1
  69. package/project/project.d.cts +3 -163
  70. package/project/project.d.ts +3 -163
  71. package/project/project.js +1 -123
  72. package/project/project.js.map +1 -1
  73. package/src/{data-manager-api.schemas.ts → API_TARGET_NAME.schemas.ts} +52 -43
  74. package/src/accounting/accounting.ts +244 -2
  75. package/src/admin/admin.ts +4 -2
  76. package/src/application/application.ts +2 -2
  77. package/src/configuration/configuration.ts +5 -9
  78. package/src/dataset/dataset.ts +2 -2
  79. package/src/digest/digest.ts +2 -2
  80. package/src/file-and-path/file-and-path.ts +602 -2
  81. package/src/index.ts +2 -2
  82. package/src/instance/instance.ts +2 -2
  83. package/src/inventory/inventory.ts +2 -2
  84. package/src/job/job.ts +599 -3
  85. package/src/metadata/metadata.ts +2 -2
  86. package/src/options-mutator.ts +2 -2
  87. package/src/project/project.ts +5 -604
  88. package/src/task/task.ts +2 -2
  89. package/src/type/type.ts +2 -2
  90. package/src/user/user.ts +2 -2
  91. package/src/workflow/workflow.ts +5 -3
  92. package/task/task.cjs +6 -6
  93. package/task/task.cjs.map +1 -1
  94. package/task/task.js +1 -1
  95. package/task/task.js.map +1 -1
  96. package/type/type.cjs +3 -3
  97. package/type/type.cjs.map +1 -1
  98. package/type/type.js +1 -1
  99. package/type/type.js.map +1 -1
  100. package/user/user.cjs +10 -10
  101. package/user/user.cjs.map +1 -1
  102. package/user/user.js +1 -1
  103. package/user/user.js.map +1 -1
  104. package/workflow/workflow.cjs +20 -20
  105. package/workflow/workflow.cjs.map +1 -1
  106. package/workflow/workflow.d.cts +3 -1
  107. package/workflow/workflow.d.ts +3 -1
  108. package/workflow/workflow.js +1 -1
  109. package/workflow/workflow.js.map +1 -1
  110. package/chunk-OYRETEBZ.js.map +0 -1
  111. package/chunk-ZLY5XEOQ.cjs.map +0 -1
  112. package/exchange-rate/exchange-rate.cjs +0 -255
  113. package/exchange-rate/exchange-rate.cjs.map +0 -1
  114. package/exchange-rate/exchange-rate.d.cts +0 -319
  115. package/exchange-rate/exchange-rate.d.ts +0 -319
  116. package/exchange-rate/exchange-rate.js +0 -255
  117. package/exchange-rate/exchange-rate.js.map +0 -1
  118. package/exchange-rate/package.json +0 -7
  119. package/src/exchange-rate/exchange-rate.ts +0 -1276
@@ -6,7 +6,7 @@
6
6
 
7
7
  A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications**, **Jobs**, and **Workflows** using **Projects** and **Files**.
8
8
 
9
- * OpenAPI spec version: 4.1
9
+ * OpenAPI spec version: 5.0
10
10
  */
11
11
  import { useMutation, useQuery, useSuspenseQuery } from "@tanstack/react-query";
12
12
  import type {
@@ -35,9 +35,12 @@ import type {
35
35
  FilePostResponse,
36
36
  FilesGetResponse,
37
37
  GetFilesParams,
38
+ GetProjectFileParams,
39
+ GetProjectFileWithTokenParams,
38
40
  MoveFileInProjectParams,
39
41
  MovePathParams,
40
- } from "../data-manager-api.schemas";
42
+ ProjectFilePutBodyBody,
43
+ } from "../API_TARGET_NAME.schemas";
41
44
 
42
45
  import { customInstance } from ".././custom-instance";
43
46
  import type { ErrorType } from ".././custom-instance";
@@ -286,6 +289,603 @@ export const useMovePath = <TError = ErrorType<void | DmError>, TContext = unkno
286
289
 
287
290
  return useMutation(mutationOptions, queryClient);
288
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).
294
+
295
+ For **managed** files you should consider using the `/file/{file_id}` endpoint.
296
+
297
+ You must be an `editor` of the Project if the Project is `private`
298
+
299
+ * @summary Download a Project file
300
+ */
301
+ export const getProjectFile = (
302
+ projectId: string,
303
+ params: GetProjectFileParams,
304
+ options?: SecondParameter<typeof customInstance>,
305
+ signal?: AbortSignal,
306
+ ) => {
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
+ */
402
+
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;
422
+
423
+ return query;
424
+ }
425
+
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
+ */
505
+
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;
528
+
529
+ return query;
530
+ }
531
+
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.
534
+
535
+ You must be an `editor` of the project
536
+
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>;
607
+
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).
634
+
635
+ For **managed** files you should consider using the `/file/{file_id}` endpoint.
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.
638
+
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<
706
+ DefinedInitialDataOptions<
707
+ Awaited<ReturnType<typeof getProjectFileWithToken>>,
708
+ TError,
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<
728
+ UndefinedInitialDataOptions<
729
+ Awaited<ReturnType<typeof getProjectFileWithToken>>,
730
+ TError,
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> };
753
+ /**
754
+ * @summary Download a Project file using a Token
755
+ */
756
+
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;
778
+
779
+ return query;
780
+ }
781
+
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
+ },
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
+ */
862
+
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;
885
+
886
+ return query;
887
+ }
888
+
289
889
  /**
290
890
  * Given a Project and Path the files available to you on that path will be returned along with any additional paths (sub-directories).
291
891
 
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // Generated by orval
2
- // data-manager-api Is replaced with the api name
3
- export * from "./data-manager-api.schemas";
2
+ // API_TARGET_NAME Is replaced with the api name
3
+ export * from "./API_TARGET_NAME.schemas";
4
4
 
5
5
  // Request instance and methods to change the baseUrl and auth token
6
6
  export * from "./custom-instance";
@@ -6,7 +6,7 @@
6
6
 
7
7
  A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications**, **Jobs**, and **Workflows** using **Projects** and **Files**.
8
8
 
9
- * OpenAPI spec version: 4.1
9
+ * OpenAPI spec version: 5.0
10
10
  */
11
11
  import { useMutation, useQuery, useSuspenseQuery } from "@tanstack/react-query";
12
12
  import type {
@@ -36,7 +36,7 @@ import type {
36
36
  InstancesGetResponse,
37
37
  PatchInstanceParams,
38
38
  TaskIdentity,
39
- } from "../data-manager-api.schemas";
39
+ } from "../API_TARGET_NAME.schemas";
40
40
 
41
41
  import { customInstance } from ".././custom-instance";
42
42
  import type { ErrorType } from ".././custom-instance";
@@ -6,7 +6,7 @@
6
6
 
7
7
  A service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications**, **Jobs**, and **Workflows** using **Projects** and **Files**.
8
8
 
9
- * OpenAPI spec version: 4.1
9
+ * OpenAPI spec version: 5.0
10
10
  */
11
11
  import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
12
12
  import type {
@@ -27,7 +27,7 @@ import type {
27
27
  DmError,
28
28
  GetUserInventoryParams,
29
29
  InventoryUserGetResponse,
30
- } from "../data-manager-api.schemas";
30
+ } from "../API_TARGET_NAME.schemas";
31
31
 
32
32
  import { customInstance } from ".././custom-instance";
33
33
  import type { ErrorType } from ".././custom-instance";