@tsed/platform-response-filter 6.95.7 → 6.96.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/platform-response-filter",
3
- "version": "6.95.7",
3
+ "version": "6.96.0",
4
4
  "description": "Platform response filter module for Ts.ED Framework",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
@@ -21,20 +21,20 @@
21
21
  "tslib": "2.2.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@tsed/core": "6.95.7",
25
- "@tsed/di": "6.95.7",
26
- "@tsed/exceptions": "6.95.7",
27
- "@tsed/json-mapper": "6.95.7",
28
- "@tsed/platform-views": "6.95.7",
29
- "@tsed/schema": "6.95.7"
24
+ "@tsed/core": "6.96.0",
25
+ "@tsed/di": "6.96.0",
26
+ "@tsed/exceptions": "6.96.0",
27
+ "@tsed/json-mapper": "6.96.0",
28
+ "@tsed/platform-views": "6.96.0",
29
+ "@tsed/schema": "6.96.0"
30
30
  },
31
31
  "peerDependencies": {
32
- "@tsed/core": "^6.95.7",
33
- "@tsed/di": "^6.95.7",
34
- "@tsed/exceptions": "^6.95.7",
35
- "@tsed/json-mapper": "^6.95.7",
36
- "@tsed/platform-views": "^6.95.7",
37
- "@tsed/schema": "^6.95.7"
32
+ "@tsed/core": "^6.96.0",
33
+ "@tsed/di": "^6.96.0",
34
+ "@tsed/exceptions": "^6.96.0",
35
+ "@tsed/json-mapper": "^6.96.0",
36
+ "@tsed/platform-views": "^6.96.0",
37
+ "@tsed/schema": "^6.96.0"
38
38
  },
39
39
  "repository": "https://github.com/tsedio/tsed",
40
40
  "bugs": {
@@ -1,7 +0,0 @@
1
- import { ResponseFilterKey } from "../domain/ResponseFiltersContainer";
2
- /**
3
- * Register a response filter service.
4
- * @param contentTypes
5
- * @decorator
6
- */
7
- export declare function ResponseFilter(...contentTypes: ResponseFilterKey[]): ClassDecorator;
@@ -1,14 +0,0 @@
1
- import { Type } from "@tsed/core";
2
- import { ResponseFilterMethods } from "../interfaces/ResponseFilterMethods";
3
- /**
4
- * @ignore
5
- */
6
- export declare type ResponseFilterKey = "*/*" | "application/json" | "text/html" | "plain/text" | string;
7
- /**
8
- * @ignore
9
- */
10
- export declare const ResponseFiltersContainer: Map<string, Type<ResponseFilterMethods<unknown>>>;
11
- /**
12
- * @ignore
13
- */
14
- export declare function registerResponseFilter(type: ResponseFilterKey, token: Type<ResponseFilterMethods>): void;
@@ -1,14 +0,0 @@
1
- import { Type } from "@tsed/core";
2
- import { InternalServerError } from "@tsed/exceptions";
3
- /**
4
- * @private
5
- */
6
- export declare class TemplateRenderError extends InternalServerError {
7
- name: string;
8
- constructor(target: Type<any> | string, method: string | symbol, err: Error);
9
- /**
10
- *
11
- * @returns {string}
12
- */
13
- static buildMessage(target: Type<any> | string, method: string | symbol, err: Error): string;
14
- }
@@ -1,8 +0,0 @@
1
- export * from "./decorators/responseFilter";
2
- export * from "./domain/ResponseFiltersContainer";
3
- export * from "./errors/TemplateRenderError";
4
- export * from "./interfaces/ResponseFilterMethods";
5
- export * from "./services/PlatformResponseFilter";
6
- export * from "./services/ConverterService";
7
- export * from "./utils/getContentType";
8
- export * from "./utils/renderView";
@@ -1,15 +0,0 @@
1
- import { Type } from "@tsed/core";
2
- import type { BaseContext } from "@tsed/di";
3
- declare global {
4
- namespace TsED {
5
- interface Configuration {
6
- /**
7
- * A list of response filters must be called before returning a response to the consumer. See more on [Response filters](/docs/response-filter.md).
8
- */
9
- responseFilters: Type<ResponseFilterMethods>[];
10
- }
11
- }
12
- }
13
- export interface ResponseFilterMethods<T = unknown> {
14
- transform(data: T, ctx: BaseContext): any;
15
- }
@@ -1,30 +0,0 @@
1
- import { Configuration, InjectorService } from "@tsed/di";
2
- import { JsonDeserializerOptions, JsonSerializerOptions } from "@tsed/json-mapper";
3
- /**
4
- * @deprecated Since 2021-10-03. Use serialize/deserialize functions from @tsed/json-mapper instead
5
- */
6
- export declare class ConverterService {
7
- private injectorService;
8
- private readonly _additionalProperties;
9
- constructor(injectorService: InjectorService, configuration: Configuration);
10
- /**
11
- * Convert instance to plainObject.
12
- *
13
- * @param obj
14
- * @param options
15
- */
16
- serialize(obj: any, options?: JsonSerializerOptions): any;
17
- /**
18
- * Convert a plainObject to targetType.
19
- *
20
- * ### Options
21
- *
22
- * - `ignoreCallback`: callback called for each object which will be deserialized. The callback can return a boolean to avoid the default converter behavior.
23
- * - `checkRequiredValue`: Disable the required check condition.
24
- *
25
- * @param obj Object source that will be deserialized
26
- * @param options Mapping options
27
- * @returns {any}
28
- */
29
- deserialize(obj: any, options?: JsonDeserializerOptions): any;
30
- }
@@ -1,27 +0,0 @@
1
- import { Type } from "@tsed/core";
2
- import { BaseContext, InjectorService } from "@tsed/di";
3
- import { ResponseFilterKey } from "../domain/ResponseFiltersContainer";
4
- import { ResponseFilterMethods } from "../interfaces/ResponseFilterMethods";
5
- /**
6
- * @platform
7
- */
8
- export declare class PlatformResponseFilter {
9
- types: Map<ResponseFilterKey, ResponseFilterMethods>;
10
- injector: InjectorService;
11
- protected responseFilters: Type<ResponseFilterMethods>[];
12
- get contentTypes(): ResponseFilterKey[];
13
- $onInit(): void;
14
- getBestContentType(data: any, ctx: BaseContext): any;
15
- /**
16
- * Call filters to transform data
17
- * @param data
18
- * @param ctx
19
- */
20
- transform(data: unknown, ctx: BaseContext): Promise<any>;
21
- /**
22
- * Serialize data before calling filters
23
- * @param data
24
- * @param ctx
25
- */
26
- serialize(data: unknown, ctx: BaseContext): Promise<unknown>;
27
- }
@@ -1,6 +0,0 @@
1
- import type { BaseContext } from "@tsed/di";
2
- export declare const ANY_CONTENT_TYPE = "*/*";
3
- /**
4
- * @ignore
5
- */
6
- export declare function getContentType(data: any, ctx: BaseContext): any;
@@ -1,2 +0,0 @@
1
- import { BaseContext } from "@tsed/di";
2
- export declare function renderView(data: any, $ctx: BaseContext): Promise<any>;