@squonk/data-manager-client 1.1.0 → 1.1.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 (96) hide show
  1. package/accounting/accounting.cjs +16 -12
  2. package/accounting/accounting.cjs.map +1 -1
  3. package/accounting/accounting.d.ts +8 -8
  4. package/accounting/accounting.js +13 -9
  5. package/accounting/accounting.js.map +1 -1
  6. package/admin/admin.cjs +19 -14
  7. package/admin/admin.cjs.map +1 -1
  8. package/admin/admin.d.ts +23 -23
  9. package/admin/admin.js +10 -5
  10. package/admin/admin.js.map +1 -1
  11. package/application/application.cjs +12 -10
  12. package/application/application.cjs.map +1 -1
  13. package/application/application.d.ts +6 -6
  14. package/application/application.js +10 -8
  15. package/application/application.js.map +1 -1
  16. package/{chunk-3O5KIRV4.js → chunk-3RNIDX7T.js} +1 -1
  17. package/{chunk-3O5KIRV4.js.map → chunk-3RNIDX7T.js.map} +1 -1
  18. package/chunk-LNYWU37B.cjs +13 -0
  19. package/chunk-LNYWU37B.cjs.map +1 -0
  20. package/chunk-LT4O36DN.js +13 -0
  21. package/chunk-LT4O36DN.js.map +1 -0
  22. package/{chunk-IUEU2LYC.cjs → chunk-UZTHSGDT.cjs} +1 -1
  23. package/chunk-UZTHSGDT.cjs.map +1 -0
  24. package/{custom-instance-5c7b6971.d.ts → custom-instance-b5dd9223.d.ts} +259 -98
  25. package/dataset/dataset.cjs +29 -32
  26. package/dataset/dataset.cjs.map +1 -1
  27. package/dataset/dataset.d.ts +24 -24
  28. package/dataset/dataset.js +19 -22
  29. package/dataset/dataset.js.map +1 -1
  30. package/exchange-rate/exchange-rate.cjs +22 -18
  31. package/exchange-rate/exchange-rate.cjs.map +1 -1
  32. package/exchange-rate/exchange-rate.d.ts +16 -16
  33. package/exchange-rate/exchange-rate.js +16 -12
  34. package/exchange-rate/exchange-rate.js.map +1 -1
  35. package/file/file.cjs +15 -15
  36. package/file/file.cjs.map +1 -1
  37. package/file/file.d.ts +13 -13
  38. package/file/file.js +10 -10
  39. package/file/file.js.map +1 -1
  40. package/index.cjs +2 -2
  41. package/index.cjs.map +1 -1
  42. package/index.d.ts +1 -1
  43. package/index.js +1 -1
  44. package/index.js.map +1 -1
  45. package/instance/instance.cjs +17 -15
  46. package/instance/instance.cjs.map +1 -1
  47. package/instance/instance.d.ts +18 -18
  48. package/instance/instance.js +10 -8
  49. package/instance/instance.js.map +1 -1
  50. package/job/job.cjs +16 -14
  51. package/job/job.cjs.map +1 -1
  52. package/job/job.d.ts +8 -8
  53. package/job/job.js +13 -11
  54. package/job/job.js.map +1 -1
  55. package/metadata/metadata.cjs +14 -15
  56. package/metadata/metadata.cjs.map +1 -1
  57. package/metadata/metadata.d.ts +12 -12
  58. package/metadata/metadata.js +10 -11
  59. package/metadata/metadata.js.map +1 -1
  60. package/package.json +12 -12
  61. package/project/project.cjs +28 -29
  62. package/project/project.cjs.map +1 -1
  63. package/project/project.d.ts +29 -29
  64. package/project/project.js +16 -17
  65. package/project/project.js.map +1 -1
  66. package/src/accounting/accounting.ts +14 -13
  67. package/src/admin/admin.ts +10 -9
  68. package/src/application/application.ts +10 -10
  69. package/src/data-manager-api.schemas.ts +206 -27
  70. package/src/dataset/dataset.ts +22 -24
  71. package/src/exchange-rate/exchange-rate.ts +18 -19
  72. package/src/file/file.ts +10 -10
  73. package/src/instance/instance.ts +10 -10
  74. package/src/job/job.ts +14 -13
  75. package/src/metadata/metadata.ts +10 -11
  76. package/src/project/project.ts +18 -19
  77. package/src/queryMutator.ts +12 -0
  78. package/src/task/task.ts +10 -9
  79. package/src/type/type.ts +6 -5
  80. package/src/user/user.ts +14 -13
  81. package/task/task.cjs +13 -12
  82. package/task/task.cjs.map +1 -1
  83. package/task/task.d.ts +8 -8
  84. package/task/task.js +10 -9
  85. package/task/task.js.map +1 -1
  86. package/type/type.cjs +8 -4
  87. package/type/type.cjs.map +1 -1
  88. package/type/type.d.ts +4 -4
  89. package/type/type.js +7 -3
  90. package/type/type.js.map +1 -1
  91. package/user/user.cjs +17 -13
  92. package/user/user.cjs.map +1 -1
  93. package/user/user.d.ts +11 -11
  94. package/user/user.js +13 -9
  95. package/user/user.js.map +1 -1
  96. package/chunk-IUEU2LYC.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/metadata/metadata.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAmC/B,IAAM,qBAAqB,CAChC,WACA,gBACA,gCACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,MAAI,+BAA+B,oBAAoB,QAAW;AAChE,aAAS;AAAA,MACP;AAAA,MACA,+BAA+B;AAAA,IACjC;AAAA,EACF;AACA,MAAI,+BAA+B,gBAAgB,QAAW;AAC5D,aAAS,OAAO,eAAe,+BAA+B,WAAW;AAAA,EAC3E;AAEA,SAAO;AAAA,IACL;AAAA,MACE,KAAK,YAAY,kBAAkB;AAAA,MACnC,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,MACjD,MAAM;AAAA,IACR;AAAA,IACA;AAAA,EACF;AACF;AAQO,IAAM,wBAAwB,CAGnC,YAYI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAOF,CAAC,UAAU;AACb,UAAM,EAAE,WAAW,gBAAgB,KAAK,IAAI,SAAS,CAAC;AAEtD,WAAO,mBAAmB,WAAW,gBAAgB,MAAM,cAAc;AAAA,EAC3E;AAEA,SAAO,YASL,YAAY,eAAe;AAC/B;AAMO,IAAM,qBAAqB,CAChC,WACA,gBACA,SACA,WACG;AACH,SAAO;AAAA,IACL;AAAA,MACE,KAAK,YAAY,kBAAkB;AAAA,MACnC,QAAQ;AAAA,MACR;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;AAEO,IAAM,gCAAgC,CAC3C,WACA,mBACG,CAAC,YAAY,kBAAkB,gBAAgB;AAO7C,IAAM,wBAAwB,CAInC,WAC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I5B,WACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,uBAAuB,SAAS;AAE3E,QAAM,UAAkE,CAAC;AAAA,IACvE;AAAA,EACF,MAAM,YAAY,WAAW,gBAAgB,MAAM;AAEnD,QAAM,QAAQ,SAIZ,UAAU,SAAS;AAAA,IACnB,SAAS,CAAC,CAAC;AAAA,IACX,GAAG;AAAA,EACL,CAAC;AAED,QAAM,WAAW;AAEjB,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.10.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n DatasetMetaGetResponse,\n DmError,\n DatasetVersionMetaPostBodyBody,\n DatasetMetaPostBodyBody,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Update parameters or add new annotations of the specified type(s) and to the metadata for the version of the dataset.\n\nThe parameters are provided in a list in keyword/arguments\n\nThe annotations are provided in a list in JSON format. For details of the annotations that can be created, see the data-manager-metadata library.\n\n * @summary Update Metadata for the Dataset version\n */\nexport const addMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n datasetVersionMetaPostBodyBody: DatasetVersionMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetVersionMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\n \"meta_properties\",\n datasetVersionMetaPostBodyBody.meta_properties\n );\n }\n if (datasetVersionMetaPostBodyBody.annotations !== undefined) {\n formData.append(\"annotations\", datasetVersionMetaPostBodyBody.annotations);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AddMetadataVersionMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadataVersion>>\n>;\nexport type AddMetadataVersionMutationBody = DatasetVersionMetaPostBodyBody;\nexport type AddMetadataVersionMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadataVersion = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n }\n > = (props) => {\n const { datasetId, datasetVersion, data } = props ?? {};\n\n return addMetadataVersion(datasetId, datasetVersion, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns the metadata for a Dataset version in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset version\n */\nexport const getMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetMetadataVersionQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/meta/${datasetVersion}`];\n\nexport type GetMetadataVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadataVersion>>\n>;\nexport type GetMetadataVersionQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadataVersion = <\n TData = Awaited<ReturnType<typeof getMetadataVersion>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getGetMetadataVersionQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getMetadataVersion>>\n > = ({ signal }) =>\n getMetadataVersion(datasetId, datasetVersion, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!(datasetId && datasetVersion),\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Update default parameters or add new labels to the metadata for the dataset.\nThe parameters are provided in a list in keyword/arguments\nThe labels are provided in a list in JSON format. For details of the label format, see the data-manager-metadata library,\n\n * @summary Update Metadata for the Dataset\n */\nexport const addMetadata = (\n datasetId: string,\n datasetMetaPostBodyBody: DatasetMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\"meta_properties\", datasetMetaPostBodyBody.meta_properties);\n }\n if (datasetMetaPostBodyBody.labels !== undefined) {\n formData.append(\"labels\", datasetMetaPostBodyBody.labels);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AddMetadataMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadata>>\n>;\nexport type AddMetadataMutationBody = DatasetMetaPostBodyBody;\nexport type AddMetadataMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadata = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addMetadata>>,\n { datasetId: string; data: DatasetMetaPostBodyBody }\n > = (props) => {\n const { datasetId, data } = props ?? {};\n\n return addMetadata(datasetId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns the metadata for a Dataset in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset\n */\nexport const getMetadata = (\n datasetId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n { url: `/dataset/${datasetId}/meta`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetMetadataQueryKey = (datasetId: string) => [\n `/dataset/${datasetId}/meta`,\n];\n\nexport type GetMetadataQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadata>>\n>;\nexport type GetMetadataQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadata = <\n TData = Awaited<ReturnType<typeof getMetadata>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadata>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadata>>> = ({\n signal,\n }) => getMetadata(datasetId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getMetadata>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!datasetId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"]}
1
+ {"version":3,"sources":["../../src/metadata/metadata.ts"],"names":[],"mappings":";;;;;;;;AAUA,SAAS,UAAU,mBAAmB;AAoC/B,IAAM,qBAAqB,CAChC,WACA,gBACA,gCACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,MAAI,+BAA+B,oBAAoB,QAAW;AAChE,aAAS;AAAA,MACP;AAAA,MACA,+BAA+B;AAAA,IACjC;AAAA,EACF;AACA,MAAI,+BAA+B,gBAAgB,QAAW;AAC5D,aAAS,OAAO,eAAe,+BAA+B,WAAW;AAAA,EAC3E;AAEA,SAAO;AAAA,IACL;AAAA,MACE,KAAK,YAAY,kBAAkB;AAAA,MACnC,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,MACjD,MAAM;AAAA,IACR;AAAA,IACA;AAAA,EACF;AACF;AAQO,IAAM,wBAAwB,CAGnC,YAYI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAOF,CAAC,UAAU;AACb,UAAM,EAAE,WAAW,gBAAgB,KAAK,IAAI,SAAS,CAAC;AAEtD,WAAO,mBAAmB,WAAW,gBAAgB,MAAM,cA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AAS,CAAC;AAEtC,WAAO,YAAY,WAAW,MAAM,cAAc;AAAA,EACpD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAMO,IAAM,cAAc,CACzB,WACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,YAAY,kBAAkB,QAAQ,OAAO,OAAO;AAAA,IAC3D;AAAA,EACF;AACF;AAEO,IAAM,yBAAyB,CAAC,cAAsB;AAAA,EAC3D,YAAY;AACd;AAOO,IAAM,iBAAiB,CAI5B,WACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,uBAAuB,SAAS;AAE3E,QAAM,UAAkE,CAAC;AAAA,IACvE;AAAA,EACF,MAAM,YAAY,WAAW,gBAAgB,MAAM;AAEnD,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ,SAIZ,aAAa;AAEf,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.12.1 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n DatasetMetaGetResponse,\n DmError,\n DatasetVersionMetaPostBodyBody,\n DatasetMetaPostBodyBody,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././queryMutator\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Update parameters or add new annotations of the specified type(s) and to the metadata for the version of the dataset.\n\nThe parameters are provided in a list in keyword/arguments\n\nThe annotations are provided in a list in JSON format. For details of the annotations that can be created, see the data-manager-metadata library.\n\n * @summary Update Metadata for the Dataset version\n */\nexport const addMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n datasetVersionMetaPostBodyBody: DatasetVersionMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetVersionMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\n \"meta_properties\",\n datasetVersionMetaPostBodyBody.meta_properties\n );\n }\n if (datasetVersionMetaPostBodyBody.annotations !== undefined) {\n formData.append(\"annotations\", datasetVersionMetaPostBodyBody.annotations);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AddMetadataVersionMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadataVersion>>\n>;\nexport type AddMetadataVersionMutationBody = DatasetVersionMetaPostBodyBody;\nexport type AddMetadataVersionMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadataVersion = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n }\n > = (props) => {\n const { datasetId, datasetVersion, data } = props ?? {};\n\n return addMetadataVersion(datasetId, datasetVersion, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns the metadata for a Dataset version in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset version\n */\nexport const getMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetMetadataVersionQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/meta/${datasetVersion}`];\n\nexport type GetMetadataVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadataVersion>>\n>;\nexport type GetMetadataVersionQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadataVersion = <\n TData = Awaited<ReturnType<typeof getMetadataVersion>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getGetMetadataVersionQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getMetadataVersion>>\n > = ({ signal }) =>\n getMetadataVersion(datasetId, datasetVersion, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Update default parameters or add new labels to the metadata for the dataset.\nThe parameters are provided in a list in keyword/arguments\nThe labels are provided in a list in JSON format. For details of the label format, see the data-manager-metadata library,\n\n * @summary Update Metadata for the Dataset\n */\nexport const addMetadata = (\n datasetId: string,\n datasetMetaPostBodyBody: DatasetMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\"meta_properties\", datasetMetaPostBodyBody.meta_properties);\n }\n if (datasetMetaPostBodyBody.labels !== undefined) {\n formData.append(\"labels\", datasetMetaPostBodyBody.labels);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AddMetadataMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadata>>\n>;\nexport type AddMetadataMutationBody = DatasetMetaPostBodyBody;\nexport type AddMetadataMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadata = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addMetadata>>,\n { datasetId: string; data: DatasetMetaPostBodyBody }\n > = (props) => {\n const { datasetId, data } = props ?? {};\n\n return addMetadata(datasetId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns the metadata for a Dataset in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset\n */\nexport const getMetadata = (\n datasetId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n { url: `/dataset/${datasetId}/meta`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetMetadataQueryKey = (datasetId: string) => [\n `/dataset/${datasetId}/meta`,\n];\n\nexport type GetMetadataQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadata>>\n>;\nexport type GetMetadataQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadata = <\n TData = Awaited<ReturnType<typeof getMetadata>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadata>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadata>>> = ({\n signal,\n }) => getMetadata(datasetId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getMetadata>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n"]}
@@ -1,9 +1,9 @@
1
1
  import * as _tanstack_react_query from '@tanstack/react-query';
2
2
  import { UseMutationOptions, UseQueryOptions, QueryKey, UseQueryResult } from '@tanstack/react-query';
3
- import { a7 as DatasetVersionMetaPostBodyBody, bI as customInstance, bu as DatasetMetaGetResponse, bJ as ErrorType, bE as DmError, a8 as DatasetMetaPostBodyBody } from '../custom-instance-5c7b6971.js';
3
+ import { a7 as DatasetVersionMetaPostBodyBody, bK as customInstance, bw as DatasetMetaGetResponse, bL as ErrorType, bG as DmError, a8 as DatasetMetaPostBodyBody } from '../custom-instance-b5dd9223.js';
4
4
  import 'axios';
5
5
 
6
- declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
6
+ type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
7
7
  /**
8
8
  * Update parameters or add new annotations of the specified type(s) and to the metadata for the version of the dataset.
9
9
 
@@ -14,9 +14,9 @@ The annotations are provided in a list in JSON format. For details of the annota
14
14
  * @summary Update Metadata for the Dataset version
15
15
  */
16
16
  declare const addMetadataVersion: (datasetId: string, datasetVersion: number, datasetVersionMetaPostBodyBody: DatasetVersionMetaPostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<DatasetMetaGetResponse>;
17
- declare type AddMetadataVersionMutationResult = NonNullable<Awaited<ReturnType<typeof addMetadataVersion>>>;
18
- declare type AddMetadataVersionMutationBody = DatasetVersionMetaPostBodyBody;
19
- declare type AddMetadataVersionMutationError = ErrorType<DmError | void>;
17
+ type AddMetadataVersionMutationResult = NonNullable<Awaited<ReturnType<typeof addMetadataVersion>>>;
18
+ type AddMetadataVersionMutationBody = DatasetVersionMetaPostBodyBody;
19
+ type AddMetadataVersionMutationError = ErrorType<DmError | void>;
20
20
  declare const useAddMetadataVersion: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
21
21
  mutation?: UseMutationOptions<DatasetMetaGetResponse, TError, {
22
22
  datasetId: string;
@@ -36,8 +36,8 @@ declare const useAddMetadataVersion: <TError = ErrorType<void | DmError>, TConte
36
36
  */
37
37
  declare const getMetadataVersion: (datasetId: string, datasetVersion: number, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<DatasetMetaGetResponse>;
38
38
  declare const getGetMetadataVersionQueryKey: (datasetId: string, datasetVersion: number) => string[];
39
- declare type GetMetadataVersionQueryResult = NonNullable<Awaited<ReturnType<typeof getMetadataVersion>>>;
40
- declare type GetMetadataVersionQueryError = ErrorType<void | DmError>;
39
+ type GetMetadataVersionQueryResult = NonNullable<Awaited<ReturnType<typeof getMetadataVersion>>>;
40
+ type GetMetadataVersionQueryError = ErrorType<void | DmError>;
41
41
  declare const useGetMetadataVersion: <TData = DatasetMetaGetResponse, TError = ErrorType<void | DmError>>(datasetId: string, datasetVersion: number, options?: {
42
42
  query?: UseQueryOptions<DatasetMetaGetResponse, TError, TData, QueryKey> | undefined;
43
43
  request?: SecondParameter<typeof customInstance>;
@@ -52,9 +52,9 @@ The labels are provided in a list in JSON format. For details of the label forma
52
52
  * @summary Update Metadata for the Dataset
53
53
  */
54
54
  declare const addMetadata: (datasetId: string, datasetMetaPostBodyBody: DatasetMetaPostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<DatasetMetaGetResponse>;
55
- declare type AddMetadataMutationResult = NonNullable<Awaited<ReturnType<typeof addMetadata>>>;
56
- declare type AddMetadataMutationBody = DatasetMetaPostBodyBody;
57
- declare type AddMetadataMutationError = ErrorType<DmError | void>;
55
+ type AddMetadataMutationResult = NonNullable<Awaited<ReturnType<typeof addMetadata>>>;
56
+ type AddMetadataMutationBody = DatasetMetaPostBodyBody;
57
+ type AddMetadataMutationError = ErrorType<DmError | void>;
58
58
  declare const useAddMetadata: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
59
59
  mutation?: UseMutationOptions<DatasetMetaGetResponse, TError, {
60
60
  datasetId: string;
@@ -72,8 +72,8 @@ declare const useAddMetadata: <TError = ErrorType<void | DmError>, TContext = un
72
72
  */
73
73
  declare const getMetadata: (datasetId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<DatasetMetaGetResponse>;
74
74
  declare const getGetMetadataQueryKey: (datasetId: string) => string[];
75
- declare type GetMetadataQueryResult = NonNullable<Awaited<ReturnType<typeof getMetadata>>>;
76
- declare type GetMetadataQueryError = ErrorType<void | DmError>;
75
+ type GetMetadataQueryResult = NonNullable<Awaited<ReturnType<typeof getMetadata>>>;
76
+ type GetMetadataQueryError = ErrorType<void | DmError>;
77
77
  declare const useGetMetadata: <TData = DatasetMetaGetResponse, TError = ErrorType<void | DmError>>(datasetId: string, options?: {
78
78
  query?: UseQueryOptions<DatasetMetaGetResponse, TError, TData, QueryKey> | undefined;
79
79
  request?: SecondParameter<typeof customInstance>;
@@ -1,6 +1,9 @@
1
+ import {
2
+ queryMutator
3
+ } from "../chunk-LT4O36DN.js";
1
4
  import {
2
5
  customInstance
3
- } from "../chunk-3O5KIRV4.js";
6
+ } from "../chunk-3RNIDX7T.js";
4
7
 
5
8
  // src/metadata/metadata.ts
6
9
  import { useQuery, useMutation } from "@tanstack/react-query";
@@ -48,11 +51,9 @@ var useGetMetadataVersion = (datasetId, datasetVersion, options) => {
48
51
  const { query: queryOptions, request: requestOptions } = options ?? {};
49
52
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetMetadataVersionQueryKey(datasetId, datasetVersion);
50
53
  const queryFn = ({ signal }) => getMetadataVersion(datasetId, datasetVersion, requestOptions, signal);
51
- const query = useQuery(queryKey, queryFn, {
52
- enabled: !!(datasetId && datasetVersion),
53
- ...queryOptions
54
- });
55
- query.queryKey = queryKey;
54
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
55
+ const query = useQuery(customOptions);
56
+ query.queryKey = customOptions.queryKey;
56
57
  return query;
57
58
  };
58
59
  var addMetadata = (datasetId, datasetMetaPostBodyBody, options) => {
@@ -96,11 +97,9 @@ var useGetMetadata = (datasetId, options) => {
96
97
  const queryFn = ({
97
98
  signal
98
99
  }) => getMetadata(datasetId, requestOptions, signal);
99
- const query = useQuery(queryKey, queryFn, {
100
- enabled: !!datasetId,
101
- ...queryOptions
102
- });
103
- query.queryKey = queryKey;
100
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
101
+ const query = useQuery(customOptions);
102
+ query.queryKey = customOptions.queryKey;
104
103
  return query;
105
104
  };
106
105
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/metadata/metadata.ts"],"sourcesContent":["/**\n * Generated by orval v6.10.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n DatasetMetaGetResponse,\n DmError,\n DatasetVersionMetaPostBodyBody,\n DatasetMetaPostBodyBody,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Update parameters or add new annotations of the specified type(s) and to the metadata for the version of the dataset.\n\nThe parameters are provided in a list in keyword/arguments\n\nThe annotations are provided in a list in JSON format. For details of the annotations that can be created, see the data-manager-metadata library.\n\n * @summary Update Metadata for the Dataset version\n */\nexport const addMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n datasetVersionMetaPostBodyBody: DatasetVersionMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetVersionMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\n \"meta_properties\",\n datasetVersionMetaPostBodyBody.meta_properties\n );\n }\n if (datasetVersionMetaPostBodyBody.annotations !== undefined) {\n formData.append(\"annotations\", datasetVersionMetaPostBodyBody.annotations);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AddMetadataVersionMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadataVersion>>\n>;\nexport type AddMetadataVersionMutationBody = DatasetVersionMetaPostBodyBody;\nexport type AddMetadataVersionMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadataVersion = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n }\n > = (props) => {\n const { datasetId, datasetVersion, data } = props ?? {};\n\n return addMetadataVersion(datasetId, datasetVersion, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns the metadata for a Dataset version in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset version\n */\nexport const getMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetMetadataVersionQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/meta/${datasetVersion}`];\n\nexport type GetMetadataVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadataVersion>>\n>;\nexport type GetMetadataVersionQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadataVersion = <\n TData = Awaited<ReturnType<typeof getMetadataVersion>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getGetMetadataVersionQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getMetadataVersion>>\n > = ({ signal }) =>\n getMetadataVersion(datasetId, datasetVersion, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!(datasetId && datasetVersion),\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Update default parameters or add new labels to the metadata for the dataset.\nThe parameters are provided in a list in keyword/arguments\nThe labels are provided in a list in JSON format. For details of the label format, see the data-manager-metadata library,\n\n * @summary Update Metadata for the Dataset\n */\nexport const addMetadata = (\n datasetId: string,\n datasetMetaPostBodyBody: DatasetMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\"meta_properties\", datasetMetaPostBodyBody.meta_properties);\n }\n if (datasetMetaPostBodyBody.labels !== undefined) {\n formData.append(\"labels\", datasetMetaPostBodyBody.labels);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AddMetadataMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadata>>\n>;\nexport type AddMetadataMutationBody = DatasetMetaPostBodyBody;\nexport type AddMetadataMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadata = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addMetadata>>,\n { datasetId: string; data: DatasetMetaPostBodyBody }\n > = (props) => {\n const { datasetId, data } = props ?? {};\n\n return addMetadata(datasetId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns the metadata for a Dataset in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset\n */\nexport const getMetadata = (\n datasetId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n { url: `/dataset/${datasetId}/meta`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetMetadataQueryKey = (datasetId: string) => [\n `/dataset/${datasetId}/meta`,\n];\n\nexport type GetMetadataQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadata>>\n>;\nexport type GetMetadataQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadata = <\n TData = Awaited<ReturnType<typeof getMetadata>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadata>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadata>>> = ({\n signal,\n }) => getMetadata(datasetId, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getMetadata>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!datasetId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { query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AA,EACF,MAAM,YAAY,WAAW,gBAAgB,MAAM;AAEnD,QAAM,QAAQ,SAIZ,UAAU,SAAS;AAAA,IACnB,SAAS,CAAC,CAAC;AAAA,IACX,GAAG;AAAA,EACL,CAAC;AAED,QAAM,WAAW;AAEjB,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/metadata/metadata.ts"],"sourcesContent":["/**\n * Generated by orval v6.12.1 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n DatasetMetaGetResponse,\n DmError,\n DatasetVersionMetaPostBodyBody,\n DatasetMetaPostBodyBody,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././queryMutator\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Update parameters or add new annotations of the specified type(s) and to the metadata for the version of the dataset.\n\nThe parameters are provided in a list in keyword/arguments\n\nThe annotations are provided in a list in JSON format. For details of the annotations that can be created, see the data-manager-metadata library.\n\n * @summary Update Metadata for the Dataset version\n */\nexport const addMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n datasetVersionMetaPostBodyBody: DatasetVersionMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetVersionMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\n \"meta_properties\",\n datasetVersionMetaPostBodyBody.meta_properties\n );\n }\n if (datasetVersionMetaPostBodyBody.annotations !== undefined) {\n formData.append(\"annotations\", datasetVersionMetaPostBodyBody.annotations);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AddMetadataVersionMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadataVersion>>\n>;\nexport type AddMetadataVersionMutationBody = DatasetVersionMetaPostBodyBody;\nexport type AddMetadataVersionMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadataVersion = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n }\n > = (props) => {\n const { datasetId, datasetVersion, data } = props ?? {};\n\n return addMetadataVersion(datasetId, datasetVersion, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addMetadataVersion>>,\n TError,\n {\n datasetId: string;\n datasetVersion: number;\n data: DatasetVersionMetaPostBodyBody;\n },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns the metadata for a Dataset version in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset version\n */\nexport const getMetadataVersion = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta/${datasetVersion}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetMetadataVersionQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/meta/${datasetVersion}`];\n\nexport type GetMetadataVersionQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadataVersion>>\n>;\nexport type GetMetadataVersionQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadataVersion = <\n TData = Awaited<ReturnType<typeof getMetadataVersion>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getGetMetadataVersionQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getMetadataVersion>>\n > = ({ signal }) =>\n getMetadataVersion(datasetId, datasetVersion, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getMetadataVersion>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Update default parameters or add new labels to the metadata for the dataset.\nThe parameters are provided in a list in keyword/arguments\nThe labels are provided in a list in JSON format. For details of the label format, see the data-manager-metadata library,\n\n * @summary Update Metadata for the Dataset\n */\nexport const addMetadata = (\n datasetId: string,\n datasetMetaPostBodyBody: DatasetMetaPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (datasetMetaPostBodyBody.meta_properties !== undefined) {\n formData.append(\"meta_properties\", datasetMetaPostBodyBody.meta_properties);\n }\n if (datasetMetaPostBodyBody.labels !== undefined) {\n formData.append(\"labels\", datasetMetaPostBodyBody.labels);\n }\n\n return customInstance<DatasetMetaGetResponse>(\n {\n url: `/dataset/${datasetId}/meta`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AddMetadataMutationResult = NonNullable<\n Awaited<ReturnType<typeof addMetadata>>\n>;\nexport type AddMetadataMutationBody = DatasetMetaPostBodyBody;\nexport type AddMetadataMutationError = ErrorType<DmError | void>;\n\nexport const useAddMetadata = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addMetadata>>,\n { datasetId: string; data: DatasetMetaPostBodyBody }\n > = (props) => {\n const { datasetId, data } = props ?? {};\n\n return addMetadata(datasetId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addMetadata>>,\n TError,\n { datasetId: string; data: DatasetMetaPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns the metadata for a Dataset in JSON format.\n\n * @summary Gets the Metadata for a specific Dataset\n */\nexport const getMetadata = (\n datasetId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetMetaGetResponse>(\n { url: `/dataset/${datasetId}/meta`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetMetadataQueryKey = (datasetId: string) => [\n `/dataset/${datasetId}/meta`,\n];\n\nexport type GetMetadataQueryResult = NonNullable<\n Awaited<ReturnType<typeof getMetadata>>\n>;\nexport type GetMetadataQueryError = ErrorType<void | DmError>;\n\nexport const useGetMetadata = <\n TData = Awaited<ReturnType<typeof getMetadata>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getMetadata>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetMetadataQueryKey(datasetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getMetadata>>> = ({\n signal,\n }) => getMetadata(datasetId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getMetadata>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;;;;AAUA,SAAS,UAAU,mBAAmB;AAoC/B,IAAM,qBAAqB,CAChC,WACA,gBACA,gCACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,MAAI,+BAA+B,oBAAoB,QAAW;AAChE,aAAS;AAAA,MACP;AAAA,MACA,+BAA+B;AAAA,IACjC;AAAA,EACF;AACA,MAAI,+BAA+B,gBAAgB,QAAW;AAC5D,aAAS,OAAO,eAAe,+BAA+B,WAAW;AAAA,EAC3E;AAEA,SAAO;AAAA,IACL;AAAA,MACE,KAAK,YAAY,kBAAkB;AAAA,MACnC,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,MACjD,MAAM;AAAA,IACR;AAAA,IACA;AAAA,EACF;AACF;AAQO,IAAM,wBAAwB,CAGnC,YAYI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAOF,CAAC,UAAU;AACb,UAAM,EAAE,WAAW,gBAAgB,KAAK,IAAI,SAAS,CAAC;AAEtD,WAAO,mBAAmB,WAAW,gBAAgB,MAAM,cAAc;AAAA,EAC3E;AAEA,SAAO,YASL,YAAY,eAAe;AAC/B;AAMO,IAAM,qBAAqB,CAChC,WACA,gBACA,SACA,WACG;AACH,SAAO;AAAA,IACL;AAAA,MACE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WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,YAAY,kBAAkB,QAAQ,OAAO,OAAO;AAAA,IAC3D;AAAA,EACF;AACF;AAEO,IAAM,yBAAyB,CAAC,cAAsB;AAAA,EAC3D,YAAY;AACd;AAOO,IAAM,iBAAiB,CAI5B,WACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,uBAAuB,SAAS;AAE3E,QAAM,UAAkE,CAAC;AAAA,IACvE;AAAA,EACF,MAAM,YAAY,WAAW,gBAAgB,MAAM;AAEnD,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ,SAIZ,aAAa;AAEf,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;","names":[]}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.1.0",
2
+ "version": "1.1.1",
3
3
  "author": "Oliver Dudgeon",
4
4
  "name": "@squonk/data-manager-client",
5
5
  "private": false,
@@ -15,21 +15,21 @@
15
15
  "build": "tsup && node setup-entrypoints.js"
16
16
  },
17
17
  "devDependencies": {
18
- "@tanstack/react-query": "4.12.0",
19
- "@typescript-eslint/eslint-plugin": "5.37.0",
20
- "axios": "0.27.2",
21
- "eslint": "8.23.1",
18
+ "@tanstack/react-query": "4.26.1",
19
+ "@typescript-eslint/eslint-plugin": "5.54.1",
20
+ "axios": "1.3.4",
21
+ "eslint": "8.35.0",
22
22
  "eslint-plugin-prettier": "4.2.1",
23
23
  "js-yaml": "4.1.0",
24
- "orval": "6.10.0",
25
- "prettier": "2.7.1",
26
- "tslib": "2.4.0",
27
- "tsup": "6.2.3",
28
- "typescript": "4.8.3"
24
+ "orval": "6.12.1",
25
+ "prettier": "2.8.4",
26
+ "tslib": "2.5.0",
27
+ "tsup": "6.6.3",
28
+ "typescript": "4.9.5"
29
29
  },
30
30
  "peerDependencies": {
31
- "axios": ">=0.23",
32
- "@tanstack/react-query": ">=4"
31
+ "@tanstack/react-query": ">=4",
32
+ "axios": ">=0.23"
33
33
  },
34
34
  "module": "./index.js",
35
35
  "main": "./index.cjs",
@@ -1,11 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkIUEU2LYCcjs = require('../chunk-IUEU2LYC.cjs');
3
+ var _chunkLNYWU37Bcjs = require('../chunk-LNYWU37B.cjs');
4
+
5
+
6
+ var _chunkUZTHSGDTcjs = require('../chunk-UZTHSGDT.cjs');
4
7
 
5
8
  // src/project/project.ts
6
9
  var _reactquery = require('@tanstack/react-query');
7
10
  var getProjects = (options, signal) => {
8
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
11
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
9
12
  { url: `/project`, method: "get", signal },
10
13
  options
11
14
  );
@@ -17,8 +20,9 @@ var useGetProjects = (options) => {
17
20
  const queryFn = ({
18
21
  signal
19
22
  }) => getProjects(requestOptions, signal);
20
- const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
21
- query.queryKey = queryKey;
23
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
24
+ const query = _reactquery.useQuery.call(void 0, customOptions);
25
+ query.queryKey = customOptions.queryKey;
22
26
  return query;
23
27
  };
24
28
  var createProject = (projectPostBodyBody, options) => {
@@ -28,7 +32,7 @@ var createProject = (projectPostBodyBody, options) => {
28
32
  formData.append("private", projectPostBodyBody.private.toString());
29
33
  }
30
34
  formData.append("tier_product_id", projectPostBodyBody.tier_product_id);
31
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
35
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
32
36
  {
33
37
  url: `/project`,
34
38
  method: "post",
@@ -47,7 +51,7 @@ var useCreateProject = (options) => {
47
51
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
48
52
  };
49
53
  var getProject = (projectId, options, signal) => {
50
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
54
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
51
55
  { url: `/project/${projectId}`, method: "get", signal },
52
56
  options
53
57
  );
@@ -61,12 +65,11 @@ var useGetProject = (projectId, options) => {
61
65
  const queryFn = ({
62
66
  signal
63
67
  }) => getProject(projectId, requestOptions, signal);
68
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
64
69
  const query = _reactquery.useQuery.call(void 0,
65
- queryKey,
66
- queryFn,
67
- { enabled: !!projectId, ...queryOptions }
70
+ customOptions
68
71
  );
69
- query.queryKey = queryKey;
72
+ query.queryKey = customOptions.queryKey;
70
73
  return query;
71
74
  };
72
75
  var patchProject = (projectId, projectPatchBodyBody, options) => {
@@ -77,7 +80,7 @@ var patchProject = (projectId, projectPatchBodyBody, options) => {
77
80
  if (projectPatchBodyBody.name !== void 0) {
78
81
  formData.append("name", projectPatchBodyBody.name);
79
82
  }
80
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
83
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
81
84
  {
82
85
  url: `/project/${projectId}`,
83
86
  method: "patch",
@@ -96,7 +99,7 @@ var usePatchProject = (options) => {
96
99
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
97
100
  };
98
101
  var deleteProject = (projectId, options) => {
99
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
102
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
100
103
  { url: `/project/${projectId}`, method: "delete" },
101
104
  options
102
105
  );
@@ -110,7 +113,7 @@ var useDeleteProject = (options) => {
110
113
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
111
114
  };
112
115
  var addEditorToProject = (projectId, userId, options) => {
113
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
116
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
114
117
  { url: `/project/${projectId}/editor/${userId}`, method: "put" },
115
118
  options
116
119
  );
@@ -124,7 +127,7 @@ var useAddEditorToProject = (options) => {
124
127
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
125
128
  };
126
129
  var removeEditorFromProject = (projectId, userId, options) => {
127
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
130
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
128
131
  { url: `/project/${projectId}/editor/${userId}`, method: "delete" },
129
132
  options
130
133
  );
@@ -138,7 +141,7 @@ var useRemoveEditorFromProject = (options) => {
138
141
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
139
142
  };
140
143
  var addObserverToProject = (projectId, userId, options) => {
141
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
144
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
142
145
  { url: `/project/${projectId}/observer/${userId}`, method: "put" },
143
146
  options
144
147
  );
@@ -152,7 +155,7 @@ var useAddObserverToProject = (options) => {
152
155
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
153
156
  };
154
157
  var removeObserverFromProject = (projectId, userId, options) => {
155
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
158
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
156
159
  { url: `/project/${projectId}/observer/${userId}`, method: "delete" },
157
160
  options
158
161
  );
@@ -166,7 +169,7 @@ var useRemoveObserverFromProject = (options) => {
166
169
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
167
170
  };
168
171
  var getProjectFile = (projectId, params, options, signal) => {
169
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
172
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
170
173
  { url: `/project/${projectId}/file`, method: "get", params, signal },
171
174
  options
172
175
  );
@@ -178,11 +181,9 @@ var useGetProjectFile = (projectId, params, options) => {
178
181
  const queryFn = ({
179
182
  signal
180
183
  }) => getProjectFile(projectId, params, requestOptions, signal);
181
- const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, {
182
- enabled: !!projectId,
183
- ...queryOptions
184
- });
185
- query.queryKey = queryKey;
184
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
185
+ const query = _reactquery.useQuery.call(void 0, customOptions);
186
+ query.queryKey = customOptions.queryKey;
186
187
  return query;
187
188
  };
188
189
  var addFileToProject = (projectId, projectFilePutBodyBody, options) => {
@@ -194,7 +195,7 @@ var addFileToProject = (projectId, projectFilePutBodyBody, options) => {
194
195
  if (projectFilePutBodyBody.path !== void 0) {
195
196
  formData.append("path", projectFilePutBodyBody.path);
196
197
  }
197
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
198
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
198
199
  {
199
200
  url: `/project/${projectId}/file`,
200
201
  method: "put",
@@ -213,7 +214,7 @@ var useAddFileToProject = (options) => {
213
214
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
214
215
  };
215
216
  var getProjectFileWithToken = (projectId, params, options, signal) => {
216
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
217
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
217
218
  {
218
219
  url: `/project/${projectId}/file-with-token`,
219
220
  method: "get",
@@ -228,11 +229,9 @@ var useGetProjectFileWithToken = (projectId, params, options) => {
228
229
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
229
230
  const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetProjectFileWithTokenQueryKey(projectId, params)));
230
231
  const queryFn = ({ signal }) => getProjectFileWithToken(projectId, params, requestOptions, signal);
231
- const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, {
232
- enabled: !!projectId,
233
- ...queryOptions
234
- });
235
- query.queryKey = queryKey;
232
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
233
+ const query = _reactquery.useQuery.call(void 0, customOptions);
234
+ query.queryKey = customOptions.queryKey;
236
235
  return query;
237
236
  };
238
237
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/project/project.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAqC/B,IAAM,cAAc,CACzB,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,YAAY,QAAQ,OAAO,OAAO;AAAA,IACzC;AAAA,EACF;AACF;AAEO,IAAM,yBAAyB,MAAM,CAAC,UAAU;AAOhD,IAAM,iBAAiB,CAG5B,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,uBAAuB;AAElE,QAAM,UAAkE,CAAC;AAAA,IACvE;AAAA,EACF,MAAM,YAAY,gBAAgB,MAAM;AAExC,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAIjC,QAAM,WAAW;AAEjB,SAAO;AACT;AAaO,IAAM,gBAAgB,CAC3B,qBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,QAAQ,oBAAoB,IAAI;AAChD,MAAI,oBAAoB,YAAY,QAAW;AAC7C,aAAS,OAAO,WAAW,oBAAoB,QAAQ,SAAS,CAAC;AAAA,EACnE;AACA,WAAS,OAAO,mBAAmB,oBAAoB,eAAe;AAEtE,SAAO;AAAA,IACL;AAAA,MACE,KAAK;AAAA,MACL,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,MACjD,MAAM;AAAA,IACR;AAAA,IACA;AAAA,EACF;AACF;AAQO,IAAM,mBAAmB,CAG9B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,KAAK,IAAI,SAAS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B,CAIxC,WACA,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aACd,mCAAmC,WAAW,MAAM;AAEtD,QAAM,UAEF,CAAC,EAAE,OAAO,MACZ,wBAAwB,WAAW,QAAQ,gBAAgB,MAAM;AAEnE,QAAM,QAAQ,SAIZ,UAAU,SAAS;AAAA,IACnB,SAAS,CAAC,CAAC;AAAA,IACX,GAAG;AAAA,EACL,CAAC;AAED,QAAM,WAAW;AAEjB,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.10.0 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n ProjectsGetResponse,\n DmError,\n ProjectPostResponse,\n ProjectPostBodyBody,\n ProjectGetResponse,\n ProjectPatchBodyBody,\n ProjectDeleteResponse,\n GetProjectFileParams,\n ProjectFilePutBodyBody,\n GetProjectFileWithTokenParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Get a list of all Projects available to you.\n\n * @summary Get all Pojects available to you\n */\nexport const getProjects = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProjectsGetResponse>(\n { url: `/project`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProjectsQueryKey = () => [`/project`];\n\nexport type GetProjectsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjects>>\n>;\nexport type GetProjectsQueryError = ErrorType<void | DmError>;\n\nexport const useGetProjects = <\n TData = Awaited<ReturnType<typeof getProjects>>,\n TError = ErrorType<void | DmError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjects>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjects>>> = ({\n signal,\n }) => getProjects(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProjects>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Creates a new Project, assigning and returning a unique **ID**. A persistent volume is created in the cluster and assigned to your Project. It's here you can add **Datasets** as **Files** and run **Applications** and **Jobs**.\n\nTo create a Project you will need an uncommitted Project product.\n\nAs the project `owner` (creator) you are also automatically an `editor` of the project and can add other users as editors so that they can also manipulate the project. An `editor` of a project can also delete it.\n\nThe name you give the project is free-form text (can contain spaces etc.). The name you use must be unique amongst all the projects you create.\n\n * @summary Create a new Project\n */\nexport const createProject = (\n projectPostBodyBody: ProjectPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"name\", projectPostBodyBody.name);\n if (projectPostBodyBody.private !== undefined) {\n formData.append(\"private\", projectPostBodyBody.private.toString());\n }\n formData.append(\"tier_product_id\", projectPostBodyBody.tier_product_id);\n\n return customInstance<ProjectPostResponse>(\n {\n url: `/project`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof createProject>>\n>;\nexport type CreateProjectMutationBody = ProjectPostBodyBody;\nexport type CreateProjectMutationError = ErrorType<DmError | void>;\n\nexport const useCreateProject = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createProject>>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createProject>>,\n { data: ProjectPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createProject(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createProject>>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the details of a project that is available to you.\n\n * @summary Get a Project\n */\nexport const getProject = (\n projectId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProjectGetResponse>(\n { url: `/project/${projectId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProjectQueryKey = (projectId: string) => [\n `/project/${projectId}`,\n];\n\nexport type GetProjectQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProject>>\n>;\nexport type GetProjectQueryError = ErrorType<void | DmError>;\n\nexport const useGetProject = <\n TData = Awaited<ReturnType<typeof getProject>>,\n TError = ErrorType<void | DmError>\n>(\n projectId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProject>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectQueryKey(projectId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProject>>> = ({\n signal,\n }) => getProject(projectId, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getProject>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!projectId, ...queryOptions }\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Used to update some adjustable parameters of a Project, i.e. to make it Private or make it Public. What can be adjusted will depend on the purchased product\n\n * @summary Adjust an existing Project\n */\nexport const patchProject = (\n projectId: string,\n projectPatchBodyBody: ProjectPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (projectPatchBodyBody.private !== undefined) {\n formData.append(\"private\", projectPatchBodyBody.private.toString());\n }\n if (projectPatchBodyBody.name !== undefined) {\n formData.append(\"name\", projectPatchBodyBody.name);\n }\n\n return customInstance<void>(\n {\n url: `/project/${projectId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type PatchProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchProject>>\n>;\nexport type PatchProjectMutationBody = ProjectPatchBodyBody;\nexport type PatchProjectMutationError = ErrorType<DmError>;\n\nexport const usePatchProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProject>>,\n TError,\n { projectId: string; data: ProjectPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchProject>>,\n { projectId: string; data: ProjectPatchBodyBody }\n > = (props) => {\n const { projectId, data } = props ?? {};\n\n return patchProject(projectId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof patchProject>>,\n TError,\n { projectId: string; data: ProjectPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes an existing project.\n\nYou must be an `editor` or the `owner` of the project.\n\nOnce deleted all **Files**, working directories and material in the project will also be removed\n\n * @summary Delete a Project\n */\nexport const deleteProject = (\n projectId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectDeleteResponse>(\n { url: `/project/${projectId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteProject>>\n>;\n\nexport type DeleteProjectMutationError = ErrorType<void | DmError>;\n\nexport const useDeleteProject = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProject>>,\n TError,\n { projectId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteProject>>,\n { projectId: string }\n > = (props) => {\n const { projectId } = props ?? {};\n\n return deleteProject(projectId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteProject>>,\n TError,\n { projectId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Adds a user to a project as an `editor`. Editors can add and remove datasets in a project and delete the project.\n\nAn `editor` of a project is not automatically an `editor` of any datasets the project contains.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Add a Project Editor\n */\nexport const addEditorToProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/editor/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddEditorToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addEditorToProject>>\n>;\n\nexport type AddEditorToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddEditorToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addEditorToProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return addEditorToProject(projectId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addEditorToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a project `editor`. The editor can be you but you cannot delete the last `editor`\n\nA project must always have one `editor` so you will not be able to delete the last editor of a project.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Delete a Project Editor\n */\nexport const removeEditorFromProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/editor/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type RemoveEditorFromProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeEditorFromProject>>\n>;\n\nexport type RemoveEditorFromProjectMutationError = ErrorType<DmError>;\n\nexport const useRemoveEditorFromProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return removeEditorFromProject(projectId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Adds a user to a project as an `observer`. Observers can view Projects and download files but they cannot modify Project data or run Applications or Jobs.\n\nYou must be an `editor` or the `owner` of the Project to add Observers\n\n * @summary Add a Project Observer\n */\nexport const addObserverToProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/observer/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddObserverToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addObserverToProject>>\n>;\n\nexport type AddObserverToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddObserverToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addObserverToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addObserverToProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return addObserverToProject(projectId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addObserverToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a project `observer`.\n\nYou must be an `editor` or the `owner` of the Project to remove Observers\n\n * @summary Delete a Project Observer\n */\nexport const removeObserverFromProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/observer/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type RemoveObserverFromProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeObserverFromProject>>\n>;\n\nexport type RemoveObserverFromProjectMutationError = ErrorType<DmError>;\n\nexport const useRemoveObserverFromProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeObserverFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof removeObserverFromProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return removeObserverFromProject(projectId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof removeObserverFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * 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).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nYou must be an `editor` or the `owner` of the project if the project is private\n\n * @summary Download a Project file\n */\nexport const getProjectFile = (\n projectId: string,\n params: GetProjectFileParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/file`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetProjectFileQueryKey = (\n projectId: string,\n params: GetProjectFileParams\n) => [`/project/${projectId}/file`, ...(params ? [params] : [])];\n\nexport type GetProjectFileQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjectFile>>\n>;\nexport type GetProjectFileQueryError = ErrorType<DmError>;\n\nexport const useGetProjectFile = <\n TData = Awaited<ReturnType<typeof getProjectFile>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params: GetProjectFileParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFile>>> = ({\n signal,\n }) => getProjectFile(projectId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProjectFile>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!projectId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * The user provides an external file for upload to the Project using an optional Path. The path is created if it does not exist.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Upload a file into a Project\n */\nexport const addFileToProject = (\n projectId: string,\n projectFilePutBodyBody: ProjectFilePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"file\", projectFilePutBodyBody.file);\n if (projectFilePutBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", projectFilePutBodyBody.as_filename);\n }\n if (projectFilePutBodyBody.path !== undefined) {\n formData.append(\"path\", projectFilePutBodyBody.path);\n }\n\n return customInstance<void>(\n {\n url: `/project/${projectId}/file`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AddFileToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addFileToProject>>\n>;\nexport type AddFileToProjectMutationBody = ProjectFilePutBodyBody;\nexport type AddFileToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddFileToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addFileToProject>>,\n TError,\n { projectId: string; data: ProjectFilePutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addFileToProject>>,\n { projectId: string; data: ProjectFilePutBodyBody }\n > = (props) => {\n const { projectId, data } = props ?? {};\n\n return addFileToProject(projectId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addFileToProject>>,\n TError,\n { projectId: string; data: ProjectFilePutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * 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).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nAs there is no security 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. If the token is not valid ou will receive a `403` error\n\n * @summary Download a Project file using a Token\n */\nexport const getProjectFileWithToken = (\n projectId: string,\n params: GetProjectFileWithTokenParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n {\n url: `/project/${projectId}/file-with-token`,\n method: \"get\",\n params,\n signal,\n },\n options\n );\n};\n\nexport const getGetProjectFileWithTokenQueryKey = (\n projectId: string,\n params: GetProjectFileWithTokenParams\n) => [`/project/${projectId}/file-with-token`, ...(params ? [params] : [])];\n\nexport type GetProjectFileWithTokenQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjectFileWithToken>>\n>;\nexport type GetProjectFileWithTokenQueryError = ErrorType<DmError>;\n\nexport const useGetProjectFileWithToken = <\n TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params: GetProjectFileWithTokenParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getGetProjectFileWithTokenQueryKey(projectId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProjectFileWithToken>>\n > = ({ signal }) =>\n getProjectFileWithToken(projectId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!projectId,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"]}
1
+ {"version":3,"sources":["../../src/project/project.ts"],"names":[],"mappings":";;;;;;;;AAUA,SAAS,UAAU,m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D,QAAM,UAEF,CAAC,EAAE,OAAO,MACZ,wBAAwB,WAAW,QAAQ,gBAAgB,MAAM;AAEnE,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ,SAIZ,aAAa;AAEf,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.12.1 🍺\n * Do not edit manually.\n * Dataset Manager API\n * The Dataset Manager API service.\n\nA service that allows *registered* users to make **Datasets** and associated **Metadata** available to **Applications** and **Jobs** using **Projects** and **Files**.\n\n * OpenAPI spec version: 1.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n ProjectsGetResponse,\n DmError,\n ProjectPostResponse,\n ProjectPostBodyBody,\n ProjectGetResponse,\n ProjectPatchBodyBody,\n ProjectDeleteResponse,\n GetProjectFileParams,\n ProjectFilePutBodyBody,\n GetProjectFileWithTokenParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././queryMutator\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Get a list of all Projects available to you.\n\n * @summary Get all Pojects available to you\n */\nexport const getProjects = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProjectsGetResponse>(\n { url: `/project`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProjectsQueryKey = () => [`/project`];\n\nexport type GetProjectsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjects>>\n>;\nexport type GetProjectsQueryError = ErrorType<void | DmError>;\n\nexport const useGetProjects = <\n TData = Awaited<ReturnType<typeof getProjects>>,\n TError = ErrorType<void | DmError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjects>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjects>>> = ({\n signal,\n }) => getProjects(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProjects>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Creates a new Project, assigning and returning a unique **ID**. A persistent volume is created in the cluster and assigned to your Project. It's here you can add **Datasets** as **Files** and run **Applications** and **Jobs**.\n\nTo create a Project you will need an uncommitted Project product.\n\nAs the project `owner` (creator) you are also automatically an `editor` of the project and can add other users as editors so that they can also manipulate the project. An `editor` of a project can also delete it.\n\nThe name you give the project is free-form text (can contain spaces etc.). The name you use must be unique amongst all the projects you create.\n\n * @summary Create a new Project\n */\nexport const createProject = (\n projectPostBodyBody: ProjectPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"name\", projectPostBodyBody.name);\n if (projectPostBodyBody.private !== undefined) {\n formData.append(\"private\", projectPostBodyBody.private.toString());\n }\n formData.append(\"tier_product_id\", projectPostBodyBody.tier_product_id);\n\n return customInstance<ProjectPostResponse>(\n {\n url: `/project`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof createProject>>\n>;\nexport type CreateProjectMutationBody = ProjectPostBodyBody;\nexport type CreateProjectMutationError = ErrorType<DmError | void>;\n\nexport const useCreateProject = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createProject>>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createProject>>,\n { data: ProjectPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createProject(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createProject>>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the details of a project that is available to you.\n\n * @summary Get a Project\n */\nexport const getProject = (\n projectId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProjectGetResponse>(\n { url: `/project/${projectId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProjectQueryKey = (projectId: string) => [\n `/project/${projectId}`,\n];\n\nexport type GetProjectQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProject>>\n>;\nexport type GetProjectQueryError = ErrorType<void | DmError>;\n\nexport const useGetProject = <\n TData = Awaited<ReturnType<typeof getProject>>,\n TError = ErrorType<void | DmError>\n>(\n projectId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProject>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectQueryKey(projectId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProject>>> = ({\n signal,\n }) => getProject(projectId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<Awaited<ReturnType<typeof getProject>>, TError, TData>(\n customOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * Used to update some adjustable parameters of a Project, i.e. to make it Private or make it Public. What can be adjusted will depend on the purchased product\n\n * @summary Adjust an existing Project\n */\nexport const patchProject = (\n projectId: string,\n projectPatchBodyBody: ProjectPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (projectPatchBodyBody.private !== undefined) {\n formData.append(\"private\", projectPatchBodyBody.private.toString());\n }\n if (projectPatchBodyBody.name !== undefined) {\n formData.append(\"name\", projectPatchBodyBody.name);\n }\n\n return customInstance<void>(\n {\n url: `/project/${projectId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type PatchProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchProject>>\n>;\nexport type PatchProjectMutationBody = ProjectPatchBodyBody;\nexport type PatchProjectMutationError = ErrorType<DmError>;\n\nexport const usePatchProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProject>>,\n TError,\n { projectId: string; data: ProjectPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchProject>>,\n { projectId: string; data: ProjectPatchBodyBody }\n > = (props) => {\n const { projectId, data } = props ?? {};\n\n return patchProject(projectId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof patchProject>>,\n TError,\n { projectId: string; data: ProjectPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes an existing project.\n\nYou must be an `editor` or the `owner` of the project.\n\nOnce deleted all **Files**, working directories and material in the project will also be removed\n\n * @summary Delete a Project\n */\nexport const deleteProject = (\n projectId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectDeleteResponse>(\n { url: `/project/${projectId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteProject>>\n>;\n\nexport type DeleteProjectMutationError = ErrorType<void | DmError>;\n\nexport const useDeleteProject = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProject>>,\n TError,\n { projectId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteProject>>,\n { projectId: string }\n > = (props) => {\n const { projectId } = props ?? {};\n\n return deleteProject(projectId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteProject>>,\n TError,\n { projectId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Adds a user to a project as an `editor`. Editors can add and remove datasets in a project and delete the project.\n\nAn `editor` of a project is not automatically an `editor` of any datasets the project contains.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Add a Project Editor\n */\nexport const addEditorToProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/editor/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddEditorToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addEditorToProject>>\n>;\n\nexport type AddEditorToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddEditorToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addEditorToProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return addEditorToProject(projectId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addEditorToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a project `editor`. The editor can be you but you cannot delete the last `editor`\n\nA project must always have one `editor` so you will not be able to delete the last editor of a project.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Delete a Project Editor\n */\nexport const removeEditorFromProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/editor/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type RemoveEditorFromProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeEditorFromProject>>\n>;\n\nexport type RemoveEditorFromProjectMutationError = ErrorType<DmError>;\n\nexport const useRemoveEditorFromProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return removeEditorFromProject(projectId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Adds a user to a project as an `observer`. Observers can view Projects and download files but they cannot modify Project data or run Applications or Jobs.\n\nYou must be an `editor` or the `owner` of the Project to add Observers\n\n * @summary Add a Project Observer\n */\nexport const addObserverToProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/observer/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddObserverToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addObserverToProject>>\n>;\n\nexport type AddObserverToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddObserverToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addObserverToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addObserverToProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return addObserverToProject(projectId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addObserverToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a project `observer`.\n\nYou must be an `editor` or the `owner` of the Project to remove Observers\n\n * @summary Delete a Project Observer\n */\nexport const removeObserverFromProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/observer/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type RemoveObserverFromProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeObserverFromProject>>\n>;\n\nexport type RemoveObserverFromProjectMutationError = ErrorType<DmError>;\n\nexport const useRemoveObserverFromProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeObserverFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof removeObserverFromProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return removeObserverFromProject(projectId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof removeObserverFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * 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).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nYou must be an `editor` or the `owner` of the project if the project is private\n\n * @summary Download a Project file\n */\nexport const getProjectFile = (\n projectId: string,\n params: GetProjectFileParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/file`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetProjectFileQueryKey = (\n projectId: string,\n params: GetProjectFileParams\n) => [`/project/${projectId}/file`, ...(params ? [params] : [])];\n\nexport type GetProjectFileQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjectFile>>\n>;\nexport type GetProjectFileQueryError = ErrorType<DmError>;\n\nexport const useGetProjectFile = <\n TData = Awaited<ReturnType<typeof getProjectFile>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params: GetProjectFileParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFile>>> = ({\n signal,\n }) => getProjectFile(projectId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProjectFile>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n\n/**\n * The user provides an external file for upload to the Project using an optional Path. The path is created if it does not exist.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Upload a file into a Project\n */\nexport const addFileToProject = (\n projectId: string,\n projectFilePutBodyBody: ProjectFilePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"file\", projectFilePutBodyBody.file);\n if (projectFilePutBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", projectFilePutBodyBody.as_filename);\n }\n if (projectFilePutBodyBody.path !== undefined) {\n formData.append(\"path\", projectFilePutBodyBody.path);\n }\n\n return customInstance<void>(\n {\n url: `/project/${projectId}/file`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AddFileToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addFileToProject>>\n>;\nexport type AddFileToProjectMutationBody = ProjectFilePutBodyBody;\nexport type AddFileToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddFileToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addFileToProject>>,\n TError,\n { projectId: string; data: ProjectFilePutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addFileToProject>>,\n { projectId: string; data: ProjectFilePutBodyBody }\n > = (props) => {\n const { projectId, data } = props ?? {};\n\n return addFileToProject(projectId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addFileToProject>>,\n TError,\n { projectId: string; data: ProjectFilePutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * 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).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nAs there is no security 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. If the token is not valid ou will receive a `403` error\n\n * @summary Download a Project file using a Token\n */\nexport const getProjectFileWithToken = (\n projectId: string,\n params: GetProjectFileWithTokenParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n {\n url: `/project/${projectId}/file-with-token`,\n method: \"get\",\n params,\n signal,\n },\n options\n );\n};\n\nexport const getGetProjectFileWithTokenQueryKey = (\n projectId: string,\n params: GetProjectFileWithTokenParams\n) => [`/project/${projectId}/file-with-token`, ...(params ? [params] : [])];\n\nexport type GetProjectFileWithTokenQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjectFileWithToken>>\n>;\nexport type GetProjectFileWithTokenQueryError = ErrorType<DmError>;\n\nexport const useGetProjectFileWithToken = <\n TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params: GetProjectFileWithTokenParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getGetProjectFileWithTokenQueryKey(projectId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProjectFileWithToken>>\n > = ({ signal }) =>\n getProjectFileWithToken(projectId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError,\n TData\n >(customOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n"]}