refactor: Streamline RepresentationMetadata interface

This commit is contained in:
Joachim Van Herwegen
2020-09-08 09:43:30 +02:00
parent 76319ba360
commit 8d3979372b
36 changed files with 416 additions and 230 deletions

View File

@@ -10,7 +10,7 @@ import { RepresentationMetadata } from '../../ldp/representation/RepresentationM
import { ResourceIdentifier } from '../../ldp/representation/ResourceIdentifier';
import { INTERNAL_QUADS } from '../../util/ContentTypes';
import { UnsupportedHttpError } from '../../util/errors/UnsupportedHttpError';
import { CONTENT_TYPE } from '../../util/MetadataTypes';
import { MA_CONTENT_TYPE } from '../../util/MetadataTypes';
import { ResourceLocker } from '../ResourceLocker';
import { ResourceStore } from '../ResourceStore';
import { PatchHandler } from './PatchHandler';
@@ -67,8 +67,7 @@ export class SparqlUpdatePatchHandler extends PatchHandler {
});
store.removeQuads(deletes);
store.addQuads(inserts);
const metadata = new RepresentationMetadata(input.identifier.path);
metadata.set(CONTENT_TYPE, INTERNAL_QUADS);
const metadata = new RepresentationMetadata(input.identifier.path, { [MA_CONTENT_TYPE]: INTERNAL_QUADS });
const representation: Representation = {
binary: false,
data: store.match() as Readable,