@squonk/data-manager-client 0.7.15-rc.3 → 0.7.17
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.d.ts +1 -1
- package/admin/admin.cjs +12 -4
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +11 -6
- package/admin/admin.js +12 -4
- package/admin/admin.js.map +1 -1
- package/application/application.d.ts +1 -1
- package/{custom-instance-6059c489.d.ts → custom-instance-2adec346.d.ts} +10 -16
- package/dataset/dataset.cjs +0 -4
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +1 -1
- package/dataset/dataset.js +0 -4
- package/dataset/dataset.js.map +1 -1
- package/file/file.d.ts +1 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/instance/instance.d.ts +1 -1
- package/job/job.d.ts +1 -1
- package/metadata/metadata.d.ts +1 -1
- package/package.json +1 -1
- package/project/project.cjs +0 -2
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +1 -1
- package/project/project.js +0 -2
- package/project/project.js.map +1 -1
- package/src/admin/admin.ts +19 -8
- package/src/data-manager-api.schemas.ts +10 -15
- package/src/dataset/dataset.ts +0 -4
- package/src/project/project.ts +0 -2
- package/task/task.d.ts +1 -1
- package/type/type.d.ts +1 -1
- package/user/user.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
|
|
2
|
-
import {
|
|
2
|
+
import { bj as customInstance, bd as AccountServerGetNamespaceResponse, bk as ErrorType, bf as DmError, be as AccountServerGetRegistrationResponse, aD as VersionGetResponse } from '../custom-instance-2adec346.js';
|
|
3
3
|
import 'axios';
|
|
4
4
|
|
|
5
5
|
/**
|
package/admin/admin.cjs
CHANGED
|
@@ -109,13 +109,21 @@ var useAdminJobManifestPut = (options) => {
|
|
|
109
109
|
};
|
|
110
110
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
111
111
|
};
|
|
112
|
-
var adminJobManifestLoad = (options) => {
|
|
113
|
-
|
|
112
|
+
var adminJobManifestLoad = (jobManifestLoadPutBodyBody, options) => {
|
|
113
|
+
const formData = new FormData();
|
|
114
|
+
formData.append("purge", jobManifestLoadPutBodyBody.purge.toString());
|
|
115
|
+
return _chunkNGBTCJWScjs.customInstance.call(void 0, {
|
|
116
|
+
url: `/admin/job-manifest/load`,
|
|
117
|
+
method: "put",
|
|
118
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
119
|
+
data: formData
|
|
120
|
+
}, options);
|
|
114
121
|
};
|
|
115
122
|
var useAdminJobManifestLoad = (options) => {
|
|
116
123
|
const { mutation: mutationOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
117
|
-
const mutationFn = () => {
|
|
118
|
-
|
|
124
|
+
const mutationFn = (props) => {
|
|
125
|
+
const { data } = _nullishCoalesce(props, () => ( {}));
|
|
126
|
+
return adminJobManifestLoad(data, requestOptions);
|
|
119
127
|
};
|
|
120
128
|
return _reactquery.useMutation.call(void 0, mutationFn, mutationOptions);
|
|
121
129
|
};
|
package/admin/admin.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/admin/admin.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAwCO,IAAM,wBAAwB,CACnC,QACA,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,wBAAwB,QAAQ,OAAO,QAAQ,OAAO,GAC7D,OACF;AACF;AAEO,IAAM,mCAAmC,CAC9C,WACG,CAAC,wBAAwB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAOlD,IAAM,2BAA2B,CAItC,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WACJ,8CAAc,aAAY,iCAAiC,MAAM;AAEnE,QAAM,UAEF,CA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AM;AAAA,EACR,GACA,OACF;AACF;AAQO,IAAM,yBAAyB,CAGpC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,SAAS,CAAC;AAE3B,WAAO,oBAAoB,MAAM,cAAc;AAAA,EACjD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAQO,IAAM,uBAAuB,CAClC,YACG;AACH,SAAO,eACL,EAAE,KAAK,4BAA4B,QAAQ,MAAM,GACjD,OACF;AACF;AAQO,IAAM,0BAA0B,CAIrC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,MAAM;AACR,WAAO,qBAAqB,cAAc;AAAA,EAC5C;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B","sourcesContent":["/**\n * Generated by orval v6.8.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: 0.7\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n ServiceErrorsGetResponse,\n DmError,\n AdminGetServiceErrorsParams,\n AdminUserPutResponse,\n UserPatchBodyBody,\n AdminJobManifestLoadPutResponse,\n JobManifestPutBodyBody,\n} from \"../data-manager-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\nexport type AwaitedInput<T> = PromiseLike<T> | T;\n\nexport type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\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 * Displays the existing Service Errors, which can also include acnowledged errors, normally excluded from the list.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Gets Service Errors\n */\nexport const adminGetServiceErrors = (\n params?: AdminGetServiceErrorsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ServiceErrorsGetResponse>(\n { url: `/admin/service-error`, method: \"get\", signal, params },\n options\n );\n};\n\nexport const getAdminGetServiceErrorsQueryKey = (\n params?: AdminGetServiceErrorsParams\n) => [`/admin/service-error`, ...(params ? [params] : [])];\n\nexport type AdminGetServiceErrorsQueryResult = NonNullable<\n Awaited<ReturnType<typeof adminGetServiceErrors>>\n>;\nexport type AdminGetServiceErrorsQueryError = ErrorType<void | DmError>;\n\nexport const useAdminGetServiceErrors = <\n TData = Awaited<ReturnType<typeof adminGetServiceErrors>>,\n TError = ErrorType<void | DmError>\n>(\n params?: AdminGetServiceErrorsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof adminGetServiceErrors>>,\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 ?? getAdminGetServiceErrorsQueryKey(params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof adminGetServiceErrors>>\n > = ({ signal }) => adminGetServiceErrors(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof adminGetServiceErrors>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Used primarily to 'Acknowledge' but not delete a Service Error.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Patches a Service Error\n */\nexport const adminPatchServiceError = (\n errorId: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/admin/service-error/${errorId}`, method: \"patch\" },\n options\n );\n};\n\nexport type AdminPatchServiceErrorMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminPatchServiceError>>\n>;\n\nexport type AdminPatchServiceErrorMutationError = ErrorType<DmError>;\n\nexport const useAdminPatchServiceError = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminPatchServiceError>>,\n TError,\n { errorId: number },\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 adminPatchServiceError>>,\n { errorId: number }\n > = (props) => {\n const { errorId } = props ?? {};\n\n return adminPatchServiceError(errorId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminPatchServiceError>>,\n TError,\n { errorId: number },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes an existing Service Error.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Deletes a Service Error\n */\nexport const adminDeleteServiceError = (\n errorId: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/admin/service-error/${errorId}`, method: \"delete\" },\n options\n );\n};\n\nexport type AdminDeleteServiceErrorMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminDeleteServiceError>>\n>;\n\nexport type AdminDeleteServiceErrorMutationError = ErrorType<DmError>;\n\nexport const useAdminDeleteServiceError = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminDeleteServiceError>>,\n TError,\n { errorId: number },\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 adminDeleteServiceError>>,\n { errorId: number }\n > = (props) => {\n const { errorId } = props ?? {};\n\n return adminDeleteServiceError(errorId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminDeleteServiceError>>,\n TError,\n { errorId: number },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * This method adds a user to the Data Manager service. The user is authenticated via a keycloak server but will need an initialised account before they can create Datasets or Projects.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Prepares a user account in the Data Manager service\n */\nexport const adminPutUser = (\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<AdminUserPutResponse>(\n { url: `/admin/user/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AdminPutUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminPutUser>>\n>;\n\nexport type AdminPutUserMutationError = ErrorType<void | DmError>;\n\nexport const useAdminPutUser = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminPutUser>>,\n TError,\n { 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 adminPutUser>>,\n { userId: string }\n > = (props) => {\n const { userId } = props ?? {};\n\n return adminPutUser(userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminPutUser>>,\n TError,\n { userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a user account, along with all the user's Datasets\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Deletes a user account\n */\nexport const adminDeleteUser = (\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/admin/user/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type AdminDeleteUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminDeleteUser>>\n>;\n\nexport type AdminDeleteUserMutationError = ErrorType<DmError>;\n\nexport const useAdminDeleteUser = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminDeleteUser>>,\n TError,\n { 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 adminDeleteUser>>,\n { userId: string }\n > = (props) => {\n const { userId } = props ?? {};\n\n return adminDeleteUser(userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminDeleteUser>>,\n TError,\n { userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Patches a user record, typcially to suspend or re-enable a user account\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Patch a given user\n */\nexport const adminPatchUser = (\n userId: string,\n userPatchBodyBody: UserPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (userPatchBodyBody.suspend_message !== undefined) {\n formData.append(\"suspend_message\", userPatchBodyBody.suspend_message);\n }\n\n return customInstance<void>(\n {\n url: `/admin/user/${userId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AdminPatchUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminPatchUser>>\n>;\nexport type AdminPatchUserMutationBody = UserPatchBodyBody;\nexport type AdminPatchUserMutationError = ErrorType<DmError>;\n\nexport const useAdminPatchUser = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminPatchUser>>,\n TError,\n { userId: string; data: UserPatchBodyBody },\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 adminPatchUser>>,\n { userId: string; data: UserPatchBodyBody }\n > = (props) => {\n const { userId, data } = props ?? {};\n\n return adminPatchUser(userId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminPatchUser>>,\n TError,\n { userId: string; data: UserPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * This endpoint is used to add (or update an existing manifest). Manifests are the soirce of Job defintions. Once added the manifest is inspected and any Jobs it refers to are loaded.\n\nA limited number of manifest origins (URLs) are supported. At the moment we support basic GitHib and GitLab URLs, i.e. those that begin `https://raw.githubusercontent.com/` and `https://gitlab.com/api/v4/projects/`.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Adds a manifest and triggers the download of Job Definitions\n */\nexport const adminJobManifestPut = (\n jobManifestPutBodyBody: JobManifestPutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"url\", jobManifestPutBodyBody.url);\n if (jobManifestPutBodyBody.header !== undefined) {\n formData.append(\"header\", jobManifestPutBodyBody.header);\n }\n if (jobManifestPutBodyBody.params !== undefined) {\n formData.append(\"params\", jobManifestPutBodyBody.params);\n }\n\n return customInstance<AdminJobManifestLoadPutResponse>(\n {\n url: `/admin/job-manifest`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AdminJobManifestPutMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminJobManifestPut>>\n>;\nexport type AdminJobManifestPutMutationBody = JobManifestPutBodyBody;\nexport type AdminJobManifestPutMutationError = ErrorType<void | DmError>;\n\nexport const useAdminJobManifestPut = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminJobManifestPut>>,\n TError,\n { data: JobManifestPutBodyBody },\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 adminJobManifestPut>>,\n { data: JobManifestPutBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return adminJobManifestPut(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminJobManifestPut>>,\n TError,\n { data: JobManifestPutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * This endpoint is used to trigger the Data Manager to re-inspect the internal Job **Manifest** table and download the manifests and reprocess the related job definitions. This is normally done by an administrator when the Manifest table has been modified or if external job defitnions are known to have changed in the referenced repositories.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Trigger a download of known Job Definitions using the Manifest table\n */\nexport const adminJobManifestLoad = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<AdminJobManifestLoadPutResponse>(\n { url: `/admin/job-manifest/load`, method: \"put\" },\n options\n );\n};\n\nexport type AdminJobManifestLoadMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminJobManifestLoad>>\n>;\n\nexport type AdminJobManifestLoadMutationError = ErrorType<void | DmError>;\n\nexport const useAdminJobManifestLoad = <\n TError = ErrorType<void | DmError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminJobManifestLoad>>,\n TError,\n TVariables,\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 adminJobManifestLoad>>,\n TVariables\n > = () => {\n return adminJobManifestLoad(requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminJobManifestLoad>>,\n TError,\n TVariables,\n TContext\n >(mutationFn, mutationOptions);\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/admin/admin.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAyCO,IAAM,wBAAwB,CACnC,QACA,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,wBAAwB,QAAQ,OAAO,QAAQ,OAAO,GAC7D,OACF;AACF;AAEO,IAAM,mCAAmC,CAC9C,WACG,CAAC,wBAAwB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAOlD,IAAM,2BAA2B,CAItC,QACA,YA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BAAuB,MAAM;AAAA,EACzD;AAEA,SAAO,eACL;AAAA,IACE,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,IACjD,MAAM;AAAA,EACR,GACA,OACF;AACF;AAQO,IAAM,yBAAyB,CAGpC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,SAAS,CAAC;AAE3B,WAAO,oBAAoB,MAAM,cAAc;AAAA,EACjD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAQO,IAAM,uBAAuB,CAClC,4BACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,SAAS,2BAA2B,MAAM,SAAS,CAAC;AAEpE,SAAO,eACL;AAAA,IACE,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,IACjD,MAAM;AAAA,EACR,GACA,OACF;AACF;AAQO,IAAM,0BAA0B,CAGrC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,SAAS,CAAC;AAE3B,WAAO,qBAAqB,MAAM,cAAc;AAAA,EAClD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B","sourcesContent":["/**\n * Generated by orval v6.8.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: 0.7\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n ServiceErrorsGetResponse,\n DmError,\n AdminGetServiceErrorsParams,\n AdminUserPutResponse,\n UserPatchBodyBody,\n AdminJobManifestLoadPutResponse,\n JobManifestPutBodyBody,\n JobManifestLoadPutBodyBody,\n} from \"../data-manager-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\nexport type AwaitedInput<T> = PromiseLike<T> | T;\n\nexport type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\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 * Displays the existing Service Errors, which can also include acnowledged errors, normally excluded from the list.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Gets Service Errors\n */\nexport const adminGetServiceErrors = (\n params?: AdminGetServiceErrorsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ServiceErrorsGetResponse>(\n { url: `/admin/service-error`, method: \"get\", signal, params },\n options\n );\n};\n\nexport const getAdminGetServiceErrorsQueryKey = (\n params?: AdminGetServiceErrorsParams\n) => [`/admin/service-error`, ...(params ? [params] : [])];\n\nexport type AdminGetServiceErrorsQueryResult = NonNullable<\n Awaited<ReturnType<typeof adminGetServiceErrors>>\n>;\nexport type AdminGetServiceErrorsQueryError = ErrorType<void | DmError>;\n\nexport const useAdminGetServiceErrors = <\n TData = Awaited<ReturnType<typeof adminGetServiceErrors>>,\n TError = ErrorType<void | DmError>\n>(\n params?: AdminGetServiceErrorsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof adminGetServiceErrors>>,\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 ?? getAdminGetServiceErrorsQueryKey(params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof adminGetServiceErrors>>\n > = ({ signal }) => adminGetServiceErrors(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof adminGetServiceErrors>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Used primarily to 'Acknowledge' but not delete a Service Error.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Patches a Service Error\n */\nexport const adminPatchServiceError = (\n errorId: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/admin/service-error/${errorId}`, method: \"patch\" },\n options\n );\n};\n\nexport type AdminPatchServiceErrorMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminPatchServiceError>>\n>;\n\nexport type AdminPatchServiceErrorMutationError = ErrorType<DmError>;\n\nexport const useAdminPatchServiceError = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminPatchServiceError>>,\n TError,\n { errorId: number },\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 adminPatchServiceError>>,\n { errorId: number }\n > = (props) => {\n const { errorId } = props ?? {};\n\n return adminPatchServiceError(errorId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminPatchServiceError>>,\n TError,\n { errorId: number },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes an existing Service Error.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Deletes a Service Error\n */\nexport const adminDeleteServiceError = (\n errorId: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/admin/service-error/${errorId}`, method: \"delete\" },\n options\n );\n};\n\nexport type AdminDeleteServiceErrorMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminDeleteServiceError>>\n>;\n\nexport type AdminDeleteServiceErrorMutationError = ErrorType<DmError>;\n\nexport const useAdminDeleteServiceError = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminDeleteServiceError>>,\n TError,\n { errorId: number },\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 adminDeleteServiceError>>,\n { errorId: number }\n > = (props) => {\n const { errorId } = props ?? {};\n\n return adminDeleteServiceError(errorId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminDeleteServiceError>>,\n TError,\n { errorId: number },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * This method adds a user to the Data Manager service. The user is authenticated via a keycloak server but will need an initialised account before they can create Datasets or Projects.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Prepares a user account in the Data Manager service\n */\nexport const adminPutUser = (\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<AdminUserPutResponse>(\n { url: `/admin/user/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AdminPutUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminPutUser>>\n>;\n\nexport type AdminPutUserMutationError = ErrorType<void | DmError>;\n\nexport const useAdminPutUser = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminPutUser>>,\n TError,\n { 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 adminPutUser>>,\n { userId: string }\n > = (props) => {\n const { userId } = props ?? {};\n\n return adminPutUser(userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminPutUser>>,\n TError,\n { userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a user account, along with all the user's Datasets\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Deletes a user account\n */\nexport const adminDeleteUser = (\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/admin/user/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type AdminDeleteUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminDeleteUser>>\n>;\n\nexport type AdminDeleteUserMutationError = ErrorType<DmError>;\n\nexport const useAdminDeleteUser = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminDeleteUser>>,\n TError,\n { 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 adminDeleteUser>>,\n { userId: string }\n > = (props) => {\n const { userId } = props ?? {};\n\n return adminDeleteUser(userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminDeleteUser>>,\n TError,\n { userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Patches a user record, typcially to suspend or re-enable a user account\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Patch a given user\n */\nexport const adminPatchUser = (\n userId: string,\n userPatchBodyBody: UserPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (userPatchBodyBody.suspend_message !== undefined) {\n formData.append(\"suspend_message\", userPatchBodyBody.suspend_message);\n }\n\n return customInstance<void>(\n {\n url: `/admin/user/${userId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AdminPatchUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminPatchUser>>\n>;\nexport type AdminPatchUserMutationBody = UserPatchBodyBody;\nexport type AdminPatchUserMutationError = ErrorType<DmError>;\n\nexport const useAdminPatchUser = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminPatchUser>>,\n TError,\n { userId: string; data: UserPatchBodyBody },\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 adminPatchUser>>,\n { userId: string; data: UserPatchBodyBody }\n > = (props) => {\n const { userId, data } = props ?? {};\n\n return adminPatchUser(userId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminPatchUser>>,\n TError,\n { userId: string; data: UserPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * This endpoint is used to add (or update an existing manifest). Manifests are the soirce of Job defintions. Once added the manifest is inspected and any Jobs it refers to are loaded.\n\nA limited number of manifest origins (URLs) are supported. At the moment we support basic GitHib and GitLab URLs, i.e. those that begin `https://raw.githubusercontent.com/` and `https://gitlab.com/api/v4/projects/`.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Adds a manifest and triggers the download of Job Definitions\n */\nexport const adminJobManifestPut = (\n jobManifestPutBodyBody: JobManifestPutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"url\", jobManifestPutBodyBody.url);\n if (jobManifestPutBodyBody.header !== undefined) {\n formData.append(\"header\", jobManifestPutBodyBody.header);\n }\n if (jobManifestPutBodyBody.params !== undefined) {\n formData.append(\"params\", jobManifestPutBodyBody.params);\n }\n\n return customInstance<AdminJobManifestLoadPutResponse>(\n {\n url: `/admin/job-manifest`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AdminJobManifestPutMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminJobManifestPut>>\n>;\nexport type AdminJobManifestPutMutationBody = JobManifestPutBodyBody;\nexport type AdminJobManifestPutMutationError = ErrorType<void | DmError>;\n\nexport const useAdminJobManifestPut = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminJobManifestPut>>,\n TError,\n { data: JobManifestPutBodyBody },\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 adminJobManifestPut>>,\n { data: JobManifestPutBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return adminJobManifestPut(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminJobManifestPut>>,\n TError,\n { data: JobManifestPutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * This endpoint is used to trigger the Data Manager to re-inspect the internal Job **Manifest** table and download the manifests and reprocess the related job definitions. This is normally done by an administrator when the Manifest table has been modified or if external job defitnions are known to have changed in the referenced repositories.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Trigger a download of known Job Definitions using the Manifest table\n */\nexport const adminJobManifestLoad = (\n jobManifestLoadPutBodyBody: JobManifestLoadPutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"purge\", jobManifestLoadPutBodyBody.purge.toString());\n\n return customInstance<AdminJobManifestLoadPutResponse>(\n {\n url: `/admin/job-manifest/load`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AdminJobManifestLoadMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminJobManifestLoad>>\n>;\nexport type AdminJobManifestLoadMutationBody = JobManifestLoadPutBodyBody;\nexport type AdminJobManifestLoadMutationError = ErrorType<void | DmError>;\n\nexport const useAdminJobManifestLoad = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminJobManifestLoad>>,\n TError,\n { data: JobManifestLoadPutBodyBody },\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 adminJobManifestLoad>>,\n { data: JobManifestLoadPutBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return adminJobManifestLoad(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminJobManifestLoad>>,\n TError,\n { data: JobManifestLoadPutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n"]}
|
package/admin/admin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AdminGetServiceErrorsParams,
|
|
1
|
+
import { A as AdminGetServiceErrorsParams, bj as customInstance, aL as ServiceErrorsGetResponse, bk as ErrorType, bf as DmError, a1 as UserAccountDetail, U as UserPatchBodyBody, S as JobManifestPutBodyBody, bc as AdminJobManifestLoadPutResponse, T as JobManifestLoadPutBodyBody } from '../custom-instance-2adec346.js';
|
|
2
2
|
import * as react_query from 'react-query';
|
|
3
3
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
|
|
4
4
|
import 'axios';
|
|
@@ -144,12 +144,17 @@ You will need **admin** rights to use this endpoint
|
|
|
144
144
|
|
|
145
145
|
* @summary Trigger a download of known Job Definitions using the Manifest table
|
|
146
146
|
*/
|
|
147
|
-
declare const adminJobManifestLoad: (options?: SecondParameter<typeof customInstance>) => Promise<AdminJobManifestLoadPutResponse>;
|
|
147
|
+
declare const adminJobManifestLoad: (jobManifestLoadPutBodyBody: JobManifestLoadPutBodyBody, options?: SecondParameter<typeof customInstance>) => Promise<AdminJobManifestLoadPutResponse>;
|
|
148
148
|
declare type AdminJobManifestLoadMutationResult = NonNullable<Awaited<ReturnType<typeof adminJobManifestLoad>>>;
|
|
149
|
+
declare type AdminJobManifestLoadMutationBody = JobManifestLoadPutBodyBody;
|
|
149
150
|
declare type AdminJobManifestLoadMutationError = ErrorType<void | DmError>;
|
|
150
|
-
declare const useAdminJobManifestLoad: <TError = ErrorType<void | DmError>,
|
|
151
|
-
mutation?: UseMutationOptions<AdminJobManifestLoadPutResponse, TError,
|
|
151
|
+
declare const useAdminJobManifestLoad: <TError = ErrorType<void | DmError>, TContext = unknown>(options?: {
|
|
152
|
+
mutation?: UseMutationOptions<AdminJobManifestLoadPutResponse, TError, {
|
|
153
|
+
data: JobManifestLoadPutBodyBody;
|
|
154
|
+
}, TContext> | undefined;
|
|
152
155
|
request?: SecondParameter<typeof customInstance>;
|
|
153
|
-
} | undefined) => react_query.UseMutationResult<AdminJobManifestLoadPutResponse, TError,
|
|
156
|
+
} | undefined) => react_query.UseMutationResult<AdminJobManifestLoadPutResponse, TError, {
|
|
157
|
+
data: JobManifestLoadPutBodyBody;
|
|
158
|
+
}, TContext>;
|
|
154
159
|
|
|
155
|
-
export { AdminDeleteServiceErrorMutationError, AdminDeleteServiceErrorMutationResult, AdminDeleteUserMutationError, AdminDeleteUserMutationResult, AdminGetServiceErrorsQueryError, AdminGetServiceErrorsQueryResult, AdminJobManifestLoadMutationError, AdminJobManifestLoadMutationResult, AdminJobManifestPutMutationBody, AdminJobManifestPutMutationError, AdminJobManifestPutMutationResult, AdminPatchServiceErrorMutationError, AdminPatchServiceErrorMutationResult, AdminPatchUserMutationBody, AdminPatchUserMutationError, AdminPatchUserMutationResult, AdminPutUserMutationError, AdminPutUserMutationResult, Awaited, AwaitedInput, adminDeleteServiceError, adminDeleteUser, adminGetServiceErrors, adminJobManifestLoad, adminJobManifestPut, adminPatchServiceError, adminPatchUser, adminPutUser, getAdminGetServiceErrorsQueryKey, useAdminDeleteServiceError, useAdminDeleteUser, useAdminGetServiceErrors, useAdminJobManifestLoad, useAdminJobManifestPut, useAdminPatchServiceError, useAdminPatchUser, useAdminPutUser };
|
|
160
|
+
export { AdminDeleteServiceErrorMutationError, AdminDeleteServiceErrorMutationResult, AdminDeleteUserMutationError, AdminDeleteUserMutationResult, AdminGetServiceErrorsQueryError, AdminGetServiceErrorsQueryResult, AdminJobManifestLoadMutationBody, AdminJobManifestLoadMutationError, AdminJobManifestLoadMutationResult, AdminJobManifestPutMutationBody, AdminJobManifestPutMutationError, AdminJobManifestPutMutationResult, AdminPatchServiceErrorMutationError, AdminPatchServiceErrorMutationResult, AdminPatchUserMutationBody, AdminPatchUserMutationError, AdminPatchUserMutationResult, AdminPutUserMutationError, AdminPutUserMutationResult, Awaited, AwaitedInput, adminDeleteServiceError, adminDeleteUser, adminGetServiceErrors, adminJobManifestLoad, adminJobManifestPut, adminPatchServiceError, adminPatchUser, adminPutUser, getAdminGetServiceErrorsQueryKey, useAdminDeleteServiceError, useAdminDeleteUser, useAdminGetServiceErrors, useAdminJobManifestLoad, useAdminJobManifestPut, useAdminPatchServiceError, useAdminPatchUser, useAdminPutUser };
|
package/admin/admin.js
CHANGED
|
@@ -109,13 +109,21 @@ var useAdminJobManifestPut = (options) => {
|
|
|
109
109
|
};
|
|
110
110
|
return useMutation(mutationFn, mutationOptions);
|
|
111
111
|
};
|
|
112
|
-
var adminJobManifestLoad = (options) => {
|
|
113
|
-
|
|
112
|
+
var adminJobManifestLoad = (jobManifestLoadPutBodyBody, options) => {
|
|
113
|
+
const formData = new FormData();
|
|
114
|
+
formData.append("purge", jobManifestLoadPutBodyBody.purge.toString());
|
|
115
|
+
return customInstance({
|
|
116
|
+
url: `/admin/job-manifest/load`,
|
|
117
|
+
method: "put",
|
|
118
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
119
|
+
data: formData
|
|
120
|
+
}, options);
|
|
114
121
|
};
|
|
115
122
|
var useAdminJobManifestLoad = (options) => {
|
|
116
123
|
const { mutation: mutationOptions, request: requestOptions } = options ?? {};
|
|
117
|
-
const mutationFn = () => {
|
|
118
|
-
|
|
124
|
+
const mutationFn = (props) => {
|
|
125
|
+
const { data } = props ?? {};
|
|
126
|
+
return adminJobManifestLoad(data, requestOptions);
|
|
119
127
|
};
|
|
120
128
|
return useMutation(mutationFn, mutationOptions);
|
|
121
129
|
};
|
package/admin/admin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/admin/admin.ts"],"sourcesContent":["/**\n * Generated by orval v6.8.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: 0.7\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n ServiceErrorsGetResponse,\n DmError,\n AdminGetServiceErrorsParams,\n AdminUserPutResponse,\n UserPatchBodyBody,\n AdminJobManifestLoadPutResponse,\n JobManifestPutBodyBody,\n} from \"../data-manager-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\nexport type AwaitedInput<T> = PromiseLike<T> | T;\n\nexport type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\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 * Displays the existing Service Errors, which can also include acnowledged errors, normally excluded from the list.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Gets Service Errors\n */\nexport const adminGetServiceErrors = (\n params?: AdminGetServiceErrorsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ServiceErrorsGetResponse>(\n { url: `/admin/service-error`, method: \"get\", signal, params },\n options\n );\n};\n\nexport const getAdminGetServiceErrorsQueryKey = (\n params?: AdminGetServiceErrorsParams\n) => [`/admin/service-error`, ...(params ? [params] : [])];\n\nexport type AdminGetServiceErrorsQueryResult = NonNullable<\n Awaited<ReturnType<typeof adminGetServiceErrors>>\n>;\nexport type AdminGetServiceErrorsQueryError = ErrorType<void | DmError>;\n\nexport const useAdminGetServiceErrors = <\n TData = Awaited<ReturnType<typeof adminGetServiceErrors>>,\n TError = ErrorType<void | DmError>\n>(\n params?: AdminGetServiceErrorsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof adminGetServiceErrors>>,\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 ?? getAdminGetServiceErrorsQueryKey(params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof adminGetServiceErrors>>\n > = ({ signal }) => adminGetServiceErrors(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof adminGetServiceErrors>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Used primarily to 'Acknowledge' but not delete a Service Error.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Patches a Service Error\n */\nexport const adminPatchServiceError = (\n errorId: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/admin/service-error/${errorId}`, method: \"patch\" },\n options\n );\n};\n\nexport type AdminPatchServiceErrorMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminPatchServiceError>>\n>;\n\nexport type AdminPatchServiceErrorMutationError = ErrorType<DmError>;\n\nexport const useAdminPatchServiceError = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminPatchServiceError>>,\n TError,\n { errorId: number },\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 adminPatchServiceError>>,\n { errorId: number }\n > = (props) => {\n const { errorId } = props ?? {};\n\n return adminPatchServiceError(errorId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminPatchServiceError>>,\n TError,\n { errorId: number },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes an existing Service Error.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Deletes a Service Error\n */\nexport const adminDeleteServiceError = (\n errorId: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/admin/service-error/${errorId}`, method: \"delete\" },\n options\n );\n};\n\nexport type AdminDeleteServiceErrorMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminDeleteServiceError>>\n>;\n\nexport type AdminDeleteServiceErrorMutationError = ErrorType<DmError>;\n\nexport const useAdminDeleteServiceError = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminDeleteServiceError>>,\n TError,\n { errorId: number },\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 adminDeleteServiceError>>,\n { errorId: number }\n > = (props) => {\n const { errorId } = props ?? {};\n\n return adminDeleteServiceError(errorId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminDeleteServiceError>>,\n TError,\n { errorId: number },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * This method adds a user to the Data Manager service. The user is authenticated via a keycloak server but will need an initialised account before they can create Datasets or Projects.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Prepares a user account in the Data Manager service\n */\nexport const adminPutUser = (\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<AdminUserPutResponse>(\n { url: `/admin/user/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AdminPutUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminPutUser>>\n>;\n\nexport type AdminPutUserMutationError = ErrorType<void | DmError>;\n\nexport const useAdminPutUser = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminPutUser>>,\n TError,\n { 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 adminPutUser>>,\n { userId: string }\n > = (props) => {\n const { userId } = props ?? {};\n\n return adminPutUser(userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminPutUser>>,\n TError,\n { userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a user account, along with all the user's Datasets\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Deletes a user account\n */\nexport const adminDeleteUser = (\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/admin/user/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type AdminDeleteUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminDeleteUser>>\n>;\n\nexport type AdminDeleteUserMutationError = ErrorType<DmError>;\n\nexport const useAdminDeleteUser = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminDeleteUser>>,\n TError,\n { 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 adminDeleteUser>>,\n { userId: string }\n > = (props) => {\n const { userId } = props ?? {};\n\n return adminDeleteUser(userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminDeleteUser>>,\n TError,\n { userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Patches a user record, typcially to suspend or re-enable a user account\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Patch a given user\n */\nexport const adminPatchUser = (\n userId: string,\n userPatchBodyBody: UserPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (userPatchBodyBody.suspend_message !== undefined) {\n formData.append(\"suspend_message\", userPatchBodyBody.suspend_message);\n }\n\n return customInstance<void>(\n {\n url: `/admin/user/${userId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AdminPatchUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminPatchUser>>\n>;\nexport type AdminPatchUserMutationBody = UserPatchBodyBody;\nexport type AdminPatchUserMutationError = ErrorType<DmError>;\n\nexport const useAdminPatchUser = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminPatchUser>>,\n TError,\n { userId: string; data: UserPatchBodyBody },\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 adminPatchUser>>,\n { userId: string; data: UserPatchBodyBody }\n > = (props) => {\n const { userId, data } = props ?? {};\n\n return adminPatchUser(userId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminPatchUser>>,\n TError,\n { userId: string; data: UserPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * This endpoint is used to add (or update an existing manifest). Manifests are the soirce of Job defintions. Once added the manifest is inspected and any Jobs it refers to are loaded.\n\nA limited number of manifest origins (URLs) are supported. At the moment we support basic GitHib and GitLab URLs, i.e. those that begin `https://raw.githubusercontent.com/` and `https://gitlab.com/api/v4/projects/`.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Adds a manifest and triggers the download of Job Definitions\n */\nexport const adminJobManifestPut = (\n jobManifestPutBodyBody: JobManifestPutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"url\", jobManifestPutBodyBody.url);\n if (jobManifestPutBodyBody.header !== undefined) {\n formData.append(\"header\", jobManifestPutBodyBody.header);\n }\n if (jobManifestPutBodyBody.params !== undefined) {\n formData.append(\"params\", jobManifestPutBodyBody.params);\n }\n\n return customInstance<AdminJobManifestLoadPutResponse>(\n {\n url: `/admin/job-manifest`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AdminJobManifestPutMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminJobManifestPut>>\n>;\nexport type AdminJobManifestPutMutationBody = JobManifestPutBodyBody;\nexport type AdminJobManifestPutMutationError = ErrorType<void | DmError>;\n\nexport const useAdminJobManifestPut = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminJobManifestPut>>,\n TError,\n { data: JobManifestPutBodyBody },\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 adminJobManifestPut>>,\n { data: JobManifestPutBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return adminJobManifestPut(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminJobManifestPut>>,\n TError,\n { data: JobManifestPutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * This endpoint is used to trigger the Data Manager to re-inspect the internal Job **Manifest** table and download the manifests and reprocess the related job definitions. This is normally done by an administrator when the Manifest table has been modified or if external job defitnions are known to have changed in the referenced repositories.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Trigger a download of known Job Definitions using the Manifest table\n */\nexport const adminJobManifestLoad = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<AdminJobManifestLoadPutResponse>(\n { url: `/admin/job-manifest/load`, method: \"put\" },\n options\n );\n};\n\nexport type AdminJobManifestLoadMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminJobManifestLoad>>\n>;\n\nexport type AdminJobManifestLoadMutationError = ErrorType<void | DmError>;\n\nexport const useAdminJobManifestLoad = <\n TError = ErrorType<void | DmError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminJobManifestLoad>>,\n TError,\n TVariables,\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 adminJobManifestLoad>>,\n TVariables\n > = () => {\n return adminJobManifestLoad(requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminJobManifestLoad>>,\n TError,\n TVariables,\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAwCO,IAAM,wBAAwB,CACnC,QACA,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,wBAAwB,QAAQ,OAAO,QAAQ,OAAO,GAC7D,OACF;AACF;AAEO,IAAM,mCAAmC,CAC9C,WACG,CAAC,wBAAwB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAOlD,IAAM,2BAA2B,CAItC,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WACJ,8CAAc,aAAY,iCAAiC,MAAM;AAEnE,QAAM,UAEF,CAAC,EAAE,aAAa,sBAAsB,QAAQ,gBAAgB,MAAM;AAExE,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAEjC,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AASO,IAAM,yBAAyB,CACpC,SACA,YACG;AACH,SAAO,eACL,EAAE,KAAK,wBAAwB,WAAW,QAAQ,QAAQ,GAC1D,OACF;AACF;AAQO,IAAM,4BAA4B,CAGvC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,YAAY,SAAS,CAAC;AAE9B,WAAO,uBAAuB,SAAS,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BAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,MAAM;AACR,WAAO,qBAAqB,cAAc;AAAA,EAC5C;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/admin/admin.ts"],"sourcesContent":["/**\n * Generated by orval v6.8.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: 0.7\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n ServiceErrorsGetResponse,\n DmError,\n AdminGetServiceErrorsParams,\n AdminUserPutResponse,\n UserPatchBodyBody,\n AdminJobManifestLoadPutResponse,\n JobManifestPutBodyBody,\n JobManifestLoadPutBodyBody,\n} from \"../data-manager-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\nexport type AwaitedInput<T> = PromiseLike<T> | T;\n\nexport type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\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 * Displays the existing Service Errors, which can also include acnowledged errors, normally excluded from the list.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Gets Service Errors\n */\nexport const adminGetServiceErrors = (\n params?: AdminGetServiceErrorsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ServiceErrorsGetResponse>(\n { url: `/admin/service-error`, method: \"get\", signal, params },\n options\n );\n};\n\nexport const getAdminGetServiceErrorsQueryKey = (\n params?: AdminGetServiceErrorsParams\n) => [`/admin/service-error`, ...(params ? [params] : [])];\n\nexport type AdminGetServiceErrorsQueryResult = NonNullable<\n Awaited<ReturnType<typeof adminGetServiceErrors>>\n>;\nexport type AdminGetServiceErrorsQueryError = ErrorType<void | DmError>;\n\nexport const useAdminGetServiceErrors = <\n TData = Awaited<ReturnType<typeof adminGetServiceErrors>>,\n TError = ErrorType<void | DmError>\n>(\n params?: AdminGetServiceErrorsParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof adminGetServiceErrors>>,\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 ?? getAdminGetServiceErrorsQueryKey(params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof adminGetServiceErrors>>\n > = ({ signal }) => adminGetServiceErrors(params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof adminGetServiceErrors>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Used primarily to 'Acknowledge' but not delete a Service Error.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Patches a Service Error\n */\nexport const adminPatchServiceError = (\n errorId: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/admin/service-error/${errorId}`, method: \"patch\" },\n options\n );\n};\n\nexport type AdminPatchServiceErrorMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminPatchServiceError>>\n>;\n\nexport type AdminPatchServiceErrorMutationError = ErrorType<DmError>;\n\nexport const useAdminPatchServiceError = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminPatchServiceError>>,\n TError,\n { errorId: number },\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 adminPatchServiceError>>,\n { errorId: number }\n > = (props) => {\n const { errorId } = props ?? {};\n\n return adminPatchServiceError(errorId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminPatchServiceError>>,\n TError,\n { errorId: number },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes an existing Service Error.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Deletes a Service Error\n */\nexport const adminDeleteServiceError = (\n errorId: number,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/admin/service-error/${errorId}`, method: \"delete\" },\n options\n );\n};\n\nexport type AdminDeleteServiceErrorMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminDeleteServiceError>>\n>;\n\nexport type AdminDeleteServiceErrorMutationError = ErrorType<DmError>;\n\nexport const useAdminDeleteServiceError = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminDeleteServiceError>>,\n TError,\n { errorId: number },\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 adminDeleteServiceError>>,\n { errorId: number }\n > = (props) => {\n const { errorId } = props ?? {};\n\n return adminDeleteServiceError(errorId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminDeleteServiceError>>,\n TError,\n { errorId: number },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * This method adds a user to the Data Manager service. The user is authenticated via a keycloak server but will need an initialised account before they can create Datasets or Projects.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Prepares a user account in the Data Manager service\n */\nexport const adminPutUser = (\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<AdminUserPutResponse>(\n { url: `/admin/user/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AdminPutUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminPutUser>>\n>;\n\nexport type AdminPutUserMutationError = ErrorType<void | DmError>;\n\nexport const useAdminPutUser = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminPutUser>>,\n TError,\n { 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 adminPutUser>>,\n { userId: string }\n > = (props) => {\n const { userId } = props ?? {};\n\n return adminPutUser(userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminPutUser>>,\n TError,\n { userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a user account, along with all the user's Datasets\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Deletes a user account\n */\nexport const adminDeleteUser = (\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/admin/user/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type AdminDeleteUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminDeleteUser>>\n>;\n\nexport type AdminDeleteUserMutationError = ErrorType<DmError>;\n\nexport const useAdminDeleteUser = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminDeleteUser>>,\n TError,\n { 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 adminDeleteUser>>,\n { userId: string }\n > = (props) => {\n const { userId } = props ?? {};\n\n return adminDeleteUser(userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminDeleteUser>>,\n TError,\n { userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Patches a user record, typcially to suspend or re-enable a user account\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Patch a given user\n */\nexport const adminPatchUser = (\n userId: string,\n userPatchBodyBody: UserPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (userPatchBodyBody.suspend_message !== undefined) {\n formData.append(\"suspend_message\", userPatchBodyBody.suspend_message);\n }\n\n return customInstance<void>(\n {\n url: `/admin/user/${userId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AdminPatchUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminPatchUser>>\n>;\nexport type AdminPatchUserMutationBody = UserPatchBodyBody;\nexport type AdminPatchUserMutationError = ErrorType<DmError>;\n\nexport const useAdminPatchUser = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminPatchUser>>,\n TError,\n { userId: string; data: UserPatchBodyBody },\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 adminPatchUser>>,\n { userId: string; data: UserPatchBodyBody }\n > = (props) => {\n const { userId, data } = props ?? {};\n\n return adminPatchUser(userId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminPatchUser>>,\n TError,\n { userId: string; data: UserPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * This endpoint is used to add (or update an existing manifest). Manifests are the soirce of Job defintions. Once added the manifest is inspected and any Jobs it refers to are loaded.\n\nA limited number of manifest origins (URLs) are supported. At the moment we support basic GitHib and GitLab URLs, i.e. those that begin `https://raw.githubusercontent.com/` and `https://gitlab.com/api/v4/projects/`.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Adds a manifest and triggers the download of Job Definitions\n */\nexport const adminJobManifestPut = (\n jobManifestPutBodyBody: JobManifestPutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"url\", jobManifestPutBodyBody.url);\n if (jobManifestPutBodyBody.header !== undefined) {\n formData.append(\"header\", jobManifestPutBodyBody.header);\n }\n if (jobManifestPutBodyBody.params !== undefined) {\n formData.append(\"params\", jobManifestPutBodyBody.params);\n }\n\n return customInstance<AdminJobManifestLoadPutResponse>(\n {\n url: `/admin/job-manifest`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AdminJobManifestPutMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminJobManifestPut>>\n>;\nexport type AdminJobManifestPutMutationBody = JobManifestPutBodyBody;\nexport type AdminJobManifestPutMutationError = ErrorType<void | DmError>;\n\nexport const useAdminJobManifestPut = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminJobManifestPut>>,\n TError,\n { data: JobManifestPutBodyBody },\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 adminJobManifestPut>>,\n { data: JobManifestPutBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return adminJobManifestPut(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminJobManifestPut>>,\n TError,\n { data: JobManifestPutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * This endpoint is used to trigger the Data Manager to re-inspect the internal Job **Manifest** table and download the manifests and reprocess the related job definitions. This is normally done by an administrator when the Manifest table has been modified or if external job defitnions are known to have changed in the referenced repositories.\n\nYou will need **admin** rights to use this endpoint\n\n * @summary Trigger a download of known Job Definitions using the Manifest table\n */\nexport const adminJobManifestLoad = (\n jobManifestLoadPutBodyBody: JobManifestLoadPutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"purge\", jobManifestLoadPutBodyBody.purge.toString());\n\n return customInstance<AdminJobManifestLoadPutResponse>(\n {\n url: `/admin/job-manifest/load`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AdminJobManifestLoadMutationResult = NonNullable<\n Awaited<ReturnType<typeof adminJobManifestLoad>>\n>;\nexport type AdminJobManifestLoadMutationBody = JobManifestLoadPutBodyBody;\nexport type AdminJobManifestLoadMutationError = ErrorType<void | DmError>;\n\nexport const useAdminJobManifestLoad = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof adminJobManifestLoad>>,\n TError,\n { data: JobManifestLoadPutBodyBody },\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 adminJobManifestLoad>>,\n { data: JobManifestLoadPutBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return adminJobManifestLoad(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof adminJobManifestLoad>>,\n TError,\n { data: JobManifestLoadPutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n"],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAyCO,IAAM,wBAAwB,CACnC,QACA,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,wBAAwB,QAAQ,OAAO,QAAQ,OAAO,GAC7D,OACF;AACF;AAEO,IAAM,mCAAmC,CAC9C,WACG,CAAC,wBAAwB,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAOlD,IAAM,2BAA2B,CAItC,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WACJ,8CAAc,aAAY,iCAAiC,MAAM;AAEnE,QAAM,UAEF,CAAC,EAAE,aAAa,sB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,OACF;AACF;AAQO,IAAM,yBAAyB,CAGpC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,SAAS,CAAC;AAE3B,WAAO,oBAAoB,MAAM,cAAc;AAAA,EACjD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;AAQO,IAAM,uBAAuB,CAClC,4BACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,SAAS,2BAA2B,MAAM,SAAS,CAAC;AAEpE,SAAO,eACL;AAAA,IACE,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,IACjD,MAAM;AAAA,EACR,GACA,OACF;AACF;AAQO,IAAM,0BAA0B,CAGrC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,SAAS,CAAC;AAE3B,WAAO,qBAAqB,MAAM,cAAc;AAAA,EAClD;AAEA,SAAO,YAKL,YAAY,eAAe;AAC/B;","names":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
|
|
2
|
-
import {
|
|
2
|
+
import { bj as customInstance, b9 as ApplicationsGetResponse, bk as ErrorType, bf as DmError, ba as ApplicationGetResponse } from '../custom-instance-2adec346.js';
|
|
3
3
|
import 'axios';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -217,12 +217,6 @@ declare type ProjectPostBodyBody = {
|
|
|
217
217
|
/** Whether the project is private. You may not be permitted to make the project private, that will depend on the project product you're using to create the project
|
|
218
218
|
*/
|
|
219
219
|
private?: boolean;
|
|
220
|
-
/** The Organisation the Project belongs to
|
|
221
|
-
*/
|
|
222
|
-
organisation_id: string;
|
|
223
|
-
/** The Organisational Unit the Project belongs to
|
|
224
|
-
*/
|
|
225
|
-
unit_id: string;
|
|
226
220
|
/** The Data Manager *Tier Product ID* you're using to create the Project
|
|
227
221
|
*/
|
|
228
222
|
tier_product_id: string;
|
|
@@ -250,6 +244,12 @@ declare type JobManifestPutBodyBody = {
|
|
|
250
244
|
/** Optional URL parameter values (a JSON string) */
|
|
251
245
|
params?: string;
|
|
252
246
|
};
|
|
247
|
+
declare type JobManifestLoadPutBodyBody = {
|
|
248
|
+
/** Set to remove all pre-existing Job Definitions that are not present in the existing manifests after the load is complete.
|
|
249
|
+
|
|
250
|
+
Jobs in the collection `im-test` are not removed */
|
|
251
|
+
purge: boolean;
|
|
252
|
+
};
|
|
253
253
|
declare type InstancePostBodyBody = {
|
|
254
254
|
/** A supported application. Applications instances are managed using pre-deployed Kubernetes **Operators**. The application ID is a combination of the operator _plural_ and _group_.
|
|
255
255
|
*/
|
|
@@ -338,9 +338,6 @@ declare type DatasetPutBodyBody = {
|
|
|
338
338
|
/** If provided the File becomes a new version of the Dataset named. If not provided this File becomes the first version of a new Dataset, whose ID is returned to you on success.
|
|
339
339
|
*/
|
|
340
340
|
dataset_id?: string;
|
|
341
|
-
/** The Organisation you want the Dataset to belong to. If not supplied the Project Organisation is used
|
|
342
|
-
*/
|
|
343
|
-
organisation_id?: string;
|
|
344
341
|
/** The Organisational Unit you want the Dataset to belong to. If not supplied the Project Unit is used
|
|
345
342
|
*/
|
|
346
343
|
unit_id?: string;
|
|
@@ -378,9 +375,6 @@ declare type DatasetPostBodyBody = {
|
|
|
378
375
|
/** If provided the Dataset becomes a new version of the Dataset named. If not provided this Dataset becomes the first version of a new Dataset, whose ID is returned to you on success.
|
|
379
376
|
*/
|
|
380
377
|
dataset_id?: string;
|
|
381
|
-
/** The Organisation you want the Dataset to belong to
|
|
382
|
-
*/
|
|
383
|
-
organisation_id: string;
|
|
384
378
|
/** The Organisational Unit you want the Dataset to belong to
|
|
385
379
|
*/
|
|
386
380
|
unit_id: string;
|
|
@@ -1448,14 +1442,14 @@ interface AdminJobManifestLoadPutResponse {
|
|
|
1448
1442
|
/** The number of Jobs inspected
|
|
1449
1443
|
*/
|
|
1450
1444
|
jobs_inspected: number;
|
|
1445
|
+
/** The number of Jobs purged
|
|
1446
|
+
*/
|
|
1447
|
+
jobs_purged?: number;
|
|
1451
1448
|
}
|
|
1452
1449
|
interface AccountServerGetNamespaceResponse {
|
|
1453
1450
|
/** The configured Account Server namespace, which will be an empty string if one is not configured. The AS API is expected as the service `as-api` in this namespace.
|
|
1454
1451
|
*/
|
|
1455
1452
|
namespace: string;
|
|
1456
|
-
/** The name of this Data Manager instance, used to distinguish itself on calls to the Account Server. Every Data Manager is deployed with a unique name, regardless of the Account Server that's being used.
|
|
1457
|
-
*/
|
|
1458
|
-
data_manager_name: string;
|
|
1459
1453
|
}
|
|
1460
1454
|
interface AccountServerGetRegistrationResponse {
|
|
1461
1455
|
merchant_id: number;
|
|
@@ -1483,4 +1477,4 @@ declare const setBaseUrl: (baseUrl: string) => void;
|
|
|
1483
1477
|
declare const customInstance: <TReturn>(config: AxiosRequestConfig, options?: AxiosRequestConfig<any> | undefined) => Promise<TReturn>;
|
|
1484
1478
|
declare type ErrorType<TError> = AxiosError<TError>;
|
|
1485
1479
|
|
|
1486
|
-
export {
|
|
1480
|
+
export { UserSummary as $, AdminGetServiceErrorsParams as A, QFileProjectIdParameter as B, QFilePathParameter as C, DeleteUnmanagedFileParams as D, QFileParameter as E, QExcludePurposeParameter as F, GetUserApiLogParams as G, QExcludeDoneParameter as H, QEventPriorOrdinalParameter as I, QEventLimitParameter as J, QDatasetMimeTypeParameter as K, QDoNotImpersonateParameter as L, UserAccountPatchBodyBody as M, ProjectPostBodyBody as N, ProjectPatchBodyBody as O, PatchInstanceParams as P, QEditorsParameter as Q, ProjectFilePutBodyBody as R, JobManifestPutBodyBody as S, JobManifestLoadPutBodyBody as T, UserPatchBodyBody as U, InstancePostBodyBody as V, FilePostBodyBody as W, DatasetPutBodyBody as X, DatasetVersionMetaPostBodyBody as Y, DatasetMetaPostBodyBody as Z, DatasetPostBodyBody as _, GetUserAccountParams as a, InstancePostResponse as a$, UserDetail as a0, UserAccountDetail as a1, TypeSummaryFormatterOptionsType as a2, TypeSummaryFormatterOptions as a3, TypeSummary as a4, TaskSummaryProcessingStage as a5, TaskSummary as a6, TaskStateState as a7, TaskState as a8, TaskIdentity as a9, ApplicationSummary as aA, ApiLogDetailMethod as aB, ApiLogDetail as aC, VersionGetResponse as aD, UsersGetResponse as aE, UserApiLogGetResponse as aF, UserAccountGetResponse as aG, TypesGetResponse as aH, TasksGetResponse as aI, TaskGetResponsePurpose as aJ, TaskGetResponse as aK, ServiceErrorsGetResponse as aL, ProjectsGetResponse as aM, ProjectPostResponse as aN, ProjectGetResponse as aO, ProjectDeleteResponse as aP, JobsGetResponse as aQ, JobGetResponseImageType as aR, JobGetResponse as aS, InstanceTaskPurpose as aT, InstanceTask as aU, InstancesGetResponse as aV, InstanceGetResponsePhase as aW, InstanceGetResponseApplicationType as aX, InstanceGetResponse as aY, FilesGetResponse as aZ, FilePostResponse as a_, TaskEventLevel as aa, TaskEvent as ab, ServiceErrorSummarySeverity as ac, ServiceErrorSummary as ad, ProjectFileDetail as ae, ProjectDetail as af, JobOrderDetail as ag, JobVariables as ah, JobSummaryImageType as ai, JobSummary as aj, JobApplication as ak, InstanceSummaryJobImageType as al, InstanceSummaryPhase as am, InstanceSummaryApplicationType as an, InstanceSummary as ao, FileStat as ap, FilePathFile as aq, DatasetVersionSummaryLabels as ar, DatasetVersionSummaryProcessingStage as as, DatasetVersionSummary as at, DatasetVersionProjectFile as au, DatasetVersionDetailLabels as av, DatasetVersionDetailProcessingStage as aw, DatasetVersionDetail as ax, DatasetSummary as ay, DatasetDetail as az, GetInstancesParams as b, InstanceDeleteResponse as b0, DatasetsGetResponse as b1, DatasetVersionsGetResponse as b2, DatasetVersionDeleteResponse as b3, DatasetSchemaGetResponseType as b4, DatasetSchemaGetResponse as b5, DatasetMetaGetResponse as b6, DatasetDigestGetResponse as b7, DatasetPutPostResponse as b8, ApplicationsGetResponse as b9, ApplicationGetResponse as ba, AdminUserPutResponse as bb, AdminJobManifestLoadPutResponse as bc, AccountServerGetNamespaceResponse as bd, AccountServerGetRegistrationResponse as be, DmError as bf, AXIOS_INSTANCE as bg, setAuthToken as bh, setBaseUrl as bi, customInstance as bj, ErrorType as bk, GetJobByNameParams as c, GetTaskParams as d, GetTasksParams as e, GetFilesParams as f, DeleteDatasetParams as g, GetVersionsParams as h, GetDatasetsParams as i, GetProjectFileWithTokenParams as j, GetProjectFileParams as k, QOwnersParameter as l, QUsernameParameter as m, QUntilParameter as n, QTokenParameter as o, QProjectIdParameter as p, QLabelsParameter as q, QJobVersionParameter as r, QJobNameParameter as s, QJobCollectionParameter as t, QKeepProjectFilesParameter as u, QInstanceArchiveParameter as v, QIncludeHiddenParameter as w, QIncludeDeletedParameter as x, QIncludeAcknowlegedParameter as y, QFromParameter as z };
|
package/dataset/dataset.cjs
CHANGED
|
@@ -23,9 +23,6 @@ var createDatasetFromFile = (datasetPutBodyBody, options) => {
|
|
|
23
23
|
if (datasetPutBodyBody.dataset_id !== void 0) {
|
|
24
24
|
formData.append("dataset_id", datasetPutBodyBody.dataset_id);
|
|
25
25
|
}
|
|
26
|
-
if (datasetPutBodyBody.organisation_id !== void 0) {
|
|
27
|
-
formData.append("organisation_id", datasetPutBodyBody.organisation_id);
|
|
28
|
-
}
|
|
29
26
|
if (datasetPutBodyBody.unit_id !== void 0) {
|
|
30
27
|
formData.append("unit_id", datasetPutBodyBody.unit_id);
|
|
31
28
|
}
|
|
@@ -60,7 +57,6 @@ var uploadDataset = (datasetPostBodyBody, options) => {
|
|
|
60
57
|
if (datasetPostBodyBody.dataset_id !== void 0) {
|
|
61
58
|
formData.append("dataset_id", datasetPostBodyBody.dataset_id);
|
|
62
59
|
}
|
|
63
|
-
formData.append("organisation_id", datasetPostBodyBody.organisation_id);
|
|
64
60
|
formData.append("unit_id", datasetPostBodyBody.unit_id);
|
|
65
61
|
return _chunkNGBTCJWScjs.customInstance.call(void 0, {
|
|
66
62
|
url: `/dataset`,
|
package/dataset/dataset.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/dataset/dataset.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AA+CO,IAAM,wBAAwB,CACnC,oBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,gBAAgB,mBAAmB,YAAY;AAC/D,MAAI,mBAAmB,2BAA2B,QAAW;AAC3D,aAAS,OACP,0BACA,mBAAmB,sBACrB;AAAA,EACF;AACA,MAAI,mBAAmB,uBAAuB,QAAW;AACvD,aAAS,OACP,sBACA,mBAAmB,mBAAmB,SAAS,CACjD;AAAA,EACF;AACA,WAAS,OAAO,cAAc,mBAAmB,UAAU;AAC3D,WAAS,OAAO,QAAQ,mBAAmB,IAAI;AAC/C,WAAS,OAAO,aAAa,mBAAmB,SAAS;AACzD,MAAI,mBAAmB,eAAe,QAAW;AAC/C,aAAS,OAAO,cAAc,mBAAmB,UAAU;AAAA,EAC7D;AACA,MAAI,mBAAmB,oBAAoB,QAAW;AACpD,aAAS,OAAO,mBAAmB,mBAAmB,eAAe;AAAA,EACvE;AACA,MAAI,mBAAmB,YAAY,QAAW;AAC5C,aAAS,OAAO,WAAW,mBAAmB,OAAO;AAAA,EACvD;AAEA,SAAO,eACL;AAAA,IACE,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,IACjD,MAAM;AAAA,EACR,GACA,OACF;AACF;AAQO,IAAM,2BAA2B,CAGtC,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,SAAS,CAAC;AAE3B,WAAO,sBAAsB,MAAM,cAAc;AAAA,EACnD;AAEA,SA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val v6.8.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: 0.7\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"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, ErrorType } from \".././custom-instance\";\n\nexport type AwaitedInput<T> = PromiseLike<T> | T;\n\nexport type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\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.organisation_id !== undefined) {\n formData.append(\"organisation_id\", datasetPutBodyBody.organisation_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(\"organisation_id\", datasetPostBodyBody.organisation_id);\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\", signal, params },\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);\n\n return {\n queryKey,\n ...query,\n };\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\", signal, params },\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, { enabled: !!datasetId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\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 });\n\n return {\n queryKey,\n ...query,\n };\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-charcater hexstring.\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, { enabled: !!datasetDigest, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\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 );\n\n return {\n queryKey,\n ...query,\n };\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/dataset/dataset.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AA+CO,IAAM,wBAAwB,CACnC,oBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,gBAAgB,mBAAmB,YAAY;AAC/D,MAAI,mBAAmB,2BAA2B,QAAW;AAC3D,aAAS,OACP,0BACA,mBAAmB,sBACrB;AAAA,EACF;AACA,MAAI,mBAAmB,uBAAuB,QAAW;AACvD,aAA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AkB,aAAc;AAElE,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAOO,IAAM,YAAY,CACvB,WACA,gBACA,SACA,WACG;AACH,SAAO,eACL;AAAA,IACE,KAAK,YAAY,oBAAoB;AAAA,IACrC,QAAQ;AAAA,IACR;AAAA,EACF,GACA,OACF;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,mBAAmB,WAAW,CAAC;AAErE,QAAM,WACJ,8CAAc,aAAY,qBAAqB,WAAW,cAAc;AAE1E,QAAM,UAAgE,CAAC;AAAA,IACrE;AAAA,QACI,UAAU,WAAW,gBAAgB,gBAAgB,MAAM;AAEjE,QAAM,QAAQ,SACZ,UACA,SACA,iBAAE,SAAS,CAAC,CAAE,cAAa,mBAAoB,aACjD;AAEA,SAAO;AAAA,IACL;AAAA,KACG;AAEP","sourcesContent":["/**\n * Generated by orval v6.8.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: 0.7\n */\nimport {\n useQuery,\n useMutation,\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"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, ErrorType } from \".././custom-instance\";\n\nexport type AwaitedInput<T> = PromiseLike<T> | T;\n\nexport type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\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\", signal, params },\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);\n\n return {\n queryKey,\n ...query,\n };\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\", signal, params },\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, { enabled: !!datasetId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\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 });\n\n return {\n queryKey,\n ...query,\n };\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-charcater hexstring.\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, { enabled: !!datasetDigest, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\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 );\n\n return {\n queryKey,\n ...query,\n };\n};\n"]}
|
package/dataset/dataset.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { X as DatasetPutBodyBody, bj as customInstance, b8 as DatasetPutPostResponse, bk as ErrorType, bf as DmError, _ as DatasetPostBodyBody, i as GetDatasetsParams, b1 as DatasetsGetResponse, h as GetVersionsParams, az as DatasetDetail, g as DeleteDatasetParams, a9 as TaskIdentity, b7 as DatasetDigestGetResponse, b5 as DatasetSchemaGetResponse } from '../custom-instance-2adec346.js';
|
|
2
2
|
import * as react_query from 'react-query';
|
|
3
3
|
import { UseMutationOptions, UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
|
|
4
4
|
import 'axios';
|
package/dataset/dataset.js
CHANGED
|
@@ -23,9 +23,6 @@ var createDatasetFromFile = (datasetPutBodyBody, options) => {
|
|
|
23
23
|
if (datasetPutBodyBody.dataset_id !== void 0) {
|
|
24
24
|
formData.append("dataset_id", datasetPutBodyBody.dataset_id);
|
|
25
25
|
}
|
|
26
|
-
if (datasetPutBodyBody.organisation_id !== void 0) {
|
|
27
|
-
formData.append("organisation_id", datasetPutBodyBody.organisation_id);
|
|
28
|
-
}
|
|
29
26
|
if (datasetPutBodyBody.unit_id !== void 0) {
|
|
30
27
|
formData.append("unit_id", datasetPutBodyBody.unit_id);
|
|
31
28
|
}
|
|
@@ -60,7 +57,6 @@ var uploadDataset = (datasetPostBodyBody, options) => {
|
|
|
60
57
|
if (datasetPostBodyBody.dataset_id !== void 0) {
|
|
61
58
|
formData.append("dataset_id", datasetPostBodyBody.dataset_id);
|
|
62
59
|
}
|
|
63
|
-
formData.append("organisation_id", datasetPostBodyBody.organisation_id);
|
|
64
60
|
formData.append("unit_id", datasetPostBodyBody.unit_id);
|
|
65
61
|
return customInstance({
|
|
66
62
|
url: `/dataset`,
|