@itwin/ecschema-metadata 4.0.0-dev.52 → 4.0.0-dev.55

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 (117) 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.d.ts.map +1 -1
  8. package/lib/cjs/DelayedPromise.js +91 -91
  9. package/lib/cjs/DelayedPromise.js.map +1 -1
  10. package/lib/cjs/Deserialization/AbstractParser.d.ts +45 -45
  11. package/lib/cjs/Deserialization/AbstractParser.d.ts.map +1 -1
  12. package/lib/cjs/Deserialization/AbstractParser.js +11 -11
  13. package/lib/cjs/Deserialization/Helper.d.ts +251 -251
  14. package/lib/cjs/Deserialization/Helper.js +843 -843
  15. package/lib/cjs/Deserialization/JsonParser.d.ts +165 -165
  16. package/lib/cjs/Deserialization/JsonParser.js +680 -680
  17. package/lib/cjs/Deserialization/JsonProps.d.ts +282 -282
  18. package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
  19. package/lib/cjs/Deserialization/JsonProps.js +9 -9
  20. package/lib/cjs/Deserialization/SchemaGraphUtil.d.ts +34 -34
  21. package/lib/cjs/Deserialization/SchemaGraphUtil.js +77 -77
  22. package/lib/cjs/Deserialization/XmlParser.d.ts +85 -85
  23. package/lib/cjs/Deserialization/XmlParser.js +973 -973
  24. package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts +54 -54
  25. package/lib/cjs/Deserialization/XmlSerializationUtils.js +174 -174
  26. package/lib/cjs/ECName.d.ts +30 -30
  27. package/lib/cjs/ECName.js +85 -85
  28. package/lib/cjs/ECObjects.d.ts +162 -162
  29. package/lib/cjs/ECObjects.js +453 -453
  30. package/lib/cjs/Exception.d.ts +43 -43
  31. package/lib/cjs/Exception.js +84 -84
  32. package/lib/cjs/Interfaces.d.ts +66 -66
  33. package/lib/cjs/Interfaces.d.ts.map +1 -1
  34. package/lib/cjs/Interfaces.js +9 -9
  35. package/lib/cjs/Metadata/Class.d.ts +243 -243
  36. package/lib/cjs/Metadata/Class.js +558 -558
  37. package/lib/cjs/Metadata/Class.js.map +1 -1
  38. package/lib/cjs/Metadata/Constant.d.ts +64 -64
  39. package/lib/cjs/Metadata/Constant.js +123 -123
  40. package/lib/cjs/Metadata/CustomAttribute.d.ts +23 -23
  41. package/lib/cjs/Metadata/CustomAttribute.js +27 -27
  42. package/lib/cjs/Metadata/CustomAttributeClass.d.ts +39 -39
  43. package/lib/cjs/Metadata/CustomAttributeClass.js +68 -68
  44. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  45. package/lib/cjs/Metadata/EntityClass.d.ts +77 -77
  46. package/lib/cjs/Metadata/EntityClass.js +230 -230
  47. package/lib/cjs/Metadata/Enumeration.d.ts +86 -86
  48. package/lib/cjs/Metadata/Enumeration.d.ts.map +1 -1
  49. package/lib/cjs/Metadata/Enumeration.js +159 -159
  50. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  51. package/lib/cjs/Metadata/Format.d.ts +98 -98
  52. package/lib/cjs/Metadata/Format.js +242 -242
  53. package/lib/cjs/Metadata/InvertedUnit.d.ts +49 -49
  54. package/lib/cjs/Metadata/InvertedUnit.js +97 -97
  55. package/lib/cjs/Metadata/KindOfQuantity.d.ts +65 -65
  56. package/lib/cjs/Metadata/KindOfQuantity.js +225 -225
  57. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  58. package/lib/cjs/Metadata/Mixin.d.ts +54 -54
  59. package/lib/cjs/Metadata/Mixin.js +113 -113
  60. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  61. package/lib/cjs/Metadata/OverrideFormat.d.ts +55 -55
  62. package/lib/cjs/Metadata/OverrideFormat.js +88 -88
  63. package/lib/cjs/Metadata/Phenomenon.d.ts +33 -33
  64. package/lib/cjs/Metadata/Phenomenon.js +59 -59
  65. package/lib/cjs/Metadata/Property.d.ts +197 -197
  66. package/lib/cjs/Metadata/Property.d.ts.map +1 -1
  67. package/lib/cjs/Metadata/Property.js +491 -491
  68. package/lib/cjs/Metadata/Property.js.map +1 -1
  69. package/lib/cjs/Metadata/PropertyCategory.d.ts +39 -39
  70. package/lib/cjs/Metadata/PropertyCategory.js +61 -61
  71. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  72. package/lib/cjs/Metadata/RelationshipClass.d.ts +152 -152
  73. package/lib/cjs/Metadata/RelationshipClass.js +349 -349
  74. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  75. package/lib/cjs/Metadata/Schema.d.ts +291 -291
  76. package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
  77. package/lib/cjs/Metadata/Schema.js +520 -520
  78. package/lib/cjs/Metadata/Schema.js.map +1 -1
  79. package/lib/cjs/Metadata/SchemaItem.d.ts +61 -61
  80. package/lib/cjs/Metadata/SchemaItem.js +136 -136
  81. package/lib/cjs/Metadata/Unit.d.ts +76 -76
  82. package/lib/cjs/Metadata/Unit.js +162 -162
  83. package/lib/cjs/Metadata/UnitSystem.d.ts +20 -20
  84. package/lib/cjs/Metadata/UnitSystem.js +29 -29
  85. package/lib/cjs/PropertyTypes.d.ts +49 -49
  86. package/lib/cjs/PropertyTypes.js +91 -91
  87. package/lib/cjs/PropertyTypes.js.map +1 -1
  88. package/lib/cjs/SchemaJsonLocater.d.ts +34 -34
  89. package/lib/cjs/SchemaJsonLocater.d.ts.map +1 -1
  90. package/lib/cjs/SchemaJsonLocater.js +42 -42
  91. package/lib/cjs/SchemaKey.d.ts +110 -110
  92. package/lib/cjs/SchemaKey.js +219 -219
  93. package/lib/cjs/SchemaLoader.d.ts +23 -23
  94. package/lib/cjs/SchemaLoader.js +47 -47
  95. package/lib/cjs/SchemaPartVisitorDelegate.d.ts +274 -274
  96. package/lib/cjs/SchemaPartVisitorDelegate.js +212 -212
  97. package/lib/cjs/UnitConversion/Graph.d.ts +34 -34
  98. package/lib/cjs/UnitConversion/Graph.js +83 -83
  99. package/lib/cjs/UnitConversion/Parser.d.ts +8 -8
  100. package/lib/cjs/UnitConversion/Parser.js +42 -42
  101. package/lib/cjs/UnitConversion/UnitConversion.d.ts +45 -45
  102. package/lib/cjs/UnitConversion/UnitConversion.js +77 -77
  103. package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
  104. package/lib/cjs/UnitConversion/UnitConverter.d.ts +39 -39
  105. package/lib/cjs/UnitConversion/UnitConverter.js +116 -116
  106. package/lib/cjs/UnitConversion/UnitTree.d.ts +43 -43
  107. package/lib/cjs/UnitConversion/UnitTree.js +169 -169
  108. package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts +77 -77
  109. package/lib/cjs/UnitProvider/SchemaUnitProvider.js +234 -234
  110. package/lib/cjs/Validation/SchemaWalker.d.ts +23 -23
  111. package/lib/cjs/Validation/SchemaWalker.js +53 -53
  112. package/lib/cjs/ecschema-metadata.d.ts +51 -51
  113. package/lib/cjs/ecschema-metadata.js +100 -96
  114. package/lib/cjs/ecschema-metadata.js.map +1 -1
  115. package/lib/cjs/utils/SchemaGraph.d.ts +25 -25
  116. package/lib/cjs/utils/SchemaGraph.js +65 -65
  117. package/package.json +8 -8
@@ -1,24 +1,24 @@
1
- /** @packageDocumentation
2
- * @module Metadata
3
- */
4
- import { Schema } from "./Schema";
5
- /** @beta */
6
- export interface CustomAttribute {
7
- className: string;
8
- [propName: string]: any;
9
- }
10
- /** @internal */
11
- export interface CustomAttributeSet {
12
- [Symbol.iterator]: () => IterableIterator<[string, CustomAttribute]>;
13
- has(className: string): boolean;
14
- get(className: string): CustomAttribute | undefined;
15
- }
16
- /** @beta */
17
- export interface CustomAttributeContainerProps {
18
- customAttributes?: CustomAttributeSet;
19
- fullName: string;
20
- schema: Schema;
21
- }
22
- /** @internal */
23
- export declare function serializeCustomAttributes(customAttributes: CustomAttributeSet | undefined): any[] | undefined;
1
+ /** @packageDocumentation
2
+ * @module Metadata
3
+ */
4
+ import { Schema } from "./Schema";
5
+ /** @beta */
6
+ export interface CustomAttribute {
7
+ className: string;
8
+ [propName: string]: any;
9
+ }
10
+ /** @internal */
11
+ export interface CustomAttributeSet {
12
+ [Symbol.iterator]: () => IterableIterator<[string, CustomAttribute]>;
13
+ has(className: string): boolean;
14
+ get(className: string): CustomAttribute | undefined;
15
+ }
16
+ /** @beta */
17
+ export interface CustomAttributeContainerProps {
18
+ customAttributes?: CustomAttributeSet;
19
+ fullName: string;
20
+ schema: Schema;
21
+ }
22
+ /** @internal */
23
+ export declare function serializeCustomAttributes(customAttributes: CustomAttributeSet | undefined): any[] | undefined;
24
24
  //# sourceMappingURL=CustomAttribute.d.ts.map
@@ -1,28 +1,28 @@
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.serializeCustomAttributes = void 0;
11
- /** @internal */
12
- function serializeCustomAttributes(customAttributes) {
13
- if (undefined !== customAttributes) { // custom attributes is optional
14
- const attributes = [];
15
- for (const [, customAttribute] of customAttributes) {
16
- const attribute = {};
17
- Object.keys(customAttribute).map((property) => {
18
- const propertyName = property.toString();
19
- attribute[propertyName] = customAttribute[property];
20
- });
21
- attributes.push(attribute);
22
- }
23
- return (attributes.length > 0) ? attributes : undefined;
24
- }
25
- return undefined;
26
- }
27
- exports.serializeCustomAttributes = serializeCustomAttributes;
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.serializeCustomAttributes = void 0;
11
+ /** @internal */
12
+ function serializeCustomAttributes(customAttributes) {
13
+ if (undefined !== customAttributes) { // custom attributes is optional
14
+ const attributes = [];
15
+ for (const [, customAttribute] of customAttributes) {
16
+ const attribute = {};
17
+ Object.keys(customAttribute).map((property) => {
18
+ const propertyName = property.toString();
19
+ attribute[propertyName] = customAttribute[property];
20
+ });
21
+ attributes.push(attribute);
22
+ }
23
+ return (attributes.length > 0) ? attributes : undefined;
24
+ }
25
+ return undefined;
26
+ }
27
+ exports.serializeCustomAttributes = serializeCustomAttributes;
28
28
  //# sourceMappingURL=CustomAttribute.js.map
@@ -1,40 +1,40 @@
1
- /** @packageDocumentation
2
- * @module Metadata
3
- */
4
- import { CustomAttributeClassProps } from "../Deserialization/JsonProps";
5
- import { CustomAttributeContainerType, ECClassModifier, SchemaItemType } from "../ECObjects";
6
- import { ECClass } from "./Class";
7
- import { Schema } from "./Schema";
8
- /**
9
- * A Typescript class representation of an ECCustomAttributeClass.
10
- * @beta
11
- */
12
- export declare class CustomAttributeClass extends ECClass {
13
- readonly schemaItemType: SchemaItemType.CustomAttributeClass;
14
- protected _containerType?: CustomAttributeContainerType;
15
- get containerType(): CustomAttributeContainerType;
16
- constructor(schema: Schema, name: string, modifier?: ECClassModifier);
17
- /**
18
- * Save this CustomAttributeClasses properties to an object for serializing to JSON.
19
- * @param standalone Serialization includes only this object (as opposed to the full schema).
20
- * @param includeSchemaVersion Include the Schema's version information in the serialized object.
21
- */
22
- toJSON(standalone?: boolean, includeSchemaVersion?: boolean): CustomAttributeClassProps;
23
- /** @internal */
24
- toXml(schemaXml: Document): Promise<Element>;
25
- fromJSONSync(customAttributeProps: CustomAttributeClassProps): void;
26
- fromJSON(customAttributeProps: CustomAttributeClassProps): Promise<void>;
27
- /**
28
- * @alpha Used in schema editing.
29
- */
30
- protected setContainerType(containerType: CustomAttributeContainerType): void;
31
- }
32
- /**
33
- * @internal
34
- * An abstract class used for Schema editing.
35
- */
36
- export declare abstract class MutableCAClass extends CustomAttributeClass {
37
- abstract setContainerType(containerType: CustomAttributeContainerType): void;
38
- abstract setDisplayLabel(displayLabel: string): void;
39
- }
1
+ /** @packageDocumentation
2
+ * @module Metadata
3
+ */
4
+ import { CustomAttributeClassProps } from "../Deserialization/JsonProps";
5
+ import { CustomAttributeContainerType, ECClassModifier, SchemaItemType } from "../ECObjects";
6
+ import { ECClass } from "./Class";
7
+ import { Schema } from "./Schema";
8
+ /**
9
+ * A Typescript class representation of an ECCustomAttributeClass.
10
+ * @beta
11
+ */
12
+ export declare class CustomAttributeClass extends ECClass {
13
+ readonly schemaItemType: SchemaItemType.CustomAttributeClass;
14
+ protected _containerType?: CustomAttributeContainerType;
15
+ get containerType(): CustomAttributeContainerType;
16
+ constructor(schema: Schema, name: string, modifier?: ECClassModifier);
17
+ /**
18
+ * Save this CustomAttributeClasses properties to an object for serializing to JSON.
19
+ * @param standalone Serialization includes only this object (as opposed to the full schema).
20
+ * @param includeSchemaVersion Include the Schema's version information in the serialized object.
21
+ */
22
+ toJSON(standalone?: boolean, includeSchemaVersion?: boolean): CustomAttributeClassProps;
23
+ /** @internal */
24
+ toXml(schemaXml: Document): Promise<Element>;
25
+ fromJSONSync(customAttributeProps: CustomAttributeClassProps): void;
26
+ fromJSON(customAttributeProps: CustomAttributeClassProps): Promise<void>;
27
+ /**
28
+ * @alpha Used in schema editing.
29
+ */
30
+ protected setContainerType(containerType: CustomAttributeContainerType): void;
31
+ }
32
+ /**
33
+ * @internal
34
+ * An abstract class used for Schema editing.
35
+ */
36
+ export declare abstract class MutableCAClass extends CustomAttributeClass {
37
+ abstract setContainerType(containerType: CustomAttributeContainerType): void;
38
+ abstract setDisplayLabel(displayLabel: string): void;
39
+ }
40
40
  //# sourceMappingURL=CustomAttributeClass.d.ts.map
@@ -1,69 +1,69 @@
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.MutableCAClass = exports.CustomAttributeClass = void 0;
11
- const ECObjects_1 = require("../ECObjects");
12
- const Exception_1 = require("../Exception");
13
- const Class_1 = require("./Class");
14
- /**
15
- * A Typescript class representation of an ECCustomAttributeClass.
16
- * @beta
17
- */
18
- class CustomAttributeClass extends Class_1.ECClass {
19
- constructor(schema, name, modifier) {
20
- super(schema, name, modifier);
21
- this.schemaItemType = ECObjects_1.SchemaItemType.CustomAttributeClass;
22
- }
23
- get containerType() {
24
- if (undefined === this._containerType)
25
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidContainerType, `The CustomAttributeClass ${this.name} does not have a CustomAttributeContainerType.`);
26
- return this._containerType;
27
- }
28
- /**
29
- * Save this CustomAttributeClasses properties to an object for serializing to JSON.
30
- * @param standalone Serialization includes only this object (as opposed to the full schema).
31
- * @param includeSchemaVersion Include the Schema's version information in the serialized object.
32
- */
33
- toJSON(standalone = false, includeSchemaVersion = false) {
34
- const schemaJson = super.toJSON(standalone, includeSchemaVersion);
35
- schemaJson.appliesTo = (0, ECObjects_1.containerTypeToString)(this.containerType);
36
- return schemaJson;
37
- }
38
- /** @internal */
39
- async toXml(schemaXml) {
40
- const itemElement = await super.toXml(schemaXml);
41
- itemElement.setAttribute("appliesTo", (0, ECObjects_1.containerTypeToString)(this.containerType));
42
- return itemElement;
43
- }
44
- fromJSONSync(customAttributeProps) {
45
- super.fromJSONSync(customAttributeProps);
46
- const containerType = (0, ECObjects_1.parseCustomAttributeContainerType)(customAttributeProps.appliesTo);
47
- if (undefined === containerType)
48
- throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidContainerType, `${containerType} is not a valid CustomAttributeContainerType.`);
49
- this._containerType = containerType;
50
- }
51
- async fromJSON(customAttributeProps) {
52
- this.fromJSONSync(customAttributeProps);
53
- }
54
- /**
55
- * @alpha Used in schema editing.
56
- */
57
- setContainerType(containerType) {
58
- this._containerType = containerType;
59
- }
60
- }
61
- exports.CustomAttributeClass = CustomAttributeClass;
62
- /**
63
- * @internal
64
- * An abstract class used for Schema editing.
65
- */
66
- class MutableCAClass extends CustomAttributeClass {
67
- }
68
- exports.MutableCAClass = MutableCAClass;
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.MutableCAClass = exports.CustomAttributeClass = void 0;
11
+ const ECObjects_1 = require("../ECObjects");
12
+ const Exception_1 = require("../Exception");
13
+ const Class_1 = require("./Class");
14
+ /**
15
+ * A Typescript class representation of an ECCustomAttributeClass.
16
+ * @beta
17
+ */
18
+ class CustomAttributeClass extends Class_1.ECClass {
19
+ get containerType() {
20
+ if (undefined === this._containerType)
21
+ throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidContainerType, `The CustomAttributeClass ${this.name} does not have a CustomAttributeContainerType.`);
22
+ return this._containerType;
23
+ }
24
+ constructor(schema, name, modifier) {
25
+ super(schema, name, modifier);
26
+ this.schemaItemType = ECObjects_1.SchemaItemType.CustomAttributeClass;
27
+ }
28
+ /**
29
+ * Save this CustomAttributeClasses properties to an object for serializing to JSON.
30
+ * @param standalone Serialization includes only this object (as opposed to the full schema).
31
+ * @param includeSchemaVersion Include the Schema's version information in the serialized object.
32
+ */
33
+ toJSON(standalone = false, includeSchemaVersion = false) {
34
+ const schemaJson = super.toJSON(standalone, includeSchemaVersion);
35
+ schemaJson.appliesTo = (0, ECObjects_1.containerTypeToString)(this.containerType);
36
+ return schemaJson;
37
+ }
38
+ /** @internal */
39
+ async toXml(schemaXml) {
40
+ const itemElement = await super.toXml(schemaXml);
41
+ itemElement.setAttribute("appliesTo", (0, ECObjects_1.containerTypeToString)(this.containerType));
42
+ return itemElement;
43
+ }
44
+ fromJSONSync(customAttributeProps) {
45
+ super.fromJSONSync(customAttributeProps);
46
+ const containerType = (0, ECObjects_1.parseCustomAttributeContainerType)(customAttributeProps.appliesTo);
47
+ if (undefined === containerType)
48
+ throw new Exception_1.ECObjectsError(Exception_1.ECObjectsStatus.InvalidContainerType, `${containerType} is not a valid CustomAttributeContainerType.`);
49
+ this._containerType = containerType;
50
+ }
51
+ async fromJSON(customAttributeProps) {
52
+ this.fromJSONSync(customAttributeProps);
53
+ }
54
+ /**
55
+ * @alpha Used in schema editing.
56
+ */
57
+ setContainerType(containerType) {
58
+ this._containerType = containerType;
59
+ }
60
+ }
61
+ exports.CustomAttributeClass = CustomAttributeClass;
62
+ /**
63
+ * @internal
64
+ * An abstract class used for Schema editing.
65
+ */
66
+ class MutableCAClass extends CustomAttributeClass {
67
+ }
68
+ exports.MutableCAClass = MutableCAClass;
69
69
  //# sourceMappingURL=CustomAttributeClass.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomAttributeClass.js","sourceRoot":"","sources":["../../../src/Metadata/CustomAttributeClass.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,4CAEsB;AACtB,4CAA+D;AAC/D,mCAAkC;AAGlC;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,eAAO;IAU/C,YAAY,MAAc,EAAE,IAAY,EAAE,QAA0B;QAClE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,0BAAc,CAAC,oBAAoB,CAAC;IAC5D,CAAC;IATD,IAAW,aAAa;QACtB,IAAI,SAAS,KAAK,IAAI,CAAC,cAAc;YACnC,MAAM,IAAI,0BAAc,CAAC,2BAAe,CAAC,oBAAoB,EAAE,4BAA4B,IAAI,CAAC,IAAI,gDAAgD,CAAC,CAAC;QACxJ,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAOD;;;;OAIG;IACa,MAAM,CAAC,aAAsB,KAAK,EAAE,uBAAgC,KAAK;QACvF,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,oBAAoB,CAAQ,CAAC;QACzE,UAAU,CAAC,SAAS,GAAG,IAAA,iCAAqB,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjE,OAAO,UAAuC,CAAC;IACjD,CAAC;IAED,gBAAgB;IACA,KAAK,CAAC,KAAK,CAAC,SAAmB;QAC7C,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACjD,WAAW,CAAC,YAAY,CAAC,WAAW,EAAE,IAAA,iCAAqB,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;QACjF,OAAO,WAAW,CAAC;IACrB,CAAC;IAEe,YAAY,CAAC,oBAA+C;QAC1E,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;QACzC,MAAM,aAAa,GAAG,IAAA,6CAAiC,EAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;QACxF,IAAI,SAAS,KAAK,aAAa;YAC7B,MAAM,IAAI,0BAAc,CAAC,2BAAe,CAAC,oBAAoB,EAAE,GAAG,aAAa,+CAA+C,CAAC,CAAC;QAClI,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;IAEe,KAAK,CAAC,QAAQ,CAAC,oBAA+C;QAC5E,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACO,gBAAgB,CAAC,aAA2C;QACpE,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;CACF;AAnDD,oDAmDC;AACD;;;GAGG;AACH,MAAsB,cAAe,SAAQ,oBAAoB;CAGhE;AAHD,wCAGC","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 { CustomAttributeClassProps } from \"../Deserialization/JsonProps\";\r\nimport {\r\n containerTypeToString, CustomAttributeContainerType, ECClassModifier, parseCustomAttributeContainerType, SchemaItemType,\r\n} from \"../ECObjects\";\r\nimport { ECObjectsError, ECObjectsStatus } from \"../Exception\";\r\nimport { ECClass } from \"./Class\";\r\nimport { Schema } from \"./Schema\";\r\n\r\n/**\r\n * A Typescript class representation of an ECCustomAttributeClass.\r\n * @beta\r\n */\r\nexport class CustomAttributeClass extends ECClass {\r\n public override readonly schemaItemType!: SchemaItemType.CustomAttributeClass; // eslint-disable-line\r\n protected _containerType?: CustomAttributeContainerType;\r\n\r\n public get containerType(): CustomAttributeContainerType {\r\n if (undefined === this._containerType)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidContainerType, `The CustomAttributeClass ${this.name} does not have a CustomAttributeContainerType.`);\r\n return this._containerType;\r\n }\r\n\r\n constructor(schema: Schema, name: string, modifier?: ECClassModifier) {\r\n super(schema, name, modifier);\r\n this.schemaItemType = SchemaItemType.CustomAttributeClass;\r\n }\r\n\r\n /**\r\n * Save this CustomAttributeClasses properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): CustomAttributeClassProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n schemaJson.appliesTo = containerTypeToString(this.containerType);\r\n return schemaJson as CustomAttributeClassProps;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n itemElement.setAttribute(\"appliesTo\", containerTypeToString(this.containerType));\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(customAttributeProps: CustomAttributeClassProps) {\r\n super.fromJSONSync(customAttributeProps);\r\n const containerType = parseCustomAttributeContainerType(customAttributeProps.appliesTo);\r\n if (undefined === containerType)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidContainerType, `${containerType} is not a valid CustomAttributeContainerType.`);\r\n this._containerType = containerType;\r\n }\r\n\r\n public override async fromJSON(customAttributeProps: CustomAttributeClassProps) {\r\n this.fromJSONSync(customAttributeProps);\r\n }\r\n\r\n /**\r\n * @alpha Used in schema editing.\r\n */\r\n protected setContainerType(containerType: CustomAttributeContainerType) {\r\n this._containerType = containerType;\r\n }\r\n}\r\n/**\r\n * @internal\r\n * An abstract class used for Schema editing.\r\n */\r\nexport abstract class MutableCAClass extends CustomAttributeClass {\r\n public abstract override setContainerType(containerType: CustomAttributeContainerType): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
1
+ {"version":3,"file":"CustomAttributeClass.js","sourceRoot":"","sources":["../../../src/Metadata/CustomAttributeClass.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,4CAEsB;AACtB,4CAA+D;AAC/D,mCAAkC;AAGlC;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,eAAO;IAI/C,IAAW,aAAa;QACtB,IAAI,SAAS,KAAK,IAAI,CAAC,cAAc;YACnC,MAAM,IAAI,0BAAc,CAAC,2BAAe,CAAC,oBAAoB,EAAE,4BAA4B,IAAI,CAAC,IAAI,gDAAgD,CAAC,CAAC;QACxJ,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,YAAY,MAAc,EAAE,IAAY,EAAE,QAA0B;QAClE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,0BAAc,CAAC,oBAAoB,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACa,MAAM,CAAC,aAAsB,KAAK,EAAE,uBAAgC,KAAK;QACvF,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,oBAAoB,CAAQ,CAAC;QACzE,UAAU,CAAC,SAAS,GAAG,IAAA,iCAAqB,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjE,OAAO,UAAuC,CAAC;IACjD,CAAC;IAED,gBAAgB;IACA,KAAK,CAAC,KAAK,CAAC,SAAmB;QAC7C,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACjD,WAAW,CAAC,YAAY,CAAC,WAAW,EAAE,IAAA,iCAAqB,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;QACjF,OAAO,WAAW,CAAC;IACrB,CAAC;IAEe,YAAY,CAAC,oBAA+C;QAC1E,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;QACzC,MAAM,aAAa,GAAG,IAAA,6CAAiC,EAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;QACxF,IAAI,SAAS,KAAK,aAAa;YAC7B,MAAM,IAAI,0BAAc,CAAC,2BAAe,CAAC,oBAAoB,EAAE,GAAG,aAAa,+CAA+C,CAAC,CAAC;QAClI,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;IAEe,KAAK,CAAC,QAAQ,CAAC,oBAA+C;QAC5E,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACO,gBAAgB,CAAC,aAA2C;QACpE,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;CACF;AAnDD,oDAmDC;AACD;;;GAGG;AACH,MAAsB,cAAe,SAAQ,oBAAoB;CAGhE;AAHD,wCAGC","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 { CustomAttributeClassProps } from \"../Deserialization/JsonProps\";\r\nimport {\r\n containerTypeToString, CustomAttributeContainerType, ECClassModifier, parseCustomAttributeContainerType, SchemaItemType,\r\n} from \"../ECObjects\";\r\nimport { ECObjectsError, ECObjectsStatus } from \"../Exception\";\r\nimport { ECClass } from \"./Class\";\r\nimport { Schema } from \"./Schema\";\r\n\r\n/**\r\n * A Typescript class representation of an ECCustomAttributeClass.\r\n * @beta\r\n */\r\nexport class CustomAttributeClass extends ECClass {\r\n public override readonly schemaItemType!: SchemaItemType.CustomAttributeClass; // eslint-disable-line\r\n protected _containerType?: CustomAttributeContainerType;\r\n\r\n public get containerType(): CustomAttributeContainerType {\r\n if (undefined === this._containerType)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidContainerType, `The CustomAttributeClass ${this.name} does not have a CustomAttributeContainerType.`);\r\n return this._containerType;\r\n }\r\n\r\n constructor(schema: Schema, name: string, modifier?: ECClassModifier) {\r\n super(schema, name, modifier);\r\n this.schemaItemType = SchemaItemType.CustomAttributeClass;\r\n }\r\n\r\n /**\r\n * Save this CustomAttributeClasses properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): CustomAttributeClassProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n schemaJson.appliesTo = containerTypeToString(this.containerType);\r\n return schemaJson as CustomAttributeClassProps;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n itemElement.setAttribute(\"appliesTo\", containerTypeToString(this.containerType));\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(customAttributeProps: CustomAttributeClassProps) {\r\n super.fromJSONSync(customAttributeProps);\r\n const containerType = parseCustomAttributeContainerType(customAttributeProps.appliesTo);\r\n if (undefined === containerType)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidContainerType, `${containerType} is not a valid CustomAttributeContainerType.`);\r\n this._containerType = containerType;\r\n }\r\n\r\n public override async fromJSON(customAttributeProps: CustomAttributeClassProps) {\r\n this.fromJSONSync(customAttributeProps);\r\n }\r\n\r\n /**\r\n * @alpha Used in schema editing.\r\n */\r\n protected setContainerType(containerType: CustomAttributeContainerType) {\r\n this._containerType = containerType;\r\n }\r\n}\r\n/**\r\n * @internal\r\n * An abstract class used for Schema editing.\r\n */\r\nexport abstract class MutableCAClass extends CustomAttributeClass {\r\n public abstract override setContainerType(containerType: CustomAttributeContainerType): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
@@ -1,78 +1,78 @@
1
- /** @packageDocumentation
2
- * @module Metadata
3
- */
4
- import { EntityClassProps } from "../Deserialization/JsonProps";
5
- import { ECClassModifier, SchemaItemType, StrengthDirection } from "../ECObjects";
6
- import { LazyLoadedMixin } from "../Interfaces";
7
- import { ECClass } from "./Class";
8
- import { Mixin } from "./Mixin";
9
- import { AnyProperty, NavigationProperty, Property } from "./Property";
10
- import { RelationshipClass } from "./RelationshipClass";
11
- import { Schema } from "./Schema";
12
- /**
13
- * A Typescript class representation of an ECEntityClass.
14
- * @beta
15
- */
16
- export declare class EntityClass extends ECClass {
17
- readonly schemaItemType: SchemaItemType.EntityClass;
18
- protected _mixins?: LazyLoadedMixin[];
19
- constructor(schema: Schema, name: string, modifier?: ECClassModifier);
20
- get mixins(): LazyLoadedMixin[];
21
- getMixinsSync(): Iterable<Mixin>;
22
- /**
23
- *
24
- * @param mixin
25
- */
26
- protected addMixin(mixin: Mixin): void;
27
- /**
28
- * Searches the base class, if one exists, first then any mixins that exist for the property with the name provided.
29
- * @param name The name of the property to find.
30
- */
31
- getInheritedProperty(name: string): Promise<AnyProperty | undefined>;
32
- /**
33
- * Searches the base class, if one exists, first then any mixins that exist for the property with the name provided.
34
- * @param name The name of the property to find.
35
- */
36
- getInheritedPropertySync(name: string): Property | undefined;
37
- protected buildPropertyCache(result: Property[], existingValues?: Map<string, number>, resetBaseCaches?: boolean): Promise<void>;
38
- protected buildPropertyCacheSync(result: Property[], existingValues?: Map<string, number>, resetBaseCaches?: boolean): void;
39
- /**
40
- *
41
- * @param name
42
- * @param relationship
43
- * @param direction
44
- */
45
- protected createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;
46
- /**
47
- *
48
- * @param name
49
- * @param relationship
50
- * @param direction
51
- */
52
- protected createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;
53
- /**
54
- * Save this EntityClass' properties to an object for serializing to JSON.
55
- * @param standalone Serialization includes only this object (as opposed to the full schema).
56
- * @param includeSchemaVersion Include the Schema's version information in the serialized object.
57
- */
58
- toJSON(standalone?: boolean, includeSchemaVersion?: boolean): EntityClassProps;
59
- /** @internal */
60
- toXml(schemaXml: Document): Promise<Element>;
61
- fromJSON(entityClassProps: EntityClassProps): Promise<void>;
62
- fromJSONSync(entityClassProps: EntityClassProps): void;
63
- }
64
- /**
65
- * Hackish approach that works like a "friend class" so we can access protected members without making them public.
66
- * @internal
67
- */
68
- export declare abstract class MutableEntityClass extends EntityClass {
69
- abstract addMixin(mixin: Mixin): any;
70
- abstract createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;
71
- abstract createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;
72
- abstract setDisplayLabel(displayLabel: string): void;
73
- }
74
- /** @internal */
75
- export declare function createNavigationProperty(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;
76
- /** @internal */
77
- export declare function createNavigationPropertySync(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;
1
+ /** @packageDocumentation
2
+ * @module Metadata
3
+ */
4
+ import { EntityClassProps } from "../Deserialization/JsonProps";
5
+ import { ECClassModifier, SchemaItemType, StrengthDirection } from "../ECObjects";
6
+ import { LazyLoadedMixin } from "../Interfaces";
7
+ import { ECClass } from "./Class";
8
+ import { Mixin } from "./Mixin";
9
+ import { AnyProperty, NavigationProperty, Property } from "./Property";
10
+ import { RelationshipClass } from "./RelationshipClass";
11
+ import { Schema } from "./Schema";
12
+ /**
13
+ * A Typescript class representation of an ECEntityClass.
14
+ * @beta
15
+ */
16
+ export declare class EntityClass extends ECClass {
17
+ readonly schemaItemType: SchemaItemType.EntityClass;
18
+ protected _mixins?: LazyLoadedMixin[];
19
+ constructor(schema: Schema, name: string, modifier?: ECClassModifier);
20
+ get mixins(): LazyLoadedMixin[];
21
+ getMixinsSync(): Iterable<Mixin>;
22
+ /**
23
+ *
24
+ * @param mixin
25
+ */
26
+ protected addMixin(mixin: Mixin): void;
27
+ /**
28
+ * Searches the base class, if one exists, first then any mixins that exist for the property with the name provided.
29
+ * @param name The name of the property to find.
30
+ */
31
+ getInheritedProperty(name: string): Promise<AnyProperty | undefined>;
32
+ /**
33
+ * Searches the base class, if one exists, first then any mixins that exist for the property with the name provided.
34
+ * @param name The name of the property to find.
35
+ */
36
+ getInheritedPropertySync(name: string): Property | undefined;
37
+ protected buildPropertyCache(result: Property[], existingValues?: Map<string, number>, resetBaseCaches?: boolean): Promise<void>;
38
+ protected buildPropertyCacheSync(result: Property[], existingValues?: Map<string, number>, resetBaseCaches?: boolean): void;
39
+ /**
40
+ *
41
+ * @param name
42
+ * @param relationship
43
+ * @param direction
44
+ */
45
+ protected createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;
46
+ /**
47
+ *
48
+ * @param name
49
+ * @param relationship
50
+ * @param direction
51
+ */
52
+ protected createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;
53
+ /**
54
+ * Save this EntityClass' properties to an object for serializing to JSON.
55
+ * @param standalone Serialization includes only this object (as opposed to the full schema).
56
+ * @param includeSchemaVersion Include the Schema's version information in the serialized object.
57
+ */
58
+ toJSON(standalone?: boolean, includeSchemaVersion?: boolean): EntityClassProps;
59
+ /** @internal */
60
+ toXml(schemaXml: Document): Promise<Element>;
61
+ fromJSON(entityClassProps: EntityClassProps): Promise<void>;
62
+ fromJSONSync(entityClassProps: EntityClassProps): void;
63
+ }
64
+ /**
65
+ * Hackish approach that works like a "friend class" so we can access protected members without making them public.
66
+ * @internal
67
+ */
68
+ export declare abstract class MutableEntityClass extends EntityClass {
69
+ abstract addMixin(mixin: Mixin): any;
70
+ abstract createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;
71
+ abstract createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;
72
+ abstract setDisplayLabel(displayLabel: string): void;
73
+ }
74
+ /** @internal */
75
+ export declare function createNavigationProperty(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;
76
+ /** @internal */
77
+ export declare function createNavigationPropertySync(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;
78
78
  //# sourceMappingURL=EntityClass.d.ts.map