@itwin/imodel-transformer 1.0.0-dev.8 → 1.0.0-dev.9
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.
|
@@ -375,22 +375,23 @@ export declare class IModelTransformer extends IModelExportHandler {
|
|
|
375
375
|
*/
|
|
376
376
|
private _startingChangesetIndices;
|
|
377
377
|
private _cachedSynchronizationVersion;
|
|
378
|
-
/** the changeset in the scoping element's source version found for this transformation
|
|
379
|
-
* @note: the version depends on whether this is a reverse synchronization or not, as
|
|
380
|
-
* it is stored separately for both synchronization directions.
|
|
381
|
-
* @note: must call [[initScopeProvenance]] before using this property.
|
|
382
|
-
* @note: empty string and -1 for changeset and index if it has never been transformed or was transformed before federation guid update (pre 1.x).
|
|
383
|
-
*/
|
|
384
|
-
private get _synchronizationVersion();
|
|
385
378
|
/**
|
|
386
379
|
* As of itwinjs 4.6.0, definitionContainers are now deleted as if they were DefinitionPartitions as opposed to Definitions.
|
|
387
380
|
* This variable being true will be used to special case the deletion of DefinitionContainers the same way DefinitionPartitions are deleted.
|
|
388
381
|
*/
|
|
389
382
|
protected get hasDefinitionContainerDeletionFeature(): boolean;
|
|
383
|
+
/**
|
|
384
|
+
* We cache the synchronization version to avoid querying the target scoping ESA multiple times.
|
|
385
|
+
* If the target scoping ESA is ever updated we need to clear any potentially cached sync version otherwise we will get stale values.
|
|
386
|
+
* Sets this._cachedSynchronizationVersion to undefined.
|
|
387
|
+
*/
|
|
388
|
+
private clearCachedSynchronizationVersion;
|
|
390
389
|
/** the changeset in the scoping element's source version found for this transformation
|
|
391
|
-
* @note
|
|
390
|
+
* @note the version depends on whether this is a reverse synchronization or not, as
|
|
392
391
|
* it is stored separately for both synchronization directions.
|
|
393
|
-
* @note
|
|
392
|
+
* @note empty string and -1 for changeset and index if it has never been transformed
|
|
393
|
+
* @note empty string and -1 for changeset and index if it was transformed before federation guid update (pre 1.x) and @see [[IModelTransformOptions.branchRelationshipDataBehavior]] === "unsafe-migrate".
|
|
394
|
+
* @throws if the version is not found in a preexisting scope aspect and @see [[IModelTransformOptions.branchRelationshipDataBehavior]] !== "unsafe-migrate"
|
|
394
395
|
*/
|
|
395
396
|
protected get synchronizationVersion(): ChangesetIndexAndId;
|
|
396
397
|
/**
|
|
@@ -405,6 +406,7 @@ export declare class IModelTransformer extends IModelExportHandler {
|
|
|
405
406
|
* if this was a [BriefcaseDb]($backend)
|
|
406
407
|
*/
|
|
407
408
|
protected initScopeProvenance(): void;
|
|
409
|
+
/** Returns true if a change was made to the aspectProps. */
|
|
408
410
|
private handleUnsafeMigrate;
|
|
409
411
|
/**
|
|
410
412
|
* Iterate all matching federation guids and ExternalSourceAspects in the provenance iModel (target unless reverse sync)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelTransformer.d.ts","sourceRoot":"","sources":["../../src/IModelTransformer.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,WAAW,EAMX,SAAS,EACT,UAAU,EAKX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,gBAAgB,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAaL,OAAO,EACP,aAAa,EACb,kBAAkB,EAGlB,mBAAmB,EACnB,MAAM,EAGN,oBAAoB,EAKpB,QAAQ,EAKR,KAAK,EAGL,YAAY,EACZ,iBAAiB,EAMlB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,mBAAmB,EAGnB,QAAQ,EAER,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,yBAAyB,EACzB,SAAS,EAIT,UAAU,EACV,WAAW,EACX,WAAW,EAMZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EAEpB,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,OAAO,EAAoB,mBAAmB,EAAE,MAA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,EAAE,UAAU;CAO9B;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,iBAAiB;IACxD,8CAA8C;IAC9C,OAAO,CAAC,YAAY,CAAC,CAAY;IACjC,gIAAgI;IAChI,OAAO,CAAC,sBAAsB,CAAC,CAA8B;IAC7D;;;;;OAKG;gBACgB,QAAQ,EAAE,QAAQ,EAAE,QAAQ,GAAE,QAAmB;IAMpE;;;;;;OAMG;IACU,eAAe,CAC1B,qBAAqB,EAAE,UAAU,EACjC,aAAa,EAAE,UAAU,EACzB,SAAS,EAAE,WAAW,GACrB,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAkBvC;;;;;;OAMG;IACU,eAAe,CAC1B,qBAAqB,EAAE,UAAU,EACjC,aAAa,EAAE,UAAU,EACzB,SAAS,EAAE,WAAW,GACrB,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAkBvC,4EAA4E;IAC5D,kBAAkB,CAAC,aAAa,EAAE,OAAO,GAAG,YAAY;CAsDzE"}
|
|
@@ -456,25 +456,6 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
456
456
|
forceOldRelationshipProvenanceMethod: this._forceOldRelationshipProvenanceMethod,
|
|
457
457
|
});
|
|
458
458
|
}
|
|
459
|
-
/** the changeset in the scoping element's source version found for this transformation
|
|
460
|
-
* @note: the version depends on whether this is a reverse synchronization or not, as
|
|
461
|
-
* it is stored separately for both synchronization directions.
|
|
462
|
-
* @note: must call [[initScopeProvenance]] before using this property.
|
|
463
|
-
* @note: empty string and -1 for changeset and index if it has never been transformed or was transformed before federation guid update (pre 1.x).
|
|
464
|
-
*/
|
|
465
|
-
get _synchronizationVersion() {
|
|
466
|
-
if (!this._cachedSynchronizationVersion) {
|
|
467
|
-
nodeAssert(this._targetScopeProvenanceProps, "_targetScopeProvenanceProps was not set yet");
|
|
468
|
-
const version = this.isReverseSynchronization
|
|
469
|
-
? this._targetScopeProvenanceProps.jsonProperties?.reverseSyncVersion
|
|
470
|
-
: this._targetScopeProvenanceProps.version;
|
|
471
|
-
nodeAssert(version !== undefined, "no version contained in target scope");
|
|
472
|
-
const [id, index] = version === "" ? ["", -1] : version.split(";");
|
|
473
|
-
this._cachedSynchronizationVersion = { index: Number(index), id };
|
|
474
|
-
nodeAssert(!Number.isNaN(this._cachedSynchronizationVersion.index), "bad parse: invalid index in version");
|
|
475
|
-
}
|
|
476
|
-
return this._cachedSynchronizationVersion;
|
|
477
|
-
}
|
|
478
459
|
/**
|
|
479
460
|
* As of itwinjs 4.6.0, definitionContainers are now deleted as if they were DefinitionPartitions as opposed to Definitions.
|
|
480
461
|
* This variable being true will be used to special case the deletion of DefinitionContainers the same way DefinitionPartitions are deleted.
|
|
@@ -485,10 +466,20 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
485
466
|
}
|
|
486
467
|
return this._hasDefinitionContainerDeletionFeature;
|
|
487
468
|
}
|
|
469
|
+
/**
|
|
470
|
+
* We cache the synchronization version to avoid querying the target scoping ESA multiple times.
|
|
471
|
+
* If the target scoping ESA is ever updated we need to clear any potentially cached sync version otherwise we will get stale values.
|
|
472
|
+
* Sets this._cachedSynchronizationVersion to undefined.
|
|
473
|
+
*/
|
|
474
|
+
clearCachedSynchronizationVersion() {
|
|
475
|
+
this._cachedSynchronizationVersion = undefined;
|
|
476
|
+
}
|
|
488
477
|
/** the changeset in the scoping element's source version found for this transformation
|
|
489
|
-
* @note
|
|
478
|
+
* @note the version depends on whether this is a reverse synchronization or not, as
|
|
490
479
|
* it is stored separately for both synchronization directions.
|
|
491
|
-
* @note
|
|
480
|
+
* @note empty string and -1 for changeset and index if it has never been transformed
|
|
481
|
+
* @note empty string and -1 for changeset and index if it was transformed before federation guid update (pre 1.x) and @see [[IModelTransformOptions.branchRelationshipDataBehavior]] === "unsafe-migrate".
|
|
482
|
+
* @throws if the version is not found in a preexisting scope aspect and @see [[IModelTransformOptions.branchRelationshipDataBehavior]] !== "unsafe-migrate"
|
|
492
483
|
*/
|
|
493
484
|
get synchronizationVersion() {
|
|
494
485
|
if (this._cachedSynchronizationVersion === undefined) {
|
|
@@ -499,10 +490,15 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
499
490
|
const version = this.isReverseSynchronization
|
|
500
491
|
? JSON.parse(provenanceScopeAspect.jsonProperties ?? "{}").reverseSyncVersion
|
|
501
492
|
: provenanceScopeAspect.version;
|
|
502
|
-
if (!version
|
|
493
|
+
if (!version &&
|
|
494
|
+
this._options.branchRelationshipDataBehavior === "unsafe-migrate") {
|
|
503
495
|
return { index: -1, id: "" }; // previous synchronization was done before fed guid update.
|
|
504
496
|
}
|
|
505
|
-
|
|
497
|
+
if (version === undefined) {
|
|
498
|
+
throw new Error(`Could not find synchronization version in scope aspect. This may be due to the last successful run of the transformer being done with an older version.
|
|
499
|
+
Consider running the transformer with branchRelationshipDataBehavior set to 'unsafe-migrate'`);
|
|
500
|
+
}
|
|
501
|
+
const [id, index] = version === "" ? ["", -1] : version.split(";");
|
|
506
502
|
if (Number.isNaN(Number(index)))
|
|
507
503
|
throw new Error("Could not parse version data from scope aspect");
|
|
508
504
|
this._cachedSynchronizationVersion = { index: Number(index), id }; // synchronization version found and cached.
|
|
@@ -578,6 +574,8 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
578
574
|
jsonProperties: JSON.stringify(aspectProps.jsonProperties),
|
|
579
575
|
});
|
|
580
576
|
aspectProps.id = id;
|
|
577
|
+
// Busting a potential cached version
|
|
578
|
+
this.clearCachedSynchronizationVersion();
|
|
581
579
|
}
|
|
582
580
|
}
|
|
583
581
|
else {
|
|
@@ -587,29 +585,49 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
587
585
|
aspectProps.jsonProperties = foundEsaProps.jsonProperties
|
|
588
586
|
? JSON.parse(foundEsaProps.jsonProperties)
|
|
589
587
|
: undefined;
|
|
590
|
-
|
|
588
|
+
// Clone oldProps incase they're changed for logging purposes
|
|
589
|
+
const oldProps = JSON.parse(JSON.stringify(aspectProps));
|
|
590
|
+
if (this.handleUnsafeMigrate(aspectProps)) {
|
|
591
|
+
core_bentley_1.Logger.logInfo(loggerCategory, "Unsafe migrate made a change to the target scope's external source aspect. Updating aspect in database.", { oldProps, newProps: aspectProps });
|
|
592
|
+
this.provenanceDb.elements.updateAspect({
|
|
593
|
+
...aspectProps,
|
|
594
|
+
jsonProperties: JSON.stringify(aspectProps.jsonProperties),
|
|
595
|
+
});
|
|
596
|
+
// Busting a potential cached version
|
|
597
|
+
this.clearCachedSynchronizationVersion();
|
|
598
|
+
}
|
|
591
599
|
}
|
|
592
600
|
this._targetScopeProvenanceProps =
|
|
593
601
|
aspectProps;
|
|
594
602
|
}
|
|
603
|
+
/** Returns true if a change was made to the aspectProps. */
|
|
595
604
|
handleUnsafeMigrate(aspectProps) {
|
|
605
|
+
let madeChange = false;
|
|
596
606
|
if (this._options.branchRelationshipDataBehavior !== "unsafe-migrate")
|
|
597
|
-
return;
|
|
607
|
+
return madeChange;
|
|
598
608
|
const fallbackSyncVersionToUse = this._options.unsafeFallbackSyncVersion ?? "";
|
|
599
609
|
const fallbackReverseSyncVersionToUse = this._options.unsafeFallbackReverseSyncVersion ?? "";
|
|
600
|
-
if (aspectProps.version === undefined ||
|
|
610
|
+
if (aspectProps.version === undefined ||
|
|
611
|
+
(aspectProps.version === "" &&
|
|
612
|
+
aspectProps.version !== fallbackSyncVersionToUse)) {
|
|
601
613
|
aspectProps.version = fallbackSyncVersionToUse;
|
|
614
|
+
madeChange = true;
|
|
615
|
+
}
|
|
602
616
|
if (aspectProps.jsonProperties === undefined) {
|
|
603
617
|
aspectProps.jsonProperties = {
|
|
604
618
|
pendingReverseSyncChangesetIndices: [],
|
|
605
619
|
pendingSyncChangesetIndices: [],
|
|
606
620
|
reverseSyncVersion: fallbackReverseSyncVersionToUse,
|
|
607
621
|
};
|
|
622
|
+
madeChange = true;
|
|
608
623
|
}
|
|
609
624
|
else if (aspectProps.jsonProperties.reverseSyncVersion === undefined ||
|
|
610
|
-
aspectProps.jsonProperties.reverseSyncVersion === ""
|
|
625
|
+
(aspectProps.jsonProperties.reverseSyncVersion === "" &&
|
|
626
|
+
aspectProps.jsonProperties.reverseSyncVersion !==
|
|
627
|
+
fallbackReverseSyncVersionToUse)) {
|
|
611
628
|
aspectProps.jsonProperties.reverseSyncVersion =
|
|
612
629
|
fallbackReverseSyncVersionToUse;
|
|
630
|
+
madeChange = true;
|
|
613
631
|
}
|
|
614
632
|
/**
|
|
615
633
|
* This case will only be hit when:
|
|
@@ -622,11 +640,14 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
622
640
|
undefined) {
|
|
623
641
|
core_bentley_1.Logger.logWarning(loggerCategory, "Property pendingReverseSyncChangesetIndices missing on the jsonProperties of the scoping ESA. Setting to [].");
|
|
624
642
|
aspectProps.jsonProperties.pendingReverseSyncChangesetIndices = [];
|
|
643
|
+
madeChange = true;
|
|
625
644
|
}
|
|
626
645
|
if (aspectProps.jsonProperties.pendingSyncChangesetIndices === undefined) {
|
|
627
646
|
core_bentley_1.Logger.logWarning(loggerCategory, "Property pendingSyncChangesetIndices missing on the jsonProperties of the scoping ESA. Setting to [].");
|
|
628
647
|
aspectProps.jsonProperties.pendingSyncChangesetIndices = [];
|
|
648
|
+
madeChange = true;
|
|
629
649
|
}
|
|
650
|
+
return madeChange;
|
|
630
651
|
}
|
|
631
652
|
/**
|
|
632
653
|
* Iterate all matching federation guids and ExternalSourceAspects in the provenance iModel (target unless reverse sync)
|
|
@@ -1454,6 +1475,7 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
1454
1475
|
...this._targetScopeProvenanceProps,
|
|
1455
1476
|
jsonProperties: JSON.stringify(this._targetScopeProvenanceProps.jsonProperties),
|
|
1456
1477
|
});
|
|
1478
|
+
this.clearCachedSynchronizationVersion();
|
|
1457
1479
|
}
|
|
1458
1480
|
// FIXME<MIKE>: is this necessary when manually using low level transform APIs? (document if so)
|
|
1459
1481
|
async finalizeTransformation(options) {
|
|
@@ -1930,7 +1952,7 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
1930
1952
|
async processDeletedOp(change, mapOfDeletedElemIdToScopeEsas, isRelationship, alreadyImportedElementInserts, alreadyImportedModelInserts) {
|
|
1931
1953
|
// we need a connected iModel with changes to remap elements with deletions
|
|
1932
1954
|
const notConnectedModel = this.sourceDb.iTwinId === undefined;
|
|
1933
|
-
const noChanges = this.
|
|
1955
|
+
const noChanges = this.synchronizationVersion.index === this.sourceDb.changeset.index;
|
|
1934
1956
|
if (notConnectedModel || noChanges)
|
|
1935
1957
|
return;
|
|
1936
1958
|
/**
|
|
@@ -2027,7 +2049,7 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
2027
2049
|
this._sourceChangeDataState = "unconnected";
|
|
2028
2050
|
return;
|
|
2029
2051
|
}
|
|
2030
|
-
const noChanges = this.
|
|
2052
|
+
const noChanges = this.synchronizationVersion.index === this.sourceDb.changeset.index;
|
|
2031
2053
|
if (noChanges) {
|
|
2032
2054
|
this._sourceChangeDataState = "no-changes";
|
|
2033
2055
|
this._csFileProps = [];
|
|
@@ -2037,7 +2059,7 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
2037
2059
|
// to ignore those already processed changes
|
|
2038
2060
|
const startChangesetIndexOrId = args.startChangeset?.index ??
|
|
2039
2061
|
args.startChangeset?.id ??
|
|
2040
|
-
this.
|
|
2062
|
+
this.synchronizationVersion.index + 1;
|
|
2041
2063
|
const endChangesetId = this.sourceDb.changeset.id;
|
|
2042
2064
|
const [startChangesetIndex, endChangesetIndex] = await Promise.all([startChangesetIndexOrId, endChangesetId].map(async (indexOrId) => typeof indexOrId === "number"
|
|
2043
2065
|
? indexOrId
|
|
@@ -2049,17 +2071,17 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
2049
2071
|
accessToken: args.accessToken,
|
|
2050
2072
|
})
|
|
2051
2073
|
.then((changeset) => changeset.index)));
|
|
2052
|
-
const missingChangesets = startChangesetIndex > this.
|
|
2074
|
+
const missingChangesets = startChangesetIndex > this.synchronizationVersion.index + 1;
|
|
2053
2075
|
if (!this._options.ignoreMissingChangesetsInSynchronizations &&
|
|
2054
|
-
startChangesetIndex !== this.
|
|
2055
|
-
this.
|
|
2076
|
+
startChangesetIndex !== this.synchronizationVersion.index + 1 &&
|
|
2077
|
+
this.synchronizationVersion.index !== -1) {
|
|
2056
2078
|
throw Error(`synchronization is ${missingChangesets ? "missing changesets" : ""},` +
|
|
2057
2079
|
" startChangesetId should be" +
|
|
2058
2080
|
" exactly the first changeset *after* the previous synchronization to not miss data." +
|
|
2059
2081
|
` You specified '${startChangesetIndexOrId}' which is changeset #${startChangesetIndex}` +
|
|
2060
|
-
` but the previous synchronization for this targetScopeElement was '${this.
|
|
2061
|
-
` which is changeset #${this.
|
|
2062
|
-
` #${this.
|
|
2082
|
+
` but the previous synchronization for this targetScopeElement was '${this.synchronizationVersion.id}'` +
|
|
2083
|
+
` which is changeset #${this.synchronizationVersion.index}. The transformer expected` +
|
|
2084
|
+
` #${this.synchronizationVersion.index + 1}.`);
|
|
2063
2085
|
}
|
|
2064
2086
|
nodeAssert(this._targetScopeProvenanceProps, "_targetScopeProvenanceProps should be set by now");
|
|
2065
2087
|
const changesetsToSkip = this.isReverseSynchronization
|
|
@@ -2081,7 +2103,9 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
2081
2103
|
csFileProps.push(...fileProps);
|
|
2082
2104
|
}
|
|
2083
2105
|
this._csFileProps = csFileProps;
|
|
2084
|
-
|
|
2106
|
+
/** Theres a possibility that our csFileProps length is still 0 here, since we skip cs indices found in the pendingSync and pendingReverseSync indices arrays. */
|
|
2107
|
+
this._sourceChangeDataState =
|
|
2108
|
+
this._csFileProps.length === 0 ? "no-changes" : "has-changes";
|
|
2085
2109
|
}
|
|
2086
2110
|
/** Export everything from the source iModel and import the transformed entities into the target iModel.
|
|
2087
2111
|
* @note [[processSchemas]] is not called automatically since the target iModel may want a different collection of schemas.
|
|
@@ -2166,7 +2190,7 @@ class IModelTransformer extends IModelExporter_1.IModelExportHandler {
|
|
|
2166
2190
|
? { startChangeset: opts.startChangeset }
|
|
2167
2191
|
: {
|
|
2168
2192
|
startChangeset: {
|
|
2169
|
-
index: this.
|
|
2193
|
+
index: this.synchronizationVersion.index + 1,
|
|
2170
2194
|
},
|
|
2171
2195
|
}),
|
|
2172
2196
|
};
|