@itwin/core-backend 5.10.0-dev.1 → 5.10.0-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -1
- package/lib/cjs/BriefcaseManager.d.ts +17 -59
- package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
- package/lib/cjs/BriefcaseManager.js +45 -162
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/Category.d.ts +4 -4
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts +6 -6
- package/lib/cjs/ChangesetECAdaptor.js +4 -4
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/CodeSpecs.d.ts +3 -3
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +2 -2
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/Element.d.ts +10 -10
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +2 -2
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +1 -1
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.d.ts +5 -5
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/ExternalSource.d.ts +2 -2
- package/lib/cjs/ExternalSource.d.ts.map +1 -1
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +22 -22
- package/lib/cjs/IModelDb.js +20 -20
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelJsFs.d.ts +2 -0
- package/lib/cjs/IModelJsFs.d.ts.map +1 -1
- package/lib/cjs/IModelJsFs.js +14 -0
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/LineStyle.d.ts +6 -6
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/Material.d.ts +1 -1
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.d.ts +6 -6
- package/lib/cjs/Model.d.ts.map +1 -1
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/Relationship.d.ts +10 -10
- package/lib/cjs/Relationship.js +6 -6
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/SheetIndex.d.ts +4 -4
- package/lib/cjs/SheetIndex.d.ts.map +1 -1
- package/lib/cjs/SheetIndex.js.map +1 -1
- package/lib/cjs/Texture.d.ts +1 -1
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +3 -0
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +95 -13
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +6 -6
- package/lib/cjs/ViewDefinition.d.ts.map +1 -1
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.d.ts +1 -1
- package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -1
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/domains/GenericElements.d.ts +2 -2
- package/lib/cjs/domains/GenericElements.d.ts.map +1 -1
- package/lib/cjs/domains/GenericElements.js.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.d.ts +2 -2
- package/lib/cjs/internal/ChannelAdmin.d.ts.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
- package/lib/esm/BriefcaseManager.d.ts +17 -59
- package/lib/esm/BriefcaseManager.d.ts.map +1 -1
- package/lib/esm/BriefcaseManager.js +46 -163
- package/lib/esm/BriefcaseManager.js.map +1 -1
- package/lib/esm/Category.d.ts +4 -4
- package/lib/esm/Category.js.map +1 -1
- package/lib/esm/ChangesetECAdaptor.d.ts +6 -6
- package/lib/esm/ChangesetECAdaptor.js +4 -4
- package/lib/esm/ChangesetECAdaptor.js.map +1 -1
- package/lib/esm/CodeSpecs.d.ts +3 -3
- package/lib/esm/CodeSpecs.js.map +1 -1
- package/lib/esm/DisplayStyle.d.ts +2 -2
- package/lib/esm/DisplayStyle.js.map +1 -1
- package/lib/esm/Element.d.ts +10 -10
- package/lib/esm/Element.d.ts.map +1 -1
- package/lib/esm/Element.js +2 -2
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/ElementAspect.d.ts +1 -1
- package/lib/esm/ElementAspect.js.map +1 -1
- package/lib/esm/ElementTreeWalker.d.ts +5 -5
- package/lib/esm/ElementTreeWalker.js.map +1 -1
- package/lib/esm/ExternalSource.d.ts +2 -2
- package/lib/esm/ExternalSource.d.ts.map +1 -1
- package/lib/esm/ExternalSource.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +22 -22
- package/lib/esm/IModelDb.js +20 -20
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/IModelJsFs.d.ts +2 -0
- package/lib/esm/IModelJsFs.d.ts.map +1 -1
- package/lib/esm/IModelJsFs.js +14 -0
- package/lib/esm/IModelJsFs.js.map +1 -1
- package/lib/esm/LineStyle.d.ts +6 -6
- package/lib/esm/LineStyle.js.map +1 -1
- package/lib/esm/Material.d.ts +1 -1
- package/lib/esm/Material.js.map +1 -1
- package/lib/esm/Model.d.ts +6 -6
- package/lib/esm/Model.d.ts.map +1 -1
- package/lib/esm/Model.js.map +1 -1
- package/lib/esm/Relationship.d.ts +10 -10
- package/lib/esm/Relationship.js +6 -6
- package/lib/esm/Relationship.js.map +1 -1
- package/lib/esm/SheetIndex.d.ts +4 -4
- package/lib/esm/SheetIndex.d.ts.map +1 -1
- package/lib/esm/SheetIndex.js.map +1 -1
- package/lib/esm/Texture.d.ts +1 -1
- package/lib/esm/Texture.js.map +1 -1
- package/lib/esm/TxnManager.d.ts +3 -0
- package/lib/esm/TxnManager.d.ts.map +1 -1
- package/lib/esm/TxnManager.js +96 -14
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/ViewDefinition.d.ts +6 -6
- package/lib/esm/ViewDefinition.d.ts.map +1 -1
- package/lib/esm/ViewDefinition.js.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/esm/domains/FunctionalElements.d.ts +1 -1
- package/lib/esm/domains/FunctionalElements.d.ts.map +1 -1
- package/lib/esm/domains/FunctionalElements.js.map +1 -1
- package/lib/esm/domains/GenericElements.d.ts +2 -2
- package/lib/esm/domains/GenericElements.d.ts.map +1 -1
- package/lib/esm/domains/GenericElements.js.map +1 -1
- package/lib/esm/internal/ChannelAdmin.d.ts +2 -2
- package/lib/esm/internal/ChannelAdmin.d.ts.map +1 -1
- package/lib/esm/internal/ChannelAdmin.js.map +1 -1
- package/lib/esm/test/hubaccess/SemanticRebase.test.js +2276 -70
- package/lib/esm/test/hubaccess/SemanticRebase.test.js.map +1 -1
- package/package.json +13 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SheetIndex.d.ts","sourceRoot":"","sources":["../../src/SheetIndex.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAe,IAAI,EAAE,cAAc,EAA0B,kBAAkB,EAAe,mBAAmB,EAAE,oBAAoB,EAAyB,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACjP,OAAO,EAAE,2BAA2B,EAAS,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAgB,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAsD,qCAAqC,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAGlK;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,0DAA0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rD,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB;YAC7C,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,OAAO,EAAE,QAAQ,CAAC,OAAO;SAC1B,CAAC;QACF,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QACrE,QAAQ,CAAC,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO,QAAQ,CAAC,EAAE,CAAC;IACrB,CAAC;IAED,aAAa;IACM,mBAAmB,CAAC,YAAgC;QACrE,KAAK,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACxC,IAAI,IAAI,CAAC,KAAK;YACZ,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACzC,CAAC;CACF;AAnED,wCAmEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Elements\r\n */\r\n\r\nimport { BisCodeSpec, Code, CodeScopeProps, CodeSpec, ElementProps, EntityReferenceSet, IModelError, RelatedElementProps, SheetIndexEntryProps, SheetIndexFolderProps, SheetIndexReferenceProps, SheetReferenceProps } from \"@itwin/core-common\";\r\nimport { InformationReferenceElement, Sheet } from \"./Element\";\r\nimport { EditTxn } from \"./EditTxn\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { SheetIndexFolderOwnsEntries, SheetIndexOwnsEntries, SheetIndexReferenceRefersToSheetIndex, SheetReferenceRefersToSheet } from \"./NavigationRelationship\";\r\nimport { _implicitTxn } from \"./internal/Symbols\";\r\n\r\n/** Arguments used to create a [[SheetIndexEntry]].\r\n * @beta\r\n */\r\nexport interface SheetIndexEntryCreateArgs {\r\n /** The iModel that will contain the sheet index entry. */\r\n iModelDb: IModelDb;\r\n /** The Id of the [[SheetIndexModel]] that will contain the sheet index entry. */\r\n sheetIndexModelId: Id64String;\r\n /** The [[SheetIndex]] or [[SheetIndexFolder]] that is parent to this SheetIndexEntry */\r\n parentId: Id64String;\r\n /** The name of the SheetIndexEntry */\r\n name: string;\r\n /** The priority of the SheetIndexEntry */\r\n priority: number;\r\n}\r\n\r\n/** Arguments supplied when creating a [[SheetIndexReference]].\r\n * @beta\r\n */\r\nexport interface SheetIndexReferenceCreateArgs extends SheetIndexEntryCreateArgs {\r\n /** The [[SheetIndex]] to which the reference refers. */\r\n sheetIndexId?: Id64String;\r\n}\r\n\r\n/** Arguments supplied when creating a [[SheetReference]].\r\n * @beta\r\n */\r\nexport interface SheetReferenceCreateArgs extends SheetIndexEntryCreateArgs {\r\n /** The [[Sheet]] to which the reference refers. */\r\n sheetId?: Id64String;\r\n}\r\n\r\n/** A [structured collection]($docs/bis/domains/drawings-sheets#sheet-index) of [[SheetIndexEntry]]s.\r\n * The sheet index is a tree whose leaf nodes refer to [[Sheet]]s, optionally grouped by [[SheetIndexFolder]]s and/or incorporating\r\n * sub-trees via [[SheetIndexReference]]s.\r\n * @beta\r\n */\r\nexport class SheetIndex extends InformationReferenceElement {\r\n public static override get className(): string { return \"SheetIndex\"; }\r\n\r\n /** Create a Code for a SheetIndex given a name that is meant to be unique within the scope of the specified SheetIndexModel.\r\n * @param iModel The IModelDb\r\n * @param scopeSheetIndexModelId The Id of the Model that contains the LinkElement and provides the scope for its name.\r\n * @param codeValue The SheetIndex name\r\n */\r\n public static createCode(iModel: IModelDb, scopeSheetIndexModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.sheetIndex);\r\n return new Code({ spec: codeSpec.id, scope: scopeSheetIndexModelId, value: codeValue });\r\n }\r\n\r\n /** Create a SheetIndex\r\n * @param iModelDb The IModelDb\r\n * @param modelId The Id of the Model that contains the SheetIndex and provides the scope for its name.\r\n * @param name The name (codeValue) of the SheetIndex\r\n * @returns The newly constructed SheetIndex\r\n * @throws [[IModelError]] if there is a problem creating the SheetIndex\r\n */\r\n public static create(iModelDb: IModelDb, modelId: Id64String, name: string): SheetIndex {\r\n const props: ElementProps = {\r\n classFullName: this.classFullName,\r\n code: this.createCode(iModelDb, modelId, name).toJSON(),\r\n model: modelId,\r\n };\r\n return new this(props, iModelDb);\r\n }\r\n\r\n /** Insert a SheetIndex\r\n * @param iModelDb The IModelDb\r\n * @param modelId The Id of the Model that contains the SheetIndex and provides the scope for its name.\r\n * @param name The name (codeValue) of the SheetIndex\r\n * @returns The Id of the newly inserted SheetIndex\r\n * @throws [[IModelError]] if there is a problem inserting the SheetIndex\r\n */\r\n public static insert(txn: EditTxn, modelId: Id64String, name: string): Id64String;\r\n /** @deprecated Use SheetIndex.insert(txn, ...) instead. */\r\n public static insert(iModelDb: IModelDb, modelId: Id64String, name: string): Id64String;\r\n public static insert(txnOrDb: EditTxn | IModelDb, modelId: Id64String, name: string): Id64String {\r\n const txn = txnOrDb instanceof EditTxn ? txnOrDb : txnOrDb[_implicitTxn];\r\n const instance = this.create(txn.iModel, modelId, name);\r\n instance.id = instance.insert(txn);\r\n return instance.id;\r\n }\r\n}\r\n\r\n/** The base class for all elements that can participate in a [[SheetIndex]] hierarchy.\r\n * @beta\r\n*/\r\nexport abstract class SheetIndexEntry extends InformationReferenceElement {\r\n public static override get className(): string { return \"SheetIndexEntry\"; }\r\n /** Can be used to prioritize or order members within a SheetIndex or SheetIndexFolder. */\r\n public entryPriority: number;\r\n\r\n protected constructor(props: SheetIndexEntryProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.entryPriority = props.entryPriority;\r\n }\r\n\r\n public override toJSON(): SheetIndexEntryProps {\r\n return { ...super.toJSON(), entryPriority: this.entryPriority };\r\n }\r\n\r\n /** Create a Code for a Sheet Index Entry given a name that is meant to be unique within the scope of the specified SheetIndexModel.\r\n * @param iModel The IModel\r\n * @param scopeModelId The Id of the [[SheetIndexModel]] that contains the [[SheetIndexEntry]] and provides the scope for its name.\r\n * @param codeValue The name of the entry\r\n */\r\n public static createCode(iModelDb: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.sheetIndexEntry);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n protected static createParentRelationshipProps(iModelDb: IModelDb, id: Id64String): RelatedElementProps {\r\n const parentElementProps = iModelDb.elements.getElementProps(id);\r\n const isFolder = parentElementProps.classFullName === SheetIndexFolder.classFullName;\r\n const relClass = isFolder ? SheetIndexFolderOwnsEntries : SheetIndexOwnsEntries;\r\n return { id, relClassName: relClass.classFullName };\r\n }\r\n\r\n protected static createProps(arg: SheetIndexEntryCreateArgs) {\r\n const parent = this.createParentRelationshipProps(arg.iModelDb, arg.parentId);\r\n const props: SheetIndexEntryProps = {\r\n classFullName: this.classFullName,\r\n model: arg.sheetIndexModelId,\r\n code: this.createCode(arg.iModelDb, arg.sheetIndexModelId, arg.name),\r\n entryPriority: arg.priority,\r\n parent,\r\n };\r\n return props;\r\n }\r\n}\r\n\r\n/** A container used to group [[SheetIndexEntry]]s within a [[SheetIndex]].\r\n * @beta\r\n */\r\nexport class SheetIndexFolder extends SheetIndexEntry {\r\n public static override get className(): string { return \"SheetIndexFolder\"; }\r\n\r\n /** Create a new SheetIndexFolder\r\n * @returns The newly constructed SheetIndexFolder element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(arg: SheetIndexEntryCreateArgs) {\r\n const props: SheetIndexFolderProps = this.createProps(arg);\r\n return new this(props, arg.iModelDb);\r\n }\r\n\r\n /** Create a new SheetIndexFolder\r\n * @returns The Id of the newly inserted SheetIndexFolder element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static insert(txn: EditTxn, arg: Omit<SheetIndexEntryCreateArgs, \"iModelDb\">): Id64String;\r\n /** @deprecated Use SheetIndexFolder.insert(txn, ...) instead. */\r\n public static insert(arg: SheetIndexEntryCreateArgs): Id64String;\r\n public static insert(txnOrArg: EditTxn | SheetIndexEntryCreateArgs, arg?: Omit<SheetIndexEntryCreateArgs, \"iModelDb\">): Id64String {\r\n const txn = txnOrArg instanceof EditTxn ? txnOrArg : txnOrArg.iModelDb[_implicitTxn];\r\n const createArg = txnOrArg instanceof EditTxn ? arg! : {\r\n sheetIndexModelId: txnOrArg.sheetIndexModelId,\r\n parentId: txnOrArg.parentId,\r\n name: txnOrArg.name,\r\n priority: txnOrArg.priority,\r\n };\r\n const instance = this.create({ ...createArg, iModelDb: txn.iModel });\r\n instance.id = instance.insert(txn);\r\n return instance.id;\r\n }\r\n}\r\n\r\n/** A node within one [[SheetIndex]] that incorporates another [[SheetIndex]] as a sub-tree.\r\n * @beta\r\n*/\r\nexport class SheetIndexReference extends SheetIndexEntry {\r\n public static override get className(): string { return \"SheetIndexReference\"; }\r\n\r\n /** The bis:SheetIndex that this bis:SheetIndexReference is pointing to. */\r\n public sheetIndex?: SheetIndexReferenceRefersToSheetIndex;\r\n\r\n protected constructor(props: SheetIndexReferenceProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n if (props.sheetIndex) {\r\n const sheetIndex = iModel.elements.tryGetElement<SheetIndex>(props.sheetIndex.id);\r\n if (!sheetIndex)\r\n throw new IModelError(IModelStatus.NotFound, \"SheetIndex not found\");\r\n\r\n this.sheetIndex = new SheetIndexReferenceRefersToSheetIndex(props.sheetIndex.id);\r\n }\r\n }\r\n\r\n protected static createReferenceRelationshipProps(id: Id64String): RelatedElementProps {\r\n return { id, relClassName: SheetIndexReferenceRefersToSheetIndex.classFullName };\r\n }\r\n\r\n public override toJSON(): SheetIndexReferenceProps { // This override only specializes the return type\r\n return {\r\n ...super.toJSON(),\r\n sheetIndex: this.sheetIndex ? this.sheetIndex.toJSON() : undefined,\r\n };\r\n }\r\n\r\n /** Create a new SheetIndexReference\r\n * @returns The newly constructed SheetIndexReference element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(arg: SheetIndexReferenceCreateArgs) {\r\n const props: SheetIndexReferenceProps = {\r\n ...this.createProps(arg),\r\n sheetIndex: arg.sheetIndexId ? this.createReferenceRelationshipProps(arg.sheetIndexId) : undefined,\r\n };\r\n return new this(props, arg.iModelDb);\r\n }\r\n\r\n /** Create a new SheetIndexReference\r\n * @returns The Id of the newly inserted SheetIndexReference element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static insert(txn: EditTxn, arg: Omit<SheetIndexReferenceCreateArgs, \"iModelDb\">): Id64String;\r\n /** @deprecated Use SheetIndexReference.insert(txn, ...) instead. */\r\n public static insert(arg: SheetIndexReferenceCreateArgs): Id64String;\r\n public static insert(txnOrArg: EditTxn | SheetIndexReferenceCreateArgs, arg?: Omit<SheetIndexReferenceCreateArgs, \"iModelDb\">): Id64String {\r\n const txn = txnOrArg instanceof EditTxn ? txnOrArg : txnOrArg.iModelDb[_implicitTxn];\r\n const createArg = txnOrArg instanceof EditTxn ? arg! : {\r\n sheetIndexModelId: txnOrArg.sheetIndexModelId,\r\n parentId: txnOrArg.parentId,\r\n name: txnOrArg.name,\r\n priority: txnOrArg.priority,\r\n sheetIndexId: txnOrArg.sheetIndexId,\r\n };\r\n const instance = this.create({ ...createArg, iModelDb: txn.iModel });\r\n instance.id = instance.insert(txn);\r\n return instance.id;\r\n }\r\n\r\n /** @alpha */\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (this.sheetIndex)\r\n referenceIds.addElement(this.sheetIndex.id);\r\n }\r\n}\r\n\r\n/** A leaf node in a [[SheetIndex]] that refers to a specific [[Sheet]].\r\n * @beta\r\n*/\r\nexport class SheetReference extends SheetIndexEntry {\r\n public static override get className(): string { return \"SheetReference\"; }\r\n\r\n /** The bis:Sheet that this bis:SheetReference is pointing to. */\r\n public sheet: SheetReferenceRefersToSheet | undefined;\r\n\r\n protected constructor(props: SheetReferenceProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n if (props.sheet) {\r\n const sheet = iModel.elements.tryGetElement<Sheet>(props.sheet.id);\r\n if (!sheet)\r\n throw new IModelError(IModelStatus.NotFound, \"Sheet not found\");\r\n\r\n this.sheet = new SheetReferenceRefersToSheet(sheet.id);\r\n }\r\n }\r\n\r\n protected static createReferenceRelationshipProps(id: Id64String): RelatedElementProps {\r\n return { id, relClassName: SheetIndexReferenceRefersToSheetIndex.classFullName };\r\n }\r\n\r\n public override toJSON(): SheetReferenceProps { // This override only specializes the return type\r\n return {\r\n ...super.toJSON(),\r\n sheet: this.sheet ? this.sheet.toJSON() : undefined,\r\n };\r\n }\r\n\r\n /** Create a new SheetReference\r\n * @returns The newly constructed SheetReference element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(arg: SheetReferenceCreateArgs) {\r\n const props: SheetReferenceProps = {\r\n ...this.createProps(arg),\r\n sheet: arg.sheetId ? this.createReferenceRelationshipProps(arg.sheetId) : undefined,\r\n };\r\n return new this(props, arg.iModelDb);\r\n }\r\n\r\n /** Insert a new SheetReference\r\n * @returns The Id of the newly inserted SheetReference element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static insert(txn: EditTxn, arg: Omit<SheetReferenceCreateArgs, \"iModelDb\">): Id64String;\r\n /** @deprecated Use SheetReference.insert(txn, ...) instead. */\r\n public static insert(arg: SheetReferenceCreateArgs): Id64String;\r\n public static insert(txnOrArg: EditTxn | SheetReferenceCreateArgs, arg?: Omit<SheetReferenceCreateArgs, \"iModelDb\">): Id64String {\r\n const txn = txnOrArg instanceof EditTxn ? txnOrArg : txnOrArg.iModelDb[_implicitTxn];\r\n const createArg = txnOrArg instanceof EditTxn ? arg! : {\r\n sheetIndexModelId: txnOrArg.sheetIndexModelId,\r\n parentId: txnOrArg.parentId,\r\n name: txnOrArg.name,\r\n priority: txnOrArg.priority,\r\n sheetId: txnOrArg.sheetId,\r\n };\r\n const instance = this.create({ ...createArg, iModelDb: txn.iModel });\r\n instance.id = instance.insert(txn);\r\n return instance.id;\r\n }\r\n\r\n /** @alpha */\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (this.sheet)\r\n referenceIds.addModel(this.sheet.id);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"SheetIndex.js","sourceRoot":"","sources":["../../src/SheetIndex.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAAiP;AACjP,uCAA+D;AAC/D,uCAAoC;AAEpC,sDAA+D;AAC/D,qEAAkK;AAClK,gDAAkD;AAkClD;;;;GAIG;AACH,MAAa,UAAW,SAAQ,qCAA2B;IAClD,MAAM,KAAc,SAAS,KAAa,OAAO,YAAY,CAAC,CAAC,CAAC;IAEvE;;;;OAIG;IACI,MAAM,CAAC,UAAU,CAAC,MAAgB,EAAE,sBAAsC,EAAE,SAAiB;QAClG,MAAM,QAAQ,GAAa,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,yBAAW,CAAC,UAAU,CAAC,CAAC;QAC9E,OAAO,IAAI,kBAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,QAAkB,EAAE,OAAmB,EAAE,IAAY;QACxE,MAAM,KAAK,GAAiB;YAC1B,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,OAAO,EAAE,I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AAmB,CAAC,YAAgC;QACrE,KAAK,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACxC,IAAI,IAAI,CAAC,KAAK;YACZ,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACzC,CAAC;CACF;AAnED,wCAmEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Elements\r\n */\r\n\r\nimport { BisCodeSpec, Code, CodeScopeProps, CodeSpec, ElementProps, EntityReferenceSet, IModelError, RelatedElementProps, SheetIndexEntryProps, SheetIndexFolderProps, SheetIndexReferenceProps, SheetReferenceProps } from \"@itwin/core-common\";\r\nimport { InformationReferenceElement, Sheet } from \"./Element\";\r\nimport { EditTxn } from \"./EditTxn\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { SheetIndexFolderOwnsEntries, SheetIndexOwnsEntries, SheetIndexReferenceRefersToSheetIndex, SheetReferenceRefersToSheet } from \"./NavigationRelationship\";\r\nimport { _implicitTxn } from \"./internal/Symbols\";\r\n\r\n/** Arguments used to create a [[SheetIndexEntry]].\r\n * @beta\r\n */\r\nexport interface SheetIndexEntryCreateArgs {\r\n /** The iModel that will contain the sheet index entry. */\r\n iModelDb: IModelDb;\r\n /** The Id of the [[SheetIndexModel]] that will contain the sheet index entry. */\r\n sheetIndexModelId: Id64String;\r\n /** The [[SheetIndex]] or [[SheetIndexFolder]] that is parent to this SheetIndexEntry */\r\n parentId: Id64String;\r\n /** The name of the SheetIndexEntry */\r\n name: string;\r\n /** The priority of the SheetIndexEntry */\r\n priority: number;\r\n}\r\n\r\n/** Arguments supplied when creating a [[SheetIndexReference]].\r\n * @beta\r\n */\r\nexport interface SheetIndexReferenceCreateArgs extends SheetIndexEntryCreateArgs {\r\n /** The [[SheetIndex]] to which the reference refers. */\r\n sheetIndexId?: Id64String;\r\n}\r\n\r\n/** Arguments supplied when creating a [[SheetReference]].\r\n * @beta\r\n */\r\nexport interface SheetReferenceCreateArgs extends SheetIndexEntryCreateArgs {\r\n /** The [[Sheet]] to which the reference refers. */\r\n sheetId?: Id64String;\r\n}\r\n\r\n/** A [structured collection]($docs/bis/domains/drawings-sheets#sheet-index) of [[SheetIndexEntry]]s.\r\n * The sheet index is a tree whose leaf nodes refer to [[Sheet]]s, optionally grouped by [[SheetIndexFolder]]s and/or incorporating\r\n * sub-trees via [[SheetIndexReference]]s.\r\n * @beta\r\n */\r\nexport class SheetIndex extends InformationReferenceElement {\r\n public static override get className(): string { return \"SheetIndex\"; }\r\n\r\n /** Create a Code for a SheetIndex given a name that is meant to be unique within the scope of the specified SheetIndexModel.\r\n * @param iModel The IModelDb\r\n * @param scopeSheetIndexModelId The Id of the Model that contains the LinkElement and provides the scope for its name.\r\n * @param codeValue The SheetIndex name\r\n */\r\n public static createCode(iModel: IModelDb, scopeSheetIndexModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.sheetIndex);\r\n return new Code({ spec: codeSpec.id, scope: scopeSheetIndexModelId, value: codeValue });\r\n }\r\n\r\n /** Create a SheetIndex\r\n * @param iModelDb The IModelDb\r\n * @param modelId The Id of the Model that contains the SheetIndex and provides the scope for its name.\r\n * @param name The name (codeValue) of the SheetIndex\r\n * @returns The newly constructed SheetIndex\r\n * @throws [[IModelError]] if there is a problem creating the SheetIndex\r\n */\r\n public static create(iModelDb: IModelDb, modelId: Id64String, name: string): SheetIndex {\r\n const props: ElementProps = {\r\n classFullName: this.classFullName,\r\n code: this.createCode(iModelDb, modelId, name).toJSON(),\r\n model: modelId,\r\n };\r\n return new this(props, iModelDb);\r\n }\r\n\r\n /** Insert a SheetIndex\r\n * @param iModelDb The IModelDb\r\n * @param modelId The Id of the Model that contains the SheetIndex and provides the scope for its name.\r\n * @param name The name (codeValue) of the SheetIndex\r\n * @returns The Id of the newly inserted SheetIndex\r\n * @throws [[IModelError]] if there is a problem inserting the SheetIndex\r\n */\r\n public static insert(txn: EditTxn, modelId: Id64String, name: string): Id64String;\r\n /** @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use SheetIndex.insert(txn, ...) instead. */\r\n public static insert(iModelDb: IModelDb, modelId: Id64String, name: string): Id64String;\r\n public static insert(txnOrDb: EditTxn | IModelDb, modelId: Id64String, name: string): Id64String {\r\n const txn = txnOrDb instanceof EditTxn ? txnOrDb : txnOrDb[_implicitTxn];\r\n const instance = this.create(txn.iModel, modelId, name);\r\n instance.id = instance.insert(txn);\r\n return instance.id;\r\n }\r\n}\r\n\r\n/** The base class for all elements that can participate in a [[SheetIndex]] hierarchy.\r\n * @beta\r\n*/\r\nexport abstract class SheetIndexEntry extends InformationReferenceElement {\r\n public static override get className(): string { return \"SheetIndexEntry\"; }\r\n /** Can be used to prioritize or order members within a SheetIndex or SheetIndexFolder. */\r\n public entryPriority: number;\r\n\r\n protected constructor(props: SheetIndexEntryProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.entryPriority = props.entryPriority;\r\n }\r\n\r\n public override toJSON(): SheetIndexEntryProps {\r\n return { ...super.toJSON(), entryPriority: this.entryPriority };\r\n }\r\n\r\n /** Create a Code for a Sheet Index Entry given a name that is meant to be unique within the scope of the specified SheetIndexModel.\r\n * @param iModel The IModel\r\n * @param scopeModelId The Id of the [[SheetIndexModel]] that contains the [[SheetIndexEntry]] and provides the scope for its name.\r\n * @param codeValue The name of the entry\r\n */\r\n public static createCode(iModelDb: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.sheetIndexEntry);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n protected static createParentRelationshipProps(iModelDb: IModelDb, id: Id64String): RelatedElementProps {\r\n const parentElementProps = iModelDb.elements.getElementProps(id);\r\n const isFolder = parentElementProps.classFullName === SheetIndexFolder.classFullName;\r\n const relClass = isFolder ? SheetIndexFolderOwnsEntries : SheetIndexOwnsEntries;\r\n return { id, relClassName: relClass.classFullName };\r\n }\r\n\r\n protected static createProps(arg: SheetIndexEntryCreateArgs) {\r\n const parent = this.createParentRelationshipProps(arg.iModelDb, arg.parentId);\r\n const props: SheetIndexEntryProps = {\r\n classFullName: this.classFullName,\r\n model: arg.sheetIndexModelId,\r\n code: this.createCode(arg.iModelDb, arg.sheetIndexModelId, arg.name),\r\n entryPriority: arg.priority,\r\n parent,\r\n };\r\n return props;\r\n }\r\n}\r\n\r\n/** A container used to group [[SheetIndexEntry]]s within a [[SheetIndex]].\r\n * @beta\r\n */\r\nexport class SheetIndexFolder extends SheetIndexEntry {\r\n public static override get className(): string { return \"SheetIndexFolder\"; }\r\n\r\n /** Create a new SheetIndexFolder\r\n * @returns The newly constructed SheetIndexFolder element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(arg: SheetIndexEntryCreateArgs) {\r\n const props: SheetIndexFolderProps = this.createProps(arg);\r\n return new this(props, arg.iModelDb);\r\n }\r\n\r\n /** Create a new SheetIndexFolder\r\n * @returns The Id of the newly inserted SheetIndexFolder element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static insert(txn: EditTxn, arg: Omit<SheetIndexEntryCreateArgs, \"iModelDb\">): Id64String;\r\n /** @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use SheetIndexFolder.insert(txn, ...) instead. */\r\n public static insert(arg: SheetIndexEntryCreateArgs): Id64String;\r\n public static insert(txnOrArg: EditTxn | SheetIndexEntryCreateArgs, arg?: Omit<SheetIndexEntryCreateArgs, \"iModelDb\">): Id64String {\r\n const txn = txnOrArg instanceof EditTxn ? txnOrArg : txnOrArg.iModelDb[_implicitTxn];\r\n const createArg = txnOrArg instanceof EditTxn ? arg! : {\r\n sheetIndexModelId: txnOrArg.sheetIndexModelId,\r\n parentId: txnOrArg.parentId,\r\n name: txnOrArg.name,\r\n priority: txnOrArg.priority,\r\n };\r\n const instance = this.create({ ...createArg, iModelDb: txn.iModel });\r\n instance.id = instance.insert(txn);\r\n return instance.id;\r\n }\r\n}\r\n\r\n/** A node within one [[SheetIndex]] that incorporates another [[SheetIndex]] as a sub-tree.\r\n * @beta\r\n*/\r\nexport class SheetIndexReference extends SheetIndexEntry {\r\n public static override get className(): string { return \"SheetIndexReference\"; }\r\n\r\n /** The bis:SheetIndex that this bis:SheetIndexReference is pointing to. */\r\n public sheetIndex?: SheetIndexReferenceRefersToSheetIndex;\r\n\r\n protected constructor(props: SheetIndexReferenceProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n if (props.sheetIndex) {\r\n const sheetIndex = iModel.elements.tryGetElement<SheetIndex>(props.sheetIndex.id);\r\n if (!sheetIndex)\r\n throw new IModelError(IModelStatus.NotFound, \"SheetIndex not found\");\r\n\r\n this.sheetIndex = new SheetIndexReferenceRefersToSheetIndex(props.sheetIndex.id);\r\n }\r\n }\r\n\r\n protected static createReferenceRelationshipProps(id: Id64String): RelatedElementProps {\r\n return { id, relClassName: SheetIndexReferenceRefersToSheetIndex.classFullName };\r\n }\r\n\r\n public override toJSON(): SheetIndexReferenceProps { // This override only specializes the return type\r\n return {\r\n ...super.toJSON(),\r\n sheetIndex: this.sheetIndex ? this.sheetIndex.toJSON() : undefined,\r\n };\r\n }\r\n\r\n /** Create a new SheetIndexReference\r\n * @returns The newly constructed SheetIndexReference element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(arg: SheetIndexReferenceCreateArgs) {\r\n const props: SheetIndexReferenceProps = {\r\n ...this.createProps(arg),\r\n sheetIndex: arg.sheetIndexId ? this.createReferenceRelationshipProps(arg.sheetIndexId) : undefined,\r\n };\r\n return new this(props, arg.iModelDb);\r\n }\r\n\r\n /** Create a new SheetIndexReference\r\n * @returns The Id of the newly inserted SheetIndexReference element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static insert(txn: EditTxn, arg: Omit<SheetIndexReferenceCreateArgs, \"iModelDb\">): Id64String;\r\n /** @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use SheetIndexReference.insert(txn, ...) instead. */\r\n public static insert(arg: SheetIndexReferenceCreateArgs): Id64String;\r\n public static insert(txnOrArg: EditTxn | SheetIndexReferenceCreateArgs, arg?: Omit<SheetIndexReferenceCreateArgs, \"iModelDb\">): Id64String {\r\n const txn = txnOrArg instanceof EditTxn ? txnOrArg : txnOrArg.iModelDb[_implicitTxn];\r\n const createArg = txnOrArg instanceof EditTxn ? arg! : {\r\n sheetIndexModelId: txnOrArg.sheetIndexModelId,\r\n parentId: txnOrArg.parentId,\r\n name: txnOrArg.name,\r\n priority: txnOrArg.priority,\r\n sheetIndexId: txnOrArg.sheetIndexId,\r\n };\r\n const instance = this.create({ ...createArg, iModelDb: txn.iModel });\r\n instance.id = instance.insert(txn);\r\n return instance.id;\r\n }\r\n\r\n /** @alpha */\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (this.sheetIndex)\r\n referenceIds.addElement(this.sheetIndex.id);\r\n }\r\n}\r\n\r\n/** A leaf node in a [[SheetIndex]] that refers to a specific [[Sheet]].\r\n * @beta\r\n*/\r\nexport class SheetReference extends SheetIndexEntry {\r\n public static override get className(): string { return \"SheetReference\"; }\r\n\r\n /** The bis:Sheet that this bis:SheetReference is pointing to. */\r\n public sheet: SheetReferenceRefersToSheet | undefined;\r\n\r\n protected constructor(props: SheetReferenceProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n if (props.sheet) {\r\n const sheet = iModel.elements.tryGetElement<Sheet>(props.sheet.id);\r\n if (!sheet)\r\n throw new IModelError(IModelStatus.NotFound, \"Sheet not found\");\r\n\r\n this.sheet = new SheetReferenceRefersToSheet(sheet.id);\r\n }\r\n }\r\n\r\n protected static createReferenceRelationshipProps(id: Id64String): RelatedElementProps {\r\n return { id, relClassName: SheetIndexReferenceRefersToSheetIndex.classFullName };\r\n }\r\n\r\n public override toJSON(): SheetReferenceProps { // This override only specializes the return type\r\n return {\r\n ...super.toJSON(),\r\n sheet: this.sheet ? this.sheet.toJSON() : undefined,\r\n };\r\n }\r\n\r\n /** Create a new SheetReference\r\n * @returns The newly constructed SheetReference element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(arg: SheetReferenceCreateArgs) {\r\n const props: SheetReferenceProps = {\r\n ...this.createProps(arg),\r\n sheet: arg.sheetId ? this.createReferenceRelationshipProps(arg.sheetId) : undefined,\r\n };\r\n return new this(props, arg.iModelDb);\r\n }\r\n\r\n /** Insert a new SheetReference\r\n * @returns The Id of the newly inserted SheetReference element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static insert(txn: EditTxn, arg: Omit<SheetReferenceCreateArgs, \"iModelDb\">): Id64String;\r\n /** @deprecated in 5.1.9 - will not be removed until after 2027-05-04. Use SheetReference.insert(txn, ...) instead. */\r\n public static insert(arg: SheetReferenceCreateArgs): Id64String;\r\n public static insert(txnOrArg: EditTxn | SheetReferenceCreateArgs, arg?: Omit<SheetReferenceCreateArgs, \"iModelDb\">): Id64String {\r\n const txn = txnOrArg instanceof EditTxn ? txnOrArg : txnOrArg.iModelDb[_implicitTxn];\r\n const createArg = txnOrArg instanceof EditTxn ? arg! : {\r\n sheetIndexModelId: txnOrArg.sheetIndexModelId,\r\n parentId: txnOrArg.parentId,\r\n name: txnOrArg.name,\r\n priority: txnOrArg.priority,\r\n sheetId: txnOrArg.sheetId,\r\n };\r\n const instance = this.create({ ...createArg, iModelDb: txn.iModel });\r\n instance.id = instance.insert(txn);\r\n return instance.id;\r\n }\r\n\r\n /** @alpha */\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (this.sheet)\r\n referenceIds.addModel(this.sheet.id);\r\n }\r\n}\r\n"]}
|
package/lib/cjs/Texture.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ export declare class Texture extends DefinitionElement {
|
|
|
57
57
|
*/
|
|
58
58
|
static insertTexture(txn: EditTxn, definitionModelId: Id64String, name: string, format: ImageSourceFormat, data: Uint8Array | Base64EncodedString, description?: string): Id64String;
|
|
59
59
|
/** Insert a new texture into a [[DefinitionModel]].
|
|
60
|
-
* @deprecated Use Texture.insertTexture(txn, ...) instead.
|
|
60
|
+
* @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use Texture.insertTexture(txn, ...) instead.
|
|
61
61
|
*/
|
|
62
62
|
static insertTexture(iModelDb: IModelDb, definitionModelId: Id64String, name: string, format: ImageSourceFormat, data: Uint8Array | Base64EncodedString, description?: string): Id64String;
|
|
63
63
|
}
|
package/lib/cjs/Texture.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Texture.js","sourceRoot":"","sources":["../../src/Texture.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,oDAE4B;AAC5B,uCAA8C;AAC9C,uCAAoC;AAEpC,gDAAkD;AAUlD;;GAEG;AACH,MAAa,OAAQ,SAAQ,2BAAiB;IAC5C,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,SAAS,CAAC,CAAC,CAAC;IAC7D,MAAM,CAAoB;IAC1B,IAAI,CAAa;IACjB,WAAW,CAAU;IAE5B,YAAY;IACZ,YAAsB,KAAyB,EAAE,MAAgB;QAC/D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,iCAAmB,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI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AAC,aAAa,CAAC,OAA2B,EAAE,iBAA6B,EAAE,IAAY,EAAE,MAAyB,EAAE,IAAsC,EAAE,WAAoB;QAC3L,MAAM,GAAG,GAAG,OAAO,YAAY,iBAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,sBAAY,CAAC,CAAC;QACzE,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;QACnG,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF;AAhFD,0BAgFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Elements\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n Base64EncodedString, BisCodeSpec, Code, CodeScopeProps, CodeSpec, ImageSourceFormat, TextureProps,\r\n} from \"@itwin/core-common\";\r\nimport { DefinitionElement } from \"./Element\";\r\nimport { EditTxn } from \"./EditTxn\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { _implicitTxn } from \"./internal/Symbols\";\r\n\r\n/** A [TextureProps]($common) in which the image data can be specified either as a base-64-encoded string or a Uint8Array.\r\n * @see [[Texture]] constructor.\r\n * @beta\r\n */\r\nexport interface TextureCreateProps extends Omit<TextureProps, \"data\"> {\r\n data: Base64EncodedString | Uint8Array;\r\n}\r\n\r\n/** Defines a rendering texture that is associated with a Material and applied to surface geometry.\r\n * @public @preview\r\n */\r\nexport class Texture extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"Texture\"; }\r\n public format: ImageSourceFormat;\r\n public data: Uint8Array;\r\n public description?: string;\r\n\r\n /** @beta */\r\n protected constructor(props: TextureCreateProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.format = props.format;\r\n this.data = typeof props.data === \"string\" ? Base64EncodedString.toUint8Array(props.data) : props.data;\r\n this.description = props.description;\r\n }\r\n\r\n public override toJSON(): TextureProps {\r\n const val = super.toJSON() as TextureProps;\r\n val.format = this.format;\r\n val.data = Base64EncodedString.fromUint8Array(this.data);\r\n val.description = this.description;\r\n return val;\r\n }\r\n\r\n /** Create a Code for a Texture given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the Texture and provides the scope for its name.\r\n * @param name The Texture name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, name: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.texture);\r\n return 0 === name.length ? Code.createEmpty() : new Code({ spec: codeSpec.id, scope: scopeModelId, value: name });\r\n }\r\n\r\n /** Create a texture with the given parameters.\r\n * @param iModelDb The iModel to contain the texture.\r\n * @param definitionModelId The [[DefinitionModel]] to contain the texture.\r\n * @param name The name to serve as the texture's [Code]($common) value.\r\n * @param format The format of the image data.\r\n * @param data The image data in the format specified by `format`.\r\n * @param description An optional description of the texture\r\n * @returns The newly constructed Texture element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n * @see [[insertTexture]] to insert a new texture into the iModel.\r\n */\r\n public static createTexture(iModelDb: IModelDb, definitionModelId: Id64String, name: string, format: ImageSourceFormat, data: Uint8Array | Base64EncodedString, description?: string): Texture {\r\n const textureProps: TextureCreateProps = {\r\n classFullName: this.classFullName,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n format,\r\n data,\r\n description,\r\n model: definitionModelId,\r\n isPrivate: false,\r\n };\r\n\r\n return new Texture(textureProps, iModelDb);\r\n }\r\n\r\n /** Insert a new texture into a [[DefinitionModel]].\r\n * @param iModelDb The iModel to contain the texture.\r\n * @param definitionModelId The [[DefinitionModel]] to contain the texture.\r\n * @param name The name to serve as the texture's [Code]($common) value.\r\n * @param format The format of the image data.\r\n * @param data The image data in the format specified by `format`.\r\n * @param description An optional description of the texture\r\n * @returns The Id of the newly-inserted texture element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n * @see [[insertTexture]] to insert a new texture into the iModel.\r\n * @beta\r\n */\r\n public static insertTexture(txn: EditTxn, definitionModelId: Id64String, name: string, format: ImageSourceFormat, data: Uint8Array | Base64EncodedString, description?: string): Id64String;\r\n /** Insert a new texture into a [[DefinitionModel]].\r\n * @deprecated Use Texture.insertTexture(txn, ...) instead.\r\n */\r\n public static insertTexture(iModelDb: IModelDb, definitionModelId: Id64String, name: string, format: ImageSourceFormat, data: Uint8Array | Base64EncodedString, description?: string): Id64String;\r\n public static insertTexture(txnOrDb: EditTxn | IModelDb, definitionModelId: Id64String, name: string, format: ImageSourceFormat, data: Uint8Array | Base64EncodedString, description?: string): Id64String {\r\n const txn = txnOrDb instanceof EditTxn ? txnOrDb : txnOrDb[_implicitTxn];\r\n const texture = this.createTexture(txn.iModel, definitionModelId, name, format, data, description);\r\n return texture.insert(txn);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Texture.js","sourceRoot":"","sources":["../../src/Texture.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,oDAE4B;AAC5B,uCAA8C;AAC9C,uCAAoC;AAEpC,gDAAkD;AAUlD;;GAEG;AACH,MAAa,OAAQ,SAAQ,2BAAiB;IAC5C,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,SAAS,CAAC,CAAC,CAAC;IAC7D,MAAM,CAAoB;IAC1B,IAAI,CAAa;IACjB,WAAW,CAAU;IAE5B,YAAY;IACZ,YAAsB,KAAyB,EAAE,MAAgB;QAC/D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC3B,IAAI,C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,WAAW;YACX,KAAK,EAAE,iBAAiB;YACxB,SAAS,EAAE,KAAK;SACjB,CAAC;QAEF,OAAO,IAAI,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAmBM,MAAM,CAAC,aAAa,CAAC,OAA2B,EAAE,iBAA6B,EAAE,IAAY,EAAE,MAAyB,EAAE,IAAsC,EAAE,WAAoB;QAC3L,MAAM,GAAG,GAAG,OAAO,YAAY,iBAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,sBAAY,CAAC,CAAC;QACzE,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;QACnG,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACF;AAhFD,0BAgFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Elements\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport {\r\n Base64EncodedString, BisCodeSpec, Code, CodeScopeProps, CodeSpec, ImageSourceFormat, TextureProps,\r\n} from \"@itwin/core-common\";\r\nimport { DefinitionElement } from \"./Element\";\r\nimport { EditTxn } from \"./EditTxn\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { _implicitTxn } from \"./internal/Symbols\";\r\n\r\n/** A [TextureProps]($common) in which the image data can be specified either as a base-64-encoded string or a Uint8Array.\r\n * @see [[Texture]] constructor.\r\n * @beta\r\n */\r\nexport interface TextureCreateProps extends Omit<TextureProps, \"data\"> {\r\n data: Base64EncodedString | Uint8Array;\r\n}\r\n\r\n/** Defines a rendering texture that is associated with a Material and applied to surface geometry.\r\n * @public @preview\r\n */\r\nexport class Texture extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"Texture\"; }\r\n public format: ImageSourceFormat;\r\n public data: Uint8Array;\r\n public description?: string;\r\n\r\n /** @beta */\r\n protected constructor(props: TextureCreateProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.format = props.format;\r\n this.data = typeof props.data === \"string\" ? Base64EncodedString.toUint8Array(props.data) : props.data;\r\n this.description = props.description;\r\n }\r\n\r\n public override toJSON(): TextureProps {\r\n const val = super.toJSON() as TextureProps;\r\n val.format = this.format;\r\n val.data = Base64EncodedString.fromUint8Array(this.data);\r\n val.description = this.description;\r\n return val;\r\n }\r\n\r\n /** Create a Code for a Texture given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DefinitionModel that contains the Texture and provides the scope for its name.\r\n * @param name The Texture name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, name: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.texture);\r\n return 0 === name.length ? Code.createEmpty() : new Code({ spec: codeSpec.id, scope: scopeModelId, value: name });\r\n }\r\n\r\n /** Create a texture with the given parameters.\r\n * @param iModelDb The iModel to contain the texture.\r\n * @param definitionModelId The [[DefinitionModel]] to contain the texture.\r\n * @param name The name to serve as the texture's [Code]($common) value.\r\n * @param format The format of the image data.\r\n * @param data The image data in the format specified by `format`.\r\n * @param description An optional description of the texture\r\n * @returns The newly constructed Texture element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n * @see [[insertTexture]] to insert a new texture into the iModel.\r\n */\r\n public static createTexture(iModelDb: IModelDb, definitionModelId: Id64String, name: string, format: ImageSourceFormat, data: Uint8Array | Base64EncodedString, description?: string): Texture {\r\n const textureProps: TextureCreateProps = {\r\n classFullName: this.classFullName,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n format,\r\n data,\r\n description,\r\n model: definitionModelId,\r\n isPrivate: false,\r\n };\r\n\r\n return new Texture(textureProps, iModelDb);\r\n }\r\n\r\n /** Insert a new texture into a [[DefinitionModel]].\r\n * @param iModelDb The iModel to contain the texture.\r\n * @param definitionModelId The [[DefinitionModel]] to contain the texture.\r\n * @param name The name to serve as the texture's [Code]($common) value.\r\n * @param format The format of the image data.\r\n * @param data The image data in the format specified by `format`.\r\n * @param description An optional description of the texture\r\n * @returns The Id of the newly-inserted texture element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n * @see [[insertTexture]] to insert a new texture into the iModel.\r\n * @beta\r\n */\r\n public static insertTexture(txn: EditTxn, definitionModelId: Id64String, name: string, format: ImageSourceFormat, data: Uint8Array | Base64EncodedString, description?: string): Id64String;\r\n /** Insert a new texture into a [[DefinitionModel]].\r\n * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use Texture.insertTexture(txn, ...) instead.\r\n */\r\n public static insertTexture(iModelDb: IModelDb, definitionModelId: Id64String, name: string, format: ImageSourceFormat, data: Uint8Array | Base64EncodedString, description?: string): Id64String;\r\n public static insertTexture(txnOrDb: EditTxn | IModelDb, definitionModelId: Id64String, name: string, format: ImageSourceFormat, data: Uint8Array | Base64EncodedString, description?: string): Id64String {\r\n const txn = txnOrDb instanceof EditTxn ? txnOrDb : txnOrDb[_implicitTxn];\r\n const texture = this.createTexture(txn.iModel, definitionModelId, name, format, data, description);\r\n return texture.insert(txn);\r\n }\r\n}\r\n"]}
|
package/lib/cjs/TxnManager.d.ts
CHANGED
|
@@ -351,6 +351,9 @@ export declare class TxnManager {
|
|
|
351
351
|
* @internal
|
|
352
352
|
*/
|
|
353
353
|
protected _onEndValidate(): void;
|
|
354
|
+
/** Called by native code during semantic rebase while reversing local changes to create instance patches to be used for reinstating changes.
|
|
355
|
+
* @internal */
|
|
356
|
+
protected _captureInstanceChanges(id: TxnIdString): void;
|
|
354
357
|
/** @internal */
|
|
355
358
|
protected _onGeometryChanged(modelProps: ModelGeometryChangesProps[]): void;
|
|
356
359
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TxnManager.d.ts","sourceRoot":"","sources":["../../src/TxnManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EACG,OAAO,EAAmD,oBAAoB,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"TxnManager.d.ts","sourceRoot":"","sources":["../../src/TxnManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EACG,OAAO,EAAmD,oBAAoB,EAAE,QAAQ,EAAmB,UAAU,EAAE,YAAY,EAC5I,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,cAAc,EAAE,0BAA0B,EAAe,yBAAyB,EAAE,sBAAsB,EAA4D,gBAAgB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEjS,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,OAAO,EAAgB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGjE,OAAO,EAAE,6BAA6B,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAM9G;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC;AAEjC;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,EAAE,0BAA0B,CAAC;IAC7C,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,0BAA0B,CAAC;IAC7C,4IAA4I;IAC5I,QAAQ,CAAC,OAAO,EAAE,0BAA0B,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,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js/TxnManager.js
CHANGED
|
@@ -6,6 +6,58 @@
|
|
|
6
6
|
/** @packageDocumentation
|
|
7
7
|
* @module iModels
|
|
8
8
|
*/
|
|
9
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
10
|
+
if (value !== null && value !== void 0) {
|
|
11
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
12
|
+
var dispose, inner;
|
|
13
|
+
if (async) {
|
|
14
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
15
|
+
dispose = value[Symbol.asyncDispose];
|
|
16
|
+
}
|
|
17
|
+
if (dispose === void 0) {
|
|
18
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
19
|
+
dispose = value[Symbol.dispose];
|
|
20
|
+
if (async) inner = dispose;
|
|
21
|
+
}
|
|
22
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
23
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
24
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
25
|
+
}
|
|
26
|
+
else if (async) {
|
|
27
|
+
env.stack.push({ async: true });
|
|
28
|
+
}
|
|
29
|
+
return value;
|
|
30
|
+
};
|
|
31
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
32
|
+
return function (env) {
|
|
33
|
+
function fail(e) {
|
|
34
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
35
|
+
env.hasError = true;
|
|
36
|
+
}
|
|
37
|
+
var r, s = 0;
|
|
38
|
+
function next() {
|
|
39
|
+
while (r = env.stack.pop()) {
|
|
40
|
+
try {
|
|
41
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
42
|
+
if (r.dispose) {
|
|
43
|
+
var result = r.dispose.call(r.value);
|
|
44
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
45
|
+
}
|
|
46
|
+
else s |= 1;
|
|
47
|
+
}
|
|
48
|
+
catch (e) {
|
|
49
|
+
fail(e);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
53
|
+
if (env.hasError) throw env.error;
|
|
54
|
+
}
|
|
55
|
+
return next();
|
|
56
|
+
};
|
|
57
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
58
|
+
var e = new Error(message);
|
|
59
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
60
|
+
});
|
|
9
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
62
|
exports.TxnManager = exports.RebaseManager = void 0;
|
|
11
63
|
exports.setMaxEntitiesPerEvent = setMaxEntitiesPerEvent;
|
|
@@ -17,6 +69,8 @@ const IpcHost_1 = require("./IpcHost");
|
|
|
17
69
|
const Symbols_1 = require("./internal/Symbols");
|
|
18
70
|
const ChangesetConflictArgs_1 = require("./internal/ChangesetConflictArgs");
|
|
19
71
|
const BriefcaseManager_1 = require("./BriefcaseManager");
|
|
72
|
+
const ChangesetReader_1 = require("./ChangesetReader");
|
|
73
|
+
const PartialChangeUnifier_1 = require("./PartialChangeUnifier");
|
|
20
74
|
/** Strictly for tests. @internal */
|
|
21
75
|
function setMaxEntitiesPerEvent(max) {
|
|
22
76
|
const prevMax = ChangedEntitiesProc.maxPerEvent;
|
|
@@ -518,16 +572,15 @@ class RebaseManager {
|
|
|
518
572
|
if (!BriefcaseManager_1.BriefcaseManager.semanticRebaseDataFolderExists(this._iModel, txnProps.id)) {
|
|
519
573
|
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, `Local folder does not exist for transaction ${txnProps.id}`);
|
|
520
574
|
}
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
if (instance.isIndirect) {
|
|
575
|
+
for await (const instance of BriefcaseManager_1.BriefcaseManager.getChangedInstancesDataForTxn(this._iModel, txnProps.id)) {
|
|
576
|
+
if (instance.$meta.isIndirectChange) {
|
|
524
577
|
this._iModel.txns.withIndirectTxnMode(() => {
|
|
525
578
|
this.applyInstancePatch(instance);
|
|
526
579
|
});
|
|
527
|
-
|
|
580
|
+
continue;
|
|
528
581
|
}
|
|
529
582
|
this.applyInstancePatch(instance);
|
|
530
|
-
}
|
|
583
|
+
}
|
|
531
584
|
BriefcaseManager_1.BriefcaseManager.deleteTxnDataFolder(this._iModel, txnProps.id); // delete the folder after importing
|
|
532
585
|
}
|
|
533
586
|
else {
|
|
@@ -541,27 +594,34 @@ class RebaseManager {
|
|
|
541
594
|
*/
|
|
542
595
|
applyInstancePatch(instance) {
|
|
543
596
|
const nativeDb = this._iModel[Symbols_1._nativeDb];
|
|
544
|
-
|
|
597
|
+
const { $meta, ...props } = instance;
|
|
598
|
+
switch ($meta.op) {
|
|
545
599
|
case "Inserted": {
|
|
546
|
-
if (!
|
|
600
|
+
if (!props)
|
|
547
601
|
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, "InstancePatch with op 'Inserted' must have props");
|
|
548
602
|
const options = { forceUseId: true, useJsNames: true };
|
|
549
|
-
nativeDb.insertInstance(
|
|
603
|
+
const id = nativeDb.insertInstance(props, options);
|
|
604
|
+
if (!core_bentley_1.Id64.isValidId64(id))
|
|
605
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, `Failed to insert instance with id ${props.id}`);
|
|
550
606
|
break;
|
|
551
607
|
}
|
|
552
608
|
case "Updated": {
|
|
553
|
-
if (!
|
|
609
|
+
if (!props)
|
|
554
610
|
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, "InstancePatch with op 'Updated' must have props");
|
|
555
|
-
nativeDb.updateInstance(
|
|
611
|
+
const isSuccess = nativeDb.updateInstance(props, { useJsNames: true });
|
|
612
|
+
if (!isSuccess)
|
|
613
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, `Failed to update instance with id ${props.id}`);
|
|
556
614
|
break;
|
|
557
615
|
}
|
|
558
616
|
case "Deleted": {
|
|
559
|
-
const key = { id:
|
|
560
|
-
nativeDb.deleteInstance(key, { useJsNames: true });
|
|
617
|
+
const key = { id: props.id, classFullName: props.className };
|
|
618
|
+
const isSuccess = nativeDb.deleteInstance(key, { useJsNames: true });
|
|
619
|
+
if (!isSuccess)
|
|
620
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, `Failed to delete instance with id ${props.id}`);
|
|
561
621
|
break;
|
|
562
622
|
}
|
|
563
623
|
default:
|
|
564
|
-
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, `Unknown InstancePatch op '${
|
|
624
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, `Unknown InstancePatch op '${$meta.op}'`);
|
|
565
625
|
}
|
|
566
626
|
}
|
|
567
627
|
/**
|
|
@@ -805,6 +865,28 @@ class TxnManager {
|
|
|
805
865
|
this.onEndValidation.raiseEvent();
|
|
806
866
|
// TODO: if (this.validationErrors.length !== 0) throw new IModelError(validation ...)
|
|
807
867
|
}
|
|
868
|
+
/** Called by native code during semantic rebase while reversing local changes to create instance patches to be used for reinstating changes.
|
|
869
|
+
* @internal */
|
|
870
|
+
_captureInstanceChanges(id) {
|
|
871
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
872
|
+
try {
|
|
873
|
+
if (BriefcaseManager_1.BriefcaseManager.semanticRebaseDataFolderExists(this._iModel, id))
|
|
874
|
+
return; // if folder already exists that means we have already captured the changes for this txn during this rebase so we can skip capturing again
|
|
875
|
+
const reader = __addDisposableResource(env_1, ChangesetReader_1.ChangesetReader.openTxn({ db: this._iModel, txnId: id, rowOptions: { useJsName: true, abbreviateBlobs: false } }), false);
|
|
876
|
+
const pcu = __addDisposableResource(env_1, new PartialChangeUnifier_1.PartialChangeUnifier(PartialChangeUnifier_1.ChangeUnifierCache.createSqliteBackedCache()), false);
|
|
877
|
+
while (reader.step()) {
|
|
878
|
+
pcu.appendFrom(reader);
|
|
879
|
+
}
|
|
880
|
+
BriefcaseManager_1.BriefcaseManager.storeChangedInstancesForSemanticRebase(this._iModel, id, pcu.instances);
|
|
881
|
+
}
|
|
882
|
+
catch (e_1) {
|
|
883
|
+
env_1.error = e_1;
|
|
884
|
+
env_1.hasError = true;
|
|
885
|
+
}
|
|
886
|
+
finally {
|
|
887
|
+
__disposeResources(env_1);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
808
890
|
/** @internal */
|
|
809
891
|
_onGeometryChanged(modelProps) {
|
|
810
892
|
this.onGeometryChanged.raiseEvent(modelProps);
|