@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,6 +1,9 @@
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/dataset/dataset.ts
6
9
  var _reactquery = require('@tanstack/react-query');
@@ -28,7 +31,7 @@ var createDatasetFromFile = (datasetPutBodyBody, options) => {
28
31
  if (datasetPutBodyBody.unit_id !== void 0) {
29
32
  formData.append("unit_id", datasetPutBodyBody.unit_id);
30
33
  }
31
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
34
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
32
35
  {
33
36
  url: `/dataset`,
34
37
  method: "put",
@@ -69,7 +72,7 @@ var uploadDataset = (datasetPostBodyBody, options) => {
69
72
  formData.append("dataset_id", datasetPostBodyBody.dataset_id);
70
73
  }
71
74
  formData.append("unit_id", datasetPostBodyBody.unit_id);
72
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
75
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
73
76
  {
74
77
  url: `/dataset`,
75
78
  method: "post",
@@ -88,7 +91,7 @@ var useUploadDataset = (options) => {
88
91
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
89
92
  };
90
93
  var getDatasets = (params, options, signal) => {
91
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
94
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
92
95
  { url: `/dataset`, method: "get", params, signal },
93
96
  options
94
97
  );
@@ -103,12 +106,13 @@ var useGetDatasets = (params, options) => {
103
106
  const queryFn = ({
104
107
  signal
105
108
  }) => getDatasets(params, requestOptions, signal);
106
- const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
107
- query.queryKey = queryKey;
109
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
110
+ const query = _reactquery.useQuery.call(void 0, customOptions);
111
+ query.queryKey = customOptions.queryKey;
108
112
  return query;
109
113
  };
110
114
  var getVersions = (datasetId, params, options, signal) => {
111
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
115
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
112
116
  { url: `/dataset/${datasetId}/versions`, method: "get", params, signal },
113
117
  options
114
118
  );
@@ -120,15 +124,13 @@ var useGetVersions = (datasetId, params, options) => {
120
124
  const queryFn = ({
121
125
  signal
122
126
  }) => getVersions(datasetId, params, requestOptions, signal);
123
- const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, {
124
- enabled: !!datasetId,
125
- ...queryOptions
126
- });
127
- query.queryKey = queryKey;
127
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
128
+ const query = _reactquery.useQuery.call(void 0, customOptions);
129
+ query.queryKey = customOptions.queryKey;
128
130
  return query;
129
131
  };
130
132
  var deleteDataset = (datasetId, datasetVersion, params, options) => {
131
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
133
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
132
134
  {
133
135
  url: `/dataset/${datasetId}/${datasetVersion}`,
134
136
  method: "delete",
@@ -146,7 +148,7 @@ var useDeleteDataset = (options) => {
146
148
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
147
149
  };
148
150
  var downloadDataset = (datasetId, datasetVersion, options, signal) => {
149
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
151
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
150
152
  { url: `/dataset/${datasetId}/${datasetVersion}`, method: "get", signal },
151
153
  options
152
154
  );
@@ -158,15 +160,13 @@ var useDownloadDataset = (datasetId, datasetVersion, options) => {
158
160
  const queryFn = ({
159
161
  signal
160
162
  }) => downloadDataset(datasetId, datasetVersion, requestOptions, signal);
161
- const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, {
162
- enabled: !!(datasetId && datasetVersion),
163
- ...queryOptions
164
- });
165
- query.queryKey = queryKey;
163
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
164
+ const query = _reactquery.useQuery.call(void 0, customOptions);
165
+ query.queryKey = customOptions.queryKey;
166
166
  return query;
167
167
  };
168
168
  var removeEditorFromDataset = (datasetId, userId, options) => {
169
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
169
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
170
170
  { url: `/dataset/${datasetId}/editor/${userId}`, method: "delete" },
171
171
  options
172
172
  );
@@ -180,7 +180,7 @@ var useRemoveEditorFromDataset = (options) => {
180
180
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
181
181
  };
182
182
  var addEditorToDataset = (datasetId, userId, options) => {
183
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
183
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
184
184
  { url: `/dataset/${datasetId}/editor/${userId}`, method: "put" },
185
185
  options
186
186
  );
@@ -194,7 +194,7 @@ var useAddEditorToDataset = (options) => {
194
194
  return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
195
195
  };
196
196
  var getDatasetDigest = (datasetDigest, options, signal) => {
197
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
197
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
198
198
  { url: `/dataset/digest/${datasetDigest}`, method: "get", signal },
199
199
  options
200
200
  );
@@ -206,15 +206,13 @@ var useGetDatasetDigest = (datasetDigest, options) => {
206
206
  const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
207
207
  const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetDatasetDigestQueryKey(datasetDigest)));
208
208
  const queryFn = ({ signal }) => getDatasetDigest(datasetDigest, requestOptions, signal);
209
- const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, {
210
- enabled: !!datasetDigest,
211
- ...queryOptions
212
- });
213
- query.queryKey = queryKey;
209
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
210
+ const query = _reactquery.useQuery.call(void 0, customOptions);
211
+ query.queryKey = customOptions.queryKey;
214
212
  return query;
215
213
  };
216
214
  var getSchema = (datasetId, datasetVersion, options, signal) => {
217
- return _chunkIUEU2LYCcjs.customInstance.call(void 0,
215
+ return _chunkUZTHSGDTcjs.customInstance.call(void 0,
218
216
  {
219
217
  url: `/dataset/${datasetId}/schema/${datasetVersion}`,
220
218
  method: "get",
@@ -230,12 +228,11 @@ var useGetSchema = (datasetId, datasetVersion, options) => {
230
228
  const queryFn = ({
231
229
  signal
232
230
  }) => getSchema(datasetId, datasetVersion, requestOptions, signal);
231
+ const customOptions = _chunkLNYWU37Bcjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
233
232
  const query = _reactquery.useQuery.call(void 0,
234
- queryKey,
235
- queryFn,
236
- { enabled: !!(datasetId && datasetVersion), ...queryOptions }
233
+ customOptions
237
234
  );
238
- query.queryKey = queryKey;
235
+ query.queryKey = customOptions.queryKey;
239
236
  return query;
240
237
  };
241
238
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/dataset/dataset.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AA2C/B,IAAM,wBAAwB,CACnC,oBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,gBAAgB,mBAAmB,YAAY;AAC/D,MAAI,m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ataset 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 DatasetPutPostResponse,\n DmError,\n DatasetPutBodyBody,\n DatasetPostBodyBody,\n DatasetsGetResponse,\n GetDatasetsParams,\n DatasetVersionsGetResponse,\n GetVersionsParams,\n DatasetVersionDeleteResponse,\n DeleteDatasetParams,\n DatasetDigestGetResponse,\n DatasetSchemaGetResponse,\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 * Using an unmanaged file in a Project as a source a Dataset (or new Dataset version) is created.\n\nThe dataset is assigned a unique identity if it has no **Parent**. If a Parent dataset is named during the upload the uploaded file inherits the Parent's identity and is issued with a new unique version number within the Dataset.\n\nBehaves like the corresponding **POST** method except the file is expected to exist on a Project path.\n\n * @summary Create a Dataset from a file in a Project\n */\nexport const createDatasetFromFile = (\n datasetPutBodyBody: DatasetPutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_type\", datasetPutBodyBody.dataset_type);\n if (datasetPutBodyBody.format_extra_variables !== undefined) {\n formData.append(\n \"format_extra_variables\",\n datasetPutBodyBody.format_extra_variables\n );\n }\n if (datasetPutBodyBody.skip_molecule_load !== undefined) {\n formData.append(\n \"skip_molecule_load\",\n datasetPutBodyBody.skip_molecule_load.toString()\n );\n }\n formData.append(\"project_id\", datasetPutBodyBody.project_id);\n formData.append(\"path\", datasetPutBodyBody.path);\n formData.append(\"file_name\", datasetPutBodyBody.file_name);\n if (datasetPutBodyBody.dataset_id !== undefined) {\n formData.append(\"dataset_id\", datasetPutBodyBody.dataset_id);\n }\n if (datasetPutBodyBody.unit_id !== undefined) {\n formData.append(\"unit_id\", datasetPutBodyBody.unit_id);\n }\n\n return customInstance<DatasetPutPostResponse>(\n {\n url: `/dataset`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateDatasetFromFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof createDatasetFromFile>>\n>;\nexport type CreateDatasetFromFileMutationBody = DatasetPutBodyBody;\nexport type CreateDatasetFromFileMutationError = ErrorType<void | DmError>;\n\nexport const useCreateDatasetFromFile = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n TError,\n { data: DatasetPutBodyBody },\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 createDatasetFromFile>>,\n { data: DatasetPutBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createDatasetFromFile(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n TError,\n { data: DatasetPutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Uploads a dataset.\n\nDataset file-naming is strictly limited to a fixed set of extensions based on the Dataset **Type**. You can obtain the supported types (and their extensions) via the **\\/type** endpoint. Filenames that do not comply with the supported filename extensions will be rejected.\n\nDatasets can be uploaded in an uncompressed form, or uploaded pre-compressed using the `.gz` extension.\n\nThe dataset is assigned a unique identity if it has no **Parent**. If a Parent dataset is named during the upload the uploaded file inherits the Parent's identity and is issued with a new unique version number within the Dataset.\n\nDatasets undergo some processing in an asynchronous `task` after control returns to you. The unique identity of the assigned task (the `task id`) is presented to you in this endpoint's response. Before you can use an uploaded dataset, and before the dataset can be added to any pre-assigned projects, you must wait until the task is complete by making regular calls to the **\\/task/{task-id}** endpoint. A Dataset upload is complete when the corresponding `task.done` is **true** along with a `task.exit_code` of **0**. If the Dataset upload fails `task.done` will be **true** but the `task.exit_code` will be non-zero.\n\n * @summary Upload an external file as a Dataset\n */\nexport const uploadDataset = (\n datasetPostBodyBody: DatasetPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_file\", datasetPostBodyBody.dataset_file);\n formData.append(\"dataset_type\", datasetPostBodyBody.dataset_type);\n if (datasetPostBodyBody.format_extra_variables !== undefined) {\n formData.append(\n \"format_extra_variables\",\n datasetPostBodyBody.format_extra_variables\n );\n }\n if (datasetPostBodyBody.skip_molecule_load !== undefined) {\n formData.append(\n \"skip_molecule_load\",\n datasetPostBodyBody.skip_molecule_load.toString()\n );\n }\n if (datasetPostBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", datasetPostBodyBody.as_filename);\n }\n if (datasetPostBodyBody.dataset_id !== undefined) {\n formData.append(\"dataset_id\", datasetPostBodyBody.dataset_id);\n }\n formData.append(\"unit_id\", datasetPostBodyBody.unit_id);\n\n return customInstance<DatasetPutPostResponse>(\n {\n url: `/dataset`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type UploadDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof uploadDataset>>\n>;\nexport type UploadDatasetMutationBody = DatasetPostBodyBody;\nexport type UploadDatasetMutationError = ErrorType<void | DmError>;\n\nexport const useUploadDataset = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof uploadDataset>>,\n TError,\n { data: DatasetPostBodyBody },\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 uploadDataset>>,\n { data: DatasetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return uploadDataset(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof uploadDataset>>,\n TError,\n { data: DatasetPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns datasets that you have access to, whether attached to a project or not.\n\nYou will not see Datasets while their upload is still in progress.\n\nDatasets can be filtered by: 1. `owner username`, 2. `mime_type`, 3. a list of `owners` (a subset of the above) 4. a list of `editors` (a subset of the above) 5. `Labels` or `Label/Value` pairs (a subset of the above)\n\nNote that if `editors` are combined with `owner username`, then the datasets will be filtered by owner username first followed by editors (so it's an AND). If `editors` are combined with `owners`, then the result will be datasets filtered by a combination of owners OR editors.\n\n * @summary Get Datasets that are available to you\n */\nexport const getDatasets = (\n params?: GetDatasetsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetsGetResponse>(\n { url: `/dataset`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetDatasetsQueryKey = (params?: GetDatasetsParams) => [\n `/dataset`,\n ...(params ? [params] : []),\n];\n\nexport type GetDatasetsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDatasets>>\n>;\nexport type GetDatasetsQueryError = ErrorType<void | DmError>;\n\nexport const useGetDatasets = <\n TData = Awaited<ReturnType<typeof getDatasets>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetDatasetsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getDatasets>>,\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 ?? getGetDatasetsQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getDatasets>>> = ({\n signal,\n }) => getDatasets(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getDatasets>>,\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 * Returns a list of Dataset versions.\n\nYou will not see Datasets while their upload is still in progress.\n\n * @summary Gets all the versions of a specific Dataset\n */\nexport const getVersions = (\n datasetId: string,\n params?: GetVersionsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetVersionsGetResponse>(\n { url: `/dataset/${datasetId}/versions`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetVersionsQueryKey = (\n datasetId: string,\n params?: GetVersionsParams\n) => [`/dataset/${datasetId}/versions`, ...(params ? [params] : [])];\n\nexport type GetVersionsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getVersions>>\n>;\nexport type GetVersionsQueryError = ErrorType<void | DmError>;\n\nexport const useGetVersions = <\n TData = Awaited<ReturnType<typeof getVersions>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n params?: GetVersionsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getVersions>>,\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 ?? getGetVersionsQueryKey(datasetId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getVersions>>> = ({\n signal,\n }) => getVersions(datasetId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getVersions>>,\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\n/**\n * Given the Dataset `id` and `version` the Dataset will be removed. The API does not prevent you removing a Dataset that's been used in a **Project**. When removed using this endpoint the Dataset is automatically detached from any and all Projects that it was attached to and any corresponding Project Files relating to the Dataset are also removed.\n\nYou must be an `editor` or `owner` of the Dataset.\n\nYou cannot delete a Dataset until its upload is complete.\n\n * @summary Delete a Dataset\n */\nexport const deleteDataset = (\n datasetId: string,\n datasetVersion: number,\n params?: DeleteDatasetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<DatasetVersionDeleteResponse>(\n {\n url: `/dataset/${datasetId}/${datasetVersion}`,\n method: \"delete\",\n params,\n },\n options\n );\n};\n\nexport type DeleteDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteDataset>>\n>;\n\nexport type DeleteDatasetMutationError = ErrorType<void | DmError>;\n\nexport const useDeleteDataset = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteDataset>>,\n TError,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },\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 deleteDataset>>,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams }\n > = (props) => {\n const { datasetId, datasetVersion, params } = props ?? {};\n\n return deleteDataset(datasetId, datasetVersion, params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteDataset>>,\n TError,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Given a `dataset_id` the dataset will be returned if available.\n\nYou cannot get a Dataset until its upload is complete.\n\n * @summary Download a Dataset\n */\nexport const downloadDataset = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/${datasetVersion}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getDownloadDatasetQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/${datasetVersion}`];\n\nexport type DownloadDatasetQueryResult = NonNullable<\n Awaited<ReturnType<typeof downloadDataset>>\n>;\nexport type DownloadDatasetQueryError = ErrorType<DmError>;\n\nexport const useDownloadDataset = <\n TData = Awaited<ReturnType<typeof downloadDataset>>,\n TError = ErrorType<DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadDataset>>,\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 getDownloadDatasetQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadDataset>>> = ({\n signal,\n }) => downloadDataset(datasetId, datasetVersion, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof downloadDataset>>,\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 * The user is removed from the Dataset's `editor` list. The user is removed from all versions of a dataset. You can remove yourself but an `owner` (creator) will always have access to the dataset.\n\nYou must be an `editor` or `owner` of the dataset.\n\nYou cannot modify Dataset editors until its upload is complete.\n\n * @summary Remove a user's edit permission for a Dataset\n */\nexport const removeEditorFromDataset = (\n datasetId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/editor/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type RemoveEditorFromDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeEditorFromDataset>>\n>;\n\nexport type RemoveEditorFromDatasetMutationError = ErrorType<DmError>;\n\nexport const useRemoveEditorFromDataset = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n TError,\n { datasetId: 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 removeEditorFromDataset>>,\n { datasetId: string; userId: string }\n > = (props) => {\n const { datasetId, userId } = props ?? {};\n\n return removeEditorFromDataset(datasetId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * The user is added to the dataset's editor list. The dataset `owner` is automatically an editor and so does not need to be added as an `editor`.\n\nYou must be an `editor` or `owner` of the dataset.\n\nYou cannot modify Dataset editors until its upload is complete.\n\n * @summary Give a user edit permission for a Dataset\n */\nexport const addEditorToDataset = (\n datasetId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/editor/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddEditorToDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof addEditorToDataset>>\n>;\n\nexport type AddEditorToDatasetMutationError = ErrorType<DmError>;\n\nexport const useAddEditorToDataset = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n TError,\n { datasetId: 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 addEditorToDataset>>,\n { datasetId: string; userId: string }\n > = (props) => {\n const { datasetId, userId } = props ?? {};\n\n return addEditorToDataset(datasetId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns a dataset ID and version of a dataset that matches the provided SHA256 digest, a 64-character hex string.\n\n * @summary Gets the first Dataset that matches the provided digest\n */\nexport const getDatasetDigest = (\n datasetDigest: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetDigestGetResponse>(\n { url: `/dataset/digest/${datasetDigest}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetDatasetDigestQueryKey = (datasetDigest: string) => [\n `/dataset/digest/${datasetDigest}`,\n];\n\nexport type GetDatasetDigestQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDatasetDigest>>\n>;\nexport type GetDatasetDigestQueryError = ErrorType<void | DmError>;\n\nexport const useGetDatasetDigest = <\n TData = Awaited<ReturnType<typeof getDatasetDigest>>,\n TError = ErrorType<void | DmError>\n>(\n datasetDigest: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getDatasetDigest>>,\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 ?? getGetDatasetDigestQueryKey(datasetDigest);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getDatasetDigest>>\n > = ({ signal }) => getDatasetDigest(datasetDigest, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getDatasetDigest>>,\n TError,\n TData\n >(queryKey, queryFn, {\n enabled: !!datasetDigest,\n ...queryOptions,\n }) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n\n/**\n * Returns the property schema for a Dataset versions in JSON format (if available).\n\n * @summary Gets the property schema for a specific Dataset\n */\nexport const getSchema = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetSchemaGetResponse>(\n {\n url: `/dataset/${datasetId}/schema/${datasetVersion}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetSchemaQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/schema/${datasetVersion}`];\n\nexport type GetSchemaQueryResult = NonNullable<\n Awaited<ReturnType<typeof getSchema>>\n>;\nexport type GetSchemaQueryError = ErrorType<void | DmError>;\n\nexport const useGetSchema = <\n TData = Awaited<ReturnType<typeof getSchema>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getSchema>>,\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 ?? getGetSchemaQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getSchema>>> = ({\n signal,\n }) => getSchema(datasetId, datasetVersion, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getSchema>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!(datasetId && datasetVersion), ...queryOptions }\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryKey;\n\n return query;\n};\n"]}
1
+ {"version":3,"sources":["../../src/dataset/dataset.ts"],"names":[],"mappings":";;;;;;;;AAUA,SAAS,UAAU,mBAAmB;AA4C/B,IAAM,wBAAwB,CACnC,oBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,gBAAgB,mBAAmB,YAAY;AAC/D,MAAI,mBAAmB,2BAA2B,QAAW;AAC3D,aAAS;AAAA,MACP;AAAA,MACA,mBAAmB;AAAA,IACrB;AAAA,EACF;AACA,MAAI,mBAAmB,uBAAuB,QAAW;AACvD,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AAO,OAAO;AAAA,IACjE;AAAA,EACF;AACF;AAEO,IAAM,8BAA8B,CAAC,kBAA0B;AAAA,EACpE,mBAAmB;AACrB;AAOO,IAAM,sBAAsB,CAIjC,eACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,4BAA4B,aAAa;AAErE,QAAM,UAEF,CAAC,EAAE,OAAO,MAAM,iBAAiB,eAAe,gBAAgB,MAAM;AAE1E,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ,SAIZ,aAAa;AAEf,QAAM,WAAW,cAAc;AAE/B,SAAO;AACT;AAOO,IAAM,YAAY,CACvB,WACA,gBACA,SACA,WACG;AACH,SAAO;AAAA,IACL;AAAA,MACE,KAAK,YAAY,oBAAoB;AAAA,MACrC,QAAQ;AAAA,MACR;AAAA,IACF;AAAA,IACA;AAAA,EACF;AACF;AAEO,IAAM,uBAAuB,CAClC,WACA,mBACG,CAAC,YAAY,oBAAoB,gBAAgB;AAO/C,IAAM,eAAe,CAI1B,WACA,gBACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,qBAAqB,WAAW,cAAc;AAE1E,QAAM,UAAgE,CAAC;AAAA,IACrE;AAAA,EACF,MAAM,UAAU,WAAW,gBAAgB,gBAAgB,MAAM;AAEjE,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,QAAM,QAAQ;AAAA,IACZ;AAAA,EACF;AAEA,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 DatasetPutPostResponse,\n DmError,\n DatasetPutBodyBody,\n DatasetPostBodyBody,\n DatasetsGetResponse,\n GetDatasetsParams,\n DatasetVersionsGetResponse,\n GetVersionsParams,\n DatasetVersionDeleteResponse,\n DeleteDatasetParams,\n DatasetDigestGetResponse,\n DatasetSchemaGetResponse,\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 * Using an unmanaged file in a Project as a source a Dataset (or new Dataset version) is created.\n\nThe dataset is assigned a unique identity if it has no **Parent**. If a Parent dataset is named during the upload the uploaded file inherits the Parent's identity and is issued with a new unique version number within the Dataset.\n\nBehaves like the corresponding **POST** method except the file is expected to exist on a Project path.\n\n * @summary Create a Dataset from a file in a Project\n */\nexport const createDatasetFromFile = (\n datasetPutBodyBody: DatasetPutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_type\", datasetPutBodyBody.dataset_type);\n if (datasetPutBodyBody.format_extra_variables !== undefined) {\n formData.append(\n \"format_extra_variables\",\n datasetPutBodyBody.format_extra_variables\n );\n }\n if (datasetPutBodyBody.skip_molecule_load !== undefined) {\n formData.append(\n \"skip_molecule_load\",\n datasetPutBodyBody.skip_molecule_load.toString()\n );\n }\n formData.append(\"project_id\", datasetPutBodyBody.project_id);\n formData.append(\"path\", datasetPutBodyBody.path);\n formData.append(\"file_name\", datasetPutBodyBody.file_name);\n if (datasetPutBodyBody.dataset_id !== undefined) {\n formData.append(\"dataset_id\", datasetPutBodyBody.dataset_id);\n }\n if (datasetPutBodyBody.unit_id !== undefined) {\n formData.append(\"unit_id\", datasetPutBodyBody.unit_id);\n }\n\n return customInstance<DatasetPutPostResponse>(\n {\n url: `/dataset`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateDatasetFromFileMutationResult = NonNullable<\n Awaited<ReturnType<typeof createDatasetFromFile>>\n>;\nexport type CreateDatasetFromFileMutationBody = DatasetPutBodyBody;\nexport type CreateDatasetFromFileMutationError = ErrorType<void | DmError>;\n\nexport const useCreateDatasetFromFile = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n TError,\n { data: DatasetPutBodyBody },\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 createDatasetFromFile>>,\n { data: DatasetPutBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createDatasetFromFile(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n TError,\n { data: DatasetPutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Uploads a dataset.\n\nDataset file-naming is strictly limited to a fixed set of extensions based on the Dataset **Type**. You can obtain the supported types (and their extensions) via the **\\/type** endpoint. Filenames that do not comply with the supported filename extensions will be rejected.\n\nDatasets can be uploaded in an uncompressed form, or uploaded pre-compressed using the `.gz` extension.\n\nThe dataset is assigned a unique identity if it has no **Parent**. If a Parent dataset is named during the upload the uploaded file inherits the Parent's identity and is issued with a new unique version number within the Dataset.\n\nDatasets undergo some processing in an asynchronous `task` after control returns to you. The unique identity of the assigned task (the `task id`) is presented to you in this endpoint's response. Before you can use an uploaded dataset, and before the dataset can be added to any pre-assigned projects, you must wait until the task is complete by making regular calls to the **\\/task/{task-id}** endpoint. A Dataset upload is complete when the corresponding `task.done` is **true** along with a `task.exit_code` of **0**. If the Dataset upload fails `task.done` will be **true** but the `task.exit_code` will be non-zero.\n\n * @summary Upload an external file as a Dataset\n */\nexport const uploadDataset = (\n datasetPostBodyBody: DatasetPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"dataset_file\", datasetPostBodyBody.dataset_file);\n formData.append(\"dataset_type\", datasetPostBodyBody.dataset_type);\n if (datasetPostBodyBody.format_extra_variables !== undefined) {\n formData.append(\n \"format_extra_variables\",\n datasetPostBodyBody.format_extra_variables\n );\n }\n if (datasetPostBodyBody.skip_molecule_load !== undefined) {\n formData.append(\n \"skip_molecule_load\",\n datasetPostBodyBody.skip_molecule_load.toString()\n );\n }\n if (datasetPostBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", datasetPostBodyBody.as_filename);\n }\n if (datasetPostBodyBody.dataset_id !== undefined) {\n formData.append(\"dataset_id\", datasetPostBodyBody.dataset_id);\n }\n formData.append(\"unit_id\", datasetPostBodyBody.unit_id);\n\n return customInstance<DatasetPutPostResponse>(\n {\n url: `/dataset`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type UploadDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof uploadDataset>>\n>;\nexport type UploadDatasetMutationBody = DatasetPostBodyBody;\nexport type UploadDatasetMutationError = ErrorType<void | DmError>;\n\nexport const useUploadDataset = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof uploadDataset>>,\n TError,\n { data: DatasetPostBodyBody },\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 uploadDataset>>,\n { data: DatasetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return uploadDataset(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof uploadDataset>>,\n TError,\n { data: DatasetPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns datasets that you have access to, whether attached to a project or not.\n\nYou will not see Datasets while their upload is still in progress.\n\nDatasets can be filtered by: 1. `owner username`, 2. `mime_type`, 3. a list of `owners` (a subset of the above) 4. a list of `editors` (a subset of the above) 5. `Labels` or `Label/Value` pairs (a subset of the above)\n\nNote that if `editors` are combined with `owner username`, then the datasets will be filtered by owner username first followed by editors (so it's an AND). If `editors` are combined with `owners`, then the result will be datasets filtered by a combination of owners OR editors.\n\n * @summary Get Datasets that are available to you\n */\nexport const getDatasets = (\n params?: GetDatasetsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetsGetResponse>(\n { url: `/dataset`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetDatasetsQueryKey = (params?: GetDatasetsParams) => [\n `/dataset`,\n ...(params ? [params] : []),\n];\n\nexport type GetDatasetsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDatasets>>\n>;\nexport type GetDatasetsQueryError = ErrorType<void | DmError>;\n\nexport const useGetDatasets = <\n TData = Awaited<ReturnType<typeof getDatasets>>,\n TError = ErrorType<void | DmError>\n>(\n params?: GetDatasetsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getDatasets>>,\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 ?? getGetDatasetsQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getDatasets>>> = ({\n signal,\n }) => getDatasets(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getDatasets>>,\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 * Returns a list of Dataset versions.\n\nYou will not see Datasets while their upload is still in progress.\n\n * @summary Gets all the versions of a specific Dataset\n */\nexport const getVersions = (\n datasetId: string,\n params?: GetVersionsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetVersionsGetResponse>(\n { url: `/dataset/${datasetId}/versions`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetVersionsQueryKey = (\n datasetId: string,\n params?: GetVersionsParams\n) => [`/dataset/${datasetId}/versions`, ...(params ? [params] : [])];\n\nexport type GetVersionsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getVersions>>\n>;\nexport type GetVersionsQueryError = ErrorType<void | DmError>;\n\nexport const useGetVersions = <\n TData = Awaited<ReturnType<typeof getVersions>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n params?: GetVersionsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getVersions>>,\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 ?? getGetVersionsQueryKey(datasetId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getVersions>>> = ({\n signal,\n }) => getVersions(datasetId, params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getVersions>>,\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 * Given the Dataset `id` and `version` the Dataset will be removed. The API does not prevent you removing a Dataset that's been used in a **Project**. When removed using this endpoint the Dataset is automatically detached from any and all Projects that it was attached to and any corresponding Project Files relating to the Dataset are also removed.\n\nYou must be an `editor` or `owner` of the Dataset.\n\nYou cannot delete a Dataset until its upload is complete.\n\n * @summary Delete a Dataset\n */\nexport const deleteDataset = (\n datasetId: string,\n datasetVersion: number,\n params?: DeleteDatasetParams,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<DatasetVersionDeleteResponse>(\n {\n url: `/dataset/${datasetId}/${datasetVersion}`,\n method: \"delete\",\n params,\n },\n options\n );\n};\n\nexport type DeleteDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteDataset>>\n>;\n\nexport type DeleteDatasetMutationError = ErrorType<void | DmError>;\n\nexport const useDeleteDataset = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteDataset>>,\n TError,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },\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 deleteDataset>>,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams }\n > = (props) => {\n const { datasetId, datasetVersion, params } = props ?? {};\n\n return deleteDataset(datasetId, datasetVersion, params, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteDataset>>,\n TError,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Given a `dataset_id` the dataset will be returned if available.\n\nYou cannot get a Dataset until its upload is complete.\n\n * @summary Download a Dataset\n */\nexport const downloadDataset = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/${datasetVersion}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getDownloadDatasetQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/${datasetVersion}`];\n\nexport type DownloadDatasetQueryResult = NonNullable<\n Awaited<ReturnType<typeof downloadDataset>>\n>;\nexport type DownloadDatasetQueryError = ErrorType<DmError>;\n\nexport const useDownloadDataset = <\n TData = Awaited<ReturnType<typeof downloadDataset>>,\n TError = ErrorType<DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof downloadDataset>>,\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 getDownloadDatasetQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof downloadDataset>>> = ({\n signal,\n }) => downloadDataset(datasetId, datasetVersion, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof downloadDataset>>,\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 is removed from the Dataset's `editor` list. The user is removed from all versions of a dataset. You can remove yourself but an `owner` (creator) will always have access to the dataset.\n\nYou must be an `editor` or `owner` of the dataset.\n\nYou cannot modify Dataset editors until its upload is complete.\n\n * @summary Remove a user's edit permission for a Dataset\n */\nexport const removeEditorFromDataset = (\n datasetId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/editor/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type RemoveEditorFromDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeEditorFromDataset>>\n>;\n\nexport type RemoveEditorFromDatasetMutationError = ErrorType<DmError>;\n\nexport const useRemoveEditorFromDataset = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n TError,\n { datasetId: 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 removeEditorFromDataset>>,\n { datasetId: string; userId: string }\n > = (props) => {\n const { datasetId, userId } = props ?? {};\n\n return removeEditorFromDataset(datasetId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * The user is added to the dataset's editor list. The dataset `owner` is automatically an editor and so does not need to be added as an `editor`.\n\nYou must be an `editor` or `owner` of the dataset.\n\nYou cannot modify Dataset editors until its upload is complete.\n\n * @summary Give a user edit permission for a Dataset\n */\nexport const addEditorToDataset = (\n datasetId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/dataset/${datasetId}/editor/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddEditorToDatasetMutationResult = NonNullable<\n Awaited<ReturnType<typeof addEditorToDataset>>\n>;\n\nexport type AddEditorToDatasetMutationError = ErrorType<DmError>;\n\nexport const useAddEditorToDataset = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n TError,\n { datasetId: 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 addEditorToDataset>>,\n { datasetId: string; userId: string }\n > = (props) => {\n const { datasetId, userId } = props ?? {};\n\n return addEditorToDataset(datasetId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Returns a dataset ID and version of a dataset that matches the provided SHA256 digest, a 64-character hex string.\n\n * @summary Gets the first Dataset that matches the provided digest\n */\nexport const getDatasetDigest = (\n datasetDigest: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetDigestGetResponse>(\n { url: `/dataset/digest/${datasetDigest}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetDatasetDigestQueryKey = (datasetDigest: string) => [\n `/dataset/digest/${datasetDigest}`,\n];\n\nexport type GetDatasetDigestQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDatasetDigest>>\n>;\nexport type GetDatasetDigestQueryError = ErrorType<void | DmError>;\n\nexport const useGetDatasetDigest = <\n TData = Awaited<ReturnType<typeof getDatasetDigest>>,\n TError = ErrorType<void | DmError>\n>(\n datasetDigest: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getDatasetDigest>>,\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 ?? getGetDatasetDigestQueryKey(datasetDigest);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getDatasetDigest>>\n > = ({ signal }) => getDatasetDigest(datasetDigest, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<\n Awaited<ReturnType<typeof getDatasetDigest>>,\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 * Returns the property schema for a Dataset versions in JSON format (if available).\n\n * @summary Gets the property schema for a specific Dataset\n */\nexport const getSchema = (\n datasetId: string,\n datasetVersion: number,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<DatasetSchemaGetResponse>(\n {\n url: `/dataset/${datasetId}/schema/${datasetVersion}`,\n method: \"get\",\n signal,\n },\n options\n );\n};\n\nexport const getGetSchemaQueryKey = (\n datasetId: string,\n datasetVersion: number\n) => [`/dataset/${datasetId}/schema/${datasetVersion}`];\n\nexport type GetSchemaQueryResult = NonNullable<\n Awaited<ReturnType<typeof getSchema>>\n>;\nexport type GetSchemaQueryError = ErrorType<void | DmError>;\n\nexport const useGetSchema = <\n TData = Awaited<ReturnType<typeof getSchema>>,\n TError = ErrorType<void | DmError>\n>(\n datasetId: string,\n datasetVersion: number,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getSchema>>,\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 ?? getGetSchemaQueryKey(datasetId, datasetVersion);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getSchema>>> = ({\n signal,\n }) => getSchema(datasetId, datasetVersion, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n const query = useQuery<Awaited<ReturnType<typeof getSchema>>, TError, TData>(\n customOptions\n ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = customOptions.queryKey;\n\n return query;\n};\n"]}
@@ -1,9 +1,9 @@
1
- import { a6 as DatasetPutBodyBody, bI as customInstance, bw as DatasetPutPostResponse, bJ as ErrorType, bE as DmError, a9 as DatasetPostBodyBody, o as GetDatasetsParams, bp as DatasetsGetResponse, n as GetVersionsParams, aP as DatasetDetail, m as DeleteDatasetParams, al as TaskIdentity, bv as DatasetDigestGetResponse, bt as DatasetSchemaGetResponse } from '../custom-instance-5c7b6971.js';
1
+ import { a6 as DatasetPutBodyBody, bK as customInstance, by as DatasetPutPostResponse, bL as ErrorType, bG as DmError, a9 as DatasetPostBodyBody, o as GetDatasetsParams, br as DatasetsGetResponse, n as GetVersionsParams, aR as DatasetDetail, m as DeleteDatasetParams, al as TaskIdentity, bx as DatasetDigestGetResponse, bv as DatasetSchemaGetResponse } from '../custom-instance-b5dd9223.js';
2
2
  import * as _tanstack_react_query from '@tanstack/react-query';
3
3
  import { UseMutationOptions, UseQueryOptions, QueryKey, UseQueryResult } from '@tanstack/react-query';
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
  * Using an unmanaged file in a Project as a source a Dataset (or new Dataset version) is created.
9
9
 
@@ -14,9 +14,9 @@ Behaves like the corresponding **POST** method except the file is expected to ex
14
14
  * @summary Create a Dataset from a file in a Project
15
15
  */
16
16
  declare const createDatasetFromFile: (datasetPutBodyBody: DatasetPutBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<DatasetPutPostResponse>;
17
- declare type CreateDatasetFromFileMutationResult = NonNullable<Awaited<ReturnType<typeof createDatasetFromFile>>>;
18
- declare type CreateDatasetFromFileMutationBody = DatasetPutBodyBody;
19
- declare type CreateDatasetFromFileMutationError = ErrorType<void | DmError>;
17
+ type CreateDatasetFromFileMutationResult = NonNullable<Awaited<ReturnType<typeof createDatasetFromFile>>>;
18
+ type CreateDatasetFromFileMutationBody = DatasetPutBodyBody;
19
+ type CreateDatasetFromFileMutationError = ErrorType<void | DmError>;
20
20
  declare const useCreateDatasetFromFile: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
21
21
  mutation?: UseMutationOptions<DatasetPutPostResponse, TError, {
22
22
  data: DatasetPutBodyBody;
@@ -39,9 +39,9 @@ Datasets undergo some processing in an asynchronous `task` after control returns
39
39
  * @summary Upload an external file as a Dataset
40
40
  */
41
41
  declare const uploadDataset: (datasetPostBodyBody: DatasetPostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<DatasetPutPostResponse>;
42
- declare type UploadDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof uploadDataset>>>;
43
- declare type UploadDatasetMutationBody = DatasetPostBodyBody;
44
- declare type UploadDatasetMutationError = ErrorType<void | DmError>;
42
+ type UploadDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof uploadDataset>>>;
43
+ type UploadDatasetMutationBody = DatasetPostBodyBody;
44
+ type UploadDatasetMutationError = ErrorType<void | DmError>;
45
45
  declare const useUploadDataset: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
46
46
  mutation?: UseMutationOptions<DatasetPutPostResponse, TError, {
47
47
  data: DatasetPostBodyBody;
@@ -63,8 +63,8 @@ Note that if `editors` are combined with `owner username`, then the datasets wil
63
63
  */
64
64
  declare const getDatasets: (params?: GetDatasetsParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<DatasetsGetResponse>;
65
65
  declare const getGetDatasetsQueryKey: (params?: GetDatasetsParams) => (string | GetDatasetsParams)[];
66
- declare type GetDatasetsQueryResult = NonNullable<Awaited<ReturnType<typeof getDatasets>>>;
67
- declare type GetDatasetsQueryError = ErrorType<void | DmError>;
66
+ type GetDatasetsQueryResult = NonNullable<Awaited<ReturnType<typeof getDatasets>>>;
67
+ type GetDatasetsQueryError = ErrorType<void | DmError>;
68
68
  declare const useGetDatasets: <TData = DatasetsGetResponse, TError = ErrorType<void | DmError>>(params?: GetDatasetsParams, options?: {
69
69
  query?: UseQueryOptions<DatasetsGetResponse, TError, TData, QueryKey> | undefined;
70
70
  request?: SecondParameter<typeof customInstance>;
@@ -80,8 +80,8 @@ You will not see Datasets while their upload is still in progress.
80
80
  */
81
81
  declare const getVersions: (datasetId: string, params?: GetVersionsParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<DatasetDetail>;
82
82
  declare const getGetVersionsQueryKey: (datasetId: string, params?: GetVersionsParams) => (string | GetVersionsParams)[];
83
- declare type GetVersionsQueryResult = NonNullable<Awaited<ReturnType<typeof getVersions>>>;
84
- declare type GetVersionsQueryError = ErrorType<void | DmError>;
83
+ type GetVersionsQueryResult = NonNullable<Awaited<ReturnType<typeof getVersions>>>;
84
+ type GetVersionsQueryError = ErrorType<void | DmError>;
85
85
  declare const useGetVersions: <TData = DatasetDetail, TError = ErrorType<void | DmError>>(datasetId: string, params?: GetVersionsParams, options?: {
86
86
  query?: UseQueryOptions<DatasetDetail, TError, TData, QueryKey> | undefined;
87
87
  request?: SecondParameter<typeof customInstance>;
@@ -98,8 +98,8 @@ You cannot delete a Dataset until its upload is complete.
98
98
  * @summary Delete a Dataset
99
99
  */
100
100
  declare const deleteDataset: (datasetId: string, datasetVersion: number, params?: DeleteDatasetParams, options?: SecondParameter<typeof customInstance>) => Promise<TaskIdentity>;
101
- declare type DeleteDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof deleteDataset>>>;
102
- declare type DeleteDatasetMutationError = ErrorType<void | DmError>;
101
+ type DeleteDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof deleteDataset>>>;
102
+ type DeleteDatasetMutationError = ErrorType<void | DmError>;
103
103
  declare const useDeleteDataset: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
104
104
  mutation?: UseMutationOptions<TaskIdentity, TError, {
105
105
  datasetId: string;
@@ -121,8 +121,8 @@ You cannot get a Dataset until its upload is complete.
121
121
  */
122
122
  declare const downloadDataset: (datasetId: string, datasetVersion: number, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<void>;
123
123
  declare const getDownloadDatasetQueryKey: (datasetId: string, datasetVersion: number) => string[];
124
- declare type DownloadDatasetQueryResult = NonNullable<Awaited<ReturnType<typeof downloadDataset>>>;
125
- declare type DownloadDatasetQueryError = ErrorType<DmError>;
124
+ type DownloadDatasetQueryResult = NonNullable<Awaited<ReturnType<typeof downloadDataset>>>;
125
+ type DownloadDatasetQueryError = ErrorType<DmError>;
126
126
  declare const useDownloadDataset: <TData = void, TError = ErrorType<DmError>>(datasetId: string, datasetVersion: number, options?: {
127
127
  query?: UseQueryOptions<void, TError, TData, QueryKey> | undefined;
128
128
  request?: SecondParameter<typeof customInstance>;
@@ -139,8 +139,8 @@ You cannot modify Dataset editors until its upload is complete.
139
139
  * @summary Remove a user's edit permission for a Dataset
140
140
  */
141
141
  declare const removeEditorFromDataset: (datasetId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
142
- declare type RemoveEditorFromDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof removeEditorFromDataset>>>;
143
- declare type RemoveEditorFromDatasetMutationError = ErrorType<DmError>;
142
+ type RemoveEditorFromDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof removeEditorFromDataset>>>;
143
+ type RemoveEditorFromDatasetMutationError = ErrorType<DmError>;
144
144
  declare const useRemoveEditorFromDataset: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
145
145
  mutation?: UseMutationOptions<void, TError, {
146
146
  datasetId: string;
@@ -161,8 +161,8 @@ You cannot modify Dataset editors until its upload is complete.
161
161
  * @summary Give a user edit permission for a Dataset
162
162
  */
163
163
  declare const addEditorToDataset: (datasetId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
164
- declare type AddEditorToDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof addEditorToDataset>>>;
165
- declare type AddEditorToDatasetMutationError = ErrorType<DmError>;
164
+ type AddEditorToDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof addEditorToDataset>>>;
165
+ type AddEditorToDatasetMutationError = ErrorType<DmError>;
166
166
  declare const useAddEditorToDataset: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
167
167
  mutation?: UseMutationOptions<void, TError, {
168
168
  datasetId: string;
@@ -180,8 +180,8 @@ declare const useAddEditorToDataset: <TError = ErrorType<DmError>, TContext = un
180
180
  */
181
181
  declare const getDatasetDigest: (datasetDigest: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<DatasetDigestGetResponse>;
182
182
  declare const getGetDatasetDigestQueryKey: (datasetDigest: string) => string[];
183
- declare type GetDatasetDigestQueryResult = NonNullable<Awaited<ReturnType<typeof getDatasetDigest>>>;
184
- declare type GetDatasetDigestQueryError = ErrorType<void | DmError>;
183
+ type GetDatasetDigestQueryResult = NonNullable<Awaited<ReturnType<typeof getDatasetDigest>>>;
184
+ type GetDatasetDigestQueryError = ErrorType<void | DmError>;
185
185
  declare const useGetDatasetDigest: <TData = DatasetDigestGetResponse, TError = ErrorType<void | DmError>>(datasetDigest: string, options?: {
186
186
  query?: UseQueryOptions<DatasetDigestGetResponse, TError, TData, QueryKey> | undefined;
187
187
  request?: SecondParameter<typeof customInstance>;
@@ -195,8 +195,8 @@ declare const useGetDatasetDigest: <TData = DatasetDigestGetResponse, TError = E
195
195
  */
196
196
  declare const getSchema: (datasetId: string, datasetVersion: number, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<DatasetSchemaGetResponse>;
197
197
  declare const getGetSchemaQueryKey: (datasetId: string, datasetVersion: number) => string[];
198
- declare type GetSchemaQueryResult = NonNullable<Awaited<ReturnType<typeof getSchema>>>;
199
- declare type GetSchemaQueryError = ErrorType<void | DmError>;
198
+ type GetSchemaQueryResult = NonNullable<Awaited<ReturnType<typeof getSchema>>>;
199
+ type GetSchemaQueryError = ErrorType<void | DmError>;
200
200
  declare const useGetSchema: <TData = DatasetSchemaGetResponse, TError = ErrorType<void | DmError>>(datasetId: string, datasetVersion: number, options?: {
201
201
  query?: UseQueryOptions<DatasetSchemaGetResponse, TError, TData, QueryKey> | undefined;
202
202
  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/dataset/dataset.ts
6
9
  import { useQuery, useMutation } from "@tanstack/react-query";
@@ -103,8 +106,9 @@ var useGetDatasets = (params, options) => {
103
106
  const queryFn = ({
104
107
  signal
105
108
  }) => getDatasets(params, requestOptions, signal);
106
- const query = useQuery(queryKey, queryFn, queryOptions);
107
- query.queryKey = queryKey;
109
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
110
+ const query = useQuery(customOptions);
111
+ query.queryKey = customOptions.queryKey;
108
112
  return query;
109
113
  };
110
114
  var getVersions = (datasetId, params, options, signal) => {
@@ -120,11 +124,9 @@ var useGetVersions = (datasetId, params, options) => {
120
124
  const queryFn = ({
121
125
  signal
122
126
  }) => getVersions(datasetId, params, requestOptions, signal);
123
- const query = useQuery(queryKey, queryFn, {
124
- enabled: !!datasetId,
125
- ...queryOptions
126
- });
127
- query.queryKey = queryKey;
127
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
128
+ const query = useQuery(customOptions);
129
+ query.queryKey = customOptions.queryKey;
128
130
  return query;
129
131
  };
130
132
  var deleteDataset = (datasetId, datasetVersion, params, options) => {
@@ -158,11 +160,9 @@ var useDownloadDataset = (datasetId, datasetVersion, options) => {
158
160
  const queryFn = ({
159
161
  signal
160
162
  }) => downloadDataset(datasetId, datasetVersion, requestOptions, signal);
161
- const query = useQuery(queryKey, queryFn, {
162
- enabled: !!(datasetId && datasetVersion),
163
- ...queryOptions
164
- });
165
- query.queryKey = queryKey;
163
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
164
+ const query = useQuery(customOptions);
165
+ query.queryKey = customOptions.queryKey;
166
166
  return query;
167
167
  };
168
168
  var removeEditorFromDataset = (datasetId, userId, options) => {
@@ -206,11 +206,9 @@ var useGetDatasetDigest = (datasetDigest, options) => {
206
206
  const { query: queryOptions, request: requestOptions } = options ?? {};
207
207
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetDatasetDigestQueryKey(datasetDigest);
208
208
  const queryFn = ({ signal }) => getDatasetDigest(datasetDigest, requestOptions, signal);
209
- const query = useQuery(queryKey, queryFn, {
210
- enabled: !!datasetDigest,
211
- ...queryOptions
212
- });
213
- query.queryKey = queryKey;
209
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
210
+ const query = useQuery(customOptions);
211
+ query.queryKey = customOptions.queryKey;
214
212
  return query;
215
213
  };
216
214
  var getSchema = (datasetId, datasetVersion, options, signal) => {
@@ -230,12 +228,11 @@ var useGetSchema = (datasetId, datasetVersion, options) => {
230
228
  const queryFn = ({
231
229
  signal
232
230
  }) => getSchema(datasetId, datasetVersion, requestOptions, signal);
231
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
233
232
  const query = useQuery(
234
- queryKey,
235
- queryFn,
236
- { enabled: !!(datasetId && datasetVersion), ...queryOptions }
233
+ customOptions
237
234
  );
238
- query.queryKey = queryKey;
235
+ query.queryKey = customOptions.queryKey;
239
236
  return query;
240
237
  };
241
238
  export {