JsonMethodStore
@tsed/schema
Usage
typescript
import { JsonMethodStore } from "@tsed/schema";
Overview
ts
class JsonMethodStore extends JsonEntityStore {
readonly parent: JsonClassStore;
middlewares: any[];
beforeMiddlewares: any[];
afterMiddlewares: any[];
readonly operation: JsonOperation;
readonly children: Map<string | number, JsonParameterStore>;
constructor(options: JsonEntityStoreOptions);
get params(): JsonParameterStore[];
get view(): JsonViewOptions;
set view(view: JsonViewOptions);
get acceptMimes(): string[];
set acceptMimes(mimes: string[]);
get parameters(): JsonParameterStore[];
get operationPaths(): Map<string, import("./JsonOperation.js").JsonMethodPath>;
get collectionType(): Type<any>;
set collectionType(type: Type<any>);
get isCollection(): boolean;
get schema(): JsonSchema;
static get(target: Type<any>, propertyKey: string | symbol, descriptor?: PropertyDescriptor): JsonMethodStore;
getResponseOptions(status: number, { contentType, includes }?: {
contentType?: string;
includes?: string[];
}): undefined | any;
before(args: Function[]): this;
after(args: Function[]): this;
use(args: Function[]): this;
get<T = any>(key: any): T;
getParamTypes(): Record<string, boolean>;
protected build(): void;
}
readonly parent
ts
readonly parent: JsonClassStore;
middlewares
ts
middlewares: any[];
beforeMiddlewares
ts
beforeMiddlewares: any[];
afterMiddlewares
ts
afterMiddlewares: any[];
readonly operation
ts
readonly operation: JsonOperation;
Ref to JsonOperation when the decorated object is a method.
readonly children
ts
readonly children: Map<string | number, JsonParameterStore>;
List of children JsonEntityStore (properties or methods or params)
get params
ts
get params(): JsonParameterStore[];
get view
ts
get view(): JsonViewOptions;
set view
ts
set view(view: JsonViewOptions);
get acceptMimes
ts
get acceptMimes(): string[];
set acceptMimes
ts
set acceptMimes(mimes: string[]);
get parameters
ts
get parameters(): JsonParameterStore[];
get operationPaths
ts
get operationPaths(): Map<string, import("./JsonOperation.js").JsonMethodPath>;
get collectionType
ts
get collectionType(): Type<any>;
set collectionType
ts
set collectionType(type: Type<any>);
get isCollection
ts
get isCollection(): boolean;
get schema
ts
get schema(): JsonSchema;
static get
ts
static get(target: Type<any>, propertyKey: string | symbol, descriptor?: PropertyDescriptor): JsonMethodStore;
Get an endpoint.
getResponseOptions
ts
getResponseOptions(status: number, { contentType, includes }?: {
contentType?: string;
includes?: string[];
}): undefined | any;
TODO must be located on JsonOperation level directly
before
ts
before(args: Function[]): this;
Append middlewares to the beforeMiddlewares list.
after
ts
after(args: Function[]): this;
Append middlewares to the afterMiddlewares list.
use
ts
use(args: Function[]): this;
Store all arguments collected via Annotation.
get
ts
get<T = any>(key: any): T;
Find the value at the controller level. Let this value be extended or overridden by the endpoint itself.
getParamTypes
ts
getParamTypes(): Record<string, boolean>;
protected build
ts
protected build(): void;