@itwin/core-backend 4.6.0-dev.7 → 4.6.0-dev.9

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.
@@ -7,7 +7,7 @@ import { Schema } from "./Schema";
7
7
  *
8
8
  * It is automatically registered when [[IModelHost.startup]] is called.
9
9
  *
10
- * ** Example:**
10
+ * Example:
11
11
  * ``` ts
12
12
  * [[include:BisCore.registerSchemaAndGetClass]]
13
13
  * ```
@@ -27,7 +27,7 @@ const displayStyleMod = require("./DisplayStyle");
27
27
  *
28
28
  * It is automatically registered when [[IModelHost.startup]] is called.
29
29
  *
30
- * ** Example:**
30
+ * Example:
31
31
  * ``` ts
32
32
  * [[include:BisCore.registerSchemaAndGetClass]]
33
33
  * ```
@@ -1 +1 @@
1
- {"version":3,"file":"BisCoreSchema.js","sourceRoot":"","sources":["../../src/BisCoreSchema.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,6BAA6B;AAC7B,0CAA0C;AAC1C,mDAAgD;AAChD,wCAAwC;AACxC,6CAA6C;AAC7C,sDAAsD;AACtD,6CAA8C;AAC9C,0CAA0C;AAC1C,oCAAoC;AACpC,0CAA0C;AAC1C,qCAA2C;AAC3C,wCAAwC;AACxC,4CAA4C;AAC5C,kDAAkD;AAElD;;;;;;;;;;GAUG;AACH,MAAa,aAAc,SAAQ,eAAM;IAChC,MAAM,KAAc,UAAU,KAAa,OAAO,SAAS,CAAC,CAAC,CAAC;IAC9D,MAAM,KAAK,cAAc,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,2BAAc,CAAC,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC,UAAU,eAAe,CAAC,CAAC,CAAC,CAAC;IAEhK,gBAAgB;IACT,MAAM,CAAC,cAAc;QAC1B,IAAI,IAAI,KAAK,gBAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC;YACvD,OAAO;QAET,gBAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1C,gBAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAE7B,sHAAsH;QACtH;YACE,UAAU;YACV,SAAS;YACT,QAAQ;YACR,WAAW;YACX,OAAO;YACP,OAAO;YACP,UAAU;YACV,WAAW;YACX,iBAAiB;YACjB,eAAe;SAChB,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,6BAAa,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IACpE,CAAC;CACF;AA1BD,sCA0BC","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 Schema\r\n */\r\n\r\nimport * as path from \"path\";\r\nimport * as categoryMod from \"./Category\";\r\nimport { ClassRegistry } from \"./ClassRegistry\";\r\nimport * as elementMod from \"./Element\";\r\nimport * as aspectMod from \"./ElementAspect\";\r\nimport * as externalSourceMod from \"./ExternalSource\";\r\nimport { KnownLocations } from \"./IModelHost\";\r\nimport * as materialMod from \"./Material\";\r\nimport * as modelMod from \"./Model\";\r\nimport * as linkMod from \"./Relationship\";\r\nimport { Schema, Schemas } from \"./Schema\";\r\nimport * as textureMod from \"./Texture\";\r\nimport * as viewMod from \"./ViewDefinition\";\r\nimport * as displayStyleMod from \"./DisplayStyle\";\r\n\r\n/**\r\n * The [BisCore]($docs/bis/guide/fundamentals/schemas-domains.md) schema is the lowest level Schema in an iModel.\r\n *\r\n * It is automatically registered when [[IModelHost.startup]] is called.\r\n *\r\n * ** Example:**\r\n * ``` ts\r\n * [[include:BisCore.registerSchemaAndGetClass]]\r\n * ```\r\n * @public\r\n */\r\nexport class BisCoreSchema extends Schema {\r\n public static override get schemaName(): string { return \"BisCore\"; }\r\n public static get schemaFilePath(): string { return path.join(KnownLocations.nativeAssetsDir, \"ECSchemas\", \"Dgn\", `${BisCoreSchema.schemaName}.ecschema.xml`); }\r\n\r\n /** @internal */\r\n public static registerSchema() {\r\n if (this === Schemas.getRegisteredSchema(this.schemaName))\r\n return;\r\n\r\n Schemas.unregisterSchema(this.schemaName);\r\n Schemas.registerSchema(this);\r\n\r\n // this list should include all backend .ts files with implementations of Entity-based classes. Order does not matter.\r\n [\r\n elementMod,\r\n aspectMod,\r\n modelMod,\r\n categoryMod,\r\n viewMod,\r\n linkMod,\r\n textureMod,\r\n materialMod,\r\n externalSourceMod,\r\n displayStyleMod,\r\n ].forEach((module) => ClassRegistry.registerModule(module, this));\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"BisCoreSchema.js","sourceRoot":"","sources":["../../src/BisCoreSchema.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,6BAA6B;AAC7B,0CAA0C;AAC1C,mDAAgD;AAChD,wCAAwC;AACxC,6CAA6C;AAC7C,sDAAsD;AACtD,6CAA8C;AAC9C,0CAA0C;AAC1C,oCAAoC;AACpC,0CAA0C;AAC1C,qCAA2C;AAC3C,wCAAwC;AACxC,4CAA4C;AAC5C,kDAAkD;AAElD;;;;;;;;;;GAUG;AACH,MAAa,aAAc,SAAQ,eAAM;IAChC,MAAM,KAAc,UAAU,KAAa,OAAO,SAAS,CAAC,CAAC,CAAC;IAC9D,MAAM,KAAK,cAAc,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,2BAAc,CAAC,eAAe,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC,UAAU,eAAe,CAAC,CAAC,CAAC,CAAC;IAEhK,gBAAgB;IACT,MAAM,CAAC,cAAc;QAC1B,IAAI,IAAI,KAAK,gBAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC;YACvD,OAAO;QAET,gBAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1C,gBAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAE7B,sHAAsH;QACtH;YACE,UAAU;YACV,SAAS;YACT,QAAQ;YACR,WAAW;YACX,OAAO;YACP,OAAO;YACP,UAAU;YACV,WAAW;YACX,iBAAiB;YACjB,eAAe;SAChB,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,6BAAa,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IACpE,CAAC;CACF;AA1BD,sCA0BC","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 Schema\r\n */\r\n\r\nimport * as path from \"path\";\r\nimport * as categoryMod from \"./Category\";\r\nimport { ClassRegistry } from \"./ClassRegistry\";\r\nimport * as elementMod from \"./Element\";\r\nimport * as aspectMod from \"./ElementAspect\";\r\nimport * as externalSourceMod from \"./ExternalSource\";\r\nimport { KnownLocations } from \"./IModelHost\";\r\nimport * as materialMod from \"./Material\";\r\nimport * as modelMod from \"./Model\";\r\nimport * as linkMod from \"./Relationship\";\r\nimport { Schema, Schemas } from \"./Schema\";\r\nimport * as textureMod from \"./Texture\";\r\nimport * as viewMod from \"./ViewDefinition\";\r\nimport * as displayStyleMod from \"./DisplayStyle\";\r\n\r\n/**\r\n * The [BisCore]($docs/bis/guide/fundamentals/schemas-domains.md) schema is the lowest level Schema in an iModel.\r\n *\r\n * It is automatically registered when [[IModelHost.startup]] is called.\r\n *\r\n * Example:\r\n * ``` ts\r\n * [[include:BisCore.registerSchemaAndGetClass]]\r\n * ```\r\n * @public\r\n */\r\nexport class BisCoreSchema extends Schema {\r\n public static override get schemaName(): string { return \"BisCore\"; }\r\n public static get schemaFilePath(): string { return path.join(KnownLocations.nativeAssetsDir, \"ECSchemas\", \"Dgn\", `${BisCoreSchema.schemaName}.ecschema.xml`); }\r\n\r\n /** @internal */\r\n public static registerSchema() {\r\n if (this === Schemas.getRegisteredSchema(this.schemaName))\r\n return;\r\n\r\n Schemas.unregisterSchema(this.schemaName);\r\n Schemas.registerSchema(this);\r\n\r\n // this list should include all backend .ts files with implementations of Entity-based classes. Order does not matter.\r\n [\r\n elementMod,\r\n aspectMod,\r\n modelMod,\r\n categoryMod,\r\n viewMod,\r\n linkMod,\r\n textureMod,\r\n materialMod,\r\n externalSourceMod,\r\n displayStyleMod,\r\n ].forEach((module) => ClassRegistry.registerModule(module, this));\r\n }\r\n}\r\n"]}
@@ -5,7 +5,9 @@ import { EntityMetaData, IModelError } from "@itwin/core-common";
5
5
  import { Entity } from "./Entity";
6
6
  import { IModelDb } from "./IModelDb";
7
7
  import { Schema } from "./Schema";
8
- /** The mapping between a BIS class name (in the form "schema:class") and its JavaScript constructor function
8
+ /** Maintains the mapping between the name of a BIS [ECClass]($ecschema-metadata) (in "schema:class" format) and the JavaScript [[Entity]] class that implements it.
9
+ * Applications or modules that supply their own Entity subclasses should use [[registerModule]] or [[register]] at startup
10
+ * to establish their mappings.
9
11
  * @public
10
12
  */
11
13
  export declare class ClassRegistry {
@@ -14,7 +16,10 @@ export declare class ClassRegistry {
14
16
  static isNotFoundError(err: any): boolean;
15
17
  /** @internal */
16
18
  static makeMetaDataNotFoundError(className: string): IModelError;
17
- /** @internal */
19
+ /** Register a single `entityClass` defined in the specified `schema`.
20
+ * @see [[registerModule]] to register multiple classes.
21
+ * @public
22
+ */
18
23
  static register(entityClass: typeof Entity, schema: typeof Schema): void;
19
24
  /** Generate a proxy Schema for a domain that has not been registered. */
20
25
  private static generateProxySchema;
@@ -30,9 +35,10 @@ export declare class ClassRegistry {
30
35
  * @param entityMetaData The Entity metadata that defines the class
31
36
  */
32
37
  private static generateClassForEntity;
33
- /** Register all of the classes found in the given module that derive from Entity. See the example in [[Schema]]
38
+ /** Register all of the classes found in the given module that derive from [[Entity]].
39
+ * [[register]] will be invoked for each subclass of `Entity` exported by `moduleObj`.
34
40
  * @param moduleObj The module to search for subclasses of Entity
35
- * @param schema The schema for all found classes
41
+ * @param schema The schema that contains all of the [ECClass]($ecschema-metadata)es exported by `moduleObj`.
36
42
  */
37
43
  static registerModule(moduleObj: any, schema: typeof Schema): void;
38
44
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ClassRegistry.d.ts","sourceRoot":"","sources":["../../src/ClassRegistry.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAsB,WAAW,EAAkB,MAAM,oBAAoB,CAAC;AACrG,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAW,MAAM,UAAU,CAAC;AAM3C;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAoC;IACrE,gBAAgB;WACF,eAAe,CAAC,GAAG,EAAE,GAAG;IACtC,gBAAgB;WACF,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW;IACvE,gBAAgB;WACF,QAAQ,CAAC,WAAW,EAAE,OAAO,MAAM,EAAE,MAAM,EAAE,OAAO,MAAM;IAYxE,yEAAyE;IACzE,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAqBlC;;;;;;OAMG;WACW,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM;IAkB9E;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAyGrC;;;OAGG;WACW,cAAc,CAAC,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,MAAM;IAQlE;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAa5B;;;;OAIG;WACW,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,MAAM,GAAG,SAAS;IAInF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AAC,sBAAsB;IAyGrC;;;;OAIG;WACW,cAAc,CAAC,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,MAAM;IAQlE;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAa5B;;;;OAIG;WACW,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,MAAM,GAAG,SAAS;IAInF;;;;OAIG;WACW,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAG,OAAO,MAAM;IAM9E;;;;;OAKG;WACW,eAAe,CAAC,aAAa,EAAE,MAAM;IACnD;;;;OAIG;WACW,qBAAqB,CAAC,MAAM,EAAE,OAAO,MAAM;CAM1D;AAED;;;;GAIG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,SAAS,CAAkE;IAEnF,wCAAwC;IACjC,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAE9D,gCAAgC;IACzB,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI;CAClE"}
@@ -19,7 +19,9 @@ const Schema_1 = require("./Schema");
19
19
  const EntityReferences_1 = require("./EntityReferences");
20
20
  const assert = require("assert");
21
21
  const isGeneratedClassTag = Symbol("isGeneratedClassTag");
22
- /** The mapping between a BIS class name (in the form "schema:class") and its JavaScript constructor function
22
+ /** Maintains the mapping between the name of a BIS [ECClass]($ecschema-metadata) (in "schema:class" format) and the JavaScript [[Entity]] class that implements it.
23
+ * Applications or modules that supply their own Entity subclasses should use [[registerModule]] or [[register]] at startup
24
+ * to establish their mappings.
23
25
  * @public
24
26
  */
25
27
  class ClassRegistry {
@@ -27,7 +29,10 @@ class ClassRegistry {
27
29
  static isNotFoundError(err) { return (err instanceof core_common_1.IModelError) && (err.errorNumber === core_bentley_1.IModelStatus.NotFound); }
28
30
  /** @internal */
29
31
  static makeMetaDataNotFoundError(className) { return new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, `metadata not found for ${className}`); }
30
- /** @internal */
32
+ /** Register a single `entityClass` defined in the specified `schema`.
33
+ * @see [[registerModule]] to register multiple classes.
34
+ * @public
35
+ */
31
36
  static register(entityClass, schema) {
32
37
  entityClass.schema = schema;
33
38
  const key = (`${schema.schemaName}:${entityClass.className}`).toLowerCase();
@@ -174,9 +179,10 @@ class ClassRegistry {
174
179
  this.register(generatedClass, schema); // register it before returning
175
180
  return generatedClass;
176
181
  }
177
- /** Register all of the classes found in the given module that derive from Entity. See the example in [[Schema]]
182
+ /** Register all of the classes found in the given module that derive from [[Entity]].
183
+ * [[register]] will be invoked for each subclass of `Entity` exported by `moduleObj`.
178
184
  * @param moduleObj The module to search for subclasses of Entity
179
- * @param schema The schema for all found classes
185
+ * @param schema The schema that contains all of the [ECClass]($ecschema-metadata)es exported by `moduleObj`.
180
186
  */
181
187
  static registerModule(moduleObj, schema) {
182
188
  for (const thisMember in moduleObj) { // eslint-disable-line guard-for-in
@@ -1 +1 @@
1
- {"version":3,"file":"ClassRegistry.js","sourceRoot":"","sources":["../../src/ClassRegistry.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;AAEH,sDAA2E;AAC3E,oDAAqG;AACrG,qCAAkC;AAElC,qCAA2C;AAC3C,yDAAsD;AACtD,iCAAiC;AAEjC,MAAM,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAa,aAAa;IAExB,gBAAgB;IACT,MAAM,CAAC,eAAe,CAAC,GAAQ,IAAI,OAAO,CAAC,GAAG,YAAY,yBAAW,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,KAAK,2BAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC/H,gBAAgB;IACT,MAAM,CAAC,yBAAyB,CAAC,SAAiB,IAAiB,OAAO,IAAI,yBAAW,CAAC,2BAAY,CAAC,QAAQ,EAAE,0BAA0B,SAAS,EAAE,CAAC,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IALC,wCAAwC;IACjC,IAAI,CAAC,aAAqB,IAAgC,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;IAE1H,gCAAgC;IACzB,GAAG,CAAC,aAAqB,EAAE,QAAwB,IAAU,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,WAAW,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;CACjI;AARD,4CAQC","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 Schema\r\n */\r\n\r\nimport { DbResult, Id64, IModelStatus, Logger } from \"@itwin/core-bentley\";\r\nimport { EntityMetaData, EntityReferenceSet, IModelError, RelatedElement } from \"@itwin/core-common\";\r\nimport { Entity } from \"./Entity\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { Schema, Schemas } from \"./Schema\";\r\nimport { EntityReferences } from \"./EntityReferences\";\r\nimport * as assert from \"assert\";\r\n\r\nconst isGeneratedClassTag = Symbol(\"isGeneratedClassTag\");\r\n\r\n/** The mapping between a BIS class name (in the form \"schema:class\") and its JavaScript constructor function\r\n * @public\r\n */\r\nexport class ClassRegistry {\r\n private static readonly _classMap = new Map<string, typeof Entity>();\r\n /** @internal */\r\n public static isNotFoundError(err: any) { return (err instanceof IModelError) && (err.errorNumber === IModelStatus.NotFound); }\r\n /** @internal */\r\n public static makeMetaDataNotFoundError(className: string): IModelError { return new IModelError(IModelStatus.NotFound, `metadata not found for ${className}`); }\r\n /** @internal */\r\n public static register(entityClass: typeof Entity, schema: typeof Schema) {\r\n entityClass.schema = schema;\r\n const key = (`${schema.schemaName}:${entityClass.className}`).toLowerCase();\r\n if (this._classMap.has(key)) {\r\n const errMsg = `Class ${key} is already registered. Make sure static className member is correct on JavaScript class ${entityClass.name}`;\r\n Logger.logError(\"core-frontend.classRegistry\", errMsg);\r\n throw new Error(errMsg);\r\n }\r\n\r\n this._classMap.set(key, entityClass);\r\n }\r\n\r\n /** Generate a proxy Schema for a domain that has not been registered. */\r\n private static generateProxySchema(domain: string, iModel: IModelDb): typeof Schema {\r\n const hasBehavior = iModel.withPreparedSqliteStatement(`\r\n SELECT NULL FROM [ec_CustomAttribute] [c]\r\n JOIN [ec_schema] [s] ON [s].[Id] = [c].[ContainerId]\r\n JOIN [ec_class] [e] ON [e].[Id] = [c].[ClassId]\r\n JOIN [ec_schema] [b] ON [e].[SchemaId] = [b].[Id]\r\n WHERE [c].[ContainerType] = 1 AND [s].[Name] = ? AND [b].[Name] || '.' || [e].[name] = ?`, (stmt) => {\r\n stmt.bindString(1, domain);\r\n stmt.bindString(2, \"BisCore.SchemaHasBehavior\");\r\n return stmt.step() === DbResult.BE_SQLITE_ROW;\r\n });\r\n\r\n const schemaClass = class extends Schema {\r\n public static override get schemaName() { return domain; }\r\n public static override get missingRequiredBehavior() { return hasBehavior; }\r\n };\r\n\r\n Schemas.registerSchema(schemaClass); // register the class before we return it.\r\n return schemaClass;\r\n }\r\n\r\n /** First, finds the root BisCore entity class for an entity, by traversing base classes and mixin targets (AppliesTo).\r\n * Then, gets its metadata and returns that.\r\n * @param iModel - iModel containing the metadata for this type\r\n * @param ecTypeQualifier - a full name of an ECEntityClass to find the root of\r\n * @returns the qualified full name of an ECEntityClass\r\n * @internal public for testing only\r\n */\r\n public static getRootEntity(iModel: IModelDb, ecTypeQualifier: string): string {\r\n const [classSchema, className] = ecTypeQualifier.split(\".\");\r\n const schemaItemJson = iModel.nativeDb.getSchemaItem(classSchema, className);\r\n if (schemaItemJson.error)\r\n throw new IModelError(schemaItemJson.error.status, `failed to get schema item '${ecTypeQualifier}'`);\r\n\r\n assert(undefined !== schemaItemJson.result);\r\n const schemaItem = JSON.parse(schemaItemJson.result);\r\n if (!(\"appliesTo\" in schemaItem) && schemaItem.baseClass === undefined) {\r\n return ecTypeQualifier;\r\n }\r\n\r\n // typescript doesn't understand that the inverse of the above condition is\r\n // (\"appliesTo\" in rootclassMetaData || rootClassMetaData.baseClass !== undefined)\r\n const parentItemQualifier = schemaItem.appliesTo ?? schemaItem.baseClass as string;\r\n return this.getRootEntity(iModel, parentItemQualifier);\r\n }\r\n\r\n /** Generate a JavaScript class from Entity metadata.\r\n * @param entityMetaData The Entity metadata that defines the class\r\n */\r\n private static generateClassForEntity(entityMetaData: EntityMetaData, iModel: IModelDb): typeof Entity {\r\n const name = entityMetaData.ecclass.split(\":\");\r\n const domainName = name[0];\r\n const className = name[1];\r\n\r\n if (0 === entityMetaData.baseClasses.length) // metadata must contain a superclass\r\n throw new IModelError(IModelStatus.BadArg, `class ${name} has no superclass`);\r\n\r\n // make sure schema exists\r\n let schema = Schemas.getRegisteredSchema(domainName);\r\n if (undefined === schema)\r\n schema = this.generateProxySchema(domainName, iModel); // no schema found, create it too\r\n\r\n const superclass = this._classMap.get(entityMetaData.baseClasses[0].toLowerCase());\r\n if (undefined === superclass)\r\n throw new IModelError(IModelStatus.NotFound, `cannot find superclass for class ${name}`);\r\n\r\n // user defined class hierarchies may skip a class in the hierarchy, and therefore their JS base class cannot\r\n // be used to tell if there are any generated classes in the hierarchy\r\n let generatedClassHasNonGeneratedNonCoreAncestor = false;\r\n let currentSuperclass = superclass;\r\n const MAX_ITERS = 1000;\r\n for (let i = 0; i < MAX_ITERS; ++i) {\r\n if (currentSuperclass.schema.schemaName === \"BisCore\")\r\n break;\r\n\r\n if (!currentSuperclass.isGeneratedClass) {\r\n generatedClassHasNonGeneratedNonCoreAncestor = true;\r\n break;\r\n }\r\n const superclassMetaData = iModel.classMetaDataRegistry.find(currentSuperclass.classFullName);\r\n if (superclassMetaData === undefined)\r\n throw new IModelError(IModelStatus.BadSchema, `could not find the metadata for class '${currentSuperclass.name}', class metadata should be loaded by now`);\r\n const maybeNextSuperclass = this.getClass(superclassMetaData.baseClasses[0], iModel);\r\n if (maybeNextSuperclass === undefined)\r\n throw new IModelError(IModelStatus.BadSchema, `could not find the base class of '${currentSuperclass.name}', all generated classes must have a base class`);\r\n currentSuperclass = maybeNextSuperclass;\r\n }\r\n\r\n const generatedClass = class extends superclass {\r\n public static override get className() { return className; }\r\n private static [isGeneratedClassTag] = true;\r\n public static override get isGeneratedClass() { return this.hasOwnProperty(isGeneratedClassTag); }\r\n };\r\n\r\n // the above creates an anonymous class. For help debugging, set the \"constructor.name\" property to be the same as the bisClassName.\r\n Object.defineProperty(generatedClass, \"name\", { get: () => className }); // this is the (only) way to change that readonly property.\r\n\r\n // a class only gets an automatic `collectReferenceIds` implementation if:\r\n // - it is not in the `BisCore` schema\r\n // - there are no ancestors with manually registered JS implementations, (excluding BisCore base classes)\r\n if (!generatedClassHasNonGeneratedNonCoreAncestor) {\r\n const navigationProps = Object.entries(entityMetaData.properties)\r\n .filter(([_name, prop]) => prop.isNavigation)\r\n // eslint-disable-next-line @typescript-eslint/no-shadow\r\n .map(([name, prop]) => {\r\n assert(prop.relationshipClass);\r\n const maybeMetaData = iModel.nativeDb.getSchemaItem(...prop.relationshipClass.split(\":\") as [string, string]);\r\n assert(maybeMetaData.result !== undefined, \"The nav props relationship metadata was not found\");\r\n const relMetaData = JSON.parse(maybeMetaData.result);\r\n const rootClassMetaData = ClassRegistry.getRootEntity(iModel, relMetaData.target.constraintClasses[0]);\r\n // root class must be in BisCore so should be loaded since biscore classes will never get this\r\n // generated implementation\r\n const normalizeClassName = (clsName: string) => clsName.replace(\".\", \":\");\r\n const rootClass = ClassRegistry.findRegisteredClass(normalizeClassName(rootClassMetaData));\r\n assert(rootClass, `The root class for ${prop.relationshipClass} was not in BisCore.`);\r\n return { name, concreteEntityType: EntityReferences.typeFromClass(rootClass) };\r\n });\r\n\r\n Object.defineProperty(\r\n generatedClass.prototype,\r\n \"collectReferenceIds\",\r\n {\r\n value(this: typeof generatedClass, referenceIds: EntityReferenceSet) {\r\n // eslint-disable-next-line @typescript-eslint/dot-notation\r\n const superImpl = superclass.prototype[\"collectReferenceIds\"];\r\n superImpl.call(this, referenceIds);\r\n for (const navProp of navigationProps) {\r\n const relatedElem: RelatedElement | undefined = (this as any)[navProp.name]; // cast to any since subclass can have any extensions\r\n if (!relatedElem || !Id64.isValid(relatedElem.id))\r\n continue;\r\n const referenceId = EntityReferences.fromEntityType(relatedElem.id, navProp.concreteEntityType);\r\n referenceIds.add(referenceId);\r\n }\r\n },\r\n // defaults for methods on a prototype (required for sinon to stub out methods on tests)\r\n writable: true,\r\n configurable: true,\r\n },\r\n );\r\n }\r\n\r\n // if the schema is a proxy for a domain with behavior, throw exceptions for all protected operations\r\n if (schema.missingRequiredBehavior) {\r\n const throwError = () => {\r\n throw new IModelError(IModelStatus.WrongHandler, `Schema [${domainName}] not registered, but is marked with SchemaHasBehavior`);\r\n };\r\n\r\n superclass.protectedOperations.forEach((operation) => (generatedClass as any)[operation] = throwError);\r\n }\r\n\r\n this.register(generatedClass, schema); // register it before returning\r\n return generatedClass;\r\n }\r\n\r\n /** Register all of the classes found in the given module that derive from Entity. See the example in [[Schema]]\r\n * @param moduleObj The module to search for subclasses of Entity\r\n * @param schema The schema for all found classes\r\n */\r\n public static registerModule(moduleObj: any, schema: typeof Schema) {\r\n for (const thisMember in moduleObj) { // eslint-disable-line guard-for-in\r\n const thisClass = moduleObj[thisMember];\r\n if (thisClass.prototype instanceof Entity)\r\n this.register(thisClass, schema);\r\n }\r\n }\r\n\r\n /**\r\n * This function fetches the specified Entity from the imodel, generates a JavaScript class for it, and registers the generated\r\n * class. This function also ensures that all of the base classes of the Entity exist and are registered.\r\n */\r\n private static generateClass(classFullName: string, iModel: IModelDb): typeof Entity {\r\n const metadata: EntityMetaData | undefined = iModel.classMetaDataRegistry.find(classFullName);\r\n if (metadata === undefined || metadata.ecclass === undefined)\r\n throw this.makeMetaDataNotFoundError(classFullName);\r\n\r\n // Make sure we have all base classes registered.\r\n if (metadata.baseClasses && (0 !== metadata.baseClasses.length))\r\n this.getClass(metadata.baseClasses[0], iModel);\r\n\r\n // Now we can generate the class from the classDef.\r\n return this.generateClassForEntity(metadata, iModel);\r\n }\r\n\r\n /** Find a registered class by classFullName.\r\n * @param classFullName class to find\r\n * @param iModel The IModel that contains the class definitions\r\n * @returns The Entity class or undefined\r\n */\r\n public static findRegisteredClass(classFullName: string): typeof Entity | undefined {\r\n return this._classMap.get(classFullName.toLowerCase());\r\n }\r\n\r\n /** Get the Entity class for the specified Entity className.\r\n * @param classFullName The full BIS class name of the Entity\r\n * @param iModel The IModel that contains the class definitions\r\n * @returns The Entity class\r\n */\r\n public static getClass(classFullName: string, iModel: IModelDb): typeof Entity {\r\n const key = classFullName.toLowerCase();\r\n const ctor = this._classMap.get(key);\r\n return ctor ? ctor : this.generateClass(key, iModel);\r\n }\r\n\r\n /** Unregister a class, by name, if one is already registered.\r\n * This function is not normally needed, but is useful for cases where a generated *proxy* class needs to be replaced by the *real* class.\r\n * @param classFullName Name of the class to unregister\r\n * @return true if the class was unregistered\r\n * @internal\r\n */\r\n public static unregisterCLass(classFullName: string) { return this._classMap.delete(classFullName.toLowerCase()); }\r\n /** Unregister all classes from a schema.\r\n * This function is not normally needed, but is useful for cases where a generated *proxy* schema needs to be replaced by the *real* schema.\r\n * @param schema Name of the schema to unregister\r\n * @internal\r\n */\r\n public static unregisterClassesFrom(schema: typeof Schema) {\r\n for (const entry of Array.from(this._classMap)) {\r\n if (entry[1].schema === schema)\r\n this.unregisterCLass(entry[0]);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * A cache that records the mapping between class names and class metadata.\r\n * @see [[IModelDb.classMetaDataRegistry]] to access the registry for a specific iModel.\r\n * @internal\r\n */\r\nexport class MetaDataRegistry {\r\n private _registry: Map<string, EntityMetaData> = new Map<string, EntityMetaData>();\r\n\r\n /** Get the specified Entity metadata */\r\n public find(classFullName: string): EntityMetaData | undefined { return this._registry.get(classFullName.toLowerCase()); }\r\n\r\n /** Add metadata to the cache */\r\n public add(classFullName: string, metaData: EntityMetaData): void { this._registry.set(classFullName.toLowerCase(), metaData); }\r\n}\r\n"]}
1
+ {"version":3,"file":"ClassRegistry.js","sourceRoot":"","sources":["../../src/ClassRegistry.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;;AAEH,sDAA2E;AAC3E,oDAAqG;AACrG,qCAAkC;AAElC,qCAA2C;AAC3C,yDAAsD;AACtD,iCAAiC;AAEjC,MAAM,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AAE1D;;;;GAIG;AACH,MAAa,aAAa;IAExB,gBAAgB;IACT,MAAM,CAAC,eAAe,CAAC,GAAQ,IAAI,OAAO,CAAC,GAAG,YAAY,yBAAW,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,KAAK,2BAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC/H,gBAAgB;IACT,MAAM,CAAC,yBAAyB,CAAC,SAAiB,IAAiB,OAAO,IAAI,yBAAW,CAAC,2BAAY,CAAC,QAAQ,EAAE,0BAA0B,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;IACjK;;;OAGG;IACI,MAAM,CAAC,QAAQ,CAAC,WAA0B,EAAE,MAAqB;QACtE,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC;QAC5B,MAAM,GAAG,GAAG,CAAC,GAAG,MAAM,CAAC,UAAU,IAAI,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAC5E,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YAC3B,MAAM,MAAM,GAAG,SAAS,GAAG,4FAA4F,WAAW,CAAC,IAAI,EAAE,CAAC;YAC1I,qBAAM,CAAC,QAAQ,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;YACvD,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;SACzB;QAED,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,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,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,eAAe,CAAC,aAAqB,IAAI,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;IACnH;;;;OAIG;IACI,MAAM,CAAC,qBAAqB,CAAC,MAAqB;QACvD,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;YAC9C,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM;gBAC5B,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SAClC;IACH,CAAC;;AAnPuB,uBAAS,GAAG,IAAI,GAAG,EAAyB,CAAC;AAD1D,sCAAa;AAuP1B;;;;GAIG;AACH,MAAa,gBAAgB;IAA7B;QACU,cAAS,GAAgC,IAAI,GAAG,EAA0B,CAAC;IAOrF,CAAC;IALC,wCAAwC;IACjC,IAAI,CAAC,aAAqB,IAAgC,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;IAE1H,gCAAgC;IACzB,GAAG,CAAC,aAAqB,EAAE,QAAwB,IAAU,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,WAAW,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;CACjI;AARD,4CAQC","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 Schema\r\n */\r\n\r\nimport { DbResult, Id64, IModelStatus, Logger } from \"@itwin/core-bentley\";\r\nimport { EntityMetaData, EntityReferenceSet, IModelError, RelatedElement } from \"@itwin/core-common\";\r\nimport { Entity } from \"./Entity\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { Schema, Schemas } from \"./Schema\";\r\nimport { EntityReferences } from \"./EntityReferences\";\r\nimport * as assert from \"assert\";\r\n\r\nconst isGeneratedClassTag = Symbol(\"isGeneratedClassTag\");\r\n\r\n/** Maintains the mapping between the name of a BIS [ECClass]($ecschema-metadata) (in \"schema:class\" format) and the JavaScript [[Entity]] class that implements it.\r\n * Applications or modules that supply their own Entity subclasses should use [[registerModule]] or [[register]] at startup\r\n * to establish their mappings.\r\n * @public\r\n */\r\nexport class ClassRegistry {\r\n private static readonly _classMap = new Map<string, typeof Entity>();\r\n /** @internal */\r\n public static isNotFoundError(err: any) { return (err instanceof IModelError) && (err.errorNumber === IModelStatus.NotFound); }\r\n /** @internal */\r\n public static makeMetaDataNotFoundError(className: string): IModelError { return new IModelError(IModelStatus.NotFound, `metadata not found for ${className}`); }\r\n /** Register a single `entityClass` defined in the specified `schema`.\r\n * @see [[registerModule]] to register multiple classes.\r\n * @public\r\n */\r\n public static register(entityClass: typeof Entity, schema: typeof Schema) {\r\n entityClass.schema = schema;\r\n const key = (`${schema.schemaName}:${entityClass.className}`).toLowerCase();\r\n if (this._classMap.has(key)) {\r\n const errMsg = `Class ${key} is already registered. Make sure static className member is correct on JavaScript class ${entityClass.name}`;\r\n Logger.logError(\"core-frontend.classRegistry\", errMsg);\r\n throw new Error(errMsg);\r\n }\r\n\r\n this._classMap.set(key, entityClass);\r\n }\r\n\r\n /** Generate a proxy Schema for a domain that has not been registered. */\r\n private static generateProxySchema(domain: string, iModel: IModelDb): typeof Schema {\r\n const hasBehavior = iModel.withPreparedSqliteStatement(`\r\n SELECT NULL FROM [ec_CustomAttribute] [c]\r\n JOIN [ec_schema] [s] ON [s].[Id] = [c].[ContainerId]\r\n JOIN [ec_class] [e] ON [e].[Id] = [c].[ClassId]\r\n JOIN [ec_schema] [b] ON [e].[SchemaId] = [b].[Id]\r\n WHERE [c].[ContainerType] = 1 AND [s].[Name] = ? AND [b].[Name] || '.' || [e].[name] = ?`, (stmt) => {\r\n stmt.bindString(1, domain);\r\n stmt.bindString(2, \"BisCore.SchemaHasBehavior\");\r\n return stmt.step() === DbResult.BE_SQLITE_ROW;\r\n });\r\n\r\n const schemaClass = class extends Schema {\r\n public static override get schemaName() { return domain; }\r\n public static override get missingRequiredBehavior() { return hasBehavior; }\r\n };\r\n\r\n Schemas.registerSchema(schemaClass); // register the class before we return it.\r\n return schemaClass;\r\n }\r\n\r\n /** First, finds the root BisCore entity class for an entity, by traversing base classes and mixin targets (AppliesTo).\r\n * Then, gets its metadata and returns that.\r\n * @param iModel - iModel containing the metadata for this type\r\n * @param ecTypeQualifier - a full name of an ECEntityClass to find the root of\r\n * @returns the qualified full name of an ECEntityClass\r\n * @internal public for testing only\r\n */\r\n public static getRootEntity(iModel: IModelDb, ecTypeQualifier: string): string {\r\n const [classSchema, className] = ecTypeQualifier.split(\".\");\r\n const schemaItemJson = iModel.nativeDb.getSchemaItem(classSchema, className);\r\n if (schemaItemJson.error)\r\n throw new IModelError(schemaItemJson.error.status, `failed to get schema item '${ecTypeQualifier}'`);\r\n\r\n assert(undefined !== schemaItemJson.result);\r\n const schemaItem = JSON.parse(schemaItemJson.result);\r\n if (!(\"appliesTo\" in schemaItem) && schemaItem.baseClass === undefined) {\r\n return ecTypeQualifier;\r\n }\r\n\r\n // typescript doesn't understand that the inverse of the above condition is\r\n // (\"appliesTo\" in rootclassMetaData || rootClassMetaData.baseClass !== undefined)\r\n const parentItemQualifier = schemaItem.appliesTo ?? schemaItem.baseClass as string;\r\n return this.getRootEntity(iModel, parentItemQualifier);\r\n }\r\n\r\n /** Generate a JavaScript class from Entity metadata.\r\n * @param entityMetaData The Entity metadata that defines the class\r\n */\r\n private static generateClassForEntity(entityMetaData: EntityMetaData, iModel: IModelDb): typeof Entity {\r\n const name = entityMetaData.ecclass.split(\":\");\r\n const domainName = name[0];\r\n const className = name[1];\r\n\r\n if (0 === entityMetaData.baseClasses.length) // metadata must contain a superclass\r\n throw new IModelError(IModelStatus.BadArg, `class ${name} has no superclass`);\r\n\r\n // make sure schema exists\r\n let schema = Schemas.getRegisteredSchema(domainName);\r\n if (undefined === schema)\r\n schema = this.generateProxySchema(domainName, iModel); // no schema found, create it too\r\n\r\n const superclass = this._classMap.get(entityMetaData.baseClasses[0].toLowerCase());\r\n if (undefined === superclass)\r\n throw new IModelError(IModelStatus.NotFound, `cannot find superclass for class ${name}`);\r\n\r\n // user defined class hierarchies may skip a class in the hierarchy, and therefore their JS base class cannot\r\n // be used to tell if there are any generated classes in the hierarchy\r\n let generatedClassHasNonGeneratedNonCoreAncestor = false;\r\n let currentSuperclass = superclass;\r\n const MAX_ITERS = 1000;\r\n for (let i = 0; i < MAX_ITERS; ++i) {\r\n if (currentSuperclass.schema.schemaName === \"BisCore\")\r\n break;\r\n\r\n if (!currentSuperclass.isGeneratedClass) {\r\n generatedClassHasNonGeneratedNonCoreAncestor = true;\r\n break;\r\n }\r\n const superclassMetaData = iModel.classMetaDataRegistry.find(currentSuperclass.classFullName);\r\n if (superclassMetaData === undefined)\r\n throw new IModelError(IModelStatus.BadSchema, `could not find the metadata for class '${currentSuperclass.name}', class metadata should be loaded by now`);\r\n const maybeNextSuperclass = this.getClass(superclassMetaData.baseClasses[0], iModel);\r\n if (maybeNextSuperclass === undefined)\r\n throw new IModelError(IModelStatus.BadSchema, `could not find the base class of '${currentSuperclass.name}', all generated classes must have a base class`);\r\n currentSuperclass = maybeNextSuperclass;\r\n }\r\n\r\n const generatedClass = class extends superclass {\r\n public static override get className() { return className; }\r\n private static [isGeneratedClassTag] = true;\r\n public static override get isGeneratedClass() { return this.hasOwnProperty(isGeneratedClassTag); }\r\n };\r\n\r\n // the above creates an anonymous class. For help debugging, set the \"constructor.name\" property to be the same as the bisClassName.\r\n Object.defineProperty(generatedClass, \"name\", { get: () => className }); // this is the (only) way to change that readonly property.\r\n\r\n // a class only gets an automatic `collectReferenceIds` implementation if:\r\n // - it is not in the `BisCore` schema\r\n // - there are no ancestors with manually registered JS implementations, (excluding BisCore base classes)\r\n if (!generatedClassHasNonGeneratedNonCoreAncestor) {\r\n const navigationProps = Object.entries(entityMetaData.properties)\r\n .filter(([_name, prop]) => prop.isNavigation)\r\n // eslint-disable-next-line @typescript-eslint/no-shadow\r\n .map(([name, prop]) => {\r\n assert(prop.relationshipClass);\r\n const maybeMetaData = iModel.nativeDb.getSchemaItem(...prop.relationshipClass.split(\":\") as [string, string]);\r\n assert(maybeMetaData.result !== undefined, \"The nav props relationship metadata was not found\");\r\n const relMetaData = JSON.parse(maybeMetaData.result);\r\n const rootClassMetaData = ClassRegistry.getRootEntity(iModel, relMetaData.target.constraintClasses[0]);\r\n // root class must be in BisCore so should be loaded since biscore classes will never get this\r\n // generated implementation\r\n const normalizeClassName = (clsName: string) => clsName.replace(\".\", \":\");\r\n const rootClass = ClassRegistry.findRegisteredClass(normalizeClassName(rootClassMetaData));\r\n assert(rootClass, `The root class for ${prop.relationshipClass} was not in BisCore.`);\r\n return { name, concreteEntityType: EntityReferences.typeFromClass(rootClass) };\r\n });\r\n\r\n Object.defineProperty(\r\n generatedClass.prototype,\r\n \"collectReferenceIds\",\r\n {\r\n value(this: typeof generatedClass, referenceIds: EntityReferenceSet) {\r\n // eslint-disable-next-line @typescript-eslint/dot-notation\r\n const superImpl = superclass.prototype[\"collectReferenceIds\"];\r\n superImpl.call(this, referenceIds);\r\n for (const navProp of navigationProps) {\r\n const relatedElem: RelatedElement | undefined = (this as any)[navProp.name]; // cast to any since subclass can have any extensions\r\n if (!relatedElem || !Id64.isValid(relatedElem.id))\r\n continue;\r\n const referenceId = EntityReferences.fromEntityType(relatedElem.id, navProp.concreteEntityType);\r\n referenceIds.add(referenceId);\r\n }\r\n },\r\n // defaults for methods on a prototype (required for sinon to stub out methods on tests)\r\n writable: true,\r\n configurable: true,\r\n },\r\n );\r\n }\r\n\r\n // if the schema is a proxy for a domain with behavior, throw exceptions for all protected operations\r\n if (schema.missingRequiredBehavior) {\r\n const throwError = () => {\r\n throw new IModelError(IModelStatus.WrongHandler, `Schema [${domainName}] not registered, but is marked with SchemaHasBehavior`);\r\n };\r\n\r\n superclass.protectedOperations.forEach((operation) => (generatedClass as any)[operation] = throwError);\r\n }\r\n\r\n this.register(generatedClass, schema); // register it before returning\r\n return generatedClass;\r\n }\r\n\r\n /** Register all of the classes found in the given module that derive from [[Entity]].\r\n * [[register]] will be invoked for each subclass of `Entity` exported by `moduleObj`.\r\n * @param moduleObj The module to search for subclasses of Entity\r\n * @param schema The schema that contains all of the [ECClass]($ecschema-metadata)es exported by `moduleObj`.\r\n */\r\n public static registerModule(moduleObj: any, schema: typeof Schema) {\r\n for (const thisMember in moduleObj) { // eslint-disable-line guard-for-in\r\n const thisClass = moduleObj[thisMember];\r\n if (thisClass.prototype instanceof Entity)\r\n this.register(thisClass, schema);\r\n }\r\n }\r\n\r\n /**\r\n * This function fetches the specified Entity from the imodel, generates a JavaScript class for it, and registers the generated\r\n * class. This function also ensures that all of the base classes of the Entity exist and are registered.\r\n */\r\n private static generateClass(classFullName: string, iModel: IModelDb): typeof Entity {\r\n const metadata: EntityMetaData | undefined = iModel.classMetaDataRegistry.find(classFullName);\r\n if (metadata === undefined || metadata.ecclass === undefined)\r\n throw this.makeMetaDataNotFoundError(classFullName);\r\n\r\n // Make sure we have all base classes registered.\r\n if (metadata.baseClasses && (0 !== metadata.baseClasses.length))\r\n this.getClass(metadata.baseClasses[0], iModel);\r\n\r\n // Now we can generate the class from the classDef.\r\n return this.generateClassForEntity(metadata, iModel);\r\n }\r\n\r\n /** Find a registered class by classFullName.\r\n * @param classFullName class to find\r\n * @param iModel The IModel that contains the class definitions\r\n * @returns The Entity class or undefined\r\n */\r\n public static findRegisteredClass(classFullName: string): typeof Entity | undefined {\r\n return this._classMap.get(classFullName.toLowerCase());\r\n }\r\n\r\n /** Get the Entity class for the specified Entity className.\r\n * @param classFullName The full BIS class name of the Entity\r\n * @param iModel The IModel that contains the class definitions\r\n * @returns The Entity class\r\n */\r\n public static getClass(classFullName: string, iModel: IModelDb): typeof Entity {\r\n const key = classFullName.toLowerCase();\r\n const ctor = this._classMap.get(key);\r\n return ctor ? ctor : this.generateClass(key, iModel);\r\n }\r\n\r\n /** Unregister a class, by name, if one is already registered.\r\n * This function is not normally needed, but is useful for cases where a generated *proxy* class needs to be replaced by the *real* class.\r\n * @param classFullName Name of the class to unregister\r\n * @return true if the class was unregistered\r\n * @internal\r\n */\r\n public static unregisterCLass(classFullName: string) { return this._classMap.delete(classFullName.toLowerCase()); }\r\n /** Unregister all classes from a schema.\r\n * This function is not normally needed, but is useful for cases where a generated *proxy* schema needs to be replaced by the *real* schema.\r\n * @param schema Name of the schema to unregister\r\n * @internal\r\n */\r\n public static unregisterClassesFrom(schema: typeof Schema) {\r\n for (const entry of Array.from(this._classMap)) {\r\n if (entry[1].schema === schema)\r\n this.unregisterCLass(entry[0]);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * A cache that records the mapping between class names and class metadata.\r\n * @see [[IModelDb.classMetaDataRegistry]] to access the registry for a specific iModel.\r\n * @internal\r\n */\r\nexport class MetaDataRegistry {\r\n private _registry: Map<string, EntityMetaData> = new Map<string, EntityMetaData>();\r\n\r\n /** Get the specified Entity metadata */\r\n public find(classFullName: string): EntityMetaData | undefined { return this._registry.get(classFullName.toLowerCase()); }\r\n\r\n /** Add metadata to the cache */\r\n public add(classFullName: string, metaData: EntityMetaData): void { this._registry.set(classFullName.toLowerCase(), metaData); }\r\n}\r\n"]}
@@ -68,17 +68,24 @@ export interface OnSubModelIdArg extends OnElementArg {
68
68
  /** The modelId of the sub Model */
69
69
  subModelId: Id64String;
70
70
  }
71
- /** Elements are the smallest individually identifiable building blocks for modeling the real world in an iModel.
72
- * Each element represents an entity in the real world. Sets of Elements (contained in [[Model]]s) are used to model
71
+ /** The smallest individually identifiable building block for modeling the real world in an iModel.
72
+ * Each element represents an [[Entity]] in the real world. Sets of Elements (contained in [[Model]]s) are used to model
73
73
  * other Elements that represent larger scale real world entities. Using this recursive modeling strategy,
74
74
  * Elements can represent entities at any scale. Elements can represent physical things or abstract concepts
75
75
  * or simply be information records.
76
76
  *
77
77
  * Every Element has a 64-bit id (inherited from Entity) that uniquely identifies it within an iModel. Every Element also
78
- * has a "code" that identifies its meaning in the real world. Additionally, Elements may have a "federationGuid"
78
+ * has a [[code]] that identifies its meaning in the real world. Additionally, Elements may have a [[federationGuid]]
79
79
  * to hold a GUID, if the element was assigned that GUID by some other federated database. The iModel database enforces
80
80
  * uniqueness of id, code, and federationGuid.
81
81
  *
82
+ * The Element class provides `static` methods like [[onInsert]], [[onUpdated]], [[onCloned]], and [[onChildAdded]] that enable
83
+ * it to customize persistence operations. For example, the base implementations of [[onInsert]], [[onUpdate]], and [[onDelete]]
84
+ * validate that the appropriate [locks]($docs/learning/backend/ConcurrencyControl.md), [codes]($docs/learning/backend/CodeService.md),
85
+ * and [channel permissions]($docs/learning/backend/Channel.md) are obtained before a change to the element is written to the iModel.
86
+ * A subclass of Element that overrides any of these methods **must** call the `super` method as well. An application that supplies its
87
+ * own Element subclasses should register them at startup via [[ClassRegistry.registerModule]] or [[ClassRegistry.register]].
88
+ *
82
89
  * See:
83
90
  * * [Element Fundamentals]($docs/bis/guide/fundamentals/element-fundamentals.md)
84
91
  * * [Working with schemas and elements in TypeScript]($docs/learning/backend/SchemasAndElementsInTypeScript.md)
@@ -1 +1 @@
1
- {"version":3,"file":"Element.d.ts","sourceRoot":"","sources":["../../src/Element.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAqB,UAAU,EAAQ,OAAO,EAAE,UAAU,EAA+B,MAAM,qBAAqB,CAAC;AAC5H,OAAO,EACL,gBAAgB,EAAe,IAAI,EAAE,cAAc,EAAY,mBAAmB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,4BAA4B,EAC7J,mCAAmC,EAAE,YAAY,EAAE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E,QAAQ;WAMpD,QAAQ,CAAC,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,GAAG,cAAc;IAIpE,MAAM,IAAI,mBAAmB;IAS7C,OAAO,CAAC,MAAM,CAAC,gBAAgB;cAQZ,mBAAmB,CAAC,GAAG,EAAE,kBAAkB,GAAG,IAAI;IAMrE,aAAa;qBACa,QAAQ,CAAC,OAAO,EAAE,yBAAyB,EAAE,WAAW,EAAE,mBAAmB,EAAE,WAAW,EAAE,mBAAmB,GAAG,IAAI;IAMhJ;;OAEG;WACW,WAAW,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,cAAc,CAAC,WAAW,GAAG,cAAc,CAAC,WAAW;CA2B7H"}
@@ -16,17 +16,24 @@ const core_geometry_1 = require("@itwin/core-geometry");
16
16
  const Entity_1 = require("./Entity");
17
17
  const Model_1 = require("./Model");
18
18
  const NavigationRelationship_1 = require("./NavigationRelationship");
19
- /** Elements are the smallest individually identifiable building blocks for modeling the real world in an iModel.
20
- * Each element represents an entity in the real world. Sets of Elements (contained in [[Model]]s) are used to model
19
+ /** The smallest individually identifiable building block for modeling the real world in an iModel.
20
+ * Each element represents an [[Entity]] in the real world. Sets of Elements (contained in [[Model]]s) are used to model
21
21
  * other Elements that represent larger scale real world entities. Using this recursive modeling strategy,
22
22
  * Elements can represent entities at any scale. Elements can represent physical things or abstract concepts
23
23
  * or simply be information records.
24
24
  *
25
25
  * Every Element has a 64-bit id (inherited from Entity) that uniquely identifies it within an iModel. Every Element also
26
- * has a "code" that identifies its meaning in the real world. Additionally, Elements may have a "federationGuid"
26
+ * has a [[code]] that identifies its meaning in the real world. Additionally, Elements may have a [[federationGuid]]
27
27
  * to hold a GUID, if the element was assigned that GUID by some other federated database. The iModel database enforces
28
28
  * uniqueness of id, code, and federationGuid.
29
29
  *
30
+ * The Element class provides `static` methods like [[onInsert]], [[onUpdated]], [[onCloned]], and [[onChildAdded]] that enable
31
+ * it to customize persistence operations. For example, the base implementations of [[onInsert]], [[onUpdate]], and [[onDelete]]
32
+ * validate that the appropriate [locks]($docs/learning/backend/ConcurrencyControl.md), [codes]($docs/learning/backend/CodeService.md),
33
+ * and [channel permissions]($docs/learning/backend/Channel.md) are obtained before a change to the element is written to the iModel.
34
+ * A subclass of Element that overrides any of these methods **must** call the `super` method as well. An application that supplies its
35
+ * own Element subclasses should register them at startup via [[ClassRegistry.registerModule]] or [[ClassRegistry.register]].
36
+ *
30
37
  * See:
31
38
  * * [Element Fundamentals]($docs/bis/guide/fundamentals/element-fundamentals.md)
32
39
  * * [Working with schemas and elements in TypeScript]($docs/learning/backend/SchemasAndElementsInTypeScript.md)
@@ -1 +1 @@
1
- {"version":3,"file":"Element.js","sourceRoot":"","sources":["../../src/Element.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;AAEH,sDAA4H;AAC5H,oDAO4B;AAC5B,wDAAsE;AACtE,qCAAkC;AAGlC,mCAA4F;AAC5F,qEAA+D;AAuE/D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,OAAQ,SAAQ,eAAM;IACjC,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,SAAS,CAAC,CAAC,CAAC;IACpE,gBAAgB;IACT,MAAM,KAAc,mBAAmB,KAAK,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAejG,YAAsB,KAAmB,EAAE,MAAgB;QACzD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,kBAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAE,0EAA0E;QAClH,IAAI,CAAC,KAAK,GAAG,4BAAc,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpD,IAAI,CAAC,MAAM,GAAG,4BAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,C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,CAAC;iBAC/B;gBAED,OAAO,CAAC,UAAU,GAAG,gCAAiB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;aAChE;SACF;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;CACF;AAhFD,wCAgFC","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 { CompressedId64Set, GuidString, Id64, Id64Set, Id64String, JsonUtils, OrderedId64Array } from \"@itwin/core-bentley\";\r\nimport {\r\n AxisAlignedBox3d, BisCodeSpec, Code, CodeScopeProps, CodeSpec, ConcreteEntityTypes, DefinitionElementProps, ElementAlignedBox3d, ElementGeometryBuilderParams,\r\n ElementGeometryBuilderParamsForPart, ElementProps, EntityMetaData, EntityReferenceSet, GeometricElement2dProps, GeometricElement3dProps, GeometricElementProps,\r\n GeometricModel2dProps, GeometricModel3dProps, GeometryPartProps, GeometryStreamProps, IModel, InformationPartitionElementProps, LineStyleProps,\r\n ModelProps, PhysicalElementProps, PhysicalTypeProps, Placement2d, Placement3d, RelatedElement, RenderSchedule, RenderTimelineProps,\r\n RepositoryLinkProps, SectionDrawingLocationProps, SectionDrawingProps, SectionType, SheetBorderTemplateProps, SheetProps, SheetTemplateProps,\r\n SubjectProps, TypeDefinition, TypeDefinitionElementProps, UrlLinkProps,\r\n} from \"@itwin/core-common\";\r\nimport { ClipVector, Range3d, Transform } from \"@itwin/core-geometry\";\r\nimport { Entity } from \"./Entity\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { IModelElementCloneContext } from \"./IModelElementCloneContext\";\r\nimport { DefinitionModel, DrawingModel, PhysicalModel, SectionDrawingModel } from \"./Model\";\r\nimport { SubjectOwnsSubjects } from \"./NavigationRelationship\";\r\n\r\n/** Argument for the `Element.onXxx` static methods\r\n * @beta\r\n */\r\nexport interface OnElementArg {\r\n /** The iModel for the Element affected by this method. */\r\n iModel: IModelDb;\r\n}\r\n\r\n/** Argument for `Element.onInsert` and `Element.onUpdate` static methods.\r\n * @beta\r\n */\r\nexport interface OnElementPropsArg extends OnElementArg {\r\n /** The properties of the Element affected by this method.\r\n * @note the properties may be modified. If so the modified values will be inserted/updated.\r\n */\r\n props: ElementProps;\r\n}\r\n\r\n/** Argument for the `Element.onXxx` static methods that notify of operations to an existing Element supplying its Id, ModelId and FederationGuid.\r\n * @beta\r\n */\r\nexport interface OnElementIdArg extends OnElementArg {\r\n /** The Id of the Element affected by this method */\r\n id: Id64String;\r\n /** The ModelId of the element affected by this method */\r\n model: Id64String;\r\n /** The federationGuid of the element affected by this method */\r\n federationGuid: GuidString;\r\n}\r\n\r\n/** Argument for the `Element.onChildXxx` static methods\r\n * @beta\r\n */\r\nexport interface OnChildElementArg extends OnElementArg {\r\n parentId: Id64String;\r\n}\r\n\r\n/** Argument for the `Element.onChildXxx` static methods that supply the properties of the child Element to be inserted or updated.\r\n * @beta\r\n */\r\nexport interface OnChildElementPropsArg extends OnChildElementArg {\r\n /** The new properties of the child Element for this method. */\r\n childProps: Readonly<ElementProps>;\r\n}\r\n\r\n/** Argument for the `Element.onChildXxx` static methods that only supply the Id of the child Element.\r\n * @beta\r\n */\r\nexport interface OnChildElementIdArg extends OnChildElementArg {\r\n /** The Id of the child element for this method */\r\n childId: Id64String;\r\n}\r\n\r\n/** Argument for the `Element.onSubModelInsert` static method\r\n * @beta\r\n */\r\nexport interface OnSubModelPropsArg extends OnElementArg {\r\n /** The properties of the prospective sub-model */\r\n subModelProps: ModelProps;\r\n}\r\n\r\n/** Argument for several `Element.onSubModelXxx` static methods\r\n * @beta\r\n */\r\nexport interface OnSubModelIdArg extends OnElementArg {\r\n /** The modelId of the sub Model */\r\n subModelId: Id64String;\r\n}\r\n\r\n/** Elements are the smallest individually identifiable building blocks for modeling the real world in an iModel.\r\n * Each element represents an entity in the real world. Sets of Elements (contained in [[Model]]s) are used to model\r\n * other Elements that represent larger scale real world entities. Using this recursive modeling strategy,\r\n * Elements can represent entities at any scale. Elements can represent physical things or abstract concepts\r\n * or simply be information records.\r\n *\r\n * Every Element has a 64-bit id (inherited from Entity) that uniquely identifies it within an iModel. Every Element also\r\n * has a \"code\" that identifies its meaning in the real world. Additionally, Elements may have a \"federationGuid\"\r\n * to hold a GUID, if the element was assigned that GUID by some other federated database. The iModel database enforces\r\n * uniqueness of id, code, and federationGuid.\r\n *\r\n * See:\r\n * * [Element Fundamentals]($docs/bis/guide/fundamentals/element-fundamentals.md)\r\n * * [Working with schemas and elements in TypeScript]($docs/learning/backend/SchemasAndElementsInTypeScript.md)\r\n * * [Creating elements]($docs/learning/backend/CreateElements.md)\r\n * @public\r\n */\r\nexport class Element extends Entity {\r\n /** @internal */\r\n public static override get className(): string { return \"Element\"; }\r\n /** @internal */\r\n public static override get protectedOperations() { return [\"onInsert\", \"onUpdate\", \"onDelete\"]; }\r\n\r\n /** The ModelId of the [Model]($docs/bis/guide/fundamentals/model-fundamentals.md) containing this element */\r\n public readonly model: Id64String;\r\n /** The [Code]($docs/bis/guide/fundamentals/codes.md) for this element */\r\n public code: Code;\r\n /** The parent element, if present, of this element. */\r\n public parent?: RelatedElement;\r\n /** A [FederationGuid]($docs/bis/guide/fundamentals/element-fundamentals.md#federationguid) assigned to this element by some other federated database */\r\n public federationGuid?: GuidString;\r\n /** A [user-assigned label]($docs/bis/guide/fundamentals/element-fundamentals.md#userlabel) for this element. */\r\n public userLabel?: string;\r\n /** Optional [json properties]($docs/bis/guide/fundamentals/element-fundamentals.md#jsonproperties) of this element. */\r\n public readonly jsonProperties: { [key: string]: any };\r\n\r\n protected constructor(props: ElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.code = Code.fromJSON(props.code); // TODO: Validate props.code - don't silently fail if it is the wrong type\r\n this.model = RelatedElement.idFromJson(props.model);\r\n this.parent = RelatedElement.fromJSON(props.parent);\r\n this.federationGuid = props.federationGuid;\r\n this.userLabel = props.userLabel;\r\n this.jsonProperties = { ...props.jsonProperties }; // make sure we have our own copy\r\n }\r\n\r\n /** Called before a new Element is inserted.\r\n * @note throw an exception to disallow the insert\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Element to be inserted\r\n * @beta\r\n */\r\n protected static onInsert(arg: OnElementPropsArg): void {\r\n const { iModel, props } = arg;\r\n const operation = \"insert\";\r\n iModel.channels.verifyChannel(arg.props.model);\r\n iModel.locks.checkSharedLock(props.model, \"model\", operation); // inserting requires shared lock on model\r\n if (props.parent) // inserting requires shared lock on parent, if present\r\n iModel.locks.checkSharedLock(props.parent.id, \"parent\", operation);\r\n iModel.codeService?.verifyCode(arg);\r\n }\r\n\r\n /** Called after a new Element was inserted.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Element that was inserted\r\n * @beta\r\n */\r\n protected static onInserted(arg: OnElementIdArg): void {\r\n arg.iModel.locks.elementWasCreated(arg.id);\r\n }\r\n\r\n /** Called before an Element is updated.\r\n * @note throw an exception to disallow the update\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Element to be updated\r\n * @beta\r\n */\r\n protected static onUpdate(arg: OnElementPropsArg): void {\r\n const { iModel, props } = arg;\r\n iModel.channels.verifyChannel(props.model);\r\n iModel.locks.checkExclusiveLock(props.id!, \"element\", \"update\"); // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n iModel.codeService?.verifyCode(arg);\r\n }\r\n\r\n /** Called after an Element was updated.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Element that was updated\r\n * @beta\r\n */\r\n protected static onUpdated(_arg: OnElementIdArg): void { }\r\n\r\n /** Called before an Element is deleted.\r\n * @note throw an exception to disallow the delete\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Element to be deleted\r\n * @beta\r\n */\r\n protected static onDelete(arg: OnElementIdArg): void {\r\n arg.iModel.channels.verifyChannel(arg.model);\r\n arg.iModel.locks.checkExclusiveLock(arg.id, \"element\", \"delete\");\r\n }\r\n\r\n /** Called after an Element was deleted.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Element that was deleted\r\n * @beta\r\n */\r\n protected static onDeleted(_arg: OnElementIdArg): void { }\r\n\r\n /** Called when an element with an instance of this class as its parent is about to be deleted.\r\n * @note throw an exception if the element should not be deleted\r\n * @note implementers should not presume that the element was deleted if this method does not throw,\r\n * since the delete may fail for other reasons. Instead, rely on [[onChildDeleted]] for that purpose.\r\n * @note `this` is the class of the parent Element whose child will be deleted\r\n * @beta\r\n */\r\n protected static onChildDelete(_arg: OnChildElementIdArg): void { }\r\n\r\n /** Called after an element with an instance of this class as its parent was successfully deleted.\r\n * @note `this` is the class of the parent Element whose child was deleted\r\n * @beta\r\n */\r\n protected static onChildDeleted(_arg: OnChildElementIdArg): void { }\r\n\r\n /** Called when a *new element* with an instance of this class as its parent is about to be inserted.\r\n * @note throw an exception if the element should not be inserted\r\n * @note `this` is the class of the prospective parent Element.\r\n * @beta\r\n */\r\n protected static onChildInsert(_arg: OnChildElementPropsArg): void { }\r\n\r\n /** Called after a *new element* with an instance of this class as its parent was inserted.\r\n * @note `this` is the class of the parent Element.\r\n * @beta\r\n */\r\n protected static onChildInserted(_arg: OnChildElementIdArg): void { }\r\n\r\n /** Called when an element with an instance of this class as its parent is about to be updated.\r\n * @note throw an exception if the element should not be updated\r\n * @note `this` is the class of the parent Element.\r\n * @beta\r\n */\r\n protected static onChildUpdate(_arg: OnChildElementPropsArg): void { }\r\n\r\n /** Called after an element with an instance of this the class as its parent was updated.\r\n * @note `this` is the class of the parent Element.\r\n * @beta\r\n */\r\n protected static onChildUpdated(_arg: OnChildElementIdArg): void { }\r\n\r\n /** Called when an *existing element* is about to be updated so that an instance of this class will become its new parent.\r\n * @note throw an exception if the element should not be added\r\n * @note `this` is the class of the prospective parent Element.\r\n * @beta\r\n */\r\n protected static onChildAdd(_arg: OnChildElementPropsArg): void { }\r\n\r\n /** Called after an *existing element* has been updated so that an instance of this class is its new parent.\r\n * @note `this` is the class of the new parent Element.\r\n * @beta\r\n */\r\n protected static onChildAdded(_arg: OnChildElementIdArg): void { }\r\n\r\n /** Called when an element with an instance of this class as its parent is about to be updated change to a different parent.\r\n * @note throw an exception if the element should not be dropped\r\n * @note `this` is the class of the parent Element.\r\n * @beta\r\n */\r\n protected static onChildDrop(_arg: OnChildElementIdArg): void { }\r\n\r\n /** Called after an element with an instance of this class as its previous parent was updated to have a new parent.\r\n * @note `this` is the class of the previous parent Element.\r\n * @beta\r\n */\r\n protected static onChildDropped(_arg: OnChildElementIdArg): void { }\r\n\r\n /** Called when an instance of this class is being *sub-modeled* by a new Model.\r\n * @note throw an exception if model should not be inserted\r\n * @note `this` is the class of Element to be sub-modeled.\r\n * @beta\r\n */\r\n protected static onSubModelInsert(_arg: OnSubModelPropsArg): void { }\r\n\r\n /** Called after an instance of this class was *sub-modeled* by a new Model.\r\n * @note `this` is the class of Element that is now sub-modeled.\r\n * @beta\r\n */\r\n protected static onSubModelInserted(_arg: OnSubModelIdArg): void { }\r\n\r\n /** Called when a sub-model of an instance of this class is being deleted.\r\n * @note throw an exception if model should not be deleted\r\n * @note `this` is the class of Element that is sub-modeled.\r\n * @beta\r\n */\r\n protected static onSubModelDelete(_arg: OnSubModelIdArg): void { }\r\n\r\n /** Called after a sub-model of an instance of this class was deleted.\r\n * @note `this` is the class of Element that was sub-modeled.\r\n * @beta\r\n */\r\n protected static onSubModelDeleted(_arg: OnSubModelIdArg): void { }\r\n\r\n /** Called during the iModel transformation process after an Element from the source iModel was *cloned* for the target iModel.\r\n * The transformation process automatically handles remapping BisCore properties and those that are properly described in ECSchema.\r\n * This callback is only meant to be overridden if there are other Ids in non-standard locations that need to be remapped or other data that needs to be fixed up after the clone.\r\n * @param _context The context that persists any remapping between the source iModel and target iModel.\r\n * @param _sourceProps The ElementProps for the source Element that was cloned.\r\n * @param _targetProps The ElementProps that are a result of the clone. These can be further modified.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onCloned(_context: IModelElementCloneContext, _sourceProps: ElementProps, _targetProps: ElementProps): void { }\r\n\r\n /** Called when a *root* element in a subgraph is changed and before its outputs are processed.\r\n * This special callback is made when:\r\n * * the element is part of an [[ElementDrivesElement]] graph, and\r\n * * the element has no inputs, and\r\n * * none of the element's outputs have been processed.\r\n * @see [[ElementDrivesElement]] for more on element dependency graphs.\r\n * @beta\r\n */\r\n protected static onBeforeOutputsHandled(_id: Id64String, _iModel: IModelDb): void { }\r\n\r\n /** Called on an element in a graph after all of its inputs have been processed and before its outputs are processed.\r\n * This callback is made when:\r\n * * the specified element is part of an [[ElementDrivesElement]] graph, and\r\n * * there was a direct change to some element upstream in the dependency graph.\r\n * * all upstream elements in the graph have been processed.\r\n * * none of the downstream elements have been processed.\r\n * This method is not called if none of the element's inputs were changed.\r\n * @see [[ElementDrivesElement]] for more on element dependency graphs.\r\n * @beta\r\n */\r\n protected static onAllInputsHandled(_id: Id64String, _iModel: IModelDb): void { }\r\n\r\n public override toJSON(): ElementProps {\r\n const val = super.toJSON() as ElementProps;\r\n\r\n if (Code.isValid(this.code))\r\n val.code = this.code;\r\n\r\n val.model = this.model;\r\n if (undefined !== this.userLabel) // NOTE: blank string should be included in JSON\r\n val.userLabel = this.userLabel;\r\n if (this.federationGuid)\r\n val.federationGuid = this.federationGuid;\r\n if (this.parent)\r\n val.parent = this.parent;\r\n\r\n if (Object.keys(this.jsonProperties).length > 0)\r\n val.jsonProperties = this.jsonProperties;\r\n\r\n return val;\r\n }\r\n\r\n /** Collect the Ids of this element's *references* at this level of the class hierarchy.\r\n * @deprecated in 3.x. use [[collectReferenceIds]] instead, the use of the term *predecessors* was confusing and became inaccurate when the transformer could handle cycles\r\n * @beta\r\n */\r\n protected collectPredecessorIds(predecessorIds: EntityReferenceSet): void {\r\n return this.collectReferenceIds(predecessorIds);\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addModel(this.model); // The modeledElement is a reference\r\n if (this.code.scope && Id64.isValidId64(this.code.scope))\r\n referenceIds.addElement(this.code.scope); // The element that scopes the code is a reference\r\n if (this.parent)\r\n referenceIds.addElement(this.parent.id); // A parent element is a reference\r\n }\r\n\r\n /** Get the Ids of this element's *references*. A *reference* is any element whose id is stored in the EC data of this element\r\n * This is important for cloning operations but can be useful in other situations as well.\r\n * @beta\r\n * @deprecated in 3.x. use [[getReferenceIds]] instead, the use of the term *predecessors* was confusing and became inaccurate when the transformer could handle cycles\r\n */\r\n public getPredecessorIds(): Id64Set {\r\n return this.getReferenceIds();\r\n }\r\n\r\n /** A *required reference* is an element that had to be inserted before this element could have been inserted.\r\n * This is the list of property keys on this element that store references to those elements\r\n * @note This should be overridden (with `super` called) at each level of the class hierarchy that introduces required references.\r\n * @note any property listed here must be added to the reference ids in [[collectReferenceIds]]\r\n * @beta\r\n */\r\n public static readonly requiredReferenceKeys: ReadonlyArray<string> = [\"parent\", \"model\"];\r\n\r\n /** A map of every [[requiredReferenceKeys]] on this class to their entity type.\r\n * @note This should be overridden (with `super` called) at each level of the class hierarchy that introduces required references.\r\n * @alpha\r\n */\r\n public static readonly requiredReferenceKeyTypeMap: Record<string, ConcreteEntityTypes> = {\r\n parent: ConcreteEntityTypes.Element,\r\n model: ConcreteEntityTypes.Model,\r\n };\r\n\r\n /** Get the class metadata for this element. */\r\n public getClassMetaData(): EntityMetaData | undefined { return this.iModel.classMetaDataRegistry.find(this.classFullName); }\r\n\r\n private getAllUserProperties(): any {\r\n if (!this.jsonProperties.UserProps)\r\n this.jsonProperties.UserProps = new Object();\r\n\r\n return this.jsonProperties.UserProps;\r\n }\r\n\r\n /** Get a set of JSON user properties by namespace */\r\n public getUserProperties(namespace: string) { return this.getAllUserProperties()[namespace]; }\r\n\r\n /** Change a set of user JSON properties of this Element by namespace. */\r\n public setUserProperties(nameSpace: string, value: any) { this.getAllUserProperties()[nameSpace] = value; }\r\n\r\n /** Remove a set of JSON user properties, specified by namespace, from this Element */\r\n public removeUserProperties(nameSpace: string) { delete this.getAllUserProperties()[nameSpace]; }\r\n\r\n /** Get a JSON property of this element, by namespace */\r\n public getJsonProperty(nameSpace: string): any { return this.jsonProperties[nameSpace]; }\r\n public setJsonProperty(nameSpace: string, value: any) { this.jsonProperties[nameSpace] = value; }\r\n\r\n /** Get a display label for this Element. By default returns userLabel if present, otherwise code value. */\r\n public getDisplayLabel(): string { return this.userLabel ?? this.code.value; }\r\n\r\n /** Get a list of HTML strings that describe this Element for the tooltip. Strings will be listed on separate lines in the tooltip.\r\n * Any instances of the pattern `%{tag}` will be replaced by the localized value of tag.\r\n */\r\n public getToolTipMessage(): string[] {\r\n const addKey = (key: string) => `<b>%{iModelJs:Element.${key}}:</b> `; // %{iModelJs:Element.xxx} is replaced with localized value of xxx in frontend.\r\n const msg: string[] = [];\r\n const display = this.getDisplayLabel();\r\n msg.push(display ? display : `${addKey(\"Id\") + this.id}, ${addKey(\"Type\")}${this.className}`);\r\n\r\n if (this instanceof GeometricElement)\r\n msg.push(addKey(\"Category\") + this.iModel.elements.getElement(this.category).getDisplayLabel());\r\n\r\n msg.push(addKey(\"Model\") + this.iModel.elements.getElement(this.model).getDisplayLabel());\r\n return msg;\r\n }\r\n\r\n /**\r\n * Insert this Element into the iModel.\r\n * @see [[IModelDb.Elements.insertElement]]\r\n * @note For convenience, the value of `this.id` is updated to reflect the resultant element's id.\r\n * However when `this.federationGuid` is not present or undefined, a new Guid will be generated and stored on the resultant element. But\r\n * the value of `this.federationGuid` is *not* updated. Generally, it is best to re-read the element after inserting (e.g. via [[IModelDb.Elements.getElement]])\r\n * if you intend to continue working with it. That will ensure its values reflect the persistent state.\r\n */\r\n public insert() {\r\n return this.id = this.iModel.elements.insertElement(this.toJSON());\r\n }\r\n /** Update this Element in the iModel. */\r\n public update() { this.iModel.elements.updateElement(this.toJSON()); }\r\n /** Delete this Element from the iModel. */\r\n public delete() { this.iModel.elements.deleteElement(this.id); }\r\n}\r\n\r\n/** An abstract base class to model real world entities that intrinsically have geometry.\r\n * @public\r\n */\r\nexport abstract class GeometricElement extends Element {\r\n /** @internal */\r\n public static override get className(): string { return \"GeometricElement\"; }\r\n /** The Id of the [[Category]] for this GeometricElement. */\r\n public category: Id64String;\r\n /** The GeometryStream for this GeometricElement. */\r\n public geom?: GeometryStreamProps;\r\n /** How to build the element's GeometryStream. This is used for insert and update only. It is not a persistent property. It will be undefined in the properties returned by functions that read a persistent element. It may be specified as an alternative to `geom` when inserting or updating an element.\r\n * @beta\r\n */\r\n public elementGeometryBuilderParams?: ElementGeometryBuilderParams;\r\n /** The origin, orientation, and bounding box of this GeometricElement. */\r\n public abstract get placement(): Placement2d | Placement3d;\r\n\r\n protected constructor(props: GeometricElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.category = Id64.fromJSON(props.category);\r\n this.geom = props.geom;\r\n }\r\n\r\n /** Type guard for instanceof [[GeometricElement3d]] */\r\n public is3d(): this is GeometricElement3d { return this instanceof GeometricElement3d; }\r\n /** Type guard for instanceof [[GeometricElement2d]] */\r\n public is2d(): this is GeometricElement2d { return this instanceof GeometricElement2d; }\r\n /** Get the [Transform]($geometry) from the Placement of this GeometricElement */\r\n public getPlacementTransform(): Transform { return this.placement.transform; }\r\n public calculateRange3d(): AxisAlignedBox3d { return this.placement.calculateRange(); }\r\n\r\n public override toJSON(): GeometricElementProps {\r\n const val = super.toJSON() as GeometricElementProps;\r\n val.category = this.category;\r\n if (this.geom)\r\n val.geom = this.geom;\r\n return val;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.category);\r\n // TODO: GeometryPartIds?\r\n }\r\n\r\n /** @beta */\r\n public static override readonly requiredReferenceKeys: ReadonlyArray<string> = [...super.requiredReferenceKeys, \"category\"];\r\n /** @alpha */\r\n public static override readonly requiredReferenceKeyTypeMap: Record<string, ConcreteEntityTypes> = {\r\n ...super.requiredReferenceKeyTypeMap,\r\n category: ConcreteEntityTypes.Element,\r\n };\r\n}\r\n\r\n/** An abstract base class to model real world entities that intrinsically have 3d geometry.\r\n * See [how to create a GeometricElement3d]($docs/learning/backend/CreateElements.md#GeometricElement3d).\r\n * @public\r\n */\r\nexport abstract class GeometricElement3d extends GeometricElement {\r\n /** @internal */\r\n public static override get className(): string { return \"GeometricElement3d\"; }\r\n public placement: Placement3d;\r\n public typeDefinition?: TypeDefinition;\r\n\r\n protected constructor(props: GeometricElement3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.placement = Placement3d.fromJSON(props.placement);\r\n if (props.typeDefinition)\r\n this.typeDefinition = TypeDefinition.fromJSON(props.typeDefinition);\r\n }\r\n\r\n public override toJSON(): GeometricElement3dProps {\r\n const val = super.toJSON() as GeometricElement3dProps;\r\n val.placement = this.placement;\r\n if (undefined !== this.typeDefinition)\r\n val.typeDefinition = this.typeDefinition;\r\n\r\n return val;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (undefined !== this.typeDefinition)\r\n referenceIds.addElement(this.typeDefinition.id);\r\n }\r\n}\r\n\r\n/** A 3d Graphical Element\r\n * @public\r\n */\r\nexport abstract class GraphicalElement3d extends GeometricElement3d {\r\n /** @internal */\r\n public static override get className(): string { return \"GraphicalElement3d\"; }\r\n protected constructor(props: GeometricElement3dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** An abstract base class to model information entities that intrinsically have 2d geometry.\r\n * @public\r\n */\r\nexport abstract class GeometricElement2d extends GeometricElement {\r\n /** @internal */\r\n public static override get className(): string { return \"GeometricElement2d\"; }\r\n public placement: Placement2d;\r\n public typeDefinition?: TypeDefinition;\r\n\r\n protected constructor(props: GeometricElement2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.placement = Placement2d.fromJSON(props.placement);\r\n if (props.typeDefinition)\r\n this.typeDefinition = TypeDefinition.fromJSON(props.typeDefinition);\r\n }\r\n\r\n public override toJSON(): GeometricElement2dProps {\r\n const val = super.toJSON() as GeometricElement2dProps;\r\n val.placement = this.placement;\r\n if (undefined !== this.typeDefinition)\r\n val.typeDefinition = this.typeDefinition;\r\n\r\n return val;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (undefined !== this.typeDefinition)\r\n referenceIds.addElement(this.typeDefinition.id);\r\n }\r\n}\r\n\r\n/** An abstract base class for 2d Geometric Elements that are used to convey information within graphical presentations (like drawings).\r\n * @public\r\n */\r\nexport abstract class GraphicalElement2d extends GeometricElement2d {\r\n /** @internal */\r\n public static override get className(): string { return \"GraphicalElement2d\"; }\r\n protected constructor(props: GeometricElement2dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** 2d element used to annotate drawings and sheets.\r\n * @public\r\n */\r\nexport class AnnotationElement2d extends GraphicalElement2d {\r\n /** @internal */\r\n public static override get className(): string { return \"AnnotationElement2d\"; }\r\n protected constructor(props: GeometricElement2dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** 2d element used to persist graphics for use in drawings.\r\n * @public\r\n */\r\nexport class DrawingGraphic extends GraphicalElement2d {\r\n /** @internal */\r\n public static override get className(): string { return \"DrawingGraphic\"; }\r\n protected constructor(props: GeometricElement2dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** 2D Text Annotation\r\n * @public\r\n */\r\nexport class TextAnnotation2d extends AnnotationElement2d {\r\n /** @internal */\r\n public static override get className(): string { return \"TextAnnotation2d\"; }\r\n protected constructor(props: GeometricElement2dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** 3D Text Annotation\r\n * @public\r\n */\r\nexport class TextAnnotation3d extends GraphicalElement3d {\r\n /** @internal */\r\n public static override get className(): string { return \"TextAnnotation3d\"; }\r\n protected constructor(props: GeometricElement3dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** An Element that occupies real world space. Its coordinates are in the project space of its iModel.\r\n * @public\r\n */\r\nexport abstract class SpatialElement extends GeometricElement3d {\r\n /** @internal */\r\n public static override get className(): string { return \"SpatialElement\"; }\r\n protected constructor(props: GeometricElement3dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** An Element that is spatially located, has mass, and can be *touched*.\r\n * @public\r\n */\r\nexport abstract class PhysicalElement extends SpatialElement {\r\n /** @internal */\r\n public static override get className(): string { return \"PhysicalElement\"; }\r\n /** If defined, the [[PhysicalMaterial]] that makes up this PhysicalElement. */\r\n public physicalMaterial?: RelatedElement;\r\n protected constructor(props: PhysicalElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.physicalMaterial = RelatedElement.fromJSON(props.physicalMaterial);\r\n }\r\n\r\n public override toJSON(): PhysicalElementProps {\r\n const val = super.toJSON() as PhysicalElementProps;\r\n val.physicalMaterial = this.physicalMaterial?.toJSON();\r\n return val;\r\n }\r\n}\r\n\r\n/** Identifies a *tracked* real world location but has no mass and cannot be *touched*.\r\n * @public\r\n */\r\nexport abstract class SpatialLocationElement extends SpatialElement {\r\n /** @internal */\r\n public static override get className(): string { return \"SpatialLocationElement\"; }\r\n protected constructor(props: GeometricElement3dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** A Volume Element is a Spatial Location Element that is restricted to defining a volume.\r\n * @public\r\n */\r\nexport class VolumeElement extends SpatialLocationElement {\r\n /** @internal */\r\n public static override get className(): string { return \"VolumeElement\"; }\r\n protected constructor(props: GeometricElement3dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** A SectionDrawingLocation element identifies the location of a [[SectionDrawing]] in the context of a [[SpatialModel]],\r\n * enabling [HyperModeling]($hypermodeling).\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.11.\r\n * @public\r\n */\r\nexport class SectionDrawingLocation extends SpatialLocationElement {\r\n /** The Id of the [[ViewDefinition]] to which this location refers. */\r\n public sectionView: RelatedElement;\r\n\r\n /** @internal */\r\n public static override get className(): string { return \"SectionDrawingLocation\"; }\r\n\r\n public constructor(props: SectionDrawingLocationProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.sectionView = RelatedElement.fromJSON(props.sectionView) ?? RelatedElement.none;\r\n }\r\n\r\n public override toJSON(): SectionDrawingLocationProps {\r\n return {\r\n ...super.toJSON(),\r\n sectionView: this.sectionView.toJSON(),\r\n };\r\n }\r\n}\r\n\r\n/** Information Content Element is an abstract base class for modeling pure information entities. Only the\r\n * core framework should directly subclass from Information Content Element. Domain and application developers\r\n * should start with the most appropriate subclass of Information Content Element.\r\n * @public\r\n */\r\nexport abstract class InformationContentElement extends Element {\r\n /** @internal */\r\n public static override get className(): string { return \"InformationContentElement\"; }\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** Element used in conjunction with bis:ElementDrivesElement relationships to bundle multiple inputs before\r\n * driving the output element.\r\n * @beta\r\n */\r\nexport abstract class DriverBundleElement extends InformationContentElement {\r\n /** @internal */\r\n public static override get className(): string { return \"DriverBundleElement\"; }\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** Information Reference is an abstract base class for modeling entities whose main purpose is to reference something else.\r\n * @public\r\n */\r\nexport abstract class InformationReferenceElement extends InformationContentElement {\r\n /** @internal */\r\n public static override get className(): string { return \"InformationReferenceElement\"; }\r\n\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** A Subject is an information element that describes what this repository (or part thereof) is about.\r\n * See [how to create a Subject element]$(docs/learning/backend/CreateElements.md#Subject).\r\n * @public\r\n */\r\nexport class Subject extends InformationReferenceElement {\r\n /** @internal */\r\n public static override get className(): string { return \"Subject\"; }\r\n public description?: string;\r\n protected constructor(props: SubjectProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n public override toJSON(): SubjectProps { // This override only specializes the return type\r\n return super.toJSON() as SubjectProps; // Entity.toJSON takes care of auto-handled properties\r\n }\r\n /** Create a Code for a Subject given a name that is meant to be unique within the scope of its parent Subject.\r\n * @param iModelDb The IModelDb\r\n * @param parentSubjectId The Id of the parent Subject that provides the scope for names of its child Subjects.\r\n * @param codeValue The child Subject name\r\n */\r\n public static createCode(iModelDb: IModelDb, parentSubjectId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.subject);\r\n return new Code({ spec: codeSpec.id, scope: parentSubjectId, value: codeValue });\r\n }\r\n /** Create a Subject\r\n * @param iModelDb The IModelDb\r\n * @param parentSubjectId The new Subject will be a child of this Subject\r\n * @param name The name (codeValue) of the Subject\r\n * @param description The optional description of the Subject\r\n * @returns The newly constructed Subject\r\n * @throws [[IModelError]] if there is a problem creating the Subject\r\n */\r\n public static create(iModelDb: IModelDb, parentSubjectId: Id64String, name: string, description?: string): Subject {\r\n const subjectProps: SubjectProps = {\r\n classFullName: this.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsSubjects(parentSubjectId),\r\n code: this.createCode(iModelDb, parentSubjectId, name),\r\n description,\r\n };\r\n return new Subject(subjectProps, iModelDb);\r\n }\r\n\r\n /** Insert a Subject\r\n * @param iModelDb Insert into this IModelDb\r\n * @param parentSubjectId The new Subject will be inserted as a child of this Subject\r\n * @param name The name (codeValue) of the Subject\r\n * @param description The optional description of the Subject\r\n * @returns The Id of the newly inserted Subject\r\n * @throws [[IModelError]] if there is a problem inserting the Subject\r\n */\r\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string, description?: string): Id64String {\r\n const subject = this.create(iModelDb, parentSubjectId, name, description);\r\n return iModelDb.elements.insertElement(subject.toJSON());\r\n }\r\n}\r\n\r\n/** An InformationContentElement that identifies the content of a document.\r\n * The realized form of a document is called a DocumentCarrier (different class than Document).\r\n * For example, a will is a legal document. The will published into a PDF file is an ElectronicDocumentCopy.\r\n * The will printed onto paper is a PrintedDocumentCopy.\r\n * In this example, the Document only identifies, names, and tracks the content of the will.\r\n * @public\r\n */\r\nexport abstract class Document extends InformationContentElement {\r\n /** @internal */\r\n public static override get className(): string { return \"Document\"; }\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** A document that represents a drawing, that is, a two-dimensional graphical representation of engineering data. A Drawing element is usually modelled by a [[DrawingModel]].\r\n * @public\r\n */\r\nexport class Drawing extends Document {\r\n /** @internal */\r\n public static override get className(): string { return \"Drawing\"; }\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /** The name of the DrawingModel class modeled by this element type.\r\n * @internal\r\n */\r\n protected static get drawingModelFullClassName(): string { return DrawingModel.classFullName; }\r\n\r\n /** Create a Code for a Drawing given a name that is meant to be unique within the scope of the specified DocumentListModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DocumentListModel that contains the Drawing and provides the scope for its name.\r\n * @param codeValue The Drawing name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.drawing);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n /** Insert a Drawing element and a DrawingModel that breaks it down.\r\n * @param iModelDb Insert into this iModel\r\n * @param documentListModelId Insert the new Drawing into this DocumentListModel\r\n * @param name The name of the Drawing.\r\n * @returns The Id of the newly inserted Drawing element and the DrawingModel that breaks it down (same value).\r\n * @throws [[IModelError]] if unable to insert the element.\r\n */\r\n public static insert(iModelDb: IModelDb, documentListModelId: Id64String, name: string): Id64String {\r\n const drawingProps: ElementProps = {\r\n classFullName: this.classFullName,\r\n model: documentListModelId,\r\n code: this.createCode(iModelDb, documentListModelId, name),\r\n };\r\n const drawingId: Id64String = iModelDb.elements.insertElement(drawingProps);\r\n const model: DrawingModel = iModelDb.models.createModel({\r\n classFullName: this.drawingModelFullClassName,\r\n modeledElement: { id: drawingId },\r\n });\r\n return iModelDb.models.insertModel(model.toJSON());\r\n }\r\n}\r\n\r\n/** A document that represents a section drawing, that is, a graphical documentation derived from a planar\r\n * section of a spatial view. A SectionDrawing element is modelled by a [[SectionDrawingModel]] or a [[GraphicalModel3d]].\r\n * A [[SectionDrawingLocation]] can associate the drawing with a spatial location, enabling [HyperModeling]($hypermodeling).\r\n * @public\r\n */\r\nexport class SectionDrawing extends Drawing {\r\n /** The type of section used to generate the drawing. */\r\n public sectionType: SectionType;\r\n /** The spatial view from which the section was generated. */\r\n public spatialView: RelatedElement;\r\n /** A transform from the section drawing model's coordinates to spatial coordinates. */\r\n public drawingToSpatialTransform?: Transform;\r\n /** If the section drawing is placed onto a [[Sheet]] via a [[ViewAttachment]], a transform from the sheet's coordinates to spatial coordinates. */\r\n public sheetToSpatialTransform?: Transform;\r\n /** If the section drawing is placed onto a [[Sheet]] via a [[ViewAttachment]], the clip to apply to the sheet graphics when drawn in the context\r\n * of the spatial view.\r\n * @note The ClipVector is defined in spatial coordinates.\r\n */\r\n public drawingBoundaryClip?: ClipVector;\r\n /** If true, when displaying the section drawing as a [DrawingViewState]($frontend), the [[spatialView]] will also be displayed. */\r\n public displaySpatialView: boolean;\r\n\r\n /** @internal */\r\n public static override get className(): string { return \"SectionDrawing\"; }\r\n\r\n /** @internal */\r\n protected static override get drawingModelFullClassName(): string { return SectionDrawingModel.classFullName; }\r\n\r\n protected constructor(props: SectionDrawingProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.sectionType = JsonUtils.asInt(props.sectionType, SectionType.Section);\r\n this.spatialView = RelatedElement.fromJSON(props.spatialView) ?? RelatedElement.none;\r\n this.displaySpatialView = JsonUtils.asBool(props.jsonProperties?.displaySpatialView);\r\n\r\n const json = props.jsonProperties;\r\n if (!json)\r\n return;\r\n\r\n if (json.drawingToSpatialTransform)\r\n this.drawingToSpatialTransform = Transform.fromJSON(json.drawingToSpatialTransform);\r\n\r\n if (json.sheetToSpatialTransform)\r\n this.sheetToSpatialTransform = Transform.fromJSON(json.sheetToSpatialTransform);\r\n\r\n if (json.drawingBoundaryClip)\r\n this.drawingBoundaryClip = ClipVector.fromJSON(json.drawingBoundaryClip);\r\n }\r\n\r\n public override toJSON(): SectionDrawingProps {\r\n const props: SectionDrawingProps = {\r\n ...super.toJSON(),\r\n sectionType: this.sectionType,\r\n spatialView: this.spatialView.toJSON(),\r\n };\r\n\r\n if (!props.jsonProperties)\r\n props.jsonProperties = {};\r\n\r\n props.jsonProperties.displaySpatialView = this.displaySpatialView ? true : undefined;\r\n props.jsonProperties.drawingToSpatialTransform = this.drawingToSpatialTransform?.toJSON();\r\n props.jsonProperties.sheetToSpatialTransform = this.sheetToSpatialTransform?.toJSON();\r\n props.jsonProperties.drawingBoundaryClip = this.drawingBoundaryClip?.toJSON();\r\n\r\n return props;\r\n }\r\n}\r\n\r\n/** The template for a SheetBorder\r\n * @public\r\n */\r\nexport class SheetBorderTemplate extends Document {\r\n /** @internal */\r\n public static override get className(): string { return \"SheetBorderTemplate\"; }\r\n public height?: number;\r\n public width?: number;\r\n protected constructor(props: SheetBorderTemplateProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** The template for a [[Sheet]]\r\n * @public\r\n */\r\nexport class SheetTemplate extends Document {\r\n /** @internal */\r\n public static override get className(): string { return \"SheetTemplate\"; }\r\n public height?: number;\r\n public width?: number;\r\n public border?: Id64String;\r\n\r\n protected constructor(props: SheetTemplateProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (undefined !== this.border)\r\n referenceIds.addElement(this.border);\r\n }\r\n}\r\n\r\n/** A digital representation of a *sheet of paper*. Modeled by a [[SheetModel]].\r\n * @public\r\n */\r\nexport class Sheet extends Document {\r\n /** @internal */\r\n public static override get className(): string { return \"Sheet\"; }\r\n public height: number;\r\n public width: number;\r\n public scale?: number;\r\n public sheetTemplate?: Id64String;\r\n\r\n protected constructor(props: SheetProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.height = JsonUtils.asDouble(props.height);\r\n this.width = JsonUtils.asDouble(props.width);\r\n this.scale = props.scale;\r\n this.sheetTemplate = props.sheetTemplate ? Id64.fromJSON(props.sheetTemplate) : undefined;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (undefined !== this.sheetTemplate)\r\n referenceIds.addElement(this.sheetTemplate);\r\n }\r\n\r\n /** Create a Code for a Sheet given a name that is meant to be unique within the scope of the specified DocumentListModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DocumentListModel that contains the Sheet and provides the scope for its name.\r\n * @param codeValue The Sheet name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.sheet);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** Information Record Element is an abstract base class for modeling information records. Information Record\r\n * Element is the default choice if no other subclass of Information Content Element makes sense.\r\n * @public\r\n */\r\nexport abstract class InformationRecordElement extends InformationContentElement {\r\n /** @internal */\r\n public static override get className(): string { return \"InformationRecordElement\"; }\r\n\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** A Definition Element holds configuration-related information that is meant to be referenced / shared.\r\n * @public\r\n */\r\nexport abstract class DefinitionElement extends InformationContentElement {\r\n /** @internal */\r\n public static override get className(): string { return \"DefinitionElement\"; }\r\n /** If true, don't show this DefinitionElement in user interface lists. */\r\n public isPrivate: boolean;\r\n\r\n protected constructor(props: DefinitionElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.isPrivate = true === props.isPrivate;\r\n }\r\n\r\n public override toJSON(): DefinitionElementProps {\r\n const val = super.toJSON() as DefinitionElementProps;\r\n val.isPrivate = this.isPrivate;\r\n return val;\r\n }\r\n}\r\n\r\n/** This abstract class unifies DefinitionGroup and DefinitionContainer for relationship endpoint purposes.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.10\r\n * @public\r\n */\r\nexport abstract class DefinitionSet extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"DefinitionSet\"; }\r\n}\r\n\r\n/** A DefinitionContainer exclusively owns a set of DefinitionElements contained within its sub-model (of type DefinitionModel).\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.10\r\n * @public\r\n */\r\nexport class DefinitionContainer extends DefinitionSet {\r\n /** @internal */\r\n public static override get className(): string { return \"DefinitionContainer\"; }\r\n /** Create a DefinitionContainer\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that will contain this DefinitionContainer element.\r\n * @param code The Code for this DefinitionContainer.\r\n * @param isPrivate The optional hint, that if `true` means it should not be displayed in the UI.\r\n * @returns The newly constructed DefinitionContainer\r\n * @note There is not a predefined CodeSpec for DefinitionContainer elements, so it is the responsibility of the domain or application to create one.\r\n * @throws [[IModelError]] if there is a problem creating the DefinitionContainer\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, code: Code, isPrivate?: boolean): DefinitionContainer {\r\n const elementProps: DefinitionElementProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code,\r\n isPrivate,\r\n };\r\n return new DefinitionContainer(elementProps, iModelDb);\r\n }\r\n /** Insert a DefinitionContainer and its sub-model.\r\n * @param iModelDb Insert into this IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that will contain this DefinitionContainer element.\r\n * @param code The Code for this DefinitionContainer.\r\n * @param isPrivate The optional hint, that if `true` means it should not be displayed in the UI.\r\n * @returns The Id of the newly inserted DefinitionContainer and its newly inserted sub-model (of type DefinitionModel).\r\n * @note There is not a predefined CodeSpec for DefinitionContainer elements, so it is the responsibility of the domain or application to create one.\r\n * @throws [[IModelError]] if there is a problem inserting the DefinitionContainer\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, code: Code, isPrivate?: boolean): Id64String {\r\n const containerElement = this.create(iModelDb, definitionModelId, code, isPrivate);\r\n const containerElementId = iModelDb.elements.insertElement(containerElement.toJSON());\r\n const containerSubModelProps: ModelProps = {\r\n classFullName: DefinitionModel.classFullName,\r\n modeledElement: { id: containerElementId },\r\n isPrivate,\r\n };\r\n iModelDb.models.insertModel(containerSubModelProps);\r\n return containerElementId;\r\n }\r\n}\r\n\r\n/** A non-exclusive set of DefinitionElements grouped using the DefinitionGroupGroupsDefinitions relationship.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.10\r\n * @public\r\n */\r\nexport class DefinitionGroup extends DefinitionSet {\r\n /** @internal */\r\n public static override get className(): string { return \"DefinitionGroup\"; }\r\n /** Create a DefinitionGroup\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that will contain this DefinitionGroup element.\r\n * @param code The Code for this DefinitionGroup\r\n * @param isPrivate The optional hint, that if `true` means it should not be displayed in the UI.\r\n * @returns The newly constructed DefinitionGroup\r\n * @note There is not a predefined CodeSpec for DefinitionGroup elements, so it is the responsibility of the domain or application to create one.\r\n * @throws [[IModelError]] if there is a problem creating the DefinitionGroup\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, code: Code, isPrivate?: boolean): DefinitionGroup {\r\n const elementProps: DefinitionElementProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code,\r\n isPrivate,\r\n };\r\n return new DefinitionGroup(elementProps, iModelDb);\r\n }\r\n}\r\n\r\n/** Defines a set of properties (the *type*) that may be associated with an element.\r\n * @public\r\n */\r\nexport abstract class TypeDefinitionElement extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"TypeDefinitionElement\"; }\r\n public recipe?: RelatedElement;\r\n\r\n protected constructor(props: TypeDefinitionElementProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (undefined !== this.recipe)\r\n referenceIds.addElement(this.recipe.id);\r\n }\r\n}\r\n\r\n/** Defines a recipe for generating instances from a definition.\r\n * @beta\r\n */\r\nexport abstract class RecipeDefinitionElement extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"RecipeDefinitionElement\"; }\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** Defines a set of properties (the *type*) that can be associated with a Physical Element. A Physical\r\n * Type has a strong correlation with something that can be ordered from a catalog since all instances\r\n * share a common set of properties.\r\n * @public\r\n */\r\nexport abstract class PhysicalType extends TypeDefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"PhysicalType\"; }\r\n /** If defined, the [[PhysicalMaterial]] that makes up this PhysicalType. */\r\n public physicalMaterial?: RelatedElement;\r\n protected constructor(props: PhysicalTypeProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.physicalMaterial = RelatedElement.fromJSON(props.physicalMaterial);\r\n }\r\n\r\n public override toJSON(): PhysicalTypeProps {\r\n const val = super.toJSON() as PhysicalTypeProps;\r\n val.physicalMaterial = this.physicalMaterial?.toJSON();\r\n return val;\r\n }\r\n /** Create a Code for a PhysicalType element 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 PhysicalType element and provides the scope for its name.\r\n * @param codeValue The PhysicalType name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.physicalType);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** Defines a set of properties (the *type*) that can be associated with a spatial location.\r\n * @public\r\n */\r\nexport abstract class SpatialLocationType extends TypeDefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"SpatialLocationType\"; }\r\n protected constructor(props: TypeDefinitionElementProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /** Create a Code for a SpatialLocationType element 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 SpatialLocationType element and provides the scope for its name.\r\n * @param codeValue The SpatialLocationType name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.spatialLocationType);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A TemplateRecipe3d is a DefinitionElement that has a sub-model that contains the 3d template elements.\r\n * @beta\r\n */\r\nexport class TemplateRecipe3d extends RecipeDefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"TemplateRecipe3d\"; }\r\n\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /** Create a Code for a TemplateRecipe3d given a name that is meant to be unique within the scope of its Model.\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe3d element.\r\n * @param codeValue The name of the TemplateRecipe3d element.\r\n */\r\n public static createCode(iModelDb: IModelDb, definitionModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.templateRecipe3d);\r\n return new Code({ spec: codeSpec.id, scope: definitionModelId, value: codeValue });\r\n }\r\n\r\n /** Create a TemplateRecipe3d\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe3d element.\r\n * @param name The name (Code.value) of the TemplateRecipe3d\r\n * @returns The newly constructed TemplateRecipe3d\r\n * @throws [[IModelError]] if there is a problem creating the TemplateRecipe3d\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, isPrivate?: boolean): TemplateRecipe3d {\r\n const elementProps: DefinitionElementProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n isPrivate,\r\n };\r\n return new TemplateRecipe3d(elementProps, iModelDb);\r\n }\r\n /** Insert a TemplateRecipe3d and a PhysicalModel (sub-model) that will contain the 3d template elements.\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe3d element.\r\n * @param name The name (Code.value) of the TemplateRecipe3d\r\n * @returns The Id of the newly inserted TemplateRecipe3d and the PhysicalModel that sub-models it.\r\n * @throws [[IModelError]] if there is a problem inserting the TemplateRecipe3d or its sub-model.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, isPrivate?: boolean): Id64String {\r\n const element = this.create(iModelDb, definitionModelId, name, isPrivate);\r\n const modeledElementId: Id64String = iModelDb.elements.insertElement(element.toJSON());\r\n const modelProps: GeometricModel3dProps = {\r\n classFullName: PhysicalModel.classFullName,\r\n modeledElement: { id: modeledElementId },\r\n isTemplate: true,\r\n };\r\n return iModelDb.models.insertModel(modelProps); // will be the same value as modeledElementId\r\n }\r\n}\r\n\r\n/** Defines a set of properties (the *type*) that can be associated with a 2D Graphical Element.\r\n * @public\r\n */\r\nexport abstract class GraphicalType2d extends TypeDefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"GraphicalType2d\"; }\r\n\r\n protected constructor(props: TypeDefinitionElementProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /** Create a Code for a GraphicalType2d element 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 GraphicalType2d element and provides the scope for its name.\r\n * @param codeValue The GraphicalType2d name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.graphicalType2d);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A recipe that uses a 2D template for creating new instances.\r\n * @beta\r\n */\r\nexport class TemplateRecipe2d extends RecipeDefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"TemplateRecipe2d\"; }\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /** Create a Code for a TemplateRecipe2d given a name that is meant to be unique within the scope of its Model.\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe2d element.\r\n * @param codeValue The name of the TemplateRecipe2d element.\r\n */\r\n public static createCode(iModelDb: IModelDb, definitionModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.templateRecipe2d);\r\n return new Code({ spec: codeSpec.id, scope: definitionModelId, value: codeValue });\r\n }\r\n\r\n /** Create a TemplateRecipe2d\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe2d element.\r\n * @param name The name (Code.value) of the TemplateRecipe2d\r\n * @returns The newly constructed TemplateRecipe2d\r\n * @throws [[IModelError]] if there is a problem creating the TemplateRecipe2d\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, isPrivate?: boolean): TemplateRecipe2d {\r\n const elementProps: DefinitionElementProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n isPrivate,\r\n };\r\n return new TemplateRecipe2d(elementProps, iModelDb);\r\n }\r\n /** Insert a TemplateRecipe2d and a DrawingModel (sub-model) that will contain the 2d template elements.\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe2d element.\r\n * @param name The name (Code.value) of the TemplateRecipe2d\r\n * @returns The Id of the newly inserted TemplateRecipe2d and the PhysicalModel that sub-models it.\r\n * @throws [[IModelError]] if there is a problem inserting the TemplateRecipe2d or its sub-model.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, isPrivate?: boolean): Id64String {\r\n const element = this.create(iModelDb, definitionModelId, name, isPrivate);\r\n const modeledElementId: Id64String = iModelDb.elements.insertElement(element.toJSON());\r\n const modelProps: GeometricModel2dProps = {\r\n classFullName: DrawingModel.classFullName,\r\n modeledElement: { id: modeledElementId },\r\n isTemplate: true,\r\n };\r\n return iModelDb.models.insertModel(modelProps); // will be the same value as modeledElementId\r\n }\r\n}\r\n\r\n/** An abstract base class for elements that establishes a particular modeling perspective for its parent Subject.\r\n * Instances are always sub-modeled by a specialization of Model of the appropriate modeling perspective.\r\n * @see [iModel Information Hierarchy]($docs/bis/guide/data-organization/top-of-the-world), [[Subject]], [[Model]]\r\n * @public\r\n */\r\nexport abstract class InformationPartitionElement extends InformationContentElement {\r\n /** @internal */\r\n public static override get className(): string { return \"InformationPartitionElement\"; }\r\n /** A human-readable string describing the intent of the partition. */\r\n public description?: string;\r\n\r\n protected constructor(props: InformationPartitionElementProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n public override toJSON(): InformationPartitionElementProps { // This override only specializes the return type\r\n return super.toJSON() as InformationPartitionElementProps; // Entity.toJSON takes care of auto-handled properties\r\n }\r\n /** Create a code that can be used for any subclass of InformationPartitionElement.\r\n * @param iModelDb The IModelDb\r\n * @param parentSubjectId The Id of the parent Subject that provides the scope for names of its child InformationPartitionElements.\r\n * @param codeValue The InformationPartitionElement name\r\n */\r\n public static createCode(iModel: IModelDb, parentSubjectId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.informationPartitionElement);\r\n return new Code({ spec: codeSpec.id, scope: parentSubjectId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A DefinitionPartition element establishes a *Definition* modeling perspective for its parent Subject.\r\n * A DefinitionPartition is always sub-modeled by a DefinitionModel.\r\n * @see [[DefinitionModel]]\r\n * @public\r\n */\r\nexport class DefinitionPartition extends InformationPartitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"DefinitionPartition\"; }\r\n}\r\n\r\n/** A DocumentPartition element establishes a *Document* modeling perspective for its parent Subject.\r\n * A DocumentPartition is always sub-modeled by a DocumentListModel.\r\n * @see [[DocumentListModel]]\r\n * @public\r\n */\r\nexport class DocumentPartition extends InformationPartitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"DocumentPartition\"; }\r\n}\r\n\r\n/** A GroupInformationPartition element establishes a *Group Information* modeling perspective for its parent Subject.\r\n * A GroupInformationPartition is always sub-modeled by a GroupInformationModel.\r\n * @see [[GroupInformationModel]]\r\n * @public\r\n */\r\nexport class GroupInformationPartition extends InformationPartitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"GroupInformationPartition\"; }\r\n}\r\n\r\n/** A GraphicalPartition3d element establishes a *3D Graphical* modeling perspective for its parent Subject.\r\n * A GraphicalPartition3d is always sub-modeled by a GraphicalModel3d.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.8\r\n * @see [[GraphicalModel3d]]\r\n * @public\r\n */\r\nexport class GraphicalPartition3d extends InformationPartitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"GraphicalPartition3d\"; }\r\n}\r\n\r\n/** An InformationRecordPartition element establishes a *Information Record* modeling perspective for its parent Subject.\r\n * A InformationRecordPartition is always sub-modeled by an InformationRecordModel.\r\n * @see [[InformationRecordModel]]\r\n * @public\r\n */\r\nexport class InformationRecordPartition extends InformationPartitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"InformationRecordPartition\"; }\r\n}\r\n\r\n/** A LinkPartition element establishes a *Link* modeling perspective for its parent Subject. A LinkPartition is always sub-modeled by a LinkModel.\r\n * @see [[LinkModel]]\r\n * @public\r\n */\r\nexport class LinkPartition extends InformationPartitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"LinkPartition\"; }\r\n}\r\n\r\n/** A PhysicalPartition element establishes a *Physical* modeling perspective for its parent Subject. A PhysicalPartition is always sub-modeled by a PhysicalModel.\r\n * @see [[PhysicalModel]]\r\n * @public\r\n */\r\nexport class PhysicalPartition extends InformationPartitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"PhysicalPartition\"; }\r\n}\r\n\r\n/** A SpatialLocationPartition element establishes a *SpatialLocation* modeling perspective for its parent Subject.\r\n * A SpatialLocationPartition is always sub-modeled by a SpatialLocationModel.\r\n * @see [[SpatialLocationModel]]\r\n * @public\r\n */\r\nexport class SpatialLocationPartition extends InformationPartitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"SpatialLocationPartition\"; }\r\n}\r\n\r\n/** Group Information is an abstract base class for modeling entities whose main purpose is to reference a group of related elements.\r\n * @public\r\n */\r\nexport abstract class GroupInformationElement extends InformationReferenceElement {\r\n /** @internal */\r\n public static override get className(): string { return \"GroupInformationElement\"; }\r\n}\r\n\r\n/** An information element that specifies a link.\r\n * @public\r\n */\r\nexport abstract class LinkElement extends InformationReferenceElement {\r\n /** @internal */\r\n public static override get className(): string { return \"LinkElement\"; }\r\n /** Create a Code for a LinkElement given a name that is meant to be unique within the scope of the specified Model.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the Model that contains the LinkElement and provides the scope for its name.\r\n * @param codeValue The LinkElement name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.linkElement);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** An information element that specifies a URL link.\r\n * @public\r\n */\r\nexport class UrlLink extends LinkElement {\r\n /** @internal */\r\n public static override get className(): string { return \"UrlLink\"; }\r\n public description?: string;\r\n public url?: string;\r\n\r\n protected constructor(props: UrlLinkProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.description = props.description;\r\n this.url = props.url;\r\n }\r\n\r\n public override toJSON(): UrlLinkProps {\r\n const val = super.toJSON() as UrlLinkProps;\r\n val.description = this.description;\r\n val.url = this.url;\r\n return val;\r\n }\r\n}\r\n\r\n/** Represents a folder-like structure that organizes repositories (typically files) in an external system.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @alpha\r\n */\r\nexport class FolderLink extends UrlLink {\r\n /** @internal */\r\n public static override get className(): string { return \"FolderLink\"; }\r\n}\r\n\r\n/** An information element that links to a repository.\r\n * @public\r\n */\r\nexport class RepositoryLink extends UrlLink {\r\n /** @internal */\r\n public static override get className(): string { return \"RepositoryLink\"; }\r\n public repositoryGuid?: GuidString;\r\n /** @note This property was added to the BisCore schema in version 1.0.13 */\r\n public format?: string;\r\n\r\n protected constructor(props: RepositoryLinkProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.repositoryGuid = props.repositoryGuid;\r\n this.format = props.format;\r\n }\r\n\r\n public override toJSON(): RepositoryLinkProps {\r\n const val = super.toJSON() as RepositoryLinkProps;\r\n val.repositoryGuid = this.repositoryGuid;\r\n val.format = this.format;\r\n return val;\r\n }\r\n}\r\n\r\n/** An information element that links to an embedded file.\r\n * @public\r\n */\r\nexport class EmbeddedFileLink extends LinkElement {\r\n /** @internal */\r\n public static override get className(): string { return \"EmbeddedFileLink\"; }\r\n}\r\n\r\n/** A real world entity is modeled as a Role Element when a set of external circumstances define an important\r\n * role (one that is worth tracking) that is not intrinsic to the entity playing the role. For example,\r\n * a person can play the role of a teacher or a rock can play the role of a boundary marker.\r\n * @public\r\n */\r\nexport abstract class RoleElement extends Element {\r\n /** @internal */\r\n public static override get className(): string { return \"RoleElement\"; }\r\n}\r\n\r\n/** A Definition Element that specifies a collection of geometry that is meant to be reused across Geometric\r\n * Element instances. Leveraging Geometry Parts can help reduce file size and improve display performance.\r\n * @public\r\n */\r\nexport class GeometryPart extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"GeometryPart\"; }\r\n public geom?: GeometryStreamProps;\r\n /** How to build the part's GeometryStream. This is used for insert and update only. It is not a persistent property. It will be undefined in the properties returned by functions that read a persistent element. It may be specified as an alternative to `geom` when inserting or updating an element.\r\n * @beta\r\n */\r\n public elementGeometryBuilderParams?: ElementGeometryBuilderParamsForPart;\r\n public bbox: ElementAlignedBox3d;\r\n\r\n protected constructor(props: GeometryPartProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.geom = props.geom;\r\n this.bbox = Range3d.fromJSON(props.bbox);\r\n }\r\n\r\n public override toJSON(): GeometryPartProps {\r\n const val = super.toJSON() as GeometryPartProps;\r\n val.geom = this.geom;\r\n val.bbox = this.bbox;\r\n return val;\r\n }\r\n\r\n /** Create a Code for a GeometryPart element 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 GeometryPart element and provides the scope for its name.\r\n * @param codeValue The GeometryPart name\r\n * @note GeometryPart elements are not required to be named (have a non-empty Code).\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.geometryPart);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** The definition element for a line style\r\n * @public\r\n */\r\nexport class LineStyle extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"LineStyle\"; }\r\n public description?: string;\r\n public data!: string;\r\n\r\n protected constructor(props: LineStyleProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /** Create a Code for a LineStyle definition given a name that is meant to be unique within the scope of the specified model.\r\n * @param iModel The IModel\r\n * @param scopeModelId The Id of the DefinitionModel that contains the LineStyle and provides the scope for its name.\r\n * @param codeValue The name of the LineStyle\r\n * @returns A LineStyle Code\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n return new Code({ spec: iModel.codeSpecs.getByName(BisCodeSpec.lineStyle).id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** Describes how to animate a view of a [[GeometricModel]] to show change over time using a [RenderSchedule.Script]($common).\r\n * @note This class was introduced in version 01.00.13 of the BisCore ECSchema. It should only be used with [[IModelDb]]s containing that version or newer.\r\n * @public\r\n */\r\nexport class RenderTimeline extends InformationRecordElement {\r\n /** @internal */\r\n public static override get className(): string { return \"RenderTimeline\"; }\r\n /** A human-readable description of the timeline, which may be an empty string. */\r\n public description: string;\r\n /** The JSON representation of the instructions for visualizing change over time.\r\n * @see [RenderSchedule.Script]($common) for the API for working with the script.\r\n */\r\n public scriptProps: RenderSchedule.ScriptProps;\r\n\r\n protected constructor(props: RenderTimelineProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.description = props.description ?? \"\";\r\n this.scriptProps = RenderTimeline.parseScriptProps(props.script);\r\n }\r\n\r\n public static fromJSON(props: RenderTimelineProps, iModel: IModelDb): RenderTimeline {\r\n return new RenderTimeline(props, iModel);\r\n }\r\n\r\n public override toJSON(): RenderTimelineProps {\r\n const props = super.toJSON() as RenderTimelineProps;\r\n if (this.description.length > 0)\r\n props.description = this.description;\r\n\r\n props.script = JSON.stringify(this.scriptProps);\r\n return props;\r\n }\r\n\r\n private static parseScriptProps(json: string): RenderSchedule.ScriptProps {\r\n try {\r\n return JSON.parse(json);\r\n } catch {\r\n return [];\r\n }\r\n }\r\n\r\n protected override collectReferenceIds(ids: EntityReferenceSet): void {\r\n super.collectReferenceIds(ids);\r\n const script = RenderSchedule.Script.fromJSON(this.scriptProps);\r\n script?.discloseIds(ids); // eslint-disable-line deprecation/deprecation\r\n }\r\n\r\n /** @alpha */\r\n protected static override onCloned(context: IModelElementCloneContext, sourceProps: RenderTimelineProps, targetProps: RenderTimelineProps): void {\r\n super.onCloned(context, sourceProps, targetProps);\r\n if (context.isBetweenIModels)\r\n targetProps.script = JSON.stringify(this.remapScript(context, this.parseScriptProps(targetProps.script)));\r\n }\r\n\r\n /** Remap Ids when cloning a RenderSchedule.Script between iModels on a DisplayStyle or RenderTimeline.\r\n * @internal\r\n */\r\n public static remapScript(context: IModelElementCloneContext, input: RenderSchedule.ScriptProps): RenderSchedule.ScriptProps {\r\n const scriptProps: RenderSchedule.ScriptProps = [];\r\n if (!Array.isArray(input))\r\n return scriptProps;\r\n\r\n const elementIds = new OrderedId64Array();\r\n for (const model of input) {\r\n const modelId = context.findTargetElementId(model.modelId);\r\n if (!Id64.isValid(modelId))\r\n continue;\r\n\r\n model.modelId = modelId;\r\n scriptProps.push(model);\r\n for (const element of model.elementTimelines) {\r\n elementIds.clear();\r\n for (const sourceId of RenderSchedule.ElementTimeline.getElementIds(element.elementIds)) {\r\n const targetId = context.findTargetElementId(sourceId);\r\n if (Id64.isValid(targetId))\r\n elementIds.insert(targetId);\r\n }\r\n\r\n element.elementIds = CompressedId64Set.compressIds(elementIds);\r\n }\r\n }\r\n\r\n return scriptProps;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Element.js","sourceRoot":"","sources":["../../src/Element.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;AAEH,sDAA4H;AAC5H,oDAO4B;AAC5B,wDAAsE;AACtE,qCAAkC;AAGlC,mCAA4F;AAC5F,qEAA+D;AAuE/D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAa,OAAQ,SAAQ,eAAM;IACjC,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,SAAS,CAAC,CAAC,CAAC;IACpE,gBAAgB;IACT,MAAM,KAAc,mBAAmB,KAAK,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAejG,YAAsB,KAAmB,EAAE,MAAgB;QACzD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,IA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BACnB,KAAK,MAAM,QAAQ,IAAI,4BAAc,CAAC,eAAe,CAAC,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;oBACvF,MAAM,QAAQ,GAAG,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;oBACvD,IAAI,mBAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;wBACxB,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;iBAC/B;gBAED,OAAO,CAAC,UAAU,GAAG,gCAAiB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;aAChE;SACF;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;CACF;AAhFD,wCAgFC","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 { CompressedId64Set, GuidString, Id64, Id64Set, Id64String, JsonUtils, OrderedId64Array } from \"@itwin/core-bentley\";\r\nimport {\r\n AxisAlignedBox3d, BisCodeSpec, Code, CodeScopeProps, CodeSpec, ConcreteEntityTypes, DefinitionElementProps, ElementAlignedBox3d, ElementGeometryBuilderParams,\r\n ElementGeometryBuilderParamsForPart, ElementProps, EntityMetaData, EntityReferenceSet, GeometricElement2dProps, GeometricElement3dProps, GeometricElementProps,\r\n GeometricModel2dProps, GeometricModel3dProps, GeometryPartProps, GeometryStreamProps, IModel, InformationPartitionElementProps, LineStyleProps,\r\n ModelProps, PhysicalElementProps, PhysicalTypeProps, Placement2d, Placement3d, RelatedElement, RenderSchedule, RenderTimelineProps,\r\n RepositoryLinkProps, SectionDrawingLocationProps, SectionDrawingProps, SectionType, SheetBorderTemplateProps, SheetProps, SheetTemplateProps,\r\n SubjectProps, TypeDefinition, TypeDefinitionElementProps, UrlLinkProps,\r\n} from \"@itwin/core-common\";\r\nimport { ClipVector, Range3d, Transform } from \"@itwin/core-geometry\";\r\nimport { Entity } from \"./Entity\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { IModelElementCloneContext } from \"./IModelElementCloneContext\";\r\nimport { DefinitionModel, DrawingModel, PhysicalModel, SectionDrawingModel } from \"./Model\";\r\nimport { SubjectOwnsSubjects } from \"./NavigationRelationship\";\r\n\r\n/** Argument for the `Element.onXxx` static methods\r\n * @beta\r\n */\r\nexport interface OnElementArg {\r\n /** The iModel for the Element affected by this method. */\r\n iModel: IModelDb;\r\n}\r\n\r\n/** Argument for `Element.onInsert` and `Element.onUpdate` static methods.\r\n * @beta\r\n */\r\nexport interface OnElementPropsArg extends OnElementArg {\r\n /** The properties of the Element affected by this method.\r\n * @note the properties may be modified. If so the modified values will be inserted/updated.\r\n */\r\n props: ElementProps;\r\n}\r\n\r\n/** Argument for the `Element.onXxx` static methods that notify of operations to an existing Element supplying its Id, ModelId and FederationGuid.\r\n * @beta\r\n */\r\nexport interface OnElementIdArg extends OnElementArg {\r\n /** The Id of the Element affected by this method */\r\n id: Id64String;\r\n /** The ModelId of the element affected by this method */\r\n model: Id64String;\r\n /** The federationGuid of the element affected by this method */\r\n federationGuid: GuidString;\r\n}\r\n\r\n/** Argument for the `Element.onChildXxx` static methods\r\n * @beta\r\n */\r\nexport interface OnChildElementArg extends OnElementArg {\r\n parentId: Id64String;\r\n}\r\n\r\n/** Argument for the `Element.onChildXxx` static methods that supply the properties of the child Element to be inserted or updated.\r\n * @beta\r\n */\r\nexport interface OnChildElementPropsArg extends OnChildElementArg {\r\n /** The new properties of the child Element for this method. */\r\n childProps: Readonly<ElementProps>;\r\n}\r\n\r\n/** Argument for the `Element.onChildXxx` static methods that only supply the Id of the child Element.\r\n * @beta\r\n */\r\nexport interface OnChildElementIdArg extends OnChildElementArg {\r\n /** The Id of the child element for this method */\r\n childId: Id64String;\r\n}\r\n\r\n/** Argument for the `Element.onSubModelInsert` static method\r\n * @beta\r\n */\r\nexport interface OnSubModelPropsArg extends OnElementArg {\r\n /** The properties of the prospective sub-model */\r\n subModelProps: ModelProps;\r\n}\r\n\r\n/** Argument for several `Element.onSubModelXxx` static methods\r\n * @beta\r\n */\r\nexport interface OnSubModelIdArg extends OnElementArg {\r\n /** The modelId of the sub Model */\r\n subModelId: Id64String;\r\n}\r\n\r\n/** The smallest individually identifiable building block for modeling the real world in an iModel.\r\n * Each element represents an [[Entity]] in the real world. Sets of Elements (contained in [[Model]]s) are used to model\r\n * other Elements that represent larger scale real world entities. Using this recursive modeling strategy,\r\n * Elements can represent entities at any scale. Elements can represent physical things or abstract concepts\r\n * or simply be information records.\r\n *\r\n * Every Element has a 64-bit id (inherited from Entity) that uniquely identifies it within an iModel. Every Element also\r\n * has a [[code]] that identifies its meaning in the real world. Additionally, Elements may have a [[federationGuid]]\r\n * to hold a GUID, if the element was assigned that GUID by some other federated database. The iModel database enforces\r\n * uniqueness of id, code, and federationGuid.\r\n *\r\n * The Element class provides `static` methods like [[onInsert]], [[onUpdated]], [[onCloned]], and [[onChildAdded]] that enable\r\n * it to customize persistence operations. For example, the base implementations of [[onInsert]], [[onUpdate]], and [[onDelete]]\r\n * validate that the appropriate [locks]($docs/learning/backend/ConcurrencyControl.md), [codes]($docs/learning/backend/CodeService.md),\r\n * and [channel permissions]($docs/learning/backend/Channel.md) are obtained before a change to the element is written to the iModel.\r\n * A subclass of Element that overrides any of these methods **must** call the `super` method as well. An application that supplies its\r\n * own Element subclasses should register them at startup via [[ClassRegistry.registerModule]] or [[ClassRegistry.register]].\r\n *\r\n * See:\r\n * * [Element Fundamentals]($docs/bis/guide/fundamentals/element-fundamentals.md)\r\n * * [Working with schemas and elements in TypeScript]($docs/learning/backend/SchemasAndElementsInTypeScript.md)\r\n * * [Creating elements]($docs/learning/backend/CreateElements.md)\r\n * @public\r\n */\r\nexport class Element extends Entity {\r\n /** @internal */\r\n public static override get className(): string { return \"Element\"; }\r\n /** @internal */\r\n public static override get protectedOperations() { return [\"onInsert\", \"onUpdate\", \"onDelete\"]; }\r\n\r\n /** The ModelId of the [Model]($docs/bis/guide/fundamentals/model-fundamentals.md) containing this element */\r\n public readonly model: Id64String;\r\n /** The [Code]($docs/bis/guide/fundamentals/codes.md) for this element */\r\n public code: Code;\r\n /** The parent element, if present, of this element. */\r\n public parent?: RelatedElement;\r\n /** A [FederationGuid]($docs/bis/guide/fundamentals/element-fundamentals.md#federationguid) assigned to this element by some other federated database */\r\n public federationGuid?: GuidString;\r\n /** A [user-assigned label]($docs/bis/guide/fundamentals/element-fundamentals.md#userlabel) for this element. */\r\n public userLabel?: string;\r\n /** Optional [json properties]($docs/bis/guide/fundamentals/element-fundamentals.md#jsonproperties) of this element. */\r\n public readonly jsonProperties: { [key: string]: any };\r\n\r\n protected constructor(props: ElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.code = Code.fromJSON(props.code); // TODO: Validate props.code - don't silently fail if it is the wrong type\r\n this.model = RelatedElement.idFromJson(props.model);\r\n this.parent = RelatedElement.fromJSON(props.parent);\r\n this.federationGuid = props.federationGuid;\r\n this.userLabel = props.userLabel;\r\n this.jsonProperties = { ...props.jsonProperties }; // make sure we have our own copy\r\n }\r\n\r\n /** Called before a new Element is inserted.\r\n * @note throw an exception to disallow the insert\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Element to be inserted\r\n * @beta\r\n */\r\n protected static onInsert(arg: OnElementPropsArg): void {\r\n const { iModel, props } = arg;\r\n const operation = \"insert\";\r\n iModel.channels.verifyChannel(arg.props.model);\r\n iModel.locks.checkSharedLock(props.model, \"model\", operation); // inserting requires shared lock on model\r\n if (props.parent) // inserting requires shared lock on parent, if present\r\n iModel.locks.checkSharedLock(props.parent.id, \"parent\", operation);\r\n iModel.codeService?.verifyCode(arg);\r\n }\r\n\r\n /** Called after a new Element was inserted.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Element that was inserted\r\n * @beta\r\n */\r\n protected static onInserted(arg: OnElementIdArg): void {\r\n arg.iModel.locks.elementWasCreated(arg.id);\r\n }\r\n\r\n /** Called before an Element is updated.\r\n * @note throw an exception to disallow the update\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Element to be updated\r\n * @beta\r\n */\r\n protected static onUpdate(arg: OnElementPropsArg): void {\r\n const { iModel, props } = arg;\r\n iModel.channels.verifyChannel(props.model);\r\n iModel.locks.checkExclusiveLock(props.id!, \"element\", \"update\"); // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n iModel.codeService?.verifyCode(arg);\r\n }\r\n\r\n /** Called after an Element was updated.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Element that was updated\r\n * @beta\r\n */\r\n protected static onUpdated(_arg: OnElementIdArg): void { }\r\n\r\n /** Called before an Element is deleted.\r\n * @note throw an exception to disallow the delete\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Element to be deleted\r\n * @beta\r\n */\r\n protected static onDelete(arg: OnElementIdArg): void {\r\n arg.iModel.channels.verifyChannel(arg.model);\r\n arg.iModel.locks.checkExclusiveLock(arg.id, \"element\", \"delete\");\r\n }\r\n\r\n /** Called after an Element was deleted.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Element that was deleted\r\n * @beta\r\n */\r\n protected static onDeleted(_arg: OnElementIdArg): void { }\r\n\r\n /** Called when an element with an instance of this class as its parent is about to be deleted.\r\n * @note throw an exception if the element should not be deleted\r\n * @note implementers should not presume that the element was deleted if this method does not throw,\r\n * since the delete may fail for other reasons. Instead, rely on [[onChildDeleted]] for that purpose.\r\n * @note `this` is the class of the parent Element whose child will be deleted\r\n * @beta\r\n */\r\n protected static onChildDelete(_arg: OnChildElementIdArg): void { }\r\n\r\n /** Called after an element with an instance of this class as its parent was successfully deleted.\r\n * @note `this` is the class of the parent Element whose child was deleted\r\n * @beta\r\n */\r\n protected static onChildDeleted(_arg: OnChildElementIdArg): void { }\r\n\r\n /** Called when a *new element* with an instance of this class as its parent is about to be inserted.\r\n * @note throw an exception if the element should not be inserted\r\n * @note `this` is the class of the prospective parent Element.\r\n * @beta\r\n */\r\n protected static onChildInsert(_arg: OnChildElementPropsArg): void { }\r\n\r\n /** Called after a *new element* with an instance of this class as its parent was inserted.\r\n * @note `this` is the class of the parent Element.\r\n * @beta\r\n */\r\n protected static onChildInserted(_arg: OnChildElementIdArg): void { }\r\n\r\n /** Called when an element with an instance of this class as its parent is about to be updated.\r\n * @note throw an exception if the element should not be updated\r\n * @note `this` is the class of the parent Element.\r\n * @beta\r\n */\r\n protected static onChildUpdate(_arg: OnChildElementPropsArg): void { }\r\n\r\n /** Called after an element with an instance of this the class as its parent was updated.\r\n * @note `this` is the class of the parent Element.\r\n * @beta\r\n */\r\n protected static onChildUpdated(_arg: OnChildElementIdArg): void { }\r\n\r\n /** Called when an *existing element* is about to be updated so that an instance of this class will become its new parent.\r\n * @note throw an exception if the element should not be added\r\n * @note `this` is the class of the prospective parent Element.\r\n * @beta\r\n */\r\n protected static onChildAdd(_arg: OnChildElementPropsArg): void { }\r\n\r\n /** Called after an *existing element* has been updated so that an instance of this class is its new parent.\r\n * @note `this` is the class of the new parent Element.\r\n * @beta\r\n */\r\n protected static onChildAdded(_arg: OnChildElementIdArg): void { }\r\n\r\n /** Called when an element with an instance of this class as its parent is about to be updated change to a different parent.\r\n * @note throw an exception if the element should not be dropped\r\n * @note `this` is the class of the parent Element.\r\n * @beta\r\n */\r\n protected static onChildDrop(_arg: OnChildElementIdArg): void { }\r\n\r\n /** Called after an element with an instance of this class as its previous parent was updated to have a new parent.\r\n * @note `this` is the class of the previous parent Element.\r\n * @beta\r\n */\r\n protected static onChildDropped(_arg: OnChildElementIdArg): void { }\r\n\r\n /** Called when an instance of this class is being *sub-modeled* by a new Model.\r\n * @note throw an exception if model should not be inserted\r\n * @note `this` is the class of Element to be sub-modeled.\r\n * @beta\r\n */\r\n protected static onSubModelInsert(_arg: OnSubModelPropsArg): void { }\r\n\r\n /** Called after an instance of this class was *sub-modeled* by a new Model.\r\n * @note `this` is the class of Element that is now sub-modeled.\r\n * @beta\r\n */\r\n protected static onSubModelInserted(_arg: OnSubModelIdArg): void { }\r\n\r\n /** Called when a sub-model of an instance of this class is being deleted.\r\n * @note throw an exception if model should not be deleted\r\n * @note `this` is the class of Element that is sub-modeled.\r\n * @beta\r\n */\r\n protected static onSubModelDelete(_arg: OnSubModelIdArg): void { }\r\n\r\n /** Called after a sub-model of an instance of this class was deleted.\r\n * @note `this` is the class of Element that was sub-modeled.\r\n * @beta\r\n */\r\n protected static onSubModelDeleted(_arg: OnSubModelIdArg): void { }\r\n\r\n /** Called during the iModel transformation process after an Element from the source iModel was *cloned* for the target iModel.\r\n * The transformation process automatically handles remapping BisCore properties and those that are properly described in ECSchema.\r\n * This callback is only meant to be overridden if there are other Ids in non-standard locations that need to be remapped or other data that needs to be fixed up after the clone.\r\n * @param _context The context that persists any remapping between the source iModel and target iModel.\r\n * @param _sourceProps The ElementProps for the source Element that was cloned.\r\n * @param _targetProps The ElementProps that are a result of the clone. These can be further modified.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onCloned(_context: IModelElementCloneContext, _sourceProps: ElementProps, _targetProps: ElementProps): void { }\r\n\r\n /** Called when a *root* element in a subgraph is changed and before its outputs are processed.\r\n * This special callback is made when:\r\n * * the element is part of an [[ElementDrivesElement]] graph, and\r\n * * the element has no inputs, and\r\n * * none of the element's outputs have been processed.\r\n * @see [[ElementDrivesElement]] for more on element dependency graphs.\r\n * @beta\r\n */\r\n protected static onBeforeOutputsHandled(_id: Id64String, _iModel: IModelDb): void { }\r\n\r\n /** Called on an element in a graph after all of its inputs have been processed and before its outputs are processed.\r\n * This callback is made when:\r\n * * the specified element is part of an [[ElementDrivesElement]] graph, and\r\n * * there was a direct change to some element upstream in the dependency graph.\r\n * * all upstream elements in the graph have been processed.\r\n * * none of the downstream elements have been processed.\r\n * This method is not called if none of the element's inputs were changed.\r\n * @see [[ElementDrivesElement]] for more on element dependency graphs.\r\n * @beta\r\n */\r\n protected static onAllInputsHandled(_id: Id64String, _iModel: IModelDb): void { }\r\n\r\n public override toJSON(): ElementProps {\r\n const val = super.toJSON() as ElementProps;\r\n\r\n if (Code.isValid(this.code))\r\n val.code = this.code;\r\n\r\n val.model = this.model;\r\n if (undefined !== this.userLabel) // NOTE: blank string should be included in JSON\r\n val.userLabel = this.userLabel;\r\n if (this.federationGuid)\r\n val.federationGuid = this.federationGuid;\r\n if (this.parent)\r\n val.parent = this.parent;\r\n\r\n if (Object.keys(this.jsonProperties).length > 0)\r\n val.jsonProperties = this.jsonProperties;\r\n\r\n return val;\r\n }\r\n\r\n /** Collect the Ids of this element's *references* at this level of the class hierarchy.\r\n * @deprecated in 3.x. use [[collectReferenceIds]] instead, the use of the term *predecessors* was confusing and became inaccurate when the transformer could handle cycles\r\n * @beta\r\n */\r\n protected collectPredecessorIds(predecessorIds: EntityReferenceSet): void {\r\n return this.collectReferenceIds(predecessorIds);\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addModel(this.model); // The modeledElement is a reference\r\n if (this.code.scope && Id64.isValidId64(this.code.scope))\r\n referenceIds.addElement(this.code.scope); // The element that scopes the code is a reference\r\n if (this.parent)\r\n referenceIds.addElement(this.parent.id); // A parent element is a reference\r\n }\r\n\r\n /** Get the Ids of this element's *references*. A *reference* is any element whose id is stored in the EC data of this element\r\n * This is important for cloning operations but can be useful in other situations as well.\r\n * @beta\r\n * @deprecated in 3.x. use [[getReferenceIds]] instead, the use of the term *predecessors* was confusing and became inaccurate when the transformer could handle cycles\r\n */\r\n public getPredecessorIds(): Id64Set {\r\n return this.getReferenceIds();\r\n }\r\n\r\n /** A *required reference* is an element that had to be inserted before this element could have been inserted.\r\n * This is the list of property keys on this element that store references to those elements\r\n * @note This should be overridden (with `super` called) at each level of the class hierarchy that introduces required references.\r\n * @note any property listed here must be added to the reference ids in [[collectReferenceIds]]\r\n * @beta\r\n */\r\n public static readonly requiredReferenceKeys: ReadonlyArray<string> = [\"parent\", \"model\"];\r\n\r\n /** A map of every [[requiredReferenceKeys]] on this class to their entity type.\r\n * @note This should be overridden (with `super` called) at each level of the class hierarchy that introduces required references.\r\n * @alpha\r\n */\r\n public static readonly requiredReferenceKeyTypeMap: Record<string, ConcreteEntityTypes> = {\r\n parent: ConcreteEntityTypes.Element,\r\n model: ConcreteEntityTypes.Model,\r\n };\r\n\r\n /** Get the class metadata for this element. */\r\n public getClassMetaData(): EntityMetaData | undefined { return this.iModel.classMetaDataRegistry.find(this.classFullName); }\r\n\r\n private getAllUserProperties(): any {\r\n if (!this.jsonProperties.UserProps)\r\n this.jsonProperties.UserProps = new Object();\r\n\r\n return this.jsonProperties.UserProps;\r\n }\r\n\r\n /** Get a set of JSON user properties by namespace */\r\n public getUserProperties(namespace: string) { return this.getAllUserProperties()[namespace]; }\r\n\r\n /** Change a set of user JSON properties of this Element by namespace. */\r\n public setUserProperties(nameSpace: string, value: any) { this.getAllUserProperties()[nameSpace] = value; }\r\n\r\n /** Remove a set of JSON user properties, specified by namespace, from this Element */\r\n public removeUserProperties(nameSpace: string) { delete this.getAllUserProperties()[nameSpace]; }\r\n\r\n /** Get a JSON property of this element, by namespace */\r\n public getJsonProperty(nameSpace: string): any { return this.jsonProperties[nameSpace]; }\r\n public setJsonProperty(nameSpace: string, value: any) { this.jsonProperties[nameSpace] = value; }\r\n\r\n /** Get a display label for this Element. By default returns userLabel if present, otherwise code value. */\r\n public getDisplayLabel(): string { return this.userLabel ?? this.code.value; }\r\n\r\n /** Get a list of HTML strings that describe this Element for the tooltip. Strings will be listed on separate lines in the tooltip.\r\n * Any instances of the pattern `%{tag}` will be replaced by the localized value of tag.\r\n */\r\n public getToolTipMessage(): string[] {\r\n const addKey = (key: string) => `<b>%{iModelJs:Element.${key}}:</b> `; // %{iModelJs:Element.xxx} is replaced with localized value of xxx in frontend.\r\n const msg: string[] = [];\r\n const display = this.getDisplayLabel();\r\n msg.push(display ? display : `${addKey(\"Id\") + this.id}, ${addKey(\"Type\")}${this.className}`);\r\n\r\n if (this instanceof GeometricElement)\r\n msg.push(addKey(\"Category\") + this.iModel.elements.getElement(this.category).getDisplayLabel());\r\n\r\n msg.push(addKey(\"Model\") + this.iModel.elements.getElement(this.model).getDisplayLabel());\r\n return msg;\r\n }\r\n\r\n /**\r\n * Insert this Element into the iModel.\r\n * @see [[IModelDb.Elements.insertElement]]\r\n * @note For convenience, the value of `this.id` is updated to reflect the resultant element's id.\r\n * However when `this.federationGuid` is not present or undefined, a new Guid will be generated and stored on the resultant element. But\r\n * the value of `this.federationGuid` is *not* updated. Generally, it is best to re-read the element after inserting (e.g. via [[IModelDb.Elements.getElement]])\r\n * if you intend to continue working with it. That will ensure its values reflect the persistent state.\r\n */\r\n public insert() {\r\n return this.id = this.iModel.elements.insertElement(this.toJSON());\r\n }\r\n /** Update this Element in the iModel. */\r\n public update() { this.iModel.elements.updateElement(this.toJSON()); }\r\n /** Delete this Element from the iModel. */\r\n public delete() { this.iModel.elements.deleteElement(this.id); }\r\n}\r\n\r\n/** An abstract base class to model real world entities that intrinsically have geometry.\r\n * @public\r\n */\r\nexport abstract class GeometricElement extends Element {\r\n /** @internal */\r\n public static override get className(): string { return \"GeometricElement\"; }\r\n /** The Id of the [[Category]] for this GeometricElement. */\r\n public category: Id64String;\r\n /** The GeometryStream for this GeometricElement. */\r\n public geom?: GeometryStreamProps;\r\n /** How to build the element's GeometryStream. This is used for insert and update only. It is not a persistent property. It will be undefined in the properties returned by functions that read a persistent element. It may be specified as an alternative to `geom` when inserting or updating an element.\r\n * @beta\r\n */\r\n public elementGeometryBuilderParams?: ElementGeometryBuilderParams;\r\n /** The origin, orientation, and bounding box of this GeometricElement. */\r\n public abstract get placement(): Placement2d | Placement3d;\r\n\r\n protected constructor(props: GeometricElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.category = Id64.fromJSON(props.category);\r\n this.geom = props.geom;\r\n }\r\n\r\n /** Type guard for instanceof [[GeometricElement3d]] */\r\n public is3d(): this is GeometricElement3d { return this instanceof GeometricElement3d; }\r\n /** Type guard for instanceof [[GeometricElement2d]] */\r\n public is2d(): this is GeometricElement2d { return this instanceof GeometricElement2d; }\r\n /** Get the [Transform]($geometry) from the Placement of this GeometricElement */\r\n public getPlacementTransform(): Transform { return this.placement.transform; }\r\n public calculateRange3d(): AxisAlignedBox3d { return this.placement.calculateRange(); }\r\n\r\n public override toJSON(): GeometricElementProps {\r\n const val = super.toJSON() as GeometricElementProps;\r\n val.category = this.category;\r\n if (this.geom)\r\n val.geom = this.geom;\r\n return val;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n referenceIds.addElement(this.category);\r\n // TODO: GeometryPartIds?\r\n }\r\n\r\n /** @beta */\r\n public static override readonly requiredReferenceKeys: ReadonlyArray<string> = [...super.requiredReferenceKeys, \"category\"];\r\n /** @alpha */\r\n public static override readonly requiredReferenceKeyTypeMap: Record<string, ConcreteEntityTypes> = {\r\n ...super.requiredReferenceKeyTypeMap,\r\n category: ConcreteEntityTypes.Element,\r\n };\r\n}\r\n\r\n/** An abstract base class to model real world entities that intrinsically have 3d geometry.\r\n * See [how to create a GeometricElement3d]($docs/learning/backend/CreateElements.md#GeometricElement3d).\r\n * @public\r\n */\r\nexport abstract class GeometricElement3d extends GeometricElement {\r\n /** @internal */\r\n public static override get className(): string { return \"GeometricElement3d\"; }\r\n public placement: Placement3d;\r\n public typeDefinition?: TypeDefinition;\r\n\r\n protected constructor(props: GeometricElement3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.placement = Placement3d.fromJSON(props.placement);\r\n if (props.typeDefinition)\r\n this.typeDefinition = TypeDefinition.fromJSON(props.typeDefinition);\r\n }\r\n\r\n public override toJSON(): GeometricElement3dProps {\r\n const val = super.toJSON() as GeometricElement3dProps;\r\n val.placement = this.placement;\r\n if (undefined !== this.typeDefinition)\r\n val.typeDefinition = this.typeDefinition;\r\n\r\n return val;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (undefined !== this.typeDefinition)\r\n referenceIds.addElement(this.typeDefinition.id);\r\n }\r\n}\r\n\r\n/** A 3d Graphical Element\r\n * @public\r\n */\r\nexport abstract class GraphicalElement3d extends GeometricElement3d {\r\n /** @internal */\r\n public static override get className(): string { return \"GraphicalElement3d\"; }\r\n protected constructor(props: GeometricElement3dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** An abstract base class to model information entities that intrinsically have 2d geometry.\r\n * @public\r\n */\r\nexport abstract class GeometricElement2d extends GeometricElement {\r\n /** @internal */\r\n public static override get className(): string { return \"GeometricElement2d\"; }\r\n public placement: Placement2d;\r\n public typeDefinition?: TypeDefinition;\r\n\r\n protected constructor(props: GeometricElement2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.placement = Placement2d.fromJSON(props.placement);\r\n if (props.typeDefinition)\r\n this.typeDefinition = TypeDefinition.fromJSON(props.typeDefinition);\r\n }\r\n\r\n public override toJSON(): GeometricElement2dProps {\r\n const val = super.toJSON() as GeometricElement2dProps;\r\n val.placement = this.placement;\r\n if (undefined !== this.typeDefinition)\r\n val.typeDefinition = this.typeDefinition;\r\n\r\n return val;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (undefined !== this.typeDefinition)\r\n referenceIds.addElement(this.typeDefinition.id);\r\n }\r\n}\r\n\r\n/** An abstract base class for 2d Geometric Elements that are used to convey information within graphical presentations (like drawings).\r\n * @public\r\n */\r\nexport abstract class GraphicalElement2d extends GeometricElement2d {\r\n /** @internal */\r\n public static override get className(): string { return \"GraphicalElement2d\"; }\r\n protected constructor(props: GeometricElement2dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** 2d element used to annotate drawings and sheets.\r\n * @public\r\n */\r\nexport class AnnotationElement2d extends GraphicalElement2d {\r\n /** @internal */\r\n public static override get className(): string { return \"AnnotationElement2d\"; }\r\n protected constructor(props: GeometricElement2dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** 2d element used to persist graphics for use in drawings.\r\n * @public\r\n */\r\nexport class DrawingGraphic extends GraphicalElement2d {\r\n /** @internal */\r\n public static override get className(): string { return \"DrawingGraphic\"; }\r\n protected constructor(props: GeometricElement2dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** 2D Text Annotation\r\n * @public\r\n */\r\nexport class TextAnnotation2d extends AnnotationElement2d {\r\n /** @internal */\r\n public static override get className(): string { return \"TextAnnotation2d\"; }\r\n protected constructor(props: GeometricElement2dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** 3D Text Annotation\r\n * @public\r\n */\r\nexport class TextAnnotation3d extends GraphicalElement3d {\r\n /** @internal */\r\n public static override get className(): string { return \"TextAnnotation3d\"; }\r\n protected constructor(props: GeometricElement3dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** An Element that occupies real world space. Its coordinates are in the project space of its iModel.\r\n * @public\r\n */\r\nexport abstract class SpatialElement extends GeometricElement3d {\r\n /** @internal */\r\n public static override get className(): string { return \"SpatialElement\"; }\r\n protected constructor(props: GeometricElement3dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** An Element that is spatially located, has mass, and can be *touched*.\r\n * @public\r\n */\r\nexport abstract class PhysicalElement extends SpatialElement {\r\n /** @internal */\r\n public static override get className(): string { return \"PhysicalElement\"; }\r\n /** If defined, the [[PhysicalMaterial]] that makes up this PhysicalElement. */\r\n public physicalMaterial?: RelatedElement;\r\n protected constructor(props: PhysicalElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.physicalMaterial = RelatedElement.fromJSON(props.physicalMaterial);\r\n }\r\n\r\n public override toJSON(): PhysicalElementProps {\r\n const val = super.toJSON() as PhysicalElementProps;\r\n val.physicalMaterial = this.physicalMaterial?.toJSON();\r\n return val;\r\n }\r\n}\r\n\r\n/** Identifies a *tracked* real world location but has no mass and cannot be *touched*.\r\n * @public\r\n */\r\nexport abstract class SpatialLocationElement extends SpatialElement {\r\n /** @internal */\r\n public static override get className(): string { return \"SpatialLocationElement\"; }\r\n protected constructor(props: GeometricElement3dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** A Volume Element is a Spatial Location Element that is restricted to defining a volume.\r\n * @public\r\n */\r\nexport class VolumeElement extends SpatialLocationElement {\r\n /** @internal */\r\n public static override get className(): string { return \"VolumeElement\"; }\r\n protected constructor(props: GeometricElement3dProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** A SectionDrawingLocation element identifies the location of a [[SectionDrawing]] in the context of a [[SpatialModel]],\r\n * enabling [HyperModeling]($hypermodeling).\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.11.\r\n * @public\r\n */\r\nexport class SectionDrawingLocation extends SpatialLocationElement {\r\n /** The Id of the [[ViewDefinition]] to which this location refers. */\r\n public sectionView: RelatedElement;\r\n\r\n /** @internal */\r\n public static override get className(): string { return \"SectionDrawingLocation\"; }\r\n\r\n public constructor(props: SectionDrawingLocationProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.sectionView = RelatedElement.fromJSON(props.sectionView) ?? RelatedElement.none;\r\n }\r\n\r\n public override toJSON(): SectionDrawingLocationProps {\r\n return {\r\n ...super.toJSON(),\r\n sectionView: this.sectionView.toJSON(),\r\n };\r\n }\r\n}\r\n\r\n/** Information Content Element is an abstract base class for modeling pure information entities. Only the\r\n * core framework should directly subclass from Information Content Element. Domain and application developers\r\n * should start with the most appropriate subclass of Information Content Element.\r\n * @public\r\n */\r\nexport abstract class InformationContentElement extends Element {\r\n /** @internal */\r\n public static override get className(): string { return \"InformationContentElement\"; }\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** Element used in conjunction with bis:ElementDrivesElement relationships to bundle multiple inputs before\r\n * driving the output element.\r\n * @beta\r\n */\r\nexport abstract class DriverBundleElement extends InformationContentElement {\r\n /** @internal */\r\n public static override get className(): string { return \"DriverBundleElement\"; }\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** Information Reference is an abstract base class for modeling entities whose main purpose is to reference something else.\r\n * @public\r\n */\r\nexport abstract class InformationReferenceElement extends InformationContentElement {\r\n /** @internal */\r\n public static override get className(): string { return \"InformationReferenceElement\"; }\r\n\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** A Subject is an information element that describes what this repository (or part thereof) is about.\r\n * See [how to create a Subject element]$(docs/learning/backend/CreateElements.md#Subject).\r\n * @public\r\n */\r\nexport class Subject extends InformationReferenceElement {\r\n /** @internal */\r\n public static override get className(): string { return \"Subject\"; }\r\n public description?: string;\r\n protected constructor(props: SubjectProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n public override toJSON(): SubjectProps { // This override only specializes the return type\r\n return super.toJSON() as SubjectProps; // Entity.toJSON takes care of auto-handled properties\r\n }\r\n /** Create a Code for a Subject given a name that is meant to be unique within the scope of its parent Subject.\r\n * @param iModelDb The IModelDb\r\n * @param parentSubjectId The Id of the parent Subject that provides the scope for names of its child Subjects.\r\n * @param codeValue The child Subject name\r\n */\r\n public static createCode(iModelDb: IModelDb, parentSubjectId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.subject);\r\n return new Code({ spec: codeSpec.id, scope: parentSubjectId, value: codeValue });\r\n }\r\n /** Create a Subject\r\n * @param iModelDb The IModelDb\r\n * @param parentSubjectId The new Subject will be a child of this Subject\r\n * @param name The name (codeValue) of the Subject\r\n * @param description The optional description of the Subject\r\n * @returns The newly constructed Subject\r\n * @throws [[IModelError]] if there is a problem creating the Subject\r\n */\r\n public static create(iModelDb: IModelDb, parentSubjectId: Id64String, name: string, description?: string): Subject {\r\n const subjectProps: SubjectProps = {\r\n classFullName: this.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsSubjects(parentSubjectId),\r\n code: this.createCode(iModelDb, parentSubjectId, name),\r\n description,\r\n };\r\n return new Subject(subjectProps, iModelDb);\r\n }\r\n\r\n /** Insert a Subject\r\n * @param iModelDb Insert into this IModelDb\r\n * @param parentSubjectId The new Subject will be inserted as a child of this Subject\r\n * @param name The name (codeValue) of the Subject\r\n * @param description The optional description of the Subject\r\n * @returns The Id of the newly inserted Subject\r\n * @throws [[IModelError]] if there is a problem inserting the Subject\r\n */\r\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string, description?: string): Id64String {\r\n const subject = this.create(iModelDb, parentSubjectId, name, description);\r\n return iModelDb.elements.insertElement(subject.toJSON());\r\n }\r\n}\r\n\r\n/** An InformationContentElement that identifies the content of a document.\r\n * The realized form of a document is called a DocumentCarrier (different class than Document).\r\n * For example, a will is a legal document. The will published into a PDF file is an ElectronicDocumentCopy.\r\n * The will printed onto paper is a PrintedDocumentCopy.\r\n * In this example, the Document only identifies, names, and tracks the content of the will.\r\n * @public\r\n */\r\nexport abstract class Document extends InformationContentElement {\r\n /** @internal */\r\n public static override get className(): string { return \"Document\"; }\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** A document that represents a drawing, that is, a two-dimensional graphical representation of engineering data. A Drawing element is usually modelled by a [[DrawingModel]].\r\n * @public\r\n */\r\nexport class Drawing extends Document {\r\n /** @internal */\r\n public static override get className(): string { return \"Drawing\"; }\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /** The name of the DrawingModel class modeled by this element type.\r\n * @internal\r\n */\r\n protected static get drawingModelFullClassName(): string { return DrawingModel.classFullName; }\r\n\r\n /** Create a Code for a Drawing given a name that is meant to be unique within the scope of the specified DocumentListModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DocumentListModel that contains the Drawing and provides the scope for its name.\r\n * @param codeValue The Drawing name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.drawing);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n\r\n /** Insert a Drawing element and a DrawingModel that breaks it down.\r\n * @param iModelDb Insert into this iModel\r\n * @param documentListModelId Insert the new Drawing into this DocumentListModel\r\n * @param name The name of the Drawing.\r\n * @returns The Id of the newly inserted Drawing element and the DrawingModel that breaks it down (same value).\r\n * @throws [[IModelError]] if unable to insert the element.\r\n */\r\n public static insert(iModelDb: IModelDb, documentListModelId: Id64String, name: string): Id64String {\r\n const drawingProps: ElementProps = {\r\n classFullName: this.classFullName,\r\n model: documentListModelId,\r\n code: this.createCode(iModelDb, documentListModelId, name),\r\n };\r\n const drawingId: Id64String = iModelDb.elements.insertElement(drawingProps);\r\n const model: DrawingModel = iModelDb.models.createModel({\r\n classFullName: this.drawingModelFullClassName,\r\n modeledElement: { id: drawingId },\r\n });\r\n return iModelDb.models.insertModel(model.toJSON());\r\n }\r\n}\r\n\r\n/** A document that represents a section drawing, that is, a graphical documentation derived from a planar\r\n * section of a spatial view. A SectionDrawing element is modelled by a [[SectionDrawingModel]] or a [[GraphicalModel3d]].\r\n * A [[SectionDrawingLocation]] can associate the drawing with a spatial location, enabling [HyperModeling]($hypermodeling).\r\n * @public\r\n */\r\nexport class SectionDrawing extends Drawing {\r\n /** The type of section used to generate the drawing. */\r\n public sectionType: SectionType;\r\n /** The spatial view from which the section was generated. */\r\n public spatialView: RelatedElement;\r\n /** A transform from the section drawing model's coordinates to spatial coordinates. */\r\n public drawingToSpatialTransform?: Transform;\r\n /** If the section drawing is placed onto a [[Sheet]] via a [[ViewAttachment]], a transform from the sheet's coordinates to spatial coordinates. */\r\n public sheetToSpatialTransform?: Transform;\r\n /** If the section drawing is placed onto a [[Sheet]] via a [[ViewAttachment]], the clip to apply to the sheet graphics when drawn in the context\r\n * of the spatial view.\r\n * @note The ClipVector is defined in spatial coordinates.\r\n */\r\n public drawingBoundaryClip?: ClipVector;\r\n /** If true, when displaying the section drawing as a [DrawingViewState]($frontend), the [[spatialView]] will also be displayed. */\r\n public displaySpatialView: boolean;\r\n\r\n /** @internal */\r\n public static override get className(): string { return \"SectionDrawing\"; }\r\n\r\n /** @internal */\r\n protected static override get drawingModelFullClassName(): string { return SectionDrawingModel.classFullName; }\r\n\r\n protected constructor(props: SectionDrawingProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.sectionType = JsonUtils.asInt(props.sectionType, SectionType.Section);\r\n this.spatialView = RelatedElement.fromJSON(props.spatialView) ?? RelatedElement.none;\r\n this.displaySpatialView = JsonUtils.asBool(props.jsonProperties?.displaySpatialView);\r\n\r\n const json = props.jsonProperties;\r\n if (!json)\r\n return;\r\n\r\n if (json.drawingToSpatialTransform)\r\n this.drawingToSpatialTransform = Transform.fromJSON(json.drawingToSpatialTransform);\r\n\r\n if (json.sheetToSpatialTransform)\r\n this.sheetToSpatialTransform = Transform.fromJSON(json.sheetToSpatialTransform);\r\n\r\n if (json.drawingBoundaryClip)\r\n this.drawingBoundaryClip = ClipVector.fromJSON(json.drawingBoundaryClip);\r\n }\r\n\r\n public override toJSON(): SectionDrawingProps {\r\n const props: SectionDrawingProps = {\r\n ...super.toJSON(),\r\n sectionType: this.sectionType,\r\n spatialView: this.spatialView.toJSON(),\r\n };\r\n\r\n if (!props.jsonProperties)\r\n props.jsonProperties = {};\r\n\r\n props.jsonProperties.displaySpatialView = this.displaySpatialView ? true : undefined;\r\n props.jsonProperties.drawingToSpatialTransform = this.drawingToSpatialTransform?.toJSON();\r\n props.jsonProperties.sheetToSpatialTransform = this.sheetToSpatialTransform?.toJSON();\r\n props.jsonProperties.drawingBoundaryClip = this.drawingBoundaryClip?.toJSON();\r\n\r\n return props;\r\n }\r\n}\r\n\r\n/** The template for a SheetBorder\r\n * @public\r\n */\r\nexport class SheetBorderTemplate extends Document {\r\n /** @internal */\r\n public static override get className(): string { return \"SheetBorderTemplate\"; }\r\n public height?: number;\r\n public width?: number;\r\n protected constructor(props: SheetBorderTemplateProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** The template for a [[Sheet]]\r\n * @public\r\n */\r\nexport class SheetTemplate extends Document {\r\n /** @internal */\r\n public static override get className(): string { return \"SheetTemplate\"; }\r\n public height?: number;\r\n public width?: number;\r\n public border?: Id64String;\r\n\r\n protected constructor(props: SheetTemplateProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (undefined !== this.border)\r\n referenceIds.addElement(this.border);\r\n }\r\n}\r\n\r\n/** A digital representation of a *sheet of paper*. Modeled by a [[SheetModel]].\r\n * @public\r\n */\r\nexport class Sheet extends Document {\r\n /** @internal */\r\n public static override get className(): string { return \"Sheet\"; }\r\n public height: number;\r\n public width: number;\r\n public scale?: number;\r\n public sheetTemplate?: Id64String;\r\n\r\n protected constructor(props: SheetProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.height = JsonUtils.asDouble(props.height);\r\n this.width = JsonUtils.asDouble(props.width);\r\n this.scale = props.scale;\r\n this.sheetTemplate = props.sheetTemplate ? Id64.fromJSON(props.sheetTemplate) : undefined;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (undefined !== this.sheetTemplate)\r\n referenceIds.addElement(this.sheetTemplate);\r\n }\r\n\r\n /** Create a Code for a Sheet given a name that is meant to be unique within the scope of the specified DocumentListModel.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the DocumentListModel that contains the Sheet and provides the scope for its name.\r\n * @param codeValue The Sheet name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.sheet);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** Information Record Element is an abstract base class for modeling information records. Information Record\r\n * Element is the default choice if no other subclass of Information Content Element makes sense.\r\n * @public\r\n */\r\nexport abstract class InformationRecordElement extends InformationContentElement {\r\n /** @internal */\r\n public static override get className(): string { return \"InformationRecordElement\"; }\r\n\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** A Definition Element holds configuration-related information that is meant to be referenced / shared.\r\n * @public\r\n */\r\nexport abstract class DefinitionElement extends InformationContentElement {\r\n /** @internal */\r\n public static override get className(): string { return \"DefinitionElement\"; }\r\n /** If true, don't show this DefinitionElement in user interface lists. */\r\n public isPrivate: boolean;\r\n\r\n protected constructor(props: DefinitionElementProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.isPrivate = true === props.isPrivate;\r\n }\r\n\r\n public override toJSON(): DefinitionElementProps {\r\n const val = super.toJSON() as DefinitionElementProps;\r\n val.isPrivate = this.isPrivate;\r\n return val;\r\n }\r\n}\r\n\r\n/** This abstract class unifies DefinitionGroup and DefinitionContainer for relationship endpoint purposes.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.10\r\n * @public\r\n */\r\nexport abstract class DefinitionSet extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"DefinitionSet\"; }\r\n}\r\n\r\n/** A DefinitionContainer exclusively owns a set of DefinitionElements contained within its sub-model (of type DefinitionModel).\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.10\r\n * @public\r\n */\r\nexport class DefinitionContainer extends DefinitionSet {\r\n /** @internal */\r\n public static override get className(): string { return \"DefinitionContainer\"; }\r\n /** Create a DefinitionContainer\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that will contain this DefinitionContainer element.\r\n * @param code The Code for this DefinitionContainer.\r\n * @param isPrivate The optional hint, that if `true` means it should not be displayed in the UI.\r\n * @returns The newly constructed DefinitionContainer\r\n * @note There is not a predefined CodeSpec for DefinitionContainer elements, so it is the responsibility of the domain or application to create one.\r\n * @throws [[IModelError]] if there is a problem creating the DefinitionContainer\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, code: Code, isPrivate?: boolean): DefinitionContainer {\r\n const elementProps: DefinitionElementProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code,\r\n isPrivate,\r\n };\r\n return new DefinitionContainer(elementProps, iModelDb);\r\n }\r\n /** Insert a DefinitionContainer and its sub-model.\r\n * @param iModelDb Insert into this IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that will contain this DefinitionContainer element.\r\n * @param code The Code for this DefinitionContainer.\r\n * @param isPrivate The optional hint, that if `true` means it should not be displayed in the UI.\r\n * @returns The Id of the newly inserted DefinitionContainer and its newly inserted sub-model (of type DefinitionModel).\r\n * @note There is not a predefined CodeSpec for DefinitionContainer elements, so it is the responsibility of the domain or application to create one.\r\n * @throws [[IModelError]] if there is a problem inserting the DefinitionContainer\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, code: Code, isPrivate?: boolean): Id64String {\r\n const containerElement = this.create(iModelDb, definitionModelId, code, isPrivate);\r\n const containerElementId = iModelDb.elements.insertElement(containerElement.toJSON());\r\n const containerSubModelProps: ModelProps = {\r\n classFullName: DefinitionModel.classFullName,\r\n modeledElement: { id: containerElementId },\r\n isPrivate,\r\n };\r\n iModelDb.models.insertModel(containerSubModelProps);\r\n return containerElementId;\r\n }\r\n}\r\n\r\n/** A non-exclusive set of DefinitionElements grouped using the DefinitionGroupGroupsDefinitions relationship.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.10\r\n * @public\r\n */\r\nexport class DefinitionGroup extends DefinitionSet {\r\n /** @internal */\r\n public static override get className(): string { return \"DefinitionGroup\"; }\r\n /** Create a DefinitionGroup\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that will contain this DefinitionGroup element.\r\n * @param code The Code for this DefinitionGroup\r\n * @param isPrivate The optional hint, that if `true` means it should not be displayed in the UI.\r\n * @returns The newly constructed DefinitionGroup\r\n * @note There is not a predefined CodeSpec for DefinitionGroup elements, so it is the responsibility of the domain or application to create one.\r\n * @throws [[IModelError]] if there is a problem creating the DefinitionGroup\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, code: Code, isPrivate?: boolean): DefinitionGroup {\r\n const elementProps: DefinitionElementProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code,\r\n isPrivate,\r\n };\r\n return new DefinitionGroup(elementProps, iModelDb);\r\n }\r\n}\r\n\r\n/** Defines a set of properties (the *type*) that may be associated with an element.\r\n * @public\r\n */\r\nexport abstract class TypeDefinitionElement extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"TypeDefinitionElement\"; }\r\n public recipe?: RelatedElement;\r\n\r\n protected constructor(props: TypeDefinitionElementProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (undefined !== this.recipe)\r\n referenceIds.addElement(this.recipe.id);\r\n }\r\n}\r\n\r\n/** Defines a recipe for generating instances from a definition.\r\n * @beta\r\n */\r\nexport abstract class RecipeDefinitionElement extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"RecipeDefinitionElement\"; }\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n}\r\n\r\n/** Defines a set of properties (the *type*) that can be associated with a Physical Element. A Physical\r\n * Type has a strong correlation with something that can be ordered from a catalog since all instances\r\n * share a common set of properties.\r\n * @public\r\n */\r\nexport abstract class PhysicalType extends TypeDefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"PhysicalType\"; }\r\n /** If defined, the [[PhysicalMaterial]] that makes up this PhysicalType. */\r\n public physicalMaterial?: RelatedElement;\r\n protected constructor(props: PhysicalTypeProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.physicalMaterial = RelatedElement.fromJSON(props.physicalMaterial);\r\n }\r\n\r\n public override toJSON(): PhysicalTypeProps {\r\n const val = super.toJSON() as PhysicalTypeProps;\r\n val.physicalMaterial = this.physicalMaterial?.toJSON();\r\n return val;\r\n }\r\n /** Create a Code for a PhysicalType element 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 PhysicalType element and provides the scope for its name.\r\n * @param codeValue The PhysicalType name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.physicalType);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** Defines a set of properties (the *type*) that can be associated with a spatial location.\r\n * @public\r\n */\r\nexport abstract class SpatialLocationType extends TypeDefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"SpatialLocationType\"; }\r\n protected constructor(props: TypeDefinitionElementProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /** Create a Code for a SpatialLocationType element 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 SpatialLocationType element and provides the scope for its name.\r\n * @param codeValue The SpatialLocationType name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.spatialLocationType);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A TemplateRecipe3d is a DefinitionElement that has a sub-model that contains the 3d template elements.\r\n * @beta\r\n */\r\nexport class TemplateRecipe3d extends RecipeDefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"TemplateRecipe3d\"; }\r\n\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /** Create a Code for a TemplateRecipe3d given a name that is meant to be unique within the scope of its Model.\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe3d element.\r\n * @param codeValue The name of the TemplateRecipe3d element.\r\n */\r\n public static createCode(iModelDb: IModelDb, definitionModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.templateRecipe3d);\r\n return new Code({ spec: codeSpec.id, scope: definitionModelId, value: codeValue });\r\n }\r\n\r\n /** Create a TemplateRecipe3d\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe3d element.\r\n * @param name The name (Code.value) of the TemplateRecipe3d\r\n * @returns The newly constructed TemplateRecipe3d\r\n * @throws [[IModelError]] if there is a problem creating the TemplateRecipe3d\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, isPrivate?: boolean): TemplateRecipe3d {\r\n const elementProps: DefinitionElementProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n isPrivate,\r\n };\r\n return new TemplateRecipe3d(elementProps, iModelDb);\r\n }\r\n /** Insert a TemplateRecipe3d and a PhysicalModel (sub-model) that will contain the 3d template elements.\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe3d element.\r\n * @param name The name (Code.value) of the TemplateRecipe3d\r\n * @returns The Id of the newly inserted TemplateRecipe3d and the PhysicalModel that sub-models it.\r\n * @throws [[IModelError]] if there is a problem inserting the TemplateRecipe3d or its sub-model.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, isPrivate?: boolean): Id64String {\r\n const element = this.create(iModelDb, definitionModelId, name, isPrivate);\r\n const modeledElementId: Id64String = iModelDb.elements.insertElement(element.toJSON());\r\n const modelProps: GeometricModel3dProps = {\r\n classFullName: PhysicalModel.classFullName,\r\n modeledElement: { id: modeledElementId },\r\n isTemplate: true,\r\n };\r\n return iModelDb.models.insertModel(modelProps); // will be the same value as modeledElementId\r\n }\r\n}\r\n\r\n/** Defines a set of properties (the *type*) that can be associated with a 2D Graphical Element.\r\n * @public\r\n */\r\nexport abstract class GraphicalType2d extends TypeDefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"GraphicalType2d\"; }\r\n\r\n protected constructor(props: TypeDefinitionElementProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /** Create a Code for a GraphicalType2d element 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 GraphicalType2d element and provides the scope for its name.\r\n * @param codeValue The GraphicalType2d name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.graphicalType2d);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A recipe that uses a 2D template for creating new instances.\r\n * @beta\r\n */\r\nexport class TemplateRecipe2d extends RecipeDefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"TemplateRecipe2d\"; }\r\n protected constructor(props: ElementProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /** Create a Code for a TemplateRecipe2d given a name that is meant to be unique within the scope of its Model.\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe2d element.\r\n * @param codeValue The name of the TemplateRecipe2d element.\r\n */\r\n public static createCode(iModelDb: IModelDb, definitionModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.templateRecipe2d);\r\n return new Code({ spec: codeSpec.id, scope: definitionModelId, value: codeValue });\r\n }\r\n\r\n /** Create a TemplateRecipe2d\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe2d element.\r\n * @param name The name (Code.value) of the TemplateRecipe2d\r\n * @returns The newly constructed TemplateRecipe2d\r\n * @throws [[IModelError]] if there is a problem creating the TemplateRecipe2d\r\n */\r\n public static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string, isPrivate?: boolean): TemplateRecipe2d {\r\n const elementProps: DefinitionElementProps = {\r\n classFullName: this.classFullName,\r\n model: definitionModelId,\r\n code: this.createCode(iModelDb, definitionModelId, name),\r\n isPrivate,\r\n };\r\n return new TemplateRecipe2d(elementProps, iModelDb);\r\n }\r\n /** Insert a TemplateRecipe2d and a DrawingModel (sub-model) that will contain the 2d template elements.\r\n * @param iModelDb The IModelDb\r\n * @param definitionModelId The Id of the [DefinitionModel]($backend) that contains this TemplateRecipe2d element.\r\n * @param name The name (Code.value) of the TemplateRecipe2d\r\n * @returns The Id of the newly inserted TemplateRecipe2d and the PhysicalModel that sub-models it.\r\n * @throws [[IModelError]] if there is a problem inserting the TemplateRecipe2d or its sub-model.\r\n */\r\n public static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, isPrivate?: boolean): Id64String {\r\n const element = this.create(iModelDb, definitionModelId, name, isPrivate);\r\n const modeledElementId: Id64String = iModelDb.elements.insertElement(element.toJSON());\r\n const modelProps: GeometricModel2dProps = {\r\n classFullName: DrawingModel.classFullName,\r\n modeledElement: { id: modeledElementId },\r\n isTemplate: true,\r\n };\r\n return iModelDb.models.insertModel(modelProps); // will be the same value as modeledElementId\r\n }\r\n}\r\n\r\n/** An abstract base class for elements that establishes a particular modeling perspective for its parent Subject.\r\n * Instances are always sub-modeled by a specialization of Model of the appropriate modeling perspective.\r\n * @see [iModel Information Hierarchy]($docs/bis/guide/data-organization/top-of-the-world), [[Subject]], [[Model]]\r\n * @public\r\n */\r\nexport abstract class InformationPartitionElement extends InformationContentElement {\r\n /** @internal */\r\n public static override get className(): string { return \"InformationPartitionElement\"; }\r\n /** A human-readable string describing the intent of the partition. */\r\n public description?: string;\r\n\r\n protected constructor(props: InformationPartitionElementProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n public override toJSON(): InformationPartitionElementProps { // This override only specializes the return type\r\n return super.toJSON() as InformationPartitionElementProps; // Entity.toJSON takes care of auto-handled properties\r\n }\r\n /** Create a code that can be used for any subclass of InformationPartitionElement.\r\n * @param iModelDb The IModelDb\r\n * @param parentSubjectId The Id of the parent Subject that provides the scope for names of its child InformationPartitionElements.\r\n * @param codeValue The InformationPartitionElement name\r\n */\r\n public static createCode(iModel: IModelDb, parentSubjectId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.informationPartitionElement);\r\n return new Code({ spec: codeSpec.id, scope: parentSubjectId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A DefinitionPartition element establishes a *Definition* modeling perspective for its parent Subject.\r\n * A DefinitionPartition is always sub-modeled by a DefinitionModel.\r\n * @see [[DefinitionModel]]\r\n * @public\r\n */\r\nexport class DefinitionPartition extends InformationPartitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"DefinitionPartition\"; }\r\n}\r\n\r\n/** A DocumentPartition element establishes a *Document* modeling perspective for its parent Subject.\r\n * A DocumentPartition is always sub-modeled by a DocumentListModel.\r\n * @see [[DocumentListModel]]\r\n * @public\r\n */\r\nexport class DocumentPartition extends InformationPartitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"DocumentPartition\"; }\r\n}\r\n\r\n/** A GroupInformationPartition element establishes a *Group Information* modeling perspective for its parent Subject.\r\n * A GroupInformationPartition is always sub-modeled by a GroupInformationModel.\r\n * @see [[GroupInformationModel]]\r\n * @public\r\n */\r\nexport class GroupInformationPartition extends InformationPartitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"GroupInformationPartition\"; }\r\n}\r\n\r\n/** A GraphicalPartition3d element establishes a *3D Graphical* modeling perspective for its parent Subject.\r\n * A GraphicalPartition3d is always sub-modeled by a GraphicalModel3d.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.8\r\n * @see [[GraphicalModel3d]]\r\n * @public\r\n */\r\nexport class GraphicalPartition3d extends InformationPartitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"GraphicalPartition3d\"; }\r\n}\r\n\r\n/** An InformationRecordPartition element establishes a *Information Record* modeling perspective for its parent Subject.\r\n * A InformationRecordPartition is always sub-modeled by an InformationRecordModel.\r\n * @see [[InformationRecordModel]]\r\n * @public\r\n */\r\nexport class InformationRecordPartition extends InformationPartitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"InformationRecordPartition\"; }\r\n}\r\n\r\n/** A LinkPartition element establishes a *Link* modeling perspective for its parent Subject. A LinkPartition is always sub-modeled by a LinkModel.\r\n * @see [[LinkModel]]\r\n * @public\r\n */\r\nexport class LinkPartition extends InformationPartitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"LinkPartition\"; }\r\n}\r\n\r\n/** A PhysicalPartition element establishes a *Physical* modeling perspective for its parent Subject. A PhysicalPartition is always sub-modeled by a PhysicalModel.\r\n * @see [[PhysicalModel]]\r\n * @public\r\n */\r\nexport class PhysicalPartition extends InformationPartitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"PhysicalPartition\"; }\r\n}\r\n\r\n/** A SpatialLocationPartition element establishes a *SpatialLocation* modeling perspective for its parent Subject.\r\n * A SpatialLocationPartition is always sub-modeled by a SpatialLocationModel.\r\n * @see [[SpatialLocationModel]]\r\n * @public\r\n */\r\nexport class SpatialLocationPartition extends InformationPartitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"SpatialLocationPartition\"; }\r\n}\r\n\r\n/** Group Information is an abstract base class for modeling entities whose main purpose is to reference a group of related elements.\r\n * @public\r\n */\r\nexport abstract class GroupInformationElement extends InformationReferenceElement {\r\n /** @internal */\r\n public static override get className(): string { return \"GroupInformationElement\"; }\r\n}\r\n\r\n/** An information element that specifies a link.\r\n * @public\r\n */\r\nexport abstract class LinkElement extends InformationReferenceElement {\r\n /** @internal */\r\n public static override get className(): string { return \"LinkElement\"; }\r\n /** Create a Code for a LinkElement given a name that is meant to be unique within the scope of the specified Model.\r\n * @param iModel The IModelDb\r\n * @param scopeModelId The Id of the Model that contains the LinkElement and provides the scope for its name.\r\n * @param codeValue The LinkElement name\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.linkElement);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** An information element that specifies a URL link.\r\n * @public\r\n */\r\nexport class UrlLink extends LinkElement {\r\n /** @internal */\r\n public static override get className(): string { return \"UrlLink\"; }\r\n public description?: string;\r\n public url?: string;\r\n\r\n protected constructor(props: UrlLinkProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.description = props.description;\r\n this.url = props.url;\r\n }\r\n\r\n public override toJSON(): UrlLinkProps {\r\n const val = super.toJSON() as UrlLinkProps;\r\n val.description = this.description;\r\n val.url = this.url;\r\n return val;\r\n }\r\n}\r\n\r\n/** Represents a folder-like structure that organizes repositories (typically files) in an external system.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @alpha\r\n */\r\nexport class FolderLink extends UrlLink {\r\n /** @internal */\r\n public static override get className(): string { return \"FolderLink\"; }\r\n}\r\n\r\n/** An information element that links to a repository.\r\n * @public\r\n */\r\nexport class RepositoryLink extends UrlLink {\r\n /** @internal */\r\n public static override get className(): string { return \"RepositoryLink\"; }\r\n public repositoryGuid?: GuidString;\r\n /** @note This property was added to the BisCore schema in version 1.0.13 */\r\n public format?: string;\r\n\r\n protected constructor(props: RepositoryLinkProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.repositoryGuid = props.repositoryGuid;\r\n this.format = props.format;\r\n }\r\n\r\n public override toJSON(): RepositoryLinkProps {\r\n const val = super.toJSON() as RepositoryLinkProps;\r\n val.repositoryGuid = this.repositoryGuid;\r\n val.format = this.format;\r\n return val;\r\n }\r\n}\r\n\r\n/** An information element that links to an embedded file.\r\n * @public\r\n */\r\nexport class EmbeddedFileLink extends LinkElement {\r\n /** @internal */\r\n public static override get className(): string { return \"EmbeddedFileLink\"; }\r\n}\r\n\r\n/** A real world entity is modeled as a Role Element when a set of external circumstances define an important\r\n * role (one that is worth tracking) that is not intrinsic to the entity playing the role. For example,\r\n * a person can play the role of a teacher or a rock can play the role of a boundary marker.\r\n * @public\r\n */\r\nexport abstract class RoleElement extends Element {\r\n /** @internal */\r\n public static override get className(): string { return \"RoleElement\"; }\r\n}\r\n\r\n/** A Definition Element that specifies a collection of geometry that is meant to be reused across Geometric\r\n * Element instances. Leveraging Geometry Parts can help reduce file size and improve display performance.\r\n * @public\r\n */\r\nexport class GeometryPart extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"GeometryPart\"; }\r\n public geom?: GeometryStreamProps;\r\n /** How to build the part's GeometryStream. This is used for insert and update only. It is not a persistent property. It will be undefined in the properties returned by functions that read a persistent element. It may be specified as an alternative to `geom` when inserting or updating an element.\r\n * @beta\r\n */\r\n public elementGeometryBuilderParams?: ElementGeometryBuilderParamsForPart;\r\n public bbox: ElementAlignedBox3d;\r\n\r\n protected constructor(props: GeometryPartProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.geom = props.geom;\r\n this.bbox = Range3d.fromJSON(props.bbox);\r\n }\r\n\r\n public override toJSON(): GeometryPartProps {\r\n const val = super.toJSON() as GeometryPartProps;\r\n val.geom = this.geom;\r\n val.bbox = this.bbox;\r\n return val;\r\n }\r\n\r\n /** Create a Code for a GeometryPart element 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 GeometryPart element and provides the scope for its name.\r\n * @param codeValue The GeometryPart name\r\n * @note GeometryPart elements are not required to be named (have a non-empty Code).\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.geometryPart);\r\n return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** The definition element for a line style\r\n * @public\r\n */\r\nexport class LineStyle extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"LineStyle\"; }\r\n public description?: string;\r\n public data!: string;\r\n\r\n protected constructor(props: LineStyleProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /** Create a Code for a LineStyle definition given a name that is meant to be unique within the scope of the specified model.\r\n * @param iModel The IModel\r\n * @param scopeModelId The Id of the DefinitionModel that contains the LineStyle and provides the scope for its name.\r\n * @param codeValue The name of the LineStyle\r\n * @returns A LineStyle Code\r\n */\r\n public static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code {\r\n return new Code({ spec: iModel.codeSpecs.getByName(BisCodeSpec.lineStyle).id, scope: scopeModelId, value: codeValue });\r\n }\r\n}\r\n\r\n/** Describes how to animate a view of a [[GeometricModel]] to show change over time using a [RenderSchedule.Script]($common).\r\n * @note This class was introduced in version 01.00.13 of the BisCore ECSchema. It should only be used with [[IModelDb]]s containing that version or newer.\r\n * @public\r\n */\r\nexport class RenderTimeline extends InformationRecordElement {\r\n /** @internal */\r\n public static override get className(): string { return \"RenderTimeline\"; }\r\n /** A human-readable description of the timeline, which may be an empty string. */\r\n public description: string;\r\n /** The JSON representation of the instructions for visualizing change over time.\r\n * @see [RenderSchedule.Script]($common) for the API for working with the script.\r\n */\r\n public scriptProps: RenderSchedule.ScriptProps;\r\n\r\n protected constructor(props: RenderTimelineProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.description = props.description ?? \"\";\r\n this.scriptProps = RenderTimeline.parseScriptProps(props.script);\r\n }\r\n\r\n public static fromJSON(props: RenderTimelineProps, iModel: IModelDb): RenderTimeline {\r\n return new RenderTimeline(props, iModel);\r\n }\r\n\r\n public override toJSON(): RenderTimelineProps {\r\n const props = super.toJSON() as RenderTimelineProps;\r\n if (this.description.length > 0)\r\n props.description = this.description;\r\n\r\n props.script = JSON.stringify(this.scriptProps);\r\n return props;\r\n }\r\n\r\n private static parseScriptProps(json: string): RenderSchedule.ScriptProps {\r\n try {\r\n return JSON.parse(json);\r\n } catch {\r\n return [];\r\n }\r\n }\r\n\r\n protected override collectReferenceIds(ids: EntityReferenceSet): void {\r\n super.collectReferenceIds(ids);\r\n const script = RenderSchedule.Script.fromJSON(this.scriptProps);\r\n script?.discloseIds(ids); // eslint-disable-line deprecation/deprecation\r\n }\r\n\r\n /** @alpha */\r\n protected static override onCloned(context: IModelElementCloneContext, sourceProps: RenderTimelineProps, targetProps: RenderTimelineProps): void {\r\n super.onCloned(context, sourceProps, targetProps);\r\n if (context.isBetweenIModels)\r\n targetProps.script = JSON.stringify(this.remapScript(context, this.parseScriptProps(targetProps.script)));\r\n }\r\n\r\n /** Remap Ids when cloning a RenderSchedule.Script between iModels on a DisplayStyle or RenderTimeline.\r\n * @internal\r\n */\r\n public static remapScript(context: IModelElementCloneContext, input: RenderSchedule.ScriptProps): RenderSchedule.ScriptProps {\r\n const scriptProps: RenderSchedule.ScriptProps = [];\r\n if (!Array.isArray(input))\r\n return scriptProps;\r\n\r\n const elementIds = new OrderedId64Array();\r\n for (const model of input) {\r\n const modelId = context.findTargetElementId(model.modelId);\r\n if (!Id64.isValid(modelId))\r\n continue;\r\n\r\n model.modelId = modelId;\r\n scriptProps.push(model);\r\n for (const element of model.elementTimelines) {\r\n elementIds.clear();\r\n for (const sourceId of RenderSchedule.ElementTimeline.getElementIds(element.elementIds)) {\r\n const targetId = context.findTargetElementId(sourceId);\r\n if (Id64.isValid(targetId))\r\n elementIds.insert(targetId);\r\n }\r\n\r\n element.elementIds = CompressedId64Set.compressIds(elementIds);\r\n }\r\n }\r\n\r\n return scriptProps;\r\n }\r\n}\r\n"]}
@@ -5,7 +5,7 @@ import { Id64String } from "@itwin/core-bentley";
5
5
  import { EntityProps, EntityReferenceSet, PropertyCallback } from "@itwin/core-common";
6
6
  import type { IModelDb } from "./IModelDb";
7
7
  import { Schema } from "./Schema";
8
- /** Represents an entity in an [[IModelDb]] such as an [[Element]], [[Model]], or [[Relationship]].
8
+ /** Represents one of the fundamental building block in an [[IModelDb]]: as an [[Element]], [[Model]], or [[Relationship]].
9
9
  * Every subclass of Entity represents one BIS [ECClass]($ecschema-metadata).
10
10
  * An Entity is typically instantiated from an [EntityProps]($common) and can be converted back to this representation via [[Entity.toJSON]].
11
11
  * @public
package/lib/cjs/Entity.js CHANGED
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.Entity = void 0;
11
11
  const core_bentley_1 = require("@itwin/core-bentley");
12
12
  const core_common_1 = require("@itwin/core-common");
13
- /** Represents an entity in an [[IModelDb]] such as an [[Element]], [[Model]], or [[Relationship]].
13
+ /** Represents one of the fundamental building block in an [[IModelDb]]: as an [[Element]], [[Model]], or [[Relationship]].
14
14
  * Every subclass of Entity represents one BIS [ECClass]($ecschema-metadata).
15
15
  * An Entity is typically instantiated from an [EntityProps]($common) and can be converted back to this representation via [[Entity.toJSON]].
16
16
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"Entity.js","sourceRoot":"","sources":["../../src/Entity.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAuD;AACvD,oDAAyG;AAIzG;;;;GAIG;AACH,MAAa,MAAM;IAQjB,IAAY,KAAK,KAAoB,OAAO,IAAI,CAAC,WAA4B,CAAC,CAAC,CAAC;IAEhF;;;;OAIG;IACI,MAAM,KAAK,SAAS,KAAa,OAAO,QAAQ,CAAC,CAAC,CAAC;IAE1D;;;OAGG;IACH,IAAW,KAAK,KAAU,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AAE,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAI,IAAY,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC;QAC3F,OAAO,GAAG,CAAC;IACb,CAAC;IAED;;;;OAIG;IACI,eAAe,CAAC,IAAsB,EAAE,gBAAyB,IAAI;QAC1E,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;IAC7E,CAAC;IAED,4EAA4E;IACrE,MAAM,KAAK,aAAa,KAAa,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAEnG,6EAA6E;IAC7E,IAAW,aAAa,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;IAEvE,gBAAgB;IACT,MAAM,KAAK,mBAAmB,KAAe,OAAO,EAAE,CAAC,CAAC,CAAC;IAEhE;;;;;OAKG;IACI,MAAM,CAAC,EAAE,CAAC,UAAyB;QACxC,6EAA6E;QAC7E,OAAO,IAAI,KAAK,UAAU,IAAI,IAAI,CAAC,SAAS,YAAY,UAAU,CAAC;IACrE,CAAC;IAED;;;OAGG;IACI,MAAM,KAAK,gBAAgB,KAAK,OAAO,KAAK,CAAC,CAAC,CAAC;IAEtD;;;;;OAKG;IACI,eAAe;QACpB,MAAM,YAAY,GAAG,IAAI,gCAAkB,EAAE,CAAC;QAC9C,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACvC,OAAO,YAAY,CAAC;IACtB,CAAC;IASD;;;;;;;OAOG;IACO,mBAAmB,CAAC,aAAiC;QAC7D,OAAO,CAAC,2BAA2B;IACrC,CAAC;CAQF;AArID,wBAqIC","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 Schema\r\n */\r\n\r\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { EntityProps, EntityReferenceSet, PropertyCallback, PropertyMetaData } from \"@itwin/core-common\";\r\nimport type { IModelDb } from \"./IModelDb\";\r\nimport { Schema } from \"./Schema\";\r\n\r\n/** Represents an entity in an [[IModelDb]] such as an [[Element]], [[Model]], or [[Relationship]].\r\n * Every subclass of Entity represents one BIS [ECClass]($ecschema-metadata).\r\n * An Entity is typically instantiated from an [EntityProps]($common) and can be converted back to this representation via [[Entity.toJSON]].\r\n * @public\r\n */\r\nexport class Entity {\r\n /** An immutable property used to discriminate between [[Entity]] and [EntityProps]($common), used to inform the TypeScript compiler that these two types\r\n * are never substitutable for one another. To obtain an EntityProps from an Entity, use [[Entity.toJSON]].\r\n */\r\n public readonly isInstanceOfEntity = true as const;\r\n /** The Schema that defines this class. */\r\n public static schema: typeof Schema;\r\n\r\n private get _ctor(): typeof Entity { return this.constructor as typeof Entity; }\r\n\r\n /** The name of the BIS class associated with this class.\r\n * @note Every subclass of Entity **MUST** override this method to identify its BIS class.\r\n * Failure to do so will ordinarily result in an error when the class is registered, since there may only\r\n * be one JavaScript class for a given BIS class (usually the errant class will collide with its superclass.)\r\n */\r\n public static get className(): string { return \"Entity\"; }\r\n\r\n /** When working with an Entity it can be useful to set property values directly, bypassing the compiler's type checking.\r\n * This property makes such code slightly less tedious to read and write.\r\n * @internal\r\n */\r\n public get asAny(): any { return this; }\r\n\r\n /** The name of the BIS Schema that defines this class */\r\n public get schemaName(): string { return this._ctor.schema.schemaName; }\r\n\r\n /** The name of the BIS class associated with this class. */\r\n public get className(): string { return this._ctor.className; }\r\n\r\n /** The [[IModelDb]] that contains this Entity */\r\n public iModel: IModelDb;\r\n\r\n /** The Id of this Entity. May be invalid if the Entity has not yet been saved in the database. */\r\n public id: Id64String;\r\n\r\n protected constructor(props: EntityProps, iModel: IModelDb) {\r\n this.iModel = iModel;\r\n this.id = Id64.fromJSON(props.id);\r\n // copy all auto-handled properties from input to the object being constructed\r\n this.forEachProperty((propName: string, meta: PropertyMetaData) => (this as any)[propName] = meta.createProperty((props as any)[propName]), false);\r\n }\r\n\r\n /** Invoke the constructor of the specified `Entity` subclass.\r\n * @internal\r\n */\r\n public static instantiate(subclass: typeof Entity, props: EntityProps, iModel: IModelDb): Entity {\r\n return new subclass(props, iModel);\r\n }\r\n\r\n /** Obtain the JSON representation of this Entity. Subclasses of [[Entity]] typically override this method to return their corresponding sub-type of [EntityProps]($common) -\r\n * for example, [[GeometricElement.toJSON]] returns a [GeometricElementProps]($common).\r\n */\r\n public toJSON(): EntityProps {\r\n const val: any = {};\r\n val.classFullName = this.classFullName;\r\n if (Id64.isValid(this.id))\r\n val.id = this.id;\r\n this.forEachProperty((propName: string) => val[propName] = (this as any)[propName], false);\r\n return val;\r\n }\r\n\r\n /** Call a function for each property of this Entity.\r\n * @param func The callback to be invoked on each property\r\n * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.\r\n * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.\r\n */\r\n public forEachProperty(func: PropertyCallback, includeCustom: boolean = true) {\r\n this.iModel.forEachMetaData(this.classFullName, true, func, includeCustom);\r\n }\r\n\r\n /** Get the full BIS class name of this Entity in the form \"schema:class\" */\r\n public static get classFullName(): string { return `${this.schema.schemaName}:${this.className}`; }\r\n\r\n /** Get the full BIS class name of this Entity in the form \"schema:class\". */\r\n public get classFullName(): string { return this._ctor.classFullName; }\r\n\r\n /** @internal */\r\n public static get protectedOperations(): string[] { return []; }\r\n\r\n /** return whether this Entity class is a subclass of another Entity class\r\n * @note the subclass-ness is checked according to JavaScript inheritance, to check the underlying raw EC class's\r\n * inheritance, you can use [ECClass.is]($ecschema-metadata)\r\n * @note this should have a type of `is<T extends typeof Entity>(otherClass: T): this is T` but can't because of\r\n * typescript's restriction on the `this` type in static methods\r\n */\r\n public static is(otherClass: typeof Entity): boolean {\r\n // inline of @itwin/core-bentley's isSubclassOf due to protected constructor.\r\n return this === otherClass || this.prototype instanceof otherClass;\r\n }\r\n\r\n /** whether this JavaScript class was generated for this ECClass because there was no registered custom implementation\r\n * ClassRegistry overrides this when generating a class\r\n * @internal\r\n */\r\n public static get isGeneratedClass() { return false; }\r\n\r\n /** Get the set of this entity's *entity references*, [EntityReferenceSet]($backend). An *entity reference* is any id\r\n * stored on the entity, in its EC properties or json fields.\r\n * This is important for cloning operations but can be useful in other situations as well.\r\n * @see this.collectReferenceIds\r\n * @beta\r\n */\r\n public getReferenceIds(): EntityReferenceSet {\r\n const referenceIds = new EntityReferenceSet();\r\n this.collectReferenceIds(referenceIds);\r\n return referenceIds;\r\n }\r\n\r\n /** kept rename for older transformer versions\r\n * @deprecated in 3.x . Use [[getReferenceIds]] instead\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n public getReferenceConcreteIds = this.getReferenceIds;\r\n\r\n /** Collect the Ids of this entity's *references* at this level of the class hierarchy.\r\n * A *reference* is any entity referenced by this entity's EC Data, including json fields.\r\n * This is important for cloning operations but can be useful in other situations as well.\r\n * @param _referenceIds The Id64Set to populate with reference Ids.\r\n * @note This should be overridden (with `super` called) at each level the class hierarchy that introduces references.\r\n * @see getReferenceIds\r\n * @beta\r\n */\r\n protected collectReferenceIds(_referenceIds: EntityReferenceSet): void {\r\n return; // no references by default\r\n }\r\n\r\n /** kept rename for older transformer versions\r\n * @deprecated in 3.x . Use [[collectReferenceIds]] instead\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n protected collectReferenceConcreteIds = this.collectReferenceIds;\r\n}\r\n\r\n/** Parameter type that can accept both abstract constructor types and non-abstract constructor types for `instanceof` to test.\r\n * @public\r\n */\r\nexport type EntityClassType<T> = Function & { prototype: T };\r\n"]}
1
+ {"version":3,"file":"Entity.js","sourceRoot":"","sources":["../../src/Entity.ts"],"names":[],"mappings":";AAAA;;;+FAG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AAC,CAAC;QACvC,OAAO,YAAY,CAAC;IACtB,CAAC;IASD;;;;;;;OAOG;IACO,mBAAmB,CAAC,aAAiC;QAC7D,OAAO,CAAC,2BAA2B;IACrC,CAAC;CAQF;AArID,wBAqIC","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 Schema\r\n */\r\n\r\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { EntityProps, EntityReferenceSet, PropertyCallback, PropertyMetaData } from \"@itwin/core-common\";\r\nimport type { IModelDb } from \"./IModelDb\";\r\nimport { Schema } from \"./Schema\";\r\n\r\n/** Represents one of the fundamental building block in an [[IModelDb]]: as an [[Element]], [[Model]], or [[Relationship]].\r\n * Every subclass of Entity represents one BIS [ECClass]($ecschema-metadata).\r\n * An Entity is typically instantiated from an [EntityProps]($common) and can be converted back to this representation via [[Entity.toJSON]].\r\n * @public\r\n */\r\nexport class Entity {\r\n /** An immutable property used to discriminate between [[Entity]] and [EntityProps]($common), used to inform the TypeScript compiler that these two types\r\n * are never substitutable for one another. To obtain an EntityProps from an Entity, use [[Entity.toJSON]].\r\n */\r\n public readonly isInstanceOfEntity = true as const;\r\n /** The Schema that defines this class. */\r\n public static schema: typeof Schema;\r\n\r\n private get _ctor(): typeof Entity { return this.constructor as typeof Entity; }\r\n\r\n /** The name of the BIS class associated with this class.\r\n * @note Every subclass of Entity **MUST** override this method to identify its BIS class.\r\n * Failure to do so will ordinarily result in an error when the class is registered, since there may only\r\n * be one JavaScript class for a given BIS class (usually the errant class will collide with its superclass.)\r\n */\r\n public static get className(): string { return \"Entity\"; }\r\n\r\n /** When working with an Entity it can be useful to set property values directly, bypassing the compiler's type checking.\r\n * This property makes such code slightly less tedious to read and write.\r\n * @internal\r\n */\r\n public get asAny(): any { return this; }\r\n\r\n /** The name of the BIS Schema that defines this class */\r\n public get schemaName(): string { return this._ctor.schema.schemaName; }\r\n\r\n /** The name of the BIS class associated with this class. */\r\n public get className(): string { return this._ctor.className; }\r\n\r\n /** The [[IModelDb]] that contains this Entity */\r\n public iModel: IModelDb;\r\n\r\n /** The Id of this Entity. May be invalid if the Entity has not yet been saved in the database. */\r\n public id: Id64String;\r\n\r\n protected constructor(props: EntityProps, iModel: IModelDb) {\r\n this.iModel = iModel;\r\n this.id = Id64.fromJSON(props.id);\r\n // copy all auto-handled properties from input to the object being constructed\r\n this.forEachProperty((propName: string, meta: PropertyMetaData) => (this as any)[propName] = meta.createProperty((props as any)[propName]), false);\r\n }\r\n\r\n /** Invoke the constructor of the specified `Entity` subclass.\r\n * @internal\r\n */\r\n public static instantiate(subclass: typeof Entity, props: EntityProps, iModel: IModelDb): Entity {\r\n return new subclass(props, iModel);\r\n }\r\n\r\n /** Obtain the JSON representation of this Entity. Subclasses of [[Entity]] typically override this method to return their corresponding sub-type of [EntityProps]($common) -\r\n * for example, [[GeometricElement.toJSON]] returns a [GeometricElementProps]($common).\r\n */\r\n public toJSON(): EntityProps {\r\n const val: any = {};\r\n val.classFullName = this.classFullName;\r\n if (Id64.isValid(this.id))\r\n val.id = this.id;\r\n this.forEachProperty((propName: string) => val[propName] = (this as any)[propName], false);\r\n return val;\r\n }\r\n\r\n /** Call a function for each property of this Entity.\r\n * @param func The callback to be invoked on each property\r\n * @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.\r\n * @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.\r\n */\r\n public forEachProperty(func: PropertyCallback, includeCustom: boolean = true) {\r\n this.iModel.forEachMetaData(this.classFullName, true, func, includeCustom);\r\n }\r\n\r\n /** Get the full BIS class name of this Entity in the form \"schema:class\" */\r\n public static get classFullName(): string { return `${this.schema.schemaName}:${this.className}`; }\r\n\r\n /** Get the full BIS class name of this Entity in the form \"schema:class\". */\r\n public get classFullName(): string { return this._ctor.classFullName; }\r\n\r\n /** @internal */\r\n public static get protectedOperations(): string[] { return []; }\r\n\r\n /** return whether this Entity class is a subclass of another Entity class\r\n * @note the subclass-ness is checked according to JavaScript inheritance, to check the underlying raw EC class's\r\n * inheritance, you can use [ECClass.is]($ecschema-metadata)\r\n * @note this should have a type of `is<T extends typeof Entity>(otherClass: T): this is T` but can't because of\r\n * typescript's restriction on the `this` type in static methods\r\n */\r\n public static is(otherClass: typeof Entity): boolean {\r\n // inline of @itwin/core-bentley's isSubclassOf due to protected constructor.\r\n return this === otherClass || this.prototype instanceof otherClass;\r\n }\r\n\r\n /** whether this JavaScript class was generated for this ECClass because there was no registered custom implementation\r\n * ClassRegistry overrides this when generating a class\r\n * @internal\r\n */\r\n public static get isGeneratedClass() { return false; }\r\n\r\n /** Get the set of this entity's *entity references*, [EntityReferenceSet]($backend). An *entity reference* is any id\r\n * stored on the entity, in its EC properties or json fields.\r\n * This is important for cloning operations but can be useful in other situations as well.\r\n * @see this.collectReferenceIds\r\n * @beta\r\n */\r\n public getReferenceIds(): EntityReferenceSet {\r\n const referenceIds = new EntityReferenceSet();\r\n this.collectReferenceIds(referenceIds);\r\n return referenceIds;\r\n }\r\n\r\n /** kept rename for older transformer versions\r\n * @deprecated in 3.x . Use [[getReferenceIds]] instead\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n public getReferenceConcreteIds = this.getReferenceIds;\r\n\r\n /** Collect the Ids of this entity's *references* at this level of the class hierarchy.\r\n * A *reference* is any entity referenced by this entity's EC Data, including json fields.\r\n * This is important for cloning operations but can be useful in other situations as well.\r\n * @param _referenceIds The Id64Set to populate with reference Ids.\r\n * @note This should be overridden (with `super` called) at each level the class hierarchy that introduces references.\r\n * @see getReferenceIds\r\n * @beta\r\n */\r\n protected collectReferenceIds(_referenceIds: EntityReferenceSet): void {\r\n return; // no references by default\r\n }\r\n\r\n /** kept rename for older transformer versions\r\n * @deprecated in 3.x . Use [[collectReferenceIds]] instead\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/unbound-method\r\n protected collectReferenceConcreteIds = this.collectReferenceIds;\r\n}\r\n\r\n/** Parameter type that can accept both abstract constructor types and non-abstract constructor types for `instanceof` to test.\r\n * @public\r\n */\r\nexport type EntityClassType<T> = Function & { prototype: T };\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/core-backend",
3
- "version": "4.6.0-dev.7",
3
+ "version": "4.6.0-dev.9",
4
4
  "description": "iTwin.js backend components",
5
5
  "main": "lib/cjs/core-backend.js",
6
6
  "typings": "lib/cjs/core-backend",
@@ -25,9 +25,9 @@
25
25
  "url": "http://www.bentley.com"
26
26
  },
27
27
  "peerDependencies": {
28
- "@itwin/core-bentley": "^4.6.0-dev.7",
29
- "@itwin/core-common": "^4.6.0-dev.7",
30
- "@itwin/core-geometry": "^4.6.0-dev.7",
28
+ "@itwin/core-bentley": "^4.6.0-dev.9",
29
+ "@itwin/core-common": "^4.6.0-dev.9",
30
+ "@itwin/core-geometry": "^4.6.0-dev.9",
31
31
  "@opentelemetry/api": "^1.0.4"
32
32
  },
33
33
  "peerDependenciesMeta": {
@@ -69,12 +69,12 @@
69
69
  "ts-node": "^10.8.2",
70
70
  "typescript": "~5.0.2",
71
71
  "webpack": "^5.76.0",
72
- "@itwin/core-bentley": "4.6.0-dev.7",
73
- "@itwin/core-common": "4.6.0-dev.7",
74
- "@itwin/build-tools": "4.6.0-dev.7",
75
- "@itwin/core-geometry": "4.6.0-dev.7",
76
- "@itwin/ecsql-common": "4.6.0-dev.7",
77
- "@itwin/core-webpack-tools": "4.6.0-dev.7",
72
+ "@itwin/build-tools": "4.6.0-dev.9",
73
+ "@itwin/core-bentley": "4.6.0-dev.9",
74
+ "@itwin/core-geometry": "4.6.0-dev.9",
75
+ "@itwin/core-common": "4.6.0-dev.9",
76
+ "@itwin/core-webpack-tools": "4.6.0-dev.9",
77
+ "@itwin/ecsql-common": "4.6.0-dev.9",
78
78
  "internal-tools": "3.0.0-dev.69"
79
79
  },
80
80
  "dependencies": {
@@ -91,7 +91,7 @@
91
91
  "semver": "^7.3.5",
92
92
  "touch": "^3.1.0",
93
93
  "ws": "^7.5.3",
94
- "@itwin/core-telemetry": "4.6.0-dev.7"
94
+ "@itwin/core-telemetry": "4.6.0-dev.9"
95
95
  },
96
96
  "nyc": {
97
97
  "extends": "./node_modules/@itwin/build-tools/.nycrc"