@itwin/core-backend 5.9.0-dev.15 → 5.9.0-dev.17
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/lib/cjs/BriefcaseManager.d.ts.map +1 -1
- package/lib/cjs/BriefcaseManager.js +6 -3
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts +9 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +7 -1
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/ChangesetReader.d.ts +186 -0
- package/lib/cjs/ChangesetReader.d.ts.map +1 -0
- package/lib/cjs/ChangesetReader.js +372 -0
- package/lib/cjs/ChangesetReader.js.map +1 -0
- package/lib/cjs/ChangesetReaderTypes.d.ts +120 -0
- package/lib/cjs/ChangesetReaderTypes.d.ts.map +1 -0
- package/lib/cjs/ChangesetReaderTypes.js +23 -0
- package/lib/cjs/ChangesetReaderTypes.js.map +1 -0
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/DevTools.js.map +1 -1
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/EditTxn.d.ts +49 -3
- package/lib/cjs/EditTxn.d.ts.map +1 -1
- package/lib/cjs/EditTxn.js +24 -9
- package/lib/cjs/EditTxn.js.map +1 -1
- package/lib/cjs/Element.d.ts +69 -0
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +36 -0
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/GeographicCRSServices.d.ts +15 -0
- package/lib/cjs/GeographicCRSServices.d.ts.map +1 -1
- package/lib/cjs/GeographicCRSServices.js +13 -4
- package/lib/cjs/GeographicCRSServices.js.map +1 -1
- package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/Model.d.ts +34 -0
- package/lib/cjs/Model.d.ts.map +1 -1
- package/lib/cjs/Model.js +24 -0
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/PartialChangeUnifier.d.ts +77 -0
- package/lib/cjs/PartialChangeUnifier.d.ts.map +1 -0
- package/lib/cjs/PartialChangeUnifier.js +234 -0
- package/lib/cjs/PartialChangeUnifier.js.map +1 -0
- package/lib/cjs/SheetIndex.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.d.ts.map +1 -1
- package/lib/cjs/SqliteChangesetReader.js +1 -1
- package/lib/cjs/SqliteChangesetReader.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/core-backend.d.ts +3 -0
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +3 -0
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/esm/BriefcaseManager.d.ts.map +1 -1
- package/lib/esm/BriefcaseManager.js +6 -3
- package/lib/esm/BriefcaseManager.js.map +1 -1
- package/lib/esm/ChangesetECAdaptor.d.ts +9 -1
- package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/esm/ChangesetECAdaptor.js +7 -1
- package/lib/esm/ChangesetECAdaptor.js.map +1 -1
- package/lib/esm/ChangesetReader.d.ts +186 -0
- package/lib/esm/ChangesetReader.d.ts.map +1 -0
- package/lib/esm/ChangesetReader.js +368 -0
- package/lib/esm/ChangesetReader.js.map +1 -0
- package/lib/esm/ChangesetReaderTypes.d.ts +120 -0
- package/lib/esm/ChangesetReaderTypes.d.ts.map +1 -0
- package/lib/esm/ChangesetReaderTypes.js +20 -0
- package/lib/esm/ChangesetReaderTypes.js.map +1 -0
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/DevTools.js.map +1 -1
- package/lib/esm/DisplayStyle.js.map +1 -1
- package/lib/esm/ECSqlStatement.d.ts.map +1 -1
- package/lib/esm/ECSqlStatement.js.map +1 -1
- package/lib/esm/EditTxn.d.ts +49 -3
- package/lib/esm/EditTxn.d.ts.map +1 -1
- package/lib/esm/EditTxn.js +23 -8
- package/lib/esm/EditTxn.js.map +1 -1
- package/lib/esm/Element.d.ts +69 -0
- package/lib/esm/Element.d.ts.map +1 -1
- package/lib/esm/Element.js +36 -0
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/ElementGraphics.js.map +1 -1
- package/lib/esm/ExternalSource.js.map +1 -1
- package/lib/esm/GeographicCRSServices.d.ts +15 -0
- package/lib/esm/GeographicCRSServices.d.ts.map +1 -1
- package/lib/esm/GeographicCRSServices.js +12 -4
- package/lib/esm/GeographicCRSServices.js.map +1 -1
- package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/esm/IpcHost.js.map +1 -1
- package/lib/esm/Model.d.ts +34 -0
- package/lib/esm/Model.d.ts.map +1 -1
- package/lib/esm/Model.js +24 -0
- package/lib/esm/Model.js.map +1 -1
- package/lib/esm/PartialChangeUnifier.d.ts +77 -0
- package/lib/esm/PartialChangeUnifier.d.ts.map +1 -0
- package/lib/esm/PartialChangeUnifier.js +230 -0
- package/lib/esm/PartialChangeUnifier.js.map +1 -0
- package/lib/esm/SheetIndex.js.map +1 -1
- package/lib/esm/SqliteChangesetReader.d.ts.map +1 -1
- package/lib/esm/SqliteChangesetReader.js +1 -1
- package/lib/esm/SqliteChangesetReader.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/esm/core-backend.d.ts +3 -0
- package/lib/esm/core-backend.d.ts.map +1 -1
- package/lib/esm/core-backend.js +3 -0
- package/lib/esm/core-backend.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/esm/test/ElementDrivesElement.test.d.ts.map +1 -1
- package/lib/esm/test/ElementDrivesElement.test.js.map +1 -1
- package/lib/esm/test/annotations/LeaderGeometry.test.js +0 -1
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
- package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
- package/lib/esm/test/element/DeleteDefinitionElements.test.js +40 -31
- package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
- package/lib/esm/test/element/SheetInformationAspect.test.js.map +1 -1
- package/lib/esm/test/hubaccess/Rebase.test.js +1 -1
- package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
- package/lib/esm/test/misc/GeoServices.test.js +43 -1
- package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
- package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +4184 -1654
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/test/standalone/DeleteElements.test.js +39 -15
- package/lib/esm/test/standalone/DeleteElements.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
- package/lib/esm/test/standalone/IntegrityCheck.test.js +1 -1
- package/lib/esm/test/standalone/IntegrityCheck.test.js.map +1 -1
- package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.d.ts +2 -0
- package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.js +1862 -0
- package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.js.map +1 -0
- package/lib/esm/test/standalone/ViewDefinition.test.js +1 -1
- package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
- package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
- package/package.json +14 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementGraphics.js","sourceRoot":"","sources":["../../src/ElementGraphics.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAA+B,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAG9E,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,OAAoC,EAAE,MAAgB;IAClG,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC,uBAAuB,CAAC,
|
|
1
|
+
{"version":3,"file":"ElementGraphics.js","sourceRoot":"","sources":["../../src/ElementGraphics.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAA+B,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAG9E,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,OAAoC,EAAE,MAAgB;IAClG,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC,2CAA2C;IAEpH,IAAI,KAAyB,CAAC;IAC9B,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;QACtB,8CAAsC;QACtC;YACE,OAAO,SAAS,CAAC;QACnB;YACE,OAAO,MAAM,CAAC,OAAO,CAAC;QACxB;YACE,KAAK,GAAG,cAAc,CAAC;YACvB,MAAM;QACR;YACE,KAAK,GAAG,8BAA8B,CAAC;YACvC,MAAM;QACR;YACE,KAAK,GAAG,cAAc,OAAO,CAAC,SAAS,YAAY,CAAC;YACpD,MAAM;QACR;YACE,KAAK,GAAG,yBAAyB,OAAO,CAAC,EAAE,GAAG,CAAC;YAC/C,MAAM;IACV,CAAC;IAED,MAAM,CAAC,SAAS,KAAK,KAAK,CAAC,CAAC;IAC5B,MAAM,IAAI,WAAW,CAAC,YAAY,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;AACxD,CAAC","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*--------------------------------------------------------------------------------------------*/\nimport { assert, IModelStatus } from \"@itwin/core-bentley\";\nimport { ElementGraphicsRequestProps, IModelError } from \"@itwin/core-common\";\nimport { ElementGraphicsStatus } from \"@bentley/imodeljs-native\";\nimport { IModelDb } from \"./IModelDb\";\nimport { _nativeDb } from \"./internal/Symbols\";\n\n/** See [[IModelDb.generateElementGraphics]] and IModelTileRpcImpl.requestElementGraphics.\n * @internal\n */\nexport async function generateElementGraphics(request: ElementGraphicsRequestProps, iModel: IModelDb): Promise<Uint8Array | undefined> {\n const result = await iModel[_nativeDb].generateElementGraphics(request); // ###TODO update package versions in addon\n\n let error: string | undefined;\n switch (result.status) {\n case ElementGraphicsStatus.NoGeometry:\n case ElementGraphicsStatus.Canceled:\n return undefined;\n case ElementGraphicsStatus.Success:\n return result.content;\n case ElementGraphicsStatus.InvalidJson:\n error = \"Invalid JSON\";\n break;\n case ElementGraphicsStatus.UnknownMajorFormatVersion:\n error = \"Unknown major format version\";\n break;\n case ElementGraphicsStatus.ElementNotFound:\n error = `Element Id ${request.elementId} not found`;\n break;\n case ElementGraphicsStatus.DuplicateRequestId:\n error = `Duplicate request Id \"${request.id}\"`;\n break;\n }\n\n assert(undefined !== error);\n throw new IModelError(IModelStatus.BadRequest, error);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalSource.js","sourceRoot":"","sources":["../../src/ExternalSource.ts"],"names":[],"mappings":"AACA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,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H,MAAM,OAAO,mBAAoB,SAAQ,cAAc;IACrD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,qBAAqB,CAAC,CAAC,CAAC;IAEhF,YAAsB,KAA0B,EAAE,MAAgB;QAChE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,yBAA0B,SAAQ,OAAO;IACpD,6EAA6E;IACtE,iBAAiB,CAAU;IAClC,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,2BAA2B,CAAC,CAAC,CAAC;IAEtF,YAAsB,KAAqC,EAAE,MAAgB;QAC3E,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;IAEe,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAoC,CAAC,CAAC,sDAAsD;IACjH,CAAC;CACF","sourcesContent":["\n/*---------------------------------------------------------------------------------------------\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 Elements\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { Point3d } from \"@itwin/core-geometry\";\nimport {\n BisCodeSpec, Code, CodeScopeSpec, EntityReferenceSet, ExternalSourceAttachmentProps, ExternalSourceAttachmentRole, ExternalSourceProps, IModel, RelatedElement,\n SynchronizationConfigLinkProps,\n} from \"@itwin/core-common\";\nimport { InformationReferenceElement, UrlLink } from \"./Element\";\nimport { EditTxn } from \"./EditTxn\";\nimport { IModelDb } from \"./IModelDb\";\nimport { ExternalSourceAttachmentAttachesSource, ExternalSourceIsInRepository } from \"./NavigationRelationship\";\nimport { _implicitTxn } from \"./internal/Symbols\";\n\n/** An ExternalSource refers to an 'information container' found in a repository. In some cases, the container is the entire repository.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSource extends InformationReferenceElement {\n /** The repository that contains this ExternalSource. */\n public repository?: ExternalSourceIsInRepository;\n /** The name of the iModel Connecter that processed this ExternalSource. */\n public connectorName?: string;\n /** The version of the iModel Connecter that processed this ExternalSource. */\n public connectorVersion?: string;\n /** @internal */\n public static override get className(): string { return \"ExternalSource\"; }\n\n protected constructor(props: ExternalSourceProps, iModel: IModelDb) {\n super(props, iModel);\n if (props.repository)\n this.repository = new ExternalSourceIsInRepository(RelatedElement.idFromJson(props.repository));\n }\n\n public override toJSON(): ExternalSourceProps { // This override only specializes the return type\n return super.toJSON() as ExternalSourceProps; // Entity.toJSON takes care of auto-handled properties\n }\n /** Ensure the [[CodeSpec]] for ExternalSource elements exists, using an explicit transaction.\n * @param txn The active EditTxn.\n */\n public static ensureCodeSpec(txn: EditTxn): Id64String;\n /** @deprecated Use ExternalSource.ensureCodeSpec(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help. */\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String;\n public static ensureCodeSpec(txnOrIModel: EditTxn | IModelDb): Id64String {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n try {\n const codeSpec = txn.iModel.codeSpecs.getByName(BisCodeSpec.externalSource);\n return codeSpec.id;\n } catch {\n return txn.iModel.codeSpecs.insert(txn, BisCodeSpec.externalSource, CodeScopeSpec.Type.Repository);\n }\n }\n\n /** Create a Code for an ExternalSource element given a name that is meant to be unique within the scope of the iModel.\n * @param iModelDb The IModelDb\n * @param codeValue The ExternalSource name\n * @see [[ensureCodeSpec]]\n */\n public static createCode(iModelDb: IModelDb, codeValue: string): Code {\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSource);\n return new Code({ spec: codeSpec.id, scope: IModel.rootSubjectId, value: codeValue });\n }\n\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\n super.collectReferenceIds(referenceIds);\n if (this.repository)\n referenceIds.addElement(this.repository.id);\n }\n}\n\n/** Attachment of an ExternalSource\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceAttachment extends InformationReferenceElement {\n /** The [[ExternalSource]] that is attached by this ExternalSourceAttachment. */\n public attaches?: ExternalSourceAttachmentAttachesSource;\n /** Specifies whether the attached [[ExternalSource]] provides context or models a part of the whole. */\n public role?: ExternalSourceAttachmentRole;\n /** The translation or offset in global coordinates of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public translation?: Point3d;\n /** The Yaw angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public yaw?: number;\n /** The Pitch angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public pitch?: number;\n /** The Roll angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public roll?: number;\n /** The scale of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public scale?: Point3d;\n /** @internal */\n public static override get className(): string { return \"ExternalSourceAttachment\"; }\n\n protected constructor(props: ExternalSourceAttachmentProps, iModel: IModelDb) {\n super(props, iModel);\n if (props.attaches)\n this.attaches = new ExternalSourceAttachmentAttachesSource(RelatedElement.idFromJson(props.attaches));\n\n if (props.translation)\n this.translation = Point3d.fromJSON(props.translation);\n\n if (props.scale)\n this.scale = Point3d.fromJSON(props.scale);\n }\n\n public override toJSON(): ExternalSourceAttachmentProps { // This override only specializes the return type\n return super.toJSON() as ExternalSourceAttachmentProps; // Entity.toJSON takes care of auto-handled properties\n }\n /** Ensure the [[CodeSpec]] for ExternalSourceAttachment elements exists, using an explicit transaction.\n * @param txn The active EditTxn.\n */\n public static ensureCodeSpec(txn: EditTxn): Id64String;\n /** @deprecated Use ExternalSourceAttachment.ensureCodeSpec(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help. */\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String;\n public static ensureCodeSpec(txnOrIModel: EditTxn | IModelDb): Id64String {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n try {\n const codeSpec = txn.iModel.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\n return codeSpec.id;\n } catch {\n return txn.iModel.codeSpecs.insert(txn, BisCodeSpec.externalSourceAttachment, CodeScopeSpec.Type.ParentElement);\n }\n }\n\n /** Create a Code for an ExternalSourceAttachment element given a name that is meant to be unique within the scope of its parent [[ExternalSource]].\n * @param iModelDb The IModelDb\n * @param scopeElementId The parent ExternalSource\n * @param codeValue The ExternalSourceAttachment name\n * @see [[ensureCodeSpec]]\n */\n public static createCode(iModelDb: IModelDb, scopeElementId: Id64String, codeValue: string): Code {\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\n return new Code({ spec: codeSpec.id, scope: scopeElementId, value: codeValue });\n }\n}\n\n/** A group of ExternalSources that are collectively a source of information for one or more elements.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceGroup extends ExternalSource {\n /** @internal */\n public static override get className(): string { return \"ExternalSourceGroup\"; }\n\n protected constructor(props: ExternalSourceProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** Link to the Configuration for an iModel Synchronization Job\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class SynchronizationConfigLink extends UrlLink {\n /** Date/Time of last successful run of this synchronization configuration */\n public lastSuccessfulRun?: string;\n /** @internal */\n public static override get className(): string { return \"SynchronizationConfigLink\"; }\n\n protected constructor(props: SynchronizationConfigLinkProps, iModel: IModelDb) {\n super(props, iModel);\n }\n\n public override toJSON(): SynchronizationConfigLinkProps { // This override only specializes the return type\n return super.toJSON() as SynchronizationConfigLinkProps; // Entity.toJSON takes care of auto-handled properties\n }\n}\n\n"]}
|
|
1
|
+
{"version":3,"file":"ExternalSource.js","sourceRoot":"","sources":["../../src/ExternalSource.ts"],"names":[],"mappings":"AACA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAA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GAGG;AACH,MAAM,OAAO,mBAAoB,SAAQ,cAAc;IACrD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,qBAAqB,CAAC,CAAC,CAAC;IAEhF,YAAsB,KAA0B,EAAE,MAAgB;QAChE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,yBAA0B,SAAQ,OAAO;IACpD,6EAA6E;IACtE,iBAAiB,CAAU;IAClC,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,2BAA2B,CAAC,CAAC,CAAC;IAEtF,YAAsB,KAAqC,EAAE,MAAgB;QAC3E,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;IAEe,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,sDAAsD;IAC/E,CAAC;CACF","sourcesContent":["\n/*---------------------------------------------------------------------------------------------\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 Elements\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { Point3d } from \"@itwin/core-geometry\";\nimport {\n BisCodeSpec, Code, CodeScopeSpec, EntityReferenceSet, ExternalSourceAttachmentProps, ExternalSourceAttachmentRole, ExternalSourceProps, IModel, RelatedElement,\n SynchronizationConfigLinkProps,\n} from \"@itwin/core-common\";\nimport { InformationReferenceElement, UrlLink } from \"./Element\";\nimport { EditTxn } from \"./EditTxn\";\nimport { IModelDb } from \"./IModelDb\";\nimport { ExternalSourceAttachmentAttachesSource, ExternalSourceIsInRepository } from \"./NavigationRelationship\";\nimport { _implicitTxn } from \"./internal/Symbols\";\n\n/** An ExternalSource refers to an 'information container' found in a repository. In some cases, the container is the entire repository.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSource extends InformationReferenceElement {\n /** The repository that contains this ExternalSource. */\n public repository?: ExternalSourceIsInRepository;\n /** The name of the iModel Connecter that processed this ExternalSource. */\n public connectorName?: string;\n /** The version of the iModel Connecter that processed this ExternalSource. */\n public connectorVersion?: string;\n /** @internal */\n public static override get className(): string { return \"ExternalSource\"; }\n\n protected constructor(props: ExternalSourceProps, iModel: IModelDb) {\n super(props, iModel);\n if (props.repository)\n this.repository = new ExternalSourceIsInRepository(RelatedElement.idFromJson(props.repository));\n }\n\n public override toJSON(): ExternalSourceProps { // This override only specializes the return type\n return super.toJSON(); // Entity.toJSON takes care of auto-handled properties\n }\n /** Ensure the [[CodeSpec]] for ExternalSource elements exists, using an explicit transaction.\n * @param txn The active EditTxn.\n */\n public static ensureCodeSpec(txn: EditTxn): Id64String;\n /** @deprecated Use ExternalSource.ensureCodeSpec(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help. */\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String;\n public static ensureCodeSpec(txnOrIModel: EditTxn | IModelDb): Id64String {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n try {\n const codeSpec = txn.iModel.codeSpecs.getByName(BisCodeSpec.externalSource);\n return codeSpec.id;\n } catch {\n return txn.iModel.codeSpecs.insert(txn, BisCodeSpec.externalSource, CodeScopeSpec.Type.Repository);\n }\n }\n\n /** Create a Code for an ExternalSource element given a name that is meant to be unique within the scope of the iModel.\n * @param iModelDb The IModelDb\n * @param codeValue The ExternalSource name\n * @see [[ensureCodeSpec]]\n */\n public static createCode(iModelDb: IModelDb, codeValue: string): Code {\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSource);\n return new Code({ spec: codeSpec.id, scope: IModel.rootSubjectId, value: codeValue });\n }\n\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\n super.collectReferenceIds(referenceIds);\n if (this.repository)\n referenceIds.addElement(this.repository.id);\n }\n}\n\n/** Attachment of an ExternalSource\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceAttachment extends InformationReferenceElement {\n /** The [[ExternalSource]] that is attached by this ExternalSourceAttachment. */\n public attaches?: ExternalSourceAttachmentAttachesSource;\n /** Specifies whether the attached [[ExternalSource]] provides context or models a part of the whole. */\n public role?: ExternalSourceAttachmentRole;\n /** The translation or offset in global coordinates of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public translation?: Point3d;\n /** The Yaw angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public yaw?: number;\n /** The Pitch angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public pitch?: number;\n /** The Roll angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public roll?: number;\n /** The scale of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\n public scale?: Point3d;\n /** @internal */\n public static override get className(): string { return \"ExternalSourceAttachment\"; }\n\n protected constructor(props: ExternalSourceAttachmentProps, iModel: IModelDb) {\n super(props, iModel);\n if (props.attaches)\n this.attaches = new ExternalSourceAttachmentAttachesSource(RelatedElement.idFromJson(props.attaches));\n\n if (props.translation)\n this.translation = Point3d.fromJSON(props.translation);\n\n if (props.scale)\n this.scale = Point3d.fromJSON(props.scale);\n }\n\n public override toJSON(): ExternalSourceAttachmentProps { // This override only specializes the return type\n return super.toJSON(); // Entity.toJSON takes care of auto-handled properties\n }\n /** Ensure the [[CodeSpec]] for ExternalSourceAttachment elements exists, using an explicit transaction.\n * @param txn The active EditTxn.\n */\n public static ensureCodeSpec(txn: EditTxn): Id64String;\n /** @deprecated Use ExternalSourceAttachment.ensureCodeSpec(txn) instead, within an explicit EditTxn scope (or via withEditTxn). See EditTxn documentation for migration help. */\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String;\n public static ensureCodeSpec(txnOrIModel: EditTxn | IModelDb): Id64String {\n const txn = txnOrIModel instanceof EditTxn ? txnOrIModel : txnOrIModel[_implicitTxn];\n try {\n const codeSpec = txn.iModel.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\n return codeSpec.id;\n } catch {\n return txn.iModel.codeSpecs.insert(txn, BisCodeSpec.externalSourceAttachment, CodeScopeSpec.Type.ParentElement);\n }\n }\n\n /** Create a Code for an ExternalSourceAttachment element given a name that is meant to be unique within the scope of its parent [[ExternalSource]].\n * @param iModelDb The IModelDb\n * @param scopeElementId The parent ExternalSource\n * @param codeValue The ExternalSourceAttachment name\n * @see [[ensureCodeSpec]]\n */\n public static createCode(iModelDb: IModelDb, scopeElementId: Id64String, codeValue: string): Code {\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\n return new Code({ spec: codeSpec.id, scope: scopeElementId, value: codeValue });\n }\n}\n\n/** A group of ExternalSources that are collectively a source of information for one or more elements.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceGroup extends ExternalSource {\n /** @internal */\n public static override get className(): string { return \"ExternalSourceGroup\"; }\n\n protected constructor(props: ExternalSourceProps, iModel: IModelDb) {\n super(props, iModel);\n }\n}\n\n/** Link to the Configuration for an iModel Synchronization Job\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class SynchronizationConfigLink extends UrlLink {\n /** Date/Time of last successful run of this synchronization configuration */\n public lastSuccessfulRun?: string;\n /** @internal */\n public static override get className(): string { return \"SynchronizationConfigLink\"; }\n\n protected constructor(props: SynchronizationConfigLinkProps, iModel: IModelDb) {\n super(props, iModel);\n }\n\n public override toJSON(): SynchronizationConfigLinkProps { // This override only specializes the return type\n return super.toJSON(); // Entity.toJSON takes care of auto-handled properties\n }\n}\n\n"]}
|
|
@@ -21,6 +21,10 @@ export interface AvailableCoordinateReferenceSystemProps {
|
|
|
21
21
|
* Maximum longitude and latitude correspond to crsExtent.high.x and crsExtent.high.y, respectively.
|
|
22
22
|
*/
|
|
23
23
|
crsExtent: Range2dProps;
|
|
24
|
+
/** The name of the linear unit used by the coordinate reference system.
|
|
25
|
+
* When returned by [[getAvailableCoordinateReferenceSystems]], the value uses the canonical casing returned by [[getAvailableCRSUnits]].
|
|
26
|
+
*/
|
|
27
|
+
unit?: string;
|
|
24
28
|
}
|
|
25
29
|
/** Arguments supplied to [[getAvailableCoordinateReferenceSystems]].
|
|
26
30
|
* @beta
|
|
@@ -34,6 +38,12 @@ export interface GetAvailableCoordinateReferenceSystemsArgs {
|
|
|
34
38
|
* @default false
|
|
35
39
|
*/
|
|
36
40
|
includeWorld?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* If provided, filter coordinate reference systems by unit name.
|
|
43
|
+
* Matching is case-insensitive.
|
|
44
|
+
* Use [[getAvailableCRSUnits]] to get a list of canonical unit names.
|
|
45
|
+
*/
|
|
46
|
+
unit?: string;
|
|
37
47
|
}
|
|
38
48
|
/** Get a list of Geographic Coordinate Reference Systems.
|
|
39
49
|
* @param options Specifies the parameters to filter the returned list.
|
|
@@ -41,4 +51,9 @@ export interface GetAvailableCoordinateReferenceSystemsArgs {
|
|
|
41
51
|
* @beta
|
|
42
52
|
*/
|
|
43
53
|
export declare function getAvailableCoordinateReferenceSystems(args: GetAvailableCoordinateReferenceSystemsArgs): Promise<AvailableCoordinateReferenceSystemProps[]>;
|
|
54
|
+
/** Get a list of units used by Geographic Coordinate Reference Systems in iTwin.js.
|
|
55
|
+
* @returns An array of canonical unit names.
|
|
56
|
+
* @beta
|
|
57
|
+
*/
|
|
58
|
+
export declare function getAvailableCRSUnits(): string[];
|
|
44
59
|
//# sourceMappingURL=GeographicCRSServices.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeographicCRSServices.d.ts","sourceRoot":"","sources":["../../src/GeographicCRSServices.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIpD;;GAEG;AACH,MAAM,WAAW,uCAAuC;IACtD,mJAAmJ;IACnJ,IAAI,EAAE,MAAM,CAAC;IACb,8JAA8J;IAC9J,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,SAAS,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"GeographicCRSServices.d.ts","sourceRoot":"","sources":["../../src/GeographicCRSServices.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIpD;;GAEG;AACH,MAAM,WAAW,uCAAuC;IACtD,mJAAmJ;IACnJ,IAAI,EAAE,MAAM,CAAC;IACb,8JAA8J;IAC9J,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,SAAS,EAAE,YAAY,CAAC;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,0CAA0C;IACzD;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,wBAAsB,sCAAsC,CAC1D,IAAI,EAAE,0CAA0C,GAC/C,OAAO,CAAC,uCAAuC,EAAE,CAAC,CAOpD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAG/C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
2
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module iModels
|
|
7
7
|
*/
|
|
@@ -14,6 +14,14 @@ import { GeoCoordConfig } from "./GeoCoordConfig";
|
|
|
14
14
|
*/
|
|
15
15
|
export async function getAvailableCoordinateReferenceSystems(args) {
|
|
16
16
|
GeoCoordConfig.loadDefaultDatabases();
|
|
17
|
-
return IModelNative.platform.GeoServices.getListOfCRS(args.extent, args.includeWorld);
|
|
17
|
+
return IModelNative.platform.GeoServices.getListOfCRS(args.extent, args.includeWorld, args.unit);
|
|
18
|
+
}
|
|
19
|
+
/** Get a list of units used by Geographic Coordinate Reference Systems in iTwin.js.
|
|
20
|
+
* @returns An array of canonical unit names.
|
|
21
|
+
* @beta
|
|
22
|
+
*/
|
|
23
|
+
export function getAvailableCRSUnits() {
|
|
24
|
+
GeoCoordConfig.loadDefaultDatabases();
|
|
25
|
+
return IModelNative.platform.GeoServices.getAvailableUnitNames();
|
|
18
26
|
}
|
|
19
27
|
//# sourceMappingURL=GeographicCRSServices.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeographicCRSServices.js","sourceRoot":"","sources":["../../src/GeographicCRSServices.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"GeographicCRSServices.js","sourceRoot":"","sources":["../../src/GeographicCRSServices.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA+ClD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,sCAAsC,CAC1D,IAAgD;IAEhD,cAAc,CAAC,oBAAoB,EAAE,CAAC;IACtC,OAAO,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,YAAY,CACnD,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,YAAY,EACjB,IAAI,CAAC,IAAI,CACV,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAClC,cAAc,CAAC,oBAAoB,EAAE,CAAC;IACtC,OAAO,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,qBAAqB,EAAE,CAAC;AACnE,CAAC","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 */\n\nimport { Range2dProps } from \"@itwin/core-geometry\";\nimport { IModelNative } from \"./internal/NativePlatform\";\nimport { GeoCoordConfig } from \"./GeoCoordConfig\";\n\n/** Describes a coordinate reference system produced by [[getAvailableCoordinateReferenceSystems]].\n * @beta\n */\nexport interface AvailableCoordinateReferenceSystemProps {\n /** The name of the coordinate reference system. It can be presented to the user in the UI as an identifier for the coordinate reference system. */\n name: string;\n /** The description of the coordinate reference system. It can be presented to the user in the UI as extra information for the coordinate reference system. */\n description: string;\n /** Indicate if the coordinate reference system is deprecated. A coordinate reference system is deprecated if it is no longer recommended for use.\n * A deprecated coordinate reference system can usually be substituted by a more accurate one. It is possible that an existing project uses a deprecated coordinate reference system.\n * However, for new projects, it is recommended to use a non-deprecated coordinate reference system.\n */\n deprecated: boolean;\n /** Extent of the coordinate reference system. This is the area where the coordinate reference system can be used.\n * Outside of this area, the coordinate reference system may not be accurate. The extent is defined by a range of longitude and latitude values.\n * Minimum longitude and latitude correspond to crsExtent.low.x and crsExtent.low.y, respectively.\n * Maximum longitude and latitude correspond to crsExtent.high.x and crsExtent.high.y, respectively.\n */\n crsExtent: Range2dProps;\n /** The name of the linear unit used by the coordinate reference system.\n * When returned by [[getAvailableCoordinateReferenceSystems]], the value uses the canonical casing returned by [[getAvailableCRSUnits]].\n */\n unit?: string;\n}\n\n/** Arguments supplied to [[getAvailableCoordinateReferenceSystems]].\n * @beta\n */\nexport interface GetAvailableCoordinateReferenceSystemsArgs {\n /** If provided, only return coordinate reference systems that contain the given extent. Minimum longitude and latitude correspond to extent.low.x and extent.low.y, respectively.\n * Maximum longitude and latitude correspond to extent.high.x and extent.high.y, respectively.\n */\n extent?: Range2dProps;\n /** If true, returns additional coordinate reference systems with extents spanning the entire Earth's surface.\n * @default false\n */\n includeWorld?: boolean;\n /**\n * If provided, filter coordinate reference systems by unit name.\n * Matching is case-insensitive.\n * Use [[getAvailableCRSUnits]] to get a list of canonical unit names.\n */\n unit?: string;\n}\n\n/** Get a list of Geographic Coordinate Reference Systems.\n * @param options Specifies the parameters to filter the returned list.\n * @returns The list of Geographic Coordinate Reference Systems, according to the supplied parameters.\n * @beta\n */\nexport async function getAvailableCoordinateReferenceSystems(\n args: GetAvailableCoordinateReferenceSystemsArgs\n): Promise<AvailableCoordinateReferenceSystemProps[]> {\n GeoCoordConfig.loadDefaultDatabases();\n return IModelNative.platform.GeoServices.getListOfCRS(\n args.extent,\n args.includeWorld,\n args.unit\n );\n}\n\n/** Get a list of units used by Geographic Coordinate Reference Systems in iTwin.js.\n * @returns An array of canonical unit names.\n * @beta\n */\nexport function getAvailableCRSUnits(): string[] {\n GeoCoordConfig.loadDefaultDatabases();\n return IModelNative.platform.GeoServices.getAvailableUnitNames();\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IModelIncrementalSchemaLocater.js","sourceRoot":"","sources":["../../src/IModelIncrementalSchemaLocater.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,EAAqB,kBAAkB,EAAqD,MAAM,0BAA0B,CAAC;AACpI,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGjE;;;GAGG;AACH,MAAM,OAAO,8BAA+B,SAAQ,kBAAkB;IACnD,OAAO,CAAW;IAEnC;;;;OAIG;IACH,YAAY,MAAgB,EAAE,OAAmC;QAC/D,KAAK,CAAC,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AClB,MAAM,CAAC,KAAc,CAAC,CAAC;YACzB,CAAC;QACH,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACT,CAAC;IAED;;;;;OAKG;IACO,KAAK,CAAC,YAAY,CAAO,KAAa,EAAE,OAA2B;QAC3E,MAAM,eAAe,GAAG,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAEzG,OAAO,IAAI,CAAC,OAAO;aAChB,iBAAiB,CAAC,KAAK,EAAE,eAAe,EAAE;YACzC,SAAS,EAAE,cAAc,CAAC,qBAAqB;YAC/C,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;SACjC,CAAC;aACD,OAAO,EAAE,CAAC;IACf,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 { ECSqlQueryOptions, ECSqlSchemaLocater, ECSqlSchemaLocaterOptions, SchemaKey, SchemaProps } from \"@itwin/ecschema-metadata\";\nimport { QueryBinder, QueryRowFormat } from \"@itwin/core-common\";\nimport { IModelDb } from \"./IModelDb\";\n\n/**\n * A [[ECSqlSchemaLocater]]($ecschema-metadata) implementation that uses the [[IModelDb]] to load schemas incrementally.\n * @beta\n */\nexport class IModelIncrementalSchemaLocater extends ECSqlSchemaLocater {\n private readonly _iModel: IModelDb;\n\n /**\n * Constructs a new IModelIncrementalSchemaLocater instance.\n * @param iModel The [[IModelDb]] to query.\n * @param options Optional [[ECSqlSchemaLocaterOptions]]($ecschema-metadata).\n */\n constructor(iModel: IModelDb, options?: ECSqlSchemaLocaterOptions) {\n super(options ?? { useMultipleQueries: true });\n this._iModel = iModel;\n }\n\n /**\n * Gets [[SchemaProps]]($ecschema-metadata) for the given [[SchemaKey]]($ecschema-metadata).\n * This is the full schema json with all elements that are defined in the schema.\n * @param schemaKey The key of the schema to be resolved.\n */\n protected async getSchemaProps(schemaKey: SchemaKey): Promise<SchemaProps | undefined> {\n // To keep the main thread from being blocked in sync loading cases the resolving\n // is triggered through a timeout. Even if there is no delay, it improves loading\n // time by ~3x.\n return new Promise((resolve, reject) => setTimeout(() => {\n try {\n resolve(this._iModel.getSchemaProps(schemaKey.name));\n }\n catch (error: any) {\n reject(error as Error);\n }\n }, 0));\n }\n\n /**\n * Executes an ECSql query against the IModelDb.\n * @param query The query to execute\n * @param options The [[ECSqlQueryOptions]]($ecschema-metadata) to use.\n * @returns A promise that resolves to read-only array of type TRow.\n */\n protected async executeQuery<TRow>(query: string, options?: ECSqlQueryOptions): Promise<ReadonlyArray<TRow>> {\n const queryParameters = options && options.parameters ? QueryBinder.from(options.parameters) : undefined;\n\n return this._iModel\n .createQueryReader(query, queryParameters, {\n rowFormat: QueryRowFormat.UseECSqlPropertyNames,\n limit: { count: options?.limit },\n })\n .toArray();\n }\n}"]}
|
package/lib/esm/IpcHost.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IpcHost.js","sourceRoot":"","sources":["../../src/IpcHost.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAY,MAAM,qBAAqB,CAAC;AAChH,OAAO,EAE2D,wBAAwB,EAAyB,WAAW,EAAE,sBAAsB,EACpJ,cAAc,EAAwF,YAAY,GAGnH,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAoB,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAqB,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AC;IAEM,KAAK,CAAC,gBAAgB,CAAC,IAAkB;QAC9C,OAAO,YAAY,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAsB,EAAE,UAAgC,EAAE,gBAAyB;IAC1H,MAAM,QAAQ,GAAG,gBAAgB,IAAI,GAAG,CAAC,CAAC,+DAA+D;IACzG,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC;IACrC,MAAM,gBAAgB,GAAqB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;QAC3D,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,IAAI,MAAM,IAAI,KAAK,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;YACvC,QAAQ,GAAG,GAAG,GAAG,QAAQ,CAAC;YAC1B,OAAO,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO,UAAU,EAAE,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO,gBAAgB,CAAC;AAC1B,CAAC","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 NativeApp\n */\n\nimport { IModelJsNative } from \"@bentley/imodeljs-native\";\nimport { assert, BentleyError, IModelStatus, JsonUtils, Logger, LogLevel, OpenMode } from \"@itwin/core-bentley\";\nimport {\n BriefcaseConnectionProps,\n ChangesetIndex, ChangesetIndexAndId, EditingScopeNotifications, getPullChangesIpcChannel, IModelConnectionProps, IModelError, IModelNotFoundResponse, IModelRpcProps,\n ipcAppChannels, IpcAppFunctions, IpcAppNotifications, IpcInvokeReturn, IpcListener, IpcSocketBackend, iTwinChannel,\n OpenBriefcaseProps, OpenCheckpointArgs, PullChangesOptions, ReinstateTxnArgs, RemoveFunction, ReverseTxnArgs, SnapshotOpenOptions,\n StandaloneOpenOptions, TileTreeContentIds, TxnNotifications,\n} from \"@itwin/core-common\";\nimport { ProgressFunction, ProgressStatus } from \"./CheckpointManager\";\nimport { BriefcaseDb, IModelDb, SnapshotDb, StandaloneDb } from \"./IModelDb\";\nimport { IModelHost, IModelHostOptions } from \"./IModelHost\";\nimport { IModelNative } from \"./internal/NativePlatform\";\nimport { _implicitTxn, _nativeDb } from \"./internal/Symbols\";\nimport { cancelTileContentRequests } from \"./rpc-impl/IModelTileRpcImpl\";\n\n/**\n * Options for [[IpcHost.startup]]\n * @public\n */\nexport interface IpcHostOpts {\n iModelHost?: IModelHostOptions;\n ipcHost?: {\n /** The Ipc socket to use for communications with frontend. Allows undefined only for headless tests. */\n socket?: IpcSocketBackend;\n\n /** don't send stack information on exceptions */\n exceptions?: {\n noStack?: boolean;\n };\n };\n}\n\n/**\n * Used by applications that have a dedicated backend. IpcHosts may send messages to their corresponding IpcApp.\n * @note if either end terminates, the other must too.\n * @public\n */\nexport class IpcHost {\n public static noStack = false;\n private static _ipc: IpcSocketBackend | undefined;\n /** Get the implementation of the [IpcSocketBackend]($common) interface. */\n private static get ipc(): IpcSocketBackend { return this._ipc!; } // eslint-disable-line @typescript-eslint/no-non-null-assertion\n /** Determine whether Ipc is available for this backend. This will only be true if [[startup]] has been called on this class. */\n public static get isValid(): boolean { return undefined !== this._ipc; }\n\n /**\n * Send a message to the frontend over an Ipc channel.\n * @param channel the name of the channel matching the name registered with [[IpcApp.addListener]].\n * @param data The content of the message.\n */\n public static send(channel: string, ...data: any[]): void {\n this.ipc.send(iTwinChannel(channel), ...data);\n }\n\n /**\n * Establish a handler for an Ipc channel to receive [[Frontend.invoke]] calls\n * @param channel The name of the channel for this handler.\n * @param handler A function that supplies the implementation for `channel`\n * @note returns A function to call to remove the handler.\n */\n public static handle(channel: string, handler: (...args: any[]) => Promise<any>): RemoveFunction {\n return this.ipc.handle(iTwinChannel(channel), handler);\n }\n /**\n * Establish a handler to receive messages sent via [[IpcApp.send]].\n * @param channel The name of the channel for the messages.\n * @param listener A function called when messages are sent over `channel`\n * @note returns A function to call to remove the listener.\n */\n public static addListener(channel: string, listener: IpcListener): RemoveFunction {\n return this.ipc.addListener(iTwinChannel(channel), listener);\n }\n /**\n * Remove a previously registered listener\n * @param channel The name of the channel for the listener previously registered with [[addListener]]\n * @param listener The function passed to [[addListener]]\n */\n public static removeListener(channel: string, listener: IpcListener): void {\n this.ipc.removeListener(iTwinChannel(channel), listener);\n }\n\n private static notify(channel: string, briefcase: BriefcaseDb | StandaloneDb, methodName: string, ...args: any[]) {\n if (this.isValid)\n return this.send(`${channel}/${briefcase.key}`, methodName, ...args);\n }\n\n /** @internal */\n public static notifyIpcFrontend<T extends keyof IpcAppNotifications>(methodName: T, ...args: Parameters<IpcAppNotifications[T]>) {\n return IpcHost.send(ipcAppChannels.appNotify, methodName, ...args);\n }\n\n /** @internal */\n public static notifyTxns<T extends keyof TxnNotifications>(briefcase: BriefcaseDb | StandaloneDb, methodName: T, ...args: Parameters<TxnNotifications[T]>) {\n this.notify(ipcAppChannels.txns, briefcase, methodName, ...args);\n }\n\n /** @internal */\n public static notifyEditingScope<T extends keyof EditingScopeNotifications>(briefcase: BriefcaseDb | StandaloneDb, methodName: T, ...args: Parameters<EditingScopeNotifications[T]>) {\n this.notify(ipcAppChannels.editingScope, briefcase, methodName, ...args);\n }\n\n /**\n * Start the backend of an Ipc app.\n * @param opt\n * @note this method calls [[IModelHost.startup]] internally.\n */\n public static async startup(opt?: IpcHostOpts): Promise<void> {\n this._ipc = opt?.ipcHost?.socket;\n if (opt?.ipcHost?.exceptions?.noStack)\n this.noStack = true;\n\n if (this.isValid) { // for tests, we use IpcHost but don't have a frontend\n IpcAppHandler.register();\n }\n\n await IModelHost.startup(opt?.iModelHost);\n }\n\n /** Shutdown IpcHost backend. Also calls [[IModelHost.shutdown]] */\n public static async shutdown(): Promise<void> {\n this._ipc = undefined;\n await IModelHost.shutdown();\n }\n}\n\n/**\n * Base class for all implementations of an Ipc interface.\n *\n * Create a subclass to implement your Ipc interface. Your class should be declared like this:\n * ```ts\n * class MyHandler extends IpcHandler implements MyInterface\n * ```\n * to ensure all methods and signatures are correct.\n *\n * Then, call `MyClass.register` at startup to connect your class to your channel.\n * @public\n */\nexport abstract class IpcHandler {\n /**\n * All subclasses *must* implement this method to specify their channel name.\n *\n * Channel names are the key that connects Handlers and senders. The channel name of IpcHandlers must exactly match the name used by senders.\n * By convention, channel names should be prefixed by a *namespace* (e.g. `${appName}/`)\n * unique enough to disambiguate them from channels for other apps that may be running in the same processes.\n */\n public abstract get channelName(): string;\n\n /**\n * Register this class as the handler for methods on its channel. This static method creates a new instance\n * that becomes the handler and is `this` when its methods are called.\n * @returns A function that can be called to remove the handler.\n * @note this method should only be called once per channel. If it is called multiple times, subsequent calls replace the previous ones.\n */\n public static register(): RemoveFunction {\n const impl = new (this as any)() as IpcHandler; // create an instance of subclass. \"as any\" is necessary because base class is abstract\n const prohibitedFunctions = Object.getOwnPropertyNames(Object.getPrototypeOf({}));\n\n return IpcHost.handle(impl.channelName, async (_evt: Event, funcName: string, ...args: any[]): Promise<IpcInvokeReturn> => {\n try {\n if (prohibitedFunctions.includes(funcName))\n throw new Error(`Method \"${funcName}\" not available for channel: ${impl.channelName}`);\n\n const func = (impl as any)[funcName];\n if (typeof func !== \"function\")\n throw new IModelError(IModelStatus.FunctionNotFound, `Method \"${impl.constructor.name}.${funcName}\" not found on IpcHandler registered for channel: ${impl.channelName}`);\n\n return { result: await func.call(impl, ...args) };\n } catch (err: unknown) {\n\n if (!JsonUtils.isObject(err)) // if the exception isn't an object, just forward it\n return { error: err as any };\n\n const serializeError = (e: any, includeStack: boolean, visited = new WeakSet<object>()): any => {\n if (visited.has(e))\n return undefined;\n visited.add(e);\n try {\n const serialized: any = { ...e };\n\n for (const sym of Object.getOwnPropertySymbols(serialized))\n delete serialized[sym]; // symbol-keyed properties cannot be structured-cloned\n\n if (e instanceof Error) {\n serialized.message = e.message; // NB: .message and .stack are non-enumerable on Error instances\n if (includeStack)\n serialized.stack = e.stack;\n\n // Error.cause is typically non-enumerable and must be copied explicitly.\n if (Object.prototype.hasOwnProperty.call(e, \"cause\"))\n serialized.cause = (e as { cause?: unknown }).cause;\n }\n\n if (e instanceof BentleyError) {\n serialized.iTwinErrorId = e.iTwinErrorId;\n if (e.hasMetaData)\n serialized.loggingMetadata = e.loggingMetadata;\n delete serialized._metaData;\n }\n\n // Only recurse into Error instances and plain objects — not class instances like Date or Buffer.\n const shouldRecurse = (val: any) => val instanceof Error || (JsonUtils.isObject(val) && Object.getPrototypeOf(val) === Object.prototype);\n const isSerializableLeaf = (val: unknown): boolean => {\n const t = typeof val;\n return val === null || val === undefined || val instanceof Date\n || t === \"string\" || t === \"number\" || t === \"boolean\";\n };\n for (const key of Object.keys(serialized)) {\n const val = serialized[key];\n if (Array.isArray(val))\n serialized[key] = val.map((item) => shouldRecurse(item) ? serializeError(item, includeStack, visited) : isSerializableLeaf(item) ? item : undefined);\n else if (shouldRecurse(val))\n serialized[key] = serializeError(val, includeStack, visited);\n else if (!isSerializableLeaf(val))\n delete serialized[key]; // strip non-cloneable values (functions, class instances, etc.)\n }\n\n return serialized;\n } finally {\n // Remove from the stack so a sibling branch can still serialize this object.\n visited.delete(e);\n }\n };\n\n return { error: serializeError(err, !IpcHost.noStack) };\n }\n });\n }\n}\n\n/**\n * Implementation of IpcAppFunctions\n */\nclass IpcAppHandler extends IpcHandler implements IpcAppFunctions {\n public get channelName() { return ipcAppChannels.functions; }\n\n private _iModelKeyToPullStatus = new Map<string, ProgressStatus>();\n\n public async log(_timestamp: number, level: LogLevel, category: string, message: string, metaData?: any): Promise<void> {\n switch (level) {\n case LogLevel.Error:\n Logger.logError(category, message, metaData);\n break;\n case LogLevel.Info:\n Logger.logInfo(category, message, metaData);\n break;\n case LogLevel.Trace:\n Logger.logTrace(category, message, metaData);\n break;\n case LogLevel.Warning:\n Logger.logWarning(category, message, metaData);\n break;\n }\n }\n\n public async cancelTileContentRequests(tokenProps: IModelRpcProps, contentIds: TileTreeContentIds[]): Promise<void> {\n return cancelTileContentRequests(tokenProps, contentIds);\n }\n public async cancelElementGraphicsRequests(key: string, requestIds: string[]): Promise<void> {\n return IModelDb.findByKey(key)[_nativeDb].cancelElementGraphicsRequests(requestIds);\n }\n public async openBriefcase(args: OpenBriefcaseProps): Promise<BriefcaseConnectionProps> {\n const db = await BriefcaseDb.open(args);\n return db.toJSON();\n }\n public async openCheckpoint(checkpoint: OpenCheckpointArgs): Promise<IModelConnectionProps> {\n return (await SnapshotDb.openCheckpoint(checkpoint)).getConnectionProps();\n }\n public async openStandalone(filePath: string, openMode: OpenMode, opts?: StandaloneOpenOptions): Promise<IModelConnectionProps> {\n return StandaloneDb.openFile(filePath, openMode, opts).getConnectionProps();\n }\n public async openSnapshot(filePath: string, opts?: SnapshotOpenOptions): Promise<IModelConnectionProps> {\n let resolvedFileName: string | undefined = filePath;\n if (IModelHost.snapshotFileNameResolver) { // eslint-disable-line @typescript-eslint/no-deprecated\n resolvedFileName = IModelHost.snapshotFileNameResolver.tryResolveFileName(filePath); // eslint-disable-line @typescript-eslint/no-deprecated\n if (!resolvedFileName)\n throw new IModelNotFoundResponse(); // eslint-disable-line @typescript-eslint/only-throw-error\n }\n return SnapshotDb.openFile(resolvedFileName, opts).getConnectionProps();\n }\n public async closeIModel(key: string): Promise<void> {\n IModelDb.findByKey(key).close();\n }\n public async saveChanges(key: string, description?: string): Promise<void> {\n IModelDb.findByKey(key)[_implicitTxn].saveChanges(description);\n }\n public async abandonChanges(key: string): Promise<void> {\n IModelDb.findByKey(key)[_implicitTxn].abandonChanges();\n }\n public async hasPendingTxns(key: string): Promise<boolean> {\n return IModelDb.findByKey(key)[_nativeDb].hasPendingTxns();\n }\n\n public async isUndoPossible(key: string): Promise<boolean> {\n return IModelDb.findByKey(key)[_nativeDb].isUndoPossible();\n }\n public async isRedoPossible(key: string): Promise<boolean> {\n return IModelDb.findByKey(key)[_nativeDb].isRedoPossible();\n }\n public async getUndoString(key: string): Promise<string> {\n return IModelDb.findByKey(key)[_nativeDb].getUndoString();\n }\n public async getRedoString(key: string): Promise<string> {\n return IModelDb.findByKey(key)[_nativeDb].getRedoString();\n }\n\n public async pullChanges(key: string, toIndex?: ChangesetIndex, options?: PullChangesOptions): Promise<ChangesetIndexAndId> {\n const iModelDb = BriefcaseDb.findByKey(key);\n\n this._iModelKeyToPullStatus.set(key, ProgressStatus.Continue);\n const checkAbort = () => this._iModelKeyToPullStatus.get(key) ?? ProgressStatus.Continue;\n\n let onProgress: ProgressFunction | undefined;\n if (options?.reportProgress) {\n const progressCallback: ProgressFunction = (loaded, total) => {\n IpcHost.send(getPullChangesIpcChannel(iModelDb.iModelId), { loaded, total });\n return checkAbort();\n };\n onProgress = throttleProgressCallback(progressCallback, checkAbort, options?.progressInterval);\n } else if (options?.enableCancellation) {\n onProgress = checkAbort;\n }\n\n try {\n await iModelDb.pullChanges({ toIndex, onProgress });\n } finally {\n this._iModelKeyToPullStatus.delete(key);\n }\n\n return iModelDb.changeset as ChangesetIndexAndId;\n }\n public async cancelPullChangesRequest(key: string): Promise<void> {\n this._iModelKeyToPullStatus.set(key, ProgressStatus.Abort);\n }\n\n public async pushChanges(key: string, description: string): Promise<ChangesetIndexAndId> {\n const iModelDb = BriefcaseDb.findByKey(key);\n await iModelDb.pushChanges({ description });\n return iModelDb.changeset as ChangesetIndexAndId;\n }\n\n public async toggleGraphicalEditingScope(key: string, startSession: boolean): Promise<boolean> {\n const val: IModelJsNative.ErrorStatusOrResult<any, boolean> = IModelDb.findByKey(key)[_nativeDb].setGeometricModelTrackingEnabled(startSession);\n if (val.error)\n throw new IModelError(val.error.status, \"Failed to toggle graphical editing scope\");\n assert(undefined !== val.result);\n return val.result;\n }\n public async isGraphicalEditingSupported(key: string): Promise<boolean> {\n return IModelDb.findByKey(key)[_nativeDb].isGeometricModelTrackingSupported();\n }\n\n public async reverseTxns(key: string, numOperations: number): Promise<IModelStatus> {\n return BriefcaseDb.findByKey(key).txns.reverseTxns(numOperations);\n }\n\n public async reverseTxnsAsync(key: string, numOperations: number, args?: ReverseTxnArgs): Promise<void> {\n return BriefcaseDb.findByKey(key).txns.reverseTxnsAsync(numOperations, args);\n }\n\n public async reverseAllTxn(key: string): Promise<IModelStatus> {\n return BriefcaseDb.findByKey(key).txns.reverseAll();\n }\n\n public async reverseAllTxnsAsync(key: string, args?: ReverseTxnArgs): Promise<void> {\n return BriefcaseDb.findByKey(key).txns.reverseAllTxnsAsync(args);\n }\n\n public async reinstateTxn(key: string): Promise<IModelStatus> {\n return BriefcaseDb.findByKey(key).txns.reinstateTxn();\n }\n\n public async reinstateTxnAsync(key: string, args?: ReinstateTxnArgs): Promise<void> {\n return BriefcaseDb.findByKey(key).txns.reinstateTxnAsync(args);\n }\n\n public async restartTxnSession(key: string): Promise<void> {\n return IModelDb.findByKey(key).restartTxnSession();\n }\n\n public async queryConcurrency(pool: \"io\" | \"cpu\"): Promise<number> {\n return IModelNative.platform.queryConcurrency(pool);\n }\n}\n\n/**\n * Prevents progress callback being called more frequently when provided interval.\n * @internal\n */\nexport function throttleProgressCallback(func: ProgressFunction, checkAbort: () => ProgressStatus, progressInterval?: number): ProgressFunction {\n const interval = progressInterval ?? 250; // by default, only send progress events every 250 milliseconds\n let nextTime = Date.now() + interval;\n const progressCallback: ProgressFunction = (loaded, total) => {\n const now = Date.now();\n if (loaded >= total || now >= nextTime) {\n nextTime = now + interval;\n return func(loaded, total);\n }\n return checkAbort();\n };\n\n return progressCallback;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IpcHost.js","sourceRoot":"","sources":["../../src/IpcHost.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAY,MAAM,qBAAqB,CAAC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,KAAK,CAAC,iBAAiB,CAAC,GAAW,EAAE,IAAuB;QACjE,OAAO,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACjE,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAAC,GAAW;QACxC,OAAO,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,iBAAiB,EAAE,CAAC;IACrD,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,IAAkB;QAC9C,OAAO,YAAY,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAsB,EAAE,UAAgC,EAAE,gBAAyB;IAC1H,MAAM,QAAQ,GAAG,gBAAgB,IAAI,GAAG,CAAC,CAAC,+DAA+D;IACzG,IAAI,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,CAAC;IACrC,MAAM,gBAAgB,GAAqB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;QAC3D,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,IAAI,MAAM,IAAI,KAAK,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;YACvC,QAAQ,GAAG,GAAG,GAAG,QAAQ,CAAC;YAC1B,OAAO,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO,UAAU,EAAE,CAAC;IACtB,CAAC,CAAC;IAEF,OAAO,gBAAgB,CAAC;AAC1B,CAAC","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 NativeApp\n */\n\nimport { IModelJsNative } from \"@bentley/imodeljs-native\";\nimport { assert, BentleyError, IModelStatus, JsonUtils, Logger, LogLevel, OpenMode } from \"@itwin/core-bentley\";\nimport {\n BriefcaseConnectionProps,\n ChangesetIndex, ChangesetIndexAndId, EditingScopeNotifications, getPullChangesIpcChannel, IModelConnectionProps, IModelError, IModelNotFoundResponse, IModelRpcProps,\n ipcAppChannels, IpcAppFunctions, IpcAppNotifications, IpcInvokeReturn, IpcListener, IpcSocketBackend, iTwinChannel,\n OpenBriefcaseProps, OpenCheckpointArgs, PullChangesOptions, ReinstateTxnArgs, RemoveFunction, ReverseTxnArgs, SnapshotOpenOptions,\n StandaloneOpenOptions, TileTreeContentIds, TxnNotifications,\n} from \"@itwin/core-common\";\nimport { ProgressFunction, ProgressStatus } from \"./CheckpointManager\";\nimport { BriefcaseDb, IModelDb, SnapshotDb, StandaloneDb } from \"./IModelDb\";\nimport { IModelHost, IModelHostOptions } from \"./IModelHost\";\nimport { IModelNative } from \"./internal/NativePlatform\";\nimport { _implicitTxn, _nativeDb } from \"./internal/Symbols\";\nimport { cancelTileContentRequests } from \"./rpc-impl/IModelTileRpcImpl\";\n\n/**\n * Options for [[IpcHost.startup]]\n * @public\n */\nexport interface IpcHostOpts {\n iModelHost?: IModelHostOptions;\n ipcHost?: {\n /** The Ipc socket to use for communications with frontend. Allows undefined only for headless tests. */\n socket?: IpcSocketBackend;\n\n /** don't send stack information on exceptions */\n exceptions?: {\n noStack?: boolean;\n };\n };\n}\n\n/**\n * Used by applications that have a dedicated backend. IpcHosts may send messages to their corresponding IpcApp.\n * @note if either end terminates, the other must too.\n * @public\n */\nexport class IpcHost {\n public static noStack = false;\n private static _ipc: IpcSocketBackend | undefined;\n /** Get the implementation of the [IpcSocketBackend]($common) interface. */\n private static get ipc(): IpcSocketBackend { return this._ipc!; } // eslint-disable-line @typescript-eslint/no-non-null-assertion\n /** Determine whether Ipc is available for this backend. This will only be true if [[startup]] has been called on this class. */\n public static get isValid(): boolean { return undefined !== this._ipc; }\n\n /**\n * Send a message to the frontend over an Ipc channel.\n * @param channel the name of the channel matching the name registered with [[IpcApp.addListener]].\n * @param data The content of the message.\n */\n public static send(channel: string, ...data: any[]): void {\n this.ipc.send(iTwinChannel(channel), ...data);\n }\n\n /**\n * Establish a handler for an Ipc channel to receive [[Frontend.invoke]] calls\n * @param channel The name of the channel for this handler.\n * @param handler A function that supplies the implementation for `channel`\n * @note returns A function to call to remove the handler.\n */\n public static handle(channel: string, handler: (...args: any[]) => Promise<any>): RemoveFunction {\n return this.ipc.handle(iTwinChannel(channel), handler);\n }\n /**\n * Establish a handler to receive messages sent via [[IpcApp.send]].\n * @param channel The name of the channel for the messages.\n * @param listener A function called when messages are sent over `channel`\n * @note returns A function to call to remove the listener.\n */\n public static addListener(channel: string, listener: IpcListener): RemoveFunction {\n return this.ipc.addListener(iTwinChannel(channel), listener);\n }\n /**\n * Remove a previously registered listener\n * @param channel The name of the channel for the listener previously registered with [[addListener]]\n * @param listener The function passed to [[addListener]]\n */\n public static removeListener(channel: string, listener: IpcListener): void {\n this.ipc.removeListener(iTwinChannel(channel), listener);\n }\n\n private static notify(channel: string, briefcase: BriefcaseDb | StandaloneDb, methodName: string, ...args: any[]) {\n if (this.isValid)\n return this.send(`${channel}/${briefcase.key}`, methodName, ...args);\n }\n\n /** @internal */\n public static notifyIpcFrontend<T extends keyof IpcAppNotifications>(methodName: T, ...args: Parameters<IpcAppNotifications[T]>) {\n return IpcHost.send(ipcAppChannels.appNotify, methodName, ...args);\n }\n\n /** @internal */\n public static notifyTxns<T extends keyof TxnNotifications>(briefcase: BriefcaseDb | StandaloneDb, methodName: T, ...args: Parameters<TxnNotifications[T]>) {\n this.notify(ipcAppChannels.txns, briefcase, methodName, ...args);\n }\n\n /** @internal */\n public static notifyEditingScope<T extends keyof EditingScopeNotifications>(briefcase: BriefcaseDb | StandaloneDb, methodName: T, ...args: Parameters<EditingScopeNotifications[T]>) {\n this.notify(ipcAppChannels.editingScope, briefcase, methodName, ...args);\n }\n\n /**\n * Start the backend of an Ipc app.\n * @param opt\n * @note this method calls [[IModelHost.startup]] internally.\n */\n public static async startup(opt?: IpcHostOpts): Promise<void> {\n this._ipc = opt?.ipcHost?.socket;\n if (opt?.ipcHost?.exceptions?.noStack)\n this.noStack = true;\n\n if (this.isValid) { // for tests, we use IpcHost but don't have a frontend\n IpcAppHandler.register();\n }\n\n await IModelHost.startup(opt?.iModelHost);\n }\n\n /** Shutdown IpcHost backend. Also calls [[IModelHost.shutdown]] */\n public static async shutdown(): Promise<void> {\n this._ipc = undefined;\n await IModelHost.shutdown();\n }\n}\n\n/**\n * Base class for all implementations of an Ipc interface.\n *\n * Create a subclass to implement your Ipc interface. Your class should be declared like this:\n * ```ts\n * class MyHandler extends IpcHandler implements MyInterface\n * ```\n * to ensure all methods and signatures are correct.\n *\n * Then, call `MyClass.register` at startup to connect your class to your channel.\n * @public\n */\nexport abstract class IpcHandler {\n /**\n * All subclasses *must* implement this method to specify their channel name.\n *\n * Channel names are the key that connects Handlers and senders. The channel name of IpcHandlers must exactly match the name used by senders.\n * By convention, channel names should be prefixed by a *namespace* (e.g. `${appName}/`)\n * unique enough to disambiguate them from channels for other apps that may be running in the same processes.\n */\n public abstract get channelName(): string;\n\n /**\n * Register this class as the handler for methods on its channel. This static method creates a new instance\n * that becomes the handler and is `this` when its methods are called.\n * @returns A function that can be called to remove the handler.\n * @note this method should only be called once per channel. If it is called multiple times, subsequent calls replace the previous ones.\n */\n public static register(): RemoveFunction {\n const impl = new (this as any)() as IpcHandler; // create an instance of subclass. \"as any\" is necessary because base class is abstract\n const prohibitedFunctions = Object.getOwnPropertyNames(Object.getPrototypeOf({}));\n\n return IpcHost.handle(impl.channelName, async (_evt: Event, funcName: string, ...args: any[]): Promise<IpcInvokeReturn> => {\n try {\n if (prohibitedFunctions.includes(funcName))\n throw new Error(`Method \"${funcName}\" not available for channel: ${impl.channelName}`);\n\n const func = (impl as any)[funcName];\n if (typeof func !== \"function\")\n throw new IModelError(IModelStatus.FunctionNotFound, `Method \"${impl.constructor.name}.${funcName}\" not found on IpcHandler registered for channel: ${impl.channelName}`);\n\n return { result: await func.call(impl, ...args) };\n } catch (err: unknown) {\n\n if (!JsonUtils.isObject(err)) // if the exception isn't an object, just forward it\n return { error: err };\n\n const serializeError = (e: any, includeStack: boolean, visited = new WeakSet<object>()): any => {\n if (visited.has(e))\n return undefined;\n visited.add(e);\n try {\n const serialized: any = { ...e };\n\n for (const sym of Object.getOwnPropertySymbols(serialized))\n delete serialized[sym]; // symbol-keyed properties cannot be structured-cloned\n\n if (e instanceof Error) {\n serialized.message = e.message; // NB: .message and .stack are non-enumerable on Error instances\n if (includeStack)\n serialized.stack = e.stack;\n\n // Error.cause is typically non-enumerable and must be copied explicitly.\n if (Object.prototype.hasOwnProperty.call(e, \"cause\"))\n serialized.cause = (e as { cause?: unknown }).cause;\n }\n\n if (e instanceof BentleyError) {\n serialized.iTwinErrorId = e.iTwinErrorId;\n if (e.hasMetaData)\n serialized.loggingMetadata = e.loggingMetadata;\n delete serialized._metaData;\n }\n\n // Only recurse into Error instances and plain objects — not class instances like Date or Buffer.\n const shouldRecurse = (val: any) => val instanceof Error || (JsonUtils.isObject(val) && Object.getPrototypeOf(val) === Object.prototype);\n const isSerializableLeaf = (val: unknown): boolean => {\n const t = typeof val;\n return val === null || val === undefined || val instanceof Date\n || t === \"string\" || t === \"number\" || t === \"boolean\";\n };\n for (const key of Object.keys(serialized)) {\n const val = serialized[key];\n if (Array.isArray(val))\n serialized[key] = val.map((item) => shouldRecurse(item) ? serializeError(item, includeStack, visited) : isSerializableLeaf(item) ? item : undefined);\n else if (shouldRecurse(val))\n serialized[key] = serializeError(val, includeStack, visited);\n else if (!isSerializableLeaf(val))\n delete serialized[key]; // strip non-cloneable values (functions, class instances, etc.)\n }\n\n return serialized;\n } finally {\n // Remove from the stack so a sibling branch can still serialize this object.\n visited.delete(e);\n }\n };\n\n return { error: serializeError(err, !IpcHost.noStack) };\n }\n });\n }\n}\n\n/**\n * Implementation of IpcAppFunctions\n */\nclass IpcAppHandler extends IpcHandler implements IpcAppFunctions {\n public get channelName() { return ipcAppChannels.functions; }\n\n private _iModelKeyToPullStatus = new Map<string, ProgressStatus>();\n\n public async log(_timestamp: number, level: LogLevel, category: string, message: string, metaData?: any): Promise<void> {\n switch (level) {\n case LogLevel.Error:\n Logger.logError(category, message, metaData);\n break;\n case LogLevel.Info:\n Logger.logInfo(category, message, metaData);\n break;\n case LogLevel.Trace:\n Logger.logTrace(category, message, metaData);\n break;\n case LogLevel.Warning:\n Logger.logWarning(category, message, metaData);\n break;\n }\n }\n\n public async cancelTileContentRequests(tokenProps: IModelRpcProps, contentIds: TileTreeContentIds[]): Promise<void> {\n return cancelTileContentRequests(tokenProps, contentIds);\n }\n public async cancelElementGraphicsRequests(key: string, requestIds: string[]): Promise<void> {\n return IModelDb.findByKey(key)[_nativeDb].cancelElementGraphicsRequests(requestIds);\n }\n public async openBriefcase(args: OpenBriefcaseProps): Promise<BriefcaseConnectionProps> {\n const db = await BriefcaseDb.open(args);\n return db.toJSON();\n }\n public async openCheckpoint(checkpoint: OpenCheckpointArgs): Promise<IModelConnectionProps> {\n return (await SnapshotDb.openCheckpoint(checkpoint)).getConnectionProps();\n }\n public async openStandalone(filePath: string, openMode: OpenMode, opts?: StandaloneOpenOptions): Promise<IModelConnectionProps> {\n return StandaloneDb.openFile(filePath, openMode, opts).getConnectionProps();\n }\n public async openSnapshot(filePath: string, opts?: SnapshotOpenOptions): Promise<IModelConnectionProps> {\n let resolvedFileName: string | undefined = filePath;\n if (IModelHost.snapshotFileNameResolver) { // eslint-disable-line @typescript-eslint/no-deprecated\n resolvedFileName = IModelHost.snapshotFileNameResolver.tryResolveFileName(filePath); // eslint-disable-line @typescript-eslint/no-deprecated\n if (!resolvedFileName)\n throw new IModelNotFoundResponse(); // eslint-disable-line @typescript-eslint/only-throw-error\n }\n return SnapshotDb.openFile(resolvedFileName, opts).getConnectionProps();\n }\n public async closeIModel(key: string): Promise<void> {\n IModelDb.findByKey(key).close();\n }\n public async saveChanges(key: string, description?: string): Promise<void> {\n IModelDb.findByKey(key)[_implicitTxn].saveChanges(description);\n }\n public async abandonChanges(key: string): Promise<void> {\n IModelDb.findByKey(key)[_implicitTxn].abandonChanges();\n }\n public async hasPendingTxns(key: string): Promise<boolean> {\n return IModelDb.findByKey(key)[_nativeDb].hasPendingTxns();\n }\n\n public async isUndoPossible(key: string): Promise<boolean> {\n return IModelDb.findByKey(key)[_nativeDb].isUndoPossible();\n }\n public async isRedoPossible(key: string): Promise<boolean> {\n return IModelDb.findByKey(key)[_nativeDb].isRedoPossible();\n }\n public async getUndoString(key: string): Promise<string> {\n return IModelDb.findByKey(key)[_nativeDb].getUndoString();\n }\n public async getRedoString(key: string): Promise<string> {\n return IModelDb.findByKey(key)[_nativeDb].getRedoString();\n }\n\n public async pullChanges(key: string, toIndex?: ChangesetIndex, options?: PullChangesOptions): Promise<ChangesetIndexAndId> {\n const iModelDb = BriefcaseDb.findByKey(key);\n\n this._iModelKeyToPullStatus.set(key, ProgressStatus.Continue);\n const checkAbort = () => this._iModelKeyToPullStatus.get(key) ?? ProgressStatus.Continue;\n\n let onProgress: ProgressFunction | undefined;\n if (options?.reportProgress) {\n const progressCallback: ProgressFunction = (loaded, total) => {\n IpcHost.send(getPullChangesIpcChannel(iModelDb.iModelId), { loaded, total });\n return checkAbort();\n };\n onProgress = throttleProgressCallback(progressCallback, checkAbort, options?.progressInterval);\n } else if (options?.enableCancellation) {\n onProgress = checkAbort;\n }\n\n try {\n await iModelDb.pullChanges({ toIndex, onProgress });\n } finally {\n this._iModelKeyToPullStatus.delete(key);\n }\n\n return iModelDb.changeset as ChangesetIndexAndId;\n }\n public async cancelPullChangesRequest(key: string): Promise<void> {\n this._iModelKeyToPullStatus.set(key, ProgressStatus.Abort);\n }\n\n public async pushChanges(key: string, description: string): Promise<ChangesetIndexAndId> {\n const iModelDb = BriefcaseDb.findByKey(key);\n await iModelDb.pushChanges({ description });\n return iModelDb.changeset as ChangesetIndexAndId;\n }\n\n public async toggleGraphicalEditingScope(key: string, startSession: boolean): Promise<boolean> {\n const val: IModelJsNative.ErrorStatusOrResult<any, boolean> = IModelDb.findByKey(key)[_nativeDb].setGeometricModelTrackingEnabled(startSession);\n if (val.error)\n throw new IModelError(val.error.status, \"Failed to toggle graphical editing scope\");\n assert(undefined !== val.result);\n return val.result;\n }\n public async isGraphicalEditingSupported(key: string): Promise<boolean> {\n return IModelDb.findByKey(key)[_nativeDb].isGeometricModelTrackingSupported();\n }\n\n public async reverseTxns(key: string, numOperations: number): Promise<IModelStatus> {\n return BriefcaseDb.findByKey(key).txns.reverseTxns(numOperations);\n }\n\n public async reverseTxnsAsync(key: string, numOperations: number, args?: ReverseTxnArgs): Promise<void> {\n return BriefcaseDb.findByKey(key).txns.reverseTxnsAsync(numOperations, args);\n }\n\n public async reverseAllTxn(key: string): Promise<IModelStatus> {\n return BriefcaseDb.findByKey(key).txns.reverseAll();\n }\n\n public async reverseAllTxnsAsync(key: string, args?: ReverseTxnArgs): Promise<void> {\n return BriefcaseDb.findByKey(key).txns.reverseAllTxnsAsync(args);\n }\n\n public async reinstateTxn(key: string): Promise<IModelStatus> {\n return BriefcaseDb.findByKey(key).txns.reinstateTxn();\n }\n\n public async reinstateTxnAsync(key: string, args?: ReinstateTxnArgs): Promise<void> {\n return BriefcaseDb.findByKey(key).txns.reinstateTxnAsync(args);\n }\n\n public async restartTxnSession(key: string): Promise<void> {\n return IModelDb.findByKey(key).restartTxnSession();\n }\n\n public async queryConcurrency(pool: \"io\" | \"cpu\"): Promise<number> {\n return IModelNative.platform.queryConcurrency(pool);\n }\n}\n\n/**\n * Prevents progress callback being called more frequently when provided interval.\n * @internal\n */\nexport function throttleProgressCallback(func: ProgressFunction, checkAbort: () => ProgressStatus, progressInterval?: number): ProgressFunction {\n const interval = progressInterval ?? 250; // by default, only send progress events every 250 milliseconds\n let nextTime = Date.now() + interval;\n const progressCallback: ProgressFunction = (loaded, total) => {\n const now = Date.now();\n if (loaded >= total || now >= nextTime) {\n nextTime = now + interval;\n return func(loaded, total);\n }\n return checkAbort();\n };\n\n return progressCallback;\n}\n"]}
|
package/lib/esm/Model.d.ts
CHANGED
|
@@ -35,6 +35,26 @@ export interface OnElementInModelPropsArg extends OnModelIdArg {
|
|
|
35
35
|
/** The new properties of an Element for the affected Model */
|
|
36
36
|
elementProps: Readonly<ElementProps>;
|
|
37
37
|
}
|
|
38
|
+
/** Per-model element deletion data used inside [[OnBulkModelEventsArg]].
|
|
39
|
+
* @beta
|
|
40
|
+
*/
|
|
41
|
+
export interface OnBulkDeletedElementsArg extends OnModelIdArg {
|
|
42
|
+
/** The Ids of all Elements that were bulk-deleted from this Model instance. */
|
|
43
|
+
elementIds: Id64String[];
|
|
44
|
+
}
|
|
45
|
+
/** Argument for the `Model.onBulkModelEvents` static method.
|
|
46
|
+
* Passed once per distinct Model ECClass, combining both deleted sub-models and
|
|
47
|
+
* deleted-elements-by-model into a single callback.
|
|
48
|
+
* @beta
|
|
49
|
+
*/
|
|
50
|
+
export interface OnBulkModelEventsArg extends OnModelArg {
|
|
51
|
+
/** Ids of Models of this class that were deleted as sub-models. Present only if any sub-models
|
|
52
|
+
* of this class were deleted. */
|
|
53
|
+
deletedModelIds?: Id64String[];
|
|
54
|
+
/** Per-model lists of element Ids deleted from instances of this Model class. Present only if
|
|
55
|
+
* any elements were deleted from models of this class. */
|
|
56
|
+
deletedElementsByModel?: OnBulkDeletedElementsArg[];
|
|
57
|
+
}
|
|
38
58
|
/** Argument for the `Model.onXxxElement` static methods that supply the Id of an Element for a Model.
|
|
39
59
|
* @beta
|
|
40
60
|
*/
|
|
@@ -118,6 +138,20 @@ export declare class Model extends Entity {
|
|
|
118
138
|
* @beta
|
|
119
139
|
*/
|
|
120
140
|
protected static onDeleted(arg: OnModelIdArg): void;
|
|
141
|
+
/** Called once per distinct Model ECClass after a bulk element delete operation, combining
|
|
142
|
+
* both sub-model deletions and element-deletions-by-model into a single callback.
|
|
143
|
+
*
|
|
144
|
+
* `arg.deletedModelIds` — present when models of this class were deleted as sub-model roots.
|
|
145
|
+
* The default implementation calls [[onDeleted]] for each.
|
|
146
|
+
*
|
|
147
|
+
* `arg.deletedElementsByModel` — present when elements were deleted from models of this class.
|
|
148
|
+
* The default implementation calls [[onDeleteElement]] and [[onDeletedElement]] for each element.
|
|
149
|
+
*
|
|
150
|
+
* @note If you override this method, you must call super.
|
|
151
|
+
* @note `this` is the Model class dispatched on.
|
|
152
|
+
* @beta
|
|
153
|
+
*/
|
|
154
|
+
protected static onBulkModelEvents(arg: OnBulkModelEventsArg): void;
|
|
121
155
|
/** Called before a prospective Element is to be inserted into an instance of a Model of this class.
|
|
122
156
|
* @note throw an exception to disallow the insert
|
|
123
157
|
* @note If you override this method, you must call super.
|
package/lib/esm/Model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Model.d.ts","sourceRoot":"","sources":["../../src/Model.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAa,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAW,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,gBAAgB,EAAE,YAAY,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EACnF,UAAU,EAAE,cAAc,EAC7D,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,yCAAyC;IACzC,MAAM,EAAE,QAAQ,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,gDAAgD;IAChD,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,CA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Ae;IAClD,WAA2B,SAAS,IAAI,MAAM,CAA8B;CAC7E;AAED;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,gBAAgB;IACrD,WAA2B,SAAS,IAAI,MAAM,CAAgC;IAE9E;;;;;;;OAOG;WACW,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU;WAC3E,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU;CAchG;AAED;;;GAGG;AACH,qBAAa,SAAU,SAAQ,gBAAgB;IAC7C,WAA2B,SAAS,IAAI,MAAM,CAAwB;CACvE;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,eAAe;IAClD,WAA2B,SAAS,IAAI,MAAM,CAA8B;CAC7E;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,WAA2B,SAAS,IAAI,MAAM,CAA+B;CAC9E"}
|
package/lib/esm/Model.js
CHANGED
|
@@ -145,6 +145,30 @@ export class Model extends Entity {
|
|
|
145
145
|
arg.iModel.models[_cache].delete(arg.id);
|
|
146
146
|
arg.iModel.elements[_cache].deleteWithModel(arg.id);
|
|
147
147
|
}
|
|
148
|
+
/** Called once per distinct Model ECClass after a bulk element delete operation, combining
|
|
149
|
+
* both sub-model deletions and element-deletions-by-model into a single callback.
|
|
150
|
+
*
|
|
151
|
+
* `arg.deletedModelIds` — present when models of this class were deleted as sub-model roots.
|
|
152
|
+
* The default implementation calls [[onDeleted]] for each.
|
|
153
|
+
*
|
|
154
|
+
* `arg.deletedElementsByModel` — present when elements were deleted from models of this class.
|
|
155
|
+
* The default implementation calls [[onDeleteElement]] and [[onDeletedElement]] for each element.
|
|
156
|
+
*
|
|
157
|
+
* @note If you override this method, you must call super.
|
|
158
|
+
* @note `this` is the Model class dispatched on.
|
|
159
|
+
* @beta
|
|
160
|
+
*/
|
|
161
|
+
static onBulkModelEvents(arg) {
|
|
162
|
+
if (arg.deletedModelIds !== undefined)
|
|
163
|
+
for (const id of arg.deletedModelIds)
|
|
164
|
+
this.onDeleted({ iModel: arg.iModel, id });
|
|
165
|
+
if (arg.deletedElementsByModel !== undefined)
|
|
166
|
+
for (const entry of arg.deletedElementsByModel)
|
|
167
|
+
for (const elementId of entry.elementIds) {
|
|
168
|
+
this.onDeleteElement({ iModel: arg.iModel, id: entry.id, elementId });
|
|
169
|
+
this.onDeletedElement({ iModel: arg.iModel, id: entry.id, elementId });
|
|
170
|
+
}
|
|
171
|
+
}
|
|
148
172
|
/** Called before a prospective Element is to be inserted into an instance of a Model of this class.
|
|
149
173
|
* @note throw an exception to disallow the insert
|
|
150
174
|
* @note If you override this method, you must call super.
|