@solid/community-server
Version:
Community Solid Server: an open and modular implementation of the Solid specifications
18 lines (17 loc) • 1.08 kB
TypeScript
import type { Readable } from 'node:stream';
import type { Validator } from '../../http/auxiliary/Validator';
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
import type { ResourceIdentifier } from '../../http/representation/ResourceIdentifier';
import type { Guarded } from '../../util/GuardedStream';
import type { DataAccessor } from './DataAccessor';
import { PassthroughDataAccessor } from './PassthroughDataAccessor';
/**
* A ValidatingDataAccessor wraps a DataAccessor such that the data stream is validated while being written.
* An AtomicDataAccessor can be used to prevent data being written in case validation fails.
*/
export declare class ValidatingDataAccessor extends PassthroughDataAccessor {
private readonly validator;
constructor(accessor: DataAccessor, validator: Validator);
writeDocument(identifier: ResourceIdentifier, data: Guarded<Readable>, metadata: RepresentationMetadata): Promise<void>;
writeContainer(identifier: ResourceIdentifier, metadata: RepresentationMetadata): Promise<void>;
}