@tsed/json-mapper 7.35.0-beta.5 → 7.35.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.
Files changed (97) hide show
  1. package/jest.config.js +3 -3
  2. package/lib/browser/json-mapper.umd.min.js +1 -1
  3. package/lib/browser/json-mapper.umd.min.js.map +1 -1
  4. package/lib/cjs/components/ArrayMapper.js +23 -0
  5. package/lib/cjs/components/ArrayMapper.js.map +1 -0
  6. package/lib/cjs/components/DateMapper.js +1 -1
  7. package/lib/cjs/components/DateMapper.js.map +1 -1
  8. package/lib/cjs/components/MapMapper.js +30 -0
  9. package/lib/cjs/components/MapMapper.js.map +1 -0
  10. package/lib/cjs/components/PrimitiveMapper.js +26 -30
  11. package/lib/cjs/components/PrimitiveMapper.js.map +1 -1
  12. package/lib/cjs/components/SetMapper.js +30 -0
  13. package/lib/cjs/components/SetMapper.js.map +1 -0
  14. package/lib/cjs/components/SymbolMapper.js.map +1 -1
  15. package/lib/cjs/domain/JsonMapperContext.js +27 -0
  16. package/lib/cjs/domain/JsonMapperContext.js.map +1 -0
  17. package/lib/cjs/index.js +4 -9
  18. package/lib/cjs/index.js.map +1 -1
  19. package/lib/cjs/utils/deserialize.js +202 -5
  20. package/lib/cjs/utils/deserialize.js.map +1 -1
  21. package/lib/cjs/utils/serialize.js +143 -5
  22. package/lib/cjs/utils/serialize.js.map +1 -1
  23. package/lib/esm/components/ArrayMapper.js +20 -0
  24. package/lib/esm/components/ArrayMapper.js.map +1 -0
  25. package/lib/esm/components/DateMapper.js +1 -1
  26. package/lib/esm/components/DateMapper.js.map +1 -1
  27. package/lib/esm/components/MapMapper.js +27 -0
  28. package/lib/esm/components/MapMapper.js.map +1 -0
  29. package/lib/esm/components/PrimitiveMapper.js +26 -30
  30. package/lib/esm/components/PrimitiveMapper.js.map +1 -1
  31. package/lib/esm/components/SetMapper.js +27 -0
  32. package/lib/esm/components/SetMapper.js.map +1 -0
  33. package/lib/esm/components/SymbolMapper.js.map +1 -1
  34. package/lib/esm/domain/JsonMapperContext.js +23 -0
  35. package/lib/esm/domain/JsonMapperContext.js.map +1 -0
  36. package/lib/esm/index.js +4 -9
  37. package/lib/esm/index.js.map +1 -1
  38. package/lib/esm/utils/deserialize.js +200 -4
  39. package/lib/esm/utils/deserialize.js.map +1 -1
  40. package/lib/esm/utils/serialize.js +141 -4
  41. package/lib/esm/utils/serialize.js.map +1 -1
  42. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  43. package/lib/tsconfig.tsbuildinfo +1 -1
  44. package/lib/types/components/ArrayMapper.d.ts +10 -0
  45. package/lib/types/components/MapMapper.d.ts +12 -0
  46. package/lib/types/components/PrimitiveMapper.d.ts +0 -4
  47. package/lib/types/components/SetMapper.d.ts +10 -0
  48. package/lib/types/domain/JsonMapperContext.d.ts +20 -0
  49. package/lib/types/index.d.ts +4 -9
  50. package/lib/types/utils/deserialize.d.ts +47 -2
  51. package/lib/types/utils/serialize.d.ts +18 -2
  52. package/package.json +8 -11
  53. package/lib/cjs/domain/JsonDeserializer.js +0 -275
  54. package/lib/cjs/domain/JsonDeserializer.js.map +0 -1
  55. package/lib/cjs/domain/JsonDeserializerOptions.js +0 -3
  56. package/lib/cjs/domain/JsonDeserializerOptions.js.map +0 -1
  57. package/lib/cjs/domain/JsonMapperCompiler.js +0 -167
  58. package/lib/cjs/domain/JsonMapperCompiler.js.map +0 -1
  59. package/lib/cjs/domain/JsonSerializer.js +0 -219
  60. package/lib/cjs/domain/JsonSerializer.js.map +0 -1
  61. package/lib/cjs/domain/JsonSerializerOptions.js +0 -3
  62. package/lib/cjs/domain/JsonSerializerOptions.js.map +0 -1
  63. package/lib/cjs/domain/Writer.js +0 -141
  64. package/lib/cjs/domain/Writer.js.map +0 -1
  65. package/lib/cjs/hooks/alterOnDeserialize.js +0 -8
  66. package/lib/cjs/hooks/alterOnDeserialize.js.map +0 -1
  67. package/lib/cjs/hooks/alterOnSerialize.js +0 -8
  68. package/lib/cjs/hooks/alterOnSerialize.js.map +0 -1
  69. package/lib/cjs/utils/getObjectProperties.js +0 -9
  70. package/lib/cjs/utils/getObjectProperties.js.map +0 -1
  71. package/lib/esm/domain/JsonDeserializer.js +0 -271
  72. package/lib/esm/domain/JsonDeserializer.js.map +0 -1
  73. package/lib/esm/domain/JsonDeserializerOptions.js +0 -2
  74. package/lib/esm/domain/JsonDeserializerOptions.js.map +0 -1
  75. package/lib/esm/domain/JsonMapperCompiler.js +0 -163
  76. package/lib/esm/domain/JsonMapperCompiler.js.map +0 -1
  77. package/lib/esm/domain/JsonSerializer.js +0 -215
  78. package/lib/esm/domain/JsonSerializer.js.map +0 -1
  79. package/lib/esm/domain/JsonSerializerOptions.js +0 -2
  80. package/lib/esm/domain/JsonSerializerOptions.js.map +0 -1
  81. package/lib/esm/domain/Writer.js +0 -137
  82. package/lib/esm/domain/Writer.js.map +0 -1
  83. package/lib/esm/hooks/alterOnDeserialize.js +0 -4
  84. package/lib/esm/hooks/alterOnDeserialize.js.map +0 -1
  85. package/lib/esm/hooks/alterOnSerialize.js +0 -4
  86. package/lib/esm/hooks/alterOnSerialize.js.map +0 -1
  87. package/lib/esm/utils/getObjectProperties.js +0 -5
  88. package/lib/esm/utils/getObjectProperties.js.map +0 -1
  89. package/lib/types/domain/JsonDeserializer.d.ts +0 -33
  90. package/lib/types/domain/JsonDeserializerOptions.d.ts +0 -31
  91. package/lib/types/domain/JsonMapperCompiler.d.ts +0 -58
  92. package/lib/types/domain/JsonSerializer.d.ts +0 -21
  93. package/lib/types/domain/JsonSerializerOptions.d.ts +0 -13
  94. package/lib/types/domain/Writer.d.ts +0 -43
  95. package/lib/types/hooks/alterOnDeserialize.d.ts +0 -2
  96. package/lib/types/hooks/alterOnSerialize.d.ts +0 -2
  97. package/lib/types/utils/getObjectProperties.d.ts +0 -1
@@ -0,0 +1,10 @@
1
+ import { JsonMapperCtx, JsonMapperMethods } from "../interfaces/JsonMapperMethods";
2
+ /**
3
+ * Mapper for `Array` type.
4
+ * @jsonmapper
5
+ * @component
6
+ */
7
+ export declare class ArrayMapper implements JsonMapperMethods {
8
+ deserialize<T = any>(data: any, options: JsonMapperCtx): T[];
9
+ serialize(data: any[], options: JsonMapperCtx): any;
10
+ }
@@ -0,0 +1,12 @@
1
+ import { JsonMapperCtx, JsonMapperMethods } from "../interfaces/JsonMapperMethods";
2
+ /**
3
+ * Mapper for `Map` type.
4
+ * @jsonmapper
5
+ * @component
6
+ */
7
+ export declare class MapMapper implements JsonMapperMethods {
8
+ deserialize<T = any, C = Map<string, T>>(data: {
9
+ [key: string]: any;
10
+ }, ctx: JsonMapperCtx<T, C>): Map<string, T>;
11
+ serialize<T>(data: Map<string, T>, ctx: JsonMapperCtx): any;
12
+ }
@@ -11,8 +11,4 @@ export declare class CastError extends Error {
11
11
  export declare class PrimitiveMapper implements JsonMapperMethods {
12
12
  deserialize<T>(data: any, ctx: JsonMapperCtx): string | number | boolean | void | null | BigInt;
13
13
  serialize(object: string | number | boolean | BigInt): string | number | boolean | BigInt;
14
- protected String(data: any): string | null;
15
- protected Boolean(data: any): boolean | null | undefined;
16
- protected Number(data: any): number | null;
17
- protected BigInt(data: any): bigint | null;
18
14
  }
@@ -0,0 +1,10 @@
1
+ import { JsonMapperCtx, JsonMapperMethods } from "../interfaces/JsonMapperMethods";
2
+ /**
3
+ * Mapper for the `Set` Type.
4
+ * @jsonmapper
5
+ * @component
6
+ */
7
+ export declare class SetMapper implements JsonMapperMethods {
8
+ deserialize<T>(data: any, ctx: JsonMapperCtx): Set<T>;
9
+ serialize<T>(data: Set<T>, ctx: JsonMapperCtx): any[];
10
+ }
@@ -0,0 +1,20 @@
1
+ import { Type } from "@tsed/core";
2
+ import { JsonMapperCtx } from "../interfaces/JsonMapperMethods";
3
+ /**
4
+ * @ignore
5
+ */
6
+ export interface JsonMapperContextProps extends Partial<Omit<JsonMapperCtx, "next">> {
7
+ next: (data: any, options: any) => void;
8
+ options: any;
9
+ }
10
+ /**
11
+ * @ignore
12
+ */
13
+ export declare class JsonMapperContext implements JsonMapperCtx {
14
+ readonly collectionType: Type<any> | undefined;
15
+ readonly type: Type<any> | any;
16
+ readonly options: any;
17
+ private _next;
18
+ constructor({ type, collectionType, next, options }: JsonMapperContextProps);
19
+ next(data: any): void;
20
+ }
@@ -1,27 +1,22 @@
1
1
  /**
2
2
  * @file Automatically generated by barrelsby.
3
3
  */
4
+ export * from "./components/ArrayMapper";
4
5
  export * from "./components/DateMapper";
6
+ export * from "./components/MapMapper";
5
7
  export * from "./components/PrimitiveMapper";
8
+ export * from "./components/SetMapper";
6
9
  export * from "./components/SymbolMapper";
7
10
  export * from "./decorators/afterDeserialize";
8
11
  export * from "./decorators/beforeDeserialize";
9
12
  export * from "./decorators/jsonMapper";
10
13
  export * from "./decorators/onDeserialize";
11
14
  export * from "./decorators/onSerialize";
12
- export * from "./domain/JsonDeserializer";
13
- export * from "./domain/JsonDeserializerOptions";
14
- export * from "./domain/JsonMapperCompiler";
15
+ export * from "./domain/JsonMapperContext";
15
16
  export * from "./domain/JsonMapperSettings";
16
17
  export * from "./domain/JsonMapperTypesContainer";
17
- export * from "./domain/JsonSerializer";
18
- export * from "./domain/JsonSerializerOptions";
19
- export * from "./domain/Writer";
20
18
  export * from "./hooks/alterAfterDeserialize";
21
19
  export * from "./hooks/alterBeforeDeserialize";
22
- export * from "./hooks/alterOnDeserialize";
23
- export * from "./hooks/alterOnSerialize";
24
20
  export * from "./interfaces/JsonMapperMethods";
25
21
  export * from "./utils/deserialize";
26
- export * from "./utils/getObjectProperties";
27
22
  export * from "./utils/serialize";
@@ -1,5 +1,50 @@
1
+ import { MetadataTypes, Type } from "@tsed/core";
2
+ import { JsonEntityStore } from "@tsed/schema";
3
+ import "../components/ArrayMapper";
1
4
  import "../components/DateMapper";
5
+ import "../components/MapMapper";
2
6
  import "../components/PrimitiveMapper";
7
+ import "../components/SetMapper";
3
8
  import "../components/SymbolMapper";
4
- import { JsonDeserializerOptions } from "../domain/JsonDeserializerOptions";
5
- export declare function deserialize<Model = any>(input: any, options?: JsonDeserializerOptions): Model;
9
+ import { JsonMapperMethods } from "../interfaces/JsonMapperMethods";
10
+ export interface JsonDeserializerOptions<T = any, C = any> extends MetadataTypes<T, C> {
11
+ /**
12
+ * Types used to map complex types (Symbol, Array, Set, Map)
13
+ */
14
+ types?: WeakMap<Type<any>, JsonMapperMethods>;
15
+ /**
16
+ * useAlias mapping
17
+ */
18
+ useAlias?: boolean;
19
+ /**
20
+ * Accept additionalProperties or ignore it
21
+ */
22
+ additionalProperties?: boolean;
23
+ /**
24
+ *
25
+ */
26
+ disableUnsecureConstructor?: boolean;
27
+ /**
28
+ * Use the store which have all metadata to deserialize correctly the model. This
29
+ * property is useful when you deal with metadata parameters.
30
+ */
31
+ store?: JsonEntityStore;
32
+ /**
33
+ *
34
+ */
35
+ groups?: string[] | false;
36
+ [key: string]: any;
37
+ }
38
+ /**
39
+ * Transform given plain object to class.
40
+ * @param src
41
+ * @param options
42
+ */
43
+ export declare function plainObjectToClass<T = any>(src: any, options: JsonDeserializerOptions): T;
44
+ /**
45
+ * Transform given source to class base on the given `options.type`.
46
+ *
47
+ * @param src
48
+ * @param options
49
+ */
50
+ export declare function deserialize<T = any>(src: any, options?: JsonDeserializerOptions): T;
@@ -1,5 +1,21 @@
1
+ import { MetadataTypes, Type } from "@tsed/core";
2
+ import "../components/ArrayMapper";
1
3
  import "../components/DateMapper";
4
+ import "../components/MapMapper";
2
5
  import "../components/PrimitiveMapper";
6
+ import "../components/SetMapper";
3
7
  import "../components/SymbolMapper";
4
- import { JsonSerializerOptions } from "../domain/JsonSerializerOptions";
5
- export declare function serialize(input: any, options?: JsonSerializerOptions): any;
8
+ import { JsonMapperMethods } from "../interfaces/JsonMapperMethods";
9
+ export interface JsonSerializerOptions<T = any, C = any> extends MetadataTypes<T, C> {
10
+ /**
11
+ * Types used to map complex types (Symbol, Array, Set, Map)
12
+ */
13
+ types?: Map<Type<any>, JsonMapperMethods>;
14
+ /**
15
+ * useAlias mapping
16
+ */
17
+ useAlias?: boolean;
18
+ [key: string]: any;
19
+ }
20
+ export declare function classToPlainObject(obj: any, options: JsonSerializerOptions<any, any>): any;
21
+ export declare function serialize(obj: any, { type, collectionType, groups, ...options }?: JsonSerializerOptions): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/json-mapper",
3
- "version": "7.35.0-beta.5",
3
+ "version": "7.35.0",
4
4
  "description": "Json mapper module for Ts.ED Framework",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
@@ -41,15 +41,15 @@
41
41
  "tslib": "2.5.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@tsed/core": "7.35.0-beta.5",
45
- "@tsed/eslint": "7.35.0-beta.5",
46
- "@tsed/schema": "7.35.0-beta.5",
47
- "@tsed/typescript": "7.35.0-beta.5",
44
+ "@tsed/core": "7.35.0",
45
+ "@tsed/eslint": "7.35.0",
46
+ "@tsed/schema": "7.35.0",
47
+ "@tsed/typescript": "7.35.0",
48
48
  "eslint": "^8.12.0"
49
49
  },
50
50
  "peerDependencies": {
51
- "@tsed/core": "^7.35.0-beta.5",
52
- "@tsed/schema": "^7.35.0-beta.5"
51
+ "@tsed/core": "^7.35.0",
52
+ "@tsed/schema": "^7.35.0"
53
53
  },
54
54
  "peerDependenciesMeta": {
55
55
  "@tsed/core": {
@@ -65,8 +65,5 @@
65
65
  },
66
66
  "homepage": "https://github.com/tsedio/tsed/tree/production/packages/specs/json-mapper",
67
67
  "author": "Romain Lenzotti",
68
- "license": "MIT",
69
- "publishConfig": {
70
- "tag": "beta"
71
- }
68
+ "license": "MIT"
72
69
  }
@@ -1,275 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.JsonDeserializer = void 0;
4
- const core_1 = require("@tsed/core");
5
- const schema_1 = require("@tsed/schema");
6
- const alterAfterDeserialize_1 = require("../hooks/alterAfterDeserialize");
7
- const alterBeforeDeserialize_1 = require("../hooks/alterBeforeDeserialize");
8
- const alterOnDeserialize_1 = require("../hooks/alterOnDeserialize");
9
- const JsonMapperCompiler_1 = require("./JsonMapperCompiler");
10
- const JsonMapperSettings_1 = require("./JsonMapperSettings");
11
- const JsonMapperTypesContainer_1 = require("./JsonMapperTypesContainer");
12
- const Writer_1 = require("./Writer");
13
- function isDeserializable(obj, options) {
14
- if ((!!options.collectionType && (0, core_1.isNil)(obj)) || obj === undefined) {
15
- return false;
16
- }
17
- return !((0, core_1.isEmpty)(options.type) || (options.type === Object && !options.collectionType));
18
- }
19
- function mapParamStoreOptions(store, options) {
20
- return {
21
- ...options,
22
- store: undefined,
23
- type: store.itemSchema.hasDiscriminator ? store.itemSchema.discriminator().base : store.getBestType(),
24
- collectionType: store.collectionType,
25
- groups: store.parameter.groups,
26
- // genericTypes: store.nestedGenerics[0],
27
- generics: store.nestedGenerics
28
- };
29
- }
30
- function getGenericIndex(propertyStore) {
31
- return propertyStore.parent.schema.genericLabels.indexOf(propertyStore.itemSchema.genericType);
32
- }
33
- class JsonDeserializer extends JsonMapperCompiler_1.JsonMapperCompiler {
34
- /**
35
- * Cached classes by his id
36
- * @protected
37
- */
38
- constructors = {};
39
- constructor() {
40
- super();
41
- this.addGlobal("newInstanceOf", this.newInstanceOf.bind(this));
42
- this.addGlobal("alterBeforeDeserialize", this.alterBeforeDeserialize.bind(this));
43
- this.addGlobal("alterAfterDeserialize", this.alterAfterDeserialize.bind(this));
44
- this.addTypeMapper(Object, this.mapObject.bind(this));
45
- this.addTypeMapper(Array, this.mapArray.bind(this));
46
- this.addTypeMapper(Map, this.mapMap.bind(this));
47
- this.addTypeMapper(Set, this.mapSet.bind(this));
48
- this.addTypeMapper("ObjectId", (value) => String(value));
49
- }
50
- map(input, options = {}) {
51
- options = this.mapOptions(options);
52
- if (!isDeserializable(input, options)) {
53
- return input;
54
- }
55
- if (!options.collectionType && (0, core_1.isArray)(input)) {
56
- options.collectionType = Array;
57
- }
58
- const model = options.type || (0, core_1.classOf)(input);
59
- const mapper = this.compile(model, options.groups);
60
- if (options.collectionType) {
61
- const collectionMapper = this.compile(options.collectionType, options.groups);
62
- return collectionMapper.fn(input, { ...options, id: mapper.id });
63
- }
64
- return mapper.fn(input, this.createContext(options));
65
- }
66
- compile(model, groups) {
67
- if ([WeakMap, WeakSet].includes(model)) {
68
- throw new Error(`${(0, core_1.nameOf)(model)} is not supported by JsonMapper.`);
69
- }
70
- return super.compile(model, groups);
71
- }
72
- eval(mapper, { id, groupsId, model }) {
73
- this.constructors[id] = model;
74
- return super.eval(mapper, { id, groupsId, model });
75
- }
76
- newInstanceOf(id, obj, options) {
77
- try {
78
- return new this.constructors[id](options.disableUnsecureConstructor ? {} : obj);
79
- }
80
- catch (er) {
81
- return obj;
82
- }
83
- }
84
- createMapper(model, id, groups) {
85
- const entity = schema_1.JsonEntityStore.from(model);
86
- const properties = new Set();
87
- const schemaProperties = [...(0, schema_1.getPropertiesStores)(entity).values()];
88
- const writer = new Writer_1.Writer().arrow("input", "options");
89
- writer.if("isNil(input)").return("input");
90
- if (entity.schema.hasDiscriminator) {
91
- writer.add(this.mapDiscriminator(entity, groups));
92
- }
93
- // pre hook
94
- if (entity.schema.$hooks?.has("beforeDeserialize")) {
95
- this.schemes[id] = entity.schema;
96
- writer.set("input", `alterBeforeDeserialize('${id}', input, options)`);
97
- }
98
- // generics and options
99
- writer.const("generics", "options.generics[0]");
100
- if (entity.schema.genericLabels?.length) {
101
- writer.set("options", "{...options, self: input, generics: [...options.generics].slice(1)}");
102
- }
103
- else {
104
- writer.set("options", "{...options, self: input}");
105
- }
106
- writer.const("obj", `newInstanceOf('${id}', input, options)`);
107
- // properties
108
- writer.add(...schemaProperties.flatMap((propertyStore) => {
109
- const key = propertyStore.propertyName;
110
- properties.add(key);
111
- properties.add(String(propertyStore.parent.schema.getAliasOf(key) || key));
112
- if (propertyStore.isGetterOnly() ||
113
- (propertyStore.schema?.$hooks?.has("groups") && this.alterGroups(propertyStore.schema, groups))) {
114
- return;
115
- }
116
- return this.mapProperty(propertyStore, id, groups);
117
- }));
118
- // additional properties
119
- writer.add(this.mapAdditionalProperties(entity, properties, groups));
120
- // post hook
121
- if (entity.schema.$hooks?.has("afterDeserialize")) {
122
- this.schemes[id] = entity.schema;
123
- return writer.return(`alterAfterDeserialize('${id}', obj, options)`).root().toString();
124
- }
125
- return writer.return("obj").root().toString();
126
- }
127
- alterValue(schemaId, value, options) {
128
- return (0, alterOnDeserialize_1.alterOnDeserialize)(this.schemes[schemaId], value, options);
129
- }
130
- mapDiscriminator(entity, groups) {
131
- const writer = new Writer_1.Writer();
132
- const discriminator = entity.schema.discriminator();
133
- const sw = writer.switch(`input['${discriminator.propertyName}']`);
134
- discriminator.values.forEach((value, kind) => {
135
- const nestedMapper = this.compile(value, groups);
136
- sw.case(`'${kind}'`).returnCallMapper(nestedMapper.id, "input");
137
- });
138
- return writer;
139
- }
140
- mapProperty(propertyStore, id, groups) {
141
- const key = String(propertyStore.propertyKey);
142
- const aliasKey = String(propertyStore.parent.schema.getAliasOf(key) || key);
143
- const schemaId = this.getSchemaId(id, key);
144
- const format = propertyStore.itemSchema.get("format");
145
- const formatOpts = format && `options: {format: '${format}'}`;
146
- let writer = new Writer_1.Writer().add(`// Map ${key} ${id} ${groups || ""}`);
147
- const pick = key !== aliasKey ? `options.useAlias ? '${aliasKey}' : '${key}'` : `'${key}'`;
148
- const ifWriter = writer.set(`let ${key}`, `input[${pick}]`).if(`${key} !== undefined`);
149
- // pre hook
150
- const hasDeserializer = propertyStore.schema?.$hooks?.has("onDeserialize");
151
- if (hasDeserializer) {
152
- this.schemes[schemaId] = propertyStore.schema;
153
- const opts = Writer_1.Writer.options(formatOpts);
154
- ifWriter.set(key, `alterValue('${schemaId}', ${key}, ${opts})`);
155
- }
156
- const fill = this.getPropertyFiller(propertyStore, id, groups, formatOpts);
157
- if (hasDeserializer) {
158
- fill(ifWriter.if(`${key} === input.${key}`));
159
- }
160
- else {
161
- fill(ifWriter);
162
- }
163
- ifWriter.set(`obj.${key}`, key);
164
- if (groups && groups.includes("partial")) {
165
- ifWriter.else().add(`delete obj.${key}`);
166
- }
167
- return writer.root();
168
- }
169
- getPropertyFiller(propertyStore, id, groups, formatOpts) {
170
- const key = String(propertyStore.propertyKey);
171
- const schemaId = this.getSchemaId(id, key);
172
- const generics = propertyStore.itemSchema.nestedGenerics;
173
- const isGeneric = propertyStore.itemSchema.isGeneric && !generics?.length;
174
- if (isGeneric) {
175
- const index = getGenericIndex(propertyStore);
176
- const opts = Writer_1.Writer.options(formatOpts, `type: generics[${index}]`);
177
- return (writer) => writer.set(key, `compileAndMap(${key}, ${opts})`);
178
- }
179
- const type = propertyStore.itemSchema.hasDiscriminator ? propertyStore.itemSchema.discriminator().base : propertyStore.getBestType();
180
- const nestedMapper = this.compile(type, groups);
181
- if (propertyStore.isCollection) {
182
- return (writer) => writer.callMapper((0, core_1.nameOf)(propertyStore.collectionType), key, `id: '${nestedMapper.id}'`, formatOpts);
183
- }
184
- if (generics?.length) {
185
- this.schemes[schemaId] = propertyStore.schema;
186
- return (writer) => writer.callMapper(nestedMapper.id, key, formatOpts, `generics: schemes['${schemaId}'].nestedGenerics`);
187
- }
188
- return (writer) => writer.callMapper(nestedMapper.id, key, formatOpts);
189
- }
190
- mapOptions({ groups = false, useAlias = true, types, ...options }) {
191
- if (options.store instanceof schema_1.JsonParameterStore) {
192
- return this.mapOptions(mapParamStoreOptions(options.store, options));
193
- }
194
- const customMappers = {};
195
- types = types || (0, JsonMapperTypesContainer_1.getJsonMapperTypes)();
196
- types.forEach((mapper, model) => {
197
- if (![Array, Set, Map].includes(model)) {
198
- const typeName = (0, core_1.nameOf)(model);
199
- if ((0, core_1.nameOf)(model) in mapper) {
200
- this.addTypeMapper(model, mapper[typeName].bind(mapper));
201
- }
202
- else {
203
- this.addTypeMapper(model, (value, options) => mapper.deserialize(value, {
204
- ...options,
205
- type: model
206
- }));
207
- }
208
- }
209
- });
210
- return {
211
- ...options,
212
- additionalProperties: (0, core_1.getValue)(options, "additionalProperties", JsonMapperSettings_1.JsonMapperSettings.additionalProperties),
213
- disableUnsecureConstructor: (0, core_1.getValue)(options, "disableUnsecureConstructor", JsonMapperSettings_1.JsonMapperSettings.disableUnsecureConstructor),
214
- groups,
215
- useAlias,
216
- customMappers,
217
- generics: options.generics || []
218
- };
219
- }
220
- mapAdditionalProperties(entity, properties, groups) {
221
- const additionalProperties = entity.schema.get("additionalProperties");
222
- const exclude = [...properties.values()].map((key) => `'${key}'`).join(", ");
223
- const writer = new Writer_1.Writer();
224
- writer.add("// add additional properties");
225
- let each = writer.each("objectKeys(input)", ["key"]);
226
- if (exclude.length) {
227
- each = each.if(`![${exclude}].includes(key)`);
228
- }
229
- if ((0, core_1.isClass)(additionalProperties)) {
230
- const nestedMapper = this.compile(additionalProperties.getComputedType(), groups);
231
- each.set("obj[key]", Writer_1.Writer.mapper(nestedMapper.id, "input[key]", "options"));
232
- return writer;
233
- }
234
- if (additionalProperties) {
235
- each.set("obj[key]", "input[key]");
236
- return writer;
237
- }
238
- // dynamic additional properties options
239
- each.if(`options.additionalProperties`).set("obj[key]", "input[key]");
240
- return writer;
241
- }
242
- mapObject(input, options) {
243
- return input;
244
- }
245
- mapSet(input, options) {
246
- const obj = new Set();
247
- (0, core_1.objectKeys)(input).forEach((key) => {
248
- obj.add(this.mapItem(input[key], options));
249
- });
250
- return obj;
251
- }
252
- mapArray(input, options) {
253
- return [].concat(input).map((item) => {
254
- return this.mapItem(item, options);
255
- });
256
- }
257
- mapMap(input, options) {
258
- const obj = new Map();
259
- (0, core_1.objectKeys)(input).forEach((key) => {
260
- obj.set(key, this.mapItem(input[key], options));
261
- });
262
- return obj;
263
- }
264
- mapItem(input, { id, ...options }) {
265
- return this.execMapper(id, input, options);
266
- }
267
- alterBeforeDeserialize(schemaId, value, options) {
268
- return (0, alterBeforeDeserialize_1.alterBeforeDeserialize)(value, this.schemes[schemaId], options);
269
- }
270
- alterAfterDeserialize(schemaId, value, options) {
271
- return (0, alterAfterDeserialize_1.alterAfterDeserialize)(value, this.schemes[schemaId], options);
272
- }
273
- }
274
- exports.JsonDeserializer = JsonDeserializer;
275
- //# sourceMappingURL=JsonDeserializer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"JsonDeserializer.js","sourceRoot":"","sources":["../../../src/domain/JsonDeserializer.ts"],"names":[],"mappings":";;;AAAA,qCAAoI;AACpI,yCAAyH;AAEzH,0EAAqE;AACrE,4EAAuE;AACvE,oEAA+D;AAG/D,6DAA0E;AAC1E,6DAAwD;AACxD,yEAA8D;AAC9D,qCAAgC;AAEhC,SAAS,gBAAgB,CAAC,GAAQ,EAAE,OAAgC;IAClE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,IAAI,IAAA,YAAK,EAAC,GAAG,CAAC,CAAC,IAAI,GAAG,KAAK,SAAS,EAAE;QACjE,OAAO,KAAK,CAAC;KACd;IAED,OAAO,CAAC,CAAC,IAAA,cAAO,EAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;AAC1F,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAyB,EAAE,OAAgC;IACvF,OAAO;QACL,GAAG,OAAO;QACV,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE;QACrG,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM;QAC9B,yCAAyC;QACzC,QAAQ,EAAE,KAAK,CAAC,cAAc;KAC/B,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,aAAgC;IACvD,OAAO,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,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QACzD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAe,CAAC;QAEnC,IAAA,iBAAU,EAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAChC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;QAEH,OAAO,GAAG,CAAC;IACb,CAAC;IAEO,OAAO,CAAC,KAAU,EAAE,EAAC,EAAE,EAAE,GAAG,OAAO,EAA0B;QACnE,OAAO,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;IAEO,sBAAsB,CAAC,QAAgB,EAAE,KAAU,EAAE,OAAgC;QAC3F,OAAO,IAAA,+CAAsB,EAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;IAEO,qBAAqB,CAAC,QAAgB,EAAE,KAAU,EAAE,OAAgC;QAC1F,OAAO,IAAA,6CAAqB,EAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC;CACF;AAhVD,4CAgVC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=JsonDeserializerOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"JsonDeserializerOptions.js","sourceRoot":"","sources":["../../../src/domain/JsonDeserializerOptions.ts"],"names":[],"mappings":""}