@allgemein/schema-api 1.7.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -1
- package/api/IBaseRef.d.ts +2 -2
- package/api/IBaseRef.js +1 -2
- package/api/IBuildOptions.d.ts +2 -2
- package/api/IBuildOptions.js +1 -2
- package/api/IClassRef.d.ts +5 -5
- package/api/IClassRef.js +3 -6
- package/api/IClassRef.js.map +1 -1
- package/api/IEntityRef.d.ts +5 -5
- package/api/IEntityRef.js +3 -6
- package/api/IEntityRef.js.map +1 -1
- package/api/IJsonSchema.d.ts +4 -4
- package/api/IJsonSchema.js +3 -8
- package/api/IJsonSchema.js.map +1 -1
- package/api/ILookupRegistry.d.ts +6 -6
- package/api/ILookupRegistry.js +6 -9
- package/api/ILookupRegistry.js.map +1 -1
- package/api/IPropertyExtentions.d.ts +1 -1
- package/api/IPropertyExtentions.js +1 -2
- package/api/IPropertyExtentions.js.map +1 -1
- package/api/IPropertyRef.d.ts +3 -3
- package/api/IPropertyRef.js +3 -6
- package/api/IPropertyRef.js.map +1 -1
- package/api/ISchemaRef.d.ts +2 -2
- package/api/ISchemaRef.js +1 -2
- package/api/ISerializeSupport.d.ts +4 -4
- package/api/ISerializeSupport.js +3 -8
- package/api/ISerializeSupport.js.map +1 -1
- package/browser.d.ts +65 -65
- package/browser.js +43 -112
- package/browser.js.map +1 -1
- package/decorators/Embeddable.d.ts +1 -1
- package/decorators/Embeddable.js +4 -7
- package/decorators/Embeddable.js.map +1 -1
- package/decorators/Entity.d.ts +1 -1
- package/decorators/Entity.js +4 -7
- package/decorators/Entity.js.map +1 -1
- package/decorators/Namespace.js +7 -10
- package/decorators/Namespace.js.map +1 -1
- package/decorators/Property.d.ts +1 -1
- package/decorators/Property.js +19 -22
- package/decorators/Property.js.map +1 -1
- package/decorators/PropertyOf.d.ts +1 -1
- package/decorators/PropertyOf.js +6 -9
- package/decorators/PropertyOf.js.map +1 -1
- package/decorators/Schema.d.ts +1 -1
- package/decorators/Schema.js +4 -7
- package/decorators/Schema.js.map +1 -1
- package/decorators/validate/Hostname.d.ts +1 -1
- package/decorators/validate/Hostname.js +12 -16
- package/decorators/validate/Hostname.js.map +1 -1
- package/decorators/validate/Ip4.d.ts +1 -1
- package/decorators/validate/Ip4.js +11 -15
- package/decorators/validate/Ip4.js.map +1 -1
- package/decorators/validate/Ip6.d.ts +1 -1
- package/decorators/validate/Ip6.js +11 -15
- package/decorators/validate/Ip6.js.map +1 -1
- package/decorators/validate/IsEmail.d.ts +1 -1
- package/decorators/validate/IsEmail.js +10 -14
- package/decorators/validate/IsEmail.js.map +1 -1
- package/decorators/validate/IsNotEmpty.d.ts +1 -1
- package/decorators/validate/IsNotEmpty.js +11 -14
- package/decorators/validate/IsNotEmpty.js.map +1 -1
- package/decorators/validate/MaxLength.d.ts +1 -1
- package/decorators/validate/MaxLength.js +9 -12
- package/decorators/validate/MaxLength.js.map +1 -1
- package/decorators/validate/MinLength.d.ts +1 -1
- package/decorators/validate/MinLength.js +9 -12
- package/decorators/validate/MinLength.js.map +1 -1
- package/decorators/validate/Regex.d.ts +1 -1
- package/decorators/validate/Regex.js +10 -13
- package/decorators/validate/Regex.js.map +1 -1
- package/decorators/validate/Required.d.ts +1 -1
- package/decorators/validate/Required.js +9 -12
- package/decorators/validate/Required.js.map +1 -1
- package/decorators/validate/index.d.ts +8 -8
- package/decorators/validate/index.js +9 -19
- package/decorators/validate/index.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -17
- package/index.js.map +1 -1
- package/lib/AbstractRef.d.ts +4 -4
- package/lib/AbstractRef.js +29 -33
- package/lib/AbstractRef.js.map +1 -1
- package/lib/AnnotationsHelper.d.ts +2 -2
- package/lib/AnnotationsHelper.js +30 -34
- package/lib/AnnotationsHelper.js.map +1 -1
- package/lib/ClassRef.d.ts +7 -7
- package/lib/ClassRef.js +62 -66
- package/lib/ClassRef.js.map +1 -1
- package/lib/Constants.js +42 -45
- package/lib/Constants.js.map +1 -1
- package/lib/DataContainer.d.ts +6 -6
- package/lib/DataContainer.js +17 -21
- package/lib/DataContainer.js.map +1 -1
- package/lib/LookupRegistry.js +13 -17
- package/lib/LookupRegistry.js.map +1 -1
- package/lib/SchemaRef.d.ts +7 -7
- package/lib/SchemaRef.js +11 -15
- package/lib/SchemaRef.js.map +1 -1
- package/lib/SchemaUtils.d.ts +3 -3
- package/lib/SchemaUtils.js +19 -23
- package/lib/SchemaUtils.js.map +1 -1
- package/lib/functions.d.ts +2 -2
- package/lib/functions.js +7 -10
- package/lib/functions.js.map +1 -1
- package/lib/json-schema/Constants.js +3 -6
- package/lib/json-schema/Constants.js.map +1 -1
- package/lib/json-schema/IJsonSchemaSerializeOptions.d.ts +4 -4
- package/lib/json-schema/IJsonSchemaSerializeOptions.js +1 -2
- package/lib/json-schema/IJsonSchemaSerializer.d.ts +3 -3
- package/lib/json-schema/IJsonSchemaSerializer.js +1 -2
- package/lib/json-schema/IJsonSchemaUnserializeOptions.d.ts +3 -3
- package/lib/json-schema/IJsonSchemaUnserializeOptions.js +1 -2
- package/lib/json-schema/IJsonSchemaUnserializer.d.ts +1 -1
- package/lib/json-schema/IJsonSchemaUnserializer.js +1 -2
- package/lib/json-schema/IParseOptions.d.ts +2 -2
- package/lib/json-schema/IParseOptions.js +1 -4
- package/lib/json-schema/IParseOptions.js.map +1 -1
- package/lib/json-schema/JsonSchema.d.ts +10 -10
- package/lib/json-schema/JsonSchema.js +26 -30
- package/lib/json-schema/JsonSchema.js.map +1 -1
- package/lib/json-schema/JsonSchema7.d.ts +2 -2
- package/lib/json-schema/JsonSchema7.js +3 -8
- package/lib/json-schema/JsonSchema7.js.map +1 -1
- package/lib/json-schema/JsonSchema7Serializer.d.ts +9 -9
- package/lib/json-schema/JsonSchema7Serializer.js +93 -97
- package/lib/json-schema/JsonSchema7Serializer.js.map +1 -1
- package/lib/json-schema/JsonSchema7Unserializer.d.ts +10 -10
- package/lib/json-schema/JsonSchema7Unserializer.js +99 -103
- package/lib/json-schema/JsonSchema7Unserializer.js.map +1 -1
- package/lib/json-schema/functions.d.ts +2 -2
- package/lib/json-schema/functions.js +8 -12
- package/lib/json-schema/functions.js.map +1 -1
- package/lib/options/IAbstractOptions.d.ts +1 -1
- package/lib/options/IAbstractOptions.js +1 -2
- package/lib/options/IAttributeOptions.d.ts +2 -2
- package/lib/options/IAttributeOptions.js +1 -2
- package/lib/options/IEntityOptions.d.ts +2 -2
- package/lib/options/IEntityOptions.js +1 -2
- package/lib/options/INamedOptions.js +1 -2
- package/lib/options/IObjectOptions.d.ts +2 -2
- package/lib/options/IObjectOptions.js +1 -2
- package/lib/options/IPropertyOptions.d.ts +2 -2
- package/lib/options/IPropertyOptions.js +1 -2
- package/lib/options/ISchemaOptions.d.ts +2 -2
- package/lib/options/ISchemaOptions.js +1 -2
- package/lib/registry/AbstractRegistry.d.ts +8 -8
- package/lib/registry/AbstractRegistry.js +19 -23
- package/lib/registry/AbstractRegistry.js.map +1 -1
- package/lib/registry/Binding.d.ts +1 -1
- package/lib/registry/Binding.js +1 -5
- package/lib/registry/Binding.js.map +1 -1
- package/lib/registry/DefaultEntityRef.d.ts +9 -9
- package/lib/registry/DefaultEntityRef.js +10 -14
- package/lib/registry/DefaultEntityRef.js.map +1 -1
- package/lib/registry/DefaultNamespacedRegistry.d.ts +14 -14
- package/lib/registry/DefaultNamespacedRegistry.js +122 -126
- package/lib/registry/DefaultNamespacedRegistry.js.map +1 -1
- package/lib/registry/DefaultPropertyRef.d.ts +7 -7
- package/lib/registry/DefaultPropertyRef.js +42 -46
- package/lib/registry/DefaultPropertyRef.js.map +1 -1
- package/lib/registry/IRegistryOptions.js +1 -2
- package/lib/registry/MetadataRegistry.d.ts +8 -8
- package/lib/registry/MetadataRegistry.js +29 -33
- package/lib/registry/MetadataRegistry.js.map +1 -1
- package/lib/registry/RegistryFactory.d.ts +3 -3
- package/lib/registry/RegistryFactory.js +19 -23
- package/lib/registry/RegistryFactory.js.map +1 -1
- package/lib/serializer/ISerializeOptions.js +1 -2
- package/lib/serializer/ISerializer.d.ts +2 -2
- package/lib/serializer/ISerializer.js +1 -2
- package/lib/serializer/ISerializerFactory.d.ts +6 -6
- package/lib/serializer/ISerializerFactory.js +1 -2
- package/lib/serializer/IUnserializeOptions.js +1 -2
- package/lib/serializer/IUnserializer.d.ts +2 -2
- package/lib/serializer/IUnserializer.js +1 -2
- package/lib/serializer/SerializerRegistry.d.ts +1 -1
- package/lib/serializer/SerializerRegistry.js +3 -7
- package/lib/serializer/SerializerRegistry.js.map +1 -1
- package/lib/validation/DefaultValidator.d.ts +5 -5
- package/lib/validation/DefaultValidator.js +32 -36
- package/lib/validation/DefaultValidator.js.map +1 -1
- package/lib/validation/IValidateOptions.js +1 -2
- package/lib/validation/IValidationError.js +1 -2
- package/lib/validation/IValidationMessage.js +1 -2
- package/lib/validation/IValidationOptions.d.ts +1 -0
- package/lib/validation/IValidationOptions.js +1 -0
- package/lib/validation/IValidationOptions.js.map +1 -1
- package/lib/validation/IValidationResult.d.ts +1 -1
- package/lib/validation/IValidationResult.js +1 -2
- package/lib/validation/IValidator.d.ts +1 -1
- package/lib/validation/IValidator.js +1 -2
- package/lib/validation/IValidatorEntry.d.ts +1 -1
- package/lib/validation/IValidatorEntry.js +1 -2
- package/lib/validation/IValidatorHandle.js +1 -2
- package/lib/validation/Validator.d.ts +4 -4
- package/lib/validation/Validator.js +7 -11
- package/lib/validation/Validator.js.map +1 -1
- package/package.json +3 -2
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const Constants_1 = require("../Constants");
|
|
7
|
-
function setDefaultArray(schema) {
|
|
8
|
-
(0, lodash_1.assign)(schema, {
|
|
9
|
-
type: Constants_1.T_ARRAY,
|
|
1
|
+
import { assign } from "@allgemein/base";
|
|
2
|
+
import { REFLECT_DESIGN_TYPE, T_ARRAY, T_OBJECT } from "../Constants.js";
|
|
3
|
+
export function setDefaultArray(schema) {
|
|
4
|
+
assign(schema, {
|
|
5
|
+
type: T_ARRAY,
|
|
10
6
|
items: {
|
|
11
|
-
type:
|
|
7
|
+
type: T_OBJECT
|
|
12
8
|
}
|
|
13
9
|
});
|
|
14
10
|
}
|
|
15
|
-
function getReflectedType(clazz, propertyName) {
|
|
11
|
+
export function getReflectedType(clazz, propertyName) {
|
|
16
12
|
return Reflect && Reflect.getMetadata ?
|
|
17
|
-
Reflect.getMetadata(
|
|
13
|
+
Reflect.getMetadata(REFLECT_DESIGN_TYPE, clazz, propertyName) : undefined;
|
|
18
14
|
}
|
|
19
15
|
//# sourceMappingURL=functions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../../src/lib/json-schema/functions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../../src/lib/json-schema/functions.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAC,mBAAmB,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAGvE,MAAM,UAAU,eAAe,CAAC,MAAoB;IAClD,MAAM,CAAC,MAAM,EAAE;QACb,IAAI,EAAE,OAAO;QACb,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;SACf;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAoD,EAAE,YAAoB;IACzG,OAAO,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;QACrC,OAAO,CAAC,WAAW,CAAC,mBAAmB,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAE9E,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { METADATA_TYPE } from '../Constants';
|
|
2
|
-
import { IAbstractOptions } from './IAbstractOptions';
|
|
1
|
+
import { METADATA_TYPE } from '../Constants.js';
|
|
2
|
+
import { IAbstractOptions } from './IAbstractOptions.js';
|
|
3
3
|
export interface IAttributeOptions extends IAbstractOptions {
|
|
4
4
|
targetTypes: (METADATA_TYPE | string)[];
|
|
5
5
|
propertyName?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAbstractOptions } from './IAbstractOptions';
|
|
2
|
-
import { INamedOptions } from "./INamedOptions";
|
|
1
|
+
import { IAbstractOptions } from './IAbstractOptions.js';
|
|
2
|
+
import { INamedOptions } from "./INamedOptions.js";
|
|
3
3
|
export interface IEntityOptions extends IAbstractOptions, INamedOptions {
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IAbstractOptions } from './IAbstractOptions';
|
|
2
|
-
import { INamedOptions } from "./INamedOptions";
|
|
1
|
+
import { IAbstractOptions } from './IAbstractOptions.js';
|
|
2
|
+
import { INamedOptions } from "./INamedOptions.js";
|
|
3
3
|
export interface IObjectOptions extends IAbstractOptions, INamedOptions {
|
|
4
4
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { JS_DATA_TYPES } from '../../lib/Constants';
|
|
2
|
-
import { IAbstractOptions } from './IAbstractOptions';
|
|
1
|
+
import { JS_DATA_TYPES } from '../../lib/Constants.js';
|
|
2
|
+
import { IAbstractOptions } from './IAbstractOptions.js';
|
|
3
3
|
export interface IPropertyOptions extends IAbstractOptions {
|
|
4
4
|
propertyName?: string;
|
|
5
5
|
internalName?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IAbstractOptions } from './IAbstractOptions';
|
|
2
|
-
import { INamedOptions } from "./INamedOptions";
|
|
1
|
+
import { IAbstractOptions } from './IAbstractOptions.js';
|
|
2
|
+
import { INamedOptions } from "./INamedOptions.js";
|
|
3
3
|
export interface ISchemaOptions extends IAbstractOptions, INamedOptions {
|
|
4
4
|
/**
|
|
5
5
|
* Inherited fromAn name of the schema must exists
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { METADATA_TYPE } from './../Constants';
|
|
2
|
-
import { ILookupRegistry } from '../../api/ILookupRegistry';
|
|
3
|
-
import { IEntityRef } from '../../api/IEntityRef';
|
|
4
|
-
import { IClassRef } from '../../api/IClassRef';
|
|
5
|
-
import { IPropertyRef } from '../../api/IPropertyRef';
|
|
6
|
-
import { LookupRegistry } from '../LookupRegistry';
|
|
1
|
+
import { METADATA_TYPE } from './../Constants.js';
|
|
2
|
+
import { ILookupRegistry } from '../../api/ILookupRegistry.js';
|
|
3
|
+
import { IEntityRef } from '../../api/IEntityRef.js';
|
|
4
|
+
import { IClassRef } from '../../api/IClassRef.js';
|
|
5
|
+
import { IPropertyRef } from '../../api/IPropertyRef.js';
|
|
6
|
+
import { LookupRegistry } from '../LookupRegistry.js';
|
|
7
7
|
import { Semaphore } from '@allgemein/base';
|
|
8
|
-
import { ISchemaRef } from '../../api/ISchemaRef';
|
|
9
|
-
import { IRegistryOptions } from './IRegistryOptions';
|
|
8
|
+
import { ISchemaRef } from '../../api/ISchemaRef.js';
|
|
9
|
+
import { IRegistryOptions } from './IRegistryOptions.js';
|
|
10
10
|
/**
|
|
11
11
|
* Registry for metadata of classes and there properties
|
|
12
12
|
*/
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const Constants_1 = require("./../Constants");
|
|
6
|
-
const LookupRegistry_1 = require("../LookupRegistry");
|
|
7
|
-
const base_1 = require("@allgemein/base");
|
|
1
|
+
import { snakeCase } from '@allgemein/base';
|
|
2
|
+
import { METATYPE_ENTITY, METATYPE_PROPERTY } from './../Constants.js';
|
|
3
|
+
import { LookupRegistry } from '../LookupRegistry.js';
|
|
4
|
+
import { LockFactory, NotSupportedError } from '@allgemein/base';
|
|
8
5
|
/**
|
|
9
6
|
* Registry for metadata of classes and there properties
|
|
10
7
|
*/
|
|
11
|
-
class AbstractRegistry {
|
|
8
|
+
export class AbstractRegistry {
|
|
12
9
|
constructor(namespace, options) {
|
|
13
10
|
this.namespace = namespace;
|
|
14
11
|
this.options = options || {};
|
|
15
12
|
}
|
|
16
13
|
get lock() {
|
|
17
14
|
if (!this._lock) {
|
|
18
|
-
this._lock =
|
|
15
|
+
this._lock = LockFactory.$().semaphore(1);
|
|
19
16
|
}
|
|
20
17
|
return this._lock;
|
|
21
18
|
}
|
|
@@ -32,10 +29,10 @@ class AbstractRegistry {
|
|
|
32
29
|
* @return ISchemaRef[]
|
|
33
30
|
*/
|
|
34
31
|
getSchemaRefs(filter) {
|
|
35
|
-
throw new
|
|
32
|
+
throw new NotSupportedError('');
|
|
36
33
|
}
|
|
37
34
|
getSchemaRefsFor(ref) {
|
|
38
|
-
throw new
|
|
35
|
+
throw new NotSupportedError('');
|
|
39
36
|
}
|
|
40
37
|
/**
|
|
41
38
|
* TODO
|
|
@@ -43,7 +40,7 @@ class AbstractRegistry {
|
|
|
43
40
|
* @param filter
|
|
44
41
|
*/
|
|
45
42
|
getEntityRefs(filter) {
|
|
46
|
-
return this.filter(
|
|
43
|
+
return this.filter(METATYPE_ENTITY, filter);
|
|
47
44
|
}
|
|
48
45
|
/**
|
|
49
46
|
* Can get get entity ref for function.
|
|
@@ -51,13 +48,13 @@ class AbstractRegistry {
|
|
|
51
48
|
* @param fn
|
|
52
49
|
*/
|
|
53
50
|
getEntityRefFor(fn, skipNsCheck = true) {
|
|
54
|
-
throw new
|
|
51
|
+
throw new NotSupportedError('');
|
|
55
52
|
}
|
|
56
53
|
/**
|
|
57
54
|
* Returns the used instance of lookup registry handler
|
|
58
55
|
*/
|
|
59
56
|
getLookupRegistry(namespace = null) {
|
|
60
|
-
return
|
|
57
|
+
return LookupRegistry.$(namespace ? namespace : this.namespace);
|
|
61
58
|
}
|
|
62
59
|
/**
|
|
63
60
|
* Method for returning class ref
|
|
@@ -66,7 +63,7 @@ class AbstractRegistry {
|
|
|
66
63
|
* @param type
|
|
67
64
|
*/
|
|
68
65
|
getClassRefFor(object, type) {
|
|
69
|
-
throw new
|
|
66
|
+
throw new NotSupportedError('');
|
|
70
67
|
}
|
|
71
68
|
/**
|
|
72
69
|
* Returns property by name for a given class or entity ref
|
|
@@ -74,7 +71,7 @@ class AbstractRegistry {
|
|
|
74
71
|
* @param filter
|
|
75
72
|
*/
|
|
76
73
|
getPropertyRef(ref, name) {
|
|
77
|
-
return this.getPropertyRefs(ref).find(x =>
|
|
74
|
+
return this.getPropertyRefs(ref).find(x => snakeCase(x.name) === snakeCase(name));
|
|
78
75
|
}
|
|
79
76
|
/**
|
|
80
77
|
* Returns all properties for given class or entity ref
|
|
@@ -82,10 +79,10 @@ class AbstractRegistry {
|
|
|
82
79
|
* @param ref
|
|
83
80
|
*/
|
|
84
81
|
getPropertyRefs(ref) {
|
|
85
|
-
throw new
|
|
82
|
+
throw new NotSupportedError('');
|
|
86
83
|
}
|
|
87
84
|
getPropertyRefsFor(fn) {
|
|
88
|
-
throw new
|
|
85
|
+
throw new NotSupportedError('');
|
|
89
86
|
}
|
|
90
87
|
list(type, filter) {
|
|
91
88
|
return this.filter(type, filter);
|
|
@@ -94,10 +91,10 @@ class AbstractRegistry {
|
|
|
94
91
|
return this.getEntityRefs(filter);
|
|
95
92
|
}
|
|
96
93
|
listProperties(filter) {
|
|
97
|
-
return this.filter(
|
|
94
|
+
return this.filter(METATYPE_PROPERTY, filter);
|
|
98
95
|
}
|
|
99
96
|
create(context, options) {
|
|
100
|
-
throw new
|
|
97
|
+
throw new NotSupportedError('');
|
|
101
98
|
}
|
|
102
99
|
/**
|
|
103
100
|
* TODO
|
|
@@ -134,10 +131,9 @@ class AbstractRegistry {
|
|
|
134
131
|
*/
|
|
135
132
|
clear() {
|
|
136
133
|
if (this._lock) {
|
|
137
|
-
|
|
134
|
+
LockFactory.$().remove(this._lock);
|
|
138
135
|
}
|
|
139
|
-
|
|
136
|
+
LookupRegistry.reset(this.namespace);
|
|
140
137
|
}
|
|
141
138
|
}
|
|
142
|
-
exports.AbstractRegistry = AbstractRegistry;
|
|
143
139
|
//# sourceMappingURL=AbstractRegistry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractRegistry.js","sourceRoot":"","sources":["../../../../src/lib/registry/AbstractRegistry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AbstractRegistry.js","sourceRoot":"","sources":["../../../../src/lib/registry/AbstractRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAgB,eAAe,EAAE,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAKpF,OAAO,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAC,WAAW,EAAE,iBAAiB,EAAY,MAAM,iBAAiB,CAAC;AAK1E;;GAEG;AACH,MAAM,OAAgB,gBAAgB;IASpC,YAAY,SAAiB,EAAE,OAA0B;QACvD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;IAC/B,CAAC;IAGD,IAAI,IAAI;QACN,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAGD,KAAK,CAAC,OAAgB;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACpE,CAAC;IAGD,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAGD;;;;;OAKG;IACH,aAAa,CAAuB,MAA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C,IAAI,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;CAEF"}
|
package/lib/registry/Binding.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Binding = void 0;
|
|
4
|
-
class Binding {
|
|
1
|
+
export class Binding {
|
|
5
2
|
static create(sType, sName, tType, tName) {
|
|
6
3
|
let b = new Binding();
|
|
7
4
|
b.bindingType = [sType, tType].join('_');
|
|
@@ -12,5 +9,4 @@ class Binding {
|
|
|
12
9
|
return b;
|
|
13
10
|
}
|
|
14
11
|
}
|
|
15
|
-
exports.Binding = Binding;
|
|
16
12
|
//# sourceMappingURL=Binding.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Binding.js","sourceRoot":"","sources":["../../../../src/lib/registry/Binding.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Binding.js","sourceRoot":"","sources":["../../../../src/lib/registry/Binding.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,OAAO;IAUlB,MAAM,CAAC,MAAM,CAAC,KAA6B,EAAE,KAAU,EAAE,KAA6B,EAAE,KAAU;QAChG,IAAI,CAAC,GAAG,IAAI,OAAO,EAAE,CAAC;QACtB,CAAC,CAAC,WAAW,GAA2B,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjE,CAAC,CAAC,UAAU,GAAG,KAAK,CAAC;QACrB,CAAC,CAAC,UAAU,GAAG,KAAK,CAAC;QACrB,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC;QACjB,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC;QACjB,OAAO,CAAC,CAAC;IACX,CAAC;CACF"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { IEntityRef } from '../../api/IEntityRef';
|
|
2
|
-
import { AbstractRef } from '../AbstractRef';
|
|
3
|
-
import { IBuildOptions } from '../../api/IBuildOptions';
|
|
4
|
-
import { IPropertyRef } from '../../api/IPropertyRef';
|
|
5
|
-
import { METADATA_TYPE } from '../Constants';
|
|
6
|
-
import { IEntityOptions } from '../options/IEntityOptions';
|
|
7
|
-
import { IClassRef } from '../../api/IClassRef';
|
|
8
|
-
import { ILookupRegistry } from '../../api/ILookupRegistry';
|
|
9
|
-
import { SchemaRef } from '../SchemaRef';
|
|
1
|
+
import { IEntityRef } from '../../api/IEntityRef.js';
|
|
2
|
+
import { AbstractRef } from '../AbstractRef.js';
|
|
3
|
+
import { IBuildOptions } from '../../api/IBuildOptions.js';
|
|
4
|
+
import { IPropertyRef } from '../../api/IPropertyRef.js';
|
|
5
|
+
import { METADATA_TYPE } from '../Constants.js';
|
|
6
|
+
import { IEntityOptions } from '../options/IEntityOptions.js';
|
|
7
|
+
import { IClassRef } from '../../api/IClassRef.js';
|
|
8
|
+
import { ILookupRegistry } from '../../api/ILookupRegistry.js';
|
|
9
|
+
import { SchemaRef } from '../SchemaRef.js';
|
|
10
10
|
export declare class DefaultEntityRef extends AbstractRef implements IEntityRef {
|
|
11
11
|
constructor(options?: IEntityOptions);
|
|
12
12
|
additionalProperties(options: any): void;
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const AnnotationsHelper_1 = require("../AnnotationsHelper");
|
|
7
|
-
const RegistryFactory_1 = require("./RegistryFactory");
|
|
8
|
-
class DefaultEntityRef extends AbstractRef_1.AbstractRef {
|
|
1
|
+
import { AbstractRef } from '../AbstractRef.js';
|
|
2
|
+
import { DEFAULT_NAMESPACE, DEFINED_PROPS_TO_OPTS, METATYPE_ENTITY, XS_ID_SEPARATOR } from '../Constants.js';
|
|
3
|
+
import { AnnotationsHelper } from '../AnnotationsHelper.js';
|
|
4
|
+
import { RegistryFactory } from './RegistryFactory.js';
|
|
5
|
+
export class DefaultEntityRef extends AbstractRef {
|
|
9
6
|
constructor(options = {}) {
|
|
10
|
-
super(
|
|
11
|
-
|
|
7
|
+
super(METATYPE_ENTITY, options.name, options.target, options.namespace ? options.namespace : DEFAULT_NAMESPACE);
|
|
8
|
+
AnnotationsHelper.merge(this.object, options);
|
|
12
9
|
this.additionalProperties(options);
|
|
13
10
|
this.setOptions(options);
|
|
14
11
|
}
|
|
15
12
|
additionalProperties(options) {
|
|
16
13
|
const cls = this.getSourceRef().getClass();
|
|
17
14
|
if (cls) {
|
|
18
|
-
|
|
15
|
+
DEFINED_PROPS_TO_OPTS.forEach(k => {
|
|
19
16
|
const p = Object.getOwnPropertyDescriptor(cls, k);
|
|
20
17
|
if (p) {
|
|
21
18
|
options[k] = p.value;
|
|
@@ -27,7 +24,7 @@ class DefaultEntityRef extends AbstractRef_1.AbstractRef {
|
|
|
27
24
|
return this.getRegistry().getSchemaRefsFor(this);
|
|
28
25
|
}
|
|
29
26
|
getRegistry() {
|
|
30
|
-
return
|
|
27
|
+
return RegistryFactory.get(this.namespace);
|
|
31
28
|
}
|
|
32
29
|
build(instance, options) {
|
|
33
30
|
return this.getClassRef().build(instance, options);
|
|
@@ -42,7 +39,7 @@ class DefaultEntityRef extends AbstractRef_1.AbstractRef {
|
|
|
42
39
|
return this.getRegistry().getPropertyRefs(this);
|
|
43
40
|
}
|
|
44
41
|
id() {
|
|
45
|
-
return [
|
|
42
|
+
return [METATYPE_ENTITY, this.getClassRef().id()].join(XS_ID_SEPARATOR);
|
|
46
43
|
}
|
|
47
44
|
getClassRefFor(object, type) {
|
|
48
45
|
return this.getRegistry().getClassRefFor(object, this.metaType);
|
|
@@ -56,5 +53,4 @@ class DefaultEntityRef extends AbstractRef_1.AbstractRef {
|
|
|
56
53
|
return this.getClassRef().isOf(instance);
|
|
57
54
|
}
|
|
58
55
|
}
|
|
59
|
-
exports.DefaultEntityRef = DefaultEntityRef;
|
|
60
56
|
//# sourceMappingURL=DefaultEntityRef.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultEntityRef.js","sourceRoot":"","sources":["../../../../src/lib/registry/DefaultEntityRef.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DefaultEntityRef.js","sourceRoot":"","sources":["../../../../src/lib/registry/DefaultEntityRef.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAG9C,OAAO,EAAC,iBAAiB,EAAE,qBAAqB,EAAiB,eAAe,EAAE,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAG1H,OAAO,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAIrD,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAG/C,YAAY,UAA0B,EAAE;QACtC,KAAK,CAAC,eAAe,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC;QAChH,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED,oBAAoB,CAAC,OAAY;QAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC,QAAQ,EAAE,CAAC;QAC3C,IAAI,GAAG,EAAE,CAAC;YACR,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;gBAChC,MAAM,CAAC,GAAG,MAAM,CAAC,wBAAwB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;gBAClD,IAAI,CAAC,EAAE,CAAC;oBACN,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC;gBACvB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAGD,aAAa;QACX,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAQ,CAAC;IAC1D,CAAC;IAED,WAAW;QACT,OAAO,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAI,QAAa,EAAE,OAAuB;QAC7C,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,CAAI,OAAiB;QACzB,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAED,cAAc,CAAC,IAAY;QACzB,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAClD,CAAC;IAED,EAAE;QACA,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC1E,CAAC;IAED,cAAc,CAAC,MAAqC,EAAE,IAAmB;QACvE,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;IAED;;;;OAIG;IACH,IAAI,CAAC,QAAa;QAChB,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3C,CAAC;CAEF"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { METADATA_TYPE } from './../Constants';
|
|
2
|
-
import { IPropertyOptions } from './../options/IPropertyOptions';
|
|
3
|
-
import { IEntityRef } from '../../api/IEntityRef';
|
|
4
|
-
import { IClassRef } from '../../api/IClassRef';
|
|
5
|
-
import { DefaultPropertyRef } from './DefaultPropertyRef';
|
|
6
|
-
import { IEntityOptions } from '../options/IEntityOptions';
|
|
7
|
-
import { DefaultEntityRef } from './DefaultEntityRef';
|
|
8
|
-
import { ISchemaOptions } from '../options/ISchemaOptions';
|
|
9
|
-
import { IObjectOptions } from '../options/IObjectOptions';
|
|
10
|
-
import { ISchemaRef } from '../../api/ISchemaRef';
|
|
11
|
-
import { SchemaRef } from '../SchemaRef';
|
|
12
|
-
import { AbstractRegistry } from './AbstractRegistry';
|
|
13
|
-
import { IAbstractOptions } from '../options/IAbstractOptions';
|
|
14
|
-
import { IRegistryOptions } from './IRegistryOptions';
|
|
1
|
+
import { METADATA_TYPE } from './../Constants.js';
|
|
2
|
+
import { IPropertyOptions } from './../options/IPropertyOptions.js';
|
|
3
|
+
import { IEntityRef } from '../../api/IEntityRef.js';
|
|
4
|
+
import { IClassRef } from '../../api/IClassRef.js';
|
|
5
|
+
import { DefaultPropertyRef } from './DefaultPropertyRef.js';
|
|
6
|
+
import { IEntityOptions } from '../options/IEntityOptions.js';
|
|
7
|
+
import { DefaultEntityRef } from './DefaultEntityRef.js';
|
|
8
|
+
import { ISchemaOptions } from '../options/ISchemaOptions.js';
|
|
9
|
+
import { IObjectOptions } from '../options/IObjectOptions.js';
|
|
10
|
+
import { ISchemaRef } from '../../api/ISchemaRef.js';
|
|
11
|
+
import { SchemaRef } from '../SchemaRef.js';
|
|
12
|
+
import { AbstractRegistry } from './AbstractRegistry.js';
|
|
13
|
+
import { IAbstractOptions } from '../options/IAbstractOptions.js';
|
|
14
|
+
import { IRegistryOptions } from './IRegistryOptions.js';
|
|
15
15
|
/**
|
|
16
16
|
* Registry which handles by default class, schema, embeddalbes and properties, which are not handled by a specialized registry.
|
|
17
17
|
*
|