@itwin/ecschema-metadata 4.8.0-dev.9 → 4.9.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -1
- package/lib/cjs/Constants.js.map +1 -1
- package/lib/cjs/DelayedPromise.js.map +1 -1
- package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
- package/lib/cjs/Deserialization/Helper.js.map +1 -1
- package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
- package/lib/cjs/Deserialization/JsonProps.d.ts +4 -0
- package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
- package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
- package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
- package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/cjs/ECName.js.map +1 -1
- package/lib/cjs/ECObjects.js.map +1 -1
- package/lib/cjs/Exception.js.map +1 -1
- package/lib/cjs/Interfaces.js.map +1 -1
- package/lib/cjs/Metadata/Class.d.ts +0 -6
- package/lib/cjs/Metadata/Class.d.ts.map +1 -1
- package/lib/cjs/Metadata/Class.js +0 -8
- package/lib/cjs/Metadata/Class.js.map +1 -1
- package/lib/cjs/Metadata/Constant.js.map +1 -1
- package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts +7 -3
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.js +16 -10
- package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
- package/lib/cjs/Metadata/EntityClass.js.map +1 -1
- package/lib/cjs/Metadata/Enumeration.js.map +1 -1
- package/lib/cjs/Metadata/Format.js.map +1 -1
- package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/cjs/Metadata/Mixin.js.map +1 -1
- package/lib/cjs/Metadata/OverrideFormat.d.ts.map +1 -1
- package/lib/cjs/Metadata/OverrideFormat.js +3 -1
- package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
- package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
- package/lib/cjs/Metadata/Property.js.map +1 -1
- package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
- package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
- package/lib/cjs/Metadata/Schema.d.ts +14 -0
- package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
- package/lib/cjs/Metadata/Schema.js +21 -0
- package/lib/cjs/Metadata/Schema.js.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.d.ts +5 -0
- package/lib/cjs/Metadata/SchemaItem.d.ts.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.js +7 -0
- package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
- package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
- package/lib/cjs/PropertyTypes.js.map +1 -1
- package/lib/cjs/SchemaJsonLocater.js.map +1 -1
- package/lib/cjs/SchemaKey.js.map +1 -1
- package/lib/cjs/SchemaLoader.js.map +1 -1
- package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
- package/lib/cjs/UnitConversion/Graph.js.map +1 -1
- package/lib/cjs/UnitConversion/Parser.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
- package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
- package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
- package/lib/cjs/ecschema-metadata.js.map +1 -1
- package/lib/cjs/utils/SchemaGraph.js.map +1 -1
- package/lib/esm/Constants.d.ts +24 -0
- package/lib/esm/Constants.d.ts.map +1 -0
- package/lib/esm/Constants.js +30 -0
- package/lib/esm/Constants.js.map +1 -0
- package/lib/esm/Context.d.ts +219 -0
- package/lib/esm/Context.d.ts.map +1 -0
- package/lib/esm/Context.js +321 -0
- package/lib/esm/Context.js.map +1 -0
- package/lib/esm/DelayedPromise.d.ts +89 -0
- package/lib/esm/DelayedPromise.d.ts.map +1 -0
- package/lib/esm/DelayedPromise.js +88 -0
- package/lib/esm/DelayedPromise.js.map +1 -0
- package/lib/esm/Deserialization/AbstractParser.d.ts +46 -0
- package/lib/esm/Deserialization/AbstractParser.d.ts.map +1 -0
- package/lib/esm/Deserialization/AbstractParser.js +8 -0
- package/lib/esm/Deserialization/AbstractParser.js.map +1 -0
- package/lib/esm/Deserialization/Helper.d.ts +263 -0
- package/lib/esm/Deserialization/Helper.d.ts.map +1 -0
- package/lib/esm/Deserialization/Helper.js +871 -0
- package/lib/esm/Deserialization/Helper.js.map +1 -0
- package/lib/esm/Deserialization/JsonParser.d.ts +166 -0
- package/lib/esm/Deserialization/JsonParser.d.ts.map +1 -0
- package/lib/esm/Deserialization/JsonParser.js +677 -0
- package/lib/esm/Deserialization/JsonParser.js.map +1 -0
- package/lib/esm/Deserialization/JsonProps.d.ts +273 -0
- package/lib/esm/Deserialization/JsonProps.d.ts.map +1 -0
- package/lib/esm/Deserialization/JsonProps.js +9 -0
- package/lib/esm/Deserialization/JsonProps.js.map +1 -0
- package/lib/esm/Deserialization/SchemaGraphUtil.d.ts +35 -0
- package/lib/esm/Deserialization/SchemaGraphUtil.d.ts.map +1 -0
- package/lib/esm/Deserialization/SchemaGraphUtil.js +74 -0
- package/lib/esm/Deserialization/SchemaGraphUtil.js.map +1 -0
- package/lib/esm/Deserialization/XmlParser.d.ts +86 -0
- package/lib/esm/Deserialization/XmlParser.d.ts.map +1 -0
- package/lib/esm/Deserialization/XmlParser.js +970 -0
- package/lib/esm/Deserialization/XmlParser.js.map +1 -0
- package/lib/esm/Deserialization/XmlSerializationUtils.d.ts +55 -0
- package/lib/esm/Deserialization/XmlSerializationUtils.d.ts.map +1 -0
- package/lib/esm/Deserialization/XmlSerializationUtils.js +172 -0
- package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -0
- package/lib/esm/ECName.d.ts +31 -0
- package/lib/esm/ECName.d.ts.map +1 -0
- package/lib/esm/ECName.js +82 -0
- package/lib/esm/ECName.js.map +1 -0
- package/lib/esm/ECObjects.d.ts +166 -0
- package/lib/esm/ECObjects.d.ts.map +1 -0
- package/lib/esm/ECObjects.js +422 -0
- package/lib/esm/ECObjects.js.map +1 -0
- package/lib/esm/Exception.d.ts +45 -0
- package/lib/esm/Exception.d.ts.map +1 -0
- package/lib/esm/Exception.js +82 -0
- package/lib/esm/Exception.js.map +1 -0
- package/lib/esm/Interfaces.d.ts +79 -0
- package/lib/esm/Interfaces.d.ts.map +1 -0
- package/lib/esm/Interfaces.js +9 -0
- package/lib/esm/Interfaces.js.map +1 -0
- package/lib/esm/Metadata/Class.d.ts +245 -0
- package/lib/esm/Metadata/Class.d.ts.map +1 -0
- package/lib/esm/Metadata/Class.js +552 -0
- package/lib/esm/Metadata/Class.js.map +1 -0
- package/lib/esm/Metadata/Constant.d.ts +65 -0
- package/lib/esm/Metadata/Constant.d.ts.map +1 -0
- package/lib/esm/Metadata/Constant.js +119 -0
- package/lib/esm/Metadata/Constant.js.map +1 -0
- package/lib/esm/Metadata/CustomAttribute.d.ts +24 -0
- package/lib/esm/Metadata/CustomAttribute.d.ts.map +1 -0
- package/lib/esm/Metadata/CustomAttribute.js +24 -0
- package/lib/esm/Metadata/CustomAttribute.js.map +1 -0
- package/lib/esm/Metadata/CustomAttributeClass.d.ts +44 -0
- package/lib/esm/Metadata/CustomAttributeClass.d.ts.map +1 -0
- package/lib/esm/Metadata/CustomAttributeClass.js +70 -0
- package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -0
- package/lib/esm/Metadata/EntityClass.d.ts +78 -0
- package/lib/esm/Metadata/EntityClass.d.ts.map +1 -0
- package/lib/esm/Metadata/EntityClass.js +224 -0
- package/lib/esm/Metadata/EntityClass.js.map +1 -0
- package/lib/esm/Metadata/Enumeration.d.ts +87 -0
- package/lib/esm/Metadata/Enumeration.d.ts.map +1 -0
- package/lib/esm/Metadata/Enumeration.js +155 -0
- package/lib/esm/Metadata/Enumeration.js.map +1 -0
- package/lib/esm/Metadata/Format.d.ts +99 -0
- package/lib/esm/Metadata/Format.d.ts.map +1 -0
- package/lib/esm/Metadata/Format.js +238 -0
- package/lib/esm/Metadata/Format.js.map +1 -0
- package/lib/esm/Metadata/InvertedUnit.d.ts +50 -0
- package/lib/esm/Metadata/InvertedUnit.d.ts.map +1 -0
- package/lib/esm/Metadata/InvertedUnit.js +93 -0
- package/lib/esm/Metadata/InvertedUnit.js.map +1 -0
- package/lib/esm/Metadata/KindOfQuantity.d.ts +72 -0
- package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -0
- package/lib/esm/Metadata/KindOfQuantity.js +229 -0
- package/lib/esm/Metadata/KindOfQuantity.js.map +1 -0
- package/lib/esm/Metadata/Mixin.d.ts +55 -0
- package/lib/esm/Metadata/Mixin.d.ts.map +1 -0
- package/lib/esm/Metadata/Mixin.js +109 -0
- package/lib/esm/Metadata/Mixin.js.map +1 -0
- package/lib/esm/Metadata/OverrideFormat.d.ts +68 -0
- package/lib/esm/Metadata/OverrideFormat.d.ts.map +1 -0
- package/lib/esm/Metadata/OverrideFormat.js +124 -0
- package/lib/esm/Metadata/OverrideFormat.js.map +1 -0
- package/lib/esm/Metadata/Phenomenon.d.ts +34 -0
- package/lib/esm/Metadata/Phenomenon.d.ts.map +1 -0
- package/lib/esm/Metadata/Phenomenon.js +55 -0
- package/lib/esm/Metadata/Phenomenon.js.map +1 -0
- package/lib/esm/Metadata/Property.d.ts +247 -0
- package/lib/esm/Metadata/Property.d.ts.map +1 -0
- package/lib/esm/Metadata/Property.js +565 -0
- package/lib/esm/Metadata/Property.js.map +1 -0
- package/lib/esm/Metadata/PropertyCategory.d.ts +40 -0
- package/lib/esm/Metadata/PropertyCategory.d.ts.map +1 -0
- package/lib/esm/Metadata/PropertyCategory.js +57 -0
- package/lib/esm/Metadata/PropertyCategory.js.map +1 -0
- package/lib/esm/Metadata/RelationshipClass.d.ts +170 -0
- package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -0
- package/lib/esm/Metadata/RelationshipClass.js +380 -0
- package/lib/esm/Metadata/RelationshipClass.js.map +1 -0
- package/lib/esm/Metadata/Schema.d.ts +330 -0
- package/lib/esm/Metadata/Schema.d.ts.map +1 -0
- package/lib/esm/Metadata/Schema.js +570 -0
- package/lib/esm/Metadata/Schema.js.map +1 -0
- package/lib/esm/Metadata/SchemaItem.d.ts +67 -0
- package/lib/esm/Metadata/SchemaItem.d.ts.map +1 -0
- package/lib/esm/Metadata/SchemaItem.js +140 -0
- package/lib/esm/Metadata/SchemaItem.js.map +1 -0
- package/lib/esm/Metadata/Unit.d.ts +77 -0
- package/lib/esm/Metadata/Unit.d.ts.map +1 -0
- package/lib/esm/Metadata/Unit.js +158 -0
- package/lib/esm/Metadata/Unit.js.map +1 -0
- package/lib/esm/Metadata/UnitSystem.d.ts +21 -0
- package/lib/esm/Metadata/UnitSystem.d.ts.map +1 -0
- package/lib/esm/Metadata/UnitSystem.js +25 -0
- package/lib/esm/Metadata/UnitSystem.js.map +1 -0
- package/lib/esm/PropertyTypes.d.ts +50 -0
- package/lib/esm/PropertyTypes.d.ts.map +1 -0
- package/lib/esm/PropertyTypes.js +88 -0
- package/lib/esm/PropertyTypes.js.map +1 -0
- package/lib/esm/SchemaJsonLocater.d.ts +42 -0
- package/lib/esm/SchemaJsonLocater.d.ts.map +1 -0
- package/lib/esm/SchemaJsonLocater.js +54 -0
- package/lib/esm/SchemaJsonLocater.js.map +1 -0
- package/lib/esm/SchemaKey.d.ts +111 -0
- package/lib/esm/SchemaKey.d.ts.map +1 -0
- package/lib/esm/SchemaKey.js +214 -0
- package/lib/esm/SchemaKey.js.map +1 -0
- package/lib/esm/SchemaLoader.d.ts +32 -0
- package/lib/esm/SchemaLoader.d.ts.map +1 -0
- package/lib/esm/SchemaLoader.js +53 -0
- package/lib/esm/SchemaLoader.js.map +1 -0
- package/lib/esm/SchemaPartVisitorDelegate.d.ts +275 -0
- package/lib/esm/SchemaPartVisitorDelegate.d.ts.map +1 -0
- package/lib/esm/SchemaPartVisitorDelegate.js +209 -0
- package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -0
- package/lib/esm/UnitConversion/Graph.d.ts +35 -0
- package/lib/esm/UnitConversion/Graph.d.ts.map +1 -0
- package/lib/esm/UnitConversion/Graph.js +80 -0
- package/lib/esm/UnitConversion/Graph.js.map +1 -0
- package/lib/esm/UnitConversion/Parser.d.ts +9 -0
- package/lib/esm/UnitConversion/Parser.d.ts.map +1 -0
- package/lib/esm/UnitConversion/Parser.js +39 -0
- package/lib/esm/UnitConversion/Parser.js.map +1 -0
- package/lib/esm/UnitConversion/UnitConversion.d.ts +46 -0
- package/lib/esm/UnitConversion/UnitConversion.d.ts.map +1 -0
- package/lib/esm/UnitConversion/UnitConversion.js +74 -0
- package/lib/esm/UnitConversion/UnitConversion.js.map +1 -0
- package/lib/esm/UnitConversion/UnitConverter.d.ts +40 -0
- package/lib/esm/UnitConversion/UnitConverter.d.ts.map +1 -0
- package/lib/esm/UnitConversion/UnitConverter.js +113 -0
- package/lib/esm/UnitConversion/UnitConverter.js.map +1 -0
- package/lib/esm/UnitConversion/UnitTree.d.ts +44 -0
- package/lib/esm/UnitConversion/UnitTree.d.ts.map +1 -0
- package/lib/esm/UnitConversion/UnitTree.js +165 -0
- package/lib/esm/UnitConversion/UnitTree.js.map +1 -0
- package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts +78 -0
- package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts.map +1 -0
- package/lib/esm/UnitProvider/SchemaUnitProvider.js +231 -0
- package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -0
- package/lib/esm/Validation/SchemaWalker.d.ts +24 -0
- package/lib/esm/Validation/SchemaWalker.d.ts.map +1 -0
- package/lib/esm/Validation/SchemaWalker.js +50 -0
- package/lib/esm/Validation/SchemaWalker.js.map +1 -0
- package/lib/esm/ecschema-metadata.d.ts +52 -0
- package/lib/esm/ecschema-metadata.d.ts.map +1 -0
- package/lib/esm/ecschema-metadata.js +55 -0
- package/lib/esm/ecschema-metadata.js.map +1 -0
- package/lib/esm/utils/SchemaGraph.d.ts +44 -0
- package/lib/esm/utils/SchemaGraph.d.ts.map +1 -0
- package/lib/esm/utils/SchemaGraph.js +111 -0
- package/lib/esm/utils/SchemaGraph.js.map +1 -0
- package/package.json +9 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ECName.js","sourceRoot":"","sources":["../../src/ECName.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9D,MAAM,gBAAgB,GAAG,8BAA8B,CAAC;AACxD,MAAM,mBAAmB,GAAG,wBAAwB,CAAC;AACrD,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;AAErD,SAAS,OAAO,CAAC,SAAiB;IAChC,MAAM,CAAC,CAAC,KAAK,SAAS,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,SAAS,IAAI,GAAG,IAAI,SAAS,IAAI,GAAG,CAAC;AAC9C,CAAC;AAED,SAAS,4BAA4B,CAAC,CAAS;IAC7C,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;IACvB,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GA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CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,IAAI,gBAAgB;YAClB,sBAAsB,CAAC,CAAC,CAAC,CAAC;QAE5B,KAAK,IAAI,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7D,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YACtB,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC;gBACrC,sBAAsB,CAAC,CAAC,CAAC,CAAC;;gBAE1B,MAAM,IAAI,IAAI,CAAC;QACnB,CAAC;QAED,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,gGAAgG;IACzF,MAAM;QACX,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAChH,CAAC;CACF","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 { assert } from \"@itwin/core-bentley\";\r\nimport { ECObjectsError, ECObjectsStatus } from \"./Exception\";\r\n\r\nconst validECNameRegex = /^([a-zA-Z_]+[a-zA-Z0-9_]*)$/i;\r\nconst ecNameReplacerRegex = /__x([0-9a-fA-F]{4})__/g;\r\nconst leadingDigits = [\"0000\", \"000\", \"00\", \"0\", \"\"];\r\n\r\nfunction isDigit(character: string): boolean {\r\n assert(1 === character.length);\r\n return character >= \"0\" && character <= \"9\";\r\n}\r\n\r\nfunction isValidAlphaNumericCharacter(c: string): boolean {\r\n assert(1 === c.length);\r\n return (((c >= \"0\" && c <= \"9\") || (c >= \"A\" && c <= \"Z\") || (c >= \"a\" && c <= \"z\") || c === \"_\"));\r\n}\r\n\r\n/** The name of an item in a [[Schema]], encoded to meet restrictions on the characters usable in such names.\r\n * An ECName meets the following criteria:\r\n * - Contains at least one character.\r\n * - Does not begin with a digit.\r\n * - Consists entirely of characters in the ASCII ranges A-Z, a-z, and 0-9; and the underscore (\"_\") character.\r\n *\r\n * All characters not meeting the above criteria are encoded as \"__x####__\" where \"####\" is the UTF-16 character code.\r\n * Such names are often automatically generated from the item's display label, which is unrestricted in the characters it may contain.\r\n * @public\r\n */\r\nexport class ECName {\r\n private _name: string;\r\n\r\n /** Construct a new ECName from a valid EC name.\r\n * throws ECObjectsError if `name` does not meet the criteria for a valid EC name.\r\n */\r\n constructor(name: string) {\r\n if (!ECName.validate(name))\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECName);\r\n\r\n this._name = name;\r\n }\r\n\r\n /** Returns true if a string meets the criteria of a valid EC name. */\r\n public static validate(name: string): boolean {\r\n return validECNameRegex.test(name);\r\n }\r\n\r\n /** The underlying name as a string. */\r\n public get name(): string {\r\n return this._name;\r\n }\r\n\r\n /** Create an ECName from an arbitrary string, encoding any special characters as \"__x####__\" where \"####\" is the UTF-16 character code.\r\n * @throws ECObjectsError if `input` is an empty string.\r\n */\r\n public static encode(input: string): ECName {\r\n if (0 === input.length)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECName);\r\n\r\n if (ECName.validate(input)) {\r\n // It's already a valid EC name.\r\n return new ECName(input);\r\n }\r\n\r\n let output = \"\";\r\n\r\n function appendEncodedCharacter(index: number): void {\r\n const hex = input.charCodeAt(index).toString(16).toUpperCase();\r\n assert(hex.length > 0 && hex.length < 5);\r\n output += `__x${leadingDigits[hex.length]}${hex}__`;\r\n }\r\n\r\n // First character cannot be a digit.\r\n const firstCharIsDigit = isDigit(input[0]);\r\n if (firstCharIsDigit)\r\n appendEncodedCharacter(0);\r\n\r\n for (let i = firstCharIsDigit ? 1 : 0; i < input.length; i++) {\r\n const char = input[i];\r\n if (!isValidAlphaNumericCharacter(char))\r\n appendEncodedCharacter(i);\r\n else\r\n output += char;\r\n }\r\n\r\n return new ECName(output);\r\n }\r\n\r\n /** Decode this ECName, replacing encoded special characters with the characters they encode. */\r\n public decode(): string {\r\n return this.name.replace(ecNameReplacerRegex, (_match, hex) => String.fromCharCode(Number.parseInt(hex, 16)));\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Metadata
|
|
3
|
+
*/
|
|
4
|
+
export { PropertyType } from "./PropertyTypes";
|
|
5
|
+
/** @beta */
|
|
6
|
+
export declare enum ECClassModifier {
|
|
7
|
+
None = 0,
|
|
8
|
+
Abstract = 1,
|
|
9
|
+
Sealed = 2
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* An enumeration that has all the schema item type names as values
|
|
13
|
+
* @beta */
|
|
14
|
+
export declare enum SchemaItemType {
|
|
15
|
+
EntityClass = "EntityClass",
|
|
16
|
+
Mixin = "Mixin",
|
|
17
|
+
StructClass = "StructClass",
|
|
18
|
+
CustomAttributeClass = "CustomAttributeClass",
|
|
19
|
+
RelationshipClass = "RelationshipClass",
|
|
20
|
+
Enumeration = "Enumeration",
|
|
21
|
+
KindOfQuantity = "KindOfQuantity",
|
|
22
|
+
PropertyCategory = "PropertyCategory",
|
|
23
|
+
Unit = "Unit",
|
|
24
|
+
InvertedUnit = "InvertedUnit",
|
|
25
|
+
Constant = "Constant",
|
|
26
|
+
Phenomenon = "Phenomenon",
|
|
27
|
+
UnitSystem = "UnitSystem",
|
|
28
|
+
Format = "Format"
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Primitive data types for ECProperties.
|
|
32
|
+
* @beta
|
|
33
|
+
*/
|
|
34
|
+
export declare enum PrimitiveType {
|
|
35
|
+
Uninitialized = 0,
|
|
36
|
+
Binary = 257,
|
|
37
|
+
Boolean = 513,
|
|
38
|
+
DateTime = 769,
|
|
39
|
+
Double = 1025,
|
|
40
|
+
Integer = 1281,
|
|
41
|
+
Long = 1537,
|
|
42
|
+
Point2d = 1793,
|
|
43
|
+
Point3d = 2049,
|
|
44
|
+
String = 2305,
|
|
45
|
+
IGeometry = 2561
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Defines the valid CustomAttribute container types.
|
|
49
|
+
* @beta
|
|
50
|
+
*/
|
|
51
|
+
export declare enum CustomAttributeContainerType {
|
|
52
|
+
Schema = 1,
|
|
53
|
+
EntityClass = 2,
|
|
54
|
+
CustomAttributeClass = 4,
|
|
55
|
+
StructClass = 8,
|
|
56
|
+
RelationshipClass = 16,
|
|
57
|
+
AnyClass = 30,
|
|
58
|
+
PrimitiveProperty = 32,
|
|
59
|
+
StructProperty = 64,
|
|
60
|
+
PrimitiveArrayProperty = 128,
|
|
61
|
+
StructArrayProperty = 256,
|
|
62
|
+
NavigationProperty = 512,
|
|
63
|
+
AnyProperty = 992,
|
|
64
|
+
SourceRelationshipConstraint = 1024,
|
|
65
|
+
TargetRelationshipConstraint = 2048,
|
|
66
|
+
AnyRelationshipConstraint = 3072,
|
|
67
|
+
Any = 4095
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Defines what sort of match should be used when locating a schema.
|
|
71
|
+
* @beta
|
|
72
|
+
*/
|
|
73
|
+
export declare enum SchemaMatchType {
|
|
74
|
+
Identical = 0,
|
|
75
|
+
Exact = 1,
|
|
76
|
+
LatestWriteCompatible = 2,
|
|
77
|
+
Latest = 3,
|
|
78
|
+
LatestReadCompatible = 4
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Identifer for an ECRelationshipConstraint. Used to determine the side of the relationship the constraint is representing.
|
|
82
|
+
* @beta
|
|
83
|
+
*/
|
|
84
|
+
export declare enum RelationshipEnd {
|
|
85
|
+
Source = 0,
|
|
86
|
+
Target = 1
|
|
87
|
+
}
|
|
88
|
+
/** @beta */
|
|
89
|
+
export declare enum StrengthType {
|
|
90
|
+
Referencing = 0,
|
|
91
|
+
Holding = 1,
|
|
92
|
+
Embedding = 2
|
|
93
|
+
}
|
|
94
|
+
/** @beta */
|
|
95
|
+
export declare enum StrengthDirection {
|
|
96
|
+
Forward = 1,
|
|
97
|
+
Backward = 2
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Parses the provided string into an ECClassModifier if the string is a valid modifier.
|
|
101
|
+
* @param modifier The modifier string to parse.
|
|
102
|
+
* @beta
|
|
103
|
+
*/
|
|
104
|
+
export declare function parseClassModifier(modifier: string): ECClassModifier | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* @return A string representing the provided ECClassModifier. If the modifier is not valid, an empty string is returned.
|
|
107
|
+
* @beta
|
|
108
|
+
*/
|
|
109
|
+
export declare function classModifierToString(modifier: ECClassModifier): string;
|
|
110
|
+
/**
|
|
111
|
+
* Tries to parse the given string as one of the 8 schema item types.
|
|
112
|
+
* @param type The schema item type string to parse.
|
|
113
|
+
* @returns A valid SchemaItemType if successfully parsed. Otherwise, undefined if the provided string is not a valid SchemaItemType.
|
|
114
|
+
* @beta
|
|
115
|
+
*/
|
|
116
|
+
export declare function parseSchemaItemType(type: string): SchemaItemType | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Converts a valid SchemaItemType to a display string.
|
|
119
|
+
* @param value The SchemaItemType to stringify.
|
|
120
|
+
* @return A string representing the provided SchemaItemType. If the type is not valid, an empty string is returned.
|
|
121
|
+
* @beta
|
|
122
|
+
* @deprecated in 4.6.0 SchemaItemType is a string enum so just use it directly
|
|
123
|
+
*/
|
|
124
|
+
export declare function schemaItemTypeToString(value: SchemaItemType): string;
|
|
125
|
+
/** @internal */
|
|
126
|
+
export declare function schemaItemTypeToXmlString(value: SchemaItemType): string;
|
|
127
|
+
/**
|
|
128
|
+
* Tries to parse the given string as one of the 10 primitive types.
|
|
129
|
+
* @param type The primitive type string to parse.
|
|
130
|
+
* @returns A valid PrimitiveType if successfully parsed, or undefined if the provided string is not a valid PrimitiveType.
|
|
131
|
+
* @beta
|
|
132
|
+
*/
|
|
133
|
+
export declare function parsePrimitiveType(type: string): PrimitiveType | undefined;
|
|
134
|
+
/** @beta */
|
|
135
|
+
export declare function primitiveTypeToString(type: PrimitiveType): string;
|
|
136
|
+
/**
|
|
137
|
+
* Parses the given string into the appropriate CustomAttributeContainerType if the string is valid.
|
|
138
|
+
* @param type The container type string to parse.
|
|
139
|
+
* @beta
|
|
140
|
+
*/
|
|
141
|
+
export declare function parseCustomAttributeContainerType(type: string): CustomAttributeContainerType | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* Creates a string representing a valid CustomAttributeContainerType.
|
|
144
|
+
* @param value The CustomAttributeContainerType to stringify.
|
|
145
|
+
* @return A string representing the provided CustomAttributeContainerType. If the type is not valid, an empty string is returned.
|
|
146
|
+
* @beta
|
|
147
|
+
*/
|
|
148
|
+
export declare function containerTypeToString(type: CustomAttributeContainerType): string;
|
|
149
|
+
/** @beta */
|
|
150
|
+
export declare function parseRelationshipEnd(end: string): RelationshipEnd | undefined;
|
|
151
|
+
/** @beta */
|
|
152
|
+
export declare function relationshipEndToString(end: RelationshipEnd): string;
|
|
153
|
+
/**
|
|
154
|
+
* Takes a string representing a StrengthType, will parse it and return the corresponding StrengthType.
|
|
155
|
+
* @throws ECObjectsStatus.InvalidStrength if the provided string that is not valid
|
|
156
|
+
* @param strength
|
|
157
|
+
* @beta
|
|
158
|
+
*/
|
|
159
|
+
export declare function parseStrength(strength: string): StrengthType | undefined;
|
|
160
|
+
/** @beta */
|
|
161
|
+
export declare function strengthToString(strength: StrengthType): string;
|
|
162
|
+
/** @beta */
|
|
163
|
+
export declare function parseStrengthDirection(direction: string): StrengthDirection | undefined;
|
|
164
|
+
/** @beta */
|
|
165
|
+
export declare function strengthDirectionToString(direction: StrengthDirection): string;
|
|
166
|
+
//# sourceMappingURL=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BAAgB,uBAAuB,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAMpE;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAOxE;AAED,YAAY;AACZ,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAO/D;AAED,YAAY;AACZ,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAMvF;AAED,YAAY;AACZ,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,iBAAiB,GAAG,MAAM,CAM9E"}
|
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
/** @packageDocumentation
|
|
6
|
+
* @module Metadata
|
|
7
|
+
*/
|
|
8
|
+
import { ECStringConstants } from "./Constants";
|
|
9
|
+
import { ECObjectsError, ECObjectsStatus } from "./Exception";
|
|
10
|
+
export { PropertyType } from "./PropertyTypes";
|
|
11
|
+
// NEEDSWORK: This shim is currently required to use async iterators. See https://github.com/Microsoft/TypeScript/issues/14151
|
|
12
|
+
if (!Symbol.asyncIterator) {
|
|
13
|
+
Symbol.asyncIterator = Symbol.for("Symbol.asyncIterator");
|
|
14
|
+
}
|
|
15
|
+
/** @beta */
|
|
16
|
+
export var ECClassModifier;
|
|
17
|
+
(function (ECClassModifier) {
|
|
18
|
+
ECClassModifier[ECClassModifier["None"] = 0] = "None";
|
|
19
|
+
ECClassModifier[ECClassModifier["Abstract"] = 1] = "Abstract";
|
|
20
|
+
ECClassModifier[ECClassModifier["Sealed"] = 2] = "Sealed";
|
|
21
|
+
})(ECClassModifier || (ECClassModifier = {}));
|
|
22
|
+
/**
|
|
23
|
+
* An enumeration that has all the schema item type names as values
|
|
24
|
+
* @beta */
|
|
25
|
+
export var SchemaItemType;
|
|
26
|
+
(function (SchemaItemType) {
|
|
27
|
+
SchemaItemType["EntityClass"] = "EntityClass";
|
|
28
|
+
SchemaItemType["Mixin"] = "Mixin";
|
|
29
|
+
SchemaItemType["StructClass"] = "StructClass";
|
|
30
|
+
SchemaItemType["CustomAttributeClass"] = "CustomAttributeClass";
|
|
31
|
+
SchemaItemType["RelationshipClass"] = "RelationshipClass";
|
|
32
|
+
SchemaItemType["Enumeration"] = "Enumeration";
|
|
33
|
+
SchemaItemType["KindOfQuantity"] = "KindOfQuantity";
|
|
34
|
+
SchemaItemType["PropertyCategory"] = "PropertyCategory";
|
|
35
|
+
SchemaItemType["Unit"] = "Unit";
|
|
36
|
+
SchemaItemType["InvertedUnit"] = "InvertedUnit";
|
|
37
|
+
SchemaItemType["Constant"] = "Constant";
|
|
38
|
+
SchemaItemType["Phenomenon"] = "Phenomenon";
|
|
39
|
+
SchemaItemType["UnitSystem"] = "UnitSystem";
|
|
40
|
+
SchemaItemType["Format"] = "Format";
|
|
41
|
+
})(SchemaItemType || (SchemaItemType = {}));
|
|
42
|
+
/**
|
|
43
|
+
* Primitive data types for ECProperties.
|
|
44
|
+
* @beta
|
|
45
|
+
*/
|
|
46
|
+
export var PrimitiveType;
|
|
47
|
+
(function (PrimitiveType) {
|
|
48
|
+
PrimitiveType[PrimitiveType["Uninitialized"] = 0] = "Uninitialized";
|
|
49
|
+
PrimitiveType[PrimitiveType["Binary"] = 257] = "Binary";
|
|
50
|
+
PrimitiveType[PrimitiveType["Boolean"] = 513] = "Boolean";
|
|
51
|
+
PrimitiveType[PrimitiveType["DateTime"] = 769] = "DateTime";
|
|
52
|
+
PrimitiveType[PrimitiveType["Double"] = 1025] = "Double";
|
|
53
|
+
PrimitiveType[PrimitiveType["Integer"] = 1281] = "Integer";
|
|
54
|
+
PrimitiveType[PrimitiveType["Long"] = 1537] = "Long";
|
|
55
|
+
PrimitiveType[PrimitiveType["Point2d"] = 1793] = "Point2d";
|
|
56
|
+
PrimitiveType[PrimitiveType["Point3d"] = 2049] = "Point3d";
|
|
57
|
+
PrimitiveType[PrimitiveType["String"] = 2305] = "String";
|
|
58
|
+
PrimitiveType[PrimitiveType["IGeometry"] = 2561] = "IGeometry";
|
|
59
|
+
})(PrimitiveType || (PrimitiveType = {}));
|
|
60
|
+
/**
|
|
61
|
+
* Defines the valid CustomAttribute container types.
|
|
62
|
+
* @beta
|
|
63
|
+
*/
|
|
64
|
+
export var CustomAttributeContainerType;
|
|
65
|
+
(function (CustomAttributeContainerType) {
|
|
66
|
+
CustomAttributeContainerType[CustomAttributeContainerType["Schema"] = 1] = "Schema";
|
|
67
|
+
CustomAttributeContainerType[CustomAttributeContainerType["EntityClass"] = 2] = "EntityClass";
|
|
68
|
+
CustomAttributeContainerType[CustomAttributeContainerType["CustomAttributeClass"] = 4] = "CustomAttributeClass";
|
|
69
|
+
CustomAttributeContainerType[CustomAttributeContainerType["StructClass"] = 8] = "StructClass";
|
|
70
|
+
CustomAttributeContainerType[CustomAttributeContainerType["RelationshipClass"] = 16] = "RelationshipClass";
|
|
71
|
+
CustomAttributeContainerType[CustomAttributeContainerType["AnyClass"] = 30] = "AnyClass";
|
|
72
|
+
CustomAttributeContainerType[CustomAttributeContainerType["PrimitiveProperty"] = 32] = "PrimitiveProperty";
|
|
73
|
+
CustomAttributeContainerType[CustomAttributeContainerType["StructProperty"] = 64] = "StructProperty";
|
|
74
|
+
CustomAttributeContainerType[CustomAttributeContainerType["PrimitiveArrayProperty"] = 128] = "PrimitiveArrayProperty";
|
|
75
|
+
CustomAttributeContainerType[CustomAttributeContainerType["StructArrayProperty"] = 256] = "StructArrayProperty";
|
|
76
|
+
CustomAttributeContainerType[CustomAttributeContainerType["NavigationProperty"] = 512] = "NavigationProperty";
|
|
77
|
+
CustomAttributeContainerType[CustomAttributeContainerType["AnyProperty"] = 992] = "AnyProperty";
|
|
78
|
+
CustomAttributeContainerType[CustomAttributeContainerType["SourceRelationshipConstraint"] = 1024] = "SourceRelationshipConstraint";
|
|
79
|
+
CustomAttributeContainerType[CustomAttributeContainerType["TargetRelationshipConstraint"] = 2048] = "TargetRelationshipConstraint";
|
|
80
|
+
CustomAttributeContainerType[CustomAttributeContainerType["AnyRelationshipConstraint"] = 3072] = "AnyRelationshipConstraint";
|
|
81
|
+
CustomAttributeContainerType[CustomAttributeContainerType["Any"] = 4095] = "Any";
|
|
82
|
+
})(CustomAttributeContainerType || (CustomAttributeContainerType = {}));
|
|
83
|
+
/**
|
|
84
|
+
* Defines what sort of match should be used when locating a schema.
|
|
85
|
+
* @beta
|
|
86
|
+
*/
|
|
87
|
+
export var SchemaMatchType;
|
|
88
|
+
(function (SchemaMatchType) {
|
|
89
|
+
// Find exact VersionRead, VersionWrite, VersionMinor match as well as Data
|
|
90
|
+
SchemaMatchType[SchemaMatchType["Identical"] = 0] = "Identical";
|
|
91
|
+
// Find exact VersionRead, VersionWrite, VersionMinor match.
|
|
92
|
+
SchemaMatchType[SchemaMatchType["Exact"] = 1] = "Exact";
|
|
93
|
+
// Find latest version with matching VersionRead and VersionWrite
|
|
94
|
+
SchemaMatchType[SchemaMatchType["LatestWriteCompatible"] = 2] = "LatestWriteCompatible";
|
|
95
|
+
// Find latest version.
|
|
96
|
+
SchemaMatchType[SchemaMatchType["Latest"] = 3] = "Latest";
|
|
97
|
+
// Find latest version with matching VersionRead
|
|
98
|
+
SchemaMatchType[SchemaMatchType["LatestReadCompatible"] = 4] = "LatestReadCompatible";
|
|
99
|
+
})(SchemaMatchType || (SchemaMatchType = {}));
|
|
100
|
+
/**
|
|
101
|
+
* Identifer for an ECRelationshipConstraint. Used to determine the side of the relationship the constraint is representing.
|
|
102
|
+
* @beta
|
|
103
|
+
*/
|
|
104
|
+
export var RelationshipEnd;
|
|
105
|
+
(function (RelationshipEnd) {
|
|
106
|
+
RelationshipEnd[RelationshipEnd["Source"] = 0] = "Source";
|
|
107
|
+
RelationshipEnd[RelationshipEnd["Target"] = 1] = "Target";
|
|
108
|
+
})(RelationshipEnd || (RelationshipEnd = {}));
|
|
109
|
+
/** @beta */
|
|
110
|
+
export var StrengthType;
|
|
111
|
+
(function (StrengthType) {
|
|
112
|
+
StrengthType[StrengthType["Referencing"] = 0] = "Referencing";
|
|
113
|
+
StrengthType[StrengthType["Holding"] = 1] = "Holding";
|
|
114
|
+
StrengthType[StrengthType["Embedding"] = 2] = "Embedding";
|
|
115
|
+
})(StrengthType || (StrengthType = {}));
|
|
116
|
+
/** @beta */
|
|
117
|
+
export var StrengthDirection;
|
|
118
|
+
(function (StrengthDirection) {
|
|
119
|
+
StrengthDirection[StrengthDirection["Forward"] = 1] = "Forward";
|
|
120
|
+
StrengthDirection[StrengthDirection["Backward"] = 2] = "Backward";
|
|
121
|
+
})(StrengthDirection || (StrengthDirection = {}));
|
|
122
|
+
// Helper methods for going to/from string for the above Enumerations.
|
|
123
|
+
/**
|
|
124
|
+
* Parses the provided string into an ECClassModifier if the string is a valid modifier.
|
|
125
|
+
* @param modifier The modifier string to parse.
|
|
126
|
+
* @beta
|
|
127
|
+
*/
|
|
128
|
+
export function parseClassModifier(modifier) {
|
|
129
|
+
const lowerModifier = modifier.toLowerCase();
|
|
130
|
+
switch (lowerModifier) {
|
|
131
|
+
case "abstract": return ECClassModifier.Abstract;
|
|
132
|
+
case "none": return ECClassModifier.None;
|
|
133
|
+
case "sealed": return ECClassModifier.Sealed;
|
|
134
|
+
}
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* @return A string representing the provided ECClassModifier. If the modifier is not valid, an empty string is returned.
|
|
139
|
+
* @beta
|
|
140
|
+
*/
|
|
141
|
+
export function classModifierToString(modifier) {
|
|
142
|
+
switch (modifier) {
|
|
143
|
+
case ECClassModifier.Abstract: return "Abstract";
|
|
144
|
+
case ECClassModifier.None: return "None";
|
|
145
|
+
case ECClassModifier.Sealed: return "Sealed";
|
|
146
|
+
default: throw new ECObjectsError(ECObjectsStatus.InvalidModifier, "An invalid ECClassModifier has been provided.");
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Tries to parse the given string as one of the 8 schema item types.
|
|
151
|
+
* @param type The schema item type string to parse.
|
|
152
|
+
* @returns A valid SchemaItemType if successfully parsed. Otherwise, undefined if the provided string is not a valid SchemaItemType.
|
|
153
|
+
* @beta
|
|
154
|
+
*/
|
|
155
|
+
export function parseSchemaItemType(type) {
|
|
156
|
+
switch (type.toLowerCase()) {
|
|
157
|
+
case "entityclass": return SchemaItemType.EntityClass;
|
|
158
|
+
case "mixin": return SchemaItemType.Mixin;
|
|
159
|
+
case "structclass": return SchemaItemType.StructClass;
|
|
160
|
+
case "customattributeclass": return SchemaItemType.CustomAttributeClass;
|
|
161
|
+
case "relationshipclass": return SchemaItemType.RelationshipClass;
|
|
162
|
+
case "enumeration": return SchemaItemType.Enumeration;
|
|
163
|
+
case "kindofquantity": return SchemaItemType.KindOfQuantity;
|
|
164
|
+
case "propertycategory": return SchemaItemType.PropertyCategory;
|
|
165
|
+
case "unit": return SchemaItemType.Unit;
|
|
166
|
+
case "invertedunit": return SchemaItemType.InvertedUnit;
|
|
167
|
+
case "constant": return SchemaItemType.Constant;
|
|
168
|
+
case "phenomenon": return SchemaItemType.Phenomenon;
|
|
169
|
+
case "unitsystem": return SchemaItemType.UnitSystem;
|
|
170
|
+
case "format": return SchemaItemType.Format;
|
|
171
|
+
}
|
|
172
|
+
return undefined;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Converts a valid SchemaItemType to a display string.
|
|
176
|
+
* @param value The SchemaItemType to stringify.
|
|
177
|
+
* @return A string representing the provided SchemaItemType. If the type is not valid, an empty string is returned.
|
|
178
|
+
* @beta
|
|
179
|
+
* @deprecated in 4.6.0 SchemaItemType is a string enum so just use it directly
|
|
180
|
+
*/
|
|
181
|
+
export function schemaItemTypeToString(value) {
|
|
182
|
+
return value; // TODO: Remove
|
|
183
|
+
}
|
|
184
|
+
/** @internal */
|
|
185
|
+
export function schemaItemTypeToXmlString(value) {
|
|
186
|
+
switch (value) {
|
|
187
|
+
case SchemaItemType.EntityClass: return "ECEntityClass";
|
|
188
|
+
case SchemaItemType.Mixin: return "ECEntityClass";
|
|
189
|
+
case SchemaItemType.StructClass: return "ECStructClass";
|
|
190
|
+
case SchemaItemType.CustomAttributeClass: return "ECCustomAttributeClass";
|
|
191
|
+
case SchemaItemType.RelationshipClass: return "ECRelationshipClass";
|
|
192
|
+
case SchemaItemType.Enumeration: return "ECEnumeration";
|
|
193
|
+
case SchemaItemType.KindOfQuantity: return "KindOfQuantity";
|
|
194
|
+
case SchemaItemType.PropertyCategory: return "PropertyCategory";
|
|
195
|
+
case SchemaItemType.Unit: return "Unit";
|
|
196
|
+
case SchemaItemType.InvertedUnit: return "InvertedUnit";
|
|
197
|
+
case SchemaItemType.Constant: return "Constant";
|
|
198
|
+
case SchemaItemType.Phenomenon: return "Phenomenon";
|
|
199
|
+
case SchemaItemType.UnitSystem: return "UnitSystem";
|
|
200
|
+
case SchemaItemType.Format: return "Format";
|
|
201
|
+
default: throw new ECObjectsError(ECObjectsStatus.InvalidSchemaItemType, "An invalid SchemaItemType has been provided.");
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Tries to parse the given string as one of the 10 primitive types.
|
|
206
|
+
* @param type The primitive type string to parse.
|
|
207
|
+
* @returns A valid PrimitiveType if successfully parsed, or undefined if the provided string is not a valid PrimitiveType.
|
|
208
|
+
* @beta
|
|
209
|
+
*/
|
|
210
|
+
export function parsePrimitiveType(type) {
|
|
211
|
+
switch (type.toLowerCase()) {
|
|
212
|
+
case "binary": return PrimitiveType.Binary;
|
|
213
|
+
case "boolean":
|
|
214
|
+
case "bool": return PrimitiveType.Boolean;
|
|
215
|
+
case "datetime": return PrimitiveType.DateTime;
|
|
216
|
+
case "double": return PrimitiveType.Double;
|
|
217
|
+
case "int": return PrimitiveType.Integer;
|
|
218
|
+
case "long": return PrimitiveType.Long;
|
|
219
|
+
case "point2d": return PrimitiveType.Point2d;
|
|
220
|
+
case "point3d": return PrimitiveType.Point3d;
|
|
221
|
+
case "string": return PrimitiveType.String;
|
|
222
|
+
case "bentley.geometry.common.igeometry": return PrimitiveType.IGeometry;
|
|
223
|
+
}
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
/** @beta */
|
|
227
|
+
export function primitiveTypeToString(type) {
|
|
228
|
+
switch (type) {
|
|
229
|
+
case PrimitiveType.Binary: return "binary";
|
|
230
|
+
case PrimitiveType.Boolean: return "boolean";
|
|
231
|
+
case PrimitiveType.DateTime: return "dateTime";
|
|
232
|
+
case PrimitiveType.Double: return "double";
|
|
233
|
+
case PrimitiveType.Integer: return "int";
|
|
234
|
+
case PrimitiveType.IGeometry: return "Bentley.Geometry.Common.IGeometry";
|
|
235
|
+
case PrimitiveType.Long: return "long";
|
|
236
|
+
case PrimitiveType.Point2d: return "point2d";
|
|
237
|
+
case PrimitiveType.Point3d: return "point3d";
|
|
238
|
+
case PrimitiveType.String: return "string";
|
|
239
|
+
default: throw new ECObjectsError(ECObjectsStatus.InvalidPrimitiveType, "An invalid PrimitiveType has been provided.");
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Parses the given string into the appropriate CustomAttributeContainerType if the string is valid.
|
|
244
|
+
* @param type The container type string to parse.
|
|
245
|
+
* @beta
|
|
246
|
+
*/
|
|
247
|
+
export function parseCustomAttributeContainerType(type) {
|
|
248
|
+
const typeTokens = type.split(/[|,;]+/);
|
|
249
|
+
let containerType = 0;
|
|
250
|
+
typeTokens.forEach((typeToken) => {
|
|
251
|
+
typeToken = typeToken.trim();
|
|
252
|
+
if (typeToken.length === 0)
|
|
253
|
+
return;
|
|
254
|
+
typeToken = typeToken.toLowerCase();
|
|
255
|
+
switch (typeToken) {
|
|
256
|
+
case "schema":
|
|
257
|
+
containerType = containerType | CustomAttributeContainerType.Schema;
|
|
258
|
+
break;
|
|
259
|
+
case "entityclass":
|
|
260
|
+
containerType = containerType | CustomAttributeContainerType.EntityClass;
|
|
261
|
+
break;
|
|
262
|
+
case "customattributeclass":
|
|
263
|
+
containerType = containerType | CustomAttributeContainerType.CustomAttributeClass;
|
|
264
|
+
break;
|
|
265
|
+
case "structclass":
|
|
266
|
+
containerType = containerType | CustomAttributeContainerType.StructClass;
|
|
267
|
+
break;
|
|
268
|
+
case "relationshipclass":
|
|
269
|
+
containerType = containerType | CustomAttributeContainerType.RelationshipClass;
|
|
270
|
+
break;
|
|
271
|
+
case "anyclass":
|
|
272
|
+
containerType = containerType | CustomAttributeContainerType.AnyClass;
|
|
273
|
+
break;
|
|
274
|
+
case "primitiveproperty":
|
|
275
|
+
containerType = containerType | CustomAttributeContainerType.PrimitiveProperty;
|
|
276
|
+
break;
|
|
277
|
+
case "structproperty":
|
|
278
|
+
containerType = containerType | CustomAttributeContainerType.StructProperty;
|
|
279
|
+
break;
|
|
280
|
+
case "arrayproperty":
|
|
281
|
+
containerType = containerType | CustomAttributeContainerType.PrimitiveArrayProperty;
|
|
282
|
+
break;
|
|
283
|
+
case "structarrayproperty":
|
|
284
|
+
containerType = containerType | CustomAttributeContainerType.StructArrayProperty;
|
|
285
|
+
break;
|
|
286
|
+
case "navigationproperty":
|
|
287
|
+
containerType = containerType | CustomAttributeContainerType.NavigationProperty;
|
|
288
|
+
break;
|
|
289
|
+
case "anyproperty":
|
|
290
|
+
containerType = containerType | CustomAttributeContainerType.AnyProperty;
|
|
291
|
+
break;
|
|
292
|
+
case "sourcerelationshipconstraint":
|
|
293
|
+
containerType = containerType | CustomAttributeContainerType.SourceRelationshipConstraint;
|
|
294
|
+
break;
|
|
295
|
+
case "targetrelationshipconstraint":
|
|
296
|
+
containerType = containerType | CustomAttributeContainerType.TargetRelationshipConstraint;
|
|
297
|
+
break;
|
|
298
|
+
case "anyrelationshipconstraint":
|
|
299
|
+
containerType = containerType | CustomAttributeContainerType.AnyRelationshipConstraint;
|
|
300
|
+
break;
|
|
301
|
+
case "any":
|
|
302
|
+
containerType = containerType | CustomAttributeContainerType.Any;
|
|
303
|
+
break;
|
|
304
|
+
default:
|
|
305
|
+
throw new ECObjectsError(ECObjectsStatus.InvalidContainerType, `${typeToken} is not a valid CustomAttributeContainerType value.`);
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
return containerType;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Creates a string representing a valid CustomAttributeContainerType.
|
|
312
|
+
* @param value The CustomAttributeContainerType to stringify.
|
|
313
|
+
* @return A string representing the provided CustomAttributeContainerType. If the type is not valid, an empty string is returned.
|
|
314
|
+
* @beta
|
|
315
|
+
*/
|
|
316
|
+
export function containerTypeToString(type) {
|
|
317
|
+
const testContainerTypeValue = (compareType, otherType) => {
|
|
318
|
+
return (compareType === (compareType & otherType));
|
|
319
|
+
};
|
|
320
|
+
if (testContainerTypeValue(CustomAttributeContainerType.Any, type))
|
|
321
|
+
return ECStringConstants.CONTAINERTYPE_ANY;
|
|
322
|
+
let containerType = "";
|
|
323
|
+
const setOrAppend = (val) => {
|
|
324
|
+
if (containerType.length === 0)
|
|
325
|
+
containerType = val;
|
|
326
|
+
else
|
|
327
|
+
containerType = `${containerType}, ${val}`;
|
|
328
|
+
};
|
|
329
|
+
if (testContainerTypeValue(CustomAttributeContainerType.Schema, type))
|
|
330
|
+
setOrAppend("Schema");
|
|
331
|
+
if (testContainerTypeValue(CustomAttributeContainerType.AnyClass, type))
|
|
332
|
+
setOrAppend("AnyClass");
|
|
333
|
+
else {
|
|
334
|
+
if (testContainerTypeValue(CustomAttributeContainerType.EntityClass, type))
|
|
335
|
+
setOrAppend(ECStringConstants.CONTAINERTYPE_ENTITYCLASS);
|
|
336
|
+
if (testContainerTypeValue(CustomAttributeContainerType.CustomAttributeClass, type))
|
|
337
|
+
setOrAppend(ECStringConstants.CONTAINERTYPE_CUSTOMATTRIBUTECLASS);
|
|
338
|
+
if (testContainerTypeValue(CustomAttributeContainerType.StructClass, type))
|
|
339
|
+
setOrAppend(ECStringConstants.CONTAINERTYPE_STRUCTCLASS);
|
|
340
|
+
if (testContainerTypeValue(CustomAttributeContainerType.RelationshipClass, type))
|
|
341
|
+
setOrAppend(ECStringConstants.CONTAINERTYPE_RELATIONSHIPCLASS);
|
|
342
|
+
}
|
|
343
|
+
if (testContainerTypeValue(CustomAttributeContainerType.AnyProperty, type))
|
|
344
|
+
setOrAppend(ECStringConstants.CONTAINERTYPE_ANYPROPERTY);
|
|
345
|
+
else {
|
|
346
|
+
if (testContainerTypeValue(CustomAttributeContainerType.PrimitiveProperty, type))
|
|
347
|
+
setOrAppend(ECStringConstants.CONTAINERTYPE_PRIMITIVEPROPERTY);
|
|
348
|
+
if (testContainerTypeValue(CustomAttributeContainerType.StructProperty, type))
|
|
349
|
+
setOrAppend(ECStringConstants.CONTAINERTYPE_STRUCTPROPERTY);
|
|
350
|
+
if (testContainerTypeValue(CustomAttributeContainerType.PrimitiveArrayProperty, type))
|
|
351
|
+
setOrAppend(ECStringConstants.CONTAINERTYPE_PRIMITIVEARRAYPROPERTY);
|
|
352
|
+
if (testContainerTypeValue(CustomAttributeContainerType.StructArrayProperty, type))
|
|
353
|
+
setOrAppend(ECStringConstants.CONTAINERTYPE_STRUCTARRAYPROPERTY);
|
|
354
|
+
if (testContainerTypeValue(CustomAttributeContainerType.NavigationProperty, type))
|
|
355
|
+
setOrAppend(ECStringConstants.CONTAINERTYPE_NAVIGATIONPROPERTY);
|
|
356
|
+
}
|
|
357
|
+
if (testContainerTypeValue(CustomAttributeContainerType.AnyRelationshipConstraint, type))
|
|
358
|
+
setOrAppend(ECStringConstants.CONTAINERTYPE_ANYRELATIONSHIPCONSTRAINT);
|
|
359
|
+
else {
|
|
360
|
+
if (testContainerTypeValue(CustomAttributeContainerType.SourceRelationshipConstraint, type))
|
|
361
|
+
setOrAppend(ECStringConstants.CONTAINERTYPE_SOURCERELATIONSHIPCONSTRAINT);
|
|
362
|
+
if (testContainerTypeValue(CustomAttributeContainerType.TargetRelationshipConstraint, type))
|
|
363
|
+
setOrAppend(ECStringConstants.CONTAINERTYPE_TARGETRELATIONSHIPCONSTRAINT);
|
|
364
|
+
}
|
|
365
|
+
return containerType;
|
|
366
|
+
}
|
|
367
|
+
/** @beta */
|
|
368
|
+
export function parseRelationshipEnd(end) {
|
|
369
|
+
switch (end.toLowerCase()) {
|
|
370
|
+
case "source": return RelationshipEnd.Source;
|
|
371
|
+
case "target": return RelationshipEnd.Target;
|
|
372
|
+
}
|
|
373
|
+
return undefined;
|
|
374
|
+
}
|
|
375
|
+
/** @beta */
|
|
376
|
+
export function relationshipEndToString(end) {
|
|
377
|
+
switch (end) {
|
|
378
|
+
case RelationshipEnd.Source: return ECStringConstants.RELATIONSHIP_END_SOURCE;
|
|
379
|
+
case RelationshipEnd.Target: return ECStringConstants.RELATIONSHIP_END_TARGET;
|
|
380
|
+
default: throw new ECObjectsError(ECObjectsStatus.InvalidRelationshipEnd, `An invalid RelationshipEnd has been provided.`);
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Takes a string representing a StrengthType, will parse it and return the corresponding StrengthType.
|
|
385
|
+
* @throws ECObjectsStatus.InvalidStrength if the provided string that is not valid
|
|
386
|
+
* @param strength
|
|
387
|
+
* @beta
|
|
388
|
+
*/
|
|
389
|
+
export function parseStrength(strength) {
|
|
390
|
+
switch (strength.toLowerCase()) {
|
|
391
|
+
case "referencing": return StrengthType.Referencing;
|
|
392
|
+
case "holding": return StrengthType.Holding;
|
|
393
|
+
case "embedding": return StrengthType.Embedding;
|
|
394
|
+
}
|
|
395
|
+
return undefined;
|
|
396
|
+
}
|
|
397
|
+
/** @beta */
|
|
398
|
+
export function strengthToString(strength) {
|
|
399
|
+
switch (strength) {
|
|
400
|
+
case StrengthType.Embedding: return "Embedding";
|
|
401
|
+
case StrengthType.Holding: return "Holding";
|
|
402
|
+
case StrengthType.Referencing: return "Referencing";
|
|
403
|
+
default: throw new ECObjectsError(ECObjectsStatus.InvalidStrength, `An invalid Strength has been provided.`);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
/** @beta */
|
|
407
|
+
export function parseStrengthDirection(direction) {
|
|
408
|
+
switch (direction.toLowerCase()) {
|
|
409
|
+
case "forward": return StrengthDirection.Forward;
|
|
410
|
+
case "backward": return StrengthDirection.Backward;
|
|
411
|
+
}
|
|
412
|
+
return undefined;
|
|
413
|
+
}
|
|
414
|
+
/** @beta */
|
|
415
|
+
export function strengthDirectionToString(direction) {
|
|
416
|
+
switch (direction) {
|
|
417
|
+
case StrengthDirection.Forward: return "Forward";
|
|
418
|
+
case StrengthDirection.Backward: return "Backward";
|
|
419
|
+
default: throw new ECObjectsError(ECObjectsStatus.InvalidStrengthDirection, `An invalid StrengthDirection has been provided.`);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
//# sourceMappingURL=ECObjects.js.map
|