Create Link model and service
authorMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Wed, 18 Jul 2018 08:21:09 +0000 (10:21 +0200)
committerMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Wed, 18 Jul 2018 08:21:09 +0000 (10:21 +0200)
Feature #13840

Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski@contractors.roche.com>

src/models/link.ts [new file with mode: 0644]
src/services/link-service/link-service.ts [new file with mode: 0644]
src/services/services.ts

diff --git a/src/models/link.ts b/src/models/link.ts
new file mode 100644 (file)
index 0000000..26cce6e
--- /dev/null
@@ -0,0 +1,13 @@
+import { Resource } from "./resource";
+
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+export interface Link extends Resource {
+    headUuid: string;
+    tailUuid: string;
+    linkClass: string;
+    name: string;
+    properties: {};
+}
diff --git a/src/services/link-service/link-service.ts b/src/services/link-service/link-service.ts
new file mode 100644 (file)
index 0000000..49e6d1f
--- /dev/null
@@ -0,0 +1,13 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import CommonResourceService from "../../common/api/common-resource-service";
+import { Link } from "../../models/link";
+import { AxiosInstance } from "../../../node_modules/axios";
+
+export default class LinkService<T extends Link = Link> extends CommonResourceService<T> {
+    constructor(serverApi: AxiosInstance) {
+        super(serverApi, "links");
+    }
+}
\ No newline at end of file
index 88f6ffaefd46527571d4a0181364a6d0663c03fa..fbd2f6eb11db75d447438a42ec46934a379c09d9 100644 (file)
@@ -6,7 +6,9 @@ import AuthService from "./auth-service/auth-service";
 import GroupsService from "./groups-service/groups-service";
 import { serverApi } from "../common/api/server-api";
 import ProjectService from "./project-service/project-service";
+import LinkService from "./link-service/link-service";
 
 export const authService = new AuthService(serverApi);
 export const groupsService = new GroupsService(serverApi);
 export const projectService = new ProjectService(serverApi);
+export const linkService = new LinkService(serverApi);