Skip to content

Commit

Permalink
chore(types): add additional comments to interface functions
Browse files Browse the repository at this point in the history
  • Loading branch information
NuttyShrimp committed Dec 6, 2024
1 parent 760af37 commit a6c22a5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions controller/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -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[]
Expand Down Expand Up @@ -48,6 +51,9 @@ export interface ResourcePermissions<T = BaseSubject<string>> {
permissionsPerSubject: SubjectPermissions<T>[]
}

/**
* The node structure used in the tree-structure for requestable resources
*/
export interface ResourceAccessRequestNode {
resourceUrl: url;
canRequestAccess: boolean;
Expand All @@ -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;
Expand Down
14 changes: 14 additions & 0 deletions controller/src/types/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ResourceAccessRequestNode>

/**
* Checks if access to the resource is possible
* This should be based on the content of the resources.json file
*/
canRequestAccessToResource(resourceUrl: string): Promise<boolean>
/**
* Adds a resource to the shareable resource list (resources.json)
*/
allowAccessRequest(resourceUrl: string): Promise<void>
/**
* Removes a resource from the shareable resource list (resources.json)
*/
disallowAccessRequest(resourceUrl: string): Promise<void>

// Notifications
Expand All @@ -51,6 +62,9 @@ export interface IAccessRequest {

loadAccessRequests(): Promise<AccessRequestMessage[]>;
loadRequestResponses(): Promise<RequestResponseMessage[]>;
/**
* Remove the given message resource from the inbox
*/
removeRequest(messageUrl: string): Promise<void>;
}

Expand Down

0 comments on commit a6c22a5

Please sign in to comment.