Update models with groups, colelctions, workflows and processes
[arvados-workbench2.git] / src / services / groups-service / groups-service.ts
index 1e5318530853fbbe4b947b45311261550a9f7235..aa39e64ed58ee8cccfebef071593cbebd39f4d78 100644 (file)
@@ -7,17 +7,11 @@ import CommonResourceService, { Resource, ListResults } from "../../common/api/c
 import FilterBuilder from "../../common/api/filter-builder";
 import OrderBuilder from "../../common/api/order-builder";
 import { AxiosInstance } from "axios";
-
-interface GroupResource extends Resource {
-    name: string;
-    groupClass: string;
-    description: string;
-    properties: string;
-    writeableBy: string[];
-    trashAt: string;
-    deleteAt: string;
-    isTrashed: boolean;
-}
+import { GroupResource } from "../../models/group";
+import { CollectionResource } from "../../models/collection";
+import { ProjectResource } from "../../models/project";
+import { WorkflowResource } from "../../models/workflow";
+import { ProcessResource } from "../../models/process";
 
 interface ContensArguments {
     limit?: number;
@@ -27,13 +21,19 @@ interface ContensArguments {
     recursive?: boolean;
 }
 
+export type GroupContentsResource =
+    CollectionResource |
+    ProjectResource |
+    WorkflowResource |
+    ProcessResource;
+
 export default class GroupsService extends CommonResourceService<GroupResource> {
 
     constructor(serverApi: AxiosInstance) {
         super(serverApi, "groups");
     }
 
-    contents (uuid: string, args: ContensArguments = {}): Promise<ListResults<Resource>> {
+    contents(uuid: string, args: ContensArguments = {}): Promise<ListResults<GroupContentsResource>> {
         const { filters, order, ...other } = args;
         const params = {
             ...other,