Joachim Van Herwegen 5613ff9e71 fix: Let Representations always have a body
This is relevant when the request has a content-type
but no data.
2021-10-12 13:30:06 +02:00

36 lines
1.0 KiB
TypeScript

import type { PermissionSet } from '../authorization/permissions/Permissions';
import type { Conditions } from '../storage/Conditions';
import type { Representation } from './representation/Representation';
import type { RepresentationPreferences } from './representation/RepresentationPreferences';
import type { ResourceIdentifier } from './representation/ResourceIdentifier';
/**
* A single REST operation.
*/
export interface Operation {
/**
* The HTTP method (GET/POST/PUT/PATCH/DELETE/etc.).
*/
method: string;
/**
* Identifier of the target.
*/
target: ResourceIdentifier;
/**
* Representation preferences of the response. Will be empty if there are none.
*/
preferences: RepresentationPreferences;
/**
* Conditions the resource must fulfill for a valid operation.
*/
conditions?: Conditions;
/**
* The permissions available for the current operation.
*/
permissionSet?: PermissionSet;
/**
* Representation of the body and metadata headers.
*/
body: Representation;
}