@itwin/ecschema-editing 5.7.0-dev.5 → 5.7.0-dev.7
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/CHANGELOG.md +6 -1
- package/lib/cjs/Merging/SchemaMerger.d.ts +108 -1
- package/lib/cjs/Merging/SchemaMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMerger.js +127 -1
- package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaMergingVisitor.d.ts +13 -2
- package/lib/cjs/Merging/SchemaMergingVisitor.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMergingVisitor.js +123 -79
- package/lib/cjs/Merging/SchemaMergingVisitor.js.map +1 -1
- package/lib/cjs/Merging/SchemaMergingWalker.d.ts +1 -1
- package/lib/cjs/Merging/SchemaMergingWalker.js +1 -1
- package/lib/cjs/Merging/SchemaMergingWalker.js.map +1 -1
- package/lib/esm/Merging/SchemaMerger.d.ts +108 -1
- package/lib/esm/Merging/SchemaMerger.d.ts.map +1 -1
- package/lib/esm/Merging/SchemaMerger.js +125 -0
- package/lib/esm/Merging/SchemaMerger.js.map +1 -1
- package/lib/esm/Merging/SchemaMergingVisitor.d.ts +13 -2
- package/lib/esm/Merging/SchemaMergingVisitor.d.ts.map +1 -1
- package/lib/esm/Merging/SchemaMergingVisitor.js +123 -79
- package/lib/esm/Merging/SchemaMergingVisitor.js.map +1 -1
- package/lib/esm/Merging/SchemaMergingWalker.d.ts +1 -1
- package/lib/esm/Merging/SchemaMergingWalker.js +1 -1
- package/lib/esm/Merging/SchemaMergingWalker.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# Change Log - @itwin/ecschema-editing
|
|
2
2
|
|
|
3
|
-
This log was last generated on Thu,
|
|
3
|
+
This log was last generated on Thu, 05 Feb 2026 16:14:10 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 5.6.0
|
|
6
|
+
Thu, 05 Feb 2026 16:12:37 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
4
9
|
|
|
5
10
|
## 5.5.2
|
|
6
11
|
Thu, 22 Jan 2026 16:16:54 GMT
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Schema, SchemaContext, SchemaKey } from "@itwin/ecschema-metadata";
|
|
5
5
|
import { SchemaContextEditor } from "../Editing/Editor";
|
|
6
|
-
import { type SchemaDifferenceResult } from "../Differencing/SchemaDifference";
|
|
6
|
+
import { AnySchemaDifference, type SchemaDifferenceResult } from "../Differencing/SchemaDifference";
|
|
7
7
|
import { SchemaEdits } from "./Edits/SchemaEdits";
|
|
8
8
|
import { NameMapping } from "./Edits/NameMapping";
|
|
9
9
|
/**
|
|
@@ -17,6 +17,106 @@ export interface SchemaMergeContext {
|
|
|
17
17
|
readonly editor: SchemaContextEditor;
|
|
18
18
|
readonly nameMapping: NameMapping;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Represents a single merge operation that was executed.
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export interface SchemaMergeOperation {
|
|
25
|
+
readonly change: AnySchemaDifference;
|
|
26
|
+
readonly durationMs: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Represents a merge operation that failed with an error.
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export interface SchemaMergeFailure extends SchemaMergeOperation {
|
|
33
|
+
readonly error: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Report of a schema merge operation containing success/failure details.
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
export interface SchemaMergeReport {
|
|
40
|
+
/** Source schema identifier */
|
|
41
|
+
readonly sourceSchemaKey: SchemaKey;
|
|
42
|
+
/** Target schema identifier */
|
|
43
|
+
readonly targetSchemaKey: SchemaKey;
|
|
44
|
+
/** Array of successfully merged differences */
|
|
45
|
+
readonly successfulOperations: SchemaMergeOperation[];
|
|
46
|
+
/** Array of failed merge operations with their errors */
|
|
47
|
+
readonly failedOperations: SchemaMergeFailure[];
|
|
48
|
+
/** Summary statistics of the merge operation */
|
|
49
|
+
readonly mergeStatistics: {
|
|
50
|
+
readonly total: number;
|
|
51
|
+
readonly succeeded: number;
|
|
52
|
+
readonly failed: number;
|
|
53
|
+
};
|
|
54
|
+
/** Performance metrics of the merge operation */
|
|
55
|
+
readonly performanceMetrics: {
|
|
56
|
+
readonly totalDurationMs: number;
|
|
57
|
+
readonly schemaDifferenceDurationMs: number;
|
|
58
|
+
readonly mergeDurationMs: number;
|
|
59
|
+
readonly averageMergeOpDurationMs: number;
|
|
60
|
+
};
|
|
61
|
+
/** Returns true if all operations succeeded */
|
|
62
|
+
readonly success: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
export declare class SchemaMergeReporter implements SchemaMergeReport {
|
|
68
|
+
private readonly _succeeded;
|
|
69
|
+
private readonly _failed;
|
|
70
|
+
private readonly _sourceSchemaKey;
|
|
71
|
+
private readonly _targetSchemaKey;
|
|
72
|
+
private readonly _totalDifferences;
|
|
73
|
+
private _totalDurationMs;
|
|
74
|
+
private _schemaDifferenceDurationMs;
|
|
75
|
+
private _mergeDurationMs;
|
|
76
|
+
private _averageMergeOpDurationMs;
|
|
77
|
+
constructor(sourceSchemaKey: SchemaKey, targetSchemaKey: SchemaKey, totalDifferences: number);
|
|
78
|
+
get sourceSchemaKey(): SchemaKey;
|
|
79
|
+
get targetSchemaKey(): SchemaKey;
|
|
80
|
+
get successfulOperations(): SchemaMergeOperation[];
|
|
81
|
+
get failedOperations(): SchemaMergeFailure[];
|
|
82
|
+
get mergeStatistics(): {
|
|
83
|
+
total: number;
|
|
84
|
+
succeeded: number;
|
|
85
|
+
failed: number;
|
|
86
|
+
};
|
|
87
|
+
get performanceMetrics(): {
|
|
88
|
+
totalDurationMs: number;
|
|
89
|
+
schemaDifferenceDurationMs: number;
|
|
90
|
+
mergeDurationMs: number;
|
|
91
|
+
averageMergeOpDurationMs: number;
|
|
92
|
+
};
|
|
93
|
+
get success(): boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Sets the performance metrics for the merge operation.
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
setPerformanceMetrics(metrics: {
|
|
99
|
+
totalDurationMs: number;
|
|
100
|
+
schemaDifferenceDurationMs: number;
|
|
101
|
+
mergeDurationMs: number;
|
|
102
|
+
averageMergeOpDurationMs: number;
|
|
103
|
+
}): void;
|
|
104
|
+
/**
|
|
105
|
+
* Records a successful merge operation.
|
|
106
|
+
* @internal
|
|
107
|
+
*/
|
|
108
|
+
recordSuccess(change: AnySchemaDifference, durationMs: number): void;
|
|
109
|
+
/**
|
|
110
|
+
* Records a failed merge operation.
|
|
111
|
+
* @internal
|
|
112
|
+
*/
|
|
113
|
+
recordFailure(change: AnySchemaDifference, durationMs: number, error: Error): void;
|
|
114
|
+
/**
|
|
115
|
+
* Returns the merge report.
|
|
116
|
+
* @internal
|
|
117
|
+
*/
|
|
118
|
+
getMergeReport(): SchemaMergeReport;
|
|
119
|
+
}
|
|
20
120
|
/**
|
|
21
121
|
* Class to merge two schemas together.
|
|
22
122
|
* @see [[merge]] or [[mergeSchemas]] to merge two schemas together.
|
|
@@ -24,6 +124,8 @@ export interface SchemaMergeContext {
|
|
|
24
124
|
*/
|
|
25
125
|
export declare class SchemaMerger {
|
|
26
126
|
private readonly _editingContext;
|
|
127
|
+
private _mergeReporter;
|
|
128
|
+
private _differenceStartTime;
|
|
27
129
|
/**
|
|
28
130
|
* Constructs a new instance of the SchemaMerger object.
|
|
29
131
|
* @param editingContext The schema contexts that holds the schema to be edited.
|
|
@@ -45,5 +147,10 @@ export declare class SchemaMerger {
|
|
|
45
147
|
* @alpha
|
|
46
148
|
*/
|
|
47
149
|
merge(differenceResult: SchemaDifferenceResult, edits?: SchemaEdits): Promise<Schema>;
|
|
150
|
+
/**
|
|
151
|
+
* Gets the merge report for the last merge operation.
|
|
152
|
+
* @alpha
|
|
153
|
+
*/
|
|
154
|
+
getMergeReport(): SchemaMergeReport | undefined;
|
|
48
155
|
}
|
|
49
156
|
//# sourceMappingURL=SchemaMerger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/SchemaMerger.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,aAAa,EAA6B,SAAS,EAAmB,MAAM,0BAA0B,CAAC;AACxH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAwB,KAAK,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"SchemaMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/SchemaMerger.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,aAAa,EAA6B,SAAS,EAAmB,MAAM,0BAA0B,CAAC;AACxH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAwB,KAAK,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAG1H,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,eAAe,EAAE,SAAS,CAAC;IACpC,QAAQ,CAAC,eAAe,EAAE,SAAS,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IACrC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;CACnC;AAED;;;GAGG;AACH,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,KAAK,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;IAK3G;;;;;OAKG;IACU,KAAK,CAAC,gBAAgB,EAAE,sBAAsB,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;IAqElG;;;OAGG;IACI,cAAc,IAAI,iBAAiB,GAAG,SAAS;CAGvD"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module Merging
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.SchemaMerger = void 0;
|
|
10
|
+
exports.SchemaMerger = exports.SchemaMergeReporter = void 0;
|
|
11
11
|
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
12
12
|
const Editor_1 = require("../Editing/Editor");
|
|
13
13
|
const Errors_1 = require("../Differencing/Errors");
|
|
@@ -16,6 +16,106 @@ const SchemaMergingVisitor_1 = require("./SchemaMergingVisitor");
|
|
|
16
16
|
const SchemaMergingWalker_1 = require("./SchemaMergingWalker");
|
|
17
17
|
const Exception_1 = require("../Editing/Exception");
|
|
18
18
|
const NameMapping_1 = require("./Edits/NameMapping");
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
class SchemaMergeReporter {
|
|
23
|
+
_succeeded = [];
|
|
24
|
+
_failed = [];
|
|
25
|
+
_sourceSchemaKey;
|
|
26
|
+
_targetSchemaKey;
|
|
27
|
+
_totalDifferences;
|
|
28
|
+
_totalDurationMs = 0;
|
|
29
|
+
_schemaDifferenceDurationMs = 0;
|
|
30
|
+
_mergeDurationMs = 0;
|
|
31
|
+
_averageMergeOpDurationMs = 0;
|
|
32
|
+
constructor(sourceSchemaKey, targetSchemaKey, totalDifferences) {
|
|
33
|
+
this._sourceSchemaKey = sourceSchemaKey;
|
|
34
|
+
this._targetSchemaKey = targetSchemaKey;
|
|
35
|
+
this._totalDifferences = totalDifferences;
|
|
36
|
+
}
|
|
37
|
+
get sourceSchemaKey() {
|
|
38
|
+
return this._sourceSchemaKey;
|
|
39
|
+
}
|
|
40
|
+
get targetSchemaKey() {
|
|
41
|
+
return this._targetSchemaKey;
|
|
42
|
+
}
|
|
43
|
+
get successfulOperations() {
|
|
44
|
+
return [...this._succeeded];
|
|
45
|
+
}
|
|
46
|
+
get failedOperations() {
|
|
47
|
+
return [...this._failed];
|
|
48
|
+
}
|
|
49
|
+
get mergeStatistics() {
|
|
50
|
+
return {
|
|
51
|
+
total: this._totalDifferences,
|
|
52
|
+
succeeded: this._succeeded.length,
|
|
53
|
+
failed: this._failed.length,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
get performanceMetrics() {
|
|
57
|
+
return {
|
|
58
|
+
totalDurationMs: this._totalDurationMs,
|
|
59
|
+
schemaDifferenceDurationMs: this._schemaDifferenceDurationMs,
|
|
60
|
+
mergeDurationMs: this._mergeDurationMs,
|
|
61
|
+
averageMergeOpDurationMs: this._averageMergeOpDurationMs,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
get success() {
|
|
65
|
+
return this._failed.length === 0;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Sets the performance metrics for the merge operation.
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
setPerformanceMetrics(metrics) {
|
|
72
|
+
this._totalDurationMs = metrics.totalDurationMs;
|
|
73
|
+
this._schemaDifferenceDurationMs = metrics.schemaDifferenceDurationMs;
|
|
74
|
+
this._mergeDurationMs = metrics.mergeDurationMs;
|
|
75
|
+
this._averageMergeOpDurationMs = metrics.averageMergeOpDurationMs;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Records a successful merge operation.
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
recordSuccess(change, durationMs) {
|
|
82
|
+
this._succeeded.push({ change, durationMs });
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Records a failed merge operation.
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
recordFailure(change, durationMs, error) {
|
|
89
|
+
this._failed.push({ change, durationMs, error: error.message });
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Returns the merge report.
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
95
|
+
getMergeReport() {
|
|
96
|
+
return {
|
|
97
|
+
sourceSchemaKey: this._sourceSchemaKey,
|
|
98
|
+
targetSchemaKey: this._targetSchemaKey,
|
|
99
|
+
successfulOperations: [...this._succeeded],
|
|
100
|
+
failedOperations: [...this._failed],
|
|
101
|
+
mergeStatistics: {
|
|
102
|
+
total: this._totalDifferences,
|
|
103
|
+
succeeded: this._succeeded.length,
|
|
104
|
+
failed: this._failed.length,
|
|
105
|
+
},
|
|
106
|
+
performanceMetrics: {
|
|
107
|
+
totalDurationMs: this._totalDurationMs,
|
|
108
|
+
schemaDifferenceDurationMs: this._schemaDifferenceDurationMs,
|
|
109
|
+
mergeDurationMs: this._mergeDurationMs,
|
|
110
|
+
averageMergeOpDurationMs: this._averageMergeOpDurationMs,
|
|
111
|
+
},
|
|
112
|
+
get success() {
|
|
113
|
+
return this.failedOperations.length === 0;
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.SchemaMergeReporter = SchemaMergeReporter;
|
|
19
119
|
/**
|
|
20
120
|
* Class to merge two schemas together.
|
|
21
121
|
* @see [[merge]] or [[mergeSchemas]] to merge two schemas together.
|
|
@@ -23,6 +123,8 @@ const NameMapping_1 = require("./Edits/NameMapping");
|
|
|
23
123
|
*/
|
|
24
124
|
class SchemaMerger {
|
|
25
125
|
_editingContext;
|
|
126
|
+
_mergeReporter;
|
|
127
|
+
_differenceStartTime = 0;
|
|
26
128
|
/**
|
|
27
129
|
* Constructs a new instance of the SchemaMerger object.
|
|
28
130
|
* @param editingContext The schema contexts that holds the schema to be edited.
|
|
@@ -39,6 +141,7 @@ class SchemaMerger {
|
|
|
39
141
|
* @alpha
|
|
40
142
|
*/
|
|
41
143
|
async mergeSchemas(targetSchema, sourceSchema, edits) {
|
|
144
|
+
this._differenceStartTime = performance.now();
|
|
42
145
|
return this.merge(await (0, SchemaDifference_1.getSchemaDifferences)(targetSchema, sourceSchema, edits), edits);
|
|
43
146
|
}
|
|
44
147
|
/**
|
|
@@ -48,6 +151,7 @@ class SchemaMerger {
|
|
|
48
151
|
* @alpha
|
|
49
152
|
*/
|
|
50
153
|
async merge(differenceResult, edits) {
|
|
154
|
+
const mergeStartTime = performance.now();
|
|
51
155
|
const targetSchemaKey = ecschema_metadata_1.SchemaKey.parseString(differenceResult.targetSchemaName);
|
|
52
156
|
const sourceSchemaKey = ecschema_metadata_1.SchemaKey.parseString(differenceResult.sourceSchemaName);
|
|
53
157
|
const nameMapping = new NameMapping_1.NameMapping();
|
|
@@ -76,11 +180,33 @@ class SchemaMerger {
|
|
|
76
180
|
sourceSchemaKey,
|
|
77
181
|
nameMapping,
|
|
78
182
|
});
|
|
183
|
+
// Initialize the merge reporter
|
|
184
|
+
this._mergeReporter = new SchemaMergeReporter(sourceSchemaKey, targetSchemaKey, differenceResult.differences.length);
|
|
185
|
+
visitor.setReporter(this._mergeReporter);
|
|
79
186
|
const walker = new SchemaMergingWalker_1.SchemaMergingWalker(visitor);
|
|
80
187
|
await walker.traverse(differenceResult.differences, "add");
|
|
81
188
|
await walker.traverse(differenceResult.differences, "modify");
|
|
189
|
+
const mergeEndTime = performance.now();
|
|
190
|
+
// Calculate performance metrics
|
|
191
|
+
const effectiveStartTime = this._differenceStartTime === 0 ? mergeStartTime : this._differenceStartTime;
|
|
192
|
+
const schemaDifferenceDurationMs = mergeStartTime - effectiveStartTime;
|
|
193
|
+
const mergeDurationMs = mergeEndTime - mergeStartTime;
|
|
194
|
+
const totalDurationMs = mergeEndTime - effectiveStartTime;
|
|
195
|
+
this._mergeReporter.setPerformanceMetrics({
|
|
196
|
+
totalDurationMs,
|
|
197
|
+
schemaDifferenceDurationMs,
|
|
198
|
+
mergeDurationMs,
|
|
199
|
+
averageMergeOpDurationMs: this._mergeReporter.mergeStatistics.total > 0 ? mergeDurationMs / this._mergeReporter.mergeStatistics.total : 0,
|
|
200
|
+
});
|
|
82
201
|
return schema;
|
|
83
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Gets the merge report for the last merge operation.
|
|
205
|
+
* @alpha
|
|
206
|
+
*/
|
|
207
|
+
getMergeReport() {
|
|
208
|
+
return this._mergeReporter?.getMergeReport();
|
|
209
|
+
}
|
|
84
210
|
}
|
|
85
211
|
exports.SchemaMerger = SchemaMerger;
|
|
86
212
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaMerger.js","sourceRoot":"","sources":["../../../src/Merging/SchemaMerger.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAAwH;AACxH,8CAAwD;AACxD,mDAA8D;AAC9D,uEAAqG;AACrG,iEAA8D;AAC9D,+DAA4D;AAE5D,oDAA2E;AAC3E,qDAAkD;AAclD;;;;GAIG;AACH,MAAa,YAAY;IAEN,eAAe,CAAgB;IAEhD;;;OAGG;IACH,YAAY,cAA6B;QACvC,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IACxC,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,YAAY,CAAC,YAAoB,EAAE,YAAoB,EAAE,KAAmB;QACvF,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,IAAA,uCAAoB,EAAC,YAAY,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;IAC1F,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,KAAK,CAAC,gBAAwC,EAAE,KAAmB;QAC9E,MAAM,eAAe,GAAG,6BAAS,CAAC,WAAW,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;QACjF,MAAM,eAAe,GAAG,6BAAS,CAAC,WAAW,CAAC,gBAAgB,CAAC,gBA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AC,gBAAgB,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QAE5D,OAAO,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;IAC7E,CAAC;CACF","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 Merging\r\n */\r\n\r\nimport { Schema, SchemaContext, SchemaItem, SchemaItemKey, SchemaKey, SchemaMatchType } from \"@itwin/ecschema-metadata\";\r\nimport { SchemaContextEditor } from \"../Editing/Editor\";\r\nimport { SchemaConflictsError } from \"../Differencing/Errors\";\r\nimport { getSchemaDifferences, type SchemaDifferenceResult } from \"../Differencing/SchemaDifference\";\r\nimport { SchemaMergingVisitor } from \"./SchemaMergingVisitor\";\r\nimport { SchemaMergingWalker } from \"./SchemaMergingWalker\";\r\nimport { SchemaEdits } from \"./Edits/SchemaEdits\";\r\nimport { ECEditingStatus, SchemaEditingError } from \"../Editing/Exception\";\r\nimport { NameMapping } from \"./Edits/NameMapping\";\r\n\r\n/**\r\n * Defines the context of a Schema merging run.\r\n * @internal\r\n */\r\nexport interface SchemaMergeContext {\r\n readonly targetSchema: Schema;\r\n readonly targetSchemaKey: SchemaKey;\r\n readonly sourceSchemaKey: SchemaKey;\r\n readonly editor: SchemaContextEditor;\r\n readonly nameMapping: NameMapping;\r\n}\r\n\r\n/**\r\n * Class to merge two schemas together.\r\n * @see [[merge]] or [[mergeSchemas]] to merge two schemas together.\r\n * @beta\r\n */\r\nexport class SchemaMerger {\r\n\r\n private readonly _editingContext: SchemaContext;\r\n\r\n /**\r\n * Constructs a new instance of the SchemaMerger object.\r\n * @param editingContext The schema contexts that holds the schema to be edited.\r\n */\r\n constructor(editingContext: SchemaContext) {\r\n this._editingContext = editingContext;\r\n }\r\n\r\n /**\r\n * Copy the SchemaItems of the source schemas to the target schema.\r\n * @param targetSchema The schema the SchemaItems gets merged to.\r\n * @param sourceSchema The schema the SchemaItems gets copied from.\r\n * @param edits An optional instance of schema edits that shall be applied before the schemas get merged.\r\n * @returns The merged target schema.\r\n * @alpha\r\n */\r\n public async mergeSchemas(targetSchema: Schema, sourceSchema: Schema, edits?: SchemaEdits): Promise<Schema> {\r\n return this.merge(await getSchemaDifferences(targetSchema, sourceSchema, edits), edits);\r\n }\r\n\r\n /**\r\n * Merges the schema differences into the target schema context.\r\n * @param differenceResult The differences that shall be applied to the target schema.\r\n * @param edits An optional instance of schema edits that shall be applied before the schemas get merged.\r\n * @alpha\r\n */\r\n public async merge(differenceResult: SchemaDifferenceResult, edits?: SchemaEdits): Promise<Schema> {\r\n const targetSchemaKey = SchemaKey.parseString(differenceResult.targetSchemaName);\r\n const sourceSchemaKey = SchemaKey.parseString(differenceResult.sourceSchemaName);\r\n\r\n const nameMapping = new NameMapping();\r\n const editor = new SchemaContextEditor(new MergingSchemaContext(this._editingContext, nameMapping));\r\n\r\n // If schema changes were provided, they'll get applied and a new SchemaDifferenceResult is returned\r\n // to prevent altering the differenceResult the caller passed in.\r\n if (edits) {\r\n await edits.applyTo(differenceResult = { ...differenceResult }, nameMapping);\r\n }\r\n\r\n if (differenceResult.conflicts && differenceResult.conflicts.length > 0) {\r\n throw new SchemaConflictsError(\r\n \"Schema's can't be merged if there are unresolved conflicts.\",\r\n differenceResult.conflicts,\r\n sourceSchemaKey,\r\n targetSchemaKey,\r\n );\r\n }\r\n\r\n const schema = await editor.getSchema(targetSchemaKey).catch((error: Error) => {\r\n if (error instanceof SchemaEditingError && error.errorNumber === ECEditingStatus.SchemaNotFound) {\r\n throw new Error(`The target schema '${targetSchemaKey.name}' could not be found in the editing context.`);\r\n }\r\n throw error;\r\n });\r\n\r\n if (!schema.isDynamic) {\r\n throw new Error(`The target schema '${targetSchemaKey.name}' is not dynamic. Only dynamic schemas are supported for merging.`);\r\n }\r\n\r\n const visitor = new SchemaMergingVisitor({\r\n editor,\r\n targetSchema: schema,\r\n targetSchemaKey,\r\n sourceSchemaKey,\r\n nameMapping,\r\n });\r\n\r\n const walker = new SchemaMergingWalker(visitor);\r\n await walker.traverse(differenceResult.differences, \"add\");\r\n await walker.traverse(differenceResult.differences, \"modify\");\r\n\r\n return schema;\r\n }\r\n}\r\n\r\n/**\r\n * SchemaContext implementation that overrides certain methods to allow to apply name mappings\r\n * for certain schema elements during the schema merging process.\r\n *\r\n * @internal\r\n */\r\nclass MergingSchemaContext extends SchemaContext {\r\n private _internalContext: SchemaContext;\r\n private _nameMappings: NameMapping;\r\n\r\n public constructor(internalContext: SchemaContext, nameMapping: NameMapping) {\r\n super();\r\n this._internalContext = internalContext;\r\n this._nameMappings = nameMapping;\r\n }\r\n\r\n public override async getCachedSchema(schemaKey: SchemaKey, matchType?: SchemaMatchType): Promise<Schema | undefined> {\r\n return this._internalContext.getCachedSchema(schemaKey, matchType);\r\n }\r\n\r\n public override async getSchema(schemaKey: SchemaKey, matchType?: SchemaMatchType): Promise<Schema | undefined> {\r\n return this._internalContext.getSchema(schemaKey, matchType);\r\n }\r\n\r\n public override async getSchemaItem<T extends typeof SchemaItem>(schemaNameOrKey: string | SchemaItemKey, itemNameOrCtor?: string | T, itemConstructor?: T): Promise<SchemaItem | InstanceType<T> | undefined> {\r\n let schemaItemKey: SchemaItemKey;\r\n if (typeof schemaNameOrKey === \"string\")\r\n schemaItemKey = new SchemaItemKey(itemNameOrCtor as string, new SchemaKey(schemaNameOrKey));\r\n else\r\n schemaItemKey = schemaNameOrKey;\r\n\r\n const mappedKey = this._nameMappings.resolveItemKey(schemaItemKey);\r\n if(mappedKey !== undefined) {\r\n schemaItemKey = mappedKey as SchemaItemKey;\r\n }\r\n\r\n if(itemConstructor === undefined)\r\n return this._internalContext.getSchemaItem(schemaItemKey);\r\n\r\n return this._internalContext.getSchemaItem(schemaItemKey, itemConstructor);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"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C;QACxC,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC;IACnC,CAAC;IAEe,KAAK,CAAC,eAAe,CAAC,SAAoB,EAAE,SAA2B;QACrF,OAAO,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACrE,CAAC;IAEe,KAAK,CAAC,SAAS,CAAC,SAAoB,EAAE,SAA2B;QAC/E,OAAO,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC/D,CAAC;IAEe,KAAK,CAAC,aAAa,CAA8B,eAAuC,EAAE,cAA2B,EAAE,eAAmB;QACxJ,IAAI,aAA4B,CAAC;QACjC,IAAI,OAAO,eAAe,KAAK,QAAQ;YACrC,aAAa,GAAG,IAAI,iCAAa,CAAC,cAAwB,EAAE,IAAI,6BAAS,CAAC,eAAe,CAAC,CAAC,CAAC;;YAE5F,aAAa,GAAG,eAAe,CAAC;QAElC,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QACnE,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,aAAa,GAAG,SAA0B,CAAC;QAC7C,CAAC;QAED,IAAI,eAAe,KAAK,SAAS;YAC/B,OAAO,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QAE5D,OAAO,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;IAC7E,CAAC;CACF","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 Merging\r\n */\r\n\r\nimport { Schema, SchemaContext, SchemaItem, SchemaItemKey, SchemaKey, SchemaMatchType } from \"@itwin/ecschema-metadata\";\r\nimport { SchemaContextEditor } from \"../Editing/Editor\";\r\nimport { SchemaConflictsError } from \"../Differencing/Errors\";\r\nimport { AnySchemaDifference, getSchemaDifferences, type SchemaDifferenceResult } from \"../Differencing/SchemaDifference\";\r\nimport { SchemaMergingVisitor } from \"./SchemaMergingVisitor\";\r\nimport { SchemaMergingWalker } from \"./SchemaMergingWalker\";\r\nimport { SchemaEdits } from \"./Edits/SchemaEdits\";\r\nimport { ECEditingStatus, SchemaEditingError } from \"../Editing/Exception\";\r\nimport { NameMapping } from \"./Edits/NameMapping\";\r\n\r\n/**\r\n * Defines the context of a Schema merging run.\r\n * @internal\r\n */\r\nexport interface SchemaMergeContext {\r\n readonly targetSchema: Schema;\r\n readonly targetSchemaKey: SchemaKey;\r\n readonly sourceSchemaKey: SchemaKey;\r\n readonly editor: SchemaContextEditor;\r\n readonly nameMapping: NameMapping;\r\n}\r\n\r\n/**\r\n * Represents a single merge operation that was executed.\r\n * @internal\r\n */\r\nexport interface SchemaMergeOperation {\r\n readonly change: AnySchemaDifference;\r\n readonly durationMs: number;\r\n}\r\n\r\n/**\r\n * Represents a merge operation that failed with an error.\r\n * @internal\r\n */\r\nexport interface SchemaMergeFailure extends SchemaMergeOperation {\r\n readonly error: string;\r\n}\r\n\r\n/**\r\n * Report of a schema merge operation containing success/failure details.\r\n * @internal\r\n */\r\nexport interface SchemaMergeReport {\r\n /** Source schema identifier */\r\n readonly sourceSchemaKey: SchemaKey;\r\n /** Target schema identifier */\r\n readonly targetSchemaKey: SchemaKey;\r\n /** Array of successfully merged differences */\r\n readonly successfulOperations: SchemaMergeOperation[];\r\n /** Array of failed merge operations with their errors */\r\n readonly failedOperations: SchemaMergeFailure[];\r\n /** Summary statistics of the merge operation */\r\n readonly mergeStatistics: {\r\n readonly total: number;\r\n readonly succeeded: number;\r\n readonly failed: number;\r\n };\r\n\r\n /** Performance metrics of the merge operation */\r\n readonly performanceMetrics: {\r\n readonly totalDurationMs: number;\r\n readonly schemaDifferenceDurationMs: number;\r\n readonly mergeDurationMs: number;\r\n readonly averageMergeOpDurationMs: number;\r\n };\r\n /** Returns true if all operations succeeded */\r\n readonly success: boolean;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class SchemaMergeReporter implements SchemaMergeReport {\r\n private readonly _succeeded: SchemaMergeOperation[] = [];\r\n private readonly _failed: SchemaMergeFailure[] = [];\r\n private readonly _sourceSchemaKey: SchemaKey;\r\n private readonly _targetSchemaKey: SchemaKey;\r\n private readonly _totalDifferences: number;\r\n private _totalDurationMs: number = 0;\r\n private _schemaDifferenceDurationMs: number = 0;\r\n private _mergeDurationMs: number = 0;\r\n private _averageMergeOpDurationMs: number = 0;\r\n\r\n constructor(\r\n sourceSchemaKey: SchemaKey,\r\n targetSchemaKey: SchemaKey,\r\n totalDifferences: number,\r\n ) {\r\n this._sourceSchemaKey = sourceSchemaKey;\r\n this._targetSchemaKey = targetSchemaKey;\r\n this._totalDifferences = totalDifferences;\r\n }\r\n\r\n public get sourceSchemaKey(): SchemaKey {\r\n return this._sourceSchemaKey;\r\n }\r\n\r\n public get targetSchemaKey(): SchemaKey {\r\n return this._targetSchemaKey;\r\n }\r\n\r\n public get successfulOperations(): SchemaMergeOperation[] {\r\n return [...this._succeeded];\r\n }\r\n\r\n public get failedOperations(): SchemaMergeFailure[] {\r\n return [...this._failed];\r\n }\r\n\r\n public get mergeStatistics() {\r\n return {\r\n total: this._totalDifferences,\r\n succeeded: this._succeeded.length,\r\n failed: this._failed.length,\r\n };\r\n }\r\n\r\n public get performanceMetrics() {\r\n return {\r\n totalDurationMs: this._totalDurationMs,\r\n schemaDifferenceDurationMs: this._schemaDifferenceDurationMs,\r\n mergeDurationMs: this._mergeDurationMs,\r\n averageMergeOpDurationMs: this._averageMergeOpDurationMs,\r\n };\r\n }\r\n\r\n public get success(): boolean {\r\n return this._failed.length === 0;\r\n }\r\n\r\n /**\r\n * Sets the performance metrics for the merge operation.\r\n * @internal\r\n */\r\n public setPerformanceMetrics(metrics: {\r\n totalDurationMs: number;\r\n schemaDifferenceDurationMs: number;\r\n mergeDurationMs: number;\r\n averageMergeOpDurationMs: number;\r\n }): void {\r\n this._totalDurationMs = metrics.totalDurationMs;\r\n this._schemaDifferenceDurationMs = metrics.schemaDifferenceDurationMs;\r\n this._mergeDurationMs = metrics.mergeDurationMs;\r\n this._averageMergeOpDurationMs = metrics.averageMergeOpDurationMs;\r\n }\r\n\r\n /**\r\n * Records a successful merge operation.\r\n * @internal\r\n */\r\n public recordSuccess(change: AnySchemaDifference, durationMs: number): void {\r\n this._succeeded.push({ change, durationMs });\r\n }\r\n\r\n /**\r\n * Records a failed merge operation.\r\n * @internal\r\n */\r\n public recordFailure(change: AnySchemaDifference, durationMs: number, error: Error): void {\r\n this._failed.push({ change, durationMs, error: error.message });\r\n }\r\n\r\n /**\r\n * Returns the merge report.\r\n * @internal\r\n */\r\n public getMergeReport(): SchemaMergeReport {\r\n return {\r\n sourceSchemaKey: this._sourceSchemaKey,\r\n targetSchemaKey: this._targetSchemaKey,\r\n successfulOperations: [...this._succeeded],\r\n failedOperations: [...this._failed],\r\n mergeStatistics: {\r\n total: this._totalDifferences,\r\n succeeded: this._succeeded.length,\r\n failed: this._failed.length,\r\n },\r\n performanceMetrics: {\r\n totalDurationMs: this._totalDurationMs,\r\n schemaDifferenceDurationMs: this._schemaDifferenceDurationMs,\r\n mergeDurationMs: this._mergeDurationMs,\r\n averageMergeOpDurationMs: this._averageMergeOpDurationMs,\r\n },\r\n get success() {\r\n return this.failedOperations.length === 0;\r\n },\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * Class to merge two schemas together.\r\n * @see [[merge]] or [[mergeSchemas]] to merge two schemas together.\r\n * @beta\r\n */\r\nexport class SchemaMerger {\r\n\r\n private readonly _editingContext: SchemaContext;\r\n private _mergeReporter: SchemaMergeReporter | undefined;\r\n private _differenceStartTime: number = 0;\r\n\r\n /**\r\n * Constructs a new instance of the SchemaMerger object.\r\n * @param editingContext The schema contexts that holds the schema to be edited.\r\n */\r\n constructor(editingContext: SchemaContext) {\r\n this._editingContext = editingContext;\r\n }\r\n\r\n /**\r\n * Copy the SchemaItems of the source schemas to the target schema.\r\n * @param targetSchema The schema the SchemaItems gets merged to.\r\n * @param sourceSchema The schema the SchemaItems gets copied from.\r\n * @param edits An optional instance of schema edits that shall be applied before the schemas get merged.\r\n * @returns The merged target schema.\r\n * @alpha\r\n */\r\n public async mergeSchemas(targetSchema: Schema, sourceSchema: Schema, edits?: SchemaEdits): Promise<Schema> {\r\n this._differenceStartTime = performance.now();\r\n return this.merge(await getSchemaDifferences(targetSchema, sourceSchema, edits), edits);\r\n }\r\n\r\n /**\r\n * Merges the schema differences into the target schema context.\r\n * @param differenceResult The differences that shall be applied to the target schema.\r\n * @param edits An optional instance of schema edits that shall be applied before the schemas get merged.\r\n * @alpha\r\n */\r\n public async merge(differenceResult: SchemaDifferenceResult, edits?: SchemaEdits): Promise<Schema> {\r\n const mergeStartTime = performance.now();\r\n\r\n const targetSchemaKey = SchemaKey.parseString(differenceResult.targetSchemaName);\r\n const sourceSchemaKey = SchemaKey.parseString(differenceResult.sourceSchemaName);\r\n\r\n const nameMapping = new NameMapping();\r\n const editor = new SchemaContextEditor(new MergingSchemaContext(this._editingContext, nameMapping));\r\n\r\n // If schema changes were provided, they'll get applied and a new SchemaDifferenceResult is returned\r\n // to prevent altering the differenceResult the caller passed in.\r\n if (edits) {\r\n await edits.applyTo(differenceResult = { ...differenceResult }, nameMapping);\r\n }\r\n\r\n if (differenceResult.conflicts && differenceResult.conflicts.length > 0) {\r\n throw new SchemaConflictsError(\r\n \"Schema's can't be merged if there are unresolved conflicts.\",\r\n differenceResult.conflicts,\r\n sourceSchemaKey,\r\n targetSchemaKey,\r\n );\r\n }\r\n\r\n const schema = await editor.getSchema(targetSchemaKey).catch((error: Error) => {\r\n if (error instanceof SchemaEditingError && error.errorNumber === ECEditingStatus.SchemaNotFound) {\r\n throw new Error(`The target schema '${targetSchemaKey.name}' could not be found in the editing context.`);\r\n }\r\n throw error;\r\n });\r\n\r\n if (!schema.isDynamic) {\r\n throw new Error(`The target schema '${targetSchemaKey.name}' is not dynamic. Only dynamic schemas are supported for merging.`);\r\n }\r\n\r\n const visitor = new SchemaMergingVisitor({\r\n editor,\r\n targetSchema: schema,\r\n targetSchemaKey,\r\n sourceSchemaKey,\r\n nameMapping,\r\n });\r\n\r\n // Initialize the merge reporter\r\n this._mergeReporter = new SchemaMergeReporter(sourceSchemaKey, targetSchemaKey, differenceResult.differences.length);\r\n visitor.setReporter(this._mergeReporter);\r\n\r\n const walker = new SchemaMergingWalker(visitor);\r\n await walker.traverse(differenceResult.differences, \"add\");\r\n await walker.traverse(differenceResult.differences, \"modify\");\r\n\r\n const mergeEndTime = performance.now();\r\n\r\n // Calculate performance metrics\r\n const effectiveStartTime = this._differenceStartTime === 0 ? mergeStartTime : this._differenceStartTime;\r\n const schemaDifferenceDurationMs = mergeStartTime - effectiveStartTime;\r\n const mergeDurationMs = mergeEndTime - mergeStartTime;\r\n const totalDurationMs = mergeEndTime - effectiveStartTime;\r\n\r\n this._mergeReporter.setPerformanceMetrics({\r\n totalDurationMs,\r\n schemaDifferenceDurationMs,\r\n mergeDurationMs,\r\n averageMergeOpDurationMs: this._mergeReporter.mergeStatistics.total > 0 ? mergeDurationMs / this._mergeReporter.mergeStatistics.total : 0,\r\n });\r\n\r\n return schema;\r\n }\r\n\r\n /**\r\n * Gets the merge report for the last merge operation.\r\n * @alpha\r\n */\r\n public getMergeReport(): SchemaMergeReport | undefined {\r\n return this._mergeReporter?.getMergeReport();\r\n }\r\n}\r\n\r\n/**\r\n * SchemaContext implementation that overrides certain methods to allow to apply name mappings\r\n * for certain schema elements during the schema merging process.\r\n *\r\n * @internal\r\n */\r\nclass MergingSchemaContext extends SchemaContext {\r\n private _internalContext: SchemaContext;\r\n private _nameMappings: NameMapping;\r\n\r\n public constructor(internalContext: SchemaContext, nameMapping: NameMapping) {\r\n super();\r\n this._internalContext = internalContext;\r\n this._nameMappings = nameMapping;\r\n }\r\n\r\n public override async getCachedSchema(schemaKey: SchemaKey, matchType?: SchemaMatchType): Promise<Schema | undefined> {\r\n return this._internalContext.getCachedSchema(schemaKey, matchType);\r\n }\r\n\r\n public override async getSchema(schemaKey: SchemaKey, matchType?: SchemaMatchType): Promise<Schema | undefined> {\r\n return this._internalContext.getSchema(schemaKey, matchType);\r\n }\r\n\r\n public override async getSchemaItem<T extends typeof SchemaItem>(schemaNameOrKey: string | SchemaItemKey, itemNameOrCtor?: string | T, itemConstructor?: T): Promise<SchemaItem | InstanceType<T> | undefined> {\r\n let schemaItemKey: SchemaItemKey;\r\n if (typeof schemaNameOrKey === \"string\")\r\n schemaItemKey = new SchemaItemKey(itemNameOrCtor as string, new SchemaKey(schemaNameOrKey));\r\n else\r\n schemaItemKey = schemaNameOrKey;\r\n\r\n const mappedKey = this._nameMappings.resolveItemKey(schemaItemKey);\r\n if (mappedKey !== undefined) {\r\n schemaItemKey = mappedKey as SchemaItemKey;\r\n }\r\n\r\n if (itemConstructor === undefined)\r\n return this._internalContext.getSchemaItem(schemaItemKey);\r\n\r\n return this._internalContext.getSchemaItem(schemaItemKey, itemConstructor);\r\n }\r\n}\r\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnySchemaDifference, ClassPropertyDifference, ConstantDifference, CustomAttributeClassDifference, CustomAttributeDifference, EntityClassDifference, EntityClassMixinDifference, EnumerationDifference, EnumeratorDifference, FormatDifference, FormatUnitDifference, FormatUnitLabelDifference, InvertedUnitDifference, KindOfQuantityDifference, KindOfQuantityPresentationFormatDifference, MixinClassDifference, PhenomenonDifference, PropertyCategoryDifference, RelationshipClassDifference, RelationshipConstraintClassDifference, RelationshipConstraintDifference, SchemaDifference, SchemaReferenceDifference, StructClassDifference, UnitDifference, UnitSystemDifference } from "../Differencing/SchemaDifference";
|
|
2
2
|
import { SchemaDifferenceVisitor } from "../Differencing/SchemaDifferenceVisitor";
|
|
3
|
-
import { SchemaMergeContext } from "./SchemaMerger";
|
|
3
|
+
import { SchemaMergeContext, SchemaMergeReporter } from "./SchemaMerger";
|
|
4
4
|
/**
|
|
5
5
|
* Implementation of ISchemaDifferenceVisitor that can be used to traverse schema
|
|
6
6
|
* differences to call the appropriated merger methods.
|
|
@@ -8,10 +8,21 @@ import { SchemaMergeContext } from "./SchemaMerger";
|
|
|
8
8
|
*/
|
|
9
9
|
export declare class SchemaMergingVisitor implements SchemaDifferenceVisitor {
|
|
10
10
|
private readonly _context;
|
|
11
|
+
private _reporter?;
|
|
11
12
|
/**
|
|
12
13
|
* Initializes a new instance of SchemaMergingVisitor class.
|
|
13
14
|
*/
|
|
14
15
|
constructor(context: SchemaMergeContext);
|
|
16
|
+
/**
|
|
17
|
+
* Sets the reporter for tracking merge operations.
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
setReporter(reporter: SchemaMergeReporter): void;
|
|
21
|
+
/**
|
|
22
|
+
* Method that wraps the visitor with success/failure tracking.
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
private trackOperation;
|
|
15
26
|
/**
|
|
16
27
|
* Shared merging logic for all types of ClassItemDifference union.
|
|
17
28
|
*/
|
|
@@ -115,7 +126,7 @@ export declare class SchemaMergingVisitor implements SchemaDifferenceVisitor {
|
|
|
115
126
|
* Visitor implementation for handling SchemaDifference.
|
|
116
127
|
* @internal
|
|
117
128
|
*/
|
|
118
|
-
visitSchemaDifference(
|
|
129
|
+
visitSchemaDifference(entry: SchemaDifference): Promise<void>;
|
|
119
130
|
/**
|
|
120
131
|
* Shared merging logic for all types of AnySchemaItemDifference union.
|
|
121
132
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaMergingVisitor.d.ts","sourceRoot":"","sources":["../../../src/Merging/SchemaMergingVisitor.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"SchemaMergingVisitor.d.ts","sourceRoot":"","sources":["../../../src/Merging/SchemaMergingVisitor.ts"],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