@itwin/core-backend 5.10.0-dev.11 → 5.10.0-dev.13
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 +6 -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.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.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +33 -23
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +32 -20
- package/lib/cjs/IModelDb.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.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.js.map +1 -1
- package/lib/cjs/Texture.d.ts +1 -1
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +6 -6
- 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/annotations/FrameGeometry.d.ts.map +1 -1
- package/lib/cjs/annotations/FrameGeometry.js +2 -3
- package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.d.ts +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.js.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.d.ts +2 -2
- package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
- package/lib/cjs/internal/ServerBasedLocks.d.ts +19 -1
- package/lib/cjs/internal/ServerBasedLocks.d.ts.map +1 -1
- package/lib/cjs/internal/ServerBasedLocks.js +55 -1
- package/lib/cjs/internal/ServerBasedLocks.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.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.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +33 -23
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +32 -20
- package/lib/esm/IModelDb.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.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.js.map +1 -1
- package/lib/esm/Texture.d.ts +1 -1
- package/lib/esm/Texture.js.map +1 -1
- package/lib/esm/ViewDefinition.d.ts +6 -6
- 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/annotations/FrameGeometry.d.ts.map +1 -1
- package/lib/esm/annotations/FrameGeometry.js +2 -3
- package/lib/esm/annotations/FrameGeometry.js.map +1 -1
- package/lib/esm/domains/FunctionalElements.d.ts +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.js.map +1 -1
- package/lib/esm/internal/ChannelAdmin.d.ts +2 -2
- package/lib/esm/internal/ChannelAdmin.js.map +1 -1
- package/lib/esm/internal/ServerBasedLocks.d.ts +19 -1
- package/lib/esm/internal/ServerBasedLocks.d.ts.map +1 -1
- package/lib/esm/internal/ServerBasedLocks.js +55 -1
- package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
- package/lib/esm/test/annotations/FrameGeometry.test.js +2 -1
- package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js +10 -0
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -1
- package/lib/esm/test/standalone/DeleteElements.test.js +45 -0
- package/lib/esm/test/standalone/DeleteElements.test.js.map +1 -1
- package/lib/esm/test/standalone/ServerBasedLocks.test.js +62 -0
- package/lib/esm/test/standalone/ServerBasedLocks.test.js.map +1 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log - @itwin/core-backend
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 14 May 2026 19:15:24 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
## 5.9.2
|
|
6
6
|
Fri, 08 May 2026 20:36:41 GMT
|
|
@@ -36,6 +36,11 @@ Mon, 04 May 2026 16:32:08 GMT
|
|
|
36
36
|
- Fix nested Error objects losing non-enumerable properties (message, stack) during IPC serialization in IpcHandler
|
|
37
37
|
- Added ChangesetReader api(along with new unifier apis) and deprecated ChangesetECAdaptor apis(including unifier apis)
|
|
38
38
|
|
|
39
|
+
## 5.8.5
|
|
40
|
+
Thu, 14 May 2026 19:12:21 GMT
|
|
41
|
+
|
|
42
|
+
_Version update only_
|
|
43
|
+
|
|
39
44
|
## 5.8.4
|
|
40
45
|
Thu, 23 Apr 2026 18:05:13 GMT
|
|
41
46
|
|
package/lib/cjs/Category.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export declare class SubCategory extends DefinitionElement {
|
|
|
72
72
|
static insert(txn: EditTxn, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;
|
|
73
73
|
/**
|
|
74
74
|
* Insert a new SubCategory
|
|
75
|
-
* @deprecated in 5.
|
|
75
|
+
* @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use SubCategory.insert(txn, ...) instead.
|
|
76
76
|
*/
|
|
77
77
|
static insert(iModelDb: IModelDb, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;
|
|
78
78
|
}
|
|
@@ -112,7 +112,7 @@ export declare class Category extends DefinitionElement {
|
|
|
112
112
|
setDefaultAppearance(txn: EditTxn, props: SubCategoryAppearance.Props | SubCategoryAppearance): void;
|
|
113
113
|
/**
|
|
114
114
|
* Set the appearance of the default SubCategory for this Category
|
|
115
|
-
* @deprecated in 5.
|
|
115
|
+
* @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use Category.setDefaultAppearance(txn, ...) instead.
|
|
116
116
|
*/
|
|
117
117
|
setDefaultAppearance(props: SubCategoryAppearance.Props | SubCategoryAppearance): void;
|
|
118
118
|
}
|
|
@@ -154,7 +154,7 @@ export declare class DrawingCategory extends Category {
|
|
|
154
154
|
static insert(txn: EditTxn, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;
|
|
155
155
|
/**
|
|
156
156
|
* Insert a new DrawingCategory
|
|
157
|
-
* @deprecated in 5.
|
|
157
|
+
* @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use DrawingCategory.insert(txn, ...) instead.
|
|
158
158
|
*/
|
|
159
159
|
static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;
|
|
160
160
|
}
|
|
@@ -196,7 +196,7 @@ export declare class SpatialCategory extends Category {
|
|
|
196
196
|
static insert(txn: EditTxn, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;
|
|
197
197
|
/**
|
|
198
198
|
* Insert a new SpatialCategory
|
|
199
|
-
* @deprecated in 5.
|
|
199
|
+
* @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use SpatialCategory.insert(txn, ...) instead.
|
|
200
200
|
*/
|
|
201
201
|
static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;
|
|
202
202
|
}
|
package/lib/cjs/Category.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-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;IAED;;;;;OAKG;IACI,MAAM,CAAC,UAAU,CAAC,MAAgB,EAAE,YAA4B,EAAE,SAAiB;QACxF,MAAM,QAAQ,GAAa,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,eAAe,CAAC,eAAe,EAAE,CAAC,CAAC;QACzF,OAAO,IAAI,kBAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,QAAkB,EAAE,iBAA6B,EAAE,IAAY;QAClF,MAAM,aAAa,GAAkB;YACnC,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,KAAK,EAAE,iBAAiB;YACxB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,iBAAiB,EAAE,IAAI,CAAC;YACxD,SAAS,EAAE,KAAK;SACjB,CAAC;QACF,OAAO,IAAI,eAAe,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;IAkBM,MAAM,CAAC,MAAM,CAAC,OAA2B,EAAE,iBAA6B,EAAE,IAAY,EAAE,iBAAsE;QACnK,MAAM,GAAG,GAAG,OAAO,YAAY,iBAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,sBAAY,CAAC,CAAC;QACzE,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,CAAC,CAAC;QAClE,QAAQ,CAAC,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACnC,QAAQ,CAAC,oBAAoB,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;QACtD,OAAO,QAAQ,CAAC,EAAE,CAAC;IACrB,CAAC;CACF;AAhED,0CAgEC","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 iModels\r\n */\r\n\r\nimport { Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport {\r\n BisCodeSpec, CategoryProps, Code, CodeScopeProps, CodeSpec, ElementProps, Rank, SubCategoryAppearance, SubCategoryProps,\r\n} from \"@itwin/core-common\";\r\nimport { DefinitionElement } from \"./Element\";\r\nimport { EditTxn } from \"./EditTxn\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { CategoryOwnsSubCategories } from \"./NavigationRelationship\";\r\nimport { CustomHandledProperty, DeserializeEntityArgs, ECSqlRow } from \"./Entity\";\r\nimport { _implicitTxn } from \"./internal/Symbols\";\r\n\r\n/** Defines the appearance for graphics in Geometric elements\r\n * @public @preview\r\n */\r\nexport class SubCategory extends DefinitionElement {\r\n public static override get className(): string { return \"SubCategory\"; }\r\n /** The Appearance parameters for this SubCategory */\r\n public appearance: SubCategoryAppearance;\r\n /** Optional description of this SubCategory. */\r\n public description?: string;\r\n\r\n protected constructor(props: SubCategoryProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.appearance = new SubCategoryAppearance(props.appearance);\r\n this.description = JsonUtils.asString(props.description);\r\n }\r\n\r\n /**\r\n * SubCategory custom HandledProps include 'description' and 'properties'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"description\", source: \"Class\" },\r\n { propertyName: \"properties\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * SubCategory deserializes 'description' and 'properties'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): SubCategoryProps {\r\n const elProps = super.deserialize(props) as SubCategoryProps;\r\n elProps.description = JsonUtils.asString(props.row.description);\r\n if (props.row.properties !== '') {\r\n elProps.appearance = JSON.parse(props.row.properties) as SubCategoryAppearance.Props;\r\n } else {\r\n elProps.appearance = undefined;\r\n }\r\n return elProps;\r\n }\r\n\r\n /**\r\n * SubCategory serialize 'description' and 'properties'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: SubCategoryProps, iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, iModel);\r\n if (props.description !== undefined) {\r\n inst.description = props.description;\r\n }\r\n if (props.appearance !== undefined) {\r\n inst.properties = JSON.stringify(props.appearance);\r\n }\r\n return inst;\r\n }\r\n\r\n public override toJSON(): SubCategoryProps {\r\n const val = super.toJSON() as SubCategoryProps;\r\n val.appearance = this.appearance.toJSON();\r\n if (this.description && this.description.length > 0)\r\n val.description = this.description;\r\n return val;\r\n }\r\n\r\n /** Get the SubCategory's name (its Code value). */\r\n public getSubCategoryName(): string { return this.code.value; }\r\n /** Get the Id of the SubCategory. */\r\n public getSubCategoryId(): Id64String { return this.id; }\r\n /** Get the Id of this SubCategory's parent Category. */\r\n public getCategoryId(): Id64String { return this.parent ? this.parent.id : Id64.invalid; }\r\n /** Check if this is the default SubCategory of its parent Category. */\r\n public get isDefaultSubCategory(): boolean { return IModelDb.getDefaultSubCategoryId(this.getCategoryId()) === this.getSubCategoryId(); }\r\n\r\n /** Create a Code for a SubCategory given a name that is meant to be unique within the scope of the specified parent Category.\r\n * @param iModel The IModel\r\n * @param parentCategoryId The Id of the parent Category that owns the SubCategory and provides the scope for its name.\r\n * @param codeValue The name of the SubCategory\r\n */\r\n public static createCode(iModel: IModelDb, parentCategoryId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.subCategory);\r\n return new Code({ spec: codeSpec.id, scope: parentCategoryId, value: codeValue });\r\n }\r\n\r\n /** Create a new SubCategory\r\n * @param iModelDb The iModel\r\n * @param parentCategoryId Create the new SubCategory as a child of this [[Category]]\r\n * @param name The name of the SubCategory\r\n * @param appearance The appearance settings to use for this SubCategory\r\n * @returns The newly constructed SubCategory element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): SubCategory {\r\n if (appearance instanceof SubCategoryAppearance)\r\n appearance = appearance.toJSON();\r\n\r\n const parentCategory = iModelDb.elements.getElement<Category>(parentCategoryId);\r\n const subCategoryProps: SubCategoryProps = {\r\n classFullName: this.classFullName,\r\n model: parentCategory.model,\r\n parent: new CategoryOwnsSubCategories(parentCategoryId),\r\n code: this.createCode(iModelDb, parentCategoryId, name),\r\n appearance,\r\n };\r\n return new SubCategory(subCategoryProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Insert a new SubCategory\r\n * @param txn The EditTxn to use\r\n * @param parentCategoryId Insert the new SubCategory as a child of this Category\r\n * @param name The name of the SubCategory\r\n * @param appearance The appearance settings to use for this SubCategory\r\n * @returns The Id of the newly inserted SubCategory element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n * @beta\r\n */\r\n public static insert(txn: EditTxn, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;\r\n /**\r\n * Insert a new SubCategory\r\n * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use SubCategory.insert(txn, ...) instead.\r\n */\r\n public static insert(iModelDb: IModelDb, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;\r\n public static insert(txnOrDb: EditTxn | IModelDb, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String {\r\n const txn = txnOrDb instanceof EditTxn ? txnOrDb : txnOrDb[_implicitTxn];\r\n const subCategory = this.create(txn.iModel, parentCategoryId, name, appearance);\r\n return subCategory.insert(txn);\r\n }\r\n}\r\n\r\n/** A Category element is the target of the `category` member of [[GeometricElement]].\r\n * @public @preview\r\n */\r\nexport class Category extends DefinitionElement {\r\n public static override get className(): string { return \"Category\"; }\r\n public rank: Rank = Rank.User;\r\n public description?: string;\r\n\r\n protected constructor(props: CategoryProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.rank = JsonUtils.asInt(props.rank);\r\n this.description = JsonUtils.asString(props.description);\r\n }\r\n\r\n /**\r\n * Category custom HandledProps include 'rank' and 'description'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"rank\", source: \"Class\" },\r\n { propertyName: \"description\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * Category deserializes 'rank' and 'description'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): CategoryProps {\r\n const elProps = super.deserialize(props) as CategoryProps;\r\n elProps.description = JsonUtils.asString(props.row.description);\r\n elProps.rank = JsonUtils.asInt(props.row.rank);\r\n return elProps;\r\n }\r\n\r\n /**\r\n * Category serialize 'rank' and 'description'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: CategoryProps, iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, iModel);\r\n if (undefined !== props.description) {\r\n inst.description = props.description;\r\n }\r\n inst.rank = props.rank;\r\n return inst;\r\n }\r\n public override toJSON(): CategoryProps {\r\n const val = super.toJSON() as CategoryProps;\r\n val.rank = this.rank;\r\n if (this.description && this.description.length > 0)\r\n val.description = this.description;\r\n return val;\r\n }\r\n\r\n /** Get the Id of the default SubCategory for this Category. */\r\n public myDefaultSubCategoryId(): Id64String { return IModelDb.getDefaultSubCategoryId(this.id); }\r\n\r\n /**\r\n * Set the appearance of the default SubCategory for this Category\r\n * @beta\r\n */\r\n public setDefaultAppearance(txn: EditTxn, props: SubCategoryAppearance.Props | SubCategoryAppearance): void;\r\n /**\r\n * Set the appearance of the default SubCategory for this Category\r\n * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use Category.setDefaultAppearance(txn, ...) instead.\r\n */\r\n public setDefaultAppearance(props: SubCategoryAppearance.Props | SubCategoryAppearance): void;\r\n public setDefaultAppearance(txnOrProps: EditTxn | SubCategoryAppearance.Props | SubCategoryAppearance, props?: SubCategoryAppearance.Props | SubCategoryAppearance): void {\r\n let txn: EditTxn;\r\n let appearance: SubCategoryAppearance.Props | SubCategoryAppearance;\r\n if (txnOrProps instanceof EditTxn) {\r\n txn = txnOrProps;\r\n if (props === undefined)\r\n throw new Error(\"Invalid argument\");\r\n appearance = props;\r\n } else {\r\n txn = this.iModel[_implicitTxn];\r\n appearance = txnOrProps;\r\n }\r\n if (appearance instanceof SubCategoryAppearance)\r\n appearance = appearance.toJSON();\r\n\r\n const subCat = this.iModel.elements.getElement<SubCategory>(this.myDefaultSubCategoryId());\r\n subCat.appearance = new SubCategoryAppearance(appearance);\r\n subCat.update(txn);\r\n }\r\n}\r\n\r\n/** Categorizes 2d GeometricElements.\r\n * @public @preview\r\n */\r\nexport class DrawingCategory extends Category {\r\n public static override get className(): string { return \"DrawingCategory\"; }\r\n\r\n protected constructor(opts: ElementProps, iModel: IModelDb) { super(opts, iModel); }\r\n\r\n /** Get the name of the CodeSpec that is used by DrawingCategory objects. */\r\n public static getCodeSpecName(): string { return BisCodeSpec.drawingCategory; }\r\n\r\n /** Looks up the CategoryId of a DrawingCategory by model and name */\r\n public static queryCategoryIdByName(iModel: IModelDb, scopeModelId: Id64String, categoryName: string): Id64String | undefined {\r\n const code: Code = DrawingCategory.createCode(iModel, scopeModelId, categoryName);\r\n return iModel.elements.queryElementIdByCode(code);\r\n }\r\n\r\n /** Create a Code for a DrawingCategory given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModel\r\n * @param scopeModelId The Id of the DefinitionModel that contains the DrawingCategory and provides the scope for its name.\r\n * @param codeValue The name of the category\r\n * @return A drawing category Code\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(DrawingCategory.getCodeSpecName());\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n /** Create a new DrawingCategory\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name of the DrawingCategory\r\n * @returns The newly constructed DrawingCategory element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string): DrawingCategory {\r\n const categoryProps: CategoryProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n isPrivate: false,\r\n };\r\n return new DrawingCategory(categoryProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Insert a new DrawingCategory\r\n * @param txn The EditTxn to use\r\n * @param definitionModelId Insert the new DrawingCategory into this [[DefinitionModel]]\r\n * @param name The name of the DrawingCategory\r\n * @param defaultAppearance The appearance settings to use for the default SubCategory of this DrawingCategory\r\n * @returns The Id of the newly inserted DrawingCategory element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n * @beta\r\n */\r\n public static insert(txn: EditTxn, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;\r\n /**\r\n * Insert a new DrawingCategory\r\n * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use DrawingCategory.insert(txn, ...) instead.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;\r\n public static insert(txnOrDb: EditTxn | IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String {\r\n const txn = txnOrDb instanceof EditTxn ? txnOrDb : txnOrDb[_implicitTxn];\r\n const category = this.create(txn.iModel, definitionModelId, name);\r\n category.id = category.insert(txn);\r\n category.setDefaultAppearance(txn, defaultAppearance);\r\n return category.id;\r\n }\r\n}\r\n\r\n/** Categorizes SpatialElements. See [how to create a SpatialCategory]($docs/learning/backend/CreateElements.md#SpatialCategory).\r\n * @public @preview\r\n */\r\nexport class SpatialCategory extends Category {\r\n public static override get className(): string { return \"SpatialCategory\"; }\r\n protected constructor(opts: ElementProps, iModel: IModelDb) { super(opts, iModel); }\r\n\r\n /** Get the name of the CodeSpec that is used by SpatialCategory objects. */\r\n public static getCodeSpecName(): string { return BisCodeSpec.spatialCategory; }\r\n\r\n /** Looks up the CategoryId of a SpatialCategory by model and name */\r\n public static queryCategoryIdByName(iModel: IModelDb, scopeModelId: Id64String, categoryName: string): Id64String | undefined {\r\n const code: Code = SpatialCategory.createCode(iModel, scopeModelId, categoryName);\r\n return iModel.elements.queryElementIdByCode(code);\r\n }\r\n\r\n /** Create a Code for a SpatialCategory given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModel\r\n * @param scopeModelId The Id of the DefinitionModel that contains the SpatialCategory and provides the scope for its name.\r\n * @param codeValue The name of the category\r\n * @return A spatial category Code\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(SpatialCategory.getCodeSpecName());\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n /** Create a new SpatialCategory\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the SpatialCategory\r\n * @returns The newly constructed SpatialCategory element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string): SpatialCategory {\r\n const categoryProps: CategoryProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n isPrivate: false,\r\n };\r\n return new SpatialCategory(categoryProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Insert a new SpatialCategory\r\n * @param txn The EditTxn to use\r\n * @param definitionModelId Insert the new SpatialCategory into this DefinitionModel\r\n * @param name The name of the SpatialCategory\r\n * @param defaultAppearance The appearance settings to use for the default SubCategory of this SpatialCategory\r\n * @returns The Id of the newly inserted SpatialCategory element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n * @beta\r\n */\r\n public static insert(txn: EditTxn, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;\r\n /**\r\n * Insert a new SpatialCategory\r\n * @deprecated in 5.1.9 - will not be removed until after 2026-08-04. Use SpatialCategory.insert(txn, ...) instead.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;\r\n public static insert(txnOrDb: EditTxn | IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String {\r\n const txn = txnOrDb instanceof EditTxn ? txnOrDb : txnOrDb[_implicitTxn];\r\n const category = this.create(txn.iModel, definitionModelId, name);\r\n category.id = category.insert(txn);\r\n category.setDefaultAppearance(txn, defaultAppearance);\r\n return category.id;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Category.js","sourceRoot":"","sources":["../../src/Category.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAkE;AAClE,oDAE4B;AAC5B,uCAA8C;AAC9C,uCAAoC;AACpC,yCAAsC;AACtC,qEAAqE;AAErE,gDAAkD;AAElD;;GAEG;AACH,MAAa,WAAY,SAAQ,2BAAiB;IACzC,MAAM,KAAc,SAAS,KAAa,OAAO,aAAa,CAAC,CAAC,CAAC;IACxE,qDAAqD;IAC9C,UAAU,CAAwB;IACzC,gDAAgD;IACzC,WAAW,CAAU;IAE5B,YAAsB,KAAuB,EAAE,MAAgB;QAC7D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,IAAI,mCAAqB,CAAC,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E,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,iBAAiB,EAAE,IAAI,CAAC;YACxD,SAAS,EAAE,KAAK;SACjB,CAAC;QACF,OAAO,IAAI,eAAe,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;IAkBM,MAAM,CAAC,MAAM,CAAC,OAA2B,EAAE,iBAA6B,EAAE,IAAY,EAAE,iBAAsE;QACnK,MAAM,GAAG,GAAG,OAAO,YAAY,iBAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,sBAAY,CAAC,CAAC;QACzE,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,CAAC,CAAC;QAClE,QAAQ,CAAC,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACnC,QAAQ,CAAC,oBAAoB,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;QACtD,OAAO,QAAQ,CAAC,EAAE,CAAC;IACrB,CAAC;CACF;AAhED,0CAgEC","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 iModels\r\n */\r\n\r\nimport { Id64, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport {\r\n BisCodeSpec, CategoryProps, Code, CodeScopeProps, CodeSpec, ElementProps, Rank, SubCategoryAppearance, SubCategoryProps,\r\n} from \"@itwin/core-common\";\r\nimport { DefinitionElement } from \"./Element\";\r\nimport { EditTxn } from \"./EditTxn\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { CategoryOwnsSubCategories } from \"./NavigationRelationship\";\r\nimport { CustomHandledProperty, DeserializeEntityArgs, ECSqlRow } from \"./Entity\";\r\nimport { _implicitTxn } from \"./internal/Symbols\";\r\n\r\n/** Defines the appearance for graphics in Geometric elements\r\n * @public @preview\r\n */\r\nexport class SubCategory extends DefinitionElement {\r\n public static override get className(): string { return \"SubCategory\"; }\r\n /** The Appearance parameters for this SubCategory */\r\n public appearance: SubCategoryAppearance;\r\n /** Optional description of this SubCategory. */\r\n public description?: string;\r\n\r\n protected constructor(props: SubCategoryProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.appearance = new SubCategoryAppearance(props.appearance);\r\n this.description = JsonUtils.asString(props.description);\r\n }\r\n\r\n /**\r\n * SubCategory custom HandledProps include 'description' and 'properties'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"description\", source: \"Class\" },\r\n { propertyName: \"properties\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * SubCategory deserializes 'description' and 'properties'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): SubCategoryProps {\r\n const elProps = super.deserialize(props) as SubCategoryProps;\r\n elProps.description = JsonUtils.asString(props.row.description);\r\n if (props.row.properties !== '') {\r\n elProps.appearance = JSON.parse(props.row.properties) as SubCategoryAppearance.Props;\r\n } else {\r\n elProps.appearance = undefined;\r\n }\r\n return elProps;\r\n }\r\n\r\n /**\r\n * SubCategory serialize 'description' and 'properties'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: SubCategoryProps, iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, iModel);\r\n if (props.description !== undefined) {\r\n inst.description = props.description;\r\n }\r\n if (props.appearance !== undefined) {\r\n inst.properties = JSON.stringify(props.appearance);\r\n }\r\n return inst;\r\n }\r\n\r\n public override toJSON(): SubCategoryProps {\r\n const val = super.toJSON() as SubCategoryProps;\r\n val.appearance = this.appearance.toJSON();\r\n if (this.description && this.description.length > 0)\r\n val.description = this.description;\r\n return val;\r\n }\r\n\r\n /** Get the SubCategory's name (its Code value). */\r\n public getSubCategoryName(): string { return this.code.value; }\r\n /** Get the Id of the SubCategory. */\r\n public getSubCategoryId(): Id64String { return this.id; }\r\n /** Get the Id of this SubCategory's parent Category. */\r\n public getCategoryId(): Id64String { return this.parent ? this.parent.id : Id64.invalid; }\r\n /** Check if this is the default SubCategory of its parent Category. */\r\n public get isDefaultSubCategory(): boolean { return IModelDb.getDefaultSubCategoryId(this.getCategoryId()) === this.getSubCategoryId(); }\r\n\r\n /** Create a Code for a SubCategory given a name that is meant to be unique within the scope of the specified parent Category.\r\n * @param iModel The IModel\r\n * @param parentCategoryId The Id of the parent Category that owns the SubCategory and provides the scope for its name.\r\n * @param codeValue The name of the SubCategory\r\n */\r\n public static createCode(iModel: IModelDb, parentCategoryId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.subCategory);\r\n return new Code({ spec: codeSpec.id, scope: parentCategoryId, value: codeValue });\r\n }\r\n\r\n /** Create a new SubCategory\r\n * @param iModelDb The iModel\r\n * @param parentCategoryId Create the new SubCategory as a child of this [[Category]]\r\n * @param name The name of the SubCategory\r\n * @param appearance The appearance settings to use for this SubCategory\r\n * @returns The newly constructed SubCategory element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): SubCategory {\r\n if (appearance instanceof SubCategoryAppearance)\r\n appearance = appearance.toJSON();\r\n\r\n const parentCategory = iModelDb.elements.getElement<Category>(parentCategoryId);\r\n const subCategoryProps: SubCategoryProps = {\r\n classFullName: this.classFullName,\r\n model: parentCategory.model,\r\n parent: new CategoryOwnsSubCategories(parentCategoryId),\r\n code: this.createCode(iModelDb, parentCategoryId, name),\r\n appearance,\r\n };\r\n return new SubCategory(subCategoryProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Insert a new SubCategory\r\n * @param txn The EditTxn to use\r\n * @param parentCategoryId Insert the new SubCategory as a child of this Category\r\n * @param name The name of the SubCategory\r\n * @param appearance The appearance settings to use for this SubCategory\r\n * @returns The Id of the newly inserted SubCategory element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n * @beta\r\n */\r\n public static insert(txn: EditTxn, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;\r\n /**\r\n * Insert a new SubCategory\r\n * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use SubCategory.insert(txn, ...) instead.\r\n */\r\n public static insert(iModelDb: IModelDb, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;\r\n public static insert(txnOrDb: EditTxn | IModelDb, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String {\r\n const txn = txnOrDb instanceof EditTxn ? txnOrDb : txnOrDb[_implicitTxn];\r\n const subCategory = this.create(txn.iModel, parentCategoryId, name, appearance);\r\n return subCategory.insert(txn);\r\n }\r\n}\r\n\r\n/** A Category element is the target of the `category` member of [[GeometricElement]].\r\n * @public @preview\r\n */\r\nexport class Category extends DefinitionElement {\r\n public static override get className(): string { return \"Category\"; }\r\n public rank: Rank = Rank.User;\r\n public description?: string;\r\n\r\n protected constructor(props: CategoryProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.rank = JsonUtils.asInt(props.rank);\r\n this.description = JsonUtils.asString(props.description);\r\n }\r\n\r\n /**\r\n * Category custom HandledProps include 'rank' and 'description'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"rank\", source: \"Class\" },\r\n { propertyName: \"description\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * Category deserializes 'rank' and 'description'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): CategoryProps {\r\n const elProps = super.deserialize(props) as CategoryProps;\r\n elProps.description = JsonUtils.asString(props.row.description);\r\n elProps.rank = JsonUtils.asInt(props.row.rank);\r\n return elProps;\r\n }\r\n\r\n /**\r\n * Category serialize 'rank' and 'description'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: CategoryProps, iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, iModel);\r\n if (undefined !== props.description) {\r\n inst.description = props.description;\r\n }\r\n inst.rank = props.rank;\r\n return inst;\r\n }\r\n public override toJSON(): CategoryProps {\r\n const val = super.toJSON() as CategoryProps;\r\n val.rank = this.rank;\r\n if (this.description && this.description.length > 0)\r\n val.description = this.description;\r\n return val;\r\n }\r\n\r\n /** Get the Id of the default SubCategory for this Category. */\r\n public myDefaultSubCategoryId(): Id64String { return IModelDb.getDefaultSubCategoryId(this.id); }\r\n\r\n /**\r\n * Set the appearance of the default SubCategory for this Category\r\n * @beta\r\n */\r\n public setDefaultAppearance(txn: EditTxn, props: SubCategoryAppearance.Props | SubCategoryAppearance): void;\r\n /**\r\n * Set the appearance of the default SubCategory for this Category\r\n * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use Category.setDefaultAppearance(txn, ...) instead.\r\n */\r\n public setDefaultAppearance(props: SubCategoryAppearance.Props | SubCategoryAppearance): void;\r\n public setDefaultAppearance(txnOrProps: EditTxn | SubCategoryAppearance.Props | SubCategoryAppearance, props?: SubCategoryAppearance.Props | SubCategoryAppearance): void {\r\n let txn: EditTxn;\r\n let appearance: SubCategoryAppearance.Props | SubCategoryAppearance;\r\n if (txnOrProps instanceof EditTxn) {\r\n txn = txnOrProps;\r\n if (props === undefined)\r\n throw new Error(\"Invalid argument\");\r\n appearance = props;\r\n } else {\r\n txn = this.iModel[_implicitTxn];\r\n appearance = txnOrProps;\r\n }\r\n if (appearance instanceof SubCategoryAppearance)\r\n appearance = appearance.toJSON();\r\n\r\n const subCat = this.iModel.elements.getElement<SubCategory>(this.myDefaultSubCategoryId());\r\n subCat.appearance = new SubCategoryAppearance(appearance);\r\n subCat.update(txn);\r\n }\r\n}\r\n\r\n/** Categorizes 2d GeometricElements.\r\n * @public @preview\r\n */\r\nexport class DrawingCategory extends Category {\r\n public static override get className(): string { return \"DrawingCategory\"; }\r\n\r\n protected constructor(opts: ElementProps, iModel: IModelDb) { super(opts, iModel); }\r\n\r\n /** Get the name of the CodeSpec that is used by DrawingCategory objects. */\r\n public static getCodeSpecName(): string { return BisCodeSpec.drawingCategory; }\r\n\r\n /** Looks up the CategoryId of a DrawingCategory by model and name */\r\n public static queryCategoryIdByName(iModel: IModelDb, scopeModelId: Id64String, categoryName: string): Id64String | undefined {\r\n const code: Code = DrawingCategory.createCode(iModel, scopeModelId, categoryName);\r\n return iModel.elements.queryElementIdByCode(code);\r\n }\r\n\r\n /** Create a Code for a DrawingCategory given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModel\r\n * @param scopeModelId The Id of the DefinitionModel that contains the DrawingCategory and provides the scope for its name.\r\n * @param codeValue The name of the category\r\n * @return A drawing category Code\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(DrawingCategory.getCodeSpecName());\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n /** Create a new DrawingCategory\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name of the DrawingCategory\r\n * @returns The newly constructed DrawingCategory element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string): DrawingCategory {\r\n const categoryProps: CategoryProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n isPrivate: false,\r\n };\r\n return new DrawingCategory(categoryProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Insert a new DrawingCategory\r\n * @param txn The EditTxn to use\r\n * @param definitionModelId Insert the new DrawingCategory into this [[DefinitionModel]]\r\n * @param name The name of the DrawingCategory\r\n * @param defaultAppearance The appearance settings to use for the default SubCategory of this DrawingCategory\r\n * @returns The Id of the newly inserted DrawingCategory element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n * @beta\r\n */\r\n public static insert(txn: EditTxn, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;\r\n /**\r\n * Insert a new DrawingCategory\r\n * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use DrawingCategory.insert(txn, ...) instead.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;\r\n public static insert(txnOrDb: EditTxn | IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String {\r\n const txn = txnOrDb instanceof EditTxn ? txnOrDb : txnOrDb[_implicitTxn];\r\n const category = this.create(txn.iModel, definitionModelId, name);\r\n category.id = category.insert(txn);\r\n category.setDefaultAppearance(txn, defaultAppearance);\r\n return category.id;\r\n }\r\n}\r\n\r\n/** Categorizes SpatialElements. See [how to create a SpatialCategory]($docs/learning/backend/CreateElements.md#SpatialCategory).\r\n * @public @preview\r\n */\r\nexport class SpatialCategory extends Category {\r\n public static override get className(): string { return \"SpatialCategory\"; }\r\n protected constructor(opts: ElementProps, iModel: IModelDb) { super(opts, iModel); }\r\n\r\n /** Get the name of the CodeSpec that is used by SpatialCategory objects. */\r\n public static getCodeSpecName(): string { return BisCodeSpec.spatialCategory; }\r\n\r\n /** Looks up the CategoryId of a SpatialCategory by model and name */\r\n public static queryCategoryIdByName(iModel: IModelDb, scopeModelId: Id64String, categoryName: string): Id64String | undefined {\r\n const code: Code = SpatialCategory.createCode(iModel, scopeModelId, categoryName);\r\n return iModel.elements.queryElementIdByCode(code);\r\n }\r\n\r\n /** Create a Code for a SpatialCategory given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n * @param iModel The IModel\r\n * @param scopeModelId The Id of the DefinitionModel that contains the SpatialCategory and provides the scope for its name.\r\n * @param codeValue The name of the category\r\n * @return A spatial category Code\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(SpatialCategory.getCodeSpecName());\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n /** Create a new SpatialCategory\r\n * @param iModelDb The iModel\r\n * @param definitionModelId The [[DefinitionModel]]\r\n * @param name The name/CodeValue of the SpatialCategory\r\n * @returns The newly constructed SpatialCategory element.\r\n * @throws [[IModelError]] if unable to create the element.\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string): SpatialCategory {\r\n const categoryProps: CategoryProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n isPrivate: false,\r\n };\r\n return new SpatialCategory(categoryProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Insert a new SpatialCategory\r\n * @param txn The EditTxn to use\r\n * @param definitionModelId Insert the new SpatialCategory into this DefinitionModel\r\n * @param name The name of the SpatialCategory\r\n * @param defaultAppearance The appearance settings to use for the default SubCategory of this SpatialCategory\r\n * @returns The Id of the newly inserted SpatialCategory element.\r\n * @throws [[IModelError]] if unable to insert the element.\r\n * @beta\r\n */\r\n public static insert(txn: EditTxn, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;\r\n /**\r\n * Insert a new SpatialCategory\r\n * @deprecated in 5.9.0 - will not be removed until after 2026-08-04. Use SpatialCategory.insert(txn, ...) instead.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;\r\n public static insert(txnOrDb: EditTxn | IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String {\r\n const txn = txnOrDb instanceof EditTxn ? txnOrDb : txnOrDb[_implicitTxn];\r\n const category = this.create(txn.iModel, definitionModelId, name);\r\n category.id = category.insert(txn);\r\n category.setDefaultAppearance(txn, defaultAppearance);\r\n return category.id;\r\n }\r\n}\r\n"]}
|
|
@@ -6,7 +6,7 @@ import { AnyDb, SqliteChangeOp, SqliteChangesetReader, SqliteValueStage } from "
|
|
|
6
6
|
/**
|
|
7
7
|
* Record meta data for the change.
|
|
8
8
|
* @beta
|
|
9
|
-
* @deprecated in 5.
|
|
9
|
+
* @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use [ChangeMeta]($backend) with [ChangesetReader]($backend) instead.
|
|
10
10
|
* */
|
|
11
11
|
export interface ChangeMetaData {
|
|
12
12
|
/** list of tables making up this EC change */
|
|
@@ -25,7 +25,7 @@ export interface ChangeMetaData {
|
|
|
25
25
|
/**
|
|
26
26
|
* Represent EC change derived from low level sqlite change
|
|
27
27
|
* @beta
|
|
28
|
-
* @deprecated in 5.
|
|
28
|
+
* @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use [ChangeInstance]($backend) with [ChangesetReader]($backend) instead.
|
|
29
29
|
*/
|
|
30
30
|
export interface ChangedECInstance {
|
|
31
31
|
ECInstanceId: Id64String;
|
|
@@ -36,7 +36,7 @@ export interface ChangedECInstance {
|
|
|
36
36
|
/**
|
|
37
37
|
* Represents a cache for unifying EC changes.
|
|
38
38
|
* @beta
|
|
39
|
-
* @deprecated in 5.
|
|
39
|
+
* @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use [ChangeCache]($backend) with [ChangesetReader]($backend) instead.
|
|
40
40
|
*/
|
|
41
41
|
export interface ECChangeUnifierCache extends Disposable {
|
|
42
42
|
/**
|
|
@@ -64,7 +64,7 @@ export interface ECChangeUnifierCache extends Disposable {
|
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
66
|
* @beta
|
|
67
|
-
* @deprecated in 5.
|
|
67
|
+
* @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use [ChangeUnifierCache.createInMemoryCache]($backend) / [ChangeUnifierCache.createSqliteBackedCache]($backend) instead.
|
|
68
68
|
*/
|
|
69
69
|
export declare namespace ECChangeUnifierCache {
|
|
70
70
|
/**
|
|
@@ -87,7 +87,7 @@ export declare namespace ECChangeUnifierCache {
|
|
|
87
87
|
* Partial changes is per table and a single instance can
|
|
88
88
|
* span multiple tables.
|
|
89
89
|
* @beta
|
|
90
|
-
* @deprecated in 5.
|
|
90
|
+
* @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use [PartialChangeUnifier]($backend) with [ChangesetReader]($backend) instead.
|
|
91
91
|
*/
|
|
92
92
|
export declare class PartialECChangeUnifier implements Disposable {
|
|
93
93
|
private _db;
|
|
@@ -147,7 +147,7 @@ export declare class PartialECChangeUnifier implements Disposable {
|
|
|
147
147
|
* it is per table while a single instance can span multiple table.
|
|
148
148
|
* @note PrimitiveArray and StructArray are not supported types.
|
|
149
149
|
* @beta
|
|
150
|
-
* @deprecated in 5.
|
|
150
|
+
* @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use [ChangesetReader]($backend) instead.
|
|
151
151
|
*
|
|
152
152
|
*/
|
|
153
153
|
export declare class ChangesetECAdaptor implements Disposable {
|
|
@@ -298,7 +298,7 @@ class ECDbMap {
|
|
|
298
298
|
/**
|
|
299
299
|
* Helper function to convert between JS DateTime & SQLite JulianDay values.
|
|
300
300
|
* @beta
|
|
301
|
-
* @deprecated in 5.
|
|
301
|
+
* @deprecated in 5.9.0 - will not be removed until after 2027-05-04. The DateTime namespace is deprecated and will be removed in a future release.
|
|
302
302
|
* */
|
|
303
303
|
var DateTime;
|
|
304
304
|
(function (DateTime) {
|
|
@@ -327,7 +327,7 @@ var DateTime;
|
|
|
327
327
|
})(DateTime || (DateTime = {}));
|
|
328
328
|
/**
|
|
329
329
|
* @beta
|
|
330
|
-
* @deprecated in 5.
|
|
330
|
+
* @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use [ChangeUnifierCache.createInMemoryCache]($backend) / [ChangeUnifierCache.createSqliteBackedCache]($backend) instead.
|
|
331
331
|
*/
|
|
332
332
|
var ECChangeUnifierCache;
|
|
333
333
|
(function (ECChangeUnifierCache) {
|
|
@@ -527,7 +527,7 @@ class SqliteBackedInstanceCache {
|
|
|
527
527
|
* Partial changes is per table and a single instance can
|
|
528
528
|
* span multiple tables.
|
|
529
529
|
* @beta
|
|
530
|
-
* @deprecated in 5.
|
|
530
|
+
* @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use [PartialChangeUnifier]($backend) with [ChangesetReader]($backend) instead.
|
|
531
531
|
*/
|
|
532
532
|
class PartialECChangeUnifier {
|
|
533
533
|
_db;
|
|
@@ -691,7 +691,7 @@ exports.PartialECChangeUnifier = PartialECChangeUnifier;
|
|
|
691
691
|
* it is per table while a single instance can span multiple table.
|
|
692
692
|
* @note PrimitiveArray and StructArray are not supported types.
|
|
693
693
|
* @beta
|
|
694
|
-
* @deprecated in 5.
|
|
694
|
+
* @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use [ChangesetReader]($backend) instead.
|
|
695
695
|
*
|
|
696
696
|
*/
|
|
697
697
|
class ChangesetECAdaptor {
|