mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: support inrupt coding standards
This commit is contained in:
8
src/ldp/http/BinaryRepresentation.ts
Normal file
8
src/ldp/http/BinaryRepresentation.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { Representation } from './Representation';
|
||||
|
||||
/**
|
||||
* A representation containing binary data.
|
||||
*/
|
||||
export interface BinaryRepresentation extends Representation {
|
||||
dataType: 'binary';
|
||||
}
|
||||
9
src/ldp/http/NamedRepresentation.ts
Normal file
9
src/ldp/http/NamedRepresentation.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Representation } from './Representation';
|
||||
import { ResourceIdentifier } from './ResourceIdentifier';
|
||||
|
||||
export interface NamedRepresentation extends Representation {
|
||||
/**
|
||||
* The identifier of this representation.
|
||||
*/
|
||||
identifier?: ResourceIdentifier;
|
||||
}
|
||||
4
src/ldp/http/Patch.ts
Normal file
4
src/ldp/http/Patch.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Represents the changes needed for a PATCH request.
|
||||
*/
|
||||
export interface Patch {}
|
||||
8
src/ldp/http/QuadRepresentation.ts
Normal file
8
src/ldp/http/QuadRepresentation.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { Representation } from './Representation';
|
||||
|
||||
/**
|
||||
* A representation containing quads as data.
|
||||
*/
|
||||
export interface QuadRepresentation extends Representation {
|
||||
dataType: 'quad';
|
||||
}
|
||||
20
src/ldp/http/Representation.ts
Normal file
20
src/ldp/http/Representation.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Readable } from 'stream';
|
||||
import { RepresentationMetadata } from './RepresentationMetadata';
|
||||
|
||||
/**
|
||||
* A representation of a resource.
|
||||
*/
|
||||
export interface Representation {
|
||||
/**
|
||||
* The corresponding metadata.
|
||||
*/
|
||||
metadata: RepresentationMetadata;
|
||||
/**
|
||||
* The raw data stream for this representation.
|
||||
*/
|
||||
data: Readable;
|
||||
/**
|
||||
* The data type of the contents in the data stream.
|
||||
*/
|
||||
dataType: string;
|
||||
}
|
||||
35
src/ldp/http/RepresentationMetadata.ts
Normal file
35
src/ldp/http/RepresentationMetadata.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Contains metadata relevant to a representation.
|
||||
*/
|
||||
import { Quad } from 'rdf-js';
|
||||
|
||||
export interface RepresentationMetadata {
|
||||
/**
|
||||
* All metadata triples of the resource.
|
||||
*/
|
||||
raw: Quad[];
|
||||
/**
|
||||
* The metadata profiles.
|
||||
*/
|
||||
profiles: string[];
|
||||
/**
|
||||
* Optional size of the representation.
|
||||
*/
|
||||
byteSize?: number;
|
||||
/**
|
||||
* Optional content type of the representation.
|
||||
*/
|
||||
contentType?: string;
|
||||
/**
|
||||
* Optional encoding of the representation.
|
||||
*/
|
||||
encoding?: string;
|
||||
/**
|
||||
* Optional language of the representation.
|
||||
*/
|
||||
language?: string;
|
||||
/**
|
||||
* Optional timestamp of the representation.
|
||||
*/
|
||||
dateTime?: Date;
|
||||
}
|
||||
4
src/ldp/http/RepresentationPreferences.ts
Normal file
4
src/ldp/http/RepresentationPreferences.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Contains the preferences of which kind of representation is requested.
|
||||
*/
|
||||
export interface RepresentationPreferences {}
|
||||
4
src/ldp/http/ResourceIdentifier.ts
Normal file
4
src/ldp/http/ResourceIdentifier.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* The unique identifier of a resource.
|
||||
*/
|
||||
export interface ResourceIdentifier {}
|
||||
Reference in New Issue
Block a user