@singularsystems/neo-core 0.10.75 → 0.10.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/JsonSchema/ClassMetadata.d.ts +2 -1
- package/dist/JsonSchema/ClassMetadata.js +14 -9
- package/dist/JsonSchema/MetadataBase.d.ts +8 -0
- package/dist/JsonSchema/MetadataBase.js +12 -0
- package/dist/JsonSchema/PropertyMetadata.d.ts +7 -3
- package/dist/JsonSchema/PropertyMetadata.js +15 -4
- package/dist/JsonSchema/TypeCache.js +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { PropertyMetadata } from './PropertyMetadata';
|
|
2
2
|
import { IJsonObjectType } from './JsonSchemaTypes';
|
|
3
3
|
import { ITypeCacheInternal } from './TypeCache';
|
|
4
|
-
|
|
4
|
+
import { MetadataBase } from './MetadataBase';
|
|
5
|
+
export declare class ClassMetadata extends MetadataBase {
|
|
5
6
|
name: string;
|
|
6
7
|
constructor(name: string);
|
|
7
8
|
/**
|
|
@@ -1,31 +1,36 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
1
2
|
import { TypeMetadata } from './TypeMetadata';
|
|
2
3
|
import { PropertyMetadata } from './PropertyMetadata';
|
|
3
|
-
|
|
4
|
+
import { MetadataBase } from './MetadataBase';
|
|
5
|
+
var ClassMetadata = /** @class */ (function (_super) {
|
|
6
|
+
__extends(ClassMetadata, _super);
|
|
4
7
|
function ClassMetadata(name) {
|
|
5
|
-
|
|
8
|
+
var _this = _super.call(this) || this;
|
|
9
|
+
_this.name = name;
|
|
6
10
|
/**
|
|
7
11
|
* All properties.
|
|
8
12
|
*/
|
|
9
|
-
|
|
13
|
+
_this.properties = [];
|
|
10
14
|
/**
|
|
11
15
|
* Properties excluding child objects and lists.
|
|
12
16
|
*/
|
|
13
|
-
|
|
17
|
+
_this.simpleProperties = [];
|
|
14
18
|
/**
|
|
15
19
|
* Properties containing child object types.
|
|
16
20
|
*/
|
|
17
|
-
|
|
21
|
+
_this.childObjectProperties = [];
|
|
18
22
|
/**
|
|
19
23
|
* Properties containing child list types.
|
|
20
24
|
*/
|
|
21
|
-
|
|
25
|
+
_this.childListProperties = [];
|
|
26
|
+
return _this;
|
|
22
27
|
}
|
|
23
28
|
ClassMetadata.prototype.loadMetaData = function (schema, cache) {
|
|
29
|
+
_super.prototype.loadFromSchema.call(this, schema);
|
|
24
30
|
for (var propertyKey in schema.properties) {
|
|
25
31
|
var propertySchema = schema.properties[propertyKey];
|
|
26
32
|
var propertyMetaData = new PropertyMetadata(propertyKey, TypeMetadata.create(propertySchema, cache));
|
|
27
|
-
propertyMetaData.
|
|
28
|
-
propertyMetaData.description = propertySchema.description;
|
|
33
|
+
propertyMetaData.loadFromSchema(propertySchema);
|
|
29
34
|
if (propertyMetaData.type.basicType !== "unknown") {
|
|
30
35
|
this.properties.push(propertyMetaData);
|
|
31
36
|
if (propertyMetaData.type.basicType === "array") {
|
|
@@ -49,5 +54,5 @@ var ClassMetadata = /** @class */ (function () {
|
|
|
49
54
|
return clone;
|
|
50
55
|
};
|
|
51
56
|
return ClassMetadata;
|
|
52
|
-
}());
|
|
57
|
+
}(MetadataBase));
|
|
53
58
|
export { ClassMetadata };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var MetadataBase = /** @class */ (function () {
|
|
2
|
+
function MetadataBase() {
|
|
3
|
+
}
|
|
4
|
+
MetadataBase.prototype.loadFromSchema = function (schema) {
|
|
5
|
+
this.title = schema.title;
|
|
6
|
+
this.description = schema.description;
|
|
7
|
+
this.ordinal = schema["x-ordinal"];
|
|
8
|
+
this.hidden = schema["x-hidden"];
|
|
9
|
+
};
|
|
10
|
+
return MetadataBase;
|
|
11
|
+
}());
|
|
12
|
+
export { MetadataBase };
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { IJsonSchemaDescriptorType } from './JsonSchemaTypes';
|
|
2
|
+
import { MetadataBase } from './MetadataBase';
|
|
1
3
|
import { TypeMetadata } from './TypeMetadata';
|
|
2
|
-
export declare class PropertyMetadata {
|
|
4
|
+
export declare class PropertyMetadata extends MetadataBase {
|
|
3
5
|
propertyName: string;
|
|
4
6
|
type: TypeMetadata;
|
|
5
7
|
constructor(propertyName: string, type: TypeMetadata);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
formatString?: string;
|
|
9
|
+
width?: number;
|
|
10
|
+
hAlign?: "left" | "center" | "right";
|
|
11
|
+
loadFromSchema(schema: IJsonSchemaDescriptorType): void;
|
|
8
12
|
}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { MetadataBase } from './MetadataBase';
|
|
3
|
+
var PropertyMetadata = /** @class */ (function (_super) {
|
|
4
|
+
__extends(PropertyMetadata, _super);
|
|
2
5
|
function PropertyMetadata(propertyName, type) {
|
|
3
|
-
|
|
4
|
-
|
|
6
|
+
var _this = _super.call(this) || this;
|
|
7
|
+
_this.propertyName = propertyName;
|
|
8
|
+
_this.type = type;
|
|
9
|
+
return _this;
|
|
5
10
|
}
|
|
11
|
+
PropertyMetadata.prototype.loadFromSchema = function (schema) {
|
|
12
|
+
_super.prototype.loadFromSchema.call(this, schema);
|
|
13
|
+
this.formatString = schema["x-formatString"];
|
|
14
|
+
this.width = schema["x-width"];
|
|
15
|
+
this.hAlign = schema["x-hAlign"];
|
|
16
|
+
};
|
|
6
17
|
return PropertyMetadata;
|
|
7
|
-
}());
|
|
18
|
+
}(MetadataBase));
|
|
8
19
|
export { PropertyMetadata };
|
|
@@ -20,6 +20,7 @@ var TypeCache = /** @class */ (function () {
|
|
|
20
20
|
enumerable: false,
|
|
21
21
|
configurable: true
|
|
22
22
|
});
|
|
23
|
+
// This is an internal method used by TypeMetadata
|
|
23
24
|
TypeCache.prototype.getOrAddType = function (name) {
|
|
24
25
|
if (name.startsWith("#/definitions/")) {
|
|
25
26
|
name = name.replace("#/definitions/", "");
|