[ARVADOS-WORKBENCH2] updated: 1.1.4-174-g73699c7
Git user
git at public.curoverse.com
Mon Jul 2 06:12:26 EDT 2018
Summary of changes:
src/services/groups-service/groups-service.ts | 49 +++++++++++++++++++++++++++
src/services/services.ts | 3 ++
2 files changed, 52 insertions(+)
create mode 100644 src/services/groups-service/groups-service.ts
via 73699c70c40d2e82f1871ba042ea5d8a79cd5fd1 (commit)
from d3f17ba544b22ae76f47401041362bbcefe95aaa (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 73699c70c40d2e82f1871ba042ea5d8a79cd5fd1
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Mon Jul 2 12:12:08 2018 +0200
Create GroupsService and implement contents method
Feature #13702
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/services/groups-service/groups-service.ts b/src/services/groups-service/groups-service.ts
new file mode 100644
index 0000000..9016714
--- /dev/null
+++ b/src/services/groups-service/groups-service.ts
@@ -0,0 +1,49 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as _ from "lodash";
+import CommonResourceService, { Resource, ListResults } from "../../common/api/common-resource-service";
+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;
+}
+
+interface ContensArguments {
+ limit?: number;
+ offset?: number;
+ order?: OrderBuilder;
+ filters?: FilterBuilder;
+ recursive?: boolean;
+}
+
+export default class GroupsService extends CommonResourceService<GroupResource> {
+
+ constructor(serverApi: AxiosInstance) {
+ super(serverApi, "groups");
+ }
+
+ contents (uuid: string, args: ContensArguments = {}): Promise<ListResults<Resource>> {
+ const { filters, order, ...other } = args;
+ const params = {
+ ...other,
+ filters: filters ? filters.get() : undefined,
+ order: order ? order.get() : undefined
+ };
+ return this.serverApi
+ .get(this.resourceType + `/${uuid}/contents`, {
+ params: CommonResourceService.mapKeys(_.snakeCase)(params)
+ })
+ .then(CommonResourceService.mapResponseKeys);
+ }
+}
\ No newline at end of file
diff --git a/src/services/services.ts b/src/services/services.ts
index 47a24b3..7ad2ff7 100644
--- a/src/services/services.ts
+++ b/src/services/services.ts
@@ -5,7 +5,10 @@
import AuthService from "./auth-service/auth-service";
import ProjectService from "./project-service/project-service";
import CollectionService from "./collection-service/collection-service";
+import GroupsService from "./groups-service/groups-service";
+import { serverApi } from "../common/api/server-api";
export const authService = new AuthService();
export const projectService = new ProjectService();
export const collectionService = new CollectionService();
+export const groupsService = new GroupsService(serverApi);
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list