mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Enable jsdoc/tag-lines and jsdoc/sort-tags rules
This commit is contained in:
@@ -31,6 +31,7 @@ export interface AuxiliaryIdentifierStrategy {
|
||||
* Checks if the input identifier corresponds to an auxiliary resource.
|
||||
* This does not check if that auxiliary resource exists,
|
||||
* only if the identifier indicates that there could be an auxiliary resource there.
|
||||
*
|
||||
* @param identifier - Identifier to check.
|
||||
*
|
||||
* @returns true if the input identifier points to an auxiliary resource.
|
||||
@@ -40,6 +41,7 @@ export interface AuxiliaryIdentifierStrategy {
|
||||
/**
|
||||
* Returns the identifier of the resource which this auxiliary resource is referring to.
|
||||
* This does not guarantee that this resource exists.
|
||||
*
|
||||
* @param identifier - Identifier of the auxiliary resource.
|
||||
*
|
||||
* @returns The ResourceIdentifier of the subject resource.
|
||||
|
||||
@@ -11,6 +11,7 @@ import type { AuxiliaryIdentifierStrategy } from './AuxiliaryIdentifierStrategy'
|
||||
export interface AuxiliaryStrategy extends AuxiliaryIdentifierStrategy {
|
||||
/**
|
||||
* Whether this auxiliary resources uses its own authorization instead of the subject resource authorization.
|
||||
*
|
||||
* @param identifier - Identifier of the auxiliary resource.
|
||||
*/
|
||||
usesOwnAuthorization: (identifier: ResourceIdentifier) => boolean;
|
||||
@@ -18,6 +19,7 @@ export interface AuxiliaryStrategy extends AuxiliaryIdentifierStrategy {
|
||||
/**
|
||||
* Whether the root storage container requires this auxiliary resource to be present.
|
||||
* If yes, this means they can't be deleted individually from such a container.
|
||||
*
|
||||
* @param identifier - Identifier of the auxiliary resource.
|
||||
*/
|
||||
isRequiredInRoot: (identifier: ResourceIdentifier) => boolean;
|
||||
@@ -42,6 +44,7 @@ export interface AuxiliaryStrategy extends AuxiliaryIdentifierStrategy {
|
||||
/**
|
||||
* Validates if the representation contains valid data for an auxiliary resource.
|
||||
* Should throw an error in case the data is invalid.
|
||||
*
|
||||
* @param identifier - Identifier of the auxiliary resource.
|
||||
* @param representation - Representation of the auxiliary resource.
|
||||
*/
|
||||
|
||||
@@ -50,7 +50,9 @@ export class LinkRelObject {
|
||||
|
||||
/**
|
||||
* Checks whether the object can be added to the metadata
|
||||
*
|
||||
* @param object - The link target.
|
||||
*
|
||||
* @returns a boolean to indicate whether it can be added to the metadata or not
|
||||
*/
|
||||
private objectAllowed(object: string): boolean {
|
||||
@@ -59,6 +61,7 @@ export class LinkRelObject {
|
||||
|
||||
/**
|
||||
* Adds the object to the metadata when it is allowed
|
||||
*
|
||||
* @param object - The link target.
|
||||
* @param metadata - Metadata of the resource.
|
||||
* @param logger - Logger
|
||||
|
||||
@@ -26,6 +26,7 @@ const cachedNamedNodes: Record<string, NamedNode> = {};
|
||||
* Converts the incoming name (URI or shorthand) to a named node.
|
||||
* The generated terms get cached to reduce the number of created nodes,
|
||||
* so only use this for internal constants!
|
||||
*
|
||||
* @param name - Predicate to potentially transform.
|
||||
*/
|
||||
function toCachedNamedNode(name: string): NamedNode {
|
||||
@@ -167,6 +168,7 @@ export class RepresentationMetadata {
|
||||
/**
|
||||
* Helper function to import all entries from the given metadata.
|
||||
* If the new metadata has a different identifier the internal one will be updated.
|
||||
*
|
||||
* @param metadata - Metadata to import.
|
||||
*/
|
||||
public setMetadata(metadata: RepresentationMetadata): this {
|
||||
@@ -235,6 +237,7 @@ export class RepresentationMetadata {
|
||||
|
||||
/**
|
||||
* Adds a value linked to the identifier. Strings get converted to literals.
|
||||
*
|
||||
* @param predicate - Predicate linking identifier to value.
|
||||
* @param object - Value(s) to add.
|
||||
* @param graph - Optional graph of where to add the values to.
|
||||
@@ -245,6 +248,7 @@ export class RepresentationMetadata {
|
||||
|
||||
/**
|
||||
* Removes the given value from the metadata. Strings get converted to literals.
|
||||
*
|
||||
* @param predicate - Predicate linking identifier to value.
|
||||
* @param object - Value(s) to remove.
|
||||
* @param graph - Optional graph of where to remove the values from.
|
||||
@@ -271,6 +275,7 @@ export class RepresentationMetadata {
|
||||
|
||||
/**
|
||||
* Removes all values linked through the given predicate.
|
||||
*
|
||||
* @param predicate - Predicate to remove.
|
||||
* @param graph - Optional graph where to remove from.
|
||||
*/
|
||||
@@ -300,6 +305,7 @@ export class RepresentationMetadata {
|
||||
|
||||
/**
|
||||
* Finds all object values matching the given predicate and/or graph.
|
||||
*
|
||||
* @param predicate - Optional predicate to get the values for.
|
||||
* @param graph - Optional graph where to get from.
|
||||
*
|
||||
@@ -314,10 +320,10 @@ export class RepresentationMetadata {
|
||||
* @param predicate - Predicate to get the value for.
|
||||
* @param graph - Optional graph where the triple should be found.
|
||||
*
|
||||
* @returns The corresponding value. Undefined if there is no match
|
||||
*
|
||||
* @throws Error
|
||||
* If there are multiple matching values.
|
||||
*
|
||||
* @returns The corresponding value. Undefined if there is no match
|
||||
*/
|
||||
public get(predicate: NamedNode, graph?: MetadataGraph): Term | undefined {
|
||||
const terms = this.getAll(predicate, graph);
|
||||
@@ -337,6 +343,7 @@ export class RepresentationMetadata {
|
||||
/**
|
||||
* Sets the value for the given predicate, removing all other instances.
|
||||
* In case the object is undefined this is identical to `removeAll(predicate)`.
|
||||
*
|
||||
* @param predicate - Predicate linking to the value.
|
||||
* @param object - Value(s) to set.
|
||||
* @param graph - Optional graph where the triple should be stored.
|
||||
@@ -383,6 +390,7 @@ export class RepresentationMetadata {
|
||||
|
||||
/**
|
||||
* Parse the internal RDF structure to retrieve the Record with ContentType Parameters.
|
||||
*
|
||||
* @returns A {@link ContentType} object containing the value and optional parameters if there is one.
|
||||
*/
|
||||
private getContentType(): ContentType | undefined {
|
||||
|
||||
Reference in New Issue
Block a user