@allgemein/schema-api 1.5.32 → 1.5.34
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/api/IBaseRef.js +0 -2
- package/api/IBuildOptions.js +0 -2
- package/api/IClassRef.js +1 -4
- package/api/IEntityRef.js +2 -6
- package/api/IJsonSchema.js +3 -6
- package/api/ILookupRegistry.js +1 -4
- package/api/IPropertyExtentions.js +0 -2
- package/api/IPropertyRef.js +1 -4
- package/api/ISchemaRef.js +0 -2
- package/api/ISerializeSupport.js +3 -6
- package/browser.js +5 -3
- package/decorators/Embeddable.js +1 -4
- package/decorators/Entity.js +1 -4
- package/decorators/Namespace.js +1 -4
- package/decorators/Property.js +1 -4
- package/decorators/PropertyOf.js +1 -4
- package/decorators/Schema.js +1 -4
- package/decorators/validate/Hostname.js +2 -4
- package/decorators/validate/Ip4.js +2 -4
- package/decorators/validate/Ip6.js +2 -4
- package/decorators/validate/IsEmail.js +2 -4
- package/decorators/validate/IsNotEmpty.js +1 -4
- package/decorators/validate/MaxLength.js +1 -4
- package/decorators/validate/MinLength.js +1 -4
- package/decorators/validate/Regex.js +1 -4
- package/decorators/validate/Required.js +1 -4
- package/decorators/validate/index.js +0 -2
- package/index.js +5 -3
- package/lib/AbstractRef.js +0 -2
- package/lib/AnnotationsHelper.js +0 -2
- package/lib/ClassRef.js +0 -2
- package/lib/Constants.d.ts +7 -7
- package/lib/Constants.js +0 -2
- package/lib/DataContainer.js +3 -2
- package/lib/LookupRegistry.js +0 -2
- package/lib/SchemaRef.js +0 -2
- package/lib/SchemaUtils.js +7 -3
- package/lib/functions.js +1 -4
- package/lib/json-schema/Constants.js +0 -2
- package/lib/json-schema/IJsonSchemaSerializeOptions.js +0 -2
- package/lib/json-schema/IJsonSchemaSerializer.js +0 -2
- package/lib/json-schema/IJsonSchemaUnserializeOptions.js +0 -2
- package/lib/json-schema/IJsonSchemaUnserializer.js +0 -2
- package/lib/json-schema/IParseOptions.js +0 -2
- package/lib/json-schema/JsonSchema.d.ts +1 -1
- package/lib/json-schema/JsonSchema.js +2 -4
- package/lib/json-schema/JsonSchema7.d.ts +2 -2
- package/lib/json-schema/JsonSchema7.js +3 -5
- package/lib/json-schema/JsonSchema7Serializer.js +1 -3
- package/lib/json-schema/JsonSchema7Unserializer.d.ts +2 -2
- package/lib/json-schema/JsonSchema7Unserializer.js +9 -10
- package/lib/json-schema/functions.js +2 -5
- package/lib/options/IAbstractOptions.js +0 -2
- package/lib/options/IAttributeOptions.js +0 -2
- package/lib/options/IEntityOptions.js +0 -2
- package/lib/options/INamedOptions.js +0 -2
- package/lib/options/IObjectOptions.js +0 -2
- package/lib/options/IPropertyOptions.js +0 -2
- package/lib/options/ISchemaOptions.js +0 -2
- package/lib/registry/AbstractRegistry.js +0 -2
- package/lib/registry/Binding.js +0 -2
- package/lib/registry/DefaultEntityRef.js +0 -2
- package/lib/registry/DefaultNamespacedRegistry.js +0 -2
- package/lib/registry/DefaultPropertyRef.js +0 -2
- package/lib/registry/IRegistryOptions.js +0 -2
- package/lib/registry/MetadataRegistry.d.ts +0 -1
- package/lib/registry/MetadataRegistry.js +0 -2
- package/lib/registry/RegistryFactory.js +0 -2
- package/lib/serializer/ISerializeOptions.js +0 -2
- package/lib/serializer/ISerializer.js +0 -2
- package/lib/serializer/ISerializerFactory.js +0 -2
- package/lib/serializer/IUnserializeOptions.js +0 -2
- package/lib/serializer/IUnserializer.js +0 -2
- package/lib/serializer/SerializerRegistry.js +0 -2
- package/lib/validation/DefaultValidator.js +1 -2
- package/lib/validation/IValidateOptions.js +0 -2
- package/lib/validation/IValidationError.js +0 -2
- package/lib/validation/IValidationMessage.js +0 -2
- package/lib/validation/IValidationOptions.d.ts +0 -1
- package/lib/validation/IValidationOptions.js +0 -2
- package/lib/validation/IValidationResult.js +0 -2
- package/lib/validation/IValidator.js +0 -2
- package/lib/validation/IValidatorEntry.js +0 -2
- package/lib/validation/IValidatorHandle.js +0 -2
- package/lib/validation/Validator.d.ts +2 -2
- package/lib/validation/Validator.js +0 -2
- package/package.json +7 -9
- package/api/IBaseRef.js.map +0 -1
- package/api/IBuildOptions.js.map +0 -1
- package/api/IClassRef.js.map +0 -1
- package/api/IEntityRef.js.map +0 -1
- package/api/IJsonSchema.js.map +0 -1
- package/api/ILookupRegistry.js.map +0 -1
- package/api/IPropertyExtentions.js.map +0 -1
- package/api/IPropertyRef.js.map +0 -1
- package/api/ISchemaRef.js.map +0 -1
- package/api/ISerializeSupport.js.map +0 -1
- package/browser.js.map +0 -1
- package/decorators/Embeddable.js.map +0 -1
- package/decorators/Entity.js.map +0 -1
- package/decorators/Namespace.js.map +0 -1
- package/decorators/Property.js.map +0 -1
- package/decorators/PropertyOf.js.map +0 -1
- package/decorators/Schema.js.map +0 -1
- package/decorators/validate/Hostname.js.map +0 -1
- package/decorators/validate/Ip4.js.map +0 -1
- package/decorators/validate/Ip6.js.map +0 -1
- package/decorators/validate/IsEmail.js.map +0 -1
- package/decorators/validate/IsNotEmpty.js.map +0 -1
- package/decorators/validate/MaxLength.js.map +0 -1
- package/decorators/validate/MinLength.js.map +0 -1
- package/decorators/validate/Regex.js.map +0 -1
- package/decorators/validate/Required.js.map +0 -1
- package/decorators/validate/index.js.map +0 -1
- package/index.js.map +0 -1
- package/lib/AbstractRef.js.map +0 -1
- package/lib/AnnotationsHelper.js.map +0 -1
- package/lib/ClassRef.js.map +0 -1
- package/lib/Constants.js.map +0 -1
- package/lib/DataContainer.js.map +0 -1
- package/lib/LookupRegistry.js.map +0 -1
- package/lib/SchemaRef.js.map +0 -1
- package/lib/SchemaUtils.js.map +0 -1
- package/lib/functions.js.map +0 -1
- package/lib/json-schema/Constants.js.map +0 -1
- package/lib/json-schema/IJsonSchemaSerializeOptions.js.map +0 -1
- package/lib/json-schema/IJsonSchemaSerializer.js.map +0 -1
- package/lib/json-schema/IJsonSchemaUnserializeOptions.js.map +0 -1
- package/lib/json-schema/IJsonSchemaUnserializer.js.map +0 -1
- package/lib/json-schema/IParseOptions.js.map +0 -1
- package/lib/json-schema/JsonSchema.js.map +0 -1
- package/lib/json-schema/JsonSchema7.js.map +0 -1
- package/lib/json-schema/JsonSchema7Serializer.js.map +0 -1
- package/lib/json-schema/JsonSchema7Unserializer.js.map +0 -1
- package/lib/json-schema/functions.js.map +0 -1
- package/lib/options/IAbstractOptions.js.map +0 -1
- package/lib/options/IAttributeOptions.js.map +0 -1
- package/lib/options/IEntityOptions.js.map +0 -1
- package/lib/options/INamedOptions.js.map +0 -1
- package/lib/options/IObjectOptions.js.map +0 -1
- package/lib/options/IPropertyOptions.js.map +0 -1
- package/lib/options/ISchemaOptions.js.map +0 -1
- package/lib/registry/AbstractRegistry.js.map +0 -1
- package/lib/registry/Binding.js.map +0 -1
- package/lib/registry/DefaultEntityRef.js.map +0 -1
- package/lib/registry/DefaultNamespacedRegistry.js.map +0 -1
- package/lib/registry/DefaultPropertyRef.js.map +0 -1
- package/lib/registry/IRegistryOptions.js.map +0 -1
- package/lib/registry/MetadataRegistry.js.map +0 -1
- package/lib/registry/RegistryFactory.js.map +0 -1
- package/lib/serializer/ISerializeOptions.js.map +0 -1
- package/lib/serializer/ISerializer.js.map +0 -1
- package/lib/serializer/ISerializerFactory.js.map +0 -1
- package/lib/serializer/IUnserializeOptions.js.map +0 -1
- package/lib/serializer/IUnserializer.js.map +0 -1
- package/lib/serializer/SerializerRegistry.js.map +0 -1
- package/lib/validation/DefaultValidator.js.map +0 -1
- package/lib/validation/IValidateOptions.js.map +0 -1
- package/lib/validation/IValidationError.js.map +0 -1
- package/lib/validation/IValidationMessage.js.map +0 -1
- package/lib/validation/IValidationOptions.js.map +0 -1
- package/lib/validation/IValidationResult.js.map +0 -1
- package/lib/validation/IValidator.js.map +0 -1
- package/lib/validation/IValidatorEntry.js.map +0 -1
- package/lib/validation/IValidatorHandle.js.map +0 -1
- package/lib/validation/Validator.js.map +0 -1
|
@@ -13,7 +13,7 @@ export declare class JsonSchema implements ISerializerFactory {
|
|
|
13
13
|
static getUnserializer(options?: IJsonSchemaUnserializeOptions): JsonSchema7Unserializer;
|
|
14
14
|
static serialize(klass: IClassRef | IEntityRef | Function | object, options?: IJsonSchemaSerializeOptions): import("./JsonSchema7").IJsonSchema7;
|
|
15
15
|
static unserialize(data: any, options?: IJsonSchemaUnserializeOptions): Promise<IClassRef | IEntityRef | (IClassRef | IEntityRef)[]>;
|
|
16
|
-
static detectSchemaVersion(schema:
|
|
16
|
+
static detectSchemaVersion(schema: any, fallback?: string): string;
|
|
17
17
|
getName(): string;
|
|
18
18
|
getSerializer(options?: IJsonSchemaSerializeOptions): ISerializer;
|
|
19
19
|
getUnserializer(options?: IJsonSchemaUnserializeOptions): IUnserializer;
|
|
@@ -16,8 +16,8 @@ const Constants_1 = require("./Constants");
|
|
|
16
16
|
const base_1 = require("@allgemein/base");
|
|
17
17
|
const JsonSchema7Unserializer_1 = require("./JsonSchema7Unserializer");
|
|
18
18
|
class JsonSchema {
|
|
19
|
-
static request(
|
|
20
|
-
return __awaiter(this,
|
|
19
|
+
static request(addr_1) {
|
|
20
|
+
return __awaiter(this, arguments, void 0, function* (addr, opts = {}) {
|
|
21
21
|
try {
|
|
22
22
|
if (addr.startsWith('file:///')) {
|
|
23
23
|
const buffer = yield base_1.PlatformUtils.readFile(addr.replace('file://', ''));
|
|
@@ -105,5 +105,3 @@ class JsonSchema {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
exports.JsonSchema = JsonSchema;
|
|
108
|
-
|
|
109
|
-
//# sourceMappingURL=JsonSchema.js.map
|
|
@@ -7,8 +7,8 @@ export interface IJsonSchema7 extends JSONSchema7 {
|
|
|
7
7
|
[key: string]: IJsonSchema7Definition;
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
-
export
|
|
11
|
-
export
|
|
10
|
+
export type IJsonSchema7Definition = IJsonSchema7 | boolean;
|
|
11
|
+
export type IJsonSchema7TypeName = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null';
|
|
12
12
|
export declare const JSON_SCHEMA_7_TYPES: IJsonSchema7TypeName[];
|
|
13
13
|
export declare function hasClassInDefinition(name: string, def: IJsonSchema7): IJsonSchema7Definition;
|
|
14
14
|
export declare function hasClassPropertiesInDefinition(name: string, def: IJsonSchema7): {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.JSON_SCHEMA_7_TYPES = void 0;
|
|
4
|
+
exports.hasClassInDefinition = hasClassInDefinition;
|
|
5
|
+
exports.hasClassPropertiesInDefinition = hasClassPropertiesInDefinition;
|
|
4
6
|
exports.JSON_SCHEMA_7_TYPES = [
|
|
5
7
|
'string',
|
|
6
8
|
'number',
|
|
@@ -13,10 +15,6 @@ exports.JSON_SCHEMA_7_TYPES = [
|
|
|
13
15
|
function hasClassInDefinition(name, def) {
|
|
14
16
|
return def && def.definitions && def.definitions[name];
|
|
15
17
|
}
|
|
16
|
-
exports.hasClassInDefinition = hasClassInDefinition;
|
|
17
18
|
function hasClassPropertiesInDefinition(name, def) {
|
|
18
19
|
return hasClassInDefinition(name, def) && def.definitions[name].properties;
|
|
19
20
|
}
|
|
20
|
-
exports.hasClassPropertiesInDefinition = hasClassPropertiesInDefinition;
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=JsonSchema7.js.map
|
|
@@ -241,7 +241,7 @@ class JsonSchema7Serializer {
|
|
|
241
241
|
}
|
|
242
242
|
else if ((0, lodash_1.isString)(p) && (0, lodash_1.has)(properties, p)) {
|
|
243
243
|
const value = instance[p];
|
|
244
|
-
if (!(0, lodash_1.isNull)(value) ||
|
|
244
|
+
if (!((0, lodash_1.isNull)(value) || (0, lodash_1.isUndefined)(value))) {
|
|
245
245
|
// add default value if exists
|
|
246
246
|
properties[p].default = SchemaUtils_1.SchemaUtils.normValue(value);
|
|
247
247
|
}
|
|
@@ -499,5 +499,3 @@ class JsonSchema7Serializer {
|
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
exports.JsonSchema7Serializer = JsonSchema7Serializer;
|
|
502
|
-
|
|
503
|
-
//# sourceMappingURL=JsonSchema7Serializer.js.map
|
|
@@ -28,7 +28,7 @@ export declare class JsonSchema7Unserializer implements IJsonSchemaUnserializer
|
|
|
28
28
|
* Return namespace if set in passed options or if used in json-schema object.
|
|
29
29
|
* If no match return default namespace
|
|
30
30
|
*/
|
|
31
|
-
getNamespace():
|
|
31
|
+
getNamespace(): string;
|
|
32
32
|
/**
|
|
33
33
|
* Get registry containing elements
|
|
34
34
|
*/
|
|
@@ -51,7 +51,7 @@ export declare class JsonSchema7Unserializer implements IJsonSchemaUnserializer
|
|
|
51
51
|
getClassRef(className: string | Function, namespace?: string): ClassRef;
|
|
52
52
|
parse(data: IJsonSchema7, options?: IParseOptions): Promise<IClassRef | IEntityRef | (IClassRef | IEntityRef)[]>;
|
|
53
53
|
parseRef(data: any, options: IParseOptions): Promise<any>;
|
|
54
|
-
getDefinitionsKey(data:
|
|
54
|
+
getDefinitionsKey(data: any): string;
|
|
55
55
|
followRef($ref: string, data: IJsonSchema7): Promise<any>;
|
|
56
56
|
parseProperties(classRef: IClassRef | IEntityRef, properties: {
|
|
57
57
|
[propertyName: string]: IJsonSchema7Definition;
|
|
@@ -104,8 +104,8 @@ class JsonSchema7Unserializer {
|
|
|
104
104
|
}
|
|
105
105
|
return ClassRef_1.ClassRef.get(className, namespace);
|
|
106
106
|
}
|
|
107
|
-
parse(
|
|
108
|
-
return __awaiter(this,
|
|
107
|
+
parse(data_1) {
|
|
108
|
+
return __awaiter(this, arguments, void 0, function* (data, options = null) {
|
|
109
109
|
let ret = null;
|
|
110
110
|
if (data.type) {
|
|
111
111
|
if (data.type === Constants_2.T_OBJECT) {
|
|
@@ -212,6 +212,7 @@ class JsonSchema7Unserializer {
|
|
|
212
212
|
const defKey = this.getDefinitionsKey(data);
|
|
213
213
|
if (data[defKey]) {
|
|
214
214
|
for (const k of (0, lodash_1.keys)(data[defKey])) {
|
|
215
|
+
// @ts-ignore
|
|
215
216
|
const x = data[defKey][k];
|
|
216
217
|
if (x && x.$id && x.$id === refHashed) {
|
|
217
218
|
return x;
|
|
@@ -232,8 +233,8 @@ class JsonSchema7Unserializer {
|
|
|
232
233
|
throw new Error($ref + ' not found');
|
|
233
234
|
});
|
|
234
235
|
}
|
|
235
|
-
parseProperties(
|
|
236
|
-
return __awaiter(this,
|
|
236
|
+
parseProperties(classRef_1, properties_1) {
|
|
237
|
+
return __awaiter(this, arguments, void 0, function* (classRef, properties, options = null) {
|
|
237
238
|
const _classRef = (0, IEntityRef_1.isEntityRef)(classRef) ? classRef.getClassRef() : classRef;
|
|
238
239
|
const propertyNames = (0, lodash_1.keys)(properties);
|
|
239
240
|
for (const propertyName of propertyNames) {
|
|
@@ -241,8 +242,8 @@ class JsonSchema7Unserializer {
|
|
|
241
242
|
}
|
|
242
243
|
});
|
|
243
244
|
}
|
|
244
|
-
parseProperty(
|
|
245
|
-
return __awaiter(this,
|
|
245
|
+
parseProperty(classRef_1, propertyName_1, data_1) {
|
|
246
|
+
return __awaiter(this, arguments, void 0, function* (classRef, propertyName, data, options = null) {
|
|
246
247
|
const _classRef = (0, IEntityRef_1.isEntityRef)(classRef) ? classRef.getClassRef() : classRef;
|
|
247
248
|
const propRefExits = _classRef.getRegistry()
|
|
248
249
|
.find(Constants_2.METATYPE_PROPERTY, (x) => x.getClassRef() === _classRef && x.name === propertyName);
|
|
@@ -407,8 +408,8 @@ class JsonSchema7Unserializer {
|
|
|
407
408
|
}
|
|
408
409
|
});
|
|
409
410
|
}
|
|
410
|
-
parseTypeObject(
|
|
411
|
-
return __awaiter(this,
|
|
411
|
+
parseTypeObject(data_1) {
|
|
412
|
+
return __awaiter(this, arguments, void 0, function* (data, options = null) {
|
|
412
413
|
let ret = null;
|
|
413
414
|
const id = (0, lodash_1.get)(data, '$id', (0, lodash_1.get)(data, 'id', null));
|
|
414
415
|
let metaType = options.isRoot || !(0, lodash_1.isEmpty)(id) ? Constants_2.METATYPE_ENTITY : Constants_2.METATYPE_CLASS_REF;
|
|
@@ -532,5 +533,3 @@ class JsonSchema7Unserializer {
|
|
|
532
533
|
}
|
|
533
534
|
}
|
|
534
535
|
exports.JsonSchema7Unserializer = JsonSchema7Unserializer;
|
|
535
|
-
|
|
536
|
-
//# sourceMappingURL=JsonSchema7Unserializer.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.setDefaultArray = setDefaultArray;
|
|
4
|
+
exports.getReflectedType = getReflectedType;
|
|
4
5
|
const lodash_1 = require("lodash");
|
|
5
6
|
const Constants_1 = require("../Constants");
|
|
6
7
|
function setDefaultArray(schema) {
|
|
@@ -11,11 +12,7 @@ function setDefaultArray(schema) {
|
|
|
11
12
|
}
|
|
12
13
|
});
|
|
13
14
|
}
|
|
14
|
-
exports.setDefaultArray = setDefaultArray;
|
|
15
15
|
function getReflectedType(clazz, propertyName) {
|
|
16
16
|
return Reflect && Reflect.getMetadata ?
|
|
17
17
|
Reflect.getMetadata(Constants_1.REFLECT_DESIGN_TYPE, clazz, propertyName) : undefined;
|
|
18
18
|
}
|
|
19
|
-
exports.getReflectedType = getReflectedType;
|
|
20
|
-
|
|
21
|
-
//# sourceMappingURL=functions.js.map
|
package/lib/registry/Binding.js
CHANGED
|
@@ -75,6 +75,7 @@ class DefaultValidator {
|
|
|
75
75
|
else {
|
|
76
76
|
value = instance;
|
|
77
77
|
}
|
|
78
|
+
// @ts-ignore
|
|
78
79
|
let instanceOptions = (0, lodash_1.clone)(toValidateEntry.options[handle.name]);
|
|
79
80
|
if (isPropertyCheck) {
|
|
80
81
|
instanceOptions.property = toValidateEntry.property;
|
|
@@ -217,5 +218,3 @@ class DefaultValidator {
|
|
|
217
218
|
exports.DefaultValidator = DefaultValidator;
|
|
218
219
|
DefaultValidator.validators = [];
|
|
219
220
|
DefaultValidator.lookupKeys = ['format', 'validate'];
|
|
220
|
-
|
|
221
|
-
//# sourceMappingURL=DefaultValidator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -2,8 +2,8 @@ import { IValidationError } from './IValidationError';
|
|
|
2
2
|
import { IClassRef } from '../../api/IClassRef';
|
|
3
3
|
import { IEntityRef } from '../../api/IEntityRef';
|
|
4
4
|
import { IValidatorEntry } from './IValidatorEntry';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export type validate_function = (instance: any, ref?: IClassRef | IEntityRef) => Promise<IValidationError[]>;
|
|
6
|
+
export type validate_info_function = (ref?: Function | IClassRef | IEntityRef) => Promise<IValidatorEntry[]>;
|
|
7
7
|
/**
|
|
8
8
|
* Abstraction for defualt validator functions
|
|
9
9
|
*/
|
package/package.json
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allgemein/schema-api",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.34",
|
|
4
4
|
"description": "Library for schema api",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"private": false,
|
|
7
|
-
"browser":
|
|
8
|
-
"./index.js": "./browser.js"
|
|
9
|
-
},
|
|
7
|
+
"browser": "./browser.js",
|
|
10
8
|
"directories": {
|
|
11
9
|
"doc": "docs/de"
|
|
12
10
|
},
|
|
@@ -49,7 +47,7 @@
|
|
|
49
47
|
"del": "6.0.0",
|
|
50
48
|
"eslint": "^8.0.1",
|
|
51
49
|
"eslint-plugin-import": "^2.25.2",
|
|
52
|
-
"got": "
|
|
50
|
+
"got": "version-11",
|
|
53
51
|
"gulp": "4.0.2",
|
|
54
52
|
"gulp-bump": "^3.2.0",
|
|
55
53
|
"gulp-clean": "^0.4.0",
|
|
@@ -58,11 +56,11 @@
|
|
|
58
56
|
"gulp-sourcemaps": "3.0.0",
|
|
59
57
|
"gulp-typescript": "5.0.1",
|
|
60
58
|
"merge-stream": "^2.0.0",
|
|
61
|
-
"mocha": "
|
|
62
|
-
"nyc": "
|
|
59
|
+
"mocha": "10.7.3",
|
|
60
|
+
"nyc": "17.0.0",
|
|
63
61
|
"reflect-metadata": "^0.1.13",
|
|
64
|
-
"ts-node": "
|
|
65
|
-
"typescript": "
|
|
62
|
+
"ts-node": "10.9.2",
|
|
63
|
+
"typescript": "5.5.4"
|
|
66
64
|
},
|
|
67
65
|
"dependencies": {
|
|
68
66
|
"@allgemein/base": "^1.6.2"
|
package/api/IBaseRef.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/api/IBaseRef.ts"],"names":[],"mappings":"","file":"IBaseRef.js","sourcesContent":["import {METADATA_TYPE} from '../lib/Constants';\nimport {ILookupRegistry} from './ILookupRegistry';\nimport {INamedOptions} from \"../lib/options/INamedOptions\";\n\n\nexport interface IBaseRef {\n\n /**\n * Original class name\n */\n name: string;\n\n /**\n * Name for backend system\n */\n storingName: string;\n\n /**\n * Name for processing and identifing\n */\n machineName: string;\n\n /**\n * meta data tpye\n */\n metaType: METADATA_TYPE;\n\n /**\n * Unique identifier\n */\n id(): string;\n\n\n /**\n * Return some options\n */\n getOptions(key?: string, defaultValue?: any): any;\n\n /**\n * Set some option\n */\n setOption(key: string, value: any): void;\n\n /**\n * Set options\n */\n setOptions(value: any): void;\n\n\n /**\n * Return the namespace name.\n */\n getNamespace(): string;\n\n /**\n * Return the registry.\n */\n getRegistry?(): ILookupRegistry;\n\n}\n"],"sourceRoot":".."}
|
package/api/IBuildOptions.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/api/IBuildOptions.ts"],"names":[],"mappings":"","file":"IBuildOptions.js","sourcesContent":["import {IEntityRef} from \"./IEntityRef\";\nimport {IClassRef} from \"./IClassRef\";\n\n/**\n * Build options for generation of object instance\n */\nexport interface IBuildOptions {\n\n\n /**\n * Do not add __CLASS__ and __NS__ in build\n */\n skipClassNamespaceInfo?: boolean;\n\n /**\n * If set only the object instance will be created and all object members will be copied\n */\n createAndCopy?: boolean;\n\n /**\n * Special callback for preprocessing\n *\n * @param entityRef\n * @param from\n * @param to\n */\n beforeBuild?: (entityRef: IEntityRef | IClassRef, from: any, to: any, options?: IBuildOptions) => void\n\n /**\n * Special callback for postprocessing\n *\n * @param entityRef\n * @param from\n * @param to\n */\n afterBuild?: (entityRef: IEntityRef | IClassRef, from: any, to: any, options?: IBuildOptions) => void\n}\n"],"sourceRoot":".."}
|
package/api/IClassRef.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/api/IClassRef.ts"],"names":[],"mappings":";;;AAIA,gDAAoD;AAIpD,SAAgB,UAAU,CAAC,CAAM;IAC/B,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,KAAK,8BAAkB,EAAE;QAC7D,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AALD,gCAKC","file":"IClassRef.js","sourcesContent":["import {IPropertyRef} from './IPropertyRef';\nimport {IBuildOptions} from './IBuildOptions';\nimport {IBaseRef} from './IBaseRef';\nimport {ILookupRegistry} from './ILookupRegistry';\nimport {METATYPE_CLASS_REF} from '../lib/Constants';\nimport {IEntityRef} from './IEntityRef';\n\n\nexport function isClassRef(x: any): x is IClassRef {\n if (x !== undefined && x && x.metaType === METATYPE_CLASS_REF) {\n return true;\n }\n return false;\n}\n\n\nexport interface IClassRef extends IBaseRef {\n\n isPlaceholder(): boolean;\n\n isAnonymous(): boolean;\n\n getClass(create?: boolean): Function;\n\n getPropertyRef(name: string): IPropertyRef;\n\n getPropertyRefs(): IPropertyRef[];\n\n getEntityRef(): IEntityRef;\n\n hasEntityRef(): boolean;\n\n create<T>(addinfo?: boolean): T;\n\n build<T>(instance: any, options?: IBuildOptions): T;\n\n getNamespace(): string;\n\n switchNamespace(namespace: string): void;\n\n getRegistry(): ILookupRegistry;\n\n getExtend(): IClassRef;\n\n getExtends(): IClassRef[];\n\n addExtend(ref: IClassRef): IClassRef;\n\n isOf(instance: any): boolean;\n // toJson(withProperties?: boolean): IClassRefMetadata;\n\n}\n"],"sourceRoot":".."}
|
package/api/IEntityRef.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/api/IEntityRef.ts"],"names":[],"mappings":";;;AAKA,gDAAiD;AAGjD,SAAgB,WAAW,CAAC,CAAM;;IAChC,OAAO,CAAA,MAAC,CAAgB,0CAAE,QAAQ,MAAK,2BAAe,CAAC;AACzD,CAAC;AAFD,kCAEC","file":"IEntityRef.js","sourcesContent":["import {IPropertyRef} from './IPropertyRef';\nimport {IClassRef} from './IClassRef';\nimport {IBuildOptions} from './IBuildOptions';\nimport {IBaseRef} from './IBaseRef';\nimport {ISchemaRef} from './ISchemaRef';\nimport {METATYPE_ENTITY} from \"../lib/Constants\";\n\n\nexport function isEntityRef(x: any): x is IEntityRef {\n return (x as IEntityRef)?.metaType === METATYPE_ENTITY;\n}\n\nexport interface IEntityRef extends IBaseRef {\n\n\n getPropertyRef(name: string): IPropertyRef;\n\n getPropertyRefs(): IPropertyRef[];\n\n getSchemaRefs(): ISchemaRef | ISchemaRef[];\n\n getClassRef(): IClassRef;\n\n getClass(create?: boolean): Function;\n\n create<T>(addinfo?: boolean): T;\n\n build<T>(instance: any, options?: IBuildOptions): T;\n\n isOf(instance: any): boolean;\n\n}\n"],"sourceRoot":".."}
|
package/api/IJsonSchema.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/api/IJsonSchema.ts"],"names":[],"mappings":";;;AAMA,SAAgB,wBAAwB,CAAC,CAAM;IAC7C,IAAI,CAAC,CAAC,YAAY,EAAE;QAClB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AALD,4DAKC;AAED,SAAgB,wBAAwB,CAAC,CAAM;IAC7C,IAAI,CAAC,CAAC,cAAc,EAAE;QACpB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AALD,4DAKC;AAGD,SAAgB,kBAAkB,CAAC,CAAM;IACvC,IAAI,wBAAwB,CAAC,CAAC,CAAC,IAAI,wBAAwB,CAAC,CAAC,CAAC,EAAE;QAC9D,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AALD,gDAKC","file":"IJsonSchema.js","sourcesContent":["import {IJsonSchemaSerializeOptions} from '../lib/json-schema/IJsonSchemaSerializeOptions';\nimport {IClassRef} from './IClassRef';\nimport {IEntityRef} from './IEntityRef';\nimport {IJsonSchemaUnserializeOptions} from '../lib/json-schema/IJsonSchemaUnserializeOptions';\n\n\nexport function supportsJsonSchemaExport(x: any): x is IJsonSchema {\n if (x.toJsonSchema) {\n return true;\n }\n return false;\n}\n\nexport function supportsJsonSchemaImport(x: any): x is IJsonSchema {\n if (x.fromJsonSchema) {\n return true;\n }\n return false;\n}\n\n\nexport function supportsJsonSchema(x: any): x is IJsonSchema {\n if (supportsJsonSchemaExport(x) && supportsJsonSchemaImport(x)) {\n return true;\n }\n return false;\n}\n\n\nexport interface IJsonSchema {\n\n toJsonSchema?(options?: IJsonSchemaSerializeOptions): Promise<any>;\n\n fromJsonSchema?(data: any, options?: IJsonSchemaUnserializeOptions): Promise<IClassRef | IEntityRef | (IClassRef | IEntityRef)[]>;\n\n}\n"],"sourceRoot":".."}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/api/ILookupRegistry.ts"],"names":[],"mappings":";;;AAAA,mCAAkC;AASlC,SAAgB,gBAAgB,CAAC,CAAM;IACrC,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC;QACtB,IAAA,mBAAU,EAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC;QAClC,IAAA,mBAAU,EAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC;QAChC,IAAA,mBAAU,EAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC;QAChC,IAAA,mBAAU,EAAC,CAAC,CAAC,aAAa,CAAC,CAAC,EAC5B;QACA,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAVD,4CAUC","file":"ILookupRegistry.js","sourcesContent":["import {isFunction} from 'lodash';\nimport {IEntityRef} from './IEntityRef';\nimport {IPropertyRef} from './IPropertyRef';\nimport {LookupRegistry} from '../lib/LookupRegistry';\nimport {IClassRef} from './IClassRef';\nimport {ISchemaRef} from './ISchemaRef';\nimport {METADATA_TYPE} from '../lib/Constants';\n\n\nexport function isLookupRegistry(x: any): x is ILookupRegistry {\n if (x !== undefined && x &&\n isFunction(x['getLookupRegistry']) &&\n isFunction(x['getEntityRefFor']) &&\n isFunction(x['getPropertyRefs']) &&\n isFunction(x['getEntities'])\n ) {\n return true;\n }\n return false;\n}\n\n/**\n *\n */\nexport interface ILookupRegistry {\n\n prepare?(): void;\n\n reload?(): void;\n\n ready?(timeout?: number): Promise<boolean>;\n\n getSchemaRefs<T extends ISchemaRef>(filter?: (x: ISchemaRef) => boolean): (T | ISchemaRef)[];\n\n getSchemaRefsFor<T extends ISchemaRef>(fn: string): (T | ISchemaRef);\n\n getSchemaRefsFor<T extends ISchemaRef>(fn: string | IEntityRef | IClassRef): T | ISchemaRef | (T | ISchemaRef)[];\n\n getEntityRefFor<T extends IEntityRef>(fn: string | object | Function, skipNsCheck?: boolean): (T | IEntityRef);\n\n getEntityRefs<T extends IEntityRef>(filter?: (x: IEntityRef) => boolean): (T | IEntityRef)[];\n\n getPropertyRefsFor<T extends IPropertyRef>(fn: string | object | Function): (T | IPropertyRef)[];\n\n getPropertyRef<T extends IPropertyRef>(ref: IClassRef | IEntityRef, name: string): (T | IPropertyRef);\n\n getPropertyRefs<T extends IPropertyRef>(ref: IClassRef | IEntityRef): (T | IPropertyRef)[];\n\n getLookupRegistry(): LookupRegistry;\n\n list<X>(type: METADATA_TYPE, filter?: (x: any) => boolean): X[];\n\n listEntities(filter?: (x: IEntityRef) => boolean): IEntityRef[];\n\n\n listProperties(filter?: (x: IPropertyRef) => boolean): IPropertyRef[];\n\n getClassRefFor(object: string | Function | IClassRef, type: METADATA_TYPE): IClassRef;\n\n\n create<T>(context: string, options: any): T;\n\n /**\n * Add some entries of given context (mostly passing to same method of LookupRegistry)\n *\n * @param context\n * @param entry\n */\n add<T>(context: string, entry: T): T;\n\n /**\n * Remove some entries of given context by search critieria (mostly passing to same method of LookupRegistry)\n *\n * @param context\n * @param entry\n */\n remove<T>(context: string, search: any): T[];\n\n /**\n * Filter some entries of given context by search critieria (mostly passing to same method of LookupRegistry)\n *\n * @param context\n * @param entry\n */\n filter<T>(context: string, search: any): T[];\n\n /**\n * Find some entries of given context by search critieria (mostly passing to same method of LookupRegistry)\n *\n * @param context\n * @param entry\n */\n find<T>(context: string, search: any): T;\n\n /**\n * Reset registry data\n */\n reset(): void;\n\n}\n"],"sourceRoot":".."}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/api/IPropertyExtentions.ts"],"names":[],"mappings":";AAAA,sDAAsD","file":"IPropertyExtentions.js","sourcesContent":["// import {METADATA_AND_BIND_TYPE} from './Constants';\n\nimport {MERGE_TYPE, METADATA_TYPE} from '../lib/Constants';\n\nexport interface IPropertyExtentions {\n\n type: METADATA_TYPE,\n\n object: Function,\n\n property?: string,\n\n options: any\n\n merge?: MERGE_TYPE;\n\n}\n"],"sourceRoot":".."}
|
package/api/IPropertyRef.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/api/IPropertyRef.ts"],"names":[],"mappings":";;;AAGA,gDAAmD;AAEnD,SAAgB,aAAa,CAAC,CAAM;IAClC,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,KAAK,6BAAiB,EAAE;QAC5D,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AALD,sCAKC","file":"IPropertyRef.js","sourcesContent":["import {IClassRef} from './IClassRef';\nimport {IBaseRef} from './IBaseRef';\nimport {IBuildOptions} from './IBuildOptions';\nimport {METATYPE_PROPERTY} from '../lib/Constants';\n\nexport function isPropertyRef(x: any) {\n if (x !== undefined && x && x.metaType === METATYPE_PROPERTY) {\n return true;\n }\n return false;\n}\n\nexport interface IPropertyRef extends IBaseRef {\n\n /**\n * Return if is identifier\n */\n isIdentifier(): boolean;\n\n /**\n * Return if property is a pattern property\n */\n isPattern(): boolean;\n\n isReference(): boolean;\n\n getType(): string | Function;\n\n /**\n * get class ref of the property\n */\n getClassRef(): IClassRef;\n\n getTargetRef(): IClassRef;\n\n /**\n * If property is added by an extra class.\n */\n isAppended(): boolean;\n\n isCollection(): boolean;\n\n convert(i: any, options?: IBuildOptions): any;\n\n // toJson(follow?: boolean): IPropertyRefMetadata;\n\n get(instance: any): any;\n}\n"],"sourceRoot":".."}
|
package/api/ISchemaRef.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/api/ISchemaRef.ts"],"names":[],"mappings":"","file":"ISchemaRef.js","sourcesContent":["import {IBaseRef} from './IBaseRef';\nimport {IEntityRef} from './IEntityRef';\n\nexport interface ISchemaRef extends IBaseRef {\n\n name: string;\n\n getNamespace(): string;\n\n getEntityRefs(): IEntityRef[];\n\n getEntityRefFor(value: string | Function): IEntityRef;\n}\n"],"sourceRoot":".."}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/api/ISerializeSupport.ts"],"names":[],"mappings":";;;AAQA,SAAgB,iBAAiB,CAAC,CAAM;IACtC,IAAI,CAAC,CAAC,SAAS,EAAE;QACf,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AALD,8CAKC;AAED,SAAgB,mBAAmB,CAAC,CAAM;IACxC,IAAI,CAAC,CAAC,WAAW,EAAE;QACjB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AALD,kDAKC;AAGD,SAAgB,qBAAqB,CAAC,CAAM;IAC1C,IAAI,iBAAiB,CAAC,CAAC,CAAC,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE;QAClD,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AALD,sDAKC","file":"ISerializeSupport.js","sourcesContent":["import {IJsonSchemaSerializeOptions} from '../lib/json-schema/IJsonSchemaSerializeOptions';\nimport {IClassRef} from './IClassRef';\nimport {IEntityRef} from './IEntityRef';\nimport {IJsonSchemaUnserializeOptions} from '../lib/json-schema/IJsonSchemaUnserializeOptions';\nimport {ISerializeOptions} from '../lib/serializer/ISerializeOptions';\nimport {IUnserializeOptions} from '../lib/serializer/IUnserializeOptions';\n\n\nexport function supportsSerialize(x: any): x is ISerializeSupport {\n if (x.serialize) {\n return true;\n }\n return false;\n}\n\nexport function supportsUnserialize(x: any): x is ISerializeSupport {\n if (x.unserialize) {\n return true;\n }\n return false;\n}\n\n\nexport function supportsSerialization(x: any): x is ISerializeSupport {\n if (supportsSerialize(x) && supportsUnserialize(x)) {\n return true;\n }\n return false;\n}\n\n\nexport interface ISerializeSupport {\n\n serialize?(options?: ISerializeOptions): Promise<any>;\n\n unserialize?(data: any, options?: IUnserializeOptions): Promise<IClassRef | IEntityRef | (IClassRef | IEntityRef)[]>;\n\n}\n"],"sourceRoot":".."}
|
package/browser.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/browser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,6CAAsD;AAAnC,uGAAA,UAAU,OAAA;AAC7B,+CAAyD;AAArC,yGAAA,WAAW,OAAA;AAC/B,yDAAwE;AAA/C,mHAAA,gBAAgB,OAAA;AAEzC,mDAA+D;AAAzC,6GAAA,aAAa,OAAA;AAEnC,iDAK2B;AAHzB,uHAAA,wBAAwB,OAAA;AACxB,iHAAA,kBAAkB,OAAA;AAClB,uHAAA,wBAAwB,OAAA;AAG1B,8CAA2C;AAAnC,gGAAA,MAAM,OAAA;AACd,kDAA+C;AAAvC,oGAAA,QAAQ,OAAA;AAChB,sDAAmD;AAA3C,wGAAA,UAAU,OAAA;AAClB,sDAAmD;AAA3C,wGAAA,UAAU,OAAA;AAClB,8CAA2C;AAAnC,gGAAA,MAAM,OAAA;AACd,oDAAiD;AAAzC,sGAAA,SAAS,OAAA;AAEjB,2DAKwC;AAJtC,oGAAA,QAAQ,OAAA;AACR,kHAAA,sBAAsB,OAAA;AAEtB,iHAAA,qBAAqB,OAAA;AAGvB,iDAAsE;AAA9D,0FAAA,GAAG,OAAA;AAAE,gGAAA,SAAS,OAAA;AACtB,iDAAsE;AAA9D,0FAAA,GAAG,OAAA;AAAE,gGAAA,SAAS,OAAA;AACtB,yDAAmF;AAA3E,kGAAA,OAAO,OAAA;AAAE,qGAAA,UAAU,OAAA;AAC3B,qDAAiE;AAAzD,8FAAA,KAAK,OAAA;AACb,2DAA0E;AAAlE,oGAAA,QAAQ,OAAA;AAChB,6DAA6E;AAArE,sGAAA,SAAS,OAAA;AACjB,6DAA6E;AAArE,sGAAA,SAAS,OAAA;AACjB,+DAAgF;AAAxE,wGAAA,UAAU,OAAA;AAElB,iDAA8C;AAAtC,0GAAA,WAAW,OAAA;AACnB,oEAAiE;AAAzD,oHAAA,gBAAgB,OAAA;AAExB,6DAA0D;AAAlD,sHAAA,iBAAiB,OAAA;AACzB,2CAAwC;AAAhC,oGAAA,QAAQ,OAAA;AAChB,kDAAgC;AAEhC,qDAAkD;AAA1C,8GAAA,aAAa,OAAA;AACrB,yDAAqD;AAA7C,qGAAA,QAAQ,OAAA;AAMhB,2DAAwD;AAAhD,wGAAA,UAAU,OAAA;AAElB,6DAOuC;AAJrC,mHAAA,oBAAoB,OAAA;AACpB,6HAAA,8BAA8B,OAAA;AAE9B,kHAAA,mBAAmB,OAAA;AAGrB,iFAA8E;AAAtE,8HAAA,qBAAqB,OAAA;AAC7B,qFAAkF;AAA1E,kIAAA,uBAAuB,OAAA;AAC/B,uDAAoD;AAA5C,gHAAA,cAAc,OAAA;AAStB,oEAAiE;AAAzD,oHAAA,gBAAgB,OAAA;AACxB,sFAAmF;AAA3E,sIAAA,yBAAyB,OAAA;AACjC,wEAAqE;AAA7D,wHAAA,kBAAkB,OAAA;AAC1B,oEAAiE;AAAzD,oHAAA,gBAAgB,OAAA;AACxB,kEAA+D;AAAvD,kHAAA,eAAe,OAAA;AACvB,kDAA+C;AAAvC,kGAAA,OAAO,OAAA;AACf,6CAA0C;AAAlC,sGAAA,SAAS,OAAA;AACjB,iDAA8C;AAAtC,0GAAA,WAAW,OAAA;AACnB,sEAAmE;AAA3D,oHAAA,gBAAgB,OAAA;AAOxB,wDAAwE;AAAhE,sGAAA,SAAS,OAAA;AACjB,6CAA6C;AAArC,yGAAA,YAAY,OAAA","file":"browser.js","sourcesContent":["export {IBaseRef} from './api/IBaseRef';\nexport {IBuildOptions} from './api/IBuildOptions';\nexport {IClassRef, isClassRef} from './api/IClassRef';\nexport {IEntityRef, isEntityRef} from './api/IEntityRef';\nexport {ILookupRegistry, isLookupRegistry} from './api/ILookupRegistry';\nexport {IPropertyExtentions} from './api/IPropertyExtentions';\nexport {IPropertyRef, isPropertyRef} from './api/IPropertyRef';\nexport {ISchemaRef} from './api/ISchemaRef';\nexport {\n IJsonSchema,\n supportsJsonSchemaExport,\n supportsJsonSchema,\n supportsJsonSchemaImport\n} from './api/IJsonSchema';\n\nexport {Entity} from './decorators/Entity';\nexport {Property} from './decorators/Property';\nexport {Embeddable} from './decorators/Embeddable';\nexport {PropertyOf} from './decorators/PropertyOf';\nexport {Schema} from './decorators/Schema';\nexport {Namespace} from './decorators/Namespace';\n\nexport {\n Hostname,\n HOSTNAME_RFC1034_REGEX,\n IHostnameOptions,\n HOSTNAME_RFC952_REGEX\n} from './decorators/validate/Hostname';\n\nexport {Ip4, IP4_REGEX, IIp4Options} from './decorators/validate/Ip4';\nexport {Ip6, IP6_REGEX, IIp6Options} from './decorators/validate/Ip6';\nexport {IsEmail, MAIL_REGEX, IIsEmailOptions} from './decorators/validate/IsEmail';\nexport {Regex, IRegexOptions} from './decorators/validate/Regex';\nexport {Required, IRequiredOptions} from './decorators/validate/Required';\nexport {MinLength, IMinLengthOptions} from './decorators/validate/MinLength';\nexport {MaxLength, IMaxLengthOptions} from './decorators/validate/MaxLength';\nexport {IsNotEmpty, IIsNotEmptyOptions} from './decorators/validate/IsNotEmpty';\n\nexport {AbstractRef} from './lib/AbstractRef';\nexport {AbstractRegistry} from './lib/registry/AbstractRegistry';\n\nexport {AnnotationsHelper} from './lib/AnnotationsHelper';\nexport {ClassRef} from './lib/ClassRef';\nexport * from './lib/Constants';\n\nexport {DataContainer} from './lib/DataContainer';\nexport {DRAFT_07} from './lib/json-schema/Constants';\nexport {IJsonSchemaSerializeOptions} from './lib/json-schema/IJsonSchemaSerializeOptions';\nexport {IJsonSchemaSerializer} from './lib/json-schema/IJsonSchemaSerializer';\nexport {IJsonSchemaUnserializeOptions} from './lib/json-schema/IJsonSchemaUnserializeOptions';\nexport {IJsonSchemaUnserializer} from './lib/json-schema/IJsonSchemaUnserializer';\nexport {IParseOptions} from './lib/json-schema/IParseOptions';\nexport {JsonSchema} from './lib/json-schema/JsonSchema';\n\nexport {\n IJsonSchema7,\n IJsonSchema7Definition,\n hasClassInDefinition,\n hasClassPropertiesInDefinition,\n IJsonSchema7TypeName,\n JSON_SCHEMA_7_TYPES\n} from './lib/json-schema/JsonSchema7';\n\nexport {JsonSchema7Serializer} from './lib/json-schema/JsonSchema7Serializer';\nexport {JsonSchema7Unserializer} from './lib/json-schema/JsonSchema7Unserializer';\nexport {LookupRegistry} from './lib/LookupRegistry';\nexport {INamedOptions} from './lib/options/INamedOptions';\nexport {IAbstractOptions} from './lib/options/IAbstractOptions';\nexport {IAttributeOptions} from './lib/options/IAttributeOptions';\nexport {IEntityOptions} from './lib/options/IEntityOptions';\nexport {IObjectOptions} from './lib/options/IObjectOptions';\nexport {IPropertyOptions} from './lib/options/IPropertyOptions';\nexport {ISchemaOptions} from './lib/options/ISchemaOptions';\n\nexport {DefaultEntityRef} from './lib/registry/DefaultEntityRef';\nexport {DefaultNamespacedRegistry} from './lib/registry/DefaultNamespacedRegistry';\nexport {DefaultPropertyRef} from './lib/registry/DefaultPropertyRef';\nexport {MetadataRegistry} from './lib/registry/MetadataRegistry';\nexport {RegistryFactory} from './lib/registry/RegistryFactory';\nexport {Binding} from './lib/registry/Binding';\nexport {SchemaRef} from './lib/SchemaRef';\nexport {SchemaUtils} from './lib/SchemaUtils';\nexport {DefaultValidator} from './lib/validation/DefaultValidator';\nexport {IValidateOptions} from './lib/validation/IValidateOptions';\nexport {IValidatorEntry} from './lib/validation/IValidatorEntry';\nexport {IValidationError} from './lib/validation/IValidationError';\nexport {IValidationMessage} from './lib/validation/IValidationMessage';\nexport {IValidationResult} from './lib/validation/IValidationResult';\nexport {IValidator} from './lib/validation/IValidator';\nexport {Validator, validate_function} from './lib/validation/Validator';\nexport {getClassName} from './lib/functions';\n"],"sourceRoot":"."}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/decorators/Embeddable.ts"],"names":[],"mappings":";;;AACA,gDAAqD;AACrD,uEAAkE;AAGlE,SAAgB,UAAU,CAAC,UAA0B,EAAE;IACrD,OAAO,UAAU,MAAgB;QAC/B,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;QACxB,mCAAgB,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,+BAAmB,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC,CAAC;AACJ,CAAC;AALD,gCAKC","file":"Embeddable.js","sourcesContent":["import {IObjectOptions} from '../lib/options/IObjectOptions';\nimport {METATYPE_EMBEDDABLE} from '../lib/Constants';\nimport {MetadataRegistry} from '../lib/registry/MetadataRegistry';\n\n\nexport function Embeddable(options: IObjectOptions = {}) {\n return function (object: Function) {\n options.target = object;\n MetadataRegistry.$().add(METATYPE_EMBEDDABLE, options);\n };\n}\n\n"],"sourceRoot":".."}
|
package/decorators/Entity.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/decorators/Entity.ts"],"names":[],"mappings":";;;AACA,gDAAiD;AACjD,uEAAkE;AAElE,SAAgB,MAAM,CAAC,UAA0B,EAAE;IACjD,OAAO,UAAU,MAAgB;QAC/B,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;QACxB,mCAAgB,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,2BAAe,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC,CAAC;AACJ,CAAC;AALD,wBAKC","file":"Entity.js","sourcesContent":["import {IEntityOptions} from '../lib/options/IEntityOptions';\nimport {METATYPE_ENTITY} from '../lib/Constants';\nimport {MetadataRegistry} from '../lib/registry/MetadataRegistry';\n\nexport function Entity(options: IEntityOptions = {}) {\n return function (object: Function) {\n options.target = object;\n MetadataRegistry.$().add(METATYPE_ENTITY, options);\n };\n}\n\n"],"sourceRoot":".."}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/decorators/Namespace.ts"],"names":[],"mappings":";;;AAAA,gDAA8G;AAC9G,uEAAkE;AAGlE,SAAgB,SAAS,CAAC,EAAU;IAClC,OAAO,UAAU,MAAgB;QAC/B,MAAM,OAAO,GAAsB;YACjC,MAAM,EAAE,MAAM;YACd,WAAW,EAAE;gBACX,2BAAe;gBACf,8BAAkB;gBAClB,+BAAmB;aACpB;YACD,UAAU,EAAE;gBACV,SAAS,EAAE,EAAE;aACd;SACF,CAAC;QACF,mCAAgB,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,8BAAkB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC,CAAC;AACJ,CAAC;AAfD,8BAeC","file":"Namespace.js","sourcesContent":["import {METATYPE_CLASS_REF, METATYPE_EMBEDDABLE, METATYPE_ENTITY, METATYPE_NAMESPACE} from '../lib/Constants';\nimport {MetadataRegistry} from '../lib/registry/MetadataRegistry';\nimport {IAttributeOptions} from '../lib/options/IAttributeOptions';\n\nexport function Namespace(ns: string) {\n return function (object: Function) {\n const options: IAttributeOptions = {\n target: object,\n targetTypes: [\n METATYPE_ENTITY,\n METATYPE_CLASS_REF,\n METATYPE_EMBEDDABLE\n ],\n attributes: {\n namespace: ns\n }\n };\n MetadataRegistry.$().add(METATYPE_NAMESPACE, options, false);\n };\n}\n\n"],"sourceRoot":".."}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/decorators/Property.ts"],"names":[],"mappings":";;;AAAA,4BAA0B;AAC1B,mCAAkE;AAClE,0CAA2C;AAE3C,gDAO0B;AAC1B,uEAAkE;AAElE,SAAgB,QAAQ,CAAC,gBAAsD,IAAI;IACjF,OAAO,UAAU,MAAW,EAAE,YAAoB;QAEhD,IAAI,OAAO,GAAqB;YAC9B,IAAI,EAAE,SAAS;SAChB,CAAC;QAGF,IAAI,IAAA,iBAAQ,EAAC,aAAa,CAAC,EAAE;YAC3B,OAAO,CAAC,IAAI,GAAkB,aAAa,CAAC;SAC7C;aAAM,IAAI,IAAA,mBAAU,EAAC,aAAa,CAAC,EAAE;YACpC,MAAM,IAAI,GAAG,iBAAU,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;YACpD,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBAC9C,OAAO,CAAC,IAAI,GAAG,aAAa,EAAE,CAAC;aAChC;iBAAM;gBACL,OAAO,CAAC,IAAI,GAAG,aAAa,CAAC;aAC9B;SACF;aAAM,IAAI,aAAa,IAAI,IAAA,qBAAY,EAAC,aAAa,CAAC,EAAE;YACvD,IAAA,eAAM,EAAC,OAAO,EAAE,aAAa,CAAC,CAAC;YAC/B,IAAI,OAAO,CAAC,IAAI,IAAI,IAAA,mBAAU,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBAC5C,MAAM,IAAI,GAAG,iBAAU,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBACnD,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;oBAC9C,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;iBAC/B;aACF;SACF;QAED,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC;QACpC,OAAO,CAAC,YAAY,GAAG,YAAY,CAAC;QAEpC,MAAM,mBAAmB,GAAG,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,+BAAmB,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAExI,IAAI,mBAAmB,EAAE;YACvB,MAAM,SAAS,GAAG,iBAAU,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;YAC/D,IAAI,8BAAkB,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,EAAS,CAAC,EAAE;gBAC/D,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;aACtE;iBAAM,IAAI,SAAS,KAAK,KAAK,CAAC,IAAI,EAAE;gBACnC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAQ,CAAC;gBACtD,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;aACzB;iBAAM;gBACL,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC;aAClE;SACF;QAED,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;YACjB,OAAO,CAAC,IAAI,GAAG,oBAAQ,CAAC;SACzB;QAED,mCAAgB,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,6BAAiB,EAAE,OAAO,CAAC,CAAC;IAEvD,CAAC,CAAC;AACJ,CAAC;AAnDD,4BAmDC","file":"Property.js","sourcesContent":["import 'reflect-metadata';\nimport {assign, isFunction, isObjectLike, isString} from 'lodash';\nimport {ClassUtils} from '@allgemein/base';\nimport {IPropertyOptions} from '../lib/options/IPropertyOptions';\nimport {\n JS_DATA_TYPES,\n JS_PRIMATIVE_TYPES,\n METATYPE_PROPERTY,\n REFLECT_DESIGN_TYPE,\n T_OBJECT,\n T_STRING\n} from '../lib/Constants';\nimport {MetadataRegistry} from '../lib/registry/MetadataRegistry';\n\nexport function Property(typeOrOptions: IPropertyOptions | Function | string = null) {\n return function (source: any, propertyName: string) {\n\n let options: IPropertyOptions = {\n type: undefined\n };\n\n\n if (isString(typeOrOptions)) {\n options.type = <JS_DATA_TYPES>typeOrOptions;\n } else if (isFunction(typeOrOptions)) {\n const name = ClassUtils.getClassName(typeOrOptions);\n if ([Function.name, '', 'type'].includes(name)) {\n options.type = typeOrOptions();\n } else {\n options.type = typeOrOptions;\n }\n } else if (typeOrOptions && isObjectLike(typeOrOptions)) {\n assign(options, typeOrOptions);\n if (options.type && isFunction(options.type)) {\n const name = ClassUtils.getClassName(options.type);\n if ([Function.name, '', 'type'].includes(name)) {\n options.type = options.type();\n }\n }\n }\n\n options.target = source.constructor;\n options.propertyName = propertyName;\n\n const reflectMetadataType = Reflect && Reflect.getMetadata ? Reflect.getMetadata(REFLECT_DESIGN_TYPE, source, propertyName) : undefined;\n\n if (reflectMetadataType) {\n const className = ClassUtils.getClassName(reflectMetadataType);\n if (JS_PRIMATIVE_TYPES.includes(className.toLowerCase() as any)) {\n options.type = options.type ? options.type : className.toLowerCase();\n } else if (className === Array.name) {\n options.type = options.type ? options.type : T_OBJECT;\n options.cardinality = 0;\n } else {\n options.type = options.type ? options.type : reflectMetadataType;\n }\n }\n\n if (!options.type) {\n options.type = T_STRING;\n }\n\n MetadataRegistry.$().add(METATYPE_PROPERTY, options);\n\n };\n}\n"],"sourceRoot":".."}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/decorators/PropertyOf.ts"],"names":[],"mappings":";;;AAAA,mCAA4C;AAG5C,uEAAkE;AAClE,gDAAmD;AAGnD,SAAgB,UAAU,CAAC,YAAoB,EAAE,eAAqD,EAAE,UAA4B,IAAI;IACtI,OAAO,UAAU,MAAW;QAC1B,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,EAAE,CAAC;SACd;QAED,IAAI,IAAA,iBAAQ,EAAC,eAAe,CAAC,IAAI,IAAA,mBAAU,EAAC,eAAe,CAAC,EAAE;YAC5D,OAAO,CAAC,MAAM,GAAG,eAAe,CAAC;SAClC;aAAM;YACL,OAAO,GAAqB,eAAe,CAAC;SAC7C;QAED,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;QACxB,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;QACtB,IAAI,YAAY,EAAE;YAChB,OAAO,CAAC,YAAY,GAAG,YAAY,CAAC;SACrC;QACD,mCAAgB,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,6BAAiB,EAAE,OAAO,CAAC,CAAC;IACvD,CAAC,CAAC;AACJ,CAAC;AAnBD,gCAmBC","file":"PropertyOf.js","sourcesContent":["import {isFunction, isString} from 'lodash';\n\nimport {IPropertyOptions} from '../lib/options/IPropertyOptions';\nimport {MetadataRegistry} from '../lib/registry/MetadataRegistry';\nimport {METATYPE_PROPERTY} from '../lib/Constants';\n\n\nexport function PropertyOf(propertyName: string, entityOrOptions: IPropertyOptions | string | Function, options: IPropertyOptions = null) {\n return function (object: any) {\n if (!options) {\n options = {};\n }\n\n if (isString(entityOrOptions) || isFunction(entityOrOptions)) {\n options.target = entityOrOptions;\n } else {\n options = <IPropertyOptions>entityOrOptions;\n }\n\n options.appended = true;\n options.type = object;\n if (propertyName) {\n options.propertyName = propertyName;\n }\n MetadataRegistry.$().add(METATYPE_PROPERTY, options);\n };\n}\n"],"sourceRoot":".."}
|
package/decorators/Schema.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/decorators/Schema.ts"],"names":[],"mappings":";;;AACA,gDAAiD;AACjD,uEAAkE;AAGlE,SAAgB,MAAM,CAAC,OAAuB;IAC5C,OAAO,UAAU,MAAgB;QAC/B,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;QACxB,mCAAgB,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,2BAAe,EAAE,OAAO,CAAC,CAAC;IACrD,CAAC,CAAC;AACJ,CAAC;AALD,wBAKC","file":"Schema.js","sourcesContent":["import {ISchemaOptions} from '../lib/options/ISchemaOptions';\nimport {METATYPE_SCHEMA} from '../lib/Constants';\nimport {MetadataRegistry} from '../lib/registry/MetadataRegistry';\n\n\nexport function Schema(options: ISchemaOptions) {\n return function (object: Function) {\n options.target = object;\n MetadataRegistry.$().add(METATYPE_SCHEMA, options);\n };\n}\n\n"],"sourceRoot":".."}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/decorators/validate/Hostname.ts"],"names":[],"mappings":";;;AAAA,mCAAkE;AAElE,mEAA8D;AAC9D,4EAAuE;AAOvE,SAAgB,QAAQ,CAAC,OAA0B;IACjD,OAAO,UAAU,MAAW,EAAE,YAAoB;QAChD,MAAM,IAAI,GAAQ;YAChB,MAAM,EAAE,UAAU;SAEnB,CAAC;QAEF,IAAI,OAAO,EAAE;YACX,IAAA,eAAM,EAAC,IAAI,EAAE,EAAC,eAAe,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAC,EAAC,CAAC,CAAC;YAChD,IAAA,eAAM,EAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;SAChD;QAED,qCAAiB,CAAC,aAAa,CAC7B,MAAM,CAAC,WAAW,EAClB,YAAY,EACZ,IAAI,EACJ,OAAO,CACR,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAnBD,4BAmBC;AAEY,QAAA,qBAAqB,GAAG,iGAAiG,CAAC;AAC1H,QAAA,sBAAsB,GAAG,6GAA6G,CAAC;AAEpJ,mCAAgB,CAAC,MAAM,CAAC;IACpB,IAAI,EAAE,UAAU;IAChB,EAAE,EAAE,CAAC,KAAa,EAAE,OAA0B,EAAE,QAAc,EAAE,EAAE;QAChE,IAAI,IAAA,oBAAW,EAAC,KAAK,CAAC,IAAI,IAAA,eAAM,EAAC,KAAK,CAAC,IAAI,CAAC,IAAA,iBAAQ,EAAC,KAAK,CAAC,EAAE;YAC3D,0CAA0C;YAC1C,iBAAiB;YACjB,IAAI;YACJ,OAAO,KAAK,CAAC;SACd;QACD,OAAO,6BAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IACD,cAAc,EAAE;QACd,OAAO,EAAE,6DAA6D;KACvE;CACF,CACF,CAAC","file":"Hostname.js","sourcesContent":["import {assign, get, isNull, isUndefined, isString} from 'lodash';\n\nimport {AnnotationsHelper} from '../../lib/AnnotationsHelper';\nimport {DefaultValidator} from '../../lib/validation/DefaultValidator';\nimport {IValidateOptions} from '../../lib/validation/IValidateOptions';\n\nexport interface IHostnameOptions extends IValidateOptions {\n // required?: boolean;\n}\n\nexport function Hostname(options?: IHostnameOptions) {\n return function (source: any, propertyName: string) {\n const opts: any = {\n format: 'hostname',\n\n };\n\n if (options) {\n assign(opts, {validateOptions: {hostname: {}}});\n assign(opts.validateOptions.hostname, options);\n }\n\n AnnotationsHelper.forPropertyOn(\n source.constructor,\n propertyName,\n opts,\n 'merge'\n );\n };\n}\n\nexport const HOSTNAME_RFC952_REGEX = /^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\\-]*[A-Za-z0-9])$/;\nexport const HOSTNAME_RFC1034_REGEX = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$/;\n\nDefaultValidator.define({\n name: 'hostname',\n fn: (value: string, options?: IHostnameOptions, instance?: any) => {\n if (isUndefined(value) || isNull(value) || !isString(value)) {\n // if (!get(options, 'required', false)) {\n // return true;\n // }\n return false;\n }\n return HOSTNAME_RFC952_REGEX.test(value);\n },\n defaultOptions: {\n message: 'Value of property \"%propertyName\" must be a valid hostname.'\n }\n }\n);\n"],"sourceRoot":"../.."}
|