@itwin/ecschema-metadata 4.8.0-dev.9 → 4.9.0-dev.1
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 +36 -1
- package/lib/cjs/Constants.js.map +1 -1
- package/lib/cjs/DelayedPromise.js.map +1 -1
- package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
- package/lib/cjs/Deserialization/Helper.js.map +1 -1
- package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
- package/lib/cjs/Deserialization/JsonProps.d.ts +4 -0
- package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
- package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
- package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
- package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/cjs/ECName.js.map +1 -1
- package/lib/cjs/ECObjects.js.map +1 -1
- package/lib/cjs/Exception.js.map +1 -1
- package/lib/cjs/Interfaces.js.map +1 -1
- package/lib/cjs/Metadata/Class.d.ts +0 -6
- package/lib/cjs/Metadata/Class.d.ts.map +1 -1
- package/lib/cjs/Metadata/Class.js +0 -8
- package/lib/cjs/Metadata/Class.js.map +1 -1
- package/lib/cjs/Metadata/Constant.js.map +1 -1
- package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts +7 -3
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.js +16 -10
- package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
- package/lib/cjs/Metadata/EntityClass.js.map +1 -1
- package/lib/cjs/Metadata/Enumeration.js.map +1 -1
- package/lib/cjs/Metadata/Format.js.map +1 -1
- package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/cjs/Metadata/Mixin.js.map +1 -1
- package/lib/cjs/Metadata/OverrideFormat.d.ts.map +1 -1
- package/lib/cjs/Metadata/OverrideFormat.js +3 -1
- package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
- package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
- package/lib/cjs/Metadata/Property.js.map +1 -1
- package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
- package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
- package/lib/cjs/Metadata/Schema.d.ts +14 -0
- package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
- package/lib/cjs/Metadata/Schema.js +21 -0
- package/lib/cjs/Metadata/Schema.js.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.d.ts +5 -0
- package/lib/cjs/Metadata/SchemaItem.d.ts.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.js +7 -0
- package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
- package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
- package/lib/cjs/PropertyTypes.js.map +1 -1
- package/lib/cjs/SchemaJsonLocater.js.map +1 -1
- package/lib/cjs/SchemaKey.js.map +1 -1
- package/lib/cjs/SchemaLoader.js.map +1 -1
- package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
- package/lib/cjs/UnitConversion/Graph.js.map +1 -1
- package/lib/cjs/UnitConversion/Parser.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
- package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
- package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
- package/lib/cjs/ecschema-metadata.js.map +1 -1
- package/lib/cjs/utils/SchemaGraph.js.map +1 -1
- package/lib/esm/Constants.d.ts +24 -0
- package/lib/esm/Constants.d.ts.map +1 -0
- package/lib/esm/Constants.js +30 -0
- package/lib/esm/Constants.js.map +1 -0
- package/lib/esm/Context.d.ts +219 -0
- package/lib/esm/Context.d.ts.map +1 -0
- package/lib/esm/Context.js +321 -0
- package/lib/esm/Context.js.map +1 -0
- package/lib/esm/DelayedPromise.d.ts +89 -0
- package/lib/esm/DelayedPromise.d.ts.map +1 -0
- package/lib/esm/DelayedPromise.js +88 -0
- package/lib/esm/DelayedPromise.js.map +1 -0
- package/lib/esm/Deserialization/AbstractParser.d.ts +46 -0
- package/lib/esm/Deserialization/AbstractParser.d.ts.map +1 -0
- package/lib/esm/Deserialization/AbstractParser.js +8 -0
- package/lib/esm/Deserialization/AbstractParser.js.map +1 -0
- package/lib/esm/Deserialization/Helper.d.ts +263 -0
- package/lib/esm/Deserialization/Helper.d.ts.map +1 -0
- package/lib/esm/Deserialization/Helper.js +871 -0
- package/lib/esm/Deserialization/Helper.js.map +1 -0
- package/lib/esm/Deserialization/JsonParser.d.ts +166 -0
- package/lib/esm/Deserialization/JsonParser.d.ts.map +1 -0
- package/lib/esm/Deserialization/JsonParser.js +677 -0
- package/lib/esm/Deserialization/JsonParser.js.map +1 -0
- package/lib/esm/Deserialization/JsonProps.d.ts +273 -0
- package/lib/esm/Deserialization/JsonProps.d.ts.map +1 -0
- package/lib/esm/Deserialization/JsonProps.js +9 -0
- package/lib/esm/Deserialization/JsonProps.js.map +1 -0
- package/lib/esm/Deserialization/SchemaGraphUtil.d.ts +35 -0
- package/lib/esm/Deserialization/SchemaGraphUtil.d.ts.map +1 -0
- package/lib/esm/Deserialization/SchemaGraphUtil.js +74 -0
- package/lib/esm/Deserialization/SchemaGraphUtil.js.map +1 -0
- package/lib/esm/Deserialization/XmlParser.d.ts +86 -0
- package/lib/esm/Deserialization/XmlParser.d.ts.map +1 -0
- package/lib/esm/Deserialization/XmlParser.js +970 -0
- package/lib/esm/Deserialization/XmlParser.js.map +1 -0
- package/lib/esm/Deserialization/XmlSerializationUtils.d.ts +55 -0
- package/lib/esm/Deserialization/XmlSerializationUtils.d.ts.map +1 -0
- package/lib/esm/Deserialization/XmlSerializationUtils.js +172 -0
- package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -0
- package/lib/esm/ECName.d.ts +31 -0
- package/lib/esm/ECName.d.ts.map +1 -0
- package/lib/esm/ECName.js +82 -0
- package/lib/esm/ECName.js.map +1 -0
- package/lib/esm/ECObjects.d.ts +166 -0
- package/lib/esm/ECObjects.d.ts.map +1 -0
- package/lib/esm/ECObjects.js +422 -0
- package/lib/esm/ECObjects.js.map +1 -0
- package/lib/esm/Exception.d.ts +45 -0
- package/lib/esm/Exception.d.ts.map +1 -0
- package/lib/esm/Exception.js +82 -0
- package/lib/esm/Exception.js.map +1 -0
- package/lib/esm/Interfaces.d.ts +79 -0
- package/lib/esm/Interfaces.d.ts.map +1 -0
- package/lib/esm/Interfaces.js +9 -0
- package/lib/esm/Interfaces.js.map +1 -0
- package/lib/esm/Metadata/Class.d.ts +245 -0
- package/lib/esm/Metadata/Class.d.ts.map +1 -0
- package/lib/esm/Metadata/Class.js +552 -0
- package/lib/esm/Metadata/Class.js.map +1 -0
- package/lib/esm/Metadata/Constant.d.ts +65 -0
- package/lib/esm/Metadata/Constant.d.ts.map +1 -0
- package/lib/esm/Metadata/Constant.js +119 -0
- package/lib/esm/Metadata/Constant.js.map +1 -0
- package/lib/esm/Metadata/CustomAttribute.d.ts +24 -0
- package/lib/esm/Metadata/CustomAttribute.d.ts.map +1 -0
- package/lib/esm/Metadata/CustomAttribute.js +24 -0
- package/lib/esm/Metadata/CustomAttribute.js.map +1 -0
- package/lib/esm/Metadata/CustomAttributeClass.d.ts +44 -0
- package/lib/esm/Metadata/CustomAttributeClass.d.ts.map +1 -0
- package/lib/esm/Metadata/CustomAttributeClass.js +70 -0
- package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -0
- package/lib/esm/Metadata/EntityClass.d.ts +78 -0
- package/lib/esm/Metadata/EntityClass.d.ts.map +1 -0
- package/lib/esm/Metadata/EntityClass.js +224 -0
- package/lib/esm/Metadata/EntityClass.js.map +1 -0
- package/lib/esm/Metadata/Enumeration.d.ts +87 -0
- package/lib/esm/Metadata/Enumeration.d.ts.map +1 -0
- package/lib/esm/Metadata/Enumeration.js +155 -0
- package/lib/esm/Metadata/Enumeration.js.map +1 -0
- package/lib/esm/Metadata/Format.d.ts +99 -0
- package/lib/esm/Metadata/Format.d.ts.map +1 -0
- package/lib/esm/Metadata/Format.js +238 -0
- package/lib/esm/Metadata/Format.js.map +1 -0
- package/lib/esm/Metadata/InvertedUnit.d.ts +50 -0
- package/lib/esm/Metadata/InvertedUnit.d.ts.map +1 -0
- package/lib/esm/Metadata/InvertedUnit.js +93 -0
- package/lib/esm/Metadata/InvertedUnit.js.map +1 -0
- package/lib/esm/Metadata/KindOfQuantity.d.ts +72 -0
- package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -0
- package/lib/esm/Metadata/KindOfQuantity.js +229 -0
- package/lib/esm/Metadata/KindOfQuantity.js.map +1 -0
- package/lib/esm/Metadata/Mixin.d.ts +55 -0
- package/lib/esm/Metadata/Mixin.d.ts.map +1 -0
- package/lib/esm/Metadata/Mixin.js +109 -0
- package/lib/esm/Metadata/Mixin.js.map +1 -0
- package/lib/esm/Metadata/OverrideFormat.d.ts +68 -0
- package/lib/esm/Metadata/OverrideFormat.d.ts.map +1 -0
- package/lib/esm/Metadata/OverrideFormat.js +124 -0
- package/lib/esm/Metadata/OverrideFormat.js.map +1 -0
- package/lib/esm/Metadata/Phenomenon.d.ts +34 -0
- package/lib/esm/Metadata/Phenomenon.d.ts.map +1 -0
- package/lib/esm/Metadata/Phenomenon.js +55 -0
- package/lib/esm/Metadata/Phenomenon.js.map +1 -0
- package/lib/esm/Metadata/Property.d.ts +247 -0
- package/lib/esm/Metadata/Property.d.ts.map +1 -0
- package/lib/esm/Metadata/Property.js +565 -0
- package/lib/esm/Metadata/Property.js.map +1 -0
- package/lib/esm/Metadata/PropertyCategory.d.ts +40 -0
- package/lib/esm/Metadata/PropertyCategory.d.ts.map +1 -0
- package/lib/esm/Metadata/PropertyCategory.js +57 -0
- package/lib/esm/Metadata/PropertyCategory.js.map +1 -0
- package/lib/esm/Metadata/RelationshipClass.d.ts +170 -0
- package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -0
- package/lib/esm/Metadata/RelationshipClass.js +380 -0
- package/lib/esm/Metadata/RelationshipClass.js.map +1 -0
- package/lib/esm/Metadata/Schema.d.ts +330 -0
- package/lib/esm/Metadata/Schema.d.ts.map +1 -0
- package/lib/esm/Metadata/Schema.js +570 -0
- package/lib/esm/Metadata/Schema.js.map +1 -0
- package/lib/esm/Metadata/SchemaItem.d.ts +67 -0
- package/lib/esm/Metadata/SchemaItem.d.ts.map +1 -0
- package/lib/esm/Metadata/SchemaItem.js +140 -0
- package/lib/esm/Metadata/SchemaItem.js.map +1 -0
- package/lib/esm/Metadata/Unit.d.ts +77 -0
- package/lib/esm/Metadata/Unit.d.ts.map +1 -0
- package/lib/esm/Metadata/Unit.js +158 -0
- package/lib/esm/Metadata/Unit.js.map +1 -0
- package/lib/esm/Metadata/UnitSystem.d.ts +21 -0
- package/lib/esm/Metadata/UnitSystem.d.ts.map +1 -0
- package/lib/esm/Metadata/UnitSystem.js +25 -0
- package/lib/esm/Metadata/UnitSystem.js.map +1 -0
- package/lib/esm/PropertyTypes.d.ts +50 -0
- package/lib/esm/PropertyTypes.d.ts.map +1 -0
- package/lib/esm/PropertyTypes.js +88 -0
- package/lib/esm/PropertyTypes.js.map +1 -0
- package/lib/esm/SchemaJsonLocater.d.ts +42 -0
- package/lib/esm/SchemaJsonLocater.d.ts.map +1 -0
- package/lib/esm/SchemaJsonLocater.js +54 -0
- package/lib/esm/SchemaJsonLocater.js.map +1 -0
- package/lib/esm/SchemaKey.d.ts +111 -0
- package/lib/esm/SchemaKey.d.ts.map +1 -0
- package/lib/esm/SchemaKey.js +214 -0
- package/lib/esm/SchemaKey.js.map +1 -0
- package/lib/esm/SchemaLoader.d.ts +32 -0
- package/lib/esm/SchemaLoader.d.ts.map +1 -0
- package/lib/esm/SchemaLoader.js +53 -0
- package/lib/esm/SchemaLoader.js.map +1 -0
- package/lib/esm/SchemaPartVisitorDelegate.d.ts +275 -0
- package/lib/esm/SchemaPartVisitorDelegate.d.ts.map +1 -0
- package/lib/esm/SchemaPartVisitorDelegate.js +209 -0
- package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -0
- package/lib/esm/UnitConversion/Graph.d.ts +35 -0
- package/lib/esm/UnitConversion/Graph.d.ts.map +1 -0
- package/lib/esm/UnitConversion/Graph.js +80 -0
- package/lib/esm/UnitConversion/Graph.js.map +1 -0
- package/lib/esm/UnitConversion/Parser.d.ts +9 -0
- package/lib/esm/UnitConversion/Parser.d.ts.map +1 -0
- package/lib/esm/UnitConversion/Parser.js +39 -0
- package/lib/esm/UnitConversion/Parser.js.map +1 -0
- package/lib/esm/UnitConversion/UnitConversion.d.ts +46 -0
- package/lib/esm/UnitConversion/UnitConversion.d.ts.map +1 -0
- package/lib/esm/UnitConversion/UnitConversion.js +74 -0
- package/lib/esm/UnitConversion/UnitConversion.js.map +1 -0
- package/lib/esm/UnitConversion/UnitConverter.d.ts +40 -0
- package/lib/esm/UnitConversion/UnitConverter.d.ts.map +1 -0
- package/lib/esm/UnitConversion/UnitConverter.js +113 -0
- package/lib/esm/UnitConversion/UnitConverter.js.map +1 -0
- package/lib/esm/UnitConversion/UnitTree.d.ts +44 -0
- package/lib/esm/UnitConversion/UnitTree.d.ts.map +1 -0
- package/lib/esm/UnitConversion/UnitTree.js +165 -0
- package/lib/esm/UnitConversion/UnitTree.js.map +1 -0
- package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts +78 -0
- package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts.map +1 -0
- package/lib/esm/UnitProvider/SchemaUnitProvider.js +231 -0
- package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -0
- package/lib/esm/Validation/SchemaWalker.d.ts +24 -0
- package/lib/esm/Validation/SchemaWalker.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaWalker.js +50 -0
- package/lib/esm/Validation/SchemaWalker.js.map +1 -0
- package/lib/esm/ecschema-metadata.d.ts +52 -0
- package/lib/esm/ecschema-metadata.d.ts.map +1 -0
- package/lib/esm/ecschema-metadata.js +55 -0
- package/lib/esm/ecschema-metadata.js.map +1 -0
- package/lib/esm/utils/SchemaGraph.d.ts +44 -0
- package/lib/esm/utils/SchemaGraph.d.ts.map +1 -0
- package/lib/esm/utils/SchemaGraph.js +111 -0
- package/lib/esm/utils/SchemaGraph.js.map +1 -0
- package/package.json +9 -7
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Metadata
|
|
3
|
+
*/
|
|
4
|
+
import { SchemaItemType } from "../ECObjects";
|
|
5
|
+
import { Schema } from "./Schema";
|
|
6
|
+
import { SchemaItem } from "./SchemaItem";
|
|
7
|
+
/**
|
|
8
|
+
* @beta
|
|
9
|
+
*/
|
|
10
|
+
export declare class UnitSystem extends SchemaItem {
|
|
11
|
+
readonly schemaItemType: SchemaItemType.UnitSystem;
|
|
12
|
+
constructor(schema: Schema, name: string);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
* Used for schema editing.
|
|
17
|
+
*/
|
|
18
|
+
export declare abstract class MutableUnitSystem extends UnitSystem {
|
|
19
|
+
abstract setDisplayLabel(displayLabel: string): void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=UnitSystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnitSystem.d.ts","sourceRoot":"","sources":["../../../src/Metadata/UnitSystem.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,qBAAa,UAAW,SAAQ,UAAU;IACxC,SAAyB,cAAc,EAAG,cAAc,CAAC,UAAU,CAAC;gBAExD,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAIzC;AAED;;;GAGG;AACH,8BAAsB,iBAAkB,SAAQ,UAAU;aAC/B,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;CACrE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Metadata
|
|
7
|
+
*/
|
|
8
|
+
import { SchemaItemType } from "../ECObjects";
|
|
9
|
+
import { SchemaItem } from "./SchemaItem";
|
|
10
|
+
/**
|
|
11
|
+
* @beta
|
|
12
|
+
*/
|
|
13
|
+
export class UnitSystem extends SchemaItem {
|
|
14
|
+
constructor(schema, name) {
|
|
15
|
+
super(schema, name);
|
|
16
|
+
this.schemaItemType = SchemaItemType.UnitSystem;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
* Used for schema editing.
|
|
22
|
+
*/
|
|
23
|
+
export class MutableUnitSystem extends UnitSystem {
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=UnitSystem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnitSystem.js","sourceRoot":"","sources":["../../../src/Metadata/UnitSystem.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,UAAU;IAGxC,YAAY,MAAc,EAAE,IAAY;QACtC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACpB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC,UAAU,CAAC;IAClD,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAgB,iBAAkB,SAAQ,UAAU;CAEzD","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 { SchemaItemType } from \"../ECObjects\";\r\nimport { Schema } from \"./Schema\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\n\r\n/**\r\n * @beta\r\n */\r\nexport class UnitSystem extends SchemaItem {\r\n public override readonly schemaItemType!: SchemaItemType.UnitSystem; // eslint-disable-line\r\n\r\n constructor(schema: Schema, name: string) {\r\n super(schema, name);\r\n this.schemaItemType = SchemaItemType.UnitSystem;\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n * Used for schema editing.\r\n */\r\nexport abstract class MutableUnitSystem extends UnitSystem {\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
|
|
@@ -0,0 +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,// PropertyFlags.Struct
|
|
10
|
+
Struct_Array = 6,// PropertyFlags.Struct | PropertyFlags.Array
|
|
11
|
+
Navigation = 8,// PropertyFlags.Navigation
|
|
12
|
+
Binary = 257,// PrimitiveType.Binary
|
|
13
|
+
Binary_Array = 261,// PrimitiveType.Binary | PropertyFlags.Array
|
|
14
|
+
Boolean = 513,// PrimitiveType.Boolean
|
|
15
|
+
Boolean_Array = 517,// PrimitiveType.Boolean | PropertyFlags.Array
|
|
16
|
+
DateTime = 769,// PrimitiveType.DateTime
|
|
17
|
+
DateTime_Array = 773,// PrimitiveType.DateTime | PropertyFlags.Array
|
|
18
|
+
Double = 1025,// PrimitiveType.Double
|
|
19
|
+
Double_Array = 1029,// PrimitiveType.Double | PropertyFlags.Array
|
|
20
|
+
Integer = 1281,// PrimitiveType.Integer
|
|
21
|
+
Integer_Array = 1285,// PrimitiveType.Integer | PropertyFlags.Array
|
|
22
|
+
Integer_Enumeration = 1297,// PrimitiveType.Integer | PropertyFlags.Enumeration
|
|
23
|
+
Integer_Enumeration_Array = 1301,// PrimitiveType.Integer | PropertyFlags.Enumeration | PropertyFlags.Array
|
|
24
|
+
Long = 1537,// PrimitiveType.Long
|
|
25
|
+
Long_Array = 1541,// PrimitiveType.Long | PropertyFlags.Array
|
|
26
|
+
Point2d = 1793,// PrimitiveType.Point2d
|
|
27
|
+
Point2d_Array = 1797,// PrimitiveType.Point2d | PropertyFlags.Array
|
|
28
|
+
Point3d = 2049,// PrimitiveType.Point3d
|
|
29
|
+
Point3d_Array = 2053,// PrimitiveType.Point3d | PropertyFlags.Array
|
|
30
|
+
String = 2305,// PrimitiveType.String
|
|
31
|
+
String_Array = 2309,// PrimitiveType.String | PropertyFlags.Array
|
|
32
|
+
String_Enumeration = 2321,// PrimitiveType.String | PropertyFlags.Enumeration
|
|
33
|
+
String_Enumeration_Array = 2325,// PrimitiveType.String | PropertyFlags.Enumeration | PropertyFlags.Array
|
|
34
|
+
IGeometry = 2561,// PrimitiveType.IGeometry
|
|
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
|
+
//# sourceMappingURL=PropertyTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PropertyTypes.d.ts","sourceRoot":"","sources":["../../src/PropertyTypes.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAY5C;;GAEG;AACH,oBAAY,YAAY;IACtB,MAAM,IAAO,CAAE,uBAAuB;IACtC,YAAY,IAAO,CAAE,6CAA6C;IAClE,UAAU,IAAO,CAAE,2BAA2B;IAC9C,MAAM,MAAQ,CAAE,uBAAuB;IACvC,YAAY,MAAQ,CAAE,6CAA6C;IACnE,OAAO,MAAQ,CAAE,wBAAwB;IACzC,aAAa,MAAQ,CAAE,8CAA8C;IACrE,QAAQ,MAAQ,CAAE,yBAAyB;IAC3C,cAAc,MAAQ,CAAE,+CAA+C;IACvE,MAAM,OAAQ,CAAE,uBAAuB;IACvC,YAAY,OAAQ,CAAE,6CAA6C;IACnE,OAAO,OAAQ,CAAE,wBAAwB;IACzC,aAAa,OAAQ,CAAE,8CAA8C;IACrE,mBAAmB,OAAQ,CAAE,oDAAoD;IACjF,yBAAyB,OAAQ,CAAE,0EAA0E;IAC7G,IAAI,OAAQ,CAAE,qBAAqB;IACnC,UAAU,OAAQ,CAAE,2CAA2C;IAC/D,OAAO,OAAQ,CAAE,wBAAwB;IACzC,aAAa,OAAQ,CAAE,8CAA8C;IACrE,OAAO,OAAQ,CAAE,wBAAwB;IACzC,aAAa,OAAQ,CAAE,8CAA8C;IACrE,MAAM,OAAQ,CAAE,uBAAuB;IACvC,YAAY,OAAQ,CAAE,6CAA6C;IACnE,kBAAkB,OAAQ,CAAE,mDAAmD;IAC/E,wBAAwB,OAAQ,CAAE,yEAAyE;IAC3G,SAAS,OAAQ,CAAE,0BAA0B;IAC7C,eAAe,OAAQ;CACxB;AAED,YAAY;AACZ,yBAAiB,iBAAiB,CAAC;IACjC,SAAgB,OAAO,CAAC,CAAC,EAAE,YAAY,WAEtC;IACD,SAAgB,WAAW,CAAC,CAAC,EAAE,YAAY,WAE1C;IACD,SAAgB,QAAQ,CAAC,CAAC,EAAE,YAAY,WAEvC;IACD,SAAgB,YAAY,CAAC,CAAC,EAAE,YAAY,WAE3C;IACD,SAAgB,aAAa,CAAC,CAAC,EAAE,YAAY,WAE5C;IACD,SAAgB,OAAO,CAAC,CAAC,EAAE,YAAY,GAAG,YAAY,CAErD;IACD,SAAgB,gBAAgB,CAAC,CAAC,EAAE,YAAY,GAAG,aAAa,CAE/D;IACD,SAAgB,iBAAiB,CAAC,CAAC,EAAE,aAAa,GAAG,YAAY,CAEhE;CACF;AAED,YAAY;AACZ,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,YAAY,oHAQtD"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Metadata
|
|
7
|
+
*/
|
|
8
|
+
import { ECObjectsError, ECObjectsStatus } from "./Exception";
|
|
9
|
+
/**
|
|
10
|
+
* @beta
|
|
11
|
+
*/
|
|
12
|
+
export var PropertyType;
|
|
13
|
+
(function (PropertyType) {
|
|
14
|
+
PropertyType[PropertyType["Struct"] = 2] = "Struct";
|
|
15
|
+
PropertyType[PropertyType["Struct_Array"] = 6] = "Struct_Array";
|
|
16
|
+
PropertyType[PropertyType["Navigation"] = 8] = "Navigation";
|
|
17
|
+
PropertyType[PropertyType["Binary"] = 257] = "Binary";
|
|
18
|
+
PropertyType[PropertyType["Binary_Array"] = 261] = "Binary_Array";
|
|
19
|
+
PropertyType[PropertyType["Boolean"] = 513] = "Boolean";
|
|
20
|
+
PropertyType[PropertyType["Boolean_Array"] = 517] = "Boolean_Array";
|
|
21
|
+
PropertyType[PropertyType["DateTime"] = 769] = "DateTime";
|
|
22
|
+
PropertyType[PropertyType["DateTime_Array"] = 773] = "DateTime_Array";
|
|
23
|
+
PropertyType[PropertyType["Double"] = 1025] = "Double";
|
|
24
|
+
PropertyType[PropertyType["Double_Array"] = 1029] = "Double_Array";
|
|
25
|
+
PropertyType[PropertyType["Integer"] = 1281] = "Integer";
|
|
26
|
+
PropertyType[PropertyType["Integer_Array"] = 1285] = "Integer_Array";
|
|
27
|
+
PropertyType[PropertyType["Integer_Enumeration"] = 1297] = "Integer_Enumeration";
|
|
28
|
+
PropertyType[PropertyType["Integer_Enumeration_Array"] = 1301] = "Integer_Enumeration_Array";
|
|
29
|
+
PropertyType[PropertyType["Long"] = 1537] = "Long";
|
|
30
|
+
PropertyType[PropertyType["Long_Array"] = 1541] = "Long_Array";
|
|
31
|
+
PropertyType[PropertyType["Point2d"] = 1793] = "Point2d";
|
|
32
|
+
PropertyType[PropertyType["Point2d_Array"] = 1797] = "Point2d_Array";
|
|
33
|
+
PropertyType[PropertyType["Point3d"] = 2049] = "Point3d";
|
|
34
|
+
PropertyType[PropertyType["Point3d_Array"] = 2053] = "Point3d_Array";
|
|
35
|
+
PropertyType[PropertyType["String"] = 2305] = "String";
|
|
36
|
+
PropertyType[PropertyType["String_Array"] = 2309] = "String_Array";
|
|
37
|
+
PropertyType[PropertyType["String_Enumeration"] = 2321] = "String_Enumeration";
|
|
38
|
+
PropertyType[PropertyType["String_Enumeration_Array"] = 2325] = "String_Enumeration_Array";
|
|
39
|
+
PropertyType[PropertyType["IGeometry"] = 2561] = "IGeometry";
|
|
40
|
+
PropertyType[PropertyType["IGeometry_Array"] = 2565] = "IGeometry_Array";
|
|
41
|
+
})(PropertyType || (PropertyType = {}));
|
|
42
|
+
/** @beta */
|
|
43
|
+
export var PropertyTypeUtils;
|
|
44
|
+
(function (PropertyTypeUtils) {
|
|
45
|
+
function isArray(t) {
|
|
46
|
+
return (t === (4 /* PropertyFlags.Array */ | t));
|
|
47
|
+
}
|
|
48
|
+
PropertyTypeUtils.isArray = isArray;
|
|
49
|
+
function isPrimitive(t) {
|
|
50
|
+
return (t === (1 /* PropertyFlags.Primitive */ | t));
|
|
51
|
+
}
|
|
52
|
+
PropertyTypeUtils.isPrimitive = isPrimitive;
|
|
53
|
+
function isStruct(t) {
|
|
54
|
+
return (t === (2 /* PropertyFlags.Struct */ | t));
|
|
55
|
+
}
|
|
56
|
+
PropertyTypeUtils.isStruct = isStruct;
|
|
57
|
+
function isNavigation(t) {
|
|
58
|
+
return (t === (8 /* PropertyFlags.Navigation */ | t));
|
|
59
|
+
}
|
|
60
|
+
PropertyTypeUtils.isNavigation = isNavigation;
|
|
61
|
+
function isEnumeration(t) {
|
|
62
|
+
return (t === (16 /* PropertyFlags.Enumeration */ | t));
|
|
63
|
+
}
|
|
64
|
+
PropertyTypeUtils.isEnumeration = isEnumeration;
|
|
65
|
+
function asArray(t) {
|
|
66
|
+
return t | 4 /* PropertyFlags.Array */;
|
|
67
|
+
}
|
|
68
|
+
PropertyTypeUtils.asArray = asArray;
|
|
69
|
+
function getPrimitiveType(t) {
|
|
70
|
+
return (0xFF01 & t);
|
|
71
|
+
}
|
|
72
|
+
PropertyTypeUtils.getPrimitiveType = getPrimitiveType;
|
|
73
|
+
function fromPrimitiveType(t) {
|
|
74
|
+
return t | 0;
|
|
75
|
+
}
|
|
76
|
+
PropertyTypeUtils.fromPrimitiveType = fromPrimitiveType;
|
|
77
|
+
})(PropertyTypeUtils || (PropertyTypeUtils = {}));
|
|
78
|
+
/** @beta */
|
|
79
|
+
export function propertyTypeToString(type) {
|
|
80
|
+
if (PropertyTypeUtils.isPrimitive(type))
|
|
81
|
+
return (PropertyTypeUtils.isArray(type)) ? "PrimitiveArrayProperty" : "PrimitiveProperty";
|
|
82
|
+
if (PropertyTypeUtils.isStruct(type))
|
|
83
|
+
return (PropertyTypeUtils.isArray(type)) ? "StructArrayProperty" : "StructProperty";
|
|
84
|
+
if (PropertyTypeUtils.isNavigation(type))
|
|
85
|
+
return "NavigationProperty";
|
|
86
|
+
throw new ECObjectsError(ECObjectsStatus.InvalidType, "Invalid propertyType");
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=PropertyTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ISchemaLocater, SchemaContext } from "./Context";
|
|
2
|
+
import { SchemaProps } from "./Deserialization/JsonProps";
|
|
3
|
+
import { SchemaMatchType } from "./ECObjects";
|
|
4
|
+
import { SchemaInfo } from "./Interfaces";
|
|
5
|
+
import { Schema } from "./Metadata/Schema";
|
|
6
|
+
import { SchemaKey } from "./SchemaKey";
|
|
7
|
+
/**
|
|
8
|
+
* Gets the full schema Json for the input schema name or undefined if not found
|
|
9
|
+
* @throws [Error] if the schema is found but json cannot be returned
|
|
10
|
+
* @beta
|
|
11
|
+
*/
|
|
12
|
+
export type SchemaPropsGetter = (schemaName: string) => SchemaProps | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* A ISchemaLocater implementation for locating and retrieving EC Schema objects using a function
|
|
15
|
+
* that returns the Schema Json for a given schema name
|
|
16
|
+
* @beta
|
|
17
|
+
*/
|
|
18
|
+
export declare class SchemaJsonLocater implements ISchemaLocater {
|
|
19
|
+
private _getSchema;
|
|
20
|
+
constructor(_getSchema: SchemaPropsGetter);
|
|
21
|
+
/** Get a schema by [SchemaKey]
|
|
22
|
+
* @param schemaKey The [SchemaKey] that identifies the schema.
|
|
23
|
+
* @param matchType The [SchemaMatchType] to used for comparing schema versions.
|
|
24
|
+
* @param context The [SchemaContext] used to facilitate schema location.
|
|
25
|
+
* @throws [ECObjectsError]($ecschema-metadata) if the schema exists, but cannot be loaded.
|
|
26
|
+
*/
|
|
27
|
+
getSchema<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): Promise<T | undefined>;
|
|
28
|
+
/**
|
|
29
|
+
* Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.
|
|
30
|
+
* @param schemaKey The SchemaKey describing the schema to get from the cache.
|
|
31
|
+
* @param matchType The match type to use when locating the schema
|
|
32
|
+
*/
|
|
33
|
+
getSchemaInfo(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined>;
|
|
34
|
+
/** Get a schema by [SchemaKey] synchronously.
|
|
35
|
+
* @param schemaKey The [SchemaKey] that identifies the schema.
|
|
36
|
+
* * @param matchType The [SchemaMatchType] to used for comparing schema versions.
|
|
37
|
+
* @param context The [SchemaContext] used to facilitate schema location.
|
|
38
|
+
* @throws [Error]($ecschema-metadata) if the schema exists, but cannot be loaded.
|
|
39
|
+
*/
|
|
40
|
+
getSchemaSync<T extends Schema>(schemaKey: Readonly<SchemaKey>, _matchType: SchemaMatchType, context: SchemaContext): T | undefined;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=SchemaJsonLocater.d.ts.map
|
|
@@ -0,0 +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,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,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,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAKpJ;;;;OAIG;IACU,aAAa,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAY/I;;;;;OAKG;IACI,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,GAAG,CAAC,GAAG,SAAS;CAS3I"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { SchemaContext } from "./Context";
|
|
6
|
+
import { Schema } from "./Metadata/Schema";
|
|
7
|
+
/**
|
|
8
|
+
* A ISchemaLocater implementation for locating and retrieving EC Schema objects using a function
|
|
9
|
+
* that returns the Schema Json for a given schema name
|
|
10
|
+
* @beta
|
|
11
|
+
*/
|
|
12
|
+
export class SchemaJsonLocater {
|
|
13
|
+
constructor(_getSchema) {
|
|
14
|
+
this._getSchema = _getSchema;
|
|
15
|
+
}
|
|
16
|
+
/** Get a schema by [SchemaKey]
|
|
17
|
+
* @param schemaKey The [SchemaKey] that identifies the schema.
|
|
18
|
+
* @param matchType The [SchemaMatchType] to used for comparing schema versions.
|
|
19
|
+
* @param context The [SchemaContext] used to facilitate schema location.
|
|
20
|
+
* @throws [ECObjectsError]($ecschema-metadata) if the schema exists, but cannot be loaded.
|
|
21
|
+
*/
|
|
22
|
+
async getSchema(schemaKey, matchType, context) {
|
|
23
|
+
await this.getSchemaInfo(schemaKey, matchType, context);
|
|
24
|
+
return await context.getCachedSchema(schemaKey, matchType);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.
|
|
28
|
+
* @param schemaKey The SchemaKey describing the schema to get from the cache.
|
|
29
|
+
* @param matchType The match type to use when locating the schema
|
|
30
|
+
*/
|
|
31
|
+
async getSchemaInfo(schemaKey, matchType, context) {
|
|
32
|
+
const schemaProps = this._getSchema(schemaKey.name);
|
|
33
|
+
if (!schemaProps)
|
|
34
|
+
return undefined;
|
|
35
|
+
const schemaInfo = await Schema.startLoadingFromJson(schemaProps, context);
|
|
36
|
+
if (schemaInfo !== undefined && schemaInfo.schemaKey.matches(schemaKey, matchType))
|
|
37
|
+
return schemaInfo;
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
/** Get a schema by [SchemaKey] synchronously.
|
|
41
|
+
* @param schemaKey The [SchemaKey] that identifies the schema.
|
|
42
|
+
* * @param matchType The [SchemaMatchType] to used for comparing schema versions.
|
|
43
|
+
* @param context The [SchemaContext] used to facilitate schema location.
|
|
44
|
+
* @throws [Error]($ecschema-metadata) if the schema exists, but cannot be loaded.
|
|
45
|
+
*/
|
|
46
|
+
getSchemaSync(schemaKey, _matchType, context) {
|
|
47
|
+
const schemaProps = this._getSchema(schemaKey.name);
|
|
48
|
+
if (!schemaProps)
|
|
49
|
+
return undefined;
|
|
50
|
+
context = context ? context : new SchemaContext();
|
|
51
|
+
return Schema.fromJsonSync(schemaProps, context);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=SchemaJsonLocater.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaJsonLocater.js","sourceRoot":"","sources":["../../src/SchemaJsonLocater.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAkB,aAAa,EAAE,MAAM,WAAW,CAAC;AAI1D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAU3C;;;;GAIG;AACH,MAAM,OAAO,iBAAiB;IAC5B,YAA2B,UAA6B;QAA7B,eAAU,GAAV,UAAU,CAAmB;IAAI,CAAC;IAE7D;;;;;OAKG;IACI,KAAK,CAAC,SAAS,CAAmB,SAA8B,EAAE,SAA0B,EAAE,OAAsB;QACzH,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QACxD,OAAO,MAAM,OAAO,CAAC,eAAe,CAAC,SAAS,EAAE,SAAS,CAAM,CAAC;IAClE,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,aAAa,CAAC,SAA8B,EAAE,SAA0B,EAAE,OAAsB;QAC3G,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACpD,IAAI,CAAC,WAAW;YACd,OAAO,SAAS,CAAC;QAEnB,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC3E,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC;YAChF,OAAO,UAAU,CAAC;QAEpB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;;OAKG;IACI,aAAa,CAAmB,SAA8B,EAAE,UAA2B,EAAE,OAAsB;QACxH,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACpD,IAAI,CAAC,WAAW;YACd,OAAO,SAAS,CAAC;QAEnB,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,aAAa,EAAE,CAAC;QAClD,OAAO,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAM,CAAC;IACxD,CAAC;CAEF","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\r\nimport { ISchemaLocater, SchemaContext } from \"./Context\";\r\nimport { SchemaProps } from \"./Deserialization/JsonProps\";\r\nimport { SchemaMatchType } from \"./ECObjects\";\r\nimport { SchemaInfo } from \"./Interfaces\";\r\nimport { Schema } from \"./Metadata/Schema\";\r\nimport { SchemaKey } from \"./SchemaKey\";\r\n\r\n/**\r\n * Gets the full schema Json for the input schema name or undefined if not found\r\n * @throws [Error] if the schema is found but json cannot be returned\r\n * @beta\r\n */\r\nexport type SchemaPropsGetter = (schemaName: string) => SchemaProps | undefined;\r\n\r\n/**\r\n * A ISchemaLocater implementation for locating and retrieving EC Schema objects using a function\r\n * that returns the Schema Json for a given schema name\r\n * @beta\r\n */\r\nexport class SchemaJsonLocater implements ISchemaLocater {\r\n public constructor(private _getSchema: SchemaPropsGetter) { }\r\n\r\n /** Get a schema by [SchemaKey]\r\n * @param schemaKey The [SchemaKey] that identifies the schema.\r\n * @param matchType The [SchemaMatchType] to used for comparing schema versions.\r\n * @param context The [SchemaContext] used to facilitate schema location.\r\n * @throws [ECObjectsError]($ecschema-metadata) if the schema exists, but cannot be loaded.\r\n */\r\n public async getSchema<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): Promise<T | undefined> {\r\n await this.getSchemaInfo(schemaKey, matchType, context);\r\n return await context.getCachedSchema(schemaKey, matchType) as T;\r\n }\r\n\r\n /**\r\n * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.\r\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\r\n * @param matchType The match type to use when locating the schema\r\n */\r\n public async getSchemaInfo(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined> {\r\n const schemaProps = this._getSchema(schemaKey.name);\r\n if (!schemaProps)\r\n return undefined;\r\n\r\n const schemaInfo = await Schema.startLoadingFromJson(schemaProps, context);\r\n if (schemaInfo !== undefined && schemaInfo.schemaKey.matches(schemaKey, matchType))\r\n return schemaInfo;\r\n\r\n return undefined;\r\n }\r\n\r\n /** Get a schema by [SchemaKey] synchronously.\r\n * @param schemaKey The [SchemaKey] that identifies the schema.\r\n * * @param matchType The [SchemaMatchType] to used for comparing schema versions.\r\n * @param context The [SchemaContext] used to facilitate schema location.\r\n * @throws [Error]($ecschema-metadata) if the schema exists, but cannot be loaded.\r\n */\r\n public getSchemaSync<T extends Schema>(schemaKey: Readonly<SchemaKey>, _matchType: SchemaMatchType, context: SchemaContext): T | undefined {\r\n const schemaProps = this._getSchema(schemaKey.name);\r\n if (!schemaProps)\r\n return undefined;\r\n\r\n context = context ? context : new SchemaContext();\r\n return Schema.fromJsonSync(schemaProps, context) as T;\r\n }\r\n\r\n}\r\n"]}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Metadata
|
|
3
|
+
*/
|
|
4
|
+
import { SchemaKeyProps } from "./Deserialization/JsonProps";
|
|
5
|
+
import { SchemaMatchType } from "./ECObjects";
|
|
6
|
+
/**
|
|
7
|
+
* @beta
|
|
8
|
+
*/
|
|
9
|
+
export declare class ECVersion {
|
|
10
|
+
private _read;
|
|
11
|
+
private _write;
|
|
12
|
+
private _minor;
|
|
13
|
+
/**
|
|
14
|
+
* The constructor will throw an ECObjectsError if any of the parameters below are above the threshold.
|
|
15
|
+
* @param read Can support up to 999.
|
|
16
|
+
* @param write Can support up to 999.
|
|
17
|
+
* @param minor Can support up to 9999999.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
constructor(read?: number, write?: number, minor?: number);
|
|
21
|
+
get read(): number;
|
|
22
|
+
get write(): number;
|
|
23
|
+
get minor(): number;
|
|
24
|
+
/**
|
|
25
|
+
* Creates a string, in the format 'RR.ww.mm', representing this ECVersion.
|
|
26
|
+
* @note The default is to pad with zeroes.
|
|
27
|
+
* @param padZeroes If true, the returned string will strictly follow `RR.ww.mm` and add leading zeroes if necessary.
|
|
28
|
+
*/
|
|
29
|
+
toString(padZeroes?: boolean): string;
|
|
30
|
+
/**
|
|
31
|
+
* Given a valid version string the
|
|
32
|
+
* @param versionString A valid version string of the format, 'RR.ww.mm'.
|
|
33
|
+
*/
|
|
34
|
+
static fromString(versionString: string): ECVersion;
|
|
35
|
+
/**
|
|
36
|
+
* Compares two schema versions.
|
|
37
|
+
* @param rhs The schema to compare.
|
|
38
|
+
* @return A negative number if this schema version is less than the given version, a positive number if greater, and 0 if are equivalent.
|
|
39
|
+
*/
|
|
40
|
+
compare(rhv: ECVersion): number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The SchemaKey contains a Schemas name and version.
|
|
44
|
+
* @beta
|
|
45
|
+
*/
|
|
46
|
+
export declare class SchemaKey {
|
|
47
|
+
private _name;
|
|
48
|
+
protected _version: ECVersion;
|
|
49
|
+
constructor(name: string, version: ECVersion);
|
|
50
|
+
constructor(name: string, readVersion?: number, writeVersion?: number, minorVersion?: number);
|
|
51
|
+
get version(): ECVersion;
|
|
52
|
+
get name(): string;
|
|
53
|
+
get readVersion(): number;
|
|
54
|
+
get writeVersion(): number;
|
|
55
|
+
get minorVersion(): number;
|
|
56
|
+
/**
|
|
57
|
+
* Creates a string, in the format 'RR.ww.mm', representing this SchemaKey.
|
|
58
|
+
* @note The default is to pad the full name with zeroes.
|
|
59
|
+
* @param padZeroes If true, the returned string will strictly follow `Name.RR.ww.mm` and add leading zeroes if necessary.
|
|
60
|
+
*/
|
|
61
|
+
toString(padZeroes?: boolean): string;
|
|
62
|
+
static parseString(fullName: string): SchemaKey;
|
|
63
|
+
/**
|
|
64
|
+
* Compares two schema names, case-insensitive.
|
|
65
|
+
* @return True if they match; otherwise, false.
|
|
66
|
+
*/
|
|
67
|
+
compareByName(rhs: SchemaKey | string | undefined): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Compares two schema versions.
|
|
70
|
+
* @param rhs The schema to compare.
|
|
71
|
+
* @return A negative number if this schema version is less than the given version, a positive number if greater, and 0 if are equivalent.
|
|
72
|
+
*/
|
|
73
|
+
compareByVersion(rhs: SchemaKey): number;
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
* @param rhs The SchemaKey to compare with
|
|
77
|
+
* @param matchType The match type to use for comparison.
|
|
78
|
+
*/
|
|
79
|
+
matches(rhs: Readonly<SchemaKey>, matchType?: SchemaMatchType): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Deserializes a SchemaKeyProps JSON object into a SchemaKey object.
|
|
82
|
+
* @param props SchemaKeyProps
|
|
83
|
+
* @returns A SchemaKey object.
|
|
84
|
+
*/
|
|
85
|
+
static fromJSON(props: SchemaKeyProps): SchemaKey;
|
|
86
|
+
/**
|
|
87
|
+
* Save this SchemaKey's properties to an object for serializing to JSON.
|
|
88
|
+
*/
|
|
89
|
+
toJSON(): SchemaKeyProps;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The SchemaItemKey contains a SchemaItem's name and SchemaKey.
|
|
93
|
+
* @beta
|
|
94
|
+
*/
|
|
95
|
+
export declare class SchemaItemKey {
|
|
96
|
+
private _name;
|
|
97
|
+
protected _schemaKey: SchemaKey;
|
|
98
|
+
constructor(name: string, schema: SchemaKey);
|
|
99
|
+
get schemaKey(): SchemaKey;
|
|
100
|
+
get name(): string;
|
|
101
|
+
get schemaName(): string;
|
|
102
|
+
/** Returns the name in the format, {schemaName}.{name}. */
|
|
103
|
+
get fullName(): string;
|
|
104
|
+
/**
|
|
105
|
+
* Checks whether this SchemaItemKey matches the one provided.
|
|
106
|
+
* @param rhs The SchemaItemKey to compare to this.
|
|
107
|
+
*/
|
|
108
|
+
matches(rhs: SchemaItemKey): boolean;
|
|
109
|
+
matchesFullName(name: string): boolean;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=SchemaKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaKey.d.ts","sourceRoot":"","sources":["../../src/SchemaKey.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAI9C;;GAEG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,MAAM,CAAa;IAE3B;;;;;;OAMG;gBACS,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;IAYzD,IAAW,IAAI,WAAyB;IACxC,IAAW,KAAK,WAA0B;IAC1C,IAAW,KAAK,WAA0B;IAE1C;;;;OAIG;IACI,QAAQ,CAAC,SAAS,GAAE,OAAc,GAAG,MAAM;IAWlD;;;OAGG;WACW,UAAU,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS;IAc1D;;;;OAIG;IACI,OAAO,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM;CASvC;AAED;;;GAGG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,KAAK,CAAS;IACtB,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC;gBAIlB,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS;gBAChC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM;IAS5F,IAAW,OAAO,cAA4B;IAC9C,IAAW,IAAI,WAA8B;IAC7C,IAAW,WAAW,WAAgC;IACtD,IAAW,YAAY,WAAiC;IACxD,IAAW,YAAY,WAAiC;IAExD;;;;OAIG;IACI,QAAQ,CAAC,SAAS,GAAE,OAAc;WAE3B,WAAW,CAAC,QAAQ,EAAE,MAAM;IAY1C;;;OAGG;IACI,aAAa,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO;IAUlE;;;;OAIG;IACI,gBAAgB,CAAC,GAAG,EAAE,SAAS,GAAG,MAAM;IAI/C;;;;OAIG;IACI,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,GAAE,eAA2C,GAAG,OAAO;IA+BzG;;;;OAIG;WACW,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS;IAIxD;;OAEG;IACI,MAAM,IAAI,cAAc;CAQhC;AAED;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,KAAK,CAAS;IACtB,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC;gBAEpB,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS;IAK3C,IAAW,SAAS,cAA8B;IAClD,IAAW,IAAI,WAA8B;IAE7C,IAAW,UAAU,WAAkC;IAEvD,2DAA2D;IAC3D,IAAW,QAAQ,WAAgD;IAEnE;;;OAGG;IAEI,OAAO,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO;IAUpC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;CAK9C"}
|