@squonk/data-manager-client 1.1.3 → 1.1.4-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accounting/accounting.cjs +28 -25
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.ts +23 -5
- package/accounting/accounting.js +27 -24
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +68 -28
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +74 -4
- package/admin/admin.js +67 -27
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +19 -16
- package/application/application.cjs.map +1 -1
- package/application/application.d.ts +16 -4
- package/application/application.js +18 -15
- package/application/application.js.map +1 -1
- package/{custom-instance-d49ce6d9.d.ts → custom-instance-e49ba702.d.ts} +1 -1
- package/dataset/dataset.cjs +98 -45
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +85 -7
- package/dataset/dataset.js +97 -44
- package/dataset/dataset.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs +62 -27
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.ts +50 -6
- package/exchange-rate/exchange-rate.js +61 -26
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file/file.cjs +40 -25
- package/file/file.cjs.map +1 -1
- package/file/file.d.ts +40 -4
- package/file/file.js +39 -24
- package/file/file.js.map +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/instance/instance.cjs +54 -29
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.ts +60 -4
- package/instance/instance.js +53 -28
- package/instance/instance.js.map +1 -1
- package/job/job.cjs +28 -32
- package/job/job.cjs.map +1 -1
- package/job/job.d.ts +23 -5
- package/job/job.js +27 -31
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +42 -20
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.ts +38 -4
- package/metadata/metadata.js +41 -19
- package/metadata/metadata.js.map +1 -1
- package/package.json +10 -9
- package/project/project.cjs +105 -47
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +106 -6
- package/project/project.js +104 -46
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +88 -43
- package/src/admin/admin.ts +253 -99
- package/src/application/application.ts +64 -31
- package/src/data-manager-api.schemas.ts +1 -1
- package/src/dataset/dataset.ts +323 -130
- package/src/exchange-rate/exchange-rate.ts +211 -87
- package/src/file/file.ts +148 -63
- package/src/instance/instance.ts +202 -87
- package/src/job/job.ts +93 -50
- package/src/metadata/metadata.ts +136 -54
- package/src/project/project.ts +367 -146
- package/src/task/task.ts +91 -44
- package/src/type/type.ts +27 -14
- package/src/user/user.ts +121 -61
- package/task/task.cjs +26 -26
- package/task/task.cjs.map +1 -1
- package/task/task.d.ts +24 -4
- package/task/task.js +25 -25
- package/task/task.js.map +1 -1
- package/type/type.cjs +10 -9
- package/type/type.cjs.map +1 -1
- package/type/type.d.ts +9 -3
- package/type/type.js +9 -8
- package/type/type.js.map +1 -1
- package/user/user.cjs +35 -29
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +31 -5
- package/user/user.js +34 -28
- package/user/user.js.map +1 -1
- package/chunk-LNYWU37B.cjs +0 -13
- package/chunk-LNYWU37B.cjs.map +0 -1
- package/chunk-LT4O36DN.js +0 -13
- package/chunk-LT4O36DN.js.map +0 -1
- package/src/queryMutator.ts +0 -12
package/dataset/dataset.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;AAA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AACH,SAAO;AAAA,IACL,EAAE,KAAK,mBAAmB,iBAAiB,QAAQ,OAAO,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
|
+
{"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,mBAAmB,2BAA2B,QAAW;AAC3D,aAAS;AAAA,MACP;AAAA,MACA,mBAAmB;AA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AE1E,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,eAAe,GAAG,aAAa;AACxE;AAOO,IAAM,sBAAsB,CAIjC,eACA,YAQ2D;AAC3D,QAAM,eAAe,gCAAgC,eAAe,OAAO;AAE3E,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,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,oBAAoB,YAAY,oBAAoB,gBAAgB;AAEnE,IAAM,2BAA2B,CAItC,WACA,gBACA,YAUG;AACH,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,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,SAAS,CAAC,EAAE,aAAa;AAAA,IACzB,GAAG;AAAA,EACL;AACF;AAOO,IAAM,eAAe,CAI1B,WACA,gBACA,YAQ2D;AAC3D,QAAM,eAAe;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.15.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 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 const getCreateDatasetFromFileMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof createDatasetFromFile>>,\n TError,\n { data: DatasetPutBodyBody },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getCreateDatasetFromFileMutationOptions(options);\n\n return useMutation(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 const getUploadDatasetMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof uploadDataset>>,\n TError,\n { data: DatasetPostBodyBody },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getUploadDatasetMutationOptions(options);\n\n return useMutation(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 [\"data-manager-api\", `/dataset`, ...(params ? [params] : [])] as const;\n\nexport const getGetDatasetsQueryOptions = <\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): UseQueryOptions<Awaited<ReturnType<typeof getDatasets>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\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 return { queryKey, queryFn, ...queryOptions };\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 queryOptions = getGetDatasetsQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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) => [\"data-manager-api\", `/dataset/${datasetId}/versions`, ...(params ? [params] : [])] as const;\n\nexport const getGetVersionsQueryOptions = <\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): UseQueryOptions<Awaited<ReturnType<typeof getVersions>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\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 return { queryKey, queryFn, enabled: !!datasetId, ...queryOptions };\n};\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 queryOptions = getGetVersionsQueryOptions(datasetId, params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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 const getDeleteDatasetMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteDataset>>,\n TError,\n { datasetId: string; datasetVersion: number; params?: DeleteDatasetParams },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getDeleteDatasetMutationOptions(options);\n\n return useMutation(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) => [\"data-manager-api\", `/dataset/${datasetId}/${datasetVersion}`] as const;\n\nexport const getDownloadDatasetQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof downloadDataset>>,\n TError,\n TData\n> & { 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 return {\n queryKey,\n queryFn,\n enabled: !!(datasetId && datasetVersion),\n ...queryOptions,\n };\n};\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 queryOptions = getDownloadDatasetQueryOptions(\n datasetId,\n datasetVersion,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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 const getRemoveEditorFromDatasetMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getRemoveEditorFromDatasetMutationOptions(options);\n\n return useMutation(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 const getAddEditorToDatasetMutationOptions = <\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}): UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToDataset>>,\n TError,\n { datasetId: string; userId: string },\n TContext\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 { mutationFn, ...mutationOptions };\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 mutationOptions = getAddEditorToDatasetMutationOptions(options);\n\n return useMutation(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 [\"data-manager-api\", `/dataset/digest/${datasetDigest}`] as const;\n\nexport const getGetDatasetDigestQueryOptions = <\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): UseQueryOptions<\n Awaited<ReturnType<typeof getDatasetDigest>>,\n TError,\n TData\n> & { 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 return { queryKey, queryFn, enabled: !!datasetDigest, ...queryOptions };\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 queryOptions = getGetDatasetDigestQueryOptions(datasetDigest, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.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) => [\"data-manager-api\", `/dataset/${datasetId}/schema/${datasetVersion}`] as const;\n\nexport const getGetSchemaQueryOptions = <\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): UseQueryOptions<Awaited<ReturnType<typeof getSchema>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\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 return {\n queryKey,\n queryFn,\n enabled: !!(datasetId && datasetVersion),\n ...queryOptions,\n };\n};\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 queryOptions = getGetSchemaQueryOptions(\n datasetId,\n datasetVersion,\n options\n );\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"]}
|
package/dataset/dataset.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aa as DatasetPutBodyBody, bO as customInstance, bC as DatasetPutPostResponse, bP as ErrorType, bK as DmError, ad as DatasetPostBodyBody, o as GetDatasetsParams, bv as DatasetsGetResponse, n as GetVersionsParams, aV as DatasetDetail, m as DeleteDatasetParams, ap as TaskIdentity, bB as DatasetDigestGetResponse, bz as DatasetSchemaGetResponse } from '../custom-instance-
|
|
1
|
+
import { aa as DatasetPutBodyBody, bO as customInstance, bC as DatasetPutPostResponse, bP as ErrorType, bK as DmError, ad as DatasetPostBodyBody, o as GetDatasetsParams, bv as DatasetsGetResponse, n as GetVersionsParams, aV as DatasetDetail, m as DeleteDatasetParams, ap as TaskIdentity, bB as DatasetDigestGetResponse, bz as DatasetSchemaGetResponse } from '../custom-instance-e49ba702.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';
|
|
@@ -14,6 +14,14 @@ 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 const getCreateDatasetFromFileMutationOptions: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
18
|
+
mutation?: UseMutationOptions<DatasetPutPostResponse, TError, {
|
|
19
|
+
data: DatasetPutBodyBody;
|
|
20
|
+
}, TContext> | undefined;
|
|
21
|
+
request?: SecondParameter<typeof customInstance>;
|
|
22
|
+
} | undefined) => UseMutationOptions<DatasetPutPostResponse, TError, {
|
|
23
|
+
data: DatasetPutBodyBody;
|
|
24
|
+
}, TContext>;
|
|
17
25
|
type CreateDatasetFromFileMutationResult = NonNullable<Awaited<ReturnType<typeof createDatasetFromFile>>>;
|
|
18
26
|
type CreateDatasetFromFileMutationBody = DatasetPutBodyBody;
|
|
19
27
|
type CreateDatasetFromFileMutationError = ErrorType<void | DmError>;
|
|
@@ -39,6 +47,14 @@ Datasets undergo some processing in an asynchronous `task` after control returns
|
|
|
39
47
|
* @summary Upload an external file as a Dataset
|
|
40
48
|
*/
|
|
41
49
|
declare const uploadDataset: (datasetPostBodyBody: DatasetPostBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<DatasetPutPostResponse>;
|
|
50
|
+
declare const getUploadDatasetMutationOptions: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
51
|
+
mutation?: UseMutationOptions<DatasetPutPostResponse, TError, {
|
|
52
|
+
data: DatasetPostBodyBody;
|
|
53
|
+
}, TContext> | undefined;
|
|
54
|
+
request?: SecondParameter<typeof customInstance>;
|
|
55
|
+
} | undefined) => UseMutationOptions<DatasetPutPostResponse, TError, {
|
|
56
|
+
data: DatasetPostBodyBody;
|
|
57
|
+
}, TContext>;
|
|
42
58
|
type UploadDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof uploadDataset>>>;
|
|
43
59
|
type UploadDatasetMutationBody = DatasetPostBodyBody;
|
|
44
60
|
type UploadDatasetMutationError = ErrorType<void | DmError>;
|
|
@@ -62,7 +78,13 @@ Note that if `editors` are combined with `owner username`, then the datasets wil
|
|
|
62
78
|
* @summary Get Datasets that are available to you
|
|
63
79
|
*/
|
|
64
80
|
declare const getDatasets: (params?: GetDatasetsParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<DatasetsGetResponse>;
|
|
65
|
-
declare const getGetDatasetsQueryKey: (params?: GetDatasetsParams) =>
|
|
81
|
+
declare const getGetDatasetsQueryKey: (params?: GetDatasetsParams) => readonly ["data-manager-api", "/dataset", ...GetDatasetsParams[]];
|
|
82
|
+
declare const getGetDatasetsQueryOptions: <TData = DatasetsGetResponse, TError = ErrorType<void | DmError>>(params?: GetDatasetsParams, options?: {
|
|
83
|
+
query?: UseQueryOptions<DatasetsGetResponse, TError, TData, QueryKey> | undefined;
|
|
84
|
+
request?: SecondParameter<typeof customInstance>;
|
|
85
|
+
} | undefined) => UseQueryOptions<DatasetsGetResponse, TError, TData, QueryKey> & {
|
|
86
|
+
queryKey: QueryKey;
|
|
87
|
+
};
|
|
66
88
|
type GetDatasetsQueryResult = NonNullable<Awaited<ReturnType<typeof getDatasets>>>;
|
|
67
89
|
type GetDatasetsQueryError = ErrorType<void | DmError>;
|
|
68
90
|
declare const useGetDatasets: <TData = DatasetsGetResponse, TError = ErrorType<void | DmError>>(params?: GetDatasetsParams, options?: {
|
|
@@ -79,7 +101,13 @@ You will not see Datasets while their upload is still in progress.
|
|
|
79
101
|
* @summary Gets all the versions of a specific Dataset
|
|
80
102
|
*/
|
|
81
103
|
declare const getVersions: (datasetId: string, params?: GetVersionsParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<DatasetDetail>;
|
|
82
|
-
declare const getGetVersionsQueryKey: (datasetId: string, params?: GetVersionsParams) =>
|
|
104
|
+
declare const getGetVersionsQueryKey: (datasetId: string, params?: GetVersionsParams) => readonly ["data-manager-api", `/dataset/${string}/versions`, ...GetVersionsParams[]];
|
|
105
|
+
declare const getGetVersionsQueryOptions: <TData = DatasetDetail, TError = ErrorType<void | DmError>>(datasetId: string, params?: GetVersionsParams, options?: {
|
|
106
|
+
query?: UseQueryOptions<DatasetDetail, TError, TData, QueryKey> | undefined;
|
|
107
|
+
request?: SecondParameter<typeof customInstance>;
|
|
108
|
+
} | undefined) => UseQueryOptions<DatasetDetail, TError, TData, QueryKey> & {
|
|
109
|
+
queryKey: QueryKey;
|
|
110
|
+
};
|
|
83
111
|
type GetVersionsQueryResult = NonNullable<Awaited<ReturnType<typeof getVersions>>>;
|
|
84
112
|
type GetVersionsQueryError = ErrorType<void | DmError>;
|
|
85
113
|
declare const useGetVersions: <TData = DatasetDetail, TError = ErrorType<void | DmError>>(datasetId: string, params?: GetVersionsParams, options?: {
|
|
@@ -98,6 +126,18 @@ You cannot delete a Dataset until its upload is complete.
|
|
|
98
126
|
* @summary Delete a Dataset
|
|
99
127
|
*/
|
|
100
128
|
declare const deleteDataset: (datasetId: string, datasetVersion: number, params?: DeleteDatasetParams, options?: SecondParameter<typeof customInstance>) => Promise<TaskIdentity>;
|
|
129
|
+
declare const getDeleteDatasetMutationOptions: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
130
|
+
mutation?: UseMutationOptions<TaskIdentity, TError, {
|
|
131
|
+
datasetId: string;
|
|
132
|
+
datasetVersion: number;
|
|
133
|
+
params?: DeleteDatasetParams | undefined;
|
|
134
|
+
}, TContext> | undefined;
|
|
135
|
+
request?: SecondParameter<typeof customInstance>;
|
|
136
|
+
} | undefined) => UseMutationOptions<TaskIdentity, TError, {
|
|
137
|
+
datasetId: string;
|
|
138
|
+
datasetVersion: number;
|
|
139
|
+
params?: DeleteDatasetParams | undefined;
|
|
140
|
+
}, TContext>;
|
|
101
141
|
type DeleteDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof deleteDataset>>>;
|
|
102
142
|
type DeleteDatasetMutationError = ErrorType<void | DmError>;
|
|
103
143
|
declare const useDeleteDataset: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
@@ -120,7 +160,13 @@ You cannot get a Dataset until its upload is complete.
|
|
|
120
160
|
* @summary Download a Dataset
|
|
121
161
|
*/
|
|
122
162
|
declare const downloadDataset: (datasetId: string, datasetVersion: number, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<void>;
|
|
123
|
-
declare const getDownloadDatasetQueryKey: (datasetId: string, datasetVersion: number) => string
|
|
163
|
+
declare const getDownloadDatasetQueryKey: (datasetId: string, datasetVersion: number) => readonly ["data-manager-api", `/dataset/${string}/${number}`];
|
|
164
|
+
declare const getDownloadDatasetQueryOptions: <TData = void, TError = ErrorType<DmError>>(datasetId: string, datasetVersion: number, options?: {
|
|
165
|
+
query?: UseQueryOptions<void, TError, TData, QueryKey> | undefined;
|
|
166
|
+
request?: SecondParameter<typeof customInstance>;
|
|
167
|
+
} | undefined) => UseQueryOptions<void, TError, TData, QueryKey> & {
|
|
168
|
+
queryKey: QueryKey;
|
|
169
|
+
};
|
|
124
170
|
type DownloadDatasetQueryResult = NonNullable<Awaited<ReturnType<typeof downloadDataset>>>;
|
|
125
171
|
type DownloadDatasetQueryError = ErrorType<DmError>;
|
|
126
172
|
declare const useDownloadDataset: <TData = void, TError = ErrorType<DmError>>(datasetId: string, datasetVersion: number, options?: {
|
|
@@ -139,6 +185,16 @@ You cannot modify Dataset editors until its upload is complete.
|
|
|
139
185
|
* @summary Remove a user's edit permission for a Dataset
|
|
140
186
|
*/
|
|
141
187
|
declare const removeEditorFromDataset: (datasetId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
188
|
+
declare const getRemoveEditorFromDatasetMutationOptions: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
189
|
+
mutation?: UseMutationOptions<void, TError, {
|
|
190
|
+
datasetId: string;
|
|
191
|
+
userId: string;
|
|
192
|
+
}, TContext> | undefined;
|
|
193
|
+
request?: SecondParameter<typeof customInstance>;
|
|
194
|
+
} | undefined) => UseMutationOptions<void, TError, {
|
|
195
|
+
datasetId: string;
|
|
196
|
+
userId: string;
|
|
197
|
+
}, TContext>;
|
|
142
198
|
type RemoveEditorFromDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof removeEditorFromDataset>>>;
|
|
143
199
|
type RemoveEditorFromDatasetMutationError = ErrorType<DmError>;
|
|
144
200
|
declare const useRemoveEditorFromDataset: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
@@ -161,6 +217,16 @@ You cannot modify Dataset editors until its upload is complete.
|
|
|
161
217
|
* @summary Give a user edit permission for a Dataset
|
|
162
218
|
*/
|
|
163
219
|
declare const addEditorToDataset: (datasetId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
220
|
+
declare const getAddEditorToDatasetMutationOptions: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
221
|
+
mutation?: UseMutationOptions<void, TError, {
|
|
222
|
+
datasetId: string;
|
|
223
|
+
userId: string;
|
|
224
|
+
}, TContext> | undefined;
|
|
225
|
+
request?: SecondParameter<typeof customInstance>;
|
|
226
|
+
} | undefined) => UseMutationOptions<void, TError, {
|
|
227
|
+
datasetId: string;
|
|
228
|
+
userId: string;
|
|
229
|
+
}, TContext>;
|
|
164
230
|
type AddEditorToDatasetMutationResult = NonNullable<Awaited<ReturnType<typeof addEditorToDataset>>>;
|
|
165
231
|
type AddEditorToDatasetMutationError = ErrorType<DmError>;
|
|
166
232
|
declare const useAddEditorToDataset: <TError = ErrorType<DmError>, TContext = unknown>(options?: {
|
|
@@ -179,7 +245,13 @@ declare const useAddEditorToDataset: <TError = ErrorType<DmError>, TContext = un
|
|
|
179
245
|
* @summary Gets the first Dataset that matches the provided digest
|
|
180
246
|
*/
|
|
181
247
|
declare const getDatasetDigest: (datasetDigest: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<DatasetDigestGetResponse>;
|
|
182
|
-
declare const getGetDatasetDigestQueryKey: (datasetDigest: string) => string
|
|
248
|
+
declare const getGetDatasetDigestQueryKey: (datasetDigest: string) => readonly ["data-manager-api", `/dataset/digest/${string}`];
|
|
249
|
+
declare const getGetDatasetDigestQueryOptions: <TData = DatasetDigestGetResponse, TError = ErrorType<void | DmError>>(datasetDigest: string, options?: {
|
|
250
|
+
query?: UseQueryOptions<DatasetDigestGetResponse, TError, TData, QueryKey> | undefined;
|
|
251
|
+
request?: SecondParameter<typeof customInstance>;
|
|
252
|
+
} | undefined) => UseQueryOptions<DatasetDigestGetResponse, TError, TData, QueryKey> & {
|
|
253
|
+
queryKey: QueryKey;
|
|
254
|
+
};
|
|
183
255
|
type GetDatasetDigestQueryResult = NonNullable<Awaited<ReturnType<typeof getDatasetDigest>>>;
|
|
184
256
|
type GetDatasetDigestQueryError = ErrorType<void | DmError>;
|
|
185
257
|
declare const useGetDatasetDigest: <TData = DatasetDigestGetResponse, TError = ErrorType<void | DmError>>(datasetDigest: string, options?: {
|
|
@@ -194,7 +266,13 @@ declare const useGetDatasetDigest: <TData = DatasetDigestGetResponse, TError = E
|
|
|
194
266
|
* @summary Gets the property schema for a specific Dataset
|
|
195
267
|
*/
|
|
196
268
|
declare const getSchema: (datasetId: string, datasetVersion: number, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<DatasetSchemaGetResponse>;
|
|
197
|
-
declare const getGetSchemaQueryKey: (datasetId: string, datasetVersion: number) => string
|
|
269
|
+
declare const getGetSchemaQueryKey: (datasetId: string, datasetVersion: number) => readonly ["data-manager-api", `/dataset/${string}/schema/${number}`];
|
|
270
|
+
declare const getGetSchemaQueryOptions: <TData = DatasetSchemaGetResponse, TError = ErrorType<void | DmError>>(datasetId: string, datasetVersion: number, options?: {
|
|
271
|
+
query?: UseQueryOptions<DatasetSchemaGetResponse, TError, TData, QueryKey> | undefined;
|
|
272
|
+
request?: SecondParameter<typeof customInstance>;
|
|
273
|
+
} | undefined) => UseQueryOptions<DatasetSchemaGetResponse, TError, TData, QueryKey> & {
|
|
274
|
+
queryKey: QueryKey;
|
|
275
|
+
};
|
|
198
276
|
type GetSchemaQueryResult = NonNullable<Awaited<ReturnType<typeof getSchema>>>;
|
|
199
277
|
type GetSchemaQueryError = ErrorType<void | DmError>;
|
|
200
278
|
declare const useGetSchema: <TData = DatasetSchemaGetResponse, TError = ErrorType<void | DmError>>(datasetId: string, datasetVersion: number, options?: {
|
|
@@ -204,4 +282,4 @@ declare const useGetSchema: <TData = DatasetSchemaGetResponse, TError = ErrorTyp
|
|
|
204
282
|
queryKey: QueryKey;
|
|
205
283
|
};
|
|
206
284
|
|
|
207
|
-
export { AddEditorToDatasetMutationError, AddEditorToDatasetMutationResult, CreateDatasetFromFileMutationBody, CreateDatasetFromFileMutationError, CreateDatasetFromFileMutationResult, DeleteDatasetMutationError, DeleteDatasetMutationResult, DownloadDatasetQueryError, DownloadDatasetQueryResult, GetDatasetDigestQueryError, GetDatasetDigestQueryResult, GetDatasetsQueryError, GetDatasetsQueryResult, GetSchemaQueryError, GetSchemaQueryResult, GetVersionsQueryError, GetVersionsQueryResult, RemoveEditorFromDatasetMutationError, RemoveEditorFromDatasetMutationResult, UploadDatasetMutationBody, UploadDatasetMutationError, UploadDatasetMutationResult, addEditorToDataset, createDatasetFromFile, deleteDataset, downloadDataset, getDatasetDigest, getDatasets, getDownloadDatasetQueryKey, getGetDatasetDigestQueryKey, getGetDatasetsQueryKey, getGetSchemaQueryKey, getGetVersionsQueryKey, getSchema, getVersions, removeEditorFromDataset, uploadDataset, useAddEditorToDataset, useCreateDatasetFromFile, useDeleteDataset, useDownloadDataset, useGetDatasetDigest, useGetDatasets, useGetSchema, useGetVersions, useRemoveEditorFromDataset, useUploadDataset };
|
|
285
|
+
export { AddEditorToDatasetMutationError, AddEditorToDatasetMutationResult, CreateDatasetFromFileMutationBody, CreateDatasetFromFileMutationError, CreateDatasetFromFileMutationResult, DeleteDatasetMutationError, DeleteDatasetMutationResult, DownloadDatasetQueryError, DownloadDatasetQueryResult, GetDatasetDigestQueryError, GetDatasetDigestQueryResult, GetDatasetsQueryError, GetDatasetsQueryResult, GetSchemaQueryError, GetSchemaQueryResult, GetVersionsQueryError, GetVersionsQueryResult, RemoveEditorFromDatasetMutationError, RemoveEditorFromDatasetMutationResult, UploadDatasetMutationBody, UploadDatasetMutationError, UploadDatasetMutationResult, addEditorToDataset, createDatasetFromFile, deleteDataset, downloadDataset, getAddEditorToDatasetMutationOptions, getCreateDatasetFromFileMutationOptions, getDatasetDigest, getDatasets, getDeleteDatasetMutationOptions, getDownloadDatasetQueryKey, getDownloadDatasetQueryOptions, getGetDatasetDigestQueryKey, getGetDatasetDigestQueryOptions, getGetDatasetsQueryKey, getGetDatasetsQueryOptions, getGetSchemaQueryKey, getGetSchemaQueryOptions, getGetVersionsQueryKey, getGetVersionsQueryOptions, getRemoveEditorFromDatasetMutationOptions, getSchema, getUploadDatasetMutationOptions, getVersions, removeEditorFromDataset, uploadDataset, useAddEditorToDataset, useCreateDatasetFromFile, useDeleteDataset, useDownloadDataset, useGetDatasetDigest, useGetDatasets, useGetSchema, useGetVersions, useRemoveEditorFromDataset, useUploadDataset };
|
package/dataset/dataset.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
queryMutator
|
|
3
|
-
} from "../chunk-LT4O36DN.js";
|
|
4
1
|
import {
|
|
5
2
|
customInstance
|
|
6
3
|
} from "../chunk-3RNIDX7T.js";
|
|
@@ -41,13 +38,17 @@ var createDatasetFromFile = (datasetPutBodyBody, options) => {
|
|
|
41
38
|
options
|
|
42
39
|
);
|
|
43
40
|
};
|
|
44
|
-
var
|
|
41
|
+
var getCreateDatasetFromFileMutationOptions = (options) => {
|
|
45
42
|
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
46
43
|
const mutationFn = (props) => {
|
|
47
44
|
const { data } = props ?? {};
|
|
48
45
|
return createDatasetFromFile(data, requestOptions);
|
|
49
46
|
};
|
|
50
|
-
return
|
|
47
|
+
return { mutationFn, ...mutationOptions };
|
|
48
|
+
};
|
|
49
|
+
var useCreateDatasetFromFile = (options) => {
|
|
50
|
+
const mutationOptions = getCreateDatasetFromFileMutationOptions(options);
|
|
51
|
+
return useMutation(mutationOptions);
|
|
51
52
|
};
|
|
52
53
|
var uploadDataset = (datasetPostBodyBody, options) => {
|
|
53
54
|
const formData = new FormData();
|
|
@@ -82,13 +83,17 @@ var uploadDataset = (datasetPostBodyBody, options) => {
|
|
|
82
83
|
options
|
|
83
84
|
);
|
|
84
85
|
};
|
|
85
|
-
var
|
|
86
|
+
var getUploadDatasetMutationOptions = (options) => {
|
|
86
87
|
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
87
88
|
const mutationFn = (props) => {
|
|
88
89
|
const { data } = props ?? {};
|
|
89
90
|
return uploadDataset(data, requestOptions);
|
|
90
91
|
};
|
|
91
|
-
return
|
|
92
|
+
return { mutationFn, ...mutationOptions };
|
|
93
|
+
};
|
|
94
|
+
var useUploadDataset = (options) => {
|
|
95
|
+
const mutationOptions = getUploadDatasetMutationOptions(options);
|
|
96
|
+
return useMutation(mutationOptions);
|
|
92
97
|
};
|
|
93
98
|
var getDatasets = (params, options, signal) => {
|
|
94
99
|
return customInstance(
|
|
@@ -96,19 +101,19 @@ var getDatasets = (params, options, signal) => {
|
|
|
96
101
|
options
|
|
97
102
|
);
|
|
98
103
|
};
|
|
99
|
-
var getGetDatasetsQueryKey = (params) => [
|
|
100
|
-
|
|
101
|
-
...params ? [params] : []
|
|
102
|
-
];
|
|
103
|
-
var useGetDatasets = (params, options) => {
|
|
104
|
+
var getGetDatasetsQueryKey = (params) => ["data-manager-api", `/dataset`, ...params ? [params] : []];
|
|
105
|
+
var getGetDatasetsQueryOptions = (params, options) => {
|
|
104
106
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
105
107
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetDatasetsQueryKey(params);
|
|
106
108
|
const queryFn = ({
|
|
107
109
|
signal
|
|
108
110
|
}) => getDatasets(params, requestOptions, signal);
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
112
|
+
};
|
|
113
|
+
var useGetDatasets = (params, options) => {
|
|
114
|
+
const queryOptions = getGetDatasetsQueryOptions(params, options);
|
|
115
|
+
const query = useQuery(queryOptions);
|
|
116
|
+
query.queryKey = queryOptions.queryKey;
|
|
112
117
|
return query;
|
|
113
118
|
};
|
|
114
119
|
var getVersions = (datasetId, params, options, signal) => {
|
|
@@ -117,16 +122,19 @@ var getVersions = (datasetId, params, options, signal) => {
|
|
|
117
122
|
options
|
|
118
123
|
);
|
|
119
124
|
};
|
|
120
|
-
var getGetVersionsQueryKey = (datasetId, params) => [`/dataset/${datasetId}/versions`, ...params ? [params] : []];
|
|
121
|
-
var
|
|
125
|
+
var getGetVersionsQueryKey = (datasetId, params) => ["data-manager-api", `/dataset/${datasetId}/versions`, ...params ? [params] : []];
|
|
126
|
+
var getGetVersionsQueryOptions = (datasetId, params, options) => {
|
|
122
127
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
123
128
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetVersionsQueryKey(datasetId, params);
|
|
124
129
|
const queryFn = ({
|
|
125
130
|
signal
|
|
126
131
|
}) => getVersions(datasetId, params, requestOptions, signal);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
132
|
+
return { queryKey, queryFn, enabled: !!datasetId, ...queryOptions };
|
|
133
|
+
};
|
|
134
|
+
var useGetVersions = (datasetId, params, options) => {
|
|
135
|
+
const queryOptions = getGetVersionsQueryOptions(datasetId, params, options);
|
|
136
|
+
const query = useQuery(queryOptions);
|
|
137
|
+
query.queryKey = queryOptions.queryKey;
|
|
130
138
|
return query;
|
|
131
139
|
};
|
|
132
140
|
var deleteDataset = (datasetId, datasetVersion, params, options) => {
|
|
@@ -139,13 +147,17 @@ var deleteDataset = (datasetId, datasetVersion, params, options) => {
|
|
|
139
147
|
options
|
|
140
148
|
);
|
|
141
149
|
};
|
|
142
|
-
var
|
|
150
|
+
var getDeleteDatasetMutationOptions = (options) => {
|
|
143
151
|
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
144
152
|
const mutationFn = (props) => {
|
|
145
153
|
const { datasetId, datasetVersion, params } = props ?? {};
|
|
146
154
|
return deleteDataset(datasetId, datasetVersion, params, requestOptions);
|
|
147
155
|
};
|
|
148
|
-
return
|
|
156
|
+
return { mutationFn, ...mutationOptions };
|
|
157
|
+
};
|
|
158
|
+
var useDeleteDataset = (options) => {
|
|
159
|
+
const mutationOptions = getDeleteDatasetMutationOptions(options);
|
|
160
|
+
return useMutation(mutationOptions);
|
|
149
161
|
};
|
|
150
162
|
var downloadDataset = (datasetId, datasetVersion, options, signal) => {
|
|
151
163
|
return customInstance(
|
|
@@ -153,16 +165,28 @@ var downloadDataset = (datasetId, datasetVersion, options, signal) => {
|
|
|
153
165
|
options
|
|
154
166
|
);
|
|
155
167
|
};
|
|
156
|
-
var getDownloadDatasetQueryKey = (datasetId, datasetVersion) => [`/dataset/${datasetId}/${datasetVersion}`];
|
|
157
|
-
var
|
|
168
|
+
var getDownloadDatasetQueryKey = (datasetId, datasetVersion) => ["data-manager-api", `/dataset/${datasetId}/${datasetVersion}`];
|
|
169
|
+
var getDownloadDatasetQueryOptions = (datasetId, datasetVersion, options) => {
|
|
158
170
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
159
171
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getDownloadDatasetQueryKey(datasetId, datasetVersion);
|
|
160
172
|
const queryFn = ({
|
|
161
173
|
signal
|
|
162
174
|
}) => downloadDataset(datasetId, datasetVersion, requestOptions, signal);
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
175
|
+
return {
|
|
176
|
+
queryKey,
|
|
177
|
+
queryFn,
|
|
178
|
+
enabled: !!(datasetId && datasetVersion),
|
|
179
|
+
...queryOptions
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
var useDownloadDataset = (datasetId, datasetVersion, options) => {
|
|
183
|
+
const queryOptions = getDownloadDatasetQueryOptions(
|
|
184
|
+
datasetId,
|
|
185
|
+
datasetVersion,
|
|
186
|
+
options
|
|
187
|
+
);
|
|
188
|
+
const query = useQuery(queryOptions);
|
|
189
|
+
query.queryKey = queryOptions.queryKey;
|
|
166
190
|
return query;
|
|
167
191
|
};
|
|
168
192
|
var removeEditorFromDataset = (datasetId, userId, options) => {
|
|
@@ -171,13 +195,17 @@ var removeEditorFromDataset = (datasetId, userId, options) => {
|
|
|
171
195
|
options
|
|
172
196
|
);
|
|
173
197
|
};
|
|
174
|
-
var
|
|
198
|
+
var getRemoveEditorFromDatasetMutationOptions = (options) => {
|
|
175
199
|
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
176
200
|
const mutationFn = (props) => {
|
|
177
201
|
const { datasetId, userId } = props ?? {};
|
|
178
202
|
return removeEditorFromDataset(datasetId, userId, requestOptions);
|
|
179
203
|
};
|
|
180
|
-
return
|
|
204
|
+
return { mutationFn, ...mutationOptions };
|
|
205
|
+
};
|
|
206
|
+
var useRemoveEditorFromDataset = (options) => {
|
|
207
|
+
const mutationOptions = getRemoveEditorFromDatasetMutationOptions(options);
|
|
208
|
+
return useMutation(mutationOptions);
|
|
181
209
|
};
|
|
182
210
|
var addEditorToDataset = (datasetId, userId, options) => {
|
|
183
211
|
return customInstance(
|
|
@@ -185,13 +213,17 @@ var addEditorToDataset = (datasetId, userId, options) => {
|
|
|
185
213
|
options
|
|
186
214
|
);
|
|
187
215
|
};
|
|
188
|
-
var
|
|
216
|
+
var getAddEditorToDatasetMutationOptions = (options) => {
|
|
189
217
|
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
190
218
|
const mutationFn = (props) => {
|
|
191
219
|
const { datasetId, userId } = props ?? {};
|
|
192
220
|
return addEditorToDataset(datasetId, userId, requestOptions);
|
|
193
221
|
};
|
|
194
|
-
return
|
|
222
|
+
return { mutationFn, ...mutationOptions };
|
|
223
|
+
};
|
|
224
|
+
var useAddEditorToDataset = (options) => {
|
|
225
|
+
const mutationOptions = getAddEditorToDatasetMutationOptions(options);
|
|
226
|
+
return useMutation(mutationOptions);
|
|
195
227
|
};
|
|
196
228
|
var getDatasetDigest = (datasetDigest, options, signal) => {
|
|
197
229
|
return customInstance(
|
|
@@ -199,16 +231,17 @@ var getDatasetDigest = (datasetDigest, options, signal) => {
|
|
|
199
231
|
options
|
|
200
232
|
);
|
|
201
233
|
};
|
|
202
|
-
var getGetDatasetDigestQueryKey = (datasetDigest) => [
|
|
203
|
-
|
|
204
|
-
];
|
|
205
|
-
var useGetDatasetDigest = (datasetDigest, options) => {
|
|
234
|
+
var getGetDatasetDigestQueryKey = (datasetDigest) => ["data-manager-api", `/dataset/digest/${datasetDigest}`];
|
|
235
|
+
var getGetDatasetDigestQueryOptions = (datasetDigest, options) => {
|
|
206
236
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
207
237
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetDatasetDigestQueryKey(datasetDigest);
|
|
208
238
|
const queryFn = ({ signal }) => getDatasetDigest(datasetDigest, requestOptions, signal);
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
239
|
+
return { queryKey, queryFn, enabled: !!datasetDigest, ...queryOptions };
|
|
240
|
+
};
|
|
241
|
+
var useGetDatasetDigest = (datasetDigest, options) => {
|
|
242
|
+
const queryOptions = getGetDatasetDigestQueryOptions(datasetDigest, options);
|
|
243
|
+
const query = useQuery(queryOptions);
|
|
244
|
+
query.queryKey = queryOptions.queryKey;
|
|
212
245
|
return query;
|
|
213
246
|
};
|
|
214
247
|
var getSchema = (datasetId, datasetVersion, options, signal) => {
|
|
@@ -221,18 +254,28 @@ var getSchema = (datasetId, datasetVersion, options, signal) => {
|
|
|
221
254
|
options
|
|
222
255
|
);
|
|
223
256
|
};
|
|
224
|
-
var getGetSchemaQueryKey = (datasetId, datasetVersion) => [`/dataset/${datasetId}/schema/${datasetVersion}`];
|
|
225
|
-
var
|
|
257
|
+
var getGetSchemaQueryKey = (datasetId, datasetVersion) => ["data-manager-api", `/dataset/${datasetId}/schema/${datasetVersion}`];
|
|
258
|
+
var getGetSchemaQueryOptions = (datasetId, datasetVersion, options) => {
|
|
226
259
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
227
260
|
const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetSchemaQueryKey(datasetId, datasetVersion);
|
|
228
261
|
const queryFn = ({
|
|
229
262
|
signal
|
|
230
263
|
}) => getSchema(datasetId, datasetVersion, requestOptions, signal);
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
264
|
+
return {
|
|
265
|
+
queryKey,
|
|
266
|
+
queryFn,
|
|
267
|
+
enabled: !!(datasetId && datasetVersion),
|
|
268
|
+
...queryOptions
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
var useGetSchema = (datasetId, datasetVersion, options) => {
|
|
272
|
+
const queryOptions = getGetSchemaQueryOptions(
|
|
273
|
+
datasetId,
|
|
274
|
+
datasetVersion,
|
|
275
|
+
options
|
|
234
276
|
);
|
|
235
|
-
query
|
|
277
|
+
const query = useQuery(queryOptions);
|
|
278
|
+
query.queryKey = queryOptions.queryKey;
|
|
236
279
|
return query;
|
|
237
280
|
};
|
|
238
281
|
export {
|
|
@@ -240,14 +283,24 @@ export {
|
|
|
240
283
|
createDatasetFromFile,
|
|
241
284
|
deleteDataset,
|
|
242
285
|
downloadDataset,
|
|
286
|
+
getAddEditorToDatasetMutationOptions,
|
|
287
|
+
getCreateDatasetFromFileMutationOptions,
|
|
243
288
|
getDatasetDigest,
|
|
244
289
|
getDatasets,
|
|
290
|
+
getDeleteDatasetMutationOptions,
|
|
245
291
|
getDownloadDatasetQueryKey,
|
|
292
|
+
getDownloadDatasetQueryOptions,
|
|
246
293
|
getGetDatasetDigestQueryKey,
|
|
294
|
+
getGetDatasetDigestQueryOptions,
|
|
247
295
|
getGetDatasetsQueryKey,
|
|
296
|
+
getGetDatasetsQueryOptions,
|
|
248
297
|
getGetSchemaQueryKey,
|
|
298
|
+
getGetSchemaQueryOptions,
|
|
249
299
|
getGetVersionsQueryKey,
|
|
300
|
+
getGetVersionsQueryOptions,
|
|
301
|
+
getRemoveEditorFromDatasetMutationOptions,
|
|
250
302
|
getSchema,
|
|
303
|
+
getUploadDatasetMutationOptions,
|
|
251
304
|
getVersions,
|
|
252
305
|
removeEditorFromDataset,
|
|
253
306
|
uploadDataset,
|