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

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 (181) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/lib/cjs/BackendHubAccess.js +1 -1
  3. package/lib/cjs/BackendHubAccess.js.map +1 -1
  4. package/lib/cjs/BackendLoggerCategory.d.ts +0 -5
  5. package/lib/cjs/BackendLoggerCategory.d.ts.map +1 -1
  6. package/lib/cjs/BackendLoggerCategory.js +1 -6
  7. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  8. package/lib/cjs/BisCoreSchema.d.ts.map +1 -1
  9. package/lib/cjs/BisCoreSchema.js +2 -0
  10. package/lib/cjs/BisCoreSchema.js.map +1 -1
  11. package/lib/cjs/BlobContainerService.js +1 -1
  12. package/lib/cjs/BlobContainerService.js.map +1 -1
  13. package/lib/cjs/BriefcaseManager.js +2 -2
  14. package/lib/cjs/BriefcaseManager.js.map +1 -1
  15. package/lib/cjs/Category.d.ts +1 -1
  16. package/lib/cjs/Category.js +1 -1
  17. package/lib/cjs/Category.js.map +1 -1
  18. package/lib/cjs/ChangeSummaryManager.js +3 -3
  19. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  20. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  21. package/lib/cjs/ChangedElementsManager.js.map +1 -1
  22. package/lib/cjs/ChangesetECAdaptor.js +239 -239
  23. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  24. package/lib/cjs/ChannelControl.js +2 -2
  25. package/lib/cjs/ChannelControl.js.map +1 -1
  26. package/lib/cjs/CheckpointManager.js +4 -4
  27. package/lib/cjs/CheckpointManager.js.map +1 -1
  28. package/lib/cjs/ClassRegistry.d.ts +3 -0
  29. package/lib/cjs/ClassRegistry.d.ts.map +1 -1
  30. package/lib/cjs/ClassRegistry.js +24 -13
  31. package/lib/cjs/ClassRegistry.js.map +1 -1
  32. package/lib/cjs/CloudSqlite.js +1 -1
  33. package/lib/cjs/CloudSqlite.js.map +1 -1
  34. package/lib/cjs/CodeService.js +1 -1
  35. package/lib/cjs/CodeService.js.map +1 -1
  36. package/lib/cjs/CodeSpecs.js +1 -1
  37. package/lib/cjs/CodeSpecs.js.map +1 -1
  38. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  39. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  40. package/lib/cjs/DevTools.js +2 -2
  41. package/lib/cjs/DevTools.js.map +1 -1
  42. package/lib/cjs/DisplayStyle.js.map +1 -1
  43. package/lib/cjs/ECDb.js +1 -1
  44. package/lib/cjs/ECDb.js.map +1 -1
  45. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  46. package/lib/cjs/ECSqlStatement.js.map +1 -1
  47. package/lib/cjs/Element.d.ts +0 -16
  48. package/lib/cjs/Element.d.ts.map +1 -1
  49. package/lib/cjs/Element.js +7 -23
  50. package/lib/cjs/Element.js.map +1 -1
  51. package/lib/cjs/ElementAspect.js +1 -1
  52. package/lib/cjs/ElementAspect.js.map +1 -1
  53. package/lib/cjs/ElementGraphics.d.ts +0 -3
  54. package/lib/cjs/ElementGraphics.d.ts.map +1 -1
  55. package/lib/cjs/ElementGraphics.js +2 -5
  56. package/lib/cjs/ElementGraphics.js.map +1 -1
  57. package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
  58. package/lib/cjs/ElementTreeWalker.js +5 -0
  59. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  60. package/lib/cjs/Entity.js.map +1 -1
  61. package/lib/cjs/EntityReferences.js +1 -1
  62. package/lib/cjs/EntityReferences.js.map +1 -1
  63. package/lib/cjs/ExportGraphics.d.ts +1 -1
  64. package/lib/cjs/ExportGraphics.js +2 -2
  65. package/lib/cjs/ExportGraphics.js.map +1 -1
  66. package/lib/cjs/ExternalSource.js.map +1 -1
  67. package/lib/cjs/GeoCoordConfig.js +1 -1
  68. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  69. package/lib/cjs/GeometrySummary.js +47 -47
  70. package/lib/cjs/GeometrySummary.js.map +1 -1
  71. package/lib/cjs/HubMock.js +1 -1
  72. package/lib/cjs/HubMock.js.map +1 -1
  73. package/lib/cjs/IModelCloneContext.js.map +1 -1
  74. package/lib/cjs/IModelDb.d.ts +8 -2
  75. package/lib/cjs/IModelDb.d.ts.map +1 -1
  76. package/lib/cjs/IModelDb.js +70 -29
  77. package/lib/cjs/IModelDb.js.map +1 -1
  78. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  79. package/lib/cjs/IModelHost.js +2 -2
  80. package/lib/cjs/IModelHost.js.map +1 -1
  81. package/lib/cjs/IModelJsFs.js.map +1 -1
  82. package/lib/cjs/IpcHost.js +1 -1
  83. package/lib/cjs/IpcHost.js.map +1 -1
  84. package/lib/cjs/LineStyle.d.ts +1 -1
  85. package/lib/cjs/LineStyle.js +2 -2
  86. package/lib/cjs/LineStyle.js.map +1 -1
  87. package/lib/cjs/LocalHub.js +1 -1
  88. package/lib/cjs/LocalHub.js.map +1 -1
  89. package/lib/cjs/LocalhostIpcHost.js +1 -1
  90. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  91. package/lib/cjs/Material.js +1 -1
  92. package/lib/cjs/Material.js.map +1 -1
  93. package/lib/cjs/Model.js.map +1 -1
  94. package/lib/cjs/NativeAppStorage.js +1 -1
  95. package/lib/cjs/NativeAppStorage.js.map +1 -1
  96. package/lib/cjs/NativeHost.js +1 -1
  97. package/lib/cjs/NativeHost.js.map +1 -1
  98. package/lib/cjs/NavigationRelationship.js +21 -21
  99. package/lib/cjs/NavigationRelationship.js.map +1 -1
  100. package/lib/cjs/PromiseMemoizer.d.ts +0 -3
  101. package/lib/cjs/PromiseMemoizer.d.ts.map +1 -1
  102. package/lib/cjs/PromiseMemoizer.js +2 -5
  103. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  104. package/lib/cjs/PropertyStore.js +1 -1
  105. package/lib/cjs/PropertyStore.js.map +1 -1
  106. package/lib/cjs/Relationship.js.map +1 -1
  107. package/lib/cjs/RpcBackend.js.map +1 -1
  108. package/lib/cjs/SQLiteDb.js +2 -2
  109. package/lib/cjs/SQLiteDb.js.map +1 -1
  110. package/lib/cjs/Schema.js +1 -1
  111. package/lib/cjs/Schema.js.map +1 -1
  112. package/lib/cjs/SchemaSync.js +1 -1
  113. package/lib/cjs/SchemaSync.js.map +1 -1
  114. package/lib/cjs/SchemaUtils.js.map +1 -1
  115. package/lib/cjs/ServerBasedLocks.js.map +1 -1
  116. package/lib/cjs/SqliteChangesetReader.js.map +1 -1
  117. package/lib/cjs/SqliteStatement.js +2 -2
  118. package/lib/cjs/SqliteStatement.js.map +1 -1
  119. package/lib/cjs/TextAnnotationElement.d.ts +54 -0
  120. package/lib/cjs/TextAnnotationElement.d.ts.map +1 -0
  121. package/lib/cjs/TextAnnotationElement.js +94 -0
  122. package/lib/cjs/TextAnnotationElement.js.map +1 -0
  123. package/lib/cjs/TextAnnotationGeometry.d.ts +28 -0
  124. package/lib/cjs/TextAnnotationGeometry.d.ts.map +1 -0
  125. package/lib/cjs/TextAnnotationGeometry.js +154 -0
  126. package/lib/cjs/TextAnnotationGeometry.js.map +1 -0
  127. package/lib/cjs/TextAnnotationLayout.d.ts +124 -0
  128. package/lib/cjs/TextAnnotationLayout.d.ts.map +1 -0
  129. package/lib/cjs/TextAnnotationLayout.js +399 -0
  130. package/lib/cjs/TextAnnotationLayout.js.map +1 -0
  131. package/lib/cjs/Texture.js.map +1 -1
  132. package/lib/cjs/TileStorage.js.map +1 -1
  133. package/lib/cjs/TxnManager.d.ts.map +1 -1
  134. package/lib/cjs/TxnManager.js +53 -1
  135. package/lib/cjs/TxnManager.js.map +1 -1
  136. package/lib/cjs/ViewDefinition.js +4 -4
  137. package/lib/cjs/ViewDefinition.js.map +1 -1
  138. package/lib/cjs/ViewStateHydrator.d.ts +1 -0
  139. package/lib/cjs/ViewStateHydrator.d.ts.map +1 -1
  140. package/lib/cjs/ViewStateHydrator.js +1 -0
  141. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  142. package/lib/cjs/ViewStore.js +1 -1
  143. package/lib/cjs/ViewStore.js.map +1 -1
  144. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  145. package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +44 -44
  146. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
  147. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
  148. package/lib/cjs/assets/Settings/backend.setting.json5 +132 -132
  149. package/lib/cjs/core-backend.d.ts +46 -61
  150. package/lib/cjs/core-backend.d.ts.map +1 -1
  151. package/lib/cjs/core-backend.js +46 -61
  152. package/lib/cjs/core-backend.js.map +1 -1
  153. package/lib/cjs/domains/FunctionalElements.js +1 -1
  154. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  155. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  156. package/lib/cjs/domains/GenericElements.js.map +1 -1
  157. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  158. package/lib/cjs/rpc/multipart.js.map +1 -1
  159. package/lib/cjs/rpc/tracing.js +2 -2
  160. package/lib/cjs/rpc/tracing.js.map +1 -1
  161. package/lib/cjs/rpc/web/logging.js +2 -2
  162. package/lib/cjs/rpc/web/logging.js.map +1 -1
  163. package/lib/cjs/rpc/web/request.js.map +1 -1
  164. package/lib/cjs/rpc/web/response.js +1 -1
  165. package/lib/cjs/rpc/web/response.js.map +1 -1
  166. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  167. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  168. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  169. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +1 -1
  170. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  171. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  172. package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
  173. package/lib/cjs/workspace/Settings.js +1 -1
  174. package/lib/cjs/workspace/Settings.js.map +1 -1
  175. package/lib/cjs/workspace/SettingsSchemas.d.ts +0 -5
  176. package/lib/cjs/workspace/SettingsSchemas.d.ts.map +1 -1
  177. package/lib/cjs/workspace/SettingsSchemas.js +1 -10
  178. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  179. package/lib/cjs/workspace/Workspace.js +4 -4
  180. package/lib/cjs/workspace/Workspace.js.map +1 -1
  181. package/package.json +14 -14
@@ -1 +1 @@
1
- {"version":3,"file":"Model.js","sourceRoot":"","sources":["../../src/Model.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,qBAAqB;AAErB,sDAAwE;AACxE,wDAAwD;AACxD,oDAG4B;AAC5B,uCAA4I;AAC5I,qCAAkC;AAElC,qEAAwE;AA0CxE;;;;GAIG;AACH,MAAa,KAAM,SAAQ,eAAM;IAC/B,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,OAAO,CAAC,CAAC,CAAC;IAClE,gBAAgB;IACT,MAAM,KAAc,mBAAmB,KAAK,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAQjG,YAAsB,KAAiB,EAAE,MAAgB;QACvD,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,8IAA8I;QACxL,IAAI,CAAC,SAAS,GAAG,wBAAS,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACnD,IAAI,CAAC,UAAU,GAAG,wBAAS,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACrD,IAAI,CAAC,cAAc,GAAG,EAAE,GAAG,KAA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AiB,CAAC,UAAU,CAAC,QAAQ,EAAE,eAAe,EAAE,IAAI,CAAC;SACpE,CAAC;QACF,MAAM,WAAW,GAAe,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC;QAChF,OAAO,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC;YACjC,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,cAAc,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE;SACpC,CAAC,CAAC;IACL,CAAC;CACF;AAvBD,8CAuBC;AAED;;;GAGG;AACH,MAAa,SAAU,SAAQ,gBAAgB;IAC7C,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,WAAW,CAAC,CAAC,CAAC;CACvE;AAHD,8BAGC;AAED;;GAEG;AACH,MAAa,eAAgB,SAAQ,eAAe;IAClD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,iBAAiB,CAAC,CAAC,CAAC;CAC7E;AAHD,0CAGC;AAED;;GAEG;AACH,MAAa,gBAAiB,SAAQ,YAAY;IAChD,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,kBAAkB,CAAC,CAAC,CAAC;CAC9E;AAHD,4CAGC","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 Models\r\n */\r\n\r\n// cspell:ignore elid\r\n\r\nimport { GuidString, Id64String, JsonUtils } from \"@itwin/core-bentley\";\r\nimport { Point2d, Range3d } from \"@itwin/core-geometry\";\r\nimport {\r\n AxisAlignedBox3d, ElementProps, EntityReferenceSet, GeometricModel2dProps, GeometricModel3dProps, GeometricModelProps, IModel,\r\n InformationPartitionElementProps, ModelProps, RelatedElement,\r\n} from \"@itwin/core-common\";\r\nimport { DefinitionPartition, DocumentPartition, InformationRecordPartition, PhysicalPartition, SpatialLocationPartition } from \"./Element\";\r\nimport { Entity } from \"./Entity\";\r\nimport { IModelDb } from \"./IModelDb\";\r\nimport { SubjectOwnsPartitionElements } from \"./NavigationRelationship\";\r\n\r\n/** Argument for the `Model.onXxx` static methods\r\n * @beta\r\n */\r\nexport interface OnModelArg {\r\n /** The iModel for the Model affected. */\r\n iModel: IModelDb;\r\n}\r\n\r\n/** Argument for the `Model.onXxx` static methods that supply the properties of a Model to be inserted or updated.\r\n * @beta\r\n */\r\nexport interface OnModelPropsArg extends OnModelArg {\r\n /** The new properties of the Model affected. */\r\n props: Readonly<ModelProps>;\r\n}\r\n\r\n/** Argument for the `Model.onXxx` static methods that only supply the Id of the affected Model.\r\n * @beta\r\n */\r\nexport interface OnModelIdArg extends OnModelArg {\r\n /** The Id of the Model affected */\r\n id: Id64String;\r\n}\r\n\r\n/** Argument for the `Model.onXxxElement` static methods that supply the properties of an Element for a Model.\r\n * @beta\r\n */\r\nexport interface OnElementInModelPropsArg extends OnModelIdArg {\r\n /** The new properties of an Element for the affected Model */\r\n elementProps: Readonly<ElementProps>;\r\n}\r\n\r\n/** Argument for the `Model.onXxxElement` static methods that supply the Id of an Element for a Model.\r\n * @beta\r\n */\r\nexport interface OnElementInModelIdArg extends OnModelIdArg {\r\n /** The Id of the Element for the affected Model */\r\n elementId: Id64String;\r\n}\r\n\r\n/** A Model is a container for persisting a collection of related elements within an iModel.\r\n * See [[IModelDb.Models]] for how to query and manage the Models in an IModelDb.\r\n * See [Creating models]($docs/learning/backend/CreateModels.md)\r\n * @public\r\n */\r\nexport class Model extends Entity {\r\n /** @internal */\r\n public static override get className(): string { return \"Model\"; }\r\n /** @internal */\r\n public static override get protectedOperations() { return [\"onInsert\", \"onUpdate\", \"onDelete\"]; }\r\n public readonly modeledElement!: RelatedElement;\r\n public readonly name: string;\r\n public readonly parentModel!: Id64String;\r\n public readonly jsonProperties: { [key: string]: any };\r\n public isPrivate: boolean;\r\n public isTemplate: boolean;\r\n\r\n protected constructor(props: ModelProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.name = props.name ? props.name : \"\"; // NB this isn't really a property of Model (it's the code.value of the modeled element), but it comes in ModelProps because it's often needed\r\n this.isPrivate = JsonUtils.asBool(props.isPrivate);\r\n this.isTemplate = JsonUtils.asBool(props.isTemplate);\r\n this.jsonProperties = { ...props.jsonProperties }; // make sure we have our own copy\r\n }\r\n\r\n public override toJSON(): ModelProps {\r\n const val = super.toJSON() as ModelProps;\r\n val.name = this.name; // for cloning\r\n return val;\r\n }\r\n\r\n /** Called before a new Model is inserted.\r\n * @note throw an exception to disallow the insert\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model to be inserted\r\n * @beta\r\n */\r\n protected static onInsert(arg: OnModelPropsArg): void {\r\n const { props, iModel } = arg;\r\n iModel.channels.verifyChannel(props.modeledElement.id);\r\n if (props.parentModel) // inserting requires shared lock on parent, if present\r\n iModel.locks.checkSharedLock(props.parentModel, \"parent model\", \"insert\");\r\n }\r\n\r\n /** Called after a new Model is inserted.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model that was inserted\r\n * @beta\r\n */\r\n protected static onInserted(_arg: OnModelIdArg): void {\r\n // we don't need to tell LockControl about models being created - their ModeledElement does that\r\n }\r\n\r\n /** Called before a Model is updated.\r\n * @note throw an exception to disallow the update\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model to be updated\r\n * @beta\r\n */\r\n protected static onUpdate(arg: OnModelPropsArg): void {\r\n const id = arg.props.id!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n arg.iModel.channels.verifyChannel(id);\r\n arg.iModel.locks.checkExclusiveLock(id, \"model\", \"update\");\r\n }\r\n\r\n /** Called after a Model is updated.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model that was updated.\r\n * @beta\r\n */\r\n protected static onUpdated(_arg: OnModelIdArg): void {\r\n }\r\n\r\n /** Called before a Model is deleted.\r\n * @note throw an exception to disallow the delete\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model to be deleted\r\n * @beta\r\n */\r\n protected static onDelete(arg: OnModelIdArg): void {\r\n arg.iModel.channels.verifyChannel(arg.id);\r\n arg.iModel.locks.checkExclusiveLock(arg.id, \"model\", \"delete\");\r\n }\r\n\r\n /** Called after a Model was deleted.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model that was deleted\r\n * @beta\r\n */\r\n protected static onDeleted(_arg: OnModelIdArg): void { }\r\n\r\n /** Called before a prospective Element is to be inserted into an instance of a Model of this class.\r\n * @note throw an exception to disallow the insert\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model to hold the element\r\n * @beta\r\n */\r\n protected static onInsertElement(_arg: OnElementInModelPropsArg): void { }\r\n\r\n /** Called after an Element has been inserted into an instance of a Model of this class.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model holding the element\r\n * @beta\r\n */\r\n protected static onInsertedElement(_arg: OnElementInModelIdArg): void { }\r\n\r\n /** Called when an Element in an instance of a Model of this class is about to be updated.\r\n * @note throw an exception to disallow the update\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model holding the element\r\n * @beta\r\n */\r\n protected static onUpdateElement(_arg: OnElementInModelPropsArg): void { }\r\n\r\n /** Called after an Element in an instance of a Model of this class has been updated.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model holding the element\r\n * @beta\r\n */\r\n protected static onUpdatedElement(_arg: OnElementInModelIdArg): void { }\r\n\r\n /** Called when an Element in an instance of a Model of this class is about to be deleted.\r\n * @note throw an exception to disallow the delete\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model holding the element\r\n * @beta\r\n */\r\n protected static onDeleteElement(_arg: OnElementInModelIdArg): void { }\r\n\r\n /** Called after an Element in an instance of a Model of this class has been deleted.\r\n * @note If you override this method, you must call super.\r\n * @note `this` is the class of the Model that held the element\r\n * @beta\r\n */\r\n protected static onDeletedElement(_arg: OnElementInModelIdArg): void { }\r\n\r\n private getAllUserProperties(): any {\r\n if (!this.jsonProperties.UserProps)\r\n this.jsonProperties.UserProps = new Object();\r\n\r\n return this.jsonProperties.UserProps;\r\n }\r\n\r\n /** Get a set of JSON user properties by namespace */\r\n public getUserProperties(namespace: string) { return this.getAllUserProperties()[namespace]; }\r\n\r\n /** Change a set of user JSON properties of this Element by namespace. */\r\n public setUserProperties(nameSpace: string, value: any) { this.getAllUserProperties()[nameSpace] = value; }\r\n\r\n /** Remove a set of JSON user properties, specified by namespace, from this Element */\r\n public removeUserProperties(nameSpace: string) { delete this.getAllUserProperties()[nameSpace]; }\r\n\r\n public getJsonProperty(name: string): any { return this.jsonProperties[name]; }\r\n public setJsonProperty(name: string, value: any) { this.jsonProperties[name] = value; }\r\n\r\n /** Insert this Model in the iModel */\r\n public insert() { return this.id = this.iModel.models.insertModel(this.toJSON()); }\r\n /** Update this Model in the iModel. */\r\n public update() { this.iModel.models.updateModel(this.toJSON()); }\r\n /** Delete this Model from the iModel. */\r\n public delete() { this.iModel.models.deleteModel(this.id); }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n if (this.parentModel)\r\n referenceIds.addModel(this.parentModel);\r\n referenceIds.addElement(this.modeledElement.id);\r\n }\r\n}\r\n\r\n/** A container for persisting geometric elements.\r\n * @public\r\n */\r\nexport class GeometricModel extends Model {\r\n public geometryGuid?: GuidString; // Initialized by the Entity constructor\r\n\r\n /** @internal */\r\n public static override get className(): string { return \"GeometricModel\"; }\r\n\r\n protected constructor(props: GeometricModelProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n /** Query for the union of the extents of the elements contained by this model.\r\n * @note This function blocks the JavaScript event loop. Consider using [[queryRange]] instead.\r\n */\r\n public queryExtents(): AxisAlignedBox3d {\r\n const extents = this.iModel.nativeDb.queryModelExtents({ id: this.id }).modelExtents;\r\n return Range3d.fromJSON(extents);\r\n }\r\n\r\n /** Query for the union of the extents of all elements contained within this model. */\r\n public async queryRange(): Promise<AxisAlignedBox3d> {\r\n return this.iModel.models.queryRange(this.id);\r\n }\r\n}\r\n\r\n/** A container for persisting 3d geometric elements.\r\n * @public\r\n */\r\nexport abstract class GeometricModel3d extends GeometricModel {\r\n /** If true, then the elements in this GeometricModel3d are expected to be in an XY plane.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isPlanProjection: boolean;\r\n /** If true, then the elements in this GeometricModel3d are not in real-world coordinates and will not be in the spatial index.\r\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\r\n */\r\n public readonly isNotSpatiallyLocated: boolean;\r\n /** If true, then the elements in this GeometricModel3d are in real-world coordinates and will be in the spatial index. */\r\n public get isSpatiallyLocated(): boolean { return !this.isNotSpatiallyLocated; }\r\n\r\n /** @internal */\r\n public static override get className(): string { return \"GeometricModel3d\"; }\r\n\r\n protected constructor(props: GeometricModel3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.isNotSpatiallyLocated = JsonUtils.asBool(props.isNotSpatiallyLocated);\r\n this.isPlanProjection = JsonUtils.asBool(props.isPlanProjection);\r\n }\r\n\r\n public override toJSON(): GeometricModel3dProps {\r\n const val = super.toJSON() as GeometricModel3dProps;\r\n if (this.isNotSpatiallyLocated)\r\n val.isNotSpatiallyLocated = true;\r\n\r\n if (this.isPlanProjection)\r\n val.isPlanProjection = true;\r\n\r\n return val;\r\n }\r\n}\r\n\r\n/** A container for persisting 2d geometric elements.\r\n * @public\r\n */\r\nexport abstract class GeometricModel2d extends GeometricModel {\r\n /** The actual coordinates of (0,0) in modeling coordinates. An offset applied to all modeling coordinates. */\r\n public globalOrigin?: Point2d; // Initialized by the Entity constructor\r\n /** @internal */\r\n public static override get className(): string { return \"GeometricModel2d\"; }\r\n\r\n protected constructor(props: GeometricModel2dProps, iModel: IModelDb) { super(props, iModel); }\r\n\r\n public override toJSON(): GeometricModel2dProps {\r\n const val = super.toJSON() as GeometricModel2dProps;\r\n if (undefined !== this.globalOrigin)\r\n val.globalOrigin = Point2d.fromJSON(this.globalOrigin);\r\n\r\n return val;\r\n }\r\n}\r\n\r\n/** A container for persisting 2d graphical elements.\r\n * @public\r\n */\r\nexport abstract class GraphicalModel2d extends GeometricModel2d {\r\n /** @internal */\r\n public static override get className(): string { return \"GraphicalModel2d\"; }\r\n}\r\n\r\n/** A container for persisting GraphicalElement3d instances.\r\n * @note The associated ECClass was added to the BisCore schema in version 1.0.8\r\n * @see [[GraphicalPartition3d]]\r\n * @public\r\n */\r\nexport abstract class GraphicalModel3d extends GeometricModel3d {\r\n /** @internal */\r\n public static override get className(): string { return \"GraphicalModel3d\"; }\r\n}\r\n\r\n/** A container for persisting 3d geometric elements that are spatially located.\r\n * @public\r\n */\r\nexport abstract class SpatialModel extends GeometricModel3d {\r\n /** @internal */\r\n public static override get className(): string { return \"SpatialModel\"; }\r\n}\r\n\r\n/** A container for persisting physical elements that model physical space.\r\n * @see [[PhysicalPartition]]\r\n * @public\r\n */\r\nexport class PhysicalModel extends SpatialModel {\r\n /** @internal */\r\n public static override get className(): string { return \"PhysicalModel\"; }\r\n /** Insert a PhysicalPartition and a PhysicalModel that sub-models it.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The PhysicalPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the PhysicalPartition that the new PhysicalModel will sub-model.\r\n * @param isPlanProjection Optional value (default is false) that indicates if the contents of this model are expected to be in an XY plane.\r\n * @returns The Id of the newly inserted PhysicalPartition and PhysicalModel (same value).\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string, isPlanProjection?: boolean): Id64String {\r\n const partitionProps: InformationPartitionElementProps = {\r\n classFullName: PhysicalPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: PhysicalPartition.createCode(iModelDb, parentSubjectId, name),\r\n };\r\n const partitionId = iModelDb.elements.insertElement(partitionProps);\r\n const modelProps: GeometricModel3dProps = {\r\n classFullName: this.classFullName,\r\n modeledElement: { id: partitionId },\r\n isPlanProjection,\r\n };\r\n return iModelDb.models.insertModel(modelProps);\r\n }\r\n}\r\n\r\n/** A container for persisting spatial location elements.\r\n * @see [[SpatialLocationPartition]]\r\n * @public\r\n */\r\nexport class SpatialLocationModel extends SpatialModel {\r\n /** @internal */\r\n public static override get className(): string { return \"SpatialLocationModel\"; }\r\n /** Insert a SpatialLocationPartition and a SpatialLocationModel that sub-models it.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The SpatialLocationPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the SpatialLocationPartition that the new SpatialLocationModel will sub-model.\r\n * @param isPlanProjection Optional value (default is false) that indicates if the contents of this model are expected to be in an XY plane.\r\n * @returns The Id of the newly inserted SpatialLocationPartition and SpatialLocationModel (same value).\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string, isPlanProjection?: boolean): Id64String {\r\n const partitionProps: InformationPartitionElementProps = {\r\n classFullName: SpatialLocationPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: SpatialLocationPartition.createCode(iModelDb, parentSubjectId, name),\r\n };\r\n const partitionId = iModelDb.elements.insertElement(partitionProps);\r\n const modelProps: GeometricModel3dProps = {\r\n classFullName: this.classFullName,\r\n modeledElement: { id: partitionId },\r\n isPlanProjection,\r\n };\r\n return iModelDb.models.insertModel(modelProps);\r\n }\r\n}\r\n\r\n/** A 2d model that holds [[DrawingGraphic]]s. DrawingModels may be dimensional or non-dimensional.\r\n * @public\r\n */\r\nexport class DrawingModel extends GraphicalModel2d {\r\n /** @internal */\r\n public static override get className(): string { return \"DrawingModel\"; }\r\n}\r\n\r\n/** A container for persisting section [[DrawingGraphic]]s.\r\n * @public\r\n */\r\nexport class SectionDrawingModel extends DrawingModel {\r\n /** @internal */\r\n public static override get className(): string { return \"SectionDrawingModel\"; }\r\n}\r\n\r\n/** A container for persisting [[ViewAttachment]]s and [[DrawingGraphic]]s.\r\n * A SheetModel is a digital representation of a *sheet of paper*. SheetModels are 2d models in bounded paper coordinates.\r\n * SheetModels may contain annotation Elements as well as references to 2d or 3d Views.\r\n * @public\r\n */\r\nexport class SheetModel extends GraphicalModel2d {\r\n /** @internal */\r\n public static override get className(): string { return \"SheetModel\"; }\r\n}\r\n\r\n/** A container for persisting role elements.\r\n * @public\r\n */\r\nexport class RoleModel extends Model {\r\n /** @internal */\r\n public static override get className(): string { return \"RoleModel\"; }\r\n}\r\n\r\n/** A container for persisting information elements.\r\n * @public\r\n */\r\nexport abstract class InformationModel extends Model {\r\n /** @internal */\r\n public static override get className(): string { return \"InformationModel\"; }\r\n}\r\n\r\n/** A container for persisting group information elements.\r\n * @see [[GroupInformationPartition]]\r\n * @public\r\n */\r\nexport abstract class GroupInformationModel extends InformationModel {\r\n /** @internal */\r\n public static override get className(): string { return \"GroupInformationModel\"; }\r\n}\r\n\r\n/** A container for persisting Information Record Elements\r\n * @see [[InformationRecordPartition]]\r\n * @public\r\n */\r\nexport class InformationRecordModel extends InformationModel {\r\n /** @internal */\r\n public static override get className(): string { return \"InformationRecordModel\"; }\r\n\r\n /** Insert a InformationRecordPartition and a InformationRecordModel that sub-models it.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The InformationRecordPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the InformationRecordPartition that the new InformationRecordModel will sub-model.\r\n * @returns The Id of the newly inserted InformationRecordModel.\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string): Id64String {\r\n const partitionProps: InformationPartitionElementProps = {\r\n classFullName: InformationRecordPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: InformationRecordPartition.createCode(iModelDb, parentSubjectId, name),\r\n };\r\n const partitionId = iModelDb.elements.insertElement(partitionProps);\r\n return iModelDb.models.insertModel({\r\n classFullName: this.classFullName,\r\n modeledElement: { id: partitionId },\r\n });\r\n }\r\n}\r\n\r\n/** A container for persisting definition elements.\r\n * @see [[DefinitionPartition]]\r\n * @public\r\n */\r\nexport class DefinitionModel extends InformationModel {\r\n /** @internal */\r\n public static override get className(): string { return \"DefinitionModel\"; }\r\n\r\n /** Insert a DefinitionPartition and a DefinitionModel that sub-models it.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The DefinitionPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the DefinitionPartition that the new DefinitionModel will sub-model.\r\n * @returns The Id of the newly inserted DefinitionModel.\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string): Id64String {\r\n const partitionProps: InformationPartitionElementProps = {\r\n classFullName: DefinitionPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: DefinitionPartition.createCode(iModelDb, parentSubjectId, name),\r\n };\r\n const partitionId = iModelDb.elements.insertElement(partitionProps);\r\n return iModelDb.models.insertModel({\r\n classFullName: this.classFullName,\r\n modeledElement: { id: partitionId },\r\n });\r\n }\r\n}\r\n\r\n/** The singleton container of repository-related information elements.\r\n * @public\r\n */\r\nexport class RepositoryModel extends DefinitionModel {\r\n /** @internal */\r\n public static override get className(): string { return \"RepositoryModel\"; }\r\n}\r\n\r\n/** Contains a list of document elements.\r\n * @see [[DocumentPartition]]\r\n * @public\r\n */\r\nexport class DocumentListModel extends InformationModel {\r\n /** @internal */\r\n public static override get className(): string { return \"DocumentListModel\"; }\r\n /** Insert a DocumentPartition and a DocumentListModel that sub-models it.\r\n * @param iModelDb Insert into this iModel\r\n * @param parentSubjectId The DocumentPartition will be inserted as a child of this Subject element.\r\n * @param name The name of the DocumentPartition that the new DocumentListModel will sub-model.\r\n * @returns The Id of the newly inserted DocumentPartition and DocumentListModel (same value)\r\n * @throws [[IModelError]] if there is an insert problem.\r\n */\r\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string): Id64String {\r\n const partitionProps: InformationPartitionElementProps = {\r\n classFullName: DocumentPartition.classFullName,\r\n model: IModel.repositoryModelId,\r\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\r\n code: DocumentPartition.createCode(iModelDb, parentSubjectId, name),\r\n };\r\n const partitionId: Id64String = iModelDb.elements.insertElement(partitionProps);\r\n return iModelDb.models.insertModel({\r\n classFullName: this.classFullName,\r\n modeledElement: { id: partitionId },\r\n });\r\n }\r\n}\r\n\r\n/** A container for persisting link elements.\r\n * @see [[LinkPartition]]\r\n * @public\r\n */\r\nexport class LinkModel extends InformationModel {\r\n /** @internal */\r\n public static override get className(): string { return \"LinkModel\"; }\r\n}\r\n\r\n/** The singleton container for repository-specific definition elements.\r\n * @public\r\n */\r\nexport class DictionaryModel extends DefinitionModel {\r\n /** @internal */\r\n public static override get className(): string { return \"DictionaryModel\"; }\r\n}\r\n\r\n/** Obtains and displays multi-resolution tiled raster organized according to the WebMercator tiling system.\r\n * @public\r\n */\r\nexport class WebMercatorModel extends SpatialModel {\r\n /** @internal */\r\n public static override get className(): string { return \"WebMercatorModel\"; }\r\n}\r\n"]}
1
+ {"version":3,"file":"Model.js","sourceRoot":"","sources":["../../src/Model.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,qBAAqB;AAErB,sDAAwE;AACxE,wDAAwD;AACxD,oDAG4B;AAC5B,uCAA4I;AAC5I,qCAAkC;AAElC,qEAAwE;AA0CxE;;;;GAIG;AACH,MAAa,KAAM,SAAQ,eAAM;IAC/B,gBAAgB;IACT,MAAM,KAAc,SAAS,KAAa,OAAO,OAAO,CAAC,CAAC,CAAC;IAClE,gBAAgB;IACT,MAAM,KAAc,mBAAmB,KAAK,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE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------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Models\n */\n\n// cspell:ignore elid\n\nimport { GuidString, Id64String, JsonUtils } from \"@itwin/core-bentley\";\nimport { Point2d, Range3d } from \"@itwin/core-geometry\";\nimport {\n AxisAlignedBox3d, ElementProps, EntityReferenceSet, GeometricModel2dProps, GeometricModel3dProps, GeometricModelProps, IModel,\n InformationPartitionElementProps, ModelProps, RelatedElement,\n} from \"@itwin/core-common\";\nimport { DefinitionPartition, DocumentPartition, InformationRecordPartition, PhysicalPartition, SpatialLocationPartition } from \"./Element\";\nimport { Entity } from \"./Entity\";\nimport { IModelDb } from \"./IModelDb\";\nimport { SubjectOwnsPartitionElements } from \"./NavigationRelationship\";\n\n/** Argument for the `Model.onXxx` static methods\n * @beta\n */\nexport interface OnModelArg {\n /** The iModel for the Model affected. */\n iModel: IModelDb;\n}\n\n/** Argument for the `Model.onXxx` static methods that supply the properties of a Model to be inserted or updated.\n * @beta\n */\nexport interface OnModelPropsArg extends OnModelArg {\n /** The new properties of the Model affected. */\n props: Readonly<ModelProps>;\n}\n\n/** Argument for the `Model.onXxx` static methods that only supply the Id of the affected Model.\n * @beta\n */\nexport interface OnModelIdArg extends OnModelArg {\n /** The Id of the Model affected */\n id: Id64String;\n}\n\n/** Argument for the `Model.onXxxElement` static methods that supply the properties of an Element for a Model.\n * @beta\n */\nexport interface OnElementInModelPropsArg extends OnModelIdArg {\n /** The new properties of an Element for the affected Model */\n elementProps: Readonly<ElementProps>;\n}\n\n/** Argument for the `Model.onXxxElement` static methods that supply the Id of an Element for a Model.\n * @beta\n */\nexport interface OnElementInModelIdArg extends OnModelIdArg {\n /** The Id of the Element for the affected Model */\n elementId: Id64String;\n}\n\n/** A Model is a container for persisting a collection of related elements within an iModel.\n * See [[IModelDb.Models]] for how to query and manage the Models in an IModelDb.\n * See [Creating models]($docs/learning/backend/CreateModels.md)\n * @public\n */\nexport class Model extends Entity {\n /** @internal */\n public static override get className(): string { return \"Model\"; }\n /** @internal */\n public static override get protectedOperations() { return [\"onInsert\", \"onUpdate\", \"onDelete\"]; }\n public readonly modeledElement!: RelatedElement;\n public readonly name: string;\n public readonly parentModel!: Id64String;\n public readonly jsonProperties: { [key: string]: any };\n public isPrivate: boolean;\n public isTemplate: boolean;\n\n protected constructor(props: ModelProps, iModel: IModelDb) {\n super(props, iModel);\n this.name = props.name ? props.name : \"\"; // NB this isn't really a property of Model (it's the code.value of the modeled element), but it comes in ModelProps because it's often needed\n this.isPrivate = JsonUtils.asBool(props.isPrivate);\n this.isTemplate = JsonUtils.asBool(props.isTemplate);\n this.jsonProperties = { ...props.jsonProperties }; // make sure we have our own copy\n }\n\n public override toJSON(): ModelProps {\n const val = super.toJSON() as ModelProps;\n val.name = this.name; // for cloning\n return val;\n }\n\n /** Called before a new Model is inserted.\n * @note throw an exception to disallow the insert\n * @note If you override this method, you must call super.\n * @note `this` is the class of the Model to be inserted\n * @beta\n */\n protected static onInsert(arg: OnModelPropsArg): void {\n const { props, iModel } = arg;\n iModel.channels.verifyChannel(props.modeledElement.id);\n if (props.parentModel) // inserting requires shared lock on parent, if present\n iModel.locks.checkSharedLock(props.parentModel, \"parent model\", \"insert\");\n }\n\n /** Called after a new Model is inserted.\n * @note If you override this method, you must call super.\n * @note `this` is the class of the Model that was inserted\n * @beta\n */\n protected static onInserted(_arg: OnModelIdArg): void {\n // we don't need to tell LockControl about models being created - their ModeledElement does that\n }\n\n /** Called before a Model is updated.\n * @note throw an exception to disallow the update\n * @note If you override this method, you must call super.\n * @note `this` is the class of the Model to be updated\n * @beta\n */\n protected static onUpdate(arg: OnModelPropsArg): void {\n const id = arg.props.id!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\n arg.iModel.channels.verifyChannel(id);\n arg.iModel.locks.checkExclusiveLock(id, \"model\", \"update\");\n }\n\n /** Called after a Model is updated.\n * @note If you override this method, you must call super.\n * @note `this` is the class of the Model that was updated.\n * @beta\n */\n protected static onUpdated(_arg: OnModelIdArg): void {\n }\n\n /** Called before a Model is deleted.\n * @note throw an exception to disallow the delete\n * @note If you override this method, you must call super.\n * @note `this` is the class of the Model to be deleted\n * @beta\n */\n protected static onDelete(arg: OnModelIdArg): void {\n arg.iModel.channels.verifyChannel(arg.id);\n arg.iModel.locks.checkExclusiveLock(arg.id, \"model\", \"delete\");\n }\n\n /** Called after a Model was deleted.\n * @note If you override this method, you must call super.\n * @note `this` is the class of the Model that was deleted\n * @beta\n */\n protected static onDeleted(_arg: OnModelIdArg): void { }\n\n /** Called before a prospective Element is to be inserted into an instance of a Model of this class.\n * @note throw an exception to disallow the insert\n * @note If you override this method, you must call super.\n * @note `this` is the class of the Model to hold the element\n * @beta\n */\n protected static onInsertElement(_arg: OnElementInModelPropsArg): void { }\n\n /** Called after an Element has been inserted into an instance of a Model of this class.\n * @note If you override this method, you must call super.\n * @note `this` is the class of the Model holding the element\n * @beta\n */\n protected static onInsertedElement(_arg: OnElementInModelIdArg): void { }\n\n /** Called when an Element in an instance of a Model of this class is about to be updated.\n * @note throw an exception to disallow the update\n * @note If you override this method, you must call super.\n * @note `this` is the class of the Model holding the element\n * @beta\n */\n protected static onUpdateElement(_arg: OnElementInModelPropsArg): void { }\n\n /** Called after an Element in an instance of a Model of this class has been updated.\n * @note If you override this method, you must call super.\n * @note `this` is the class of the Model holding the element\n * @beta\n */\n protected static onUpdatedElement(_arg: OnElementInModelIdArg): void { }\n\n /** Called when an Element in an instance of a Model of this class is about to be deleted.\n * @note throw an exception to disallow the delete\n * @note If you override this method, you must call super.\n * @note `this` is the class of the Model holding the element\n * @beta\n */\n protected static onDeleteElement(_arg: OnElementInModelIdArg): void { }\n\n /** Called after an Element in an instance of a Model of this class has been deleted.\n * @note If you override this method, you must call super.\n * @note `this` is the class of the Model that held the element\n * @beta\n */\n protected static onDeletedElement(_arg: OnElementInModelIdArg): void { }\n\n private getAllUserProperties(): any {\n if (!this.jsonProperties.UserProps)\n this.jsonProperties.UserProps = new Object();\n\n return this.jsonProperties.UserProps;\n }\n\n /** Get a set of JSON user properties by namespace */\n public getUserProperties(namespace: string) { return this.getAllUserProperties()[namespace]; }\n\n /** Change a set of user JSON properties of this Element by namespace. */\n public setUserProperties(nameSpace: string, value: any) { this.getAllUserProperties()[nameSpace] = value; }\n\n /** Remove a set of JSON user properties, specified by namespace, from this Element */\n public removeUserProperties(nameSpace: string) { delete this.getAllUserProperties()[nameSpace]; }\n\n public getJsonProperty(name: string): any { return this.jsonProperties[name]; }\n public setJsonProperty(name: string, value: any) { this.jsonProperties[name] = value; }\n\n /** Insert this Model in the iModel */\n public insert() { return this.id = this.iModel.models.insertModel(this.toJSON()); }\n /** Update this Model in the iModel. */\n public update() { this.iModel.models.updateModel(this.toJSON()); }\n /** Delete this Model from the iModel. */\n public delete() { this.iModel.models.deleteModel(this.id); }\n\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\n super.collectReferenceIds(referenceIds);\n if (this.parentModel)\n referenceIds.addModel(this.parentModel);\n referenceIds.addElement(this.modeledElement.id);\n }\n}\n\n/** A container for persisting geometric elements.\n * @public\n */\nexport class GeometricModel extends Model {\n public geometryGuid?: GuidString; // Initialized by the Entity constructor\n\n /** @internal */\n public static override get className(): string { return \"GeometricModel\"; }\n\n protected constructor(props: GeometricModelProps, iModel: IModelDb) { super(props, iModel); }\n\n /** Query for the union of the extents of the elements contained by this model.\n * @note This function blocks the JavaScript event loop. Consider using [[queryRange]] instead.\n */\n public queryExtents(): AxisAlignedBox3d {\n const extents = this.iModel.nativeDb.queryModelExtents({ id: this.id }).modelExtents;\n return Range3d.fromJSON(extents);\n }\n\n /** Query for the union of the extents of all elements contained within this model. */\n public async queryRange(): Promise<AxisAlignedBox3d> {\n return this.iModel.models.queryRange(this.id);\n }\n}\n\n/** A container for persisting 3d geometric elements.\n * @public\n */\nexport abstract class GeometricModel3d extends GeometricModel {\n /** If true, then the elements in this GeometricModel3d are expected to be in an XY plane.\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\n */\n public readonly isPlanProjection: boolean;\n /** If true, then the elements in this GeometricModel3d are not in real-world coordinates and will not be in the spatial index.\n * @note The associated ECProperty was added to the BisCore schema in version 1.0.8\n */\n public readonly isNotSpatiallyLocated: boolean;\n /** If true, then the elements in this GeometricModel3d are in real-world coordinates and will be in the spatial index. */\n public get isSpatiallyLocated(): boolean { return !this.isNotSpatiallyLocated; }\n\n /** @internal */\n public static override get className(): string { return \"GeometricModel3d\"; }\n\n protected constructor(props: GeometricModel3dProps, iModel: IModelDb) {\n super(props, iModel);\n this.isNotSpatiallyLocated = JsonUtils.asBool(props.isNotSpatiallyLocated);\n this.isPlanProjection = JsonUtils.asBool(props.isPlanProjection);\n }\n\n public override toJSON(): GeometricModel3dProps {\n const val = super.toJSON() as GeometricModel3dProps;\n if (this.isNotSpatiallyLocated)\n val.isNotSpatiallyLocated = true;\n\n if (this.isPlanProjection)\n val.isPlanProjection = true;\n\n return val;\n }\n}\n\n/** A container for persisting 2d geometric elements.\n * @public\n */\nexport abstract class GeometricModel2d extends GeometricModel {\n /** The actual coordinates of (0,0) in modeling coordinates. An offset applied to all modeling coordinates. */\n public globalOrigin?: Point2d; // Initialized by the Entity constructor\n /** @internal */\n public static override get className(): string { return \"GeometricModel2d\"; }\n\n protected constructor(props: GeometricModel2dProps, iModel: IModelDb) { super(props, iModel); }\n\n public override toJSON(): GeometricModel2dProps {\n const val = super.toJSON() as GeometricModel2dProps;\n if (undefined !== this.globalOrigin)\n val.globalOrigin = Point2d.fromJSON(this.globalOrigin);\n\n return val;\n }\n}\n\n/** A container for persisting 2d graphical elements.\n * @public\n */\nexport abstract class GraphicalModel2d extends GeometricModel2d {\n /** @internal */\n public static override get className(): string { return \"GraphicalModel2d\"; }\n}\n\n/** A container for persisting GraphicalElement3d instances.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.8\n * @see [[GraphicalPartition3d]]\n * @public\n */\nexport abstract class GraphicalModel3d extends GeometricModel3d {\n /** @internal */\n public static override get className(): string { return \"GraphicalModel3d\"; }\n}\n\n/** A container for persisting 3d geometric elements that are spatially located.\n * @public\n */\nexport abstract class SpatialModel extends GeometricModel3d {\n /** @internal */\n public static override get className(): string { return \"SpatialModel\"; }\n}\n\n/** A container for persisting physical elements that model physical space.\n * @see [[PhysicalPartition]]\n * @public\n */\nexport class PhysicalModel extends SpatialModel {\n /** @internal */\n public static override get className(): string { return \"PhysicalModel\"; }\n /** Insert a PhysicalPartition and a PhysicalModel that sub-models it.\n * @param iModelDb Insert into this iModel\n * @param parentSubjectId The PhysicalPartition will be inserted as a child of this Subject element.\n * @param name The name of the PhysicalPartition that the new PhysicalModel will sub-model.\n * @param isPlanProjection Optional value (default is false) that indicates if the contents of this model are expected to be in an XY plane.\n * @returns The Id of the newly inserted PhysicalPartition and PhysicalModel (same value).\n * @throws [[IModelError]] if there is an insert problem.\n */\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string, isPlanProjection?: boolean): Id64String {\n const partitionProps: InformationPartitionElementProps = {\n classFullName: PhysicalPartition.classFullName,\n model: IModel.repositoryModelId,\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\n code: PhysicalPartition.createCode(iModelDb, parentSubjectId, name),\n };\n const partitionId = iModelDb.elements.insertElement(partitionProps);\n const modelProps: GeometricModel3dProps = {\n classFullName: this.classFullName,\n modeledElement: { id: partitionId },\n isPlanProjection,\n };\n return iModelDb.models.insertModel(modelProps);\n }\n}\n\n/** A container for persisting spatial location elements.\n * @see [[SpatialLocationPartition]]\n * @public\n */\nexport class SpatialLocationModel extends SpatialModel {\n /** @internal */\n public static override get className(): string { return \"SpatialLocationModel\"; }\n /** Insert a SpatialLocationPartition and a SpatialLocationModel that sub-models it.\n * @param iModelDb Insert into this iModel\n * @param parentSubjectId The SpatialLocationPartition will be inserted as a child of this Subject element.\n * @param name The name of the SpatialLocationPartition that the new SpatialLocationModel will sub-model.\n * @param isPlanProjection Optional value (default is false) that indicates if the contents of this model are expected to be in an XY plane.\n * @returns The Id of the newly inserted SpatialLocationPartition and SpatialLocationModel (same value).\n * @throws [[IModelError]] if there is an insert problem.\n */\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string, isPlanProjection?: boolean): Id64String {\n const partitionProps: InformationPartitionElementProps = {\n classFullName: SpatialLocationPartition.classFullName,\n model: IModel.repositoryModelId,\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\n code: SpatialLocationPartition.createCode(iModelDb, parentSubjectId, name),\n };\n const partitionId = iModelDb.elements.insertElement(partitionProps);\n const modelProps: GeometricModel3dProps = {\n classFullName: this.classFullName,\n modeledElement: { id: partitionId },\n isPlanProjection,\n };\n return iModelDb.models.insertModel(modelProps);\n }\n}\n\n/** A 2d model that holds [[DrawingGraphic]]s. DrawingModels may be dimensional or non-dimensional.\n * @public\n */\nexport class DrawingModel extends GraphicalModel2d {\n /** @internal */\n public static override get className(): string { return \"DrawingModel\"; }\n}\n\n/** A container for persisting section [[DrawingGraphic]]s.\n * @public\n */\nexport class SectionDrawingModel extends DrawingModel {\n /** @internal */\n public static override get className(): string { return \"SectionDrawingModel\"; }\n}\n\n/** A container for persisting [[ViewAttachment]]s and [[DrawingGraphic]]s.\n * A SheetModel is a digital representation of a *sheet of paper*. SheetModels are 2d models in bounded paper coordinates.\n * SheetModels may contain annotation Elements as well as references to 2d or 3d Views.\n * @public\n */\nexport class SheetModel extends GraphicalModel2d {\n /** @internal */\n public static override get className(): string { return \"SheetModel\"; }\n}\n\n/** A container for persisting role elements.\n * @public\n */\nexport class RoleModel extends Model {\n /** @internal */\n public static override get className(): string { return \"RoleModel\"; }\n}\n\n/** A container for persisting information elements.\n * @public\n */\nexport abstract class InformationModel extends Model {\n /** @internal */\n public static override get className(): string { return \"InformationModel\"; }\n}\n\n/** A container for persisting group information elements.\n * @see [[GroupInformationPartition]]\n * @public\n */\nexport abstract class GroupInformationModel extends InformationModel {\n /** @internal */\n public static override get className(): string { return \"GroupInformationModel\"; }\n}\n\n/** A container for persisting Information Record Elements\n * @see [[InformationRecordPartition]]\n * @public\n */\nexport class InformationRecordModel extends InformationModel {\n /** @internal */\n public static override get className(): string { return \"InformationRecordModel\"; }\n\n /** Insert a InformationRecordPartition and a InformationRecordModel that sub-models it.\n * @param iModelDb Insert into this iModel\n * @param parentSubjectId The InformationRecordPartition will be inserted as a child of this Subject element.\n * @param name The name of the InformationRecordPartition that the new InformationRecordModel will sub-model.\n * @returns The Id of the newly inserted InformationRecordModel.\n * @throws [[IModelError]] if there is an insert problem.\n */\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string): Id64String {\n const partitionProps: InformationPartitionElementProps = {\n classFullName: InformationRecordPartition.classFullName,\n model: IModel.repositoryModelId,\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\n code: InformationRecordPartition.createCode(iModelDb, parentSubjectId, name),\n };\n const partitionId = iModelDb.elements.insertElement(partitionProps);\n return iModelDb.models.insertModel({\n classFullName: this.classFullName,\n modeledElement: { id: partitionId },\n });\n }\n}\n\n/** A container for persisting definition elements.\n * @see [[DefinitionPartition]]\n * @public\n */\nexport class DefinitionModel extends InformationModel {\n /** @internal */\n public static override get className(): string { return \"DefinitionModel\"; }\n\n /** Insert a DefinitionPartition and a DefinitionModel that sub-models it.\n * @param iModelDb Insert into this iModel\n * @param parentSubjectId The DefinitionPartition will be inserted as a child of this Subject element.\n * @param name The name of the DefinitionPartition that the new DefinitionModel will sub-model.\n * @returns The Id of the newly inserted DefinitionModel.\n * @throws [[IModelError]] if there is an insert problem.\n */\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string): Id64String {\n const partitionProps: InformationPartitionElementProps = {\n classFullName: DefinitionPartition.classFullName,\n model: IModel.repositoryModelId,\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\n code: DefinitionPartition.createCode(iModelDb, parentSubjectId, name),\n };\n const partitionId = iModelDb.elements.insertElement(partitionProps);\n return iModelDb.models.insertModel({\n classFullName: this.classFullName,\n modeledElement: { id: partitionId },\n });\n }\n}\n\n/** The singleton container of repository-related information elements.\n * @public\n */\nexport class RepositoryModel extends DefinitionModel {\n /** @internal */\n public static override get className(): string { return \"RepositoryModel\"; }\n}\n\n/** Contains a list of document elements.\n * @see [[DocumentPartition]]\n * @public\n */\nexport class DocumentListModel extends InformationModel {\n /** @internal */\n public static override get className(): string { return \"DocumentListModel\"; }\n /** Insert a DocumentPartition and a DocumentListModel that sub-models it.\n * @param iModelDb Insert into this iModel\n * @param parentSubjectId The DocumentPartition will be inserted as a child of this Subject element.\n * @param name The name of the DocumentPartition that the new DocumentListModel will sub-model.\n * @returns The Id of the newly inserted DocumentPartition and DocumentListModel (same value)\n * @throws [[IModelError]] if there is an insert problem.\n */\n public static insert(iModelDb: IModelDb, parentSubjectId: Id64String, name: string): Id64String {\n const partitionProps: InformationPartitionElementProps = {\n classFullName: DocumentPartition.classFullName,\n model: IModel.repositoryModelId,\n parent: new SubjectOwnsPartitionElements(parentSubjectId),\n code: DocumentPartition.createCode(iModelDb, parentSubjectId, name),\n };\n const partitionId: Id64String = iModelDb.elements.insertElement(partitionProps);\n return iModelDb.models.insertModel({\n classFullName: this.classFullName,\n modeledElement: { id: partitionId },\n });\n }\n}\n\n/** A container for persisting link elements.\n * @see [[LinkPartition]]\n * @public\n */\nexport class LinkModel extends InformationModel {\n /** @internal */\n public static override get className(): string { return \"LinkModel\"; }\n}\n\n/** The singleton container for repository-specific definition elements.\n * @public\n */\nexport class DictionaryModel extends DefinitionModel {\n /** @internal */\n public static override get className(): string { return \"DictionaryModel\"; }\n}\n\n/** Obtains and displays multi-resolution tiled raster organized according to the WebMercator tiling system.\n * @public\n */\nexport class WebMercatorModel extends SpatialModel {\n /** @internal */\n public static override get className(): string { return \"WebMercatorModel\"; }\n}\n"]}
@@ -196,8 +196,8 @@ class NativeAppStorage {
196
196
  }
197
197
  }
198
198
  }
199
+ exports.NativeAppStorage = NativeAppStorage;
199
200
  NativeAppStorage._ext = ".settings-db";
200
201
  NativeAppStorage._storages = new Map();
201
202
  NativeAppStorage._init = false;
202
- exports.NativeAppStorage = NativeAppStorage;
203
203
  //# sourceMappingURL=NativeAppStorage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NativeAppStorage.js","sourceRoot":"","sources":["../../src/NativeAppStorage.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+BAA4B;AAC5B,sDAA6D;AAC7D,oDAA+D;AAC/D,iCAA4C;AAC5C,6CAA0C;AAC1C,6CAA0C;AAC1C,6CAA0C;AAE1C,qBAAqB;AAErB;;;GAGG;AACH,MAAa,gBAAgB;IAI3B,YAA4B,KAAW,EAAkB,EAAU;QAAvC,UAAK,GAAL,KAAK,CAAM;QAAkB,OAAE,GAAF,EAAE,CAAQ;IAAI,CAAC;IAExE,8BAA8B;IACvB,OAAO,CAAC,GAAW,EAAE,KAAmB;QAC7C,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC,uHAAuH,EAAE,CAAC,IAAI,EAAE,EAAE;YAClL,IAAI,OAAO,GAAG,CAAC,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC;YAC9E,IAAI,OAAO,KAAK,QAAQ,IAAI,CAAC,KAAK,YAAY,UAAU,CAAC;gBACvD,OAAO,GAAG,YAAY,CAAC;YAEzB,QAAQ,OAAO,EAAE;gBACf,KAAK,MAAM,CAAC;gBACZ,KAAK,QAAQ,CAAC;gBACd,KAAK,QAAQ,CAAC;gBACd,KAAK,SAAS,CAAC;gBACf,KAAK,YAAY;oBACf,MAAM;gBACR;oBACE,MAAM,IAAI,yBAAW,CAAC,uBAAQ,CAAC,eAAe,EAAE,oBAAoB,OAAO,uBAAuB,GAAG,EAAE,CAAC,CAAC;aAC5G;YAED,IAAI,CAAC,SAAS,CAAC,CAAC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CAAC;YACrD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACtC,OAAO,OAAO,CAAC;SAChB;IACH,CAAC;;AAhMuB,qBAAI,GAAG,cAAc,CAAC;AAC/B,0BAAS,GAAG,IAAI,GAAG,EAA4B,CAAC;AAChD,sBAAK,GAAY,KAAK,CAAC;AAH3B,4CAAgB","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 NativeApp\r\n */\r\n\r\nimport { join } from \"path\";\r\nimport { DbResult, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { IModelError, StorageValue } from \"@itwin/core-common\";\r\nimport { ECDb, ECDbOpenMode } from \"./ECDb\";\r\nimport { IModelHost } from \"./IModelHost\";\r\nimport { IModelJsFs } from \"./IModelJsFs\";\r\nimport { NativeHost } from \"./NativeHost\";\r\n\r\n// cspell:ignore ecdb\r\n\r\n/**\r\n * A local file stored in the [[NativeHost.appSettingsCacheDir]] for storing key/value pairs.\r\n * @public\r\n */\r\nexport class NativeAppStorage {\r\n private static readonly _ext = \".settings-db\";\r\n private static _storages = new Map<string, NativeAppStorage>();\r\n private static _init: boolean = false;\r\n private constructor(private _ecdb: ECDb, public readonly id: string) { }\r\n\r\n /** Set the value for a key */\r\n public setData(key: string, value: StorageValue): void {\r\n const rc = this._ecdb.withPreparedSqliteStatement(\"INSERT INTO app_setting(key,type,val)VALUES(?,?,?) ON CONFLICT(key) DO UPDATE SET type=excluded.type,val=excluded.val\", (stmt) => {\r\n let valType = (value === undefined || value === null) ? \"null\" : typeof value;\r\n if (valType === \"object\" && (value instanceof Uint8Array))\r\n valType = \"Uint8Array\";\r\n\r\n switch (valType) {\r\n case \"null\":\r\n case \"number\":\r\n case \"string\":\r\n case \"boolean\":\r\n case \"Uint8Array\":\r\n break;\r\n default:\r\n throw new IModelError(DbResult.BE_SQLITE_ERROR, `Unsupported type ${valType} for value for key='${key}`);\r\n }\r\n\r\n stmt.bindValue(1, key);\r\n stmt.bindValue(2, valType);\r\n stmt.bindValue(3, value);\r\n return stmt.step();\r\n });\r\n if (rc !== DbResult.BE_SQLITE_DONE)\r\n throw new IModelError(rc, \"SQLite error\");\r\n\r\n this._ecdb.saveChanges();\r\n }\r\n\r\n /** Get the value for a key from this Storage. If key is not present or is null, return undefined. */\r\n public getData(key: string): StorageValue {\r\n return this._ecdb.withPreparedSqliteStatement(\"SELECT type,val FROM app_setting WHERE key=?\", (stmt) => {\r\n stmt.bindValue(1, key);\r\n if (DbResult.BE_SQLITE_ROW !== stmt.step())\r\n return undefined;\r\n const valType = stmt.getValueString(0);\r\n switch (valType) {\r\n case \"number\":\r\n return stmt.getValueDouble(1);\r\n case \"string\":\r\n return stmt.getValueString(1);\r\n case \"boolean\":\r\n return Boolean(stmt.getValueInteger(1));\r\n case \"Uint8Array\":\r\n return stmt.getValueBlob(1);\r\n case \"null\":\r\n return undefined;\r\n }\r\n throw new IModelError(DbResult.BE_SQLITE_ERROR, `Unsupported type in cache ${valType}`);\r\n });\r\n }\r\n\r\n /** return the type of the value for a key, or undefined if not present. */\r\n public getValueType(key: string): \"number\" | \"string\" | \"boolean\" | \"Uint8Array\" | \"null\" | undefined {\r\n return this._ecdb.withSqliteStatement(\"SELECT type FROM app_setting WHERE key=?\", (stmt) => {\r\n stmt.bindValue(1, key);\r\n return stmt.step() === DbResult.BE_SQLITE_ROW ? stmt.getValueString(0) as any : undefined;\r\n });\r\n }\r\n\r\n /** return `true` if the key is present, but has a null value. */\r\n public hasNullValue(key: string): boolean {\r\n return this.getValueType(key) === \"null\";\r\n }\r\n\r\n /** Get the value for a key as a string. If it is not present, or not of type string, return undefined */\r\n public getString(key: string): string | undefined {\r\n const val = this.getData(key);\r\n return typeof val === \"string\" ? val : undefined;\r\n }\r\n\r\n /** Get the value for a key as a number. If it is not present, or not of type number, return undefined */\r\n public getNumber(key: string): number | undefined {\r\n const val = this.getData(key);\r\n return typeof val === \"number\" ? val : undefined;\r\n }\r\n\r\n /** Get the value for a key as a boolean. If it is not present, or not of type boolean, return undefined */\r\n public getBoolean(key: string): boolean | undefined {\r\n const val = this.getData(key);\r\n return typeof val === \"boolean\" ? val : undefined;\r\n }\r\n\r\n /** Get the value for a key as a Uint8Array. If it is not present, or not of type Uint8Array, return undefined */\r\n public getUint8Array(key: string): Uint8Array | undefined {\r\n const val = this.getData(key);\r\n return val instanceof Uint8Array ? val : undefined;\r\n }\r\n\r\n /** Get all key names in this Storage */\r\n public getKeys(): string[] {\r\n const keys = new Array<string>();\r\n this._ecdb.withPreparedSqliteStatement(\"SELECT key FROM app_setting\", (stmt) => {\r\n while (DbResult.BE_SQLITE_ROW === stmt.step()) {\r\n keys.push(stmt.getValueString(0));\r\n }\r\n });\r\n return keys;\r\n }\r\n\r\n /** Remove a key/value pair from this Storage */\r\n public removeData(key: string) {\r\n const rc = this._ecdb.withPreparedSqliteStatement(\"DELETE FROM app_setting WHERE key=?\", (stmt) => {\r\n stmt.bindValue(1, key);\r\n return stmt.step();\r\n });\r\n if (rc !== DbResult.BE_SQLITE_DONE) {\r\n throw new IModelError(rc, \"SQLite error\");\r\n }\r\n }\r\n\r\n /** Remove all key/value pairs */\r\n public removeAll() {\r\n const rc = this._ecdb.withPreparedSqliteStatement(\"DELETE FROM app_setting\", (stmt) => {\r\n return stmt.step();\r\n });\r\n if (rc !== DbResult.BE_SQLITE_DONE) {\r\n throw new IModelError(rc, \"SQLite error\");\r\n }\r\n }\r\n\r\n /** Close this Storage. */\r\n public close(deleteFile: boolean = false) {\r\n const storageFile = join(NativeHost.appSettingsCacheDir, this.id);\r\n this._ecdb.saveChanges();\r\n this._ecdb.closeDb();\r\n (this._ecdb as any) = undefined;\r\n if (deleteFile)\r\n IModelJsFs.removeSync(storageFile);\r\n NativeAppStorage._storages.delete(this.id);\r\n }\r\n\r\n private static init(ecdb: ECDb): DbResult {\r\n return ecdb.withPreparedSqliteStatement(\"CREATE TABLE app_setting(key PRIMARY KEY,type,val);\", (stmt) => {\r\n return stmt.step();\r\n });\r\n }\r\n\r\n /** find and open storage by its name. */\r\n public static find(name: string): NativeAppStorage {\r\n const storage = this._storages.get(name);\r\n if (undefined === storage)\r\n throw new IModelError(IModelStatus.FileNotFound, `Storage ${name} not open`);\r\n return storage;\r\n }\r\n\r\n /** Close all opened Storages.\r\n * @internal\r\n */\r\n public static closeAll() {\r\n this._storages.forEach((value) => value.close());\r\n this._storages.clear();\r\n }\r\n\r\n /** @internal */\r\n public static getStorageNames(): string[] {\r\n return IModelJsFs.readdirSync(NativeHost.appSettingsCacheDir).filter((name) => name.endsWith(this._ext));\r\n }\r\n\r\n /** Open or find a Storage by name. */\r\n public static open(name: string): NativeAppStorage {\r\n if (!this._init) {\r\n IModelHost.onBeforeShutdown.addOnce(() => this.closeAll());\r\n this._init = true;\r\n }\r\n const fileName = name + this._ext;\r\n if (!IModelJsFs.existsSync(NativeHost.appSettingsCacheDir))\r\n IModelJsFs.recursiveMkDirSync(NativeHost.appSettingsCacheDir);\r\n\r\n const storageFile = join(NativeHost.appSettingsCacheDir, fileName);\r\n try {\r\n return this.find(fileName); // see if it's already open\r\n } catch (err) {\r\n const ecdb = new ECDb();\r\n if (IModelJsFs.existsSync(storageFile)) {\r\n ecdb.openDb(storageFile, ECDbOpenMode.ReadWrite);\r\n } else {\r\n ecdb.createDb(storageFile);\r\n const rc = this.init(ecdb);\r\n if (rc !== DbResult.BE_SQLITE_DONE)\r\n throw new IModelError(rc, \"SQLite error\");\r\n ecdb.saveChanges();\r\n }\r\n const storage = new NativeAppStorage(ecdb, fileName);\r\n this._storages.set(fileName, storage);\r\n return storage;\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"NativeAppStorage.js","sourceRoot":"","sources":["../../src/NativeAppStorage.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;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kMC;AAjMyB,qBAAI,GAAG,cAAc,CAAC;AAC/B,0BAAS,GAAG,IAAI,GAAG,EAA4B,CAAC;AAChD,sBAAK,GAAY,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module NativeApp\n */\n\nimport { join } from \"path\";\nimport { DbResult, IModelStatus } from \"@itwin/core-bentley\";\nimport { IModelError, StorageValue } from \"@itwin/core-common\";\nimport { ECDb, ECDbOpenMode } from \"./ECDb\";\nimport { IModelHost } from \"./IModelHost\";\nimport { IModelJsFs } from \"./IModelJsFs\";\nimport { NativeHost } from \"./NativeHost\";\n\n// cspell:ignore ecdb\n\n/**\n * A local file stored in the [[NativeHost.appSettingsCacheDir]] for storing key/value pairs.\n * @public\n */\nexport class NativeAppStorage {\n private static readonly _ext = \".settings-db\";\n private static _storages = new Map<string, NativeAppStorage>();\n private static _init: boolean = false;\n private constructor(private _ecdb: ECDb, public readonly id: string) { }\n\n /** Set the value for a key */\n public setData(key: string, value: StorageValue): void {\n const rc = this._ecdb.withPreparedSqliteStatement(\"INSERT INTO app_setting(key,type,val)VALUES(?,?,?) ON CONFLICT(key) DO UPDATE SET type=excluded.type,val=excluded.val\", (stmt) => {\n let valType = (value === undefined || value === null) ? \"null\" : typeof value;\n if (valType === \"object\" && (value instanceof Uint8Array))\n valType = \"Uint8Array\";\n\n switch (valType) {\n case \"null\":\n case \"number\":\n case \"string\":\n case \"boolean\":\n case \"Uint8Array\":\n break;\n default:\n throw new IModelError(DbResult.BE_SQLITE_ERROR, `Unsupported type ${valType} for value for key='${key}`);\n }\n\n stmt.bindValue(1, key);\n stmt.bindValue(2, valType);\n stmt.bindValue(3, value);\n return stmt.step();\n });\n if (rc !== DbResult.BE_SQLITE_DONE)\n throw new IModelError(rc, \"SQLite error\");\n\n this._ecdb.saveChanges();\n }\n\n /** Get the value for a key from this Storage. If key is not present or is null, return undefined. */\n public getData(key: string): StorageValue {\n return this._ecdb.withPreparedSqliteStatement(\"SELECT type,val FROM app_setting WHERE key=?\", (stmt) => {\n stmt.bindValue(1, key);\n if (DbResult.BE_SQLITE_ROW !== stmt.step())\n return undefined;\n const valType = stmt.getValueString(0);\n switch (valType) {\n case \"number\":\n return stmt.getValueDouble(1);\n case \"string\":\n return stmt.getValueString(1);\n case \"boolean\":\n return Boolean(stmt.getValueInteger(1));\n case \"Uint8Array\":\n return stmt.getValueBlob(1);\n case \"null\":\n return undefined;\n }\n throw new IModelError(DbResult.BE_SQLITE_ERROR, `Unsupported type in cache ${valType}`);\n });\n }\n\n /** return the type of the value for a key, or undefined if not present. */\n public getValueType(key: string): \"number\" | \"string\" | \"boolean\" | \"Uint8Array\" | \"null\" | undefined {\n return this._ecdb.withSqliteStatement(\"SELECT type FROM app_setting WHERE key=?\", (stmt) => {\n stmt.bindValue(1, key);\n return stmt.step() === DbResult.BE_SQLITE_ROW ? stmt.getValueString(0) as any : undefined;\n });\n }\n\n /** return `true` if the key is present, but has a null value. */\n public hasNullValue(key: string): boolean {\n return this.getValueType(key) === \"null\";\n }\n\n /** Get the value for a key as a string. If it is not present, or not of type string, return undefined */\n public getString(key: string): string | undefined {\n const val = this.getData(key);\n return typeof val === \"string\" ? val : undefined;\n }\n\n /** Get the value for a key as a number. If it is not present, or not of type number, return undefined */\n public getNumber(key: string): number | undefined {\n const val = this.getData(key);\n return typeof val === \"number\" ? val : undefined;\n }\n\n /** Get the value for a key as a boolean. If it is not present, or not of type boolean, return undefined */\n public getBoolean(key: string): boolean | undefined {\n const val = this.getData(key);\n return typeof val === \"boolean\" ? val : undefined;\n }\n\n /** Get the value for a key as a Uint8Array. If it is not present, or not of type Uint8Array, return undefined */\n public getUint8Array(key: string): Uint8Array | undefined {\n const val = this.getData(key);\n return val instanceof Uint8Array ? val : undefined;\n }\n\n /** Get all key names in this Storage */\n public getKeys(): string[] {\n const keys = new Array<string>();\n this._ecdb.withPreparedSqliteStatement(\"SELECT key FROM app_setting\", (stmt) => {\n while (DbResult.BE_SQLITE_ROW === stmt.step()) {\n keys.push(stmt.getValueString(0));\n }\n });\n return keys;\n }\n\n /** Remove a key/value pair from this Storage */\n public removeData(key: string) {\n const rc = this._ecdb.withPreparedSqliteStatement(\"DELETE FROM app_setting WHERE key=?\", (stmt) => {\n stmt.bindValue(1, key);\n return stmt.step();\n });\n if (rc !== DbResult.BE_SQLITE_DONE) {\n throw new IModelError(rc, \"SQLite error\");\n }\n }\n\n /** Remove all key/value pairs */\n public removeAll() {\n const rc = this._ecdb.withPreparedSqliteStatement(\"DELETE FROM app_setting\", (stmt) => {\n return stmt.step();\n });\n if (rc !== DbResult.BE_SQLITE_DONE) {\n throw new IModelError(rc, \"SQLite error\");\n }\n }\n\n /** Close this Storage. */\n public close(deleteFile: boolean = false) {\n const storageFile = join(NativeHost.appSettingsCacheDir, this.id);\n this._ecdb.saveChanges();\n this._ecdb.closeDb();\n (this._ecdb as any) = undefined;\n if (deleteFile)\n IModelJsFs.removeSync(storageFile);\n NativeAppStorage._storages.delete(this.id);\n }\n\n private static init(ecdb: ECDb): DbResult {\n return ecdb.withPreparedSqliteStatement(\"CREATE TABLE app_setting(key PRIMARY KEY,type,val);\", (stmt) => {\n return stmt.step();\n });\n }\n\n /** find and open storage by its name. */\n public static find(name: string): NativeAppStorage {\n const storage = this._storages.get(name);\n if (undefined === storage)\n throw new IModelError(IModelStatus.FileNotFound, `Storage ${name} not open`);\n return storage;\n }\n\n /** Close all opened Storages.\n * @internal\n */\n public static closeAll() {\n this._storages.forEach((value) => value.close());\n this._storages.clear();\n }\n\n /** @internal */\n public static getStorageNames(): string[] {\n return IModelJsFs.readdirSync(NativeHost.appSettingsCacheDir).filter((name) => name.endsWith(this._ext));\n }\n\n /** Open or find a Storage by name. */\n public static open(name: string): NativeAppStorage {\n if (!this._init) {\n IModelHost.onBeforeShutdown.addOnce(() => this.closeAll());\n this._init = true;\n }\n const fileName = name + this._ext;\n if (!IModelJsFs.existsSync(NativeHost.appSettingsCacheDir))\n IModelJsFs.recursiveMkDirSync(NativeHost.appSettingsCacheDir);\n\n const storageFile = join(NativeHost.appSettingsCacheDir, fileName);\n try {\n return this.find(fileName); // see if it's already open\n } catch (err) {\n const ecdb = new ECDb();\n if (IModelJsFs.existsSync(storageFile)) {\n ecdb.openDb(storageFile, ECDbOpenMode.ReadWrite);\n } else {\n ecdb.createDb(storageFile);\n const rc = this.init(ecdb);\n if (rc !== DbResult.BE_SQLITE_DONE)\n throw new IModelError(rc, \"SQLite error\");\n ecdb.saveChanges();\n }\n const storage = new NativeAppStorage(ecdb, fileName);\n this._storages.set(fileName, storage);\n return storage;\n }\n }\n}\n"]}
@@ -152,8 +152,8 @@ class NativeHost {
152
152
  }
153
153
  }
154
154
  }
155
+ exports.NativeHost = NativeHost;
155
156
  /** Event called when the internet connectivity changes, if known. */
156
157
  NativeHost.onInternetConnectivityChanged = new core_bentley_1.BeEvent();
157
158
  NativeHost._isValid = false;
158
- exports.NativeHost = NativeHost;
159
159
  //# sourceMappingURL=NativeHost.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NativeHost.js","sourceRoot":"","sources":["../../src/NativeHost.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+BAA4B;AAC5B,sDAA+E;AAC/E,oDAG4B;AAC5B,yDAA8E;AAC9E,2DAAkF;AAClF,6CAA0C;AAC1C,uCAAuF;AACvF,yDAAsD;AAEtD;;GAEG;AACH,MAAM,gBAAiB,SAAQ,oBAAU;IACvC,IAAW,WAAW,KAAK,OAAO,iCAAmB,CAAC,WAAW,CAAC,CAAC,CAAC;IAE7D,KAAK,CAAC,cAAc;QACzB,OAAO,uBAAU,CAAC,mBAAmB,EAAE,cAAc,EAAE,CAAC;IAC1D,CAAC;IAEM,KAAK,CAAC,yBAAyB;QACpC,OAAO,UAAU,CAAC,yBAAyB,EAAE,CAAC;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gD,CAAC;AAcpG,mBAAQ,GAAG,KAAK,CAAC;AApBrB,gCAAU","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 NativeApp\r\n */\r\n\r\nimport { join } from \"path\";\r\nimport { AccessToken, assert, BeEvent, GuidString } from \"@itwin/core-bentley\";\r\nimport {\r\n BriefcaseProps, InternetConnectivityStatus, LocalBriefcaseProps, NativeAppFunctions, nativeAppIpcStrings, NativeAppNotifications,\r\n OverriddenBy, RequestNewBriefcaseProps, StorageValue,\r\n} from \"@itwin/core-common\";\r\nimport { BriefcaseManager, RequestNewBriefcaseArg } from \"./BriefcaseManager\";\r\nimport { Downloads, ProgressFunction, ProgressStatus } from \"./CheckpointManager\";\r\nimport { IModelHost } from \"./IModelHost\";\r\nimport { IpcHandler, IpcHost, IpcHostOpts, throttleProgressCallback } from \"./IpcHost\";\r\nimport { NativeAppStorage } from \"./NativeAppStorage\";\r\n\r\n/**\r\n * Implementation of NativeAppFunctions\r\n */\r\nclass NativeAppHandler extends IpcHandler implements NativeAppFunctions {\r\n public get channelName() { return nativeAppIpcStrings.channelName; }\r\n\r\n public async getAccessToken(): Promise<AccessToken | undefined> {\r\n return IModelHost.authorizationClient?.getAccessToken();\r\n }\r\n\r\n public async checkInternetConnectivity(): Promise<InternetConnectivityStatus> {\r\n return NativeHost.checkInternetConnectivity();\r\n }\r\n public async overrideInternetConnectivity(by: OverriddenBy, status: InternetConnectivityStatus): Promise<void> {\r\n NativeHost.overrideInternetConnectivity(by, status);\r\n }\r\n public async acquireNewBriefcaseId(iModelId: GuidString): Promise<number> {\r\n return BriefcaseManager.acquireNewBriefcaseId({ iModelId });\r\n }\r\n public async getBriefcaseFileName(props: BriefcaseProps): Promise<string> {\r\n return BriefcaseManager.getFileName(props);\r\n }\r\n public async downloadBriefcase(request: RequestNewBriefcaseProps, reportProgress: boolean, progressInterval?: number): Promise<LocalBriefcaseProps> {\r\n const args: RequestNewBriefcaseArg = {\r\n ...request,\r\n accessToken: await this.getAccessToken(),\r\n onProgress: (_a: number, _b: number) => checkAbort(),\r\n };\r\n\r\n const checkAbort = () => {\r\n assert(undefined !== args.fileName);\r\n const job = Downloads.isInProgress(args.fileName);\r\n return (job && (job.request as any).abort === 1) ? ProgressStatus.Abort : ProgressStatus.Continue;\r\n };\r\n\r\n if (reportProgress) {\r\n const progressCallback: ProgressFunction = (loaded, total) => {\r\n IpcHost.send(`nativeApp.progress-${request.iModelId}`, { loaded, total });\r\n return checkAbort();\r\n };\r\n args.onProgress = throttleProgressCallback(progressCallback, checkAbort, progressInterval);\r\n }\r\n\r\n return BriefcaseManager.downloadBriefcase(args);\r\n }\r\n\r\n public async requestCancelDownloadBriefcase(fileName: string): Promise<boolean> {\r\n const job = Downloads.isInProgress(fileName);\r\n if (job)\r\n (job.request as any).abort = 1;\r\n return job !== undefined;\r\n }\r\n\r\n public async deleteBriefcaseFiles(fileName: string): Promise<void> {\r\n await BriefcaseManager.deleteBriefcaseFiles(fileName, await IModelHost.getAccessToken());\r\n }\r\n\r\n public async getCachedBriefcases(iModelId?: GuidString): Promise<LocalBriefcaseProps[]> {\r\n return BriefcaseManager.getCachedBriefcases(iModelId);\r\n }\r\n\r\n public async storageMgrOpen(storageId: string): Promise<string> {\r\n return NativeAppStorage.open(storageId).id;\r\n }\r\n\r\n public async storageMgrClose(storageId: string, deleteIt: boolean): Promise<void> {\r\n NativeAppStorage.find(storageId).close(deleteIt);\r\n }\r\n\r\n public async storageMgrNames(): Promise<string[]> {\r\n return NativeAppStorage.getStorageNames();\r\n }\r\n\r\n public async storageGetValueType(storageId: string, key: string): Promise<\"number\" | \"string\" | \"boolean\" | \"Uint8Array\" | \"null\" | undefined> {\r\n return NativeAppStorage.find(storageId).getValueType(key);\r\n }\r\n\r\n public async storageGet(storageId: string, key: string): Promise<StorageValue | undefined> {\r\n return NativeAppStorage.find(storageId).getData(key);\r\n }\r\n\r\n public async storageSet(storageId: string, key: string, value: StorageValue): Promise<void> {\r\n NativeAppStorage.find(storageId).setData(key, value);\r\n }\r\n\r\n public async storageRemove(storageId: string, key: string): Promise<void> {\r\n NativeAppStorage.find(storageId).removeData(key);\r\n }\r\n\r\n public async storageKeys(storageId: string): Promise<string[]> {\r\n return NativeAppStorage.find(storageId).getKeys();\r\n }\r\n\r\n public async storageRemoveAll(storageId: string): Promise<void> {\r\n NativeAppStorage.find(storageId).removeAll();\r\n }\r\n}\r\n\r\n/** Options for [[NativeHost.startup]]\r\n * @public\r\n */\r\nexport interface NativeHostOpts extends IpcHostOpts {\r\n nativeHost?: {\r\n /** Application name. Used, for example, to name the settings file. If not supplied, defaults to \"iTwinApp\". */\r\n applicationName?: string;\r\n };\r\n}\r\n\r\n/**\r\n * Backend for desktop/mobile native applications\r\n * @public\r\n */\r\nexport class NativeHost {\r\n private static _reachability?: InternetConnectivityStatus;\r\n private static _applicationName: string;\r\n private constructor() { } // no instances - static methods only\r\n\r\n /** Event called when the internet connectivity changes, if known. */\r\n public static readonly onInternetConnectivityChanged = new BeEvent<(status: InternetConnectivityStatus) => void>();\r\n\r\n private static _appSettingsCacheDir?: string;\r\n\r\n /** Get the local cache folder for application settings */\r\n public static get appSettingsCacheDir(): string {\r\n return this._appSettingsCacheDir ??= join(IModelHost.cacheDir, \"appSettings\");\r\n }\r\n\r\n /** Send a notification to the NativeApp connected to this NativeHost. */\r\n public static notifyNativeFrontend<T extends keyof NativeAppNotifications>(methodName: T, ...args: Parameters<NativeAppNotifications[T]>) {\r\n return IpcHost.send(nativeAppIpcStrings.notifyChannel, methodName, ...args);\r\n }\r\n\r\n private static _isValid = false;\r\n public static get isValid(): boolean { return this._isValid; }\r\n public static get applicationName() { return this._applicationName; }\r\n /** Get the settings store for this NativeHost. */\r\n public static get settingsStore() {\r\n return NativeAppStorage.open(this.applicationName);\r\n }\r\n\r\n /**\r\n * Start the backend of a native app.\r\n * @note this method calls [[IpcHost.startup]] internally.\r\n */\r\n public static async startup(opt?: NativeHostOpts): Promise<void> {\r\n if (!this.isValid) {\r\n this._isValid = true;\r\n this.onInternetConnectivityChanged.addListener((status: InternetConnectivityStatus) =>\r\n NativeHost.notifyNativeFrontend(\"notifyInternetConnectivityChanged\", status));\r\n this._applicationName = opt?.nativeHost?.applicationName ?? \"iTwinApp\";\r\n }\r\n\r\n await IpcHost.startup(opt);\r\n if (IpcHost.isValid) // for tests, we use NativeHost but don't have a frontend\r\n NativeAppHandler.register();\r\n }\r\n\r\n /** Shutdown native app backend. Also calls [[IpcHost.shutdown]] */\r\n public static async shutdown(): Promise<void> {\r\n this._isValid = false;\r\n this.onInternetConnectivityChanged.clear();\r\n await IpcHost.shutdown();\r\n }\r\n\r\n /** get current value of internet connectivity */\r\n public static checkInternetConnectivity(): InternetConnectivityStatus {\r\n return this._reachability ?? InternetConnectivityStatus.Online;\r\n }\r\n\r\n /**\r\n * Override internet connectivity state\r\n * @param _overridenBy who overrode the value.\r\n * @internal\r\n */\r\n public static overrideInternetConnectivity(_overridenBy: OverriddenBy, status: InternetConnectivityStatus): void {\r\n if (this._reachability !== status) {\r\n this._reachability = status;\r\n this.onInternetConnectivityChanged.raiseEvent(status);\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"NativeHost.js","sourceRoot":"","sources":["../../src/NativeHost.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,+BAA4B;AAC5B,sDAA+E;AAC/E,oDAG4B;AAC5B,yDAA8E;AAC9E,2DAAkF;AAClF,6CAA0C;AAC1C,uCAAuF;AACvF,yDAAsD;AAEtD;;GAEG;AACH,MAAM,gBAAiB,SAAQ,oBAAU;IACvC,IAAW,WAAW,KAAK,OAAO,iCAAmB,CAAC,WAAW,CAAC,CAAC,CAAC;IAE7D,KAAK,CAAC,cAAc;QACzB,OAAO,uBAAU,CAAC,mBAAmB,EAAE,c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B,IAAI,CAAC,6BAA6B,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;;AAnEH,gCAoEC;AA/DC,qEAAqE;AAC9C,wCAA6B,GAAG,IAAI,sBAAO,EAAgD,CAAC;AAcpG,mBAAQ,GAAG,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module NativeApp\n */\n\nimport { join } from \"path\";\nimport { AccessToken, assert, BeEvent, GuidString } from \"@itwin/core-bentley\";\nimport {\n BriefcaseProps, InternetConnectivityStatus, LocalBriefcaseProps, NativeAppFunctions, nativeAppIpcStrings, NativeAppNotifications,\n OverriddenBy, RequestNewBriefcaseProps, StorageValue,\n} from \"@itwin/core-common\";\nimport { BriefcaseManager, RequestNewBriefcaseArg } from \"./BriefcaseManager\";\nimport { Downloads, ProgressFunction, ProgressStatus } from \"./CheckpointManager\";\nimport { IModelHost } from \"./IModelHost\";\nimport { IpcHandler, IpcHost, IpcHostOpts, throttleProgressCallback } from \"./IpcHost\";\nimport { NativeAppStorage } from \"./NativeAppStorage\";\n\n/**\n * Implementation of NativeAppFunctions\n */\nclass NativeAppHandler extends IpcHandler implements NativeAppFunctions {\n public get channelName() { return nativeAppIpcStrings.channelName; }\n\n public async getAccessToken(): Promise<AccessToken | undefined> {\n return IModelHost.authorizationClient?.getAccessToken();\n }\n\n public async checkInternetConnectivity(): Promise<InternetConnectivityStatus> {\n return NativeHost.checkInternetConnectivity();\n }\n public async overrideInternetConnectivity(by: OverriddenBy, status: InternetConnectivityStatus): Promise<void> {\n NativeHost.overrideInternetConnectivity(by, status);\n }\n public async acquireNewBriefcaseId(iModelId: GuidString): Promise<number> {\n return BriefcaseManager.acquireNewBriefcaseId({ iModelId });\n }\n public async getBriefcaseFileName(props: BriefcaseProps): Promise<string> {\n return BriefcaseManager.getFileName(props);\n }\n public async downloadBriefcase(request: RequestNewBriefcaseProps, reportProgress: boolean, progressInterval?: number): Promise<LocalBriefcaseProps> {\n const args: RequestNewBriefcaseArg = {\n ...request,\n accessToken: await this.getAccessToken(),\n onProgress: (_a: number, _b: number) => checkAbort(),\n };\n\n const checkAbort = () => {\n assert(undefined !== args.fileName);\n const job = Downloads.isInProgress(args.fileName);\n return (job && (job.request as any).abort === 1) ? ProgressStatus.Abort : ProgressStatus.Continue;\n };\n\n if (reportProgress) {\n const progressCallback: ProgressFunction = (loaded, total) => {\n IpcHost.send(`nativeApp.progress-${request.iModelId}`, { loaded, total });\n return checkAbort();\n };\n args.onProgress = throttleProgressCallback(progressCallback, checkAbort, progressInterval);\n }\n\n return BriefcaseManager.downloadBriefcase(args);\n }\n\n public async requestCancelDownloadBriefcase(fileName: string): Promise<boolean> {\n const job = Downloads.isInProgress(fileName);\n if (job)\n (job.request as any).abort = 1;\n return job !== undefined;\n }\n\n public async deleteBriefcaseFiles(fileName: string): Promise<void> {\n await BriefcaseManager.deleteBriefcaseFiles(fileName, await IModelHost.getAccessToken());\n }\n\n public async getCachedBriefcases(iModelId?: GuidString): Promise<LocalBriefcaseProps[]> {\n return BriefcaseManager.getCachedBriefcases(iModelId);\n }\n\n public async storageMgrOpen(storageId: string): Promise<string> {\n return NativeAppStorage.open(storageId).id;\n }\n\n public async storageMgrClose(storageId: string, deleteIt: boolean): Promise<void> {\n NativeAppStorage.find(storageId).close(deleteIt);\n }\n\n public async storageMgrNames(): Promise<string[]> {\n return NativeAppStorage.getStorageNames();\n }\n\n public async storageGetValueType(storageId: string, key: string): Promise<\"number\" | \"string\" | \"boolean\" | \"Uint8Array\" | \"null\" | undefined> {\n return NativeAppStorage.find(storageId).getValueType(key);\n }\n\n public async storageGet(storageId: string, key: string): Promise<StorageValue | undefined> {\n return NativeAppStorage.find(storageId).getData(key);\n }\n\n public async storageSet(storageId: string, key: string, value: StorageValue): Promise<void> {\n NativeAppStorage.find(storageId).setData(key, value);\n }\n\n public async storageRemove(storageId: string, key: string): Promise<void> {\n NativeAppStorage.find(storageId).removeData(key);\n }\n\n public async storageKeys(storageId: string): Promise<string[]> {\n return NativeAppStorage.find(storageId).getKeys();\n }\n\n public async storageRemoveAll(storageId: string): Promise<void> {\n NativeAppStorage.find(storageId).removeAll();\n }\n}\n\n/** Options for [[NativeHost.startup]]\n * @public\n */\nexport interface NativeHostOpts extends IpcHostOpts {\n nativeHost?: {\n /** Application name. Used, for example, to name the settings file. If not supplied, defaults to \"iTwinApp\". */\n applicationName?: string;\n };\n}\n\n/**\n * Backend for desktop/mobile native applications\n * @public\n */\nexport class NativeHost {\n private static _reachability?: InternetConnectivityStatus;\n private static _applicationName: string;\n private constructor() { } // no instances - static methods only\n\n /** Event called when the internet connectivity changes, if known. */\n public static readonly onInternetConnectivityChanged = new BeEvent<(status: InternetConnectivityStatus) => void>();\n\n private static _appSettingsCacheDir?: string;\n\n /** Get the local cache folder for application settings */\n public static get appSettingsCacheDir(): string {\n return this._appSettingsCacheDir ??= join(IModelHost.cacheDir, \"appSettings\");\n }\n\n /** Send a notification to the NativeApp connected to this NativeHost. */\n public static notifyNativeFrontend<T extends keyof NativeAppNotifications>(methodName: T, ...args: Parameters<NativeAppNotifications[T]>) {\n return IpcHost.send(nativeAppIpcStrings.notifyChannel, methodName, ...args);\n }\n\n private static _isValid = false;\n public static get isValid(): boolean { return this._isValid; }\n public static get applicationName() { return this._applicationName; }\n /** Get the settings store for this NativeHost. */\n public static get settingsStore() {\n return NativeAppStorage.open(this.applicationName);\n }\n\n /**\n * Start the backend of a native app.\n * @note this method calls [[IpcHost.startup]] internally.\n */\n public static async startup(opt?: NativeHostOpts): Promise<void> {\n if (!this.isValid) {\n this._isValid = true;\n this.onInternetConnectivityChanged.addListener((status: InternetConnectivityStatus) =>\n NativeHost.notifyNativeFrontend(\"notifyInternetConnectivityChanged\", status));\n this._applicationName = opt?.nativeHost?.applicationName ?? \"iTwinApp\";\n }\n\n await IpcHost.startup(opt);\n if (IpcHost.isValid) // for tests, we use NativeHost but don't have a frontend\n NativeAppHandler.register();\n }\n\n /** Shutdown native app backend. Also calls [[IpcHost.shutdown]] */\n public static async shutdown(): Promise<void> {\n this._isValid = false;\n this.onInternetConnectivityChanged.clear();\n await IpcHost.shutdown();\n }\n\n /** get current value of internet connectivity */\n public static checkInternetConnectivity(): InternetConnectivityStatus {\n return this._reachability ?? InternetConnectivityStatus.Online;\n }\n\n /**\n * Override internet connectivity state\n * @param _overridenBy who overrode the value.\n * @internal\n */\n public static overrideInternetConnectivity(_overridenBy: OverriddenBy, status: InternetConnectivityStatus): void {\n if (this._reachability !== status) {\n this._reachability = status;\n this.onInternetConnectivityChanged.raiseEvent(status);\n }\n }\n}\n"]}
@@ -17,8 +17,8 @@ class ElementOwnsChildElements extends core_common_1.RelatedElement {
17
17
  super({ id: parentId, relClassName });
18
18
  }
19
19
  }
20
- ElementOwnsChildElements.classFullName = "BisCore:ElementOwnsChildElements";
21
20
  exports.ElementOwnsChildElements = ElementOwnsChildElements;
21
+ ElementOwnsChildElements.classFullName = "BisCore:ElementOwnsChildElements";
22
22
  /** Relates a parent [[Subject]] to [[Subject]] child elements.
23
23
  * @public
24
24
  */
@@ -27,8 +27,8 @@ class SubjectOwnsSubjects extends ElementOwnsChildElements {
27
27
  super(parentId, relClassName);
28
28
  }
29
29
  }
30
- SubjectOwnsSubjects.classFullName = "BisCore:SubjectOwnsSubjects";
31
30
  exports.SubjectOwnsSubjects = SubjectOwnsSubjects;
31
+ SubjectOwnsSubjects.classFullName = "BisCore:SubjectOwnsSubjects";
32
32
  /** Relates a parent [[Subject]] to [[InformationPartitionElement]] child elements.
33
33
  * @public
34
34
  */
@@ -37,8 +37,8 @@ class SubjectOwnsPartitionElements extends ElementOwnsChildElements {
37
37
  super(parentId, relClassName);
38
38
  }
39
39
  }
40
- SubjectOwnsPartitionElements.classFullName = "BisCore:SubjectOwnsPartitionElements";
41
40
  exports.SubjectOwnsPartitionElements = SubjectOwnsPartitionElements;
41
+ SubjectOwnsPartitionElements.classFullName = "BisCore:SubjectOwnsPartitionElements";
42
42
  /** Relates a parent [[Category]] to [[SubCategory]] child elements.
43
43
  * @public
44
44
  */
@@ -47,8 +47,8 @@ class CategoryOwnsSubCategories extends ElementOwnsChildElements {
47
47
  super(parentId, relClassName);
48
48
  }
49
49
  }
50
- CategoryOwnsSubCategories.classFullName = "BisCore:CategoryOwnsSubCategories";
51
50
  exports.CategoryOwnsSubCategories = CategoryOwnsSubCategories;
51
+ CategoryOwnsSubCategories.classFullName = "BisCore:CategoryOwnsSubCategories";
52
52
  /** Relates a parent [[RenderMaterial]] to [[RenderMaterial]] child elements.
53
53
  * @public
54
54
  */
@@ -57,8 +57,8 @@ class RenderMaterialOwnsRenderMaterials extends ElementOwnsChildElements {
57
57
  super(parentId, relClassName);
58
58
  }
59
59
  }
60
- RenderMaterialOwnsRenderMaterials.classFullName = "BisCore:RenderMaterialOwnsRenderMaterials";
61
60
  exports.RenderMaterialOwnsRenderMaterials = RenderMaterialOwnsRenderMaterials;
61
+ RenderMaterialOwnsRenderMaterials.classFullName = "BisCore:RenderMaterialOwnsRenderMaterials";
62
62
  /** Relates a parent Element to child Elements which represent **hidden** parts of the Entity.
63
63
  * @public
64
64
  */
@@ -67,8 +67,8 @@ class ElementEncapsulatesElements extends ElementOwnsChildElements {
67
67
  super(parentId, relClassName);
68
68
  }
69
69
  }
70
- ElementEncapsulatesElements.classFullName = "BisCore:ElementEncapsulatesElements";
71
70
  exports.ElementEncapsulatesElements = ElementEncapsulatesElements;
71
+ ElementEncapsulatesElements.classFullName = "BisCore:ElementEncapsulatesElements";
72
72
  /** Relates a parent [[PhysicalElement]] to [[PhysicalElement]] children that it assembles.
73
73
  * @public
74
74
  */
@@ -77,8 +77,8 @@ class PhysicalElementAssemblesElements extends ElementOwnsChildElements {
77
77
  super(parentId, relClassName);
78
78
  }
79
79
  }
80
- PhysicalElementAssemblesElements.classFullName = "BisCore:PhysicalElementAssemblesElements";
81
80
  exports.PhysicalElementAssemblesElements = PhysicalElementAssemblesElements;
81
+ PhysicalElementAssemblesElements.classFullName = "BisCore:PhysicalElementAssemblesElements";
82
82
  /** Relates a parent [[ExternalSource]] to its [[ExternalSourceAttachment]] children.
83
83
  * @note The associated ECClass was added to the BisCore schema in version 1.0.13
84
84
  * @beta
@@ -88,8 +88,8 @@ class ExternalSourceOwnsAttachments extends ElementOwnsChildElements {
88
88
  super(parentId, relClassName);
89
89
  }
90
90
  }
91
- ExternalSourceOwnsAttachments.classFullName = "BisCore:ExternalSourceOwnsAttachments";
92
91
  exports.ExternalSourceOwnsAttachments = ExternalSourceOwnsAttachments;
92
+ ExternalSourceOwnsAttachments.classFullName = "BisCore:ExternalSourceOwnsAttachments";
93
93
  /** Relates a parent [[FolderLink]] to its [[RepositoryLink]] children.
94
94
  * @note The associated ECClass was added to the BisCore schema in version 1.0.13
95
95
  * @beta
@@ -99,8 +99,8 @@ class FolderContainsRepositories extends ElementOwnsChildElements {
99
99
  super(parentId, relClassName);
100
100
  }
101
101
  }
102
- FolderContainsRepositories.classFullName = "BisCore:FolderContainsRepositories";
103
102
  exports.FolderContainsRepositories = FolderContainsRepositories;
103
+ FolderContainsRepositories.classFullName = "BisCore:FolderContainsRepositories";
104
104
  /** Relates a [[GeometricElement2d]] to its [[TypeDefinitionElement]]
105
105
  * @public
106
106
  */
@@ -109,8 +109,8 @@ class GeometricElement2dHasTypeDefinition extends core_common_1.TypeDefinition {
109
109
  super({ id, relClassName });
110
110
  }
111
111
  }
112
- GeometricElement2dHasTypeDefinition.classFullName = "BisCore:GeometricElement2dHasTypeDefinition";
113
112
  exports.GeometricElement2dHasTypeDefinition = GeometricElement2dHasTypeDefinition;
113
+ GeometricElement2dHasTypeDefinition.classFullName = "BisCore:GeometricElement2dHasTypeDefinition";
114
114
  /** Relates a [[GraphicalElement2d]] to its [[GraphicalType2d]]
115
115
  * @public
116
116
  */
@@ -119,8 +119,8 @@ class GraphicalElement2dIsOfType extends GeometricElement2dHasTypeDefinition {
119
119
  super(id, relClassName);
120
120
  }
121
121
  }
122
- GraphicalElement2dIsOfType.classFullName = "BisCore:GraphicalElement2dIsOfType";
123
122
  exports.GraphicalElement2dIsOfType = GraphicalElement2dIsOfType;
123
+ GraphicalElement2dIsOfType.classFullName = "BisCore:GraphicalElement2dIsOfType";
124
124
  /** Relates a [[GeometricElement3d]] to its [[TypeDefinitionElement]]
125
125
  * @public
126
126
  */
@@ -129,8 +129,8 @@ class GeometricElement3dHasTypeDefinition extends core_common_1.TypeDefinition {
129
129
  super({ id, relClassName });
130
130
  }
131
131
  }
132
- GeometricElement3dHasTypeDefinition.classFullName = "BisCore:GeometricElement3dHasTypeDefinition";
133
132
  exports.GeometricElement3dHasTypeDefinition = GeometricElement3dHasTypeDefinition;
133
+ GeometricElement3dHasTypeDefinition.classFullName = "BisCore:GeometricElement3dHasTypeDefinition";
134
134
  /** Relates a [[SpatialLocationElement]] to its [[SpatialLocationType]]
135
135
  * @public
136
136
  */
@@ -139,8 +139,8 @@ class SpatialLocationIsOfType extends GeometricElement3dHasTypeDefinition {
139
139
  super(id, relClassName);
140
140
  }
141
141
  }
142
- SpatialLocationIsOfType.classFullName = "BisCore:SpatialLocationIsOfType";
143
142
  exports.SpatialLocationIsOfType = SpatialLocationIsOfType;
143
+ SpatialLocationIsOfType.classFullName = "BisCore:SpatialLocationIsOfType";
144
144
  /** Relates a [[PhysicalElement]] to its [[PhysicalType]]
145
145
  * @public
146
146
  */
@@ -149,8 +149,8 @@ class PhysicalElementIsOfType extends GeometricElement3dHasTypeDefinition {
149
149
  super(id, relClassName);
150
150
  }
151
151
  }
152
- PhysicalElementIsOfType.classFullName = "BisCore:PhysicalElementIsOfType";
153
152
  exports.PhysicalElementIsOfType = PhysicalElementIsOfType;
153
+ PhysicalElementIsOfType.classFullName = "BisCore:PhysicalElementIsOfType";
154
154
  /** Relates a [[PhysicalElement]] to its [[PhysicalMaterial]]
155
155
  * @public
156
156
  */
@@ -159,8 +159,8 @@ class PhysicalElementIsOfPhysicalMaterial extends core_common_1.RelatedElement {
159
159
  super({ id });
160
160
  }
161
161
  }
162
- PhysicalElementIsOfPhysicalMaterial.classFullName = "BisCore:PhysicalElementIsOfPhysicalMaterial";
163
162
  exports.PhysicalElementIsOfPhysicalMaterial = PhysicalElementIsOfPhysicalMaterial;
163
+ PhysicalElementIsOfPhysicalMaterial.classFullName = "BisCore:PhysicalElementIsOfPhysicalMaterial";
164
164
  /** Relates a [[PhysicalType]] to its [[PhysicalMaterial]]
165
165
  * @public
166
166
  */
@@ -169,8 +169,8 @@ class PhysicalTypeIsOfPhysicalMaterial extends core_common_1.RelatedElement {
169
169
  super({ id });
170
170
  }
171
171
  }
172
- PhysicalTypeIsOfPhysicalMaterial.classFullName = "BisCore:PhysicalTypeIsOfPhysicalMaterial";
173
172
  exports.PhysicalTypeIsOfPhysicalMaterial = PhysicalTypeIsOfPhysicalMaterial;
173
+ PhysicalTypeIsOfPhysicalMaterial.classFullName = "BisCore:PhysicalTypeIsOfPhysicalMaterial";
174
174
  /** Relates an [[Element]] and an [[ElementUniqueAspect]] that it owns.
175
175
  * @public
176
176
  */
@@ -179,8 +179,8 @@ class ElementOwnsUniqueAspect extends core_common_1.RelatedElement {
179
179
  super({ id: elementId, relClassName });
180
180
  }
181
181
  }
182
- ElementOwnsUniqueAspect.classFullName = "BisCore:ElementOwnsUniqueAspect";
183
182
  exports.ElementOwnsUniqueAspect = ElementOwnsUniqueAspect;
183
+ ElementOwnsUniqueAspect.classFullName = "BisCore:ElementOwnsUniqueAspect";
184
184
  /** Relates an [[Element]] and an [[ElementMultiAspect]] that it owns.
185
185
  * @public
186
186
  */
@@ -189,8 +189,8 @@ class ElementOwnsMultiAspects extends core_common_1.RelatedElement {
189
189
  super({ id: elementId, relClassName });
190
190
  }
191
191
  }
192
- ElementOwnsMultiAspects.classFullName = "BisCore:ElementOwnsMultiAspects";
193
192
  exports.ElementOwnsMultiAspects = ElementOwnsMultiAspects;
193
+ ElementOwnsMultiAspects.classFullName = "BisCore:ElementOwnsMultiAspects";
194
194
  /** Relates an [[Element]] and an [[ExternalSourceAspect]] that it owns.
195
195
  * @public
196
196
  */
@@ -199,8 +199,8 @@ class ElementOwnsExternalSourceAspects extends ElementOwnsMultiAspects {
199
199
  super(elementId, relClassName);
200
200
  }
201
201
  }
202
- ElementOwnsExternalSourceAspects.classFullName = "BisCore:ElementOwnsExternalSourceAspects";
203
202
  exports.ElementOwnsExternalSourceAspects = ElementOwnsExternalSourceAspects;
203
+ ElementOwnsExternalSourceAspects.classFullName = "BisCore:ElementOwnsExternalSourceAspects";
204
204
  /** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.
205
205
  * @note The associated ECClass was added to the BisCore schema in version 1.0.13
206
206
  * @beta
@@ -210,8 +210,8 @@ class ExternalSourceIsInRepository extends core_common_1.RelatedElement {
210
210
  super({ id: repositoryId, relClassName });
211
211
  }
212
212
  }
213
- ExternalSourceIsInRepository.classFullName = "BisCore:ExternalSourceIsInRepository";
214
213
  exports.ExternalSourceIsInRepository = ExternalSourceIsInRepository;
214
+ ExternalSourceIsInRepository.classFullName = "BisCore:ExternalSourceIsInRepository";
215
215
  /** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.
216
216
  * @note The associated ECClass was added to the BisCore schema in version 1.0.13
217
217
  * @beta
@@ -221,6 +221,6 @@ class ExternalSourceAttachmentAttachesSource extends core_common_1.RelatedElemen
221
221
  super({ id: externalSourceId, relClassName });
222
222
  }
223
223
  }
224
- ExternalSourceAttachmentAttachesSource.classFullName = "BisCore:ExternalSourceAttachmentAttachesSource";
225
224
  exports.ExternalSourceAttachmentAttachesSource = ExternalSourceAttachmentAttachesSource;
225
+ ExternalSourceAttachmentAttachesSource.classFullName = "BisCore:ExternalSourceAttachmentAttachesSource";
226
226
  //# sourceMappingURL=NavigationRelationship.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationRelationship.js","sourceRoot":"","s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C,CAAC;;AAHa,qCAAa,GAAG,iCAAiC,CAAC;AADrD,0DAAuB;AAOpC;;GAEG;AACH,MAAa,uBAAwB,SAAQ,4BAAc;IAEzD,YAAmB,SAAqB,EAAE,eAAuB,uBAAuB,CAAC,aAAa;QACpG,KAAK,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC;IACzC,CAAC;;AAHa,qCAAa,GAAG,iCAAiC,CAAC;AADrD,0DAAuB;AAOpC;;GAEG;AACH,MAAa,gCAAiC,SAAQ,uBAAuB;IAE3E,YAAmB,SAAqB,EAAE,eAAuB,gCAAgC,CAAC,aAAa;QAC7G,KAAK,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IACjC,CAAC;;AAHsB,8CAAa,GAAG,0CAA0C,CAAC;AADvE,4EAAgC;AAO7C;;;GAGG;AACH,MAAa,4BAA6B,SAAQ,4BAAc;IAE9D,YAAmB,YAAwB,EAAE,eAAuB,4BAA4B,CAAC,aAAa;QAC5G,KAAK,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAC;IAC5C,CAAC;;AAHa,0CAAa,GAAG,sCAAsC,CAAC;AAD1D,oEAA4B;AAOzC;;;GAGG;AACH,MAAa,sCAAuC,SAAQ,4BAAc;IAExE,YAAmB,gBAA4B,EAAE,eAAuB,sCAAsC,CAAC,aAAa;QAC1H,KAAK,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,YAAY,EAAE,CAAC,CAAC;IAChD,CAAC;;AAHa,oDAAa,GAAG,gDAAgD,CAAC;AADpE,wFAAsC","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 Relationships\r\n */\r\n\r\n// NOTE: A NavigationRelationship is not an Entity, so is not registered in the ClassRegistry.\r\n// NOTE: It does, however, have a classFullName property for consistency with Entity subclasses.\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { RelatedElement, TypeDefinition } from \"@itwin/core-common\";\r\n\r\n/** Relates a parent Element to child Elements which represent parts of the Entity modeled by the parent Element.\r\n * @public\r\n */\r\nexport class ElementOwnsChildElements extends RelatedElement {\r\n public static classFullName = \"BisCore:ElementOwnsChildElements\";\r\n public constructor(parentId: Id64String, relClassName: string = ElementOwnsChildElements.classFullName) {\r\n super({ id: parentId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates a parent [[Subject]] to [[Subject]] child elements.\r\n * @public\r\n */\r\nexport class SubjectOwnsSubjects extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:SubjectOwnsSubjects\";\r\n public constructor(parentId: Id64String, relClassName: string = SubjectOwnsSubjects.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[Subject]] to [[InformationPartitionElement]] child elements.\r\n * @public\r\n */\r\nexport class SubjectOwnsPartitionElements extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:SubjectOwnsPartitionElements\";\r\n public constructor(parentId: Id64String, relClassName: string = SubjectOwnsPartitionElements.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[Category]] to [[SubCategory]] child elements.\r\n * @public\r\n */\r\nexport class CategoryOwnsSubCategories extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:CategoryOwnsSubCategories\";\r\n public constructor(parentId: Id64String, relClassName: string = CategoryOwnsSubCategories.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[RenderMaterial]] to [[RenderMaterial]] child elements.\r\n * @public\r\n */\r\nexport class RenderMaterialOwnsRenderMaterials extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:RenderMaterialOwnsRenderMaterials\";\r\n public constructor(parentId: Id64String, relClassName: string = RenderMaterialOwnsRenderMaterials.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent Element to child Elements which represent **hidden** parts of the Entity.\r\n * @public\r\n */\r\nexport class ElementEncapsulatesElements extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:ElementEncapsulatesElements\";\r\n public constructor(parentId: Id64String, relClassName: string = ElementEncapsulatesElements.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[PhysicalElement]] to [[PhysicalElement]] children that it assembles.\r\n * @public\r\n */\r\nexport class PhysicalElementAssemblesElements extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:PhysicalElementAssemblesElements\";\r\n public constructor(parentId: Id64String, relClassName: string = PhysicalElementAssemblesElements.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[ExternalSource]] to its [[ExternalSourceAttachment]] children.\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 ExternalSourceOwnsAttachments extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:ExternalSourceOwnsAttachments\";\r\n public constructor(parentId: Id64String, relClassName: string = ExternalSourceOwnsAttachments.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a parent [[FolderLink]] to its [[RepositoryLink]] children.\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 FolderContainsRepositories extends ElementOwnsChildElements {\r\n public static override classFullName = \"BisCore:FolderContainsRepositories\";\r\n public constructor(parentId: Id64String, relClassName: string = FolderContainsRepositories.classFullName) {\r\n super(parentId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a [[GeometricElement2d]] to its [[TypeDefinitionElement]]\r\n * @public\r\n */\r\nexport class GeometricElement2dHasTypeDefinition extends TypeDefinition {\r\n public static classFullName = \"BisCore:GeometricElement2dHasTypeDefinition\";\r\n public constructor(id: Id64String, relClassName: string = GeometricElement2dHasTypeDefinition.classFullName) {\r\n super({ id, relClassName });\r\n }\r\n}\r\n\r\n/** Relates a [[GraphicalElement2d]] to its [[GraphicalType2d]]\r\n * @public\r\n */\r\nexport class GraphicalElement2dIsOfType extends GeometricElement2dHasTypeDefinition {\r\n public static override classFullName = \"BisCore:GraphicalElement2dIsOfType\";\r\n public constructor(id: Id64String, relClassName: string = GraphicalElement2dIsOfType.classFullName) {\r\n super(id, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a [[GeometricElement3d]] to its [[TypeDefinitionElement]]\r\n * @public\r\n */\r\nexport class GeometricElement3dHasTypeDefinition extends TypeDefinition {\r\n public static classFullName = \"BisCore:GeometricElement3dHasTypeDefinition\";\r\n public constructor(id: Id64String, relClassName: string = GeometricElement3dHasTypeDefinition.classFullName) {\r\n super({ id, relClassName });\r\n }\r\n}\r\n\r\n/** Relates a [[SpatialLocationElement]] to its [[SpatialLocationType]]\r\n * @public\r\n */\r\nexport class SpatialLocationIsOfType extends GeometricElement3dHasTypeDefinition {\r\n public static override classFullName = \"BisCore:SpatialLocationIsOfType\";\r\n public constructor(id: Id64String, relClassName: string = SpatialLocationIsOfType.classFullName) {\r\n super(id, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a [[PhysicalElement]] to its [[PhysicalType]]\r\n * @public\r\n */\r\nexport class PhysicalElementIsOfType extends GeometricElement3dHasTypeDefinition {\r\n public static override classFullName = \"BisCore:PhysicalElementIsOfType\";\r\n public constructor(id: Id64String, relClassName: string = PhysicalElementIsOfType.classFullName) {\r\n super(id, relClassName);\r\n }\r\n}\r\n\r\n/** Relates a [[PhysicalElement]] to its [[PhysicalMaterial]]\r\n * @public\r\n */\r\nexport class PhysicalElementIsOfPhysicalMaterial extends RelatedElement {\r\n public static classFullName = \"BisCore:PhysicalElementIsOfPhysicalMaterial\";\r\n public constructor(id: Id64String) {\r\n super({ id });\r\n }\r\n}\r\n\r\n/** Relates a [[PhysicalType]] to its [[PhysicalMaterial]]\r\n * @public\r\n */\r\nexport class PhysicalTypeIsOfPhysicalMaterial extends RelatedElement {\r\n public static classFullName = \"BisCore:PhysicalTypeIsOfPhysicalMaterial\";\r\n public constructor(id: Id64String) {\r\n super({ id });\r\n }\r\n}\r\n\r\n/** Relates an [[Element]] and an [[ElementUniqueAspect]] that it owns.\r\n * @public\r\n */\r\nexport class ElementOwnsUniqueAspect extends RelatedElement {\r\n public static classFullName = \"BisCore:ElementOwnsUniqueAspect\";\r\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsUniqueAspect.classFullName) {\r\n super({ id: elementId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates an [[Element]] and an [[ElementMultiAspect]] that it owns.\r\n * @public\r\n */\r\nexport class ElementOwnsMultiAspects extends RelatedElement {\r\n public static classFullName = \"BisCore:ElementOwnsMultiAspects\";\r\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsMultiAspects.classFullName) {\r\n super({ id: elementId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates an [[Element]] and an [[ExternalSourceAspect]] that it owns.\r\n * @public\r\n */\r\nexport class ElementOwnsExternalSourceAspects extends ElementOwnsMultiAspects {\r\n public static override classFullName = \"BisCore:ElementOwnsExternalSourceAspects\";\r\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsExternalSourceAspects.classFullName) {\r\n super(elementId, relClassName);\r\n }\r\n}\r\n\r\n/** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.\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 ExternalSourceIsInRepository extends RelatedElement {\r\n public static classFullName = \"BisCore:ExternalSourceIsInRepository\";\r\n public constructor(repositoryId: Id64String, relClassName: string = ExternalSourceIsInRepository.classFullName) {\r\n super({ id: repositoryId, relClassName });\r\n }\r\n}\r\n\r\n/** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.\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 ExternalSourceAttachmentAttachesSource extends RelatedElement {\r\n public static classFullName = \"BisCore:ExternalSourceAttachmentAttachesSource\";\r\n public constructor(externalSourceId: Id64String, relClassName: string = ExternalSourceAttachmentAttachesSource.classFullName) {\r\n super({ id: externalSourceId, relClassName });\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"NavigationRelationship.js","sourceRoot":"","sources":["../../src/NavigationRelationship.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAMH,oDAAoE;AAEpE;;GAEG;AACH,MAAa,wBAAyB,SAAQ,4BAAc;IAE1D,YAAmB,QAAoB,EAAE,eAAuB,wBAAwB,CAAC,aAAa;QACpG,KAAK,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAC;IACxC,CAAC;;AAJH,4DAKC;AAJe,sCAAa,GAAG,kCAAkC,CAAC;AAMnE;;GAEG;AACH,MAAa,mBAAoB,SAAQ,wBAAwB;IAE/D,YAAmB,QAAoB,EAAE,eAAuB,mBAAmB,CAAC,aAAa;QAC/F,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAChC,CAAC;;AAJH,kDAKC;AAJwB,iCAAa,GAAG,6BAA6B,CAAC;AAMvE;;GAEG;AACH,MAAa,4BAA6B,SAAQ,wBAAwB;IAExE,YAAmB,QAAoB,EAAE,eAAuB,4BAA4B,CAAC,aAAa;QACxG,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAChC,CAAC;;AAJH,oEAKC;AAJwB,0CAAa,GAAG,sCAAsC,CAAC;AAMhF;;GAEG;AACH,MAAa,yBAA0B,SAAQ,wBAAwB;IAErE,YAAmB,QAAoB,EAAE,eAAuB,yBAAyB,CAAC,aAAa;QACrG,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAChC,CAAC;;AAJH,8DAKC;AAJwB,uCAAa,GAAG,mCAAmC,CAAC;AAM7E;;GAEG;AACH,MAAa,iCAAkC,SAAQ,wBAAwB;IAE7E,Y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AC;AAM3E;;GAEG;AACH,MAAa,uBAAwB,SAAQ,4BAAc;IAEzD,YAAmB,SAAqB,EAAE,eAAuB,uBAAuB,CAAC,aAAa;QACpG,KAAK,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC;IACzC,CAAC;;AAJH,0DAKC;AAJe,qCAAa,GAAG,iCAAiC,CAAC;AAMlE;;GAEG;AACH,MAAa,uBAAwB,SAAQ,4BAAc;IAEzD,YAAmB,SAAqB,EAAE,eAAuB,uBAAuB,CAAC,aAAa;QACpG,KAAK,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC;IACzC,CAAC;;AAJH,0DAKC;AAJe,qCAAa,GAAG,iCAAiC,CAAC;AAMlE;;GAEG;AACH,MAAa,gCAAiC,SAAQ,uBAAuB;IAE3E,YAAmB,SAAqB,EAAE,eAAuB,gCAAgC,CAAC,aAAa;QAC7G,KAAK,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IACjC,CAAC;;AAJH,4EAKC;AAJwB,8CAAa,GAAG,0CAA0C,CAAC;AAMpF;;;GAGG;AACH,MAAa,4BAA6B,SAAQ,4BAAc;IAE9D,YAAmB,YAAwB,EAAE,eAAuB,4BAA4B,CAAC,aAAa;QAC5G,KAAK,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC,CAAC;IAC5C,CAAC;;AAJH,oEAKC;AAJe,0CAAa,GAAG,sCAAsC,CAAC;AAMvE;;;GAGG;AACH,MAAa,sCAAuC,SAAQ,4BAAc;IAExE,YAAmB,gBAA4B,EAAE,eAAuB,sCAAsC,CAAC,aAAa;QAC1H,KAAK,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,YAAY,EAAE,CAAC,CAAC;IAChD,CAAC;;AAJH,wFAKC;AAJe,oDAAa,GAAG,gDAAgD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Relationships\n */\n\n// NOTE: A NavigationRelationship is not an Entity, so is not registered in the ClassRegistry.\n// NOTE: It does, however, have a classFullName property for consistency with Entity subclasses.\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { RelatedElement, TypeDefinition } from \"@itwin/core-common\";\n\n/** Relates a parent Element to child Elements which represent parts of the Entity modeled by the parent Element.\n * @public\n */\nexport class ElementOwnsChildElements extends RelatedElement {\n public static classFullName = \"BisCore:ElementOwnsChildElements\";\n public constructor(parentId: Id64String, relClassName: string = ElementOwnsChildElements.classFullName) {\n super({ id: parentId, relClassName });\n }\n}\n\n/** Relates a parent [[Subject]] to [[Subject]] child elements.\n * @public\n */\nexport class SubjectOwnsSubjects extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:SubjectOwnsSubjects\";\n public constructor(parentId: Id64String, relClassName: string = SubjectOwnsSubjects.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[Subject]] to [[InformationPartitionElement]] child elements.\n * @public\n */\nexport class SubjectOwnsPartitionElements extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:SubjectOwnsPartitionElements\";\n public constructor(parentId: Id64String, relClassName: string = SubjectOwnsPartitionElements.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[Category]] to [[SubCategory]] child elements.\n * @public\n */\nexport class CategoryOwnsSubCategories extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:CategoryOwnsSubCategories\";\n public constructor(parentId: Id64String, relClassName: string = CategoryOwnsSubCategories.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[RenderMaterial]] to [[RenderMaterial]] child elements.\n * @public\n */\nexport class RenderMaterialOwnsRenderMaterials extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:RenderMaterialOwnsRenderMaterials\";\n public constructor(parentId: Id64String, relClassName: string = RenderMaterialOwnsRenderMaterials.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent Element to child Elements which represent **hidden** parts of the Entity.\n * @public\n */\nexport class ElementEncapsulatesElements extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:ElementEncapsulatesElements\";\n public constructor(parentId: Id64String, relClassName: string = ElementEncapsulatesElements.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[PhysicalElement]] to [[PhysicalElement]] children that it assembles.\n * @public\n */\nexport class PhysicalElementAssemblesElements extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:PhysicalElementAssemblesElements\";\n public constructor(parentId: Id64String, relClassName: string = PhysicalElementAssemblesElements.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[ExternalSource]] to its [[ExternalSourceAttachment]] children.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceOwnsAttachments extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:ExternalSourceOwnsAttachments\";\n public constructor(parentId: Id64String, relClassName: string = ExternalSourceOwnsAttachments.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a parent [[FolderLink]] to its [[RepositoryLink]] children.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class FolderContainsRepositories extends ElementOwnsChildElements {\n public static override classFullName = \"BisCore:FolderContainsRepositories\";\n public constructor(parentId: Id64String, relClassName: string = FolderContainsRepositories.classFullName) {\n super(parentId, relClassName);\n }\n}\n\n/** Relates a [[GeometricElement2d]] to its [[TypeDefinitionElement]]\n * @public\n */\nexport class GeometricElement2dHasTypeDefinition extends TypeDefinition {\n public static classFullName = \"BisCore:GeometricElement2dHasTypeDefinition\";\n public constructor(id: Id64String, relClassName: string = GeometricElement2dHasTypeDefinition.classFullName) {\n super({ id, relClassName });\n }\n}\n\n/** Relates a [[GraphicalElement2d]] to its [[GraphicalType2d]]\n * @public\n */\nexport class GraphicalElement2dIsOfType extends GeometricElement2dHasTypeDefinition {\n public static override classFullName = \"BisCore:GraphicalElement2dIsOfType\";\n public constructor(id: Id64String, relClassName: string = GraphicalElement2dIsOfType.classFullName) {\n super(id, relClassName);\n }\n}\n\n/** Relates a [[GeometricElement3d]] to its [[TypeDefinitionElement]]\n * @public\n */\nexport class GeometricElement3dHasTypeDefinition extends TypeDefinition {\n public static classFullName = \"BisCore:GeometricElement3dHasTypeDefinition\";\n public constructor(id: Id64String, relClassName: string = GeometricElement3dHasTypeDefinition.classFullName) {\n super({ id, relClassName });\n }\n}\n\n/** Relates a [[SpatialLocationElement]] to its [[SpatialLocationType]]\n * @public\n */\nexport class SpatialLocationIsOfType extends GeometricElement3dHasTypeDefinition {\n public static override classFullName = \"BisCore:SpatialLocationIsOfType\";\n public constructor(id: Id64String, relClassName: string = SpatialLocationIsOfType.classFullName) {\n super(id, relClassName);\n }\n}\n\n/** Relates a [[PhysicalElement]] to its [[PhysicalType]]\n * @public\n */\nexport class PhysicalElementIsOfType extends GeometricElement3dHasTypeDefinition {\n public static override classFullName = \"BisCore:PhysicalElementIsOfType\";\n public constructor(id: Id64String, relClassName: string = PhysicalElementIsOfType.classFullName) {\n super(id, relClassName);\n }\n}\n\n/** Relates a [[PhysicalElement]] to its [[PhysicalMaterial]]\n * @public\n */\nexport class PhysicalElementIsOfPhysicalMaterial extends RelatedElement {\n public static classFullName = \"BisCore:PhysicalElementIsOfPhysicalMaterial\";\n public constructor(id: Id64String) {\n super({ id });\n }\n}\n\n/** Relates a [[PhysicalType]] to its [[PhysicalMaterial]]\n * @public\n */\nexport class PhysicalTypeIsOfPhysicalMaterial extends RelatedElement {\n public static classFullName = \"BisCore:PhysicalTypeIsOfPhysicalMaterial\";\n public constructor(id: Id64String) {\n super({ id });\n }\n}\n\n/** Relates an [[Element]] and an [[ElementUniqueAspect]] that it owns.\n * @public\n */\nexport class ElementOwnsUniqueAspect extends RelatedElement {\n public static classFullName = \"BisCore:ElementOwnsUniqueAspect\";\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsUniqueAspect.classFullName) {\n super({ id: elementId, relClassName });\n }\n}\n\n/** Relates an [[Element]] and an [[ElementMultiAspect]] that it owns.\n * @public\n */\nexport class ElementOwnsMultiAspects extends RelatedElement {\n public static classFullName = \"BisCore:ElementOwnsMultiAspects\";\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsMultiAspects.classFullName) {\n super({ id: elementId, relClassName });\n }\n}\n\n/** Relates an [[Element]] and an [[ExternalSourceAspect]] that it owns.\n * @public\n */\nexport class ElementOwnsExternalSourceAspects extends ElementOwnsMultiAspects {\n public static override classFullName = \"BisCore:ElementOwnsExternalSourceAspects\";\n public constructor(elementId: Id64String, relClassName: string = ElementOwnsExternalSourceAspects.classFullName) {\n super(elementId, relClassName);\n }\n}\n\n/** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceIsInRepository extends RelatedElement {\n public static classFullName = \"BisCore:ExternalSourceIsInRepository\";\n public constructor(repositoryId: Id64String, relClassName: string = ExternalSourceIsInRepository.classFullName) {\n super({ id: repositoryId, relClassName });\n }\n}\n\n/** Relates an [[ExternalSource]] to the [[RepositoryLink]] that it is persisted in.\n * @note The associated ECClass was added to the BisCore schema in version 1.0.13\n * @beta\n */\nexport class ExternalSourceAttachmentAttachesSource extends RelatedElement {\n public static classFullName = \"BisCore:ExternalSourceAttachmentAttachesSource\";\n public constructor(externalSourceId: Id64String, relClassName: string = ExternalSourceAttachmentAttachesSource.classFullName) {\n super({ id: externalSourceId, relClassName });\n }\n}\n"]}
@@ -1,6 +1,3 @@
1
- /** @packageDocumentation
2
- * @module Utils
3
- */
4
1
  import { IDisposable } from "@itwin/core-bentley";
5
2
  /** Wrapper around a promise that allows synchronous queries of it's state
6
3
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"PromiseMemoizer.d.ts","sourceRoot":"","sources":["../../src/Prom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