1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { AuthService } from "./auth-service/auth-service";
6 import { GroupsService } from "./groups-service/groups-service";
7 import { ProjectService } from "./project-service/project-service";
8 import { LinkService } from "./link-service/link-service";
9 import { FavoriteService } from "./favorite-service/favorite-service";
10 import { AxiosInstance } from "axios";
11 import { CollectionService } from "./collection-service/collection-service";
12 import Axios from "axios";
13 import { CollectionFilesService } from "./collection-files-service/collection-files-service";
15 export interface ServiceRepository {
16 apiClient: AxiosInstance;
18 authService: AuthService;
19 groupsService: GroupsService;
20 projectService: ProjectService;
21 linkService: LinkService;
22 favoriteService: FavoriteService;
23 collectionService: CollectionService;
24 collectionFilesService: CollectionFilesService;
27 export const createServices = (baseUrl: string): ServiceRepository => {
28 const apiClient = Axios.create();
29 apiClient.defaults.baseURL = `${baseUrl}/arvados/v1`;
31 const authService = new AuthService(apiClient, baseUrl);
32 const groupsService = new GroupsService(apiClient);
33 const projectService = new ProjectService(apiClient);
34 const linkService = new LinkService(apiClient);
35 const favoriteService = new FavoriteService(linkService, groupsService);
36 const collectionService = new CollectionService(apiClient);
37 const collectionFilesService = new CollectionFilesService(collectionService);
47 collectionFilesService