From a6c22a5186bc27e1f2716bec41f897af0c4ccb83 Mon Sep 17 00:00:00 2001 From: NuttyShrimp Date: Fri, 6 Dec 2024 11:25:00 +0100 Subject: [PATCH] chore(types): add additional comments to interface functions --- controller/src/types/index.ts | 7 +++++++ controller/src/types/modules.ts | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/controller/src/types/index.ts b/controller/src/types/index.ts index ffab3da..1b71a18 100644 --- a/controller/src/types/index.ts +++ b/controller/src/types/index.ts @@ -1,5 +1,8 @@ import { url } from "loama-common"; +/** + * The json schema for the resources file which holds the shareable resources inside a Solid data pod. + */ export interface Resources { id: url; items: string[] @@ -48,6 +51,9 @@ export interface ResourcePermissions> { permissionsPerSubject: SubjectPermissions[] } +/** + * The node structure used in the tree-structure for requestable resources + */ export interface ResourceAccessRequestNode { resourceUrl: url; canRequestAccess: boolean; @@ -56,6 +62,7 @@ export interface ResourceAccessRequestNode { export type AccessRequestMessage = { id: string; + // The webid of the person performing the request actor: string; requestedAt: Date; target: string; diff --git a/controller/src/types/modules.ts b/controller/src/types/modules.ts index cec8e4d..db9b0f9 100644 --- a/controller/src/types/modules.ts +++ b/controller/src/types/modules.ts @@ -41,8 +41,19 @@ export interface IAccessRequest { * Will return a tree structure starting from the containerUrl with the access requestable (container) resources */ getRequestableResources(containerUrl: string): Promise + + /** + * Checks if access to the resource is possible + * This should be based on the content of the resources.json file + */ canRequestAccessToResource(resourceUrl: string): Promise + /** + * Adds a resource to the shareable resource list (resources.json) + */ allowAccessRequest(resourceUrl: string): Promise + /** + * Removes a resource from the shareable resource list (resources.json) + */ disallowAccessRequest(resourceUrl: string): Promise // Notifications @@ -51,6 +62,9 @@ export interface IAccessRequest { loadAccessRequests(): Promise; loadRequestResponses(): Promise; + /** + * Remove the given message resource from the inbox + */ removeRequest(messageUrl: string): Promise; }