@itwin/ecschema-metadata 5.1.0-dev.9 → 5.2.0-dev.2
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 +74 -1
- package/lib/cjs/Context.d.ts +1 -1
- package/lib/cjs/Context.js +1 -1
- package/lib/cjs/Context.js.map +1 -1
- package/lib/cjs/Deserialization/Helper.d.ts +30 -11
- package/lib/cjs/Deserialization/Helper.d.ts.map +1 -1
- package/lib/cjs/Deserialization/Helper.js +124 -96
- package/lib/cjs/Deserialization/Helper.js.map +1 -1
- package/lib/cjs/Deserialization/SchemaGraphUtil.d.ts +12 -3
- package/lib/cjs/Deserialization/SchemaGraphUtil.d.ts.map +1 -1
- package/lib/cjs/Deserialization/SchemaGraphUtil.js +36 -23
- package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
- package/lib/cjs/Deserialization/XmlParser.d.ts.map +1 -1
- package/lib/cjs/Deserialization/XmlParser.js +14 -5
- package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.js +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/cjs/ECName.js +1 -1
- package/lib/cjs/ECName.js.map +1 -1
- package/lib/cjs/ECObjects.d.ts +1 -1
- package/lib/cjs/ECObjects.js +2 -2
- package/lib/cjs/ECObjects.js.map +1 -1
- package/lib/cjs/IncrementalLoading/ClassParsers.d.ts +60 -0
- package/lib/cjs/IncrementalLoading/ClassParsers.d.ts.map +1 -0
- package/lib/cjs/IncrementalLoading/ClassParsers.js +111 -0
- package/lib/cjs/IncrementalLoading/ClassParsers.js.map +1 -0
- package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.d.ts +211 -0
- package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.d.ts.map +1 -0
- package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js +387 -0
- package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -0
- package/lib/cjs/IncrementalLoading/FullSchemaQueries.d.ts +14 -0
- package/lib/cjs/IncrementalLoading/FullSchemaQueries.d.ts.map +1 -0
- package/lib/cjs/IncrementalLoading/FullSchemaQueries.js +609 -0
- package/lib/cjs/IncrementalLoading/FullSchemaQueries.js.map +1 -0
- package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.d.ts +109 -0
- package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.d.ts.map +1 -0
- package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js +219 -0
- package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -0
- package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.d.ts +36 -0
- package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.d.ts.map +1 -0
- package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.js +77 -0
- package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.js.map +1 -0
- package/lib/cjs/IncrementalLoading/PerformanceLogger.d.ts +60 -0
- package/lib/cjs/IncrementalLoading/PerformanceLogger.d.ts.map +1 -0
- package/lib/cjs/IncrementalLoading/PerformanceLogger.js +82 -0
- package/lib/cjs/IncrementalLoading/PerformanceLogger.js.map +1 -0
- package/lib/cjs/IncrementalLoading/SchemaItemParsers.d.ts +51 -0
- package/lib/cjs/IncrementalLoading/SchemaItemParsers.d.ts.map +1 -0
- package/lib/cjs/IncrementalLoading/SchemaItemParsers.js +122 -0
- package/lib/cjs/IncrementalLoading/SchemaItemParsers.js.map +1 -0
- package/lib/cjs/IncrementalLoading/SchemaItemQueries.d.ts +16 -0
- package/lib/cjs/IncrementalLoading/SchemaItemQueries.d.ts.map +1 -0
- package/lib/cjs/IncrementalLoading/SchemaItemQueries.js +308 -0
- package/lib/cjs/IncrementalLoading/SchemaItemQueries.js.map +1 -0
- package/lib/cjs/IncrementalLoading/SchemaParser.d.ts +42 -0
- package/lib/cjs/IncrementalLoading/SchemaParser.d.ts.map +1 -0
- package/lib/cjs/IncrementalLoading/SchemaParser.js +109 -0
- package/lib/cjs/IncrementalLoading/SchemaParser.js.map +1 -0
- package/lib/cjs/IncrementalLoading/SchemaStubQueries.d.ts +12 -0
- package/lib/cjs/IncrementalLoading/SchemaStubQueries.d.ts.map +1 -0
- package/lib/cjs/IncrementalLoading/SchemaStubQueries.js +365 -0
- package/lib/cjs/IncrementalLoading/SchemaStubQueries.js.map +1 -0
- package/lib/cjs/Metadata/Class.d.ts +5 -16
- package/lib/cjs/Metadata/Class.d.ts.map +1 -1
- package/lib/cjs/Metadata/Class.js +68 -68
- package/lib/cjs/Metadata/Class.js.map +1 -1
- package/lib/cjs/Metadata/CustomAttribute.d.ts +7 -1
- package/lib/cjs/Metadata/CustomAttribute.d.ts.map +1 -1
- package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.js +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
- package/lib/cjs/Metadata/EntityClass.d.ts +6 -6
- package/lib/cjs/Metadata/EntityClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/EntityClass.js +48 -26
- package/lib/cjs/Metadata/EntityClass.js.map +1 -1
- package/lib/cjs/Metadata/Format.d.ts +5 -0
- package/lib/cjs/Metadata/Format.d.ts.map +1 -1
- package/lib/cjs/Metadata/Format.js +7 -0
- package/lib/cjs/Metadata/Format.js.map +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/cjs/Metadata/Schema.d.ts +10 -0
- package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
- package/lib/cjs/Metadata/Schema.js +13 -0
- package/lib/cjs/Metadata/Schema.js.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.d.ts +10 -0
- package/lib/cjs/Metadata/SchemaItem.d.ts.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.js +13 -0
- package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
- package/lib/cjs/SchemaFormatsProvider.d.ts +4 -3
- package/lib/cjs/SchemaFormatsProvider.d.ts.map +1 -1
- package/lib/cjs/SchemaFormatsProvider.js +60 -17
- package/lib/cjs/SchemaFormatsProvider.js.map +1 -1
- package/lib/cjs/SchemaLoader.d.ts +4 -1
- package/lib/cjs/SchemaLoader.d.ts.map +1 -1
- package/lib/cjs/SchemaLoader.js +4 -1
- package/lib/cjs/SchemaLoader.js.map +1 -1
- package/lib/cjs/ecschema-metadata.d.ts +2 -0
- package/lib/cjs/ecschema-metadata.d.ts.map +1 -1
- package/lib/cjs/ecschema-metadata.js +2 -0
- package/lib/cjs/ecschema-metadata.js.map +1 -1
- package/lib/cjs/utils/SchemaLoadingController.d.ts +37 -0
- package/lib/cjs/utils/SchemaLoadingController.d.ts.map +1 -0
- package/lib/cjs/utils/SchemaLoadingController.js +65 -0
- package/lib/cjs/utils/SchemaLoadingController.js.map +1 -0
- package/lib/esm/Context.d.ts +1 -1
- package/lib/esm/Context.js +1 -1
- package/lib/esm/Context.js.map +1 -1
- package/lib/esm/Deserialization/Helper.d.ts +30 -11
- package/lib/esm/Deserialization/Helper.d.ts.map +1 -1
- package/lib/esm/Deserialization/Helper.js +124 -96
- package/lib/esm/Deserialization/Helper.js.map +1 -1
- package/lib/esm/Deserialization/SchemaGraphUtil.d.ts +12 -3
- package/lib/esm/Deserialization/SchemaGraphUtil.d.ts.map +1 -1
- package/lib/esm/Deserialization/SchemaGraphUtil.js +36 -23
- package/lib/esm/Deserialization/SchemaGraphUtil.js.map +1 -1
- package/lib/esm/Deserialization/XmlParser.d.ts.map +1 -1
- package/lib/esm/Deserialization/XmlParser.js +14 -5
- package/lib/esm/Deserialization/XmlParser.js.map +1 -1
- package/lib/esm/Deserialization/XmlSerializationUtils.js +1 -1
- package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/esm/ECName.js +1 -1
- package/lib/esm/ECName.js.map +1 -1
- package/lib/esm/ECObjects.d.ts +1 -1
- package/lib/esm/ECObjects.js +2 -2
- package/lib/esm/ECObjects.js.map +1 -1
- package/lib/esm/IncrementalLoading/ClassParsers.d.ts +60 -0
- package/lib/esm/IncrementalLoading/ClassParsers.d.ts.map +1 -0
- package/lib/esm/IncrementalLoading/ClassParsers.js +104 -0
- package/lib/esm/IncrementalLoading/ClassParsers.js.map +1 -0
- package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.d.ts +211 -0
- package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.d.ts.map +1 -0
- package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js +383 -0
- package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -0
- package/lib/esm/IncrementalLoading/FullSchemaQueries.d.ts +14 -0
- package/lib/esm/IncrementalLoading/FullSchemaQueries.d.ts.map +1 -0
- package/lib/esm/IncrementalLoading/FullSchemaQueries.js +606 -0
- package/lib/esm/IncrementalLoading/FullSchemaQueries.js.map +1 -0
- package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.d.ts +109 -0
- package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.d.ts.map +1 -0
- package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js +215 -0
- package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -0
- package/lib/esm/IncrementalLoading/IncrementalSchemaReader.d.ts +36 -0
- package/lib/esm/IncrementalLoading/IncrementalSchemaReader.d.ts.map +1 -0
- package/lib/esm/IncrementalLoading/IncrementalSchemaReader.js +73 -0
- package/lib/esm/IncrementalLoading/IncrementalSchemaReader.js.map +1 -0
- package/lib/esm/IncrementalLoading/PerformanceLogger.d.ts +60 -0
- package/lib/esm/IncrementalLoading/PerformanceLogger.d.ts.map +1 -0
- package/lib/esm/IncrementalLoading/PerformanceLogger.js +78 -0
- package/lib/esm/IncrementalLoading/PerformanceLogger.js.map +1 -0
- package/lib/esm/IncrementalLoading/SchemaItemParsers.d.ts +51 -0
- package/lib/esm/IncrementalLoading/SchemaItemParsers.d.ts.map +1 -0
- package/lib/esm/IncrementalLoading/SchemaItemParsers.js +117 -0
- package/lib/esm/IncrementalLoading/SchemaItemParsers.js.map +1 -0
- package/lib/esm/IncrementalLoading/SchemaItemQueries.d.ts +16 -0
- package/lib/esm/IncrementalLoading/SchemaItemQueries.d.ts.map +1 -0
- package/lib/esm/IncrementalLoading/SchemaItemQueries.js +305 -0
- package/lib/esm/IncrementalLoading/SchemaItemQueries.js.map +1 -0
- package/lib/esm/IncrementalLoading/SchemaParser.d.ts +42 -0
- package/lib/esm/IncrementalLoading/SchemaParser.d.ts.map +1 -0
- package/lib/esm/IncrementalLoading/SchemaParser.js +104 -0
- package/lib/esm/IncrementalLoading/SchemaParser.js.map +1 -0
- package/lib/esm/IncrementalLoading/SchemaStubQueries.d.ts +12 -0
- package/lib/esm/IncrementalLoading/SchemaStubQueries.d.ts.map +1 -0
- package/lib/esm/IncrementalLoading/SchemaStubQueries.js +359 -0
- package/lib/esm/IncrementalLoading/SchemaStubQueries.js.map +1 -0
- package/lib/esm/Metadata/Class.d.ts +5 -16
- package/lib/esm/Metadata/Class.d.ts.map +1 -1
- package/lib/esm/Metadata/Class.js +68 -68
- package/lib/esm/Metadata/Class.js.map +1 -1
- package/lib/esm/Metadata/CustomAttribute.d.ts +7 -1
- package/lib/esm/Metadata/CustomAttribute.d.ts.map +1 -1
- package/lib/esm/Metadata/CustomAttribute.js.map +1 -1
- package/lib/esm/Metadata/CustomAttributeClass.d.ts +1 -1
- package/lib/esm/Metadata/CustomAttributeClass.js +1 -1
- package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
- package/lib/esm/Metadata/EntityClass.d.ts +6 -6
- package/lib/esm/Metadata/EntityClass.d.ts.map +1 -1
- package/lib/esm/Metadata/EntityClass.js +48 -26
- package/lib/esm/Metadata/EntityClass.js.map +1 -1
- package/lib/esm/Metadata/Format.d.ts +5 -0
- package/lib/esm/Metadata/Format.d.ts.map +1 -1
- package/lib/esm/Metadata/Format.js +7 -0
- package/lib/esm/Metadata/Format.js.map +1 -1
- package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/esm/Metadata/Schema.d.ts +10 -0
- package/lib/esm/Metadata/Schema.d.ts.map +1 -1
- package/lib/esm/Metadata/Schema.js +13 -0
- package/lib/esm/Metadata/Schema.js.map +1 -1
- package/lib/esm/Metadata/SchemaItem.d.ts +10 -0
- package/lib/esm/Metadata/SchemaItem.d.ts.map +1 -1
- package/lib/esm/Metadata/SchemaItem.js +13 -0
- package/lib/esm/Metadata/SchemaItem.js.map +1 -1
- package/lib/esm/SchemaFormatsProvider.d.ts +4 -3
- package/lib/esm/SchemaFormatsProvider.d.ts.map +1 -1
- package/lib/esm/SchemaFormatsProvider.js +61 -18
- package/lib/esm/SchemaFormatsProvider.js.map +1 -1
- package/lib/esm/SchemaLoader.d.ts +4 -1
- package/lib/esm/SchemaLoader.d.ts.map +1 -1
- package/lib/esm/SchemaLoader.js +4 -1
- package/lib/esm/SchemaLoader.js.map +1 -1
- package/lib/esm/ecschema-metadata.d.ts +2 -0
- package/lib/esm/ecschema-metadata.d.ts.map +1 -1
- package/lib/esm/ecschema-metadata.js +2 -0
- package/lib/esm/ecschema-metadata.js.map +1 -1
- package/lib/esm/utils/SchemaLoadingController.d.ts +37 -0
- package/lib/esm/utils/SchemaLoadingController.d.ts.map +1 -0
- package/lib/esm/utils/SchemaLoadingController.js +61 -0
- package/lib/esm/utils/SchemaLoadingController.js.map +1 -0
- package/package.json +15 -10
package/lib/cjs/ECName.js
CHANGED
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.ECName = void 0;
|
|
11
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
12
12
|
const Exception_1 = require("./Exception");
|
|
13
|
-
const validECNameRegex = /^
|
|
13
|
+
const validECNameRegex = /^[a-zA-Z_]\w*$/i;
|
|
14
14
|
const ecNameReplacerRegex = /__x([0-9a-fA-F]{4})__/g;
|
|
15
15
|
const leadingDigits = ["0000", "000", "00", "0", ""];
|
|
16
16
|
function isDigit(character) {
|
package/lib/cjs/ECName.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ECName.js","sourceRoot":"","sources":["../../src/ECName.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAC7C,2CAA4D;AAE5D,MAAM,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"file":"ECName.js","sourceRoot":"","sources":["../../src/ECName.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAC7C,2CAA4D;AAE5D,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAC3C,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,IAAA,qBAAM,EAAC,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,IAAA,qBAAM,EAAC,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,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AACrG,CAAC;AAED;;;;;;;;;GASG;AACH,MAAa,MAAM;IACT,KAAK,CAAS;IAEtB;;OAEG;IACH,YAAY,I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BAAgB,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;AA/DD,wBA+DC","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 { assert } from \"@itwin/core-bentley\";\nimport { ECSchemaError, ECSchemaStatus } from \"./Exception\";\n\nconst validECNameRegex = /^[a-zA-Z_]\\w*$/i;\nconst ecNameReplacerRegex = /__x([0-9a-fA-F]{4})__/g;\nconst leadingDigits = [\"0000\", \"000\", \"00\", \"0\", \"\"];\n\nfunction isDigit(character: string): boolean {\n assert(1 === character.length);\n return character >= \"0\" && character <= \"9\";\n}\n\nfunction isValidAlphaNumericCharacter(c: string): boolean {\n assert(1 === c.length);\n return (((c >= \"0\" && c <= \"9\") || (c >= \"A\" && c <= \"Z\") || (c >= \"a\" && c <= \"z\") || c === \"_\"));\n}\n\n/** The name of an item in a [[Schema]], encoded to meet restrictions on the characters usable in such names.\n * An ECName meets the following criteria:\n * - Contains at least one character.\n * - Does not begin with a digit.\n * - Consists entirely of characters in the ASCII ranges A-Z, a-z, and 0-9; and the underscore (\"_\") character.\n *\n * All characters not meeting the above criteria are encoded as \"__x####__\" where \"####\" is the UTF-16 character code.\n * Such names are often automatically generated from the item's display label, which is unrestricted in the characters it may contain.\n * @public\n */\nexport class ECName {\n private _name: string;\n\n /** Construct a new ECName from a valid EC name.\n * throws ECSchemaError if `name` does not meet the criteria for a valid EC name.\n */\n constructor(name: string) {\n if (!ECName.validate(name))\n throw new ECSchemaError(ECSchemaStatus.InvalidECName);\n\n this._name = name;\n }\n\n /** Returns true if a string meets the criteria of a valid EC name. */\n public static validate(name: string): boolean {\n return validECNameRegex.test(name);\n }\n\n /** The underlying name as a string. */\n public get name(): string {\n return this._name;\n }\n\n /** Create an ECName from an arbitrary string, encoding any special characters as \"__x####__\" where \"####\" is the UTF-16 character code.\n * @throws ECSchemaError if `input` is an empty string.\n */\n public static encode(input: string): ECName {\n if (0 === input.length)\n throw new ECSchemaError(ECSchemaStatus.InvalidECName);\n\n if (ECName.validate(input)) {\n // It's already a valid EC name.\n return new ECName(input);\n }\n\n let output = \"\";\n\n function appendEncodedCharacter(index: number): void {\n const hex = input.charCodeAt(index).toString(16).toUpperCase();\n assert(hex.length > 0 && hex.length < 5);\n output += `__x${leadingDigits[hex.length]}${hex}__`;\n }\n\n // First character cannot be a digit.\n const firstCharIsDigit = isDigit(input[0]);\n if (firstCharIsDigit)\n appendEncodedCharacter(0);\n\n for (let i = firstCharIsDigit ? 1 : 0; i < input.length; i++) {\n const char = input[i];\n if (!isValidAlphaNumericCharacter(char))\n appendEncodedCharacter(i);\n else\n output += char;\n }\n\n return new ECName(output);\n }\n\n /** Decode this ECName, replacing encoded special characters with the characters they encode. */\n public decode(): string {\n return this.name.replace(ecNameReplacerRegex, (_match, hex) => String.fromCharCode(Number.parseInt(hex, 16)));\n }\n}\n"]}
|
package/lib/cjs/ECObjects.d.ts
CHANGED
|
@@ -147,7 +147,7 @@ export declare function parseSchemaItemType(type: string): SchemaItemType | unde
|
|
|
147
147
|
* @param value The SchemaItemType to stringify.
|
|
148
148
|
* @return A string representing the provided SchemaItemType. If the type is not valid, an empty string is returned.
|
|
149
149
|
* @beta
|
|
150
|
-
* @deprecated in 4.6.0 SchemaItemType is a string enum so just use it directly
|
|
150
|
+
* @deprecated in 4.6.0 - will not be removed until after 2026-06-13. SchemaItemType is a string enum so just use it directly
|
|
151
151
|
*/
|
|
152
152
|
export declare function schemaItemTypeToString(value: SchemaItemType): string;
|
|
153
153
|
/** @internal */
|
package/lib/cjs/ECObjects.js
CHANGED
|
@@ -129,7 +129,7 @@ var SchemaMatchType;
|
|
|
129
129
|
(function (SchemaMatchType) {
|
|
130
130
|
/*
|
|
131
131
|
* Find exact VersionRead, VersionWrite, VersionMinor match as well as Data. NOTE data is not yet matched
|
|
132
|
-
* @deprecated in 4.10 Use Exact instead.
|
|
132
|
+
* @deprecated in 4.10 - will not be removed until after 2026-06-13. Use Exact instead.
|
|
133
133
|
*/
|
|
134
134
|
SchemaMatchType[SchemaMatchType["Identical"] = 0] = "Identical";
|
|
135
135
|
/* Find exact VersionRead, VersionWrite, VersionMinor match. */
|
|
@@ -229,7 +229,7 @@ function parseSchemaItemType(type) {
|
|
|
229
229
|
* @param value The SchemaItemType to stringify.
|
|
230
230
|
* @return A string representing the provided SchemaItemType. If the type is not valid, an empty string is returned.
|
|
231
231
|
* @beta
|
|
232
|
-
* @deprecated in 4.6.0 SchemaItemType is a string enum so just use it directly
|
|
232
|
+
* @deprecated in 4.6.0 - will not be removed until after 2026-06-13. SchemaItemType is a string enum so just use it directly
|
|
233
233
|
*/
|
|
234
234
|
function schemaItemTypeToString(value) {
|
|
235
235
|
return value; // TODO: Remove
|
package/lib/cjs/ECObjects.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ECObjects.js","sourceRoot":"","sources":["../../src/ECObjects.ts"],"names":[],"mappings":";A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IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAErC,IAAI,SAAS,KAAK,sBAAsB,CAAC,KAAK,IAAI,CAC9C,KAAK,KAAK,cAAc,CAAC,WAAW;QACpC,KAAK,KAAK,cAAc,CAAC,KAAK;QAC9B,KAAK,KAAK,cAAc,CAAC,WAAW;QACpC,KAAK,KAAK,cAAc,CAAC,oBAAoB;QAC7C,KAAK,KAAK,cAAc,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAChD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,SAAS,KAAK,sBAAsB,CAAC,UAAU,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","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 { ECStringConstants } from \"./Constants\";\nimport { ECSchemaError, ECSchemaStatus } from \"./Exception\";\n\nexport { PropertyType } from \"./PropertyTypes\";\n\n// NEEDSWORK: This shim is currently required to use async iterators. See https://github.com/Microsoft/TypeScript/issues/14151\nif (!(Symbol as any).asyncIterator) {\n (Symbol as any).asyncIterator = Symbol.for(\"Symbol.asyncIterator\");\n}\n\n/**\n * Identifies a class as abstract or sealed\n *\n * @public @preview\n */\nexport enum ECClassModifier {\n /* normal, instantiable class, can be subclassed */\n None,\n /* abstract class, cannot be instantiated, can be subclassed */\n Abstract,\n /* sealed class, instantiable class, cannot be subclassed */\n Sealed,\n}\n\n/**\n * An enumeration that has all the schema item type names as values\n *\n * @enum {string}\n * @public @preview\n */\nexport enum SchemaItemType {\n EntityClass = \"EntityClass\",\n Mixin = \"Mixin\",\n StructClass = \"StructClass\",\n CustomAttributeClass = \"CustomAttributeClass\",\n RelationshipClass = \"RelationshipClass\",\n Enumeration = \"Enumeration\",\n KindOfQuantity = \"KindOfQuantity\",\n PropertyCategory = \"PropertyCategory\",\n Unit = \"Unit\",\n InvertedUnit = \"InvertedUnit\",\n Constant = \"Constant\",\n Phenomenon = \"Phenomenon\",\n UnitSystem = \"UnitSystem\",\n Format = \"Format\",\n}\n\n/**\n * Additional Schema Item Types which define classes of item types\n * @public @preview\n */\nexport enum AbstractSchemaItemType {\n /* Item is EntityClass, Mixin, StructClass, CustomAttributeClass, or RelationshipClass */\n Class = \"Class\",\n /* Any item type including the Class types */\n SchemaItem = \"SchemaItem\",\n}\n\n/**\n * Defines types of items that may be provided to identify supported items\n * @public @preview\n */\nexport type SupportedSchemaItemType = SchemaItemType | AbstractSchemaItemType;\n\n/**\n * Primitive data types for ECProperties.\n * @public @preview\n */\nexport enum PrimitiveType {\n Uninitialized = 0x00,\n Binary = 0x101,\n Boolean = 0x201,\n DateTime = 0x301,\n Double = 0x401,\n Integer = 0x501,\n Long = 0x601,\n Point2d = 0x701,\n Point3d = 0x801,\n String = 0x901,\n IGeometry = 0xa01,\n}\n\n/**\n * Defines the valid CustomAttribute container types.\n * @public @preview\n */\nexport enum CustomAttributeContainerType {\n Schema = 0x0001 << 0,\n EntityClass = 0x0001 << 1,\n CustomAttributeClass = 0x0001 << 2,\n StructClass = 0x0001 << 3,\n RelationshipClass = 0x0001 << 4,\n AnyClass = EntityClass | CustomAttributeClass | StructClass | RelationshipClass,\n PrimitiveProperty = 0x0001 << 5,\n StructProperty = 0x0001 << 6,\n PrimitiveArrayProperty = 0x0001 << 7,\n StructArrayProperty = 0x0001 << 8,\n NavigationProperty = 0x0001 << 9,\n AnyProperty = PrimitiveProperty | StructProperty | PrimitiveArrayProperty | StructArrayProperty | NavigationProperty,\n SourceRelationshipConstraint = 0x0001 << 10,\n TargetRelationshipConstraint = 0x0001 << 11,\n AnyRelationshipConstraint = SourceRelationshipConstraint | TargetRelationshipConstraint,\n Any = Schema | AnyClass | AnyProperty | AnyRelationshipConstraint,\n}\n\n/**\n * Defines what sort of match should be used when locating a schema.\n * @public @preview\n */\nexport enum SchemaMatchType {\n /*\n * Find exact VersionRead, VersionWrite, VersionMinor match as well as Data. NOTE data is not yet matched\n * @deprecated in 4.10 Use Exact instead.\n */\n Identical,\n /* Find exact VersionRead, VersionWrite, VersionMinor match. */\n Exact,\n /* Find latest version with matching VersionRead and VersionWrite */\n LatestWriteCompatible,\n /* Find latest version. */\n Latest,\n /* Find latest version with matching VersionRead */\n LatestReadCompatible,\n}\n\n/**\n * Identifer for an ECRelationshipConstraint. Used to determine the side of the relationship the constraint is representing.\n * @public @preview\n */\nexport enum RelationshipEnd {\n Source = 0,\n Target = 1,\n}\n\n/**\n * Defines the how the lifetime of the source and target are related.\n *\n * @public @preview */\nexport enum StrengthType {\n Referencing,\n Holding,\n Embedding,\n}\n\n/**\n * Defines the which side of the relationship is the starting point of the relationship. This impacts how relationship strength is applied.\n *\n * @public @preview */\nexport enum StrengthDirection {\n /** The source is the starting point of the relationship. */\n Forward = 1,\n /** The target is the starting point of the relationship. */\n Backward = 2,\n}\n\n// Helper methods for going to/from string for the above Enumerations.\n\n/**\n * Parses the provided string into an ECClassModifier if the string is a valid modifier.\n * @param modifier The modifier string to parse.\n * @beta\n */\nexport function parseClassModifier(modifier: string): ECClassModifier | undefined {\n const lowerModifier = modifier.toLowerCase();\n switch (lowerModifier) {\n case \"abstract\": return ECClassModifier.Abstract;\n case \"none\": return ECClassModifier.None;\n case \"sealed\": return ECClassModifier.Sealed;\n }\n return undefined;\n}\n\n/**\n * @return A string representing the provided ECClassModifier. If the modifier is not valid, an empty string is returned.\n * @beta\n */\nexport function classModifierToString(modifier: ECClassModifier): string {\n switch (modifier) {\n case ECClassModifier.Abstract: return \"Abstract\";\n case ECClassModifier.None: return \"None\";\n case ECClassModifier.Sealed: return \"Sealed\";\n default:\n throw new ECSchemaError(ECSchemaStatus.InvalidModifier, \"An invalid ECClassModifier has been provided.\");\n }\n}\n\n/**\n * Tries to parse the given string as one of the 8 schema item types.\n * @param type The schema item type string to parse.\n * @returns A valid SchemaItemType if successfully parsed. Otherwise, undefined if the provided string is not a valid SchemaItemType.\n * @beta\n */\nexport function parseSchemaItemType(type: string): SchemaItemType | undefined {\n switch (type.toLowerCase()) {\n case \"entityclass\": return SchemaItemType.EntityClass;\n case \"mixin\": return SchemaItemType.Mixin;\n case \"structclass\": return SchemaItemType.StructClass;\n case \"customattributeclass\": return SchemaItemType.CustomAttributeClass;\n case \"relationshipclass\": return SchemaItemType.RelationshipClass;\n case \"enumeration\": return SchemaItemType.Enumeration;\n case \"kindofquantity\": return SchemaItemType.KindOfQuantity;\n case \"propertycategory\": return SchemaItemType.PropertyCategory;\n case \"unit\": return SchemaItemType.Unit;\n case \"invertedunit\": return SchemaItemType.InvertedUnit;\n case \"constant\": return SchemaItemType.Constant;\n case \"phenomenon\": return SchemaItemType.Phenomenon;\n case \"unitsystem\": return SchemaItemType.UnitSystem;\n case \"format\": return SchemaItemType.Format;\n }\n return undefined;\n}\n\n/**\n * Converts a valid SchemaItemType to a display string.\n * @param value The SchemaItemType to stringify.\n * @return A string representing the provided SchemaItemType. If the type is not valid, an empty string is returned.\n * @beta\n * @deprecated in 4.6.0 SchemaItemType is a string enum so just use it directly\n */\nexport function schemaItemTypeToString(value: SchemaItemType): string {\n return value; // TODO: Remove\n}\n\n/** @internal */\nexport function schemaItemTypeToXmlString(value: SchemaItemType): string {\n switch (value) {\n case SchemaItemType.EntityClass: return \"ECEntityClass\";\n case SchemaItemType.Mixin: return \"ECEntityClass\";\n case SchemaItemType.StructClass: return \"ECStructClass\";\n case SchemaItemType.CustomAttributeClass: return \"ECCustomAttributeClass\";\n case SchemaItemType.RelationshipClass: return \"ECRelationshipClass\";\n case SchemaItemType.Enumeration: return \"ECEnumeration\";\n case SchemaItemType.KindOfQuantity: return \"KindOfQuantity\";\n case SchemaItemType.PropertyCategory: return \"PropertyCategory\";\n case SchemaItemType.Unit: return \"Unit\";\n case SchemaItemType.InvertedUnit: return \"InvertedUnit\";\n case SchemaItemType.Constant: return \"Constant\";\n case SchemaItemType.Phenomenon: return \"Phenomenon\";\n case SchemaItemType.UnitSystem: return \"UnitSystem\";\n case SchemaItemType.Format: return \"Format\";\n default:\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, \"An invalid SchemaItemType has been provided.\");\n }\n}\n\n/**\n * Tries to parse the given string as one of the 10 primitive types.\n * @param type The primitive type string to parse.\n * @returns A valid PrimitiveType if successfully parsed, or undefined if the provided string is not a valid PrimitiveType.\n * @beta\n */\nexport function parsePrimitiveType(type: string): PrimitiveType | undefined {\n switch (type.toLowerCase()) {\n case \"binary\": return PrimitiveType.Binary;\n case \"boolean\": case \"bool\": return PrimitiveType.Boolean;\n case \"datetime\": return PrimitiveType.DateTime;\n case \"double\": return PrimitiveType.Double;\n case \"int\": return PrimitiveType.Integer;\n case \"long\": return PrimitiveType.Long;\n case \"point2d\": return PrimitiveType.Point2d;\n case \"point3d\": return PrimitiveType.Point3d;\n case \"string\": return PrimitiveType.String;\n case \"bentley.geometry.common.igeometry\": return PrimitiveType.IGeometry;\n }\n\n return undefined;\n}\n\n/** @beta */\nexport function primitiveTypeToString(type: PrimitiveType): string {\n switch (type) {\n case PrimitiveType.Binary: return \"binary\";\n case PrimitiveType.Boolean: return \"boolean\";\n case PrimitiveType.DateTime: return \"dateTime\";\n case PrimitiveType.Double: return \"double\";\n case PrimitiveType.Integer: return \"int\";\n case PrimitiveType.IGeometry: return \"Bentley.Geometry.Common.IGeometry\";\n case PrimitiveType.Long: return \"long\";\n case PrimitiveType.Point2d: return \"point2d\";\n case PrimitiveType.Point3d: return \"point3d\";\n case PrimitiveType.String: return \"string\";\n default:\n throw new ECSchemaError(ECSchemaStatus.InvalidPrimitiveType, \"An invalid PrimitiveType has been provided.\");\n }\n}\n\n/**\n * Parses the given string into the appropriate CustomAttributeContainerType if the string is valid.\n * @param type The container type string to parse.\n * @beta\n */\nexport function parseCustomAttributeContainerType(type: string): CustomAttributeContainerType | undefined {\n const typeTokens = type.split(/[|,;]+/);\n\n let containerType = 0;\n\n typeTokens.forEach((typeToken) => {\n typeToken = typeToken.trim();\n if (typeToken.length === 0) return;\n\n typeToken = typeToken.toLowerCase();\n switch (typeToken) {\n case \"schema\":\n containerType = containerType | CustomAttributeContainerType.Schema;\n break;\n case \"entityclass\":\n containerType = containerType | CustomAttributeContainerType.EntityClass;\n break;\n case \"customattributeclass\":\n containerType = containerType | CustomAttributeContainerType.CustomAttributeClass;\n break;\n case \"structclass\":\n containerType = containerType | CustomAttributeContainerType.StructClass;\n break;\n case \"relationshipclass\":\n containerType = containerType | CustomAttributeContainerType.RelationshipClass;\n break;\n case \"anyclass\":\n containerType = containerType | CustomAttributeContainerType.AnyClass;\n break;\n case \"primitiveproperty\":\n containerType = containerType | CustomAttributeContainerType.PrimitiveProperty;\n break;\n case \"structproperty\":\n containerType = containerType | CustomAttributeContainerType.StructProperty;\n break;\n case \"arrayproperty\":\n containerType = containerType | CustomAttributeContainerType.PrimitiveArrayProperty;\n break;\n case \"structarrayproperty\":\n containerType = containerType | CustomAttributeContainerType.StructArrayProperty;\n break;\n case \"navigationproperty\":\n containerType = containerType | CustomAttributeContainerType.NavigationProperty;\n break;\n case \"anyproperty\":\n containerType = containerType | CustomAttributeContainerType.AnyProperty;\n break;\n case \"sourcerelationshipconstraint\":\n containerType = containerType | CustomAttributeContainerType.SourceRelationshipConstraint;\n break;\n case \"targetrelationshipconstraint\":\n containerType = containerType | CustomAttributeContainerType.TargetRelationshipConstraint;\n break;\n case \"anyrelationshipconstraint\":\n containerType = containerType | CustomAttributeContainerType.AnyRelationshipConstraint;\n break;\n case \"any\":\n containerType = containerType | CustomAttributeContainerType.Any;\n break;\n default:\n throw new ECSchemaError(ECSchemaStatus.InvalidContainerType, `${typeToken} is not a valid CustomAttributeContainerType value.`);\n }\n });\n\n return containerType as CustomAttributeContainerType;\n}\n\n/**\n * Creates a string representing a valid CustomAttributeContainerType.\n * @param value The CustomAttributeContainerType to stringify.\n * @return A string representing the provided CustomAttributeContainerType. If the type is not valid, an empty string is returned.\n * @beta\n */\nexport function containerTypeToString(type: CustomAttributeContainerType): string {\n const testContainerTypeValue = (compareType: CustomAttributeContainerType, otherType: CustomAttributeContainerType) => {\n return compareType === (compareType & otherType);\n };\n\n if (testContainerTypeValue(CustomAttributeContainerType.Any, type))\n return ECStringConstants.CONTAINERTYPE_ANY;\n\n let containerType = \"\";\n const setOrAppend = (val: string) => {\n if (containerType.length === 0) containerType = val;\n else containerType = `${containerType}, ${val}`;\n };\n\n if (testContainerTypeValue(CustomAttributeContainerType.Schema, type))\n setOrAppend(\"Schema\");\n\n if (testContainerTypeValue(CustomAttributeContainerType.AnyClass, type))\n setOrAppend(\"AnyClass\");\n else {\n if (testContainerTypeValue(CustomAttributeContainerType.EntityClass, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_ENTITYCLASS);\n if (testContainerTypeValue(CustomAttributeContainerType.CustomAttributeClass, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_CUSTOMATTRIBUTECLASS);\n if (testContainerTypeValue(CustomAttributeContainerType.StructClass, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_STRUCTCLASS);\n if (testContainerTypeValue(CustomAttributeContainerType.RelationshipClass, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_RELATIONSHIPCLASS);\n }\n\n if (testContainerTypeValue(CustomAttributeContainerType.AnyProperty, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_ANYPROPERTY);\n else {\n if (testContainerTypeValue(CustomAttributeContainerType.PrimitiveProperty, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_PRIMITIVEPROPERTY);\n if (testContainerTypeValue(CustomAttributeContainerType.StructProperty, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_STRUCTPROPERTY);\n if (testContainerTypeValue(CustomAttributeContainerType.PrimitiveArrayProperty, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_PRIMITIVEARRAYPROPERTY);\n if (testContainerTypeValue(CustomAttributeContainerType.StructArrayProperty, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_STRUCTARRAYPROPERTY);\n if (testContainerTypeValue(CustomAttributeContainerType.NavigationProperty, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_NAVIGATIONPROPERTY);\n }\n\n if (testContainerTypeValue(CustomAttributeContainerType.AnyRelationshipConstraint, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_ANYRELATIONSHIPCONSTRAINT);\n else {\n if (testContainerTypeValue(CustomAttributeContainerType.SourceRelationshipConstraint, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_SOURCERELATIONSHIPCONSTRAINT);\n if (testContainerTypeValue(CustomAttributeContainerType.TargetRelationshipConstraint, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_TARGETRELATIONSHIPCONSTRAINT);\n }\n\n return containerType;\n}\n\n/** @beta */\nexport function parseRelationshipEnd(end: string): RelationshipEnd | undefined {\n switch (end.toLowerCase()) {\n case \"source\": return RelationshipEnd.Source;\n case \"target\": return RelationshipEnd.Target;\n }\n return undefined;\n}\n\n/** @beta */\nexport function relationshipEndToString(end: RelationshipEnd): string {\n switch (end) {\n case RelationshipEnd.Source: return ECStringConstants.RELATIONSHIP_END_SOURCE;\n case RelationshipEnd.Target: return ECStringConstants.RELATIONSHIP_END_TARGET;\n default:\n throw new ECSchemaError(ECSchemaStatus.InvalidRelationshipEnd, `An invalid RelationshipEnd has been provided.`);\n }\n}\n\n/**\n * Takes a string representing a StrengthType, will parse it and return the corresponding StrengthType.\n * @throws ECSchemaStatus.InvalidStrength if the provided string that is not valid\n * @param strength\n * @beta\n */\nexport function parseStrength(strength: string): StrengthType | undefined {\n switch (strength.toLowerCase()) {\n case \"referencing\": return StrengthType.Referencing;\n case \"holding\": return StrengthType.Holding;\n case \"embedding\": return StrengthType.Embedding;\n }\n return undefined;\n}\n\n/** @beta */\nexport function strengthToString(strength: StrengthType): string {\n switch (strength) {\n case StrengthType.Embedding: return \"Embedding\";\n case StrengthType.Holding: return \"Holding\";\n case StrengthType.Referencing: return \"Referencing\";\n default:\n throw new ECSchemaError(ECSchemaStatus.InvalidStrength, `An invalid Strength has been provided.`);\n }\n}\n\n/** @beta */\nexport function parseStrengthDirection(direction: string): StrengthDirection | undefined {\n switch (direction.toLowerCase()) {\n case \"forward\": return StrengthDirection.Forward;\n case \"backward\": return StrengthDirection.Backward;\n }\n return undefined;\n}\n\n/** @beta */\nexport function strengthDirectionToString(direction: StrengthDirection): string {\n switch (direction) {\n case StrengthDirection.Forward: return \"Forward\";\n case StrengthDirection.Backward: return \"Backward\";\n default:\n throw new ECSchemaError(ECSchemaStatus.InvalidStrengthDirection, `An invalid StrengthDirection has been provided.`);\n }\n}\n\n/** Compares a SchemaItemType against supported type.\n * @beta\n */\nexport function isSupportedSchemaItemType(value: SchemaItemType, supported: SupportedSchemaItemType): boolean {\n if (value === supported) return true;\n\n if (supported === AbstractSchemaItemType.Class && (\n value === SchemaItemType.EntityClass ||\n value === SchemaItemType.Mixin ||\n value === SchemaItemType.StructClass ||\n value === SchemaItemType.CustomAttributeClass ||\n value === SchemaItemType.RelationshipClass)) {\n return true;\n }\n\n if (supported === AbstractSchemaItemType.SchemaItem) {\n return true;\n }\n\n return false;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ECObjects.js","sourceRoot":"","sources":["../../src/ECObjects.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;AAChG;;GAEG;;;AAoKH,gDAQC;AAMD,sDAQC;AAQD,kDAkBC;AASD,wDAEC;AAGD,8DAmBC;AAQD,gDAeC;AAGD,sDAeC;AAOD,8EAiEC;AAQD,sDAuDC;AAGD,oDAMC;AAGD,0DAOC;AAQD,sCAOC;AAGD,4CAQC;AAGD,wDAMC;AAGD,8DAOC;AAKD,8DAiBC;AAzfD,2CAAgD;AAChD,2CAA4D;AAE5D,iDAA+C;AAAtC,6GAAA,YAAY,OAAA;AAErB,+HAA+H;AAC/H,IAAI,CAAE,MAAc,CAAC,aAAa,EA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,UAAU,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","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 { ECStringConstants } from \"./Constants\";\nimport { ECSchemaError, ECSchemaStatus } from \"./Exception\";\n\nexport { PropertyType } from \"./PropertyTypes\";\n\n// NEEDSWORK: This shim is currently required to use async iterators. See https://github.com/Microsoft/TypeScript/issues/14151\nif (!(Symbol as any).asyncIterator) {\n (Symbol as any).asyncIterator = Symbol.for(\"Symbol.asyncIterator\");\n}\n\n/**\n * Identifies a class as abstract or sealed\n *\n * @public @preview\n */\nexport enum ECClassModifier {\n /* normal, instantiable class, can be subclassed */\n None,\n /* abstract class, cannot be instantiated, can be subclassed */\n Abstract,\n /* sealed class, instantiable class, cannot be subclassed */\n Sealed,\n}\n\n/**\n * An enumeration that has all the schema item type names as values\n *\n * @enum {string}\n * @public @preview\n */\nexport enum SchemaItemType {\n EntityClass = \"EntityClass\",\n Mixin = \"Mixin\",\n StructClass = \"StructClass\",\n CustomAttributeClass = \"CustomAttributeClass\",\n RelationshipClass = \"RelationshipClass\",\n Enumeration = \"Enumeration\",\n KindOfQuantity = \"KindOfQuantity\",\n PropertyCategory = \"PropertyCategory\",\n Unit = \"Unit\",\n InvertedUnit = \"InvertedUnit\",\n Constant = \"Constant\",\n Phenomenon = \"Phenomenon\",\n UnitSystem = \"UnitSystem\",\n Format = \"Format\",\n}\n\n/**\n * Additional Schema Item Types which define classes of item types\n * @public @preview\n */\nexport enum AbstractSchemaItemType {\n /* Item is EntityClass, Mixin, StructClass, CustomAttributeClass, or RelationshipClass */\n Class = \"Class\",\n /* Any item type including the Class types */\n SchemaItem = \"SchemaItem\",\n}\n\n/**\n * Defines types of items that may be provided to identify supported items\n * @public @preview\n */\nexport type SupportedSchemaItemType = SchemaItemType | AbstractSchemaItemType;\n\n/**\n * Primitive data types for ECProperties.\n * @public @preview\n */\nexport enum PrimitiveType {\n Uninitialized = 0x00,\n Binary = 0x101,\n Boolean = 0x201,\n DateTime = 0x301,\n Double = 0x401,\n Integer = 0x501,\n Long = 0x601,\n Point2d = 0x701,\n Point3d = 0x801,\n String = 0x901,\n IGeometry = 0xa01,\n}\n\n/**\n * Defines the valid CustomAttribute container types.\n * @public @preview\n */\nexport enum CustomAttributeContainerType {\n Schema = 0x0001 << 0,\n EntityClass = 0x0001 << 1,\n CustomAttributeClass = 0x0001 << 2,\n StructClass = 0x0001 << 3,\n RelationshipClass = 0x0001 << 4,\n AnyClass = EntityClass | CustomAttributeClass | StructClass | RelationshipClass,\n PrimitiveProperty = 0x0001 << 5,\n StructProperty = 0x0001 << 6,\n PrimitiveArrayProperty = 0x0001 << 7,\n StructArrayProperty = 0x0001 << 8,\n NavigationProperty = 0x0001 << 9,\n AnyProperty = PrimitiveProperty | StructProperty | PrimitiveArrayProperty | StructArrayProperty | NavigationProperty,\n SourceRelationshipConstraint = 0x0001 << 10,\n TargetRelationshipConstraint = 0x0001 << 11,\n AnyRelationshipConstraint = SourceRelationshipConstraint | TargetRelationshipConstraint,\n Any = Schema | AnyClass | AnyProperty | AnyRelationshipConstraint,\n}\n\n/**\n * Defines what sort of match should be used when locating a schema.\n * @public @preview\n */\nexport enum SchemaMatchType {\n /*\n * Find exact VersionRead, VersionWrite, VersionMinor match as well as Data. NOTE data is not yet matched\n * @deprecated in 4.10 - will not be removed until after 2026-06-13. Use Exact instead.\n */\n Identical,\n /* Find exact VersionRead, VersionWrite, VersionMinor match. */\n Exact,\n /* Find latest version with matching VersionRead and VersionWrite */\n LatestWriteCompatible,\n /* Find latest version. */\n Latest,\n /* Find latest version with matching VersionRead */\n LatestReadCompatible,\n}\n\n/**\n * Identifer for an ECRelationshipConstraint. Used to determine the side of the relationship the constraint is representing.\n * @public @preview\n */\nexport enum RelationshipEnd {\n Source = 0,\n Target = 1,\n}\n\n/**\n * Defines the how the lifetime of the source and target are related.\n *\n * @public @preview */\nexport enum StrengthType {\n Referencing,\n Holding,\n Embedding,\n}\n\n/**\n * Defines the which side of the relationship is the starting point of the relationship. This impacts how relationship strength is applied.\n *\n * @public @preview */\nexport enum StrengthDirection {\n /** The source is the starting point of the relationship. */\n Forward = 1,\n /** The target is the starting point of the relationship. */\n Backward = 2,\n}\n\n// Helper methods for going to/from string for the above Enumerations.\n\n/**\n * Parses the provided string into an ECClassModifier if the string is a valid modifier.\n * @param modifier The modifier string to parse.\n * @beta\n */\nexport function parseClassModifier(modifier: string): ECClassModifier | undefined {\n const lowerModifier = modifier.toLowerCase();\n switch (lowerModifier) {\n case \"abstract\": return ECClassModifier.Abstract;\n case \"none\": return ECClassModifier.None;\n case \"sealed\": return ECClassModifier.Sealed;\n }\n return undefined;\n}\n\n/**\n * @return A string representing the provided ECClassModifier. If the modifier is not valid, an empty string is returned.\n * @beta\n */\nexport function classModifierToString(modifier: ECClassModifier): string {\n switch (modifier) {\n case ECClassModifier.Abstract: return \"Abstract\";\n case ECClassModifier.None: return \"None\";\n case ECClassModifier.Sealed: return \"Sealed\";\n default:\n throw new ECSchemaError(ECSchemaStatus.InvalidModifier, \"An invalid ECClassModifier has been provided.\");\n }\n}\n\n/**\n * Tries to parse the given string as one of the 8 schema item types.\n * @param type The schema item type string to parse.\n * @returns A valid SchemaItemType if successfully parsed. Otherwise, undefined if the provided string is not a valid SchemaItemType.\n * @beta\n */\nexport function parseSchemaItemType(type: string): SchemaItemType | undefined {\n switch (type.toLowerCase()) {\n case \"entityclass\": return SchemaItemType.EntityClass;\n case \"mixin\": return SchemaItemType.Mixin;\n case \"structclass\": return SchemaItemType.StructClass;\n case \"customattributeclass\": return SchemaItemType.CustomAttributeClass;\n case \"relationshipclass\": return SchemaItemType.RelationshipClass;\n case \"enumeration\": return SchemaItemType.Enumeration;\n case \"kindofquantity\": return SchemaItemType.KindOfQuantity;\n case \"propertycategory\": return SchemaItemType.PropertyCategory;\n case \"unit\": return SchemaItemType.Unit;\n case \"invertedunit\": return SchemaItemType.InvertedUnit;\n case \"constant\": return SchemaItemType.Constant;\n case \"phenomenon\": return SchemaItemType.Phenomenon;\n case \"unitsystem\": return SchemaItemType.UnitSystem;\n case \"format\": return SchemaItemType.Format;\n }\n return undefined;\n}\n\n/**\n * Converts a valid SchemaItemType to a display string.\n * @param value The SchemaItemType to stringify.\n * @return A string representing the provided SchemaItemType. If the type is not valid, an empty string is returned.\n * @beta\n * @deprecated in 4.6.0 - will not be removed until after 2026-06-13. SchemaItemType is a string enum so just use it directly\n */\nexport function schemaItemTypeToString(value: SchemaItemType): string {\n return value; // TODO: Remove\n}\n\n/** @internal */\nexport function schemaItemTypeToXmlString(value: SchemaItemType): string {\n switch (value) {\n case SchemaItemType.EntityClass: return \"ECEntityClass\";\n case SchemaItemType.Mixin: return \"ECEntityClass\";\n case SchemaItemType.StructClass: return \"ECStructClass\";\n case SchemaItemType.CustomAttributeClass: return \"ECCustomAttributeClass\";\n case SchemaItemType.RelationshipClass: return \"ECRelationshipClass\";\n case SchemaItemType.Enumeration: return \"ECEnumeration\";\n case SchemaItemType.KindOfQuantity: return \"KindOfQuantity\";\n case SchemaItemType.PropertyCategory: return \"PropertyCategory\";\n case SchemaItemType.Unit: return \"Unit\";\n case SchemaItemType.InvertedUnit: return \"InvertedUnit\";\n case SchemaItemType.Constant: return \"Constant\";\n case SchemaItemType.Phenomenon: return \"Phenomenon\";\n case SchemaItemType.UnitSystem: return \"UnitSystem\";\n case SchemaItemType.Format: return \"Format\";\n default:\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, \"An invalid SchemaItemType has been provided.\");\n }\n}\n\n/**\n * Tries to parse the given string as one of the 10 primitive types.\n * @param type The primitive type string to parse.\n * @returns A valid PrimitiveType if successfully parsed, or undefined if the provided string is not a valid PrimitiveType.\n * @beta\n */\nexport function parsePrimitiveType(type: string): PrimitiveType | undefined {\n switch (type.toLowerCase()) {\n case \"binary\": return PrimitiveType.Binary;\n case \"boolean\": case \"bool\": return PrimitiveType.Boolean;\n case \"datetime\": return PrimitiveType.DateTime;\n case \"double\": return PrimitiveType.Double;\n case \"int\": return PrimitiveType.Integer;\n case \"long\": return PrimitiveType.Long;\n case \"point2d\": return PrimitiveType.Point2d;\n case \"point3d\": return PrimitiveType.Point3d;\n case \"string\": return PrimitiveType.String;\n case \"bentley.geometry.common.igeometry\": return PrimitiveType.IGeometry;\n }\n\n return undefined;\n}\n\n/** @beta */\nexport function primitiveTypeToString(type: PrimitiveType): string {\n switch (type) {\n case PrimitiveType.Binary: return \"binary\";\n case PrimitiveType.Boolean: return \"boolean\";\n case PrimitiveType.DateTime: return \"dateTime\";\n case PrimitiveType.Double: return \"double\";\n case PrimitiveType.Integer: return \"int\";\n case PrimitiveType.IGeometry: return \"Bentley.Geometry.Common.IGeometry\";\n case PrimitiveType.Long: return \"long\";\n case PrimitiveType.Point2d: return \"point2d\";\n case PrimitiveType.Point3d: return \"point3d\";\n case PrimitiveType.String: return \"string\";\n default:\n throw new ECSchemaError(ECSchemaStatus.InvalidPrimitiveType, \"An invalid PrimitiveType has been provided.\");\n }\n}\n\n/**\n * Parses the given string into the appropriate CustomAttributeContainerType if the string is valid.\n * @param type The container type string to parse.\n * @beta\n */\nexport function parseCustomAttributeContainerType(type: string): CustomAttributeContainerType | undefined {\n const typeTokens = type.split(/[|,;]+/);\n\n let containerType = 0;\n\n typeTokens.forEach((typeToken) => {\n typeToken = typeToken.trim();\n if (typeToken.length === 0) return;\n\n typeToken = typeToken.toLowerCase();\n switch (typeToken) {\n case \"schema\":\n containerType = containerType | CustomAttributeContainerType.Schema;\n break;\n case \"entityclass\":\n containerType = containerType | CustomAttributeContainerType.EntityClass;\n break;\n case \"customattributeclass\":\n containerType = containerType | CustomAttributeContainerType.CustomAttributeClass;\n break;\n case \"structclass\":\n containerType = containerType | CustomAttributeContainerType.StructClass;\n break;\n case \"relationshipclass\":\n containerType = containerType | CustomAttributeContainerType.RelationshipClass;\n break;\n case \"anyclass\":\n containerType = containerType | CustomAttributeContainerType.AnyClass;\n break;\n case \"primitiveproperty\":\n containerType = containerType | CustomAttributeContainerType.PrimitiveProperty;\n break;\n case \"structproperty\":\n containerType = containerType | CustomAttributeContainerType.StructProperty;\n break;\n case \"arrayproperty\":\n containerType = containerType | CustomAttributeContainerType.PrimitiveArrayProperty;\n break;\n case \"structarrayproperty\":\n containerType = containerType | CustomAttributeContainerType.StructArrayProperty;\n break;\n case \"navigationproperty\":\n containerType = containerType | CustomAttributeContainerType.NavigationProperty;\n break;\n case \"anyproperty\":\n containerType = containerType | CustomAttributeContainerType.AnyProperty;\n break;\n case \"sourcerelationshipconstraint\":\n containerType = containerType | CustomAttributeContainerType.SourceRelationshipConstraint;\n break;\n case \"targetrelationshipconstraint\":\n containerType = containerType | CustomAttributeContainerType.TargetRelationshipConstraint;\n break;\n case \"anyrelationshipconstraint\":\n containerType = containerType | CustomAttributeContainerType.AnyRelationshipConstraint;\n break;\n case \"any\":\n containerType = containerType | CustomAttributeContainerType.Any;\n break;\n default:\n throw new ECSchemaError(ECSchemaStatus.InvalidContainerType, `${typeToken} is not a valid CustomAttributeContainerType value.`);\n }\n });\n\n return containerType as CustomAttributeContainerType;\n}\n\n/**\n * Creates a string representing a valid CustomAttributeContainerType.\n * @param value The CustomAttributeContainerType to stringify.\n * @return A string representing the provided CustomAttributeContainerType. If the type is not valid, an empty string is returned.\n * @beta\n */\nexport function containerTypeToString(type: CustomAttributeContainerType): string {\n const testContainerTypeValue = (compareType: CustomAttributeContainerType, otherType: CustomAttributeContainerType) => {\n return compareType === (compareType & otherType);\n };\n\n if (testContainerTypeValue(CustomAttributeContainerType.Any, type))\n return ECStringConstants.CONTAINERTYPE_ANY;\n\n let containerType = \"\";\n const setOrAppend = (val: string) => {\n if (containerType.length === 0) containerType = val;\n else containerType = `${containerType}, ${val}`;\n };\n\n if (testContainerTypeValue(CustomAttributeContainerType.Schema, type))\n setOrAppend(\"Schema\");\n\n if (testContainerTypeValue(CustomAttributeContainerType.AnyClass, type))\n setOrAppend(\"AnyClass\");\n else {\n if (testContainerTypeValue(CustomAttributeContainerType.EntityClass, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_ENTITYCLASS);\n if (testContainerTypeValue(CustomAttributeContainerType.CustomAttributeClass, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_CUSTOMATTRIBUTECLASS);\n if (testContainerTypeValue(CustomAttributeContainerType.StructClass, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_STRUCTCLASS);\n if (testContainerTypeValue(CustomAttributeContainerType.RelationshipClass, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_RELATIONSHIPCLASS);\n }\n\n if (testContainerTypeValue(CustomAttributeContainerType.AnyProperty, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_ANYPROPERTY);\n else {\n if (testContainerTypeValue(CustomAttributeContainerType.PrimitiveProperty, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_PRIMITIVEPROPERTY);\n if (testContainerTypeValue(CustomAttributeContainerType.StructProperty, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_STRUCTPROPERTY);\n if (testContainerTypeValue(CustomAttributeContainerType.PrimitiveArrayProperty, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_PRIMITIVEARRAYPROPERTY);\n if (testContainerTypeValue(CustomAttributeContainerType.StructArrayProperty, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_STRUCTARRAYPROPERTY);\n if (testContainerTypeValue(CustomAttributeContainerType.NavigationProperty, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_NAVIGATIONPROPERTY);\n }\n\n if (testContainerTypeValue(CustomAttributeContainerType.AnyRelationshipConstraint, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_ANYRELATIONSHIPCONSTRAINT);\n else {\n if (testContainerTypeValue(CustomAttributeContainerType.SourceRelationshipConstraint, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_SOURCERELATIONSHIPCONSTRAINT);\n if (testContainerTypeValue(CustomAttributeContainerType.TargetRelationshipConstraint, type))\n setOrAppend(ECStringConstants.CONTAINERTYPE_TARGETRELATIONSHIPCONSTRAINT);\n }\n\n return containerType;\n}\n\n/** @beta */\nexport function parseRelationshipEnd(end: string): RelationshipEnd | undefined {\n switch (end.toLowerCase()) {\n case \"source\": return RelationshipEnd.Source;\n case \"target\": return RelationshipEnd.Target;\n }\n return undefined;\n}\n\n/** @beta */\nexport function relationshipEndToString(end: RelationshipEnd): string {\n switch (end) {\n case RelationshipEnd.Source: return ECStringConstants.RELATIONSHIP_END_SOURCE;\n case RelationshipEnd.Target: return ECStringConstants.RELATIONSHIP_END_TARGET;\n default:\n throw new ECSchemaError(ECSchemaStatus.InvalidRelationshipEnd, `An invalid RelationshipEnd has been provided.`);\n }\n}\n\n/**\n * Takes a string representing a StrengthType, will parse it and return the corresponding StrengthType.\n * @throws ECSchemaStatus.InvalidStrength if the provided string that is not valid\n * @param strength\n * @beta\n */\nexport function parseStrength(strength: string): StrengthType | undefined {\n switch (strength.toLowerCase()) {\n case \"referencing\": return StrengthType.Referencing;\n case \"holding\": return StrengthType.Holding;\n case \"embedding\": return StrengthType.Embedding;\n }\n return undefined;\n}\n\n/** @beta */\nexport function strengthToString(strength: StrengthType): string {\n switch (strength) {\n case StrengthType.Embedding: return \"Embedding\";\n case StrengthType.Holding: return \"Holding\";\n case StrengthType.Referencing: return \"Referencing\";\n default:\n throw new ECSchemaError(ECSchemaStatus.InvalidStrength, `An invalid Strength has been provided.`);\n }\n}\n\n/** @beta */\nexport function parseStrengthDirection(direction: string): StrengthDirection | undefined {\n switch (direction.toLowerCase()) {\n case \"forward\": return StrengthDirection.Forward;\n case \"backward\": return StrengthDirection.Backward;\n }\n return undefined;\n}\n\n/** @beta */\nexport function strengthDirectionToString(direction: StrengthDirection): string {\n switch (direction) {\n case StrengthDirection.Forward: return \"Forward\";\n case StrengthDirection.Backward: return \"Backward\";\n default:\n throw new ECSchemaError(ECSchemaStatus.InvalidStrengthDirection, `An invalid StrengthDirection has been provided.`);\n }\n}\n\n/** Compares a SchemaItemType against supported type.\n * @beta\n */\nexport function isSupportedSchemaItemType(value: SchemaItemType, supported: SupportedSchemaItemType): boolean {\n if (value === supported) return true;\n\n if (supported === AbstractSchemaItemType.Class && (\n value === SchemaItemType.EntityClass ||\n value === SchemaItemType.Mixin ||\n value === SchemaItemType.StructClass ||\n value === SchemaItemType.CustomAttributeClass ||\n value === SchemaItemType.RelationshipClass)) {\n return true;\n }\n\n if (supported === AbstractSchemaItemType.SchemaItem) {\n return true;\n }\n\n return false;\n}\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ClassProps, CustomAttributeClassProps, MixinProps, RelationshipClassProps } from "../Deserialization/JsonProps";
|
|
2
|
+
import { SchemaItemParser } from "./SchemaItemParsers";
|
|
3
|
+
/**
|
|
4
|
+
* Parses ClassProps JSON returned from an ECSql query and returns the correct ClassProps JSON.
|
|
5
|
+
* This is necessary as a small amount information (ie. CustomAttribute data) returned from the
|
|
6
|
+
* iModelDb is in a different format than is required for a ClassProps JSON object.
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare class ClassParser extends SchemaItemParser {
|
|
10
|
+
/**
|
|
11
|
+
* Parses the given ClassProps JSON returned from an ECSql query.
|
|
12
|
+
* @param data The ClassProps JSON as returned from an iModelDb.
|
|
13
|
+
* @returns The corrected ClassProps Json.
|
|
14
|
+
*/
|
|
15
|
+
parse(data: ClassProps): Promise<ClassProps>;
|
|
16
|
+
private parseProperties;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Parses the given MixinProps JSON returned from an ECSql query.
|
|
20
|
+
* @param data The MixinProps JSON as returned from an iModelDb.
|
|
21
|
+
* @returns The corrected MixinProps Json.
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export declare class MixinParser extends ClassParser {
|
|
25
|
+
/**
|
|
26
|
+
* Parses the given MixinProps JSON returned from an ECSql query.
|
|
27
|
+
* @param data The MixinProps JSON as returned from an iModelDb.
|
|
28
|
+
* @returns The corrected MixinProps Json.
|
|
29
|
+
*/
|
|
30
|
+
parse(data: MixinProps): Promise<MixinProps>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Parses the given CustomAttributeClassProps JSON returned from an ECSql query.
|
|
34
|
+
* @param data The CustomAttributeClassProps JSON as returned from an iModelDb.
|
|
35
|
+
* @returns The corrected CustomAttributeClassProps Json.
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
export declare class CustomAttributeClassParser extends ClassParser {
|
|
39
|
+
/**
|
|
40
|
+
* Parses the given CustomAttributeClassProps JSON returned from an ECSql query.
|
|
41
|
+
* @param data The CustomAttributeClassProps JSON as returned from an iModelDb.
|
|
42
|
+
* @returns The corrected CustomAttributeClassProps Json.
|
|
43
|
+
*/
|
|
44
|
+
parse(data: CustomAttributeClassProps): Promise<CustomAttributeClassProps>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parses the given RelationshipClassProps JSON returned from an ECSql query.
|
|
48
|
+
* @param data The RelationshipClassProps JSON as returned from an iModelDb.
|
|
49
|
+
* @returns The corrected RelationshipClassProps Json.
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
export declare class RelationshipClassParser extends ClassParser {
|
|
53
|
+
/**
|
|
54
|
+
* Parses the given RelationshipClassProps JSON returned from an ECSql query.
|
|
55
|
+
* @param data The RelationshipClassProps JSON as returned from an iModelDb.
|
|
56
|
+
* @returns The corrected RelationshipClassProps Json.
|
|
57
|
+
*/
|
|
58
|
+
parse(data: RelationshipClassProps): Promise<RelationshipClassProps>;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=ClassParsers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClassParsers.d.ts","sourceRoot":"","sources":["../../../src/IncrementalLoading/ClassParsers.ts"],"names":[],"mappings":"AAKA,OAAO,EAAoB,UAAU,EAAE,yBAAyB,EAAE,UAAU,EAAE,sBAAsB,EAA+B,MAAM,8BAA8B,CAAC;AAExK,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAWvD;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,gBAAgB;IAC/C;;;;OAIG;IACmB,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAYlE,OAAO,CAAC,eAAe;CAOxB;AAMD;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;OAIG;IACmB,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;CAOnE;AAMD;;;;;GAKG;AACH,qBAAa,0BAA2B,SAAQ,WAAW;IACzD;;;;OAIG;IACmB,KAAK,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAKjG;AAMD;;;;;GAKG;AACH,qBAAa,uBAAwB,SAAQ,WAAW;IACtD;;;;OAIG;IACmB,KAAK,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAmB3F"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.RelationshipClassParser = exports.CustomAttributeClassParser = exports.MixinParser = exports.ClassParser = void 0;
|
|
8
|
+
const ECObjects_1 = require("../ECObjects");
|
|
9
|
+
const SchemaItemParsers_1 = require("./SchemaItemParsers");
|
|
10
|
+
const SchemaParser_1 = require("./SchemaParser");
|
|
11
|
+
/**
|
|
12
|
+
* Parses ClassProps JSON returned from an ECSql query and returns the correct ClassProps JSON.
|
|
13
|
+
* This is necessary as a small amount information (ie. CustomAttribute data) returned from the
|
|
14
|
+
* iModelDb is in a different format than is required for a ClassProps JSON object.
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
class ClassParser extends SchemaItemParsers_1.SchemaItemParser {
|
|
18
|
+
/**
|
|
19
|
+
* Parses the given ClassProps JSON returned from an ECSql query.
|
|
20
|
+
* @param data The ClassProps JSON as returned from an iModelDb.
|
|
21
|
+
* @returns The corrected ClassProps Json.
|
|
22
|
+
*/
|
|
23
|
+
async parse(data) {
|
|
24
|
+
const props = await super.parse(data);
|
|
25
|
+
if (props.properties) {
|
|
26
|
+
if (props.properties.length === 0)
|
|
27
|
+
delete props.properties;
|
|
28
|
+
else
|
|
29
|
+
this.parseProperties(props.properties);
|
|
30
|
+
}
|
|
31
|
+
return props;
|
|
32
|
+
}
|
|
33
|
+
parseProperties(propertyProps) {
|
|
34
|
+
for (const props of propertyProps) {
|
|
35
|
+
props.customAttributes = props.customAttributes && props.customAttributes.length > 0 ? props.customAttributes.map((attr) => { return (0, SchemaParser_1.parseCustomAttribute)(attr); }) : undefined;
|
|
36
|
+
if (!props.customAttributes)
|
|
37
|
+
delete props.customAttributes;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.ClassParser = ClassParser;
|
|
42
|
+
/**
|
|
43
|
+
* Parses the given MixinProps JSON returned from an ECSql query.
|
|
44
|
+
* @param data The MixinProps JSON as returned from an iModelDb.
|
|
45
|
+
* @returns The corrected MixinProps Json.
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
class MixinParser extends ClassParser {
|
|
49
|
+
/**
|
|
50
|
+
* Parses the given MixinProps JSON returned from an ECSql query.
|
|
51
|
+
* @param data The MixinProps JSON as returned from an iModelDb.
|
|
52
|
+
* @returns The corrected MixinProps Json.
|
|
53
|
+
*/
|
|
54
|
+
async parse(data) {
|
|
55
|
+
const props = await super.parse(data);
|
|
56
|
+
if (!props.customAttributes)
|
|
57
|
+
delete props.customAttributes;
|
|
58
|
+
return props;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.MixinParser = MixinParser;
|
|
62
|
+
/**
|
|
63
|
+
* Parses the given CustomAttributeClassProps JSON returned from an ECSql query.
|
|
64
|
+
* @param data The CustomAttributeClassProps JSON as returned from an iModelDb.
|
|
65
|
+
* @returns The corrected CustomAttributeClassProps Json.
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
class CustomAttributeClassParser extends ClassParser {
|
|
69
|
+
/**
|
|
70
|
+
* Parses the given CustomAttributeClassProps JSON returned from an ECSql query.
|
|
71
|
+
* @param data The CustomAttributeClassProps JSON as returned from an iModelDb.
|
|
72
|
+
* @returns The corrected CustomAttributeClassProps Json.
|
|
73
|
+
*/
|
|
74
|
+
async parse(data) {
|
|
75
|
+
const props = await super.parse(data);
|
|
76
|
+
props.appliesTo = props.appliesTo ? (0, ECObjects_1.containerTypeToString)(props.appliesTo) : ECObjects_1.CustomAttributeContainerType[ECObjects_1.CustomAttributeContainerType.Any];
|
|
77
|
+
return props;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.CustomAttributeClassParser = CustomAttributeClassParser;
|
|
81
|
+
/**
|
|
82
|
+
* Parses the given RelationshipClassProps JSON returned from an ECSql query.
|
|
83
|
+
* @param data The RelationshipClassProps JSON as returned from an iModelDb.
|
|
84
|
+
* @returns The corrected RelationshipClassProps Json.
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
class RelationshipClassParser extends ClassParser {
|
|
88
|
+
/**
|
|
89
|
+
* Parses the given RelationshipClassProps JSON returned from an ECSql query.
|
|
90
|
+
* @param data The RelationshipClassProps JSON as returned from an iModelDb.
|
|
91
|
+
* @returns The corrected RelationshipClassProps Json.
|
|
92
|
+
*/
|
|
93
|
+
async parse(data) {
|
|
94
|
+
const props = await super.parse(data);
|
|
95
|
+
const source = props.source;
|
|
96
|
+
const target = props.target;
|
|
97
|
+
if (source) {
|
|
98
|
+
source.customAttributes = source.customAttributes ? source.customAttributes.map((attr) => { return (0, SchemaParser_1.parseCustomAttribute)(attr); }) : undefined;
|
|
99
|
+
if (!source.customAttributes)
|
|
100
|
+
delete source.customAttributes;
|
|
101
|
+
}
|
|
102
|
+
if (target) {
|
|
103
|
+
target.customAttributes = target.customAttributes ? target.customAttributes.map((attr) => { return (0, SchemaParser_1.parseCustomAttribute)(attr); }) : undefined;
|
|
104
|
+
if (!target.customAttributes)
|
|
105
|
+
delete target.customAttributes;
|
|
106
|
+
}
|
|
107
|
+
return props;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.RelationshipClassParser = RelationshipClassParser;
|
|
111
|
+
//# sourceMappingURL=ClassParsers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClassParsers.js","sourceRoot":"","sources":["../../../src/IncrementalLoading/ClassParsers.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAGhG,4CAAmF;AACnF,2DAAuD;AACvD,iDAAsD;AAUtD;;;;;GAKG;AACH,MAAa,WAAY,SAAQ,oCAAgB;IAC/C;;;;OAIG;IACa,KAAK,CAAC,KAAK,CAAC,IAAgB;QAC1C,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,IAAI,CAAsB,CAAC;QAC3D,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;YACrB,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC;gBAC/B,OAAO,KAAK,CAAC,UAAU,CAAC;;gBAExB,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC3C,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,eAAe,CAAC,aAAiC;QACvD,KAAK,MAAM,KAAK,IAAI,aAA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4B;QACtD,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,IAAI,CAA2B,CAAC;QAChE,MAAM,MAAM,GAAG,KAAK,CAAC,MAA4C,CAAC;QAClE,MAAM,MAAM,GAAG,KAAK,CAAC,MAA4C,CAAC;QAElE,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,GAAG,OAAO,IAAA,mCAAoB,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACnJ,IAAI,CAAC,MAAM,CAAC,gBAAgB;gBAC1B,OAAO,MAAM,CAAC,gBAAgB,CAAC;QACnC,CAAC;QAED,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,IAAS,EAAE,EAAE,GAAG,OAAO,IAAA,mCAAoB,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACnJ,IAAI,CAAC,MAAM,CAAC,gBAAgB;gBAC1B,OAAO,MAAM,CAAC,gBAAgB,CAAC;QACnC,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAzBD,0DAyBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { AnyPropertyProps, ClassProps, CustomAttributeClassProps, MixinProps, RelationshipClassProps, RelationshipConstraintProps } from \"../Deserialization/JsonProps\";\nimport { containerTypeToString, CustomAttributeContainerType } from \"../ECObjects\";\nimport { SchemaItemParser } from \"./SchemaItemParsers\";\nimport { parseCustomAttribute } from \"./SchemaParser\";\n\ntype MutablePropertyProps = {\n -readonly [K in keyof AnyPropertyProps]: AnyPropertyProps[K]\n};\n\ntype MutableClassProps = {\n -readonly [K in keyof ClassProps]: ClassProps[K]\n};\n\n/**\n * Parses ClassProps JSON returned from an ECSql query and returns the correct ClassProps JSON.\n * This is necessary as a small amount information (ie. CustomAttribute data) returned from the\n * iModelDb is in a different format than is required for a ClassProps JSON object.\n * @internal\n */\nexport class ClassParser extends SchemaItemParser {\n /**\n * Parses the given ClassProps JSON returned from an ECSql query.\n * @param data The ClassProps JSON as returned from an iModelDb.\n * @returns The corrected ClassProps Json.\n */\n public override async parse(data: ClassProps): Promise<ClassProps> {\n const props = await super.parse(data) as MutableClassProps;\n if (props.properties) {\n if (props.properties.length === 0)\n delete props.properties;\n else\n this.parseProperties(props.properties);\n }\n\n return props;\n }\n\n private parseProperties(propertyProps: AnyPropertyProps[]) {\n for (const props of propertyProps as MutablePropertyProps[]) {\n props.customAttributes = props.customAttributes && props.customAttributes.length > 0 ? props.customAttributes.map((attr: any) => { return parseCustomAttribute(attr); }) : undefined;\n if (!props.customAttributes)\n delete props.customAttributes;\n }\n }\n}\n\ntype MutableMixinProps = {\n -readonly [K in keyof MixinProps]: MixinProps[K]\n};\n\n/**\n * Parses the given MixinProps JSON returned from an ECSql query.\n * @param data The MixinProps JSON as returned from an iModelDb.\n * @returns The corrected MixinProps Json.\n * @internal\n */\nexport class MixinParser extends ClassParser {\n /**\n * Parses the given MixinProps JSON returned from an ECSql query.\n * @param data The MixinProps JSON as returned from an iModelDb.\n * @returns The corrected MixinProps Json.\n */\n public override async parse(data: MixinProps): Promise<MixinProps> {\n const props = await super.parse(data) as MutableMixinProps;\n if (!props.customAttributes)\n delete props.customAttributes;\n\n return props;\n }\n}\n\ntype MutableCustomAttributeClassProps = {\n -readonly [K in keyof CustomAttributeClassProps]: CustomAttributeClassProps[K]\n};\n\n/**\n * Parses the given CustomAttributeClassProps JSON returned from an ECSql query.\n * @param data The CustomAttributeClassProps JSON as returned from an iModelDb.\n * @returns The corrected CustomAttributeClassProps Json.\n * @internal\n */\nexport class CustomAttributeClassParser extends ClassParser {\n /**\n * Parses the given CustomAttributeClassProps JSON returned from an ECSql query.\n * @param data The CustomAttributeClassProps JSON as returned from an iModelDb.\n * @returns The corrected CustomAttributeClassProps Json.\n */\n public override async parse(data: CustomAttributeClassProps): Promise<CustomAttributeClassProps> {\n const props = await super.parse(data) as MutableCustomAttributeClassProps;\n props.appliesTo = props.appliesTo ? containerTypeToString(props.appliesTo as any as number) : CustomAttributeContainerType[CustomAttributeContainerType.Any];\n return props;\n }\n}\n\ntype MutableRelationshipConstraintProps = {\n -readonly [K in keyof RelationshipConstraintProps]: RelationshipConstraintProps[K]\n};\n\n/**\n * Parses the given RelationshipClassProps JSON returned from an ECSql query.\n * @param data The RelationshipClassProps JSON as returned from an iModelDb.\n * @returns The corrected RelationshipClassProps Json.\n * @internal\n */\nexport class RelationshipClassParser extends ClassParser {\n /**\n * Parses the given RelationshipClassProps JSON returned from an ECSql query.\n * @param data The RelationshipClassProps JSON as returned from an iModelDb.\n * @returns The corrected RelationshipClassProps Json.\n */\n public override async parse(data: RelationshipClassProps): Promise<RelationshipClassProps> {\n const props = await super.parse(data) as RelationshipClassProps;\n const source = props.source as MutableRelationshipConstraintProps;\n const target = props.target as MutableRelationshipConstraintProps;\n\n if (source) {\n source.customAttributes = source.customAttributes ? source.customAttributes.map((attr: any) => { return parseCustomAttribute(attr); }) : undefined;\n if (!source.customAttributes)\n delete source.customAttributes;\n }\n\n if (target) {\n target.customAttributes = target.customAttributes ? target.customAttributes.map((attr: any) => { return parseCustomAttribute(attr); }) : undefined;\n if (!target.customAttributes)\n delete target.customAttributes;\n }\n\n return props;\n }\n}"]}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { SchemaContext } from "../Context";
|
|
2
|
+
import { ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps, MixinProps, PhenomenonProps, PropertyCategoryProps, RelationshipClassProps, SchemaItemFormatProps, SchemaItemUnitProps, SchemaProps, StructClassProps, UnitSystemProps } from "../Deserialization/JsonProps";
|
|
3
|
+
import { SchemaInfo } from "../Interfaces";
|
|
4
|
+
import { SchemaKey } from "../SchemaKey";
|
|
5
|
+
import { IncrementalSchemaLocater, SchemaLocaterOptions } from "./IncrementalSchemaLocater";
|
|
6
|
+
import { PerformanceLogger } from "./PerformanceLogger";
|
|
7
|
+
interface QueryParameters {
|
|
8
|
+
[parameterName: string]: string | number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Query options used by the ECSqlSchemaLocater.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export interface ECSqlQueryOptions {
|
|
15
|
+
parameters?: QueryParameters;
|
|
16
|
+
limit?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Defines the [[ECSqlSchemaLocater]] options which determine how each
|
|
20
|
+
* schema is to be loaded. All options are optional.
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export interface ECSqlSchemaLocaterOptions extends SchemaLocaterOptions {
|
|
24
|
+
/** Query for Schemas using multiple queries. Defaults to false. */
|
|
25
|
+
readonly useMultipleQueries?: boolean;
|
|
26
|
+
/** Collects query execution performance data. Defaults to false. */
|
|
27
|
+
readonly performanceLogger?: PerformanceLogger;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* An abstract [[IncrementalSchemaLocater]] implementation for loading
|
|
31
|
+
* EC [Schema] instances from an iModelDb using ECSql queries.
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
export declare abstract class ECSqlSchemaLocater extends IncrementalSchemaLocater {
|
|
35
|
+
/**
|
|
36
|
+
* Gets the [[ECSqlSchemaLocaterOptions]] used by this locater.
|
|
37
|
+
*/
|
|
38
|
+
protected get options(): ECSqlSchemaLocaterOptions;
|
|
39
|
+
/**
|
|
40
|
+
* Initializes a new ECSqlSchemaLocater instance.
|
|
41
|
+
* @param options The options used by this Schema locater.
|
|
42
|
+
*/
|
|
43
|
+
constructor(options?: ECSqlSchemaLocaterOptions);
|
|
44
|
+
/**
|
|
45
|
+
* Executes the given ECSql query and returns the resulting rows.
|
|
46
|
+
* @param query The ECSql query to execute.
|
|
47
|
+
* @param options Optional arguments to control the query result.
|
|
48
|
+
* @returns A promise that resolves to the resulting rows.
|
|
49
|
+
*/
|
|
50
|
+
protected abstract executeQuery<TRow>(query: string, options?: ECSqlQueryOptions): Promise<ReadonlyArray<TRow>>;
|
|
51
|
+
/**
|
|
52
|
+
* Gets the [[SchemaProps]] for the given schema key.
|
|
53
|
+
* @param schemaKey The schema key of the schema to be resolved.
|
|
54
|
+
*/
|
|
55
|
+
protected abstract getSchemaProps(schemaKey: SchemaKey): Promise<SchemaProps | undefined>;
|
|
56
|
+
/**
|
|
57
|
+
* Gets the [[SchemaProps]] for the given schema key. This is the full schema json with all elements that are defined
|
|
58
|
+
* in the schema. The schema locater calls this after the stub has been loaded to fully load the schema in the background.
|
|
59
|
+
* @param schemaKey The [[SchemaKey]] of the schema to be resolved.
|
|
60
|
+
* @param context The [[SchemaContext]] to use for resolving references.
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
getSchemaJson(schemaKey: SchemaKey, context: SchemaContext): Promise<SchemaProps | undefined>;
|
|
64
|
+
/**
|
|
65
|
+
* Gets the [[SchemaProps]] without schemaItems.
|
|
66
|
+
*/
|
|
67
|
+
/**
|
|
68
|
+
* Gets the [[SchemaProps]] without schemaItems for the given schema name.
|
|
69
|
+
* @param schemaName The name of the Schema.
|
|
70
|
+
* @param context The [[SchemaContext]] to use for resolving references.
|
|
71
|
+
* @returns
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
74
|
+
getSchemaNoItems(schemaName: string, context: SchemaContext): Promise<SchemaProps | undefined>;
|
|
75
|
+
/**
|
|
76
|
+
* Checks if the [[SchemaContext]] has the right Meta Schema version to support the incremental schema loading.
|
|
77
|
+
* @param context The schema context to lookup the meta schema.
|
|
78
|
+
* @returns true if the context has a supported meta schema version, false otherwise.
|
|
79
|
+
*/
|
|
80
|
+
protected supportPartialSchemaLoading(context: SchemaContext): Promise<boolean>;
|
|
81
|
+
/**
|
|
82
|
+
* Gets all the Schema's Entity classes as [[EntityClassProps]] JSON objects.
|
|
83
|
+
* @param schemaName The name of the Schema.
|
|
84
|
+
* @param context The [[SchemaContext]] to which the schema belongs.
|
|
85
|
+
* @returns A promise that resolves to a EntityClassProps array. Maybe empty of no entities are found.
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
getEntities(schema: string, context: SchemaContext, queryOverride?: string): Promise<EntityClassProps[]>;
|
|
89
|
+
/**
|
|
90
|
+
* Gets all the Schema's Mixin classes as [[MixinProps]] JSON objects.
|
|
91
|
+
* @param schemaName The name of the Schema.
|
|
92
|
+
* @param context The SchemaContext to which the schema belongs.
|
|
93
|
+
* @returns A promise that resolves to a MixinProps array. Maybe empty of no entities are found.
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
|
+
getMixins(schema: string, context: SchemaContext, queryOverride?: string): Promise<MixinProps[]>;
|
|
97
|
+
/**
|
|
98
|
+
* Gets all the Schema's Relationship classes as [[RelationshipClassProps]] JSON objects.
|
|
99
|
+
* @param schemaName The name of the Schema.
|
|
100
|
+
* @param context The SchemaContext to which the schema belongs.
|
|
101
|
+
* @returns A promise that resolves to a RelationshipClassProps array. Maybe empty if no items are found.
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
104
|
+
getRelationships(schema: string, context: SchemaContext, queryOverride?: string): Promise<RelationshipClassProps[]>;
|
|
105
|
+
/**
|
|
106
|
+
* Gets all the Schema's CustomAttributeClass items as [[CustomAttributeClassProps]] JSON objects.
|
|
107
|
+
* @param schemaName The name of the Schema.
|
|
108
|
+
* @param context The SchemaContext to which the schema belongs.
|
|
109
|
+
* @returns A promise that resolves to a CustomAttributeClassProps array. Maybe empty if not items are found.
|
|
110
|
+
* @internal
|
|
111
|
+
*/
|
|
112
|
+
getCustomAttributeClasses(schema: string, context: SchemaContext, queryOverride?: string): Promise<CustomAttributeClassProps[]>;
|
|
113
|
+
/**
|
|
114
|
+
* Gets all the Schema's StructClass items as [[StructClassProps]] JSON objects.
|
|
115
|
+
* @param schemaName The name of the Schema.
|
|
116
|
+
* @param context The SchemaContext to which the schema belongs.
|
|
117
|
+
* @returns A promise that resolves to a StructClassProps array. Maybe empty if not items are found.
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
120
|
+
getStructs(schema: string, context: SchemaContext, queryOverride?: string): Promise<StructClassProps[]>;
|
|
121
|
+
/**
|
|
122
|
+
* Gets all the Schema's KindOfQuantity items as [[KindOfQuantityProps]] JSON objects.
|
|
123
|
+
* @param schema The name of the Schema.
|
|
124
|
+
* @param context The SchemaContext to which the schema belongs.
|
|
125
|
+
* @returns A promise that resolves to a KindOfQuantityProps array. Maybe empty if not items are found.
|
|
126
|
+
* @internal
|
|
127
|
+
*/
|
|
128
|
+
getKindOfQuantities(schema: string, context: SchemaContext): Promise<KindOfQuantityProps[]>;
|
|
129
|
+
/**
|
|
130
|
+
* Gets all the Schema's PropertyCategory items as [[PropertyCategoryProps]] JSON objects.
|
|
131
|
+
* @param schema The name of the Schema.
|
|
132
|
+
* @param context The SchemaContext to which the schema belongs.
|
|
133
|
+
* @returns A promise that resolves to a PropertyCategoryProps array. Maybe empty if not items are found.
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
|
+
getPropertyCategories(schema: string, context: SchemaContext): Promise<PropertyCategoryProps[]>;
|
|
137
|
+
/**
|
|
138
|
+
* Gets all the Schema's Enumeration items as [[EnumerationProps]] JSON objects.
|
|
139
|
+
* @param schema The name of the Schema.
|
|
140
|
+
* @param context The SchemaContext to which the schema belongs.
|
|
141
|
+
* @returns A promise that resolves to a EnumerationProps array. Maybe empty if not items are found.
|
|
142
|
+
* @internal
|
|
143
|
+
*/
|
|
144
|
+
getEnumerations(schema: string, context: SchemaContext): Promise<EnumerationProps[]>;
|
|
145
|
+
/**
|
|
146
|
+
* Gets all the Schema's Unit items as [[SchemaItemUnitProps]] JSON objects.
|
|
147
|
+
* @param schema The name of the Schema.
|
|
148
|
+
* @param context The SchemaContext to which the schema belongs.
|
|
149
|
+
* @returns A promise that resolves to a SchemaItemUnitProps array. Maybe empty if not items are found.
|
|
150
|
+
* @internal
|
|
151
|
+
*/
|
|
152
|
+
getUnits(schema: string, context: SchemaContext): Promise<SchemaItemUnitProps[]>;
|
|
153
|
+
/**
|
|
154
|
+
* Gets all the Schema's InvertedUnit items as [[InvertedUnitProps]] JSON objects.
|
|
155
|
+
* @param schema The name of the Schema.
|
|
156
|
+
* @param context The SchemaContext to which the schema belongs.
|
|
157
|
+
* @returns A promise that resolves to a InvertedUnitProps array. Maybe empty if not items are found.
|
|
158
|
+
* @internal
|
|
159
|
+
*/
|
|
160
|
+
getInvertedUnits(schema: string, context: SchemaContext): Promise<InvertedUnitProps[]>;
|
|
161
|
+
/**
|
|
162
|
+
* Gets all the Schema's Constant items as [[ConstantProps]] JSON objects.
|
|
163
|
+
* @param schema The name of the Schema.
|
|
164
|
+
* @param context The SchemaContext to which the schema belongs.
|
|
165
|
+
* @returns A promise that resolves to a ConstantProps array. Maybe empty if not items are found.
|
|
166
|
+
* @internal
|
|
167
|
+
*/
|
|
168
|
+
getConstants(schema: string, context: SchemaContext): Promise<ConstantProps[]>;
|
|
169
|
+
/**
|
|
170
|
+
* Gets all the Schema's UnitSystem items as [[UnitSystemProps]] JSON objects.
|
|
171
|
+
* @param schema The name of the Schema.
|
|
172
|
+
* @param context The SchemaContext to which the schema belongs.
|
|
173
|
+
* @returns A promise that resolves to a UnitSystemProps array. Maybe empty if not items are found.
|
|
174
|
+
* @internal
|
|
175
|
+
*/
|
|
176
|
+
getUnitSystems(schema: string, context: SchemaContext): Promise<UnitSystemProps[]>;
|
|
177
|
+
/**
|
|
178
|
+
* Gets all the Schema's Phenomenon items as [[PhenomenonProps]] JSON objects.
|
|
179
|
+
* @param schema The name of the Schema.
|
|
180
|
+
* @param context The SchemaContext to which the schema belongs.
|
|
181
|
+
* @returns A promise that resolves to a PhenomenonProps array. Maybe empty if not items are found.
|
|
182
|
+
* @internal
|
|
183
|
+
*/
|
|
184
|
+
getPhenomenon(schema: string, context: SchemaContext): Promise<PhenomenonProps[]>;
|
|
185
|
+
/**
|
|
186
|
+
* Gets all the Schema's Format items as [[SchemaItemFormatProps]] JSON objects.
|
|
187
|
+
* @param schema The name of the Schema.
|
|
188
|
+
* @param context The SchemaContext to which the schema belongs.
|
|
189
|
+
* @returns A promise that resolves to a SchemaItemFormatProps array. Maybe empty if not items are found.
|
|
190
|
+
* @internal
|
|
191
|
+
*/
|
|
192
|
+
getFormats(schema: string, context: SchemaContext): Promise<SchemaItemFormatProps[]>;
|
|
193
|
+
/**
|
|
194
|
+
* Gets [[SchemaInfo]] objects for all schemas including their direct schema references.
|
|
195
|
+
* @internal
|
|
196
|
+
*/
|
|
197
|
+
loadSchemaInfos(): Promise<ReadonlyArray<SchemaInfo>>;
|
|
198
|
+
/**
|
|
199
|
+
* Gets the [[SchemaProps]] to create the basic schema skeleton. Depending on which options are set, the schema items or class hierarchy
|
|
200
|
+
* can be included in the initial fetch.
|
|
201
|
+
* @param schemaKey The [[SchemaKey]] of the schema to be resolved.
|
|
202
|
+
* @returns A promise that resolves to the schema partials, which is an array of [[SchemaProps]].
|
|
203
|
+
* @internal
|
|
204
|
+
*/
|
|
205
|
+
getSchemaPartials(schemaKey: SchemaKey, context: SchemaContext): Promise<ReadonlyArray<SchemaProps> | undefined>;
|
|
206
|
+
private querySchemaItem;
|
|
207
|
+
private getFullSchema;
|
|
208
|
+
private getFullSchemaMultipleQueries;
|
|
209
|
+
}
|
|
210
|
+
export {};
|
|
211
|
+
//# sourceMappingURL=ECSqlSchemaLocater.d.ts.map
|