@itwin/ecschema-editing 3.0.0-dev.77 → 3.0.0-dev.81
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/{Editing → cjs/Editing}/Constants.d.ts +0 -0
- package/lib/cjs/Editing/Constants.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Constants.js +0 -0
- package/lib/cjs/Editing/Constants.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/CustomAttributes.d.ts +0 -0
- package/lib/cjs/Editing/CustomAttributes.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/CustomAttributes.js +0 -0
- package/lib/cjs/Editing/CustomAttributes.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/ECClasses.d.ts +0 -0
- package/lib/cjs/Editing/ECClasses.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/ECClasses.js +0 -0
- package/lib/cjs/Editing/ECClasses.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Editor.d.ts +0 -0
- package/lib/cjs/Editing/Editor.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Editor.js +4 -33
- package/lib/cjs/Editing/Editor.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Entities.d.ts +0 -0
- package/lib/cjs/Editing/Entities.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Entities.js +0 -0
- package/lib/cjs/Editing/Entities.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Enumerations.d.ts +0 -0
- package/lib/cjs/Editing/Enumerations.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Enumerations.js +0 -0
- package/lib/cjs/Editing/Enumerations.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Formats.d.ts +0 -0
- package/lib/cjs/Editing/Formats.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Formats.js +0 -0
- package/lib/cjs/Editing/Formats.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/InvertedUnits.d.ts +0 -0
- package/lib/cjs/Editing/InvertedUnits.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/InvertedUnits.js +0 -0
- package/lib/cjs/Editing/InvertedUnits.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/KindOfQuantities.d.ts +0 -0
- package/lib/cjs/Editing/KindOfQuantities.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/KindOfQuantities.js +0 -0
- package/lib/cjs/Editing/KindOfQuantities.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mixins.d.ts +0 -0
- package/lib/cjs/Editing/Mixins.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mixins.js +0 -0
- package/lib/cjs/Editing/Mixins.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableCAClass.d.ts +0 -0
- package/lib/cjs/Editing/Mutable/MutableCAClass.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableCAClass.js +0 -0
- package/lib/cjs/Editing/Mutable/MutableCAClass.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableClass.d.ts +0 -0
- package/lib/cjs/Editing/Mutable/MutableClass.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableClass.js +0 -0
- package/lib/cjs/Editing/Mutable/MutableClass.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableConstant.d.ts +0 -0
- package/lib/cjs/Editing/Mutable/MutableConstant.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableConstant.js +0 -0
- package/lib/cjs/Editing/Mutable/MutableConstant.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableEntityClass.d.ts +0 -0
- package/lib/cjs/Editing/Mutable/MutableEntityClass.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableEntityClass.js +0 -0
- package/lib/cjs/Editing/Mutable/MutableEntityClass.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableEnumeration.d.ts +0 -0
- package/lib/cjs/Editing/Mutable/MutableEnumeration.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableEnumeration.js +0 -0
- package/lib/cjs/Editing/Mutable/MutableEnumeration.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableFormat.d.ts +0 -0
- package/lib/cjs/Editing/Mutable/MutableFormat.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableFormat.js +0 -0
- package/lib/cjs/Editing/Mutable/MutableFormat.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableInvertedUnit.d.ts +0 -0
- package/lib/cjs/Editing/Mutable/MutableInvertedUnit.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableInvertedUnit.js +0 -0
- package/lib/cjs/Editing/Mutable/MutableInvertedUnit.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableKindOfQuantity.d.ts +0 -0
- package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableKindOfQuantity.js +0 -0
- package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableMixin.d.ts +0 -0
- package/lib/cjs/Editing/Mutable/MutableMixin.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableMixin.js +0 -0
- package/lib/cjs/Editing/Mutable/MutableMixin.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutablePhenomenon.d.ts +0 -0
- package/lib/cjs/Editing/Mutable/MutablePhenomenon.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutablePhenomenon.js +0 -0
- package/lib/cjs/Editing/Mutable/MutablePhenomenon.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableProperty.d.ts +0 -0
- package/lib/cjs/Editing/Mutable/MutableProperty.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableProperty.js +0 -0
- package/lib/cjs/Editing/Mutable/MutableProperty.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutablePropertyCategory.d.ts +0 -0
- package/lib/cjs/Editing/Mutable/MutablePropertyCategory.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutablePropertyCategory.js +0 -0
- package/lib/cjs/Editing/Mutable/MutablePropertyCategory.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableRelationshipClass.d.ts +0 -0
- package/lib/cjs/Editing/Mutable/MutableRelationshipClass.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableRelationshipClass.js +0 -0
- package/lib/cjs/Editing/Mutable/MutableRelationshipClass.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableSchema.d.ts +0 -0
- package/lib/cjs/Editing/Mutable/MutableSchema.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableSchema.js +0 -0
- package/lib/cjs/Editing/Mutable/MutableSchema.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableUnit.d.ts +0 -0
- package/lib/cjs/Editing/Mutable/MutableUnit.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableUnit.js +0 -0
- package/lib/cjs/Editing/Mutable/MutableUnit.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableUnitSystem.d.ts +0 -0
- package/lib/cjs/Editing/Mutable/MutableUnitSystem.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Mutable/MutableUnitSystem.js +0 -0
- package/lib/cjs/Editing/Mutable/MutableUnitSystem.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Phenomena.d.ts +0 -0
- package/lib/cjs/Editing/Phenomena.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Phenomena.js +0 -0
- package/lib/cjs/Editing/Phenomena.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/PropertyCategories.d.ts +0 -0
- package/lib/cjs/Editing/PropertyCategories.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/PropertyCategories.js +0 -0
- package/lib/cjs/Editing/PropertyCategories.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/RelationshipClasses.d.ts +0 -0
- package/lib/cjs/Editing/RelationshipClasses.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/RelationshipClasses.js +0 -0
- package/lib/cjs/Editing/RelationshipClasses.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Structs.d.ts +0 -0
- package/lib/cjs/Editing/Structs.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Structs.js +0 -0
- package/lib/cjs/Editing/Structs.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/UnitSystems.d.ts +0 -0
- package/lib/cjs/Editing/UnitSystems.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/UnitSystems.js +0 -0
- package/lib/cjs/Editing/UnitSystems.js.map +1 -0
- package/lib/{Editing → cjs/Editing}/Units.d.ts +0 -0
- package/lib/cjs/Editing/Units.d.ts.map +1 -0
- package/lib/{Editing → cjs/Editing}/Units.js +0 -0
- package/lib/cjs/Editing/Units.js.map +1 -0
- package/lib/{Validation → cjs/Validation}/Diagnostic.d.ts +0 -0
- package/lib/cjs/Validation/Diagnostic.d.ts.map +1 -0
- package/lib/{Validation → cjs/Validation}/Diagnostic.js +0 -0
- package/lib/cjs/Validation/Diagnostic.js.map +1 -0
- package/lib/{Validation → cjs/Validation}/DiagnosticReporter.d.ts +0 -0
- package/lib/cjs/Validation/DiagnosticReporter.d.ts.map +1 -0
- package/lib/{Validation → cjs/Validation}/DiagnosticReporter.js +0 -0
- package/lib/cjs/Validation/DiagnosticReporter.js.map +1 -0
- package/lib/{Validation → cjs/Validation}/ECRules.d.ts +0 -0
- package/lib/cjs/Validation/ECRules.d.ts.map +1 -0
- package/lib/{Validation → cjs/Validation}/ECRules.js +235 -330
- package/lib/cjs/Validation/ECRules.js.map +1 -0
- package/lib/{Validation → cjs/Validation}/LoggingDiagnosticReporter.d.ts +0 -0
- package/lib/cjs/Validation/LoggingDiagnosticReporter.d.ts.map +1 -0
- package/lib/{Validation → cjs/Validation}/LoggingDiagnosticReporter.js +1 -1
- package/lib/cjs/Validation/LoggingDiagnosticReporter.js.map +1 -0
- package/lib/{Validation → cjs/Validation}/RuleSuppressionSet.d.ts +0 -0
- package/lib/cjs/Validation/RuleSuppressionSet.d.ts.map +1 -0
- package/lib/{Validation → cjs/Validation}/RuleSuppressionSet.js +0 -0
- package/lib/cjs/Validation/RuleSuppressionSet.js.map +1 -0
- package/lib/{Validation → cjs/Validation}/Rules.d.ts +0 -0
- package/lib/cjs/Validation/Rules.d.ts.map +1 -0
- package/lib/{Validation → cjs/Validation}/Rules.js +0 -0
- package/lib/cjs/Validation/Rules.js.map +1 -0
- package/lib/{Validation → cjs/Validation}/SchemaChanges.d.ts +0 -0
- package/lib/cjs/Validation/SchemaChanges.d.ts.map +1 -0
- package/lib/{Validation → cjs/Validation}/SchemaChanges.js +0 -0
- package/lib/cjs/Validation/SchemaChanges.js.map +1 -0
- package/lib/{Validation → cjs/Validation}/SchemaCompareDiagnostics.d.ts +0 -0
- package/lib/cjs/Validation/SchemaCompareDiagnostics.d.ts.map +1 -0
- package/lib/{Validation → cjs/Validation}/SchemaCompareDiagnostics.js +0 -0
- package/lib/cjs/Validation/SchemaCompareDiagnostics.js.map +1 -0
- package/lib/{Validation → cjs/Validation}/SchemaCompareReporter.d.ts +0 -0
- package/lib/cjs/Validation/SchemaCompareReporter.d.ts.map +1 -0
- package/lib/{Validation → cjs/Validation}/SchemaCompareReporter.js +0 -0
- package/lib/cjs/Validation/SchemaCompareReporter.js.map +1 -0
- package/lib/{Validation → cjs/Validation}/SchemaCompareResultDelegate.d.ts +0 -0
- package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts.map +1 -0
- package/lib/{Validation → cjs/Validation}/SchemaCompareResultDelegate.js +0 -0
- package/lib/cjs/Validation/SchemaCompareResultDelegate.js.map +1 -0
- package/lib/{Validation → cjs/Validation}/SchemaCompareVisitor.d.ts +0 -0
- package/lib/cjs/Validation/SchemaCompareVisitor.d.ts.map +1 -0
- package/lib/{Validation → cjs/Validation}/SchemaCompareVisitor.js +0 -0
- package/lib/cjs/Validation/SchemaCompareVisitor.js.map +1 -0
- package/lib/{Validation → cjs/Validation}/SchemaComparer.d.ts +0 -0
- package/lib/cjs/Validation/SchemaComparer.d.ts.map +1 -0
- package/lib/{Validation → cjs/Validation}/SchemaComparer.js +0 -0
- package/lib/cjs/Validation/SchemaComparer.js.map +1 -0
- package/lib/{Validation → cjs/Validation}/SchemaValidater.d.ts +0 -0
- package/lib/cjs/Validation/SchemaValidater.d.ts.map +1 -0
- package/lib/{Validation → cjs/Validation}/SchemaValidater.js +0 -0
- package/lib/cjs/Validation/SchemaValidater.js.map +1 -0
- package/lib/{Validation → cjs/Validation}/SchemaValidationVisitor.d.ts +0 -0
- package/lib/cjs/Validation/SchemaValidationVisitor.d.ts.map +1 -0
- package/lib/cjs/Validation/SchemaValidationVisitor.js +491 -0
- package/lib/cjs/Validation/SchemaValidationVisitor.js.map +1 -0
- package/lib/{Validation → cjs/Validation}/SchemaWalker.d.ts +0 -0
- package/lib/cjs/Validation/SchemaWalker.d.ts.map +1 -0
- package/lib/{Validation → cjs/Validation}/SchemaWalker.js +0 -0
- package/lib/cjs/Validation/SchemaWalker.js.map +1 -0
- package/lib/{ecschema-editing.d.ts → cjs/ecschema-editing.d.ts} +0 -0
- package/lib/cjs/ecschema-editing.d.ts.map +1 -0
- package/lib/{ecschema-editing.js → cjs/ecschema-editing.js} +0 -0
- package/lib/cjs/ecschema-editing.js.map +1 -0
- package/package.json +15 -14
- package/lib/Editing/Constants.d.ts.map +0 -1
- package/lib/Editing/Constants.js.map +0 -1
- package/lib/Editing/CustomAttributes.d.ts.map +0 -1
- package/lib/Editing/CustomAttributes.js.map +0 -1
- package/lib/Editing/ECClasses.d.ts.map +0 -1
- package/lib/Editing/ECClasses.js.map +0 -1
- package/lib/Editing/Editor.d.ts.map +0 -1
- package/lib/Editing/Editor.js.map +0 -1
- package/lib/Editing/Entities.d.ts.map +0 -1
- package/lib/Editing/Entities.js.map +0 -1
- package/lib/Editing/Enumerations.d.ts.map +0 -1
- package/lib/Editing/Enumerations.js.map +0 -1
- package/lib/Editing/Formats.d.ts.map +0 -1
- package/lib/Editing/Formats.js.map +0 -1
- package/lib/Editing/InvertedUnits.d.ts.map +0 -1
- package/lib/Editing/InvertedUnits.js.map +0 -1
- package/lib/Editing/KindOfQuantities.d.ts.map +0 -1
- package/lib/Editing/KindOfQuantities.js.map +0 -1
- package/lib/Editing/Mixins.d.ts.map +0 -1
- package/lib/Editing/Mixins.js.map +0 -1
- package/lib/Editing/Mutable/MutableCAClass.d.ts.map +0 -1
- package/lib/Editing/Mutable/MutableCAClass.js.map +0 -1
- package/lib/Editing/Mutable/MutableClass.d.ts.map +0 -1
- package/lib/Editing/Mutable/MutableClass.js.map +0 -1
- package/lib/Editing/Mutable/MutableConstant.d.ts.map +0 -1
- package/lib/Editing/Mutable/MutableConstant.js.map +0 -1
- package/lib/Editing/Mutable/MutableEntityClass.d.ts.map +0 -1
- package/lib/Editing/Mutable/MutableEntityClass.js.map +0 -1
- package/lib/Editing/Mutable/MutableEnumeration.d.ts.map +0 -1
- package/lib/Editing/Mutable/MutableEnumeration.js.map +0 -1
- package/lib/Editing/Mutable/MutableFormat.d.ts.map +0 -1
- package/lib/Editing/Mutable/MutableFormat.js.map +0 -1
- package/lib/Editing/Mutable/MutableInvertedUnit.d.ts.map +0 -1
- package/lib/Editing/Mutable/MutableInvertedUnit.js.map +0 -1
- package/lib/Editing/Mutable/MutableKindOfQuantity.d.ts.map +0 -1
- package/lib/Editing/Mutable/MutableKindOfQuantity.js.map +0 -1
- package/lib/Editing/Mutable/MutableMixin.d.ts.map +0 -1
- package/lib/Editing/Mutable/MutableMixin.js.map +0 -1
- package/lib/Editing/Mutable/MutablePhenomenon.d.ts.map +0 -1
- package/lib/Editing/Mutable/MutablePhenomenon.js.map +0 -1
- package/lib/Editing/Mutable/MutableProperty.d.ts.map +0 -1
- package/lib/Editing/Mutable/MutableProperty.js.map +0 -1
- package/lib/Editing/Mutable/MutablePropertyCategory.d.ts.map +0 -1
- package/lib/Editing/Mutable/MutablePropertyCategory.js.map +0 -1
- package/lib/Editing/Mutable/MutableRelationshipClass.d.ts.map +0 -1
- package/lib/Editing/Mutable/MutableRelationshipClass.js.map +0 -1
- package/lib/Editing/Mutable/MutableSchema.d.ts.map +0 -1
- package/lib/Editing/Mutable/MutableSchema.js.map +0 -1
- package/lib/Editing/Mutable/MutableUnit.d.ts.map +0 -1
- package/lib/Editing/Mutable/MutableUnit.js.map +0 -1
- package/lib/Editing/Mutable/MutableUnitSystem.d.ts.map +0 -1
- package/lib/Editing/Mutable/MutableUnitSystem.js.map +0 -1
- package/lib/Editing/Phenomena.d.ts.map +0 -1
- package/lib/Editing/Phenomena.js.map +0 -1
- package/lib/Editing/PropertyCategories.d.ts.map +0 -1
- package/lib/Editing/PropertyCategories.js.map +0 -1
- package/lib/Editing/RelationshipClasses.d.ts.map +0 -1
- package/lib/Editing/RelationshipClasses.js.map +0 -1
- package/lib/Editing/Structs.d.ts.map +0 -1
- package/lib/Editing/Structs.js.map +0 -1
- package/lib/Editing/UnitSystems.d.ts.map +0 -1
- package/lib/Editing/UnitSystems.js.map +0 -1
- package/lib/Editing/Units.d.ts.map +0 -1
- package/lib/Editing/Units.js.map +0 -1
- package/lib/Validation/Diagnostic.d.ts.map +0 -1
- package/lib/Validation/Diagnostic.js.map +0 -1
- package/lib/Validation/DiagnosticReporter.d.ts.map +0 -1
- package/lib/Validation/DiagnosticReporter.js.map +0 -1
- package/lib/Validation/ECRules.d.ts.map +0 -1
- package/lib/Validation/ECRules.js.map +0 -1
- package/lib/Validation/LoggingDiagnosticReporter.d.ts.map +0 -1
- package/lib/Validation/LoggingDiagnosticReporter.js.map +0 -1
- package/lib/Validation/RuleSuppressionSet.d.ts.map +0 -1
- package/lib/Validation/RuleSuppressionSet.js.map +0 -1
- package/lib/Validation/Rules.d.ts.map +0 -1
- package/lib/Validation/Rules.js.map +0 -1
- package/lib/Validation/SchemaChanges.d.ts.map +0 -1
- package/lib/Validation/SchemaChanges.js.map +0 -1
- package/lib/Validation/SchemaCompareDiagnostics.d.ts.map +0 -1
- package/lib/Validation/SchemaCompareDiagnostics.js.map +0 -1
- package/lib/Validation/SchemaCompareReporter.d.ts.map +0 -1
- package/lib/Validation/SchemaCompareReporter.js.map +0 -1
- package/lib/Validation/SchemaCompareResultDelegate.d.ts.map +0 -1
- package/lib/Validation/SchemaCompareResultDelegate.js.map +0 -1
- package/lib/Validation/SchemaCompareVisitor.d.ts.map +0 -1
- package/lib/Validation/SchemaCompareVisitor.js.map +0 -1
- package/lib/Validation/SchemaComparer.d.ts.map +0 -1
- package/lib/Validation/SchemaComparer.js.map +0 -1
- package/lib/Validation/SchemaValidater.d.ts.map +0 -1
- package/lib/Validation/SchemaValidater.js.map +0 -1
- package/lib/Validation/SchemaValidationVisitor.d.ts.map +0 -1
- package/lib/Validation/SchemaValidationVisitor.js +0 -729
- package/lib/Validation/SchemaValidationVisitor.js.map +0 -1
- package/lib/Validation/SchemaWalker.d.ts.map +0 -1
- package/lib/Validation/SchemaWalker.js.map +0 -1
- package/lib/ecschema-editing.d.ts.map +0 -1
- package/lib/ecschema-editing.js.map +0 -1
|
@@ -6,30 +6,6 @@
|
|
|
6
6
|
/** @packageDocumentation
|
|
7
7
|
* @module Validation
|
|
8
8
|
*/
|
|
9
|
-
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
10
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
11
|
-
var m = o[Symbol.asyncIterator], i;
|
|
12
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
13
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
14
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
15
|
-
};
|
|
16
|
-
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
17
|
-
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
|
|
18
|
-
var i, p;
|
|
19
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
20
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
21
|
-
};
|
|
22
|
-
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
23
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
24
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
25
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
26
|
-
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
27
|
-
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
28
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
29
|
-
function fulfill(value) { resume("next", value); }
|
|
30
|
-
function reject(value) { resume("throw", value); }
|
|
31
|
-
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
32
|
-
};
|
|
33
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
10
|
exports.validateCustomAttributeInstance = exports.mixinAppliedToClassMustDeriveFromConstraint = exports.enumerationTypeUnsupported = exports.abstractConstraintMustExistWithMultipleConstraints = exports.atLeastOneConstraintClassDefined = exports.constraintClassesDeriveFromAbstractContraint = exports.derivedConstraintsMustNarrowBaseConstraints = exports.abstractConstraintMustNarrowBaseConstraints = exports.validateNavigationProperty = exports.incompatibleUnitPropertyOverride = exports.incompatibleTypePropertyOverride = exports.incompatibleValueTypePropertyOverride = exports.abstractClassWithNonAbstractBase = exports.baseClassIsOfDifferentType = exports.baseClassIsSealed = exports.validateSchemaReferencesSync = exports.validateSchemaReferences = exports.ECRuleSet = exports.Diagnostics = exports.DiagnosticCodes = void 0;
|
|
35
11
|
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
@@ -189,10 +165,8 @@ exports.ECRuleSet = {
|
|
|
189
165
|
* Validates schema references against multiple EC rules.
|
|
190
166
|
* @param schema The schema to validate.
|
|
191
167
|
*/
|
|
192
|
-
function validateSchemaReferences(schema) {
|
|
193
|
-
|
|
194
|
-
yield __await(yield* __asyncDelegator(__asyncValues(validateSchemaReferencesSync(schema))));
|
|
195
|
-
});
|
|
168
|
+
async function* validateSchemaReferences(schema) {
|
|
169
|
+
yield* validateSchemaReferencesSync(schema);
|
|
196
170
|
}
|
|
197
171
|
exports.validateSchemaReferences = validateSchemaReferences;
|
|
198
172
|
function* validateSchemaReferencesSync(schema) {
|
|
@@ -222,321 +196,264 @@ exports.validateSchemaReferencesSync = validateSchemaReferencesSync;
|
|
|
222
196
|
* EC Rule: Sealed classes cannot be a base class.
|
|
223
197
|
* @internal
|
|
224
198
|
*/
|
|
225
|
-
function baseClassIsSealed(ecClass) {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
yield yield __await(new exports.Diagnostics.BaseClassIsSealed(ecClass, [ecClass.fullName, baseClass.fullName]));
|
|
234
|
-
});
|
|
199
|
+
async function* baseClassIsSealed(ecClass) {
|
|
200
|
+
if (!ecClass.baseClass)
|
|
201
|
+
return;
|
|
202
|
+
const baseClass = await ecClass.baseClass;
|
|
203
|
+
// return if rule passed
|
|
204
|
+
if (baseClass.modifier !== ecschema_metadata_1.ECClassModifier.Sealed)
|
|
205
|
+
return;
|
|
206
|
+
yield new exports.Diagnostics.BaseClassIsSealed(ecClass, [ecClass.fullName, baseClass.fullName]);
|
|
235
207
|
}
|
|
236
208
|
exports.baseClassIsSealed = baseClassIsSealed;
|
|
237
209
|
/**
|
|
238
210
|
* EC Rule: Base and child class must be of the same type (i.e. Entity, Mixin, Relationship, etc.)
|
|
239
211
|
* @internal
|
|
240
212
|
*/
|
|
241
|
-
function baseClassIsOfDifferentType(ecClass) {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
yield yield __await(new exports.Diagnostics.BaseClassIsOfDifferentType(ecClass, [ecClass.fullName, baseClass.fullName, itemType]));
|
|
251
|
-
});
|
|
213
|
+
async function* baseClassIsOfDifferentType(ecClass) {
|
|
214
|
+
if (!ecClass.baseClass)
|
|
215
|
+
return;
|
|
216
|
+
const baseClass = await ecClass.baseClass;
|
|
217
|
+
// return if rule passed
|
|
218
|
+
if (baseClass.schemaItemType === ecClass.schemaItemType)
|
|
219
|
+
return;
|
|
220
|
+
const itemType = (0, ecschema_metadata_1.schemaItemTypeToString)(baseClass.schemaItemType);
|
|
221
|
+
yield new exports.Diagnostics.BaseClassIsOfDifferentType(ecClass, [ecClass.fullName, baseClass.fullName, itemType]);
|
|
252
222
|
}
|
|
253
223
|
exports.baseClassIsOfDifferentType = baseClassIsOfDifferentType;
|
|
254
224
|
/**
|
|
255
225
|
* EC Rule: Abstract class cannot derive from a non-abstract base class.
|
|
256
226
|
* @internal
|
|
257
227
|
*/
|
|
258
|
-
function abstractClassWithNonAbstractBase(ecClass) {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
yield yield __await(new exports.Diagnostics.AbstractClassWithNonAbstractBase(ecClass, [ecClass.fullName, baseClass.fullName]));
|
|
267
|
-
});
|
|
228
|
+
async function* abstractClassWithNonAbstractBase(ecClass) {
|
|
229
|
+
if (ecClass.modifier !== ecschema_metadata_1.ECClassModifier.Abstract || !ecClass.baseClass)
|
|
230
|
+
return;
|
|
231
|
+
const baseClass = await ecClass.baseClass;
|
|
232
|
+
// return if rule passed
|
|
233
|
+
if (baseClass.modifier === ecschema_metadata_1.ECClassModifier.Abstract)
|
|
234
|
+
return;
|
|
235
|
+
yield new exports.Diagnostics.AbstractClassWithNonAbstractBase(ecClass, [ecClass.fullName, baseClass.fullName]);
|
|
268
236
|
}
|
|
269
237
|
exports.abstractClassWithNonAbstractBase = abstractClassWithNonAbstractBase;
|
|
270
238
|
/**
|
|
271
239
|
* EC Rule: When overriding a class primitive property, the child and base property must be of the same type (string, number, etc...).
|
|
272
240
|
* @internal
|
|
273
241
|
*/
|
|
274
|
-
function incompatibleValueTypePropertyOverride(property) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
const result = yield __await(callback(baseClass));
|
|
300
|
-
if (result)
|
|
301
|
-
yield yield __await(result);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
305
|
-
finally {
|
|
306
|
-
try {
|
|
307
|
-
if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b));
|
|
308
|
-
}
|
|
309
|
-
finally { if (e_1) throw e_1.error; }
|
|
310
|
-
}
|
|
311
|
-
});
|
|
242
|
+
async function* incompatibleValueTypePropertyOverride(property) {
|
|
243
|
+
if (!property.class.baseClass)
|
|
244
|
+
return;
|
|
245
|
+
const primitiveType = getPrimitiveType(property);
|
|
246
|
+
if (!primitiveType)
|
|
247
|
+
return;
|
|
248
|
+
async function callback(baseClass) {
|
|
249
|
+
const baseProperty = await baseClass.getProperty(property.name);
|
|
250
|
+
if (!baseProperty)
|
|
251
|
+
return;
|
|
252
|
+
// Other rules will catch this if false, but we need to make sure
|
|
253
|
+
// types match for this rule to be valid.
|
|
254
|
+
if (!propertyTypesMatch(property, baseProperty))
|
|
255
|
+
return;
|
|
256
|
+
const baseType = getPrimitiveType(baseProperty);
|
|
257
|
+
// Return if rule passed
|
|
258
|
+
if (!baseType || primitiveType === baseType)
|
|
259
|
+
return;
|
|
260
|
+
return new exports.Diagnostics.IncompatibleValueTypePropertyOverride(property, [property.class.fullName, property.name, baseClass.fullName, (0, ecschema_metadata_1.primitiveTypeToString)(baseType), (0, ecschema_metadata_1.primitiveTypeToString)(primitiveType)]);
|
|
261
|
+
}
|
|
262
|
+
for await (const baseClass of property.class.getAllBaseClasses()) {
|
|
263
|
+
const result = await callback(baseClass);
|
|
264
|
+
if (result)
|
|
265
|
+
yield result;
|
|
266
|
+
}
|
|
312
267
|
}
|
|
313
268
|
exports.incompatibleValueTypePropertyOverride = incompatibleValueTypePropertyOverride;
|
|
314
269
|
/**
|
|
315
270
|
* EC Rule: When overriding a class property, the child and base property must be of the same property type (primitive, struct, enumeration, etc...).
|
|
316
271
|
* @internal
|
|
317
272
|
*/
|
|
318
|
-
function incompatibleTypePropertyOverride(property) {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
const result = yield __await(callback(baseClass));
|
|
336
|
-
if (result)
|
|
337
|
-
yield yield __await(result);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
341
|
-
finally {
|
|
342
|
-
try {
|
|
343
|
-
if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b));
|
|
344
|
-
}
|
|
345
|
-
finally { if (e_2) throw e_2.error; }
|
|
346
|
-
}
|
|
347
|
-
});
|
|
273
|
+
async function* incompatibleTypePropertyOverride(property) {
|
|
274
|
+
if (!property.class.baseClass)
|
|
275
|
+
return;
|
|
276
|
+
async function callback(baseClass) {
|
|
277
|
+
const baseProperty = await baseClass.getProperty(property.name);
|
|
278
|
+
if (!baseProperty)
|
|
279
|
+
return;
|
|
280
|
+
// Return if rule passed
|
|
281
|
+
if (propertyTypesMatch(property, baseProperty))
|
|
282
|
+
return;
|
|
283
|
+
return new exports.Diagnostics.IncompatibleTypePropertyOverride(property, [property.class.fullName, property.name, baseClass.fullName, baseProperty.constructor.name, property.constructor.name]);
|
|
284
|
+
}
|
|
285
|
+
for await (const baseClass of property.class.getAllBaseClasses()) {
|
|
286
|
+
const result = await callback(baseClass);
|
|
287
|
+
if (result)
|
|
288
|
+
yield result;
|
|
289
|
+
}
|
|
348
290
|
}
|
|
349
291
|
exports.incompatibleTypePropertyOverride = incompatibleTypePropertyOverride;
|
|
350
292
|
/**
|
|
351
293
|
* EC Rule: When overriding a kindOfQuantity property, the child and base property units must be the same.
|
|
352
294
|
* @internal
|
|
353
295
|
*/
|
|
354
|
-
function incompatibleUnitPropertyOverride(property) {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
const result = yield __await(callback(baseClass));
|
|
392
|
-
if (result)
|
|
393
|
-
yield yield __await(result);
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
397
|
-
finally {
|
|
398
|
-
try {
|
|
399
|
-
if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b));
|
|
400
|
-
}
|
|
401
|
-
finally { if (e_3) throw e_3.error; }
|
|
402
|
-
}
|
|
403
|
-
});
|
|
296
|
+
async function* incompatibleUnitPropertyOverride(property) {
|
|
297
|
+
if (!property.kindOfQuantity || !property.class.baseClass)
|
|
298
|
+
return;
|
|
299
|
+
async function callback(baseClass) {
|
|
300
|
+
const baseProperty = await baseClass.getProperty(property.name);
|
|
301
|
+
if (!baseProperty || !baseProperty.kindOfQuantity)
|
|
302
|
+
return;
|
|
303
|
+
// Other rules will catch this if false, but we need to make sure
|
|
304
|
+
// types match for this rule to be valid.
|
|
305
|
+
if (!propertyTypesMatch(property, baseProperty))
|
|
306
|
+
return;
|
|
307
|
+
const koq = await property.kindOfQuantity;
|
|
308
|
+
const baseKoq = await baseProperty.kindOfQuantity;
|
|
309
|
+
if (!koq || !baseKoq)
|
|
310
|
+
return;
|
|
311
|
+
const unit = await koq.persistenceUnit;
|
|
312
|
+
const baseUnit = await baseKoq.persistenceUnit;
|
|
313
|
+
if (!unit || !baseUnit)
|
|
314
|
+
return;
|
|
315
|
+
// return if rule passed
|
|
316
|
+
if (unit.key.matches(baseUnit.key))
|
|
317
|
+
return;
|
|
318
|
+
return new exports.Diagnostics.IncompatibleUnitPropertyOverride(property, [
|
|
319
|
+
property.class.fullName,
|
|
320
|
+
property.name,
|
|
321
|
+
baseClass.fullName,
|
|
322
|
+
baseKoq.fullName,
|
|
323
|
+
baseUnit.fullName,
|
|
324
|
+
unit.fullName,
|
|
325
|
+
koq.fullName,
|
|
326
|
+
]);
|
|
327
|
+
}
|
|
328
|
+
for await (const baseClass of property.class.getAllBaseClasses()) {
|
|
329
|
+
const result = await callback(baseClass);
|
|
330
|
+
if (result)
|
|
331
|
+
yield result;
|
|
332
|
+
}
|
|
404
333
|
}
|
|
405
334
|
exports.incompatibleUnitPropertyOverride = incompatibleUnitPropertyOverride;
|
|
406
335
|
/** Validates Navigation Properties. EC Rules: 1303, 1304 */
|
|
407
|
-
function validateNavigationProperty(property) {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
break;
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
if (!classSupported)
|
|
452
|
-
yield yield __await(new exports.Diagnostics.NavigationClassMustBeAConstraintClassOfRelationship(property, [property.class.name, property.name, relationship.fullName, navigationClassSide]));
|
|
453
|
-
if (thatConstraint.multiplicity === ecschema_metadata_1.RelationshipMultiplicity.oneMany || thatConstraint.multiplicity === ecschema_metadata_1.RelationshipMultiplicity.zeroMany) {
|
|
454
|
-
const direction = (0, ecschema_metadata_1.strengthDirectionToString)(navProp.direction);
|
|
455
|
-
yield yield __await(new exports.Diagnostics.NavigationTargetMustHaveSingularMultiplicity(property, [property.fullName, relationship.fullName, direction]));
|
|
336
|
+
async function* validateNavigationProperty(property) {
|
|
337
|
+
if (!property.isNavigation())
|
|
338
|
+
return;
|
|
339
|
+
const navProp = property;
|
|
340
|
+
const relationship = await navProp.relationshipClass;
|
|
341
|
+
if (relationship.baseClass)
|
|
342
|
+
yield new exports.Diagnostics.NavigationRelationshipMustBeRoot(property, [property.fullName, relationship.fullName]);
|
|
343
|
+
let thisConstraint;
|
|
344
|
+
let thatConstraint;
|
|
345
|
+
let navigationClassSide;
|
|
346
|
+
if (navProp.direction === ecschema_metadata_1.StrengthDirection.Forward) {
|
|
347
|
+
thisConstraint = relationship.source;
|
|
348
|
+
thatConstraint = relationship.target;
|
|
349
|
+
navigationClassSide = "source";
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
thisConstraint = relationship.target;
|
|
353
|
+
thatConstraint = relationship.source;
|
|
354
|
+
navigationClassSide = "target";
|
|
355
|
+
}
|
|
356
|
+
const thatAbstractConstraint = await thatConstraint.abstractConstraint;
|
|
357
|
+
if (thatAbstractConstraint && thatAbstractConstraint.schemaItemType === ecschema_metadata_1.SchemaItemType.RelationshipClass) {
|
|
358
|
+
yield new exports.Diagnostics.NavigationRelationshipAbstractConstraintEntityOrMixin(property, [property.fullName, relationship.fullName]);
|
|
359
|
+
}
|
|
360
|
+
const isClassSupported = async (ecClass, propertyName, constraintName) => {
|
|
361
|
+
if (constraintName === ecClass.fullName && undefined !== await ecClass.getProperty(propertyName))
|
|
362
|
+
return true;
|
|
363
|
+
const inheritedProp = await ecClass.getInheritedProperty(propertyName);
|
|
364
|
+
if (inheritedProp && constraintName === inheritedProp.class.fullName)
|
|
365
|
+
return true;
|
|
366
|
+
const baseClass = await ecClass.baseClass;
|
|
367
|
+
if (!baseClass)
|
|
368
|
+
return false;
|
|
369
|
+
return isClassSupported(baseClass, propertyName, constraintName);
|
|
370
|
+
};
|
|
371
|
+
let classSupported = false;
|
|
372
|
+
if (thisConstraint.constraintClasses) {
|
|
373
|
+
for (const constraintClass of thisConstraint.constraintClasses) {
|
|
374
|
+
classSupported = await isClassSupported(property.class, property.name, constraintClass.fullName);
|
|
375
|
+
if (classSupported)
|
|
376
|
+
break;
|
|
456
377
|
}
|
|
457
|
-
|
|
458
|
-
|
|
378
|
+
}
|
|
379
|
+
if (!classSupported)
|
|
380
|
+
yield new exports.Diagnostics.NavigationClassMustBeAConstraintClassOfRelationship(property, [property.class.name, property.name, relationship.fullName, navigationClassSide]);
|
|
381
|
+
if (thatConstraint.multiplicity === ecschema_metadata_1.RelationshipMultiplicity.oneMany || thatConstraint.multiplicity === ecschema_metadata_1.RelationshipMultiplicity.zeroMany) {
|
|
382
|
+
const direction = (0, ecschema_metadata_1.strengthDirectionToString)(navProp.direction);
|
|
383
|
+
yield new exports.Diagnostics.NavigationTargetMustHaveSingularMultiplicity(property, [property.fullName, relationship.fullName, direction]);
|
|
384
|
+
}
|
|
385
|
+
return;
|
|
459
386
|
}
|
|
460
387
|
exports.validateNavigationProperty = validateNavigationProperty;
|
|
461
388
|
/**
|
|
462
389
|
* EC Rule: When overriding a RelationshipClass, the derived abstract constraint must narrow the base constraint classes.
|
|
463
390
|
* @internal
|
|
464
391
|
*/
|
|
465
|
-
function abstractConstraintMustNarrowBaseConstraints(ecClass) {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
yield yield __await(targetResult);
|
|
476
|
-
});
|
|
392
|
+
async function* abstractConstraintMustNarrowBaseConstraints(ecClass) {
|
|
393
|
+
if (!ecClass.baseClass)
|
|
394
|
+
return;
|
|
395
|
+
const baseRelationship = await ecClass.baseClass;
|
|
396
|
+
const sourceResult = await applyAbstractConstraintMustNarrowBaseConstraints(ecClass, ecClass.source, baseRelationship);
|
|
397
|
+
if (sourceResult)
|
|
398
|
+
yield sourceResult;
|
|
399
|
+
const targetResult = await applyAbstractConstraintMustNarrowBaseConstraints(ecClass, ecClass.target, baseRelationship);
|
|
400
|
+
if (targetResult)
|
|
401
|
+
yield targetResult;
|
|
477
402
|
}
|
|
478
403
|
exports.abstractConstraintMustNarrowBaseConstraints = abstractConstraintMustNarrowBaseConstraints;
|
|
479
404
|
/**
|
|
480
405
|
* EC Rule: When overriding a RelationshipClass, derived constraint classes must narrow base constraint classes.
|
|
481
406
|
* @internal
|
|
482
407
|
*/
|
|
483
|
-
function derivedConstraintsMustNarrowBaseConstraints(ecClass) {
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
yield yield __await(targetResult);
|
|
494
|
-
});
|
|
408
|
+
async function* derivedConstraintsMustNarrowBaseConstraints(ecClass) {
|
|
409
|
+
if (!ecClass.baseClass)
|
|
410
|
+
return;
|
|
411
|
+
const baseRelationship = await ecClass.baseClass;
|
|
412
|
+
const sourceResult = await applyDerivedConstraintsMustNarrowBaseConstraints(ecClass, ecClass.source, baseRelationship);
|
|
413
|
+
if (sourceResult)
|
|
414
|
+
yield sourceResult;
|
|
415
|
+
const targetResult = await applyDerivedConstraintsMustNarrowBaseConstraints(ecClass, ecClass.target, baseRelationship);
|
|
416
|
+
if (targetResult)
|
|
417
|
+
yield targetResult;
|
|
495
418
|
}
|
|
496
419
|
exports.derivedConstraintsMustNarrowBaseConstraints = derivedConstraintsMustNarrowBaseConstraints;
|
|
497
420
|
/**
|
|
498
421
|
* EC Rule: All constraint classes must have a common base class specified in the abstract constraint.
|
|
499
422
|
* @internal
|
|
500
423
|
*/
|
|
501
|
-
function constraintClassesDeriveFromAbstractContraint(ecClass) {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
yield yield __await(targetResult);
|
|
509
|
-
});
|
|
424
|
+
async function* constraintClassesDeriveFromAbstractContraint(ecClass) {
|
|
425
|
+
const sourceResult = await applyConstraintClassesDeriveFromAbstractContraint(ecClass, ecClass.source);
|
|
426
|
+
if (sourceResult)
|
|
427
|
+
yield sourceResult;
|
|
428
|
+
const targetResult = await applyConstraintClassesDeriveFromAbstractContraint(ecClass, ecClass.target);
|
|
429
|
+
if (targetResult)
|
|
430
|
+
yield targetResult;
|
|
510
431
|
}
|
|
511
432
|
exports.constraintClassesDeriveFromAbstractContraint = constraintClassesDeriveFromAbstractContraint;
|
|
512
433
|
/**
|
|
513
434
|
* EC Rule: At least on concrete constraint class must be defined in the list of constraint classes.
|
|
514
435
|
* @internal
|
|
515
436
|
*/
|
|
516
|
-
function atLeastOneConstraintClassDefined(constraint) {
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
}
|
|
522
|
-
});
|
|
437
|
+
async function* atLeastOneConstraintClassDefined(constraint) {
|
|
438
|
+
if (!constraint.constraintClasses || constraint.constraintClasses.length === 0) {
|
|
439
|
+
const constraintType = constraint.isSource ? ecschema_metadata_1.ECStringConstants.RELATIONSHIP_END_SOURCE : ecschema_metadata_1.ECStringConstants.RELATIONSHIP_END_TARGET;
|
|
440
|
+
yield new exports.Diagnostics.AtLeastOneConstraintClassDefined(constraint, [constraintType, constraint.relationshipClass.fullName]);
|
|
441
|
+
}
|
|
523
442
|
}
|
|
524
443
|
exports.atLeastOneConstraintClassDefined = atLeastOneConstraintClassDefined;
|
|
525
444
|
/**
|
|
526
445
|
* EC Rule: If multiple constraints exist, an abstract constraint must be defined.
|
|
527
446
|
* @internal
|
|
528
447
|
*/
|
|
529
|
-
function abstractConstraintMustExistWithMultipleConstraints(constraint) {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
yield yield __await(new exports.Diagnostics.AbstractConstraintMustExistWithMultipleConstraints(constraint, [constraintType, constraint.relationshipClass.fullName]));
|
|
539
|
-
});
|
|
448
|
+
async function* abstractConstraintMustExistWithMultipleConstraints(constraint) {
|
|
449
|
+
if (!constraint.constraintClasses || constraint.constraintClasses.length <= 1) {
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
const abstractConstraint = await getAbstractConstraint(constraint);
|
|
453
|
+
if (abstractConstraint)
|
|
454
|
+
return;
|
|
455
|
+
const constraintType = constraint.isSource ? ecschema_metadata_1.ECStringConstants.RELATIONSHIP_END_SOURCE : ecschema_metadata_1.ECStringConstants.RELATIONSHIP_END_TARGET;
|
|
456
|
+
yield new exports.Diagnostics.AbstractConstraintMustExistWithMultipleConstraints(constraint, [constraintType, constraint.relationshipClass.fullName]);
|
|
540
457
|
}
|
|
541
458
|
exports.abstractConstraintMustExistWithMultipleConstraints = abstractConstraintMustExistWithMultipleConstraints;
|
|
542
459
|
function propertyTypesMatch(propertyA, propertyB) {
|
|
@@ -551,75 +468,63 @@ function getPrimitiveType(property) {
|
|
|
551
468
|
* EC Rule: Enumeration type must be a string or integer
|
|
552
469
|
* @internal
|
|
553
470
|
*/
|
|
554
|
-
function enumerationTypeUnsupported(enumeration) {
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
yield yield __await(new exports.Diagnostics.EnumerationTypeUnsupported(enumeration, [enumeration.fullName]));
|
|
560
|
-
});
|
|
471
|
+
async function* enumerationTypeUnsupported(enumeration) {
|
|
472
|
+
const type = enumeration.type;
|
|
473
|
+
if (type === ecschema_metadata_1.PrimitiveType.Integer || type === ecschema_metadata_1.PrimitiveType.String)
|
|
474
|
+
return;
|
|
475
|
+
yield new exports.Diagnostics.EnumerationTypeUnsupported(enumeration, [enumeration.fullName]);
|
|
561
476
|
}
|
|
562
477
|
exports.enumerationTypeUnsupported = enumerationTypeUnsupported;
|
|
563
478
|
/**
|
|
564
479
|
* EC Rule: Mixin applied to class must derived from the Mixin appliesTo constraint.
|
|
565
480
|
* @internal
|
|
566
481
|
*/
|
|
567
|
-
function mixinAppliedToClassMustDeriveFromConstraint(entityClass) {
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
return yield __await(void 0);
|
|
577
|
-
});
|
|
482
|
+
async function* mixinAppliedToClassMustDeriveFromConstraint(entityClass) {
|
|
483
|
+
for (const lazyMixin of entityClass.mixins) {
|
|
484
|
+
const mixin = await lazyMixin;
|
|
485
|
+
if (!mixin.appliesTo)
|
|
486
|
+
continue;
|
|
487
|
+
if (!await entityClass.is(await mixin.appliesTo))
|
|
488
|
+
yield new exports.Diagnostics.MixinAppliedToClassMustDeriveFromConstraint(entityClass, [mixin.fullName, entityClass.fullName, mixin.appliesTo.fullName]);
|
|
489
|
+
}
|
|
490
|
+
return;
|
|
578
491
|
}
|
|
579
492
|
exports.mixinAppliedToClassMustDeriveFromConstraint = mixinAppliedToClassMustDeriveFromConstraint;
|
|
580
493
|
/**
|
|
581
494
|
* Validates a custom attribute instance and yields EC-500, EC-501, and EC-502 rule violations.
|
|
582
495
|
*/
|
|
583
|
-
function validateCustomAttributeInstance(container, customAttribute) {
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
yield __await(yield* __asyncDelegator(__asyncValues(customAttributeClassMustExist(container, customAttribute))));
|
|
588
|
-
});
|
|
496
|
+
async function* validateCustomAttributeInstance(container, customAttribute) {
|
|
497
|
+
yield* customAttributeNotOfConcreteClass(container, customAttribute);
|
|
498
|
+
yield* customAttributeSchemaMustBeReferenced(container, customAttribute);
|
|
499
|
+
yield* customAttributeClassMustExist(container, customAttribute);
|
|
589
500
|
}
|
|
590
501
|
exports.validateCustomAttributeInstance = validateCustomAttributeInstance;
|
|
591
502
|
/** EC Rule: CustomAttribute instance must be of a concrete CustomAttributeClass. */
|
|
592
|
-
function customAttributeNotOfConcreteClass(container, customAttribute) {
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
yield yield __await(new exports.Diagnostics.CustomAttributeNotOfConcreteClass(container, [container.fullName, caClass.fullName]));
|
|
601
|
-
});
|
|
503
|
+
async function* customAttributeNotOfConcreteClass(container, customAttribute) {
|
|
504
|
+
const schema = container.schema;
|
|
505
|
+
const caClass = await schema.lookupItem(customAttribute.className);
|
|
506
|
+
if (!caClass)
|
|
507
|
+
return;
|
|
508
|
+
if (caClass.modifier !== ecschema_metadata_1.ECClassModifier.Abstract)
|
|
509
|
+
return;
|
|
510
|
+
yield new exports.Diagnostics.CustomAttributeNotOfConcreteClass(container, [container.fullName, caClass.fullName]);
|
|
602
511
|
}
|
|
603
512
|
/** EC Rule: CustomAttribute Schema must be referenced by the container's Schema. */
|
|
604
|
-
function customAttributeSchemaMustBeReferenced(container, customAttribute) {
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
yield yield __await(new exports.Diagnostics.CustomAttributeSchemaMustBeReferenced(container, [container.fullName, customAttribute.className]));
|
|
613
|
-
});
|
|
513
|
+
async function* customAttributeSchemaMustBeReferenced(container, customAttribute) {
|
|
514
|
+
const schema = container.schema;
|
|
515
|
+
const nameParts = customAttribute.className.split(".");
|
|
516
|
+
if (nameParts.length === 1 || nameParts[0] === schema.name)
|
|
517
|
+
return;
|
|
518
|
+
if (schema.references.some((s) => s.name === nameParts[0]))
|
|
519
|
+
return;
|
|
520
|
+
yield new exports.Diagnostics.CustomAttributeSchemaMustBeReferenced(container, [container.fullName, customAttribute.className]);
|
|
614
521
|
}
|
|
615
522
|
/** EC Rule: CustomAttribute instance class must exist. */
|
|
616
|
-
function customAttributeClassMustExist(container, customAttribute) {
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
yield yield __await(new exports.Diagnostics.CustomAttributeClassNotFound(container, [container.fullName, customAttribute.className]));
|
|
622
|
-
});
|
|
523
|
+
async function* customAttributeClassMustExist(container, customAttribute) {
|
|
524
|
+
const schema = container.schema;
|
|
525
|
+
const caClass = await schema.lookupItem(customAttribute.className);
|
|
526
|
+
if (!caClass)
|
|
527
|
+
yield new exports.Diagnostics.CustomAttributeClassNotFound(container, [container.fullName, customAttribute.className]);
|
|
623
528
|
}
|
|
624
529
|
async function applyAbstractConstraintMustNarrowBaseConstraints(ecClass, constraint, baseRelationship) {
|
|
625
530
|
const baseConstraint = constraint.isSource ? baseRelationship.source : baseRelationship.target;
|