@itwin/imodel-transformer 2.0.0-dev.4 → 2.0.0-dev.40
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/README.md +12 -26
- package/lib/cjs/BranchProvenanceInitializer.d.ts.map +1 -1
- package/lib/cjs/BranchProvenanceInitializer.js +35 -30
- package/lib/cjs/BranchProvenanceInitializer.js.map +1 -1
- package/lib/cjs/ChangesetScanner.d.ts +60 -0
- package/lib/cjs/ChangesetScanner.d.ts.map +1 -0
- package/lib/cjs/ChangesetScanner.js +101 -0
- package/lib/cjs/ChangesetScanner.js.map +1 -0
- package/lib/cjs/ECReferenceTypesCache.d.ts +0 -3
- package/lib/cjs/ECReferenceTypesCache.d.ts.map +1 -1
- package/lib/cjs/ECReferenceTypesCache.js +61 -103
- package/lib/cjs/ECReferenceTypesCache.js.map +1 -1
- package/lib/cjs/ElementAspectCleanup.d.ts +16 -0
- package/lib/cjs/ElementAspectCleanup.d.ts.map +1 -0
- package/lib/cjs/ElementAspectCleanup.js +83 -0
- package/lib/cjs/ElementAspectCleanup.js.map +1 -0
- package/lib/cjs/ElementAspectExportCoordinator.d.ts +44 -0
- package/lib/cjs/ElementAspectExportCoordinator.d.ts.map +1 -0
- package/lib/cjs/ElementAspectExportCoordinator.js +148 -0
- package/lib/cjs/ElementAspectExportCoordinator.js.map +1 -0
- package/lib/cjs/ElementAspectExportProcessor.d.ts +55 -0
- package/lib/cjs/ElementAspectExportProcessor.d.ts.map +1 -0
- package/lib/cjs/ElementAspectExportProcessor.js +186 -0
- package/lib/cjs/ElementAspectExportProcessor.js.map +1 -0
- package/lib/cjs/ElementCascadingDeleter.d.ts +3 -3
- package/lib/cjs/ElementCascadingDeleter.d.ts.map +1 -1
- package/lib/cjs/ElementCascadingDeleter.js +12 -12
- package/lib/cjs/ElementCascadingDeleter.js.map +1 -1
- package/lib/cjs/EntityUnifier.d.ts +4 -8
- package/lib/cjs/EntityUnifier.d.ts.map +1 -1
- package/lib/cjs/EntityUnifier.js +6 -24
- package/lib/cjs/EntityUnifier.js.map +1 -1
- package/lib/cjs/IModelCloneContext.d.ts +6 -5
- package/lib/cjs/IModelCloneContext.d.ts.map +1 -1
- package/lib/cjs/IModelCloneContext.js +74 -57
- package/lib/cjs/IModelCloneContext.js.map +1 -1
- package/lib/cjs/IModelExporter.d.ts +80 -32
- package/lib/cjs/IModelExporter.d.ts.map +1 -1
- package/lib/cjs/IModelExporter.js +563 -188
- package/lib/cjs/IModelExporter.js.map +1 -1
- package/lib/cjs/IModelImporter.d.ts +38 -24
- package/lib/cjs/IModelImporter.d.ts.map +1 -1
- package/lib/cjs/IModelImporter.js +210 -129
- package/lib/cjs/IModelImporter.js.map +1 -1
- package/lib/cjs/IModelTransformContext.d.ts +54 -0
- package/lib/cjs/IModelTransformContext.d.ts.map +1 -0
- package/lib/cjs/IModelTransformContext.js +3 -0
- package/lib/cjs/IModelTransformContext.js.map +1 -0
- package/lib/cjs/IModelTransformer.d.ts +101 -189
- package/lib/cjs/IModelTransformer.d.ts.map +1 -1
- package/lib/cjs/IModelTransformer.js +558 -1104
- package/lib/cjs/IModelTransformer.js.map +1 -1
- package/lib/cjs/IModelTransformerError.d.ts +76 -0
- package/lib/cjs/IModelTransformerError.d.ts.map +1 -0
- package/lib/cjs/IModelTransformerError.js +85 -0
- package/lib/cjs/IModelTransformerError.js.map +1 -0
- package/lib/cjs/ProvenanceManager.d.ts +170 -0
- package/lib/cjs/ProvenanceManager.d.ts.map +1 -0
- package/lib/cjs/ProvenanceManager.js +735 -0
- package/lib/cjs/ProvenanceManager.js.map +1 -0
- package/lib/cjs/SyncTypeResolver.d.ts +34 -0
- package/lib/cjs/SyncTypeResolver.d.ts.map +1 -0
- package/lib/cjs/SyncTypeResolver.js +98 -0
- package/lib/cjs/SyncTypeResolver.js.map +1 -0
- package/lib/cjs/TransformerLoggerCategory.d.ts +1 -1
- package/lib/cjs/TransformerLoggerCategory.js +1 -1
- package/lib/cjs/TransformerLoggerCategory.js.map +1 -1
- package/lib/cjs/TransformerPackageMetadata.d.ts +8 -0
- package/lib/cjs/TransformerPackageMetadata.d.ts.map +1 -0
- package/lib/cjs/TransformerPackageMetadata.js +14 -0
- package/lib/cjs/TransformerPackageMetadata.js.map +1 -0
- package/lib/cjs/imodel-transformer.d.ts +18 -0
- package/lib/cjs/imodel-transformer.d.ts.map +1 -1
- package/lib/cjs/imodel-transformer.js +29 -33
- package/lib/cjs/imodel-transformer.js.map +1 -1
- package/package.json +27 -39
- package/lib/cjs/DetachedExportElementAspectsStrategy.d.ts +0 -16
- package/lib/cjs/DetachedExportElementAspectsStrategy.d.ts.map +0 -1
- package/lib/cjs/DetachedExportElementAspectsStrategy.js +0 -106
- package/lib/cjs/DetachedExportElementAspectsStrategy.js.map +0 -1
- package/lib/cjs/ExportElementAspectsStrategy.d.ts +0 -35
- package/lib/cjs/ExportElementAspectsStrategy.d.ts.map +0 -1
- package/lib/cjs/ExportElementAspectsStrategy.js +0 -52
- package/lib/cjs/ExportElementAspectsStrategy.js.map +0 -1
- package/lib/cjs/ExportElementAspectsWithElementsStrategy.d.ts +0 -12
- package/lib/cjs/ExportElementAspectsWithElementsStrategy.d.ts.map +0 -1
- package/lib/cjs/ExportElementAspectsWithElementsStrategy.js +0 -47
- package/lib/cjs/ExportElementAspectsWithElementsStrategy.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module iModels
|
|
3
3
|
*/
|
|
4
|
-
import { BriefcaseDb,
|
|
4
|
+
import { BriefcaseDb, ChangeInstance, Element, ElementAspect, ElementMultiAspect, ElementUniqueAspect, IModelDb, IModelJsNative, Model, Relationship, SqliteChangeOp } from "@itwin/core-backend";
|
|
5
5
|
import { Id64Arg, Id64String } from "@itwin/core-bentley";
|
|
6
|
-
import { ChangesetFileProps, CodeSpec, FontProps } from "@itwin/core-common";
|
|
6
|
+
import { ChangesetFileProps, CodeSpec, FontFamilyDescriptor, FontProps } from "@itwin/core-common";
|
|
7
7
|
import { Schema, SchemaKey } from "@itwin/ecschema-metadata";
|
|
8
|
-
import {
|
|
8
|
+
import { ElementAspectExportCoordinator } from "./ElementAspectExportCoordinator";
|
|
9
9
|
/**
|
|
10
10
|
* @beta
|
|
11
11
|
* The (optional) result of [[IModelExportHandler.onExportSchema]]
|
|
@@ -70,41 +70,41 @@ export declare abstract class IModelExportHandler {
|
|
|
70
70
|
/** If `true` is returned, then the CodeSpec will be exported.
|
|
71
71
|
* @note This method can optionally be overridden to exclude an individual CodeSpec from the export. The base implementation always returns `true`.
|
|
72
72
|
*/
|
|
73
|
-
shouldExportCodeSpec(_codeSpec: CodeSpec): boolean
|
|
73
|
+
shouldExportCodeSpec(_codeSpec: CodeSpec): Promise<boolean>;
|
|
74
74
|
/** Called when a CodeSpec should be exported.
|
|
75
75
|
* @param codeSpec The CodeSpec to export
|
|
76
76
|
* @param isUpdate If defined, then `true` indicates an UPDATE operation while `false` indicates an INSERT operation. If not defined, then INSERT vs. UPDATE is not known.
|
|
77
77
|
* @note This should be overridden to actually do the export.
|
|
78
78
|
*/
|
|
79
|
-
onExportCodeSpec(_codeSpec: CodeSpec, _isUpdate: boolean | undefined): void
|
|
79
|
+
onExportCodeSpec(_codeSpec: CodeSpec, _isUpdate: boolean | undefined): Promise<void>;
|
|
80
80
|
/** Called when a font should be exported.
|
|
81
81
|
* @param font The font to export
|
|
82
82
|
* @param isUpdate If defined, then `true` indicates an UPDATE operation while `false` indicates an INSERT operation. If not defined, then INSERT vs. UPDATE is not known.
|
|
83
83
|
* @note This should be overridden to actually do the export.
|
|
84
84
|
*/
|
|
85
|
-
onExportFont(_font: FontProps, _isUpdate: boolean | undefined): void
|
|
85
|
+
onExportFont(_font: FontProps, _isUpdate: boolean | undefined): Promise<void>;
|
|
86
86
|
/** Called when a model should be exported.
|
|
87
87
|
* @param model The model to export
|
|
88
88
|
* @param isUpdate If defined, then `true` indicates an UPDATE operation while `false` indicates an INSERT operation. If not defined, then INSERT vs. UPDATE is not known.
|
|
89
89
|
* @note This should be overridden to actually do the export.
|
|
90
90
|
*/
|
|
91
|
-
onExportModel(_model: Model, _isUpdate: boolean | undefined): void
|
|
91
|
+
onExportModel(_model: Model, _isUpdate: boolean | undefined): Promise<void>;
|
|
92
92
|
/** Called when a model should be deleted. */
|
|
93
|
-
onDeleteModel(_modelId: Id64String): void
|
|
93
|
+
onDeleteModel(_modelId: Id64String): Promise<void>;
|
|
94
94
|
/** If `true` is returned, then the element will be exported.
|
|
95
95
|
* @note This method can optionally be overridden to exclude an individual Element (and its children and ElementAspects) from the export. The base implementation always returns `true`.
|
|
96
96
|
*/
|
|
97
|
-
shouldExportElement(_element: Element): boolean
|
|
97
|
+
shouldExportElement(_element: Element): Promise<boolean>;
|
|
98
98
|
/** Called when element is skipped instead of exported.
|
|
99
99
|
* @note When an element is skipped, exporter will not export any of its child elements. Because of this, [[onSkipElement]] will not be invoked for any children of a "skipped" element.
|
|
100
100
|
*/
|
|
101
|
-
onSkipElement(_elementId: Id64String): void
|
|
101
|
+
onSkipElement(_elementId: Id64String): Promise<void>;
|
|
102
102
|
/** Called when an element should be exported.
|
|
103
103
|
* @param element The element to export
|
|
104
104
|
* @param isUpdate If defined, then `true` indicates an UPDATE operation while `false` indicates an INSERT operation. If not defined, then INSERT vs. UPDATE is not known.
|
|
105
105
|
* @note This should be overridden to actually do the export.
|
|
106
106
|
*/
|
|
107
|
-
onExportElement(_element: Element, _isUpdate: boolean | undefined): void
|
|
107
|
+
onExportElement(_element: Element, _isUpdate: boolean | undefined): Promise<void>;
|
|
108
108
|
/**
|
|
109
109
|
* Do any asynchronous actions before exporting an element
|
|
110
110
|
* @note Do not implement this handler manually, it is internal, it will be removed.
|
|
@@ -113,37 +113,37 @@ export declare abstract class IModelExportHandler {
|
|
|
113
113
|
*/
|
|
114
114
|
preExportElement(_element: Element): Promise<void>;
|
|
115
115
|
/** Called when an element should be deleted. */
|
|
116
|
-
onDeleteElement(_elementId: Id64String): void
|
|
116
|
+
onDeleteElement(_elementId: Id64String): Promise<void>;
|
|
117
117
|
/** If `true` is returned, then the ElementAspect will be exported.
|
|
118
118
|
* @note This method can optionally be overridden to exclude an individual ElementAspect from the export. The base implementation always returns `true`.
|
|
119
119
|
*/
|
|
120
|
-
shouldExportElementAspect(_aspect: ElementAspect): boolean
|
|
120
|
+
shouldExportElementAspect(_aspect: ElementAspect): Promise<boolean>;
|
|
121
121
|
/** Called when an ElementUniqueAspect should be exported.
|
|
122
122
|
* @param aspect The ElementUniqueAspect to export
|
|
123
123
|
* @param isUpdate If defined, then `true` indicates an UPDATE operation while `false` indicates an INSERT operation. If not defined, then INSERT vs. UPDATE is not known.
|
|
124
124
|
* @note This should be overridden to actually do the export.
|
|
125
125
|
*/
|
|
126
|
-
onExportElementUniqueAspect(_aspect: ElementUniqueAspect, _isUpdate: boolean | undefined): void
|
|
126
|
+
onExportElementUniqueAspect(_aspect: ElementUniqueAspect, _isUpdate: boolean | undefined): Promise<void>;
|
|
127
127
|
/** Called when ElementMultiAspects should be exported.
|
|
128
128
|
* @note This should be overridden to actually do the export.
|
|
129
129
|
*/
|
|
130
|
-
onExportElementMultiAspects(_aspects: ElementMultiAspect[]): void
|
|
130
|
+
onExportElementMultiAspects(_aspects: ElementMultiAspect[]): Promise<void>;
|
|
131
131
|
/** If `true` is returned, then the relationship will be exported.
|
|
132
132
|
* @note This method can optionally be overridden to exclude an individual CodeSpec from the export. The base implementation always returns `true`.
|
|
133
133
|
*/
|
|
134
|
-
shouldExportRelationship(_relationship: Relationship): boolean
|
|
134
|
+
shouldExportRelationship(_relationship: Relationship): Promise<boolean>;
|
|
135
135
|
/** Called when a Relationship should be exported.
|
|
136
136
|
* @param relationship The Relationship to export
|
|
137
137
|
* @param isUpdate If defined, then `true` indicates an UPDATE operation while `false` indicates an INSERT operation. If not defined, then INSERT vs. UPDATE is not known.
|
|
138
138
|
* @note This should be overridden to actually do the export.
|
|
139
139
|
*/
|
|
140
|
-
onExportRelationship(_relationship: Relationship, _isUpdate: boolean | undefined): void
|
|
140
|
+
onExportRelationship(_relationship: Relationship, _isUpdate: boolean | undefined): Promise<void>;
|
|
141
141
|
/** Called when a relationship should be deleted. */
|
|
142
|
-
onDeleteRelationship(_relInstanceId: Id64String): void
|
|
142
|
+
onDeleteRelationship(_relInstanceId: Id64String): Promise<void>;
|
|
143
143
|
/** If `true` is returned, then the schema will be exported.
|
|
144
144
|
* @note This method can optionally be overridden to exclude an individual schema from the export. The base implementation always returns `true`.
|
|
145
145
|
*/
|
|
146
|
-
shouldExportSchema(_schemaKey: SchemaKey): boolean
|
|
146
|
+
shouldExportSchema(_schemaKey: SchemaKey): Promise<boolean>;
|
|
147
147
|
/** Called when a schema should be exported.
|
|
148
148
|
* @param schema The schema to export
|
|
149
149
|
* @note This should be overridden to actually do the export.
|
|
@@ -159,10 +159,14 @@ export declare abstract class IModelExportHandler {
|
|
|
159
159
|
}
|
|
160
160
|
/** Base class for exporting data from an iModel.
|
|
161
161
|
* @note Most uses cases will not require a custom subclass of `IModelExporter`. Instead, it is more typical to subclass/customize [IModelExportHandler]($transformer).
|
|
162
|
+
* ElementAspects are exported separately from element callbacks in bounded,
|
|
163
|
+
* owner-scoped groups. Aspect callbacks are not guaranteed to be adjacent to
|
|
164
|
+
* callbacks for their owners.
|
|
162
165
|
* @see [iModel Transformation and Data Exchange]($docs/learning/transformer/index.md), [[registerHandler]], [IModelTransformer]($transformer), [IModelImporter]($transformer)
|
|
163
166
|
* @beta
|
|
164
167
|
*/
|
|
165
168
|
export declare class IModelExporter {
|
|
169
|
+
private static readonly _elementAspectOwnerBatchSize;
|
|
166
170
|
/** The read-only source iModel. */
|
|
167
171
|
readonly sourceDb: IModelDb;
|
|
168
172
|
/** A flag that indicates whether element GeometryStreams are loaded or not.
|
|
@@ -215,13 +219,22 @@ export declare class IModelExporter {
|
|
|
215
219
|
private _excludedElementClasses;
|
|
216
220
|
/** The set of classes of Relationships that will be excluded (polymorphically) from transformation to the target iModel. */
|
|
217
221
|
private _excludedRelationshipClasses;
|
|
218
|
-
/**
|
|
219
|
-
private
|
|
222
|
+
/** Exports ElementAspects for accepted owner groups. */
|
|
223
|
+
private _elementAspectExportProcessor;
|
|
224
|
+
/** Coordinates accepted-owner scopes and bounded group processing. */
|
|
225
|
+
private readonly _elementAspectExportCoordinator;
|
|
226
|
+
/** Coordinates accepted ElementAspect owners and bounded group processing.
|
|
227
|
+
* @internal
|
|
228
|
+
*/
|
|
229
|
+
get elementAspectExportCoordinator(): ElementAspectExportCoordinator;
|
|
230
|
+
/** Whether change traversal skips root-owned entities. */
|
|
231
|
+
private _skipPropagateChangesToRootElements;
|
|
232
|
+
private readonly _rootElementIds;
|
|
220
233
|
/** Construct a new IModelExporter
|
|
221
234
|
* @param sourceDb The source IModelDb
|
|
222
235
|
* @see registerHandler
|
|
223
236
|
*/
|
|
224
|
-
constructor(sourceDb: IModelDb
|
|
237
|
+
constructor(sourceDb: IModelDb);
|
|
225
238
|
/**
|
|
226
239
|
* Initialize prerequisites of exporting. This is implicitly done by any `export*` calls that need initialization
|
|
227
240
|
* which is currently just `exportChanges`.
|
|
@@ -250,6 +263,7 @@ export declare class IModelExporter {
|
|
|
250
263
|
exportAll(): Promise<void>;
|
|
251
264
|
/** Export changes from the source iModel.
|
|
252
265
|
* Inserts, updates, and deletes are determined by inspecting the changeset(s).
|
|
266
|
+
* @throws [[ITwinError]] with scope `@itwin/imodel-transformer` and key `no-changesets` if the source iModel has no changesets and no custom changes. Call [[exportAll]] to export all content.
|
|
253
267
|
* @note To form a range of versions to process, set `startChangesetId` for the start (inclusive) of the desired
|
|
254
268
|
* range and open the source iModel as of the end (inclusive) of the desired range.
|
|
255
269
|
* @note the changedInstanceIds are just for this call to exportChanges, so you must continue to pass it in
|
|
@@ -280,9 +294,18 @@ export declare class IModelExporter {
|
|
|
280
294
|
*/
|
|
281
295
|
exportFonts(): Promise<void>;
|
|
282
296
|
/** Export a single font from the source iModel.
|
|
283
|
-
* @note
|
|
297
|
+
* @note multiple fonts can have the same font name, if a font with a specific type is needed use exportFontByFontFamilyDescriptor.
|
|
298
|
+
* If not this will only export the first font with this type in the db.
|
|
284
299
|
*/
|
|
285
300
|
exportFontByName(fontName: string): Promise<void>;
|
|
301
|
+
/** Export a single font from the source iModel.
|
|
302
|
+
* @note This method is called from [[exportChanges]] and [[exportAll]], so it only needs to be called directly when exporting a subset of an iModel.
|
|
303
|
+
*/
|
|
304
|
+
exportFontByFontProps(fontProps: FontProps): Promise<void>;
|
|
305
|
+
/** Export a single font from the source iModel.
|
|
306
|
+
* @note This method is called from [[exportChanges]] and [[exportAll]], so it only needs to be called directly when exporting a subset of an iModel.
|
|
307
|
+
*/
|
|
308
|
+
exportFontByFontFamilyDescriptor(fontFamily: FontFamilyDescriptor): Promise<void>;
|
|
286
309
|
/** Export a single font from the source iModel.
|
|
287
310
|
* @note This method is called from [[exportChanges]] and [[exportAll]], so it only needs to be called directly when exporting a subset of an iModel.
|
|
288
311
|
*/
|
|
@@ -291,6 +314,7 @@ export declare class IModelExporter {
|
|
|
291
314
|
* @note This method is called from [[exportChanges]] and [[exportAll]], so it only needs to be called directly when exporting a subset of an iModel.
|
|
292
315
|
*/
|
|
293
316
|
exportModel(modeledElementId: Id64String): Promise<void>;
|
|
317
|
+
private exportModelImpl;
|
|
294
318
|
/** Export the model (the container only) from the source iModel. */
|
|
295
319
|
private exportModelContainer;
|
|
296
320
|
private _yieldManager;
|
|
@@ -301,26 +325,41 @@ export declare class IModelExporter {
|
|
|
301
325
|
* @note This method is called from [[exportChanges]] and [[exportAll]], so it only needs to be called directly when exporting a subset of an iModel.
|
|
302
326
|
*/
|
|
303
327
|
exportModelContents(modelId: Id64String, elementClassFullName?: string, skipRootSubject?: boolean): Promise<void>;
|
|
328
|
+
private exportModelContentsImpl;
|
|
304
329
|
/** Export the sub-models directly below the specified model.
|
|
305
330
|
* @note This method is called from [[exportChanges]] and [[exportAll]], so it only needs to be called directly when exporting a subset of an iModel.
|
|
306
331
|
*/
|
|
307
332
|
exportSubModels(parentModelId: Id64String): Promise<void>;
|
|
333
|
+
private exportSubModelsImpl;
|
|
308
334
|
/** Returns true if the specified element should be exported.
|
|
309
335
|
* This considers the standard IModelExporter exclusion rules plus calls [IModelExportHandler.shouldExportElement]($transformer) for any custom exclusion rules.
|
|
310
336
|
* @note This method is called from within [[exportChanges]] and [[exportAll]], so usually does not need to be called directly.
|
|
311
337
|
*/
|
|
312
|
-
shouldExportElement(element: Element): boolean
|
|
313
|
-
/** Export the specified element
|
|
338
|
+
shouldExportElement(element: Element): Promise<boolean>;
|
|
339
|
+
/** Export the specified element and its child elements (if applicable).
|
|
314
340
|
* @note This method is called from [[exportChanges]] and [[exportAll]], so it only needs to be called directly when exporting a subset of an iModel.
|
|
341
|
+
* @note ElementAspects are exported separately in owner-scoped groups, so their callbacks are not guaranteed to follow this element callback.
|
|
315
342
|
*/
|
|
316
343
|
exportElement(elementId: Id64String): Promise<void>;
|
|
344
|
+
private exportElementImpl;
|
|
317
345
|
/** Export the child elements of the specified element from the source iModel.
|
|
318
346
|
* @note This method is called from [[exportChanges]] and [[exportAll]], so it only needs to be called directly when exporting a subset of an iModel.
|
|
319
347
|
*/
|
|
320
348
|
exportChildElements(elementId: Id64String): Promise<void>;
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
private
|
|
349
|
+
private exportChildElementsImpl;
|
|
350
|
+
/** Exports all aspects owned by the supplied elements. */
|
|
351
|
+
private exportAspectsForOwners;
|
|
352
|
+
private filterOwnerElementIdsForAspectExport;
|
|
353
|
+
private shouldExportElementHierarchyForAspect;
|
|
354
|
+
private shouldExportModelForAspect;
|
|
355
|
+
private runScopedElementExport;
|
|
356
|
+
/** Apply the element export filter when deciding whether to process an aspect owner. @internal */
|
|
357
|
+
private shouldExportElementForAspect;
|
|
358
|
+
private shouldExportElementFact;
|
|
359
|
+
private queryAspectElementHierarchyFacts;
|
|
360
|
+
private queryAspectElementFacts;
|
|
361
|
+
private queryAspectModelHierarchyFacts;
|
|
362
|
+
private getAspectOwnerIdBatches;
|
|
324
363
|
/** Exports all relationships that subclass from the specified base class.
|
|
325
364
|
* @note This method is called from [[exportChanges]] and [[exportAll]], so it only needs to be called directly when exporting a subset of an iModel.
|
|
326
365
|
*/
|
|
@@ -369,6 +408,11 @@ export declare class ChangedInstanceIds {
|
|
|
369
408
|
private _aspectSubclassIds?;
|
|
370
409
|
private _relationshipSubclassIds?;
|
|
371
410
|
private _relationshipSubclassIdsToSkip?;
|
|
411
|
+
private readonly _aspectOwnerElementIds;
|
|
412
|
+
/** Element IDs that own the aspects represented by `aspect` changes.
|
|
413
|
+
* @internal
|
|
414
|
+
*/
|
|
415
|
+
get aspectOwnerElementIds(): ReadonlySet<Id64String>;
|
|
372
416
|
private _db;
|
|
373
417
|
constructor(db: IModelDb);
|
|
374
418
|
private setupECClassIds;
|
|
@@ -383,12 +427,13 @@ export declare class ChangedInstanceIds {
|
|
|
383
427
|
*/
|
|
384
428
|
get hasChanges(): boolean;
|
|
385
429
|
/**
|
|
386
|
-
* Adds the provided [[
|
|
430
|
+
* Adds the provided [[ChangeInstance]] to the appropriate set of changes by class type (codeSpec, model, element, aspect, or relationship) maintained by this instance of ChangedInstanceIds.
|
|
387
431
|
* If the same ECInstanceId is seen multiple times, the changedInstanceIds will be modified accordingly, i.e. if an id 'x' was updated but now we see 'x' was deleted, we will remove 'x'
|
|
388
432
|
* from the set of updatedIds and add it to the set of deletedIds for the appropriate class type.
|
|
389
|
-
* @param change
|
|
433
|
+
* @param change Changed EC instance with the ID, operation, and EC class ID of the changed entity.
|
|
390
434
|
*/
|
|
391
|
-
addChange(change:
|
|
435
|
+
addChange(change: ChangeInstance): Promise<void>;
|
|
436
|
+
private tryGetAspectOwnerElementId;
|
|
392
437
|
/**
|
|
393
438
|
* This method should only be called inside [[IModelTransformer.addCustomChanges]].
|
|
394
439
|
* It adds the provided change to the element changes maintained by this instance of ChangedInstanceIds.
|
|
@@ -420,10 +465,13 @@ export declare class ChangedInstanceIds {
|
|
|
420
465
|
* If the same ECInstanceId is seen multiple times, the changedInstanceIds will be modified accordingly, i.e. if an id 'x' was updated but now we see 'x' was deleted, we will remove 'x'
|
|
421
466
|
* from the set of updatedIds and add it to the set of deletedIds for the appropriate class type.
|
|
422
467
|
* @note It is the responsibility of the caller to ensure that the provided id is, in fact an aspect.
|
|
468
|
+
* @param elementIds Owning element IDs. Required when `changeType` is
|
|
469
|
+
* `Deleted` or the source aspect row is unavailable.
|
|
423
470
|
* @note In most cases, this method does not need to be called. Its only for consumers to mimic changes as if they were found in a changeset, which should only be useful in certain cases such as the changing of filter criteria for a preexisting master branch relationship.
|
|
424
471
|
* @beta
|
|
425
472
|
*/
|
|
426
|
-
addCustomAspectChange(changeType: SqliteChangeOp, ids: Id64Arg): void;
|
|
473
|
+
addCustomAspectChange(changeType: SqliteChangeOp, ids: Id64Arg, elementIds?: Id64Arg): void;
|
|
474
|
+
private recordCustomAspectChange;
|
|
427
475
|
/**
|
|
428
476
|
* There is an optimization in [IModelExporter.exportModelContents] which doesn't try to export elements within a model unless the model itself is marked as `Updated` or 'Inserted' in sourceDbChanges. This method is used in [[addCustomElementChange]] and [[addCustomModelChange]] to add the parent model hierarchy to the 'updatedIds' so that the custom element changes are exported.
|
|
429
477
|
* Transformer will insert 'Updated' model to target if it does not exist there already. To handle such case, modeled elements of parent models are also marked as updated. This is done, because model can not be inserted without it's modeled element.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelExporter.d.ts","sourceRoot":"","sources":["../../src/IModelExporter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,WAAW,EAEX,
|
|
1
|
+
{"version":3,"file":"IModelExporter.d.ts","sourceRoot":"","sources":["../../src/IModelExporter.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,WAAW,EAEX,cAAc,EAGd,OAAO,EACP,aAAa,EACb,kBAAkB,EAElB,mBAAmB,EAEnB,QAAQ,EACR,cAAc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