@tsed/platform-response-filter 7.70.1 → 7.71.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/lib/cjs/decorators/responseFilter.js +2 -2
- package/lib/cjs/decorators/responseFilter.js.map +1 -1
- package/lib/cjs/index.js +10 -10
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/services/PlatformResponseFilter.js +8 -8
- package/lib/cjs/services/PlatformResponseFilter.js.map +1 -1
- package/lib/cjs/utils/renderView.js +2 -2
- package/lib/cjs/utils/renderView.js.map +1 -1
- package/lib/esm/decorators/responseFilter.js.map +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/services/PlatformResponseFilter.js.map +1 -1
- package/lib/esm/utils/renderView.js.map +1 -1
- package/lib/types/decorators/responseFilter.d.ts +1 -1
- package/lib/types/domain/ResponseFiltersContainer.d.ts +1 -1
- package/lib/types/index.d.ts +8 -8
- package/lib/types/services/PlatformResponseFilter.d.ts +2 -2
- package/package.json +14 -14
- package/readme.md +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ResponseFilter = void 0;
|
|
4
4
|
const di_1 = require("@tsed/di");
|
|
5
|
-
const
|
|
5
|
+
const ResponseFiltersContainer_js_1 = require("../domain/ResponseFiltersContainer.js");
|
|
6
6
|
/**
|
|
7
7
|
* Register a response filter service.
|
|
8
8
|
* @param contentTypes
|
|
@@ -11,7 +11,7 @@ const ResponseFiltersContainer_1 = require("../domain/ResponseFiltersContainer")
|
|
|
11
11
|
function ResponseFilter(...contentTypes) {
|
|
12
12
|
return (target) => {
|
|
13
13
|
contentTypes.forEach((contentType) => {
|
|
14
|
-
(0,
|
|
14
|
+
(0, ResponseFiltersContainer_js_1.registerResponseFilter)(contentType, target);
|
|
15
15
|
});
|
|
16
16
|
(0, di_1.registerProvider)({
|
|
17
17
|
provide: target,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responseFilter.js","sourceRoot":"","sources":["../../../src/decorators/responseFilter.ts"],"names":[],"mappings":";;;AACA,iCAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"responseFilter.js","sourceRoot":"","sources":["../../../src/decorators/responseFilter.ts"],"names":[],"mappings":";;;AACA,iCAA0C;AAC1C,uFAAgG;AAEhG;;;;GAIG;AACH,SAAgB,cAAc,CAAC,GAAG,YAAiC;IACjE,OAAO,CAAU,MAAS,EAAY,EAAE;QACtC,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;YACnC,IAAA,oDAAsB,EAAC,WAAW,EAAE,MAAa,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QACH,IAAA,qBAAgB,EAAC;YACf,OAAO,EAAE,MAAM;YACf,QAAQ,EAAE,MAA8B;SACzC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAVD,wCAUC"}
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @file Automatically generated by barrelsby.
|
|
4
|
-
*/
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
const tslib_1 = require("tslib");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
tslib_1.__exportStar(require("./
|
|
11
|
-
tslib_1.__exportStar(require("./
|
|
12
|
-
tslib_1.__exportStar(require("./
|
|
13
|
-
tslib_1.__exportStar(require("./
|
|
4
|
+
/**
|
|
5
|
+
* @file Automatically generated by @tsed/barrels.
|
|
6
|
+
*/
|
|
7
|
+
tslib_1.__exportStar(require("./decorators/responseFilter.js"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./domain/ResponseFiltersContainer.js"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./errors/TemplateRenderError.js"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./interfaces/ResponseFilterMethods.js"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./services/PlatformResponseFilter.js"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./utils/getContentType.js"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./utils/renderView.js"), exports);
|
|
14
14
|
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,yEAA+C;AAC/C,+EAAqD;AACrD,0EAAgD;AAChD,gFAAsD;AACtD,+EAAqD;AACrD,oEAA0C;AAC1C,gEAAsC"}
|
|
@@ -5,9 +5,9 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const core_1 = require("@tsed/core");
|
|
6
6
|
const di_1 = require("@tsed/di");
|
|
7
7
|
const json_mapper_1 = require("@tsed/json-mapper");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
8
|
+
const ResponseFiltersContainer_js_1 = require("../domain/ResponseFiltersContainer.js");
|
|
9
|
+
const getContentType_js_1 = require("../utils/getContentType.js");
|
|
10
|
+
const renderView_js_1 = require("../utils/renderView.js");
|
|
11
11
|
/**
|
|
12
12
|
* @platform
|
|
13
13
|
*/
|
|
@@ -20,14 +20,14 @@ let PlatformResponseFilter = class PlatformResponseFilter {
|
|
|
20
20
|
return [...this.types.keys()];
|
|
21
21
|
}
|
|
22
22
|
$onInit() {
|
|
23
|
-
|
|
23
|
+
ResponseFiltersContainer_js_1.ResponseFiltersContainer.forEach((token, type) => {
|
|
24
24
|
if (this.responseFilters.includes(token)) {
|
|
25
25
|
this.types.set(type, this.injector.get(token));
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
getBestContentType(data, ctx) {
|
|
30
|
-
const contentType = (0,
|
|
30
|
+
const contentType = (0, getContentType_js_1.getContentType)(data, ctx);
|
|
31
31
|
if (ctx.request.get("Accept")) {
|
|
32
32
|
const bestContentType = ctx.request.accepts([contentType].concat(this.contentTypes).filter(Boolean));
|
|
33
33
|
if (bestContentType) {
|
|
@@ -49,8 +49,8 @@ let PlatformResponseFilter = class PlatformResponseFilter {
|
|
|
49
49
|
if (this.types.has(bestContentType)) {
|
|
50
50
|
return this.types.get(bestContentType).transform(data, ctx);
|
|
51
51
|
}
|
|
52
|
-
if (this.types.has(
|
|
53
|
-
return this.types.get(
|
|
52
|
+
if (this.types.has(getContentType_js_1.ANY_CONTENT_TYPE)) {
|
|
53
|
+
return this.types.get(getContentType_js_1.ANY_CONTENT_TYPE).transform(data, ctx);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
return data;
|
|
@@ -64,7 +64,7 @@ let PlatformResponseFilter = class PlatformResponseFilter {
|
|
|
64
64
|
const { response, endpoint } = ctx;
|
|
65
65
|
if (endpoint) {
|
|
66
66
|
if (endpoint.view) {
|
|
67
|
-
data = await (0,
|
|
67
|
+
data = await (0, renderView_js_1.renderView)(data, ctx);
|
|
68
68
|
}
|
|
69
69
|
else if ((0, core_1.isSerializable)(data)) {
|
|
70
70
|
const responseOpts = endpoint.getResponseOptions(response.statusCode, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformResponseFilter.js","sourceRoot":"","sources":["../../../src/services/PlatformResponseFilter.ts"],"names":[],"mappings":";;;;AAAA,qCAAgD;AAChD,iCAAoF;AACpF,mDAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"PlatformResponseFilter.js","sourceRoot":"","sources":["../../../src/services/PlatformResponseFilter.ts"],"names":[],"mappings":";;;;AAAA,qCAAgD;AAChD,iCAAoF;AACpF,mDAA4C;AAC5C,uFAAkG;AAElG,kEAA4E;AAC5E,0DAAkD;AAElD;;GAEG;AAEI,IAAM,sBAAsB,GAA5B,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ED,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,WAAW,CAAC,GAAgB;QAClC,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE;YAC9B,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;SAC/F;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF,CAAA;AA/FC;IAAC,IAAA,WAAM,GAAE;sCACW,oBAAe;wDAAC;AAEpC;IAAC,IAAA,aAAQ,EAAC,iBAAiB,EAAE,EAAE,CAAC;;+DACyB;AAEzD;IAAC,IAAA,aAAQ,EAAC,sBAAsB,CAAC;;oEACO;AAV7B,sBAAsB;IADlC,IAAA,eAAU,GAAE;GACA,sBAAsB,CAkGlC;AAlGY,wDAAsB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.renderView = void 0;
|
|
4
|
-
const
|
|
4
|
+
const TemplateRenderError_js_1 = require("../errors/TemplateRenderError.js");
|
|
5
5
|
async function renderView(data, $ctx) {
|
|
6
6
|
const { response, endpoint } = $ctx;
|
|
7
7
|
try {
|
|
@@ -10,7 +10,7 @@ async function renderView(data, $ctx) {
|
|
|
10
10
|
return await response.render(path, { ...options, ...data, $ctx });
|
|
11
11
|
}
|
|
12
12
|
catch (err) {
|
|
13
|
-
throw new
|
|
13
|
+
throw new TemplateRenderError_js_1.TemplateRenderError(endpoint.targetName, endpoint.propertyKey, err);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
exports.renderView = renderView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderView.js","sourceRoot":"","sources":["../../../src/utils/renderView.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"renderView.js","sourceRoot":"","sources":["../../../src/utils/renderView.ts"],"names":[],"mappings":";;;AACA,6EAAqE;AAE9D,KAAK,UAAU,UAAU,CAAC,IAAS,EAAE,IAAiB;IAC3D,MAAM,EAAC,QAAQ,EAAE,QAAQ,EAAC,GAAG,IAAI,CAAC;IAClC,IAAI;QACF,MAAM,EAAC,IAAI,EAAC,GAAG,IAAI,CAAC;QACpB,MAAM,EAAC,IAAI,EAAE,OAAO,EAAC,GAAG,QAAQ,CAAC,IAAI,CAAC;QAEtC,OAAO,MAAM,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,EAAC,GAAG,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;KACjE;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,IAAI,4CAAmB,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;KAC/E;AACH,CAAC;AAVD,gCAUC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responseFilter.js","sourceRoot":"","sources":["../../../src/decorators/responseFilter.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAC,sBAAsB,EAAoB,MAAM,
|
|
1
|
+
{"version":3,"file":"responseFilter.js","sourceRoot":"","sources":["../../../src/decorators/responseFilter.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAC,sBAAsB,EAAoB,MAAM,uCAAuC,CAAC;AAEhG;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,GAAG,YAAiC;IACjE,OAAO,CAAU,MAAS,EAAY,EAAE;QACtC,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;YACnC,sBAAsB,CAAC,WAAW,EAAE,MAAa,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QACH,gBAAgB,CAAC;YACf,OAAO,EAAE,MAAM;YACf,QAAQ,EAAE,MAA8B;SACzC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
package/lib/esm/index.js
CHANGED
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlatformResponseFilter.js","sourceRoot":"","sources":["../../../src/services/PlatformResponseFilter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,cAAc,EAAO,MAAM,YAAY,CAAC;AAChD,OAAO,EAAc,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAC,MAAM,UAAU,CAAC;AACpF,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAoB,wBAAwB,EAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"PlatformResponseFilter.js","sourceRoot":"","sources":["../../../src/services/PlatformResponseFilter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,cAAc,EAAO,MAAM,YAAY,CAAC;AAChD,OAAO,EAAc,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAC,MAAM,UAAU,CAAC;AACpF,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAoB,wBAAwB,EAAC,MAAM,uCAAuC,CAAC;AAEl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,IAAI;oBACd,oBAAoB,EAAE,IAAI,CAAC,oBAAoB;oBAC/C,GAAG,YAAY;oBACf,QAAQ,EAAE,IAAI;iBACf,CAAC,CAAC;aACJ;SACF;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,WAAW,CAAC,GAAgB;QAClC,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE;YAC9B,OAAO,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;SAC/F;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF,CAAA;AA/FC;IAAC,MAAM,EAAE;8BACW,eAAe;wDAAC;AAEpC;IAAC,QAAQ,CAAC,iBAAiB,EAAE,EAAE,CAAC;;+DACyB;AAEzD;IAAC,QAAQ,CAAC,sBAAsB,CAAC;;oEACO;AAV7B,sBAAsB;IADlC,UAAU,EAAE;GACA,sBAAsB,CAkGlC;SAlGY,sBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderView.js","sourceRoot":"","sources":["../../../src/utils/renderView.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,mBAAmB,EAAC,MAAM
|
|
1
|
+
{"version":3,"file":"renderView.js","sourceRoot":"","sources":["../../../src/utils/renderView.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AAErE,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAS,EAAE,IAAiB;IAC3D,MAAM,EAAC,QAAQ,EAAE,QAAQ,EAAC,GAAG,IAAI,CAAC;IAClC,IAAI;QACF,MAAM,EAAC,IAAI,EAAC,GAAG,IAAI,CAAC;QACpB,MAAM,EAAC,IAAI,EAAE,OAAO,EAAC,GAAG,QAAQ,CAAC,IAAI,CAAC;QAEtC,OAAO,MAAM,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,EAAC,GAAG,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;KACjE;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,IAAI,mBAAmB,CAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;KAC/E;AACH,CAAC"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file Automatically generated by
|
|
2
|
+
* @file Automatically generated by @tsed/barrels.
|
|
3
3
|
*/
|
|
4
|
-
export * from "./decorators/responseFilter";
|
|
5
|
-
export * from "./domain/ResponseFiltersContainer";
|
|
6
|
-
export * from "./errors/TemplateRenderError";
|
|
7
|
-
export * from "./interfaces/ResponseFilterMethods";
|
|
8
|
-
export * from "./services/PlatformResponseFilter";
|
|
9
|
-
export * from "./utils/getContentType";
|
|
10
|
-
export * from "./utils/renderView";
|
|
4
|
+
export * from "./decorators/responseFilter.js";
|
|
5
|
+
export * from "./domain/ResponseFiltersContainer.js";
|
|
6
|
+
export * from "./errors/TemplateRenderError.js";
|
|
7
|
+
export * from "./interfaces/ResponseFilterMethods.js";
|
|
8
|
+
export * from "./services/PlatformResponseFilter.js";
|
|
9
|
+
export * from "./utils/getContentType.js";
|
|
10
|
+
export * from "./utils/renderView.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type } from "@tsed/core";
|
|
2
2
|
import { BaseContext, InjectorService } from "@tsed/di";
|
|
3
|
-
import { ResponseFilterKey } from "../domain/ResponseFiltersContainer";
|
|
4
|
-
import { ResponseFilterMethods } from "../interfaces/ResponseFilterMethods";
|
|
3
|
+
import { ResponseFilterKey } from "../domain/ResponseFiltersContainer.js";
|
|
4
|
+
import { ResponseFilterMethods } from "../interfaces/ResponseFilterMethods.js";
|
|
5
5
|
/**
|
|
6
6
|
* @platform
|
|
7
7
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/platform-response-filter",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.71.0",
|
|
4
4
|
"description": "Platform response filter module for Ts.ED Framework",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/cjs/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build": "yarn barrels && yarn build:ts",
|
|
17
|
-
"barrels": "
|
|
17
|
+
"barrels": "barrels",
|
|
18
18
|
"test": "jest --max-workers=2 && jest-coverage-thresholds-bumper",
|
|
19
19
|
"build:ts": "tsc --build tsconfig.json && tsc --build tsconfig.esm.json"
|
|
20
20
|
},
|
|
@@ -22,22 +22,22 @@
|
|
|
22
22
|
"tslib": "2.6.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@tsed/
|
|
26
|
-
"@tsed/
|
|
27
|
-
"@tsed/
|
|
28
|
-
"@tsed/
|
|
29
|
-
"@tsed/
|
|
30
|
-
"@tsed/
|
|
31
|
-
"
|
|
25
|
+
"@tsed/barrels": "7.71.0",
|
|
26
|
+
"@tsed/core": "7.71.0",
|
|
27
|
+
"@tsed/di": "7.71.0",
|
|
28
|
+
"@tsed/exceptions": "7.71.0",
|
|
29
|
+
"@tsed/json-mapper": "7.71.0",
|
|
30
|
+
"@tsed/schema": "7.71.0",
|
|
31
|
+
"@tsed/typescript": "7.71.0",
|
|
32
32
|
"eslint": "^8.57.0",
|
|
33
33
|
"jest": "^29.7.0"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@tsed/core": "7.
|
|
37
|
-
"@tsed/di": "7.
|
|
38
|
-
"@tsed/exceptions": "7.
|
|
39
|
-
"@tsed/json-mapper": "7.
|
|
40
|
-
"@tsed/schema": "7.
|
|
36
|
+
"@tsed/core": "7.71.0",
|
|
37
|
+
"@tsed/di": "7.71.0",
|
|
38
|
+
"@tsed/exceptions": "7.71.0",
|
|
39
|
+
"@tsed/json-mapper": "7.71.0",
|
|
40
|
+
"@tsed/schema": "7.71.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependenciesMeta": {
|
|
43
43
|
"@tsed/core": {
|
package/readme.md
CHANGED
|
@@ -46,7 +46,7 @@ Define a class that return data:
|
|
|
46
46
|
```typescript
|
|
47
47
|
import {Injectable} from "@tsed/di";
|
|
48
48
|
import {Returns} from "@tsed/schema";
|
|
49
|
-
import {MyModel} from "../models/MyModel";
|
|
49
|
+
import {MyModel} from "../models/MyModel.js";
|
|
50
50
|
|
|
51
51
|
@Injectable()
|
|
52
52
|
class MyService {
|