@itwin/ecschema-metadata 4.0.0-dev.7 → 4.0.0-dev.70
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/CHANGELOG.md +13 -3
- package/lib/cjs/Constants.d.ts +23 -23
- package/lib/cjs/Constants.js +33 -33
- package/lib/cjs/Constants.js.map +1 -1
- package/lib/cjs/Context.d.ts +139 -139
- package/lib/cjs/Context.js +204 -204
- package/lib/cjs/DelayedPromise.d.ts +88 -88
- package/lib/cjs/DelayedPromise.d.ts.map +1 -1
- package/lib/cjs/DelayedPromise.js +91 -91
- package/lib/cjs/DelayedPromise.js.map +1 -1
- package/lib/cjs/Deserialization/AbstractParser.d.ts +45 -45
- package/lib/cjs/Deserialization/AbstractParser.d.ts.map +1 -1
- package/lib/cjs/Deserialization/AbstractParser.js +11 -11
- package/lib/cjs/Deserialization/Helper.d.ts +251 -251
- package/lib/cjs/Deserialization/Helper.js +843 -843
- package/lib/cjs/Deserialization/JsonParser.d.ts +165 -165
- package/lib/cjs/Deserialization/JsonParser.js +680 -680
- package/lib/cjs/Deserialization/JsonProps.d.ts +282 -282
- package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
- package/lib/cjs/Deserialization/JsonProps.js +9 -9
- package/lib/cjs/Deserialization/SchemaGraphUtil.d.ts +34 -34
- package/lib/cjs/Deserialization/SchemaGraphUtil.js +77 -77
- package/lib/cjs/Deserialization/XmlParser.d.ts +85 -85
- package/lib/cjs/Deserialization/XmlParser.js +973 -973
- package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts +54 -54
- package/lib/cjs/Deserialization/XmlSerializationUtils.js +174 -174
- package/lib/cjs/ECName.d.ts +30 -30
- package/lib/cjs/ECName.js +85 -85
- package/lib/cjs/ECObjects.d.ts +162 -162
- package/lib/cjs/ECObjects.js +453 -453
- package/lib/cjs/Exception.d.ts +43 -43
- package/lib/cjs/Exception.js +84 -84
- package/lib/cjs/Interfaces.d.ts +66 -66
- package/lib/cjs/Interfaces.d.ts.map +1 -1
- package/lib/cjs/Interfaces.js +9 -9
- package/lib/cjs/Metadata/Class.d.ts +243 -243
- package/lib/cjs/Metadata/Class.js +558 -558
- package/lib/cjs/Metadata/Class.js.map +1 -1
- package/lib/cjs/Metadata/Constant.d.ts +64 -64
- package/lib/cjs/Metadata/Constant.js +123 -123
- package/lib/cjs/Metadata/Constant.js.map +1 -1
- package/lib/cjs/Metadata/CustomAttribute.d.ts +23 -23
- package/lib/cjs/Metadata/CustomAttribute.js +27 -27
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts +39 -39
- package/lib/cjs/Metadata/CustomAttributeClass.js +68 -68
- package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
- package/lib/cjs/Metadata/EntityClass.d.ts +77 -77
- package/lib/cjs/Metadata/EntityClass.js +230 -230
- package/lib/cjs/Metadata/Enumeration.d.ts +86 -86
- package/lib/cjs/Metadata/Enumeration.d.ts.map +1 -1
- package/lib/cjs/Metadata/Enumeration.js +159 -159
- package/lib/cjs/Metadata/Enumeration.js.map +1 -1
- package/lib/cjs/Metadata/Format.d.ts +98 -98
- package/lib/cjs/Metadata/Format.js +242 -242
- package/lib/cjs/Metadata/InvertedUnit.d.ts +49 -49
- package/lib/cjs/Metadata/InvertedUnit.js +97 -97
- package/lib/cjs/Metadata/KindOfQuantity.d.ts +65 -65
- package/lib/cjs/Metadata/KindOfQuantity.js +225 -225
- package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/cjs/Metadata/Mixin.d.ts +54 -54
- package/lib/cjs/Metadata/Mixin.js +113 -113
- package/lib/cjs/Metadata/Mixin.js.map +1 -1
- package/lib/cjs/Metadata/OverrideFormat.d.ts +55 -55
- package/lib/cjs/Metadata/OverrideFormat.js +88 -88
- package/lib/cjs/Metadata/Phenomenon.d.ts +33 -33
- package/lib/cjs/Metadata/Phenomenon.js +59 -59
- package/lib/cjs/Metadata/Property.d.ts +197 -197
- package/lib/cjs/Metadata/Property.d.ts.map +1 -1
- package/lib/cjs/Metadata/Property.js +491 -491
- package/lib/cjs/Metadata/Property.js.map +1 -1
- package/lib/cjs/Metadata/PropertyCategory.d.ts +39 -39
- package/lib/cjs/Metadata/PropertyCategory.js +61 -61
- package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
- package/lib/cjs/Metadata/RelationshipClass.d.ts +152 -152
- package/lib/cjs/Metadata/RelationshipClass.js +349 -349
- package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
- package/lib/cjs/Metadata/Schema.d.ts +291 -291
- package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
- package/lib/cjs/Metadata/Schema.js +520 -520
- package/lib/cjs/Metadata/Schema.js.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.d.ts +61 -61
- package/lib/cjs/Metadata/SchemaItem.js +136 -136
- package/lib/cjs/Metadata/Unit.d.ts +76 -76
- package/lib/cjs/Metadata/Unit.js +162 -162
- package/lib/cjs/Metadata/Unit.js.map +1 -1
- package/lib/cjs/Metadata/UnitSystem.d.ts +20 -20
- package/lib/cjs/Metadata/UnitSystem.js +29 -29
- package/lib/cjs/PropertyTypes.d.ts +49 -49
- package/lib/cjs/PropertyTypes.js +91 -91
- package/lib/cjs/PropertyTypes.js.map +1 -1
- package/lib/cjs/SchemaJsonLocater.d.ts +34 -34
- package/lib/cjs/SchemaJsonLocater.d.ts.map +1 -1
- package/lib/cjs/SchemaJsonLocater.js +42 -42
- package/lib/cjs/SchemaKey.d.ts +110 -110
- package/lib/cjs/SchemaKey.js +219 -219
- package/lib/cjs/SchemaLoader.d.ts +23 -23
- package/lib/cjs/SchemaLoader.js +47 -47
- package/lib/cjs/SchemaPartVisitorDelegate.d.ts +274 -274
- package/lib/cjs/SchemaPartVisitorDelegate.js +212 -212
- package/lib/cjs/UnitConversion/Graph.d.ts +34 -34
- package/lib/cjs/UnitConversion/Graph.js +83 -83
- package/lib/cjs/UnitConversion/Parser.d.ts +8 -8
- package/lib/cjs/UnitConversion/Parser.js +42 -42
- package/lib/cjs/UnitConversion/UnitConversion.d.ts +45 -45
- package/lib/cjs/UnitConversion/UnitConversion.js +77 -77
- package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitConverter.d.ts +39 -39
- package/lib/cjs/UnitConversion/UnitConverter.js +116 -116
- package/lib/cjs/UnitConversion/UnitTree.d.ts +43 -43
- package/lib/cjs/UnitConversion/UnitTree.js +169 -169
- package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts +77 -77
- package/lib/cjs/UnitProvider/SchemaUnitProvider.js +234 -236
- package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
- package/lib/cjs/Validation/SchemaWalker.d.ts +23 -23
- package/lib/cjs/Validation/SchemaWalker.js +53 -53
- package/lib/cjs/ecschema-metadata.d.ts +51 -51
- package/lib/cjs/ecschema-metadata.js +100 -96
- package/lib/cjs/ecschema-metadata.js.map +1 -1
- package/lib/cjs/utils/SchemaGraph.d.ts +25 -25
- package/lib/cjs/utils/SchemaGraph.js +65 -65
- package/package.json +11 -11
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
/** @packageDocumentation
|
|
7
|
-
* @module Metadata
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.MutableUnitSystem = exports.UnitSystem = void 0;
|
|
11
|
-
const ECObjects_1 = require("../ECObjects");
|
|
12
|
-
const SchemaItem_1 = require("./SchemaItem");
|
|
13
|
-
/**
|
|
14
|
-
* @beta
|
|
15
|
-
*/
|
|
16
|
-
class UnitSystem extends SchemaItem_1.SchemaItem {
|
|
17
|
-
constructor(schema, name) {
|
|
18
|
-
super(schema, name);
|
|
19
|
-
this.schemaItemType = ECObjects_1.SchemaItemType.UnitSystem;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.UnitSystem = UnitSystem;
|
|
23
|
-
/**
|
|
24
|
-
* @internal
|
|
25
|
-
* Used for schema editing.
|
|
26
|
-
*/
|
|
27
|
-
class MutableUnitSystem extends UnitSystem {
|
|
28
|
-
}
|
|
29
|
-
exports.MutableUnitSystem = MutableUnitSystem;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Metadata
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.MutableUnitSystem = exports.UnitSystem = void 0;
|
|
11
|
+
const ECObjects_1 = require("../ECObjects");
|
|
12
|
+
const SchemaItem_1 = require("./SchemaItem");
|
|
13
|
+
/**
|
|
14
|
+
* @beta
|
|
15
|
+
*/
|
|
16
|
+
class UnitSystem extends SchemaItem_1.SchemaItem {
|
|
17
|
+
constructor(schema, name) {
|
|
18
|
+
super(schema, name);
|
|
19
|
+
this.schemaItemType = ECObjects_1.SchemaItemType.UnitSystem;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.UnitSystem = UnitSystem;
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
* Used for schema editing.
|
|
26
|
+
*/
|
|
27
|
+
class MutableUnitSystem extends UnitSystem {
|
|
28
|
+
}
|
|
29
|
+
exports.MutableUnitSystem = MutableUnitSystem;
|
|
30
30
|
//# sourceMappingURL=UnitSystem.js.map
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Metadata
|
|
3
|
-
*/
|
|
4
|
-
import { PrimitiveType } from "./ECObjects";
|
|
5
|
-
/**
|
|
6
|
-
* @beta
|
|
7
|
-
*/
|
|
8
|
-
export declare enum PropertyType {
|
|
9
|
-
Struct = 2,
|
|
10
|
-
Struct_Array = 6,
|
|
11
|
-
Navigation = 8,
|
|
12
|
-
Binary = 257,
|
|
13
|
-
Binary_Array = 261,
|
|
14
|
-
Boolean = 513,
|
|
15
|
-
Boolean_Array = 517,
|
|
16
|
-
DateTime = 769,
|
|
17
|
-
DateTime_Array = 773,
|
|
18
|
-
Double = 1025,
|
|
19
|
-
Double_Array = 1029,
|
|
20
|
-
Integer = 1281,
|
|
21
|
-
Integer_Array = 1285,
|
|
22
|
-
Integer_Enumeration = 1297,
|
|
23
|
-
Integer_Enumeration_Array = 1301,
|
|
24
|
-
Long = 1537,
|
|
25
|
-
Long_Array = 1541,
|
|
26
|
-
Point2d = 1793,
|
|
27
|
-
Point2d_Array = 1797,
|
|
28
|
-
Point3d = 2049,
|
|
29
|
-
Point3d_Array = 2053,
|
|
30
|
-
String = 2305,
|
|
31
|
-
String_Array = 2309,
|
|
32
|
-
String_Enumeration = 2321,
|
|
33
|
-
String_Enumeration_Array = 2325,
|
|
34
|
-
IGeometry = 2561,
|
|
35
|
-
IGeometry_Array = 2565
|
|
36
|
-
}
|
|
37
|
-
/** @beta */
|
|
38
|
-
export declare namespace PropertyTypeUtils {
|
|
39
|
-
function isArray(t: PropertyType): boolean;
|
|
40
|
-
function isPrimitive(t: PropertyType): boolean;
|
|
41
|
-
function isStruct(t: PropertyType): boolean;
|
|
42
|
-
function isNavigation(t: PropertyType): boolean;
|
|
43
|
-
function isEnumeration(t: PropertyType): boolean;
|
|
44
|
-
function asArray(t: PropertyType): PropertyType;
|
|
45
|
-
function getPrimitiveType(t: PropertyType): PrimitiveType;
|
|
46
|
-
function fromPrimitiveType(t: PrimitiveType): PropertyType;
|
|
47
|
-
}
|
|
48
|
-
/** @beta */
|
|
49
|
-
export declare function propertyTypeToString(type: PropertyType): "PrimitiveProperty" | "StructProperty" | "StructArrayProperty" | "NavigationProperty" | "PrimitiveArrayProperty";
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Metadata
|
|
3
|
+
*/
|
|
4
|
+
import { PrimitiveType } from "./ECObjects";
|
|
5
|
+
/**
|
|
6
|
+
* @beta
|
|
7
|
+
*/
|
|
8
|
+
export declare enum PropertyType {
|
|
9
|
+
Struct = 2,
|
|
10
|
+
Struct_Array = 6,
|
|
11
|
+
Navigation = 8,
|
|
12
|
+
Binary = 257,
|
|
13
|
+
Binary_Array = 261,
|
|
14
|
+
Boolean = 513,
|
|
15
|
+
Boolean_Array = 517,
|
|
16
|
+
DateTime = 769,
|
|
17
|
+
DateTime_Array = 773,
|
|
18
|
+
Double = 1025,
|
|
19
|
+
Double_Array = 1029,
|
|
20
|
+
Integer = 1281,
|
|
21
|
+
Integer_Array = 1285,
|
|
22
|
+
Integer_Enumeration = 1297,
|
|
23
|
+
Integer_Enumeration_Array = 1301,
|
|
24
|
+
Long = 1537,
|
|
25
|
+
Long_Array = 1541,
|
|
26
|
+
Point2d = 1793,
|
|
27
|
+
Point2d_Array = 1797,
|
|
28
|
+
Point3d = 2049,
|
|
29
|
+
Point3d_Array = 2053,
|
|
30
|
+
String = 2305,
|
|
31
|
+
String_Array = 2309,
|
|
32
|
+
String_Enumeration = 2321,
|
|
33
|
+
String_Enumeration_Array = 2325,
|
|
34
|
+
IGeometry = 2561,
|
|
35
|
+
IGeometry_Array = 2565
|
|
36
|
+
}
|
|
37
|
+
/** @beta */
|
|
38
|
+
export declare namespace PropertyTypeUtils {
|
|
39
|
+
function isArray(t: PropertyType): boolean;
|
|
40
|
+
function isPrimitive(t: PropertyType): boolean;
|
|
41
|
+
function isStruct(t: PropertyType): boolean;
|
|
42
|
+
function isNavigation(t: PropertyType): boolean;
|
|
43
|
+
function isEnumeration(t: PropertyType): boolean;
|
|
44
|
+
function asArray(t: PropertyType): PropertyType;
|
|
45
|
+
function getPrimitiveType(t: PropertyType): PrimitiveType;
|
|
46
|
+
function fromPrimitiveType(t: PrimitiveType): PropertyType;
|
|
47
|
+
}
|
|
48
|
+
/** @beta */
|
|
49
|
+
export declare function propertyTypeToString(type: PropertyType): "PrimitiveProperty" | "StructProperty" | "StructArrayProperty" | "NavigationProperty" | "PrimitiveArrayProperty";
|
|
50
50
|
//# sourceMappingURL=PropertyTypes.d.ts.map
|
package/lib/cjs/PropertyTypes.js
CHANGED
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
/** @packageDocumentation
|
|
7
|
-
* @module Metadata
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.propertyTypeToString = exports.PropertyTypeUtils = exports.PropertyType = void 0;
|
|
11
|
-
const Exception_1 = require("./Exception");
|
|
12
|
-
/**
|
|
13
|
-
* @beta
|
|
14
|
-
*/
|
|
15
|
-
var PropertyType;
|
|
16
|
-
(function (PropertyType) {
|
|
17
|
-
PropertyType[PropertyType["Struct"] = 2] = "Struct";
|
|
18
|
-
PropertyType[PropertyType["Struct_Array"] = 6] = "Struct_Array";
|
|
19
|
-
PropertyType[PropertyType["Navigation"] = 8] = "Navigation";
|
|
20
|
-
PropertyType[PropertyType["Binary"] = 257] = "Binary";
|
|
21
|
-
PropertyType[PropertyType["Binary_Array"] = 261] = "Binary_Array";
|
|
22
|
-
PropertyType[PropertyType["Boolean"] = 513] = "Boolean";
|
|
23
|
-
PropertyType[PropertyType["Boolean_Array"] = 517] = "Boolean_Array";
|
|
24
|
-
PropertyType[PropertyType["DateTime"] = 769] = "DateTime";
|
|
25
|
-
PropertyType[PropertyType["DateTime_Array"] = 773] = "DateTime_Array";
|
|
26
|
-
PropertyType[PropertyType["Double"] = 1025] = "Double";
|
|
27
|
-
PropertyType[PropertyType["Double_Array"] = 1029] = "Double_Array";
|
|
28
|
-
PropertyType[PropertyType["Integer"] = 1281] = "Integer";
|
|
29
|
-
PropertyType[PropertyType["Integer_Array"] = 1285] = "Integer_Array";
|
|
30
|
-
PropertyType[PropertyType["Integer_Enumeration"] = 1297] = "Integer_Enumeration";
|
|
31
|
-
PropertyType[PropertyType["Integer_Enumeration_Array"] = 1301] = "Integer_Enumeration_Array";
|
|
32
|
-
PropertyType[PropertyType["Long"] = 1537] = "Long";
|
|
33
|
-
PropertyType[PropertyType["Long_Array"] = 1541] = "Long_Array";
|
|
34
|
-
PropertyType[PropertyType["Point2d"] = 1793] = "Point2d";
|
|
35
|
-
PropertyType[PropertyType["Point2d_Array"] = 1797] = "Point2d_Array";
|
|
36
|
-
PropertyType[PropertyType["Point3d"] = 2049] = "Point3d";
|
|
37
|
-
PropertyType[PropertyType["Point3d_Array"] = 2053] = "Point3d_Array";
|
|
38
|
-
PropertyType[PropertyType["String"] = 2305] = "String";
|
|
39
|
-
PropertyType[PropertyType["String_Array"] = 2309] = "String_Array";
|
|
40
|
-
PropertyType[PropertyType["String_Enumeration"] = 2321] = "String_Enumeration";
|
|
41
|
-
PropertyType[PropertyType["String_Enumeration_Array"] = 2325] = "String_Enumeration_Array";
|
|
42
|
-
PropertyType[PropertyType["IGeometry"] = 2561] = "IGeometry";
|
|
43
|
-
PropertyType[PropertyType["IGeometry_Array"] = 2565] = "IGeometry_Array";
|
|
44
|
-
})(PropertyType = exports.PropertyType || (exports.PropertyType = {}));
|
|
45
|
-
/** @beta */
|
|
46
|
-
var PropertyTypeUtils;
|
|
47
|
-
(function (PropertyTypeUtils) {
|
|
48
|
-
function isArray(t) {
|
|
49
|
-
return (t === (4 /* Array */ | t));
|
|
50
|
-
}
|
|
51
|
-
PropertyTypeUtils.isArray = isArray;
|
|
52
|
-
function isPrimitive(t) {
|
|
53
|
-
return (t === (1 /* Primitive */ | t));
|
|
54
|
-
}
|
|
55
|
-
PropertyTypeUtils.isPrimitive = isPrimitive;
|
|
56
|
-
function isStruct(t) {
|
|
57
|
-
return (t === (2 /* Struct */ | t));
|
|
58
|
-
}
|
|
59
|
-
PropertyTypeUtils.isStruct = isStruct;
|
|
60
|
-
function isNavigation(t) {
|
|
61
|
-
return (t === (8 /* Navigation */ | t));
|
|
62
|
-
}
|
|
63
|
-
PropertyTypeUtils.isNavigation = isNavigation;
|
|
64
|
-
function isEnumeration(t) {
|
|
65
|
-
return (t === (16 /* Enumeration */ | t));
|
|
66
|
-
}
|
|
67
|
-
PropertyTypeUtils.isEnumeration = isEnumeration;
|
|
68
|
-
function asArray(t) {
|
|
69
|
-
return t | 4 /* Array */;
|
|
70
|
-
}
|
|
71
|
-
PropertyTypeUtils.asArray = asArray;
|
|
72
|
-
function getPrimitiveType(t) {
|
|
73
|
-
return (0xFF01 & t);
|
|
74
|
-
}
|
|
75
|
-
PropertyTypeUtils.getPrimitiveType = getPrimitiveType;
|
|
76
|
-
function fromPrimitiveType(t) {
|
|
77
|
-
return t | 0;
|
|
78
|
-
}
|
|
79
|
-
PropertyTypeUtils.fromPrimitiveType = fromPrimitiveType;
|
|
80
|
-
})(PropertyTypeUtils = exports.PropertyTypeUtils || (exports.PropertyTypeUtils = {}));
|
|
81
|
-
/** @beta */
|
|
82
|
-
function propertyTypeToString(type) {
|
|
83
|
-
if (PropertyTypeUtils.isPrimitive(type))
|
|
84
|
-
return (PropertyTypeUtils.isArray(type)) ? "PrimitiveArrayProperty" : "PrimitiveProperty";
|
|
85
|
-
if (PropertyTypeUtils.isStruct(type))
|
|
86
|
-
return (PropertyTypeUtils.isArray(type)) ? "StructArrayProperty" : "StructProperty";
|
|
87
|
-
if (PropertyTypeUtils.isNavigation(type))
|
|
88
|
-
return "NavigationProperty";
|
|
89
|
-
throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidType, "Invalid propertyType");
|
|
90
|
-
}
|
|
91
|
-
exports.propertyTypeToString = propertyTypeToString;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Metadata
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.propertyTypeToString = exports.PropertyTypeUtils = exports.PropertyType = void 0;
|
|
11
|
+
const Exception_1 = require("./Exception");
|
|
12
|
+
/**
|
|
13
|
+
* @beta
|
|
14
|
+
*/
|
|
15
|
+
var PropertyType;
|
|
16
|
+
(function (PropertyType) {
|
|
17
|
+
PropertyType[PropertyType["Struct"] = 2] = "Struct";
|
|
18
|
+
PropertyType[PropertyType["Struct_Array"] = 6] = "Struct_Array";
|
|
19
|
+
PropertyType[PropertyType["Navigation"] = 8] = "Navigation";
|
|
20
|
+
PropertyType[PropertyType["Binary"] = 257] = "Binary";
|
|
21
|
+
PropertyType[PropertyType["Binary_Array"] = 261] = "Binary_Array";
|
|
22
|
+
PropertyType[PropertyType["Boolean"] = 513] = "Boolean";
|
|
23
|
+
PropertyType[PropertyType["Boolean_Array"] = 517] = "Boolean_Array";
|
|
24
|
+
PropertyType[PropertyType["DateTime"] = 769] = "DateTime";
|
|
25
|
+
PropertyType[PropertyType["DateTime_Array"] = 773] = "DateTime_Array";
|
|
26
|
+
PropertyType[PropertyType["Double"] = 1025] = "Double";
|
|
27
|
+
PropertyType[PropertyType["Double_Array"] = 1029] = "Double_Array";
|
|
28
|
+
PropertyType[PropertyType["Integer"] = 1281] = "Integer";
|
|
29
|
+
PropertyType[PropertyType["Integer_Array"] = 1285] = "Integer_Array";
|
|
30
|
+
PropertyType[PropertyType["Integer_Enumeration"] = 1297] = "Integer_Enumeration";
|
|
31
|
+
PropertyType[PropertyType["Integer_Enumeration_Array"] = 1301] = "Integer_Enumeration_Array";
|
|
32
|
+
PropertyType[PropertyType["Long"] = 1537] = "Long";
|
|
33
|
+
PropertyType[PropertyType["Long_Array"] = 1541] = "Long_Array";
|
|
34
|
+
PropertyType[PropertyType["Point2d"] = 1793] = "Point2d";
|
|
35
|
+
PropertyType[PropertyType["Point2d_Array"] = 1797] = "Point2d_Array";
|
|
36
|
+
PropertyType[PropertyType["Point3d"] = 2049] = "Point3d";
|
|
37
|
+
PropertyType[PropertyType["Point3d_Array"] = 2053] = "Point3d_Array";
|
|
38
|
+
PropertyType[PropertyType["String"] = 2305] = "String";
|
|
39
|
+
PropertyType[PropertyType["String_Array"] = 2309] = "String_Array";
|
|
40
|
+
PropertyType[PropertyType["String_Enumeration"] = 2321] = "String_Enumeration";
|
|
41
|
+
PropertyType[PropertyType["String_Enumeration_Array"] = 2325] = "String_Enumeration_Array";
|
|
42
|
+
PropertyType[PropertyType["IGeometry"] = 2561] = "IGeometry";
|
|
43
|
+
PropertyType[PropertyType["IGeometry_Array"] = 2565] = "IGeometry_Array";
|
|
44
|
+
})(PropertyType = exports.PropertyType || (exports.PropertyType = {}));
|
|
45
|
+
/** @beta */
|
|
46
|
+
var PropertyTypeUtils;
|
|
47
|
+
(function (PropertyTypeUtils) {
|
|
48
|
+
function isArray(t) {
|
|
49
|
+
return (t === (4 /* PropertyFlags.Array */ | t));
|
|
50
|
+
}
|
|
51
|
+
PropertyTypeUtils.isArray = isArray;
|
|
52
|
+
function isPrimitive(t) {
|
|
53
|
+
return (t === (1 /* PropertyFlags.Primitive */ | t));
|
|
54
|
+
}
|
|
55
|
+
PropertyTypeUtils.isPrimitive = isPrimitive;
|
|
56
|
+
function isStruct(t) {
|
|
57
|
+
return (t === (2 /* PropertyFlags.Struct */ | t));
|
|
58
|
+
}
|
|
59
|
+
PropertyTypeUtils.isStruct = isStruct;
|
|
60
|
+
function isNavigation(t) {
|
|
61
|
+
return (t === (8 /* PropertyFlags.Navigation */ | t));
|
|
62
|
+
}
|
|
63
|
+
PropertyTypeUtils.isNavigation = isNavigation;
|
|
64
|
+
function isEnumeration(t) {
|
|
65
|
+
return (t === (16 /* PropertyFlags.Enumeration */ | t));
|
|
66
|
+
}
|
|
67
|
+
PropertyTypeUtils.isEnumeration = isEnumeration;
|
|
68
|
+
function asArray(t) {
|
|
69
|
+
return t | 4 /* PropertyFlags.Array */;
|
|
70
|
+
}
|
|
71
|
+
PropertyTypeUtils.asArray = asArray;
|
|
72
|
+
function getPrimitiveType(t) {
|
|
73
|
+
return (0xFF01 & t);
|
|
74
|
+
}
|
|
75
|
+
PropertyTypeUtils.getPrimitiveType = getPrimitiveType;
|
|
76
|
+
function fromPrimitiveType(t) {
|
|
77
|
+
return t | 0;
|
|
78
|
+
}
|
|
79
|
+
PropertyTypeUtils.fromPrimitiveType = fromPrimitiveType;
|
|
80
|
+
})(PropertyTypeUtils = exports.PropertyTypeUtils || (exports.PropertyTypeUtils = {}));
|
|
81
|
+
/** @beta */
|
|
82
|
+
function propertyTypeToString(type) {
|
|
83
|
+
if (PropertyTypeUtils.isPrimitive(type))
|
|
84
|
+
return (PropertyTypeUtils.isArray(type)) ? "PrimitiveArrayProperty" : "PrimitiveProperty";
|
|
85
|
+
if (PropertyTypeUtils.isStruct(type))
|
|
86
|
+
return (PropertyTypeUtils.isArray(type)) ? "StructArrayProperty" : "StructProperty";
|
|
87
|
+
if (PropertyTypeUtils.isNavigation(type))
|
|
88
|
+
return "NavigationProperty";
|
|
89
|
+
throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidType, "Invalid propertyType");
|
|
90
|
+
}
|
|
91
|
+
exports.propertyTypeToString = propertyTypeToString;
|
|
92
92
|
//# sourceMappingURL=PropertyTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyTypes.js","sourceRoot":"","sources":["../../src/PropertyTypes.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,2CAA8D;AAW9D;;GAEG;AACH,IAAY,YA4BX;AA5BD,WAAY,YAAY;IACtB,mDAAa,CAAA;IACb,+DAAmB,CAAA;IACnB,2DAAiB,CAAA;IACjB,qDAAc,CAAA;IACd,iEAAoB,CAAA;IACpB,uDAAe,CAAA;IACf,mEAAqB,CAAA;IACrB,yDAAgB,CAAA;IAChB,qEAAsB,CAAA;IACtB,sDAAc,CAAA;IACd,kEAAoB,CAAA;IACpB,wDAAe,CAAA;IACf,oEAAqB,CAAA;IACrB,gFAA2B,CAAA;IAC3B,4FAAiC,CAAA;IACjC,kDAAY,CAAA;IACZ,8DAAkB,CAAA;IAClB,wDAAe,CAAA;IACf,oEAAqB,CAAA;IACrB,wDAAe,CAAA;IACf,oEAAqB,CAAA;IACrB,sDAAc,CAAA;IACd,kEAAoB,CAAA;IACpB,8EAA0B,CAAA;IAC1B,0FAAgC,CAAA;IAChC,4DAAiB,CAAA;IACjB,wEAAuB,CAAA;AACzB,CAAC,EA5BW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QA4BvB;AAED,YAAY;AACZ,IAAiB,iBAAiB,CAyBjC;AAzBD,WAAiB,iBAAiB;IAChC,SAAgB,OAAO,CAAC,CAAe;QACrC,OAAO,CAAC,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"PropertyTypes.js","sourceRoot":"","sources":["../../src/PropertyTypes.ts"],"names":[],"mappings":"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","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { PrimitiveType } from \"./ECObjects\";\r\nimport { ECObjectsError, ECObjectsStatus } from \"./Exception\";\r\n\r\n/** @beta */\r\nconst enum PropertyFlags { // eslint-disable-line no-restricted-syntax\r\n Primitive = 0x01,\r\n Struct = 0x02,\r\n Array = 0x04,\r\n Navigation = 0x08,\r\n Enumeration = 0x10,\r\n}\r\n\r\n/**\r\n * @beta\r\n */\r\nexport enum PropertyType {\r\n Struct = 0x02, // PropertyFlags.Struct\r\n Struct_Array = 0x06, // PropertyFlags.Struct | PropertyFlags.Array\r\n Navigation = 0x08, // PropertyFlags.Navigation\r\n Binary = 0x101, // PrimitiveType.Binary\r\n Binary_Array = 0x105, // PrimitiveType.Binary | PropertyFlags.Array\r\n Boolean = 0x201, // PrimitiveType.Boolean\r\n Boolean_Array = 0x205, // PrimitiveType.Boolean | PropertyFlags.Array\r\n DateTime = 0x301, // PrimitiveType.DateTime\r\n DateTime_Array = 0x305, // PrimitiveType.DateTime | PropertyFlags.Array\r\n Double = 0x401, // PrimitiveType.Double\r\n Double_Array = 0x405, // PrimitiveType.Double | PropertyFlags.Array\r\n Integer = 0x501, // PrimitiveType.Integer\r\n Integer_Array = 0x505, // PrimitiveType.Integer | PropertyFlags.Array\r\n Integer_Enumeration = 0x511, // PrimitiveType.Integer | PropertyFlags.Enumeration\r\n Integer_Enumeration_Array = 0x515, // PrimitiveType.Integer | PropertyFlags.Enumeration | PropertyFlags.Array\r\n Long = 0x601, // PrimitiveType.Long\r\n Long_Array = 0x605, // PrimitiveType.Long | PropertyFlags.Array\r\n Point2d = 0x701, // PrimitiveType.Point2d\r\n Point2d_Array = 0x705, // PrimitiveType.Point2d | PropertyFlags.Array\r\n Point3d = 0x801, // PrimitiveType.Point3d\r\n Point3d_Array = 0x805, // PrimitiveType.Point3d | PropertyFlags.Array\r\n String = 0x901, // PrimitiveType.String\r\n String_Array = 0x905, // PrimitiveType.String | PropertyFlags.Array\r\n String_Enumeration = 0x911, // PrimitiveType.String | PropertyFlags.Enumeration\r\n String_Enumeration_Array = 0x915, // PrimitiveType.String | PropertyFlags.Enumeration | PropertyFlags.Array\r\n IGeometry = 0xA01, // PrimitiveType.IGeometry\r\n IGeometry_Array = 0xA05, // PrimitiveType.IGeometry | PropertyFlags.Array\r\n}\r\n\r\n/** @beta */\r\nexport namespace PropertyTypeUtils {\r\n export function isArray(t: PropertyType) {\r\n return (t === (PropertyFlags.Array | t));\r\n }\r\n export function isPrimitive(t: PropertyType) {\r\n return (t === (PropertyFlags.Primitive | t));\r\n }\r\n export function isStruct(t: PropertyType) {\r\n return (t === (PropertyFlags.Struct | t));\r\n }\r\n export function isNavigation(t: PropertyType) {\r\n return (t === (PropertyFlags.Navigation | t));\r\n }\r\n export function isEnumeration(t: PropertyType) {\r\n return (t === (PropertyFlags.Enumeration | t));\r\n }\r\n export function asArray(t: PropertyType): PropertyType {\r\n return t | PropertyFlags.Array;\r\n }\r\n export function getPrimitiveType(t: PropertyType): PrimitiveType {\r\n return (0xFF01 & t);\r\n }\r\n export function fromPrimitiveType(t: PrimitiveType): PropertyType {\r\n return t | 0;\r\n }\r\n}\r\n\r\n/** @beta */\r\nexport function propertyTypeToString(type: PropertyType) {\r\n if (PropertyTypeUtils.isPrimitive(type))\r\n return (PropertyTypeUtils.isArray(type)) ? \"PrimitiveArrayProperty\" : \"PrimitiveProperty\";\r\n if (PropertyTypeUtils.isStruct(type))\r\n return (PropertyTypeUtils.isArray(type)) ? \"StructArrayProperty\" : \"StructProperty\";\r\n if (PropertyTypeUtils.isNavigation(type))\r\n return \"NavigationProperty\";\r\n throw new ECObjectsError(ECObjectsStatus.InvalidType, \"Invalid propertyType\");\r\n}\r\n"]}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { ISchemaLocater, SchemaContext } from "./Context";
|
|
2
|
-
import { SchemaProps } from "./Deserialization/JsonProps";
|
|
3
|
-
import { SchemaMatchType } from "./ECObjects";
|
|
4
|
-
import { Schema } from "./Metadata/Schema";
|
|
5
|
-
import { SchemaKey } from "./SchemaKey";
|
|
6
|
-
/**
|
|
7
|
-
* Gets the full schema Json for the input schema name or undefined if not found
|
|
8
|
-
* @throws [Error] if the schema is found but json cannot be returned
|
|
9
|
-
* @alpha
|
|
10
|
-
*/
|
|
11
|
-
export
|
|
12
|
-
/**
|
|
13
|
-
* A ISchemaLocater implementation for locating and retrieving EC Schema objects using a function
|
|
14
|
-
* that returns the Schema Json for a given schema name
|
|
15
|
-
* @alpha
|
|
16
|
-
*/
|
|
17
|
-
export declare class SchemaJsonLocater implements ISchemaLocater {
|
|
18
|
-
private _getSchema;
|
|
19
|
-
constructor(_getSchema: SchemaPropsGetter);
|
|
20
|
-
/** Get a schema by [SchemaKey]
|
|
21
|
-
* @param schemaKey The [SchemaKey] that identifies the schema.
|
|
22
|
-
* @param matchType The [SchemaMatchType] to used for comparing schema versions.
|
|
23
|
-
* @param context The [SchemaContext] used to facilitate schema location.
|
|
24
|
-
* @throws [ECObjectsError]($ecschema-metadata) if the schema exists, but cannot be loaded.
|
|
25
|
-
*/
|
|
26
|
-
getSchema<T extends Schema>(schemaKey: SchemaKey, matchType: SchemaMatchType, context?: SchemaContext | undefined): Promise<T | undefined>;
|
|
27
|
-
/** Get a schema by [SchemaKey] synchronously.
|
|
28
|
-
* @param schemaKey The [SchemaKey] that identifies the schema.
|
|
29
|
-
* * @param matchType The [SchemaMatchType] to used for comparing schema versions.
|
|
30
|
-
* @param context The [SchemaContext] used to facilitate schema location.
|
|
31
|
-
* @throws [Error]($ecschema-metadata) if the schema exists, but cannot be loaded.
|
|
32
|
-
*/
|
|
33
|
-
getSchemaSync<T extends Schema>(schemaKey: SchemaKey, _matchType: SchemaMatchType, context?: SchemaContext | undefined): T | undefined;
|
|
34
|
-
}
|
|
1
|
+
import { ISchemaLocater, SchemaContext } from "./Context";
|
|
2
|
+
import { SchemaProps } from "./Deserialization/JsonProps";
|
|
3
|
+
import { SchemaMatchType } from "./ECObjects";
|
|
4
|
+
import { Schema } from "./Metadata/Schema";
|
|
5
|
+
import { SchemaKey } from "./SchemaKey";
|
|
6
|
+
/**
|
|
7
|
+
* Gets the full schema Json for the input schema name or undefined if not found
|
|
8
|
+
* @throws [Error] if the schema is found but json cannot be returned
|
|
9
|
+
* @alpha
|
|
10
|
+
*/
|
|
11
|
+
export type SchemaPropsGetter = (schemaName: string) => SchemaProps | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* A ISchemaLocater implementation for locating and retrieving EC Schema objects using a function
|
|
14
|
+
* that returns the Schema Json for a given schema name
|
|
15
|
+
* @alpha
|
|
16
|
+
*/
|
|
17
|
+
export declare class SchemaJsonLocater implements ISchemaLocater {
|
|
18
|
+
private _getSchema;
|
|
19
|
+
constructor(_getSchema: SchemaPropsGetter);
|
|
20
|
+
/** Get a schema by [SchemaKey]
|
|
21
|
+
* @param schemaKey The [SchemaKey] that identifies the schema.
|
|
22
|
+
* @param matchType The [SchemaMatchType] to used for comparing schema versions.
|
|
23
|
+
* @param context The [SchemaContext] used to facilitate schema location.
|
|
24
|
+
* @throws [ECObjectsError]($ecschema-metadata) if the schema exists, but cannot be loaded.
|
|
25
|
+
*/
|
|
26
|
+
getSchema<T extends Schema>(schemaKey: SchemaKey, matchType: SchemaMatchType, context?: SchemaContext | undefined): Promise<T | undefined>;
|
|
27
|
+
/** Get a schema by [SchemaKey] synchronously.
|
|
28
|
+
* @param schemaKey The [SchemaKey] that identifies the schema.
|
|
29
|
+
* * @param matchType The [SchemaMatchType] to used for comparing schema versions.
|
|
30
|
+
* @param context The [SchemaContext] used to facilitate schema location.
|
|
31
|
+
* @throws [Error]($ecschema-metadata) if the schema exists, but cannot be loaded.
|
|
32
|
+
*/
|
|
33
|
+
getSchemaSync<T extends Schema>(schemaKey: SchemaKey, _matchType: SchemaMatchType, context?: SchemaContext | undefined): T | undefined;
|
|
34
|
+
}
|
|
35
35
|
//# sourceMappingURL=SchemaJsonLocater.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaJsonLocater.d.ts","sourceRoot":"","sources":["../../src/SchemaJsonLocater.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"SchemaJsonLocater.d.ts","sourceRoot":"","sources":["../../src/SchemaJsonLocater.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,WAAW,GAAG,SAAS,CAAC;AAEhF;;;;GAIG;AACH,qBAAa,iBAAkB,YAAW,cAAc;IACnC,OAAO,CAAC,UAAU;gBAAV,UAAU,EAAE,iBAAiB;IAExD;;;;;OAKG;IACU,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAIvJ;;;;;OAKG;IACI,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,GAAG,CAAC,GAAG,SAAS;CAS9I"}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.SchemaJsonLocater = void 0;
|
|
8
|
-
const Context_1 = require("./Context");
|
|
9
|
-
const Schema_1 = require("./Metadata/Schema");
|
|
10
|
-
/**
|
|
11
|
-
* A ISchemaLocater implementation for locating and retrieving EC Schema objects using a function
|
|
12
|
-
* that returns the Schema Json for a given schema name
|
|
13
|
-
* @alpha
|
|
14
|
-
*/
|
|
15
|
-
class SchemaJsonLocater {
|
|
16
|
-
constructor(_getSchema) {
|
|
17
|
-
this._getSchema = _getSchema;
|
|
18
|
-
}
|
|
19
|
-
/** Get a schema by [SchemaKey]
|
|
20
|
-
* @param schemaKey The [SchemaKey] that identifies the schema.
|
|
21
|
-
* @param matchType The [SchemaMatchType] to used for comparing schema versions.
|
|
22
|
-
* @param context The [SchemaContext] used to facilitate schema location.
|
|
23
|
-
* @throws [ECObjectsError]($ecschema-metadata) if the schema exists, but cannot be loaded.
|
|
24
|
-
*/
|
|
25
|
-
async getSchema(schemaKey, matchType, context) {
|
|
26
|
-
return this.getSchemaSync(schemaKey, matchType, context);
|
|
27
|
-
}
|
|
28
|
-
/** Get a schema by [SchemaKey] synchronously.
|
|
29
|
-
* @param schemaKey The [SchemaKey] that identifies the schema.
|
|
30
|
-
* * @param matchType The [SchemaMatchType] to used for comparing schema versions.
|
|
31
|
-
* @param context The [SchemaContext] used to facilitate schema location.
|
|
32
|
-
* @throws [Error]($ecschema-metadata) if the schema exists, but cannot be loaded.
|
|
33
|
-
*/
|
|
34
|
-
getSchemaSync(schemaKey, _matchType, context) {
|
|
35
|
-
const schemaProps = this._getSchema(schemaKey.name);
|
|
36
|
-
if (!schemaProps)
|
|
37
|
-
return undefined;
|
|
38
|
-
context = context ? context : new Context_1.SchemaContext();
|
|
39
|
-
return Schema_1.Schema.fromJsonSync(schemaProps, context);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.SchemaJsonLocater = SchemaJsonLocater;
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.SchemaJsonLocater = void 0;
|
|
8
|
+
const Context_1 = require("./Context");
|
|
9
|
+
const Schema_1 = require("./Metadata/Schema");
|
|
10
|
+
/**
|
|
11
|
+
* A ISchemaLocater implementation for locating and retrieving EC Schema objects using a function
|
|
12
|
+
* that returns the Schema Json for a given schema name
|
|
13
|
+
* @alpha
|
|
14
|
+
*/
|
|
15
|
+
class SchemaJsonLocater {
|
|
16
|
+
constructor(_getSchema) {
|
|
17
|
+
this._getSchema = _getSchema;
|
|
18
|
+
}
|
|
19
|
+
/** Get a schema by [SchemaKey]
|
|
20
|
+
* @param schemaKey The [SchemaKey] that identifies the schema.
|
|
21
|
+
* @param matchType The [SchemaMatchType] to used for comparing schema versions.
|
|
22
|
+
* @param context The [SchemaContext] used to facilitate schema location.
|
|
23
|
+
* @throws [ECObjectsError]($ecschema-metadata) if the schema exists, but cannot be loaded.
|
|
24
|
+
*/
|
|
25
|
+
async getSchema(schemaKey, matchType, context) {
|
|
26
|
+
return this.getSchemaSync(schemaKey, matchType, context);
|
|
27
|
+
}
|
|
28
|
+
/** Get a schema by [SchemaKey] synchronously.
|
|
29
|
+
* @param schemaKey The [SchemaKey] that identifies the schema.
|
|
30
|
+
* * @param matchType The [SchemaMatchType] to used for comparing schema versions.
|
|
31
|
+
* @param context The [SchemaContext] used to facilitate schema location.
|
|
32
|
+
* @throws [Error]($ecschema-metadata) if the schema exists, but cannot be loaded.
|
|
33
|
+
*/
|
|
34
|
+
getSchemaSync(schemaKey, _matchType, context) {
|
|
35
|
+
const schemaProps = this._getSchema(schemaKey.name);
|
|
36
|
+
if (!schemaProps)
|
|
37
|
+
return undefined;
|
|
38
|
+
context = context ? context : new Context_1.SchemaContext();
|
|
39
|
+
return Schema_1.Schema.fromJsonSync(schemaProps, context);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.SchemaJsonLocater = SchemaJsonLocater;
|
|
43
43
|
//# sourceMappingURL=SchemaJsonLocater.js.map
|