@squonk/data-manager-client 0.7.14 → 0.7.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accounting/accounting.cjs +19 -1
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.ts +17 -2
- package/accounting/accounting.js +18 -0
- package/accounting/accounting.js.map +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-da28e834.d.ts → custom-instance-910c4a7d.d.ts} +24 -10
- package/dataset/dataset.cjs +3 -1
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.ts +1 -1
- package/dataset/dataset.js +3 -1
- 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 +6 -2
- package/project/project.cjs.map +1 -1
- package/project/project.d.ts +1 -1
- package/project/project.js +6 -2
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +57 -0
- package/src/admin/admin.ts +19 -8
- package/src/data-manager-api.schemas.ts +26 -10
- package/src/dataset/dataset.ts +3 -1
- package/src/project/project.ts +6 -2
- package/task/task.d.ts +1 -1
- package/type/type.d.ts +1 -1
- package/user/user.d.ts +1 -1
package/project/project.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/project/project.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 ProjectsGetResponse,\n DmError,\n ProjectPostResponse,\n ProjectPostBodyBody,\n ProjectGetResponse,\n ProjectPatchBodyBody,\n ProjectDeleteResponse,\n GetProjectFileParams,\n ProjectFilePutBodyBody,\n GetProjectFileWithTokenParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance, 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 * Get a list of all projects available to you.\n\n * @summary Get all projects available to you\n */\nexport const getProjects = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProjectsGetResponse>(\n { url: `/project`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProjectsQueryKey = () => [`/project`];\n\nexport type GetProjectsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjects>>\n>;\nexport type GetProjectsQueryError = ErrorType<void | DmError>;\n\nexport const useGetProjects = <\n TData = Awaited<ReturnType<typeof getProjects>>,\n TError = ErrorType<void | DmError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjects>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjects>>> = ({\n signal,\n }) => getProjects(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProjects>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new project, assigning and returning a unique **ID**. A peristent volume is created in the cluster and assigned to your Project. It's here you can add **Datasets** as **Files** and run **Applications** and **Jobs**.\n\nTo create a Project you will need an uncommitted Project product.\n\nAs the project `owner` (creator) you are also automatically an `editor` of the project and can add other users as editors so that they can also manipulate the project. An `editor` of a project can also delete it.\n\nThe name you give the project is free-form text (can contain spaces etc.). The name you use must be unique amongst all the projects you create.\n\n * @summary Create a new project\n */\nexport const createProject = (\n projectPostBodyBody: ProjectPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"name\", projectPostBodyBody.name);\n if (projectPostBodyBody.private !== undefined) {\n formData.append(\"private\", projectPostBodyBody.private.toString());\n }\n formData.append(\"organisation_id\", projectPostBodyBody.organisation_id);\n formData.append(\"unit_id\", projectPostBodyBody.unit_id);\n formData.append(\"tier_product_id\", projectPostBodyBody.tier_product_id);\n\n return customInstance<ProjectPostResponse>(\n {\n url: `/project`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof createProject>>\n>;\nexport type CreateProjectMutationBody = ProjectPostBodyBody;\nexport type CreateProjectMutationError = ErrorType<DmError | void>;\n\nexport const useCreateProject = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createProject>>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createProject>>,\n { data: ProjectPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createProject(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createProject>>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the details of a project that is available to you.\n\n * @summary Get a project\n */\nexport const getProject = (\n projectId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProjectGetResponse>(\n { url: `/project/${projectId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProjectQueryKey = (projectId: string) => [\n `/project/${projectId}`,\n];\n\nexport type GetProjectQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProject>>\n>;\nexport type GetProjectQueryError = ErrorType<void | DmError>;\n\nexport const useGetProject = <\n TData = Awaited<ReturnType<typeof getProject>>,\n TError = ErrorType<void | DmError>\n>(\n projectId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProject>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectQueryKey(projectId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProject>>> = ({\n signal,\n }) => getProject(projectId, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getProject>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!projectId, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Used to update some adjustable parameters of a project, i.e. to make it Private or make it Public. What can be adjusted will depend on the purchased product\n\n * @summary Adjust an existing project\n */\nexport const patchProject = (\n projectId: string,\n projectPatchBodyBody: ProjectPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (projectPatchBodyBody.private !== undefined) {\n formData.append(\"private\", projectPatchBodyBody.private.toString());\n }\n if (projectPatchBodyBody.name !== undefined) {\n formData.append(\"name\", projectPatchBodyBody.name);\n }\n\n return customInstance<void>(\n {\n url: `/project/${projectId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type PatchProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchProject>>\n>;\nexport type PatchProjectMutationBody = ProjectPatchBodyBody;\nexport type PatchProjectMutationError = ErrorType<DmError>;\n\nexport const usePatchProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProject>>,\n TError,\n { projectId: string; data: ProjectPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchProject>>,\n { projectId: string; data: ProjectPatchBodyBody }\n > = (props) => {\n const { projectId, data } = props ?? {};\n\n return patchProject(projectId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof patchProject>>,\n TError,\n { projectId: string; data: ProjectPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes an existing project.\n\nYou must be an `editor` or the `owner` of the project.\n\nOnce deleted all **Files**, working directories and material in the project will also be removed\n\n * @summary Delete a project\n */\nexport const deleteProject = (\n projectId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectDeleteResponse>(\n { url: `/project/${projectId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteProject>>\n>;\n\nexport type DeleteProjectMutationError = ErrorType<void | DmError>;\n\nexport const useDeleteProject = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProject>>,\n TError,\n { projectId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteProject>>,\n { projectId: string }\n > = (props) => {\n const { projectId } = props ?? {};\n\n return deleteProject(projectId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteProject>>,\n TError,\n { projectId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Adds a user to a project as an `editor`. Editors can add and remove datasets in a project and delete the project.\n\nAn `editor` of a project is not automatically an `editor` of any datasets the project contains.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Add a project editor\n */\nexport const addEditorToProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/editor/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddEditorToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addEditorToProject>>\n>;\n\nexport type AddEditorToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddEditorToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addEditorToProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return addEditorToProject(projectId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addEditorToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a project `editor`. The editor can be you but you cannot delete the last `editor`\n\nA project must always have one `editor` so you will not be able to delete the last editor of a project.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Delete a project editor\n */\nexport const removeEditorFromProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/editor/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type RemoveEditorFromProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeEditorFromProject>>\n>;\n\nexport type RemoveEditorFromProjectMutationError = ErrorType<DmError>;\n\nexport const useRemoveEditorFromProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return removeEditorFromProject(projectId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nYou must be an `editor` or the `owner` of the project if the project is private\n\n * @summary Download a project file\n */\nexport const getProjectFile = (\n projectId: string,\n params?: GetProjectFileParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/file`, method: \"get\", signal, params },\n options\n );\n};\n\nexport const getGetProjectFileQueryKey = (\n projectId: string,\n params?: GetProjectFileParams\n) => [`/project/${projectId}/file`, ...(params ? [params] : [])];\n\nexport type GetProjectFileQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjectFile>>\n>;\nexport type GetProjectFileQueryError = ErrorType<DmError>;\n\nexport const useGetProjectFile = <\n TData = Awaited<ReturnType<typeof getProjectFile>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params?: GetProjectFileParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFile>>> = ({\n signal,\n }) => getProjectFile(projectId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProjectFile>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!projectId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * The user provides an external file for upload to the Project using an optional Path. The path is created if it does not exist.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Upload a file into a Project\n */\nexport const addFileToProject = (\n projectId: string,\n projectFilePutBodyBody: ProjectFilePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"file\", projectFilePutBodyBody.file);\n if (projectFilePutBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", projectFilePutBodyBody.as_filename);\n }\n if (projectFilePutBodyBody.path !== undefined) {\n formData.append(\"path\", projectFilePutBodyBody.path);\n }\n\n return customInstance<void>(\n {\n url: `/project/${projectId}/file`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AddFileToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addFileToProject>>\n>;\nexport type AddFileToProjectMutationBody = ProjectFilePutBodyBody;\nexport type AddFileToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddFileToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addFileToProject>>,\n TError,\n { projectId: string; data: ProjectFilePutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addFileToProject>>,\n { projectId: string; data: ProjectFilePutBodyBody }\n > = (props) => {\n const { projectId, data } = props ?? {};\n\n return addFileToProject(projectId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addFileToProject>>,\n TError,\n { projectId: string; data: ProjectFilePutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nAs there is no security You must provide a valid token. The token must be a token valid for the project, usually generted when an Instance has been launched in the Project. If the token is not valid ou will receive a `403` error\n\n * @summary Download a project file using a token\n */\nexport const getProjectFileWithToken = (\n projectId: string,\n params?: GetProjectFileWithTokenParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n {\n url: `/project/${projectId}/file-with-token`,\n method: \"get\",\n signal,\n params,\n },\n options\n );\n};\n\nexport const getGetProjectFileWithTokenQueryKey = (\n projectId: string,\n params?: GetProjectFileWithTokenParams\n) => [`/project/${projectId}/file-with-token`, ...(params ? [params] : [])];\n\nexport type GetProjectFileWithTokenQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjectFileWithToken>>\n>;\nexport type GetProjectFileWithTokenQueryError = ErrorType<DmError>;\n\nexport const useGetProjectFileWithToken = <\n TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params?: GetProjectFileWithTokenParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getGetProjectFileWithTokenQueryKey(projectId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProjectFileWithToken>>\n > = ({ signal }) =>\n getProjectFileWithToken(projectId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!projectId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n"],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAyCO,IAAM,cAAc,CACzB,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,YAAY,QAAQ,OAAO,OAAO,GACzC,OACF;AACF;AAEO,IAAM,yBAAyB,MAAM,CAAC,UAAU;AAOhD,IAAM,iBAAiB,CAG5B,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WAAW,8CAAc,aAAY,uBAAuB;AAElE,QAAM,UAAkE,CAAC;AAAA,IACvE;AAAA,QACI,YAAY,gBAAgB,MAAM;AAExC,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAEjC,SAAO;AAAA,IACL;AAAA,KACG;AAEP;AAaO,IAAM,gBAAgB,CAC3B,qBACA,YACG;AACH,QAAM,WAAW,IAAI,SAAS;AAC9B,WAAS,OAAO,QAAQ,oBAAoB,IAAI;AAChD,MAAI,oBAAoB,YAAY,QAAW;AAC7C,aAAS,OAAO,WAAW,oBAAoB,QAAQ,SAAS,CAAC;AAAA,EACnE;AACA,WAAS,OAAO,mBAAmB,oBAAoB,eAAe;AACtE,WAAS,OAAO,WAAW,oBAAoB,OAAO;AACtD,WAAS,OAAO,mBAAmB,oBAAoB,eAAe;AAEtE,SAAO,eACL;AAAA,IACE,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,SAAS,EAAE,gBAAgB,sBAAsB;AAAA,IACjD,MAAM;AAAA,EACR,GACA,OACF;AACF;AAQO,IAAM,mBAAmB,CAG9B,YAQI;AACJ,QAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,WAAW,CAAC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,WACG;AACH,SAAO,eACL;AAAA,IACE,KAAK,YAAY;AAAA,IACjB,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,EACF,GACA,OACF;AACF;AAEO,IAAM,qCAAqC,CAChD,WACA,WACG,CAAC,YAAY,6BAA6B,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAOnE,IAAM,6BAA6B,CAIxC,WACA,QACA,YAQ2D;AAC3D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;AAErE,QAAM,WACJ,8CAAc,aACd,mCAAmC,WAAW,MAAM;AAEtD,QAAM,UAEF,CAAC,EAAE,aACL,wBAAwB,WAAW,QAAQ,gBAAgB,MAAM;AAEnE,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,aAAc,aAAc;AAE9D,SAAO;AAAA,IACL;AAAA,KACG;AAEP;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/project/project.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 ProjectsGetResponse,\n DmError,\n ProjectPostResponse,\n ProjectPostBodyBody,\n ProjectGetResponse,\n ProjectPatchBodyBody,\n ProjectDeleteResponse,\n GetProjectFileParams,\n ProjectFilePutBodyBody,\n GetProjectFileWithTokenParams,\n} from \"../data-manager-api.schemas\";\nimport { customInstance, 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 * Get a list of all projects available to you.\n\n * @summary Get all projects available to you\n */\nexport const getProjects = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProjectsGetResponse>(\n { url: `/project`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProjectsQueryKey = () => [`/project`];\n\nexport type GetProjectsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjects>>\n>;\nexport type GetProjectsQueryError = ErrorType<void | DmError>;\n\nexport const useGetProjects = <\n TData = Awaited<ReturnType<typeof getProjects>>,\n TError = ErrorType<void | DmError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjects>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjects>>> = ({\n signal,\n }) => getProjects(requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProjects>>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Creates a new project, assigning and returning a unique **ID**. A peristent volume is created in the cluster and assigned to your Project. It's here you can add **Datasets** as **Files** and run **Applications** and **Jobs**.\n\nTo create a Project you will need an uncommitted Project product.\n\nAs the project `owner` (creator) you are also automatically an `editor` of the project and can add other users as editors so that they can also manipulate the project. An `editor` of a project can also delete it.\n\nThe name you give the project is free-form text (can contain spaces etc.). The name you use must be unique amongst all the projects you create.\n\n * @summary Create a new project\n */\nexport const createProject = (\n projectPostBodyBody: ProjectPostBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"name\", projectPostBodyBody.name);\n if (projectPostBodyBody.private !== undefined) {\n formData.append(\"private\", projectPostBodyBody.private.toString());\n }\n if (projectPostBodyBody.organisation_id !== undefined) {\n formData.append(\"organisation_id\", projectPostBodyBody.organisation_id);\n }\n if (projectPostBodyBody.unit_id !== undefined) {\n formData.append(\"unit_id\", projectPostBodyBody.unit_id);\n }\n formData.append(\"tier_product_id\", projectPostBodyBody.tier_product_id);\n\n return customInstance<ProjectPostResponse>(\n {\n url: `/project`,\n method: \"post\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type CreateProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof createProject>>\n>;\nexport type CreateProjectMutationBody = ProjectPostBodyBody;\nexport type CreateProjectMutationError = ErrorType<DmError | void>;\n\nexport const useCreateProject = <\n TError = ErrorType<DmError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createProject>>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createProject>>,\n { data: ProjectPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createProject(data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof createProject>>,\n TError,\n { data: ProjectPostBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets the details of a project that is available to you.\n\n * @summary Get a project\n */\nexport const getProject = (\n projectId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<ProjectGetResponse>(\n { url: `/project/${projectId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetProjectQueryKey = (projectId: string) => [\n `/project/${projectId}`,\n];\n\nexport type GetProjectQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProject>>\n>;\nexport type GetProjectQueryError = ErrorType<void | DmError>;\n\nexport const useGetProject = <\n TData = Awaited<ReturnType<typeof getProject>>,\n TError = ErrorType<void | DmError>\n>(\n projectId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProject>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetProjectQueryKey(projectId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProject>>> = ({\n signal,\n }) => getProject(projectId, requestOptions, signal);\n\n const query = useQuery<Awaited<ReturnType<typeof getProject>>, TError, TData>(\n queryKey,\n queryFn,\n { enabled: !!projectId, ...queryOptions }\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * Used to update some adjustable parameters of a project, i.e. to make it Private or make it Public. What can be adjusted will depend on the purchased product\n\n * @summary Adjust an existing project\n */\nexport const patchProject = (\n projectId: string,\n projectPatchBodyBody: ProjectPatchBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n if (projectPatchBodyBody.private !== undefined) {\n formData.append(\"private\", projectPatchBodyBody.private.toString());\n }\n if (projectPatchBodyBody.name !== undefined) {\n formData.append(\"name\", projectPatchBodyBody.name);\n }\n\n return customInstance<void>(\n {\n url: `/project/${projectId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type PatchProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchProject>>\n>;\nexport type PatchProjectMutationBody = ProjectPatchBodyBody;\nexport type PatchProjectMutationError = ErrorType<DmError>;\n\nexport const usePatchProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchProject>>,\n TError,\n { projectId: string; data: ProjectPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchProject>>,\n { projectId: string; data: ProjectPatchBodyBody }\n > = (props) => {\n const { projectId, data } = props ?? {};\n\n return patchProject(projectId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof patchProject>>,\n TError,\n { projectId: string; data: ProjectPatchBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes an existing project.\n\nYou must be an `editor` or the `owner` of the project.\n\nOnce deleted all **Files**, working directories and material in the project will also be removed\n\n * @summary Delete a project\n */\nexport const deleteProject = (\n projectId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<ProjectDeleteResponse>(\n { url: `/project/${projectId}`, method: \"delete\" },\n options\n );\n};\n\nexport type DeleteProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteProject>>\n>;\n\nexport type DeleteProjectMutationError = ErrorType<void | DmError>;\n\nexport const useDeleteProject = <\n TError = ErrorType<void | DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteProject>>,\n TError,\n { projectId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteProject>>,\n { projectId: string }\n > = (props) => {\n const { projectId } = props ?? {};\n\n return deleteProject(projectId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof deleteProject>>,\n TError,\n { projectId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Adds a user to a project as an `editor`. Editors can add and remove datasets in a project and delete the project.\n\nAn `editor` of a project is not automatically an `editor` of any datasets the project contains.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Add a project editor\n */\nexport const addEditorToProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/editor/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport type AddEditorToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addEditorToProject>>\n>;\n\nexport type AddEditorToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddEditorToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addEditorToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addEditorToProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return addEditorToProject(projectId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addEditorToProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Deletes a project `editor`. The editor can be you but you cannot delete the last `editor`\n\nA project must always have one `editor` so you will not be able to delete the last editor of a project.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Delete a project editor\n */\nexport const removeEditorFromProject = (\n projectId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/editor/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport type RemoveEditorFromProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof removeEditorFromProject>>\n>;\n\nexport type RemoveEditorFromProjectMutationError = ErrorType<DmError>;\n\nexport const useRemoveEditorFromProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n { projectId: string; userId: string }\n > = (props) => {\n const { projectId, userId } = props ?? {};\n\n return removeEditorFromProject(projectId, userId, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof removeEditorFromProject>>,\n TError,\n { projectId: string; userId: string },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nYou must be an `editor` or the `owner` of the project if the project is private\n\n * @summary Download a project file\n */\nexport const getProjectFile = (\n projectId: string,\n params?: GetProjectFileParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n { url: `/project/${projectId}/file`, method: \"get\", signal, params },\n options\n );\n};\n\nexport const getGetProjectFileQueryKey = (\n projectId: string,\n params?: GetProjectFileParams\n) => [`/project/${projectId}/file`, ...(params ? [params] : [])];\n\nexport type GetProjectFileQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjectFile>>\n>;\nexport type GetProjectFileQueryError = ErrorType<DmError>;\n\nexport const useGetProjectFile = <\n TData = Awaited<ReturnType<typeof getProjectFile>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params?: GetProjectFileParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFile>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetProjectFileQueryKey(projectId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getProjectFile>>> = ({\n signal,\n }) => getProjectFile(projectId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProjectFile>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!projectId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n\n/**\n * The user provides an external file for upload to the Project using an optional Path. The path is created if it does not exist.\n\nYou must be an `editor` or the `owner` of the project\n\n * @summary Upload a file into a Project\n */\nexport const addFileToProject = (\n projectId: string,\n projectFilePutBodyBody: ProjectFilePutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n const formData = new FormData();\n formData.append(\"file\", projectFilePutBodyBody.file);\n if (projectFilePutBodyBody.as_filename !== undefined) {\n formData.append(\"as_filename\", projectFilePutBodyBody.as_filename);\n }\n if (projectFilePutBodyBody.path !== undefined) {\n formData.append(\"path\", projectFilePutBodyBody.path);\n }\n\n return customInstance<void>(\n {\n url: `/project/${projectId}/file`,\n method: \"put\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options\n );\n};\n\nexport type AddFileToProjectMutationResult = NonNullable<\n Awaited<ReturnType<typeof addFileToProject>>\n>;\nexport type AddFileToProjectMutationBody = ProjectFilePutBodyBody;\nexport type AddFileToProjectMutationError = ErrorType<DmError>;\n\nexport const useAddFileToProject = <\n TError = ErrorType<DmError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addFileToProject>>,\n TError,\n { projectId: string; data: ProjectFilePutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addFileToProject>>,\n { projectId: string; data: ProjectFilePutBodyBody }\n > = (props) => {\n const { projectId, data } = props ?? {};\n\n return addFileToProject(projectId, data, requestOptions);\n };\n\n return useMutation<\n Awaited<ReturnType<typeof addFileToProject>>,\n TError,\n { projectId: string; data: ProjectFilePutBodyBody },\n TContext\n >(mutationFn, mutationOptions);\n};\n/**\n * Gets a file from the project, with an optional path. This method should be used to get arbitrary files from the Project's file system (typically **unmanaged** files).\n\nFor **managed** files you should consider using the `/file/{file_id}` endpoint.\n\nAs there is no security You must provide a valid token. The token must be a token valid for the project, usually generted when an Instance has been launched in the Project. If the token is not valid ou will receive a `403` error\n\n * @summary Download a project file using a token\n */\nexport const getProjectFileWithToken = (\n projectId: string,\n params?: GetProjectFileWithTokenParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<void>(\n {\n url: `/project/${projectId}/file-with-token`,\n method: \"get\",\n signal,\n params,\n },\n options\n );\n};\n\nexport const getGetProjectFileWithTokenQueryKey = (\n projectId: string,\n params?: GetProjectFileWithTokenParams\n) => [`/project/${projectId}/file-with-token`, ...(params ? [params] : [])];\n\nexport type GetProjectFileWithTokenQueryResult = NonNullable<\n Awaited<ReturnType<typeof getProjectFileWithToken>>\n>;\nexport type GetProjectFileWithTokenQueryError = ErrorType<DmError>;\n\nexport const useGetProjectFileWithToken = <\n TData = Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError = ErrorType<DmError>\n>(\n projectId: string,\n params?: GetProjectFileWithTokenParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ??\n getGetProjectFileWithTokenQueryKey(projectId, params);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getProjectFileWithToken>>\n > = ({ signal }) =>\n getProjectFileWithToken(projectId, params, requestOptions, signal);\n\n const query = useQuery<\n Awaited<ReturnType<typeof getProjectFileWithToken>>,\n TError,\n TData\n >(queryKey, queryFn, { enabled: !!projectId, ...queryOptions });\n\n return {\n queryKey,\n ...query,\n };\n};\n"],"mappings":";;;;;;AAUA;AAAA;AAAA;AAAA;AAyCO,IAAM,cAAc,CACzB,SACA,WACG;AACH,SAAO,eACL,EAAE,KAAK,YAAY,QAAQ,OAAO,OAAO,GACzC,OACF;AACF;AAEO,IAAM,yBAAyB,MAAM,CAAC,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AAmB,WAAW,CAAC;AAErE,QAAM,WACJ,8CAAc,aACd,mCAAmC,WAAW,MAAM;AAEtD,QAAM,UAEF,CAAC,EAAE,aACL,wBAAwB,WAAW,QAAQ,gBAAgB,MAAM;AAEnE,QAAM,QAAQ,SAIZ,UAAU,SAAS,iBAAE,SAAS,CAAC,CAAC,aAAc,aAAc;AAE9D,SAAO;AAAA,IACL;AAAA,KACG;AAEP;","names":[]}
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
import type {
|
|
19
19
|
AccountServerGetNamespaceResponse,
|
|
20
20
|
DmError,
|
|
21
|
+
AccountServerGetRegistrationResponse,
|
|
21
22
|
VersionGetResponse,
|
|
22
23
|
} from "../data-manager-api.schemas";
|
|
23
24
|
import { customInstance, ErrorType } from ".././custom-instance";
|
|
@@ -90,6 +91,62 @@ export const useGetAccountServerNamespace = <
|
|
|
90
91
|
};
|
|
91
92
|
};
|
|
92
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Returns our Account Server Registration information
|
|
96
|
+
|
|
97
|
+
* @summary Gets the Data Manager Account Server Registration
|
|
98
|
+
*/
|
|
99
|
+
export const getAccountServerRegistration = (
|
|
100
|
+
options?: SecondParameter<typeof customInstance>,
|
|
101
|
+
signal?: AbortSignal
|
|
102
|
+
) => {
|
|
103
|
+
return customInstance<AccountServerGetRegistrationResponse>(
|
|
104
|
+
{ url: `/account-server/registration`, method: "get", signal },
|
|
105
|
+
options
|
|
106
|
+
);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const getGetAccountServerRegistrationQueryKey = () => [
|
|
110
|
+
`/account-server/registration`,
|
|
111
|
+
];
|
|
112
|
+
|
|
113
|
+
export type GetAccountServerRegistrationQueryResult = NonNullable<
|
|
114
|
+
Awaited<ReturnType<typeof getAccountServerRegistration>>
|
|
115
|
+
>;
|
|
116
|
+
export type GetAccountServerRegistrationQueryError = ErrorType<void | DmError>;
|
|
117
|
+
|
|
118
|
+
export const useGetAccountServerRegistration = <
|
|
119
|
+
TData = Awaited<ReturnType<typeof getAccountServerRegistration>>,
|
|
120
|
+
TError = ErrorType<void | DmError>
|
|
121
|
+
>(options?: {
|
|
122
|
+
query?: UseQueryOptions<
|
|
123
|
+
Awaited<ReturnType<typeof getAccountServerRegistration>>,
|
|
124
|
+
TError,
|
|
125
|
+
TData
|
|
126
|
+
>;
|
|
127
|
+
request?: SecondParameter<typeof customInstance>;
|
|
128
|
+
}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
129
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
130
|
+
|
|
131
|
+
const queryKey =
|
|
132
|
+
queryOptions?.queryKey ?? getGetAccountServerRegistrationQueryKey();
|
|
133
|
+
|
|
134
|
+
const queryFn: QueryFunction<
|
|
135
|
+
Awaited<ReturnType<typeof getAccountServerRegistration>>
|
|
136
|
+
> = ({ signal }) => getAccountServerRegistration(requestOptions, signal);
|
|
137
|
+
|
|
138
|
+
const query = useQuery<
|
|
139
|
+
Awaited<ReturnType<typeof getAccountServerRegistration>>,
|
|
140
|
+
TError,
|
|
141
|
+
TData
|
|
142
|
+
>(queryKey, queryFn, queryOptions);
|
|
143
|
+
|
|
144
|
+
return {
|
|
145
|
+
queryKey,
|
|
146
|
+
...query,
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
|
|
93
150
|
/**
|
|
94
151
|
* @summary Gets the Data Manager version that's running behind the API
|
|
95
152
|
*/
|
package/src/admin/admin.ts
CHANGED
|
@@ -26,6 +26,7 @@ import type {
|
|
|
26
26
|
UserPatchBodyBody,
|
|
27
27
|
AdminJobManifestLoadPutResponse,
|
|
28
28
|
JobManifestPutBodyBody,
|
|
29
|
+
JobManifestLoadPutBodyBody,
|
|
29
30
|
} from "../data-manager-api.schemas";
|
|
30
31
|
import { customInstance, ErrorType } from ".././custom-instance";
|
|
31
32
|
|
|
@@ -456,10 +457,19 @@ You will need **admin** rights to use this endpoint
|
|
|
456
457
|
* @summary Trigger a download of known Job Definitions using the Manifest table
|
|
457
458
|
*/
|
|
458
459
|
export const adminJobManifestLoad = (
|
|
460
|
+
jobManifestLoadPutBodyBody: JobManifestLoadPutBodyBody,
|
|
459
461
|
options?: SecondParameter<typeof customInstance>
|
|
460
462
|
) => {
|
|
463
|
+
const formData = new FormData();
|
|
464
|
+
formData.append("purge", jobManifestLoadPutBodyBody.purge.toString());
|
|
465
|
+
|
|
461
466
|
return customInstance<AdminJobManifestLoadPutResponse>(
|
|
462
|
-
{
|
|
467
|
+
{
|
|
468
|
+
url: `/admin/job-manifest/load`,
|
|
469
|
+
method: "put",
|
|
470
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
471
|
+
data: formData,
|
|
472
|
+
},
|
|
463
473
|
options
|
|
464
474
|
);
|
|
465
475
|
};
|
|
@@ -467,18 +477,17 @@ export const adminJobManifestLoad = (
|
|
|
467
477
|
export type AdminJobManifestLoadMutationResult = NonNullable<
|
|
468
478
|
Awaited<ReturnType<typeof adminJobManifestLoad>>
|
|
469
479
|
>;
|
|
470
|
-
|
|
480
|
+
export type AdminJobManifestLoadMutationBody = JobManifestLoadPutBodyBody;
|
|
471
481
|
export type AdminJobManifestLoadMutationError = ErrorType<void | DmError>;
|
|
472
482
|
|
|
473
483
|
export const useAdminJobManifestLoad = <
|
|
474
484
|
TError = ErrorType<void | DmError>,
|
|
475
|
-
TVariables = void,
|
|
476
485
|
TContext = unknown
|
|
477
486
|
>(options?: {
|
|
478
487
|
mutation?: UseMutationOptions<
|
|
479
488
|
Awaited<ReturnType<typeof adminJobManifestLoad>>,
|
|
480
489
|
TError,
|
|
481
|
-
|
|
490
|
+
{ data: JobManifestLoadPutBodyBody },
|
|
482
491
|
TContext
|
|
483
492
|
>;
|
|
484
493
|
request?: SecondParameter<typeof customInstance>;
|
|
@@ -487,15 +496,17 @@ export const useAdminJobManifestLoad = <
|
|
|
487
496
|
|
|
488
497
|
const mutationFn: MutationFunction<
|
|
489
498
|
Awaited<ReturnType<typeof adminJobManifestLoad>>,
|
|
490
|
-
|
|
491
|
-
> = () => {
|
|
492
|
-
|
|
499
|
+
{ data: JobManifestLoadPutBodyBody }
|
|
500
|
+
> = (props) => {
|
|
501
|
+
const { data } = props ?? {};
|
|
502
|
+
|
|
503
|
+
return adminJobManifestLoad(data, requestOptions);
|
|
493
504
|
};
|
|
494
505
|
|
|
495
506
|
return useMutation<
|
|
496
507
|
Awaited<ReturnType<typeof adminJobManifestLoad>>,
|
|
497
508
|
TError,
|
|
498
|
-
|
|
509
|
+
{ data: JobManifestLoadPutBodyBody },
|
|
499
510
|
TContext
|
|
500
511
|
>(mutationFn, mutationOptions);
|
|
501
512
|
};
|
|
@@ -42,12 +42,6 @@ export type GetTasksParams = {
|
|
|
42
42
|
project_id?: QProjectIdParameter;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
/**
|
|
46
|
-
* A project file.
|
|
47
|
-
|
|
48
|
-
*/
|
|
49
|
-
export type QFileParameter = string;
|
|
50
|
-
|
|
51
45
|
export type DeleteUnmanagedFileParams = {
|
|
52
46
|
file: QFileParameter;
|
|
53
47
|
path?: QFilePathParameter;
|
|
@@ -188,6 +182,12 @@ export type QFileProjectIdParameter = string;
|
|
|
188
182
|
*/
|
|
189
183
|
export type QFilePathParameter = string;
|
|
190
184
|
|
|
185
|
+
/**
|
|
186
|
+
* A project file.
|
|
187
|
+
|
|
188
|
+
*/
|
|
189
|
+
export type QFileParameter = string;
|
|
190
|
+
|
|
191
191
|
/**
|
|
192
192
|
* Set to a dot-separated string of purpose enumerations, i.e. `INSTANCE`, `FILE` or `DATASET`. To exclude file and dataset tasks set to `FILE.DATASET`
|
|
193
193
|
|
|
@@ -234,7 +234,7 @@ export type UserAccountPatchBodyBody = {
|
|
|
234
234
|
/** If set the user account becomes private, if provided but false the user account becomes public. Public Users show up in user searches
|
|
235
235
|
*/
|
|
236
236
|
private?: boolean;
|
|
237
|
-
/** For **admin** accounts, if set the user account is able to read anything, i.e. `GET` API calls (i.e. endpoints that do not change the Data Manager state) behave as though the caller is acting as *everyone*. An **admin** user would set ths parameter in order to browse the system, and then switch to `impersonate` mode in order to
|
|
237
|
+
/** For **admin** accounts, if set the user account is able to read anything, i.e. `GET` API calls (i.e. endpoints that do not change the Data Manager state) behave as though the caller is acting as *everyone*. An **admin** user would set ths parameter in order to browse the system, and then switch to `impersonate` mode in order to change things as the chosen user
|
|
238
238
|
*/
|
|
239
239
|
become_admin?: boolean;
|
|
240
240
|
/** For **admin** accounts, if set API calls behave as though the caller is the user being impersonated. To stop impersonating set this to an empty string. To set impersonation to anything other than an empty string you must also set `become_admin`
|
|
@@ -252,10 +252,10 @@ export type ProjectPostBodyBody = {
|
|
|
252
252
|
private?: boolean;
|
|
253
253
|
/** The Organisation the Project belongs to
|
|
254
254
|
*/
|
|
255
|
-
organisation_id
|
|
255
|
+
organisation_id?: string;
|
|
256
256
|
/** The Organisational Unit the Project belongs to
|
|
257
257
|
*/
|
|
258
|
-
unit_id
|
|
258
|
+
unit_id?: string;
|
|
259
259
|
/** The Data Manager *Tier Product ID* you're using to create the Project
|
|
260
260
|
*/
|
|
261
261
|
tier_product_id: string;
|
|
@@ -287,6 +287,13 @@ export type JobManifestPutBodyBody = {
|
|
|
287
287
|
params?: string;
|
|
288
288
|
};
|
|
289
289
|
|
|
290
|
+
export type JobManifestLoadPutBodyBody = {
|
|
291
|
+
/** Set to remove all pre-existing Job Definitions that are not present in the existing manifests after the load is complete.
|
|
292
|
+
|
|
293
|
+
Jobs in the collection `im-test` are not removed */
|
|
294
|
+
purge: boolean;
|
|
295
|
+
};
|
|
296
|
+
|
|
290
297
|
export type InstancePostBodyBody = {
|
|
291
298
|
/** A supported application. Applications instances are managed using pre-deployed Kubernetes **Operators**. The application ID is a combination of the operator _plural_ and _group_.
|
|
292
299
|
*/
|
|
@@ -422,7 +429,7 @@ export type DatasetPostBodyBody = {
|
|
|
422
429
|
dataset_id?: string;
|
|
423
430
|
/** The Organisation you want the Dataset to belong to
|
|
424
431
|
*/
|
|
425
|
-
organisation_id
|
|
432
|
+
organisation_id?: string;
|
|
426
433
|
/** The Organisational Unit you want the Dataset to belong to
|
|
427
434
|
*/
|
|
428
435
|
unit_id: string;
|
|
@@ -1616,6 +1623,9 @@ export interface AdminJobManifestLoadPutResponse {
|
|
|
1616
1623
|
/** The number of Jobs inspected
|
|
1617
1624
|
*/
|
|
1618
1625
|
jobs_inspected: number;
|
|
1626
|
+
/** The number of Jobs purged
|
|
1627
|
+
*/
|
|
1628
|
+
jobs_purged?: number;
|
|
1619
1629
|
}
|
|
1620
1630
|
|
|
1621
1631
|
export interface AccountServerGetNamespaceResponse {
|
|
@@ -1627,6 +1637,12 @@ export interface AccountServerGetNamespaceResponse {
|
|
|
1627
1637
|
data_manager_name: string;
|
|
1628
1638
|
}
|
|
1629
1639
|
|
|
1640
|
+
export interface AccountServerGetRegistrationResponse {
|
|
1641
|
+
merchant_id: number;
|
|
1642
|
+
name: string;
|
|
1643
|
+
registered: string;
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1630
1646
|
export interface DmError {
|
|
1631
1647
|
/** Brief error text that can be presented to the user
|
|
1632
1648
|
*/
|
package/src/dataset/dataset.ts
CHANGED
|
@@ -171,7 +171,9 @@ export const uploadDataset = (
|
|
|
171
171
|
if (datasetPostBodyBody.dataset_id !== undefined) {
|
|
172
172
|
formData.append("dataset_id", datasetPostBodyBody.dataset_id);
|
|
173
173
|
}
|
|
174
|
-
|
|
174
|
+
if (datasetPostBodyBody.organisation_id !== undefined) {
|
|
175
|
+
formData.append("organisation_id", datasetPostBodyBody.organisation_id);
|
|
176
|
+
}
|
|
175
177
|
formData.append("unit_id", datasetPostBodyBody.unit_id);
|
|
176
178
|
|
|
177
179
|
return customInstance<DatasetPutPostResponse>(
|
package/src/project/project.ts
CHANGED
|
@@ -117,8 +117,12 @@ export const createProject = (
|
|
|
117
117
|
if (projectPostBodyBody.private !== undefined) {
|
|
118
118
|
formData.append("private", projectPostBodyBody.private.toString());
|
|
119
119
|
}
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
if (projectPostBodyBody.organisation_id !== undefined) {
|
|
121
|
+
formData.append("organisation_id", projectPostBodyBody.organisation_id);
|
|
122
|
+
}
|
|
123
|
+
if (projectPostBodyBody.unit_id !== undefined) {
|
|
124
|
+
formData.append("unit_id", projectPostBodyBody.unit_id);
|
|
125
|
+
}
|
|
122
126
|
formData.append("tier_product_id", projectPostBodyBody.tier_product_id);
|
|
123
127
|
|
|
124
128
|
return customInstance<ProjectPostResponse>(
|
package/task/task.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_query from 'react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
|
|
3
|
-
import { e as GetTasksParams,
|
|
3
|
+
import { e as GetTasksParams, bj as customInstance, aI as TasksGetResponse, bk as ErrorType, bf as DmError, d as GetTaskParams, aK as TaskGetResponse } from '../custom-instance-910c4a7d.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
declare type AwaitedInput<T> = PromiseLike<T> | T;
|
package/type/type.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
|
|
2
|
-
import {
|
|
2
|
+
import { bj as customInstance, aH as TypesGetResponse, bk as ErrorType, bf as DmError } from '../custom-instance-910c4a7d.js';
|
|
3
3
|
import 'axios';
|
|
4
4
|
|
|
5
5
|
/**
|
package/user/user.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_query from 'react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from 'react-query';
|
|
3
|
-
import {
|
|
3
|
+
import { bj as customInstance, aE as UsersGetResponse, bk as ErrorType, bf as DmError, a as GetUserAccountParams, a1 as UserAccountDetail, M as UserAccountPatchBodyBody, G as GetUserApiLogParams, aF as UserApiLogGetResponse } from '../custom-instance-910c4a7d.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
declare type AwaitedInput<T> = PromiseLike<T> | T;
|