@itwin/ecschema-rpcinterface-tests 5.2.0-dev.15 → 5.2.0-dev.16

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.
@@ -65443,7 +65443,8 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
65443
65443
  if (schemaRow === undefined)
65444
65444
  return undefined;
65445
65445
  const schema = JSON.parse(schemaRow.schema);
65446
- return _SchemaParser__WEBPACK_IMPORTED_MODULE_5__.SchemaParser.parse(schema, context);
65446
+ const schemaInfos = await this._schemaInfoCache.getSchemasByContext(context) ?? [];
65447
+ return _SchemaParser__WEBPACK_IMPORTED_MODULE_5__.SchemaParser.parse(schema, schemaInfos);
65447
65448
  }
65448
65449
  /**
65449
65450
  * Checks if the [[SchemaContext]] has the right Meta Schema version to support the incremental schema loading.
@@ -65621,10 +65622,12 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
65621
65622
  * @internal
65622
65623
  */
65623
65624
  async getSchemaPartials(schemaKey, context) {
65625
+ const start = Date.now();
65624
65626
  const [schemaRow] = await this.executeQuery(_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_6__.ecsqlQueries.schemaStubQuery, {
65625
65627
  parameters: { schemaName: schemaKey.name },
65626
65628
  limit: 1
65627
65629
  });
65630
+ this.options.performanceLogger?.logSchemaItem(start, schemaKey.name, 'SchemaPartials', 1);
65628
65631
  if (!schemaRow)
65629
65632
  return undefined;
65630
65633
  const schemaPartials = [];
@@ -65658,7 +65661,8 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
65658
65661
  return value;
65659
65662
  };
65660
65663
  await addSchema(schemaKey);
65661
- await parseSchemaItemStubs(schemaKey.name, context, JSON.parse(schemaRow.items, reviver), addItems);
65664
+ const schemaInfos = await this._schemaInfoCache.getSchemasByContext(context) ?? [];
65665
+ await parseSchemaItemStubs(schemaKey.name, JSON.parse(schemaRow.items, reviver), addItems, schemaInfos);
65662
65666
  return schemaPartials;
65663
65667
  }
65664
65668
  async querySchemaItem(context, schemaName, query, schemaType) {
@@ -65670,7 +65674,8 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
65670
65674
  const items = itemRows.map((itemRow) => {
65671
65675
  return "string" === typeof itemRow.item ? JSON.parse(itemRow.item) : itemRow.item;
65672
65676
  });
65673
- return await _SchemaParser__WEBPACK_IMPORTED_MODULE_5__.SchemaParser.parseSchemaItems(items, schemaName, context) ?? [];
65677
+ const schemaInfos = await this._schemaInfoCache.getSchemasByContext(context) ?? [];
65678
+ return await _SchemaParser__WEBPACK_IMPORTED_MODULE_5__.SchemaParser.parseSchemaItems(items, schemaName, schemaInfos) ?? [];
65674
65679
  }
65675
65680
  async getFullSchema(schemaKey, context) {
65676
65681
  const schemaRows = await this.executeQuery(_FullSchemaQueries__WEBPACK_IMPORTED_MODULE_2__.FullSchemaQueries.schemaQuery, { parameters: { schemaName: schemaKey.name } });
@@ -65682,7 +65687,8 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
65682
65687
  if (schema.items) {
65683
65688
  schema.items = schema.items.map((itemRow) => { return itemRow.item; });
65684
65689
  }
65685
- return _SchemaParser__WEBPACK_IMPORTED_MODULE_5__.SchemaParser.parse(schema, context);
65690
+ const schemaInfos = await this._schemaInfoCache.getSchemasByContext(context) ?? [];
65691
+ return _SchemaParser__WEBPACK_IMPORTED_MODULE_5__.SchemaParser.parse(schema, schemaInfos);
65686
65692
  }
65687
65693
  async getFullSchemaMultipleQueries(schemaKey, context) {
65688
65694
  const schema = await this.getSchemaNoItems(schemaKey.name, context);
@@ -65716,7 +65722,7 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
65716
65722
  function parseSchemaReference(referenceName) {
65717
65723
  return { schemaKey: _SchemaKey__WEBPACK_IMPORTED_MODULE_1__.SchemaKey.parseString(referenceName) };
65718
65724
  }
65719
- async function parseSchemaItemStubs(schemaName, context, itemRows, addItemsHandler) {
65725
+ async function parseSchemaItemStubs(schemaName, itemRows, addItemsHandler, schemaInfos) {
65720
65726
  if (!itemRows || itemRows.length === 0) {
65721
65727
  return;
65722
65728
  }
@@ -65727,7 +65733,7 @@ async function parseSchemaItemStubs(schemaName, context, itemRows, addItemsHandl
65727
65733
  const currentItem = baseClasses[index--];
65728
65734
  const baseClassItem = baseClasses[index];
65729
65735
  const baseClassName = baseClassItem ? `${baseClassItem.schema}.${baseClassItem.name}` : undefined;
65730
- const schemaItem = await _SchemaParser__WEBPACK_IMPORTED_MODULE_5__.SchemaParser.parseItem(currentItem, currentItem.schema, context);
65736
+ const schemaItem = await _SchemaParser__WEBPACK_IMPORTED_MODULE_5__.SchemaParser.parseItem(currentItem, currentItem.schema, schemaInfos);
65731
65737
  await addItemsHandler(currentItem.schema, {
65732
65738
  ...schemaItem,
65733
65739
  name: schemaItem.name,
@@ -65737,7 +65743,7 @@ async function parseSchemaItemStubs(schemaName, context, itemRows, addItemsHandl
65737
65743
  }
65738
65744
  };
65739
65745
  for (const itemRow of itemRows) {
65740
- const schemaItem = await _SchemaParser__WEBPACK_IMPORTED_MODULE_5__.SchemaParser.parseItem(itemRow, schemaName, context);
65746
+ const schemaItem = await _SchemaParser__WEBPACK_IMPORTED_MODULE_5__.SchemaParser.parseItem(itemRow, schemaName, schemaInfos);
65741
65747
  await addItemsHandler(schemaName, {
65742
65748
  ...schemaItem,
65743
65749
  name: schemaItem.name,
@@ -65748,7 +65754,7 @@ async function parseSchemaItemStubs(schemaName, context, itemRows, addItemsHandl
65748
65754
  });
65749
65755
  await parseBaseClasses(itemRow.baseClasses);
65750
65756
  for (const mixinRow of itemRow.mixins || []) {
65751
- const mixinItem = await _SchemaParser__WEBPACK_IMPORTED_MODULE_5__.SchemaParser.parseItem(mixinRow, mixinRow.schema, context);
65757
+ const mixinItem = await _SchemaParser__WEBPACK_IMPORTED_MODULE_5__.SchemaParser.parseItem(mixinRow, mixinRow.schema, schemaInfos);
65752
65758
  await addItemsHandler(mixinRow.schema, {
65753
65759
  ...mixinItem,
65754
65760
  name: mixinItem.name,
@@ -66636,9 +66642,7 @@ __webpack_require__.r(__webpack_exports__);
66636
66642
  /* harmony import */ var _Deserialization_JsonParser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Deserialization/JsonParser */ "../../core/ecschema-metadata/lib/esm/Deserialization/JsonParser.js");
66637
66643
  /* harmony import */ var _ECObjects__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../ECObjects */ "../../core/ecschema-metadata/lib/esm/ECObjects.js");
66638
66644
  /* harmony import */ var _Metadata_Class__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Metadata/Class */ "../../core/ecschema-metadata/lib/esm/Metadata/Class.js");
66639
- /* harmony import */ var _Metadata_SchemaItem__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Metadata/SchemaItem */ "../../core/ecschema-metadata/lib/esm/Metadata/SchemaItem.js");
66640
- /* harmony import */ var _utils_SchemaLoadingController__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/SchemaLoadingController */ "../../core/ecschema-metadata/lib/esm/utils/SchemaLoadingController.js");
66641
-
66645
+ /* harmony import */ var _utils_SchemaLoadingController__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/SchemaLoadingController */ "../../core/ecschema-metadata/lib/esm/utils/SchemaLoadingController.js");
66642
66646
 
66643
66647
 
66644
66648
 
@@ -66685,12 +66689,7 @@ class IncrementalSchemaReader extends _Deserialization_Helper__WEBPACK_IMPORTED_
66685
66689
  // The fromJSON method of the actual class instances may complain about missing properties in the props, so
66686
66690
  // calling the fromJSON on the ECClass ensures only the bare minimum is loaded.
66687
66691
  if (this._incremental && schemaItemObject && schemaItem) {
66688
- if (schemaItem.schemaItemType === _ECObjects__WEBPACK_IMPORTED_MODULE_2__.SchemaItemType.KindOfQuantity) {
66689
- _Metadata_SchemaItem__WEBPACK_IMPORTED_MODULE_4__.SchemaItem.prototype.fromJSONSync.call(schemaItem, schemaItemObject);
66690
- }
66691
- else {
66692
- schemaItem.fromJSONSync(schemaItemObject);
66693
- }
66692
+ await schemaItem.fromJSON(schemaItemObject);
66694
66693
  }
66695
66694
  this.schemaItemLoading(schemaItem);
66696
66695
  return schemaItem;
@@ -66699,7 +66698,7 @@ class IncrementalSchemaReader extends _Deserialization_Helper__WEBPACK_IMPORTED_
66699
66698
  if (schemaItem === undefined)
66700
66699
  return;
66701
66700
  if (schemaItem.loadingController === undefined) {
66702
- const controller = new _utils_SchemaLoadingController__WEBPACK_IMPORTED_MODULE_5__.SchemaLoadingController();
66701
+ const controller = new _utils_SchemaLoadingController__WEBPACK_IMPORTED_MODULE_4__.SchemaLoadingController();
66703
66702
  schemaItem.setLoadingController(controller);
66704
66703
  }
66705
66704
  if (_Metadata_Class__WEBPACK_IMPORTED_MODULE_3__.ECClass.isECClass(schemaItem)
@@ -66746,15 +66745,15 @@ __webpack_require__.r(__webpack_exports__);
66746
66745
  */
66747
66746
  class SchemaItemParser {
66748
66747
  _schema;
66749
- _context;
66748
+ _schemaInfos;
66750
66749
  /**
66751
66750
  * Initializes a new SchemaItemParser.
66752
66751
  * @param schemaName The name the Schema containing the SchemaItems.
66753
66752
  * @param context The SchemaContext containing the Schema.
66754
66753
  */
66755
- constructor(schemaName, context) {
66754
+ constructor(schemaName, schemaInfos) {
66756
66755
  this._schema = schemaName;
66757
- this._context = context;
66756
+ this._schemaInfos = schemaInfos;
66758
66757
  }
66759
66758
  /**
66760
66759
  * Parses the given SchemaItemProps JSON returned from an ECSql query.
@@ -66777,7 +66776,7 @@ class SchemaItemParser {
66777
66776
  * @param rawTypeName The name or aliased name of the SchemaItem.
66778
66777
  * @returns The full name of the SchemaItem, ie. 'BisCore.PhysicalElement'
66779
66778
  */
66780
- async getQualifiedTypeName(rawTypeName) {
66779
+ getQualifiedTypeName(rawTypeName) {
66781
66780
  const nameParts = rawTypeName.split(":");
66782
66781
  if (nameParts.length !== 2) {
66783
66782
  const [schemaName, itemName] = _Metadata_SchemaItem__WEBPACK_IMPORTED_MODULE_2__.SchemaItem.parseFullName(rawTypeName);
@@ -66785,15 +66784,15 @@ class SchemaItemParser {
66785
66784
  return `${this._schema}.${itemName}`;
66786
66785
  return rawTypeName;
66787
66786
  }
66788
- const resolvedName = await this.resolveNameFromAlias(nameParts[0].toLocaleLowerCase());
66787
+ const resolvedName = this.resolveNameFromAlias(nameParts[0].toLocaleLowerCase());
66789
66788
  if (!resolvedName)
66790
66789
  throw new Error(`No valid schema found for alias '${nameParts[0]}'`);
66791
66790
  return `${resolvedName}.${nameParts[1]}`;
66792
66791
  }
66793
- async resolveNameFromAlias(alias) {
66794
- for (const schema of this._context.getKnownSchemas()) {
66795
- if (schema.alias === alias)
66796
- return schema.schemaKey.name;
66792
+ resolveNameFromAlias(alias) {
66793
+ for (const schemaInfo of this._schemaInfos) {
66794
+ if (schemaInfo.alias === alias)
66795
+ return schemaInfo.schemaKey.name;
66797
66796
  }
66798
66797
  return undefined;
66799
66798
  }
@@ -66813,31 +66812,31 @@ class KindOfQuantityParser extends SchemaItemParser {
66813
66812
  async parse(data) {
66814
66813
  const mutableProps = await super.parse(data);
66815
66814
  if (mutableProps.persistenceUnit) {
66816
- mutableProps.persistenceUnit = await this.getQualifiedTypeName(mutableProps.persistenceUnit);
66815
+ mutableProps.persistenceUnit = this.getQualifiedTypeName(mutableProps.persistenceUnit);
66817
66816
  }
66818
- mutableProps.presentationUnits = await this.parsePresentationUnits(mutableProps);
66817
+ mutableProps.presentationUnits = this.parsePresentationUnits(mutableProps);
66819
66818
  return mutableProps;
66820
66819
  }
66821
- async parsePresentationUnits(props) {
66820
+ parsePresentationUnits(props) {
66822
66821
  const presentationUnits = [];
66823
66822
  if (!props.presentationUnits)
66824
66823
  return [];
66825
66824
  for (const presentationUnit of props.presentationUnits) {
66826
66825
  const presFormatOverride = _Metadata_OverrideFormat__WEBPACK_IMPORTED_MODULE_1__.OverrideFormat.parseFormatString(presentationUnit);
66827
- const formatString = await this.createOverrideFormatString(presFormatOverride);
66826
+ const formatString = this.createOverrideFormatString(presFormatOverride);
66828
66827
  presentationUnits.push(formatString);
66829
66828
  }
66830
66829
  ;
66831
66830
  return presentationUnits;
66832
66831
  }
66833
- async createOverrideFormatString(overrideFormatProps) {
66834
- let formatFullName = await this.getQualifiedTypeName(overrideFormatProps.name);
66832
+ createOverrideFormatString(overrideFormatProps) {
66833
+ let formatFullName = this.getQualifiedTypeName(overrideFormatProps.name);
66835
66834
  if (overrideFormatProps.precision)
66836
66835
  formatFullName += `(${overrideFormatProps.precision.toString()})`;
66837
66836
  if (undefined === overrideFormatProps.unitAndLabels)
66838
66837
  return formatFullName;
66839
66838
  for (const [unit, unitLabel] of overrideFormatProps.unitAndLabels) {
66840
- const unitFullName = await this.getQualifiedTypeName(unit);
66839
+ const unitFullName = this.getQualifiedTypeName(unit);
66841
66840
  if (undefined === unitLabel)
66842
66841
  formatFullName += `[${unitFullName}]`;
66843
66842
  else
@@ -66881,10 +66880,10 @@ SELECT
66881
66880
  'name', [koq].[Name],
66882
66881
  'label', [koq].[DisplayLabel],
66883
66882
  'description', [koq].[Description]
66884
- ${singleSchema ? `
66885
66883
  ,'relativeError', [koq].[RelativeError],
66886
- 'persistenceUnit', [koq].[PersistenceUnit],
66887
- 'presentationUnits', (
66884
+ 'persistenceUnit', [koq].[PersistenceUnit]
66885
+ ${singleSchema ? `
66886
+ , 'presentationUnits', (
66888
66887
  SELECT json_group_array(js."value")
66889
66888
  FROM [meta].[KindOfQuantityDef] [koq1], json1.json_each([PresentationUnits]) js
66890
66889
  WHERE [koq1].[ECInstanceId] = [koq].[ECInstanceId]
@@ -67211,14 +67210,14 @@ class SchemaParser {
67211
67210
  * @param context The SchemaContext that will contain the schema and it's references.
67212
67211
  * @returns The corrected SchemaProps JSON.
67213
67212
  */
67214
- static async parse(schema, context) {
67213
+ static async parse(schema, schemaInfos) {
67215
67214
  const props = schema;
67216
67215
  props.$schema = _Constants__WEBPACK_IMPORTED_MODULE_0__.ECSchemaNamespaceUris.SCHEMAURL3_2_JSON,
67217
67216
  props.customAttributes = props.customAttributes ? props.customAttributes.map((attr) => { return parseCustomAttribute(attr); }) : undefined;
67218
67217
  props.label = props.label === null ? undefined : props.label;
67219
67218
  props.description = props.description === null ? undefined : props.description;
67220
67219
  if (props.items) {
67221
- props.items = await this.parseItems(props.items, props.name, context);
67220
+ props.items = await this.parseItems(props.items, props.name, schemaInfos);
67222
67221
  }
67223
67222
  if (!props.customAttributes || props.customAttributes.length === 0)
67224
67223
  delete props.customAttributes;
@@ -67232,46 +67231,46 @@ class SchemaParser {
67232
67231
  * @param context The SchemaContext containing the Schema.
67233
67232
  * @returns The corrected SchemaItemProps.
67234
67233
  */
67235
- static async parseSchemaItems(schemaItems, schemaName, context) {
67234
+ static async parseSchemaItems(schemaItems, schemaName, schemaInfos) {
67236
67235
  const items = [];
67237
67236
  for (const item of schemaItems) {
67238
- const props = await this.parseItem(item, schemaName, context);
67237
+ const props = await this.parseItem(item, schemaName, schemaInfos);
67239
67238
  const cleaned = JSON.parse(JSON.stringify(props, clean));
67240
67239
  items.push(cleaned);
67241
67240
  }
67242
67241
  return items.length > 0 ? items : undefined;
67243
67242
  }
67244
- static async parseItems(schemaItemProps, schemaName, context) {
67243
+ static async parseItems(schemaItemProps, schemaName, schemaInfos) {
67245
67244
  const items = {};
67246
67245
  for (const itemProps of schemaItemProps) {
67247
- const props = await this.parseItem(itemProps, schemaName, context);
67246
+ const props = await this.parseItem(itemProps, schemaName, schemaInfos);
67248
67247
  items[props.name] = props;
67249
67248
  delete props.name;
67250
67249
  }
67251
67250
  return Object.keys(items).length > 0 ? items : undefined;
67252
67251
  }
67253
- static async parseItem(props, schemaName, context) {
67252
+ static async parseItem(props, schemaName, schemaInfos) {
67254
67253
  const schemaItem = "string" === typeof (props) ? JSON.parse(props) : props;
67255
67254
  const type = (0,_ECObjects__WEBPACK_IMPORTED_MODULE_1__.parseSchemaItemType)(schemaItem.schemaItemType);
67256
67255
  switch (type) {
67257
67256
  case _ECObjects__WEBPACK_IMPORTED_MODULE_1__.SchemaItemType.KindOfQuantity:
67258
- const koqParser = new _SchemaItemParsers__WEBPACK_IMPORTED_MODULE_3__.KindOfQuantityParser(schemaName, context);
67257
+ const koqParser = new _SchemaItemParsers__WEBPACK_IMPORTED_MODULE_3__.KindOfQuantityParser(schemaName, schemaInfos);
67259
67258
  return koqParser.parse(schemaItem);
67260
67259
  case _ECObjects__WEBPACK_IMPORTED_MODULE_1__.SchemaItemType.EntityClass:
67261
67260
  case _ECObjects__WEBPACK_IMPORTED_MODULE_1__.SchemaItemType.StructClass:
67262
- const classParser = new _ClassParsers__WEBPACK_IMPORTED_MODULE_2__.ClassParser(schemaName, context);
67261
+ const classParser = new _ClassParsers__WEBPACK_IMPORTED_MODULE_2__.ClassParser(schemaName, schemaInfos);
67263
67262
  return classParser.parse(schemaItem);
67264
67263
  case _ECObjects__WEBPACK_IMPORTED_MODULE_1__.SchemaItemType.RelationshipClass:
67265
- const relationshipParser = new _ClassParsers__WEBPACK_IMPORTED_MODULE_2__.RelationshipClassParser(schemaName, context);
67264
+ const relationshipParser = new _ClassParsers__WEBPACK_IMPORTED_MODULE_2__.RelationshipClassParser(schemaName, schemaInfos);
67266
67265
  return relationshipParser.parse(schemaItem);
67267
67266
  case _ECObjects__WEBPACK_IMPORTED_MODULE_1__.SchemaItemType.Mixin:
67268
- const mixinParser = new _ClassParsers__WEBPACK_IMPORTED_MODULE_2__.MixinParser(schemaName, context);
67267
+ const mixinParser = new _ClassParsers__WEBPACK_IMPORTED_MODULE_2__.MixinParser(schemaName, schemaInfos);
67269
67268
  return mixinParser.parse(schemaItem);
67270
67269
  case _ECObjects__WEBPACK_IMPORTED_MODULE_1__.SchemaItemType.CustomAttributeClass:
67271
- const caParser = new _ClassParsers__WEBPACK_IMPORTED_MODULE_2__.CustomAttributeClassParser(schemaName, context);
67270
+ const caParser = new _ClassParsers__WEBPACK_IMPORTED_MODULE_2__.CustomAttributeClassParser(schemaName, schemaInfos);
67272
67271
  return caParser.parse(schemaItem);
67273
67272
  default:
67274
- const itemParser = new _SchemaItemParsers__WEBPACK_IMPORTED_MODULE_3__.SchemaItemParser(schemaName, context);
67273
+ const itemParser = new _SchemaItemParsers__WEBPACK_IMPORTED_MODULE_3__.SchemaItemParser(schemaName, schemaInfos);
67275
67274
  return itemParser.parse(schemaItem);
67276
67275
  }
67277
67276
  }
@@ -69981,32 +69980,19 @@ class KindOfQuantity extends _SchemaItem__WEBPACK_IMPORTED_MODULE_7__.SchemaItem
69981
69980
  fromJSONSync(kindOfQuantityProps) {
69982
69981
  super.fromJSONSync(kindOfQuantityProps);
69983
69982
  this._relativeError = kindOfQuantityProps.relativeError;
69984
- const persistenceUnit = this.schema.lookupItemSync(kindOfQuantityProps.persistenceUnit);
69985
- if (undefined === persistenceUnit)
69986
- throw new _Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaError(_Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaStatus.InvalidECJson, `The Unit ${kindOfQuantityProps.persistenceUnit} does not exist.`);
69987
- if (!_Unit__WEBPACK_IMPORTED_MODULE_8__.Unit.isUnit(persistenceUnit) && !_InvertedUnit__WEBPACK_IMPORTED_MODULE_5__.InvertedUnit.isInvertedUnit(persistenceUnit))
69988
- throw new _Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaError(_Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaStatus.InvalidECJson, `The item ${kindOfQuantityProps.persistenceUnit} is not a Unit or InvertedUnit.`);
69989
- if (_Unit__WEBPACK_IMPORTED_MODULE_8__.Unit.isUnit(persistenceUnit))
69990
- this._persistenceUnit = new _DelayedPromise__WEBPACK_IMPORTED_MODULE_0__.DelayedPromiseWithProps(persistenceUnit.key, async () => persistenceUnit);
69991
- else
69992
- this._persistenceUnit = new _DelayedPromise__WEBPACK_IMPORTED_MODULE_0__.DelayedPromiseWithProps(persistenceUnit.key, async () => persistenceUnit);
69983
+ const unitItemKey = this.schema.getSchemaItemKey(kindOfQuantityProps.persistenceUnit);
69984
+ this._persistenceUnit = new _DelayedPromise__WEBPACK_IMPORTED_MODULE_0__.DelayedPromiseWithProps(unitItemKey, async () => {
69985
+ const unitItem = await this.schema.lookupItem(unitItemKey, _Unit__WEBPACK_IMPORTED_MODULE_8__.Unit)
69986
+ || await this.schema.lookupItem(unitItemKey, _InvertedUnit__WEBPACK_IMPORTED_MODULE_5__.InvertedUnit);
69987
+ if (undefined === unitItem)
69988
+ throw new _Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaError(_Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaStatus.InvalidECJson, `Unable to locate the unit ${kindOfQuantityProps.persistenceUnit}.`);
69989
+ return unitItem;
69990
+ });
69993
69991
  if (undefined !== kindOfQuantityProps.presentationUnits)
69994
69992
  this.processPresentationUnitsSync(kindOfQuantityProps.presentationUnits);
69995
69993
  }
69996
69994
  async fromJSON(kindOfQuantityProps) {
69997
- await super.fromJSON(kindOfQuantityProps);
69998
- this._relativeError = kindOfQuantityProps.relativeError;
69999
- const persistenceUnit = await this.schema.lookupItem(kindOfQuantityProps.persistenceUnit);
70000
- if (undefined === persistenceUnit)
70001
- throw new _Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaError(_Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaStatus.InvalidECJson, `The Unit ${kindOfQuantityProps.persistenceUnit} does not exist.`);
70002
- if (!_Unit__WEBPACK_IMPORTED_MODULE_8__.Unit.isUnit(persistenceUnit) && !_InvertedUnit__WEBPACK_IMPORTED_MODULE_5__.InvertedUnit.isInvertedUnit(persistenceUnit))
70003
- throw new _Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaError(_Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaStatus.InvalidECJson, `The item ${kindOfQuantityProps.persistenceUnit} is not a Unit or InvertedUnit.`);
70004
- if (_Unit__WEBPACK_IMPORTED_MODULE_8__.Unit.isUnit(persistenceUnit))
70005
- this._persistenceUnit = new _DelayedPromise__WEBPACK_IMPORTED_MODULE_0__.DelayedPromiseWithProps(persistenceUnit.key, async () => persistenceUnit);
70006
- else
70007
- this._persistenceUnit = new _DelayedPromise__WEBPACK_IMPORTED_MODULE_0__.DelayedPromiseWithProps(persistenceUnit.key, async () => persistenceUnit);
70008
- if (undefined !== kindOfQuantityProps.presentationUnits)
70009
- await this.processPresentationUnits(kindOfQuantityProps.presentationUnits);
69995
+ this.fromJSONSync(kindOfQuantityProps);
70010
69996
  }
70011
69997
  /**
70012
69998
  * Used for schema editing.
@@ -318869,7 +318855,7 @@ var loadLanguages = instance.loadLanguages;
318869
318855
  /***/ ((module) => {
318870
318856
 
318871
318857
  "use strict";
318872
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.2.0-dev.15","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/eslint-plugin":"5.2.2-dev.2","@types/chai-as-promised":"^7","@types/sinon":"^17.0.2","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.31.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","sinon":"^17.0.2","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.3.0","@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
318858
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.2.0-dev.16","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/eslint-plugin":"5.2.2-dev.2","@types/chai-as-promised":"^7","@types/sinon":"^17.0.2","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.31.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","sinon":"^17.0.2","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.3.0","@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
318873
318859
 
318874
318860
  /***/ })
318875
318861