diff --git a/pages/_app.tsx b/pages/_app.tsx index 86cb2ae45663a8d3228490b04360557b7f11e05a..a6e5e3daa3bb7b1b19651ce99ef4e13f6c869b39 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -138,7 +138,7 @@ const App = (props: React.PropsWithChildren) => { name: 'fdo', list: '/fdo', show: '/fdo/show/:id', - create: '/fdo', + create: '/fdo/create', meta: { icon: logo } diff --git a/pages/fdo/create/index.tsx b/pages/fdo/create/index.tsx new file mode 100644 index 0000000000000000000000000000000000000000..f9ed32774ea24c215e1cec01edfa3d28ab192865 --- /dev/null +++ b/pages/fdo/create/index.tsx @@ -0,0 +1,23 @@ +import React from 'react' + +import { FdoCreate } from '../../../src/components/fdos' +import { GetServerSideProps } from 'next' +import { serverSideTranslations } from 'next-i18next/serverSideTranslations' + +const CreateFDO = () => { + return <FdoCreate/> +} + +export default CreateFDO + +export const getServerSideProps: GetServerSideProps<{}> = async (context) => { + const translateProps = await serverSideTranslations(context.locale ?? 'en', [ + 'common' + ]) + + return { + props: { + ...translateProps + } + } +} diff --git a/pages/fdo/index.tsx b/pages/fdo/index.tsx index 5e6feb4a095bd8a4293ad2478b3c4bfe62ff7a6c..f60558b40df2a723404578f4b52ab5d389a81b8d 100644 --- a/pages/fdo/index.tsx +++ b/pages/fdo/index.tsx @@ -1,14 +1,14 @@ import React from 'react' - -import { FdoCreate } from '../../src/components/fdos' import { GetServerSideProps } from 'next' import { serverSideTranslations } from 'next-i18next/serverSideTranslations' -const CreateFDO = () => { - return <FdoCreate/> +import { LoggingList } from '../../src/components/fdos' + +const ListFdo = () => { + return <LoggingList/> } -export default CreateFDO +export default ListFdo export const getServerSideProps: GetServerSideProps<{}> = async (context) => { const translateProps = await serverSideTranslations(context.locale ?? 'en', [ diff --git a/pages/fdo/show/[id]/index.tsx b/pages/fdo/show/[id]/index.tsx index 8bbbe0e73b782ae962875492c552cfb61fa6994d..830062bb06c918b58e37cd8c8d2b4802fc12ee99 100644 --- a/pages/fdo/show/[id]/index.tsx +++ b/pages/fdo/show/[id]/index.tsx @@ -3,14 +3,17 @@ import React from 'react' import { ErrorComponent } from '../../../../src/components/ErrorComponent' import { GetServerSideProps } from 'next' import { serverSideTranslations } from 'next-i18next/serverSideTranslations' -import { useShow } from '@refinedev/core' +import { useShow, useTranslate } from '@refinedev/core' import { Show } from '@refinedev/mui' import { Typography } from '@mui/material' import CircularProgress from '@mui/material/CircularProgress' import Box from '@mui/material/Box' +import Stack from '@mui/material/Stack' import Chip from '@mui/material/Chip' +import Link from '@mui/material/Link' const ShowFDO = () => { + const t = useTranslate() const { queryResult: { isError, error, isLoading, data }, showId } = useShow({ errorNotification: () => false, queryOptions: { @@ -20,16 +23,21 @@ const ShowFDO = () => { if (isError) { console.log('error', error) - return <ErrorComponent/> + return <ErrorComponent message={t('fdo.show.handle_not_found', 'Handle not found.')} /> } + const handleUrl = `https://hdl.handle.net/${showId}` + return ( <Show isLoading={isLoading} title={<Typography variant="h5">{ showId }{ !isLoading && (data?.data?.isFdo ? <Chip label="FDO" color="success" variant="outlined" /> : <Chip label="Not an FDO" color="error" variant="outlined" />)}</Typography>} > { isLoading && <Box sx={{ textAlign: 'center' }}><CircularProgress/></Box>} - <Box>This is FDO { showId }</Box> + <Stack> + <Box><Link href={handleUrl}>To Repository</Link></Box> + <Box><Link href={`${handleUrl}?noredirect`}>View Handle Record</Link></Box> + </Stack> </Show> ) diff --git a/src/api/api.ts b/src/api/api.ts index 3e8cfaeccc7df79032ac475b987b27ecba85a028..b0f308edbee999af4044c62c65750e6a018de118 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -1,10 +1,10 @@ /* eslint-disable */ /** * FDO Manager Service API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * The FDO Manager Service API for creating FAIR Digital Objects. * * The version of the OpenAPI document: 0.1 - * + * Contact: t.fitschen@indiscale.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -22,61 +22,6 @@ import type { RequestArgs } from './base'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base'; -/** - * - * @export - * @interface CreateFDOProcess - */ -export interface CreateFDOProcess { - /** - * - * @type {CreateFDOProcessState} - * @memberof CreateFDOProcess - */ - 'state'?: CreateFDOProcessState; - /** - * - * @type {string} - * @memberof CreateFDOProcess - */ - 'processId': string; - /** - * - * @type {TargetRepositories} - * @memberof CreateFDOProcess - */ - 'targetRepository': TargetRepositories; -} - - -/** - * - * @export - * @enum {string} - */ - -export const CreateFDOProcessState = { - Processing: 'processing', - Finished: 'finished', - Canceled: 'canceled' -} as const; - -export type CreateFDOProcessState = typeof CreateFDOProcessState[keyof typeof CreateFDOProcessState]; - - -/** - * - * @export - * @interface CreateFDORequest - */ -export interface CreateFDORequest { - /** - * - * @type {TargetRepositories} - * @memberof CreateFDORequest - */ - 'targetRepository': TargetRepositories; -} /** * * @export @@ -202,6 +147,12 @@ export interface Info { * @memberof Info */ 'serviceProvider'?: string; + /** + * + * @type {SelfLink} + * @memberof Info + */ + 'links'?: SelfLink; } /** * @@ -222,6 +173,25 @@ export interface Links { */ 'collection'?: string; } +/** + * + * @export + * @interface ListLogEvents200Response + */ +export interface ListLogEvents200Response { + /** + * + * @type {Array<OperationsLogRecord>} + * @memberof ListLogEvents200Response + */ + 'data'?: Array<OperationsLogRecord>; + /** + * + * @type {PaginationLinks} + * @memberof ListLogEvents200Response + */ + 'links'?: PaginationLinks; +} /** * * @export @@ -282,21 +252,108 @@ export interface ModelError { /** * * @export - * @interface OverviewFdoCreate200Response + * @interface OperationsLogRecord */ -export interface OverviewFdoCreate200Response { +export interface OperationsLogRecord { /** * - * @type {CreateFDOProcess} - * @memberof OverviewFdoCreate200Response + * @type {string} + * @memberof OperationsLogRecord */ - 'data': CreateFDOProcess; + 'id'?: string; /** * - * @type {Links} - * @memberof OverviewFdoCreate200Response + * @type {string} + * @memberof OperationsLogRecord */ - 'links'?: Links; + 'type'?: string; + /** + * + * @type {OperationsLogRecordAttributes} + * @memberof OperationsLogRecord + */ + 'attributes'?: OperationsLogRecordAttributes; + /** + * + * @type {SelfLink} + * @memberof OperationsLogRecord + */ + 'links'?: SelfLink; +} +/** + * + * @export + * @interface OperationsLogRecordAttributes + */ +export interface OperationsLogRecordAttributes { + /** + * + * @type {string} + * @memberof OperationsLogRecordAttributes + */ + 'operation'?: OperationsLogRecordAttributesOperationEnum; + /** + * + * @type {string} + * @memberof OperationsLogRecordAttributes + */ + 'timestamp'?: string; + /** + * + * @type {TargetRepositories} + * @memberof OperationsLogRecordAttributes + */ + 'repositories'?: TargetRepositories; + /** + * + * @type {DigitalObject} + * @memberof OperationsLogRecordAttributes + */ + 'fdo'?: DigitalObject; +} + +export const OperationsLogRecordAttributesOperationEnum = { + OpCreate: 'Op.Create' +} as const; + +export type OperationsLogRecordAttributesOperationEnum = typeof OperationsLogRecordAttributesOperationEnum[keyof typeof OperationsLogRecordAttributesOperationEnum]; + +/** + * + * @export + * @interface PaginationLinks + */ +export interface PaginationLinks { + /** + * + * @type {string} + * @memberof PaginationLinks + */ + 'self'?: string; + /** + * + * @type {string} + * @memberof PaginationLinks + */ + 'first'?: string; + /** + * + * @type {string} + * @memberof PaginationLinks + */ + 'prev'?: string; + /** + * + * @type {string} + * @memberof PaginationLinks + */ + 'next'?: string; + /** + * + * @type {string} + * @memberof PaginationLinks + */ + 'last'?: string; } /** * @@ -355,6 +412,19 @@ export interface ResolvePID200Response { */ 'links'?: Links; } +/** + * + * @export + * @interface SelfLink + */ +export interface SelfLink { + /** + * + * @type {string} + * @memberof SelfLink + */ + 'self'?: string; +} /** * * @export @@ -366,7 +436,7 @@ export interface TargetRepositories { * @type {string} * @memberof TargetRepositories */ - 'fdo': string; + 'fdo'?: string; /** * * @type {string} @@ -380,46 +450,15 @@ export interface TargetRepositories { */ 'data'?: string; } -/** - * - * @export - * @interface UpdateStateFdoCreateRequest - */ -export interface UpdateStateFdoCreateRequest { - /** - * - * @type {CreateFDOProcessState} - * @memberof UpdateStateFdoCreateRequest - */ - 'data': CreateFDOProcessState; -} - - -/** - * - * @export - * @interface UploadState - */ -export interface UploadState { - /** - * - * @type {CreateFDOProcessState} - * @memberof UploadState - */ - 'state'?: CreateFDOProcessState; -} - - /** - * DefaultApi - axios parameter creator + * FDOsApi - axios parameter creator * @export */ -export const DefaultApiAxiosParamCreator = function (configuration?: Configuration) { +export const FDOsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * - * @summary Create an FDO. + * Create an FDO. * @param {TargetRepositories} repositories * @param {File} data * @param {File} metadata @@ -473,13 +512,16 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * - * @summary Retrieve general information on the service. + * Resolve a pid. + * @param {string} pid Persistent Identifier * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getInfo: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { - const localVarPath = `/info`; + resolvePID: async (pid: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { + // verify required parameter 'pid' is not null or undefined + assertParamExists('resolvePID', 'pid', pid) + const localVarPath = `/fdo/{pid}` + .replace(`{${"pid"}}`, encodeURIComponent(String(pid))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -502,52 +544,122 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati options: localVarRequestOptions, }; }, + } +}; + +/** + * FDOsApi - functional programming interface + * @export + */ +export const FDOsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = FDOsApiAxiosParamCreator(configuration) + return { + /** + * Create an FDO. + * @param {TargetRepositories} repositories + * @param {File} data + * @param {File} metadata + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createFDO(repositories: TargetRepositories, data: File, metadata: File, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createFDO(repositories, data, metadata, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['FDOsApi.createFDO']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, /** - * - * @summary Get the current state of the FDO creation process. - * @param {string} processId Repository ID + * Resolve a pid. + * @param {string} pid Persistent Identifier * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getStateFdoCreate: async (processId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { - // verify required parameter 'processId' is not null or undefined - assertParamExists('getStateFdoCreate', 'processId', processId) - const localVarPath = `/fdo/create/{processId}/state` - .replace(`{${"processId"}}`, encodeURIComponent(String(processId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } + async resolvePID(pid: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ResolvePID200Response>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.resolvePID(pid, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['FDOsApi.resolvePID']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; +/** + * FDOsApi - factory interface + * @export + */ +export const FDOsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = FDOsApiFp(configuration) + return { + /** + * Create an FDO. + * @param {TargetRepositories} repositories + * @param {File} data + * @param {File} metadata + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createFDO(repositories: TargetRepositories, data: File, metadata: File, options?: any): AxiosPromise<void> { + return localVarFp.createFDO(repositories, data, metadata, options).then((request) => request(axios, basePath)); + }, + /** + * Resolve a pid. + * @param {string} pid Persistent Identifier + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + resolvePID(pid: string, options?: any): AxiosPromise<ResolvePID200Response> { + return localVarFp.resolvePID(pid, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * FDOsApi - object-oriented interface + * @export + * @class FDOsApi + * @extends {BaseAPI} + */ +export class FDOsApi extends BaseAPI { + /** + * Create an FDO. + * @param {TargetRepositories} repositories + * @param {File} data + * @param {File} metadata + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FDOsApi + */ + public createFDO(repositories: TargetRepositories, data: File, metadata: File, options?: RawAxiosRequestConfig) { + return FDOsApiFp(this.configuration).createFDO(repositories, data, metadata, options).then((request) => request(this.axios, this.basePath)); + } + /** + * Resolve a pid. + * @param {string} pid Persistent Identifier + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FDOsApi + */ + public resolvePID(pid: string, options?: RawAxiosRequestConfig) { + return FDOsApiFp(this.configuration).resolvePID(pid, options).then((request) => request(this.axios, this.basePath)); + } +} - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, + +/** + * InfoApi - axios parameter creator + * @export + */ +export const InfoApiAxiosParamCreator = function (configuration?: Configuration) { + return { /** - * - * @summary Get the current state of the data file of the FDO. - * @param {string} processId Repository ID + * Retrieve general information on the service. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getStatusFdoCreateData: async (processId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { - // verify required parameter 'processId' is not null or undefined - assertParamExists('getStatusFdoCreateData', 'processId', processId) - const localVarPath = `/fdo/create/{processId}/data` - .replace(`{${"processId"}}`, encodeURIComponent(String(processId))); + getInfo: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { + const localVarPath = `/info`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -571,17 +683,12 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati }; }, /** - * - * @summary Get the current state of the metadata file of the FDO. - * @param {string} processId Repository ID + * Say hello to the server. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getStatusFdoCreateMetadata: async (processId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { - // verify required parameter 'processId' is not null or undefined - assertParamExists('getStatusFdoCreateMetadata', 'processId', processId) - const localVarPath = `/fdo/create/{processId}/metadata` - .replace(`{${"processId"}}`, encodeURIComponent(String(processId))); + hello: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { + const localVarPath = `/hello`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -604,193 +711,112 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati options: localVarRequestOptions, }; }, - /** - * - * @summary Say hello to the server. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - hello: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { - const localVarPath = `/hello`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + } +}; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, +/** + * InfoApi - functional programming interface + * @export + */ +export const InfoApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = InfoApiAxiosParamCreator(configuration) + return { /** - * - * @summary Initiate the process to create an FDO - * @param {CreateFDORequest} createFDORequest + * Retrieve general information on the service. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - initiateFdoCreate: async (createFDORequest: CreateFDORequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { - // verify required parameter 'createFDORequest' is not null or undefined - assertParamExists('initiateFdoCreate', 'createFDORequest', createFDORequest) - const localVarPath = `/fdo/create`; - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(createFDORequest, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + async getInfo(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetInfo200Response>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getInfo(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['InfoApi.getInfo']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * - * @summary Get an overview of the FDO creation process. - * @param {string} processId Repository ID + * Say hello to the server. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - overviewFdoCreate: async (processId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { - // verify required parameter 'processId' is not null or undefined - assertParamExists('overviewFdoCreate', 'processId', processId) - const localVarPath = `/fdo/create/{processId}` - .replace(`{${"processId"}}`, encodeURIComponent(String(processId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + async hello(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Hello>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.hello(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['InfoApi.hello']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, + } +}; + +/** + * InfoApi - factory interface + * @export + */ +export const InfoApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = InfoApiFp(configuration) + return { /** - * - * @summary Resolve a pid. - * @param {string} pid Persistent Identifier + * Retrieve general information on the service. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - resolvePID: async (pid: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { - // verify required parameter 'pid' is not null or undefined - assertParamExists('resolvePID', 'pid', pid) - const localVarPath = `/pid/{pid}` - .replace(`{${"pid"}}`, encodeURIComponent(String(pid))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } - - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + getInfo(options?: any): AxiosPromise<GetInfo200Response> { + return localVarFp.getInfo(options).then((request) => request(axios, basePath)); }, /** - * - * @summary Update the current state of the FDO creation process. Use this to cancel or conclude the creation process - * @param {string} processId Repository ID - * @param {UpdateStateFdoCreateRequest} [updateStateFdoCreateRequest] + * Say hello to the server. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateStateFdoCreate: async (processId: string, updateStateFdoCreateRequest?: UpdateStateFdoCreateRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { - // verify required parameter 'processId' is not null or undefined - assertParamExists('updateStateFdoCreate', 'processId', processId) - const localVarPath = `/fdo/create/{processId}/state` - .replace(`{${"processId"}}`, encodeURIComponent(String(processId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; - } + hello(options?: any): AxiosPromise<Hello> { + return localVarFp.hello(options).then((request) => request(axios, basePath)); + }, + }; +}; - const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; +/** + * InfoApi - object-oriented interface + * @export + * @class InfoApi + * @extends {BaseAPI} + */ +export class InfoApi extends BaseAPI { + /** + * Retrieve general information on the service. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InfoApi + */ + public getInfo(options?: RawAxiosRequestConfig) { + return InfoApiFp(this.configuration).getInfo(options).then((request) => request(this.axios, this.basePath)); + } + /** + * Say hello to the server. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InfoApi + */ + public hello(options?: RawAxiosRequestConfig) { + return InfoApiFp(this.configuration).hello(options).then((request) => request(this.axios, this.basePath)); + } +} - - localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(updateStateFdoCreateRequest, localVarRequestOptions, configuration) - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, +/** + * LoggingApi - axios parameter creator + * @export + */ +export const LoggingApiAxiosParamCreator = function (configuration?: Configuration) { + return { /** - * - * @summary Upload the data file of the FDO. - * @param {string} processId Repository ID - * @param {File} body + * List latest log events + * @param {number} [pageNumber] + * @param {number} [pageSize] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadFdoCreateData: async (processId: string, body: File, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { - // verify required parameter 'processId' is not null or undefined - assertParamExists('uploadFdoCreateData', 'processId', processId) - // verify required parameter 'body' is not null or undefined - assertParamExists('uploadFdoCreateData', 'body', body) - const localVarPath = `/fdo/create/{processId}/data` - .replace(`{${"processId"}}`, encodeURIComponent(String(processId))); + listLogEvents: async (pageNumber?: number, pageSize?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { + const localVarPath = `/logging`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -798,58 +824,23 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - - - localVarHeaderParameter['Content-Type'] = 'application/octet-stream'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * - * @summary Upload the metadata file of the FDO. - * @param {string} processId Repository ID - * @param {File} body - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - uploadFdoCreateMetadata: async (processId: string, body: File, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { - // verify required parameter 'processId' is not null or undefined - assertParamExists('uploadFdoCreateMetadata', 'processId', processId) - // verify required parameter 'body' is not null or undefined - assertParamExists('uploadFdoCreateMetadata', 'body', body) - const localVarPath = `/fdo/create/{processId}/metadata` - .replace(`{${"processId"}}`, encodeURIComponent(String(processId))); - // use dummy base URL string because the URL constructor only accepts absolute URLs. - const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); - let baseOptions; - if (configuration) { - baseOptions = configuration.baseOptions; + if (pageNumber !== undefined) { + localVarQueryParameter['page[number]'] = pageNumber; } - const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + if (pageSize !== undefined) { + localVarQueryParameter['page[size]'] = pageSize; + } - localVarHeaderParameter['Content-Type'] = 'application/octet-stream'; - setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -860,459 +851,65 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati }; /** - * DefaultApi - functional programming interface + * LoggingApi - functional programming interface * @export */ -export const DefaultApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = DefaultApiAxiosParamCreator(configuration) +export const LoggingApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = LoggingApiAxiosParamCreator(configuration) return { /** - * - * @summary Create an FDO. - * @param {TargetRepositories} repositories - * @param {File} data - * @param {File} metadata + * List latest log events + * @param {number} [pageNumber] + * @param {number} [pageSize] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async createFDO(repositories: TargetRepositories, data: File, metadata: File, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.createFDO(repositories, data, metadata, options); + async listLogEvents(pageNumber?: number, pageSize?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListLogEvents200Response>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listLogEvents(pageNumber, pageSize, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.createFDO']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Retrieve general information on the service. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getInfo(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetInfo200Response>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getInfo(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.getInfo']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get the current state of the FDO creation process. - * @param {string} processId Repository ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getStateFdoCreate(processId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getStateFdoCreate(processId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.getStateFdoCreate']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get the current state of the data file of the FDO. - * @param {string} processId Repository ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getStatusFdoCreateData(processId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getStatusFdoCreateData(processId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.getStatusFdoCreateData']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get the current state of the metadata file of the FDO. - * @param {string} processId Repository ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getStatusFdoCreateMetadata(processId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getStatusFdoCreateMetadata(processId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.getStatusFdoCreateMetadata']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Say hello to the server. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async hello(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Hello>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.hello(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.hello']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Initiate the process to create an FDO - * @param {CreateFDORequest} createFDORequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async initiateFdoCreate(createFDORequest: CreateFDORequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.initiateFdoCreate(createFDORequest, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.initiateFdoCreate']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Get an overview of the FDO creation process. - * @param {string} processId Repository ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async overviewFdoCreate(processId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<OverviewFdoCreate200Response>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.overviewFdoCreate(processId, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.overviewFdoCreate']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Resolve a pid. - * @param {string} pid Persistent Identifier - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async resolvePID(pid: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ResolvePID200Response>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.resolvePID(pid, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.resolvePID']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Update the current state of the FDO creation process. Use this to cancel or conclude the creation process - * @param {string} processId Repository ID - * @param {UpdateStateFdoCreateRequest} [updateStateFdoCreateRequest] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async updateStateFdoCreate(processId: string, updateStateFdoCreateRequest?: UpdateStateFdoCreateRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.updateStateFdoCreate(processId, updateStateFdoCreateRequest, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.updateStateFdoCreate']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Upload the data file of the FDO. - * @param {string} processId Repository ID - * @param {File} body - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async uploadFdoCreateData(processId: string, body: File, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFdoCreateData(processId, body, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.uploadFdoCreateData']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * - * @summary Upload the metadata file of the FDO. - * @param {string} processId Repository ID - * @param {File} body - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async uploadFdoCreateMetadata(processId: string, body: File, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFdoCreateMetadata(processId, body, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['DefaultApi.uploadFdoCreateMetadata']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['LoggingApi.listLogEvents']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** - * DefaultApi - factory interface + * LoggingApi - factory interface * @export */ -export const DefaultApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = DefaultApiFp(configuration) +export const LoggingApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = LoggingApiFp(configuration) return { /** - * - * @summary Create an FDO. - * @param {TargetRepositories} repositories - * @param {File} data - * @param {File} metadata - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - createFDO(repositories: TargetRepositories, data: File, metadata: File, options?: any): AxiosPromise<void> { - return localVarFp.createFDO(repositories, data, metadata, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Retrieve general information on the service. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getInfo(options?: any): AxiosPromise<GetInfo200Response> { - return localVarFp.getInfo(options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get the current state of the FDO creation process. - * @param {string} processId Repository ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getStateFdoCreate(processId: string, options?: any): AxiosPromise<object> { - return localVarFp.getStateFdoCreate(processId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get the current state of the data file of the FDO. - * @param {string} processId Repository ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getStatusFdoCreateData(processId: string, options?: any): AxiosPromise<object> { - return localVarFp.getStatusFdoCreateData(processId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get the current state of the metadata file of the FDO. - * @param {string} processId Repository ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getStatusFdoCreateMetadata(processId: string, options?: any): AxiosPromise<object> { - return localVarFp.getStatusFdoCreateMetadata(processId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Say hello to the server. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - hello(options?: any): AxiosPromise<Hello> { - return localVarFp.hello(options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Initiate the process to create an FDO - * @param {CreateFDORequest} createFDORequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - initiateFdoCreate(createFDORequest: CreateFDORequest, options?: any): AxiosPromise<void> { - return localVarFp.initiateFdoCreate(createFDORequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Get an overview of the FDO creation process. - * @param {string} processId Repository ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - overviewFdoCreate(processId: string, options?: any): AxiosPromise<OverviewFdoCreate200Response> { - return localVarFp.overviewFdoCreate(processId, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Resolve a pid. - * @param {string} pid Persistent Identifier - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - resolvePID(pid: string, options?: any): AxiosPromise<ResolvePID200Response> { - return localVarFp.resolvePID(pid, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Update the current state of the FDO creation process. Use this to cancel or conclude the creation process - * @param {string} processId Repository ID - * @param {UpdateStateFdoCreateRequest} [updateStateFdoCreateRequest] + * List latest log events + * @param {number} [pageNumber] + * @param {number} [pageSize] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - updateStateFdoCreate(processId: string, updateStateFdoCreateRequest?: UpdateStateFdoCreateRequest, options?: any): AxiosPromise<object> { - return localVarFp.updateStateFdoCreate(processId, updateStateFdoCreateRequest, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Upload the data file of the FDO. - * @param {string} processId Repository ID - * @param {File} body - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - uploadFdoCreateData(processId: string, body: File, options?: any): AxiosPromise<object> { - return localVarFp.uploadFdoCreateData(processId, body, options).then((request) => request(axios, basePath)); - }, - /** - * - * @summary Upload the metadata file of the FDO. - * @param {string} processId Repository ID - * @param {File} body - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - uploadFdoCreateMetadata(processId: string, body: File, options?: any): AxiosPromise<object> { - return localVarFp.uploadFdoCreateMetadata(processId, body, options).then((request) => request(axios, basePath)); + listLogEvents(pageNumber?: number, pageSize?: number, options?: any): AxiosPromise<ListLogEvents200Response> { + return localVarFp.listLogEvents(pageNumber, pageSize, options).then((request) => request(axios, basePath)); }, }; }; /** - * DefaultApi - object-oriented interface + * LoggingApi - object-oriented interface * @export - * @class DefaultApi + * @class LoggingApi * @extends {BaseAPI} */ -export class DefaultApi extends BaseAPI { - /** - * - * @summary Create an FDO. - * @param {TargetRepositories} repositories - * @param {File} data - * @param {File} metadata - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public createFDO(repositories: TargetRepositories, data: File, metadata: File, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).createFDO(repositories, data, metadata, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Retrieve general information on the service. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public getInfo(options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).getInfo(options).then((request) => request(this.axios, this.basePath)); - } - +export class LoggingApi extends BaseAPI { /** - * - * @summary Get the current state of the FDO creation process. - * @param {string} processId Repository ID + * List latest log events + * @param {number} [pageNumber] + * @param {number} [pageSize] * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof DefaultApi + * @memberof LoggingApi */ - public getStateFdoCreate(processId: string, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).getStateFdoCreate(processId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get the current state of the data file of the FDO. - * @param {string} processId Repository ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public getStatusFdoCreateData(processId: string, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).getStatusFdoCreateData(processId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get the current state of the metadata file of the FDO. - * @param {string} processId Repository ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public getStatusFdoCreateMetadata(processId: string, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).getStatusFdoCreateMetadata(processId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Say hello to the server. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public hello(options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).hello(options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Initiate the process to create an FDO - * @param {CreateFDORequest} createFDORequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public initiateFdoCreate(createFDORequest: CreateFDORequest, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).initiateFdoCreate(createFDORequest, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Get an overview of the FDO creation process. - * @param {string} processId Repository ID - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public overviewFdoCreate(processId: string, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).overviewFdoCreate(processId, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Resolve a pid. - * @param {string} pid Persistent Identifier - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public resolvePID(pid: string, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).resolvePID(pid, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Update the current state of the FDO creation process. Use this to cancel or conclude the creation process - * @param {string} processId Repository ID - * @param {UpdateStateFdoCreateRequest} [updateStateFdoCreateRequest] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public updateStateFdoCreate(processId: string, updateStateFdoCreateRequest?: UpdateStateFdoCreateRequest, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).updateStateFdoCreate(processId, updateStateFdoCreateRequest, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Upload the data file of the FDO. - * @param {string} processId Repository ID - * @param {File} body - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public uploadFdoCreateData(processId: string, body: File, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).uploadFdoCreateData(processId, body, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * - * @summary Upload the metadata file of the FDO. - * @param {string} processId Repository ID - * @param {File} body - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof DefaultApi - */ - public uploadFdoCreateMetadata(processId: string, body: File, options?: RawAxiosRequestConfig) { - return DefaultApiFp(this.configuration).uploadFdoCreateMetadata(processId, body, options).then((request) => request(this.axios, this.basePath)); + public listLogEvents(pageNumber?: number, pageSize?: number, options?: RawAxiosRequestConfig) { + return LoggingApiFp(this.configuration).listLogEvents(pageNumber, pageSize, options).then((request) => request(this.axios, this.basePath)); } } @@ -1325,8 +922,7 @@ export class DefaultApi extends BaseAPI { export const ProfilesApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * - * @summary Get information on a single profile. + * Get information on a single profile. * @param {string} profileId Profile ID * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -1359,8 +955,7 @@ export const ProfilesApiAxiosParamCreator = function (configuration?: Configurat }; }, /** - * - * @summary List known profiles. + * List known profiles. * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -1399,8 +994,7 @@ export const ProfilesApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ProfilesApiAxiosParamCreator(configuration) return { /** - * - * @summary Get information on a single profile. + * Get information on a single profile. * @param {string} profileId Profile ID * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -1412,8 +1006,7 @@ export const ProfilesApiFp = function(configuration?: Configuration) { return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * - * @summary List known profiles. + * List known profiles. * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -1434,8 +1027,7 @@ export const ProfilesApiFactory = function (configuration?: Configuration, baseP const localVarFp = ProfilesApiFp(configuration) return { /** - * - * @summary Get information on a single profile. + * Get information on a single profile. * @param {string} profileId Profile ID * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -1444,8 +1036,7 @@ export const ProfilesApiFactory = function (configuration?: Configuration, baseP return localVarFp.getProfile(profileId, options).then((request) => request(axios, basePath)); }, /** - * - * @summary List known profiles. + * List known profiles. * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -1463,8 +1054,7 @@ export const ProfilesApiFactory = function (configuration?: Configuration, baseP */ export class ProfilesApi extends BaseAPI { /** - * - * @summary Get information on a single profile. + * Get information on a single profile. * @param {string} profileId Profile ID * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -1475,8 +1065,7 @@ export class ProfilesApi extends BaseAPI { } /** - * - * @summary List known profiles. + * List known profiles. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ProfilesApi @@ -1495,8 +1084,7 @@ export class ProfilesApi extends BaseAPI { export const RepositoriesApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * - * @summary Get information on a single repository. + * Get information on a single repository. * @param {string} repositoryId Repository ID * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -1529,8 +1117,7 @@ export const RepositoriesApiAxiosParamCreator = function (configuration?: Config }; }, /** - * - * @summary List trusted repositories. + * List trusted repositories. * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -1569,8 +1156,7 @@ export const RepositoriesApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = RepositoriesApiAxiosParamCreator(configuration) return { /** - * - * @summary Get information on a single repository. + * Get information on a single repository. * @param {string} repositoryId Repository ID * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -1582,8 +1168,7 @@ export const RepositoriesApiFp = function(configuration?: Configuration) { return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * - * @summary List trusted repositories. + * List trusted repositories. * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -1604,8 +1189,7 @@ export const RepositoriesApiFactory = function (configuration?: Configuration, b const localVarFp = RepositoriesApiFp(configuration) return { /** - * - * @summary Get information on a single repository. + * Get information on a single repository. * @param {string} repositoryId Repository ID * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -1614,8 +1198,7 @@ export const RepositoriesApiFactory = function (configuration?: Configuration, b return localVarFp.getRepository(repositoryId, options).then((request) => request(axios, basePath)); }, /** - * - * @summary List trusted repositories. + * List trusted repositories. * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -1633,8 +1216,7 @@ export const RepositoriesApiFactory = function (configuration?: Configuration, b */ export class RepositoriesApi extends BaseAPI { /** - * - * @summary Get information on a single repository. + * Get information on a single repository. * @param {string} repositoryId Repository ID * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -1645,8 +1227,7 @@ export class RepositoriesApi extends BaseAPI { } /** - * - * @summary List trusted repositories. + * List trusted repositories. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof RepositoriesApi diff --git a/src/api/base.ts b/src/api/base.ts index 89b54ab09df447064fb08782c996cf380d5835ac..8cbe71836c1ff299408b27b425ac934c305a5f9b 100644 --- a/src/api/base.ts +++ b/src/api/base.ts @@ -1,10 +1,10 @@ /* eslint-disable */ /** * FDO Manager Service API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * The FDO Manager Service API for creating FAIR Digital Objects. * * The version of the OpenAPI document: 0.1 - * + * Contact: t.fitschen@indiscale.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/src/api/common.ts b/src/api/common.ts index 9b2273c98700ebe566ff37920e98183099468bce..936f34c3a7895fcdffe03d2dc24434570cedfa6c 100644 --- a/src/api/common.ts +++ b/src/api/common.ts @@ -1,10 +1,10 @@ /* eslint-disable */ /** * FDO Manager Service API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * The FDO Manager Service API for creating FAIR Digital Objects. * * The version of the OpenAPI document: 0.1 - * + * Contact: t.fitschen@indiscale.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/src/api/configuration.ts b/src/api/configuration.ts index e8efb77751fdb2719a59de13b2ab7a78437280bf..1a3fbb63e471b75a0e100d11866ff1805d4639d8 100644 --- a/src/api/configuration.ts +++ b/src/api/configuration.ts @@ -1,10 +1,10 @@ /* eslint-disable */ /** * FDO Manager Service API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * The FDO Manager Service API for creating FAIR Digital Objects. * * The version of the OpenAPI document: 0.1 - * + * Contact: t.fitschen@indiscale.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/src/api/index.ts b/src/api/index.ts index 10f56534ef2c21414b7312c81a28f62f8e6bab6f..49b1dd417c32290cfce830001aaae51615a724b4 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,10 +1,10 @@ /* eslint-disable */ /** * FDO Manager Service API - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * The FDO Manager Service API for creating FAIR Digital Objects. * * The version of the OpenAPI document: 0.1 - * + * Contact: t.fitschen@indiscale.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/src/components/ErrorComponent.tsx b/src/components/ErrorComponent.tsx index dd58db0db0f06217d7d66b071161207caee707d9..c30b54595ac39e939ea002abea6bc84f2ac3baf5 100644 --- a/src/components/ErrorComponent.tsx +++ b/src/components/ErrorComponent.tsx @@ -9,7 +9,7 @@ import Grid from '@mui/material/Grid' import Info from '@mui/icons-material/Info' -export const ErrorComponent: React.FC<any> = ({ status = 404, back = undefined }) => { +export const ErrorComponent: React.FC<any> = ({ status = 404, back = undefined, message }) => { // const [errorMessage, setErrorMessage] = useState<string>(); const { push } = useNavigation() const go = useGo() @@ -18,6 +18,10 @@ export const ErrorComponent: React.FC<any> = ({ status = 404, back = undefined } // const { resource, action } = useResource(); const translate = useTranslate() + const showErrorMessage = message || translate( + 'pages.error.404', + 'Sorry, the page you visited does not exist.' + ) /* useEffect(() => { @@ -52,10 +56,7 @@ export const ErrorComponent: React.FC<any> = ({ status = 404, back = undefined } <Typography variant="h1">{status}</Typography> <Stack direction="row" spacing="2"> <Typography> - {translate( - 'pages.error.404', - 'Sorry, the page you visited does not exist.' - )} + { showErrorMessage } </Typography> {/* diff --git a/src/components/fdos/index.ts b/src/components/fdos/index.ts index f756a8bb30f99725945915a7511c321515a1e96d..a892195e52693d39746a36cf0609a50f19b5acf7 100644 --- a/src/components/fdos/index.ts +++ b/src/components/fdos/index.ts @@ -1 +1,2 @@ export * from './create' +export * from './list' diff --git a/src/components/fdos/list.tsx b/src/components/fdos/list.tsx new file mode 100644 index 0000000000000000000000000000000000000000..ca688a14ca49e96ee0ff20a9583dc29d221a1c3e --- /dev/null +++ b/src/components/fdos/list.tsx @@ -0,0 +1,43 @@ +import { IResourceComponentsProps } from '@refinedev/core' +import Link from '@mui/material/Link' + +import { List, useDataGrid } from '@refinedev/mui' + +import { + DataGrid, + GridColDef, + GridValueFormatterParams +} from '@mui/x-data-grid' + +import { OperationsLogRecord } from '../../api/api' + +const columns: Array<GridColDef<OperationsLogRecord>> = [ + { + field: 'operation', + headerName: 'Operation', + type: 'string', + width: 200 + }, + { + field: 'id', + headerName: 'FDO', + type: 'string', + width: 200 + } +] + +export const LoggingList: React.FC<IResourceComponentsProps> = () => { + const { dataGridProps } = useDataGrid<OperationsLogRecord>({ + resource: 'fdo' + }) + + const rows = dataGridProps.rows.map((record: OperationsLogRecord, index) => { + return { id: record?.attributes?.fdo?.pid, operation: record?.attributes?.operation } + }) + + return ( + <List> + <DataGrid {...dataGridProps} rows={rows} columns={columns} autoHeight /> + </List> + ) +} diff --git a/src/providers/dataProvider.tsx b/src/providers/dataProvider.tsx index 0814e10c38ae914dc202b29970161f2f20c4ef55..c392dea7c9858d5727ac00499e793a1e257d465a 100644 --- a/src/providers/dataProvider.tsx +++ b/src/providers/dataProvider.tsx @@ -1,6 +1,6 @@ import { DataProvider, useOne } from '@refinedev/core' import dataProvider from '@refinedev/simple-rest' -import { Configuration, ProfilesApi, RepositoriesApi, DefaultApi, GetInfo200Response, ListRepositories200Response } from '../api' +import { Configuration, ProfilesApi, RepositoriesApi, FDOsApi, InfoApi, LoggingApi, GetInfo200Response, ListRepositories200Response } from '../api' import axios from 'axios' const getNewlyCreated = async (newLocation: string) => { @@ -10,9 +10,11 @@ const getNewlyCreated = async (newLocation: string) => { const apiDataProvider = (apiUrl: string): DataProvider => { const config: Configuration = new Configuration({ basePath: apiUrl }) const apiResources: any = { - default: new DefaultApi(config), + info: new InfoApi(config), + fdo: new FDOsApi(config), profiles: new ProfilesApi(config), - repositories: new RepositoriesApi(config) + repositories: new RepositoriesApi(config), + logging: new LoggingApi(config) } const apiOperations: any = { @@ -25,11 +27,12 @@ const apiDataProvider = (apiUrl: string): DataProvider => { get: apiResources.repositories.getRepository }, info: { - get: apiResources.default.getInfo + get: apiResources.info.getInfo }, fdo: { - get: apiResources.default.resolvePID, - create: apiResources.default.createFDO + list: apiResources.logging.listLogEvents, + get: apiResources.fdo.resolvePID, + create: apiResources.fdo.createFDO } }