@goatlab/fluent 0.9.22 → 0.9.23
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/dist/BaseConnector.js +13 -13
- package/dist/TypeOrmConnector/TypeOrmConnector.d.ts +1 -1
- package/dist/TypeOrmConnector/TypeOrmConnector.js +23 -23
- package/dist/TypeOrmConnector/TypeOrmConnector.js.map +1 -1
- package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoBaseAggregations.d.ts +1 -1
- package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoBaseAggregations.js +33 -33
- package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoBaseAggregations.js.map +1 -1
- package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoFindAggregatedQuery.d.ts +1 -1
- package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoFindAggregatedQuery.js +5 -5
- package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoFindAggregatedQuery.js.map +1 -1
- package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoOrderBy.js +1 -1
- package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoWhere.d.ts +1 -1
- package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoWhere.js +2 -2
- package/dist/TypeOrmConnector/queryBuilder/mongodb/getMongoWhere.js.map +1 -1
- package/dist/TypeOrmConnector/queryBuilder/sql/getQueryBuilderWhere.d.ts +1 -1
- package/dist/TypeOrmConnector/queryBuilder/sql/getQueryBuilderWhere.js +28 -28
- package/dist/TypeOrmConnector/queryBuilder/sql/getQueryBuilderWhere.js.map +1 -1
- package/dist/TypeOrmConnector/queryBuilder/sql/getTypeOrmWhere.d.ts +1 -1
- package/dist/TypeOrmConnector/queryBuilder/sql/getTypeOrmWhere.js +23 -23
- package/dist/TypeOrmConnector/queryBuilder/sql/getTypeOrmWhere.js.map +1 -1
- package/dist/TypeOrmConnector/test/advanced/typeOrm.entity.js +3 -3
- package/dist/TypeOrmConnector/test/basic/goat.entity.js +3 -3
- package/dist/TypeOrmConnector/test/flock.js +6 -6
- package/dist/TypeOrmConnector/util/extractConditions.js +6 -6
- package/dist/TypeOrmConnector/util/extractMetadataFromKeys.js +2 -2
- package/dist/TypeOrmConnector/util/getRelationsFromModelGenerator.js +2 -2
- package/dist/core/Loopback/build-schema.js +7 -7
- package/dist/core/Loopback/common-types.js +3 -3
- package/dist/core/Loopback/common-types.js.map +1 -1
- package/dist/core/Loopback/json-to-schema.js +1 -1
- package/dist/core/Loopback/model.js +4 -4
- package/dist/core/Nestjs/types/decorators/api-property.decorator.js +5 -5
- package/dist/core/Nestjs/types/decorators/apply-is-optional.decorator.js +3 -3
- package/dist/core/Nestjs/types/decorators/args-type.decorator.js +1 -1
- package/dist/core/Nestjs/types/decorators/create-property.decorator.js +3 -3
- package/dist/core/Nestjs/types/decorators/directive.decorator.js +2 -2
- package/dist/core/Nestjs/types/decorators/extensions.decorator.js +2 -2
- package/dist/core/Nestjs/types/decorators/field.decorator.js +3 -3
- package/dist/core/Nestjs/types/decorators/input-type.decorator.js +1 -1
- package/dist/core/Nestjs/types/decorators/interface-type.decorator.js +1 -1
- package/dist/core/Nestjs/types/decorators/partial-type.helper.js +1 -1
- package/dist/core/Nestjs/types/lazy-metadata.storage.js +1 -1
- package/dist/core/Nestjs/types/object-type.decorator.js +1 -1
- package/dist/core/Nestjs/types/reflection.utils.js +4 -4
- package/dist/core/Nestjs/types/reflection.utils.js.map +1 -1
- package/dist/core/Nestjs/types/type-metadata.storage.js +5 -5
- package/dist/core/Nestjs/types/utils/get-fields-and-decorator.util.js +6 -6
- package/dist/core/Nestjs/types/utils/mapped-types.utils.js +2 -2
- package/dist/core/Nestjs/types/utils/mapped-types.utils.js.map +1 -1
- package/dist/decorators.d.ts +3 -3
- package/dist/decorators.js +17 -24
- package/dist/decorators.js.map +1 -1
- package/dist/generatorDatasource.js +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1 -1
- package/dist/loadRelations.d.ts +1 -1
- package/dist/loadRelations.js +15 -15
- package/dist/loadRelations.js.map +1 -1
- package/dist/testing/genericUnifiedTestSuite.js +20 -20
- package/dist/testing/unifiedTestFactory.js +25 -25
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +4 -4
|
@@ -16,11 +16,11 @@ const getRelationsFromModelGenerator = (typeOrmRepo) => {
|
|
|
16
16
|
tableName: relation.inverseEntityMetadata.tableName,
|
|
17
17
|
targetClass: relation.inverseEntityMetadata.target,
|
|
18
18
|
joinColumns: relation.joinColumns,
|
|
19
|
-
inverseJoinColumns: relation.inverseJoinColumns
|
|
19
|
+
inverseJoinColumns: relation.inverseJoinColumns,
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
return {
|
|
23
|
-
relations
|
|
23
|
+
relations,
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
exports.getRelationsFromModelGenerator = getRelationsFromModelGenerator;
|
|
@@ -41,7 +41,7 @@ function getJsonSchema(ctor, options) {
|
|
|
41
41
|
// In the near future the metadata will be an object with
|
|
42
42
|
// different titles as keys
|
|
43
43
|
const cached = metadata_1.MetadataInspector.getClassMetadata(exports.JSON_SCHEMA_KEY, ctor, {
|
|
44
|
-
ownMetadataOnly: true
|
|
44
|
+
ownMetadataOnly: true,
|
|
45
45
|
});
|
|
46
46
|
const key = buildModelCacheKey(options);
|
|
47
47
|
let schema = cached?.[key];
|
|
@@ -96,7 +96,7 @@ function getJsonSchemaRef(modelCtor, options) {
|
|
|
96
96
|
definitions[key] = schema;
|
|
97
97
|
return {
|
|
98
98
|
$ref: `#/definitions/${key}`,
|
|
99
|
-
definitions
|
|
99
|
+
definitions,
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
@@ -180,7 +180,7 @@ function metaToJsonProperty(meta) {
|
|
|
180
180
|
if (resolvedType === Date) {
|
|
181
181
|
Object.assign(propDef, {
|
|
182
182
|
type: 'string',
|
|
183
|
-
format: 'date-time'
|
|
183
|
+
format: 'date-time',
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
186
|
else if (propertyType === 'any') {
|
|
@@ -188,7 +188,7 @@ function metaToJsonProperty(meta) {
|
|
|
188
188
|
}
|
|
189
189
|
else if ((0, type_resolver_1.isBuiltinType)(resolvedType)) {
|
|
190
190
|
Object.assign(propDef, {
|
|
191
|
-
type: resolvedType.name.toLowerCase()
|
|
191
|
+
type: resolvedType.name.toLowerCase(),
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
194
|
else {
|
|
@@ -196,7 +196,7 @@ function metaToJsonProperty(meta) {
|
|
|
196
196
|
}
|
|
197
197
|
if (meta.description) {
|
|
198
198
|
Object.assign(propDef, {
|
|
199
|
-
description: meta.description
|
|
199
|
+
description: meta.description,
|
|
200
200
|
});
|
|
201
201
|
}
|
|
202
202
|
if (meta.jsonSchema) {
|
|
@@ -214,7 +214,7 @@ function getNavigationalPropertyForRelation(relMeta, targetRef) {
|
|
|
214
214
|
// Targets an array of object, like, hasMany
|
|
215
215
|
return {
|
|
216
216
|
type: 'array',
|
|
217
|
-
items: targetRef
|
|
217
|
+
items: targetRef,
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
220
|
if (relMeta.targetsMany === false) {
|
|
@@ -256,7 +256,7 @@ function stringifyOptions(modelSettings = {}) {
|
|
|
256
256
|
return (0, node_util_1.inspect)(modelSettings, {
|
|
257
257
|
depth: Number.POSITIVE_INFINITY,
|
|
258
258
|
maxArrayLength: Number.POSITIVE_INFINITY,
|
|
259
|
-
breakLength: Number.POSITIVE_INFINITY
|
|
259
|
+
breakLength: Number.POSITIVE_INFINITY,
|
|
260
260
|
});
|
|
261
261
|
}
|
|
262
262
|
function isEmptyJson(obj) {
|
|
@@ -17,8 +17,8 @@ exports.CountSchema /* :SchemaObject */ = {
|
|
|
17
17
|
'x-typescript-type': '@loopback/repository#Count',
|
|
18
18
|
properties: {
|
|
19
19
|
count: {
|
|
20
|
-
type: 'number' // Force to be `number` type instead of `string`
|
|
21
|
-
}
|
|
22
|
-
}
|
|
20
|
+
type: 'number', // Force to be `number` type instead of `string`
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=common-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-types.js","sourceRoot":"","sources":["../../../src/core/Loopback/common-types.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,oCAAoC;AACpC,+CAA+C;AAC/C,gEAAgE;;;AA2FhE;;;;;GAKG;AACU,QAAA,WAAW,CAAC,mBAAmB,GAAG;IAC7C,IAAI,EAAE,QAAiB,EAAE,gDAAgD;IACzE,KAAK,EAAE,gBAAgB;IACvB,mBAAmB,EAAE,4BAA4B;IACjD,UAAU,EAAE;QACV,KAAK,EAAE;YACL,IAAI,EAAE,QAAiB,
|
|
1
|
+
{"version":3,"file":"common-types.js","sourceRoot":"","sources":["../../../src/core/Loopback/common-types.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,oCAAoC;AACpC,+CAA+C;AAC/C,gEAAgE;;;AA2FhE;;;;;GAKG;AACU,QAAA,WAAW,CAAC,mBAAmB,GAAG;IAC7C,IAAI,EAAE,QAAiB,EAAE,gDAAgD;IACzE,KAAK,EAAE,gBAAgB;IACvB,mBAAmB,EAAE,4BAA4B;IACjD,UAAU,EAAE;QACV,KAAK,EAAE;YACL,IAAI,EAAE,QAAiB,EAAE,gDAAgD;SAC1E;KACF;CACF,CAAA"}
|
|
@@ -72,7 +72,7 @@ class ModelDefinition {
|
|
|
72
72
|
...definition,
|
|
73
73
|
name,
|
|
74
74
|
type: relation_types_1.RelationType.belongsTo,
|
|
75
|
-
targetsMany: false
|
|
75
|
+
targetsMany: false,
|
|
76
76
|
};
|
|
77
77
|
return this.addRelation(meta);
|
|
78
78
|
}
|
|
@@ -86,7 +86,7 @@ class ModelDefinition {
|
|
|
86
86
|
...definition,
|
|
87
87
|
name,
|
|
88
88
|
type: relation_types_1.RelationType.hasOne,
|
|
89
|
-
targetsMany: false
|
|
89
|
+
targetsMany: false,
|
|
90
90
|
};
|
|
91
91
|
return this.addRelation(meta);
|
|
92
92
|
}
|
|
@@ -100,7 +100,7 @@ class ModelDefinition {
|
|
|
100
100
|
...definition,
|
|
101
101
|
name,
|
|
102
102
|
type: relation_types_1.RelationType.hasMany,
|
|
103
|
-
targetsMany: true
|
|
103
|
+
targetsMany: true,
|
|
104
104
|
};
|
|
105
105
|
return this.addRelation(meta);
|
|
106
106
|
}
|
|
@@ -246,7 +246,7 @@ class Model {
|
|
|
246
246
|
if (relName in this) {
|
|
247
247
|
obj[relName] = asObject(this[relName], {
|
|
248
248
|
...options,
|
|
249
|
-
ignoreUnknownProperties: false
|
|
249
|
+
ignoreUnknownProperties: false,
|
|
250
250
|
});
|
|
251
251
|
}
|
|
252
252
|
}
|
|
@@ -22,7 +22,7 @@ exports.DECORATORS = {
|
|
|
22
22
|
API_EXCLUDE_ENDPOINT: `${exports.DECORATORS_PREFIX}/apiExcludeEndpoint`,
|
|
23
23
|
API_EXCLUDE_CONTROLLER: `${exports.DECORATORS_PREFIX}/apiExcludeController`,
|
|
24
24
|
API_EXTRA_MODELS: `${exports.DECORATORS_PREFIX}/apiExtraModels`,
|
|
25
|
-
API_EXTENSION: `${exports.DECORATORS_PREFIX}/apiExtension
|
|
25
|
+
API_EXTENSION: `${exports.DECORATORS_PREFIX}/apiExtension`,
|
|
26
26
|
};
|
|
27
27
|
const isEnumArray = (obj) => obj.isArray && !!obj.enum;
|
|
28
28
|
function ApiProperty(options = {}) {
|
|
@@ -33,14 +33,14 @@ function createApiPropertyDecorator(options = {}, overrideExisting = true) {
|
|
|
33
33
|
options = {
|
|
34
34
|
...options,
|
|
35
35
|
type,
|
|
36
|
-
isArray
|
|
36
|
+
isArray,
|
|
37
37
|
};
|
|
38
38
|
if (isEnumArray(options)) {
|
|
39
39
|
options.type = 'array';
|
|
40
40
|
const enumValues = (0, enum_utils_1.getEnumValues)(options.enum);
|
|
41
41
|
options.items = {
|
|
42
42
|
type: (0, enum_utils_1.getEnumType)(enumValues),
|
|
43
|
-
enum: enumValues
|
|
43
|
+
enum: enumValues,
|
|
44
44
|
};
|
|
45
45
|
options.enum = undefined;
|
|
46
46
|
}
|
|
@@ -54,13 +54,13 @@ function createApiPropertyDecorator(options = {}, overrideExisting = true) {
|
|
|
54
54
|
function ApiPropertyOptional(options = {}) {
|
|
55
55
|
return ApiProperty({
|
|
56
56
|
...options,
|
|
57
|
-
required: false
|
|
57
|
+
required: false,
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
function ApiResponseProperty(options = {}) {
|
|
61
61
|
return ApiProperty({
|
|
62
62
|
readOnly: true,
|
|
63
|
-
...options
|
|
63
|
+
...options,
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
//# sourceMappingURL=api-property.decorator.js.map
|
|
@@ -32,7 +32,7 @@ function inheritValidationMetadata(parentClass, targetClass, isPropertyInherited
|
|
|
32
32
|
}
|
|
33
33
|
metadataStorage.addValidationMetadata({
|
|
34
34
|
...value,
|
|
35
|
-
target: targetClass
|
|
35
|
+
target: targetClass,
|
|
36
36
|
});
|
|
37
37
|
return value.propertyName;
|
|
38
38
|
});
|
|
@@ -51,7 +51,7 @@ function inheritTransformationMetadata(parentClass, targetClass, isPropertyInher
|
|
|
51
51
|
'_excludeMetadatas',
|
|
52
52
|
'_exposeMetadatas',
|
|
53
53
|
'_transformMetadatas',
|
|
54
|
-
'_typeMetadatas'
|
|
54
|
+
'_typeMetadatas',
|
|
55
55
|
];
|
|
56
56
|
transformMetadataKeys.forEach(key => inheritTransformerMetadata(key, parentClass, targetClass, isPropertyInherited));
|
|
57
57
|
}
|
|
@@ -82,7 +82,7 @@ function inheritTransformerMetadata(key, parentClass, targetClass, isPropertyInh
|
|
|
82
82
|
// "_transformMetadatas" is an array of elements
|
|
83
83
|
const targetMetadata = metadata.map(item => ({
|
|
84
84
|
...item,
|
|
85
|
-
target: targetClass
|
|
85
|
+
target: targetClass,
|
|
86
86
|
}));
|
|
87
87
|
return [key, targetMetadata];
|
|
88
88
|
}
|
|
@@ -12,7 +12,7 @@ function ArgsType() {
|
|
|
12
12
|
return (target) => {
|
|
13
13
|
const metadata = {
|
|
14
14
|
name: target.name,
|
|
15
|
-
target: target
|
|
15
|
+
target: target,
|
|
16
16
|
};
|
|
17
17
|
lazy_metadata_storage_1.LazyMetadataStorage.store(() => type_metadata_storage_1.TypeMetadataStorage.addArgsMetadata(metadata));
|
|
18
18
|
// This function must be called eagerly to allow resolvers
|
|
@@ -23,11 +23,11 @@ function createPropertyDecorator(metakey, metadata, overrideExisting = true) {
|
|
|
23
23
|
const metadataToSave = overrideExisting
|
|
24
24
|
? {
|
|
25
25
|
...existingMetadata,
|
|
26
|
-
...newMetadata
|
|
26
|
+
...newMetadata,
|
|
27
27
|
}
|
|
28
28
|
: {
|
|
29
29
|
...newMetadata,
|
|
30
|
-
...existingMetadata
|
|
30
|
+
...existingMetadata,
|
|
31
31
|
};
|
|
32
32
|
Reflect.defineMetadata(metakey, metadataToSave, target, propertyKey);
|
|
33
33
|
}
|
|
@@ -36,7 +36,7 @@ function createPropertyDecorator(metakey, metadata, overrideExisting = true) {
|
|
|
36
36
|
Reflect.getMetadata('design:type', target, propertyKey);
|
|
37
37
|
Reflect.defineMetadata(metakey, {
|
|
38
38
|
type,
|
|
39
|
-
...OmitBy(metadata, isUndefined)
|
|
39
|
+
...OmitBy(metadata, isUndefined),
|
|
40
40
|
}, target, propertyKey);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
@@ -16,13 +16,13 @@ function Directive(sdl) {
|
|
|
16
16
|
type_metadata_storage_1.TypeMetadataStorage.addDirectivePropertyMetadata({
|
|
17
17
|
target: target.constructor,
|
|
18
18
|
fieldName: key,
|
|
19
|
-
sdl
|
|
19
|
+
sdl,
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
else {
|
|
23
23
|
type_metadata_storage_1.TypeMetadataStorage.addDirectiveMetadata({
|
|
24
24
|
target: target,
|
|
25
|
-
sdl
|
|
25
|
+
sdl,
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
});
|
|
@@ -13,13 +13,13 @@ function Extensions(value) {
|
|
|
13
13
|
type_metadata_storage_1.TypeMetadataStorage.addExtensionsPropertyMetadata({
|
|
14
14
|
target: target.constructor,
|
|
15
15
|
fieldName: propertyKey,
|
|
16
|
-
value
|
|
16
|
+
value,
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
else {
|
|
20
20
|
type_metadata_storage_1.TypeMetadataStorage.addExtensionsMetadata({
|
|
21
21
|
target: target,
|
|
22
|
-
value
|
|
22
|
+
value,
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
});
|
|
@@ -30,7 +30,7 @@ function addFieldMetadata(typeOrOptions, fieldOptions, prototype, propertyKey, d
|
|
|
30
30
|
prototype,
|
|
31
31
|
propertyKey: propertyKey || '',
|
|
32
32
|
explicitTypeFn: typeFunc,
|
|
33
|
-
typeOptions: options
|
|
33
|
+
typeOptions: options,
|
|
34
34
|
});
|
|
35
35
|
type_metadata_storage_1.TypeMetadataStorage.addClassFieldMetadata({
|
|
36
36
|
name: propertyKey || '',
|
|
@@ -41,7 +41,7 @@ function addFieldMetadata(typeOrOptions, fieldOptions, prototype, propertyKey, d
|
|
|
41
41
|
description: options.description,
|
|
42
42
|
deprecationReason: options.deprecationReason,
|
|
43
43
|
complexity: options.complexity,
|
|
44
|
-
middleware: options.middleware
|
|
44
|
+
middleware: options.middleware,
|
|
45
45
|
});
|
|
46
46
|
if (isResolver) {
|
|
47
47
|
type_metadata_storage_1.TypeMetadataStorage.addResolverPropertyMetadata({
|
|
@@ -49,7 +49,7 @@ function addFieldMetadata(typeOrOptions, fieldOptions, prototype, propertyKey, d
|
|
|
49
49
|
methodName: propertyKey || '',
|
|
50
50
|
schemaName: options.name || propertyKey,
|
|
51
51
|
target: prototype?.constructor,
|
|
52
|
-
complexity: options.complexity
|
|
52
|
+
complexity: options.complexity,
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
};
|
|
@@ -20,7 +20,7 @@ function InputType(nameOrOptions, inputTypeOptions) {
|
|
|
20
20
|
target: target,
|
|
21
21
|
name: name || target.name,
|
|
22
22
|
description: options.description,
|
|
23
|
-
isAbstract: options.isAbstract
|
|
23
|
+
isAbstract: options.isAbstract,
|
|
24
24
|
};
|
|
25
25
|
lazy_metadata_storage_1.LazyMetadataStorage.store(() => type_metadata_storage_1.TypeMetadataStorage.addInputTypeMetadata(metadata));
|
|
26
26
|
(0, add_class_type_metadata_util_1.addClassTypeMetadata)(target, common_1.ClassType.Input);
|
|
@@ -21,7 +21,7 @@ function InterfaceType(nameOrOptions, interfaceOptions) {
|
|
|
21
21
|
name: name || target.name,
|
|
22
22
|
target: target,
|
|
23
23
|
...options,
|
|
24
|
-
interfaces: options.implements
|
|
24
|
+
interfaces: options.implements,
|
|
25
25
|
};
|
|
26
26
|
type_metadata_storage_1.TypeMetadataStorage.addInterfaceMetadata(metadata);
|
|
27
27
|
};
|
|
@@ -39,7 +39,7 @@ function PartialType(classRef, decorator) {
|
|
|
39
39
|
pluginFields.forEach(key => (0, apply_is_optional_decorator_1.applyIsOptionalDecorator)(PartialObjectType, key));
|
|
40
40
|
}
|
|
41
41
|
Object.defineProperty(PartialObjectType, 'name', {
|
|
42
|
-
value: `Partial${classRef.name}
|
|
42
|
+
value: `Partial${classRef.name}`,
|
|
43
43
|
});
|
|
44
44
|
return PartialObjectType;
|
|
45
45
|
}
|
|
@@ -21,7 +21,7 @@ function ObjectType(nameOrOptions, objectTypeOptions) {
|
|
|
21
21
|
target: target,
|
|
22
22
|
description: options.description,
|
|
23
23
|
interfaces: options.implements,
|
|
24
|
-
isAbstract: options.isAbstract
|
|
24
|
+
isAbstract: options.isAbstract,
|
|
25
25
|
});
|
|
26
26
|
// This function must be called eagerly to allow resolvers
|
|
27
27
|
// accessing the "name" property
|
|
@@ -12,7 +12,7 @@ const get = (obj, path, defaultValue = undefined) => {
|
|
|
12
12
|
};
|
|
13
13
|
const NOT_ALLOWED_TYPES = [Promise, Array, Object, Function];
|
|
14
14
|
function reflectTypeFromMetadata(reflectOptions) {
|
|
15
|
-
const { metadataKey, prototype, propertyKey, explicitTypeFn, typeOptions = {}, index } = reflectOptions;
|
|
15
|
+
const { metadataKey, prototype, propertyKey, explicitTypeFn, typeOptions = {}, index, } = reflectOptions;
|
|
16
16
|
const options = { ...typeOptions };
|
|
17
17
|
const reflectedType = Reflect.getMetadata(metadataKey, prototype, propertyKey);
|
|
18
18
|
const implicitType = extractTypeIfArray(metadataKey, reflectedType, index);
|
|
@@ -24,7 +24,7 @@ function reflectTypeFromMetadata(reflectOptions) {
|
|
|
24
24
|
if (explicitTypeFn) {
|
|
25
25
|
return {
|
|
26
26
|
typeFn: createWrappedExplicitTypeFn(explicitTypeFn, options),
|
|
27
|
-
options
|
|
27
|
+
options,
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
return {
|
|
@@ -33,9 +33,9 @@ function reflectTypeFromMetadata(reflectOptions) {
|
|
|
33
33
|
? {
|
|
34
34
|
...options,
|
|
35
35
|
isArray: true,
|
|
36
|
-
arrayDepth: 1
|
|
36
|
+
arrayDepth: 1,
|
|
37
37
|
}
|
|
38
|
-
: options
|
|
38
|
+
: options,
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
function extractTypeIfArray(metadataKey, reflectedType, index) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflection.utils.js","sourceRoot":"","sources":["../../../../src/core/Nestjs/types/reflection.utils.ts"],"names":[],"mappings":";;AAqCA,0DAgDC;AApFD,wEAAkE;AAOlE,MAAM,GAAG,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,YAAY,GAAG,SAAS,EAAE,EAAE;IAClD,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,CACtB,MAAM,CAAC,SAAS,CAAC,KAAK;SACnB,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC;SAClB,MAAM,CAAC,OAAO,CAAC;SACf,MAAM,CACL,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAClE,GAAG,CACJ,CAAA;IACL,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,WAAW,CAAC,CAAA;IACxD,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAA;AACvE,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAgB,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAA;AAgBzE,SAAgB,uBAAuB,CACrC,cAAkC;IAElC,MAAM,EACJ,WAAW,EACX,SAAS,EACT,WAAW,EACX,cAAc,EACd,WAAW,GAAG,EAAE,EAChB,KAAK,
|
|
1
|
+
{"version":3,"file":"reflection.utils.js","sourceRoot":"","sources":["../../../../src/core/Nestjs/types/reflection.utils.ts"],"names":[],"mappings":"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"}
|
|
@@ -149,7 +149,7 @@ class TypeMetadataStorageHost {
|
|
|
149
149
|
...this.objectTypes,
|
|
150
150
|
...this.inputTypes,
|
|
151
151
|
...this.argumentTypes,
|
|
152
|
-
...this.interfaces
|
|
152
|
+
...this.interfaces,
|
|
153
153
|
];
|
|
154
154
|
this.loadClassPluginMetadata(classMetadata);
|
|
155
155
|
this.compileClassMetadata(classMetadata);
|
|
@@ -157,7 +157,7 @@ class TypeMetadataStorageHost {
|
|
|
157
157
|
const resolversMetadata = [
|
|
158
158
|
...this.queries,
|
|
159
159
|
...this.mutations,
|
|
160
|
-
...this.subscriptions
|
|
160
|
+
...this.subscriptions,
|
|
161
161
|
];
|
|
162
162
|
this.compileResolversMetadata(resolversMetadata);
|
|
163
163
|
this.compileExtendedResolversMetadata();
|
|
@@ -290,7 +290,7 @@ class TypeMetadataStorageHost {
|
|
|
290
290
|
methodArgs: item.methodArgs,
|
|
291
291
|
directives: item.directives,
|
|
292
292
|
extensions: item.extensions,
|
|
293
|
-
complexity: item.complexity
|
|
293
|
+
complexity: item.complexity,
|
|
294
294
|
};
|
|
295
295
|
this.addClassFieldMetadata(fieldMetadata);
|
|
296
296
|
objectOrInterfaceTypeMetadata.properties?.push(fieldMetadata);
|
|
@@ -337,7 +337,7 @@ class TypeMetadataStorageHost {
|
|
|
337
337
|
: {
|
|
338
338
|
...metadata,
|
|
339
339
|
target: classMetadata.target,
|
|
340
|
-
classMetadata
|
|
340
|
+
classMetadata,
|
|
341
341
|
});
|
|
342
342
|
return mergedMetadata;
|
|
343
343
|
}
|
|
@@ -349,7 +349,7 @@ class TypeMetadataStorageHost {
|
|
|
349
349
|
...metadata,
|
|
350
350
|
objectTypeFn: (0, common_1.isThrowing)(metadata.objectTypeFn)
|
|
351
351
|
? classMetadata.typeFn
|
|
352
|
-
: metadata.objectTypeFn
|
|
352
|
+
: metadata.objectTypeFn,
|
|
353
353
|
});
|
|
354
354
|
return mergedMetadata;
|
|
355
355
|
}
|
|
@@ -17,7 +17,7 @@ function getFieldsAndDecoratorForType(objType) {
|
|
|
17
17
|
throw new unable_to_find_fields_error_1.UnableToFindFieldsError(objType.name);
|
|
18
18
|
}
|
|
19
19
|
lazy_metadata_storage_1.LazyMetadataStorage.load([objType], {
|
|
20
|
-
skipFieldLazyMetadata: true
|
|
20
|
+
skipFieldLazyMetadata: true,
|
|
21
21
|
});
|
|
22
22
|
const [classMetadata, decoratorFactory] = getClassMetadataAndFactoryByTargetAndType(classType, objType);
|
|
23
23
|
type_metadata_storage_1.TypeMetadataStorage.loadClassPluginMetadata([classMetadata]);
|
|
@@ -29,7 +29,7 @@ function getFieldsAndDecoratorForType(objType) {
|
|
|
29
29
|
fields = inheritClassFields(objType, fields);
|
|
30
30
|
return {
|
|
31
31
|
fields,
|
|
32
|
-
decoratorFactory
|
|
32
|
+
decoratorFactory,
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
function getClassMetadataAndFactoryByTargetAndType(classType, objType) {
|
|
@@ -37,22 +37,22 @@ function getClassMetadataAndFactoryByTargetAndType(classType, objType) {
|
|
|
37
37
|
case common_1.ClassType.Args:
|
|
38
38
|
return [
|
|
39
39
|
type_metadata_storage_1.TypeMetadataStorage.getArgumentsMetadataByTarget(objType),
|
|
40
|
-
args_type_decorator_1.ArgsType
|
|
40
|
+
args_type_decorator_1.ArgsType,
|
|
41
41
|
];
|
|
42
42
|
case common_1.ClassType.Object:
|
|
43
43
|
return [
|
|
44
44
|
type_metadata_storage_1.TypeMetadataStorage.getObjectTypeMetadataByTarget(objType),
|
|
45
|
-
object_type_decorator_1.ObjectType
|
|
45
|
+
object_type_decorator_1.ObjectType,
|
|
46
46
|
];
|
|
47
47
|
case common_1.ClassType.Input:
|
|
48
48
|
return [
|
|
49
49
|
type_metadata_storage_1.TypeMetadataStorage.getInputTypeMetadataByTarget(objType),
|
|
50
|
-
input_type_decorator_1.InputType
|
|
50
|
+
input_type_decorator_1.InputType,
|
|
51
51
|
];
|
|
52
52
|
case common_1.ClassType.Interface:
|
|
53
53
|
return [
|
|
54
54
|
type_metadata_storage_1.TypeMetadataStorage.getInterfaceMetadataByTarget(objType),
|
|
55
|
-
interface_type_decorator_1.InterfaceType
|
|
55
|
+
interface_type_decorator_1.InterfaceType,
|
|
56
56
|
];
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -15,7 +15,7 @@ function clonePluginMetadataFactory(target, parent, transformFn = identity) {
|
|
|
15
15
|
const parentMetadata = parent.constructor[type_metadata_storage_1.METADATA_FACTORY_NAME]();
|
|
16
16
|
targetMetadata = {
|
|
17
17
|
...parentMetadata,
|
|
18
|
-
...targetMetadata
|
|
18
|
+
...targetMetadata,
|
|
19
19
|
};
|
|
20
20
|
} while ((parent = Reflect.getPrototypeOf(parent)) &&
|
|
21
21
|
parent !== Object.prototype &&
|
|
@@ -27,7 +27,7 @@ function clonePluginMetadataFactory(target, parent, transformFn = identity) {
|
|
|
27
27
|
const originalMetadata = originalFactory();
|
|
28
28
|
return {
|
|
29
29
|
...originalMetadata,
|
|
30
|
-
...targetMetadata
|
|
30
|
+
...targetMetadata,
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapped-types.utils.js","sourceRoot":"","sources":["../../../../../src/core/Nestjs/types/utils/mapped-types.utils.ts"],"names":[],"mappings":";;AAKA,
|
|
1
|
+
{"version":3,"file":"mapped-types.utils.js","sourceRoot":"","sources":["../../../../../src/core/Nestjs/types/utils/mapped-types.utils.ts"],"names":[],"mappings":";;AAKA,gEAwCC;AA5CD,oEAAgE;AAEhE,MAAM,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAEvB,SAAgB,0BAA0B,CACxC,MAAqB,EACrB,MAAqB,EACrB,cAE2B,QAAQ;IAEnC,IAAI,cAAc,GAAG,EAAE,CAAA;IAEvB,GAAG,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;YACxB,OAAM;QACR,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,6CAAqB,CAAC,EAAE,CAAC;YAC/C,SAAQ;QACV,CAAC;QACD,MAAM,cAAc,GAAG,MAAM,CAAC,WAAW,CAAC,6CAAqB,CAAC,EAAE,CAAA;QAClE,cAAc,GAAG;YACf,GAAG,cAAc;YACjB,GAAG,cAAc;SAClB,CAAA;IACH,CAAC,QACC,CAAC,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,MAAM,CAAc,CAAC;QACtD,MAAM,KAAK,MAAM,CAAC,SAAS;QAC3B,MAAM,EACP;IACD,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC,CAAA;IAE5C,IAAI,MAAM,CAAC,6CAAqB,CAAC,EAAE,CAAC;QAClC,MAAM,eAAe,GAAG,MAAM,CAAC,6CAAqB,CAAC,CAAA;QACrD,MAAM,CAAC,6CAAqB,CAAC,GAAG,GAAG,EAAE;YACnC,MAAM,gBAAgB,GAAG,eAAe,EAAE,CAAA;YAC1C,OAAO;gBACL,GAAG,gBAAgB;gBACnB,GAAG,cAAc;aAClB,CAAA;QACH,CAAC,CAAA;IACH,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,6CAAqB,CAAC,GAAG,GAAG,EAAE,CAAC,cAAc,CAAA;IACtD,CAAC;AACH,CAAC"}
|
package/dist/decorators.d.ts
CHANGED
|
@@ -84,9 +84,9 @@ export declare class DecoratorsClass {
|
|
|
84
84
|
* @param e
|
|
85
85
|
*/
|
|
86
86
|
version(_e?: any): PropertyDecorator;
|
|
87
|
-
belongsToMany<T>({ entity, joinTableName, foreignKey, inverseForeignKey }: ManyToManyInterface<T>): PropertyDecorator;
|
|
88
|
-
belongsTo<T>({ entity, inverse, pivotColumnName }: BelongsToInterface<T>): PropertyDecorator;
|
|
89
|
-
hasMany<T>({ entity, inverse }: HasManyInterface<T>): PropertyDecorator;
|
|
87
|
+
belongsToMany<T>({ entity, joinTableName, foreignKey, inverseForeignKey, }: ManyToManyInterface<T>): PropertyDecorator;
|
|
88
|
+
belongsTo<T>({ entity, inverse, pivotColumnName, }: BelongsToInterface<T>): PropertyDecorator;
|
|
89
|
+
hasMany<T>({ entity, inverse, }: HasManyInterface<T>): PropertyDecorator;
|
|
90
90
|
}
|
|
91
91
|
export declare const f: DecoratorsClass;
|
|
92
92
|
export {};
|
package/dist/decorators.js
CHANGED
|
@@ -13,17 +13,12 @@ class DecoratorsClass {
|
|
|
13
13
|
* @param spec
|
|
14
14
|
*/
|
|
15
15
|
id() {
|
|
16
|
-
return (0, applyDecorators_1.applyDecorators)((0, typeorm_1.ObjectIdColumn)({ type: 'uuid' }), (0, typeorm_1.PrimaryGeneratedColumn)('uuid'), (0, types_1.ApiProperty)(), (0, field_decorator_1.Field)(() => graphql_1.GraphQLID)
|
|
17
|
-
// Column() as PropertyDecorator
|
|
18
|
-
// AutoGeneratedHashKey()
|
|
19
|
-
);
|
|
16
|
+
return (0, applyDecorators_1.applyDecorators)((0, typeorm_1.ObjectIdColumn)({ type: 'uuid' }), (0, typeorm_1.PrimaryGeneratedColumn)('uuid'), (0, types_1.ApiProperty)(), (0, field_decorator_1.Field)(() => graphql_1.GraphQLID));
|
|
20
17
|
}
|
|
21
18
|
mongoId() {
|
|
22
19
|
return (0, applyDecorators_1.applyDecorators)((0, typeorm_1.ObjectIdColumn)(),
|
|
23
20
|
// PrimaryGeneratedColumn('uuid') as PropertyDecorator,
|
|
24
|
-
(0, types_1.ApiProperty)(), (0, field_decorator_1.Field)(() => graphql_1.GraphQLID)
|
|
25
|
-
// AutoGeneratedHashKey()
|
|
26
|
-
);
|
|
21
|
+
(0, types_1.ApiProperty)(), (0, field_decorator_1.Field)(() => graphql_1.GraphQLID));
|
|
27
22
|
}
|
|
28
23
|
/**
|
|
29
24
|
*
|
|
@@ -43,18 +38,18 @@ class DecoratorsClass {
|
|
|
43
38
|
return (0, applyDecorators_1.applyDecorators)((0, types_1.HideField)(), (0, typeorm_1.Column)({
|
|
44
39
|
select: false,
|
|
45
40
|
nullable: !params.required,
|
|
46
|
-
type: params.type
|
|
41
|
+
type: params.type,
|
|
47
42
|
}), (0, types_1.ApiProperty)({
|
|
48
43
|
nullable: !params.required,
|
|
49
|
-
required: !!params.required
|
|
44
|
+
required: !!params.required,
|
|
50
45
|
}), (0, types_1.ApiHideProperty)());
|
|
51
46
|
}
|
|
52
47
|
return (0, applyDecorators_1.applyDecorators)((0, typeorm_1.Column)({
|
|
53
48
|
nullable: !params?.required,
|
|
54
|
-
type: params?.type
|
|
49
|
+
type: params?.type,
|
|
55
50
|
}), (0, types_1.ApiProperty)({
|
|
56
51
|
nullable: !params?.required,
|
|
57
|
-
required: !!params?.required
|
|
52
|
+
required: !!params?.required,
|
|
58
53
|
}), (0, field_decorator_1.Field)());
|
|
59
54
|
}
|
|
60
55
|
/**
|
|
@@ -62,9 +57,7 @@ class DecoratorsClass {
|
|
|
62
57
|
* @param e
|
|
63
58
|
*/
|
|
64
59
|
embed(e) {
|
|
65
|
-
return (0, applyDecorators_1.applyDecorators)((0, typeorm_1.Column)(_type => e), (0, types_1.ApiProperty)({ type: e })
|
|
66
|
-
// Attribute({ memberType: dynamoEmbed(e) })
|
|
67
|
-
);
|
|
60
|
+
return (0, applyDecorators_1.applyDecorators)((0, typeorm_1.Column)(_type => e), (0, types_1.ApiProperty)({ type: e }));
|
|
68
61
|
}
|
|
69
62
|
/**
|
|
70
63
|
*
|
|
@@ -75,7 +68,7 @@ class DecoratorsClass {
|
|
|
75
68
|
isArray: true,
|
|
76
69
|
type: e,
|
|
77
70
|
nullable: !params?.required,
|
|
78
|
-
required: !!params?.required
|
|
71
|
+
required: !!params?.required,
|
|
79
72
|
}));
|
|
80
73
|
}
|
|
81
74
|
/**
|
|
@@ -85,11 +78,11 @@ class DecoratorsClass {
|
|
|
85
78
|
stringArray(e, params) {
|
|
86
79
|
return (0, applyDecorators_1.applyDecorators)((0, typeorm_1.Column)({
|
|
87
80
|
type: 'simple-array',
|
|
88
|
-
nullable: !params?.required
|
|
81
|
+
nullable: !params?.required,
|
|
89
82
|
}), (0, types_1.ApiProperty)({
|
|
90
83
|
type: [e],
|
|
91
84
|
nullable: !params?.required,
|
|
92
|
-
required: !!params?.required
|
|
85
|
+
required: !!params?.required,
|
|
93
86
|
}));
|
|
94
87
|
}
|
|
95
88
|
/**
|
|
@@ -104,12 +97,12 @@ class DecoratorsClass {
|
|
|
104
97
|
type: 'enum',
|
|
105
98
|
enum: e.enum,
|
|
106
99
|
default: e.default,
|
|
107
|
-
nullable: !params?.required
|
|
100
|
+
nullable: !params?.required,
|
|
108
101
|
}), (0, types_1.ApiProperty)({
|
|
109
102
|
enum: e.enum,
|
|
110
103
|
default: e.default,
|
|
111
104
|
nullable: !params?.required,
|
|
112
|
-
required: !!params?.required
|
|
105
|
+
required: !!params?.required,
|
|
113
106
|
}));
|
|
114
107
|
}
|
|
115
108
|
/**
|
|
@@ -140,21 +133,21 @@ class DecoratorsClass {
|
|
|
140
133
|
version(_e) {
|
|
141
134
|
return (0, applyDecorators_1.applyDecorators)((0, typeorm_1.VersionColumn)(), (0, types_1.ApiProperty)());
|
|
142
135
|
}
|
|
143
|
-
belongsToMany({ entity, joinTableName, foreignKey, inverseForeignKey }) {
|
|
136
|
+
belongsToMany({ entity, joinTableName, foreignKey, inverseForeignKey, }) {
|
|
144
137
|
return (0, applyDecorators_1.applyDecorators)((0, typeorm_1.ManyToMany)(entity), (0, typeorm_1.JoinTable)({
|
|
145
138
|
name: joinTableName,
|
|
146
139
|
joinColumns: [{ name: foreignKey }],
|
|
147
|
-
inverseJoinColumns: [{ name: inverseForeignKey }]
|
|
140
|
+
inverseJoinColumns: [{ name: inverseForeignKey }],
|
|
148
141
|
}));
|
|
149
142
|
}
|
|
150
|
-
belongsTo({ entity, inverse, pivotColumnName }) {
|
|
143
|
+
belongsTo({ entity, inverse, pivotColumnName, }) {
|
|
151
144
|
return (0, applyDecorators_1.applyDecorators)((0, typeorm_1.ManyToOne)(entity, inverse), (0, typeorm_1.JoinColumn)({
|
|
152
145
|
name: pivotColumnName,
|
|
153
146
|
referencedColumnName: 'id',
|
|
154
|
-
foreignKeyConstraintName: `${pivotColumnName}_id_${js_utils_1.Ids.nanoId()}
|
|
147
|
+
foreignKeyConstraintName: `${pivotColumnName}_id_${js_utils_1.Ids.nanoId()}`,
|
|
155
148
|
}));
|
|
156
149
|
}
|
|
157
|
-
hasMany({ entity, inverse }) {
|
|
150
|
+
hasMany({ entity, inverse, }) {
|
|
158
151
|
return (0, applyDecorators_1.applyDecorators)((0, typeorm_1.OneToMany)(entity, inverse));
|
|
159
152
|
}
|
|
160
153
|
}
|