@itwin/imodel-transformer 2.0.0-dev.50 → 2.0.0-dev.51

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.
@@ -20,6 +20,8 @@ export declare enum IModelTransformerError {
20
20
  DependencyVersionMismatch = "dependency-version-mismatch",
21
21
  /** A required edit transaction is not active. */
22
22
  EditTxnNotActive = "edit-txn-not-active",
23
+ /** Native bulk deletion failed for one or more requested element trees. */
24
+ ElementBulkDeleteFailed = "element-bulk-delete-failed",
23
25
  /** An element identifier cannot be preserved in the target. */
24
26
  ElementIdNotPreservable = "element-id-not-preservable",
25
27
  /** A required element identifier was not provided. */
@@ -1 +1 @@
1
- {"version":3,"file":"IModelTransformerError.d.ts","sourceRoot":"","sources":["../../src/IModelTransformerError.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,eAAO,MAAM,2BAA2B,8BAA8B,CAAC;AAEvE;;GAEG;AACH,oBAAY,sBAAsB;IAChC,sEAAsE;IACtE,mBAAmB,0BAA0B;IAC7C,qDAAqD;IACrD,8BAA8B,sCAAsC;IACpE,iDAAiD;IACjD,yBAAyB,gCAAgC;IACzD,oFAAoF;IACpF,iBAAiB,uBAAuB;IACxC,mDAAmD;IACnD,wBAAwB,+BAA+B;IACvD,iEAAiE;IACjE,yBAAyB,gCAAgC;IACzD,iDAAiD;IACjD,gBAAgB,wBAAwB;IACxC,+DAA+D;IAC/D,uBAAuB,+BAA+B;IACtD,sDAAsD;IACtD,iBAAiB,wBAAwB;IACzC,qDAAqD;IACrD,8BAA8B,sCAAsC;IACpE,6CAA6C;IAC7C,0BAA0B,kCAAkC;IAC5D,8DAA8D;IAC9D,qCAAqC,6CAA6C;IAClF,wEAAwE;IACxE,kCAAkC,0CAA0C;IAC5E,uFAAuF;IACvF,sBAAsB,4BAA4B;IAClD,sEAAsE;IACtE,sBAAsB,6BAA6B;IACnD,uCAAuC;IACvC,WAAW,iBAAiB;IAC5B,6DAA6D;IAC7D,sBAAsB,6BAA6B;IACnD,6DAA6D;IAC7D,uBAAuB,8BAA8B;IACrD,gDAAgD;IAChD,cAAc,qBAAqB;IACnC,8CAA8C;IAC9C,kBAAkB,wBAAwB;IAC1C,6DAA6D;IAC7D,YAAY,kBAAkB;IAC9B,gDAAgD;IAChD,mBAAmB,0BAA0B;IAC7C,6DAA6D;IAC7D,uBAAuB,8BAA8B;IACrD,oEAAoE;IACpE,2BAA2B,kCAAkC;IAC7D,+CAA+C;IAC/C,yBAAyB,iCAAiC;IAC1D,2DAA2D;IAC3D,sBAAsB,6BAA6B;IACnD,kDAAkD;IAClD,8BAA8B,sCAAsC;IACpE,qDAAqD;IACrD,yBAAyB,iCAAiC;IAC1D,6EAA6E;IAC7E,cAAc,oBAAoB;IAClC,2DAA2D;IAC3D,qBAAqB,4BAA4B;IACjD,6CAA6C;IAC7C,gBAAgB,uBAAuB;IACvC,kEAAkE;IAClE,qBAAqB,6BAA6B;IAClD,sDAAsD;IACtD,2BAA2B,kCAAkC;IAC7D,0DAA0D;IAC1D,gCAAgC,wCAAwC;IACxE,uDAAuD;IACvD,6BAA6B,oCAAoC;IACjE,yDAAyD;IACzD,mBAAmB,2BAA2B;CAC/C"}
1
+ {"version":3,"file":"IModelTransformerError.d.ts","sourceRoot":"","sources":["../../src/IModelTransformerError.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,eAAO,MAAM,2BAA2B,8BAA8B,CAAC;AAEvE;;GAEG;AACH,oBAAY,sBAAsB;IAChC,sEAAsE;IACtE,mBAAmB,0BAA0B;IAC7C,qDAAqD;IACrD,8BAA8B,sCAAsC;IACpE,iDAAiD;IACjD,yBAAyB,gCAAgC;IACzD,oFAAoF;IACpF,iBAAiB,uBAAuB;IACxC,mDAAmD;IACnD,wBAAwB,+BAA+B;IACvD,iEAAiE;IACjE,yBAAyB,gCAAgC;IACzD,iDAAiD;IACjD,gBAAgB,wBAAwB;IACxC,2EAA2E;IAC3E,uBAAuB,+BAA+B;IACtD,+DAA+D;IAC/D,uBAAuB,+BAA+B;IACtD,sDAAsD;IACtD,iBAAiB,wBAAwB;IACzC,qDAAqD;IACrD,8BAA8B,sCAAsC;IACpE,6CAA6C;IAC7C,0BAA0B,kCAAkC;IAC5D,8DAA8D;IAC9D,qCAAqC,6CAA6C;IAClF,wEAAwE;IACxE,kCAAkC,0CAA0C;IAC5E,uFAAuF;IACvF,sBAAsB,4BAA4B;IAClD,sEAAsE;IACtE,sBAAsB,6BAA6B;IACnD,uCAAuC;IACvC,WAAW,iBAAiB;IAC5B,6DAA6D;IAC7D,sBAAsB,6BAA6B;IACnD,6DAA6D;IAC7D,uBAAuB,8BAA8B;IACrD,gDAAgD;IAChD,cAAc,qBAAqB;IACnC,8CAA8C;IAC9C,kBAAkB,wBAAwB;IAC1C,6DAA6D;IAC7D,YAAY,kBAAkB;IAC9B,gDAAgD;IAChD,mBAAmB,0BAA0B;IAC7C,6DAA6D;IAC7D,uBAAuB,8BAA8B;IACrD,oEAAoE;IACpE,2BAA2B,kCAAkC;IAC7D,+CAA+C;IAC/C,yBAAyB,iCAAiC;IAC1D,2DAA2D;IAC3D,sBAAsB,6BAA6B;IACnD,kDAAkD;IAClD,8BAA8B,sCAAsC;IACpE,qDAAqD;IACrD,yBAAyB,iCAAiC;IAC1D,6EAA6E;IAC7E,cAAc,oBAAoB;IAClC,2DAA2D;IAC3D,qBAAqB,4BAA4B;IACjD,6CAA6C;IAC7C,gBAAgB,uBAAuB;IACvC,kEAAkE;IAClE,qBAAqB,6BAA6B;IAClD,sDAAsD;IACtD,2BAA2B,kCAAkC;IAC7D,0DAA0D;IAC1D,gCAAgC,wCAAwC;IACxE,uDAAuD;IACvD,6BAA6B,oCAAoC;IACjE,yDAAyD;IACzD,mBAAmB,2BAA2B;CAC/C"}
@@ -29,6 +29,8 @@ var IModelTransformerError;
29
29
  IModelTransformerError["DependencyVersionMismatch"] = "dependency-version-mismatch";
30
30
  /** A required edit transaction is not active. */
31
31
  IModelTransformerError["EditTxnNotActive"] = "edit-txn-not-active";
32
+ /** Native bulk deletion failed for one or more requested element trees. */
33
+ IModelTransformerError["ElementBulkDeleteFailed"] = "element-bulk-delete-failed";
32
34
  /** An element identifier cannot be preserved in the target. */
33
35
  IModelTransformerError["ElementIdNotPreservable"] = "element-id-not-preservable";
34
36
  /** A required element identifier was not provided. */
@@ -1 +1 @@
1
- {"version":3,"file":"IModelTransformerError.js","sourceRoot":"","sources":["../../src/IModelTransformerError.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG;;GAEG;AACH,gEAAgE;AACnD,QAAA,2BAA2B,GAAG,2BAA2B,CAAC;AAEvE;;GAEG;AACH,IAAY,sBAyEX;AAzED,WAAY,sBAAsB;IAChC,sEAAsE;IACtE,uEAA6C,CAAA;IAC7C,qDAAqD;IACrD,8FAAoE,CAAA;IACpE,iDAAiD;IACjD,mFAAyD,CAAA;IACzD,oFAAoF;IACpF,kEAAwC,CAAA;IACxC,mDAAmD;IACnD,iFAAuD,CAAA;IACvD,iEAAiE;IACjE,mFAAyD,CAAA;IACzD,iDAAiD;IACjD,kEAAwC,CAAA;IACxC,+DAA+D;IAC/D,gFAAsD,CAAA;IACtD,sDAAsD;IACtD,mEAAyC,CAAA;IACzC,qDAAqD;IACrD,8FAAoE,CAAA;IACpE,6CAA6C;IAC7C,sFAA4D,CAAA;IAC5D,8DAA8D;IAC9D,4GAAkF,CAAA;IAClF,wEAAwE;IACxE,sGAA4E,CAAA;IAC5E,uFAAuF;IACvF,4EAAkD,CAAA;IAClD,sEAAsE;IACtE,6EAAmD,CAAA;IACnD,uCAAuC;IACvC,sDAA4B,CAAA;IAC5B,6DAA6D;IAC7D,6EAAmD,CAAA;IACnD,6DAA6D;IAC7D,+EAAqD,CAAA;IACrD,gDAAgD;IAChD,6DAAmC,CAAA;IACnC,8CAA8C;IAC9C,oEAA0C,CAAA;IAC1C,6DAA6D;IAC7D,wDAA8B,CAAA;IAC9B,gDAAgD;IAChD,uEAA6C,CAAA;IAC7C,6DAA6D;IAC7D,+EAAqD,CAAA;IACrD,oEAAoE;IACpE,uFAA6D,CAAA;IAC7D,+CAA+C;IAC/C,oFAA0D,CAAA;IAC1D,2DAA2D;IAC3D,6EAAmD,CAAA;IACnD,kDAAkD;IAClD,8FAAoE,CAAA;IACpE,qDAAqD;IACrD,oFAA0D,CAAA;IAC1D,6EAA6E;IAC7E,4DAAkC,CAAA;IAClC,2DAA2D;IAC3D,2EAAiD,CAAA;IACjD,6CAA6C;IAC7C,iEAAuC,CAAA;IACvC,kEAAkE;IAClE,4EAAkD,CAAA;IAClD,sDAAsD;IACtD,uFAA6D,CAAA;IAC7D,0DAA0D;IAC1D,kGAAwE,CAAA;IACxE,uDAAuD;IACvD,2FAAiE,CAAA;IACjE,yDAAyD;IACzD,wEAA8C,CAAA;AAChD,CAAC,EAzEW,sBAAsB,aAAtB,sBAAsB,GAAtB,sBAAsB,QAyEjC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/** Scope shared by errors originating from `@itwin/imodel-transformer`.\n * @beta\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const IModelTransformerErrorScope = \"@itwin/imodel-transformer\";\n\n/** Errors originating from `@itwin/imodel-transformer`.\n * @beta\n */\nexport enum IModelTransformerError {\n /** An ElementAspect change requires its owning element identifier. */\n AspectOwnerRequired = \"aspect-owner-required\",\n /** Required changed-instance metadata is missing. */\n ChangedInstanceMetadataMissing = \"changed-instance-metadata-missing\",\n /** A required changeset index is unavailable. */\n ChangesetIndexUnavailable = \"changeset-index-unavailable\",\n /** A source entity contains a dangling reference rejected by transformer policy. */\n DanglingReference = \"dangling-reference\",\n /** A required dependency has no target mapping. */\n DependencyMappingMissing = \"dependency-mapping-missing\",\n /** The installed iTwin.js dependency version is incompatible. */\n DependencyVersionMismatch = \"dependency-version-mismatch\",\n /** A required edit transaction is not active. */\n EditTxnNotActive = \"edit-txn-not-active\",\n /** An element identifier cannot be preserved in the target. */\n ElementIdNotPreservable = \"element-id-not-preservable\",\n /** A required element identifier was not provided. */\n ElementIdRequired = \"element-id-required\",\n /** Exporting changes requires a briefcase iModel. */\n ExportChangesRequiresBriefcase = \"export-changes-requires-briefcase\",\n /** No export handler has been registered. */\n ExportHandlerNotRegistered = \"export-handler-not-registered\",\n /** A required geographic coordinate system is unavailable. */\n GeographicCoordinateSystemUnavailable = \"geographic-coordinate-system-unavailable\",\n /** Source and target geographic coordinate systems are incompatible. */\n GeographicCoordinateSystemMismatch = \"geographic-coordinate-system-mismatch\",\n /** Required geolocation data or an invertible geolocation transform is unavailable. */\n GeolocationUnavailable = \"geolocation-unavailable\",\n /** A custom importer option conflicts with the transformer option. */\n ImporterOptionMismatch = \"importer-option-mismatch\",\n /** A code is invalid or incomplete. */\n InvalidCode = \"invalid-code\",\n /** An entity reference has an unsupported representation. */\n InvalidEntityReference = \"invalid-entity-reference\",\n /** A relationship query returned malformed instance data. */\n InvalidRelationshipData = \"invalid-relationship-data\",\n /** A model identifier is invalid or missing. */\n InvalidModelId = \"invalid-model-id\",\n /** A subcategory is invalid or incomplete. */\n InvalidSubCategory = \"invalid-subcategory\",\n /** The source iModel has no changesets or custom changes. */\n NoChangesets = \"no-changesets\",\n /** A required parent model was not provided. */\n ParentModelRequired = \"parent-model-required\",\n /** A provenance scope conflicts with existing provenance. */\n ProvenanceScopeConflict = \"provenance-scope-conflict\",\n /** The BisCore schema does not support required provenance data. */\n ProvenanceSchemaUnsupported = \"provenance-schema-unsupported\",\n /** A required relationship class is absent. */\n RelationshipClassNotFound = \"relationship-class-not-found\",\n /** A required relationship identifier was not provided. */\n RelationshipIdRequired = \"relationship-id-required\",\n /** Expected relationship provenance is absent. */\n RelationshipProvenanceNotFound = \"relationship-provenance-not-found\",\n /** The root subject cannot be processed directly. */\n RootSubjectNotProcessable = \"root-subject-not-processable\",\n /** A schema conflict or incompatible schema version prevented processing. */\n SchemaConflict = \"schema-conflict\",\n /** The source schema dependency graph contains a cycle. */\n SchemaDependencyCycle = \"schema-dependency-cycle\",\n /** A required schema could not be loaded. */\n SchemaLoadFailed = \"schema-load-failed\",\n /** Reverse synchronization requires a source edit transaction. */\n SourceEditTxnRequired = \"source-edit-txn-required\",\n /** The requested synchronization range is invalid. */\n SynchronizationRangeInvalid = \"synchronization-range-invalid\",\n /** The synchronization direction cannot be determined. */\n SynchronizationTypeNotDetermined = \"synchronization-type-not-determined\",\n /** The previous synchronization version is missing. */\n SynchronizationVersionMissing = \"synchronization-version-missing\",\n /** A required class is absent from the target iModel. */\n TargetClassNotFound = \"target-class-not-found\",\n}\n"]}
1
+ {"version":3,"file":"IModelTransformerError.js","sourceRoot":"","sources":["../../src/IModelTransformerError.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAEhG;;GAEG;AACH,gEAAgE;AACnD,QAAA,2BAA2B,GAAG,2BAA2B,CAAC;AAEvE;;GAEG;AACH,IAAY,sBA2EX;AA3ED,WAAY,sBAAsB;IAChC,sEAAsE;IACtE,uEAA6C,CAAA;IAC7C,qDAAqD;IACrD,8FAAoE,CAAA;IACpE,iDAAiD;IACjD,mFAAyD,CAAA;IACzD,oFAAoF;IACpF,kEAAwC,CAAA;IACxC,mDAAmD;IACnD,iFAAuD,CAAA;IACvD,iEAAiE;IACjE,mFAAyD,CAAA;IACzD,iDAAiD;IACjD,kEAAwC,CAAA;IACxC,2EAA2E;IAC3E,gFAAsD,CAAA;IACtD,+DAA+D;IAC/D,gFAAsD,CAAA;IACtD,sDAAsD;IACtD,mEAAyC,CAAA;IACzC,qDAAqD;IACrD,8FAAoE,CAAA;IACpE,6CAA6C;IAC7C,sFAA4D,CAAA;IAC5D,8DAA8D;IAC9D,4GAAkF,CAAA;IAClF,wEAAwE;IACxE,sGAA4E,CAAA;IAC5E,uFAAuF;IACvF,4EAAkD,CAAA;IAClD,sEAAsE;IACtE,6EAAmD,CAAA;IACnD,uCAAuC;IACvC,sDAA4B,CAAA;IAC5B,6DAA6D;IAC7D,6EAAmD,CAAA;IACnD,6DAA6D;IAC7D,+EAAqD,CAAA;IACrD,gDAAgD;IAChD,6DAAmC,CAAA;IACnC,8CAA8C;IAC9C,oEAA0C,CAAA;IAC1C,6DAA6D;IAC7D,wDAA8B,CAAA;IAC9B,gDAAgD;IAChD,uEAA6C,CAAA;IAC7C,6DAA6D;IAC7D,+EAAqD,CAAA;IACrD,oEAAoE;IACpE,uFAA6D,CAAA;IAC7D,+CAA+C;IAC/C,oFAA0D,CAAA;IAC1D,2DAA2D;IAC3D,6EAAmD,CAAA;IACnD,kDAAkD;IAClD,8FAAoE,CAAA;IACpE,qDAAqD;IACrD,oFAA0D,CAAA;IAC1D,6EAA6E;IAC7E,4DAAkC,CAAA;IAClC,2DAA2D;IAC3D,2EAAiD,CAAA;IACjD,6CAA6C;IAC7C,iEAAuC,CAAA;IACvC,kEAAkE;IAClE,4EAAkD,CAAA;IAClD,sDAAsD;IACtD,uFAA6D,CAAA;IAC7D,0DAA0D;IAC1D,kGAAwE,CAAA;IACxE,uDAAuD;IACvD,2FAAiE,CAAA;IACjE,yDAAyD;IACzD,wEAA8C,CAAA;AAChD,CAAC,EA3EW,sBAAsB,aAAtB,sBAAsB,GAAtB,sBAAsB,QA2EjC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/** Scope shared by errors originating from `@itwin/imodel-transformer`.\n * @beta\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const IModelTransformerErrorScope = \"@itwin/imodel-transformer\";\n\n/** Errors originating from `@itwin/imodel-transformer`.\n * @beta\n */\nexport enum IModelTransformerError {\n /** An ElementAspect change requires its owning element identifier. */\n AspectOwnerRequired = \"aspect-owner-required\",\n /** Required changed-instance metadata is missing. */\n ChangedInstanceMetadataMissing = \"changed-instance-metadata-missing\",\n /** A required changeset index is unavailable. */\n ChangesetIndexUnavailable = \"changeset-index-unavailable\",\n /** A source entity contains a dangling reference rejected by transformer policy. */\n DanglingReference = \"dangling-reference\",\n /** A required dependency has no target mapping. */\n DependencyMappingMissing = \"dependency-mapping-missing\",\n /** The installed iTwin.js dependency version is incompatible. */\n DependencyVersionMismatch = \"dependency-version-mismatch\",\n /** A required edit transaction is not active. */\n EditTxnNotActive = \"edit-txn-not-active\",\n /** Native bulk deletion failed for one or more requested element trees. */\n ElementBulkDeleteFailed = \"element-bulk-delete-failed\",\n /** An element identifier cannot be preserved in the target. */\n ElementIdNotPreservable = \"element-id-not-preservable\",\n /** A required element identifier was not provided. */\n ElementIdRequired = \"element-id-required\",\n /** Exporting changes requires a briefcase iModel. */\n ExportChangesRequiresBriefcase = \"export-changes-requires-briefcase\",\n /** No export handler has been registered. */\n ExportHandlerNotRegistered = \"export-handler-not-registered\",\n /** A required geographic coordinate system is unavailable. */\n GeographicCoordinateSystemUnavailable = \"geographic-coordinate-system-unavailable\",\n /** Source and target geographic coordinate systems are incompatible. */\n GeographicCoordinateSystemMismatch = \"geographic-coordinate-system-mismatch\",\n /** Required geolocation data or an invertible geolocation transform is unavailable. */\n GeolocationUnavailable = \"geolocation-unavailable\",\n /** A custom importer option conflicts with the transformer option. */\n ImporterOptionMismatch = \"importer-option-mismatch\",\n /** A code is invalid or incomplete. */\n InvalidCode = \"invalid-code\",\n /** An entity reference has an unsupported representation. */\n InvalidEntityReference = \"invalid-entity-reference\",\n /** A relationship query returned malformed instance data. */\n InvalidRelationshipData = \"invalid-relationship-data\",\n /** A model identifier is invalid or missing. */\n InvalidModelId = \"invalid-model-id\",\n /** A subcategory is invalid or incomplete. */\n InvalidSubCategory = \"invalid-subcategory\",\n /** The source iModel has no changesets or custom changes. */\n NoChangesets = \"no-changesets\",\n /** A required parent model was not provided. */\n ParentModelRequired = \"parent-model-required\",\n /** A provenance scope conflicts with existing provenance. */\n ProvenanceScopeConflict = \"provenance-scope-conflict\",\n /** The BisCore schema does not support required provenance data. */\n ProvenanceSchemaUnsupported = \"provenance-schema-unsupported\",\n /** A required relationship class is absent. */\n RelationshipClassNotFound = \"relationship-class-not-found\",\n /** A required relationship identifier was not provided. */\n RelationshipIdRequired = \"relationship-id-required\",\n /** Expected relationship provenance is absent. */\n RelationshipProvenanceNotFound = \"relationship-provenance-not-found\",\n /** The root subject cannot be processed directly. */\n RootSubjectNotProcessable = \"root-subject-not-processable\",\n /** A schema conflict or incompatible schema version prevented processing. */\n SchemaConflict = \"schema-conflict\",\n /** The source schema dependency graph contains a cycle. */\n SchemaDependencyCycle = \"schema-dependency-cycle\",\n /** A required schema could not be loaded. */\n SchemaLoadFailed = \"schema-load-failed\",\n /** Reverse synchronization requires a source edit transaction. */\n SourceEditTxnRequired = \"source-edit-txn-required\",\n /** The requested synchronization range is invalid. */\n SynchronizationRangeInvalid = \"synchronization-range-invalid\",\n /** The synchronization direction cannot be determined. */\n SynchronizationTypeNotDetermined = \"synchronization-type-not-determined\",\n /** The previous synchronization version is missing. */\n SynchronizationVersionMissing = \"synchronization-version-missing\",\n /** A required class is absent from the target iModel. */\n TargetClassNotFound = \"target-class-not-found\",\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/imodel-transformer",
3
- "version": "2.0.0-dev.50",
3
+ "version": "2.0.0-dev.51",
4
4
  "description": "API for exporting an iModel's parts and also importing them into another iModel",
5
5
  "main": "lib/cjs/imodel-transformer.js",
6
6
  "typings": "lib/cjs/imodel-transformer.d.ts",
@@ -1,22 +0,0 @@
1
- /** @packageDocumentation
2
- * @module iModels
3
- */
4
- import { EditTxn, ElementTreeDeleter, ElementTreeWalkerScope } from "@itwin/core-backend";
5
- import { Id64String } from "@itwin/core-bentley";
6
- /** Deletes an element tree and code scope references starting with the specified top element. The top element is also deleted. Uses ElementCascadeDeleter.
7
- * @param editTxn The active EditTxn for the iModel
8
- * @param topElement The parent of the sub-tree
9
- */
10
- export declare function deleteElementTreeCascade(editTxn: EditTxn, topElement: Id64String): void;
11
- /** Deletes an entire element tree, including sub-models, child elements and code scope references.
12
- * Items are deleted in bottom-up order. Definitions and Subjects are deleted after normal elements.
13
- * Call deleteNormalElements on each tree. Then call deleteSpecialElements.
14
- */
15
- export declare class ElementCascadingDeleter extends ElementTreeDeleter {
16
- protected shouldVisitCodeScopes(_elementId: Id64String, _scope: ElementTreeWalkerScope): boolean;
17
- /** The main tree-walking function */
18
- protected processElementTree(element: Id64String, scope: ElementTreeWalkerScope): void;
19
- /** Process code scope references */
20
- private _processCodeScopes;
21
- }
22
- //# sourceMappingURL=ElementCascadingDeleter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ElementCascadingDeleter.d.ts","sourceRoot":"","sources":["../../src/ElementCascadingDeleter.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EACL,OAAO,EACP,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,GACrB,IAAI,CAIN;AAED;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,kBAAkB;IAC7D,SAAS,CAAC,qBAAqB,CAC7B,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,sBAAsB,WAG/B;IAED,qCAAqC;IACrC,UAAmB,kBAAkB,CACnC,OAAO,EAAE,UAAU,EACnB,KAAK,EAAE,sBAAsB,GAC5B,IAAI,CAKN;IACD,oCAAoC;IACpC,OAAO,CAAC,kBAAkB;CAyB3B"}
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ElementCascadingDeleter = void 0;
4
- exports.deleteElementTreeCascade = deleteElementTreeCascade;
5
- /*---------------------------------------------------------------------------------------------
6
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
7
- * See LICENSE.md in the project root for license terms and full copyright notice.
8
- *--------------------------------------------------------------------------------------------*/
9
- /** @packageDocumentation
10
- * @module iModels
11
- */
12
- const core_backend_1 = require("@itwin/core-backend");
13
- const core_common_1 = require("@itwin/core-common");
14
- /** Deletes an element tree and code scope references starting with the specified top element. The top element is also deleted. Uses ElementCascadeDeleter.
15
- * @param editTxn The active EditTxn for the iModel
16
- * @param topElement The parent of the sub-tree
17
- */
18
- function deleteElementTreeCascade(editTxn, topElement) {
19
- const del = new ElementCascadingDeleter(editTxn);
20
- del.deleteNormalElements(topElement);
21
- del.deleteSpecialElements();
22
- }
23
- /** Deletes an entire element tree, including sub-models, child elements and code scope references.
24
- * Items are deleted in bottom-up order. Definitions and Subjects are deleted after normal elements.
25
- * Call deleteNormalElements on each tree. Then call deleteSpecialElements.
26
- */
27
- class ElementCascadingDeleter extends core_backend_1.ElementTreeDeleter {
28
- shouldVisitCodeScopes(_elementId, _scope) {
29
- return true;
30
- }
31
- /** The main tree-walking function */
32
- processElementTree(element, scope) {
33
- if (this.shouldVisitCodeScopes(element, scope)) {
34
- this._processCodeScopes(element, scope);
35
- }
36
- super.processElementTree(element, scope);
37
- }
38
- /** Process code scope references */
39
- _processCodeScopes(element, scope) {
40
- const newScope = new core_backend_1.ElementTreeWalkerScope(scope, element);
41
- const query = `
42
- SELECT ECInstanceId
43
- FROM bis.Element
44
- WHERE CodeScope.id=:scopeId
45
- AND Parent.id IS NULL
46
- `;
47
- const params = new core_common_1.QueryBinder().bindId("scopeId", element);
48
- this.txn.iModel.withQueryReader(query, (reader) => {
49
- for (const row of reader) {
50
- const elementId = row[0];
51
- this.processElementTree(elementId, newScope);
52
- }
53
- }, params);
54
- }
55
- }
56
- exports.ElementCascadingDeleter = ElementCascadingDeleter;
57
- //# sourceMappingURL=ElementCascadingDeleter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ElementCascadingDeleter.js","sourceRoot":"","sources":["../../src/ElementCascadingDeleter.ts"],"names":[],"mappings":";;;;AAAA;;;gGAGgG;AAChG;;GAEG;AACH,sDAI6B;AAE7B,oDAAiD;AAEjD;;;GAGG;AACH,kCACE,OAAgB,EAChB,UAAsB;IAEtB,MAAM,GAAG,GAAG,IAAI,uBAAuB,CAAC,OAAO,CAAC,CAAC;IACjD,GAAG,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;IACrC,GAAG,CAAC,qBAAqB,EAAE,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,6BAAqC,SAAQ,iCAAkB;IACnD,qBAAqB,CAC7B,UAAsB,EACtB,MAA8B;QAE9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,qCAAqC;IAClB,kBAAkB,CACnC,OAAmB,EACnB,KAA6B;QAE7B,IAAI,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC;YAC/C,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC1C,CAAC;QACD,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IACD,oCAAoC;IAC5B,kBAAkB,CACxB,OAAmB,EACnB,KAA6B;QAE7B,MAAM,QAAQ,GAAG,IAAI,qCAAsB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC5D,MAAM,KAAK,GAAG;;;;;KAKb,CAAC;QAEF,MAAM,MAAM,GAAG,IAAI,yBAAW,EAAE,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAE5D,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,eAAe,CAC7B,KAAK,EACL,CAAC,MAAM,EAAE,EAAE;YACT,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;gBACzB,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAe,CAAC;gBACvC,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC,EACD,MAAM,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\nimport {\n EditTxn,\n ElementTreeDeleter,\n ElementTreeWalkerScope,\n} from \"@itwin/core-backend\";\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { QueryBinder } from \"@itwin/core-common\";\n\n/** Deletes an element tree and code scope references starting with the specified top element. The top element is also deleted. Uses ElementCascadeDeleter.\n * @param editTxn The active EditTxn for the iModel\n * @param topElement The parent of the sub-tree\n */\nexport function deleteElementTreeCascade(\n editTxn: EditTxn,\n topElement: Id64String\n): void {\n const del = new ElementCascadingDeleter(editTxn);\n del.deleteNormalElements(topElement);\n del.deleteSpecialElements();\n}\n\n/** Deletes an entire element tree, including sub-models, child elements and code scope references.\n * Items are deleted in bottom-up order. Definitions and Subjects are deleted after normal elements.\n * Call deleteNormalElements on each tree. Then call deleteSpecialElements.\n */\nexport class ElementCascadingDeleter extends ElementTreeDeleter {\n protected shouldVisitCodeScopes(\n _elementId: Id64String,\n _scope: ElementTreeWalkerScope\n ) {\n return true;\n }\n\n /** The main tree-walking function */\n protected override processElementTree(\n element: Id64String,\n scope: ElementTreeWalkerScope\n ): void {\n if (this.shouldVisitCodeScopes(element, scope)) {\n this._processCodeScopes(element, scope);\n }\n super.processElementTree(element, scope);\n }\n /** Process code scope references */\n private _processCodeScopes(\n element: Id64String,\n scope: ElementTreeWalkerScope\n ) {\n const newScope = new ElementTreeWalkerScope(scope, element);\n const query = `\n SELECT ECInstanceId\n FROM bis.Element\n WHERE CodeScope.id=:scopeId\n AND Parent.id IS NULL\n `;\n\n const params = new QueryBinder().bindId(\"scopeId\", element);\n\n this.txn.iModel.withQueryReader(\n query,\n (reader) => {\n for (const row of reader) {\n const elementId = row[0] as Id64String;\n this.processElementTree(elementId, newScope);\n }\n },\n params\n );\n }\n}\n"]}