@lenne.tech/nest-server 10.0.2 → 10.0.4
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/README.md +9 -0
- package/dist/config.env.js +47 -17
- package/dist/config.env.js.map +1 -1
- package/dist/core/common/args/filter.args.js +3 -3
- package/dist/core/common/args/filter.args.js.map +1 -1
- package/dist/core/common/args/pagination.args.js +6 -6
- package/dist/core/common/args/pagination.args.js.map +1 -1
- package/dist/core/common/decorators/restricted.decorator.js +15 -17
- package/dist/core/common/decorators/restricted.decorator.js.map +1 -1
- package/dist/core/common/filters/http-exception-log.filter.js +1 -3
- package/dist/core/common/filters/http-exception-log.filter.js.map +1 -1
- package/dist/core/common/helpers/db.helper.js +14 -14
- package/dist/core/common/helpers/db.helper.js.map +1 -1
- package/dist/core/common/helpers/file.helper.js +2 -2
- package/dist/core/common/helpers/file.helper.js.map +1 -1
- package/dist/core/common/helpers/filter.helper.d.ts +2 -2
- package/dist/core/common/helpers/filter.helper.js +1 -1
- package/dist/core/common/helpers/filter.helper.js.map +1 -1
- package/dist/core/common/helpers/graphql.helper.js +1 -1
- package/dist/core/common/helpers/graphql.helper.js.map +1 -1
- package/dist/core/common/helpers/input.helper.js +31 -38
- package/dist/core/common/helpers/input.helper.js.map +1 -1
- package/dist/core/common/helpers/model.helper.js +7 -7
- package/dist/core/common/helpers/model.helper.js.map +1 -1
- package/dist/core/common/helpers/service.helper.js +2 -2
- package/dist/core/common/helpers/service.helper.js.map +1 -1
- package/dist/core/common/inputs/combined-filter.input.js +3 -3
- package/dist/core/common/inputs/combined-filter.input.js.map +1 -1
- package/dist/core/common/inputs/core-input.input.js +1 -1
- package/dist/core/common/inputs/core-input.input.js.map +1 -1
- package/dist/core/common/inputs/filter.input.js +3 -3
- package/dist/core/common/inputs/filter.input.js.map +1 -1
- package/dist/core/common/inputs/single-filter.input.js +4 -4
- package/dist/core/common/inputs/single-filter.input.js.map +1 -1
- package/dist/core/common/inputs/sort.input.js +1 -1
- package/dist/core/common/inputs/sort.input.js.map +1 -1
- package/dist/core/common/interceptors/check-security.interceptor.d.ts +1 -1
- package/dist/core/common/interceptors/check-security.interceptor.js +2 -2
- package/dist/core/common/interceptors/check-security.interceptor.js.map +1 -1
- package/dist/core/common/interfaces/server-options.interface.d.ts +28 -0
- package/dist/core/common/models/core-model.model.js.map +1 -1
- package/dist/core/common/models/core-persistence.model.js +3 -3
- package/dist/core/common/models/core-persistence.model.js.map +1 -1
- package/dist/core/common/pipes/map-and-validate.pipe.d.ts +1 -1
- package/dist/core/common/pipes/map-and-validate.pipe.js +1 -1
- package/dist/core/common/pipes/map-and-validate.pipe.js.map +1 -1
- package/dist/core/common/scalars/any.scalar.js +2 -2
- package/dist/core/common/scalars/any.scalar.js.map +1 -1
- package/dist/core/common/scalars/date-timestamp.scalar.js +1 -1
- package/dist/core/common/scalars/date-timestamp.scalar.js.map +1 -1
- package/dist/core/common/scalars/date.scalar.js +1 -1
- package/dist/core/common/scalars/date.scalar.js.map +1 -1
- package/dist/core/common/scalars/json.scalar.js +2 -2
- package/dist/core/common/scalars/json.scalar.js.map +1 -1
- package/dist/core/common/services/config.service.js +7 -7
- package/dist/core/common/services/config.service.js.map +1 -1
- package/dist/core/common/services/core-cron-jobs.service.js +5 -5
- package/dist/core/common/services/core-cron-jobs.service.js.map +1 -1
- package/dist/core/common/services/crud.service.js +1 -1
- package/dist/core/common/services/crud.service.js.map +1 -1
- package/dist/core/common/services/mailjet.service.js +5 -5
- package/dist/core/common/services/mailjet.service.js.map +1 -1
- package/dist/core/common/services/model-doc.service.d.ts +16 -0
- package/dist/core/common/services/model-doc.service.js +107 -0
- package/dist/core/common/services/model-doc.service.js.map +1 -0
- package/dist/core/common/services/module.service.js.map +1 -1
- package/dist/core/common/services/template.service.js +3 -3
- package/dist/core/common/services/template.service.js.map +1 -1
- package/dist/core/common/types/core-model-constructor.type.d.ts +2 -2
- package/dist/core/modules/auth/core-auth.module.js +3 -3
- package/dist/core/modules/auth/core-auth.module.js.map +1 -1
- package/dist/core/modules/auth/core-auth.resolver.js +5 -5
- package/dist/core/modules/auth/core-auth.resolver.js.map +1 -1
- package/dist/core/modules/auth/guards/auth.guard.js +4 -4
- package/dist/core/modules/auth/guards/auth.guard.js.map +1 -1
- package/dist/core/modules/auth/guards/roles.guard.js +1 -1
- package/dist/core/modules/auth/guards/roles.guard.js.map +1 -1
- package/dist/core/modules/auth/services/core-auth.service.js +5 -5
- package/dist/core/modules/auth/services/core-auth.service.js.map +1 -1
- package/dist/core/modules/auth/strategies/jwt.strategy.js.map +1 -1
- package/dist/core/modules/auth/tokens.decorator.js +2 -2
- package/dist/core/modules/auth/tokens.decorator.js.map +1 -1
- package/dist/core/modules/file/core-file-info.model.js +2 -2
- package/dist/core/modules/file/core-file-info.model.js.map +1 -1
- package/dist/core/modules/file/core-file.controller.d.ts +1 -2
- package/dist/core/modules/file/core-file.controller.js +3 -6
- package/dist/core/modules/file/core-file.controller.js.map +1 -1
- package/dist/core/modules/file/core-file.service.js +1 -1
- package/dist/core/modules/file/core-file.service.js.map +1 -1
- package/dist/core/modules/file/interfaces/file-upload.interface.d.ts +1 -1
- package/dist/core/modules/health-check/core-health-check-result.model.d.ts +8 -0
- package/dist/core/modules/health-check/core-health-check-result.model.js +53 -0
- package/dist/core/modules/health-check/core-health-check-result.model.js.map +1 -0
- package/dist/core/modules/health-check/core-health-check.controller.d.ts +6 -0
- package/dist/core/modules/health-check/core-health-check.controller.js +33 -0
- package/dist/core/modules/health-check/core-health-check.controller.js.map +1 -0
- package/dist/core/modules/health-check/core-health-check.module.d.ts +2 -0
- package/dist/core/modules/health-check/core-health-check.module.js +24 -0
- package/dist/core/modules/health-check/core-health-check.module.js.map +1 -0
- package/dist/core/modules/health-check/core-health-check.resolver.d.ts +6 -0
- package/dist/core/modules/health-check/core-health-check.resolver.js +38 -0
- package/dist/core/modules/health-check/core-health-check.resolver.js.map +1 -0
- package/dist/core/modules/health-check/core-health-check.service.d.ts +11 -0
- package/dist/core/modules/health-check/core-health-check.service.js +52 -0
- package/dist/core/modules/health-check/core-health-check.service.js.map +1 -0
- package/dist/core/modules/user/core-user.model.js +5 -5
- package/dist/core/modules/user/core-user.model.js.map +1 -1
- package/dist/core/modules/user/core-user.service.js +2 -2
- package/dist/core/modules/user/core-user.service.js.map +1 -1
- package/dist/core/modules/user/inputs/core-user.input.js +1 -1
- package/dist/core/modules/user/inputs/core-user.input.js.map +1 -1
- package/dist/core.module.js +14 -5
- package/dist/core.module.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/server/modules/auth/auth.service.js +1 -1
- package/dist/server/modules/auth/auth.service.js.map +1 -1
- package/dist/server/modules/file/file.controller.js +1 -1
- package/dist/server/modules/file/file.controller.js.map +1 -1
- package/dist/server/modules/file/file.resolver.js +2 -2
- package/dist/server/modules/file/file.resolver.js.map +1 -1
- package/dist/server/modules/file/file.service.js +1 -1
- package/dist/server/modules/file/file.service.js.map +1 -1
- package/dist/server/modules/file/multer-config.service.js +1 -1
- package/dist/server/modules/file/multer-config.service.js.map +1 -1
- package/dist/server/modules/user/avatar.controller.js +1 -1
- package/dist/server/modules/user/avatar.controller.js.map +1 -1
- package/dist/server/modules/user/user.resolver.js +1 -1
- package/dist/server/modules/user/user.resolver.js.map +1 -1
- package/dist/server/modules/user/user.service.js +3 -3
- package/dist/server/modules/user/user.service.js.map +1 -1
- package/dist/templates/index.ejs +2 -0
- package/dist/templates/password-reset.ejs +3 -0
- package/dist/templates/welcome.ejs +3 -0
- package/dist/test/test.helper.d.ts +1 -1
- package/dist/test/test.helper.js +7 -7
- package/dist/test/test.helper.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +32 -26
- package/src/config.env.ts +50 -20
- package/src/core/common/args/filter.args.ts +4 -4
- package/src/core/common/args/pagination.args.ts +7 -7
- package/src/core/common/decorators/graphql-service-options.decorator.ts +2 -2
- package/src/core/common/decorators/graphql-user.decorator.ts +1 -1
- package/src/core/common/decorators/rest-user.decorator.ts +1 -1
- package/src/core/common/decorators/restricted.decorator.ts +18 -18
- package/src/core/common/filters/http-exception-log.filter.ts +4 -4
- package/src/core/common/helpers/db.helper.ts +35 -40
- package/src/core/common/helpers/decorator.helper.ts +1 -1
- package/src/core/common/helpers/file.helper.ts +2 -2
- package/src/core/common/helpers/filter.helper.ts +7 -8
- package/src/core/common/helpers/graphql.helper.ts +6 -6
- package/src/core/common/helpers/input.helper.ts +54 -61
- package/src/core/common/helpers/model.helper.ts +33 -41
- package/src/core/common/helpers/service.helper.ts +8 -8
- package/src/core/common/inputs/combined-filter.input.ts +4 -4
- package/src/core/common/inputs/core-input.input.ts +2 -2
- package/src/core/common/inputs/filter.input.ts +4 -4
- package/src/core/common/inputs/single-filter.input.ts +4 -4
- package/src/core/common/inputs/sort.input.ts +1 -1
- package/src/core/common/interceptors/check-response.interceptor.ts +1 -1
- package/src/core/common/interceptors/check-security.interceptor.ts +5 -5
- package/src/core/common/interfaces/server-options.interface.ts +109 -0
- package/src/core/common/models/core-model.model.ts +6 -4
- package/src/core/common/models/core-persistence.model.ts +3 -3
- package/src/core/common/pipes/map-and-validate.pipe.ts +2 -2
- package/src/core/common/scalars/any.scalar.ts +2 -2
- package/src/core/common/scalars/date-timestamp.scalar.ts +1 -2
- package/src/core/common/scalars/date.scalar.ts +1 -2
- package/src/core/common/scalars/json.scalar.ts +4 -4
- package/src/core/common/services/config.service.ts +16 -16
- package/src/core/common/services/core-cron-jobs.service.ts +7 -7
- package/src/core/common/services/crud.service.ts +22 -22
- package/src/core/common/services/email.service.ts +1 -1
- package/src/core/common/services/mailjet.service.ts +8 -8
- package/src/core/common/services/model-doc.service.ts +140 -0
- package/src/core/common/services/module.service.ts +5 -6
- package/src/core/common/services/template.service.ts +4 -4
- package/src/core/common/types/core-model-constructor.type.ts +2 -2
- package/src/core/modules/auth/core-auth.controller.ts +2 -2
- package/src/core/modules/auth/core-auth.module.ts +4 -4
- package/src/core/modules/auth/core-auth.resolver.ts +9 -9
- package/src/core/modules/auth/guards/auth.guard.ts +8 -7
- package/src/core/modules/auth/guards/roles.guard.ts +1 -1
- package/src/core/modules/auth/services/core-auth.service.ts +9 -9
- package/src/core/modules/auth/strategies/jwt-refresh.strategy.ts +1 -1
- package/src/core/modules/auth/strategies/jwt.strategy.ts +1 -1
- package/src/core/modules/auth/tokens.decorator.ts +6 -7
- package/src/core/modules/file/core-file-info.model.ts +2 -2
- package/src/core/modules/file/core-file.controller.ts +2 -4
- package/src/core/modules/file/core-file.service.ts +6 -5
- package/src/core/modules/file/interfaces/file-upload.interface.ts +1 -1
- package/src/core/modules/health-check/core-health-check-result.model.ts +46 -0
- package/src/core/modules/health-check/core-health-check.controller.ts +24 -0
- package/src/core/modules/health-check/core-health-check.module.ts +17 -0
- package/src/core/modules/health-check/core-health-check.resolver.ts +32 -0
- package/src/core/modules/health-check/core-health-check.service.ts +62 -0
- package/src/core/modules/user/core-user.model.ts +6 -6
- package/src/core/modules/user/core-user.service.ts +10 -9
- package/src/core/modules/user/inputs/core-user.input.ts +1 -2
- package/src/core.module.ts +23 -12
- package/src/index.ts +11 -0
- package/src/main.ts +2 -2
- package/src/server/modules/auth/auth.controller.ts +1 -1
- package/src/server/modules/auth/auth.resolver.ts +3 -3
- package/src/server/modules/auth/auth.service.ts +2 -2
- package/src/server/modules/file/file.controller.ts +1 -2
- package/src/server/modules/file/file.module.ts +1 -1
- package/src/server/modules/file/file.resolver.ts +4 -3
- package/src/server/modules/file/file.service.ts +1 -1
- package/src/server/modules/file/multer-config.service.ts +1 -1
- package/src/server/modules/user/avatar.controller.ts +3 -3
- package/src/server/modules/user/user.model.ts +1 -1
- package/src/server/modules/user/user.resolver.ts +4 -4
- package/src/server/modules/user/user.service.ts +4 -4
- package/src/test/test.helper.ts +11 -11
|
@@ -17,7 +17,7 @@ export class ModelHelper {
|
|
|
17
17
|
cloneDeep?: boolean;
|
|
18
18
|
funcAllowed?: boolean;
|
|
19
19
|
mapId?: boolean;
|
|
20
|
-
} = {}
|
|
20
|
+
} = {},
|
|
21
21
|
): Partial<T> | Record<string, any> {
|
|
22
22
|
return prepareMap(source, target, options);
|
|
23
23
|
}
|
|
@@ -32,7 +32,7 @@ export class ModelHelper {
|
|
|
32
32
|
cloneDeep?: boolean;
|
|
33
33
|
funcAllowed?: boolean;
|
|
34
34
|
mapId?: boolean;
|
|
35
|
-
} = {}
|
|
35
|
+
} = {},
|
|
36
36
|
): T {
|
|
37
37
|
return map(source, target, options);
|
|
38
38
|
}
|
|
@@ -43,7 +43,7 @@ export class ModelHelper {
|
|
|
43
43
|
public static maps<T = Record<string, any>>(
|
|
44
44
|
data: Partial<T> | Partial<T>[] | Record<string, any> | Record<string, any>[],
|
|
45
45
|
targetClass: new (...args: any[]) => T,
|
|
46
|
-
cloneDeep = true
|
|
46
|
+
cloneDeep = true,
|
|
47
47
|
): T[] {
|
|
48
48
|
return maps(data, targetClass, cloneDeep);
|
|
49
49
|
}
|
|
@@ -61,7 +61,7 @@ export function prepareMap<T = Record<string, any>>(
|
|
|
61
61
|
funcAllowed?: boolean;
|
|
62
62
|
mapId?: boolean;
|
|
63
63
|
proto?: boolean;
|
|
64
|
-
} = {}
|
|
64
|
+
} = {},
|
|
65
65
|
): Partial<T> | Record<string, any> {
|
|
66
66
|
// Set config
|
|
67
67
|
const config = {
|
|
@@ -79,12 +79,12 @@ export function prepareMap<T = Record<string, any>>(
|
|
|
79
79
|
// Update properties
|
|
80
80
|
for (const key of Object.keys(target)) {
|
|
81
81
|
if (
|
|
82
|
-
(!['id', '_id'].includes(key) || config.mapId)
|
|
83
|
-
source[key] !== undefined
|
|
84
|
-
(config.funcAllowed || typeof (source[key] !== 'function'))
|
|
82
|
+
(!['id', '_id'].includes(key) || config.mapId)
|
|
83
|
+
&& source[key] !== undefined
|
|
84
|
+
&& (config.funcAllowed || typeof (source[key] !== 'function'))
|
|
85
85
|
) {
|
|
86
|
-
result[key]
|
|
87
|
-
source[key] !== 'function' && config.cloneDeep
|
|
86
|
+
result[key]
|
|
87
|
+
= source[key] !== 'function' && config.cloneDeep
|
|
88
88
|
? clone(source[key], { circles: config.circles, proto: config.proto })
|
|
89
89
|
: source[key];
|
|
90
90
|
} else if (key === 'id' && !config.mapId) {
|
|
@@ -107,7 +107,7 @@ export function map<T = Record<string, any>>(
|
|
|
107
107
|
funcAllowed?: boolean;
|
|
108
108
|
mapId?: boolean;
|
|
109
109
|
proto?: boolean;
|
|
110
|
-
} = {}
|
|
110
|
+
} = {},
|
|
111
111
|
): T {
|
|
112
112
|
// Set config
|
|
113
113
|
const config = {
|
|
@@ -140,7 +140,7 @@ export function map<T = Record<string, any>>(
|
|
|
140
140
|
export function maps<T = Record<string, any>>(
|
|
141
141
|
data: Partial<T> | Partial<T>[] | Record<string, any> | Record<string, any>[],
|
|
142
142
|
targetClass: new (...args: any[]) => T,
|
|
143
|
-
cloneDeep = true
|
|
143
|
+
cloneDeep = true,
|
|
144
144
|
): T[] {
|
|
145
145
|
// Check data
|
|
146
146
|
if (!data || typeof data !== 'object') {
|
|
@@ -171,7 +171,7 @@ export function mapClasses<T = Record<string, any>>(
|
|
|
171
171
|
input: Record<string, any>,
|
|
172
172
|
mapping: Record<string, new (...args: any[]) => any>,
|
|
173
173
|
target?: T,
|
|
174
|
-
options?: { objectIdsToString?: boolean; removeUndefinedProperties?: boolean }
|
|
174
|
+
options?: { objectIdsToString?: boolean; removeUndefinedProperties?: boolean },
|
|
175
175
|
): T {
|
|
176
176
|
// Check params
|
|
177
177
|
if (!target) {
|
|
@@ -198,10 +198,9 @@ export function mapClasses<T = Record<string, any>>(
|
|
|
198
198
|
if (value === null) {
|
|
199
199
|
target[prop] = null;
|
|
200
200
|
continue;
|
|
201
|
-
}
|
|
202
201
|
|
|
203
|
-
|
|
204
|
-
else if (Array.isArray(value)) {
|
|
202
|
+
// Process array
|
|
203
|
+
} else if (Array.isArray(value)) {
|
|
205
204
|
const arr = [];
|
|
206
205
|
for (const item of value) {
|
|
207
206
|
if (item instanceof targetClass) {
|
|
@@ -219,15 +218,13 @@ export function mapClasses<T = Record<string, any>>(
|
|
|
219
218
|
}
|
|
220
219
|
}
|
|
221
220
|
target[prop] = arr as any;
|
|
222
|
-
}
|
|
223
221
|
|
|
224
|
-
|
|
225
|
-
else if (value instanceof Types.ObjectId) {
|
|
222
|
+
// Process ObjectId
|
|
223
|
+
} else if (value instanceof Types.ObjectId) {
|
|
226
224
|
target[prop] = config.objectIdsToString ? value.toHexString() : value;
|
|
227
|
-
}
|
|
228
225
|
|
|
229
|
-
|
|
230
|
-
else if (typeof value === 'object') {
|
|
226
|
+
// Process object
|
|
227
|
+
} else if (typeof value === 'object') {
|
|
231
228
|
if (value instanceof targetClass) {
|
|
232
229
|
target[prop] = value as any;
|
|
233
230
|
} else {
|
|
@@ -237,10 +234,9 @@ export function mapClasses<T = Record<string, any>>(
|
|
|
237
234
|
target[prop] = plainToInstance(targetClass, value) as any;
|
|
238
235
|
}
|
|
239
236
|
}
|
|
240
|
-
}
|
|
241
237
|
|
|
242
|
-
|
|
243
|
-
else if (!config.removeUndefinedProperties || value !== undefined) {
|
|
238
|
+
// Others
|
|
239
|
+
} else if (!config.removeUndefinedProperties || value !== undefined) {
|
|
244
240
|
target[prop] = value;
|
|
245
241
|
}
|
|
246
242
|
}
|
|
@@ -262,7 +258,7 @@ export async function mapClassesAsync<T = Record<string, any>>(
|
|
|
262
258
|
input: Record<string, any>,
|
|
263
259
|
mapping: Record<string, new (...args: any[]) => any>,
|
|
264
260
|
target?: T,
|
|
265
|
-
options?: { objectIdsToString?: boolean; removeUndefinedProperties?: boolean }
|
|
261
|
+
options?: { objectIdsToString?: boolean; removeUndefinedProperties?: boolean },
|
|
266
262
|
): Promise<T> {
|
|
267
263
|
// Check params
|
|
268
264
|
if (!target) {
|
|
@@ -289,10 +285,9 @@ export async function mapClassesAsync<T = Record<string, any>>(
|
|
|
289
285
|
if (value === null) {
|
|
290
286
|
target[prop] = null;
|
|
291
287
|
continue;
|
|
292
|
-
}
|
|
293
288
|
|
|
294
|
-
|
|
295
|
-
else if (Array.isArray(value)) {
|
|
289
|
+
// Process array
|
|
290
|
+
} else if (Array.isArray(value)) {
|
|
296
291
|
const arr = [];
|
|
297
292
|
for (const item of value) {
|
|
298
293
|
if (item instanceof targetClass) {
|
|
@@ -310,15 +305,13 @@ export async function mapClassesAsync<T = Record<string, any>>(
|
|
|
310
305
|
}
|
|
311
306
|
}
|
|
312
307
|
target[prop] = arr as any;
|
|
313
|
-
}
|
|
314
308
|
|
|
315
|
-
|
|
316
|
-
else if (value instanceof Types.ObjectId) {
|
|
309
|
+
// Process ObjectId
|
|
310
|
+
} else if (value instanceof Types.ObjectId) {
|
|
317
311
|
target[prop] = config.objectIdsToString ? value.toHexString() : value;
|
|
318
|
-
}
|
|
319
312
|
|
|
320
|
-
|
|
321
|
-
else if (typeof value === 'object') {
|
|
313
|
+
// Process object
|
|
314
|
+
} else if (typeof value === 'object') {
|
|
322
315
|
if (value instanceof targetClass) {
|
|
323
316
|
target[prop] = value as any;
|
|
324
317
|
} else {
|
|
@@ -328,10 +321,9 @@ export async function mapClassesAsync<T = Record<string, any>>(
|
|
|
328
321
|
target[prop] = plainToInstance(targetClass, value) as any;
|
|
329
322
|
}
|
|
330
323
|
}
|
|
331
|
-
}
|
|
332
324
|
|
|
333
|
-
|
|
334
|
-
else if (!config.removeUndefinedProperties || value !== undefined) {
|
|
325
|
+
// Others
|
|
326
|
+
} else if (!config.removeUndefinedProperties || value !== undefined) {
|
|
335
327
|
target[prop] = value;
|
|
336
328
|
}
|
|
337
329
|
}
|
|
@@ -347,14 +339,14 @@ export function mapInputClasses<T = Record<string, any>>(
|
|
|
347
339
|
input: Record<string, any>,
|
|
348
340
|
mapping: Record<string, new (...args: any[]) => any>,
|
|
349
341
|
target?: T,
|
|
350
|
-
options?: { objectIdsToString?: boolean; removeUndefinedProperties?: boolean }
|
|
342
|
+
options?: { objectIdsToString?: boolean; removeUndefinedProperties?: boolean },
|
|
351
343
|
) {
|
|
352
344
|
// Get config
|
|
353
345
|
const config = {
|
|
354
346
|
removeUndefinedProperties: true,
|
|
355
347
|
...options,
|
|
356
348
|
};
|
|
357
|
-
return mapClasses(input, mapping, target,
|
|
349
|
+
return mapClasses(input, mapping, target, config);
|
|
358
350
|
}
|
|
359
351
|
|
|
360
352
|
/**
|
|
@@ -364,12 +356,12 @@ export function mapInputClassesAsync<T = Record<string, any>>(
|
|
|
364
356
|
input: Record<string, any>,
|
|
365
357
|
mapping: Record<string, new (...args: any[]) => any>,
|
|
366
358
|
target?: T,
|
|
367
|
-
options?: { objectIdsToString?: boolean; removeUndefinedProperties?: boolean }
|
|
359
|
+
options?: { objectIdsToString?: boolean; removeUndefinedProperties?: boolean },
|
|
368
360
|
) {
|
|
369
361
|
// Get config
|
|
370
362
|
const config = {
|
|
371
363
|
removeUndefinedProperties: true,
|
|
372
364
|
...options,
|
|
373
365
|
};
|
|
374
|
-
return mapClassesAsync(input, mapping, target,
|
|
366
|
+
return mapClassesAsync(input, mapping, target, config);
|
|
375
367
|
}
|
|
@@ -33,7 +33,7 @@ export default class ServiceHelper {
|
|
|
33
33
|
removeUndefined?: boolean;
|
|
34
34
|
sha256?: boolean;
|
|
35
35
|
targetModel?: new (...args: any[]) => T;
|
|
36
|
-
} = {}
|
|
36
|
+
} = {},
|
|
37
37
|
): Promise<T> {
|
|
38
38
|
return prepareInput(input, currentUser, options);
|
|
39
39
|
}
|
|
@@ -51,7 +51,7 @@ export default class ServiceHelper {
|
|
|
51
51
|
removeSecrets?: boolean;
|
|
52
52
|
removeUndefined?: boolean;
|
|
53
53
|
targetModel?: new (...args: any[]) => T;
|
|
54
|
-
} = {}
|
|
54
|
+
} = {},
|
|
55
55
|
): Promise<T | T[] | any> {
|
|
56
56
|
return prepareOutput(output, options);
|
|
57
57
|
}
|
|
@@ -75,7 +75,7 @@ export async function prepareInput<T = any>(
|
|
|
75
75
|
removeUndefined?: boolean;
|
|
76
76
|
sha256?: boolean;
|
|
77
77
|
targetModel?: new (...args: any[]) => T;
|
|
78
|
-
} = {}
|
|
78
|
+
} = {},
|
|
79
79
|
): Promise<T> {
|
|
80
80
|
// Configuration
|
|
81
81
|
const config = {
|
|
@@ -127,7 +127,7 @@ export async function prepareInput<T = any>(
|
|
|
127
127
|
}
|
|
128
128
|
return property;
|
|
129
129
|
},
|
|
130
|
-
{ specialClasses: ['ObjectId'] }
|
|
130
|
+
{ specialClasses: ['ObjectId'] },
|
|
131
131
|
);
|
|
132
132
|
}
|
|
133
133
|
|
|
@@ -153,7 +153,7 @@ export async function prepareInput<T = any>(
|
|
|
153
153
|
const allowedRoles = _.intersection((input as Record<string, any>).roles, (currentUser as any).roles);
|
|
154
154
|
if (allowedRoles.length !== (input as Record<string, any>).roles.length) {
|
|
155
155
|
const missingRoles = _.difference((input as Record<string, any>).roles, (currentUser as any).roles);
|
|
156
|
-
throw new UnauthorizedException(
|
|
156
|
+
throw new UnauthorizedException(`Current user not allowed setting roles: ${missingRoles}`);
|
|
157
157
|
}
|
|
158
158
|
(input as Record<string, any>).roles = allowedRoles;
|
|
159
159
|
}
|
|
@@ -190,7 +190,7 @@ export async function prepareOutput<T = { [key: string]: any; map: (...args: any
|
|
|
190
190
|
removeSecrets?: boolean;
|
|
191
191
|
removeUndefined?: boolean;
|
|
192
192
|
targetModel?: new (...args: any[]) => T;
|
|
193
|
-
} = {}
|
|
193
|
+
} = {},
|
|
194
194
|
): Promise<T | T[] | any> {
|
|
195
195
|
// Configuration
|
|
196
196
|
const config = {
|
|
@@ -289,7 +289,7 @@ export function prepareServiceOptions(
|
|
|
289
289
|
proto?: boolean;
|
|
290
290
|
prepareInput?: PrepareInputOptions;
|
|
291
291
|
prepareOutput?: PrepareOutputOptions;
|
|
292
|
-
}
|
|
292
|
+
},
|
|
293
293
|
): ServiceOptions {
|
|
294
294
|
// Set default values
|
|
295
295
|
const config = {
|
|
@@ -322,7 +322,7 @@ export function prepareServiceOptions(
|
|
|
322
322
|
// Set subfield selection
|
|
323
323
|
if (config.subFieldSelection) {
|
|
324
324
|
if ((serviceOptions.fieldSelection as ResolveSelector)?.select) {
|
|
325
|
-
(serviceOptions.fieldSelection as ResolveSelector).select +=
|
|
325
|
+
(serviceOptions.fieldSelection as ResolveSelector).select += `.${config.subFieldSelection}`;
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
|
|
@@ -11,7 +11,7 @@ export class CombinedFilterInput extends CoreInput {
|
|
|
11
11
|
/**
|
|
12
12
|
* Logical Operator to combine filters
|
|
13
13
|
*/
|
|
14
|
-
@Field(
|
|
14
|
+
@Field(type => LogicalOperatorEnum, {
|
|
15
15
|
description: 'Logical Operator to combine filters',
|
|
16
16
|
})
|
|
17
17
|
logicalOperator: LogicalOperatorEnum = undefined;
|
|
@@ -19,7 +19,7 @@ export class CombinedFilterInput extends CoreInput {
|
|
|
19
19
|
/**
|
|
20
20
|
* Filters to combine via logical operator
|
|
21
21
|
*/
|
|
22
|
-
@Field(
|
|
22
|
+
@Field(type => [FilterInput], {
|
|
23
23
|
description: 'Filters to combine via logical operator',
|
|
24
24
|
})
|
|
25
25
|
filters: FilterInput[] = undefined;
|
|
@@ -37,11 +37,11 @@ export class CombinedFilterInput extends CoreInput {
|
|
|
37
37
|
cloneDeep?: boolean;
|
|
38
38
|
funcAllowed?: boolean;
|
|
39
39
|
mapId?: boolean;
|
|
40
|
-
} = {}
|
|
40
|
+
} = {},
|
|
41
41
|
): this {
|
|
42
42
|
super.map(data, options);
|
|
43
43
|
this.filters = maps(data.filters, FilterInput, options.cloneDeep);
|
|
44
|
-
Object.keys(this).forEach(
|
|
44
|
+
Object.keys(this).forEach(key => this[key] === undefined && delete this[key]);
|
|
45
45
|
return this;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -21,7 +21,7 @@ export abstract class CoreInput extends CoreModel {
|
|
|
21
21
|
cloneDeep?: boolean;
|
|
22
22
|
funcAllowed?: boolean;
|
|
23
23
|
mapId?: boolean;
|
|
24
|
-
} = {}
|
|
24
|
+
} = {},
|
|
25
25
|
): this {
|
|
26
26
|
const config = {
|
|
27
27
|
cloneDeep: false,
|
|
@@ -30,7 +30,7 @@ export abstract class CoreInput extends CoreModel {
|
|
|
30
30
|
...options,
|
|
31
31
|
};
|
|
32
32
|
const coreInput = map(data, this, config);
|
|
33
|
-
Object.keys(coreInput).forEach(
|
|
33
|
+
Object.keys(coreInput).forEach(key => coreInput[key] === undefined && delete coreInput[key]);
|
|
34
34
|
return coreInput;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -13,7 +13,7 @@ export class FilterInput extends CoreInput {
|
|
|
13
13
|
/**
|
|
14
14
|
* Combination of multiple filters via logical operator
|
|
15
15
|
*/
|
|
16
|
-
@Field(
|
|
16
|
+
@Field(type => CombinedFilterInput, {
|
|
17
17
|
description: 'Combination of multiple filters via logical operator',
|
|
18
18
|
nullable: true,
|
|
19
19
|
})
|
|
@@ -22,7 +22,7 @@ export class FilterInput extends CoreInput {
|
|
|
22
22
|
/**
|
|
23
23
|
* Filter for a single property
|
|
24
24
|
*/
|
|
25
|
-
@Field(
|
|
25
|
+
@Field(type => SingleFilterInput, {
|
|
26
26
|
description: 'Filter for a single property',
|
|
27
27
|
nullable: true,
|
|
28
28
|
})
|
|
@@ -41,12 +41,12 @@ export class FilterInput extends CoreInput {
|
|
|
41
41
|
cloneDeep?: boolean;
|
|
42
42
|
funcAllowed?: boolean;
|
|
43
43
|
mapId?: boolean;
|
|
44
|
-
} = {}
|
|
44
|
+
} = {},
|
|
45
45
|
): this {
|
|
46
46
|
super.map(data, options);
|
|
47
47
|
this.combinedFilter = data.combinedFilter ? CombinedFilterInput.map(data.combinedFilter, options) : undefined;
|
|
48
48
|
this.singleFilter = data.singleFilter ? SingleFilterInput.map(data.singleFilter, options) : undefined;
|
|
49
|
-
Object.keys(this).forEach(
|
|
49
|
+
Object.keys(this).forEach(key => this[key] === undefined && delete this[key]);
|
|
50
50
|
return this;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -44,7 +44,7 @@ export class SingleFilterInput extends CoreInput {
|
|
|
44
44
|
/**
|
|
45
45
|
* [Comparison operator](https://docs.mongodb.com/manual/reference/operator/query-comparison/)
|
|
46
46
|
*/
|
|
47
|
-
@Field(
|
|
47
|
+
@Field(type => ComparisonOperatorEnum, {
|
|
48
48
|
description: '[Comparison operator](https://docs.mongodb.com/manual/reference/operator/query-comparison/)',
|
|
49
49
|
})
|
|
50
50
|
operator: ComparisonOperatorEnum = undefined;
|
|
@@ -55,12 +55,12 @@ export class SingleFilterInput extends CoreInput {
|
|
|
55
55
|
*/
|
|
56
56
|
@Field({
|
|
57
57
|
description:
|
|
58
|
-
'[Options](https://docs.mongodb.com/manual/reference/operator/query/regex/#op._S_options) for '
|
|
59
|
-
'[REGEX](https://docs.mongodb.com/manual/reference/operator/query/regex/) operator',
|
|
58
|
+
'[Options](https://docs.mongodb.com/manual/reference/operator/query/regex/#op._S_options) for '
|
|
59
|
+
+ '[REGEX](https://docs.mongodb.com/manual/reference/operator/query/regex/) operator',
|
|
60
60
|
nullable: true,
|
|
61
61
|
})
|
|
62
62
|
options?: string = undefined;
|
|
63
63
|
|
|
64
|
-
@Field(
|
|
64
|
+
@Field(type => JSON, { description: 'Value of the property' })
|
|
65
65
|
value: any = undefined;
|
|
66
66
|
}
|
|
@@ -16,6 +16,6 @@ export class SortInput extends CoreInput {
|
|
|
16
16
|
/**
|
|
17
17
|
* SortInput order of the field
|
|
18
18
|
*/
|
|
19
|
-
@Field(
|
|
19
|
+
@Field(type => SortOrderEnum, { description: 'SortInput order of the field' })
|
|
20
20
|
order: SortOrderEnum = undefined;
|
|
21
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { map } from 'rxjs/operators';
|
|
4
4
|
import { getContextData } from '../helpers/context.helper';
|
|
@@ -33,7 +33,7 @@ export class CheckSecurityInterceptor implements NestInterceptor {
|
|
|
33
33
|
|
|
34
34
|
// Check if data is writeable (e.g. objects from direct access to json files via http are not writable)
|
|
35
35
|
if (data && typeof data === 'object') {
|
|
36
|
-
const writeable = !Object.keys(data).find(
|
|
36
|
+
const writeable = !Object.keys(data).find(key => !Object.getOwnPropertyDescriptor(data, key).writable);
|
|
37
37
|
if (!writeable) {
|
|
38
38
|
return data;
|
|
39
39
|
}
|
|
@@ -45,15 +45,15 @@ export class CheckSecurityInterceptor implements NestInterceptor {
|
|
|
45
45
|
(item) => {
|
|
46
46
|
if (!item || typeof item !== 'object' || typeof item.securityCheck !== 'function') {
|
|
47
47
|
if (Array.isArray(item)) {
|
|
48
|
-
return item.filter(
|
|
48
|
+
return item.filter(i => i !== undefined);
|
|
49
49
|
}
|
|
50
50
|
return item;
|
|
51
51
|
}
|
|
52
52
|
return item.securityCheck(user, force);
|
|
53
53
|
},
|
|
54
|
-
{ specialFunctions: ['securityCheck'] }
|
|
54
|
+
{ specialFunctions: ['securityCheck'] },
|
|
55
55
|
);
|
|
56
|
-
})
|
|
56
|
+
}),
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -8,6 +8,8 @@ import { CronExpression } from '@nestjs/schedule';
|
|
|
8
8
|
import compression from 'compression';
|
|
9
9
|
import { CollationOptions } from 'mongodb';
|
|
10
10
|
import * as SMTPTransport from 'nodemailer/lib/smtp-transport';
|
|
11
|
+
import { MongoosePingCheckSettings } from '@nestjs/terminus/dist/health-indicator/database/mongoose.health';
|
|
12
|
+
import { DiskHealthIndicatorOptions } from '@nestjs/terminus/dist/health-indicator/disk/disk-health-options.type';
|
|
11
13
|
import { Falsy } from '../types/falsy.type';
|
|
12
14
|
import { CronJobConfig } from './cron-job-config.interface';
|
|
13
15
|
import { MailjetOptions } from './mailjet-options.interface';
|
|
@@ -170,6 +172,107 @@ export interface IServerOptions {
|
|
|
170
172
|
options?: GqlModuleAsyncOptions;
|
|
171
173
|
};
|
|
172
174
|
|
|
175
|
+
/**
|
|
176
|
+
* Whether to activate health check endpoints
|
|
177
|
+
*/
|
|
178
|
+
healthCheck?: {
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Whether health check is enabled
|
|
182
|
+
*/
|
|
183
|
+
enabled?: boolean;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Configuration of single health checks
|
|
187
|
+
*/
|
|
188
|
+
configs?: {
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Configuration for database health check
|
|
192
|
+
*/
|
|
193
|
+
database?: {
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Whether to enable the database health check
|
|
197
|
+
*/
|
|
198
|
+
enabled?: boolean;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Key in result JSON
|
|
202
|
+
*/
|
|
203
|
+
key?: string;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Database health check options
|
|
207
|
+
*/
|
|
208
|
+
options?: MongoosePingCheckSettings;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Configuration for memory heap health check
|
|
213
|
+
*/
|
|
214
|
+
memoryHeap?: {
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Whether to enable the memory heap health check
|
|
218
|
+
*/
|
|
219
|
+
enabled?: boolean;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Key in result JSON
|
|
223
|
+
*/
|
|
224
|
+
key?: string;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Memory limit in bytes
|
|
228
|
+
*/
|
|
229
|
+
heapUsedThreshold?: number;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Configuration for memory resident set size health check
|
|
234
|
+
*/
|
|
235
|
+
memoryRss?: {
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Whether to enable the memory resident set size health check
|
|
239
|
+
*/
|
|
240
|
+
enabled?: boolean;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Key in result JSON
|
|
244
|
+
*/
|
|
245
|
+
key?: string;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Memory limit in bytes
|
|
249
|
+
*/
|
|
250
|
+
rssThreshold?: number;
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Configuration for disk space health check
|
|
255
|
+
*/
|
|
256
|
+
storage?: {
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Whether to enable the disk space health check
|
|
260
|
+
*/
|
|
261
|
+
enabled?: boolean;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Key in result JSON
|
|
265
|
+
*/
|
|
266
|
+
key?: string;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Disk health indicator options
|
|
270
|
+
*/
|
|
271
|
+
options?: DiskHealthIndicatorOptions;
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
|
|
173
276
|
/**
|
|
174
277
|
* Ignore selections in fieldSelection
|
|
175
278
|
* [ConfigService must be integrated in ModuleService]
|
|
@@ -218,6 +321,12 @@ export interface IServerOptions {
|
|
|
218
321
|
mongoose?: {
|
|
219
322
|
collation?: CollationOptions;
|
|
220
323
|
|
|
324
|
+
/**
|
|
325
|
+
* Whether to create SVG-Diagrams of mongoose models
|
|
326
|
+
* @beta
|
|
327
|
+
*/
|
|
328
|
+
modelDocumentation?: boolean;
|
|
329
|
+
|
|
221
330
|
/**
|
|
222
331
|
* Mongoose connection string
|
|
223
332
|
*/
|
|
@@ -32,7 +32,7 @@ export abstract class CoreModel {
|
|
|
32
32
|
init?: any;
|
|
33
33
|
item?: T;
|
|
34
34
|
mapId?: boolean;
|
|
35
|
-
} = {}
|
|
35
|
+
} = {},
|
|
36
36
|
): T {
|
|
37
37
|
const item = options.item || new this();
|
|
38
38
|
delete options.item;
|
|
@@ -57,7 +57,7 @@ export abstract class CoreModel {
|
|
|
57
57
|
init?: any;
|
|
58
58
|
item?: T;
|
|
59
59
|
mapId?: boolean;
|
|
60
|
-
} = {}
|
|
60
|
+
} = {},
|
|
61
61
|
): T {
|
|
62
62
|
const item = options.item || new this();
|
|
63
63
|
delete options.item;
|
|
@@ -68,6 +68,7 @@ export abstract class CoreModel {
|
|
|
68
68
|
* Initialize instance with default values instead of undefined
|
|
69
69
|
* Should be overwritten in child class to organize the defaults
|
|
70
70
|
*/
|
|
71
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
71
72
|
public init(...args: any[]): this {
|
|
72
73
|
return this;
|
|
73
74
|
}
|
|
@@ -83,7 +84,7 @@ export abstract class CoreModel {
|
|
|
83
84
|
funcAllowed?: boolean;
|
|
84
85
|
init?: any;
|
|
85
86
|
mapId?: boolean;
|
|
86
|
-
} = {}
|
|
87
|
+
} = {},
|
|
87
88
|
): this {
|
|
88
89
|
const config = {
|
|
89
90
|
cloneDeep: false,
|
|
@@ -114,7 +115,7 @@ export abstract class CoreModel {
|
|
|
114
115
|
funcAllowed?: boolean;
|
|
115
116
|
init?: any;
|
|
116
117
|
mapId?: boolean;
|
|
117
|
-
} = {}
|
|
118
|
+
} = {},
|
|
118
119
|
): this {
|
|
119
120
|
const config = {
|
|
120
121
|
cloneDeep: true,
|
|
@@ -129,6 +130,7 @@ export abstract class CoreModel {
|
|
|
129
130
|
/**
|
|
130
131
|
* Verification of the user's rights to access the properties of this object
|
|
131
132
|
*/
|
|
133
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
132
134
|
public securityCheck(user: any, force?: boolean): this {
|
|
133
135
|
return this;
|
|
134
136
|
}
|
|
@@ -36,7 +36,7 @@ export abstract class CorePersistenceModel extends CoreModel {
|
|
|
36
36
|
/**
|
|
37
37
|
* ID of the persistence object as string
|
|
38
38
|
*/
|
|
39
|
-
@Field(
|
|
39
|
+
@Field(type => ID, {
|
|
40
40
|
description: 'ID of the persistence object',
|
|
41
41
|
nullable: true,
|
|
42
42
|
})
|
|
@@ -52,7 +52,7 @@ export abstract class CorePersistenceModel extends CoreModel {
|
|
|
52
52
|
/**
|
|
53
53
|
* Labels of the object
|
|
54
54
|
*/
|
|
55
|
-
@Field(
|
|
55
|
+
@Field(type => [String], {
|
|
56
56
|
description: 'Labels of the object',
|
|
57
57
|
nullable: true,
|
|
58
58
|
})
|
|
@@ -62,7 +62,7 @@ export abstract class CorePersistenceModel extends CoreModel {
|
|
|
62
62
|
/**
|
|
63
63
|
* Tags for the object
|
|
64
64
|
*/
|
|
65
|
-
@Field(
|
|
65
|
+
@Field(type => [String], {
|
|
66
66
|
description: 'Tags for the object',
|
|
67
67
|
nullable: true,
|
|
68
68
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArgumentMetadata, BadRequestException, Injectable, PipeTransform } from '@nestjs/common';
|
|
2
2
|
import { plainToInstance } from 'class-transformer';
|
|
3
3
|
import { validate } from 'class-validator';
|
|
4
4
|
import { isBasicType } from '../helpers/input.helper';
|
|
@@ -24,7 +24,7 @@ export class MapAndValidatePipe implements PipeTransform {
|
|
|
24
24
|
// Validate
|
|
25
25
|
const errors = await validate(value, { forbidUnknownValues: false });
|
|
26
26
|
if (errors.length > 0) {
|
|
27
|
-
throw new BadRequestException(
|
|
27
|
+
throw new BadRequestException(`Input validation failed:${errors.join('; ')}`);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
return value;
|
|
@@ -4,7 +4,7 @@ import { Kind, ValueNode } from 'graphql';
|
|
|
4
4
|
/**
|
|
5
5
|
* Any scalar (is equivalent to the JSON scalar)
|
|
6
6
|
*/
|
|
7
|
-
@Scalar('Any',
|
|
7
|
+
@Scalar('Any', type => Any)
|
|
8
8
|
export class Any implements CustomScalar<string, any> {
|
|
9
9
|
/**
|
|
10
10
|
* Description of the scalar
|
|
@@ -45,7 +45,7 @@ export class Any implements CustomScalar<string, any> {
|
|
|
45
45
|
return value;
|
|
46
46
|
}
|
|
47
47
|
case Kind.LIST:
|
|
48
|
-
return ast.values.map(
|
|
48
|
+
return ast.values.map(n => this.parseLiteral(n, variables));
|
|
49
49
|
case Kind.NULL:
|
|
50
50
|
return null;
|
|
51
51
|
case Kind.VARIABLE: {
|