+export const mockConfig = (config: Partial<Config>): Config => ({
+ auth: {},
+ basePath: '',
+ baseUrl: '',
+ batchPath: '',
+ blobSignatureTtl: 0,
+ crunchLimitLogBytesPerJob: 0,
+ crunchLogBytesPerEvent: 0,
+ crunchLogPartialLineThrottlePeriod: 0,
+ crunchLogSecondsBetweenEvents: 0,
+ crunchLogThrottleBytes: 0,
+ crunchLogThrottleLines: 0,
+ crunchLogThrottlePeriod: 0,
+ defaultCollectionReplication: 0,
+ defaultTrashLifetime: 0,
+ description: '',
+ discoveryVersion: '',
+ dockerImageFormats: [],
+ documentationLink: '',
+ generatedAt: '',
+ gitUrl: '',
+ id: '',
+ keepWebServiceUrl: '',
+ kind: '',
+ maxRequestSize: 0,
+ name: '',
+ packageVersion: '',
+ parameters: {},
+ protocol: '',
+ remoteHosts: {},
+ remoteHostsViaDNS: false,
+ resources: {},
+ revision: '',
+ rootUrl: '',
+ schemas: {},
+ servicePath: '',
+ sourceVersion: '',
+ source_version: '',
+ title: '',
+ uuidPrefix: '',
+ version: '',
+ websocketUrl: '',
+ workbenchUrl: '',
+ vocabularyUrl: '',
+ fileViewersConfigUrl: '',
+ ...config
+});
+
+interface ConfigJSON {
+ API_HOST: string;
+ VOCABULARY_URL: string;
+ FILE_VIEWERS_CONFIG_URL: string;
+}
+
+const getDefaultConfig = (): ConfigJSON => ({
+ API_HOST: process.env.REACT_APP_ARVADOS_API_HOST || "",
+ VOCABULARY_URL: "",
+ FILE_VIEWERS_CONFIG_URL: "",
+});
+
+export const DISCOVERY_URL = 'discovery/v1/apis/arvados/v1/rest';
+const getDiscoveryURL = (apiHost: string) => `${window.location.protocol}//${apiHost}/${DISCOVERY_URL}`;