@itwin/ecschema-metadata 4.0.0-dev.28 → 4.0.0-dev.32

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.
Files changed (140) hide show
  1. package/lib/cjs/Constants.d.ts +23 -23
  2. package/lib/cjs/Constants.js +33 -33
  3. package/lib/cjs/Constants.js.map +1 -1
  4. package/lib/cjs/Context.d.ts +139 -139
  5. package/lib/cjs/Context.js +204 -204
  6. package/lib/cjs/DelayedPromise.d.ts +88 -88
  7. package/lib/cjs/DelayedPromise.js +91 -91
  8. package/lib/cjs/DelayedPromise.js.map +1 -1
  9. package/lib/cjs/Deserialization/AbstractParser.d.ts +45 -45
  10. package/lib/cjs/Deserialization/AbstractParser.js +11 -11
  11. package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
  12. package/lib/cjs/Deserialization/Helper.d.ts +251 -251
  13. package/lib/cjs/Deserialization/Helper.js +843 -843
  14. package/lib/cjs/Deserialization/Helper.js.map +1 -1
  15. package/lib/cjs/Deserialization/JsonParser.d.ts +165 -165
  16. package/lib/cjs/Deserialization/JsonParser.js +680 -680
  17. package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
  18. package/lib/cjs/Deserialization/JsonProps.d.ts +282 -282
  19. package/lib/cjs/Deserialization/JsonProps.js +9 -9
  20. package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
  21. package/lib/cjs/Deserialization/SchemaGraphUtil.d.ts +34 -34
  22. package/lib/cjs/Deserialization/SchemaGraphUtil.js +77 -77
  23. package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
  24. package/lib/cjs/Deserialization/XmlParser.d.ts +85 -85
  25. package/lib/cjs/Deserialization/XmlParser.js +973 -973
  26. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  27. package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts +54 -54
  28. package/lib/cjs/Deserialization/XmlSerializationUtils.js +174 -174
  29. package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
  30. package/lib/cjs/ECName.d.ts +30 -30
  31. package/lib/cjs/ECName.js +85 -85
  32. package/lib/cjs/ECName.js.map +1 -1
  33. package/lib/cjs/ECObjects.d.ts +162 -162
  34. package/lib/cjs/ECObjects.js +453 -453
  35. package/lib/cjs/ECObjects.js.map +1 -1
  36. package/lib/cjs/Exception.d.ts +43 -43
  37. package/lib/cjs/Exception.js +84 -84
  38. package/lib/cjs/Exception.js.map +1 -1
  39. package/lib/cjs/Interfaces.d.ts +66 -66
  40. package/lib/cjs/Interfaces.js +9 -9
  41. package/lib/cjs/Interfaces.js.map +1 -1
  42. package/lib/cjs/Metadata/Class.d.ts +243 -243
  43. package/lib/cjs/Metadata/Class.js +558 -558
  44. package/lib/cjs/Metadata/Class.js.map +1 -1
  45. package/lib/cjs/Metadata/Constant.d.ts +64 -64
  46. package/lib/cjs/Metadata/Constant.js +123 -123
  47. package/lib/cjs/Metadata/Constant.js.map +1 -1
  48. package/lib/cjs/Metadata/CustomAttribute.d.ts +23 -23
  49. package/lib/cjs/Metadata/CustomAttribute.js +27 -27
  50. package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
  51. package/lib/cjs/Metadata/CustomAttributeClass.d.ts +39 -39
  52. package/lib/cjs/Metadata/CustomAttributeClass.js +68 -68
  53. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  54. package/lib/cjs/Metadata/EntityClass.d.ts +77 -77
  55. package/lib/cjs/Metadata/EntityClass.js +230 -230
  56. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  57. package/lib/cjs/Metadata/Enumeration.d.ts +86 -86
  58. package/lib/cjs/Metadata/Enumeration.js +159 -159
  59. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  60. package/lib/cjs/Metadata/Format.d.ts +98 -98
  61. package/lib/cjs/Metadata/Format.js +242 -242
  62. package/lib/cjs/Metadata/Format.js.map +1 -1
  63. package/lib/cjs/Metadata/InvertedUnit.d.ts +49 -49
  64. package/lib/cjs/Metadata/InvertedUnit.js +97 -97
  65. package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
  66. package/lib/cjs/Metadata/KindOfQuantity.d.ts +65 -65
  67. package/lib/cjs/Metadata/KindOfQuantity.js +225 -225
  68. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  69. package/lib/cjs/Metadata/Mixin.d.ts +54 -54
  70. package/lib/cjs/Metadata/Mixin.js +113 -113
  71. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  72. package/lib/cjs/Metadata/OverrideFormat.d.ts +55 -55
  73. package/lib/cjs/Metadata/OverrideFormat.js +88 -88
  74. package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
  75. package/lib/cjs/Metadata/Phenomenon.d.ts +33 -33
  76. package/lib/cjs/Metadata/Phenomenon.js +59 -59
  77. package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
  78. package/lib/cjs/Metadata/Property.d.ts +197 -197
  79. package/lib/cjs/Metadata/Property.js +491 -491
  80. package/lib/cjs/Metadata/Property.js.map +1 -1
  81. package/lib/cjs/Metadata/PropertyCategory.d.ts +39 -39
  82. package/lib/cjs/Metadata/PropertyCategory.js +61 -61
  83. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  84. package/lib/cjs/Metadata/RelationshipClass.d.ts +152 -152
  85. package/lib/cjs/Metadata/RelationshipClass.js +349 -349
  86. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  87. package/lib/cjs/Metadata/Schema.d.ts +291 -291
  88. package/lib/cjs/Metadata/Schema.js +520 -520
  89. package/lib/cjs/Metadata/Schema.js.map +1 -1
  90. package/lib/cjs/Metadata/SchemaItem.d.ts +61 -61
  91. package/lib/cjs/Metadata/SchemaItem.js +136 -136
  92. package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
  93. package/lib/cjs/Metadata/Unit.d.ts +76 -76
  94. package/lib/cjs/Metadata/Unit.js +162 -162
  95. package/lib/cjs/Metadata/UnitSystem.d.ts +20 -20
  96. package/lib/cjs/Metadata/UnitSystem.js +29 -29
  97. package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
  98. package/lib/cjs/PropertyTypes.d.ts +49 -49
  99. package/lib/cjs/PropertyTypes.js +91 -91
  100. package/lib/cjs/PropertyTypes.js.map +1 -1
  101. package/lib/cjs/SchemaJsonLocater.d.ts +34 -34
  102. package/lib/cjs/SchemaJsonLocater.js +42 -42
  103. package/lib/cjs/SchemaJsonLocater.js.map +1 -1
  104. package/lib/cjs/SchemaKey.d.ts +110 -110
  105. package/lib/cjs/SchemaKey.js +219 -219
  106. package/lib/cjs/SchemaKey.js.map +1 -1
  107. package/lib/cjs/SchemaLoader.d.ts +23 -23
  108. package/lib/cjs/SchemaLoader.js +47 -47
  109. package/lib/cjs/SchemaLoader.js.map +1 -1
  110. package/lib/cjs/SchemaPartVisitorDelegate.d.ts +274 -274
  111. package/lib/cjs/SchemaPartVisitorDelegate.js +212 -212
  112. package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
  113. package/lib/cjs/UnitConversion/Graph.d.ts +34 -34
  114. package/lib/cjs/UnitConversion/Graph.js +83 -83
  115. package/lib/cjs/UnitConversion/Graph.js.map +1 -1
  116. package/lib/cjs/UnitConversion/Parser.d.ts +8 -8
  117. package/lib/cjs/UnitConversion/Parser.js +42 -42
  118. package/lib/cjs/UnitConversion/Parser.js.map +1 -1
  119. package/lib/cjs/UnitConversion/UnitConversion.d.ts +45 -45
  120. package/lib/cjs/UnitConversion/UnitConversion.js +77 -77
  121. package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
  122. package/lib/cjs/UnitConversion/UnitConverter.d.ts +39 -39
  123. package/lib/cjs/UnitConversion/UnitConverter.js +116 -116
  124. package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
  125. package/lib/cjs/UnitConversion/UnitTree.d.ts +43 -43
  126. package/lib/cjs/UnitConversion/UnitTree.js +169 -169
  127. package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
  128. package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts +77 -77
  129. package/lib/cjs/UnitProvider/SchemaUnitProvider.js +234 -234
  130. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  131. package/lib/cjs/Validation/SchemaWalker.d.ts +23 -23
  132. package/lib/cjs/Validation/SchemaWalker.js +53 -53
  133. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  134. package/lib/cjs/ecschema-metadata.d.ts +51 -51
  135. package/lib/cjs/ecschema-metadata.js +96 -96
  136. package/lib/cjs/ecschema-metadata.js.map +1 -1
  137. package/lib/cjs/utils/SchemaGraph.d.ts +25 -25
  138. package/lib/cjs/utils/SchemaGraph.js +65 -65
  139. package/lib/cjs/utils/SchemaGraph.js.map +1 -1
  140. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"UnitSystem.js","sourceRoot":"","sources":["../../../src/Metadata/UnitSystem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,4CAA8C;AAE9C,6CAA0C;AAE1C;;GAEG;AACH,MAAa,UAAW,SAAQ,uBAAU;IAGxC,YAAY,MAAc,EAAE,IAAY;QACtC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACpB,IAAI,CAAC,cAAc,GAAG,0BAAc,CAAC,UAAU,CAAC;IAClD,CAAC;CACF;AAPD,gCAOC;AAED;;;GAGG;AACH,MAAsB,iBAAkB,SAAQ,UAAU;CAEzD;AAFD,8CAEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Metadata\n */\n\nimport { SchemaItemType } from \"../ECObjects\";\nimport { Schema } from \"./Schema\";\nimport { SchemaItem } from \"./SchemaItem\";\n\n/**\n * @beta\n */\nexport class UnitSystem extends SchemaItem {\n public override readonly schemaItemType!: SchemaItemType.UnitSystem; // eslint-disable-line\n\n constructor(schema: Schema, name: string) {\n super(schema, name);\n this.schemaItemType = SchemaItemType.UnitSystem;\n }\n}\n\n/**\n * @internal\n * Used for schema editing.\n */\nexport abstract class MutableUnitSystem extends UnitSystem {\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
1
+ {"version":3,"file":"UnitSystem.js","sourceRoot":"","sources":["../../../src/Metadata/UnitSystem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,4CAA8C;AAE9C,6CAA0C;AAE1C;;GAEG;AACH,MAAa,UAAW,SAAQ,uBAAU;IAGxC,YAAY,MAAc,EAAE,IAAY;QACtC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACpB,IAAI,CAAC,cAAc,GAAG,0BAAc,CAAC,UAAU,CAAC;IAClD,CAAC;CACF;AAPD,gCAOC;AAED;;;GAGG;AACH,MAAsB,iBAAkB,SAAQ,UAAU;CAEzD;AAFD,8CAEC","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"]}
@@ -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
@@ -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 /* 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;
92
92
  //# sourceMappingURL=PropertyTypes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyTypes.js","sourceRoot":"","sources":["../../src/PropertyTypes.ts"],"names":[],"mappings":"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","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Metadata\n */\n\nimport { PrimitiveType } from \"./ECObjects\";\nimport { ECObjectsError, ECObjectsStatus } from \"./Exception\";\n\n/** @beta */\nconst enum PropertyFlags { // eslint-disable-line no-restricted-syntax\n Primitive = 0x01,\n Struct = 0x02,\n Array = 0x04,\n Navigation = 0x08,\n Enumeration = 0x10,\n}\n\n/**\n * @beta\n */\nexport enum PropertyType {\n Struct = 0x02, // PropertyFlags.Struct\n Struct_Array = 0x06, // PropertyFlags.Struct | PropertyFlags.Array\n Navigation = 0x08, // PropertyFlags.Navigation\n Binary = 0x101, // PrimitiveType.Binary\n Binary_Array = 0x105, // PrimitiveType.Binary | PropertyFlags.Array\n Boolean = 0x201, // PrimitiveType.Boolean\n Boolean_Array = 0x205, // PrimitiveType.Boolean | PropertyFlags.Array\n DateTime = 0x301, // PrimitiveType.DateTime\n DateTime_Array = 0x305, // PrimitiveType.DateTime | PropertyFlags.Array\n Double = 0x401, // PrimitiveType.Double\n Double_Array = 0x405, // PrimitiveType.Double | PropertyFlags.Array\n Integer = 0x501, // PrimitiveType.Integer\n Integer_Array = 0x505, // PrimitiveType.Integer | PropertyFlags.Array\n Integer_Enumeration = 0x511, // PrimitiveType.Integer | PropertyFlags.Enumeration\n Integer_Enumeration_Array = 0x515, // PrimitiveType.Integer | PropertyFlags.Enumeration | PropertyFlags.Array\n Long = 0x601, // PrimitiveType.Long\n Long_Array = 0x605, // PrimitiveType.Long | PropertyFlags.Array\n Point2d = 0x701, // PrimitiveType.Point2d\n Point2d_Array = 0x705, // PrimitiveType.Point2d | PropertyFlags.Array\n Point3d = 0x801, // PrimitiveType.Point3d\n Point3d_Array = 0x805, // PrimitiveType.Point3d | PropertyFlags.Array\n String = 0x901, // PrimitiveType.String\n String_Array = 0x905, // PrimitiveType.String | PropertyFlags.Array\n String_Enumeration = 0x911, // PrimitiveType.String | PropertyFlags.Enumeration\n String_Enumeration_Array = 0x915, // PrimitiveType.String | PropertyFlags.Enumeration | PropertyFlags.Array\n IGeometry = 0xA01, // PrimitiveType.IGeometry\n IGeometry_Array = 0xA05, // PrimitiveType.IGeometry | PropertyFlags.Array\n}\n\n/** @beta */\nexport namespace PropertyTypeUtils {\n export function isArray(t: PropertyType) {\n return (t === (PropertyFlags.Array | t));\n }\n export function isPrimitive(t: PropertyType) {\n return (t === (PropertyFlags.Primitive | t));\n }\n export function isStruct(t: PropertyType) {\n return (t === (PropertyFlags.Struct | t));\n }\n export function isNavigation(t: PropertyType) {\n return (t === (PropertyFlags.Navigation | t));\n }\n export function isEnumeration(t: PropertyType) {\n return (t === (PropertyFlags.Enumeration | t));\n }\n export function asArray(t: PropertyType): PropertyType {\n return t | PropertyFlags.Array;\n }\n export function getPrimitiveType(t: PropertyType): PrimitiveType {\n return (0xFF01 & t);\n }\n export function fromPrimitiveType(t: PrimitiveType): PropertyType {\n return t | 0;\n }\n}\n\n/** @beta */\nexport function propertyTypeToString(type: PropertyType) {\n if (PropertyTypeUtils.isPrimitive(type))\n return (PropertyTypeUtils.isArray(type)) ? \"PrimitiveArrayProperty\" : \"PrimitiveProperty\";\n if (PropertyTypeUtils.isStruct(type))\n return (PropertyTypeUtils.isArray(type)) ? \"StructArrayProperty\" : \"StructProperty\";\n if (PropertyTypeUtils.isNavigation(type))\n return \"NavigationProperty\";\n throw new ECObjectsError(ECObjectsStatus.InvalidType, \"Invalid propertyType\");\n}\n"]}
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 declare 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
- }
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 declare 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,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
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaJsonLocater.js","sourceRoot":"","sources":["../../src/SchemaJsonLocater.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,uCAA0D;AAG1D,8CAA2C;AAU3C;;;;GAIG;AACH,MAAa,iBAAiB;IAC5B,YAA2B,UAA6B;QAA7B,eAAU,GAAV,UAAU,CAAmB;IAAI,CAAC;IAE7D;;;;;OAKG;IACI,KAAK,CAAC,SAAS,CAAmB,SAAoB,EAAE,SAA0B,EAAE,OAAmC;QAC5H,OAAO,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAM,CAAC;IAChE,CAAC;IAED;;;;;OAKG;IACI,aAAa,CAAmB,SAAoB,EAAE,UAA2B,EAAE,OAAmC;QAC3H,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,uBAAa,EAAE,CAAC;QAClD,OAAO,eAAM,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAM,CAAC;IACxD,CAAC;CAEF;AA5BD,8CA4BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { ISchemaLocater, SchemaContext } from \"./Context\";\nimport { SchemaProps } from \"./Deserialization/JsonProps\";\nimport { SchemaMatchType } from \"./ECObjects\";\nimport { Schema } from \"./Metadata/Schema\";\nimport { SchemaKey } from \"./SchemaKey\";\n\n/**\n * Gets the full schema Json for the input schema name or undefined if not found\n * @throws [Error] if the schema is found but json cannot be returned\n * @alpha\n */\nexport type SchemaPropsGetter = (schemaName: string) => SchemaProps | undefined;\n\n/**\n * A ISchemaLocater implementation for locating and retrieving EC Schema objects using a function\n * that returns the Schema Json for a given schema name\n * @alpha\n */\nexport class SchemaJsonLocater implements ISchemaLocater {\n public constructor(private _getSchema: SchemaPropsGetter) { }\n\n /** Get a schema by [SchemaKey]\n * @param schemaKey The [SchemaKey] that identifies the schema.\n * @param matchType The [SchemaMatchType] to used for comparing schema versions.\n * @param context The [SchemaContext] used to facilitate schema location.\n * @throws [ECObjectsError]($ecschema-metadata) if the schema exists, but cannot be loaded.\n */\n public async getSchema<T extends Schema>(schemaKey: SchemaKey, matchType: SchemaMatchType, context?: SchemaContext | undefined): Promise<T | undefined> {\n return this.getSchemaSync(schemaKey, matchType, context) as T;\n }\n\n /** Get a schema by [SchemaKey] synchronously.\n * @param schemaKey The [SchemaKey] that identifies the schema.\n * * @param matchType The [SchemaMatchType] to used for comparing schema versions.\n * @param context The [SchemaContext] used to facilitate schema location.\n * @throws [Error]($ecschema-metadata) if the schema exists, but cannot be loaded.\n */\n public getSchemaSync<T extends Schema>(schemaKey: SchemaKey, _matchType: SchemaMatchType, context?: SchemaContext | undefined): T | undefined {\n const schemaProps = this._getSchema(schemaKey.name);\n if (!schemaProps)\n return undefined;\n\n context = context ? context : new SchemaContext();\n return Schema.fromJsonSync(schemaProps, context) as T;\n }\n\n}\n"]}
1
+ {"version":3,"file":"SchemaJsonLocater.js","sourceRoot":"","sources":["../../src/SchemaJsonLocater.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,uCAA0D;AAG1D,8CAA2C;AAU3C;;;;GAIG;AACH,MAAa,iBAAiB;IAC5B,YAA2B,UAA6B;QAA7B,eAAU,GAAV,UAAU,CAAmB;IAAI,CAAC;IAE7D;;;;;OAKG;IACI,KAAK,CAAC,SAAS,CAAmB,SAAoB,EAAE,SAA0B,EAAE,OAAmC;QAC5H,OAAO,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAM,CAAC;IAChE,CAAC;IAED;;;;;OAKG;IACI,aAAa,CAAmB,SAAoB,EAAE,UAA2B,EAAE,OAAmC;QAC3H,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,uBAAa,EAAE,CAAC;QAClD,OAAO,eAAM,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAM,CAAC;IACxD,CAAC;CAEF;AA5BD,8CA4BC","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 { 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 * @alpha\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 * @alpha\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: SchemaKey, matchType: SchemaMatchType, context?: SchemaContext | undefined): Promise<T | undefined> {\r\n return this.getSchemaSync(schemaKey, matchType, context) as T;\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: SchemaKey, _matchType: SchemaMatchType, context?: SchemaContext | undefined): 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"]}