@itwin/core-backend 4.1.0-dev.8 → 4.1.0-dev.81

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.
Files changed (134) hide show
  1. package/CHANGELOG.md +99 -1
  2. package/lib/cjs/BackendHubAccess.js.map +1 -1
  3. package/lib/cjs/BlobContainerService.d.ts +38 -28
  4. package/lib/cjs/BlobContainerService.d.ts.map +1 -1
  5. package/lib/cjs/BlobContainerService.js.map +1 -1
  6. package/lib/cjs/BriefcaseManager.d.ts +8 -5
  7. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  8. package/lib/cjs/BriefcaseManager.js +9 -16
  9. package/lib/cjs/BriefcaseManager.js.map +1 -1
  10. package/lib/cjs/Category.d.ts +4 -16
  11. package/lib/cjs/Category.d.ts.map +1 -1
  12. package/lib/cjs/Category.js +0 -12
  13. package/lib/cjs/Category.js.map +1 -1
  14. package/lib/cjs/ChannelControl.d.ts +5 -1
  15. package/lib/cjs/ChannelControl.d.ts.map +1 -1
  16. package/lib/cjs/ChannelControl.js +10 -5
  17. package/lib/cjs/ChannelControl.js.map +1 -1
  18. package/lib/cjs/CheckpointManager.d.ts.map +1 -1
  19. package/lib/cjs/CheckpointManager.js +20 -9
  20. package/lib/cjs/CheckpointManager.js.map +1 -1
  21. package/lib/cjs/ClassRegistry.d.ts +2 -1
  22. package/lib/cjs/ClassRegistry.d.ts.map +1 -1
  23. package/lib/cjs/ClassRegistry.js +2 -1
  24. package/lib/cjs/ClassRegistry.js.map +1 -1
  25. package/lib/cjs/CloudSqlite.d.ts +57 -40
  26. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  27. package/lib/cjs/CloudSqlite.js +54 -39
  28. package/lib/cjs/CloudSqlite.js.map +1 -1
  29. package/lib/cjs/DisplayStyle.d.ts +2 -5
  30. package/lib/cjs/DisplayStyle.d.ts.map +1 -1
  31. package/lib/cjs/DisplayStyle.js +0 -3
  32. package/lib/cjs/DisplayStyle.js.map +1 -1
  33. package/lib/cjs/ECDb.d.ts +6 -0
  34. package/lib/cjs/ECDb.d.ts.map +1 -1
  35. package/lib/cjs/ECDb.js +6 -0
  36. package/lib/cjs/ECDb.js.map +1 -1
  37. package/lib/cjs/ECSchemaXmlContext.d.ts +28 -1
  38. package/lib/cjs/ECSchemaXmlContext.d.ts.map +1 -1
  39. package/lib/cjs/ECSchemaXmlContext.js +28 -1
  40. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  41. package/lib/cjs/Element.d.ts +40 -97
  42. package/lib/cjs/Element.d.ts.map +1 -1
  43. package/lib/cjs/Element.js +0 -57
  44. package/lib/cjs/Element.js.map +1 -1
  45. package/lib/cjs/ElementAspect.d.ts +2 -4
  46. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  47. package/lib/cjs/ElementAspect.js +2 -4
  48. package/lib/cjs/ElementAspect.js.map +1 -1
  49. package/lib/cjs/Entity.d.ts +5 -2
  50. package/lib/cjs/Entity.d.ts.map +1 -1
  51. package/lib/cjs/Entity.js +10 -2
  52. package/lib/cjs/Entity.js.map +1 -1
  53. package/lib/cjs/ExternalSource.d.ts +4 -11
  54. package/lib/cjs/ExternalSource.d.ts.map +1 -1
  55. package/lib/cjs/ExternalSource.js +0 -7
  56. package/lib/cjs/ExternalSource.js.map +1 -1
  57. package/lib/cjs/IModelDb.d.ts +61 -26
  58. package/lib/cjs/IModelDb.d.ts.map +1 -1
  59. package/lib/cjs/IModelDb.js +164 -83
  60. package/lib/cjs/IModelDb.js.map +1 -1
  61. package/lib/cjs/IModelHost.d.ts +1 -3
  62. package/lib/cjs/IModelHost.d.ts.map +1 -1
  63. package/lib/cjs/IModelHost.js +3 -5
  64. package/lib/cjs/IModelHost.js.map +1 -1
  65. package/lib/cjs/Material.d.ts +0 -1
  66. package/lib/cjs/Material.d.ts.map +1 -1
  67. package/lib/cjs/Material.js +1 -2
  68. package/lib/cjs/Material.js.map +1 -1
  69. package/lib/cjs/Model.d.ts +4 -13
  70. package/lib/cjs/Model.d.ts.map +1 -1
  71. package/lib/cjs/Model.js +0 -9
  72. package/lib/cjs/Model.js.map +1 -1
  73. package/lib/cjs/PropertyStore.d.ts +3 -3
  74. package/lib/cjs/PropertyStore.d.ts.map +1 -1
  75. package/lib/cjs/PropertyStore.js +2 -5
  76. package/lib/cjs/PropertyStore.js.map +1 -1
  77. package/lib/cjs/Relationship.d.ts +2 -5
  78. package/lib/cjs/Relationship.d.ts.map +1 -1
  79. package/lib/cjs/Relationship.js +0 -3
  80. package/lib/cjs/Relationship.js.map +1 -1
  81. package/lib/cjs/SQLiteDb.d.ts +1 -1
  82. package/lib/cjs/SQLiteDb.d.ts.map +1 -1
  83. package/lib/cjs/SQLiteDb.js +1 -1
  84. package/lib/cjs/SQLiteDb.js.map +1 -1
  85. package/lib/cjs/Schema.d.ts +0 -1
  86. package/lib/cjs/Schema.d.ts.map +1 -1
  87. package/lib/cjs/Schema.js +0 -1
  88. package/lib/cjs/Schema.js.map +1 -1
  89. package/lib/cjs/SchemaUtils.d.ts +19 -0
  90. package/lib/cjs/SchemaUtils.d.ts.map +1 -0
  91. package/lib/cjs/SchemaUtils.js +42 -0
  92. package/lib/cjs/SchemaUtils.js.map +1 -0
  93. package/lib/cjs/SqliteStatement.d.ts +13 -1
  94. package/lib/cjs/SqliteStatement.d.ts.map +1 -1
  95. package/lib/cjs/SqliteStatement.js +23 -1
  96. package/lib/cjs/SqliteStatement.js.map +1 -1
  97. package/lib/cjs/Texture.d.ts +3 -4
  98. package/lib/cjs/Texture.d.ts.map +1 -1
  99. package/lib/cjs/Texture.js +1 -2
  100. package/lib/cjs/Texture.js.map +1 -1
  101. package/lib/cjs/TileStorage.d.ts +3 -0
  102. package/lib/cjs/TileStorage.d.ts.map +1 -1
  103. package/lib/cjs/TileStorage.js +9 -1
  104. package/lib/cjs/TileStorage.js.map +1 -1
  105. package/lib/cjs/ViewDefinition.d.ts +7 -28
  106. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  107. package/lib/cjs/ViewDefinition.js +0 -21
  108. package/lib/cjs/ViewDefinition.js.map +1 -1
  109. package/lib/cjs/ViewStore.d.ts +488 -0
  110. package/lib/cjs/ViewStore.d.ts.map +1 -0
  111. package/lib/cjs/ViewStore.js +1246 -0
  112. package/lib/cjs/ViewStore.js.map +1 -0
  113. package/lib/cjs/core-backend.d.ts +2 -0
  114. package/lib/cjs/core-backend.d.ts.map +1 -1
  115. package/lib/cjs/core-backend.js +2 -0
  116. package/lib/cjs/core-backend.js.map +1 -1
  117. package/lib/cjs/domains/FunctionalElements.d.ts +6 -12
  118. package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -1
  119. package/lib/cjs/domains/FunctionalElements.js +0 -6
  120. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  121. package/lib/cjs/rpc/tracing.js +2 -2
  122. package/lib/cjs/rpc/tracing.js.map +1 -1
  123. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +5 -3
  124. package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
  125. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +53 -36
  126. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  127. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
  128. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +0 -2
  129. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  130. package/lib/cjs/workspace/Workspace.d.ts +1 -1
  131. package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
  132. package/lib/cjs/workspace/Workspace.js +4 -4
  133. package/lib/cjs/workspace/Workspace.js.map +1 -1
  134. package/package.json +21 -40
@@ -19,12 +19,11 @@ const core_bentley_1 = require("@itwin/core-bentley");
19
19
  class ElementAspect extends Entity_1.Entity {
20
20
  /** @internal */
21
21
  static get className() { return "ElementAspect"; }
22
- /** @internal */
22
+ /** Construct an aspect from its JSON representation and its containing iModel. */
23
23
  constructor(props, iModel) {
24
24
  super(props, iModel);
25
25
  this.element = core_common_1.RelatedElement.fromJSON(props.element); // eslint-disable-line @typescript-eslint/no-non-null-assertion
26
26
  }
27
- /** @internal */
28
27
  toJSON() {
29
28
  const val = super.toJSON();
30
29
  val.element = this.element;
@@ -109,7 +108,7 @@ exports.ChannelRootAspect = ChannelRootAspect;
109
108
  class ExternalSourceAspect extends ElementMultiAspect {
110
109
  /** @internal */
111
110
  static get className() { return "ExternalSourceAspect"; }
112
- /** @internal */
111
+ /** Construct an aspect from its JSON representation and its containing iModel. */
113
112
  constructor(props, iModel) {
114
113
  super(props, iModel);
115
114
  this.scope = core_common_1.RelatedElement.fromJSON(props.scope); // eslint-disable-line @typescript-eslint/no-non-null-assertion
@@ -161,7 +160,6 @@ class ExternalSourceAspect extends ElementMultiAspect {
161
160
  });
162
161
  return found;
163
162
  }
164
- /** @internal */
165
163
  toJSON() {
166
164
  const val = super.toJSON();
167
165
  val.scope = this.scope;
@@ -1 +1 @@
1
- {"version":3,"file":"ElementAspect.js","sourceRoot":"","sources":["../../src/ElementAspect.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,oDAA+I;AAC/I,qCAAkC;AAGlC,sDAA2D;AA0B3D;;;;GAIG;AACH,MAAa,aAAc,SAAQ,eAAM;IACvC,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,eAAe,CAAC,CAAC,CAAC;IAG1E,gBAAgB;IAChB,YAAY,KAAyB,EAAE,MAAgB;QACrD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,4BAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAE,CAAC,CAAC,+DAA+D;IACzH,CAAC;IAED,gBAAgB;IACA,MAAM;QACpB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAwB,CAAC;QACjD,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC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gB;IACA,MAAM;QACpB,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAA+B,CAAC;QACxD,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACvB,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QACzB,GAAG,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACjC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC7B,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3B,GAAG,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QACzC,OAAO,GAAG,CAAC;IACb,CAAC;IAEkB,mBAAmB,CAAC,YAAgC;QACrE,KAAK,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QACxC,IAAI,IAAI,CAAC,KAAK;YACZ,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACzC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACzC,IAAI,IAAI,CAAC,MAAM;YACb,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC5C,CAAC;CACF;AAxGD,oDAwGC;AAED,cAAc;AACd,WAAiB,oBAAoB;IACnC;;OAEG;IACH,IAAY,IASX;IATD,WAAY,IAAI;QACd,oFAAoF;QACpF,2BAAmB,CAAA;QACnB,yFAAyF;QACzF,qCAA6B,CAAA;QAC7B;;WAEG;QACH,uBAAe,CAAA;IACjB,CAAC,EATW,IAAI,GAAJ,yBAAI,KAAJ,yBAAI,QASf;AACH,CAAC,EAdgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAcpC","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 ElementAspects\r\n */\r\n\r\nimport { ChannelRootAspectProps, ElementAspectProps, EntityReferenceSet, ExternalSourceAspectProps, RelatedElement } from \"@itwin/core-common\";\r\nimport { Entity } from \"./Entity\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { ECSqlStatement } from \"./ECSqlStatement\";\r\nimport { DbResult, Id64String } from \"@itwin/core-bentley\";\r\n\r\n/** Argument for the `ElementAspect.onXxx` static methods\r\n * @beta\r\n */\r\nexport interface OnAspectArg {\r\n /** The iModel for the aspect affected by this event. */\r\n iModel: IModelDb;\r\n /** The model for the aspect affected by this event */\r\n model: Id64String;\r\n}\r\n/** Argument for the `ElementAspect.onXxx` static methods that supply the properties of an aspect to be inserted or updated.\r\n * @beta\r\n */\r\nexport interface OnAspectPropsArg extends OnAspectArg {\r\n /** The new properties of the aspect affected by this event. */\r\n props: Readonly<ElementAspectProps>;\r\n}\r\n/** Argument for the `ElementAspect.onXxx` static methods that only supply the Id of the affected aspect.\r\n * @beta\r\n */\r\nexport interface OnAspectIdArg extends OnAspectArg {\r\n /** The Id of the aspect affected by this event */\r\n aspectId: Id64String;\r\n}\r\n\r\n/** An Element Aspect is a class that defines a set of properties that are related to (and owned by) a single element.\r\n * Semantically, an ElementAspect can be considered part of the Element. Thus, an ElementAspect is deleted if its owning Element is deleted.\r\n * BIS Guideline: Subclass ElementUniqueAspect or ElementMultiAspect rather than subclassing ElementAspect directly.\r\n * @public\r\n */\r\nexport class ElementAspect extends Entity {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementAspect\"; }\r\n public element: RelatedElement;\r\n\r\n /** @internal */\r\n constructor(props: ElementAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.element = RelatedElement.fromJSON(props.element)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n }\r\n\r\n /** @internal */\r\n public override toJSON(): ElementAspectProps {\r\n const val = super.toJSON() as ElementAspectProps;\r\n val.element = this.element;\r\n return val;\r\n }\r\n\r\n /** Called before a new ElementAspect 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 * @beta\r\n */\r\n protected static onInsert(arg: OnAspectPropsArg): void {\r\n arg.iModel.channels.verifyChannel(arg.model);\r\n }\r\n\r\n /** Called after a new ElementAspect was inserted.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onInserted(_arg: OnAspectPropsArg): void { }\r\n\r\n /** Called before an ElementAspect 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 * @beta\r\n */\r\n protected static onUpdate(arg: OnAspectPropsArg): void {\r\n arg.iModel.channels.verifyChannel(arg.model);\r\n }\r\n\r\n /** Called after an ElementAspect was updated.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onUpdated(_arg: OnAspectPropsArg): void { }\r\n\r\n /** Called before an ElementAspect 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 * @beta\r\n */\r\n protected static onDelete(arg: OnAspectIdArg): void {\r\n arg.iModel.channels.verifyChannel(arg.model);\r\n }\r\n\r\n /** Called after an ElementAspect was deleted.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onDeleted(_arg: OnAspectIdArg): void { }\r\n}\r\n\r\n/** An Element Unique Aspect is an ElementAspect where there can be only zero or one instance of the Element Aspect class per Element.\r\n * @public\r\n */\r\nexport class ElementUniqueAspect extends ElementAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementUniqueAspect\"; }\r\n}\r\n\r\n/** An Element Multi-Aspect is an ElementAspect where there can be **n** instances of the Element Aspect class per Element.\r\n * @public\r\n */\r\nexport class ElementMultiAspect extends ElementAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementMultiAspect\"; }\r\n}\r\n\r\n/**\r\n * @public\r\n */\r\nexport class ChannelRootAspect extends ElementUniqueAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ChannelRootAspect\"; }\r\n /** Insert a ChannelRootAspect on the specified element.\r\n * @deprecated in 4.0 use [[ChannelControl.makeChannelRoot]]. This method does not enforce the rule that channels may not nest and is therefore dangerous.\r\n */\r\n public static insert(iModel: IModelDb, ownerId: Id64String, channelName: string) {\r\n const props: ChannelRootAspectProps = { classFullName: this.classFullName, element: { id: ownerId }, owner: channelName };\r\n iModel.elements.insertAspect(props);\r\n }\r\n}\r\n\r\n/** An ElementMultiAspect that stores synchronization information for an Element originating from an external source.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.2\r\n * @public\r\n */\r\nexport class ExternalSourceAspect extends ElementMultiAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSourceAspect\"; }\r\n\r\n /** An element that scopes the combination of `kind` and `identifier` to uniquely identify the object from the external source.\r\n * @note Warning: in a future major release the `scope` property will be optional, since the scope is intended to be potentially invalid.\r\n * all references should treat it as potentially undefined, but we cannot change the type yet since that is a breaking change.\r\n */\r\n public scope: RelatedElement;\r\n /** The identifier of the object in the source repository. */\r\n public identifier: string;\r\n /** The kind of object within the source repository. */\r\n public kind: string;\r\n /** The cryptographic hash (any algorithm) of the source object's content. If defined, it must be guaranteed to change when the source object's content changes. */\r\n public checksum?: string;\r\n /** An optional value that is typically a version number or a pseudo version number like last modified time.\r\n * It will be used by the synchronization process to detect that a source object is unchanged so that computing a cryptographic hash can be avoided.\r\n * If present, this value must be guaranteed to change when any of the source object's content changes.\r\n */\r\n public version?: string;\r\n /** A place where additional JSON properties can be stored. For example, provenance information or properties relating to the synchronization process.\r\n * @note Warning: in a future major release, the type of `jsonProperties` will be changed to object, and itwin.js will automatically stringify it when writing to the iModel.\r\n * This will be a breaking change, since application code will have to change from supplying a string to supplying an object.\r\n */\r\n public jsonProperties?: string;\r\n /** The source of the imported/synchronized object. Should point to an instance of [ExternalSource]($backend). */\r\n public source?: RelatedElement;\r\n\r\n /** @internal */\r\n constructor(props: ExternalSourceAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.scope = RelatedElement.fromJSON(props.scope)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n this.source = RelatedElement.fromJSON(props.source);\r\n this.identifier = props.identifier;\r\n this.kind = props.kind;\r\n this.checksum = props.checksum;\r\n this.version = props.version;\r\n this.jsonProperties = props.jsonProperties;\r\n }\r\n\r\n /** @deprecated in 3.x. findAllBySource */\r\n public static findBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): { elementId?: Id64String, aspectId?: Id64String } {\r\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\r\n let elementId: Id64String | undefined;\r\n let aspectId: Id64String | undefined;\r\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\r\n statement.bindId(\"scope\", scope);\r\n statement.bindString(\"kind\", kind);\r\n statement.bindString(\"identifier\", identifier);\r\n if (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n elementId = statement.getValue(0).getId();\r\n aspectId = statement.getValue(1).getId();\r\n }\r\n });\r\n return { elementId, aspectId };\r\n }\r\n\r\n /** Look up the elements that contain one or more ExternalSourceAspect with the specified Scope, Kind, and Identifier.\r\n * The result of this function is an array of all of the ExternalSourceAspects that were found, each associated with the owning element.\r\n * A given element could have more than one ExternalSourceAspect with the given scope, kind, and identifier.\r\n * Also, many elements could have ExternalSourceAspect with the same scope, kind, and identifier.\r\n * Therefore, the result array could have more than one entry with the same elementId.\r\n * Aspects are never shared. Each aspect has its own unique ECInstanceId.\r\n * @param iModelDb The iModel to query\r\n * @param scope The scope of the ExternalSourceAspects to find\r\n * @param kind The kind of the ExternalSourceAspects to find\r\n * @param identifier The identifier of the ExternalSourceAspects to find\r\n * @returns the query results\r\n */\r\n public static findAllBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): Array<{ elementId: Id64String, aspectId: Id64String }> {\r\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\r\n const found: Array<{ elementId: Id64String, aspectId: Id64String }> = [];\r\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\r\n statement.bindId(\"scope\", scope);\r\n statement.bindString(\"kind\", kind);\r\n statement.bindString(\"identifier\", identifier);\r\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n found.push({ elementId: statement.getValue(0).getId(), aspectId: statement.getValue(1).getId() });\r\n }\r\n });\r\n return found;\r\n }\r\n\r\n /** @internal */\r\n public override toJSON(): ExternalSourceAspectProps {\r\n const val = super.toJSON() as ExternalSourceAspectProps;\r\n val.scope = this.scope;\r\n val.source = this.source;\r\n val.identifier = this.identifier;\r\n val.kind = this.kind;\r\n val.checksum = this.checksum;\r\n val.version = this.version;\r\n val.jsonProperties = this.jsonProperties;\r\n return val;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (this.scope)\r\n referenceIds.addElement(this.scope.id);\r\n referenceIds.addElement(this.element.id);\r\n if (this.source)\r\n referenceIds.addElement(this.source.id);\r\n }\r\n}\r\n\r\n/** @public */\r\nexport namespace ExternalSourceAspect { // eslint-disable-line no-redeclare\r\n /** Standard values for the `Kind` property of `ExternalSourceAspect`.\r\n * @public\r\n */\r\n export enum Kind {\r\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Element]] provenance */\r\n Element = \"Element\",\r\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Relationship]] provenance */\r\n Relationship = \"Relationship\",\r\n /** Indicates that the [[ExternalSourceAspect]] is storing *scope* provenance\r\n * @see [[ExternalSourceAspect.scope]]\r\n */\r\n Scope = \"Scope\",\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ElementAspect.js","sourceRoot":"","sources":["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AAY,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACzC,IAAI,IAAI,CAAC,MAAM;YACb,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC5C,CAAC;CACF;AAvGD,oDAuGC;AAED,cAAc;AACd,WAAiB,oBAAoB;IACnC;;OAEG;IACH,IAAY,IASX;IATD,WAAY,IAAI;QACd,oFAAoF;QACpF,2BAAmB,CAAA;QACnB,yFAAyF;QACzF,qCAA6B,CAAA;QAC7B;;WAEG;QACH,uBAAe,CAAA;IACjB,CAAC,EATW,IAAI,GAAJ,yBAAI,KAAJ,yBAAI,QASf;AACH,CAAC,EAdgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAcpC","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 ElementAspects\r\n */\r\n\r\nimport { ChannelRootAspectProps, ElementAspectProps, EntityReferenceSet, ExternalSourceAspectProps, RelatedElement } from \"@itwin/core-common\";\r\nimport { Entity } from \"./Entity\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { ECSqlStatement } from \"./ECSqlStatement\";\r\nimport { DbResult, Id64String } from \"@itwin/core-bentley\";\r\n\r\n/** Argument for the `ElementAspect.onXxx` static methods\r\n * @beta\r\n */\r\nexport interface OnAspectArg {\r\n /** The iModel for the aspect affected by this event. */\r\n iModel: IModelDb;\r\n /** The model for the aspect affected by this event */\r\n model: Id64String;\r\n}\r\n/** Argument for the `ElementAspect.onXxx` static methods that supply the properties of an aspect to be inserted or updated.\r\n * @beta\r\n */\r\nexport interface OnAspectPropsArg extends OnAspectArg {\r\n /** The new properties of the aspect affected by this event. */\r\n props: Readonly<ElementAspectProps>;\r\n}\r\n/** Argument for the `ElementAspect.onXxx` static methods that only supply the Id of the affected aspect.\r\n * @beta\r\n */\r\nexport interface OnAspectIdArg extends OnAspectArg {\r\n /** The Id of the aspect affected by this event */\r\n aspectId: Id64String;\r\n}\r\n\r\n/** An Element Aspect is a class that defines a set of properties that are related to (and owned by) a single element.\r\n * Semantically, an ElementAspect can be considered part of the Element. Thus, an ElementAspect is deleted if its owning Element is deleted.\r\n * BIS Guideline: Subclass ElementUniqueAspect or ElementMultiAspect rather than subclassing ElementAspect directly.\r\n * @public\r\n */\r\nexport class ElementAspect extends Entity {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementAspect\"; }\r\n public element: RelatedElement;\r\n\r\n /** Construct an aspect from its JSON representation and its containing iModel. */\r\n constructor(props: ElementAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.element = RelatedElement.fromJSON(props.element)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n }\r\n\r\n public override toJSON(): ElementAspectProps {\r\n const val = super.toJSON() as ElementAspectProps;\r\n val.element = this.element;\r\n return val;\r\n }\r\n\r\n /** Called before a new ElementAspect 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 * @beta\r\n */\r\n protected static onInsert(arg: OnAspectPropsArg): void {\r\n arg.iModel.channels.verifyChannel(arg.model);\r\n }\r\n\r\n /** Called after a new ElementAspect was inserted.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onInserted(_arg: OnAspectPropsArg): void { }\r\n\r\n /** Called before an ElementAspect 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 * @beta\r\n */\r\n protected static onUpdate(arg: OnAspectPropsArg): void {\r\n arg.iModel.channels.verifyChannel(arg.model);\r\n }\r\n\r\n /** Called after an ElementAspect was updated.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onUpdated(_arg: OnAspectPropsArg): void { }\r\n\r\n /** Called before an ElementAspect 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 * @beta\r\n */\r\n protected static onDelete(arg: OnAspectIdArg): void {\r\n arg.iModel.channels.verifyChannel(arg.model);\r\n }\r\n\r\n /** Called after an ElementAspect was deleted.\r\n * @note If you override this method, you must call super.\r\n * @beta\r\n */\r\n protected static onDeleted(_arg: OnAspectIdArg): void { }\r\n}\r\n\r\n/** An Element Unique Aspect is an ElementAspect where there can be only zero or one instance of the Element Aspect class per Element.\r\n * @public\r\n */\r\nexport class ElementUniqueAspect extends ElementAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementUniqueAspect\"; }\r\n}\r\n\r\n/** An Element Multi-Aspect is an ElementAspect where there can be **n** instances of the Element Aspect class per Element.\r\n * @public\r\n */\r\nexport class ElementMultiAspect extends ElementAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ElementMultiAspect\"; }\r\n}\r\n\r\n/**\r\n * @public\r\n */\r\nexport class ChannelRootAspect extends ElementUniqueAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ChannelRootAspect\"; }\r\n /** Insert a ChannelRootAspect on the specified element.\r\n * @deprecated in 4.0 use [[ChannelControl.makeChannelRoot]]. This method does not enforce the rule that channels may not nest and is therefore dangerous.\r\n */\r\n public static insert(iModel: IModelDb, ownerId: Id64String, channelName: string) {\r\n const props: ChannelRootAspectProps = { classFullName: this.classFullName, element: { id: ownerId }, owner: channelName };\r\n iModel.elements.insertAspect(props);\r\n }\r\n}\r\n\r\n/** An ElementMultiAspect that stores synchronization information for an Element originating from an external source.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.2\r\n * @public\r\n */\r\nexport class ExternalSourceAspect extends ElementMultiAspect {\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSourceAspect\"; }\r\n\r\n /** An element that scopes the combination of `kind` and `identifier` to uniquely identify the object from the external source.\r\n * @note Warning: in a future major release the `scope` property will be optional, since the scope is intended to be potentially invalid.\r\n * all references should treat it as potentially undefined, but we cannot change the type yet since that is a breaking change.\r\n */\r\n public scope: RelatedElement;\r\n /** The identifier of the object in the source repository. */\r\n public identifier: string;\r\n /** The kind of object within the source repository. */\r\n public kind: string;\r\n /** The cryptographic hash (any algorithm) of the source object's content. If defined, it must be guaranteed to change when the source object's content changes. */\r\n public checksum?: string;\r\n /** An optional value that is typically a version number or a pseudo version number like last modified time.\r\n * It will be used by the synchronization process to detect that a source object is unchanged so that computing a cryptographic hash can be avoided.\r\n * If present, this value must be guaranteed to change when any of the source object's content changes.\r\n */\r\n public version?: string;\r\n /** A place where additional JSON properties can be stored. For example, provenance information or properties relating to the synchronization process.\r\n * @note Warning: in a future major release, the type of `jsonProperties` will be changed to object, and itwin.js will automatically stringify it when writing to the iModel.\r\n * This will be a breaking change, since application code will have to change from supplying a string to supplying an object.\r\n */\r\n public jsonProperties?: string;\r\n /** The source of the imported/synchronized object. Should point to an instance of [ExternalSource]($backend). */\r\n public source?: RelatedElement;\r\n\r\n /** Construct an aspect from its JSON representation and its containing iModel. */\r\n constructor(props: ExternalSourceAspectProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.scope = RelatedElement.fromJSON(props.scope)!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n this.source = RelatedElement.fromJSON(props.source);\r\n this.identifier = props.identifier;\r\n this.kind = props.kind;\r\n this.checksum = props.checksum;\r\n this.version = props.version;\r\n this.jsonProperties = props.jsonProperties;\r\n }\r\n\r\n /** @deprecated in 3.x. findAllBySource */\r\n public static findBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): { elementId?: Id64String, aspectId?: Id64String } {\r\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\r\n let elementId: Id64String | undefined;\r\n let aspectId: Id64String | undefined;\r\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\r\n statement.bindId(\"scope\", scope);\r\n statement.bindString(\"kind\", kind);\r\n statement.bindString(\"identifier\", identifier);\r\n if (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n elementId = statement.getValue(0).getId();\r\n aspectId = statement.getValue(1).getId();\r\n }\r\n });\r\n return { elementId, aspectId };\r\n }\r\n\r\n /** Look up the elements that contain one or more ExternalSourceAspect with the specified Scope, Kind, and Identifier.\r\n * The result of this function is an array of all of the ExternalSourceAspects that were found, each associated with the owning element.\r\n * A given element could have more than one ExternalSourceAspect with the given scope, kind, and identifier.\r\n * Also, many elements could have ExternalSourceAspect with the same scope, kind, and identifier.\r\n * Therefore, the result array could have more than one entry with the same elementId.\r\n * Aspects are never shared. Each aspect has its own unique ECInstanceId.\r\n * @param iModelDb The iModel to query\r\n * @param scope The scope of the ExternalSourceAspects to find\r\n * @param kind The kind of the ExternalSourceAspects to find\r\n * @param identifier The identifier of the ExternalSourceAspects to find\r\n * @returns the query results\r\n */\r\n public static findAllBySource(iModelDb: IModelDb, scope: Id64String, kind: string, identifier: string): Array<{ elementId: Id64String, aspectId: Id64String }> {\r\n const sql = `SELECT Element.Id, ECInstanceId FROM ${ExternalSourceAspect.classFullName} WHERE (Scope.Id=:scope AND Kind=:kind AND Identifier=:identifier)`;\r\n const found: Array<{ elementId: Id64String, aspectId: Id64String }> = [];\r\n iModelDb.withPreparedStatement(sql, (statement: ECSqlStatement) => {\r\n statement.bindId(\"scope\", scope);\r\n statement.bindString(\"kind\", kind);\r\n statement.bindString(\"identifier\", identifier);\r\n while (DbResult.BE_SQLITE_ROW === statement.step()) {\r\n found.push({ elementId: statement.getValue(0).getId(), aspectId: statement.getValue(1).getId() });\r\n }\r\n });\r\n return found;\r\n }\r\n\r\n public override toJSON(): ExternalSourceAspectProps {\r\n const val = super.toJSON() as ExternalSourceAspectProps;\r\n val.scope = this.scope;\r\n val.source = this.source;\r\n val.identifier = this.identifier;\r\n val.kind = this.kind;\r\n val.checksum = this.checksum;\r\n val.version = this.version;\r\n val.jsonProperties = this.jsonProperties;\r\n return val;\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (this.scope)\r\n referenceIds.addElement(this.scope.id);\r\n referenceIds.addElement(this.element.id);\r\n if (this.source)\r\n referenceIds.addElement(this.source.id);\r\n }\r\n}\r\n\r\n/** @public */\r\nexport namespace ExternalSourceAspect { // eslint-disable-line no-redeclare\r\n /** Standard values for the `Kind` property of `ExternalSourceAspect`.\r\n * @public\r\n */\r\n export enum Kind {\r\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Element]] provenance */\r\n Element = \"Element\",\r\n /** Indicates that the [[ExternalSourceAspect]] is storing [[Relationship]] provenance */\r\n Relationship = \"Relationship\",\r\n /** Indicates that the [[ExternalSourceAspect]] is storing *scope* provenance\r\n * @see [[ExternalSourceAspect.scope]]\r\n */\r\n Scope = \"Scope\",\r\n }\r\n}\r\n"]}
@@ -37,8 +37,11 @@ export declare class Entity {
37
37
  iModel: IModelDb;
38
38
  /** The Id of this Entity. May be invalid if the Entity has not yet been saved in the database. */
39
39
  id: Id64String;
40
- /** @internal */
41
- constructor(props: EntityProps, iModel: IModelDb);
40
+ protected constructor(props: EntityProps, iModel: IModelDb);
41
+ /** Invoke the constructor of the specified `Entity` subclass.
42
+ * @internal
43
+ */
44
+ static instantiate(subclass: typeof Entity, props: EntityProps, iModel: IModelDb): Entity;
42
45
  /** Obtain the JSON representation of this Entity. Subclasses of [[Entity]] typically override this method to return their corresponding sub-type of [EntityProps]($common) -
43
46
  * for example, [[GeometricElement.toJSON]] returns a [GeometricElementProps]($common).
44
47
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Entity.d.ts","sourceRoot":"","sources":["../../src/Entity.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAQ,UAAU,EAAgB,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,gBAAgB,EAAoB,MAAM,oBAAoB,CAAC;AACzG,OAAO,KAAK,EAAE,QAAQ,EAAE,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E,4EAA4E;IAC5E,WAAkB,aAAa,IAAI,MAAM,CAA0D;IAEnG,6EAA6E;IAC7E,IAAW,aAAa,IAAI,MAAM,CAAqC;IAEvE,gBAAgB;IAChB,WAAkB,mBAAmB,IAAI,MAAM,EAAE,CAAe;IAEhE;;;;;OAKG;WACW,EAAE,CAAC,UAAU,EAAE,OAAO,MAAM,GAAG,OAAO;IAKpD;;;OAGG;IACH,WAAkB,gBAAgB,YAAoB;IAEtD;;;;;OAKG;IACI,eAAe,IAAI,kBAAkB;IAM5C;;;OAGG;IAEI,uBAAuB,QAXJ,kBAAkB,CAWU;IAEtD;;;;;;;OAOG;IACH,SAAS,CAAC,mBAAmB,CAAC,aAAa,EAAE,kBAAkB,GAAG,IAAI;IAItE;;;OAGG;IAEH,SAAS,CAAC,2BAA2B,kBATQ,kBAAkB,KAAG,IAAI,CASL;CAClE;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,QAAQ,GAAG;IAAE,SAAS,EAAE,CAAC,CAAA;CAAE,CAAC"}
package/lib/cjs/Entity.js CHANGED
@@ -32,7 +32,6 @@ class Entity {
32
32
  get schemaName() { return this._ctor.schema.schemaName; }
33
33
  /** The name of the BIS class associated with this class. */
34
34
  get className() { return this._ctor.className; }
35
- /** @internal */
36
35
  constructor(props, iModel) {
37
36
  /** An immutable property used to discriminate between [[Entity]] and [EntityProps]($common), used to inform the TypeScript compiler that these two types
38
37
  * are never substitutable for one another. To obtain an EntityProps from an Entity, use [[Entity.toJSON]].
@@ -55,6 +54,12 @@ class Entity {
55
54
  // copy all auto-handled properties from input to the object being constructed
56
55
  this.forEachProperty((propName, meta) => this[propName] = meta.createProperty(props[propName]), false);
57
56
  }
57
+ /** Invoke the constructor of the specified `Entity` subclass.
58
+ * @internal
59
+ */
60
+ static instantiate(subclass, props, iModel) {
61
+ return new subclass(props, iModel);
62
+ }
58
63
  /** Obtain the JSON representation of this Entity. Subclasses of [[Entity]] typically override this method to return their corresponding sub-type of [EntityProps]($common) -
59
64
  * for example, [[GeometricElement.toJSON]] returns a [GeometricElementProps]($common).
60
65
  */
@@ -86,7 +91,10 @@ class Entity {
86
91
  * @note this should have a type of `is<T extends typeof Entity>(otherClass: T): this is T` but can't because of
87
92
  * typescript's restriction on the `this` type in static methods
88
93
  */
89
- static is(otherClass) { return (0, core_bentley_1.isSubclassOf)(this, otherClass); }
94
+ static is(otherClass) {
95
+ // inline of @itwin/core-bentley's isSubclassOf due to protected constructor.
96
+ return this === otherClass || this.prototype instanceof otherClass;
97
+ }
90
98
  /** whether this JavaScript class was generated for this ECClass because there was no registered custom implementation
91
99
  * ClassRegistry overrides this when generating a class
92
100
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"Entity.js","sourceRoot":"","sources":["../../src/Entity.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAqE;AACrE,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,OAAO,IAAI,CAAC,CAAC,CAAC;IAExC,yDAAyD;IACzD,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IAExE,4DAA4D;IAC5D,IAAW,SAAS,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAQ/D,gBAAgB;IAChB,YAAY,KAAkB,EAAE,MAAgB;QAnChD;;WAEG;QACa,uBAAkB,GAAG,IAAa,CAAC;QA+FnD;;;WAGG;QACH,6DAA6D;QACtD,4BAAuB,GAAG,IAAI,CAAC,eAAe,CAAC;QActD;;;WAGG;QACH,6DAA6D;QACnD,gCAA2B,GAAG,IAA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OAAO,EAAE,CAAC,CAAC,CAAC;IAEhE;;;;;OAKG;IACI,MAAM,CAAC,EAAE,CAAC,UAAyB,IAAa,OAAO,IAAA,2BAAY,EAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAE/F;;;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;AA5HD,wBA4HC","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, isSubclassOf } 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 /** @internal */\r\n 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 /** 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 { return isSubclassOf(this, otherClass); }\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+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,OAAO,IAAI,CAAC,CAAC,CAAC;IAExC,yDAAyD;IACzD,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IAExE,4DAA4D;IAC5D,IAAW,SAAS,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAQ/D,YAAsB,KAAkB,EAAE,MAAgB;QAlC1D;;WAEG;QACa,uBAAkB,GAAG,IAAa,CAAC;QAwGnD;;;WAGG;QACH,6DAA6D;QACtD,4BAAuB,GAAG,IAAI,CAAC,eAAe,CAAC;QActD;;;WAGG;QACH,6DAA6D;QACnD,gCAA2B,GAAG,IAAI,CAAC,mBAAmB,CAAC;QAhG/D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACr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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"]}
@@ -20,9 +20,7 @@ export declare class ExternalSource extends InformationReferenceElement {
20
20
  connectorVersion?: string;
21
21
  /** @internal */
22
22
  static get className(): string;
23
- /** @internal */
24
- constructor(props: ExternalSourceProps, iModel: IModelDb);
25
- /** @internal */
23
+ protected constructor(props: ExternalSourceProps, iModel: IModelDb);
26
24
  toJSON(): ExternalSourceProps;
27
25
  /** The [[CodeSpec]] for ExternalSource elements is not automatically created, so this method ensures that it exists. */
28
26
  static ensureCodeSpec(iModelDb: IModelDb): Id64String;
@@ -55,9 +53,7 @@ export declare class ExternalSourceAttachment extends InformationReferenceElemen
55
53
  scale?: Point3d;
56
54
  /** @internal */
57
55
  static get className(): string;
58
- /** @internal */
59
- constructor(props: ExternalSourceAttachmentProps, iModel: IModelDb);
60
- /** @internal */
56
+ protected constructor(props: ExternalSourceAttachmentProps, iModel: IModelDb);
61
57
  toJSON(): ExternalSourceAttachmentProps;
62
58
  /** The [[CodeSpec]] for ExternalSourceAttachment elements is not automatically created, so this method ensures that it exists. */
63
59
  static ensureCodeSpec(iModelDb: IModelDb): Id64String;
@@ -76,8 +72,7 @@ export declare class ExternalSourceAttachment extends InformationReferenceElemen
76
72
  export declare class ExternalSourceGroup extends ExternalSource {
77
73
  /** @internal */
78
74
  static get className(): string;
79
- /** @internal */
80
- constructor(props: ExternalSourceProps, iModel: IModelDb);
75
+ protected constructor(props: ExternalSourceProps, iModel: IModelDb);
81
76
  }
82
77
  /** Link to the Configuration for an iModel Synchronization Job
83
78
  * @note The associated ECClass was added to the BisCore schema in version 1.0.13
@@ -88,9 +83,7 @@ export declare class SynchronizationConfigLink extends UrlLink {
88
83
  lastSuccessfulRun?: string;
89
84
  /** @internal */
90
85
  static get className(): string;
91
- /** @internal */
92
- constructor(props: SynchronizationConfigLinkProps, iModel: IModelDb);
93
- /** @internal */
86
+ protected constructor(props: SynchronizationConfigLinkProps, iModel: IModelDb);
94
87
  toJSON(): SynchronizationConfigLinkProps;
95
88
  }
96
89
  //# sourceMappingURL=ExternalSource.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ExternalSource.d.ts","sourceRoot":"","sources":["../../src/ExternalSource.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EACQ,IAAI,EAAiB,kBAAkB,EAAE,6BAA6B,EAAE,4BAA4B,EAAE,mBAAmB,EACtI,8BAA8B,EAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,2BAA2B,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,sCAAsC,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAEhH;;;GAGG;AACH,qBAAa,cAAe,SAAQ,2BAA2B;IAC7D,wD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AmB,EAAE,MAAM,EAAE,QAAQ;CAGnE;AAED;;;GAGG;AACH,qBAAa,yBAA0B,SAAQ,OAAO;IACpD,6EAA6E;IACtE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAClC,gBAAgB;IAChB,WAA2B,SAAS,IAAI,MAAM,CAAwC;IAEtF,SAAS,aAAa,KAAK,EAAE,8BAA8B,EAAE,MAAM,EAAE,QAAQ;IAI7D,MAAM,IAAI,8BAA8B;CAGzD"}
@@ -19,13 +19,11 @@ const NavigationRelationship_1 = require("./NavigationRelationship");
19
19
  class ExternalSource extends Element_1.InformationReferenceElement {
20
20
  /** @internal */
21
21
  static get className() { return "ExternalSource"; }
22
- /** @internal */
23
22
  constructor(props, iModel) {
24
23
  super(props, iModel);
25
24
  if (props.repository)
26
25
  this.repository = new NavigationRelationship_1.ExternalSourceIsInRepository(core_common_1.RelatedElement.idFromJson(props.repository));
27
26
  }
28
- /** @internal */
29
27
  toJSON() {
30
28
  return super.toJSON(); // Entity.toJSON takes care of auto-handled properties
31
29
  }
@@ -62,7 +60,6 @@ exports.ExternalSource = ExternalSource;
62
60
  class ExternalSourceAttachment extends Element_1.InformationReferenceElement {
63
61
  /** @internal */
64
62
  static get className() { return "ExternalSourceAttachment"; }
65
- /** @internal */
66
63
  constructor(props, iModel) {
67
64
  super(props, iModel);
68
65
  if (props.attaches)
@@ -72,7 +69,6 @@ class ExternalSourceAttachment extends Element_1.InformationReferenceElement {
72
69
  if (props.scale)
73
70
  this.scale = core_geometry_1.Point3d.fromJSON(props.scale);
74
71
  }
75
- /** @internal */
76
72
  toJSON() {
77
73
  return super.toJSON(); // Entity.toJSON takes care of auto-handled properties
78
74
  }
@@ -105,7 +101,6 @@ exports.ExternalSourceAttachment = ExternalSourceAttachment;
105
101
  class ExternalSourceGroup extends ExternalSource {
106
102
  /** @internal */
107
103
  static get className() { return "ExternalSourceGroup"; }
108
- /** @internal */
109
104
  constructor(props, iModel) {
110
105
  super(props, iModel);
111
106
  }
@@ -118,11 +113,9 @@ exports.ExternalSourceGroup = ExternalSourceGroup;
118
113
  class SynchronizationConfigLink extends Element_1.UrlLink {
119
114
  /** @internal */
120
115
  static get className() { return "SynchronizationConfigLink"; }
121
- /** @internal */
122
116
  constructor(props, iModel) {
123
117
  super(props, iModel);
124
118
  }
125
- /** @internal */
126
119
  toJSON() {
127
120
  return super.toJSON(); // Entity.toJSON takes care of auto-handled properties
128
121
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ExternalSource.js","sourceRoot":"","sources":["../../src/ExternalSource.ts"],"names":[],"mappings":";AACA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAA+C;AAC/C,oDAG4B;AAC5B,uCAAiE;AAEjE,qEAAgH;AAEhH;;;GAGG;AACH,MAAa,cAAe,SAAQ,qCAA2B;IAO7D,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,gBAAgB,CAAC,CAAC,CAAC;IAC3E,gBAAgB;IAChB,YAAmB,KAA0B,EAAE,MAAgB;QAC7D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,KAAK,CAAC,UAAU;YAClB,IAAI,CAAC,UAAU,GAAG,IAAI,qDAA4B,CAAC,4BAAc,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACpG,CAAC;IACD,gBAAgB;IACA,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAyB,CAAC,CAAC,sDAAsD;IACtG,CAAC;IACD,wHAAwH;IACjH,MAAM,CAAC,cAAc,CAAC,QAAkB;QAC7C,IAAI;YACF,MAAM,QAAQ,GAAG,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,yBAAW,CAAC,cAAc,CAAC,CAAC;YAC1E,OAAO,QAAQ,CAAC,EAAE,CAAC;SACpB;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,yBAAW,CAAC,cAAc,EAAE,2BAAa,CAAC,IAA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,CAAC;IACD,gBAAgB;IACA,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAoC,CAAC,CAAC,sDAAsD;IACjH,CAAC;CACF;AAbD,8DAaC","sourcesContent":["\r\n/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Elements\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { Point3d } from \"@itwin/core-geometry\";\r\nimport {\r\n BisCodeSpec, Code, CodeScopeSpec, EntityReferenceSet, ExternalSourceAttachmentProps, ExternalSourceAttachmentRole, ExternalSourceProps, IModel, RelatedElement,\r\n SynchronizationConfigLinkProps,\r\n} from \"@itwin/core-common\";\r\nimport { InformationReferenceElement, UrlLink } from \"./Element\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { ExternalSourceAttachmentAttachesSource, ExternalSourceIsInRepository } from \"./NavigationRelationship\";\r\n\r\n/** An ExternalSource refers to an 'information container' found in a repository. In some cases, the container is the entire repository.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSource extends InformationReferenceElement {\r\n /** The repository that contains this ExternalSource. */\r\n public repository?: ExternalSourceIsInRepository;\r\n /** The name of the iModel Connecter that processed this ExternalSource. */\r\n public connectorName?: string;\r\n /** The version of the iModel Connecter that processed this ExternalSource. */\r\n public connectorVersion?: string;\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSource\"; }\r\n /** @internal */\r\n public constructor(props: ExternalSourceProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n if (props.repository)\r\n this.repository = new ExternalSourceIsInRepository(RelatedElement.idFromJson(props.repository));\r\n }\r\n /** @internal */\r\n public override toJSON(): ExternalSourceProps { // This override only specializes the return type\r\n return super.toJSON() as ExternalSourceProps; // Entity.toJSON takes care of auto-handled properties\r\n }\r\n /** The [[CodeSpec]] for ExternalSource elements is not automatically created, so this method ensures that it exists. */\r\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String {\r\n try {\r\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSource);\r\n return codeSpec.id;\r\n } catch (e) {\r\n return iModelDb.codeSpecs.insert(BisCodeSpec.externalSource, CodeScopeSpec.Type.Repository);\r\n }\r\n }\r\n /** Create a Code for an ExternalSource element given a name that is meant to be unique within the scope of the iModel.\r\n * @param iModelDb The IModelDb\r\n * @param codeValue The ExternalSource name\r\n * @see [[ensureCodeSpec]]\r\n */\r\n public static createCode(iModelDb: IModelDb, codeValue: string): Code {\r\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSource);\r\n return new Code({ spec: codeSpec.id, scope: IModel.rootSubjectId, value: codeValue });\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (this.repository)\r\n referenceIds.addElement(this.repository.id);\r\n }\r\n}\r\n\r\n/** Attachment of an ExternalSource\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceAttachment extends InformationReferenceElement {\r\n /** The [[ExternalSource]] that is attached by this ExternalSourceAttachment. */\r\n public attaches?: ExternalSourceAttachmentAttachesSource;\r\n /** Specifies whether the attached [[ExternalSource]] provides context or models a part of the whole. */\r\n public role?: ExternalSourceAttachmentRole;\r\n /** The translation or offset in global coordinates of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public translation?: Point3d;\r\n /** The Yaw angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public yaw?: number;\r\n /** The Pitch angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public pitch?: number;\r\n /** The Roll angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public roll?: number;\r\n /** The scale of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public scale?: Point3d;\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSourceAttachment\"; }\r\n /** @internal */\r\n public constructor(props: ExternalSourceAttachmentProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n if (props.attaches)\r\n this.attaches = new ExternalSourceAttachmentAttachesSource(RelatedElement.idFromJson(props.attaches));\r\n\r\n if (props.translation)\r\n this.translation = Point3d.fromJSON(props.translation);\r\n\r\n if (props.scale)\r\n this.scale = Point3d.fromJSON(props.scale);\r\n }\r\n /** @internal */\r\n public override toJSON(): ExternalSourceAttachmentProps { // This override only specializes the return type\r\n return super.toJSON() as ExternalSourceAttachmentProps; // Entity.toJSON takes care of auto-handled properties\r\n }\r\n /** The [[CodeSpec]] for ExternalSourceAttachment elements is not automatically created, so this method ensures that it exists. */\r\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String {\r\n try {\r\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\r\n return codeSpec.id;\r\n } catch (e) {\r\n return iModelDb.codeSpecs.insert(BisCodeSpec.externalSourceAttachment, CodeScopeSpec.Type.ParentElement);\r\n }\r\n }\r\n /** Create a Code for an ExternalSourceAttachment element given a name that is meant to be unique within the scope of its parent [[ExternalSource]].\r\n * @param iModelDb The IModelDb\r\n * @param scopeElementId The parent ExternalSource\r\n * @param codeValue The ExternalSourceAttachment name\r\n * @see [[ensureCodeSpec]]\r\n */\r\n public static createCode(iModelDb: IModelDb, scopeElementId: Id64String, codeValue: string): Code {\r\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\r\n return new Code({ spec: codeSpec.id, scope: scopeElementId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A group of ExternalSources that are collectively a source of information for one or more elements.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceGroup extends ExternalSource {\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSourceGroup\"; }\r\n /** @internal */\r\n public constructor(props: ExternalSourceProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** Link to the Configuration for an iModel Synchronization Job\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class SynchronizationConfigLink extends UrlLink {\r\n /** Date/Time of last successful run of this synchronization configuration */\r\n public lastSuccessfulRun?: string;\r\n /** @internal */\r\n public static override get className(): string { return \"SynchronizationConfigLink\"; }\r\n /** @internal */\r\n public constructor(props: SynchronizationConfigLinkProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n /** @internal */\r\n public override toJSON(): SynchronizationConfigLinkProps { // This override only specializes the return type\r\n return super.toJSON() as SynchronizationConfigLinkProps; // Entity.toJSON takes care of auto-handled properties\r\n }\r\n}\r\n\r\n"]}
1
+ {"version":3,"file":"ExternalSource.js","sourceRoot":"","sources":["../../src/ExternalSource.ts"],"names":[],"mappings":";AACA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAA+C;AAC/C,oDAG4B;AAC5B,uCAAiE;AAEjE,qEAAgH;AAEhH;;;GAGG;AACH,MAAa,cAAe,SAAQ,qCAA2B;IAO7D,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,gBAAgB,CAAC,CAAC,CAAC;IAE3E,YAAsB,KAA0B,EAAE,MAAgB;QAChE,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,KAAK,CAAC,UAAU;YAClB,IAAI,CAAC,UAAU,GAAG,IAAI,qDAA4B,CAAC,4BAAc,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACpG,CAAC;IAEe,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAyB,CAAC,CAAC,sDAAsD;IACtG,CAAC;IACD,wHAAwH;IACjH,MAAM,CAAC,cAAc,CAAC,QAAkB;QAC7C,IAAI;YACF,MAAM,QAA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A0B,SAAQ,iBAAO;IAGpD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,2BAA2B,CAAC,CAAC,CAAC;IAEtF,YAAsB,KAAqC,EAAE,MAAgB;QAC3E,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC;IAEe,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAoC,CAAC,CAAC,sDAAsD;IACjH,CAAC;CACF;AAbD,8DAaC","sourcesContent":["\r\n/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Elements\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { Point3d } from \"@itwin/core-geometry\";\r\nimport {\r\n BisCodeSpec, Code, CodeScopeSpec, EntityReferenceSet, ExternalSourceAttachmentProps, ExternalSourceAttachmentRole, ExternalSourceProps, IModel, RelatedElement,\r\n SynchronizationConfigLinkProps,\r\n} from \"@itwin/core-common\";\r\nimport { InformationReferenceElement, UrlLink } from \"./Element\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { ExternalSourceAttachmentAttachesSource, ExternalSourceIsInRepository } from \"./NavigationRelationship\";\r\n\r\n/** An ExternalSource refers to an 'information container' found in a repository. In some cases, the container is the entire repository.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSource extends InformationReferenceElement {\r\n /** The repository that contains this ExternalSource. */\r\n public repository?: ExternalSourceIsInRepository;\r\n /** The name of the iModel Connecter that processed this ExternalSource. */\r\n public connectorName?: string;\r\n /** The version of the iModel Connecter that processed this ExternalSource. */\r\n public connectorVersion?: string;\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSource\"; }\r\n\r\n protected constructor(props: ExternalSourceProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n if (props.repository)\r\n this.repository = new ExternalSourceIsInRepository(RelatedElement.idFromJson(props.repository));\r\n }\r\n\r\n public override toJSON(): ExternalSourceProps { // This override only specializes the return type\r\n return super.toJSON() as ExternalSourceProps; // Entity.toJSON takes care of auto-handled properties\r\n }\r\n /** The [[CodeSpec]] for ExternalSource elements is not automatically created, so this method ensures that it exists. */\r\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String {\r\n try {\r\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSource);\r\n return codeSpec.id;\r\n } catch (e) {\r\n return iModelDb.codeSpecs.insert(BisCodeSpec.externalSource, CodeScopeSpec.Type.Repository);\r\n }\r\n }\r\n /** Create a Code for an ExternalSource element given a name that is meant to be unique within the scope of the iModel.\r\n * @param iModelDb The IModelDb\r\n * @param codeValue The ExternalSource name\r\n * @see [[ensureCodeSpec]]\r\n */\r\n public static createCode(iModelDb: IModelDb, codeValue: string): Code {\r\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSource);\r\n return new Code({ spec: codeSpec.id, scope: IModel.rootSubjectId, value: codeValue });\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (this.repository)\r\n referenceIds.addElement(this.repository.id);\r\n }\r\n}\r\n\r\n/** Attachment of an ExternalSource\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceAttachment extends InformationReferenceElement {\r\n /** The [[ExternalSource]] that is attached by this ExternalSourceAttachment. */\r\n public attaches?: ExternalSourceAttachmentAttachesSource;\r\n /** Specifies whether the attached [[ExternalSource]] provides context or models a part of the whole. */\r\n public role?: ExternalSourceAttachmentRole;\r\n /** The translation or offset in global coordinates of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public translation?: Point3d;\r\n /** The Yaw angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public yaw?: number;\r\n /** The Pitch angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public pitch?: number;\r\n /** The Roll angle (in degrees) of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public roll?: number;\r\n /** The scale of the attached [[ExternalSource]] relative to the ExternalSource that attaches it. */\r\n public scale?: Point3d;\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSourceAttachment\"; }\r\n\r\n protected constructor(props: ExternalSourceAttachmentProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n if (props.attaches)\r\n this.attaches = new ExternalSourceAttachmentAttachesSource(RelatedElement.idFromJson(props.attaches));\r\n\r\n if (props.translation)\r\n this.translation = Point3d.fromJSON(props.translation);\r\n\r\n if (props.scale)\r\n this.scale = Point3d.fromJSON(props.scale);\r\n }\r\n\r\n public override toJSON(): ExternalSourceAttachmentProps { // This override only specializes the return type\r\n return super.toJSON() as ExternalSourceAttachmentProps; // Entity.toJSON takes care of auto-handled properties\r\n }\r\n /** The [[CodeSpec]] for ExternalSourceAttachment elements is not automatically created, so this method ensures that it exists. */\r\n public static ensureCodeSpec(iModelDb: IModelDb): Id64String {\r\n try {\r\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\r\n return codeSpec.id;\r\n } catch (e) {\r\n return iModelDb.codeSpecs.insert(BisCodeSpec.externalSourceAttachment, CodeScopeSpec.Type.ParentElement);\r\n }\r\n }\r\n /** Create a Code for an ExternalSourceAttachment element given a name that is meant to be unique within the scope of its parent [[ExternalSource]].\r\n * @param iModelDb The IModelDb\r\n * @param scopeElementId The parent ExternalSource\r\n * @param codeValue The ExternalSourceAttachment name\r\n * @see [[ensureCodeSpec]]\r\n */\r\n public static createCode(iModelDb: IModelDb, scopeElementId: Id64String, codeValue: string): Code {\r\n const codeSpec = iModelDb.codeSpecs.getByName(BisCodeSpec.externalSourceAttachment);\r\n return new Code({ spec: codeSpec.id, scope: scopeElementId, value: codeValue });\r\n }\r\n}\r\n\r\n/** A group of ExternalSources that are collectively a source of information for one or more elements.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class ExternalSourceGroup extends ExternalSource {\r\n /** @internal */\r\n public static override get className(): string { return \"ExternalSourceGroup\"; }\r\n\r\n protected constructor(props: ExternalSourceProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n}\r\n\r\n/** Link to the Configuration for an iModel Synchronization Job\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\r\n * @beta\r\n */\r\nexport class SynchronizationConfigLink extends UrlLink {\r\n /** Date/Time of last successful run of this synchronization configuration */\r\n public lastSuccessfulRun?: string;\r\n /** @internal */\r\n public static override get className(): string { return \"SynchronizationConfigLink\"; }\r\n\r\n protected constructor(props: SynchronizationConfigLinkProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n }\r\n\r\n public override toJSON(): SynchronizationConfigLinkProps { // This override only specializes the return type\r\n return super.toJSON() as SynchronizationConfigLinkProps; // Entity.toJSON takes care of auto-handled properties\r\n }\r\n}\r\n\r\n"]}
@@ -3,14 +3,16 @@
3
3
  */
4
4
  import { IModelJsNative } from "@bentley/imodeljs-native";
5
5
  import { AccessToken, BeEvent, DbResult, GuidString, Id64Arg, Id64Array, Id64Set, Id64String, IModelStatus, OpenMode } from "@itwin/core-bentley";
6
- import { AxisAlignedBox3d, BRepGeometryCreate, BriefcaseId, ChangesetIdWithIndex, Code, CodeProps, CreateEmptySnapshotIModelProps, CreateEmptyStandaloneIModelProps, CreateSnapshotIModelProps, EcefLocation, ECSchemaProps, ECSqlReader, ElementAspectProps, ElementGeometryRequest, ElementGraphicsRequestProps, ElementLoadProps, ElementProps, EntityMetaData, EntityProps, EntityQueryParams, FilePropertyProps, FontId, FontMap, FontType, GeoCoordinatesRequestProps, GeoCoordinatesResponseProps, GeometryContainmentRequestProps, GeometryContainmentResponseProps, IModel, IModelCoordinatesRequestProps, IModelCoordinatesResponseProps, IModelTileTreeProps, LocalFileName, MassPropertiesRequestProps, MassPropertiesResponseProps, ModelExtentsProps, ModelLoadProps, ModelProps, OpenBriefcaseProps, PropertyCallback, QueryBinder, QueryOptions, SchemaState, SnapRequestProps, SnapResponseProps, SnapshotOpenOptions, SubCategoryResultRow, TextureData, TextureLoadProps, ThumbnailProps, UpgradeOptions, ViewDefinitionProps, ViewQueryParams, ViewStateLoadProps, ViewStateProps } from "@itwin/core-common";
6
+ import { AxisAlignedBox3d, BRepGeometryCreate, BriefcaseId, ChangesetIdWithIndex, Code, CodeProps, CreateEmptySnapshotIModelProps, CreateEmptyStandaloneIModelProps, CreateSnapshotIModelProps, EcefLocation, ECSchemaProps, ECSqlReader, ElementAspectProps, ElementGeometryRequest, ElementGraphicsRequestProps, ElementLoadProps, ElementProps, EntityMetaData, EntityProps, EntityQueryParams, FilePropertyProps, FontId, FontMap, FontType, GeoCoordinatesRequestProps, GeoCoordinatesResponseProps, GeometryContainmentRequestProps, GeometryContainmentResponseProps, IModel, IModelCoordinatesRequestProps, IModelCoordinatesResponseProps, IModelTileTreeProps, LocalFileName, MassPropertiesRequestProps, MassPropertiesResponseProps, ModelExtentsProps, ModelLoadProps, ModelProps, OpenBriefcaseProps, PropertyCallback, QueryBinder, QueryOptions, SchemaState, SnapRequestProps, SnapResponseProps, SnapshotOpenOptions, SubCategoryResultRow, TextureData, TextureLoadProps, ThumbnailProps, UpgradeOptions, ViewDefinitionProps, ViewIdString, ViewQueryParams, ViewStateLoadProps, ViewStateProps } from "@itwin/core-common";
7
7
  import { Range3d } from "@itwin/core-geometry";
8
8
  import { PullChangesArgs, PushChangesArgs } from "./BriefcaseManager";
9
+ import { ChannelControl } from "./ChannelControl";
9
10
  import { CheckpointProps } from "./CheckpointManager";
10
11
  import { MetaDataRegistry } from "./ClassRegistry";
11
12
  import { CloudSqlite } from "./CloudSqlite";
12
13
  import { CodeService } from "./CodeService";
13
14
  import { CodeSpecs } from "./CodeSpecs";
15
+ import { ECSchemaXmlContext } from "./ECSchemaXmlContext";
14
16
  import { ECSqlStatement } from "./ECSqlStatement";
15
17
  import { Element, Subject } from "./Element";
16
18
  import { ElementAspect } from "./ElementAspect";
@@ -21,10 +23,10 @@ import { Relationships } from "./Relationship";
21
23
  import { SqliteStatement } from "./SqliteStatement";
22
24
  import { TxnManager } from "./TxnManager";
23
25
  import { ViewDefinition } from "./ViewDefinition";
26
+ import { ViewStore } from "./ViewStore";
24
27
  import { SettingDictionary } from "./workspace/Settings";
25
28
  import { Workspace } from "./workspace/Workspace";
26
- import { ECSchemaXmlContext } from "./ECSchemaXmlContext";
27
- import { ChannelControl } from "./ChannelControl";
29
+ import type { BlobContainer } from "./BlobContainerService";
28
30
  /** Options for [[IModelDb.Models.updateModel]]
29
31
  * @note To mark *only* the geometry as changed, use [[IModelDb.Models.updateGeometryGuid]] instead.
30
32
  * @public
@@ -242,9 +244,7 @@ export declare abstract class IModelDb extends IModel {
242
244
  * @internal
243
245
  */
244
246
  get isStandalone(): boolean;
245
- /** Type guard for instanceof [[StandaloneDb]]
246
- * @internal
247
- */
247
+ /** Type guard for instanceof [[StandaloneDb]]. */
248
248
  isStandaloneDb(): this is StandaloneDb;
249
249
  /** Return `true` if the underlying nativeDb is open and valid.
250
250
  * @internal
@@ -279,6 +279,12 @@ export declare abstract class IModelDb extends IModel {
279
279
  */
280
280
  withStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T, logErrors?: boolean): T;
281
281
  /** Allow to execute query and read results along with meta data. The result are streamed.
282
+ *
283
+ * See also:
284
+ * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL)
285
+ * - [Code Examples]($docs/learning/backend/ECSQLCodeExamples)
286
+ * - [ECSQL Row Format]($docs/learning/ECSQLRowFormat)
287
+ *
282
288
  * @param params The values to bind to the parameters (if the ECSQL has any).
283
289
  * @param config Allow to specify certain flags which control how query is executed.
284
290
  * @returns Returns an [ECSqlReader]($common) which helps iterate over the result set and also give access to metadata.
@@ -478,7 +484,7 @@ export declare abstract class IModelDb extends IModel {
478
484
  * @see ($docs/learning/backend/IModelDb.md#upgrading-schemas-in-an-imodel)
479
485
  */
480
486
  static validateSchemas(filePath: LocalFileName, forReadWrite: boolean): SchemaState;
481
- /** Get the ClassMetaDataRegistry for this iModel.
487
+ /** The registry of entity metadata for this iModel.
482
488
  * @internal
483
489
  */
484
490
  get classMetaDataRegistry(): MetaDataRegistry;
@@ -500,7 +506,7 @@ export declare abstract class IModelDb extends IModel {
500
506
  /** Construct an entity (Element or Model) from an iModel.
501
507
  * @throws [[IModelError]] if the entity cannot be constructed.
502
508
  */
503
- constructEntity<T extends Entity>(props: EntityProps): T;
509
+ constructEntity<T extends Entity, P extends EntityProps = EntityProps>(props: P): T;
504
510
  /** Get the JavaScript class that handles a given entity class. */
505
511
  getJsClass<T extends typeof Entity>(classFullName: string): T;
506
512
  /** Get metadata for a class. This method will load the metadata from the iModel into the cache as a side-effect, if necessary.
@@ -633,7 +639,7 @@ export declare abstract class IModelDb extends IModel {
633
639
  exportPartGraphics(exportProps: ExportPartGraphicsOptions): DbResult;
634
640
  /** Request geometry stream information from an element in binary format instead of json.
635
641
  * @returns IModelStatus.Success if successful
636
- * @alpha
642
+ * @beta
637
643
  */
638
644
  elementGeometryRequest(requestProps: ElementGeometryRequest): IModelStatus;
639
645
  /** Create brep geometry for inclusion in an element's geometry stream.
@@ -685,8 +691,9 @@ export declare namespace IModelDb {
685
691
  * @see getModelProps
686
692
  */
687
693
  tryGetModelProps<T extends ModelProps>(id: Id64String): T | undefined;
688
- /** Query for the last modified time of the specified Model.
689
- * @internal
694
+ /** Query for the last modified time for a [[Model]].
695
+ * @param modelId The Id of the model.
696
+ * @throws IModelError if `modelId` does not identify a model in the iModel.
690
697
  */
691
698
  queryLastModifiedTime(modelId: Id64String): string;
692
699
  /** Get the Model with the specified identifier.
@@ -780,13 +787,19 @@ export declare namespace IModelDb {
780
787
  */
781
788
  queryRange(ids: Id64String | Id64String[]): Promise<AxisAlignedBox3d>;
782
789
  }
790
+ interface GuidMapper {
791
+ getFederationGuidFromId(id: Id64String): GuidString | undefined;
792
+ getIdFromFederationGuid(guid?: GuidString): Id64String | undefined;
793
+ }
783
794
  /** The collection of elements in an [[IModelDb]].
784
795
  * @public
785
796
  */
786
- class Elements {
797
+ class Elements implements GuidMapper {
787
798
  private _iModel;
788
799
  /** @internal */
789
800
  constructor(_iModel: IModelDb);
801
+ getFederationGuidFromId(id: Id64String): GuidString | undefined;
802
+ getIdFromFederationGuid(guid?: GuidString): Id64String | undefined;
790
803
  /** Read element data from the iModel as JSON
791
804
  * @param elementIdArg a json string with the identity of the element to load. Must have one of "id", "federationGuid", or "code".
792
805
  * @returns The JSON properties of the element.
@@ -842,8 +855,9 @@ export declare namespace IModelDb {
842
855
  * @throws IModelError if the code is invalid
843
856
  */
844
857
  queryElementIdByCode(code: Required<CodeProps>): Id64String | undefined;
845
- /** Query for the last modified time of the specified element.
846
- * @internal
858
+ /** Query for an [[Element]]'s last modified time.
859
+ * @param elementId The Id of the element.
860
+ * @throws IModelError if `elementId` does not identify an element in the iModel.
847
861
  */
848
862
  queryLastModifiedTime(elementId: Id64String): string;
849
863
  /** Create a new instance of an element.
@@ -949,6 +963,20 @@ export declare namespace IModelDb {
949
963
  private _iModel;
950
964
  /** @internal */
951
965
  constructor(_iModel: IModelDb);
966
+ private static viewStoreProperty;
967
+ private _viewStore?;
968
+ get hasViewStore(): boolean;
969
+ /** @beta */
970
+ get viewStore(): ViewStore.CloudAccess;
971
+ set viewStore(viewStore: ViewStore.CloudAccess);
972
+ /** @beta */
973
+ accessViewStore(args: {
974
+ userToken?: AccessToken;
975
+ props?: CloudSqlite.ContainerProps;
976
+ accessLevel?: BlobContainer.RequestAccessLevel;
977
+ }): Promise<ViewStore.CloudAccess>;
978
+ /** @beta */
979
+ saveDefaultViewStore(arg: CloudSqlite.ContainerProps): void;
952
980
  /** Query for the array of ViewDefinitionProps of the specified class and matching the specified IsPrivate setting.
953
981
  * @param className Query for view definitions of this class.
954
982
  * @param wantPrivate If true, include private view definitions.
@@ -960,18 +988,13 @@ export declare namespace IModelDb {
960
988
  * @param params Specifies the query by which views are selected.
961
989
  * @param callback Function invoked for each ViewDefinition matching the query. Return false to terminate iteration, true to continue.
962
990
  * @returns true if all views were iterated, false if iteration was terminated early due to callback returning false.
963
- *
964
- * **Example: Finding all views of a specific DrawingModel**
965
- * ``` ts
966
- * [[include:IModelDb.Views.iterateViews]]
967
- * ```
968
991
  */
969
992
  iterateViews(params: ViewQueryParams, callback: (view: ViewDefinition) => boolean): boolean;
970
- private loadViewStateProps;
993
+ private loadViewData;
971
994
  /** @deprecated in 3.x. use [[getViewStateProps]]. */
972
- getViewStateData(viewDefinitionId: string, options?: ViewStateLoadProps): ViewStateProps;
973
- /** Obtain a [ViewStateProps]($common) for a [[ViewDefinition]] specified by element Id. */
974
- getViewStateProps(viewDefinitionId: string, options?: ViewStateLoadProps): Promise<ViewStateProps>;
995
+ getViewStateData(viewDefinitionId: ViewIdString, options?: ViewStateLoadProps): ViewStateProps;
996
+ /** Obtain a [ViewStateProps]($common) for a [[ViewDefinition]] specified by ViewIdString. */
997
+ getViewStateProps(viewDefinitionId: ViewIdString, options?: ViewStateLoadProps): Promise<ViewStateProps>;
975
998
  private getViewThumbnailArg;
976
999
  /** Get the thumbnail for a view.
977
1000
  * @param viewDefinitionId The Id of the view for thumbnail
@@ -990,9 +1013,9 @@ export declare namespace IModelDb {
990
1013
  setDefaultViewId(viewId: Id64String): void;
991
1014
  }
992
1015
  /** Represents the current state of a pollable tile content request.
993
- * Note: lack of a "completed" state because polling a completed request returns the content as a Uint8Array.
994
- * @internal
995
- */
1016
+ * Note: lack of a "completed" state because polling a completed request returns the content as a Uint8Array.
1017
+ * @internal
1018
+ */
996
1019
  enum TileContentState {
997
1020
  New = 0,
998
1021
  Pending = 1,
@@ -1067,6 +1090,8 @@ export declare class BriefcaseDb extends IModelDb {
1067
1090
  * ```
1068
1091
  */
1069
1092
  static readonly onOpened: BeEvent<(_iModelDb: BriefcaseDb, _args: OpenBriefcaseArgs) => void>;
1093
+ /** Event raised after a BriefcaseDb has been closed. */
1094
+ readonly onClosed: BeEvent<() => void>;
1070
1095
  /** @alpha */
1071
1096
  static readonly onCodeServiceCreated: BeEvent<(briefcase: BriefcaseDb) => void>;
1072
1097
  static findByKey(key: string): BriefcaseDb;
@@ -1110,6 +1135,7 @@ export declare class BriefcaseDb extends IModelDb {
1110
1135
  pullChanges(arg?: PullChangesArgs): Promise<void>;
1111
1136
  /** Push changes to iModelHub. */
1112
1137
  pushChanges(arg: PushChangesArgs): Promise<void>;
1138
+ close(): void;
1113
1139
  }
1114
1140
  /** A *snapshot* iModel database file that is used for archival and data transfer purposes.
1115
1141
  * @see [Snapshot iModels]($docs/learning/backend/AccessingIModels.md#snapshot-imodels)
@@ -1120,6 +1146,8 @@ export declare class SnapshotDb extends IModelDb {
1120
1146
  get isSnapshot(): boolean;
1121
1147
  private _refreshSas;
1122
1148
  private _createClassViewsOnClose?;
1149
+ static readonly onOpen: BeEvent<(path: LocalFileName, opts?: SnapshotDbOpenArgs) => void>;
1150
+ static readonly onOpened: BeEvent<(_iModelDb: SnapshotDb) => void>;
1123
1151
  private constructor();
1124
1152
  static findByKey(key: string): SnapshotDb;
1125
1153
  static tryFindByKey(key: string): SnapshotDb | undefined;
@@ -1212,6 +1240,13 @@ export declare class StandaloneDb extends BriefcaseDb {
1212
1240
  * @see [[StandaloneDb.validateSchemas]]
1213
1241
  */
1214
1242
  static upgradeStandaloneSchemas(filePath: LocalFileName): void;
1243
+ /** Creates or updates views in the iModel to permit visualizing the EC content as ECClasses and ECProperties rather than raw database tables and columns.
1244
+ * This can be helpful when debugging the EC data, especially when the raw tables make use of shared columns or spread data across multiple tables.
1245
+ * @throws IModelError if view creation failed.
1246
+ * @note The views are strictly intended for developers and debugging purposes only - they should not be used in application code.
1247
+ * @beta
1248
+ */
1249
+ createClassViews(): void;
1215
1250
  /** Open a standalone iModel file.
1216
1251
  * @param filePath The path of the standalone iModel file.
1217
1252
  * @param openMode Optional open mode for the standalone iModel. The default is read/write.