@itwin/ecschema-metadata 3.6.0-dev.36 → 3.6.0-dev.38

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 +86 -86
  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 +236 -236
  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":"Constant.js","sourceRoot":"","sources":["../../../src/Metadata/Constant.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4D;AAE5D,oFAAiF;AACjF,4CAA8C;AAC9C,4CAA+D;AAK/D,6CAA0C;AAE1C;;;GAGG;AACH,MAAa,QAAS,SAAQ,uBAAU;IAOtC,YAAY,MAAc,EAAE,IAAY;QACtC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACpB,IAAI,CAAC,cAAc,GAAG,0BAAc,CAAC,QAAQ,CAAC;QAC9C,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACxB,CAAC;IAED,IAAW,UAAU,KAAuC,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IACtF,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC5D,IAAW,SAAS,aAAa,OAAO,MAAA,IAAI,CAAC,UAAU,mCAAI,GAAG,CAAC,CAAC,CAAC;IACjE,IAAW,WAAW,aAAa,OAAO,MAAA,IAAI,CAAC,YAAY,mCAAI,GAAG,CAAC,CAAC,CAAC;IACrE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YACzC,IAAI,aAAa,CAAC,SAAS,KAAK,IAAI,CAAC,UAAU;gBAC7C,IAAI,CAAC,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC;SAC7C;QAED,IAAI,SAAS,KAAK,aAAa,CAAC,WAAW,EAAE;YAC3C,IAAI,aAAa,CAAC,WAAW,KAAK,IAAI,CAAC,YAAY;gBACjD,IAAI,CAAC,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC;SACjD;IACH,CAAC;IAEe,KAAK,CAAC,QAAQ,CAAC,aAA4B;QACzD,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACO,aAAa,CAAC,UAAgC;QACtD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,UAAkB;QACxC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED;;OAEG;IACO,YAAY,CAAC,SAAiB;QACtC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IAED;;OAEG;IACO,cAAc,CAAC,WAAmB;QAC1C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;CACF;AArHD,4BAqHC;AACD;;;GAGG;AACH,MAAsB,eAAgB,SAAQ,QAAQ;CAMrD;AAND,0CAMC","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 { DelayedPromiseWithProps } from \"../DelayedPromise\";\nimport { ConstantProps } from \"../Deserialization/JsonProps\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { SchemaItemType } from \"../ECObjects\";\nimport { ECObjectsError, ECObjectsStatus } from \"../Exception\";\nimport { LazyLoadedPhenomenon } from \"../Interfaces\";\nimport { SchemaItemKey } from \"../SchemaKey\";\nimport { Phenomenon } from \"./Phenomenon\";\nimport { Schema } from \"./Schema\";\nimport { SchemaItem } from \"./SchemaItem\";\n\n/**\n * A Constant is a specific type of Unit that represents a number.\n * @beta\n */\nexport class Constant extends SchemaItem {\n public override readonly schemaItemType!: SchemaItemType.Constant; // eslint-disable-line\n protected _phenomenon?: LazyLoadedPhenomenon;\n protected _definition: string;\n protected _numerator?: number;\n protected _denominator?: number;\n\n constructor(schema: Schema, name: string) {\n super(schema, name);\n this.schemaItemType = SchemaItemType.Constant;\n this._definition = \"\";\n }\n\n public get phenomenon(): LazyLoadedPhenomenon | undefined { return this._phenomenon; }\n public get definition(): string { return this._definition; }\n public get numerator(): number { return this._numerator ?? 1.0; }\n public get denominator(): number { return this._denominator ?? 1.0; }\n public get hasNumerator(): boolean { return (this._numerator !== undefined); }\n public get hasDenominator(): boolean { return (this._denominator !== undefined); }\n\n /**\n * Save this Constants properties to an object for serializing to JSON.\n * @param standalone Serialization includes only this object (as opposed to the full schema).\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\n */\n public override toJSON(standalone: boolean, includeSchemaVersion: boolean): ConstantProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n if (this.phenomenon !== undefined)\n schemaJson.phenomenon = this.phenomenon.fullName;\n schemaJson.definition = this.definition;\n if (this.hasNumerator)\n schemaJson.numerator = this.numerator;\n if (this.hasDenominator)\n schemaJson.denominator = this.denominator;\n return schemaJson as ConstantProps;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n itemElement.setAttribute(\"definition\", this.definition);\n if (this.hasNumerator)\n itemElement.setAttribute(\"numerator\", this.numerator.toString());\n if (this.hasDenominator)\n itemElement.setAttribute(\"denominator\", this.denominator.toString());\n\n const phenomenon = await this.phenomenon;\n if (undefined !== phenomenon) {\n const phenomenonName = XmlSerializationUtils.createXmlTypedName(this.schema, phenomenon.schema, phenomenon.name);\n itemElement.setAttribute(\"phenomenon\", phenomenonName);\n }\n\n return itemElement;\n }\n\n public override fromJSONSync(constantProps: ConstantProps) {\n super.fromJSONSync(constantProps);\n\n const schemaItemKey = this.schema.getSchemaItemKey(constantProps.phenomenon);\n if (!schemaItemKey)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the phenomenon ${constantProps.phenomenon}.`);\n this._phenomenon = new DelayedPromiseWithProps<SchemaItemKey, Phenomenon>(schemaItemKey,\n async () => {\n const phenom = await this.schema.lookupItem<Phenomenon>(schemaItemKey);\n if (undefined === phenom)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the phenomenon ${constantProps.phenomenon}.`);\n return phenom;\n });\n\n if (this._definition !== \"\" && constantProps.definition.toLowerCase() !== this._definition.toLowerCase())\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Constant ${this.name} has an invalid 'definition' attribute.`);\n else if (this._definition === \"\")\n this._definition = constantProps.definition;\n\n if (undefined !== constantProps.numerator) {\n if (constantProps.numerator !== this._numerator)\n this._numerator = constantProps.numerator;\n }\n\n if (undefined !== constantProps.denominator) {\n if (constantProps.denominator !== this._denominator)\n this._denominator = constantProps.denominator;\n }\n }\n\n public override async fromJSON(constantProps: ConstantProps) {\n this.fromJSONSync(constantProps);\n }\n\n /**\n * @alpha Used in schema editing.\n * @param phenomenon A LazyLoadedPhenomenon.\n */\n protected setPhenomenon(phenomenon: LazyLoadedPhenomenon) {\n this._phenomenon = phenomenon;\n }\n\n /**\n * @alpha Used in schema editing.\n */\n protected setDefinition(definition: string) {\n this._definition = definition;\n }\n\n /**\n * @alpha Used in schema editing.\n */\n protected setNumerator(numerator: number) {\n this._numerator = numerator;\n }\n\n /**\n * @alpha Used in schema editing.\n */\n protected setDenominator(denominator: number) {\n this._denominator = denominator;\n }\n}\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableConstant extends Constant {\n public abstract override setPhenomenon(phenomenon: LazyLoadedPhenomenon): void;\n public abstract override setDefinition(definition: string): void;\n public abstract override setNumerator(numerator: number): void;\n public abstract override setDenominator(denominator: number): void;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
1
+ {"version":3,"file":"Constant.js","sourceRoot":"","sources":["../../../src/Metadata/Constant.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4D;AAE5D,oFAAiF;AACjF,4CAA8C;AAC9C,4CAA+D;AAK/D,6CAA0C;AAE1C;;;GAGG;AACH,MAAa,QAAS,SAAQ,uBAAU;IAOtC,YAAY,MAAc,EAAE,IAAY;QACtC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACpB,IAAI,CAAC,cAAc,GAAG,0BAAc,CAAC,QAAQ,CAAC;QAC9C,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACxB,CAAC;IAED,IAAW,UAAU,KAAuC,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IACtF,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC5D,IAAW,SAAS,aAAa,OAAO,MAAA,IAAI,CAAC,UAAU,mCAAI,GAAG,CAAC,CAAC,CAAC;IACjE,IAAW,WAAW,aAAa,OAAO,MAAA,IAAI,CAAC,YAAY,mCAAI,GAAG,CAAC,CAAC,CAAC;IACrE,IAAW,YAAY,KAAc,OAAO,CAAC,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC;IAC9E,IAAW,cAAc,KAAc,OAAO,CAAC,IAAI,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC;IAElF;;;;OAIG;IACa,MAAM,CAAC,UAAmB,EAAE,oBAA6B;QACvE,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,oBAAoB,CAAQ,CAAC;QACzE,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS;YAC/B,UAAU,CAAC,UAA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;IACnC,CAAC;IAED;;;OAGG;IACO,aAAa,CAAC,UAAgC;QACtD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,UAAkB;QACxC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED;;OAEG;IACO,YAAY,CAAC,SAAiB;QACtC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IAED;;OAEG;IACO,cAAc,CAAC,WAAmB;QAC1C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;CACF;AArHD,4BAqHC;AACD;;;GAGG;AACH,MAAsB,eAAgB,SAAQ,QAAQ;CAMrD;AAND,0CAMC","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 { DelayedPromiseWithProps } from \"../DelayedPromise\";\r\nimport { ConstantProps } from \"../Deserialization/JsonProps\";\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { SchemaItemType } from \"../ECObjects\";\r\nimport { ECObjectsError, ECObjectsStatus } from \"../Exception\";\r\nimport { LazyLoadedPhenomenon } from \"../Interfaces\";\r\nimport { SchemaItemKey } from \"../SchemaKey\";\r\nimport { Phenomenon } from \"./Phenomenon\";\r\nimport { Schema } from \"./Schema\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\n\r\n/**\r\n * A Constant is a specific type of Unit that represents a number.\r\n * @beta\r\n */\r\nexport class Constant extends SchemaItem {\r\n public override readonly schemaItemType!: SchemaItemType.Constant; // eslint-disable-line\r\n protected _phenomenon?: LazyLoadedPhenomenon;\r\n protected _definition: string;\r\n protected _numerator?: number;\r\n protected _denominator?: number;\r\n\r\n constructor(schema: Schema, name: string) {\r\n super(schema, name);\r\n this.schemaItemType = SchemaItemType.Constant;\r\n this._definition = \"\";\r\n }\r\n\r\n public get phenomenon(): LazyLoadedPhenomenon | undefined { return this._phenomenon; }\r\n public get definition(): string { return this._definition; }\r\n public get numerator(): number { return this._numerator ?? 1.0; }\r\n public get denominator(): number { return this._denominator ?? 1.0; }\r\n public get hasNumerator(): boolean { return (this._numerator !== undefined); }\r\n public get hasDenominator(): boolean { return (this._denominator !== undefined); }\r\n\r\n /**\r\n * Save this Constants 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, includeSchemaVersion: boolean): ConstantProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n if (this.phenomenon !== undefined)\r\n schemaJson.phenomenon = this.phenomenon.fullName;\r\n schemaJson.definition = this.definition;\r\n if (this.hasNumerator)\r\n schemaJson.numerator = this.numerator;\r\n if (this.hasDenominator)\r\n schemaJson.denominator = this.denominator;\r\n return schemaJson as ConstantProps;\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(\"definition\", this.definition);\r\n if (this.hasNumerator)\r\n itemElement.setAttribute(\"numerator\", this.numerator.toString());\r\n if (this.hasDenominator)\r\n itemElement.setAttribute(\"denominator\", this.denominator.toString());\r\n\r\n const phenomenon = await this.phenomenon;\r\n if (undefined !== phenomenon) {\r\n const phenomenonName = XmlSerializationUtils.createXmlTypedName(this.schema, phenomenon.schema, phenomenon.name);\r\n itemElement.setAttribute(\"phenomenon\", phenomenonName);\r\n }\r\n\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(constantProps: ConstantProps) {\r\n super.fromJSONSync(constantProps);\r\n\r\n const schemaItemKey = this.schema.getSchemaItemKey(constantProps.phenomenon);\r\n if (!schemaItemKey)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the phenomenon ${constantProps.phenomenon}.`);\r\n this._phenomenon = new DelayedPromiseWithProps<SchemaItemKey, Phenomenon>(schemaItemKey,\r\n async () => {\r\n const phenom = await this.schema.lookupItem<Phenomenon>(schemaItemKey);\r\n if (undefined === phenom)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the phenomenon ${constantProps.phenomenon}.`);\r\n return phenom;\r\n });\r\n\r\n if (this._definition !== \"\" && constantProps.definition.toLowerCase() !== this._definition.toLowerCase())\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Constant ${this.name} has an invalid 'definition' attribute.`);\r\n else if (this._definition === \"\")\r\n this._definition = constantProps.definition;\r\n\r\n if (undefined !== constantProps.numerator) {\r\n if (constantProps.numerator !== this._numerator)\r\n this._numerator = constantProps.numerator;\r\n }\r\n\r\n if (undefined !== constantProps.denominator) {\r\n if (constantProps.denominator !== this._denominator)\r\n this._denominator = constantProps.denominator;\r\n }\r\n }\r\n\r\n public override async fromJSON(constantProps: ConstantProps) {\r\n this.fromJSONSync(constantProps);\r\n }\r\n\r\n /**\r\n * @alpha Used in schema editing.\r\n * @param phenomenon A LazyLoadedPhenomenon.\r\n */\r\n protected setPhenomenon(phenomenon: LazyLoadedPhenomenon) {\r\n this._phenomenon = phenomenon;\r\n }\r\n\r\n /**\r\n * @alpha Used in schema editing.\r\n */\r\n protected setDefinition(definition: string) {\r\n this._definition = definition;\r\n }\r\n\r\n /**\r\n * @alpha Used in schema editing.\r\n */\r\n protected setNumerator(numerator: number) {\r\n this._numerator = numerator;\r\n }\r\n\r\n /**\r\n * @alpha Used in schema editing.\r\n */\r\n protected setDenominator(denominator: number) {\r\n this._denominator = denominator;\r\n }\r\n}\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableConstant extends Constant {\r\n public abstract override setPhenomenon(phenomenon: LazyLoadedPhenomenon): void;\r\n public abstract override setDefinition(definition: string): void;\r\n public abstract override setNumerator(numerator: number): void;\r\n public abstract override setDenominator(denominator: number): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
@@ -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 +1 @@
1
- {"version":3,"file":"CustomAttribute.js","sourceRoot":"","sources":["../../../src/Metadata/CustomAttribute.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAwBH,gBAAgB;AAChB,SAAgB,yBAAyB,CAAC,gBAAgD;IACxF,IAAI,SAAS,KAAK,gBAAgB,EAAE,EAAE,gCAAgC;QACpE,MAAM,UAAU,GAAU,EAAE,CAAC;QAC7B,KAAK,MAAM,CAAC,EAAE,eAAe,CAAC,IAAI,gBAAgB,EAAE;YAClD,MAAM,SAAS,GAA6B,EAAE,CAAC;YAC/C,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,QAAa,EAAE,EAAE;gBACjD,MAAM,YAAY,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;gBACzC,SAAS,CAAC,YAAY,CAAC,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;YACtD,CAAC,CAAC,CAAC;YACH,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SAC5B;QACD,OAAO,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;KACzD;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAdD,8DAcC","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 { Schema } from \"./Schema\";\n\n/** @beta */\nexport interface CustomAttribute {\n className: string;\n [propName: string]: any;\n}\n\n/** @internal */\nexport interface CustomAttributeSet {\n [Symbol.iterator]: () => IterableIterator<[string, CustomAttribute]>;\n has(className: string): boolean;\n get(className: string): CustomAttribute | undefined;\n}\n\n/** @beta */\nexport interface CustomAttributeContainerProps {\n customAttributes?: CustomAttributeSet;\n fullName: string;\n schema: Schema;\n}\n\n/** @internal */\nexport function serializeCustomAttributes(customAttributes: CustomAttributeSet | undefined): any[] | undefined {\n if (undefined !== customAttributes) { // custom attributes is optional\n const attributes: any[] = [];\n for (const [, customAttribute] of customAttributes) {\n const attribute: { [value: string]: any } = {};\n Object.keys(customAttribute).map((property: any) => {\n const propertyName = property.toString();\n attribute[propertyName] = customAttribute[property];\n });\n attributes.push(attribute);\n }\n return (attributes.length > 0) ? attributes : undefined;\n }\n return undefined;\n}\n"]}
1
+ {"version":3,"file":"CustomAttribute.js","sourceRoot":"","sources":["../../../src/Metadata/CustomAttribute.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAwBH,gBAAgB;AAChB,SAAgB,yBAAyB,CAAC,gBAAgD;IACxF,IAAI,SAAS,KAAK,gBAAgB,EAAE,EAAE,gCAAgC;QACpE,MAAM,UAAU,GAAU,EAAE,CAAC;QAC7B,KAAK,MAAM,CAAC,EAAE,eAAe,CAAC,IAAI,gBAAgB,EAAE;YAClD,MAAM,SAAS,GAA6B,EAAE,CAAC;YAC/C,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,QAAa,EAAE,EAAE;gBACjD,MAAM,YAAY,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;gBACzC,SAAS,CAAC,YAAY,CAAC,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;YACtD,CAAC,CAAC,CAAC;YACH,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SAC5B;QACD,OAAO,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;KACzD;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAdD,8DAcC","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 { Schema } from \"./Schema\";\r\n\r\n/** @beta */\r\nexport interface CustomAttribute {\r\n className: string;\r\n [propName: string]: any;\r\n}\r\n\r\n/** @internal */\r\nexport interface CustomAttributeSet {\r\n [Symbol.iterator]: () => IterableIterator<[string, CustomAttribute]>;\r\n has(className: string): boolean;\r\n get(className: string): CustomAttribute | undefined;\r\n}\r\n\r\n/** @beta */\r\nexport interface CustomAttributeContainerProps {\r\n customAttributes?: CustomAttributeSet;\r\n fullName: string;\r\n schema: Schema;\r\n}\r\n\r\n/** @internal */\r\nexport function serializeCustomAttributes(customAttributes: CustomAttributeSet | undefined): any[] | undefined {\r\n if (undefined !== customAttributes) { // custom attributes is optional\r\n const attributes: any[] = [];\r\n for (const [, customAttribute] of customAttributes) {\r\n const attribute: { [value: string]: any } = {};\r\n Object.keys(customAttribute).map((property: any) => {\r\n const propertyName = property.toString();\r\n attribute[propertyName] = customAttribute[property];\r\n });\r\n attributes.push(attribute);\r\n }\r\n return (attributes.length > 0) ? attributes : undefined;\r\n }\r\n return undefined;\r\n}\r\n"]}
@@ -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
+ 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;
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,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Ae,SAAQ,oBAAoB;CAGhE;AAHD,wCAGC","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 { CustomAttributeClassProps } from \"../Deserialization/JsonProps\";\nimport {\n containerTypeToString, CustomAttributeContainerType, ECClassModifier, parseCustomAttributeContainerType, SchemaItemType,\n} from \"../ECObjects\";\nimport { ECObjectsError, ECObjectsStatus } from \"../Exception\";\nimport { ECClass } from \"./Class\";\nimport { Schema } from \"./Schema\";\n\n/**\n * A Typescript class representation of an ECCustomAttributeClass.\n * @beta\n */\nexport class CustomAttributeClass extends ECClass {\n public override readonly schemaItemType!: SchemaItemType.CustomAttributeClass; // eslint-disable-line\n protected _containerType?: CustomAttributeContainerType;\n\n public get containerType(): CustomAttributeContainerType {\n if (undefined === this._containerType)\n throw new ECObjectsError(ECObjectsStatus.InvalidContainerType, `The CustomAttributeClass ${this.name} does not have a CustomAttributeContainerType.`);\n return this._containerType;\n }\n\n constructor(schema: Schema, name: string, modifier?: ECClassModifier) {\n super(schema, name, modifier);\n this.schemaItemType = SchemaItemType.CustomAttributeClass;\n }\n\n /**\n * Save this CustomAttributeClasses properties to an object for serializing to JSON.\n * @param standalone Serialization includes only this object (as opposed to the full schema).\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\n */\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): CustomAttributeClassProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n schemaJson.appliesTo = containerTypeToString(this.containerType);\n return schemaJson as CustomAttributeClassProps;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n itemElement.setAttribute(\"appliesTo\", containerTypeToString(this.containerType));\n return itemElement;\n }\n\n public override fromJSONSync(customAttributeProps: CustomAttributeClassProps) {\n super.fromJSONSync(customAttributeProps);\n const containerType = parseCustomAttributeContainerType(customAttributeProps.appliesTo);\n if (undefined === containerType)\n throw new ECObjectsError(ECObjectsStatus.InvalidContainerType, `${containerType} is not a valid CustomAttributeContainerType.`);\n this._containerType = containerType;\n }\n\n public override async fromJSON(customAttributeProps: CustomAttributeClassProps) {\n this.fromJSONSync(customAttributeProps);\n }\n\n /**\n * @alpha Used in schema editing.\n */\n protected setContainerType(containerType: CustomAttributeContainerType) {\n this._containerType = containerType;\n }\n}\n/**\n * @internal\n * An abstract class used for Schema editing.\n */\nexport abstract class MutableCAClass extends CustomAttributeClass {\n public abstract override setContainerType(containerType: CustomAttributeContainerType): void;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\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;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,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