@itwin/ecschema-editing 4.5.0-dev.30 → 4.5.0-dev.32

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.
Files changed (83) hide show
  1. package/lib/cjs/Differencing/SchemaConflicts.d.ts +76 -0
  2. package/lib/cjs/Differencing/SchemaConflicts.d.ts.map +1 -0
  3. package/lib/cjs/Differencing/SchemaConflicts.js +56 -0
  4. package/lib/cjs/Differencing/SchemaConflicts.js.map +1 -0
  5. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts +43 -0
  6. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -0
  7. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js +501 -0
  8. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js.map +1 -0
  9. package/lib/cjs/Differencing/SchemaDifference.d.ts +150 -0
  10. package/lib/cjs/Differencing/SchemaDifference.d.ts.map +1 -0
  11. package/lib/cjs/Differencing/SchemaDifference.js +54 -0
  12. package/lib/cjs/Differencing/SchemaDifference.js.map +1 -0
  13. package/lib/cjs/Editing/Constants.js.map +1 -1
  14. package/lib/cjs/Editing/CustomAttributes.js.map +1 -1
  15. package/lib/cjs/Editing/ECClasses.js.map +1 -1
  16. package/lib/cjs/Editing/Editor.js.map +1 -1
  17. package/lib/cjs/Editing/Entities.js.map +1 -1
  18. package/lib/cjs/Editing/Enumerations.js.map +1 -1
  19. package/lib/cjs/Editing/Formats.js.map +1 -1
  20. package/lib/cjs/Editing/InvertedUnits.js.map +1 -1
  21. package/lib/cjs/Editing/KindOfQuantities.js.map +1 -1
  22. package/lib/cjs/Editing/Mixins.js.map +1 -1
  23. package/lib/cjs/Editing/Mutable/MutableArrayProperty.js.map +1 -1
  24. package/lib/cjs/Editing/Mutable/MutableCAClass.js.map +1 -1
  25. package/lib/cjs/Editing/Mutable/MutableClass.js.map +1 -1
  26. package/lib/cjs/Editing/Mutable/MutableConstant.js.map +1 -1
  27. package/lib/cjs/Editing/Mutable/MutableEntityClass.js.map +1 -1
  28. package/lib/cjs/Editing/Mutable/MutableEnumeration.js.map +1 -1
  29. package/lib/cjs/Editing/Mutable/MutableFormat.js.map +1 -1
  30. package/lib/cjs/Editing/Mutable/MutableInvertedUnit.js.map +1 -1
  31. package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.js.map +1 -1
  32. package/lib/cjs/Editing/Mutable/MutableMixin.js.map +1 -1
  33. package/lib/cjs/Editing/Mutable/MutablePhenomenon.js.map +1 -1
  34. package/lib/cjs/Editing/Mutable/MutablePrimitiveOrEnumProperty.js.map +1 -1
  35. package/lib/cjs/Editing/Mutable/MutableProperty.js.map +1 -1
  36. package/lib/cjs/Editing/Mutable/MutablePropertyCategory.js.map +1 -1
  37. package/lib/cjs/Editing/Mutable/MutableRelationshipClass.js.map +1 -1
  38. package/lib/cjs/Editing/Mutable/MutableSchema.js.map +1 -1
  39. package/lib/cjs/Editing/Mutable/MutableUnit.js.map +1 -1
  40. package/lib/cjs/Editing/Mutable/MutableUnitSystem.js.map +1 -1
  41. package/lib/cjs/Editing/Phenomena.js.map +1 -1
  42. package/lib/cjs/Editing/PropertyCategories.js.map +1 -1
  43. package/lib/cjs/Editing/RelationshipClasses.js.map +1 -1
  44. package/lib/cjs/Editing/SchemaItems.js.map +1 -1
  45. package/lib/cjs/Editing/Structs.js.map +1 -1
  46. package/lib/cjs/Editing/UnitSystems.js.map +1 -1
  47. package/lib/cjs/Editing/Units.js.map +1 -1
  48. package/lib/cjs/Merging/CAClassMerger.js.map +1 -1
  49. package/lib/cjs/Merging/ClassMerger.js.map +1 -1
  50. package/lib/cjs/Merging/ConstantMerger.js.map +1 -1
  51. package/lib/cjs/Merging/CustomAttributeMerger.js.map +1 -1
  52. package/lib/cjs/Merging/EntityClassMerger.js.map +1 -1
  53. package/lib/cjs/Merging/EnumerationMerger.js.map +1 -1
  54. package/lib/cjs/Merging/KindOfQuantityMerger.js.map +1 -1
  55. package/lib/cjs/Merging/MixinMerger.js.map +1 -1
  56. package/lib/cjs/Merging/PropertyMerger.js.map +1 -1
  57. package/lib/cjs/Merging/RelationshipClassMerger.js.map +1 -1
  58. package/lib/cjs/Merging/SchemaItemFactory.js.map +1 -1
  59. package/lib/cjs/Merging/SchemaItemMerger.js.map +1 -1
  60. package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
  61. package/lib/cjs/Merging/SchemaReferenceMerger.js.map +1 -1
  62. package/lib/cjs/Merging/StructClassMerger.js.map +1 -1
  63. package/lib/cjs/Validation/Diagnostic.js.map +1 -1
  64. package/lib/cjs/Validation/DiagnosticReporter.js.map +1 -1
  65. package/lib/cjs/Validation/ECRules.js.map +1 -1
  66. package/lib/cjs/Validation/LoggingDiagnosticReporter.js.map +1 -1
  67. package/lib/cjs/Validation/RuleSuppressionSet.js.map +1 -1
  68. package/lib/cjs/Validation/Rules.js.map +1 -1
  69. package/lib/cjs/Validation/SchemaChanges.js.map +1 -1
  70. package/lib/cjs/Validation/SchemaCompareDiagnostics.js.map +1 -1
  71. package/lib/cjs/Validation/SchemaCompareReporter.js.map +1 -1
  72. package/lib/cjs/Validation/SchemaCompareResultDelegate.js.map +1 -1
  73. package/lib/cjs/Validation/SchemaCompareVisitor.js.map +1 -1
  74. package/lib/cjs/Validation/SchemaComparer.js.map +1 -1
  75. package/lib/cjs/Validation/SchemaValidater.js.map +1 -1
  76. package/lib/cjs/Validation/SchemaValidationVisitor.js.map +1 -1
  77. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  78. package/lib/cjs/ecschema-editing.d.ts +4 -0
  79. package/lib/cjs/ecschema-editing.d.ts.map +1 -1
  80. package/lib/cjs/ecschema-editing.js +4 -0
  81. package/lib/cjs/ecschema-editing.js.map +1 -1
  82. package/package.json +9 -9
  83. package/public/locales/en/ECSchemaEditing.json +26 -26
@@ -0,0 +1,76 @@
1
+ /** @packageDocumentation
2
+ * @module Differencing
3
+ */
4
+ import type { SchemaType } from "./SchemaDifference";
5
+ /**
6
+ * The unique conflicts codes for Schema differencing.
7
+ *
8
+ * To provide meaning to code values, with anticipation
9
+ * of future rules for all current EC Types, the following
10
+ * value ranges should be used:
11
+ *
12
+ * - Schema: 000-099
13
+ * - Class: 100-199
14
+ * - Constant: 200-299
15
+ * - CustomAttribute 300-399
16
+ * - CustomAttributeClass: 400-499
17
+ * - CustomAttributeContainer: 500-599
18
+ * - EntityClass: 600-699
19
+ * - Enumeration: 700-799
20
+ * - Format: 800-899
21
+ * - InvertedUnit: 900-999
22
+ * - KindOfQuantity: 1000-1099
23
+ * - Mixin: 1100-1199
24
+ * - Phenomenon: 1200-1299
25
+ * - Property: 1300-1399
26
+ * - PropertyCategory: 1400-1499
27
+ * - RelationshipClass: 1500-1599
28
+ * - RelationshipConstraint: 1600-1699
29
+ * - StructClass: 1700-1799
30
+ * - Unit: 1800-1899
31
+ * - UnitSystem: 1900-1999
32
+ *
33
+ * @internal
34
+ */
35
+ export declare enum ConflictCode {
36
+ ConflictingItemName = "C-001",
37
+ ConflictingReferenceAlias = "C-002",
38
+ ConflictingBaseClass = "C-100",
39
+ RemovingBaseClass = "C-101",
40
+ SealedBaseClass = "C-102",
41
+ ConflictingEnumerationType = "C-700",
42
+ ConflictingEnumeratorValue = "C-701",
43
+ MixinAppliedMustDeriveFromConstraint = "C-1100",
44
+ ConflictingPropertyName = "C-1300",
45
+ AbstractConstraintMustNarrowBaseConstraints = "C-1500",
46
+ DerivedConstraintsMustNarrowBaseConstraints = "C-1501",
47
+ ConstraintClassesDeriveFromAbstractConstraint = "C-1502"
48
+ }
49
+ /**
50
+ * Defines the interface for a conflict during Schema Differencing. Conflicts were discovered
51
+ * while comparing the changed elements. Conflicts in the whole schema context are not found
52
+ * on that level.
53
+ *
54
+ * @internal
55
+ */
56
+ export interface SchemaDifferenceConflict {
57
+ /**
58
+ * The name of the schema type which is "Schema" for a conflict on the schema, on schema items
59
+ * or objects that are related to schema items (properties, relationship constraints) it is the
60
+ * name of the related schema item.
61
+ */
62
+ readonly schemaType: SchemaType;
63
+ /** The name of the schema item the conflict appears on. */
64
+ readonly itemName?: string;
65
+ /** Optional path what on the item was conflicting. */
66
+ readonly path?: string;
67
+ /** The unique conflicting code. */
68
+ readonly code: ConflictCode;
69
+ /** A description of the conflict. */
70
+ readonly description: string;
71
+ /** The value in the source schema. */
72
+ readonly source: unknown;
73
+ /** The value in the target schema. */
74
+ readonly target: unknown;
75
+ }
76
+ //# sourceMappingURL=SchemaConflicts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaConflicts.d.ts","sourceRoot":"","sources":["../../../src/Differencing/SchemaConflicts.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,oBAAY,YAAY;IAEtB,mBAAmB,UAAU;IAC7B,yBAAyB,UAAU;IAEnC,oBAAoB,UAAU;IAC9B,iBAAiB,UAAU;IAC3B,eAAe,UAAU;IAEzB,0BAA0B,UAAU;IACpC,0BAA0B,UAAU;IAEpC,oCAAoC,WAAW;IAE/C,uBAAuB,WAAW;IAElC,2CAA2C,WAAW;IACtD,2CAA2C,WAAW;IACtD,6CAA6C,WAAW;CACzD;AAED;;;;;;GAMG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAEhC,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE3B,sDAAsD;IACtD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB,mCAAmC;IACnC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAE5B,qCAAqC;IACrC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,sCAAsC;IACtC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAEzB,sCAAsC;IACtC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module Differencing
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.ConflictCode = void 0;
11
+ /**
12
+ * The unique conflicts codes for Schema differencing.
13
+ *
14
+ * To provide meaning to code values, with anticipation
15
+ * of future rules for all current EC Types, the following
16
+ * value ranges should be used:
17
+ *
18
+ * - Schema: 000-099
19
+ * - Class: 100-199
20
+ * - Constant: 200-299
21
+ * - CustomAttribute 300-399
22
+ * - CustomAttributeClass: 400-499
23
+ * - CustomAttributeContainer: 500-599
24
+ * - EntityClass: 600-699
25
+ * - Enumeration: 700-799
26
+ * - Format: 800-899
27
+ * - InvertedUnit: 900-999
28
+ * - KindOfQuantity: 1000-1099
29
+ * - Mixin: 1100-1199
30
+ * - Phenomenon: 1200-1299
31
+ * - Property: 1300-1399
32
+ * - PropertyCategory: 1400-1499
33
+ * - RelationshipClass: 1500-1599
34
+ * - RelationshipConstraint: 1600-1699
35
+ * - StructClass: 1700-1799
36
+ * - Unit: 1800-1899
37
+ * - UnitSystem: 1900-1999
38
+ *
39
+ * @internal
40
+ */
41
+ var ConflictCode;
42
+ (function (ConflictCode) {
43
+ ConflictCode["ConflictingItemName"] = "C-001";
44
+ ConflictCode["ConflictingReferenceAlias"] = "C-002";
45
+ ConflictCode["ConflictingBaseClass"] = "C-100";
46
+ ConflictCode["RemovingBaseClass"] = "C-101";
47
+ ConflictCode["SealedBaseClass"] = "C-102";
48
+ ConflictCode["ConflictingEnumerationType"] = "C-700";
49
+ ConflictCode["ConflictingEnumeratorValue"] = "C-701";
50
+ ConflictCode["MixinAppliedMustDeriveFromConstraint"] = "C-1100";
51
+ ConflictCode["ConflictingPropertyName"] = "C-1300";
52
+ ConflictCode["AbstractConstraintMustNarrowBaseConstraints"] = "C-1500";
53
+ ConflictCode["DerivedConstraintsMustNarrowBaseConstraints"] = "C-1501";
54
+ ConflictCode["ConstraintClassesDeriveFromAbstractConstraint"] = "C-1502";
55
+ })(ConflictCode = exports.ConflictCode || (exports.ConflictCode = {}));
56
+ //# sourceMappingURL=SchemaConflicts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaConflicts.js","sourceRoot":"","sources":["../../../src/Differencing/SchemaConflicts.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,IAAY,YAmBX;AAnBD,WAAY,YAAY;IAEtB,6CAA6B,CAAA;IAC7B,mDAAmC,CAAA;IAEnC,8CAA8B,CAAA;IAC9B,2CAA2B,CAAA;IAC3B,yCAAyB,CAAA;IAEzB,oDAAoC,CAAA;IACpC,oDAAoC,CAAA;IAEpC,+DAA+C,CAAA;IAE/C,kDAAkC,CAAA;IAElC,sEAAsD,CAAA;IACtD,sEAAsD,CAAA;IACtD,wEAAwD,CAAA;AAC1D,CAAC,EAnBW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAmBvB","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Differencing\r\n */\r\n\r\nimport type { SchemaType } from \"./SchemaDifference\";\r\n\r\n/**\r\n * The unique conflicts codes for Schema differencing.\r\n *\r\n * To provide meaning to code values, with anticipation\r\n * of future rules for all current EC Types, the following\r\n * value ranges should be used:\r\n *\r\n * - Schema: 000-099\r\n * - Class: 100-199\r\n * - Constant: 200-299\r\n * - CustomAttribute 300-399\r\n * - CustomAttributeClass: 400-499\r\n * - CustomAttributeContainer: 500-599\r\n * - EntityClass: 600-699\r\n * - Enumeration: 700-799\r\n * - Format: 800-899\r\n * - InvertedUnit: 900-999\r\n * - KindOfQuantity: 1000-1099\r\n * - Mixin: 1100-1199\r\n * - Phenomenon: 1200-1299\r\n * - Property: 1300-1399\r\n * - PropertyCategory: 1400-1499\r\n * - RelationshipClass: 1500-1599\r\n * - RelationshipConstraint: 1600-1699\r\n * - StructClass: 1700-1799\r\n * - Unit: 1800-1899\r\n * - UnitSystem: 1900-1999\r\n *\r\n * @internal\r\n */\r\nexport enum ConflictCode {\r\n\r\n ConflictingItemName = \"C-001\",\r\n ConflictingReferenceAlias = \"C-002\",\r\n\r\n ConflictingBaseClass = \"C-100\",\r\n RemovingBaseClass = \"C-101\",\r\n SealedBaseClass = \"C-102\",\r\n\r\n ConflictingEnumerationType = \"C-700\",\r\n ConflictingEnumeratorValue = \"C-701\",\r\n\r\n MixinAppliedMustDeriveFromConstraint = \"C-1100\",\r\n\r\n ConflictingPropertyName = \"C-1300\",\r\n\r\n AbstractConstraintMustNarrowBaseConstraints = \"C-1500\",\r\n DerivedConstraintsMustNarrowBaseConstraints = \"C-1501\",\r\n ConstraintClassesDeriveFromAbstractConstraint = \"C-1502\",\r\n}\r\n\r\n/**\r\n * Defines the interface for a conflict during Schema Differencing. Conflicts were discovered\r\n * while comparing the changed elements. Conflicts in the whole schema context are not found\r\n * on that level.\r\n *\r\n * @internal\r\n */\r\nexport interface SchemaDifferenceConflict {\r\n /**\r\n * The name of the schema type which is \"Schema\" for a conflict on the schema, on schema items\r\n * or objects that are related to schema items (properties, relationship constraints) it is the\r\n * name of the related schema item.\r\n */\r\n readonly schemaType: SchemaType;\r\n\r\n /** The name of the schema item the conflict appears on. */\r\n readonly itemName?: string;\r\n\r\n /** Optional path what on the item was conflicting. */\r\n readonly path?: string;\r\n\r\n /** The unique conflicting code. */\r\n readonly code: ConflictCode;\r\n\r\n /** A description of the conflict. */\r\n readonly description: string;\r\n\r\n /** The value in the source schema. */\r\n readonly source: unknown;\r\n\r\n /** The value in the target schema. */\r\n readonly target: unknown;\r\n}\r\n"]}
@@ -0,0 +1,43 @@
1
+ /** @packageDocumentation
2
+ * @module Differencing
3
+ */
4
+ import type { AnyDiagnostic } from "../Validation/Diagnostic";
5
+ import { SchemaDifferences } from "./SchemaDifference";
6
+ /**
7
+ * The SchemaDiagnosticVisitor is a visitor implementation for diagnostic entries
8
+ * from the schema comparer api. Depending on the diagnostic code, the difference
9
+ * result is build together.
10
+ * @internal
11
+ */
12
+ export declare class SchemaDiagnosticVisitor {
13
+ private readonly _differenceReport;
14
+ constructor(differenceReport: SchemaDifferences);
15
+ private addEntry;
16
+ private lookupEntry;
17
+ private addConflict;
18
+ /**
19
+ * Visitor function to process the schema change diagnostic object.
20
+ * @internal
21
+ */
22
+ visit(diagnostic: AnyDiagnostic): void;
23
+ private visitChangedSchemaProperties;
24
+ private visitMissingSchemaItem;
25
+ private visitChangedSchemaItem;
26
+ private visitChangedEnumeration;
27
+ private visitMissingEnumerator;
28
+ private lookupEnumeratorEntry;
29
+ private visitChangedEnumerator;
30
+ private validateEnumerator;
31
+ private visitMissingProperty;
32
+ private visitChangedProperty;
33
+ private validatePropertyChange;
34
+ private visitMissingBaseClass;
35
+ private validateBaseClassChange;
36
+ private visitMissingMixinOnClass;
37
+ private validateMixin;
38
+ private visitMissingRelationshipConstraintClass;
39
+ private visitChangedRelationshipConstraint;
40
+ private visitSchemaReference;
41
+ private visitMissingCustomAttributeInstance;
42
+ }
43
+ //# sourceMappingURL=SchemaDiagnosticVisitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaDiagnosticVisitor.d.ts","sourceRoot":"","sources":["../../../src/Differencing/SchemaDiagnosticVisitor.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAM9D,OAAO,EAKL,iBAAiB,EAQlB,MAAM,oBAAoB,CAAC;AA0B5B;;;;;GAKG;AACH,qBAAa,uBAAuB;IAElC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAoB;gBAE1C,gBAAgB,EAAE,iBAAiB;IAI/C,OAAO,CAAC,QAAQ;IAKhB,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,WAAW;IAInB;;;OAGG;IACI,KAAK,CAAC,UAAU,EAAE,aAAa;IA6DtC,OAAO,CAAC,4BAA4B;IA+BpC,OAAO,CAAC,sBAAsB;IAU9B,OAAO,CAAC,sBAAsB;IAmC9B,OAAO,CAAC,uBAAuB;IAqB/B,OAAO,CAAC,sBAAsB;IAgB9B,OAAO,CAAC,qBAAqB;IAU7B,OAAO,CAAC,sBAAsB;IAgC9B,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,oBAAoB;IA2B5B,OAAO,CAAC,sBAAsB;IAgB9B,OAAO,CAAC,qBAAqB;IAwB7B,OAAO,CAAC,uBAAuB;IA0C/B,OAAO,CAAC,wBAAwB;IAyBhC,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,uCAAuC;IAuB/C,OAAO,CAAC,kCAAkC;IAyB1C,OAAO,CAAC,oBAAoB;IAa5B,OAAO,CAAC,mCAAmC;CAe5C"}