@itwin/ecschema-rpcinterface-tests 4.10.0-dev.37 → 4.10.0-dev.39
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/_bea9.bundled-tests.js.map +1 -1
- package/lib/dist/bundled-tests.js +363 -207
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_3_1_6_node_modules_loaders_gl_draco_di-0642a6.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_meshoptimizer_0_20_0_node_modules_meshoptimizer_index_m-a5ae61.bundled-tests.js.map +1 -1
- package/package.json +16 -16
|
@@ -61440,11 +61440,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
61440
61440
|
/* harmony import */ var _Context__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Context */ "../../core/ecschema-metadata/lib/esm/Context.js");
|
|
61441
61441
|
/* harmony import */ var _ECObjects__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ECObjects */ "../../core/ecschema-metadata/lib/esm/ECObjects.js");
|
|
61442
61442
|
/* harmony import */ var _Exception__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Exception */ "../../core/ecschema-metadata/lib/esm/Exception.js");
|
|
61443
|
-
/* harmony import */ var
|
|
61444
|
-
/* harmony import */ var
|
|
61445
|
-
/* harmony import */ var
|
|
61446
|
-
/* harmony import */ var
|
|
61447
|
-
/* harmony import */ var
|
|
61443
|
+
/* harmony import */ var _Metadata_Schema__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Metadata/Schema */ "../../core/ecschema-metadata/lib/esm/Metadata/Schema.js");
|
|
61444
|
+
/* harmony import */ var _Metadata_SchemaItem__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Metadata/SchemaItem */ "../../core/ecschema-metadata/lib/esm/Metadata/SchemaItem.js");
|
|
61445
|
+
/* harmony import */ var _SchemaKey__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../SchemaKey */ "../../core/ecschema-metadata/lib/esm/SchemaKey.js");
|
|
61446
|
+
/* harmony import */ var _SchemaPartVisitorDelegate__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../SchemaPartVisitorDelegate */ "../../core/ecschema-metadata/lib/esm/SchemaPartVisitorDelegate.js");
|
|
61447
|
+
/* harmony import */ var _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @itwin/core-quantity */ "../../core/quantity/lib/esm/core-quantity.js");
|
|
61448
|
+
/* harmony import */ var _utils_SchemaGraph__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/SchemaGraph */ "../../core/ecschema-metadata/lib/esm/utils/SchemaGraph.js");
|
|
61448
61449
|
/*---------------------------------------------------------------------------------------------
|
|
61449
61450
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
61450
61451
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -61457,6 +61458,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
61457
61458
|
|
|
61458
61459
|
|
|
61459
61460
|
|
|
61461
|
+
|
|
61460
61462
|
/**
|
|
61461
61463
|
* This class properly handles the order the deserialization of ECSchemas and SchemaItems from serialized formats.
|
|
61462
61464
|
* For example, when deserializing an ECClass most times all base class should be de-serialized before the given class.
|
|
@@ -61465,7 +61467,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
61465
61467
|
class SchemaReadHelper {
|
|
61466
61468
|
constructor(parserType, context, visitor) {
|
|
61467
61469
|
this._context = (undefined !== context) ? context : new _Context__WEBPACK_IMPORTED_MODULE_0__.SchemaContext();
|
|
61468
|
-
this._visitorHelper = visitor ? new
|
|
61470
|
+
this._visitorHelper = visitor ? new _SchemaPartVisitorDelegate__WEBPACK_IMPORTED_MODULE_6__.SchemaPartVisitorDelegate(visitor) : undefined;
|
|
61469
61471
|
this._parserType = parserType;
|
|
61470
61472
|
}
|
|
61471
61473
|
/**
|
|
@@ -61490,7 +61492,7 @@ class SchemaReadHelper {
|
|
|
61490
61492
|
this._schema = schema;
|
|
61491
61493
|
const schemaInfo = { schemaKey: schema.schemaKey, references: [] };
|
|
61492
61494
|
for (const reference of this._parser.getReferences()) {
|
|
61493
|
-
const refKey = new
|
|
61495
|
+
const refKey = new _SchemaKey__WEBPACK_IMPORTED_MODULE_5__.SchemaKey(reference.name, _SchemaKey__WEBPACK_IMPORTED_MODULE_5__.ECVersion.fromString(reference.version));
|
|
61494
61496
|
schemaInfo.references.push({ schemaKey: refKey });
|
|
61495
61497
|
}
|
|
61496
61498
|
this._schemaInfo = schemaInfo;
|
|
@@ -61517,7 +61519,7 @@ class SchemaReadHelper {
|
|
|
61517
61519
|
/* Finish loading the rest of the schema */
|
|
61518
61520
|
async loadSchema(schemaInfo, schema) {
|
|
61519
61521
|
// Verify that there are no schema reference cycles, this will start schema loading by loading their headers
|
|
61520
|
-
(await
|
|
61522
|
+
(await _utils_SchemaGraph__WEBPACK_IMPORTED_MODULE_8__.SchemaGraph.generateGraph(schemaInfo, this._context)).throwIfCycles();
|
|
61521
61523
|
for (const reference of schemaInfo.references) {
|
|
61522
61524
|
await this.loadSchemaReference(schemaInfo, reference.schemaKey);
|
|
61523
61525
|
}
|
|
@@ -61598,12 +61600,12 @@ class SchemaReadHelper {
|
|
|
61598
61600
|
* @param ref The object to read the SchemaReference's props from.
|
|
61599
61601
|
*/
|
|
61600
61602
|
loadSchemaReferenceSync(ref) {
|
|
61601
|
-
const schemaKey = new
|
|
61603
|
+
const schemaKey = new _SchemaKey__WEBPACK_IMPORTED_MODULE_5__.SchemaKey(ref.name, _SchemaKey__WEBPACK_IMPORTED_MODULE_5__.ECVersion.fromString(ref.version));
|
|
61602
61604
|
const refSchema = this._context.getSchemaSync(schemaKey, _ECObjects__WEBPACK_IMPORTED_MODULE_1__.SchemaMatchType.LatestWriteCompatible);
|
|
61603
61605
|
if (!refSchema)
|
|
61604
61606
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.UnableToLocateSchema, `Could not locate the referenced schema, ${ref.name}.${ref.version}, of ${this._schema.schemaKey.name}`);
|
|
61605
61607
|
this._schema.addReferenceSync(refSchema);
|
|
61606
|
-
|
|
61608
|
+
_utils_SchemaGraph__WEBPACK_IMPORTED_MODULE_8__.SchemaGraph.generateGraphSync(this._schema).throwIfCycles();
|
|
61607
61609
|
const results = this.validateSchemaReferences(this._schema);
|
|
61608
61610
|
let errorMessage = "";
|
|
61609
61611
|
for (const result of results) {
|
|
@@ -61791,7 +61793,7 @@ class SchemaReadHelper {
|
|
|
61791
61793
|
* @param schema The schema that will be used to lookup the schema name by alias, if necessary.
|
|
61792
61794
|
*/
|
|
61793
61795
|
static resolveSchemaAndItemName(fullOrQualifiedName, schema) {
|
|
61794
|
-
const [schemaName, itemName] =
|
|
61796
|
+
const [schemaName, itemName] = _Metadata_SchemaItem__WEBPACK_IMPORTED_MODULE_4__.SchemaItem.parseFullName(fullOrQualifiedName);
|
|
61795
61797
|
// If a schema is provided we attempt to resolve the alias by looking at the reference schemas.
|
|
61796
61798
|
if (undefined !== schema && -1 !== fullOrQualifiedName.indexOf(":")) {
|
|
61797
61799
|
const refName = schema.getReferenceNameByAlias(schemaName);
|
|
@@ -61832,7 +61834,7 @@ class SchemaReadHelper {
|
|
|
61832
61834
|
}
|
|
61833
61835
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidECJson, `Unable to locate SchemaItem ${name}.`);
|
|
61834
61836
|
}
|
|
61835
|
-
schemaItem = await this._context.getSchemaItem(new
|
|
61837
|
+
schemaItem = await this._context.getSchemaItem(new _SchemaKey__WEBPACK_IMPORTED_MODULE_5__.SchemaItemKey(itemName, new _SchemaKey__WEBPACK_IMPORTED_MODULE_5__.SchemaKey(schemaName)));
|
|
61836
61838
|
if (undefined === schemaItem)
|
|
61837
61839
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidECJson, `Unable to locate SchemaItem ${name}.`);
|
|
61838
61840
|
return schemaItem;
|
|
@@ -61865,7 +61867,7 @@ class SchemaReadHelper {
|
|
|
61865
61867
|
}
|
|
61866
61868
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidECJson, `Unable to locate SchemaItem ${name}.`);
|
|
61867
61869
|
}
|
|
61868
|
-
schemaItem = this._context.getSchemaItemSync(new
|
|
61870
|
+
schemaItem = this._context.getSchemaItemSync(new _SchemaKey__WEBPACK_IMPORTED_MODULE_5__.SchemaItemKey(itemName, new _SchemaKey__WEBPACK_IMPORTED_MODULE_5__.SchemaKey(schemaName)));
|
|
61869
61871
|
if (undefined === schemaItem)
|
|
61870
61872
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidECJson, `Unable to locate SchemaItem ${name}.`);
|
|
61871
61873
|
return schemaItem;
|
|
@@ -61902,7 +61904,7 @@ class SchemaReadHelper {
|
|
|
61902
61904
|
await this.findSchemaItem(koqProps.persistenceUnit);
|
|
61903
61905
|
if (undefined !== koqProps.presentationUnits) {
|
|
61904
61906
|
for (const formatString of koqProps.presentationUnits) {
|
|
61905
|
-
for (const name of (0,
|
|
61907
|
+
for (const name of (0,_itwin_core_quantity__WEBPACK_IMPORTED_MODULE_7__.getItemNamesFromFormatString)(formatString)) {
|
|
61906
61908
|
await this.findSchemaItem(name);
|
|
61907
61909
|
}
|
|
61908
61910
|
}
|
|
@@ -61919,7 +61921,7 @@ class SchemaReadHelper {
|
|
|
61919
61921
|
this.findSchemaItemSync(koqProps.persistenceUnit);
|
|
61920
61922
|
if (undefined !== koqProps.presentationUnits) {
|
|
61921
61923
|
for (const formatString of koqProps.presentationUnits) {
|
|
61922
|
-
for (const name of (0,
|
|
61924
|
+
for (const name of (0,_itwin_core_quantity__WEBPACK_IMPORTED_MODULE_7__.getItemNamesFromFormatString)(formatString)) {
|
|
61923
61925
|
this.findSchemaItemSync(name);
|
|
61924
61926
|
}
|
|
61925
61927
|
}
|
|
@@ -62169,14 +62171,19 @@ class SchemaReadHelper {
|
|
|
62169
62171
|
*/
|
|
62170
62172
|
async loadPropertyTypes(classObj, propName, propType, rawProperty) {
|
|
62171
62173
|
const loadTypeName = async (typeName) => {
|
|
62172
|
-
if (undefined === (0,_ECObjects__WEBPACK_IMPORTED_MODULE_1__.parsePrimitiveType)(typeName))
|
|
62174
|
+
if (undefined === (0,_ECObjects__WEBPACK_IMPORTED_MODULE_1__.parsePrimitiveType)(typeName)) {
|
|
62175
|
+
if (SchemaReadHelper.isECSpecVersionNewer(this._parser.getECSpecVersion))
|
|
62176
|
+
return _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.NewerECSpecVersion;
|
|
62173
62177
|
await this.findSchemaItem(typeName);
|
|
62178
|
+
}
|
|
62179
|
+
return _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.Success;
|
|
62174
62180
|
};
|
|
62175
62181
|
const lowerCasePropType = propType.toLowerCase();
|
|
62176
62182
|
switch (lowerCasePropType) {
|
|
62177
62183
|
case "primitiveproperty":
|
|
62178
62184
|
const primPropertyProps = this._parser.parsePrimitiveProperty(rawProperty);
|
|
62179
|
-
await loadTypeName(primPropertyProps.typeName)
|
|
62185
|
+
if (await loadTypeName(primPropertyProps.typeName) === _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.NewerECSpecVersion)
|
|
62186
|
+
primPropertyProps.typeName = "string";
|
|
62180
62187
|
const primProp = await classObj.createPrimitiveProperty(propName, primPropertyProps.typeName);
|
|
62181
62188
|
return this.loadProperty(primProp, primPropertyProps, rawProperty);
|
|
62182
62189
|
case "structproperty":
|
|
@@ -62186,7 +62193,8 @@ class SchemaReadHelper {
|
|
|
62186
62193
|
return this.loadProperty(structProp, structPropertyProps, rawProperty);
|
|
62187
62194
|
case "primitivearrayproperty":
|
|
62188
62195
|
const primArrPropertyProps = this._parser.parsePrimitiveArrayProperty(rawProperty);
|
|
62189
|
-
await loadTypeName(primArrPropertyProps.typeName)
|
|
62196
|
+
if (await loadTypeName(primArrPropertyProps.typeName) === _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.NewerECSpecVersion)
|
|
62197
|
+
primArrPropertyProps.typeName = "string";
|
|
62190
62198
|
const primArrProp = await classObj.createPrimitiveArrayProperty(propName, primArrPropertyProps.typeName);
|
|
62191
62199
|
return this.loadProperty(primArrProp, primArrPropertyProps, rawProperty);
|
|
62192
62200
|
case "structarrayproperty":
|
|
@@ -62212,14 +62220,19 @@ class SchemaReadHelper {
|
|
|
62212
62220
|
*/
|
|
62213
62221
|
loadPropertyTypesSync(classObj, propName, propType, rawProperty) {
|
|
62214
62222
|
const loadTypeName = (typeName) => {
|
|
62215
|
-
if (undefined === (0,_ECObjects__WEBPACK_IMPORTED_MODULE_1__.parsePrimitiveType)(typeName))
|
|
62223
|
+
if (undefined === (0,_ECObjects__WEBPACK_IMPORTED_MODULE_1__.parsePrimitiveType)(typeName)) {
|
|
62224
|
+
if (SchemaReadHelper.isECSpecVersionNewer(this._parser.getECSpecVersion))
|
|
62225
|
+
return _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.NewerECSpecVersion;
|
|
62216
62226
|
this.findSchemaItemSync(typeName);
|
|
62227
|
+
}
|
|
62228
|
+
return _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.Success;
|
|
62217
62229
|
};
|
|
62218
62230
|
const lowerCasePropType = propType.toLowerCase();
|
|
62219
62231
|
switch (lowerCasePropType) {
|
|
62220
62232
|
case "primitiveproperty":
|
|
62221
62233
|
const primPropertyProps = this._parser.parsePrimitiveProperty(rawProperty);
|
|
62222
|
-
loadTypeName(primPropertyProps.typeName)
|
|
62234
|
+
if (loadTypeName(primPropertyProps.typeName) === _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.NewerECSpecVersion)
|
|
62235
|
+
primPropertyProps.typeName = "string";
|
|
62223
62236
|
const primProp = classObj.createPrimitivePropertySync(propName, primPropertyProps.typeName);
|
|
62224
62237
|
return this.loadPropertySync(primProp, primPropertyProps, rawProperty);
|
|
62225
62238
|
case "structproperty":
|
|
@@ -62229,7 +62242,8 @@ class SchemaReadHelper {
|
|
|
62229
62242
|
return this.loadPropertySync(structProp, structPropertyProps, rawProperty);
|
|
62230
62243
|
case "primitivearrayproperty":
|
|
62231
62244
|
const primArrPropertyProps = this._parser.parsePrimitiveArrayProperty(rawProperty);
|
|
62232
|
-
loadTypeName(primArrPropertyProps.typeName)
|
|
62245
|
+
if (loadTypeName(primArrPropertyProps.typeName) === _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.NewerECSpecVersion)
|
|
62246
|
+
primArrPropertyProps.typeName = "string";
|
|
62233
62247
|
const primArrProp = classObj.createPrimitiveArrayPropertySync(propName, primArrPropertyProps.typeName);
|
|
62234
62248
|
return this.loadPropertySync(primArrProp, primArrPropertyProps, rawProperty);
|
|
62235
62249
|
case "structarrayproperty":
|
|
@@ -62314,6 +62328,11 @@ class SchemaReadHelper {
|
|
|
62314
62328
|
container.addCustomAttribute(customAttribute);
|
|
62315
62329
|
}
|
|
62316
62330
|
}
|
|
62331
|
+
static isECSpecVersionNewer(ecSpecVersion) {
|
|
62332
|
+
if (ecSpecVersion === undefined || ecSpecVersion.readVersion === undefined || ecSpecVersion.writeVersion === undefined)
|
|
62333
|
+
return false;
|
|
62334
|
+
return ((ecSpecVersion.readVersion > _Metadata_Schema__WEBPACK_IMPORTED_MODULE_3__.Schema.currentECSpecMajorVersion) || (ecSpecVersion.readVersion === _Metadata_Schema__WEBPACK_IMPORTED_MODULE_3__.Schema.currentECSpecMajorVersion && ecSpecVersion.writeVersion > _Metadata_Schema__WEBPACK_IMPORTED_MODULE_3__.Schema.currentECSpecMinorVersion));
|
|
62335
|
+
}
|
|
62317
62336
|
}
|
|
62318
62337
|
|
|
62319
62338
|
|
|
@@ -62333,6 +62352,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
62333
62352
|
/* harmony import */ var _Exception__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Exception */ "../../core/ecschema-metadata/lib/esm/Exception.js");
|
|
62334
62353
|
/* harmony import */ var _ECName__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ECName */ "../../core/ecschema-metadata/lib/esm/ECName.js");
|
|
62335
62354
|
/* harmony import */ var _AbstractParser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AbstractParser */ "../../core/ecschema-metadata/lib/esm/Deserialization/AbstractParser.js");
|
|
62355
|
+
/* harmony import */ var _Helper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Helper */ "../../core/ecschema-metadata/lib/esm/Deserialization/Helper.js");
|
|
62336
62356
|
/*---------------------------------------------------------------------------------------------
|
|
62337
62357
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
62338
62358
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -62340,9 +62360,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
62340
62360
|
|
|
62341
62361
|
|
|
62342
62362
|
|
|
62363
|
+
|
|
62343
62364
|
function isObject(x) {
|
|
62344
62365
|
return typeof (x) === "object";
|
|
62345
62366
|
}
|
|
62367
|
+
const SCHEMAURL_JSON = "https://dev\\.bentley\\.com/json_schemas/ec";
|
|
62346
62368
|
/** @internal */
|
|
62347
62369
|
class JsonParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_2__.AbstractParser {
|
|
62348
62370
|
constructor(rawSchema) {
|
|
@@ -62351,6 +62373,18 @@ class JsonParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_2__.AbstractPa
|
|
|
62351
62373
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsStatus.InvalidECJson, `Invalid JSON object.`);
|
|
62352
62374
|
this._rawSchema = rawSchema;
|
|
62353
62375
|
this._schemaName = rawSchema.name;
|
|
62376
|
+
this._ecSpecVersion = JsonParser.parseJSUri(rawSchema.$schema);
|
|
62377
|
+
}
|
|
62378
|
+
get getECSpecVersion() { return this._ecSpecVersion; }
|
|
62379
|
+
static parseJSUri(uri) {
|
|
62380
|
+
if (uri === undefined)
|
|
62381
|
+
return undefined;
|
|
62382
|
+
const match = uri.match(`^${SCHEMAURL_JSON}/([0-9]+)/ecschema$`);
|
|
62383
|
+
if (!match)
|
|
62384
|
+
return;
|
|
62385
|
+
const readVersion = parseInt(match[1][0], 10);
|
|
62386
|
+
const writeVersion = parseInt(match[1][1], 10);
|
|
62387
|
+
return { readVersion, writeVersion };
|
|
62354
62388
|
}
|
|
62355
62389
|
/**
|
|
62356
62390
|
* Type checks Schema and returns SchemaProps interface
|
|
@@ -62382,7 +62416,12 @@ class JsonParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_2__.AbstractPa
|
|
|
62382
62416
|
if (typeof (this._rawSchema.description) !== "string")
|
|
62383
62417
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'description' attribute. It should be of type 'string'.`);
|
|
62384
62418
|
}
|
|
62385
|
-
|
|
62419
|
+
const ecVersions = JsonParser.parseJSUri(this._rawSchema.$schema);
|
|
62420
|
+
return {
|
|
62421
|
+
...this._rawSchema,
|
|
62422
|
+
ecSpecMajorVersion: ecVersions?.readVersion,
|
|
62423
|
+
ecSpecMinorVersion: ecVersions?.writeVersion,
|
|
62424
|
+
};
|
|
62386
62425
|
}
|
|
62387
62426
|
*getReferences() {
|
|
62388
62427
|
if (undefined !== this._rawSchema.references) {
|
|
@@ -62478,8 +62517,11 @@ class JsonParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_2__.AbstractPa
|
|
|
62478
62517
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} does not have the required 'type' attribute.`);
|
|
62479
62518
|
if (typeof (property.type) !== "string")
|
|
62480
62519
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} has an invalid 'type' attribute. It should be of type 'string'.`);
|
|
62481
|
-
if (!this.isValidPropertyType(property.type))
|
|
62520
|
+
if (!this.isValidPropertyType(property.type)) {
|
|
62521
|
+
if (_Helper__WEBPACK_IMPORTED_MODULE_3__.SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))
|
|
62522
|
+
return;
|
|
62482
62523
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} has an invalid 'type' attribute. '${property.type}' is not a valid type.`);
|
|
62524
|
+
}
|
|
62483
62525
|
yield [property.name, property.type, property];
|
|
62484
62526
|
}
|
|
62485
62527
|
}
|
|
@@ -62519,7 +62561,11 @@ class JsonParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_2__.AbstractPa
|
|
|
62519
62561
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsStatus.InvalidECJson, `The ECEntityClass ${this._currentItemFullName} has an invalid 'mixins' attribute. It should be of type 'string[]'.`);
|
|
62520
62562
|
}
|
|
62521
62563
|
}
|
|
62522
|
-
return
|
|
62564
|
+
return {
|
|
62565
|
+
...jsonObj,
|
|
62566
|
+
originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,
|
|
62567
|
+
originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,
|
|
62568
|
+
};
|
|
62523
62569
|
}
|
|
62524
62570
|
/**
|
|
62525
62571
|
* Type checks mixin and returns MixinProps interface
|
|
@@ -62532,7 +62578,11 @@ class JsonParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_2__.AbstractPa
|
|
|
62532
62578
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsStatus.InvalidECJson, `The Mixin ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);
|
|
62533
62579
|
if (typeof (jsonObj.appliesTo) !== "string")
|
|
62534
62580
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsStatus.InvalidECJson, `The Mixin ${this._currentItemFullName} has an invalid 'appliesTo' attribute. It should be of type 'string'.`);
|
|
62535
|
-
return
|
|
62581
|
+
return {
|
|
62582
|
+
...jsonObj,
|
|
62583
|
+
originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,
|
|
62584
|
+
originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,
|
|
62585
|
+
};
|
|
62536
62586
|
}
|
|
62537
62587
|
/**
|
|
62538
62588
|
* Type checks custom attribute class and returns CustomAttributeClassProps interface
|
|
@@ -62545,11 +62595,19 @@ class JsonParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_2__.AbstractPa
|
|
|
62545
62595
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsStatus.InvalidECJson, `The CustomAttributeClass ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);
|
|
62546
62596
|
if (typeof (jsonObj.appliesTo) !== "string")
|
|
62547
62597
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsStatus.InvalidECJson, `The CustomAttributeClass ${this._currentItemFullName} has an invalid 'appliesTo' attribute. It should be of type 'string'.`);
|
|
62548
|
-
return
|
|
62598
|
+
return {
|
|
62599
|
+
...jsonObj,
|
|
62600
|
+
originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,
|
|
62601
|
+
originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,
|
|
62602
|
+
};
|
|
62549
62603
|
}
|
|
62550
62604
|
parseStructClass(jsonObj) {
|
|
62551
62605
|
this.checkClassProps(jsonObj);
|
|
62552
|
-
return
|
|
62606
|
+
return {
|
|
62607
|
+
...jsonObj,
|
|
62608
|
+
originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,
|
|
62609
|
+
originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,
|
|
62610
|
+
};
|
|
62553
62611
|
}
|
|
62554
62612
|
parseUnitSystem(jsonObj) {
|
|
62555
62613
|
this.checkSchemaItemProps(jsonObj);
|
|
@@ -62580,7 +62638,11 @@ class JsonParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_2__.AbstractPa
|
|
|
62580
62638
|
if (!isObject(jsonObj.target))
|
|
62581
62639
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid target constraint. It should be of type 'object'.`);
|
|
62582
62640
|
this.checkRelationshipConstraintProps(jsonObj.target, false);
|
|
62583
|
-
return
|
|
62641
|
+
return {
|
|
62642
|
+
...jsonObj,
|
|
62643
|
+
originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,
|
|
62644
|
+
originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,
|
|
62645
|
+
};
|
|
62584
62646
|
}
|
|
62585
62647
|
/**
|
|
62586
62648
|
* Type checks Relationship Constraint and returns RelationshipConstraintProps interface.
|
|
@@ -62632,8 +62694,12 @@ class JsonParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_2__.AbstractPa
|
|
|
62632
62694
|
(type === "integer") ||
|
|
62633
62695
|
(type === "string");
|
|
62634
62696
|
};
|
|
62635
|
-
if (!isValidEnumerationType(jsonObj.type))
|
|
62636
|
-
|
|
62697
|
+
if (!isValidEnumerationType(jsonObj.type)) {
|
|
62698
|
+
if (_Helper__WEBPACK_IMPORTED_MODULE_3__.SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))
|
|
62699
|
+
jsonObj.type = "string";
|
|
62700
|
+
else
|
|
62701
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'type' attribute. It should be either "int" or "string".`);
|
|
62702
|
+
}
|
|
62637
62703
|
if (undefined !== jsonObj.isStrict) { // TODO: make required
|
|
62638
62704
|
if (typeof (jsonObj.isStrict) !== "boolean")
|
|
62639
62705
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_0__.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'isStrict' attribute. It should be of type 'boolean'.`);
|
|
@@ -63137,6 +63203,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
63137
63203
|
/* harmony import */ var _Exception__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Exception */ "../../core/ecschema-metadata/lib/esm/Exception.js");
|
|
63138
63204
|
/* harmony import */ var _ECName__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ECName */ "../../core/ecschema-metadata/lib/esm/ECName.js");
|
|
63139
63205
|
/* harmony import */ var _AbstractParser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./AbstractParser */ "../../core/ecschema-metadata/lib/esm/Deserialization/AbstractParser.js");
|
|
63206
|
+
/* harmony import */ var _Helper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Helper */ "../../core/ecschema-metadata/lib/esm/Deserialization/Helper.js");
|
|
63140
63207
|
/*---------------------------------------------------------------------------------------------
|
|
63141
63208
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
63142
63209
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -63146,6 +63213,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
63146
63213
|
|
|
63147
63214
|
|
|
63148
63215
|
|
|
63216
|
+
|
|
63149
63217
|
const NON_ITEM_SCHEMA_ELEMENTS = ["ECSchemaReference", "ECCustomAttributes"];
|
|
63150
63218
|
const ECXML_URI = "http://www\\.bentley\\.com/schemas/Bentley\\.ECXML";
|
|
63151
63219
|
/** @internal */
|
|
@@ -63168,11 +63236,12 @@ class XmlParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_4__.AbstractPar
|
|
|
63168
63236
|
const xmlNamespace = schemaInfo.getAttribute("xmlns");
|
|
63169
63237
|
if (xmlNamespace) {
|
|
63170
63238
|
this._xmlNamespace = xmlNamespace;
|
|
63171
|
-
this.
|
|
63239
|
+
this._ecSpecVersion = XmlParser.parseXmlNamespace(this._xmlNamespace);
|
|
63172
63240
|
}
|
|
63173
63241
|
this._schemaItems = new Map();
|
|
63174
63242
|
this._mapIsPopulated = false;
|
|
63175
63243
|
}
|
|
63244
|
+
get getECSpecVersion() { return this._ecSpecVersion; }
|
|
63176
63245
|
parseSchema() {
|
|
63177
63246
|
const schemaMetadata = this._rawSchema.documentElement;
|
|
63178
63247
|
if ("ECSchema" !== schemaMetadata.nodeName)
|
|
@@ -63186,7 +63255,7 @@ class XmlParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_4__.AbstractPar
|
|
|
63186
63255
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'version' attribute`);
|
|
63187
63256
|
if (this._xmlNamespace === undefined)
|
|
63188
63257
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'xmlns' attribute`);
|
|
63189
|
-
if (this.
|
|
63258
|
+
if (this._ecSpecVersion === undefined)
|
|
63190
63259
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} has an invalid 'xmlns' attribute`);
|
|
63191
63260
|
const alias = this.getRequiredAttribute(schemaMetadata, "alias", `The ECSchema ${this._schemaName} is missing a required 'alias' attribute`);
|
|
63192
63261
|
const description = this.getOptionalAttribute(schemaMetadata, "description");
|
|
@@ -63198,6 +63267,8 @@ class XmlParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_4__.AbstractPar
|
|
|
63198
63267
|
alias,
|
|
63199
63268
|
label: displayLabel,
|
|
63200
63269
|
description,
|
|
63270
|
+
ecSpecMajorVersion: this._ecSpecVersion.readVersion,
|
|
63271
|
+
ecSpecMinorVersion: this._ecSpecVersion.writeVersion,
|
|
63201
63272
|
};
|
|
63202
63273
|
return schemaProps;
|
|
63203
63274
|
}
|
|
@@ -63223,8 +63294,11 @@ class XmlParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_4__.AbstractPar
|
|
|
63223
63294
|
rawItemType = "Mixin";
|
|
63224
63295
|
}
|
|
63225
63296
|
const itemType = this.getSchemaItemType(rawItemType);
|
|
63226
|
-
if (itemType === undefined)
|
|
63297
|
+
if (itemType === undefined) {
|
|
63298
|
+
if (_Helper__WEBPACK_IMPORTED_MODULE_5__.SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))
|
|
63299
|
+
continue;
|
|
63227
63300
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidSchemaXML, `A SchemaItem in ${this._schemaName} has an invalid type. '${rawItemType}' is not a valid SchemaItem type.`);
|
|
63301
|
+
}
|
|
63228
63302
|
const itemName = this.getRequiredAttribute(item, "typeName", `A SchemaItem in ${this._schemaName} is missing the required 'typeName' attribute.`);
|
|
63229
63303
|
if (!_ECName__WEBPACK_IMPORTED_MODULE_3__.ECName.validate(itemName))
|
|
63230
63304
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'typeName' attribute. '${itemName}' is not a valid ECName.`);
|
|
@@ -63357,12 +63431,18 @@ class XmlParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_4__.AbstractPar
|
|
|
63357
63431
|
// TODO: This shouldn't be verified here. It's for the deserialize method to handle. The only reason it's currently done here so that the xml
|
|
63358
63432
|
// value can be put in the correct type, number or string.
|
|
63359
63433
|
let tempBackingType;
|
|
63360
|
-
if (/int/i.test(enumType))
|
|
63434
|
+
if (/int/i.test(enumType)) {
|
|
63361
63435
|
tempBackingType = _ECObjects__WEBPACK_IMPORTED_MODULE_1__.PrimitiveType.Integer;
|
|
63362
|
-
|
|
63436
|
+
}
|
|
63437
|
+
else if (/string/i.test(enumType)) {
|
|
63363
63438
|
tempBackingType = _ECObjects__WEBPACK_IMPORTED_MODULE_1__.PrimitiveType.String;
|
|
63364
|
-
|
|
63365
|
-
|
|
63439
|
+
}
|
|
63440
|
+
else {
|
|
63441
|
+
if (_Helper__WEBPACK_IMPORTED_MODULE_5__.SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))
|
|
63442
|
+
tempBackingType = _ECObjects__WEBPACK_IMPORTED_MODULE_1__.PrimitiveType.String;
|
|
63443
|
+
else
|
|
63444
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'backingTypeName' attribute. It should be either "int" or "string".`);
|
|
63445
|
+
}
|
|
63366
63446
|
let isStrictString = this.getOptionalAttribute(xmlElement, "isStrict");
|
|
63367
63447
|
if (isStrictString === undefined)
|
|
63368
63448
|
isStrictString = "true";
|
|
@@ -63393,6 +63473,8 @@ class XmlParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_4__.AbstractPar
|
|
|
63393
63473
|
type: enumType,
|
|
63394
63474
|
isStrict,
|
|
63395
63475
|
enumerators,
|
|
63476
|
+
originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,
|
|
63477
|
+
originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,
|
|
63396
63478
|
};
|
|
63397
63479
|
}
|
|
63398
63480
|
parseKindOfQuantity(xmlElement) {
|
|
@@ -63755,6 +63837,8 @@ class XmlParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_4__.AbstractPar
|
|
|
63755
63837
|
...itemProps,
|
|
63756
63838
|
modifier,
|
|
63757
63839
|
baseClass,
|
|
63840
|
+
originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,
|
|
63841
|
+
originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,
|
|
63758
63842
|
};
|
|
63759
63843
|
}
|
|
63760
63844
|
getRelationshipConstraintProps(xmlElement, isSource) {
|
|
@@ -63886,14 +63970,14 @@ class XmlParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_4__.AbstractPar
|
|
|
63886
63970
|
}
|
|
63887
63971
|
}
|
|
63888
63972
|
getCustomAttributeProvider(xmlCustomAttribute) {
|
|
63889
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(this.
|
|
63973
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(this._ecSpecVersion !== undefined);
|
|
63890
63974
|
let ns = xmlCustomAttribute.getAttribute("xmlns");
|
|
63891
63975
|
if (!ns) {
|
|
63892
63976
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(this._schemaName !== undefined);
|
|
63893
63977
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(this._schemaVersion !== undefined);
|
|
63894
63978
|
ns = `${this._schemaName}.${this._schemaVersion}`;
|
|
63895
63979
|
}
|
|
63896
|
-
if (null === ns || !this.isSchemaFullNameValidForVersion(ns, this.
|
|
63980
|
+
if (null === ns || !this.isSchemaFullNameValidForVersion(ns, this._ecSpecVersion))
|
|
63897
63981
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidSchemaXML, `Custom attribute namespaces must contain a valid 3.2 full schema name in the form <schemaName>.RR.ww.mm.`);
|
|
63898
63982
|
const schemaNameParts = ns.split(".");
|
|
63899
63983
|
const className = `${schemaNameParts[0]}.${xmlCustomAttribute.tagName}`;
|
|
@@ -64051,9 +64135,9 @@ class XmlParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_4__.AbstractPar
|
|
|
64051
64135
|
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 3D value was expected.`);
|
|
64052
64136
|
return { x, y, z };
|
|
64053
64137
|
}
|
|
64054
|
-
isSchemaFullNameValidForVersion(schemaFullName,
|
|
64138
|
+
isSchemaFullNameValidForVersion(schemaFullName, ecSpecVersion) {
|
|
64055
64139
|
const schemaNameParts = schemaFullName.split(".");
|
|
64056
|
-
if ((
|
|
64140
|
+
if ((ecSpecVersion.readVersion >= 3 && ecSpecVersion.writeVersion >= 2) || ecSpecVersion.readVersion > 3) {
|
|
64057
64141
|
if (schemaNameParts.length < 4)
|
|
64058
64142
|
return false;
|
|
64059
64143
|
}
|
|
@@ -64063,7 +64147,7 @@ class XmlParser extends _AbstractParser__WEBPACK_IMPORTED_MODULE_4__.AbstractPar
|
|
|
64063
64147
|
}
|
|
64064
64148
|
return true;
|
|
64065
64149
|
}
|
|
64066
|
-
parseXmlNamespace(xmlNamespace) {
|
|
64150
|
+
static parseXmlNamespace(xmlNamespace) {
|
|
64067
64151
|
const regEx = new RegExp(`^${ECXML_URI}\\.([0-9]+)\\.([0-9]+)$`);
|
|
64068
64152
|
const match = xmlNamespace.match(regEx);
|
|
64069
64153
|
if (!match)
|
|
@@ -64917,6 +65001,7 @@ var ECObjectsStatus;
|
|
|
64917
65001
|
ECObjectsStatus[ECObjectsStatus["InvalidSchemaAlias"] = 35078] = "InvalidSchemaAlias";
|
|
64918
65002
|
ECObjectsStatus[ECObjectsStatus["InvalidSchemaKey"] = 35079] = "InvalidSchemaKey";
|
|
64919
65003
|
ECObjectsStatus[ECObjectsStatus["UnableToLoadSchema"] = 35080] = "UnableToLoadSchema";
|
|
65004
|
+
ECObjectsStatus[ECObjectsStatus["NewerECSpecVersion"] = 35081] = "NewerECSpecVersion";
|
|
64920
65005
|
})(ECObjectsStatus || (ECObjectsStatus = {}));
|
|
64921
65006
|
/** @internal */
|
|
64922
65007
|
class ECObjectsError extends _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyError {
|
|
@@ -65004,6 +65089,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
65004
65089
|
/* harmony import */ var _CustomAttribute__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./CustomAttribute */ "../../core/ecschema-metadata/lib/esm/Metadata/CustomAttribute.js");
|
|
65005
65090
|
/* harmony import */ var _Property__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Property */ "../../core/ecschema-metadata/lib/esm/Metadata/Property.js");
|
|
65006
65091
|
/* harmony import */ var _SchemaItem__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./SchemaItem */ "../../core/ecschema-metadata/lib/esm/Metadata/SchemaItem.js");
|
|
65092
|
+
/* harmony import */ var _Deserialization_Helper__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../Deserialization/Helper */ "../../core/ecschema-metadata/lib/esm/Deserialization/Helper.js");
|
|
65007
65093
|
/*---------------------------------------------------------------------------------------------
|
|
65008
65094
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
65009
65095
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -65020,6 +65106,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
65020
65106
|
|
|
65021
65107
|
|
|
65022
65108
|
|
|
65109
|
+
|
|
65023
65110
|
/**
|
|
65024
65111
|
* A common abstract class for all of the ECClass types.
|
|
65025
65112
|
* @beta
|
|
@@ -65308,9 +65395,15 @@ class ECClass extends _SchemaItem__WEBPACK_IMPORTED_MODULE_8__.SchemaItem {
|
|
|
65308
65395
|
super.fromJSONSync(classProps);
|
|
65309
65396
|
if (undefined !== classProps.modifier) {
|
|
65310
65397
|
const modifier = (0,_ECObjects__WEBPACK_IMPORTED_MODULE_3__.parseClassModifier)(classProps.modifier);
|
|
65311
|
-
if (undefined === modifier)
|
|
65312
|
-
|
|
65313
|
-
|
|
65398
|
+
if (undefined === modifier) {
|
|
65399
|
+
if (_Deserialization_Helper__WEBPACK_IMPORTED_MODULE_9__.SchemaReadHelper.isECSpecVersionNewer({ readVersion: classProps.originalECSpecMajorVersion, writeVersion: classProps.originalECSpecMinorVersion }))
|
|
65400
|
+
this._modifier = _ECObjects__WEBPACK_IMPORTED_MODULE_3__.ECClassModifier.None;
|
|
65401
|
+
else
|
|
65402
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidModifier, `The string '${classProps.modifier}' is not a valid ECClassModifier.`);
|
|
65403
|
+
}
|
|
65404
|
+
else {
|
|
65405
|
+
this._modifier = modifier;
|
|
65406
|
+
}
|
|
65314
65407
|
}
|
|
65315
65408
|
if (undefined !== classProps.baseClass) {
|
|
65316
65409
|
const ecClassSchemaItemKey = this.schema.getSchemaItemKey(classProps.baseClass);
|
|
@@ -66083,10 +66176,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
66083
66176
|
/* harmony export */ "Enumeration": () => (/* binding */ Enumeration),
|
|
66084
66177
|
/* harmony export */ "MutableEnumeration": () => (/* binding */ MutableEnumeration)
|
|
66085
66178
|
/* harmony export */ });
|
|
66086
|
-
/* harmony import */ var
|
|
66087
|
-
/* harmony import */ var
|
|
66088
|
-
/* harmony import */ var
|
|
66089
|
-
/* harmony import */ var
|
|
66179
|
+
/* harmony import */ var _Deserialization_Helper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Deserialization/Helper */ "../../core/ecschema-metadata/lib/esm/Deserialization/Helper.js");
|
|
66180
|
+
/* harmony import */ var _ECObjects__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ECObjects */ "../../core/ecschema-metadata/lib/esm/ECObjects.js");
|
|
66181
|
+
/* harmony import */ var _Exception__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Exception */ "../../core/ecschema-metadata/lib/esm/Exception.js");
|
|
66182
|
+
/* harmony import */ var _ECName__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ECName */ "../../core/ecschema-metadata/lib/esm/ECName.js");
|
|
66183
|
+
/* harmony import */ var _SchemaItem__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SchemaItem */ "../../core/ecschema-metadata/lib/esm/Metadata/SchemaItem.js");
|
|
66090
66184
|
/*---------------------------------------------------------------------------------------------
|
|
66091
66185
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
66092
66186
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -66098,23 +66192,24 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
66098
66192
|
|
|
66099
66193
|
|
|
66100
66194
|
|
|
66195
|
+
|
|
66101
66196
|
/**
|
|
66102
66197
|
* A Typescript class representation of an ECEnumeration.
|
|
66103
66198
|
* @beta
|
|
66104
66199
|
*/
|
|
66105
|
-
class Enumeration extends
|
|
66200
|
+
class Enumeration extends _SchemaItem__WEBPACK_IMPORTED_MODULE_4__.SchemaItem {
|
|
66106
66201
|
get enumerators() { return this._enumerators; }
|
|
66107
66202
|
get type() { return this._type; }
|
|
66108
66203
|
get isStrict() { return this._isStrict; }
|
|
66109
66204
|
constructor(schema, name, primitiveType) {
|
|
66110
66205
|
super(schema, name);
|
|
66111
|
-
this.schemaItemType =
|
|
66206
|
+
this.schemaItemType = _ECObjects__WEBPACK_IMPORTED_MODULE_1__.SchemaItemType.Enumeration;
|
|
66112
66207
|
this._type = primitiveType;
|
|
66113
66208
|
this._isStrict = true;
|
|
66114
66209
|
this._enumerators = [];
|
|
66115
66210
|
}
|
|
66116
|
-
get isInt() { return this._type ===
|
|
66117
|
-
get isString() { return this._type ===
|
|
66211
|
+
get isInt() { return this._type === _ECObjects__WEBPACK_IMPORTED_MODULE_1__.PrimitiveType.Integer; }
|
|
66212
|
+
get isString() { return this._type === _ECObjects__WEBPACK_IMPORTED_MODULE_1__.PrimitiveType.String; }
|
|
66118
66213
|
/**
|
|
66119
66214
|
* Gets an enumerator that matches the name provided.
|
|
66120
66215
|
* @param name The ECName of the Enumerator to find.
|
|
@@ -66134,9 +66229,9 @@ class Enumeration extends _SchemaItem__WEBPACK_IMPORTED_MODULE_3__.SchemaItem {
|
|
|
66134
66229
|
findDuplicateEnumerators(name, value) {
|
|
66135
66230
|
this._enumerators.forEach((element) => {
|
|
66136
66231
|
if (element.name.toLowerCase() === name.toLowerCase())
|
|
66137
|
-
throw new
|
|
66232
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidECJson, `The Enumeration ${this.name} has a duplicate Enumerator with name '${name}'.`);
|
|
66138
66233
|
if (element.value === value)
|
|
66139
|
-
throw new
|
|
66234
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidECJson, `The Enumeration ${this.name} has a duplicate Enumerator with value '${value}'.`);
|
|
66140
66235
|
});
|
|
66141
66236
|
}
|
|
66142
66237
|
/**
|
|
@@ -66149,12 +66244,12 @@ class Enumeration extends _SchemaItem__WEBPACK_IMPORTED_MODULE_3__.SchemaItem {
|
|
|
66149
66244
|
*/
|
|
66150
66245
|
createEnumerator(name, value, label, description) {
|
|
66151
66246
|
if (this.isInt && typeof (value) === "string") // throws if backing type is int and value is string
|
|
66152
|
-
throw new
|
|
66247
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidECJson, `The Enumeration ${this.name} has a backing type 'integer' and an enumerator with value of type 'string'.`);
|
|
66153
66248
|
if (!this.isInt && typeof (value) === "number") // also throws if backing type is string and value is number
|
|
66154
|
-
throw new
|
|
66249
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidECJson, `The Enumeration ${this.name} has a backing type 'string' and an enumerator with value of type 'integer'.`);
|
|
66155
66250
|
this.findDuplicateEnumerators(name, value); // check for duplicates; throw if there are any
|
|
66156
|
-
if (!
|
|
66157
|
-
throw new
|
|
66251
|
+
if (!_ECName__WEBPACK_IMPORTED_MODULE_3__.ECName.validate(name))
|
|
66252
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidECName, `The Enumeration ${this.name} has an enumerator with an invalid 'name' attribute. ${name} is not a valid ECName.`);
|
|
66158
66253
|
return { name, value, label, description };
|
|
66159
66254
|
}
|
|
66160
66255
|
/**
|
|
@@ -66187,7 +66282,7 @@ class Enumeration extends _SchemaItem__WEBPACK_IMPORTED_MODULE_3__.SchemaItem {
|
|
|
66187
66282
|
async toXml(schemaXml) {
|
|
66188
66283
|
const itemElement = await super.toXml(schemaXml);
|
|
66189
66284
|
if (undefined !== this.type)
|
|
66190
|
-
itemElement.setAttribute("backingTypeName", (0,
|
|
66285
|
+
itemElement.setAttribute("backingTypeName", (0,_ECObjects__WEBPACK_IMPORTED_MODULE_1__.primitiveTypeToString)(this.type));
|
|
66191
66286
|
itemElement.setAttribute("isStrict", String(this.isStrict));
|
|
66192
66287
|
for (const enumerator of this.enumerators) {
|
|
66193
66288
|
const enumElement = schemaXml.createElement("ECEnumerator");
|
|
@@ -66205,17 +66300,23 @@ class Enumeration extends _SchemaItem__WEBPACK_IMPORTED_MODULE_3__.SchemaItem {
|
|
|
66205
66300
|
fromJSONSync(enumerationProps) {
|
|
66206
66301
|
super.fromJSONSync(enumerationProps);
|
|
66207
66302
|
if (undefined === this._type) {
|
|
66208
|
-
if (/int/i.test(enumerationProps.type))
|
|
66209
|
-
this._type =
|
|
66210
|
-
|
|
66211
|
-
|
|
66212
|
-
|
|
66213
|
-
|
|
66303
|
+
if (/int/i.test(enumerationProps.type)) {
|
|
66304
|
+
this._type = _ECObjects__WEBPACK_IMPORTED_MODULE_1__.PrimitiveType.Integer;
|
|
66305
|
+
}
|
|
66306
|
+
else if (/string/i.test(enumerationProps.type)) {
|
|
66307
|
+
this._type = _ECObjects__WEBPACK_IMPORTED_MODULE_1__.PrimitiveType.String;
|
|
66308
|
+
}
|
|
66309
|
+
else {
|
|
66310
|
+
if (_Deserialization_Helper__WEBPACK_IMPORTED_MODULE_0__.SchemaReadHelper.isECSpecVersionNewer({ readVersion: enumerationProps.originalECSpecMajorVersion, writeVersion: enumerationProps.originalECSpecMinorVersion }))
|
|
66311
|
+
this._type = _ECObjects__WEBPACK_IMPORTED_MODULE_1__.PrimitiveType.String;
|
|
66312
|
+
else
|
|
66313
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidECJson, `The Enumeration ${this.name} has an invalid 'type' attribute. It should be either "int" or "string".`);
|
|
66314
|
+
}
|
|
66214
66315
|
}
|
|
66215
66316
|
else {
|
|
66216
66317
|
const primitiveTypePattern = (this.isInt) ? /int/i : /string/i;
|
|
66217
66318
|
if (!primitiveTypePattern.test(enumerationProps.type))
|
|
66218
|
-
throw new
|
|
66319
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_2__.ECObjectsStatus.InvalidECJson, `The Enumeration ${this.name} has an incompatible type. It must be "${(this.isInt) ? "int" : "string"}", not "${(this.isInt) ? "string" : "int"}".`);
|
|
66219
66320
|
}
|
|
66220
66321
|
this._isStrict = enumerationProps.isStrict;
|
|
66221
66322
|
if (undefined !== enumerationProps.enumerators) {
|
|
@@ -67911,13 +68012,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
67911
68012
|
/* harmony export */ "RelationshipMultiplicity": () => (/* binding */ RelationshipMultiplicity)
|
|
67912
68013
|
/* harmony export */ });
|
|
67913
68014
|
/* harmony import */ var _DelayedPromise__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../DelayedPromise */ "../../core/ecschema-metadata/lib/esm/DelayedPromise.js");
|
|
67914
|
-
/* harmony import */ var
|
|
67915
|
-
/* harmony import */ var
|
|
67916
|
-
/* harmony import */ var
|
|
67917
|
-
/* harmony import */ var
|
|
67918
|
-
/* harmony import */ var
|
|
67919
|
-
/* harmony import */ var
|
|
67920
|
-
/* harmony import */ var
|
|
68015
|
+
/* harmony import */ var _Deserialization_Helper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Deserialization/Helper */ "../../core/ecschema-metadata/lib/esm/Deserialization/Helper.js");
|
|
68016
|
+
/* harmony import */ var _Deserialization_XmlSerializationUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Deserialization/XmlSerializationUtils */ "../../core/ecschema-metadata/lib/esm/Deserialization/XmlSerializationUtils.js");
|
|
68017
|
+
/* harmony import */ var _ECObjects__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ECObjects */ "../../core/ecschema-metadata/lib/esm/ECObjects.js");
|
|
68018
|
+
/* harmony import */ var _Exception__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Exception */ "../../core/ecschema-metadata/lib/esm/Exception.js");
|
|
68019
|
+
/* harmony import */ var _Class__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Class */ "../../core/ecschema-metadata/lib/esm/Metadata/Class.js");
|
|
68020
|
+
/* harmony import */ var _CustomAttribute__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./CustomAttribute */ "../../core/ecschema-metadata/lib/esm/Metadata/CustomAttribute.js");
|
|
68021
|
+
/* harmony import */ var _EntityClass__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./EntityClass */ "../../core/ecschema-metadata/lib/esm/Metadata/EntityClass.js");
|
|
68022
|
+
/* harmony import */ var _SchemaItem__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./SchemaItem */ "../../core/ecschema-metadata/lib/esm/Metadata/SchemaItem.js");
|
|
67921
68023
|
/*---------------------------------------------------------------------------------------------
|
|
67922
68024
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
67923
68025
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -67933,18 +68035,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
67933
68035
|
|
|
67934
68036
|
|
|
67935
68037
|
|
|
68038
|
+
|
|
67936
68039
|
/**
|
|
67937
68040
|
* A Typescript class representation of a ECRelationshipClass.
|
|
67938
68041
|
* @beta
|
|
67939
68042
|
*/
|
|
67940
|
-
class RelationshipClass extends
|
|
68043
|
+
class RelationshipClass extends _Class__WEBPACK_IMPORTED_MODULE_5__.ECClass {
|
|
67941
68044
|
constructor(schema, name, modifier) {
|
|
67942
68045
|
super(schema, name, modifier);
|
|
67943
|
-
this.schemaItemType =
|
|
67944
|
-
this._strengthDirection =
|
|
67945
|
-
this._strength =
|
|
67946
|
-
this._source = new RelationshipConstraint(this,
|
|
67947
|
-
this._target = new RelationshipConstraint(this,
|
|
68046
|
+
this.schemaItemType = _ECObjects__WEBPACK_IMPORTED_MODULE_3__.SchemaItemType.RelationshipClass;
|
|
68047
|
+
this._strengthDirection = _ECObjects__WEBPACK_IMPORTED_MODULE_3__.StrengthDirection.Forward;
|
|
68048
|
+
this._strength = _ECObjects__WEBPACK_IMPORTED_MODULE_3__.StrengthType.Referencing;
|
|
68049
|
+
this._source = new RelationshipConstraint(this, _ECObjects__WEBPACK_IMPORTED_MODULE_3__.RelationshipEnd.Source);
|
|
68050
|
+
this._target = new RelationshipConstraint(this, _ECObjects__WEBPACK_IMPORTED_MODULE_3__.RelationshipEnd.Target);
|
|
67948
68051
|
}
|
|
67949
68052
|
get strength() { return this._strength; }
|
|
67950
68053
|
get strengthDirection() { return this._strengthDirection; }
|
|
@@ -67957,10 +68060,10 @@ class RelationshipClass extends _Class__WEBPACK_IMPORTED_MODULE_4__.ECClass {
|
|
|
67957
68060
|
* @param direction
|
|
67958
68061
|
*/
|
|
67959
68062
|
async createNavigationProperty(name, relationship, direction) {
|
|
67960
|
-
return this.addProperty(await (0,
|
|
68063
|
+
return this.addProperty(await (0,_EntityClass__WEBPACK_IMPORTED_MODULE_7__.createNavigationProperty)(this, name, relationship, direction));
|
|
67961
68064
|
}
|
|
67962
68065
|
createNavigationPropertySync(name, relationship, direction) {
|
|
67963
|
-
return this.addProperty((0,
|
|
68066
|
+
return this.addProperty((0,_EntityClass__WEBPACK_IMPORTED_MODULE_7__.createNavigationPropertySync)(this, name, relationship, direction));
|
|
67964
68067
|
}
|
|
67965
68068
|
/**
|
|
67966
68069
|
* @alpha Used for schema editing.
|
|
@@ -67993,8 +68096,8 @@ class RelationshipClass extends _Class__WEBPACK_IMPORTED_MODULE_4__.ECClass {
|
|
|
67993
68096
|
*/
|
|
67994
68097
|
toJSON(standalone = false, includeSchemaVersion = false) {
|
|
67995
68098
|
const schemaJson = super.toJSON(standalone, includeSchemaVersion);
|
|
67996
|
-
schemaJson.strength = (0,
|
|
67997
|
-
schemaJson.strengthDirection = (0,
|
|
68099
|
+
schemaJson.strength = (0,_ECObjects__WEBPACK_IMPORTED_MODULE_3__.strengthToString)(this.strength);
|
|
68100
|
+
schemaJson.strengthDirection = (0,_ECObjects__WEBPACK_IMPORTED_MODULE_3__.strengthDirectionToString)(this.strengthDirection);
|
|
67998
68101
|
schemaJson.source = this.source.toJSON();
|
|
67999
68102
|
schemaJson.target = this.target.toJSON();
|
|
68000
68103
|
return schemaJson;
|
|
@@ -68002,20 +68105,24 @@ class RelationshipClass extends _Class__WEBPACK_IMPORTED_MODULE_4__.ECClass {
|
|
|
68002
68105
|
/** @internal */
|
|
68003
68106
|
async toXml(schemaXml) {
|
|
68004
68107
|
const itemElement = await super.toXml(schemaXml);
|
|
68005
|
-
itemElement.setAttribute("strength", (0,
|
|
68006
|
-
itemElement.setAttribute("strengthDirection", (0,
|
|
68108
|
+
itemElement.setAttribute("strength", (0,_ECObjects__WEBPACK_IMPORTED_MODULE_3__.strengthToString)(this.strength));
|
|
68109
|
+
itemElement.setAttribute("strengthDirection", (0,_ECObjects__WEBPACK_IMPORTED_MODULE_3__.strengthDirectionToString)(this.strengthDirection));
|
|
68007
68110
|
itemElement.appendChild(await this.source.toXml(schemaXml));
|
|
68008
68111
|
itemElement.appendChild(await this.target.toXml(schemaXml));
|
|
68009
68112
|
return itemElement;
|
|
68010
68113
|
}
|
|
68011
68114
|
fromJSONSync(relationshipClassProps) {
|
|
68012
68115
|
super.fromJSONSync(relationshipClassProps);
|
|
68013
|
-
|
|
68014
|
-
if (undefined === strength)
|
|
68015
|
-
|
|
68016
|
-
|
|
68116
|
+
let strength = (0,_ECObjects__WEBPACK_IMPORTED_MODULE_3__.parseStrength)(relationshipClassProps.strength);
|
|
68117
|
+
if (undefined === strength) {
|
|
68118
|
+
if (_Deserialization_Helper__WEBPACK_IMPORTED_MODULE_1__.SchemaReadHelper.isECSpecVersionNewer({ readVersion: relationshipClassProps.originalECSpecMajorVersion, writeVersion: relationshipClassProps.originalECSpecMinorVersion }))
|
|
68119
|
+
strength = _ECObjects__WEBPACK_IMPORTED_MODULE_3__.StrengthType.Referencing;
|
|
68120
|
+
else
|
|
68121
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidStrength, `The RelationshipClass ${this.fullName} has an invalid 'strength' attribute. '${relationshipClassProps.strength}' is not a valid StrengthType.`);
|
|
68122
|
+
}
|
|
68123
|
+
const strengthDirection = (0,_ECObjects__WEBPACK_IMPORTED_MODULE_3__.parseStrengthDirection)(relationshipClassProps.strengthDirection);
|
|
68017
68124
|
if (undefined === strengthDirection)
|
|
68018
|
-
throw new
|
|
68125
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidStrength, `The RelationshipClass ${this.fullName} has an invalid 'strengthDirection' attribute. '${relationshipClassProps.strengthDirection}' is not a valid StrengthDirection.`);
|
|
68019
68126
|
this._strength = strength;
|
|
68020
68127
|
this._strengthDirection = strengthDirection;
|
|
68021
68128
|
}
|
|
@@ -68074,7 +68181,7 @@ class RelationshipConstraint {
|
|
|
68074
68181
|
/**
|
|
68075
68182
|
* True if this RelationshipConstraint is the Source relationship end.
|
|
68076
68183
|
*/
|
|
68077
|
-
get isSource() { return this.relationshipEnd ===
|
|
68184
|
+
get isSource() { return this.relationshipEnd === _ECObjects__WEBPACK_IMPORTED_MODULE_3__.RelationshipEnd.Source; }
|
|
68078
68185
|
/**
|
|
68079
68186
|
* Adds the provided class as a constraint class to this constraint.
|
|
68080
68187
|
* @param constraint The class to add as a constraint class.
|
|
@@ -68113,7 +68220,7 @@ class RelationshipConstraint {
|
|
|
68113
68220
|
schemaJson.abstractConstraint = this._abstractConstraint.fullName;
|
|
68114
68221
|
if (undefined !== this.constraintClasses && this.constraintClasses.length > 0)
|
|
68115
68222
|
schemaJson.constraintClasses = this.constraintClasses.map((constraintClass) => constraintClass.fullName);
|
|
68116
|
-
const customAttributes = (0,
|
|
68223
|
+
const customAttributes = (0,_CustomAttribute__WEBPACK_IMPORTED_MODULE_6__.serializeCustomAttributes)(this.customAttributes);
|
|
68117
68224
|
if (undefined !== customAttributes)
|
|
68118
68225
|
schemaJson.customAttributes = customAttributes;
|
|
68119
68226
|
return schemaJson;
|
|
@@ -68130,14 +68237,14 @@ class RelationshipConstraint {
|
|
|
68130
68237
|
itemElement.setAttribute("multiplicity", this.multiplicity.toString());
|
|
68131
68238
|
const abstractConstraint = await this.abstractConstraint;
|
|
68132
68239
|
if (undefined !== abstractConstraint) {
|
|
68133
|
-
const abstractConstraintName =
|
|
68240
|
+
const abstractConstraintName = _Deserialization_XmlSerializationUtils__WEBPACK_IMPORTED_MODULE_2__.XmlSerializationUtils.createXmlTypedName(this.schema, abstractConstraint.schema, abstractConstraint.name);
|
|
68134
68241
|
itemElement.setAttribute("abstractConstraint", abstractConstraintName);
|
|
68135
68242
|
}
|
|
68136
68243
|
if (undefined !== this.constraintClasses) {
|
|
68137
68244
|
for (const item of this.constraintClasses) {
|
|
68138
68245
|
const constraintClass = await item;
|
|
68139
68246
|
const classElement = schemaXml.createElement("Class");
|
|
68140
|
-
const constraintClassName =
|
|
68247
|
+
const constraintClassName = _Deserialization_XmlSerializationUtils__WEBPACK_IMPORTED_MODULE_2__.XmlSerializationUtils.createXmlTypedName(this.schema, constraintClass.schema, constraintClass.name);
|
|
68141
68248
|
classElement.setAttribute("class", constraintClassName);
|
|
68142
68249
|
itemElement.appendChild(classElement);
|
|
68143
68250
|
}
|
|
@@ -68145,7 +68252,7 @@ class RelationshipConstraint {
|
|
|
68145
68252
|
if (this._customAttributes) {
|
|
68146
68253
|
const caContainerElement = schemaXml.createElement("ECCustomAttributes");
|
|
68147
68254
|
for (const [name, attribute] of this._customAttributes) {
|
|
68148
|
-
const caElement = await
|
|
68255
|
+
const caElement = await _Deserialization_XmlSerializationUtils__WEBPACK_IMPORTED_MODULE_2__.XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this.schema);
|
|
68149
68256
|
caContainerElement.appendChild(caElement);
|
|
68150
68257
|
}
|
|
68151
68258
|
itemElement.appendChild(caContainerElement);
|
|
@@ -68157,24 +68264,24 @@ class RelationshipConstraint {
|
|
|
68157
68264
|
this._polymorphic = relationshipConstraintProps.polymorphic;
|
|
68158
68265
|
const parsedMultiplicity = RelationshipMultiplicity.fromString(relationshipConstraintProps.multiplicity);
|
|
68159
68266
|
if (!parsedMultiplicity)
|
|
68160
|
-
throw new
|
|
68267
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidMultiplicity, ``);
|
|
68161
68268
|
this._multiplicity = parsedMultiplicity;
|
|
68162
68269
|
const relClassSchema = this.relationshipClass.schema;
|
|
68163
68270
|
if (undefined !== relationshipConstraintProps.abstractConstraint) {
|
|
68164
68271
|
const abstractConstraintSchemaItemKey = relClassSchema.getSchemaItemKey(relationshipConstraintProps.abstractConstraint);
|
|
68165
68272
|
if (!abstractConstraintSchemaItemKey)
|
|
68166
|
-
throw new
|
|
68273
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidECJson, `Unable to locate the abstractConstraint ${relationshipConstraintProps.abstractConstraint}.`);
|
|
68167
68274
|
this.abstractConstraint = new _DelayedPromise__WEBPACK_IMPORTED_MODULE_0__.DelayedPromiseWithProps(abstractConstraintSchemaItemKey, async () => {
|
|
68168
68275
|
const tempAbstractConstraint = await relClassSchema.lookupItem(relationshipConstraintProps.abstractConstraint);
|
|
68169
68276
|
if (undefined === tempAbstractConstraint)
|
|
68170
|
-
throw new
|
|
68277
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidECJson, `Unable to locate the abstractConstraint ${relationshipConstraintProps.abstractConstraint}.`);
|
|
68171
68278
|
return tempAbstractConstraint;
|
|
68172
68279
|
});
|
|
68173
68280
|
}
|
|
68174
68281
|
const loadEachConstraint = (constraintClassName) => {
|
|
68175
68282
|
const tempConstraintClass = relClassSchema.lookupItemSync(constraintClassName);
|
|
68176
68283
|
if (!tempConstraintClass)
|
|
68177
|
-
throw new
|
|
68284
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidECJson, ``);
|
|
68178
68285
|
return tempConstraintClass;
|
|
68179
68286
|
};
|
|
68180
68287
|
for (const constraintClassName of relationshipConstraintProps.constraintClasses) {
|
|
@@ -68198,8 +68305,8 @@ class RelationshipConstraint {
|
|
|
68198
68305
|
}
|
|
68199
68306
|
return false;
|
|
68200
68307
|
}
|
|
68201
|
-
if (ecClass.schemaItemType !==
|
|
68202
|
-
ecClass.schemaItemType !==
|
|
68308
|
+
if (ecClass.schemaItemType !== _ECObjects__WEBPACK_IMPORTED_MODULE_3__.SchemaItemType.EntityClass && ecClass.schemaItemType !== _ECObjects__WEBPACK_IMPORTED_MODULE_3__.SchemaItemType.RelationshipClass &&
|
|
68309
|
+
ecClass.schemaItemType !== _ECObjects__WEBPACK_IMPORTED_MODULE_3__.SchemaItemType.Mixin) {
|
|
68203
68310
|
return false;
|
|
68204
68311
|
}
|
|
68205
68312
|
const abstractConstraint = await this.abstractConstraint;
|
|
@@ -68218,14 +68325,14 @@ class RelationshipConstraint {
|
|
|
68218
68325
|
* @param isPolymorphic Indicates if the testClass should be checked polymorphically.
|
|
68219
68326
|
*/
|
|
68220
68327
|
static async classCompatibleWithConstraint(constraintClass, testClass, isPolymorphic) {
|
|
68221
|
-
if (
|
|
68328
|
+
if (_SchemaItem__WEBPACK_IMPORTED_MODULE_8__.SchemaItem.equalByKey(constraintClass, testClass))
|
|
68222
68329
|
return true;
|
|
68223
68330
|
if (isPolymorphic) {
|
|
68224
|
-
if (testClass.schemaItemType ===
|
|
68331
|
+
if (testClass.schemaItemType === _ECObjects__WEBPACK_IMPORTED_MODULE_3__.SchemaItemType.EntityClass || testClass.schemaItemType === _ECObjects__WEBPACK_IMPORTED_MODULE_3__.SchemaItemType.RelationshipClass) {
|
|
68225
68332
|
return testClass.is(constraintClass);
|
|
68226
68333
|
}
|
|
68227
|
-
if (testClass.schemaItemType ===
|
|
68228
|
-
if (constraintClass.schemaItemType ===
|
|
68334
|
+
if (testClass.schemaItemType === _ECObjects__WEBPACK_IMPORTED_MODULE_3__.SchemaItemType.Mixin) {
|
|
68335
|
+
if (constraintClass.schemaItemType === _ECObjects__WEBPACK_IMPORTED_MODULE_3__.SchemaItemType.EntityClass)
|
|
68229
68336
|
return testClass.applicableTo(constraintClass);
|
|
68230
68337
|
else
|
|
68231
68338
|
return testClass.is(constraintClass);
|
|
@@ -68315,26 +68422,27 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68315
68422
|
/* harmony export */ });
|
|
68316
68423
|
/* harmony import */ var _Deserialization_Helper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Deserialization/Helper */ "../../core/ecschema-metadata/lib/esm/Deserialization/Helper.js");
|
|
68317
68424
|
/* harmony import */ var _Deserialization_JsonParser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Deserialization/JsonParser */ "../../core/ecschema-metadata/lib/esm/Deserialization/JsonParser.js");
|
|
68318
|
-
/* harmony import */ var
|
|
68319
|
-
/* harmony import */ var
|
|
68320
|
-
/* harmony import */ var
|
|
68321
|
-
/* harmony import */ var
|
|
68322
|
-
/* harmony import */ var
|
|
68323
|
-
/* harmony import */ var
|
|
68324
|
-
/* harmony import */ var
|
|
68325
|
-
/* harmony import */ var
|
|
68326
|
-
/* harmony import */ var
|
|
68327
|
-
/* harmony import */ var
|
|
68328
|
-
/* harmony import */ var
|
|
68329
|
-
/* harmony import */ var
|
|
68330
|
-
/* harmony import */ var
|
|
68331
|
-
/* harmony import */ var
|
|
68332
|
-
/* harmony import */ var
|
|
68333
|
-
/* harmony import */ var
|
|
68334
|
-
/* harmony import */ var
|
|
68335
|
-
/* harmony import */ var
|
|
68336
|
-
/* harmony import */ var
|
|
68337
|
-
/* harmony import */ var
|
|
68425
|
+
/* harmony import */ var _Deserialization_XmlParser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Deserialization/XmlParser */ "../../core/ecschema-metadata/lib/esm/Deserialization/XmlParser.js");
|
|
68426
|
+
/* harmony import */ var _Deserialization_XmlSerializationUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Deserialization/XmlSerializationUtils */ "../../core/ecschema-metadata/lib/esm/Deserialization/XmlSerializationUtils.js");
|
|
68427
|
+
/* harmony import */ var _Exception__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Exception */ "../../core/ecschema-metadata/lib/esm/Exception.js");
|
|
68428
|
+
/* harmony import */ var _SchemaKey__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../SchemaKey */ "../../core/ecschema-metadata/lib/esm/SchemaKey.js");
|
|
68429
|
+
/* harmony import */ var _ECName__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ECName */ "../../core/ecschema-metadata/lib/esm/ECName.js");
|
|
68430
|
+
/* harmony import */ var _Class__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Class */ "../../core/ecschema-metadata/lib/esm/Metadata/Class.js");
|
|
68431
|
+
/* harmony import */ var _Constant__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Constant */ "../../core/ecschema-metadata/lib/esm/Metadata/Constant.js");
|
|
68432
|
+
/* harmony import */ var _CustomAttribute__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./CustomAttribute */ "../../core/ecschema-metadata/lib/esm/Metadata/CustomAttribute.js");
|
|
68433
|
+
/* harmony import */ var _CustomAttributeClass__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./CustomAttributeClass */ "../../core/ecschema-metadata/lib/esm/Metadata/CustomAttributeClass.js");
|
|
68434
|
+
/* harmony import */ var _EntityClass__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./EntityClass */ "../../core/ecschema-metadata/lib/esm/Metadata/EntityClass.js");
|
|
68435
|
+
/* harmony import */ var _Enumeration__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Enumeration */ "../../core/ecschema-metadata/lib/esm/Metadata/Enumeration.js");
|
|
68436
|
+
/* harmony import */ var _Format__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Format */ "../../core/ecschema-metadata/lib/esm/Metadata/Format.js");
|
|
68437
|
+
/* harmony import */ var _InvertedUnit__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./InvertedUnit */ "../../core/ecschema-metadata/lib/esm/Metadata/InvertedUnit.js");
|
|
68438
|
+
/* harmony import */ var _KindOfQuantity__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./KindOfQuantity */ "../../core/ecschema-metadata/lib/esm/Metadata/KindOfQuantity.js");
|
|
68439
|
+
/* harmony import */ var _Mixin__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./Mixin */ "../../core/ecschema-metadata/lib/esm/Metadata/Mixin.js");
|
|
68440
|
+
/* harmony import */ var _Phenomenon__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./Phenomenon */ "../../core/ecschema-metadata/lib/esm/Metadata/Phenomenon.js");
|
|
68441
|
+
/* harmony import */ var _PropertyCategory__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./PropertyCategory */ "../../core/ecschema-metadata/lib/esm/Metadata/PropertyCategory.js");
|
|
68442
|
+
/* harmony import */ var _RelationshipClass__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./RelationshipClass */ "../../core/ecschema-metadata/lib/esm/Metadata/RelationshipClass.js");
|
|
68443
|
+
/* harmony import */ var _SchemaItem__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./SchemaItem */ "../../core/ecschema-metadata/lib/esm/Metadata/SchemaItem.js");
|
|
68444
|
+
/* harmony import */ var _Unit__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./Unit */ "../../core/ecschema-metadata/lib/esm/Metadata/Unit.js");
|
|
68445
|
+
/* harmony import */ var _UnitSystem__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./UnitSystem */ "../../core/ecschema-metadata/lib/esm/Metadata/UnitSystem.js");
|
|
68338
68446
|
/*---------------------------------------------------------------------------------------------
|
|
68339
68447
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
68340
68448
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -68362,6 +68470,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68362
68470
|
|
|
68363
68471
|
|
|
68364
68472
|
|
|
68473
|
+
|
|
68365
68474
|
|
|
68366
68475
|
|
|
68367
68476
|
const SCHEMAURL3_2_JSON = "https://dev.bentley.com/json_schemas/ec/32/ecschema";
|
|
@@ -68372,29 +68481,51 @@ const SCHEMAURL3_2_XML = "http://www.bentley.com/schemas/Bentley.ECXML.3.2";
|
|
|
68372
68481
|
class Schema {
|
|
68373
68482
|
/** @internal */
|
|
68374
68483
|
constructor(context, nameOrKey, alias, readVer, writeVer, minorVer) {
|
|
68375
|
-
this._schemaKey = (typeof (nameOrKey) === "string") ? new
|
|
68484
|
+
this._schemaKey = (typeof (nameOrKey) === "string") ? new _SchemaKey__WEBPACK_IMPORTED_MODULE_5__.SchemaKey(nameOrKey, new _SchemaKey__WEBPACK_IMPORTED_MODULE_5__.ECVersion(readVer, writeVer, minorVer)) : nameOrKey;
|
|
68376
68485
|
this._context = context;
|
|
68377
68486
|
this.references = [];
|
|
68378
68487
|
this._items = new Map();
|
|
68379
|
-
if (alias !== undefined &&
|
|
68488
|
+
if (alias !== undefined && _ECName__WEBPACK_IMPORTED_MODULE_6__.ECName.validate(alias)) {
|
|
68380
68489
|
this._alias = alias;
|
|
68381
68490
|
}
|
|
68382
68491
|
else if (nameOrKey !== undefined) {
|
|
68383
|
-
throw new
|
|
68492
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidECJson, `The Schema ${this.name} does not have the required 'alias' attribute.`);
|
|
68384
68493
|
}
|
|
68494
|
+
this._originalECSpecMajorVersion = Schema.currentECSpecMajorVersion;
|
|
68495
|
+
this._originalECSpecMinorVersion = Schema.currentECSpecMinorVersion;
|
|
68385
68496
|
}
|
|
68386
68497
|
get schemaKey() {
|
|
68387
68498
|
if (undefined === this._schemaKey)
|
|
68388
|
-
throw new
|
|
68499
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);
|
|
68389
68500
|
return this._schemaKey;
|
|
68390
68501
|
}
|
|
68391
|
-
get name() {
|
|
68392
|
-
|
|
68393
|
-
|
|
68394
|
-
|
|
68502
|
+
get name() {
|
|
68503
|
+
if (this._schemaKey === undefined)
|
|
68504
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);
|
|
68505
|
+
return this.schemaKey.name;
|
|
68506
|
+
}
|
|
68507
|
+
get readVersion() {
|
|
68508
|
+
if (this._schemaKey === undefined)
|
|
68509
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);
|
|
68510
|
+
return this.schemaKey.readVersion;
|
|
68511
|
+
}
|
|
68512
|
+
get writeVersion() {
|
|
68513
|
+
if (this._schemaKey === undefined)
|
|
68514
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);
|
|
68515
|
+
return this.schemaKey.writeVersion;
|
|
68516
|
+
}
|
|
68517
|
+
get minorVersion() {
|
|
68518
|
+
if (this._schemaKey === undefined)
|
|
68519
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);
|
|
68520
|
+
return this.schemaKey.minorVersion;
|
|
68521
|
+
}
|
|
68522
|
+
get originalECSpecMajorVersion() { return this._originalECSpecMajorVersion; }
|
|
68523
|
+
get originalECSpecMinorVersion() { return this._originalECSpecMinorVersion; }
|
|
68524
|
+
static get currentECSpecMajorVersion() { return parseInt(Schema._currentECSpecVersion.split(".")[0], 10); }
|
|
68525
|
+
static get currentECSpecMinorVersion() { return parseInt(Schema._currentECSpecVersion.split(".")[1], 10); }
|
|
68395
68526
|
get alias() {
|
|
68396
68527
|
if (this._alias === undefined || this._alias === null) {
|
|
68397
|
-
throw new
|
|
68528
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidECJson, `The Schema ${this.name} does not have the required 'alias' attribute.`);
|
|
68398
68529
|
}
|
|
68399
68530
|
else {
|
|
68400
68531
|
return this._alias;
|
|
@@ -68414,19 +68545,19 @@ class Schema {
|
|
|
68414
68545
|
* @param fullName fully qualified name {Schema name}.{Item Name}
|
|
68415
68546
|
*/
|
|
68416
68547
|
getSchemaItemKey(fullName) {
|
|
68417
|
-
const [schemaName, itemName] =
|
|
68548
|
+
const [schemaName, itemName] = _SchemaItem__WEBPACK_IMPORTED_MODULE_20__.SchemaItem.parseFullName(fullName);
|
|
68418
68549
|
let schemaKey = this.schemaKey;
|
|
68419
68550
|
if (this.name !== schemaName) {
|
|
68420
68551
|
const newSchemaRef = this.getReferenceSync(schemaName);
|
|
68421
68552
|
if (undefined === newSchemaRef)
|
|
68422
|
-
throw new
|
|
68553
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidECJson, `Unable to find the referenced SchemaItem ${itemName}.`);
|
|
68423
68554
|
schemaKey = newSchemaRef.schemaKey;
|
|
68424
68555
|
}
|
|
68425
|
-
return new
|
|
68556
|
+
return new _SchemaKey__WEBPACK_IMPORTED_MODULE_5__.SchemaItemKey(itemName, schemaKey);
|
|
68426
68557
|
}
|
|
68427
68558
|
addItem(item) {
|
|
68428
68559
|
if (undefined !== this.getItemSync(item.name))
|
|
68429
|
-
throw new
|
|
68560
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.DuplicateItem, `The SchemaItem ${item.name} cannot be added to the schema ${this.name} because it already exists`);
|
|
68430
68561
|
this._items.set(item.name.toUpperCase(), item);
|
|
68431
68562
|
}
|
|
68432
68563
|
/**
|
|
@@ -68444,7 +68575,7 @@ class Schema {
|
|
|
68444
68575
|
*/
|
|
68445
68576
|
async deleteClass(name) {
|
|
68446
68577
|
const schemaItem = await this.getItem(name);
|
|
68447
|
-
if (
|
|
68578
|
+
if (_Class__WEBPACK_IMPORTED_MODULE_7__.ECClass.isECClass(schemaItem)) {
|
|
68448
68579
|
this._items.delete(name.toUpperCase());
|
|
68449
68580
|
}
|
|
68450
68581
|
}
|
|
@@ -68455,7 +68586,7 @@ class Schema {
|
|
|
68455
68586
|
*/
|
|
68456
68587
|
deleteClassSync(name) {
|
|
68457
68588
|
const schemaItem = this.getItemSync(name);
|
|
68458
|
-
if (
|
|
68589
|
+
if (_Class__WEBPACK_IMPORTED_MODULE_7__.ECClass.isECClass(schemaItem))
|
|
68459
68590
|
this._items.delete(name.toUpperCase());
|
|
68460
68591
|
}
|
|
68461
68592
|
/**
|
|
@@ -68465,7 +68596,7 @@ class Schema {
|
|
|
68465
68596
|
*/
|
|
68466
68597
|
async deleteSchemaItem(name) {
|
|
68467
68598
|
const schemaItem = await this.getItem(name);
|
|
68468
|
-
if (
|
|
68599
|
+
if (_SchemaItem__WEBPACK_IMPORTED_MODULE_20__.SchemaItem.isSchemaItem(schemaItem)) {
|
|
68469
68600
|
this._items.delete(name.toUpperCase());
|
|
68470
68601
|
}
|
|
68471
68602
|
}
|
|
@@ -68476,7 +68607,7 @@ class Schema {
|
|
|
68476
68607
|
*/
|
|
68477
68608
|
deleteSchemaItemSync(name) {
|
|
68478
68609
|
const schemaItem = this.getItemSync(name);
|
|
68479
|
-
if (
|
|
68610
|
+
if (_SchemaItem__WEBPACK_IMPORTED_MODULE_20__.SchemaItem.isSchemaItem(schemaItem))
|
|
68480
68611
|
this._items.delete(name.toUpperCase());
|
|
68481
68612
|
}
|
|
68482
68613
|
/**
|
|
@@ -68498,27 +68629,27 @@ class Schema {
|
|
|
68498
68629
|
* @param modifier
|
|
68499
68630
|
*/
|
|
68500
68631
|
async createEntityClass(name, modifier) {
|
|
68501
|
-
return this.createClass(
|
|
68632
|
+
return this.createClass(_EntityClass__WEBPACK_IMPORTED_MODULE_11__.EntityClass, name, modifier);
|
|
68502
68633
|
}
|
|
68503
68634
|
createEntityClassSync(name, modifier) {
|
|
68504
|
-
return this.createClass(
|
|
68635
|
+
return this.createClass(_EntityClass__WEBPACK_IMPORTED_MODULE_11__.EntityClass, name, modifier);
|
|
68505
68636
|
}
|
|
68506
68637
|
/**
|
|
68507
68638
|
* Creates a Mixin with the provided name in this schema.
|
|
68508
68639
|
* @param name
|
|
68509
68640
|
*/
|
|
68510
|
-
async createMixinClass(name) { return this.createClass(
|
|
68511
|
-
createMixinClassSync(name) { return this.createClass(
|
|
68641
|
+
async createMixinClass(name) { return this.createClass(_Mixin__WEBPACK_IMPORTED_MODULE_16__.Mixin, name); }
|
|
68642
|
+
createMixinClassSync(name) { return this.createClass(_Mixin__WEBPACK_IMPORTED_MODULE_16__.Mixin, name); }
|
|
68512
68643
|
/**
|
|
68513
68644
|
* Creates a StructClass with the provided name in this schema.
|
|
68514
68645
|
* @param name
|
|
68515
68646
|
* @param modifier
|
|
68516
68647
|
*/
|
|
68517
68648
|
async createStructClass(name, modifier) {
|
|
68518
|
-
return this.createClass(
|
|
68649
|
+
return this.createClass(_Class__WEBPACK_IMPORTED_MODULE_7__.StructClass, name, modifier);
|
|
68519
68650
|
}
|
|
68520
68651
|
createStructClassSync(name, modifier) {
|
|
68521
|
-
return this.createClass(
|
|
68652
|
+
return this.createClass(_Class__WEBPACK_IMPORTED_MODULE_7__.StructClass, name, modifier);
|
|
68522
68653
|
}
|
|
68523
68654
|
/**
|
|
68524
68655
|
* Creates a CustomAttributeClass with the provided name in this schema.
|
|
@@ -68526,10 +68657,10 @@ class Schema {
|
|
|
68526
68657
|
* @param modifier
|
|
68527
68658
|
*/
|
|
68528
68659
|
async createCustomAttributeClass(name, modifier) {
|
|
68529
|
-
return this.createClass(
|
|
68660
|
+
return this.createClass(_CustomAttributeClass__WEBPACK_IMPORTED_MODULE_10__.CustomAttributeClass, name, modifier);
|
|
68530
68661
|
}
|
|
68531
68662
|
createCustomAttributeClassSync(name, modifier) {
|
|
68532
|
-
return this.createClass(
|
|
68663
|
+
return this.createClass(_CustomAttributeClass__WEBPACK_IMPORTED_MODULE_10__.CustomAttributeClass, name, modifier);
|
|
68533
68664
|
}
|
|
68534
68665
|
/**
|
|
68535
68666
|
* Creates a RelationshipClass with the provided name in this schema.
|
|
@@ -68540,7 +68671,7 @@ class Schema {
|
|
|
68540
68671
|
return this.createRelationshipClassSync(name, modifier);
|
|
68541
68672
|
}
|
|
68542
68673
|
createRelationshipClassSync(name, modifier) {
|
|
68543
|
-
return this.createClass(
|
|
68674
|
+
return this.createClass(_RelationshipClass__WEBPACK_IMPORTED_MODULE_19__.RelationshipClass, name, modifier);
|
|
68544
68675
|
}
|
|
68545
68676
|
/**
|
|
68546
68677
|
* Creates an Enumeration with the provided name in this schema.
|
|
@@ -68550,7 +68681,7 @@ class Schema {
|
|
|
68550
68681
|
return this.createEnumerationSync(name, primitiveType);
|
|
68551
68682
|
}
|
|
68552
68683
|
createEnumerationSync(name, primitiveType) {
|
|
68553
|
-
const item = new
|
|
68684
|
+
const item = new _Enumeration__WEBPACK_IMPORTED_MODULE_12__.Enumeration(this, name, primitiveType);
|
|
68554
68685
|
this.addItem(item);
|
|
68555
68686
|
return item;
|
|
68556
68687
|
}
|
|
@@ -68562,77 +68693,77 @@ class Schema {
|
|
|
68562
68693
|
return this.createKindOfQuantitySync(name);
|
|
68563
68694
|
}
|
|
68564
68695
|
createKindOfQuantitySync(name) {
|
|
68565
|
-
return this.createItem(
|
|
68696
|
+
return this.createItem(_KindOfQuantity__WEBPACK_IMPORTED_MODULE_15__.KindOfQuantity, name);
|
|
68566
68697
|
}
|
|
68567
68698
|
/**
|
|
68568
68699
|
* Creates a Constant with the provided name in this schema.
|
|
68569
68700
|
* @param name
|
|
68570
68701
|
*/
|
|
68571
68702
|
async createConstant(name) {
|
|
68572
|
-
return this.createItem(
|
|
68703
|
+
return this.createItem(_Constant__WEBPACK_IMPORTED_MODULE_8__.Constant, name);
|
|
68573
68704
|
}
|
|
68574
68705
|
createConstantSync(name) {
|
|
68575
|
-
return this.createItem(
|
|
68706
|
+
return this.createItem(_Constant__WEBPACK_IMPORTED_MODULE_8__.Constant, name);
|
|
68576
68707
|
}
|
|
68577
68708
|
/**
|
|
68578
68709
|
* Creates a Inverted Unit with the provided name in this schema.
|
|
68579
68710
|
* @param name
|
|
68580
68711
|
*/
|
|
68581
68712
|
async createInvertedUnit(name) {
|
|
68582
|
-
return this.createItem(
|
|
68713
|
+
return this.createItem(_InvertedUnit__WEBPACK_IMPORTED_MODULE_14__.InvertedUnit, name);
|
|
68583
68714
|
}
|
|
68584
68715
|
createInvertedUnitSync(name) {
|
|
68585
|
-
return this.createItem(
|
|
68716
|
+
return this.createItem(_InvertedUnit__WEBPACK_IMPORTED_MODULE_14__.InvertedUnit, name);
|
|
68586
68717
|
}
|
|
68587
68718
|
/**
|
|
68588
68719
|
* Creates an Format with the provided name in this schema.
|
|
68589
68720
|
* @param name
|
|
68590
68721
|
*/
|
|
68591
68722
|
async createFormat(name) {
|
|
68592
|
-
return this.createItem(
|
|
68723
|
+
return this.createItem(_Format__WEBPACK_IMPORTED_MODULE_13__.Format, name);
|
|
68593
68724
|
}
|
|
68594
68725
|
createFormatSync(name) {
|
|
68595
|
-
return this.createItem(
|
|
68726
|
+
return this.createItem(_Format__WEBPACK_IMPORTED_MODULE_13__.Format, name);
|
|
68596
68727
|
}
|
|
68597
68728
|
/**
|
|
68598
68729
|
* Creates a UnitSystem with the provided name in this schema.
|
|
68599
68730
|
* @param name
|
|
68600
68731
|
*/
|
|
68601
68732
|
async createUnitSystem(name) {
|
|
68602
|
-
return this.createItem(
|
|
68733
|
+
return this.createItem(_UnitSystem__WEBPACK_IMPORTED_MODULE_22__.UnitSystem, name);
|
|
68603
68734
|
}
|
|
68604
68735
|
createUnitSystemSync(name) {
|
|
68605
|
-
return this.createItem(
|
|
68736
|
+
return this.createItem(_UnitSystem__WEBPACK_IMPORTED_MODULE_22__.UnitSystem, name);
|
|
68606
68737
|
}
|
|
68607
68738
|
/**
|
|
68608
68739
|
* Creates a Phenomenon with the provided name in this schema.
|
|
68609
68740
|
* @param name
|
|
68610
68741
|
*/
|
|
68611
68742
|
async createPhenomenon(name) {
|
|
68612
|
-
return this.createItem(
|
|
68743
|
+
return this.createItem(_Phenomenon__WEBPACK_IMPORTED_MODULE_17__.Phenomenon, name);
|
|
68613
68744
|
}
|
|
68614
68745
|
createPhenomenonSync(name) {
|
|
68615
|
-
return this.createItem(
|
|
68746
|
+
return this.createItem(_Phenomenon__WEBPACK_IMPORTED_MODULE_17__.Phenomenon, name);
|
|
68616
68747
|
}
|
|
68617
68748
|
/**
|
|
68618
68749
|
* Creates a Unit with the provided name in this schema.
|
|
68619
68750
|
* @param name
|
|
68620
68751
|
*/
|
|
68621
68752
|
async createUnit(name) {
|
|
68622
|
-
return this.createItem(
|
|
68753
|
+
return this.createItem(_Unit__WEBPACK_IMPORTED_MODULE_21__.Unit, name);
|
|
68623
68754
|
}
|
|
68624
68755
|
createUnitSync(name) {
|
|
68625
|
-
return this.createItem(
|
|
68756
|
+
return this.createItem(_Unit__WEBPACK_IMPORTED_MODULE_21__.Unit, name);
|
|
68626
68757
|
}
|
|
68627
68758
|
/**
|
|
68628
68759
|
* Creates an PropertyCategory with the provided name in this schema.
|
|
68629
68760
|
* @param name
|
|
68630
68761
|
*/
|
|
68631
68762
|
async createPropertyCategory(name) {
|
|
68632
|
-
return this.createItem(
|
|
68763
|
+
return this.createItem(_PropertyCategory__WEBPACK_IMPORTED_MODULE_18__.PropertyCategory, name);
|
|
68633
68764
|
}
|
|
68634
68765
|
createPropertyCategorySync(name) {
|
|
68635
|
-
return this.createItem(
|
|
68766
|
+
return this.createItem(_PropertyCategory__WEBPACK_IMPORTED_MODULE_18__.PropertyCategory, name);
|
|
68636
68767
|
}
|
|
68637
68768
|
/**
|
|
68638
68769
|
*
|
|
@@ -68659,9 +68790,9 @@ class Schema {
|
|
|
68659
68790
|
*/
|
|
68660
68791
|
setVersion(readVersion, writeVersion, minorVersion) {
|
|
68661
68792
|
if (!this._schemaKey)
|
|
68662
|
-
throw new
|
|
68663
|
-
const newVersion = new
|
|
68664
|
-
this._schemaKey = new
|
|
68793
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidSchemaKey, `The schema '${this.name}' has an invalid SchemaKey.`);
|
|
68794
|
+
const newVersion = new _SchemaKey__WEBPACK_IMPORTED_MODULE_5__.ECVersion(readVersion ?? this._schemaKey.readVersion, writeVersion ?? this._schemaKey.writeVersion, minorVersion ?? this._schemaKey.minorVersion);
|
|
68795
|
+
this._schemaKey = new _SchemaKey__WEBPACK_IMPORTED_MODULE_5__.SchemaKey(this._schemaKey.name, newVersion);
|
|
68665
68796
|
}
|
|
68666
68797
|
/**
|
|
68667
68798
|
* Gets an item from within this schema. To get by full name use lookupItem instead.
|
|
@@ -68686,7 +68817,7 @@ class Schema {
|
|
|
68686
68817
|
async lookupItem(key) {
|
|
68687
68818
|
let schemaName, itemName;
|
|
68688
68819
|
if (typeof (key) === "string") {
|
|
68689
|
-
[schemaName, itemName] =
|
|
68820
|
+
[schemaName, itemName] = _SchemaItem__WEBPACK_IMPORTED_MODULE_20__.SchemaItem.parseFullName(key);
|
|
68690
68821
|
}
|
|
68691
68822
|
else {
|
|
68692
68823
|
itemName = key.name;
|
|
@@ -68707,7 +68838,7 @@ class Schema {
|
|
|
68707
68838
|
lookupItemSync(key) {
|
|
68708
68839
|
let schemaName, itemName;
|
|
68709
68840
|
if (typeof (key) === "string") {
|
|
68710
|
-
[schemaName, itemName] =
|
|
68841
|
+
[schemaName, itemName] = _SchemaItem__WEBPACK_IMPORTED_MODULE_20__.SchemaItem.parseFullName(key);
|
|
68711
68842
|
}
|
|
68712
68843
|
else {
|
|
68713
68844
|
itemName = key.name;
|
|
@@ -68728,7 +68859,7 @@ class Schema {
|
|
|
68728
68859
|
}
|
|
68729
68860
|
*getClasses() {
|
|
68730
68861
|
for (const [, value] of this._items) {
|
|
68731
|
-
if (
|
|
68862
|
+
if (_Class__WEBPACK_IMPORTED_MODULE_7__.ECClass.isECClass(value))
|
|
68732
68863
|
yield value;
|
|
68733
68864
|
}
|
|
68734
68865
|
}
|
|
@@ -68752,6 +68883,8 @@ class Schema {
|
|
|
68752
68883
|
* Save this Schema's properties to an object for serializing to JSON.
|
|
68753
68884
|
*/
|
|
68754
68885
|
toJSON() {
|
|
68886
|
+
if (!this.isECSpecVersionSupported())
|
|
68887
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECSpecVersion and cannot be serialized.`);
|
|
68755
68888
|
const schemaJson = {};
|
|
68756
68889
|
schemaJson.$schema = SCHEMAURL3_2_JSON; // $schema is required
|
|
68757
68890
|
schemaJson.name = this.name; // name is required
|
|
@@ -68763,7 +68896,7 @@ class Schema {
|
|
|
68763
68896
|
schemaJson.description = this.description;
|
|
68764
68897
|
if (undefined !== this.references && this.references.length > 0) // references is optional
|
|
68765
68898
|
schemaJson.references = this.references.map(({ name, schemaKey }) => ({ name, version: schemaKey.version.toString() }));
|
|
68766
|
-
const customAttributes = (0,
|
|
68899
|
+
const customAttributes = (0,_CustomAttribute__WEBPACK_IMPORTED_MODULE_9__.serializeCustomAttributes)(this.customAttributes);
|
|
68767
68900
|
if (undefined !== customAttributes)
|
|
68768
68901
|
schemaJson.customAttributes = customAttributes;
|
|
68769
68902
|
if (this._items.size > 0) {
|
|
@@ -68779,6 +68912,8 @@ class Schema {
|
|
|
68779
68912
|
* @param schemaXml An empty DOM document to which the schema will be written
|
|
68780
68913
|
*/
|
|
68781
68914
|
async toXml(schemaXml) {
|
|
68915
|
+
if (!this.isECSpecVersionSupported())
|
|
68916
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECSpecVersion and cannot be serialized.`);
|
|
68782
68917
|
const schemaMetadata = schemaXml.createElement("ECSchema");
|
|
68783
68918
|
schemaMetadata.setAttribute("xmlns", SCHEMAURL3_2_XML);
|
|
68784
68919
|
schemaMetadata.setAttribute("version", this.schemaKey.version.toString());
|
|
@@ -68801,7 +68936,7 @@ class Schema {
|
|
|
68801
68936
|
if (this._customAttributes) {
|
|
68802
68937
|
const parentElem = schemaXml.createElement("ECCustomAttributes");
|
|
68803
68938
|
for (const [name, attribute] of this._customAttributes) {
|
|
68804
|
-
const caElem = await
|
|
68939
|
+
const caElem = await _Deserialization_XmlSerializationUtils__WEBPACK_IMPORTED_MODULE_3__.XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this);
|
|
68805
68940
|
parentElem.appendChild(caElem);
|
|
68806
68941
|
}
|
|
68807
68942
|
schemaMetadata.appendChild(parentElem);
|
|
@@ -68813,28 +68948,67 @@ class Schema {
|
|
|
68813
68948
|
schemaXml.appendChild(schemaMetadata);
|
|
68814
68949
|
return schemaXml;
|
|
68815
68950
|
}
|
|
68951
|
+
// Check if the ECSpecVersion read-version is greater than the current ECSpecVersion supported.
|
|
68952
|
+
// If a specific ECSpecVersion is given, check against that version.
|
|
68953
|
+
// If no argument is given, check against the original ECSpecVersion of the schema.
|
|
68954
|
+
isECSpecMajorVersionSupported(ecSpecMajorVersionToCheck) {
|
|
68955
|
+
// If argument is supplied, check the argument against the current ECSpecVersion supported
|
|
68956
|
+
if (ecSpecMajorVersionToCheck !== undefined)
|
|
68957
|
+
return (Schema.currentECSpecMajorVersion >= ecSpecMajorVersionToCheck);
|
|
68958
|
+
// If argument is not supplied, check against the original ECSpecVersion of the schema
|
|
68959
|
+
if (this.originalECSpecMajorVersion === undefined)
|
|
68960
|
+
return false;
|
|
68961
|
+
return (Schema.currentECSpecMajorVersion >= this.originalECSpecMajorVersion);
|
|
68962
|
+
}
|
|
68963
|
+
// Check if the full ECSpecVersion is greater than the current ECSpecVersion supported.
|
|
68964
|
+
// If a specific ECSpecVersion is given, check against that version.
|
|
68965
|
+
// If no argument is given, check against the original ECSpecVersion of the schema.
|
|
68966
|
+
isECSpecVersionSupported(ecSpecMajorVersionToCheck, ecSpecMinorVersionToCheck) {
|
|
68967
|
+
// If arguments are supplied, check the arguments against the current ECSpecVersion supported
|
|
68968
|
+
if (ecSpecMajorVersionToCheck !== undefined && ecSpecMinorVersionToCheck !== undefined) {
|
|
68969
|
+
if (!this.isECSpecMajorVersionSupported(ecSpecMajorVersionToCheck))
|
|
68970
|
+
return false;
|
|
68971
|
+
return (Schema.currentECSpecMinorVersion >= ecSpecMinorVersionToCheck);
|
|
68972
|
+
}
|
|
68973
|
+
// If arguments are not supplied, check against the original ECSpecVersion of the schema
|
|
68974
|
+
if (!this.isECSpecMajorVersionSupported() || this.originalECSpecMinorVersion === undefined)
|
|
68975
|
+
return false;
|
|
68976
|
+
return (Schema.currentECSpecMinorVersion >= this.originalECSpecMinorVersion);
|
|
68977
|
+
}
|
|
68816
68978
|
/**
|
|
68817
68979
|
* Loads the schema header (name, version alias, label and description) from the input SchemaProps
|
|
68818
68980
|
*/
|
|
68819
68981
|
fromJSONSync(schemaProps) {
|
|
68820
68982
|
if (undefined === this._schemaKey) {
|
|
68821
68983
|
const schemaName = schemaProps.name;
|
|
68822
|
-
const version =
|
|
68823
|
-
this._schemaKey = new
|
|
68984
|
+
const version = _SchemaKey__WEBPACK_IMPORTED_MODULE_5__.ECVersion.fromString(schemaProps.version);
|
|
68985
|
+
this._schemaKey = new _SchemaKey__WEBPACK_IMPORTED_MODULE_5__.SchemaKey(schemaName, version);
|
|
68824
68986
|
}
|
|
68825
68987
|
else {
|
|
68826
68988
|
if (schemaProps.name.toLowerCase() !== this.name.toLowerCase())
|
|
68827
|
-
throw new
|
|
68828
|
-
if (this.schemaKey.version.compare(
|
|
68829
|
-
throw new
|
|
68989
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidECJson, `The Schema ${this.name} does not match the provided name, '${schemaProps.name}'.`);
|
|
68990
|
+
if (this.schemaKey.version.compare(_SchemaKey__WEBPACK_IMPORTED_MODULE_5__.ECVersion.fromString(schemaProps.version)))
|
|
68991
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidECJson, `The Schema ${this.name} has the version '${this.schemaKey.version}' that does not match the provided version '${schemaProps.version}'.`);
|
|
68992
|
+
}
|
|
68993
|
+
if (schemaProps.$schema.match(`https://dev\\.bentley\\.com/json_schemas/ec/([0-9]+)/ecschema`) == null && schemaProps.$schema.match(`http://www\\.bentley\\.com/schemas/Bentley\\.ECXML\\.([0-9]+)`) == null)
|
|
68994
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.MissingSchemaUrl, `The Schema '${this.name}' has an unsupported namespace '${schemaProps.$schema}'.`);
|
|
68995
|
+
// The schema props have not been parsed. Parse the ECXml version from the $schema attribute
|
|
68996
|
+
let ecVersion;
|
|
68997
|
+
if (schemaProps.ecSpecMajorVersion === undefined || schemaProps.ecSpecMinorVersion === undefined) {
|
|
68998
|
+
ecVersion = ((schemaProps.$schema.search("ECXML") !== -1) ? _Deserialization_XmlParser__WEBPACK_IMPORTED_MODULE_2__.XmlParser.parseXmlNamespace(schemaProps.$schema) : _Deserialization_JsonParser__WEBPACK_IMPORTED_MODULE_1__.JsonParser.parseJSUri(schemaProps.$schema));
|
|
68830
68999
|
}
|
|
68831
|
-
|
|
68832
|
-
|
|
68833
|
-
|
|
69000
|
+
else {
|
|
69001
|
+
ecVersion = { readVersion: schemaProps.ecSpecMajorVersion, writeVersion: schemaProps.ecSpecMinorVersion };
|
|
69002
|
+
}
|
|
69003
|
+
this._originalECSpecMajorVersion = ecVersion?.readVersion;
|
|
69004
|
+
this._originalECSpecMinorVersion = ecVersion?.writeVersion;
|
|
69005
|
+
if (!this.isECSpecMajorVersionSupported(ecVersion?.readVersion))
|
|
69006
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECVersion and cannot be loaded.`);
|
|
69007
|
+
if (_ECName__WEBPACK_IMPORTED_MODULE_6__.ECName.validate(schemaProps.alias)) {
|
|
68834
69008
|
this._alias = schemaProps.alias;
|
|
68835
69009
|
}
|
|
68836
69010
|
else {
|
|
68837
|
-
throw new
|
|
69011
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidECJson, `The Schema ${schemaProps.name} does not have the required 'alias' attribute.`);
|
|
68838
69012
|
}
|
|
68839
69013
|
if (undefined !== schemaProps.label)
|
|
68840
69014
|
this._label = schemaProps.label;
|
|
@@ -68900,12 +69074,13 @@ class Schema {
|
|
|
68900
69074
|
* Used for schema editing.
|
|
68901
69075
|
*/
|
|
68902
69076
|
setAlias(alias) {
|
|
68903
|
-
if (!
|
|
68904
|
-
throw new
|
|
69077
|
+
if (!_ECName__WEBPACK_IMPORTED_MODULE_6__.ECName.validate(alias)) {
|
|
69078
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_4__.ECObjectsStatus.InvalidECName, "The specified schema alias is invalid.");
|
|
68905
69079
|
}
|
|
68906
69080
|
this._alias = alias;
|
|
68907
69081
|
}
|
|
68908
69082
|
}
|
|
69083
|
+
Schema._currentECSpecVersion = "3.2";
|
|
68909
69084
|
/**
|
|
68910
69085
|
* Hackish approach that works like a "friend class" so we can access protected members without making them public.
|
|
68911
69086
|
* We cannot put this into Helper.ts and make it non-export, because we are importing Helper.ts from this file, and the circular import
|
|
@@ -76704,7 +76879,6 @@ class BriefcaseEditorToolSettings {
|
|
|
76704
76879
|
* @public
|
|
76705
76880
|
*/
|
|
76706
76881
|
class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__.IModelConnection {
|
|
76707
|
-
/** @internal */
|
|
76708
76882
|
isBriefcaseConnection() { return true; }
|
|
76709
76883
|
/** The Guid that identifies the iTwin that owns this iModel. */
|
|
76710
76884
|
get iTwinId() { return super.iTwinId; } // GuidString | undefined for IModelConnection, but required for BriefcaseConnection
|
|
@@ -78916,7 +79090,6 @@ class DrawingViewState extends _ViewState__WEBPACK_IMPORTED_MODULE_14__.ViewStat
|
|
|
78916
79090
|
super.detachFromViewport();
|
|
78917
79091
|
this._attachment = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.dispose)(this._attachment);
|
|
78918
79092
|
}
|
|
78919
|
-
/** @internal */
|
|
78920
79093
|
async changeViewedModel(modelId) {
|
|
78921
79094
|
await super.changeViewedModel(modelId);
|
|
78922
79095
|
const props = await this.querySectionDrawingProps();
|
|
@@ -78991,7 +79164,6 @@ class DrawingViewState extends _ViewState__WEBPACK_IMPORTED_MODULE_14__.ViewStat
|
|
|
78991
79164
|
max: 3 * _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Constant.diameterOfEarth,
|
|
78992
79165
|
};
|
|
78993
79166
|
}
|
|
78994
|
-
/** @internal */
|
|
78995
79167
|
isDrawingView() { return true; }
|
|
78996
79168
|
/** See [[ViewState.getOrigin]]. */
|
|
78997
79169
|
getOrigin() {
|
|
@@ -79020,7 +79192,6 @@ class DrawingViewState extends _ViewState__WEBPACK_IMPORTED_MODULE_14__.ViewStat
|
|
|
79020
79192
|
if (this._attachment)
|
|
79021
79193
|
this._attachment.addToScene(context);
|
|
79022
79194
|
}
|
|
79023
|
-
/** @internal */
|
|
79024
79195
|
get areAllTileTreesLoaded() {
|
|
79025
79196
|
return super.areAllTileTreesLoaded && (!this._attachment || this._attachment.view.areAllTileTreesLoaded);
|
|
79026
79197
|
}
|
|
@@ -85022,11 +85193,9 @@ class GeometricModelState extends ModelState {
|
|
|
85022
85193
|
super(props, iModel, state);
|
|
85023
85194
|
this.geometryGuid = props.geometryGuid;
|
|
85024
85195
|
}
|
|
85025
|
-
/** @internal */
|
|
85026
85196
|
get asGeometricModel() { return this; }
|
|
85027
85197
|
/** Returns true if this is a 2d model (a [[GeometricModel2dState]]). */
|
|
85028
85198
|
get is2d() { return !this.is3d; }
|
|
85029
|
-
/** @internal */
|
|
85030
85199
|
get isGeometricModel() { return true; }
|
|
85031
85200
|
/** @internal */
|
|
85032
85201
|
get treeModelId() { return this.id; }
|
|
@@ -85121,9 +85290,7 @@ class GeometricModel2dState extends GeometricModelState {
|
|
|
85121
85290
|
super(props, iModel, state);
|
|
85122
85291
|
this.globalOrigin = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point2d.fromJSON(props.globalOrigin);
|
|
85123
85292
|
}
|
|
85124
|
-
/** @internal */
|
|
85125
85293
|
get is3d() { return false; }
|
|
85126
|
-
/** @internal */
|
|
85127
85294
|
get asGeometricModel2d() { return this; }
|
|
85128
85295
|
toJSON() {
|
|
85129
85296
|
const val = super.toJSON();
|
|
@@ -85142,7 +85309,6 @@ class GeometricModel3dState extends GeometricModelState {
|
|
|
85142
85309
|
this.isNotSpatiallyLocated = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.JsonUtils.asBool(props.isNotSpatiallyLocated);
|
|
85143
85310
|
this.isPlanProjection = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.JsonUtils.asBool(props.isPlanProjection);
|
|
85144
85311
|
}
|
|
85145
|
-
/** @internal */
|
|
85146
85312
|
toJSON() {
|
|
85147
85313
|
const val = super.toJSON();
|
|
85148
85314
|
if (this.isNotSpatiallyLocated)
|
|
@@ -85151,9 +85317,7 @@ class GeometricModel3dState extends GeometricModelState {
|
|
|
85151
85317
|
val.isPlanProjection = true;
|
|
85152
85318
|
return val;
|
|
85153
85319
|
}
|
|
85154
|
-
/** @internal */
|
|
85155
85320
|
get is3d() { return true; }
|
|
85156
|
-
/** @internal */
|
|
85157
85321
|
get asGeometricModel3d() { return this; }
|
|
85158
85322
|
/** If true, then the elements in this GeometricModel3dState are in real-world coordinates and will be in the spatial index. */
|
|
85159
85323
|
get isSpatiallyLocated() { return !this.isNotSpatiallyLocated; }
|
|
@@ -85171,7 +85335,6 @@ class SheetModelState extends GeometricModel2dState {
|
|
|
85171
85335
|
*/
|
|
85172
85336
|
class SpatialModelState extends GeometricModel3dState {
|
|
85173
85337
|
static get className() { return "SpatialModel"; }
|
|
85174
|
-
/** @internal */
|
|
85175
85338
|
get asSpatialModel() { return this; }
|
|
85176
85339
|
constructor(props, iModel, state) {
|
|
85177
85340
|
super(props, iModel, state);
|
|
@@ -87723,9 +87886,7 @@ class SheetViewState extends _ViewState__WEBPACK_IMPORTED_MODULE_12__.ViewState2
|
|
|
87723
87886
|
get attachments() {
|
|
87724
87887
|
return this._attachments?.attachments;
|
|
87725
87888
|
}
|
|
87726
|
-
/** @internal */
|
|
87727
87889
|
isDrawingView() { return false; }
|
|
87728
|
-
/** @internal */
|
|
87729
87890
|
isSheetView() { return true; }
|
|
87730
87891
|
constructor(props, iModel, categories, displayStyle, sheetProps, attachments) {
|
|
87731
87892
|
super(props, iModel, categories, displayStyle);
|
|
@@ -87768,11 +87929,9 @@ class SheetViewState extends _ViewState__WEBPACK_IMPORTED_MODULE_12__.ViewState2
|
|
|
87768
87929
|
if (this._attachments)
|
|
87769
87930
|
this._attachments.collectStatistics(stats);
|
|
87770
87931
|
}
|
|
87771
|
-
/** @internal */
|
|
87772
87932
|
get defaultExtentLimits() {
|
|
87773
87933
|
return { min: _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Constant.oneMillimeter, max: this.sheetSize.magnitude() * 10 };
|
|
87774
87934
|
}
|
|
87775
|
-
/** @internal */
|
|
87776
87935
|
getViewedExtents() {
|
|
87777
87936
|
return this._viewedExtents;
|
|
87778
87937
|
}
|
|
@@ -87818,7 +87977,6 @@ class SheetViewState extends _ViewState__WEBPACK_IMPORTED_MODULE_12__.ViewState2
|
|
|
87818
87977
|
ids.push(row[0]);
|
|
87819
87978
|
return ids;
|
|
87820
87979
|
}
|
|
87821
|
-
/** @internal */
|
|
87822
87980
|
async changeViewedModel(modelId) {
|
|
87823
87981
|
await super.changeViewedModel(modelId);
|
|
87824
87982
|
const attachmentIds = await this.queryAttachmentIds();
|
|
@@ -87836,7 +87994,6 @@ class SheetViewState extends _ViewState__WEBPACK_IMPORTED_MODULE_12__.ViewState2
|
|
|
87836
87994
|
super.detachFromViewport();
|
|
87837
87995
|
this._attachments = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.dispose)(this._attachments);
|
|
87838
87996
|
}
|
|
87839
|
-
/** @internal */
|
|
87840
87997
|
get areAllTileTreesLoaded() {
|
|
87841
87998
|
return super.areAllTileTreesLoaded && (!this._attachments || this._attachments.areAllTileTreesLoaded);
|
|
87842
87999
|
}
|
|
@@ -88451,7 +88608,6 @@ class SpatialViewState extends _ViewState__WEBPACK_IMPORTED_MODULE_6__.ViewState
|
|
|
88451
88608
|
this._modelSelector = arg3.modelSelector.clone();
|
|
88452
88609
|
this._treeRefs = _tile_internal__WEBPACK_IMPORTED_MODULE_7__.SpatialTileTreeReferences.create(this);
|
|
88453
88610
|
}
|
|
88454
|
-
/** @internal */
|
|
88455
88611
|
isSpatialView() { return true; }
|
|
88456
88612
|
equals(other) { return super.equals(other) && this.modelSelector.equals(other.modelSelector); }
|
|
88457
88613
|
createAuxCoordSystem(acsName) { return _AuxCoordSys__WEBPACK_IMPORTED_MODULE_2__.AuxCoordSystemSpatialState.createNew(acsName, this.iModel); }
|
|
@@ -304482,7 +304638,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
304482
304638
|
/***/ ((module) => {
|
|
304483
304639
|
|
|
304484
304640
|
"use strict";
|
|
304485
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.10.0-dev.
|
|
304641
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.10.0-dev.39","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 ES2020 --outDir lib/esm","clean":"rimraf 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 --includes=../../generated-docs/extract --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","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 --coverage","test:debug":"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:^4.10.0-dev.39","@itwin/core-bentley":"workspace:^4.10.0-dev.39","@itwin/core-common":"workspace:^4.10.0-dev.39","@itwin/core-geometry":"workspace:^4.10.0-dev.39","@itwin/core-orbitgt":"workspace:^4.10.0-dev.39","@itwin/core-quantity":"workspace:^4.10.0-dev.39"},"//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/eslint-plugin":"5.0.0-dev.1","@types/chai-as-promised":"^7","@vitest/browser":"^2.1.0","@vitest/coverage-v8":"^2.1.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","cpx2":"^3.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^3.0.2","source-map-loader":"^4.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^2.1.0","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"1.0.6","webpack":"^5.76.0"},"//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.2.5","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","meshoptimizer":"~0.20.0","wms-capabilities":"0.4.0"}}');
|
|
304486
304642
|
|
|
304487
304643
|
/***/ })
|
|
304488
304644
|
|