@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 +13 -13
- package/lib/cjs/decorators/responseFilter.d.ts +0 -7
- package/lib/cjs/domain/ResponseFiltersContainer.d.ts +0 -14
- package/lib/cjs/errors/TemplateRenderError.d.ts +0 -14
- package/lib/cjs/index.d.ts +0 -8
- package/lib/cjs/interfaces/ResponseFilterMethods.d.ts +0 -15
- package/lib/cjs/services/ConverterService.d.ts +0 -30
- package/lib/cjs/services/PlatformResponseFilter.d.ts +0 -27
- package/lib/cjs/utils/getContentType.d.ts +0 -6
- package/lib/cjs/utils/renderView.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/platform-response-filter",
|
|
3
|
-
"version": "6.
|
|
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.
|
|
25
|
-
"@tsed/di": "6.
|
|
26
|
-
"@tsed/exceptions": "6.
|
|
27
|
-
"@tsed/json-mapper": "6.
|
|
28
|
-
"@tsed/platform-views": "6.
|
|
29
|
-
"@tsed/schema": "6.
|
|
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.
|
|
33
|
-
"@tsed/di": "^6.
|
|
34
|
-
"@tsed/exceptions": "^6.
|
|
35
|
-
"@tsed/json-mapper": "^6.
|
|
36
|
-
"@tsed/platform-views": "^6.
|
|
37
|
-
"@tsed/schema": "^6.
|
|
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,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
|
-
}
|
package/lib/cjs/index.d.ts
DELETED
|
@@ -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
|
-
}
|