@allgemein/schema-api 1.5.24 → 1.5.26
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.d.ts +0 -4
- package/api/IBaseRef.js.map +1 -1
- package/api/IEntityRef.js +2 -2
- package/api/IEntityRef.js.map +1 -1
- package/browser.d.ts +2 -0
- package/browser.js.map +1 -1
- package/lib/AbstractRef.d.ts +32 -4
- package/lib/AbstractRef.js +35 -29
- package/lib/AbstractRef.js.map +1 -1
- package/lib/Constants.d.ts +1 -0
- package/lib/Constants.js +2 -1
- package/lib/Constants.js.map +1 -1
- package/lib/options/IAttributeOptions.js.map +1 -1
- package/lib/options/IEntityOptions.d.ts +2 -2
- package/lib/options/IEntityOptions.js.map +1 -1
- package/lib/options/INamedOptions.d.ts +13 -0
- package/lib/options/INamedOptions.js +4 -0
- package/lib/options/INamedOptions.js.map +1 -0
- package/lib/options/IObjectOptions.d.ts +2 -2
- package/lib/options/IObjectOptions.js.map +1 -1
- package/lib/options/IPropertyOptions.d.ts +1 -0
- package/lib/options/IPropertyOptions.js.map +1 -1
- package/lib/options/ISchemaOptions.d.ts +5 -1
- package/lib/options/ISchemaOptions.js.map +1 -1
- package/package.json +1 -1
package/api/IBaseRef.d.ts
CHANGED
package/api/IBaseRef.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/api/IBaseRef.ts"],"names":[],"mappings":"","file":"IBaseRef.js","sourcesContent":["import {METADATA_TYPE} from '../lib/Constants';\nimport {ILookupRegistry} from './ILookupRegistry';\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
|
|
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/IEntityRef.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isEntityRef = void 0;
|
|
4
|
-
|
|
4
|
+
const Constants_1 = require("../lib/Constants");
|
|
5
5
|
function isEntityRef(x) {
|
|
6
6
|
var _a;
|
|
7
|
-
return ((_a = x) === null || _a === void 0 ? void 0 : _a.metaType) ===
|
|
7
|
+
return ((_a = x) === null || _a === void 0 ? void 0 : _a.metaType) === Constants_1.METATYPE_ENTITY;
|
|
8
8
|
}
|
|
9
9
|
exports.isEntityRef = isEntityRef;
|
|
10
10
|
|
package/api/IEntityRef.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/api/IEntityRef.ts"],"names":[],"mappings":";;;
|
|
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/browser.d.ts
CHANGED
|
@@ -39,7 +39,9 @@ export { IJsonSchema7, IJsonSchema7Definition, hasClassInDefinition, hasClassPro
|
|
|
39
39
|
export { JsonSchema7Serializer } from './lib/json-schema/JsonSchema7Serializer';
|
|
40
40
|
export { JsonSchema7Unserializer } from './lib/json-schema/JsonSchema7Unserializer';
|
|
41
41
|
export { LookupRegistry } from './lib/LookupRegistry';
|
|
42
|
+
export { INamedOptions } from './lib/options/INamedOptions';
|
|
42
43
|
export { IAbstractOptions } from './lib/options/IAbstractOptions';
|
|
44
|
+
export { IAttributeOptions } from './lib/options/IAttributeOptions';
|
|
43
45
|
export { IEntityOptions } from './lib/options/IEntityOptions';
|
|
44
46
|
export { IObjectOptions } from './lib/options/IObjectOptions';
|
|
45
47
|
export { IPropertyOptions } from './lib/options/IPropertyOptions';
|
package/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/browser.ts"],"names":[],"mappings":";;;;AAWA,
|
|
1
|
+
{"version":3,"sources":["../../../src/browser.ts"],"names":[],"mappings":";;;;AAWA,iDAK2B;AAHzB,uHAAA,wBAAwB,OAAA;AACxB,iHAAA,kBAAkB,OAAA;AAClB,uHAA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C;AAArC,yGAAA,YAAY,OAAA","file":"browser.js","sourcesContent":["// ---- Generated by gulp taskRef ----\nimport exp = require(\"constants\");\n\nexport {IBaseRef} from './api/IBaseRef';\nexport {IBuildOptions} from './api/IBuildOptions';\nexport {IClassRef} from './api/IClassRef';\nexport {IEntityRef} from './api/IEntityRef';\nexport {ILookupRegistry} from './api/ILookupRegistry';\nexport {IPropertyExtentions} from './api/IPropertyExtentions';\nexport {IPropertyRef} 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 {\n METATYPE_SCHEMA,\n METATYPE_ENTITY,\n METATYPE_PROPERTY,\n METATYPE_CLASS_REF,\n METATYPE_NAMESPACE,\n METADATA_TYPE,\n DEFAULT_NAMESPACE,\n XS_ANNOTATION_OPTIONS_CACHE,\n MERGE_TYPE, IMinMax, ClassType,\n __CLASS__, __NS__,\n C_EVENT_ADD, C_EVENT_REMOVE, C_EVENT_UPDATE,\n C_PROP_NAME, CLASS_TYPE, GLOBAL_NAMESPACE, JS_DATA_TYPES, JS_PRIMATIVE_TYPES,\n METADATA_REGISTRY, METATYPE_EMBEDDABLE,\n OPT_CREAT_AND_COPY, REFLECT_DESIGN_TYPE, STATE_KEY,\n T_STRING, XS_DATA_TYPES,\n XS_DEFAULT_CLASSES,\n XS_DEFAULT_SCHEMA,\n METADATA_AND_BIND_TYPE,\n XS_ID_SEPARATOR, BINDING_SCHEMA_ENTITY, BINDING_SCHEMA_CLASS_REF\n} 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';\n\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":"."}
|
package/lib/AbstractRef.d.ts
CHANGED
|
@@ -3,29 +3,57 @@ import { IBaseRef } from '../api/IBaseRef';
|
|
|
3
3
|
import { IClassRef } from '../api/IClassRef';
|
|
4
4
|
import { ILookupRegistry } from '../api/ILookupRegistry';
|
|
5
5
|
export declare abstract class AbstractRef implements IBaseRef {
|
|
6
|
+
/**
|
|
7
|
+
* Type of this entry
|
|
8
|
+
*/
|
|
6
9
|
readonly metaType: METADATA_TYPE;
|
|
10
|
+
/**
|
|
11
|
+
* Namespace better registry of this entry
|
|
12
|
+
*/
|
|
7
13
|
namespace: string;
|
|
8
14
|
private _cachedOptions;
|
|
9
15
|
readonly name: string;
|
|
10
16
|
readonly object: IClassRef;
|
|
11
17
|
constructor(type: METADATA_TYPE, name: string, object?: IClassRef | Function | string, namespace?: string);
|
|
12
|
-
abstract getClassRefFor(object: string | Function | IClassRef, type: METADATA_TYPE): IClassRef;
|
|
13
18
|
getNamespace(): string;
|
|
14
|
-
abstract getRegistry(): ILookupRegistry;
|
|
15
19
|
getSourceRef(): IClassRef;
|
|
20
|
+
abstract getClassRefFor(object: string | Function | IClassRef, type: METADATA_TYPE): IClassRef;
|
|
21
|
+
abstract getRegistry(): ILookupRegistry;
|
|
16
22
|
protected getOptionsEntry(): any;
|
|
17
23
|
getOptions(key?: string, defaultValue?: any): any;
|
|
18
24
|
setOptions(options: any): void;
|
|
19
25
|
setOption(key: string, value: any): void;
|
|
20
26
|
hasOption(key: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Return class ref
|
|
29
|
+
*/
|
|
21
30
|
getClassRef(): IClassRef;
|
|
31
|
+
/**
|
|
32
|
+
* Get class for the entry
|
|
33
|
+
*
|
|
34
|
+
* @param create: create anonymous placeholder if no class exists
|
|
35
|
+
*/
|
|
22
36
|
getClass(create?: boolean): Function;
|
|
23
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Return the name of the class ref, if not exits then return null
|
|
39
|
+
*/
|
|
24
40
|
get originalName(): string;
|
|
41
|
+
/**
|
|
42
|
+
* Return internal name (same as calling storingName)
|
|
43
|
+
*/
|
|
44
|
+
get internalName(): string;
|
|
45
|
+
/**
|
|
46
|
+
* Return name in snake case notation
|
|
47
|
+
*/
|
|
48
|
+
get machineName(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Return internal name, check if internalName is set else check if name options is present
|
|
51
|
+
*
|
|
52
|
+
*/
|
|
25
53
|
get storingName(): any;
|
|
26
54
|
abstract id(): string;
|
|
27
55
|
/**
|
|
28
|
-
* Return supported
|
|
56
|
+
* Return supported primitive data types
|
|
29
57
|
*/
|
|
30
58
|
getSupportedDataTypes(): JS_DATA_TYPES[];
|
|
31
59
|
}
|
package/lib/AbstractRef.js
CHANGED
|
@@ -7,6 +7,9 @@ const IClassRef_1 = require("../api/IClassRef");
|
|
|
7
7
|
const MetadataRegistry_1 = require("./registry/MetadataRegistry");
|
|
8
8
|
class AbstractRef {
|
|
9
9
|
constructor(type, name, object = null, namespace = Constants_1.DEFAULT_NAMESPACE) {
|
|
10
|
+
/**
|
|
11
|
+
* Namespace better registry of this entry
|
|
12
|
+
*/
|
|
10
13
|
this.namespace = Constants_1.DEFAULT_NAMESPACE;
|
|
11
14
|
this.namespace = namespace;
|
|
12
15
|
this.metaType = type;
|
|
@@ -80,47 +83,50 @@ class AbstractRef {
|
|
|
80
83
|
const opts = this.getOptionsEntry();
|
|
81
84
|
return (0, lodash_1.has)(opts, key);
|
|
82
85
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
// }
|
|
87
|
-
// return this.options;
|
|
88
|
-
// }
|
|
89
|
-
//
|
|
90
|
-
// setOptions(opts: any) {
|
|
91
|
-
// if (opts && !isEmpty(keys(opts))) {
|
|
92
|
-
// if (!isEmpty(keys(this.options))) {
|
|
93
|
-
// this.options = merge(this.options, opts);
|
|
94
|
-
// } else {
|
|
95
|
-
// this.options = opts;
|
|
96
|
-
// }
|
|
97
|
-
// }
|
|
98
|
-
// }
|
|
99
|
-
//
|
|
100
|
-
//
|
|
101
|
-
// setOption(key: string, value: any) {
|
|
102
|
-
// if (!this.options) {
|
|
103
|
-
// this.options = <any>{};
|
|
104
|
-
// }
|
|
105
|
-
// set(<any>this.options, key, value);
|
|
106
|
-
// }
|
|
86
|
+
/**
|
|
87
|
+
* Return class ref
|
|
88
|
+
*/
|
|
107
89
|
getClassRef() {
|
|
108
90
|
return this.object;
|
|
109
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Get class for the entry
|
|
94
|
+
*
|
|
95
|
+
* @param create: create anonymous placeholder if no class exists
|
|
96
|
+
*/
|
|
110
97
|
getClass(create = false) {
|
|
111
98
|
return this.getClassRef().getClass(create);
|
|
112
99
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
100
|
+
/**
|
|
101
|
+
* Return the name of the class ref, if not exits then return null
|
|
102
|
+
*/
|
|
116
103
|
get originalName() {
|
|
117
104
|
if (this.object) {
|
|
118
105
|
return this.object.name;
|
|
119
106
|
}
|
|
120
107
|
return null;
|
|
121
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Return internal name (same as calling storingName)
|
|
111
|
+
*/
|
|
112
|
+
get internalName() {
|
|
113
|
+
return this.storingName;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Return name in snake case notation
|
|
117
|
+
*/
|
|
118
|
+
get machineName() {
|
|
119
|
+
return (0, lodash_1.snakeCase)(this.name);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Return internal name, check if internalName is set else check if name options is present
|
|
123
|
+
*
|
|
124
|
+
*/
|
|
122
125
|
get storingName() {
|
|
123
|
-
let name = null;
|
|
126
|
+
let name = this.getOptions(Constants_1.C_INTERNAL_NAME, null);
|
|
127
|
+
if (name) {
|
|
128
|
+
return name;
|
|
129
|
+
}
|
|
124
130
|
if (this.metaType === Constants_1.METATYPE_PROPERTY) {
|
|
125
131
|
name = this.getOptions(Constants_1.C_NAME, null);
|
|
126
132
|
if (!name) {
|
|
@@ -138,7 +144,7 @@ class AbstractRef {
|
|
|
138
144
|
return name;
|
|
139
145
|
}
|
|
140
146
|
/**
|
|
141
|
-
* Return supported
|
|
147
|
+
* Return supported primitive data types
|
|
142
148
|
*/
|
|
143
149
|
getSupportedDataTypes() {
|
|
144
150
|
return Constants_1.JS_DATA_TYPES;
|
package/lib/AbstractRef.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/AbstractRef.ts"],"names":[],"mappings":";;;AAAA,mCAAuE;AACvE,
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/AbstractRef.ts"],"names":[],"mappings":";;;AAAA,mCAAuE;AACvE,2CAQqB;AAErB,gDAAuD;AACvD,kEAA6D;AAI7D,MAAsB,WAAW;I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AAM,CAAC,CAAC;IAC7C,CAAC;IAGD;;OAEG;IACH,IAAI,YAAY;QACd,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;SACzB;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAGD;;OAEG;IACH,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAI,WAAW;QACb,OAAO,IAAA,kBAAS,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,IAAI,WAAW;QACb,IAAI,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,2BAAe,EAAE,IAAI,CAAC,CAAC;QAClD,IAAI,IAAI,EAAE;YACR,OAAO,IAAI,CAAC;SACb;QACD,IAAI,IAAI,CAAC,QAAQ,KAAK,6BAAiB,EAAE;YACvC,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,kBAAM,EAAE,IAAI,CAAC,CAAC;YACrC,IAAI,CAAC,IAAI,EAAE;gBACT,IAAI,GAAG,IAAA,kBAAS,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC7B;SACF;aAAM;YACL,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,YAAY,EAAE;gBACnC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;aAClB;iBAAM;gBACL,IAAI,GAAG,IAAA,kBAAS,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAC7B;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAMD;;OAEG;IACH,qBAAqB;QACnB,OAAO,yBAAa,CAAC;IACvB,CAAC;CAGF;AA/LD,kCA+LC","file":"AbstractRef.js","sourcesContent":["import {assign, get, has, isEmpty, keys, set, snakeCase} from 'lodash';\nimport {\n C_INTERNAL_NAME,\n C_NAME,\n DEFAULT_NAMESPACE,\n JS_DATA_TYPES,\n METADATA_TYPE,\n METATYPE_PROPERTY,\n METATYPE_SCHEMA,\n} from './Constants';\nimport {IBaseRef} from '../api/IBaseRef';\nimport {IClassRef, isClassRef} from '../api/IClassRef';\nimport {MetadataRegistry} from './registry/MetadataRegistry';\nimport {ILookupRegistry} from '../api/ILookupRegistry';\n\n\nexport abstract class AbstractRef implements IBaseRef {\n\n /**\n * Type of this entry\n */\n readonly metaType: METADATA_TYPE;\n\n /**\n * Namespace better registry of this entry\n */\n namespace: string = DEFAULT_NAMESPACE;\n\n private _cachedOptions: any;\n\n readonly name: string;\n\n readonly object: IClassRef;\n\n\n constructor(type: METADATA_TYPE,\n name: string,\n object: IClassRef | Function | string = null,\n namespace: string = DEFAULT_NAMESPACE) {\n this.namespace = namespace;\n this.metaType = type;\n this.name = name;\n if (isClassRef(object)) {\n this.object = object;\n } else {\n this.object = object ? this.getClassRefFor(object, type) : null;\n }\n }\n\n\n getNamespace() {\n return this.namespace;\n }\n\n\n getSourceRef() {\n return this.object;\n }\n\n abstract getClassRefFor(object: string | Function | IClassRef, type: METADATA_TYPE): IClassRef;\n\n abstract getRegistry(): ILookupRegistry;\n\n protected getOptionsEntry() {\n if (!this._cachedOptions) {\n if (this.metaType === METATYPE_PROPERTY) {\n this._cachedOptions = MetadataRegistry.$().findCached(this.metaType, (x: any) =>\n x.target === this.getClass(true) &&\n x.propertyName === this.name &&\n x.namespace === this.getNamespace()\n );\n if (!this._cachedOptions) {\n this._cachedOptions = {target: this.getClass(true), propertyName: this.name, namespace: this.getNamespace()};\n MetadataRegistry.$().addCached(this.metaType, this._cachedOptions);\n }\n } else if (this.metaType === METATYPE_SCHEMA) {\n this._cachedOptions = MetadataRegistry.$().findCached(this.metaType, (x: any) =>\n x.name === this.name &&\n x.namespace === this.getNamespace()\n );\n if (!this._cachedOptions) {\n this._cachedOptions = {name: this.name, namespace: this.getNamespace()};\n MetadataRegistry.$().addCached(this.metaType, this._cachedOptions);\n }\n } else {\n this._cachedOptions = MetadataRegistry.$().findCached(this.metaType, (x: any) =>\n x.target === this.getClass(true) &&\n x.namespace === this.getNamespace()\n );\n if (!this._cachedOptions) {\n this._cachedOptions = {target: this.getClass(true), namespace: this.getNamespace()};\n MetadataRegistry.$().addCached(this.metaType, this._cachedOptions);\n }\n }\n }\n return this._cachedOptions;\n }\n\n getOptions(key?: string, defaultValue: any = null): any {\n if (key) {\n return get(this.getOptionsEntry(), key, defaultValue);\n }\n return this.getOptionsEntry();\n }\n\n setOptions(options: any) {\n if (options && !isEmpty(keys(options))) {\n const opts = this.getOptionsEntry();\n // if same object cause taken from MetadataRegistry then ignore setting\n if (opts !== options) {\n for (const k of keys(opts)) {\n delete opts[k];\n }\n assign(opts, options);\n }\n }\n }\n\n setOption(key: string, value: any) {\n const opts = this.getOptionsEntry();\n set(opts, key, value);\n }\n\n hasOption(key: string) {\n const opts = this.getOptionsEntry();\n return has(opts, key);\n }\n\n /**\n * Return class ref\n */\n getClassRef(): IClassRef {\n return this.object;\n }\n\n\n /**\n * Get class for the entry\n *\n * @param create: create anonymous placeholder if no class exists\n */\n getClass(create: boolean = false): Function {\n return this.getClassRef().getClass(create);\n }\n\n\n /**\n * Return the name of the class ref, if not exits then return null\n */\n get originalName() {\n if (this.object) {\n return this.object.name;\n }\n return null;\n }\n\n\n /**\n * Return internal name (same as calling storingName)\n */\n get internalName(): string {\n return this.storingName;\n }\n\n /**\n * Return name in snake case notation\n */\n get machineName() {\n return snakeCase(this.name);\n }\n\n /**\n * Return internal name, check if internalName is set else check if name options is present\n *\n */\n get storingName() {\n let name = this.getOptions(C_INTERNAL_NAME, null);\n if (name) {\n return name;\n }\n if (this.metaType === METATYPE_PROPERTY) {\n name = this.getOptions(C_NAME, null);\n if (!name) {\n name = snakeCase(this.name);\n }\n } else {\n if (this.name !== this.originalName) {\n name = this.name;\n } else {\n name = snakeCase(this.name);\n }\n }\n return name;\n }\n\n\n abstract id(): string;\n\n\n /**\n * Return supported primitive data types\n */\n getSupportedDataTypes() {\n return JS_DATA_TYPES;\n }\n\n\n}\n\n\n\n"],"sourceRoot":".."}
|
package/lib/Constants.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare const GLOBAL_NAMESPACE = "__global__";
|
|
|
3
3
|
export declare const C_IDENTIFIER = "identifier";
|
|
4
4
|
export declare const C_TYPE = "type";
|
|
5
5
|
export declare const C_NAME = "name";
|
|
6
|
+
export declare const C_INTERNAL_NAME = "internalName";
|
|
6
7
|
export declare const C_APPENDED = "appended";
|
|
7
8
|
export declare const C_CARDINALITY = "cardinality";
|
|
8
9
|
export declare const XS_DEFAULT_CLASSES = "default_class_ref";
|
package/lib/Constants.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFINED_PROPS_TO_OPTS = exports.K_ENTITY_BUILT = exports.DEFAULT_KEY_TO_SKIP = exports.K_TRIGGERED = exports.K_PATTERN_PROPERTY = exports.STATE_KEY = exports.OPT_CREAT_AND_COPY = exports.__NS__ = exports.__CLASS__ = exports.C_PROP_NAME = exports.T_BOOLEAN = exports.T_OBJECT = exports.T_ARRAY = exports.T_STRING = exports.C_EVENT_DRAIN_FINISHED = exports.C_EVENT_UPDATE = exports.C_EVENT_REMOVE = exports.C_EVENT_ADD = exports.JS_PRIMATIVE_TYPES = exports.JS_DATA_TYPES = exports.XS_ANNOTATION_OPTIONS_CACHE = exports.METADATA_REGISTRY = exports.XS_DEFAULT_SCHEMA = exports.XS_ID_SEPARATOR = exports.BINDING_SCHEMA_CLASS_REF = exports.BINDING_SCHEMA_ENTITY = exports.METATYPE_EMBEDDABLE = exports.METATYPE_PROPERTY = exports.METATYPE_CLASS_REF = exports.METATYPE_NAMESPACE = exports.METATYPE_ENTITY = exports.METATYPE_SCHEMA = exports.REFLECT_DESIGN_TYPE = exports.XS_DEFAULT_CLASSES = exports.C_CARDINALITY = exports.C_APPENDED = exports.C_NAME = exports.C_TYPE = exports.C_IDENTIFIER = exports.GLOBAL_NAMESPACE = exports.DEFAULT_NAMESPACE = void 0;
|
|
3
|
+
exports.DEFINED_PROPS_TO_OPTS = exports.K_ENTITY_BUILT = exports.DEFAULT_KEY_TO_SKIP = exports.K_TRIGGERED = exports.K_PATTERN_PROPERTY = exports.STATE_KEY = exports.OPT_CREAT_AND_COPY = exports.__NS__ = exports.__CLASS__ = exports.C_PROP_NAME = exports.T_BOOLEAN = exports.T_OBJECT = exports.T_ARRAY = exports.T_STRING = exports.C_EVENT_DRAIN_FINISHED = exports.C_EVENT_UPDATE = exports.C_EVENT_REMOVE = exports.C_EVENT_ADD = exports.JS_PRIMATIVE_TYPES = exports.JS_DATA_TYPES = exports.XS_ANNOTATION_OPTIONS_CACHE = exports.METADATA_REGISTRY = exports.XS_DEFAULT_SCHEMA = exports.XS_ID_SEPARATOR = exports.BINDING_SCHEMA_CLASS_REF = exports.BINDING_SCHEMA_ENTITY = exports.METATYPE_EMBEDDABLE = exports.METATYPE_PROPERTY = exports.METATYPE_CLASS_REF = exports.METATYPE_NAMESPACE = exports.METATYPE_ENTITY = exports.METATYPE_SCHEMA = exports.REFLECT_DESIGN_TYPE = exports.XS_DEFAULT_CLASSES = exports.C_CARDINALITY = exports.C_APPENDED = exports.C_INTERNAL_NAME = exports.C_NAME = exports.C_TYPE = exports.C_IDENTIFIER = exports.GLOBAL_NAMESPACE = exports.DEFAULT_NAMESPACE = void 0;
|
|
4
4
|
exports.DEFAULT_NAMESPACE = 'default';
|
|
5
5
|
exports.GLOBAL_NAMESPACE = '__global__';
|
|
6
6
|
exports.C_IDENTIFIER = 'identifier';
|
|
7
7
|
exports.C_TYPE = 'type';
|
|
8
8
|
exports.C_NAME = 'name';
|
|
9
|
+
exports.C_INTERNAL_NAME = 'internalName';
|
|
9
10
|
exports.C_APPENDED = 'appended';
|
|
10
11
|
exports.C_CARDINALITY = 'cardinality';
|
|
11
12
|
exports.XS_DEFAULT_CLASSES = 'default_class_ref';
|
package/lib/Constants.js.map
CHANGED
|
@@ -1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A,kBAAkB,GAAoB;IACjD,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,MAAM;IACN,WAAW;IACX,QAAQ;CACT,CAAC;AAGW,QAAA,WAAW,GAAG,KAAK,CAAC;AACpB,QAAA,cAAc,GAAG,QAAQ,CAAC;AAC1B,QAAA,cAAc,GAAG,QAAQ,CAAC;AAC1B,QAAA,sBAAsB,GAAG,gBAAgB,CAAC;AAE1C,QAAA,QAAQ,GAAG,QAAQ,CAAC;AACpB,QAAA,OAAO,GAAG,OAAO,CAAC;AAClB,QAAA,QAAQ,GAAG,QAAQ,CAAC;AACpB,QAAA,SAAS,GAAG,SAAS,CAAC;AAEtB,QAAA,WAAW,GAAG,MAAM,CAAC;AACrB,QAAA,SAAS,GAAG,WAAW,CAAC;AACxB,QAAA,MAAM,GAAG,QAAQ,CAAC;AAClB,QAAA,kBAAkB,GAAG,eAAe,CAAC;AAErC,QAAA,SAAS,GAAG,QAAQ,CAAC;AAErB,QAAA,kBAAkB,GAAG,iBAAiB,CAAC;AACvC,QAAA,WAAW,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAWpC,QAAA,mBAAmB,GAAG,CAAC,cAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,cAAM,CAAC,CAAC;AAE/G;;GAEG;AACU,QAAA,cAAc,GAAG,SAAS,CAAC;AAE3B,QAAA,qBAAqB,GAAG,CAAC,sBAAc,CAAC,CAAC","file":"Constants.js","sourcesContent":["import exp = require('constants');\nimport {INamedOptions} from \"./options/INamedOptions\";\n\nexport const DEFAULT_NAMESPACE = 'default';\nexport const GLOBAL_NAMESPACE = '__global__';\n\n\nexport const C_IDENTIFIER = 'identifier';\nexport const C_TYPE = 'type';\nexport const C_NAME = 'name';\nexport const C_INTERNAL_NAME = 'internalName';\nexport const C_APPENDED = 'appended';\nexport const C_CARDINALITY = 'cardinality';\n\n\nexport const XS_DEFAULT_CLASSES = 'default_class_ref';\n\nexport const REFLECT_DESIGN_TYPE = 'design:type';\nexport const METATYPE_SCHEMA = 'schema';\nexport const METATYPE_ENTITY = 'entity';\nexport const METATYPE_NAMESPACE = 'namespace';\nexport const METATYPE_CLASS_REF = 'class_ref';\nexport const METATYPE_PROPERTY = 'property';\nexport const METATYPE_EMBEDDABLE = 'object';\n\nexport type METADATA_TYPE =\n 'schema'\n | 'object'\n | 'entity'\n | 'property'\n | 'class_ref'\n | 'namespace';\n\n\nexport const BINDING_SCHEMA_ENTITY = 'schema_entity';\nexport const BINDING_SCHEMA_CLASS_REF = 'schema_class_ref';\n\nexport type METADATA_AND_BIND_TYPE = METADATA_TYPE\n | 'schema_entity'\n | 'entity_property'\n | 'property_entity'\n | 'schema_class_ref';\n\nexport type XS_DATA_TYPES = 'string' | 'number' | 'boolean' | 'entity' | 'array' | 'any';\nexport const XS_ID_SEPARATOR = '--';\n\nexport const XS_DEFAULT_SCHEMA = 'default';\n\n\nexport const METADATA_REGISTRY = 'metadata/registry';\n\n\nexport type ClassType<T> = { new(...args: any[]): T; };\n\nexport type JS_DATA_TYPES =\n 'string'\n | 'text'\n | 'number'\n | 'boolean'\n | 'double'\n | 'json'\n | 'date'\n | 'time'\n | 'datetime'\n | 'timestamp'\n | 'byte'\n | 'object'\n | 'array'\n | 'symbol'\n | 'null'\n | 'undefined'\n | 'bigint'\n ;\n\nexport const XS_ANNOTATION_OPTIONS_CACHE = 'anno_options_cache';\n// export const XS_ANNOTATION_OPTIONS_CACHE = 'anno_options_cache';\n\nexport const JS_DATA_TYPES: JS_DATA_TYPES[] = [\n 'string'\n , 'text'\n , 'number'\n , 'boolean'\n , 'double'\n , 'json'\n , 'date'\n , 'time'\n , 'datetime'\n , 'timestamp'\n , 'byte'\n , 'object'\n , 'symbol'\n , 'null'\n , 'undefined'\n , 'bigint'\n];\n\nexport const JS_PRIMATIVE_TYPES: JS_DATA_TYPES[] = [\n 'string',\n 'number',\n 'boolean',\n 'object',\n 'symbol',\n 'date',\n 'null',\n 'undefined',\n 'bigint'\n];\n\n\nexport const C_EVENT_ADD = 'add';\nexport const C_EVENT_REMOVE = 'remove';\nexport const C_EVENT_UPDATE = 'update';\nexport const C_EVENT_DRAIN_FINISHED = 'drain_finished';\n\nexport const T_STRING = 'string';\nexport const T_ARRAY = 'array';\nexport const T_OBJECT = 'object';\nexport const T_BOOLEAN = 'boolean';\n\nexport const C_PROP_NAME = 'name';\nexport const __CLASS__ = '__CLASS__';\nexport const __NS__ = '__NS__';\nexport const OPT_CREAT_AND_COPY = 'createAndCopy';\n\nexport const STATE_KEY = '$state';\n\nexport const K_PATTERN_PROPERTY = 'patternProperty';\nexport const K_TRIGGERED = Symbol('_triggered_');\n\nexport type CLASS_TYPE = Function | ClassType<any>;\nexport type MERGE_TYPE = 'default' | 'assign' | 'merge';\n\nexport interface IMinMax {\n min: number;\n max: number;\n}\n\n\nexport const DEFAULT_KEY_TO_SKIP = [C_TYPE, '$ref', 'target', 'propertyName', 'metaType', 'namespace', C_NAME];\n\n/**\n * Entity option signals that entity is generate by an other\n */\nexport const K_ENTITY_BUILT = '_built_';\n\nexport const DEFINED_PROPS_TO_OPTS = [K_ENTITY_BUILT];\n"],"sourceRoot":".."}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/options/IAttributeOptions.ts"],"names":[],"mappings":"","file":"IAttributeOptions.js","sourcesContent":["import {METADATA_TYPE} from '../Constants';\nimport {IAbstractOptions} from './IAbstractOptions';\n\nexport interface IAttributeOptions extends IAbstractOptions{\n targetTypes: (METADATA_TYPE | string)[];\n propertyName?: string;\n attributes: any;\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/options/IAttributeOptions.ts"],"names":[],"mappings":"","file":"IAttributeOptions.js","sourcesContent":["import {METADATA_TYPE} from '../Constants';\nimport {IAbstractOptions} from './IAbstractOptions';\n\nexport interface IAttributeOptions extends IAbstractOptions {\n targetTypes: (METADATA_TYPE | string)[];\n propertyName?: string;\n attributes: any;\n}\n"],"sourceRoot":"../.."}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/options/IEntityOptions.ts"],"names":[],"mappings":"","file":"IEntityOptions.js","sourcesContent":["import {IAbstractOptions} from './IAbstractOptions';\n\nexport interface IEntityOptions extends IAbstractOptions {\n\n
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/options/IEntityOptions.ts"],"names":[],"mappings":"","file":"IEntityOptions.js","sourcesContent":["import {IAbstractOptions} from './IAbstractOptions';\nimport {INamedOptions} from \"./INamedOptions\";\n\nexport interface IEntityOptions extends IAbstractOptions, INamedOptions {\n\n}\n"],"sourceRoot":"../.."}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/options/INamedOptions.ts"],"names":[],"mappings":"","file":"INamedOptions.js","sourcesContent":["/**\n * Interface for naming\n */\nexport interface INamedOptions {\n\n /**\n * Defined name for this entry\n */\n name?: string;\n\n /**\n * Set internal name for this entry for external source\n */\n internalName?: string;\n\n}\n"],"sourceRoot":"../.."}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/options/IObjectOptions.ts"],"names":[],"mappings":"","file":"IObjectOptions.js","sourcesContent":["import {IAbstractOptions} from './IAbstractOptions';\n\nexport interface IObjectOptions extends IAbstractOptions {\n\n
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/options/IObjectOptions.ts"],"names":[],"mappings":"","file":"IObjectOptions.js","sourcesContent":["import {IAbstractOptions} from './IAbstractOptions';\nimport {INamedOptions} from \"./INamedOptions\";\n\nexport interface IObjectOptions extends IAbstractOptions, INamedOptions {\n\n\n}\n"],"sourceRoot":"../.."}
|
|
@@ -2,6 +2,7 @@ import { JS_DATA_TYPES } from '../../lib/Constants';
|
|
|
2
2
|
import { IAbstractOptions } from './IAbstractOptions';
|
|
3
3
|
export interface IPropertyOptions extends IAbstractOptions {
|
|
4
4
|
propertyName?: string;
|
|
5
|
+
internalName?: string;
|
|
5
6
|
appended?: boolean;
|
|
6
7
|
cardinality?: number | {
|
|
7
8
|
min: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/options/IPropertyOptions.ts"],"names":[],"mappings":"","file":"IPropertyOptions.js","sourcesContent":["import {JS_DATA_TYPES} from '../../lib/Constants';\nimport {IAbstractOptions} from './IAbstractOptions';\n\nexport interface IPropertyOptions extends IAbstractOptions {\n\n propertyName?: string;\n\n appended?: boolean;\n\n cardinality?: number | { min: number, max: number };\n\n format?: string;\n\n type?: JS_DATA_TYPES | any;\n\n /**\n * Mark if value is representation of unique identifier\n */\n identifier?: boolean;\n\n /**\n * Generate automatically values for identifier\n */\n generated?: boolean;\n\n /**\n * Mark if property is a pattern property\n */\n pattern?: boolean;\n\n\n /**\n * Mark if property is an array\n */\n array?: boolean;\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/options/IPropertyOptions.ts"],"names":[],"mappings":"","file":"IPropertyOptions.js","sourcesContent":["import {JS_DATA_TYPES} from '../../lib/Constants';\nimport {IAbstractOptions} from './IAbstractOptions';\n\nexport interface IPropertyOptions extends IAbstractOptions {\n\n propertyName?: string;\n\n internalName?: string;\n\n appended?: boolean;\n\n cardinality?: number | { min: number, max: number };\n\n format?: string;\n\n type?: JS_DATA_TYPES | any;\n\n /**\n * Mark if value is representation of unique identifier\n */\n identifier?: boolean;\n\n /**\n * Generate automatically values for identifier\n */\n generated?: boolean;\n\n /**\n * Mark if property is a pattern property\n */\n pattern?: boolean;\n\n\n /**\n * Mark if property is an array\n */\n array?: boolean;\n}\n"],"sourceRoot":"../.."}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { IAbstractOptions } from './IAbstractOptions';
|
|
2
|
-
|
|
2
|
+
import { INamedOptions } from "./INamedOptions";
|
|
3
|
+
export interface ISchemaOptions extends IAbstractOptions, INamedOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Inherited fromAn name of the schema must exists
|
|
6
|
+
*/
|
|
3
7
|
name: string;
|
|
4
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/options/ISchemaOptions.ts"],"names":[],"mappings":"","file":"ISchemaOptions.js","sourcesContent":["import {IAbstractOptions} from './IAbstractOptions';\n\nexport interface ISchemaOptions extends IAbstractOptions {\n\n name: string;\n\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/options/ISchemaOptions.ts"],"names":[],"mappings":"","file":"ISchemaOptions.js","sourcesContent":["import {IAbstractOptions} from './IAbstractOptions';\nimport {INamedOptions} from \"./INamedOptions\";\n\nexport interface ISchemaOptions extends IAbstractOptions, INamedOptions {\n\n /**\n * Inherited fromAn name of the schema must exists\n */\n name: string;\n\n}\n"],"sourceRoot":"../.."}
|