@itwin/ecschema-rpcinterface-tests 5.2.0-dev.16 → 5.2.0-dev.18
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/lib/dist/bundled-tests.js +91 -68
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +15 -15
|
@@ -65369,13 +65369,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
65369
65369
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
65370
65370
|
/* harmony export */ ECSqlSchemaLocater: () => (/* binding */ ECSqlSchemaLocater)
|
|
65371
65371
|
/* harmony export */ });
|
|
65372
|
-
/* harmony import */ var
|
|
65373
|
-
/* harmony import */ var
|
|
65374
|
-
/* harmony import */ var
|
|
65375
|
-
/* harmony import */ var
|
|
65376
|
-
/* harmony import */ var
|
|
65377
|
-
/* harmony import */ var
|
|
65378
|
-
/* harmony import */ var
|
|
65372
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
65373
|
+
/* harmony import */ var _ECObjects__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ECObjects */ "../../core/ecschema-metadata/lib/esm/ECObjects.js");
|
|
65374
|
+
/* harmony import */ var _SchemaKey__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../SchemaKey */ "../../core/ecschema-metadata/lib/esm/SchemaKey.js");
|
|
65375
|
+
/* harmony import */ var _FullSchemaQueries__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./FullSchemaQueries */ "../../core/ecschema-metadata/lib/esm/IncrementalLoading/FullSchemaQueries.js");
|
|
65376
|
+
/* harmony import */ var _IncrementalSchemaLocater__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./IncrementalSchemaLocater */ "../../core/ecschema-metadata/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js");
|
|
65377
|
+
/* harmony import */ var _SchemaItemQueries__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SchemaItemQueries */ "../../core/ecschema-metadata/lib/esm/IncrementalLoading/SchemaItemQueries.js");
|
|
65378
|
+
/* harmony import */ var _SchemaParser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SchemaParser */ "../../core/ecschema-metadata/lib/esm/IncrementalLoading/SchemaParser.js");
|
|
65379
|
+
/* harmony import */ var _SchemaStubQueries__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SchemaStubQueries */ "../../core/ecschema-metadata/lib/esm/IncrementalLoading/SchemaStubQueries.js");
|
|
65379
65380
|
/*---------------------------------------------------------------------------------------------
|
|
65380
65381
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
65381
65382
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -65387,12 +65388,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
65387
65388
|
|
|
65388
65389
|
|
|
65389
65390
|
|
|
65391
|
+
|
|
65392
|
+
const LOGGER_CATEGORY = "IncrementalSchemaLoading.Performance";
|
|
65390
65393
|
/**
|
|
65391
65394
|
* An abstract [[IncrementalSchemaLocater]] implementation for loading
|
|
65392
65395
|
* EC [Schema] instances from an iModelDb using ECSql queries.
|
|
65393
65396
|
* @internal
|
|
65394
65397
|
*/
|
|
65395
|
-
class ECSqlSchemaLocater extends
|
|
65398
|
+
class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MODULE_4__.IncrementalSchemaLocater {
|
|
65396
65399
|
/**
|
|
65397
65400
|
* Gets the [[ECSqlSchemaLocaterOptions]] used by this locater.
|
|
65398
65401
|
*/
|
|
@@ -65419,17 +65422,19 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65419
65422
|
// to fetch the whole schema json.
|
|
65420
65423
|
if (!await this.supportPartialSchemaLoading(context))
|
|
65421
65424
|
return this.getSchemaProps(schemaKey);
|
|
65422
|
-
const
|
|
65425
|
+
const queryStart = Date.now();
|
|
65423
65426
|
const schemaProps = this.options.useMultipleQueries
|
|
65424
65427
|
? await this.getFullSchemaMultipleQueries(schemaKey, context)
|
|
65425
65428
|
: await this.getFullSchema(schemaKey, context);
|
|
65426
|
-
|
|
65429
|
+
const queryDuration = Date.now() - queryStart;
|
|
65430
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logTrace(LOGGER_CATEGORY, `Recieved SchemaProps for ${schemaKey.name} in ${queryDuration}ms`, {
|
|
65431
|
+
schemaName: schemaKey.name,
|
|
65432
|
+
queryMode: this.options.useMultipleQueries ? "parallel" : "single",
|
|
65433
|
+
duration: queryDuration,
|
|
65434
|
+
});
|
|
65427
65435
|
return schemaProps;
|
|
65428
65436
|
}
|
|
65429
65437
|
;
|
|
65430
|
-
/**
|
|
65431
|
-
* Gets the [[SchemaProps]] without schemaItems.
|
|
65432
|
-
*/
|
|
65433
65438
|
/**
|
|
65434
65439
|
* Gets the [[SchemaProps]] without schemaItems for the given schema name.
|
|
65435
65440
|
* @param schemaName The name of the Schema.
|
|
@@ -65438,13 +65443,13 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65438
65443
|
* @internal
|
|
65439
65444
|
*/
|
|
65440
65445
|
async getSchemaNoItems(schemaName, context) {
|
|
65441
|
-
const schemaRows = await this.executeQuery(
|
|
65446
|
+
const schemaRows = await this.executeQuery(_FullSchemaQueries__WEBPACK_IMPORTED_MODULE_3__.FullSchemaQueries.schemaNoItemsQuery, { parameters: { schemaName } });
|
|
65442
65447
|
const schemaRow = schemaRows[0];
|
|
65443
65448
|
if (schemaRow === undefined)
|
|
65444
65449
|
return undefined;
|
|
65445
65450
|
const schema = JSON.parse(schemaRow.schema);
|
|
65446
65451
|
const schemaInfos = await this._schemaInfoCache.getSchemasByContext(context) ?? [];
|
|
65447
|
-
return
|
|
65452
|
+
return _SchemaParser__WEBPACK_IMPORTED_MODULE_6__.SchemaParser.parse(schema, schemaInfos);
|
|
65448
65453
|
}
|
|
65449
65454
|
/**
|
|
65450
65455
|
* Checks if the [[SchemaContext]] has the right Meta Schema version to support the incremental schema loading.
|
|
@@ -65452,8 +65457,8 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65452
65457
|
* @returns true if the context has a supported meta schema version, false otherwise.
|
|
65453
65458
|
*/
|
|
65454
65459
|
async supportPartialSchemaLoading(context) {
|
|
65455
|
-
const metaSchemaKey = new
|
|
65456
|
-
const metaSchemaInfo = await context.getSchemaInfo(metaSchemaKey,
|
|
65460
|
+
const metaSchemaKey = new _SchemaKey__WEBPACK_IMPORTED_MODULE_2__.SchemaKey("ECDbMeta", 4, 0, 3);
|
|
65461
|
+
const metaSchemaInfo = await context.getSchemaInfo(metaSchemaKey, _ECObjects__WEBPACK_IMPORTED_MODULE_1__.SchemaMatchType.LatestWriteCompatible);
|
|
65457
65462
|
return metaSchemaInfo !== undefined;
|
|
65458
65463
|
}
|
|
65459
65464
|
;
|
|
@@ -65465,7 +65470,7 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65465
65470
|
* @internal
|
|
65466
65471
|
*/
|
|
65467
65472
|
async getEntities(schema, context, queryOverride) {
|
|
65468
|
-
const query = queryOverride ??
|
|
65473
|
+
const query = queryOverride ?? _FullSchemaQueries__WEBPACK_IMPORTED_MODULE_3__.FullSchemaQueries.entityQuery;
|
|
65469
65474
|
return this.querySchemaItem(context, schema, query, "EntityClass");
|
|
65470
65475
|
}
|
|
65471
65476
|
/**
|
|
@@ -65476,7 +65481,7 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65476
65481
|
* @internal
|
|
65477
65482
|
*/
|
|
65478
65483
|
async getMixins(schema, context, queryOverride) {
|
|
65479
|
-
const query = queryOverride ??
|
|
65484
|
+
const query = queryOverride ?? _FullSchemaQueries__WEBPACK_IMPORTED_MODULE_3__.FullSchemaQueries.mixinQuery;
|
|
65480
65485
|
return this.querySchemaItem(context, schema, query, "Mixin");
|
|
65481
65486
|
}
|
|
65482
65487
|
/**
|
|
@@ -65487,7 +65492,7 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65487
65492
|
* @internal
|
|
65488
65493
|
*/
|
|
65489
65494
|
async getRelationships(schema, context, queryOverride) {
|
|
65490
|
-
const query = queryOverride ??
|
|
65495
|
+
const query = queryOverride ?? _FullSchemaQueries__WEBPACK_IMPORTED_MODULE_3__.FullSchemaQueries.relationshipClassQuery;
|
|
65491
65496
|
return this.querySchemaItem(context, schema, query, "RelationshipClass");
|
|
65492
65497
|
}
|
|
65493
65498
|
/**
|
|
@@ -65498,7 +65503,7 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65498
65503
|
* @internal
|
|
65499
65504
|
*/
|
|
65500
65505
|
async getCustomAttributeClasses(schema, context, queryOverride) {
|
|
65501
|
-
const query = queryOverride ??
|
|
65506
|
+
const query = queryOverride ?? _FullSchemaQueries__WEBPACK_IMPORTED_MODULE_3__.FullSchemaQueries.customAttributeQuery;
|
|
65502
65507
|
return this.querySchemaItem(context, schema, query, "CustomAttributeClass");
|
|
65503
65508
|
}
|
|
65504
65509
|
/**
|
|
@@ -65509,7 +65514,7 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65509
65514
|
* @internal
|
|
65510
65515
|
*/
|
|
65511
65516
|
async getStructs(schema, context, queryOverride) {
|
|
65512
|
-
const query = queryOverride ??
|
|
65517
|
+
const query = queryOverride ?? _FullSchemaQueries__WEBPACK_IMPORTED_MODULE_3__.FullSchemaQueries.structQuery;
|
|
65513
65518
|
return this.querySchemaItem(context, schema, query, "StructClass");
|
|
65514
65519
|
}
|
|
65515
65520
|
/**
|
|
@@ -65520,7 +65525,7 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65520
65525
|
* @internal
|
|
65521
65526
|
*/
|
|
65522
65527
|
async getKindOfQuantities(schema, context) {
|
|
65523
|
-
return this.querySchemaItem(context, schema,
|
|
65528
|
+
return this.querySchemaItem(context, schema, _SchemaItemQueries__WEBPACK_IMPORTED_MODULE_5__.SchemaItemQueries.kindOfQuantity(true), "KindOfQuantity");
|
|
65524
65529
|
}
|
|
65525
65530
|
/**
|
|
65526
65531
|
* Gets all the Schema's PropertyCategory items as [[PropertyCategoryProps]] JSON objects.
|
|
@@ -65530,7 +65535,7 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65530
65535
|
* @internal
|
|
65531
65536
|
*/
|
|
65532
65537
|
async getPropertyCategories(schema, context) {
|
|
65533
|
-
return this.querySchemaItem(context, schema,
|
|
65538
|
+
return this.querySchemaItem(context, schema, _SchemaItemQueries__WEBPACK_IMPORTED_MODULE_5__.SchemaItemQueries.propertyCategory(true), "PropertyCategory");
|
|
65534
65539
|
}
|
|
65535
65540
|
/**
|
|
65536
65541
|
* Gets all the Schema's Enumeration items as [[EnumerationProps]] JSON objects.
|
|
@@ -65540,7 +65545,7 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65540
65545
|
* @internal
|
|
65541
65546
|
*/
|
|
65542
65547
|
async getEnumerations(schema, context) {
|
|
65543
|
-
return this.querySchemaItem(context, schema,
|
|
65548
|
+
return this.querySchemaItem(context, schema, _SchemaItemQueries__WEBPACK_IMPORTED_MODULE_5__.SchemaItemQueries.enumeration(true), "Enumeration");
|
|
65544
65549
|
}
|
|
65545
65550
|
/**
|
|
65546
65551
|
* Gets all the Schema's Unit items as [[SchemaItemUnitProps]] JSON objects.
|
|
@@ -65550,7 +65555,7 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65550
65555
|
* @internal
|
|
65551
65556
|
*/
|
|
65552
65557
|
async getUnits(schema, context) {
|
|
65553
|
-
return this.querySchemaItem(context, schema,
|
|
65558
|
+
return this.querySchemaItem(context, schema, _SchemaItemQueries__WEBPACK_IMPORTED_MODULE_5__.SchemaItemQueries.unit(true), "Unit");
|
|
65554
65559
|
}
|
|
65555
65560
|
/**
|
|
65556
65561
|
* Gets all the Schema's InvertedUnit items as [[InvertedUnitProps]] JSON objects.
|
|
@@ -65560,7 +65565,7 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65560
65565
|
* @internal
|
|
65561
65566
|
*/
|
|
65562
65567
|
async getInvertedUnits(schema, context) {
|
|
65563
|
-
return this.querySchemaItem(context, schema,
|
|
65568
|
+
return this.querySchemaItem(context, schema, _SchemaItemQueries__WEBPACK_IMPORTED_MODULE_5__.SchemaItemQueries.invertedUnit(true), "InvertedUnit");
|
|
65564
65569
|
}
|
|
65565
65570
|
/**
|
|
65566
65571
|
* Gets all the Schema's Constant items as [[ConstantProps]] JSON objects.
|
|
@@ -65570,7 +65575,7 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65570
65575
|
* @internal
|
|
65571
65576
|
*/
|
|
65572
65577
|
async getConstants(schema, context) {
|
|
65573
|
-
return this.querySchemaItem(context, schema,
|
|
65578
|
+
return this.querySchemaItem(context, schema, _SchemaItemQueries__WEBPACK_IMPORTED_MODULE_5__.SchemaItemQueries.constant(true), "Constant");
|
|
65574
65579
|
}
|
|
65575
65580
|
/**
|
|
65576
65581
|
* Gets all the Schema's UnitSystem items as [[UnitSystemProps]] JSON objects.
|
|
@@ -65580,7 +65585,7 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65580
65585
|
* @internal
|
|
65581
65586
|
*/
|
|
65582
65587
|
async getUnitSystems(schema, context) {
|
|
65583
|
-
return this.querySchemaItem(context, schema,
|
|
65588
|
+
return this.querySchemaItem(context, schema, _SchemaItemQueries__WEBPACK_IMPORTED_MODULE_5__.SchemaItemQueries.unitSystem(true), "UnitSystem");
|
|
65584
65589
|
}
|
|
65585
65590
|
/**
|
|
65586
65591
|
* Gets all the Schema's Phenomenon items as [[PhenomenonProps]] JSON objects.
|
|
@@ -65590,7 +65595,7 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65590
65595
|
* @internal
|
|
65591
65596
|
*/
|
|
65592
65597
|
async getPhenomenon(schema, context) {
|
|
65593
|
-
return this.querySchemaItem(context, schema,
|
|
65598
|
+
return this.querySchemaItem(context, schema, _SchemaItemQueries__WEBPACK_IMPORTED_MODULE_5__.SchemaItemQueries.phenomenon(true), "Phenomenon");
|
|
65594
65599
|
}
|
|
65595
65600
|
/**
|
|
65596
65601
|
* Gets all the Schema's Format items as [[SchemaItemFormatProps]] JSON objects.
|
|
@@ -65600,17 +65605,17 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65600
65605
|
* @internal
|
|
65601
65606
|
*/
|
|
65602
65607
|
async getFormats(schema, context) {
|
|
65603
|
-
return this.querySchemaItem(context, schema,
|
|
65608
|
+
return this.querySchemaItem(context, schema, _SchemaItemQueries__WEBPACK_IMPORTED_MODULE_5__.SchemaItemQueries.format(true), "Format");
|
|
65604
65609
|
}
|
|
65605
65610
|
/**
|
|
65606
65611
|
* Gets [[SchemaInfo]] objects for all schemas including their direct schema references.
|
|
65607
65612
|
* @internal
|
|
65608
65613
|
*/
|
|
65609
65614
|
async loadSchemaInfos() {
|
|
65610
|
-
const schemaRows = await this.executeQuery(
|
|
65615
|
+
const schemaRows = await this.executeQuery(_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_7__.ecsqlQueries.schemaInfoQuery);
|
|
65611
65616
|
return schemaRows.map((schemaRow) => ({
|
|
65612
65617
|
alias: schemaRow.alias,
|
|
65613
|
-
schemaKey:
|
|
65618
|
+
schemaKey: _SchemaKey__WEBPACK_IMPORTED_MODULE_2__.SchemaKey.parseString(`${schemaRow.name}.${schemaRow.version}`),
|
|
65614
65619
|
references: Array.from(JSON.parse(schemaRow.references), parseSchemaReference),
|
|
65615
65620
|
}));
|
|
65616
65621
|
}
|
|
@@ -65622,12 +65627,16 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65622
65627
|
* @internal
|
|
65623
65628
|
*/
|
|
65624
65629
|
async getSchemaPartials(schemaKey, context) {
|
|
65625
|
-
const
|
|
65626
|
-
const [schemaRow] = await this.executeQuery(
|
|
65630
|
+
const queryStart = Date.now();
|
|
65631
|
+
const [schemaRow] = await this.executeQuery(_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_7__.ecsqlQueries.schemaStubQuery, {
|
|
65627
65632
|
parameters: { schemaName: schemaKey.name },
|
|
65628
65633
|
limit: 1
|
|
65629
65634
|
});
|
|
65630
|
-
|
|
65635
|
+
const queryDuration = Date.now() - queryStart;
|
|
65636
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logTrace(LOGGER_CATEGORY, `Recieved PartialSchema for ${schemaKey.name} in ${queryDuration}ms`, {
|
|
65637
|
+
schemaName: schemaKey.name,
|
|
65638
|
+
duration: queryDuration,
|
|
65639
|
+
});
|
|
65631
65640
|
if (!schemaRow)
|
|
65632
65641
|
return undefined;
|
|
65633
65642
|
const schemaPartials = [];
|
|
@@ -65637,7 +65646,7 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65637
65646
|
if (stub.references) {
|
|
65638
65647
|
for (const referenceProps of stub.references) {
|
|
65639
65648
|
if (!schemaPartials.some((schema) => schema.name === referenceProps.name)) {
|
|
65640
|
-
await addSchema(
|
|
65649
|
+
await addSchema(_SchemaKey__WEBPACK_IMPORTED_MODULE_2__.SchemaKey.parseString(`${referenceProps.name}.${referenceProps.version}`));
|
|
65641
65650
|
}
|
|
65642
65651
|
}
|
|
65643
65652
|
}
|
|
@@ -65646,13 +65655,14 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65646
65655
|
const addItems = async (schemaName, itemInfo) => {
|
|
65647
65656
|
let schemaStub = schemaPartials.find((schema) => schema.name === schemaName);
|
|
65648
65657
|
if (!schemaStub) {
|
|
65649
|
-
schemaStub = await addSchema(
|
|
65658
|
+
schemaStub = await addSchema(_SchemaKey__WEBPACK_IMPORTED_MODULE_2__.SchemaKey.parseString(`${schemaName}.0.0.0`));
|
|
65650
65659
|
}
|
|
65651
|
-
|
|
65652
|
-
|
|
65660
|
+
let items = schemaStub.items;
|
|
65661
|
+
if (!items) {
|
|
65662
|
+
Object.assign(schemaStub, items = { items: {} });
|
|
65653
65663
|
}
|
|
65654
|
-
const existingItem =
|
|
65655
|
-
Object.assign(
|
|
65664
|
+
const existingItem = items[itemInfo.name] || {};
|
|
65665
|
+
Object.assign(items, { [itemInfo.name]: Object.assign(existingItem, itemInfo) });
|
|
65656
65666
|
};
|
|
65657
65667
|
const reviver = (_key, value) => {
|
|
65658
65668
|
if (value === null) {
|
|
@@ -65668,17 +65678,23 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65668
65678
|
async querySchemaItem(context, schemaName, query, schemaType) {
|
|
65669
65679
|
const start = Date.now();
|
|
65670
65680
|
const itemRows = await this.executeQuery(query, { parameters: { schemaName } });
|
|
65671
|
-
|
|
65681
|
+
const queryDuration = Date.now() - start;
|
|
65682
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logTrace(LOGGER_CATEGORY, `Recieved rows of ${schemaType} items for ${schemaName} in ${queryDuration}ms`, {
|
|
65683
|
+
schemaName,
|
|
65684
|
+
itemCount: itemRows.length,
|
|
65685
|
+
itemType: schemaType,
|
|
65686
|
+
duration: queryDuration,
|
|
65687
|
+
});
|
|
65672
65688
|
if (itemRows.length === 0)
|
|
65673
65689
|
return [];
|
|
65674
65690
|
const items = itemRows.map((itemRow) => {
|
|
65675
65691
|
return "string" === typeof itemRow.item ? JSON.parse(itemRow.item) : itemRow.item;
|
|
65676
65692
|
});
|
|
65677
65693
|
const schemaInfos = await this._schemaInfoCache.getSchemasByContext(context) ?? [];
|
|
65678
|
-
return await
|
|
65694
|
+
return await _SchemaParser__WEBPACK_IMPORTED_MODULE_6__.SchemaParser.parseSchemaItems(items, schemaName, schemaInfos) ?? [];
|
|
65679
65695
|
}
|
|
65680
65696
|
async getFullSchema(schemaKey, context) {
|
|
65681
|
-
const schemaRows = await this.executeQuery(
|
|
65697
|
+
const schemaRows = await this.executeQuery(_FullSchemaQueries__WEBPACK_IMPORTED_MODULE_3__.FullSchemaQueries.schemaQuery, { parameters: { schemaName: schemaKey.name } });
|
|
65682
65698
|
const schemaRow = schemaRows[0];
|
|
65683
65699
|
if (schemaRow === undefined)
|
|
65684
65700
|
return undefined;
|
|
@@ -65688,13 +65704,13 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65688
65704
|
schema.items = schema.items.map((itemRow) => { return itemRow.item; });
|
|
65689
65705
|
}
|
|
65690
65706
|
const schemaInfos = await this._schemaInfoCache.getSchemasByContext(context) ?? [];
|
|
65691
|
-
return
|
|
65707
|
+
return _SchemaParser__WEBPACK_IMPORTED_MODULE_6__.SchemaParser.parse(schema, schemaInfos);
|
|
65692
65708
|
}
|
|
65693
65709
|
async getFullSchemaMultipleQueries(schemaKey, context) {
|
|
65694
65710
|
const schema = await this.getSchemaNoItems(schemaKey.name, context);
|
|
65695
65711
|
if (!schema)
|
|
65696
65712
|
return undefined;
|
|
65697
|
-
schema.items = {};
|
|
65713
|
+
const items = schema.items || (schema.items = {});
|
|
65698
65714
|
await Promise.all([
|
|
65699
65715
|
this.getEntities(schemaKey.name, context),
|
|
65700
65716
|
this.getMixins(schemaKey.name, context),
|
|
@@ -65711,16 +65727,21 @@ class ECSqlSchemaLocater extends _IncrementalSchemaLocater__WEBPACK_IMPORTED_MOD
|
|
|
65711
65727
|
this.getPhenomenon(schemaKey.name, context),
|
|
65712
65728
|
this.getFormats(schemaKey.name, context)
|
|
65713
65729
|
]).then((itemResults) => {
|
|
65714
|
-
const flatItemList = itemResults.reduce((acc,
|
|
65730
|
+
const flatItemList = itemResults.reduce((acc, result) => acc.concat(result));
|
|
65715
65731
|
flatItemList.forEach((schemaItem) => {
|
|
65716
|
-
|
|
65732
|
+
if (!schemaItem.name) {
|
|
65733
|
+
// This should never be happen, as we query the schema items by name from the database, but since the SchemaProps
|
|
65734
|
+
// have name optional, we need the check here to make the compiler happy.
|
|
65735
|
+
throw new Error(`SchemaItem with no name encountered in schema ${schemaKey.name}`);
|
|
65736
|
+
}
|
|
65737
|
+
items[schemaItem.name] = schemaItem;
|
|
65717
65738
|
});
|
|
65718
65739
|
});
|
|
65719
65740
|
return schema;
|
|
65720
65741
|
}
|
|
65721
65742
|
}
|
|
65722
65743
|
function parseSchemaReference(referenceName) {
|
|
65723
|
-
return { schemaKey:
|
|
65744
|
+
return { schemaKey: _SchemaKey__WEBPACK_IMPORTED_MODULE_2__.SchemaKey.parseString(referenceName) };
|
|
65724
65745
|
}
|
|
65725
65746
|
async function parseSchemaItemStubs(schemaName, itemRows, addItemsHandler, schemaInfos) {
|
|
65726
65747
|
if (!itemRows || itemRows.length === 0) {
|
|
@@ -65733,32 +65754,32 @@ async function parseSchemaItemStubs(schemaName, itemRows, addItemsHandler, schem
|
|
|
65733
65754
|
const currentItem = baseClasses[index--];
|
|
65734
65755
|
const baseClassItem = baseClasses[index];
|
|
65735
65756
|
const baseClassName = baseClassItem ? `${baseClassItem.schema}.${baseClassItem.name}` : undefined;
|
|
65736
|
-
const schemaItem = await
|
|
65757
|
+
const schemaItem = await _SchemaParser__WEBPACK_IMPORTED_MODULE_6__.SchemaParser.parseItem(currentItem, currentItem.schema, schemaInfos);
|
|
65737
65758
|
await addItemsHandler(currentItem.schema, {
|
|
65738
65759
|
...schemaItem,
|
|
65739
65760
|
name: schemaItem.name,
|
|
65740
|
-
schemaItemType:
|
|
65761
|
+
schemaItemType: schemaItem.schemaItemType,
|
|
65741
65762
|
baseClass: baseClassName,
|
|
65742
65763
|
});
|
|
65743
65764
|
}
|
|
65744
65765
|
};
|
|
65745
65766
|
for (const itemRow of itemRows) {
|
|
65746
|
-
const schemaItem = await
|
|
65767
|
+
const schemaItem = await _SchemaParser__WEBPACK_IMPORTED_MODULE_6__.SchemaParser.parseItem(itemRow, schemaName, schemaInfos);
|
|
65747
65768
|
await addItemsHandler(schemaName, {
|
|
65748
65769
|
...schemaItem,
|
|
65749
65770
|
name: schemaItem.name,
|
|
65750
|
-
schemaItemType:
|
|
65771
|
+
schemaItemType: schemaItem.schemaItemType,
|
|
65751
65772
|
mixins: itemRow.mixins
|
|
65752
65773
|
? itemRow.mixins.map(mixin => { return `${mixin.schema}.${mixin.name}`; })
|
|
65753
65774
|
: undefined,
|
|
65754
65775
|
});
|
|
65755
65776
|
await parseBaseClasses(itemRow.baseClasses);
|
|
65756
65777
|
for (const mixinRow of itemRow.mixins || []) {
|
|
65757
|
-
const mixinItem = await
|
|
65778
|
+
const mixinItem = await _SchemaParser__WEBPACK_IMPORTED_MODULE_6__.SchemaParser.parseItem(mixinRow, mixinRow.schema, schemaInfos);
|
|
65758
65779
|
await addItemsHandler(mixinRow.schema, {
|
|
65759
65780
|
...mixinItem,
|
|
65760
65781
|
name: mixinItem.name,
|
|
65761
|
-
schemaItemType:
|
|
65782
|
+
schemaItemType: mixinItem.schemaItemType,
|
|
65762
65783
|
});
|
|
65763
65784
|
await parseBaseClasses(mixinRow.baseClasses);
|
|
65764
65785
|
}
|
|
@@ -66497,6 +66518,8 @@ class IncrementalSchemaLocater {
|
|
|
66497
66518
|
// to fetch the whole schema json.
|
|
66498
66519
|
if (!await this.supportPartialSchemaLoading(schemaContext)) {
|
|
66499
66520
|
const schemaJson = await this.getSchemaJson(schemaInfo.schemaKey, schemaContext);
|
|
66521
|
+
if (schemaJson === undefined)
|
|
66522
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaError(_Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaStatus.UnableToLocateSchema, `Could not locate the schema, ${schemaInfo.schemaKey.name}.${schemaInfo.schemaKey.version.toString()}`);
|
|
66500
66523
|
return _Metadata_Schema__WEBPACK_IMPORTED_MODULE_4__.Schema.fromJson(schemaJson, schemaContext);
|
|
66501
66524
|
}
|
|
66502
66525
|
// Fetches the schema partials for the given schema key. The first item in the array is the
|
|
@@ -66527,18 +66550,17 @@ class IncrementalSchemaLocater {
|
|
|
66527
66550
|
const schemaInfo = await schemaContext.getSchemaInfo(schemaKey, _ECObjects__WEBPACK_IMPORTED_MODULE_2__.SchemaMatchType.Latest);
|
|
66528
66551
|
if (!schemaInfo)
|
|
66529
66552
|
throw new Error(`Schema ${schemaKey.name} could not be found.`);
|
|
66553
|
+
const schemaReferences = [];
|
|
66530
66554
|
const schemaProps = {
|
|
66531
66555
|
$schema: _Constants__WEBPACK_IMPORTED_MODULE_0__.ECSchemaNamespaceUris.SCHEMAURL3_2_JSON,
|
|
66532
66556
|
name: schemaKey.name,
|
|
66533
66557
|
alias: schemaInfo.alias,
|
|
66534
66558
|
version: schemaInfo.schemaKey.version.toString(),
|
|
66535
|
-
references:
|
|
66559
|
+
references: schemaReferences,
|
|
66536
66560
|
items: {}
|
|
66537
66561
|
};
|
|
66538
|
-
if (!schemaProps.references)
|
|
66539
|
-
throw new Error(`Schema references is undefined for the Schema ${schemaInfo.schemaKey.name}`);
|
|
66540
66562
|
schemaInfo.references.forEach((ref) => {
|
|
66541
|
-
|
|
66563
|
+
schemaReferences.push({ name: ref.schemaKey.name, version: ref.schemaKey.version.toString() });
|
|
66542
66564
|
});
|
|
66543
66565
|
return schemaProps;
|
|
66544
66566
|
}
|
|
@@ -66700,6 +66722,7 @@ class IncrementalSchemaReader extends _Deserialization_Helper__WEBPACK_IMPORTED_
|
|
|
66700
66722
|
if (schemaItem.loadingController === undefined) {
|
|
66701
66723
|
const controller = new _utils_SchemaLoadingController__WEBPACK_IMPORTED_MODULE_4__.SchemaLoadingController();
|
|
66702
66724
|
schemaItem.setLoadingController(controller);
|
|
66725
|
+
return this.schemaItemLoading(schemaItem);
|
|
66703
66726
|
}
|
|
66704
66727
|
if (_Metadata_Class__WEBPACK_IMPORTED_MODULE_3__.ECClass.isECClass(schemaItem)
|
|
66705
66728
|
|| schemaItem.schemaItemType === _ECObjects__WEBPACK_IMPORTED_MODULE_2__.SchemaItemType.KindOfQuantity
|
|
@@ -67255,23 +67278,23 @@ class SchemaParser {
|
|
|
67255
67278
|
switch (type) {
|
|
67256
67279
|
case _ECObjects__WEBPACK_IMPORTED_MODULE_1__.SchemaItemType.KindOfQuantity:
|
|
67257
67280
|
const koqParser = new _SchemaItemParsers__WEBPACK_IMPORTED_MODULE_3__.KindOfQuantityParser(schemaName, schemaInfos);
|
|
67258
|
-
return koqParser.parse(schemaItem);
|
|
67281
|
+
return await koqParser.parse(schemaItem);
|
|
67259
67282
|
case _ECObjects__WEBPACK_IMPORTED_MODULE_1__.SchemaItemType.EntityClass:
|
|
67260
67283
|
case _ECObjects__WEBPACK_IMPORTED_MODULE_1__.SchemaItemType.StructClass:
|
|
67261
67284
|
const classParser = new _ClassParsers__WEBPACK_IMPORTED_MODULE_2__.ClassParser(schemaName, schemaInfos);
|
|
67262
|
-
return classParser.parse(schemaItem);
|
|
67285
|
+
return await classParser.parse(schemaItem);
|
|
67263
67286
|
case _ECObjects__WEBPACK_IMPORTED_MODULE_1__.SchemaItemType.RelationshipClass:
|
|
67264
67287
|
const relationshipParser = new _ClassParsers__WEBPACK_IMPORTED_MODULE_2__.RelationshipClassParser(schemaName, schemaInfos);
|
|
67265
|
-
return relationshipParser.parse(schemaItem);
|
|
67288
|
+
return await relationshipParser.parse(schemaItem);
|
|
67266
67289
|
case _ECObjects__WEBPACK_IMPORTED_MODULE_1__.SchemaItemType.Mixin:
|
|
67267
67290
|
const mixinParser = new _ClassParsers__WEBPACK_IMPORTED_MODULE_2__.MixinParser(schemaName, schemaInfos);
|
|
67268
|
-
return mixinParser.parse(schemaItem);
|
|
67291
|
+
return await mixinParser.parse(schemaItem);
|
|
67269
67292
|
case _ECObjects__WEBPACK_IMPORTED_MODULE_1__.SchemaItemType.CustomAttributeClass:
|
|
67270
67293
|
const caParser = new _ClassParsers__WEBPACK_IMPORTED_MODULE_2__.CustomAttributeClassParser(schemaName, schemaInfos);
|
|
67271
|
-
return caParser.parse(schemaItem);
|
|
67294
|
+
return await caParser.parse(schemaItem);
|
|
67272
67295
|
default:
|
|
67273
67296
|
const itemParser = new _SchemaItemParsers__WEBPACK_IMPORTED_MODULE_3__.SchemaItemParser(schemaName, schemaInfos);
|
|
67274
|
-
return itemParser.parse(schemaItem);
|
|
67297
|
+
return await itemParser.parse(schemaItem);
|
|
67275
67298
|
}
|
|
67276
67299
|
}
|
|
67277
67300
|
}
|
|
@@ -69077,7 +69100,7 @@ async function createNavigationProperty(ecClass, name, relationship, direction)
|
|
|
69077
69100
|
}
|
|
69078
69101
|
/** @internal */
|
|
69079
69102
|
function createNavigationPropertySync(ecClass, name, relationship, direction) {
|
|
69080
|
-
if (ecClass.getPropertySync(name))
|
|
69103
|
+
if (ecClass.getPropertySync(name, true))
|
|
69081
69104
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaError(_Exception__WEBPACK_IMPORTED_MODULE_3__.ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${ecClass.name}.`);
|
|
69082
69105
|
let resolvedRelationship;
|
|
69083
69106
|
if (typeof (relationship) === "string") {
|
|
@@ -318855,7 +318878,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
318855
318878
|
/***/ ((module) => {
|
|
318856
318879
|
|
|
318857
318880
|
"use strict";
|
|
318858
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.2.0-dev.
|
|
318881
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.2.0-dev.18","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"}}');
|
|
318859
318882
|
|
|
318860
318883
|
/***/ })
|
|
318861
318884
|
|