@itwin/ecschema-locaters 4.1.0-dev.6 → 4.1.0-dev.8

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.
@@ -132,7 +132,7 @@ class StubSchemaXmlFileLocater extends SchemaFileLocater_1.SchemaFileLocater {
132
132
  const file = xmlSchemaKey.schemaText;
133
133
  if (!file)
134
134
  throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.UnableToLocateSchema, `Could not locate the schema file, ${xmlSchemaKey.fileName}, for the schema ${xmlSchemaKey.name}`);
135
- const data = file.toString().replace(/(\s*)<!--.*?-->/g, ""); // ignore any comments in the XML file when getting the array of SchemaKeys
135
+ const data = file.toString().replace(/(\s*)<!--[\s\S]*?--!?>/g, ""); // ignore any comments in the XML file when getting the array of SchemaKeys
136
136
  const keys = [];
137
137
  const matches = data.match(/<ECSchemaReference ([^]+?)\/>/g);
138
138
  if (!matches)
@@ -1 +1 @@
1
- {"version":3,"file":"StubSchemaXmlFileLocater.js","sourceRoot":"","sources":["../../src/StubSchemaXmlFileLocater.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,6BAA6B;AAC7B,gEAEkC;AAClC,2DAAuE;AAEvE;;GAEG;AAEH,SAAS,YAAY,CAAC,UAAkB;IACtC,OAAO,mCAAmC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;GAKG;AACH,MAAa,wBAAyB,SAAQ,qCAAiB;IAC7D;;;;;OAKG;IACI,UAAU,CAAC,UAAkB,EAAE,UAAmB;QACvD,UAAU,GAAG,UAAU,IAAI,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC;QACrE,IAAI,CAAC,UAAU;YACb,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,oBAAoB,EAAE,uCAAuC,UAAU,EAAE,CAAC,CAAC;QAEtH,IAAI,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,OA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AC,kCAAkC,CAAQ,CAAC;SACpE;QAED,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE;YACjC,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,gBAAgB,EAAE,4DAA4D,CAAC,CAAC;SAC1H;QAED,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACK,cAAc,CAAC,aAAqB;QAC1C,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE/C,IAAI,CAAC,IAAI;YACP,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,gBAAgB,EAAE,oDAAoD,aAAa,EAAE,CAAC,CAAC;QAElI,IAAI,CAAC,KAAK;YACR,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,gBAAgB,EAAE,qDAAqD,aAAa,EAAE,CAAC,CAAC;QAEnI,OAAO,IAAI,6BAAS,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;CACF;AAnMD,4DAmMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as path from \"path\";\r\nimport {\r\n ECObjectsError, ECObjectsStatus, ECVersion, ISchemaLocater, Schema, SchemaContext, SchemaInfo, SchemaKey, SchemaMatchType,\r\n} from \"@itwin/ecschema-metadata\";\r\nimport { FileSchemaKey, SchemaFileLocater } from \"./SchemaFileLocater\";\r\n\r\n/** @packageDocumentation\r\n * @module Locaters\r\n */\r\n\r\nfunction isECv2Schema(schemaText: string): boolean {\r\n return /<ECSchema[^>]*xmlns=\".*ECXML.2.0\"/.test(schemaText);\r\n}\r\n\r\n/**\r\n * A SchemaLocater implementation for locating XML Schema files\r\n * from the file system using configurable search paths. Returns only\r\n * Schemas from XML files with their keys populated.\r\n * @internal\r\n */\r\nexport class StubSchemaXmlFileLocater extends SchemaFileLocater implements ISchemaLocater {\r\n /**\r\n * Loads a Schema from an XML file on the file system.\r\n * @param schemaPath The path to the Schema file.\r\n * @param schemaText Optionally pass in the schema text read from the schema file. If undefined,\r\n * the schema will be read from the provided schemaPath.\r\n */\r\n public loadSchema(schemaPath: string, schemaText?: string): Schema {\r\n schemaText = schemaText || this.readUtf8FileToStringSync(schemaPath);\r\n if (!schemaText)\r\n throw new ECObjectsError(ECObjectsStatus.UnableToLocateSchema, `Unable to locate schema XML file at ${schemaPath}`);\r\n\r\n this.addSchemaSearchPaths([path.dirname(schemaPath)]);\r\n const key = this.getSchemaKey(schemaText);\r\n const alias = this.getSchemaAlias(schemaText);\r\n const context = new SchemaContext();\r\n context.addLocater(this);\r\n\r\n // Load the schema and return it\r\n const schema = new Schema(context, new FileSchemaKey(key, schemaPath, schemaText), alias);\r\n this.addSchemaReferences(schema, context, SchemaMatchType.LatestWriteCompatible);\r\n return schema;\r\n }\r\n\r\n /**\r\n * Attempts to retrieve a Schema with the given SchemaKey by using the configured search paths\r\n * to locate the XML Schema file from the file system. Returns only Schemas from XML files with\r\n * their keys populated.\r\n * @param key The SchemaKey of the Schema to retrieve.\r\n * @param matchType The SchemaMatchType.\r\n * @param context The SchemaContext that will control the lifetime of the schema.\r\n */\r\n public async getSchema<T extends Schema>(key: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<T | undefined> {\r\n return this.getSchemaSync(key, matchType, context) as T;\r\n }\r\n\r\n /**\r\n * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.\r\n * The fully loaded schema can be gotten later from the context using the getCachedSchema method.\r\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\r\n * @param matchType The match type to use when locating the schema\r\n * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.\r\n */\r\n public async getSchemaInfo(key: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined> {\r\n return this.getSchemaSync(key, matchType, context) as SchemaInfo;\r\n }\r\n\r\n /**\r\n * Attempts to retrieve a Schema with the given SchemaKey by using the configured search paths\r\n * to locate the XML Schema file from the file system. Returns only Schemas from XML files with\r\n * their keys populated.\r\n * @param key The SchemaKey of the Schema to retrieve.\r\n * @param matchType The SchemaMatchType.\r\n * @param context The SchemaContext that will control the lifetime of the schema.\r\n */\r\n public getSchemaSync<T extends Schema>(key: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): T | undefined {\r\n const candidates: FileSchemaKey[] = this.findEligibleSchemaKeys(key, matchType, \"xml\");\r\n\r\n if (!candidates || candidates.length === 0)\r\n return undefined;\r\n\r\n const maxCandidate = candidates.sort(this.compareSchemaKeyByVersion)[candidates.length - 1]; // eslint-disable-line @typescript-eslint/unbound-method\r\n const alias = this.getSchemaAlias(maxCandidate.schemaText!);\r\n const schema = new Schema(context, maxCandidate, alias) as T;\r\n context.addSchemaSync(schema);\r\n\r\n this.addSchemaReferences(schema, context, SchemaMatchType.LatestWriteCompatible);\r\n return schema;\r\n }\r\n\r\n /**\r\n * Constructs a SchemaKey based on the information in the Schema XML.\r\n * @param schemaXml The Schema XML as a string.\r\n */\r\n public getSchemaKey(schemaXml: string): SchemaKey {\r\n const matches = schemaXml.match(/<ECSchema ([^]+?)>/g);\r\n if (!matches || matches.length !== 1)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Could not find '<ECSchema>' tag in the given file`);\r\n\r\n const name = matches[0].match(/schemaName=\"(.+?)\"/);\r\n const version = matches[0].match(/version=\"(.+?)\"/);\r\n if (!name || name.length !== 2 || !version || version.length !== 2)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Could not find the ECSchema 'schemaName' or 'version' tag in the given file`);\r\n\r\n let ecVersion: ECVersion;\r\n if (isECv2Schema(schemaXml))\r\n ecVersion = this.fromECv2String(version[1]);\r\n else\r\n ecVersion = ECVersion.fromString(version[1]);\r\n\r\n const key = new SchemaKey(name[1], ecVersion);\r\n return key;\r\n }\r\n\r\n /**\r\n * Gets an array of SchemaKeys of the Schemas referenced by the given Schema.\r\n * @param xmlSchemaKey The SchemaKey of the parent Schema containing the references.\r\n */\r\n private getSchemaReferenceKeys(schemaKey: FileSchemaKey): SchemaKey[] {\r\n return this._getSchemaReferenceKeys(schemaKey);\r\n }\r\n\r\n /**\r\n * Adds schemas to the references collection for the given Schema by locating\r\n * the referenced schemas.\r\n * @param schema The schema for which to add the references.\r\n * @param context The SchemaContext that will control the lifetime of the schema.\r\n * @param refMatchType The SchemaMatchType to use when locating schema references.\r\n */\r\n private addSchemaReferences(schema: Schema, context: SchemaContext, refMatchType: SchemaMatchType): void {\r\n const refKeys = this.getSchemaReferenceKeys(schema.schemaKey as FileSchemaKey);\r\n\r\n for (const key of refKeys) {\r\n const refSchema = context ? context.getSchemaSync(key, refMatchType) : undefined;\r\n if (!refSchema)\r\n throw new ECObjectsError(ECObjectsStatus.UnableToLocateSchema, `Unable to locate referenced schema: ${key.name}.${key.readVersion}.${key.writeVersion}.${key.minorVersion}`);\r\n\r\n schema.references.push(refSchema);\r\n }\r\n }\r\n\r\n /**\r\n * Gets an array of SchemaKeys of the Schemas referenced by the given Schema.\r\n * @param data The Schema XML string.\r\n */\r\n private _getSchemaReferenceKeys(xmlSchemaKey: FileSchemaKey): SchemaKey[] {\r\n const file = xmlSchemaKey.schemaText;\r\n\r\n if (!file)\r\n throw new ECObjectsError(ECObjectsStatus.UnableToLocateSchema, `Could not locate the schema file, ${xmlSchemaKey.fileName}, for the schema ${xmlSchemaKey.name}`);\r\n\r\n const data = file.toString().replace(/(\\s*)<!--.*?-->/g, \"\"); // ignore any comments in the XML file when getting the array of SchemaKeys\r\n\r\n const keys: SchemaKey[] = [];\r\n const matches = data.match(/<ECSchemaReference ([^]+?)\\/>/g);\r\n if (!matches)\r\n return keys;\r\n\r\n for (const match of matches) {\r\n const name = match.match(/name=\"(.+?)\"/);\r\n const versionMatch = match.match(/version=\"(.+?)\"/);\r\n if (!name || name.length !== 2 || !versionMatch || versionMatch.length !== 2)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Invalid ECSchemaReference xml encountered in the schema file`);\r\n\r\n // write version maybe missing, so insert \"0\"\r\n let versionString = versionMatch[1];\r\n const versionParts = versionString.split(\".\");\r\n if (versionParts.length === 2)\r\n versionParts.splice(1, 0, \"0\");\r\n\r\n versionString = versionParts.join(\".\");\r\n\r\n const key = new SchemaKey(name[1], ECVersion.fromString(versionString));\r\n keys.push(key);\r\n }\r\n\r\n return keys;\r\n }\r\n\r\n /**\r\n * Gets the Schema alias from the Schema XML.\r\n * @param data The Schema XML as a string.\r\n */\r\n private getSchemaAlias(schemaXml: string): string {\r\n let match: any;\r\n\r\n if (isECv2Schema(schemaXml)) {\r\n match = schemaXml.match(/<ECSchema.*nameSpacePrefix=\"(?<alias>\\w+)\"/) as any;\r\n } else {\r\n match = schemaXml.match(/<ECSchema.*alias=\"(?<alias>\\w+)\"/) as any;\r\n }\r\n\r\n if (!match || !match.groups.alias) {\r\n throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Could not find the ECSchema 'alias' tag in the given file.`);\r\n }\r\n\r\n return match.groups.alias;\r\n }\r\n\r\n /**\r\n * Parses a valid EC 2.0 version string and returns an ECVersion object. The second digit becomes the minor version,\r\n * and a zero is inserted as the 'write' digit. Example: \"1.1\" -> \"1.0.1\".\r\n * @param versionString A valid EC 2.0 version string of the format, 'RR.mm'.\r\n */\r\n private fromECv2String(versionString: string): ECVersion {\r\n const [read, minor] = versionString.split(\".\");\r\n\r\n if (!read)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECVersion, `The read version is missing from version string, ${versionString}`);\r\n\r\n if (!minor)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECVersion, `The minor version is missing from version string, ${versionString}`);\r\n\r\n return new ECVersion(+read, 0, +min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,aAAa,EAAE,CAAC,CAAC;QAEnI,OAAO,IAAI,6BAAS,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;CACF;AAnMD,4DAmMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport * as path from \"path\";\r\nimport {\r\n ECObjectsError, ECObjectsStatus, ECVersion, ISchemaLocater, Schema, SchemaContext, SchemaInfo, SchemaKey, SchemaMatchType,\r\n} from \"@itwin/ecschema-metadata\";\r\nimport { FileSchemaKey, SchemaFileLocater } from \"./SchemaFileLocater\";\r\n\r\n/** @packageDocumentation\r\n * @module Locaters\r\n */\r\n\r\nfunction isECv2Schema(schemaText: string): boolean {\r\n return /<ECSchema[^>]*xmlns=\".*ECXML.2.0\"/.test(schemaText);\r\n}\r\n\r\n/**\r\n * A SchemaLocater implementation for locating XML Schema files\r\n * from the file system using configurable search paths. Returns only\r\n * Schemas from XML files with their keys populated.\r\n * @internal\r\n */\r\nexport class StubSchemaXmlFileLocater extends SchemaFileLocater implements ISchemaLocater {\r\n /**\r\n * Loads a Schema from an XML file on the file system.\r\n * @param schemaPath The path to the Schema file.\r\n * @param schemaText Optionally pass in the schema text read from the schema file. If undefined,\r\n * the schema will be read from the provided schemaPath.\r\n */\r\n public loadSchema(schemaPath: string, schemaText?: string): Schema {\r\n schemaText = schemaText || this.readUtf8FileToStringSync(schemaPath);\r\n if (!schemaText)\r\n throw new ECObjectsError(ECObjectsStatus.UnableToLocateSchema, `Unable to locate schema XML file at ${schemaPath}`);\r\n\r\n this.addSchemaSearchPaths([path.dirname(schemaPath)]);\r\n const key = this.getSchemaKey(schemaText);\r\n const alias = this.getSchemaAlias(schemaText);\r\n const context = new SchemaContext();\r\n context.addLocater(this);\r\n\r\n // Load the schema and return it\r\n const schema = new Schema(context, new FileSchemaKey(key, schemaPath, schemaText), alias);\r\n this.addSchemaReferences(schema, context, SchemaMatchType.LatestWriteCompatible);\r\n return schema;\r\n }\r\n\r\n /**\r\n * Attempts to retrieve a Schema with the given SchemaKey by using the configured search paths\r\n * to locate the XML Schema file from the file system. Returns only Schemas from XML files with\r\n * their keys populated.\r\n * @param key The SchemaKey of the Schema to retrieve.\r\n * @param matchType The SchemaMatchType.\r\n * @param context The SchemaContext that will control the lifetime of the schema.\r\n */\r\n public async getSchema<T extends Schema>(key: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<T | undefined> {\r\n return this.getSchemaSync(key, matchType, context) as T;\r\n }\r\n\r\n /**\r\n * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.\r\n * The fully loaded schema can be gotten later from the context using the getCachedSchema method.\r\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\r\n * @param matchType The match type to use when locating the schema\r\n * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.\r\n */\r\n public async getSchemaInfo(key: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined> {\r\n return this.getSchemaSync(key, matchType, context) as SchemaInfo;\r\n }\r\n\r\n /**\r\n * Attempts to retrieve a Schema with the given SchemaKey by using the configured search paths\r\n * to locate the XML Schema file from the file system. Returns only Schemas from XML files with\r\n * their keys populated.\r\n * @param key The SchemaKey of the Schema to retrieve.\r\n * @param matchType The SchemaMatchType.\r\n * @param context The SchemaContext that will control the lifetime of the schema.\r\n */\r\n public getSchemaSync<T extends Schema>(key: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): T | undefined {\r\n const candidates: FileSchemaKey[] = this.findEligibleSchemaKeys(key, matchType, \"xml\");\r\n\r\n if (!candidates || candidates.length === 0)\r\n return undefined;\r\n\r\n const maxCandidate = candidates.sort(this.compareSchemaKeyByVersion)[candidates.length - 1]; // eslint-disable-line @typescript-eslint/unbound-method\r\n const alias = this.getSchemaAlias(maxCandidate.schemaText!);\r\n const schema = new Schema(context, maxCandidate, alias) as T;\r\n context.addSchemaSync(schema);\r\n\r\n this.addSchemaReferences(schema, context, SchemaMatchType.LatestWriteCompatible);\r\n return schema;\r\n }\r\n\r\n /**\r\n * Constructs a SchemaKey based on the information in the Schema XML.\r\n * @param schemaXml The Schema XML as a string.\r\n */\r\n public getSchemaKey(schemaXml: string): SchemaKey {\r\n const matches = schemaXml.match(/<ECSchema ([^]+?)>/g);\r\n if (!matches || matches.length !== 1)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Could not find '<ECSchema>' tag in the given file`);\r\n\r\n const name = matches[0].match(/schemaName=\"(.+?)\"/);\r\n const version = matches[0].match(/version=\"(.+?)\"/);\r\n if (!name || name.length !== 2 || !version || version.length !== 2)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Could not find the ECSchema 'schemaName' or 'version' tag in the given file`);\r\n\r\n let ecVersion: ECVersion;\r\n if (isECv2Schema(schemaXml))\r\n ecVersion = this.fromECv2String(version[1]);\r\n else\r\n ecVersion = ECVersion.fromString(version[1]);\r\n\r\n const key = new SchemaKey(name[1], ecVersion);\r\n return key;\r\n }\r\n\r\n /**\r\n * Gets an array of SchemaKeys of the Schemas referenced by the given Schema.\r\n * @param xmlSchemaKey The SchemaKey of the parent Schema containing the references.\r\n */\r\n private getSchemaReferenceKeys(schemaKey: FileSchemaKey): SchemaKey[] {\r\n return this._getSchemaReferenceKeys(schemaKey);\r\n }\r\n\r\n /**\r\n * Adds schemas to the references collection for the given Schema by locating\r\n * the referenced schemas.\r\n * @param schema The schema for which to add the references.\r\n * @param context The SchemaContext that will control the lifetime of the schema.\r\n * @param refMatchType The SchemaMatchType to use when locating schema references.\r\n */\r\n private addSchemaReferences(schema: Schema, context: SchemaContext, refMatchType: SchemaMatchType): void {\r\n const refKeys = this.getSchemaReferenceKeys(schema.schemaKey as FileSchemaKey);\r\n\r\n for (const key of refKeys) {\r\n const refSchema = context ? context.getSchemaSync(key, refMatchType) : undefined;\r\n if (!refSchema)\r\n throw new ECObjectsError(ECObjectsStatus.UnableToLocateSchema, `Unable to locate referenced schema: ${key.name}.${key.readVersion}.${key.writeVersion}.${key.minorVersion}`);\r\n\r\n schema.references.push(refSchema);\r\n }\r\n }\r\n\r\n /**\r\n * Gets an array of SchemaKeys of the Schemas referenced by the given Schema.\r\n * @param data The Schema XML string.\r\n */\r\n private _getSchemaReferenceKeys(xmlSchemaKey: FileSchemaKey): SchemaKey[] {\r\n const file = xmlSchemaKey.schemaText;\r\n\r\n if (!file)\r\n throw new ECObjectsError(ECObjectsStatus.UnableToLocateSchema, `Could not locate the schema file, ${xmlSchemaKey.fileName}, for the schema ${xmlSchemaKey.name}`);\r\n\r\n const data = file.toString().replace(/(\\s*)<!--[\\s\\S]*?--!?>/g, \"\"); // ignore any comments in the XML file when getting the array of SchemaKeys\r\n\r\n const keys: SchemaKey[] = [];\r\n const matches = data.match(/<ECSchemaReference ([^]+?)\\/>/g);\r\n if (!matches)\r\n return keys;\r\n\r\n for (const match of matches) {\r\n const name = match.match(/name=\"(.+?)\"/);\r\n const versionMatch = match.match(/version=\"(.+?)\"/);\r\n if (!name || name.length !== 2 || !versionMatch || versionMatch.length !== 2)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Invalid ECSchemaReference xml encountered in the schema file`);\r\n\r\n // write version maybe missing, so insert \"0\"\r\n let versionString = versionMatch[1];\r\n const versionParts = versionString.split(\".\");\r\n if (versionParts.length === 2)\r\n versionParts.splice(1, 0, \"0\");\r\n\r\n versionString = versionParts.join(\".\");\r\n\r\n const key = new SchemaKey(name[1], ECVersion.fromString(versionString));\r\n keys.push(key);\r\n }\r\n\r\n return keys;\r\n }\r\n\r\n /**\r\n * Gets the Schema alias from the Schema XML.\r\n * @param data The Schema XML as a string.\r\n */\r\n private getSchemaAlias(schemaXml: string): string {\r\n let match: any;\r\n\r\n if (isECv2Schema(schemaXml)) {\r\n match = schemaXml.match(/<ECSchema.*nameSpacePrefix=\"(?<alias>\\w+)\"/) as any;\r\n } else {\r\n match = schemaXml.match(/<ECSchema.*alias=\"(?<alias>\\w+)\"/) as any;\r\n }\r\n\r\n if (!match || !match.groups.alias) {\r\n throw new ECObjectsError(ECObjectsStatus.InvalidSchemaXML, `Could not find the ECSchema 'alias' tag in the given file.`);\r\n }\r\n\r\n return match.groups.alias;\r\n }\r\n\r\n /**\r\n * Parses a valid EC 2.0 version string and returns an ECVersion object. The second digit becomes the minor version,\r\n * and a zero is inserted as the 'write' digit. Example: \"1.1\" -> \"1.0.1\".\r\n * @param versionString A valid EC 2.0 version string of the format, 'RR.mm'.\r\n */\r\n private fromECv2String(versionString: string): ECVersion {\r\n const [read, minor] = versionString.split(\".\");\r\n\r\n if (!read)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECVersion, `The read version is missing from version string, ${versionString}`);\r\n\r\n if (!minor)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECVersion, `The minor version is missing from version string, ${versionString}`);\r\n\r\n return new ECVersion(+read, 0, +minor);\r\n }\r\n}\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/ecschema-locaters",
3
- "version": "4.1.0-dev.6",
3
+ "version": "4.1.0-dev.8",
4
4
  "description": "EC Schema file locaters",
5
5
  "license": "MIT",
6
6
  "main": "lib/cjs/ecschema-locaters.js",
@@ -54,8 +54,8 @@
54
54
  "rimraf": "^3.0.2",
55
55
  "sinon": "^9.0.2",
56
56
  "typescript": "~5.0.2",
57
- "@itwin/build-tools": "4.1.0-dev.6",
58
- "@itwin/ecschema-metadata": "4.1.0-dev.6"
57
+ "@itwin/build-tools": "4.1.0-dev.8",
58
+ "@itwin/ecschema-metadata": "4.1.0-dev.8"
59
59
  },
60
60
  "dependencies": {
61
61
  "glob": "^7.1.2",
@@ -63,7 +63,7 @@
63
63
  "@xmldom/xmldom": "~0.8.5"
64
64
  },
65
65
  "peerDependencies": {
66
- "@itwin/ecschema-metadata": "^4.1.0-dev.6"
66
+ "@itwin/ecschema-metadata": "^4.1.0-dev.8"
67
67
  },
68
68
  "nyc": {
69
69
  "extends": "./node_modules/@itwin/build-tools/.nycrc",