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 { TagService } from "./tag-service/tag-service";
13 import Axios from "axios";
14 import { CollectionFilesService } from "./collection-files-service/collection-files-service";
15 import { KeepService } from "./keep-service/keep-service";
17 export interface ServiceRepository {
18 apiClient: AxiosInstance;
20 authService: AuthService;
21 keepService: KeepService;
22 groupsService: GroupsService;
23 projectService: ProjectService;
24 linkService: LinkService;
25 favoriteService: FavoriteService;
26 tagService: TagService;
27 collectionService: CollectionService;
28 collectionFilesService: CollectionFilesService;
31 export const createServices = (baseUrl: string): ServiceRepository => {
32 const apiClient = Axios.create();
33 apiClient.defaults.baseURL = `${baseUrl}/arvados/v1`;
35 const authService = new AuthService(apiClient, baseUrl);
36 const keepService = new KeepService(apiClient);
37 const groupsService = new GroupsService(apiClient);
38 const projectService = new ProjectService(apiClient);
39 const linkService = new LinkService(apiClient);
40 const favoriteService = new FavoriteService(linkService, groupsService);
41 const collectionService = new CollectionService(apiClient, keepService);
42 const tagService = new TagService(linkService);
43 const collectionFilesService = new CollectionFilesService(collectionService);
55 collectionFilesService