@tsed/json-mapper 8.0.0-alpha.5 → 8.0.0-alpha.6
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/browser/json-mapper.umd.min.js.map +1 -1
- package/lib/esm/utils/deserialize.js.map +1 -1
- package/lib/esm/utils/serialize.js.map +1 -1
- package/lib/types/utils/deserialize.d.ts +3 -3
- package/lib/types/utils/serialize.d.ts +3 -3
- package/package.json +11 -11
- package/lib/cjs/components/DateMapper.js +0 -30
- package/lib/cjs/components/DateMapper.js.map +0 -1
- package/lib/cjs/components/PrimitiveMapper.js +0 -64
- package/lib/cjs/components/PrimitiveMapper.js.map +0 -1
- package/lib/cjs/components/SymbolMapper.js +0 -24
- package/lib/cjs/components/SymbolMapper.js.map +0 -1
- package/lib/cjs/decorators/afterDeserialize.js +0 -39
- package/lib/cjs/decorators/afterDeserialize.js.map +0 -1
- package/lib/cjs/decorators/beforeDeserialize.js +0 -39
- package/lib/cjs/decorators/beforeDeserialize.js.map +0 -1
- package/lib/cjs/decorators/jsonMapper.js +0 -18
- package/lib/cjs/decorators/jsonMapper.js.map +0 -1
- package/lib/cjs/decorators/onDeserialize.js +0 -29
- package/lib/cjs/decorators/onDeserialize.js.map +0 -1
- package/lib/cjs/decorators/onSerialize.js +0 -29
- package/lib/cjs/decorators/onSerialize.js.map +0 -1
- package/lib/cjs/domain/JsonDeserializer.js +0 -295
- package/lib/cjs/domain/JsonDeserializer.js.map +0 -1
- package/lib/cjs/domain/JsonDeserializerOptions.js +0 -3
- package/lib/cjs/domain/JsonDeserializerOptions.js.map +0 -1
- package/lib/cjs/domain/JsonMapperCompiler.js +0 -167
- package/lib/cjs/domain/JsonMapperCompiler.js.map +0 -1
- package/lib/cjs/domain/JsonMapperGlobalOptions.js +0 -3
- package/lib/cjs/domain/JsonMapperGlobalOptions.js.map +0 -1
- package/lib/cjs/domain/JsonMapperSettings.js +0 -9
- package/lib/cjs/domain/JsonMapperSettings.js.map +0 -1
- package/lib/cjs/domain/JsonMapperTypesContainer.js +0 -23
- package/lib/cjs/domain/JsonMapperTypesContainer.js.map +0 -1
- package/lib/cjs/domain/JsonSerializer.js +0 -273
- package/lib/cjs/domain/JsonSerializer.js.map +0 -1
- package/lib/cjs/domain/JsonSerializerOptions.js +0 -3
- package/lib/cjs/domain/JsonSerializerOptions.js.map +0 -1
- package/lib/cjs/domain/Writer.js +0 -137
- package/lib/cjs/domain/Writer.js.map +0 -1
- package/lib/cjs/hooks/alterAfterDeserialize.js +0 -8
- package/lib/cjs/hooks/alterAfterDeserialize.js.map +0 -1
- package/lib/cjs/hooks/alterBeforeDeserialize.js +0 -8
- package/lib/cjs/hooks/alterBeforeDeserialize.js.map +0 -1
- package/lib/cjs/hooks/alterOnDeserialize.js +0 -8
- package/lib/cjs/hooks/alterOnDeserialize.js.map +0 -1
- package/lib/cjs/hooks/alterOnSerialize.js +0 -8
- package/lib/cjs/hooks/alterOnSerialize.js.map +0 -1
- package/lib/cjs/index.js +0 -32
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/interfaces/JsonMapperMethods.js +0 -3
- package/lib/cjs/interfaces/JsonMapperMethods.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/utils/deserialize.js +0 -13
- package/lib/cjs/utils/deserialize.js.map +0 -1
- package/lib/cjs/utils/getObjectProperties.js +0 -9
- package/lib/cjs/utils/getObjectProperties.js.map +0 -1
- package/lib/cjs/utils/serialize.js +0 -13
- package/lib/cjs/utils/serialize.js.map +0 -1
- package/lib/esm/package.json +0 -3
- package/lib/types-esm/components/DateMapper.d.ts +0 -11
- package/lib/types-esm/components/PrimitiveMapper.d.ts +0 -18
- package/lib/types-esm/components/SymbolMapper.d.ts +0 -11
- package/lib/types-esm/decorators/afterDeserialize.d.ts +0 -33
- package/lib/types-esm/decorators/beforeDeserialize.d.ts +0 -33
- package/lib/types-esm/decorators/jsonMapper.d.ts +0 -7
- package/lib/types-esm/decorators/onDeserialize.d.ts +0 -23
- package/lib/types-esm/decorators/onSerialize.d.ts +0 -23
- package/lib/types-esm/domain/JsonDeserializer.d.ts +0 -33
- package/lib/types-esm/domain/JsonDeserializerOptions.d.ts +0 -28
- package/lib/types-esm/domain/JsonMapperCompiler.d.ts +0 -60
- package/lib/types-esm/domain/JsonMapperGlobalOptions.d.ts +0 -14
- package/lib/types-esm/domain/JsonMapperSettings.d.ts +0 -2
- package/lib/types-esm/domain/JsonMapperTypesContainer.d.ts +0 -10
- package/lib/types-esm/domain/JsonSerializer.d.ts +0 -22
- package/lib/types-esm/domain/JsonSerializerOptions.d.ts +0 -14
- package/lib/types-esm/domain/Writer.d.ts +0 -43
- package/lib/types-esm/hooks/alterAfterDeserialize.d.ts +0 -4
- package/lib/types-esm/hooks/alterBeforeDeserialize.d.ts +0 -4
- package/lib/types-esm/hooks/alterOnDeserialize.d.ts +0 -2
- package/lib/types-esm/hooks/alterOnSerialize.d.ts +0 -2
- package/lib/types-esm/index.d.ts +0 -28
- package/lib/types-esm/interfaces/JsonMapperMethods.d.ts +0 -28
- package/lib/types-esm/utils/deserialize.d.ts +0 -5
- package/lib/types-esm/utils/getObjectProperties.d.ts +0 -1
- package/lib/types-esm/utils/serialize.d.ts +0 -5
- /package/{webpack.config.js → webpack.config.cjs} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Writer.js","sourceRoot":"","sources":["../../../src/domain/Writer.ts"],"names":[],"mappings":";;;AAAA,MAAa,MAAM;aACV,WAAM,GAAG;QACd,MAAM,CAAC,GAAG,IAAc;YACtB,OAAO,KAAK,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;QAClD,CAAC;KACF,CAAC;IAMF,YAAY,IAAa;QAHf,SAAI,GAAwB,EAAE,CAAC;QAIvC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,KAAe;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,GAAG,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAC9G,CAAC,CAAC,CACH;YACD,GAAG;SACJ,CAAC,IAAI,EAAE,CAAC;IACX,CAAC;CACF"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.alterAfterDeserialize = void 0;
|
|
4
|
-
function alterAfterDeserialize(data, schema, options) {
|
|
5
|
-
return schema?.$hooks?.alter("afterDeserialize", data, [options]);
|
|
6
|
-
}
|
|
7
|
-
exports.alterAfterDeserialize = alterAfterDeserialize;
|
|
8
|
-
//# sourceMappingURL=alterAfterDeserialize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alterAfterDeserialize.js","sourceRoot":"","sources":["../../../src/hooks/alterAfterDeserialize.ts"],"names":[],"mappings":";;;AAEA,SAAgB,qBAAqB,CAAC,IAAS,EAAE,MAAuB,EAAE,OAAY;IACpF,OAAO,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,kBAAkB,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AACpE,CAAC;AAFD,sDAEC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.alterBeforeDeserialize = void 0;
|
|
4
|
-
function alterBeforeDeserialize(data, schema, options) {
|
|
5
|
-
return schema?.$hooks?.alter("beforeDeserialize", data, [options]);
|
|
6
|
-
}
|
|
7
|
-
exports.alterBeforeDeserialize = alterBeforeDeserialize;
|
|
8
|
-
//# sourceMappingURL=alterBeforeDeserialize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alterBeforeDeserialize.js","sourceRoot":"","sources":["../../../src/hooks/alterBeforeDeserialize.ts"],"names":[],"mappings":";;;AAEA,SAAgB,sBAAsB,CAAC,IAAS,EAAE,MAAuB,EAAE,OAAY;IACrF,OAAO,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,mBAAmB,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AACrE,CAAC;AAFD,wDAEC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.alterOnDeserialize = void 0;
|
|
4
|
-
function alterOnDeserialize(schema, value, options) {
|
|
5
|
-
return schema.$hooks.alter("onDeserialize", value, [options]);
|
|
6
|
-
}
|
|
7
|
-
exports.alterOnDeserialize = alterOnDeserialize;
|
|
8
|
-
//# sourceMappingURL=alterOnDeserialize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alterOnDeserialize.js","sourceRoot":"","sources":["../../../src/hooks/alterOnDeserialize.ts"],"names":[],"mappings":";;;AAEA,SAAgB,kBAAkB,CAAC,MAAkB,EAAE,KAAU,EAAE,OAAwB;IACzF,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAChE,CAAC;AAFD,gDAEC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.alterOnSerialize = void 0;
|
|
4
|
-
function alterOnSerialize(schema, value, options) {
|
|
5
|
-
return schema.$hooks.alter("onSerialize", value, [options]);
|
|
6
|
-
}
|
|
7
|
-
exports.alterOnSerialize = alterOnSerialize;
|
|
8
|
-
//# sourceMappingURL=alterOnSerialize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alterOnSerialize.js","sourceRoot":"","sources":["../../../src/hooks/alterOnSerialize.ts"],"names":[],"mappings":";;;AAEA,SAAgB,gBAAgB,CAAC,MAAkB,EAAE,KAAU,EAAE,OAAwB;IACvF,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9D,CAAC;AAFD,4CAEC"}
|
package/lib/cjs/index.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
/**
|
|
5
|
-
* @file Automatically generated by @tsed/barrels.
|
|
6
|
-
*/
|
|
7
|
-
tslib_1.__exportStar(require("./components/DateMapper.js"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./components/PrimitiveMapper.js"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./components/SymbolMapper.js"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./decorators/afterDeserialize.js"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./decorators/beforeDeserialize.js"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./decorators/jsonMapper.js"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./decorators/onDeserialize.js"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./decorators/onSerialize.js"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./domain/JsonDeserializer.js"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./domain/JsonDeserializerOptions.js"), exports);
|
|
17
|
-
tslib_1.__exportStar(require("./domain/JsonMapperCompiler.js"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./domain/JsonMapperGlobalOptions.js"), exports);
|
|
19
|
-
tslib_1.__exportStar(require("./domain/JsonMapperSettings.js"), exports);
|
|
20
|
-
tslib_1.__exportStar(require("./domain/JsonMapperTypesContainer.js"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("./domain/JsonSerializer.js"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("./domain/JsonSerializerOptions.js"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./domain/Writer.js"), exports);
|
|
24
|
-
tslib_1.__exportStar(require("./hooks/alterAfterDeserialize.js"), exports);
|
|
25
|
-
tslib_1.__exportStar(require("./hooks/alterBeforeDeserialize.js"), exports);
|
|
26
|
-
tslib_1.__exportStar(require("./hooks/alterOnDeserialize.js"), exports);
|
|
27
|
-
tslib_1.__exportStar(require("./hooks/alterOnSerialize.js"), exports);
|
|
28
|
-
tslib_1.__exportStar(require("./interfaces/JsonMapperMethods.js"), exports);
|
|
29
|
-
tslib_1.__exportStar(require("./utils/deserialize.js"), exports);
|
|
30
|
-
tslib_1.__exportStar(require("./utils/getObjectProperties.js"), exports);
|
|
31
|
-
tslib_1.__exportStar(require("./utils/serialize.js"), exports);
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
package/lib/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,qEAA2C;AAC3C,0EAAgD;AAChD,uEAA6C;AAC7C,2EAAiD;AACjD,4EAAkD;AAClD,qEAA2C;AAC3C,wEAA8C;AAC9C,sEAA4C;AAC5C,uEAA6C;AAC7C,8EAAoD;AACpD,yEAA+C;AAC/C,8EAAoD;AACpD,yEAA+C;AAC/C,+EAAqD;AACrD,qEAA2C;AAC3C,4EAAkD;AAClD,6DAAmC;AACnC,2EAAiD;AACjD,4EAAkD;AAClD,wEAA8C;AAC9C,sEAA4C;AAC5C,4EAAkD;AAClD,iEAAuC;AACvC,yEAA+C;AAC/C,+DAAqC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JsonMapperMethods.js","sourceRoot":"","sources":["../../../src/interfaces/JsonMapperMethods.ts"],"names":[],"mappings":""}
|
package/lib/cjs/package.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deserialize = void 0;
|
|
4
|
-
require("../components/DateMapper");
|
|
5
|
-
require("../components/PrimitiveMapper");
|
|
6
|
-
require("../components/SymbolMapper");
|
|
7
|
-
const JsonDeserializer_js_1 = require("../domain/JsonDeserializer.js");
|
|
8
|
-
const deserializer = new JsonDeserializer_js_1.JsonDeserializer();
|
|
9
|
-
function deserialize(input, options) {
|
|
10
|
-
return deserializer.map(input, options);
|
|
11
|
-
}
|
|
12
|
-
exports.deserialize = deserialize;
|
|
13
|
-
//# sourceMappingURL=deserialize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deserialize.js","sourceRoot":"","sources":["../../../src/utils/deserialize.ts"],"names":[],"mappings":";;;AAAA,oCAAkC;AAClC,yCAAuC;AACvC,sCAAoC;AAEpC,uEAA+D;AAG/D,MAAM,YAAY,GAAG,IAAI,sCAAgB,EAAE,CAAC;AAE5C,SAAgB,WAAW,CAAc,KAAU,EAAE,OAAiC;IACpF,OAAO,YAAY,CAAC,GAAG,CAAQ,KAAK,EAAE,OAAO,CAAC,CAAC;AACjD,CAAC;AAFD,kCAEC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getObjectProperties = void 0;
|
|
4
|
-
const core_1 = require("@tsed/core");
|
|
5
|
-
function getObjectProperties(obj) {
|
|
6
|
-
return Object.entries(obj).filter(([, value]) => !(0, core_1.isFunction)(value));
|
|
7
|
-
}
|
|
8
|
-
exports.getObjectProperties = getObjectProperties;
|
|
9
|
-
//# sourceMappingURL=getObjectProperties.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getObjectProperties.js","sourceRoot":"","sources":["../../../src/utils/getObjectProperties.ts"],"names":[],"mappings":";;;AAAA,qCAAsC;AAEtC,SAAgB,mBAAmB,CAAC,GAAQ;IAC1C,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,IAAA,iBAAU,EAAC,KAAK,CAAC,CAAC,CAAC;AACvE,CAAC;AAFD,kDAEC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serialize = void 0;
|
|
4
|
-
require("../components/DateMapper");
|
|
5
|
-
require("../components/PrimitiveMapper");
|
|
6
|
-
require("../components/SymbolMapper");
|
|
7
|
-
const JsonSerializer_js_1 = require("../domain/JsonSerializer.js");
|
|
8
|
-
const serializer = new JsonSerializer_js_1.JsonSerializer();
|
|
9
|
-
function serialize(input, options) {
|
|
10
|
-
return serializer.map(input, options);
|
|
11
|
-
}
|
|
12
|
-
exports.serialize = serialize;
|
|
13
|
-
//# sourceMappingURL=serialize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../../src/utils/serialize.ts"],"names":[],"mappings":";;;AAAA,oCAAkC;AAClC,yCAAuC;AACvC,sCAAoC;AAEpC,mEAA2D;AAG3D,MAAM,UAAU,GAAG,IAAI,kCAAc,EAAE,CAAC;AAExC,SAAgB,SAAS,CAAC,KAAU,EAAE,OAA+B;IACnE,OAAO,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC;AAFD,8BAEC"}
|
package/lib/esm/package.json
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { JsonMapperMethods } from "../interfaces/JsonMapperMethods.js";
|
|
2
|
-
/**
|
|
3
|
-
* Mapper for `Date` type.
|
|
4
|
-
* @jsonmapper
|
|
5
|
-
* @component
|
|
6
|
-
*/
|
|
7
|
-
export declare class DateMapper implements JsonMapperMethods {
|
|
8
|
-
deserialize(data: string | number): Date;
|
|
9
|
-
deserialize(data: boolean | null | undefined): boolean | null | undefined;
|
|
10
|
-
serialize(object: Date): any;
|
|
11
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { JsonMapperCtx, JsonMapperMethods } from "../interfaces/JsonMapperMethods.js";
|
|
2
|
-
export declare class CastError extends Error {
|
|
3
|
-
name: string;
|
|
4
|
-
constructor(message: string);
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Mapper for the `String`, `Number`, `BigInt` and `Boolean` types.
|
|
8
|
-
* @jsonmapper
|
|
9
|
-
* @component
|
|
10
|
-
*/
|
|
11
|
-
export declare class PrimitiveMapper implements JsonMapperMethods {
|
|
12
|
-
deserialize<T>(data: any, ctx: JsonMapperCtx): string | number | boolean | void | null | BigInt;
|
|
13
|
-
serialize(object: string | number | boolean | BigInt, ctx: JsonMapperCtx): string | number | boolean | BigInt;
|
|
14
|
-
protected String(data: any): string | null;
|
|
15
|
-
protected Boolean(data: any): boolean | null | undefined;
|
|
16
|
-
protected Number(data: any): any;
|
|
17
|
-
protected BigInt(data: any): bigint | null;
|
|
18
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { JsonMapperMethods } from "../interfaces/JsonMapperMethods.js";
|
|
2
|
-
/**
|
|
3
|
-
* Mapper for the `Symbol` type.
|
|
4
|
-
*
|
|
5
|
-
* @jsonmapper
|
|
6
|
-
* @component
|
|
7
|
-
*/
|
|
8
|
-
export declare class SymbolMapper implements JsonMapperMethods {
|
|
9
|
-
deserialize(data: string): symbol;
|
|
10
|
-
serialize(object: Symbol): any;
|
|
11
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { JsonHookContext } from "@tsed/schema";
|
|
2
|
-
export interface AfterDeserializeCallback {
|
|
3
|
-
(value: any, ctx: JsonHookContext): any;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Call the function after JsonMapper.
|
|
7
|
-
*
|
|
8
|
-
* ## Example
|
|
9
|
-
*
|
|
10
|
-
* ```typescript
|
|
11
|
-
* @AfterDeserialize((data: Model) => { // After deserialize get the instance class
|
|
12
|
-
* if (data.prop1 === 'VALUE' && data.prop2 !== 'VALUE2') {
|
|
13
|
-
* throw BadRequest('MyMessage'); // or throw a ValidationError
|
|
14
|
-
* } else {
|
|
15
|
-
* data.prop2 = 'VALUE2';
|
|
16
|
-
* return data;
|
|
17
|
-
* }
|
|
18
|
-
* })
|
|
19
|
-
* class Model {
|
|
20
|
-
* @Property()
|
|
21
|
-
* prop1: string;
|
|
22
|
-
* @Property()
|
|
23
|
-
* prop2: string;
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* @returns {Function}
|
|
28
|
-
* @decorator
|
|
29
|
-
* @schema
|
|
30
|
-
* @property
|
|
31
|
-
* @param cb
|
|
32
|
-
*/
|
|
33
|
-
export declare function AfterDeserialize(cb: AfterDeserializeCallback): ClassDecorator;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { JsonHookContext } from "@tsed/schema";
|
|
2
|
-
export interface BeforeDeserializeCallback {
|
|
3
|
-
(value: any, ctx: JsonHookContext): any;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Call the function before JsonMapper.
|
|
7
|
-
*
|
|
8
|
-
* ## Example
|
|
9
|
-
*
|
|
10
|
-
* ```typescript
|
|
11
|
-
* @BeforeDeserialize((data: Record<string, unknown>) => { // Before deserialize get the data
|
|
12
|
-
* if (data.prop1 === 'VALUE' && data.prop2 !== 'VALUE2') {
|
|
13
|
-
* throw BadRequest('MyMessage'); // or throw a ValidationError
|
|
14
|
-
* } else {
|
|
15
|
-
* data.prop2 = 'VALUE2';
|
|
16
|
-
* return data;
|
|
17
|
-
* }
|
|
18
|
-
* })
|
|
19
|
-
* class Model {
|
|
20
|
-
* @Property()
|
|
21
|
-
* prop1: string;
|
|
22
|
-
* @Property()
|
|
23
|
-
* prop2: string;
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* @returns {Function}
|
|
28
|
-
* @decorator
|
|
29
|
-
* @schema
|
|
30
|
-
* @property
|
|
31
|
-
* @param cb
|
|
32
|
-
*/
|
|
33
|
-
export declare function BeforeDeserialize(cb: BeforeDeserializeCallback): ClassDecorator;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { JsonHookContext } from "@tsed/schema";
|
|
2
|
-
export interface OnDeserializeCallback {
|
|
3
|
-
(value: any, ctx: JsonHookContext): any;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Call the function before property deserialization.
|
|
7
|
-
*
|
|
8
|
-
* ## Example
|
|
9
|
-
*
|
|
10
|
-
* ```typescript
|
|
11
|
-
* class Model {
|
|
12
|
-
* @OnDeserialize(v => v + 1)
|
|
13
|
-
* property: string;
|
|
14
|
-
* }
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @returns {Function}
|
|
18
|
-
* @decorator
|
|
19
|
-
* @schema
|
|
20
|
-
* @property
|
|
21
|
-
* @param cb
|
|
22
|
-
*/
|
|
23
|
-
export declare function OnDeserialize(cb: OnDeserializeCallback): PropertyDecorator;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { JsonHookContext } from "@tsed/schema";
|
|
2
|
-
export interface OnSerializeCallback {
|
|
3
|
-
(value: any, ctx: JsonHookContext): any;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Call the function before property serialization.
|
|
7
|
-
*
|
|
8
|
-
* ## Example
|
|
9
|
-
*
|
|
10
|
-
* ```typescript
|
|
11
|
-
* class Model {
|
|
12
|
-
* @OnSerialize(v => v + 1)
|
|
13
|
-
* property: string;
|
|
14
|
-
* }
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @returns {Function}
|
|
18
|
-
* @decorator
|
|
19
|
-
* @schema
|
|
20
|
-
* @property
|
|
21
|
-
* @param cb
|
|
22
|
-
*/
|
|
23
|
-
export declare function OnSerialize(cb: OnSerializeCallback): PropertyDecorator;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { JsonDeserializerOptions } from "./JsonDeserializerOptions.js";
|
|
3
|
-
import { CachedJsonMapper, JsonMapperCompiler } from "./JsonMapperCompiler.js";
|
|
4
|
-
export declare class JsonDeserializer extends JsonMapperCompiler<JsonDeserializerOptions> {
|
|
5
|
-
/**
|
|
6
|
-
* Cached classes by his id
|
|
7
|
-
* @protected
|
|
8
|
-
*/
|
|
9
|
-
protected constructors: Record<string, Type<any>>;
|
|
10
|
-
constructor();
|
|
11
|
-
map<Model = any>(input: any, options?: JsonDeserializerOptions): Model;
|
|
12
|
-
compile(model: Type<any>, groups: false | string[]): CachedJsonMapper<JsonDeserializerOptions>;
|
|
13
|
-
eval(mapper: string, { id, groupsId, model }: {
|
|
14
|
-
id: string;
|
|
15
|
-
model: Type<any>;
|
|
16
|
-
groupsId: string;
|
|
17
|
-
}): CachedJsonMapper<JsonDeserializerOptions>;
|
|
18
|
-
protected newInstanceOf(id: string, obj: any, options: any): any;
|
|
19
|
-
protected createMapper(model: Type<any>, id: string, groups: false | string[]): string;
|
|
20
|
-
protected alterValue(schemaId: string, value: any, options: JsonDeserializerOptions): any;
|
|
21
|
-
private mapDiscriminator;
|
|
22
|
-
private mapProperty;
|
|
23
|
-
private getPropertyFiller;
|
|
24
|
-
private mapOptions;
|
|
25
|
-
private mapAdditionalProperties;
|
|
26
|
-
private mapObject;
|
|
27
|
-
private mapSet;
|
|
28
|
-
private mapArray;
|
|
29
|
-
private mapMap;
|
|
30
|
-
private mapItem;
|
|
31
|
-
private alterBeforeDeserialize;
|
|
32
|
-
private alterAfterDeserialize;
|
|
33
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { MetadataTypes, Type } from "@tsed/core";
|
|
2
|
-
import { JsonEntityStore } from "@tsed/schema";
|
|
3
|
-
import { JsonMapperMethods } from "../interfaces/JsonMapperMethods.js";
|
|
4
|
-
import { JsonMapperGlobalOptions } from "./JsonMapperGlobalOptions.js";
|
|
5
|
-
export interface JsonDeserializerOptions<T = any, C = any> extends MetadataTypes<T, C>, JsonMapperGlobalOptions {
|
|
6
|
-
/**
|
|
7
|
-
* Types used to map complex types (Symbol, Array, Set, Map)
|
|
8
|
-
*/
|
|
9
|
-
types?: Map<Type | Symbol | string, JsonMapperMethods>;
|
|
10
|
-
/**
|
|
11
|
-
* useAlias mapping
|
|
12
|
-
*/
|
|
13
|
-
useAlias?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Use the store which have all metadata to deserialize correctly the model. This
|
|
16
|
-
* property is useful when you deal with metadata parameters.
|
|
17
|
-
*/
|
|
18
|
-
store?: JsonEntityStore;
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
groups?: string[] | false;
|
|
23
|
-
/**
|
|
24
|
-
* Add types to deserialize a module using generics feature.
|
|
25
|
-
*/
|
|
26
|
-
generics?: Type[][];
|
|
27
|
-
[key: string]: any;
|
|
28
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { JsonSchema } from "@tsed/schema";
|
|
3
|
-
export type JsonMapperCallback<Options> = (input: any, options?: Options) => any;
|
|
4
|
-
export type CachedJsonMapper<Options> = {
|
|
5
|
-
id: string;
|
|
6
|
-
fn: JsonMapperCallback<Options>;
|
|
7
|
-
};
|
|
8
|
-
export type CachedGroupsJsonMapper<Options> = Map<string, CachedJsonMapper<Options>>;
|
|
9
|
-
export declare abstract class JsonMapperCompiler<Options extends Record<string, any> = any> {
|
|
10
|
-
/**
|
|
11
|
-
* Cached mappers metadata
|
|
12
|
-
* @protected
|
|
13
|
-
*/
|
|
14
|
-
protected cache: Map<string | Type<any>, CachedGroupsJsonMapper<Options>>;
|
|
15
|
-
/**
|
|
16
|
-
* Cached executable mappers by his id
|
|
17
|
-
* @protected
|
|
18
|
-
*/
|
|
19
|
-
protected mappers: Record<string, JsonMapperCallback<Options>>;
|
|
20
|
-
/**
|
|
21
|
-
* Cached schemas
|
|
22
|
-
* @protected
|
|
23
|
-
*/
|
|
24
|
-
protected schemes: Record<string, any>;
|
|
25
|
-
/**
|
|
26
|
-
* Cached classes by his id
|
|
27
|
-
* @protected
|
|
28
|
-
*/
|
|
29
|
-
protected constructors: Record<string, Type<any>>;
|
|
30
|
-
/**
|
|
31
|
-
* Global variables available in the mapper
|
|
32
|
-
* @protected
|
|
33
|
-
*/
|
|
34
|
-
protected globals: Record<string, any>;
|
|
35
|
-
constructor();
|
|
36
|
-
addTypeMapper(model: Type<any> | string, fn: any): this;
|
|
37
|
-
removeTypeMapper(model: Type<any> | string): void;
|
|
38
|
-
addGlobal(key: string, value: any): this;
|
|
39
|
-
eval(mapper: string, { id, groupsId, model }: {
|
|
40
|
-
id: string;
|
|
41
|
-
model: Type<any> | string;
|
|
42
|
-
groupsId: string;
|
|
43
|
-
}): CachedJsonMapper<Options>;
|
|
44
|
-
createContext(options: Options): Options & {
|
|
45
|
-
cache: Map<string | Type<any>, CachedGroupsJsonMapper<Options>>;
|
|
46
|
-
};
|
|
47
|
-
compile(model: Type<any> | string, groups: false | string[], opts?: {
|
|
48
|
-
mapper?: any;
|
|
49
|
-
}): CachedJsonMapper<Options>;
|
|
50
|
-
protected execMapper(id: string, value: any, options: Options): any;
|
|
51
|
-
protected abstract map(input: any, options: Options): any;
|
|
52
|
-
protected abstract alterValue(schemaId: string, value: any, options: Options): any;
|
|
53
|
-
protected abstract createMapper(model: Type<any>, id: string, groups: false | string[]): string;
|
|
54
|
-
protected getType(model: Type<any>): Type<any> | MapConstructor | ObjectConstructor | ArrayConstructor | SetConstructor;
|
|
55
|
-
protected alterIgnore(id: string, options: Options): any;
|
|
56
|
-
protected alterGroups(schema: JsonSchema, groups: false | string[]): boolean;
|
|
57
|
-
protected getGroupsId(groups: false | string[]): string;
|
|
58
|
-
protected getId(model: Type<any> | string, groupsId: string): string;
|
|
59
|
-
protected getSchemaId(id: string, propertyKey: string): string;
|
|
60
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface JsonMapperGlobalOptions {
|
|
2
|
-
/**
|
|
3
|
-
* JsonMapper additional property policy. (see [JsonMapper](/docs/json-mapper.md))
|
|
4
|
-
*/
|
|
5
|
-
additionalProperties?: boolean;
|
|
6
|
-
/**
|
|
7
|
-
* Disable the unsecure constructor injection when the deserialize function is used (by default: false)
|
|
8
|
-
*/
|
|
9
|
-
disableUnsecureConstructor?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Enable strict Groups configuration when the `options.groups` is undefined. (by default: false)
|
|
12
|
-
*/
|
|
13
|
-
strictGroups?: boolean;
|
|
14
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { JsonMapperMethods } from "../interfaces/JsonMapperMethods.js";
|
|
3
|
-
/**
|
|
4
|
-
* @ignore
|
|
5
|
-
*/
|
|
6
|
-
export declare function registerJsonTypeMapper(type: Type<any> | Symbol | string, token: Type<JsonMapperMethods>): void;
|
|
7
|
-
/**
|
|
8
|
-
* @ignore
|
|
9
|
-
*/
|
|
10
|
-
export declare function getJsonMapperTypes(): Map<Type<any> | Symbol | string, JsonMapperMethods>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Type } from "@tsed/core";
|
|
2
|
-
import { JsonMapperCompiler } from "./JsonMapperCompiler.js";
|
|
3
|
-
import { JsonSerializerOptions } from "./JsonSerializerOptions.js";
|
|
4
|
-
export declare class JsonSerializer extends JsonMapperCompiler<JsonSerializerOptions> {
|
|
5
|
-
constructor();
|
|
6
|
-
map(input: any, options?: JsonSerializerOptions): any;
|
|
7
|
-
protected alterValue(schemaId: string, value: any, options: JsonSerializerOptions): any;
|
|
8
|
-
protected createMapper(model: Type<any>, id: string, groups: false | string[]): string;
|
|
9
|
-
private mapOptions;
|
|
10
|
-
private mapProperty;
|
|
11
|
-
private getPropertyFiller;
|
|
12
|
-
private createDiscriminatorMapper;
|
|
13
|
-
private mapPrecondition;
|
|
14
|
-
private mapDiscriminatorKeyValue;
|
|
15
|
-
private mapAdditionalProperties;
|
|
16
|
-
private mapObject;
|
|
17
|
-
private mapSet;
|
|
18
|
-
private mapArray;
|
|
19
|
-
private mapMap;
|
|
20
|
-
private mapItem;
|
|
21
|
-
private mapJSON;
|
|
22
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { MetadataTypes, Type } from "@tsed/core";
|
|
2
|
-
import { JsonMapperMethods } from "../interfaces/JsonMapperMethods.js";
|
|
3
|
-
import { JsonMapperGlobalOptions } from "./JsonMapperGlobalOptions.js";
|
|
4
|
-
export interface JsonSerializerOptions<T = any, C = any> extends MetadataTypes<T, C>, Pick<JsonMapperGlobalOptions, "strictGroups"> {
|
|
5
|
-
/**
|
|
6
|
-
* Types used to map complex types (Symbol, Number, String, etc...)
|
|
7
|
-
*/
|
|
8
|
-
types?: Map<Type<any> | Symbol | string, JsonMapperMethods>;
|
|
9
|
-
/**
|
|
10
|
-
* useAlias mapping
|
|
11
|
-
*/
|
|
12
|
-
useAlias?: boolean;
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export declare class Writer {
|
|
2
|
-
static object: {
|
|
3
|
-
assign(...args: string[]): string;
|
|
4
|
-
};
|
|
5
|
-
protected _root?: Writer;
|
|
6
|
-
protected body: (string | Writer)[];
|
|
7
|
-
private _indent;
|
|
8
|
-
constructor(root?: Writer);
|
|
9
|
-
static indent(lines: string[]): string[];
|
|
10
|
-
static mapper(mapperId: string, key: string, options: string): string;
|
|
11
|
-
static mapperFrom(key: string, options: string): string;
|
|
12
|
-
static options(...args: string[]): string;
|
|
13
|
-
add(...lines: (undefined | string | Writer)[]): this;
|
|
14
|
-
arrow(...args: string[]): Writer;
|
|
15
|
-
build(): string[];
|
|
16
|
-
callMapper(id: string, key: string, ...options: string[]): this;
|
|
17
|
-
returnCallMapper(id: string, key: string, ...options: string[]): Writer;
|
|
18
|
-
const(name: string, line: string): this;
|
|
19
|
-
each(iterable: string, args?: string[]): Writer;
|
|
20
|
-
if(condition: string): IfWriter;
|
|
21
|
-
switch(input: string): SwitchWriter;
|
|
22
|
-
indent(indent: boolean): this;
|
|
23
|
-
new(indent?: boolean): Writer;
|
|
24
|
-
return(line: string): Writer;
|
|
25
|
-
root(): Writer;
|
|
26
|
-
set(left: string, right: string): this;
|
|
27
|
-
toString(): string;
|
|
28
|
-
}
|
|
29
|
-
declare class IfWriter extends Writer {
|
|
30
|
-
protected condition: string;
|
|
31
|
-
protected elseWriter?: Writer;
|
|
32
|
-
constructor(condition: string, root: Writer);
|
|
33
|
-
else(): Writer;
|
|
34
|
-
build(): string[];
|
|
35
|
-
}
|
|
36
|
-
declare class SwitchWriter extends Writer {
|
|
37
|
-
#private;
|
|
38
|
-
private input;
|
|
39
|
-
constructor(input: string);
|
|
40
|
-
case(condition: string): Writer;
|
|
41
|
-
build(): string[];
|
|
42
|
-
}
|
|
43
|
-
export {};
|
package/lib/types-esm/index.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Automatically generated by @tsed/barrels.
|
|
3
|
-
*/
|
|
4
|
-
export * from "./components/DateMapper.js";
|
|
5
|
-
export * from "./components/PrimitiveMapper.js";
|
|
6
|
-
export * from "./components/SymbolMapper.js";
|
|
7
|
-
export * from "./decorators/afterDeserialize.js";
|
|
8
|
-
export * from "./decorators/beforeDeserialize.js";
|
|
9
|
-
export * from "./decorators/jsonMapper.js";
|
|
10
|
-
export * from "./decorators/onDeserialize.js";
|
|
11
|
-
export * from "./decorators/onSerialize.js";
|
|
12
|
-
export * from "./domain/JsonDeserializer.js";
|
|
13
|
-
export * from "./domain/JsonDeserializerOptions.js";
|
|
14
|
-
export * from "./domain/JsonMapperCompiler.js";
|
|
15
|
-
export * from "./domain/JsonMapperGlobalOptions.js";
|
|
16
|
-
export * from "./domain/JsonMapperSettings.js";
|
|
17
|
-
export * from "./domain/JsonMapperTypesContainer.js";
|
|
18
|
-
export * from "./domain/JsonSerializer.js";
|
|
19
|
-
export * from "./domain/JsonSerializerOptions.js";
|
|
20
|
-
export * from "./domain/Writer.js";
|
|
21
|
-
export * from "./hooks/alterAfterDeserialize.js";
|
|
22
|
-
export * from "./hooks/alterBeforeDeserialize.js";
|
|
23
|
-
export * from "./hooks/alterOnDeserialize.js";
|
|
24
|
-
export * from "./hooks/alterOnSerialize.js";
|
|
25
|
-
export * from "./interfaces/JsonMapperMethods.js";
|
|
26
|
-
export * from "./utils/deserialize.js";
|
|
27
|
-
export * from "./utils/getObjectProperties.js";
|
|
28
|
-
export * from "./utils/serialize.js";
|